|
@@ -2,50 +2,25 @@
|
|
|
<div class="p-2">
|
|
<div class="p-2">
|
|
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter"
|
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter"
|
|
|
:leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
:leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
- <div v-show="showSearch" class="mb-[10px]">
|
|
|
|
|
- <el-card shadow="hover">
|
|
|
|
|
- <el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
|
|
|
|
- <el-form-item label="门店名称" prop="name">
|
|
|
|
|
- <el-input v-model="queryParams.name" placeholder="请输入门店名称" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="联系人" prop="contact">
|
|
|
|
|
- <el-input v-model="queryParams.contact" placeholder="请输入联系人" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="有效期至" prop="validity">
|
|
|
|
|
- <el-date-picker clearable v-model="queryParams.validity" type="date" value-format="YYYY-MM-DD"
|
|
|
|
|
- placeholder="请选择有效期至" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item>
|
|
|
|
|
- <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
|
|
- <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- </el-card>
|
|
|
|
|
|
|
+ <div v-show="showSearch" class="mb-[10px] bg-white p-[20px] rounded-[4px] flex justify-between items-center shadow-sm" style="background-color: #fff; padding: 20px; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,21,41,.08);">
|
|
|
|
|
+ <div class="text-[18px] font-bold text-[#303133]" style="font-size: 18px; font-weight: bold; color: #303133;">门店管理</div>
|
|
|
|
|
+ <div class="flex items-center gap-[10px]" style="display: flex; gap: 10px; align-items: center;">
|
|
|
|
|
+ <el-input v-model="queryParams.storeOrContact" placeholder="搜索门店名称/联系人" prefix-icon="Search"
|
|
|
|
|
+ style="width: 250px" clearable @keyup.enter="handleQuery" @clear="handleQuery" />
|
|
|
|
|
+ <el-cascader v-model="searchRegionValue" :options="areaOptions" placeholder="所属城市"
|
|
|
|
|
+ style="width: 150px" clearable @change="handleSearchAreaChange" />
|
|
|
|
|
+ <el-select v-model="queryParams.station" placeholder="所属站点" style="width: 150px" clearable @change="handleQuery">
|
|
|
|
|
+ <el-option v-for="site in searchSiteOptions" :key="site.value" :label="site.label" :value="site.value" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <el-select v-model="queryParams.status" placeholder="状态" style="width: 120px" clearable @change="handleQuery">
|
|
|
|
|
+ <el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <el-button type="primary" icon="Plus" @click="handleAdd" v-hasPermi="['system:store:add']">新增门店</el-button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</transition>
|
|
</transition>
|
|
|
|
|
|
|
|
<el-card shadow="never">
|
|
<el-card shadow="never">
|
|
|
- <template #header>
|
|
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
- <el-button type="primary" plain icon="Plus" @click="handleAdd"
|
|
|
|
|
- v-hasPermi="['system:store:add']">新增</el-button>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
- <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
|
|
|
|
|
- v-hasPermi="['system:store:edit']">修改</el-button>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
- <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
|
|
|
|
|
- v-hasPermi="['system:store:remove']">删除</el-button>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
- <el-button type="warning" plain icon="Download" @click="handleExport"
|
|
|
|
|
- v-hasPermi="['system:store:export']">导出</el-button>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" border :data="storeList" @selection-change="handleSelectionChange">
|
|
<el-table v-loading="loading" border :data="storeList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
@@ -86,6 +61,11 @@
|
|
|
<div>{{ scope.row.siteName }}</div>
|
|
<div>{{ scope.row.siteName }}</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column label="服务单" align="center" width="150">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <div>{{ scope.row.serviceOrder }}</div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="营业时间" align="center" width="150">
|
|
<el-table-column label="营业时间" align="center" width="150">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<div>{{ formatTime(scope.row.startBusinessTime) }}-{{ formatTime(scope.row.endBusinessTime) }}</div>
|
|
<div>{{ formatTime(scope.row.startBusinessTime) }}-{{ formatTime(scope.row.endBusinessTime) }}</div>
|
|
@@ -294,7 +274,7 @@
|
|
|
|
|
|
|
|
<script setup name="Store" lang="ts">
|
|
<script setup name="Store" lang="ts">
|
|
|
import { listStore, getStore, delStore, addStore, updateStore, listStoreStatus } from '@/api/system/store';
|
|
import { listStore, getStore, delStore, addStore, updateStore, listStoreStatus } from '@/api/system/store';
|
|
|
-import { StoreVO, StoreQuery, StoreForm, StoreStatusVO } from '@/api/system/store/types';
|
|
|
|
|
|
|
+import { StoreVO, StoreQuery, StoreForm, StoreStatusVO, SysStorePageBo } from '@/api/system/store/types';
|
|
|
import { listOnStore } from '@/api/system/tenant';
|
|
import { listOnStore } from '@/api/system/tenant';
|
|
|
import { listOnStore as listTenantCategoriesOnStore } from '@/api/system/tenantCategories';
|
|
import { listOnStore as listTenantCategoriesOnStore } from '@/api/system/tenantCategories';
|
|
|
import { listOnStore as listServiceOnStore } from '@/api/service/list';
|
|
import { listOnStore as listServiceOnStore } from '@/api/service/list';
|
|
@@ -318,6 +298,30 @@ const queryFormRef = ref<ElFormInstance>();
|
|
|
const storeFormRef = ref<ElFormInstance>();
|
|
const storeFormRef = ref<ElFormInstance>();
|
|
|
const brandSelectRef = ref<any>(null);
|
|
const brandSelectRef = ref<any>(null);
|
|
|
|
|
|
|
|
|
|
+const searchRegionValue = ref<any[]>([]); // 搜索的区域值
|
|
|
|
|
+const searchSiteOptions = ref<any[]>([]); // 搜索的站点选项
|
|
|
|
|
+
|
|
|
|
|
+/** 处理搜索区域选择变化 */
|
|
|
|
|
+const handleSearchAreaChange = (value: any[]) => {
|
|
|
|
|
+ // 清空级联站点
|
|
|
|
|
+ queryParams.value.station = undefined;
|
|
|
|
|
+
|
|
|
|
|
+ if (value && value.length > 0) {
|
|
|
|
|
+ const areaId = value[value.length - 1];
|
|
|
|
|
+ queryParams.value.area = areaId;
|
|
|
|
|
+ searchSiteOptions.value = areaStationList.value
|
|
|
|
|
+ .filter((item: any) => item.type === 2 && String(item.parentId) === String(areaId))
|
|
|
|
|
+ .map((item: any) => ({
|
|
|
|
|
+ value: item.id,
|
|
|
|
|
+ label: item.name
|
|
|
|
|
+ }));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ queryParams.value.area = undefined;
|
|
|
|
|
+ searchSiteOptions.value = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ handleQuery();
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// 新增的响应式变量
|
|
// 新增的响应式变量
|
|
|
const regionValue = ref<any[]>([]);
|
|
const regionValue = ref<any[]>([]);
|
|
|
const province = ref('');
|
|
const province = ref('');
|
|
@@ -386,17 +390,14 @@ const initFormData: StoreForm = {
|
|
|
services: [],
|
|
services: [],
|
|
|
regionId: undefined,
|
|
regionId: undefined,
|
|
|
}
|
|
}
|
|
|
-const data = reactive<PageData<StoreForm, StoreQuery>>({
|
|
|
|
|
|
|
+const data = reactive<PageData<StoreForm, SysStorePageBo>>({
|
|
|
form: { ...initFormData },
|
|
form: { ...initFormData },
|
|
|
queryParams: {
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
- pageSize: 1,
|
|
|
|
|
- businessLicense: undefined,
|
|
|
|
|
- name: undefined,
|
|
|
|
|
- tenantCatergories: undefined,
|
|
|
|
|
- contact: undefined,
|
|
|
|
|
- validity: undefined,
|
|
|
|
|
- site: undefined,
|
|
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ storeOrContact: undefined,
|
|
|
|
|
+ area: undefined,
|
|
|
|
|
+ station: undefined,
|
|
|
status: undefined,
|
|
status: undefined,
|
|
|
params: {
|
|
params: {
|
|
|
}
|
|
}
|
|
@@ -478,7 +479,12 @@ const handleQuery = () => {
|
|
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
|
const resetQuery = () => {
|
|
const resetQuery = () => {
|
|
|
- queryFormRef.value?.resetFields();
|
|
|
|
|
|
|
+ searchRegionValue.value = [];
|
|
|
|
|
+ searchSiteOptions.value = [];
|
|
|
|
|
+ queryParams.value.storeOrContact = undefined;
|
|
|
|
|
+ queryParams.value.area = undefined;
|
|
|
|
|
+ queryParams.value.station = undefined;
|
|
|
|
|
+ queryParams.value.status = undefined;
|
|
|
handleQuery();
|
|
handleQuery();
|
|
|
}
|
|
}
|
|
|
|
|
|