editVehicle.vue 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564
  1. <!-- 管理车辆 -->
  2. <template>
  3. <view @click='hidden' class="content">
  4. <view class="flex s-row container">
  5. <view class="flex row">
  6. <view class="left-text">车型</view>
  7. <view class="color" @click="selectCarModel">{{dataDetails.carCategory}} {{dataDetails.carType}}</view>
  8. <view>></view>
  9. <u-picker :show="carModel" :columns="carModelColumns" :closeOnClickOverlay='true' @close='carModelClose'
  10. @cancel='carModelClose' @confirm='confirmCarModel' @change="changeCarModel"></u-picker>
  11. </view>
  12. <view class="title">道路运输证</view>
  13. <view @click="uploadImg(8)" class="picture picture8" v-if="!dataDetails.operationCertificate">
  14. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  15. <view class="text">上传道路运输证</view>
  16. </view>
  17. <view v-if="dataDetails.operationCertificate" @click.stop="uploadImg(8)" class="preview-card-img picture">
  18. <view @click.stop="delCard(8)">
  19. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  20. </image>
  21. </view>
  22. <image class="" :src="dataDetails.operationCertificate" mode="aspectFit"></image>
  23. </view>
  24. <view class="flex row">
  25. <view class="left-text">道路运输证号</view>
  26. <u--input maxlength='12' placeholder="输入道路运输证号" inputAlign='right' border="none"
  27. v-model="dataDetails.operationCertificateNumber">
  28. </u--input>
  29. </view>
  30. <view class="flex row flex-space-between">
  31. <view class="left-text">道路运输证有效期</view>
  32. <view class="" @click="selectValidityPeriod(4)">
  33. {{dataDetails.operationCertificateValidityDate?dataDetails.operationCertificateValidityDate:'选择有效期>'}}
  34. </view>
  35. </view>
  36. <view v-if="sign == '挂车'">
  37. <view class="title">挂车道路运输证</view>
  38. <view @click="uploadImg(9)" class="picture picture9" v-if="!dataDetails.trailerOperationCertificate">
  39. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  40. <view class="text">上传挂车道路运输证</view>
  41. </view>
  42. <view v-if="dataDetails.trailerOperationCertificate" @click.stop="uploadImg(9)"
  43. class="preview-card-img picture">
  44. <view @click.stop="delCard(9)">
  45. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  46. </image>
  47. </view>
  48. <image class="" :src="dataDetails.trailerOperationCertificate" mode="aspectFit"></image>
  49. </view>
  50. </view>
  51. <view class="flex row" v-if="sign == '挂车'">
  52. <view class="left-text">挂车道路运输证号</view>
  53. <u--input maxlength='12' placeholder="输入挂车道路运输证号" inputAlign='right' border="none"
  54. v-model="dataDetails.trailerOperationCertificateNumber">
  55. </u--input>
  56. </view>
  57. <view class="flex row flex-space-between" v-if="sign == '挂车'">
  58. <view class="left-text">挂车道路运输证有效期</view>
  59. <view class="" @click="selectValidityPeriod(5)">
  60. {{dataDetails.trailerOperationCertificateValidityDate?dataDetails.trailerOperationCertificateValidityDate:'选择有效期>'}}
  61. </view>
  62. </view>
  63. <view class="title" v-if="sign == '挂车'">牵引车行驶证主页</view>
  64. <view class="title" v-if="sign == '非挂车'">行驶证主页</view>
  65. <view @click="uploadImg(3)" class="picture picture3" v-if="!dataDetails.drivingLicenseHomePage">
  66. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  67. <view class="text" v-if="sign == '挂车'">上传牵引车行驶证主页</view>
  68. <view class="text" v-else>上传行驶证主页</view>
  69. </view>
  70. <view v-if="dataDetails.drivingLicenseHomePage" @click.stop="uploadImg(1)" class="preview-card-img picture">
  71. <view @click.stop="delCard(3)">
  72. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  73. </image>
  74. </view>
  75. <image class="" :src="dataDetails.drivingLicenseHomePage" mode="aspectFit"></image>
  76. </view>
  77. <view class="title" v-if="sign == '挂车'">牵引车行驶证副页</view>
  78. <view class="title" v-if="sign == '非挂车'">行驶证副页</view>
  79. <view @click="uploadImg(4)" class="picture picture4" v-if="!dataDetails.drivingLicenseBackPage">
  80. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  81. <view class="text" v-if="sign == '挂车'">上传牵引车行驶证副页</view>
  82. <view class="text" v-else>上传行驶证副页</view>
  83. </view>
  84. <view v-if="dataDetails.drivingLicenseBackPage" @click.stop="uploadImg(4)" class="preview-card-img picture">
  85. <view @click.stop="delCard(4)">
  86. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  87. </image>
  88. </view>
  89. <image class="" :src="dataDetails.drivingLicenseBackPage" mode="aspectFit"></image>
  90. </view>
  91. <view class="flex row flex-space-between">
  92. <view class="left-text">行驶证档案编号</view>
  93. <u--input maxlength='12' placeholder="输入行驶证档案编号" inputAlign='right' border="none"
  94. v-model="dataDetails.drivingLicenseNumber">
  95. </u--input>
  96. </view>
  97. <view class="flex row flex-space-between">
  98. <view class="left-text">注册日期</view>
  99. <view class="" @click="selectValidityPeriod(6)">
  100. {{dataDetails.drivingLicenseRegistrationDate?dataDetails.drivingLicenseRegistrationDate:'选择注册日期>'}}
  101. </view>
  102. </view>
  103. <view class="flex row flex-space-between">
  104. <view class="left-text">发证日期</view>
  105. <view class="" @click="selectValidityPeriod(7)">
  106. {{dataDetails.drivingLicenseIssueDate?dataDetails.drivingLicenseIssueDate:'选择发证日期>'}}
  107. </view>
  108. </view>
  109. <view class="flex row flex-space-between">
  110. <view class="left-text">行驶证有效期</view>
  111. <view class="" @click="selectValidityPeriod(1)">
  112. {{dataDetails.drivingLicenseValidityDate?dataDetails.drivingLicenseValidityDate:'选择有效截止日期>'}}
  113. </view>
  114. </view>
  115. <view class="flex row flex-space-between">
  116. <view class="left-text">使用性质</view>
  117. <u--input placeholder="输入使用性质" inputAlign='right' border="none" v-model="dataDetails.useNature"
  118. disabled>
  119. </u--input>
  120. </view>
  121. <view class="flex row flex-space-between">
  122. <view class="left-text">发证机关</view>
  123. <u--input placeholder="输入发证机关" inputAlign='right' border="none" maxlength="25" v-model="dataDetails.lssuingAuthority">
  124. </u--input>
  125. </view>
  126. <view class="flex row noborder flex-space-between">
  127. <view class="left-text">车辆能源类型</view>
  128. <view class="" @click="driveType">
  129. {{dataDetails.energyType?dataDetails.energyType:'选择车辆能源类型>'}}
  130. </view>
  131. </view>
  132. <view class="" v-if="sign == '挂车'">
  133. <view class="title">挂车行驶证主页</view>
  134. <view @click="uploadImg(5)" class="picture picture5" v-if="!dataDetails.trailerLicenseHomePage">
  135. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  136. <view class="text">上传挂车行驶证主页</view>
  137. </view>
  138. <view v-if="dataDetails.trailerLicenseHomePage" @click.stop="uploadImg(5)"
  139. class="preview-card-img picture">
  140. <view @click.stop="delCard(5)">
  141. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  142. </image>
  143. </view>
  144. <image class="" :src="dataDetails.trailerLicenseHomePage" mode="aspectFit"></image>
  145. </view>
  146. </view>
  147. <view v-if="sign == '挂车'">
  148. <view class="title">挂车行驶证副页</view>
  149. <view @click="uploadImg(6)" class="picture picture6" v-if="!dataDetails.trailerLicenseBackPage">
  150. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  151. <view class="text">上传挂车行驶证副页</view>
  152. </view>
  153. <view v-if="dataDetails.trailerLicenseBackPage" @click.stop="uploadImg(6)"
  154. class="preview-card-img picture">
  155. <view @click.stop="delCard(6)">
  156. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  157. </image>
  158. </view>
  159. <image class="" :src="dataDetails.trailerLicenseBackPage" mode="aspectFit"></image>
  160. </view>
  161. </view>
  162. <view class="flex row" v-if="sign == '挂车'">
  163. <view maxlength='12' class="left-text">挂车行驶证档案编号</view>
  164. <u--input placeholder="输入挂车行驶证档案编号" inputAlign='right' border="none"
  165. v-model="dataDetails.trailerLicenseNumber">
  166. </u--input>
  167. </view>
  168. <view class="flex row flex-space-between" v-if="sign == '挂车'">
  169. <view class="left-text">注册日期</view>
  170. <view class="" @click="selectValidityPeriod(8)">
  171. {{dataDetails.trailerLicenseRegistrationDate?dataDetails.trailerLicenseRegistrationDate:'选择注册日期>'}}
  172. </view>
  173. </view>
  174. <view class="flex row flex-space-between" v-if="sign == '挂车'">
  175. <view class="left-text">发证日期</view>
  176. <view class="" @click="selectValidityPeriod(9)">
  177. {{dataDetails.trailerLicenseIssueDate?dataDetails.trailerLicenseIssueDate:'选择发证日期>'}}
  178. </view>
  179. </view>
  180. <view class="flex row flex-space-between" v-if="sign == '挂车'">
  181. <view class="left-text">挂车行驶证有效期</view>
  182. <view class="" @click="selectValidityPeriod(2)">
  183. {{dataDetails.trailerLicenseValidityDate?dataDetails.trailerLicenseValidityDate:'选择有效截止日期>'}}
  184. </view>
  185. </view>
  186. <view class="flex row flex-space-between" v-if="sign == '挂车'">
  187. <view class="left-text">使用性质</view>
  188. <u--input placeholder="输入使用性质" inputAlign='right' border="none" v-model="dataDetails.guaUseNature"
  189. disabled>
  190. </u--input>
  191. </view>
  192. <view class="flex row flex-space-between" v-if="sign == '挂车'">
  193. <view class="left-text">发证机关</view>
  194. <u--input placeholder="输入发证机关" inputAlign='right' border="none" maxlength="25"
  195. v-model="dataDetails.guaLssuingAuthority">
  196. </u--input>
  197. </view>
  198. <!-- 牵引车 -->
  199. <view class="flex row" v-if="sign == '挂车'">
  200. <view class="left left-text">牵引车车牌号</view>
  201. <view class="right flex">
  202. <input class="car-uumber" v-model='dataDetails.carNumber' @click.stop="handleShowKeyboard(index)"
  203. :disabled="true" placeholder="输入牵引车车牌号" name="input"></input>
  204. </view>
  205. </view>
  206. <view class="flex row" v-if="sign == '非挂车'">
  207. <view class="left left-text">车牌号</view>
  208. <view class="right flex">
  209. <input class="car-uumber" v-model='dataDetails.carNumber' @click.stop="handleShowKeyboard(index)"
  210. :disabled="true" placeholder="输入车牌号" name="input"></input>
  211. </view>
  212. </view>
  213. <view class="flex row flex-space-between">
  214. <view class="left-text">车牌颜色</view>
  215. <view class='flex'>
  216. <view class="color" @click="selectNoColor">{{dataDetails.carNumberColour}}</view>
  217. <view>
  218. <image v-if='!dataDetails.carNumberColour' style='width:12px;height:12px;' src="../../../static/right.png" mode=""></image>
  219. </view>
  220. </view>
  221. </view>
  222. <view class="flex row">
  223. <view class="left-text">车辆所属车主</view>
  224. <u--input placeholder="输入车主姓名" inputAlign='right' border="none" v-model="dataDetails.owner">
  225. </u--input>
  226. </view>
  227. <view class="flex row" v-if="sign == '非挂车'">
  228. <view class="left-text">总质量(千克)</view>
  229. <u--input placeholder="输入总质量" inputAlign='right' border="none" v-model="dataDetails.carTotalWeight">
  230. </u--input>
  231. </view>
  232. <view class="flex row" v-if="sign == '非挂车'">
  233. <view class="left-text">核定载质量(千克)</view>
  234. <u--input placeholder="输入核定载质量" inputAlign='left' border="none" v-model="dataDetails.carApprovedWeight">
  235. </u--input>
  236. </view>
  237. <view class="flex row" v-if="sign == '挂车'">
  238. <view class="left-text">整备质量(千克)</view>
  239. <u--input placeholder="输入整备质量" inputAlign='right' border="none" v-model="dataDetails.servicingWeight">
  240. </u--input>
  241. </view>
  242. <view class="flex row noborder" v-if="sign == '挂车'">
  243. <view style='width:390rpx;' class="left-text">牵引车外廓尺寸(毫米)</view>
  244. </view>
  245. <view class="flex row noborder" v-if="sign == '非挂车'">
  246. <view class="left-text">外廓尺寸(毫米)</view>
  247. </view>
  248. <view class="flex row noborder input-ckg">
  249. <view class="input-positon">
  250. <u--input class="input" placeholder="长" inputAlign='left' border="none"
  251. v-model="dataDetails.carLong">
  252. </u--input>
  253. <view class="position-right">
  254. mm
  255. </view>
  256. </view>
  257. <view class="star">*</view>
  258. <view class="input-positon">
  259. <u--input placeholder="宽" inputAlign='left' border="none" v-model="dataDetails.carWidth">
  260. </u--input>
  261. <view class="position-right">
  262. mm
  263. </view>
  264. </view>
  265. <view class="star">*</view>
  266. <view class="input-positon">
  267. <u--input placeholder="高" inputAlign='left' border="none" v-model="dataDetails.carHeight">
  268. </u--input>
  269. <view class="position-right">
  270. mm
  271. </view>
  272. </view>
  273. </view>
  274. <view class="flex row noborder s-row">
  275. <view class="left-text" style="width: 100%;" v-if="sign == '挂车'">上传人和牵引车合影(牵引车牌号可见)</view>
  276. <view class="left-text" style="width: 100%;" v-if="sign == '非挂车'">上传人车合影(车头车牌号可见)</view>
  277. <u-upload class="uview-upload" :fileList="fileList1" @afterRead="afterRead($event,'1')"
  278. @delete="deletePic" name="1" multiple :maxCount="1"></u-upload>
  279. </view>
  280. <!-- 挂车 -->
  281. <view v-if="sign == '挂车'">
  282. <view class="flex row">
  283. <view class="left left-text">挂车车牌号</view>
  284. <view class="right flex">
  285. <input class="car-uumber" maxlength="6" v-model='dataDetails.guaCarNumber'
  286. @click.stop="handleShowKeyboard1(index)" :disabled="true" placeholder="输入挂车牌号"
  287. name="input"></input>
  288. </view>
  289. </view>
  290. <view class="flex row">
  291. <view class="left-text">挂车车辆所属车主</view>
  292. <u--input placeholder="输入车主姓名" inputAlign='right' border="none" v-model="dataDetails.guaOwner">
  293. </u--input>
  294. </view>
  295. <view class="flex row">
  296. <view class="left-text">挂车整备质量(千克)</view>
  297. <u--input placeholder="输入总质量" inputAlign='right' border="none"
  298. v-model="dataDetails.guaServicingWeight">
  299. </u--input>
  300. </view>
  301. <view class="flex row">
  302. <view class="left-text">挂车核定载质量(千克)</view>
  303. <u--input placeholder="输入核定载质量" inputAlign='right' border="none"
  304. v-model="dataDetails.guaCarApprovedWeight">
  305. </u--input>
  306. </view>
  307. <view class="flex row noborder">
  308. <view style='width:390rpx;' class="left-text">挂车外廓尺寸(毫米)</view>
  309. </view>
  310. <view class="flex row noborder input-ckg">
  311. <view class="input-positon">
  312. <u--input class="input" placeholder="长" inputAlign='left' border="none"
  313. v-model="dataDetails.guaCarLong">
  314. </u--input>
  315. <view class="position-right">
  316. mm
  317. </view>
  318. </view>
  319. <view class="star">*</view>
  320. <view class="input-positon">
  321. <u--input placeholder="宽" inputAlign='left' border="none" v-model="dataDetails.guaCarWidth">
  322. </u--input>
  323. <view class="position-right">
  324. mm
  325. </view>
  326. </view>
  327. <view class="star">*</view>
  328. <view class="input-positon">
  329. <u--input placeholder="高" inputAlign='left' border="none" v-model="dataDetails.guaCarHeight">
  330. </u--input>
  331. <view class="position-right">
  332. mm
  333. </view>
  334. </view>
  335. </view>
  336. <view class="flex row noborder s-row">
  337. <view class="left-text" style="width: 100%;">上传人和挂车合影(挂车车牌号可见)</view>
  338. <u-upload class="uview-upload" :fileList="fileList2" @afterRead="afterRead1($event,'2')"
  339. @delete="deletePic" name="2" multiple :maxCount="1"></u-upload>
  340. </view>
  341. </view>
  342. <!-- <view class="level1-title">证件信息</view> -->
  343. </view>
  344. <view class='submit-btn-wrap'>
  345. <view class="submit-btn" @click="$u.throttle(submit, 5000)">提交</view>
  346. </view>
  347. <master-keyboard ref="keyboard" keyboardtype="car" :show="keyShow" :randomNumber="true" :newCar="false"
  348. :defaultValue="carNumber" @keyboardClick="handleClick"></master-keyboard>
  349. <master-keyboard ref="keyboard1" :guastatus='true' keyboardtype="car" :show="keyShow1" :randomNumber="true" :newCar="false"
  350. :defaultValue="carNumber1" @keyboardClick="handleClick1"></master-keyboard>
  351. <u-toast ref="uToast"></u-toast>
  352. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  353. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true" @close="isShowimgType=false">
  354. </u-action-sheet>
  355. <u-picker :show="carColor" :columns="colorColumns" :closeOnClickOverlay='true' @close='colorClose'
  356. @cancel='colorClose' @confirm='confirmColor' ></u-picker>
  357. <u-picker :show="isShowValidity" ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
  358. :closeOnClickOverlay='true' @close='isShowValidity=false' @cancel='isShowValidity=false'>
  359. </u-picker>
  360. <u-picker :show="isShowCarType" ref="uPicker" :columns="carTypeList" @confirm="confirmCarType"
  361. :closeOnClickOverlay='true' @close='isShowCarType=false' @cancel='isShowCarType=false'>
  362. </u-picker>
  363. </view>
  364. </template>
  365. <script>
  366. import permision from "@/js_sdk/wa-permission/permission.js";
  367. import uploadImage from '@/components/ossutil/uploadFile.js';
  368. import keyboard from "@/components/master-keyboard/master-keyboard.vue";
  369. var _this;
  370. import {
  371. mapState
  372. } from 'vuex';
  373. export default {
  374. data() {
  375. return {
  376. index: '',
  377. keyShow: false,
  378. keyShow1: false,
  379. carNumber: '',
  380. carNumber1: "",
  381. dataDetails: {
  382. // driverId: '',
  383. // carNumber: '',
  384. carNumberColour: '黄色',
  385. carCategory: '挂车',
  386. carType: '高栏',
  387. // carTotalWeight: '',
  388. // carApprovedWeight: '',
  389. // carLong: '',
  390. // carWidth: '',
  391. // carHeight: '',
  392. // addressUrl: ''
  393. },
  394. carTypeList: [
  395. ["汽油", "柴油", "油电混合", "纯电动", "插电式混合动力", "增程式"]
  396. ],
  397. isShowCarType: false,
  398. carModelColumns: [
  399. ['挂车', '非挂车'],
  400. ['高栏', '集装箱', '自卸车']
  401. ],
  402. carModelColumnData: [
  403. ['高栏', '集装箱', '自卸车'],
  404. ['重型仓栏']
  405. ],
  406. colorColumns: [
  407. ['黄色', '蓝色']
  408. ],
  409. carColor: false,
  410. carModel: false,
  411. fileList1: [],
  412. fileList2: [],
  413. ValidityPeriodType: "",
  414. validityPeriod: [],
  415. isShowValidity: false,
  416. uploadType: '',
  417. isShowimgType: false,
  418. sign: "挂车"
  419. };
  420. },
  421. computed: {
  422. ...mapState(['hasLogin', 'userInfo', 'firstAuthentication']),
  423. },
  424. onLoad(options) {
  425. _this = this;
  426. console.log(options)
  427. if(options.guaCarNumber){
  428. options.guaCarNumber=options.guaCarNumber.substring(0,6);
  429. }
  430. this.dataDetails = options
  431. this.sign = options.carCategory
  432. // if (this.dataDetails.carType.indexOf("挂车") != -1) {
  433. // this.sign = "挂车"
  434. // } else {
  435. // this.sign = "非挂车"
  436. // }
  437. this.fileList1 = [{
  438. url: options.addressUrl
  439. }]
  440. this.fileList2 = [{
  441. url: options.guaAddressUrl
  442. }]
  443. this.get_camera_permission()
  444. this.validityPeriod = this.$helper.makeValidityPeriod()
  445. },
  446. methods: {
  447. async get_camera_permission() {
  448. var photol=await permision.requestAndroidPermission("android.permission.CAMERA")
  449. if(photol == false){
  450. uni.showModal({
  451. title: '提示',
  452. content: '您已经关闭相册权限,去设置',
  453. success: function (res) {
  454. if (res.confirm) {
  455. permision.gotoAppPermissionSetting()
  456. // plus.runtime.openURL("app-settings:");
  457. } else if (res.cancel) {
  458. console.log('用户点击取消');
  459. }
  460. }
  461. });
  462. }
  463. },
  464. driveType() {
  465. this.isShowCarType = true
  466. },
  467. hidden(){
  468. this.$refs.keyboard.open(false)
  469. this.$refs.keyboard1.open(false)
  470. },
  471. confirmCarType(e) {
  472. this.dataDetails.energyType = e.value[0]
  473. this.isShowCarType = false
  474. },
  475. //挂车牌号弹出键盘
  476. handleShowKeyboard1(index) {
  477. if (this.dataDetails.guaCarNumber == '') {
  478. this.carNumber1 = ''
  479. } else {
  480. this.carNumber1 = this.dataDetails.guaCarNumber
  481. }
  482. if (this.$refs.keyboard1.open) {
  483. this.$refs.keyboard1.open(false) //true 键盘显示 false 键盘隐藏
  484. } else {
  485. this.$refs.keyboard1[0].open(false)
  486. }
  487. this.index = index
  488. if (this.$refs.keyboard1.open) {
  489. this.$refs.keyboard1.open(true) //true 键盘显示 false 键盘隐藏
  490. } else {
  491. this.$refs.keyboard1[0].open(true)
  492. }
  493. },
  494. handleClick1(e) {
  495. this.carNumber1 = e.value
  496. this.dataDetails.guaCarNumber = e.value //键盘输入值
  497. },
  498. delCard(type) {
  499. switch (type) {
  500. case 1:
  501. _this.dataDetails.operationCertificate = "" //道路运输证
  502. break;
  503. case 2:
  504. _this.dataDetails.trailerOperationCertificate = "" //挂车道路运输证
  505. break;
  506. case 3:
  507. _this.dataDetails.drivingLicenseHomePage = "" //牵引车行驶证
  508. break;
  509. case 4:
  510. _this.dataDetails.drivingLicenseBackPage = "" //牵引车行驶证副页
  511. break;
  512. case 5:
  513. _this.dataDetails.trailerLicenseHomePage = "" //挂车行驶证
  514. break;
  515. case 6:
  516. _this.dataDetails.trailerLicenseBackPage = ""//挂车行驶证副页
  517. break;
  518. }
  519. this.$forceUpdate()
  520. },
  521. uploadImg(type) {
  522. this.uploadType = type
  523. this.imgTypeSelect()
  524. // this.isShowimgType = true
  525. },
  526. selectValidityPeriod(type) {
  527. this.ValidityPeriodType = type
  528. this.isShowValidity = true
  529. },
  530. // 上传图片
  531. imgTypeSelect(val) {
  532. uni.chooseImage({
  533. count: 1,
  534. // sourceType: this.$helper.chooseImage.sourceType,
  535. success: function(res) {
  536. console.log(JSON.stringify(res.tempFilePaths));
  537. uploadImage("images", res.tempFilePaths[0], 'appData/',
  538. result => {
  539. // 上传成功回调函数
  540. console.log('图片地址-----', result)
  541. switch (_this.uploadType) {
  542. case 1:
  543. _this.dataDetails.driverLicenseHomePage = result
  544. break;
  545. case 2:
  546. _this.dataDetails.driverLicenseBackPage = result
  547. break;
  548. case 3:
  549. _this.dataDetails.drivingLicenseHomePage = result
  550. _this.$request.baseRequest('get',
  551. '/driverCarInfo/api/driveringLicenseShibie', {
  552. image: result,
  553. flag: 1
  554. }).then(res => {
  555. if (res.data) {
  556. _this.dataDetails.carNumber = res.data
  557. .carNum //车牌号
  558. _this.dataDetails.owner = res.data
  559. .owner //车辆所有人
  560. _this.$forceUpdate()
  561. }
  562. })
  563. .catch(res => {
  564. uni.$u.toast(res.message);
  565. });
  566. break;
  567. case 4:
  568. _this.dataDetails.drivingLicenseBackPage = result
  569. _this.$request.baseRequest('get',
  570. '/driverCarInfo/api/driveringLicenseShibie', {
  571. image: result,
  572. flag: 2
  573. }).then(res => {
  574. if (res.data) {
  575. if (res.data.issuingAuthority) { //行驶证发证机关
  576. _this.dataDetails.lssuingAuthority = res
  577. .data.issuingAuthority
  578. }
  579. if (res.data
  580. .licenseRegistrationDate) { //行驶证注册日期
  581. _this.dataDetails
  582. .drivingLicenseRegistrationDate = res
  583. .data.licenseRegistrationDate
  584. }
  585. if (res.data.licenseIssueDate) { //行驶证发证日期
  586. _this.dataDetails.drivingLicenseIssueDate =
  587. res.data.licenseIssueDate
  588. }
  589. _this.dataDetails.drivingLicenseValidityDate =
  590. res.data.driveringEndDate //行驶证有效期
  591. _this.dataDetails.drivingLicenseNumber = res
  592. .data.driveringNum //行驶证档案编号
  593. if (_this.sign == "非挂车") {
  594. if (res.data.servicingMass && res.data
  595. .servicingMass.indexOf("kg") != -1) {
  596. res.data.servicingMass = res.data
  597. .servicingMass.slice(0, res.data
  598. .servicingMass.length - 2)
  599. }
  600. _this.dataDetails.carTotalWeight = res.data
  601. .servicingMass //总质量
  602. }
  603. if (res.data.approvedLoadMass.indexOf("kg") !=
  604. -1) {
  605. res.data.approvedLoadMass = res.data
  606. .approvedLoadMass.slice(0, res.data
  607. .approvedLoadMass.length - 2)
  608. }
  609. _this.dataDetails.carApprovedWeight = res.data
  610. .approvedLoadMass //核定载质量
  611. if (res.data.size && res.data.size.indexOf(
  612. "mm") != -1) {
  613. res.data.size = res.data.size.slice(0, res
  614. .data.size.length - 2);
  615. }
  616. _this.dataDetails.carLong = res.data.size
  617. .split("X")[0] //车长
  618. _this.dataDetails.carWidth = res.data.size
  619. .split("X")[1] //车宽
  620. _this.dataDetails.carHeight = res.data.size
  621. .split("X")[2] //车高
  622. _this.$forceUpdate()
  623. }
  624. })
  625. .catch(res => {
  626. uni.$u.toast(res.message);
  627. });
  628. break;
  629. case 5: //挂车行驶证
  630. _this.dataDetails.trailerLicenseHomePage = result
  631. _this.$request.baseRequest('get',
  632. '/driverCarInfo/api/driveringLicenseShibie', {
  633. image: result,
  634. flag: 1
  635. }).then(res => {
  636. if (res.data) {
  637. if (res.data.issuingAuthority) { //行驶证发证机关
  638. _this.dataDetails.guaLssuingAuthority = res
  639. .data.issuingAuthority
  640. }
  641. if (res.data.licenseRegistrationDate) { //行驶证注册日期
  642. _this.dataDetails
  643. .trailerLicenseRegistrationDate = res.data
  644. .licenseRegistrationDate
  645. }
  646. if (res.data.licenseIssueDate) { //行驶证发证日期
  647. _this.dataDetails.trailerLicenseIssueDate = res
  648. .data.licenseIssueDate
  649. }
  650. _this.dataDetails.guaCarNumber = res.data
  651. .carNum //车牌号
  652. _this.dataDetails.guaOwner = res.data
  653. .owner //车辆所有人
  654. _this.$forceUpdate()
  655. }
  656. })
  657. .catch(res => {
  658. uni.$u.toast(res.message);
  659. });
  660. break;
  661. case 6:
  662. _this.dataDetails.trailerLicenseBackPage = result
  663. _this.$request.baseRequest('get',
  664. '/driverCarInfo/api/driveringLicenseShibie', {
  665. image: result,
  666. flag: 2
  667. }).then(res => {
  668. if (res.data) {
  669. _this.dataDetails.trailerLicenseValidityDate =
  670. res.data.driveringEndDate //挂车行驶证有效期
  671. _this.dataDetails.trailerLicenseNumber = res
  672. .data.driveringNum //挂车行驶证档案编号
  673. if (res.data.servicingMass && res.data
  674. .servicingMass.indexOf("kg") != -1) {
  675. res.data.servicingMass = res.data
  676. .servicingMass.slice(0, res.data
  677. .servicingMass.length - 2)
  678. }
  679. if (res.data.approvedLoadMass.indexOf("kg") !=
  680. -1) {
  681. res.data.approvedLoadMass = res.data
  682. .approvedLoadMass.slice(0, res.data
  683. .approvedLoadMass.length - 2)
  684. }
  685. _this.dataDetails.guaServicingWeight = res.data
  686. .servicingMass //总质量
  687. _this.dataDetails.guaCarApprovedWeight = res
  688. .data.approvedLoadMass //核定载质量
  689. if (res.data.size && res.data.size.indexOf(
  690. "mm") != -1) {
  691. res.data.size = res.data.size.slice(0, res
  692. .data.size.length - 2);
  693. }
  694. _this.dataDetails.guaCarLong = res.data.size
  695. .split("X")[0] //车长
  696. _this.dataDetails.guaCarWidth = res.data.size
  697. .split("X")[1] //车宽
  698. _this.dataDetails.guaCarHeight = res.data.size
  699. .split("X")[2] //车高
  700. _this.$forceUpdate()
  701. }
  702. })
  703. .catch(res => {
  704. uni.$u.toast(res.message);
  705. });
  706. break;
  707. case 7:
  708. _this.dataDetails.qualificationCertificate = result
  709. break;
  710. case 8:
  711. _this.dataDetails.operationCertificate = result
  712. _this.$request.baseRequest('get',
  713. '/driverCarInfo/api/tranLicenseShibie', {
  714. image: result
  715. }).then(res => {
  716. if (res.data) {
  717. _this.dataDetails.operationCertificateNumber =
  718. res.data.tranNumber
  719. _this.dataDetails
  720. .operationCertificateValidityDate = res
  721. .data.tranEndDate
  722. _this.$forceUpdate()
  723. }
  724. })
  725. .catch(res => {
  726. uni.$u.toast(res.message);
  727. });
  728. break;
  729. case 9:
  730. _this.dataDetails.trailerOperationCertificate = result
  731. _this.$request.baseRequest('get',
  732. '/driverCarInfo/api/tranLicenseShibie', {
  733. image: result
  734. }).then(res => {
  735. if (res.data) {
  736. _this.dataDetails
  737. .trailerOperationCertificateNumber = res
  738. .data.tranNumber
  739. _this.dataDetails
  740. .trailerOperationCertificateValidityDate =
  741. res.data.tranEndDate
  742. _this.$forceUpdate()
  743. }
  744. })
  745. .catch(res => {
  746. uni.$u.toast(res.message);
  747. });
  748. break;
  749. }
  750. _this.$forceUpdate()
  751. }
  752. )
  753. }
  754. });
  755. },
  756. confirmValidityPeriod(e) {
  757. console.log('confirm', e)
  758. if(e.value[0]==''){
  759. this.$refs.uToast.show({
  760. type: 'error',
  761. message: "年份不能为空!",
  762. })
  763. return
  764. }else if(e.value[1]==''){
  765. this.$refs.uToast.show({
  766. type: 'error',
  767. message: "月份不能为空!",
  768. })
  769. return
  770. }else if(e.value[2]==''){
  771. this.$refs.uToast.show({
  772. type: 'error',
  773. message: "日期不能为空!",
  774. })
  775. return
  776. }
  777. var date=new Date()
  778. var text=''
  779. switch (this.ValidityPeriodType) {
  780. case 4:
  781. text='道路运输证已过期!'
  782. break
  783. case 5:
  784. text='挂车道路运输证已过期!'
  785. break
  786. case 1:
  787. text='行驶证已过期!'
  788. break
  789. case 2:
  790. text='挂车行驶证已过期!'
  791. break
  792. }
  793. if(this.ValidityPeriodType==1||this.ValidityPeriodType==2||this.ValidityPeriodType==4||this.ValidityPeriodType==5){
  794. if(e.value[0]<date.getFullYear()){
  795. this.$refs.uToast.show({
  796. type: 'error',
  797. message: text,
  798. })
  799. return
  800. }
  801. if(e.value[0]==date.getFullYear()&&Number(e.value[1])<(date.getMonth()+1)){
  802. this.$refs.uToast.show({
  803. type: 'error',
  804. message: text,
  805. })
  806. return
  807. }
  808. if(e.value[0]==date.getFullYear()&&Number(e.value[1])==(date.getMonth()+1)&&Number(e.value[2])<=(date.getDate())){
  809. this.$refs.uToast.show({
  810. type: 'error',
  811. message: text,
  812. })
  813. return
  814. }
  815. }
  816. switch (this.ValidityPeriodType) {
  817. case 0:
  818. this.dataDetails.driverLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  819. break
  820. case 1:
  821. this.dataDetails.drivingLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  822. break
  823. case 2:
  824. this.dataDetails.trailerLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  825. break
  826. case 3:
  827. this.dataDetails.qualificationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  828. .value[2]
  829. break
  830. case 4:
  831. this.dataDetails.operationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[
  832. 2]
  833. break
  834. case 5:
  835. this.dataDetails.trailerOperationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  836. .value[2]
  837. break
  838. case 6: //行驶证注册日期
  839. this.dataDetails.drivingLicenseRegistrationDate = e.value[0] + '-' + e.value[1] + '-' + e
  840. .value[2]
  841. break
  842. case 7: //行驶证发证日期
  843. this.dataDetails.drivingLicenseIssueDate = e.value[0] + '-' + e.value[1] + '-' + e
  844. .value[2]
  845. break
  846. case 8: //挂车行驶证注册日期
  847. this.dataDetails.trailerLicenseRegistrationDate = e.value[0] + '-' + e.value[1] + '-' + e
  848. .value[2]
  849. break
  850. case 9: //挂车行驶证发证日期
  851. this.dataDetails.trailerLicenseIssueDate = e.value[0] + '-' + e.value[1] + '-' + e
  852. .value[2]
  853. break
  854. }
  855. this.isShowValidity = false
  856. },
  857. // 车型切换
  858. changeCarModel(e) {
  859. const {
  860. columnIndex,
  861. index,
  862. // 微信小程序无法将picker实例传出来,只能通过ref操作
  863. picker = this.$refs.carTypePicker
  864. } = e
  865. if (columnIndex === 0) {
  866. // 模拟网络请求
  867. picker.setColumnValues(1, this.carModelColumnData[index])
  868. }
  869. },
  870. // 删除图片
  871. deletePic(event) {
  872. this[`fileList${event.name}`].splice(event.index, 1)
  873. },
  874. // 新增图片
  875. async afterRead(event, num) {
  876. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  877. let lists = [].concat(event.file)
  878. let fileListLen = this[`fileList${event.name}`].length
  879. lists.map((item) => {
  880. this[`fileList${event.name}`].push({
  881. ...item,
  882. status: 'uploading',
  883. message: '上传中'
  884. })
  885. })
  886. for (let i = 0; i < lists.length; i++) {
  887. const result = await this.uploadFilePromise(lists[i].url, num)
  888. let item = this[`fileList${event.name}`][fileListLen]
  889. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  890. status: 'success',
  891. message: '',
  892. url: result
  893. }))
  894. fileListLen++
  895. }
  896. },
  897. // 新增图片
  898. async afterRead1(event, num) {
  899. console.log(event)
  900. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  901. let lists = [].concat(event.file)
  902. let fileListLen = this[`fileList${event.name}`].length
  903. lists.map((item) => {
  904. this[`fileList${event.name}`].push({
  905. ...item,
  906. status: 'uploading',
  907. message: '上传中'
  908. })
  909. })
  910. for (let i = 0; i < lists.length; i++) {
  911. const result = await this.uploadFilePromise(lists[i].url, num)
  912. let item = this[`fileList${event.name}`][fileListLen]
  913. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  914. status: 'success',
  915. message: '',
  916. url: result
  917. }))
  918. fileListLen++
  919. }
  920. },
  921. uploadFilePromise(url, num) {
  922. uploadImage('image', url, 'appData/',
  923. result => {
  924. // 上传成功回调函数
  925. console.log('图片地址', result)
  926. if (num == 1) {
  927. if (!this.dataDetails.addressUrl) {
  928. this.dataDetails.addressUrl = result
  929. } else {
  930. this.dataDetails.addressUrl = this.dataDetails.addressUrl + ',' + result
  931. }
  932. } else if (num == 2) {
  933. if (!this.dataDetails.guaAddressUrl) {
  934. this.dataDetails.guaAddressUrl = result
  935. } else {
  936. this.dataDetails.guaAddressUrl = this.dataDetails.guaAddressUrl + ',' + result
  937. }
  938. }
  939. }
  940. )
  941. },
  942. //车牌号弹出键盘
  943. handleShowKeyboard(index) {
  944. if (this.dataDetails.carNumber == '') {
  945. this.carNumber = ''
  946. } else {
  947. this.carNumber = this.dataDetails.carNumber
  948. }
  949. if (this.$refs.keyboard.open) {
  950. this.$refs.keyboard.open(false) //true 键盘显示 false 键盘隐藏
  951. } else {
  952. this.$refs.keyboard[0].open(false)
  953. }
  954. this.index = index
  955. if (this.$refs.keyboard.open) {
  956. this.$refs.keyboard.open(true) //true 键盘显示 false 键盘隐藏
  957. } else {
  958. this.$refs.keyboard[0].open(true)
  959. }
  960. },
  961. //车牌号弹出键盘
  962. handleClick(e) {
  963. this.carNumber = e.value
  964. this.dataDetails.carNumber = e.value //键盘输入值
  965. },
  966. confirmColor(val) {
  967. this.dataDetails.carNumberColour = val.value[0]
  968. this.carColor = false
  969. },
  970. colorClose() {
  971. this.carColor = false
  972. },
  973. selectNoColor() {
  974. this.carColor = true
  975. },
  976. confirmCarModel(val) {
  977. this.sign = val.value[0]
  978. // this.dataDetails.carType = val.value[0] + ' ' + val.value[1]
  979. this.dataDetails.carCategory = val.value[0]
  980. this.dataDetails.carType = val.value[1]
  981. this.carModel = false
  982. },
  983. carModelClose() {
  984. this.carModel = false
  985. },
  986. selectCarModel() {
  987. this.carModel = true
  988. },
  989. selectNoColor() {
  990. this.carColor = true
  991. },
  992. unloadGroupPhoto() {
  993. uni.chooseImage({
  994. count: 1,
  995. success: function(res) {
  996. console.log(JSON.stringify(res.tempFilePaths));
  997. uploadImage('image', res.tempFilePaths[0], 'appData/',
  998. result => {
  999. // 上传成功
  1000. console.log('图片地址', result)
  1001. }
  1002. )
  1003. }
  1004. });
  1005. },
  1006. validate() {
  1007. // true 为校验不通过
  1008. if (uni.$u.test.isEmpty(this.dataDetails.carNumber)) {
  1009. this.$refs.uToast.show({
  1010. type: 'error',
  1011. message: "车牌号不能为空!",
  1012. })
  1013. return true
  1014. }
  1015. if (uni.$u.test.isEmpty(this.dataDetails.carTotalWeight) && this.sign == '非挂车') {
  1016. this.$refs.uToast.show({
  1017. type: 'error',
  1018. message: "总质量不能为空!",
  1019. })
  1020. return true
  1021. }
  1022. if (uni.$u.test.isEmpty(this.dataDetails.carApprovedWeight) && this.sign == '非挂车') {
  1023. this.$refs.uToast.show({
  1024. type: 'error',
  1025. message: "核定载质量不能为空!",
  1026. })
  1027. return true
  1028. }
  1029. if (uni.$u.test.isEmpty(this.dataDetails.carApprovedWeight)&& this.sign == '非挂车' && this.dataDetails.carApprovedWeight<500||
  1030. uni.$u.test.isEmpty(this.dataDetails.carApprovedWeight) && this.sign == '非挂车' && this.dataDetails.carApprovedWeight>60000) {
  1031. this.$refs.uToast.show({
  1032. type: 'error',
  1033. message: "核定载质量输入错误!",
  1034. })
  1035. return true
  1036. }
  1037. if (uni.$u.test.isEmpty(this.dataDetails.servicingWeight) && this.sign == '挂车') {
  1038. this.$refs.uToast.show({
  1039. type: 'error',
  1040. message: "整备质量不能为空!",
  1041. })
  1042. return true
  1043. }
  1044. if (uni.$u.test.isEmpty(this.dataDetails.owner)) {
  1045. this.$refs.uToast.show({
  1046. type: 'error',
  1047. message: "车辆所属车主不能为空!",
  1048. })
  1049. return true
  1050. }
  1051. if (uni.$u.test.isEmpty(this.dataDetails.carLong) && uni.$u.test.isEmpty(this.dataDetails.caWidth) && uni
  1052. .$u.test.isEmpty(this.dataDetails.carHeight)) {
  1053. this.$refs.uToast.show({
  1054. type: 'error',
  1055. message: "外廓尺寸不能为空!",
  1056. })
  1057. return true
  1058. }
  1059. if (uni.$u.test.isEmpty(this.dataDetails.operationCertificate)) {
  1060. this.$refs.uToast.show({
  1061. type: 'error',
  1062. message: "道路运输证不能为空!",
  1063. })
  1064. return true
  1065. }
  1066. if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateNumber)) {
  1067. this.$refs.uToast.show({
  1068. type: 'error',
  1069. message: "道路运输证号不能为空!",
  1070. })
  1071. return true
  1072. }
  1073. if (this.dataDetails.operationCertificateNumber.length!=12) {
  1074. this.$refs.uToast.show({
  1075. type: 'error',
  1076. message: "道路运输证号输入错误!",
  1077. })
  1078. return true
  1079. }
  1080. if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateValidityDate)) {
  1081. this.$refs.uToast.show({
  1082. type: 'error',
  1083. message: "道路运输证有效期不能为空!",
  1084. })
  1085. return true
  1086. }
  1087. if (this.sign == '挂车') {
  1088. if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
  1089. this.$refs.uToast.show({
  1090. type: 'error',
  1091. message: "挂车道路运输证不能为空!",
  1092. })
  1093. return true
  1094. }
  1095. if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
  1096. this.$refs.uToast.show({
  1097. type: 'error',
  1098. message: "挂车道路运输证号不能为空!",
  1099. })
  1100. return true
  1101. }
  1102. if (this.dataDetails.trailerOperationCertificateNumber.length!=12) {
  1103. this.$refs.uToast.show({
  1104. type: 'error',
  1105. message: "挂车道路运输证号输入错误!",
  1106. })
  1107. return true
  1108. }
  1109. if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
  1110. this.$refs.uToast.show({
  1111. type: 'error',
  1112. message: "挂车道路运输证有效期不能为空!",
  1113. })
  1114. return true
  1115. }
  1116. }
  1117. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseHomePage)) {
  1118. this.$refs.uToast.show({
  1119. type: 'error',
  1120. message: "行驶证主页不能为空!",
  1121. })
  1122. return true
  1123. }
  1124. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseBackPage)) {
  1125. this.$refs.uToast.show({
  1126. type: 'error',
  1127. message: "行驶证副页不能为空!",
  1128. })
  1129. return true
  1130. }
  1131. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseNumber)) {
  1132. this.$refs.uToast.show({
  1133. type: 'error',
  1134. message: "行驶证档案编号不能为空!",
  1135. })
  1136. return true
  1137. }
  1138. if (this.dataDetails.drivingLicenseNumber.length!=12) {
  1139. this.$refs.uToast.show({
  1140. type: 'error',
  1141. message: "行驶证档案编号输入错误!",
  1142. })
  1143. return true
  1144. }
  1145. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseRegistrationDate)) {
  1146. this.$refs.uToast.show({
  1147. type: 'error',
  1148. message: "行驶证注册日期不能为空!",
  1149. })
  1150. return true
  1151. }
  1152. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseIssueDate)) {
  1153. this.$refs.uToast.show({
  1154. type: 'error',
  1155. message: "行驶证发证日期不能为空!",
  1156. })
  1157. return true
  1158. }
  1159. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseValidityDate)) {
  1160. this.$refs.uToast.show({
  1161. type: 'error',
  1162. message: "行驶证有效期不能为空!",
  1163. })
  1164. return true
  1165. }
  1166. if (uni.$u.test.isEmpty(this.dataDetails.lssuingAuthority)) {
  1167. this.$refs.uToast.show({
  1168. type: 'error',
  1169. message: "行驶证发证机关不能为空!",
  1170. })
  1171. return true
  1172. }
  1173. if (this.dataDetails.lssuingAuthority.length<5||this.dataDetails.lssuingAuthority.length>25) {
  1174. this.$refs.uToast.show({
  1175. type: 'error',
  1176. message: "行驶证发证机关输入错误!",
  1177. })
  1178. return true
  1179. }
  1180. if (uni.$u.test.isEmpty(this.dataDetails.energyType)) {
  1181. this.$refs.uToast.show({
  1182. type: 'error',
  1183. message: "能源类型不能为空!",
  1184. })
  1185. return true
  1186. }
  1187. if (this.sign == '挂车') {
  1188. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
  1189. this.$refs.uToast.show({
  1190. type: 'error',
  1191. message: "挂车行驶证主页不能为空!",
  1192. })
  1193. return true
  1194. }
  1195. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  1196. this.$refs.uToast.show({
  1197. type: 'error',
  1198. message: "挂车行驶证副页不能为空!",
  1199. })
  1200. return true
  1201. }
  1202. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
  1203. this.$refs.uToast.show({
  1204. type: 'error',
  1205. message: "挂车行驶证档案编号不能为空!",
  1206. })
  1207. return true
  1208. }
  1209. if (this.dataDetails.trailerLicenseNumber.length!=12) {
  1210. this.$refs.uToast.show({
  1211. type: 'error',
  1212. message: "挂车行驶证档案编号输入错误!",
  1213. })
  1214. return true
  1215. }
  1216. if (uni.$u.test.isEmpty(this.dataDetails.guaCarNumber)) {
  1217. this.$refs.uToast.show({
  1218. type: 'error',
  1219. message: "挂车车牌号不能为空!",
  1220. })
  1221. return true
  1222. }
  1223. if (uni.$u.test.isEmpty(this.dataDetails.guaOwner)) {
  1224. this.$refs.uToast.show({
  1225. type: 'error',
  1226. message: "车辆所属车主不能为空!",
  1227. })
  1228. return true
  1229. }
  1230. if (uni.$u.test.isEmpty(this.dataDetails.guaServicingWeight)) {
  1231. this.$refs.uToast.show({
  1232. type: 'error',
  1233. message: "挂车整备质量不能为空!",
  1234. })
  1235. return true
  1236. }
  1237. if (uni.$u.test.isEmpty(this.dataDetails.guaCarApprovedWeight)) {
  1238. this.$refs.uToast.show({
  1239. type: 'error',
  1240. message: "挂车核定载质量不能为空!",
  1241. })
  1242. return true
  1243. }
  1244. if (this.dataDetails.guaCarApprovedWeight<500||this.dataDetails.guaCarApprovedWeight>60000) {
  1245. this.$refs.uToast.show({
  1246. type: 'error',
  1247. message: "挂车核定载质量输入错误!",
  1248. })
  1249. return true
  1250. }
  1251. if (uni.$u.test.isEmpty(this.dataDetails.guaCarLong) || uni.$u.test.isEmpty(this.dataDetails.guaCarWidth) || uni.$u.test.isEmpty(this.dataDetails.guaCarHeight)) {
  1252. this.$refs.uToast.show({
  1253. type: 'error',
  1254. message: "挂车外廓尺寸不能为空!",
  1255. })
  1256. return true
  1257. }
  1258. // if (this.dataDetails.fileList2.length == 0) {
  1259. // this.$refs.uToast.show({
  1260. // type: 'error',
  1261. // message: "人和挂车合影不能为空!",
  1262. // })
  1263. // return true
  1264. // }
  1265. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseRegistrationDate)) {
  1266. this.$refs.uToast.show({
  1267. type: 'error',
  1268. message: "挂车行驶证注册日期不能为空!",
  1269. })
  1270. return true
  1271. }
  1272. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseIssueDate)) {
  1273. this.$refs.uToast.show({
  1274. type: 'error',
  1275. message: "挂车行驶证发证日期不能为空!!",
  1276. })
  1277. return true
  1278. }
  1279. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
  1280. this.$refs.uToast.show({
  1281. type: 'error',
  1282. message: "挂车行驶证有效期不能为空!",
  1283. })
  1284. return true
  1285. }
  1286. if (uni.$u.test.isEmpty(this.dataDetails.guaLssuingAuthority)) {
  1287. this.$refs.uToast.show({
  1288. type: 'error',
  1289. message: "挂车行驶证发证机关不能为空!",
  1290. })
  1291. return true
  1292. }
  1293. if (this.dataDetails.guaLssuingAuthority.length<5||this.dataDetails.guaLssuingAuthority.length>25) {
  1294. this.$refs.uToast.show({
  1295. type: 'error',
  1296. message: "挂车行驶证发证机关输入错误!",
  1297. })
  1298. return true
  1299. }
  1300. }
  1301. return false
  1302. },
  1303. submit() {
  1304. if (this.validate()) return
  1305. if(this.dataDetails.carCategory == "挂车"){
  1306. if(this.dataDetails.guaCarNumber.indexOf('挂')==-1){
  1307. this.dataDetails.guaCarNumber=this.dataDetails.guaCarNumber+'挂'
  1308. }
  1309. }
  1310. this.$request.baseRequest('post', '/driverCarInfo/api/editInfo', this.dataDetails).then(res => {
  1311. if (res.code == '200') {
  1312. this.$refs.uToast.show({
  1313. type: 'success',
  1314. message: "提交成功!",
  1315. complete() {
  1316. uni.navigateBack({
  1317. delta: 1
  1318. });
  1319. // uni.$u.route('/pages/mine/manageVehicles/index');
  1320. }
  1321. })
  1322. // this.$refs.uToast.show({
  1323. // ...params
  1324. // })
  1325. // uni.$u.route('/pages/mine/manageVehicles/index');
  1326. } else {
  1327. uni.$u.toast(res.message);
  1328. }
  1329. })
  1330. .catch(res => {
  1331. uni.$u.toast(res.message);
  1332. });
  1333. },
  1334. },
  1335. }
  1336. </script>
  1337. <style lang="scss" scoped>
  1338. .container {
  1339. margin: 20rpx;
  1340. background: white;
  1341. padding: 0 20rpx;
  1342. border-radius: 20rpx;
  1343. padding-bottom: 200rpx;
  1344. .left-text {
  1345. // background: red;
  1346. width: 290rpx;
  1347. color: #333333;
  1348. display: flex;
  1349. align-items: center;
  1350. }
  1351. .row {
  1352. border-bottom: 1px solid #EEEEEE;
  1353. padding-bottom: 28rpx;
  1354. margin-top: 26rpx;
  1355. .ch-style {}
  1356. }
  1357. .row-ch {
  1358. padding-right: 250rpx;
  1359. box-sizing: border-box;
  1360. }
  1361. .row {
  1362. border-bottom: 1px solid #EEEEEE;
  1363. padding-bottom: 28rpx;
  1364. margin-top: 26rpx;
  1365. }
  1366. .left-text {
  1367. // background: red;
  1368. width: 320rpx;
  1369. color: #333333;
  1370. display: flex;
  1371. align-items: center;
  1372. }
  1373. .picture {
  1374. position: relative;
  1375. width: 100%;
  1376. height: 440rpx;
  1377. display: flex;
  1378. justify-content: center;
  1379. flex-direction: column;
  1380. align-items: center;
  1381. .text {
  1382. margin-top: 20rpx;
  1383. }
  1384. }
  1385. .picture1 {
  1386. background: url(../../../static/images/mine/jzz.png);
  1387. background-size: 100% 100%;
  1388. }
  1389. .picture2 {
  1390. background: url(../../../static/images/mine/jzf.png);
  1391. background-size: 100% 100%;
  1392. }
  1393. .picture3 {
  1394. background: url(../../../static/images/mine/xsz.png);
  1395. background-size: 100% 100%;
  1396. }
  1397. .picture4 {
  1398. background: url(../../../static/images/mine/xsf.png);
  1399. background-size: 100% 100%;
  1400. }
  1401. .picture5 {
  1402. background: url(../../../static/images/mine/gcxsz.png);
  1403. background-size: 100% 100%;
  1404. }
  1405. .picture6 {
  1406. background: url(../../../static/images/mine/gcxsf.png);
  1407. background-size: 100% 100%;
  1408. }
  1409. .picture7 {
  1410. background: url(../../../static/images/mine/cy.png);
  1411. background-size: 100% 100%;
  1412. }
  1413. .picture8 {
  1414. background: url(../../../static/images/mine/cy.png);
  1415. background-size: 100% 100%;
  1416. }
  1417. .picture9 {
  1418. background: url(../../../static/images/mine/cy.png);
  1419. background-size: 100% 100%;
  1420. }
  1421. .xj-image {
  1422. width: 100rpx;
  1423. height: 100rpx;
  1424. }
  1425. .title {
  1426. color: #999999;
  1427. margin: 20rpx 0;
  1428. }
  1429. }
  1430. .input-ckg {
  1431. height: 86rpx;
  1432. margin-top: 0 !important;
  1433. padding-bottom: 0 !important;
  1434. .u-input {
  1435. height: 100%;
  1436. background: #F7F8FA;
  1437. padding-left: 10rpx !important;
  1438. padding-right: 85rpx !important;
  1439. }
  1440. .star {
  1441. display: flex;
  1442. align-items: center;
  1443. margin: 0 10rpx;
  1444. }
  1445. .input-positon {
  1446. position: relative;
  1447. }
  1448. .position-right {
  1449. position: absolute;
  1450. right: 20rpx;
  1451. top: 0;
  1452. width: 60rpx;
  1453. height: 50rpx;
  1454. bottom: 0;
  1455. margin: auto;
  1456. }
  1457. }
  1458. .picture {
  1459. margin-top: 20rpx;
  1460. background: #F5F6FA;
  1461. width: 212rpx;
  1462. height: 212rpx;
  1463. border-radius: 10rpx;
  1464. display: flex;
  1465. flex-direction: column;
  1466. justify-content: center;
  1467. align-items: center;
  1468. color: #6A7282;
  1469. }
  1470. .submit-btn-wrap{
  1471. position: fixed;
  1472. bottom:0;left:0;
  1473. width:100%;
  1474. padding:40rpx 0;
  1475. background:#fff;
  1476. z-index:1000;
  1477. }
  1478. .submit-btn {
  1479. bottom: 40rpx;
  1480. width: 90%;
  1481. background: #2772FB;
  1482. color: white;
  1483. text-align: center;
  1484. margin:0 auto;
  1485. padding: 30rpx 0;
  1486. border-radius: 50rpx;
  1487. }
  1488. .del-card {
  1489. position: absolute;
  1490. top: -10rpx;
  1491. right: -6rpx;
  1492. width: 80rpx;
  1493. height: 80rpx;
  1494. z-index: 9;
  1495. }
  1496. /deep/.uni-input-input:disabled{
  1497. background:#fff;
  1498. }
  1499. .car-uumber{
  1500. text-align:right;
  1501. }
  1502. </style>