addVehicle.vue 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389
  1. <!-- 管理车辆 -->
  2. <template>
  3. <view 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 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 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 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">
  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 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">
  214. <view class="left-text">车牌颜色</view>
  215. <view class="color" @click="selectNoColor">{{dataDetails.carNumberColour}}</view>
  216. <view>></view>
  217. <u-picker :show="carColor" :columns="colorColumns" :closeOnClickOverlay='true' @close='colorClose'
  218. @cancel='colorClose' @confirm='confirmColor' @change="changeCarModel"></u-picker>
  219. </view>
  220. <view class="flex row">
  221. <view class="left-text">车辆所属车主</view>
  222. <u--input placeholder="输入车主姓名" inputAlign='left' border="none" v-model="dataDetails.owner">
  223. </u--input>
  224. </view>
  225. <view class="flex row" v-if="sign == '非挂车'">
  226. <view class="left-text">总质量(千克)</view>
  227. <u--input placeholder="输入总质量" inputAlign='left' border="none" v-model="dataDetails.carTotalWeight">
  228. </u--input>
  229. </view>
  230. <view class="flex row" v-if="sign == '挂车'">
  231. <view class="left-text">整备质量(千克)</view>
  232. <u--input placeholder="输入整备质量" inputAlign='left' border="none" v-model="dataDetails.servicingWeight">
  233. </u--input>
  234. </view>
  235. <view class="flex row noborder" v-if="sign == '挂车'">
  236. <view style='width:390rpx;' class="left-text">牵引车外廓尺寸(毫米)</view>
  237. </view>
  238. <view class="flex row noborder" v-if="sign == '非挂车'">
  239. <view class="left-text">外廓尺寸(毫米)</view>
  240. </view>
  241. <view class="flex row noborder input-ckg">
  242. <view class="input-positon">
  243. <u--input class="input" placeholder="长" inputAlign='left' border="none"
  244. v-model="dataDetails.carLong">
  245. </u--input>
  246. <view class="position-right">
  247. mm
  248. </view>
  249. </view>
  250. <view class="star">*</view>
  251. <view class="input-positon">
  252. <u--input placeholder="宽" inputAlign='left' border="none" v-model="dataDetails.carWidth">
  253. </u--input>
  254. <view class="position-right">
  255. mm
  256. </view>
  257. </view>
  258. <view class="star">*</view>
  259. <view class="input-positon">
  260. <u--input placeholder="高" inputAlign='left' border="none" v-model="dataDetails.carHeight">
  261. </u--input>
  262. <view class="position-right">
  263. mm
  264. </view>
  265. </view>
  266. </view>
  267. <view class="flex row noborder s-row">
  268. <view class="left-text" style="width: 100%;" v-if="sign == '挂车'">上传人和牵引车合影(牵引车牌号可见)</view>
  269. <view class="left-text" style="width: 100%;" v-if="sign == '非挂车'">上传人车合影(车头车牌号可见)</view>
  270. <u-upload class="uview-upload" :fileList="fileList1" @afterRead="afterRead($event,'1')"
  271. @delete="deletePic" name="1" multiple :maxCount="1"></u-upload>
  272. </view>
  273. <!-- 挂车 -->
  274. <view v-if="sign == '挂车'">
  275. <view class="flex row">
  276. <view class="left left-text">挂车车牌号</view>
  277. <view class="right flex">
  278. <input class="car-uumber" v-model='dataDetails.guaCarNumber'
  279. @click.stop="handleShowKeyboard1(index)" :disabled="true" placeholder="输入挂车牌号"
  280. name="input"></input>
  281. </view>
  282. </view>
  283. <view class="flex row">
  284. <view class="left-text">车辆所属车主</view>
  285. <u--input placeholder="输入车主姓名" inputAlign='left' border="none" v-model="dataDetails.guaOwner">
  286. </u--input>
  287. </view>
  288. <view class="flex row">
  289. <view class="left-text">整备质量(千克)</view>
  290. <u--input placeholder="输入整备质量" inputAlign='left' border="none"
  291. v-model="dataDetails.guaServicingWeight">
  292. </u--input>
  293. </view>
  294. <view class="flex row">
  295. <view class="left-text">核定载质量(千克)</view>
  296. <u--input placeholder="输入核定载质量" inputAlign='left' border="none"
  297. v-model="dataDetails.guaCarApprovedWeight">
  298. </u--input>
  299. </view>
  300. <view class="flex row noborder">
  301. <view style='width:390rpx;' class="left-text">挂车外廓尺寸(毫米)</view>
  302. </view>
  303. <view class="flex row noborder input-ckg">
  304. <view class="input-positon">
  305. <u--input class="input" placeholder="长" inputAlign='left' border="none"
  306. v-model="dataDetails.guaCarLong">
  307. </u--input>
  308. <view class="position-right">
  309. mm
  310. </view>
  311. </view>
  312. <view class="star">*</view>
  313. <view class="input-positon">
  314. <u--input placeholder="宽" inputAlign='left' border="none" v-model="dataDetails.guaCarWidth">
  315. </u--input>
  316. <view class="position-right">
  317. mm
  318. </view>
  319. </view>
  320. <view class="star">*</view>
  321. <view class="input-positon">
  322. <u--input placeholder="高" inputAlign='left' border="none" v-model="dataDetails.guaCarHeight">
  323. </u--input>
  324. <view class="position-right">
  325. mm
  326. </view>
  327. </view>
  328. </view>
  329. <view class="flex row noborder s-row">
  330. <view class="left-text" style="width: 100%;">上传人和挂车合影(挂车车牌号可见)</view>
  331. <u-upload class="uview-upload" :fileList="fileList2" @afterRead="afterRead1($event,'2')"
  332. @delete="deletePic" name="2" multiple :maxCount="1"></u-upload>
  333. </view>
  334. </view>
  335. <!-- <view class="level1-title">证件信息</view> -->
  336. </view>
  337. <view class='submit-btn-wrap'>
  338. <view class="submit-btn" @click="submit">提交</view>
  339. </view>
  340. <master-keyboard ref="keyboard" keyboardtype="car" :show="keyShow" :randomNumber="true" :newCar="false"
  341. :defaultValue="carNumber" @keyboardClick="handleClick"></master-keyboard>
  342. <master-keyboard ref="keyboard1" keyboardtype="car" :show="keyShow1" :randomNumber="true" :newCar="false"
  343. :defaultValue="carNumber1" @keyboardClick="handleClick1"></master-keyboard>
  344. <u-toast ref="uToast"></u-toast>
  345. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  346. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true" @close="isShowimgType=false">
  347. </u-action-sheet>
  348. <u-picker :show="isShowValidity" ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
  349. :closeOnClickOverlay='true' @close='isShowValidity=false' @cancel='isShowValidity=false'>
  350. </u-picker>
  351. <u-picker :show="isShowCarType" ref="uPicker" :columns="carTypeList" @confirm="confirmCarType"
  352. :closeOnClickOverlay='true' @close='isShowCarType=false' @cancel='isShowCarType=false'>
  353. </u-picker>
  354. </view>
  355. </template>
  356. <script>
  357. import uploadImage from '@/components/ossutil/uploadFile.js';
  358. import keyboard from "@/components/master-keyboard/master-keyboard.vue";
  359. var _this;
  360. import {
  361. mapState
  362. } from 'vuex';
  363. export default {
  364. data() {
  365. return {
  366. index: '',
  367. keyShow: false,
  368. keyShow1: false,
  369. carNumber: '',
  370. carNumber1: "",
  371. dataDetails: {
  372. // driverId: '',
  373. // carNumber: '',
  374. carNumberColour: '黄色',
  375. carCategory: '挂车',
  376. carType: '高栏',
  377. useNature: "营业特种车",
  378. guaUseNature: "营运挂车",
  379. energyType:"汽油",
  380. // carTotalWeight: '',
  381. // carApprovedWeight: '',
  382. // carLong: '',
  383. // carWidth: '',
  384. // carHeight: '',
  385. // addressUrl: ''
  386. },
  387. carTypeList:[["汽油","柴油","油电混合","纯电动","插电式混合动力","增程式"]],
  388. isShowCarType:false,
  389. carModelColumns: [
  390. ['挂车', '非挂车'],
  391. ['高栏', '集装箱', '自卸车']
  392. ],
  393. carModelColumnData: [
  394. ['高栏', '集装箱', '自卸车'],
  395. ['重型仓栏']
  396. ],
  397. colorColumns: [
  398. ['黄色', '蓝色']
  399. ],
  400. carColor: false,
  401. carModel: false,
  402. fileList1: [],
  403. fileList2: [],
  404. ValidityPeriodType: "",
  405. validityPeriod: [],
  406. isShowValidity: false,
  407. uploadType: '',
  408. isShowimgType: false,
  409. sign: "挂车"
  410. };
  411. },
  412. computed: {
  413. ...mapState(['hasLogin', 'userInfo', 'firstAuthentication']),
  414. },
  415. onLoad(options) {
  416. _this = this;
  417. this.dataDetails.commonId = this.userInfo.id
  418. this.validityPeriod = this.$helper.makeValidityPeriod()
  419. },
  420. methods: {
  421. driveType(){
  422. this.isShowCarType = true
  423. },
  424. confirmCarType(e){
  425. this.dataDetails.energyType = e.value[0]
  426. this.isShowCarType = false
  427. },
  428. //挂车牌号弹出键盘
  429. handleShowKeyboard1(index) {
  430. if (this.dataDetails.guaCarNumber == '') {
  431. this.carNumber1 = ''
  432. } else {
  433. this.carNumber1 = this.dataDetails.guaCarNumber
  434. }
  435. if (this.$refs.keyboard1.open) {
  436. this.$refs.keyboard1.open(false) //true 键盘显示 false 键盘隐藏
  437. } else {
  438. this.$refs.keyboard1[0].open(false)
  439. }
  440. this.index = index
  441. if (this.$refs.keyboard1.open) {
  442. this.$refs.keyboard1.open(true) //true 键盘显示 false 键盘隐藏
  443. } else {
  444. this.$refs.keyboard1[0].open(true)
  445. }
  446. },
  447. handleClick1(e) {
  448. this.carNumber1 = e.value
  449. this.dataDetails.guaCarNumber = e.value //键盘输入值
  450. },
  451. delCard(type) {
  452. switch (type) {
  453. case 1:
  454. _this.dataDetails.operationCertificate = "" //道路运输证
  455. break;
  456. case 2:
  457. _this.dataDetails.trailerOperationCertificate = "" //挂车道路运输证
  458. break;
  459. case 3:
  460. _this.dataDetails.drivingLicenseHomePage = "" //牵引车行驶证
  461. break;
  462. case 4:
  463. _this.dataDetails.drivingLicenseBackPage = "" //牵引车行驶证副页
  464. break;
  465. case 5:
  466. _this.dataDetails.trailerLicenseHomePage = "" //挂车行驶证
  467. break;
  468. case 6:
  469. _this.dataDetails.trailerLicenseBackPage = ""//挂车行驶证副页
  470. break;
  471. }
  472. _this.$forceUpdate()
  473. },
  474. uploadImg(type) {
  475. this.uploadType = type
  476. this.imgTypeSelect()
  477. // this.isShowimgType = true
  478. },
  479. selectValidityPeriod(type) {
  480. this.ValidityPeriodType = type
  481. this.isShowValidity = true
  482. },
  483. // 上传图片
  484. imgTypeSelect(val) {
  485. // if (val.name == '相册') {
  486. uni.chooseImage({
  487. count: 1,
  488. success: function(res) {
  489. uploadImage("images", res.tempFilePaths[0], 'appData/',
  490. result => {
  491. // 上传成功回调函数
  492. console.log('图片地址-----', result)
  493. switch (_this.uploadType) {
  494. case 1:
  495. _this.dataDetails.driverLicenseHomePage = result
  496. break;
  497. case 2:
  498. _this.dataDetails.driverLicenseBackPage = result
  499. break;
  500. case 3:
  501. _this.dataDetails.drivingLicenseHomePage = result
  502. _this.$request.baseRequest('get',
  503. '/driverCarInfo/api/driveringLicenseShibie', {
  504. image: result,
  505. flag: 1
  506. }).then(res => {
  507. if (res.data) {
  508. _this.dataDetails.carNumber = res.data
  509. .carNum //车牌号
  510. _this.dataDetails.owner = res.data
  511. .owner //车辆所有人
  512. _this.$forceUpdate()
  513. }
  514. })
  515. .catch(res => {
  516. uni.$u.toast(res.message);
  517. });
  518. break;
  519. case 4:
  520. _this.dataDetails.drivingLicenseBackPage = result
  521. _this.$request.baseRequest('get',
  522. '/driverCarInfo/api/driveringLicenseShibie', {
  523. image: result,
  524. flag: 2
  525. }).then(res => {
  526. if (res.data) {
  527. if (res.data.issuingAuthority) { //行驶证发证机关
  528. _this.dataDetails.lssuingAuthority = res
  529. .data.issuingAuthority
  530. }
  531. if (res.data
  532. .licenseRegistrationDate) { //行驶证注册日期
  533. _this.dataDetails
  534. .drivingLicenseRegistrationDate = res
  535. .data.licenseRegistrationDate
  536. }
  537. if (res.data.licenseIssueDate) { //行驶证发证日期
  538. _this.dataDetails.drivingLicenseIssueDate =
  539. res.data.licenseIssueDate
  540. }
  541. _this.dataDetails.drivingLicenseValidityDate =
  542. res.data.driveringEndDate //行驶证有效期
  543. _this.dataDetails.drivingLicenseNumber = res
  544. .data.driveringNum //行驶证档案编号
  545. if (_this.sign == "非挂车") {
  546. if (res.data.servicingMass && res.data
  547. .servicingMass.indexOf("kg") != -1) {
  548. res.data.servicingMass = res.data
  549. .servicingMass.slice(0, res.data
  550. .servicingMass.length - 2)
  551. }
  552. _this.dataDetails.carTotalWeight = res.data
  553. .servicingMass //总质量
  554. }
  555. if(res.data.approvedLoadMass.indexOf("kg") != -1){
  556. res.data.approvedLoadMass = res.data.approvedLoadMass.slice(0, res.data.approvedLoadMass.length - 2)
  557. }
  558. _this.dataDetails.carApprovedWeight = res.data
  559. .approvedLoadMass //核定载质量
  560. if (res.data.size && res.data.size.indexOf(
  561. "mm") != -1) {
  562. res.data.size = res.data.size.slice(0, res
  563. .data.size.length - 2);
  564. }
  565. _this.dataDetails.carLong = res.data.size
  566. .split("X")[0] //车长
  567. _this.dataDetails.carWidth = res.data.size
  568. .split("X")[1] //车宽
  569. _this.dataDetails.carHeight = res.data.size
  570. .split("X")[2] //车高
  571. _this.$forceUpdate()
  572. }
  573. })
  574. .catch(res => {
  575. uni.$u.toast(res.message);
  576. });
  577. break;
  578. case 5: //挂车行驶证
  579. _this.dataDetails.trailerLicenseHomePage = result
  580. _this.$request.baseRequest('get',
  581. '/driverCarInfo/api/driveringLicenseShibie', {
  582. image: result,
  583. flag: 1
  584. }).then(res => {
  585. if (res.data) {
  586. if (res.data.issuingAuthority) { //行驶证发证机关
  587. _this.dataDetails.guaLssuingAuthority = res
  588. .data.issuingAuthority
  589. }
  590. if (res.data.licenseRegistrationDate) { //行驶证注册日期
  591. _this.dataDetails
  592. .trailerLicenseRegistrationDate = res.data
  593. .licenseRegistrationDate
  594. }
  595. if (res.data.licenseIssueDate) { //行驶证发证日期
  596. _this.dataDetails.trailerLicenseIssueDate = res
  597. .data.licenseIssueDate
  598. }
  599. _this.dataDetails.guaCarNumber = res.data
  600. .carNum //车牌号
  601. _this.dataDetails.guaOwner = res.data
  602. .owner //车辆所有人
  603. _this.$forceUpdate()
  604. }
  605. })
  606. .catch(res => {
  607. uni.$u.toast(res.message);
  608. });
  609. break;
  610. case 6:
  611. _this.dataDetails.trailerLicenseBackPage = result
  612. _this.$request.baseRequest('get',
  613. '/driverCarInfo/api/driveringLicenseShibie', {
  614. image: result,
  615. flag: 2
  616. }).then(res => {
  617. if (res.data) {
  618. _this.dataDetails.trailerLicenseValidityDate =
  619. res.data.driveringEndDate //挂车行驶证有效期
  620. _this.dataDetails.trailerLicenseNumber = res
  621. .data.driveringNum //挂车行驶证档案编号
  622. if (res.data.servicingMass && res.data
  623. .servicingMass.indexOf("kg") != -1) {
  624. res.data.servicingMass = res.data
  625. .servicingMass.slice(0, res.data
  626. .servicingMass.length - 2)
  627. }
  628. if(res.data.approvedLoadMass.indexOf("kg") != -1){
  629. res.data.approvedLoadMass = res.data.approvedLoadMass.slice(0, res.data.approvedLoadMass.length - 2)
  630. }
  631. _this.dataDetails.guaServicingWeight = res.data.servicingMass //总质量
  632. _this.dataDetails.guaCarApprovedWeight = res.data.approvedLoadMass //核定载质量
  633. if (res.data.size && res.data.size.indexOf(
  634. "mm") != -1) {
  635. res.data.size = res.data.size.slice(0, res
  636. .data.size.length - 2);
  637. }
  638. _this.dataDetails.guaCarLong = res.data.size
  639. .split("X")[0] //车长
  640. _this.dataDetails.guaCarWidth = res.data.size
  641. .split("X")[1] //车宽
  642. _this.dataDetails.guaCarHeight = res.data.size
  643. .split("X")[2] //车高
  644. _this.$forceUpdate()
  645. }
  646. })
  647. .catch(res => {
  648. uni.$u.toast(res.message);
  649. });
  650. break;
  651. case 7:
  652. _this.dataDetails.qualificationCertificate = result
  653. break;
  654. case 8:
  655. _this.dataDetails.operationCertificate = result
  656. _this.$request.baseRequest('get',
  657. '/driverCarInfo/api/tranLicenseShibie', {
  658. image: result
  659. }).then(res => {
  660. if (res.data) {
  661. _this.dataDetails.operationCertificateNumber =
  662. res.data.tranNumber
  663. _this.dataDetails
  664. .operationCertificateValidityDate = res
  665. .data.tranEndDate
  666. _this.$forceUpdate()
  667. }
  668. })
  669. .catch(res => {
  670. uni.$u.toast(res.message);
  671. });
  672. break;
  673. case 9:
  674. _this.dataDetails.trailerOperationCertificate = result
  675. _this.$request.baseRequest('get',
  676. '/driverCarInfo/api/tranLicenseShibie', {
  677. image: result
  678. }).then(res => {
  679. if (res.data) {
  680. _this.dataDetails
  681. .trailerOperationCertificateNumber = res
  682. .data.tranNumber
  683. _this.dataDetails
  684. .trailerOperationCertificateValidityDate =
  685. res.data.tranEndDate
  686. _this.$forceUpdate()
  687. }
  688. })
  689. .catch(res => {
  690. uni.$u.toast(res.message);
  691. });
  692. break;
  693. }
  694. _this.$forceUpdate()
  695. }
  696. )
  697. }
  698. });
  699. // }
  700. },
  701. confirmValidityPeriod(e) {
  702. console.log('confirm', e)
  703. switch (this.ValidityPeriodType) {
  704. case 0:
  705. this.dataDetails.driverLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  706. break
  707. case 1:
  708. this.dataDetails.drivingLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  709. break
  710. case 2:
  711. this.dataDetails.trailerLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  712. break
  713. case 3:
  714. this.dataDetails.qualificationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  715. .value[2]
  716. break
  717. case 4:
  718. this.dataDetails.operationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[
  719. 2]
  720. break
  721. case 5:
  722. this.dataDetails.trailerOperationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  723. .value[2]
  724. case 6: //行驶证注册日期
  725. this.dataDetails.drivingLicenseRegistrationDate = e.value[0] + '-' + e.value[1] + '-' + e
  726. .value[2]
  727. break
  728. case 7: //行驶证发证日期
  729. this.dataDetails.drivingLicenseIssueDate = e.value[0] + '-' + e.value[1] + '-' + e
  730. .value[2]
  731. break
  732. case 8: //挂车行驶证注册日期
  733. this.dataDetails.trailerLicenseRegistrationDate = e.value[0] + '-' + e.value[1] + '-' + e
  734. .value[2]
  735. break
  736. case 9: //挂车行驶证发证日期
  737. this.dataDetails.trailerLicenseIssueDate = e.value[0] + '-' + e.value[1] + '-' + e
  738. .value[2]
  739. break
  740. }
  741. this.isShowValidity = false
  742. },
  743. // 车型切换
  744. changeCarModel(e) {
  745. const {
  746. columnIndex,
  747. index,
  748. // 微信小程序无法将picker实例传出来,只能通过ref操作
  749. picker = this.$refs.carTypePicker
  750. } = e
  751. if (columnIndex === 0) {
  752. // 模拟网络请求
  753. picker.setColumnValues(1, this.carModelColumnData[index])
  754. }
  755. },
  756. // 删除图片
  757. deletePic(event) {
  758. this[`fileList${event.name}`].splice(event.index, 1)
  759. },
  760. // 新增图片
  761. async afterRead(event, num) {
  762. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  763. let lists = [].concat(event.file)
  764. let fileListLen = this[`fileList${event.name}`].length
  765. lists.map((item) => {
  766. this[`fileList${event.name}`].push({
  767. ...item,
  768. status: 'uploading',
  769. message: '上传中'
  770. })
  771. })
  772. for (let i = 0; i < lists.length; i++) {
  773. const result = await this.uploadFilePromise(lists[i].url, num)
  774. let item = this[`fileList${event.name}`][fileListLen]
  775. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  776. status: 'success',
  777. message: '',
  778. url: result
  779. }))
  780. fileListLen++
  781. }
  782. },
  783. // 新增图片
  784. async afterRead1(event, num) {
  785. console.log(event)
  786. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  787. let lists = [].concat(event.file)
  788. let fileListLen = this[`fileList${event.name}`].length
  789. lists.map((item) => {
  790. this[`fileList${event.name}`].push({
  791. ...item,
  792. status: 'uploading',
  793. message: '上传中'
  794. })
  795. })
  796. for (let i = 0; i < lists.length; i++) {
  797. const result = await this.uploadFilePromise(lists[i].url, num)
  798. let item = this[`fileList${event.name}`][fileListLen]
  799. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  800. status: 'success',
  801. message: '',
  802. url: result
  803. }))
  804. fileListLen++
  805. }
  806. },
  807. uploadFilePromise(url, num) {
  808. uploadImage('image', url, 'appData/',
  809. result => {
  810. // 上传成功回调函数
  811. console.log('图片地址', result)
  812. if (num == 1) {
  813. if (!this.dataDetails.addressUrl) {
  814. this.dataDetails.addressUrl = result
  815. } else {
  816. this.dataDetails.addressUrl = this.dataDetails.addressUrl + ',' + result
  817. }
  818. } else if (num == 2) {
  819. if (!this.dataDetails.guaAddressUrl) {
  820. this.dataDetails.guaAddressUrl = result
  821. } else {
  822. this.dataDetails.guaAddressUrl = this.dataDetails.guaAddressUrl + ',' + result
  823. }
  824. }
  825. }
  826. )
  827. },
  828. //车牌号弹出键盘
  829. handleShowKeyboard(index) {
  830. if (this.dataDetails.carNumber == '') {
  831. this.carNumber = ''
  832. } else {
  833. this.carNumber = this.dataDetails.carNumber
  834. }
  835. if (this.$refs.keyboard.open) {
  836. this.$refs.keyboard.open(false) //true 键盘显示 false 键盘隐藏
  837. } else {
  838. this.$refs.keyboard[0].open(false)
  839. }
  840. this.index = index
  841. if (this.$refs.keyboard.open) {
  842. this.$refs.keyboard.open(true) //true 键盘显示 false 键盘隐藏
  843. } else {
  844. this.$refs.keyboard[0].open(true)
  845. }
  846. },
  847. //车牌号弹出键盘
  848. handleClick(e) {
  849. this.carNumber = e.value
  850. this.dataDetails.carNumber = e.value //键盘输入值
  851. },
  852. confirmColor(val) {
  853. this.dataDetails.carNumberColour = val.value[0]
  854. this.carColor = false
  855. },
  856. colorClose() {
  857. this.carColor = false
  858. },
  859. selectNoColor() {
  860. this.carColor = true
  861. },
  862. confirmCarModel(val) {
  863. if (val.value[0] == '挂车') {
  864. this.dataDetails.useNature = "营业特种车"
  865. this.dataDetails.guaUseNature = "营运挂车"
  866. } else if (val.value[0] == '非挂车') {
  867. this.dataDetails.useNature = "营运货车"
  868. }
  869. this.sign = val.value[0]
  870. // this.dataDetails.carType = val.value[0] + ' ' + val.value[1]
  871. this.dataDetails.carCategory = val.value[0]
  872. this.dataDetails.carType = val.value[1]
  873. this.carModel = false
  874. },
  875. carModelClose() {
  876. this.carModel = false
  877. },
  878. selectCarModel() {
  879. this.carModel = true
  880. },
  881. selectNoColor() {
  882. this.carColor = true
  883. },
  884. unloadGroupPhoto() {
  885. uni.chooseImage({
  886. count: 1,
  887. success: function(res) {
  888. console.log(JSON.stringify(res.tempFilePaths));
  889. uploadImage('image', res.tempFilePaths[0], 'appData/',
  890. result => {
  891. // 上传成功
  892. console.log('图片地址', result)
  893. }
  894. )
  895. }
  896. });
  897. },
  898. validate() {
  899. // true 为校验不通过
  900. if (uni.$u.test.isEmpty(this.dataDetails.carNumber)) {
  901. this.$refs.uToast.show({
  902. type: 'error',
  903. message: "车牌号不能为空!",
  904. })
  905. return true
  906. }
  907. if (uni.$u.test.isEmpty(this.dataDetails.carTotalWeight) && this.sign == '非挂车') {
  908. this.$refs.uToast.show({
  909. type: 'error',
  910. message: "总质量不能为空!",
  911. })
  912. return true
  913. }
  914. if (uni.$u.test.isEmpty(this.dataDetails.servicingWeight) && this.sign == '挂车') {
  915. this.$refs.uToast.show({
  916. type: 'error',
  917. message: "整备质量不能为空!",
  918. })
  919. return true
  920. }
  921. if (uni.$u.test.isEmpty(this.dataDetails.owner)) {
  922. this.$refs.uToast.show({
  923. type: 'error',
  924. message: "车辆所属车主不能为空!",
  925. })
  926. return true
  927. }
  928. if (uni.$u.test.isEmpty(this.dataDetails.carLong) && uni.$u.test.isEmpty(this.dataDetails.caWidth) && uni
  929. .$u.test.isEmpty(this.dataDetails.carHeight)) {
  930. this.$refs.uToast.show({
  931. type: 'error',
  932. message: "外廓尺寸不能为空!",
  933. })
  934. return true
  935. }
  936. if (uni.$u.test.isEmpty(this.dataDetails.operationCertificate)) {
  937. this.$refs.uToast.show({
  938. type: 'error',
  939. message: "道路运输证不能为空!",
  940. })
  941. return true
  942. }
  943. if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateNumber)) {
  944. this.$refs.uToast.show({
  945. type: 'error',
  946. message: "道路运输证号不能为空!",
  947. })
  948. return true
  949. }
  950. if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateValidityDate)) {
  951. this.$refs.uToast.show({
  952. type: 'error',
  953. message: "道路运输证有效期不能为空!",
  954. })
  955. return true
  956. }
  957. if (this.sign == '挂车') {
  958. if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
  959. this.$refs.uToast.show({
  960. type: 'error',
  961. message: "挂车道路运输证不能为空!",
  962. })
  963. return true
  964. }
  965. if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
  966. this.$refs.uToast.show({
  967. type: 'error',
  968. message: "挂车道路运输证号不能为空!",
  969. })
  970. return true
  971. }
  972. if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
  973. this.$refs.uToast.show({
  974. type: 'error',
  975. message: "挂车道路运输证有效期不能为空!",
  976. })
  977. return true
  978. }
  979. }
  980. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseHomePage)) {
  981. this.$refs.uToast.show({
  982. type: 'error',
  983. message: "行驶证主页不能为空!",
  984. })
  985. return true
  986. }
  987. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseBackPage)) {
  988. this.$refs.uToast.show({
  989. type: 'error',
  990. message: "行驶证副页不能为空!",
  991. })
  992. return true
  993. }
  994. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseNumber)) {
  995. this.$refs.uToast.show({
  996. type: 'error',
  997. message: "行驶证档案编号不能为空!",
  998. })
  999. return true
  1000. }
  1001. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseRegistrationDate)) {
  1002. this.$refs.uToast.show({
  1003. type: 'error',
  1004. message: "行驶证注册日期不能为空!",
  1005. })
  1006. return true
  1007. }
  1008. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseIssueDate)) {
  1009. this.$refs.uToast.show({
  1010. type: 'error',
  1011. message: "行驶证发证日期不能为空!",
  1012. })
  1013. return true
  1014. }
  1015. if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseValidityDate)) {
  1016. this.$refs.uToast.show({
  1017. type: 'error',
  1018. message: "行驶证有效期不能为空!",
  1019. })
  1020. return true
  1021. }
  1022. if (uni.$u.test.isEmpty(this.dataDetails.lssuingAuthority)) {
  1023. this.$refs.uToast.show({
  1024. type: 'error',
  1025. message: "行驶证发证机关不能为空!",
  1026. })
  1027. return true
  1028. }
  1029. if (uni.$u.test.isEmpty(this.dataDetails.energyType)) {
  1030. this.$refs.uToast.show({
  1031. type: 'error',
  1032. message: "能源类型不能为空!",
  1033. })
  1034. return true
  1035. }
  1036. if (this.sign == '挂车') {
  1037. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
  1038. this.$refs.uToast.show({
  1039. type: 'error',
  1040. message: "挂车行驶证主页不能为空!",
  1041. })
  1042. return true
  1043. }
  1044. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  1045. this.$refs.uToast.show({
  1046. type: 'error',
  1047. message: "挂车行驶证副页不能为空!",
  1048. })
  1049. return true
  1050. }
  1051. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
  1052. this.$refs.uToast.show({
  1053. type: 'error',
  1054. message: "挂车行驶证档案编号不能为空!",
  1055. })
  1056. return true
  1057. }
  1058. if (uni.$u.test.isEmpty(this.dataDetails.guaCarNumber)) {
  1059. this.$refs.uToast.show({
  1060. type: 'error',
  1061. message: "挂车车牌号不能为空!",
  1062. })
  1063. return true
  1064. }
  1065. if (uni.$u.test.isEmpty(this.dataDetails.guaOwner)) {
  1066. this.$refs.uToast.show({
  1067. type: 'error',
  1068. message: "车辆所属车主不能为空!",
  1069. })
  1070. return true
  1071. }
  1072. if (uni.$u.test.isEmpty(this.dataDetails.guaServicingWeight)) {
  1073. this.$refs.uToast.show({
  1074. type: 'error',
  1075. message: "挂车整备质量不能为空!",
  1076. })
  1077. return true
  1078. }
  1079. if (uni.$u.test.isEmpty(this.dataDetails.guaCarApprovedWeight)) {
  1080. this.$refs.uToast.show({
  1081. type: 'error',
  1082. message: "挂车核定载质量不能为空!",
  1083. })
  1084. return true
  1085. }
  1086. if (uni.$u.test.isEmpty(this.dataDetails.guaCarLong) || uni.$u.test.isEmpty(this.dataDetails.guaCarWidth) || uni.$u.test.isEmpty(this.dataDetails.guaCarHeight)) {
  1087. this.$refs.uToast.show({
  1088. type: 'error',
  1089. message: "挂车外廓尺寸不能为空!",
  1090. })
  1091. return true
  1092. }
  1093. // if (this.dataDetails.fileList2.length == 0) {
  1094. // this.$refs.uToast.show({
  1095. // type: 'error',
  1096. // message: "人和挂车合影不能为空!",
  1097. // })
  1098. // return true
  1099. // }
  1100. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseRegistrationDate)) {
  1101. this.$refs.uToast.show({
  1102. type: 'error',
  1103. message: "挂车行驶证注册日期不能为空!",
  1104. })
  1105. return true
  1106. }
  1107. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseIssueDate)) {
  1108. this.$refs.uToast.show({
  1109. type: 'error',
  1110. message: "挂车行驶证发证日期不能为空!!",
  1111. })
  1112. return true
  1113. }
  1114. if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
  1115. this.$refs.uToast.show({
  1116. type: 'error',
  1117. message: "挂车行驶证有效期不能为空!",
  1118. })
  1119. return true
  1120. }
  1121. if (uni.$u.test.isEmpty(this.dataDetails.guaLssuingAuthority)) {
  1122. this.$refs.uToast.show({
  1123. type: 'error',
  1124. message: "挂车行驶证发证机关不能为空!",
  1125. })
  1126. return true
  1127. }
  1128. }
  1129. return false
  1130. },
  1131. submit() {
  1132. this.dataDetails.driverId = uni.getStorageSync("firstAuthentication").id
  1133. // 校验
  1134. if (this.validate()) return
  1135. if (!this.dataDetails.carApprovedWeight) {
  1136. delete this.dataDetails.carApprovedWeight
  1137. }
  1138. if(this.dataDetails.carCategory == "非挂车"){
  1139. delete this.dataDetails.guaUseNature
  1140. }
  1141. this.$request.baseRequest('post', '/driverCarInfo/api/addInfo', this.dataDetails).then(res => {
  1142. if (res.code == '200') {
  1143. this.$refs.uToast.show({
  1144. type: 'success',
  1145. message: "提交成功!",
  1146. complete() {
  1147. // uni.navigateBack({
  1148. // delta: 1
  1149. // });
  1150. uni.$u.route('/pages/mine/manageVehicles/index');
  1151. }
  1152. })
  1153. // this.$refs.uToast.show({
  1154. // ...params
  1155. // })
  1156. // uni.$u.route('/pages/mine/manageVehicles/index');
  1157. } else {
  1158. uni.$u.toast(res.message);
  1159. }
  1160. })
  1161. .catch(res => {
  1162. uni.$u.toast(res.message);
  1163. });
  1164. },
  1165. },
  1166. }
  1167. </script>
  1168. <style lang="scss" scoped>
  1169. .container {
  1170. margin: 20rpx;
  1171. background: white;
  1172. padding: 0 20rpx;
  1173. border-radius: 20rpx;
  1174. padding-bottom: 200rpx;
  1175. .left-text {
  1176. // background: red;
  1177. width: 290rpx;
  1178. color: #333333;
  1179. display: flex;
  1180. align-items: center;
  1181. }
  1182. .row {
  1183. border-bottom: 1px solid #EEEEEE;
  1184. padding-bottom: 28rpx;
  1185. margin-top: 26rpx;
  1186. .ch-style {}
  1187. }
  1188. .row-ch {
  1189. padding-right: 250rpx;
  1190. box-sizing: border-box;
  1191. }
  1192. .row {
  1193. border-bottom: 1px solid #EEEEEE;
  1194. padding-bottom: 28rpx;
  1195. margin-top: 26rpx;
  1196. }
  1197. .left-text {
  1198. // background: red;
  1199. width: 320rpx;
  1200. color: #333333;
  1201. display: flex;
  1202. align-items: center;
  1203. }
  1204. .picture {
  1205. position: relative;
  1206. width: 100%;
  1207. height: 440rpx;
  1208. display: flex;
  1209. justify-content: center;
  1210. flex-direction: column;
  1211. align-items: center;
  1212. .text {
  1213. margin-top: 20rpx;
  1214. }
  1215. }
  1216. .picture1 {
  1217. background: url(../../../static/images/mine/jzz.png);
  1218. background-size: 100% 100%;
  1219. }
  1220. .picture2 {
  1221. background: url(../../../static/images/mine/jzf.png);
  1222. background-size: 100% 100%;
  1223. }
  1224. .picture3 {
  1225. background: url(../../../static/images/mine/xsz.png);
  1226. background-size: 100% 100%;
  1227. }
  1228. .picture4 {
  1229. background: url(../../../static/images/mine/xsf.png);
  1230. background-size: 100% 100%;
  1231. }
  1232. .picture5 {
  1233. background: url(../../../static/images/mine/gcxsz.png);
  1234. background-size: 100% 100%;
  1235. }
  1236. .picture6 {
  1237. background: url(../../../static/images/mine/gcxsf.png);
  1238. background-size: 100% 100%;
  1239. }
  1240. .picture7 {
  1241. background: url(../../../static/images/mine/cy.png);
  1242. background-size: 100% 100%;
  1243. }
  1244. .picture8 {
  1245. background: url(../../../static/images/mine/cy.png);
  1246. background-size: 100% 100%;
  1247. }
  1248. .picture9 {
  1249. background: url(../../../static/images/mine/cy.png);
  1250. background-size: 100% 100%;
  1251. }
  1252. .xj-image {
  1253. width: 100rpx;
  1254. height: 100rpx;
  1255. }
  1256. .title {
  1257. color: #999999;
  1258. margin: 20rpx 0;
  1259. }
  1260. }
  1261. .input-ckg {
  1262. height: 86rpx;
  1263. margin-top: 0 !important;
  1264. padding-bottom: 0 !important;
  1265. .u-input {
  1266. height: 100%;
  1267. background: #F7F8FA;
  1268. padding-left: 10rpx !important;
  1269. padding-right: 85rpx !important;
  1270. }
  1271. .star {
  1272. display: flex;
  1273. align-items: center;
  1274. margin: 0 10rpx;
  1275. }
  1276. .input-positon {
  1277. position: relative;
  1278. }
  1279. .position-right {
  1280. position: absolute;
  1281. right: 20rpx;
  1282. top: 0;
  1283. width: 60rpx;
  1284. height: 50rpx;
  1285. bottom: 0;
  1286. margin: auto;
  1287. }
  1288. }
  1289. .picture {
  1290. margin-top: 20rpx;
  1291. background: #F5F6FA;
  1292. width: 212rpx;
  1293. height: 212rpx;
  1294. border-radius: 10rpx;
  1295. display: flex;
  1296. flex-direction: column;
  1297. justify-content: center;
  1298. align-items: center;
  1299. color: #6A7282;
  1300. }
  1301. .submit-btn-wrap{
  1302. position: fixed;
  1303. bottom:0;left:0;
  1304. width:100%;
  1305. padding:40rpx 20rpx;
  1306. background:#fff;
  1307. }
  1308. .submit-btn {
  1309. bottom: 40rpx;
  1310. width: 90%;
  1311. background: #2772FB;
  1312. color: white;
  1313. text-align: center;
  1314. margin:0 auto;
  1315. padding: 30rpx 0;
  1316. border-radius: 50rpx;
  1317. }
  1318. .del-card {
  1319. position: absolute;
  1320. top: -10rpx;
  1321. right: -6rpx;
  1322. width: 80rpx;
  1323. height: 80rpx;
  1324. z-index: 9;
  1325. }
  1326. /deep/.uni-input-input:disabled{
  1327. background:#fff;
  1328. }
  1329. </style>