From 1aad791aa26d2b10df8f1a91dc7fa1ad69491093 Mon Sep 17 00:00:00 2001 From: xiao-fajia <1665375861@qq.com> Date: Sat, 14 Sep 2024 18:27:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/repair/stockOperate/stockOperate.js | 9 ++ src/views/repair/Components/StaffChoose.vue | 15 +++- .../repair/Components/SupplierChoose.vue | 19 +++- .../repair/Components/WarehouseChoose.vue | 3 +- .../stockOperate/Components/SoIndex.vue | 87 +++++++++++-------- .../repair/stockOperate/Components/SoInfo.vue | 77 ++++++++++++---- .../stockOperate/Components/SoTable.vue | 43 ++++++--- 7 files changed, 185 insertions(+), 68 deletions(-) diff --git a/src/api/repair/stockOperate/stockOperate.js b/src/api/repair/stockOperate/stockOperate.js index 23d957c..a2a1685 100644 --- a/src/api/repair/stockOperate/stockOperate.js +++ b/src/api/repair/stockOperate/stockOperate.js @@ -2,6 +2,7 @@ import request from '@/utils/request' const preUrl = "/repair/so" +// 采购单\领料单 新增 export function createRepairSo(data){ return request({ url: preUrl + "/create", @@ -9,3 +10,11 @@ export function createRepairSo(data){ data }) } + +export function getRepairSoPage(params){ + return request({ + url: preUrl + "/page", + method: "get", + params + }) +} diff --git a/src/views/repair/Components/StaffChoose.vue b/src/views/repair/Components/StaffChoose.vue index a5301bb..223f742 100644 --- a/src/views/repair/Components/StaffChoose.vue +++ b/src/views/repair/Components/StaffChoose.vue @@ -10,6 +10,12 @@ import {getStaffList} from "@/api/company/staff"; export default { name: "StaffChoose", + props:{ + value: { + type: Object, + defaultValue: null + } + }, data() { return { staffList: [], @@ -19,7 +25,14 @@ export default { watch:{ staffSelected(val) { const staff = this.staffList.find(item => item.id === val); - this.$emit("selected", staff); + this.$emit("input", staff); + }, + value(newVal){ + if (newVal){ + this.staffSelected = newVal.id + }else { + this.staffSelected = null + } } }, mounted() { diff --git a/src/views/repair/Components/SupplierChoose.vue b/src/views/repair/Components/SupplierChoose.vue index 85ff8b9..7011d0f 100644 --- a/src/views/repair/Components/SupplierChoose.vue +++ b/src/views/repair/Components/SupplierChoose.vue @@ -11,16 +11,29 @@ import {getBaseSupplierList} from "@/api/repair/supplier"; export default { name: "SupplierChoose", + props: { + value: { + type: Object, + defaultValue: null + } + }, data() { return { supplierSelected: undefined, supplierList: null } }, - watch:{ + watch: { supplierSelected(val) { - const supplier = this.supplierList.find(item => item.id === val); - this.$emit("selected", supplier); + const supplier = this.supplierList.find(item => item.id === val) + this.$emit("input", supplier); + }, + value(newVal) { + if (newVal) { + this.supplierSelected = newVal.id + } else { + this.supplierSelected = null + } } }, mounted() { diff --git a/src/views/repair/Components/WarehouseChoose.vue b/src/views/repair/Components/WarehouseChoose.vue index 7dad376..0b0fcb7 100644 --- a/src/views/repair/Components/WarehouseChoose.vue +++ b/src/views/repair/Components/WarehouseChoose.vue @@ -51,7 +51,8 @@ export default { return JSON.parse(JSON.stringify(result)) }, handleNodeClick(node){ - this.$emit("selected", node) + this.$emit("input", node.name) + this.$emit("change") this.warehouseSelected = node.name this.$refs.selectTree.blur() } diff --git a/src/views/repair/stockOperate/Components/SoIndex.vue b/src/views/repair/stockOperate/Components/SoIndex.vue index ad3f7d9..edd98f3 100644 --- a/src/views/repair/stockOperate/Components/SoIndex.vue +++ b/src/views/repair/stockOperate/Components/SoIndex.vue @@ -12,7 +12,7 @@ - + @@ -25,7 +25,7 @@ + :value="item.value"/> @@ -55,19 +55,19 @@ {{ scope.$index + 1 }} - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + +