driverCertificationNext.vue 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. <template>
  2. <view class="content">
  3. <view class="top-head"></view>
  4. <view class="container">
  5. <u-radio-group v-model="radiovalue" iconPlacement="row" class='radio-group'>
  6. <u-radio :customStyle="{marginBottom: '8px',marginRight:'4px'}" v-for="(item, index) in radiolist" :key="index"
  7. :label="item.name" :name="item.name" @change="radioChange">
  8. </u-radio>
  9. </u-radio-group>
  10. <view class="level1-title">证件信息</view>
  11. <view class="content1">
  12. <view class="title">上传驾驶证主页</view>
  13. <view @click="uploadImg(1)" class="picture picture1" v-if="!dataDetails.driverLicenseHomePage">
  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.driverLicenseHomePage" @click.stop="uploadImg(1)"
  18. class="preview-card-img picture">
  19. <view @click.stop="delCard(1)">
  20. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  21. </image>
  22. </view>
  23. <image class="" :src="dataDetails.driverLicenseHomePage" mode="aspectFit"></image>
  24. </view>
  25. <view class="title">上传驾驶证副页</view>
  26. <view @click="uploadImg(2)" class="picture picture2" v-if="!dataDetails.driverLicenseBackPage">
  27. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  28. <view class="text">上传驾驶证副页</view>
  29. </view>
  30. <view v-if="dataDetails.driverLicenseBackPage" @click.stop="uploadImg(2)"
  31. class="preview-card-img picture">
  32. <view @click.stop="delCard(2)">
  33. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  34. </image>
  35. </view>
  36. <image class="" :src="dataDetails.driverLicenseBackPage" mode="aspectFit"></image>
  37. </view>
  38. <view class="flex row flex-space-between">
  39. <view class="left-text">驾驶证有效期</view>
  40. <!-- <view class="" @click="selectValidityPeriod(0)">
  41. {{dataDetails.driverLicenseValidityDate?dataDetails.driverLicenseValidityDate:'选择有效截止日期>'}}
  42. </view> -->
  43. <view style='font-size:12px;' class="" @click="selectValidityPeriod(0)">
  44. {{dataDetails.driverLicenseValidityStartDate?dataDetails.driverLicenseValidityStartDate:'起始时间'}}
  45. </view>
  46. <view>~</view>
  47. <view style='font-size:12px;' class="" @click="selectValidityPeriod(9)">
  48. {{dataDetails.driverLicenseValidityDate?dataDetails.driverLicenseValidityDate:'结束时间'}}
  49. </view>
  50. </view>
  51. <view class="flex row flex-space-between">
  52. <view class="left-text">准驾车型</view>
  53. <view class="" @click="driveType">
  54. {{dataDetails.quasiDrivingVehicle?dataDetails.quasiDrivingVehicle:'选择准驾车型>'}}
  55. </view>
  56. </view>
  57. <view class="flex row noborder">
  58. <view class="left-text">驾驶证发证机关</view>
  59. <u--input placeholder="请输入驾驶证发证机关" inputAlign='right' border="none" v-model="dataDetails.lssuingAuthority" >
  60. </u--input>
  61. </view>
  62. <!--
  63. <view class="title">上传行驶证主页</view>
  64. <view @click="uploadImg(3)" class="picture picture3" v-if="!dataDetails.drivingLicenseHomePage">
  65. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  66. <view class="text">上传行驶证主页</view>
  67. </view>
  68. <view v-if="dataDetails.drivingLicenseHomePage" @click.stop="uploadImg(1)"
  69. class="preview-card-img picture">
  70. <view @click.stop="delCard(1)">
  71. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  72. </image>
  73. </view>
  74. <image class="" :src="dataDetails.drivingLicenseHomePage" mode="aspectFit"></image>
  75. </view>
  76. <view class="title">上传行驶证副页</view>
  77. <view @click="uploadImg(4)" class="picture picture4" v-if="!dataDetails.drivingLicenseBackPage">
  78. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  79. <view class="text">上传行驶证副页</view>
  80. </view>
  81. <view v-if="dataDetails.drivingLicenseBackPage" @click.stop="uploadImg(1)"
  82. class="preview-card-img picture">
  83. <view @click.stop="delCard(1)">
  84. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  85. </image>
  86. </view>
  87. <image class="" :src="dataDetails.drivingLicenseBackPage" mode="aspectFit"></image>
  88. </view>
  89. <view class="flex row flex-space-between">
  90. <view class="left-text">行驶证档案编号</view>
  91. <u--input placeholder="输入行驶证档案编号" inputAlign='right' border="none" v-model="dataDetails.drivingLicenseNumber">
  92. </u--input>
  93. </view>
  94. <view class="flex row flex-space-between">
  95. <view class="left-text">行驶证有效期</view>
  96. <view class="" @click="selectValidityPeriod(1)">
  97. {{dataDetails.drivingLicenseValidityDate?dataDetails.drivingLicenseValidityDate:'选择有效截止日期>'}}
  98. </view>
  99. </view>
  100. <view class="" v-if="isGCar">
  101. <view class="title">挂车行驶证主页</view>
  102. <view @click="uploadImg(5)" class="picture picture5" v-if="!dataDetails.trailerLicenseHomePage">
  103. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  104. <view class="text">上传挂车行驶证主页</view>
  105. </view>
  106. <view v-if="dataDetails.trailerLicenseHomePage" @click.stop="uploadImg(1)"
  107. class="preview-card-img picture">
  108. <view @click.stop="delCard(1)">
  109. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  110. </image>
  111. </view>
  112. <image class="" :src="dataDetails.trailerLicenseHomePage" mode="aspectFit"></image>
  113. </view>
  114. </view>
  115. <view v-if="isGCar">
  116. <view class="title">挂车行驶证副页</view>
  117. <view @click="uploadImg(6)" class="picture picture6" v-if="!dataDetails.trailerLicenseBackPage">
  118. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  119. <view class="text">上传挂车行驶证副页</view>
  120. </view>
  121. <view v-if="dataDetails.trailerLicenseBackPage" @click.stop="uploadImg(1)"
  122. class="preview-card-img picture">
  123. <view @click.stop="delCard(1)">
  124. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  125. </image>
  126. </view>
  127. <image class="" :src="dataDetails.trailerLicenseBackPage" mode="aspectFit"></image>
  128. </view>
  129. </view>
  130. <view class="flex row">
  131. <view class="left-text">挂车行驶证档案编号</view>
  132. <u--input placeholder="输入挂车行驶证档案编号" inputAlign='right' border="none" v-model="dataDetails.trailerLicenseNumber">
  133. </u--input>
  134. </view>
  135. <view class="flex row flex-space-between" v-if="isGCar">
  136. <view class="left-text">挂车行驶证有效期</view>
  137. <view class="" @click="selectValidityPeriod(2)">
  138. {{dataDetails.trailerLicenseValidityDate?dataDetails.trailerLicenseValidityDate:'选择有效截止日期>'}}
  139. </view>
  140. </view>-->
  141. <view class="title">从业资格证</view>
  142. <view @click="uploadImg(7)" class="picture picture7" v-if="!dataDetails.qualificationCertificate">
  143. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  144. <view class="text">上传从业资格证</view>
  145. </view>
  146. <view v-if="dataDetails.qualificationCertificate" @click.stop="uploadImg(7)"
  147. class="preview-card-img picture">
  148. <view @click.stop="delCard(7)">
  149. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  150. </image>
  151. </view>
  152. <image class="" :src="dataDetails.qualificationCertificate" mode="aspectFit"></image>
  153. </view>
  154. <view class="flex row flex-space-between">
  155. <view class="left-text">从业资格证有效期</view>
  156. <view></view>
  157. <view class="" @click="selectValidityPeriod(3)">
  158. {{dataDetails.qualificationCertificateValidityDate?dataDetails.qualificationCertificateValidityDate:'选择有效期>'}}
  159. </view>
  160. </view>
  161. <view class="flex row ">
  162. <view class="left-text">从业资格证号</view>
  163. <u--input maxlength='19' placeholder="请输入从业资格证号" inputAlign='right' border="none" v-model="dataDetails.qualificationCertificateNumber">
  164. </u--input>
  165. </view>
  166. <!--
  167. <view class="title">道路运输证</view>
  168. <view @click="uploadImg(8)" class="picture picture8" v-if="!dataDetails.operationCertificate">
  169. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  170. <view class="text">上传道路运输证</view>
  171. </view>
  172. <view v-if="dataDetails.operationCertificate" @click.stop="uploadImg(1)"
  173. class="preview-card-img picture">
  174. <view @click.stop="delCard(1)">
  175. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  176. </image>
  177. </view>
  178. <image class="" :src="dataDetails.operationCertificate" mode="aspectFit"></image>
  179. </view>
  180. <view class="flex row">
  181. <view class="left-text">道路运输证号</view>
  182. <u--input placeholder="输入道路运输证号" inputAlign='right' border="none" v-model="dataDetails.operationCertificateNumber">
  183. </u--input>
  184. </view>
  185. <view class="flex row flex-space-between">
  186. <view class="left-text">道路运输证有效期</view>
  187. <view class="" @click="selectValidityPeriod(4)">
  188. {{dataDetails.operationCertificateValidityDate?dataDetails.operationCertificateValidityDate:'选择有效期>'}}
  189. </view>
  190. </view>
  191. <view v-if="isGCar">
  192. <view class="title">挂车道路运输证</view>
  193. <view @click="uploadImg(9)" class="picture picture9"
  194. v-if="!dataDetails.trailerOperationCertificate">
  195. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  196. <view class="text">上传挂车道路运输证</view>
  197. </view>
  198. <view v-if="dataDetails.trailerOperationCertificate" @click.stop="uploadImg(1)"
  199. class="preview-card-img picture">
  200. <view @click.stop="delCard(1)">
  201. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  202. </image>
  203. </view>
  204. <image class="" :src="dataDetails.trailerOperationCertificate" mode="aspectFit"></image>
  205. </view>
  206. </view>
  207. <view class="flex row">
  208. <view class="left-text">挂车道路运输证号</view>
  209. <u--input placeholder="输入挂车道路运输证号" inputAlign='right' border="none" v-model="dataDetails.trailerOperationCertificateNumber">
  210. </u--input>
  211. </view>
  212. <view class="flex row flex-space-between" v-if="isGCar">
  213. <view class="left-text">挂车道路运输证有效期</view>
  214. <view class="" @click="selectValidityPeriod(5)">
  215. {{dataDetails.trailerOperationCertificateValidityDate?dataDetails.trailerOperationCertificateValidityDate:'选择有效期>'}}
  216. </view>
  217. </view>
  218. -->
  219. <view class="flex row noborder">
  220. <view class="left-text">通讯地址</view>
  221. <u--textarea v-model="dataDetails.postalAddress" border="none" placeholder="输入通讯地址" autoHeight maxlength="30"></u--textarea>
  222. <!-- <u--input placeholder="输入通讯地址" inputAlign='right' border="none" v-model="dataDetails.postalAddress"></u--input> -->
  223. </view>
  224. </view>
  225. <view class="flex service align-center">
  226. <u--image @click='consent'
  227. :src="consentStatus==true?'../../static/images/mine/duihao@2x.png':'../../static/images/mine/wxz.png'"
  228. width="12px" height="12px"></u--image>
  229. 我已阅读并同意
  230. <navigator
  231. url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/userAgreement.html"
  232. class="path" hover-class="navigator-hover">《服务协议》</navigator>和<navigator
  233. url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/screctAgreement.html"
  234. class="path" hover-class="navigator-hover">《隐私政策》</navigator>
  235. </view>
  236. <u-button type="primary" @click="btnBClick">提交</u-button>
  237. <u-toast ref="uToast"></u-toast>
  238. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  239. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true"
  240. @close="isShowimgType=false">
  241. </u-action-sheet>
  242. <u-picker :show="isShowValidity" ref="uPicker" :columns="validityPeriod" @confirm="confirmValidityPeriod"
  243. :closeOnClickOverlay='true' @close='isShowValidity=false' @cancel='isShowValidity=false'>
  244. </u-picker>
  245. <u-picker :show="isShowDrive" ref="uPicker" :columns="driveList" @confirm="confirmDriveType"
  246. :closeOnClickOverlay='true' @close='isShowDrive=false' @cancel='isShowDrive=false'>
  247. </u-picker>
  248. </view>
  249. </view>
  250. </template>
  251. <script>
  252. import uploadImage from '@/components/ossutil/uploadFile.js';
  253. import permision from "@/js_sdk/wa-permission/permission.js"
  254. var _this;
  255. export default {
  256. components: {},
  257. data() {
  258. return {
  259. consentStatus: false,
  260. isGCar: true,
  261. ValidityPeriodType: '',
  262. validityPeriod: [],
  263. isShowValidity: false,
  264. isShowDrive:false,
  265. driveList:[["A2","B2"]],
  266. uploadType: '',
  267. isShowimgType: false,
  268. dataDetails: {},
  269. radiolist: [{
  270. name: '挂车司机',
  271. disabled: false
  272. },
  273. {
  274. name: '非挂车司机',
  275. disabled: false
  276. }
  277. ],
  278. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  279. radiovalue: '挂车司机',
  280. };
  281. },
  282. onLoad(options) {
  283. _this = this;
  284. console.log(options)
  285. this.get_camera_permission()
  286. if(options.data){
  287. this.dataDetails = JSON.parse(options.data)
  288. this.dataDetails.driverType = 1
  289. }
  290. this.validityPeriod = this.$helper.makeValidityPeriod('kong',1980)
  291. this.validityPeriod1 = this.$helper.makeValidityPeriod(0,1980)
  292. console.log(this.validityPeriod)
  293. },
  294. methods: {
  295. async get_camera_permission() {
  296. var photol=await permision.requestAndroidPermission("android.permission.CAMERA")
  297. if(photol == false){
  298. uni.showModal({
  299. title: '提示',
  300. content: '您已经关闭相册权限,去设置',
  301. success: function (res) {
  302. if (res.confirm) {
  303. permision.gotoAppPermissionSetting()
  304. // plus.runtime.openURL("app-settings:");
  305. } else if (res.cancel) {
  306. console.log('用户点击取消');
  307. }
  308. }
  309. });
  310. }
  311. },
  312. delCard(type) {
  313. switch (type) {
  314. case 1:
  315. _this.dataDetails.driverLicenseHomePage = ""
  316. break;
  317. case 2:
  318. _this.dataDetails.driverLicenseBackPage = ""
  319. break;
  320. case 3:
  321. _this.dataDetails.drivingLicenseHomePage = ""
  322. break;
  323. case 4:
  324. _this.dataDetails.drivingLicenseBackPage = ""
  325. break;
  326. case 5:
  327. _this.dataDetails.trailerLicenseHomePage = ""
  328. break;
  329. case 6:
  330. _this.dataDetails.trailerLicenseBackPage = ""
  331. break;
  332. case 7:
  333. _this.dataDetails.qualificationCertificate = ""
  334. break;
  335. case 8:
  336. _this.dataDetails.operationCertificate = ""
  337. break;
  338. case 9:
  339. _this.dataDetails.trailerOperationCertificate = ""
  340. break;
  341. }
  342. },
  343. consent() {
  344. this.consentStatus = !this.consentStatus
  345. // uni.setStorage({
  346. // key: 'policyStorageKey',
  347. // data: this.consentStatus
  348. // });
  349. },
  350. validate(data) {},
  351. confirmValidityPeriod(e) {
  352. console.log('confirm', e)
  353. if(e.value[0]=='长期'){
  354. if (e.value[1] || e.value[2]) {
  355. this.$refs.uToast.show({
  356. type: 'error',
  357. message: "选择长期不允许选择月日!",
  358. })
  359. return
  360. }
  361. switch (this.ValidityPeriodType) {
  362. case 0:
  363. this.dataDetails.driverLicenseValidityStartDate = e.value[0]
  364. break
  365. case 1:
  366. this.dataDetails.drivingLicenseValidityDate = e.value[0]
  367. break
  368. case 2:
  369. this.dataDetails.trailerLicenseValidityDate = e.value[0]
  370. break
  371. case 3:
  372. this.dataDetails.qualificationCertificateValidityDate = e.value[0]
  373. break
  374. case 4:
  375. this.dataDetails.operationCertificateValidityDate = e.value[0]
  376. break
  377. case 5:
  378. this.dataDetails.trailerOperationCertificateValidityDate = e.value[0]
  379. break
  380. case 9:
  381. this.dataDetails.driverLicenseValidityDate = e.value[0]
  382. break
  383. }
  384. }else{
  385. if(e.value[0]==''){
  386. this.$refs.uToast.show({
  387. type: 'error',
  388. message: "年份不能为空!",
  389. })
  390. return
  391. }else if(e.value[1]==''){
  392. this.$refs.uToast.show({
  393. type: 'error',
  394. message: "月份不能为空!",
  395. })
  396. return
  397. }else if(e.value[2]==''){
  398. this.$refs.uToast.show({
  399. type: 'error',
  400. message: "日期不能为空!",
  401. })
  402. return
  403. }
  404. var date=new Date()
  405. var text=''
  406. switch (this.ValidityPeriodType) {
  407. case 3:
  408. text='从业资格证已过期!'
  409. break
  410. case 9:
  411. text='驾驶证已过期!'
  412. break
  413. }
  414. if(this.ValidityPeriodType==3||this.ValidityPeriodType==9){
  415. if(e.value[0]<date.getFullYear()){
  416. this.$refs.uToast.show({
  417. type: 'error',
  418. message: text,
  419. })
  420. return
  421. }
  422. if(e.value[0]==date.getFullYear()&&Number(e.value[1])<(date.getMonth()+1)){
  423. this.$refs.uToast.show({
  424. type: 'error',
  425. message: text,
  426. })
  427. return
  428. }
  429. if(e.value[0]==date.getFullYear()&&Number(e.value[1])==(date.getMonth()+1)&&Number(e.value[2])<=(date.getDate())){
  430. this.$refs.uToast.show({
  431. type: 'error',
  432. message: text,
  433. })
  434. return
  435. }
  436. }
  437. switch (this.ValidityPeriodType) {
  438. case 0:
  439. this.dataDetails.driverLicenseValidityStartDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  440. break
  441. case 1:
  442. this.dataDetails.drivingLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  443. break
  444. case 2:
  445. this.dataDetails.trailerLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  446. break
  447. case 3:
  448. this.dataDetails.qualificationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  449. .value[2]
  450. break
  451. case 4:
  452. this.dataDetails.operationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[
  453. 2]
  454. break
  455. case 5:
  456. this.dataDetails.trailerOperationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  457. .value[2]
  458. break
  459. case 9:
  460. this.dataDetails.driverLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  461. .value[2]
  462. break
  463. }
  464. }
  465. this.isShowValidity = false
  466. },
  467. selectValidityPeriod(type) {
  468. this.ValidityPeriodType = type
  469. this.isShowValidity = true
  470. },
  471. driveType(){
  472. this.isShowDrive = true
  473. },
  474. confirmDriveType(e){
  475. this.dataDetails.quasiDrivingVehicle = e.value[0]
  476. this.isShowDrive = false
  477. },
  478. // 上传图片
  479. imgTypeSelect(val) {
  480. // console.log(val)
  481. console.log(this.uploadType)
  482. // if (val.name == '相册') {
  483. uni.chooseImage({
  484. count: 1,
  485. // sourceType: this.$helper.chooseImage.sourceType,
  486. success: function(res) {
  487. console.log(JSON.stringify(res.tempFilePaths));
  488. uploadImage("images",res.tempFilePaths[0], 'appData/',
  489. result => {
  490. // 上传成功回调函数
  491. console.log('图片地址-----', result)
  492. switch (_this.uploadType) {
  493. case 1:
  494. _this.dataDetails.driverLicenseHomePage = result
  495. _this.$request.baseRequest('get',
  496. '/driverInfo/api/driverLicenseShibie', {
  497. image: result
  498. }).then(res => {
  499. if (res.data) {
  500. let date = res.data.driverEndDate.substr(0,4)+"-"+res.data.driverEndDate.substr(4,2)+"-"+res.data.driverEndDate.substr(6,2)
  501. _this.dataDetails.driverLicenseValidityDate = date
  502. if(res.data.allowCar == 'A2' || res.data.allowCar == 'B2'){
  503. _this.dataDetails.quasiDrivingVehicle = res.data.allowCar
  504. }
  505. _this.dataDetails.lssuingAuthority = res.data.issuingAuthority
  506. _this.$forceUpdate()
  507. }
  508. })
  509. .catch(res => {
  510. uni.$u.toast(res.message);
  511. });
  512. break;
  513. case 2:
  514. _this.dataDetails.driverLicenseBackPage = result
  515. break;
  516. case 3:
  517. _this.dataDetails.drivingLicenseHomePage = result
  518. break;
  519. case 4:
  520. _this.dataDetails.drivingLicenseBackPage = result
  521. break;
  522. case 5:
  523. _this.dataDetails.trailerLicenseHomePage = result
  524. break;
  525. case 6:
  526. _this.dataDetails.trailerLicenseBackPage = result
  527. break;
  528. case 7:
  529. _this.dataDetails.qualificationCertificate = result
  530. _this.$request.baseRequest('get',
  531. '/driverInfo/api/qualificationLicenseShibie', {
  532. image: result
  533. }).then(res => {
  534. if (res.data&&res.data.qualificationCertificate) {
  535. _this.dataDetails.qualificationCertificateValidityDate = res.data.qualificationCertificate
  536. // _this.dataDetails.driverLicenseValidityDate =
  537. // res.data.driverEndDate
  538. }
  539. if(res.data&&res.data.qualificationCertificateNum){
  540. _this.dataDetails.qualificationCertificateNumber = res.data.qualificationCertificateNum
  541. }
  542. _this.$forceUpdate()
  543. })
  544. .catch(res => {
  545. uni.$u.toast(res.message);
  546. });
  547. break;
  548. case 8:
  549. _this.dataDetails.operationCertificate = result
  550. break;
  551. case 9:
  552. _this.dataDetails.trailerOperationCertificate = result
  553. break;
  554. }
  555. _this.$forceUpdate()
  556. }
  557. )
  558. }
  559. });
  560. // } else {
  561. // }
  562. },
  563. uploadImg(type) {
  564. this.uploadType = type
  565. this.imgTypeSelect()
  566. // this.isShowimgType = true
  567. },
  568. validate() {
  569. // true 为校验不通过
  570. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
  571. this.$refs.uToast.show({
  572. type: 'error',
  573. message: "驾驶证主页不能为空!",
  574. })
  575. return true
  576. }
  577. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
  578. this.$refs.uToast.show({
  579. type: 'error',
  580. message: "驾驶证副页不能为空!",
  581. })
  582. return true
  583. }
  584. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseValidityDate)) {
  585. this.$refs.uToast.show({
  586. type: 'error',
  587. message: "驾驶证有效期不能为空!",
  588. })
  589. return true
  590. }
  591. if (uni.$u.test.isEmpty(this.dataDetails.quasiDrivingVehicle)) {
  592. this.$refs.uToast.show({
  593. type: 'error',
  594. message: "准驾车型不能为空!",
  595. })
  596. return true
  597. }
  598. if (uni.$u.test.isEmpty(this.dataDetails.lssuingAuthority)) {
  599. this.$refs.uToast.show({
  600. type: 'error',
  601. message: "驾驶证发证机关不能为空!",
  602. })
  603. return true
  604. }
  605. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseHomePage)) {
  606. // this.$refs.uToast.show({
  607. // type: 'error',
  608. // message: "行驶证主页不能为空!",
  609. // })
  610. // return true
  611. // }
  612. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseBackPage)) {
  613. // this.$refs.uToast.show({
  614. // type: 'error',
  615. // message: "行驶证副页不能为空!",
  616. // })
  617. // return true
  618. // }
  619. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseValidityDate)) {
  620. // this.$refs.uToast.show({
  621. // type: 'error',
  622. // message: "行驶证有效期不能为空!",
  623. // })
  624. // return true
  625. // }
  626. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseNumber)) {
  627. // this.$refs.uToast.show({
  628. // type: 'error',
  629. // message: "行驶证档案编号不能为空!",
  630. // })
  631. // return true
  632. // }
  633. // if(this.radiovalue=='挂车司机'){
  634. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
  635. // this.$refs.uToast.show({
  636. // type: 'error',
  637. // message: "挂车行驶证主页不能为空!",
  638. // })
  639. // return true
  640. // }
  641. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  642. // this.$refs.uToast.show({
  643. // type: 'error',
  644. // message: "挂车行驶证副页不能为空!",
  645. // })
  646. // return true
  647. // }
  648. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
  649. // this.$refs.uToast.show({
  650. // type: 'error',
  651. // message: "挂车行驶证档案编号不能为空!",
  652. // })
  653. // return true
  654. // }
  655. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
  656. // this.$refs.uToast.show({
  657. // type: 'error',
  658. // message: "挂车行驶证有效期不能为空!",
  659. // })
  660. // return true
  661. // }
  662. // }
  663. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  664. // this.$refs.uToast.show({
  665. // type: 'error',
  666. // message: "行驶证副页不能为空!",
  667. // })
  668. // return true
  669. // }
  670. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificate)) {
  671. this.$refs.uToast.show({
  672. type: 'error',
  673. message: "从业资格证不能为空!",
  674. })
  675. return true
  676. }
  677. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateValidityDate)) {
  678. this.$refs.uToast.show({
  679. type: 'error',
  680. message: "从业资格证有效期不能为空!",
  681. })
  682. return true
  683. }
  684. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateNumber)) {
  685. this.$refs.uToast.show({
  686. type: 'error',
  687. message: "从业资格证号不能为空!",
  688. })
  689. return true
  690. }
  691. // if (!uni.$u.test.rangeLength(this.dataDetails.qualificationCertificateNumber,[12,19])) {
  692. // this.$refs.uToast.show({
  693. // type: 'error',
  694. // message: "从业资格证号输入错误!",
  695. // })
  696. // return true
  697. // }
  698. if (this.dataDetails.qualificationCertificateNumber.length!=19) {
  699. this.$refs.uToast.show({
  700. type: 'error',
  701. message: "从业资格证号输入错误!",
  702. })
  703. return true
  704. }
  705. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificate)) {
  706. // this.$refs.uToast.show({
  707. // type: 'error',
  708. // message: "道路运输证不能为空!",
  709. // })
  710. // return true
  711. // }
  712. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateNumber)) {
  713. // this.$refs.uToast.show({
  714. // type: 'error',
  715. // message: "道路运输证号不能为空!",
  716. // })
  717. // return true
  718. // }
  719. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateValidityDate)) {
  720. // this.$refs.uToast.show({
  721. // type: 'error',
  722. // message: "道路运输证有效期不能为空!",
  723. // })
  724. // return true
  725. // }
  726. // if(this.radiovalue=='挂车司机'){
  727. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
  728. // this.$refs.uToast.show({
  729. // type: 'error',
  730. // message: "挂车道路运输证不能为空!",
  731. // })
  732. // return true
  733. // }
  734. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
  735. // this.$refs.uToast.show({
  736. // type: 'error',
  737. // message: "挂车道路运输证号不能为空!",
  738. // })
  739. // return true
  740. // }
  741. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
  742. // this.$refs.uToast.show({
  743. // type: 'error',
  744. // message: "挂车道路运输证有效期不能为空!",
  745. // })
  746. // return true
  747. // }
  748. // }
  749. if (uni.$u.test.isEmpty(this.dataDetails.postalAddress)) {
  750. this.$refs.uToast.show({
  751. type: 'error',
  752. message: "通讯地址不能为空!",
  753. })
  754. return true
  755. }
  756. return false
  757. },
  758. btnBClick() {
  759. // 此处用法为在js中调用,需要写uni.$u.throttle()
  760. uni.$u.throttle(this.submit(), 5000)
  761. },
  762. submit() {
  763. // 校验
  764. if (this.validate()) return
  765. // if(this.dataDetails.driverSex=='男'){
  766. // this.dataDetails.driverCall = this.dataDetails.driverCall+'先生'
  767. // }else{
  768. // this.dataDetails.driverCall = this.dataDetails.driverCall+'女士'
  769. // }
  770. if(!this.consentStatus){
  771. this.$refs.uToast.show({
  772. type: 'error',
  773. message: "请勾选协议!",
  774. })
  775. return
  776. }
  777. //账号传
  778. this.dataDetails.accountNumber = uni.getStorageSync("userInfo").phone
  779. uni.showLoading({
  780. mask: true,
  781. title: '加载中'
  782. })
  783. this.$request.baseRequest('post', '/driverInfo/api/addInfo', this.dataDetails).then(res => {
  784. if(res.code==200){
  785. uni.hideLoading()
  786. this.$refs.uToast.show({
  787. type: 'success',
  788. message: "提交成功,待平台审核!",
  789. complete() {
  790. uni.switchTab({
  791. url: '/pages/mine/index'
  792. })
  793. }
  794. })
  795. // uni.$u.route('/pages/mine/index');
  796. }else{
  797. uni.hideLoading()
  798. uni.$u.toast(res.message);
  799. }
  800. })
  801. .catch(res => {
  802. uni.hideLoading()
  803. uni.$u.toast(res.message);
  804. });
  805. },
  806. radioChange(n) {
  807. if (n == '挂车司机') {
  808. this.isGCar = true
  809. this.dataDetails.driverType = 1
  810. } else {
  811. this.dataDetails.driverType = 2
  812. this.isGCar = false
  813. }
  814. },
  815. //设置图片
  816. setImage(e) {
  817. console.log(e);
  818. //显示在页面
  819. //this.imagesrc = e.path;
  820. // if (e.dotype == 'idphoto') {
  821. // _this.zjzClipper(e.path);
  822. // } else if (e.dotype == 'watermark') {
  823. // _this.watermark(e.path);
  824. // } else {
  825. // _this.savePhoto(e.path);
  826. // }
  827. },
  828. }
  829. };
  830. </script>
  831. <style scoped lang="scss">
  832. .u-radio {
  833. margin-bottom: 0px !important;
  834. }
  835. .row4-img {
  836. width: 32rpx;
  837. height: 32rpx;
  838. }
  839. .preview {
  840. width: 100%;
  841. height: 100px;
  842. }
  843. .top-head {
  844. background: #2772FB;
  845. height: 80rpx;
  846. width: 100%;
  847. }
  848. .container {
  849. background: white;
  850. position: relative;
  851. top: -60rpx;
  852. margin: 0 20rpx;
  853. padding: 20rpx;
  854. box-sizing: border-box;
  855. border-radius: 10rpx;
  856. }
  857. .radio-group {
  858. display: flex;
  859. align-items: center;
  860. }
  861. .level1-title {
  862. margin: 20rpx 0;
  863. border-bottom: 1px solid #EEEEEE;
  864. padding-bottom: 30rpx;
  865. }
  866. .content1 {
  867. .row {
  868. border-bottom: 1px solid #EEEEEE;
  869. padding-bottom: 28rpx;
  870. margin-top: 26rpx;
  871. }
  872. .left-text {
  873. // background: red;
  874. width: 320rpx;
  875. color: #333333;
  876. display: flex;
  877. align-items: center;
  878. }
  879. .picture {
  880. position: relative;
  881. width: 100%;
  882. height: 440rpx;
  883. display: flex;
  884. justify-content: center;
  885. flex-direction: column;
  886. align-items: center;
  887. .text {
  888. margin-top: 20rpx;
  889. }
  890. }
  891. .picture1 {
  892. background: url(../../static/images/mine/jzz.png);
  893. background-size: 100% 100%;
  894. }
  895. .picture2 {
  896. background: url(../../static/images/mine/jzf.png);
  897. background-size: 100% 100%;
  898. }
  899. .picture3 {
  900. background: url(../../static/images/mine/xsz.png);
  901. background-size: 100% 100%;
  902. }
  903. .picture4 {
  904. background: url(../../static/images/mine/xsf.png);
  905. background-size: 100% 100%;
  906. }
  907. .picture5 {
  908. background: url(../../static/images/mine/gcxsz.png);
  909. background-size: 100% 100%;
  910. }
  911. .picture6 {
  912. background: url(../../static/images/mine/gcxsf.png);
  913. background-size: 100% 100%;
  914. }
  915. .picture7 {
  916. background: url(../../static/images/mine/cy.png);
  917. background-size: 100% 100%;
  918. }
  919. .picture8 {
  920. background: url(../../static/images/mine/cy.png);
  921. background-size: 100% 100%;
  922. }
  923. .picture9 {
  924. background: url(../../static/images/mine/cy.png);
  925. background-size: 100% 100%;
  926. }
  927. .xj-image {
  928. width: 100rpx;
  929. height: 100rpx;
  930. }
  931. .title {
  932. color: #999999;
  933. margin: 20rpx 0;
  934. }
  935. }
  936. .service {
  937. font-size: 24rpx;
  938. margin: 20rpx;
  939. justify-content: center;
  940. /deep/.u-image {
  941. margin: 0 20rpx;
  942. }
  943. }
  944. .del-card {
  945. position: absolute;
  946. top: -10rpx;
  947. right: -6rpx;
  948. width: 80rpx;
  949. height: 80rpx;
  950. z-index: 9;
  951. }
  952. .path{
  953. color: #2772FB;
  954. }
  955. /deep/.u-textarea{
  956. padding:9px 0;
  957. }
  958. /deep/.u-textarea__field{
  959. color:#000;
  960. text-align:right;
  961. }
  962. </style>