driverIdentityTwo.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  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. </view>
  84. <view class="c-row b-b">
  85. <text class="tit">银行卡照片(可选)</text>
  86. <view class="con-list">
  87. <!-- <input placeholder="请上传照片" name="input" v-model="items.payeeAddressUrl" @clisk="bankimg(items)"></input> -->
  88. <view v-if="bankimg == ''" @click="bankimgs(index)">请上传照片</view>
  89. <view v-if="bankimg != ''" @click="bankimgs(index)">
  90. <image v-bind:src="bankimg" style="width: 40px; height: 40px;"></image>
  91. </view>
  92. </view>
  93. </view>
  94. <view class="c-row b-b">
  95. <text class="tit">银行卡号</text>
  96. <view class="con-list">
  97. <input placeholder="请输入银行卡号" name="input" v-model="items.bankCard"></input>
  98. </view>
  99. </view>
  100. <view class="c-row b-b">
  101. <text class="tit">开户行</text>
  102. <view class="con-list">
  103. <input placeholder="请输入开户行" name="input" v-model="items.bankDeposit"></input>
  104. </view>
  105. </view>
  106. <view class="c-row b-b">
  107. <text class="tit">开户支行</text>
  108. <picker @change="bankChange" :value="bankIndex" :range="bankType" class="con-list">
  109. <view class="con-list">
  110. {{bankIndex>-1?bankType[bankIndex]:'请选择开户支行'}}
  111. </view>
  112. </picker>
  113. </view>
  114. <view class="c-row b-b">
  115. <text class="tit">收款人姓名</text>
  116. <view class="con-list">
  117. <input placeholder="请输入收款人姓名" name="input" v-model="items.payeeName"></input>
  118. </view>
  119. </view>
  120. <view class="c-row b-b">
  121. <text class="tit">收款人身份证号</text>
  122. <view class="con-list">
  123. <input placeholder="请输入收款人身份证号" name="input" v-model="items.payeeNumberCard"></input>
  124. </view>
  125. </view>
  126. </view>
  127. <button class="btn" v-if="openuserboolean == true" @click="userAdd()">
  128. <image src="../../static/img/jiaoyi/ic_fabu@3x.png" class="add" style="top: 8px;"></image>
  129. <text style="margin-top: -2px;">添加账户</text>
  130. </button>
  131. <button class="btns btn" @click="jumpUrl">下一步</button>
  132. </view>
  133. </view>
  134. </template>
  135. <script>
  136. import {
  137. mapState
  138. } from 'vuex';
  139. export default {
  140. data() {
  141. return {
  142. opencar: "../../static/img/authentication/down2@3x.png",
  143. openuser: "../../static/img/authentication/down2@3x.png",
  144. opencarboolean: false,
  145. openuserboolean: false,
  146. driverCarInfoList: [{
  147. carNumber: '',
  148. carModel: "高栏",
  149. carLength: "13",
  150. carLoad: "",
  151. yearManufacture: "",
  152. }],
  153. driverPayeeInfoList: [
  154. {
  155. accountType:"",
  156. cardAddressUrl:"",
  157. bankCard:"",
  158. bankDeposit:"",
  159. bankDepositBranch:"",
  160. payeeName:"",
  161. payeeNumberCard:"",
  162. }
  163. ],
  164. ModelIndex: 0,
  165. Model: '',
  166. ModelType: ["高栏", "集装箱", "自卸车"],
  167. carLong: '',
  168. carLongIndex: 0,
  169. carLongType: ['13', '9.6', '8.2', '8.7', '11.7', '12.5', '13.7', '15', '16', '17.5'],
  170. DriverViewInfo:{},
  171. bankimg:"",
  172. bankImgs1:{},
  173. bankIndex:-1,
  174. bankType:[],
  175. }
  176. },
  177. onLoad(options){
  178. this.DriverViewInfo = JSON.parse(options.DriverViewInfo)
  179. },
  180. methods: {
  181. bankimgs(items){
  182. console.log(items)
  183. var that = this
  184. wx.chooseImage({
  185. success: function(res) {
  186. wx.uploadFile({
  187. url: 'https://www.zthymaoyi.com/upload/admin',
  188. filePath: res.tempFilePaths[0],
  189. name: 'file',
  190. success(res) {
  191. var data = res.data
  192. var strToObj = JSON.parse(data)
  193. // that.id[0] = strToObj.url
  194. that.bankimg = strToObj.url
  195. that.bankImgs1.bankImg = strToObj.url
  196. that.$api.doRequest('get', '/driverViewInfo/bankShibie', that.bankImgs1).then(res => {
  197. console.log(res)
  198. that.$set(that.driverPayeeInfoList[items],'bankCard',res.data.data.bankNo)
  199. that.$set(that.driverPayeeInfoList[items],'bankDeposit',res.data.data.bankName)
  200. that.bankType = res.data.data.bankNameZhihang
  201. console.log(that.ban)
  202. }).catch(res => {
  203. uni.showToast({
  204. title: res.data.message,
  205. icon: 'none',
  206. duration: 2000
  207. })
  208. })
  209. }
  210. })
  211. }
  212. })
  213. },
  214. jumpUrl(){
  215. for(var i = 0 ; i < this.driverCarInfoList.length ; i++){
  216. if (!this.driverCarInfoList[i].carNumber) {
  217. this.$api.msg('车牌号不能为空')
  218. return
  219. }
  220. if (!this.driverCarInfoList[i].carModel) {
  221. this.$api.msg('车型不能为空')
  222. return
  223. }
  224. if (!this.driverCarInfoList[i].carLength) {
  225. this.$api.msg('车长不能为空')
  226. return
  227. }
  228. if (!this.driverCarInfoList[i].carLoad) {
  229. this.$api.msg('载重不能为空')
  230. return
  231. }
  232. if (!this.driverCarInfoList[i].yearManufacture) {
  233. this.$api.msg('出厂年份不能为空')
  234. return
  235. }
  236. }
  237. for(var i = 0 ; i < this.driverPayeeInfoList.length ; i++){
  238. if (!this.driverPayeeInfoList[i].accountType) {
  239. this.$api.msg('账户类型不能为空')
  240. return
  241. }
  242. // if (!this.driverCarInfoList[i].cardAddressUrl) {
  243. // this.$api.msg('银行卡照片不能为空')
  244. // }
  245. if (!this.driverPayeeInfoList[i].bankCard) {
  246. this.$api.msg('银行卡号不能为空')
  247. return
  248. }
  249. if (!this.driverPayeeInfoList[i].bankDeposit) {
  250. this.$api.msg('开户行不能为空')
  251. return
  252. }
  253. if (!this.driverPayeeInfoList[i].bankDepositBranch) {
  254. this.$api.msg('开户支行不能为空')
  255. return
  256. }
  257. if (!this.driverPayeeInfoList[i].payeeName) {
  258. this.$api.msg('收款人姓名不能为空')
  259. return
  260. }
  261. if (!this.driverPayeeInfoList[i].payeeNumberCard) {
  262. this.$api.msg('收款人身份证号不能为空')
  263. return
  264. }
  265. }
  266. this.DriverViewInfo.driverCarInfoList = this.driverCarInfoList
  267. this.DriverViewInfo.driverPayeeInfoList = this.driverPayeeInfoList
  268. this.DriverViewInfo.driverPayeeInfoList.payeeAddressUrl = this.bankimg
  269. var model = JSON.stringify(this.DriverViewInfo);
  270. uni.navigateTo({
  271. url: `/pageD/identity/driverIdentityThree?DriverViewInfo=` + model
  272. })
  273. },
  274. carAdd() {
  275. this.driverCarInfoList.push({
  276. carNumber: '',
  277. carModel: "",
  278. carLength: "",
  279. carLoad: "",
  280. yearManufacture: "",
  281. })
  282. },
  283. userAdd() {
  284. this.driverPayeeInfoList.push({
  285. accountType:"",
  286. cardAddressUrl:"",
  287. bankCard:"",
  288. bankDeposit:"",
  289. bankDepositBranch:"",
  290. payeeName:"",
  291. payeeNumberCard:"",
  292. })
  293. },
  294. carDel(index) {
  295. if (this.driverCarInfoList.length > 1) {
  296. this.driverCarInfoList.splice(index, 1)
  297. }
  298. },
  299. userDel(index) {
  300. if (this.driverPayeeInfoList.length > 1) {
  301. this.driverPayeeInfoList.splice(index, 1)
  302. }
  303. },
  304. ModelChange(e) {
  305. this.ModelIndex = e.detail.value
  306. this.Model = this.ModelType[this.ModelIndex];
  307. this.driverCarInfoList[this.driverCarInfoList.length - 1].carModel = this.ModelType[this.ModelIndex];
  308. },
  309. bankChange(e) {
  310. this.bankIndex = e.detail.value
  311. this.Model = this.bankType[this.bankIndex];
  312. this.driverPayeeInfoList[this.driverPayeeInfoList.length - 1].bankDepositBranch = this.bankType[this.bankIndex];
  313. },
  314. carLongChange(e) {
  315. this.carLongIndex = e.detail.value
  316. this.carLong = this.carLongType[this.carLongIndex];
  317. this.driverCarInfoList[this.driverCarInfoList.length - 1].carLength = this.carLongType[this.carLongIndex];
  318. },
  319. opencarclick() {
  320. if (this.opencarboolean == false) {
  321. this.opencarboolean = true;
  322. this.opencar = "../../static/img/authentication/up2%20(3).png"
  323. } else if (this.opencarboolean == true) {
  324. this.opencarboolean = false;
  325. this.opencar = "../../static/img/authentication/down2@3x.png"
  326. }
  327. },
  328. openuserclick() {
  329. if (this.openuserboolean == false) {
  330. this.openuserboolean = true;
  331. this.openuser = "../../static/img/authentication/up2%20(3).png"
  332. } else if (this.openuserboolean == true) {
  333. this.openuserboolean = false;
  334. this.openuser = "../../static/img/authentication/down2@3x.png"
  335. }
  336. }
  337. }
  338. }
  339. </script>
  340. <style scoped>
  341. .center {
  342. padding: 10px 20px;
  343. background-color: #F5F6FA;
  344. }
  345. .c-row {
  346. display: -webkit-box;
  347. display: -webkit-flex;
  348. display: flex;
  349. -webkit-box-align: center;
  350. -webkit-align-items: center;
  351. align-items: center;
  352. padding: 20rpx 30rpx;
  353. position: relative;
  354. line-height: 36px;
  355. }
  356. .con-list {
  357. -webkit-box-flex: 1;
  358. -webkit-flex: 1;
  359. flex: 1;
  360. display: -webkit-box;
  361. display: -webkit-flex;
  362. display: flex;
  363. -webkit-box-orient: vertical;
  364. -webkit-box-direction: normal;
  365. -webkit-flex-direction: column;
  366. flex-direction: column;
  367. color: #AFB3BF;
  368. line-height: 40rpx;
  369. text-align: right;
  370. padding-right: 20rpx;
  371. font-size: 14px;
  372. }
  373. .open {
  374. width: 30px;
  375. height: 20px;
  376. position: absolute;
  377. right: 20px;
  378. margin-top: -10px;
  379. }
  380. .information {
  381. margin-top: 10px;
  382. width: 100%;
  383. height: 56px;
  384. background-color: #FFFFFF;
  385. border-radius: 16px;
  386. }
  387. .informations {
  388. margin-top: 10px;
  389. background-color: #FFFFFF;
  390. border-radius: 20px;
  391. }
  392. .btn {
  393. margin-top: 10px;
  394. background-color: #FFFFFF;
  395. border-radius: 25px;
  396. border: none;
  397. }
  398. .btns{
  399. background-color: #22C572;
  400. }
  401. .add{
  402. width: 26px;
  403. height: 26px;
  404. /* background-image: url(../../static/img/jiaoyi/ic_fabu@3x.png); */
  405. }
  406. /* 清除 */
  407. .eliminate {
  408. width: 20px;
  409. height: 20px;
  410. float: right;
  411. }
  412. .bankImg{
  413. width: 20px;
  414. height: 20px;
  415. }
  416. </style>