editDriverCertificationNext.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850
  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">
  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() {
  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&&res.data.qualificationCertificate) {
  443. _this.dataDetails.qualificationCertificateValidityDate = res.data.qualificationCertificate
  444. }
  445. if(res.data&&res.data.qualificationCertificateNum){
  446. _this.dataDetails.qualificationCertificateNumber = res.data.qualificationCertificateNum
  447. }
  448. _this.$forceUpdate()
  449. })
  450. .catch(res => {
  451. uni.$u.toast(res.message);
  452. });
  453. break;
  454. case 8:
  455. _this.dataDetails.operationCertificate = result
  456. break;
  457. case 9:
  458. _this.dataDetails.trailerOperationCertificate = result
  459. break;
  460. }
  461. }
  462. )
  463. }
  464. });
  465. // } else {
  466. // }
  467. },
  468. uploadImg(type) {
  469. this.uploadType = type
  470. // this.isShowimgType = true
  471. this.imgTypeSelect()
  472. },
  473. validate() {
  474. // true 为校验不通过
  475. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
  476. this.$refs.uToast.show({
  477. type: 'error',
  478. message: "驾驶证主页不能为空!",
  479. })
  480. return true
  481. }
  482. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseBackPage)) {
  483. this.$refs.uToast.show({
  484. type: 'error',
  485. message: "驾驶证副页不能为空!",
  486. })
  487. return true
  488. }
  489. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseValidityDate)) {
  490. this.$refs.uToast.show({
  491. type: 'error',
  492. message: "驾驶证有效期不能为空!",
  493. })
  494. return true
  495. }
  496. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseHomePage)) {
  497. // this.$refs.uToast.show({
  498. // type: 'error',
  499. // message: "行驶证主页不能为空!",
  500. // })
  501. // return true
  502. // }
  503. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseBackPage)) {
  504. // this.$refs.uToast.show({
  505. // type: 'error',
  506. // message: "行驶证副页不能为空!",
  507. // })
  508. // return true
  509. // }
  510. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseValidityDate)) {
  511. // this.$refs.uToast.show({
  512. // type: 'error',
  513. // message: "行驶证有效期不能为空!",
  514. // })
  515. // return true
  516. // }
  517. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseNumber)) {
  518. // this.$refs.uToast.show({
  519. // type: 'error',
  520. // message: "行驶证档案编号不能为空!",
  521. // })
  522. // return true
  523. // }
  524. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificate)) {
  525. this.$refs.uToast.show({
  526. type: 'error',
  527. message: "从业资格证不能为空!",
  528. })
  529. return true
  530. }
  531. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateValidityDate)) {
  532. this.$refs.uToast.show({
  533. type: 'error',
  534. message: "从业资格证有效期不能为空!",
  535. })
  536. return true
  537. }
  538. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificate)) {
  539. // this.$refs.uToast.show({
  540. // type: 'error',
  541. // message: "道路运输证不能为空!",
  542. // })
  543. // return true
  544. // }
  545. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateValidityDate)) {
  546. // this.$refs.uToast.show({
  547. // type: 'error',
  548. // message: "道路运输证有效期不能为空!",
  549. // })
  550. // return true
  551. // }
  552. // if (this.radiovalue == '挂车司机') {
  553. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
  554. // this.$refs.uToast.show({
  555. // type: 'error',
  556. // message: "挂车行驶证主页不能为空!",
  557. // })
  558. // return true
  559. // }
  560. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  561. // this.$refs.uToast.show({
  562. // type: 'error',
  563. // message: "挂车行驶证副页不能为空!",
  564. // })
  565. // return true
  566. // }
  567. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
  568. // this.$refs.uToast.show({
  569. // type: 'error',
  570. // message: "挂车行驶证有效期不能为空!",
  571. // })
  572. // return true
  573. // }
  574. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
  575. // this.$refs.uToast.show({
  576. // type: 'error',
  577. // message: "挂车道路运输证不能为空!",
  578. // })
  579. // return true
  580. // }
  581. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
  582. // this.$refs.uToast.show({
  583. // type: 'error',
  584. // message: "挂车道路运输证有效期不能为空!",
  585. // })
  586. // return true
  587. // }
  588. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
  589. // this.$refs.uToast.show({
  590. // type: 'error',
  591. // message: "挂车道路运输证号不能为空!",
  592. // })
  593. // return true
  594. // }
  595. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
  596. // this.$refs.uToast.show({
  597. // type: 'error',
  598. // message: "挂车行驶证档案编号不能为空!",
  599. // })
  600. // return true
  601. // }
  602. // }
  603. if (uni.$u.test.isEmpty(this.dataDetails.postalAddress)) {
  604. this.$refs.uToast.show({
  605. type: 'error',
  606. message: "通讯地址不能为空!",
  607. })
  608. return true
  609. }
  610. return false
  611. },
  612. delSubmitObj() {
  613. delete this.dataDetails.authenticationStatus
  614. delete this.dataDetails.authenticationStatusKey
  615. delete this.dataDetails.compId
  616. delete this.dataDetails.createDate
  617. delete this.dataDetails.createUserId
  618. delete this.dataDetails.deleteFlag
  619. delete this.dataDetails.driverCarInfoList
  620. delete this.dataDetails.driverPayeeInfoList
  621. delete this.dataDetails.firstFlag
  622. delete this.dataDetails.updateDate
  623. },
  624. submit() {
  625. if (!this.consentStatus) {
  626. uni.showToast({
  627. title: '请勾选协议',
  628. icon: 'none',
  629. duration: 2000
  630. })
  631. return
  632. }
  633. // 校验
  634. if (this.validate()) return
  635. this.delSubmitObj()
  636. this.$request.baseRequest('post', '/driverInfo/api/editInfo', this.dataDetails).then(res => {
  637. if (res.code == 200) {
  638. this.$refs.uToast.show({
  639. type: 'success',
  640. message: "提交成功,待平台审核!",
  641. complete() {
  642. uni.switchTab({
  643. url: '/pages/mine/index'
  644. })
  645. }
  646. })
  647. } else {
  648. uni.$u.toast(res.message);
  649. }
  650. })
  651. .catch(res => {
  652. uni.$u.toast(res.message);
  653. });
  654. },
  655. radioChange(n) {
  656. console.log('radioChange', n);
  657. if (n == '挂车司机') {
  658. this.isGCar = true
  659. this.dataDetails.driverType = 1
  660. } else {
  661. this.dataDetails.driverType = 2
  662. this.isGCar = false
  663. }
  664. },
  665. //设置图片
  666. setImage(e) {
  667. console.log(e);
  668. //显示在页面
  669. //this.imagesrc = e.path;
  670. // if (e.dotype == 'idphoto') {
  671. // _this.zjzClipper(e.path);
  672. // } else if (e.dotype == 'watermark') {
  673. // _this.watermark(e.path);
  674. // } else {
  675. // _this.savePhoto(e.path);
  676. // }
  677. },
  678. }
  679. };
  680. </script>
  681. <style scoped lang="scss">
  682. .u-radio {
  683. margin-bottom: 0px !important;
  684. }
  685. .row4-img {
  686. width: 32rpx;
  687. height: 32rpx;
  688. }
  689. .preview {
  690. width: 100%;
  691. height: 100px;
  692. }
  693. .top-head {
  694. background: #2772FB;
  695. height: 80rpx;
  696. width: 100%;
  697. }
  698. .container {
  699. background: white;
  700. position: relative;
  701. top: -60rpx;
  702. margin: 0 20rpx;
  703. padding: 20rpx;
  704. box-sizing: border-box;
  705. border-radius: 10rpx;
  706. }
  707. .radio-group {
  708. display: flex;
  709. align-items: center;
  710. // justify-content: space-between;
  711. }
  712. .level1-title {
  713. margin: 20rpx 0;
  714. border-bottom: 1px solid #EEEEEE;
  715. padding-bottom: 30rpx;
  716. }
  717. .content1 {
  718. .row {
  719. border-bottom: 1px solid #EEEEEE;
  720. padding-bottom: 28rpx;
  721. margin-top: 26rpx;
  722. }
  723. .left-text {
  724. // background: red;
  725. width: 320rpx;
  726. color: #333333;
  727. display: flex;
  728. align-items: center;
  729. }
  730. .picture {
  731. position: relative;
  732. width: 100%;
  733. height: 440rpx;
  734. display: flex;
  735. justify-content: center;
  736. flex-direction: column;
  737. align-items: center;
  738. .text {
  739. margin-top: 20rpx;
  740. }
  741. }
  742. .picture1 {
  743. background: url(../../static/images/mine/jzz.png);
  744. background-size: 100% 100%;
  745. }
  746. .picture2 {
  747. background: url(../../static/images/mine/jzf.png);
  748. background-size: 100% 100%;
  749. }
  750. .picture3 {
  751. background: url(../../static/images/mine/xsz.png);
  752. background-size: 100% 100%;
  753. }
  754. .picture4 {
  755. background: url(../../static/images/mine/xsf.png);
  756. background-size: 100% 100%;
  757. }
  758. .picture5 {
  759. background: url(../../static/images/mine/gcxsz.png);
  760. background-size: 100% 100%;
  761. }
  762. .picture6 {
  763. background: url(../../static/images/mine/gcxsf.png);
  764. background-size: 100% 100%;
  765. }
  766. .picture7 {
  767. background: url(../../static/images/mine/cy.png);
  768. background-size: 100% 100%;
  769. }
  770. .picture8 {
  771. background: url(../../static/images/mine/cy.png);
  772. background-size: 100% 100%;
  773. }
  774. .picture9 {
  775. background: url(../../static/images/mine/cy.png);
  776. background-size: 100% 100%;
  777. }
  778. .xj-image {
  779. width: 100rpx;
  780. height: 100rpx;
  781. }
  782. .title {
  783. color: #999999;
  784. margin: 20rpx 0;
  785. }
  786. }
  787. .service {
  788. font-size: 24rpx;
  789. margin: 20rpx;
  790. justify-content: center;
  791. /deep/.u-image {
  792. margin: 0 20rpx;
  793. }
  794. }
  795. .del-card {
  796. position: absolute;
  797. top: -10rpx;
  798. right: -6rpx;
  799. width: 80rpx;
  800. height: 80rpx;
  801. z-index: 9;
  802. }
  803. .path {
  804. color: #2772FB;
  805. }
  806. .btn-color {}
  807. </style>