entry.vue 37 KB

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