editDriverCertificationNext.vue 25 KB

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