editDriverCertificationNext.vue 27 KB

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