完善工单结算

This commit is contained in:
xiaofajia 2024-10-16 16:26:36 +08:00
parent a26488930b
commit a839658d75
2 changed files with 26 additions and 6 deletions

View File

@ -151,7 +151,7 @@
<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-option v-for="item in this.getDictDataByCode(DICT_TYPE.REPAIR_PAY_TYPE)" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
@ -159,7 +159,7 @@
<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-input style="width:30rem" type="textarea" v-model="formData.remark" :autosize="{ minRows: 4, maxRows: 8}"/>
</el-form-item>
</el-col>
</el-row>
@ -175,6 +175,7 @@
<script>
import {setTicketsVoid, setTicketsPaid, setTicketsPrint} from '@/api/repair/tickets/Tickets'
import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
import {getByNameAndMobile} from "@/api/base/customer";
export default {
name: "TicketTable",
@ -205,7 +206,8 @@ export default {
formRules:{
payType: [{required: true, message: '支付方式不能为空', trigger: 'blur'}]
},
dialogVisible: false
dialogVisible: false,
isHangAccount: false
}
},
methods: {
@ -236,7 +238,6 @@ export default {
* 打印
*/
async handlePrint(row) {
// window.location.href = process.env.VUE_APP_BASE_API + '/admin-api/repair/tickets/print/'+row.id;
window.open(process.env.VUE_APP_BASE_API + '/admin-api/repair/tickets/print/'+row.id)
},
@ -259,6 +260,14 @@ export default {
this.formData['id'] = row.id
this.formData['ticketsStatus'] = '02'
this.dialogVisible = true
this.checkIsHangAccount(row)
},
async checkIsHangAccount(row){
const data = {
cusName: row.userName, phoneNumber: row.userMobile
}
const res = await getByNameAndMobile(data)
this.isHangAccount = res.data.isHangAccount === '1'
},
async doPaid() {
try {
@ -268,7 +277,15 @@ export default {
this.dialogVisible = false
this.$emit("setVoid")
}catch{}
}
},
getDictDataByCode(code){
const data = this.getDictDatas(code);
if (this.isHangAccount){
return data
}else {
return data.filter(item => !item.label.includes("挂账"))
}
},
}
}
</script>

View File

@ -168,10 +168,13 @@
<el-table-column label="规格" align="center" prop="wares.model" width="180"/>
<el-table-column label="数量" align="center" prop="waresCount" width="180"/>
<el-table-column v-if="userRole === 2" label="折扣" align="center" prop="itemDiscount" width="180">
<div class="item" slot-scope="scope">
<div v-if="formData.status === '01'" class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount"/>
<span class="item__txt">{{ scope.row.itemDiscount }}</span>
</div>
<div v-else class="item" slot-scope="scope">
<span>{{ scope.row.itemDiscount }}</span>
</div>
</el-table-column>
<el-table-column label="状态" align="center" prop="waresStatus" width="180">
<template slot-scope="scope">