editVehicle.vue 50 KB

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