|
|
|
@ -0,0 +1,767 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<div id="table" v-show="showTable">
|
|
|
|
|
<el-form class="print-selfMutualInspection">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="5">
|
|
|
|
|
<img src="@/assets/logo/lanjv.png" class="lanju-logo" />
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col class="tittle-text" :span="14">
|
|
|
|
|
<span>中山榄菊日化实业有限公司</span>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="5"> </el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col class="tittle-text">
|
|
|
|
|
<span>班组安全生产每日点检报表</span>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<div>
|
|
|
|
|
生产产线:
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="headerParameters.lineCode"
|
|
|
|
|
filterable
|
|
|
|
|
placeholder="请选择产线"
|
|
|
|
|
style="width: 160px"
|
|
|
|
|
@change="handleSelectLineChange"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in lineCodeOption"
|
|
|
|
|
:key="item.equipmentCode"
|
|
|
|
|
:label="item.equipmentName"
|
|
|
|
|
:value="item.equipmentCode"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<br />
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<div>
|
|
|
|
|
检查日期:
|
|
|
|
|
<el-date-picker
|
|
|
|
|
clearable
|
|
|
|
|
v-model="headerParameters.checkDate"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
placeholder="请选择检查日期"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<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-button
|
|
|
|
|
type="warning"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handlePrintPre"
|
|
|
|
|
>打印
|
|
|
|
|
</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-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<table class="bordered-table">
|
|
|
|
|
<tr>
|
|
|
|
|
<th rowspan="1" style="width: 50px">班组名称</th>
|
|
|
|
|
<th rowspan="1" style="width: 120px">黑蚊香</th>
|
|
|
|
|
<th style="width: 250px">产线:{{ headerParameters.lineName }}</th>
|
|
|
|
|
|
|
|
|
|
<th
|
|
|
|
|
v-for="(item, key) in tableData[0]"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
v-if="key !== '序号' && key !== '点检内容' && key !== '点检项目'"
|
|
|
|
|
:width="tableTittleWidth"
|
|
|
|
|
>
|
|
|
|
|
<el-row>
|
|
|
|
|
<label>
|
|
|
|
|
<input
|
|
|
|
|
type="checkbox"
|
|
|
|
|
class="check-box"
|
|
|
|
|
:checked="item.whetherOpenLine === true"
|
|
|
|
|
@change="
|
|
|
|
|
handleCheckboxChange(
|
|
|
|
|
item,
|
|
|
|
|
'openLine',
|
|
|
|
|
key,
|
|
|
|
|
$event.target.checked
|
|
|
|
|
)
|
|
|
|
|
"
|
|
|
|
|
size="4"
|
|
|
|
|
/>开线
|
|
|
|
|
</label>
|
|
|
|
|
<label>
|
|
|
|
|
<input
|
|
|
|
|
type="checkbox"
|
|
|
|
|
class="check-box"
|
|
|
|
|
:checked="item.whetherOpenLine === false"
|
|
|
|
|
@change="
|
|
|
|
|
handleCheckboxChange(
|
|
|
|
|
item,
|
|
|
|
|
'clearLine',
|
|
|
|
|
key,
|
|
|
|
|
$event.target.checked
|
|
|
|
|
)
|
|
|
|
|
"
|
|
|
|
|
size="4"
|
|
|
|
|
/>清换线
|
|
|
|
|
</label>
|
|
|
|
|
</el-row>
|
|
|
|
|
</th>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>日期:{{ headerParameters.checkDate }}</th>
|
|
|
|
|
<td
|
|
|
|
|
columnspan="1"
|
|
|
|
|
v-for="(item, key) in tableData[0]"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
v-if="key !== '序号' && key !== '点检内容' && key !== '点检项目'"
|
|
|
|
|
>
|
|
|
|
|
<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>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<!-- 动态渲染列名 -->
|
|
|
|
|
<th
|
|
|
|
|
v-for="item in tableTittle0"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
style="width: 50px"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label }}
|
|
|
|
|
</th>
|
|
|
|
|
<!-- 动态渲染列名 -->
|
|
|
|
|
<th
|
|
|
|
|
v-for="item in tableTittle1"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
style="width: 120px"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label }}
|
|
|
|
|
</th>
|
|
|
|
|
<!-- 动态渲染列名 -->
|
|
|
|
|
<th
|
|
|
|
|
v-for="item in tableTittle2"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
style="width: 250px"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label }}
|
|
|
|
|
</th>
|
|
|
|
|
<!-- 动态渲染列名 -->
|
|
|
|
|
<th
|
|
|
|
|
v-for="item in tableTittle"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
:width="tableTittleWidth"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label }}
|
|
|
|
|
</th>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr v-for="item in tableData" :key="item.id">
|
|
|
|
|
<!-- 动态渲染列值 -->
|
|
|
|
|
<td columnspan="1" v-for="(value, key) in item" :key="key">
|
|
|
|
|
<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>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
<br />
|
|
|
|
|
<div>
|
|
|
|
|
<el-row>填写要求:</el-row>
|
|
|
|
|
<el-row>1.产线组长在开线、品种转换时填写该表。</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="20">2.在"口"中选择类别。 </el-col
|
|
|
|
|
><el-col :span="4"
|
|
|
|
|
>班组长签字:{{ headerParameters.createBy }}</el-col
|
|
|
|
|
>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>3."点检结果",是填"√",否填"×",若有异常则填写实际情况。</el-row>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="printPage" v-show="showPrintPage">
|
|
|
|
|
<br />
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="5">
|
|
|
|
|
<img src="@/assets/logo/lanjv.png" class="lanju-logo-print" />
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col class="tittle-text-print" :span="14">
|
|
|
|
|
<span>中山榄菊日化实业有限公司</span>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="5"> </el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="5"> </el-col>
|
|
|
|
|
<el-col class="tittle-text-print">
|
|
|
|
|
<span>产品转换/完产清线点检表</span>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="5"> </el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<br />
|
|
|
|
|
<el-row>
|
|
|
|
|
<div class="formCode">表单编号:08GL05C001-014A</div>
|
|
|
|
|
<br />
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<table class="bordered-table-print" border="1">
|
|
|
|
|
<tr>
|
|
|
|
|
<th rowspan="2" style="width: 50px">车间</th>
|
|
|
|
|
<th rowspan="2" style="width: 120px">黑蚊香</th>
|
|
|
|
|
<th style="width: 250px">
|
|
|
|
|
产线:{{ headerParameters.lineName }}
|
|
|
|
|
</th>
|
|
|
|
|
<th
|
|
|
|
|
v-for="(item, key) in tableData[0]"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
v-if="
|
|
|
|
|
key !== '序号' && key !== '点检内容' && key !== '点检项目'
|
|
|
|
|
"
|
|
|
|
|
:width="tableTittleWidth"
|
|
|
|
|
>
|
|
|
|
|
<el-row>
|
|
|
|
|
<label>
|
|
|
|
|
<input
|
|
|
|
|
type="checkbox"
|
|
|
|
|
class="check-box"
|
|
|
|
|
:checked="item.whetherOpenLine === true"
|
|
|
|
|
@change="handleCheckboxChange(item, 'openLine')"
|
|
|
|
|
size="4"
|
|
|
|
|
/>开线
|
|
|
|
|
</label>
|
|
|
|
|
<label>
|
|
|
|
|
<input
|
|
|
|
|
type="checkbox"
|
|
|
|
|
class="check-box"
|
|
|
|
|
:checked="item.whetherOpenLine === false"
|
|
|
|
|
@change="handleCheckboxChange(item, 'clearLine')"
|
|
|
|
|
size="4"
|
|
|
|
|
/>清换线
|
|
|
|
|
</label>
|
|
|
|
|
</el-row>
|
|
|
|
|
</th>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>日期:{{ headerParameters.checkDate }}</th>
|
|
|
|
|
<!-- 班次 -->
|
|
|
|
|
<td
|
|
|
|
|
columnspan="1"
|
|
|
|
|
v-for="(item, key) in tableData[0]"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
v-if="
|
|
|
|
|
key !== '序号' && key !== '点检内容' && key !== '点检项目'
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
班次:{{ item.remark }}
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<!-- 动态渲染列名 -->
|
|
|
|
|
<th
|
|
|
|
|
v-for="item in tableTittle0"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
style="width: 50px"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label }}
|
|
|
|
|
</th>
|
|
|
|
|
<!-- 动态渲染列名 -->
|
|
|
|
|
<th
|
|
|
|
|
v-for="item in tableTittle1"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
style="width: 120px"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label }}
|
|
|
|
|
</th>
|
|
|
|
|
<!-- 动态渲染列名 -->
|
|
|
|
|
<th
|
|
|
|
|
v-for="item in tableTittle2"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
style="width: 250px"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label }}
|
|
|
|
|
</th>
|
|
|
|
|
<!-- 动态渲染列名 -->
|
|
|
|
|
<th
|
|
|
|
|
v-for="item in tableTittle"
|
|
|
|
|
:key="item.key"
|
|
|
|
|
:width="tableTittleWidth"
|
|
|
|
|
>
|
|
|
|
|
{{ item.label }}
|
|
|
|
|
</th>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr v-for="item in tableData" :key="item.id">
|
|
|
|
|
<!-- 动态渲染列值 -->
|
|
|
|
|
<td columnspan="1" v-for="(value, key) in item" :key="key">
|
|
|
|
|
<template
|
|
|
|
|
v-if="
|
|
|
|
|
key !== '序号' && key !== '点检内容' && key !== '点检项目'
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
{{ value.checkResult }}
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
{{ value.data }}
|
|
|
|
|
</template>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<br />
|
|
|
|
|
<br />
|
|
|
|
|
<el-row>填写要求:</el-row>
|
|
|
|
|
<el-row>1.产线组长在开线、品种转换时填写该表。</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="20">2.在"口"中选择类别。 </el-col
|
|
|
|
|
><el-col :span="4">班组长签字:{{ headerParameters.createBy }}</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>3."点检结果",是填"√",否填"×",若有异常则填写实际情况。</el-row>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
listPointInspection,
|
|
|
|
|
getSelfMutualInspectionData,
|
|
|
|
|
getLineCodeList,
|
|
|
|
|
updatePointInspectionTable,
|
|
|
|
|
} from "@/api/mes/selfMutualInspection";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "Item",
|
|
|
|
|
dicts: ["device_item_type", "device_loop_type"],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
printData: {
|
|
|
|
|
printable: "printPage",
|
|
|
|
|
ignore: ["no-print"],
|
|
|
|
|
},
|
|
|
|
|
currentSelectedRow: null,
|
|
|
|
|
showPrintPage: false,
|
|
|
|
|
showTable: false,
|
|
|
|
|
lineCodeOption: [],
|
|
|
|
|
propertyNum: null,
|
|
|
|
|
tableTittle: [],
|
|
|
|
|
tableTittle0: [],
|
|
|
|
|
tableTittle1: [],
|
|
|
|
|
tableTittle2: [],
|
|
|
|
|
tableTittleWidth: null,
|
|
|
|
|
tableData: [],
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
|
ids: [],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {},
|
|
|
|
|
//表头参数
|
|
|
|
|
headerParameters: {
|
|
|
|
|
reportName: "CheckReport", //表类型
|
|
|
|
|
productionWorkshop: null, //生产车间
|
|
|
|
|
lineCode: null, //生产产线编码
|
|
|
|
|
lineName: null, //生产产线名称
|
|
|
|
|
createBy: null, //检查人
|
|
|
|
|
productName: null, //产品名称
|
|
|
|
|
checkDate: null, //检查日期
|
|
|
|
|
whetherOpenLine: null, //异常处理
|
|
|
|
|
remark: null, //备注
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
// this.getDate();
|
|
|
|
|
this.getLineCode();
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
handleCheckboxChange(item, checkboxType, transKey, newBz) {
|
|
|
|
|
if (checkboxType === "openLine") {
|
|
|
|
|
this.$set(item, "whetherOpenLine", true);
|
|
|
|
|
} else {
|
|
|
|
|
this.$set(item, "whetherOpenLine", false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
console.log("item", item);
|
|
|
|
|
this.tableData.forEach((dataItem) => {
|
|
|
|
|
Object.keys(dataItem).forEach((key) => {
|
|
|
|
|
if (key === transKey) {
|
|
|
|
|
this.$set(dataItem[transKey], "whetherOpenLine", newBz);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//在选择产线时候,存产线名称
|
|
|
|
|
handleSelectLineChange(value) {
|
|
|
|
|
const selectedOption = this.lineCodeOption.find(
|
|
|
|
|
(option) => option.equipmentCode === value
|
|
|
|
|
);
|
|
|
|
|
if (selectedOption) {
|
|
|
|
|
this.headerParameters.lineName = selectedOption.equipmentName;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
dynamicWidthStyle() {
|
|
|
|
|
return { width: `${1000 / this.propertyNum}px` };
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//预处理
|
|
|
|
|
handlePrintPre() {
|
|
|
|
|
this.$confirm("是否确定提交当前页面信息并进行打印操作?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
// 用户点击确定后执行的逻辑
|
|
|
|
|
this.showTable = false;
|
|
|
|
|
this.showPrintPage = true;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//真正打印
|
|
|
|
|
handlePrint() {
|
|
|
|
|
printJS({
|
|
|
|
|
printable: this.printData.printable, // 'printPage', // 标签元素id
|
|
|
|
|
type: this.printData.type || "html",
|
|
|
|
|
maxWidth: 1500, // 最大宽度
|
|
|
|
|
font_size: "", // 设置字体大小
|
|
|
|
|
header: this.printData.header, // '表单',
|
|
|
|
|
targetStyles: ["*"],
|
|
|
|
|
style: "@page {margin:0 10mm};", // 可选-打印时去掉眉页眉尾
|
|
|
|
|
ignoreElements: this.printData.ignore || [], // ['no-print']
|
|
|
|
|
properties: this.printData.properties || null,
|
|
|
|
|
});
|
|
|
|
|
this.showTable = true; //页面上的表格显示
|
|
|
|
|
this.showPrintPage = false; //打印的表格不显示
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
if (this.headerParameters.lineCode == null) {
|
|
|
|
|
this.$modal.msg("您没有选择生产产线,请选择!");
|
|
|
|
|
} else if (this.headerParameters.checkDate == null) {
|
|
|
|
|
this.$modal.msg("您没有选择检查时间,请选择!");
|
|
|
|
|
} else {
|
|
|
|
|
this.getList();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getLineCode() {
|
|
|
|
|
getLineCodeList().then((response) => {
|
|
|
|
|
this.lineCodeOption = response;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
(this.headerParameters.productionWorkshop = null), //生产车间
|
|
|
|
|
(this.headerParameters.lineCode = null), //生产产线
|
|
|
|
|
(this.headerParameters.lineName = null), //生产产线
|
|
|
|
|
(this.headerParameters.createBy = null), //检查人
|
|
|
|
|
(this.headerParameters.productName = null), //产品名称
|
|
|
|
|
(this.headerParameters.checkDate = null), //检查日期
|
|
|
|
|
(this.headerParameters.whetherOpenLine = null), //异常处理
|
|
|
|
|
(this.headerParameters.remark = null), //备注
|
|
|
|
|
// this.getDate();
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleRemarkChange(transKey, newRemark) {
|
|
|
|
|
// 遍历表格数据,更新该列所有对象的checkTime属性
|
|
|
|
|
this.tableData.forEach((item) => {
|
|
|
|
|
Object.keys(item).forEach((key) => {
|
|
|
|
|
if (key == transKey) {
|
|
|
|
|
const originalRemark = item[key].remark;
|
|
|
|
|
item[key].remark = newRemark;
|
|
|
|
|
console.log(
|
|
|
|
|
key + "原来的班组:",
|
|
|
|
|
originalRemark + "现在的班组:",
|
|
|
|
|
item[key].remark
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
AddNewColumn() {
|
|
|
|
|
this.propertyNum = Object.keys(this.tableData[0]).length - 3 + 1; //属性个数
|
|
|
|
|
this.tableTittle.push({
|
|
|
|
|
label: "点检结果",
|
|
|
|
|
key: this.propertyNum + 3,
|
|
|
|
|
});
|
|
|
|
|
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() {
|
|
|
|
|
this.showTable = true; //页面上的表格显示
|
|
|
|
|
this.showPrintPage = false; //打印的表格不显示
|
|
|
|
|
this.tableData = [];
|
|
|
|
|
this.tableTittle = [];
|
|
|
|
|
this.tableTittle0 = [];
|
|
|
|
|
this.tableTittle1 = [];
|
|
|
|
|
this.tableTittle2 = [];
|
|
|
|
|
this.propertyNum = null;
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
|
|
getSelfMutualInspectionData(this.headerParameters).then((response) => {
|
|
|
|
|
this.headerParameters.createBy = response.createBy; //检查人
|
|
|
|
|
this.headerParameters.productName = response.productName; //产品名称
|
|
|
|
|
this.headerParameters.remark = response.remark; //备注
|
|
|
|
|
this.headerParameters.whetherOpenLine = response.whetherOpenLine; //异常处理
|
|
|
|
|
this.headerParameters.id = response.id; //主表id
|
|
|
|
|
|
|
|
|
|
listPointInspection(this.headerParameters).then((response) => {
|
|
|
|
|
this.tableData = response;
|
|
|
|
|
|
|
|
|
|
this.propertyNum = Object.keys(this.tableData[0]).length - 3; //属性个数
|
|
|
|
|
this.tableTittle0.push({
|
|
|
|
|
label: "序号",
|
|
|
|
|
key: 0,
|
|
|
|
|
});
|
|
|
|
|
this.tableTittle1.push({
|
|
|
|
|
label: "点检项目",
|
|
|
|
|
key: 1,
|
|
|
|
|
});
|
|
|
|
|
this.tableTittle2.push({
|
|
|
|
|
label: "点检内容",
|
|
|
|
|
key: 2,
|
|
|
|
|
});
|
|
|
|
|
for (let i = 0; i < this.propertyNum; i++) {
|
|
|
|
|
this.tableTittle.push({
|
|
|
|
|
label: "点检结果",
|
|
|
|
|
key: i + 3,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.tableTittleWidth = 880 / this.propertyNum + "px";
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.tittle-text {
|
|
|
|
|
text-align: center;
|
|
|
|
|
font-size: 25px;
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
color: black;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.lanju-logo {
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
margin-left: 15px;
|
|
|
|
|
height: 50px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bordered-table {
|
|
|
|
|
border-collapse: collapse; /* 确保边框合并为单一边框 */
|
|
|
|
|
width: 1300px; /* 表格宽度 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bordered-table th,
|
|
|
|
|
.bordered-table td {
|
|
|
|
|
border: 1px solid #ddd; /* 边框样式 */
|
|
|
|
|
text-align: center; /* 文本对齐 */
|
|
|
|
|
height: 35px; /* 表格高度 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bordered-table tr {
|
|
|
|
|
word-break: break-all;
|
|
|
|
|
word-wrap: break-word;
|
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
height: 35px; /* 表格高度 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bordered-table-bottom {
|
|
|
|
|
border-collapse: collapse; /* 确保边框合并为单一边框 */
|
|
|
|
|
width: 1300px; /* 表格宽度 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bordered-table-bottom td {
|
|
|
|
|
border: 1px solid #ddd; /* 边框样式 */
|
|
|
|
|
text-align: left; /* 文本对齐 */
|
|
|
|
|
width: 1300px; /* 表格宽度 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 下面是和打印有关系的 */
|
|
|
|
|
.tittle-text-print {
|
|
|
|
|
text-align: center;
|
|
|
|
|
font-size: 40px;
|
|
|
|
|
font-weight: 800;
|
|
|
|
|
color: black;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.lanju-logo-print {
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
margin-left: 15px;
|
|
|
|
|
height: 75px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.text-print {
|
|
|
|
|
text-align: left;
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
color: black;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bordered-table-print {
|
|
|
|
|
border-collapse: collapse; /* 确保边框合并为单一边框 */
|
|
|
|
|
width: 1300px; /* 表格宽度 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bordered-table-print td {
|
|
|
|
|
text-align: center; /* 文本对齐 */
|
|
|
|
|
height: 35px; /* 表格高度 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bordered-table-bottom-print {
|
|
|
|
|
border-collapse: collapse; /* 确保边框合并为单一边框 */
|
|
|
|
|
width: 1300px; /* 表格宽度 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bordered-table-bottom-print td {
|
|
|
|
|
text-align: left; /* 文本对齐 */
|
|
|
|
|
height: 35px; /* 表格宽度 */
|
|
|
|
|
width: 1300px; /* 表格高度 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bottom-remark {
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bordered-table-print tr {
|
|
|
|
|
word-break: break-all;
|
|
|
|
|
word-wrap: break-word;
|
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.formCode {
|
|
|
|
|
margin-left: 1000px;
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.check-box {
|
|
|
|
|
font-size: 3px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|