addVehicle.vue 52 KB

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