editVehicle.vue 53 KB

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