carInfo1.vue 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020
  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="使用性质: ">
  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="车辆用途: ">
  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: "02", //使用性质 家庭自用8A 非营业企业8B 非营业党政机关,事业团体8C 非营业货车8D
  649. property: "1", //所属性质 1个人 2企业 3个人
  650. outOfInsurance: false, //脱保
  651. secondhandcarflag: false, //二手车
  652. vehicleUse: "05" //车辆用途
  653. },
  654. carInfo1: {
  655. energyType: "汽油",
  656. cimodelclass: "客车", //车辆种类
  657. carnature: "非营业",
  658. cartype: "轿车",
  659. vehicleUse: "",
  660. },
  661. carRules: {
  662. completeKerbMass: {
  663. rules: [{
  664. required: true,
  665. errorMessage: '请输入整备质量',
  666. }, ]
  667. },
  668. frameNo: {
  669. rules: [{
  670. required: true,
  671. errorMessage: '请输入车辆识别码',
  672. }, {
  673. pattern: /^([0-9A-Z]){17}$/,
  674. errorMessage: '请输入正确的车辆识别码',
  675. }]
  676. },
  677. modelcname: {
  678. rules: [{
  679. required: true,
  680. errorMessage: '请输入品牌型号',
  681. }, ]
  682. },
  683. engineNo: {
  684. rules: [{
  685. required: true,
  686. errorMessage: '请输入发动机号',
  687. }, ]
  688. },
  689. purchasePrice: {
  690. rules: [{
  691. required: true,
  692. errorMessage: '请输入新车购置价',
  693. }, {
  694. validateField: function(rule, value, data, callback) {
  695. if (value == 0) {
  696. callback('新车购置价不能为零')
  697. }
  698. return true
  699. }
  700. }]
  701. },
  702. registerDate: {
  703. rules: [{
  704. required: true,
  705. errorMessage: '请选择注册日期',
  706. }, {
  707. pattern: /^\d{4}-\d{2}-\d{2}$/,
  708. errorMessage: '注册日期格式错误',
  709. }]
  710. },
  711. issueDate: {
  712. rules: [{
  713. required: true,
  714. errorMessage: '请选择发证日期',
  715. }, {
  716. pattern: /^\d{4}-\d{2}-\d{2}$/,
  717. errorMessage: '发证日期日期格式错误',
  718. }]
  719. }
  720. },
  721. ownerRules: {
  722. name: {
  723. rules: [{
  724. required: true,
  725. errorMessage: '请输入车主姓名',
  726. },
  727. {
  728. minLength: 2,
  729. maxLength: 5,
  730. errorMessage: '车主姓名长度在 {minLength} 到 {maxLength} 个字符',
  731. },
  732. {
  733. pattern: /^([\u4e00-\u9fa5]{1,6}|[a-zA-Z\.\s]{1,6})$/,
  734. errorMessage: '请输入正确的车主姓名',
  735. }
  736. ]
  737. },
  738. identifyNumber: {
  739. rules: [{
  740. required: true,
  741. errorMessage: '请输入车主证件号',
  742. },
  743. {
  744. 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]$/,
  745. errorMessage: '请输入正确的车主证件号',
  746. }
  747. ]
  748. },
  749. mobile: {
  750. rules: [{
  751. required: true,
  752. errorMessage: '请输入车主手机号',
  753. },
  754. {
  755. pattern: /^1[3-9]\d{9}$/,
  756. errorMessage: '请输入正确的手机号',
  757. }
  758. ]
  759. },
  760. addr: {
  761. rules: [{
  762. required: true,
  763. errorMessage: '请输入车主地址',
  764. },
  765. {
  766. minLength: 8,
  767. maxLength: 40,
  768. errorMessage: '车主地址长度在 {minLength} 到 {maxLength} 个字符',
  769. },
  770. ]
  771. },
  772. identifyValidDate: {
  773. rules: [{
  774. required: true,
  775. errorMessage: '请选择身份证起期',
  776. }, {
  777. pattern: /^\d{4}-\d{2}-\d{2}$/,
  778. errorMessage: '身份证起期格式错误',
  779. }]
  780. },
  781. identifyValidEndDate: {
  782. rules: [{
  783. required: true,
  784. errorMessage: '请选择身份证止期',
  785. }, {
  786. pattern: /^\d{4}-\d{2}-\d{2}$/,
  787. errorMessage: '身份证止期格式错误',
  788. }]
  789. },
  790. },
  791. policyHolderRules: {
  792. name: {
  793. rules: [{
  794. required: true,
  795. errorMessage: '请输入投保人姓名',
  796. },
  797. {
  798. minLength: 2,
  799. maxLength: 5,
  800. errorMessage: '投保人姓名长度在 {minLength} 到 {maxLength} 个字符',
  801. },
  802. {
  803. pattern: /^([\u4e00-\u9fa5]{1,6}|[a-zA-Z\.\s]{1,6})$/,
  804. errorMessage: '请输入正确的投保人姓名',
  805. }
  806. ]
  807. },
  808. identifyNumber: {
  809. rules: [{
  810. required: true,
  811. errorMessage: '请输入投保人证件号',
  812. },
  813. {
  814. 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]$/,
  815. errorMessage: '请输入正确的投保人证件号',
  816. }
  817. ]
  818. },
  819. mobile: {
  820. rules: [{
  821. required: true,
  822. errorMessage: '请输入投保人手机号',
  823. },
  824. {
  825. pattern: /^1[3-9]\d{9}$/,
  826. errorMessage: '请输入正确的手机号',
  827. }
  828. ]
  829. },
  830. addr: {
  831. rules: [{
  832. required: true,
  833. errorMessage: '请输入投保人地址',
  834. },
  835. {
  836. minLength: 8,
  837. maxLength: 40,
  838. errorMessage: '投保人地址长度在 {minLength} 到 {maxLength} 个字符',
  839. },
  840. ]
  841. },
  842. identifyValidDate: {
  843. rules: [{
  844. required: true,
  845. errorMessage: '请选择身份证起期',
  846. }, {
  847. pattern: /^\d{4}-\d{2}-\d{2}$/,
  848. errorMessage: '身份证起期格式错误',
  849. }]
  850. },
  851. identifyValidEndDate: {
  852. rules: [{
  853. required: true,
  854. errorMessage: '请选择身份证止期',
  855. }, {
  856. pattern: /^\d{4}-\d{2}-\d{2}$/,
  857. errorMessage: '身份证止期格式错误',
  858. }]
  859. },
  860. },
  861. insuredPersonRules: {
  862. name: {
  863. rules: [{
  864. required: true,
  865. errorMessage: '请输入被保人姓名',
  866. },
  867. {
  868. minLength: 2,
  869. maxLength: 5,
  870. errorMessage: '被保人姓名长度在 {minLength} 到 {maxLength} 个字符',
  871. },
  872. {
  873. pattern: /^([\u4e00-\u9fa5]{1,6}|[a-zA-Z\.\s]{1,6})$/,
  874. errorMessage: '请输入正确的被保人姓名',
  875. }
  876. ]
  877. },
  878. identifyNumber: {
  879. rules: [{
  880. required: true,
  881. errorMessage: '请输入被保人证件号',
  882. },
  883. {
  884. 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]$/,
  885. errorMessage: '请输入正确的被保人证件号',
  886. }
  887. ]
  888. },
  889. mobile: {
  890. rules: [{
  891. required: true,
  892. errorMessage: '请输入被保人手机号',
  893. },
  894. {
  895. 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}$/,
  896. errorMessage: '请输入正确的手机号',
  897. }
  898. ]
  899. },
  900. addr: {
  901. rules: [{
  902. required: true,
  903. errorMessage: '请输入被保人地址',
  904. },
  905. {
  906. minLength: 8,
  907. maxLength: 40,
  908. errorMessage: '被保人地址长度在 {minLength} 到 {maxLength} 个字符',
  909. },
  910. ]
  911. },
  912. identifyValidDate: {
  913. rules: [{
  914. required: true,
  915. errorMessage: '请选择身份证起期',
  916. }, {
  917. pattern: /^\d{4}-\d{2}-\d{2}$/,
  918. errorMessage: '身份证起期格式错误',
  919. }]
  920. },
  921. identifyValidEndDate: {
  922. rules: [{
  923. required: true,
  924. errorMessage: '请选择身份证止期',
  925. }, {
  926. pattern: /^\d{4}-\d{2}-\d{2}$/,
  927. errorMessage: '身份证止期格式错误',
  928. }]
  929. },
  930. },
  931. checkInfo: {},
  932. checkImage: [],
  933. licenseNo: '', //车牌号
  934. //使用性质
  935. carnatureIndex: 0,
  936. cartypeIndex: 0,
  937. cimodelclassIndex: 0,
  938. fuelTypeCodeIndex: 0,
  939. propertyIndex: 0,
  940. ownerGenderIndex: 0,
  941. policyHolderGenderIndex: 0,
  942. insuredPersonGenderIndex: 0,
  943. genderList: [{
  944. label: "男",
  945. value: "男",
  946. },
  947. {
  948. label: "女",
  949. value: "女",
  950. }
  951. ],
  952. identifyList: [{
  953. label: '身份证',
  954. id: "01"
  955. },
  956. {
  957. label: '护照',
  958. id: "02"
  959. },
  960. {
  961. label: '港澳台居民居住证',
  962. id: "03"
  963. },
  964. {
  965. label: '组织机构代码证',
  966. id: "04"
  967. },
  968. {
  969. label: '统一社会信用代码证',
  970. id: "05"
  971. },
  972. {
  973. label: '营业执照',
  974. id: "06"
  975. }
  976. ],
  977. ownerIdentifyIndex: 0,
  978. policyHolderIdentifyIndex: 0,
  979. insuredPersonIdentifyIndex: 0,
  980. holderAndOwner: true, //投保人同车主
  981. insuredAndOwner: false, //被保人同车主
  982. tbrAndOwner: true, //被保人同投保人
  983. ownerInfo: {
  984. name: "",
  985. identifyType: "01",
  986. identifyNumber: "",
  987. addr: "",
  988. gender: "", //性别
  989. email: "", //邮箱
  990. mobile: "",
  991. identifyValidDate: "", //有效期起期
  992. identifyValidEndDate: "", //有效期止期
  993. age: "", //年龄
  994. },
  995. policyHolderInfo: {
  996. name: "",
  997. identifyType: "01",
  998. identifyNumber: "",
  999. addr: "",
  1000. gender: "", //性别
  1001. email: "",
  1002. mobile: "",
  1003. identifyValidDate: "", //有效期起期
  1004. identifyValidEndDate: "", //有效期止期
  1005. age: "", //年龄
  1006. },
  1007. insuredPersonInfo: {
  1008. name: "",
  1009. identifyType: "01",
  1010. identifyNumber: "",
  1011. addr: "",
  1012. gender: "", //性别
  1013. email: "",
  1014. mobile: "",
  1015. identifyValidDate: "", //有效期起期
  1016. identifyValidEndDate: "", //有效期止期
  1017. age: "", //年龄
  1018. },
  1019. riskList: [], //交强险和商业险的选择
  1020. kindList: [], //商业险险种的选择
  1021. token: "",
  1022. /* 数据字典 */
  1023. natureOfVehicleUseoptions: [],
  1024. vehicleTypeoptions: [],
  1025. trafficManagementVehicleTypeoptions: [],
  1026. energyTypeoptions: [],
  1027. businessVehicleUseoptions: [],
  1028. outOfBusinessVehicleUseoptions: [],
  1029. /* 数据字典 */
  1030. model: {
  1031. ownerInforegion: '',
  1032. policyHolderInforegion: '',
  1033. insuredPersonInforegion: '',
  1034. },
  1035. previewImgs: [],
  1036. }
  1037. },
  1038. onShow() {
  1039. nextTick(() => {
  1040. this.getDicType("businessVehicleUse"); //车辆用途(营业)
  1041. this.getDicType("outOfBusinessVehicleUse"); //车辆用途(非营业)
  1042. this.getDicType("natureOfVehicleUse"); //车辆性质
  1043. this.getDicType("vehicleType"); //车辆种类
  1044. this.getDicType("trafficManagementVehicleType"); //车辆类型
  1045. this.getDicType("energyType"); //能源种类
  1046. })
  1047. },
  1048. onLoad(options) {
  1049. //--数据字典 begin --
  1050. if (!!options.licenseNo) {
  1051. // this.licenseNo = decodeURIComponent(options.licenseNo);
  1052. } else {
  1053. const eventChannel = this.getOpenerEventChannel()
  1054. // 监听acceptData事件,获取上一页面通过eventChannel传送到当前页面的数据
  1055. eventChannel.on('acceptData', (data) => {
  1056. if (!!data) {
  1057. //读取上一个页面传过来数据(车辆信息,人员信息,险种信息)
  1058. this.carInfo = data.carInfo; //车辆信息
  1059. this.ownerInfo = JSON.parse(JSON.stringify(data.ownerInfo));
  1060. this.policyHolderInfo = JSON.parse(JSON.stringify(data.policyHolderInfo));
  1061. this.insuredPersonInfo = JSON.parse(JSON.stringify(data.insuredPersonInfo));
  1062. this.carInfoPositiveList = data.carInfoPositiveList; //车辆
  1063. this.ownerInfoPositiveList = data.ownerInfoPositiveList; //车主
  1064. this.policyHolderInfoPositiveList = data.policyHolderInfoPositiveList; //投保
  1065. this.insuredPersonInfoPositiveList = data.insuredPersonInfoPositiveList; //被保人
  1066. this.riskList = data.riskList; //险种大类
  1067. this.kindList = data.kindList; //商业险险别
  1068. this.licenseNo = this.carInfo.licenseNo;
  1069. this.holderAndOwner = false; //投保人同车主
  1070. this.insuredAndOwner = false; //被保人同车主
  1071. this.tbrAndOwner = false; //被保人同投保人
  1072. }
  1073. })
  1074. };
  1075. this.token = store.state.token
  1076. },
  1077. // 监听导航栏的按钮
  1078. onNavigationBarButtonTap(e) {
  1079. if (e.index == 0) {
  1080. this.navigate({
  1081. url: '/pages/index/index'
  1082. }, "switchTab", true);
  1083. }
  1084. },
  1085. computed: {
  1086. startDate() {
  1087. return this.getDate('start');
  1088. },
  1089. endDate() {
  1090. return this.getDate('end');
  1091. },
  1092. },
  1093. methods: {
  1094. transferFlagchange(status) {
  1095. if (status) {
  1096. this.carInfo.transferDate = this.carInfo.issueDate;
  1097. } else {
  1098. this.carInfo.transferDate = ""
  1099. }
  1100. },
  1101. async getDicType(type) {
  1102. let res = await this.$http.get('/sysDict/dictDetails/' + type);
  1103. if (res.code == 200) {
  1104. this[type + 'options'] = res.data.ddList;
  1105. if (type == "trafficManagementVehicleType") {
  1106. this.carInfo1.cartype = this.dictionaryMatching(this.trafficManagementVehicleTypeoptions, this
  1107. .carInfo
  1108. .cartype)
  1109. }
  1110. }
  1111. },
  1112. dictionaryConfirm(e, name) {
  1113. this.carInfo[name] = e[0].value;
  1114. this.carInfo1[name] = e[0].label;
  1115. },
  1116. /**
  1117. * @param {String} e 时间选择器的值
  1118. * @param {String} obj 储存表单对象
  1119. * @param {String} param 储存表单参数
  1120. */
  1121. Dateconfirm(e, obj, param) {
  1122. this[obj][param] = e.year + '-' + e.month + '-' + e.day;
  1123. },
  1124. //选择驾照图片或拍摄驾照图片
  1125. chooseImage(type, index) {
  1126. this.checkType = type;
  1127. this.checkIndex = index;
  1128. this.ImageOcrShow = true;
  1129. },
  1130. //行驶证正面
  1131. async carfrontChange() {
  1132. if (this.carfrontImg) {
  1133. this.previewImgs = [{
  1134. url: this.carfrontImg
  1135. }];
  1136. this.$refs.previewImage.open(0); // 传入当前选中的图片地址或序号
  1137. } else {
  1138. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  1139. count: 1,
  1140. sizeType: ['compressed']
  1141. });
  1142. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  1143. if (!size) {
  1144. this.$refs.uToast.show({
  1145. title: '上传图片大小不能超过 5MB!',
  1146. type: 'error',
  1147. })
  1148. return false
  1149. }
  1150. if (chooseImageRes) {
  1151. this.lodingshow = true;
  1152. this.carfrontImg = chooseImageRes.tempFilePaths[0];
  1153. uni.uploadFile({
  1154. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  1155. filePath: this.carfrontImg,
  1156. name: "multipartFile",
  1157. formData: {
  1158. 'type': 'image',
  1159. },
  1160. header: {
  1161. Authorization: this.token,
  1162. },
  1163. success: (imgRes) => {
  1164. let data = JSON.parse(imgRes.data);
  1165. if (data.code == '200') {
  1166. if (this.carInfoPositiveList.some(v => v.imageType == 'C01')) {
  1167. this.carInfoPositiveList.map(val => {
  1168. if (val.imageType == 'C01') {
  1169. val.imageId = data.data.id;
  1170. }
  1171. })
  1172. } else {
  1173. this.carInfoPositiveList.push({
  1174. imageId: data.data.id,
  1175. imageType: "C01",
  1176. })
  1177. }
  1178. uni.uploadFile({
  1179. url: this.$base.baseUrl + '/order/identify/drivingPermit',
  1180. filePath: this.carfrontImg,
  1181. name: "image1",
  1182. header: {
  1183. Authorization: this.token,
  1184. },
  1185. success: (uploadFileRes) => {
  1186. let data = JSON.parse(uploadFileRes.data).data;
  1187. let rdate = '';
  1188. if (!!data.carInfo.registerDate) {
  1189. rdate = data.carInfo.registerDate.substr(0,
  1190. 4) +
  1191. '-' + data.carInfo
  1192. .registerDate.substr(4, 2) + '-' + data
  1193. .carInfo
  1194. .registerDate
  1195. .substr(6,
  1196. 2)
  1197. }
  1198. let isdate = '';
  1199. if (!!data.carInfo.issueDate) {
  1200. isdate = data.carInfo.issueDate.substr(0, 4) +
  1201. '-' + data.carInfo
  1202. .issueDate.substr(4, 2) + '-' + data
  1203. .carInfo
  1204. .issueDate.substr(6, 2)
  1205. }
  1206. this.ownerInfo.name = data.carInfo.carOwner; //车主
  1207. this.carfront = {
  1208. carOwner: data.carInfo.carOwner, //车主
  1209. licenseNo: data.carInfo.plateNo, //车牌号
  1210. modelcname: data.carInfo.backOcrID, //品牌型号
  1211. frameNo: data.carInfo.vin, //车架号
  1212. engineNo: data.carInfo.engine, //发动机号
  1213. vinNo: data.carInfo.vin, //车架号
  1214. issueDate: isdate, //发证日期
  1215. registerDate: rdate, //注册日期
  1216. cimodelclass: data.carInfo
  1217. .plateType, //车辆种类
  1218. carnature: data.carInfo.motorUsageTypeCode,
  1219. cartype: data.carInfo.category, //车辆类型
  1220. }
  1221. this.lodingshow = false;
  1222. }
  1223. });
  1224. }
  1225. }
  1226. });
  1227. } else {
  1228. this.lodingshow = false;
  1229. }
  1230. }
  1231. },
  1232. //行驶证反面
  1233. async carbackChange() {
  1234. if (this.carbackImg) {
  1235. this.previewImgs = [{
  1236. url: this.carbackImg
  1237. }];
  1238. this.$refs.previewImage.open(0); // 传入当前选中的图片地址或序号
  1239. } else {
  1240. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  1241. count: 1,
  1242. sizeType: ['compressed']
  1243. });
  1244. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  1245. if (!size) {
  1246. this.$refs.uToast.show({
  1247. title: '上传图片大小不能超过 5MB!',
  1248. type: 'error',
  1249. })
  1250. return false
  1251. }
  1252. if (chooseImageRes) {
  1253. this.lodingshow = true;
  1254. this.carbackImg = chooseImageRes.tempFilePaths[0];
  1255. uni.uploadFile({
  1256. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  1257. filePath: this.carbackImg,
  1258. name: "multipartFile",
  1259. formData: {
  1260. 'type': 'image',
  1261. },
  1262. header: {
  1263. Authorization: this.token,
  1264. },
  1265. success: (imgRes) => {
  1266. let data = JSON.parse(imgRes.data);
  1267. if (data.code == '200') {
  1268. if (this.carInfoPositiveList.some(v => v.imageType == 'D01')) {
  1269. this.carInfoPositiveList.map(val => {
  1270. if (val.imageType == 'D01') {
  1271. val.imageId = data.data.id;
  1272. }
  1273. })
  1274. } else {
  1275. this.carInfoPositiveList.push({
  1276. imageId: data.data.id,
  1277. imageType: "D01",
  1278. })
  1279. }
  1280. uni.uploadFile({
  1281. url: this.$base.baseUrl + '/order/identify/drivingPermit',
  1282. filePath: this.carbackImg,
  1283. name: "image2",
  1284. header: {
  1285. Authorization: this.token,
  1286. },
  1287. success: (uploadFileRes) => {
  1288. let data1 = JSON.parse(uploadFileRes.data).data;
  1289. this.carback = {
  1290. vehicleweight: data1.carInfo
  1291. .grossMass, //总质量
  1292. completeKerbMass: data1.carInfo
  1293. .unladenMass, //整备质量
  1294. seatCount: data1.carInfo
  1295. .approvedPassengersCapacity, //核定载客数
  1296. limitLoad: data1.carInfo
  1297. .limitLoad, //核定载质量
  1298. }
  1299. this.lodingshow = false;
  1300. }
  1301. });
  1302. }
  1303. }
  1304. });
  1305. } else {
  1306. this.lodingshow = false;
  1307. }
  1308. }
  1309. },
  1310. //身份证正面
  1311. async userfrontChange() {
  1312. if (this.userfrontImg) {
  1313. this.previewImgs = [{
  1314. url: this.userfrontImg
  1315. }];
  1316. this.$refs.previewImage.open(0); // 传入当前选中的图片地址或序号
  1317. } else {
  1318. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  1319. count: 1,
  1320. sizeType: ['compressed']
  1321. });
  1322. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  1323. if (!size) {
  1324. this.$refs.uToast.show({
  1325. title: '上传图片大小不能超过 5MB!',
  1326. type: 'error',
  1327. })
  1328. return false
  1329. }
  1330. if (chooseImageRes) {
  1331. this.lodingshow = true;
  1332. this.userfrontImg = chooseImageRes.tempFilePaths[0];
  1333. uni.uploadFile({
  1334. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  1335. filePath: this.userfrontImg,
  1336. name: "multipartFile",
  1337. formData: {
  1338. 'type': 'image',
  1339. },
  1340. header: {
  1341. Authorization: this.token,
  1342. },
  1343. success: (imgRes) => {
  1344. let data = JSON.parse(imgRes.data);
  1345. if (data.code == '200') {
  1346. let type = 'C0' + this.checkIndex;
  1347. if (this[this.checkType + 'PositiveList'].some(v => v.imageType ==
  1348. type)) {
  1349. this[this.checkType + 'PositiveList'].map(val => {
  1350. if (val.imageType == type) {
  1351. val.imageId = data.data.id;
  1352. }
  1353. })
  1354. } else {
  1355. this[this.checkType + 'PositiveList'].push({
  1356. imageId: data.data.id,
  1357. imageType: type,
  1358. })
  1359. }
  1360. uni.uploadFile({
  1361. url: this.$base.baseUrl + '/order/identify/idCard',
  1362. filePath: this.userfrontImg,
  1363. name: "image1",
  1364. header: {
  1365. Authorization: this.token,
  1366. },
  1367. success: (uploadFileRes) => {
  1368. let data = JSON.parse(uploadFileRes.data).data;
  1369. this.userfront = {
  1370. age: getAgeByIdCard(data.customerInfo
  1371. .identifyNumber),
  1372. name: data.customerInfo.name,
  1373. gender: data.customerInfo
  1374. .identifyIssuedCom,
  1375. identifyNumber: data.customerInfo
  1376. .identifyNumber,
  1377. addr: data.customerInfo.addr,
  1378. }
  1379. this.lodingshow = false;
  1380. }
  1381. });
  1382. }
  1383. }
  1384. });
  1385. } else {
  1386. this.lodingshow = false;
  1387. }
  1388. }
  1389. },
  1390. //身份证反面
  1391. async userbackChange() {
  1392. if (this.userbackImg) {
  1393. this.previewImgs = [{
  1394. url: this.userbackImg
  1395. }];
  1396. this.$refs.previewImage.open(0); // 传入当前选中的图片地址或序号
  1397. } else {
  1398. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  1399. count: 1,
  1400. sizeType: ['compressed']
  1401. });
  1402. let size = chooseImageRes.tempFiles[0].size / 1024 / 1024 < 5;
  1403. if (!size) {
  1404. this.$refs.uToast.show({
  1405. title: '上传图片大小不能超过 5MB!',
  1406. type: 'error',
  1407. })
  1408. return false
  1409. }
  1410. if (chooseImageRes) {
  1411. this.lodingshow = true;
  1412. this.userbackImg = chooseImageRes.tempFilePaths[0];
  1413. uni.uploadFile({
  1414. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  1415. filePath: this.userbackImg,
  1416. name: "multipartFile",
  1417. formData: {
  1418. 'type': 'image',
  1419. },
  1420. header: {
  1421. Authorization: this.token,
  1422. },
  1423. success: (imgRes) => {
  1424. let data = JSON.parse(imgRes.data);
  1425. if (data.code == '200') {
  1426. let type = 'D0' + this.checkIndex;
  1427. if (this[this.checkType + 'PositiveList'].some(v => v.imageType ==
  1428. type)) {
  1429. this[this.checkType + 'PositiveList'].map(val => {
  1430. if (val.imageType == type) {
  1431. val.imageId = data.data.id;
  1432. }
  1433. })
  1434. } else {
  1435. this[this.checkType + 'PositiveList'].push({
  1436. imageId: data.data.id,
  1437. imageType: type,
  1438. })
  1439. }
  1440. uni.uploadFile({
  1441. url: this.$base.baseUrl +
  1442. '/order/identify/idCard',
  1443. filePath: this.userbackImg,
  1444. name: "image2",
  1445. header: {
  1446. Authorization: this.token,
  1447. },
  1448. success: (uploadFileRes) => {
  1449. let data1 = JSON.parse(uploadFileRes.data).data;
  1450. let identifyValidDate = '';
  1451. if (!!data1.customerInfo
  1452. .identifyValidDate) {
  1453. identifyValidDate = data1
  1454. .customerInfo
  1455. .identifyValidDate
  1456. .substr(0, 4) +
  1457. '-' + data1
  1458. .customerInfo
  1459. .identifyValidDate
  1460. .substr(4, 2) + '-' +
  1461. data1
  1462. .customerInfo
  1463. .identifyValidDate
  1464. .substr(6,
  1465. 2)
  1466. }
  1467. let identifyValidEndDate = '';
  1468. if (!!data1.customerInfo
  1469. .identifyValidEndDate) {
  1470. identifyValidEndDate =
  1471. data1.customerInfo
  1472. .identifyValidEndDate
  1473. .substr(0,
  1474. 4) + '-' + data1
  1475. .customerInfo
  1476. .identifyValidEndDate
  1477. .substr(4, 2) + '-' +
  1478. data1
  1479. .customerInfo
  1480. .identifyValidEndDate
  1481. .substr(6, 2)
  1482. }
  1483. this.userback = {
  1484. identifyValidDate: identifyValidDate, //起期
  1485. identifyValidEndDate: identifyValidEndDate, //止期
  1486. }
  1487. this.lodingshow = false;
  1488. }
  1489. });
  1490. }
  1491. }
  1492. });
  1493. } else {
  1494. this.lodingshow = false;
  1495. }
  1496. }
  1497. },
  1498. CarOCRconfirm() {
  1499. switch (this.checkType) {
  1500. case 'carInfo':
  1501. Object.assign(this.carInfo, this.carfront, this
  1502. .carback);
  1503. this.carInfo1.cartype = this.dictionaryMatching(this.trafficManagementVehicleTypeoptions, this
  1504. .carInfo
  1505. .cartype)
  1506. this.ImageOcrShow = false;
  1507. break;
  1508. case 'ownerInfo':
  1509. case "policyHolderInfo":
  1510. case "insuredPersonInfo":
  1511. Object.assign(this[this.checkType], this.userfront, this
  1512. .userback);
  1513. this.ImageOcrShow = false;
  1514. break;
  1515. default:
  1516. break;
  1517. }
  1518. },
  1519. //图片删除
  1520. del_btn(val) {
  1521. this[val] = "";
  1522. },
  1523. //弹框关闭事件
  1524. ImagePopClose() {
  1525. this.carfrontImg = "";
  1526. this.carbackImg = "";
  1527. this.userfrontImg = "";
  1528. this.userbackImg = "";
  1529. this.carfront = {};
  1530. this.carback = {};
  1531. this.userfront = {};
  1532. this.userback = {};
  1533. },
  1534. /**
  1535. * 复写 binddata 方法,如果只是为了校验,无复杂自定义操作,可忽略此方法
  1536. * @param {String} name 字段名称
  1537. * @param {String} value 表单域的值
  1538. */
  1539. binddata(name, value, type) {
  1540. if (name == 'identifyNumber') {
  1541. this[type].age = getAgeByIdCard(value)
  1542. }
  1543. },
  1544. //转变大写(车型/车架号/发动机号)
  1545. upperCaseType(type) {
  1546. this.carInfo[type] = this.carInfo[type].toUpperCase();
  1547. if (type == 'vinNo') {
  1548. this.carInfo.frameNo = this.carInfo.vinNo.trim();
  1549. }
  1550. },
  1551. //下拉改变触发该方法
  1552. bindPickerChange(e, type, list) {
  1553. this[type + 'Index'] = e.target.value;
  1554. this.carInfo[type] = this[list][e.target.value].dictValue;
  1555. },
  1556. // 身份证类型选择
  1557. bindIdentifyTypeChange(e, type) {
  1558. this[type + 'IdentifyIndex'] = e.target.value;
  1559. this[type + 'Info'].identifyType = this.identifyList[e.target.value].id;
  1560. this[type + 'Info'].identifyNumber = '';
  1561. },
  1562. //性别匹配
  1563. bindGenderChange(e, type) {
  1564. this[type + 'GenderIndex'] = e.target.value;
  1565. this[type + 'Info'].gender = this.genderList[e.target.value].label;
  1566. },
  1567. bindDateChange(e, type) { //日期赋值
  1568. if ((type == 'issueDate') && (!this.carInfo.registerDate)) {
  1569. return uni.showToast({
  1570. title: '请先输入注册日期',
  1571. icon: "none"
  1572. });
  1573. }
  1574. this.carInfo[type] = e.detail.value;
  1575. if (new Date(this.carInfo.registerDate) > new Date(this.carInfo.issueDate)) {
  1576. this.carInfo.issueDate = ""
  1577. return uni.showToast({
  1578. title: '注册日期大于发证日期',
  1579. icon: "none"
  1580. });
  1581. }
  1582. },
  1583. //长期
  1584. insureLongterm(checked, e) {
  1585. checked.detail.value == true ? this[e].identifyValidEndDate = "9999-12-31" : this[e]
  1586. .identifyValidEndDate =
  1587. "";
  1588. },
  1589. //日期(可以选择20年以内的时间)
  1590. getDate(type) {
  1591. const date = new Date();
  1592. let year = date.getFullYear();
  1593. let month = date.getMonth() + 1;
  1594. let day = date.getDate();
  1595. if (type === 'start') {
  1596. year = year - 20;
  1597. } else if (type === 'end') {}
  1598. month = month > 9 ? month : '0' + month;;
  1599. day = day > 9 ? day : '0' + day;
  1600. return `${year}-${month}-${day}`;
  1601. },
  1602. //同车主信息
  1603. syncPersonInfo(e, type, touch1, touch2, touch3) {
  1604. this[type] = e.detail.value;
  1605. this[touch1 + 'IdentifyIndex'] = this[touch2 + 'IdentifyIndex'];
  1606. if (this[type]) {
  1607. this[touch1 + 'Info'] = JSON.parse(JSON.stringify(this[touch2 + 'Info']));
  1608. this[touch3] = false;
  1609. } else {
  1610. for (let key in this[touch1 + "Info"]) {
  1611. this[touch1 + "Info"][key] = '';
  1612. }
  1613. }
  1614. },
  1615. //跳转选择车辆类型页面
  1616. toChooseVehicleType(cctype) {
  1617. if (cctype == '' || cctype == null) {
  1618. uni.showToast({
  1619. icon: 'none',
  1620. title: '请输入车型名称',
  1621. duration: 1500
  1622. });
  1623. } else {
  1624. let cctypeName = cctype.replace(/[^u4e00-u9fa5|,]+/ig, '')
  1625. this.navigate({
  1626. url: '/pages/carInsure1/carType1?modelName=' + encodeURIComponent(cctypeName)
  1627. }, "navigateTo", true);
  1628. }
  1629. },
  1630. // 通过车架号获取车型
  1631. async toChooseVin(cctype) {
  1632. if (cctype == '' || cctype == null) {
  1633. return uni.showToast({
  1634. icon: 'none',
  1635. title: '请输入车架号',
  1636. duration: 1500
  1637. });
  1638. } else {
  1639. if (!this.isFrameno(cctype.trim())) {
  1640. return uni.showToast({
  1641. title: '请输入正确的车辆识别码',
  1642. icon: "none"
  1643. });
  1644. }
  1645. this.navigate({
  1646. url: '/pages/carInsure1/carType1?frameNo=' + encodeURIComponent(cctype)
  1647. }, "navigateTo", true);
  1648. }
  1649. },
  1650. //验证车架号
  1651. isFrameno(str) {
  1652. let mPattern = /^([0-9A-Z]){17}$/;
  1653. return mPattern.test(str);
  1654. },
  1655. toNext() {
  1656. if (this.holderAndOwner) { //投保人同车主
  1657. this.policyHolderInfo = this.ownerInfo;
  1658. if (this.ownerInfoPositiveList.length > 0) {
  1659. this.policyHolderInfoPositiveList = JSON.parse(JSON.stringify(this
  1660. .ownerInfoPositiveList));
  1661. if (this.policyHolderInfoPositiveList.length == 1) {
  1662. this.policyHolderInfoPositiveList[0].imageType = "C03";
  1663. } else {
  1664. this.policyHolderInfoPositiveList[0].imageType = "C03";
  1665. this.policyHolderInfoPositiveList[1].imageType = "D03";
  1666. }
  1667. }
  1668. }
  1669. if (this.insuredAndOwner) { //被保人同车主
  1670. this.insuredPersonInfo = this.ownerInfo;
  1671. if (this.ownerInfoPositiveList.length > 0) {
  1672. this.insuredPersonInfoPositiveList = JSON.parse(JSON.stringify(this
  1673. .ownerInfoPositiveList));
  1674. if (this.insuredPersonInfoPositiveList.length == 1) {
  1675. this.insuredPersonInfoPositiveList[0].imageType = "C04";
  1676. } else {
  1677. this.insuredPersonInfoPositiveList[0].imageType = "C04";
  1678. this.insuredPersonInfoPositiveList[1].imageType = "D04";
  1679. }
  1680. }
  1681. }
  1682. if (this.tbrAndOwner) { //被保人同投保人
  1683. this.insuredPersonInfo = this.policyHolderInfo;
  1684. if (this.policyHolderInfoPositiveList.length > 0) {
  1685. this.insuredPersonInfoPositiveList = JSON.parse(JSON.stringify(this
  1686. .policyHolderInfoPositiveList));
  1687. if (this.insuredPersonInfoPositiveList.length == 1) {
  1688. this.insuredPersonInfoPositiveList[0].imageType = "C04";
  1689. } else {
  1690. this.insuredPersonInfoPositiveList[0].imageType = "C04";
  1691. this.insuredPersonInfoPositiveList[1].imageType = "D04";
  1692. }
  1693. }
  1694. }
  1695. this.$refs.carForm.submit().then(res => {
  1696. this.$refs.ownerForm.submit().then(res1 => {
  1697. this.$refs.policyHolderForm.submit().then(res2 => {
  1698. this.$refs.insuredPersonForm.submit().then(res3 => {
  1699. this.navigate({
  1700. url: '/pages/carInsure1/insureItems1',
  1701. success: (res) => {
  1702. res.eventChannel.emit(
  1703. "acceptData", {
  1704. carInfo: this
  1705. .carInfo,
  1706. ownerInfo: this
  1707. .ownerInfo,
  1708. policyHolderInfo: this
  1709. .policyHolderInfo,
  1710. insuredPersonInfo: this
  1711. .insuredPersonInfo,
  1712. riskList: this
  1713. .riskList,
  1714. kindList: this
  1715. .kindList,
  1716. carInfoPositiveList: this
  1717. .carInfoPositiveList, //车辆
  1718. ownerInfoPositiveList: this
  1719. .ownerInfoPositiveList, //车主
  1720. policyHolderInfoPositiveList: this
  1721. .policyHolderInfoPositiveList, //投保人
  1722. insuredPersonInfoPositiveList: this
  1723. .insuredPersonInfoPositiveList, //被保人
  1724. })
  1725. }
  1726. }, "navigateTo", true);
  1727. })
  1728. })
  1729. })
  1730. })
  1731. },
  1732. //字典name匹配
  1733. dictionaryMatching(list, value) {
  1734. console.log(list)
  1735. let obj = list.find(val => val.dictValue == value);
  1736. return obj.dictTag;
  1737. }
  1738. }
  1739. }
  1740. </script>
  1741. <style lang="scss" scoped>
  1742. @import '@/style/mixin.scss';
  1743. /deep/ .uni-group__content {
  1744. padding-top: 0;
  1745. }
  1746. /deep/ .uni-forms--top {
  1747. padding: 0;
  1748. }
  1749. /deep/ .uni-forms-item {
  1750. margin-bottom: 0;
  1751. }
  1752. /deep/ .uni-input-input {
  1753. font-size: 26upx;
  1754. }
  1755. /deep/ .uni-switch-input-checked {
  1756. background-color: $themeColor !important;
  1757. border-color: $themeColor !important;
  1758. }
  1759. /deep/ .uni-group__content {
  1760. padding-bottom: 0;
  1761. }
  1762. /deep/ .uni-input-input {
  1763. font-size: 28upx;
  1764. }
  1765. .body {
  1766. width: 100vw;
  1767. /* min-height: 100vh; */
  1768. background: #f5f5f5;
  1769. /* background: #FFFFFF; */
  1770. font-family: "Arial,Helvetica,sans-serif,PingFangSC";
  1771. }
  1772. .title {
  1773. height: 90upx;
  1774. border-bottom: 1px solid #EEEEEE;
  1775. }
  1776. .checkButton {
  1777. margin: 0 20upx;
  1778. width: 100upx;
  1779. height: 50upx;
  1780. flex-shrink: 1;
  1781. background: rgba($themeColor, 0.6);
  1782. color: #FFFFFF;
  1783. border-radius: 5upx;
  1784. }
  1785. .textColor {
  1786. color: #6091f5;
  1787. }
  1788. textarea {
  1789. font-size: 28upx;
  1790. width: 330upx;
  1791. }
  1792. /* 底部的样式Start */
  1793. .infoBottom {
  1794. height: 140upx;
  1795. position: fixed;
  1796. bottom: 0;
  1797. left: 0;
  1798. right: 0;
  1799. background: #FFFFFF;
  1800. border-top: 1upx solid #EEEEEE;
  1801. z-index: 99;
  1802. }
  1803. .infoBottom>button {
  1804. // font-size: 30upx;
  1805. background: $themeColor;
  1806. color: #FFFFFF;
  1807. flex: 1;
  1808. margin: 0upx 30upx;
  1809. }
  1810. /* 底部的样式End */
  1811. .popContent {
  1812. height: 100%;
  1813. background-color: #f9f9f9;
  1814. .popHeader {
  1815. width: 100%;
  1816. text-align: center;
  1817. padding: 10px;
  1818. font-weight: bold;
  1819. background-color: #FFFFFF;
  1820. }
  1821. .imgOcr {
  1822. width: 100%;
  1823. background-color: #f9f9f9;
  1824. .imgOcr-border {
  1825. position: relative;
  1826. width: 49%;
  1827. background-color: #fff;
  1828. padding: 2px;
  1829. .del_btn {
  1830. cursor: pointer;
  1831. position: absolute;
  1832. top: 5rpx;
  1833. right: 0;
  1834. width: 50rpx;
  1835. height: 50rpx;
  1836. border-radius: 50%;
  1837. z-index: 20;
  1838. }
  1839. .obverseimg {
  1840. height: 120px;
  1841. border-radius: 4px;
  1842. }
  1843. }
  1844. }
  1845. .line {
  1846. width: 100%;
  1847. margin: 2px 0;
  1848. background-color: #FFFFFF;
  1849. padding: 0 10px;
  1850. >text {
  1851. font-weight: bold;
  1852. width: 100px;
  1853. }
  1854. }
  1855. .popFooter {
  1856. width: 100%;
  1857. height: 50px;
  1858. font-weight: bold;
  1859. background-color: #FFFFFF;
  1860. color: #3e5cd7;
  1861. .popFooter-btn:nth-child(1) {
  1862. border-right: 1px solid #f9f9f9;
  1863. }
  1864. .popFooter-btn {
  1865. width: 50%;
  1866. text-align: center;
  1867. line-height: 50px;
  1868. }
  1869. }
  1870. }
  1871. .mask {
  1872. /* pointer-events: none; */
  1873. position: fixed;
  1874. z-index: 99999;
  1875. top: 0;
  1876. left: 0;
  1877. right: 0;
  1878. bottom: 0;
  1879. height: 100vh;
  1880. width: 100vw;
  1881. display: flex;
  1882. flex-direction: column;
  1883. justify-content: center;
  1884. align-items: center;
  1885. flex-wrap: wrap;
  1886. }
  1887. .mask.mask-show {
  1888. background: rgba(255, 255, 255, 0.3);
  1889. }
  1890. .title {
  1891. color: #333;
  1892. font-size: 28rpx;
  1893. margin-top: 20rpx;
  1894. }
  1895. .loader {
  1896. display: block;
  1897. width: 120rpx;
  1898. height: 120rpx;
  1899. border-radius: 50%;
  1900. border: 3rpx solid transparent;
  1901. border-top-color: #9370db;
  1902. -webkit-animation: spin 2s linear infinite;
  1903. animation: spin 2s linear infinite;
  1904. }
  1905. .loader::before {
  1906. content: "";
  1907. position: absolute;
  1908. top: 5rpx;
  1909. left: 5rpx;
  1910. right: 5rpx;
  1911. bottom: 5rpx;
  1912. border-radius: 50%;
  1913. border: 3rpx solid transparent;
  1914. border-top-color: #ba55d3;
  1915. -webkit-animation: spin 3s linear infinite;
  1916. animation: spin 3s linear infinite;
  1917. }
  1918. .loader::after {
  1919. content: "";
  1920. position: absolute;
  1921. top: 15rpx;
  1922. left: 15rpx;
  1923. right: 15rpx;
  1924. bottom: 15rpx;
  1925. border-radius: 50%;
  1926. border: 3rpx solid transparent;
  1927. border-top-color: #ff00ff;
  1928. -webkit-animation: spin 1.5s linear infinite;
  1929. animation: spin 1.5s linear infinite;
  1930. }
  1931. @-webkit-keyframes spin {
  1932. 0% {
  1933. -webkit-transform: rotate(0deg);
  1934. -ms-transform: rotate(0deg);
  1935. transform: rotate(0deg);
  1936. }
  1937. 100% {
  1938. -webkit-transform: rotate(360deg);
  1939. -ms-transform: rotate(360deg);
  1940. transform: rotate(360deg);
  1941. }
  1942. }
  1943. @keyframes spin {
  1944. 0% {
  1945. -webkit-transform: rotate(0deg);
  1946. -ms-transform: rotate(0deg);
  1947. transform: rotate(0deg);
  1948. }
  1949. 100% {
  1950. -webkit-transform: rotate(360deg);
  1951. -ms-transform: rotate(360deg);
  1952. transform: rotate(360deg);
  1953. }
  1954. }
  1955. </style>