Compare commits
36 Commits
efee846973
...
dev-收货单
| Author | SHA1 | Date | |
|---|---|---|---|
| fae9b61e7d | |||
| f4274d2fb3 | |||
| e908048997 | |||
| e79c096e12 | |||
| 4168871fd4 | |||
| 335b9a9b2d | |||
| 2b2e6fc401 | |||
| 17625a1cff | |||
| b0e729f9c0 | |||
| caf79bae5a | |||
| cad97ac4fd | |||
| 1e80affb50 | |||
| 107bd1a933 | |||
| 1208835216 | |||
| da31b2d347 | |||
| d0d6853806 | |||
| f3bc8e6410 | |||
| 173131d11c | |||
| a90dab331c | |||
| c0750ed493 | |||
| 8a958c987e | |||
| 0861dae12d | |||
| e8dc354c10 | |||
| eea0925899 | |||
| c913152460 | |||
| 7efeb8faf0 | |||
| 8a064cf1b9 | |||
| f08b094efc | |||
| 9aa3782667 | |||
| 574c46580f | |||
| 3c72a248fa | |||
| f057f07ce7 | |||
| 54522f7ca2 | |||
| c18746fcf5 | |||
| ef38880743 | |||
| 190be3b7ce |
2
.env
2
.env
@@ -1,5 +1,5 @@
|
|||||||
# title
|
# title
|
||||||
VITE_GLOB_APP_TITLE = OPS供应链系统
|
VITE_GLOB_APP_TITLE = WMS系统
|
||||||
|
|
||||||
# 本地运行端口号
|
# 本地运行端口号
|
||||||
VITE_PORT = 8080
|
VITE_PORT = 8080
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
ENV = 'dev'
|
ENV = 'dev'
|
||||||
VITE_APP_API_VERSION =""
|
VITE_APP_API_VERSION =""
|
||||||
VITE_APP_API_BASEURL = https://dev.wms.api.v2.f2b211.com/v1/admapi/
|
VITE_APP_API_BASEURL = https://dev.wms.api.v2.f2b211.com/v1/admapi/
|
||||||
VITE_APP_SSO_LOGINURL = http://dev.uc.v3.f2b211.com/uc/login # http://dev.uc.f2b211.com/index.php/uc/user/login.html
|
VITE_APP_SSO_LOGINURL = https://dev.uc.v3.f2b211.com/uc/login # http://dev.uc.f2b211.com/index.php/uc/user/login.html
|
||||||
VITE_APP_SSO_APPID = 101341644040699904
|
VITE_APP_SSO_APPID = 101341644040699904
|
||||||
|
|
||||||
VITE_REDIRECT_URL =http://localhost:8080/login #单点从定向地址
|
VITE_REDIRECT_URL =http://localhost:8080/login #单点从定向地址
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
VITE_APP_API_VERSION = "" #版本号
|
VITE_APP_API_VERSION = "" #版本号
|
||||||
VITE_APP_API_BASEURL = https://opsscmapi.f2b211.com/api/ #请求地址
|
VITE_APP_API_BASEURL = https://newwms.api.f2b211.com/v1/admapi/ #请求地址
|
||||||
VITE_APP_SSO_LOGINURL = http://uc.v3.f2b211.com/uc/login
|
VITE_APP_SSO_LOGINURL = https://uc.v3.f2b211.com/uc/login
|
||||||
VITE_APP_SSO_APPID = 100664627590856707
|
VITE_APP_SSO_APPID = 100664627590856709
|
||||||
|
|
||||||
VITE_REDIRECT_URL = https://opsscm.f2b211.com/login #单点从定向地址
|
VITE_REDIRECT_URL = https://newwms.f2b211.com/login #单点从定向地址
|
||||||
VITE_SINGLE_URL = https://uc.v3.f2b211.com/ #单点登录通知
|
VITE_SINGLE_URL = https://uc.v3.f2b211.com/ #单点登录通知
|
||||||
# 线上环境
|
# 线上环境
|
||||||
VITE_USER_NODE_ENV = production
|
VITE_USER_NODE_ENV = production
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
ENV = 'test'
|
ENV = 'test'
|
||||||
VITE_APP_API_VERSION =""
|
VITE_APP_API_VERSION =""
|
||||||
VITE_APP_API_BASEURL = https://dev.wms.api.v2.f2b211.com/v1/admapi/
|
VITE_APP_API_BASEURL = https://dev.wms.api.v2.f2b211.com/v1/admapi/
|
||||||
VITE_APP_SSO_LOGINURL = http://dev.uc.v3.f2b211.com/uc/login # http://dev.uc.f2b211.com/index.php/uc/user/login.html
|
VITE_APP_SSO_LOGINURL = https://dev.uc.v3.f2b211.com/uc/login # http://dev.uc.f2b211.com/index.php/uc/user/login.html
|
||||||
VITE_APP_SSO_APPID = 101341644040699904
|
VITE_APP_SSO_APPID = 101341644040699904
|
||||||
|
|
||||||
VITE_REDIRECT_URL =https://dev.wms.v2.f2b211.com/login #单点从定向地址
|
VITE_REDIRECT_URL =https://dev.wms.v2.f2b211.com/login #单点从定向地址
|
||||||
|
|||||||
@@ -60,8 +60,17 @@ class RequestHttp {
|
|||||||
this.service.interceptors.response.use(
|
this.service.interceptors.response.use(
|
||||||
(response: AxiosResponse) => {
|
(response: AxiosResponse) => {
|
||||||
const { data } = response;
|
const { data } = response;
|
||||||
// const userStore = useUserStore();
|
|
||||||
tryHideFullScreenLoading();
|
tryHideFullScreenLoading();
|
||||||
|
// 获取响应头中的 Authorization 信息
|
||||||
|
const authorization = response.headers["authorization"];
|
||||||
|
//刷新token
|
||||||
|
if (authorization) {
|
||||||
|
// 可以在这里更新用户的 token 信息
|
||||||
|
const userStore = useUserStore();
|
||||||
|
userStore.setToken(authorization);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
// 登陆失效
|
// 登陆失效
|
||||||
if (data.code == 401) {
|
if (data.code == 401) {
|
||||||
ElMessage.error(data.msg || data.message);
|
ElMessage.error(data.msg || data.message);
|
||||||
|
|||||||
@@ -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";
|
import http from "@/api";
|
||||||
// 导出列表
|
// 导出列表
|
||||||
export const getListApi = (params: Record<string, any>) => {
|
export const getListApi = (params: Record<string, any>) => {
|
||||||
|
if (params?.status === "正在导出") {
|
||||||
|
params.status = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return http.get<any>(`exports`, params);
|
return http.get<any>(`exports`, params);
|
||||||
};
|
};
|
||||||
//状态
|
//状态
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import http from "@/api";
|
|||||||
|
|
||||||
//物料分页列表
|
//物料分页列表
|
||||||
export const getMaterialListApi = (params: any) => {
|
export const getMaterialListApi = (params: any) => {
|
||||||
|
if (params.disabled && params.disabled === "启用") {
|
||||||
|
params.disabled = 0;
|
||||||
|
}
|
||||||
return http.get<any>(`material`, params);
|
return http.get<any>(`material`, params);
|
||||||
};
|
};
|
||||||
//刷新 /admapi/material/reload
|
//刷新 /admapi/material/reload
|
||||||
|
|||||||
@@ -26,6 +26,22 @@ export const getProductLinesApi = (params: any) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//仓库
|
//仓库
|
||||||
export const getWarehousesListApi = () => {
|
export const getWarehousesListApi = (params?: any) => {
|
||||||
return http.get<any>(`basicinfo/warehouses`);
|
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);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,15 +4,15 @@ import http from "@/api";
|
|||||||
* @name 全局模块(在公司下面的数据)
|
* @name 全局模块(在公司下面的数据)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//质检单列表
|
//质检单列表 /admapi/inspection
|
||||||
export const getQualityInspectListApi = (params: any) => {
|
export const getQualityInspectListApi = (params: any) => {
|
||||||
return http.get<any>(`quality_inspect`, params);
|
return http.get<any>(`inspection`, params);
|
||||||
};
|
};
|
||||||
//刷新 /admapi/quality_inspect/reload
|
//刷新 /admapi/quality_inspect/reload
|
||||||
export const getQualityInspectReloadApi = (params: any) => {
|
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) => {
|
export const getQualityInspectExportApi = (params: any) => {
|
||||||
return http.get<any>(`quality_inspect/export`, params);
|
return http.get<any>(`inspection/export`, params);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ export const loginApi = (params: Login.ReqLoginCode) => {
|
|||||||
|
|
||||||
// 获取菜单列表
|
// 获取菜单列表
|
||||||
export const getAuthMenuListApi = () => {
|
export const getAuthMenuListApi = () => {
|
||||||
console.log("触发了吗");
|
|
||||||
return http.get<any>(`/user/permissions`, {}, { noLoading: true });
|
return http.get<any>(`/user/permissions`, {}, { noLoading: true });
|
||||||
// return authMenuList;
|
// return authMenuList;
|
||||||
};
|
};
|
||||||
|
|||||||
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);
|
||||||
|
};
|
||||||
@@ -2,6 +2,9 @@ import http from "@/api";
|
|||||||
|
|
||||||
//订阅入庫單列表 /admapi/subscribe /admapi/subscribe/wrr
|
//订阅入庫單列表 /admapi/subscribe /admapi/subscribe/wrr
|
||||||
export const getSubscribeWrrListApi = (params: any) => {
|
export const getSubscribeWrrListApi = (params: any) => {
|
||||||
|
if (params?.notif_ret_status === "空") {
|
||||||
|
params.notif_ret_status = 0;
|
||||||
|
}
|
||||||
return http.get<any>(`subscribe/wrr`, params);
|
return http.get<any>(`subscribe/wrr`, params);
|
||||||
};
|
};
|
||||||
//订阅入库单刷新
|
//订阅入库单刷新
|
||||||
@@ -9,5 +12,8 @@ export const getSubscribeResetListApi = (params: any) => {
|
|||||||
return http.get<any>(`subscribe/wrr/reload`, params);
|
return http.get<any>(`subscribe/wrr/reload`, params);
|
||||||
};
|
};
|
||||||
export const getSubscribeResetListExportApi = (params: any) => {
|
export const getSubscribeResetListExportApi = (params: any) => {
|
||||||
|
if (params?.notif_ret_status === "空") {
|
||||||
|
params.notif_ret_status = 0;
|
||||||
|
}
|
||||||
return http.get<any>(`subscribe/wrr/export`, params);
|
return http.get<any>(`subscribe/wrr/export`, params);
|
||||||
};
|
};
|
||||||
|
|||||||
1
src/components.d.ts
vendored
1
src/components.d.ts
vendored
@@ -19,6 +19,7 @@ declare module "vue" {
|
|||||||
ElCheckbox: typeof import("element-plus/es")["ElCheckbox"];
|
ElCheckbox: typeof import("element-plus/es")["ElCheckbox"];
|
||||||
ElContainer: typeof import("element-plus/es")["ElContainer"];
|
ElContainer: typeof import("element-plus/es")["ElContainer"];
|
||||||
ElDatePicker: typeof import("element-plus/es")["ElDatePicker"];
|
ElDatePicker: typeof import("element-plus/es")["ElDatePicker"];
|
||||||
|
ElDialog: typeof import("element-plus/es")["ElDialog"];
|
||||||
ElDrawer: typeof import("element-plus/es")["ElDrawer"];
|
ElDrawer: typeof import("element-plus/es")["ElDrawer"];
|
||||||
ElDropdown: typeof import("element-plus/es")["ElDropdown"];
|
ElDropdown: typeof import("element-plus/es")["ElDropdown"];
|
||||||
ElDropdownItem: typeof import("element-plus/es")["ElDropdownItem"];
|
ElDropdownItem: typeof import("element-plus/es")["ElDropdownItem"];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="search-box1" ref="searchRef">
|
<div :class="isSearch ? 'search-box' : 'search-box1'" ref="searchRef">
|
||||||
<el-form
|
<el-form
|
||||||
ref="ruleFormRef"
|
ref="ruleFormRef"
|
||||||
:model="_searchResult"
|
:model="_searchResult"
|
||||||
@@ -13,14 +13,14 @@
|
|||||||
:label="item.label"
|
:label="item.label"
|
||||||
:prop="item.prop"
|
:prop="item.prop"
|
||||||
:label-width="labelWidth || '81px'"
|
:label-width="labelWidth || '81px'"
|
||||||
:rules="item.rules"
|
|
||||||
:error="item.error"
|
:error="item.error"
|
||||||
|
:required="item.required"
|
||||||
:show-message="item.showMessage ? item.showMessage : false"
|
:show-message="item.showMessage ? item.showMessage : false"
|
||||||
:inline-message="item.inlineMessage"
|
:inline-message="item.inlineMessage"
|
||||||
:style="item.style ? item.style : 'margin-right:8px;position: relative;'"
|
:style="item.style ? item.style : 'margin-right:8px;position: relative;'"
|
||||||
:required="item.required"
|
|
||||||
:class="item.class ? item.class : 'form-item'"
|
:class="item.class ? item.class : 'form-item'"
|
||||||
>
|
>
|
||||||
|
<!-- :required="item.required" -->
|
||||||
<template v-if="item.type === 'input'">
|
<template v-if="item.type === 'input'">
|
||||||
<el-input
|
<el-input
|
||||||
v-model.trim="_searchResult[`${item.prop}`]"
|
v-model.trim="_searchResult[`${item.prop}`]"
|
||||||
@@ -31,6 +31,16 @@
|
|||||||
>
|
>
|
||||||
</el-input>
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-if="item.type === 'textarea'">
|
||||||
|
<el-input
|
||||||
|
v-model.trim="_searchResult[`${item.prop}`]"
|
||||||
|
:placeholder="item.placeholder"
|
||||||
|
:disabled="item.disabled"
|
||||||
|
type="textarea"
|
||||||
|
:maxlength="item.maxLength ? item.maxLength : 255"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</template>
|
||||||
<template v-if="item.type === 'inputs'">
|
<template v-if="item.type === 'inputs'">
|
||||||
<el-input
|
<el-input
|
||||||
v-model.trim="_searchResult[`${item.startProp}`]"
|
v-model.trim="_searchResult[`${item.startProp}`]"
|
||||||
@@ -57,16 +67,33 @@
|
|||||||
:placeholder="item.placeholder"
|
:placeholder="item.placeholder"
|
||||||
clearable
|
clearable
|
||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
|
@change="handleSelectChange(item)"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="options in item.options"
|
v-for="option in item.options"
|
||||||
:label="options.label"
|
:label="option.label"
|
||||||
:value="options.value"
|
:value="option.value"
|
||||||
:key="options.label"
|
: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>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="item.type === 'date'">
|
<template v-if="item.type === 'date'">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
@@ -127,10 +154,30 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</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
|
<template
|
||||||
v-if="item.type === 'selectMultipleRemoteCustomersNames' || item.type === 'selectProductLinesRemote'"
|
v-if="item.type === 'selectMultipleRemoteCustomersNames' || item.type === 'selectProductLinesRemote'"
|
||||||
>
|
>
|
||||||
<!-- // filterable -->
|
|
||||||
<el-select
|
<el-select
|
||||||
v-model="_searchResult[`${item.prop}`]"
|
v-model="_searchResult[`${item.prop}`]"
|
||||||
:placeholder="item.placeholder"
|
:placeholder="item.placeholder"
|
||||||
@@ -142,6 +189,7 @@
|
|||||||
class="m-2 select"
|
class="m-2 select"
|
||||||
:remote-method="(query:any)=> handleSelectMultipleRemote(query, item)"
|
:remote-method="(query:any)=> handleSelectMultipleRemote(query, item)"
|
||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
|
style="max-height: 300px; overflow-y: auto"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
:label="option.label"
|
:label="option.label"
|
||||||
@@ -168,11 +216,14 @@ const props = defineProps<{
|
|||||||
labelWidth?: string;
|
labelWidth?: string;
|
||||||
ruleForm: Record<string, any>;
|
ruleForm: Record<string, any>;
|
||||||
style?: string;
|
style?: string;
|
||||||
|
isSearch?: Boolean;
|
||||||
inline?: Boolean;
|
inline?: Boolean;
|
||||||
getSearchValue?: () => void;
|
getSearchValue?: () => void;
|
||||||
selectMultipleRemoveTag?: () => void;
|
selectMultipleRemoveTag?: () => void;
|
||||||
selectMultipleRemoteTag1?: () => void;
|
selectMultipleRemoteTag1?: () => void;
|
||||||
setRuleFormValue?: () => void;
|
setRuleFormValue?: () => void;
|
||||||
|
selectMultipleDClear?: () => void;
|
||||||
|
selectChange?: () => void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
let _searchResult = computed(() => {
|
let _searchResult = computed(() => {
|
||||||
@@ -185,8 +236,12 @@ const emits = defineEmits<{
|
|||||||
(e: "setRuleFormValue", result: Record<string, any>): void;
|
(e: "setRuleFormValue", result: Record<string, any>): void;
|
||||||
(e: "selectMultipleRemoveTag", result: Record<string, any>): void;
|
(e: "selectMultipleRemoveTag", result: Record<string, any>): void;
|
||||||
(e: "selectMultipleRemoteTag1", 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) => {
|
const handleRomoveTag = (item: any) => {
|
||||||
emits("selectMultipleRemoveTag", { item, org_number: _searchResult.value.org_number });
|
emits("selectMultipleRemoveTag", { item, org_number: _searchResult.value.org_number });
|
||||||
};
|
};
|
||||||
@@ -195,6 +250,7 @@ const handleTagRemove1 = (item: any) => {
|
|||||||
item.options = [];
|
item.options = [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//客戶
|
//客戶
|
||||||
const getCustomers = async (keywords: any, item: any) => {
|
const getCustomers = async (keywords: any, item: any) => {
|
||||||
let org_number = _searchResult.value.org_number.join(",");
|
let org_number = _searchResult.value.org_number.join(",");
|
||||||
@@ -205,8 +261,10 @@ const getCustomers = async (keywords: any, item: any) => {
|
|||||||
let options: any = [];
|
let options: any = [];
|
||||||
data.forEach((item: any) => {
|
data.forEach((item: any) => {
|
||||||
options.push({
|
options.push({
|
||||||
value: item.customer_number,
|
value: item.customer_number + "_" + item.use_org_number,
|
||||||
label: item.customer_name
|
label: item.customer_name + " " + `(${item.use_org_name})`,
|
||||||
|
id: item.use_org_number,
|
||||||
|
useOrgName: item.use_org_name
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
item.options = options;
|
item.options = options;
|
||||||
@@ -256,6 +314,10 @@ const getUsers = async (keywords: any, item: any) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleSelectMultipleDClear = (item: any) => {
|
||||||
|
emits("selectMultipleDClear", { item });
|
||||||
|
};
|
||||||
|
|
||||||
//远程搜索多选
|
//远程搜索多选
|
||||||
const handleSelectMultipleRemote = (query: any, item: any) => {
|
const handleSelectMultipleRemote = (query: any, item: any) => {
|
||||||
if (!query) {
|
if (!query) {
|
||||||
@@ -316,9 +378,10 @@ const valueVerifyInputs = (item: any) => {
|
|||||||
prop: item.prop
|
prop: item.prop
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// const handleSelectMultipleClear = (item: any) => {
|
|
||||||
// console.log(item, "===========>");
|
defineExpose({
|
||||||
// };
|
formElement: ruleFormRef
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scope>
|
<style lang="scss" scope>
|
||||||
.search-box1 {
|
.search-box1 {
|
||||||
@@ -375,6 +438,60 @@ const valueVerifyInputs = (item: any) => {
|
|||||||
margin-bottom: 8px !important;
|
margin-bottom: 8px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.search-box {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
min-width: 600px;
|
||||||
|
padding: 16px;
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 6px;
|
||||||
|
|
||||||
|
// 单据头用的样式
|
||||||
|
.form-box {
|
||||||
|
// width: 85%;
|
||||||
|
.form-item {
|
||||||
|
width: 392px !important;
|
||||||
|
|
||||||
|
// height: 32px;
|
||||||
|
// 原代码有 height: 32px !important; 这会导致子元素高度超出后被遮盖
|
||||||
|
height: auto !important; // 改为自动高度
|
||||||
|
min-height: 32px; // 保留最小高度,未选择时对齐
|
||||||
|
margin-bottom: 8px !important;
|
||||||
|
.el-form-item__label {
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
.el-select {
|
||||||
|
width: 392px;
|
||||||
|
}
|
||||||
|
.el-form-item--default {
|
||||||
|
width: 392px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.form-item1 {
|
||||||
|
width: 594px !important;
|
||||||
|
|
||||||
|
// height: 32px;
|
||||||
|
// 原代码有 height: 32px !important; 这会导致子元素高度超出后被遮盖
|
||||||
|
height: auto !important; // 改为自动高度
|
||||||
|
min-height: 32px; // 保留最小高度,未选择时对齐
|
||||||
|
margin-bottom: 8px !important;
|
||||||
|
.el-form-item__label {
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
.el-select {
|
||||||
|
width: 594px;
|
||||||
|
}
|
||||||
|
.el-form-item--default {
|
||||||
|
width: 594px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.form-item2 {
|
||||||
|
width: 494px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
margin-bottom: 8px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
.el-form-item--default .el-form-item__label {
|
.el-form-item--default .el-form-item__label {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
|
|||||||
@@ -150,7 +150,6 @@ const handleRemoteClick = (item: any, index: number) => {
|
|||||||
emits("handleRemoteClickValue", { item, index });
|
emits("handleRemoteClickValue", { item, index });
|
||||||
};
|
};
|
||||||
const handleEnterInput = (item: any, index: number) => {
|
const handleEnterInput = (item: any, index: number) => {
|
||||||
console.log("1232323");
|
|
||||||
emits("handleKeyupEnterInputValue", {
|
emits("handleKeyupEnterInputValue", {
|
||||||
item,
|
item,
|
||||||
index
|
index
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ const newValInitParams = toRef(props, "initParam");
|
|||||||
const { selectionChange, selectedList, selectedListIds, isSelected } = useSelection(props.rowKey);
|
const { selectionChange, selectedList, selectedListIds, isSelected } = useSelection(props.rowKey);
|
||||||
|
|
||||||
// 清空选中数据列表
|
// 清空选中数据列表
|
||||||
const clearSelection = () => tableRef.value!.clearSelection();
|
const clearSelection = () => tableRef?.value!.clearSelection();
|
||||||
// 表格操作 Hooks
|
// 表格操作 Hooks
|
||||||
const { tableData, pageable, getTableList, handleSizeChange, handleCurrentChange } = useTable(
|
const { tableData, pageable, getTableList, handleSizeChange, handleCurrentChange } = useTable(
|
||||||
routeName.value,
|
routeName.value,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<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">
|
<div style="flex: 2">
|
||||||
<el-form ref="formRef" :model="_searchParams" :inline="true">
|
<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
|
<el-form-item
|
||||||
:prop="item.prop"
|
:prop="item.prop"
|
||||||
:label-width="item.labelWidth ? item.labelWidth : '120px'"
|
:label-width="item.labelWidth ? item.labelWidth : '120px'"
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
v-if="item.type === 'selectRemote' || item.type === 'selectRemote1' || item.type === 'selectRemote2'"
|
v-if="item.type === 'selectRemote' || item.type === 'selectRemote1' || item.type === 'selectRemote2'"
|
||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="_searchParams[`${item.prop}`]"
|
v-model.trim="_searchParams[`${item.prop}`]"
|
||||||
:placeholder="item.placeholder"
|
:placeholder="item.placeholder"
|
||||||
clearable
|
clearable
|
||||||
remote
|
remote
|
||||||
@@ -86,16 +86,23 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</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
|
<el-select
|
||||||
v-model="_searchParams[`${item.prop}`]"
|
v-model.trim="_searchParams[`${item.prop}`]"
|
||||||
:placeholder="item.placeholder"
|
:placeholder="item.placeholder"
|
||||||
remote
|
remote
|
||||||
multiple
|
multiple
|
||||||
filterable
|
filterable
|
||||||
:reserve-keyword="false"
|
:reserve-keyword="false"
|
||||||
@clear="handleClear(item)"
|
@remove-tag="handleTagRemove(item)"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
class="m-2 select"
|
class="m-2 select"
|
||||||
remote-show-suffix
|
remote-show-suffix
|
||||||
@@ -108,7 +115,7 @@
|
|||||||
}
|
}
|
||||||
"
|
"
|
||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
style="width: 224px"
|
style="width: 224px; max-height: 80px; overflow-y: auto"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
:label="option.label"
|
:label="option.label"
|
||||||
@@ -122,14 +129,16 @@
|
|||||||
<template v-if="item.type === 'selectMultiple'">
|
<template v-if="item.type === 'selectMultiple'">
|
||||||
<!-- multiple -->
|
<!-- multiple -->
|
||||||
<el-select
|
<el-select
|
||||||
v-model="_searchParams[`${item.prop}`]"
|
v-model.trim="_searchParams[`${item.prop}`]"
|
||||||
filterable
|
filterable
|
||||||
multiple
|
multiple
|
||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
:placeholder="item.placeholder"
|
:placeholder="item.placeholder"
|
||||||
class="m-2 select"
|
class="m-2 select"
|
||||||
:reserve-keyword="false"
|
:reserve-keyword="false"
|
||||||
style="width: 224px"
|
style="width: 224px; max-height: 80px; overflow-y: auto"
|
||||||
|
@remove-tag="handleTagRemove1(item)"
|
||||||
|
ref="remoteRef"
|
||||||
>
|
>
|
||||||
<!-- 循环渲染选项:label 为显示文本,value 为实际提交值 -->
|
<!-- 循环渲染选项:label 为显示文本,value 为实际提交值 -->
|
||||||
<el-option
|
<el-option
|
||||||
@@ -144,7 +153,7 @@
|
|||||||
<template v-if="item.type === 'selectMultipleD'">
|
<template v-if="item.type === 'selectMultipleD'">
|
||||||
<!-- multiple -->
|
<!-- multiple -->
|
||||||
<el-select
|
<el-select
|
||||||
v-model="_searchParams[`${item.prop}`]"
|
v-model.trim="_searchParams[`${item.prop}`]"
|
||||||
filterable
|
filterable
|
||||||
clearable
|
clearable
|
||||||
:reserve-keyword="false"
|
:reserve-keyword="false"
|
||||||
@@ -162,6 +171,23 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</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>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -174,23 +200,35 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="SearchForm">
|
<script setup lang="ts" name="SearchForm">
|
||||||
import { verificationInput } from "./components/utils/verificationInput";
|
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<{
|
const props = defineProps<{
|
||||||
formData: any[];
|
formData: any[];
|
||||||
searchParams: Record<string, any>;
|
searchParams: Record<string, any>;
|
||||||
|
selectMultipleRemoveTag?: () => void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emits = defineEmits<{
|
const emits = defineEmits<{
|
||||||
(e: "search", result: Record<string, any>): void;
|
(e: "search", result: Record<string, any>): void;
|
||||||
(e: "reset", result: Record<string, any>): void;
|
(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);
|
let loading = ref(false);
|
||||||
|
const remoteRef = ref(null);
|
||||||
const _searchParams = computed(() => {
|
const _searchParams: any = computed(() => {
|
||||||
return props.searchParams;
|
return props.searchParams;
|
||||||
});
|
});
|
||||||
|
const _formData: any = computed(() => {
|
||||||
|
return props.formData;
|
||||||
|
});
|
||||||
//日期选择后重选赋值
|
//日期选择后重选赋值
|
||||||
const handlePicker = (item: any) => {
|
const handlePicker = (item: any) => {
|
||||||
const { prop } = item;
|
const { prop } = item;
|
||||||
@@ -209,6 +247,8 @@ const getSupplier = async (keywords: any, item: any) => {
|
|||||||
if (result?.code === 0) {
|
if (result?.code === 0) {
|
||||||
const { data } = result;
|
const { data } = result;
|
||||||
item.options = data;
|
item.options = data;
|
||||||
|
} else {
|
||||||
|
item.options = [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//客戶
|
//客戶
|
||||||
@@ -219,13 +259,17 @@ const getCustomers = async (keywords: any, item: any) => {
|
|||||||
const { data } = result;
|
const { data } = result;
|
||||||
if (Array.isArray(data) && data.length) {
|
if (Array.isArray(data) && data.length) {
|
||||||
let options: any = [];
|
let options: any = [];
|
||||||
data.forEach((item: any) => {
|
data.forEach((it: any) => {
|
||||||
options.push({
|
options.push({
|
||||||
value: item.customer_number,
|
value: it.customer_number + "_" + it.use_org_number,
|
||||||
label: item.customer_name
|
label: it.customer_name + " " + `(${it.use_org_name})`,
|
||||||
|
id: it.use_org_number,
|
||||||
|
useOrgName: it.use_org_name
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
item.options = options;
|
item.options = options;
|
||||||
|
} else {
|
||||||
|
item.options = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -236,16 +280,73 @@ const getProductLines = async (keywords: any, item: any) => {
|
|||||||
const { data } = result;
|
const { data } = result;
|
||||||
if (Array.isArray(data) && data.length) {
|
if (Array.isArray(data) && data.length) {
|
||||||
let options: any = [];
|
let options: any = [];
|
||||||
data.forEach((item: any) => {
|
data.forEach((it: any) => {
|
||||||
options.push({
|
options.push({
|
||||||
value: item,
|
value: it,
|
||||||
label: item
|
label: it
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
item.options = options;
|
item.options = options;
|
||||||
|
} else {
|
||||||
|
item.options = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//金蝶仓库 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) => {
|
const handleSelectMultipleRemote = async (query: any, item: any) => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@@ -253,12 +354,14 @@ const handleSelectMultipleRemote = async (query: any, item: any) => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
item.options = [];
|
||||||
//去除字符串首尾的所有空白字符。
|
//去除字符串首尾的所有空白字符。
|
||||||
let valClone = query.replace(/^\s*|\s*$/g, "");
|
let valClone = query.replace(/^\s*|\s*$/g, "");
|
||||||
if (!valClone.length) {
|
if (!valClone.length) {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.type === "selectMultipleRemote") {
|
if (item.type === "selectMultipleRemote") {
|
||||||
//客戶編碼
|
//客戶編碼
|
||||||
getCustomers(valClone, item);
|
getCustomers(valClone, item);
|
||||||
@@ -266,9 +369,23 @@ const handleSelectMultipleRemote = async (query: any, item: any) => {
|
|||||||
//品线
|
//品线
|
||||||
getProductLines(valClone, item);
|
getProductLines(valClone, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = false;
|
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) => {
|
||||||
|
const { prop } = item;
|
||||||
|
console.log(prop);
|
||||||
|
emits("selectMultipleRemoveTag", { item, org_number: _searchParams.value[prop] });
|
||||||
|
};
|
||||||
//单选远程搜索(供应商)
|
//单选远程搜索(供应商)
|
||||||
const remoteMethod = async (query: any, item: any) => {
|
const remoteMethod = async (query: any, item: any) => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@@ -276,8 +393,9 @@ const remoteMethod = async (query: any, item: any) => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
item.options = [];
|
||||||
//去除字符串首尾的所有空白字符。
|
//去除字符串首尾的所有空白字符。
|
||||||
let valClone = query.replace(/^\s*|\s*$/g, "");
|
let valClone = query.replace(/^\s+|\s+$/g, "");
|
||||||
if (!valClone.length) {
|
if (!valClone.length) {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
return;
|
return;
|
||||||
@@ -310,6 +428,78 @@ const handleFormSearch = () => {
|
|||||||
const handleFormReset = () => {
|
const handleFormReset = () => {
|
||||||
emits("reset", _searchParams.value);
|
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>
|
</script>
|
||||||
<style lang="scss" scope>
|
<style lang="scss" scope>
|
||||||
@use "./index.scss";
|
@use "./index.scss";
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
export const usePathUrl = () => {
|
export const usePathUrl = (redirect_path?: any) => {
|
||||||
const PATH_URL = `${import.meta.env.VITE_APP_SSO_LOGINURL}?client_id=${
|
let PATH_URL: any = "";
|
||||||
|
if (redirect_path) {
|
||||||
|
PATH_URL = `${import.meta.env.VITE_APP_SSO_LOGINURL}?client_id=${
|
||||||
|
import.meta.env.VITE_APP_SSO_APPID
|
||||||
|
}&redirect_uri=${encodeURIComponent(
|
||||||
|
import.meta.env.VITE_REDIRECT_URL + "?redirect_path=" + redirect_path
|
||||||
|
)}&response_type=code`;
|
||||||
|
return PATH_URL;
|
||||||
|
} else {
|
||||||
|
PATH_URL = `${import.meta.env.VITE_APP_SSO_LOGINURL}?client_id=${
|
||||||
import.meta.env.VITE_APP_SSO_APPID
|
import.meta.env.VITE_APP_SSO_APPID
|
||||||
}&redirect_uri=${encodeURIComponent(import.meta.env.VITE_REDIRECT_URL)}&response_type=code`;
|
}&redirect_uri=${encodeURIComponent(import.meta.env.VITE_REDIRECT_URL)}&response_type=code`;
|
||||||
return PATH_URL;
|
return PATH_URL;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -31,15 +31,15 @@ export const useTable = (
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//数据处理
|
//訂閲数据处理
|
||||||
const initSubscribeData = () => {
|
const initSubscribeData = () => {
|
||||||
if (routeName === "foundationSubscribeList") {
|
if (routeName === "foundationSubscribeList") {
|
||||||
if (Array.isArray(state.totalParam?.org_number) && state.totalParam?.org_number?.length) {
|
if (Array.isArray(state.totalParam?.org_number) && state.totalParam?.org_number?.length) {
|
||||||
state.totalParam.org_number = state.totalParam.org_number.join(",");
|
state.totalParam.org_number = state.totalParam.org_number.join(",");
|
||||||
}
|
}
|
||||||
//品线
|
//品线
|
||||||
if (Array.isArray(state.totalParam?.product_line_name) && state.totalParam?.product_line_name?.length) {
|
if (Array.isArray(state.totalParam?.product_line) && state.totalParam?.product_line?.length) {
|
||||||
state.totalParam.org_number = state.totalParam.product_line_name.join(",");
|
state.totalParam.product_line = state.totalParam.product_line.join(",");
|
||||||
}
|
}
|
||||||
//客户名称
|
//客户名称
|
||||||
if (Array.isArray(state.totalParam?.customer_number) && state.totalParam?.customer_number?.length) {
|
if (Array.isArray(state.totalParam?.customer_number) && state.totalParam?.customer_number?.length) {
|
||||||
@@ -63,10 +63,33 @@ export const useTable = (
|
|||||||
state.totalParam.subscriber_name = state.totalParam?.subscriber_name.replace(/[,,]/g, ",");
|
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(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//删除临时参数和空值参数
|
//删除临时参数和空值参数
|
||||||
const deleteParams = () => {
|
const deleteParams = () => {
|
||||||
const KEY = ["Time", "customer_number1"];
|
const KEY = ["Time", "customer_number1", "customer_numbers"];
|
||||||
for (let key in state.totalParam) {
|
for (let key in state.totalParam) {
|
||||||
if (KEY.includes(key) || !state.totalParam[key]) {
|
if (KEY.includes(key) || !state.totalParam[key]) {
|
||||||
delete state.totalParam[key];
|
delete state.totalParam[key];
|
||||||
@@ -79,16 +102,16 @@ export const useTable = (
|
|||||||
*/
|
*/
|
||||||
const getTableList = async () => {
|
const getTableList = async () => {
|
||||||
if (!api) return;
|
if (!api) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
initSubscribeData();
|
await initSubscribeData();
|
||||||
deleteParams();
|
await deleteParams();
|
||||||
|
state.tableData = [];
|
||||||
let params = {
|
let params = {
|
||||||
...state.totalParam,
|
...state.totalParam,
|
||||||
...pageParam.value
|
...pageParam.value
|
||||||
};
|
};
|
||||||
const { data } = await api(params);
|
const { data } = await api(params);
|
||||||
state.tableData = data.data || [];
|
state.tableData = Array.isArray(data.data) && data.data.length ? data.data : [];
|
||||||
clearSelection && clearSelection();
|
clearSelection && clearSelection();
|
||||||
if (isPageable && data.total_size !== undefined) {
|
if (isPageable && data.total_size !== undefined) {
|
||||||
updatePageable({
|
updatePageable({
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<!-- <el-icon v-show="item.meta.icon && globalStore.breadcrumbIcon" class="breadcrumb-icon">
|
<!-- <el-icon v-show="item.meta.icon && globalStore.breadcrumbIcon" class="breadcrumb-icon">
|
||||||
<component :is="item.meta.icon"></component>
|
<component :is="item.meta.icon"></component>
|
||||||
</el-icon> -->
|
</el-icon> -->
|
||||||
|
<!-- {{ breadcrumbList }} -->
|
||||||
<span class="breadcrumb-title">{{ item.meta.title }}</span>
|
<span class="breadcrumb-title">{{ item.meta.title }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
@@ -28,13 +28,28 @@ const route = useRoute();
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
const globalStore = useGlobalStore();
|
const globalStore = useGlobalStore();
|
||||||
|
// const routeName: any = ref(router.currentRoute.value.name);
|
||||||
const breadcrumbList = computed(() => {
|
const breadcrumbList = computed(() => {
|
||||||
let breadcrumbData = authStore.breadcrumbListGet[route.matched[route.matched.length - 1].path] ?? [];
|
let breadcrumbData = authStore.breadcrumbListGet[route.matched[route.matched.length - 1].path] ?? [];
|
||||||
// 🙅♀️不需要首页面包屑可删除以下判断
|
// 🙅♀️不需要首页面包屑可删除以下判断
|
||||||
if (breadcrumbData[0].path !== HOME_URL) {
|
if (breadcrumbData[0].path !== HOME_URL) {
|
||||||
breadcrumbData = [{ path: HOME_URL, meta: { icon: "HomeFilled", title: "首页" } }, ...breadcrumbData];
|
breadcrumbData = [{ path: HOME_URL, meta: { icon: "HomeFilled", title: "首页" } }, ...breadcrumbData];
|
||||||
}
|
}
|
||||||
|
if (route.query.title === "新增订阅" || "编辑订阅") {
|
||||||
|
breadcrumbData.forEach((item: any) => {
|
||||||
|
if (item.name === "foundationSubscribeListAdd") {
|
||||||
|
item.meta.title = route.query.title;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (route.query.title === "新增仓位找货优先级" || "编辑仓位找货优先级") {
|
||||||
|
breadcrumbData.forEach((item: any) => {
|
||||||
|
if (item.name === "foundationSetGoodsAdd") {
|
||||||
|
item.meta.title = route.query.title;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return breadcrumbData;
|
return breadcrumbData;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,9 @@ watch(
|
|||||||
() => {
|
() => {
|
||||||
if (route.meta.isFull) return;
|
if (route.meta.isFull) return;
|
||||||
tabsMenuValue.value = route.fullPath;
|
tabsMenuValue.value = route.fullPath;
|
||||||
|
|
||||||
let title: any = route.query.title ? route.query.title : route.meta.title;
|
let title: any = route.query.title ? route.query.title : route.meta.title;
|
||||||
|
|
||||||
const tabsParams = {
|
const tabsParams = {
|
||||||
icon: route.meta.icon as string,
|
icon: route.meta.icon as string,
|
||||||
title: title,
|
title: title,
|
||||||
@@ -63,6 +65,7 @@ watch(
|
|||||||
name: route.name as string,
|
name: route.name as string,
|
||||||
close: !route.meta.isAffix
|
close: !route.meta.isAffix
|
||||||
};
|
};
|
||||||
|
|
||||||
tabStore.addTabs(tabsParams);
|
tabStore.addTabs(tabsParams);
|
||||||
route.meta.isKeepAlive && keepAliveStore.addKeepAliveName(route.name as string);
|
route.meta.isKeepAlive && keepAliveStore.addKeepAliveName(route.name as string);
|
||||||
},
|
},
|
||||||
@@ -107,13 +110,12 @@ const tabClick = (tabItem: TabsPaneContext) => {
|
|||||||
|
|
||||||
// Remove Tab
|
// Remove Tab
|
||||||
const tabRemove = (fullPath: TabPaneName) => {
|
const tabRemove = (fullPath: TabPaneName) => {
|
||||||
if (fullPath === "/index") {
|
const name = tabStore.tabsMenuList.filter(item => item.path == fullPath)[0].name || "";
|
||||||
|
|
||||||
|
if (fullPath === "/index" || name === "home") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// const name = tabStore.tabsMenuList.filter(item => item.path == fullPath)[0].name || "";
|
|
||||||
// keepAliveStore.removeKeepAliveName(name);
|
|
||||||
// tabStore.removeTabs(fullPath as string, fullPath == route.fullPath);
|
|
||||||
const name = tabStore.tabsMenuList.filter(item => item.path == fullPath)[0].name || "";
|
|
||||||
tabStore.removeTabs(fullPath as string, fullPath == route.fullPath);
|
tabStore.removeTabs(fullPath as string, fullPath == route.fullPath);
|
||||||
let isKeepAlive = tabStore.tabsMenuList.some((item: any) => {
|
let isKeepAlive = tabStore.tabsMenuList.some((item: any) => {
|
||||||
return item.name === name;
|
return item.name === name;
|
||||||
|
|||||||
10
src/main.ts
10
src/main.ts
@@ -32,6 +32,16 @@ import pinia from "@/stores";
|
|||||||
import errorHandler from "@/utils/errorHandler";
|
import errorHandler from "@/utils/errorHandler";
|
||||||
import VXETable from "vxe-table";
|
import VXETable from "vxe-table";
|
||||||
import "vxe-table/lib/style.css";
|
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);
|
localStorage.setItem("baseUrl", import.meta.env.VITE_SINGLE_URL);
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|||||||
@@ -38,10 +38,11 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
|
|
||||||
// 1.NProgress 开始
|
// 1.NProgress 开始
|
||||||
NProgress.start();
|
NProgress.start();
|
||||||
|
const currentPath = window.location.pathname;
|
||||||
// 2.动态设置标题
|
// 2.动态设置标题
|
||||||
const title = import.meta.env.VITE_GLOB_APP_TITLE;
|
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 重置路由到登陆页
|
// 3.判断是访问登陆页,有 Token 就在当前页面,没有 Token 重置路由到登陆页
|
||||||
if (to.path.toLocaleLowerCase() === LOGIN_URL) {
|
if (to.path.toLocaleLowerCase() === LOGIN_URL) {
|
||||||
if (userStore.newUserToken) return next(from.fullPath);
|
if (userStore.newUserToken) return next(from.fullPath);
|
||||||
@@ -51,6 +52,17 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
|
|
||||||
// 4.判断访问页面是否在路由白名单地址(静态路由)中,如果存在直接放行
|
// 4.判断访问页面是否在路由白名单地址(静态路由)中,如果存在直接放行
|
||||||
if (ROUTER_WHITE_LIST.includes(to.path)) return next();
|
if (ROUTER_WHITE_LIST.includes(to.path)) return next();
|
||||||
|
// 4.判断访问页面是否在路由白名单地址(静态路由)中,如果存在直接放行
|
||||||
|
if (ROUTER_WHITE_LIST.includes(to.path)) return next();
|
||||||
|
|
||||||
|
// 如果没有token但是有订阅路由就将订阅路由当参数携带
|
||||||
|
if (!userStore.newUserToken && currentPath === "/foundation/subscribe/warehousing/index") {
|
||||||
|
return next({
|
||||||
|
path: LOGIN_URL,
|
||||||
|
replace: true,
|
||||||
|
query: { redirect_path: currentPath } // 通过query传递参数
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 5.判断是否有 Token,没有重定向到 login 页面
|
// 5.判断是否有 Token,没有重定向到 login 页面
|
||||||
if (!userStore.newUserToken) return next({ path: LOGIN_URL, replace: true });
|
if (!userStore.newUserToken) return next({ path: LOGIN_URL, replace: true });
|
||||||
|
|||||||
@@ -10,4 +10,5 @@ export interface TabsMenuProps {
|
|||||||
/* TabsState */
|
/* TabsState */
|
||||||
export interface TabsState {
|
export interface TabsState {
|
||||||
tabsMenuList: TabsMenuProps[];
|
tabsMenuList: TabsMenuProps[];
|
||||||
|
isSubscribeAdd: Boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,10 +65,10 @@ export const useAuthStore = defineStore({
|
|||||||
// 获取权限菜单列表并处理按钮权限
|
// 获取权限菜单列表并处理按钮权限
|
||||||
async getAuthMenuList() {
|
async getAuthMenuList() {
|
||||||
const { data } = await getAuthMenuListApi();
|
const { data } = await getAuthMenuListApi();
|
||||||
let dataClone = data;
|
let dataClone =
|
||||||
|
Array.isArray(data) && data.length
|
||||||
// 如果没有路由数据,设置默认首页
|
? data
|
||||||
this.authMenuList = dataClone || [
|
: [
|
||||||
{
|
{
|
||||||
path: "/index",
|
path: "/index",
|
||||||
name: "home",
|
name: "home",
|
||||||
@@ -83,6 +83,9 @@ export const useAuthStore = defineStore({
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// 如果没有路由数据,设置默认首页
|
||||||
|
this.authMenuList = dataClone;
|
||||||
|
|
||||||
// 提取按钮权限
|
// 提取按钮权限
|
||||||
this.buttonPermissions = extractButtonPermissions(this.authMenuList);
|
this.buttonPermissions = extractButtonPermissions(this.authMenuList);
|
||||||
// 构建页面与按钮的映射关系
|
// 构建页面与按钮的映射关系
|
||||||
@@ -92,7 +95,6 @@ export const useAuthStore = defineStore({
|
|||||||
// 构建页面与按钮的映射关系
|
// 构建页面与按钮的映射关系
|
||||||
buildPageButtonMap() {
|
buildPageButtonMap() {
|
||||||
const pageButtonMap: PageButtonMap = {};
|
const pageButtonMap: PageButtonMap = {};
|
||||||
|
|
||||||
// 递归处理路由,建立页面与按钮的关联
|
// 递归处理路由,建立页面与按钮的关联
|
||||||
const processRoutes = (routes: any[], parentPageName?: string) => {
|
const processRoutes = (routes: any[], parentPageName?: string) => {
|
||||||
routes.forEach((route: any) => {
|
routes.forEach((route: any) => {
|
||||||
@@ -102,7 +104,6 @@ export const useAuthStore = defineStore({
|
|||||||
if (!pageButtonMap[route.name]) {
|
if (!pageButtonMap[route.name]) {
|
||||||
pageButtonMap[route.name] = [];
|
pageButtonMap[route.name] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理子节点中的按钮权限
|
// 处理子节点中的按钮权限
|
||||||
if (route.children && route.children.length > 0) {
|
if (route.children && route.children.length > 0) {
|
||||||
route.children.forEach((child: any) => {
|
route.children.forEach((child: any) => {
|
||||||
@@ -123,9 +124,7 @@ export const useAuthStore = defineStore({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
processRoutes(this.authMenuList);
|
processRoutes(this.authMenuList);
|
||||||
console.log(pageButtonMap, "=pageButtonMap=");
|
|
||||||
this.pageButtonMap = pageButtonMap;
|
this.pageButtonMap = pageButtonMap;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -6,16 +6,86 @@ import piniaPersistConfig from "@/config/piniaPersist";
|
|||||||
export const useTabsStore = defineStore({
|
export const useTabsStore = defineStore({
|
||||||
id: "wms-tabs",
|
id: "wms-tabs",
|
||||||
state: (): TabsState => ({
|
state: (): TabsState => ({
|
||||||
tabsMenuList: []
|
isSubscribeAdd: false,
|
||||||
|
tabsMenuList: [
|
||||||
|
{
|
||||||
|
icon: "", // 首页的icon,按实际路由meta.icon填写(如"Home")
|
||||||
|
title: "首页", // 固定首页标题
|
||||||
|
path: "/index", // 首页的基础路径(无参数版本,避免初始参数冗余)
|
||||||
|
name: "home", // 必须与首页路由的name一致(如路由定义中name: "home")
|
||||||
|
close: true // 首页是否可关闭,按业务需求设置(通常true,若禁止关闭设为false)
|
||||||
|
}
|
||||||
|
]
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
// Add Tabs
|
|
||||||
async addTabs(tabItem: any) {
|
async addTabs(tabItem: any) {
|
||||||
if (this.tabsMenuList.every(item => item.path !== tabItem.path)) {
|
// 1. 校验参数:首页必须有 name,其他标签必须有 path
|
||||||
|
if ((tabItem.name === "home" && !tabItem.name) || (!tabItem.name && !tabItem.path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 区分首页和普通标签的去重逻辑
|
||||||
|
let isExist = false;
|
||||||
|
if (tabItem.name === "home") {
|
||||||
|
// 首页:按 name 去重(确保唯一)
|
||||||
|
isExist = this.tabsMenuList.some(item => item.name === "home");
|
||||||
|
} else {
|
||||||
|
// 普通标签:按完整 path 去重(区分参数)
|
||||||
|
isExist = this.tabsMenuList.some(item => item.path === tabItem.path);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isExist) {
|
||||||
|
// 3. 首页放首位,其他放末尾
|
||||||
|
if (tabItem.name === "home") {
|
||||||
|
// 先移除旧首页(防止重复),再添加到最前
|
||||||
|
this.tabsMenuList = this.tabsMenuList.filter(item => item.name !== "home");
|
||||||
|
this.tabsMenuList.unshift(tabItem);
|
||||||
|
} else {
|
||||||
this.tabsMenuList.push(tabItem);
|
this.tabsMenuList.push(tabItem);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// 4. 已存在时更新信息
|
||||||
|
this.tabsMenuList = this.tabsMenuList.map(item => {
|
||||||
|
if (tabItem.name === "home" && item.name === "home") {
|
||||||
|
// 首页:更新 path 等信息(如首页参数变化)
|
||||||
|
return { ...item, path: tabItem.path };
|
||||||
|
} else if (item.path === tabItem.path) {
|
||||||
|
// 普通标签:全量更新(如标题、参数)
|
||||||
|
return { ...item, ...tabItem };
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// Remove Tabs
|
// // Add Tabs:按 name 去重,首页始终在最前
|
||||||
|
// async addTabs(tabItem: any) {
|
||||||
|
// // 1. 校验参数:确保 tabItem 有 name(避免异常数据)
|
||||||
|
// if (!tabItem.name) return;
|
||||||
|
|
||||||
|
// // 2. 去重逻辑:按 name 判断是否已存在
|
||||||
|
// const isExist = this.tabsMenuList.some(item => item.name === tabItem.name);
|
||||||
|
|
||||||
|
// if (!isExist) {
|
||||||
|
// // 3. 首页(name: "home")添加到数组开头,其他标签添加到末尾
|
||||||
|
// if (tabItem.name === "home") {
|
||||||
|
// // 先移除旧的首页(防止极端情况残留),再添加新首页到最前
|
||||||
|
// this.tabsMenuList = this.tabsMenuList.filter(item => item.name !== "home");
|
||||||
|
// this.tabsMenuList.unshift(tabItem); // 首页放第一位
|
||||||
|
// } else {
|
||||||
|
// this.tabsMenuList.push(tabItem); // 非首页放末尾
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// // 4. 可选优化:若标签已存在,同步更新其 path(如首页参数变化时)
|
||||||
|
// this.tabsMenuList = this.tabsMenuList.map(item => {
|
||||||
|
// if (item.name === tabItem.name) {
|
||||||
|
// return { ...item, path: tabItem.path }; // 仅更新 path,保留其他属性
|
||||||
|
// }
|
||||||
|
// return item;
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
|
||||||
|
// Remove Tabs(原有逻辑不变,无需修改)
|
||||||
async removeTabs(tabPath: string, isCurrent: boolean = true) {
|
async removeTabs(tabPath: string, isCurrent: boolean = true) {
|
||||||
const tabsMenuList = this.tabsMenuList;
|
const tabsMenuList = this.tabsMenuList;
|
||||||
if (isCurrent) {
|
if (isCurrent) {
|
||||||
@@ -28,22 +98,46 @@ export const useTabsStore = defineStore({
|
|||||||
}
|
}
|
||||||
this.tabsMenuList = tabsMenuList.filter(item => item.path !== tabPath);
|
this.tabsMenuList = tabsMenuList.filter(item => item.path !== tabPath);
|
||||||
},
|
},
|
||||||
// Close MultipleTab
|
|
||||||
|
// Close MultipleTab(原有逻辑不变)
|
||||||
async closeMultipleTab(tabsMenuValue?: string) {
|
async closeMultipleTab(tabsMenuValue?: string) {
|
||||||
this.tabsMenuList = this.tabsMenuList.filter(item => {
|
this.tabsMenuList = this.tabsMenuList.filter(item => {
|
||||||
return item.path === tabsMenuValue || !item.close;
|
return item.path === tabsMenuValue || !item.close;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// Set Tabs
|
|
||||||
|
// Set Tabs(原有逻辑不变)
|
||||||
async setTabs(tabsMenuList: any[]) {
|
async setTabs(tabsMenuList: any[]) {
|
||||||
this.tabsMenuList = tabsMenuList;
|
// 补充:设置 tabs 时也需去重,避免批量设置时带入重复首页
|
||||||
|
const uniqueTabs = [];
|
||||||
|
const nameSet = new Set();
|
||||||
|
// 先处理首页,确保在最前
|
||||||
|
const homeTab = tabsMenuList.find(item => item.name === "home");
|
||||||
|
if (homeTab) {
|
||||||
|
uniqueTabs.push(homeTab);
|
||||||
|
nameSet.add("home");
|
||||||
|
}
|
||||||
|
// 再处理其他标签,去重
|
||||||
|
tabsMenuList.forEach(tab => {
|
||||||
|
if (!nameSet.has(tab.name)) {
|
||||||
|
nameSet.add(tab.name);
|
||||||
|
uniqueTabs.push(tab);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.tabsMenuList = uniqueTabs;
|
||||||
},
|
},
|
||||||
// Set Tabs Title
|
|
||||||
|
// Set Tabs Title(原有逻辑不变)
|
||||||
async setTabsTitle(title: string) {
|
async setTabsTitle(title: string) {
|
||||||
|
console.log("12332323");
|
||||||
const nowFullPath = location.hash.substring(1);
|
const nowFullPath = location.hash.substring(1);
|
||||||
this.tabsMenuList.forEach(item => {
|
this.tabsMenuList.forEach(item => {
|
||||||
if (item.path == nowFullPath) item.title = title;
|
if (item.path == nowFullPath) item.title = title;
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
async setSIsSubscribeAdd(is: any) {
|
||||||
|
console.log(is, "==========is========");
|
||||||
|
this.isSubscribeAdd = is;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
persist: piniaPersistConfig("wms-tabs")
|
persist: piniaPersistConfig("wms-tabs")
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export const FORM_DATA: any[] = [
|
|||||||
label: "导出失败"
|
label: "导出失败"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 0,
|
value: "正在导出",
|
||||||
label: "正在导出"
|
label: "正在导出"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,13 +2,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="table-box">
|
<div class="table-box">
|
||||||
<ProTable
|
<ProTable
|
||||||
ref="proTable"
|
ref="proTableRef"
|
||||||
:formData="dataStore.formData"
|
:formData="dataStore.formData"
|
||||||
:columns="dataStore.columns"
|
:columns="dataStore.columns"
|
||||||
:request-api="getListApi"
|
:request-api="getListApi"
|
||||||
:init-param="dataStore.initParam"
|
: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">
|
<template #status_text="scope">
|
||||||
<span v-if="scope.row.status_text === '导出成功'" style="color: #3ad6ac">
|
<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 { RULE_FORM, FORM_DATA, COLUMNS } from "./constant/list/index";
|
||||||
import { cloneDeep } from "lodash-es";
|
import { cloneDeep } from "lodash-es";
|
||||||
|
|
||||||
const proTable = ref<any>();
|
const proTableRef = ref<any>();
|
||||||
// 数据源
|
// 数据源
|
||||||
const dataStore: any = reactive({
|
const dataStore: any = reactive({
|
||||||
columns: COLUMNS, //列表配置项
|
columns: COLUMNS, //列表配置项
|
||||||
@@ -74,6 +81,24 @@ const getExportTypes = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
getExportTypes();
|
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>
|
</script>
|
||||||
<style scope lang="scss">
|
<style scope lang="scss">
|
||||||
.main-container {
|
.main-container {
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
export const BUTTON = [
|
|
||||||
{
|
|
||||||
text: "导出",
|
|
||||||
permission: "reportManagementInstantBtnExport",
|
|
||||||
type: "export"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
interface FormItem {
|
|
||||||
prop: string;
|
|
||||||
label?: string;
|
|
||||||
placeholder?: string;
|
|
||||||
type: string;
|
|
||||||
isCopy?: boolean;
|
|
||||||
optionProps?: any;
|
|
||||||
startPlaceholder?: string;
|
|
||||||
endPlaceholder?: string;
|
|
||||||
options?: any;
|
|
||||||
isArray?: boolean;
|
|
||||||
startDate?: string; //开始时间(传入后台需要的参数)
|
|
||||||
endDate?: string; //结束时间(传入后台需要的参数)
|
|
||||||
startProp?: string;
|
|
||||||
endProp?: string;
|
|
||||||
isInteger?: boolean;
|
|
||||||
}
|
|
||||||
export const FORM_DATA: FormItem[] = [
|
|
||||||
{
|
|
||||||
prop: "securityNumbers",
|
|
||||||
placeholder: "请输入来源单号",
|
|
||||||
type: "input",
|
|
||||||
isArray: true,
|
|
||||||
label: "来源单号: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "lotNumbers",
|
|
||||||
placeholder: "请选择供应商",
|
|
||||||
type: "select",
|
|
||||||
isArray: true,
|
|
||||||
label: "供应商: ",
|
|
||||||
options: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "securityNumbers",
|
|
||||||
placeholder: "请输入质检人",
|
|
||||||
type: "input",
|
|
||||||
isArray: true,
|
|
||||||
label: "质检人: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "Time",
|
|
||||||
type: "daterange",
|
|
||||||
options: [],
|
|
||||||
startPlaceholder: "质检开始日期",
|
|
||||||
endPlaceholder: "质检结束日期",
|
|
||||||
startDate: "createBeginDate",
|
|
||||||
endDate: "createEndDate",
|
|
||||||
label: "质检时间: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "lotNumbers",
|
|
||||||
placeholder: "请选择组织",
|
|
||||||
type: "select",
|
|
||||||
isArray: true,
|
|
||||||
label: "组织: "
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
prop: "materialNumber",
|
|
||||||
placeholder: "请输入規格型号",
|
|
||||||
type: "selectRemote1",
|
|
||||||
isArray: true,
|
|
||||||
options: [],
|
|
||||||
label: "物料编码: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "lotNumbers",
|
|
||||||
placeholder: "请选择质检状态",
|
|
||||||
type: "select",
|
|
||||||
isArray: true,
|
|
||||||
label: "质检状态: "
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
export const RULE_FORM = {
|
|
||||||
page: 1,
|
|
||||||
size: 50,
|
|
||||||
orgCode: 0
|
|
||||||
};
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
export const COLUMNS = [
|
|
||||||
{ type: "selection", fixed: "left", width: 40 },
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
fixed: true,
|
|
||||||
label: "质检单",
|
|
||||||
prop: "securityNumber",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "质检状态",
|
|
||||||
prop: "id",
|
|
||||||
width: 160
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "销售订单号",
|
|
||||||
prop: "specifications",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "来源单号",
|
|
||||||
prop: "createTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "下载次数",
|
|
||||||
prop: "downLoadNumber",
|
|
||||||
width: 80
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "质检类型",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "供应商",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "组织",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "规格型号",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "物料编码",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "物料名称",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "应质检数量",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "良品数",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "次品数",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "质检人",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "质检时间",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "创建时间",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
}
|
|
||||||
];
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
<!-- 质检单 -->
|
|
||||||
<template>
|
|
||||||
<div class="table-box">
|
|
||||||
<div style="padding-bottom: 16px">
|
|
||||||
<PermissionButton
|
|
||||||
:buttons="dataStore.buttons"
|
|
||||||
@handleButtonClickCallback="handleButtonClickCallback"
|
|
||||||
></PermissionButton>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ProTable
|
|
||||||
ref="proTable"
|
|
||||||
:formData="dataStore.formData"
|
|
||||||
:columns="dataStore.columns"
|
|
||||||
:request-api="getMaterialListApi"
|
|
||||||
:init-param="dataStore.initParam"
|
|
||||||
@selectionChange="selectionChange"
|
|
||||||
:orgCode="dataStore.ruleForm.orgCode"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts" name="foundationSetData">
|
|
||||||
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 { 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>();
|
|
||||||
|
|
||||||
// 获取用户信息(组织id)
|
|
||||||
const userStore = useUserStore();
|
|
||||||
// 数据源
|
|
||||||
const dataStore = reactive<any>({
|
|
||||||
columns: COLUMNS, //列表配置项
|
|
||||||
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
|
||||||
ruleForm: cloneDeep(RULE_FORM), // 搜索条件
|
|
||||||
formData: FORM_DATA, //搜索配置项
|
|
||||||
buttons: cloneDeep(BUTTON),
|
|
||||||
options: [], //规格型号
|
|
||||||
selectionList: [], //选中表格的行
|
|
||||||
loading: false
|
|
||||||
});
|
|
||||||
|
|
||||||
// 表格选择事件
|
|
||||||
const selectionChange = (selection: any) => {
|
|
||||||
dataStore.selectionList = selection;
|
|
||||||
};
|
|
||||||
const handleButtonClickCallback = (item: any) => {
|
|
||||||
const { type } = item;
|
|
||||||
btnClick[type](item);
|
|
||||||
};
|
|
||||||
// // 规格型号
|
|
||||||
// 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;
|
|
||||||
// };
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => userStore.orgCode,
|
|
||||||
newVal => {
|
|
||||||
dataStore.ruleForm.orgCode = newVal;
|
|
||||||
dataStore.initParam.orgCode = newVal;
|
|
||||||
},
|
|
||||||
{
|
|
||||||
immediate: true,
|
|
||||||
deep: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scope lang="scss">
|
|
||||||
.down-dialog-box {
|
|
||||||
.el-dialog__body {
|
|
||||||
padding: 0 16px 40px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
// 直接导出函数,无需额外包装对象
|
|
||||||
export const handleExport = (item: any) => {
|
|
||||||
console.log("导出操作", item);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handleRefresh = (item: any) => {
|
|
||||||
console.log("刷新操作", item);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const btnClick: any = {
|
|
||||||
export: handleExport,
|
|
||||||
refresh: handleRefresh
|
|
||||||
};
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
import { btnClick } from "./btnClick";
|
|
||||||
export { btnClick };
|
|
||||||
227
src/views/foundation/set/goods/add.vue
Normal file
227
src/views/foundation/set/goods/add.vue
Normal file
@@ -0,0 +1,227 @@
|
|||||||
|
<template>
|
||||||
|
<div class="table-box">
|
||||||
|
<div style="padding-bottom: 16px">
|
||||||
|
<PermissionButton
|
||||||
|
:buttons="dataStore.buttons"
|
||||||
|
@handleButtonClickCallback="handleButtonClickCallback"
|
||||||
|
></PermissionButton>
|
||||||
|
</div>
|
||||||
|
<div class="card table-main">
|
||||||
|
<DetailsSearch
|
||||||
|
:formData="dataStore.formData"
|
||||||
|
:ruleForm="dataStore.ruleForm"
|
||||||
|
:labelWidth="dataStore.labelWidth"
|
||||||
|
:inline="true"
|
||||||
|
ref="detailsRef"
|
||||||
|
@selectChange="handleChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="foundationSetGoodsAdd">
|
||||||
|
import { BUTTON } from "./constant/list/addButton";
|
||||||
|
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),
|
||||||
|
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 = (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 [];
|
||||||
|
}
|
||||||
|
// 方法1:Map 实现(高效,保留顺序)
|
||||||
|
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>
|
||||||
33
src/views/foundation/set/goods/constant/list/add.ts
Normal file
33
src/views/foundation/set/goods/constant/list/add.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
export const DETAILS_FORM_DATA: any[] = [
|
||||||
|
{
|
||||||
|
prop: "use_org_number",
|
||||||
|
placeholder: "请选择",
|
||||||
|
type: "select",
|
||||||
|
label: "组织:",
|
||||||
|
disabled: false,
|
||||||
|
required: true,
|
||||||
|
class: "form-item1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "warehouse_number",
|
||||||
|
placeholder: "请选择",
|
||||||
|
type: "select",
|
||||||
|
label: "仓库:",
|
||||||
|
disabled: false,
|
||||||
|
required: true,
|
||||||
|
class: "form-item1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "pos_picking_priority",
|
||||||
|
placeholder: "请输入",
|
||||||
|
type: "textarea",
|
||||||
|
label: "仓位:",
|
||||||
|
disabled: false,
|
||||||
|
required: true,
|
||||||
|
class: "form-item1",
|
||||||
|
maxLength: 5000
|
||||||
|
}
|
||||||
|
];
|
||||||
|
export const DETAILS_RULE_FORM: any = {
|
||||||
|
use_org_number: "101"
|
||||||
|
};
|
||||||
20
src/views/foundation/set/goods/constant/list/addButton.ts
Normal file
20
src/views/foundation/set/goods/constant/list/addButton.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
export const BUTTON = [
|
||||||
|
{
|
||||||
|
text: "保存",
|
||||||
|
permission: "foundationSetGoodsAddBtnSave",
|
||||||
|
type: "save",
|
||||||
|
props: {
|
||||||
|
type: "primary"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "预览(请先保存)",
|
||||||
|
permission: "foundationSetGoodsAddBtnPreview",
|
||||||
|
type: "preview"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "返回",
|
||||||
|
permission: "foundationSetGoodsAddBtnRreturn",
|
||||||
|
type: "return"
|
||||||
|
}
|
||||||
|
];
|
||||||
10
src/views/foundation/set/goods/constant/list/button.ts
Normal file
10
src/views/foundation/set/goods/constant/list/button.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export const BUTTON = [
|
||||||
|
{
|
||||||
|
text: "新增",
|
||||||
|
permission: "foundationSetGoodsBtnAdd",
|
||||||
|
type: "add",
|
||||||
|
props: {
|
||||||
|
type: "primary"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
31
src/views/foundation/set/goods/constant/list/search.ts
Normal file
31
src/views/foundation/set/goods/constant/list/search.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
interface FormItem {
|
||||||
|
prop: string;
|
||||||
|
label?: string;
|
||||||
|
placeholder?: string;
|
||||||
|
type: string;
|
||||||
|
isCopy?: boolean;
|
||||||
|
optionProps?: any;
|
||||||
|
startPlaceholder?: string;
|
||||||
|
endPlaceholder?: string;
|
||||||
|
options?: any;
|
||||||
|
isArray?: boolean;
|
||||||
|
startDate?: string; //开始时间(传入后台需要的参数)
|
||||||
|
endDate?: string; //结束时间(传入后台需要的参数)
|
||||||
|
startProp?: string;
|
||||||
|
endProp?: string;
|
||||||
|
isInteger?: boolean;
|
||||||
|
}
|
||||||
|
export const FORM_DATA: FormItem[] = [
|
||||||
|
{
|
||||||
|
prop: "warehouse_number",
|
||||||
|
placeholder: "请输入仓库",
|
||||||
|
type: "select",
|
||||||
|
label: "仓库: ",
|
||||||
|
options: []
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export const RULE_FORM = {
|
||||||
|
page: 1,
|
||||||
|
size: 50
|
||||||
|
};
|
||||||
33
src/views/foundation/set/goods/constant/list/table.ts
Normal file
33
src/views/foundation/set/goods/constant/list/table.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
// import { RenderScope } from "@/components/ProTable/interface";
|
||||||
|
export const COLUMNS = [
|
||||||
|
{ type: "selection", fixed: "left", width: 40 },
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
fixed: true,
|
||||||
|
label: "仓库名称",
|
||||||
|
prop: "warehouse_name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
fixed: true,
|
||||||
|
label: "组织",
|
||||||
|
prop: "use_org_name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "仓库优先级",
|
||||||
|
prop: "pos_picking_priority"
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "更新人",
|
||||||
|
prop: "operator_name"
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "更新时间",
|
||||||
|
prop: "updated_at"
|
||||||
|
}
|
||||||
|
];
|
||||||
123
src/views/foundation/set/goods/index.vue
Normal file
123
src/views/foundation/set/goods/index.vue
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
<!-- 仓位找货优先级 -->
|
||||||
|
<template>
|
||||||
|
<div class="table-box">
|
||||||
|
<div style="padding-bottom: 16px">
|
||||||
|
<PermissionButton
|
||||||
|
:buttons="dataStore.buttons"
|
||||||
|
@handleButtonClickCallback="handleButtonClickCallback"
|
||||||
|
></PermissionButton>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ProTable
|
||||||
|
ref="proTableRef"
|
||||||
|
:columns="dataStore.columns"
|
||||||
|
:request-api="getGoodsListApi"
|
||||||
|
:init-param="dataStore.initParam"
|
||||||
|
@selectionChange="selectionChange"
|
||||||
|
>
|
||||||
|
<template v-slot:search>
|
||||||
|
<SearchForm
|
||||||
|
@search="handleSearch"
|
||||||
|
@reset="handleReset"
|
||||||
|
:searchParams="dataStore.initParam"
|
||||||
|
: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>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="foundationSetGoods">
|
||||||
|
import ProTable from "@/components/ProTable/index.vue";
|
||||||
|
import SearchForm from "@/components/SearchForm/index.vue";
|
||||||
|
import PermissionButton from "@/components/PermissionButton/index.vue";
|
||||||
|
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
|
||||||
|
import { ProTableInstance } from "@/components/ProTable/interface";
|
||||||
|
|
||||||
|
// 深拷贝方法
|
||||||
|
import { cloneDeep } from "lodash-es";
|
||||||
|
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||||
|
const proTableRef = ref<ProTableInstance>();
|
||||||
|
const $router = useRouter();
|
||||||
|
// 数据源
|
||||||
|
const dataStore = reactive<any>({
|
||||||
|
columns: COLUMNS, //列表配置项
|
||||||
|
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
||||||
|
formData: FORM_DATA, //搜索配置项
|
||||||
|
buttons: cloneDeep(BUTTON),
|
||||||
|
labelWidth: "120px",
|
||||||
|
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", 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);
|
||||||
|
//这里需要等到表格刷新以后才去请求
|
||||||
|
nextTick(() => {
|
||||||
|
proTableRef?.value!.getTableList();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 重置
|
||||||
|
const handleReset = () => {
|
||||||
|
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||||
|
//这里需要等到表格刷新以后才去请求
|
||||||
|
nextTick(() => {
|
||||||
|
proTableRef?.value!.getTableList();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
$Bus.on("setGoodsResetList", () => {
|
||||||
|
nextTick(() => {
|
||||||
|
proTableRef?.value!.getTableList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scope lang="scss">
|
||||||
|
.down-dialog-box {
|
||||||
|
.el-dialog__body {
|
||||||
|
padding: 0 16px 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-dialog .el-dialog__header {
|
||||||
|
padding: 8px 0;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
54
src/views/foundation/set/goods/preview.vue
Normal file
54
src/views/foundation/set/goods/preview.vue
Normal 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>
|
||||||
@@ -34,6 +34,22 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
placeholder: "请输入品线",
|
placeholder: "请输入品线",
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "品线: "
|
label: "品线: "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "disabled",
|
||||||
|
placeholder: "请选择",
|
||||||
|
type: "select",
|
||||||
|
label: "物料状态: ",
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: "禁用"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "启用",
|
||||||
|
label: "启用"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { RenderScope } from "@/components/ProTable/interface";
|
||||||
export const COLUMNS = [
|
export const COLUMNS = [
|
||||||
{ type: "selection", fixed: "left", width: 40 },
|
{ type: "selection", fixed: "left", width: 40 },
|
||||||
{
|
{
|
||||||
@@ -69,5 +70,24 @@ export const COLUMNS = [
|
|||||||
label: "SPU",
|
label: "SPU",
|
||||||
prop: "spu",
|
prop: "spu",
|
||||||
width: 200
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "物料状态",
|
||||||
|
prop: "disabled",
|
||||||
|
width: 200,
|
||||||
|
render: (scope: RenderScope<any>): VNode | string | any => {
|
||||||
|
const OBJ: any = {
|
||||||
|
0: "启用",
|
||||||
|
1: "禁用"
|
||||||
|
};
|
||||||
|
return OBJ[scope.row.disabled];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "更新时间",
|
||||||
|
prop: "updated_at",
|
||||||
|
width: 200
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!-- 质检单 -->
|
<!-- 物料列表 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="table-box">
|
<div class="table-box">
|
||||||
<div style="padding-bottom: 16px">
|
<div style="padding-bottom: 16px">
|
||||||
@@ -66,7 +66,6 @@ const selectionChange = (selection: any) => {
|
|||||||
};
|
};
|
||||||
const handleButtonClickCallback = (item: any) => {
|
const handleButtonClickCallback = (item: any) => {
|
||||||
const { type } = item;
|
const { type } = item;
|
||||||
// dataStore.selectionList, proTableRef
|
|
||||||
btnClick[type]({
|
btnClick[type]({
|
||||||
selectionList: dataStore.selectionList,
|
selectionList: dataStore.selectionList,
|
||||||
proTableRef,
|
proTableRef,
|
||||||
@@ -79,7 +78,7 @@ const handleSearch = async (params: any) => {
|
|||||||
dataStore.initParam = cloneDeep(params);
|
dataStore.initParam = cloneDeep(params);
|
||||||
//这里需要等到表格刷新以后才去请求
|
//这里需要等到表格刷新以后才去请求
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
proTableRef.value!.getTableList();
|
proTableRef?.value!.getTableList();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
//重置
|
//重置
|
||||||
@@ -87,7 +86,7 @@ const handleReset = () => {
|
|||||||
dataStore.initParam = cloneDeep(RULE_FORM);
|
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||||
//这里需要等到表格刷新以后才去请求
|
//这里需要等到表格刷新以后才去请求
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
proTableRef.value!.getTableList();
|
proTableRef?.value!.getTableList();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export const handleExport = async (params: any) => {
|
|||||||
const { initParam } = params;
|
const { initParam } = params;
|
||||||
const result = await getMaterialListExportApi(initParam);
|
const result = await getMaterialListExportApi(initParam);
|
||||||
if (result?.code === 0) {
|
if (result?.code === 0) {
|
||||||
useMsg("success", "导出成功 !");
|
useMsg("success", "导出成功请前往导出列表中进行下载!");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//刷新
|
//刷新
|
||||||
@@ -25,7 +25,7 @@ export const handleReload = async (params: any) => {
|
|||||||
const result = await getMaterialListReloadApi({ id });
|
const result = await getMaterialListReloadApi({ id });
|
||||||
if (result?.code === 0) {
|
if (result?.code === 0) {
|
||||||
useMsg("success", "数据刷新成功 !");
|
useMsg("success", "数据刷新成功 !");
|
||||||
proTable.value!.getTableList();
|
proTable?.value!.getTableList();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
export const BUTTON = [
|
|
||||||
{
|
|
||||||
text: "导出",
|
|
||||||
permission: "reportManagementBoxInventoryBtnExport",
|
|
||||||
type: "export"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
interface FormItem {
|
|
||||||
prop: string;
|
|
||||||
label?: string;
|
|
||||||
placeholder?: string;
|
|
||||||
type: string;
|
|
||||||
isCopy?: boolean;
|
|
||||||
optionProps?: any;
|
|
||||||
startPlaceholder?: string;
|
|
||||||
endPlaceholder?: string;
|
|
||||||
options?: any;
|
|
||||||
isArray?: boolean;
|
|
||||||
startDate?: string; //开始时间(传入后台需要的参数)
|
|
||||||
endDate?: string; //结束时间(传入后台需要的参数)
|
|
||||||
startProp?: string;
|
|
||||||
endProp?: string;
|
|
||||||
isInteger?: boolean;
|
|
||||||
}
|
|
||||||
export const FORM_DATA: FormItem[] = [
|
|
||||||
{
|
|
||||||
prop: "securityNumbers",
|
|
||||||
placeholder: "请输入来源单号",
|
|
||||||
type: "input",
|
|
||||||
isArray: true,
|
|
||||||
label: "来源单号: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "lotNumbers",
|
|
||||||
placeholder: "请选择供应商",
|
|
||||||
type: "select",
|
|
||||||
isArray: true,
|
|
||||||
label: "供应商: ",
|
|
||||||
options: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "securityNumbers",
|
|
||||||
placeholder: "请输入质检人",
|
|
||||||
type: "input",
|
|
||||||
isArray: true,
|
|
||||||
label: "质检人: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "Time",
|
|
||||||
type: "daterange",
|
|
||||||
options: [],
|
|
||||||
startPlaceholder: "质检开始日期",
|
|
||||||
endPlaceholder: "质检结束日期",
|
|
||||||
startDate: "createBeginDate",
|
|
||||||
endDate: "createEndDate",
|
|
||||||
label: "质检时间: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "lotNumbers",
|
|
||||||
placeholder: "请选择组织",
|
|
||||||
type: "select",
|
|
||||||
isArray: true,
|
|
||||||
label: "组织: "
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
prop: "materialNumber",
|
|
||||||
placeholder: "请输入規格型号",
|
|
||||||
type: "selectRemote1",
|
|
||||||
isArray: true,
|
|
||||||
options: [],
|
|
||||||
label: "物料编码: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "lotNumbers",
|
|
||||||
placeholder: "请选择质检状态",
|
|
||||||
type: "select",
|
|
||||||
isArray: true,
|
|
||||||
label: "质检状态: "
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
export const RULE_FORM = {
|
|
||||||
page: 1,
|
|
||||||
size: 50,
|
|
||||||
orgCode: 0
|
|
||||||
};
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
export const COLUMNS = [
|
|
||||||
{ type: "selection", fixed: "left", width: 40 },
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
fixed: true,
|
|
||||||
label: "质检单",
|
|
||||||
prop: "securityNumber",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "质检状态",
|
|
||||||
prop: "id",
|
|
||||||
width: 160
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "销售订单号",
|
|
||||||
prop: "specifications",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "来源单号",
|
|
||||||
prop: "createTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "下载次数",
|
|
||||||
prop: "downLoadNumber",
|
|
||||||
width: 80
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "质检类型",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "供应商",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "组织",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "规格型号",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "物料编码",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "物料名称",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "应质检数量",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "良品数",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "次品数",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "质检人",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "质检时间",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "创建时间",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
}
|
|
||||||
];
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
<!-- 质检单 -->
|
|
||||||
<template>
|
|
||||||
<div class="table-box">
|
|
||||||
<div style="padding-bottom: 16px">
|
|
||||||
<PermissionButton
|
|
||||||
:buttons="dataStore.buttons"
|
|
||||||
@handleButtonClickCallback="handleButtonClickCallback"
|
|
||||||
></PermissionButton>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ProTable
|
|
||||||
ref="proTable"
|
|
||||||
:formData="dataStore.formData"
|
|
||||||
:columns="dataStore.columns"
|
|
||||||
:request-api="getMaterialListApi"
|
|
||||||
:init-param="dataStore.initParam"
|
|
||||||
@selectionChange="selectionChange"
|
|
||||||
:orgCode="dataStore.ruleForm.orgCode"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts" name="foundationSetPriority">
|
|
||||||
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 { 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>();
|
|
||||||
|
|
||||||
// 获取用户信息(组织id)
|
|
||||||
const userStore = useUserStore();
|
|
||||||
// 数据源
|
|
||||||
const dataStore = reactive<any>({
|
|
||||||
columns: COLUMNS, //列表配置项
|
|
||||||
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
|
||||||
ruleForm: cloneDeep(RULE_FORM), // 搜索条件
|
|
||||||
formData: FORM_DATA, //搜索配置项
|
|
||||||
buttons: cloneDeep(BUTTON),
|
|
||||||
options: [], //规格型号
|
|
||||||
selectionList: [], //选中表格的行
|
|
||||||
loading: false
|
|
||||||
});
|
|
||||||
|
|
||||||
// 表格选择事件
|
|
||||||
const selectionChange = (selection: any) => {
|
|
||||||
dataStore.selectionList = selection;
|
|
||||||
};
|
|
||||||
const handleButtonClickCallback = (item: any) => {
|
|
||||||
const { type } = item;
|
|
||||||
btnClick[type](item);
|
|
||||||
};
|
|
||||||
// // 规格型号
|
|
||||||
// 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;
|
|
||||||
// };
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => userStore.orgCode,
|
|
||||||
newVal => {
|
|
||||||
dataStore.ruleForm.orgCode = newVal;
|
|
||||||
dataStore.initParam.orgCode = newVal;
|
|
||||||
},
|
|
||||||
{
|
|
||||||
immediate: true,
|
|
||||||
deep: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scope lang="scss">
|
|
||||||
.down-dialog-box {
|
|
||||||
.el-dialog__body {
|
|
||||||
padding: 0 16px 40px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
// 直接导出函数,无需额外包装对象
|
|
||||||
export const handleExport = (item: any) => {
|
|
||||||
console.log("导出操作", item);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handleRefresh = (item: any) => {
|
|
||||||
console.log("刷新操作", item);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const btnClick: any = {
|
|
||||||
export: handleExport,
|
|
||||||
refresh: handleRefresh
|
|
||||||
};
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
import { btnClick } from "./btnClick";
|
|
||||||
export { btnClick };
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
export const BUTTON = [
|
|
||||||
{
|
|
||||||
text: "导出",
|
|
||||||
permission: "reportManagementMaterialBtnExport",
|
|
||||||
type: "export"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
interface FormItem {
|
|
||||||
prop: string;
|
|
||||||
label?: string;
|
|
||||||
placeholder?: string;
|
|
||||||
type: string;
|
|
||||||
isCopy?: boolean;
|
|
||||||
optionProps?: any;
|
|
||||||
startPlaceholder?: string;
|
|
||||||
endPlaceholder?: string;
|
|
||||||
options?: any;
|
|
||||||
isArray?: boolean;
|
|
||||||
startDate?: string; //开始时间(传入后台需要的参数)
|
|
||||||
endDate?: string; //结束时间(传入后台需要的参数)
|
|
||||||
startProp?: string;
|
|
||||||
endProp?: string;
|
|
||||||
isInteger?: boolean;
|
|
||||||
}
|
|
||||||
export const FORM_DATA: FormItem[] = [
|
|
||||||
{
|
|
||||||
prop: "securityNumbers",
|
|
||||||
placeholder: "请输入来源单号",
|
|
||||||
type: "input",
|
|
||||||
isArray: true,
|
|
||||||
label: "来源单号: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "lotNumbers",
|
|
||||||
placeholder: "请选择供应商",
|
|
||||||
type: "select",
|
|
||||||
isArray: true,
|
|
||||||
label: "供应商: ",
|
|
||||||
options: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "securityNumbers",
|
|
||||||
placeholder: "请输入质检人",
|
|
||||||
type: "input",
|
|
||||||
isArray: true,
|
|
||||||
label: "质检人: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "Time",
|
|
||||||
type: "daterange",
|
|
||||||
options: [],
|
|
||||||
startPlaceholder: "质检开始日期",
|
|
||||||
endPlaceholder: "质检结束日期",
|
|
||||||
startDate: "createBeginDate",
|
|
||||||
endDate: "createEndDate",
|
|
||||||
label: "质检时间: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "lotNumbers",
|
|
||||||
placeholder: "请选择组织",
|
|
||||||
type: "select",
|
|
||||||
isArray: true,
|
|
||||||
label: "组织: "
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
prop: "materialNumber",
|
|
||||||
placeholder: "请输入規格型号",
|
|
||||||
type: "selectRemote1",
|
|
||||||
isArray: true,
|
|
||||||
options: [],
|
|
||||||
label: "物料编码: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "lotNumbers",
|
|
||||||
placeholder: "请选择质检状态",
|
|
||||||
type: "select",
|
|
||||||
isArray: true,
|
|
||||||
label: "质检状态: "
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
export const RULE_FORM = {
|
|
||||||
page: 1,
|
|
||||||
size: 50,
|
|
||||||
orgCode: 0
|
|
||||||
};
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
export const COLUMNS = [
|
|
||||||
{ type: "selection", fixed: "left", width: 40 },
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
fixed: true,
|
|
||||||
label: "质检单",
|
|
||||||
prop: "securityNumber",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "质检状态",
|
|
||||||
prop: "id",
|
|
||||||
width: 160
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "销售订单号",
|
|
||||||
prop: "specifications",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "来源单号",
|
|
||||||
prop: "createTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "下载次数",
|
|
||||||
prop: "downLoadNumber",
|
|
||||||
width: 80
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "质检类型",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "供应商",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "组织",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "规格型号",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "物料编码",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "物料名称",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "应质检数量",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "良品数",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "次品数",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "质检人",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "质检时间",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: "left",
|
|
||||||
label: "创建时间",
|
|
||||||
prop: "downLoadTime",
|
|
||||||
width: 200
|
|
||||||
}
|
|
||||||
];
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
<!-- 质检单 -->
|
|
||||||
<template>
|
|
||||||
<div class="table-box">
|
|
||||||
<div style="padding-bottom: 16px">
|
|
||||||
<PermissionButton
|
|
||||||
:buttons="dataStore.buttons"
|
|
||||||
@handleButtonClickCallback="handleButtonClickCallback"
|
|
||||||
></PermissionButton>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ProTable
|
|
||||||
ref="proTable"
|
|
||||||
:formData="dataStore.formData"
|
|
||||||
:columns="dataStore.columns"
|
|
||||||
:request-api="getMaterialListApi"
|
|
||||||
:init-param="dataStore.initParam"
|
|
||||||
@selectionChange="selectionChange"
|
|
||||||
:orgCode="dataStore.ruleForm.orgCode"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts" name="foundationSetRelationship">
|
|
||||||
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 { 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>();
|
|
||||||
|
|
||||||
// 获取用户信息(组织id)
|
|
||||||
const userStore = useUserStore();
|
|
||||||
// 数据源
|
|
||||||
const dataStore = reactive<any>({
|
|
||||||
columns: COLUMNS, //列表配置项
|
|
||||||
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
|
||||||
ruleForm: cloneDeep(RULE_FORM), // 搜索条件
|
|
||||||
formData: FORM_DATA, //搜索配置项
|
|
||||||
buttons: cloneDeep(BUTTON),
|
|
||||||
options: [], //规格型号
|
|
||||||
selectionList: [], //选中表格的行
|
|
||||||
loading: false
|
|
||||||
});
|
|
||||||
|
|
||||||
// 表格选择事件
|
|
||||||
const selectionChange = (selection: any) => {
|
|
||||||
dataStore.selectionList = selection;
|
|
||||||
};
|
|
||||||
const handleButtonClickCallback = (item: any) => {
|
|
||||||
const { type } = item;
|
|
||||||
btnClick[type](item);
|
|
||||||
};
|
|
||||||
// // 规格型号
|
|
||||||
// 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;
|
|
||||||
// };
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => userStore.orgCode,
|
|
||||||
newVal => {
|
|
||||||
dataStore.ruleForm.orgCode = newVal;
|
|
||||||
dataStore.initParam.orgCode = newVal;
|
|
||||||
},
|
|
||||||
{
|
|
||||||
immediate: true,
|
|
||||||
deep: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scope lang="scss">
|
|
||||||
.down-dialog-box {
|
|
||||||
.el-dialog__body {
|
|
||||||
padding: 0 16px 40px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
// 直接导出函数,无需额外包装对象
|
|
||||||
export const handleExport = (item: any) => {
|
|
||||||
console.log("导出操作", item);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handleRefresh = (item: any) => {
|
|
||||||
console.log("刷新操作", item);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const btnClick: any = {
|
|
||||||
export: handleExport,
|
|
||||||
refresh: handleRefresh
|
|
||||||
};
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
import { btnClick } from "./btnClick";
|
|
||||||
export { btnClick };
|
|
||||||
23
src/views/foundation/set/shop/constant/list/button.ts
Normal file
23
src/views/foundation/set/shop/constant/list/button.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
export const BUTTON = [
|
||||||
|
{
|
||||||
|
text: "新增",
|
||||||
|
permission: "foundationSetShopBtnAdd",
|
||||||
|
type: "add",
|
||||||
|
props: {
|
||||||
|
type: "primary"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "导出",
|
||||||
|
permission: "foundationSetShopBtnExport",
|
||||||
|
type: "export"
|
||||||
|
// props: {
|
||||||
|
// type: "primary"
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "删除",
|
||||||
|
permission: "foundationSetShopBtnDel",
|
||||||
|
type: "del"
|
||||||
|
}
|
||||||
|
];
|
||||||
173
src/views/foundation/set/shop/constant/list/details.ts
Normal file
173
src/views/foundation/set/shop/constant/list/details.ts
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
export const DETAILS_FORM_DATA: 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"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
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 = {};
|
||||||
70
src/views/foundation/set/shop/constant/list/search.ts
Normal file
70
src/views/foundation/set/shop/constant/list/search.ts
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
interface FormItem {
|
||||||
|
prop: string;
|
||||||
|
label?: string;
|
||||||
|
placeholder?: string;
|
||||||
|
type: string;
|
||||||
|
isCopy?: boolean;
|
||||||
|
optionProps?: any;
|
||||||
|
startPlaceholder?: string;
|
||||||
|
endPlaceholder?: string;
|
||||||
|
options?: any;
|
||||||
|
isArray?: boolean;
|
||||||
|
startDate?: string; //开始时间(传入后台需要的参数)
|
||||||
|
endDate?: string; //结束时间(传入后台需要的参数)
|
||||||
|
startProp?: string;
|
||||||
|
endProp?: string;
|
||||||
|
isInteger?: boolean;
|
||||||
|
}
|
||||||
|
export const FORM_DATA: FormItem[] = [
|
||||||
|
{
|
||||||
|
prop: "platform_name",
|
||||||
|
placeholder: "请输入平台",
|
||||||
|
type: "input",
|
||||||
|
label: "平台: "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "platform_store_name",
|
||||||
|
placeholder: "请输入平台店铺名称",
|
||||||
|
type: "input",
|
||||||
|
label: "平台店铺名称: "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "kingdee_store_name",
|
||||||
|
placeholder: "请输入金蝶店铺名称",
|
||||||
|
type: "input",
|
||||||
|
label: "金蝶店铺名称: "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "jushuitan_store_name",
|
||||||
|
placeholder: "请输入聚水潭店铺名称",
|
||||||
|
type: "input",
|
||||||
|
label: "聚水潭店铺名称: "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "lingxing_store_name",
|
||||||
|
placeholder: "请输入领星店铺名称",
|
||||||
|
type: "input",
|
||||||
|
label: "领星店铺名称: "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "operator_name",
|
||||||
|
placeholder: "请输入更新人",
|
||||||
|
type: "input",
|
||||||
|
label: "更新人: "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "Time",
|
||||||
|
type: "daterange",
|
||||||
|
options: [],
|
||||||
|
startPlaceholder: "更新开始日期",
|
||||||
|
endPlaceholder: "更新结束日期",
|
||||||
|
startDate: "update_time",
|
||||||
|
// endDate: "createEndDate",
|
||||||
|
label: "更新时间: "
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export const RULE_FORM = {
|
||||||
|
page: 1,
|
||||||
|
size: 50
|
||||||
|
};
|
||||||
59
src/views/foundation/set/shop/constant/list/table.ts
Normal file
59
src/views/foundation/set/shop/constant/list/table.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
// import { RenderScope } from "@/components/ProTable/interface";
|
||||||
|
export const COLUMNS = [
|
||||||
|
{ type: "selection", fixed: "left", width: 40 },
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
fixed: true,
|
||||||
|
label: "平台店铺名称",
|
||||||
|
prop: "platform_store_name",
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "平台",
|
||||||
|
prop: "platform_name",
|
||||||
|
fixed: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "订单接入系统",
|
||||||
|
prop: "access_system_name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "聚水潭店铺名称",
|
||||||
|
prop: "jushuitan_store_name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "领星店铺名称",
|
||||||
|
prop: "lingxing_store_name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "领星店铺SellerID",
|
||||||
|
prop: "lingxing_store_number"
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "金蝶店铺名称",
|
||||||
|
prop: "kingdee_store_name"
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "金蝶店铺编码",
|
||||||
|
prop: "kingdee_store_number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "更新人",
|
||||||
|
prop: "operator"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "更新时间",
|
||||||
|
prop: "updated_at"
|
||||||
|
}
|
||||||
|
];
|
||||||
299
src/views/foundation/set/shop/index.vue
Normal file
299
src/views/foundation/set/shop/index.vue
Normal file
@@ -0,0 +1,299 @@
|
|||||||
|
<!-- 店铺资料 -->
|
||||||
|
<template>
|
||||||
|
<div class="table-box">
|
||||||
|
<div style="padding-bottom: 16px">
|
||||||
|
<PermissionButton
|
||||||
|
:buttons="dataStore.buttons"
|
||||||
|
@handleButtonClickCallback="handleButtonClickCallback"
|
||||||
|
></PermissionButton>
|
||||||
|
</div>
|
||||||
|
<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"
|
||||||
|
ref="detailsRef"
|
||||||
|
/>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button @click="handleClose">取消</el-button>
|
||||||
|
<el-button type="primary" @click="handleCommit"> 确认 </el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<ProTable
|
||||||
|
ref="proTableRef"
|
||||||
|
:columns="dataStore.columns"
|
||||||
|
:request-api="getShopListApi"
|
||||||
|
:init-param="dataStore.initParam"
|
||||||
|
@selectionChange="selectionChange"
|
||||||
|
>
|
||||||
|
<template v-slot:search>
|
||||||
|
<SearchForm
|
||||||
|
@search="handleSearch"
|
||||||
|
@reset="handleReset"
|
||||||
|
:searchParams="dataStore.initParam"
|
||||||
|
: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>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="foundationSetShop">
|
||||||
|
import ProTable from "@/components/ProTable/index.vue";
|
||||||
|
import SearchForm from "@/components/SearchForm/index.vue";
|
||||||
|
import PermissionButton from "@/components/PermissionButton/index.vue";
|
||||||
|
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, 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>();
|
||||||
|
const detailsRef = ref<any>(null);
|
||||||
|
// 数据源
|
||||||
|
const dataStore = reactive<any>({
|
||||||
|
columns: COLUMNS, //列表配置项
|
||||||
|
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
||||||
|
formData: FORM_DATA, // 搜索配置项
|
||||||
|
buttons: cloneDeep(BUTTON),
|
||||||
|
labelWidth: "120px",
|
||||||
|
title: "新增店铺",
|
||||||
|
detailsFormData: cloneDeep(DETAILS_FORM_DATA),
|
||||||
|
detailsRuleForm: cloneDeep(DETAILS_RULE_FORM),
|
||||||
|
dialogVisible: false, // 弹窗
|
||||||
|
accessSystemOptions: [], // 接入系統列表
|
||||||
|
selectionList: [] // 列表选中数据
|
||||||
|
});
|
||||||
|
|
||||||
|
// 表格选择事件
|
||||||
|
const selectionChange = (selection: any) => {
|
||||||
|
dataStore.selectionList = selection;
|
||||||
|
};
|
||||||
|
// 删除
|
||||||
|
const handleDel = () => {
|
||||||
|
if (!dataStore.selectionList.length) {
|
||||||
|
useMsg("warning", "请选择数据 !");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
ElMessageBox.confirm("您确定进行删除操作吗?", "温馨提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
let ids: any = [];
|
||||||
|
dataStore.selectionList?.forEach((item: any) => {
|
||||||
|
ids.push(item.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await getShopDelApi(ids.join(","));
|
||||||
|
|
||||||
|
if (result?.code === 0) {
|
||||||
|
proTableRef?.value!.getTableList();
|
||||||
|
useMsg("success", "删除成功 !");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 新增
|
||||||
|
const getShopAdd = async () => {
|
||||||
|
const result = await getShopAddApi(dataStore.detailsRuleForm);
|
||||||
|
if (result?.code === 0) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 更新
|
||||||
|
const getShopUp = async () => {
|
||||||
|
const result = await getShopUpApi(dataStore.rowId, dataStore.detailsRuleForm);
|
||||||
|
if (result?.code === 0) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 详情
|
||||||
|
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 = async (row: any) => {
|
||||||
|
dataStore.rowId = 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: 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;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 弹窗确认
|
||||||
|
const handleCommit = () => {
|
||||||
|
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) => {
|
||||||
|
dataStore.initParam = cloneDeep(params);
|
||||||
|
//这里需要等到表格刷新以后才去请求
|
||||||
|
nextTick(() => {
|
||||||
|
proTableRef?.value!.getTableList();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 重置
|
||||||
|
const handleReset = () => {
|
||||||
|
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||||
|
//这里需要等到表格刷新以后才去请求
|
||||||
|
nextTick(() => {
|
||||||
|
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">
|
||||||
|
.down-dialog-box {
|
||||||
|
.el-dialog__body {
|
||||||
|
padding: 0 16px 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-dialog .el-dialog__header {
|
||||||
|
padding: 8px 0;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
0
src/views/foundation/set/shop/init/index.ts
Normal file
0
src/views/foundation/set/shop/init/index.ts
Normal file
16
src/views/foundation/set/warehouse/constant/list/button.ts
Normal file
16
src/views/foundation/set/warehouse/constant/list/button.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
export const BUTTON = [
|
||||||
|
{
|
||||||
|
text: "新增",
|
||||||
|
permission: "foundationSetWarehouseBtnAdd",
|
||||||
|
type: "add",
|
||||||
|
props: {
|
||||||
|
type: "primary"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
text: "删除",
|
||||||
|
permission: "foundationSetWarehouseBtnDel",
|
||||||
|
type: "del"
|
||||||
|
}
|
||||||
|
];
|
||||||
63
src/views/foundation/set/warehouse/constant/list/details.ts
Normal file
63
src/views/foundation/set/warehouse/constant/list/details.ts
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
export const DETAILS_FORM_DATA: any[] = [
|
||||||
|
{
|
||||||
|
prop: "use_org_number",
|
||||||
|
placeholder: "请输入",
|
||||||
|
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",
|
||||||
|
options: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "kd_subwarehouse_number",
|
||||||
|
placeholder: "请选择",
|
||||||
|
type: "selectMultiple",
|
||||||
|
label: "金蝶子仓库:",
|
||||||
|
disabled: false,
|
||||||
|
class: "form-item1",
|
||||||
|
options: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "jst_warehouse_number",
|
||||||
|
placeholder: "请选择",
|
||||||
|
type: "selectMultipleD",
|
||||||
|
label: "对应聚水潭仓库:",
|
||||||
|
disabled: false,
|
||||||
|
class: "form-item1",
|
||||||
|
options: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "lx_warehouse_number",
|
||||||
|
placeholder: "请选择",
|
||||||
|
type: "selectMultipleD",
|
||||||
|
label: "对应领星仓库:",
|
||||||
|
disabled: false,
|
||||||
|
class: "form-item1",
|
||||||
|
options: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
//textarea
|
||||||
|
|
||||||
|
prop: "remark",
|
||||||
|
placeholder: "请输入",
|
||||||
|
type: "textarea",
|
||||||
|
label: "备注:",
|
||||||
|
disabled: false,
|
||||||
|
maxLength: 5000,
|
||||||
|
class: "form-item1"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
export const DETAILS_RULE_FORM: any = {
|
||||||
|
use_org_number: "101"
|
||||||
|
};
|
||||||
64
src/views/foundation/set/warehouse/constant/list/search.ts
Normal file
64
src/views/foundation/set/warehouse/constant/list/search.ts
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
interface FormItem {
|
||||||
|
prop: string;
|
||||||
|
label?: string;
|
||||||
|
placeholder?: string;
|
||||||
|
type: string;
|
||||||
|
isCopy?: boolean;
|
||||||
|
optionProps?: any;
|
||||||
|
startPlaceholder?: string;
|
||||||
|
endPlaceholder?: string;
|
||||||
|
options?: any;
|
||||||
|
isArray?: boolean;
|
||||||
|
startDate?: string; //开始时间(传入后台需要的参数)
|
||||||
|
endDate?: string; //结束时间(传入后台需要的参数)
|
||||||
|
startProp?: string;
|
||||||
|
endProp?: string;
|
||||||
|
isInteger?: boolean;
|
||||||
|
}
|
||||||
|
export const FORM_DATA: FormItem[] = [
|
||||||
|
{
|
||||||
|
prop: "use_org_number",
|
||||||
|
placeholder: "请选择组织",
|
||||||
|
type: "selectMultiple",
|
||||||
|
label: "组织: ",
|
||||||
|
options: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "kd_warehouse_number",
|
||||||
|
placeholder: "请输入金蝶仓库",
|
||||||
|
type: "selectMultiple",
|
||||||
|
label: "金蝶仓库: ",
|
||||||
|
options: []
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
prop: "kd_subwarehouse_number",
|
||||||
|
placeholder: "请输入金蝶子仓库",
|
||||||
|
type: "selectMultiple",
|
||||||
|
label: "金蝶子仓库: ",
|
||||||
|
options: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "operator",
|
||||||
|
placeholder: "请输入更新人",
|
||||||
|
type: "input",
|
||||||
|
label: "更新人: "
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
prop: "Time",
|
||||||
|
type: "daterange",
|
||||||
|
options: [],
|
||||||
|
startPlaceholder: "更新开始日期",
|
||||||
|
endPlaceholder: "更新结束日期",
|
||||||
|
startDate: "update_time",
|
||||||
|
// endDate: "createEndDate",
|
||||||
|
label: "更新时间: "
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export const RULE_FORM = {
|
||||||
|
page: 1,
|
||||||
|
size: 50,
|
||||||
|
use_org_number: ["101"]
|
||||||
|
};
|
||||||
64
src/views/foundation/set/warehouse/constant/list/table.ts
Normal file
64
src/views/foundation/set/warehouse/constant/list/table.ts
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import { RenderScope } from "@/components/ProTable/interface";
|
||||||
|
export const COLUMNS = [
|
||||||
|
{ type: "selection", fixed: "left", width: 40 },
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
fixed: true,
|
||||||
|
label: "金蝶仓库",
|
||||||
|
prop: "kd_warehouse_name",
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
fixed: true,
|
||||||
|
label: "组织",
|
||||||
|
prop: "use_org_name",
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "金蝶子仓库",
|
||||||
|
prop: "kd_subwarehouse_number",
|
||||||
|
width: 400,
|
||||||
|
fixed: true,
|
||||||
|
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: "jst_warehouse_name",
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "对应领星仓库",
|
||||||
|
prop: "lx_warehouse_name",
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "备注",
|
||||||
|
prop: "remark",
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "更新人",
|
||||||
|
prop: "operator"
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
align: "left",
|
||||||
|
label: "更新时间",
|
||||||
|
prop: "updated_at",
|
||||||
|
width: 200
|
||||||
|
}
|
||||||
|
];
|
||||||
444
src/views/foundation/set/warehouse/index.vue
Normal file
444
src/views/foundation/set/warehouse/index.vue
Normal file
@@ -0,0 +1,444 @@
|
|||||||
|
<!-- 店铺资料 -->
|
||||||
|
<template>
|
||||||
|
<div class="table-box">
|
||||||
|
<div style="padding-bottom: 16px">
|
||||||
|
<PermissionButton
|
||||||
|
:buttons="dataStore.buttons"
|
||||||
|
@handleButtonClickCallback="handleButtonClickCallback"
|
||||||
|
></PermissionButton>
|
||||||
|
</div>
|
||||||
|
<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>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button @click="handleClose">取消</el-button>
|
||||||
|
<el-button type="primary" @click="handleCommit"> 确认 </el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<ProTable
|
||||||
|
ref="proTableRef"
|
||||||
|
:columns="dataStore.columns"
|
||||||
|
:request-api="getSetWarehouseListApi"
|
||||||
|
:init-param="dataStore.initParam"
|
||||||
|
@selectionChange="selectionChange"
|
||||||
|
>
|
||||||
|
<!-- @selectMultipleRemoveTag="handleSelectMultipleRemoveTag" -->
|
||||||
|
<template v-slot:search>
|
||||||
|
<SearchForm
|
||||||
|
@search="handleSearch"
|
||||||
|
@reset="handleReset"
|
||||||
|
:searchParams="dataStore.initParam"
|
||||||
|
:formData="dataStore.formData"
|
||||||
|
/>
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<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 { 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
|
||||||
|
import { ProTableInstance } from "@/components/ProTable/interface";
|
||||||
|
|
||||||
|
// 深拷贝方法
|
||||||
|
import { cloneDeep } from "lodash-es";
|
||||||
|
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||||
|
const proTableRef = ref<ProTableInstance>();
|
||||||
|
const detailsRef = ref<any>(null);
|
||||||
|
// 数据源
|
||||||
|
const dataStore = reactive<any>({
|
||||||
|
columns: COLUMNS, //列表配置项
|
||||||
|
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
||||||
|
formData: FORM_DATA, // 搜索配置项
|
||||||
|
buttons: cloneDeep(BUTTON),
|
||||||
|
labelWidth: "120px",
|
||||||
|
title: "新增金蝶子仓与各系统仓库关系",
|
||||||
|
detailsFormData: cloneDeep(DETAILS_FORM_DATA),
|
||||||
|
detailsRuleForm: cloneDeep(DETAILS_RULE_FORM),
|
||||||
|
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 = () => {
|
||||||
|
if (!dataStore.selectionList.length) {
|
||||||
|
useMsg("warning", "请选择数据 !");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
ElMessageBox.confirm("您确定进行删除操作吗?", "温馨提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
let ids: any = [];
|
||||||
|
dataStore.selectionList?.forEach((item: any) => {
|
||||||
|
ids.push(item.id);
|
||||||
|
});
|
||||||
|
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;
|
||||||
|
detailsRef?.value?.formElement?.resetFields();
|
||||||
|
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;
|
||||||
|
detailsRef?.value?.formElement?.resetFields();
|
||||||
|
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 (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 [];
|
||||||
|
}
|
||||||
|
// 方法1:Map 实现(高效,保留顺序)
|
||||||
|
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;
|
||||||
|
getWarehouseDetails(row.id);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 顶部按钮点击事件
|
||||||
|
const handleButtonClickCallback = (item: any) => {
|
||||||
|
const { type } = item;
|
||||||
|
if (type === "del") {
|
||||||
|
handleDel();
|
||||||
|
}
|
||||||
|
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 = () => {
|
||||||
|
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);
|
||||||
|
// 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();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 重置
|
||||||
|
const handleReset = () => {
|
||||||
|
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||||
|
//这里需要等到表格刷新以后才去请求
|
||||||
|
nextTick(() => {
|
||||||
|
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">
|
||||||
|
.down-dialog-box {
|
||||||
|
.el-dialog__body {
|
||||||
|
padding: 0 16px 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-dialog .el-dialog__header {
|
||||||
|
padding: 8px 0;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
:labelWidth="dataStore.labelWidth"
|
:labelWidth="dataStore.labelWidth"
|
||||||
@selectMultipleRemoveTag="handleSelectMultipleRemoveTag"
|
@selectMultipleRemoveTag="handleSelectMultipleRemoveTag"
|
||||||
:inline="true"
|
:inline="true"
|
||||||
|
ref="detailsRef"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -22,15 +23,16 @@
|
|||||||
import PermissionButton from "@/components/PermissionButton/index.vue";
|
import PermissionButton from "@/components/PermissionButton/index.vue";
|
||||||
import DetailsSearch from "@/components/DetailsSearch/index.vue";
|
import DetailsSearch from "@/components/DetailsSearch/index.vue";
|
||||||
import { FORM_DATA, RULE_FORM } from "./constant/add";
|
import { FORM_DATA, RULE_FORM } from "./constant/add";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
import { getSubscribeDetailsApi, getSubscribeUpdateApi, getSubscribeAddApi } from "@/api/modules/subscribe";
|
||||||
import { getSubscribeDetailsApi, getSubscribeAddApi, getSubscribeUpdateApi } from "@/api/modules/subscribe";
|
|
||||||
import { setDetailsData } from "./init/setDetailsData";
|
import { setDetailsData } from "./init/setDetailsData";
|
||||||
import { useMsg } from "@/hooks/useMsg";
|
import { useMsg } from "@/hooks/useMsg";
|
||||||
import { BUTTON } from "./constant/add/button";
|
import { BUTTON } from "./constant/add/button";
|
||||||
import { useUserStore } from "@/stores/modules/user";
|
import { useUserStore } from "@/stores/modules/user";
|
||||||
import { cloneDeep } from "lodash-es";
|
import { cloneDeep } from "lodash-es";
|
||||||
|
import $Bus from "@/utils/mittBus";
|
||||||
|
// import { useTabsStore } from "@/stores/modules/tabs";
|
||||||
|
// const tabStore = useTabsStore();
|
||||||
const dataStore = reactive({
|
const dataStore = reactive({
|
||||||
formData: cloneDeep(FORM_DATA),
|
formData: cloneDeep(FORM_DATA),
|
||||||
ruleForm: cloneDeep(RULE_FORM),
|
ruleForm: cloneDeep(RULE_FORM),
|
||||||
@@ -42,10 +44,10 @@ const dataStore = reactive({
|
|||||||
});
|
});
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const $route = useRoute();
|
const $route = useRoute();
|
||||||
|
const $router = useRouter();
|
||||||
|
const detailsRef = ref<any>(null);
|
||||||
dataStore.formData[0].options = userStore.orgIdArr;
|
dataStore.formData[0].options = userStore.orgIdArr;
|
||||||
const init = () => {
|
const init = () => {
|
||||||
//$route.query.title === "新增订阅" ? org_number: ["101"],
|
|
||||||
if ($route.query.title === "新增订阅") {
|
if ($route.query.title === "新增订阅") {
|
||||||
dataStore.ruleForm.org_number = ["101"];
|
dataStore.ruleForm.org_number = ["101"];
|
||||||
}
|
}
|
||||||
@@ -53,8 +55,17 @@ const init = () => {
|
|||||||
init();
|
init();
|
||||||
//新增
|
//新增
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
|
if ($route.query.title === "编辑订阅") {
|
||||||
|
$router.replace({
|
||||||
|
path: "/foundation/subscribe/list/add",
|
||||||
|
query: {
|
||||||
|
title: "新增订阅"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if ($route.query.title === "新增订阅") {
|
||||||
if (
|
if (
|
||||||
dataStore.ruleForm?.customer_number.length ||
|
dataStore.ruleForm?.customer_number?.length ||
|
||||||
dataStore.ruleForm?.org_number ||
|
dataStore.ruleForm?.org_number ||
|
||||||
dataStore.ruleForm?.product_lines ||
|
dataStore.ruleForm?.product_lines ||
|
||||||
dataStore.ruleForm?.subscriber_dduid
|
dataStore.ruleForm?.subscriber_dduid
|
||||||
@@ -66,17 +77,30 @@ const handleAdd = () => {
|
|||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
dataStore.ruleForm = cloneDeep(RULE_FORM);
|
dataStore.ruleForm = cloneDeep(RULE_FORM);
|
||||||
|
dataStore.ruleForm.org_number = ["101"];
|
||||||
dataStore.isAdd = true;
|
dataStore.isAdd = true;
|
||||||
|
detailsRef?.value?.formElement?.resetFields();
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleGoList = () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
$router.replace({ path: "/foundation/subscribe/list/index" });
|
||||||
|
$Bus.emit("setResetList");
|
||||||
|
}, 300);
|
||||||
};
|
};
|
||||||
|
|
||||||
//添加
|
//添加
|
||||||
const getSubscribeAdd = async (params: any) => {
|
const getSubscribeAdd = async (params: any) => {
|
||||||
|
console.log(params);
|
||||||
const result = await getSubscribeAddApi(params);
|
const result = await getSubscribeAddApi(params);
|
||||||
if (result?.code === 0) {
|
if (result?.code === 0) {
|
||||||
useMsg("success", "新增成功 !");
|
useMsg("success", "新增成功 !");
|
||||||
|
dataStore.ruleForm = cloneDeep(RULE_FORM);
|
||||||
|
dataStore.ruleForm.org_number = ["101"];
|
||||||
|
detailsRef?.value?.formElement?.resetFields();
|
||||||
|
handleGoList();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//更新
|
//更新
|
||||||
@@ -84,6 +108,7 @@ const getSubscribeUpdate = async (params: any) => {
|
|||||||
const result = await getSubscribeUpdateApi($route.query.id, params);
|
const result = await getSubscribeUpdateApi($route.query.id, params);
|
||||||
if (result?.code === 0) {
|
if (result?.code === 0) {
|
||||||
useMsg("success", "更新成功 !");
|
useMsg("success", "更新成功 !");
|
||||||
|
handleGoList();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -117,7 +142,6 @@ const handleCommit = () => {
|
|||||||
};
|
};
|
||||||
//详情
|
//详情
|
||||||
const getSubscribeDetails = async () => {
|
const getSubscribeDetails = async () => {
|
||||||
console.log($route.query.id);
|
|
||||||
let id = $route.query.id;
|
let id = $route.query.id;
|
||||||
if (!id) {
|
if (!id) {
|
||||||
return;
|
return;
|
||||||
@@ -129,19 +153,36 @@ const getSubscribeDetails = async () => {
|
|||||||
setDetailsData(dataStore, data);
|
setDetailsData(dataStore, data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const filterBySecondArray = (firstArray: any, secondArray: any) => {
|
||||||
|
if (!firstArray || !secondArray) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!firstArray.length || !secondArray.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 创建一个Set用于快速查找
|
||||||
|
const filterSet = new Set(secondArray);
|
||||||
|
|
||||||
|
// 过滤出后缀在第二个数组中的元素(保留符合条件的)
|
||||||
|
return firstArray.filter((item: any) => {
|
||||||
|
// 分割字符串获取后缀部分
|
||||||
|
const suffix = item.split("_")[1];
|
||||||
|
// 检查后缀是否在过滤集合中,保留存在的元素
|
||||||
|
return filterSet.has(suffix);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
//本地多选远程搜索Tag删除回调(组织)
|
//本地多选远程搜索Tag删除回调(组织)
|
||||||
const handleSelectMultipleRemoveTag = async (params: any) => {
|
const handleSelectMultipleRemoveTag = async (params: any) => {
|
||||||
const { org_number } = params;
|
const { org_number } = params;
|
||||||
let customers: any = [];
|
|
||||||
// 筛选出 org_number 在 ids 中的数据
|
|
||||||
dataStore.formData[1].options = dataStore.formData[1].options.filter((item: any) => org_number.includes(item.org_number));
|
|
||||||
|
|
||||||
dataStore.formData[1].options.length &&
|
// 筛选出 org_number 数组包含的数据
|
||||||
dataStore.formData[1].options.forEach((item: any) => {
|
dataStore.formData[1].options = dataStore.formData[1].options.filter((item: any) => {
|
||||||
customers.push(item.value);
|
return org_number.includes(item.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
dataStore.ruleForm.customer_number = customers;
|
dataStore.ruleForm.customer_number1 = filterBySecondArray(dataStore.ruleForm.customer_number1, org_number);
|
||||||
};
|
};
|
||||||
getSubscribeDetails();
|
getSubscribeDetails();
|
||||||
|
|
||||||
@@ -154,4 +195,25 @@ const handleButtonClickCallback = (item: any) => {
|
|||||||
handleCommit();
|
handleCommit();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const getPrefixes = (arr: any) => {
|
||||||
|
// 遍历数组,返回每个元素下划线前面的部分
|
||||||
|
return arr.map((item: any) => {
|
||||||
|
// 分割字符串并返回下划线前面的部分(索引0)
|
||||||
|
return item.split("_")[0];
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => dataStore.ruleForm.customer_number1,
|
||||||
|
(newVal: any) => {
|
||||||
|
if (Array.isArray(newVal) && newVal.length) {
|
||||||
|
dataStore.ruleForm.customer_number = getPrefixes(newVal);
|
||||||
|
} else {
|
||||||
|
dataStore.ruleForm.customer_number = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export const FORM_DATA: any[] = [
|
|||||||
options: []
|
options: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "customer_number",
|
prop: "customer_number1",
|
||||||
placeholder: "请输入",
|
placeholder: "请输入",
|
||||||
type: "selectMultipleRemoteCustomersNames",
|
type: "selectMultipleRemoteCustomersNames",
|
||||||
label: "客户名称:",
|
label: "客户名称:",
|
||||||
@@ -23,7 +23,7 @@ export const FORM_DATA: any[] = [
|
|||||||
{
|
{
|
||||||
prop: "customer_number",
|
prop: "customer_number",
|
||||||
placeholder: "请输入",
|
placeholder: "请输入",
|
||||||
type: "input",
|
type: "textarea",
|
||||||
label: "客户编码:",
|
label: "客户编码:",
|
||||||
disabled: true,
|
disabled: true,
|
||||||
required: true,
|
required: true,
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
options: []
|
options: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "customer_number",
|
prop: "customer_numbers",
|
||||||
placeholder: "请输入客户名称",
|
placeholder: "请输入客户名称",
|
||||||
type: "selectMultipleRemote",
|
type: "selectMultipleRemote",
|
||||||
label: "客户名称: ",
|
label: "客户名称: ",
|
||||||
@@ -37,7 +37,7 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
label: "客户编码: "
|
label: "客户编码: "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "product_line_name",
|
prop: "product_line",
|
||||||
placeholder: "请输入品线",
|
placeholder: "请输入品线",
|
||||||
type: "selectProductLinesRemote",
|
type: "selectProductLinesRemote",
|
||||||
label: "品线: ",
|
label: "品线: ",
|
||||||
@@ -71,5 +71,6 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
export const RULE_FORM = {
|
export const RULE_FORM = {
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 1,
|
size: 1,
|
||||||
org_number: ["101"]
|
org_number: ["101"],
|
||||||
|
customer_number: []
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!-- 质检单 -->
|
<!-- 订阅人列表 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="table-box">
|
<div class="table-box">
|
||||||
<div style="padding-bottom: 16px">
|
<div style="padding-bottom: 16px">
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
<SearchForm
|
<SearchForm
|
||||||
@search="handleSearch"
|
@search="handleSearch"
|
||||||
@reset="handleReset"
|
@reset="handleReset"
|
||||||
|
@selectMultipleRemoveTag="handleSelectMultipleRemoveTag"
|
||||||
:searchParams="dataStore.initParam"
|
:searchParams="dataStore.initParam"
|
||||||
:formData="dataStore.formData"
|
:formData="dataStore.formData"
|
||||||
/>
|
/>
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="foundationSubscribeList">
|
<script setup lang="ts" name="foundationSubscribeList">
|
||||||
|
import { onMounted } from "vue";
|
||||||
import SearchForm from "@/components/SearchForm/index.vue";
|
import SearchForm from "@/components/SearchForm/index.vue";
|
||||||
import ProTable from "@/components/ProTable/index.vue";
|
import ProTable from "@/components/ProTable/index.vue";
|
||||||
import PermissionButton from "@/components/PermissionButton/index.vue";
|
import PermissionButton from "@/components/PermissionButton/index.vue";
|
||||||
@@ -45,19 +47,20 @@ import { ProTableInstance } from "@/components/ProTable/interface";
|
|||||||
import { btnClick } from "./init";
|
import { btnClick } from "./init";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { useUserStore } from "@/stores/modules/user";
|
import { useUserStore } from "@/stores/modules/user";
|
||||||
|
import $Bus from "@/utils/mittBus";
|
||||||
//深拷贝方法
|
//深拷贝方法
|
||||||
import { cloneDeep } from "lodash-es";
|
import { cloneDeep } from "lodash-es";
|
||||||
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||||
const proTableRef = ref<ProTableInstance>();
|
const proTableRef = ref<ProTableInstance>();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
||||||
// 数据源
|
// 数据源
|
||||||
const dataStore = reactive<any>({
|
const dataStore = reactive<any>({
|
||||||
columns: COLUMNS, //列表配置项
|
columns: COLUMNS, //列表配置项
|
||||||
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
||||||
ruleForm: cloneDeep(RULE_FORM), // 搜索条件
|
|
||||||
formData: FORM_DATA, //搜索配置项
|
formData: FORM_DATA, //搜索配置项
|
||||||
buttons: cloneDeep(BUTTON),
|
buttons: cloneDeep(BUTTON),
|
||||||
options: [], //规格型号
|
options: [], //规格型号
|
||||||
@@ -90,7 +93,7 @@ const handleSearch = async (params: any) => {
|
|||||||
dataStore.initParam = cloneDeep(params);
|
dataStore.initParam = cloneDeep(params);
|
||||||
//这里需要等到表格刷新以后才去请求
|
//这里需要等到表格刷新以后才去请求
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
proTableRef.value!.getTableList();
|
proTableRef?.value!.getTableList();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
//重置
|
//重置
|
||||||
@@ -98,7 +101,7 @@ const handleReset = () => {
|
|||||||
dataStore.initParam = cloneDeep(RULE_FORM);
|
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||||
//这里需要等到表格刷新以后才去请求
|
//这里需要等到表格刷新以后才去请求
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
proTableRef.value!.getTableList();
|
proTableRef?.value!.getTableList();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -109,6 +112,65 @@ const handleOpen = (row: any) => {
|
|||||||
query: { id: row.id, title: "编辑订阅" }
|
query: { id: row.id, title: "编辑订阅" }
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const filterBySecondArray = (firstArray: any, secondArray: any) => {
|
||||||
|
if (!firstArray || !secondArray) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!firstArray.length || !secondArray.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 创建一个Set用于快速查找
|
||||||
|
const filterSet = new Set(secondArray);
|
||||||
|
|
||||||
|
// 过滤出后缀在第二个数组中的元素(保留符合条件的)
|
||||||
|
return firstArray.filter((item: any) => {
|
||||||
|
// 分割字符串获取后缀部分
|
||||||
|
const suffix = item.split("_")[1];
|
||||||
|
// 检查后缀是否在过滤集合中,保留存在的元素
|
||||||
|
return filterSet.has(suffix);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const getPrefixes = (arr: any) => {
|
||||||
|
// 遍历数组,返回每个元素下划线前面的部分
|
||||||
|
return arr.map((item: any) => {
|
||||||
|
// 分割字符串并返回下划线前面的部分(索引0)
|
||||||
|
return item.split("_")[0];
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//本地多选远程搜索Tag删除回调(组织)
|
||||||
|
const handleSelectMultipleRemoveTag = async (params: any) => {
|
||||||
|
const { org_number } = params;
|
||||||
|
|
||||||
|
// 筛选出 org_number 数组包含的数据
|
||||||
|
dataStore.formData[1].options = dataStore.formData[1].options.filter((item: any) => {
|
||||||
|
return org_number.includes(item.id);
|
||||||
|
});
|
||||||
|
let customer_numbers = filterBySecondArray(dataStore.initParam.customer_numbers, org_number);
|
||||||
|
dataStore.initParam.customer_numbers = customer_numbers;
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => dataStore.initParam.customer_numbers,
|
||||||
|
(newVal: any) => {
|
||||||
|
if (Array.isArray(newVal) && newVal.length) {
|
||||||
|
dataStore.initParam.customer_number = getPrefixes(newVal);
|
||||||
|
} else {
|
||||||
|
dataStore.initParam.customer_number = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
onMounted(() => {
|
||||||
|
$Bus.on("setResetList", () => {
|
||||||
|
nextTick(() => {
|
||||||
|
proTableRef?.value!.getTableList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scope lang="scss">
|
<style scope lang="scss">
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export const handleDel = (params: any) => {
|
|||||||
});
|
});
|
||||||
const result = await getSubscribeDelApi(ids.join(","));
|
const result = await getSubscribeDelApi(ids.join(","));
|
||||||
if (result?.code === 0) {
|
if (result?.code === 0) {
|
||||||
proTable.value!.getTableList();
|
proTable?.value!.getTableList();
|
||||||
useMsg("success", "删除成功 !");
|
useMsg("success", "删除成功 !");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -10,15 +10,18 @@ export const setDetailsData = (dataStore: any, data: any) => {
|
|||||||
if (data?.customers?.length) {
|
if (data?.customers?.length) {
|
||||||
data?.customers?.forEach((item: any) => {
|
data?.customers?.forEach((item: any) => {
|
||||||
//客户编码
|
//客户编码
|
||||||
dataStore.ruleForm.customers.push(item.customer_number);
|
dataStore.ruleForm.customers.push(item.customer_number + "_" + item.use_org_number);
|
||||||
//客户名称下拉框数据初始化
|
//客户名称下拉框数据初始化
|
||||||
customers_names.push({
|
customers_names.push({
|
||||||
value: item.customer_number,
|
value: item.customer_number + "_" + item.use_org_number,
|
||||||
label: item.customer_name,
|
label: item.customer_name + " " + `(${item.use_org_name})`,
|
||||||
org_number: "100"
|
id: item.use_org_number,
|
||||||
|
useOrgName: item.use_org_name
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//客户名称值回填
|
//客户名称值回填
|
||||||
|
dataStore.ruleForm.customer_number1 = dataStore.ruleForm.customers;
|
||||||
dataStore.ruleForm.customer_number = dataStore.ruleForm.customers;
|
dataStore.ruleForm.customer_number = dataStore.ruleForm.customers;
|
||||||
//客户名称下拉框数据
|
//客户名称下拉框数据
|
||||||
dataStore.formData[1].options = customers_names;
|
dataStore.formData[1].options = customers_names;
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
value: 1,
|
value: 1,
|
||||||
label: "成功"
|
label: "成功"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
value: "空",
|
||||||
|
label: "空"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
value: -1,
|
value: -1,
|
||||||
label: "失败"
|
label: "失败"
|
||||||
@@ -65,11 +69,11 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
options: []
|
options: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "warehouse_number",
|
prop: "warehouse_name",
|
||||||
placeholder: "请选择仓库",
|
placeholder: "请输入仓库",
|
||||||
type: "select",
|
type: "input",
|
||||||
label: "仓库: ",
|
label: "仓库: "
|
||||||
options: []
|
// options: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "sub_warehouse_name",
|
prop: "sub_warehouse_name",
|
||||||
@@ -77,7 +81,12 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
type: "input",
|
type: "input",
|
||||||
label: "子仓库: "
|
label: "子仓库: "
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: "customer_name",
|
||||||
|
placeholder: "请输入客户名称",
|
||||||
|
type: "input",
|
||||||
|
label: "客户名称: "
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: "Time",
|
prop: "Time",
|
||||||
type: "daterange",
|
type: "daterange",
|
||||||
|
|||||||
@@ -11,13 +11,15 @@ export const COLUMNS = [
|
|||||||
align: "left",
|
align: "left",
|
||||||
label: "来源单号",
|
label: "来源单号",
|
||||||
prop: "src_bill_no",
|
prop: "src_bill_no",
|
||||||
width: 140
|
width: 140,
|
||||||
|
fixed: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "订单单号",
|
label: "订单单号",
|
||||||
prop: "order_no",
|
prop: "order_no",
|
||||||
width: 140
|
width: 140,
|
||||||
|
fixed: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
@@ -25,18 +27,18 @@ export const COLUMNS = [
|
|||||||
prop: "customer_name",
|
prop: "customer_name",
|
||||||
width: 140
|
width: 140
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "入库组织",
|
label: "入库时间",
|
||||||
prop: "warehousing_org_name",
|
prop: "storage_time",
|
||||||
width: 200
|
width: 160
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "单据类型",
|
label: "单据类型",
|
||||||
prop: "bill_type_name",
|
prop: "bill_type_name",
|
||||||
width: 140
|
width: 80
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
@@ -60,7 +62,7 @@ export const COLUMNS = [
|
|||||||
align: "left",
|
align: "left",
|
||||||
label: "出厂价",
|
label: "出厂价",
|
||||||
prop: "factory_price",
|
prop: "factory_price",
|
||||||
width: 140
|
width: 66
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
@@ -78,7 +80,7 @@ export const COLUMNS = [
|
|||||||
align: "left",
|
align: "left",
|
||||||
label: "入库数量",
|
label: "入库数量",
|
||||||
prop: "real_qty",
|
prop: "real_qty",
|
||||||
width: 140
|
width: 76
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
@@ -90,13 +92,13 @@ export const COLUMNS = [
|
|||||||
align: "left",
|
align: "left",
|
||||||
label: "单位",
|
label: "单位",
|
||||||
prop: "unit_name",
|
prop: "unit_name",
|
||||||
width: 120
|
width: 50
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "入库时间",
|
label: "入库组织",
|
||||||
prop: "storage_time",
|
prop: "warehousing_org_name",
|
||||||
width: 160
|
width: 200
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!-- 入库单 -->
|
<!-- 入库单列表 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="table-box">
|
<div class="table-box">
|
||||||
<div style="padding-bottom: 16px">
|
<div style="padding-bottom: 16px">
|
||||||
@@ -23,6 +23,23 @@
|
|||||||
:formData="dataStore.formData"
|
:formData="dataStore.formData"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
<template #notif_ret_text="scope">
|
||||||
|
<div
|
||||||
|
v-if="scope.row.notif_ret_text === '成功'"
|
||||||
|
style="color: #4178d5; cursor: pointer"
|
||||||
|
@click="handleClickSuccess(scope.row)"
|
||||||
|
>
|
||||||
|
{{ scope.row.notif_ret_text }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-else-if="scope.row.notif_ret_text === '失败'"
|
||||||
|
style="color: red; cursor: pointer"
|
||||||
|
@click="handleClickError(scope.row)"
|
||||||
|
>
|
||||||
|
{{ scope.row.notif_ret_text }}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="!scope.row.notif_ret_text">--</div>
|
||||||
|
</template>
|
||||||
</ProTable>
|
</ProTable>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -84,7 +101,7 @@ const handleSearch = async (params: any) => {
|
|||||||
dataStore.initParam = cloneDeep(params);
|
dataStore.initParam = cloneDeep(params);
|
||||||
//这里需要等到表格刷新以后才去请求
|
//这里需要等到表格刷新以后才去请求
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
proTable.value!.getTableList();
|
proTable?.value!.getTableList();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
//重置
|
//重置
|
||||||
@@ -93,7 +110,26 @@ const handleReset = () => {
|
|||||||
init();
|
init();
|
||||||
//这里需要等到表格刷新以后才去请求
|
//这里需要等到表格刷新以后才去请求
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
proTable.value!.getTableList();
|
proTable?.value!.getTableList();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const handleClickSuccess = (row: any) => {
|
||||||
|
Array.isArray;
|
||||||
|
ElMessageBox.alert(
|
||||||
|
`<div style='font-size:16px'>${
|
||||||
|
Array.isArray(row?.notif_user_names) && row?.notif_user_names.length ? row?.notif_user_names.join(",") : ""
|
||||||
|
}</div>`,
|
||||||
|
"接收人",
|
||||||
|
{
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
showConfirmButton: false
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
const handleClickError = (row: any) => {
|
||||||
|
ElMessageBox.alert(`<div style='font-size:16px'>${row.fail_msg}</div>`, "失败原因", {
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
showConfirmButton: false
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,19 +1,23 @@
|
|||||||
import { useMsg } from "@/hooks/useMsg";
|
import { useMsg } from "@/hooks/useMsg";
|
||||||
import { getSubscribeResetListApi, getSubscribeResetListExportApi } from "@/api/modules/warehousing";
|
import { getSubscribeResetListApi, getSubscribeResetListExportApi } from "@/api/modules/warehousing";
|
||||||
|
import { cloneDeep } from "lodash-es";
|
||||||
// 导出
|
// 导出
|
||||||
export const handleExport = async (params: any) => {
|
export const handleExport = async (data: any) => {
|
||||||
const { initParam } = params;
|
const { initParam } = data;
|
||||||
const result = await getSubscribeResetListExportApi(initParam);
|
let params = cloneDeep(initParam);
|
||||||
|
params.org_number =
|
||||||
|
Array.isArray(params?.org_number) && params?.org_number?.length ? params.org_number.join(",") : params.org_number;
|
||||||
|
const result = await getSubscribeResetListExportApi(params);
|
||||||
if (result?.code === 0) {
|
if (result?.code === 0) {
|
||||||
useMsg("success", "导出成功 !");
|
useMsg("success", "导出成功请前往导出列表中进行下载 !");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// proTable: any
|
// proTable: any
|
||||||
export const handleReSet = async (item: any, selectionList: any[], proTable: any) => {
|
export const handleReSet = async (params: any) => {
|
||||||
console.log("刷新操作", item);
|
const { proTable, selectionList } = params;
|
||||||
let length = selectionList.length;
|
let length = selectionList.length;
|
||||||
if (length && length > 100) {
|
if (length && length > 100) {
|
||||||
useMsg("warning", "选中刷新数据最大100条!");
|
useMsg("warning", "选中刷新数据最大100条 !");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let ids: any = [];
|
let ids: any = [];
|
||||||
@@ -25,7 +29,7 @@ export const handleReSet = async (item: any, selectionList: any[], proTable: any
|
|||||||
const result = await getSubscribeResetListApi({ id });
|
const result = await getSubscribeResetListApi({ id });
|
||||||
if (result?.code === 0) {
|
if (result?.code === 0) {
|
||||||
useMsg("success", "数据刷新成功 !");
|
useMsg("success", "数据刷新成功 !");
|
||||||
proTable.value!.getTableList();
|
proTable?.value!.getTableList();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,30 +6,33 @@
|
|||||||
|
|
||||||
<script setup lang="ts" name="home">
|
<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";
|
import { useUserStore } from "@/stores/modules/user";
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
//获取组织
|
//路由;
|
||||||
const getOrgs = async () => {
|
const $route = useRoute();
|
||||||
const result = await getOrgsApi();
|
const $router = useRouter();
|
||||||
if (result?.code === 0) {
|
// //获取组织
|
||||||
const { data } = result;
|
// const getOrgs = async () => {
|
||||||
if (data?.length) {
|
// const result = await getOrgsApi();
|
||||||
let options: any = [];
|
// if (result?.code === 0) {
|
||||||
data.forEach((item: any) => {
|
// const { data } = result;
|
||||||
options.push({
|
// if (data?.length) {
|
||||||
id: item.id,
|
// let options: any = [];
|
||||||
value: item.org_number,
|
// data.forEach((item: any) => {
|
||||||
label: item.org_name
|
// options.push({
|
||||||
});
|
// id: item.id,
|
||||||
});
|
// value: item.org_number,
|
||||||
userStore.setOrgIdArr(options);
|
// label: item.org_name
|
||||||
}
|
// });
|
||||||
}
|
// });
|
||||||
};
|
// userStore.setOrgIdArr(options);
|
||||||
getOrgs();
|
// }
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
// getOrgs();
|
||||||
const getWarehousesList = async () => {
|
const getWarehousesList = async () => {
|
||||||
const result = await getWarehousesListApi();
|
const result = await getWarehousesListApi();
|
||||||
if (result?.code === 0) {
|
if (result?.code === 0) {
|
||||||
@@ -48,6 +51,16 @@ const getWarehousesList = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
getWarehousesList();
|
getWarehousesList();
|
||||||
|
|
||||||
|
const init = () => {
|
||||||
|
let redirect_path: any = $route.query.redirect_path;
|
||||||
|
if (redirect_path) {
|
||||||
|
setTimeout(() => {
|
||||||
|
$router.push({ path: redirect_path });
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
init();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
//useRouter
|
//useRouter
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
import { getOrgsApi, getWarehousesListApi } from "@/api/modules/global";
|
||||||
// import { useMsg } from "@/hooks/useMsg";
|
// import { useMsg } from "@/hooks/useMsg";
|
||||||
//重定向
|
//重定向
|
||||||
import { usePathUrl } from "@/hooks/usePathUrl";
|
import { usePathUrl } from "@/hooks/usePathUrl";
|
||||||
@@ -18,18 +19,66 @@ const userStore = useUserStore();
|
|||||||
const $route = useRoute();
|
const $route = useRoute();
|
||||||
const $router = useRouter();
|
const $router = useRouter();
|
||||||
|
|
||||||
|
//获取组织
|
||||||
|
const getOrgs = async () => {
|
||||||
|
const result = await getOrgsApi();
|
||||||
|
if (result?.code === 0) {
|
||||||
|
const { data } = result;
|
||||||
|
if (data?.length) {
|
||||||
|
let options: any = [];
|
||||||
|
data.forEach((item: any) => {
|
||||||
|
options.push({
|
||||||
|
id: item.id,
|
||||||
|
value: item.org_number,
|
||||||
|
label: item.org_name
|
||||||
|
});
|
||||||
|
});
|
||||||
|
userStore.setOrgIdArr(options);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 登录
|
// 登录
|
||||||
const loginHttp = async (code: any) => {
|
const loginHttp = async (code: any) => {
|
||||||
const result: Record<string, any> = await loginApi(code);
|
const result: Record<string, any> = await loginApi(code);
|
||||||
if (result.code === 0) {
|
if (result.code === 0) {
|
||||||
userStore.setToken(result?.data?.access_token);
|
userStore.setToken(result?.data?.access_token);
|
||||||
console.log(result?.data?.access_token, "=data.access_token=");
|
|
||||||
// 设置用户信息
|
// 设置用户信息
|
||||||
userStore.setUserInfo(result?.data?.user_data);
|
userStore.setUserInfo(result?.data?.user_data);
|
||||||
//设置好了token和用户信息跳转到首页
|
|
||||||
|
let redirect_path: any = $route.query.redirect_path;
|
||||||
|
|
||||||
|
if (result?.data?.access_token) {
|
||||||
|
getWarehousesList();
|
||||||
|
getOrgs();
|
||||||
|
}
|
||||||
|
if (redirect_path) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
$router.push({ path: "/" });
|
$router.replace({ path: redirect_path });
|
||||||
}, 500);
|
}, 500);
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
$router.replace({ path: "/" });
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
location.href = usePathUrl();
|
location.href = usePathUrl();
|
||||||
}
|
}
|
||||||
@@ -37,14 +86,20 @@ const loginHttp = async (code: any) => {
|
|||||||
|
|
||||||
// 登录前的判断
|
// 登录前的判断
|
||||||
const login = () => {
|
const login = () => {
|
||||||
const { code } = $route.query;
|
const { code, redirect_path } = $route.query;
|
||||||
// 没有code直接跳转到登录页
|
// 没有code直接跳转到登录页
|
||||||
|
if (!code && redirect_path) {
|
||||||
|
location.href = usePathUrl(redirect_path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!code) {
|
if (!code) {
|
||||||
location.href = usePathUrl();
|
location.href = usePathUrl();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 有code就登录请求
|
// 有code就登录请求
|
||||||
|
if (code) {
|
||||||
loginHttp(code);
|
loginHttp(code);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
login();
|
login();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
export const BUTTON = [
|
export const BUTTON = [
|
||||||
|
{
|
||||||
|
text: "返回",
|
||||||
|
permission: "receiptWarehousingReceiptOrderAddBtnBack",
|
||||||
|
type: "back"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: "提交",
|
text: "提交",
|
||||||
permission: "receiptWarehousingReceiptOrderAddBtnCommit",
|
permission: "receiptWarehousingReceiptOrderAddBtnSubmit",
|
||||||
type: "commit",
|
type: "submit",
|
||||||
props: {
|
props: {
|
||||||
type: "primary"
|
type: "primary"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
export const BUTTON = [
|
||||||
|
{
|
||||||
|
text: "返回",
|
||||||
|
permission: "receiptWarehousingReceiptOrderDetailsBtnBack",
|
||||||
|
type: "back"
|
||||||
|
}
|
||||||
|
];
|
||||||
@@ -19,12 +19,12 @@ export const BUTTON = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "导出",
|
text: "导出",
|
||||||
permission: "inspectionManagementReportBtnExport",
|
permission: "receiptWarehousingReceiptOrderBtnExport",
|
||||||
type: "export"
|
type: "export"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "刷新",
|
text: "刷新",
|
||||||
permission: "inspectionManagementReportBtnRefresh",
|
permission: "receiptWarehousingReceiptOrderBtnRefresh",
|
||||||
type: "refresh"
|
type: "refresh"
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -9,14 +9,20 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ProTable
|
<ProTable
|
||||||
ref="proTable"
|
ref="proTableRef"
|
||||||
:formData="dataStore.formData"
|
|
||||||
:columns="dataStore.columns"
|
:columns="dataStore.columns"
|
||||||
:request-api="getMaterialListApi"
|
:request-api="getMaterialListApi"
|
||||||
:init-param="dataStore.initParam"
|
:init-param="dataStore.initParam"
|
||||||
@selectionChange="selectionChange"
|
@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">
|
<template #boxBillNo="scope">
|
||||||
<a @click="handleOpen(scope.row)" class="break-word to-details">
|
<a @click="handleOpen(scope.row)" class="break-word to-details">
|
||||||
{{ scope.row.boxBillNo }}
|
{{ scope.row.boxBillNo }}
|
||||||
@@ -28,7 +34,6 @@
|
|||||||
|
|
||||||
<script setup lang="ts" name="inspectionManagementReport">
|
<script setup lang="ts" name="inspectionManagementReport">
|
||||||
import ProTable from "@/components/ProTable/index.vue";
|
import ProTable from "@/components/ProTable/index.vue";
|
||||||
|
|
||||||
// import { useMsg } from "@/hooks/useMsg";
|
// import { useMsg } from "@/hooks/useMsg";
|
||||||
import PermissionButton from "@/components/PermissionButton/index.vue";
|
import PermissionButton from "@/components/PermissionButton/index.vue";
|
||||||
import { getMaterialListApi } from "@/api/modules/foundationMaterial";
|
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";
|
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
|
||||||
//表格TS
|
//表格TS
|
||||||
import { ProTableInstance } from "@/components/ProTable/interface";
|
import { ProTableInstance } from "@/components/ProTable/interface";
|
||||||
import { useUserStore } from "@/stores/modules/user";
|
|
||||||
import { btnClick } from "./init";
|
import { btnClick } from "./init";
|
||||||
//深拷贝方法
|
//深拷贝方法
|
||||||
import { cloneDeep } from "lodash-es";
|
import { cloneDeep } from "lodash-es";
|
||||||
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||||
const proTable = ref<ProTableInstance>();
|
const proTableRef = ref<ProTableInstance>();
|
||||||
|
|
||||||
const $router = useRouter();
|
const $router = useRouter();
|
||||||
// 获取用户信息(组织id)
|
|
||||||
const userStore = useUserStore();
|
|
||||||
// 数据源
|
// 数据源
|
||||||
const dataStore = reactive<any>({
|
const dataStore = reactive<any>({
|
||||||
columns: COLUMNS, //列表配置项
|
columns: COLUMNS, //列表配置项
|
||||||
@@ -67,39 +70,26 @@ const handleButtonClickCallback = (item: any) => {
|
|||||||
const { type } = item;
|
const { type } = item;
|
||||||
btnClick[type](item, $router);
|
btnClick[type](item, $router);
|
||||||
};
|
};
|
||||||
// // 规格型号
|
//搜索
|
||||||
// const remoteMethod1 = async (query: any) => {
|
const handleSearch = async (params: any) => {
|
||||||
// datas.loading = true;
|
dataStore.initParam = cloneDeep(params);
|
||||||
// if (!query) {
|
//这里需要等到表格刷新以后才去请求
|
||||||
// datas.loading = false;
|
nextTick(() => {
|
||||||
// return;
|
proTableRef?.value!.getTableList();
|
||||||
// }
|
});
|
||||||
// let valClone = query.replace(/^\s*|\s*$/g, "");
|
};
|
||||||
// if (!valClone.length) {
|
//重置
|
||||||
// datas.loading = false;
|
const handleReset = () => {
|
||||||
// return;
|
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||||
// }
|
// init();
|
||||||
// const result = await getMaterialListApi(valClone);
|
//这里需要等到表格刷新以后才去请求
|
||||||
// if (result.status === 200) {
|
nextTick(() => {
|
||||||
// const { data } = result;
|
proTableRef?.value!.getTableList();
|
||||||
// datas.options = data;
|
});
|
||||||
// }
|
};
|
||||||
// datas.loading = false;
|
|
||||||
// };
|
|
||||||
const handleOpen = (row: any) => {
|
const handleOpen = (row: any) => {
|
||||||
console.log(row);
|
console.log(row);
|
||||||
};
|
};
|
||||||
watch(
|
|
||||||
() => userStore.orgCode,
|
|
||||||
newVal => {
|
|
||||||
dataStore.ruleForm.orgCode = newVal;
|
|
||||||
dataStore.initParam.orgCode = newVal;
|
|
||||||
},
|
|
||||||
{
|
|
||||||
immediate: true,
|
|
||||||
deep: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scope lang="scss">
|
<style scope lang="scss">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export const BUTTON = [
|
export const BUTTON = [
|
||||||
{
|
{
|
||||||
text: "重传",
|
text: "重传",
|
||||||
permission: "receiptWarehousingWarehousingOrderBtnRetransmission",
|
permission: "receiptWarehousingWarehousingOrderBtnCC",
|
||||||
type: "retransmission",
|
type: "retransmission",
|
||||||
props: {
|
props: {
|
||||||
type: "primary"
|
type: "primary"
|
||||||
@@ -14,7 +14,7 @@ export const BUTTON = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "同步成功",
|
text: "同步成功",
|
||||||
permission: "receiptWarehousingWarehousingOrderBtnSynchronize",
|
permission: "receiptWarehousingWarehousingOrderBtnTB",
|
||||||
type: "synchronize"
|
type: "synchronize"
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -20,22 +20,19 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
prop: "securityNumbers",
|
prop: "securityNumbers",
|
||||||
placeholder: "请输入来源单号",
|
placeholder: "请输入来源单号",
|
||||||
type: "input",
|
type: "input",
|
||||||
isArray: true,
|
|
||||||
label: "来源单号: "
|
label: "来源单号: "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "lotNumbers",
|
prop: "lotNumbers",
|
||||||
placeholder: "请选择收货类型",
|
placeholder: "请选择来源类型",
|
||||||
type: "select",
|
type: "select",
|
||||||
isArray: true,
|
label: "来源类型: ",
|
||||||
label: "收货类型: ",
|
|
||||||
options: []
|
options: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "lotNumbers",
|
prop: "lotNumbers",
|
||||||
placeholder: "请选择仓库",
|
placeholder: "请选择仓库",
|
||||||
type: "select",
|
type: "select",
|
||||||
isArray: true,
|
|
||||||
label: "仓库: ",
|
label: "仓库: ",
|
||||||
options: []
|
options: []
|
||||||
},
|
},
|
||||||
@@ -43,34 +40,23 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
prop: "Time",
|
prop: "Time",
|
||||||
type: "daterange",
|
type: "daterange",
|
||||||
options: [],
|
options: [],
|
||||||
startPlaceholder: "收货开始日期",
|
startPlaceholder: "创建开始日期",
|
||||||
endPlaceholder: "收货结束日期",
|
endPlaceholder: "创建结束日期",
|
||||||
startDate: "createBeginDate",
|
startDate: "createBeginDate",
|
||||||
endDate: "createEndDate",
|
endDate: "createEndDate",
|
||||||
label: "收货时间: "
|
label: "创建日期: "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "securityNumbers",
|
||||||
|
placeholder: "请输入编码,型号,名称",
|
||||||
|
type: "input",
|
||||||
|
label: "物料: "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "lotNumbers",
|
prop: "lotNumbers",
|
||||||
placeholder: "请选择供应商",
|
placeholder: "请选择发货状态",
|
||||||
type: "select",
|
type: "select",
|
||||||
isArray: true,
|
label: "发货状态: ",
|
||||||
label: "供应商: ",
|
|
||||||
options: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "materialNumber",
|
|
||||||
placeholder: "请输入物料编码",
|
|
||||||
type: "selectRemote1",
|
|
||||||
isArray: true,
|
|
||||||
options: [],
|
|
||||||
label: "物料编码: "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: "lotNumbers",
|
|
||||||
placeholder: "请选择收货状态",
|
|
||||||
type: "select",
|
|
||||||
isArray: true,
|
|
||||||
label: "收货状态: ",
|
|
||||||
options: []
|
options: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -78,30 +64,50 @@ export const FORM_DATA: FormItem[] = [
|
|||||||
placeholder: "请选择组织",
|
placeholder: "请选择组织",
|
||||||
type: "select",
|
type: "select",
|
||||||
isArray: true,
|
isArray: true,
|
||||||
label: "组织: "
|
label: "组织: ",
|
||||||
|
options: []
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
prop: "securityNumbers",
|
prop: "securityNumbers",
|
||||||
placeholder: "请输入收货人",
|
placeholder: "请输入收货客户",
|
||||||
type: "input",
|
type: "input",
|
||||||
isArray: true,
|
label: "收货客户: "
|
||||||
label: "收货人: "
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
prop: "securityNumbers",
|
prop: "securityNumbers",
|
||||||
placeholder: "请输入箱号",
|
placeholder: "请输入箱号",
|
||||||
type: "input",
|
type: "inputBtn",
|
||||||
isArray: true,
|
isArray: true,
|
||||||
label: "箱号: "
|
label: "箱号: "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "securityNumbers",
|
prop: "securityNumbers",
|
||||||
placeholder: "请输入序列号",
|
placeholder: "请输入序列号",
|
||||||
type: "input",
|
type: "inputBtn",
|
||||||
isArray: true,
|
isArray: true,
|
||||||
label: "序列号: "
|
label: "序列号: "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "securityNumbers",
|
||||||
|
placeholder: "请输入调入仓库",
|
||||||
|
type: "input",
|
||||||
|
|
||||||
|
label: "调入仓库: "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "securityNumbers",
|
||||||
|
placeholder: "请输入单号",
|
||||||
|
type: "inputBtn",
|
||||||
|
label: "单号: ",
|
||||||
|
isArray: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "lotNumbers",
|
||||||
|
placeholder: "请选择组织",
|
||||||
|
type: "select",
|
||||||
|
isArray: true,
|
||||||
|
label: "拣货类型: ",
|
||||||
|
options: []
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!-- 质检单 -->
|
<!-- 发货单 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="table-box">
|
<div class="table-box">
|
||||||
<div style="padding-bottom: 16px">
|
<div style="padding-bottom: 16px">
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ProTable
|
<ProTable
|
||||||
ref="proTable"
|
ref="proTableRef"
|
||||||
:formData="dataStore.formData"
|
:formData="dataStore.formData"
|
||||||
:columns="dataStore.columns"
|
:columns="dataStore.columns"
|
||||||
:request-api="getMaterialListApi"
|
:request-api="getMaterialListApi"
|
||||||
@@ -22,6 +22,14 @@
|
|||||||
{{ scope.row.boxBillNo }}
|
{{ scope.row.boxBillNo }}
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-slot:search>
|
||||||
|
<SearchForm
|
||||||
|
@search="handleSearch"
|
||||||
|
@reset="handleReset"
|
||||||
|
:searchParams="dataStore.initParam"
|
||||||
|
:formData="dataStore.formData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
</ProTable>
|
</ProTable>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -32,21 +40,19 @@ import ProTable from "@/components/ProTable/index.vue";
|
|||||||
// import { useMsg } from "@/hooks/useMsg";
|
// import { useMsg } from "@/hooks/useMsg";
|
||||||
import PermissionButton from "@/components/PermissionButton/index.vue";
|
import PermissionButton from "@/components/PermissionButton/index.vue";
|
||||||
import { getMaterialListApi } from "@/api/modules/foundationMaterial";
|
import { getMaterialListApi } from "@/api/modules/foundationMaterial";
|
||||||
// import { useAuthStore } from "@/stores/modules/auth";
|
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
|
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
|
||||||
//表格TS
|
//表格TS
|
||||||
import { ProTableInstance } from "@/components/ProTable/interface";
|
import { ProTableInstance } from "@/components/ProTable/interface";
|
||||||
import { useUserStore } from "@/stores/modules/user";
|
|
||||||
import { btnClick } from "./init";
|
import { btnClick } from "./init";
|
||||||
//深拷贝方法
|
//深拷贝方法
|
||||||
import { cloneDeep } from "lodash-es";
|
import { cloneDeep } from "lodash-es";
|
||||||
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||||
const proTable = ref<ProTableInstance>();
|
const proTableRef = ref<ProTableInstance>();
|
||||||
|
|
||||||
const $router = useRouter();
|
const $router = useRouter();
|
||||||
// 获取用户信息(组织id)
|
|
||||||
const userStore = useUserStore();
|
|
||||||
// 数据源
|
// 数据源
|
||||||
const dataStore = reactive<any>({
|
const dataStore = reactive<any>({
|
||||||
columns: COLUMNS, //列表配置项
|
columns: COLUMNS, //列表配置项
|
||||||
@@ -66,39 +72,27 @@ const selectionChange = (selection: any) => {
|
|||||||
const handleButtonClickCallback = (item: any) => {
|
const handleButtonClickCallback = (item: any) => {
|
||||||
btnClick[item?.type](item, $router);
|
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) => {
|
const handleOpen = (row: any) => {
|
||||||
console.log(row);
|
console.log(row);
|
||||||
};
|
};
|
||||||
watch(
|
|
||||||
() => userStore.orgCode,
|
// 搜索
|
||||||
newVal => {
|
const handleSearch = async (params: any) => {
|
||||||
dataStore.ruleForm.orgCode = newVal;
|
dataStore.initParam = cloneDeep(params);
|
||||||
dataStore.initParam.orgCode = newVal;
|
//这里需要等到表格刷新以后才去请求
|
||||||
},
|
nextTick(() => {
|
||||||
{
|
proTableRef?.value!.getTableList();
|
||||||
immediate: true,
|
});
|
||||||
deep: true
|
};
|
||||||
}
|
// 重置
|
||||||
);
|
const handleReset = () => {
|
||||||
|
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||||
|
//这里需要等到表格刷新以后才去请求
|
||||||
|
nextTick(() => {
|
||||||
|
proTableRef?.value!.getTableList();
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scope lang="scss">
|
<style scope lang="scss">
|
||||||
|
|||||||
367
vite.config.ts.timestamp-1761094820807-dbd99bea932ef.mjs
Normal file
367
vite.config.ts.timestamp-1761094820807-dbd99bea932ef.mjs
Normal file
File diff suppressed because one or more lines are too long
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
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user