|
@@ -2,10 +2,12 @@
|
|
|
<html>
|
|
<html>
|
|
|
<head>
|
|
<head>
|
|
|
<meta charset="utf-8" />
|
|
<meta charset="utf-8" />
|
|
|
- <meta
|
|
|
|
|
|
|
+ <meta name="viewport" content="width=1920">
|
|
|
|
|
+ <!-- <meta
|
|
|
name="viewport"
|
|
name="viewport"
|
|
|
- content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi"
|
|
|
|
|
+ /> -->
|
|
|
|
|
+
|
|
|
<title>index</title>
|
|
<title>index</title>
|
|
|
<script type="text/javascript" src="../plugin/jquery.min.js"></script>
|
|
<script type="text/javascript" src="../plugin/jquery.min.js"></script>
|
|
|
<script type="text/javascript" src="../plugin/echarts.min.js"></script>
|
|
<script type="text/javascript" src="../plugin/echarts.min.js"></script>
|
|
@@ -143,17 +145,16 @@
|
|
|
warehouse: null,
|
|
warehouse: null,
|
|
|
workShopDatas: null,
|
|
workShopDatas: null,
|
|
|
warehouseId: null,
|
|
warehouseId: null,
|
|
|
|
|
+ warehouseName: "",
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 创建并渲染中间车间环图
|
|
// 创建并渲染中间车间环图
|
|
|
createWorkShopChart() {
|
|
createWorkShopChart() {
|
|
|
const _self = this;
|
|
const _self = this;
|
|
|
- const workShopOption = drawWorkShopChart(
|
|
|
|
|
- _self.workShopChart,
|
|
|
|
|
- _self.workShopDatas
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ const workShopOption = drawWorkShopChart(_self.workShopDatas);
|
|
|
initChart(_self.workShopChart, workShopOption);
|
|
initChart(_self.workShopChart, workShopOption);
|
|
|
|
|
+ _self.getBoardInfo();
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 创建并渲染左下角模检具数量图
|
|
// 创建并渲染左下角模检具数量图
|
|
@@ -241,18 +242,21 @@
|
|
|
this.maintainChart.setOption({
|
|
this.maintainChart.setOption({
|
|
|
series: [
|
|
series: [
|
|
|
{ type: "custom", name: "时效", data: yData },
|
|
{ type: "custom", name: "时效", data: yData },
|
|
|
- { type: "bar", name: "比例", data: yData,
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ type: "bar",
|
|
|
|
|
+ name: "比例",
|
|
|
|
|
+ data: yData,
|
|
|
label: {
|
|
label: {
|
|
|
normal: {
|
|
normal: {
|
|
|
formatter: (e) => {
|
|
formatter: (e) => {
|
|
|
- if(value == 0){
|
|
|
|
|
|
|
+ if (value == 0) {
|
|
|
value = 1;
|
|
value = 1;
|
|
|
}
|
|
}
|
|
|
- return e.value / value * 100 + '%';
|
|
|
|
|
|
|
+ return (e.value / value) * 100 + "%";
|
|
|
},
|
|
},
|
|
|
- }
|
|
|
|
|
- }},
|
|
|
|
|
-
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
],
|
|
],
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -300,9 +304,13 @@
|
|
|
}, 200),
|
|
}, 200),
|
|
|
|
|
|
|
|
// 获取当前展示的仓库id
|
|
// 获取当前展示的仓库id
|
|
|
- getWarehouseId({ detail }) {
|
|
|
|
|
|
|
+ getWarehouseId() {
|
|
|
const _self = this;
|
|
const _self = this;
|
|
|
- _self.warehouseId = detail.warehouseId;
|
|
|
|
|
|
|
+ // 看板盒子从url获取
|
|
|
|
|
+ // const params = getQueryString();
|
|
|
|
|
+ // _self.warehouseId = params.warehouseId;
|
|
|
|
|
+ // apk 安装包写死(需要多个页面)
|
|
|
|
|
+ _self.warehouseId = 460335910907969;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 获取所有车间信息
|
|
// 获取所有车间信息
|
|
@@ -311,7 +319,15 @@
|
|
|
const url = "/api/WarehouseResource/queryAllWarehouse";
|
|
const url = "/api/WarehouseResource/queryAllWarehouse";
|
|
|
ajaxGet(url).then((success) => {
|
|
ajaxGet(url).then((success) => {
|
|
|
if (success.errorCode === 0) {
|
|
if (success.errorCode === 0) {
|
|
|
- _self.workShopDatas = success.datas;
|
|
|
|
|
|
|
+ if (success.datas) {
|
|
|
|
|
+ success.datas.forEach((item) => {
|
|
|
|
|
+ if (item.id == _self.warehouseId) {
|
|
|
|
|
+ item.selected = true;
|
|
|
|
|
+ _self.warehouseName = item.name;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ _self.workShopDatas = success.datas;
|
|
|
|
|
+ }
|
|
|
_self.createWorkShopChart();
|
|
_self.createWorkShopChart();
|
|
|
} else {
|
|
} else {
|
|
|
console.log(success.errorMessage);
|
|
console.log(success.errorMessage);
|
|
@@ -320,10 +336,10 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 获取看板信息
|
|
// 获取看板信息
|
|
|
- getBoardInfo(warehouseId) {
|
|
|
|
|
|
|
+ getBoardInfo() {
|
|
|
const _self = this;
|
|
const _self = this;
|
|
|
const url = "/api/BulletinBoardResource/queryBoardByWarehouse";
|
|
const url = "/api/BulletinBoardResource/queryBoardByWarehouse";
|
|
|
- const params = [["warehouseId", warehouseId]];
|
|
|
|
|
|
|
+ const params = [["warehouseId", _self.warehouseId]];
|
|
|
ajaxGet(url, params).then((success) => {
|
|
ajaxGet(url, params).then((success) => {
|
|
|
if (success.errorCode === 0) {
|
|
if (success.errorCode === 0) {
|
|
|
if (success.data) {
|
|
if (success.data) {
|
|
@@ -336,7 +352,9 @@
|
|
|
success.data; // 右下角出入库
|
|
success.data; // 右下角出入库
|
|
|
|
|
|
|
|
// 更新左上角
|
|
// 更新左上角
|
|
|
- _self.count = boardInventoryQuantityDto;
|
|
|
|
|
|
|
+ if (boardInventoryQuantityDto) {
|
|
|
|
|
+ _self.count = boardInventoryQuantityDto;
|
|
|
|
|
+ }
|
|
|
// 更新左下角
|
|
// 更新左下角
|
|
|
if (count && count.length > 0) {
|
|
if (count && count.length > 0) {
|
|
|
_self.updateCountChart(count);
|
|
_self.updateCountChart(count);
|
|
@@ -367,14 +385,6 @@
|
|
|
chart && chart.dispose();
|
|
chart && chart.dispose();
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- watch: {
|
|
|
|
|
- warehouseId(newVal, oldValue) {
|
|
|
|
|
- var _self = this;
|
|
|
|
|
- if (newVal !== oldValue) {
|
|
|
|
|
- _self.getBoardInfo(newVal);
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
mounted() {
|
|
mounted() {
|
|
|
const _self = this;
|
|
const _self = this;
|
|
|
_self.outInChart = getElement("outInChart");
|
|
_self.outInChart = getElement("outInChart");
|
|
@@ -383,7 +393,7 @@
|
|
|
_self.maintainChart = getElement("maintainChart");
|
|
_self.maintainChart = getElement("maintainChart");
|
|
|
_self.malfunctionChart = getElement("malfunctionChart");
|
|
_self.malfunctionChart = getElement("malfunctionChart");
|
|
|
_self.malfunctionNumber = getElement("malfunctionNumber");
|
|
_self.malfunctionNumber = getElement("malfunctionNumber");
|
|
|
-
|
|
|
|
|
|
|
+ _self.getWarehouseId();
|
|
|
_self.getAllWarehouse();
|
|
_self.getAllWarehouse();
|
|
|
_self.$nextTick(() => {
|
|
_self.$nextTick(() => {
|
|
|
_self.createCountChart();
|
|
_self.createCountChart();
|
|
@@ -394,11 +404,14 @@
|
|
|
window.addEventListener("resize", _self.cancalDebounce);
|
|
window.addEventListener("resize", _self.cancalDebounce);
|
|
|
window.addEventListener("onmessageChange", _self.getWarehouseId);
|
|
window.addEventListener("onmessageChange", _self.getWarehouseId);
|
|
|
});
|
|
});
|
|
|
|
|
+ _self.timer = setInterval(() => {
|
|
|
|
|
+ _self.getBoardInfo();
|
|
|
|
|
+ }, 6000 * 10);
|
|
|
},
|
|
},
|
|
|
beforeUnmount() {
|
|
beforeUnmount() {
|
|
|
const _self = this;
|
|
const _self = this;
|
|
|
- window.clearInterval(window.timeTicket);
|
|
|
|
|
- window.timeTicket = null;
|
|
|
|
|
|
|
+ clearInterval(_self.timer);
|
|
|
|
|
+ _self.timer = null;
|
|
|
_self.disposeChart(_self.outInChart);
|
|
_self.disposeChart(_self.outInChart);
|
|
|
_self.disposeChart(_self.workShopChart);
|
|
_self.disposeChart(_self.workShopChart);
|
|
|
_self.disposeChart(_self.maintainChart);
|
|
_self.disposeChart(_self.maintainChart);
|