|
@@ -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);
|
|
|
}
|
|
|
|