From f27631f4601360196e92fdc51b05e4b54a073bde Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Wed, 16 Oct 2024 10:42:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A6=E5=8A=A1=E8=AE=BE=E7=BD=AE=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E6=94=AF=E4=BB=98=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/permission.js | 8 ++ .../tickets/Components/TicketSearch.vue | 12 ++- .../repair/tickets/Components/TicketTable.vue | 79 ++++++++++++++----- .../tickets/Components/TicketWaresShow.vue | 20 ++--- 4 files changed, 86 insertions(+), 33 deletions(-) diff --git a/src/api/system/permission.js b/src/api/system/permission.js index 1eee42a..0bf6f7a 100644 --- a/src/api/system/permission.js +++ b/src/api/system/permission.js @@ -42,3 +42,11 @@ export function assignRoleDataScope(data) { data: data }) } + +// 用来判断角色 +export function checkRole(code){ + return request({ + url: '/system/permission/checkRole?code=' + code, + method: 'get' + }) +} diff --git a/src/views/repair/tickets/Components/TicketSearch.vue b/src/views/repair/tickets/Components/TicketSearch.vue index 13d87f8..05d5032 100644 --- a/src/views/repair/tickets/Components/TicketSearch.vue +++ b/src/views/repair/tickets/Components/TicketSearch.vue @@ -41,7 +41,7 @@ - + @@ -53,6 +53,7 @@ import TicketTable from "@/views/repair/tickets/Components/TicketTable.vue"; import RepairTypeChoose from "@/views/repair/Components/RepairTypeChoose.vue"; import {getTicketsPage} from "@/api/repair/tickets/Tickets"; import CorpChoose from "@/views/repair/Components/CorpChoose.vue"; +import {checkRole} from "@/api/system/permission"; export default { name: "TicketSearch", @@ -83,13 +84,20 @@ export default { }, showSearch: true, total: 0, - list: [] + list: [], + isWXCW: false } }, mounted() { this.getPage() + this.getIsWXCW() }, methods: { + // 是否是财务 + async getIsWXCW(){ + const res = await checkRole("wxcw") + this.isWXCW = res.data + }, // 类型选择 getRepairType(data){ console.log(data) diff --git a/src/views/repair/tickets/Components/TicketTable.vue b/src/views/repair/tickets/Components/TicketTable.vue index e8181c0..15e5a5e 100644 --- a/src/views/repair/tickets/Components/TicketTable.vue +++ b/src/views/repair/tickets/Components/TicketTable.vue @@ -104,7 +104,7 @@ 查看 - 结算 @@ -145,6 +145,30 @@ + + + + + + + + + + + + + + + + + + + + + @@ -164,6 +188,9 @@ export default { list: { type: Array, default: [] + }, + isWXCW:{ + type:Boolean } }, data() { @@ -172,8 +199,13 @@ export default { formData: { id: null, ticketsStatus: null, - remark: null - } + remark: null, + payType: null + }, + formRules:{ + payType: [{required: true, message: '支付方式不能为空', trigger: 'blur'}] + }, + dialogVisible: false } }, methods: { @@ -218,25 +250,30 @@ export default { }, handlePaid(row) { - this.$prompt('结算备注', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - }).then(({value}) => { - const data = {} - data['id'] = row.id - data['remark'] = value - data['ticketsStatus'] = '02' - this.doPaid(data) - }).catch(() => { - }) - }, - async doPaid(data) { - try { - await setTicketsPaid(data) - this.$modal.msgSuccess("结算成功") - this.$emit("setVoid") - } catch { + this.formData = { + id: null, + ticketsStatus: null, + remark: null, + payType: null } + this.formData['id'] = row.id + this.formData['ticketsStatus'] = '02' + this.dialogVisible = true + }, + async doPaid() { + try { + await this.$refs['formRef'].validate() + await setTicketsPaid(this.formData) + this.$modal.msgSuccess("结算成功") + this.dialogVisible = false + this.$emit("setVoid") + }catch{} + // try { + // await setTicketsPaid(this.formData) + // this.$modal.msgSuccess("结算成功") + // this.$emit("setVoid") + // } catch { + // } } } } diff --git a/src/views/repair/tickets/Components/TicketWaresShow.vue b/src/views/repair/tickets/Components/TicketWaresShow.vue index 99bd75e..30566cc 100644 --- a/src/views/repair/tickets/Components/TicketWaresShow.vue +++ b/src/views/repair/tickets/Components/TicketWaresShow.vue @@ -147,16 +147,7 @@ {{ scope.$index + 1 }} - - - - - - - - + + + + + + + +