addVehicle.vue 49 KB

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