carInfo1.vue 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987
  1. <template>
  2. <view class="body">
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <uni-group title="" class="carInfo">
  6. <uni-forms :rules="carRules" :value="carInfo" ref="carForm" validate-trigger="bind" err-show-type="toast"
  7. label-width="100">
  8. <uni-forms-item>
  9. <view class="title d-flex a-center j-sb font-md">
  10. <text class="font-weight">车辆信息</text>
  11. <view class="icon iconfont icon-hangshizhengshibie font-lg main-text-color"
  12. @tap="chooseImage('carInfo',1)" style="margin-right: 14px;"></view>
  13. </view>
  14. </uni-forms-item>
  15. <uni-forms-item label="车牌号: ">
  16. <input class="uni-input-input textColor" placeholder="暂未上牌" v-model="carInfo.licenseNo"
  17. placeholder-style="font-size:28upx" @input="upperCaseType('licenseNo')" />
  18. </uni-forms-item>
  19. <uni-forms-item name="frameNo" required label="车辆识别码:">
  20. <view class="d-flex a-center" style="height: 100%;">
  21. <input class="uni-input-input flex-1 textColor" placeholder="请输入车辆识别码" v-model="carInfo.frameNo"
  22. maxlength="17" placeholder-style="font-size:28upx" @input="upperCaseType('frameNo')" />
  23. <text class="checkButton d-flex a-center j-center" @tap="toChooseVin(carInfo.frameNo)">校验</text>
  24. </view>
  25. </uni-forms-item>
  26. <uni-forms-item name="modelcname" required label="品牌型号: ">
  27. <view class="d-flex a-center textColor" style="height: 100%;">
  28. <input class="uni-input-input flex-1 textColor" placeholder="请输入品牌型号"
  29. v-model="carInfo.modelcname" @blur="binddata('modelcname', $event.detail.value,'carForm')"
  30. placeholder-style="font-size:28upx" @input="upperCaseType('modelcname')" />
  31. <text class="checkButton d-flex a-center j-center"
  32. @tap="toChooseVehicleType(carInfo.modelcname)">校验</text>
  33. </view>
  34. </uni-forms-item>
  35. <uni-forms-item name="engineNo" required label="发动机号: ">
  36. <input class="uni-input-input textColor" placeholder="请输入发动机号" v-model="carInfo.engineNo"
  37. @blur="binddata('engineNo', $event.detail.value,'carForm')" placeholder-style="font-size:28upx"
  38. @input="upperCaseType('engineNo')" />
  39. </uni-forms-item>
  40. <uni-forms-item label="年款: ">
  41. <input class="uni-input-input textColor" placeholder="请输入年款" v-model="carInfo.caryear"
  42. placeholder-style="font-size:28upx" />
  43. </uni-forms-item>
  44. <uni-forms-item label="座位数: ">
  45. <input class="uni-input-input textColor" placeholder="请输入座位数" v-model="carInfo.seatCount"
  46. placeholder-style="font-size:28upx" />
  47. </uni-forms-item>
  48. <uni-forms-item label="排量: ">
  49. <input class="uni-input-input textColor" placeholder="请输入排量" v-model="carInfo.enginedesc"
  50. placeholder-style="font-size:28upx" />
  51. </uni-forms-item>
  52. <uni-forms-item label="功率: ">
  53. <input class="uni-input-input textColor" placeholder="请输入功率" v-model="carInfo.powerScale"
  54. placeholder-style="font-size:28upx" />
  55. </uni-forms-item>
  56. <uni-forms-item label="整备质量: ">
  57. <input class="uni-input-input textColor" placeholder="请输入功率" v-model="carInfo.completeKerbMass"
  58. placeholder-style="font-size:28upx" />
  59. </uni-forms-item>
  60. <uni-forms-item label="新车购置价: " required name="purchasePrice">
  61. <input class="uni-input-input textColor" placeholder="请输入新车购置价" v-model="carInfo.purchasePrice"
  62. placeholder-style="font-size:28upx"
  63. @blur="binddata('purchasePrice', $event.detail.value,'carForm')"
  64. @input="upperCaseType('purchasePrice')" />
  65. </uni-forms-item>
  66. <uni-forms-item required label="使用性质: " required>
  67. <view class="d-flex a-center" style="width:100%;height: 100%;" @click="carnatureshow=true">
  68. <u-select v-model="carnatureshow" mode="single-column" :list="natureOfVehicleUseoptions"
  69. @confirm="dictionaryConfirm($event,'carnature')" label-name="dictTag"
  70. value-name="dictValue"></u-select>
  71. <view class="textColor">{{carInfo1.carnature}}</view>
  72. </view>
  73. </uni-forms-item>
  74. <uni-forms-item label="车辆用途: ">
  75. <view class="d-flex a-center" style="width:100%;height: 100%;" @click="vehicleUseshow=true">
  76. <u-select v-if="carInfo.carnature=='01'" v-model="vehicleUseshow" mode="single-column"
  77. :list="businessVehicleUseoptions" @confirm="dictionaryConfirm($event,'vehicleUse')"
  78. label-name="dictTag" value-name="dictValue"></u-select>
  79. <u-select v-if="carInfo.carnature=='02'" v-model="vehicleUseshow" mode="single-column"
  80. :list="outOfBusinessVehicleUseoptions" @confirm="dictionaryConfirm($event,'vehicleUse')"
  81. label-name="dictTag" value-name="dictValue"></u-select>
  82. <view class="textColor">{{carInfo1.vehicleUse}}</view>
  83. </view>
  84. </uni-forms-item>
  85. <uni-forms-item label="车辆类型: " required>
  86. <view class="d-flex a-center" style="width:100%;height: 100%;" @click="cartypeshow=true">
  87. <u-select v-model="cartypeshow" mode="single-column" :searchShow="true"
  88. :list="trafficManagementVehicleTypeoptions" @confirm="dictionaryConfirm($event,'cartype')"
  89. label-name="dictTag" value-name="dictValue"></u-select>
  90. <view class="textColor">{{carInfo1.cartype}}</view>
  91. </view>
  92. </uni-forms-item>
  93. <uni-forms-item label="车辆种类:" required>
  94. <view class="d-flex a-center" style="width:100%;height: 100%;" @click="cimodelclassshow=true">
  95. <u-select v-model="cimodelclassshow" mode="single-column" :list="vehicleTypeoptions"
  96. @confirm="dictionaryConfirm($event,'cimodelclass')" label-name="dictTag"
  97. value-name="dictValue"></u-select>
  98. <view class="textColor">{{carInfo1.cimodelclass}}</view>
  99. </view>
  100. </uni-forms-item>
  101. <uni-forms-item label="能源种类: " required name="energyType">
  102. <view class="d-flex a-center" style="width:100%;height: 100%;" @click="energyTypeshow=true">
  103. <u-select v-model="energyTypeshow" mode="single-column" :list="energyTypeoptions"
  104. @confirm="dictionaryConfirm($event,'energyType')" label-name="dictTag"
  105. value-name="dictValue"></u-select>
  106. <view class="textColor">{{carInfo1.energyType}}</view>
  107. </view>
  108. </uni-forms-item>
  109. <uni-forms-item required label="注册日期" name="registerDate" style="margin-right: 14px;">
  110. <u-input type="select" :select-open="registerDateShow" v-model="carInfo.registerDate"
  111. placeholder="请选择注册日期" @click="registerDateShow = true"
  112. placeholder-style="color:#808080"></u-input>
  113. <u-picker v-model="registerDateShow" mode="time" :params="params" :end-year="endYear"
  114. :end-month="endMonth" @confirm="e=> Dateconfirm(e,'carInfo','registerDate')"></u-picker>
  115. </uni-forms-item>
  116. <uni-forms-item required label="发证日期" name="issueDate" style="margin-right: 14px;">
  117. <u-input type="select" :select-open="issueDateShow" v-model="carInfo.issueDate"
  118. placeholder="请选择发证日期" @click="issueDateShow = true" placeholder-style="color:#808080"></u-input>
  119. <u-picker v-model="issueDateShow" mode="time" :params="params"
  120. @confirm="e=> Dateconfirm(e,'carInfo','issueDate')"></u-picker>
  121. </uni-forms-item>
  122. <uni-forms-item v-if="carInfo.transferFlag" required label="转移登记日期" name="transferDate"
  123. style="margin-right: 14px;">
  124. <u-input type="select" :select-open="transferDateShow" v-model="carInfo.transferDate"
  125. placeholder="请选择过户日期" @click="transferDateShow = true"
  126. placeholder-style="color:#808080"></u-input>
  127. <u-picker v-model="transferDateShow" mode="time" :params="params" :end-year="endYear"
  128. :end-month="endMonth" @confirm="e=> Dateconfirm(e,'carInfo','transferDate')"></u-picker>
  129. </uni-forms-item>
  130. <uni-forms-item required label="是否过户: ">
  131. <view class="d-flex j-end a-c" style="height:100%">
  132. <u-switch v-model="carInfo.transferFlag" active-color="#ea552d " size="30"
  133. style="margin-right: 15px;" @change="transferFlagchange"></u-switch>
  134. </view>
  135. </uni-forms-item>
  136. <uni-forms-item required label="商业险过户: ">
  137. <view class="d-flex j-end a-c" style="height:100%">
  138. <u-switch v-model="carInfo.transferFlagBi" active-color="#ea552d " size="30"
  139. style="margin-right: 15px;"></u-switch>
  140. </view>
  141. </uni-forms-item>
  142. <uni-forms-item required label="是否脱保: ">
  143. <view class="d-flex j-end a-c" style="height:100%">
  144. <u-switch v-model="carInfo.outOfInsurance" active-color="#ea552d " size="30"
  145. style="margin-right: 15px;"></u-switch>
  146. </view>
  147. </uni-forms-item>
  148. <uni-forms-item required label="是否二手车: ">
  149. <view class="d-flex j-end a-c" style="height:100%">
  150. <u-switch v-model="carInfo.secondhandcarflag" active-color="#ea552d " size="30"
  151. style="margin-right: 15px;"></u-switch>
  152. </view>
  153. </uni-forms-item>
  154. </uni-forms>
  155. </uni-group>
  156. <uni-group title="" top="10">
  157. <uni-forms :rules="ownerRules" :value="ownerInfo" ref="ownerForm" validate-trigger="bind"
  158. err-show-type="toast" label-width="100">
  159. <uni-forms-item>
  160. <view class="title d-flex a-center j-sb font-md">
  161. <text class="font-weight">车主</text>
  162. <view class="icon iconfont icon-shenfenzhengshibie font-lg main-text-color"
  163. @tap="chooseImage('ownerInfo',2)" style="margin-right: 14px;"></view>
  164. </view>
  165. </uni-forms-item>
  166. <uni-forms-item name="name" required label="姓名: ">
  167. <input class="uni-input-input textColor" placeholder="请输入姓名" v-model="ownerInfo.name" maxlength="5"
  168. placeholder-style="font-size:28upx" />
  169. </uni-forms-item>
  170. <uni-forms-item name="identifyType" required label="证件类型:">
  171. <view class="d-flex a-center" style="width:100%;height: 100%;">
  172. <picker disabled class="d-flex a-center" style="width:100%;height: 100%;" mode="selector"
  173. range-key="label" :range="identifyList" v-model="ownerIdentifyIndex"
  174. @change="bindIdentifyTypeChange($event,'owner')">
  175. <view class="textColor">{{identifyList[ownerIdentifyIndex]['label']}}</view>
  176. </picker>
  177. </view>
  178. </uni-forms-item>
  179. <uni-forms-item required name="identifyNumber" label="证件号: ">
  180. <input class="uni-input-input textColor" placeholder="请输入证件号" v-model="ownerInfo.identifyNumber"
  181. maxlength="18" @blur="binddata('identifyNumber', $event.detail.value,'ownerInfo')"
  182. placeholder-style="font-size:28upx" />
  183. </uni-forms-item>
  184. <uni-forms-item required name="age" label="年龄: ">
  185. <input class="uni-input-input textColor" disabled placeholder="请输入年龄" v-model="ownerInfo.age"
  186. maxlength="18" placeholder-style="font-size:28upx" />
  187. </uni-forms-item>
  188. <uni-forms-item name="gender" required label="性别:">
  189. <view class="d-flex a-center" style="width:100%;height: 100%;">
  190. <picker class="d-flex a-center" style="width:100%;height: 100%;" mode="selector"
  191. range-key="label" :range="genderList" v-model="ownerGenderIndex"
  192. @change="bindGenderChange($event,'owner')">
  193. <view class="textColor">{{ownerInfo.gender}}</view>
  194. </picker>
  195. </view>
  196. </uni-forms-item>
  197. <uni-forms-item required name="mobile" label="手机号: ">
  198. <input class="uni-input-input textColor" placeholder="请输入手机号" v-model="ownerInfo.mobile"
  199. maxlength="11" placeholder-style="font-size:28upx" />
  200. </uni-forms-item>
  201. <uni-forms-item required name="addr" label="地址: " style="margin-right: 14px;">
  202. <textarea class="textColor" v-model="ownerInfo.addr"
  203. style="width:100%;line-height: 50upx;margin-top: 15upx;" placeholder-style="font-size:28upx;"
  204. placeholder="请输入地址" auto-height />
  205. </uni-forms-item>
  206. <uni-forms-item name="email" label="邮箱: ">
  207. <input class="uni-input-input textColor" placeholder="请输入邮箱" v-model="ownerInfo.email"
  208. placeholder-style="font-size:28upx" />
  209. </uni-forms-item>
  210. <uni-forms-item required label="有效期起期" name="identifyValidDate" style="margin-right: 14px;">
  211. <u-input type="select" :select-open="ownerDateShow" v-model="ownerInfo.identifyValidDate"
  212. placeholder="请选择有效期起期" @click="ownerDateShow = true"
  213. placeholder-style="color:#808080"></u-input>
  214. <u-picker v-model="ownerDateShow" mode="time" :params="params"
  215. @confirm="e=> Dateconfirm(e,'ownerInfo','identifyValidDate')"></u-picker>
  216. </uni-forms-item>
  217. <uni-forms-item required label="有效期止期" name="identifyValidEndDate">
  218. <view class="dis j-s a-c">
  219. <u-input type="select" :select-open="ownerEndDateShow" v-model="ownerInfo.identifyValidEndDate"
  220. placeholder="请选择有效期止期" @click="ownerEndDateShow = true" placeholder-style="color:#808080"
  221. style="margin-right: 14px;"></u-input>
  222. <view class=" dis j-c a-c ">
  223. <text>长期</text>
  224. <switch style="transform: scale(0.6)"
  225. @change="checked=> insureLongterm(checked,'ownerInfo')" />
  226. </view>
  227. </view>
  228. <u-picker v-model="ownerEndDateShow" mode="time" :params="params"
  229. @confirm="e=> Dateconfirm(e,'ownerInfo','identifyValidEndDate')"></u-picker>
  230. </uni-forms-item>
  231. </uni-forms>
  232. </uni-group>
  233. <uni-group title="" top="10">
  234. <uni-forms :rules="policyHolderRules" :value="policyHolderInfo" ref="policyHolderForm"
  235. validate-trigger="bind" err-show-type="toast" label-width="100">
  236. <uni-forms-item>
  237. <view class="title d-flex a-center j-sb font-md">
  238. <text class="font-weight">投保人</text>
  239. <view class="d-flex a-center j-sb">
  240. <switch style="transform: scale(0.6);" :checked="holderAndOwner"
  241. @change="e=>syncPersonInfo(e,'holderAndOwner','policyHolder','owner')" />
  242. <text style="margin-right: 10px;">同车主</text>
  243. <view class="icon iconfont icon-shenfenzhengshibie font-lg main-text-color"
  244. @tap="chooseImage('policyHolderInfo',3)" style="margin-right: 14px;"></view>
  245. </view>
  246. </view>
  247. </uni-forms-item>
  248. <template v-if="!holderAndOwner">
  249. <uni-forms-item name="name" required label="姓名: ">
  250. <input class="uni-input-input textColor" placeholder="请输入姓名" v-model="policyHolderInfo.name"
  251. maxlength="5" @blur="binddata('name', $event.detail.value,'policyHolderForm')"
  252. placeholder-style="font-size:28upx" />
  253. </uni-forms-item>
  254. <uni-forms-item name="identifyType" required label="证件类型: ">
  255. <view class="d-flex a-center" style="width:100%;height: 100%;">
  256. <picker disabled class="d-flex a-center" style="width:100%;height: 100%;" mode="selector"
  257. range-key="label" :range="identifyList" v-model="policyHolderIdentifyIndex"
  258. @change="bindIdentifyTypeChange($event,'policyHolder')">
  259. <view class="textColor">{{identifyList[policyHolderIdentifyIndex]['label']}}</view>
  260. </picker>
  261. </view>
  262. </uni-forms-item>
  263. <uni-forms-item required name="identifyNumber" label="证件号: ">
  264. <input class="uni-input-input textColor" placeholder="请输入证件号"
  265. v-model="policyHolderInfo.identifyNumber" maxlength="18"
  266. @blur="binddata('identifyNumber', $event.detail.value,'policyHolderInfo')"
  267. placeholder-style="font-size:28upx" />
  268. </uni-forms-item>
  269. <uni-forms-item required name="age" label="年龄: ">
  270. <input class="uni-input-input textColor" disabled placeholder="请输入年龄"
  271. v-model="policyHolderInfo.age" maxlength="18" placeholder-style="font-size:28upx" />
  272. </uni-forms-item>
  273. <uni-forms-item name="gender" required label="性别:">
  274. <view class="d-flex a-center" style="width:100%;height: 100%;">
  275. <picker class="d-flex a-center" style="width:100%;height: 100%;" mode="selector"
  276. range-key="label" :range="genderList" v-model="policyHolderGenderIndex"
  277. @change="bindGenderChange($event,'policyHolder')">
  278. <view class="textColor">{{policyHolderInfo.gender}}</view>
  279. </picker>
  280. </view>
  281. </uni-forms-item>
  282. <uni-forms-item required name="mobile" label="手机号: ">
  283. <input class="uni-input-input textColor" placeholder="请输入手机号" v-model="policyHolderInfo.mobile"
  284. maxlength="11" @blur="binddata('mobile', $event.detail.value,'policyHolderForm')"
  285. placeholder-style="font-size:28upx" />
  286. </uni-forms-item>
  287. <uni-forms-item required name="addr" label="地址: ">
  288. <textarea class="textColor" v-model="policyHolderInfo.addr"
  289. style="width:100%;line-height: 50upx;margin-top: 15upx;"
  290. placeholder-style="font-size:28upx;" placeholder="请输入地址" auto-height
  291. @blur="binddata('addr', $event.detail.value,'policyHolderForm')" />
  292. </uni-forms-item>
  293. <uni-forms-item name="email" label="邮箱: ">
  294. <input class="uni-input-input textColor" placeholder="请输入邮箱" v-model="policyHolderInfo.email"
  295. placeholder-style="font-size:28upx" />
  296. </uni-forms-item>
  297. <uni-forms-item required label="有效期起期" name="identifyValidDate" style="margin-right: 14px;">
  298. <u-input type="select" :select-open="policyHolderDateShow"
  299. v-model="policyHolderInfo.identifyValidDate" placeholder="请选择有效期起期"
  300. @click="policyHolderDateShow = true" placeholder-style="color:#808080"></u-input>
  301. <u-picker v-model="policyHolderDateShow" mode="time" :params="params"
  302. @confirm="e=> Dateconfirm(e,'policyHolderInfo','identifyValidDate')"></u-picker>
  303. </uni-forms-item>
  304. <uni-forms-item required label="有效期止期" name="identifyValidEndDate">
  305. <view class="dis j-s a-c">
  306. <u-input type="select" :select-open="policyHolderEndDateShow"
  307. v-model="policyHolderInfo.identifyValidEndDate" placeholder="请选择有效期止期"
  308. @click="policyHolderEndDateShow = true" placeholder-style="color:#808080"
  309. style="margin-right: 14px;"></u-input>
  310. <view class=" dis j-c a-c ">
  311. <text>长期</text>
  312. <switch style="transform: scale(0.6)"
  313. @change="checked=>insureLongterm(checked,'policyHolderInfo')" />
  314. </view>
  315. </view>
  316. <u-picker v-model="policyHolderEndDateShow" mode="time" :params="params"
  317. @confirm="e=> Dateconfirm(e,'policyHolderInfo','identifyValidEndDate')"></u-picker>
  318. </uni-forms-item>
  319. </template>
  320. </uni-forms>
  321. </uni-group>
  322. <uni-group title="" top="10">
  323. <uni-forms :rules="insuredPersonRules" :value="insuredPersonInfo" ref="insuredPersonForm"
  324. validate-trigger="bind" err-show-type="toast" label-width="100">
  325. <uni-forms-item>
  326. <view class="title d-flex a-center j-sb font-md">
  327. <text class="font-weight">被保人</text>
  328. <view class="d-flex a-center j-sb">
  329. <view class="d-flex a-center j-sb">
  330. <switch style="transform: scale(0.6);" :checked="tbrAndOwner"
  331. @change="e=>syncPersonInfo(e,'tbrAndOwner','insuredPerson','policyHolder','insuredAndOwner')" />
  332. <text style="margin-right: 10px;">同投保人</text>
  333. </view>
  334. <view class="d-flex a-center j-sb" v>
  335. <switch style="transform: scale(0.6);" :checked="insuredAndOwner"
  336. @change="e=>syncPersonInfo(e,'insuredAndOwner','insuredPerson','owner','tbrAndOwner')" />
  337. <text style="margin-right: 10px;">同车主</text>
  338. </view>
  339. <view class="icon iconfont icon-shenfenzhengshibie font-lg main-text-color"
  340. @tap="chooseImage('insuredPersonInfo',4)" style="margin-right: 14px;"></view>
  341. </view>
  342. </view>
  343. </uni-forms-item>
  344. <template v-if="!insuredAndOwner && !tbrAndOwner">
  345. <uni-forms-item name="name" required label="姓名: ">
  346. <input class="uni-input-input textColor" placeholder="请输入姓名" v-model="insuredPersonInfo.name"
  347. maxlength="5" @blur="binddata('name', $event.detail.value,'insuredPersonForm')"
  348. placeholder-style="font-size:28upx" />
  349. </uni-forms-item>
  350. <uni-forms-item name="identifyType" required label="证件类型: ">
  351. <view class="d-flex a-center" style="width:100%;height: 100%;">
  352. <picker disabled class="d-flex a-center" style="width:100%;height: 100%;" mode="selector"
  353. range-key="label" :range="identifyList" v-model="insuredPersonIdentifyIndex"
  354. @change="bindIdentifyTypeChange($event,'insuredPerson')">
  355. <view class="textColor">{{identifyList[insuredPersonIdentifyIndex]['label']}}</view>
  356. </picker>
  357. </view>
  358. </uni-forms-item>
  359. <uni-forms-item required name="identifyNumber" label="证件号: ">
  360. <input class="uni-input-input textColor" placeholder="请输入证件号"
  361. v-model="insuredPersonInfo.identifyNumber" maxlength="18"
  362. @blur="binddata('identifyNumber', $event.detail.value,'insuredPersonInfo')"
  363. placeholder-style="font-size:28upx" />
  364. </uni-forms-item>
  365. <uni-forms-item required name="age" label="年龄: ">
  366. <input class="uni-input-input textColor" disabled placeholder="请输入年龄"
  367. v-model="insuredPersonInfo.age" maxlength="18" placeholder-style="font-size:28upx" />
  368. </uni-forms-item>
  369. <uni-forms-item name="gender" required label="性别:">
  370. <view class="d-flex a-center" style="width:100%;height: 100%;">
  371. <picker class="d-flex a-center" style="width:100%;height: 100%;" mode="selector"
  372. range-key="label" :range="genderList" v-model="insuredPersonGenderIndex"
  373. @change="bindGenderChange($event,'insuredPerson')">
  374. <view class="textColor">{{insuredPersonInfo.gender}}</view>
  375. </picker>
  376. </view>
  377. </uni-forms-item>
  378. <uni-forms-item required name="mobile" label="手机号: ">
  379. <input class="uni-input-input textColor" placeholder="请输入手机号" v-model="insuredPersonInfo.mobile"
  380. maxlength="11" @blur="binddata('mobile', $event.detail.value,'insuredPersonForm')"
  381. placeholder-style="font-size:28upx" />
  382. </uni-forms-item>
  383. <uni-forms-item required name="addr" label="地址: ">
  384. <textarea class="textColor" v-model="insuredPersonInfo.addr"
  385. style="width:100%;line-height: 50upx;margin-top: 15upx;"
  386. placeholder-style="font-size:28upx;" placeholder="请输入地址" auto-height
  387. @blur="binddata('addr', $event.detail.value,'insuredPersonForm')" />
  388. </uni-forms-item>
  389. <uni-forms-item name="email" label="邮箱: ">
  390. <input class="uni-input-input textColor" placeholder="请输入邮箱" v-model="insuredPersonInfo.email"
  391. placeholder-style="font-size:28upx" />
  392. </uni-forms-item>
  393. <uni-forms-item required label="有效期起期" name="identifyValidDate" style="margin-right: 14px;">
  394. <u-input type="select" :select-open="insuredPersonDateShow"
  395. v-model="insuredPersonInfo.identifyValidDate" placeholder="请选择有效期起期"
  396. @click="insuredPersonDateShow = true" placeholder-style="color:#808080"></u-input>
  397. <u-picker v-model="insuredPersonDateShow" mode="time" :params="params"
  398. @confirm="e=> Dateconfirm(e,'insuredPersonInfo','identifyValidDate')"></u-picker>
  399. </uni-forms-item>
  400. <uni-forms-item required label="有效期止期" name="identifyValidEndDate">
  401. <view class="dis j-s a-c">
  402. <u-input type="select" :select-open="insuredPersonEndDateShow"
  403. v-model="insuredPersonInfo.identifyValidEndDate" placeholder="请选择有效期止期"
  404. @click="insuredPersonEndDateShow = true" placeholder-style="color:#808080"
  405. style="margin-right: 14px;"></u-input>
  406. <view class=" dis j-c a-c ">
  407. <text>长期</text>
  408. <switch style="transform: scale(0.6)"
  409. @change="checked=>insureLongterm(checked,'insuredPersonInfo')" />
  410. </view>
  411. </view>
  412. <u-picker v-model="insuredPersonEndDateShow" mode="time" :params="params"
  413. @confirm="e=> Dateconfirm(e,'insuredPersonInfo','identifyValidEndDate')"></u-picker>
  414. </uni-forms-item>
  415. </template>
  416. </uni-forms>
  417. </uni-group>
  418. <view style="height: 160upx;"></view>
  419. <view class="infoBottom d-flex a-center j-center j-sb">
  420. <button type="default" class="d-flex a-center j-center" @tap="toNext">下一步</button>
  421. </view>
  422. <view class="mask mask-show" v-if="lodingshow">
  423. <!-- 加载动画开始 -->
  424. <view class="preloader">
  425. <view class="loader"></view>
  426. </view>
  427. <!-- 加载动画结束 -->
  428. <view class="title">加载中...</view>
  429. </view>
  430. <u-popup v-model="ImageOcrShow" mode="center" width="90%" border-radius="10" @close="ImagePopClose">
  431. <view class="popContent dis f-c a-c j-s">
  432. <view class="popHeader ">信息校验</view>
  433. <view v-if="checkType=='carInfo'" class="" style="padding: 4px 10px;width: 100%;">
  434. <view class="imgOcr dis j-s a-c">
  435. <view class="imgOcr-border">
  436. <u-icon v-if="carfrontImg" class="del_btn" name="close-circle-fill" style="font-size: 20px;"
  437. color="rgb(247, 247, 247)" @click="del_btn('carfrontImg')"></u-icon>
  438. <image class="obverseimg" :src="carfrontImg?carfrontImg:'/static/carfront.png'"
  439. @click="carfrontChange" mode="">
  440. </view>
  441. <view class="imgOcr-border">
  442. <u-icon v-if="carbackImg" class="del_btn" name="close-circle-fill" style="font-size: 20px;"
  443. color="rgb(247, 247, 247)" @click="del_btn('carbackImg')"></u-icon>
  444. <image class="obverseimg" :src="carbackImg?carbackImg:'/static/carback.png'"
  445. @click="carbackChange" mode="">
  446. </view>
  447. </view>
  448. <view class="line dis j-s a-c" style="margin-top: 10px;">
  449. <text>车主</text>
  450. <u-input v-model="carfront.carOwner" placeholder="请输入车主" />
  451. </view>
  452. <view class="line dis j-s a-c">
  453. <text>车牌号</text>
  454. <u-input v-model="carfront.licenseNo" placeholder="请输入车牌号" />
  455. </view>
  456. <view class="line dis j-s a-c">
  457. <text>发动机号</text>
  458. <u-input v-model="carfront.engineNo" placeholder="请输入发动机号" />
  459. </view>
  460. <view class="line dis j-s a-c">
  461. <text>车架号</text>
  462. <u-input v-model="carfront.vinNo" placeholder="请输入车架号" />
  463. </view>
  464. <view class="line dis j-s a-c">
  465. <text>注册日期</text>
  466. <u-input v-model="carfront.registerDate" placeholder="请输入注册日期" />
  467. </view>
  468. <view class="line dis j-s a-c">
  469. <text>发证日期</text>
  470. <u-input v-model="carfront.issueDate" placeholder="请输入发证日期" />
  471. </view>
  472. </view>
  473. <view v-else class="" style="padding: 4px 10px;width: 100%;">
  474. <view class="imgOcr dis j-s a-c">
  475. <view class="imgOcr-border">
  476. <u-icon v-if="userfrontImg" class="del_btn" name="close-circle-fill"
  477. style="font-size: 20px;" color="rgb(247, 247, 247)"
  478. @click="del_btn('userfrontImg')"></u-icon>
  479. <image class="obverseimg" :src="userfrontImg?userfrontImg:'/static/userfront.png'"
  480. @click="userfrontChange" mode="">
  481. </view>
  482. <view class="imgOcr-border">
  483. <u-icon v-if="userbackImg" class="del_btn" name="close-circle-fill" style="font-size: 20px;"
  484. color="rgb(247, 247, 247)" @click="del_btn('userbackImg')"></u-icon>
  485. <image class="obverseimg" :src="userbackImg?userbackImg:'/static/userback.png'"
  486. @click="userbackChange" mode="">
  487. </view>
  488. </view>
  489. <view class="line dis j-s a-c" style="margin-top: 10px;">
  490. <text>姓名</text>
  491. <u-input v-model="userfront.name" placeholder="请输入姓名" />
  492. </view>
  493. <view class="line dis j-s a-c">
  494. <text>证件号</text>
  495. <u-input v-model="userfront.identifyNumber" placeholder="请输入证件号" />
  496. </view>
  497. <view class="line dis j-s a-c">
  498. <text>地址</text>
  499. <u-input v-model="userfront.addr" placeholder="请输入地址" />
  500. </view>
  501. <view class="line dis j-s a-c">
  502. <text>有效期起期</text>
  503. <u-input v-model="userback.identifyValidDate" placeholder="请输入有效期起期" />
  504. </view>
  505. <view class="line dis j-s a-c">
  506. <text>有效期止期</text>
  507. <u-input v-model="userback.identifyValidEndDate" placeholder="请输入有效期止期" />
  508. </view>
  509. </view>
  510. <view class="popFooter dis">
  511. <view class="popFooter-btn" @click="ImageOcrShow=false">取消</view>
  512. <view class="popFooter-btn" @click="CarOCRconfirm">确认</view>
  513. </view>
  514. </view>
  515. </u-popup>
  516. <previewImage ref="previewImage" :opacity="0.8" :circular="true" :imgs="previewImgs"></previewImage>
  517. <u-toast ref="uToast" />
  518. </view>
  519. </template>
  520. <script>
  521. import checkImageInfo from '@/components/modules/carInsure/checkImageInfo/checkImageInfo.vue'; //引用图片信息检查插件
  522. import previewImage from '@/components/common/previewImage/previewImage.vue'; //引用插件
  523. import {
  524. pathToBase64,
  525. base64ToPath
  526. } from '@/common/image-tools-base64.js';
  527. import {
  528. userInfo
  529. } from 'os';
  530. import store from '@/store';
  531. import $http from '../../config/requestConfig';
  532. import {
  533. getAgeByIdCard,
  534. addressCode,
  535. } from '@/plugins/utils';
  536. import {
  537. Promise
  538. } from 'bluebird';
  539. var dateTime = new Date();
  540. let Year = dateTime.getFullYear();
  541. let Month = Number(dateTime.getMonth() + 1);
  542. export default {
  543. components: {
  544. checkImageInfo,
  545. previewImage
  546. },
  547. watch: {
  548. "carInfo.frameNo": {
  549. handler(val) {
  550. if (val) {
  551. this.carInfo.vinNo = val;
  552. }
  553. },
  554. deep: true
  555. },
  556. },
  557. data() {
  558. return {
  559. form: {
  560. name: "",
  561. },
  562. //影像id上传列表
  563. checkType: "",
  564. checkIndex: 1,
  565. carInfoPositiveList: [], //车辆
  566. ownerInfoPositiveList: [], //车主
  567. policyHolderInfoPositiveList: [], //投保人
  568. insuredPersonInfoPositiveList: [], //被保人
  569. carfront: {},
  570. carback: {},
  571. userfront: {},
  572. userback: {},
  573. carfrontImg: '', //车辆正面
  574. carbackImg: '', //车辆背面
  575. userfrontImg: '', //车主正面
  576. userbackImg: '', //车主背面
  577. carFile: [], //车辆识别list
  578. userFile: [], //车主识别list
  579. ImageOcrShow: false, //影像识别框
  580. vehicleUseshow: false,
  581. carnatureshow: false,
  582. cartypeshow: false,
  583. cimodelclassshow: false,
  584. energyTypeshow: false,
  585. lodingshow: false,
  586. endYear: Year,
  587. endMonth: Month,
  588. registerDateShow: false,
  589. issueDateShow: false,
  590. ownerDateShow: false,
  591. ownerEndDateShow: false,
  592. policyHolderDateShow: false,
  593. policyHolderEndDateShow: false,
  594. insuredPersonDateShow: false,
  595. insuredPersonEndDateShow: false,
  596. transferDateShow: false,
  597. params: {
  598. year: true, //年
  599. month: true, //月
  600. day: true, //日
  601. hour: false, //时
  602. minute: false, //分
  603. second: false, //秒
  604. },
  605. carInfo: {
  606. licenseNo: "", //车牌号
  607. brandName: "", //车辆品牌型号
  608. vinNo: "", //车架号
  609. engineNo: "", //发动机号
  610. modelCode: "", //车型编码
  611. seatCount: "0", //核定载客量 核定载人数
  612. purchasePrice: "", //新车购置价最低,行业实际价值,协商价值
  613. carBrand: "", //车型品牌
  614. ciCarName: "", //行业车型名称
  615. ciModelCode: "", //行业车型编码
  616. completeKerbMass: "", //整备质量
  617. exhaustScale: "", //排量
  618. factory: "", //工厂名称
  619. factoryid: "", //工厂编码
  620. frameNo: "", //车架号
  621. licenseTypeCode: "02", //号牌种类
  622. vehicleclass: "", //车辆类型
  623. familyName: "", //车型
  624. modelcname: "", //车型名称
  625. powertypecode: "", //燃料类型编码
  626. vehicleweight: "", //总质量
  627. limitLoad: "", //核定载质量
  628. caryear: "0", //年款
  629. cimodelclass: "A0", //车辆种类
  630. powertype: "汽油", //燃料类型
  631. energyType: "0", //能源种类
  632. enginedesc: "", //排量
  633. powerScale: "", //功率
  634. registerDate: "", //注册日期
  635. issueDate: "", //发证日期
  636. transferFlag: false, //过户标志
  637. transferFlagBi: false, //商业过户标志
  638. transferDate: "", //过户日期
  639. loanStatus: 0, //贷款标志
  640. firstBeneMan: "", //第一受益人
  641. noLicenseFlag: false, //是否新车
  642. cartype: "K33", //客车A0 货车H0          
  643. carnature: "02", //使用性质 家庭自用8A 非营业企业8B 非营业党政机关,事业团体8C 非营业货车8D
  644. property: "1", //所属性质 1个人 2企业 3个人
  645. outOfInsurance: false, //脱保
  646. secondhandcarflag: false, //二手车
  647. vehicleUse: "05" //车辆用途
  648. },
  649. carInfo1: {
  650. energyType: "汽油",
  651. cimodelclass: "客车", //车辆种类
  652. carnature: "非营业",
  653. cartype: "轿车",
  654. vehicleUse: "",
  655. },
  656. carRules: {
  657. frameNo: {
  658. rules: [{
  659. required: true,
  660. errorMessage: '请输入车辆识别码',
  661. }, {
  662. pattern: /^([0-9A-Z]){17}$/,
  663. errorMessage: '请输入正确的车辆识别码',
  664. }]
  665. },
  666. modelcname: {
  667. rules: [{
  668. required: true,
  669. errorMessage: '请输入品牌型号',
  670. }, ]
  671. },
  672. engineNo: {
  673. rules: [{
  674. required: true,
  675. errorMessage: '请输入发动机号',
  676. }, ]
  677. },
  678. purchasePrice: {
  679. rules: [{
  680. required: true,
  681. errorMessage: '请输入新车购置价',
  682. }, {
  683. validateField: function(rule, value, data, callback) {
  684. if (value == 0) {
  685. callback('新车购置价不能为零')
  686. }
  687. return true
  688. }
  689. }]
  690. },
  691. registerDate: {
  692. rules: [{
  693. required: true,
  694. errorMessage: '请选择注册日期',
  695. }, {
  696. pattern: /^\d{4}-\d{2}-\d{2}$/,
  697. errorMessage: '注册日期格式错误',
  698. }]
  699. },
  700. issueDate: {
  701. rules: [{
  702. required: true,
  703. errorMessage: '请选择发证日期',
  704. }, {
  705. pattern: /^\d{4}-\d{2}-\d{2}$/,
  706. errorMessage: '发证日期日期格式错误',
  707. }]
  708. }
  709. },
  710. ownerRules: {
  711. name: {
  712. rules: [{
  713. required: true,
  714. errorMessage: '请输入车主姓名',
  715. },
  716. {
  717. minLength: 2,
  718. maxLength: 5,
  719. errorMessage: '车主姓名长度在 {minLength} 到 {maxLength} 个字符',
  720. },
  721. {
  722. pattern: /^([\u4e00-\u9fa5]{1,6}|[a-zA-Z\.\s]{1,6})$/,
  723. errorMessage: '请输入正确的车主姓名',
  724. }
  725. ]
  726. },
  727. identifyNumber: {
  728. rules: [{
  729. required: true,
  730. errorMessage: '请输入车主证件号',
  731. },
  732. {
  733. pattern: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  734. errorMessage: '请输入正确的车主证件号',
  735. }
  736. ]
  737. },
  738. mobile: {
  739. rules: [{
  740. required: true,
  741. errorMessage: '请输入车主手机号',
  742. },
  743. {
  744. pattern: /^1[3-9]\d{9}$/,
  745. errorMessage: '请输入正确的手机号',
  746. }
  747. ]
  748. },
  749. addr: {
  750. rules: [{
  751. required: true,
  752. errorMessage: '请输入车主地址',
  753. },
  754. {
  755. minLength: 8,
  756. maxLength: 40,
  757. errorMessage: '车主地址长度在 {minLength} 到 {maxLength} 个字符',
  758. },
  759. ]
  760. },
  761. identifyValidDate: {
  762. rules: [{
  763. required: true,
  764. errorMessage: '请选择身份证起期',
  765. }, {
  766. pattern: /^\d{4}-\d{2}-\d{2}$/,
  767. errorMessage: '身份证起期格式错误',
  768. }]
  769. },
  770. identifyValidEndDate: {
  771. rules: [{
  772. required: true,
  773. errorMessage: '请选择身份证止期',
  774. }, {
  775. pattern: /^\d{4}-\d{2}-\d{2}$/,
  776. errorMessage: '身份证止期格式错误',
  777. }]
  778. },
  779. },
  780. policyHolderRules: {
  781. name: {
  782. rules: [{
  783. required: true,
  784. errorMessage: '请输入投保人姓名',
  785. },
  786. {
  787. minLength: 2,
  788. maxLength: 5,
  789. errorMessage: '投保人姓名长度在 {minLength} 到 {maxLength} 个字符',
  790. },
  791. {
  792. pattern: /^([\u4e00-\u9fa5]{1,6}|[a-zA-Z\.\s]{1,6})$/,
  793. errorMessage: '请输入正确的投保人姓名',
  794. }
  795. ]
  796. },
  797. identifyNumber: {
  798. rules: [{
  799. required: true,
  800. errorMessage: '请输入投保人证件号',
  801. },
  802. {
  803. pattern: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  804. errorMessage: '请输入正确的投保人证件号',
  805. }
  806. ]
  807. },
  808. mobile: {
  809. rules: [{
  810. required: true,
  811. errorMessage: '请输入投保人手机号',
  812. },
  813. {
  814. pattern: /^1[3-9]\d{9}$/,
  815. errorMessage: '请输入正确的手机号',
  816. }
  817. ]
  818. },
  819. addr: {
  820. rules: [{
  821. required: true,
  822. errorMessage: '请输入投保人地址',
  823. },
  824. {
  825. minLength: 8,
  826. maxLength: 40,
  827. errorMessage: '投保人地址长度在 {minLength} 到 {maxLength} 个字符',
  828. },
  829. ]
  830. },
  831. identifyValidDate: {
  832. rules: [{
  833. required: true,
  834. errorMessage: '请选择身份证起期',
  835. }, {
  836. pattern: /^\d{4}-\d{2}-\d{2}$/,
  837. errorMessage: '身份证起期格式错误',
  838. }]
  839. },
  840. identifyValidEndDate: {
  841. rules: [{
  842. required: true,
  843. errorMessage: '请选择身份证止期',
  844. }, {
  845. pattern: /^\d{4}-\d{2}-\d{2}$/,
  846. errorMessage: '身份证止期格式错误',
  847. }]
  848. },
  849. },
  850. insuredPersonRules: {
  851. name: {
  852. rules: [{
  853. required: true,
  854. errorMessage: '请输入被保人姓名',
  855. },
  856. {
  857. minLength: 2,
  858. maxLength: 5,
  859. errorMessage: '被保人姓名长度在 {minLength} 到 {maxLength} 个字符',
  860. },
  861. {
  862. pattern: /^([\u4e00-\u9fa5]{1,6}|[a-zA-Z\.\s]{1,6})$/,
  863. errorMessage: '请输入正确的被保人姓名',
  864. }
  865. ]
  866. },
  867. identifyNumber: {
  868. rules: [{
  869. required: true,
  870. errorMessage: '请输入被保人证件号',
  871. },
  872. {
  873. pattern: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  874. errorMessage: '请输入正确的被保人证件号',
  875. }
  876. ]
  877. },
  878. mobile: {
  879. rules: [{
  880. required: true,
  881. errorMessage: '请输入被保人手机号',
  882. },
  883. {
  884. pattern: /^(13[0-9]|14[01456879]|15[0-3,5-9]|16[2567]|17[0-8]|18[0-9]|19[0-3,5-9])\d{8}$/,
  885. errorMessage: '请输入正确的手机号',
  886. }
  887. ]
  888. },
  889. addr: {
  890. rules: [{
  891. required: true,
  892. errorMessage: '请输入被保人地址',
  893. },
  894. {
  895. minLength: 8,
  896. maxLength: 40,
  897. errorMessage: '被保人地址长度在 {minLength} 到 {maxLength} 个字符',
  898. },
  899. ]
  900. },
  901. identifyValidDate: {
  902. rules: [{
  903. required: true,
  904. errorMessage: '请选择身份证起期',
  905. }, {
  906. pattern: /^\d{4}-\d{2}-\d{2}$/,
  907. errorMessage: '身份证起期格式错误',
  908. }]
  909. },
  910. identifyValidEndDate: {
  911. rules: [{
  912. required: true,
  913. errorMessage: '请选择身份证止期',
  914. }, {
  915. pattern: /^\d{4}-\d{2}-\d{2}$/,
  916. errorMessage: '身份证止期格式错误',
  917. }]
  918. },
  919. },
  920. checkInfo: {},
  921. checkImage: [],
  922. licenseNo: '', //车牌号
  923. //使用性质
  924. carnatureIndex: 0,
  925. cartypeIndex: 0,
  926. cimodelclassIndex: 0,
  927. fuelTypeCodeIndex: 0,
  928. propertyIndex: 0,
  929. ownerGenderIndex: 0,
  930. policyHolderGenderIndex: 0,
  931. insuredPersonGenderIndex: 0,
  932. genderList: [{
  933. label: "男",
  934. value: "男",
  935. },
  936. {
  937. label: "女",
  938. value: "女",
  939. }
  940. ],
  941. identifyList: [{
  942. label: '身份证',
  943. id: "01"
  944. },
  945. {
  946. label: '护照',
  947. id: "02"
  948. },
  949. {
  950. label: '港澳台居民居住证',
  951. id: "03"
  952. },
  953. {
  954. label: '组织机构代码证',
  955. id: "04"
  956. },
  957. {
  958. label: '统一社会信用代码证',
  959. id: "05"
  960. },
  961. {
  962. label: '营业执照',
  963. id: "06"
  964. }
  965. ],
  966. ownerIdentifyIndex: 0,
  967. policyHolderIdentifyIndex: 0,
  968. insuredPersonIdentifyIndex: 0,
  969. holderAndOwner: true, //投保人同车主
  970. insuredAndOwner: false, //被保人同车主
  971. tbrAndOwner: true, //被保人同投保人
  972. ownerInfo: {
  973. name: "",
  974. identifyType: "01",
  975. identifyNumber: "",
  976. addr: "",
  977. gender: "", //性别
  978. email: "", //邮箱
  979. mobile: "",
  980. identifyValidDate: "", //有效期起期
  981. identifyValidEndDate: "", //有效期止期
  982. age: "", //年龄
  983. },
  984. policyHolderInfo: {
  985. name: "",
  986. identifyType: "01",
  987. identifyNumber: "",
  988. addr: "",
  989. gender: "", //性别
  990. email: "",
  991. mobile: "",
  992. identifyValidDate: "", //有效期起期
  993. identifyValidEndDate: "", //有效期止期
  994. age: "", //年龄
  995. },
  996. insuredPersonInfo: {
  997. name: "",
  998. identifyType: "01",
  999. identifyNumber: "",
  1000. addr: "",
  1001. gender: "", //性别
  1002. email: "",
  1003. mobile: "",
  1004. identifyValidDate: "", //有效期起期
  1005. identifyValidEndDate: "", //有效期止期
  1006. age: "", //年龄
  1007. },
  1008. riskList: [], //交强险和商业险的选择
  1009. kindList: [], //商业险险种的选择
  1010. token: "",
  1011. /* 数据字典 */
  1012. natureOfVehicleUseoptions: [],
  1013. vehicleTypeoptions: [],
  1014. trafficManagementVehicleTypeoptions: [],
  1015. energyTypeoptions: [],
  1016. businessVehicleUseoptions: [],
  1017. outOfBusinessVehicleUseoptions: [],
  1018. /* 数据字典 */
  1019. model: {
  1020. ownerInforegion: '',
  1021. policyHolderInforegion: '',
  1022. insuredPersonInforegion: '',
  1023. },
  1024. previewImgs: [],
  1025. }
  1026. },
  1027. onShow() {
  1028. this.getDicType("businessVehicleUse"); //车辆用途(营业)
  1029. this.getDicType("outOfBusinessVehicleUse"); //车辆用途(非营业)
  1030. this.getDicType("natureOfVehicleUse"); //车辆性质
  1031. this.getDicType("vehicleType"); //车辆种类
  1032. this.getDicType("trafficManagementVehicleType"); //车辆类型
  1033. this.getDicType("energyType"); //能源种类
  1034. },
  1035. onLoad(options) {
  1036. //--数据字典 begin --
  1037. if (!!options.licenseNo) {
  1038. // this.licenseNo = decodeURIComponent(options.licenseNo);
  1039. } else {
  1040. const eventChannel = this.getOpenerEventChannel()
  1041. // 监听acceptData事件,获取上一页面通过eventChannel传送到当前页面的数据
  1042. eventChannel.on('acceptData', (data) => {
  1043. if (!!data) {
  1044. //读取上一个页面传过来数据(车辆信息,人员信息,险种信息)
  1045. this.carInfo = data.carInfo; //车辆信息
  1046. this.ownerInfo = JSON.parse(JSON.stringify(data.ownerInfo));
  1047. this.policyHolderInfo = JSON.parse(JSON.stringify(data.policyHolderInfo));
  1048. this.insuredPersonInfo = JSON.parse(JSON.stringify(data.insuredPersonInfo));
  1049. this.carInfoPositiveList = data.carInfoPositiveList; //车辆
  1050. this.ownerInfoPositiveList = data.ownerInfoPositiveList; //车主
  1051. this.policyHolderInfoPositiveList = data.policyHolderInfoPositiveList; //投保
  1052. this.insuredPersonInfoPositiveList = data.insuredPersonInfoPositiveList; //被保人
  1053. this.riskList = data.riskList; //险种大类
  1054. this.kindList = data.kindList; //商业险险别
  1055. this.licenseNo = this.carInfo.licenseNo;
  1056. this.holderAndOwner = false; //投保人同车主
  1057. this.insuredAndOwner = false; //被保人同车主
  1058. this.tbrAndOwner = false; //被保人同投保人
  1059. }
  1060. })
  1061. };
  1062. this.token = store.state.token
  1063. },
  1064. // 监听导航栏的按钮
  1065. onNavigationBarButtonTap(e) {
  1066. if (e.index == 0) {
  1067. this.navigate({
  1068. url: '/pages/index/index'
  1069. }, "switchTab", true);
  1070. }
  1071. },
  1072. computed: {
  1073. startDate() {
  1074. return this.getDate('start');
  1075. },
  1076. endDate() {
  1077. return this.getDate('end');
  1078. },
  1079. },
  1080. methods: {
  1081. transferFlagchange(status) {
  1082. if (status) {
  1083. this.carInfo.transferDate = this.carInfo.issueDate;
  1084. } else {
  1085. this.carInfo.transferDate = ""
  1086. }
  1087. },
  1088. async getDicType(type) {
  1089. let res = await this.$http.get('/sysDict/dictDetails/' + type);
  1090. if (res.code == 200) {
  1091. this[type + 'options'] = res.data.ddList;
  1092. }
  1093. },
  1094. dictionaryConfirm(e, name) {
  1095. this.carInfo[name] = e[0].value;
  1096. this.carInfo1[name] = e[0].label;
  1097. },
  1098. /**
  1099. * @param {String} e 时间选择器的值
  1100. * @param {String} obj 储存表单对象
  1101. * @param {String} param 储存表单参数
  1102. */
  1103. Dateconfirm(e, obj, param) {
  1104. this[obj][param] = e.year + '-' + e.month + '-' + e.day;
  1105. },
  1106. //选择驾照图片或拍摄驾照图片
  1107. chooseImage(type, index) {
  1108. this.checkType = type;
  1109. this.checkIndex = index;
  1110. this.ImageOcrShow = true;
  1111. },
  1112. //行驶证正面
  1113. async carfrontChange() {
  1114. if (this.carfrontImg) {
  1115. this.previewImgs = [{
  1116. url: this.carfrontImg
  1117. }];
  1118. this.$refs.previewImage.open(0); // 传入当前选中的图片地址或序号
  1119. } else {
  1120. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  1121. count: 1,
  1122. sizeType: ['compressed']
  1123. });
  1124. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  1125. if (!size) {
  1126. this.$refs.uToast.show({
  1127. title: '上传图片大小不能超过 5MB!',
  1128. type: 'error',
  1129. })
  1130. return false
  1131. }
  1132. if (chooseImageRes) {
  1133. this.lodingshow = true;
  1134. this.carfrontImg = chooseImageRes.tempFilePaths[0];
  1135. uni.uploadFile({
  1136. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  1137. filePath: this.carfrontImg,
  1138. name: "multipartFile",
  1139. formData: {
  1140. 'type': 'image',
  1141. },
  1142. header: {
  1143. Authorization: this.token,
  1144. },
  1145. success: (imgRes) => {
  1146. let data = JSON.parse(imgRes.data);
  1147. if (data.code == '200') {
  1148. if (this.carInfoPositiveList.some(v => v.imageType == 'C01')) {
  1149. this.carInfoPositiveList.map(val => {
  1150. if (val.imageType == 'C01') {
  1151. val.imageId = data.data.id;
  1152. }
  1153. })
  1154. } else {
  1155. this.carInfoPositiveList.push({
  1156. imageId: data.data.id,
  1157. imageType: "C01",
  1158. })
  1159. }
  1160. uni.uploadFile({
  1161. url: this.$base.baseUrl + '/order/identify/drivingPermit',
  1162. filePath: this.carfrontImg,
  1163. name: "image1",
  1164. header: {
  1165. Authorization: this.token,
  1166. },
  1167. success: (uploadFileRes) => {
  1168. let data = JSON.parse(uploadFileRes.data).data;
  1169. let rdate = '';
  1170. if (!!data.carInfo.registerDate) {
  1171. rdate = data.carInfo.registerDate.substr(0,
  1172. 4) +
  1173. '-' + data.carInfo
  1174. .registerDate.substr(4, 2) + '-' + data
  1175. .carInfo
  1176. .registerDate
  1177. .substr(6,
  1178. 2)
  1179. }
  1180. let isdate = '';
  1181. if (!!data.carInfo.issueDate) {
  1182. isdate = data.carInfo.issueDate.substr(0, 4) +
  1183. '-' + data.carInfo
  1184. .issueDate.substr(4, 2) + '-' + data
  1185. .carInfo
  1186. .issueDate.substr(6, 2)
  1187. }
  1188. this.ownerInfo.name = data.carInfo.carOwner; //车主
  1189. this.carfront = {
  1190. carOwner: data.carInfo.carOwner, //车主
  1191. licenseNo: data.carInfo.plateNo, //车牌号
  1192. modelcname: data.carInfo.backOcrID, //品牌型号
  1193. frameNo: data.carInfo.vin, //车架号
  1194. engineNo: data.carInfo.engine, //发动机号
  1195. vinNo: data.carInfo.vin, //车架号
  1196. issueDate: isdate, //发证日期
  1197. registerDate: rdate, //注册日期
  1198. cimodelclass: data.carInfo.motorTypeCode,
  1199. carnature: data.carInfo.motorUsageTypeCode,
  1200. }
  1201. this.lodingshow = false;
  1202. }
  1203. });
  1204. }
  1205. }
  1206. });
  1207. } else {
  1208. this.lodingshow = false;
  1209. }
  1210. }
  1211. },
  1212. //行驶证反面
  1213. async carbackChange() {
  1214. if (this.carbackImg) {
  1215. this.previewImgs = [{
  1216. url: this.carbackImg
  1217. }];
  1218. this.$refs.previewImage.open(0); // 传入当前选中的图片地址或序号
  1219. } else {
  1220. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  1221. count: 1,
  1222. sizeType: ['compressed']
  1223. });
  1224. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  1225. if (!size) {
  1226. this.$refs.uToast.show({
  1227. title: '上传图片大小不能超过 5MB!',
  1228. type: 'error',
  1229. })
  1230. return false
  1231. }
  1232. if (chooseImageRes) {
  1233. this.lodingshow = true;
  1234. this.carbackImg = chooseImageRes.tempFilePaths[0];
  1235. uni.uploadFile({
  1236. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  1237. filePath: this.carbackImg,
  1238. name: "multipartFile",
  1239. formData: {
  1240. 'type': 'image',
  1241. },
  1242. header: {
  1243. Authorization: this.token,
  1244. },
  1245. success: (imgRes) => {
  1246. let data = JSON.parse(imgRes.data);
  1247. if (data.code == '200') {
  1248. if (this.carInfoPositiveList.some(v => v.imageType == 'D01')) {
  1249. this.carInfoPositiveList.map(val => {
  1250. if (val.imageType == 'D01') {
  1251. val.imageId = data.data.id;
  1252. }
  1253. })
  1254. } else {
  1255. this.carInfoPositiveList.push({
  1256. imageId: data.data.id,
  1257. imageType: "D01",
  1258. })
  1259. }
  1260. uni.uploadFile({
  1261. url: this.$base.baseUrl + '/order/identify/drivingPermit',
  1262. filePath: this.carbackImg,
  1263. name: "image2",
  1264. header: {
  1265. Authorization: this.token,
  1266. },
  1267. success: (uploadFileRes) => {
  1268. let data1 = JSON.parse(uploadFileRes.data).data;
  1269. this.carback = {
  1270. vehicleweight: data1.carInfo
  1271. .grossMass, //总质量
  1272. completeKerbMass: data1.carInfo
  1273. .unladenMass, //整备质量
  1274. seatCount: data1.carInfo
  1275. .approvedPassengersCapacity, //核定载客数
  1276. }
  1277. this.lodingshow = false;
  1278. }
  1279. });
  1280. }
  1281. }
  1282. });
  1283. } else {
  1284. this.lodingshow = false;
  1285. }
  1286. }
  1287. },
  1288. //身份证正面
  1289. async userfrontChange() {
  1290. if (this.userfrontImg) {
  1291. this.previewImgs = [{
  1292. url: this.userfrontImg
  1293. }];
  1294. this.$refs.previewImage.open(0); // 传入当前选中的图片地址或序号
  1295. } else {
  1296. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  1297. count: 1,
  1298. sizeType: ['compressed']
  1299. });
  1300. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  1301. if (!size) {
  1302. this.$refs.uToast.show({
  1303. title: '上传图片大小不能超过 5MB!',
  1304. type: 'error',
  1305. })
  1306. return false
  1307. }
  1308. if (chooseImageRes) {
  1309. this.lodingshow = true;
  1310. this.userfrontImg = chooseImageRes.tempFilePaths[0];
  1311. uni.uploadFile({
  1312. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  1313. filePath: this.userfrontImg,
  1314. name: "multipartFile",
  1315. formData: {
  1316. 'type': 'image',
  1317. },
  1318. header: {
  1319. Authorization: this.token,
  1320. },
  1321. success: (imgRes) => {
  1322. let data = JSON.parse(imgRes.data);
  1323. if (data.code == '200') {
  1324. let type = 'C0' + this.checkIndex;
  1325. if (this[this.checkType + 'PositiveList'].some(v => v.imageType ==
  1326. type)) {
  1327. this[this.checkType + 'PositiveList'].map(val => {
  1328. if (val.imageType == type) {
  1329. val.imageId = data.data.id;
  1330. }
  1331. })
  1332. } else {
  1333. this[this.checkType + 'PositiveList'].push({
  1334. imageId: data.data.id,
  1335. imageType: type,
  1336. })
  1337. }
  1338. uni.uploadFile({
  1339. url: this.$base.baseUrl + '/order/identify/idCard',
  1340. filePath: this.userfrontImg,
  1341. name: "image1",
  1342. header: {
  1343. Authorization: this.token,
  1344. },
  1345. success: (uploadFileRes) => {
  1346. let data = JSON.parse(uploadFileRes.data).data;
  1347. this.userfront = {
  1348. age: getAgeByIdCard(data.customerInfo
  1349. .identifyNumber),
  1350. name: data.customerInfo.name,
  1351. gender: data.customerInfo
  1352. .identifyIssuedCom,
  1353. identifyNumber: data.customerInfo
  1354. .identifyNumber,
  1355. addr: data.customerInfo.addr,
  1356. }
  1357. this.lodingshow = false;
  1358. }
  1359. });
  1360. }
  1361. }
  1362. });
  1363. } else {
  1364. this.lodingshow = false;
  1365. }
  1366. }
  1367. },
  1368. //身份证反面
  1369. async userbackChange() {
  1370. if (this.userbackImg) {
  1371. this.previewImgs = [{
  1372. url: this.userbackImg
  1373. }];
  1374. this.$refs.previewImage.open(0); // 传入当前选中的图片地址或序号
  1375. } else {
  1376. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  1377. count: 1,
  1378. sizeType: ['compressed']
  1379. });
  1380. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  1381. if (!size) {
  1382. this.$refs.uToast.show({
  1383. title: '上传图片大小不能超过 5MB!',
  1384. type: 'error',
  1385. })
  1386. return false
  1387. }
  1388. if (chooseImageRes) {
  1389. this.lodingshow = true;
  1390. this.userbackImg = chooseImageRes.tempFilePaths[0];
  1391. uni.uploadFile({
  1392. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  1393. filePath: this.userbackImg,
  1394. name: "multipartFile",
  1395. formData: {
  1396. 'type': 'image',
  1397. },
  1398. header: {
  1399. Authorization: this.token,
  1400. },
  1401. success: (imgRes) => {
  1402. let data = JSON.parse(imgRes.data);
  1403. if (data.code == '200') {
  1404. let type = 'D0' + this.checkIndex;
  1405. if (this[this.checkType + 'PositiveList'].some(v => v.imageType ==
  1406. type)) {
  1407. this[this.checkType + 'PositiveList'].map(val => {
  1408. if (val.imageType == type) {
  1409. val.imageId = data.data.id;
  1410. }
  1411. })
  1412. } else {
  1413. this[this.checkType + 'PositiveList'].push({
  1414. imageId: data.data.id,
  1415. imageType: type,
  1416. })
  1417. }
  1418. uni.uploadFile({
  1419. url: this.$base.baseUrl +
  1420. '/order/identify/idCard',
  1421. filePath: this.userbackImg,
  1422. name: "image2",
  1423. header: {
  1424. Authorization: this.token,
  1425. },
  1426. success: (uploadFileRes) => {
  1427. let data1 = JSON.parse(uploadFileRes.data).data;
  1428. let identifyValidDate = '';
  1429. if (!!data1.customerInfo
  1430. .identifyValidDate) {
  1431. identifyValidDate = data1
  1432. .customerInfo
  1433. .identifyValidDate
  1434. .substr(0, 4) +
  1435. '-' + data1
  1436. .customerInfo
  1437. .identifyValidDate
  1438. .substr(4, 2) + '-' +
  1439. data1
  1440. .customerInfo
  1441. .identifyValidDate
  1442. .substr(6,
  1443. 2)
  1444. }
  1445. let identifyValidEndDate = '';
  1446. if (!!data1.customerInfo
  1447. .identifyValidEndDate) {
  1448. identifyValidEndDate =
  1449. data1.customerInfo
  1450. .identifyValidEndDate
  1451. .substr(0,
  1452. 4) + '-' + data1
  1453. .customerInfo
  1454. .identifyValidEndDate
  1455. .substr(4, 2) + '-' +
  1456. data1
  1457. .customerInfo
  1458. .identifyValidEndDate
  1459. .substr(6, 2)
  1460. }
  1461. this.userback = {
  1462. identifyValidDate: identifyValidDate, //起期
  1463. identifyValidEndDate: identifyValidEndDate, //止期
  1464. }
  1465. this.lodingshow = false;
  1466. }
  1467. });
  1468. }
  1469. }
  1470. });
  1471. } else {
  1472. this.lodingshow = false;
  1473. }
  1474. }
  1475. },
  1476. CarOCRconfirm() {
  1477. switch (this.checkType) {
  1478. case 'carInfo':
  1479. Object.assign(this.carInfo, this.carfront, this
  1480. .carback);
  1481. this.ImageOcrShow = false;
  1482. break;
  1483. case 'ownerInfo':
  1484. case "policyHolderInfo":
  1485. case "insuredPersonInfo":
  1486. Object.assign(this[this.checkType], this.userfront, this
  1487. .userback);
  1488. this.ImageOcrShow = false;
  1489. break;
  1490. default:
  1491. break;
  1492. }
  1493. },
  1494. //图片删除
  1495. del_btn(val) {
  1496. this[val] = "";
  1497. },
  1498. //弹框关闭事件
  1499. ImagePopClose() {
  1500. this.carfrontImg = "";
  1501. this.carbackImg = "";
  1502. this.userfrontImg = "";
  1503. this.userbackImg = "";
  1504. this.carfront = {};
  1505. this.carback = {};
  1506. this.userfront = {};
  1507. this.userback = {};
  1508. },
  1509. /**
  1510. * 复写 binddata 方法,如果只是为了校验,无复杂自定义操作,可忽略此方法
  1511. * @param {String} name 字段名称
  1512. * @param {String} value 表单域的值
  1513. */
  1514. binddata(name, value, type) {
  1515. if (name == 'identifyNumber') {
  1516. this[type].age = getAgeByIdCard(value)
  1517. }
  1518. },
  1519. //转变大写(车型/车架号/发动机号)
  1520. upperCaseType(type) {
  1521. this.carInfo[type] = this.carInfo[type].toUpperCase();
  1522. if (type == 'vinNo') {
  1523. this.carInfo.frameNo = this.carInfo.vinNo.trim();
  1524. }
  1525. },
  1526. //下拉改变触发该方法
  1527. bindPickerChange(e, type, list) {
  1528. this[type + 'Index'] = e.target.value;
  1529. this.carInfo[type] = this[list][e.target.value].dictValue;
  1530. },
  1531. // 身份证类型选择
  1532. bindIdentifyTypeChange(e, type) {
  1533. this[type + 'IdentifyIndex'] = e.target.value;
  1534. this[type + 'Info'].identifyType = this.identifyList[e.target.value].id;
  1535. this[type + 'Info'].identifyNumber = '';
  1536. },
  1537. //性别匹配
  1538. bindGenderChange(e, type) {
  1539. this[type + 'GenderIndex'] = e.target.value;
  1540. this[type + 'Info'].gender = this.genderList[e.target.value].label;
  1541. },
  1542. bindDateChange(e, type) { //日期赋值
  1543. if ((type == 'issueDate') && (!this.carInfo.registerDate)) {
  1544. return uni.showToast({
  1545. title: '请先输入注册日期',
  1546. icon: "none"
  1547. });
  1548. }
  1549. this.carInfo[type] = e.detail.value;
  1550. if (new Date(this.carInfo.registerDate) > new Date(this.carInfo.issueDate)) {
  1551. this.carInfo.issueDate = ""
  1552. return uni.showToast({
  1553. title: '注册日期大于发证日期',
  1554. icon: "none"
  1555. });
  1556. }
  1557. },
  1558. //长期
  1559. insureLongterm(checked, e) {
  1560. checked.detail.value == true ? this[e].identifyValidEndDate = "9999-12-31" : this[e]
  1561. .identifyValidEndDate =
  1562. "";
  1563. },
  1564. //日期(可以选择20年以内的时间)
  1565. getDate(type) {
  1566. const date = new Date();
  1567. let year = date.getFullYear();
  1568. let month = date.getMonth() + 1;
  1569. let day = date.getDate();
  1570. if (type === 'start') {
  1571. year = year - 20;
  1572. } else if (type === 'end') {}
  1573. month = month > 9 ? month : '0' + month;;
  1574. day = day > 9 ? day : '0' + day;
  1575. return `${year}-${month}-${day}`;
  1576. },
  1577. //同车主信息
  1578. syncPersonInfo(e, type, touch1, touch2, touch3) {
  1579. this[type] = e.detail.value;
  1580. this[touch1 + 'IdentifyIndex'] = this[touch2 + 'IdentifyIndex'];
  1581. if (this[type]) {
  1582. this[touch1 + 'Info'] = JSON.parse(JSON.stringify(this[touch2 + 'Info']));
  1583. this[touch3] = false;
  1584. } else {
  1585. for (let key in this[touch1 + "Info"]) {
  1586. this[touch1 + "Info"][key] = '';
  1587. }
  1588. }
  1589. },
  1590. //跳转选择车辆类型页面
  1591. toChooseVehicleType(cctype) {
  1592. if (cctype == '' || cctype == null) {
  1593. uni.showToast({
  1594. icon: 'none',
  1595. title: '请输入车型名称',
  1596. duration: 1500
  1597. });
  1598. } else {
  1599. let cctypeName = cctype.replace(/[^u4e00-u9fa5|,]+/ig, '')
  1600. this.navigate({
  1601. url: '/pages/carInsure1/carType1?modelName=' + encodeURIComponent(cctypeName)
  1602. }, "navigateTo", true);
  1603. }
  1604. },
  1605. // 通过车架号获取车型
  1606. async toChooseVin(cctype) {
  1607. if (cctype == '' || cctype == null) {
  1608. return uni.showToast({
  1609. icon: 'none',
  1610. title: '请输入车架号',
  1611. duration: 1500
  1612. });
  1613. } else {
  1614. if (!this.isFrameno(cctype.trim())) {
  1615. return uni.showToast({
  1616. title: '请输入正确的车辆识别码',
  1617. icon: "none"
  1618. });
  1619. }
  1620. this.navigate({
  1621. url: '/pages/carInsure1/carType1?frameNo=' + encodeURIComponent(cctype)
  1622. }, "navigateTo", true);
  1623. }
  1624. },
  1625. //验证车架号
  1626. isFrameno(str) {
  1627. let mPattern = /^([0-9A-Z]){17}$/;
  1628. return mPattern.test(str);
  1629. },
  1630. toNext() {
  1631. if (this.holderAndOwner) { //投保人同车主
  1632. this.policyHolderInfo = this.ownerInfo;
  1633. if (this.ownerInfoPositiveList.length > 0) {
  1634. this.policyHolderInfoPositiveList = JSON.parse(JSON.stringify(this
  1635. .ownerInfoPositiveList));
  1636. if (this.policyHolderInfoPositiveList.length == 1) {
  1637. this.policyHolderInfoPositiveList[0].imageType = "C03";
  1638. } else {
  1639. this.policyHolderInfoPositiveList[0].imageType = "C03";
  1640. this.policyHolderInfoPositiveList[1].imageType = "D03";
  1641. }
  1642. }
  1643. }
  1644. if (this.insuredAndOwner) { //被保人同车主
  1645. this.insuredPersonInfo = this.ownerInfo;
  1646. if (this.ownerInfoPositiveList.length > 0) {
  1647. this.insuredPersonInfoPositiveList = JSON.parse(JSON.stringify(this
  1648. .ownerInfoPositiveList));
  1649. if (this.insuredPersonInfoPositiveList.length == 1) {
  1650. this.insuredPersonInfoPositiveList[0].imageType = "C04";
  1651. } else {
  1652. this.insuredPersonInfoPositiveList[0].imageType = "C04";
  1653. this.insuredPersonInfoPositiveList[1].imageType = "D04";
  1654. }
  1655. }
  1656. }
  1657. if (this.tbrAndOwner) { //被保人同投保人
  1658. this.insuredPersonInfo = this.policyHolderInfo;
  1659. if (this.policyHolderInfoPositiveList.length > 0) {
  1660. this.insuredPersonInfoPositiveList = JSON.parse(JSON.stringify(this
  1661. .policyHolderInfoPositiveList));
  1662. if (this.insuredPersonInfoPositiveList.length == 1) {
  1663. this.insuredPersonInfoPositiveList[0].imageType = "C04";
  1664. } else {
  1665. this.insuredPersonInfoPositiveList[0].imageType = "C04";
  1666. this.insuredPersonInfoPositiveList[1].imageType = "D04";
  1667. }
  1668. }
  1669. }
  1670. this.$refs.carForm.submit().then(res => {
  1671. this.$refs.ownerForm.submit().then(res1 => {
  1672. this.$refs.policyHolderForm.submit().then(res2 => {
  1673. this.$refs.insuredPersonForm.submit().then(res3 => {
  1674. this.navigate({
  1675. url: '/pages/carInsure1/insureItems1',
  1676. success: (res) => {
  1677. res.eventChannel.emit(
  1678. "acceptData", {
  1679. carInfo: this
  1680. .carInfo,
  1681. ownerInfo: this
  1682. .ownerInfo,
  1683. policyHolderInfo: this
  1684. .policyHolderInfo,
  1685. insuredPersonInfo: this
  1686. .insuredPersonInfo,
  1687. riskList: this
  1688. .riskList,
  1689. kindList: this
  1690. .kindList,
  1691. carInfoPositiveList: this
  1692. .carInfoPositiveList, //车辆
  1693. ownerInfoPositiveList: this
  1694. .ownerInfoPositiveList, //车主
  1695. policyHolderInfoPositiveList: this
  1696. .policyHolderInfoPositiveList, //投保人
  1697. insuredPersonInfoPositiveList: this
  1698. .insuredPersonInfoPositiveList, //被保人
  1699. })
  1700. }
  1701. }, "navigateTo", true);
  1702. })
  1703. })
  1704. })
  1705. })
  1706. },
  1707. }
  1708. }
  1709. </script>
  1710. <style lang="scss" scoped>
  1711. @import '@/style/mixin.scss';
  1712. /deep/ .uni-group__content {
  1713. padding-top: 0;
  1714. }
  1715. /deep/ .uni-forms--top {
  1716. padding: 0;
  1717. }
  1718. /deep/ .uni-forms-item {
  1719. margin-bottom: 0;
  1720. }
  1721. /deep/ .uni-input-input {
  1722. font-size: 26upx;
  1723. }
  1724. /deep/ .uni-switch-input-checked {
  1725. background-color: $themeColor !important;
  1726. border-color: $themeColor !important;
  1727. }
  1728. /deep/ .uni-group__content {
  1729. padding-bottom: 0;
  1730. }
  1731. /deep/ .uni-input-input {
  1732. font-size: 28upx;
  1733. }
  1734. .body {
  1735. width: 100vw;
  1736. /* min-height: 100vh; */
  1737. background: #f5f5f5;
  1738. /* background: #FFFFFF; */
  1739. font-family: "Arial,Helvetica,sans-serif,PingFangSC";
  1740. }
  1741. .title {
  1742. height: 90upx;
  1743. border-bottom: 1px solid #EEEEEE;
  1744. }
  1745. .checkButton {
  1746. margin: 0 20upx;
  1747. width: 100upx;
  1748. height: 50upx;
  1749. flex-shrink: 1;
  1750. background: rgba($themeColor, 0.6);
  1751. color: #FFFFFF;
  1752. border-radius: 5upx;
  1753. }
  1754. .textColor {
  1755. color: #6091f5;
  1756. }
  1757. textarea {
  1758. font-size: 28upx;
  1759. width: 330upx;
  1760. }
  1761. /* 底部的样式Start */
  1762. .infoBottom {
  1763. height: 140upx;
  1764. position: fixed;
  1765. bottom: 0;
  1766. left: 0;
  1767. right: 0;
  1768. background: #FFFFFF;
  1769. border-top: 1upx solid #EEEEEE;
  1770. z-index: 99;
  1771. }
  1772. .infoBottom>button {
  1773. // font-size: 30upx;
  1774. background: $themeColor;
  1775. color: #FFFFFF;
  1776. flex: 1;
  1777. margin: 0upx 30upx;
  1778. }
  1779. /* 底部的样式End */
  1780. .popContent {
  1781. height: 100%;
  1782. background-color: #f9f9f9;
  1783. .popHeader {
  1784. width: 100%;
  1785. text-align: center;
  1786. padding: 10px;
  1787. font-weight: bold;
  1788. background-color: #FFFFFF;
  1789. }
  1790. .imgOcr {
  1791. width: 100%;
  1792. background-color: #f9f9f9;
  1793. .imgOcr-border {
  1794. position: relative;
  1795. width: 49%;
  1796. background-color: #fff;
  1797. padding: 2px;
  1798. .del_btn {
  1799. cursor: pointer;
  1800. position: absolute;
  1801. top: 5rpx;
  1802. right: 0;
  1803. width: 50rpx;
  1804. height: 50rpx;
  1805. border-radius: 50%;
  1806. z-index: 20;
  1807. }
  1808. .obverseimg {
  1809. height: 120px;
  1810. border-radius: 4px;
  1811. }
  1812. }
  1813. }
  1814. .line {
  1815. width: 100%;
  1816. margin: 2px 0;
  1817. background-color: #FFFFFF;
  1818. padding: 0 10px;
  1819. >text {
  1820. font-weight: bold;
  1821. width: 100px;
  1822. }
  1823. }
  1824. .popFooter {
  1825. width: 100%;
  1826. height: 50px;
  1827. font-weight: bold;
  1828. background-color: #FFFFFF;
  1829. color: #3e5cd7;
  1830. .popFooter-btn:nth-child(1) {
  1831. border-right: 1px solid #f9f9f9;
  1832. }
  1833. .popFooter-btn {
  1834. width: 50%;
  1835. text-align: center;
  1836. line-height: 50px;
  1837. }
  1838. }
  1839. }
  1840. .mask {
  1841. /* pointer-events: none; */
  1842. position: fixed;
  1843. z-index: 99999;
  1844. top: 0;
  1845. left: 0;
  1846. right: 0;
  1847. bottom: 0;
  1848. height: 100vh;
  1849. width: 100vw;
  1850. display: flex;
  1851. flex-direction: column;
  1852. justify-content: center;
  1853. align-items: center;
  1854. flex-wrap: wrap;
  1855. }
  1856. .mask.mask-show {
  1857. background: rgba(255, 255, 255, 0.3);
  1858. }
  1859. .title {
  1860. color: #333;
  1861. font-size: 28rpx;
  1862. margin-top: 20rpx;
  1863. }
  1864. .loader {
  1865. display: block;
  1866. width: 120rpx;
  1867. height: 120rpx;
  1868. border-radius: 50%;
  1869. border: 3rpx solid transparent;
  1870. border-top-color: #9370db;
  1871. -webkit-animation: spin 2s linear infinite;
  1872. animation: spin 2s linear infinite;
  1873. }
  1874. .loader::before {
  1875. content: "";
  1876. position: absolute;
  1877. top: 5rpx;
  1878. left: 5rpx;
  1879. right: 5rpx;
  1880. bottom: 5rpx;
  1881. border-radius: 50%;
  1882. border: 3rpx solid transparent;
  1883. border-top-color: #ba55d3;
  1884. -webkit-animation: spin 3s linear infinite;
  1885. animation: spin 3s linear infinite;
  1886. }
  1887. .loader::after {
  1888. content: "";
  1889. position: absolute;
  1890. top: 15rpx;
  1891. left: 15rpx;
  1892. right: 15rpx;
  1893. bottom: 15rpx;
  1894. border-radius: 50%;
  1895. border: 3rpx solid transparent;
  1896. border-top-color: #ff00ff;
  1897. -webkit-animation: spin 1.5s linear infinite;
  1898. animation: spin 1.5s linear infinite;
  1899. }
  1900. @-webkit-keyframes spin {
  1901. 0% {
  1902. -webkit-transform: rotate(0deg);
  1903. -ms-transform: rotate(0deg);
  1904. transform: rotate(0deg);
  1905. }
  1906. 100% {
  1907. -webkit-transform: rotate(360deg);
  1908. -ms-transform: rotate(360deg);
  1909. transform: rotate(360deg);
  1910. }
  1911. }
  1912. @keyframes spin {
  1913. 0% {
  1914. -webkit-transform: rotate(0deg);
  1915. -ms-transform: rotate(0deg);
  1916. transform: rotate(0deg);
  1917. }
  1918. 100% {
  1919. -webkit-transform: rotate(360deg);
  1920. -ms-transform: rotate(360deg);
  1921. transform: rotate(360deg);
  1922. }
  1923. }
  1924. </style>