editDriverCertificationNext.vue 31 KB

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