editDriverCertificationNext.vue 26 KB

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