浏览代码

企业添加银行卡 修改

zhongtianhaoyuan 2 年之前
父节点
当前提交
4fe29abc53
共有 4 个文件被更改,包括 223 次插入195 次删除
  1. 137 125
      pages/mine/manageBankCards/addBankCard.vue
  2. 18 10
      pages/mine/myAccount/bankList.vue
  3. 7 2
      pages/mine/myAccount/withdrawal.vue
  4. 61 58
      pages/release/record.vue

+ 137 - 125
pages/mine/manageBankCards/addBankCard.vue

@@ -21,7 +21,8 @@
 					</u--input>
 				</view>
 				<view class="" @click="uploadImg">
-					<image src="../../../static/images/xiangji-2.png" mode="" style="width: 40rpx ;height: 40rpx;margin-top: 10rpx;"></image>
+					<image src="../../../static/images/xiangji-2.png" mode=""
+						style="width: 40rpx ;height: 40rpx;margin-top: 10rpx;"></image>
 				</view>
 			</view>
 			<view class="flex row">
@@ -43,7 +44,8 @@
 					<!-- <u--input class="select-bankzh point" placeholder="选择开户支行" inputAlign='left' border="none"
 						v-model="dataDetails.bankDepositBranch">
 					</u--input> -->
-					<view :style="{'color':dataDetails.bankDepositBranch?'#000':'#C6CBD5'}" style='font-size:15px;' class="select-bankzh" @click="selectZhbank">
+					<view :style="{'color':dataDetails.bankDepositBranch?'#000':'#C6CBD5'}" style='font-size:15px;'
+						class="select-bankzh" @click="selectZhbank">
 						{{dataDetails.bankDepositBranch?dataDetails.bankDepositBranch:'选择开户支行'}}
 					</view>
 					<view @click="manualInput" class="type">手动输入</view>
@@ -72,6 +74,14 @@
 					</view>
 				</view>
 			</view>
+			<view class="flex row noborder" v-if="enterpriseShow">
+				<view class="left-text">企业名称</view>
+				<view class="flex">
+					<u--input placeholder="输入企业名称" inputAlign='left' border="none" v-model="dataDetails.companyName"
+						maxlength="18">
+					</u--input>
+				</view>
+			</view>
 			<u-picker :show="isShowBank" :columns="columns" :closeOnClickOverlay='true' @close='zhBankClose'
 				@cancel='zhBankClose' @confirm='confirmBank'></u-picker>
 			</u-picker>
@@ -107,9 +117,9 @@
 					bankDeposit: '',
 					bankDepositBranch: '',
 				},
-				disabled:false,
+				disabled: false,
 				imagesrc: '',
-				submitstatus:false,
+				submitstatus: false,
 				columns: [
 
 				],
@@ -117,44 +127,54 @@
 				isShowManualInput: false,
 				index: '',
 				id: "", //司机身份证号
-				name: "" //司机姓名
+				name: "", //司机姓名
+				enterpriseShow: false, //判断是否有企业
+				enterprise: ""
 			};
 		},
 		computed: {
-			...mapState(['hasLogin', 'userInfo']),
+			...mapState(['hasLogin', 'userInfo', 'firstAuthentication']),
 		},
