fix: 🧩 修复BUG
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
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 #单点从定向地址
|
||||
|
||||
@@ -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_LOGINURL = https://uc.v3.f2b211.com/uc/login
|
||||
VITE_APP_SSO_APPID = 100664627590856707
|
||||
|
||||
VITE_REDIRECT_URL = https://opsscm.f2b211.com/login #单点从定向地址
|
||||
VITE_REDIRECT_URL = https://wms.v2.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/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 =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);
|
||||
|
||||
@@ -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,12 +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"
|
||||
@@ -122,7 +123,7 @@
|
||||
<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"
|
||||
@@ -130,6 +131,8 @@
|
||||
class="m-2 select"
|
||||
:reserve-keyword="false"
|
||||
style="width: 224px"
|
||||
@remove-tag="handleTagRemove1(item)"
|
||||
ref="remoteRef"
|
||||
>
|
||||
<!-- 循环渲染选项:label 为显示文本,value 为实际提交值 -->
|
||||
<el-option
|
||||
@@ -144,7 +147,7 @@
|
||||
<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"
|
||||
@@ -178,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;
|
||||
});
|
||||
@@ -209,6 +214,8 @@ const getSupplier = async (keywords: any, item: any) => {
|
||||
if (result?.code === 0) {
|
||||
const { data } = result;
|
||||
item.options = data;
|
||||
} else {
|
||||
item.options = [];
|
||||
}
|
||||
};
|
||||
//客戶
|
||||
@@ -219,13 +226,15 @@ 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,
|
||||
label: it.customer_name
|
||||
});
|
||||
});
|
||||
item.options = options;
|
||||
} else {
|
||||
item.options = [];
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -236,39 +245,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") {
|
||||
//品线
|
||||
console.log("走到了这里");
|
||||
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;
|
||||
@@ -276,8 +299,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;
|
||||
|
||||
@@ -38,8 +38,8 @@ export const useTable = (
|
||||
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) {
|
||||
|
||||
@@ -140,8 +140,9 @@ const handleSelectMultipleRemoveTag = async (params: any) => {
|
||||
dataStore.formData[1].options.forEach((item: any) => {
|
||||
customers.push(item.value);
|
||||
});
|
||||
|
||||
console.log(customers, "=customers=");
|
||||
dataStore.ruleForm.customer_number = customers;
|
||||
console.log(dataStore.ruleForm.customer_number, "=123==");
|
||||
};
|
||||
getSubscribeDetails();
|
||||
|
||||
|
||||
@@ -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: []
|
||||
};
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<SearchForm
|
||||
@search="handleSearch"
|
||||
@reset="handleReset"
|
||||
@selectMultipleRemoveTag="handleSelectMultipleRemoveTag"
|
||||
:searchParams="dataStore.initParam"
|
||||
:formData="dataStore.formData"
|
||||
/>
|
||||
@@ -57,7 +58,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: [], //规格型号
|
||||
@@ -109,6 +110,21 @@ const handleOpen = (row: any) => {
|
||||
query: { id: row.id, title: "编辑订阅" }
|
||||
});
|
||||
};
|
||||
|
||||
//本地多选远程搜索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);
|
||||
});
|
||||
nextTick(() => {
|
||||
dataStore.initParam.customer_number = customers;
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scope lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user