|
@@ -92,6 +92,7 @@ const sourceList = ref({
|
|
|
bomSpecWidth: "",
|
|
|
departmentId: "",
|
|
|
warehouseId: "",
|
|
|
+ warehouseIdList: [],
|
|
|
},
|
|
|
});
|
|
|
const loading = ref(false);
|
|
@@ -265,7 +266,18 @@ const getDemandData = () => {
|
|
|
}
|
|
|
});
|
|
|
proxy.post("/warehouse/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
|
- warehouseList.value[0].children = res.rows.filter((item) => item.type !== "1");
|
|
|
+ let rolesStatus = false;
|
|
|
+ if (proxy.useUserStore().roles && proxy.useUserStore().roles.length > 0) {
|
|
|
+ let roles = proxy.useUserStore().roles.filter((item) => item === "financeOfficer");
|
|
|
+ if (roles && roles.length > 0) {
|
|
|
+ rolesStatus = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (rolesStatus) {
|
|
|
+ warehouseList.value[0].children = res.rows.filter((item) => ["2", "3", "5"].includes(item.type));
|
|
|
+ } else {
|
|
|
+ warehouseList.value[0].children = res.rows.filter((item) => item.type !== "1");
|
|
|
+ }
|
|
|
if (!(route.query && route.query.backupDate)) {
|
|
|
proxy.post("/inventory/getQuantityByWarehouse", { departmentId: sourceList.value.pagination.departmentId }).then((res) => {
|
|
|
if (warehouseList.value[0].children && warehouseList.value[0].children.length > 0) {
|
|
@@ -302,6 +314,11 @@ const getList = async (req, status) => {
|
|
|
sourceList.value.pagination.departmentId = props.departmentId;
|
|
|
}
|
|
|
loading.value = true;
|
|
|
+ if (sourceList.value.pagination.warehouseId) {
|
|
|
+ sourceList.value.pagination.warehouseIdList = [sourceList.value.pagination.warehouseId];
|
|
|
+ } else {
|
|
|
+ sourceList.value.pagination.warehouseIdList = warehouseList.value[0].children.map((item) => item.id);
|
|
|
+ }
|
|
|
proxy.post(path, sourceList.value.pagination).then((res) => {
|
|
|
sourceList.value.data = res.rows;
|
|
|
sourceList.value.pagination.total = res.total;
|