driverIdentityTwo.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  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. },
  216. methods: {
  217. subBranchChength(){
  218. this.subBranch = !this.subBranch
  219. },
  220. changeCarChength() {
  221. this.carchength = !this.carchength
  222. },
  223. yearchange() {
  224. this.show = true
  225. },
  226. yearpicker(e, index) {
  227. this.year[index] = e.year
  228. this.driverCarInfoList[index].yearManufacture = e.year
  229. },
  230. accountChange(e, index) {
  231. this.driverPayeeInfoList[index].accountIndex = e.detail.value
  232. this.driverPayeeInfoList[index].accountType = this.accountType[this.driverPayeeInfoList[index]
  233. .accountIndex];
  234. this.accountarr[index] = this.accountType[e.detail.value];
  235. },
  236. bankimgs(items) {
  237. var that = this
  238. wx.chooseImage({
  239. success: function(res) {
  240. wx.uploadFile({
  241. url: 'https://www.zthymaoyi.com/upload/admin',
  242. filePath: res.tempFilePaths[0],
  243. name: 'file',
  244. success(res) {
  245. var data = res.data
  246. var strToObj = JSON.parse(data)
  247. // that.id[0] = strToObj.url
  248. that.bankimg[items] = strToObj.url
  249. that.bankImgs1.bankImg = strToObj.url
  250. that.driverPayeeInfoList[items].cardAddressUrl = strToObj.url
  251. that.$api.doRequest('get', '/driverViewInfo/bankShibie', that
  252. .bankImgs1).then(res => {
  253. that.$set(that.driverPayeeInfoList[items], 'bankCard', res
  254. .data.data.bankNo)
  255. that.$set(that.driverPayeeInfoList[items], 'bankDeposit',
  256. res.data.data.bankName)
  257. that.bankType[items] = res.data.data.bankNameZhihang
  258. }).catch(res => {
  259. uni.showToast({
  260. title: res.data.message,
  261. icon: 'none',
  262. duration: 2000
  263. })
  264. })
  265. }
  266. })
  267. }
  268. })
  269. },
  270. jumpUrl() {
  271. for (var i = 0; i < this.driverCarInfoList.length; i++) {
  272. if (!this.driverCarInfoList[i].carNumber) {
  273. this.$api.msg('车牌号不能为空')
  274. return
  275. }
  276. if (this.driverCarInfoList[i].carNumber.toString().length != 7) {
  277. this.$api.msg('车牌号输入错误')
  278. return
  279. }
  280. if (!this.driverCarInfoList[i].carModel) {
  281. this.$api.msg('车型不能为空')
  282. return
  283. }
  284. if (!this.driverCarInfoList[i].carLength) {
  285. this.$api.msg('车长不能为空')
  286. return
  287. }
  288. if (this.driverCarInfoList[i].carLength > 50) {
  289. this.$api.msg('车长输入错误')
  290. return
  291. }
  292. if (this.driverCarInfoList[i].carLength.indexOf('.') != -1) {
  293. if (this.driverCarInfoList[i].carLength.split('.')[1].length > 1) {
  294. this.$api.msg('车长输入错误')
  295. return
  296. }
  297. }
  298. if (!this.driverCarInfoList[i].carLoad) {
  299. this.$api.msg('载重不能为空')
  300. return
  301. }
  302. if (this.driverCarInfoList[i].carLoad > 50) {
  303. this.$api.msg('载重输入错误')
  304. return
  305. }
  306. if (this.driverCarInfoList[i].carLoad.indexOf('.') != -1) {
  307. if (this.driverCarInfoList[i].carLoad.split('.')[1].length > 1) {
  308. this.$api.msg('载重输入错误')
  309. return
  310. }
  311. }
  312. if (!this.driverCarInfoList[i].yearManufacture) {
  313. this.$api.msg('出厂年份不能为空')
  314. return
  315. }
  316. }
  317. for (var i = 0; i < this.driverPayeeInfoList.length; i++) {
  318. if (!this.driverPayeeInfoList[i].accountType) {
  319. this.$api.msg('账户类型不能为空')
  320. return
  321. }
  322. // if (!this.driverCarInfoList[i].cardAddressUrl) {
  323. // this.$api.msg('银行卡照片不能为空')
  324. // }
  325. if (!this.driverPayeeInfoList[i].bankCard) {
  326. this.$api.msg('银行卡号不能为空')
  327. return
  328. }
  329. if (this.driverPayeeInfoList[i].bankCard.length < 16 || this.driverPayeeInfoList[i].bankCard.length >
  330. 19) {
  331. this.$api.msg('银行卡号输入错误')
  332. return
  333. }
  334. if (!this.driverPayeeInfoList[i].bankDeposit) {
  335. this.$api.msg('开户行不能为空')
  336. return
  337. }
  338. if (this.driverPayeeInfoList[i].bankDeposit.length < 4 || this.driverPayeeInfoList[i].bankDeposit
  339. .length > 15) {
  340. this.$api.msg('开户行输入错误')
  341. return
  342. }
  343. if (!this.driverPayeeInfoList[i].bankDepositBranch) {
  344. this.$api.msg('开户支行不能为空')
  345. return
  346. }
  347. if (this.driverPayeeInfoList[i].bankDepositBranch.length < 4 || this.driverPayeeInfoList[i]
  348. .bankDepositBranch.length > 30) {
  349. this.$api.msg('开户支行输入错误')
  350. return
  351. }
  352. if (!this.driverPayeeInfoList[i].payeeName) {
  353. this.$api.msg('收款人姓名不能为空')
  354. return
  355. }
  356. if (this.driverPayeeInfoList[i].payeeName.length < 2 || this.driverPayeeInfoList[i].payeeName.length >
  357. 10) {
  358. this.$api.msg('收款人姓名输入错误')
  359. return
  360. }
  361. if (!this.driverPayeeInfoList[i].payeeNumberCard) {
  362. this.$api.msg('收款人身份证号不能为空')
  363. return
  364. }
  365. if (this.driverPayeeInfoList[i].payeeNumberCard.length != 18) {
  366. this.$api.msg('收款人身份证号输入错误')
  367. return
  368. }
  369. }
  370. this.DriverViewInfo.driverCarInfoList = this.driverCarInfoList
  371. this.DriverViewInfo.driverPayeeInfoList = this.driverPayeeInfoList
  372. this.DriverViewInfo.driverPayeeInfoList.payeeAddressUrl = this.bankimg
  373. var model = JSON.stringify(this.DriverViewInfo);
  374. uni.navigateTo({
  375. url: `/pageD/identity/driverIdentityThree?DriverViewInfo=` + model
  376. })
  377. },
  378. carAdd() {
  379. this.driverCarInfoList.push({
  380. carNumber: '',
  381. carModel: "",
  382. carLength: "",
  383. carLoad: "",
  384. yearManufacture: "",
  385. })
  386. },
  387. userAdd() {
  388. this.driverPayeeInfoList.push({
  389. accountType: "个人账户",
  390. accountIndex: '0',
  391. binkindex: 0,
  392. cardAddressUrl: "",
  393. bankCard: "",
  394. bankDeposit: "",
  395. bankDepositBranch: "",
  396. payeeName: "",
  397. payeeNumberCard: "",
  398. })
  399. },
  400. carDel(index) {
  401. if (this.driverCarInfoList.length > 1) {
  402. this.driverCarInfoList.splice(index, 1)
  403. }
  404. },
  405. userDel(index) {
  406. if (this.driverPayeeInfoList.length > 1) {
  407. this.driverPayeeInfoList.splice(index, 1)
  408. }
  409. },
  410. ModelChange(e, index) {
  411. this.ModelIndex = e.detail.value
  412. this.driverCarInfoList[index].carModel = this.ModelType[this.ModelIndex];
  413. this.carModelType[index] = this.ModelType[this.ModelIndex];
  414. },
  415. bankChange(e, index) {
  416. this.driverPayeeInfoList[index].binkindex = e.detail.value
  417. this.$set(this.bankarr, index, this.bankType[index][this.driverPayeeInfoList[index].binkindex])
  418. this.driverPayeeInfoList[index].bankDepositBranch = this.bankType[index][e.detail.value];
  419. },
  420. carLongChange(e, index) {
  421. this.carLongIndex = e.detail.value
  422. this.carLong = this.carLongType[this.carLongIndex];
  423. this.driverCarInfoList[index].carLength = this.carLongType[this.carLongIndex];
  424. this.carLengtharr[index] = this.carLongType[this.carLongIndex];
  425. },
  426. opencarclick() {
  427. if (this.opencarboolean == false) {
  428. this.opencarboolean = true;
  429. this.opencar = "../../static/img/authentication/up2%20(3).png"
  430. } else if (this.opencarboolean == true) {
  431. this.opencarboolean = false;
  432. this.opencar = "../../static/img/authentication/down2@3x.png"
  433. }
  434. },
  435. openuserclick() {
  436. if (this.openuserboolean == false) {
  437. this.openuserboolean = true;
  438. this.openuser = "../../static/img/authentication/up2%20(3).png"
  439. } else if (this.openuserboolean == true) {
  440. this.openuserboolean = false;
  441. this.openuser = "../../static/img/authentication/down2@3x.png"
  442. }
  443. }
  444. }
  445. }
  446. </script>
  447. <style scoped>
  448. .center {
  449. padding: 10px 20px;
  450. background-color: #F5F6FA;
  451. }
  452. .c-row {
  453. display: -webkit-box;
  454. display: -webkit-flex;
  455. display: flex;
  456. -webkit-box-align: center;
  457. -webkit-align-items: center;
  458. align-items: center;
  459. padding: 20rpx 30rpx;
  460. position: relative;
  461. line-height: 36px;
  462. }
  463. .con-list {
  464. -webkit-box-flex: 1;
  465. -webkit-flex: 1;
  466. flex: 1;
  467. display: -webkit-box;
  468. display: -webkit-flex;
  469. display: flex;
  470. -webkit-box-orient: vertical;
  471. -webkit-box-direction: normal;
  472. -webkit-flex-direction: column;
  473. flex-direction: column;
  474. color: #AFB3BF;
  475. line-height: 40rpx;
  476. text-align: right;
  477. padding-right: 20rpx;
  478. font-size: 14px;
  479. }
  480. .open {
  481. width: 30px;
  482. height: 20px;
  483. position: absolute;
  484. right: 20px;
  485. margin-top: -10px;
  486. }
  487. .information {
  488. margin-top: 10px;
  489. width: 100%;
  490. height: 56px;
  491. background-color: #FFFFFF;
  492. border-radius: 16px;
  493. }
  494. .informations {
  495. margin-top: 10px;
  496. background-color: #FFFFFF;
  497. border-radius: 20px;
  498. }
  499. .btn {
  500. margin-top: 10px;
  501. background-color: #FFFFFF;
  502. border-radius: 25px;
  503. border: none;
  504. }
  505. .btns {
  506. background-color: #22C572;
  507. }
  508. .add {
  509. width: 26px;
  510. height: 26px;
  511. /* background-image: url(../../static/img/jiaoyi/ic_fabu@3x.png); */
  512. }
  513. /* 清除 */
  514. .eliminate {
  515. width: 20px;
  516. height: 20px;
  517. float: right;
  518. }
  519. .bankImg {
  520. width: 20px;
  521. height: 20px;
  522. }
  523. </style>