carInfo1.vue 65 KB

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