|
@@ -109,20 +109,20 @@
|
|
|
<div class="sales-condition">
|
|
|
<el-date-picker
|
|
|
v-model="getSalesDates"
|
|
|
- type="datetimerange"
|
|
|
- :picker-options="pickerOptions"
|
|
|
+ type="daterange"
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
align="right"
|
|
|
size="small"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
</div>
|
|
|
<div class="sales-content">
|
|
|
<div class="sales-left">
|
|
|
<div class="up">
|
|
|
- <label>本周销售额</label>
|
|
|
+ <label>本月销售额</label>
|
|
|
<span>{{ weekSales }}元</span>
|
|
|
<div class="sales-change">
|
|
|
<div>
|
|
@@ -135,13 +135,13 @@
|
|
|
<span :class="weekSalesChange > 0 ? 'color-up' : 'color-down'"
|
|
|
>{{ weekSalesChange }}%</span
|
|
|
>
|
|
|
- 同比上周
|
|
|
+ 环比上月
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="down">
|
|
|
- <label>本周销售量</label>
|
|
|
- <span>{{ weekSalesVolume }}元</span>
|
|
|
+ <label>本月销售量</label>
|
|
|
+ <span>{{ weekSalesVolume }}头</span>
|
|
|
<div class="sales-change">
|
|
|
<div>
|
|
|
<div
|
|
@@ -159,7 +159,7 @@
|
|
|
>
|
|
|
{{ weekSalesVolumeChange }}%
|
|
|
</span>
|
|
|
- 同比上周
|
|
|
+ 同比上月
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -242,8 +242,8 @@ import {
|
|
|
import {
|
|
|
getInventoryLines,
|
|
|
getInventoryAndProduct,
|
|
|
- getSalesChange,
|
|
|
- getSalesChart,
|
|
|
+ // getSalesChange,
|
|
|
+ // getSalesChart,
|
|
|
// getCosts,
|
|
|
// getYingShou,
|
|
|
getYingFu,
|
|
@@ -255,6 +255,7 @@ import {
|
|
|
getProductionCondition,
|
|
|
getImportantData,
|
|
|
getCostData,
|
|
|
+ getTheSales,
|
|
|
} from "utils/chenApi";
|
|
|
|
|
|
export default {
|
|
@@ -426,8 +427,8 @@ export default {
|
|
|
/** 获取网络请求数据 */
|
|
|
this.initInventoryLines();
|
|
|
this.initInventoryAndProduct();
|
|
|
- this.initSalesChange();
|
|
|
- this.initSalesChart();
|
|
|
+ // this.initSalesChange();
|
|
|
+ // this.initSalesChart();
|
|
|
// this.initYingShou();
|
|
|
this.initYingFu();
|
|
|
this.initWorkBoard(); // 工作看板
|
|
@@ -435,6 +436,7 @@ export default {
|
|
|
this.initProductionCondition(); // 生产情况
|
|
|
this.initImportantData(); // 重要指标
|
|
|
this.initCostData(); // 成本分析
|
|
|
+ this.initTheSales(); // 销售情况
|
|
|
},
|
|
|
methods: {
|
|
|
handleWorkInfoClick(item) {
|
|
@@ -536,40 +538,40 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- // 经营分析 - 销售改变
|
|
|
- initSalesChange() {
|
|
|
- getSalesChange({}).then((res) => {
|
|
|
- if (res.code === 10000) {
|
|
|
- this.weekSales = res.data.quantityAll;
|
|
|
- this.weekSalesChange = res.data.quantityType
|
|
|
- ? res.data.quantityPercentage
|
|
|
- : -res.data.quantityPercentage;
|
|
|
- this.weekSalesVolume = res.data.saleAll;
|
|
|
- this.weekSalesVolumeChange = res.data.saleType
|
|
|
- ? res.data.salePercentage
|
|
|
- : -res.data.salePercentage;
|
|
|
- } else {
|
|
|
- this.weekSales = 0;
|
|
|
- this.weekSalesChange = 0;
|
|
|
- this.weekSalesVolume = 0;
|
|
|
- this.weekSalesVolumeChange = 0;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 经营分析 - 销售情况图
|
|
|
- initSalesChart() {
|
|
|
- const params = {
|
|
|
- beginDate: this.getSalesDates[0] || "",
|
|
|
- endDate: this.getSalesDates[1] || "",
|
|
|
- };
|
|
|
- console.log("我要放参数了", params);
|
|
|
- getSalesChart(params).then((res) => {
|
|
|
- if (res.code === 10000) {
|
|
|
- this.salesChartData = res.data;
|
|
|
- console.log(this.salesChartData);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
+ // // 经营分析 - 销售改变
|
|
|
+ // initSalesChange() {
|
|
|
+ // getSalesChange({}).then((res) => {
|
|
|
+ // if (res.code === 10000) {
|
|
|
+ // this.weekSales = res.data.quantityAll;
|
|
|
+ // this.weekSalesChange = res.data.quantityType
|
|
|
+ // ? res.data.quantityPercentage
|
|
|
+ // : -res.data.quantityPercentage;
|
|
|
+ // this.weekSalesVolume = res.data.saleAll;
|
|
|
+ // this.weekSalesVolumeChange = res.data.saleType
|
|
|
+ // ? res.data.salePercentage
|
|
|
+ // : -res.data.salePercentage;
|
|
|
+ // } else {
|
|
|
+ // this.weekSales = 0;
|
|
|
+ // this.weekSalesChange = 0;
|
|
|
+ // this.weekSalesVolume = 0;
|
|
|
+ // this.weekSalesVolumeChange = 0;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // // 经营分析 - 销售情况图
|
|
|
+ // initSalesChart() {
|
|
|
+ // const params = {
|
|
|
+ // beginDate: this.getSalesDates[0] || "",
|
|
|
+ // endDate: this.getSalesDates[1] || "",
|
|
|
+ // };
|
|
|
+ // console.log("我要放参数了", params);
|
|
|
+ // getSalesChart(params).then((res) => {
|
|
|
+ // if (res.code === 10000) {
|
|
|
+ // this.salesChartData = res.data;
|
|
|
+ // console.log(this.salesChartData);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
// 经营分析 - 成本分析
|
|
|
initCostData() {
|
|
|
getCostData({}).then((res) => {
|
|
@@ -676,11 +678,31 @@ export default {
|
|
|
this.costIndex = value;
|
|
|
this.costPieData = this.costHisData[value];
|
|
|
},
|
|
|
+ // 销售情况
|
|
|
+ initTheSales() {
|
|
|
+ getTheSales({
|
|
|
+ type: this.getSalesDates[0] ? 3 : 2,
|
|
|
+ startDate: this.getSalesDates[0] || undefined,
|
|
|
+ endDate: this.getSalesDates[1] || undefined,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code === 10000) {
|
|
|
+ this.weekSales = res.data.money;
|
|
|
+ this.weekSalesChange = res.data.moneyPercent;
|
|
|
+ this.weekSalesVolume = res.data.quantity;
|
|
|
+ this.weekSalesVolumeChange = res.data.quantityPercent;
|
|
|
+ this.salesChartData = {
|
|
|
+ moneyList: res.data.moneyList,
|
|
|
+ quantityList: res.data.quantityList,
|
|
|
+ timeList: res.data.timeList,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
getSalesDates(newValue) {
|
|
|
this.getSalesDates = newValue;
|
|
|
- this.initSalesChart();
|
|
|
+ this.initTheSales();
|
|
|
},
|
|
|
},
|
|
|
};
|