|
@@ -53,7 +53,7 @@
|
|
|
<span class="block-title-important">{{userSum}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="row">
|
|
|
+ <div class="row" style="height: 160px;">
|
|
|
<div class="person-div" v-for="user in userList">
|
|
|
<div>
|
|
|
<img v-bind:src="user.avatar" border="0" />
|
|
@@ -365,102 +365,44 @@
|
|
|
<script src="/js/service/product.js"></script>
|
|
|
<script src="/js/content/mycharts.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
- const userList = ServicePerson.getWarehousePersonList();
|
|
|
- const userSum = userList.length;
|
|
|
- const waitinginMaterialList = ServiceMaterial.getWatingInList();
|
|
|
- const waitinginMaterialSum = waitinginMaterialList.length;
|
|
|
- const inMaterialSum = ServiceMaterial.getInSum();
|
|
|
- const waitinginMaterialSumPercent = (waitinginMaterialSum / (waitinginMaterialSum + inMaterialSum) * 100)
|
|
|
- .toFixed(0);
|
|
|
- const inMaterialSumPercent = 100 - waitinginMaterialSumPercent;
|
|
|
- const waitingcheckMaterialList = ServiceMaterial.getWatingCheckList();
|
|
|
- const waitingcheckMaterialSum = waitingcheckMaterialList.length;
|
|
|
- const checkedMaterialSum = ServiceMaterial.getCheckSum();
|
|
|
- const checkedMaterialSumPercent = (checkedMaterialSum / (checkedMaterialSum + waitingcheckMaterialSum) * 100)
|
|
|
- .toFixed(0);
|
|
|
- const waitingcheckMaterialSumPercent = 100 - checkedMaterialSumPercent;
|
|
|
- const waitingSendProductList = ServiceProduct.getWatingSendList();
|
|
|
- const waitingSendProductSum = waitingSendProductList.length;
|
|
|
- const sendProductSum = ServiceProduct.getSendSum();
|
|
|
- const waitingSendProductSumPercent = (waitingSendProductSum / (waitingSendProductSum + sendProductSum) * 100)
|
|
|
- .toFixed(0);
|
|
|
- const sendProductSumPercent = 100 - waitingSendProductSumPercent;
|
|
|
- const materialStockList = ServiceMaterial.getStockList();
|
|
|
- /** 工单备料 **/
|
|
|
- const orderSheetMaterialList = ServiceMaterial.getListByOrderSheet();
|
|
|
- var orderSheetMaterialNeedSum = 0;
|
|
|
- var orderSheetMaterialPercent = 0;
|
|
|
- var orderSheetMaterialStockSum = 0;
|
|
|
-
|
|
|
- function getOrderSheetMaterialNeedSum() {
|
|
|
- orderSheetMaterialNeedSum = orderSheetMaterialList.length;
|
|
|
- $.each(orderSheetMaterialList, function (index, item) {
|
|
|
- if (item.needSum * 1 > item.stockSum * 1)
|
|
|
- orderSheetMaterialStockSum++;
|
|
|
- });
|
|
|
- orderSheetMaterialPercent = ((orderSheetMaterialNeedSum - orderSheetMaterialStockSum) /
|
|
|
- orderSheetMaterialNeedSum * 100).toFixed("0");
|
|
|
- /*
|
|
|
- $.each(orderSheetMaterialList, function (index, item) {
|
|
|
- orderSheetMaterialNeedSum += item.needSum * 1;
|
|
|
-
|
|
|
- orderSheetMaterialStockSum += (item.needSum * 1 > item.stockSum * 1 ? item.stockSum * 1 : item.needSum * 1);
|
|
|
- });
|
|
|
- orderSheetMaterialPercent = (orderSheetMaterialStockSum / orderSheetMaterialNeedSum*100).toFixed("0");*/
|
|
|
- }
|
|
|
- getOrderSheetMaterialNeedSum();
|
|
|
- /** 工单缺料 **/
|
|
|
- const orderSheetMaterialNotEnoughList = ServiceMaterial.getListByOrderSheetNotEnough();
|
|
|
- var orderSheetMaterialNotEnoughSum = orderSheetMaterialNotEnoughList.length;
|
|
|
- /*
|
|
|
- function getOrderSheetMaterialNotEnoughSum() {
|
|
|
- $.each(orderSheetMaterialNotEnoughList, function (index, item) {
|
|
|
- orderSheetMaterialNotEnoughSum += item.needSum * 1 - item.stockSum *1;
|
|
|
- });
|
|
|
- }
|
|
|
- getOrderSheetMaterialNotEnoughSum();*/
|
|
|
- /** 工单齐套 **/
|
|
|
- const orderSheetMaterialEnoughList = ServiceMaterial.getListByOrderSheetEnough();
|
|
|
- var orderSheetMaterialEnoughSum = orderSheetMaterialEnoughList.length;
|
|
|
- /** 领料申请 **/
|
|
|
- const applyMaterialList = ServiceMaterial.getApplyList();
|
|
|
- const applyCompleteSum = ServiceMaterial.getApplyCompleteSum();
|
|
|
- const applyMaterialSum = applyMaterialList.length;
|
|
|
- const applyCompleteSumPercent = (applyCompleteSum / (applyCompleteSum + applyMaterialSum) * 100).toFixed(0);
|
|
|
- const applyMaterialSumPercent = 100 - applyCompleteSumPercent;
|
|
|
-
|
|
|
-
|
|
|
var vm = new Vue({
|
|
|
el: '#div-main',
|
|
|
data: {
|
|
|
- userList: userList,
|
|
|
- userSum: userSum,
|
|
|
- waitinginMaterialList: waitinginMaterialList,
|
|
|
- waitinginMaterialSum: waitinginMaterialSum,
|
|
|
- inMaterialSum: inMaterialSum,
|
|
|
- waitinginMaterialSumPercent: waitinginMaterialSumPercent + '%',
|
|
|
- inMaterialSumPercent: inMaterialSumPercent + '%',
|
|
|
- waitingcheckMaterialList: waitingcheckMaterialList,
|
|
|
- waitingcheckMaterialSum: waitingcheckMaterialSum,
|
|
|
- checkedMaterialSum: checkedMaterialSum,
|
|
|
- checkedMaterialSumPercent: checkedMaterialSumPercent + '%',
|
|
|
- waitingcheckMaterialSumPercent: waitingcheckMaterialSumPercent + '%',
|
|
|
- waitingSendProductList: waitingSendProductList,
|
|
|
- waitingSendProductSum: waitingSendProductSum,
|
|
|
- sendProductSum: sendProductSum,
|
|
|
- waitingSendProductSumPercent: waitingSendProductSumPercent + '%',
|
|
|
- sendProductSumPercent: sendProductSumPercent + '%',
|
|
|
- materialStockList: materialStockList,
|
|
|
- orderSheetMaterialList: orderSheetMaterialList,
|
|
|
- orderSheetMaterialNeedSum: orderSheetMaterialNeedSum,
|
|
|
- orderSheetMaterialPercent: orderSheetMaterialPercent,
|
|
|
- orderSheetMaterialEnoughList: orderSheetMaterialEnoughList,
|
|
|
- orderSheetMaterialEnoughSum: orderSheetMaterialEnoughSum,
|
|
|
- applyMaterialList: applyMaterialList,
|
|
|
- applyCompleteSum: applyCompleteSum,
|
|
|
- applyMaterialSum: applyMaterialSum,
|
|
|
- applyCompleteSumPercent: applyCompleteSumPercent + '%',
|
|
|
- applyMaterialSumPercent: applyMaterialSumPercent + '%',
|
|
|
+ userList: [],
|
|
|
+ userSum: 0,
|
|
|
+ waitinginMaterialList: [],
|
|
|
+ waitinginMaterialSum: 0,
|
|
|
+ inMaterialSum: 0,
|
|
|
+ waitinginMaterialSumPercent: '0%',
|
|
|
+ inMaterialSumPercent: '0%',
|
|
|
+ waitingcheckMaterialList: [],
|
|
|
+ waitingcheckMaterialSum: 0,
|
|
|
+ checkedMaterialSum: 0,
|
|
|
+ checkedMaterialSumPercent: '0%',
|
|
|
+ waitingcheckMaterialSumPercent: '0%',
|
|
|
+ waitingSendProductList: [],
|
|
|
+ waitingSendProductSum: 0,
|
|
|
+ sendProductSum: 0,
|
|
|
+ waitingSendProductSumPercent: '0%',
|
|
|
+ sendProductSumPercent: '0%',
|
|
|
+ materialStockList: [],
|
|
|
+ orderSheetMaterialList: [],
|
|
|
+ orderSheetMaterialNeedSum: 0,
|
|
|
+ orderSheetMaterialPercent: 0,
|
|
|
+ orderSheetMaterialEnoughList: [],
|
|
|
+ orderSheetMaterialEnoughSum: 0,
|
|
|
+ orderSheetMaterialNotEnoughSum:0,
|
|
|
+ orderSheetMaterialNotEnoughList:[],
|
|
|
+ applyMaterialList: [],
|
|
|
+ applyCompleteSum: 0,
|
|
|
+ applyMaterialSum: 0,
|
|
|
+ applyCompleteSumPercent: '0%',
|
|
|
+ applyMaterialSumPercent: '0%',
|
|
|
+
|
|
|
+ cacheDataObject: {}, // 从服务器加载的全数据,界面只取某几条
|
|
|
+
|
|
|
+ timer_long: '', // 定时取服务器数据
|
|
|
+ timer_short: '' // 数据超长定时轮播
|
|
|
},
|
|
|
methods: {
|
|
|
// 安全库存不足时class
|
|
@@ -475,12 +417,168 @@
|
|
|
return "error-font";
|
|
|
}
|
|
|
return "";
|
|
|
+ },
|
|
|
+ // 从服务器加载数据并显示
|
|
|
+ refreshData: function () {
|
|
|
+ // 关闭定时器
|
|
|
+ clearInterval(this.timer_short);
|
|
|
+ // 刷新报表
|
|
|
+ ChartsService.initCommonBar("charts_11", ServiceProduct.getMonthSend());
|
|
|
+ ChartsService.initLineWithShade("charts_12", ServiceProduct.getMonthSendByProject());
|
|
|
+ ChartsService.initCommonBar("charts_22", ServiceProduct.getStockList());
|
|
|
+ this.loadData();
|
|
|
+ // 开启定时器
|
|
|
+ this.timer_short = setInterval(this.scrollData, 5000);
|
|
|
+ },
|
|
|
+ // 轮播数据
|
|
|
+ scrollData: function () {
|
|
|
+ for (var key in this.cacheDataObject){
|
|
|
+ const dataList = this.cacheDataObject[key].data;
|
|
|
+ const pagesize = this.cacheDataObject[key].pagesize;
|
|
|
+ var pageindex = this.cacheDataObject[key].pageindex+1;
|
|
|
+
|
|
|
+
|
|
|
+ if (dataList.length > pagesize){
|
|
|
+ const pagesum = (dataList.length/pagesize).toFixed(0)*1+(dataList.length%pagesize>0?1:0);
|
|
|
+ if (pageindex >= pagesum)
|
|
|
+ pageindex = 0;
|
|
|
+ this.cacheDataObject[key].pageindex = pageindex;
|
|
|
+ const startIndex = pageindex*pagesize;
|
|
|
+ const remainSum = dataList.length-startIndex;
|
|
|
+ const recordSum = remainSum>=pagesize?pagesize:remainSum;
|
|
|
+ this[key] = dataList.slice(startIndex, startIndex+pagesize);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ // 从服务器加载数据
|
|
|
+ loadData: function () {
|
|
|
+ this.cacheDataObject = {};
|
|
|
+ // 人员信息
|
|
|
+ const userList = ServicePerson.getWarehousePersonList();
|
|
|
+ this.userSum = userList.length;
|
|
|
+ this.cacheDataObject.userList = {
|
|
|
+ data: userList,
|
|
|
+ pagesize: 5,
|
|
|
+ pageindex: 0
|
|
|
+ }
|
|
|
+ this.userList = userList.slice(0, this.cacheDataObject.userList.pagesize);
|
|
|
+ // 待入库
|
|
|
+ const waitinginMaterialList = ServiceMaterial.getWatingInList();
|
|
|
+ this.waitinginMaterialSum = waitinginMaterialList.length;
|
|
|
+ this.inMaterialSum = ServiceMaterial.getInSum();
|
|
|
+ const waitinginMaterialSumPercent = (this.waitinginMaterialSum / (this.waitinginMaterialSum +
|
|
|
+ this.inMaterialSum) * 100)
|
|
|
+ .toFixed(0);
|
|
|
+ this.inMaterialSumPercent = (100 - waitinginMaterialSumPercent) + '%';
|
|
|
+ this.waitinginMaterialSumPercent = waitinginMaterialSumPercent + '%';
|
|
|
+ this.cacheDataObject.waitinginMaterialList = {
|
|
|
+ data: waitinginMaterialList,
|
|
|
+ pagesize: 8,
|
|
|
+ pageindex: 0
|
|
|
+ }
|
|
|
+ this.waitinginMaterialList = waitinginMaterialList.slice(0, this.cacheDataObject.waitinginMaterialList.pagesize);
|
|
|
+ // 收料待检
|
|
|
+ const waitingcheckMaterialList = ServiceMaterial.getWatingCheckList();
|
|
|
+ this.waitingcheckMaterialSum = waitingcheckMaterialList.length;
|
|
|
+ this.checkedMaterialSum = ServiceMaterial.getCheckSum();
|
|
|
+ const checkedMaterialSumPercent = (this.checkedMaterialSum / (this.checkedMaterialSum +
|
|
|
+ this.waitingcheckMaterialSum) * 100)
|
|
|
+ .toFixed(0);
|
|
|
+ this.waitingcheckMaterialSumPercent = (100 - checkedMaterialSumPercent) + '%';
|
|
|
+ this.checkedMaterialSumPercent = checkedMaterialSumPercent + '%';
|
|
|
+ this.cacheDataObject.waitingcheckMaterialList = {
|
|
|
+ data: waitingcheckMaterialList,
|
|
|
+ pagesize: 8,
|
|
|
+ pageindex: 0
|
|
|
+ }
|
|
|
+ this.waitingcheckMaterialList = waitingcheckMaterialList.slice(0, this.cacheDataObject.waitingcheckMaterialList.pagesize);
|
|
|
+ // 待入库
|
|
|
+ const waitingSendProductList = ServiceProduct.getWatingSendList();
|
|
|
+ this.waitingSendProductSum = waitingSendProductList.length;
|
|
|
+ this.sendProductSum = ServiceProduct.getSendSum();
|
|
|
+ const waitingSendProductSumPercent = (this.waitingSendProductSum / (this.waitingSendProductSum +
|
|
|
+ this.sendProductSum) * 100)
|
|
|
+ .toFixed(0);
|
|
|
+ this.sendProductSumPercent = (100 - waitingSendProductSumPercent) + '%';
|
|
|
+ this.waitingSendProductSumPercent = waitingSendProductSumPercent + '%';
|
|
|
+ this.cacheDataObject.waitingSendProductList = {
|
|
|
+ data: waitingSendProductList,
|
|
|
+ pagesize: 8,
|
|
|
+ pageindex: 0
|
|
|
+ }
|
|
|
+ this.waitingSendProductList = waitingSendProductList.slice(0, this.cacheDataObject.waitingSendProductList.pagesize);
|
|
|
+ // 库存
|
|
|
+ const materialStockList = ServiceMaterial.getStockList();
|
|
|
+ this.cacheDataObject.materialStockList = {
|
|
|
+ data: materialStockList,
|
|
|
+ pagesize: 20,
|
|
|
+ pageindex: 0
|
|
|
+ }
|
|
|
+ this.materialStockList = materialStockList.slice(0, this.cacheDataObject.materialStockList.pagesize);
|
|
|
+ /** 工单备料 **/
|
|
|
+ const orderSheetMaterialList = ServiceMaterial.getListByOrderSheet();
|
|
|
+ var orderSheetMaterialNeedSum = 0;
|
|
|
+ var orderSheetMaterialStockSum = 0;
|
|
|
+
|
|
|
+ orderSheetMaterialNeedSum = orderSheetMaterialList.length;
|
|
|
+ $.each(orderSheetMaterialList, function (index, item) {
|
|
|
+ if (item.needSum * 1 > item.stockSum * 1)
|
|
|
+ orderSheetMaterialStockSum++;
|
|
|
+ });
|
|
|
+ this.orderSheetMaterialPercent = ((orderSheetMaterialNeedSum - orderSheetMaterialStockSum) /
|
|
|
+ orderSheetMaterialNeedSum * 100).toFixed("0");
|
|
|
+ this.cacheDataObject.orderSheetMaterialList = {
|
|
|
+ data: orderSheetMaterialList,
|
|
|
+ pagesize: 8,
|
|
|
+ pageindex: 0
|
|
|
+ }
|
|
|
+ this.orderSheetMaterialList = orderSheetMaterialList.slice(0, this.cacheDataObject.orderSheetMaterialList.pagesize);
|
|
|
+ /** 工单缺料 **/
|
|
|
+ const orderSheetMaterialNotEnoughList = ServiceMaterial.getListByOrderSheetNotEnough();
|
|
|
+ this.orderSheetMaterialNotEnoughSum = orderSheetMaterialNotEnoughList.length;
|
|
|
+ this.cacheDataObject.orderSheetMaterialNotEnoughList = {
|
|
|
+ data: orderSheetMaterialNotEnoughList,
|
|
|
+ pagesize: 8,
|
|
|
+ pageindex: 0
|
|
|
+ }
|
|
|
+ this.orderSheetMaterialNotEnoughList = orderSheetMaterialNotEnoughList.slice(0, this.cacheDataObject.orderSheetMaterialNotEnoughList.pagesize);
|
|
|
+ /** 工单齐套 **/
|
|
|
+ const orderSheetMaterialEnoughList = ServiceMaterial.getListByOrderSheetEnough();
|
|
|
+ this.orderSheetMaterialEnoughSum = orderSheetMaterialEnoughList.length;
|
|
|
+ this.cacheDataObject.orderSheetMaterialEnoughList = {
|
|
|
+ data: orderSheetMaterialEnoughList,
|
|
|
+ pagesize: 8,
|
|
|
+ pageindex: 0
|
|
|
+ }
|
|
|
+ this.orderSheetMaterialEnoughList = orderSheetMaterialEnoughList.slice(0, this.cacheDataObject.orderSheetMaterialEnoughList.pagesize);
|
|
|
+ /** 领料申请 **/
|
|
|
+ const applyMaterialList = ServiceMaterial.getApplyList();
|
|
|
+ this.applyCompleteSum = ServiceMaterial.getApplyCompleteSum();
|
|
|
+ this.applyMaterialSum = applyMaterialList.length;
|
|
|
+ const applyCompleteSumPercent = (this.applyCompleteSum / (this.applyCompleteSum +
|
|
|
+ this.applyMaterialSum) * 100).toFixed(0);
|
|
|
+ this.applyMaterialSumPercent = (100 - applyCompleteSumPercent)+'%';
|
|
|
+ this.applyCompleteSumPercent = applyCompleteSumPercent + '%';
|
|
|
+ this.cacheDataObject.applyMaterialList = {
|
|
|
+ data: applyMaterialList,
|
|
|
+ pagesize: 8,
|
|
|
+ pageindex: 0
|
|
|
+ }
|
|
|
+ this.applyMaterialList = applyMaterialList.slice(0, this.cacheDataObject.applyMaterialList.pagesize);
|
|
|
}
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.timer_long = setInterval(this.refreshData, 60000);
|
|
|
+ this.refreshData();
|
|
|
+
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ clearInterval(this.timer_long);
|
|
|
+ clearInterval(this.timer_short);
|
|
|
}
|
|
|
});
|
|
|
- ChartsService.initCommonBar("charts_11", ServiceProduct.getMonthSend());
|
|
|
- ChartsService.initLineWithShade("charts_12", ServiceProduct.getMonthSendByProject());
|
|
|
- ChartsService.initCommonBar("charts_22", ServiceProduct.getStockList());
|
|
|
</script>
|
|
|
|
|
|
</body>
|