Files
b2894lxlx c8e651b7a6 fix: 支付去掉货到付款,样式穿透改为 ::v-deep
支付单改为上传凭证和附件,尾款或全款时提示交易已完结。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-19 14:20:52 +08:00

470 lines
15 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="">
<u-sticky offset-top="0" customNavHeight="0">
<uititle title="出证申请"></uititle>
</u-sticky>
<view class="w-100p">
<view class="certificate-container bg-white p-20">
<!-- 申请表格 -->
<u-parse :content="content"></u-parse>
<!-- 出证样板选择 -->
<view class="form-item mb-20">
<view class="form-label">出证样板查看</view>
</view>
<!-- 出证方式 -->
<view class="form-item mb-20">
<view class="form-label">出证方式</view>
<view class="form-content">
<el-radio v-model="form.certificateType" label="normal">(正常)出证时效({{ amount }}元/份)</el-radio>
<el-radio v-model="form.certificateType" label="urgent">(加急)出证时效({{
urgentAmount
}}元/份)
</el-radio>
</view>
</view>
<!-- 发票类型 -->
<view class="form-item mb-20">
<view class="form-label">发票类型</view>
<view class="form-content">
<el-radio v-model="form.invoiceTypes" label="none">无需开具发票</el-radio>
<el-radio v-model="form.invoiceTypes" label="electronic">增值税专用发票(电子发票)</el-radio>
<el-radio v-model="form.invoiceTypes" label="normal">普票(电子发票)</el-radio>
</view>
</view>
<!-- 发票抬头 -->
<template v-if="form.invoiceTypes !== 'none'">
<view class="form-item mb-20">
<view class="form-label">发票抬头</view>
<view class="form-content">
<el-form :model="form.invoice" label-width="100px">
<el-form-item label="名称:" required>
<el-input v-model="form.invoice.companyName" placeholder="请输入企业名称或个人姓名"></el-input>
</el-form-item>
<el-form-item label="税号/证号:" required>
<el-input v-model="form.invoice.taxNumber" placeholder="请输入税号或身份证号"></el-input>
</el-form-item>
<el-form-item label="开户行:">
<el-input v-model="form.invoice.bankName"></el-input>
</el-form-item>
<el-form-item label="开户账号:">
<el-input v-model="form.invoice.bankAccount"></el-input>
</el-form-item>
<el-form-item label="联系电话:" required>
<el-input v-model="form.invoice.phone"></el-input>
</el-form-item>
</el-form>
</view>
</view>
<!-- 电子发票接收信息 -->
<!-- <view class="form-item mb-20">-->
<!-- <view class="form-label">电子发票接收信息</view>-->
<!-- <view class="form-content">-->
<!-- <el-form :model="form.electronicInvoice" label-width="100px">-->
<!-- <el-form-item label="收票人:" required>-->
<!-- <el-input v-model="form.electronicInvoice.receiver"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="手机号码:" required>-->
<!-- <el-input v-model="form.electronicInvoice.phone"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="邮箱:" required>-->
<!-- <el-input v-model="form.electronicInvoice.email"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- </view>-->
<!-- </view>-->
</template>
<!-- 出证交付方式 -->
<view class="form-item mb-20">
<view class="form-label">出证交付方式</view>
<view class="form-content pos-r">
<el-checkbox v-model="form.deliveryMethods.electronic" @change="selectEle">电子</el-checkbox>
<!-- <el-form v-if="form.deliveryMethods.electronic" :model="form.electronicDelivery" label-width="100px">-->
<!-- <el-form-item label="收件人姓名:">-->
<!-- <el-input v-model="form.electronicDelivery.receiver"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="手机号码:">-->
<!-- <el-input v-model="form.electronicDelivery.phone"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="收件邮箱:">-->
<!-- <el-input v-model="form.electronicDelivery.email"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<el-checkbox v-model="form.deliveryMethods.paper" @change="selectPaper">纸质邮寄</el-checkbox>
<el-form v-if="form.deliveryMethods.paper" :model="form.paperDelivery" label-width="100px">
<el-form-item label="收件人姓名:">
<el-input v-model="form.paperDelivery.receiver"></el-input>
</el-form-item>
<el-form-item label="手机号码:">
<el-input v-model="form.paperDelivery.phone"></el-input>
</el-form-item>
<el-form-item label="收件地址:">
<el-input v-model="form.paperDelivery.address"></el-input>
</el-form-item>
</el-form>
</view>
</view>
<!-- 支付方式 -->
<view class="form-item mb-20">
<view class="form-label">支付方式</view>
<view class="form-content">
<el-radio v-model="form.paymentMethod" label="advance">公对公支付</el-radio>
<el-radio v-model="form.paymentMethod" label="online">在线支付</el-radio>
<template v-if="form.paymentMethod === 'advance'">
<u-upload
:fileList="payVoucher"
@afterRead="afterRead($event, 'payVoucher')"
@delete="deletePic($event, 'payVoucher')"
:maxCount="1"
width="120rpx"
height="120rpx"
></u-upload>
<p>上传付款凭证</p>
</template>
</view>
</view>
<view v-if="form.paymentMethod === 'advance'" v-html="bankAccount"></view>
<!-- 提交按钮 -->
<view class="text-center mb-20">
<el-button type="primary" @click="submitForm" v-if="form.paymentMethod === 'online'">提交支付</el-button>
<el-button type="primary" @click="uploadSuccess" v-else>提交支付</el-button>
</view>
<!-- 客服电话 -->
<view class="text-center">
<view class="service-phone">客服电话:400 686 5559</view>
</view>
</view>
</view>
</view>
</template>
<script>
import uititle from "@/components/common/title.vue";
import dayjs from "dayjs";
export default {
components: {uititle},
data() {
return {
form: {
sampleSelected: false,
certificateType: 'normal',
lawPrice: '100',
agreementPrice: '150',
invoiceTypes: 'none',
invoice: {
companyName: '',
taxNumber: '',
bankName: '',
bankAccount: '',
phone: ''
},
electronicInvoice: {
receiver: '',
phone: '',
email: ''
},
deliveryMethods: {
electronic: true,
paper: false
},
electronicDelivery: {
receiver: '',
phone: '',
email: ''
},
paperDelivery: {
receiver: '',
phone: '',
address: ''
},
paymentMethod: 'online',
payVoucher: '',
paidConfirm: false,
hasReport: false,
},
contractId: null,
transactionId: null,
amount: null,
urgentAmount: null,
content: null,
bankAccount: null,
payVoucher: []
}
},
onLoad({contractId, transactionId,}) {
this.contractId = contractId;
this.transactionId = transactionId;
this.getContent()
this.getAmount()
this.getUrgentAmount()
this.getUserInfo()
this.getBankAccount()
},
methods: {
async getUserInfo(){
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.form.invoice.companyName = userInfo.accountType === 2 ? userInfo.company.companyName : userInfo.person.personName
this.form.invoice.taxNumber = userInfo.accountType === 2 ? userInfo.company.organization : userInfo.person.idCard
this.form.invoice.phone = userInfo.accountType === 2 ? userInfo.company.mobile : userInfo.person.mobile
},
async getContent() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'e647148e684a458a0295b0a239c3d539'
},
})
this.content = res.content
},
async getAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'd77d384f684a47b6029a135220ecf4c9'
},
})
this.amount = res.content
},
async getUrgentAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '8524406c684a47c402985cb55941b3cb'
},
})
this.urgentAmount = res.content
},
afterRead({file}, field) {
uniCloud.uploadFile({
filePath: file.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + file.name,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.payVoucher = [{url: res.fileList[0].tempFileURL}]
this.form.payVoucher = res.fileList[0].tempFileURL;
})
}
})
},
deletePic({index}, field) {
this[field] = []
this.form.payVoucher = null
},
uploadSuccess() {
if (!this.form.payVoucher) return vk.toast('请上传付款凭证');
this.submitForm()
},
submitForm() {
// 表单验证
if (!this.validateForm()) {
return;
}
if (this.form.certificateType === 'normal') {
this.form.amount = this.amount;
} else {
this.form.amount = this.urgentAmount;
}
uni.showModal({
title: '温馨提示',
content: `司法调证服务需向数据中心付费(${this.form.amount}元/次),是否继续?`,
success: async res => {
if (res.confirm) {
this.form.contractId = this.contractId;
this.form.contractNo = this.transactionId;
vk.callFunction({
url: 'client/contract/kh/certificateAdd',
title: '提交中...',
data: this.form,
success: async (res) => {
this.$message({
message: '申请提交成功',
type: 'success'
});
if (this.form.paymentMethod === 'online') {
const {data} = await vk.callFunction({
url: 'client/contract/kh/buy',
title: '请求中...',
data: {
contractId: this.contractId,
contractNo: this.transactionId,
amount: this.form.amount
},
})
vk.navigateTo({
url: `/pages/shop/pay?id=${data}`
})
} else {
this.$message({
message: '请等待后台审核',
type: 'success'
});
setTimeout(() => {
vk.navigateTo({
url: `/pages/public/sign?tab=signBuyLog`
})
}, 1500)
}
}
});
}
}
})
},
validateForm() {
// 验证必填项
// if (this.form.deliveryMethods.electronic) {
// if (!this.form.electronicDelivery.receiver) {
// this.$message.error('请填写电子发送邮箱的收件人姓名');
// return false;
// }
// if (!this.form.electronicDelivery.phone) {
// this.$message.error('请填写电子发送邮箱的手机号码');
// return false;
// }
// if (!this.form.electronicDelivery.email) {
// this.$message.error('请填写电子发送邮箱的收件邮箱');
// return false;
// }
// }
if (this.form.deliveryMethods.paper) {
if (!this.form.paperDelivery.receiver) {
this.$message.error('请填写纸质邮寄的收件人姓名');
return false;
}
if (!this.form.paperDelivery.phone) {
this.$message.error('请填写纸质邮寄的手机号码');
return false;
}
if (!this.form.paperDelivery.address) {
this.$message.error('请填写纸质邮寄的收件地址');
return false;
}
}
return true;
},
async getBankAccount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'b5ad93e068f343230344c7b63cb1aac5'
},
})
this.bankAccount = res.content
},
selectEle(e) {
if (e) {
this.form.deliveryMethods.electronic = true;
this.form.deliveryMethods.paper = false;
} else {
this.form.deliveryMethods.electronic = false;
this.form.deliveryMethods.paper = true;
}
},
selectPaper(e) {
if (!e) {
this.form.deliveryMethods.electronic = true;
this.form.deliveryMethods.paper = false;
} else {
this.form.deliveryMethods.electronic = false;
this.form.deliveryMethods.paper = true;
}
},
}
}
</script>
<style scoped lang="scss">
.w-1200 {
width: 1200px;
margin: 20px auto;
}
.certificate-container {
border-radius: 4px;
}
.title {
font-size: 24px;
font-weight: bold;
}
.certificate-table {
width: 100%;
table {
border-collapse: collapse;
width: 100%;
th, td {
border: 1px solid #dcdfe6;
padding: 8px;
text-align: center;
}
th {
background-color: #f5f7fa;
}
}
}
.notice {
border: 1px solid #dcdfe6;
padding: 10px;
border-radius: 4px;
.notice-title {
font-weight: bold;
margin-bottom: 5px;
}
.notice-item {
font-size: 14px;
line-height: 1.5;
color: #606266;
}
}
.form-item {
margin-bottom: 20px;
.form-label {
font-weight: bold;
margin-bottom: 10px;
}
.form-content {
padding: 0 20px;
}
}
.w-100 {
width: 100px;
}
.required ::v-deep .el-form-item__label:before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
.service-phone {
font-size: 16px;
font-weight: bold;
color: #333;
}
</style>