diff --git a/src/api/basic/invSubWarehouse.js b/src/api/basic/invSubWarehouse.js index ba47c79..76deef7 100644 --- a/src/api/basic/invSubWarehouse.js +++ b/src/api/basic/invSubWarehouse.js @@ -40,3 +40,32 @@ export function deleteSubWarehouse(data) { data: data }); } +//查询第三方系统和仓库数据关联信息 +export function getSubThrsysDetail(params) { + return axios({ + url: "/spms/sub/inv/warehouse/thridSys/detail", + method: "get", + params: params + }); +} + + +//绑定第三方仓库 +export function bindThrSubWarehouse(params) { + return axios({ + url: "/spms/sub/inv/warehouse/bindThrWarehouse", + method: "post", + params: params + }); +} + +//解绑第三方仓库 +export function unbindSubThrWarehouse(params) { + return axios({ + url: "/spms/sub/inv/warehouse/unbindThrWarehouse", + method: "post", + params: params + }); +} + + diff --git a/src/api/basic/invWarehouse.js b/src/api/basic/invWarehouse.js index 056625c..5def803 100644 --- a/src/api/basic/invWarehouse.js +++ b/src/api/basic/invWarehouse.js @@ -199,3 +199,14 @@ export function replaceCodes(data) { data: data }) } + +export function filterThridSubByInv(params) { + return axios({ + url: "/spms/sub/inv/warehouse/filterThridInv", + method: "get", + params: params + }); +} + + + diff --git a/src/api/thrsys/thrdSubInvWarehouse.js b/src/api/thrsys/thrdSubInvWarehouse.js new file mode 100644 index 0000000..72c0dba --- /dev/null +++ b/src/api/thrsys/thrdSubInvWarehouse.js @@ -0,0 +1,43 @@ +import axios from "../../utils/axios"; + +export function filterThridSubAll(query) { + return axios({ + url: "/thirdSys/sub/inv/warehouse/filter", + method: "get", + params: query + }); +} + +export function filterSubByInv(query) { + return axios({ + url: "/thirdSys/sub/inv/warehouse/findByInv", + method: "get", + params: query + }); +} + + +// 保存 +export function saveSubWarehouse(data, formName, method = "post") { + let url = + formName !== "edit" + ? "/thirdSys/sub/inv/warehouse/save" + : "/thirdSys/sub/inv/warehouse/edit"; + return axios({ + url: url, + method: method, + data: data + }); +} + +// 删除 +export function deleteSubWarehouse(data) { + return axios({ + url: "/thirdSys/sub/inv/warehouse/delete", + method: "post", + data: data + }); +} + + + diff --git a/src/views/basic/invWarehouse.vue b/src/views/basic/invWarehouse.vue index 02df647..59185a3 100644 --- a/src/views/basic/invWarehouse.vue +++ b/src/views/basic/invWarehouse.vue @@ -367,20 +367,60 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + 查询 + + + + + + + + + + + + + + + + @@ -609,10 +706,11 @@ import { warehouseUserList, saveWarehouseBussinessType, saveWarehouseUser, updateDirector, disableWarehouse, deleteWarehouseUser, deleteWarehouseBussinessType, - bindThrWarehouse, unbindThrWarehouse, getThrsysDetail + bindThrWarehouse, unbindThrWarehouse, filterThridSubByInv, getThrsysDetail } from "../../api/basic/invWarehouse"; import { - filterSubAll, saveSubWarehouse, deleteSubWarehouse + filterSubAll, saveSubWarehouse, deleteSubWarehouse, + getSubThrsysDetail, bindThrSubWarehouse, unbindSubThrWarehouse } from "../../api/basic/invSubWarehouse"; import {filterThrList} from "@/api/thrsys/thrInvWarehouse"; import {getHospitalUserList} from "../../api/auth/authUser"; @@ -696,23 +794,37 @@ export default { bussinessTypeList: null, userFormVisible: false, currentCode: null, + superRow: null, currentRow: {status: 1}, selectUserList: [], selectBussinessTypeList: [], bussinessTypeFormVisible: false, - thrWarehouseData: null, + thrWarehouseData: [], + thrSubWarehouseData: [], currentId: null, + currentSubId: null, thrWareHouseVisible: false, + thrSubWareHouseVisible: false, sysList: [], + sysSubList: [], checkThrWarehouseRow: null, + checkSubThrWarehouseRow: null, currentSysId: null, thirdSysVisible: false, total: 0, + subTotal: 0, thirdQuery: { key: null, page: 1, - limit: 10 - , thirdSysFk: "thirdId", + limit: 10, + thirdSysFk: "thirdId", + }, + thirdSubQuery: { + parentId: null, + key: null, + page: 1, + limit: 10, + thirdSysFk: "thirdId", }, configParms: {}, subData: {}, @@ -760,7 +872,7 @@ export default { // 更改值 this.formVisible = false; this.subFormVisible = false; - this.loadSubData(this.currentCode); + // this.loadSubData(this.currentCode); return true; }, // 显示表单 @@ -809,8 +921,24 @@ export default { this.sysList = []; }); }, + getSubThrsysDetailData() { + let params = { + id: this.subData.code, + }; + getSubThrsysDetail(params) + .then((response) => { + this.loading = false; + this.sysSubList = response.data.list || []; + }) + .catch(() => { + this.loading = false; + this.sysSubList = []; + }); + }, + handleSubForm(data, formName) { this.subFromName = formName; + if (formName === "edit") { this.subData = data; } else if (formName === "add") { @@ -819,7 +947,7 @@ export default { } ; this.subFormVisible = true; - + this.getSubThrsysDetailData(); }, //添加仓库 formSubmit() { @@ -1063,7 +1191,7 @@ export default { this.subList = []; this.userList = null; this.bussinessTypeList = null; - this.currentCode = row.code; + this.superRow = row; this.loadSubData(row.code); }, @@ -1305,8 +1433,11 @@ export default { sysId: this.currentSysId } bindThrWarehouse(params).then((res) => { - this.$message.success("绑定成功") - this.getThrsysDetailData(); + if (res.code == 20000) { + this.$message.success("绑定成功") + this.getThrsysDetailData(); + } + }).catch((error) => { this.$message.error("绑定失败") }) @@ -1324,11 +1455,46 @@ export default { this.$message.error("解绑失败"); }) }, + + //绑定第三方分库 + bindSubThrWarehouse() { + + let params = { + id: this.subData.id, + thridWarehouseId: this.checkSubThrWarehouseRow.code, + sysId: this.checkSubThrWarehouseRow.thirdSysFk + } + bindThrSubWarehouse(params).then((res) => { + if (res.code == 20000) { + this.$message.success("绑定成功") + this.getSubThrsysDetailData(); + } + this.thrSubWareHouseVisible = false; + }).catch((error) => { + this.$message.error("绑定失败"); + this.thrSubWareHouseVisible = false; + }) + }, + //解绑第三方分库 + unbindSubThrWarehouse(row) { + let params = { + id: this.subData.id, + sysId: row.sysId + }; + unbindSubThrWarehouse(params).then((res) => { + this.$message.success("解绑成功"); + this.getSubThrsysDetailData(); + }).catch((error) => { + this.$message.error("解绑失败"); + }) + }, + intentSelect(row) { if (row != null) this.currentSysId = row.sysId; //加载第三方仓库数据 this.thirdQuery.thirdSysFk = this.currentSysId; + this.thrWarehouseData = []; filterThrList(this.thirdQuery).then((res) => { this.thrWarehouseData = res.data.list; this.total = res.data.total || 0; @@ -1341,16 +1507,47 @@ export default { }); }, + intentSubSelect(row) { + + if (row != null) { + this.thirdSubQuery.parentId = this.superRow.code; + this.thirdSubQuery.thirdSysFk = row.sysId; + } + this.thrSubWarehouseData = []; + this.thrSubWareHouseVisible = true; + filterThridSubByInv(this.thirdSubQuery).then((res) => { + if (res.code == 20000) { + this.thrSubWarehouseData = res.data.list; + this.subTotal = res.data.total || 0; + } else { + this.$message.error(res.message); + } + + }).catch((error) => { + this.thrWarehouseData = []; + this.subTotal = 0; + this.$message.error("第三方分库库数据加载失败"); + }); + }, + handleCurrentChange(val) { this.thirdQuery.page = val; this.intentSelect(); }, + handleSubCurrentChange(val) { + this.thirdSubQuery.page = val; + this.intentSubSelect(); + }, changeThrWarehouse(row) { this.checkThrWarehouseRow = row; }, + changeSubThrWarehouse(row) { + this.checkSubThrWarehouseRow = row; + }, hideThrWarehouseTable() { this.thrWareHouseVisible = false; + this.thrSubWareHouseVisible = false; }, getSyncConfig() { findConfig() diff --git a/src/views/business/stockOrderRecedLog.vue b/src/views/business/stockOrderRecedLog.vue index 4053fc7..2a328fa 100644 --- a/src/views/business/stockOrderRecedLog.vue +++ b/src/views/business/stockOrderRecedLog.vue @@ -1,118 +1,117 @@