editVehicle.vue 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618
  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 class="left-text">挂车行驶证档案编号</view>
  164. <u--input maxlength='12' 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" type='number' 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="宽" type='number' 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="高" type='number' 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.guaCarNumber1'
  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 style='width:180px' 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" type='number' 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="宽" type='number' 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="高" type='number' 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. <itmister-date-picker :checkYear="year" :checkMonth="month" :checkDay="day" :overdueContent="overdueContent" :dateStatus="0" :periodOfValidity="true" ref="dateEl" :startYear="1999" :futureYear="6" @dateConfirm="confirmValidityPeriod"></itmister-date-picker>
  361. <itmister-date-picker :checkYear="year" :checkMonth="month" :checkDay="day" :overdueContent="overdueContent" :dateStatus="1" :periodOfValidity="true" ref="dateXSZEl" :startYear="1999" :futureYear="10" @dateConfirm="confirmValidityPeriod"></itmister-date-picker>
  362. <itmister-date-picker :checkYear="year" :checkMonth="month" :checkDay="day" :dateStatus="0" ref="daterestsEl" :startYear="startYear" :futureYear="0" @dateConfirm="confirmValidityPeriod"></itmister-date-picker>
  363. <u-picker :show="isShowCarType" ref="uPicker" :columns="carTypeList" @confirm="confirmCarType"
  364. :closeOnClickOverlay='true' @close='isShowCarType=false' @cancel='isShowCarType=false'>
  365. </u-picker>
  366. </view>
  367. </template>
  368. <script>
  369. import permision from "@/js_sdk/wa-permission/permission.js";
  370. import uploadImage from '@/components/ossutil/uploadFile.js';
  371. import keyboard from "@/components/master-keyboard/master-keyboard.vue";
  372. var _this;
  373. import {
  374. mapState
  375. } from 'vuex';
  376. export default {
  377. data() {
  378. return {
  379. index: '',
  380. keyShow: false,
  381. keyShow1: false,
  382. carNumber: '',
  383. carNumber1: "",
  384. overdueContent:'',
  385. year:'',
  386. month:'',
  387. day:'',
  388. dataDetails: {
  389. // driverId: '',
  390. // carNumber: '',
  391. carNumberColour: '黄色',
  392. carCategory: '挂车',
  393. carType: '高栏',
  394. // carTotalWeight: '',
  395. // carApprovedWeight: '',
  396. // carLong: '',
  397. // carWidth: '',
  398. // carHeight: '',
  399. // addressUrl: ''
  400. },
  401. carTypeList: [
  402. ["汽油", "柴油", "油电混合", "纯电动", "插电式混合动力", "增程式"]
  403. ],
  404. isShowCarType: false,
  405. carModelColumns: [
  406. ['挂车', '非挂车'],
  407. ['高栏', '集装箱', '自卸车']
  408. ],
  409. carModelColumnData: [
  410. ['高栏', '集装箱', '自卸车'],
  411. ['重型仓栏']
  412. ],
  413. colorColumns: [
  414. ['黄色', '蓝色']
  415. ],
  416. carColor: false,
  417. carModel: false,
  418. fileList1: [],
  419. fileList2: [],
  420. ValidityPeriodType: "",
  421. validityPeriod: [],
  422. isShowValidity: false,
  423. uploadType: '',
  424. isShowimgType: false,
  425. sign: "挂车",
  426. startYear:1980
  427. };
  428. },
  429. computed: {
  430. ...mapState(['hasLogin', 'userInfo', 'firstAuthentication']),
  431. },
  432. onLoad(options) {
  433. _this = this;
  434. console.log(options)
  435. if(options.guaCarNumber){
  436. options.guaCarNumber=options.guaCarNumber.substring(0,6);
  437. options.guaCarNumber1=options.guaCarNumber.substring(0,6);
  438. }
  439. this.dataDetails = options
  440. this.sign = options.carCategory
  441. // if (this.dataDetails.carType.indexOf("挂车") != -1) {
  442. // this.sign = "挂车"
  443. // } else {
  444. // this.sign = "非挂车"
  445. // }
  446. this.fileList1 = [{
  447. url: options.addressUrl
  448. }]
  449. this.fileList2 = [{
  450. url: options.guaAddressUrl
  451. }]
  452. this.get_camera_permission()
  453. },
  454. onShow(){
  455. this.startYear=new Date().getFullYear()-30
  456. },
  457. methods: {
  458. async get_camera_permission() {
  459. var photol=await permision.requestAndroidPermission("android.permission.CAMERA")
  460. if(photol == false){
  461. uni.showModal({
  462. title: '提示',
  463. content: '您已经关闭相册权限,去设置',
  464. success: function (res) {
  465. if (res.confirm) {
  466. permision.gotoAppPermissionSetting()
  467. // plus.runtime.openURL("app-settings:");
  468. } else if (res.cancel) {
  469. console.log('用户点击取消');
  470. }
  471. }
  472. });
  473. }
  474. },
  475. driveType() {
  476. this.isShowCarType = true
  477. },
  478. hidden(){
  479. this.$refs.keyboard.open(false)
  480. this.$refs.keyboard1.open(false)
  481. },
  482. confirmCarType(e) {
  483. this.dataDetails.energyType = e.value[0]
  484. this.isShowCarType = false
  485. },
  486. //挂车牌号弹出键盘
  487. handleShowKeyboard1(index) {
  488. if (this.dataDetails.guaCarNumber == '') {
  489. this.carNumber1 = ''
  490. } else {
  491. this.carNumber1 = this.dataDetails.guaCarNumber
  492. }
  493. if (this.$refs.keyboard1.open) {
  494. this.$refs.keyboard1.open(false) //true 键盘显示 false 键盘隐藏
  495. } else {
  496. this.$refs.keyboard1[0].open(false)
  497. }
  498. this.index = index
  499. if (this.$refs.keyboard1.open) {
  500. this.$refs.keyboard1.open(true) //true 键盘显示 false 键盘隐藏
  501. } else {
  502. this.$refs.keyboard1[0].open(true)
  503. }
  504. },
  505. handleClick1(e) {
  506. this.carNumber1 = e.value
  507. this.dataDetails.guaCarNumber = e.value //键盘输入值
  508. },
  509. delCard(type) {
  510. switch (type) {
  511. case 1:
  512. _this.dataDetails.operationCertificate = "" //道路运输证
  513. break;
  514. case 2:
  515. _this.dataDetails.trailerOperationCertificate = "" //挂车道路运输证
  516. break;
  517. case 3:
  518. _this.dataDetails.drivingLicenseHomePage = "" //牵引车行驶证
  519. break;
  520. case 4:
  521. _this.dataDetails.drivingLicenseBackPage = "" //牵引车行驶证副页
  522. break;
  523. case 5:
  524. _this.dataDetails.trailerLicenseHomePage = "" //挂车行驶证
  525. break;
  526. case 6:
  527. _this.dataDetails.trailerLicenseBackPage = ""//挂车行驶证副页
  528. break;
  529. }
  530. this.$forceUpdate()
  531. },
  532. uploadImg(type) {
  533. this.uploadType = type
  534. this.imgTypeSelect()
  535. // this.isShowimgType = true
  536. },
  537. selectValidityPeriod(type) {
  538. this.ValidityPeriodType = type
  539. var arr=[]
  540. switch (this.ValidityPeriodType) {
  541. case 1:
  542. if(this.dataDetails.drivingLicenseValidityDate!='长期'){
  543. arr=this.dataDetails.drivingLicenseValidityDate.split('-')
  544. this.year=arr[0]
  545. this.month=arr[1]
  546. this.day=arr[2]
  547. }else{
  548. this.year='长期'
  549. this.month=''
  550. this.day=''
  551. }
  552. this.overdueContent='行驶证已过期'
  553. this.$refs.dateXSZEl.show()
  554. break;
  555. case 2:
  556. if(this.dataDetails.trailerLicenseValidityDate!='长期'){
  557. arr=this.dataDetails.trailerLicenseValidityDate.split('-')
  558. this.year=arr[0]
  559. this.month=arr[1]
  560. this.day=arr[2]
  561. }else{
  562. this.year='长期'
  563. this.month=''
  564. this.day=''
  565. }
  566. this.overdueContent='挂车行驶证已过期'
  567. this.$refs.dateXSZEl.show()
  568. break;
  569. case 4:
  570. if(this.dataDetails.operationCertificateValidityDate){
  571. arr=this.dataDetails.operationCertificateValidityDate.split('-')
  572. this.year=arr[0]
  573. this.month=arr[1]
  574. this.day=arr[2]
  575. }
  576. this.overdueContent='道路运输证已过期'
  577. this.$refs.dateEl.show()
  578. break;
  579. case 5:
  580. if(this.dataDetails.trailerOperationCertificateValidityDate){
  581. arr=this.dataDetails.trailerOperationCertificateValidityDate.split('-')
  582. this.year=arr[0]
  583. this.month=arr[1]
  584. this.day=arr[2]
  585. }
  586. this.overdueContent='挂车道路运输证已过期'
  587. this.$refs.dateEl.show()
  588. break;
  589. case 6:
  590. if(this.dataDetails.drivingLicenseRegistrationDate){
  591. arr=this.dataDetails.drivingLicenseRegistrationDate.split('-')
  592. this.year=arr[0]
  593. this.month=arr[1]
  594. this.day=arr[2]
  595. }
  596. this.$refs.daterestsEl.show()
  597. break;
  598. case 7:
  599. if(this.dataDetails.drivingLicenseIssueDate){
  600. arr=this.dataDetails.drivingLicenseIssueDate.split('-')
  601. this.year=arr[0]
  602. this.month=arr[1]
  603. this.day=arr[2]
  604. }
  605. this.$refs.daterestsEl.show()
  606. break;
  607. case 8:
  608. if(this.dataDetails.trailerLicenseRegistrationDate){
  609. arr=this.dataDetails.trailerLicenseRegistrationDate.split('-')
  610. this.year=arr[0]
  611. this.month=arr[1]
  612. this.day=arr[2]
  613. }
  614. this.$refs.daterestsEl.show()
  615. break;
  616. case 9:
  617. if(this.dataDetails.trailerLicenseIssueDate){
  618. arr=this.dataDetails.trailerLicenseIssueDate.split('-')
  619. this.year=arr[0]
  620. this.month=arr[1]
  621. this.day=arr[2]
  622. }
  623. this.$refs.daterestsEl.show()
  624. break;
  625. }
  626. },
  627. // 上传图片
  628. imgTypeSelect(val) {
  629. uni.chooseImage({
  630. count: 1,
  631. // sourceType: this.$helper.chooseImage.sourceType,
  632. success: function(res) {
  633. console.log(JSON.stringify(res.tempFilePaths));
  634. uploadImage("images", res.tempFilePaths[0], 'appData/',
  635. result => {
  636. // 上传成功回调函数
  637. console.log('图片地址-----', result)
  638. switch (_this.uploadType) {
  639. case 1:
  640. _this.dataDetails.driverLicenseHomePage = result
  641. break;
  642. case 2:
  643. _this.dataDetails.driverLicenseBackPage = result
  644. break;
  645. case 3:
  646. _this.dataDetails.drivingLicenseHomePage = result
  647. _this.$request.baseRequest('get',
  648. '/driverCarInfo/api/driveringLicenseShibie', {
  649. image: result,
  650. flag: 1
  651. }).then(res => {
  652. if (res.data) {
  653. _this.dataDetails.carNumber = res.data
  654. .carNum //车牌号
  655. _this.dataDetails.owner = res.data
  656. .owner //车辆所有人
  657. _this.$forceUpdate()
  658. }
  659. })
  660. .catch(res => {
  661. uni.$u.toast(res.message);
  662. });
  663. break;
  664. case 4:
  665. _this.dataDetails.drivingLicenseBackPage = result
  666. _this.$request.baseRequest('get',
  667. '/driverCarInfo/api/driveringLicenseShibie', {
  668. image: result,
  669. flag: 2
  670. }).then(res => {
  671. if (res.data) {
  672. if (res.data.issuingAuthority) { //行驶证发证机关
  673. _this.dataDetails.lssuingAuthority = res
  674. .data.issuingAuthority
  675. }
  676. if (res.data
  677. .licenseRegistrationDate) { //行驶证注册日期
  678. _this.dataDetails
  679. .drivingLicenseRegistrationDate = res
  680. .data.licenseRegistrationDate
  681. }
  682. if (res.data.licenseIssueDate) { //行驶证发证日期
  683. _this.dataDetails.drivingLicenseIssueDate =
  684. res.data.licenseIssueDate
  685. }
  686. _this.dataDetails.drivingLicenseValidityDate =
  687. res.data.driveringEndDate //行驶证有效期
  688. _this.dataDetails.drivingLicenseNumber = res
  689. .data.driveringNum //行驶证档案编号
  690. if (_this.sign == "非挂车") {
  691. if (res.data.servicingMass && res.data
  692. .servicingMass.indexOf("kg") != -1) {
  693. res.data.servicingMass = res.data
  694. .servicingMass.slice(0, res.data
  695. .servicingMass.length - 2)
  696. }
  697. _this.dataDetails.carTotalWeight = res.data
  698. .servicingMass //总质量
  699. }
  700. if (res.data.approvedLoadMass.indexOf("kg") !=
  701. -1) {
  702. res.data.approvedLoadMass = res.data
  703. .approvedLoadMass.slice(0, res.data
  704. .approvedLoadMass.length - 2)
  705. }
  706. _this.dataDetails.carApprovedWeight = res.data
  707. .approvedLoadMass //核定载质量
  708. if (res.data.size && res.data.size.indexOf(
  709. "mm") != -1) {
  710. res.data.size = res.data.size.slice(0, res
  711. .data.size.length - 2);
  712. }
  713. _this.dataDetails.carLong = res.data.size
  714. .split("X")[0] //车长
  715. _this.dataDetails.carWidth = res.data.size
  716. .split("X")[1] //车宽
  717. _this.dataDetails.carHeight = res.data.size
  718. .split("X")[2] //车高
  719. _this.$forceUpdate()
  720. }
  721. })
  722. .catch(res => {
  723. uni.$u.toast(res.message);
  724. });
  725. break;
  726. case 5: //挂车行驶证
  727. _this.dataDetails.trailerLicenseHomePage = result
  728. _this.$request.baseRequest('get',
  729. '/driverCarInfo/api/driveringLicenseShibie', {
  730. image: result,
  731. flag: 1
  732. }).then(res => {
  733. if (res.data) {
  734. if (res.data.issuingAuthority) { //行驶证发证机关
  735. _this.dataDetails.guaLssuingAuthority = res
  736. .data.issuingAuthority
  737. }
  738. if (res.data.licenseRegistrationDate) { //行驶证注册日期
  739. _this.dataDetails
  740. .trailerLicenseRegistrationDate = res.data
  741. .licenseRegistrationDate
  742. }
  743. if (res.data.licenseIssueDate) { //行驶证发证日期
  744. _this.dataDetails.trailerLicenseIssueDate = res
  745. .data.licenseIssueDate
  746. }
  747. _this.dataDetails.guaCarNumber = res.data
  748. .carNum //车牌号
  749. _this.dataDetails.guaOwner = res.data
  750. .owner //车辆所有人
  751. _this.$forceUpdate()
  752. }
  753. })
  754. .catch(res => {
  755. uni.$u.toast(res.message);
  756. });
  757. break;
  758. case 6:
  759. _this.dataDetails.trailerLicenseBackPage = result
  760. _this.$request.baseRequest('get',
  761. '/driverCarInfo/api/driveringLicenseShibie', {
  762. image: result,
  763. flag: 2
  764. }).then(res => {
  765. if (res.data) {
  766. _this.dataDetails.trailerLicenseValidityDate =
  767. res.data.driveringEndDate //挂车行驶证有效期
  768. _this.dataDetails.trailerLicenseNumber = res
  769. .data.driveringNum //挂车行驶证档案编号
  770. if (res.data.servicingMass && res.data
  771. .servicingMass.indexOf("kg") != -1) {
  772. res.data.servicingMass = res.data
  773. .servicingMass.slice(0, res.data
  774. .servicingMass.length - 2)
  775. }
  776. if (res.data.approvedLoadMass.indexOf("kg") !=
  777. -1) {
  778. res.data.approvedLoadMass = res.data
  779. .approvedLoadMass.slice(0, res.data
  780. .approvedLoadMass.length - 2)
  781. }
  782. _this.dataDetails.guaServicingWeight = res.data
  783. .servicingMass //总质量
  784. _this.dataDetails.guaCarApprovedWeight = res
  785. .data.approvedLoadMass //核定载质量
  786. if (res.data.size && res.data.size.indexOf(
  787. "mm") != -1) {
  788. res.data.size = res.data.size.slice(0, res
  789. .data.size.length - 2);
  790. }
  791. _this.dataDetails.guaCarLong = res.data.size
  792. .split("X")[0] //车长
  793. _this.dataDetails.guaCarWidth = res.data.size
  794. .split("X")[1] //车宽
  795. _this.dataDetails.guaCarHeight = res.data.size
  796. .split("X")[2] //车高
  797. _this.$forceUpdate()
  798. }
  799. })
  800. .catch(res => {
  801. uni.$u.toast(res.message);
  802. });
  803. break;
  804. case 7:
  805. _this.dataDetails.qualificationCertificate = result
  806. break;
  807. case 8:
  808. _this.dataDetails.operationCertificate = result
  809. _this.$request.baseRequest('get',
  810. '/driverCarInfo/api/tranLicenseShibie', {
  811. image: result
  812. }).then(res => {
  813. if (res.data) {
  814. _this.dataDetails.operationCertificateNumber =
  815. res.data.tranNumber
  816. _this.dataDetails
  817. .operationCertificateValidityDate = res
  818. .data.tranEndDate
  819. _this.$forceUpdate()
  820. }
  821. })
  822. .catch(res => {
  823. uni.$u.toast(res.message);
  824. });
  825. break;
  826. case 9:
  827. _this.dataDetails.trailerOperationCertificate = result
  828. _this.$request.baseRequest('get',
  829. '/driverCarInfo/api/tranLicenseShibie', {
  830. image: result
  831. }).then(res => {
  832. if (res.data) {
  833. _this.dataDetails
  834. .trailerOperationCertificateNumber = res
  835. .data.tranNumber
  836. _this.dataDetails
  837. .trailerOperationCertificateValidityDate =
  838. res.data.tranEndDate
  839. _this.$forceUpdate()
  840. }
  841. })
  842. .catch(res => {
  843. uni.$u.toast(res.message);
  844. });
  845. break;
  846. }
  847. _this.$forceUpdate()
  848. }
  849. )
  850. }
  851. });
  852. },
  853. confirmValidityPeriod(date) {
  854. switch (this.ValidityPeriodType) {
  855. case 0:
  856. this.dataDetails.driverLicenseValidityDate = date.date
  857. break
  858. case 1:
  859. this.dataDetails.drivingLicenseValidityDate = date.date
  860. break
  861. case 2:
  862. this.dataDetails.trailerLicenseValidityDate = date.date
  863. break
  864. case 3:
  865. this.dataDetails.qualificationCertificateValidityDate = date.date
  866. break
  867. case 4:
  868. this.dataDetails.operationCertificateValidityDate = date.date
  869. break
  870. case 5:
  871. this.dataDetails.trailerOperationCertificateValidityDate = date.date
  872. break
  873. case 6: //行驶证注册日期
  874. this.dataDetails.drivingLicenseRegistrationDate = date.date
  875. break
  876. case 7: //行驶证发证日期
  877. this.dataDetails.drivingLicenseIssueDate = date.date
  878. break
  879. case 8: //挂车行驶证注册日期
  880. this.dataDetails.trailerLicenseRegistrationDate = date.date
  881. break
  882. case 9: //挂车行驶证发证日期
  883. this.dataDetails.trailerLicenseIssueDate = date.date
  884. break
  885. }
  886. },
  887. // 车型切换
  888. changeCarModel(e) {
  889. const {
  890. columnIndex,
  891. index,
  892. // 微信小程序无法将picker实例传出来,只能通过ref操作
  893. picker = this.$refs.carTypePicker
  894. } = e
  895. if (columnIndex === 0) {
  896. // 模拟网络请求
  897. picker.setColumnValues(1, this.carModelColumnData[index])
  898. }
  899. },
  900. // 删除图片
  901. deletePic(event) {
  902. this[`fileList${event.name}`].splice(event.index, 1)
  903. },
  904. // 新增图片
  905. async afterRead(event, num) {
  906. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  907. let lists = [].concat(event.file)
  908. let fileListLen = this[`fileList${event.name}`].length
  909. lists.map((item) => {
  910. this[`fileList${event.name}`].push({
  911. ...item,
  912. status: 'uploading',
  913. message: '上传中'
  914. })
  915. })
  916. for (let i = 0; i < lists.length; i++) {
  917. const result = await this.uploadFilePromise(lists[i].url, num)
  918. let item = this[`fileList${event.name}`][fileListLen]
  919. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  920. status: 'success',
  921. message: '',
  922. url: result
  923. }))
  924. fileListLen++
  925. }
  926. },
  927. // 新增图片
  928. async afterRead1(event, num) {
  929. console.log(event)
  930. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  931. let lists = [].concat(event.file)
  932. let fileListLen = this[`fileList${event.name}`].length
  933. lists.map((item) => {
  934. this[`fileList${event.name}`].push({
  935. ...item,
  936. status: 'uploading',
  937. message: '上传中'
  938. })
  939. })
  940. for (let i = 0; i < lists.length; i++) {
  941. const result = await this.uploadFilePromise(lists[i].url, num)
  942. let item = this[`fileList${event.name}`][fileListLen]
  943. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  944. status: 'success',
  945. message: '',
  946. url: result
  947. }))
  948. fileListLen++
  949. }
  950. },
  951. uploadFilePromise(url, num) {
  952. uploadImage('image', url, 'appData/',
  953. result => {
  954. // 上传成功回调函数
  955. console.log('图片地址', result)
  956. if (num == 1) {
  957. if (!this.dataDetails.addressUrl) {
  958. this.dataDetails.addressUrl = result
  959. } else {
  960. this.dataDetails.addressUrl = this.dataDetails.addressUrl + ',' + result
  961. }
  962. } else if (num == 2) {
  963. if (!this.dataDetails.guaAddressUrl) {
  964. this.dataDetails.guaAddressUrl = result
  965. } else {
  966. this.dataDetails.guaAddressUrl = this.dataDetails.guaAddressUrl + ',' + result
  967. }
  968. }
  969. }
  970. )
  971. },
  972. //车牌号弹出键盘
  973. handleShowKeyboard(index) {
  974. if (this.dataDetails.carNumber == '') {
  975. this.carNumber = ''
  976. } else {
  977. this.carNumber = this.dataDetails.carNumber
  978. }
  979. if (this.$refs.keyboard.open) {
  980. this.$refs.keyboard.open(false) //true 键盘显示 false 键盘隐藏
  981. } else {
  982. this.$refs.keyboard[0].open(false)
  983. }
  984. this.index = index
  985. if (this.$refs.keyboard.open) {
  986. this.$refs.keyboard.open(true) //true 键盘显示 false 键盘隐藏
  987. } else {
  988. this.$refs.keyboard[0].open(true)
  989. }
  990. },
  991. //车牌号弹出键盘
  992. handleClick(e) {
  993. this.carNumber = e.value
  994. this.dataDetails.carNumber = e.value //键盘输入值
  995. },
  996. confirmColor(val) {
  997. this.dataDetails.carNumberColour = val.value[0]
  998. this.carColor = false
  999. },
  1000. colorClose() {
  1001. this.carColor = false
  1002. },
  1003. selectNoColor() {
  1004. this.carColor = true
  1005. },
  1006. confirmCarModel(val) {
  1007. this.sign = val.value[0]
  1008. // this.dataDetails.carType = val.value[0] + ' ' + val.value[1]
  1009. this.dataDetails.carCategory = val.value[0]
  1010. this.dataDetails.carType = val.value[1]
  1011. this.carModel = false
  1012. },
  1013. carModelClose() {
  1014. this.carModel = false
  1015. },
  1016. selectCarModel() {
  1017. this.carModel = true
  1018. },
  1019. selectNoColor() {
  1020. this.carColor = true
  1021. },
  1022. unloadGroupPhoto() {
  1023. uni.chooseImage({
  1024. count: 1,
  1025. success: function(res) {
  1026. console.log(JSON.stringify(res.tempFilePaths));
  1027. uploadImage('image', res.tempFilePaths[0], 'appData/',
  1028. result => {
  1029. // 上传成功
  1030. console.log('图片地址', result)
  1031. }
  1032. )
  1033. }
  1034. });
  1035. },
  1036. validate() {
  1037. // true 为校验不通过
  1038. if (uni.$u.test.isEmpty(this.dataDetails.carNumber)) {
  1039. this.$refs.uToast.show({
  1040. type: 'error',
  1041. message: "车牌号不能为空!",
  1042. })
  1043. return true
  1044. }
  1045. if (uni.$u.test.isEmpty(this.dataDetails.carTotalWeight) && this.sign == '非挂车') {
  1046. this.$refs.uToast.show({
  1047. type: 'error',
  1048. message: "总质量不能为空!",
  1049. })
  1050. return true
  1051. }
  1052. if (uni.$u.test.isEmpty(this.dataDetails.carApprovedWeight) && this.sign == '非挂车') {
  1053. this.$refs.uToast.show({
  1054. type: 'error',
  1055. message: "核定载质量不能为空!",
  1056. })
  1057. return true
  1058. }
  1059. if (uni.$u.test.isEmpty(this.dataDetails.carApprovedWeight)&& this.sign == '非挂车' && this.dataDetails.carApprovedWeight<500||
  1060. uni.$u.test.isEmpty(this.dataDetails.carApprovedWeight) && this.sign == '非挂车' && this.dataDetails.carApprovedWeight>60000) {
  1061. this.$refs.uToast.show({
  1062. type: 'error',
  1063. message: "核定载质量输入错误!",
  1064. })
  1065. return true
  1066. }
  1067. if (uni.$u.test.isEmpty(this.dataDetails.servicingWeight) && this.sign == '挂车') {
  1068. this.$refs.uToast.show({
  1069. type: 'error',
  1070. message: "整备质量不能为空!",
  1071. })
  1072. return true
  1073. }
  1074. if (uni.$u.test.isEmpty(this.dataDetails.owner)) {
  1075. this.$refs.uToast.show({
  1076. type: 'error',
  1077. message: "车辆所属车主不能为空!",
  1078. })
  1079. return true
  1080. }
  1081. if (uni.$u.test.isEmpty(this.dataDetails.carLong) && uni.$u.test.isEmpty(this.dataDetails.caWidth) && uni
  1082. .$u.test.isEmpty(this.dataDetails.carHeight)) {
  1083. this.$refs.uToast.show({
  1084. type: 'error',
  1085. message: "外廓尺寸不能为空!",
  1086. })
  1087. return true
  1088. }
  1089. if (uni.$u.test.isEmpty(this.dataDetails.operationCertificate)) {
  1090. this.$refs.uToast.show({
  1091. type: 'error',
  1092. message: "道路运输证不能为空!",
  1093. })
  1094. return true
  1095. }
  1096. if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateNumber)) {
  1097. this.$refs.uToast.show({
  1098. type: 'error',
  1099. message: "道路运输证号不能为空!",
  1100. })
  1101. return true
  1102. }
  1103. if (this.dataDetails.operationCertificateNumber.length!=12) {
  1104. this.$refs.uToast.show({
  1105. type: 'error',
  1106. message: "道路运输证号输入错误!",
  1107. })
  1108. return true
  1109. }
  1110. if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateValidityDate)) {
  1111. this.$refs.uToast.show({
  1112. type: 'error',
  1113. message: "道路运输证有效期不能为空!",
  1114. })
  1115. return true
  1116. }
  1117. if (this.sign == '挂车') {
  1118. if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
  1119. this.$refs.uToast.show({
  1120. type: 'error',
  1121. message: "挂车道路运输证不能为空!",
  1122. })
  1123. return true
  1124. }
  1125. if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
  1126. this.$refs.uToast.show({
  1127. type: 'error',
  1128. message: "挂车道路运输证号不能为空!",
  1129. })
  1130. return true
  1131. }
  1132. if (this.dataDetails.trailerOperationCertificateNumber.length!=12) {
  1133. this.$refs.uToast.show({
  1134. type: 'error',
  1135. message: "挂车道路运输证号输入错误!",
  1136. })
  1137. return true
  1138. }
  1139. if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
  1140. this.$refs.uToast.show({
  1141. type: 'error',
  1142. message: "挂车道路运输证有效期不能为空!",
  1143. })
  1144. return true
  1145. }
  1146. }
  1147. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseHomePage)) {
  1148. this.$refs.uToast.show({
  1149. type: 'error',
  1150. message: "行驶证主页不能为空!",
  1151. })
  1152. return true
  1153. }
  1154. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseBackPage)) {
  1155. this.$refs.uToast.show({
  1156. type: 'error',
  1157. message: "行驶证副页不能为空!",
  1158. })
  1159. return true
  1160. }
  1161. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseNumber)) {
  1162. this.$refs.uToast.show({
  1163. type: 'error',
  1164. message: "行驶证档案编号不能为空!",
  1165. })
  1166. return true
  1167. }
  1168. if (this.dataDetails.drivingLicenseNumber.length!=12) {
  1169. this.$refs.uToast.show({
  1170. type: 'error',
  1171. message: "行驶证档案编号输入错误!",
  1172. })
  1173. return true
  1174. }
  1175. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseRegistrationDate)) {
  1176. this.$refs.uToast.show({
  1177. type: 'error',
  1178. message: "行驶证注册日期不能为空!",
  1179. })
  1180. return true
  1181. }
  1182. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseIssueDate)) {
  1183. this.$refs.uToast.show({
  1184. type: 'error',
  1185. message: "行驶证发证日期不能为空!",
  1186. })
  1187. return true
  1188. }
  1189. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseValidityDate)) {
  1190. this.$refs.uToast.show({
  1191. type: 'error',
  1192. message: "行驶证有效期不能为空!",
  1193. })
  1194. return true
  1195. }
  1196. if(this.dataDetails.drivingLicenseValidityDate!='长期'){
  1197. var arr=this.dataDetails.drivingLicenseValidityDate.split('-')
  1198. if(!this.$helper.periodOfValidity(arr[0],arr[1],arr[2])){
  1199. this.$refs.uToast.show({
  1200. type: 'error',
  1201. message: "行驶证已过期!",
  1202. })
  1203. return true
  1204. }
  1205. }
  1206. if (uni.$u.test.isEmpty(this.dataDetails.lssuingAuthority)) {
  1207. this.$refs.uToast.show({
  1208. type: 'error',
  1209. message: "行驶证发证机关不能为空!",
  1210. })
  1211. return true
  1212. }
  1213. if (this.dataDetails.lssuingAuthority.length<5||this.dataDetails.lssuingAuthority.length>25) {
  1214. this.$refs.uToast.show({
  1215. type: 'error',
  1216. message: "行驶证发证机关输入错误!",
  1217. })
  1218. return true
  1219. }
  1220. if (uni.$u.test.isEmpty(this.dataDetails.energyType)) {
  1221. this.$refs.uToast.show({
  1222. type: 'error',
  1223. message: "能源类型不能为空!",
  1224. })
  1225. return true
  1226. }
  1227. if (this.sign == '挂车') {
  1228. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
  1229. this.$refs.uToast.show({
  1230. type: 'error',
  1231. message: "挂车行驶证主页不能为空!",
  1232. })
  1233. return true
  1234. }
  1235. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  1236. this.$refs.uToast.show({
  1237. type: 'error',
  1238. message: "挂车行驶证副页不能为空!",
  1239. })
  1240. return true
  1241. }
  1242. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
  1243. this.$refs.uToast.show({
  1244. type: 'error',
  1245. message: "挂车行驶证档案编号不能为空!",
  1246. })
  1247. return true
  1248. }
  1249. if (this.dataDetails.trailerLicenseNumber.length!=12) {
  1250. this.$refs.uToast.show({
  1251. type: 'error',
  1252. message: "挂车行驶证档案编号输入错误!",
  1253. })
  1254. return true
  1255. }
  1256. if (uni.$u.test.isEmpty(this.dataDetails.guaCarNumber)) {
  1257. this.$refs.uToast.show({
  1258. type: 'error',
  1259. message: "挂车车牌号不能为空!",
  1260. })
  1261. return true
  1262. }
  1263. if (uni.$u.test.isEmpty(this.dataDetails.guaOwner)) {
  1264. this.$refs.uToast.show({
  1265. type: 'error',
  1266. message: "车辆所属车主不能为空!",
  1267. })
  1268. return true
  1269. }
  1270. if (uni.$u.test.isEmpty(this.dataDetails.guaServicingWeight)) {
  1271. this.$refs.uToast.show({
  1272. type: 'error',
  1273. message: "挂车整备质量不能为空!",
  1274. })
  1275. return true
  1276. }
  1277. if (uni.$u.test.isEmpty(this.dataDetails.guaCarApprovedWeight)) {
  1278. this.$refs.uToast.show({
  1279. type: 'error',
  1280. message: "挂车核定载质量不能为空!",
  1281. })
  1282. return true
  1283. }
  1284. if (this.dataDetails.guaCarApprovedWeight<500||this.dataDetails.guaCarApprovedWeight>60000) {
  1285. this.$refs.uToast.show({
  1286. type: 'error',
  1287. message: "挂车核定载质量输入错误!",
  1288. })
  1289. return true
  1290. }
  1291. if (uni.$u.test.isEmpty(this.dataDetails.guaCarLong) || uni.$u.test.isEmpty(this.dataDetails.guaCarWidth) || uni.$u.test.isEmpty(this.dataDetails.guaCarHeight)) {
  1292. this.$refs.uToast.show({
  1293. type: 'error',
  1294. message: "挂车外廓尺寸不能为空!",
  1295. })
  1296. return true
  1297. }
  1298. // if (this.dataDetails.fileList2.length == 0) {
  1299. // this.$refs.uToast.show({
  1300. // type: 'error',
  1301. // message: "人和挂车合影不能为空!",
  1302. // })
  1303. // return true
  1304. // }
  1305. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseRegistrationDate)) {
  1306. this.$refs.uToast.show({
  1307. type: 'error',
  1308. message: "挂车行驶证注册日期不能为空!",
  1309. })
  1310. return true
  1311. }
  1312. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseIssueDate)) {
  1313. this.$refs.uToast.show({
  1314. type: 'error',
  1315. message: "挂车行驶证发证日期不能为空!!",
  1316. })
  1317. return true
  1318. }
  1319. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
  1320. this.$refs.uToast.show({
  1321. type: 'error',
  1322. message: "挂车行驶证有效期不能为空!",
  1323. })
  1324. return true
  1325. }
  1326. if(this.dataDetails.trailerLicenseValidityDate!='长期'){
  1327. var arr=this.dataDetails.trailerLicenseValidityDate.split('-')
  1328. if(!this.$helper.periodOfValidity(arr[0],arr[1],arr[2])){
  1329. this.$refs.uToast.show({
  1330. type: 'error',
  1331. message: "挂车行驶证已过期!",
  1332. })
  1333. return true
  1334. }
  1335. }
  1336. if (uni.$u.test.isEmpty(this.dataDetails.guaLssuingAuthority)) {
  1337. this.$refs.uToast.show({
  1338. type: 'error',
  1339. message: "挂车行驶证发证机关不能为空!",
  1340. })
  1341. return true
  1342. }
  1343. if (this.dataDetails.guaLssuingAuthority.length<5||this.dataDetails.guaLssuingAuthority.length>25) {
  1344. this.$refs.uToast.show({
  1345. type: 'error',
  1346. message: "挂车行驶证发证机关输入错误!",
  1347. })
  1348. return true
  1349. }
  1350. }
  1351. return false
  1352. },
  1353. submit() {
  1354. if (this.validate()) return
  1355. if(this.dataDetails.carCategory == "挂车"){
  1356. if(this.dataDetails.guaCarNumber1.indexOf('挂')==-1){
  1357. this.dataDetails.guaCarNumber=this.dataDetails.guaCarNumber1+'挂'
  1358. }
  1359. }
  1360. this.$request.baseRequest('post', '/driverCarInfo/api/editInfo', this.dataDetails).then(res => {
  1361. if (res.code == '200') {
  1362. this.$refs.uToast.show({
  1363. type: 'success',
  1364. message: "提交成功!",
  1365. complete() {
  1366. uni.navigateBack({
  1367. delta: 1
  1368. });
  1369. // uni.$u.route('/pages/mine/manageVehicles/index');
  1370. }
  1371. })
  1372. // this.$refs.uToast.show({
  1373. // ...params
  1374. // })
  1375. // uni.$u.route('/pages/mine/manageVehicles/index');
  1376. } else {
  1377. uni.$u.toast(res.message);
  1378. }
  1379. })
  1380. .catch(res => {
  1381. uni.$u.toast(res.message);
  1382. });
  1383. },
  1384. },
  1385. }
  1386. </script>
  1387. <style lang="scss" scoped>
  1388. .container {
  1389. margin: 20rpx;
  1390. background: white;
  1391. padding: 0 20rpx;
  1392. border-radius: 20rpx;
  1393. padding-bottom: 200rpx;
  1394. .left-text {
  1395. // background: red;
  1396. width: 176px;
  1397. color: #333333;
  1398. display: flex;
  1399. align-items: center;
  1400. }
  1401. .row {
  1402. border-bottom: 1px solid #EEEEEE;
  1403. padding-bottom: 28rpx;
  1404. margin-top: 26rpx;
  1405. .ch-style {}
  1406. }
  1407. .row-ch {
  1408. padding-right: 250rpx;
  1409. box-sizing: border-box;
  1410. }
  1411. .row {
  1412. border-bottom: 1px solid #EEEEEE;
  1413. padding-bottom: 28rpx;
  1414. margin-top: 26rpx;
  1415. }
  1416. .left-text {
  1417. // background: red;
  1418. width: 320rpx;
  1419. color: #333333;
  1420. display: flex;
  1421. align-items: center;
  1422. }
  1423. .picture {
  1424. position: relative;
  1425. width: 100%;
  1426. height: 440rpx;
  1427. display: flex;
  1428. justify-content: center;
  1429. flex-direction: column;
  1430. align-items: center;
  1431. .text {
  1432. margin-top: 20rpx;
  1433. }
  1434. }
  1435. .picture1 {
  1436. background: url(../../../static/images/mine/jzz.png);
  1437. background-size: 100% 100%;
  1438. }
  1439. .picture2 {
  1440. background: url(../../../static/images/mine/jzf.png);
  1441. background-size: 100% 100%;
  1442. }
  1443. .picture3 {
  1444. background: url(../../../static/images/mine/xsz.png);
  1445. background-size: 100% 100%;
  1446. }
  1447. .picture4 {
  1448. background: url(../../../static/images/mine/xsf.png);
  1449. background-size: 100% 100%;
  1450. }
  1451. .picture5 {
  1452. background: url(../../../static/images/mine/gcxsz.png);
  1453. background-size: 100% 100%;
  1454. }
  1455. .picture6 {
  1456. background: url(../../../static/images/mine/gcxsf.png);
  1457. background-size: 100% 100%;
  1458. }
  1459. .picture7 {
  1460. background: url(../../../static/images/mine/cy.png);
  1461. background-size: 100% 100%;
  1462. }
  1463. .picture8 {
  1464. background: url(../../../static/images/mine/cy.png);
  1465. background-size: 100% 100%;
  1466. }
  1467. .picture9 {
  1468. background: url(../../../static/images/mine/cy.png);
  1469. background-size: 100% 100%;
  1470. }
  1471. .xj-image {
  1472. width: 100rpx;
  1473. height: 100rpx;
  1474. }
  1475. .title {
  1476. color: #000;
  1477. margin: 20rpx 0;
  1478. }
  1479. }
  1480. .input-ckg {
  1481. height: 86rpx;
  1482. margin-top: 0 !important;
  1483. padding-bottom: 0 !important;
  1484. .u-input {
  1485. height: 100%;
  1486. background: #F7F8FA;
  1487. padding-left: 10rpx !important;
  1488. padding-right: 85rpx !important;
  1489. }
  1490. .star {
  1491. display: flex;
  1492. align-items: center;
  1493. margin: 0 10rpx;
  1494. }
  1495. .input-positon {
  1496. position: relative;
  1497. }
  1498. .position-right {
  1499. position: absolute;
  1500. right: 20rpx;
  1501. top: 0;
  1502. width: 60rpx;
  1503. height: 50rpx;
  1504. bottom: 0;
  1505. margin: auto;
  1506. }
  1507. }
  1508. .picture {
  1509. margin-top: 20rpx;
  1510. background: #F5F6FA;
  1511. width: 212rpx;
  1512. height: 212rpx;
  1513. border-radius: 10rpx;
  1514. display: flex;
  1515. flex-direction: column;
  1516. justify-content: center;
  1517. align-items: center;
  1518. color: #6A7282;
  1519. }
  1520. .submit-btn-wrap{
  1521. position: fixed;
  1522. bottom:0;left:0;
  1523. width:100%;
  1524. padding:40rpx 0;
  1525. background:#fff;
  1526. z-index:1000;
  1527. }
  1528. .submit-btn {
  1529. bottom: 40rpx;
  1530. width: 90%;
  1531. background: #2772FB;
  1532. color: white;
  1533. text-align: center;
  1534. margin:0 auto;
  1535. padding: 30rpx 0;
  1536. border-radius: 50rpx;
  1537. }
  1538. .del-card {
  1539. position: absolute;
  1540. top: -10rpx;
  1541. right: -6rpx;
  1542. width: 80rpx;
  1543. height: 80rpx;
  1544. z-index: 9;
  1545. }
  1546. /deep/.uni-input-input:disabled{
  1547. background:#fff;
  1548. }
  1549. .car-uumber{
  1550. text-align:right;
  1551. }
  1552. </style>