addVehicle.vue 47 KB

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