Commit 0ce23df3 by Lin

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

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