提交 9e4d2038 authored 作者: matian's avatar matian

代码提交

上级 ae37107d
...@@ -35,3 +35,7 @@ export function getTableColumns(params) { ...@@ -35,3 +35,7 @@ export function getTableColumns(params) {
export function updateTableColumns(data) { export function updateTableColumns(data) {
return httpRequest.post('/api/finance/v1/payments/update-title', data) return httpRequest.post('/api/finance/v1/payments/update-title', data)
} }
export function getRoles(params) {
return httpRequest.get('/api/finance/user/get-info', { params })
}
...@@ -49,7 +49,11 @@ export function payConfirm(data) { ...@@ -49,7 +49,11 @@ export function payConfirm(data) {
headers: { 'Content-Type': 'multipart/form-data' } headers: { 'Content-Type': 'multipart/form-data' }
}) })
} }
// 获取oss signature // 取消足额支付
export function getSignature() { export function confirmPayDetail(data) {
return httpRequest.get('/api/usercenter/aliyun/get-signature') return httpRequest.post('/api/finance/v1/payments/undo-confirm', data)
}
// 确认足额支付
export function cancelPayDetail(data) {
return httpRequest.post('/api/finance/v1/payments/undo-confirm', data)
} }
...@@ -17,15 +17,17 @@ const routes = [ ...@@ -17,15 +17,17 @@ const routes = [
}, },
{ {
name: 'deal', name: 'deal',
path: 'deal', path: 'payment/:id/deal',
component: () => import('./views/Deal.vue'), component: () => import('./views/Deal.vue'),
meta: { title: '支付详情' } meta: { title: '支付详情' },
props: true
}, },
{ {
name: 'paydetail', name: 'paydetail',
path: 'paydetail', path: 'payment/:id/view',
component: () => import('./views/PayDetail.vue'), component: () => import('./views/PayDetail.vue'),
meta: { title: '支付详情' } meta: { title: '支付详情' },
props: true
} }
] ]
} }
......
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
list-type="picture-card" list-type="picture-card"
action="" action=""
multiple multiple
show-file-list
:auto-upload="false" :auto-upload="false"
:on-change="handleChange" :on-change="handleChange"
:on-remove="handleChange" :on-remove="handleChange"
...@@ -129,8 +128,9 @@ export default { ...@@ -129,8 +128,9 @@ export default {
getPayDetail() { getPayDetail() {
payDetail({ id: this.id }).then(res => { payDetail({ id: this.id }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.project = res.data.list[0] const [first = {}] = res.data.list
this.confirmDetail = res.data.list[0].confirmed_details[0] this.project = first
this.confirmDetail = first.confirmed_details[0]
} }
}) })
}, },
...@@ -143,14 +143,14 @@ export default { ...@@ -143,14 +143,14 @@ export default {
params[`receiving_voucher_filename[${index}]`] = file.raw params[`receiving_voucher_filename[${index}]`] = file.raw
}) })
delete params.receiving_voucher_filename delete params.receiving_voucher_filename
payConfirm(params).then(res => { payConfirm(params)
if (res.code === 0) { .then(res => {
this.$message.success('支付已经到账') this.$message.success('支付已经到账')
history.go(-1) history.go(-1)
} else { })
this.$message.error('提交失败') .catch(error => {
} this.$message.error(error.message)
}) })
}) })
} }
} }
......
<template> <template>
<div> <div>
<el-button @click="fetchTicketDetail" type="danger">财务确认足额支付</el-button> <template v-if="dealList.payment_status === '70'">
<el-button @click="fetchTicketDetail" type="primary">刷新状态及金额</el-button> <el-button
@click="fetchConfirmTicketDetail('FINANCE')"
type="danger"
v-if="isFINANCE && dealList.finance_confirm_status === 0"
>财务确认足额支付</el-button
>
<el-button
@click="fetchConfirmTicketDetail('BUSINESS')"
type="danger"
v-if="isBUSINESS && dealList.bussiness_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.bussiness_confirm_status === 1"
>业务取消足额支付</el-button
>
</template>
<app-card title="订单信息"> <app-card title="订单信息">
<Order :dealList= "dealList" /> <Order :dealList="dealList" />
</app-card> </app-card>
<app-card title="学员信息"> <app-card title="学员信息">
<Student :dealList= "dealList" /> <Student :dealList="dealList" />
</app-card> </app-card>
<app-card title="收款信息"> <app-card title="收款信息">
<Collection :dealList= "dealList" /> <Collection :dealList="dealList" />
</app-card> </app-card>
<app-card title="发票信息"> <app-card title="发票信息">
<Ticket :dealList= "dealList" /> <Ticket :dealList="dealList" />
</app-card> </app-card>
<app-card title="渠道信息"> <app-card title="渠道信息">
<Channel :dealList= "dealList" /> <Channel :dealList="dealList" />
</app-card> </app-card>
<app-card title="支付待确认记录"> <app-card title="支付待确认记录">
<Toconfirm :dealList= "dealList" :id="this.id" /> <Toconfirm :dealList="dealList" :id="this.id" />
</app-card> </app-card>
<app-card title="支付确认记录"> <app-card title="支付确认记录">
<Confirmed :dealList= "dealList" :id="this.id"/> <Confirmed :dealList="dealList" :id="this.id" />
</app-card> </app-card>
</div> </div>
</template> </template>
...@@ -36,7 +62,7 @@ import Ticket from '../components/Ticket.vue' ...@@ -36,7 +62,7 @@ import Ticket from '../components/Ticket.vue'
import Channel from '../components/Channel.vue' import Channel from '../components/Channel.vue'
import Toconfirm from '../components/Toconfirm.vue' import Toconfirm from '../components/Toconfirm.vue'
import Confirmed from '../components/Confirmed.vue' import Confirmed from '../components/Confirmed.vue'
import { payDetail } from '../api' import { payDetail, confirmPayDetail, cancelPayDetail } from '../api'
export default { export default {
components: { AppCard, Order, Student, Collection, Ticket, Channel, Toconfirm, Confirmed }, components: { AppCard, Order, Student, Collection, Ticket, Channel, Toconfirm, Confirmed },
data() { data() {
...@@ -45,19 +71,64 @@ export default { ...@@ -45,19 +71,64 @@ export default {
dealList: {} dealList: {}
} }
}, },
created() { computed: {
roles() {
return this.$store.state.roles
},
isFINANCE() {
return (
this.roles.includes('finance_manager') ||
this.roles.includes('finance_director') ||
this.roles.includes('developer')
)
},
isBUSINESS() {
return (
this.roles.includes('admissions_director') ||
this.roles.includes('dean_of_admissions') ||
this.roles.includes('developer')
)
}
},
beforeMount() {
this.id = this.$route.params.id // 详情列表 this.id = this.$route.params.id // 详情列表
// 获取发票详情信息 // 获取发票详情信息
this.fetchTicketDetail() this.fetchTicketDetail()
this.$store.dispatch('getRoles')
}, },
methods: { methods: {
fetchTicketDetail() { fetchTicketDetail() {
const params = { id: this.id } const params = { id: this.id }
payDetail(params).then((res) => { payDetail(params).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.dealList = res.data.list[0] this.dealList = res.data.list[0]
} }
}) })
},
// 确认
fetchConfirmTicketDetail(val) {
console.log(val)
const params = {
confirm_type: val,
id: this.id
}
confirmPayDetail(params).then(res => {
if (res.code === 0) {
this.fetchTicketDetail()
}
})
},
// 取消
fetchCancelTicketDetail(val) {
const params = {
confirm_type: val,
id: this.id
}
cancelPayDetail(params).then(res => {
if (res.code === 0) {
this.fetchTicketDetail()
}
})
} }
} }
} }
......
...@@ -4,7 +4,12 @@ ...@@ -4,7 +4,12 @@
<!-- 申请状态 --> <!-- 申请状态 -->
<template v-slot:status-select="{ params }"> <template v-slot:status-select="{ params }">
<el-select v-model="params.status" placeholder="申请状态" filterable remote> <el-select v-model="params.status" placeholder="申请状态" filterable remote>
<el-option v-for="(item, index) in conditionList.payment_status" :value="item.key" :key="index" :label="item.value"> <el-option
v-for="(item, index) in conditionList.payment_status"
:value="item.key"
:key="index"
:label="item.value"
>
<el-checkbox>{{ item.value }}</el-checkbox> <el-checkbox>{{ item.value }}</el-checkbox>
</el-option> </el-option>
</el-select> </el-select>
...@@ -20,7 +25,12 @@ ...@@ -20,7 +25,12 @@
<!-- 发票状态 --> <!-- 发票状态 -->
<template v-slot:invoice-select="{ params }"> <template v-slot:invoice-select="{ params }">
<el-select v-model="params.invoice" placeholder="发票状态" filterable remote> <el-select v-model="params.invoice" placeholder="发票状态" filterable remote>
<el-option v-for="(item, index) in conditionList.invoice_status" :key="index" :label="item.value" :value="item.key"> <el-option
v-for="(item, index) in conditionList.invoice_status"
:key="index"
:label="item.value"
:value="item.key"
>
<el-checkbox>{{ item.value }}</el-checkbox> <el-checkbox>{{ item.value }}</el-checkbox>
</el-option> </el-option>
</el-select> </el-select>
...@@ -60,11 +70,15 @@ ...@@ -60,11 +70,15 @@
> >
</el-date-picker> </el-date-picker>
</template> </template>
<template #header-aside> <template #header-aside> </template>
</template>
<!-- 状态 --> <!-- 状态 -->
<template v-slot:status="{ row }"> <template v-slot:status="{ row }">
<el-switch v-model="row.can_add_invoice" active-value="1" inactive-value="0" @change="handleStatus(row)"></el-switch> <el-switch
v-model="row.can_add_invoice"
active-value="1"
inactive-value="0"
@change="handleStatus(row)"
></el-switch>
</template> </template>
<!-- 操作 --> <!-- 操作 -->
<template v-slot:table-x="{ row }"> <template v-slot:table-x="{ row }">
...@@ -82,8 +96,8 @@ ...@@ -82,8 +96,8 @@
<el-button @click="backTicket(row)">退费</el-button> <el-button @click="backTicket(row)">退费</el-button>
</template> </template>
<template #footer> <template #footer>
<span>已选择{{multipleSelection.length}}</span> <span>已选择{{ multipleSelection.length }}</span>
<el-button @click="exportSelect" style="margin-left:40px">导出</el-button> <el-button @click="exportSelect" style="margin-left: 40px">导出</el-button>
</template> </template>
</app-list> </app-list>
<!-- 开具发票 --> <!-- 开具发票 -->
...@@ -91,18 +105,7 @@ ...@@ -91,18 +105,7 @@
<TicketForm :id="id" @close="ticketVisible = false" @createTicket="handleCreateTicket" /> <TicketForm :id="id" @close="ticketVisible = false" @createTicket="handleCreateTicket" />
</el-dialog> </el-dialog>
<!-- 开票二维码 --> <!-- 开票二维码 -->
<ShareQrcode :visible.sync="codeVisible" :value="shareUrl"/> <ShareQrcode :visible.sync="codeVisible" :value="shareUrl" />
<!-- 作废弹框 -->
<el-dialog
title="提示"
:visible.sync="disabledTicketVisible"
width="30%">
<span>确定要作废此发票吗?作废后不可恢复</span>
<span slot="footer" class="dialog-footer">
<el-button @click="disabledTicketVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmDisabledTicket">确 定</el-button>
</span>
</el-dialog>
</app-card> </app-card>
</template> </template>
<script> <script>
...@@ -123,7 +126,8 @@ export default { ...@@ -123,7 +126,8 @@ export default {
return { return {
id: '', id: '',
shareUrl: '', shareUrl: '',
conditionList: { // 筛选条件列表 conditionList: {
// 筛选条件列表
project_id: [], // 项目 project_id: [], // 项目
channel_id: [], // 渠道 channel_id: [], // 渠道
type: [], // 费用类型 type: [], // 费用类型
...@@ -270,7 +274,12 @@ export default { ...@@ -270,7 +274,12 @@ export default {
{ label: '不含税销售金额', prop: 'sales_amount_excluding_tax', align: 'center', minWidth: 120 }, { label: '不含税销售金额', prop: 'sales_amount_excluding_tax', align: 'center', minWidth: 120 },
{ label: '渠道代理提基数', prop: 'channel_agent_fee_base', align: 'center', minWidth: 120 }, { label: '渠道代理提基数', prop: 'channel_agent_fee_base', align: 'center', minWidth: 120 },
{ label: '代理服务费', prop: 'agency_service_fee', align: 'center', minWidth: 120 }, { label: '代理服务费', prop: 'agency_service_fee', align: 'center', minWidth: 120 },
{ label: '代理服务费(不含税金额)', prop: 'agency_service_fee_excluding_tax', align: 'center', minWidth: 300 }, {
label: '代理服务费(不含税金额)',
prop: 'agency_service_fee_excluding_tax',
align: 'center',
minWidth: 300
},
{ label: '渠道税率', prop: 'channel_tax_rate', align: 'center', minWidth: 80 }, { label: '渠道税率', prop: 'channel_tax_rate', align: 'center', minWidth: 80 },
{ label: '户名', prop: 'channel_account_name', align: 'center', minWidth: 80 }, { label: '户名', prop: 'channel_account_name', align: 'center', minWidth: 80 },
{ label: '账号', prop: 'channel_account', align: 'center', minWidth: 80 }, { label: '账号', prop: 'channel_account', align: 'center', minWidth: 80 },
...@@ -279,8 +288,8 @@ export default { ...@@ -279,8 +288,8 @@ export default {
{ label: '开学时间', prop: 'bill_customer_class_start_time', align: 'center', minWidth: 200 }, { label: '开学时间', prop: 'bill_customer_class_start_time', align: 'center', minWidth: 200 },
{ label: '学制期限', prop: 'bill_customer_class_length_of_schooling', align: 'center', minWidth: 80 }, { label: '学制期限', prop: 'bill_customer_class_length_of_schooling', align: 'center', minWidth: 80 },
{ label: '客户编号', prop: 'customer_id', align: 'center', minWidth: 300 }, { label: '客户编号', prop: 'customer_id', align: 'center', minWidth: 300 },
// eslint-disable-next-line object-curly-newline {
{ label: '退费状态', label: '退费状态',
prop: 'refund_time', prop: 'refund_time',
align: 'center', align: 'center',
minWidth: 80, minWidth: 80,
...@@ -288,8 +297,8 @@ export default { ...@@ -288,8 +297,8 @@ export default {
return row.refund_time === null ? '未退费' : '已退费' return row.refund_time === null ? '未退费' : '已退费'
} }
}, },
// eslint-disable-next-line object-curly-newline {
{ label: '发票状态', label: '发票状态',
prop: 'invoice_status', prop: 'invoice_status',
align: 'center', align: 'center',
minWidth: 80, minWidth: 80,
...@@ -315,8 +324,21 @@ export default { ...@@ -315,8 +324,21 @@ export default {
}, },
// 作废发票 // 作废发票
disabledTicket(row) { disabledTicket(row) {
this.id = row.id this.$confirm('确定要作废此发票吗?作废后不可恢复', '提示', {
this.disabledTicketVisible = true confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.fetchDisabled(row)
})
},
// 作废发票
fetchDisabled(row) {
cancelTicket(row.id).then(res => {
if (res.code === 0) {
this.$refs.list.refetch()
}
})
}, },
qrCode(row) { qrCode(row) {
this.shareUrl = `${import.meta.env.VITE_SHARE_URL}/h5/payment/invoice?id=${row.id}` this.shareUrl = `${import.meta.env.VITE_SHARE_URL}/h5/payment/invoice?id=${row.id}`
...@@ -324,7 +346,7 @@ export default { ...@@ -324,7 +346,7 @@ export default {
}, },
// 获取过滤条件 // 获取过滤条件
fetchCondition() { fetchCondition() {
getCondition().then((res) => { getCondition().then(res => {
if (res.code === 0) { if (res.code === 0) {
this.conditionList = res.data this.conditionList = res.data
} }
...@@ -340,16 +362,17 @@ export default { ...@@ -340,16 +362,17 @@ export default {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('开票成功') this.$message.success('开票成功')
this.ticketVisible = false this.ticketVisible = false
this.getPayList() // 刷新订单列表 this.$refs.list.refetch() // 刷新订单列表
} }
}) })
}, },
// 是否允许开具发票 // 是否允许开具发票
handleStatus(row) { handleStatus(row) {
const params = { id: row.id, status: row.can_add_invoice } const params = { id: row.id, can_add_invoice: row.can_add_invoice }
allowCreate(params).then(res => { allowCreate(params).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('更新状态成功') this.$message.success('更新状态成功')
this.$refs.list.refetch() // 刷新订单列表
} else { } else {
this.$message.error('更新状态失败') this.$message.error('更新状态失败')
} }
...@@ -362,18 +385,20 @@ export default { ...@@ -362,18 +385,20 @@ export default {
if (res.code === 0) { if (res.code === 0) {
this.disabledTicketVisible = false this.disabledTicketVisible = false
this.$message.success('发票已作废') this.$message.success('发票已作废')
this.getPayList() // 更新订单列表 this.$refs.list.refetch() // 刷新订单列表
} else { } else {
this.$message.error('该发票无作废失败') this.$message.error('该发票无作废失败')
} }
}) })
}, },
// 退费 // 退费
backTicket(row) { backTicket(row) {
// 改变退费状态 // 改变退费状态
drawBack(row.id).then(res => { const params = { id: row.id }
drawBack(params).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.getPayList() // 刷新订单列表 this.$refs.list.refetch() // 刷新订单列表
this.$message.success('退费成功') this.$message.success('退费成功')
} else { } else {
this.$message.error('退费失败') this.$message.error('退费失败')
......
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import { getUser, logout } from '@/api/base' import { getUser, logout, getRoles } from '@/api/base'
Vue.use(Vuex) Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
user: {} user: {},
roles: []
}, },
mutations: { mutations: {
setUser(state, user) { setUser(state, user) {
state.user = user state.user = user
},
setRoles(state, roles) {
state.roles = roles
} }
}, },
actions: { actions: {
...@@ -43,6 +47,15 @@ export default new Vuex.Store({ ...@@ -43,6 +47,15 @@ export default new Vuex.Store({
return false return false
}) })
return isLogin return isLogin
},
// 获取角色
getRoles({ commit }) {
return getRoles().then(response => {
const { roles = [] } = response.data
commit('setRoles', roles)
console.log(roles)
return response
})
} }
} }
}) })
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论