Commit 0ce23df3 by Lin

fix(financeManage): 修改对账商户选择逻辑以支持单商户选择

- 将对账商户的选择方式从多选改为单选,更新相关表单字段以反映这一变化。
- 优化了商户选择后的数据处理逻辑,确保正确获取商户名称。
- 更新了用户提示信息,确保用户在未选择商户时能获得明确的反馈。
1 parent f45f0382
......@@ -51,8 +51,6 @@
</el-form-item>
<el-form-item label="对账商户:" prop="merchant">
<el-select v-model="infoForm.merchant"
multiple
:multiple-limit="multipleLimit"
filterable
style="width:400px"
@change="handleChangeMerchant">
......@@ -232,7 +230,7 @@ export default {
userInfo: this.$store.state.d2admin.user.info,
infoForm: {
merchantType: "2",
merchant: [],
merchant: "",
payStartDate: "",
payEndDate: "",
reportType: "1",
......@@ -364,7 +362,7 @@ export default {
params.merchantTypeList = merchantTypeList;
getMerchantPageSearch(params).then((res) => {
this.baseData.merchantList = res.list;
this.infoForm.merchant = [];
this.infoForm.merchant = "";
}).finally(() => {
this.loading = false;
});
......@@ -373,10 +371,14 @@ export default {
handleChangeMerchant(e) {
console.log(e);
this.infoForm.shopMerchantId = "";
if (!e) {
this.baseData.shopMerchantList = [];
return;
}
const params = {
currentPage: 1,
pageSize: 9999,
partnerMerchantId: e[0],
partnerMerchantId: e,
scene: this.scene,
};
getShopList(params).then((res) => {
......@@ -406,7 +408,7 @@ export default {
judgeTmpl() {
this.isTmpl = this.infoForm.merchantType == "2";
this.merchantTypeStr = this.typeObj[this.infoForm.merchantType];
this.infoForm.merchant = [];
this.infoForm.merchant = "";
this.resetTmplData();
},
......@@ -547,15 +549,15 @@ export default {
// console.log(infoForm)
let params = {};
let merchantList = [];
let obj;
infoForm.merchant.forEach((item) => {
obj = {};
obj.merchantId = item;
obj.merchantName = this.baseData.merchantList.find(
mer => mer.merchantId === item,
).merchantName;
merchantList.push(obj);
});
const currentMerchant = this.baseData.merchantList.find(
mer => mer.merchantId === infoForm.merchant,
);
if (currentMerchant) {
merchantList.push({
merchantId: infoForm.merchant,
merchantName: currentMerchant.merchantName,
});
}
params.payStartDate = infoForm.payStartDate + " 00:00:00";
params.payEndDate = infoForm.payEndDate + " 23:59:59";
merchantList.forEach((item, index) => {
......@@ -588,7 +590,7 @@ export default {
handleSystemBill() {
this.$refs.accountForm.validate((valid) => {
if (valid) {
if (this.infoForm.merchant.length == 1) {
if (this.infoForm.merchant) {
let params = this.getParams();
params.orderCurrentPage = 1;
params.orderPageSize = 10;
......@@ -598,7 +600,7 @@ export default {
this.$emit("handleBill", { billTmplInfo: res });
});
} else {
this.$message.warning("仅支持单商户进行系统对账");
this.$message.warning("请选择对账商户");
}
}
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!