fix: 🧩 修改bug
This commit is contained in:
@@ -44,6 +44,13 @@ const userStore = useUserStore();
|
||||
const $route = useRoute();
|
||||
|
||||
dataStore.formData[0].options = userStore.orgIdArr;
|
||||
const init = () => {
|
||||
//$route.query.title === "新增订阅" ? org_number: ["101"],
|
||||
if ($route.query.title === "新增订阅") {
|
||||
dataStore.ruleForm.org_number = ["101"];
|
||||
}
|
||||
};
|
||||
init();
|
||||
//新增
|
||||
const handleAdd = () => {
|
||||
if (
|
||||
|
||||
@@ -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: "",
|
||||
placeholder: "请输入",
|
||||
type: "selectMultipleRemoteCustomersNames",
|
||||
label: "客户名称:",
|
||||
disabled: false,
|
||||
@@ -21,7 +22,7 @@ export const FORM_DATA: any[] = [
|
||||
},
|
||||
{
|
||||
prop: "customer_number",
|
||||
placeholder: "",
|
||||
placeholder: "请输入",
|
||||
type: "input",
|
||||
label: "客户编码:",
|
||||
disabled: 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,
|
||||
|
||||
@@ -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: "客户编码",
|
||||
|
||||
@@ -43,7 +43,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;
|
||||
|
||||
@@ -5,37 +5,31 @@
|
||||
//useRouter
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
// 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);
|
||||
|
||||
//设置好了token和用户信息跳转到首页
|
||||
setTimeout(() => {
|
||||
$router.push({ path: "/" });
|
||||
}, 500);
|
||||
};
|
||||
|
||||
// 登录
|
||||
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);
|
||||
console.log(result?.data?.access_token, "=data.access_token=");
|
||||
// 设置用户信息
|
||||
userStore.setUserInfo(result?.data?.user_data);
|
||||
//设置好了token和用户信息跳转到首页
|
||||
setTimeout(() => {
|
||||
$router.push({ path: "/" });
|
||||
}, 500);
|
||||
} else {
|
||||
location.href = usePathUrl();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user