From b135d6eb9c321f547ce6615ed2987397bce9be53 Mon Sep 17 00:00:00 2001 From: TianyangZhang Date: Tue, 21 Apr 2026 16:04:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=E5=85=89=E8=8A=AF=20=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=20=E4=B8=BB?= =?UTF-8?q?=E8=A6=81=E6=98=AF=E9=87=87=E8=B4=AD=E5=AE=A1=E6=89=B9=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/model/mpr.js | 32 + src/config/route.js | 9 + src/views/enm_energy/carbon_ly.vue | 1036 ------------------- src/views/hrm/empjoin.vue | 14 +- src/views/hrm/empjoin_form.vue | 12 + src/views/mpr/material_requisition_form.vue | 18 +- src/views/mpr/warehouse.vue | 82 ++ src/views/mpr/warehouse_entry.vue | 2 +- src/views/mpr/warehouse_entry_form.vue | 2 +- src/views/mpr/warehouse_form2.vue | 96 ++ src/views/mpr/warehouse_stock.vue | 2 +- 11 files changed, 262 insertions(+), 1043 deletions(-) delete mode 100644 src/views/enm_energy/carbon_ly.vue create mode 100644 src/views/mpr/warehouse.vue create mode 100644 src/views/mpr/warehouse_form2.vue diff --git a/src/api/model/mpr.js b/src/api/model/mpr.js index c0a2b30b..f78f0772 100644 --- a/src/api/model/mpr.js +++ b/src/api/model/mpr.js @@ -1,6 +1,38 @@ import config from "@/config" import http from "@/utils/request" export default { + warehouse: { + list: { + name: "库房列表", + req: async function(data){ + return await http.get(`${config.API_URL}/mpr/warehouse/`, data); + } + }, + create: { + name: "创建库房", + req: async function(data){ + return await http.post(`${config.API_URL}/mpr/warehouse/`, data); + } + }, + item: { + name: "获取库房详情", + req: async function(id){ + return await http.get(`${config.API_URL}/mpr/warehouse/${id}/`); + } + }, + update: { + name: "更新库房", + req: async function(id, data){ + return await http.put(`${config.API_URL}/mpr/warehouse/${id}/`, data); + } + }, + delete: { + name: "删除库房", + req: async function(id){ + return await http.delete(`${config.API_URL}/mpr/warehouse/${id}/`); + } + }, + }, requisition: { list: { name: "申购单列表", diff --git a/src/config/route.js b/src/config/route.js index c776008b..f04bbd68 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -2102,6 +2102,15 @@ const routes = [ perms: ["mpr"], }, children: [ + { + name: "mpr_warehouse", + path: "/mpr/warehouse", + meta: { + title: "库房管理", + perms: ["mpr_warehouse"], + }, + component: "mpr/warehouse", + }, { name: "requisition", path: "/mpr/requisition", diff --git a/src/views/enm_energy/carbon_ly.vue b/src/views/enm_energy/carbon_ly.vue deleted file mode 100644 index dc7f06a0..00000000 --- a/src/views/enm_energy/carbon_ly.vue +++ /dev/null @@ -1,1036 +0,0 @@ - - - - diff --git a/src/views/hrm/empjoin.vue b/src/views/hrm/empjoin.vue index 490d69d4..7973c9de 100644 --- a/src/views/hrm/empjoin.vue +++ b/src/views/hrm/empjoin.vue @@ -9,7 +9,9 @@ - + + + diff --git a/src/views/mpr/warehouse_entry.vue b/src/views/mpr/warehouse_entry.vue index 232023a0..2c9ee4f9 100644 --- a/src/views/mpr/warehouse_entry.vue +++ b/src/views/mpr/warehouse_entry.vue @@ -85,7 +85,7 @@ const t_id = ref(null) const warehouseOptions = ref([]) onMounted(async () => { - let res = await API.inm.warehouse.list.req({ page: 0 }) + let res = await API.mpr.warehouse.list.req({ page: 0 }) warehouseOptions.value = res }) diff --git a/src/views/mpr/warehouse_entry_form.vue b/src/views/mpr/warehouse_entry_form.vue index fb8592fc..598095b4 100644 --- a/src/views/mpr/warehouse_entry_form.vue +++ b/src/views/mpr/warehouse_entry_form.vue @@ -192,7 +192,7 @@ export default { } }, async mounted() { - let res = await this.$API.inm.warehouse.list.req({ page: 0 }) + let res = await this.$API.mpr.warehouse.list.req({ page: 0 }) this.warehouseOptions = res if (this.t_id) { this.loadData() diff --git a/src/views/mpr/warehouse_form2.vue b/src/views/mpr/warehouse_form2.vue new file mode 100644 index 00000000..3cc91d4d --- /dev/null +++ b/src/views/mpr/warehouse_form2.vue @@ -0,0 +1,96 @@ + + diff --git a/src/views/mpr/warehouse_stock.vue b/src/views/mpr/warehouse_stock.vue index f7d8983b..20d45898 100644 --- a/src/views/mpr/warehouse_stock.vue +++ b/src/views/mpr/warehouse_stock.vue @@ -91,7 +91,7 @@ const dateRange = ref(null) const warehouseOptions = ref([]) onMounted(async () => { - let res = await API.inm.warehouse.list.req({ page: 0 }) + let res = await API.mpr.warehouse.list.req({ page: 0 }) warehouseOptions.value = res }) From f360fa4d21ec2f9911006cf1bd643dc919ab6ae1 Mon Sep 17 00:00:00 2001 From: TianyangZhang Date: Wed, 22 Apr 2026 10:58:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=85=89?= =?UTF-8?q?=E8=8A=AF=E4=BE=9B=E5=BA=94=E5=95=86=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/pum/supplieraudit_form.vue | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/views/pum/supplieraudit_form.vue b/src/views/pum/supplieraudit_form.vue index dd3877b8..6159c73f 100644 --- a/src/views/pum/supplieraudit_form.vue +++ b/src/views/pum/supplieraudit_form.vue @@ -134,17 +134,31 @@ export default { }) }, handleSave() { + // 过滤掉 _ 后缀的对象字段,只发送后端需要的数据 + let data = {}; + for (let key in this.formData) { + if (!key.endsWith('_')) { + data[key] = this.formData[key]; + } + } if (this.localMode == "add") { this.saveLoading = true; - this.$API.pum.supplieraudit.create.req(this.formData).then(res=>{ - this.saveLoading = true; + this.$API.pum.supplieraudit.create.req(data).then(res=>{ + this.saveLoading = false; this.$message.success("提交成功"); this.$emit('success', this.localMode); }).catch(e=>{ this.saveLoading = false; }) } else if (this.localMode == "edit") { - this.$message.error("不支持编辑!") + this.saveLoading = true; + this.$API.pum.supplieraudit.update.req(this.formData.id, data).then(res=>{ + this.saveLoading = false; + this.$message.success("更新成功"); + this.$emit('success', this.localMode); + }).catch(e=>{ + this.saveLoading = false; + }) } }, }