editDriverCertificationNext.vue 27 KB

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