editVehicle.vue 48 KB

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