物料安全库存
This commit is contained in:
parent
c9d3b15a5f
commit
0f8128a5d8
|
@ -295,7 +295,7 @@
|
|||
ganttHeight:{
|
||||
type:Number,
|
||||
default: () => {
|
||||
return 300
|
||||
return 0
|
||||
}
|
||||
} ,
|
||||
},
|
||||
|
@ -374,14 +374,7 @@
|
|||
};
|
||||
},
|
||||
mounted(){
|
||||
this.ganttHeight = this.ganttHeight-45;
|
||||
if(window.innerHeight){
|
||||
this.windowWidth = window.innerWidth;
|
||||
this.windowHeight = window.innerHeight;
|
||||
}else{
|
||||
this.windowHeight=document.body.clientHeight?document.body.clientHeight:document.documentElement.clientHeight;
|
||||
this.windowWidth=document.body.clientWidth?document.body.clientWidth:document.documentElement.clientWidth;
|
||||
}
|
||||
// this.ganttHeight = this.ganttHeight;
|
||||
let currentYear = new Date().getFullYear();
|
||||
this.timeRange = [currentYear+'-01',(currentYear+1)+'-12'];
|
||||
this.list = [...this.proList];
|
||||
|
@ -533,14 +526,14 @@
|
|||
},
|
||||
//修改后续高度
|
||||
resetTop(zindex, reduce, isexpand) {
|
||||
let num = reduce ? -40 : 40;
|
||||
let num = reduce ? -34 : 34;
|
||||
if (!reduce && !isexpand) {
|
||||
this.list.forEach((item, index) => {
|
||||
if (index > zindex) {
|
||||
item.top = item.top + 40;
|
||||
item.top = item.top + 35;
|
||||
if (item.children && item.children.length > 0) {
|
||||
item.children.forEach((k, i) => {
|
||||
k.top = item.top + 40 * i + 40;
|
||||
k.top = item.top + 34 * i + 35;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -820,19 +813,7 @@
|
|||
parseInt(this.$refs[dom][0].style.width);
|
||||
end =
|
||||
Math.round(end / this.currentDaySize.value) *
|
||||
this.currentDaySize.value -
|
||||
this.currentDaySize.value;
|
||||
let infoDomX=0,infoDomY = 0;
|
||||
if(this.windowWidth-e.clientX>230){
|
||||
infoDomX = e.clientX;
|
||||
}else{
|
||||
infoDomX = this.windowWidth-230;
|
||||
}
|
||||
if(this.windowHeight-e.clientY>200){
|
||||
infoDomY = e.clientY;
|
||||
}else{
|
||||
infoDomY = this.windowHeight-200;
|
||||
}
|
||||
this.currentDaySize.value -this.currentDaySize.value;
|
||||
this.currentProjectMsg = {
|
||||
name: this.computedList[index].name,
|
||||
allTime: (end - start) / this.currentDaySize.value + 1,
|
||||
|
@ -840,15 +821,9 @@
|
|||
per1: this.computedList[index].per1,
|
||||
startTime: this.computedWithTime(start),
|
||||
endTime: this.computedWithTime(end),
|
||||
left:infoDomX ,
|
||||
top: infoDomY
|
||||
left:e.clientX ,
|
||||
top: e.clientY
|
||||
};
|
||||
/*
|
||||
* left:
|
||||
e.clientX + 220 - this.$refs.chart.scrollLeft >= this.$refs.chart.clientWidth
|
||||
? e.clientX - 220 - 400
|
||||
: e.clientX ,
|
||||
* */
|
||||
this.isShowMsg = true;
|
||||
},
|
||||
//鼠标离开信息消失,时间显示消失
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<div class="totalCountWrap">
|
||||
<span class="totalCountText">本月合同数</span>
|
||||
<div class="totalCountNum">
|
||||
<span class="totalCount">30</span>
|
||||
<span class="totalCount">{{contractTotalCurrent}}</span>
|
||||
<span>个</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<div class="totalCountWrap">
|
||||
<span class="totalCountText">本月生产订单数</span>
|
||||
<div class="totalCountNum">
|
||||
<span class="totalCount">30</span>
|
||||
<span class="totalCount">{{orderTotalCurrent}}</span>
|
||||
<span>个</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -45,7 +45,7 @@
|
|||
<div class="totalCountWrap">
|
||||
<span class="totalCountText">本月在制任务</span>
|
||||
<div class="totalCountNum">
|
||||
<span class="totalCount">30</span>
|
||||
<span class="totalCount">{{planTotalCurrent}}</span>
|
||||
<span>个</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -96,15 +96,15 @@
|
|||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="padding: 5px 20px 20px 20px;">
|
||||
<el-row class="dashboardCardPadding">
|
||||
<el-col :span="15">
|
||||
<div style="height: 40px;line-height: 40px;"></div>
|
||||
<div>
|
||||
<gantt
|
||||
style="position: relative"
|
||||
v-if="proList.length>0"
|
||||
style="position: relative"
|
||||
:proList="proList"
|
||||
:ganttHeight="cardTabelHeight"
|
||||
:ganttHeight="ganttHeight"
|
||||
></gantt>
|
||||
</div>
|
||||
</el-col>
|
||||
|
@ -124,19 +124,25 @@
|
|||
>
|
||||
</el-date-picker>
|
||||
<div class="convenientWrap">
|
||||
<div class="convenientBtn" :class="{activeIndex:chartIndex==='1'}" @click="convenientClick('1','week')">本周</div>
|
||||
<div class="convenientBtn" :class="{activeIndex:chartIndex==='2'}" @click="convenientClick('1','month')">本月</div>
|
||||
<div class="convenientBtn" :class="{activeIndex:chartIndex==='3'}" @click="convenientClick('1','quarter')">三个月</div>
|
||||
<div class="convenientBtn" :class="{activeIndex:chartIndex==='1'}" @click="convenientClick('1','week')">
|
||||
本周
|
||||
</div>
|
||||
<div class="convenientBtn" :class="{activeIndex:chartIndex==='2'}"
|
||||
@click="convenientClick('1','month')">本月
|
||||
</div>
|
||||
<div class="convenientBtn" :class="{activeIndex:chartIndex==='3'}"
|
||||
@click="convenientClick('1','quarter')">三个月
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="chartColumn" style="width:100%;height: 300px;"></div>
|
||||
</div>
|
||||
<div id="chartColumn" style="width:100%;" :style="{height:ganttHeight+'px'}"></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row class="dashboardSubRow" :gutter="5">
|
||||
<el-row :gutter="5">
|
||||
<el-col :span="12">
|
||||
<el-card style="border-radius: 5px;">
|
||||
<div class="dashboardBottomRow">
|
||||
<div class="dashboardCardHand">
|
||||
<div class="CardTitleWrap">
|
||||
<span class="verticalLine"></span><span class="dashboardCardTitle">库存列表</span>
|
||||
|
@ -154,12 +160,14 @@
|
|||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dashboardCardPadding">
|
||||
<el-table
|
||||
v-loading="listLoadingStock"
|
||||
:data="stockList"
|
||||
fit stripe
|
||||
size="mini"
|
||||
:height="cardTabelHeight"
|
||||
style="border-top: 1px solid #f5f5f5;"
|
||||
>
|
||||
<el-table-column label="物料编号" prop="material_">
|
||||
<template slot-scope="scope">{{ scope.row.material_.number }}</template>
|
||||
|
@ -167,7 +175,7 @@
|
|||
<el-table-column label="物料名称" prop="material_" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row.material_.name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格型号" prop="material_">
|
||||
<el-table-column label="规格型号" prop="material_" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row.material_.specification }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料类型" prop="material_">
|
||||
|
@ -182,15 +190,15 @@
|
|||
<template slot-scope="scope">{{ scope.row.warehouse_.name }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card style="height: 350px;border-radius: 5px;">
|
||||
<div class="dashboardBottomRow">
|
||||
<div class="dashboardCardHand">
|
||||
<div class="CardTitleWrap">
|
||||
<span class="verticalLine"></span><span class="dashboardCardTitle">提醒</span>
|
||||
</div>
|
||||
<!--<div class="dashboardCardTitle">提醒</div>-->
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:current-page.sync="remindPage"
|
||||
|
@ -203,17 +211,14 @@
|
|||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
<el-tabs type="card" :style="{height:cardTabelHeight+'px'}" v-model="activeName" @tab-click="activeNameClick">
|
||||
<div class="dashboardCardPadding">
|
||||
<el-tabs type="card" :style="{height:cardTabelHeight+'px'}" v-model="activeName"
|
||||
@tab-click="activeNameClick">
|
||||
<el-tab-pane label="库存警告" name="库存警告">
|
||||
<ul class="lists">
|
||||
<li class="listItem">
|
||||
<ul :style="{height:cardTabelHeight-47+'px'}" class="lists" :class="{anim:animate}" @mouseenter="Stop()" @mouseleave="Up()">
|
||||
<li v-for="item in list" :key="item.id" class="listItem">
|
||||
<div class="itemText">
|
||||
<span>玻璃低于安全库存</span><span>2021-12-30</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class="listItem" v-for="item in warningList" :key="item.id">
|
||||
<div class="itemText">
|
||||
<span>{{item}}</span><span>2021-12-20</span>
|
||||
<span>{{item.name}}</span><span style="float: right">2021-12-30</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -247,7 +252,8 @@
|
|||
</ul>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
@ -270,6 +276,8 @@ export default {
|
|||
name: 'Dashboard',
|
||||
data() {
|
||||
return {
|
||||
animate: false,
|
||||
intNum: null,
|
||||
chartColumn: null,
|
||||
week: null,
|
||||
currentTime: null,
|
||||
|
@ -292,9 +300,13 @@ export default {
|
|||
remindList: [],
|
||||
warningList: [],
|
||||
list: [
|
||||
{id:1,name:'HIehd9',card:'3337',sco:'REF-32'},
|
||||
{id:1,name:'HIehd9',card:'3337',sco:'REF-32'},
|
||||
{id:1,name:'HIehd9',card:'3337',sco:'REF-32'}
|
||||
{id: 1, name: 'HIehd91', card: '3337', sco: 'REF-32'},
|
||||
{id: 2, name: 'HIehd92', card: '3337', sco: 'REF-32'},
|
||||
{id: 3, name: 'HIehd93', card: '3337', sco: 'REF-32'},
|
||||
{id: 4, name: 'HIehd94', card: '3337', sco: 'REF-32'},
|
||||
{id: 5, name: 'HIehd95', card: '3337', sco: 'REF-32'},
|
||||
{id: 6, name: 'HIehd96', card: '3337', sco: 'REF-32'},
|
||||
{id: 7, name: 'HIehd97', card: '3337', sco: 'REF-32'},
|
||||
],
|
||||
options: {
|
||||
"1": '成品',
|
||||
|
@ -320,6 +332,7 @@ export default {
|
|||
listLoadingPlan: false,
|
||||
listLoadingStock: false,
|
||||
cardTabelHeight: null,
|
||||
ganttHeight: 0,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -330,6 +343,26 @@ export default {
|
|||
])
|
||||
},
|
||||
methods: {
|
||||
getNoticeData() {
|
||||
this.ScrollUp();
|
||||
},
|
||||
ScrollUp() {
|
||||
this.intNum = setInterval(() => {
|
||||
this.animate = true;
|
||||
setTimeout(() => {
|
||||
this.list.push(this.list[0]);
|
||||
this.list.shift();
|
||||
this.animate = false;
|
||||
}, 500)
|
||||
}, 1000);
|
||||
},
|
||||
//鼠标移上去停止
|
||||
Stop() {
|
||||
clearInterval(this.intNum);
|
||||
},
|
||||
Up() {
|
||||
this.ScrollUp();
|
||||
},
|
||||
getStatisticsData() {
|
||||
let that = this;
|
||||
let dat = new Date();
|
||||
|
@ -399,6 +432,12 @@ export default {
|
|||
}
|
||||
});
|
||||
|
||||
//获取库存警告
|
||||
getMaterialList({tag: 'low_inm'}).then((response) => {
|
||||
if (response.data) {
|
||||
that.warningList = response.data.results;
|
||||
}
|
||||
});
|
||||
},
|
||||
gotoTicketPage() {
|
||||
let path = this.$route.path;
|
||||
|
@ -663,17 +702,14 @@ export default {
|
|||
});
|
||||
},
|
||||
//提示
|
||||
activeNameClick(tab, event) {
|
||||
activeNameClick(tab) {
|
||||
let that = this;
|
||||
// debugger;
|
||||
// console.log(tab, event);
|
||||
if (tab.label === '库存警告') {
|
||||
getMaterialList({page: 0, tag: 'low_inm'}).then((response) => {
|
||||
if (response.data) {
|
||||
that.warningList = response.data;
|
||||
that.remindTotal = response.data.length;
|
||||
}
|
||||
this.listLoadingPlan = false;
|
||||
});
|
||||
} else if (tab.label === '临近交货') {
|
||||
getmaterialbatchList({page: 0, tag: 'expired'}).then((response) => {
|
||||
|
@ -681,7 +717,6 @@ export default {
|
|||
that.warningList = response.data;
|
||||
that.remindTotal = response.data.length;
|
||||
}
|
||||
this.listLoadingPlan = false;
|
||||
});
|
||||
} else if (tab.label === '过期提醒') {
|
||||
getmaterialbatchList({page: 0, tag: 'expired'}).then((response) => {
|
||||
|
@ -689,7 +724,6 @@ export default {
|
|||
that.warningList = response.data;
|
||||
that.remindTotal = response.data.length;
|
||||
}
|
||||
this.listLoadingPlan = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -775,17 +809,16 @@ export default {
|
|||
},
|
||||
|
||||
mounted() {
|
||||
// let he = document.documentElement.clientHeight || document.body.clientHeight;
|
||||
let hei = document.getElementsByClassName('app-main')[0].clientHeight;
|
||||
let heig = document.getElementsByClassName('dashboardTopCard')[0].clientHeight;
|
||||
this.cardTabelHeight = ((hei - heig - 130) / 2);
|
||||
this.ganttHeight = this.cardTabelHeight - 50;
|
||||
document.getElementById('chartColumn').style.height = this.cardTabelHeight - 35 + 'px';
|
||||
// this.drawChart();
|
||||
this.getPlanList();
|
||||
this.getStockList();
|
||||
this.getGanttData();
|
||||
// this.getYield();
|
||||
this.getStatisticsData();
|
||||
this.getNoticeData();
|
||||
},
|
||||
updated() {
|
||||
this.drawChart()
|
||||
|
@ -794,16 +827,13 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
ul{
|
||||
margin: 0!important;
|
||||
}
|
||||
.el-card.is-always-shadow {
|
||||
height: auto !important;
|
||||
}
|
||||
.dashboard-container {
|
||||
margin: 5px 6px;
|
||||
}
|
||||
.dashboardTopCard,.dashboardMiddle{
|
||||
.dashboardTopCard, .dashboardMiddle, .dashboardBottomRow {
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
|
@ -811,6 +841,12 @@ export default {
|
|||
background: #ffffff;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
|
||||
}
|
||||
.dashboardBottomRow {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.dashboardCardPadding {
|
||||
padding: 5px 20px 20px 20px;
|
||||
}
|
||||
/**/
|
||||
.cardsWrap {
|
||||
display: flex;
|
||||
|
@ -846,7 +882,6 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cardsWrap:nth-child(3) {
|
||||
.svgIconWrap {
|
||||
background: #d9f6d8;
|
||||
|
@ -904,12 +939,12 @@ export default {
|
|||
line-height: 34px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
width: 50px;
|
||||
width: 70px;
|
||||
vertical-align: middle;
|
||||
margin-right: 7px;
|
||||
}
|
||||
.stockMore {
|
||||
font-size: 14px;
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
color: #409EFF;
|
||||
cursor: pointer;
|
||||
|
@ -948,11 +983,18 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.anim {
|
||||
transition: all 0.5s;
|
||||
margin-top: -35px; //高度等于行高
|
||||
}
|
||||
.lists {
|
||||
height: 100%;
|
||||
line-height: 35px;
|
||||
transition: top 0.5s;
|
||||
overflow-y: scroll;
|
||||
padding-right: 40px;
|
||||
margin: 0 !important;
|
||||
.listItem {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
<el-form
|
||||
ref="Form"
|
||||
:model="material"
|
||||
label-width="80px"
|
||||
label-width="100px"
|
||||
label-position="right"
|
||||
:rules="rule1"
|
||||
>
|
||||
|
@ -131,41 +131,42 @@
|
|||
<el-form-item label="物料编号" prop="number">
|
||||
<el-input v-model="material.number" placeholder="物料编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="specification">
|
||||
<el-form-item label="规格型号">
|
||||
<el-input v-model="material.specification" placeholder="规格型号"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="计量单位" prop="unit">
|
||||
<el-form-item label="计量单位">
|
||||
<el-select style="width: 100%" v-model="material.unit" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in unitoptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料类别" prop="type">
|
||||
|
||||
<el-select style="width: 100%" v-model="material.type" placeholder="请选择">
|
||||
<el-form-item label="物料类别">
|
||||
<el-select style="width: 100%" v-model="material.type" placeholder="请选择物料类别">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单片玻璃数量" prop="piece_count" v-if="material.type==1">
|
||||
<el-form-item label="单片玻璃数量" v-if="material.type==1">
|
||||
<el-input v-model="material.piece_count" placeholder="单片玻璃数量"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="排序" prop="sort_str">
|
||||
<el-input v-model="material.sort_str" placeholder="排序"/>
|
||||
<el-form-item label="安全库存数">
|
||||
<el-input-number style="width: 100%;" v-model="material.count_safe" :step="1" :min="0" step-strictly placeholder="安全库存数"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序">
|
||||
<el-input-number style="width: 100%;" v-model="material.sort_str" :step="1" :min="0" step-strictly placeholder="排序"></el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||
|
@ -189,8 +190,14 @@
|
|||
import {genTree} from "@/utils";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
const defaultmaterial = {
|
||||
name: "",
|
||||
number: "",
|
||||
name: null,
|
||||
number: null,
|
||||
specification: null,
|
||||
unit: null,
|
||||
type: null,
|
||||
piece_count: null,
|
||||
sort_str: null,
|
||||
count_safe: 0,
|
||||
processes: [],
|
||||
};
|
||||
export default {
|
||||
|
@ -270,19 +277,13 @@
|
|||
created() {
|
||||
this.getList();
|
||||
this.getProcessList();
|
||||
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
|
||||
//物料详情
|
||||
handledetail(scope)
|
||||
{
|
||||
handledetail(scope){
|
||||
this.$router.push({name: "MaterialDetail", params: { id: scope.row.id,type: scope.row.type }, })
|
||||
|
||||
},
|
||||
|
||||
|
||||
//选项卡切换
|
||||
handleClick(tab) {
|
||||
this.listLoading = true;
|
||||
|
@ -311,10 +312,8 @@
|
|||
},
|
||||
//绑定工序
|
||||
handlebind(scope) {
|
||||
|
||||
this.$router.push({name: "MaterialDO", params: {id: scope.row.id},})
|
||||
}
|
||||
,
|
||||
},
|
||||
handleFilter() {
|
||||
this.listQuery.page = 1;
|
||||
this.getList();
|
||||
|
@ -324,7 +323,7 @@
|
|||
this.listQuery = {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
}
|
||||
};
|
||||
this.getList();
|
||||
},
|
||||
handleCreate() {
|
||||
|
@ -335,7 +334,6 @@
|
|||
this.$refs["Form"].clearValidate();
|
||||
});
|
||||
},
|
||||
|
||||
handleEdit(scope) {
|
||||
this.material = Object.assign({}, scope.row); // copy obj
|
||||
this.dialogType = "edit";
|
||||
|
@ -359,7 +357,6 @@
|
|||
console.error(err);
|
||||
});
|
||||
},
|
||||
|
||||
async confirm(form) {
|
||||
this.$refs[form].validate((valid) => {
|
||||
if (valid) {
|
||||
|
|
Loading…
Reference in New Issue