editDriverCertificationNext.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020
  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. confirmValidityPeriod(e) {
  356. console.log('confirm', e)
  357. if(e.value[0]=='长期'){
  358. if (e.value[1] || e.value[2]) {
  359. this.$refs.uToast.show({
  360. type: 'error',
  361. message: "选择长期不允许选择月日!",
  362. })
  363. return
  364. }
  365. switch (this.ValidityPeriodType) {
  366. case 0:
  367. this.dataDetails.driverLicenseValidityStartDate = e.value[0]
  368. break
  369. case 1:
  370. this.dataDetails.drivingLicenseValidityDate = e.value[0]
  371. break
  372. case 2:
  373. this.dataDetails.trailerLicenseValidityDate = e.value[0]
  374. break
  375. case 3:
  376. this.dataDetails.qualificationCertificateValidityDate = e.value[0]
  377. break
  378. case 4:
  379. this.dataDetails.operationCertificateValidityDate = e.value[0]
  380. break
  381. case 5:
  382. this.dataDetails.trailerOperationCertificateValidityDate = e.value[0]
  383. break
  384. case 9:
  385. this.dataDetails.driverLicenseValidityDate = e.value[0]
  386. break
  387. }
  388. }else{
  389. if(e.value[0]==''){
  390. this.$refs.uToast.show({
  391. type: 'error',
  392. message: "年份不能为空!",
  393. })
  394. return
  395. }else if(e.value[1]==''){
  396. this.$refs.uToast.show({
  397. type: 'error',
  398. message: "月份不能为空!",
  399. })
  400. return
  401. }else if(e.value[2]==''){
  402. this.$refs.uToast.show({
  403. type: 'error',
  404. message: "日期不能为空!",
  405. })
  406. return
  407. }
  408. var date=new Date()
  409. var text=''
  410. switch (this.ValidityPeriodType) {
  411. case 3:
  412. text='从业资格证已过期!'
  413. break
  414. case 9:
  415. text='驾驶证已过期!'
  416. break
  417. }
  418. if(this.ValidityPeriodType==3||this.ValidityPeriodType==9){
  419. if(e.value[0]<date.getFullYear()){
  420. this.$refs.uToast.show({
  421. type: 'error',
  422. message: text,
  423. })
  424. return
  425. }
  426. if(e.value[0]==date.getFullYear()&&Number(e.value[1])<(date.getMonth()+1)){
  427. this.$refs.uToast.show({
  428. type: 'error',
  429. message: text,
  430. })
  431. return
  432. }
  433. if(e.value[0]==date.getFullYear()&&Number(e.value[1])==(date.getMonth()+1)&&Number(e.value[2])<=(date.getDate())){
  434. this.$refs.uToast.show({
  435. type: 'error',
  436. message: text,
  437. })
  438. return
  439. }
  440. }
  441. switch (this.ValidityPeriodType) {
  442. case 0:
  443. this.dataDetails.driverLicenseValidityStartDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  444. break
  445. case 1:
  446. this.dataDetails.drivingLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  447. break
  448. case 2:
  449. this.dataDetails.trailerLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  450. break
  451. case 3:
  452. this.dataDetails.qualificationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  453. .value[2]
  454. break
  455. case 4:
  456. this.dataDetails.operationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[
  457. 2]
  458. break
  459. case 5:
  460. this.dataDetails.trailerOperationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  461. .value[2]
  462. break
  463. case 9:
  464. this.dataDetails.driverLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  465. .value[2]
  466. break
  467. }
  468. }
  469. this.isShowValidity = false
  470. },
  471. selectValidityPeriod(type) {
  472. this.ValidityPeriodType = type
  473. this.isShowValidity = true
  474. },
  475. driveType(){
  476. this.isShowDrive = true
  477. },
  478. confirmDriveType(e){
  479. this.dataDetails.quasiDrivingVehicle = e.value[0]
  480. this.isShowDrive = false
  481. },
  482. // 上传图片
  483. imgTypeSelect() {
  484. // if (val.name == '相册') {
  485. uni.chooseImage({
  486. count: 1,
  487. // sourceType: this.$helper.chooseImage.sourceType,
  488. success: function(res) {
  489. console.log(JSON.stringify(res.tempFilePaths));
  490. uploadImage('image', res.tempFilePaths[0], 'appData/',
  491. result => {
  492. // 上传成功回调函数
  493. console.log('图片地址-----', result)
  494. switch (_this.uploadType) {
  495. case 1:
  496. _this.dataDetails.driverLicenseHomePage = result
  497. _this.$request.baseRequest('get',
  498. '/driverInfo/api/driverLicenseShibie', {
  499. image: result
  500. }).then(res => {
  501. if (res.data) {
  502. let date = res.data.driverEndDate.substr(0,4)+"-"+res.data.driverEndDate.substr(4,2)+"-"+res.data.driverEndDate.substr(6,2)
  503. _this.dataDetails.driverLicenseValidityDate = date
  504. if(res.data.allowCar == 'A2' || res.data.allowCar == 'B2'){
  505. _this.dataDetails.quasiDrivingVehicle = res.data.allowCar
  506. }
  507. _this.dataDetails.lssuingAuthority = res.data.issuingAuthority
  508. _this.$forceUpdate()
  509. }
  510. })
  511. .catch(res => {
  512. uni.$u.toast(res.message);
  513. });
  514. break;
  515. case 2:
  516. _this.dataDetails.driverLicenseBackPage = result
  517. break;
  518. case 3:
  519. _this.dataDetails.drivingLicenseHomePage = result
  520. break;
  521. case 4:
  522. _this.dataDetails.drivingLicenseBackPage = result
  523. break;
  524. case 5:
  525. _this.dataDetails.trailerLicenseHomePage = result
  526. break;
  527. case 6:
  528. _this.dataDetails.trailerLicenseBackPage = result
  529. break;
  530. case 7:
  531. _this.dataDetails.qualificationCertificate = result
  532. _this.$request.baseRequest('get',
  533. '/driverInfo/api/qualificationLicenseShibie', {
  534. image: result
  535. }).then(res => {
  536. if (res.data&&res.data.qualificationCertificate) {
  537. _this.dataDetails.qualificationCertificateValidityDate = res.data.qualificationCertificate
  538. }
  539. if(res.data&&res.data.qualificationCertificateNum){
  540. _this.dataDetails.qualificationCertificateNumber = res.data.qualificationCertificateNum
  541. }
  542. _this.$forceUpdate()
  543. })
  544. .catch(res => {
  545. uni.$u.toast(res.message);
  546. });
  547. break;
  548. case 8:
  549. _this.dataDetails.operationCertificate = result
  550. break;
  551. case 9:
  552. _this.dataDetails.trailerOperationCertificate = result
  553. break;
  554. }
  555. }
  556. )
  557. }
  558. });
  559. // } else {
  560. // }
  561. },
  562. uploadImg(type) {
  563. this.uploadType = type
  564. // this.isShowimgType = true
  565. this.imgTypeSelect()
  566. },
  567. validate() {
  568. // true 为校验不通过
  569. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
  570. this.$refs.uToast.show({
  571. type: 'error',
  572. message: "驾驶证主页不能为空!",
  573. })
  574. return true
  575. }
  576. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
  577. this.$refs.uToast.show({
  578. type: 'error',
  579. message: "驾驶证副页不能为空!",
  580. })
  581. return true
  582. }
  583. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseValidityDate)) {
  584. this.$refs.uToast.show({
  585. type: 'error',
  586. message: "驾驶证有效期不能为空!",
  587. })
  588. return true
  589. }
  590. if (uni.$u.test.isEmpty(this.dataDetails.quasiDrivingVehicle)) {
  591. this.$refs.uToast.show({
  592. type: 'error',
  593. message: "准驾车型不能为空!",
  594. })
  595. return true
  596. }
  597. if (uni.$u.test.isEmpty(this.dataDetails.lssuingAuthority)) {
  598. this.$refs.uToast.show({
  599. type: 'error',
  600. message: "驾驶证发证机关不能为空!",
  601. })
  602. return true
  603. }
  604. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseHomePage)) {
  605. // this.$refs.uToast.show({
  606. // type: 'error',
  607. // message: "行驶证主页不能为空!",
  608. // })
  609. // return true
  610. // }
  611. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseBackPage)) {
  612. // this.$refs.uToast.show({
  613. // type: 'error',
  614. // message: "行驶证副页不能为空!",
  615. // })
  616. // return true
  617. // }
  618. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseValidityDate)) {
  619. // this.$refs.uToast.show({
  620. // type: 'error',
  621. // message: "行驶证有效期不能为空!",
  622. // })
  623. // return true
  624. // }
  625. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseNumber)) {
  626. // this.$refs.uToast.show({
  627. // type: 'error',
  628. // message: "行驶证档案编号不能为空!",
  629. // })
  630. // return true
  631. // }
  632. // if(this.radiovalue=='挂车司机'){
  633. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
  634. // this.$refs.uToast.show({
  635. // type: 'error',
  636. // message: "挂车行驶证主页不能为空!",
  637. // })
  638. // return true
  639. // }
  640. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  641. // this.$refs.uToast.show({
  642. // type: 'error',
  643. // message: "挂车行驶证副页不能为空!",
  644. // })
  645. // return true
  646. // }
  647. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
  648. // this.$refs.uToast.show({
  649. // type: 'error',
  650. // message: "挂车行驶证档案编号不能为空!",
  651. // })
  652. // return true
  653. // }
  654. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
  655. // this.$refs.uToast.show({
  656. // type: 'error',
  657. // message: "挂车行驶证有效期不能为空!",
  658. // })
  659. // return true
  660. // }
  661. // }
  662. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  663. // this.$refs.uToast.show({
  664. // type: 'error',
  665. // message: "行驶证副页不能为空!",
  666. // })
  667. // return true
  668. // }
  669. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificate)) {
  670. this.$refs.uToast.show({
  671. type: 'error',
  672. message: "从业资格证不能为空!",
  673. })
  674. return true
  675. }
  676. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateValidityDate)) {
  677. this.$refs.uToast.show({
  678. type: 'error',
  679. message: "从业资格证有效期不能为空!",
  680. })
  681. return true
  682. }
  683. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateNumber)) {
  684. this.$refs.uToast.show({
  685. type: 'error',
  686. message: "从业资格证号不能为空!",
  687. })
  688. return true
  689. }
  690. // if (!uni.$u.test.rangeLength(this.dataDetails.qualificationCertificateNumber,[12,19])) {
  691. // this.$refs.uToast.show({
  692. // type: 'error',
  693. // message: "从业资格证号输入错误!",
  694. // })
  695. // return true
  696. // }
  697. if (this.dataDetails.qualificationCertificateNumber.length!=19) {
  698. this.$refs.uToast.show({
  699. type: 'error',
  700. message: "从业资格证号输入错误!",
  701. })
  702. return true
  703. }
  704. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificate)) {
  705. // this.$refs.uToast.show({
  706. // type: 'error',
  707. // message: "道路运输证不能为空!",
  708. // })
  709. // return true
  710. // }
  711. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateNumber)) {
  712. // this.$refs.uToast.show({
  713. // type: 'error',
  714. // message: "道路运输证号不能为空!",
  715. // })
  716. // return true
  717. // }
  718. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateValidityDate)) {
  719. // this.$refs.uToast.show({
  720. // type: 'error',
  721. // message: "道路运输证有效期不能为空!",
  722. // })
  723. // return true
  724. // }
  725. // if(this.radiovalue=='挂车司机'){
  726. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
  727. // this.$refs.uToast.show({
  728. // type: 'error',
  729. // message: "挂车道路运输证不能为空!",
  730. // })
  731. // return true
  732. // }
  733. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
  734. // this.$refs.uToast.show({
  735. // type: 'error',
  736. // message: "挂车道路运输证号不能为空!",
  737. // })
  738. // return true
  739. // }
  740. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
  741. // this.$refs.uToast.show({
  742. // type: 'error',
  743. // message: "挂车道路运输证有效期不能为空!",
  744. // })
  745. // return true
  746. // }
  747. // }
  748. if (uni.$u.test.isEmpty(this.dataDetails.postalAddress)) {
  749. this.$refs.uToast.show({
  750. type: 'error',
  751. message: "通讯地址不能为空!",
  752. })
  753. return true
  754. }
  755. return false
  756. },
  757. delSubmitObj() {
  758. delete this.dataDetails.authenticationStatus
  759. delete this.dataDetails.authenticationStatusKey
  760. delete this.dataDetails.compId
  761. delete this.dataDetails.createDate
  762. delete this.dataDetails.createUserId
  763. delete this.dataDetails.deleteFlag
  764. delete this.dataDetails.driverCarInfoList
  765. delete this.dataDetails.driverPayeeInfoList
  766. delete this.dataDetails.firstFlag
  767. delete this.dataDetails.updateDate
  768. },
  769. btnBClick() {
  770. // 此处用法为在js中调用,需要写uni.$u.throttle()
  771. uni.$u.throttle(this.submit(), 5000)
  772. },
  773. submit() {
  774. if (!this.consentStatus) {
  775. uni.showToast({
  776. title: '请勾选协议',
  777. icon: 'none',
  778. duration: 2000
  779. })
  780. return
  781. }
  782. // 校验
  783. if (this.validate()) return
  784. this.delSubmitObj()
  785. this.dataDetails.accountNumber = uni.getStorageSync("userInfo").phone
  786. uni.showLoading({
  787. mask: true,
  788. title: '加载中'
  789. })
  790. this.$request.baseRequest('post', '/driverInfo/api/editInfo', this.dataDetails).then(res => {
  791. if (res.code == 200) {
  792. uni.hideLoading()
  793. this.$refs.uToast.show({
  794. type: 'success',
  795. message: "提交成功,待平台审核!",
  796. complete() {
  797. uni.switchTab({
  798. url: '/pages/mine/index'
  799. })
  800. }
  801. })
  802. } else {
  803. uni.hideLoading()
  804. uni.$u.toast(res.message);
  805. }
  806. })
  807. .catch(res => {
  808. uni.hideLoading()
  809. uni.$u.toast(res.message);
  810. });
  811. },
  812. radioChange(n) {
  813. console.log('radioChange', n);
  814. if (n == '挂车司机') {
  815. this.isGCar = true
  816. this.dataDetails.driverType = 1
  817. } else {
  818. this.dataDetails.driverType = 2
  819. this.isGCar = false
  820. }
  821. },
  822. //设置图片
  823. setImage(e) {
  824. console.log(e);
  825. //显示在页面
  826. //this.imagesrc = e.path;
  827. // if (e.dotype == 'idphoto') {
  828. // _this.zjzClipper(e.path);
  829. // } else if (e.dotype == 'watermark') {
  830. // _this.watermark(e.path);
  831. // } else {
  832. // _this.savePhoto(e.path);
  833. // }
  834. },
  835. }
  836. };
  837. </script>
  838. <style scoped lang="scss">
  839. .u-radio {
  840. margin-bottom: 0px !important;
  841. }
  842. .row4-img {
  843. width: 32rpx;
  844. height: 32rpx;
  845. }
  846. .preview {
  847. width: 100%;
  848. height: 100px;
  849. }
  850. .top-head {
  851. background: #2772FB;
  852. height: 80rpx;
  853. width: 100%;
  854. }
  855. .container {
  856. background: white;
  857. position: relative;
  858. top: -60rpx;
  859. margin: 0 20rpx;
  860. padding: 20rpx;
  861. box-sizing: border-box;
  862. border-radius: 10rpx;
  863. }
  864. .radio-group {
  865. display: flex;
  866. align-items: center;
  867. // justify-content: space-between;
  868. }
  869. .level1-title {
  870. margin: 20rpx 0;
  871. border-bottom: 1px solid #EEEEEE;
  872. padding-bottom: 30rpx;
  873. }
  874. .content1 {
  875. .row {
  876. border-bottom: 1px solid #EEEEEE;
  877. padding-bottom: 28rpx;
  878. margin-top: 26rpx;
  879. }
  880. .left-text {
  881. // background: red;
  882. width: 320rpx;
  883. color: #333333;
  884. display: flex;
  885. align-items: center;
  886. }
  887. .picture {
  888. position: relative;
  889. width: 100%;
  890. height: 440rpx;
  891. display: flex;
  892. justify-content: center;
  893. flex-direction: column;
  894. align-items: center;
  895. .text {
  896. margin-top: 20rpx;
  897. }
  898. }
  899. .picture1 {
  900. background: url(../../static/images/mine/jzz.png);
  901. background-size: 100% 100%;
  902. }
  903. .picture2 {
  904. background: url(../../static/images/mine/jzf.png);
  905. background-size: 100% 100%;
  906. }
  907. .picture3 {
  908. background: url(../../static/images/mine/xsz.png);
  909. background-size: 100% 100%;
  910. }
  911. .picture4 {
  912. background: url(../../static/images/mine/xsf.png);
  913. background-size: 100% 100%;
  914. }
  915. .picture5 {
  916. background: url(../../static/images/mine/gcxsz.png);
  917. background-size: 100% 100%;
  918. }
  919. .picture6 {
  920. background: url(../../static/images/mine/gcxsf.png);
  921. background-size: 100% 100%;
  922. }
  923. .picture7 {
  924. background: url(../../static/images/mine/cy.png);
  925. background-size: 100% 100%;
  926. }
  927. .picture8 {
  928. background: url(../../static/images/mine/cy.png);
  929. background-size: 100% 100%;
  930. }
  931. .picture9 {
  932. background: url(../../static/images/mine/cy.png);
  933. background-size: 100% 100%;
  934. }
  935. .xj-image {
  936. width: 100rpx;
  937. height: 100rpx;
  938. }
  939. .title {
  940. color: #999999;
  941. margin: 20rpx 0;
  942. }
  943. }
  944. .service {
  945. font-size: 24rpx;
  946. margin: 20rpx;
  947. justify-content: center;
  948. /deep/.u-image {
  949. margin: 0 20rpx;
  950. }
  951. }
  952. .del-card {
  953. position: absolute;
  954. top: -10rpx;
  955. right: -6rpx;
  956. width: 80rpx;
  957. height: 80rpx;
  958. z-index: 9;
  959. }
  960. .path {
  961. color: #2772FB;
  962. }
  963. .btn-color {}
  964. /deep/.uni-input-input:disabled {
  965. background: #fff;
  966. }
  967. /deep/.u-textarea{
  968. padding:9px 0;
  969. }
  970. /deep/.u-textarea__field{
  971. color:#000;
  972. text-align:right;
  973. }
  974. </style>