Commit 970d2113 by wangzhihui

```

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

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