editDriverCertificationNext.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888
  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
  394. .qualificationCertificateValidityDate = res
  395. .data.qualificationCertificate
  396. }
  397. if (res.data && res.data.qualificationCertificateNum) {
  398. _this.dataDetails.qualificationCertificateNumber =
  399. res.data.qualificationCertificateNum.replace(
  400. /\s*/g, "")
  401. }
  402. _this.$forceUpdate()
  403. })
  404. .catch(res => {
  405. uni.$u.toast(res.message);
  406. });
  407. break;
  408. case 8:
  409. _this.dataDetails.operationCertificate = result
  410. break;
  411. case 9:
  412. _this.dataDetails.trailerOperationCertificate = result
  413. break;
  414. case 10:
  415. _this.$set(_this.dataDetails,'selfPhoto',result)
  416. break;
  417. }
  418. }
  419. )
  420. }
  421. });
  422. // } else {
  423. // }
  424. },
  425. uploadImg(type) {
  426. this.uploadType = type
  427. // this.isShowimgType = true
  428. this.imgTypeSelect()
  429. },
  430. validate() {
  431. // true 为校验不通过
  432. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
  433. this.$refs.uToast.show({
  434. type: 'error',
  435. message: "驾驶证主页不能为空!",
  436. })
  437. return true
  438. }
  439. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
  440. this.$refs.uToast.show({
  441. type: 'error',
  442. message: "驾驶证副页不能为空!",
  443. })
  444. return true
  445. }
  446. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseValidityDate)) {
  447. this.$refs.uToast.show({
  448. type: 'error',
  449. message: "驾驶证有效期不能为空!",
  450. })
  451. return true
  452. }
  453. if (uni.$u.test.isEmpty(this.dataDetails.quasiDrivingVehicle)) {
  454. this.$refs.uToast.show({
  455. type: 'error',
  456. message: "准驾车型不能为空!",
  457. })
  458. return true
  459. }
  460. if (uni.$u.test.isEmpty(this.dataDetails.lssuingAuthority)) {
  461. this.$refs.uToast.show({
  462. type: 'error',
  463. message: "驾驶证发证机关不能为空!",
  464. })
  465. return true
  466. }
  467. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseHomePage)) {
  468. // this.$refs.uToast.show({
  469. // type: 'error',
  470. // message: "行驶证主页不能为空!",
  471. // })
  472. // return true
  473. // }
  474. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseBackPage)) {
  475. // this.$refs.uToast.show({
  476. // type: 'error',
  477. // message: "行驶证副页不能为空!",
  478. // })
  479. // return true
  480. // }
  481. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseValidityDate)) {
  482. // this.$refs.uToast.show({
  483. // type: 'error',
  484. // message: "行驶证有效期不能为空!",
  485. // })
  486. // return true
  487. // }
  488. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseNumber)) {
  489. // this.$refs.uToast.show({
  490. // type: 'error',
  491. // message: "行驶证档案编号不能为空!",
  492. // })
  493. // return true
  494. // }
  495. // if(this.radiovalue=='挂车司机'){
  496. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
  497. // this.$refs.uToast.show({
  498. // type: 'error',
  499. // message: "挂车行驶证主页不能为空!",
  500. // })
  501. // return true
  502. // }
  503. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  504. // this.$refs.uToast.show({
  505. // type: 'error',
  506. // message: "挂车行驶证副页不能为空!",
  507. // })
  508. // return true
  509. // }
  510. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
  511. // this.$refs.uToast.show({
  512. // type: 'error',
  513. // message: "挂车行驶证档案编号不能为空!",
  514. // })
  515. // return true
  516. // }
  517. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
  518. // this.$refs.uToast.show({
  519. // type: 'error',
  520. // message: "挂车行驶证有效期不能为空!",
  521. // })
  522. // return true
  523. // }
  524. // }
  525. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  526. // this.$refs.uToast.show({
  527. // type: 'error',
  528. // message: "行驶证副页不能为空!",
  529. // })
  530. // return true
  531. // }
  532. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificate)) {
  533. this.$refs.uToast.show({
  534. type: 'error',
  535. message: "从业资格证不能为空!",
  536. })
  537. return true
  538. }
  539. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateValidityDate)) {
  540. this.$refs.uToast.show({
  541. type: 'error',
  542. message: "从业资格证有效期不能为空!",
  543. })
  544. return true
  545. }
  546. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateNumber)) {
  547. this.$refs.uToast.show({
  548. type: 'error',
  549. message: "从业资格证号不能为空!",
  550. })
  551. return true
  552. }
  553. // if (!uni.$u.test.rangeLength(this.dataDetails.qualificationCertificateNumber,[12,19])) {
  554. // this.$refs.uToast.show({
  555. // type: 'error',
  556. // message: "从业资格证号输入错误!",
  557. // })
  558. // return true
  559. // }
  560. // if (this.dataDetails.qualificationCertificateNumber.length>19||this.dataDetails.qualificationCertificateNumber.length<18) {
  561. // this.$refs.uToast.show({
  562. // type: 'error',
  563. // message: "从业资格证号输入错误!",
  564. // })
  565. // return true
  566. // }
  567. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificate)) {
  568. // this.$refs.uToast.show({
  569. // type: 'error',
  570. // message: "道路运输证不能为空!",
  571. // })
  572. // return true
  573. // }
  574. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateNumber)) {
  575. // this.$refs.uToast.show({
  576. // type: 'error',
  577. // message: "道路运输证号不能为空!",
  578. // })
  579. // return true
  580. // }
  581. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateValidityDate)) {
  582. // this.$refs.uToast.show({
  583. // type: 'error',
  584. // message: "道路运输证有效期不能为空!",
  585. // })
  586. // return true
  587. // }
  588. // if(this.radiovalue=='挂车司机'){
  589. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
  590. // this.$refs.uToast.show({
  591. // type: 'error',
  592. // message: "挂车道路运输证不能为空!",
  593. // })
  594. // return true
  595. // }
  596. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
  597. // this.$refs.uToast.show({
  598. // type: 'error',
  599. // message: "挂车道路运输证号不能为空!",
  600. // })
  601. // return true
  602. // }
  603. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
  604. // this.$refs.uToast.show({
  605. // type: 'error',
  606. // message: "挂车道路运输证有效期不能为空!",
  607. // })
  608. // return true
  609. // }
  610. // }.
  611. if (uni.$u.test.isEmpty(this.dataDetails.actualCarrierBusinessLicense)) {
  612. this.$refs.uToast.show({
  613. type: 'error',
  614. message: "道路运输经营许可证号不能为空!",
  615. })
  616. return true
  617. }
  618. if (uni.$u.test.isEmpty(this.dataDetails.postalAddress)) {
  619. this.$refs.uToast.show({
  620. type: 'error',
  621. message: "通讯地址不能为空!",
  622. })
  623. return true
  624. }
  625. return false
  626. },
  627. delSubmitObj() {
  628. delete this.dataDetails.authenticationStatus
  629. delete this.dataDetails.authenticationStatusKey
  630. delete this.dataDetails.compId
  631. delete this.dataDetails.createDate
  632. delete this.dataDetails.createUserId
  633. delete this.dataDetails.deleteFlag
  634. delete this.dataDetails.driverCarInfoList
  635. delete this.dataDetails.driverPayeeInfoList
  636. delete this.dataDetails.firstFlag
  637. delete this.dataDetails.updateDate
  638. },
  639. btnBClick() {
  640. // 此处用法为在js中调用,需要写uni.$u.throttle()
  641. uni.$u.throttle(this.submit(), 1000)
  642. },
  643. submit() {
  644. if (!this.consentStatus) {
  645. uni.showToast({
  646. title: '请勾选协议',
  647. icon: 'none',
  648. duration: 2000
  649. })
  650. return
  651. }
  652. // 校验
  653. if (this.validate()) return
  654. this.delSubmitObj()
  655. this.dataDetails.accountNumber = uni.getStorageSync("userInfo").phone
  656. uni.showLoading({
  657. mask: true,
  658. title: '加载中'
  659. })
  660. this.$request.baseRequest('post', '/driverInfo/api/editInfo', this.dataDetails).then(res => {
  661. if (res.code == 200) {
  662. uni.hideLoading()
  663. this.$refs.uToast.show({
  664. type: 'success',
  665. message: "提交成功,待平台审核!",
  666. complete() {
  667. uni.switchTab({
  668. url: '/pages/mine/index'
  669. })
  670. }
  671. })
  672. } else {
  673. uni.hideLoading()
  674. uni.$u.toast(res.message);
  675. }
  676. })
  677. .catch(res => {
  678. uni.hideLoading()
  679. uni.$u.toast(res.message);
  680. });
  681. },
  682. radioChange(n) {
  683. console.log('radioChange', n);
  684. if (n == '挂车司机') {
  685. this.isGCar = true
  686. this.dataDetails.driverType = 1
  687. } else {
  688. this.dataDetails.driverType = 2
  689. this.isGCar = false
  690. }
  691. },
  692. //设置图片
  693. setImage(e) {
  694. console.log(e);
  695. //显示在页面
  696. //this.imagesrc = e.path;
  697. // if (e.dotype == 'idphoto') {
  698. // _this.zjzClipper(e.path);
  699. // } else if (e.dotype == 'watermark') {
  700. // _this.watermark(e.path);
  701. // } else {
  702. // _this.savePhoto(e.path);
  703. // }
  704. },
  705. }
  706. };
  707. </script>
  708. <style scoped lang="scss">
  709. .u-radio {
  710. margin-bottom: 0px !important;
  711. }
  712. .row4-img {
  713. width: 32rpx;
  714. height: 32rpx;
  715. }
  716. .preview {
  717. width: 100%;
  718. height: 100px;
  719. }
  720. .top-head {
  721. background: #F5BA3C;
  722. height: 80rpx;
  723. width: 100%;
  724. }
  725. .container {
  726. background: white;
  727. position: relative;
  728. top: -60rpx;
  729. margin: 0 20rpx;
  730. padding: 20rpx;
  731. box-sizing: border-box;
  732. border-radius: 10rpx;
  733. }
  734. .radio-group {
  735. display: flex;
  736. align-items: center;
  737. // justify-content: space-between;
  738. }
  739. .level1-title {
  740. margin: 20rpx 0;
  741. border-bottom: 1px solid #EEEEEE;
  742. padding-bottom: 30rpx;
  743. }
  744. .content1 {
  745. .row {
  746. border-bottom: 1px solid #EEEEEE;
  747. padding-bottom: 28rpx;
  748. margin-top: 26rpx;
  749. }
  750. .left-text {
  751. // background: red;
  752. width: 320rpx;
  753. color: #333333;
  754. display: flex;
  755. align-items: center;
  756. }
  757. .picture {
  758. position: relative;
  759. width: 100%;
  760. height: 440rpx;
  761. display: flex;
  762. justify-content: center;
  763. flex-direction: column;
  764. align-items: center;
  765. .text {
  766. margin-top: 20rpx;
  767. }
  768. }
  769. .picture1 {
  770. background: url(../../static/images/mine/jzz.png);
  771. background-size: 100% 100%;
  772. }
  773. .picture2 {
  774. background: url(../../static/images/mine/jzf.png);
  775. background-size: 100% 100%;
  776. }
  777. .picture3 {
  778. background: url(../../static/images/mine/xsz.png);
  779. background-size: 100% 100%;
  780. }
  781. .picture4 {
  782. background: url(../../static/images/mine/xsf.png);
  783. background-size: 100% 100%;
  784. }
  785. .picture5 {
  786. background: url(../../static/images/mine/gcxsz.png);
  787. background-size: 100% 100%;
  788. }
  789. .picture6 {
  790. background: url(../../static/images/mine/gcxsf.png);
  791. background-size: 100% 100%;
  792. }
  793. .picture7 {
  794. background: url(../../static/images/mine/cy.png);
  795. background-size: 100% 100%;
  796. }
  797. .picture8 {
  798. background: url(../../static/images/mine/cy.png);
  799. background-size: 100% 100%;
  800. }
  801. .picture9 {
  802. background: url(../../static/images/mine/cy.png);
  803. background-size: 100% 100%;
  804. }
  805. .xj-image {
  806. width: 100rpx;
  807. height: 100rpx;
  808. }
  809. .title {
  810. color: #999999;
  811. margin: 20rpx 0;
  812. }
  813. }
  814. .service {
  815. font-size: 24rpx;
  816. margin: 20rpx;
  817. justify-content: center;
  818. /deep/.u-image {
  819. margin: 0 20rpx;
  820. }
  821. }
  822. .del-card {
  823. position: absolute;
  824. top: -10rpx;
  825. right: -6rpx;
  826. width: 80rpx;
  827. height: 80rpx;
  828. z-index: 9;
  829. }
  830. .path {
  831. color: #F5BA3C;
  832. }
  833. .btn-color {}
  834. /deep/.uni-input-input:disabled {
  835. background: #fff;
  836. }
  837. /deep/.u-textarea {
  838. padding: 9px 0;
  839. }
  840. /deep/.u-textarea__field {
  841. color: #000;
  842. text-align: right;
  843. }
  844. </style>