diff --git a/src/api/inventory/invSpace.js b/src/api/inventory/invSpace.js index b85714d..442596e 100644 --- a/src/api/inventory/invSpace.js +++ b/src/api/inventory/invSpace.js @@ -1,3 +1,25 @@ import axios from "../../utils/axios"; +export function getInvSpaceList(params) { + return axios({ + url: "/spms/inv/space/filter", + method: "get", + params: params + }); +} +export function saveSpace(data, formName){ + return axios({ + url: formName === "add" ? "/spms/inv/space/add" : "/spms/inv/space/update", + method: "post", + data: data + }); +} + +export function deleteSpace(data) { + return axios({ + url: "/spms/inv/space/delete", + method: "post", + data: data + }) +} diff --git a/src/views/inventory/InvSpaceManage.vue b/src/views/inventory/InvSpaceManage.vue index 0155dfd..6c2f846 100644 --- a/src/views/inventory/InvSpaceManage.vue +++ b/src/views/inventory/InvSpaceManage.vue @@ -47,13 +47,21 @@ - - + + - - + + + @@ -87,7 +170,7 @@ import {filterUplLocInv} from "@/api/basic/invWarehouse"; import {filterSubByInv} from "@/api/basic/invSubWarehouse"; import {userInfo} from "@/api/auth/login"; import {isBlank} from "@/utils/strUtil"; - +import {getInvSpaceList, saveSpace, deleteSpace} from "@/api/inventory/invSpace"; export default { data() { @@ -112,10 +195,27 @@ export default { formLoading: false, dialogVisible: false, deleteLoading: false, - busTypes: [], idQuery: null, - showSup: false, fromOptions: [], + statusMap: { + 0: "禁用", + 1: "启用" + }, + formMap: { + add: "添加货位", + edit: "编辑货位" + }, + formName: null, + modifySpaceVisible: false, + formData: { + id: null, + code: null, + name: null, + invStorageCode: null, + invWarehouseCode: null, + status: 1, + remark: null + } }; }, methods: { @@ -160,6 +260,15 @@ export default { getList() { this.loading = true; this.filterQuery.customerId = store.getters.customerId; + getInvSpaceList(this.filterQuery).then((res) => { + this.loading = false; + if (res.code === 20000) { + this.list = res.data.list || []; + this.total = res.data.total || 0; + } else { + this.$message.error(res.data); + } + }) }, deleteDialog(rowId) { @@ -169,7 +278,15 @@ export default { type: "warning", }) .then(() => { - + let params = {id: rowId}; + deleteSpace(params).then((res) => { + if (res.code === 20000) { + this.$message.success("删除成功!"); + this.getList(); + } else { + this.$message.error(res.data); + } + }) }) .catch(() => { }); @@ -202,10 +319,22 @@ export default { } }, editSpace(row) { - + this.modifySpaceVisible = true; + this.formName = "edit"; + this.formData = row; }, addSpace() { - + this.modifySpaceVisible = true; + this.formName = "add"; + this.formData = { + id: null, + code: null, + name: null, + invStorageCode: null, + invWarehouseCode: null, + status: 1, + remark: null + } }, }, mounted() { diff --git a/src/views/inventory/invCountOrderNew.vue b/src/views/inventory/invCountOrderNew.vue index f0d6094..335eb52 100644 --- a/src/views/inventory/invCountOrderNew.vue +++ b/src/views/inventory/invCountOrderNew.vue @@ -155,7 +155,7 @@ export default { 0: "未提交", 1: "未审核", 2: "已审核" - } + }, }; }, components: {