carInfo1.vue 65 KB

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