Merge remote-tracking branch 'origin/master'

yangwl
wws 11 months ago
commit 9b6faad2ff

@ -52,6 +52,7 @@
"quill": "1.3.7", "quill": "1.3.7",
"screenfull": "5.0.2", "screenfull": "5.0.2",
"sortablejs": "1.10.2", "sortablejs": "1.10.2",
"v-scale-screen": "^1.0.2",
"vue": "2.6.12", "vue": "2.6.12",
"vue-count-to": "1.0.13", "vue-count-to": "1.0.13",
"vue-cropper": "0.5.5", "vue-cropper": "0.5.5",

@ -81,4 +81,20 @@ export function getLineChartData() {
method: 'get' method: 'get'
}); });
} }
//查询设备小时表头
export function getHourProductionTitle(query) {
return request({
url: '/mes/reportWork/getHourProductionTitle',
method: 'get',
params: query
});
}
// 查询设备小时产量
export function getHourProductionList(query) {
return request({
url: '/mes/reportWork/getHourProductionList',
method: 'get',
params: query
});
}

@ -41,8 +41,10 @@ import VueMeta from 'vue-meta'
import DictData from '@/components/DictData' import DictData from '@/components/DictData'
// 打印插件 // 打印插件
import Print from 'print-js' import Print from 'print-js'
import VScaleScreen from 'v-scale-screen'
// 全局方法挂载 // 全局方法挂载
Vue.prototype.$echarts = echarts Vue.prototype.$echarts = echarts
Vue.prototype.getDicts = getDicts Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey Vue.prototype.getConfigKey = getConfigKey
@ -63,6 +65,7 @@ Vue.component('FileUpload', FileUpload)
Vue.component('ImageUpload', ImageUpload) Vue.component('ImageUpload', ImageUpload)
Vue.component('ImagePreview', ImagePreview) Vue.component('ImagePreview', ImagePreview)
Vue.use(VScaleScreen)
Vue.use(directive) Vue.use(directive)
Vue.use(plugins) Vue.use(plugins)
Vue.use(VueMeta) Vue.use(VueMeta)

