editDriverCertificationNext.vue 31 KB

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