driverIdentityTwo.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <template>
  2. <view class="center">
  3. <!-- 车辆信息 -->
  4. <view class="information">
  5. <view class="c-row">
  6. <text class="tit">货车信息</text>
  7. <view class="con-list">
  8. <image v-bind:src="opencar" class="open" opencarboolean @click="opencarclick"></image>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="informations" v-if="opencarboolean == true" v-for="(item , index) in driverCarInfoList"
  13. :Key="index">
  14. <view class="c-row ">
  15. <text class="tit">车辆 -{{index+1}}</text>
  16. <view class="con-list">
  17. <view>
  18. <image src="../../static/img/jiaoyi/shanchu@2x.png" class="eliminate" @click="carDel(index)">
  19. </image>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="c-row b-b">
  24. <text class="tit">车牌号</text>
  25. <view class="con-list">
  26. <input placeholder="请填写车牌号" placeholder-style="font-size: 14px;color:#AFB3BF;" maxlength = "7" name="input" v-model="item.carNumber"></input>
  27. </view>
  28. </view>
  29. <view class="c-row b-b">
  30. <text class="tit">车型</text>
  31. <picker @change="ModelChange($event,index)" :value="ModelIndex" :range="ModelType" class="con-list">
  32. <view class="picker " v-model="item.carModel">
  33. {{item.carModel ?item.carModel:'请选择车型'}}
  34. </view>
  35. </picker>
  36. </view>
  37. <view class="c-row b-b">
  38. <text class="tit">不含车头车长(米)</text>
  39. <picker v-if="carchength" @change="carLongChange($event,index)" :value="carLongIndex"
  40. :range="carLongType" class="con-list">
  41. <view class="picker" v-model="item.carLength">
  42. {{item.carLength?item.carLength:'请选择车长 >'}}
  43. </view>
  44. </picker>
  45. <view v-else class="con-list">
  46. <input placeholder="请填写车长(米)" name="input" v-model="item.carLength"></input>
  47. </view>
  48. <view v-if="carchength" @click="changeCarChength">手动填写<u-icon name="edit-pen-fill"></u-icon></view>
  49. <view v-else @click="changeCarChength">自动获取<u-icon name="edit-pen-fill"></u-icon></view>
  50. <!-- <image src='' >填写</image> -->
  51. <!-- <button v-else class='cu-btn bg-green shadow' @click="changeCarChength">选择</button> -->
  52. </view>
  53. <view class="c-row b-b">
  54. <text class="tit">载重(吨)</text>
  55. <view class="con-list">
  56. <input type='number' placeholder="请填写载重(吨)"placeholder-style="font-size: 14px;color:#AFB3BF;" name="input" v-model="item.carLoad"></input>
  57. </view>
  58. </view>
  59. <view class="c-row ">
  60. <text class="tit">出厂年份</text>
  61. <view class="con-list">
  62. <view @click='yearchange'>{{year[index] == null?"请选择出厂年份":year[index]}}</view>
  63. <u-picker :params='params' @confirm='yearpicker($event,index)' v-model="show" mode="time" :start-year="startData" :end-year="endData">
  64. </u-picker>
  65. </view>
  66. </view>
  67. </view>
  68. <button class="btnAdd" v-if="opencarboolean == true" @click="carAdd">
  69. <image style='width:16px;height:16px;margin-right:3px;position:relative;top:2px;' src="../../static/img/add@3x.png" mode=""></image>
  70. <texe>添加车辆</texe>
  71. </button>
  72. <!-- 账户信息 -->
  73. <view class="information">
  74. <view class="c-row">
  75. <text class="tit">账户信息</text>
  76. <view class="con-list">
  77. <image v-bind:src="openuser" class="open" openuserboolean @click="openuserclick"></image>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="informations" v-if="openuserboolean == true" v-for="(items , index) in driverPayeeInfoList"
  82. :Key="index">
  83. <view class="c-row ">
  84. <text class="tit">账户 -{{index+1}}</text>
  85. <view class="con-list">
  86. <view>
  87. <image src="../../static/img/jiaoyi/shanchu@2x.png" class="eliminate" @click="userDel(index)">
  88. </image>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="c-row b-b">
  93. <text class="tit">账户类型</text>
  94. <picker @change="accountChange($event,index)" :value="accountarr[index]" :range="accountType"
  95. class="con-list">
  96. <view class="picker" v-model="items.accountType">
  97. {{accountarr[index] != null ? accountarr[index]:'个人账户'}}
  98. </view>
  99. </picker>
  100. </view>
  101. <view class="c-row b-b">
  102. <text class="tit">银行卡照片(可选)</text>
  103. <view class="con-list">
  104. <view v-if="bankimg[index] == null" @click="bankimgs(index)">请上传照片</view>
  105. <view v-if="bankimg[index] != null" @click="bankimgs(index)">
  106. <image v-bind:src="bankimg[index]" style="width: 40px; height: 40px;"></image>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="c-row b-b">
  111. <text class="tit">银行卡号</text>
  112. <view class="con-list">
  113. <input type='number' placeholder="请输入银行卡号"placeholder-style="font-size: 14px;color:#AFB3BF;" name="input" v-model="items.bankCard"></input>
  114. </view>
  115. </view>
  116. <view class="c-row b-b">
  117. <text class="tit">开户行</text>
  118. <view class="con-list">
  119. <input placeholder="请输入开户行"placeholder-style="font-size: 14px;color:#AFB3BF;" name="input" v-model="items.bankDeposit"></input>
  120. </view>
  121. </view>
  122. <view class="c-row b-b">
  123. <text class="tit">开户支行</text>
  124. <picker v-if="subBranch" @change="bankChange($event,index)" :value="bankarr[index]" :range="bankType[index]"
  125. class="con-list">
  126. <view class="con-list">
  127. {{bankarr[index] != null?bankarr[index]:'请选择开户支行'}}
  128. </view>
  129. </picker>
  130. <view v-else class="con-list">
  131. <input placeholder="请填写开户支行"placeholder-style="font-size: 14px;color:#AFB3BF;" name="input" v-model="items.bankDepositBranch"></input>
  132. </view>
  133. <view v-if="subBranch" @click="subBranchChength">手动填写<u-icon name="edit-pen-fill"></u-icon></view>
  134. <view v-else @click="subBranchChength">自动识别<u-icon name="edit-pen-fill"></u-icon></view>
  135. </view>
  136. <view class="c-row b-b" v-if="items.accountType == '个人账户'">
  137. <text class="tit">收款人姓名</text>
  138. <view class="con-list">
  139. <input placeholder="请输入收款人姓名"placeholder-style="font-size: 14px;color:#AFB3BF;" name="input" v-model="items.payeeName"></input>
  140. </view>
  141. </view>
  142. <view class="c-row " v-if="items.accountType == '个人账户'">
  143. <text class="tit">收款人身份证号</text>
  144. <view class="con-list">
  145. <input placeholder="请输入收款人身份证号"placeholder-style="font-size: 14px;color:#AFB3BF;" name="input" v-model="items.payeeNumberCard"></input>
  146. </view>
  147. </view>
  148. <view class="c-row " v-if="items.accountType == '企业账户'">
  149. <text class="tit">企业名称</text>
  150. <view class="con-list">
  151. <input placeholder="请输入企业名称"placeholder-style="font-size: 14px;color:#AFB3BF;" name="input" v-model="items.compName"></input>
  152. </view>
  153. </view>
  154. </view>
  155. <button class="btnAdd" v-if="openuserboolean == true && this.driverPayeeInfoList.length < 10" @click="userAdd()" >
  156. <image style='width:16px;height:16px;margin-right:3px;position:relative;top:2px;' src="../../static/img/add@3x.png" mode=""></image>
  157. <texe>添加账户</texe>
  158. </button>
  159. <button class="btns btn" @click="jumpUrl">下一步</button>
  160. </view>
  161. </view>
  162. </template>
  163. <script>
  164. import {
  165. mapState
  166. } from 'vuex';
  167. export default {
  168. data() {
  169. return {
  170. opencar: "../../static/img/authentication/down2@3x.png",
  171. openuser: "../../static/img/authentication/down2@3x.png",
  172. opencarboolean: false,
  173. openuserboolean: false,
  174. driverCarInfoList: [{
  175. carNumber: '',
  176. carModel: "",
  177. carLength: "",
  178. carLoad: "",
  179. yearManufacture: "",
  180. }],
  181. driverPayeeInfoList: [{
  182. accountType: "个人账户",
  183. accountTypeFlag: "1",
  184. accountIndex: '0',
  185. binkindex: 0,
  186. cardAddressUrl: "",
  187. bankCard: "",
  188. bankDeposit: "",
  189. bankDepositBranch: "",
  190. payeeName: "",
  191. payeeNumberCard:"",
  192. }],
  193. ModelIndex: 0,
  194. Model: '',
  195. ModelType: ["高栏", "集装箱", "自卸车"],
  196. carLong: '',
  197. carLongIndex: 0,
  198. carLongType: ['13', '9.6', '8.2', '8.7', '11.7', '12.5', '13.7', '15', '16', '17.5'],
  199. DriverViewInfo: {},
  200. bankimg: [],
  201. bankImgs1: {},
  202. bankIndex: -1,
  203. bankType: [],
  204. accountType: ["个人账户", "企业账户"],
  205. accountarr: [],
  206. bankarr: [],
  207. show: false,
  208. carchength: true,
  209. subBranch:true,
  210. params: {
  211. year: true,
  212. },
  213. year: [],
  214. default_time:'',
  215. carModelType: [],
  216. carLengtharr: [],
  217. }
  218. },
  219. computed:{
  220. startData(){
  221. var data = new Date()
  222. return data.getFullYear() - 30
  223. },
  224. endData(){
  225. var data = new Date()
  226. return data.getFullYear()
  227. }
  228. },
  229. onLoad(options) {
  230. this.DriverViewInfo = JSON.parse(options.DriverViewInfo)
  231. this.driverPayeeInfoList[0].payeeName = this.DriverViewInfo.driverName
  232. this.driverPayeeInfoList[0].payeeNumberCard = this.DriverViewInfo.numberCard
  233. },
  234. methods: {
  235. subBranchChength(){
  236. this.subBranch = !this.subBranch
  237. },
  238. changeCarChength() {
  239. this.carchength = !this.carchength
  240. },
  241. yearchange() {
  242. this.show = true
  243. },
  244. yearpicker(e, index) {
  245. this.year[index] = e.year
  246. this.driverCarInfoList[index].yearManufacture = e.year
  247. },
  248. accountChange(e, index) {
  249. this.driverPayeeInfoList[index].accountIndex = e.detail.value
  250. this.driverPayeeInfoList[index].accountType = this.accountType[this.driverPayeeInfoList[index]
  251. .accountIndex];
  252. this.driverPayeeInfoList[index].accountTypeFlag= e.detail.value+1;
  253. this.accountarr[index] = this.accountType[e.detail.value];
  254. },
  255. bankimgs(items) {
  256. var that = this
  257. uni.chooseImage({
  258. success: function(res) {
  259. uni.uploadFile({
  260. url: 'https://www.zthymaoyi.com/upload/admin',
  261. filePath: res.tempFilePaths[0],
  262. name: 'file',
  263. success(res) {
  264. var data = res.data
  265. var strToObj = JSON.parse(data)
  266. // that.id[0] = strToObj.url
  267. that.bankimg[items] = strToObj.url
  268. that.bankImgs1.bankImg = strToObj.url
  269. that.driverPayeeInfoList[items].cardAddressUrl = strToObj.url
  270. that.$api.doRequest('get', '/driverViewInfo/bankShibie', that
  271. .bankImgs1).then(res => {
  272. that.$set(that.driverPayeeInfoList[items], 'bankCard', res
  273. .data.data.bankNo)
  274. that.$set(that.driverPayeeInfoList[items], 'bankDeposit',
  275. res.data.data.bankName)
  276. that.bankType[items] = res.data.data.bankNameZhihang
  277. }).catch(res => {
  278. uni.showToast({
  279. title: res.data.message,
  280. icon: 'none',
  281. duration: 2000
  282. })
  283. })
  284. }
  285. })
  286. }
  287. })
  288. },
  289. jumpUrl() {
  290. for (var i = 0; i < this.driverCarInfoList.length; i++) {
  291. if (!this.driverCarInfoList[i].carNumber) {
  292. this.$api.msg('车牌号不能为空')
  293. return
  294. }
  295. if (this.driverCarInfoList[i].carNumber.toString().length != 7) {
  296. this.$api.msg('车牌号输入错误')
  297. return
  298. }
  299. if (!this.driverCarInfoList[i].carModel) {
  300. this.$api.msg('车型不能为空')
  301. return
  302. }
  303. if (!this.driverCarInfoList[i].carLength) {
  304. this.$api.msg('车长不能为空')
  305. return
  306. }
  307. if (this.driverCarInfoList[i].carLength > 50) {
  308. this.$api.msg('车长输入错误')
  309. return
  310. }
  311. if (this.driverCarInfoList[i].carLength.indexOf('.') != -1) {
  312. if (this.driverCarInfoList[i].carLength.split('.')[1].length > 1) {
  313. this.$api.msg('车长输入错误')
  314. return
  315. }
  316. }
  317. if (!this.driverCarInfoList[i].carLoad) {
  318. this.$api.msg('载重不能为空')
  319. return
  320. }
  321. if (this.driverCarInfoList[i].carLoad > 50) {
  322. this.$api.msg('载重输入错误')
  323. return
  324. }
  325. if (this.driverCarInfoList[i].carLoad.indexOf('.') != -1) {
  326. if (this.driverCarInfoList[i].carLoad.split('.')[1].length > 1) {
  327. this.$api.msg('载重输入错误')
  328. return
  329. }
  330. }
  331. if (!this.driverCarInfoList[i].yearManufacture) {
  332. this.$api.msg('出厂年份不能为空')
  333. return
  334. }
  335. }
  336. for (var i = 0; i < this.driverPayeeInfoList.length; i++) {
  337. if (!this.driverPayeeInfoList[i].accountType) {
  338. this.$api.msg('账户类型不能为空')
  339. return
  340. }
  341. // if (!this.driverCarInfoList[i].cardAddressUrl) {
  342. // this.$api.msg('银行卡照片不能为空')
  343. // }
  344. if (!this.driverPayeeInfoList[i].bankCard) {
  345. this.$api.msg('银行卡号不能为空')
  346. return
  347. }
  348. if (this.driverPayeeInfoList[i].bankCard.length < 16 || this.driverPayeeInfoList[i].bankCard.length >
  349. 19) {
  350. this.$api.msg('银行卡号输入错误')
  351. return
  352. }
  353. if (!this.driverPayeeInfoList[i].bankDeposit) {
  354. this.$api.msg('开户行不能为空')
  355. return
  356. }
  357. if (this.driverPayeeInfoList[i].bankDeposit.length < 4 || this.driverPayeeInfoList[i].bankDeposit
  358. .length > 15) {
  359. this.$api.msg('开户行输入错误')
  360. return
  361. }
  362. if (!this.driverPayeeInfoList[i].bankDepositBranch) {
  363. this.$api.msg('开户支行不能为空')
  364. return
  365. }
  366. if (this.driverPayeeInfoList[i].bankDepositBranch.length < 4 || this.driverPayeeInfoList[i]
  367. .bankDepositBranch.length > 30) {
  368. this.$api.msg('开户支行输入错误')
  369. return
  370. }
  371. if(this.driverPayeeInfoList[i].accountTypeFlag==1){
  372. if (!this.driverPayeeInfoList[i].payeeName) {
  373. this.$api.msg('收款人姓名不能为空')
  374. return
  375. }
  376. if (this.driverPayeeInfoList[i].payeeName.length < 2 || this.driverPayeeInfoList[i].payeeName.length >
  377. 10) {
  378. this.$api.msg('收款人姓名输入错误')
  379. return
  380. }
  381. if (!this.driverPayeeInfoList[i].payeeNumberCard) {
  382. this.$api.msg('收款人身份证号不能为空')
  383. return
  384. }
  385. if (this.driverPayeeInfoList[i].payeeNumberCard.length != 18) {
  386. this.$api.msg('收款人身份证号输入错误')
  387. return
  388. }
  389. }
  390. }
  391. this.DriverViewInfo.driverCarInfoList = this.driverCarInfoList
  392. this.DriverViewInfo.driverPayeeInfoList = this.driverPayeeInfoList
  393. this.DriverViewInfo.driverPayeeInfoList.payeeAddressUrl = this.bankimg
  394. var model = JSON.stringify(this.DriverViewInfo);
  395. uni.navigateTo({
  396. url: `/pageD/identity/driverIdentityThree?DriverViewInfo=` + model
  397. })
  398. },
  399. carAdd() {
  400. this.driverCarInfoList.push({
  401. carNumber: '',
  402. carModel: "",
  403. carLength: "",
  404. carLoad: "",
  405. yearManufacture: "",
  406. })
  407. },
  408. userAdd() {
  409. this.driverPayeeInfoList.push({
  410. accountType: "个人账户",
  411. accountIndex: '0',
  412. binkindex: 0,
  413. cardAddressUrl: "",
  414. bankCard: "",
  415. bankDeposit: "",
  416. bankDepositBranch: "",
  417. payeeName: this.DriverViewInfo.driverName,
  418. payeeNumberCard: this.DriverViewInfo.numberCard,
  419. })
  420. },
  421. carDel(index) {
  422. if (this.driverCarInfoList.length > 1) {
  423. this.driverCarInfoList.splice(index, 1)
  424. }
  425. },
  426. userDel(index) {
  427. if (this.driverPayeeInfoList.length > 1) {
  428. this.driverPayeeInfoList.splice(index, 1)
  429. }
  430. },
  431. ModelChange(e, index) {
  432. this.ModelIndex = e.detail.value
  433. this.driverCarInfoList[index].carModel = this.ModelType[this.ModelIndex];
  434. this.carModelType[index] = this.ModelType[this.ModelIndex];
  435. },
  436. bankChange(e, index) {
  437. this.driverPayeeInfoList[index].binkindex = e.detail.value
  438. this.$set(this.bankarr, index, this.bankType[index][this.driverPayeeInfoList[index].binkindex])
  439. this.driverPayeeInfoList[index].bankDepositBranch = this.bankType[index][e.detail.value];
  440. },
  441. carLongChange(e, index) {
  442. this.carLongIndex = e.detail.value
  443. this.carLong = this.carLongType[this.carLongIndex];
  444. this.driverCarInfoList[index].carLength = this.carLongType[this.carLongIndex];
  445. this.carLengtharr[index] = this.carLongType[this.carLongIndex];
  446. },
  447. opencarclick() {
  448. if (this.opencarboolean == false) {
  449. this.opencarboolean = true;
  450. this.opencar = "../../static/img/authentication/up2%20(3).png"
  451. } else if (this.opencarboolean == true) {
  452. this.opencarboolean = false;
  453. this.opencar = "../../static/img/authentication/down2@3x.png"
  454. }
  455. },
  456. openuserclick() {
  457. if (this.openuserboolean == false) {
  458. this.openuserboolean = true;
  459. this.openuser = "../../static/img/authentication/up2%20(3).png"
  460. } else if (this.openuserboolean == true) {
  461. this.openuserboolean = false;
  462. this.openuser = "../../static/img/authentication/down2@3x.png"
  463. }
  464. }
  465. }
  466. }
  467. </script>
  468. <style scoped>
  469. .center {
  470. padding: 10px 20px;
  471. background-color: #F5F6FA;
  472. }
  473. .c-row {
  474. display: -webkit-box;
  475. display: -webkit-flex;
  476. display: flex;
  477. -webkit-box-align: center;
  478. -webkit-align-items: center;
  479. align-items: center;
  480. padding: 20rpx 30rpx;
  481. position: relative;
  482. line-height: 36px;
  483. }
  484. .con-list {
  485. -webkit-box-flex: 1;
  486. -webkit-flex: 1;
  487. flex: 1;
  488. display: -webkit-box;
  489. display: -webkit-flex;
  490. display: flex;
  491. -webkit-box-orient: vertical;
  492. -webkit-box-direction: normal;
  493. -webkit-flex-direction: column;
  494. flex-direction: column;
  495. color: #AFB3BF;
  496. line-height: 40rpx;
  497. text-align: right;
  498. padding-right: 20rpx;
  499. font-size: 14px;
  500. }
  501. .open {
  502. width: 30rpx;
  503. height: 20rpx;
  504. position: absolute;
  505. right: 20px;
  506. margin-top: -5px;
  507. }
  508. .information {
  509. margin-top: 10px;
  510. width: 100%;
  511. height: 56px;
  512. background-color: #FFFFFF;
  513. border-radius: 10px;
  514. }
  515. .informations {
  516. margin-top: 10px;
  517. background-color: #FFFFFF;
  518. border-radius: 10px;
  519. }
  520. .btn {
  521. margin-top: 10px;
  522. background-color: #FFFFFF;
  523. border-radius: 25px;
  524. font-weight: 550;
  525. }
  526. .btnAdd {
  527. margin-top: 10px;
  528. background-color: #FFFFFF;
  529. color:#00C265;
  530. border: none;
  531. border-radius:30px;
  532. }
  533. .btnAdd:after{
  534. border: none;
  535. }
  536. .btns {
  537. background-color: #22C572;
  538. color: white;
  539. }
  540. .add {
  541. width: 26px;
  542. height: 26px;
  543. }
  544. /* 清除 */
  545. .eliminate {
  546. width: 15px;
  547. height: 15px;
  548. float: right;
  549. }
  550. .bankImg {
  551. width: 20px;
  552. height: 20px;
  553. }
  554. </style>