账务设置工单支付方式

This commit is contained in:
xiaofajia 2024-10-16 10:42:13 +08:00
parent d6a4763c60
commit f27631f460
4 changed files with 86 additions and 33 deletions

View File

@ -42,3 +42,11 @@ export function assignRoleDataScope(data) {
data: data data: data
}) })
} }
// 用来判断角色
export function checkRole(code){
return request({
url: '/system/permission/checkRole?code=' + code,
method: 'get'
})
}

View File

@ -41,7 +41,7 @@
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch"></right-toolbar> <right-toolbar :showSearch.sync="showSearch"></right-toolbar>
</el-row> </el-row>
<TicketTable :ticket-type="TicketType" :list="list" @setVoid="getPage"/> <TicketTable :ticket-type="TicketType" :list="list" @setVoid="getPage" :is-w-x-c-w="isWXCW"/>
<pagination @pagination="getPage" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination @pagination="getPage" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
/> />
</div> </div>
@ -53,6 +53,7 @@ import TicketTable from "@/views/repair/tickets/Components/TicketTable.vue";
import RepairTypeChoose from "@/views/repair/Components/RepairTypeChoose.vue"; import RepairTypeChoose from "@/views/repair/Components/RepairTypeChoose.vue";
import {getTicketsPage} from "@/api/repair/tickets/Tickets"; import {getTicketsPage} from "@/api/repair/tickets/Tickets";
import CorpChoose from "@/views/repair/Components/CorpChoose.vue"; import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
import {checkRole} from "@/api/system/permission";
export default { export default {
name: "TicketSearch", name: "TicketSearch",
@ -83,13 +84,20 @@ export default {
}, },
showSearch: true, showSearch: true,
total: 0, total: 0,
list: [] list: [],
isWXCW: false
} }
}, },
mounted() { mounted() {
this.getPage() this.getPage()
this.getIsWXCW()
}, },
methods: { methods: {
//
async getIsWXCW(){
const res = await checkRole("wxcw")
this.isWXCW = res.data
},
// //
getRepairType(data){ getRepairType(data){
console.log(data) console.log(data)

View File

@ -104,7 +104,7 @@
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)" <el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
>查看 >查看
</el-button> </el-button>
<el-button v-if="TicketType === 'tu'" size="mini" type="text" icon="el-icon-finished" <el-button v-if="TicketType === 'tu' && isWXCW && !scope.row.payType" size="mini" type="text" icon="el-icon-finished"
@click="handlePaid(scope.row)" @click="handlePaid(scope.row)"
>结算 >结算
</el-button> </el-button>
@ -145,6 +145,30 @@
<!-- <el-table-column label="作废备注" align="center" prop="remark" width="180" />--> <!-- <el-table-column label="作废备注" align="center" prop="remark" width="180" />-->
<!-- </el-table>--> <!-- </el-table>-->
<TicketsShow ref="ticketsShow"/> <TicketsShow ref="ticketsShow"/>
<el-dialog title="结算信息" :visible.sync="dialogVisible" width="40%" v-dialogDrag append-to-body>
<el-form :model="formData" ref="formRef" :inline="true" label-width="10rem" :rules="formRules">
<el-row :gutter="1">
<el-col :span="24">
<el-form-item label="结算方法" prop="payType">
<el-select v-model="formData.payType">
<el-option v-for="item in this.getDictDatas(DICT_TYPE.REPAIR_PAY_TYPE)" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="1">
<el-col :span="24">
<el-form-item label="结算备注" prop="remark">
<el-input style="width:40rem" type="textarea" v-model="formData.remark" :autosize="{ minRows: 4, maxRows: 8}"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="doPaid"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -164,6 +188,9 @@ export default {
list: { list: {
type: Array, type: Array,
default: [] default: []
},
isWXCW:{
type:Boolean
} }
}, },
data() { data() {
@ -172,8 +199,13 @@ export default {
formData: { formData: {
id: null, id: null,
ticketsStatus: null, ticketsStatus: null,
remark: null remark: null,
} payType: null
},
formRules:{
payType: [{required: true, message: '支付方式不能为空', trigger: 'blur'}]
},
dialogVisible: false
} }
}, },
methods: { methods: {
@ -218,25 +250,30 @@ export default {
}, },
handlePaid(row) { handlePaid(row) {
this.$prompt('结算备注', '提示', { this.formData = {
confirmButtonText: '确定', id: null,
cancelButtonText: '取消', ticketsStatus: null,
}).then(({value}) => { remark: null,
const data = {} payType: null
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'] = 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 {
// }
} }
} }
} }

View File

@ -147,16 +147,7 @@
<span>{{ scope.$index + 1 }}</span> <span>{{ scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="名称" align="center" prop="waresName"/> <el-table-column align="center" label="客户可见" prop="isShow" v-if="userRole === 2" width="180">
<el-table-column label="规格" align="center" prop="wares.model" />
<el-table-column label="数量" align="center" prop="waresCount" />
<el-table-column label="状态" align="center" prop="waresStatus">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.TW_ITEM_STATUS" :value="scope.row.waresStatus" />
</template>
</el-table-column>
<el-table-column align="center" label="备注" prop="remark" />
<el-table-column align="center" label="客户可见" prop="isShow" v-if="userRole === 2">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.isShow" v-model="scope.row.isShow"
@ -169,6 +160,15 @@
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="名称" align="center" prop="waresName" width="180" :show-overflow-tooltip="true"/>
<el-table-column label="规格" align="center" prop="wares.model" width="180"/>
<el-table-column label="数量" align="center" prop="waresCount" width="180"/>
<el-table-column label="状态" align="center" prop="waresStatus" width="180">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.TW_ITEM_STATUS" :value="scope.row.waresStatus" />
</template>
</el-table-column>
<el-table-column align="center" label="备注" prop="remark" width="180" :show-overflow-tooltip="true"/>
</el-table> </el-table>
</div> </div>
</el-card> </el-card>