-		onLoad() {
+		onLoad(options) {
+			if (options && options.enterprise) { //判断是否是从企业页面进来的(有则是)
+				this.enterprise = options.enterprise
+			}
+			console.log(this.firstAuthentication.enterpriseOwner)
+			if (this.firstAuthentication.enterpriseOwner && this.firstAuthentication.enterpriseOwner == 1 && this
+				.enterprise) {
+				this.enterpriseShow = true
+			}
 			this.get_camera_permission()
 			_this = this;
 			// this.dataDetails.driverId = this.userInfo.driverId
 			_this.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', { //查身份证号
 				phone: uni.getStorageSync("userInfo").phone
 			}).then(res => {
-				if(res.data.authenticationStatus=='已认证'){
+				if (res.data.authenticationStatus == '已认证') {
 					this.id = res.data.cardNumber
 					this.name = res.data.name
-					this.dataDetails.cardholderIdNumber= res.data.cardNumber
-					this.dataDetails.cardholderName=res.data.name
-					this.disabled=true
+					this.dataDetails.cardholderIdNumber = res.data.cardNumber
+					this.dataDetails.cardholderName = res.data.name
+					this.disabled = true
 				}
 			})
 		},
 		methods: {
 			async get_camera_permission() {
-				var photol=await permision.requestAndroidPermission("android.permission.CAMERA")
-				if(photol == false){
+				var photol = await permision.requestAndroidPermission("android.permission.CAMERA")
+				if (photol == false) {
 					uni.showModal({
 						title: '提示',
 						content: '您已经关闭相机权限,去设置',
-						success: function (res) {
+						success: function(res) {
 							if (res.confirm) {
 								permision.gotoAppPermissionSetting()
-									            // plus.runtime.openURL("app-settings:");
+								// plus.runtime.openURL("app-settings:");
 							} else if (res.cancel) {
 								console.log('用户点击取消');
 							}
 						}
-					});	
+					});
 				}
 			},
 			delCard() {
@@ -187,23 +207,23 @@
 			},
 			manualInput() {
 				if (this.isShowManualInput) {
-					
+
 					if (uni.$u.test.isEmpty(this.dataDetails.payeeAddressUrl)) {
-						if(this.dataDetails.bankCard){
+						if (this.dataDetails.bankCard) {
 							this.$refs.uToast.show({
 								type: 'error',
 								message: "请手动输入开户支行!",
 							})
 							return true
-						}else{
+						} else {
 							this.$refs.uToast.show({
 								type: 'error',
 								message: "请填写卡号!",
 							})
 							return true
 						}
-						
-					}else if(this.dataDetails.payeeAddressUrl && uni.$u.test.isEmpty(this.columns)){
+
+					} else if (this.dataDetails.payeeAddressUrl && uni.$u.test.isEmpty(this.columns)) {
 						this.$refs.uToast.show({
 							type: 'error',
 							message: "请手动输入开户支行!",
@@ -251,7 +271,7 @@
 				// });
 			},
 			uploadImg() {
-				this.dataDetails.bankDepositBranch=''
+				this.dataDetails.bankDepositBranch = ''
 				this.imgTypeSelect()
 				// this.isShowimgType = true
 			},
@@ -271,7 +291,7 @@
 					})
 					return true
 				}
-				if (uni.$u.test.rangeLength(this.dataDetails.bankCard,[16,20])) {
+				if (uni.$u.test.rangeLength(this.dataDetails.bankCard, [16, 20])) {
 					this.$refs.uToast.show({
 						type: 'error',
 						message: "银行卡号输入错误!",
@@ -285,8 +305,8 @@
 					})
 					return true
 				}
-				
-				if (uni.$u.test.rangeLength(this.dataDetails.bankDeposit,[4,25])) {
+
+				if (uni.$u.test.rangeLength(this.dataDetails.bankDeposit, [4, 25])) {
 					this.$refs.uToast.show({
 						type: 'error',
 						message: "开户行输入错误!",
@@ -300,7 +320,7 @@
 					})
 					return true
 				}
-				if (uni.$u.test.rangeLength(this.dataDetails.bankDepositBranch,[4,25])) {
+				if (uni.$u.test.rangeLength(this.dataDetails.bankDepositBranch, [4, 25])) {
 					this.$refs.uToast.show({
 						type: 'error',
 						message: "开户支行输入错误!",
@@ -324,47 +344,47 @@
 			},
 
 			imgTypeSelect(val) {
-				
+
 				console.log(val)
 				// if (val.name == '相册') {
-					uni.chooseImage({
-						count: 1,
-						// sourceType: this.$helper.chooseImage.sourceType,
-						success: function(res) {
-							console.log(JSON.stringify(res.tempFilePaths));
-							uploadImage('image', res.tempFilePaths[0], 'appData/',
-								result => {
-									// 上传成功
-									console.log('图片地址', result)
-									_this.$request.baseRequest('get',
-											'/driverInfo/bankShibie', {
-												bankImg: result,
-											}).then(res => {
-											console.log(res)
-											_this.dataDetails.payeeAddressUrl = result
-											_this.columns = []
-											if (res.data.bankNo) {
-												_this.dataDetails.bankCard = res.data.bankNo
-											}
-											if (res.data.bankName) {
-												_this.dataDetails.bankDeposit = res.data.bankName
-											}
+				uni.chooseImage({
+					count: 1,
+					// sourceType: this.$helper.chooseImage.sourceType,
+					success: function(res) {
+						console.log(JSON.stringify(res.tempFilePaths));
+						uploadImage('image', res.tempFilePaths[0], 'appData/',
+							result => {
+								// 上传成功
+								console.log('图片地址', result)
+								_this.$request.baseRequest('get',
+										'/driverInfo/bankShibie', {
+											bankImg: result,
+										}).then(res => {
+										console.log(res)
+										_this.dataDetails.payeeAddressUrl = result
+										_this.columns = []
+										if (res.data.bankNo) {
+											_this.dataDetails.bankCard = res.data.bankNo
+										}
+										if (res.data.bankName) {
+											_this.dataDetails.bankDeposit = res.data.bankName
+										}
 
-											// 开户支行LIst
-											if (res.data.bankNameZhihang) {
-												_this.columns.push(res.data
-													.bankNameZhihang)
+										// 开户支行LIst
+										if (res.data.bankNameZhihang) {
+											_this.columns.push(res.data
+												.bankNameZhihang)
 
-											}
-											_this.$forceUpdate()
-										})
-										.catch(res => {
-											uni.$u.toast(res.message);
-										});
-								}
-							)
-						}
-					});
+										}
+										_this.$forceUpdate()
+									})
+									.catch(res => {
+										uni.$u.toast(res.message);
+									});
+							}
+						)
+					}
+				});
 
 				// } else {
 				// 	uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=bank');
@@ -392,71 +412,63 @@
 				// 	});
 				console.log(this.name)
 				if (that.validate()) return //校验  511303198809243079
-				if(!this.submitstatus){
-					this.submitstatus=true
-					if (that.dataDetails.cardholderName != this.name&&this.name!='') {
-					that.$refs.uToast.show({
-						type: 'error',
-						message: "收款人须为货主本人!",
-					})
-					return
-				} else {
-					uni.showLoading({
-						title: '加载中',
-						mask: true
-					})
-					
-					that.$request.baseRequest('get', '/driverPayeeInfo/bankCradShibie', { //三要素验证
-						name: that.dataDetails.cardholderName, //持卡人姓名
-						idCard: this.id, //货主身份证号
-						accountNo: that.dataDetails.bankCard //卡号
-					}).then(response => {
-						if (response.data.distinguishNum == "01") {
-							that.dataDetails.commonId = uni.getStorageSync("userInfo").id
-							delete that.dataDetails.payeeAddressUrl
-							that.$request.baseRequest('post', '/hyCargoOwnerPayeeInfo/api/addPayee',
-									that.dataDetails).then(res => {
+				if (!this.submitstatus) {
+					this.submitstatus = true
+					if (that.dataDetails.cardholderName != this.name && this.name != '') {
+						that.$refs.uToast.show({
+							type: 'error',
+							message: "收款人须为货主本人!",
+						})
+						return
+					} else {
+						uni.showLoading({
+							title: '加载中',
+							mask: true
+						})
+						that.$request.baseRequest('get', '/driverPayeeInfo/bankCradShibie', { //三要素验证
+							name: that.dataDetails.cardholderName, //持卡人姓名
+							idCard: this.id, //货主身份证号
+							accountNo: that.dataDetails.bankCard //卡号
+						}).then(response => {
+							if (response.data.distinguishNum == "01") {
+								that.dataDetails.commonId = uni.getStorageSync("userInfo").id
+								delete that.dataDetails.payeeAddressUrl
+								that.$request.baseRequest('post', '/hyCargoOwnerPayeeInfo/api/addPayee',
+										that.dataDetails).then(res => {
 										uni.hideLoading()
-									if (res.code == '200') {
-										let params = {
-											type: 'success',
-											message: "提交成功",
+										if (res.code == '200') {
+											let params = {
+												type: 'success',
+												message: "提交成功",
+											}
+											this.submitstatus = false
+											that.$refs.uToast.show({
+												...params
+											})
+											//uni.$u.route('/pages/mine/manageBankCards/index');
+											uni.navigateBack({
+												delta: 1
+											});
+
+										} else {
+											this.submitstatus = false
+											uni.$u.toast(res.message);
 										}
-										this.submitstatus=false
-										that.$refs.uToast.show({
-											...params
-										})
-										//uni.$u.route('/pages/mine/manageBankCards/index');
-										uni.navigateBack({
-											delta: 1
-										});
-					
-									} else {
-										this.submitstatus=false
+
+									})
+									.catch(res => {
+										uni.hideLoading()
+										this.submitstatus
 										uni.$u.toast(res.message);
-									}
-					
-								})
-								.catch(res => {
-									uni.hideLoading()
-									this.submitstatus
-									uni.$u.toast(res.message);
-								});
-						} else {
-							uni.hideLoading()
-							this.submitstatus=false
-							uni.$u.toast(response.data.distinguish);
-						}
-					})
-				}
+									});
+							} else {
+								uni.hideLoading()
+								this.submitstatus = false
+								uni.$u.toast(response.data.distinguish);
+							}
+						})
+					}
 				}
-				
-				
-
-
-
-
-
 			},
 		},
 	};
@@ -469,7 +481,7 @@
 	}
 
 	.content {
-		padding: 20rpx ;
+		padding: 20rpx;
 		height: calc(100vh - 23vh);
 	}
 

+ 18 - 10
pages/mine/myAccount/bankList.vue

@@ -6,15 +6,15 @@
 				<view class="text2">(共{{bankList?bankList.length:0}}张)</view>
 			</view> -->
 
-			<view v-if='bankList.length==0' @click="addBankCard" class="add-bankcard flex">
+			<view  @click="addBankCard" class="add-bankcard flex">
 				<view class="car-text">添加银行卡</view>
 				<u-icon class="icon" name="plus-circle-fill" color="#2979ff" size="24"></u-icon>
 			</view>
-			<view v-else><image style='width:17px;height:17px;' @click="del()" src="../../../static/mine/sanchu.png" mode=""></image></view>
 		</view>
 		<!-- <image src="../../../static/images/mine/bank/nongyelogo.png" mode=""></image> -->
 		<view class="card-list" v-for="(item,index) in bankList" @click="bankCheng(item)">
 			<view class="card-list-item" :style='{"background-image":"url("+item.cardColor+")"}'>
+				<image style='width:17px;height:17px;position: absolute;z-index: 9999;right: 20rpx;top: 20rpx;' @click.stop="del(item,index)" src="../../../static/mine/sanchu.png" mode=""></image>
 				<view class="flex flex-end number carNumber">{{item.bankCard}}</view>
 				<view class="flex align-center">
 					<!-- @/static/images/mine/bank/gflogo.png -->
@@ -44,13 +44,17 @@
 				obj:{},
 				index:null,
 				isShowAlert:false,
-				alertTitle:'确认删除该银行卡?'
+				alertTitle:'确认删除该银行卡?',
+				enterprise:"",//判断是否有值(有则是我的公司页面进来的  没有则是首页进来的)
 			};
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo']),
 		},
-		onLoad() {
+		onLoad(options) {
+			if(options && options.enterprise){
+				this.enterprise = options.enterprise
+			}
 			if (!this.hasLogin) {
 				uni.$u.route('/pages/public/login');
 			}
@@ -100,7 +104,6 @@
 								} else {
 									uni.$u.toast(res.message);
 								}
-
 							})
 							.catch(res => {
 								uni.$u.toast(res.message);
@@ -210,7 +213,11 @@
 					phone: uni.getStorageSync("userInfo").phone
 				}).then(res => {
 					if(res.data.authenticationStatus=='已认证'){
-						uni.$u.route('/pages/mine/manageBankCards/addBankCard');
+						if(this.enterprise){
+							uni.$u.route('/pages/mine/manageBankCards/addBankCard?enterprise='+this.enterprise);//企业添加银行卡标识
+						}else{
+							uni.$u.route('/pages/mine/manageBankCards/addBankCard');
+						}
 					}else{
 						this.$refs.uToast.show({
 							type: 'error',
@@ -230,11 +237,10 @@
 					...params
 				})
 			},
-			del() {
-				this.obj = this.bankList[0]
-				this.index =0
+			del(val,index) {
+				this.obj = val
+				this.index = index
 				this.isShowAlert = true
-		
 			}
 		},
 
@@ -266,6 +272,7 @@
 
 	.card-list {
 		padding: 0 20rpx;
+		margin-top: 20rpx;
 
 		.number {
 			color: white;
@@ -288,6 +295,7 @@
 		background-size: cover;
 		padding: 60rpx 43rpx 100rpx 43rpx;
 		border-radius: 20rpx;
+		position: relative;
 		.carNumber{
 			margin-bottom: 20rpx;
 		}

+ 7 - 2
pages/mine/myAccount/withdrawal.vue

@@ -88,6 +88,7 @@
 				alertTitle: "",
 				alertContent: "",
 				showCancelButton: true,
+				enterprise:""//企业名称
 			}
 		},
 		onLoad(options) {
@@ -126,14 +127,18 @@
 				})
 			},
 			bankChange() { //选择银行卡
-				uni.$u.route("/pages/mine/myAccount/bankList")
+				uni.$u.route("/pages/mine/myAccount/bankList?enterprise=" + this.enterprise)
 			},
 			getList() {
 				this.$request.baseRequest('get', '/cargoOwnerInfo/selectAccountBalance', {
 					id: this.id,
 					flag: this.flag
 				}).then(res => {
-					this.usableMoney = Number(res.data.accountBalance)
+					if(res.data){
+						this.usableMoney = Number(res.data.accountBalance)
+						this.enterprise = res.data.companyName
+					}
+					
 				})
 			},
 			writeIn() {

+ 61 - 58
pages/release/record.vue

@@ -23,12 +23,13 @@
 			        itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;"
 			    >
 			    </u-tabs> -->
-				<view class='tab-nav'>
-					<view class='tab-item' v-for='item in list1' @click='statuschange(item)' :class='{active:item.status==searchType}'>
-						{{item.name}} {{item.num}}	
-					</view>
+			<view class='tab-nav'>
+				<view class='tab-item' v-for='item in list1' @click='statuschange(item)'
+					:class='{active:item.status==searchType}'>
+					{{item.name}} {{item.num}}
 				</view>
-			
+			</view>
+
 			<!-- <u-tabs  :list="list1" @click="click"></u-tabs> -->
 			<view :id="'good'+good.id" class="good-list" v-for="good in goods" :key="good.id"
 				@click="toDetail(good.id)">
@@ -107,8 +108,8 @@
 		</mescroll-body>
 
 		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :confirmText='confirmText'
-			:closeOnClickOverlay='true' :showCancelButton='true' @confirm="$u.throttle(confirmClick, 5000)" @close="cancelClick"
-			@cancel="cancelClick" class="modal">
+			:closeOnClickOverlay='true' :showCancelButton='true' @confirm="$u.throttle(confirmClick, 5000)"
+			@close="cancelClick" @cancel="cancelClick" class="modal">
 		</u-modal>
 
 		<u-toast ref="uToast"></u-toast>
@@ -137,30 +138,30 @@
 				mescroll: null,
 				id: '',
 				confirmText: '确定',
-				searchType:'2',
+				searchType: '2',
 				alertTitle: '',
 				alertContent: "",
 				isShowAlert: false,
 				goods: [], // 数据列表
 				delOrShowHidden: '',
 				rowObj: {},
-				 list1: [{
-				    name: '审核中',
-					status:'1',
-					num:0,
-					}, {
-				    name: '已通过',
-					status:'3',
-					num:0,
-				    }, {
-				    name: '未通过',
-					status:'2',
-					num:0,
-				    }, {
-				    name: '已过期',
-					status:'4',
-					num:0,
-				    }],
+				list1: [{
+					name: '审核中',
+					status: '1',
+					num: 0,
+				}, {
+					name: '已通过',
+					status: '3',
+					num: 0,
+				}, {
+					name: '未通过',
+					status: '2',
+					num: 0,
+				}, {
+				 name: '已过期',
+					status: '4',
+					num: 0,
+				}],
 				upOption: {
 					page: {
 						size: 10 // 每页数据的数量,默认10
@@ -188,7 +189,7 @@
 			//#endif
 		},
 		onLoad() {
-			
+
 			// let _isHave = this.$utils.getRoles('aaa')
 			// console.log(_isHave)
 
@@ -220,8 +221,8 @@
 
 		// },
 		methods: {
-			statuschange(item){
-				this.searchType=item.status
+			statuschange(item) {
+				this.searchType = item.status
 				this.upCallback({
 					size: 10,
 					num: 1
@@ -322,9 +323,7 @@
 			back() {
 				uni.navigateBack(-1)
 			},
-			mescrollInit(mescroll) {
-				this.mescroll = mescroll;
-			},
+
 			radioChange(n) {
 				console.log('radioChange', n);
 
@@ -392,10 +391,10 @@
 				this.$request.baseRequest('get', '/publishTaskInfo/selectNum', {
 						commonId: this.userInfo.id,
 					}).then(res => {
-						this.list1[0].num=res.data.examieNum
-						this.list1[1].num=res.data.passNum
-						this.list1[2].num=res.data.noNum
-						this.list1[3].num=res.data.overdueNum
+						this.list1[0].num = res.data.examieNum
+						this.list1[1].num = res.data.passNum
+						this.list1[2].num = res.data.noNum
+						this.list1[3].num = res.data.overdueNum
 						console.log(res)
 					})
 					.catch(res => {
@@ -691,35 +690,39 @@
 	/deep/.u-modal__content {
 		flex-direction: column;
 	}
-	.tab-nav{
-		width:100%;
+
+	.tab-nav {
+		width: 100%;
 		background: white;
-		display:flex;
+		display: flex;
 	}
-	.tab-item{
-		width:25%;
-		display:block;
-		position:relative;
-		text-align:center;
-		padding:10px 0;
+
+	.tab-item {
+		width: 25%;
+		display: block;
+		position: relative;
+		text-align: center;
+		padding: 10px 0;
 		box-sizing: border-box;
-		color:#7D8087;
-		font-size:14px;
+		color: #7D8087;
+		font-size: 14px;
 	}
-	.tab-item.active{
-		color:#000;
-		font-size:16px;
+
+	.tab-item.active {
+		color: #000;
+		font-size: 16px;
 	}
-	.tab-item.active:after{
-		position:absolute;
-		content:'';
-		display:block;
-		width:50%;
-		left:50%;
+
+	.tab-item.active:after {
+		position: absolute;
+		content: '';
+		display: block;
+		width: 50%;
+		left: 50%;
 		transform: translate(-50%);
-		height:4px;
-		bottom:0;
-		background:#2772FB;
+		height: 4px;
+		bottom: 0;
+		background: #2772FB;
 		border-radius: 2px;
 	}
 </style>