From bcf45748acd031185bfa6750a7ba83c9e457c3ba Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Sat, 19 Oct 2024 22:55:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E4=BB=B6=E9=A2=86=E9=80=80=E4=BF=AE?= =?UTF-8?q?=E6=94=B91/2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stockOperate/Components/WaresItem.vue | 107 +++++++++--------- src/views/repair/stockOperate/WaresAudit.vue | 4 +- .../tickets/Components/DiscountInput.vue | 43 +++++++ .../repair/tickets/Components/TicketItem.vue | 11 +- .../tickets/Components/TicketItemShow.vue | 6 +- .../tickets/Components/TicketManagerItem.vue | 14 +-- .../repair/tickets/Components/TicketWares.vue | 5 +- .../tickets/Components/TicketWaresShow.vue | 13 ++- src/views/repair/tickets/TicketManager.vue | 8 +- 9 files changed, 130 insertions(+), 81 deletions(-) create mode 100644 src/views/repair/tickets/Components/DiscountInput.vue diff --git a/src/views/repair/stockOperate/Components/WaresItem.vue b/src/views/repair/stockOperate/Components/WaresItem.vue index c0b7f6a..b40808b 100644 --- a/src/views/repair/stockOperate/Components/WaresItem.vue +++ b/src/views/repair/stockOperate/Components/WaresItem.vue @@ -43,20 +43,36 @@ /> - + - + +
+ + {{ scope.row.waresCount }} +
+
@@ -180,8 +196,9 @@ export default { // 保存进入编辑的cell clickCellMap: {}, // 需要编辑的属性 - editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code'], + editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount'], remark: null, + tableKey: 0, } }, mounted() { @@ -189,7 +206,7 @@ export default { }, methods:{ // 通过 true是全部、false是选择 - async handlePass(flag){ + async handlePass(){ // 生成领料单 if (this.type){ this.formData.repairSo = { @@ -201,35 +218,18 @@ export default { soStatus: "04", purchaseType: "01" } - if (flag){ - this.formData.repairSois = [...this.items.map(item => { - return { - soiType: '02', - goodsId: item.waresId, - goodsCount: item.waresCount, - } - })] - this.formData.items = [...this.items.map(item => { - return { - id: item.id, - waresStatus: "04" - } - })] - }else { - this.formData.repairSois = [...this.selections.map(item => { - return { - soiType: '02', - goodsId: item.waresId, - goodsCount: item.waresCount, - } - })] - this.formData.items = [...this.selections.map(item => { - return { - id: item.id, - waresStatus: "04" - } - })] - } + this.formData.repairSois = [...this.selections.map(item => { + return { + soiType: '02', + goodsId: item.waresId, + goodsCount: item.waresCount, + } + })] + this.formData.items = [...this.selections.map(item => { + return { + id: item.id, + } + })] try { await pass(this.formData) this.$modal.msgSuccess("处理成功") @@ -240,21 +240,12 @@ export default { }else { // 退料方法 this.formData = {} - if (flag){ - this.formData.items = [...this.items.map(item => { - return { - id: item.id, - waresStatus: "05" - } - })] - }else { - this.formData.items = [...this.selections.map(item => { - return { - id: item.id, - waresStatus: "05" - } - })] - } + this.formData.items = [...this.selections.map(item => { + return { + id: item.id, + waresStatus: "05" + } + })] try { await passBackTicketWares(this.formData) this.$modal.msgSuccess("处理成功") @@ -321,7 +312,9 @@ export default { this.items = res.data // 库存判断 this.items.forEach(item => { - item.isStock = item.waresCount <= item.wares.stock + const count = item.waresAlreadyCount ? parseInt(item.waresCount) - parseInt(item.waresAlreadyCount) : item.waresCount + item.waresCount = count + item.isStock = count <= item.wares.stock }) // 只要未领料的 if (this.type){ @@ -334,7 +327,7 @@ export default { this.dialogLoading = false } }, - getClass(row){ + getRowClass(row){ if (this.type && !row.row.isStock){ return 'stock' } @@ -411,6 +404,7 @@ export default { /** 保存数据 */ save(row) { // 更新表格的数据 + row.isStock = row.waresCount <= row.wares.stock row.totalPrice = row.count * row.newPrice const id = row.id // 取消本行所有cell的编辑状态 @@ -418,6 +412,7 @@ export default { this.cancelEditable(cell) }) this.clickCellMap[id] = [] + this.tableKey++ }, changeWare(row) { if (row.ware) { diff --git a/src/views/repair/stockOperate/WaresAudit.vue b/src/views/repair/stockOperate/WaresAudit.vue index bff6e6f..d5df6c0 100644 --- a/src/views/repair/stockOperate/WaresAudit.vue +++ b/src/views/repair/stockOperate/WaresAudit.vue @@ -1,10 +1,10 @@ - + + + diff --git a/src/views/repair/tickets/Components/TicketManagerItem.vue b/src/views/repair/tickets/Components/TicketManagerItem.vue index 9e1ce44..237abf5 100644 --- a/src/views/repair/tickets/Components/TicketManagerItem.vue +++ b/src/views/repair/tickets/Components/TicketManagerItem.vue @@ -50,12 +50,12 @@ 通知施工 - - 过程记录 - 开始施工 + + 过程记录 + 施工完成 @@ -71,11 +71,11 @@ 更多 申请领料 - - 申请退料 + >申请配件 + + + 审核 + - 领料 + 领料确认 - 退料 + 退料确认 diff --git a/src/views/repair/tickets/Components/TicketWaresShow.vue b/src/views/repair/tickets/Components/TicketWaresShow.vue index 97e3f68..189ea8d 100644 --- a/src/views/repair/tickets/Components/TicketWaresShow.vue +++ b/src/views/repair/tickets/Components/TicketWaresShow.vue @@ -169,11 +169,12 @@
- - {{ scope.row.itemDiscount }} + + + {{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}
-
- {{ scope.row.itemDiscount }} +
+ {{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}
@@ -197,9 +198,11 @@ import {getTicketsById} from "@/api/repair/tickets/Tickets"; import {auditTicketWares} from "@/api/repair/tickets/TicketWares"; import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem"; +import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.vue"; export default { name: "TicketWaresShow", + components: {DiscountInput}, props:{ userRole: String, type: Boolean @@ -241,7 +244,7 @@ export default { this.items = [...this.items.map(item => { return { ...item, - itemDiscount: 10, + itemDiscount: 1, } })] }finally { diff --git a/src/views/repair/tickets/TicketManager.vue b/src/views/repair/tickets/TicketManager.vue index 98271c6..82abe3a 100644 --- a/src/views/repair/tickets/TicketManager.vue +++ b/src/views/repair/tickets/TicketManager.vue @@ -7,12 +7,12 @@ - + - - - + + +