@@ -615,7 +628,9 @@ export default {
initInterestRateTime: '',
costLoading: true,
costRef: null,
- costUpdateTime: ''
+ costUpdateTime: '',
+ interestRateDay: '7',
+ costDay: '7'
};
},
computed: {
@@ -686,14 +701,21 @@ export default {
* 获取分店列表
*/
async geiShopList() {
- let res = await ShopApi.getBranchList()
- this.branchList = res;
- this.shopId = res[0].shopId
+ try {
+ let res = await ShopApi.getBranchList()
+ this.branchList = res;
+ this.shopId = res[0].shopId
+ } catch (error) {
+ console.log('获取分店列表===', error);
+ }
},
shopChange() {
this.summarytrade();
this.lineChartTypeChange(this.lineChartType)
this.dateProduct()
+
+ this.profitRateBarChart()
+ this.costLineChart()
},
// 切换时间
timeChange(e, index = 0) {
@@ -1071,7 +1093,6 @@ export default {
],
});
},
- // 初始化毛利率/净利率图表
initInterestRateChart(time, data) {
// 销毁旧实例,避免重复创建
if (this.initInterestRate) {
@@ -1100,7 +1121,6 @@ export default {
return `
${xName}
毛利率:${profitRate}%
-
净利率:${netProfitRate}%
`;
},
// 保留你原有的提示框样式
@@ -1146,17 +1166,96 @@ export default {
barGap: "0%", // 保持柱子紧贴
barWidth: time.length <= 7 ? "50%" : "30%",
data: profitRateData, // 预处理后的毛利率数据
- },
- {
- name: '净利率',
- type: "bar",
- barGap: "0%",
- barWidth: time.length <= 7 ? "50%" : "30%",
- data: netProfitRateData, // 预处理后的净利率数据
- },
+ }
],
});
},
+ // 初始化毛利率/净利率图表
+ // initInterestRateChart(time, data) {
+ // // 销毁旧实例,避免重复创建
+ // if (this.initInterestRate) {
+ // this.initInterestRate.dispose();
+ // }
+ // this.initInterestRate = echarts.init(this.$refs.initInterestRate);
+
+ // // 预处理数据:将毛利率和净利率按索引对应(关键,用于手动匹配)
+ // const profitRateData = data.map(item => item.profitRate || 0);
+ // const netProfitRateData = data.map(item => item.netProfitRate || 0);
+
+ // this.initInterestRate.setOption({
+ // tooltip: {
+ // trigger: "item", // 保留 item 模式(确保能触发,之前已验证有效)
+ // // 核心:手动查找当前 X 轴索引对应的另一个系列数据,拼接显示
+ // formatter: (params) => {
+ // const index = params.dataIndex; // 获取当前数据的索引(X轴位置)
+ // const xName = time[index]; // 当前 X 轴分类名称(如时间)
+ // const color1 = "#165DFF"; // 毛利率颜色(与 series 一致)
+ // const color2 = "#14C9C9"; // 净利率颜色(与 series 一致)
+ // // 当前系列数据 + 另一个系列数据(按索引匹配)
+ // const profitRate = profitRateData[index].toFixed(2);
+ // const netProfitRate = netProfitRateData[index].toFixed(2);
+
+ // // 拼接提示框内容(彩色方块 + 两个指标)
+ // return `
+ //
${xName}
+ //
毛利率:${profitRate}%
+ //
净利率:${netProfitRate}%
+ // `;
+ // },
+ // // 保留你原有的提示框样式
+ // padding: 10,
+ // textStyle: { fontSize: 11 },
+ // backgroundColor: "#fff",
+ // borderColor: "#eee",
+ // borderWidth: 1,
+ // boxShadow: "0 2px 8px rgba(0,0,0,0.08)"
+ // },
+ // xAxis: [
+ // {
+ // type: "category",
+ // data: time,
+ // axisTick: { alignWithLabel: true },
+ // axisLine: { lineStyle: { color: "#999" } },
+ // axisLabel: {
+ // rotate: time.length <= 7 ? 0 : 45,
+ // interval: 0,
+ // fontSize: "9",
+ // },
+ // },
+ // ],
+ // color: ["#165DFF", "#14C9C9", "#F98B26"], // 系列颜色不变
+ // yAxis: [
+ // {
+ // type: "value",
+ // axisLine: { lineStyle: { color: "#999" } },
+ // splitLine: { lineStyle: { type: "dashed", color: "#ececec" } },
+ // axisLabel: { formatter: "{value}%" }, // Y轴加百分号
+ // },
+ // ],
+ // grid: {
+ // top: '5%',
+ // right: '5%',
+ // bottom: '8%',
+ // left: '8%',
+ // },
+ // series: [
+ // {
+ // name: "毛利率",
+ // type: "bar",
+ // barGap: "0%", // 保持柱子紧贴
+ // barWidth: time.length <= 7 ? "50%" : "30%",
+ // data: profitRateData, // 预处理后的毛利率数据
+ // },
+ // {
+ // name: '净利率',
+ // type: "bar",
+ // barGap: "0%",
+ // barWidth: time.length <= 7 ? "50%" : "30%",
+ // data: netProfitRateData, // 预处理后的净利率数据
+ // },
+ // ],
+ // });
+ // },
// 初始化销售额图表
initPayChart(data) {
this.payChart = echarts.init(this.$refs.payChart);
@@ -1230,7 +1329,7 @@ export default {
async profitRateBarChart() {
try {
this.initInterestRateLoading = true;
- const res = await dataSummaryApi.profitRateBarChart({ day: this.saleActive, shopId: this.shopId });
+ const res = await dataSummaryApi.profitRateBarChart({ day: this.interestRateDay, shopId: this.shopId });
this.initInterestRateTime = dayjs().format('HH:mm')
@@ -1254,7 +1353,7 @@ export default {
async costLineChart() {
try {
this.costLoading = true;
- const res = await dataSummaryApi.costLineChart({ day: this.saleActive, shopId: this.shopId });
+ const res = await dataSummaryApi.costLineChart({ day: this.costDay, shopId: this.shopId });
this.costUpdateTime = dayjs().format('HH:mm')
@@ -1903,6 +2002,11 @@ export default {
align-items: center;
justify-content: space-between;
+ .column {
+ display: flex;
+ flex-direction: column;
+ }
+
.t1 {
font-size: 16px;
color: #111;
diff --git a/src/views/marketing_center/list.vue b/src/views/marketing_center/list.vue
index 3e002d9..b470ba3 100644
--- a/src/views/marketing_center/list.vue
+++ b/src/views/marketing_center/list.vue
@@ -330,6 +330,7 @@ const handleImageError = (item) => {
.name {
font-size: 14px;
+ font-weight: bold;
}
.intro {
diff --git a/src/views/online-shop/index.vue b/src/views/online-shop/index.vue
index 9df282a..dc5684f 100644
--- a/src/views/online-shop/index.vue
+++ b/src/views/online-shop/index.vue
@@ -236,7 +236,8 @@ export default {
tableData: [],
selectItem: {},
imageUrl: "",
- imgList: []
+ imgList: [],
+ shopName: ''
};
},
mounted() {
@@ -261,6 +262,9 @@ export default {
},
// 多图上传成功
async MultiOnSuccess(response) {
+ console.log(response);
+ console.log(this.imgList);
+
if (!response && this.imgList.length > 0) {
console.log(this.imgList);
await nextTick()
@@ -301,6 +305,8 @@ export default {
this.selectItem = { autoKey, id, name, value };
if (this.isJsonArrayString(value)) {
this.imgList = JSON.parse(value)
+ } else {
+ this.imgList = []
}
console.log(this.selectItem);
},
diff --git a/src/views/user/active/components/addActive.vue b/src/views/user/active/components/addActive.vue
index 7500351..82b966f 100644
--- a/src/views/user/active/components/addActive.vue
+++ b/src/views/user/active/components/addActive.vue
@@ -29,10 +29,10 @@
-
+
- 添加优惠劵
+ 添加优惠券
@@ -145,7 +145,7 @@ export default {
if (this.form.isGiftCoupon == 1) {
if (this.productIds.length == 0) {
this.$message({
- message: "请选择优惠劵",
+ message: "请选择优惠券",
type: "warning",
});
return false;
@@ -190,7 +190,7 @@ export default {
this.dialogVisible = true;
if (obj && obj.id) {
this.form = { ...obj };
- // 留着以后说不定多个优惠劵
+ // 留着以后说不定多个优惠券
// let res = await activate(obj.id)
// this.productIds = res
if (obj.couponId) {