12 Commits

Author SHA1 Message Date
fae9b61e7d feat: 🚀 修复bug 2025-11-18 17:32:51 +08:00
f4274d2fb3 fix: 🧩 修复bug 2025-11-18 16:38:07 +08:00
e908048997 feat: 🚀 修复bug 2025-11-18 10:16:36 +08:00
e79c096e12 feat: 🚀 修復bug 2025-11-18 09:21:25 +08:00
4168871fd4 fix: 🧩 修复bug 2025-11-17 15:53:22 +08:00
335b9a9b2d fix: 🧩 修复bug 2025-11-14 16:04:52 +08:00
2b2e6fc401 feat: 🚀 新增 2025-11-13 10:44:21 +08:00
17625a1cff feat: 🚀 完工 2025-11-10 15:35:59 +08:00
b0e729f9c0 fix: 🧩 修复金蝶仓库和子仓库options无法清空 2025-11-08 10:40:06 +08:00
caf79bae5a feat: 🚀 仓库关系查询-详情-更新 2025-11-08 09:48:16 +08:00
cad97ac4fd fix: 🧩 修复关闭标签对应的关联无法清空 2025-11-07 17:48:36 +08:00
1e80affb50 feat: 🚀 查询条件关联关系处理 2025-11-07 17:43:03 +08:00
37 changed files with 2184 additions and 287 deletions

View File

