driverIdentityTwo.vue 17 KB

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