addVehicle.vue 49 KB

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