Commit af0b1667 by Lin

fix(financeManage): 更新表单字段以反映业务线与场景类型的变化

- 将 downloadAccountDialog.vue 和 downloadReconciDialog.vue 中的表单字段名称进行了调整,以确保与业务逻辑一致。
- 更新了表单验证规则,确保用户在选择业务线和场景时能获得明确的提示。
- 优化了数据处理逻辑,确保在切换业务线时能够正确同步场景类型列表。
1 parent 0ce23df3
......@@ -13,16 +13,16 @@
:model="infoForm"
:rules="formRules"
label-width="120px">
<el-form-item label="业务线:" prop="businessLine">
<el-select v-model="infoForm.businessLine" style="width:400px">
<el-option v-for="item in baseData.businessLineList"
<el-form-item label="业务线:" prop="sceneType">
<el-select v-model="infoForm.sceneType" style="width:400px">
<el-option v-for="item in baseData.sceneTypeList"
:key="item.confId"
:label="item.confLabel"
:value="item.confId" />
</el-select>
</el-form-item>
<el-form-item label="业务场景:" prop="sceneType">
<el-select v-model="infoForm.sceneType"
<el-form-item label="业务场景:" prop="baseSceneCodeList">
<el-select v-model="infoForm.baseSceneCodeList"
multiple
collapse-tags
style="width:400px"
......@@ -252,8 +252,8 @@ export default {
payEndDate: "",
reportType: "1",
shopMerchantId: "",
businessLine: "",
sceneType: [""],
sceneType: "",
baseSceneCodeList: [""],
reconciliationStatus: "all",
packageMerge: false,
templateId: "",
......@@ -269,8 +269,8 @@ export default {
},
formRules: {
businessLine: [{ required: true, message: "请选择业务线", trigger: "change" }],
sceneType: [{ required: true, message: "请选择业务场景", trigger: "change" }],
sceneType: [{ required: true, message: "请选择业务线", trigger: "change" }],
baseSceneCodeList: [{ required: true, message: "请选择业务场景", trigger: "change" }],
merchantType: [{ required: true, message: "请选择商户类型", trigger: "change" }],
merchant: [
{ required: true, message: "请选择对账商户", trigger: "change" },
......@@ -288,7 +288,7 @@ export default {
selectLoading: false,
// 基本数据
baseData: {
businessLineList: [{
sceneTypeList: [{
confId: "0",
confLabel: "权益类",
}, {
......@@ -358,17 +358,17 @@ export default {
"scene": {
handler(val) {
const sceneStr = val == null ? "" : String(val);
const exists = this.baseData.businessLineList.some(i => i.confId === sceneStr);
this.infoForm.businessLine = exists ? sceneStr : (this.baseData.businessLineList[0]?.confId || "");
const exists = this.baseData.sceneTypeList.some(i => i.confId === sceneStr);
this.infoForm.sceneType = exists ? sceneStr : (this.baseData.sceneTypeList[0]?.confId || "");
// 首次打开弹框时,确保能根据当前业务线拉取“业务场景”列表
this.syncSceneTypeList();
},
immediate: true,
},
"infoForm.businessLine": {
"infoForm.sceneType": {
handler() {
// 切换业务线时,业务场景默认回到“全部”
this.infoForm.sceneType = [""];
this.infoForm.baseSceneCodeList = [""];
this.syncSceneTypeList();
},
},
......@@ -396,8 +396,8 @@ export default {
methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]),
syncSceneTypeList() {
const sceneType = Number(this.infoForm?.businessLine);
if (this.infoForm?.businessLine === "" || this.infoForm?.businessLine === null || this.infoForm?.businessLine === undefined || Number.isNaN(sceneType)) {
const sceneType = Number(this.infoForm?.sceneType);
if (this.infoForm?.sceneType === "" || this.infoForm?.sceneType === null || this.infoForm?.sceneType === undefined || Number.isNaN(sceneType)) {
this.sceneTypeList = [];
return;
}
......@@ -421,12 +421,12 @@ export default {
return;
}
if (!value.length) {
this.infoForm.sceneType = [""];
this.infoForm.baseSceneCodeList = [""];
return;
}
if (value.includes("") && value.length > 1) {
// 多选时,“全部”与具体值互斥;以最后一次选择为准
this.infoForm.sceneType = value[value.length - 1] === ""
this.infoForm.baseSceneCodeList = value[value.length - 1] === ""
? [""]
: value.filter(v => v !== "");
}
......@@ -652,6 +652,7 @@ export default {
params.reportType = infoForm.reportType;
}
params.sceneType = this.scene;
params.baseSceneCodeList = infoForm.baseSceneCodeList;
// 对账状态
infoForm.reconciliationStatus == "all" ? "" : (params.reconciliationStatus = infoForm.reconciliationStatus);
// infoForm.payeeType == 'all' ? '' : (params.payeeType = infoForm.payeeType)
......
......@@ -13,8 +13,8 @@
:model="infoForm"
:rules="formRules"
label-width="120px">
<el-form-item label="业务场景:" prop="businessLine">
<el-select v-model="infoForm.businessLine" style="width:400px">
<el-form-item label="业务场景:" prop="sceneType">
<el-select v-model="infoForm.sceneType" style="width:400px">
<el-option v-for="item in baseData.businessLineList"
:key="item.confId"
:label="item.confLabel"
......@@ -229,6 +229,7 @@ export default {
},
userInfo: this.$store.state.d2admin.user.info,
infoForm: {
sceneType: "",
merchantType: "2",
merchant: "",
payStartDate: "",
......@@ -251,7 +252,7 @@ export default {
},
formRules: {
businessLine: [{ required: true, message: "请选择业务线", trigger: "change" }],
sceneType: [{ required: true, message: "请选择业务场景", trigger: "change" }],
merchantType: [{ required: true, message: "请选择商户类型", trigger: "change" }],
merchant: [
{ required: true, message: "请选择对账商户", trigger: "change" },
......@@ -570,7 +571,7 @@ export default {
if (infoForm.merchantType == "7") {
params.reportType = infoForm.reportType;
}
params.sceneType = this.scene;
params.sceneType = infoForm.sceneType;
// 对账状态
infoForm.reconciliationStatus == "all" ? "" : (params.reconciliationStatus = infoForm.reconciliationStatus);
// infoForm.payeeType == 'all' ? '' : (params.payeeType = infoForm.payeeType)
......
......@@ -981,7 +981,7 @@ export default {
// this.showFormData[this.findFormIdx('yqMerchantId')].isHide = true
// }
// this.showFormData[this.findFormIdx('merchantId')].isHide = true
this.showFormData[this.findFormIdx("businessModel")].isHide = true;
// this.showFormData[this.findFormIdx("businessModel")].isHide = true;
this.showFormData[this.findFormIdx("yqMerchantId")].isHide = false;
this.showFormData[this.findFormIdx("merchantId")].isHide = false;
this.sellerName_visible = false;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!