addVehicle.vue 51 KB

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