addVehicle.vue 50 KB

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