2024-01-8 MES-完产清线点检

master
元气满满(jgy) 6 months ago
parent a778acb5a7
commit c892d0ffb5

@ -37,7 +37,7 @@ export function getProductList(query) {
}); });
} }
// 修改表头表尾部记录 // 修改
export function updateTable(data) { export function updateTable(data) {
return request({ return request({
url: '/mes/inspectionReport/updateTable', url: '/mes/inspectionReport/updateTable',
@ -46,8 +46,15 @@ export function updateTable(data) {
}); });
} }
// 修改点检
export function updatePointInspectionTable(data) {
return request({
url: '/mes/inspectionReport/updatePointInspectionTable',
method: 'put',
data: data
});
}
// 查询组线列表
export function getWorkList(query) { export function getWorkList(query) {
return request({ return request({
url: '/mes/inspectionReport/getWorkList', url: '/mes/inspectionReport/getWorkList',
@ -83,12 +90,3 @@ export function listPointInspection(query) {
params: query params: query
}) })
} }
// 查询点检listCheckBox
export function listCheckBox(query) {
return request({
url: '/mes/inspectionReport/listCheckBox',
method: 'get',
params: query
})
}

@ -19,7 +19,7 @@
<div class="formCode">表单编号:08GL05C001-014A</div> <div class="formCode">表单编号:08GL05C001-014A</div>
<br /> <br />
<el-row> <el-row>
<el-col :span="9"> <el-col :span="8">
<div> <div>
生产产线: 生产产线:
<el-select <el-select
@ -27,6 +27,7 @@
filterable filterable
placeholder="请选择产线" placeholder="请选择产线"
style="width: 160px" style="width: 160px"
@change="handleSelectLineChange"
> >
<el-option <el-option
v-for="item in lineCodeOption" v-for="item in lineCodeOption"
@ -39,7 +40,7 @@
</div> </div>
<br /> <br />
</el-col> </el-col>
<el-col :span="10"> <el-col :span="8">
<div> <div>
检查日期: 检查日期:
<el-date-picker <el-date-picker
@ -52,7 +53,7 @@
</el-date-picker> </el-date-picker>
</div> </div>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="8">
<el-button <el-button
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@ -71,6 +72,22 @@
@click="handlePrintPre" @click="handlePrintPre"
>打印 >打印
</el-button> </el-button>
<el-button
type="primary"
plain
icon="el-icon-check"
size="mini"
@click="handleSubmit"
>提交
</el-button>
<el-button
type="primary"
plain
icon="el-icon-check"
size="mini"
@click="AddNewColumn"
>新增一列
</el-button>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -81,18 +98,27 @@
<th rowspan="2" style="width: 50px">车间</th> <th rowspan="2" style="width: 50px">车间</th>
<th rowspan="2" style="width: 120px">黑蚊香</th> <th rowspan="2" style="width: 120px">黑蚊香</th>
<th style="width: 250px">产线{{ headerParameters.lineName }}</th> <th style="width: 250px">产线{{ headerParameters.lineName }}</th>
<th <th
th v-for="(item, key) in tableData[0]"
v-for="item in checkBoxData[0]"
:key="item.key" :key="item.key"
v-if="key !== '序号' && key !== '点检内容' && key !== '点检项目'"
:width="tableTittleWidth" :width="tableTittleWidth"
> >
<row> <el-row>
<label> <label>
<input <input
type="checkbox" type="checkbox"
class="check-box" class="check-box"
v-model="item.openLine" :checked="item.whetherOpenLine === true"
@change="
handleCheckboxChange(
item,
'openLine',
key,
$event.target.checked
)
"
size="4" size="4"
/>线 />线
</label> </label>
@ -100,21 +126,37 @@
<input <input
type="checkbox" type="checkbox"
class="check-box" class="check-box"
v-model="item.clearLine" :checked="item.whetherOpenLine === false"
@change="
handleCheckboxChange(
item,
'openLine',
key,
$event.target.checked
)
"
size="4" size="4"
/>线 />线
</label> </label>
</row> </el-row>
</th> </th>
</tr> </tr>
<tr> <tr>
<th>日期{{ headerParameters.checkDate }}</th> <th>日期{{ headerParameters.checkDate }}</th>
<td <td
columnspan="1" columnspan="1"
v-for="(value, key) in checkBoxData[1]" v-for="(item, key) in tableData[0]"
:key="key" :key="item.key"
v-if="key !== '序号' && key !== '点检内容' && key !== '点检项目'"
> >
{{ value }} <el-row>
<el-col :span="10"><span>班次</span></el-col>
<el-col :span="14"
><el-input
type="text"
v-model="item.remark"
@change="handleRemarkChange(key, $event)" /></el-col
></el-row>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -155,12 +197,24 @@
<tr v-for="item in tableData" :key="item.id"> <tr v-for="item in tableData" :key="item.id">
<!-- 动态渲染列值 --> <!-- 动态渲染列值 -->
<td columnspan="1" v-for="(value, key) in item" :key="key"> <td columnspan="1" v-for="(value, key) in item" :key="key">
{{ value }} <template
v-if="
key !== '序号' && key !== '点检内容' && key !== '点检项目'
"
>
<el-select v-model="item[key].checkResult">
<el-option label="√" value="√"></el-option>
<el-option label="×" value="×"></el-option>
</el-select>
</template>
<template v-else>
{{ value.data }}
</template>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<br /> <br>
<div> <div>
<el-row>填写要求</el-row> <el-row>填写要求</el-row>
<el-row>1.产线组长在开线品种转换时填写该表</el-row> <el-row>1.产线组长在开线品种转换时填写该表</el-row>
@ -207,17 +261,18 @@
产线{{ headerParameters.lineName }} 产线{{ headerParameters.lineName }}
</th> </th>
<th <th
th v-for="(item, key) in tableData[0]"
v-for="item in checkBoxData[0]"
:key="item.key" :key="item.key"
v-if="key !== '序号' && key !== '点检内容' && key !== '点检项目'"
:width="tableTittleWidth" :width="tableTittleWidth"
> >
<row> <el-row>
<label> <label>
<input <input
type="checkbox" type="checkbox"
class="check-box" class="check-box"
v-model="item.openLine" :checked="item.whetherOpenLine === true"
@change="handleCheckboxChange(item, 'openLine')"
size="4" size="4"
/>线 />线
</label> </label>
@ -225,21 +280,26 @@
<input <input
type="checkbox" type="checkbox"
class="check-box" class="check-box"
v-model="item.clearLine" :checked="item.whetherOpenLine === false"
@change="handleCheckboxChange(item, 'clearLine')"
size="4" size="4"
/>线 />线
</label> </label>
</row> </el-row>
</th> </th>
</tr> </tr>
<tr> <tr>
<th>日期{{ headerParameters.checkDate }}</th> <th>日期{{ headerParameters.checkDate }}</th>
<!-- 班次 -->
<td <td
columnspan="1" columnspan="1"
v-for="(value, key) in checkBoxData[1]" v-for="(item, key) in tableData[0]"
:key="key" :key="item.key"
v-if="
key !== '序号' && key !== '点检内容' && key !== '点检项目'
"
> >
{{ value }} 班次{{ item.remark }}
</td> </td>
</tr> </tr>
<tr> <tr>
@ -280,14 +340,23 @@
<tr v-for="item in tableData" :key="item.id"> <tr v-for="item in tableData" :key="item.id">
<!-- 动态渲染列值 --> <!-- 动态渲染列值 -->
<td columnspan="1" v-for="(value, key) in item" :key="key"> <td columnspan="1" v-for="(value, key) in item" :key="key">
{{ value }} <template
v-if="
key !== '序号' && key !== '点检内容' && key !== '点检项目'
"
>
{{ value.checkResult }}
</template>
<template v-else>
{{ value.data }}
</template>
</td> </td>
</tr> </tr>
</table> </table>
</el-col> </el-col>
</row> </row>
<br /> <br>
<br /> <br>
<el-row>填写要求</el-row> <el-row>填写要求</el-row>
<el-row>1.产线组长在开线品种转换时填写该表</el-row> <el-row>1.产线组长在开线品种转换时填写该表</el-row>
<el-row> <el-row>
@ -304,7 +373,7 @@ import {
listPointInspection, listPointInspection,
getSelfMutualInspectionData, getSelfMutualInspectionData,
getLineCodeList, getLineCodeList,
listCheckBox, updatePointInspectionTable,
} from "@/api/mes/selfMutualInspection"; } from "@/api/mes/selfMutualInspection";
export default { export default {
@ -326,7 +395,6 @@ export default {
tableTittle2: [], tableTittle2: [],
tableTittleWidth: null, tableTittleWidth: null,
tableData: [], tableData: [],
checkBoxData: [],
// //
loading: true, loading: true,
// //
@ -347,14 +415,14 @@ export default {
queryParams: {}, queryParams: {},
// //
headerParameters: { headerParameters: {
reportName: "ConversionReport", // reportName: "CheckReport", //
productionWorkshop: null, // productionWorkshop: null, //
lineCode: null, //线 lineCode: null, //线
lineName: null, //线 lineName: null, //线
createBy: null, // createBy: null, //
productName: null, // productName: null, //
checkDate: null, // checkDate: null, //
bz: null, // whetherOpenLine: null, //
remark: null, // remark: null, //
}, },
// //
@ -369,16 +437,72 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
handleCheckboxChange(item, checkboxType, transKey, newBz) {
if (checkboxType === "openLine") {
this.$set(item, "whetherOpenLine", true);
} else {
this.$set(item, "whetherOpenLine", false);
}
this.tableData.forEach((dataItem) => {
Object.keys(dataItem).forEach((key) => {
if (key === transKey) {
this.$set(dataItem[transKey], "whetherOpenLine", newBz);
}
});
});
// this.tableData.forEach((dataItem) => {
// if (dataItem.hasOwnProperty(transKey)) {
// dataItem[transKey][whetherOpenLine] = newBz;
// }
// });
},
//线线
handleSelectLineChange(value) {
const selectedOption = this.lineCodeOption.find(
(option) => option.equipmentCode === value
);
if (selectedOption) {
this.headerParameters.lineName = selectedOption.equipmentName;
}
},
dynamicWidthStyle() { dynamicWidthStyle() {
return { width: `${1000 / this.propertyNum}px` }; return { width: `${1000 / this.propertyNum}px` };
}, },
// //
handlePrintPre() { handlePrintPre() {
this.showTable = false; // this.$confirm("是否确定提交当前页面信息并进行打印操作?", "提示", {
this.showPrintPage = true; // confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
//
this.showTable = false;
this.showPrintPage = true;
this.$nextTick(() => { this.$nextTick(() => {
this.handlePrint(); this.handleSubmit(); //
this.handlePrint(); //
});
})
.catch(() => {
//
console.log("用户取消了打印预处理操作");
});
},
handleSubmit() {
this.headerParameters.tableData = this.tableData;
updatePointInspectionTable(this.headerParameters).then((response) => {
this.$modal.msgSuccess("提交成功");
if (response.code == 200) {
this.headerParameters.tableData = null;
this.getList();
}
}); });
}, },
@ -425,20 +549,6 @@ export default {
}); });
}, },
/**获取默认查询时间段**/
// getDate() {
// let start = this.Fungetdate (0)
// this.headerParameters.checkDate = start;
// },
// 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;
// },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
(this.headerParameters.productionWorkshop = null), // (this.headerParameters.productionWorkshop = null), //
@ -447,38 +557,61 @@ export default {
(this.headerParameters.createBy = null), // (this.headerParameters.createBy = null), //
(this.headerParameters.productName = null), // (this.headerParameters.productName = null), //
(this.headerParameters.checkDate = null), // (this.headerParameters.checkDate = null), //
(this.headerParameters.bz = null), // (this.headerParameters.whetherOpenLine = null), //
(this.headerParameters.remark = null), // (this.headerParameters.remark = null), //
// this.getDate(); // this.getDate();
this.getList(); this.getList();
}, },
// objectSpanMethod({ row, column, rowIndex, columnIndex }) { handleRemarkChange(transKey, newRemark) {
// if (columnIndex === 1) { // checkTime
// // this.tableData.forEach((item) => {
// const currentValue = row[column.property]; Object.keys(item).forEach((key) => {
// // if (key == transKey) {
// const preRow = this.tableData[rowIndex - 1]; const originalRemark = item[key].remark;
// const preValue = preRow ? preRow[column.property] : null; item[key].remark = newRemark;
// // console.log(
// if (currentValue === preValue) { key + "原来的班组:",
// return { rowspan: 0, colspan: 0 }; originalRemark + "现在的班组:",
// } else { item[key].remark
// // );
// let rowspan = 1; }
// for (let i = rowIndex + 1; i < this.detailList.length; i++) { });
// const nextRow = this.tableData[i]; });
// const nextValue = nextRow[column.property]; },
// if (nextValue === currentValue) {
// rowspan++; AddNewColumn() {
// } else { this.propertyNum = Object.keys(this.tableData[0]).length - 3 + 1; //
// break; this.tableTittle.push({
// } label: "点检结果",
// } key: this.propertyNum + 3,
// return { rowspan, colspan: 1 }; });
// } this.tableTittleWidth = 880 / this.propertyNum + "px";
// } //
// }, let tableLines = [];
for (let key in table[0]) {
if (key !== "序号" && key !== "点检项目" && key !== "点检内容") {
Object.keys(item).forEach((key) => {
if (key === "tableLine") {
tableLines.push(item[key]);
}
});
}
}
let maxEndTimeInMinutes = Math.max(...tableLines);
console.log("maxEndTimeInMinutes", maxEndTimeInMinutes);
//
this.tableData.forEach((item) => {
var dynamicPropertyName = "第" + this.propertyNum + "列";
let newProperty = {};
newProperty.productCode = this.headerParameters.productCode;
newProperty.productName = this.headerParameters.productName;
newProperty.tableLine = this.propertyNum;
newProperty.remark = "";
this.$set(item, dynamicPropertyName, newProperty);
});
},
/** 查询检查项维护列表 */ /** 查询检查项维护列表 */
getList() { getList() {
@ -492,24 +625,16 @@ export default {
this.propertyNum = null; this.propertyNum = null;
this.loading = true; this.loading = true;
//
listCheckBox(this.headerParameters).then((response) => {
this.checkBoxData = response;
});
getSelfMutualInspectionData(this.headerParameters).then((response) => { getSelfMutualInspectionData(this.headerParameters).then((response) => {
this.headerParameters.createBy = response.createBy; // this.headerParameters.createBy = response.createBy; //
this.headerParameters.productName = response.productName; // this.headerParameters.productName = response.productName; //
this.headerParameters.remark = response.remark; // this.headerParameters.remark = response.remark; //
this.headerParameters.bz = response.bz; // this.headerParameters.whetherOpenLine = response.whetherOpenLine; //
this.headerParameters.lineName = response.lineName; this.headerParameters.id = response.id; //id
//this.headerParameters.checkDate = response.checkDate
//线
});
listPointInspection(this.headerParameters).then((response) => { listPointInspection(this.headerParameters).then((response) => {
this.tableData = response; this.tableData = response;
console.log("this.tableData", this.tableData);
this.propertyNum = Object.keys(this.tableData[0]).length - 3; // this.propertyNum = Object.keys(this.tableData[0]).length - 3; //
this.tableTittle0.push({ this.tableTittle0.push({
label: "序号", label: "序号",
@ -532,6 +657,7 @@ export default {
this.tableTittleWidth = 880 / this.propertyNum + "px"; this.tableTittleWidth = 880 / this.propertyNum + "px";
}); });
});
}, },
}, },
}; };

Loading…
Cancel
Save