gantt图修改,生产执行修改
This commit is contained in:
parent
9fb27aa062
commit
329d30eecb
|
@ -32,8 +32,12 @@
|
|||
<div id="app" class="aminui">
|
||||
<div class="app-loading">
|
||||
<div class="app-loading__logo">
|
||||
<!-- <img src="img/bbmg.jpg"/> -->
|
||||
<img src="img/gz_logo.png"/>
|
||||
<!-- 曲阳 -->
|
||||
<!-- <img src="img/bbmg_jy.jpg"/> -->
|
||||
<!-- 托克逊 -->
|
||||
<img src="img/bbmg.jpg"/>
|
||||
<!-- 光子 -->
|
||||
<!-- <img src="img/gz_logo.png"/> -->
|
||||
</div>
|
||||
<div class="app-loading__loader"></div>
|
||||
<div class="app-loading__title"><%= VUE_APP_TITLE %></div>
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import colorTool from '@/utils/color'
|
||||
|
||||
import colorTool from '@/utils/color';
|
||||
export default {
|
||||
name: 'App',
|
||||
data() {
|
||||
|
@ -75,8 +74,8 @@
|
|||
height: 35px;
|
||||
text-align: center;
|
||||
}
|
||||
.numCell,.myTable th{
|
||||
width: 100px!important;
|
||||
.numCell{
|
||||
width: 100px;
|
||||
}
|
||||
.chartWrap{
|
||||
width: 1035px;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<div ref="ganttContainer"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {gantt} from 'dhtmlx-gantt';
|
||||
export default {
|
||||
|
@ -34,29 +33,23 @@
|
|||
gantt.config.date_grid = "%Y/%m/%d";
|
||||
gantt.config.readonly = true;
|
||||
gantt.config.autosize = true;
|
||||
gantt.plugins({
|
||||
tooltip: true
|
||||
});
|
||||
|
||||
gantt.plugins({tooltip: true});
|
||||
// gantt.config.start_date = new Date(2023, 9, 1);
|
||||
// gantt.config.end_date = new Date(2023, 9, 10);
|
||||
gantt.config.columns = [
|
||||
{name: 'number',label: '订单编号',tree: true,width: '*',align: 'left'},
|
||||
{name: 'model',label: '型号', width: '70',align: 'center'},
|
||||
{name: 'cate',label: '规格',width: '80',align: 'center'},
|
||||
{name: 'number',label: '任务编号',tree: true,width: '*',align: 'left'},
|
||||
{name: 'cate',label: '规格型号', width: '70',align: 'center'},
|
||||
{name: 'count',label: '完成量',width: '50', align: 'center'}
|
||||
];
|
||||
gantt.attachEvent('onGanttReady', function () {
|
||||
var tooltips = gantt.ext.tooltips;
|
||||
// var tooltips = gantt.ext.tooltips;
|
||||
gantt.templates.tooltip_text = function (start, end, task) {
|
||||
return task.number + '<br/>计划产量:' + task.count + '<br/>当日产量:' + task.count + '<br/>完成产量:' + task.count + '<br/>开工时间:' + gantt.templates.tooltip_date_format(start) + '<br/>完工时间:' + gantt.templates.tooltip_date_format(end);
|
||||
};
|
||||
});
|
||||
|
||||
// gantt.config.scale_unit = "day";
|
||||
// gantt.config.step = 1;
|
||||
// gantt.config.date_scale = " %Y/%m/%d";
|
||||
|
||||
//时间轴样式
|
||||
var yearScaleCss = function () {
|
||||
return 'yearScaleStyle';
|
||||
|
@ -65,15 +58,14 @@
|
|||
return 'monthScaleStyle';
|
||||
};
|
||||
gantt.config.scales = [
|
||||
{ unit: 'year', step: 1, format: " %Y", css: yearScaleCss },
|
||||
{ unit: 'day', step: 1, format: " %m/%d", css: monthScaleCss }
|
||||
{ unit: 'year', step: 1, format: " %Y年", css: yearScaleCss },
|
||||
{ unit: 'day', step: 1, format: " %m月%d日", css: monthScaleCss }
|
||||
];
|
||||
gantt.init(this.$refs.ganttContainer);
|
||||
gantt.parse(this.$props.tasks);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import "~dhtmlx-gantt/codebase/dhtmlxgantt.css";
|
||||
</style>
|
|
@ -10,14 +10,14 @@
|
|||
<div class="panel_title">本月全厂主要数据</div>
|
||||
<el-row :gutter="16" style="height: 72px;margin-top: 4px">
|
||||
<el-col :span="12" class="panel_item">
|
||||
<div class="panel_label"><img src="/img/elec.png" style="height: 24px;vertical-align:middle;"/>动力电消耗</div>
|
||||
<div class="panel_label"><img src="img/elec.png" style="height: 24px;vertical-align:middle;"/>动力电消耗</div>
|
||||
<div class="pannel_number">
|
||||
<span class="panel_value">{{ factoryData.elec_consume }}</span>
|
||||
<span class="panel_unit">(kW·h)</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="panel_item">
|
||||
<div class="panel_label"><img src="/img/coal.png" style="height: 24px;vertical-align:bottom;" />煤粉消耗</div>
|
||||
<div class="panel_label"><img src="img/coal.png" style="height: 24px;vertical-align:bottom;" />煤粉消耗</div>
|
||||
<div class="pannel_number">
|
||||
<span class="panel_value">{{ factoryData.pcoal_consume }}</span>
|
||||
<span class="panel_unit">(t)</span>
|
||||
|
@ -26,14 +26,14 @@
|
|||
</el-row>
|
||||
<el-row :gutter="16" style="height: 72px;margin-top: 4px">
|
||||
<el-col :span="12" class="panel_item">
|
||||
<div class="panel_label"><img src="/img/water.png" style="height: 24px;vertical-align:bottom;" />工业水消耗</div>
|
||||
<div class="panel_label"><img src="img/water.png" style="height: 24px;vertical-align:bottom;" />工业水消耗</div>
|
||||
<div class="pannel_number">
|
||||
<span class="panel_value">{{ factoryData.water_consume }}</span>
|
||||
<span class="panel_unit">(t)</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="panel_item">
|
||||
<div class="panel_label"><img src="/img/cair.png" style="height: 24px;vertical-align:bottom;" />压缩空气消耗</div>
|
||||
<div class="panel_label"><img src="img/cair.png" style="height: 24px;vertical-align:bottom;" />压缩空气消耗</div>
|
||||
<div class="pannel_number">
|
||||
<span class="panel_value">{{ factoryData.cair_consume }}</span>
|
||||
<span class="panel_unit">(t)</span>
|
||||
|
@ -59,14 +59,14 @@
|
|||
<div class="panel_title">今日工段主要数据-{{ activeSectionName }}</div>
|
||||
<el-row :gutter="16" style="height: 72px;margin-top: 4px">
|
||||
<el-col :span="12" class="panel_item">
|
||||
<div class="panel_label"><img src="/img/elec.png" style="height: 24px;vertical-align:middle;" />单位产品电耗</div>
|
||||
<div class="panel_label"><img src="img/elec.png" style="height: 24px;vertical-align:middle;" />单位产品电耗</div>
|
||||
<div class="pannel_number">
|
||||
<span class="panel_value">{{ sectionData.elec_consume_unit }}</span>
|
||||
<span class="panel_unit">(kW·h)</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="panel_item">
|
||||
<div class="panel_label"><img src="/img/total_production.png" style="height: 24px;vertical-align:middle;" />产品产量</div>
|
||||
<div class="panel_label"><img src="img/total_production.png" style="height: 24px;vertical-align:middle;" />产品产量</div>
|
||||
<div class="pannel_number">
|
||||
<span class="panel_value">{{ sectionData.total_production }}</span>
|
||||
<span class="panel_unit">(t)</span>
|
||||
|
@ -75,14 +75,14 @@
|
|||
</el-row>
|
||||
<el-row :gutter="16" style="height: 72px;margin-top: 4px">
|
||||
<el-col :span="12" class="panel_item">
|
||||
<div class="panel_label"><img src="/img/run_rate.png" style="height: 24px;vertical-align:middle;" /> 运转率</div>
|
||||
<div class="panel_label"><img src="img/run_rate.png" style="height: 24px;vertical-align:middle;" /> 运转率</div>
|
||||
<div class="pannel_number">
|
||||
<span class="panel_value">{{ sectionData.run_rate }}</span>
|
||||
<span class="panel_unit">(%)</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="panel_item" v-if="showKgcet">
|
||||
<div class="panel_label"><img src="/img/coal.png" style="height: 24px;vertical-align:bottom;"/>单位产品标煤耗</div>
|
||||
<div class="panel_label"><img src="img/coal.png" style="height: 24px;vertical-align:bottom;"/>单位产品标煤耗</div>
|
||||
<div class="pannel_number">
|
||||
<span class="panel_value">{{ sectionData.coal_consume_unit }}</span>
|
||||
<span class="panel_unit">(kgce/t)</span>
|
||||
|
|
|
@ -98,6 +98,7 @@
|
|||
></save-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import baseInFo from './../../../src/utils/baseJson';
|
||||
import saveDialog from "./equipment_form.vue";
|
||||
export default {
|
||||
name: "rparty",
|
||||
|
@ -123,8 +124,12 @@ export default {
|
|||
30: '在修',
|
||||
40: '禁用',
|
||||
},
|
||||
baseInfo:{}
|
||||
};
|
||||
},
|
||||
mounted(){
|
||||
// console.log(baseInfo)
|
||||
},
|
||||
methods: {
|
||||
//添加
|
||||
add() {
|
||||
|
|
|
@ -87,10 +87,20 @@
|
|||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
this.getData();
|
||||
let params = {};
|
||||
params.page=0;
|
||||
params.year=year;
|
||||
params.mgroup=that.query.mgroup;
|
||||
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||
let data = [];
|
||||
if(res.length>0){
|
||||
data = res[0];
|
||||
}
|
||||
that.getData(data);
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getData(){
|
||||
getData(goalData){
|
||||
let that = this;
|
||||
let query0={};
|
||||
query0.page = 0;
|
||||
|
@ -100,7 +110,6 @@
|
|||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [];
|
||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||
let data0 = res0;
|
||||
debugger;
|
||||
if(data0.length>0){
|
||||
data0.forEach(item0 => {
|
||||
//先按月份排序,再按班组排序
|
||||
|
@ -115,11 +124,11 @@
|
|||
}
|
||||
wrapArr0[ind0] = item0;
|
||||
});
|
||||
debugger;
|
||||
console.log(wrapArr0)
|
||||
}else{
|
||||
}
|
||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||
//今年的值
|
||||
let data = res;
|
||||
if(data.length>0){
|
||||
data.forEach(item => {
|
||||
|
@ -148,23 +157,35 @@
|
|||
arr[7]=item.煤粉_水分_rate_pass!=null?item.煤粉_水分_rate_pass:'/';
|
||||
//设备
|
||||
arr[8]=item.煤磨排风机_consume_unit!=null?item.煤磨排风机_consume_unit:'/';
|
||||
|
||||
let keyVale ='goal_val_'+n;
|
||||
arr[9]=item.elec_consume_unit//当期值(KW·h/t)
|
||||
arr[10]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取
|
||||
arr[11]=item.celec_consume_unit;//当期与目标差值(KW·h/t)
|
||||
let ind_pre = 0,huanbi = 0;
|
||||
if(item.month_s==1){
|
||||
arr[10]=goalData[keyVale];//目标值(KW·h/t)//需要接口获取
|
||||
arr[11]=item.celec_consume_unit-arr[10];//当期与目标差值(KW·h/t)
|
||||
let ind_pre = 0,huanqi = 0,huanqicha=0,tongqi=0,tongqicha=0;
|
||||
if(n==1){
|
||||
ind_pre = 12;
|
||||
huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/';
|
||||
huanqi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/';
|
||||
}else{
|
||||
ind_pre=ind-1;
|
||||
huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/'
|
||||
ind_pre=n-1;
|
||||
huanqi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/'
|
||||
}
|
||||
arr[12]=huanbi;//环期值(KW·h/t)上个月的值
|
||||
arr[13]=item.celec_consume_unit;//当期与环期差值(KW·h/t)
|
||||
arr[14]=item.celec_consume_unit;//环比增长率(%)
|
||||
arr[15]=item.celec_consume_unit;//同比增长率(%)
|
||||
arr[16]=item.celec_consume_unit;//同比增长率(%)
|
||||
arr[12]=huanqi;//环期值(KW·h/t)上个月的值
|
||||
if(huanqi!=='/'){
|
||||
huanqicha = item.celec_consume_unit-huanqi;
|
||||
}else{
|
||||
huanqicha = item.celec_consume_unit
|
||||
}
|
||||
arr[13]=huanqicha;//当期与环期差值(KW·h/t)
|
||||
arr[14]=huanqi!='/'? huanqicha/huanqi*100:0;;//环比增长率(%)
|
||||
if(wrapArr0[n]){
|
||||
tongqicha = item.celec_consume_unit-wrapArr0[n].celec_consume_unit;
|
||||
tongqi = tongqicha/tongqi;
|
||||
}else{
|
||||
tongqicha = item.celec_consume_unit;
|
||||
tongqi = 0;
|
||||
}
|
||||
arr[15]=tongqi;//同比增长率(%)
|
||||
arr[16]=0;//同比增长率(%)
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
console.log(wrapArr)
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(item,index) in tableDatas" :key="index">
|
||||
<td v-for="(item0,index0) in item" :key="index0" class="numCell">{{item0}}</td>
|
||||
<td v-for="(item0,index0) in item" :key="index0" class="numCell"> <span v-if="item0">{{item0}}</span> <span v-else>0</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -93,11 +93,20 @@
|
|||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
that.getData();
|
||||
|
||||
let params = {};
|
||||
params.page=0;
|
||||
params.year=year;
|
||||
params.mgroup=that.query.mgroup;
|
||||
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||
let data = [];
|
||||
if(res.length>0){
|
||||
data = res[0];
|
||||
}
|
||||
that.getData(data);
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getData(){
|
||||
getData(goalData){
|
||||
let that = this;
|
||||
let query0={};
|
||||
query0.page = 0;
|
||||
|
@ -106,8 +115,8 @@
|
|||
query0.mgroup='3346520558031773696';
|
||||
let wrapArr = [],wrapArr0 = [] ,wrapArrs = [];
|
||||
this.$API.enm.enstat.req(query0).then((res0) => {
|
||||
let data0 = res0;
|
||||
debugger;
|
||||
let data0 = [];//去年的值
|
||||
data0 = res0;
|
||||
if(data0.length>0){
|
||||
data0.forEach(item0 => {
|
||||
//先按月份排序,再按班组排序
|
||||
|
@ -126,6 +135,7 @@
|
|||
}else{
|
||||
}
|
||||
this.$API.enm.enstat.req(that.query).then((res) => {
|
||||
//今年的值
|
||||
let data = res;
|
||||
if(data.length>0){
|
||||
data.forEach(item => {
|
||||
|
@ -157,27 +167,49 @@
|
|||
arr[9]=item.循环风机1906_consume_unit!=null?item.循环风机1906_consume_unit:'/';
|
||||
arr[10]=item.系统风机_consume_unit!=null?item.系统风机_consume_unit:'/';
|
||||
arr[11]=item.水平涡流选粉机1915_consume_unit!=null?item.水平涡流选粉机1915_consume_unit:'/';
|
||||
arr[12]=item.新增磨尾风机_consume_unit!=null?item.新增磨尾风机_consume_unit:'/';
|
||||
// arr[12]=item.新增磨尾风机_consume_unit!=null?item.新增磨尾风机_consume_unit:'/';
|
||||
|
||||
arr[13]=item.elec_consume_unit//当期值(KW·h/t)
|
||||
arr[14]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取
|
||||
arr[15]=item.celec_consume_unit;//当期与目标差值(KW·h/t)
|
||||
let ind_pre = 0,huanbi = 0;
|
||||
if(item.month_s==1){
|
||||
// arr[13]=item.elec_consume_unit//当期值(KW·h/t)
|
||||
let keyVale ='goal_val_'+n;
|
||||
arr[12]=goalData[keyVale];//目标值(KW·h/t)//需要接口获取
|
||||
arr[13]=arr[12]-item.celec_consume_unit;//当期与目标差值(KW·h/t)
|
||||
let ind_pre = 0,huanqi = 0,huanqicha=0,tongqi=0,tongqicha=0;
|
||||
if(n==1){
|
||||
ind_pre = 12;
|
||||
huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/';
|
||||
huanqi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/';
|
||||
}else{
|
||||
ind_pre=ind-1;
|
||||
huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/'
|
||||
ind_pre=n-1;
|
||||
huanqi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/'
|
||||
}
|
||||
arr[16]=huanbi;//环期值(KW·h/t)上个月的值
|
||||
arr[17]=item.celec_consume_unit;//当期与环期差值(KW·h/t)
|
||||
arr[18]=item.celec_consume_unit;//环比增长率(%)
|
||||
arr[19]=item.celec_consume_unit;//同比增长率(%)
|
||||
arr[20]=item.celec_consume_unit;//同比增长率(%)
|
||||
arr[14]=huanqi;//环期值(KW·h/t)上个月的值
|
||||
if(huanqi!=='/'){
|
||||
huanqicha = item.celec_consume_unit-huanqi;
|
||||
}else{
|
||||
huanqicha = item.celec_consume_unit
|
||||
}
|
||||
arr[15]=huanqicha;//当期与环期差值(KW·h/t)
|
||||
arr[16]=huanqi!='/'? huanqicha/huanqi*100:0;//环比增长率(%)
|
||||
if(wrapArr0[n]){
|
||||
tongqicha = item.celec_consume_unit-wrapArr0[n].celec_consume_unit;
|
||||
tongqi = tongqicha/tongqi;
|
||||
}else{
|
||||
tongqicha = item.celec_consume_unit;
|
||||
tongqi = 0;
|
||||
}
|
||||
|
||||
arr[17]=tongqi;//同比增长率(%):本月-去年本月/去年
|
||||
arr[18]=0.00;//同比增长率(%)
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
that.tableDatas = wrapArr;
|
||||
let newArr= [];
|
||||
for (let i = 0; i < wrapArr.length; i++) {
|
||||
let item = wrapArr[i];
|
||||
console.log(item);
|
||||
if (item==undefined) {}else{
|
||||
newArr.push(wrapArr[i])
|
||||
}
|
||||
}
|
||||
that.tableDatas = newArr;
|
||||
}else{
|
||||
}
|
||||
})
|
||||
|
@ -197,7 +229,7 @@
|
|||
.req('3322567213885833216')
|
||||
.then((res) => {
|
||||
this.myOption = JSON.parse(res.echart_options);
|
||||
debugger;
|
||||
// debugger;
|
||||
console.log(this.myOption)
|
||||
this.chartShow = true;
|
||||
});
|
||||
|
|
|
@ -853,12 +853,12 @@
|
|||
query.mgroup = that.query.mgroup;
|
||||
this.$API.enm.enstat.req(query).then((response) => {
|
||||
let seriesData0 = [],seriesData1 = [], seriesData2 = [],seriesData3 = [],seriesData4 = [];
|
||||
console.log(response)
|
||||
console.log('获取小时数据',response)
|
||||
let data = response;
|
||||
data.forEach(item => {
|
||||
let ind = item.hour;
|
||||
seriesData0[ind] = item.total_production;
|
||||
seriesData1[ind] = item.production_hour.toFixed(2);
|
||||
seriesData1[ind] = Number(item.production_hour).toFixed(2);
|
||||
seriesData2[ind] = item.run_rate;
|
||||
seriesData3[ind] = item.production_cost_unit;
|
||||
seriesData4[ind] = item.elec_consume_unit;
|
||||
|
@ -896,7 +896,7 @@
|
|||
// debugger;
|
||||
let ind = item.day_s;
|
||||
seriesData0[ind] = item.total_production;
|
||||
seriesData1[ind] = item.production_hour.toFixed(2);
|
||||
seriesData1[ind] = Number(item.production_hour).toFixed(2);
|
||||
seriesData2[ind] = item.run_rate;
|
||||
seriesData3[ind] = item.production_cost_unit;
|
||||
seriesData4[ind] = item.elec_consume_unit;
|
||||
|
@ -932,7 +932,7 @@
|
|||
data.forEach(item => {
|
||||
let ind = item.month_s;
|
||||
seriesData0[ind] = item.total_production;
|
||||
seriesData1[ind] = item.production_hour.toFixed(2);
|
||||
seriesData1[ind] = Number(item.production_hour).toFixed(2);
|
||||
seriesData2[ind] = item.run_rate;
|
||||
seriesData3[ind] = item.production_cost_unit;
|
||||
seriesData4[ind] = item.elec_consume_unit;
|
||||
|
|
|
@ -99,12 +99,20 @@
|
|||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
this.getData();
|
||||
|
||||
|
||||
let params = {};
|
||||
params.page=0;
|
||||
params.year=year;
|
||||
params.mgroup=that.query.mgroup;
|
||||
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||
let data = [];
|
||||
if(res.length>0){
|
||||
data = res[0];
|
||||
}
|
||||
that.getData(data);
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getData(){
|
||||
getData(goalData){
|
||||
let that = this;
|
||||
let query0={};
|
||||
query0.page = 0;
|
||||
|
@ -171,8 +179,9 @@
|
|||
arr[13]=item.废气风机_consume_unit!=null?item.废气风机_consume_unit:'/';
|
||||
//
|
||||
arr[16]=item.elec_consume_unit//当期值(KW·h/t)
|
||||
arr[17]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取
|
||||
arr[18]=item.celec_consume_unit;//当期与目标差值(KW·h/t)
|
||||
let keyVale ='goal_val_'+n;
|
||||
arr[17] = goalData[keyVale];//目标值(KW·h/t)//需要接口获取
|
||||
arr[18]=item.celec_consume_unit-arr[16];//当期与目标差值(KW·h/t)
|
||||
let ind_pre = 0,huanbi = 0;
|
||||
if(item.month_s==1){
|
||||
ind_pre = 12;
|
||||
|
|
|
@ -81,11 +81,21 @@
|
|||
var myDate = new Date();
|
||||
let year = myDate.getFullYear();
|
||||
that.query.year_s = year;
|
||||
this.getData();
|
||||
let params = {};
|
||||
params.page=0;
|
||||
params.year=year;
|
||||
params.mgroup=that.query.mgroup;
|
||||
this.$API.mtm.goal.list.req(params).then((res) => {
|
||||
let data = [];
|
||||
if(res.length>0){
|
||||
data = res[0];
|
||||
}
|
||||
that.getData(data);
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
getData(){
|
||||
getData(goalData){
|
||||
let that = this;
|
||||
let query0={};
|
||||
query0.page = 0;
|
||||
|
@ -136,21 +146,34 @@
|
|||
arr.push(item.production_hour);
|
||||
|
||||
arr[4]=item.elec_consume_unit//当期值(KW·h/t)
|
||||
arr[5]=item.celec_consume_unit;//目标值(KW·h/t)//需要接口获取
|
||||
arr[6]=item.celec_consume_unit;//当期与目标差值(KW·h/t)
|
||||
let ind_pre = 0,huanbi = 0;
|
||||
if(item.month_s==1){
|
||||
let keyVale ='goal_val_'+n;
|
||||
arr[5]=goalData[keyVale];//目标值(KW·h/t)//需要接口获取
|
||||
arr[6]=arr[4]-item.celec_consume_unit;//当期与目标差值(KW·h/t)
|
||||
let ind_pre = 0,huanqi = 0,huanqicha=0,tongqi=0,tongqicha=0;
|
||||
if(n==1){
|
||||
ind_pre = 12;
|
||||
huanbi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/';
|
||||
huanqi = wrapArr0[ind_pre]?wrapArr0[ind_pre].elec_consume_unit:'/';
|
||||
}else{
|
||||
ind_pre=ind-1;
|
||||
huanbi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/'
|
||||
ind_pre=n-1;
|
||||
huanqi = wrapArr[ind_pre]?wrapArr[ind_pre].elec_consume_unit?wrapArr[ind_pre].elec_consume_unit:'/':'/'
|
||||
}
|
||||
arr[7]=huanbi;//环期值(KW·h/t)上个月的值
|
||||
arr[8]=item.celec_consume_unit;//当期与环期差值(KW·h/t)
|
||||
arr[9]=item.celec_consume_unit;//环比增长率(%)
|
||||
arr[10]=item.celec_consume_unit;//同比增长率(%)
|
||||
arr[11]=0;//同比增长率(%)
|
||||
arr[7]=huanqi;//环期值(KW·h/t)上个月的值
|
||||
if(huanqi!=='/'){
|
||||
huanqicha = item.celec_consume_unit-huanqi;
|
||||
}else{
|
||||
huanqicha = item.celec_consume_unit
|
||||
}
|
||||
arr[8]=huanqicha;//当期与环期差值(KW·h/t)
|
||||
arr[9]=huanqi!='/'? huanqicha/huanqi*100:0;//环比增长率(%)
|
||||
if(wrapArr0[n]){
|
||||
tongqicha = item.celec_consume_unit-wrapArr0[n].celec_consume_unit;
|
||||
tongqi = tongqicha/tongqi;
|
||||
}else{
|
||||
tongqicha = item.celec_consume_unit;
|
||||
tongqi = 0;
|
||||
}
|
||||
arr[10]=tongqi;//同比增长率(%)
|
||||
arr[11]=0;//得分
|
||||
wrapArr[ind] = arr;
|
||||
});
|
||||
console.log(wrapArr)
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<div class="retangleWrap">
|
||||
<div class="retangle countRetangle">
|
||||
<div style="display: flex;justify-content: space-between;padding: 0 24px;">
|
||||
<div style="color: rgb(30, 30, 30);font-size: 16px;font-weight: 400;line-height: 24px;">本周核心指标</div>
|
||||
<div style="color: rgb(30, 30, 30);font-size: 16px;font-weight: 400;line-height: 24px;">昨日核心指标</div>
|
||||
<div style="color: rgb(122, 121, 121);size: 12px;font-weight: 290;line-height: 22px;">时间</div>
|
||||
</div>
|
||||
<div style="padding-top: 20px;display: flex;">
|
||||
|
|
|
@ -134,7 +134,7 @@ export default {
|
|||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
this.$API.pm.mtask.delete.req(row.id).then((res) => {
|
||||
this.$API.mtm.material.delete.req(row.id).then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
|
|
|
@ -53,6 +53,13 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="出材率" prop="out_rate" min-width="80"></el-table-column>
|
||||
<el-table-column label="自动排产" min-width="80">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.is_count_utask" color="green">
|
||||
<CircleCheckFilled />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" @click="table_edit(scope.row)" v-auth="'mgroup.update'"
|
||||
|
|
|
@ -14,23 +14,11 @@ export default {
|
|||
data: [
|
||||
{number:'GZ20231012',model:'GB2',cate:'100*50*2',count:300,text: "一天任务",start_date: "2023-10-12",id:'2023101800',duration: 2,progress: 1},
|
||||
{number:'GZ20231013',model:'GB2',cate:'100*50*2',count:300,text: "一天任务",start_date: "2023-10-13",id:'2023101801',duration: 1,progress: 1},
|
||||
{number:'GZ20231014',model:'GB2',cate:'100*50*2',count:200, text: "一天任务",start_date: "2023-10-14",id:'2023101802',duration: 1,progress: 0.8},
|
||||
{number:'GZ20231015',model:'ZB2',cate:'100*50*2',count:100, text: "一天任务", start_date: "2023-10-15",id:'2023101803',duration: 1,progress: 0.6},
|
||||
{number:'GZ20231016',model:'GB2',cate:'100*50*2',count:50, text: "一天任务", start_date: "2023-10-16",id:'2023101804',duration: 1,progress: 0.4},
|
||||
{number:'GZ20231017',model:'GB2',cate:'100*50*2',count:0, text: "一天任务", start_date: "2023-10-17",id:'2023101805',duration: 1,progress: 0.2},
|
||||
{number:'GZ20231018',model:'GB2',cate:'100*50*2',count:300,text: "一天任务",start_date: "2023-10-18",id:'2023101806',duration: 1,progress: 1},
|
||||
{number:'GZ20231018',model:'GB2',cate:'100*50*2',count:200, text: "一天任务",start_date: "2023-10-19",id:'2023101807',duration: 1,progress: 0.8},
|
||||
{number:'GZ20231020',model:'ZB2',cate:'100*50*2',count:100, text: "一天任务", start_date: "2023-10-20",id:'2023101808',duration: 1,progress: 0.6},
|
||||
{number:'GZ20231021',model:'GB2',cate:'100*50*2',count:50, text: "一天任务", start_date: "2023-10-21",id:'2023101809',duration: 1,progress: 0.4},
|
||||
{number:'GZ20231022',model:'GB2',cate:'100*50*2',count:0, text: "一天任务", start_date: "2023-10-22",id:'20231018010',duration: 1,progress: 0.2},
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
var that = this;
|
||||
|
||||
},
|
||||
methods: {
|
||||
init(){
|
||||
//本地化
|
||||
|
@ -49,8 +37,7 @@ export default {
|
|||
},
|
||||
{name: 'beginTime',label: '开始日期', width: '100',align: 'center', template: function (obj) {return obj.beginTime;}},
|
||||
{name: 'endTime',label: '结束日期',width: '100',align: 'center',template: function (obj) {return obj.endTime;}},
|
||||
{name: 'limitTime',label: '工期',width: '100', align: 'center',template: function (obj) {return `${obj.limitTime}天`;}
|
||||
}
|
||||
{name: 'limitTime',label: '工期',width: '100', align: 'center',template: function (obj) {return `${obj.limitTime}天`;}}
|
||||
];
|
||||
gantt.config.data=[
|
||||
{ "id": "1635835705701744641", "text": "345分项工程分项工程分项工程", "start_date": "2022-12-01", "beginTime": "2022-12-01", "endTime": "2023-03-14", "limitTime": 103, "duration": 103, "progress": 1 },
|
||||
|
@ -67,12 +54,10 @@ export default {
|
|||
gantt.config.row_height = 44;
|
||||
//表头高度
|
||||
gantt.config.scale_height = 50;
|
||||
|
||||
//开启提示:鼠标悬浮在gantt行上显示
|
||||
gantt.plugins({
|
||||
tooltip: true
|
||||
});
|
||||
|
||||
//时间轴格式化模版
|
||||
var yearScaleTemplate = function (date) {
|
||||
return date.getFullYear();
|
||||
|
@ -102,14 +87,12 @@ export default {
|
|||
{ unit: 'month', step: 1, format: monthScaleTemplate, css: monthScaleCss },
|
||||
{ unit: 'day', step: 1, format: dayScaleTemplate, css: monthScaleCss }
|
||||
];
|
||||
|
||||
gantt.attachEvent('onGanttReady', function () {
|
||||
var tooltips = gantt.ext.tooltips;
|
||||
gantt.templates.tooltip_text = function (start, end, task) {
|
||||
return '任务编号:' + task.no + '<br/>Task:' + task.text + '<br/>Role:' + task.roleName + '<br/>Owner:' + task.ownerName + '<br/>计划开始时间:' + gantt.templates.tooltip_date_format(start) + '<br/>RCD:' + gantt.templates.tooltip_date_format(end);
|
||||
};
|
||||
});
|
||||
|
||||
//禁用双击事件
|
||||
gantt.config.details_on_dblclick = false;
|
||||
//关闭所有错误提示信息:gantt有自己的异常消息,如果不关闭可能页面会弹出异常消息
|
||||
|
@ -124,12 +107,10 @@ export default {
|
|||
gantt.config.drag_progress = false;
|
||||
//禁止拖放添加Link
|
||||
gantt.config.drag_links = false;
|
||||
|
||||
//开启标记
|
||||
gantt.plugins({
|
||||
marker: true
|
||||
});
|
||||
|
||||
//标记当前日期
|
||||
var dateToStr = gantt.date.date_to_str(gantt.config.task_date);
|
||||
var markerId = gantt.addMarker({
|
||||
|
@ -139,14 +120,14 @@ export default {
|
|||
title: dateToStr(new Date())
|
||||
});
|
||||
gantt.getMarker(markerId);
|
||||
|
||||
// 初始化
|
||||
gantt.init(this.$refs.gantt);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>html, body {
|
||||
<style scoped>
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
|
|
@ -8,7 +8,17 @@
|
|||
</div>
|
||||
<el-tabs v-model="activeName" class="demo-tabs">
|
||||
<el-tab-pane label="粗加工6车间" name="6车间">
|
||||
<scTable ref="table1" :apiObj="apiUtask" row-key="id" stripe :params="paramsUtask" :height="tableHeight" @selection-change="handleSelectionChange" hidePagination>
|
||||
<scTable
|
||||
ref="table1"
|
||||
:apiObj="apiUtask"
|
||||
row-key="id" stripe
|
||||
:params="paramsUtask"
|
||||
:height="tableHeight"
|
||||
@row-click="rowClick"
|
||||
@selection-change="handleSelectionChange"
|
||||
|
||||
hidePagination
|
||||
>
|
||||
<el-table-column type="selection" width="40" />
|
||||
<el-table-column type="index" width="40" />
|
||||
<el-table-column label="任务编号" prop="number">
|
||||
|
@ -244,17 +254,19 @@ export default {
|
|||
utaskDetail:[],
|
||||
tasks: {
|
||||
data: [
|
||||
{number:'GZ20231012',model:'GB2',cate:'100*50*2',count:300,text: "一天任务",start_date: "2023-10-12",id:'2023101800',duration: 2,progress: 1},
|
||||
{number:'GZ20231013',model:'GB2',cate:'100*50*2',count:300,text: "一天任务",start_date: "2023-10-13",id:'2023101801',duration: 1,progress: 1},
|
||||
{number:'GZ20231014',model:'GB2',cate:'100*50*2',count:200, text: "一天任务",start_date: "2023-10-14",id:'2023101802',duration: 1,progress: 0.8},
|
||||
{number:'GZ20231015',model:'ZB2',cate:'100*50*2',count:100, text: "一天任务", start_date: "2023-10-15",id:'2023101803',duration: 1,progress: 0.6},
|
||||
{number:'GZ20231016',model:'GB2',cate:'100*50*2',count:50, text: "一天任务", start_date: "2023-10-16",id:'2023101804',duration: 1,progress: 0.4},
|
||||
{number:'GZ20231017',model:'GB2',cate:'100*50*2',count:0, text: "一天任务", start_date: "2023-10-17",id:'2023101805',duration: 1,progress: 0.2},
|
||||
{number:'GZ20231018',model:'GB2',cate:'100*50*2',count:300,text: "一天任务",start_date: "2023-10-18",id:'2023101806',duration: 1,progress: 1},
|
||||
{number:'GZ20231018',model:'GB2',cate:'100*50*2',count:200, text: "一天任务",start_date: "2023-10-19",id:'2023101807',duration: 1,progress: 0.8},
|
||||
{number:'GZ20231020',model:'ZB2',cate:'100*50*2',count:100, text: "一天任务", start_date: "2023-10-20",id:'2023101808',duration: 1,progress: 0.6},
|
||||
{number:'GZ20231021',model:'GB2',cate:'100*50*2',count:50, text: "一天任务", start_date: "2023-10-21",id:'2023101809',duration: 1,progress: 0.4},
|
||||
{number:'GZ20231022',model:'GB2',cate:'100*50*2',count:0, text: "一天任务", start_date: "2023-10-22",id:'20231018010',duration: 1,progress: 0.2},
|
||||
// {
|
||||
// id:'2023101800',
|
||||
// number:'GZ20231012',
|
||||
// model:'GB2',
|
||||
// cate:'100*50*2',
|
||||
// count:300,
|
||||
// text: "一天任务",
|
||||
// start_date: "2023-11-2",
|
||||
// duration: 2,
|
||||
// progress: 1
|
||||
// },
|
||||
// {number:'GZ20231013',model:'GB2',cate:'100*50*2',count:300,text: "一天任务",start_date: "2023-11-3",id:'2023101801',duration: 1,progress: 1},
|
||||
// {number:'GZ20231014',model:'GB2',cate:'100*50*2',count:200, text: "一天任务",start_date: "2023-11-4",id:'2023101802',duration: 1,progress: 0.8},
|
||||
]
|
||||
},
|
||||
loading:false,
|
||||
|
@ -337,30 +349,62 @@ export default {
|
|||
this.$message.error('未选择任何订单明细项目')
|
||||
}
|
||||
},
|
||||
//获取甘特图数据
|
||||
getProjectTaskData() {
|
||||
this.ganttLoading = true;
|
||||
this.tasks.data = [];
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('url'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
projectId: this.projectId
|
||||
rowClick(row){
|
||||
//获取 mtask
|
||||
let that = this;
|
||||
that.tasks.data = [];
|
||||
this.$API.pm.mtask.list.req({utask:row.id}).then(res=>{
|
||||
// console.log(res.results)//获取甘特图数据
|
||||
let data = res.results;
|
||||
let arr = [];
|
||||
data.forEach(item=>{
|
||||
let obj = {};
|
||||
obj.id=item.id;
|
||||
obj.number=item.number;
|
||||
obj.count=item.count;
|
||||
obj.text = "一天任务",
|
||||
obj.cate='100*50*2',
|
||||
obj.start_date = item.start_date;
|
||||
obj.duration = 1;
|
||||
obj.progress = 1;
|
||||
obj.count_ok=item.count_ok;
|
||||
obj.count_real=item.count_real;
|
||||
obj.count_notok=item.count_notok;
|
||||
obj.state = item.state;
|
||||
obj.utask = item.utask;
|
||||
obj.mgroup_name = item.mgroup_name;
|
||||
obj.material_name = item.material_out_.name;
|
||||
obj.specification = item.material_out_.specification;
|
||||
console.log(obj)
|
||||
that.tasks.data.push(obj)
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data != null && data.code == 200) {
|
||||
this.tasks.data = data.res;
|
||||
console.log(that.tasks.data)
|
||||
// data.forEach(item=>{
|
||||
// let obj = {};
|
||||
// let progress = 0;
|
||||
// progress = item.count_ok/item.count;
|
||||
// obj.text = "一天任务",
|
||||
// obj.count_ok=item.count_ok;
|
||||
// obj.count_real=item.count_real;
|
||||
// obj.count_notok=item.count_notok;
|
||||
// obj.start_date=item.start_date;
|
||||
// obj.end_date=item.end_date;
|
||||
// obj.state = item.state;
|
||||
// obj.utask = item.utask;
|
||||
// obj.mgroup_name = item.mgroup_name;
|
||||
// obj.material_name = item.material_out_.name;
|
||||
// obj.specification = item.material_out_.specification;
|
||||
// arr.push(obj)
|
||||
// })
|
||||
// console.log(arr)
|
||||
// that.tasks.data = res.results;
|
||||
console.log('tasks:',that.tasks)
|
||||
// 数据解析:将数据解析到gantt列数据中
|
||||
gantt.parse(this.tasks);
|
||||
gantt.parse(that.tasks);
|
||||
// 刷新数据
|
||||
gantt.refreshData();
|
||||
this.ganttLoading = false;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
//自定义新增任务
|
||||
addTask(taskId) {
|
||||
var $this = this;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
<el-button type="primary" icon="el-icon-bottom-left" @click="importInspect">导入</el-button>
|
||||
<el-button type="primary" icon="el-icon-top" @click="importInspect">上传</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-date-picker
|
||||
|
@ -45,20 +45,30 @@
|
|||
</scTable>
|
||||
</el-main>
|
||||
<el-dialog
|
||||
title="导入"
|
||||
title="上传"
|
||||
destroy-on-close
|
||||
v-model="visible"
|
||||
@closed="closeVisible"
|
||||
@closed="visible = false"
|
||||
>
|
||||
<el-form ref="dialogForm" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="模板文件">
|
||||
<!-- <el-link :href="scope.row.file_.file" type="primary">{{ }}</el-link> -->
|
||||
<el-link href="" target="_blank" type="primary" style="margin-right:10px">模板一</el-link>
|
||||
<el-link href="" target="_blank" type="primary">模板二</el-link>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="导入文件" prop="file">
|
||||
|
||||
<el-input><span>{{ form.fileName }}</span></el-input>
|
||||
<el-form-item label="上传文件">
|
||||
<span>{{ form.fileName }}</span>
|
||||
<sc-upload-file
|
||||
v-model="form.file"
|
||||
:multiple="false"
|
||||
:limit="1"
|
||||
accept="xlsx"
|
||||
tip="文件不要超过10M,请上传xlsx格式文件"
|
||||
>
|
||||
<el-button type="primary" icon="el-icon-upload"
|
||||
>上传</el-button
|
||||
>
|
||||
</sc-upload-file>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-footer>
|
||||
|
@ -89,7 +99,7 @@
|
|||
fileName:'',
|
||||
},
|
||||
rules: {
|
||||
file:[{required:true, message:'请上传导入文件', trigger: "blur"}]
|
||||
file:[{required:true, message:'请上传上传文件', trigger: "blur"}]
|
||||
},
|
||||
visible:true,
|
||||
isSaveing:false,
|
||||
|
@ -98,6 +108,9 @@
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
importInspect(){
|
||||
this.visible = true;
|
||||
},
|
||||
submitFile(){
|
||||
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<!-- <el-card style="height: 100%;background-image: url('/img/elec_flow.png');background-size: contain;background-repeat: no-repeat;"> -->
|
||||
<el-card style="height: 100%;">
|
||||
<img src="/img/elec_flow.png" class="flowImg" style="max-height: 100%;width:50%;object-fit:contain;" >
|
||||
<img src="img/elec_flow.png" class="flowImg" style="max-height: 100%;width:50%;object-fit:contain;" >
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
@closed="$emit('closed')"
|
||||
>
|
||||
<!-- 混料工序 -->
|
||||
<el-form v-if="activeType=='混料工序'" ref="ruleForm" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form v-if="activeType=='8车间'" ref="dialogForm" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="产品规格" prop="material">
|
||||
<el-form-item label="工段" prop="material">
|
||||
<el-select
|
||||
v-model="form.cate"
|
||||
placeholder="产品规格"
|
||||
v-model="form.mgroup"
|
||||
placeholder="工段"
|
||||
clearable
|
||||
style="width:100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in cateOptions"
|
||||
v-for="item in mgroupOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
|
@ -27,30 +27,114 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="合格数量" width="100">
|
||||
<el-form-item label="产物" prop="material">
|
||||
<el-select
|
||||
v-model="form.material_out"
|
||||
placeholder="产物"
|
||||
clearable
|
||||
style="width:100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="设备" prop="material">
|
||||
<el-select
|
||||
v-model="form.equipment"
|
||||
placeholder="设备"
|
||||
clearable
|
||||
style="width:100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in equipmentOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="批次" width="100">
|
||||
<el-input v-model="form.batch" tyle="width:100%" placeholder="请输入批次"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="数量" width="100">
|
||||
<el-input-number
|
||||
v-model="form.count_use"
|
||||
v-model="form.count_real"
|
||||
controls-position="right"
|
||||
:min="0" step="1"
|
||||
:step-strictly="true"
|
||||
style="width:100%"
|
||||
placeholder="请输入合格数量">
|
||||
placeholder="请输入数量">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="重量" width="100">
|
||||
<el-input-number
|
||||
v-model="form.count_real_eweight"
|
||||
controls-position="right"
|
||||
:min="0" step="1"
|
||||
:step-strictly="true"
|
||||
style="width:100%"
|
||||
placeholder="请输入重量">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="配料人" prop="material">
|
||||
<el-select
|
||||
v-model="handle_user"
|
||||
placeholder="配料人"
|
||||
clearable
|
||||
multiple
|
||||
style="width:100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- 七车间 -->
|
||||
<el-form v-if="activeType=='7车间'" ref="ruleForm" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="炉号">
|
||||
<el-form-item label="锅号">
|
||||
<el-select
|
||||
v-model="form.cate"
|
||||
placeholder="炉号"
|
||||
v-model="form.equipment"
|
||||
placeholder="锅号"
|
||||
clearable
|
||||
style="width:100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in equipmentOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="第几锅">
|
||||
<el-select
|
||||
v-model="form.index"
|
||||
placeholder="第几锅"
|
||||
clearable
|
||||
style="width:100%"
|
||||
>
|
||||
|
@ -64,15 +148,20 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="第几锅">
|
||||
<el-input-number
|
||||
v-model="form.count_use"
|
||||
controls-position="right"
|
||||
:min="0" step="1"
|
||||
:step-strictly="true"
|
||||
<el-form-item label="产品名称" prop="material">
|
||||
<el-select
|
||||
v-model="form.material_out"
|
||||
placeholder="产品名称"
|
||||
clearable
|
||||
style="width:100%"
|
||||
placeholder="第几锅">
|
||||
</el-input-number>
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
|
@ -92,10 +181,22 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="产品编号">
|
||||
<el-input-number
|
||||
v-model="form.count_real"
|
||||
controls-position="right"
|
||||
:min="0" step="1"
|
||||
:step-strictly="true"
|
||||
style="width:100%"
|
||||
placeholder="请输入批次号">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="配粉料数(kg)">
|
||||
<el-input-number
|
||||
v-model="form.count_use"
|
||||
v-model="form.count_real_eweight"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
|
@ -106,26 +207,38 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="产出数量">
|
||||
<el-form-item label="生产量">
|
||||
<el-input-number
|
||||
v-model="form.count_use"
|
||||
v-model="form.count_real"
|
||||
controls-position="right"
|
||||
:min="0" step="1"
|
||||
:step-strictly="true"
|
||||
style="width:100%"
|
||||
placeholder="请输入产出数量">
|
||||
placeholder="生产量">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="合格数量">
|
||||
<el-form-item label="合格量">
|
||||
<el-input-number
|
||||
v-model="form.count_use"
|
||||
v-model="form.count_ok"
|
||||
controls-position="right"
|
||||
:min="0" step="1"
|
||||
:step-strictly="true"
|
||||
style="width:100%"
|
||||
placeholder="请输入合格数量">
|
||||
placeholder="合格量">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="合格率">
|
||||
<el-input-number
|
||||
v-model="form.count_ok"
|
||||
controls-position="right"
|
||||
:min="0" step="1"
|
||||
:step-strictly="true"
|
||||
style="width:100%"
|
||||
placeholder="合格率">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -167,7 +280,7 @@
|
|||
<el-col :md="12" :sm="24">
|
||||
<el-form-item prop="type" label="成型人">
|
||||
<el-select
|
||||
v-model="form.shift"
|
||||
v-model="form.handle_user"
|
||||
placeholder="成型人"
|
||||
clearable
|
||||
style="width:100%"
|
||||
|
@ -184,7 +297,7 @@
|
|||
<el-col :md="12" :sm="24">
|
||||
<el-form-item prop="type" label="切料人">
|
||||
<el-select
|
||||
v-model="form.shift"
|
||||
v-model="form.handle_user"
|
||||
placeholder="切料人"
|
||||
clearable
|
||||
style="width:100%"
|
||||
|
@ -240,7 +353,7 @@
|
|||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="合格数量" width="100">
|
||||
<el-input-number
|
||||
v-model="form.count_use"
|
||||
v-model="form.count_ok"
|
||||
controls-position="right"
|
||||
:min="0" step="1"
|
||||
:step-strictly="true"
|
||||
|
@ -252,7 +365,7 @@
|
|||
<el-col :md="12" :sm="24">
|
||||
<el-form-item prop="type" label="成型人">
|
||||
<el-select
|
||||
v-model="form.cxr"
|
||||
v-model="form.handle_user"
|
||||
placeholder="成型人"
|
||||
clearable
|
||||
style="width:100%"
|
||||
|
@ -269,7 +382,7 @@
|
|||
<el-col :md="12" :sm="24">
|
||||
<el-form-item prop="type" label="带班人">
|
||||
<el-select
|
||||
v-model="form.shift"
|
||||
v-model="form.handle_leader"
|
||||
placeholder="带班人"
|
||||
clearable
|
||||
style="width:100%"
|
||||
|
@ -286,14 +399,13 @@
|
|||
</el-row>
|
||||
</el-form>
|
||||
<el-footer>
|
||||
<el-button type="primary" v-loading="isSaveing" @click="submit">提交</el-button>
|
||||
<el-button @click="resetForm">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
|
||||
</el-footer>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { index } from 'd3';
|
||||
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
props:{
|
||||
|
@ -310,20 +422,31 @@ import { index } from 'd3';
|
|||
edit: "编辑记录",
|
||||
show: "查看记录",
|
||||
},
|
||||
handle_user:[],
|
||||
form:{},
|
||||
options:[],
|
||||
userList:[],
|
||||
cateOptions:[],
|
||||
mgroupOptions:[],
|
||||
materialOptions:[],
|
||||
equipmentOptions:[],
|
||||
shiftOptions:['白班','夜班'],
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
setFiltersVisible: false,
|
||||
handle_name:'',
|
||||
leader_name:''
|
||||
leader_name:'',
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getMaterial();
|
||||
this.getUserList();
|
||||
this.getEquipment();
|
||||
this.getMgroupList();
|
||||
let date = new Date();
|
||||
let year = date.getFullYear();
|
||||
let month = date.getMonth()+1;
|
||||
let day = date.getDate();
|
||||
this.form.handle_date = year+'-'+month+'-'+day;
|
||||
},
|
||||
methods: {
|
||||
getUserList(){
|
||||
|
@ -332,47 +455,69 @@ import { index } from 'd3';
|
|||
that.userList = res;
|
||||
});
|
||||
},
|
||||
getReceptionist(data) {
|
||||
this.form.handle_user=data.id;
|
||||
this.handle_name=data.name
|
||||
//获取集合列表
|
||||
getMgroupList(){
|
||||
let that = this;
|
||||
this.$API.mtm.mgroup.list.req({page:0,cate:'photon'}).then(res=>{
|
||||
let data = res.filter(item=>{
|
||||
return item.process_cate=='成型'
|
||||
})
|
||||
that.mgroupOptions = data;
|
||||
})
|
||||
},
|
||||
getLeader(data){
|
||||
this.form.leader_user=data.id;
|
||||
this.leader_name=data.name
|
||||
//获取设备列表
|
||||
getEquipment(){
|
||||
this.$API.em.equipment.list.req({page:0,type:10}).then(res=>{
|
||||
this.equipmentOptions = res;
|
||||
})
|
||||
},
|
||||
getMaterial(){
|
||||
let obj ={};
|
||||
obj.page = 0;
|
||||
obj.type = 20;
|
||||
obj.is_hidden = false;
|
||||
this.$API.mtm.material.list.req(obj).then(res=>{
|
||||
this.materialOptions = res;
|
||||
})
|
||||
},
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
|
||||
return this;
|
||||
},
|
||||
getList(){
|
||||
this.$API.mtm.material.list.req({page:0}).then(res=>{
|
||||
this.options = res;
|
||||
})
|
||||
},
|
||||
//提交
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
try {
|
||||
var res;
|
||||
if(this.mtask!==''){
|
||||
this.form.mtask = this.mtask;
|
||||
if (this.mode == "add") {
|
||||
res = await this.$API.pum.planitem.create.req(this.form);
|
||||
} else if (this.mode == "edit") {
|
||||
res = await this.$API.pum.planitem.update.req(this.form.id,this.form);
|
||||
}else{
|
||||
this.form.handle_user = this.handle_user.join(',');
|
||||
}
|
||||
if (this.mode == "add") {
|
||||
this.$API.wpm.mlog.create.req(this.form).then(res=>{
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
} catch (err) {
|
||||
}).catch( (err) =>{
|
||||
//可以处理校验错误
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
})
|
||||
} else if (this.mode == "edit") {
|
||||
this.$API.wpm.mlog.update.req(this.form.id,this.form).then(res=>{
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
}).catch( (err) =>{
|
||||
//可以处理校验错误
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -380,6 +525,14 @@ import { index } from 'd3';
|
|||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form, data);
|
||||
if(this.activeType=='8车间'){
|
||||
if(this.form.handle_user.indexOf(',')>-1){
|
||||
this.handle_user = this.form.handle_user.split(',')
|
||||
}else{
|
||||
this.handle_user = [this.form.handle_user];
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
<el-container style="flex-direction: column">
|
||||
<el-main id="topContainer" class="nopadding" style="position: relative;height: 50%;margin-bottom: 10px;">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12" style="border-right: 1px solid #eeeeee;position: relative;">
|
||||
<div class="right-panel" style=" display: inline-block;position: absolute;right: 20px;margin-top: 4px;z-index:100">
|
||||
|
||||
<el-col :span="activeSpan" style="border-right: 1px solid #eeeeee;position: relative;">
|
||||
<div class="right-panel" v-if="activeName=='8车间'" style="display: inline-block;position:absolute;right:20px;margin-top:4px;z-index:100">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="混料工序" name="8车间">
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
ref="table8"
|
||||
:apiObj="apiObj8"
|
||||
row-key="id"
|
||||
stripe
|
||||
:height="tableHeight"
|
||||
|
@ -19,27 +19,48 @@
|
|||
hideDo
|
||||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
|
||||
<el-table-column label="送料日期" prop="handle_date">
|
||||
</el-table-column>
|
||||
<el-table-column label="型号" prop="number">
|
||||
<el-table-column label="产物" prop="material" show-overflow-tooltip>
|
||||
<template #default="scope"><span v-if="scope.row.material_out_">{{ scope.row.material_out_.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" prop="number">
|
||||
<el-table-column label="工段" prop="material" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划量" prop="count">
|
||||
<el-table-column label="设备" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="日均量" prop="count">
|
||||
<el-table-column label="批次" prop="end_date">
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" prop="start_date">
|
||||
<el-table-column label="数量/桶数" prop="count_real">
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" prop="end_date">
|
||||
<el-table-column label="每桶重量/kg" prop="count_real_eweight">
|
||||
</el-table-column>
|
||||
<el-table-column label="完成量" prop="count">
|
||||
<el-table-column label="配料人" prop="count">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="left">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
type="primary"
|
||||
@click="table_edit(scope.row)"
|
||||
v-auth="'equipment'"
|
||||
>
|
||||
编辑
|
||||
</el-link>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-link
|
||||
type="danger"
|
||||
@click="table_del(scope.row,'8车间')"
|
||||
v-auth="'equipment'"
|
||||
>
|
||||
删除
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="7车间" name="7车间">
|
||||
<scTable
|
||||
ref="table"
|
||||
ref="table7"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
stripe
|
||||
|
@ -86,7 +107,7 @@
|
|||
</el-tab-pane>
|
||||
<el-tab-pane label="10车间" name="10车间">
|
||||
<scTable
|
||||
ref="table"
|
||||
ref="table10"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
stripe
|
||||
|
@ -94,9 +115,13 @@
|
|||
:params="params10"
|
||||
hidePagination
|
||||
hideDo
|
||||
@row-click="rowClick"
|
||||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="型号" prop="number">
|
||||
</el-table-column>
|
||||
|
@ -116,7 +141,7 @@
|
|||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="12" v-if="activeName!=='8车间'">
|
||||
<el-form label-width="100px" style="border-bottom: 1px solid #eeeeee;padding: 4px 0;">
|
||||
<el-row>
|
||||
<el-col :md="8" :sm="12" :xs="24">
|
||||
|
@ -334,6 +359,7 @@ export default {
|
|||
date:'2023-10-24'
|
||||
},
|
||||
apiObj: null,
|
||||
apiObj8:null,
|
||||
params10: {
|
||||
belong_dept_name:'10车间',
|
||||
date:'2023-10-20'
|
||||
|
@ -356,6 +382,7 @@ export default {
|
|||
},
|
||||
choseData:{},
|
||||
mtask:'',
|
||||
activeSpan:24,
|
||||
rightHeight:null,
|
||||
tableHeight:null,
|
||||
formList:[
|
||||
|
@ -388,30 +415,16 @@ export default {
|
|||
this.params8.date = NowDate.getFullYear()+'-'+(NowDate.getMonth()+1)+'-'+NowDate.getDate();
|
||||
this.params10.date = NowDate.getFullYear()+'-'+(NowDate.getMonth()+1)+'-'+NowDate.getDate();
|
||||
this.apiObj = this.$API.pm.mtask.daylist;
|
||||
this.apiObj8 = this.$API.wpm.mlog.list;
|
||||
},
|
||||
methods: {
|
||||
//获取甘特图数据
|
||||
getProjectTaskData() {
|
||||
this.ganttLoading= true;
|
||||
this.tasks.data = [];
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('url'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
projectId: this.projectId
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data != null && data.code == 200) {
|
||||
this.tasks.data = data.res;
|
||||
// 数据解析:将数据解析到gantt列数据中
|
||||
gantt.parse(this.tasks);
|
||||
// 刷新数据
|
||||
gantt.refreshData();
|
||||
this.ganttLoading= false;
|
||||
handleClick(val){
|
||||
console.log(val.index);
|
||||
if(val.index==0){
|
||||
this.activeSpan = 24
|
||||
}else{
|
||||
this.$message.error(data.msg);
|
||||
this.activeSpan = 12
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//自定义新增任务
|
||||
|
@ -447,16 +460,27 @@ export default {
|
|||
});
|
||||
},
|
||||
//删除
|
||||
async table_del(row) {
|
||||
async table_del(row,type) {
|
||||
|
||||
this.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
if(type=='8车间'){
|
||||
this.$API.wpm.mlog.delete.req(row.id).then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}else{
|
||||
this.$API.pm.mtask.delete.req(row.id).then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}
|
||||
|
||||
}).catch(() => {});
|
||||
},
|
||||
//合计
|
||||
|
@ -468,11 +492,9 @@ export default {
|
|||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
if (mode == "add") {
|
||||
this.$refs.table.refresh();
|
||||
} else if (mode == "edit") {
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
this.$refs.table7.refresh();
|
||||
this.$refs.table8.refresh();
|
||||
this.$refs.table10.refresh();
|
||||
},
|
||||
handleQuery() {
|
||||
// this.$refs.table.queryData(this.query)
|
||||
|
|
|
@ -177,7 +177,7 @@
|
|||
isedit:true,
|
||||
change:true
|
||||
}
|
||||
this.formList.push(obj);
|
||||
this.relatedList.push(obj);
|
||||
// this.dialog.save = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.saveDialog.open("add");
|
||||
|
|
Loading…
Reference in New Issue