editDriverCertificationNext.vue 30 KB

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