editVehicle.vue 49 KB

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