editDriverCertificationNext.vue 26 KB

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