提交 e23e5fa9 authored 作者: matian's avatar matian

更新代码

上级 3694a03f
<template> <template>
<div> <div>
<!-- 财务 --> <app-card title="支付明细信息">
<el-button type="danger" v-if="isFINANCE" @click="fetchToTicketDetail('FINANCE')">{{ btnText1 }}</el-button> <table border="1" width="100%" cellspacing="0" class="tableDetail">
<!-- 业务 --> <tr>
<el-button type="danger" v-if="isBUSINESS" @click="fetchToTicketDetail('BUSINESS')">{{ btnText2 }}</el-button> <th>支付人姓名</th>
<app-card title="订单信息" style="margin-top: 20px"> <td>{{ row.payer_name }}</td>
<Order :dealList="dealList" /> <th>费用类型</th>
<td>{{ dealList.type_name }}</td>
<th>支付金额</th>
<td>{{ row.amount }}</td>
<th>支付状态</th>
<td>{{ row.payment_status }}</td>
</tr>
<tr>
<th>支付方式</th>
<td>{{ row.payment_method }}</td>
<th>其他支付方式</th>
<td>{{ row.payment_method_others }}</td>
<th>支付时间</th>
<td colspan="3">{{ row.payment_time }}</td>
</tr>
<tr>
<td></td>
<td colspan="7">
<img :src="row.payment_voucher_filename" alt="" />
</td>
</tr>
<tr>
<th>项目</th>
<td>{{ dealList.project_id_name }}</td>
<th>销售</th>
<td>{{ dealList.sales_rep_user_id_name }}</td>
<th>渠道</th>
<td colspan="3">{{ dealList.channel_id_name }}</td>
</tr>
<tr>
<th>备注</th>
<td colspan="7">{{ row.comment }}</td>
</tr>
<tr>
<th>创建时间</th>
<td colspan="3">{{ row.created_time }}</td>
<th>更新时间</th>
<td colspan="3">{{ row.updated_time }}</td>
</tr>
</table>
</app-card> </app-card>
<app-card title="学员信息"> <app-card>
<Student :dealList="dealList" /> <el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
</app-card> <el-form-item label="支付状态" prop="payment_status">
<app-card title="收款信息"> <el-select v-model="form.payment_status" placeholder="请选择支付状态">
<Collection :dealList="dealList" /> <el-option label="支付已到账" value="21"></el-option>
</app-card> <el-option label="支付未到账" value="22"></el-option>
<app-card title="发票信息"> <el-option label="支付申请作废" value="23"></el-option>
<Ticket :dealList="dealList" /> </el-select>
</app-card> </el-form-item>
<app-card title="渠道信息"> <el-form-item label="手续费" label-width="80px" prop="service_charge">
<Channel :dealList="dealList" /> <el-input v-model="form.service_charge"></el-input>
</app-card> </el-form-item>
<app-card title="支付待确认记录"> <el-form-item label="到账时间" prop="receiving_time">
<Toconfirm :dealList="dealList" /> <el-date-picker
</app-card> v-model="form.receiving_time"
<app-card title="支付确认记录"> type="datetime"
<Confirmed :dealList="dealList" /> range-separator="至"
start-placeholder="开始日期时间"
end-placeholder="结束日期时间"
value-format="yyyy-MM-dd HH:mm:ss"
size="small"
></el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="comment">
<el-input type="textarea" v-model="form.comment"> </el-input>
</el-form-item>
<el-form-item label="到账凭证" prop="receiving_voucher_filename">
<el-upload
list-type="picture-card"
action=""
multiple
:auto-upload="false"
:on-change="handleChange"
:on-remove="handleChange"
accept="image/*"
>
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="dealPay">提交</el-button>
</el-form-item>
</el-form>
</app-card> </app-card>
</div> </div>
</template> </template>
<script> <script>
// 组件
import AppCard from '@/components/base/AppCard.vue' import AppCard from '@/components/base/AppCard.vue'
import Order from '../components/Order.vue' import { payConfirm } from '../api'
import Student from '../components/Student.vue'
import Collection from '../components/Collection.vue'
import Ticket from '../components/Ticket.vue'
import Channel from '../components/Channel.vue'
import Toconfirm from '../components/Toconfirm.vue'
import Confirmed from '../components/Confirmed.vue'
import { payDetail, confirmPayDetail, cancelPayDetail } from '../api'
export default { export default {
components: { AppCard, Order, Student, Collection, Ticket, Channel, Toconfirm, Confirmed }, components: { AppCard },
data() { data() {
return { return {
id: '', row: {},
dealList: {} dealList: {},
} form: {
}, service_charge: '',
computed: { payment_status: '',
roles() { receiving_time: '',
return this.$store.state.roles comment: '',
}, receiving_voucher_filename: []
isFINANCE() { },
return ( rules: {
this.roles.includes('finance_manager') || payment_status: [{ required: true, message: '请选择支付状态', trigger: 'change' }],
this.roles.includes('finance_director') || service_charge: [{ required: true, message: '请输入手续费', trigger: 'blur' }],
this.roles.includes('developer') receiving_time: [{ required: true, message: '请选择到账时间', trigger: 'blur' }],
) comment: [{ required: true, message: '请输入备注', trigger: 'blur' }],
}, receiving_voucher_filename: [{ required: true, message: '请上传到账凭证', trigger: 'change' }]
isBUSINESS() { }
return (
this.roles.includes('admissions_director') ||
this.roles.includes('dean_of_admissions') ||
this.roles.includes('developer')
)
},
btnText1() {
return this.dealList.finance_confirm_status === 0 ? '财务确认足额支付' : '财务取消足额支付'
},
btnText2() {
return this.dealList.business_confirm_status === 0 ? '业务确认足额支付' : '业务取消足额支付'
} }
}, },
beforeMount() { mounted() {
this.id = this.$route.params.id // 详情列表 this.row = JSON.parse(this.$route.query.row)
// 获取发票详情信息 this.dealList = JSON.parse(this.$route.query.dealList)
this.fetchTicketDetail()
this.$store.dispatch('getRoles')
}, },
methods: { methods: {
fetchTicketDetail() { handleChange(file, fileList) {
const params = { id: this.id } this.form.receiving_voucher_filename = fileList
payDetail(params)
.then(res => {
this.dealList = res.data.list[0]
})
.catch(error => {
this.$message.error(error.message)
})
}, },
// 财务(业务)确认(取消)支付 // 确认支付
fetchToTicketDetail(val) { dealPay() {
const params = { const id = this.row.id
confirm_type: val, this.$refs.formRef.validate().then(() => {
id: this.id const params = Object.assign({ id: id }, this.form)
} // 图片上传
if (this.dealList.payment_status === '70') { this.form.receiving_voucher_filename.forEach((file, index) => {
// 确认 params[`receiving_voucher_filename[${index}]`] = file.raw
confirmPayDetail(params).then(res => {
this.fetchTicketDetail()
}) })
} else { delete params.receiving_voucher_filename
// 取消 payConfirm(params).then(res => {
cancelPayDetail(params).then(res => { history.go(-1)
this.fetchTicketDetail()
}) })
} })
} }
} }
} }
......
<template> <template>
<div> <div>
<template v-if="dealList.payment_status === '70'"> <!-- 财务 -->
<el-button <el-button type="danger" v-if="isFINANCE" @click="fetchToTicketDetail('FINANCE')">{{ btnText1 }}</el-button>
@click="fetchConfirmTicketDetail('FINANCE')" <!-- 业务 -->
type="danger" <el-button type="danger" v-if="isBUSINESS" @click="fetchToTicketDetail('BUSINESS')">{{ btnText2 }}</el-button>
v-if="isFINANCE && dealList.finance_confirm_status === 0"
>财务确认足额支付</el-button
>
<el-button
@click="fetchConfirmTicketDetail('BUSINESS')"
type="danger"
v-if="isBUSINESS && dealList.business_confirm_status === 0"
>业务确认足额支付</el-button
>
</template>
<template v-if="dealList.payment_status === '80'">
<el-button
@click="fetchCancelTicketDetail('FINANCE')"
type="danger"
v-if="isFINANCE && dealList.finance_confirm_status === 1"
>财务取消足额支付</el-button
>
<el-button
@click="fetchCancelTicketDetail('BUSINESS')"
type="danger"
v-if="isBUSINESS && dealList.business_confirm_status === 1"
>业务取消足额支付</el-button
>
</template>
<app-card title="订单信息" style="margin-top: 20px"> <app-card title="订单信息" style="margin-top: 20px">
<Order :dealList="dealList" /> <Order :dealList="dealList" />
</app-card> </app-card>
...@@ -88,6 +64,12 @@ export default { ...@@ -88,6 +64,12 @@ export default {
this.roles.includes('dean_of_admissions') || this.roles.includes('dean_of_admissions') ||
this.roles.includes('developer') this.roles.includes('developer')
) )
},
btnText1() {
return this.dealList.finance_confirm_status === 0 ? '财务确认足额支付' : '财务取消足额支付'
},
btnText2() {
return this.dealList.business_confirm_status === 0 ? '业务确认足额支付' : '业务取消足额支付'
} }
}, },
beforeMount() { beforeMount() {
...@@ -107,25 +89,23 @@ export default { ...@@ -107,25 +89,23 @@ export default {
this.$message.error(error.message) this.$message.error(error.message)
}) })
}, },
// 确认 // 财务(业务)确认(取消)支付
fetchConfirmTicketDetail(val) { fetchToTicketDetail(val) {
const params = { const params = {
confirm_type: val, confirm_type: val,
id: this.id id: this.id
} }
confirmPayDetail(params).then(res => { if (this.dealList.payment_status === '70') {
this.fetchTicketDetail() // 确认
}) confirmPayDetail(params).then(res => {
}, this.fetchTicketDetail()
// 取消 })
fetchCancelTicketDetail(val) { } else {
const params = { // 取消
confirm_type: val, cancelPayDetail(params).then(res => {
id: this.id this.fetchTicketDetail()
})
} }
cancelPayDetail(params).then(res => {
this.fetchTicketDetail()
})
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论