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

View File

@ -52,7 +52,7 @@
<span>营业</span>
</div>
<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-select>
<div class="time_wrap u-flex" style="flex-shrink: 0">
@ -391,7 +391,7 @@ export default {
},
],
branchList: [],
storeId: null,
shopId: null,
trade: {},
formatDecimal,
topData: "",
@ -486,10 +486,18 @@ export default {
// this.initCardUserChart();
},
methods: {
/**
* 获取分店列表
*/
async geiShopList() {
let res = await ShopApi.getBranchList()
this.branchList = res;
},
shopChange(){
this.summarytrade();
this.lineChartTypeChange(this.lineChartType)
this.dateProduct()
},
//
timeChange(e) {
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({
beginDate: this.query.createdAt[0],
endDate: this.query.createdAt[1],
shopId: this.shopId
});
this.trade = res;
this.tradeLoading = false;
@ -878,7 +887,7 @@ export default {
async dateAmount() {
try {
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) => {
return {
orderAmount: item.orderAmount,
@ -907,6 +916,7 @@ export default {
day: this.saleTableActive,
page: this.saleTablePage,
size: this.saleTableSize,
shopId: this.shopId
});
this.saleTable = res.records;
this.saleTableTotal = res.totalRow * 1;
@ -922,7 +932,7 @@ export default {
async datePayType() {
try {
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) => {
return {
value: item.count,

View File

@ -12,7 +12,7 @@
</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-select>
</el-form-item>
@ -157,6 +157,7 @@
<script>
import saleSummaryApi from "@/api/order/sale-summary";
import categoryApi from "@/api/product/productclassification";
import ShopApi from "@/api/account/shop";
import dayjs from "dayjs";
import { downloadFile } from "@/utils/index";
@ -183,7 +184,7 @@ export default {
payCount: "",
payCountTotal: 0,
branchList: [],
storeId: null,
shopId: null,
};
},
filters: {
@ -216,6 +217,7 @@ export default {
page: 1,
size: 200,
orderBy: "name asc",
shopId: this.shopId
});
this.categorys = res;
} catch (error) {
@ -230,7 +232,7 @@ export default {
endDate: this.query.createdAt[1],
prodCategoryId: this.query.prodCategoryId,
productName: this.query.productName,
shopId: this.shopId,
type: this.orderType,
});
this.payCount = res;
@ -247,6 +249,7 @@ export default {
endDate: this.query.createdAt[1],
prodCategoryId: this.query.prodCategoryId,
productName: this.query.productName,
shopId: this.shopId
});
downloadFile(file, "数据", "xlsx");
this.downloadLoading = false;
@ -284,6 +287,7 @@ export default {
endDate: this.query.createdAt[1],
productName: this.query.productName,
prodCategoryId: this.query.prodCategoryId,
shopId: this.shopId
});
this.tableData.loading = false;
this.tableData.data = res.records;

View File

@ -6,15 +6,16 @@
<el-input v-model="state.form.shopName" placeholder="请输入门店名称"></el-input>
</el-form-item>
<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="chain">连锁店</el-radio-button>
<el-radio-button value="join">加盟店</el-radio-button>
</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 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="0"></el-radio>
</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.shopType != 'only'"> -->
<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"
:key="item.id"></el-option>
</el-select>
@ -41,14 +42,16 @@
<el-radio-button value="before">先付费</el-radio-button>
<el-radio-button value="after">后付费</el-radio-button>
</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 label="管理方式" v-if="state.form.shopType != 'only'">
<el-radio-group v-model="state.form.tubeType">
<el-radio-button :value="0">不可直接管理</el-radio-button>
<el-radio-button :value="1">直接管理</el-radio-button>
</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 label="试用/正式">
<el-radio-group v-model="state.form.profiles">
@ -297,6 +300,7 @@ const state = reactive({
},
shopListLoading: false,
shopList: [],
isEdit: false,
});
onBeforeMount(async () => {
const res = await initMapLoad();
@ -387,7 +391,9 @@ function show(obj,type) {
}
console.log(state.form);
console.log(state.type);
if( state.form.shopType != 'only'){
state.isEdit = true
}
for (let key in state.rules) {
if (key === "accountName") {
if (obj.id) {
@ -403,11 +409,12 @@ function close() {
state.dialogVisible = false;
state.form = { ...state.resetForm };
state.type = "";
state.isEdit = false
}
function reset() {
state.form = { ...state.resetForm };
state.type = "";
state.isEdit = false
}
let ElMap = undefined;
@ -544,4 +551,7 @@ defineExpose({
.amap-sug-result {
z-index: 2000;
}
.tips{
margin-left: 10px;
}
</style>

View File

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