driverIdentityTwo.vue 15 KB

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