carInfo1.vue 45 KB

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