Merge branch 'multi-store' of https://e.coding.net/g-cphe0354/cashier/cashier-web into wwz
This commit is contained in:
commit
2922de551a
|
|
@ -8,13 +8,7 @@
|
||||||
chaozg
|
chaozg
|
||||||
chaozg123
|
chaozg123
|
||||||
|
|
||||||
## 测试宝塔
|
## 本地测试服务器(192.168.1.31)linux部署
|
||||||
|
|
||||||
<http://101.37.12.135:19928/mianban>
|
|
||||||
chaozg
|
|
||||||
chaozg123
|
|
||||||
|
|
||||||
## 本地服务器(192.168.1.31)linux部署
|
|
||||||
|
|
||||||
映射地址
|
映射地址
|
||||||
<https://fv901fw8033.vicp.fun/>
|
<https://fv901fw8033.vicp.fun/>
|
||||||
|
|
|
||||||
|
|
@ -648,7 +648,7 @@ export const useCartsStore = defineStore("carts", () => {
|
||||||
return ElMessage.warning(msg.message || '该商品已存在')
|
return ElMessage.warning(msg.message || '该商品已存在')
|
||||||
}
|
}
|
||||||
const skuData = getProductDetails({ product_id: msg.data.product_id, sku_id: msg.data.sku_id })
|
const skuData = getProductDetails({ product_id: msg.data.product_id, sku_id: msg.data.sku_id })
|
||||||
if (skuData) {
|
if (skuData || msg.data.is_temporary) {
|
||||||
const newGoods = { ...skuData, ...msg.data }
|
const newGoods = { ...skuData, ...msg.data }
|
||||||
console.log('newGoods', newGoods)
|
console.log('newGoods', newGoods)
|
||||||
list.value.push(newGoods)
|
list.value.push(newGoods)
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ export const useUserStore = defineStore("user", () => {
|
||||||
console.log(userInfo)
|
console.log(userInfo)
|
||||||
console.log(data)
|
console.log(data)
|
||||||
localStorage.setItem("shopId", "" + data.id);
|
localStorage.setItem("shopId", "" + data.id);
|
||||||
Object.assign(userInfo.value, { ...data, roles: [], promissionList: [], shopId: userInfo.value.shopId });
|
Object.assign(userInfo.value, { ...data, roles: [], promissionList: [], shopId: data.id });
|
||||||
resolve(userInfo.value);
|
resolve(userInfo.value);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|
|
||||||
|
|
@ -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-if="isHeadShop == 1" 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">
|
||||||
|
|
@ -67,7 +67,7 @@
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<div class="u-flex">
|
<div class="u-flex">
|
||||||
<el-date-picker v-if="timeValue == 'custom'" v-model="query.createdAt" type="daterange"
|
<el-date-picker v-if="timeValue == 'custom'" v-model="query.createdAt" type="daterange"
|
||||||
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD "
|
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
@change="summarytrade" />
|
@change="summarytrade" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -391,7 +391,7 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
branchList: [],
|
branchList: [],
|
||||||
storeId: null,
|
shopId: null,
|
||||||
trade: {},
|
trade: {},
|
||||||
formatDecimal,
|
formatDecimal,
|
||||||
topData: "",
|
topData: "",
|
||||||
|
|
@ -428,6 +428,8 @@ export default {
|
||||||
},
|
},
|
||||||
tradeVip: "",
|
tradeVip: "",
|
||||||
tradeCount: "",
|
tradeCount: "",
|
||||||
|
isHeadShop: JSON.parse(localStorage.getItem("userInfo")).isHeadShop
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -486,10 +488,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"];
|
||||||
|
|
@ -539,7 +549,9 @@ export default {
|
||||||
break;
|
break;
|
||||||
case "custom":
|
case "custom":
|
||||||
// 自定义
|
// 自定义
|
||||||
this.query.createdAt = [];
|
this.query.createdAt = [
|
||||||
|
dayjs().add(-30, "d").format(format[0]),
|
||||||
|
dayjs().format(format[1]),];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -552,9 +564,13 @@ export default {
|
||||||
async summarytrade() {
|
async summarytrade() {
|
||||||
try {
|
try {
|
||||||
this.tradeLoading = true;
|
this.tradeLoading = true;
|
||||||
|
if( this.query.createdAt[1] ){
|
||||||
|
this.query.createdAt.splice(1,1,this.query.createdAt[1].replace("00:00:00","23:59:59"))
|
||||||
|
}
|
||||||
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 +894,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 +923,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 +939,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,
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
<el-input placeholder="商品名称" v-model="query.productName" />
|
<el-input placeholder="商品名称" v-model="query.productName" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item v-if="isHeadShop == 1">
|
||||||
<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="getCategory">
|
||||||
<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>
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
<el-radio-button value="custom">自定义</el-radio-button>
|
<el-radio-button value="custom">自定义</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<el-date-picker class="u-m-l-10" v-model="query.createdAt" type="daterange" range-separator="至"
|
<el-date-picker class="u-m-l-10" v-model="query.createdAt" type="daterange" range-separator="至"
|
||||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD"
|
start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
v-if="timeValue == 'custom'"></el-date-picker>
|
v-if="timeValue == 'custom'"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<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,9 @@ export default {
|
||||||
payCount: "",
|
payCount: "",
|
||||||
payCountTotal: 0,
|
payCountTotal: 0,
|
||||||
branchList: [],
|
branchList: [],
|
||||||
storeId: null,
|
shopId: null,
|
||||||
|
isHeadShop: JSON.parse(localStorage.getItem("userInfo")).isHeadShop
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
|
|
@ -212,10 +215,12 @@ export default {
|
||||||
// 获取商品分类
|
// 获取商品分类
|
||||||
async getCategory() {
|
async getCategory() {
|
||||||
try {
|
try {
|
||||||
|
this.query.prodCategoryId = ""
|
||||||
const res = await categoryApi.getList({
|
const res = await categoryApi.getList({
|
||||||
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) {
|
||||||
|
|
@ -225,12 +230,15 @@ export default {
|
||||||
// 获取订单汇总
|
// 获取订单汇总
|
||||||
async daycount() {
|
async daycount() {
|
||||||
try {
|
try {
|
||||||
|
if (this.query.createdAt[1]) {
|
||||||
|
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
|
||||||
|
}
|
||||||
const res = await saleSummaryApi.count({
|
const res = await saleSummaryApi.count({
|
||||||
beginDate: this.query.createdAt[0],
|
beginDate: this.query.createdAt[0],
|
||||||
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;
|
||||||
|
|
@ -242,11 +250,15 @@ export default {
|
||||||
async downloadHandle() {
|
async downloadHandle() {
|
||||||
try {
|
try {
|
||||||
this.downloadLoading = true;
|
this.downloadLoading = true;
|
||||||
|
if (this.query.createdAt[1]) {
|
||||||
|
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
|
||||||
|
}
|
||||||
const file = await saleSummaryApi.export({
|
const file = await saleSummaryApi.export({
|
||||||
beginDate: this.query.createdAt[0],
|
beginDate: this.query.createdAt[0],
|
||||||
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;
|
||||||
|
|
@ -276,6 +288,9 @@ export default {
|
||||||
this.tableData.loading = true;
|
this.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
this.daycount();
|
this.daycount();
|
||||||
|
if (this.query.createdAt[1]) {
|
||||||
|
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
|
||||||
|
}
|
||||||
const res = await saleSummaryApi.page({
|
const res = await saleSummaryApi.page({
|
||||||
page: this.tableData.page,
|
page: this.tableData.page,
|
||||||
size: this.tableData.size,
|
size: this.tableData.size,
|
||||||
|
|
@ -284,6 +299,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;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
</el-tabs> -->
|
</el-tabs> -->
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-form :model="query" inline label-position="left">
|
<el-form :model="query" inline label-position="left">
|
||||||
<div class="u-flex gap-10">
|
<div class="u-flex gap-10" style="flex-wrap: wrap;">
|
||||||
<el-radio-group v-model="timeValue" @change="timeChange">
|
<el-radio-group v-model="timeValue" @change="timeChange">
|
||||||
<el-radio-button value="">全部</el-radio-button>
|
<el-radio-button value="">全部</el-radio-button>
|
||||||
<el-radio-button value="0">今天</el-radio-button>
|
<el-radio-button value="0">今天</el-radio-button>
|
||||||
|
|
@ -18,14 +18,14 @@
|
||||||
<el-radio-button value="custom">自定义</el-radio-button>
|
<el-radio-button value="custom">自定义</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<div>
|
<div>
|
||||||
<el-date-picker
|
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||||
v-model="query.createdAt"
|
end-placeholder="结束日期" value-format="YYYY-MM-DD HH:mm:ss"></el-date-picker>
|
||||||
type="daterange"
|
</div>
|
||||||
range-separator="至"
|
<div>
|
||||||
start-placeholder="开始日期"
|
<el-select v-model="shopId" v-if="isHeadShop == 1" placeholder="选择分店"
|
||||||
end-placeholder="结束日期"
|
style="width: 200px; margin-right: 10px">
|
||||||
value-format="YYYY-MM-DD"
|
<el-option v-for="item in branchList" :key="item.shopId" :label="item.shopName" :value="item.shopId" />
|
||||||
></el-date-picker>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||||
|
|
@ -100,6 +100,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tableSummaryApi from "@/api/order/table-summary";
|
import tableSummaryApi from "@/api/order/table-summary";
|
||||||
|
import ShopApi from "@/api/account/shop";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { downloadFile } from "@/utils/index";
|
import { downloadFile } from "@/utils/index";
|
||||||
|
|
||||||
|
|
@ -125,6 +126,9 @@ export default {
|
||||||
downloadLoading: false,
|
downloadLoading: false,
|
||||||
payCountList: "",
|
payCountList: "",
|
||||||
payCountTotal: 0,
|
payCountTotal: 0,
|
||||||
|
shopId: null,
|
||||||
|
branchList: [],
|
||||||
|
isHeadShop: JSON.parse(localStorage.getItem("userInfo")).isHeadShop
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
|
|
@ -135,8 +139,16 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
this.resetQuery = { ...this.query };
|
this.resetQuery = { ...this.query };
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
|
this.geiShopList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 获取分店列表
|
||||||
|
*/
|
||||||
|
async geiShopList() {
|
||||||
|
let res = await ShopApi.getBranchList()
|
||||||
|
this.branchList = res;
|
||||||
|
},
|
||||||
//携带table id跳转到订单列表页面
|
//携带table id跳转到订单列表页面
|
||||||
toTableOrderList(data) {
|
toTableOrderList(data) {
|
||||||
// console.log(data)
|
// console.log(data)
|
||||||
|
|
@ -152,9 +164,13 @@ export default {
|
||||||
async downloadHandle() {
|
async downloadHandle() {
|
||||||
try {
|
try {
|
||||||
this.downloadLoading = true;
|
this.downloadLoading = true;
|
||||||
|
if (this.query.createdAt[1]) {
|
||||||
|
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
|
||||||
|
}
|
||||||
const file = await tableSummaryApi.export({
|
const file = await tableSummaryApi.export({
|
||||||
beginDate: this.query.createdAt[0],
|
beginDate: this.query.createdAt[0],
|
||||||
endDate: this.query.createdAt[1],
|
endDate: this.query.createdAt[1],
|
||||||
|
shopId: this.shopId
|
||||||
});
|
});
|
||||||
downloadFile(file, "数据", "xlsx");
|
downloadFile(file, "数据", "xlsx");
|
||||||
this.downloadLoading = false;
|
this.downloadLoading = false;
|
||||||
|
|
@ -183,11 +199,15 @@ export default {
|
||||||
async getTableData() {
|
async getTableData() {
|
||||||
this.tableData.loading = true;
|
this.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
|
if (this.query.createdAt[1]) {
|
||||||
|
this.query.createdAt.splice(1, 1, this.query.createdAt[1].replace("00:00:00", "23:59:59"))
|
||||||
|
}
|
||||||
const res = await tableSummaryApi.list({
|
const res = await tableSummaryApi.list({
|
||||||
page: this.tableData.page,
|
page: this.tableData.page,
|
||||||
size: this.tableData.size,
|
size: this.tableData.size,
|
||||||
beginDate: this.query.createdAt[0],
|
beginDate: this.query.createdAt[0],
|
||||||
endDate: this.query.createdAt[1],
|
endDate: this.query.createdAt[1],
|
||||||
|
shopId: this.shopId
|
||||||
});
|
});
|
||||||
this.tableData.loading = false;
|
this.tableData.loading = false;
|
||||||
this.tableData.data = res;
|
this.tableData.data = res;
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -2,24 +2,12 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<page-search
|
<page-search ref="searchRef" :search-config="searchConfig" @query-click="handleQueryClick"
|
||||||
ref="searchRef"
|
@reset-click="handleResetClick" />
|
||||||
:search-config="searchConfig"
|
|
||||||
@query-click="handleQueryClick"
|
|
||||||
@reset-click="handleResetClick"
|
|
||||||
/>
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<page-content
|
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
||||||
ref="contentRef"
|
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
||||||
:content-config="contentConfig"
|
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
||||||
@add-click="handleAddClick"
|
|
||||||
@edit-click="handleEditClick"
|
|
||||||
@export-click="handleExportClick"
|
|
||||||
@search-click="handleSearchClick"
|
|
||||||
@toolbar-click="handleToolbarClick"
|
|
||||||
@operat-click="handleOperatClick"
|
|
||||||
@filter-change="handleFilterChange"
|
|
||||||
>
|
|
||||||
<template #status="scope">
|
<template #status="scope">
|
||||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||||
|
|
@ -33,11 +21,7 @@
|
||||||
</template>
|
</template>
|
||||||
<template #mobile="scope">
|
<template #mobile="scope">
|
||||||
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||||
<copy-button
|
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
|
||||||
v-if="scope.row[scope.prop]"
|
|
||||||
:text="scope.row[scope.prop]"
|
|
||||||
style="margin-left: 2px"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</page-content>
|
</page-content>
|
||||||
|
|
||||||
|
|
@ -47,12 +31,8 @@
|
||||||
<h3 style="color: rgb(63, 158, 255)">收银机权限设置</h3>
|
<h3 style="color: rgb(63, 158, 255)">收银机权限设置</h3>
|
||||||
<div>
|
<div>
|
||||||
<el-checkbox-group v-model="addPagePathIdList">
|
<el-checkbox-group v-model="addPagePathIdList">
|
||||||
<el-checkbox
|
<el-checkbox v-for="(item, index) in pagePathIdLists" :key="index" :value="item.value"
|
||||||
v-for="(item, index) in pagePathIdLists"
|
:label="item.label" />
|
||||||
:key="index"
|
|
||||||
:value="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
/>
|
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</div>
|
</div>
|
||||||
<h3 style="color: rgb(63, 158, 255)">员工权限设置</h3>
|
<h3 style="color: rgb(63, 158, 255)">员工权限设置</h3>
|
||||||
|
|
@ -62,21 +42,13 @@
|
||||||
</page-modal>
|
</page-modal>
|
||||||
|
|
||||||
<!-- 编辑 -->
|
<!-- 编辑 -->
|
||||||
<page-modal
|
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
|
||||||
ref="editModalRef"
|
|
||||||
:modal-config="editModalConfig"
|
|
||||||
@submit-click="handleSubmitClick"
|
|
||||||
>
|
|
||||||
<template #formFooter>
|
<template #formFooter>
|
||||||
<h3 style="color: rgb(63, 158, 255)">收银机权限设置</h3>
|
<h3 style="color: rgb(63, 158, 255)">收银机权限设置</h3>
|
||||||
<div>
|
<div>
|
||||||
<el-checkbox-group v-model="editPagePathIdList">
|
<el-checkbox-group v-model="editPagePathIdList">
|
||||||
<el-checkbox
|
<el-checkbox v-for="(item, index) in pagePathIdLists" :key="index" :value="item.value"
|
||||||
v-for="(item, index) in pagePathIdLists"
|
:label="item.label" />
|
||||||
:key="index"
|
|
||||||
:value="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
/>
|
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</div>
|
</div>
|
||||||
<h3 style="color: rgb(63, 158, 255)">员工权限设置</h3>
|
<h3 style="color: rgb(63, 158, 255)">员工权限设置</h3>
|
||||||
|
|
@ -143,6 +115,9 @@ const oldeditSubmitFunc = editModalConfig.formAction;
|
||||||
// 数据初始化
|
// 数据初始化
|
||||||
async function init() {
|
async function init() {
|
||||||
// 覆写添加确定方法
|
// 覆写添加确定方法
|
||||||
|
if (JSON.parse(localStorage.getItem('userInfo') || '{}').isHeadShop == 0) {
|
||||||
|
searchConfig.formItems.splice(0, 1)
|
||||||
|
}
|
||||||
addModalConfig.formAction = function (data) {
|
addModalConfig.formAction = function (data) {
|
||||||
return ShopStaffApi.add({
|
return ShopStaffApi.add({
|
||||||
...data,
|
...data,
|
||||||
|
|
|
||||||
|
|
@ -383,12 +383,18 @@ async function createOrder(key) {
|
||||||
// });
|
// });
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
const payArr = ["wx-aiplay", "cash", "to-pay"];
|
const payArr = ["wx-aiplay", "cash", "to-pay", "more-pay"];
|
||||||
if (payArr.includes(key) && carts.isEmpty && carts.oldOrder.id) {
|
if (payArr.includes(key) && carts.isEmpty && carts.oldOrder.id) {
|
||||||
showOrder.value = true;
|
showOrder.value = true;
|
||||||
nextTick(() => {
|
if (key != "more-pay") {
|
||||||
refOrder.value.nowPayClick(key || "");
|
nextTick(() => {
|
||||||
});
|
if (key == "wx-aiplay") {
|
||||||
|
refOrder.value.nowPayClick("scanCode");
|
||||||
|
} else {
|
||||||
|
refOrder.value.nowPayClick(key || "");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue