carInfo1.vue 67 KB

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