Commit af0b1667 by Lin

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

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