Compare commits
22 Commits
e259886cbc
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| c0750ed493 | |||
| 8a958c987e | |||
| 0861dae12d | |||
| e8dc354c10 | |||
| eea0925899 | |||
| c913152460 | |||
| 7efeb8faf0 | |||
| 8a064cf1b9 | |||
| f08b094efc | |||
| 9aa3782667 | |||
| 574c46580f | |||
| 3c72a248fa | |||
| f057f07ce7 | |||
| 54522f7ca2 | |||
| c18746fcf5 | |||
| ef38880743 | |||
| 190be3b7ce | |||
| efee846973 | |||
| 2837efee97 | |||
| 7b4e4f81d2 | |||
| 629232a243 | |||
| b9c5ded6ec |
2
.env
2
.env
@@ -1,5 +1,5 @@
|
||||
# title
|
||||
VITE_GLOB_APP_TITLE = OPS供应链系统
|
||||
VITE_GLOB_APP_TITLE = WMS系统
|
||||
|
||||
# 本地运行端口号
|
||||
VITE_PORT = 8080
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
ENV = 'test'
|
||||
ENV = 'dev'
|
||||
VITE_APP_API_VERSION =""
|
||||
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_REDIRECT_URL =http://localhost:8080/login #单点从定向地址
|
||||
VITE_SINGLE_URL = https://dev.uc.v3.f2b211.com/ #测试环境单点登录通知
|
||||
|
||||
# 测试环境
|
||||
VITE_USER_NODE_ENV = test
|
||||
VITE_USER_NODE_ENV = development
|
||||
|
||||
# 公共基础路径
|
||||
VITE_PUBLIC_PATH = /
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
ENV = 'production'
|
||||
VITE_APP_API_VERSION = "" #版本号
|
||||
VITE_APP_API_BASEURL = https://opsscmapi.f2b211.com/api/ #请求地址
|
||||
VITE_APP_SSO_LOGINURL = http://uc.v3.f2b211.com/uc/login
|
||||
VITE_APP_SSO_APPID = 100664627590856707
|
||||
VITE_APP_API_BASEURL = https://newwms.api.f2b211.com/v1/admapi/ #请求地址
|
||||
VITE_APP_SSO_LOGINURL = https://uc.v3.f2b211.com/uc/login
|
||||
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_USER_NODE_ENV = production
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ENV = 'test'
|
||||
VITE_APP_API_VERSION =""
|
||||
VITE_APP_API_BASEURL = https://dev.wms.api.v2.f2b211.com/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_API_BASEURL = https://dev.wms.api.v2.f2b211.com/v1/admapi/
|
||||
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_REDIRECT_URL =https://dev.wms.v2.f2b211.com/login #单点从定向地址
|
||||
|
||||
@@ -60,8 +60,17 @@ class RequestHttp {
|
||||
this.service.interceptors.response.use(
|
||||
(response: AxiosResponse) => {
|
||||
const { data } = response;
|
||||
// const userStore = useUserStore();
|
||||
|
||||
tryHideFullScreenLoading();
|
||||
// 获取响应头中的 Authorization 信息
|
||||
const authorization = response.headers["authorization"];
|
||||
//刷新token
|
||||
if (authorization) {
|
||||
// 可以在这里更新用户的 token 信息
|
||||
const userStore = useUserStore();
|
||||
userStore.setToken(authorization);
|
||||
return data;
|
||||
}
|
||||
// 登陆失效
|
||||
if (data.code == 401) {
|
||||
ElMessage.error(data.msg || data.message);
|
||||
|
||||
@@ -6,5 +6,15 @@ import http from "@/api";
|
||||
|
||||
//物料分页列表
|
||||
export const getMaterialListApi = (params: any) => {
|
||||
if (params.disabled && params.disabled === "启用") {
|
||||
params.disabled = 0;
|
||||
}
|
||||
return http.get<any>(`material`, params);
|
||||
};
|
||||
//刷新 /admapi/material/reload
|
||||
export const getMaterialListReloadApi = (params: any) => {
|
||||
return http.get<any>(`material/reload`, params);
|
||||
};
|
||||
export const getMaterialListExportApi = (params: any) => {
|
||||
return http.get<any>(`material/export`, params);
|
||||
};
|
||||
|
||||
@@ -24,3 +24,8 @@ export const getUsersApi = (params: any) => {
|
||||
export const getProductLinesApi = (params: any) => {
|
||||
return http.get<any>(`basicinfo/productlines`, params);
|
||||
};
|
||||
|
||||
//仓库
|
||||
export const getWarehousesListApi = () => {
|
||||
return http.get<any>(`basicinfo/warehouses`);
|
||||
};
|
||||
|
||||
@@ -17,7 +17,6 @@ export const loginApi = (params: Login.ReqLoginCode) => {
|
||||
|
||||
// 获取菜单列表
|
||||
export const getAuthMenuListApi = () => {
|
||||
console.log("触发了吗");
|
||||
return http.get<any>(`/user/permissions`, {}, { noLoading: true });
|
||||
// return authMenuList;
|
||||
};
|
||||
|
||||
19
src/api/modules/warehousing.ts
Normal file
19
src/api/modules/warehousing.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import http from "@/api";
|
||||
|
||||
//订阅入庫單列表 /admapi/subscribe /admapi/subscribe/wrr
|
||||
export const getSubscribeWrrListApi = (params: any) => {
|
||||
if (params?.notif_ret_status === "空") {
|
||||
params.notif_ret_status = 0;
|
||||
}
|
||||
return http.get<any>(`subscribe/wrr`, params);
|
||||
};
|
||||
//订阅入库单刷新
|
||||
export const getSubscribeResetListApi = (params: any) => {
|
||||
return http.get<any>(`subscribe/wrr/reload`, params);
|
||||
};
|
||||
export const getSubscribeResetListExportApi = (params: any) => {
|
||||
if (params?.notif_ret_status === "空") {
|
||||
params.notif_ret_status = 0;
|
||||
}
|
||||
return http.get<any>(`subscribe/wrr/export`, params);
|
||||
};
|
||||
6
src/components.d.ts
vendored
6
src/components.d.ts
vendored
@@ -13,13 +13,12 @@ declare module "vue" {
|
||||
ColSetting: typeof import("./components/ProTable/components/ColSetting.vue")["default"];
|
||||
DetailsSearch: typeof import("./components/DetailsSearch/index.vue")["default"];
|
||||
ElAside: typeof import("element-plus/es")["ElAside"];
|
||||
ElAutocomplete: typeof import("element-plus/es")["ElAutocomplete"];
|
||||
ElBreadcrumb: typeof import("element-plus/es")["ElBreadcrumb"];
|
||||
ElBreadcrumbItem: typeof import("element-plus/es")["ElBreadcrumbItem"];
|
||||
ElButton: typeof import("element-plus/es")["ElButton"];
|
||||
ElCheckbox: typeof import("element-plus/es")["ElCheckbox"];
|
||||
ElContainer: typeof import("element-plus/es")["ElContainer"];
|
||||
ElDatePicker: typeof import("element-plus/es")["ElDatePicker"];
|
||||
ElDialog: typeof import("element-plus/es")["ElDialog"];
|
||||
ElDrawer: typeof import("element-plus/es")["ElDrawer"];
|
||||
ElDropdown: typeof import("element-plus/es")["ElDropdown"];
|
||||
ElDropdownItem: typeof import("element-plus/es")["ElDropdownItem"];
|
||||
@@ -29,6 +28,7 @@ declare module "vue" {
|
||||
ElHeader: typeof import("element-plus/es")["ElHeader"];
|
||||
ElIcon: typeof import("element-plus/es")["ElIcon"];
|
||||
ElInput: typeof import("element-plus/es")["ElInput"];
|
||||
ElInputNumber: typeof import("element-plus/es")["ElInputNumber"];
|
||||
ElMain: typeof import("element-plus/es")["ElMain"];
|
||||
ElMenu: typeof import("element-plus/es")["ElMenu"];
|
||||
ElMenuItem: typeof import("element-plus/es")["ElMenuItem"];
|
||||
@@ -43,6 +43,7 @@ declare module "vue" {
|
||||
ElTabPane: typeof import("element-plus/es")["ElTabPane"];
|
||||
ElTabs: typeof import("element-plus/es")["ElTabs"];
|
||||
ElTag: typeof import("element-plus/es")["ElTag"];
|
||||
ElTooltip: typeof import("element-plus/es")["ElTooltip"];
|
||||
Empty: typeof import("./components/ProTable/components/Empty.vue")["default"];
|
||||
Form: typeof import("./components/Form/index.vue")["default"];
|
||||
FormItem: typeof import("./components/Form/components/FormItem.vue")["default"];
|
||||
@@ -55,7 +56,6 @@ declare module "vue" {
|
||||
IEpFullScreen: typeof import("~icons/ep/full-screen")["default"];
|
||||
IEpRefresh: typeof import("~icons/ep/refresh")["default"];
|
||||
IEpRemove: typeof import("~icons/ep/remove")["default"];
|
||||
IEpSearch: typeof import("~icons/ep/search")["default"];
|
||||
IEpSwitchButton: typeof import("~icons/ep/switch-button")["default"];
|
||||
ImportExcel: typeof import("./components/ImportExcel/index.vue")["default"];
|
||||
Loading: typeof import("./components/Loading/index.vue")["default"];
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
:label="item.label"
|
||||
:prop="item.prop"
|
||||
:label-width="labelWidth || '81px'"
|
||||
:rules="item.rules"
|
||||
:error="item.error"
|
||||
:required="item.required"
|
||||
:show-message="item.showMessage ? item.showMessage : false"
|
||||
:inline-message="item.inlineMessage"
|
||||
:style="item.style ? item.style : 'margin-right:8px;position: relative;'"
|
||||
:required="item.required"
|
||||
:class="item.class ? item.class : 'form-item'"
|
||||
>
|
||||
<!-- :required="item.required" -->
|
||||
<template v-if="item.type === 'input'">
|
||||
<el-input
|
||||
v-model.trim="_searchResult[`${item.prop}`]"
|
||||
@@ -31,6 +31,15 @@
|
||||
>
|
||||
</el-input>
|
||||
</template>
|
||||
<template v-if="item.type === 'textarea'">
|
||||
<el-input
|
||||
v-model.trim="_searchResult[`${item.prop}`]"
|
||||
:placeholder="item.placeholder"
|
||||
:disabled="item.disabled"
|
||||
type="textarea"
|
||||
>
|
||||
</el-input>
|
||||
</template>
|
||||
<template v-if="item.type === 'inputs'">
|
||||
<el-input
|
||||
v-model.trim="_searchResult[`${item.startProp}`]"
|
||||
@@ -113,6 +122,7 @@
|
||||
v-model="_searchResult[`${item.prop}`]"
|
||||
multiple
|
||||
filterable
|
||||
:reserve-keyword="false"
|
||||
@remove-tag="handleRomoveTag(item)"
|
||||
:disabled="item.disabled"
|
||||
:placeholder="item.placeholder"
|
||||
@@ -129,17 +139,19 @@
|
||||
<template
|
||||
v-if="item.type === 'selectMultipleRemoteCustomersNames' || item.type === 'selectProductLinesRemote'"
|
||||
>
|
||||
<!-- // filterable -->
|
||||
<el-select
|
||||
v-model="_searchResult[`${item.prop}`]"
|
||||
:placeholder="item.placeholder"
|
||||
remote
|
||||
multiple
|
||||
filterable
|
||||
multiple
|
||||
:reserve-keyword="false"
|
||||
@remove-tag="handleTagRemove1(item)"
|
||||
class="m-2 select"
|
||||
remote-show-suffix
|
||||
@clear="handleSelectClear(item.prop)"
|
||||
:remote-method="(query:any)=> handleSelectMultipleRemote(query, item)"
|
||||
:disabled="item.disabled"
|
||||
style="max-height: 300px; overflow-y: auto"
|
||||
>
|
||||
<el-option
|
||||
:label="option.label"
|
||||
@@ -169,6 +181,7 @@ const props = defineProps<{
|
||||
inline?: Boolean;
|
||||
getSearchValue?: () => void;
|
||||
selectMultipleRemoveTag?: () => void;
|
||||
selectMultipleRemoteTag1?: () => void;
|
||||
setRuleFormValue?: () => void;
|
||||
}>();
|
||||
|
||||
@@ -181,12 +194,17 @@ const emits = defineEmits<{
|
||||
(e: "setMaterialList", result: Record<string, any>): void;
|
||||
(e: "setRuleFormValue", result: Record<string, any>): void;
|
||||
(e: "selectMultipleRemoveTag", result: Record<string, any>): void;
|
||||
(e: "selectMultipleRemoteTag1", result: Record<string, any>): void;
|
||||
}>();
|
||||
|
||||
const handleRomoveTag = (item: any) => {
|
||||
emits("selectMultipleRemoveTag", { item, org_number: _searchResult.value.org_number });
|
||||
};
|
||||
|
||||
const handleTagRemove1 = (item: any) => {
|
||||
if (!_searchResult.value[item.prop].length) {
|
||||
item.options = [];
|
||||
}
|
||||
};
|
||||
//客戶
|
||||
const getCustomers = async (keywords: any, item: any) => {
|
||||
let org_number = _searchResult.value.org_number.join(",");
|
||||
@@ -197,11 +215,15 @@ const getCustomers = async (keywords: any, item: any) => {
|
||||
let options: any = [];
|
||||
data.forEach((item: any) => {
|
||||
options.push({
|
||||
value: item.customer_number,
|
||||
label: item.customer_name
|
||||
value: item.customer_number + "_" + item.use_org_number,
|
||||
label: item.customer_name + " " + `(${item.use_org_name})`,
|
||||
id: item.use_org_number,
|
||||
useOrgName: item.use_org_name
|
||||
});
|
||||
});
|
||||
item.options = options;
|
||||
} else {
|
||||
item.options = [];
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -220,6 +242,8 @@ const getProductLines = async (keywords: any, item: any) => {
|
||||
});
|
||||
});
|
||||
item.options = options;
|
||||
} else {
|
||||
item.options = [];
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -234,10 +258,12 @@ const getUsers = async (keywords: any, item: any) => {
|
||||
data.forEach((item: any) => {
|
||||
options.push({
|
||||
value: item.dduid,
|
||||
label: item.realname
|
||||
label: item.realname + " " + item.mobile
|
||||
});
|
||||
});
|
||||
item.options = options;
|
||||
} else {
|
||||
item.options = [];
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -247,6 +273,7 @@ const handleSelectMultipleRemote = (query: any, item: any) => {
|
||||
if (!query) {
|
||||
return;
|
||||
}
|
||||
item.options = [];
|
||||
let valClone = query.replace(/^\s*|\s*$/g, "");
|
||||
if (!valClone) {
|
||||
return;
|
||||
@@ -271,9 +298,7 @@ const remoteMethod = async (query: any, item: any) => {
|
||||
getUsers(valClone, item);
|
||||
}
|
||||
};
|
||||
const handleSelectClear = (prop: any) => {
|
||||
console.log("会触发吗?", prop);
|
||||
};
|
||||
|
||||
//input输入验证
|
||||
const valueVerify = (item: any) => {
|
||||
//只能输入整数
|
||||
@@ -303,9 +328,10 @@ const valueVerifyInputs = (item: any) => {
|
||||
prop: item.prop
|
||||
});
|
||||
};
|
||||
// const handleSelectMultipleClear = (item: any) => {
|
||||
// console.log(item, "===========>");
|
||||
// };
|
||||
|
||||
defineExpose({
|
||||
formElement: ruleFormRef
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.search-box1 {
|
||||
|
||||
@@ -150,7 +150,6 @@ const handleRemoteClick = (item: any, index: number) => {
|
||||
emits("handleRemoteClickValue", { item, index });
|
||||
};
|
||||
const handleEnterInput = (item: any, index: number) => {
|
||||
console.log("1232323");
|
||||
emits("handleKeyupEnterInputValue", {
|
||||
item,
|
||||
index
|
||||
|
||||
@@ -135,7 +135,7 @@ const props = withDefaults(defineProps<ProTableProps>(), {
|
||||
toolButton: true,
|
||||
// rowKey: `id${index}`,
|
||||
// searchCol: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }),
|
||||
sizes: [1, 2, 3, 4]
|
||||
sizes: [50, 100, 150, 200]
|
||||
});
|
||||
|
||||
// 是否显示搜索模块
|
||||
@@ -147,7 +147,7 @@ const newValInitParams = toRef(props, "initParam");
|
||||
const { selectionChange, selectedList, selectedListIds, isSelected } = useSelection(props.rowKey);
|
||||
|
||||
// 清空选中数据列表
|
||||
const clearSelection = () => tableRef.value!.clearSelection();
|
||||
const clearSelection = () => tableRef?.value!.clearSelection();
|
||||
// 表格操作 Hooks
|
||||
const { tableData, pageable, getTableList, handleSizeChange, handleCurrentChange } = useTable(
|
||||
routeName.value,
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
v-if="item.type === 'selectRemote' || item.type === 'selectRemote1' || item.type === 'selectRemote2'"
|
||||
>
|
||||
<el-select
|
||||
v-model="_searchParams[`${item.prop}`]"
|
||||
v-model.trim="_searchParams[`${item.prop}`]"
|
||||
:placeholder="item.placeholder"
|
||||
clearable
|
||||
remote
|
||||
@@ -89,11 +89,13 @@
|
||||
<!-- getProductLinesApi -->
|
||||
<template v-if="item.type === 'selectMultipleRemote' || item.type === 'selectProductLinesRemote'">
|
||||
<el-select
|
||||
v-model="_searchParams[`${item.prop}`]"
|
||||
v-model.trim="_searchParams[`${item.prop}`]"
|
||||
:placeholder="item.placeholder"
|
||||
remote
|
||||
multiple
|
||||
filterable
|
||||
:reserve-keyword="false"
|
||||
@remove-tag="handleTagRemove(item)"
|
||||
@clear="handleClear(item)"
|
||||
:loading="loading"
|
||||
class="m-2 select"
|
||||
@@ -121,13 +123,16 @@
|
||||
<template v-if="item.type === 'selectMultiple'">
|
||||
<!-- multiple -->
|
||||
<el-select
|
||||
v-model="_searchParams[`${item.prop}`]"
|
||||
v-model.trim="_searchParams[`${item.prop}`]"
|
||||
filterable
|
||||
multiple
|
||||
:disabled="item.disabled"
|
||||
:placeholder="item.placeholder"
|
||||
class="m-2 select"
|
||||
:reserve-keyword="false"
|
||||
style="width: 224px"
|
||||
@remove-tag="handleTagRemove1(item)"
|
||||
ref="remoteRef"
|
||||
>
|
||||
<!-- 循环渲染选项:label 为显示文本,value 为实际提交值 -->
|
||||
<el-option
|
||||
@@ -142,9 +147,10 @@
|
||||
<template v-if="item.type === 'selectMultipleD'">
|
||||
<!-- multiple -->
|
||||
<el-select
|
||||
v-model="_searchParams[`${item.prop}`]"
|
||||
v-model.trim="_searchParams[`${item.prop}`]"
|
||||
filterable
|
||||
clearable
|
||||
:reserve-keyword="false"
|
||||
:disabled="item.disabled"
|
||||
:placeholder="item.placeholder"
|
||||
class="m-2 select"
|
||||
@@ -175,15 +181,17 @@ import { getSupplierApi, getCustomersApi, getProductLinesApi } from "@/api/modul
|
||||
const props = defineProps<{
|
||||
formData: any[];
|
||||
searchParams: Record<string, any>;
|
||||
selectMultipleRemoveTag?: () => void;
|
||||
}>();
|
||||
|
||||
const emits = defineEmits<{
|
||||
(e: "search", result: Record<string, any>): void;
|
||||
(e: "reset", result: Record<string, any>): void;
|
||||
(e: "selectMultipleRemoveTag", result: Record<string, any>): void;
|
||||
}>();
|
||||
|
||||
let loading = ref(false);
|
||||
|
||||
const remoteRef = ref(null);
|
||||
const _searchParams = computed(() => {
|
||||
return props.searchParams;
|
||||
});
|
||||
@@ -206,6 +214,8 @@ const getSupplier = async (keywords: any, item: any) => {
|
||||
if (result?.code === 0) {
|
||||
const { data } = result;
|
||||
item.options = data;
|
||||
} else {
|
||||
item.options = [];
|
||||
}
|
||||
};
|
||||
//客戶
|
||||
@@ -216,13 +226,17 @@ const getCustomers = async (keywords: any, item: any) => {
|
||||
const { data } = result;
|
||||
if (Array.isArray(data) && data.length) {
|
||||
let options: any = [];
|
||||
data.forEach((item: any) => {
|
||||
data.forEach((it: any) => {
|
||||
options.push({
|
||||
value: item.customer_number,
|
||||
label: item.customer_name
|
||||
value: it.customer_number + "_" + it.use_org_number,
|
||||
label: it.customer_name + " " + `(${it.use_org_name})`,
|
||||
id: it.use_org_number,
|
||||
useOrgName: it.use_org_name
|
||||
});
|
||||
});
|
||||
item.options = options;
|
||||
} else {
|
||||
item.options = [];
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -233,39 +247,53 @@ const getProductLines = async (keywords: any, item: any) => {
|
||||
const { data } = result;
|
||||
if (Array.isArray(data) && data.length) {
|
||||
let options: any = [];
|
||||
data.forEach((item: any) => {
|
||||
data.forEach((it: any) => {
|
||||
options.push({
|
||||
value: item,
|
||||
label: item
|
||||
value: it,
|
||||
label: it
|
||||
});
|
||||
});
|
||||
item.options = options;
|
||||
} else {
|
||||
item.options = [];
|
||||
}
|
||||
}
|
||||
};
|
||||
//多选远程搜索
|
||||
const handleSelectMultipleRemote = async (query: any, item: any) => {
|
||||
console.log(remoteRef.value, "==========remoteRef=========");
|
||||
|
||||
loading.value = true;
|
||||
if (!query) {
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
item.options = [];
|
||||
//去除字符串首尾的所有空白字符。
|
||||
let valClone = query.replace(/^\s*|\s*$/g, "");
|
||||
if (!valClone.length) {
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (item.type === "selectMultipleRemote") {
|
||||
//客戶編碼
|
||||
getCustomers(valClone, item);
|
||||
} else if (item.type === "selectProductLinesRemote") {
|
||||
//品线
|
||||
|
||||
getProductLines(valClone, item);
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
const handleTagRemove = (item: any) => {
|
||||
if (!_searchParams.value[item.prop].length) {
|
||||
item.options = [];
|
||||
}
|
||||
};
|
||||
const handleTagRemove1 = (item: any) => {
|
||||
emits("selectMultipleRemoveTag", { item, org_number: _searchParams.value.org_number });
|
||||
};
|
||||
//单选远程搜索(供应商)
|
||||
const remoteMethod = async (query: any, item: any) => {
|
||||
loading.value = true;
|
||||
@@ -273,8 +301,9 @@ const remoteMethod = async (query: any, item: any) => {
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
item.options = [];
|
||||
//去除字符串首尾的所有空白字符。
|
||||
let valClone = query.replace(/^\s*|\s*$/g, "");
|
||||
let valClone = query.replace(/^\s+|\s+$/g, "");
|
||||
if (!valClone.length) {
|
||||
loading.value = false;
|
||||
return;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { cloneDeep } from "lodash-es";
|
||||
|
||||
export const useFilter = (datas: any) => {
|
||||
const target = cloneDeep(datas);
|
||||
const returnTarget = target.filter((item: any) => {
|
||||
return !item.disable;
|
||||
});
|
||||
return returnTarget;
|
||||
};
|
||||
@@ -1,6 +1,16 @@
|
||||
export const usePathUrl = () => {
|
||||
const PATH_URL = `${import.meta.env.VITE_APP_SSO_LOGINURL}?client_id=${
|
||||
export const usePathUrl = (redirect_path?: any) => {
|
||||
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
|
||||
}&redirect_uri=${encodeURIComponent(import.meta.env.VITE_REDIRECT_URL)}&response_type=code`;
|
||||
return PATH_URL;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -30,15 +30,16 @@ export const useTable = (
|
||||
console.log("分页参数更新:", newVal);
|
||||
}
|
||||
});
|
||||
//订阅列表数据处理
|
||||
|
||||
//訂閲数据处理
|
||||
const initSubscribeData = () => {
|
||||
if (routeName === "foundationSubscribeList") {
|
||||
if (Array.isArray(state.totalParam?.org_number) && state.totalParam?.org_number?.length) {
|
||||
state.totalParam.org_number = state.totalParam.org_number.join(",");
|
||||
}
|
||||
//品线
|
||||
if (Array.isArray(state.totalParam?.product_line_name) && state.totalParam?.product_line_name?.length) {
|
||||
state.totalParam.org_number = state.totalParam.product_line_name.join(",");
|
||||
if (Array.isArray(state.totalParam?.product_line) && state.totalParam?.product_line?.length) {
|
||||
state.totalParam.product_line = state.totalParam.product_line.join(",");
|
||||
}
|
||||
//客户名称
|
||||
if (Array.isArray(state.totalParam?.customer_number) && state.totalParam?.customer_number?.length) {
|
||||
@@ -53,10 +54,26 @@ export const useTable = (
|
||||
}
|
||||
}
|
||||
}
|
||||
if (routeName === "foundationSubscribeWarehousing") {
|
||||
if (Array.isArray(state.totalParam?.org_number) && state.totalParam?.org_number?.length) {
|
||||
state.totalParam.org_number = state.totalParam.org_number.join(",");
|
||||
}
|
||||
if (state.totalParam?.subscriber_name) {
|
||||
// let names: any = "";
|
||||
state.totalParam.subscriber_name = state.totalParam?.subscriber_name.replace(/[,,]/g, ",");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// //其他數據處理
|
||||
// const initData = () => {
|
||||
// if (state.totalParam?.warehouse_number) {
|
||||
// state.totalParam.warehouse_number = state.totalParam?.warehouse_number.split("_")[0];
|
||||
// }
|
||||
// };
|
||||
//删除临时参数和空值参数
|
||||
const deleteParams = () => {
|
||||
const KEY = ["Time", "customer_number1"];
|
||||
const KEY = ["Time", "customer_number1", "customer_numbers"];
|
||||
for (let key in state.totalParam) {
|
||||
if (KEY.includes(key) || !state.totalParam[key]) {
|
||||
delete state.totalParam[key];
|
||||
@@ -71,14 +88,17 @@ export const useTable = (
|
||||
if (!api) return;
|
||||
|
||||
try {
|
||||
initSubscribeData();
|
||||
deleteParams();
|
||||
await initSubscribeData();
|
||||
await deleteParams();
|
||||
state.tableData = [];
|
||||
let params = {
|
||||
...state.totalParam,
|
||||
...pageParam.value
|
||||
};
|
||||
|
||||
const { data } = await api(params);
|
||||
state.tableData = data.data || [];
|
||||
|
||||
state.tableData = Array.isArray(data.data) && data.data.length ? data.data : [];
|
||||
clearSelection && clearSelection();
|
||||
if (isPageable && data.total_size !== undefined) {
|
||||
updatePageable({
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!-- 公司名 -->
|
||||
<div class="name-box font12" style="padding-top: 2px">
|
||||
<span style="margin-right: 10px; margin-left: 10px">
|
||||
{{ userStore.userInfo.corp.corp_name ? userStore.userInfo.corp.corp_name : "" }}
|
||||
{{ userStore?.userInfo?.corp?.corp_name ? userStore?.userInfo?.corp?.corp_name : "" }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="name-box font12">
|
||||
<el-dropdown trigger="click" class="triangle-box">
|
||||
<div>
|
||||
{{ userStore.userInfo.nickname }}
|
||||
{{ userStore?.userInfo?.nickname }}
|
||||
<el-icon class="triangle">
|
||||
<i-ep-arrow-down />
|
||||
</el-icon>
|
||||
@@ -41,15 +41,12 @@ const logout = () => {
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
//1.退出登录
|
||||
const result: any = await logoutApi();
|
||||
if (result?.code === 0) {
|
||||
location.href = usePathUrl();
|
||||
setTimeout(() => {
|
||||
userStore.$reset();
|
||||
//清除本地
|
||||
localStorage.clear();
|
||||
}, 300);
|
||||
location.href = usePathUrl();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<!-- <el-icon v-show="item.meta.icon && globalStore.breadcrumbIcon" class="breadcrumb-icon">
|
||||
<component :is="item.meta.icon"></component>
|
||||
</el-icon> -->
|
||||
|
||||
<!-- {{ breadcrumbList }} -->
|
||||
<span class="breadcrumb-title">{{ item.meta.title }}</span>
|
||||
</div>
|
||||
</el-breadcrumb-item>
|
||||
@@ -28,13 +28,22 @@ const route = useRoute();
|
||||
const router = useRouter();
|
||||
const authStore = useAuthStore();
|
||||
const globalStore = useGlobalStore();
|
||||
|
||||
// const routeName: any = ref(router.currentRoute.value.name);
|
||||
const breadcrumbList = computed(() => {
|
||||
let breadcrumbData = authStore.breadcrumbListGet[route.matched[route.matched.length - 1].path] ?? [];
|
||||
// 🙅♀️不需要首页面包屑可删除以下判断
|
||||
if (breadcrumbData[0].path !== HOME_URL) {
|
||||
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;
|
||||
}
|
||||
});
|
||||
console.log("");
|
||||
}
|
||||
|
||||
return breadcrumbData;
|
||||
});
|
||||
|
||||
|
||||
@@ -55,7 +55,9 @@ watch(
|
||||
() => {
|
||||
if (route.meta.isFull) return;
|
||||
tabsMenuValue.value = route.fullPath;
|
||||
|
||||
let title: any = route.query.title ? route.query.title : route.meta.title;
|
||||
|
||||
const tabsParams = {
|
||||
icon: route.meta.icon as string,
|
||||
title: title,
|
||||
@@ -63,6 +65,7 @@ watch(
|
||||
name: route.name as string,
|
||||
close: !route.meta.isAffix
|
||||
};
|
||||
|
||||
tabStore.addTabs(tabsParams);
|
||||
route.meta.isKeepAlive && keepAliveStore.addKeepAliveName(route.name as string);
|
||||
},
|
||||
@@ -107,13 +110,12 @@ const tabClick = (tabItem: TabsPaneContext) => {
|
||||
|
||||
// Remove Tab
|
||||
const tabRemove = (fullPath: TabPaneName) => {
|
||||
if (fullPath === "/index") {
|
||||
const name = tabStore.tabsMenuList.filter(item => item.path == fullPath)[0].name || "";
|
||||
|
||||
if (fullPath === "/index" || name === "home") {
|
||||
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);
|
||||
let isKeepAlive = tabStore.tabsMenuList.some((item: any) => {
|
||||
return item.name === name;
|
||||
|
||||
@@ -38,7 +38,7 @@ router.beforeEach(async (to, from, next) => {
|
||||
|
||||
// 1.NProgress 开始
|
||||
NProgress.start();
|
||||
|
||||
const currentPath = window.location.pathname;
|
||||
// 2.动态设置标题
|
||||
const title = import.meta.env.VITE_GLOB_APP_TITLE;
|
||||
document.title = to.meta.title ? `${to.meta.title} - ${title}` : title;
|
||||
@@ -51,6 +51,17 @@ router.beforeEach(async (to, from, next) => {
|
||||
|
||||
// 4.判断访问页面是否在路由白名单地址(静态路由)中,如果存在直接放行
|
||||
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 页面
|
||||
if (!userStore.newUserToken) return next({ path: LOGIN_URL, replace: true });
|
||||
|
||||
@@ -10,4 +10,5 @@ export interface TabsMenuProps {
|
||||
/* TabsState */
|
||||
export interface TabsState {
|
||||
tabsMenuList: TabsMenuProps[];
|
||||
isSubscribeAdd: Boolean;
|
||||
}
|
||||
|
||||
@@ -65,10 +65,10 @@ export const useAuthStore = defineStore({
|
||||
// 获取权限菜单列表并处理按钮权限
|
||||
async getAuthMenuList() {
|
||||
const { data } = await getAuthMenuListApi();
|
||||
let dataClone = data;
|
||||
|
||||
// 如果没有路由数据,设置默认首页
|
||||
this.authMenuList = dataClone || [
|
||||
let dataClone =
|
||||
Array.isArray(data) && data.length
|
||||
? data
|
||||
: [
|
||||
{
|
||||
path: "/index",
|
||||
name: "home",
|
||||
@@ -83,6 +83,9 @@ export const useAuthStore = defineStore({
|
||||
}
|
||||
];
|
||||
|
||||
// 如果没有路由数据,设置默认首页
|
||||
this.authMenuList = dataClone;
|
||||
|
||||
// 提取按钮权限
|
||||
this.buttonPermissions = extractButtonPermissions(this.authMenuList);
|
||||
// 构建页面与按钮的映射关系
|
||||
@@ -92,7 +95,6 @@ export const useAuthStore = defineStore({
|
||||
// 构建页面与按钮的映射关系
|
||||
buildPageButtonMap() {
|
||||
const pageButtonMap: PageButtonMap = {};
|
||||
|
||||
// 递归处理路由,建立页面与按钮的关联
|
||||
const processRoutes = (routes: any[], parentPageName?: string) => {
|
||||
routes.forEach((route: any) => {
|
||||
@@ -102,7 +104,6 @@ export const useAuthStore = defineStore({
|
||||
if (!pageButtonMap[route.name]) {
|
||||
pageButtonMap[route.name] = [];
|
||||
}
|
||||
|
||||
// 处理子节点中的按钮权限
|
||||
if (route.children && route.children.length > 0) {
|
||||
route.children.forEach((child: any) => {
|
||||
@@ -123,9 +124,7 @@ export const useAuthStore = defineStore({
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
processRoutes(this.authMenuList);
|
||||
console.log(pageButtonMap, "=pageButtonMap=");
|
||||
this.pageButtonMap = pageButtonMap;
|
||||
},
|
||||
|
||||
|
||||
@@ -6,16 +6,86 @@ import piniaPersistConfig from "@/config/piniaPersist";
|
||||
export const useTabsStore = defineStore({
|
||||
id: "wms-tabs",
|
||||
state: (): TabsState => ({
|
||||
tabsMenuList: []
|
||||
isSubscribeAdd: false,
|
||||
tabsMenuList: [
|
||||
{
|
||||
icon: "", // 首页的icon,按实际路由meta.icon填写(如"Home")
|
||||
title: "首页", // 固定首页标题
|
||||
path: "/index", // 首页的基础路径(无参数版本,避免初始参数冗余)
|
||||
name: "home", // 必须与首页路由的name一致(如路由定义中name: "home")
|
||||
close: true // 首页是否可关闭,按业务需求设置(通常true,若禁止关闭设为false)
|
||||
}
|
||||
]
|
||||
}),
|
||||
actions: {
|
||||
// Add Tabs
|
||||
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);
|
||||
}
|
||||
} 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) {
|
||||
const tabsMenuList = this.tabsMenuList;
|
||||
if (isCurrent) {
|
||||
@@ -28,22 +98,46 @@ export const useTabsStore = defineStore({
|
||||
}
|
||||
this.tabsMenuList = tabsMenuList.filter(item => item.path !== tabPath);
|
||||
},
|
||||
// Close MultipleTab
|
||||
|
||||
// Close MultipleTab(原有逻辑不变)
|
||||
async closeMultipleTab(tabsMenuValue?: string) {
|
||||
this.tabsMenuList = this.tabsMenuList.filter(item => {
|
||||
return item.path === tabsMenuValue || !item.close;
|
||||
});
|
||||
},
|
||||
// Set Tabs
|
||||
|
||||
// Set Tabs(原有逻辑不变)
|
||||
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) {
|
||||
console.log("12332323");
|
||||
const nowFullPath = location.hash.substring(1);
|
||||
this.tabsMenuList.forEach(item => {
|
||||
if (item.path == nowFullPath) item.title = title;
|
||||
});
|
||||
},
|
||||
async setSIsSubscribeAdd(is: any) {
|
||||
console.log(is, "==========is========");
|
||||
this.isSubscribeAdd = is;
|
||||
}
|
||||
},
|
||||
persist: piniaPersistConfig("wms-tabs")
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
:href="scope.row.download_url"
|
||||
v-if="
|
||||
scope.row.status == 1 &&
|
||||
Math.abs((new Date(scope.row.date).getTime() - new Date().getTime()) / (24 * 60 * 60 * 1000)) <= 7
|
||||
Math.abs((new Date(scope.row.created_at).getTime() - new Date().getTime()) / (24 * 60 * 60 * 1000)) <= 7
|
||||
"
|
||||
>下载</a
|
||||
>
|
||||
|
||||
@@ -2,7 +2,7 @@ export const BUTTON = [
|
||||
{
|
||||
text: "导出",
|
||||
permission: "foundationSetMaterialBtnExport",
|
||||
type: "add",
|
||||
type: "export",
|
||||
props: {
|
||||
type: "primary"
|
||||
}
|
||||
@@ -10,6 +10,6 @@ export const BUTTON = [
|
||||
{
|
||||
text: "刷新",
|
||||
permission: "foundationSetMaterialBtnRefresh",
|
||||
type: "del"
|
||||
type: "reset"
|
||||
}
|
||||
];
|
||||
|
||||
@@ -34,6 +34,22 @@ export const FORM_DATA: FormItem[] = [
|
||||
placeholder: "请输入品线",
|
||||
type: "input",
|
||||
label: "品线: "
|
||||
},
|
||||
{
|
||||
prop: "disabled",
|
||||
placeholder: "请选择",
|
||||
type: "select",
|
||||
label: "物料状态: ",
|
||||
options: [
|
||||
{
|
||||
value: 1,
|
||||
label: "禁用"
|
||||
},
|
||||
{
|
||||
value: "启用",
|
||||
label: "启用"
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -1,61 +1,93 @@
|
||||
import { RenderScope } from "@/components/ProTable/interface";
|
||||
export const COLUMNS = [
|
||||
{ type: "selection", fixed: "left", width: 40 },
|
||||
{
|
||||
align: "left",
|
||||
fixed: true,
|
||||
label: "物料编码",
|
||||
prop: "material_number"
|
||||
prop: "material_number",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "规格型号(SKU)",
|
||||
prop: "sku"
|
||||
prop: "sku",
|
||||
fixed: true,
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "物料名称",
|
||||
prop: "material_name"
|
||||
prop: "material_name",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "组织",
|
||||
prop: "org_name"
|
||||
prop: "org_name",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "品线",
|
||||
prop: "product_line"
|
||||
prop: "product_line",
|
||||
width: 200
|
||||
},
|
||||
|
||||
{
|
||||
align: "left",
|
||||
label: "69码",
|
||||
prop: "bar_code"
|
||||
prop: "bar_code",
|
||||
width: 200
|
||||
},
|
||||
|
||||
{
|
||||
align: "left",
|
||||
label: "FNSKU",
|
||||
prop: "fnsku"
|
||||
prop: "fnsku",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "1级分类",
|
||||
prop: "category_lv1"
|
||||
prop: "category_lv1",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "2级分类",
|
||||
prop: "category_lv2"
|
||||
prop: "category_lv2",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "3级分类",
|
||||
prop: "category_lv3"
|
||||
prop: "category_lv3",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "SPU",
|
||||
prop: "spu"
|
||||
prop: "spu",
|
||||
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
|
||||
}
|
||||
];
|
||||
|
||||
@@ -66,7 +66,12 @@ const selectionChange = (selection: any) => {
|
||||
};
|
||||
const handleButtonClickCallback = (item: any) => {
|
||||
const { type } = item;
|
||||
btnClick[type](item, dataStore.selectionList, proTableRef);
|
||||
|
||||
btnClick[type]({
|
||||
selectionList: dataStore.selectionList,
|
||||
proTableRef,
|
||||
initParam: dataStore.initParam
|
||||
});
|
||||
};
|
||||
|
||||
//搜索
|
||||
@@ -74,7 +79,7 @@ const handleSearch = async (params: any) => {
|
||||
dataStore.initParam = cloneDeep(params);
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
nextTick(() => {
|
||||
proTableRef.value!.getTableList();
|
||||
proTableRef?.value!.getTableList();
|
||||
});
|
||||
};
|
||||
//重置
|
||||
@@ -82,7 +87,7 @@ const handleReset = () => {
|
||||
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
nextTick(() => {
|
||||
proTableRef.value!.getTableList();
|
||||
proTableRef?.value!.getTableList();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,32 +1,17 @@
|
||||
import { getMaterialListReloadApi, getMaterialListExportApi } from "@/api/modules/foundationMaterial";
|
||||
import { useMsg } from "@/hooks/useMsg";
|
||||
// 直接导出函数,无需额外包装对象
|
||||
export const handleDel = (item: any, selectionList: any[], proTable: any) => {
|
||||
console.log("导出操作", item);
|
||||
console.log(selectionList, "=selectionList=");
|
||||
let length = selectionList.length;
|
||||
if (!length) {
|
||||
useMsg("warning", "请选择需要删除的数据!");
|
||||
return;
|
||||
|
||||
// 导出
|
||||
export const handleExport = async (params: any) => {
|
||||
const { initParam } = params;
|
||||
const result = await getMaterialListExportApi(initParam);
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "导出成功请前往导出列表中进行下载!");
|
||||
}
|
||||
ElMessageBox.confirm("您确定进行删除操作吗?", "温馨提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(async () => {
|
||||
proTable.value!.getTableList();
|
||||
// const result = await commitListApi();
|
||||
// if (result.status === 200) {
|
||||
// useMsg("success", "删除成功 !");
|
||||
// } else {
|
||||
// useMsg("error", result.message);
|
||||
// }
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
// proTable: any
|
||||
export const handleAdd = (item: any, selectionList: any[]) => {
|
||||
console.log("刷新操作", item);
|
||||
//刷新
|
||||
export const handleReload = async (params: any) => {
|
||||
const { selectionList, proTable } = params;
|
||||
let length = selectionList.length;
|
||||
let ids: any = [];
|
||||
if (length && length > 100) {
|
||||
@@ -36,9 +21,15 @@ export const handleAdd = (item: any, selectionList: any[]) => {
|
||||
selectionList.forEach((item: any) => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
let id = ids.join(",");
|
||||
const result = await getMaterialListReloadApi({ id });
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "数据刷新成功 !");
|
||||
proTable?.value!.getTableList();
|
||||
}
|
||||
};
|
||||
|
||||
export const btnClick: any = {
|
||||
del: handleDel,
|
||||
add: handleAdd
|
||||
export: handleExport,
|
||||
reset: handleReload
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
:labelWidth="dataStore.labelWidth"
|
||||
@selectMultipleRemoveTag="handleSelectMultipleRemoveTag"
|
||||
:inline="true"
|
||||
ref="detailsRef"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -22,15 +23,16 @@
|
||||
import PermissionButton from "@/components/PermissionButton/index.vue";
|
||||
import DetailsSearch from "@/components/DetailsSearch/index.vue";
|
||||
import { FORM_DATA, RULE_FORM } from "./constant/add";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import { getSubscribeDetailsApi, getSubscribeAddApi, getSubscribeUpdateApi } from "@/api/modules/subscribe";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { getSubscribeDetailsApi, getSubscribeUpdateApi, getSubscribeAddApi } from "@/api/modules/subscribe";
|
||||
import { setDetailsData } from "./init/setDetailsData";
|
||||
import { useMsg } from "@/hooks/useMsg";
|
||||
import { BUTTON } from "./constant/add/button";
|
||||
import { useUserStore } from "@/stores/modules/user";
|
||||
import { cloneDeep } from "lodash-es";
|
||||
|
||||
import $Bus from "@/utils/mittBus";
|
||||
// import { useTabsStore } from "@/stores/modules/tabs";
|
||||
// const tabStore = useTabsStore();
|
||||
const dataStore = reactive({
|
||||
formData: cloneDeep(FORM_DATA),
|
||||
ruleForm: cloneDeep(RULE_FORM),
|
||||
@@ -42,11 +44,28 @@ const dataStore = reactive({
|
||||
});
|
||||
const userStore = useUserStore();
|
||||
const $route = useRoute();
|
||||
const $router = useRouter();
|
||||
const detailsRef = ref<any>(null);
|
||||
dataStore.formData[0].options = userStore.orgIdArr;
|
||||
const init = () => {
|
||||
if ($route.query.title === "新增订阅") {
|
||||
dataStore.ruleForm.org_number = ["101"];
|
||||
}
|
||||
};
|
||||
init();
|
||||
//新增
|
||||
const handleAdd = () => {
|
||||
if ($route.query.title === "编辑订阅") {
|
||||
$router.replace({
|
||||
path: "/foundation/subscribe/list/add",
|
||||
query: {
|
||||
title: "新增订阅"
|
||||
}
|
||||
});
|
||||
}
|
||||
if ($route.query.title === "新增订阅") {
|
||||
if (
|
||||
dataStore.ruleForm?.customer_number.length ||
|
||||
dataStore.ruleForm?.customer_number?.length ||
|
||||
dataStore.ruleForm?.org_number ||
|
||||
dataStore.ruleForm?.product_lines ||
|
||||
dataStore.ruleForm?.subscriber_dduid
|
||||
@@ -58,17 +77,30 @@ const handleAdd = () => {
|
||||
})
|
||||
.then(async () => {
|
||||
dataStore.ruleForm = cloneDeep(RULE_FORM);
|
||||
dataStore.ruleForm.org_number = ["101"];
|
||||
dataStore.isAdd = true;
|
||||
detailsRef?.value?.formElement?.resetFields();
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
const handleGoList = () => {
|
||||
setTimeout(() => {
|
||||
$router.replace({ path: "/foundation/subscribe/list/index" });
|
||||
$Bus.emit("setResetList");
|
||||
}, 300);
|
||||
};
|
||||
|
||||
//添加
|
||||
const getSubscribeAdd = async (params: any) => {
|
||||
console.log(params);
|
||||
const result = await getSubscribeAddApi(params);
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "新增成功 !");
|
||||
dataStore.ruleForm = cloneDeep(RULE_FORM);
|
||||
dataStore.ruleForm.org_number = ["101"];
|
||||
detailsRef?.value?.formElement?.resetFields();
|
||||
handleGoList();
|
||||
}
|
||||
};
|
||||
//更新
|
||||
@@ -76,6 +108,7 @@ const getSubscribeUpdate = async (params: any) => {
|
||||
const result = await getSubscribeUpdateApi($route.query.id, params);
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "更新成功 !");
|
||||
handleGoList();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -109,7 +142,6 @@ const handleCommit = () => {
|
||||
};
|
||||
//详情
|
||||
const getSubscribeDetails = async () => {
|
||||
console.log($route.query.id);
|
||||
let id = $route.query.id;
|
||||
if (!id) {
|
||||
return;
|
||||
@@ -121,19 +153,36 @@ const getSubscribeDetails = async () => {
|
||||
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删除回调(组织)
|
||||
const handleSelectMultipleRemoveTag = async (params: any) => {
|
||||
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 &&
|
||||
dataStore.formData[1].options.forEach((item: any) => {
|
||||
customers.push(item.value);
|
||||
// 筛选出 org_number 数组包含的数据
|
||||
dataStore.formData[1].options = dataStore.formData[1].options.filter((item: any) => {
|
||||
return org_number.includes(item.id);
|
||||
});
|
||||
|
||||
dataStore.ruleForm.customer_number = customers;
|
||||
dataStore.ruleForm.customer_number1 = filterBySecondArray(dataStore.ruleForm.customer_number1, org_number);
|
||||
};
|
||||
getSubscribeDetails();
|
||||
|
||||
@@ -146,4 +195,25 @@ const handleButtonClickCallback = (item: any) => {
|
||||
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>
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
export const FORM_DATA: any[] = [
|
||||
{
|
||||
prop: "org_number",
|
||||
placeholder: "",
|
||||
placeholder: "请输入",
|
||||
type: "selectMultiple",
|
||||
label: "组织:",
|
||||
disabled: false,
|
||||
required: true,
|
||||
class: "form-item1",
|
||||
|
||||
options: []
|
||||
},
|
||||
{
|
||||
prop: "customer_number",
|
||||
placeholder: "",
|
||||
prop: "customer_number1",
|
||||
placeholder: "请输入",
|
||||
type: "selectMultipleRemoteCustomersNames",
|
||||
label: "客户名称:",
|
||||
disabled: false,
|
||||
@@ -21,8 +22,8 @@ export const FORM_DATA: any[] = [
|
||||
},
|
||||
{
|
||||
prop: "customer_number",
|
||||
placeholder: "",
|
||||
type: "input",
|
||||
placeholder: "请输入",
|
||||
type: "textarea",
|
||||
label: "客户编码:",
|
||||
disabled: true,
|
||||
required: true,
|
||||
@@ -30,7 +31,7 @@ export const FORM_DATA: any[] = [
|
||||
},
|
||||
{
|
||||
prop: "product_lines",
|
||||
placeholder: "",
|
||||
placeholder: "请输入",
|
||||
type: "selectProductLinesRemote",
|
||||
label: "品线:",
|
||||
disabled: false,
|
||||
@@ -40,7 +41,7 @@ export const FORM_DATA: any[] = [
|
||||
},
|
||||
{
|
||||
prop: "subscriber_dduid",
|
||||
placeholder: "",
|
||||
placeholder: "请输入",
|
||||
type: "selectRemoteUser",
|
||||
label: "订阅账号:",
|
||||
disabled: false,
|
||||
|
||||
@@ -24,7 +24,7 @@ export const FORM_DATA: FormItem[] = [
|
||||
options: []
|
||||
},
|
||||
{
|
||||
prop: "customer_number",
|
||||
prop: "customer_numbers",
|
||||
placeholder: "请输入客户名称",
|
||||
type: "selectMultipleRemote",
|
||||
label: "客户名称: ",
|
||||
@@ -37,7 +37,7 @@ export const FORM_DATA: FormItem[] = [
|
||||
label: "客户编码: "
|
||||
},
|
||||
{
|
||||
prop: "product_line_name",
|
||||
prop: "product_line",
|
||||
placeholder: "请输入品线",
|
||||
type: "selectProductLinesRemote",
|
||||
label: "品线: ",
|
||||
@@ -71,5 +71,6 @@ export const FORM_DATA: FormItem[] = [
|
||||
export const RULE_FORM = {
|
||||
page: 1,
|
||||
size: 1,
|
||||
org_number: ["101"]
|
||||
org_number: ["101"],
|
||||
customer_number: []
|
||||
};
|
||||
|
||||
@@ -3,19 +3,20 @@ export const COLUMNS = [
|
||||
{
|
||||
align: "left",
|
||||
label: "订阅账号",
|
||||
prop: "subscriber_name"
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
fixed: true,
|
||||
label: "客户名称",
|
||||
prop: "customer_name"
|
||||
prop: "subscriber_name",
|
||||
fixed: true
|
||||
},
|
||||
|
||||
{
|
||||
align: "left",
|
||||
label: "组织",
|
||||
prop: "org_name"
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "客户名称",
|
||||
prop: "customer_name"
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "客户编码",
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<SearchForm
|
||||
@search="handleSearch"
|
||||
@reset="handleReset"
|
||||
@selectMultipleRemoveTag="handleSelectMultipleRemoveTag"
|
||||
:searchParams="dataStore.initParam"
|
||||
:formData="dataStore.formData"
|
||||
/>
|
||||
@@ -34,6 +35,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="foundationSubscribeList">
|
||||
import { onMounted } from "vue";
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import ProTable from "@/components/ProTable/index.vue";
|
||||
import PermissionButton from "@/components/PermissionButton/index.vue";
|
||||
@@ -45,7 +47,7 @@ import { ProTableInstance } from "@/components/ProTable/interface";
|
||||
import { btnClick } from "./init";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useUserStore } from "@/stores/modules/user";
|
||||
|
||||
import $Bus from "@/utils/mittBus";
|
||||
//深拷贝方法
|
||||
import { cloneDeep } from "lodash-es";
|
||||
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||
@@ -57,7 +59,7 @@ const userStore = useUserStore();
|
||||
const dataStore = reactive<any>({
|
||||
columns: COLUMNS, //列表配置项
|
||||
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
||||
ruleForm: cloneDeep(RULE_FORM), // 搜索条件
|
||||
|
||||
formData: FORM_DATA, //搜索配置项
|
||||
buttons: cloneDeep(BUTTON),
|
||||
options: [], //规格型号
|
||||
@@ -90,7 +92,7 @@ const handleSearch = async (params: any) => {
|
||||
dataStore.initParam = cloneDeep(params);
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
nextTick(() => {
|
||||
proTableRef.value!.getTableList();
|
||||
proTableRef?.value!.getTableList();
|
||||
});
|
||||
};
|
||||
//重置
|
||||
@@ -98,7 +100,7 @@ const handleReset = () => {
|
||||
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
nextTick(() => {
|
||||
proTableRef.value!.getTableList();
|
||||
proTableRef?.value!.getTableList();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -109,6 +111,65 @@ const handleOpen = (row: any) => {
|
||||
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>
|
||||
|
||||
<style scope lang="scss">
|
||||
|
||||
@@ -21,7 +21,7 @@ export const handleDel = (params: any) => {
|
||||
});
|
||||
const result = await getSubscribeDelApi(ids.join(","));
|
||||
if (result?.code === 0) {
|
||||
proTable.value!.getTableList();
|
||||
proTable?.value!.getTableList();
|
||||
useMsg("success", "删除成功 !");
|
||||
}
|
||||
})
|
||||
|
||||
@@ -10,15 +10,18 @@ export const setDetailsData = (dataStore: any, data: any) => {
|
||||
if (data?.customers?.length) {
|
||||
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({
|
||||
value: item.customer_number,
|
||||
label: item.customer_name,
|
||||
org_number: "100"
|
||||
value: item.customer_number + "_" + item.use_org_number,
|
||||
label: item.customer_name + " " + `(${item.use_org_name})`,
|
||||
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.formData[1].options = customers_names;
|
||||
@@ -43,7 +46,7 @@ export const setDetailsData = (dataStore: any, data: any) => {
|
||||
dataStore.formData[4].options = [
|
||||
{
|
||||
value: data?.subscriber_dduid,
|
||||
label: data?.subscriber_name
|
||||
label: data?.subscriber_mobile ? data?.subscriber_name + " " + data?.subscriber_mobile : data?.subscriber_name
|
||||
}
|
||||
];
|
||||
dataStore.ruleForm.subscriber_dduid = data?.subscriber_dduid;
|
||||
|
||||
@@ -2,7 +2,7 @@ export const BUTTON = [
|
||||
{
|
||||
text: "导出",
|
||||
permission: "foundationSubscribeWarehousingBtnExport",
|
||||
type: "add",
|
||||
type: "export",
|
||||
props: {
|
||||
type: "primary"
|
||||
}
|
||||
@@ -10,6 +10,6 @@ export const BUTTON = [
|
||||
{
|
||||
text: "刷新",
|
||||
permission: "foundationSubscribeWarehousingBtnRefresh",
|
||||
type: "del"
|
||||
type: "reset"
|
||||
}
|
||||
];
|
||||
|
||||
@@ -17,33 +17,46 @@ interface FormItem {
|
||||
}
|
||||
export const FORM_DATA: FormItem[] = [
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
prop: "bill_no",
|
||||
placeholder: "请输入单据编号",
|
||||
type: "input",
|
||||
label: "单据编号: "
|
||||
},
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
prop: "src_bill_no",
|
||||
placeholder: "请输入来源单号",
|
||||
type: "input",
|
||||
label: "来源单号: "
|
||||
},
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
prop: "order_no",
|
||||
placeholder: "请输入订单单号",
|
||||
type: "input",
|
||||
label: "订单单号: "
|
||||
},
|
||||
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
prop: "notif_ret_status",
|
||||
placeholder: "请选择推送结果",
|
||||
type: "select",
|
||||
label: "推送结果: ",
|
||||
options: []
|
||||
options: [
|
||||
{
|
||||
value: 1,
|
||||
label: "成功"
|
||||
},
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
value: "空",
|
||||
label: "空"
|
||||
},
|
||||
{
|
||||
value: -1,
|
||||
label: "失败"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
prop: "material",
|
||||
placeholder: "请输入物料名称/编码/规格型号",
|
||||
type: "input",
|
||||
label: "物料编码: "
|
||||
@@ -56,31 +69,36 @@ export const FORM_DATA: FormItem[] = [
|
||||
options: []
|
||||
},
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
placeholder: "请选择仓库",
|
||||
type: "select",
|
||||
label: "仓库: ",
|
||||
options: []
|
||||
prop: "warehouse_name",
|
||||
placeholder: "请输入仓库",
|
||||
type: "input",
|
||||
label: "仓库: "
|
||||
// options: []
|
||||
},
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
prop: "sub_warehouse_name",
|
||||
placeholder: "请输入子仓库",
|
||||
type: "input",
|
||||
label: "子仓库: "
|
||||
},
|
||||
|
||||
{
|
||||
prop: "customer_name",
|
||||
placeholder: "请输入客户名称",
|
||||
type: "input",
|
||||
label: "客户名称: "
|
||||
},
|
||||
{
|
||||
prop: "Time",
|
||||
type: "daterange",
|
||||
options: [],
|
||||
startPlaceholder: "入库开始日期",
|
||||
endPlaceholder: "入库结束日期",
|
||||
startDate: "createBeginDate",
|
||||
endDate: "createEndDate",
|
||||
startDate: "storage_time",
|
||||
// endDate: "createEndDate",
|
||||
label: "入库日期: "
|
||||
},
|
||||
{
|
||||
prop: "lotNumbers",
|
||||
prop: "subscriber_name",
|
||||
placeholder: "请输入订阅人",
|
||||
type: "input",
|
||||
label: "订阅人: "
|
||||
@@ -90,5 +108,6 @@ export const FORM_DATA: FormItem[] = [
|
||||
export const RULE_FORM = {
|
||||
page: 1,
|
||||
size: 50,
|
||||
org_number: ["101"]
|
||||
org_number: ["101"],
|
||||
subscriber_name: ""
|
||||
};
|
||||
|
||||
@@ -4,92 +4,110 @@ export const COLUMNS = [
|
||||
align: "left",
|
||||
fixed: true,
|
||||
label: "单据编码",
|
||||
prop: "securityNumber"
|
||||
prop: "bill_no",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "来源单号",
|
||||
prop: "id"
|
||||
prop: "src_bill_no",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "订单单号",
|
||||
prop: "specifications"
|
||||
prop: "order_no",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "客户名称",
|
||||
prop: "createTime"
|
||||
prop: "customer_name",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "入库组织",
|
||||
prop: "downLoadNumber"
|
||||
prop: "warehousing_org_name",
|
||||
width: 200
|
||||
},
|
||||
|
||||
{
|
||||
align: "left",
|
||||
label: "单据类型",
|
||||
prop: "downLoadTime"
|
||||
prop: "bill_type_name",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "规格型号",
|
||||
prop: "downLoadTime"
|
||||
prop: "specification",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "物料编码",
|
||||
prop: "downLoadTime"
|
||||
prop: "material_number",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "物料名称",
|
||||
prop: "downLoadTime"
|
||||
prop: "material_name",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "出厂价",
|
||||
prop: "downLoadTime"
|
||||
prop: "factory_price",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "入库仓库",
|
||||
prop: "downLoadTime"
|
||||
prop: "warehouse_name",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "入库子仓库",
|
||||
prop: "downLoadTime"
|
||||
prop: "sub_warehouse_name",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "入库数量",
|
||||
prop: "downLoadTime"
|
||||
prop: "real_qty",
|
||||
width: 140
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "订单明细备注",
|
||||
prop: "downLoadTime"
|
||||
prop: "remark",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "单位",
|
||||
prop: "downLoadTime"
|
||||
prop: "unit_name",
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "入库时间",
|
||||
prop: "downLoadTime"
|
||||
prop: "storage_time",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "创建时间",
|
||||
prop: "downLoadTime"
|
||||
prop: "created_at",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "推送结果",
|
||||
prop: "downLoadTime"
|
||||
prop: "notif_ret_text",
|
||||
width: 120
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- 质检单 -->
|
||||
<!-- 入库单 -->
|
||||
<template>
|
||||
<div class="table-box">
|
||||
<div style="padding-bottom: 16px">
|
||||
@@ -11,7 +11,7 @@
|
||||
<ProTable
|
||||
ref="proTable"
|
||||
:columns="dataStore.columns"
|
||||
:request-api="getMaterialListApi"
|
||||
:request-api="getSubscribeWrrListApi"
|
||||
:init-param="dataStore.initParam"
|
||||
@selectionChange="selectionChange"
|
||||
>
|
||||
@@ -23,6 +23,23 @@
|
||||
:formData="dataStore.formData"
|
||||
/>
|
||||
</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>
|
||||
</div>
|
||||
</template>
|
||||
@@ -32,7 +49,7 @@ 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 { getSubscribeWrrListApi } from "@/api/modules/warehousing";
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
|
||||
//表格TS
|
||||
@@ -57,18 +74,64 @@ const dataStore = reactive<any>({
|
||||
selectionList: [], //选中表格的行
|
||||
loading: false
|
||||
});
|
||||
|
||||
const init = () => {
|
||||
//设置组织数组
|
||||
dataStore.formData[5].options = userStore.orgIdArr;
|
||||
//设置仓库数据
|
||||
dataStore.formData[6].options = userStore.warehouse;
|
||||
//订阅人
|
||||
dataStore.initParam.subscriber_name = userStore.userInfo.nickname;
|
||||
};
|
||||
init();
|
||||
// 表格选择事件
|
||||
const selectionChange = (selection: any) => {
|
||||
dataStore.selectionList = selection;
|
||||
};
|
||||
const handleButtonClickCallback = (item: any) => {
|
||||
const { type } = item;
|
||||
btnClick[type](item, dataStore.selectionList, proTable);
|
||||
btnClick[type]({
|
||||
selectionList: dataStore.selectionList,
|
||||
proTable,
|
||||
initParam: dataStore.initParam
|
||||
});
|
||||
};
|
||||
//搜索
|
||||
const handleSearch = async (params: any) => {
|
||||
dataStore.initParam = cloneDeep(params);
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
nextTick(() => {
|
||||
proTable?.value!.getTableList();
|
||||
});
|
||||
};
|
||||
//重置
|
||||
const handleReset = () => {
|
||||
dataStore.initParam = cloneDeep(RULE_FORM);
|
||||
init();
|
||||
//这里需要等到表格刷新以后才去请求
|
||||
nextTick(() => {
|
||||
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
|
||||
});
|
||||
};
|
||||
const handleSearch = () => {};
|
||||
const handleReset = () => {};
|
||||
</script>
|
||||
|
||||
<style scope lang="scss">
|
||||
|
||||
@@ -1,40 +1,39 @@
|
||||
import { useMsg } from "@/hooks/useMsg";
|
||||
// 直接导出函数,无需额外包装对象
|
||||
export const handleDel = (item: any, selectionList: any[], proTable: any) => {
|
||||
console.log("导出操作", item);
|
||||
console.log(selectionList, "=selectionList=");
|
||||
let length = selectionList.length;
|
||||
if (!length) {
|
||||
useMsg("warning", "请选择需要删除的数据!");
|
||||
return;
|
||||
import { getSubscribeResetListApi, getSubscribeResetListExportApi } from "@/api/modules/warehousing";
|
||||
import { cloneDeep } from "lodash-es";
|
||||
// 导出
|
||||
export const handleExport = async (data: any) => {
|
||||
const { initParam } = data;
|
||||
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) {
|
||||
useMsg("success", "导出成功请前往导出列表中进行下载 !");
|
||||
}
|
||||
ElMessageBox.confirm("您确定进行删除操作吗?", "温馨提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(async () => {
|
||||
proTable.value!.getTableList();
|
||||
// const result = await commitListApi();
|
||||
// if (result.status === 200) {
|
||||
// useMsg("success", "删除成功 !");
|
||||
// } else {
|
||||
// useMsg("error", result.message);
|
||||
// }
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
// proTable: any
|
||||
export const handleAdd = (item: any, selectionList: any[]) => {
|
||||
console.log("刷新操作", item);
|
||||
export const handleReSet = async (params: any) => {
|
||||
const { proTable, selectionList } = params;
|
||||
let length = selectionList.length;
|
||||
if (length && length > 100) {
|
||||
useMsg("warning", "选中刷新数据最大100条 !");
|
||||
return;
|
||||
}
|
||||
let ids: any = [];
|
||||
selectionList.forEach((item: any) => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
|
||||
let id = ids.join(",");
|
||||
const result = await getSubscribeResetListApi({ id });
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "数据刷新成功 !");
|
||||
proTable?.value!.getTableList();
|
||||
}
|
||||
};
|
||||
|
||||
export const btnClick: any = {
|
||||
del: handleDel,
|
||||
add: handleAdd
|
||||
export: handleExport,
|
||||
reset: handleReSet
|
||||
};
|
||||
|
||||
@@ -6,40 +6,61 @@
|
||||
|
||||
<script setup lang="ts" name="home">
|
||||
//登录请求接口
|
||||
import { getOrgsApi } from "@/api/modules/global";
|
||||
// import { getOrgsApi, getWarehousesListApi } from "@/api/modules/global";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
//用户信息存储
|
||||
import { useUserStore } from "@/stores/modules/user";
|
||||
//setOrgIdArr
|
||||
const userStore = useUserStore();
|
||||
//获取组织
|
||||
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);
|
||||
}
|
||||
}
|
||||
};
|
||||
getOrgs();
|
||||
|
||||
// //获取供应商
|
||||
// const getSupplier = async () => {
|
||||
// const result = await getSupplierApi();
|
||||
// import { useUserStore } from "@/stores/modules/user";
|
||||
// const userStore = useUserStore();
|
||||
//路由;
|
||||
const $route = useRoute();
|
||||
const $router = useRouter();
|
||||
// //获取组织
|
||||
// const getOrgs = async () => {
|
||||
// const result = await getOrgsApi();
|
||||
// if (result?.code === 0) {
|
||||
// const { data } = result;
|
||||
// console.log(data, "=============>");
|
||||
// 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);
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// getSupplier();
|
||||
// getOrgs();
|
||||
// const getWarehousesList = async () => {
|
||||
// const result = await getWarehousesListApi();
|
||||
// if (result?.code === 0) {
|
||||
// const { data } = result;
|
||||
// if (data?.length) {
|
||||
// let options: any = [];
|
||||
// data.forEach((item: any) => {
|
||||
// options.push({
|
||||
// id: item.id,
|
||||
// value: item.warehouse_name,
|
||||
// label: item.warehouse_name
|
||||
// });
|
||||
// });
|
||||
// userStore.setWarehouse(options);
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// getWarehousesList();
|
||||
|
||||
const init = () => {
|
||||
let redirect_path: any = $route.query.redirect_path;
|
||||
if (redirect_path) {
|
||||
setTimeout(() => {
|
||||
$router.push({ path: redirect_path });
|
||||
}, 500);
|
||||
}
|
||||
};
|
||||
init();
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -4,38 +4,81 @@
|
||||
<script setup lang="ts">
|
||||
//useRouter
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { getOrgsApi, getWarehousesListApi } from "@/api/modules/global";
|
||||
// import { useMsg } from "@/hooks/useMsg";
|
||||
//重定向
|
||||
import { usePathUrl } from "@/hooks/usePathUrl";
|
||||
//登录请求接口
|
||||
import { loginApi } from "@/api/modules/login";
|
||||
|
||||
//用户信息存储
|
||||
import { useUserStore } from "@/stores/modules/user";
|
||||
//重定向
|
||||
import { usePathUrl } from "@/hooks/usePathUrl";
|
||||
|
||||
const userStore = useUserStore();
|
||||
// 路由
|
||||
//路由;
|
||||
const $route = useRoute();
|
||||
const $router = useRouter();
|
||||
|
||||
// 设置用户数据
|
||||
const setUserData = (data: any) => {
|
||||
// 设置token
|
||||
userStore.setToken(data.access_token);
|
||||
// 设置用户信息
|
||||
userStore.setUserInfo(data.user_data);
|
||||
//获取组织
|
||||
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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//设置好了token和用户信息跳转到首页
|
||||
setTimeout(() => {
|
||||
$router.push({ path: "/" });
|
||||
}, 500);
|
||||
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 result: Record<string, any> = await loginApi(code);
|
||||
if (result.code === 0) {
|
||||
setUserData(result.data);
|
||||
userStore.setToken(result?.data?.access_token);
|
||||
// 设置用户信息
|
||||
userStore.setUserInfo(result?.data?.user_data);
|
||||
|
||||
let redirect_path: any = $route.query.redirect_path;
|
||||
|
||||
if (result?.data?.access_token) {
|
||||
getWarehousesList();
|
||||
getOrgs();
|
||||
}
|
||||
if (redirect_path) {
|
||||
setTimeout(() => {
|
||||
$router.replace({ path: redirect_path });
|
||||
}, 500);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
$router.replace({ path: "/" });
|
||||
}, 500);
|
||||
}
|
||||
} else {
|
||||
location.href = usePathUrl();
|
||||
}
|
||||
@@ -43,14 +86,20 @@ const loginHttp = async (code: any) => {
|
||||
|
||||
// 登录前的判断
|
||||
const login = () => {
|
||||
const { code } = $route.query;
|
||||
const { code, redirect_path } = $route.query;
|
||||
// 没有code直接跳转到登录页
|
||||
if (!code && redirect_path) {
|
||||
location.href = usePathUrl(redirect_path);
|
||||
return;
|
||||
}
|
||||
if (!code) {
|
||||
location.href = usePathUrl();
|
||||
return;
|
||||
}
|
||||
// 有code就登录请求
|
||||
if (code) {
|
||||
loginHttp(code);
|
||||
}
|
||||
};
|
||||
login();
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user