|
@@ -3,13 +3,18 @@
|
|
|
<!-- 工作看板 -->
|
|
|
<board :title="title[0]">
|
|
|
<div>
|
|
|
- <work-infos :dataList="workInfos" @workInfoClick="handleWorkInfoClick"></work-infos>
|
|
|
+ <work-infos :dataList="workInfos" @workInfoClick="handleWorkInfoClick">
|
|
|
+ </work-infos>
|
|
|
<div class="table-content">
|
|
|
- <table-content
|
|
|
- :tableItems="tableItems"
|
|
|
- :height="height"
|
|
|
+ <table-content
|
|
|
+ :tableItems="tableItems"
|
|
|
+ :height="height"
|
|
|
:shows="tableShows"
|
|
|
- :listData="tableData">
|
|
|
+ :listData="tableData"
|
|
|
+ >
|
|
|
+ <template v-slot:handleState="slotProps">
|
|
|
+ {{ slotProps.row.handleState ? "已处理" : "未处理" }}
|
|
|
+ </template>
|
|
|
</table-content>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -22,7 +27,9 @@
|
|
|
<!-- 存栏结构 -->
|
|
|
<chart-inventory-pie :data="inventoryPieData"></chart-inventory-pie>
|
|
|
<!-- 存栏变动 -->
|
|
|
- <chart-inventory-lines :data="inventoryLinesData"></chart-inventory-lines>
|
|
|
+ <chart-inventory-lines
|
|
|
+ :data="inventoryLinesData"
|
|
|
+ ></chart-inventory-lines>
|
|
|
</div>
|
|
|
<div>
|
|
|
<!-- 存栏计数 -->
|
|
@@ -49,7 +56,8 @@
|
|
|
v-for="item in costOptions"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
- :value="item.value">
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
@@ -67,15 +75,18 @@
|
|
|
<!-- 重要指标 -->
|
|
|
<div class="important">
|
|
|
<div class="condition">
|
|
|
- <el-select
|
|
|
- size="small"
|
|
|
+ <el-select
|
|
|
+ size="small"
|
|
|
v-model="importantValue"
|
|
|
- style="margin-right: 20px">
|
|
|
+ style="margin-right: 20px"
|
|
|
+ @change="changeImportantValue"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in importantOptions"
|
|
|
- :key="item.value"
|
|
|
+ :key="item.type"
|
|
|
:label="item.label"
|
|
|
- :value="item.value">
|
|
|
+ :value="item.type"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
<el-date-picker
|
|
@@ -84,7 +95,10 @@
|
|
|
type="daterange"
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期">
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ @change="changeImportantDates"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</div>
|
|
|
<div class="important-chart">
|
|
@@ -95,7 +109,6 @@
|
|
|
<!-- 销售情况 -->
|
|
|
<div class="sales">
|
|
|
<div class="sales-condition">
|
|
|
- <!-- <x-form :formItems="salesFormItems" :day="salesDay" @setDay="salesSetDay" @onClickType="salesOnClickType"></x-form> -->
|
|
|
<el-date-picker
|
|
|
v-model="getSalesDates"
|
|
|
type="datetimerange"
|
|
@@ -104,7 +117,8 @@
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
align="right"
|
|
|
- size="small">
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</div>
|
|
|
<div class="sales-content">
|
|
@@ -114,10 +128,17 @@
|
|
|
<span>{{ weekSales }}元</span>
|
|
|
<div class="sales-change">
|
|
|
<div>
|
|
|
- <div class="triangle-change" :class="weekSalesChange>0? 'triangle-up': 'triangle-down'"></div>
|
|
|
- <span :class="weekSalesChange>0? 'color-up': 'color-down'">{{ weekSalesChange }}%</span>
|
|
|
+ <div
|
|
|
+ class="triangle-change"
|
|
|
+ :class="
|
|
|
+ weekSalesChange > 0 ? 'triangle-up' : 'triangle-down'
|
|
|
+ "
|
|
|
+ ></div>
|
|
|
+ <span :class="weekSalesChange > 0 ? 'color-up' : 'color-down'"
|
|
|
+ >{{ weekSalesChange }}%</span
|
|
|
+ >
|
|
|
同比上周
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="down">
|
|
@@ -125,8 +146,21 @@
|
|
|
<span>{{ weekSalesVolume }}元</span>
|
|
|
<div class="sales-change">
|
|
|
<div>
|
|
|
- <div class="triangle-change" :class="weekSalesVolumeChange>0? 'triangle-up': 'triangle-down'"></div>
|
|
|
- <span :class="weekSalesVolumeChange>0? 'color-up': 'color-down'">{{ weekSalesVolumeChange }}%</span>
|
|
|
+ <div
|
|
|
+ class="triangle-change"
|
|
|
+ :class="
|
|
|
+ weekSalesVolumeChange > 0
|
|
|
+ ? 'triangle-up'
|
|
|
+ : 'triangle-down'
|
|
|
+ "
|
|
|
+ ></div>
|
|
|
+ <span
|
|
|
+ :class="
|
|
|
+ weekSalesVolumeChange > 0 ? 'color-up' : 'color-down'
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ weekSalesVolumeChange }}%
|
|
|
+ </span>
|
|
|
同比上周
|
|
|
</div>
|
|
|
</div>
|
|
@@ -140,65 +174,89 @@
|
|
|
</board>
|
|
|
|
|
|
<!-- 应收排名 -->
|
|
|
- <board :title="title[4]">
|
|
|
- <table-content
|
|
|
- :tableItems="yingshouTableItems"
|
|
|
- :height="height"
|
|
|
+ <!-- <board :title="title[4]">
|
|
|
+ <table-content
|
|
|
+ :tableItems="yingshouTableItems"
|
|
|
+ :height="height"
|
|
|
:shows="yingshouTableShows"
|
|
|
- :listData="yingshouTableData">
|
|
|
+ :listData="yingshouTableData"
|
|
|
+ >
|
|
|
</table-content>
|
|
|
- </board>
|
|
|
+ </board> -->
|
|
|
|
|
|
<!-- 应付排名 -->
|
|
|
<board :title="title[5]">
|
|
|
- <table-content
|
|
|
- :tableItems="yingshouTableItems"
|
|
|
- :height="height"
|
|
|
+ <table-content
|
|
|
+ :tableItems="yingshouTableItems"
|
|
|
+ :height="height"
|
|
|
:shows="yingshouTableShows"
|
|
|
- :listData="yingfuTableData">
|
|
|
+ :listData="yingfuTableData"
|
|
|
+ >
|
|
|
</table-content>
|
|
|
</board>
|
|
|
|
|
|
<!-- 安全库存报警 -->
|
|
|
<board :title="title[6]">
|
|
|
- <table-content
|
|
|
- :tableItems="safetyTableItems"
|
|
|
- :height="height"
|
|
|
+ <table-content
|
|
|
+ :tableItems="safetyTableItems"
|
|
|
+ :height="height"
|
|
|
:shows="safetyTableShows"
|
|
|
- :listData="safetyTableData">
|
|
|
+ :listData="safetyTableData"
|
|
|
+ >
|
|
|
</table-content>
|
|
|
<table-footer
|
|
|
:totals="total"
|
|
|
:size="size"
|
|
|
@sizeChange="sizeChange"
|
|
|
- @pageChange="pageChange">
|
|
|
+ @pageChange="pageChange"
|
|
|
+ >
|
|
|
</table-footer>
|
|
|
</board>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Board from 'components/board/index.vue'
|
|
|
-import WorkInfos from './analysis/WorkInfos.vue'
|
|
|
-import TableContent from 'components/newTable/TableContent.vue'
|
|
|
-import ChartInventoryPie from './analysis/ChartInventoryPie.vue'
|
|
|
-import ChartInventoryLines from './analysis/ChartInventoryLines.vue'
|
|
|
-import InventoryItems from './analysis/InventoryItems.vue'
|
|
|
-import ProductionDonuts from './analysis/ProductionDonuts.vue'
|
|
|
-import ProductionItems from './analysis/ProductionItems.vue'
|
|
|
-import CostPie from './analysis/CostPie.vue'
|
|
|
-import CostHistogram from './analysis/CostHistogram.vue'
|
|
|
-import ImportantLine from './analysis/ImportantLine.vue'
|
|
|
-// import XForm from "components/XForm";
|
|
|
-import SalesChart from './analysis/SalesChart.vue'
|
|
|
-import TableFooter from "../../components/TableFooter"
|
|
|
+import Board from "components/board/index.vue";
|
|
|
+import WorkInfos from "./analysis/WorkInfos.vue";
|
|
|
+import TableContent from "components/newTable/TableContent.vue";
|
|
|
+import ChartInventoryPie from "./analysis/ChartInventoryPie.vue";
|
|
|
+import ChartInventoryLines from "./analysis/ChartInventoryLines.vue";
|
|
|
+import InventoryItems from "./analysis/InventoryItems.vue";
|
|
|
+import ProductionDonuts from "./analysis/ProductionDonuts.vue";
|
|
|
+import ProductionItems from "./analysis/ProductionItems.vue";
|
|
|
+import CostPie from "./analysis/CostPie.vue";
|
|
|
+import CostHistogram from "./analysis/CostHistogram.vue";
|
|
|
+import ImportantLine from "./analysis/ImportantLine.vue";
|
|
|
+import SalesChart from "./analysis/SalesChart.vue";
|
|
|
+import TableFooter from "../../components/TableFooter";
|
|
|
|
|
|
-import { tableItems, tableShows } from './analysis/table.config'
|
|
|
-import { yingshouTableItems, yingshouTableShows } from './analysis/yingshouTable.config'
|
|
|
-import { safetyTableItems, safetyTableShows } from './analysis/safetyTable.config'
|
|
|
+import { tableItems, tableShows } from "./analysis/table.config";
|
|
|
+import {
|
|
|
+ yingshouTableItems,
|
|
|
+ yingshouTableShows,
|
|
|
+} from "./analysis/yingshouTable.config";
|
|
|
+import {
|
|
|
+ safetyTableItems,
|
|
|
+ safetyTableShows,
|
|
|
+} from "./analysis/safetyTable.config";
|
|
|
// import { formItems } from './analysis/salesXForm.config'
|
|
|
|
|
|
-import { getInventoryLines, getInventoryAndProduct, getSalesChange, getSalesChart, getCosts, getYingShou, getYingFu } from 'utils/api'
|
|
|
+import {
|
|
|
+ getInventoryLines,
|
|
|
+ getInventoryAndProduct,
|
|
|
+ getSalesChange,
|
|
|
+ getSalesChart,
|
|
|
+ getCosts,
|
|
|
+ // getYingShou,
|
|
|
+ getYingFu,
|
|
|
+} from "utils/api";
|
|
|
+import {
|
|
|
+ getWorkTotal,
|
|
|
+ getWorkInfos,
|
|
|
+ getSafeInventory,
|
|
|
+ getProductionCondition,
|
|
|
+ getImportantData,
|
|
|
+} from "utils/chenApi";
|
|
|
|
|
|
export default {
|
|
|
name: "Analysis",
|
|
@@ -216,46 +274,54 @@ export default {
|
|
|
ImportantLine,
|
|
|
// XForm,
|
|
|
SalesChart,
|
|
|
- TableFooter
|
|
|
+ TableFooter,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- title: ['工作看板', '存栏情况', '生产情况', '经营分析', '应收排名', '应付排名', '安全库存报警'],
|
|
|
+ title: [
|
|
|
+ "工作看板",
|
|
|
+ "存栏情况",
|
|
|
+ "生产情况",
|
|
|
+ "经营分析",
|
|
|
+ "应收排名",
|
|
|
+ "应付排名",
|
|
|
+ "安全库存报警",
|
|
|
+ ],
|
|
|
workInfos: [
|
|
|
{
|
|
|
- label: '预警信息',
|
|
|
- number: 10
|
|
|
+ label: "预警信息",
|
|
|
+ number: 10,
|
|
|
},
|
|
|
{
|
|
|
- label: '断奶数量',
|
|
|
- number: 1150
|
|
|
+ label: "断奶数量",
|
|
|
+ number: 1150,
|
|
|
},
|
|
|
{
|
|
|
- label: '配种数量',
|
|
|
- number: 1540
|
|
|
+ label: "配种数量",
|
|
|
+ number: 1540,
|
|
|
},
|
|
|
{
|
|
|
- label: '转舍计划',
|
|
|
- number: 108
|
|
|
+ label: "转舍计划",
|
|
|
+ number: 108,
|
|
|
},
|
|
|
{
|
|
|
- label: '分娩数量',
|
|
|
- number: 180
|
|
|
+ label: "分娩数量",
|
|
|
+ number: 180,
|
|
|
},
|
|
|
{
|
|
|
- label: '日常计划',
|
|
|
- number: 10
|
|
|
+ label: "日常计划",
|
|
|
+ number: 10,
|
|
|
},
|
|
|
{
|
|
|
- label: '天才计划',
|
|
|
- number: 10
|
|
|
+ label: "天才计划",
|
|
|
+ number: 10,
|
|
|
},
|
|
|
{
|
|
|
- label: '保健计划',
|
|
|
- number: 10
|
|
|
- }
|
|
|
+ label: "保健计划",
|
|
|
+ number: 10,
|
|
|
+ },
|
|
|
],
|
|
|
- tableItems: [],
|
|
|
+ tableItems: [],
|
|
|
tableShows: {},
|
|
|
height: 300,
|
|
|
tableData: [],
|
|
@@ -268,13 +334,31 @@ export default {
|
|
|
productionItems: [], // 下面块图的数据
|
|
|
// 经营分析
|
|
|
costOptions: [],
|
|
|
- costValue: '',
|
|
|
+ costValue: "",
|
|
|
costPieData: [], // 经营分析 - 成本分析环形图
|
|
|
costHisData: [], // 经营分析 - 柱状图
|
|
|
// 重要指标
|
|
|
- importantOptions: [],
|
|
|
- importantValue: '',
|
|
|
+ importantOptions: [
|
|
|
+ {
|
|
|
+ type: 1,
|
|
|
+ label: "配种指标",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 2,
|
|
|
+ label: "分娩指标",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 3,
|
|
|
+ label: "断奶指标",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 4,
|
|
|
+ label: "成活率指标",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ importantValue: "",
|
|
|
importantDates: [],
|
|
|
+ importantData: [], // 重要指标折线图数据
|
|
|
// 销售额
|
|
|
// salesFormItems: [],
|
|
|
salesDay: 2, //默认选择本周
|
|
@@ -283,32 +367,37 @@ export default {
|
|
|
weekSalesVolume: 1000,
|
|
|
weekSalesVolumeChange: -10,
|
|
|
getSalesDates: [], // 销售图的时间选择
|
|
|
- pickerOptions: { // 快捷选项
|
|
|
- shortcuts: [{
|
|
|
- text: '最近一周',
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
- }
|
|
|
- }, {
|
|
|
- text: '最近一个月',
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
- }
|
|
|
- }, {
|
|
|
- text: '最近三个月',
|
|
|
- onClick(picker) {
|
|
|
- const end = new Date();
|
|
|
- const start = new Date();
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
- }
|
|
|
- }]
|
|
|
+ pickerOptions: {
|
|
|
+ // 快捷选项
|
|
|
+ shortcuts: [
|
|
|
+ {
|
|
|
+ text: "最近一周",
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
+ picker.$emit("pick", [start, end]);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "最近一个月",
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
+ picker.$emit("pick", [start, end]);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: "最近三个月",
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
+ picker.$emit("pick", [start, end]);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
salesChartData: {}, // 销售图的数据
|
|
|
// 应收排名
|
|
@@ -324,28 +413,31 @@ export default {
|
|
|
total: 0,
|
|
|
size: 20,
|
|
|
pageNum: 1,
|
|
|
- }
|
|
|
+ };
|
|
|
},
|
|
|
mounted() {
|
|
|
// this.salesFormItems = formItems
|
|
|
- this.tableItems = tableItems
|
|
|
- this.tableShows = tableShows
|
|
|
- this.yingshouTableItems = yingshouTableItems
|
|
|
- this.yingshouTableShows = yingshouTableShows
|
|
|
- this.safetyTableItems = safetyTableItems
|
|
|
- this.safetyTableShows = safetyTableShows
|
|
|
+ this.tableItems = tableItems;
|
|
|
+ this.tableShows = tableShows;
|
|
|
+ this.yingshouTableItems = yingshouTableItems;
|
|
|
+ this.yingshouTableShows = yingshouTableShows;
|
|
|
+ this.safetyTableItems = safetyTableItems;
|
|
|
+ this.safetyTableShows = safetyTableShows;
|
|
|
/** 获取网络请求数据 */
|
|
|
- this.initInventoryLines()
|
|
|
- this.initInventoryAndProduct()
|
|
|
- this.initSalesChange()
|
|
|
- this.initSalesChart()
|
|
|
- this.initCosts()
|
|
|
- this.initYingShou()
|
|
|
- this.initYingFu()
|
|
|
+ this.initInventoryLines();
|
|
|
+ this.initInventoryAndProduct();
|
|
|
+ this.initSalesChange();
|
|
|
+ this.initSalesChart();
|
|
|
+ this.initCosts();
|
|
|
+ // this.initYingShou();
|
|
|
+ this.initYingFu();
|
|
|
+ this.initWorkBoard(); // 工作看板
|
|
|
+ this.initSafeInventory(); // 安全库存报警
|
|
|
+ this.initProductionCondition(); // 生产情况
|
|
|
},
|
|
|
methods: {
|
|
|
handleWorkInfoClick(item) {
|
|
|
- console.log(item)
|
|
|
+ console.log(item);
|
|
|
},
|
|
|
// 修改size
|
|
|
sizeChange(val) {
|
|
@@ -354,33 +446,40 @@ export default {
|
|
|
},
|
|
|
// 修改页数
|
|
|
pageChange(val) {
|
|
|
- this.pageNum= val;
|
|
|
+ this.pageNum = val;
|
|
|
this.init();
|
|
|
},
|
|
|
init() {
|
|
|
let params = {
|
|
|
pageNum: this.pageNum,
|
|
|
pageSize: this.size,
|
|
|
- searchStr: this.keyword
|
|
|
- }
|
|
|
- console.log(params)
|
|
|
+ searchStr: this.keyword,
|
|
|
+ };
|
|
|
+ console.log(params);
|
|
|
// 获取后端数据
|
|
|
},
|
|
|
// 销售额选中日期
|
|
|
salesSetDay(data) {
|
|
|
this.salesDay = data;
|
|
|
- console.log(this.salesDay)
|
|
|
+ console.log(this.salesDay);
|
|
|
},
|
|
|
// 销售额选中日周月
|
|
|
salesOnClickType(data) {
|
|
|
- console.log(data)
|
|
|
+ console.log(data);
|
|
|
+ },
|
|
|
+ // 工作看板
|
|
|
+ initWorkBoard() {
|
|
|
+ getWorkTotal({}).then(async (res) => {
|
|
|
+ this.workInfos = res.data;
|
|
|
+ const result = await getWorkInfos({});
|
|
|
+ this.tableData = result.data;
|
|
|
+ });
|
|
|
},
|
|
|
// 存栏情况 - 存栏变动折线图数据请求
|
|
|
initInventoryLines() {
|
|
|
- getInventoryLines({}).then(res => {
|
|
|
+ getInventoryLines({}).then((res) => {
|
|
|
if (res.code === 10000) {
|
|
|
- this.inventoryLinesData = res.data
|
|
|
- console.log(this.inventoryLinesData)
|
|
|
+ this.inventoryLinesData = res.data;
|
|
|
} else {
|
|
|
this.inventoryLinesData = {
|
|
|
boarStock: [],
|
|
@@ -388,23 +487,42 @@ export default {
|
|
|
griceStock: [],
|
|
|
month: [],
|
|
|
pigletStock: [],
|
|
|
- sowStock: []
|
|
|
- }
|
|
|
+ sowStock: [],
|
|
|
+ };
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
// 存栏情况 + 生产情况
|
|
|
initInventoryAndProduct() {
|
|
|
- getInventoryAndProduct({}).then(res => {
|
|
|
+ getInventoryAndProduct({}).then((res) => {
|
|
|
if (res.code === 10000) {
|
|
|
// this.inventoryLinesData = res.data
|
|
|
- console.log(res.data)
|
|
|
- this.inventoryPieData = res.data.slice(0, 6)
|
|
|
- console.log('-----------存栏结构数据')
|
|
|
- console.log(this.inventoryPieData)
|
|
|
- this.inventoryItemsData = [res.data[1].stockQuantity, res.data[6].stockQuantity, res.data[7].stockQuantity, res.data[8].stockQuantity, res.data[2].stockQuantity, res.data[9].stockQuantity]
|
|
|
- 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]
|
|
|
+ console.log(res.data);
|
|
|
+ // this.inventoryPieData = res.data.slice(0, 6)
|
|
|
+ this.inventoryPieData = [
|
|
|
+ res.data["sow_stock"],
|
|
|
+ res.data["boar_stock"],
|
|
|
+ res.data["grice_stock"],
|
|
|
+ res.data["piglet_stock"],
|
|
|
+ res.data["fatpig_stock"],
|
|
|
+ ];
|
|
|
+ this.inventoryItemsData = [
|
|
|
+ res.data["sow_stock"].stockQuantity,
|
|
|
+ res.data["sow_stock_1"].stockQuantity,
|
|
|
+ res.data["sow_stock_2"].stockQuantity,
|
|
|
+ res.data["sow_stock_3"].stockQuantity,
|
|
|
+ res.data["boar_stock"].stockQuantity,
|
|
|
+ res.data["business_stock"].stockQuantity,
|
|
|
+ ];
|
|
|
+ // 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.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: [],
|
|
@@ -415,82 +533,138 @@ export default {
|
|
|
// sowStock: []
|
|
|
// }
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
// 经营分析 - 销售改变
|
|
|
initSalesChange() {
|
|
|
- getSalesChange({}).then(res => {
|
|
|
+ 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
|
|
|
+ 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
|
|
|
+ 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 => {
|
|
|
+ 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)
|
|
|
+ this.salesChartData = res.data;
|
|
|
+ console.log(this.salesChartData);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
// 经营分析 - 成本分析
|
|
|
initCosts() {
|
|
|
- getCosts({}).then(res => {
|
|
|
+ getCosts({}).then((res) => {
|
|
|
if (res.code === 10000) {
|
|
|
- this.costPieData = []
|
|
|
- res.data.forEach(item => {
|
|
|
+ this.costPieData = [];
|
|
|
+ res.data.forEach((item) => {
|
|
|
this.costPieData.push({
|
|
|
name: item.costName,
|
|
|
- value: item.costRate
|
|
|
- })
|
|
|
- })
|
|
|
- this.costHisData = []
|
|
|
- res.data.forEach(item => {
|
|
|
- this.costHisData.push(item.costVal)
|
|
|
- })
|
|
|
+ value: item.costRate,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.costHisData = [];
|
|
|
+ res.data.forEach((item) => {
|
|
|
+ this.costHisData.push(item.costVal);
|
|
|
+ });
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
- // 应收排名
|
|
|
- initYingShou() {
|
|
|
- getYingShou({}).then(res => {
|
|
|
- console.log('应收', res)
|
|
|
+ // // 应收排名
|
|
|
+ // initYingShou() {
|
|
|
+ // getYingShou({}).then((res) => {
|
|
|
+ // console.log("应收", res);
|
|
|
+ // if (res.code === 10000) {
|
|
|
+ // this.yingshouTableData = res.data;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // 应付排名
|
|
|
+ initYingFu() {
|
|
|
+ getYingFu({}).then((res) => {
|
|
|
+ console.log("应付", res);
|
|
|
if (res.code === 10000) {
|
|
|
- this.yingshouTableData = res.data
|
|
|
+ this.yingfuTableData = res.data;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
- // 应付排名
|
|
|
- initYingFu() {
|
|
|
- getYingFu({}).then(res => {
|
|
|
- console.log('应付', res)
|
|
|
+ // 安全库存报警
|
|
|
+ initSafeInventory() {
|
|
|
+ getSafeInventory({
|
|
|
+ current: this.size,
|
|
|
+ size: this.pageNum,
|
|
|
+ }).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 生产情况
|
|
|
+ initProductionCondition() {
|
|
|
+ getProductionCondition({}).then((res) => {
|
|
|
+ console.log(res.data);
|
|
|
if (res.code === 10000) {
|
|
|
- this.yingfuTableData = res.data
|
|
|
+ this.productionPercents = [
|
|
|
+ { ...res.data["grice_rate"], color: "rgb(112,249,250)" },
|
|
|
+ { ...res.data["piglet_rate"], color: "rgb(51, 211, 137)" },
|
|
|
+ { ...res.data["fatpig_rate"], color: "rgb(255, 125, 0)" },
|
|
|
+ { ...res.data["break_rate"], color: "rgb(2, 167, 240)" },
|
|
|
+ // FIXME: 配种分娩率没有,也不能随便放 color: "rgb(112, 0, 217)"
|
|
|
+ ];
|
|
|
+ this.productionItems = [
|
|
|
+ res.data["avg_farrow_1"].stockQuantity,
|
|
|
+ res.data["avg_farrow_2"].stockQuantity,
|
|
|
+ res.data["avg_farrow_3"].stockQuantity,
|
|
|
+ res.data["break_grice"].stockQuantity,
|
|
|
+ res.data["avg_weight"].stockQuantity,
|
|
|
+ res.data["avg_weight"].stockQuantity, // FIXME: 没有数据,随便放一个先
|
|
|
+ res.data["nest_times"].stockQuantity,
|
|
|
+ res.data["psy"].stockQuantity,
|
|
|
+ ];
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 重要指标折线图
|
|
|
+ initImportantData() {
|
|
|
+ getImportantData({
|
|
|
+ startDate: this.importantDates[0],
|
|
|
+ endDate: this.importantDates[1],
|
|
|
+ type: this.importantValue,
|
|
|
+ }).then((res) => {
|
|
|
+ console.log("重要指标数据----------------", res);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 重要指标的 type 改变
|
|
|
+ changeImportantValue() {
|
|
|
+ this.initImportantData();
|
|
|
+ },
|
|
|
+ // 重要指标的时间改变
|
|
|
+ changeImportantDates() {
|
|
|
+ this.initImportantData();
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
getSalesDates(newValue) {
|
|
|
- this.getSalesDates = newValue
|
|
|
- this.initSalesChart()
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ this.getSalesDates = newValue;
|
|
|
+ this.initSalesChart();
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
@@ -509,7 +683,7 @@ export default {
|
|
|
border-bottom: 1px solid rgba(228, 228, 228, 1);
|
|
|
position: relative;
|
|
|
}
|
|
|
-.cost>.select {
|
|
|
+.cost > .select {
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
margin: 20px;
|
|
@@ -524,7 +698,7 @@ export default {
|
|
|
.cost-right {
|
|
|
flex: 1;
|
|
|
}
|
|
|
-.cost>.label {
|
|
|
+.cost > .label {
|
|
|
text-align: center;
|
|
|
font-weight: bold;
|
|
|
font-size: 18px;
|
|
@@ -535,7 +709,7 @@ export default {
|
|
|
position: relative;
|
|
|
border-bottom: 1px solid rgba(228, 228, 228, 1);
|
|
|
}
|
|
|
-.important>.condition {
|
|
|
+.important > .condition {
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
margin-right: 20px;
|
|
@@ -556,32 +730,32 @@ export default {
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
- justify-content: space-around
|
|
|
+ justify-content: space-around;
|
|
|
}
|
|
|
.sales-left {
|
|
|
width: 15%;
|
|
|
line-height: 25px;
|
|
|
padding-top: 30px;
|
|
|
}
|
|
|
-.sales-left>.up {
|
|
|
+.sales-left > .up {
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
-.sales-left>.up>label,
|
|
|
-.sales-left>.down>label {
|
|
|
+.sales-left > .up > label,
|
|
|
+.sales-left > .down > label {
|
|
|
display: block;
|
|
|
text-align: center;
|
|
|
font-size: 13px;
|
|
|
color: #999;
|
|
|
}
|
|
|
-.sales-left>.up>span,
|
|
|
-.sales-left>.down>span {
|
|
|
+.sales-left > .up > span,
|
|
|
+.sales-left > .down > span {
|
|
|
display: block;
|
|
|
text-align: center;
|
|
|
font-size: 16px;
|
|
|
color: #333;
|
|
|
}
|
|
|
-.sales-left>.up>.sales-change,
|
|
|
-.sales-left>.down>.sales-change {
|
|
|
+.sales-left > .up > .sales-change,
|
|
|
+.sales-left > .down > .sales-change {
|
|
|
display: flex;
|
|
|
justify-content: space-around;
|
|
|
font-size: 13px;
|