374 lines
9.4 KiB
Vue
374 lines
9.4 KiB
Vue
<template>
|
|
<view class="Box">
|
|
<view class="Box_box_O">
|
|
|
|
<view class="Box_box flex-between">
|
|
<view>开票员姓名</view>
|
|
<view class="Box_box_input"><input type="text" v-model="form.taxname" placeholder="请填写开票员姓名"
|
|
data-key="mobile" /></view>
|
|
</view>
|
|
<view class="Box_box flex-between">
|
|
<view>开票员电话</view>
|
|
<view class="Box_box_input"><input type="text" v-model="form.taxphone" placeholder="请填写开票员电话"
|
|
data-key="mobile" /></view>
|
|
</view>
|
|
<view class="Box_box flex-between" @click="showpicker = true">
|
|
<view>开票员身份</view>
|
|
<view class="flex-start">
|
|
{{form.dlsf_name || ''}}<u-icon name="arrow-right" color="#999999" size="16"></u-icon>
|
|
</view>
|
|
</view>
|
|
<view class="Box_box flex-between">
|
|
<view>开票员身份证号</view>
|
|
<view class="Box_box_input"><input type="text" v-model="form.dlzh" placeholder="请填写开票员身份证号" /></view>
|
|
</view>
|
|
<view class="Box_box flex-between">
|
|
<view>开票员密码</view>
|
|
<view class="Box_box_input"><input type="text" v-model="form.dlmm" placeholder="请填写开票员密码"
|
|
data-key="mobile" /></view>
|
|
</view>
|
|
<view class="Box_box flex-between">
|
|
<view>验证码</view>
|
|
<view class="Box_box_input" style="display: flex; justify-content: flex-start;align-items: center;">
|
|
<input class="Box_box_inpuinputt" type="text" maxlength="6" v-model="form.code" placeholder="验证码"
|
|
data-key="mobile" />
|
|
<view class="repeats">
|
|
<view v-if="showText == true" style="padding: 8rpx;background: #288EFB; border-radius: 15rpx;"
|
|
@tap="$u.debounce(CodeRegister, 500)">
|
|
{{ Recapture }}
|
|
</view>
|
|
<view v-else
|
|
style="color: #ccc; background-color: #f9f9f9; padding: 8rpx; border-radius: 15rpx;">
|
|
{{ second }}s重新发送
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="preservation flex-colum">
|
|
<!-- <view v-if="form.status == '2'"
|
|
style="width: 100%; color: #FF2B2B; padding: 28rpx 0;word-wrap: break-word;">
|
|
拒接原因:({{form.no|| '无'}})</view> -->
|
|
<view v-if="!codefailed" class="preservation_boxs">提交</view>
|
|
<view v-else class="preservation_box" @tap="$u.throttle(saveMerchantBaseInfoV2, 1000)">提交</view>
|
|
|
|
</view>
|
|
<u-picker :show="showpicker" :columns="columns" @confirm='confirm' keyName="name"
|
|
@cancel='showpicker = false'></u-picker>
|
|
</view>
|
|
</template>
|
|
<script>
|
|
import selectaddress from '@/components/yixuan-selectAddress/yixuan-selectAddress.vue';
|
|
export default {
|
|
components: {
|
|
selectaddress
|
|
},
|
|
data() {
|
|
return {
|
|
showpicker: false,
|
|
disabled: false,
|
|
Uploadurlnumber: '',
|
|
namelang: '',
|
|
merchantAuditStatus: '',
|
|
columns: [
|
|
|
|
],
|
|
codefailed: false, //验证码是否发送成功
|
|
store_id: '',
|
|
// 注册定时器 初始值
|
|
second: 60,
|
|
showText: true,
|
|
Recapture: '发送验证码',
|
|
form: {
|
|
store_id: uni.getStorageSync('userId'),
|
|
dlzh: '',
|
|
dlmm: '',
|
|
taxname: '',
|
|
taxphone: '',
|
|
code: '',
|
|
dlsf_name: '',
|
|
dlsf: ''
|
|
}
|
|
};
|
|
},
|
|
onLoad(e) {
|
|
console.log(e.store)
|
|
let data = uni.getStorageSync('form')
|
|
},
|
|
onShow() {
|
|
this.onShowdata()
|
|
},
|
|
methods: {
|
|
async CodeRegister() {
|
|
if (this.form.dlzh == null || this.form.dlzh == '') {
|
|
uni.showToast({
|
|
title: '请填写电税账号',
|
|
icon: 'none'
|
|
});
|
|
return false;
|
|
}
|
|
if (this.form.dlmm == null || this.form.dlmm == '') {
|
|
uni.showToast({
|
|
title: '请填写电税密码',
|
|
icon: 'none'
|
|
});
|
|
return false;
|
|
}
|
|
if (this.form.taxname == null || this.form.taxname == '') {
|
|
uni.showToast({
|
|
title: '请填写办税员',
|
|
icon: 'none'
|
|
});
|
|
return false;
|
|
}
|
|
if (this.form.taxphone == null || this.form.taxphone == '') {
|
|
uni.showToast({
|
|
title: '请填写办税员电话',
|
|
icon: 'none'
|
|
});
|
|
return false;
|
|
}
|
|
if (this.form.dlsf == null || this.form.dlsf == '') {
|
|
uni.showToast({
|
|
title: '请选择办税员身份',
|
|
icon: 'none'
|
|
});
|
|
return false;
|
|
}
|
|
let res = await this.api.szzpyaddinvoicer(this.form)
|
|
if (res.code == 1) {
|
|
uni.showToast({
|
|
title: res.message || res.msg,
|
|
icon: "none",
|
|
})
|
|
// 定时器
|
|
this.showText = false;
|
|
this.Recapture = '重新获取';
|
|
var interval = setInterval(() => {
|
|
let times = --this.second;
|
|
this.second = times < 10 ? '0' + times : times; //小于10秒补 0
|
|
}, 1000);
|
|
setTimeout(() => {
|
|
clearInterval(interval);
|
|
this.second = 60;
|
|
this.showText = true;
|
|
}, 60000);
|
|
this.codefailed = true
|
|
}
|
|
|
|
},
|
|
async saveMerchantBaseInfoV2() {
|
|
if (this.form.code == null || this.form.code == '') {
|
|
|
|
uni.showToast({
|
|
title: '请填写验证码',
|
|
icon: 'none'
|
|
});
|
|
return false;
|
|
}
|
|
let res = await this.api.szzpyaddinvoicersendsms(this.form)
|
|
if (res.code == 1) {
|
|
uni.showToast({
|
|
title: res.message || res.msg,
|
|
icon: "none",
|
|
})
|
|
setTimeout(() => {
|
|
uni.navigateBack()
|
|
}, 1500);
|
|
//请求数电授权
|
|
// this.szzpyauthorization()
|
|
}
|
|
},
|
|
async szzpyauthorization() {
|
|
let res = await this.api.szzpyauthorization({
|
|
store_id: this.store_id
|
|
})
|
|
if (res.code == 1) {
|
|
setTimeout(() => {
|
|
uni.cache.set('form', '');
|
|
uni.reLaunch({
|
|
url: '/pages/index/index'
|
|
});
|
|
}, 2000);
|
|
}
|
|
},
|
|
async onShowdata() {
|
|
let res = await this.api.szzpytypeofinvoicer()
|
|
console.log(res)
|
|
this.columns = [res.data]
|
|
},
|
|
confirm(e) {
|
|
this.form.dlsf = e.value[0].id
|
|
this.form.dlsf_name = e.value[0].name
|
|
this.showpicker = false
|
|
},
|
|
Upload(i) {
|
|
if (this.disabled) {
|
|
return false;
|
|
} else {
|
|
this.Uploadurlnumber = i;
|
|
uni.chooseImage({
|
|
count: 1, //默认9
|
|
sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
sourceType: ['album', 'camera'], //从相册选择,和摄像头功能,默认二者都有
|
|
success: res => {
|
|
uni.pro.showLoading({
|
|
title: '上传中',
|
|
mask: true
|
|
});
|
|
var thisimgUrlcaca = res.tempFilePaths[0];
|
|
var that = this;
|
|
uni.uploadFile({
|
|
url: 'https://cashieradmin.sxczgkj.cn' + '/api/qiNiuContent',
|
|
filePath: thisimgUrlcaca,
|
|
name: 'file', // 后端接收的文件名
|
|
header: {
|
|
userId: uni.cache.get('userId'),
|
|
token: uni.cache.get('token'),
|
|
myLoginName: uni.cache.get('myLoginName')
|
|
},
|
|
success: res => {
|
|
console.log(res)
|
|
var thisdata_ = JSON.parse(res.data);
|
|
uni.showToast({
|
|
title: '上传成功',
|
|
icon: 'none',
|
|
success: () => {
|
|
uni.pro.hideLoading();
|
|
console.log(thisdata_.data[0]);
|
|
if (this.Uploadurlnumber == 0) {
|
|
this.$set(this.form,
|
|
'id_card_straight', thisdata_
|
|
.data[0])
|
|
} else if (this.Uploadurlnumber == 1) {
|
|
this.$set(this.form, 'id_card_reverse',
|
|
thisdata_.data[0])
|
|
} else {
|
|
this.$set(this.form,
|
|
'business_license', thisdata_
|
|
.data[0])
|
|
}
|
|
console.log(this.form)
|
|
}
|
|
});
|
|
},
|
|
fail: err => {
|
|
uni.pro.hideLoading();
|
|
uni.showToast({
|
|
title: thisdata_.message || thisdata_.msg,
|
|
icon: 'none',
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
page {
|
|
background: #fff;
|
|
}
|
|
|
|
.Box {
|
|
.Box_box_O {
|
|
padding: 0 28rpx;
|
|
|
|
.Box_box {
|
|
text-align: right;
|
|
padding: 24rpx;
|
|
border-bottom: 1px solid #e5e5e5;
|
|
font-size: 28rpx;
|
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
|
font-weight: 400;
|
|
color: #333333;
|
|
|
|
.Box_box_input {
|
|
position: relative;
|
|
width: 60%;
|
|
|
|
.Box_box_inpuinputt {
|
|
padding-right: 15rpx;
|
|
}
|
|
|
|
.repeats {
|
|
flex: none;
|
|
text-align: center;
|
|
font-size: 24rpx;
|
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
|
font-weight: 400;
|
|
color: #ffffff;
|
|
border-radius: 12rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.Box_box_T {
|
|
padding: 0 28rpx;
|
|
border-top: 16rpx solid #e5e5e5;
|
|
|
|
.Box_box_T_o {
|
|
padding: 28rpx 0;
|
|
text-align: center;
|
|
}
|
|
|
|
.flex-colum {
|
|
image {
|
|
width: 396rpx;
|
|
height: 240rpx;
|
|
}
|
|
|
|
padding-bottom: 16rpx;
|
|
border-bottom: 1px solid #e5e5e5;
|
|
|
|
.Box_box_Ts {
|
|
width: 396rpx;
|
|
height: 240rpx;
|
|
background: #ffffff;
|
|
border-radius: 8rpx;
|
|
border: 2rpx dashed #707070;
|
|
background: url(@/static/my2.png) no-repeat;
|
|
background-position: 50% 50%;
|
|
background-size: 50%;
|
|
}
|
|
}
|
|
}
|
|
|
|
.preservation {
|
|
width: 100%;
|
|
padding: 50rpx;
|
|
|
|
.preservation_box {
|
|
width: 70%;
|
|
height: 72rpx;
|
|
background: #288efb;
|
|
text-align: center;
|
|
line-height: 72rpx;
|
|
border-radius: 50rpx;
|
|
font-size: 36rpx;
|
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
|
font-weight: 400;
|
|
color: #ffffff;
|
|
}
|
|
|
|
.preservation_boxs {
|
|
width: 70%;
|
|
height: 72rpx;
|
|
background: #999999;
|
|
text-align: center;
|
|
line-height: 72rpx;
|
|
border-radius: 50rpx;
|
|
font-size: 36rpx;
|
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
|
font-weight: 400;
|
|
color: #ffffff;
|
|
}
|
|
}
|
|
}
|
|
</style> |