@@ -26,6 +26,22 @@ export const getProductLinesApi = (params: any) => {
};
//仓库
export const getWarehousesListApi = () => {
return http.get<any>(`basicinfo/warehouses`);
export const getWarehousesListApi = (params?: any) => {
return http.get<any>(`basicinfo/warehouses`, params);
};
//获取金蝶仓库
export const getWarehousesKingdeeListApi = (params: any) => {
return http.get<any>(`basicinfo/warehouses/kingdee`, params);
};
//获取金蝶子仓库
export const getSubwarehouseskingdeeListApi = (params?: any) => {
return http.get<any>(`basicinfo/subwarehouses/kingdee`, params);
};
//获取聚水潭仓库 /admapi/basicinfo/warehouses/jushuitan
export const getWarehousesJushuitanListApi = (params?: any) => {
return http.get<any>(`basicinfo/warehouses/jushuitan`, params);
};
export const getWarehousesLingXingListApi = (params?: any) => {
return http.get<any>(`basicinfo/warehouses/lingxing`, params);
};

View File

@@ -4,15 +4,15 @@ import http from "@/api";
* @name 全局模块(在公司下面的数据)
*/
//质检单列表
//质检单列表 /admapi/inspection
export const getQualityInspectListApi = (params: any) => {
return http.get<any>(`quality_inspect`, params);
return http.get<any>(`inspection`, params);
};
//刷新 /admapi/quality_inspect/reload
export const getQualityInspectReloadApi = (params: any) => {
return http.get<any>(`quality_inspect/reload`, params);
return http.get<any>(`inspection/reload`, params);
};
//导出
export const getQualityInspectExportApi = (params: any) => {
return http.get<any>(`quality_inspect/export`, params);
return http.get<any>(`inspection/export`, params);
};

View File

@@ -0,0 +1,26 @@
import http from "@/api";
//列表 /admapi/warehouse/pos_picking_priority
export const getGoodsListApi = (params: any) => {
return http.get<any>(`warehouse/pos_picking_priority`, params);
};
//新增 /admapi/warehouse/pos_picking_priority
export const getGoodsAddApi = (params: any) => {
return http.post<any>(`warehouse/pos_picking_priority`, params);
};
//更新
export const getGoodsUpApi = (id: any, params: any) => {
return http.post<any>(`warehouse/pos_picking_priority/${id}`, params);
};
//详情
export const getGoodsDetailsApi = (id: any) => {
return http.get<any>(`warehouse/pos_picking_priority/${id}`);
};
//预览
export const getGoodsPreviewApi = (id: any) => {
return http.get<any>(`warehouse/pos_picking_priority/preview/${id}`);
};
//验证 /admapi/warehouse/pos_picking_priority/check_exists
export const getGoodsCheckExistswApi = (params: any) => {
return http.get<any>(`warehouse/pos_picking_priority/check_exists`, params);
};

View File

@@ -1,10 +1,10 @@
import http from "@/api";
//
//列表
export const getSetWarehouseListApi = (params: any) => {
return http.get<any>(`store`, params);
return http.get<any>(`warehouse/relationship`, params);
};
// getWarehouseUpApi,getWarehouseDetailsApi,getWarehouseUpApi
//删除
export const getWarehouseDelApi = (params: any) => {
return http.delete<any>(`warehouse/relationship/${params}`);
@@ -18,10 +18,6 @@ export const getWarehouseUpApi = (id: any, params: any) => {
return http.post<any>(`warehouse/relationship/${id}`, params);
};
//详情
// export const getWarehouseDetailsApi = (id: any) => {
// return http.get<any>(`store/${id}`);
// };
// //导出
// export const getShopListExportApi = (params: any) => {
// return http.get<any>(`store/export`, params);
// };
export const getWarehouseDetailsApi = (id: any) => {
return http.get<any>(`warehouse/relationship/${id}`);
};

3
src/components.d.ts vendored
View File

@@ -16,6 +16,7 @@ declare module "vue" {
ElBreadcrumb: typeof import("element-plus/es")["ElBreadcrumb"];
ElBreadcrumbItem: typeof import("element-plus/es")["ElBreadcrumbItem"];
ElButton: typeof import("element-plus/es")["ElButton"];
ElCheckbox: typeof import("element-plus/es")["ElCheckbox"];
ElContainer: typeof import("element-plus/es")["ElContainer"];
ElDatePicker: typeof import("element-plus/es")["ElDatePicker"];
ElDialog: typeof import("element-plus/es")["ElDialog"];
@@ -28,6 +29,7 @@ declare module "vue" {
ElHeader: typeof import("element-plus/es")["ElHeader"];
ElIcon: typeof import("element-plus/es")["ElIcon"];
ElInput: typeof import("element-plus/es")["ElInput"];
ElInputNumber: typeof import("element-plus/es")["ElInputNumber"];
ElMain: typeof import("element-plus/es")["ElMain"];
ElMenu: typeof import("element-plus/es")["ElMenu"];
ElMenuItem: typeof import("element-plus/es")["ElMenuItem"];
@@ -42,6 +44,7 @@ declare module "vue" {
ElTabPane: typeof import("element-plus/es")["ElTabPane"];
ElTabs: typeof import("element-plus/es")["ElTabs"];
ElTag: typeof import("element-plus/es")["ElTag"];
ElTooltip: typeof import("element-plus/es")["ElTooltip"];
Empty: typeof import("./components/ProTable/components/Empty.vue")["default"];
Form: typeof import("./components/Form/index.vue")["default"];
FormItem: typeof import("./components/Form/components/FormItem.vue")["default"];

View File

@@ -67,6 +67,7 @@
:placeholder="item.placeholder"
clearable
:disabled="item.disabled"
@change="handleSelectChange(item)"
>
<el-option
v-for="option in item.options"
@@ -76,13 +77,14 @@
/>
</el-select>
</template>
<!-- 多选不带输入 -->
<template v-if="item.type === 'selectMultiples'">
<el-select
v-model="_searchResult[`${item.prop}`]"
:placeholder="item.placeholder"
clearable
multiple
:disabled="item.disabled"
style="max-height: 150px; overflow-y: auto"
>
<el-option
v-for="option in item.options"
@@ -152,10 +154,30 @@
></el-option>
</el-select>
</template>
<!-- 单选带模糊搜索 -->
<template v-if="item.type === 'selectMultipleD'">
<el-select
v-model="_searchResult[`${item.prop}`]"
filterable
:reserve-keyword="false"
:disabled="item.disabled"
:placeholder="item.placeholder"
clearable
@clear="handleSelectMultipleDClear(item)"
>
<!-- 循环渲染选项label 为显示文本value 为实际提交值 -->
<el-option
v-for="option in item.options"
:key="option.value"
:label="option.label"
:value="option.value"
></el-option>
</el-select>
</template>
<!-- 客户也是多选带模糊搜搜 -->
<template
v-if="item.type === 'selectMultipleRemoteCustomersNames' || item.type === 'selectProductLinesRemote'"
>
<!-- // filterable -->
<el-select
v-model="_searchResult[`${item.prop}`]"
:placeholder="item.placeholder"
@@ -200,6 +222,8 @@ const props = defineProps<{
selectMultipleRemoveTag?: () => void;
selectMultipleRemoteTag1?: () => void;
setRuleFormValue?: () => void;
selectMultipleDClear?: () => void;
selectChange?: () => void;
}>();
let _searchResult = computed(() => {
@@ -212,8 +236,12 @@ const emits = defineEmits<{
(e: "setRuleFormValue", result: Record<string, any>): void;
(e: "selectMultipleRemoveTag", result: Record<string, any>): void;
(e: "selectMultipleRemoteTag1", result: Record<string, any>): void;
(e: "selectMultipleDClear", result: Record<string, any>): void;
(e: "selectChange", result: Record<string, any>): void;
}>();
const handleSelectChange = (item: any) => {
emits("selectChange", item);
};
const handleRomoveTag = (item: any) => {
emits("selectMultipleRemoveTag", { item, org_number: _searchResult.value.org_number });
};
@@ -222,6 +250,7 @@ const handleTagRemove1 = (item: any) => {
item.options = [];
}
};
//客戶
const getCustomers = async (keywords: any, item: any) => {
let org_number = _searchResult.value.org_number.join(",");
@@ -285,6 +314,10 @@ const getUsers = async (keywords: any, item: any) => {
}
};
const handleSelectMultipleDClear = (item: any) => {
emits("selectMultipleDClear", { item });
};
//远程搜索多选
const handleSelectMultipleRemote = (query: any, item: any) => {
if (!query) {

View File

@@ -1,8 +1,8 @@
<template>
<div v-if="formData.length" class="table-search" style="display: flex">
<div v-if="_formData.length" class="table-search" style="display: flex">
<div style="flex: 2">
<el-form ref="formRef" :model="_searchParams" :inline="true">
<template v-for="item in formData" :key="item.prop">
<template v-for="item in _formData" :key="item.prop">
<el-form-item
:prop="item.prop"
:label-width="item.labelWidth ? item.labelWidth : '120px'"
@@ -86,8 +86,15 @@
/>
</el-select>
</template>
<!-- getProductLinesApi -->
<template v-if="item.type === 'selectMultipleRemote' || item.type === 'selectProductLinesRemote'">
<template
v-if="
item.type === 'selectMultipleRemote' ||
item.type === 'selectProductLinesRemote' ||
item.type === 'selectRemoteKD' ||
item.type === 'selectRemoteKDSubwarehouse'
"
>
<el-select
v-model.trim="_searchParams[`${item.prop}`]"
:placeholder="item.placeholder"
@@ -96,7 +103,6 @@
filterable
:reserve-keyword="false"
@remove-tag="handleTagRemove(item)"
@clear="handleClear(item)"
:loading="loading"
class="m-2 select"
remote-show-suffix
@@ -109,7 +115,7 @@
}
"
:disabled="item.disabled"
style="width: 224px"
style="width: 224px; max-height: 80px; overflow-y: auto"
>
<el-option
:label="option.label"
@@ -130,7 +136,7 @@
:placeholder="item.placeholder"
class="m-2 select"
:reserve-keyword="false"
style="width: 224px"
style="width: 224px; max-height: 80px; overflow-y: auto"
@remove-tag="handleTagRemove1(item)"
ref="remoteRef"
>
@@ -165,6 +171,23 @@
></el-option>
</el-select>
</template>
<!-- <template v-if="item.type === 'inputBtn'">
<el-input
:placeholder="item.placeholder"
:maxlength="item.maxlength || 255"
v-model.trim="_searchParams[`${item.prop}`]"
style="width: 224px"
@input="handleInput(item)"
@keyup.enter="handleFormSearch"
clearable
@clear="handleEmitClear(item)"
>
<template #append>
<div @click="handleClick(item)" style="cursor: pointer">...</div>
</template>
</el-input>
</template> -->
</el-form-item>
</template>
</el-form>
@@ -177,7 +200,14 @@
</template>
<script setup lang="ts" name="SearchForm">
import { verificationInput } from "./components/utils/verificationInput";
import { getSupplierApi, getCustomersApi, getProductLinesApi } from "@/api/modules/global";
import {
getSupplierApi,
getCustomersApi,
getProductLinesApi,
getWarehousesKingdeeListApi,
getSubwarehouseskingdeeListApi
} from "@/api/modules/global";
const props = defineProps<{
formData: any[];
searchParams: Record<string, any>;
@@ -189,13 +219,16 @@ const emits = defineEmits<{
(e: "reset", result: Record<string, any>): void;
(e: "selectMultipleRemoveTag", result: Record<string, any>): void;
}>();
const $router = useRouter();
const routeName: any = ref($router.currentRoute.value.name);
let loading = ref(false);
const remoteRef = ref(null);
const _searchParams = computed(() => {
const _searchParams: any = computed(() => {
return props.searchParams;
});
const _formData: any = computed(() => {
return props.formData;
});
//日期选择后重选赋值
const handlePicker = (item: any) => {
const { prop } = item;
@@ -259,10 +292,63 @@ const getProductLines = async (keywords: any, item: any) => {
}
}
};
//金蝶仓库 keywords: any, item: any
const getSetWarehouseKingdeeList = async () => {
const useOrgNumber: any[] = _searchParams?.value?.use_org_number;
if (Array.isArray(useOrgNumber) && useOrgNumber?.length > 0) {
_formData.value[1].options = [];
let use_org_number = "";
use_org_number = _searchParams.value.use_org_number.join(",");
const result = await getWarehousesKingdeeListApi({
// keywords: keywords,
use_org_number
});
if (result?.code === 0) {
let options: any = [];
result?.data?.forEach((it: any) => {
options.push({
label: it.warehouse_name,
value: it.warehouse_number + "_" + it.use_org_number,
use_org_number: it.use_org_number
});
});
_formData.value[1].options = options;
}
}
};
//获取金蝶子仓库
const getSetWarehouseSubwarehousesList = async () => {
const kdWarehouseNumber: any[] = _searchParams?.value?.kd_warehouse_number;
if (Array.isArray(kdWarehouseNumber) && kdWarehouseNumber?.length > 0) {
//先清空一下
_formData.value[2].options = [];
let kd_warehouse_number_str = "";
let kd_warehouse_number: any = [];
_searchParams.value.kd_warehouse_number.forEach((it: any) => {
kd_warehouse_number.push(it.split("_")[0]);
});
kd_warehouse_number_str = kd_warehouse_number.join(",");
const result = await getSubwarehouseskingdeeListApi({
warehouse_number: kd_warehouse_number_str
});
if (result?.code === 0) {
let options: any = [];
result?.data?.forEach((it: any) => {
options.push({
label: it.sub_warehouse_name,
value: it.sub_warehouse_number + "_" + it.warehouse_number,
warehouse_number: it.warehouse_number
});
});
_formData.value[2].options = options;
}
}
};
//多选远程搜索
const handleSelectMultipleRemote = async (query: any, item: any) => {
console.log(remoteRef.value, "==========remoteRef=========");
loading.value = true;
if (!query) {
loading.value = false;
@@ -281,18 +367,24 @@ const handleSelectMultipleRemote = async (query: any, item: any) => {
getCustomers(valClone, item);
} else if (item.type === "selectProductLinesRemote") {
//品线
getProductLines(valClone, item);
}
loading.value = false;
};
const handleTagRemove = (item: any) => {
if (!_searchParams.value[item.prop].length) {
item.options = [];
}
const { prop } = item;
if (prop === "kd_warehouse_number" || prop === "kd_subwarehouse_number") {
emits("selectMultipleRemoveTag", { item, org_number: _searchParams.value[prop] });
}
};
const handleTagRemove1 = (item: any) => {
emits("selectMultipleRemoveTag", { item, org_number: _searchParams.value.org_number });
const { prop } = item;
console.log(prop);
emits("selectMultipleRemoveTag", { item, org_number: _searchParams.value[prop] });
};
//单选远程搜索(供应商)
const remoteMethod = async (query: any, item: any) => {
@@ -336,6 +428,78 @@ const handleFormSearch = () => {
const handleFormReset = () => {
emits("reset", _searchParams.value);
};
// 核心逻辑:根据下划线后的值匹配,保留成功项
const filterBySuffixMatch = (targetArr: any, sourceArr: any) => {
// 遍历待筛选数组,筛选出符合条件的项
const matchedResult = sourceArr.filter((item: any) => {
// 分割下划线,获取后半部分(如 "THXLC_101" → "101"
const suffix = item.split("_")[1];
// 判断后缀是否存在于目标数组中
return targetArr.includes(suffix);
});
return matchedResult;
};
// 核心逻辑:按规则对比,保留匹配项
const filterMatchedItems = (upperArr: any, lowerArr: any) => {
// 第一步:处理上方数组,提取所有「下划线前的部分」,组成匹配池
const matchPool = upperArr.map((item: any) => item.split("_")[0]);
// 第二步:遍历下方数组,筛选匹配项
const matchedResult = lowerArr.filter((item: any) => {
// 提取下方数组元素「下划线后的部分」
const lowerSuffix = item.split("_")[1];
// 判断是否在匹配池中(同时处理无下划线的情况)
return lowerSuffix && matchPool.includes(lowerSuffix);
});
return matchedResult;
};
watch(
() => _searchParams?.value?.use_org_number,
newVal => {
if (routeName.value === "foundationSetWarehouse") {
if (!newVal || !newVal.length) {
_searchParams.value.kd_warehouse_number = "";
_searchParams.value.kd_subwarehouse_number = "";
_formData.value[1].options = [];
_formData.value[2].options = [];
}
getSetWarehouseKingdeeList();
if (!_searchParams?.value?.kd_warehouse_number || !_searchParams?.value?.kd_warehouse_number.length) {
return;
}
let kd_warehouse_number = filterBySuffixMatch(newVal, _searchParams?.value?.kd_warehouse_number);
_searchParams.value.kd_warehouse_number = kd_warehouse_number;
}
},
{
deep: true,
immediate: true
}
);
watch(
() => _searchParams?.value?.kd_warehouse_number,
newVal => {
if (routeName.value === "foundationSetWarehouse") {
if (!newVal || !newVal.length) {
_searchParams.value.kd_subwarehouse_number = "";
_formData.value[2].options = [];
}
getSetWarehouseSubwarehousesList();
if (!_searchParams?.value?.kd_subwarehouse_number || !_searchParams?.value?.kd_subwarehouse_number.length) {
return;
}
let kd_subwarehouse_number = filterMatchedItems(newVal, _searchParams?.value?.kd_subwarehouse_number);
console.log(kd_subwarehouse_number, "=kd_subwarehouse_number=");
_searchParams.value.kd_subwarehouse_number = kd_subwarehouse_number;
}
},
{
deep: true,
immediate: true
}
);
</script>
<style lang="scss" scope>
@use "./index.scss";

View File

@@ -63,6 +63,28 @@ export const useTable = (
state.totalParam.subscriber_name = state.totalParam?.subscriber_name.replace(/[,]/g, ",");
}
}
if (routeName === "foundationSetWarehouse") {
//组织
if (Array.isArray(state.totalParam?.use_org_number) && state.totalParam?.use_org_number?.length) {
state.totalParam.use_org_number = state.totalParam.use_org_number.join(",");
}
//金蝶仓库
if (Array.isArray(state.totalParam?.kd_warehouse_number) && state.totalParam?.kd_warehouse_number?.length) {
let kd_warehouse_number: any[] = [];
state.totalParam.kd_warehouse_number.forEach((item: any) => {
kd_warehouse_number.push(item.split("_")[0]);
});
state.totalParam.kd_warehouse_number = kd_warehouse_number.join(",");
}
//金蝶子仓库
if (Array.isArray(state.totalParam?.kd_subwarehouse_number) && state.totalParam?.kd_subwarehouse_number?.length) {
let kd_subwarehouse_number: any[] = [];
state.totalParam.kd_subwarehouse_number.forEach((item: any) => {
kd_subwarehouse_number.push(item.split("_")[0]);
});
state.totalParam.kd_subwarehouse_number = kd_subwarehouse_number.join(",");
}
}
};
//删除临时参数和空值参数

View File

@@ -41,7 +41,13 @@ const breadcrumbList = computed(() => {
item.meta.title = route.query.title;
}
});
console.log("");
}
if (route.query.title === "新增仓位找货优先级" || "编辑仓位找货优先级") {
breadcrumbData.forEach((item: any) => {
if (item.name === "foundationSetGoodsAdd") {
item.meta.title = route.query.title;
}
});
}
return breadcrumbData;

View File

@@ -32,6 +32,16 @@ import pinia from "@/stores";
import errorHandler from "@/utils/errorHandler";
import VXETable from "vxe-table";
import "vxe-table/lib/style.css";
// 全局添加 ElMessage 的高层级样式(不用再单独写 CSS 文件)
const style = document.createElement("style");
style.textContent = `
.el-message {
z-index: 3000 !important;
}
`;
document.head.appendChild(style);
localStorage.setItem("baseUrl", import.meta.env.VITE_SINGLE_URL);
const app = createApp(App);

View File

@@ -41,7 +41,8 @@ router.beforeEach(async (to, from, next) => {
const currentPath = window.location.pathname;
// 2.动态设置标题
const title = import.meta.env.VITE_GLOB_APP_TITLE;
document.title = to.meta.title ? `${to.meta.title} - ${title}` : title;
// to.meta.title ? `${to.meta.title} - ${title}` :
document.title = title;
// 3.判断是访问登陆页,有 Token 就在当前页面,没有 Token 重置路由到登陆页
if (to.path.toLocaleLowerCase() === LOGIN_URL) {
if (userStore.newUserToken) return next(from.fullPath);

View File

@@ -268,6 +268,3 @@
text-overflow: ellipsis;
white-space: nowrap;
}
.el-message {
z-index: 888;
}

View File

@@ -13,6 +13,7 @@
:labelWidth="dataStore.labelWidth"
:inline="true"
ref="detailsRef"
@selectChange="handleChange"
/>
</div>
</div>
@@ -24,19 +25,203 @@ import { cloneDeep } from "lodash-es";
import { DETAILS_FORM_DATA, DETAILS_RULE_FORM } from "./constant/list/add";
import DetailsSearch from "@/components/DetailsSearch/index.vue";
import PermissionButton from "@/components/PermissionButton/index.vue";
import { useUserStore } from "@/stores/modules/user";
import $Bus from "@/utils/mittBus";
import { getGoodsAddApi, getGoodsUpApi, getGoodsDetailsApi, getGoodsCheckExistswApi } from "@/api/modules/setGoods";
import { getWarehousesListApi } from "@/api/modules/global";
import { useMsg } from "@/hooks/useMsg";
const userStore = useUserStore();
const route = useRoute();
const $router = useRouter();
// 数据源
const dataStore = reactive<any>({
buttons: cloneDeep(BUTTON),
labelWidth: "120px",
formData: cloneDeep(DETAILS_FORM_DATA),
ruleForm: cloneDeep(DETAILS_RULE_FORM)
ruleForm: cloneDeep(DETAILS_RULE_FORM),
compareRuleForm: {},
id: null,
title: ""
});
// 详情表单实例
const detailsRef = ref(null);
//初始化组织数据
const init = () => {
if (userStore.orgIdArr.length) {
dataStore.formData[0].options = userStore?.orgIdArr;
}
};
init();
//新增
const handleAdd = async () => {
const result = await getGoodsAddApi(dataStore.ruleForm);
if (result?.code === 0) {
useMsg("success", "新增成功 ");
dataStore.id = result?.data?.id;
$Bus.emit("setGoodsResetList");
}
};
//更新
const getGoodsUp = async () => {
const result = await getGoodsUpApi(dataStore.id, dataStore.ruleForm);
if (result?.code === 0) {
useMsg("success", "更新成功 ");
$Bus.emit("setGoodsResetList");
//更新成功以后调用详情接口是为了刷新对比数据防止对比数据不一致
getGoodsDetails();
}
};
//详情
const getGoodsDetails = async () => {
dataStore.id = route.query.id;
if (!dataStore.id) {
return;
}
//getGoodsDetailsApi
const result = await getGoodsDetailsApi(dataStore.id);
if (result?.code === 0) {
dataStore.ruleForm = result?.data;
dataStore.compareRuleForm = cloneDeep(result?.data);
}
};
getGoodsDetails();
//验证
const getGoodsCheckExistsw = async () => {
const result = await getGoodsCheckExistswApi({
use_org_number: dataStore.ruleForm.use_org_number,
warehouse_number: dataStore.ruleForm.warehouse_number
});
if (result?.code === 0 && result?.data?.exists) {
useMsg("error", "仓库已存在数据, 无需再次新增 ");
}
};
// 按钮点击事件
const handleButtonClickCallback = () => {};
const handleButtonClickCallback = (item: any) => {
const { type } = item;
dataStore.title = route.query.title;
if (type === "save") {
if (!dataStore.ruleForm.use_org_number) {
return useMsg("warning", "组织不能为空 !");
}
if (!dataStore.ruleForm.warehouse_number) {
return useMsg("warning", "仓库不能为空 !");
}
if (!dataStore.ruleForm.pos_picking_priority) {
return useMsg("warning", "仓位不能为空 !");
}
dataStore.title === "新增仓位找货优先级" ? handleAdd() : getGoodsUp();
}
if (type === "preview") {
if (!dataStore.id && dataStore.title === "新增仓位找货优先级") {
useMsg("warning", "请先保存数据 !");
return;
}
// 编辑的话需要判断用户是否有修改
if (dataStore.title === "编辑仓位找货优先级") {
if (dataStore.compareRuleForm.use_org_number !== dataStore.ruleForm.use_org_number) {
useMsg("warning", "请先保存数据 !");
return;
}
if (dataStore.compareRuleForm.warehouse_number !== dataStore.ruleForm.warehouse_number) {
useMsg("warning", "请先保存数据 !");
return;
}
if (dataStore.compareRuleForm.pos_picking_priority !== dataStore.ruleForm.pos_picking_priority) {
useMsg("warning", "请先保存数据 !");
return;
}
}
$router.push({
path: "/foundation/set/goods/preview",
query: { id: dataStore.id, name: dataStore.title }
});
}
if (type === "return") {
$router.push({
path: "/foundation/set/goods/index"
});
}
};
//去重
const uniqueArrayObject = (arr: any[], uniqueKey: any = "value") => {
// 边界处理:如果传入的不是数组,直接返回空数组
if (!Array.isArray(arr)) {
console.warn("传入的参数不是数组,返回空数组");
return [];
}
// 方法1Map 实现(高效,保留顺序)
const uniqueMap = new Map();
arr.forEach(item => {
// 确保对象存在该字段,避免报错
if (item.hasOwnProperty(uniqueKey)) {
// 以 uniqueKey 的值为键重复键会自动覆盖保留最后一次出现forEach 顺序遍历,后出现的会覆盖前面的,如需保留首次出现,用下面的逻辑)
// 如需保留首次出现:只有 Map 中没有该键时才添加
if (!uniqueMap.has(item[uniqueKey])) {
uniqueMap.set(item[uniqueKey], item);
}
}
});
// 转换为数组返回
return Array.from(uniqueMap.values());
};
//仓库列表 /foundation/set/goods/preview
const getWarehousesList = async () => {
const result = await getWarehousesListApi({ use_org_number: dataStore.ruleForm.use_org_number });
if (result?.code === 0) {
const { data } = result;
if (data?.length) {
let options: any = [];
data.forEach((item: any) => {
options.push({
// id: item.id,
value: item.warehouse_number,
label: item.warehouse_name
});
});
dataStore.formData[1].options = options;
if (dataStore.ruleForm.warehouse_name) {
dataStore.formData[1].options.push({
value: dataStore.ruleForm.warehouse_number,
label: dataStore.ruleForm.warehouse_name
});
dataStore.formData[1].options = uniqueArrayObject(dataStore.formData[1].options);
}
} else {
dataStore.formData[1].options = [];
}
}
};
const handleChange = (item: any) => {
console.log(item);
if (item.prop === "warehouse_number") {
if (!dataStore.ruleForm.use_org_number || !dataStore.ruleForm.warehouse_number) {
return;
}
getGoodsCheckExistsw();
}
};
//监听当前组织
watch(
() => dataStore.ruleForm.use_org_number,
(newVal: any) => {
if (!newVal) {
dataStore.ruleForm.warehouse_number = "";
dataStore.formData[1].options = [];
return;
}
getWarehousesList();
},
{
deep: true,
immediate: true
}
);
</script>
<style scoped></style>

View File

@@ -1,6 +1,15 @@
export const DETAILS_FORM_DATA: any[] = [
{
prop: "org_number",
prop: "use_org_number",
placeholder: "请选择",
type: "select",
label: "组织:",
disabled: false,
required: true,
class: "form-item1"
},
{
prop: "warehouse_number",
placeholder: "请选择",
type: "select",
label: "仓库:",
@@ -9,7 +18,7 @@ export const DETAILS_FORM_DATA: any[] = [
class: "form-item1"
},
{
prop: "org_number",
prop: "pos_picking_priority",
placeholder: "请输入",
type: "textarea",
label: "仓位:",
@@ -19,4 +28,6 @@ export const DETAILS_FORM_DATA: any[] = [
maxLength: 5000
}
];
export const DETAILS_RULE_FORM: any = {};
export const DETAILS_RULE_FORM: any = {
use_org_number: "101"
};

View File

@@ -11,5 +11,10 @@ export const BUTTON = [
text: "预览(请先保存)",
permission: "foundationSetGoodsAddBtnPreview",
type: "preview"
},
{
text: "返回",
permission: "foundationSetGoodsAddBtnRreturn",
type: "return"
}
];

View File

@@ -17,10 +17,11 @@ interface FormItem {
}
export const FORM_DATA: FormItem[] = [
{
prop: "org_number",
prop: "warehouse_number",
placeholder: "请输入仓库",
type: "input",
label: "仓库: "
type: "select",
label: "仓库: ",
options: []
}
];

View File

@@ -4,38 +4,30 @@ export const COLUMNS = [
{
align: "left",
fixed: true,
label: "金蝶仓库",
prop: "material_number",
width: 200
label: "仓库名称",
prop: "warehouse_name"
},
{
align: "left",
label: "金蝶子仓库",
prop: "sku",
fixed: true,
width: 200
label: "组织",
prop: "use_org_name"
},
{
align: "left",
label: "对应聚水潭仓库",
prop: "material_name",
width: 200
},
{
align: "left",
label: "对应领星仓库",
prop: "org_name",
width: 200
label: "仓库优先级",
prop: "pos_picking_priority"
},
{
align: "left",
label: "更新人",
prop: "product_line"
prop: "operator_name"
},
{
align: "left",
label: "更新时间",
prop: "bar_code"
prop: "updated_at"
}
];

View File

@@ -11,7 +11,7 @@
<ProTable
ref="proTableRef"
:columns="dataStore.columns"
:request-api="getMaterialListApi"
:request-api="getGoodsListApi"
:init-param="dataStore.initParam"
@selectionChange="selectionChange"
>
@@ -23,6 +23,11 @@
:formData="dataStore.formData"
/>
</template>
<template #warehouse_name="scope">
<a @click="handleOpen(scope.row)" class="break-word to-details">
{{ scope.row.warehouse_name }}
</a>
</template>
</ProTable>
</div>
</template>
@@ -31,7 +36,9 @@
import ProTable from "@/components/ProTable/index.vue";
import SearchForm from "@/components/SearchForm/index.vue";
import PermissionButton from "@/components/PermissionButton/index.vue";
import { getMaterialListApi } from "@/api/modules/foundationMaterial";
import { getGoodsListApi } from "@/api/modules/setGoods";
import { useUserStore } from "@/stores/modules/user";
import $Bus from "@/utils/mittBus";
// import { useMsg } from "@/hooks/useMsg";
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
@@ -53,7 +60,13 @@ const dataStore = reactive<any>({
dialogVisible: false, //弹窗
selectionList: [] //选中表格的行
});
const userStore = useUserStore();
const router = useRouter();
const init = () => {
//仓库赋值
dataStore.formData[0].options = userStore.warehouse;
};
init();
// 表格选择事件
const selectionChange = (selection: any) => {
dataStore.selectionList = selection;
@@ -62,9 +75,15 @@ const selectionChange = (selection: any) => {
// 顶部按钮点击事件
const handleButtonClickCallback = (item: any) => {
console.log(item);
$router.push({ path: "/foundation/set/goods/add" });
$router.push({ path: "/foundation/set/goods/add", query: { title: "新增仓位找货优先级" } });
};
//跳转详情
const handleOpen = (row: any) => {
router.push({
path: "/foundation/set/goods/add",
query: { id: row.id, title: "编辑仓位找货优先级" }
});
};
// 搜索
const handleSearch = async (params: any) => {
dataStore.initParam = cloneDeep(params);
@@ -82,6 +101,13 @@ const handleReset = () => {
proTableRef?.value!.getTableList();
});
};
onMounted(() => {
$Bus.on("setGoodsResetList", () => {
nextTick(() => {
proTableRef?.value!.getTableList();
});
});
});
</script>
<style scope lang="scss">

View File

@@ -0,0 +1,54 @@
<template>
<div class="table-box">
<div>
<div style="padding-bottom: 16px">
<el-button type="primary" @click="handleBlack">返回</el-button>
</div>
</div>
<div class="table-box card">
<div style="display: flex">
<el-table :data="dataStore.tableData" border style="width: 70%">
<el-table-column type="index" :index="indexMethod" label="序号" width="100" />
<el-table-column prop="position" label="仓位" />
<el-table-column prop="priority_item" label="匹配项" />
</el-table>
</div>
</div>
</div>
</template>
<script setup lang="ts" name="foundationSetGoodsPreview">
import { getGoodsPreviewApi } from "@/api/modules/setGoods";
const $router = useRouter();
const route = useRoute();
const dataStore = reactive<any>({
tableData: []
});
const indexMethod = (index: number) => {
return index + 1;
};
//预览
const getGoodsPreview = async () => {
const result = await getGoodsPreviewApi(route.query.id);
if (result?.code === 0) {
dataStore.tableData = result?.data ? result?.data : [];
console.log(result?.data);
}
};
getGoodsPreview();
const handleBlack = () => {
if (route.query.name === "新增仓位找货优先级") {
$router.push({
path: "/foundation/set/goods/add",
query: { title: route.query.name }
});
} else {
$router.push({
path: "/foundation/set/goods/add",
query: { id: route.query.id, title: route.query.name }
});
}
};
</script>
<style scoped></style>

View File

@@ -66,7 +66,6 @@ const selectionChange = (selection: any) => {
};
const handleButtonClickCallback = (item: any) => {
const { type } = item;
btnClick[type]({
selectionList: dataStore.selectionList,
proTableRef,

View File

@@ -124,6 +124,9 @@ const getShopAdd = async () => {
useMsg("success", "新增成功 ");
setTimeout(() => {
dataStore.dialogVisible = false;
detailsRef?.value?.formElement?.resetFields();
dataStore.detailsRuleForm = cloneDeep(DETAILS_RULE_FORM);
dataStore.detailsFormData = cloneDeep(DETAILS_FORM_DATA);
proTableRef?.value!.getTableList();
}, 600);
}
@@ -135,6 +138,9 @@ const getShopUp = async () => {
useMsg("success", "更新成功 ");
setTimeout(() => {
dataStore.dialogVisible = false;
detailsRef?.value?.formElement?.resetFields();
dataStore.detailsRuleForm = cloneDeep(DETAILS_RULE_FORM);
dataStore.detailsFormData = cloneDeep(DETAILS_FORM_DATA);
proTableRef?.value!.getTableList();
}, 600);
}
@@ -150,16 +156,17 @@ const getShopDetails = async (id: any) => {
}
};
// 表格row点击事件
const handleOpen = (row: any) => {
const handleOpen = async (row: any) => {
dataStore.rowId = row.id;
getShopDetails(row.id);
await getShopAccessSystem();
await getShopDetails(row.id);
};
// 獲取接入系統列表數據
const getShopAccessSystem = async () => {
const result = await getShopAccessSystemApi();
if (result?.code === 0) {
let data = cloneDeep(result?.data);
let options = [];
let options: any = [];
data?.length &&
data.forEach((item: any) => {
@@ -169,7 +176,7 @@ const getShopAccessSystem = async () => {
dataStore.detailsFormData[2].options = options;
}
};
getShopAccessSystem();
// 导出
const handleExport = async () => {
const result = await getShopListExportApi(dataStore.initParam);
@@ -189,11 +196,13 @@ const handleButtonClickCallback = (item: any) => {
if (type === "add") {
dataStore.title = "新增店铺";
dataStore.dialogVisible = true;
getShopAccessSystem();
}
};
// 弹窗取消
const handleClose = () => {
dataStore.detailsRuleForm = cloneDeep(DETAILS_RULE_FORM);
dataStore.detailsFormData = cloneDeep(DETAILS_FORM_DATA);
detailsRef?.value?.formElement?.resetFields();
dataStore.dialogVisible = false;
};
@@ -241,7 +250,6 @@ const handleCommit = () => {
};
// 搜索
const handleSearch = async (params: any) => {
console.log(params, "==============>");
dataStore.initParam = cloneDeep(params);
//这里需要等到表格刷新以后才去请求
nextTick(() => {

View File

@@ -2,47 +2,59 @@ export const DETAILS_FORM_DATA: any[] = [
{
prop: "use_org_number",
placeholder: "请输入",
type: "select",
type: "selectMultipleD",
label: "组织:",
disabled: false,
required: true,
class: "form-item1"
class: "form-item1",
options: []
},
{
prop: "kd_warehouse_number",
placeholder: "请输入",
type: "select",
placeholder: "请选择",
type: "selectMultipleD",
label: "金蝶仓库:",
disabled: false,
required: true,
class: "form-item1"
class: "form-item1",
options: []
},
{
prop: "kd_subwarehouse ",
prop: "kd_subwarehouse_number",
placeholder: "请选择",
type: "selectMultiples",
type: "selectMultiple",
label: "金蝶子仓库:",
disabled: false,
required: true,
class: "form-item1"
class: "form-item1",
options: []
},
{
prop: "jst_warehouse_number",
placeholder: "请输入",
type: "select",
placeholder: "请选择",
type: "selectMultipleD",
label: "对应聚水潭仓库:",
disabled: false,
required: true,
class: "form-item1"
class: "form-item1",
options: []
},
{
prop: "lx_warehouse_number",
placeholder: "请输入",
type: "select",
placeholder: "请选择",
type: "selectMultipleD",
label: "对应领星仓库:",
disabled: false,
required: true,
class: "form-item1",
options: []
},
{
//textarea
prop: "remark",
placeholder: "请输入",
type: "textarea",
label: "备注:",
disabled: false,
maxLength: 5000,
class: "form-item1"
}
];

View File

@@ -26,17 +26,20 @@ export const FORM_DATA: FormItem[] = [
{
prop: "kd_warehouse_number",
placeholder: "请输入金蝶仓库",
type: "input",
label: "金蝶仓库: "
type: "selectMultiple",
label: "金蝶仓库: ",
options: []
},
{
prop: "kd_subwarehouse",
prop: "kd_subwarehouse_number",
placeholder: "请输入金蝶子仓库",
type: "input",
label: "金蝶子仓库: "
type: "selectMultiple",
label: "金蝶子仓库: ",
options: []
},
{
prop: "operator_name",
prop: "operator",
placeholder: "请输入更新人",
type: "input",
label: "更新人: "

View File

@@ -1,48 +1,64 @@
// import { RenderScope } from "@/components/ProTable/interface";
import { RenderScope } from "@/components/ProTable/interface";
export const COLUMNS = [
{ type: "selection", fixed: "left", width: 40 },
{
align: "left",
fixed: true,
label: "金蝶仓库",
prop: "material_number",
prop: "kd_warehouse_name",
width: 200
},
{
align: "left",
fixed: true,
label: "组织",
prop: "use_org_number",
prop: "use_org_name",
width: 200
},
{
align: "left",
label: "金蝶子仓库",
prop: "sku",
prop: "kd_subwarehouse_number",
width: 400,
fixed: true,
width: 200
render: (scope: RenderScope<any>): VNode | string | any => {
let arr: any = [];
if (Array.isArray(scope.row.kd_subwarehouse) && scope.row.kd_subwarehouse.length) {
scope.row.kd_subwarehouse?.forEach((item: any) => {
arr.push(item.subwarehouse_name);
});
}
return Array.isArray(arr) && arr.length ? arr.join(",") : "--";
}
},
{
align: "left",
label: "对应聚水潭仓库",
prop: "material_name",
prop: "jst_warehouse_name",
width: 200
},
{
align: "left",
label: "对应领星仓库",
prop: "org_name",
prop: "lx_warehouse_name",
width: 200
},
{
align: "left",
label: "备注",
prop: "remark",
width: 200
},
{
align: "left",
label: "更新人",
prop: "product_line"
prop: "operator"
},
{
align: "left",
label: "更新时间",
prop: "bar_code"
prop: "updated_at",
width: 200
}
];

View File

@@ -14,6 +14,7 @@
:labelWidth="dataStore.labelWidth"
:inline="true"
:isSearch="true"
@selectMultipleDClear="handleSelectMultipleDClear"
ref="detailsRef"
/>
<template #footer>
@@ -26,10 +27,11 @@
<ProTable
ref="proTableRef"
:columns="dataStore.columns"
:request-api="getShopListApi"
:request-api="getSetWarehouseListApi"
:init-param="dataStore.initParam"
@selectionChange="selectionChange"
>
<!-- @selectMultipleRemoveTag="handleSelectMultipleRemoveTag" -->
<template v-slot:search>
<SearchForm
@search="handleSearch"
@@ -38,22 +40,36 @@
:formData="dataStore.formData"
/>
</template>
<template #platform_store_name="scope">
<template #kd_warehouse_name="scope">
<a @click="handleOpen(scope.row)" class="break-word to-details">
{{ scope.row.platform_store_name }}
{{ scope.row.kd_warehouse_name }}
</a>
</template>
</ProTable>
</div>
</template>
<script setup lang="ts" name="foundationSetShop">
<script setup lang="ts" name="foundationSetWarehouse">
import ProTable from "@/components/ProTable/index.vue";
import SearchForm from "@/components/SearchForm/index.vue";
import PermissionButton from "@/components/PermissionButton/index.vue";
import { getShopListApi } from "@/api/modules/shop";
import { useUserStore } from "@/stores/modules/user";
import { getWarehouseDelApi, getWarehouseAddApi, getWarehouseUpApi } from "@/api/modules/setWarehouse";
import {
getSetWarehouseListApi,
getWarehouseDelApi,
getWarehouseAddApi,
getWarehouseUpApi,
getWarehouseDetailsApi
} from "@/api/modules/setWarehouse";
import {
getWarehousesKingdeeListApi,
getSubwarehouseskingdeeListApi,
getWarehousesJushuitanListApi,
getWarehousesLingXingListApi
} from "@/api/modules/global";
import { useMsg } from "@/hooks/useMsg";
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
import { DETAILS_RULE_FORM, DETAILS_FORM_DATA } from "./constant/list/details";
@@ -117,58 +133,187 @@ const handleDel = () => {
}
};
// 新增
const getWarehouseAdd = async () => {
const result = await getWarehouseAddApi(dataStore.detailsRuleForm);
const getWarehouseAdd = async (params: any) => {
const result = await getWarehouseAddApi(params);
if (result?.code === 0) {
useMsg("success", "新增成功 ");
setTimeout(() => {
dataStore.dialogVisible = false;
detailsRef?.value?.formElement?.resetFields();
proTableRef?.value!.getTableList();
}, 600);
}
};
// 更新
const getWarehouseUp = async () => {
const result = await getWarehouseUpApi(dataStore.rowId, dataStore.detailsRuleForm);
const getWarehouseUp = async (params: any) => {
const result = await getWarehouseUpApi(dataStore.rowId, params);
if (result?.code === 0) {
useMsg("success", "更新成功 ");
setTimeout(() => {
dataStore.dialogVisible = false;
detailsRef?.value?.formElement?.resetFields();
proTableRef?.value!.getTableList();
}, 600);
}
};
// 详情
const getShopDetails = async (id: any) => {
const result = await getShopDetailsApi(id);
const getWarehouseDetails = async (id: any) => {
const result = await getWarehouseDetailsApi(id);
if (result?.code === 0) {
dataStore.dialogVisible = true;
dataStore.title = "编辑金蝶子仓与各系统仓库关系";
setAccessSystem(result?.data?.access_system);
dataStore.detailsRuleForm = result?.data;
//临时变量存储金蝶和金蝶子仓库
let kd_warehouse_number = dataStore?.detailsRuleForm?.kd_warehouse_number;
let kd_subwarehouse = dataStore?.detailsRuleForm?.kd_subwarehouse;
//判断金蝶仓库和金蝶子仓库是否存在
if (kd_warehouse_number && Array.isArray(kd_subwarehouse) && kd_subwarehouse.length) {
let kd_subwarehouse_number: any[] = [];
dataStore?.detailsRuleForm?.kd_subwarehouse?.forEach((item: any) => {
kd_subwarehouse_number.push(item.subwarehouse_number);
});
nextTick(() => {
dataStore.detailsRuleForm.kd_subwarehouse_number = kd_subwarehouse_number;
});
}
}
};
//获取金蝶仓库
const getSetWarehouseKingdeeList = async (type: any) => {
dataStore.detailsFormData[1].options = [];
const result = await getWarehousesKingdeeListApi({ use_org_number: dataStore.detailsRuleForm.use_org_number });
if (result?.code === 0) {
let options: any = [];
result?.data?.forEach((item: any) => {
options.push({
label: item.warehouse_name,
value: item.warehouse_number
});
});
if (type === "details") {
dataStore.detailsFormData[1].options = options;
if (dataStore.detailsRuleForm.kd_warehouse_number) {
dataStore.detailsFormData[1].options.push({
label: dataStore.detailsRuleForm.kd_warehouse_number,
value: dataStore.detailsRuleForm.kd_warehouse_number
});
dataStore.detailsFormData[1].options = uniqueArrayObject(dataStore.detailsFormData[1].options);
}
} else {
dataStore.formData[1].options = options;
}
}
};
//去重
const uniqueArrayObject = (arr: any[], uniqueKey: any = "value") => {
// 边界处理:如果传入的不是数组,直接返回空数组
if (!Array.isArray(arr)) {
console.warn("传入的参数不是数组,返回空数组");
return [];
}
// 方法1Map 实现(高效,保留顺序)
const uniqueMap = new Map();
arr.forEach(item => {
// 确保对象存在该字段,避免报错
if (item.hasOwnProperty(uniqueKey)) {
// 以 uniqueKey 的值为键重复键会自动覆盖保留最后一次出现forEach 顺序遍历,后出现的会覆盖前面的,如需保留首次出现,用下面的逻辑)
// 如需保留首次出现:只有 Map 中没有该键时才添加
if (!uniqueMap.has(item[uniqueKey])) {
uniqueMap.set(item[uniqueKey], item);
}
}
});
// 转换为数组返回
return Array.from(uniqueMap.values());
};
//获取金蝶子仓库
const getSetWarehouseSubwarehousesList = async (type: any) => {
//先清空一下
dataStore.detailsFormData[2].options = [];
const result = await getSubwarehouseskingdeeListApi({
warehouse_number: dataStore.detailsRuleForm.kd_warehouse_number
});
if (result?.code === 0) {
let options: any = [];
result?.data?.forEach((item: any) => {
options.push({
label: item.sub_warehouse_name,
value: item.sub_warehouse_number
});
});
if (type === "details") {
dataStore.detailsFormData[2].options = options;
if (dataStore.detailsRuleForm.kd_subwarehouse.length) {
let options: any = [];
dataStore.detailsRuleForm.kd_subwarehouse.forEach((item: any) => {
options.push({ label: item.subwarehouse_name, value: item.subwarehouse_number });
});
dataStore.detailsFormData[2].options = [...dataStore.detailsFormData[2].options, ...options];
dataStore.detailsFormData[2].options = uniqueArrayObject(dataStore.detailsFormData[2].options);
}
} else {
dataStore.formData[2].options = options;
}
}
};
//获取领星仓库
const getSetWarehouseSubwarehousesLingXingList = async () => {
const result = await getWarehousesLingXingListApi();
if (result?.code === 0) {
let options: any = [];
result?.data?.forEach((item: any) => {
options.push({
label: item.warehouse_name,
value: item.warehouse_number + ""
});
});
dataStore.detailsFormData[4].options = options;
console.log(dataStore.detailsRuleForm.lx_warehouse_number, "");
//领星
if (dataStore.detailsRuleForm.lx_warehouse_number) {
dataStore.detailsFormData[4].options.push({
label: dataStore.detailsRuleForm.lx_warehouse_name,
value: dataStore.detailsRuleForm.lx_warehouse_number
});
dataStore.detailsFormData[4].options = uniqueArrayObject(dataStore.detailsFormData[4].options);
}
}
};
//获取聚水潭仓库
const getSetWarehouseSubwarehousesJushuitanList = async () => {
const result = await getWarehousesJushuitanListApi();
if (result?.code === 0) {
let options: any = [];
result?.data?.forEach((item: any) => {
options.push({
label: item.warehouse_name,
value: item.warehouse_number + ""
});
});
dataStore.detailsFormData[3].options = options;
if (dataStore.detailsRuleForm.jst_warehouse_number) {
dataStore.detailsFormData[3].options.push({
label: dataStore.detailsRuleForm.jst_warehouse_name,
value: dataStore.detailsRuleForm.jst_warehouse_number
});
dataStore.detailsFormData[3].options = uniqueArrayObject(dataStore.detailsFormData[3].options);
}
}
};
// 表格row点击事件
const handleOpen = (row: any) => {
dataStore.rowId = row.id;
getShopDetails(row.id);
getWarehouseDetails(row.id);
};
// 导出
const handleExport = async () => {
const result = await getShopListExportApi(dataStore.initParam);
if (result?.code === 0) {
useMsg("success", "导出成功请前往导出列表中进行下载 ");
}
};
// 顶部按钮点击事件
const handleButtonClickCallback = (item: any) => {
const { type } = item;
if (type === "del") {
return handleDel();
}
if (type === "export") {
return handleExport();
handleDel();
}
if (type === "add") {
dataStore.title = "新增金蝶子仓与各系统仓库关系";
@@ -184,30 +329,39 @@ const handleClose = () => {
// 弹窗确认
const handleCommit = () => {
if (!dataStore.detailsRuleForm.use_org_number) {
let params = cloneDeep(dataStore.detailsRuleForm);
if (!params.use_org_number) {
return useMsg("warning", "组织不能为空 !");
}
if (!dataStore.detailsRuleForm.kd_warehouse_number) {
if (!params.kd_warehouse_number) {
return useMsg("warning", "金蝶仓库不能为空 !");
}
if (!dataStore.detailsRuleForm.kd_subwarehouse) {
return useMsg("warning", "金蝶子仓库不能为空 !");
}
if (!dataStore.detailsRuleForm.jst_warehouse_number) {
return useMsg("warning", "对应聚水潭仓库不能为空 !");
}
if (!dataStore.detailsRuleForm.lx_warehouse_number) {
return useMsg("warning", "对应对应领星仓库不能为空 !");
}
if (dataStore.title === "新增金蝶子仓与各系统仓库关系") {
getWarehouseAdd();
//将金蝶子仓库转换为字符串
let kd_subwarehouse_number = params.kd_subwarehouse_number;
if (Array.isArray(kd_subwarehouse_number) && kd_subwarehouse_number.length) {
params.kd_subwarehouse_number = kd_subwarehouse_number.join(",");
} else {
getWarehouseUp();
delete params.kd_subwarehouse_number;
}
if (dataStore.title === "新增金蝶子仓与各系统仓库关系") {
getWarehouseAdd(params);
} else {
getWarehouseUp(params);
}
};
// 搜索
const handleSearch = async (params: any) => {
dataStore.initParam = cloneDeep(params);
// dataStore.initParam.kd_subwarehouse_number
// if (dataStore.initParam.kd_subwarehouse_number.length) {
// let kd_subwarehouse_number = [];
// dataStore.initParam.kd_subwarehouse_number.forEach((it: any) => {
// // kd_subwarehouse_number.push(it.split("_")[1]);
// console.log(it.split("_")[1]);
// });
// dataStore.initParam.kd_subwarehouse_number = kd_subwarehouse_number;
// }
//这里需要等到表格刷新以后才去请求
nextTick(() => {
proTableRef?.value!.getTableList();
@@ -221,6 +375,60 @@ const handleReset = () => {
proTableRef?.value!.getTableList();
});
};
//监听组织和金蝶仓库清空按钮(会触发下面的watch)
const handleSelectMultipleDClear = (params: any) => {
const {
item: { prop }
} = params;
dataStore.detailsRuleForm[prop] = "";
};
// //监听弹窗开启
watch(
() => dataStore.dialogVisible,
(newVal: any) => {
if (newVal) {
//金蝶倉庫
getSetWarehouseKingdeeList("details");
//领星仓库
getSetWarehouseSubwarehousesLingXingList();
//聚水潭仓库
getSetWarehouseSubwarehousesJushuitanList();
}
},
{
deep: true
}
);
//监听组织值改变(值改变关联关系需重置)
watch(
() => dataStore.detailsRuleForm.use_org_number,
(newVal: any) => {
if (newVal) {
dataStore.detailsRuleForm.kd_warehouse_number = "";
dataStore.detailsRuleForm.kd_subwarehouse_number = "";
getSetWarehouseKingdeeList("details");
} else {
dataStore.detailsRuleForm.kd_warehouse_number = "";
dataStore.detailsRuleForm.kd_subwarehouse_number = "";
dataStore.detailsFormData[1].options = [];
dataStore.detailsFormData[2].options = [];
}
}
);
//监听金蝶仓库值改变(值改变关联关系需重置)
watch(
() => dataStore.detailsRuleForm.kd_warehouse_number,
(newVal: any) => {
if (newVal) {
dataStore.detailsRuleForm.kd_subwarehouse_number = "";
getSetWarehouseSubwarehousesList("details");
} else {
dataStore.detailsRuleForm.kd_subwarehouse_number = "";
dataStore.detailsFormData[2].options = [];
}
}
);
</script>
<style scope lang="scss">

View File

@@ -6,11 +6,11 @@
<script setup lang="ts" name="home">
//登录请求接口
// import { getOrgsApi, getWarehousesListApi } from "@/api/modules/global";
import { getWarehousesListApi } from "@/api/modules/global";
import { useRoute, useRouter } from "vue-router";
//用户信息存储
// import { useUserStore } from "@/stores/modules/user";
// const userStore = useUserStore();
import { useUserStore } from "@/stores/modules/user";
const userStore = useUserStore();
//路由;
const $route = useRoute();
const $router = useRouter();
@@ -33,24 +33,24 @@ const $router = useRouter();
// }
// };
// getOrgs();
// const getWarehousesList = async () => {
// const result = await getWarehousesListApi();
// if (result?.code === 0) {
// const { data } = result;
// if (data?.length) {
// let options: any = [];
// data.forEach((item: any) => {
// options.push({
// id: item.id,
// value: item.warehouse_name,
// label: item.warehouse_name
// });
// });
// userStore.setWarehouse(options);
// }
// }
// };
// getWarehousesList();
const getWarehousesList = async () => {
const result = await getWarehousesListApi();
if (result?.code === 0) {
const { data } = result;
if (data?.length) {
let options: any = [];
data.forEach((item: any) => {
options.push({
id: item.id,
value: item.warehouse_number,
label: item.warehouse_name
});
});
userStore.setWarehouse(options);
}
}
};
getWarehousesList();
const init = () => {
let redirect_path: any = $route.query.redirect_path;

View File

@@ -39,7 +39,7 @@ const getOrgs = async () => {
};
const getWarehousesList = async () => {
const result = await getWarehousesListApi();
const result = await getWarehousesListApi({});
if (result?.code === 0) {
const { data } = result;
if (data?.length) {

View File

@@ -1,8 +1,13 @@
export const BUTTON = [
{
text: "返回",
permission: "receiptWarehousingReceiptOrderAddBtnBack",
type: "back"
},
{
text: "提交",
permission: "receiptWarehousingReceiptOrderAddBtnCommit",
type: "commit",
permission: "receiptWarehousingReceiptOrderAddBtnSubmit",
type: "submit",
props: {
type: "primary"
}

View File

@@ -0,0 +1,7 @@
export const BUTTON = [
{
text: "返回",
permission: "receiptWarehousingReceiptOrderDetailsBtnBack",
type: "back"
}
];

View File

@@ -19,12 +19,12 @@ export const BUTTON = [
},
{
text: "导出",
permission: "inspectionManagementReportBtnExport",
permission: "receiptWarehousingReceiptOrderBtnExport",
type: "export"
},
{
text: "刷新",
permission: "inspectionManagementReportBtnRefresh",
permission: "receiptWarehousingReceiptOrderBtnRefresh",
type: "refresh"
}
];

View File

@@ -9,14 +9,20 @@
</div>
<ProTable
ref="proTable"
:formData="dataStore.formData"
ref="proTableRef"
:columns="dataStore.columns"
:request-api="getMaterialListApi"
:init-param="dataStore.initParam"
@selectionChange="selectionChange"
:orgCode="dataStore.ruleForm.orgCode"
>
<template v-slot:search>
<SearchForm
@search="handleSearch"
@reset="handleReset"
:searchParams="dataStore.initParam"
:formData="dataStore.formData"
/>
</template>
<template #boxBillNo="scope">
<a @click="handleOpen(scope.row)" class="break-word to-details">
{{ scope.row.boxBillNo }}
@@ -28,7 +34,6 @@
<script setup lang="ts" name="inspectionManagementReport">
import ProTable from "@/components/ProTable/index.vue";
// import { useMsg } from "@/hooks/useMsg";
import PermissionButton from "@/components/PermissionButton/index.vue";
import { getMaterialListApi } from "@/api/modules/foundationMaterial";
@@ -37,16 +42,14 @@ import { useRouter } from "vue-router";
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
//表格TS
import { ProTableInstance } from "@/components/ProTable/interface";
import { useUserStore } from "@/stores/modules/user";
import { btnClick } from "./init";
//深拷贝方法
import { cloneDeep } from "lodash-es";
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
const proTable = ref<ProTableInstance>();
const proTableRef = ref<ProTableInstance>();
const $router = useRouter();
// 获取用户信息(组织id)
const userStore = useUserStore();
// 数据源
const dataStore = reactive<any>({
columns: COLUMNS, //列表配置项
@@ -67,39 +70,26 @@ const handleButtonClickCallback = (item: any) => {
const { type } = item;
btnClick[type](item, $router);
};
// // 规格型号
// const remoteMethod1 = async (query: any) => {
// datas.loading = true;
// if (!query) {
// datas.loading = false;
// return;
// }
// let valClone = query.replace(/^\s*|\s*$/g, "");
// if (!valClone.length) {
// datas.loading = false;
// return;
// }
// const result = await getMaterialListApi(valClone);
// if (result.status === 200) {
// const { data } = result;
// datas.options = data;
// }
// datas.loading = false;
// };
//搜索
const handleSearch = async (params: any) => {
dataStore.initParam = cloneDeep(params);
//这里需要等到表格刷新以后才去请求
nextTick(() => {
proTableRef?.value!.getTableList();
});
};
//重置
const handleReset = () => {
dataStore.initParam = cloneDeep(RULE_FORM);
// init();
//这里需要等到表格刷新以后才去请求
nextTick(() => {
proTableRef?.value!.getTableList();
});
};
const handleOpen = (row: any) => {
console.log(row);
};
watch(
() => userStore.orgCode,
newVal => {
dataStore.ruleForm.orgCode = newVal;
dataStore.initParam.orgCode = newVal;
},
{
immediate: true,
deep: true
}
);
</script>
<style scope lang="scss">

View File

@@ -1,7 +1,7 @@
export const BUTTON = [
{
text: "重传",
permission: "receiptWarehousingWarehousingOrderBtnRetransmission",
permission: "receiptWarehousingWarehousingOrderBtnCC",
type: "retransmission",
props: {
type: "primary"
@@ -14,7 +14,7 @@ export const BUTTON = [
},
{
text: "同步成功",
permission: "receiptWarehousingWarehousingOrderBtnSynchronize",
permission: "receiptWarehousingWarehousingOrderBtnTB",
type: "synchronize"
}
];

View File

@@ -20,22 +20,19 @@ export const FORM_DATA: FormItem[] = [
prop: "securityNumbers",
placeholder: "请输入来源单号",
type: "input",
isArray: true,
label: "来源单号: "
},
{
prop: "lotNumbers",
placeholder: "请选择收货类型",
placeholder: "请选择来源类型",
type: "select",
isArray: true,
label: "收货类型: ",
label: "来源类型: ",
options: []
},
{
prop: "lotNumbers",
placeholder: "请选择仓库",
type: "select",
isArray: true,
label: "仓库: ",
options: []
},
@@ -43,34 +40,23 @@ export const FORM_DATA: FormItem[] = [
prop: "Time",
type: "daterange",
options: [],
startPlaceholder: "收货开始日期",
endPlaceholder: "收货结束日期",
startPlaceholder: "创建开始日期",
endPlaceholder: "创建结束日期",
startDate: "createBeginDate",
endDate: "createEndDate",
label: "收货时间: "
label: "创建日期: "
},
{
prop: "securityNumbers",
placeholder: "请输入编码,型号,名称",
type: "input",
label: "物料: "
},
{
prop: "lotNumbers",
placeholder: "请选择供应商",
placeholder: "请选择发货状态",
type: "select",
isArray: true,
label: "供应商: ",
options: []
},
{
prop: "materialNumber",
placeholder: "请输入物料编码",
type: "selectRemote1",
isArray: true,
options: [],
label: "物料编码: "
},
{
prop: "lotNumbers",
placeholder: "请选择收货状态",
type: "select",
isArray: true,
label: "收货状态: ",
label: "发货状态: ",
options: []
},
{
@@ -78,30 +64,50 @@ export const FORM_DATA: FormItem[] = [
placeholder: "请选择组织",
type: "select",
isArray: true,
label: "组织: "
label: "组织: ",
options: []
},
{
prop: "securityNumbers",
placeholder: "请输入收货",
placeholder: "请输入收货客户",
type: "input",
isArray: true,
label: "收货人: "
label: "收货客户: "
},
{
prop: "securityNumbers",
placeholder: "请输入箱号",
type: "input",
type: "inputBtn",
isArray: true,
label: "箱号: "
},
{
prop: "securityNumbers",
placeholder: "请输入序列号",
type: "input",
type: "inputBtn",
isArray: true,
label: "序列号: "
},
{
prop: "securityNumbers",
placeholder: "请输入调入仓库",
type: "input",
label: "调入仓库: "
},
{
prop: "securityNumbers",
placeholder: "请输入单号",
type: "inputBtn",
label: "单号: ",
isArray: true
},
{
prop: "lotNumbers",
placeholder: "请选择组织",
type: "select",
isArray: true,
label: "拣货类型: ",
options: []
}
];

View File

@@ -1,4 +1,4 @@
<!-- 质检 -->
<!-- 发货 -->
<template>
<div class="table-box">
<div style="padding-bottom: 16px">
@@ -9,7 +9,7 @@
</div>
<ProTable
ref="proTable"
ref="proTableRef"
:formData="dataStore.formData"
:columns="dataStore.columns"
:request-api="getMaterialListApi"
@@ -22,6 +22,14 @@
{{ scope.row.boxBillNo }}
</a>
</template>
<template v-slot:search>
<SearchForm
@search="handleSearch"
@reset="handleReset"
:searchParams="dataStore.initParam"
:formData="dataStore.formData"
/>
</template>
</ProTable>
</div>
</template>
@@ -32,21 +40,19 @@ import ProTable from "@/components/ProTable/index.vue";
// import { useMsg } from "@/hooks/useMsg";
import PermissionButton from "@/components/PermissionButton/index.vue";
import { getMaterialListApi } from "@/api/modules/foundationMaterial";
// import { useAuthStore } from "@/stores/modules/auth";
import { useRouter } from "vue-router";
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
//表格TS
import { ProTableInstance } from "@/components/ProTable/interface";
import { useUserStore } from "@/stores/modules/user";
import { btnClick } from "./init";
//深拷贝方法
import { cloneDeep } from "lodash-es";
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
const proTable = ref<ProTableInstance>();
const proTableRef = ref<ProTableInstance>();
const $router = useRouter();
// 获取用户信息(组织id)
const userStore = useUserStore();
// 数据源
const dataStore = reactive<any>({
columns: COLUMNS, //列表配置项
@@ -66,39 +72,27 @@ const selectionChange = (selection: any) => {
const handleButtonClickCallback = (item: any) => {
btnClick[item?.type](item, $router);
};
// // 规格型号
// const remoteMethod1 = async (query: any) => {
// datas.loading = true;
// if (!query) {
// datas.loading = false;
// return;
// }
// let valClone = query.replace(/^\s*|\s*$/g, "");
// if (!valClone.length) {
// datas.loading = false;
// return;
// }
// const result = await getMaterialListApi(valClone);
// if (result.status === 200) {
// const { data } = result;
// datas.options = data;
// }
// datas.loading = false;
// };
const handleOpen = (row: any) => {
console.log(row);
};
watch(
() => userStore.orgCode,
newVal => {
dataStore.ruleForm.orgCode = newVal;
dataStore.initParam.orgCode = newVal;
},
{
immediate: true,
deep: true
}
);
// 搜索
const handleSearch = async (params: any) => {
dataStore.initParam = cloneDeep(params);
//这里需要等到表格刷新以后才去请求
nextTick(() => {
proTableRef?.value!.getTableList();
});
};
// 重置
const handleReset = () => {
dataStore.initParam = cloneDeep(RULE_FORM);
//这里需要等到表格刷新以后才去请求
nextTick(() => {
proTableRef?.value!.getTableList();
});
};
</script>
<style scope lang="scss">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long