@ -1,4 +1,5 @@
<template> <template>
<v-scale-screen width="1920" height="1080" :fullScreen="false">
<div class="app-container home" style="height: 100vh; overflow: hidden"> <div class="app-container home" style="height: 100vh; overflow: hidden">
<div class="head"> <div class="head">
<div class="head-content"> <div class="head-content">
@ -7,6 +8,13 @@
<div class="head-logo"> <div class="head-logo">
<img src="../../../assets/images/logo.png" alt="" /> <img src="../../../assets/images/logo.png" alt="" />
</div> </div>
<div class="back">
<el-button
@click="back()"
type="primary"
icon="el-icon-s-home"
></el-button>
</div>
</div> </div>
<div class="content-top"> <div class="content-top">
<div class="factory"> <div class="factory">
@ -147,6 +155,7 @@
<!-- <div class="item"></div> --> <!-- <div class="item"></div> -->
</div> </div>
</div> </div>
</v-scale-screen>
</template> </template>
<script> <script>
@ -189,17 +198,25 @@ export default {
optionDatalist3: [], optionDatalist3: [],
optionDatalist4: [], optionDatalist4: [],
colorlist: ["#005aff", "#f8b551"], colorlist: ["#005aff", "#f8b551"],
datetime: "", datetime: null,
time1: null,
}; };
}, },
created() {}, created() {},
destroyed(){
clearInterval(this.time1)
this.time1 = null
},
mounted() { mounted() {
this.datetime = moment().subtract(2, "day").format("yyyy-MM-DD"); // this.datetime = moment().subtract(2, "day").format("yyyy-MM-DD");
//console.log('zhuanhuahou',this.dateRangeone) //console.log('zhuanhuahou',this.dateRangeone)
this.selectFactorylist(); this.selectFactorylist();
this.gettime(); this.gettime();
}, },
methods: { methods: {
back() {
this.$router.push({ path: "/index" });
},
gettime() { gettime() {
this.gettimedata = moment().format("YYYY-MM-DD HH:mm:ss "); this.gettimedata = moment().format("YYYY-MM-DD HH:mm:ss ");
setInterval(() => { setInterval(() => {
@ -214,6 +231,9 @@ export default {
this.getLineList = response.data; this.getLineList = response.data;
this.selectxt = this.getLineList[0].parentName; this.selectxt = this.getLineList[0].parentName;
this.initChart1(); this.initChart1();
this.time1 = setInterval(() => {
this.initChart1();
}, 1000 * 60 * 1);
// this.initChart2(); // this.initChart2();
// this.initChart3(); // this.initChart3();
// this.initChart4(); // this.initChart4();
@ -1650,6 +1670,11 @@ export default {
// width: ; // width: ;
} }
} }
.back {
position: absolute;
right: 0px;
top: 5px;
}
} }
.content-top { .content-top {
display: flex; display: flex;
@ -1797,4 +1822,9 @@ export default {
/*给自定义的图标实现点击下来功能*/ /*给自定义的图标实现点击下来功能*/
pointer-events: none; pointer-events: none;
} }
::v-deep .el-button--primary {
color: #ffffff;
background-color: #325e82;
border-color: #0a0f19;
}
</style> </style>

@ -0,0 +1,260 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
<el-form-item label="生产时间段" prop="productDateArray">
<el-date-picker
v-model="queryParams.productDateArray"
format="yyyy-MM-dd HH:00:00"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="工单编号" prop="workorderCode">
<el-input
v-model="queryParams.workorderCode"
placeholder="请输入工单编号"
clearable
/>
</el-form-item>
<el-form-item label="订单编码" prop="orderCode">
<el-input
v-model="queryParams.orderCode"
placeholder="请输入订单编号"
clearable
/>
</el-form-item>
<el-form-item label="产品编号" prop="productCode">
<el-input
v-model="queryParams.productCode"
placeholder="请输入产品编码"
clearable
/>
</el-form-item>
<el-form-item label="产品名称" prop="productName">
<el-input
v-model="queryParams.productName"
placeholder="请输入产品名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="equName">
<el-input
v-model="queryParams.equName"
placeholder="请输入设备名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="hourProList"
:summary-method="getSummaries"
show-summary
>
<el-table-column label="设备编码" align="center" prop="equCode" min-width="100" />
<el-table-column label="设备名称" align="center" prop="equName" min-width="100" />
<template v-for="(column, index) in showTitles">
<el-table-column align="center" min-width="120" :prop="column.id" :key="column.id" :label="column.titleName"/>
</template>
</el-table>
</div>
</template>
<script>
import {getHourProductionTitle, getHourProductionList} from "@/api/mes/reportWork";
import moment from 'moment';
export default {
name: "Prepare",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
hourProList: [],
showTitles:[],//
//
title: "",
//
open: false,
//
queryParams: {
productDateArray: [],
pageNum: 1,
pageSize: 10,
workorderCode: null,
workorderName: null,
parentOrder: null,
orderId: null,
orderCode: null,
productId: null,
productCode: null,
prodType: null,
productName: null,
productSpc: null,
productDate: null,
},
//
form: {}
};
},
created() {
this.getDate();
this.getList();
},
methods: {
/**获取默认查询时间段**/
getDate() {
let start = this.Fungetdate (0)
let end = this.Fungetdate (1)
this.queryParams.productDateArray.push(start,end)
},
Fungetdate (num) {
var dd = new Date();
dd.setDate(dd.getDate() + num);
var y = dd.getFullYear();
var m = dd.getMonth() + 1;//
var d = dd.getDate();
return y + "-" + m + "-" + d+" 00:00:00";
},
/** 查询设备小时产量列表 */
getList() {
if(this.queryParams.productDateArray!=null){
this.queryParams.productDateStart = moment(this.queryParams.productDateArray[0]).format('YYYY-MM-DD HH:00:00');
this.queryParams.productDateEnd = moment(this.queryParams.productDateArray[1]).format('YYYY-MM-DD HH:00:00');
}
this.loading = true;
//Table
getHourProductionTitle(this.queryParams).then(response => {
this.showTitles = [];
for(let i=0;i<=response.length-1;i++){
var pobj={};
pobj.id="hourPro"+i;
pobj.titleName = response[i]+"时";
this.showTitles.push(pobj)
}
});
//Table
getHourProductionList(this.queryParams).then(response => {
this.hourProList = response;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
prepareId: null,
workorderCode: null,
workorderName: null,
parentOrder: null,
orderId: null,
orderCode: null,
productId: null,
productCode: null,
prodType: null,
productName: null,
productSpc: null,
wetDetailPlanId: null,
productDate: null,
shiftId: null,
ancestors: null,
status: null,
remark: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
factoryCode: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 导出按钮操作 */
handleExport() {
this.download('mes/reportWork/processFinishExport', {
...this.queryParams
}, `processFinish_${new Date().getTime()}.xlsx`)
},
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += '';
if(sums[index] > 1000000){
sums[index] = '';
}
} else {
sums[index] = '';//N/A
}
});
return sums;
}
}
};
</script>

@ -43,7 +43,7 @@
<el-form-item label="设备名称" prop="equName"> <el-form-item label="设备名称" prop="equName">
<el-input <el-input
v-model="queryParams.equName" v-model="queryParams.equName"
placeholder="请输入规格型号" placeholder="请输入设备名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
@ -63,7 +63,6 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['mes:prepare:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>

Loading…
Cancel
Save