Commit 970d2113 by wangzhihui

```

fix(earlyWarningManager): 修复门店招牌组件中切换商户功能的数据获取问题

- 修复区域筛选框的属性顺序问题,统一属性排列顺序
- 修复品牌级联选择器属性位置错误
- 修改区域运营、线上运营、区域督导选择器的属性顺序
- 重构切换商户对话框中的API调用逻辑,从listShop4sByRef改为getWarningSummaryList
- 修正商户列表数据绑定,使用merchantNo作为key和value
- 调整门店名称显示字段从merchantName为storeName
- 移除教学详情组件中的测试代码,删除硬编码的ID赋值
- 修复用户角色判断逻辑,优化线上运营权限验证方式
```
1 parent 3b6ad690
......@@ -10,10 +10,10 @@
<span class="label">区域:</span>
<el-select v-model="formData.provinceId"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
size="small"
clearable
filterable>
<el-option v-for="item in provinceOptions"
:key="item.code"
:label="item.name"
......@@ -25,24 +25,24 @@
<span class="label">品牌:</span>
<el-cascader v-model="formData.brand"
class="filter-select filter-select-brand"
placeholder="全部"
size="small"
clearable
collapse-tags
filterable
:options="brandOptions"
placeholder="全部"
:props="cascaderProps"
:show-all-levels="false"
size="small">
:show-all-levels="false">
</el-cascader>
</div>
<div class="filter-group">
<span class="label">区域运营:</span>
<el-select v-model="formData.regionOps"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
size="small"
clearable
filterable>
<el-option v-for="item in regionOpsOptions"
:key="item.value"
:label="item.label"
......@@ -54,10 +54,10 @@
<span class="label">线上运营:</span>
<el-select v-model="formData.onlineOps"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
size="small"
clearable
filterable>
<el-option v-for="item in onlineOpsOptions"
:key="item.value"
:label="item.label"
......@@ -69,10 +69,10 @@
<span class="label">区域督导:</span>
<el-select v-model="formData.supervisorOps"
class="filter-select"
clearable
filterable
placeholder="全部"
size="small">
size="small"
clearable
filterable>
<el-option v-for="item in supervisorOpsOptions"
:key="item.value"
:label="item.label"
......@@ -165,8 +165,8 @@ export default {
},
methods: {
getDefaultOnlineOps() {
const { roleName, uuid } = this.$store.state.d2admin.user.info?.detail || {};
return roleName === "线上运营" ? uuid : "";
const { uuid } = this.$store.state.d2admin.user.info?.detail || {};
return this.onlineOpsOptions.find(item => item.value == uuid) ? uuid : "";
},
getInitialFormData() {
return {
......
<template>
<baseDialog
:is-show.sync="dialogShow"
:dialog-config="dialogConfig.config"
class="detail-content-warn"
@handleClick="submit"
:btnLoding="btnLoding"
>
<el-form
v-loading="loading"
class="form"
label-width="120px"
size="small"
>
<el-form-item
label="门店名称:"
required
>
<el-select
v-model="currentMerchantId"
class="select"
filterable
>
<el-option
v-for="item in merchantList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId"
></el-option>
<baseDialog class="detail-content-warn"
:btn-loding="btnLoding"
:dialog-config="dialogConfig.config"
:is-show.sync="dialogShow"
@handleClick="submit">
<el-form v-loading="loading"
class="form"
label-width="120px"
size="small">
<el-form-item label="门店名称:"
required>
<el-select v-model="currentMerchantId"
class="select"
filterable>
<el-option v-for="item in merchantList"
:key="item.merchantNo"
:label="item.storeName"
:value="item.merchantNo">
</el-option>
</el-select>
</el-form-item>
</el-form>
......@@ -34,108 +25,118 @@
</template>
<script>
import { listShop4sByRef } from "@api/merchant"
export default {
name: "ChangeMerchantDialog",
props: {
visible: {
type: Boolean,
default: false
},
merchantId: [String, Number]
},
computed: {
dialogShow: {
get () {
return this.visible
},
set (val) {
this.close()
}
},
},
watch: {
visible: {
handler (val) {
if (val) {
this.currentMerchantId = this.merchantId
this.getMerchantList()
}
import { getWarningSummaryList } from "@/api/earlyWarningManager";
},
immediate: true,
deep: true
}
},
export default {
name: "ChangeMerchantDialog",
props: {
visible: {
type: Boolean,
default: false,
},
merchantId: [String, Number],
},
data() {
return {
dialogConfig: {
config: {
title: "切换门店",
width: "640px",
},
},
merchantList: [],
currentMerchantId: "",
loading: false,
btnLoding: false,
};
},
computed: {
dialogShow: {
get() {
return this.visible;
},
set(val) {
this.close();
},
},
},
watch: {
visible: {
handler(val) {
if (val) {
this.currentMerchantId = String(this.merchantId);
console.log(typeof (this.currentMerchantId));
this.getMerchantList();
}
},
immediate: true,
deep: true,
},
},
mounted () {
},
data () {
return {
dialogConfig: {
config: {
title: "切换门店",
width: "640px"
}
},
merchantList: [],
currentMerchantId: '',
loading: false,
btnLoding: false
}
},
methods: {
close () {
this.btnLoding = false
this.$emit('dialogClose')
},
async getMerchantList () {
this.loading = true
const data = await listShop4sByRef({})
this.loading = false
this.merchantList = data
},
async submit () {
this.btnLoding = true
if (this.currentMerchantId != this.merchantId) this.$emit('changeMerchant', {
merchantId: this.currentMerchantId,
merchantName: this.merchantList.find(item => item.merchantId == this.currentMerchantId).merchantName
})
this.close()
}
}
}
mounted() {
},
methods: {
close() {
this.btnLoding = false;
this.$emit("dialogClose");
},
async getMerchantList() {
this.loading = true;
console.log(this.$route.query);
const { businessType, startDate, endDate, periodType } = this.$route.query || {};
const data = await getWarningSummaryList({
businessType,
startDate,
endDate,
periodType,
});
this.loading = false;
this.merchantList = data;
},
async submit() {
this.btnLoding = true;
if (this.currentMerchantId != this.merchantId) {
this.$emit("changeMerchant", {
merchantId: this.currentMerchantId,
merchantName: this.merchantList.find(item => item.merchantNo == this.currentMerchantId).storeName,
});
}
this.close();
},
},
};
</script>
<style lang="scss" scoped>
.flex {
display: flex;
align-items: center;
display: flex;
align-items: center;
}
.detail-content-warn {
::v-deep .el-dialog {
height: 256px;
.el-dialog__body {
padding-bottom: 24px;
// border-bottom: 1px solid #e6e6e6;
}
.el-dialog__footer {
margin-top: auto;
border-top: 1px solid #e5e5e5;
padding: 15px 20px 15px;
}
.dialog-footer {
border-top: none;
padding: 0;
}
}
.form {
height: 89px;
padding: 37px 22px 0 0;
box-sizing: border-box;
.select {
width: 436px;
}
}
::v-deep .el-dialog {
height: 256px;
.el-dialog__body {
padding-bottom: 24px;
// border-bottom: 1px solid #e6e6e6;
}
.el-dialog__footer {
margin-top: auto;
border-top: 1px solid #e5e5e5;
padding: 15px 20px 15px;
}
.dialog-footer {
border-top: none;
padding: 0;
}
}
.form {
height: 89px;
padding: 37px 22px 0 0;
box-sizing: border-box;
.select {
width: 436px;
}
}
}
</style>
......@@ -36,9 +36,9 @@
<el-image v-for="(img, imgIdx) in item.value"
:key="imgIdx"
fit="cover"
style="width: 80px; height: 80px; margin-right: 10px; border-radius: 4px;"
:preview-src-list="item.value"
:src="img"
style="width: 80px; height: 80px; margin-right: 10px; border-radius: 4px;">
:src="img">
</el-image>
</div>
<div v-else>
......@@ -109,7 +109,6 @@ export default {
if (!this.item.id)
return;
try {
this.item.id = 133;
const res = await queryStrategyStudyDetailById({ id: this.item.id });
if (res) {
this.formatDetailData(res);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!