no message
This commit is contained in:
parent
c233dc932c
commit
cf787e136e
|
@ -4,6 +4,8 @@ import zhCn from "element-plus/es/locale/lang/zh-cn";
|
|||
import useAppStore from "./stores/modules/app";
|
||||
import useSettingStore from "./stores/modules/setting";
|
||||
import { ScreenEnum } from "./enums/appEnums";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
const appStore = useAppStore();
|
||||
const settingStore = useSettingStore();
|
||||
const elConfig = {
|
||||
|
|
|
@ -71,7 +71,6 @@ export function merchantCategoryApi(params: any) {
|
|||
return request.get({ url: '/merchant.merchant/merchantCategory', params })
|
||||
}
|
||||
|
||||
|
||||
// 区域分类
|
||||
export function merchantAreaListApi(params: any) {
|
||||
return request.get({ url: '/merchant.merchant/AreatList', params })
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<el-popover placement="bottom" trigger="hover" width="200px">
|
||||
<template #reference>
|
||||
<el-badge
|
||||
:is-dot="newsList.length > 0 ? true : false"
|
||||
:value="newsList.length"
|
||||
class="item"
|
||||
style="display: flex; align-items: center; height: 100%; cursor: pointer"
|
||||
>
|
||||
|
@ -32,22 +32,24 @@
|
|||
import { useRouter } from "vue-router";
|
||||
import { newList } from "@/api/merchant";
|
||||
import { getRoutePath } from "@/router";
|
||||
import { ref, getCurrentInstance, type ComponentInternalInstance, onMounted, onBeforeMount } from "vue";
|
||||
import mitt from "@/utils/mitt";
|
||||
|
||||
// 總線
|
||||
mitt.on("selfEvent", (res: any) => {
|
||||
getNewsList();
|
||||
});
|
||||
|
||||
const { appContext } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const newsList = ref([]);
|
||||
onMounted(()=>{
|
||||
appContext.config.globalProperties.$mitt.on('selfEvent',(res:any)=>{
|
||||
console.log('执行了自定义方法')
|
||||
// 消息通知 路由变动
|
||||
newList("").then((res) => {
|
||||
newsList.value = res;
|
||||
});
|
||||
})
|
||||
})
|
||||
const getNewsList = () => {
|
||||
// 消息通知 路由变动
|
||||
newList("").then((res: any) => {
|
||||
newsList.value = res;
|
||||
});
|
||||
};
|
||||
|
||||
getNewsList();
|
||||
|
||||
// 列表点击事件
|
||||
|
||||
const router = useRouter();
|
||||
const rowClick = (row: any) => {
|
||||
router.push({
|
||||
|
@ -55,4 +57,9 @@ const rowClick = (row: any) => {
|
|||
query: { mer_ids: row.mer_ids.join(",") },
|
||||
});
|
||||
};
|
||||
router.beforeEach((a, b, c) => {
|
||||
// 定义全局方法,执行bell上的数据
|
||||
getNewsList();
|
||||
c();
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
import mitt from "mitt";
|
||||
|
||||
const mi: any = mitt();
|
||||
|
||||
export default mi;
|
|
@ -9,22 +9,22 @@
|
|||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="店铺类型" prop="type_id">
|
||||
<el-form-item label="商户分类" prop="type_id">
|
||||
<el-select
|
||||
class="w-[280px]"
|
||||
placeholder="请输入店铺类型"
|
||||
placeholder="请选择商户分类"
|
||||
v-model="formData.type_id"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in merchantData"
|
||||
:label="item.type_name"
|
||||
:value="item.mer_type_id"
|
||||
:key="item.mer_type_id"
|
||||
:label="item.category_name"
|
||||
:value="item.merchant_category_id"
|
||||
:key="item.merchant_category_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="店铺类型" prop="open">
|
||||
<el-form-item label="状态" prop="open">
|
||||
<el-switch v-model="formData.open" active-text="开启" inactive-text="关闭">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
|
@ -41,7 +41,7 @@
|
|||
<script lang="ts" setup name="cateTimeEdit">
|
||||
import type { FormInstance } from "element-plus";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { merchantCate } from "@/api/merchant";
|
||||
import { merchantCategoryApi } from "@/api/merchant";
|
||||
import { apiRecordDetail } from "@/api/record";
|
||||
import { cateTimeAddApi, cateTimeEditApi } from "@/api/cate_time";
|
||||
|
||||
|
@ -61,12 +61,13 @@ const formData = reactive({
|
|||
type_id: "",
|
||||
time: "",
|
||||
open: true,
|
||||
merchant_id: "",
|
||||
});
|
||||
|
||||
// 商户分类
|
||||
const merchantData: any = ref([]);
|
||||
const getMerchantCate = async () => {
|
||||
merchantData.value = await merchantCate("");
|
||||
merchantData.value = await merchantCategoryApi("");
|
||||
};
|
||||
|
||||
// 表单验证
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="店铺类型" prop="type_id">
|
||||
<el-form-item label="商户分类" prop="type_id">
|
||||
<el-select
|
||||
placeholder="请选择商户"
|
||||
placeholder="请选择商户分类"
|
||||
v-model="queryParams.type_id"
|
||||
class="w-[280px]"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, indx) in merchantData"
|
||||
:key="item.mer_type_id"
|
||||
:value="item.mer_type_id + ''"
|
||||
:label="item.type_name"
|
||||
:key="item.merchant_category_id"
|
||||
:value="item.merchant_category_id + ''"
|
||||
:label="item.category_name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -35,7 +35,7 @@
|
|||
<el-table :data="pager.lists">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column
|
||||
label="店铺类型"
|
||||
label="商户分类"
|
||||
prop="cate_name"
|
||||
min-width="200"
|
||||
show-overflow-tooltip
|
||||
|
@ -79,10 +79,9 @@
|
|||
|
||||
<script lang="ts" setup name="cateTimeList">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { recordAll, recordInfo } from "@/api/record";
|
||||
import { cateTimeListsApi, cateTimeDelApi } from "@/api/cate_time";
|
||||
import feedback from "@/utils/feedback";
|
||||
import { merchantCate } from "@/api/merchant";
|
||||
import { merchantCategoryApi } from "@/api/merchant";
|
||||
import EditPopup from "./edit.vue";
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
|
@ -125,7 +124,7 @@ const handleDelete = async (id: number | any[]) => {
|
|||
// 商户分类
|
||||
const merchantData: any = ref([]);
|
||||
const getMerchantCate = async () => {
|
||||
merchantData.value = await merchantCate("");
|
||||
merchantData.value = await merchantCategoryApi("");
|
||||
};
|
||||
getMerchantCate();
|
||||
|
||||
|
|
|
@ -24,88 +24,7 @@
|
|||
label-width="100px"
|
||||
:rules="rules"
|
||||
>
|
||||
<div class="form-wrap">
|
||||
<el-form-item label="商户名称" prop="mer_name">
|
||||
<el-input
|
||||
class="w-80"
|
||||
v-model="formData.mer_name"
|
||||
placeholder="请输入商户名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="真实姓名" prop="real_name">
|
||||
<el-input
|
||||
class="w-80"
|
||||
v-model="formData.real_name"
|
||||
placeholder="请输入真实姓名"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="总采购金额" prop="purchase_amount">
|
||||
<el-input
|
||||
class="w-80"
|
||||
v-model="formData.purchase_amount"
|
||||
placeholder="请输入总采购金额"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="总销售金额" prop="sale_amount">
|
||||
<el-input
|
||||
class="w-80"
|
||||
v-model="formData.sale_amount"
|
||||
placeholder="请输入总销售金额"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="手机号" prop="service_phone">
|
||||
<el-input
|
||||
class="w-80"
|
||||
v-model="formData.service_phone"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="评分" prop="product_score">
|
||||
<el-input
|
||||
class="w-80"
|
||||
v-model="formData.product_score"
|
||||
placeholder="请输入评分"
|
||||
type="number"
|
||||
maxlength="1"
|
||||
max="5"
|
||||
min="1"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="店铺类型" prop="type_name">
|
||||
<el-select
|
||||
class="w-80"
|
||||
v-model="formData.type_name"
|
||||
placeholder="请输入店铺类型"
|
||||
>
|
||||
<el-option
|
||||
:label="item.type_name"
|
||||
:value="item.mer_type_id"
|
||||
v-for="item in merchantData"
|
||||
:key="item.mer_type_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="地址" prop="mer_address">
|
||||
<el-input
|
||||
class="w-80"
|
||||
v-model="formData.mer_address"
|
||||
placeholder="请输入地址"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="form-wrap"></div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<footer-btns>
|
||||
|
|
|
@ -18,6 +18,16 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="真实姓名" prop="real_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.real_name"
|
||||
placeholder="请输入真实姓名"
|
||||
clearable
|
||||
@keyup.enter="resetPage"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="店铺类型" prop="type_id">
|
||||
<el-select
|
||||
class="w-[280px]"
|
||||
|
@ -25,6 +35,7 @@
|
|||
v-model="queryParams.type_id"
|
||||
@keyup.enter="resetPage"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option
|
||||
v-for="item in merchantData"
|
||||
:label="item.type_name"
|
||||
|
@ -41,6 +52,7 @@
|
|||
v-model="queryParams.category_id"
|
||||
@keyup.enter="resetPage"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option
|
||||
v-for="item in categoryList"
|
||||
:label="item.category_name"
|
||||
|
@ -57,6 +69,7 @@
|
|||
v-model="queryParams.wholesale"
|
||||
@keyup.enter="resetPage"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="仅零售" value="0" />
|
||||
<el-option label="仅批发" value="1" />
|
||||
<el-option label="零售批发" value="2" />
|
||||
|
@ -103,16 +116,6 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="真实姓名" prop="real_name">
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.real_name"
|
||||
placeholder="请输入真实姓名"
|
||||
clearable
|
||||
@keyup.enter="resetPage"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="区、县" prop="category_id">
|
||||
<el-select
|
||||
class="w-[280px]"
|
||||
|
@ -121,6 +124,7 @@
|
|||
@keyup.enter="resetPage"
|
||||
@change="areaChange"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option
|
||||
v-for="item in areaList"
|
||||
:label="item.area_name"
|
||||
|
@ -137,6 +141,7 @@
|
|||
v-model="queryParams.street_id"
|
||||
@keyup.enter="resetPage"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option
|
||||
v-for="item in streetList"
|
||||
:label="item.street_name"
|
||||
|
@ -146,6 +151,19 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否分配" prop="status">
|
||||
<el-select
|
||||
class="w-[280px]"
|
||||
placeholder="请是否分配"
|
||||
v-model="queryParams.status"
|
||||
@keyup.enter="resetPage"
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="未分配" value="1" />
|
||||
<el-option label="已分配" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
|
@ -187,7 +205,15 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商户名称" prop="mer_name" min-width="220" />
|
||||
<el-table-column label="商户分类" prop="category_name" min-width="220" />
|
||||
<el-table-column label="真实姓名" prop="real_name" min-width="100" />
|
||||
<el-table-column label="是否分配" prop="real_name" min-width="100">
|
||||
<template #default="props">
|
||||
<el-tag v-if="props.row.admin_id > 0" type="success">已分配</el-tag>
|
||||
<el-tag v-else type="info">未分配</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="接受人" prop="admin_name" min-width="100" />
|
||||
<el-table-column label="总采购金额" prop="purchase_amount" min-width="100" />
|
||||
<el-table-column label="总销售金额" prop="sale_amount" min-width="100" />
|
||||
<el-table-column label="手机号" prop="service_phone" min-width="120" />
|
||||
|
@ -197,22 +223,8 @@
|
|||
<el-table-column label="地址" prop="mer_address" min-width="220" />
|
||||
<el-table-column label="操作" width="240" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['merchant.merchant/edit', 'merchant.merchant/add:edit']"
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
>
|
||||
<router-link
|
||||
:to="{
|
||||
path: getRoutePath('merchant.merchant/add:edit'),
|
||||
query: {
|
||||
id: row.mer_id,
|
||||
},
|
||||
}"
|
||||
>
|
||||
编辑
|
||||
</router-link>
|
||||
<el-button @click="onView(row)" type="primary" size="small" link>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['merchant.merchant/edit', 'merchant.merchant/add:edit']"
|
||||
|
@ -288,6 +300,95 @@
|
|||
</el-form>
|
||||
</Popup>
|
||||
|
||||
<!-- 详情查看 -->
|
||||
<Popup
|
||||
ref="viewRef"
|
||||
title="详情"
|
||||
:async="true"
|
||||
width="650px"
|
||||
@confirm="handleSubmit"
|
||||
@close="onClose"
|
||||
confirmButtonText=""
|
||||
>
|
||||
<el-form ref="formRef" class="ls-form" :model="bindForm" label-width="110px">
|
||||
<el-form-item label="商户名称" prop="mer_name">
|
||||
<el-input
|
||||
v-model="formData.mer_name"
|
||||
placeholder="请输入商户名称"
|
||||
clearable
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="真实姓名" prop="real_name">
|
||||
<el-input v-model="formData.real_name" placeholder="请输入真实姓名" readonly />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="总采购金额" prop="purchase_amount">
|
||||
<el-input
|
||||
v-model="formData.purchase_amount"
|
||||
placeholder="请输入总采购金额"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="总销售金额" prop="sale_amount">
|
||||
<el-input
|
||||
v-model="formData.sale_amount"
|
||||
placeholder="请输入总销售金额"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="手机号" prop="service_phone">
|
||||
<el-input
|
||||
v-model="formData.service_phone"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="评分" prop="product_score">
|
||||
<el-input
|
||||
v-model="formData.product_score"
|
||||
placeholder="请输入评分"
|
||||
type="number"
|
||||
maxlength="1"
|
||||
max="5"
|
||||
min="1"
|
||||
clearable
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="店铺类型" prop="type_name">
|
||||
<el-select
|
||||
v-model="formData.type_name"
|
||||
placeholder="请输入店铺类型"
|
||||
disabled
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
:label="item.type_name"
|
||||
:value="item.mer_type_id"
|
||||
v-for="item in merchantData"
|
||||
:key="item.mer_type_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="地址" prop="mer_address">
|
||||
<el-input
|
||||
v-model="formData.mer_address"
|
||||
placeholder="请输入地址"
|
||||
clearable
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</Popup>
|
||||
|
||||
<!-- 督导情况 -->
|
||||
<Popup
|
||||
ref="monitorRef"
|
||||
|
@ -297,6 +398,9 @@
|
|||
@confirm="onBindSubmit"
|
||||
@close="onMonitorClose"
|
||||
>
|
||||
<div style="font-size: 20px; color: #333; text-align: center; margin-bottom: 20px">
|
||||
{{ monitorForm.mer_name }}
|
||||
</div>
|
||||
<el-form ref="formRef" :model="monitorForm" label-width="180px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
|
@ -322,7 +426,7 @@
|
|||
v-model="monitorForm.store_condition.survival_rate"
|
||||
placeholder="请输入成活率"
|
||||
controls-position="right"
|
||||
:min="0.01"
|
||||
:min="0.0"
|
||||
:max="100"
|
||||
:step="1"
|
||||
:precision="2"
|
||||
|
@ -353,7 +457,7 @@
|
|||
v-model="monitorForm.store_condition.administrator_rate"
|
||||
placeholder="请输入成活率"
|
||||
controls-position="right"
|
||||
:min="0.01"
|
||||
:min="0.0"
|
||||
:max="100"
|
||||
:step="1"
|
||||
:precision="2"
|
||||
|
@ -384,7 +488,7 @@
|
|||
v-model="monitorForm.store_condition.operate_rate"
|
||||
placeholder="请输入成活率"
|
||||
controls-position="right"
|
||||
:min="0.01"
|
||||
:min="0.0"
|
||||
:max="100"
|
||||
:step="1"
|
||||
:precision="2"
|
||||
|
@ -656,11 +760,17 @@
|
|||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="商品总数">
|
||||
<el-form-item label="在售商品总数">
|
||||
<el-input v-model="monitorForm.saleNum" placeholder="" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="商品总数">
|
||||
<el-input v-model="monitorForm.allGoods" placeholder="" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="商品分类">
|
||||
<el-table :data="monitorForm.storeCates" max-height="320">
|
||||
|
@ -788,6 +898,7 @@
|
|||
</el-row>
|
||||
</el-form>
|
||||
</Popup>
|
||||
|
||||
<!-- 跟进记录 -->
|
||||
<edit-popup ref="editRef" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
|
@ -807,6 +918,7 @@ import {
|
|||
streetListApi,
|
||||
saveConditionApi,
|
||||
recordManApi,
|
||||
merchantListNoPage,
|
||||
} from "@/api/merchant";
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useRoute } from "vue-router";
|
||||
|
@ -815,9 +927,11 @@ import feedback from "@/utils/feedback";
|
|||
import { ref } from "vue";
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import EditPopup from "@/views/record/edit.vue"; // 跟进记录添加
|
||||
import mitt from "@/utils/mitt";
|
||||
|
||||
const monitorRef: any = ref(null); //监督弹框引用
|
||||
const formRef: any = ref(null); //监督表单引用
|
||||
const viewRef: any = ref(null); //查看
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>(); //商户分配dialog
|
||||
const tableRef: any = ref(null); //表格引用
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
|
@ -836,6 +950,7 @@ const queryParams = reactive({
|
|||
wholesale: "",
|
||||
area_id: "",
|
||||
street_id: "",
|
||||
status: "",
|
||||
});
|
||||
// 获取参数
|
||||
const route = useRoute();
|
||||
|
@ -872,23 +987,51 @@ const bindForm: any = reactive({
|
|||
|
||||
// 绑定商户
|
||||
const onBind = (e: any) => {
|
||||
if (e.admin_id > 0) {
|
||||
return feedback.notifyError("该商户已绑定!");
|
||||
}
|
||||
popupRef.value?.open();
|
||||
bindForm.merchant_ids.push(e.mer_id);
|
||||
};
|
||||
|
||||
// 查看
|
||||
const formData = ref(null);
|
||||
const onView = (e: any) => {
|
||||
formData.value = e;
|
||||
viewRef.value?.open();
|
||||
};
|
||||
|
||||
// 批量绑定
|
||||
const onBindBatch = async () => {
|
||||
if (!selectData.value || selectData.value.length === 0)
|
||||
return await feedback.notifyError("请至少选择一条记录!");
|
||||
popupRef.value?.open();
|
||||
|
||||
selectData.value.forEach((item) => {
|
||||
bindForm.merchant_ids.push(item);
|
||||
if (item.admin_id > 0) {
|
||||
tableRef.value?.toggleRowSelection(item, false);
|
||||
} else {
|
||||
bindForm.merchant_ids.push(item.mer_id);
|
||||
}
|
||||
});
|
||||
|
||||
popupRef.value?.open();
|
||||
};
|
||||
|
||||
// 预下载
|
||||
const onDownload = () => {
|
||||
excelApi(queryParams).then((res) => {});
|
||||
const arr: any = reactive({
|
||||
data: [],
|
||||
});
|
||||
if (selectData.value.length > 0) {
|
||||
selectData.value.forEach((item: any) => {
|
||||
arr.data.push(item.mer_id);
|
||||
});
|
||||
}
|
||||
|
||||
excelApi({ mer_ids: arr.data }).then((res) => {
|
||||
arr.data = [];
|
||||
tableRef.value?.clearSelection();
|
||||
});
|
||||
};
|
||||
|
||||
// 绑定提交
|
||||
|
@ -902,7 +1045,14 @@ const handleSubmit = async () => {
|
|||
// 选中的商户行
|
||||
const selectData = ref<any[]>([]);
|
||||
const onSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ mer_id }) => mer_id);
|
||||
// if (val && val.length > 0) {
|
||||
// val.forEach((item) => {
|
||||
// if (item.admin_id > 0) {
|
||||
// tableRef.value?.toggleRowSelection(item, false);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
selectData.value = val;
|
||||
};
|
||||
|
||||
// 清除绑定选择的记录
|
||||
|
@ -916,7 +1066,28 @@ const onMonitorClose = () => {};
|
|||
|
||||
// 督导情况
|
||||
const onMonitor = async (row: any) => {
|
||||
console.log(row);
|
||||
let detail = await storeSuper({ mer_id: row.mer_id });
|
||||
if (!detail.store_condition || detail.store_condition.length == 0) {
|
||||
detail.mer_name = row.mer_name;
|
||||
detail.store_condition = {
|
||||
administrator: "",
|
||||
administrator_rate: "",
|
||||
condition: "",
|
||||
extend: "",
|
||||
finance: "",
|
||||
mer_id: detail.mer_id,
|
||||
merchant_name: "",
|
||||
operate: "",
|
||||
operate_rate: "",
|
||||
risk: "",
|
||||
supervisor: "",
|
||||
supervisor_more: "",
|
||||
survival_rate: "",
|
||||
technology: "",
|
||||
};
|
||||
}
|
||||
|
||||
monitorForm.value = detail;
|
||||
monitorRef.value?.open();
|
||||
};
|
||||
|
@ -1024,6 +1195,11 @@ const areaChange = () => {
|
|||
});
|
||||
};
|
||||
|
||||
// 添加跟进记录,刷新列表
|
||||
mitt.on("refresh", (res: any) => {
|
||||
getLists();
|
||||
});
|
||||
|
||||
getLists();
|
||||
|
||||
// 商户类型
|
||||
|
|
|
@ -70,7 +70,13 @@
|
|||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" />
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="5"
|
||||
v-model="formData.remark"
|
||||
clearable
|
||||
placeholder="请输入备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
|
@ -88,7 +94,8 @@ import {
|
|||
recordInfo,
|
||||
} from "@/api/record";
|
||||
import { merchantListNoPage } from "@/api/merchant";
|
||||
import { getCurrentInstance,type ComponentInternalInstance ,onMounted} from 'vue';
|
||||
import { getCurrentInstance,type ComponentInternalInstance ,ref} from 'vue';
|
||||
import mitt from "@/utils/mitt";
|
||||
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
|
@ -185,8 +192,9 @@ const handleSubmit = async () => {
|
|||
mode.value == "edit" ? await apiRecordEdit(data) : await apiRecordAdd(data);
|
||||
popupRef.value?.close();
|
||||
emit("success");
|
||||
const {appContext} = getCurrentInstance()as ComponentInternalInstance;
|
||||
appContext.config.globalProperties.$mitt.emit("selfEvent");
|
||||
|
||||
mitt.emit("selfEvent");
|
||||
mitt.emit("refresh")
|
||||
};
|
||||
|
||||
//打开弹窗
|
||||
|
@ -194,6 +202,12 @@ const open = (type = "add", merId = "") => {
|
|||
mode.value = type;
|
||||
popupRef.value?.open();
|
||||
if (merId) {
|
||||
formData. id ="";
|
||||
formData. theme= "";
|
||||
formData. rid= "";
|
||||
formData. admin_id= "";
|
||||
formData.remark= "";
|
||||
formData.flow_time= "";
|
||||
formData.merchant_id = merId;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline label-width="80">
|
||||
<el-form-item label="店铺类型" prop="mer_id">
|
||||
<el-form-item label="商户名称" prop="mer_id">
|
||||
<el-select
|
||||
class="w-[280px]"
|
||||
placeholder="请输入店铺类型"
|
||||
placeholder="请输入商户名称"
|
||||
v-model="queryParams.mer_id"
|
||||
@keyup.enter="resetPage"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in merchantData"
|
||||
:label="item.type_name"
|
||||
:value="item.mer_type_id"
|
||||
:key="item.mer_type_id"
|
||||
:label="item.mer_name"
|
||||
:value="item.mer_id"
|
||||
:key="item.mer_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -194,8 +194,7 @@
|
|||
<script lang="ts" setup name="recordLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { monitorListApi, monitorDelApi } from "@/api/monitor";
|
||||
import { merchantCate } from "@/api/merchant";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import { merchantListNoPage } from "@/api/merchant";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./edit.vue";
|
||||
|
||||
|
@ -223,7 +222,7 @@ const handleSelectionChange = (val: any[]) => {
|
|||
// 商户分类
|
||||
const merchantData: any = ref([]);
|
||||
const getMerchantCate = async () => {
|
||||
merchantData.value = await merchantCate("");
|
||||
merchantData.value = await merchantListNoPage("");
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
|
|
|
@ -121,196 +121,189 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup name="workbench">
|
||||
import { getWorkbench, merchantInfo } from '@/api/app'
|
||||
import { orderBy } from 'lodash-es';
|
||||
import vCharts from 'vue-echarts';
|
||||
import { getCurrentInstance,type ComponentInternalInstance ,onMounted} from 'vue';
|
||||
|
||||
// 定义全局方法,执行bell上的数据
|
||||
onMounted(()=>{
|
||||
const {appContext} = getCurrentInstance()as ComponentInternalInstance;
|
||||
appContext.config.globalProperties.$mitt.emit("selfEvent");
|
||||
})
|
||||
import { getWorkbench, merchantInfo } from "@/api/app";
|
||||
import { orderBy } from "lodash-es";
|
||||
import vCharts from "vue-echarts";
|
||||
|
||||
// 商品统计表单
|
||||
const merchantInfoData = ref({
|
||||
// 订单数
|
||||
order: {
|
||||
nowWeekOrders: 0,
|
||||
lastWeekOrders: 0
|
||||
},
|
||||
// 订单数
|
||||
order: {
|
||||
nowWeekOrders: 0,
|
||||
lastWeekOrders: 0,
|
||||
},
|
||||
|
||||
// 平台交易额
|
||||
amount: {
|
||||
nowWeekAmount: 0,
|
||||
lastWeekAmount: 0
|
||||
},
|
||||
// 平台交易额
|
||||
amount: {
|
||||
nowWeekAmount: 0,
|
||||
lastWeekAmount: 0,
|
||||
},
|
||||
|
||||
// echarts 本周数据配置项
|
||||
echartOptionNowWeek: {
|
||||
tooltip: { show: true },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisLabel: {
|
||||
show: true,
|
||||
rotate: 45
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: [],
|
||||
type: 'bar',
|
||||
barMaxWidth: 30,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top'
|
||||
}
|
||||
}
|
||||
]
|
||||
// echarts 本周数据配置项
|
||||
echartOptionNowWeek: {
|
||||
tooltip: { show: true },
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: [],
|
||||
axisLabel: {
|
||||
show: true,
|
||||
rotate: 45,
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: [],
|
||||
type: "bar",
|
||||
barMaxWidth: 30,
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
// echarts 上周数据配置项
|
||||
echartOptionLastWeek: {
|
||||
tooltip: { show: true },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisLabel: {
|
||||
show: true,
|
||||
rotate: 45
|
||||
}
|
||||
// echarts 上周数据配置项
|
||||
echartOptionLastWeek: {
|
||||
tooltip: { show: true },
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: [],
|
||||
axisLabel: {
|
||||
show: true,
|
||||
rotate: 45,
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: [],
|
||||
type: "bar",
|
||||
barMaxWidth: 30,
|
||||
label: {
|
||||
show: true,
|
||||
position: "top",
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: [],
|
||||
type: 'bar',
|
||||
barMaxWidth: 30,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
// 获取商品销量统计
|
||||
const getMerchangeInfo = () => {
|
||||
merchantInfo().then(res => {
|
||||
// 订单
|
||||
merchantInfoData.value.order.nowWeekOrders = res.nowWeekOrderNum;
|
||||
merchantInfoData.value.order.lastWeekOrders = res.lastWeekOrderNum;
|
||||
merchantInfo().then((res) => {
|
||||
// 订单
|
||||
merchantInfoData.value.order.nowWeekOrders = res.nowWeekOrderNum;
|
||||
merchantInfoData.value.order.lastWeekOrders = res.lastWeekOrderNum;
|
||||
|
||||
// 销售额
|
||||
merchantInfoData.value.amount.nowWeekAmount = res.nowWeekMoney;
|
||||
merchantInfoData.value.amount.lastWeekAmount = res.lastWeekMoney;
|
||||
// 销售额
|
||||
merchantInfoData.value.amount.nowWeekAmount = res.nowWeekMoney;
|
||||
merchantInfoData.value.amount.lastWeekAmount = res.lastWeekMoney;
|
||||
|
||||
// 本周商品销售数量
|
||||
let nameArr: any = [], dataArr: any = [];
|
||||
res.nowWeekGoods.map((item: any) => {
|
||||
nameArr.push(item.store_name ? item.store_name : '-');
|
||||
dataArr.push(item.product_count);
|
||||
});
|
||||
merchantInfoData.value.echartOptionNowWeek.xAxis.data = nameArr;
|
||||
merchantInfoData.value.echartOptionNowWeek.series[0].data = dataArr;
|
||||
|
||||
|
||||
// 上周商品销售数量
|
||||
let nameArr1: any = [], dataArr1: any = [];
|
||||
res.lastWeekGoods.map((item: any) => {
|
||||
nameArr1.push(item.store_name || '-');
|
||||
dataArr1.push(item.product_count);
|
||||
});
|
||||
merchantInfoData.value.echartOptionLastWeek.xAxis.data = nameArr1;
|
||||
merchantInfoData.value.echartOptionLastWeek.series[0].data = dataArr1;
|
||||
})
|
||||
}
|
||||
// 本周商品销售数量
|
||||
let nameArr: any = [],
|
||||
dataArr: any = [];
|
||||
res.nowWeekGoods.map((item: any) => {
|
||||
nameArr.push(item.store_name ? item.store_name : "-");
|
||||
dataArr.push(item.product_count);
|
||||
});
|
||||
merchantInfoData.value.echartOptionNowWeek.xAxis.data = nameArr;
|
||||
merchantInfoData.value.echartOptionNowWeek.series[0].data = dataArr;
|
||||
|
||||
// 上周商品销售数量
|
||||
let nameArr1: any = [],
|
||||
dataArr1: any = [];
|
||||
res.lastWeekGoods.map((item: any) => {
|
||||
nameArr1.push(item.store_name || "-");
|
||||
dataArr1.push(item.product_count);
|
||||
});
|
||||
merchantInfoData.value.echartOptionLastWeek.xAxis.data = nameArr1;
|
||||
merchantInfoData.value.echartOptionLastWeek.series[0].data = dataArr1;
|
||||
});
|
||||
};
|
||||
|
||||
// 表单数据
|
||||
const workbenchData: any = reactive({
|
||||
version: {
|
||||
version: '', // 版本号
|
||||
website: '', // 官网
|
||||
based: '',
|
||||
channel: {
|
||||
gitee: '',
|
||||
website: ''
|
||||
}
|
||||
version: {
|
||||
version: "", // 版本号
|
||||
website: "", // 官网
|
||||
based: "",
|
||||
channel: {
|
||||
gitee: "",
|
||||
website: "",
|
||||
},
|
||||
support: [],
|
||||
today: {}, // 今日数据
|
||||
menu: [], // 常用功能
|
||||
visitor: [], // 访问量
|
||||
article: [], // 文章阅读量
|
||||
},
|
||||
support: [],
|
||||
today: {}, // 今日数据
|
||||
menu: [], // 常用功能
|
||||
visitor: [], // 访问量
|
||||
article: [], // 文章阅读量
|
||||
|
||||
visitorOption: {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [0]
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
legend: {
|
||||
data: ['访问量']
|
||||
},
|
||||
itemStyle: {
|
||||
// 点的颜色。
|
||||
color: 'red'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '访问量',
|
||||
data: [0],
|
||||
type: 'line',
|
||||
smooth: true
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
visitorOption: {
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: [0],
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
},
|
||||
legend: {
|
||||
data: ["访问量"],
|
||||
},
|
||||
itemStyle: {
|
||||
// 点的颜色。
|
||||
color: "red",
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: "访问量",
|
||||
data: [0],
|
||||
type: "line",
|
||||
smooth: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
// 获取工作台主页数据
|
||||
const getData = () => {
|
||||
getWorkbench()
|
||||
.then((res: any) => {
|
||||
workbenchData.version = res.version
|
||||
workbenchData.today = res.today
|
||||
workbenchData.menu = res.menu
|
||||
workbenchData.visitor = res.visitor
|
||||
workbenchData.support = res.support
|
||||
getWorkbench()
|
||||
.then((res: any) => {
|
||||
workbenchData.version = res.version;
|
||||
workbenchData.today = res.today;
|
||||
workbenchData.menu = res.menu;
|
||||
workbenchData.visitor = res.visitor;
|
||||
workbenchData.support = res.support;
|
||||
|
||||
// 清空echarts 数据
|
||||
workbenchData.visitorOption.xAxis.data = []
|
||||
workbenchData.visitorOption.series[0].data = []
|
||||
// 清空echarts 数据
|
||||
workbenchData.visitorOption.xAxis.data = [];
|
||||
workbenchData.visitorOption.series[0].data = [];
|
||||
|
||||
// 写入从后台拿来的数据
|
||||
res.visitor.date.reverse().forEach((item: any) => {
|
||||
workbenchData.visitorOption.xAxis.data.push(item)
|
||||
})
|
||||
res.visitor.list[0].data.forEach((item: any) => {
|
||||
workbenchData.visitorOption.series[0].data.push(item)
|
||||
})
|
||||
})
|
||||
.catch((err: any) => {
|
||||
console.log('err', err)
|
||||
})
|
||||
}
|
||||
// 写入从后台拿来的数据
|
||||
res.visitor.date.reverse().forEach((item: any) => {
|
||||
workbenchData.visitorOption.xAxis.data.push(item);
|
||||
});
|
||||
res.visitor.list[0].data.forEach((item: any) => {
|
||||
workbenchData.visitorOption.series[0].data.push(item);
|
||||
});
|
||||
})
|
||||
.catch((err: any) => {
|
||||
console.log("err", err);
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
getMerchangeInfo();
|
||||
})
|
||||
getData();
|
||||
getMerchangeInfo();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
Loading…
Reference in New Issue