carInfo1.vue 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442
  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','car')" 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="vinNo" 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.vinNo"
  22. maxlength="17" @blur="binddata('vinNo', $event.detail.value,'carForm')"
  23. placeholder-style="font-size:28upx" @input="upperCaseType('vinNo')" />
  24. <text class="checkButton d-flex a-center j-center" @tap="toChooseVin">校验</text>
  25. </view>
  26. </uni-forms-item>
  27. <uni-forms-item name="brandName" required label="品牌型号: ">
  28. <view class="d-flex a-center textColor" style="height: 100%;">
  29. <input class="uni-input-input flex-1 textColor" placeholder="请输入品牌型号"
  30. v-model="carInfo.brandName" @blur="binddata('brandName', $event.detail.value,'carForm')"
  31. placeholder-style="font-size:28upx" @input="upperCaseType('brandName')" />
  32. <text class="checkButton d-flex a-center j-center" @tap="toChooseVehicleType">校验</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="使用性质: ">
  63. <view class="d-flex a-center" style="width:100%;height: 100%;">
  64. <picker class="d-flex a-center" style="width:100%;height: 100%;" mode="selector"
  65. range-key="label" :range="carnatureList" :value="carnatureIndex"
  66. @change="bindPickerChange($event,'carnature')">
  67. <view class="textColor">{{carnatureList[carnatureIndex]['label']}}</view>
  68. </picker>
  69. </view>
  70. </uni-forms-item>
  71. <uni-forms-item label="能源种类: ">
  72. <view class="d-flex a-center" style="width:100%;height: 100%;">
  73. <picker class="d-flex a-center" style="width:100%;height: 100%;" mode="selector"
  74. range-key="label" :range="fuelTypeCodeList" :value="fuelTypeCodeIndex"
  75. @change="bindPickerChange($event,'fuelTypeCode')">
  76. <view class="textColor">{{fuelTypeCodeList[fuelTypeCodeIndex]['label']}}</view>
  77. </picker>
  78. </view>
  79. </uni-forms-item>
  80. <uni-forms-item required label="注册日期" name="registerDate" style="margin-right: 14px;">
  81. <u-input type="select" :select-open="registerDateShow" v-model="carInfo.registerDate"
  82. placeholder="请选择注册日期" @click="registerDateShow = true"
  83. placeholder-style="color:#808080"></u-input>
  84. <u-picker v-model="registerDateShow" mode="time" :params="params" :end-year="endYear"
  85. :end-month="endMonth" @confirm="e=> Dateconfirm(e,'carInfo','registerDate')"></u-picker>
  86. </uni-forms-item>
  87. <uni-forms-item required label="发证日期" name="issueDate" style="margin-right: 14px;">
  88. <u-input type="select" :select-open="issueDateShow" v-model="carInfo.issueDate"
  89. placeholder="请选择发证日期" @click="issueDateShow = true" placeholder-style="color:#808080"></u-input>
  90. <u-picker v-model="issueDateShow" mode="time" :params="params" :end-year="endYear"
  91. :end-month="endMonth" @confirm="e=> Dateconfirm(e,'carInfo','issueDate')"></u-picker>
  92. </uni-forms-item>
  93. <uni-forms-item v-if="carInfo.transferFlag" required label="转移登记日期" name="transferDate"
  94. style="margin-right: 14px;">
  95. <u-input type="select" :select-open="transferDateShow" v-model="carInfo.transferDate"
  96. placeholder="请选择过户日期" @click="transferDateShow = true"
  97. placeholder-style="color:#808080"></u-input>
  98. <u-picker v-model="transferDateShow" mode="time" :params="params" :end-year="endYear"
  99. :end-month="endMonth" @confirm="e=> Dateconfirm(e,'carInfo','transferDate')"></u-picker>
  100. </uni-forms-item>
  101. <uni-forms-item required label="是否过户: ">
  102. <view class="d-flex j-end">
  103. <switch style="transform: scale(0.6)" @change="isChangeStatus" />
  104. </view>
  105. </uni-forms-item>
  106. </uni-forms>
  107. </uni-group>
  108. <uni-group title="" top="10">
  109. <uni-forms :rules="ownerRules" :value="ownerInfo" ref="ownerForm" validate-trigger="bind"
  110. err-show-type="toast" label-width="100">
  111. <uni-forms-item>
  112. <view class="title d-flex a-center j-sb font-md">
  113. <text class="font-weight">车主</text>
  114. <view class="icon iconfont icon-shenfenzhengshibie font-lg main-text-color"
  115. @tap="chooseImage('ownerInfo')" style="margin-right: 14px;"></view>
  116. </view>
  117. </uni-forms-item>
  118. <uni-forms-item name="name" required label="姓名: ">
  119. <input class="uni-input-input textColor" placeholder="请输入姓名" v-model="ownerInfo.name" maxlength="5"
  120. @blur="binddata('name', $event.detail.value,'ownerForm')" placeholder-style="font-size:28upx" />
  121. </uni-forms-item>
  122. <uni-forms-item name="identifyType" required label="证件类型:">
  123. <view class="d-flex a-center" style="width:100%;height: 100%;">
  124. <picker disabled class="d-flex a-center" style="width:100%;height: 100%;" mode="selector"
  125. range-key="label" :range="identifyList" v-model="ownerIdentifyIndex"
  126. @change="bindIdentifyTypeChange($event,'owner')">
  127. <view class="textColor">{{identifyList[ownerIdentifyIndex]['label']}}</view>
  128. </picker>
  129. </view>
  130. </uni-forms-item>
  131. <uni-forms-item required name="identifyNumber" label="证件号: ">
  132. <input class="uni-input-input textColor" placeholder="请输入证件号" v-model="ownerInfo.identifyNumber"
  133. maxlength="18" @blur="binddata('identifyNumber', $event.detail.value,'ownerForm')"
  134. placeholder-style="font-size:28upx" />
  135. </uni-forms-item>
  136. <uni-forms-item required name="mobile" label="手机号: ">
  137. <input class="uni-input-input textColor" placeholder="请输入手机号" v-model="ownerInfo.mobile"
  138. maxlength="11" @blur="binddata('mobile', $event.detail.value,'ownerForm')"
  139. placeholder-style="font-size:28upx" />
  140. </uni-forms-item>
  141. <uni-forms-item required name="addr" label="地址: " style="margin-right: 14px;">
  142. <textarea class="textColor" v-model="ownerInfo.addr"
  143. style="width:100%;line-height: 50upx;margin-top: 15upx;" placeholder-style="font-size:28upx;"
  144. placeholder="请输入地址" auto-height @blur="binddata('addr', $event.detail.value,'ownerForm')" />
  145. </uni-forms-item>
  146. <uni-forms-item required label="有效期起期" name="identifyValidDate" style="margin-right: 14px;">
  147. <u-input type="select" :select-open="ownerDateShow" v-model="ownerInfo.identifyValidDate"
  148. placeholder="请选择有效期起期" @click="ownerDateShow = true"
  149. placeholder-style="color:#808080"></u-input>
  150. <u-picker v-model="ownerDateShow" mode="time" :params="params" :end-year="endYear"
  151. :end-month="endMonth" @confirm="e=> Dateconfirm(e,'ownerInfo','identifyValidDate')"></u-picker>
  152. </uni-forms-item>
  153. <uni-forms-item required label="有效期止期" name="identifyValidEndDate">
  154. <view class="dis j-s a-c">
  155. <u-input type="select" :select-open="ownerEndDateShow" v-model="ownerInfo.identifyValidEndDate"
  156. placeholder="请选择有效期止期" @click="ownerEndDateShow = true" placeholder-style="color:#808080"
  157. style="margin-right: 14px;"></u-input>
  158. <view class=" dis j-c a-c ">
  159. <text>长期</text>
  160. <switch style="transform: scale(0.6)"
  161. @change="checked=> insureLongterm(checked,'ownerInfo')" />
  162. </view>
  163. </view>
  164. <u-picker v-model="ownerEndDateShow" mode="time" :params="params" :end-year="endYear"
  165. :end-month="endMonth"
  166. @confirm="e=> Dateconfirm(e,'ownerInfo','identifyValidEndDate')"></u-picker>
  167. </uni-forms-item>
  168. </uni-forms>
  169. </uni-group>
  170. <uni-group title="" top="10">
  171. <uni-forms :rules="policyHolderRules" :value="policyHolderInfo" ref="policyHolderForm"
  172. validate-trigger="bind" err-show-type="toast" label-width="100">
  173. <uni-forms-item>
  174. <view class="title d-flex a-center j-sb font-md">
  175. <text class="font-weight">投保人</text>
  176. <view class="d-flex a-center j-sb">
  177. <switch style="transform: scale(0.6);" :checked="holderAndOwner"
  178. @change="e=>syncPersonInfo(e,'holderAndOwner','policyHolder','owner')" />
  179. <text style="margin-right: 10px;">同车主</text>
  180. <view class="icon iconfont icon-shenfenzhengshibie font-lg main-text-color"
  181. @tap="chooseImage('policyHolderInfo')" style="margin-right: 14px;"></view>
  182. </view>
  183. </view>
  184. </uni-forms-item>
  185. <template v-if="!holderAndOwner">
  186. <uni-forms-item name="name" required label="姓名: ">
  187. <input class="uni-input-input textColor" placeholder="请输入姓名" v-model="policyHolderInfo.name"
  188. maxlength="5" @blur="binddata('name', $event.detail.value,'policyHolderForm')"
  189. placeholder-style="font-size:28upx" />
  190. </uni-forms-item>
  191. <uni-forms-item name="identifyType" required label="证件类型: ">
  192. <view class="d-flex a-center" style="width:100%;height: 100%;">
  193. <picker disabled class="d-flex a-center" style="width:100%;height: 100%;" mode="selector"
  194. range-key="label" :range="identifyList" v-model="policyHolderIdentifyIndex"
  195. @change="bindIdentifyTypeChange($event,'policyHolder')">
  196. <view class="textColor">{{identifyList[policyHolderIdentifyIndex]['label']}}</view>
  197. </picker>
  198. </view>
  199. </uni-forms-item>
  200. <uni-forms-item required name="identifyNumber" label="证件号: ">
  201. <input class="uni-input-input textColor" placeholder="请输入证件号"
  202. v-model="policyHolderInfo.identifyNumber" maxlength="18"
  203. @blur="binddata('identifyNumber', $event.detail.value,'policyHolderForm')"
  204. placeholder-style="font-size:28upx" />
  205. </uni-forms-item>
  206. <uni-forms-item required name="mobile" label="手机号: ">
  207. <input class="uni-input-input textColor" placeholder="请输入手机号" v-model="policyHolderInfo.mobile"
  208. maxlength="11" @blur="binddata('mobile', $event.detail.value,'policyHolderForm')"
  209. placeholder-style="font-size:28upx" />
  210. </uni-forms-item>
  211. <uni-forms-item required name="addr" label="地址: ">
  212. <textarea class="textColor" v-model="policyHolderInfo.addr"
  213. style="width:100%;line-height: 50upx;margin-top: 15upx;"
  214. placeholder-style="font-size:28upx;" placeholder="请输入地址" auto-height
  215. @blur="binddata('addr', $event.detail.value,'policyHolderForm')" />
  216. </uni-forms-item>
  217. <uni-forms-item required label="有效期起期" name="identifyValidDate" style="margin-right: 14px;">
  218. <u-input type="select" :select-open="policyHolderDateShow"
  219. v-model="policyHolderInfo.identifyValidDate" placeholder="请选择有效期起期"
  220. @click="policyHolderDateShow = true" placeholder-style="color:#808080"></u-input>
  221. <u-picker v-model="policyHolderDateShow" mode="time" :params="params" :end-year="endYear"
  222. :end-month="endMonth"
  223. @confirm="e=> Dateconfirm(e,'policyHolderInfo','identifyValidDate')"></u-picker>
  224. </uni-forms-item>
  225. <uni-forms-item required label="有效期止期" name="identifyValidEndDate">
  226. <view class="dis j-s a-c">
  227. <u-input type="select" :select-open="policyHolderEndDateShow"
  228. v-model="policyHolderInfo.identifyValidEndDate" placeholder="请选择有效期止期"
  229. @click="policyHolderEndDateShow = true" placeholder-style="color:#808080"
  230. style="margin-right: 14px;"></u-input>
  231. <view class=" dis j-c a-c ">
  232. <text>长期</text>
  233. <switch style="transform: scale(0.6)"
  234. @change="checked=>insureLongterm(checked,'policyHolderInfo')" />
  235. </view>
  236. </view>
  237. <u-picker v-model="policyHolderEndDateShow" mode="time" :params="params" :end-year="endYear"
  238. :end-month="endMonth"
  239. @confirm="e=> Dateconfirm(e,'policyHolderInfo','identifyValidEndDate')"></u-picker>
  240. </uni-forms-item>
  241. </template>
  242. </uni-forms>
  243. </uni-group>
  244. <uni-group title="" top="10">
  245. <uni-forms :rules="insuredPersonRules" :value="insuredPersonInfo" ref="insuredPersonForm"
  246. validate-trigger="bind" err-show-type="toast" label-width="100">
  247. <uni-forms-item>
  248. <view class="title d-flex a-center j-sb font-md">
  249. <text class="font-weight">被保人</text>
  250. <view class="d-flex a-center j-sb">
  251. <view class="d-flex a-center j-sb" v-if="!insuredAndOwner">
  252. <switch style="transform: scale(0.6);" :checked="tbrAndOwner"
  253. @change="e=>syncPersonInfo(e,'tbrAndOwner','insuredPerson','policyHolder')" />
  254. <text style="margin-right: 10px;">同投保人</text>
  255. </view>
  256. <view class="d-flex a-center j-sb" v-if="!tbrAndOwner">
  257. <switch style="transform: scale(0.6);" :checked="insuredAndOwner"
  258. @change="e=>syncPersonInfo(e,'insuredAndOwner','insuredPerson','owner')" />
  259. <text style="margin-right: 10px;">同车主</text>
  260. </view>
  261. <view class="icon iconfont icon-shenfenzhengshibie font-lg main-text-color"
  262. @tap="chooseImage('insuredPersonInfo')" style="margin-right: 14px;"></view>
  263. </view>
  264. </view>
  265. </uni-forms-item>
  266. <template v-if="!insuredAndOwner && !tbrAndOwner">
  267. <uni-forms-item name="name" required label="姓名: ">
  268. <input class="uni-input-input textColor" placeholder="请输入姓名" v-model="insuredPersonInfo.name"
  269. maxlength="5" @blur="binddata('name', $event.detail.value,'insuredPersonForm')"
  270. placeholder-style="font-size:28upx" />
  271. </uni-forms-item>
  272. <uni-forms-item name="identifyType" required label="证件类型: ">
  273. <view class="d-flex a-center" style="width:100%;height: 100%;">
  274. <picker disabled class="d-flex a-center" style="width:100%;height: 100%;" mode="selector"
  275. range-key="label" :range="identifyList" v-model="insuredPersonIdentifyIndex"
  276. @change="bindIdentifyTypeChange($event,'insuredPerson')">
  277. <view class="textColor">{{identifyList[insuredPersonIdentifyIndex]['label']}}</view>
  278. </picker>
  279. </view>
  280. </uni-forms-item>
  281. <uni-forms-item required name="identifyNumber" label="证件号: ">
  282. <input class="uni-input-input textColor" placeholder="请输入证件号"
  283. v-model="insuredPersonInfo.identifyNumber" maxlength="18"
  284. @blur="binddata('identifyNumber', $event.detail.value,'insuredPersonForm')"
  285. placeholder-style="font-size:28upx" />
  286. </uni-forms-item>
  287. <uni-forms-item required name="mobile" label="手机号: ">
  288. <input class="uni-input-input textColor" placeholder="请输入手机号" v-model="insuredPersonInfo.mobile"
  289. maxlength="11" @blur="binddata('mobile', $event.detail.value,'insuredPersonForm')"
  290. placeholder-style="font-size:28upx" />
  291. </uni-forms-item>
  292. <uni-forms-item required name="addr" label="地址: ">
  293. <textarea class="textColor" v-model="insuredPersonInfo.addr"
  294. style="width:100%;line-height: 50upx;margin-top: 15upx;"
  295. placeholder-style="font-size:28upx;" placeholder="请输入地址" auto-height
  296. @blur="binddata('addr', $event.detail.value,'insuredPersonForm')" />
  297. </uni-forms-item>
  298. <uni-forms-item required label="有效期起期" name="identifyValidDate" style="margin-right: 14px;">
  299. <u-input type="select" :select-open="insuredPersonDateShow"
  300. v-model="insuredPersonInfo.identifyValidDate" placeholder="请选择有效期起期"
  301. @click="insuredPersonDateShow = true" placeholder-style="color:#808080"></u-input>
  302. <u-picker v-model="insuredPersonDateShow" mode="time" :params="params" :end-year="endYear"
  303. :end-month="endMonth"
  304. @confirm="e=> Dateconfirm(e,'insuredPersonInfo','identifyValidDate')"></u-picker>
  305. </uni-forms-item>
  306. <uni-forms-item required label="有效期止期" name="identifyValidEndDate">
  307. <view class="dis j-s a-c">
  308. <u-input type="select" :select-open="insuredPersonEndDateShow"
  309. v-model="insuredPersonInfo.identifyValidEndDate" placeholder="请选择有效期止期"
  310. @click="insuredPersonEndDateShow = true" placeholder-style="color:#808080"
  311. style="margin-right: 14px;"></u-input>
  312. <view class=" dis j-c a-c ">
  313. <text>长期</text>
  314. <switch style="transform: scale(0.6)"
  315. @change="checked=>insureLongterm(checked,'insuredPersonInfo')" />
  316. </view>
  317. </view>
  318. <u-picker v-model="insuredPersonEndDateShow" mode="time" :params="params" :end-year="endYear"
  319. :end-month="endMonth"
  320. @confirm="e=> Dateconfirm(e,'insuredPersonInfo','identifyValidEndDate')"></u-picker>
  321. </uni-forms-item>
  322. </template>
  323. </uni-forms>
  324. </uni-group>
  325. <view style="height: 160upx;"></view>
  326. <view class="infoBottom d-flex a-center j-center j-sb">
  327. <button type="default" class="d-flex a-center j-center" @tap="toNext">下一步</button>
  328. </view>
  329. <view class="mask mask-show" v-if="lodingshow">
  330. <!-- 加载动画开始 -->
  331. <view class="preloader">
  332. <view class="loader"></view>
  333. </view>
  334. <!-- 加载动画结束 -->
  335. <view class="title">加载中...</view>
  336. </view>
  337. <checkImageInfo :checkType="checkType" :checkInfo="checkInfo" :show="checkInfoShow" @cancel="cancelCheckInfo"
  338. @close="closeCheckInfo" :img="checkImage"></checkImageInfo>
  339. </view>
  340. </template>
  341. <script>
  342. import checkImageInfo from '@/components/modules/carInsure/checkImageInfo/checkImageInfo.vue'; //引用图片信息检查插件
  343. import {
  344. pathToBase64,
  345. base64ToPath
  346. } from '@/common/image-tools-base64.js';
  347. import {
  348. userInfo
  349. } from 'os';
  350. import store from '@/store';
  351. import $http from '../../config/requestConfig';
  352. import {
  353. Promise
  354. } from 'bluebird';
  355. var dateTime = new Date();
  356. let Year = dateTime.getFullYear();
  357. let Month = Number(dateTime.getMonth() + 1);
  358. export default {
  359. components: {
  360. checkImageInfo,
  361. },
  362. data() {
  363. return {
  364. lodingshow: false,
  365. endYear: Year,
  366. endMonth: Month,
  367. registerDateShow: false,
  368. issueDateShow: false,
  369. ownerDateShow: false,
  370. ownerEndDateShow: false,
  371. policyHolderDateShow: false,
  372. policyHolderEndDateShow: false,
  373. insuredPersonDateShow: false,
  374. insuredPersonEndDateShow: false,
  375. transferDateShow: false,
  376. params: {
  377. year: true, //年
  378. month: true, //月
  379. day: true, //日
  380. hour: false, //时
  381. minute: false, //分
  382. second: false, //秒
  383. },
  384. carInfo: {
  385. licenseNo: "", //车牌号
  386. brandName: "", //车辆品牌型号
  387. vinNo: "", //车架号
  388. engineNo: "", //发动机号
  389. modelCode: "", //车型编码
  390. seatCount: "0", //核定载客量 核定载人数
  391. purchasePrice: "", //新车购置价最低,行业实际价值,协商价值
  392. carBrand: "", //车型品牌
  393. ciCarName: "", //行业车型名称
  394. ciModelCode: "", //行业车型编码
  395. completeKerbMass: "", //整备质量
  396. exhaustScale: "", //排量
  397. factory: "", //工厂名称
  398. factoryid: "", //工厂编码
  399. frameNo: "", //车架号
  400. licenseTypeCode: "02", //号牌种类
  401. vehicleclass: "", //车辆类型
  402. familyName: "", //车型
  403. modelcname: "", //车型名称
  404. powertypecode: "", //燃料类型编码
  405. vehicleweight: "", //总质量
  406. limitLoad: "", //核定载质量
  407. caryear: "0", //年款
  408. cimodelclass: "", //车辆种类
  409. powertype: "汽油", //燃料类型
  410. enginedesc: "", //排量
  411. powerScale: "", //功率
  412. registerDate: "", //注册日期
  413. issueDate: "", //发证日期
  414. transferFlag: false, //过户标志
  415. transferDate: "", //过户日期
  416. loanStatus: 0, //贷款标志
  417. firstBeneMan: "", //第一受益人
  418. noLicenseFlag: false, //是否新车
  419. cartype: "A0", //客车A0 货车H0          
  420. carnature: "8A", //使用性质 家庭自用8A 非营业企业8B 非营业党政机关,事业团体8C 非营业货车8D
  421. property: "1" //所属性质 1个人 2企业 3个人
  422. },
  423. carRules: {
  424. brandName: {
  425. rules: [{
  426. required: true,
  427. errorMessage: '请输入品牌型号',
  428. }, ]
  429. },
  430. vinNo: {
  431. rules: [{
  432. required: true,
  433. errorMessage: '请输入车辆识别码',
  434. }, {
  435. pattern: /^([0-9A-Z]){17}$/,
  436. errorMessage: '请输入正确的车辆识别码',
  437. }]
  438. },
  439. engineNo: {
  440. rules: [{
  441. required: true,
  442. errorMessage: '请输入发动机号',
  443. }, ]
  444. },
  445. purchasePrice: {
  446. rules: [{
  447. required: true,
  448. errorMessage: '请输入新车购置价',
  449. }, {
  450. validateField: function(rule, value, data, callback) {
  451. if (value == 0) {
  452. callback('新车购置价不能为零')
  453. }
  454. return true
  455. }
  456. }]
  457. },
  458. registerDate: {
  459. rules: [{
  460. required: true,
  461. errorMessage: '请选择注册日期',
  462. }, ]
  463. },
  464. issueDate: {
  465. rules: [{
  466. required: true,
  467. errorMessage: '请选择发证日期',
  468. }, ]
  469. }
  470. },
  471. ownerRules: {
  472. name: {
  473. rules: [{
  474. required: true,
  475. errorMessage: '请输入车主姓名',
  476. },
  477. {
  478. minLength: 2,
  479. maxLength: 5,
  480. errorMessage: '车主姓名长度在 {minLength} 到 {maxLength} 个字符',
  481. },
  482. {
  483. pattern: /^([\u4e00-\u9fa5]{1,6}|[a-zA-Z\.\s]{1,6})$/,
  484. errorMessage: '请输入正确的车主姓名',
  485. }
  486. ]
  487. },
  488. identifyNumber: {
  489. rules: [{
  490. required: true,
  491. errorMessage: '请输入车主证件号',
  492. },
  493. {
  494. 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]$/,
  495. errorMessage: '请输入正确的车主证件号',
  496. }
  497. ]
  498. },
  499. mobile: {
  500. rules: [{
  501. required: true,
  502. errorMessage: '请输入车主手机号',
  503. },
  504. {
  505. pattern: /^1[3-9]\d{9}$/,
  506. errorMessage: '请输入正确的手机号',
  507. }
  508. ]
  509. },
  510. addr: {
  511. rules: [{
  512. required: true,
  513. errorMessage: '请输入车主地址',
  514. },
  515. {
  516. minLength: 8,
  517. maxLength: 40,
  518. errorMessage: '车主地址长度在 {minLength} 到 {maxLength} 个字符',
  519. },
  520. ]
  521. }
  522. },
  523. policyHolderRules: {
  524. name: {
  525. rules: [{
  526. required: true,
  527. errorMessage: '请输入投保人姓名',
  528. },
  529. {
  530. minLength: 2,
  531. maxLength: 5,
  532. errorMessage: '投保人姓名长度在 {minLength} 到 {maxLength} 个字符',
  533. },
  534. {
  535. pattern: /^([\u4e00-\u9fa5]{1,6}|[a-zA-Z\.\s]{1,6})$/,
  536. errorMessage: '请输入正确的投保人姓名',
  537. }
  538. ]
  539. },
  540. identifyNumber: {
  541. rules: [{
  542. required: true,
  543. errorMessage: '请输入投保人证件号',
  544. },
  545. {
  546. 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]$/,
  547. errorMessage: '请输入正确的投保人证件号',
  548. }
  549. ]
  550. },
  551. mobile: {
  552. rules: [{
  553. required: true,
  554. errorMessage: '请输入投保人手机号',
  555. },
  556. {
  557. pattern: /^1[3-9]\d{9}$/,
  558. errorMessage: '请输入正确的手机号',
  559. }
  560. ]
  561. },
  562. addr: {
  563. rules: [{
  564. required: true,
  565. errorMessage: '请输入投保人地址',
  566. },
  567. {
  568. minLength: 8,
  569. maxLength: 40,
  570. errorMessage: '投保人地址长度在 {minLength} 到 {maxLength} 个字符',
  571. },
  572. ]
  573. }
  574. },
  575. insuredPersonRules: {
  576. name: {
  577. rules: [{
  578. required: true,
  579. errorMessage: '请输入被保人姓名',
  580. },
  581. {
  582. minLength: 2,
  583. maxLength: 5,
  584. errorMessage: '被保人姓名长度在 {minLength} 到 {maxLength} 个字符',
  585. },
  586. {
  587. pattern: /^([\u4e00-\u9fa5]{1,6}|[a-zA-Z\.\s]{1,6})$/,
  588. errorMessage: '请输入正确的被保人姓名',
  589. }
  590. ]
  591. },
  592. identifyNumber: {
  593. rules: [{
  594. required: true,
  595. errorMessage: '请输入被保人证件号',
  596. },
  597. {
  598. 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]$/,
  599. errorMessage: '请输入正确的被保人证件号',
  600. }
  601. ]
  602. },
  603. mobile: {
  604. rules: [{
  605. required: true,
  606. errorMessage: '请输入被保人手机号',
  607. },
  608. {
  609. pattern: /^1[3-9]\d{9}$/,
  610. errorMessage: '请输入正确的手机号',
  611. }
  612. ]
  613. },
  614. addr: {
  615. rules: [{
  616. required: true,
  617. errorMessage: '请输入被保人地址',
  618. },
  619. {
  620. minLength: 8,
  621. maxLength: 40,
  622. errorMessage: '被保人地址长度在 {minLength} 到 {maxLength} 个字符',
  623. },
  624. ]
  625. }
  626. },
  627. checkInfo: {},
  628. checkType: 1,
  629. checkImage: [],
  630. checkInfoShow: false,
  631. licenseNo: '', //车牌号
  632. //使用性质
  633. carnatureIndex: 0,
  634. carnatureList: [{
  635. label: '家庭自用',
  636. id: "8A"
  637. }, ],
  638. //能源种类
  639. fuelTypeCodeIndex: 0,
  640. fuelTypeCodeList: [{
  641. id: "0",
  642. label: '汽油',
  643. },
  644. {
  645. id: "1",
  646. label: "纯电动",
  647. },
  648. {
  649. id: "2",
  650. label: "燃料电池",
  651. },
  652. {
  653. id: "3",
  654. label: "插电式混合动力",
  655. },
  656. {
  657. id: "4",
  658. label: "其他混合动力",
  659. },
  660. ],
  661. propertyIndex: 0,
  662. propertyList: [{
  663. label: '个人',
  664. id: "1"
  665. },
  666. {
  667. label: '企业',
  668. id: "2"
  669. },
  670. {
  671. label: '机关',
  672. id: "3"
  673. }
  674. ],
  675. identifyList: [{
  676. label: '身份证',
  677. id: "01"
  678. },
  679. {
  680. label: '护照',
  681. id: "02"
  682. },
  683. {
  684. label: '港澳台居民居住证',
  685. id: "03"
  686. },
  687. {
  688. label: '组织机构代码证',
  689. id: "04"
  690. },
  691. {
  692. label: '统一社会信用代码证',
  693. id: "05"
  694. },
  695. {
  696. label: '营业执照',
  697. id: "06"
  698. }
  699. ],
  700. ownerIdentifyIndex: 0,
  701. policyHolderIdentifyIndex: 0,
  702. insuredPersonIdentifyIndex: 0,
  703. holderAndOwner: true, //投保人同车主
  704. insuredAndOwner: true, //被保人同车主
  705. tbrAndOwner: false, //被保人同投保人
  706. ownerInfo: {
  707. name: "",
  708. identifyType: "01",
  709. identifyNumber: "",
  710. addr: "",
  711. email: "",
  712. mobile: "",
  713. identifyValidDate: "", //有效期起期
  714. identifyValidEndDate: "", //有效期止期
  715. },
  716. policyHolderInfo: {
  717. name: "",
  718. identifyType: "01",
  719. identifyNumber: "",
  720. addr: "",
  721. email: "",
  722. mobile: "",
  723. identifyValidDate: "", //有效期起期
  724. identifyValidEndDate: "", //有效期止期
  725. },
  726. insuredPersonInfo: {
  727. name: "",
  728. identifyType: "01",
  729. identifyNumber: "",
  730. addr: "",
  731. email: "",
  732. mobile: "",
  733. identifyValidDate: "", //有效期起期
  734. identifyValidEndDate: "", //有效期止期
  735. },
  736. riskList: [], //交强险和商业险的选择
  737. kindList: [], //商业险险种的选择
  738. //影像上传列表
  739. carInfoRmation: [], //车辆
  740. ownerInfoRmation: [], //车主
  741. policyHolderInfoRmation: [], //投保人
  742. insuredPersonInfoRmation: [], //被保人
  743. vehicleRmation: [], //验车照
  744. carfront: {},
  745. carback: {},
  746. userfront: {},
  747. userback: {},
  748. token: "",
  749. }
  750. },
  751. async onLoad(options) {
  752. if (!!options.licenseNo) {
  753. this.licenseNo = decodeURIComponent(options.licenseNo);
  754. // this.carInfo.licenseNo = options.licenseNo
  755. // this.policyHolderInfo = this.ownerInfo;
  756. // this.policyHolderIdentifyIndex = this.ownerIdentifyIndex;
  757. // this.insuredPersonInfo = this.ownerInfo;
  758. // this.insuredPersonIdentifyIndex = this.ownerIdentifyIndex;
  759. } else {
  760. const eventChannel = this.getOpenerEventChannel()
  761. // 监听acceptData事件,获取上一页面通过eventChannel传送到当前页面的数据
  762. eventChannel.on('acceptData', (data) => {
  763. console.log(data)
  764. if (!!data) {
  765. //读取上一个页面传过来数据(车辆信息,人员信息,险种信息)
  766. this.carInfo = data.carInfo; //车辆信息
  767. this.ownerInfo = JSON.parse(JSON.stringify(data.ownerInfo));
  768. this.policyHolderInfo = JSON.parse(JSON.stringify(data.policyHolderInfo));
  769. this.insuredPersonInfo = JSON.parse(JSON.stringify(data.insuredPersonInfo));
  770. this.carInfoRmation = data.carInfoRmation; //车辆
  771. this.ownerInfoRmation = data.ownerInfoRmation; //车主
  772. this.policyHolderInfoRmation = data.policyHolderInfoRmation; //投保
  773. this.insuredPersonInfoRmation = data.insuredPersonInfoRmation; //被保人
  774. this.riskList = data.riskList; //险种大类
  775. this.kindList = data.kindList; //商业险险别
  776. this.licenseNo = this.carInfo.licenseNo;
  777. this.holderAndOwner = false; //投保人同车主
  778. this.insuredAndOwner = false; //被保人同车主
  779. this.tbrAndOwner = false; //被保人同投保人
  780. }
  781. })
  782. };
  783. this.token = store.state.token
  784. },
  785. // 监听导航栏的按钮
  786. onNavigationBarButtonTap(e) {
  787. if (e.index == 0) {
  788. this.navigate({
  789. url: '/pages/index/index'
  790. }, "switchTab", true);
  791. }
  792. },
  793. computed: {
  794. startDate() {
  795. return this.getDate('start');
  796. },
  797. endDate() {
  798. return this.getDate('end');
  799. },
  800. },
  801. methods: {
  802. /**
  803. * @param {String} e 时间选择器的值
  804. * @param {String} obj 储存表单对象
  805. * @param {String} param 储存表单参数
  806. */
  807. Dateconfirm(e, obj, param) {
  808. this[obj][param] = e.year + '-' + e.month + '-' + e.day;
  809. },
  810. //选择驾照图片或拍摄驾照图片
  811. async chooseImage(type) {
  812. console.log(type)
  813. this.checkType = (type == 'carInfo') ? 2 : 1;
  814. this.checkInfo = {};
  815. this.checkImage = [];
  816. switch (type) {
  817. case "carInfo":
  818. let filelist = await this.choosepars(type + 'Rmation') //储存影像id
  819. console.log(filelist)
  820. uni.uploadFile({
  821. url: this.$base.baseUrl + '/order/identify/drivingPermit',
  822. filePath: filelist[0],
  823. name: "image1",
  824. header: {
  825. Authorization: this.token,
  826. },
  827. success: (uploadFileRes) => {
  828. console.log(filelist)
  829. let data = JSON.parse(uploadFileRes.data).data;
  830. let rdate = '';
  831. if (!!data.carInfo.registerDate) {
  832. rdate = data.carInfo.registerDate.substr(0, 4) + '-' + data.carInfo
  833. .registerDate.substr(4, 2) + '-' + data.carInfo.registerDate
  834. .substr(6,
  835. 2)
  836. }
  837. let isdate = '';
  838. if (!!data.carInfo.issueDate) {
  839. isdate = data.carInfo.issueDate.substr(0, 4) + '-' + data.carInfo
  840. .issueDate.substr(4, 2) + '-' + data.carInfo.issueDate.substr(6, 2)
  841. }
  842. this.carfront = {
  843. licenseNo: data.carInfo.plateNo, //车牌号
  844. engineNo: data.carInfo.engine, //发动机号
  845. issueDate: isdate, //发证日期
  846. cartype: data.carInfo.motorTypeCode,
  847. carnature: data.carInfo.motorUsageTypeCode,
  848. licenseTypeCode: data.carInfo.plateType, //所属性质
  849. registerDate: rdate, //注册日期
  850. vinNo: data.carInfo.vIN, //车架号
  851. frameNo: data.carInfo.vIN, //车架号
  852. brandName: data.carInfo.backOcrID, //品牌型号
  853. }
  854. if (filelist.length > 1) {
  855. uni.uploadFile({
  856. url: this.$base.baseUrl + '/order/identify/drivingPermit',
  857. filePath: filelist[1],
  858. name: "image2",
  859. header: {
  860. Authorization: this.token,
  861. },
  862. success: (uploadFileRes) => {
  863. let data1 = JSON.parse(uploadFileRes.data).data;
  864. this.carback = {
  865. vehicleweight: data1.carInfo
  866. .grossMass, //总质量
  867. completeKerbMass: data1.carInfo
  868. .unladenMass, //整备质量
  869. seatCount: data1.carInfo
  870. .approvedPassengersCapacity, //核定载客数
  871. }
  872. }
  873. });
  874. }
  875. this.checkInfo = Object.assign(this.carfront, this
  876. .carback)
  877. this.lodingshow = false;
  878. this.checkInfoShow = true;
  879. }
  880. });
  881. break;
  882. case "ownerInfo":
  883. case "policyHolderInfo":
  884. case "insuredPersonInfo":
  885. let ownerInfolist = await this.choosepars(type + 'Rmation') //储存影像id
  886. uni.uploadFile({
  887. url: this.$base.baseUrl + '/order/identify/idCard',
  888. filePath: ownerInfolist[0],
  889. name: "image1",
  890. header: {
  891. Authorization: this.token,
  892. },
  893. success: (uploadFileRes) => {
  894. let data = JSON.parse(uploadFileRes.data).data;
  895. this.userfront = {
  896. type: type,
  897. name: data.customerInfo.name,
  898. identifyNumber: data.customerInfo.identifyNumber,
  899. addr: data.customerInfo.addr,
  900. }
  901. if (ownerInfolist.length > 1) {
  902. uni.uploadFile({
  903. url: this.$base.baseUrl + '/order/identify/idCard',
  904. filePath: ownerInfolist[1],
  905. name: "image2",
  906. header: {
  907. Authorization: this.token,
  908. },
  909. success: (uploadFileRes) => {
  910. let data1 = JSON.parse(uploadFileRes.data).data;
  911. let identifyValidDate = '';
  912. if (!!data1.customerInfo.identifyValidDate) {
  913. identifyValidDate = data1.customerInfo
  914. .identifyValidDate.substr(0, 4) +
  915. '-' + data1.customerInfo
  916. .identifyValidDate.substr(4, 2) + '-' +
  917. data1
  918. .customerInfo
  919. .identifyValidDate
  920. .substr(6,
  921. 2)
  922. }
  923. let identifyValidEndDate = '';
  924. if (!!data1.customerInfo.identifyValidEndDate) {
  925. identifyValidEndDate = data1.customerInfo
  926. .identifyValidEndDate.substr(0,
  927. 4) + '-' + data1.customerInfo
  928. .identifyValidEndDate.substr(4, 2) + '-' +
  929. data1
  930. .customerInfo
  931. .identifyValidEndDate.substr(6, 2)
  932. }
  933. this.userback = {
  934. identifyValidDate: identifyValidDate, //起期
  935. identifyValidEndDate: identifyValidEndDate, //止期
  936. }
  937. }
  938. });
  939. }
  940. this.checkInfo = Object.assign(this.userfront, this
  941. .userback)
  942. this.lodingshow = false;
  943. this.checkInfoShow = true;
  944. }
  945. });
  946. break;
  947. default:
  948. }
  949. },
  950. //自定义影像上传识别
  951. async choosepars(imageName) {
  952. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  953. count: 2,
  954. sizeType: ['compressed']
  955. });
  956. if (chooseImageErr) {
  957. this.lodingshow = false;
  958. return;
  959. } else {
  960. this.lodingshow = true;
  961. // 上传
  962. this.checkImage = chooseImageRes.tempFilePaths;
  963. this[imageName] = [];
  964. chooseImageRes.tempFilePaths.map((ele, index) => {
  965. uni.uploadFile({
  966. url: this.$base.baseUrl + '/ins/taskImage/uploadFile',
  967. filePath: ele,
  968. name: "multipartFile",
  969. formData: {
  970. 'type': 'image',
  971. },
  972. header: {
  973. Authorization: this.token,
  974. },
  975. success: (imgRes) => {
  976. let id = JSON.parse(imgRes.data).data.id;
  977. console.log(id)
  978. this[imageName].push(id)
  979. }
  980. });
  981. })
  982. return chooseImageRes.tempFilePaths;
  983. }
  984. },
  985. // 取消验证信息
  986. cancelCheckInfo() {
  987. this.checkInfoShow = false;
  988. },
  989. // 关闭验证信息
  990. closeCheckInfo(params) {
  991. if (params.checkType == 2) {
  992. if (params.checkInfo.licenseNo != this.licenseNo) {
  993. uni.showModal({
  994. content: '识别到的车辆信息与录入车辆信息不一致,是否覆盖之前车辆信息',
  995. success: (res) => {
  996. if (res.confirm) {
  997. for (var key in this.carInfo) {
  998. this.carInfo[key] = "";
  999. }
  1000. this.carInfo.seatCount = "0";
  1001. this.carInfo.purchasePrice = "0";
  1002. this.carInfo.licenseTypeCode = "02";
  1003. this.carInfo.caryear = "0"; //年款
  1004. this.carInfo.powertype = "汽油";
  1005. this.carInfo.transferFlag = false;
  1006. this.carInfo.loanStatus = 0;
  1007. this.carInfo.noLicenseFlag = false;
  1008. this.carInfo.cartype = "A0";
  1009. this.carInfo.carnature = "8A";
  1010. this.carInfo.property = "1";
  1011. this.checkInfoShow = false;
  1012. this.carInfo.brandName = '';
  1013. Object.assign(this.carInfo, params.checkInfo);
  1014. this.licenseNo = params.checkInfo.licenseNo;
  1015. }
  1016. }
  1017. });
  1018. } else {
  1019. Object.assign(this.carInfo, params.checkInfo);
  1020. this.licenseNo = params.checkInfo.licenseNo;
  1021. this.checkInfoShow = false;
  1022. }
  1023. for (let i = 0; i < this.carnatureList.length; i++) {
  1024. if (this.carInfo.carnature == this.carnatureList[i].id) {
  1025. this.carnatureIndex = i;
  1026. }
  1027. }
  1028. } else if (params.checkType == 1) {
  1029. if (params.checkInfo.type == 'ownerInfo') {
  1030. this.ownerInfo = {
  1031. name: params.checkInfo.name,
  1032. identifyType: "01",
  1033. identifyNumber: params.checkInfo.identifyNumber,
  1034. addr: params.checkInfo.addr,
  1035. identifyValidDate: params.checkInfo.identifyValidDate, //起期
  1036. identifyValidEndDate: params.checkInfo.identifyValidEndDate, //止期
  1037. email: "",
  1038. mobile: ""
  1039. }
  1040. } else if (params.checkInfo.type == 'policyHolderInfo') {
  1041. this.policyHolderInfo = {
  1042. name: params.checkInfo.name,
  1043. identifyType: "01",
  1044. identifyNumber: params.checkInfo.identifyNumber,
  1045. addr: params.checkInfo.addr,
  1046. identifyValidDate: params.checkInfo.identifyValidDate, //起期
  1047. identifyValidEndDate: params.checkInfo.identifyValidEndDate, //止期
  1048. email: "",
  1049. mobile: ""
  1050. }
  1051. } else {
  1052. this.insuredPersonInfo = {
  1053. name: params.checkInfo.name,
  1054. identifyType: "01",
  1055. identifyNumber: params.checkInfo.identifyNumber,
  1056. addr: params.checkInfo.addr,
  1057. identifyValidDate: params.checkInfo.identifyValidDate, //起期
  1058. identifyValidEndDate: params.checkInfo.identifyValidEndDate, //止期
  1059. email: "",
  1060. mobile: ""
  1061. }
  1062. }
  1063. this.checkInfoShow = false;
  1064. }
  1065. },
  1066. /**
  1067. * 复写 binddata 方法,如果只是为了校验,无复杂自定义操作,可忽略此方法
  1068. * @param {String} name 字段名称
  1069. * @param {String} value 表单域的值
  1070. */
  1071. binddata(name, value, type) {
  1072. // 通过 input 事件设置表单指定 name 的值
  1073. this.$refs[type].setValue(name, value)
  1074. },
  1075. //转变大写(车型/车架号/发动机号)
  1076. upperCaseType(type) {
  1077. this.carInfo[type] = this.carInfo[type].toUpperCase();
  1078. if (type == 'vinNo') {
  1079. this.carInfo.frameNo = this.carInfo.vinNo.trim();
  1080. }
  1081. },
  1082. //下拉改变触发该方法
  1083. bindPickerChange(e, type) {
  1084. this[type + 'Index'] = e.target.value;
  1085. this.carInfo[type] = this[type + 'List'][e.target.value].id;
  1086. },
  1087. // 身份证类型选择
  1088. bindIdentifyTypeChange(e, type) {
  1089. this[type + 'IdentifyIndex'] = e.target.value;
  1090. this[type + 'Info'].identifyType = this.identifyList[e.target.value].id;
  1091. this[type + 'Info'].identifyNumber = '';
  1092. },
  1093. bindDateChange(e, type) { //日期赋值
  1094. if ((type == 'issueDate') && (!this.carInfo.registerDate)) {
  1095. return uni.showToast({
  1096. title: '请先输入注册日期',
  1097. icon: "none"
  1098. });
  1099. }
  1100. this.carInfo[type] = e.detail.value;
  1101. if (new Date(this.carInfo.registerDate) > new Date(this.carInfo.issueDate)) {
  1102. this.carInfo.issueDate = ""
  1103. return uni.showToast({
  1104. title: '注册日期大于发证日期',
  1105. icon: "none"
  1106. });
  1107. }
  1108. },
  1109. // 是否过户
  1110. isChangeStatus(e) {
  1111. if (e.detail.value) {
  1112. this.carInfo.transferFlag = true;
  1113. } else {
  1114. this.carInfo.transferFlag = false;
  1115. }
  1116. },
  1117. //长期
  1118. insureLongterm(checked, e) {
  1119. checked.detail.value == true ? this[e].identifyValidEndDate = "9999-12-31" : this[e].identifyValidEndDate =
  1120. "";
  1121. },
  1122. //日期(可以选择20年以内的时间)
  1123. getDate(type) {
  1124. const date = new Date();
  1125. let year = date.getFullYear();
  1126. let month = date.getMonth() + 1;
  1127. let day = date.getDate();
  1128. if (type === 'start') {
  1129. year = year - 20;
  1130. } else if (type === 'end') {}
  1131. month = month > 9 ? month : '0' + month;;
  1132. day = day > 9 ? day : '0' + day;
  1133. return `${year}-${month}-${day}`;
  1134. },
  1135. //同车主信息
  1136. syncPersonInfo(e, type, touch1, touch2) {
  1137. this[type] = e.detail.value;
  1138. this[touch1 + 'IdentifyIndex'] = this[touch2 + 'IdentifyIndex'];
  1139. if (this[type]) {
  1140. this[touch1 + 'Info'] = JSON.parse(JSON.stringify(this[touch2 + 'Info']));
  1141. } else {
  1142. for (let key in this[touch1 + "Info"]) {
  1143. this[touch1 + "Info"][key] = '';
  1144. }
  1145. }
  1146. },
  1147. //跳转选择车辆类型页面
  1148. toChooseVehicleType() {
  1149. if (this.carInfo.brandName == '' || this.carInfo.brandName == null) {
  1150. uni.showToast({
  1151. icon: 'none',
  1152. title: '请输入车型名称',
  1153. duration: 1500
  1154. });
  1155. } else {
  1156. this.navigate({
  1157. url: '/pages/carInsure1/carType1?brandName=' + encodeURIComponent(this.carInfo.brandName)
  1158. }, "navigateTo", true);
  1159. }
  1160. },
  1161. // 通过车架号获取车型
  1162. async toChooseVin() {
  1163. if (this.carInfo.vinNo == '' || this.carInfo.vinNo == null) {
  1164. return uni.showToast({
  1165. icon: 'none',
  1166. title: '请输入车架号',
  1167. duration: 1500
  1168. });
  1169. } else {
  1170. if (!this.isFrameno(this.carInfo.vinNo.trim())) {
  1171. return uni.showToast({
  1172. title: '请输入正确的车架号',
  1173. icon: "none"
  1174. });
  1175. }
  1176. this.navigate({
  1177. url: '/pages/carInsure1/carType1?frameNo=' + encodeURIComponent(this.carInfo.vinNo)
  1178. }, "navigateTo", true);
  1179. this.carInfo.vinNo = this.carInfo.vinNo.trim();
  1180. this.carInfo.frameNo = this.carInfo.vinNo.trim();
  1181. }
  1182. },
  1183. //验证车架号
  1184. isFrameno(str) {
  1185. let mPattern = /^([0-9A-Z]){17}$/;
  1186. return mPattern.test(str);
  1187. },
  1188. toNext() {
  1189. if (this.holderAndOwner) { //投保人同车主
  1190. this.policyHolderInfo = this.ownerInfo;
  1191. this.policyHolderInfoRmation = this.ownerInfoRmation;
  1192. }
  1193. if (this.insuredAndOwner) { //被保人同车主
  1194. this.insuredPersonInfo = this.ownerInfo;
  1195. this.insuredPersonInfoRmation = this.ownerInfoRmation;
  1196. }
  1197. if (this.tbrAndOwner) { //被保人同投保人
  1198. this.insuredPersonInfo = this.policyHolderInfo;
  1199. this.insuredPersonInfoRmation = this.policyHolderInfoRmation;
  1200. }
  1201. this.$refs.carForm.submit().then(res => {
  1202. this.$refs.ownerForm.submit().then(res1 => {
  1203. this.$refs.policyHolderForm.submit().then(res2 => {
  1204. this.$refs.insuredPersonForm.submit().then(res3 => {
  1205. this.navigate({
  1206. url: '/pages/carInsure1/insureItems1',
  1207. success: (res) => {
  1208. res.eventChannel.emit("acceptData", {
  1209. carInfo: this.carInfo,
  1210. ownerInfo: this.ownerInfo,
  1211. policyHolderInfo: this
  1212. .policyHolderInfo,
  1213. insuredPersonInfo: this
  1214. .insuredPersonInfo,
  1215. riskList: this.riskList,
  1216. kindList: this.kindList,
  1217. carInfoRmation: this
  1218. .carInfoRmation, //车辆
  1219. ownerInfoRmation: this
  1220. .ownerInfoRmation, //车主
  1221. policyHolderInfoRmation: this
  1222. .policyHolderInfoRmation, //投保人
  1223. insuredPersonInfoRmation: this
  1224. .insuredPersonInfoRmation, //被保人
  1225. })
  1226. }
  1227. }, "navigateTo", true);
  1228. })
  1229. })
  1230. })
  1231. })
  1232. }
  1233. }
  1234. }
  1235. </script>
  1236. <style lang="scss" scoped>
  1237. @import '@/style/mixin.scss';
  1238. /deep/ .uni-group__content {
  1239. padding-top: 0;
  1240. }
  1241. /deep/ .uni-forms--top {
  1242. padding: 0;
  1243. }
  1244. /deep/ .uni-forms-item {
  1245. margin-bottom: 0;
  1246. }
  1247. /deep/ .uni-input-input {
  1248. font-size: 26upx;
  1249. }
  1250. /deep/ .uni-switch-input-checked {
  1251. background-color: $themeColor !important;
  1252. border-color: $themeColor !important;
  1253. }
  1254. /deep/ .uni-group__content {
  1255. padding-bottom: 0;
  1256. }
  1257. /deep/ .uni-input-input {
  1258. font-size: 28upx;
  1259. }
  1260. .body {
  1261. width: 100vw;
  1262. /* min-height: 100vh; */
  1263. background: #f5f5f5;
  1264. /* background: #FFFFFF; */
  1265. font-family: "Arial,Helvetica,sans-serif,PingFangSC";
  1266. }
  1267. .title {
  1268. height: 90upx;
  1269. border-bottom: 1px solid #EEEEEE;
  1270. }
  1271. .checkButton {
  1272. margin: 0 20upx;
  1273. width: 100upx;
  1274. height: 50upx;
  1275. flex-shrink: 1;
  1276. background: rgba($themeColor, 0.6);
  1277. color: #FFFFFF;
  1278. border-radius: 5upx;
  1279. }
  1280. .textColor {
  1281. color: #6091f5;
  1282. }
  1283. textarea {
  1284. font-size: 28upx;
  1285. width: 330upx;
  1286. }
  1287. /* 底部的样式Start */
  1288. .infoBottom {
  1289. height: 140upx;
  1290. position: fixed;
  1291. bottom: 0;
  1292. left: 0;
  1293. right: 0;
  1294. background: #FFFFFF;
  1295. border-top: 1upx solid #EEEEEE;
  1296. z-index: 99;
  1297. }
  1298. .infoBottom>button {
  1299. // font-size: 30upx;
  1300. background: $themeColor;
  1301. color: #FFFFFF;
  1302. flex: 1;
  1303. margin: 0upx 30upx;
  1304. }
  1305. /* 底部的样式End */
  1306. .mask {
  1307. /* pointer-events: none; */
  1308. position: fixed;
  1309. z-index: 99999;
  1310. top: 0;
  1311. left: 0;
  1312. right: 0;
  1313. bottom: 0;
  1314. height: 100vh;
  1315. width: 100vw;
  1316. display: flex;
  1317. flex-direction: column;
  1318. justify-content: center;
  1319. align-items: center;
  1320. flex-wrap: wrap;
  1321. }
  1322. .mask.mask-show {
  1323. background: rgba(255, 255, 255, 0.3);
  1324. }
  1325. .title {
  1326. color: #333;
  1327. font-size: 28rpx;
  1328. margin-top: 20rpx;
  1329. }
  1330. .loader {
  1331. display: block;
  1332. width: 120rpx;
  1333. height: 120rpx;
  1334. border-radius: 50%;
  1335. border: 3rpx solid transparent;
  1336. border-top-color: #9370db;
  1337. -webkit-animation: spin 2s linear infinite;
  1338. animation: spin 2s linear infinite;
  1339. }
  1340. .loader::before {
  1341. content: "";
  1342. position: absolute;
  1343. top: 5rpx;
  1344. left: 5rpx;
  1345. right: 5rpx;
  1346. bottom: 5rpx;
  1347. border-radius: 50%;
  1348. border: 3rpx solid transparent;
  1349. border-top-color: #ba55d3;
  1350. -webkit-animation: spin 3s linear infinite;
  1351. animation: spin 3s linear infinite;
  1352. }
  1353. .loader::after {
  1354. content: "";
  1355. position: absolute;
  1356. top: 15rpx;
  1357. left: 15rpx;
  1358. right: 15rpx;
  1359. bottom: 15rpx;
  1360. border-radius: 50%;
  1361. border: 3rpx solid transparent;
  1362. border-top-color: #ff00ff;
  1363. -webkit-animation: spin 1.5s linear infinite;
  1364. animation: spin 1.5s linear infinite;
  1365. }
  1366. @-webkit-keyframes spin {
  1367. 0% {
  1368. -webkit-transform: rotate(0deg);
  1369. -ms-transform: rotate(0deg);
  1370. transform: rotate(0deg);
  1371. }
  1372. 100% {
  1373. -webkit-transform: rotate(360deg);
  1374. -ms-transform: rotate(360deg);
  1375. transform: rotate(360deg);
  1376. }
  1377. }
  1378. @keyframes spin {
  1379. 0% {
  1380. -webkit-transform: rotate(0deg);
  1381. -ms-transform: rotate(0deg);
  1382. transform: rotate(0deg);
  1383. }
  1384. 100% {
  1385. -webkit-transform: rotate(360deg);
  1386. -ms-transform: rotate(360deg);
  1387. transform: rotate(360deg);
  1388. }
  1389. }
  1390. </style>