diff --git a/src/api/modules/foundationMaterial.ts b/src/api/modules/foundationMaterial.ts index f329688..71c1a51 100644 --- a/src/api/modules/foundationMaterial.ts +++ b/src/api/modules/foundationMaterial.ts @@ -8,3 +8,7 @@ import http from "@/api"; export const getMaterialListApi = (params: any) => { return http.get(`material`, params); }; +//刷新 /admapi/material/reload +export const getMaterialListReloadApi = (params: any) => { + return http.get(`material/reload`, params); +}; diff --git a/src/api/modules/global.ts b/src/api/modules/global.ts index 8914a32..94d6284 100644 --- a/src/api/modules/global.ts +++ b/src/api/modules/global.ts @@ -24,3 +24,8 @@ export const getUsersApi = (params: any) => { export const getProductLinesApi = (params: any) => { return http.get(`basicinfo/productlines`, params); }; + +//仓库 +export const getWarehousesListApi = () => { + return http.get(`basicinfo/warehouses`); +}; diff --git a/src/hooks/useFilter.ts b/src/hooks/useFilter.ts deleted file mode 100644 index 93d318a..0000000 --- a/src/hooks/useFilter.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { cloneDeep } from "lodash-es"; - -export const useFilter = (datas: any) => { - const target = cloneDeep(datas); - const returnTarget = target.filter((item: any) => { - return !item.disable; - }); - return returnTarget; -}; diff --git a/src/hooks/useTable.ts b/src/hooks/useTable.ts index 2748196..b878fbc 100644 --- a/src/hooks/useTable.ts +++ b/src/hooks/useTable.ts @@ -31,7 +31,7 @@ export const useTable = ( } }); - //订阅列表数据处理 + //数据处理 const initSubscribeData = () => { if (routeName === "foundationSubscribeList") { if (Array.isArray(state.totalParam?.org_number) && state.totalParam?.org_number?.length) { diff --git a/src/views/foundation/set/material/constant/list/button.ts b/src/views/foundation/set/material/constant/list/button.ts index 9b7259c..48d5a37 100644 --- a/src/views/foundation/set/material/constant/list/button.ts +++ b/src/views/foundation/set/material/constant/list/button.ts @@ -2,7 +2,7 @@ export const BUTTON = [ { text: "导出", permission: "foundationSetMaterialBtnExport", - type: "add", + type: "export", props: { type: "primary" } @@ -10,6 +10,6 @@ export const BUTTON = [ { text: "刷新", permission: "foundationSetMaterialBtnRefresh", - type: "del" + type: "reset" } ]; diff --git a/src/views/foundation/set/material/init/btnClick.ts b/src/views/foundation/set/material/init/btnClick.ts index f754c55..177c470 100644 --- a/src/views/foundation/set/material/init/btnClick.ts +++ b/src/views/foundation/set/material/init/btnClick.ts @@ -1,6 +1,8 @@ +import { getMaterialListReloadApi } from "@/api/modules/foundationMaterial"; import { useMsg } from "@/hooks/useMsg"; +//getMaterialListResetApi // 直接导出函数,无需额外包装对象 -export const handleDel = (item: any, selectionList: any[], proTable: any) => { +export const handleExport = (item: any, selectionList: any[], proTable: any) => { console.log("导出操作", item); console.log(selectionList, "=selectionList="); let length = selectionList.length; @@ -24,8 +26,8 @@ export const handleDel = (item: any, selectionList: any[], proTable: any) => { }) .catch(() => {}); }; -// proTable: any -export const handleAdd = (item: any, selectionList: any[]) => { +// proTable: any getMaterialListReloadApi +export const handleReload = async (item: any, selectionList: any[], proTable: any) => { console.log("刷新操作", item); let length = selectionList.length; let ids: any = []; @@ -36,9 +38,15 @@ export const handleAdd = (item: any, selectionList: any[]) => { selectionList.forEach((item: any) => { ids.push(item.id); }); + let id = ids.join(","); + const result = await getMaterialListReloadApi({ id }); + if (result?.code === 0) { + useMsg("success", "数据刷新成功 !"); + proTable.value!.getTableList(); + } }; export const btnClick: any = { - del: handleDel, - add: handleAdd + export: handleExport, + reset: handleReload }; diff --git a/src/views/foundation/subscribe/list/add.vue b/src/views/foundation/subscribe/list/add.vue index 03b7a5e..7e6ab2c 100644 --- a/src/views/foundation/subscribe/list/add.vue +++ b/src/views/foundation/subscribe/list/add.vue @@ -42,6 +42,7 @@ const dataStore = reactive({ }); const userStore = useUserStore(); const $route = useRoute(); + dataStore.formData[0].options = userStore.orgIdArr; //新增 const handleAdd = () => { diff --git a/src/views/foundation/subscribe/warehousing/constant/list/search.ts b/src/views/foundation/subscribe/warehousing/constant/list/search.ts index 664e16e..81ad5a5 100644 --- a/src/views/foundation/subscribe/warehousing/constant/list/search.ts +++ b/src/views/foundation/subscribe/warehousing/constant/list/search.ts @@ -72,7 +72,7 @@ export const FORM_DATA: FormItem[] = [ options: [] }, { - prop: "sub_warehouse", + prop: "sub_warehouse_name", placeholder: "请输入子仓库", type: "input", label: "子仓库: " diff --git a/src/views/foundation/subscribe/warehousing/index.vue b/src/views/foundation/subscribe/warehousing/index.vue index 50ac7ed..35c08d2 100644 --- a/src/views/foundation/subscribe/warehousing/index.vue +++ b/src/views/foundation/subscribe/warehousing/index.vue @@ -57,12 +57,16 @@ const dataStore = reactive({ selectionList: [], //选中表格的行 loading: false }); -//设置组织数组 -dataStore.formData[5].options = userStore.orgIdArr; - -//订阅人 -dataStore.initParam.subscriber_name = userStore.userInfo.nickname; +const init = () => { + //设置组织数组 + dataStore.formData[5].options = userStore.orgIdArr; + //设置仓库数据 + dataStore.formData[6].options = userStore.warehouse; + //订阅人 + dataStore.initParam.subscriber_name = userStore.userInfo.nickname; +}; +init(); // 表格选择事件 const selectionChange = (selection: any) => { dataStore.selectionList = selection; @@ -82,6 +86,7 @@ const handleSearch = async (params: any) => { //重置 const handleReset = () => { dataStore.initParam = cloneDeep(RULE_FORM); + init(); //这里需要等到表格刷新以后才去请求 nextTick(() => { proTable.value!.getTableList(); diff --git a/src/views/foundation/subscribe/warehousing/init/btnClick.ts b/src/views/foundation/subscribe/warehousing/init/btnClick.ts index 5acca32..0eba86d 100644 --- a/src/views/foundation/subscribe/warehousing/init/btnClick.ts +++ b/src/views/foundation/subscribe/warehousing/init/btnClick.ts @@ -37,7 +37,9 @@ export const handleReSet = async (item: any, selectionList: any[], proTable: any selectionList.forEach((item: any) => { ids.push(item.id); }); - const result = await getSubscribeResetListApi(ids); + + let id = ids.join(","); + const result = await getSubscribeResetListApi({ id }); if (result?.code === 0) { useMsg("success", "数据刷新成功 !"); proTable.value!.getTableList(); diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 489e726..0fa0cc7 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -6,10 +6,10 @@