carInfo1.vue 67 KB

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