test #47

Merged
gtz217 merged 273 commits from test into master 2023-10-17 08:53:54 +08:00
8 changed files with 67 additions and 17 deletions
Showing only changes of commit 69bdab75d4 - Show all commits

View File

@ -72,9 +72,11 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="工段排序" prop="sort"> <el-form-item label="工段排序" prop="sort">
<el-input <el-input-number
v-model="dataForm.sort" v-model="dataForm.sort"
filterable filterable
min="0"
max="100"
@change="$emit('update', dataForm)" @change="$emit('update', dataForm)"
placeholder="请输入工段排序" /> placeholder="请输入工段排序" />
</el-form-item> </el-form-item>

View File

@ -134,6 +134,8 @@ export default {
label: '工段', label: '工段',
placeholder: '请选择工段', placeholder: '请选择工段',
param: 'workshopSectionId', param: 'workshopSectionId',
selectOptions: [],
filterable: true
}, },
{ {
type: 'input', type: 'input',
@ -239,8 +241,24 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.initWorksection();
}, },
methods: { methods: {
/** 准备工段数据 */
async initWorksection() {
const { code, data } = await this.$axios({
url: '/base/workshop-section/listAll',
method: 'get',
});
if (code == 0) {
this.searchBarFormConfig[0].selectOptions = data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
}
},
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -323,7 +341,7 @@ export default {
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否确认删除工段设备绑定编号为"' + id + '"的数据项?') .confirm('是否确认删除工段设备绑定设备名称为"' + row.equipment + '"的数据项?')
.then(function () { .then(function () {
return deleteEquipmentBindSection(id); return deleteEquipmentBindSection(id);
}) })

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2023-08-02 15:12:42 * @Date: 2023-08-02 15:12:42
* @LastEditors: zwq * @LastEditors: DY
* @LastEditTime: 2023-08-03 14:24:36 * @LastEditTime: 2023-10-10 16:49:03
* @Description: * @Description:
--> -->
<template> <template>
@ -81,6 +81,7 @@ export default {
}; };
getProductPage(params).then((response) => { getProductPage(params).then((response) => {
this.tableProps[1].list = response.data.list; this.tableProps[1].list = response.data.list;
console.log('打印', this.tableProps[1].list)
}); });
}, },
methods: { methods: {

View File

@ -1,8 +1,8 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2023-08-03 14:09:18 * @Date: 2023-08-03 14:09:18
* @LastEditors: zwq * @LastEditors: DY
* @LastEditTime: 2023-08-03 14:51:16 * @LastEditTime: 2023-10-10 16:54:09
* @Description: * @Description:
--> -->
<template> <template>
@ -48,6 +48,9 @@ export default {
visible: false, visible: false,
}; };
}, },
mounted() {
console.log('hello', this.list)
},
methods: { methods: {
changeInput() { changeInput() {
const data = { const data = {

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-08-29 14:59:29 * @Date: 2023-08-29 14:59:29
* @LastEditTime: 2023-09-27 16:19:56 * @LastEditTime: 2023-10-09 09:08:08
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -308,8 +308,8 @@ export default {
this.listQuery.pageSize = 10; this.listQuery.pageSize = 10;
this.listQuery.lineId = val.line ? val.line : undefined; this.listQuery.lineId = val.line ? val.line : undefined;
this.listQuery.reportType = val.reportType ? val.reportType : undefined; this.listQuery.reportType = val.reportType ? val.reportType : undefined;
this.listQuery.reportStartTime = [new Date(val.timeVal[0]).getTime()]; this.listQuery.reportStartTime = val.timeVal ? [new Date(val.timeVal[0]).getTime()] : undefined;
this.listQuery.reportEndTime = [new Date(val.timeVal[1]).getTime()]; this.listQuery.reportEndTime = val.timeVal ? [new Date(val.timeVal[1]).getTime()] : undefined;
this.getDataList(); this.getDataList();
break; break;
case 'export': case 'export':

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-08-29 14:59:29 * @Date: 2023-08-29 14:59:29
* @LastEditTime: 2023-09-27 16:23:44 * @LastEditTime: 2023-10-09 15:14:42
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -110,6 +110,7 @@ export default {
showData: [], showData: [],
tableData: [], tableData: [],
selectedList: [], selectedList: [],
fileName: [],
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
@ -155,13 +156,14 @@ export default {
} }
// const time = new Date() // const time = new Date()
// this.formConfig[1].defaultSelect = [time, time] // this.formConfig[1].defaultSelect = [time, time]
this.getDataList() // this.getDataList()
this.getPdLineList() this.getPdLineList()
}, },
methods: { methods: {
test() { test() {
var target = document.getElementsByClassName("right-aside")[0] var target = document.getElementsByClassName("right-aside")[0]
target.style.background = '#FFFFFF' target.style.background = '#FFFFFF'
var that = this
setTimeout(() => { setTimeout(() => {
html2canvas(target).then(function(canvas) { html2canvas(target).then(function(canvas) {
var contentWidth = canvas.width var contentWidth = canvas.width
@ -197,7 +199,7 @@ export default {
} }
} }
pdf.save('产线统计数据查询报表.pdf') pdf.save(that.fileName[0] + '-' + that.fileName[1] + '_产线产量.pdf')
}) })
}, 300) }, 300)
}, },
@ -220,7 +222,7 @@ export default {
try { try {
FileSaver.saveAs(new Blob([exportTableOut], { FileSaver.saveAs(new Blob([exportTableOut], {
type: 'application/octet-stream' type: 'application/octet-stream'
}), '产线统计数据查询报表.xlsx') }), this.fileName[0] + '-' + this.fileName[1] + '_产线产量.xlsx')
} catch (e) { } catch (e) {
if (typeof console !== 'undefined') console.log(e, exportTableOut) if (typeof console !== 'undefined') console.log(e, exportTableOut)
} }
@ -263,7 +265,17 @@ export default {
this.listQuery.proLineId = val.line ? val.line : undefined; this.listQuery.proLineId = val.line ? val.line : undefined;
this.listQuery.startTime = val.timeVal ? new Date(val.timeVal[0]).getTime() : undefined; this.listQuery.startTime = val.timeVal ? new Date(val.timeVal[0]).getTime() : undefined;
this.listQuery.endTime = val.timeVal ? new Date(val.timeVal[1]).getTime() : undefined; this.listQuery.endTime = val.timeVal ? new Date(val.timeVal[1]).getTime() : undefined;
console.log('nihc 你好', val.timeVal)
if (val.timeVal && val.timeVal.length > 0) {
this.fileName[0] = val.timeVal[0].slice(0, 10)
this.fileName[1] = val.timeVal[1].slice(0, 10)
this.getDataList(); this.getDataList();
} else {
this.$message({
message: '请选择时间',
type: 'warning'
});
}
break; break;
case 'export': case 'export':
this.handleExport(); this.handleExport();

View File

@ -7,7 +7,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<SearchBar <SearchBar
:formConfigs="[{ label: '设备近24小时产线生产数据', type: 'title' }]" :formConfigs="[{ label: '近24小时产线生产数据', type: 'title' }]"
ref="search-bar" /> ref="search-bar" />
<el-skeleton v-if="initing" :rows="6" animated /> <el-skeleton v-if="initing" :rows="6" animated />
<!-- :span-method="mergeColumnHandler" --> <!-- :span-method="mergeColumnHandler" -->
@ -150,11 +150,13 @@ export default {
prop: 'proLineName', prop: 'proLineName',
label: '生产线', label: '生产线',
align: 'center', align: 'center',
fixed: 'left'
}, },
{ {
prop: 'spec', prop: 'spec',
label: '产品规格', label: '产品规格',
align: 'center', align: 'center',
fixed: 'left'
} }
] ]
this.buildProps(res.data.nameData); this.buildProps(res.data.nameData);

View File

@ -96,9 +96,11 @@ export default {
sectionId: undefined, sectionId: undefined,
startTime: undefined, startTime: undefined,
endTime: undefined, endTime: undefined,
total: 0
}, },
dataListLoading: false, dataListLoading: false,
dialogVisible: false, dialogVisible: false,
fileName: [],
optionArrUrl: [getProductionLinePage, getWorkshopSectionPage], optionArrUrl: [getProductionLinePage, getWorkshopSectionPage],
formConfig: [ formConfig: [
{ {
@ -146,7 +148,7 @@ export default {
}, },
created() { created() {
this.getArr(); this.getArr();
this.getDataList() // this.getDataList()
}, },
methods: { methods: {
test() { test() {
@ -291,7 +293,17 @@ export default {
this.listQuery.sectionId = val.sectionId ? val.sectionId : undefined this.listQuery.sectionId = val.sectionId ? val.sectionId : undefined
this.listQuery.startTime = val.timeSlot ? new Date(val.timeSlot[0]).getTime() : undefined this.listQuery.startTime = val.timeSlot ? new Date(val.timeSlot[0]).getTime() : undefined
this.listQuery.endTime = val.timeSlot ? new Date(val.timeSlot[1]).getTime() : undefined this.listQuery.endTime = val.timeSlot ? new Date(val.timeSlot[1]).getTime() : undefined
this.getDataList(); this.fileName[0] = val.timeSlot[0]
this.fileName[1] = val.timeSlot[1]
console.log('wfjmmki文件名称', this.fileName)
if (val.timeSlot) {
this.getDataList()
} else {
this.$message({
message: '请选择时间',
type: 'warning'
});
}
break; break;
case 'reset': case 'reset':
this.$refs.searchBarForm.resetForm(); this.$refs.searchBarForm.resetForm();