carInfo1.vue 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421
  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. }
  749. },
  750. async onLoad(options) {
  751. if (!!options.licenseNo) {
  752. this.licenseNo = decodeURIComponent(options.licenseNo);
  753. // this.carInfo.licenseNo = options.licenseNo
  754. // this.policyHolderInfo = this.ownerInfo;
  755. // this.policyHolderIdentifyIndex = this.ownerIdentifyIndex;
  756. // this.insuredPersonInfo = this.ownerInfo;
  757. // this.insuredPersonIdentifyIndex = this.ownerIdentifyIndex;
  758. } else {
  759. const eventChannel = this.getOpenerEventChannel()
  760. // 监听acceptData事件,获取上一页面通过eventChannel传送到当前页面的数据
  761. eventChannel.on('acceptData', (data) => {
  762. console.log(data)
  763. if (!!data) {
  764. //读取上一个页面传过来数据(车辆信息,人员信息,险种信息)
  765. this.carInfo = data.carInfo; //车辆信息
  766. this.ownerInfo = JSON.parse(JSON.stringify(data.ownerInfo));
  767. this.policyHolderInfo = JSON.parse(JSON.stringify(data.policyHolderInfo));
  768. this.insuredPersonInfo = JSON.parse(JSON.stringify(data.insuredPersonInfo));
  769. this.riskList = data.riskList; //险种大类
  770. this.kindList = data.kindList; //商业险险别
  771. this.licenseNo = this.carInfo.licenseNo;
  772. this.holderAndOwner = false; //投保人同车主
  773. this.insuredAndOwner = false; //被保人同车主
  774. this.tbrAndOwner = false; //被保人同投保人
  775. }
  776. })
  777. }
  778. },
  779. // 监听导航栏的按钮
  780. onNavigationBarButtonTap(e) {
  781. if (e.index == 0) {
  782. this.navigate({
  783. url: '/pages/index/index'
  784. }, "switchTab", true);
  785. }
  786. },
  787. computed: {
  788. startDate() {
  789. return this.getDate('start');
  790. },
  791. endDate() {
  792. return this.getDate('end');
  793. },
  794. },
  795. methods: {
  796. /**
  797. * @param {String} e 时间选择器的值
  798. * @param {String} obj 储存表单对象
  799. * @param {String} param 储存表单参数
  800. */
  801. Dateconfirm(e, obj, param) {
  802. this[obj][param] = e.year + '-' + e.month + '-' + e.day;
  803. },
  804. //选择驾照图片或拍摄驾照图片
  805. async chooseImage(type) {
  806. console.log(type)
  807. this.checkType = (type == 'carInfo') ? 2 : 1;
  808. this.checkInfo = {};
  809. this.checkImage = [];
  810. switch (type) {
  811. case "carInfo":
  812. let filelist = await this.choosepars(type + 'Rmation') //储存影像id
  813. console.log(filelist)
  814. uni.uploadFile({
  815. url: `${this.$base.baseUrl}/order/identify/drivingPermit`,
  816. filePath: filelist[0],
  817. name: "image1",
  818. header: {
  819. Authorization: store.state.token,
  820. },
  821. success: (uploadFileRes) => {
  822. let data = JSON.parse(uploadFileRes.data).data;
  823. let rdate = '';
  824. if (!!data.carInfo.registerDate) {
  825. rdate = data.carInfo.registerDate.substr(0, 4) + '-' + data.carInfo
  826. .registerDate.substr(4, 2) + '-' + data.carInfo.registerDate
  827. .substr(6,
  828. 2)
  829. }
  830. let isdate = '';
  831. if (!!data.carInfo.issueDate) {
  832. isdate = data.carInfo.issueDate.substr(0, 4) + '-' + data.carInfo
  833. .issueDate.substr(4, 2) + '-' + data.carInfo.issueDate.substr(6, 2)
  834. }
  835. this.carfront = {
  836. licenseNo: data.carInfo.plateNo, //车牌号
  837. engineNo: data.carInfo.engine, //发动机号
  838. issueDate: isdate, //发证日期
  839. cartype: data.carInfo.motorTypeCode,
  840. carnature: data.carInfo.motorUsageTypeCode,
  841. licenseTypeCode: data.carInfo.plateType, //所属性质
  842. registerDate: rdate, //注册日期
  843. vinNo: data.carInfo.vIN, //车架号
  844. frameNo: data.carInfo.vIN, //车架号
  845. brandName: data.carInfo.backOcrID, //品牌型号
  846. }
  847. uni.uploadFile({
  848. url: `${this.$base.baseUrl}/order/identify/drivingPermit`,
  849. filePath: filelist[1],
  850. name: "image2",
  851. header: {
  852. Authorization: store.state.token,
  853. },
  854. success: (uploadFileRes) => {
  855. let data1 = JSON.parse(uploadFileRes.data).data;
  856. this.carback = {
  857. vehicleweight: data1.carInfo.grossMass, //总质量
  858. completeKerbMass: data1.carInfo
  859. .unladenMass, //整备质量
  860. seatCount: data1.carInfo
  861. .approvedPassengersCapacity, //核定载客数
  862. }
  863. this.checkInfo = Object.assign(this.carfront, this
  864. .carback)
  865. this.lodingshow = false;
  866. this.checkInfoShow = true;
  867. }
  868. });
  869. }
  870. });
  871. break;
  872. case "ownerInfo":
  873. case "policyHolderInfo":
  874. case "insuredPersonInfo":
  875. let ownerInfolist = await this.choosepars(type + 'Rmation') //储存影像id
  876. uni.uploadFile({
  877. url: `${this.$base.baseUrl}/order/identify/idCard`,
  878. filePath: ownerInfolist[0],
  879. name: "image1",
  880. header: {
  881. Authorization: store.state.token,
  882. },
  883. success: (uploadFileRes) => {
  884. let data = JSON.parse(uploadFileRes.data).data;
  885. this.userfront = {
  886. type: type,
  887. name: data.customerInfo.name,
  888. identifyNumber: data.customerInfo.identifyNumber,
  889. addr: data.customerInfo.addr,
  890. }
  891. uni.uploadFile({
  892. url: `${this.$base.baseUrl}/order/identify/idCard`,
  893. filePath: ownerInfolist[1],
  894. name: "image2",
  895. header: {
  896. Authorization: store.state.token,
  897. },
  898. success: (uploadFileRes) => {
  899. let data1 = JSON.parse(uploadFileRes.data).data;
  900. let identifyValidDate = '';
  901. if (!!data1.customerInfo.identifyValidDate) {
  902. identifyValidDate = data1.customerInfo
  903. .identifyValidDate.substr(0, 4) +
  904. '-' + data1.customerInfo
  905. .identifyValidDate.substr(4, 2) + '-' + data1
  906. .customerInfo
  907. .identifyValidDate
  908. .substr(6,
  909. 2)
  910. }
  911. let identifyValidEndDate = '';
  912. if (!!data1.customerInfo.identifyValidEndDate) {
  913. identifyValidEndDate = data1.customerInfo
  914. .identifyValidEndDate.substr(0,
  915. 4) + '-' + data1.customerInfo
  916. .identifyValidEndDate.substr(4, 2) + '-' +
  917. data1
  918. .customerInfo
  919. .identifyValidEndDate.substr(6, 2)
  920. }
  921. this.userback = {
  922. identifyValidDate: identifyValidDate, //起期
  923. identifyValidEndDate: identifyValidEndDate, //止期
  924. }
  925. this.checkInfo = Object.assign(this.userfront, this
  926. .userback)
  927. this.lodingshow = false;
  928. this.checkInfoShow = true;
  929. }
  930. });
  931. }
  932. });
  933. break;
  934. default:
  935. }
  936. },
  937. //自定义影像上传识别
  938. async choosepars(imageName) {
  939. let [chooseImageErr, chooseImageRes] = await uni.chooseImage({
  940. count: 2,
  941. sizeType: ['compressed']
  942. });
  943. this.lodingshow = true;
  944. // 上传
  945. this.checkImage = chooseImageRes.tempFilePaths;
  946. this[imageName] = [];
  947. chooseImageRes.tempFilePaths.map((ele, index) => {
  948. uni.uploadFile({
  949. url: `${this.$base.baseUrl}/ins/taskImage/uploadFile`,
  950. filePath: ele,
  951. name: "multipartFile",
  952. formData: {
  953. 'type': 'image',
  954. },
  955. header: {
  956. Authorization: store.state.token,
  957. },
  958. success: (imgRes) => {
  959. let id = JSON.parse(imgRes.data).data.id;
  960. this[imageName].push(id)
  961. }
  962. });
  963. })
  964. return chooseImageRes.tempFilePaths;
  965. },
  966. // 取消验证信息
  967. cancelCheckInfo() {
  968. this.checkInfoShow = false;
  969. },
  970. // 关闭验证信息
  971. closeCheckInfo(params) {
  972. if (params.checkType == 2) {
  973. if (params.checkInfo.licenseNo != this.licenseNo) {
  974. uni.showModal({
  975. content: '识别到的车辆信息与录入车辆信息不一致,是否覆盖之前车辆信息',
  976. success: (res) => {
  977. if (res.confirm) {
  978. for (var key in this.carInfo) {
  979. this.carInfo[key] = "";
  980. }
  981. this.carInfo.seatCount = "0";
  982. this.carInfo.purchasePrice = "0";
  983. this.carInfo.licenseTypeCode = "02";
  984. this.carInfo.caryear = "0"; //年款
  985. this.carInfo.powertype = "汽油";
  986. this.carInfo.transferFlag = false;
  987. this.carInfo.loanStatus = 0;
  988. this.carInfo.noLicenseFlag = false;
  989. this.carInfo.cartype = "A0";
  990. this.carInfo.carnature = "8A";
  991. this.carInfo.property = "1";
  992. this.checkInfoShow = false;
  993. this.carInfo.brandName = '';
  994. Object.assign(this.carInfo, params.checkInfo);
  995. this.licenseNo = params.checkInfo.licenseNo;
  996. }
  997. }
  998. });
  999. } else {
  1000. Object.assign(this.carInfo, params.checkInfo);
  1001. this.licenseNo = params.checkInfo.licenseNo;
  1002. this.checkInfoShow = false;
  1003. }
  1004. for (let i = 0; i < this.carnatureList.length; i++) {
  1005. if (this.carInfo.carnature == this.carnatureList[i].id) {
  1006. this.carnatureIndex = i;
  1007. }
  1008. }
  1009. } else if (params.checkType == 1) {
  1010. if (params.checkInfo.type == 'ownerInfo') {
  1011. this.ownerInfo = {
  1012. name: params.checkInfo.name,
  1013. identifyType: "01",
  1014. identifyNumber: params.checkInfo.identifyNumber,
  1015. addr: params.checkInfo.addr,
  1016. identifyValidDate: params.checkInfo.identifyValidDate, //起期
  1017. identifyValidEndDate: params.checkInfo.identifyValidEndDate, //止期
  1018. email: "",
  1019. mobile: ""
  1020. }
  1021. } else if (params.checkInfo.type == 'policyHolderInfo') {
  1022. this.policyHolderInfo = {
  1023. name: params.checkInfo.name,
  1024. identifyType: "01",
  1025. identifyNumber: params.checkInfo.identifyNumber,
  1026. addr: params.checkInfo.addr,
  1027. identifyValidDate: params.checkInfo.identifyValidDate, //起期
  1028. identifyValidEndDate: params.checkInfo.identifyValidEndDate, //止期
  1029. email: "",
  1030. mobile: ""
  1031. }
  1032. } else {
  1033. this.insuredPersonInfo = {
  1034. name: params.checkInfo.name,
  1035. identifyType: "01",
  1036. identifyNumber: params.checkInfo.identifyNumber,
  1037. addr: params.checkInfo.addr,
  1038. identifyValidDate: params.checkInfo.identifyValidDate, //起期
  1039. identifyValidEndDate: params.checkInfo.identifyValidEndDate, //止期
  1040. email: "",
  1041. mobile: ""
  1042. }
  1043. }
  1044. this.checkInfoShow = false;
  1045. }
  1046. },
  1047. /**
  1048. * 复写 binddata 方法,如果只是为了校验,无复杂自定义操作,可忽略此方法
  1049. * @param {String} name 字段名称
  1050. * @param {String} value 表单域的值
  1051. */
  1052. binddata(name, value, type) {
  1053. // 通过 input 事件设置表单指定 name 的值
  1054. this.$refs[type].setValue(name, value)
  1055. },
  1056. //转变大写(车型/车架号/发动机号)
  1057. upperCaseType(type) {
  1058. this.carInfo[type] = this.carInfo[type].toUpperCase();
  1059. if (type == 'vinNo') {
  1060. this.carInfo.frameNo = this.carInfo.vinNo.trim();
  1061. }
  1062. },
  1063. //下拉改变触发该方法
  1064. bindPickerChange(e, type) {
  1065. this[type + 'Index'] = e.target.value;
  1066. this.carInfo[type] = this[type + 'List'][e.target.value].id;
  1067. },
  1068. // 身份证类型选择
  1069. bindIdentifyTypeChange(e, type) {
  1070. this[type + 'IdentifyIndex'] = e.target.value;
  1071. this[type + 'Info'].identifyType = this.identifyList[e.target.value].id;
  1072. this[type + 'Info'].identifyNumber = '';
  1073. },
  1074. bindDateChange(e, type) { //日期赋值
  1075. if ((type == 'issueDate') && (!this.carInfo.registerDate)) {
  1076. return uni.showToast({
  1077. title: '请先输入注册日期',
  1078. icon: "none"
  1079. });
  1080. }
  1081. this.carInfo[type] = e.detail.value;
  1082. if (new Date(this.carInfo.registerDate) > new Date(this.carInfo.issueDate)) {
  1083. this.carInfo.issueDate = ""
  1084. return uni.showToast({
  1085. title: '注册日期大于发证日期',
  1086. icon: "none"
  1087. });
  1088. }
  1089. },
  1090. // 是否过户
  1091. isChangeStatus(e) {
  1092. if (e.detail.value) {
  1093. this.carInfo.transferFlag = true;
  1094. } else {
  1095. this.carInfo.transferFlag = false;
  1096. }
  1097. },
  1098. //长期
  1099. insureLongterm(checked, e) {
  1100. checked.detail.value == true ? this[e].identifyValidEndDate = "9999-12-31" : this[e].identifyValidEndDate =
  1101. "";
  1102. },
  1103. //日期(可以选择20年以内的时间)
  1104. getDate(type) {
  1105. const date = new Date();
  1106. let year = date.getFullYear();
  1107. let month = date.getMonth() + 1;
  1108. let day = date.getDate();
  1109. if (type === 'start') {
  1110. year = year - 20;
  1111. } else if (type === 'end') {}
  1112. month = month > 9 ? month : '0' + month;;
  1113. day = day > 9 ? day : '0' + day;
  1114. return `${year}-${month}-${day}`;
  1115. },
  1116. //同车主信息
  1117. syncPersonInfo(e, type, touch1, touch2) {
  1118. this[type] = e.detail.value;
  1119. this[touch1 + 'IdentifyIndex'] = this[touch2 + 'IdentifyIndex'];
  1120. if (this[type]) {
  1121. this[touch1 + 'Info'] = JSON.parse(JSON.stringify(this[touch2 + 'Info']));
  1122. } else {
  1123. for (let key in this[touch1 + "Info"]) {
  1124. this[touch1 + "Info"][key] = '';
  1125. }
  1126. }
  1127. },
  1128. //跳转选择车辆类型页面
  1129. toChooseVehicleType() {
  1130. if (this.carInfo.brandName == '' || this.carInfo.brandName == null) {
  1131. uni.showToast({
  1132. icon: 'none',
  1133. title: '请输入车型名称',
  1134. duration: 1500
  1135. });
  1136. } else {
  1137. this.navigate({
  1138. url: '/pages/carInsure1/carType1?brandName=' + encodeURIComponent(this.carInfo.brandName)
  1139. }, "navigateTo", true);
  1140. }
  1141. },
  1142. // 通过车架号获取车型
  1143. async toChooseVin() {
  1144. if (this.carInfo.vinNo == '' || this.carInfo.vinNo == null) {
  1145. return uni.showToast({
  1146. icon: 'none',
  1147. title: '请输入车架号',
  1148. duration: 1500
  1149. });
  1150. } else {
  1151. if (!this.isFrameno(this.carInfo.vinNo.trim())) {
  1152. return uni.showToast({
  1153. title: '请输入正确的车架号',
  1154. icon: "none"
  1155. });
  1156. }
  1157. this.navigate({
  1158. url: '/pages/carInsure1/carType1?frameNo=' + encodeURIComponent(this.carInfo.vinNo)
  1159. }, "navigateTo", true);
  1160. this.carInfo.vinNo = this.carInfo.vinNo.trim();
  1161. this.carInfo.frameNo = this.carInfo.vinNo.trim();
  1162. }
  1163. },
  1164. //验证车架号
  1165. isFrameno(str) {
  1166. let mPattern = /^([0-9A-Z]){17}$/;
  1167. return mPattern.test(str);
  1168. },
  1169. toNext() {
  1170. if (this.holderAndOwner) { //投保人同车主
  1171. this.policyHolderInfo = this.ownerInfo;
  1172. this.policyHolderInfoRmation = this.ownerInfoRmation;
  1173. }
  1174. if (this.insuredAndOwner) { //被保人同车主
  1175. this.insuredPersonInfo = this.ownerInfo;
  1176. this.insuredPersonInfoRmation = this.ownerInfoRmation;
  1177. }
  1178. if (this.tbrAndOwner) { //被保人同投保人
  1179. this.insuredPersonInfo = this.policyHolderInfo;
  1180. this.insuredPersonInfoRmation = this.policyHolderInfoRmation;
  1181. }
  1182. this.$refs.carForm.submit().then(res => {
  1183. this.$refs.ownerForm.submit().then(res1 => {
  1184. this.$refs.policyHolderForm.submit().then(res2 => {
  1185. this.$refs.insuredPersonForm.submit().then(res3 => {
  1186. this.navigate({
  1187. url: '/pages/carInsure1/insureItems1',
  1188. success: (res) => {
  1189. res.eventChannel.emit("acceptData", {
  1190. carInfo: this.carInfo,
  1191. ownerInfo: this.ownerInfo,
  1192. policyHolderInfo: this
  1193. .policyHolderInfo,
  1194. insuredPersonInfo: this
  1195. .insuredPersonInfo,
  1196. riskList: this.riskList,
  1197. kindList: this.kindList,
  1198. carInfoRmation: this
  1199. .carInfoRmation, //车辆
  1200. ownerInfoRmation: this
  1201. .ownerInfoRmation, //车主
  1202. policyHolderInfoRmation: this
  1203. .policyHolderInfoRmation, //投保人
  1204. insuredPersonInfoRmation: this
  1205. .insuredPersonInfoRmation, //被保人
  1206. })
  1207. }
  1208. }, "navigateTo", true);
  1209. })
  1210. })
  1211. })
  1212. })
  1213. }
  1214. }
  1215. }
  1216. </script>
  1217. <style lang="scss" scoped>
  1218. @import '@/style/mixin.scss';
  1219. /deep/ .uni-group__content {
  1220. padding-top: 0;
  1221. }
  1222. /deep/ .uni-forms--top {
  1223. padding: 0;
  1224. }
  1225. /deep/ .uni-forms-item {
  1226. margin-bottom: 0;
  1227. }
  1228. /deep/ .uni-input-input {
  1229. font-size: 26upx;
  1230. }
  1231. /deep/ .uni-switch-input-checked {
  1232. background-color: $themeColor !important;
  1233. border-color: $themeColor !important;
  1234. }
  1235. /deep/ .uni-group__content {
  1236. padding-bottom: 0;
  1237. }
  1238. /deep/ .uni-input-input {
  1239. font-size: 28upx;
  1240. }
  1241. .body {
  1242. width: 100vw;
  1243. /* min-height: 100vh; */
  1244. background: #f5f5f5;
  1245. /* background: #FFFFFF; */
  1246. font-family: "Arial,Helvetica,sans-serif,PingFangSC";
  1247. }
  1248. .title {
  1249. height: 90upx;
  1250. border-bottom: 1px solid #EEEEEE;
  1251. }
  1252. .checkButton {
  1253. margin: 0 20upx;
  1254. width: 100upx;
  1255. height: 50upx;
  1256. flex-shrink: 1;
  1257. background: rgba($themeColor, 0.6);
  1258. color: #FFFFFF;
  1259. border-radius: 5upx;
  1260. }
  1261. .textColor {
  1262. color: #6091f5;
  1263. }
  1264. textarea {
  1265. font-size: 28upx;
  1266. width: 330upx;
  1267. }
  1268. /* 底部的样式Start */
  1269. .infoBottom {
  1270. height: 140upx;
  1271. position: fixed;
  1272. bottom: 0;
  1273. left: 0;
  1274. right: 0;
  1275. background: #FFFFFF;
  1276. border-top: 1upx solid #EEEEEE;
  1277. z-index: 99;
  1278. }
  1279. .infoBottom>button {
  1280. // font-size: 30upx;
  1281. background: $themeColor;
  1282. color: #FFFFFF;
  1283. flex: 1;
  1284. margin: 0upx 30upx;
  1285. }
  1286. /* 底部的样式End */
  1287. .mask {
  1288. /* pointer-events: none; */
  1289. position: fixed;
  1290. z-index: 99999;
  1291. top: 0;
  1292. left: 0;
  1293. right: 0;
  1294. bottom: 0;
  1295. height: 100vh;
  1296. width: 100vw;
  1297. display: flex;
  1298. flex-direction: column;
  1299. justify-content: center;
  1300. align-items: center;
  1301. flex-wrap: wrap;
  1302. }
  1303. .mask.mask-show {
  1304. background: rgba(255, 255, 255, 0.3);
  1305. }
  1306. .title {
  1307. color: #333;
  1308. font-size: 28rpx;
  1309. margin-top: 20rpx;
  1310. }
  1311. .loader {
  1312. display: block;
  1313. width: 120rpx;
  1314. height: 120rpx;
  1315. border-radius: 50%;
  1316. border: 3rpx solid transparent;
  1317. border-top-color: #9370db;
  1318. -webkit-animation: spin 2s linear infinite;
  1319. animation: spin 2s linear infinite;
  1320. }
  1321. .loader::before {
  1322. content: "";
  1323. position: absolute;
  1324. top: 5rpx;
  1325. left: 5rpx;
  1326. right: 5rpx;
  1327. bottom: 5rpx;
  1328. border-radius: 50%;
  1329. border: 3rpx solid transparent;
  1330. border-top-color: #ba55d3;
  1331. -webkit-animation: spin 3s linear infinite;
  1332. animation: spin 3s linear infinite;
  1333. }
  1334. .loader::after {
  1335. content: "";
  1336. position: absolute;
  1337. top: 15rpx;
  1338. left: 15rpx;
  1339. right: 15rpx;
  1340. bottom: 15rpx;
  1341. border-radius: 50%;
  1342. border: 3rpx solid transparent;
  1343. border-top-color: #ff00ff;
  1344. -webkit-animation: spin 1.5s linear infinite;
  1345. animation: spin 1.5s linear infinite;
  1346. }
  1347. @-webkit-keyframes spin {
  1348. 0% {
  1349. -webkit-transform: rotate(0deg);
  1350. -ms-transform: rotate(0deg);
  1351. transform: rotate(0deg);
  1352. }
  1353. 100% {
  1354. -webkit-transform: rotate(360deg);
  1355. -ms-transform: rotate(360deg);
  1356. transform: rotate(360deg);
  1357. }
  1358. }
  1359. @keyframes spin {
  1360. 0% {
  1361. -webkit-transform: rotate(0deg);
  1362. -ms-transform: rotate(0deg);
  1363. transform: rotate(0deg);
  1364. }
  1365. 100% {
  1366. -webkit-transform: rotate(360deg);
  1367. -ms-transform: rotate(360deg);
  1368. transform: rotate(360deg);
  1369. }
  1370. }
  1371. </style>