Commit c6e75c4e by Lin

feat: 更新场景管理功能,调整API请求方式并优化数据处理

- 将getScenesByParams的请求方式从POST更改为GET
- 在financeList.vue中引入getScenesByParams并更新业务场景相关字段名称
- 优化场景数据的获取和处理逻辑,确保界面数据的正确性
1 parent 057b497f
...@@ -21,7 +21,7 @@ export function disableScene(data) { ...@@ -21,7 +21,7 @@ export function disableScene(data) {
// 获取公共业务场景列表 // 获取公共业务场景列表
export function getScenesByParams(data) { export function getScenesByParams(data) {
data.method = `${path}scene.getScenesByParams`; data.method = `${path}scene.getScenesByParams`;
return request(data, "post"); return request(data, "get");
} }
// 获取场景标签 // 获取场景标签
......
...@@ -670,6 +670,7 @@ ...@@ -670,6 +670,7 @@
import { getParkStore, getServiceStore } from "@api/editCustomer"; import { getParkStore, getServiceStore } from "@api/editCustomer";
import * as api from "@api/finance"; import * as api from "@api/finance";
import { getPlatformMerchantList, getTransferData } from "@api/index"; import { getPlatformMerchantList, getTransferData } from "@api/index";
import { getScenesByParams } from "@api/senseManage";
// import moment from 'moment' // import moment from 'moment'
import dayjs from "dayjs"; import dayjs from "dayjs";
import * as echarts from "echarts"; import * as echarts from "echarts";
...@@ -747,25 +748,25 @@ export default { ...@@ -747,25 +748,25 @@ export default {
}, },
{ {
label: "业务场景", label: "业务场景",
name: "channelType", name: "subSceneType",
type: "select", type: "select",
multiple: true, multiple: true,
collapseTags: true, collapseTags: true,
optionList: [], optionList: [],
optionId: "value", optionId: "id",
optionLabel: "name", optionLabel: "name",
optionsName: "channelTypeList", optionsName: "subSceneTypeList",
changeAttr: (value) => { changeAttr: (value) => {
if (!Array.isArray(value)) { if (!Array.isArray(value)) {
return; return;
} }
if (!value.length) { if (!value.length) {
this.searchForm.channelType = [""]; this.searchForm.baseSceneCode = [""];
return; return;
} }
if (value.includes("") && value.length > 1) { if (value.includes("") && value.length > 1) {
// 多选时,“全部”与具体值互斥;以最后一次选择为准 // 多选时,“全部”与具体值互斥;以最后一次选择为准
this.searchForm.channelType this.searchForm.baseSceneCodeList
= value[value.length - 1] === "" = value[value.length - 1] === ""
? [""] ? [""]
: value.filter(v => v !== ""); : value.filter(v => v !== "");
...@@ -876,8 +877,6 @@ export default { ...@@ -876,8 +877,6 @@ export default {
label: "渠道", label: "渠道",
name: "channelType", name: "channelType",
type: "select", type: "select",
multiple: true,
collapseTags: true,
optionList: [], optionList: [],
optionId: "value", optionId: "value",
optionLabel: "name", optionLabel: "name",
...@@ -938,6 +937,7 @@ export default { ...@@ -938,6 +937,7 @@ export default {
manageTypeList: deepClone(manageTypeList), manageTypeList: deepClone(manageTypeList),
PlatformMerchantList: [], PlatformMerchantList: [],
channelTypeList: [], channelTypeList: [],
subSceneTypeList: [],
reconciliationFlagList: [], reconciliationFlagList: [],
}, },
total: 0, total: 0,
...@@ -1092,6 +1092,11 @@ export default { ...@@ -1092,6 +1092,11 @@ export default {
this.baseData.PlatformMerchantList = res; this.baseData.PlatformMerchantList = res;
this.getOptionsList(); this.getOptionsList();
}); });
getScenesByParams({}).then((res) => {
const list = Array.isArray(res) ? res : (Array.isArray(res?.data) ? res.data : []);
this.baseData.subSceneTypeList = list.map(({ id, name }) => ({ id, name }));
this.getOptionsList();
});
this.getBaseData(); this.getBaseData();
}, },
methods: { methods: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!