editVehicle.vue 47 KB

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