|
@@ -308,8 +308,26 @@ export default {
|
|
|
height: 300,
|
|
|
tableData: [],
|
|
|
// 存栏情况
|
|
|
- inventoryLinesData: {}, // 折线图数据
|
|
|
- inventoryPieData: [], // 环形图数据
|
|
|
+ inventoryLinesData: {
|
|
|
+ month: [],
|
|
|
+ }, // 折线图数据
|
|
|
+ inventoryPieData: [
|
|
|
+ {
|
|
|
+ stockQuantity: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ stockQuantity: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ stockQuantity: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ stockQuantity: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ stockQuantity: 0,
|
|
|
+ },
|
|
|
+ ], // 环形图数据
|
|
|
inventoryItemsData: [], // 下面块图的数据
|
|
|
// 生产情况
|
|
|
productionPercents: [], // 百分比
|
|
@@ -384,7 +402,9 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
- salesChartData: {}, // 销售图的数据
|
|
|
+ salesChartData: {
|
|
|
+ timeList: [],
|
|
|
+ }, // 销售图的数据
|
|
|
// 应收排名
|
|
|
yingshouTableItems: [],
|
|
|
yingshouTableShows: {},
|
|
@@ -423,8 +443,8 @@ export default {
|
|
|
this.initTheSales(); // 销售情况
|
|
|
},
|
|
|
methods: {
|
|
|
- handleWorkInfoClick(item) {
|
|
|
- console.log(item);
|
|
|
+ handleWorkInfoClick() {
|
|
|
+ // console.log(item);
|
|
|
},
|
|
|
// 修改size
|
|
|
sizeChange(val) {
|
|
@@ -439,12 +459,11 @@ export default {
|
|
|
// 销售额选中日期
|
|
|
salesSetDay(data) {
|
|
|
this.salesDay = data;
|
|
|
- // console.log(this.salesDay);
|
|
|
- },
|
|
|
- // 销售额选中日周月
|
|
|
- salesOnClickType(data) {
|
|
|
- // console.log(data);
|
|
|
},
|
|
|
+ // // 销售额选中日周月
|
|
|
+ // salesOnClickType(data) {
|
|
|
+ // // console.log(data);
|
|
|
+ // },
|
|
|
// 工作看板
|
|
|
initWorkBoard() {
|
|
|
getWorkTotal({}).then(async (res) => {
|
|
@@ -529,14 +548,29 @@ export default {
|
|
|
// this.productionPercents = [res.data[12].rate*100, res.data[13].rate*100, res.data[14].rate*100, res.data[15].rate*100, res.data[16].rate*100]
|
|
|
// this.productionItems = [res.data[17].stockQuantity, res.data[18].stockQuantity, res.data[19].stockQuantity, res.data[20].stockQuantity, res.data[21].stockQuantity, res.data[22].stockQuantity, res.data[23].stockQuantity, res.data[24].stockQuantity]
|
|
|
} else {
|
|
|
- // this.inventoryLinesData = {
|
|
|
- // boarStock: [],
|
|
|
- // fatpigStock: [],
|
|
|
- // griceStock: [],
|
|
|
- // month: [],
|
|
|
- // pigletStock: [],
|
|
|
- // sowStock: []
|
|
|
- // }
|
|
|
+ const undefinedData = {
|
|
|
+ stockQuantity: 0,
|
|
|
+ };
|
|
|
+ // this.inventoryPieData = res.data.slice(0, 6)
|
|
|
+ this.inventoryPieData = [
|
|
|
+ res.data["sow_stock"] || undefinedData,
|
|
|
+ res.data["boar_stock"] || undefinedData,
|
|
|
+ res.data["grice_stock"] || undefinedData,
|
|
|
+ res.data["piglet_stock"] || undefinedData,
|
|
|
+ res.data["fatpig_stock"] || undefinedData,
|
|
|
+ ];
|
|
|
+ // console.log("object", this.inventoryPieData);
|
|
|
+ this.inventoryItemsData = [
|
|
|
+ res.data["sow_stock"] ? res.data["sow_stock"].stockQuantity : 0,
|
|
|
+ res.data["sow_stock_1"] ? res.data["sow_stock_1"].stockQuantity : 0,
|
|
|
+ res.data["sow_stock_2"] ? res.data["sow_stock_2"].stockQuantity : 0,
|
|
|
+ res.data["sow_stock_3"] ? res.data["sow_stock_3"].stockQuantity : 0,
|
|
|
+ res.data["boar_stock"] ? res.data["boar_stock"].stockQuantity : 0,
|
|
|
+ res.data["business_stock"]
|
|
|
+ ? res.data["business_stock"].stockQuantity
|
|
|
+ : 0,
|
|
|
+ ];
|
|
|
+ this.$message.warning(res.message);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -632,7 +666,6 @@ export default {
|
|
|
{ ...res.data["break_rate"], color: "rgb(2, 167, 240)" },
|
|
|
{ ...res.data["breed_rate"], color: "rgb(112, 0, 217)" },
|
|
|
];
|
|
|
- console.log(this.productionPercents);
|
|
|
this.productionItems = [
|
|
|
res.data["avg_farrow_1"].stockQuantity,
|
|
|
res.data["avg_farrow_2"].stockQuantity,
|