driverIdentityTwo.vue 16 KB

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