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 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
- 查询
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
- {{ getStatusInfo(scope.row.status) }}
-
-
-
+
+
+ 查询
+
+
+
+
+
-
-
-
- 详情
-
- 删除
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{ getStatusInfo(scope.row.status) }}
+
+
+
+
+
+
+ 详情
+
+ 删除
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
- 查询
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ 查询
+
+
+
+
+
-
- {{ getStatusInfo(scope.row.status) }}
-
-
-
-
-
-
- 详情
-
- 删除
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{ getStatusInfo(scope.row.status) }}
+
+
+
+
+
+
+ 详情
+
+ 删除
+
+
+
+
+
+
+ highlight-current-row
+ @current-change="handInvCurrentChange">
+
+ 添加分库
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+ 删除
+
+
+
+
+
+
-
+
-
-
-
- {{ item.name }}
-
-
-
-
+
@@ -144,10 +187,21 @@
-
+
-
-
+
+
+
+
+
+
+
+
@@ -169,68 +223,60 @@
>
+
+
-
+
+
+
+
+ {{ item.name }}
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 禁用
- 正常
-
-
-
+
+
@@ -244,6 +290,7 @@ import {
import {filterDetailByKey, getBasicThirdSys} from "../../api/basic/basicThirdSys";
import {findConfig} from "@/api/thrsys/spsSyncStatus";
import {isBlank} from "@/utils/strUtil";
+import {filterThridSubAll, filterSubByInv, deleteSubWarehouse, saveSubWarehouse} from "@/api/thrsys/thrdSubInvWarehouse";
const formJson = {
@@ -273,6 +320,9 @@ export default {
thirdSysFk: null,
},
mergeList: [],
+ subList: [],
+ subData: {},
+ currentCode: null,
node: null,
defaultProps: {
children: "children",
@@ -328,33 +378,25 @@ export default {
this.query.page = val;
this.getList();
},
- renderContent(h, {node, data, store}) {
- return (
-
-
- {node.label}
- (编码:{data.code})
-
-
- this.handleForm(node, data, "edit")}
- >
- 编辑
-
- this.handleDel(node, data)}
- >
- 删除
-
-
-
- );
+ handInvCurrentChange(row) {
+ this.subList = [];
+ this.currentCode = row.code;
+ this.loadSubData(row);
+ },
+
+ loadSubData(row) {
+ let subQuery = {
+ parentId: row.code,
+ thirdSysFk: row.thirdSysFk,
+ }
+ filterThridSubAll(subQuery).then((res) => {
+ if (res.code == 20000) {
+ this.subList = res.data.list;
+
+ }
+ }).catch((error) => {
+ });
},
onReset() {
this.$router.push({
@@ -456,29 +498,71 @@ export default {
}
},
- handleSubForm(node, data, formName) {
+ handleSubForm(data, formName) {
+ this.subFromName = formName;
+ if (formName === "edit") {
+ this.subData = data;
+ } else if (formName === "add") {
+ this.subData = {};
+ this.subData.parentId = data.code;
+ this.subData.thirdSysFk = data.thirdSysFk;
+ }
this.subFormVisible = true;
+ },
- this.pidData = data || null;
- formJson.pid = (data && parseInt(data.id)) || "";
- this.formData = JSON.parse(JSON.stringify(formJson));
- if (formName === "edit") {
- this.formData = Object.assign({}, data);
- this.node = node;
- } else {
- let no = this.getProjectNum() + Math.floor(Math.random() * 10000);
- this.formData.code = no;
+ handleSubDel(row) {
+ if (row.id) {
+ this.$confirm("确认删除该分库吗?", "提示", {
+ type: "warning",
+ })
+ .then(() => {
+ this.deleteLoading = true;
+ let para = {id: row.id};
+ deleteSubWarehouse(para)
+ .then((response) => {
+ this.deleteLoading = false;
+ if (response.code !== 20000) {
+ this.$message.error(response.message);
+ return false;
+ }
+ this.$message.success("删除成功");
+ this.loadSubData(row.parentId);
+ })
+ .catch(() => {
+ this.deleteLoading = false;
+ });
+ })
+ .catch(() => {
+ this.$message.info("取消删除");
+ });
}
- this.formData.pid = !this.formData.pid ? "" : this.formData.pid;
+ },
- this.formName = formName;
- if (data && data.id) {
- this.index = this.mergeList.findIndex((d) => d.id === data.id);
+ //添加分库
+ forSubSubmit() {
+
+ if (this.$isBlank(this.subData.name)) {
+ this.$message.error("分库名称不能为空!");
+ return;
}
+ saveSubWarehouse(this.subData, this.subFromName).then((response) => {
+ if (response.code == 20000) {
+ this.loadSubData(this.subData.parentId);
+ this.subFormVisible = false;
+ } else {
+ this.$message.error(response.message);
+ this.subFormVisible = false;
+ }
+ }).catch(() => {
+ this.subFormVisible = false;
+ });
+
},
+
+
formSubmit() {
if (!isBlank(this.formData.code)) {
- if (Number(this.formData.code)+'' ===NaN+'' ) {
+ if (Number(this.formData.code) + '' === NaN + '') {
this.$message.error("仓库编码格式错误!")
return;
}
@@ -515,11 +599,6 @@ export default {
this.mergeList.push(data);
}
}
- } else {
- // const parent = this.node.parent;
- // const children = parent.data.children || parent.data;
- // const index = children.findIndex((d) => d.id === data.id);
- // children.splice(index, 1, data);
}
// 刷新表单
this.resetForm();
@@ -658,7 +737,8 @@ export default {
.catch(() => {
});
},
- },
+ }
+ ,
filters: {
statusFilterType(status) {
const statusMap = {
@@ -666,24 +746,30 @@ export default {
1: "success",
};
return statusMap[status];
- },
+ }
+ ,
statusFilterName(status) {
const statusMap = {
0: "禁用",
1: "正常",
};
return statusMap[status];
- },
- },
+ }
+ ,
+ }
+ ,
mounted() {
- },
+ }
+ ,
created() {
// 加载表格数据
this.getBasicThirdSys();
this.getSyncConfig();
this.getList();
- },
-};
+ }
+ ,
+}
+;