Compare commits
8 Commits
d0d6853806
...
dev-V01.00
| Author | SHA1 | Date | |
|---|---|---|---|
| 17625a1cff | |||
| b0e729f9c0 | |||
| caf79bae5a | |||
| cad97ac4fd | |||
| 1e80affb50 | |||
| 107bd1a933 | |||
| 1208835216 | |||
| da31b2d347 |
@@ -1,25 +0,0 @@
|
||||
import http from "@/api";
|
||||
import { ResPage } from "@/api/interface/index";
|
||||
/**
|
||||
* @name 防伪码模块
|
||||
*/
|
||||
//防伪码记录列表
|
||||
export const getListApi = (params: Record<string, any>) => {
|
||||
return http.post<ResPage<any>>(`SecurityNumber/GetGenerateRecordList`, params);
|
||||
};
|
||||
//生成防伪码
|
||||
export const getGenerateSecurityNumberApi = (params: Record<string, any>) => {
|
||||
return http.post<ResPage<any>>(`SecurityNumber/Generate`, params);
|
||||
};
|
||||
//防伪码下载列表 getDownListApi
|
||||
export const getDownListApi = (params: Record<string, any>) => {
|
||||
return http.post<ResPage<any>>(`SecurityNumber/GetList`, params);
|
||||
};
|
||||
//下载
|
||||
export const getDownAllApi = (params: Record<string, any>) => {
|
||||
return http.post<ResPage<any>>(`SecurityNumber/Export`, params);
|
||||
};
|
||||
//选择下载
|
||||
export const getDownApi = (params: Record<string, any>) => {
|
||||
return http.post<ResPage<any>>(`SecurityNumber/Export`, params);
|
||||
};
|
||||
@@ -1,110 +0,0 @@
|
||||
import http from "@/api";
|
||||
import { ResPage } from "@/api/interface/index";
|
||||
/**
|
||||
* @name 打印产品条码模块
|
||||
*/
|
||||
//产品条码生成记录列表
|
||||
export const getListApi = (params: Record<string, any>) => {
|
||||
// console.log(params);
|
||||
// return {
|
||||
// isSuccess: true,
|
||||
// message: "Success",
|
||||
// status: 200,
|
||||
// totalCount: 1,
|
||||
// data: [
|
||||
// {
|
||||
// id: 17372,
|
||||
// specifications: "ORICO-H7013-U3-AD-EU-BK-BP",
|
||||
// materialNumber: "G01-43-552867",
|
||||
// materialName: "7口USB3.0集线器",
|
||||
// barCode: "6936761881968",
|
||||
// purchaseBillNo: "ceshi1224",
|
||||
// generateComplete: "已完成",
|
||||
// number: 300,
|
||||
// printNumber: 0,
|
||||
// downLoadNumber: 300,
|
||||
// useNumber: 2,
|
||||
// creator: "admin",
|
||||
// createTime: "2024-12-24 10:27:04",
|
||||
// generateCompleteTime: "2024-12-24 10:27:05",
|
||||
// supplierOrOrg: "深圳市元创时代科技有限公司",
|
||||
// isUpdateMaterial: false,
|
||||
// isTwo: 2
|
||||
// }
|
||||
// ]
|
||||
// };
|
||||
return http.post<ResPage<any>>(`SerialNumber/GetGenerateRecordList`, params);
|
||||
};
|
||||
//产品条码列表
|
||||
export const getCodeListApi = (params: Record<string, any>) => {
|
||||
// console.log(params);
|
||||
// return {
|
||||
// totalCount: 300,
|
||||
// data: [
|
||||
// {
|
||||
// materialNumber: "G01-43-552867",
|
||||
// materialName: "7口USB3.0集线器",
|
||||
// specifications: "ORICO-H7013-U3-AD-EU-BK-BP",
|
||||
// old_Specifications: "",
|
||||
// barCode: "6936761881968",
|
||||
// serialNumber: "10FC-616M3R",
|
||||
// twoSerialNumber: "10FC-616M3R-two",
|
||||
// numberCode: "241224000417",
|
||||
// id: 202593401,
|
||||
// number: 300,
|
||||
// isUse: false,
|
||||
// isUseStr: "否",
|
||||
// box: "",
|
||||
// creator: "admin",
|
||||
// createTime: "2024-12-24 10:27:05",
|
||||
// printNumber: 0,
|
||||
// downLoadNumber: 1,
|
||||
// printTime: "",
|
||||
// downLoadTime: "2025-01-08 16:11:39",
|
||||
// isEnablePrint: true
|
||||
// },
|
||||
// {
|
||||
// materialNumber: "G01-43-552867",
|
||||
// materialName: "7口USB3.0集线器",
|
||||
// specifications: "ORICO-H7013-U3-AD-EU-BK-BP",
|
||||
// old_Specifications: "",
|
||||
// barCode: "6936761881968",
|
||||
// serialNumber: "10FC-616M3Q",
|
||||
// twoSerialNumber: "10FC-616M3R-two",
|
||||
// numberCode: "241224000416",
|
||||
// id: 202593400,
|
||||
// number: 300,
|
||||
// isUse: false,
|
||||
// isUseStr: "否",
|
||||
// box: "",
|
||||
// creator: "admin",
|
||||
// createTime: "2024-12-24 10:27:05",
|
||||
// printNumber: 0,
|
||||
// downLoadNumber: 1,
|
||||
// printTime: "",
|
||||
// downLoadTime: "2025-01-08 16:11:39",
|
||||
// isEnablePrint: true
|
||||
// }
|
||||
// ],
|
||||
// isSuccess: true,
|
||||
// status: 200,
|
||||
// message: "Success"
|
||||
// };
|
||||
return http.post<ResPage<any>>(`SerialNumber/GetList`, params);
|
||||
};
|
||||
//转换规格型号 SerialNumber/UpdateMaterial
|
||||
export const getUpdateMaterialApi = (params: Record<string, any>) => {
|
||||
return http.post<ResPage<any>>(`SerialNumber/UpdateMaterial`, params);
|
||||
};
|
||||
//产品条码列表下载
|
||||
export const getSerialNumberDownLoadApi = (params: Record<string, any>) => {
|
||||
return http.post<ResPage<any>>(`SerialNumber/Export`, params);
|
||||
};
|
||||
//生成条码
|
||||
export const generateBarCodeApi = (params: Record<string, any>) => {
|
||||
return http.post<ResPage<any>>(`SerialNumber/Generate`, params);
|
||||
};
|
||||
//打印
|
||||
export const getPrintListCodeApi = (params: Record<string, any>) => {
|
||||
return http.post<ResPage<any>>(`SerialNumber/Print`, params);
|
||||
};
|
||||
@@ -1,48 +0,0 @@
|
||||
import http from "@/api";
|
||||
import { ResPage } from "@/api/interface/index";
|
||||
//箱信息列表
|
||||
export const getListApi = (params: any) => {
|
||||
return http.post<ResPage<any>>(`Box/GetList`, params);
|
||||
};
|
||||
//生成箱碼
|
||||
export const getBoxGenerateApi = (params: any) => {
|
||||
return http.post<ResPage<any>>(`Box/Generate`, params);
|
||||
};
|
||||
//裝箱保存
|
||||
export const getSaveBoxApi = (params: any) => {
|
||||
return http.post<ResPage<any>>(`Box/Save`, params, { noLoading: false });
|
||||
};
|
||||
//打印
|
||||
export const getPrintBoxApi = (params: any) => {
|
||||
return http.post<ResPage<any>>(`Box/Print`, params);
|
||||
};
|
||||
//刪除 /
|
||||
export const getDeleteBoxApi = (params: any) => {
|
||||
return http.post<ResPage<any>>(`Box/Delete`, params);
|
||||
};
|
||||
//清空
|
||||
export const getClearBoxApi = (params: any) => {
|
||||
return http.get<ResPage<any>>(`Box/Clear`, params);
|
||||
};
|
||||
//根据箱号获取箱信息
|
||||
export const getBoxByNoApi = (params: any) => {
|
||||
return http.get<ResPage<any>>(`Box/GetBoxByNo`, params, {
|
||||
noLoading: true
|
||||
});
|
||||
};
|
||||
//根据序列号获取序列号信息
|
||||
export const getSerialNumberApi = (params: any) => {
|
||||
return http.get<ResPage<any>>(`SerialNumber/Get`, params);
|
||||
};
|
||||
//根据箱号去获取序列号
|
||||
export const getSerialNumberByBoxIdApi = (params: any) => {
|
||||
return http.post<ResPage<any>>(`SerialNumber/GetByBoxId`, params, { noLoading: true });
|
||||
};
|
||||
//重新装箱
|
||||
export const getBoxRestartApi = (params: any) => {
|
||||
return http.post<ResPage<any>>(`Box/Restart`, params);
|
||||
};
|
||||
//开始装箱时间接口 Box/BeginCarton
|
||||
export const getBeginCartonApi = (params: any) => {
|
||||
return http.get<ResPage<any>>(`Box/BeginCarton`, params);
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
//箱唛
|
||||
import http from "@/api";
|
||||
import { ResPage } from "@/api/interface/index";
|
||||
|
||||
//箱唛列表
|
||||
export const getBoxMarkListApi = (params: Record<string, any>) => {
|
||||
return http.post<ResPage<any>>(`BoxMark/GetList`, params);
|
||||
};
|
||||
//生成箱唛
|
||||
export const getMaterialListApi = (params: any) => {
|
||||
console.log(params);
|
||||
// return http.get<any>(`SysConfig/GetMaterialList?speci=${encodeURIComponent(speci)}`);
|
||||
return [];
|
||||
};
|
||||
@@ -1,6 +1,10 @@
|
||||
import http from "@/api";
|
||||
// 导出列表
|
||||
export const getListApi = (params: Record<string, any>) => {
|
||||
if (params?.status === "正在导出") {
|
||||
params.status = 0;
|
||||
}
|
||||
|
||||
return http.get<any>(`exports`, params);
|
||||
};
|
||||
//状态
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
26
src/api/modules/setGoods.ts
Normal file
26
src/api/modules/setGoods.ts
Normal 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);
|
||||
};
|
||||
23
src/api/modules/setWarehouse.ts
Normal file
23
src/api/modules/setWarehouse.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import http from "@/api";
|
||||
|
||||
//列表
|
||||
export const getSetWarehouseListApi = (params: any) => {
|
||||
return http.get<any>(`warehouse/relationship`, params);
|
||||
};
|
||||
|
||||
//删除
|
||||
export const getWarehouseDelApi = (params: any) => {
|
||||
return http.delete<any>(`warehouse/relationship/${params}`);
|
||||
};
|
||||
//新增 /admapi/warehouse/relationship
|
||||
export const getWarehouseAddApi = (params: any) => {
|
||||
return http.post<any>(`warehouse/relationship`, params);
|
||||
};
|
||||
//更新
|
||||
export const getWarehouseUpApi = (id: any, params: any) => {
|
||||
return http.post<any>(`warehouse/relationship/${id}`, params);
|
||||
};
|
||||
//详情
|
||||
export const getWarehouseDetailsApi = (id: any) => {
|
||||
return http.get<any>(`warehouse/relationship/${id}`);
|
||||
};
|
||||
30
src/api/modules/shop.ts
Normal file
30
src/api/modules/shop.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import http from "@/api";
|
||||
|
||||
//店鋪資料列表
|
||||
export const getShopListApi = (params: any) => {
|
||||
return http.get<any>(`store`, params);
|
||||
};
|
||||
//獲取接入系統列表數據
|
||||
export const getShopAccessSystemApi = () => {
|
||||
return http.get<any>(`store/access_system`);
|
||||
};
|
||||
//删除
|
||||
export const getShopDelApi = (params: any) => {
|
||||
return http.delete<any>(`store/${params}`);
|
||||
};
|
||||
//新增
|
||||
export const getShopAddApi = (params: any) => {
|
||||
return http.post<any>(`store`, params);
|
||||
};
|
||||
//更新
|
||||
export const getShopUpApi = (id: any, params: any) => {
|
||||
return http.post<any>(`store/${id}`, params);
|
||||
};
|
||||
//详情
|
||||
export const getShopDetailsApi = (id: any) => {
|
||||
return http.get<any>(`store/${id}`);
|
||||
};
|
||||
//导出
|
||||
export const getShopListExportApi = (params: any) => {
|
||||
return http.get<any>(`store/export`, params);
|
||||
};
|
||||
@@ -67,16 +67,33 @@
|
||||
:placeholder="item.placeholder"
|
||||
clearable
|
||||
:disabled="item.disabled"
|
||||
@change="handleSelectChange(item)"
|
||||
>
|
||||
<el-option
|
||||
v-for="options in item.options"
|
||||
:label="options.label"
|
||||
:value="options.value"
|
||||
:key="options.label"
|
||||
v-for="option in item.options"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
:key="option.label"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
<!-- 多选不带输入 -->
|
||||
<template v-if="item.type === 'selectMultiples'">
|
||||
<el-select
|
||||
v-model="_searchResult[`${item.prop}`]"
|
||||
:placeholder="item.placeholder"
|
||||
multiple
|
||||
:disabled="item.disabled"
|
||||
style="max-height: 150px; overflow-y: auto"
|
||||
>
|
||||
<el-option
|
||||
v-for="option in item.options"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
:key="option.label"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<template v-if="item.type === 'date'">
|
||||
<el-date-picker
|
||||
:disabled="item.disabled"
|
||||
@@ -137,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"
|
||||
@@ -185,6 +222,8 @@ const props = defineProps<{
|
||||
selectMultipleRemoveTag?: () => void;
|
||||
selectMultipleRemoteTag1?: () => void;
|
||||
setRuleFormValue?: () => void;
|
||||
selectMultipleDClear?: () => void;
|
||||
selectChange?: () => void;
|
||||
}>();
|
||||
|
||||
let _searchResult = computed(() => {
|
||||
@@ -197,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 });
|
||||
};
|
||||
@@ -207,6 +250,7 @@ const handleTagRemove1 = (item: any) => {
|
||||
item.options = [];
|
||||
}
|
||||
};
|
||||
|
||||
//客戶
|
||||
const getCustomers = async (keywords: any, item: any) => {
|
||||
let org_number = _searchResult.value.org_number.join(",");
|
||||
@@ -270,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) {
|
||||
|
||||
@@ -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
|
||||
@@ -177,7 +183,15 @@
|
||||
</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";
|
||||
// // getWarehousesKingdeeListApi getSubwarehouseskingdeeListApi getWarehousesJushuitanListApi getWarehousesLingXingListApi
|
||||
// import { getWarehousesKingdeeListApi, getSubwarehouseskingdeeListApi } from "@/api/modules/setWarehouse";
|
||||
const props = defineProps<{
|
||||
formData: any[];
|
||||
searchParams: Record<string, any>;
|
||||
@@ -192,7 +206,7 @@ const emits = defineEmits<{
|
||||
|
||||
let loading = ref(false);
|
||||
const remoteRef = ref(null);
|
||||
const _searchParams = computed(() => {
|
||||
const _searchParams: any = computed(() => {
|
||||
return props.searchParams;
|
||||
});
|
||||
|
||||
@@ -259,10 +273,59 @@ const getProductLines = async (keywords: any, item: any) => {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//金蝶仓库
|
||||
const getSetWarehouseKingdeeList = async (keywords: any, item: any) => {
|
||||
const useOrgNumber: any[] = _searchParams?.value?.use_org_number;
|
||||
if (Array.isArray(useOrgNumber) && useOrgNumber?.length > 0) {
|
||||
item.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,
|
||||
use_org_number: it.use_org_number
|
||||
});
|
||||
});
|
||||
item.options = options;
|
||||
}
|
||||
}
|
||||
};
|
||||
//获取金蝶子仓库
|
||||
const getSetWarehouseSubwarehousesList = async (keywords: any, item: any) => {
|
||||
const kdWarehouseNumber: any[] = _searchParams?.value?.kd_warehouse_number;
|
||||
if (Array.isArray(kdWarehouseNumber) && kdWarehouseNumber?.length > 0) {
|
||||
//先清空一下
|
||||
item.options = [];
|
||||
let kd_warehouse_number = "";
|
||||
kd_warehouse_number = _searchParams.value.kd_warehouse_number.join(",");
|
||||
const result = await getSubwarehouseskingdeeListApi({
|
||||
keywords,
|
||||
warehouse_number: kd_warehouse_number
|
||||
});
|
||||
if (result?.code === 0) {
|
||||
let options: any = [];
|
||||
result?.data?.forEach((it: any) => {
|
||||
options.push({
|
||||
label: it.sub_warehouse_name,
|
||||
value: it.sub_warehouse_number,
|
||||
warehouse_number: it.warehouse_number
|
||||
});
|
||||
});
|
||||
item.options = options;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//多选远程搜索
|
||||
const handleSelectMultipleRemote = async (query: any, item: any) => {
|
||||
console.log(remoteRef.value, "==========remoteRef=========");
|
||||
|
||||
loading.value = true;
|
||||
if (!query) {
|
||||
loading.value = false;
|
||||
@@ -281,8 +344,11 @@ const handleSelectMultipleRemote = async (query: any, item: any) => {
|
||||
getCustomers(valClone, item);
|
||||
} else if (item.type === "selectProductLinesRemote") {
|
||||
//品线
|
||||
|
||||
getProductLines(valClone, item);
|
||||
} else if (item.type === "selectRemoteKD") {
|
||||
getSetWarehouseKingdeeList(valClone, item);
|
||||
} else if (item.type === "selectRemoteKDSubwarehouse") {
|
||||
getSetWarehouseSubwarehousesList(valClone, item);
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
@@ -290,9 +356,15 @@ 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) => {
|
||||
|
||||
@@ -63,14 +63,22 @@ 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) {
|
||||
state.totalParam.kd_warehouse_number = state.totalParam.kd_warehouse_number.join(",");
|
||||
}
|
||||
//金蝶子仓库
|
||||
if (Array.isArray(state.totalParam?.kd_subwarehouse_number) && state.totalParam?.kd_subwarehouse_number?.length) {
|
||||
state.totalParam.kd_subwarehouse_number = state.totalParam.kd_subwarehouse_number.join(",");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// //其他數據處理
|
||||
// const initData = () => {
|
||||
// if (state.totalParam?.warehouse_number) {
|
||||
// state.totalParam.warehouse_number = state.totalParam?.warehouse_number.split("_")[0];
|
||||
// }
|
||||
// };
|
||||
//删除临时参数和空值参数
|
||||
const deleteParams = () => {
|
||||
const KEY = ["Time", "customer_number1", "customer_numbers"];
|
||||
@@ -86,7 +94,6 @@ export const useTable = (
|
||||
*/
|
||||
const getTableList = async () => {
|
||||
if (!api) return;
|
||||
|
||||
try {
|
||||
await initSubscribeData();
|
||||
await deleteParams();
|
||||
@@ -95,9 +102,7 @@ export const useTable = (
|
||||
...state.totalParam,
|
||||
...pageParam.value
|
||||
};
|
||||
|
||||
const { data } = await api(params);
|
||||
|
||||
state.tableData = Array.isArray(data.data) && data.data.length ? data.data : [];
|
||||
clearSelection && clearSelection();
|
||||
if (isPageable && data.total_size !== undefined) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -268,3 +268,6 @@
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.el-message {
|
||||
z-index: 888;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export const FORM_DATA: any[] = [
|
||||
label: "导出失败"
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
value: "正在导出",
|
||||
label: "正在导出"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2,13 +2,20 @@
|
||||
<template>
|
||||
<div class="table-box">
|
||||
<ProTable
|
||||
ref="proTable"
|
||||
ref="proTableRef"
|
||||
:formData="dataStore.formData"
|
||||
:columns="dataStore.columns"
|
||||
:request-api="getListApi"
|
||||
:init-param="dataStore.initParam"
|
||||
:orgCode="dataStore.ruleForm.orgCode"
|
||||
>
|
||||
<template v-slot:search>
|
||||
<SearchForm
|
||||
@search="handleSearch"
|
||||
@reset="handleReset"
|
||||
:searchParams="dataStore.initParam"
|
||||
:formData="dataStore.formData"
|
||||
/>
|
||||
</template>
|
||||
<!-- 导出状态 -->
|
||||
<template #status_text="scope">
|
||||
<span v-if="scope.row.status_text === '导出成功'" style="color: #3ad6ac">
|
||||
@@ -47,7 +54,7 @@ import { getListApi, getExportTypesApi } from "@/api/modules/exportList";
|
||||
import { RULE_FORM, FORM_DATA, COLUMNS } from "./constant/list/index";
|
||||
import { cloneDeep } from "lodash-es";
|
||||
|
||||
const proTable = ref<any>();
|
||||
const proTableRef = ref<any>();
|
||||
// 数据源
|
||||
const dataStore: any = reactive({
|
||||
columns: COLUMNS, //列表配置项
|
||||
@@ -74,6 +81,24 @@ const getExportTypes = async () => {
|
||||
}
|
||||
};
|
||||
getExportTypes();
|
||||
|
||||
// 搜索
|
||||
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">
|
||||
.main-container {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
:labelWidth="dataStore.labelWidth"
|
||||
:inline="true"
|
||||
ref="detailsRef"
|
||||
@selectChange="handleChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -24,17 +25,140 @@ 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),
|
||||
id: null,
|
||||
title: ""
|
||||
});
|
||||
// 详情表单实例
|
||||
const detailsRef = ref(null);
|
||||
console.log(dataStore.buttons, "======================");
|
||||
const handleButtonClickCallback = () => {};
|
||||
|
||||
//初始化组织数据
|
||||
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");
|
||||
}
|
||||
};
|
||||
//详情
|
||||
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;
|
||||
}
|
||||
};
|
||||
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 = (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) {
|
||||
useMsg("warning", "请先保存数据 !");
|
||||
}
|
||||
$router.push({
|
||||
path: "/foundation/set/goods/preview",
|
||||
query: { id: dataStore.id, name: dataStore.title }
|
||||
});
|
||||
}
|
||||
if (type === "return") {
|
||||
$router.push({
|
||||
path: "/foundation/set/goods/index"
|
||||
});
|
||||
}
|
||||
};
|
||||
//仓库列表 /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;
|
||||
}
|
||||
}
|
||||
};
|
||||
const handleChange = (item: any) => {
|
||||
console.log(item);
|
||||
getGoodsCheckExistsw();
|
||||
};
|
||||
//监听当前组织
|
||||
watch(
|
||||
() => dataStore.ruleForm.use_org_number,
|
||||
(newVal: any) => {
|
||||
if (newVal) {
|
||||
getWarehousesList();
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
@@ -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,13 +18,16 @@ export const DETAILS_FORM_DATA: any[] = [
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "pos_picking_priority",
|
||||
placeholder: "请输入",
|
||||
type: "textarea",
|
||||
label: "仓位:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1",
|
||||
maxLength: 5000
|
||||
}
|
||||
];
|
||||
export const DETAILS_RULE_FORM: any = {};
|
||||
export const DETAILS_RULE_FORM: any = {
|
||||
use_org_number: "101"
|
||||
};
|
||||
|
||||
@@ -11,5 +11,10 @@ export const BUTTON = [
|
||||
text: "预览(请先保存)",
|
||||
permission: "foundationSetGoodsAddBtnPreview",
|
||||
type: "preview"
|
||||
},
|
||||
{
|
||||
text: "返回",
|
||||
permission: "foundationSetGoodsAddBtnRreturn",
|
||||
type: "return"
|
||||
}
|
||||
];
|
||||
|
||||
@@ -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: []
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
];
|
||||
|
||||
@@ -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,14 +36,16 @@
|
||||
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";
|
||||
|
||||
//表格TS
|
||||
// 表格TS
|
||||
import { ProTableInstance } from "@/components/ProTable/interface";
|
||||
|
||||
//深拷贝方法
|
||||
// 深拷贝方法
|
||||
import { cloneDeep } from "lodash-es";
|
||||
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||
const proTableRef = ref<ProTableInstance>();
|
||||
@@ -53,19 +60,31 @@ 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;
|
||||
};
|
||||
|
||||
//顶部按钮点击事件
|
||||
// 顶部按钮点击事件
|
||||
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);
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
@@ -73,7 +92,8 @@ const handleSearch = async (params: any) => {
|
||||
proTableRef?.value!.getTableList();
|
||||
});
|
||||
};
|
||||
//重置
|
||||
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
@@ -81,6 +101,13 @@ const handleReset = () => {
|
||||
proTableRef?.value!.getTableList();
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
$Bus.on("setGoodsResetList", () => {
|
||||
nextTick(() => {
|
||||
proTableRef?.value!.getTableList();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scope lang="scss">
|
||||
|
||||
47
src/views/foundation/set/goods/preview.vue
Normal file
47
src/views/foundation/set/goods/preview.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<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 = () => {
|
||||
$router.push({
|
||||
path: "/foundation/set/goods/add",
|
||||
query: { id: route.query.id, title: route.query.name }
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -66,7 +66,6 @@ const selectionChange = (selection: any) => {
|
||||
};
|
||||
const handleButtonClickCallback = (item: any) => {
|
||||
const { type } = item;
|
||||
|
||||
btnClick[type]({
|
||||
selectionList: dataStore.selectionList,
|
||||
proTableRef,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export const DETAILS_FORM_DATA: any[] = [
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "platform_name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "平台:",
|
||||
@@ -9,7 +9,7 @@ export const DETAILS_FORM_DATA: any[] = [
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "platform_store_name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "平台店铺名称:",
|
||||
@@ -18,16 +18,17 @@ export const DETAILS_FORM_DATA: any[] = [
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
placeholder: "请输入",
|
||||
prop: "access_system",
|
||||
placeholder: "请选择",
|
||||
type: "select",
|
||||
label: "订单接入系统:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
options: [],
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "kingdee_store_name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "金蝶店铺名称:",
|
||||
@@ -36,7 +37,7 @@ export const DETAILS_FORM_DATA: any[] = [
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "kingdee_store_number",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "金蝶店铺编码:",
|
||||
@@ -45,4 +46,128 @@ export const DETAILS_FORM_DATA: any[] = [
|
||||
class: "form-item1"
|
||||
}
|
||||
];
|
||||
|
||||
export const DETAILS_FORM_DATA1: any[] = [
|
||||
{
|
||||
prop: "platform_name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "平台:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "platform_store_name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "平台店铺名称:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "access_system",
|
||||
placeholder: "请输入",
|
||||
type: "select",
|
||||
label: "订单接入系统:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
options: [],
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "kingdee_store_name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "金蝶店铺名称:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "kingdee_store_number",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "金蝶店铺编码:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "jushuitan_store_name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "聚水潭店铺名称:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
}
|
||||
];
|
||||
export const DETAILS_FORM_DATA2: any[] = [
|
||||
{
|
||||
prop: "platform_name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "平台:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "platform_store_name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "平台店铺名称:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "access_system",
|
||||
placeholder: "请输入",
|
||||
type: "select",
|
||||
label: "订单接入系统:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
options: [],
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "kingdee_store_name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "金蝶店铺名称:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "kingdee_store_number",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "金蝶店铺编码:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "lingxing_store_name",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "领星店铺名称:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
},
|
||||
{
|
||||
prop: "lingxing_store_number",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "领星店铺SellerID:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
}
|
||||
];
|
||||
export const DETAILS_RULE_FORM: any = {};
|
||||
|
||||
@@ -17,37 +17,37 @@ interface FormItem {
|
||||
}
|
||||
export const FORM_DATA: FormItem[] = [
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "platform_name",
|
||||
placeholder: "请输入平台",
|
||||
type: "input",
|
||||
label: "平台: "
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "platform_store_name",
|
||||
placeholder: "请输入平台店铺名称",
|
||||
type: "input",
|
||||
label: "平台店铺名称: "
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "kingdee_store_name",
|
||||
placeholder: "请输入金蝶店铺名称",
|
||||
type: "input",
|
||||
label: "金蝶店铺名称: "
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "jushuitan_store_name",
|
||||
placeholder: "请输入聚水潭店铺名称",
|
||||
type: "input",
|
||||
label: "聚水潭店铺名称: "
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "lingxing_store_name",
|
||||
placeholder: "请输入领星店铺名称",
|
||||
type: "input",
|
||||
label: "领星店铺名称: "
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "operator_name",
|
||||
placeholder: "请输入更新人",
|
||||
type: "input",
|
||||
label: "更新人: "
|
||||
@@ -58,7 +58,7 @@ export const FORM_DATA: FormItem[] = [
|
||||
options: [],
|
||||
startPlaceholder: "更新开始日期",
|
||||
endPlaceholder: "更新结束日期",
|
||||
startDate: "updated_at",
|
||||
startDate: "update_time",
|
||||
// endDate: "createEndDate",
|
||||
label: "更新时间: "
|
||||
}
|
||||
|
||||
@@ -5,53 +5,55 @@ export const COLUMNS = [
|
||||
align: "left",
|
||||
fixed: true,
|
||||
label: "平台店铺名称",
|
||||
prop: "material_number",
|
||||
prop: "platform_store_name",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "平台",
|
||||
prop: "sku",
|
||||
fixed: true,
|
||||
width: 200
|
||||
prop: "platform_name",
|
||||
fixed: true
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "订单接入系统",
|
||||
prop: "material_name",
|
||||
width: 200
|
||||
prop: "access_system_name"
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "聚水潭店铺名称",
|
||||
prop: "jushuitan_store_name"
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "领星店铺名称",
|
||||
prop: "org_name",
|
||||
width: 200
|
||||
prop: "lingxing_store_name"
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "领星店铺SellerID",
|
||||
prop: "product_line"
|
||||
prop: "lingxing_store_number"
|
||||
},
|
||||
|
||||
{
|
||||
align: "left",
|
||||
label: "金蝶店铺名称",
|
||||
prop: "bar_code"
|
||||
prop: "kingdee_store_name"
|
||||
},
|
||||
|
||||
{
|
||||
align: "left",
|
||||
label: "金蝶店铺编码",
|
||||
prop: "fnsku"
|
||||
prop: "kingdee_store_number"
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "更新人",
|
||||
prop: "category_lv1"
|
||||
prop: "operator"
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "更新时间",
|
||||
prop: "category_lv2"
|
||||
prop: "updated_at"
|
||||
}
|
||||
];
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
@handleButtonClickCallback="handleButtonClickCallback"
|
||||
></PermissionButton>
|
||||
</div>
|
||||
<el-dialog v-model="dataStore.dialogVisible" width="660" :before-close="handleClose" title="新增店铺">
|
||||
<el-dialog v-model="dataStore.dialogVisible" width="660" :before-close="handleClose" :title="dataStore.title">
|
||||
<DetailsSearch
|
||||
:formData="dataStore.detailsFormData"
|
||||
:ruleForm="dataStore.detailsRuleForm"
|
||||
@@ -26,7 +26,7 @@
|
||||
<ProTable
|
||||
ref="proTableRef"
|
||||
:columns="dataStore.columns"
|
||||
:request-api="getMaterialListApi"
|
||||
:request-api="getShopListApi"
|
||||
:init-param="dataStore.initParam"
|
||||
@selectionChange="selectionChange"
|
||||
>
|
||||
@@ -38,6 +38,11 @@
|
||||
:formData="dataStore.formData"
|
||||
/>
|
||||
</template>
|
||||
<template #platform_store_name="scope">
|
||||
<a @click="handleOpen(scope.row)" class="break-word to-details">
|
||||
{{ scope.row.platform_store_name }}
|
||||
</a>
|
||||
</template>
|
||||
</ProTable>
|
||||
</div>
|
||||
</template>
|
||||
@@ -46,14 +51,22 @@
|
||||
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 {
|
||||
getShopListApi,
|
||||
getShopDelApi,
|
||||
getShopAccessSystemApi,
|
||||
getShopAddApi,
|
||||
getShopUpApi,
|
||||
getShopDetailsApi,
|
||||
getShopListExportApi
|
||||
} from "@/api/modules/shop";
|
||||
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";
|
||||
//表格TS
|
||||
import { DETAILS_RULE_FORM, DETAILS_FORM_DATA, DETAILS_FORM_DATA1, DETAILS_FORM_DATA2 } from "./constant/list/details";
|
||||
// 表格TS
|
||||
import { ProTableInstance } from "@/components/ProTable/interface";
|
||||
|
||||
//深拷贝方法
|
||||
// 深拷贝方法
|
||||
import { cloneDeep } from "lodash-es";
|
||||
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||
const proTableRef = ref<ProTableInstance>();
|
||||
@@ -62,23 +75,23 @@ const detailsRef = ref<any>(null);
|
||||
const dataStore = reactive<any>({
|
||||
columns: COLUMNS, //列表配置项
|
||||
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
||||
formData: FORM_DATA, //搜索配置项
|
||||
formData: FORM_DATA, // 搜索配置项
|
||||
buttons: cloneDeep(BUTTON),
|
||||
options: [], //规格型号
|
||||
labelWidth: "120px",
|
||||
title: "新增店铺",
|
||||
detailsFormData: cloneDeep(DETAILS_FORM_DATA),
|
||||
detailsRuleForm: cloneDeep(DETAILS_RULE_FORM),
|
||||
dialogVisible: false, //弹窗
|
||||
selectionList: [] //选中表格的行
|
||||
dialogVisible: false, // 弹窗
|
||||
accessSystemOptions: [], // 接入系統列表
|
||||
selectionList: [] // 列表选中数据
|
||||
});
|
||||
|
||||
// 表格选择事件
|
||||
const selectionChange = (selection: any) => {
|
||||
dataStore.selectionList = selection;
|
||||
};
|
||||
//删除
|
||||
// 删除
|
||||
const handleDel = () => {
|
||||
console.log();
|
||||
if (!dataStore.selectionList.length) {
|
||||
useMsg("warning", "请选择数据 !");
|
||||
return;
|
||||
@@ -93,24 +106,78 @@ const handleDel = () => {
|
||||
dataStore.selectionList?.forEach((item: any) => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
console.log(ids, "==========");
|
||||
// const result = await getSubscribeDelApi(ids.join(","));
|
||||
// if (result?.code === 0) {
|
||||
// proTable?.value!.getTableList();
|
||||
// useMsg("success", "删除成功 !");
|
||||
// }
|
||||
|
||||
const result = await getShopDelApi(ids.join(","));
|
||||
|
||||
if (result?.code === 0) {
|
||||
proTableRef?.value!.getTableList();
|
||||
useMsg("success", "删除成功 !");
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
};
|
||||
//导出
|
||||
const handleExport = async () => {
|
||||
// const result = await getSubscribeResetListExportApi(dataStore.initParam);
|
||||
// if (result?.code === 0) {
|
||||
// useMsg("success", "导出成功请前往导出列表中进行下载 !");
|
||||
// }
|
||||
// 新增
|
||||
const getShopAdd = async () => {
|
||||
const result = await getShopAddApi(dataStore.detailsRuleForm);
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "新增成功 !");
|
||||
setTimeout(() => {
|
||||
dataStore.dialogVisible = false;
|
||||
proTableRef?.value!.getTableList();
|
||||
}, 600);
|
||||
}
|
||||
};
|
||||
//顶部按钮点击事件
|
||||
// 更新
|
||||
const getShopUp = async () => {
|
||||
const result = await getShopUpApi(dataStore.rowId, dataStore.detailsRuleForm);
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "更新成功 !");
|
||||
setTimeout(() => {
|
||||
dataStore.dialogVisible = false;
|
||||
proTableRef?.value!.getTableList();
|
||||
}, 600);
|
||||
}
|
||||
};
|
||||
// 详情
|
||||
const getShopDetails = async (id: any) => {
|
||||
const result = await getShopDetailsApi(id);
|
||||
if (result?.code === 0) {
|
||||
dataStore.dialogVisible = true;
|
||||
dataStore.title = "编辑店铺";
|
||||
setAccessSystem(result?.data?.access_system);
|
||||
dataStore.detailsRuleForm = result?.data;
|
||||
}
|
||||
};
|
||||
// 表格row点击事件
|
||||
const handleOpen = (row: any) => {
|
||||
dataStore.rowId = row.id;
|
||||
getShopDetails(row.id);
|
||||
};
|
||||
// 獲取接入系統列表數據
|
||||
const getShopAccessSystem = async () => {
|
||||
const result = await getShopAccessSystemApi();
|
||||
if (result?.code === 0) {
|
||||
let data = cloneDeep(result?.data);
|
||||
let options: any = [];
|
||||
|
||||
data?.length &&
|
||||
data.forEach((item: any) => {
|
||||
options.push({ value: item.id, label: item.name, is_default: item.is_default });
|
||||
});
|
||||
dataStore.accessSystemOptions = options;
|
||||
dataStore.detailsFormData[2].options = options;
|
||||
}
|
||||
};
|
||||
getShopAccessSystem();
|
||||
// 导出
|
||||
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") {
|
||||
@@ -120,28 +187,68 @@ const handleButtonClickCallback = (item: any) => {
|
||||
return handleExport();
|
||||
}
|
||||
if (type === "add") {
|
||||
dataStore.title = "新增店铺";
|
||||
dataStore.dialogVisible = true;
|
||||
}
|
||||
};
|
||||
//弹窗取消
|
||||
// 弹窗取消
|
||||
const handleClose = () => {
|
||||
dataStore.detailsRuleForm = cloneDeep(DETAILS_RULE_FORM);
|
||||
detailsRef?.value?.formElement?.resetFields();
|
||||
dataStore.dialogVisible = false;
|
||||
};
|
||||
//弹窗确认
|
||||
|
||||
// 弹窗确认
|
||||
const handleCommit = () => {
|
||||
dataStore.dialogVisible = false;
|
||||
if (!dataStore.detailsRuleForm.platform_name) {
|
||||
useMsg("warning", "平台不能为空 !");
|
||||
return false;
|
||||
}
|
||||
if (!dataStore.detailsRuleForm.platform_store_name) {
|
||||
useMsg("warning", "平台店铺名称不能为空 !");
|
||||
return false;
|
||||
}
|
||||
if (!dataStore.detailsRuleForm.access_system) {
|
||||
useMsg("warning", "订单接入系统不能为空 !");
|
||||
return false;
|
||||
}
|
||||
if (!dataStore.detailsRuleForm.kingdee_store_name) {
|
||||
useMsg("warning", "金蝶店铺名称不能为空 !");
|
||||
return false;
|
||||
}
|
||||
if (!dataStore.detailsRuleForm.kingdee_store_number) {
|
||||
useMsg("warning", "金蝶店铺编码不能为空 !");
|
||||
return false;
|
||||
}
|
||||
if (dataStore.detailsRuleForm.access_system === 2 && !dataStore.detailsRuleForm.jushuitan_store_name) {
|
||||
useMsg("warning", "聚水潭店铺名称不能为空 !");
|
||||
return false;
|
||||
}
|
||||
if (dataStore.detailsRuleForm.access_system === 3 && !dataStore.detailsRuleForm.lingxing_store_name) {
|
||||
useMsg("warning", "领星店铺名称不能为空 !");
|
||||
return false;
|
||||
}
|
||||
if (dataStore.detailsRuleForm.access_system === 3 && !dataStore.detailsRuleForm.lingxing_store_number) {
|
||||
useMsg("warning", "领星店铺SellerID不能为空 !");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dataStore.title === "新增店铺") {
|
||||
getShopAdd();
|
||||
} else {
|
||||
getShopUp();
|
||||
}
|
||||
};
|
||||
//搜索
|
||||
// 搜索
|
||||
const handleSearch = async (params: any) => {
|
||||
console.log(params, "==============>");
|
||||
dataStore.initParam = cloneDeep(params);
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
nextTick(() => {
|
||||
proTableRef?.value!.getTableList();
|
||||
});
|
||||
};
|
||||
//重置
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
@@ -149,6 +256,26 @@ const handleReset = () => {
|
||||
proTableRef?.value!.getTableList();
|
||||
});
|
||||
};
|
||||
// 接入系统切换
|
||||
const setAccessSystem = (val: any) => {
|
||||
if (val === 2) {
|
||||
dataStore.detailsFormData = cloneDeep(DETAILS_FORM_DATA1);
|
||||
dataStore.detailsFormData[2].options = cloneDeep(dataStore.accessSystemOptions);
|
||||
dataStore.detailsRuleForm.lingxing_store_name = "";
|
||||
dataStore.lingxing_store_number = "";
|
||||
}
|
||||
if (val === 3) {
|
||||
dataStore.detailsFormData = cloneDeep(DETAILS_FORM_DATA2);
|
||||
dataStore.detailsFormData[2].options = cloneDeep(dataStore.accessSystemOptions);
|
||||
dataStore.detailsRuleForm.jushuitan_store_name = "";
|
||||
}
|
||||
};
|
||||
watch(
|
||||
() => dataStore.detailsRuleForm.access_system,
|
||||
(newVal: any) => {
|
||||
setAccessSystem(newVal);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scope lang="scss">
|
||||
|
||||
@@ -1,38 +1,63 @@
|
||||
export const DETAILS_FORM_DATA: any[] = [
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "use_org_number",
|
||||
placeholder: "请输入",
|
||||
type: "select",
|
||||
type: "selectMultipleD",
|
||||
label: "组织:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1",
|
||||
options: []
|
||||
},
|
||||
{
|
||||
prop: "kd_warehouse_number",
|
||||
placeholder: "请选择",
|
||||
type: "selectMultipleD",
|
||||
label: "金蝶仓库:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
class: "form-item1",
|
||||
options: []
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
placeholder: "请输入",
|
||||
type: "select",
|
||||
prop: "kd_subwarehouse_number",
|
||||
placeholder: "请选择",
|
||||
type: "selectMultiples",
|
||||
label: "金蝶子仓库:",
|
||||
disabled: false,
|
||||
class: "form-item1"
|
||||
class: "form-item1",
|
||||
options: []
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
placeholder: "请输入",
|
||||
prop: "jst_warehouse_number",
|
||||
placeholder: "请选择",
|
||||
type: "select",
|
||||
label: "对应聚水潭仓库:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1"
|
||||
class: "form-item1",
|
||||
options: []
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
placeholder: "请输入",
|
||||
prop: "lx_warehouse_number",
|
||||
placeholder: "请选择",
|
||||
type: "select",
|
||||
label: "对应领星仓库:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1",
|
||||
options: []
|
||||
},
|
||||
{
|
||||
//textarea
|
||||
|
||||
prop: "remark",
|
||||
placeholder: "请输入",
|
||||
type: "textarea",
|
||||
label: "备注:",
|
||||
disabled: false,
|
||||
maxLength: 5000,
|
||||
class: "form-item1"
|
||||
}
|
||||
];
|
||||
export const DETAILS_RULE_FORM: any = {};
|
||||
export const DETAILS_RULE_FORM: any = {
|
||||
use_org_number: "101"
|
||||
};
|
||||
|
||||
@@ -17,19 +17,29 @@ interface FormItem {
|
||||
}
|
||||
export const FORM_DATA: FormItem[] = [
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "use_org_number",
|
||||
placeholder: "请选择组织",
|
||||
type: "selectMultiple",
|
||||
label: "组织: ",
|
||||
options: []
|
||||
},
|
||||
{
|
||||
prop: "kd_warehouse_number",
|
||||
placeholder: "请输入金蝶仓库",
|
||||
type: "input",
|
||||
label: "金蝶仓库: "
|
||||
type: "selectRemoteKD",
|
||||
label: "金蝶仓库: ",
|
||||
options: []
|
||||
},
|
||||
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "kd_subwarehouse_number",
|
||||
placeholder: "请输入金蝶子仓库",
|
||||
type: "input",
|
||||
label: "金蝶子仓库: "
|
||||
type: "selectRemoteKDSubwarehouse",
|
||||
label: "金蝶子仓库: ",
|
||||
options: []
|
||||
},
|
||||
{
|
||||
prop: "org_number",
|
||||
prop: "operator",
|
||||
placeholder: "请输入更新人",
|
||||
type: "input",
|
||||
label: "更新人: "
|
||||
@@ -41,7 +51,7 @@ export const FORM_DATA: FormItem[] = [
|
||||
options: [],
|
||||
startPlaceholder: "更新开始日期",
|
||||
endPlaceholder: "更新结束日期",
|
||||
startDate: "updated_at",
|
||||
startDate: "update_time",
|
||||
// endDate: "createEndDate",
|
||||
label: "更新时间: "
|
||||
}
|
||||
@@ -49,5 +59,6 @@ export const FORM_DATA: FormItem[] = [
|
||||
|
||||
export const RULE_FORM = {
|
||||
page: 1,
|
||||
size: 50
|
||||
size: 50,
|
||||
use_org_number: ["101"]
|
||||
};
|
||||
|
||||
@@ -1,41 +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_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
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- 仓库关系 -->
|
||||
<!-- 店铺资料 -->
|
||||
<template>
|
||||
<div class="table-box">
|
||||
<div style="padding-bottom: 16px">
|
||||
@@ -7,13 +7,14 @@
|
||||
@handleButtonClickCallback="handleButtonClickCallback"
|
||||
></PermissionButton>
|
||||
</div>
|
||||
<el-dialog v-model="dataStore.dialogVisible" width="660" :before-close="handleClose" title="新增店铺">
|
||||
<el-dialog v-model="dataStore.dialogVisible" width="660" :before-close="handleClose" :title="dataStore.title">
|
||||
<DetailsSearch
|
||||
:formData="dataStore.detailsFormData"
|
||||
:ruleForm="dataStore.detailsRuleForm"
|
||||
:labelWidth="dataStore.labelWidth"
|
||||
:inline="true"
|
||||
:isSearch="true"
|
||||
@selectMultipleDClear="handleSelectMultipleDClear"
|
||||
ref="detailsRef"
|
||||
/>
|
||||
<template #footer>
|
||||
@@ -26,7 +27,7 @@
|
||||
<ProTable
|
||||
ref="proTableRef"
|
||||
:columns="dataStore.columns"
|
||||
:request-api="getMaterialListApi"
|
||||
:request-api="getSetWarehouseListApi"
|
||||
:init-param="dataStore.initParam"
|
||||
@selectionChange="selectionChange"
|
||||
>
|
||||
@@ -36,8 +37,15 @@
|
||||
@reset="handleReset"
|
||||
:searchParams="dataStore.initParam"
|
||||
:formData="dataStore.formData"
|
||||
@selectMultipleRemoveTag="handleSelectMultipleRemoveTag"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template #kd_warehouse_name="scope">
|
||||
<a @click="handleOpen(scope.row)" class="break-word to-details">
|
||||
{{ scope.row.kd_warehouse_name }}
|
||||
</a>
|
||||
</template>
|
||||
</ProTable>
|
||||
</div>
|
||||
</template>
|
||||
@@ -46,14 +54,29 @@
|
||||
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 { useUserStore } from "@/stores/modules/user";
|
||||
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";
|
||||
//表格TS
|
||||
// 表格TS
|
||||
import { ProTableInstance } from "@/components/ProTable/interface";
|
||||
|
||||
//深拷贝方法
|
||||
// 深拷贝方法
|
||||
import { cloneDeep } from "lodash-es";
|
||||
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||
const proTableRef = ref<ProTableInstance>();
|
||||
@@ -62,23 +85,30 @@ const detailsRef = ref<any>(null);
|
||||
const dataStore = reactive<any>({
|
||||
columns: COLUMNS, //列表配置项
|
||||
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
||||
formData: FORM_DATA, //搜索配置项
|
||||
formData: FORM_DATA, // 搜索配置项
|
||||
buttons: cloneDeep(BUTTON),
|
||||
options: [], //规格型号
|
||||
labelWidth: "120px",
|
||||
title: "新增金蝶子仓与各系统仓库关系",
|
||||
detailsFormData: cloneDeep(DETAILS_FORM_DATA),
|
||||
detailsRuleForm: cloneDeep(DETAILS_RULE_FORM),
|
||||
dialogVisible: false, //弹窗
|
||||
selectionList: [] //选中表格的行
|
||||
dialogVisible: false, // 弹窗
|
||||
selectionList: [] // 列表选中数据
|
||||
});
|
||||
|
||||
const userStore = useUserStore();
|
||||
//初始化组织数据
|
||||
const init = () => {
|
||||
if (userStore.orgIdArr.length) {
|
||||
dataStore.formData[0].options = userStore?.orgIdArr;
|
||||
dataStore.detailsFormData[0].options = userStore?.orgIdArr;
|
||||
}
|
||||
};
|
||||
init();
|
||||
// 表格选择事件
|
||||
const selectionChange = (selection: any) => {
|
||||
dataStore.selectionList = selection;
|
||||
};
|
||||
//删除
|
||||
// 删除
|
||||
const handleDel = () => {
|
||||
console.log();
|
||||
if (!dataStore.selectionList.length) {
|
||||
useMsg("warning", "请选择数据 !");
|
||||
return;
|
||||
@@ -90,40 +120,175 @@ const handleDel = () => {
|
||||
})
|
||||
.then(async () => {
|
||||
let ids: any = [];
|
||||
dataStore.selectionList.forEach((item: any) => {
|
||||
dataStore.selectionList?.forEach((item: any) => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
// console.log(ids, "==========");
|
||||
// const result = await getSubscribeDelApi(ids.join(","));
|
||||
// if (result?.code === 0) {
|
||||
// proTable?.value!.getTableList();
|
||||
// useMsg("success", "删除成功 !");
|
||||
// }
|
||||
const result = await getWarehouseDelApi(ids.join(","));
|
||||
if (result?.code === 0) {
|
||||
proTableRef?.value!.getTableList();
|
||||
useMsg("success", "删除成功 !");
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
};
|
||||
//顶部按钮点击事件
|
||||
// 新增
|
||||
const getWarehouseAdd = async (params: any) => {
|
||||
const result = await getWarehouseAddApi(params);
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "新增成功 !");
|
||||
setTimeout(() => {
|
||||
dataStore.dialogVisible = false;
|
||||
proTableRef?.value!.getTableList();
|
||||
}, 600);
|
||||
}
|
||||
};
|
||||
// 更新
|
||||
const getWarehouseUp = async (params: any) => {
|
||||
const result = await getWarehouseUpApi(dataStore.rowId, params);
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "更新成功 !");
|
||||
setTimeout(() => {
|
||||
dataStore.dialogVisible = false;
|
||||
proTableRef?.value!.getTableList();
|
||||
}, 600);
|
||||
}
|
||||
};
|
||||
// 详情
|
||||
const getWarehouseDetails = async (id: any) => {
|
||||
const result = await getWarehouseDetailsApi(id);
|
||||
if (result?.code === 0) {
|
||||
dataStore.dialogVisible = true;
|
||||
dataStore.title = "编辑金蝶子仓与各系统仓库关系";
|
||||
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 () => {
|
||||
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
|
||||
});
|
||||
});
|
||||
dataStore.detailsFormData[1].options = options;
|
||||
}
|
||||
};
|
||||
//获取金蝶子仓库
|
||||
const getSetWarehouseSubwarehousesList = async () => {
|
||||
//先清空一下
|
||||
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
|
||||
});
|
||||
});
|
||||
dataStore.detailsFormData[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;
|
||||
}
|
||||
};
|
||||
//获取聚水潭仓库
|
||||
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;
|
||||
}
|
||||
};
|
||||
// 表格row点击事件
|
||||
const handleOpen = (row: any) => {
|
||||
dataStore.rowId = row.id;
|
||||
getWarehouseDetails(row.id);
|
||||
};
|
||||
|
||||
// 顶部按钮点击事件
|
||||
const handleButtonClickCallback = (item: any) => {
|
||||
const { type } = item;
|
||||
if (type === "del") {
|
||||
return handleDel();
|
||||
handleDel();
|
||||
}
|
||||
// if (type === "export") {
|
||||
// handleExport();
|
||||
// }
|
||||
if (type === "add") {
|
||||
dataStore.title = "新增金蝶子仓与各系统仓库关系";
|
||||
dataStore.dialogVisible = true;
|
||||
}
|
||||
};
|
||||
//弹窗取消
|
||||
// 弹窗取消
|
||||
const handleClose = () => {
|
||||
dataStore.detailsRuleForm = cloneDeep(DETAILS_RULE_FORM);
|
||||
detailsRef?.value?.formElement?.resetFields();
|
||||
dataStore.dialogVisible = false;
|
||||
};
|
||||
//弹窗确认
|
||||
|
||||
// 弹窗确认
|
||||
const handleCommit = () => {
|
||||
dataStore.dialogVisible = false;
|
||||
let params = cloneDeep(dataStore.detailsRuleForm);
|
||||
if (!params.use_org_number) {
|
||||
return useMsg("warning", "组织不能为空 !");
|
||||
}
|
||||
if (!params.kd_warehouse_number) {
|
||||
return useMsg("warning", "金蝶仓库不能为空 !");
|
||||
}
|
||||
//将金蝶子仓库转换为字符串
|
||||
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 {
|
||||
delete params.kd_subwarehouse_number;
|
||||
}
|
||||
|
||||
if (dataStore.title === "新增金蝶子仓与各系统仓库关系") {
|
||||
getWarehouseAdd(params);
|
||||
} else {
|
||||
getWarehouseUp(params);
|
||||
}
|
||||
};
|
||||
//搜索
|
||||
// 搜索
|
||||
const handleSearch = async (params: any) => {
|
||||
dataStore.initParam = cloneDeep(params);
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
@@ -131,7 +296,7 @@ const handleSearch = async (params: any) => {
|
||||
proTableRef?.value!.getTableList();
|
||||
});
|
||||
};
|
||||
//重置
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
@@ -139,6 +304,138 @@ const handleReset = () => {
|
||||
proTableRef?.value!.getTableList();
|
||||
});
|
||||
};
|
||||
//监听组织和金蝶仓库清空按钮(会触发下面的watch)
|
||||
const handleSelectMultipleDClear = (params: any) => {
|
||||
const {
|
||||
item: { prop }
|
||||
} = params;
|
||||
dataStore.detailsRuleForm[prop] = "";
|
||||
};
|
||||
/**
|
||||
* 监听查询条件标签关闭(统一处理组织、仓库、子仓库联动,修复split类型错误)
|
||||
* @param params { item: { prop: string } } - 关闭标签的相关参数(包含字段标识prop)
|
||||
*/
|
||||
const handleSelectMultipleRemoveTag = (params: any) => {
|
||||
const { item } = params;
|
||||
const { prop } = item;
|
||||
const paramValue = dataStore.initParam[prop]; // 获取当前参数值
|
||||
// 根据字段标识分发处理逻辑
|
||||
switch (prop) {
|
||||
case "use_org_number":
|
||||
handleOrgTagRemove(paramValue);
|
||||
break;
|
||||
case "kd_warehouse_number":
|
||||
handleKdWarehouseTagRemove(paramValue);
|
||||
break;
|
||||
case "kd_subwarehouse_number":
|
||||
handleKdSubWarehouseTagRemove(paramValue);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 组织标签关闭处理(联动仓库、子仓库)
|
||||
* @param remainingOrgValues 关闭后剩余的组织value数组(如:["101"]、["101","115"])
|
||||
*/
|
||||
const handleOrgTagRemove = (remainingOrgValues: any[]) => {
|
||||
// 2. 筛选仓库:基于原始金蝶仓库数据,聚合所有剩余组织对应的仓库(去重)
|
||||
let filteredWarehouses: any = [];
|
||||
if (remainingOrgValues.length > 0) {
|
||||
filteredWarehouses = dataStore.formData[1].options.filter((warehouse: any) =>
|
||||
remainingOrgValues.includes(warehouse.use_org_number)
|
||||
);
|
||||
// 去重:避免同一仓库被多个组织关联导致重复
|
||||
filteredWarehouses = Array.from(new Map(filteredWarehouses.map((item: any) => [item.value, item])).values());
|
||||
}
|
||||
|
||||
// 3. 重置仓库状态(清空已选+更新选项)
|
||||
dataStore.initParam.kd_warehouse_number = "";
|
||||
dataStore.formData[1].options = [];
|
||||
dataStore.formData[1].options = filteredWarehouses;
|
||||
|
||||
// 4. 重置子仓库状态(仓库变化后必须清空)
|
||||
dataStore.initParam.kd_subwarehouse_number = "";
|
||||
dataStore.formData[2].options = [];
|
||||
};
|
||||
|
||||
/**
|
||||
* 金蝶仓库标签关闭处理(联动子仓库)
|
||||
* @param remainingWarehouseValues 关闭后剩余的仓库value数组(如:["AD"]、["AD","CK001"])
|
||||
*/
|
||||
const handleKdWarehouseTagRemove = (remainingWarehouseValues: any[]) => {
|
||||
// 2. 筛选子仓库:基于原始金蝶子仓库数据,聚合所有剩余仓库对应的子仓库
|
||||
let filteredSubWarehouses = [];
|
||||
if (remainingWarehouseValues.length > 0) {
|
||||
filteredSubWarehouses = dataStore.formData[2].options.filter((subWarehouse: any) =>
|
||||
remainingWarehouseValues.includes(subWarehouse.warehouse_number)
|
||||
);
|
||||
} else {
|
||||
// 仓库全部关闭:显示所有原始子仓库数据
|
||||
filteredSubWarehouses = [...dataStore.formData[2].options];
|
||||
}
|
||||
|
||||
// 3. 重置子仓库状态(清空已选+更新选项)
|
||||
dataStore.initParam.kd_subwarehouse_number = "";
|
||||
dataStore.formData[2].options = [];
|
||||
dataStore.formData[2].options = filteredSubWarehouses;
|
||||
};
|
||||
|
||||
/**
|
||||
* 金蝶子仓库标签关闭处理(仅更新自身,不联动上级)
|
||||
* @param remainingSubWarehouseValues 关闭后剩余的子仓库value数组
|
||||
*/
|
||||
const handleKdSubWarehouseTagRemove = (remainingSubWarehouseValues: any[]) => {
|
||||
// 同步表单已选值
|
||||
dataStore.formData[2].options = remainingSubWarehouseValues;
|
||||
};
|
||||
// //监听弹窗开启
|
||||
watch(
|
||||
() => dataStore.dialogVisible,
|
||||
(newVal: any) => {
|
||||
if (newVal) {
|
||||
//金蝶倉庫
|
||||
getSetWarehouseKingdeeList();
|
||||
//领星仓库
|
||||
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();
|
||||
} 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();
|
||||
} else {
|
||||
dataStore.detailsRuleForm.kd_subwarehouse_number = "";
|
||||
dataStore.detailsFormData[2].options = [];
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scope lang="scss">
|
||||
|
||||
@@ -53,6 +53,7 @@ import { cloneDeep } from "lodash-es";
|
||||
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||
const proTableRef = ref<ProTableInstance>();
|
||||
const router = useRouter();
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
// 数据源
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
367
vite.config.ts.timestamp-1761526887211-bf09e25f7bade.mjs
Normal file
367
vite.config.ts.timestamp-1761526887211-bf09e25f7bade.mjs
Normal file
File diff suppressed because one or more lines are too long
367
vite.config.ts.timestamp-1761526957978-11dadb76ad61e.mjs
Normal file
367
vite.config.ts.timestamp-1761526957978-11dadb76ad61e.mjs
Normal file
File diff suppressed because one or more lines are too long
367
vite.config.ts.timestamp-1762304755718-8c17e0d0abd23.mjs
Normal file
367
vite.config.ts.timestamp-1762304755718-8c17e0d0abd23.mjs
Normal file
File diff suppressed because one or more lines are too long
367
vite.config.ts.timestamp-1762736569869-1de5e357445ba.mjs
Normal file
367
vite.config.ts.timestamp-1762736569869-1de5e357445ba.mjs
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user