This commit is contained in:
GaoHao
2025-04-09 16:43:57 +08:00
4 changed files with 40 additions and 16 deletions

View File

@@ -52,7 +52,7 @@
<span>营业</span> <span>营业</span>
</div> </div>
<div class="u-flex" style="flex-wrap: wrap"> <div class="u-flex" style="flex-wrap: wrap">
<el-select v-model="storeId" placeholder="选择分店" style="width: 200px; margin-right: 10px;"> <el-select v-model="shopId" placeholder="选择分店" style="width: 200px; margin-right: 10px;" @change="shopChange">
<el-option v-for="item in branchList" :key="item.shopId" :label="item.shopName" :value="item.shopId" /> <el-option v-for="item in branchList" :key="item.shopId" :label="item.shopName" :value="item.shopId" />
</el-select> </el-select>
<div class="time_wrap u-flex" style="flex-shrink: 0"> <div class="time_wrap u-flex" style="flex-shrink: 0">
@@ -391,7 +391,7 @@ export default {
}, },
], ],
branchList: [], branchList: [],
storeId: null, shopId: null,
trade: {}, trade: {},
formatDecimal, formatDecimal,
topData: "", topData: "",
@@ -486,10 +486,18 @@ export default {
// this.initCardUserChart(); // this.initCardUserChart();
}, },
methods: { methods: {
/**
* 获取分店列表
*/
async geiShopList() { async geiShopList() {
let res = await ShopApi.getBranchList() let res = await ShopApi.getBranchList()
this.branchList = res; this.branchList = res;
}, },
shopChange(){
this.summarytrade();
this.lineChartTypeChange(this.lineChartType)
this.dateProduct()
},
// 切换时间 // 切换时间
timeChange(e) { timeChange(e) {
const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"]; const format = ["YYYY-MM-DD 00:00:00", "YYYY-MM-DD 23:59:59"];
@@ -555,6 +563,7 @@ export default {
const res = await dataSummaryApi.trade({ const res = await dataSummaryApi.trade({
beginDate: this.query.createdAt[0], beginDate: this.query.createdAt[0],
endDate: this.query.createdAt[1], endDate: this.query.createdAt[1],
shopId: this.shopId
}); });
this.trade = res; this.trade = res;
this.tradeLoading = false; this.tradeLoading = false;
@@ -878,7 +887,7 @@ export default {
async dateAmount() { async dateAmount() {
try { try {
this.saleLoading = true; this.saleLoading = true;
const res = await dataSummaryApi.dateAmount({ day: this.saleActive }); const res = await dataSummaryApi.dateAmount({ day: this.saleActive,shopId: this.shopId });
const data = res.total.map((item) => { const data = res.total.map((item) => {
return { return {
orderAmount: item.orderAmount, orderAmount: item.orderAmount,
@@ -907,6 +916,7 @@ export default {
day: this.saleTableActive, day: this.saleTableActive,
page: this.saleTablePage, page: this.saleTablePage,
size: this.saleTableSize, size: this.saleTableSize,
shopId: this.shopId
}); });
this.saleTable = res.records; this.saleTable = res.records;
this.saleTableTotal = res.totalRow * 1; this.saleTableTotal = res.totalRow * 1;
@@ -922,7 +932,7 @@ export default {
async datePayType() { async datePayType() {
try { try {
this.payChartLoading = true; this.payChartLoading = true;
const res = await dataSummaryApi.datePayType({ day: this.saleActive }); const res = await dataSummaryApi.datePayType({ day: this.saleActive,shopId: this.shopId });
const data = res.countPayType.map((item) => { const data = res.countPayType.map((item) => {
return { return {
value: item.count, value: item.count,

View File

@@ -12,7 +12,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select v-model="storeId" placeholder="选择分店" style="width: 200px; margin-right: 10px"> <el-select v-model="shopId" placeholder="选择分店" style="width: 200px; margin-right: 10px">
<el-option v-for="item in branchList" :key="item.shopId" :label="item.shopName" :value="item.shopId" /> <el-option v-for="item in branchList" :key="item.shopId" :label="item.shopName" :value="item.shopId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -157,6 +157,7 @@
<script> <script>
import saleSummaryApi from "@/api/order/sale-summary"; import saleSummaryApi from "@/api/order/sale-summary";
import categoryApi from "@/api/product/productclassification"; import categoryApi from "@/api/product/productclassification";
import ShopApi from "@/api/account/shop";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { downloadFile } from "@/utils/index"; import { downloadFile } from "@/utils/index";
@@ -183,7 +184,7 @@ export default {
payCount: "", payCount: "",
payCountTotal: 0, payCountTotal: 0,
branchList: [], branchList: [],
storeId: null, shopId: null,
}; };
}, },
filters: { filters: {
@@ -216,6 +217,7 @@ export default {
page: 1, page: 1,
size: 200, size: 200,
orderBy: "name asc", orderBy: "name asc",
shopId: this.shopId
}); });
this.categorys = res; this.categorys = res;
} catch (error) { } catch (error) {
@@ -230,7 +232,7 @@ export default {
endDate: this.query.createdAt[1], endDate: this.query.createdAt[1],
prodCategoryId: this.query.prodCategoryId, prodCategoryId: this.query.prodCategoryId,
productName: this.query.productName, productName: this.query.productName,
shopId: this.shopId,
type: this.orderType, type: this.orderType,
}); });
this.payCount = res; this.payCount = res;
@@ -247,6 +249,7 @@ export default {
endDate: this.query.createdAt[1], endDate: this.query.createdAt[1],
prodCategoryId: this.query.prodCategoryId, prodCategoryId: this.query.prodCategoryId,
productName: this.query.productName, productName: this.query.productName,
shopId: this.shopId
}); });
downloadFile(file, "数据", "xlsx"); downloadFile(file, "数据", "xlsx");
this.downloadLoading = false; this.downloadLoading = false;
@@ -284,6 +287,7 @@ export default {
endDate: this.query.createdAt[1], endDate: this.query.createdAt[1],
productName: this.query.productName, productName: this.query.productName,
prodCategoryId: this.query.prodCategoryId, prodCategoryId: this.query.prodCategoryId,
shopId: this.shopId
}); });
this.tableData.loading = false; this.tableData.loading = false;
this.tableData.data = res.records; this.tableData.data = res.records;

View File

@@ -6,15 +6,16 @@
<el-input v-model="state.form.shopName" placeholder="请输入门店名称"></el-input> <el-input v-model="state.form.shopName" placeholder="请输入门店名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="店铺类型"> <el-form-item label="店铺类型">
<el-radio-group v-model="state.form.shopType" :disabled="state.form.id || state.type == 'addBranch'"> <el-radio-group v-model="state.form.shopType" :disabled="state.isEdit || state.type == 'addBranch'">
<el-radio-button value="only">单店</el-radio-button> <el-radio-button value="only">单店</el-radio-button>
<el-radio-button value="chain">连锁店</el-radio-button> <el-radio-button value="chain">连锁店</el-radio-button>
<el-radio-button value="join">加盟店</el-radio-button> <el-radio-button value="join">加盟店</el-radio-button>
</el-radio-group> </el-radio-group>
<div class="tips">请谨慎修改</div> <div class="tips"><el-alert title="请谨慎修改" type="warning" size="7" effect="dark" show-icon :closable="false"/></div>
</el-form-item> </el-form-item>
<el-form-item label="是否为主店" prop="isHeadShop" v-if="state.form.shopType != 'only'"> <el-form-item label="是否为主店" prop="isHeadShop" v-if="state.form.shopType != 'only'">
<el-radio-group v-model="state.form.isHeadShop" @change=" state.form.mainId = ''" :disabled="state.form.id || state.type == 'addBranch'"> <el-radio-group v-model="state.form.isHeadShop" @change=" state.form.mainId = ''" :disabled="state.isEdit || state.type == 'addBranch'">
<el-radio :value="1"></el-radio> <el-radio :value="1"></el-radio>
<el-radio :value="0"></el-radio> <el-radio :value="0"></el-radio>
</el-radio-group> </el-radio-group>
@@ -22,7 +23,7 @@
<el-form-item label="选择主店" prop="mainId" v-if="state.form.isHeadShop == '0'&&state.form.shopType != 'only'"> <el-form-item label="选择主店" prop="mainId" v-if="state.form.isHeadShop == '0'&&state.form.shopType != 'only'">
<!-- <el-form-item label="主店账号" prop="mainId" v-if="state.form.shopType != 'only'"> --> <!-- <el-form-item label="主店账号" prop="mainId" v-if="state.form.shopType != 'only'"> -->
<el-select v-model="state.form.mainId" placeholder="请选择主店铺" filterable reserve-keyword <el-select v-model="state.form.mainId" placeholder="请选择主店铺" filterable reserve-keyword
:remote-method="getTableData" :loading="state.shopListLoading" :disabled="state.form.id || state.type == 'addBranch'"> :remote-method="getTableData" :loading="state.shopListLoading" :disabled="state.isEdit || state.type == 'addBranch'">
<el-option v-for="item in state.shopList" :label="`${item.shopName}`" :value="item.id" <el-option v-for="item in state.shopList" :label="`${item.shopName}`" :value="item.id"
:key="item.id"></el-option> :key="item.id"></el-option>
</el-select> </el-select>
@@ -41,14 +42,16 @@
<el-radio-button value="before">先付费</el-radio-button> <el-radio-button value="before">先付费</el-radio-button>
<el-radio-button value="after">后付费</el-radio-button> <el-radio-button value="after">后付费</el-radio-button>
</el-radio-group> </el-radio-group>
<div class="tips">请谨慎修改</div> <div class="tips"><el-alert title="请谨慎修改" type="warning" size="7" effect="dark" show-icon :closable="false"/></div>
</el-form-item> </el-form-item>
<el-form-item label="管理方式" v-if="state.form.shopType != 'only'"> <el-form-item label="管理方式" v-if="state.form.shopType != 'only'">
<el-radio-group v-model="state.form.tubeType"> <el-radio-group v-model="state.form.tubeType">
<el-radio-button :value="0">不可直接管理</el-radio-button> <el-radio-button :value="0">不可直接管理</el-radio-button>
<el-radio-button :value="1">直接管理</el-radio-button> <el-radio-button :value="1">直接管理</el-radio-button>
</el-radio-group> </el-radio-group>
<div class="tips">请谨慎修改</div> <div class="tips"><el-alert title="请谨慎修改" type="warning" size="7" effect="dark" show-icon :closable="false"/></div>
</el-form-item> </el-form-item>
<el-form-item label="试用/正式"> <el-form-item label="试用/正式">
<el-radio-group v-model="state.form.profiles"> <el-radio-group v-model="state.form.profiles">
@@ -297,6 +300,7 @@ const state = reactive({
}, },
shopListLoading: false, shopListLoading: false,
shopList: [], shopList: [],
isEdit: false,
}); });
onBeforeMount(async () => { onBeforeMount(async () => {
const res = await initMapLoad(); const res = await initMapLoad();
@@ -387,7 +391,9 @@ function show(obj,type) {
} }
console.log(state.form); console.log(state.form);
console.log(state.type); console.log(state.type);
if( state.form.shopType != 'only'){
state.isEdit = true
}
for (let key in state.rules) { for (let key in state.rules) {
if (key === "accountName") { if (key === "accountName") {
if (obj.id) { if (obj.id) {
@@ -403,11 +409,12 @@ function close() {
state.dialogVisible = false; state.dialogVisible = false;
state.form = { ...state.resetForm }; state.form = { ...state.resetForm };
state.type = ""; state.type = "";
state.isEdit = false
} }
function reset() { function reset() {
state.form = { ...state.resetForm }; state.form = { ...state.resetForm };
state.type = ""; state.type = "";
state.isEdit = false
} }
let ElMap = undefined; let ElMap = undefined;
@@ -544,4 +551,7 @@ defineExpose({
.amap-sug-result { .amap-sug-result {
z-index: 2000; z-index: 2000;
} }
.tips{
margin-left: 10px;
}
</style> </style>

View File

@@ -10,7 +10,7 @@ const searchConfig: ISearchConfig = {
{ {
type: "select", type: "select",
label: "分店选择", label: "分店选择",
prop: "storeId", prop: "shopId",
attrs: { attrs: {
placeholder: "请选择分店", placeholder: "请选择分店",
clearable: true, clearable: true,