entry.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092
  1. <template>
  2. <view class="page">
  3. <view class="banner mb-3">
  4. <image src="/static/image/car-insure/carban.png" mode=""></image>
  5. </view>
  6. <view class="carinfo">
  7. <view class="title dis a-c j-s mb-3">
  8. <text>车辆信息</text>
  9. <view class="rounded dis a-c j-c">
  10. <view class="left dis a-c j-c" :class="insuranceType==1? 'active':''" @click="insuranceType=1">
  11. <text>车牌号</text>
  12. </view>
  13. <view class="center"></view>
  14. <view class="right dis a-c j-c" :class="insuranceType==2? 'active':''" @click="insuranceType=2">
  15. <text>行驶证</text>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="carinput" v-show="insuranceType==1">
  20. <view class="top dis a-c j-s mb-3">
  21. <text>车牌号码</text>
  22. <u-switch v-model="checked" active-color="#0052FF" inactive-color="#eee" size='30'
  23. @change="switchChange"></u-switch>
  24. </view>
  25. <view class="btn dis a-c j-s">
  26. <view class="so-plate-word dis a-c j-c" data-index="0" :class="currentInputIndex==0?'actives':''"
  27. @tap="inputSwitch">
  28. <text>{{LicenseInputValue[0]}}</text>
  29. </view>
  30. <view class="so-plate-word dis a-c j-c" data-index="1" :class="currentInputIndex==1?'actives':''"
  31. @tap="inputSwitch">
  32. <text>{{LicenseInputValue[1]}}</text>
  33. </view>
  34. <view class="so-plate-dot"></view>
  35. <view class="so-plate-word dis a-c j-c" data-index="2" :class="currentInputIndex==2?'actives':''"
  36. @tap="inputSwitch">
  37. <text>{{LicenseInputValue[2]}}</text>
  38. </view>
  39. <view class="so-plate-word dis a-c j-c" data-index="3" :class="currentInputIndex==3?'actives':''"
  40. @tap="inputSwitch">
  41. <text>{{LicenseInputValue[3]}}</text>
  42. </view>
  43. <view class="so-plate-word dis a-c j-c" data-index="4" :class="currentInputIndex==4?'actives':''"
  44. @tap="inputSwitch">
  45. <text>{{LicenseInputValue[4]}}</text>
  46. </view>
  47. <view class="so-plate-word dis a-c j-c" data-index="5" :class="currentInputIndex==5?'actives':''"
  48. @tap="inputSwitch">
  49. <text>{{LicenseInputValue[5]}}</text>
  50. </view>
  51. <view class="so-plate-word dis a-c j-c" data-index="6" :class="currentInputIndex==6?'actives':''"
  52. @tap="inputSwitch">
  53. <text>{{LicenseInputValue[6]}}</text>
  54. </view>
  55. <view class="so-plate-word dis a-c j-c" data-index="7" :class="currentInputIndex==7?'newactives':''"
  56. @tap="inputSwitch">
  57. <text v-if="LicenseInputValue[7]">{{LicenseInputValue[7]}}</text>
  58. <view v-else class="newEnergy dis f-c a-c j-c">
  59. <image src="/static/image/car-insure/leaf.png" mode="">
  60. </image>
  61. <text>新能源</text>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <view v-show="insuranceType==2" class="OCRcar">
  67. <view class="title dis j-s a-c">
  68. <text>行驶证识别</text>
  69. <text @click="carSwitching=!carSwitching">{{carSwitching?'手动输入':'拍照识别'}}</text>
  70. </view>
  71. <view v-show="carSwitching" class="ocr mt-2">
  72. <image v-if="!carimg" @tap="ocrIdentify" src="/static/image/car-insure/carbg.png" mode=""
  73. style="width: 100%;height: 198px;">
  74. </image>
  75. <template v-else>
  76. <view v-if=" carimg" class="movable-view dis f-c a-c">
  77. <movable-area>
  78. <movable-view direction="all" out-of-bounds :scale="true">
  79. <image :src="carimg" mode=""
  80. :style="{width:'100%',height:'100%',transform:`rotate(-${cardeg}deg)`}">
  81. </image>
  82. </movable-view>
  83. </movable-area>
  84. <view class="operate-img dis j-s a-c">
  85. <view class="dis a-c" @tap="rotatefront('cardeg')">
  86. <image src="/static/image/car-insure/rotate1.png" mode=""></image>
  87. 左转
  88. </view>
  89. <view class="dis a-c" @tap="ocrIdentify('carInfo')">
  90. <image src="/static/image/car-insure/upload.png" mode=""></image>
  91. 上传
  92. </view>
  93. <view class="dis a-c" @tap="rotateback('cardeg')">
  94. <image src="/static/image/car-insure/rotate2.png" mode=""></image>
  95. 右转
  96. </view>
  97. </view>
  98. </view>
  99. <view class="">
  100. <uni-forms :rules="carRules" :value="carInfo" ref="carForm" validate-trigger="bind"
  101. err-show-type="toast" label-width="100" style="padding: 0 15px;">
  102. <uni-forms-item label="车牌号: ">
  103. <input class="uni-input-input textColor" placeholder="输入车牌号"
  104. v-model="carInfo.licenseNo" placeholder-style="font-size:28upx"
  105. @input="upperCaseType('licenseNo')" />
  106. </uni-forms-item>
  107. <uni-forms-item name="frameNo" required label="车辆识别码:">
  108. <view class="d-flex a-center" style="height: 100%;">
  109. <input class="uni-input-input flex-1 textColor" placeholder="请输入车辆识别码"
  110. v-model="carInfo.frameNo" maxlength="17" placeholder-style="font-size:28upx"
  111. @input="upperCaseType('frameNo')" />
  112. <image src="/static/image/car-insure/search.png" mode=""
  113. style="width: 20px;height: 20px;" @tap="toChooseVin(carInfo.frameNo)">
  114. </image>
  115. </view>
  116. </uni-forms-item>
  117. <uni-forms-item name="modelcname" required label="品牌型号: ">
  118. <view class="d-flex a-center textColor" style="height: 100%;">
  119. <input class="uni-input-input flex-1 textColor" placeholder="请输入品牌型号"
  120. v-model="carInfo.modelcname"
  121. @blur="binddata('modelcname', $event.detail.value,'carForm')"
  122. placeholder-style="font-size:28upx" @input="upperCaseType('modelcname')" />
  123. <image src="/static/image/car-insure/search.png" mode=""
  124. style="width: 20px;height: 20px;"
  125. @tap="toChooseVehicleType(carInfo.modelcname)">
  126. </image>
  127. </view>
  128. </uni-forms-item>
  129. <uni-forms-item name="engineNo" required label="发动机号: ">
  130. <input class="uni-input-input textColor" placeholder="请输入发动机号"
  131. v-model="carInfo.engineNo"
  132. @blur="binddata('engineNo', $event.detail.value,'carForm')"
  133. placeholder-style="font-size:28upx" @input="upperCaseType('engineNo')" />
  134. </uni-forms-item>
  135. <uni-forms-item required label="注册日期" name="registerDate">
  136. <u-input type="select" :custom-style="{textAlign:'right'}"
  137. :select-open="registerDateShow" v-model="carInfo.registerDate"
  138. placeholder="请选择注册日期" @click="registerDateShow = true"
  139. placeholder-style="color:#808080"></u-input>
  140. <u-picker v-model="registerDateShow" mode="time" :params="params"
  141. :end-year="endYear" :end-month="endMonth"
  142. @confirm="e=> Dateconfirm(e,'carInfo','registerDate')"></u-picker>
  143. </uni-forms-item>
  144. <uni-forms-item required label="发证日期" name="issueDate">
  145. <u-input type="select" :custom-style="{textAlign:'right'}"
  146. :select-open="issueDateShow" v-model="carInfo.issueDate" placeholder="请选择发证日期"
  147. @click="issueDateShow = true" placeholder-style="color:#808080"></u-input>
  148. <u-picker v-model="issueDateShow" mode="time" :params="params"
  149. @confirm="e=> Dateconfirm(e,'carInfo','issueDate')"></u-picker>
  150. </uni-forms-item>
  151. <uni-forms-item label="整备质量: " required name="completeKerbMass">
  152. <input class="uni-input-input textColor" placeholder="请输入整备质量"
  153. v-model="carInfo.completeKerbMass" placeholder-style="font-size:28upx" />
  154. </uni-forms-item>
  155. <uni-forms-item label="核定载质量: ">
  156. <input class="uni-input-input textColor" placeholder="请输入核定载质量"
  157. v-model="carInfo.limitLoad" placeholder-style="font-size:28upx" />
  158. </uni-forms-item>
  159. <uni-forms-item label="使用性质: " required name="carnature">
  160. <u-input v-model="carInfo1.carnature" type="select" :select-open="carnatureShow"
  161. @click="carnatureShow = true" :custom-style="{textAlign:'right'}"
  162. placeholder-style="color:#808080" placeholder="请选择使用性质" />
  163. <u-select mode="single-column" :list="natureOfVehicleUseoptions"
  164. v-model="carnatureShow" label-name="dictTag" value-name="dictValue"
  165. @confirm="dictionaryConfirm($event,'carnature')"></u-select>
  166. </uni-forms-item>
  167. <uni-forms-item label="能源种类: " required name="energyType">
  168. <u-input v-model="carInfo1.energyType" type="select" :select-open="energyTypeShow"
  169. @click="energyTypeShow = true" :custom-style="{textAlign:'right'}"
  170. placeholder-style="color:#808080" placeholder="请选择能源种类" />
  171. <u-select mode="single-column" :list="energyTypeoptions" v-model="energyTypeShow"
  172. label-name="dictTag" value-name="dictValue"
  173. @confirm="dictionaryConfirm($event,'energyType')"></u-select>
  174. </uni-forms-item>
  175. <uni-forms-item label="车辆用途: " required name="vehicleUse">
  176. <u-input v-model="carInfo1.vehicleUse" type="select" :select-open="vehicleUseShow"
  177. @click="vehicleUseShow = true" :custom-style="{textAlign:'right'}"
  178. placeholder-style="color:#808080" placeholder="请选择车辆用途" />
  179. <u-select v-if="carInfo.carnature=='01'" mode="single-column"
  180. :list="businessVehicleUseoptions" v-model="vehicleUseShow" label-name="dictTag"
  181. value-name="dictValue"
  182. @confirm="dictionaryConfirm($event,'vehicleUse')"></u-select>
  183. <u-select v-else mode="single-column" :list="outOfBusinessVehicleUseoptions"
  184. v-model="vehicleUseShow" label-name="dictTag" value-name="dictValue"
  185. @confirm="dictionaryConfirm($event,'vehicleUse')"></u-select>
  186. </uni-forms-item>
  187. <uni-forms-item label="车辆类型: " required name="cartype">
  188. <u-input v-model="carInfo1.cartype" type="select" :select-open="cartypeShow"
  189. @click="cartypeShow = true" :custom-style="{textAlign:'right'}"
  190. placeholder-style="color:#808080" placeholder="请选择车辆类型" />
  191. <u-select mode="single-column" :searchShow="true"
  192. :list="trafficManagementVehicleTypeoptions" v-model="cartypeShow"
  193. label-name="dictTag" value-name="dictValue"
  194. @confirm="dictionaryConfirm($event,'cartype')"></u-select>
  195. </uni-forms-item>
  196. <uni-forms-item label="车辆种类: " required name="cimodelclass">
  197. <u-input v-model="carInfo1.cimodelclass" type="select"
  198. :select-open="cimodelclassShow" @click="cimodelclassShow = true"
  199. :custom-style="{textAlign:'right'}" placeholder-style="color:#808080"
  200. placeholder="请选择车辆种类" />
  201. <u-select mode="single-column" :list="vehicleTypeoptions" v-model="cimodelclassShow"
  202. label-name="dictTag" value-name="dictValue"
  203. @confirm="dictionaryConfirm($event,'cimodelclass')"></u-select>
  204. </uni-forms-item>
  205. <uni-forms-item label="年款: ">
  206. <input class="uni-input-input textColor" placeholder="请输入年款"
  207. v-model="carInfo.caryear" placeholder-style="font-size:28upx" />
  208. </uni-forms-item>
  209. <uni-forms-item label="座位数: ">
  210. <input class="uni-input-input textColor" placeholder="请输入座位数"
  211. v-model="carInfo.seatCount" maxlength="1" placeholder-style="font-size:28upx" />
  212. </uni-forms-item>
  213. <uni-forms-item label="排量: ">
  214. <input class="uni-input-input textColor" placeholder="请输入排量"
  215. v-model="carInfo.enginedesc" placeholder-style="font-size:28upx" />
  216. </uni-forms-item>
  217. <uni-forms-item label="功率: ">
  218. <input class="uni-input-input textColor" placeholder="请输入功率"
  219. v-model="carInfo.powerScale" placeholder-style="font-size:28upx" />
  220. </uni-forms-item>
  221. <uni-forms-item label="新车购置价: " required name="purchasePrice">
  222. <input class="uni-input-input textColor" placeholder="请输入新车购置价"
  223. v-model="carInfo.purchasePrice" placeholder-style="font-size:28upx"
  224. @blur="binddata('purchasePrice', $event.detail.value,'carForm')"
  225. @input="upperCaseType('purchasePrice')" />
  226. </uni-forms-item>
  227. <uni-forms-item label="是否过户: ">
  228. <view class="d-flex j-end a-c" style="height:100%">
  229. <u-switch v-model="carInfo.transferFlag" active-color="#0052FF " size="30"
  230. @change="transferFlagchange"></u-switch>
  231. </view>
  232. </uni-forms-item>
  233. <uni-forms-item v-if="carInfo.transferFlag" required label="转移登记日期" name="transferDate">
  234. <u-input type="select" :select-open="transferDateShow"
  235. :custom-style="{textAlign:'right'}" v-model="carInfo.transferDate"
  236. placeholder="请选择过户日期" @click="transferDateShow = true"
  237. placeholder-style="color:#808080"></u-input>
  238. <u-picker v-model="transferDateShow" mode="time" :params="params"
  239. :end-year="endYear" :end-month="endMonth"
  240. @confirm="e=> Dateconfirm(e,'carInfo','transferDate')"></u-picker>
  241. </uni-forms-item>
  242. </uni-forms>
  243. </view>
  244. </template>
  245. </view>
  246. <view v-show="!carSwitching" class="content mt-2">
  247. <uni-forms :rules="carRules" :value="carInfo" ref="carForm" validate-trigger="bind"
  248. style="padding: 0 15px;" err-show-type="toast" label-width="100">
  249. <uni-forms-item label="车牌号: ">
  250. <input class="uni-input-input textColor" placeholder="输入车牌号" v-model="carInfo.licenseNo"
  251. placeholder-style="font-size:28upx" @input="upperCaseType('licenseNo')" />
  252. </uni-forms-item>
  253. <uni-forms-item name="frameNo" required label="车辆识别码:">
  254. <view class="d-flex a-center" style="height: 100%;">
  255. <input class="uni-input-input flex-1 textColor" placeholder="请输入车辆识别码"
  256. v-model="carInfo.frameNo" maxlength="17" placeholder-style="font-size:28upx"
  257. @input="upperCaseType('frameNo')" />
  258. <image src="/static/image/car-insure/search.png" mode=""
  259. style="width: 20px;height: 20px;" @tap="toChooseVin(carInfo.frameNo)">
  260. </image>
  261. </view>
  262. </uni-forms-item>
  263. <uni-forms-item name="modelcname" required label="品牌型号: ">
  264. <view class="d-flex a-center textColor" style="height: 100%;">
  265. <input class="uni-input-input flex-1 textColor" placeholder="请输入品牌型号"
  266. v-model="carInfo.modelcname"
  267. @blur="binddata('modelcname', $event.detail.value,'carForm')"
  268. placeholder-style="font-size:28upx" @input="upperCaseType('modelcname')" />
  269. <image src="/static/image/car-insure/search.png" mode=""
  270. style="width: 20px;height: 20px;" @tap="toChooseVehicleType(carInfo.modelcname)">
  271. </image>
  272. </view>
  273. </uni-forms-item>
  274. <uni-forms-item name="engineNo" required label="发动机号: ">
  275. <input class="uni-input-input textColor" placeholder="请输入发动机号" v-model="carInfo.engineNo"
  276. @blur="binddata('engineNo', $event.detail.value,'carForm')"
  277. placeholder-style="font-size:28upx" @input="upperCaseType('engineNo')" />
  278. </uni-forms-item>
  279. <uni-forms-item required label="注册日期" name="registerDate">
  280. <u-input type="select" :custom-style="{textAlign:'right'}" :select-open="registerDateShow"
  281. v-model="carInfo.registerDate" placeholder="请选择注册日期" @click="registerDateShow = true"
  282. placeholder-style="color:#808080"></u-input>
  283. <u-picker v-model="registerDateShow" mode="time" :params="params" :end-year="endYear"
  284. :end-month="endMonth" @confirm="e=> Dateconfirm(e,'carInfo','registerDate')"></u-picker>
  285. </uni-forms-item>
  286. <uni-forms-item required label="发证日期" name="issueDate">
  287. <u-input type="select" :custom-style="{textAlign:'right'}" :select-open="issueDateShow"
  288. v-model="carInfo.issueDate" placeholder="请选择发证日期" @click="issueDateShow = true"
  289. placeholder-style="color:#808080"></u-input>
  290. <u-picker v-model="issueDateShow" mode="time" :params="params"
  291. @confirm="e=> Dateconfirm(e,'carInfo','issueDate')"></u-picker>
  292. </uni-forms-item>
  293. <uni-forms-item label="整备质量: " required name="completeKerbMass">
  294. <input class="uni-input-input textColor" placeholder="请输入整备质量"
  295. v-model="carInfo.completeKerbMass" placeholder-style="font-size:28upx" />
  296. </uni-forms-item>
  297. <uni-forms-item label="核定载质量: ">
  298. <input class="uni-input-input textColor" placeholder="请输入核定载质量" v-model="carInfo.limitLoad"
  299. placeholder-style="font-size:28upx" />
  300. </uni-forms-item>
  301. <uni-forms-item label="使用性质: " required name="carnature">
  302. <u-input v-model="carInfo1.carnature" type="select" :select-open="carnatureShow"
  303. @click="carnatureShow = true" :custom-style="{textAlign:'right'}"
  304. placeholder-style="color:#808080" placeholder="请选择使用性质" />
  305. <u-select mode="single-column" :list="natureOfVehicleUseoptions" v-model="carnatureShow"
  306. label-name="dictTag" value-name="dictValue"
  307. @confirm="dictionaryConfirm($event,'carnature')"></u-select>
  308. </uni-forms-item>
  309. <uni-forms-item label="能源种类: " required name="energyType">
  310. <u-input v-model="carInfo1.energyType" type="select" :select-open="energyTypeShow"
  311. @click="energyTypeShow = true" :custom-style="{textAlign:'right'}"
  312. placeholder-style="color:#808080" placeholder="请选择能源种类" />
  313. <u-select mode="single-column" :list="energyTypeoptions" v-model="energyTypeShow"
  314. label-name="dictTag" value-name="dictValue"
  315. @confirm="dictionaryConfirm($event,'energyType')"></u-select>
  316. </uni-forms-item>
  317. <uni-forms-item label="车辆用途: " required name="vehicleUse">
  318. <u-input v-model="carInfo1.vehicleUse" type="select" :select-open="vehicleUseShow"
  319. @click="vehicleUseShow = true" :custom-style="{textAlign:'right'}"
  320. placeholder-style="color:#808080" placeholder="请选择车辆用途" />
  321. <u-select v-if="carInfo.carnature=='01'" mode="single-column"
  322. :list="businessVehicleUseoptions" v-model="vehicleUseShow" label-name="dictTag"
  323. value-name="dictValue" @confirm="dictionaryConfirm($event,'vehicleUse')"></u-select>
  324. <u-select v-else mode="single-column" :list="outOfBusinessVehicleUseoptions"
  325. v-model="vehicleUseShow" label-name="dictTag" value-name="dictValue"
  326. @confirm="dictionaryConfirm($event,'vehicleUse')"></u-select>
  327. </uni-forms-item>
  328. <uni-forms-item label="车辆类型: " required name="cartype">
  329. <u-input v-model="carInfo1.cartype" type="select" :select-open="cartypeShow"
  330. @click="cartypeShow = true" :custom-style="{textAlign:'right'}"
  331. placeholder-style="color:#808080" placeholder="请选择车辆类型" />
  332. <u-select mode="single-column" :searchShow="true"
  333. :list="trafficManagementVehicleTypeoptions" v-model="cartypeShow" label-name="dictTag"
  334. value-name="dictValue" @confirm="dictionaryConfirm($event,'cartype')"></u-select>
  335. </uni-forms-item>
  336. <uni-forms-item label="车辆种类: " required name="cimodelclass">
  337. <u-input v-model="carInfo1.cimodelclass" type="select" :select-open="cimodelclassShow"
  338. @click="cimodelclassShow = true" :custom-style="{textAlign:'right'}"
  339. placeholder-style="color:#808080" placeholder="请选择车辆种类" />
  340. <u-select mode="single-column" :list="vehicleTypeoptions" v-model="cimodelclassShow"
  341. label-name="dictTag" value-name="dictValue"
  342. @confirm="dictionaryConfirm($event,'cimodelclass')"></u-select>
  343. </uni-forms-item>
  344. <uni-forms-item label="年款: ">
  345. <input class="uni-input-input textColor" placeholder="请输入年款" v-model="carInfo.caryear"
  346. placeholder-style="font-size:28upx" />
  347. </uni-forms-item>
  348. <uni-forms-item label="座位数: ">
  349. <input class="uni-input-input textColor" maxlength="1" placeholder="请输入座位数"
  350. v-model="carInfo.seatCount" placeholder-style="font-size:28upx" />
  351. </uni-forms-item>
  352. <uni-forms-item label="排量: ">
  353. <input class="uni-input-input textColor" placeholder="请输入排量" v-model="carInfo.enginedesc"
  354. placeholder-style="font-size:28upx" />
  355. </uni-forms-item>
  356. <uni-forms-item label="功率: ">
  357. <input class="uni-input-input textColor" placeholder="请输入功率" v-model="carInfo.powerScale"
  358. placeholder-style="font-size:28upx" />
  359. </uni-forms-item>
  360. <uni-forms-item label="新车购置价: " required name="purchasePrice">
  361. <input class="uni-input-input textColor" placeholder="请输入新车购置价"
  362. v-model="carInfo.purchasePrice" placeholder-style="font-size:28upx"
  363. @blur="binddata('purchasePrice', $event.detail.value,'carForm')"
  364. @input="upperCaseType('purchasePrice')" />
  365. </uni-forms-item>
  366. <uni-forms-item label="是否过户: ">
  367. <view class="d-flex j-end a-c" style="height:100%">
  368. <u-switch v-model="carInfo.transferFlag" active-color="#0052FF " size="30"
  369. @change="transferFlagchange"></u-switch>
  370. </view>
  371. </uni-forms-item>
  372. <uni-forms-item v-if="carInfo.transferFlag" required label="转移登记日期" name="transferDate">
  373. <u-input type="select" :select-open="transferDateShow" v-model="carInfo.transferDate"
  374. placeholder="请选择过户日期" @click="transferDateShow = true"
  375. :custom-style="{textAlign:'right'}" placeholder-style="color:#808080"></u-input>
  376. <u-picker v-model="transferDateShow" mode="time" :params="params" :end-year="endYear"
  377. :end-month="endMonth" @confirm="e=> Dateconfirm(e,'carInfo','transferDate')"></u-picker>
  378. </uni-forms-item>
  379. </uni-forms>
  380. </view>
  381. </view>
  382. </view>
  383. <view class="fixed dis a-c j-c">
  384. <u-button type="warning" class="fiexdbtn" shape="circle" @click="toNext">立即投保</u-button>
  385. </view>
  386. <OCRComponent :showModal='OCRShow' @closePopup="closePopup" :tabslist="tabslist" @tabschange="OCRtabschange"
  387. :tabsCurrent="tabsCurrent" :checkType='checkType' @carCallback="carCallback">
  388. </OCRComponent>
  389. <u-keyboard ref="uKeyboard" mode="car" :keyboardType="keyboardType" v-model="keyboardShow"
  390. @change="keyboardchange" @backspace="backspacesss" @confirm="backsconfirm"></u-keyboard>
  391. <u-toast ref="uToast" />
  392. </view>
  393. </template>
  394. <script>
  395. import OCRComponent from '@/components/modules/carInsure/OCRComponent/OCRComponent.vue'; //引用图片信息检查插件
  396. var dateTime = new Date();
  397. let Year = dateTime.getFullYear();
  398. let Month = Number(dateTime.getMonth() + 1);
  399. export default {
  400. components: {
  401. OCRComponent,
  402. },
  403. data() {
  404. return {
  405. vehicleType: false, //车型查询调用标识
  406. keyboardType: false, //键盘中/英切换标识
  407. endYear: Year,
  408. endMonth: Month,
  409. params: {
  410. year: true, //年
  411. month: true, //月
  412. day: true, //日
  413. hour: false, //时
  414. minute: false, //分
  415. second: false, //秒
  416. },
  417. carRules: {
  418. frameNo: {
  419. rules: [{
  420. required: true,
  421. errorMessage: '请输入车辆识别码',
  422. }, {
  423. pattern: /^([0-9A-Z]){17}$/,
  424. errorMessage: '请输入正确的车辆识别码',
  425. }]
  426. },
  427. modelcname: {
  428. rules: [{
  429. required: true,
  430. errorMessage: '请输入品牌型号',
  431. }, ]
  432. },
  433. engineNo: {
  434. rules: [{
  435. required: true,
  436. errorMessage: '请输入发动机号',
  437. }, ]
  438. },
  439. purchasePrice: {
  440. rules: [{
  441. required: true,
  442. errorMessage: '请输入新车购置价',
  443. }, {
  444. validateField: function(rule, value, data, callback) {
  445. if (value == 0) {
  446. callback('新车购置价不能为零')
  447. }
  448. return true
  449. }
  450. }]
  451. },
  452. completeKerbMass: {
  453. rules: [{
  454. required: true,
  455. errorMessage: '请输入整备质量',
  456. }, ]
  457. },
  458. carnature: {
  459. rules: [{
  460. required: true,
  461. errorMessage: '使用性质必选',
  462. }, ]
  463. },
  464. vehicleUse: {
  465. rules: [{
  466. required: true,
  467. errorMessage: '车辆用途必选',
  468. }, ]
  469. },
  470. registerDate: {
  471. rules: [{
  472. required: true,
  473. errorMessage: '请选择注册日期',
  474. }, {
  475. pattern: /^\d{4}-\d{2}-\d{2}$/,
  476. errorMessage: '注册日期格式错误',
  477. }]
  478. },
  479. issueDate: {
  480. rules: [{
  481. required: true,
  482. errorMessage: '请选择发证日期',
  483. }, {
  484. pattern: /^\d{4}-\d{2}-\d{2}$/,
  485. errorMessage: '发证日期日期格式错误',
  486. }]
  487. }
  488. },
  489. //影像信息
  490. carSwitching: true, //true识别 false录入
  491. keyboardShow: false,
  492. insuranceType: 2,
  493. checked: true,
  494. LicenseInputValue: ['晋', 'A', '', '', '', '', '', ''],
  495. currentInputIndex: 0,
  496. carInfoPositiveList: [], //车辆
  497. //车辆信息
  498. carInfo: {
  499. licenseNo: "", //车牌号
  500. brandName: "", //车辆品牌型号
  501. vinNo: "", //车架号
  502. engineNo: "", //发动机号
  503. modelCode: "", //车型编码
  504. seatCount: "0", //核定载客量 核定载人数
  505. purchasePrice: "", //新车购置价最低,行业实际价值,协商价值
  506. carBrand: "", //车型品牌
  507. ciCarName: "", //行业车型名称
  508. ciModelCode: "", //行业车型编码
  509. completeKerbMass: "", //整备质量
  510. exhaustScale: "", //排量
  511. factory: "", //工厂名称
  512. factoryid: "", //工厂编码
  513. frameNo: "", //车架号
  514. licenseTypeCode: "02", //号牌种类
  515. vehicleclass: "", //车辆类型
  516. familyName: "", //车型
  517. modelcname: "", //车型名称
  518. powertypecode: "", //燃料类型编码
  519. vehicleweight: "", //总质量
  520. limitLoad: "", //核定载质量
  521. caryear: "0", //年款
  522. cimodelclass: "A0", //车辆种类客车A0 货车H0
  523. cartype: "K33", //车辆类型
  524. powertype: "汽油", //燃料类型
  525. energyType: "0", //能源种类
  526. enginedesc: "", //排量
  527. powerScale: "", //功率
  528. registerDate: "", //注册日期
  529. issueDate: "", //发证日期
  530. transferFlag: false, //过户标志
  531. transferFlagBi: false, //商业过户标志
  532. transferDate: "", //过户日期
  533. loanStatus: 0, //贷款标志
  534. firstBeneMan: "", //第一受益人
  535. noLicenseFlag: false, //是否新车
  536. carnature: "02", //使用性质 家庭自用8A 非营业企业8B 非营业党政机关,事业团体8C 非营业货车8D
  537. property: "1", //所属性质 1个人 2企业 3个人
  538. outOfInsurance: false, //脱保
  539. usedCar: false, //二手车
  540. vehicleUse: "05" //车辆用途
  541. },
  542. carInfo1: {
  543. carnature: "非营业",
  544. energyType: "燃油",
  545. vehicleUse: "家庭自用",
  546. cartype: "轿车",
  547. cimodelclass: "客车",
  548. },
  549. registerDateShow: false, //注册日期
  550. issueDateShow: false, //发证日期
  551. transferDateShow: false, //转移登记日期
  552. carnatureShow: false, //使用性质
  553. energyTypeShow: false, //能源种类
  554. vehicleUseShow: false, //车辆用途
  555. cartypeShow: false, //车辆类型
  556. cimodelclassShow: false, //车辆种类
  557. /* 数据字典 */
  558. natureOfVehicleUseoptions: [],
  559. vehicleTypeoptions: [],
  560. trafficManagementVehicleTypeoptions: [],
  561. energyTypeoptions: [],
  562. businessVehicleUseoptions: [],
  563. outOfBusinessVehicleUseoptions: [],
  564. /* 数据字典 */
  565. tabslist: [{
  566. name: '行驶证识别'
  567. }, ],
  568. OCRShow: false,
  569. tabsCurrent: 0,
  570. checkType: "carInfo", //组件类型
  571. carimg: null, //展示图片
  572. cardeg: 0, //旋转角度
  573. }
  574. },
  575. async onLoad() {
  576. this.getDicType("businessVehicleUse"); //车辆用途(营业)
  577. this.getDicType("outOfBusinessVehicleUse"); //车辆用途(非营业)
  578. this.getDicType("natureOfVehicleUse"); //车辆性质
  579. this.getDicType("vehicleType"); //车辆种类
  580. this.getDicType("trafficManagementVehicleType"); //车辆类型
  581. this.getDicType("energyType"); //能源种类
  582. if (this.checked) {
  583. this.LicenseInputValue.forEach((val, index) => {
  584. if (index < 7) {
  585. this.$set(this.LicenseInputValue, index, "*");
  586. }
  587. })
  588. let valueList = this.LicenseInputValue;
  589. const str = valueList.join("")
  590. this.carInfo.licenseNo = str;
  591. } else {
  592. this.LicenseInputValue.forEach((val, index) => {
  593. this.$set(this.LicenseInputValue, index, "");
  594. })
  595. this.carInfo.licenseNo = "";
  596. }
  597. },
  598. watch: {
  599. currentInputIndex(newVal) {
  600. switch (newVal) {
  601. case 0:
  602. this.keyboardType = false;
  603. break;
  604. default:
  605. this.keyboardType = true;
  606. }
  607. }
  608. },
  609. methods: {
  610. rotatefront(int) {
  611. this[int] = this[int] == 270 ? 0 : this[int] + 90;
  612. },
  613. rotateback(int) {
  614. this[int] = this[int] == 0 ? 270 : this[int] - 90;
  615. },
  616. dictionaryConfirm(e, name) {
  617. if (name == 'carnature') {
  618. this.carInfo1['vehicleUse'] = "";
  619. }
  620. this.carInfo[name] = e[0].value;
  621. this.carInfo1[name] = e[0].label;
  622. },
  623. async getDicType(type) {
  624. let res = await this.$http.get('/sysDict/dictDetails/' + type);
  625. if (res.code == 200) {
  626. this[type + 'options'] = res.data.ddList;
  627. // if (type == "trafficManagementVehicleType") {
  628. // this.carInfo1.cartype = this.dictionaryMatching(this.trafficManagementVehicleTypeoptions, this
  629. // .carInfo
  630. // .cartype)
  631. // this.carInfo1.cimodelclass = this.dictionaryMatching(this.vehicleTypeoptions,
  632. // this
  633. // .carInfo
  634. // .cimodelclass)
  635. // }
  636. }
  637. },
  638. //字典name匹配
  639. dictionaryMatching(list, value) {
  640. let obj = list.find(val => val.dictValue == value);
  641. return obj.dictTag;
  642. },
  643. //OC识别返回信息
  644. carCallback(obj) {
  645. this.carimg = obj.img;
  646. this.carInfoPositiveList = obj.ImgList;
  647. Object.assign(this.carInfo, obj.Info);
  648. this.carInfo1.cimodelclass = this.dictionaryMatching(this.vehicleTypeoptions,
  649. this
  650. .carInfo
  651. .cimodelclass)
  652. this.OCRShow = false;
  653. },
  654. upperCaseType(type) {
  655. this.carInfo[type] = this.carInfo[type].toUpperCase();
  656. if (type == 'frameNo') {
  657. this.carInfo.vinNo = this.carInfo.frameNo.trim();
  658. }
  659. },
  660. //
  661. transferFlagchange(status) {
  662. if (status) {
  663. this.carInfo.transferDate = this.carInfo.issueDate;
  664. } else {
  665. this.carInfo.transferDate = ""
  666. }
  667. },
  668. Dateconfirm(e, obj, param) {
  669. this[obj][param] = e.year + '-' + e.month + '-' + e.day;
  670. },
  671. //下一步
  672. toNext() {
  673. console.log(this.vehicleType);
  674. switch (this.insuranceType) {
  675. case 1:
  676. if (!this.carInfo.licenseNo && !this.islicense(this.carInfo.licenseNo)) {
  677. return uni.showToast({
  678. icon: "none",
  679. title: '请填写正确的车牌号码',
  680. duration: 1500
  681. });
  682. }
  683. break;
  684. case 2:
  685. if (!this.carInfo.licenseNo && !this.carimg) {
  686. return uni.showToast({
  687. icon: "none",
  688. title: '请上传资料或录入信息后再投保',
  689. duration: 1500
  690. });
  691. }
  692. this.$refs.carForm.submit().then(res => {
  693. if (this.vehicleType) {
  694. this.navigate({
  695. url: '/pages/carInsure2/Information',
  696. success: (res) => {
  697. res.eventChannel.emit(
  698. "acceptData", {
  699. carInfo: this
  700. .carInfo,
  701. carInfoPositiveList: this
  702. .carInfoPositiveList, //车辆
  703. })
  704. }
  705. }, "navigateTo", true);
  706. } else {
  707. this.$refs.uToast.show({
  708. title: '检测到未精准校验车型,即将跳转到车型界面选择,请等待。。。',
  709. type: 'warning',
  710. icon: false,
  711. })
  712. setTimeout(() => {
  713. this.navigate({
  714. url: '/pages/carInsure2/carType?frameNo=' +
  715. encodeURIComponent(this.carInfo.frameNo) +
  716. '&vehicleType=true'
  717. }, "navigateTo", true);
  718. }, 2000)
  719. }
  720. })
  721. break;
  722. default:
  723. break;
  724. }
  725. },
  726. switchChange(value) {
  727. if (value) {
  728. this.LicenseInputValue.forEach((val, index) => {
  729. if (index < 7) {
  730. this.$set(this.LicenseInputValue, index, "*");
  731. }
  732. })
  733. let valueList = this.LicenseInputValue;
  734. const str = valueList.join("")
  735. this.carInfo.licenseNo = str;
  736. } else {
  737. this.LicenseInputValue.forEach((val, index) => {
  738. this.$set(this.LicenseInputValue, index, "");
  739. })
  740. this.carInfo.licenseNo = "";
  741. }
  742. },
  743. // 通过车架号获取车型
  744. async toChooseVin(cctype) {
  745. this.vehicleType = true;
  746. if (cctype == '' || cctype == null) {
  747. return uni.showToast({
  748. icon: 'none',
  749. title: '请输入车架号',
  750. duration: 1500
  751. });
  752. } else {
  753. if (!this.isFrameno(cctype.trim())) {
  754. return uni.showToast({
  755. title: '请输入正确的车辆识别码',
  756. icon: "none"
  757. });
  758. }
  759. this.navigate({
  760. url: '/pages/carInsure2/carType?frameNo=' + encodeURIComponent(cctype)
  761. }, "navigateTo", true);
  762. }
  763. },
  764. //跳转选择车辆类型页面
  765. toChooseVehicleType(cctype) {
  766. if (cctype == '' || cctype == null) {
  767. uni.showToast({
  768. icon: 'none',
  769. title: '请输入车型名称',
  770. duration: 1500
  771. });
  772. } else {
  773. let cctypeName = cctype.replace(/[^u4e00-u9fa5|,]+/ig, '')
  774. this.navigate({
  775. url: '/pages/carInsure2/carType?modelName=' + encodeURIComponent(cctypeName)
  776. }, "navigateTo", true);
  777. }
  778. },
  779. //验证车牌号
  780. islicense(val) {
  781. let mPattern = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4,5}[A-Z0-9挂学警港澳]{1}$/;
  782. return mPattern.test(val);
  783. },
  784. //验证车架号
  785. isFrameno(str) {
  786. let mPattern = /^([0-9A-Z]){17}$/;
  787. return mPattern.test(str);
  788. },
  789. //OCR识别
  790. ocrIdentify() {
  791. this.OCRShow = !this.OCRShow;
  792. },
  793. closePopup() {
  794. this.OCRShow = false;
  795. },
  796. OCRtabschange(e) {
  797. this.tabsCurrent = e;
  798. },
  799. keyboardchange(val) {
  800. this.$set(this.LicenseInputValue, this.currentInputIndex, val);
  801. if (this.currentInputIndex < 7) {
  802. this.currentInputIndex++;
  803. }
  804. },
  805. backsconfirm() {
  806. let valueList = this.LicenseInputValue;
  807. const str = valueList.join("")
  808. this.carInfo.licenseNo = str;
  809. },
  810. //键盘退格键
  811. backspacesss() {
  812. this.$set(this.LicenseInputValue, this.currentInputIndex, '')
  813. if (this.currentInputIndex != 0) this.currentInputIndex--
  814. },
  815. inputSwitch(e) {
  816. const {
  817. index
  818. } = e.currentTarget.dataset;
  819. this.currentInputIndex = parseInt(index);
  820. this.keyboardShow = true;
  821. console.log(this.currentInputIndex);
  822. },
  823. }
  824. }
  825. </script>
  826. <style lang="scss" scoped>
  827. .uni-forms-item .uni-input-input {
  828. text-align: end;
  829. }
  830. ::v-deep .uni-forms-item {
  831. border-bottom: 1px solid #f2f2f2;
  832. }
  833. ::v-deep .uni-forms-item:last-child {
  834. border: none;
  835. }
  836. page {
  837. height: 100vh;
  838. background: #F8FAFE;
  839. }
  840. .page {
  841. padding: 16px 16px 50px 16px;
  842. }
  843. .banner {
  844. width: 100%;
  845. height: 202px;
  846. image {
  847. width: 100%;
  848. height: 100%;
  849. }
  850. }
  851. .carinfo {
  852. width: 100%;
  853. height: auto;
  854. >.title {
  855. padding: 10px;
  856. border-bottom: 1px solid #f2f2f2;
  857. >text {
  858. font-weight: bold;
  859. font-size: 15px;
  860. }
  861. .rounded {
  862. width: 120px;
  863. height: 28px;
  864. background: #0052FF;
  865. border-radius: 15px;
  866. padding: 1px;
  867. box-sizing: border-box;
  868. position: relative;
  869. .left {
  870. width: 50%;
  871. height: 100%;
  872. background-color: white;
  873. border-top-left-radius: 15px;
  874. border-bottom-left-radius: 15px;
  875. font-size: 24rpx;
  876. color: #0052FF;
  877. }
  878. .right {
  879. width: 50%;
  880. height: 100%;
  881. background-color: #fff;
  882. border-top-right-radius: 15px;
  883. border-bottom-right-radius: 15px;
  884. font-size: 24rpx;
  885. color: #0052FF;
  886. }
  887. .center {
  888. width: 8px;
  889. height: 100%;
  890. background-color: white;
  891. position: absolute;
  892. border-left: 1px solid #0052FF;
  893. border-right: 1px solid #0052FF;
  894. top: 50%;
  895. left: 50%;
  896. transform: translate(-50%, -50%) skewX(-10deg);
  897. }
  898. .active {
  899. background-color: #0052FF;
  900. color: #fff;
  901. }
  902. }
  903. }
  904. .carinput {
  905. width: 100%;
  906. height: auto;
  907. background: #FFFFFF;
  908. box-shadow: 0px 4px 10px 0px #DAE3F4;
  909. border-radius: 12px;
  910. padding: 10px;
  911. .top {
  912. font-weight: bold;
  913. font-size: 15px;
  914. }
  915. .so-plate-word {
  916. width: 40px;
  917. height: 40px;
  918. background-color: #f8f8fa;
  919. border-radius: 5px;
  920. margin: 0 4px;
  921. box-sizing: border-box;
  922. text {
  923. font-size: 18px;
  924. font-weight: bold;
  925. }
  926. .newEnergy {
  927. image {
  928. width: 12px;
  929. height: 12px;
  930. }
  931. text {
  932. font-size: 16rpx;
  933. color: #0eb78e;
  934. }
  935. }
  936. }
  937. .so-plate-dot {
  938. width: 15upx;
  939. height: 15upx;
  940. background: #ccc;
  941. border-radius: 50%;
  942. margin: 0 5upx
  943. }
  944. .actives {
  945. border: 1px solid #0052FF;
  946. background-color: rgba(0, 82, 255, 0.1);
  947. }
  948. .newactives {
  949. border: 1px solid #0eb78e;
  950. background-color: rgba(14, 183, 142, 0.1);
  951. }
  952. }
  953. .OCRcar {
  954. width: 100%;
  955. height: auto;
  956. .title {
  957. color: #FF5600;
  958. text:nth-child(1) {
  959. font-size: 15px;
  960. font-weight: bold;
  961. color: #232832;
  962. }
  963. }
  964. .ocr {
  965. width: 100%;
  966. height: auto;
  967. background-color: white;
  968. box-shadow: 0px 4px 10px 0px #DAE3F4;
  969. border-radius: 12px;
  970. .content {
  971. padding: 0 15px;
  972. }
  973. .movable-view {
  974. .operate-img {
  975. width: 90%;
  976. height: 38px;
  977. background-color: #F9F9F9;
  978. border-radius: 8px;
  979. padding: 10px 25px;
  980. margin-top: 10px;
  981. image {
  982. width: 20px;
  983. height: 20px;
  984. margin-right: 5px;
  985. }
  986. }
  987. }
  988. }
  989. .content {
  990. width: 100%;
  991. height: auto;
  992. background-color: white;
  993. box-shadow: 0px 4px 10px 0px #DAE3F4;
  994. border-radius: 12px;
  995. .input-align-right {
  996. padding: 20px;
  997. }
  998. }
  999. }
  1000. }
  1001. .fixed {
  1002. width: 100%;
  1003. height: 80px;
  1004. padding: 10px;
  1005. position: fixed;
  1006. bottom: 0;
  1007. left: 0;
  1008. right: 0;
  1009. background: white;
  1010. z-index: 9;
  1011. border-top: 1px solid #f2f2f2;
  1012. .fiexdbtn {
  1013. width: 50%;
  1014. background: linear-gradient(to bottom, #FFF9F5, #FCD4C0, #F8A67D);
  1015. color: #FF5600;
  1016. font-weight: bold;
  1017. font-size: 18px;
  1018. border: 1px solid #F8A67D;
  1019. }
  1020. }
  1021. movable-area {
  1022. height: 178px;
  1023. width: 100%;
  1024. border-top-left-radius: 12px;
  1025. border-top-right-radius: 12px;
  1026. background-color: #D8D8D8;
  1027. overflow: hidden;
  1028. }
  1029. movable-view {
  1030. display: flex;
  1031. align-items: center;
  1032. justify-content: center;
  1033. height: 100%;
  1034. width: 100%;
  1035. }
  1036. </style>