<style scoped>
|
.custom-table .el-table__header-wrapper th {
|
background-color: #87ceeb; /* 只对带有my-custom-table类的表格生效 */
|
color: #fff;
|
}
|
.container {
|
overflow: auto; /* 确保容器能包裹浮动元素 */
|
margin-bottom: 10px;
|
}
|
|
.right-button {
|
float: right;
|
}
|
.inspection {
|
height: 100%;
|
overflow-y: auto;
|
}
|
|
.inspection::-webkit-scrollbar {
|
width: 0;
|
}
|
|
.title {
|
height: 60px;
|
line-height: 60px;
|
}
|
|
.search {
|
width: 100%;
|
margin-bottom: 10px;
|
background-color: #fff;
|
border-radius: 3px;
|
}
|
|
.search .form-inline {
|
padding-top: 20px;
|
padding-left: 0px;
|
text-align: left;
|
}
|
|
.center {
|
width: calc(100% - 40px);
|
/* max-height: 580px; */
|
background-color: #fff;
|
border-radius: 3px;
|
padding: 20px;
|
overflow: auto;
|
}
|
|
.center-box {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
flex-direction: column;
|
flex-wrap: wrap;
|
width: 100%;
|
overflow-x: hidden;
|
/* overflow-x: scroll; */
|
cursor: grab;
|
}
|
|
.center-box:active {
|
cursor: grabbing;
|
}
|
|
.tables {
|
table-layout: fixed;
|
margin: 5px 5px 16px;
|
}
|
|
.tables td {
|
height: 40px;
|
width: 100px;
|
text-align: center;
|
font-size: 14px;
|
word-wrap: break-word;
|
white-space: normal;
|
}
|
.thermal-table {
|
min-width: calc(100% - 10px);
|
margin: 5px 5px 0;
|
table-layout: fixed;
|
}
|
.thermal-table td {
|
min-width: 70px;
|
text-align: center;
|
font-size: 14px;
|
word-wrap: break-word;
|
white-space: normal;
|
padding: 5px;
|
}
|
.table-container {
|
overflow-x: auto; /* 使容器支持横向滚动 */
|
max-width: 100%; /* 限制容器的最大宽度 */
|
margin-bottom: 16px;
|
}
|
|
.content {
|
display: flex;
|
height: 100%;
|
align-items: center;
|
justify-content: left;
|
padding: 5px;
|
box-sizing: border-box;
|
overflow: hidden;
|
user-select: none;
|
}
|
|
.content * {
|
user-select: none;
|
}
|
|
.content-h-0 {
|
justify-content: center;
|
}
|
|
.content-h-1 {
|
justify-content: start;
|
}
|
|
.content-h-2 {
|
justify-content: end;
|
}
|
|
.content-v-0 {
|
align-items: center;
|
}
|
|
.content-v-1 {
|
align-items: start;
|
}
|
|
.content-v-2 {
|
align-items: end;
|
}
|
|
.table_input {
|
width: 100%;
|
height: 100%;
|
}
|
.table_input >>> .el-input__inner {
|
border-color: rgba(0, 0, 0, 0.5) !important;
|
}
|
|
.collection {
|
width: 50px;
|
height: 100%;
|
margin-left: 5px;
|
border-color: transparent;
|
background-color: #409eff;
|
color: #fff;
|
border-radius: 4px;
|
font-size: 12px;
|
}
|
|
.collection:active {
|
opacity: 0.7;
|
}
|
.table_caret {
|
font-size: 16px;
|
margin: 0 5px;
|
color: rgba(0, 0, 0, 0.5);
|
}
|
.table_caret:hover {
|
color: #409eff;
|
cursor: pointer;
|
}
|
|
.table_caret:active {
|
opacity: 0.8;
|
}
|
>>> input::-webkit-inner-spin-button {
|
-webkit-appearance: none !important; /* 隐藏微调按钮 */
|
margin: 0 !important; /* 移除微调按钮的边距 */
|
}
|
|
>>> input[type="number"] {
|
-moz-appearance: textfield !important; /* 针对 Firefox */
|
}
|
>>> .el-form-item__content {
|
display: inline-flex;
|
align-items: center;
|
}
|
#lineTd {
|
background: #fff
|
url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxsaW5lIHgxPSIwIiB5MT0iMCIgeDI9IjEwMCUiIHkyPSIxMDAlIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjEiLz48L3N2Zz4=)
|
no-repeat 100% center;
|
}
|
.background-grey {
|
background-color: #f0f1f5;
|
}
|
.search_thing {
|
display: flex;
|
align-items: center;
|
height: 50px;
|
}
|
|
.search_label {
|
width: 120px;
|
font-size: 14px;
|
text-align: right;
|
}
|
.search_input {
|
width: calc(100% - 120px);
|
}
|
</style>
|
<style>
|
.inspection .el-form-item__label {
|
color: #000;
|
}
|
|
.inspection .el-drawer__header::before {
|
content: "";
|
display: inline-block;
|
width: 4px;
|
height: 30.24px;
|
background: #3a7bfa;
|
border-radius: 10px;
|
margin-left: 32px;
|
margin-right: 8.5px;
|
}
|
|
.inspection .el-drawer__header {
|
color: #303133;
|
text-align: left;
|
}
|
|
.inspection .el-input-group__append {
|
padding: 0 14px;
|
color: #3a7bfa;
|
background-color: #fff;
|
height: 100%;
|
display: flex;
|
align-items: center;
|
}
|
|
.inspection .center-box .el-input__inner {
|
font-size: 12px;
|
padding: 0 6px;
|
text-align: center;
|
}
|
|
.inspection .el-textarea__inner {
|
padding: 2px;
|
}
|
|
.inspection .el-textarea__inner::-webkit-scrollbar {
|
width: 0;
|
}
|
|
.inspection .el-select {
|
display: flex;
|
align-items: center;
|
}
|
|
.inspection .el-textarea__inner {
|
min-height: 100% !important;
|
}
|
|
.inspection .tables .el-input {
|
display: flex;
|
align-items: center;
|
}
|
.thermal-table .el-input {
|
display: flex;
|
align-items: center;
|
}
|
.custom-dialog .el-dialog__body {
|
max-width: 1000px; /* 设置最大宽度 */
|
}
|
</style>
|
<template>
|
<div v-loading="loading" class="inspection">
|
<el-row class="title">
|
<el-col :span="12" style="padding-left: 20px; text-align: left"
|
>检验单详情
|
</el-col>
|
<el-col :span="12" style="text-align: right">
|
<el-button
|
size="small"
|
type="primary"
|
@click="connectVisible = true"
|
v-show="insOrderState != 2 && state == 1"
|
>交接</el-button
|
>
|
<!-- <el-button size="small" type="primary" @click="fiberOpticVisible=true" v-if="fiberOptic.length>0">光纤切换</el-button>
|
<el-button size="small" type="primary" @click="fiberOpticTapeVisible=true" v-if="fiberOpticTape.length>0">光纤带切换</el-button>
|
<el-button size="small" type="primary" @click="bushingVisible=true" v-if="bushing.length>0">套管切换</el-button> -->
|
<el-button
|
size="small"
|
type="primary"
|
@click="
|
sampleVisible = true;
|
uploadSample();
|
"
|
>样品切换</el-button
|
>
|
<el-button size="small" type="primary" @click="taskVisible = true"
|
>任务切换</el-button
|
>
|
<el-button
|
size="small"
|
type="primary"
|
@click="addVerifyDia = true"
|
v-if="state == 1"
|
:loading="submitLoading"
|
>提交</el-button
|
>
|
<!-- 复核 -->
|
<el-button
|
size="medium"
|
type="primary"
|
@click="upInsReview(1)"
|
:loading="reviewLoading"
|
v-if="state > 1"
|
>通过</el-button
|
>
|
<el-button size="medium" @click="upInsReview(0)" v-if="state > 1"
|
>不通过</el-button
|
>
|
<el-button size="small" @click="$emit('goback')">返回</el-button>
|
</el-col>
|
</el-row>
|
<div class="search">
|
<el-form
|
:inline="true"
|
:model="searchForm"
|
class="form-inline"
|
label-width="100px"
|
label-position="right"
|
>
|
<el-form-item label="委托编号:">
|
<el-input
|
clearable
|
v-model="insOrder.entrustCode"
|
disabled
|
size="small"
|
placeholder="请输入"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="样品编号:">
|
<el-tooltip
|
:disabled="!currentSample.sampleCode"
|
:content="currentSample.sampleCode"
|
>
|
<el-input
|
clearable
|
v-model="currentSample.sampleCode"
|
disabled
|
size="small"
|
placeholder="请输入"
|
></el-input>
|
</el-tooltip>
|
</el-form-item>
|
<el-form-item label="样品名称:">
|
<el-input
|
clearable
|
v-model="currentSample.sample"
|
disabled
|
size="small"
|
placeholder="请输入"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="样品数量:">
|
<el-input
|
clearable
|
v-model="fileterSampleProducts.length"
|
disabled
|
size="small"
|
placeholder="请输入"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="下发时间:">
|
<el-input
|
clearable
|
v-model="insOrder.sendTime"
|
disabled
|
size="small"
|
placeholder="请输入"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="紧急程度:">
|
<el-input
|
clearable
|
v-model="insOrder.typeName"
|
disabled
|
size="small"
|
placeholder="请输入"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="约定时间:">
|
<el-input
|
clearable
|
v-model="insOrder.appointed"
|
disabled
|
size="small"
|
placeholder="请输入"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="当前样品位数:">
|
<el-tag v-if="currentKey">{{ `NO.${currentKey}` }}</el-tag>
|
</el-form-item>
|
<el-form-item label="备注:">
|
<span style="color: red">{{
|
insOrder.remark ? insOrder.remark : "-"
|
}}</span>
|
<!-- <el-tag v-if="currentKey">{{ insOrder.remark }}</el-tag> -->
|
</el-form-item>
|
</el-form>
|
</div>
|
<div class="center">
|
<div
|
class="search"
|
style="
|
text-align: left;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
"
|
>
|
<div style="display: flex; align-items: center">
|
<span v-if="tableList.length > 0">检验模板:</span>
|
<el-radio-group v-model="currentTable" size="small">
|
<el-radio-button
|
:label="item.templateId"
|
v-for="(item, index) in tableLists"
|
:key="index"
|
size="small"
|
>{{ item.templateName }}</el-radio-button
|
>
|
</el-radio-group>
|
</div>
|
<div style="display: flex; align-items: center">
|
<span
|
v-if="
|
casing.length > 0 &&
|
tableLists.find((m) => m.templateId == currentTable) &&
|
(tableLists.find((m) => m.templateId == currentTable)
|
.templateName == '成品缆检验原始记录' ||
|
tableLists.find((m) => m.templateId == currentTable)
|
.templateName == '二次被覆材料检验原始记录')
|
"
|
> 套管:</span
|
>
|
<el-select
|
v-model="currentTab"
|
placeholder="请选择"
|
clearable
|
@clear="handleChangeSample({ id: currentSample.id })"
|
@change="(m) => handleChange(m, 3)"
|
v-if="
|
casing.length > 0 &&
|
tableLists.find((m) => m.templateId == currentTable) &&
|
(tableLists.find((m) => m.templateId == currentTable)
|
.templateName == '成品缆检验原始记录' ||
|
tableLists.find((m) => m.templateId == currentTable)
|
.templateName == '二次被覆材料检验原始记录')
|
"
|
size="small"
|
:loading="getReportModelLoading"
|
@focus="getReportModel(currentSample.id)"
|
>
|
<el-option
|
v-for="item in casing"
|
:key="item.id"
|
:label="item.color"
|
:value="item.id"
|
>
|
<span style="float: left">{{ item.color }}</span>
|
<el-tag
|
:type="
|
item.state == 1
|
? 'success'
|
: item.state == 2
|
? 'warning'
|
: 'danger'
|
"
|
style="float: right; margin-top: 5px"
|
size="small"
|
>
|
{{
|
item.state == 1 ? "已检" : item.state == 2 ? "在检" : "未检"
|
}}
|
</el-tag>
|
</el-option>
|
</el-select>
|
|
<!-- 该光纤带用于光纤带下有项目配置的情况 -->
|
<span
|
v-if="
|
fibers.filter((f) => f.isExistProduct).length > 0 &&
|
fibers.length > 0 &&
|
tableLists.find((m) => m.templateId == currentTable) &&
|
tableLists.find((m) => m.templateId == currentTable)
|
.templateName != '温度循环检验原始记录' &&
|
tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('光纤')
|
"
|
> 光纤带:</span
|
>
|
<el-select
|
v-model="currentTab"
|
placeholder="请选择"
|
clearable
|
@clear="handleChangeSample({ id: currentSample.id })"
|
@change="(m) => handleChange(m, 1)"
|
v-if="
|
fibers.filter((f) => f.isExistProduct).length > 0 &&
|
fibers.length > 0 &&
|
tableLists.find((m) => m.templateId == currentTable) &&
|
tableLists.find((m) => m.templateId == currentTable)
|
.templateName != '温度循环检验原始记录' &&
|
tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('光纤')
|
"
|
size="small"
|
:loading="getReportModelLoading"
|
@focus="getReportModel(currentSample.id)"
|
>
|
<el-option
|
v-for="item in fibers"
|
:key="item.value"
|
:label="item.bushingColor + '-' + item.code"
|
:value="item.id"
|
>
|
<span style="float: left">{{
|
item.bushingColor + "-" + item.code
|
}}</span>
|
<el-tag
|
:type="
|
item.state == 1
|
? 'success'
|
: item.state == 2
|
? 'warning'
|
: 'danger'
|
"
|
style="float: right; margin-top: 5px"
|
size="small"
|
>
|
{{
|
item.state == 1 ? "已检" : item.state == 2 ? "在检" : "未检"
|
}}
|
</el-tag>
|
</el-option>
|
</el-select>
|
|
<!-- 该光纤带用于光纤带无项目,下面有光纤配置的情况 -->
|
<span
|
v-if="
|
fibers.filter((f) => f.isExistProduct).length === 0 &&
|
fibers.length > 0 &&
|
tableLists.find((m) => m.templateId == currentTable) &&
|
tableLists.find((m) => m.templateId == currentTable)
|
.templateName != '温度循环检验原始记录' &&
|
tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('光纤')
|
"
|
> 光纤带:</span
|
>
|
<el-select
|
v-model="insFibersId"
|
placeholder="请选择"
|
disabled
|
v-if="
|
fibers.filter((f) => f.isExistProduct).length === 0 &&
|
fibers.length > 0 &&
|
tableLists.find((m) => m.templateId == currentTable) &&
|
tableLists.find((m) => m.templateId == currentTable)
|
.templateName != '温度循环检验原始记录' &&
|
tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('光纤')
|
"
|
size="small"
|
>
|
<el-option
|
v-for="item in fibers"
|
:key="item.value"
|
:label="item.bushingColor + '-' + item.code"
|
:value="item.id"
|
>
|
<span style="float: left">{{
|
item.bushingColor + "-" + item.code
|
}}</span>
|
<el-tag
|
:type="
|
item.state == 1
|
? 'success'
|
: item.state == 2
|
? 'warning'
|
: 'danger'
|
"
|
style="float: right; margin-top: 5px"
|
size="small"
|
>
|
{{
|
item.state == 1 ? "已检" : item.state == 2 ? "在检" : "未检"
|
}}
|
</el-tag>
|
</el-option>
|
</el-select>
|
<span
|
v-if="
|
fiber.length > 0 &&
|
tableLists.find((m) => m.templateId == currentTable) &&
|
tableLists.find((m) => m.templateId == currentTable)
|
.templateName != '温度循环检验原始记录' &&
|
tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('光纤')
|
"
|
> 光纤:</span
|
>
|
<el-select
|
v-model="currentTab"
|
placeholder="请选择"
|
clearable
|
@clear="handleChangeSample({ id: currentSample.id })"
|
@change="(m) => handleChange(m, 2)"
|
v-if="
|
fiber.length > 0 &&
|
tableLists.find((m) => m.templateId == currentTable) &&
|
tableLists.find((m) => m.templateId == currentTable)
|
.templateName != '温度循环检验原始记录' &&
|
tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('光纤')
|
"
|
size="small"
|
:loading="getReportModelLoading"
|
@focus="getReportModel(currentSample.id)"
|
>
|
<el-option
|
v-for="item in fiber"
|
:label="item.bushColor + '-' + item.color"
|
:key="item.id"
|
:value="item.id"
|
>
|
<span style="float: left">{{
|
item.bushColor + "-" + item.color
|
}}</span>
|
<el-tag
|
:type="
|
item.state == 1
|
? 'success'
|
: item.state == 2
|
? 'warning'
|
: 'danger'
|
"
|
style="float: right; margin-top: 5px"
|
size="small"
|
>
|
{{
|
item.state == 1 ? "已检" : item.state == 2 ? "在检" : "未检"
|
}}
|
</el-tag>
|
</el-option>
|
</el-select>
|
<el-form
|
:inline="true"
|
:model="otherForm"
|
class="form-inline"
|
label-width="50px"
|
style="padding-top: 0; padding-left: 10px"
|
>
|
<el-form-item label="温度:" style="margin-bottom: 0">
|
<el-input
|
v-model="otherForm.temperature"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="width: 90px"
|
@change="(m) => subOtherForm(m, 'temperature')"
|
></el-input>
|
<span style="margin-left: 4px">℃</span>
|
</el-form-item>
|
<el-form-item label="湿度:" style="margin-bottom: 0">
|
<el-input
|
v-model="otherForm.humidity"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="width: 90px"
|
@change="(m) => subOtherForm(m, 'humidity')"
|
></el-input>
|
<span style="margin-left: 4px">%</span>
|
</el-form-item>
|
</el-form>
|
<el-button
|
type="primary"
|
size="small"
|
v-if="
|
(isGet ||
|
(tableLists.find((m) => m.templateId == currentTable) &&
|
tableLists.find((m) => m.templateId == currentTable)
|
.templateName == '温度循环检验原始记录' &&
|
temDataAcquisition)) &&
|
state == 1
|
"
|
@click="getDataAcquisitionDevice"
|
:loading="dataAcquisitionLoading"
|
>数据采集</el-button
|
>
|
<el-button
|
:type="dataAcquisitionEidtAble ? '' : 'primary'"
|
size="small"
|
v-if="
|
isGet ||
|
isEdit ||
|
(tableLists.find((m) => m.templateId == currentTable) &&
|
tableLists.find((m) => m.templateId == currentTable)
|
.templateName == '温度循环检验原始记录' &&
|
collected &&
|
state == 1)
|
"
|
@click="dataAcquisitionEidtAble = !dataAcquisitionEidtAble"
|
>{{ dataAcquisitionEidtAble ? "关闭编辑" : "编辑数采" }}</el-button
|
>
|
</div>
|
</div>
|
<!-- 常规检验原始记录 -->
|
<div
|
class="center-box"
|
id="nav"
|
v-loading="tableLoading"
|
v-if="
|
!tableLists.find((m) => m.templateId == currentTable) ||
|
(tableLists.find((m) => m.templateId == currentTable).templateName !=
|
'温度循环检验原始记录' &&
|
!tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('热循环') &&
|
!tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('温升试验') &&
|
!tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('弧垂特性检验原始记录') &&
|
!tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('单根垂直燃烧') &&
|
!tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('架空地线应力应变') &&
|
!tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('防振锤功率特性') &&
|
!tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('疲劳试验检验原始记录'))
|
"
|
>
|
<table
|
border="1"
|
class="tables"
|
cellpadding="10"
|
v-for="(item, index) in tableList"
|
:key="index + currentTable + currentSample.id"
|
>
|
<tbody>
|
<tr v-for="(m, i) in item.arr" :key="i">
|
<td
|
:id="item.templateId + '-' + n.i + '-' + n.r + '-' + n.c"
|
v-for="(n, j) in m"
|
:key="j"
|
v-if="n.v.mc == undefined || Object.keys(n.v.mc).length === 4"
|
:colspan="n.v.mc && n.v.mc.cs ? n.v.mc.cs : 1"
|
:rowspan="n.v.mc && n.v.mc.rs ? n.v.mc.rs : 1"
|
:style="`background:${n.v.bg ? n.v.bg : ''};color:${
|
n.v.fc
|
};font-size:${n.v.fs}px;width:${handleWidth(
|
n
|
)}px !important;height:${item.style.rowlen[n.r]}px;font-wight:${
|
n.v.bl ? 'bold' : ''
|
};`"
|
>
|
<div
|
class="content"
|
:class="`content-h-${n.v.ht} content-v-${n.v.vt}`"
|
:style="`width:${handleWidth(n)}px !important;min-height:${
|
item.style.rowlen[n.r]
|
}px;`"
|
>
|
<template
|
v-if="
|
n.v.ps != undefined &&
|
typeof n.v.ps.value === 'string' &&
|
n.v.ps.value.includes('检验值') &&
|
state == 1
|
"
|
>
|
<el-input
|
v-if="getInspectionValueType(n.i) == 1"
|
class="table_input"
|
v-model="n.v.v"
|
:disabled="
|
(getInspectionItemType(n.i) == 1 &&
|
!dataAcquisitionEidtAble) ||
|
(n.u != loginUserInfo.userId &&
|
n.u != undefined &&
|
n.u != '')
|
"
|
@input="handleInput(n)"
|
@change="
|
(m) =>
|
changeInput(
|
m,
|
`${item.templateId}-${n.r}-${n.c}-${n.i}`,
|
n,
|
'getDataType'
|
)
|
"
|
@mousewheel.native.prevent
|
:key="'abc-' + '000' + index + '000' + i + '000' + j"
|
@keydown.enter="
|
changeInput(
|
'',
|
`${item.templateId}-${n.r}-${n.c}-${n.i}`,
|
n,
|
'getDataType'
|
)
|
"
|
>
|
<!-- <el-button slot="append" type="primary" icon="el-icon-edit" size="mini"
|
v-if="getInspectionItemType(n.i) == 1" @click="getSystemValue(n)"></el-button> -->
|
</el-input>
|
<el-input
|
v-else-if="getInspectionValueType(n.i) == 2"
|
class="table_input"
|
type="textarea"
|
v-model="n.v.v"
|
:disabled="
|
getInspectionItemType(n.i) == 1 ||
|
(n.u != loginUserInfo.userId &&
|
n.u != undefined &&
|
n.u != '')
|
"
|
@change="
|
(m) =>
|
changeInput(
|
m,
|
`${item.templateId}-${n.r}-${n.c}-${n.i}`,
|
n,
|
'getDataType'
|
)
|
"
|
/>
|
<el-select
|
v-else-if="getInspectionValueType(n.i) == 5"
|
class="table_input"
|
v-model="n.v.v"
|
:disabled="
|
state > 1 ||
|
getInspectionItemType(n.i) == 1 ||
|
(n.u != loginUserInfo.userId &&
|
n.u != undefined &&
|
n.u != '')
|
"
|
@visible-change="(e) => getDic(e, n.i)"
|
@change="
|
(m) =>
|
changeInput(
|
m,
|
`${item.templateId}-${n.r}-${n.c}-${n.i}`,
|
n,
|
'getDataType'
|
)
|
"
|
>
|
<el-option
|
v-for="(e, i) in enumList"
|
:key="i"
|
:label="e.dictLabel"
|
:value="e.dictValue"
|
></el-option>
|
</el-select>
|
<span
|
:style="`font-family:${n.v.ff} !important;`"
|
v-else-if="getInspectionValueType(n.i) == 4"
|
>/</span
|
>
|
</template>
|
<template
|
v-else-if="n.v.ps != undefined && n.v.ps.value === '结论'"
|
>
|
<template>
|
<span
|
v-if="n.v.v === 1"
|
:style="`font-family:${n.v.ff} !important;color: green;`"
|
>合格</span
|
>
|
<span
|
v-else-if="n.v.v === 0"
|
:style="`font-family:${n.v.ff} !important;color: red;`"
|
>不合格</span
|
>
|
<span
|
v-else-if="n.v.v === 3"
|
:style="`font-family:${n.v.ff} !important;color: #3A7BFA;`"
|
>不判定</span
|
>
|
<span v-else :style="`font-family:${n.v.ff} !important;`"
|
>待定</span
|
>
|
</template>
|
</template>
|
<template
|
v-else-if="
|
n.v.ps != undefined &&
|
n.v.ps.value === '设备编码' &&
|
state == 1
|
"
|
>
|
<el-select
|
v-model="n.v.v"
|
placeholder="设备"
|
:disabled="
|
n.u != loginUserInfo.userId &&
|
n.u != undefined &&
|
n.u != ''
|
"
|
class="table_input"
|
@visible-change="(e) => getEquipOptions(e, n.i)"
|
remote
|
@change="(val) => changeEquip(val, n)"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</template>
|
<template
|
v-else-if="
|
n.v.ps != undefined &&
|
n.v.ps.value === '设备名称' &&
|
state == 1
|
"
|
>
|
<span>{{ n.v.v }}</span>
|
</template>
|
<template
|
v-else-if="
|
n.v.ps != undefined &&
|
n.v.ps.value === '要求值' &&
|
state == 1
|
"
|
>
|
<span :style="`font-family:${n.v.ff} !important;`">{{
|
getTell(n.i)
|
}}</span>
|
</template>
|
<template
|
v-else-if="
|
n.v.ps != undefined &&
|
n.v.ps.value === '计算值' &&
|
state == 1
|
"
|
><span :style="`font-family:${n.v.ff} !important;`">{{
|
toFixed(n.v.v, n.v.ct)
|
}}</span></template
|
>
|
<template
|
v-else-if="
|
n.v.ps != undefined &&
|
n.v.ps.value === '最终值' &&
|
state == 1
|
"
|
>
|
<span :style="`font-family:${n.v.ff} !important;`">{{
|
toFixed(n.v.v, n.v.ct)
|
}}</span>
|
</template>
|
<template
|
v-else-if="
|
n.v.ps != undefined && n.v.ps.value === '样品编号'
|
"
|
>
|
<div
|
style="
|
display: flex;
|
flex-wrap: nowrap;
|
align-items: center;
|
width: 100%;
|
"
|
:title="currentSample.sampleCode"
|
>
|
<i
|
class="el-icon-caret-left table_caret"
|
style="width: 16px"
|
@click="caretSample(-1)"
|
v-if="!currentFiberOpticTape && !currentFiberOptic"
|
></i>
|
<div
|
:style="`font-family:${n.v.ff} !important;overflow: hidden;white-space: nowrap;width: calc(100% - 32px);`"
|
>
|
{{ currentSample.sampleCode }}
|
</div>
|
<i
|
class="el-icon-caret-right table_caret"
|
style="width: 16px"
|
v-if="!currentFiberOpticTape && !currentFiberOptic"
|
@click="caretSample(1)"
|
></i>
|
</div>
|
</template>
|
<template
|
v-else-if="
|
n.v.ps != undefined && n.v.ps.value === '样品型号'
|
"
|
>
|
<div
|
:style="`font-family:${n.v.ff} !important;`"
|
v-if="
|
currentSample.model !== undefined &&
|
currentSample.model !== null
|
"
|
>
|
{{ currentSample.model }}
|
</div>
|
</template>
|
<template
|
v-else-if="n.v.ps != undefined && n.v.ps.value === '套管'"
|
>
|
<div
|
style="
|
display: flex;
|
flex-wrap: nowrap;
|
align-items: center;
|
"
|
>
|
<!-- <i class="el-icon-caret-left table_caret" @click="caretBushing(-1)"></i> -->
|
<div :style="`font-family:${n.v.ff} !important;`">
|
{{ currentBushing ? currentBushing.color : "" }}
|
</div>
|
<!-- <i class="el-icon-caret-right table_caret" @click="caretBushing(1)"></i> -->
|
</div>
|
</template>
|
<template
|
v-else-if="n.v.ps != undefined && n.v.ps.value === '光纤带'"
|
>
|
<div
|
style="
|
display: flex;
|
flex-wrap: nowrap;
|
align-items: center;
|
"
|
>
|
<i
|
class="el-icon-caret-left table_caret"
|
@click="caretTape(-1)"
|
v-if="currentFiberOpticTape"
|
></i>
|
<div :style="`font-family:${n.v.ff} !important;`">
|
{{
|
currentFiberOpticTape
|
? currentFiberOpticTape.code
|
: ""
|
}}
|
</div>
|
<i
|
class="el-icon-caret-right table_caret"
|
v-if="currentFiberOpticTape"
|
@click="caretTape(1)"
|
></i>
|
</div>
|
</template>
|
<template
|
v-else-if="n.v.ps != undefined && n.v.ps.value === '光纤'"
|
>
|
<div
|
style="
|
display: flex;
|
flex-wrap: nowrap;
|
align-items: center;
|
"
|
>
|
<i
|
class="el-icon-caret-left table_caret"
|
@click="caretOptic(-1)"
|
v-if="currentFiberOptic"
|
></i>
|
<div :style="`font-family:${n.v.ff} !important;`">
|
{{ currentFiberOptic ? currentFiberOptic.color : "" }}
|
</div>
|
<i
|
v-if="currentFiberOptic"
|
class="el-icon-caret-right table_caret"
|
@click="caretOptic(1)"
|
></i>
|
</div>
|
</template>
|
<span
|
v-else
|
:style="`font-family:${n.v.ff} !important;`"
|
v-html="getValue(n.v)"
|
></span>
|
</div>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
<!-- 弧垂特性检验原始记录 -->
|
<div
|
v-loading="tableLoading"
|
v-else-if="
|
tableLists.find((m) => m.templateId == currentTable).templateName ==
|
'弧垂特性检验原始记录'
|
"
|
>
|
<el-divider></el-divider>
|
<h4
|
style="
|
margin-bottom: 20px;
|
font-size: 24px;
|
font-weight: 400;
|
text-align: center;
|
"
|
>
|
弧垂特性检验原始记录
|
</h4>
|
<el-form
|
:inline="true"
|
:model="sagForm"
|
class="form-inline"
|
label-width="120px"
|
style="
|
justify-content: flex-start;
|
display: flex;
|
align-items: center;
|
width: 100%;
|
"
|
>
|
<el-form-item label="样品型号" style="margin-bottom: 0">
|
<el-input
|
clearable
|
v-model="sagForm.model"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
<el-form-item label="检验依据" style="margin-bottom: 0">
|
<el-input
|
clearable
|
v-model="sagForm.methodName"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
<!-- <el-form-item label="设备名称" style="margin-bottom: 0">
|
<el-input
|
clearable
|
v-model="equipForm.value0"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item> -->
|
<el-form-item label="设备名称" style="margin-bottom: 0">
|
<el-select
|
ref="sag"
|
multiple
|
collapse-tags
|
style="margin-left: 20px; width: 280px"
|
v-model="equipForm.value0"
|
size="small"
|
@change="blockModifications('sag')"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.label"
|
:value="item.label"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="设备编号" style="margin-bottom: 0">
|
<el-select
|
multiple
|
collapse-tags
|
style="margin-left: 20px; width: 280px"
|
v-model="equipForm.code0"
|
:disabled="state > 1"
|
placeholder="请选择"
|
size="small"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="额定拉断力/kN" style="margin-bottom: 0">
|
<el-input
|
clearable
|
v-model="sagForm.tensileForce"
|
size="small"
|
placeholder="请输入"
|
:disabled="state > 1"
|
@change="(m) => saveSageInfo('额定拉断力', m)"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="跨距长度/m" style="margin-bottom: 0">
|
<el-input
|
clearable
|
v-model="sagForm.spanLength"
|
size="small"
|
placeholder="请输入"
|
@change="(m) => saveSageInfo('跨距长度', m)"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="载荷/kN" style="margin-bottom: 0">
|
<el-input
|
clearable
|
v-model="sagForm.load"
|
size="small"
|
placeholder="请输入"
|
:disabled="state > 1"
|
@change="(m) => saveSageInfo('载荷', m)"
|
></el-input>
|
<!-- <el-select-->
|
<!-- v-model="sagForm.load"-->
|
<!-- :disabled="state > 1"-->
|
<!-- placeholder="请选择"-->
|
<!-- size="small"-->
|
<!-- @change="(m) => saveSageInfo('载荷', m)"-->
|
<!-- >-->
|
<!-- <el-option-->
|
<!-- v-for="item in loadList"-->
|
<!-- :key="item.label"-->
|
<!-- :label="item.value"-->
|
<!-- :value="item.label"-->
|
<!-- >-->
|
<!-- </el-option>-->
|
<!-- </el-select>-->
|
</el-form-item>
|
</el-form>
|
<el-divider></el-divider>
|
<div class="container">
|
<el-button
|
class="right-button"
|
type="primary"
|
size="small"
|
@click="addSag"
|
>添 加</el-button
|
>
|
</div>
|
<el-table
|
:data="sagData"
|
class="custom-table"
|
border
|
style="margin-bottom: 20px"
|
>
|
<!-- <el-table-column label="高度 h mm" prop="height" align="center">
|
<template slot-scope="scope">
|
<el-input v-model="scope.row.height" style="width: 100%;" size="small" @change="m=>saveSageInfo('高度','height')"></el-input>
|
</template>
|
</el-table-column> -->
|
<el-table-column label="弧垂 mm" prop="sag" align="center">
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.sag"
|
size="small"
|
style="width: 100%"
|
:disabled="state > 1"
|
@change="(m) => saveSageInfo('弧垂', 'sag')"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column label="导线温度℃" align="center">
|
<el-table-column label="1" prop="value0" align="center">
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.value0"
|
style="width: 100%"
|
size="small"
|
:disabled="state > 1"
|
@change="(m) => saveSageInfo('导线温度', scope.row)"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column label="2" prop="value1" align="center">
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.value1"
|
style="width: 100%"
|
size="small"
|
:disabled="state > 1"
|
@change="(m) => saveSageInfo('导线温度', scope.row)"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column label="3" prop="value2" align="center">
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.value2"
|
style="width: 100%"
|
size="small"
|
:disabled="state > 1"
|
@change="(m) => saveSageInfo('导线温度', scope.row)"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column label="4" prop="value3" align="center">
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.value3"
|
style="width: 100%"
|
size="small"
|
:disabled="state > 1"
|
@change="(m) => saveSageInfo('导线温度', scope.row)"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column label="5" prop="value4" align="center">
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.value4"
|
style="width: 100%"
|
size="small"
|
:disabled="state > 1"
|
@change="(m) => saveSageInfo('导线温度', scope.row)"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column label="6" prop="value5" align="center">
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.value5"
|
style="width: 100%"
|
size="small"
|
:disabled="state > 1"
|
@change="(m) => saveSageInfo('导线温度', scope.row)"
|
></el-input>
|
</template>
|
</el-table-column>
|
</el-table-column>
|
<el-table-column label="平均温度℃" prop="average" align="center">
|
</el-table-column>
|
<el-table-column label="室温℃" prop="temperature" align="center">
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.temperature"
|
style="width: 100%"
|
size="small"
|
:disabled="state > 1"
|
@change="(m) => saveSageInfo('室温', 'temperature')"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column label="张力kN" prop="remark" align="center">
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.remark"
|
style="width: 100%"
|
size="small"
|
:disabled="state > 1"
|
@change="(m) => saveSageInfo('张力', 'remark')"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" align="center">
|
<template slot-scope="scope">
|
<el-button
|
type="text"
|
size="small"
|
@click="deleteSag(scope.$index)"
|
><span style="color: red">删除</span></el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<!-- 温度循环检验原始记录 -->
|
<div
|
v-loading="tableLoading"
|
v-else-if="
|
tableLists.find((m) => m.templateId == currentTable).templateName ==
|
'温度循环检验原始记录'
|
"
|
>
|
<el-divider></el-divider>
|
<h4
|
style="
|
margin-bottom: 20px;
|
font-size: 24px;
|
font-weight: 400;
|
text-align: center;
|
"
|
>
|
温度循环检验原始记录
|
</h4>
|
<el-form
|
:inline="true"
|
:model="wareForm"
|
class="form-inline"
|
label-width="100px"
|
style="
|
justify-content: flex-start;
|
display: flex;
|
align-items: center;
|
width: 100%;
|
"
|
>
|
<el-form-item label="型号:" style="margin-bottom: 0">
|
<el-input
|
clearable
|
v-model="wareForm0.model"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
<el-form-item label="试验方法:" style="margin-bottom: 0">
|
<el-input
|
clearable
|
v-model="wareForm0.methodName"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
<!-- <el-form-item label="检测依据:" style="margin-bottom: 0;">
|
<el-input clearable v-model="wareForm0.sample" disabled size="small" placeholder=""></el-input>
|
</el-form-item> -->
|
<el-form-item label="循环次数:" style="margin-bottom: 0">
|
<el-select
|
v-model="wareForm.inspectionItem"
|
placeholder="请选择"
|
size="small"
|
@change="(m) => wareFormChange(m, 'inspectionItem')"
|
>
|
<el-option
|
v-for="item in numOptions"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="温度:" style="margin-bottom: 0">
|
<el-select
|
v-model="wareForm.inspectionItemSubclass"
|
placeholder="请选择"
|
size="small"
|
@change="(m) => wareFormChange(m, 'inspectionItemSubclass')"
|
>
|
<el-option
|
v-for="item in temperatureOptions"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
<span style="margin-left: 4px">℃</span>
|
</el-form-item>
|
</el-form>
|
<el-divider></el-divider>
|
<el-form
|
:inline="true"
|
:model="equipForm"
|
label-width="100px"
|
style="
|
justify-content: flex-start;
|
display: flex;
|
align-items: center;
|
width: 100%;
|
"
|
>
|
<el-form-item label="仪器名称:">
|
<el-input
|
clearable
|
v-model="equipForm.value0"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
<el-form-item label="仪器编号:">
|
<el-select
|
v-model="equipForm.code0"
|
:disabled="state > 1"
|
placeholder="请选择"
|
size="small"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="仪器名称:">
|
<el-input
|
clearable
|
v-model="equipForm.value1"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
<el-form-item label="仪器编号:">
|
<el-select
|
v-model="equipForm.code1"
|
:disabled="state > 1"
|
placeholder="请选择"
|
size="small"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-form>
|
<el-table
|
:data="wareTableData"
|
ref="wareTableData"
|
border
|
v-loading="wareTableDataLoading"
|
style="width: 100%; margin-bottom: 30px"
|
align="center"
|
v-if="
|
(wareForm.inspectionItemSubclass != '20(常温)' &&
|
wareForm.inspectionItemSubclass != '20') ||
|
(wareForm.inspectionItemSubclass == '20(常温)' &&
|
wareForm.inspectionItem == 1) ||
|
(wareForm.inspectionItemSubclass == '20' &&
|
wareForm.inspectionItem == numOptions.length)
|
"
|
>
|
<el-table-column label="序号" type="index" width="59" align="center">
|
</el-table-column>
|
<el-table-column
|
prop="bushColor"
|
label="管色标"
|
width="75"
|
align="center"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="code"
|
label="光纤带编号"
|
width="105"
|
align="center"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="color"
|
label="光纤色标"
|
align="center"
|
width="90"
|
>
|
</el-table-column>
|
<template v-for="(item, index) in wareLength">
|
<el-table-column
|
prop="value0"
|
label="外端"
|
align="center"
|
width="100"
|
:key="new Date().getTime() + '1234567'"
|
>
|
<template slot="header">
|
{{ "外端" + (index + 1) }}
|
</template>
|
<template slot-scope="scope">
|
<el-input
|
size="small"
|
v-model="scope.row.arr[index].value0"
|
placeholder=""
|
:disabled="state > 1 || !dataAcquisitionEidtAble"
|
@change="(m) => changeItem(scope.row.arr[index])"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="value1"
|
label="内端"
|
align="center"
|
width="100"
|
:key="new Date().getTime() + '23333333'"
|
>
|
<template slot="header">
|
{{ "内端" + (index + 1) }}
|
</template>
|
<template slot-scope="scope">
|
<el-input
|
size="small"
|
:disabled="state > 1 || !dataAcquisitionEidtAble"
|
v-model="scope.row.arr[index].value1"
|
placeholder=""
|
@change="(m) => changeItem(scope.row.arr[index])"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="comValue"
|
align="center"
|
min-width="150"
|
:key="new Date().getTime() + '364654654'"
|
>
|
<template slot="header">
|
{{ "衰减系数" + item }}
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.arr[index].comValue }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="resValue"
|
label="衰减差"
|
align="center"
|
v-if="wareForm.inspectionItemSubclass != '20(常温)'"
|
min-width="90"
|
:key="new Date().getTime() + '434634634634'"
|
>
|
<template slot="header">
|
{{ "衰减差" + (index + 1) }}
|
</template>
|
<template slot-scope="scope">
|
<span>{{ scope.row.arr[index].resValue }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="insResult"
|
label="结论"
|
align="center"
|
min-width="70"
|
v-if="wareForm.inspectionItemSubclass != '20(常温)'"
|
:key="new Date().getTime() + '53457689809808-'"
|
>
|
<template slot="header">
|
{{ "结论" + (index + 1) }}
|
</template>
|
<template slot-scope="scope">
|
<span
|
v-if="scope.row.arr[index].insResult === 1"
|
style="color: green"
|
>合格</span
|
>
|
<span
|
v-else-if="scope.row.arr[index].insResult === 0"
|
style="color: red"
|
>不合格</span
|
>
|
<span
|
v-else-if="scope.row.arr[index].insResult === 3"
|
style="color: #3a7bfa"
|
>不判定</span
|
>
|
<span v-else>待定</span>
|
</template>
|
</el-table-column>
|
</template>
|
</el-table>
|
</div>
|
<!-- 热循环/温升试验检验原始记录 -->
|
<div
|
v-loading="tableLoading"
|
v-else-if="
|
tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('热循环') ||
|
tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('温升试验')
|
"
|
>
|
<el-divider></el-divider>
|
<h4
|
style="
|
margin-bottom: 20px;
|
font-size: 24px;
|
font-weight: 400;
|
text-align: center;
|
"
|
>
|
{{
|
tableLists.find((m) => m.templateId == currentTable).templateName
|
}}
|
</h4>
|
<el-form
|
:inline="true"
|
:model="wareForm"
|
class="form-inline"
|
label-width="100px"
|
style="
|
justify-content: flex-start;
|
display: flex;
|
align-items: center;
|
width: 100%;
|
"
|
>
|
<!-- <el-form-item label="仪器名称:" style="margin-bottom: 0">
|
<el-input
|
clearable
|
v-model="equipForm.value0"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item> -->
|
<el-form-item label="仪器名称" style="margin-bottom: 0">
|
<el-select
|
ref="thermalCycle"
|
multiple
|
collapse-tags
|
style="margin-left: 20px; width: 280px"
|
v-model="equipForm.value0"
|
size="small"
|
@change="blockModifications('thermalCycle')"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.label"
|
:value="item.label"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
|
<!-- <el-form-item label="仪器名称:" style="margin-bottom: 0">
|
<el-input
|
clearable
|
v-model="equipForm.value1"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item> -->
|
<el-form-item label="型号:" style="margin-bottom: 0">
|
<el-input
|
clearable
|
v-model="thermalCyclingInfo.model"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
<el-form-item label="试验方法:" style="margin-bottom: 0">
|
<el-input
|
clearable
|
v-model="thermalCyclingInfo.methodName"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
</el-form>
|
<el-divider></el-divider>
|
<el-form
|
:inline="true"
|
:model="equipForm"
|
label-width="100px"
|
style="
|
justify-content: flex-start;
|
display: flex;
|
align-items: center;
|
width: 100%;
|
"
|
>
|
<el-form-item label="仪器编号:">
|
<el-select
|
multiple
|
collapse-tags
|
style="margin-left: 20px; width: 280px"
|
v-model="equipForm.code0"
|
:disabled="state > 1"
|
placeholder="请选择"
|
size="small"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<!-- <el-form-item label="仪器编号:">
|
<el-select
|
multiple
|
v-model="equipForm.code1"
|
:disabled="state > 1"
|
placeholder="请选择"
|
size="small"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item> -->
|
<!-- <el-form-item-->
|
<!-- label="循环次数:"-->
|
<!-- v-if="thermalCyclingInfo.inspectionItemClass == '直流电阻'"-->
|
<!-- >-->
|
<!-- <el-input-number-->
|
<!-- v-model="thermalCyclingInfo.inspectionItem"-->
|
<!-- :min="1"-->
|
<!-- :max="thermalCyclingInfo.max"-->
|
<!-- label=""-->
|
<!-- style="margin-top: 4px; width: 190px"-->
|
<!-- size="small"-->
|
<!-- @change="thermalCyclingChange"-->
|
<!-- ></el-input-number>-->
|
<!-- </el-form-item>-->
|
<el-button
|
type="primary"
|
size="small"
|
style="margin-bottom: 22px; margin-left: 30px"
|
@click="handleAddThermal"
|
v-if="state == 1"
|
>新增</el-button
|
>
|
<el-button
|
size="small"
|
style="margin-bottom: 22px"
|
@click="handleDeleteThermal"
|
v-if="state == 1"
|
>删除</el-button
|
>
|
</el-form>
|
<div class="table-container" v-loading="thermalCyclingLoading">
|
<table border="1" cellpadding="10" class="thermal-table">
|
<tr>
|
<td>检验项目</td>
|
<td :colspan="thermalCyclingInfo.length">检验过程值</td>
|
<td style="width: 100px">结论</td>
|
</tr>
|
<tr>
|
<td>序号</td>
|
<td
|
v-for="(m, i) in thermalCyclingInfo.length"
|
:key="i"
|
style="min-width: 150px"
|
>
|
{{ i + 1 }}
|
</td>
|
</tr>
|
<tr v-for="(item, index) in thermalCyclingInfo.arr" :key="index">
|
<td style="width: 100px; text-align: center">{{ item.name }}</td>
|
<td
|
v-for="(m, i) in thermalCyclingInfo.length"
|
:key="i"
|
style="min-width: 150px"
|
>
|
<div
|
style="display: flex; align-items: center; margin-bottom: 5px"
|
>
|
<label
|
style="width: 100px; white-space: nowrap; font-size: 12px"
|
>温度:</label
|
>
|
<el-input
|
clearable
|
size="small"
|
placeholder=""
|
v-model="item.arr[i].value0"
|
:disabled="state > 1"
|
@change="(m) => saveThermalCycling(m, item, 'value0')"
|
></el-input>
|
<span
|
style="
|
font-size: 12px;
|
margin-left: 13px;
|
margin-right: 13px;
|
"
|
>
|
℃</span
|
>
|
</div>
|
<div
|
style="display: flex; align-items: center"
|
v-if="
|
item.name != '环境温度' &&
|
thermalCyclingInfo.inspectionItemClass == '直流电阻'
|
"
|
>
|
<label
|
style="width: 100px; white-space: nowrap; font-size: 12px"
|
>直流电阻:</label
|
>
|
<el-input
|
clearable
|
size="small"
|
:disabled="state > 1"
|
placeholder=""
|
v-model="item.arr[i].value1"
|
@change="saveThermalCycling(null, item, null)"
|
></el-input>
|
<span style="margin-left: 5px; font-size: 12px"> Ω/km</span>
|
</div>
|
</td>
|
<td>
|
<template
|
v-if="item.name == '环境温度' || item.name == '导线温度'"
|
>
|
<span>/</span>
|
</template>
|
<template v-else>
|
<span v-if="item.insResult === 1" style="color: green"
|
>合格</span
|
>
|
<span v-else-if="item.insResult === 0" style="color: red"
|
>不合格</span
|
>
|
<span v-else-if="item.insResult === 3" style="color: #3a7bfa"
|
>不判定</span
|
>
|
<span v-else>待定</span>
|
</template>
|
</td>
|
</tr>
|
</table>
|
</div>
|
</div>
|
<!-- 单根垂直燃烧检验原始记录 -->
|
<div
|
v-loading="tableLoading"
|
v-else-if="
|
tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('单根垂直燃烧')
|
"
|
>
|
<el-divider></el-divider>
|
<h4
|
style="
|
margin-bottom: 20px;
|
font-size: 24px;
|
font-weight: 400;
|
text-align: center;
|
"
|
>
|
{{
|
tableLists.find((m) => m.templateId == currentTable).templateName
|
}}
|
</h4>
|
<el-form
|
:inline="true"
|
:model="wareForm"
|
class="form-inline"
|
label-width="100px"
|
style="
|
justify-content: flex-start;
|
display: flex;
|
align-items: center;
|
width: 100%;
|
"
|
>
|
<el-form-item label="仪器名称:" style="margin-bottom: 0">
|
<el-input
|
v-model="equipForm.value0"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
<!-- <el-form-item label="仪器名称" style="margin-bottom: 0">
|
<el-select
|
ref="combustion"
|
multiple
|
collapse-tags
|
style="margin-left: 20px;width: 280px"
|
v-model="equipForm.value0"
|
size="small"
|
@change="blockModifications('combustion')"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.label"
|
:value="item.label"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item> -->
|
<el-form-item label="仪器名称:" style="margin-bottom: 0">
|
<el-input
|
v-model="equipForm.value1"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
<el-form-item label="型号:" style="margin-bottom: 0">
|
<el-input
|
v-model="singleRootVerticalInfo.model"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
<el-form-item label="试验方法:" style="margin-bottom: 0">
|
<el-input
|
v-model="singleRootVerticalInfo.methodName"
|
disabled
|
size="small"
|
placeholder=""
|
></el-input>
|
</el-form-item>
|
</el-form>
|
<el-divider></el-divider>
|
<el-form
|
:inline="true"
|
:model="equipForm"
|
label-width="100px"
|
style="
|
justify-content: flex-start;
|
display: flex;
|
align-items: center;
|
width: 100%;
|
"
|
>
|
<!-- <el-form-item label="仪器编号:">
|
<el-select
|
multiple
|
collapse-tags
|
style="margin-left: 20px;width: 280px"
|
v-model="equipForm.code0"
|
:disabled="state > 1"
|
placeholder="请选择"
|
size="small"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item> -->
|
<el-form-item label="仪器编号:">
|
<el-select
|
v-model="equipForm.code0"
|
:disabled="state > 1"
|
placeholder="请选择"
|
size="small"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="仪器编号:">
|
<el-select
|
v-model="equipForm.code1"
|
:disabled="state > 1"
|
placeholder="请选择"
|
size="small"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-form>
|
<table
|
border="1"
|
cellpadding="10"
|
class="thermal-table"
|
style="margin-bottom: 16px"
|
>
|
<tr>
|
<td>检验项目</td>
|
<td>单位</td>
|
<td>标准要求</td>
|
<td :colspan="singleRootVerticalInfo.num">检验过程值</td>
|
<td>检验结果</td>
|
<td>结论</td>
|
</tr>
|
<tr v-for="(item, index) in singleRootVerticalInfo.arr" :key="index">
|
<td>{{ item.inspectionItemSubclass }}</td>
|
<td>{{ item.unit }}</td>
|
<td>{{ item.ask }}</td>
|
<td v-for="(m, i) in singleRootVerticalInfo.num">
|
<el-input
|
clearable
|
size="small"
|
placeholder=""
|
v-model="item.value[i]"
|
:disabled="state > 1"
|
@change="(value) => changeSingleRootVertical(value, item)"
|
></el-input>
|
</td>
|
<td>{{ item.resValue }}</td>
|
<td>
|
<template>
|
<span v-if="item.insResult === 1" style="color: green"
|
>合格</span
|
>
|
<span v-else-if="item.insResult === 0" style="color: red"
|
>不合格</span
|
>
|
<span v-else-if="item.insResult === 3" style="color: #3a7bfa"
|
>不判定</span
|
>
|
<span v-else>待定</span>
|
</template>
|
</td>
|
</tr>
|
</table>
|
</div>
|
<!-- 架空地线应力应变 -->
|
<div
|
v-loading="tableLoading"
|
v-else-if="
|
tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('架空地线应力应变')
|
"
|
>
|
<el-divider></el-divider>
|
<el-form
|
:inline="true"
|
:model="stressStrainInfo"
|
class="form-inline"
|
label-width="80px"
|
style="
|
justify-content: flex-start;
|
display: flex;
|
align-items: center;
|
width: 100%;
|
"
|
>
|
<el-row style="width: 100%">
|
<el-col :span="5">
|
<el-form-item label="仪器编号:" style="margin-bottom: 0">
|
<el-select
|
multiple
|
collapse-tags
|
style="margin-left: 20px; width: 200px"
|
v-model="equipForm.code0"
|
:disabled="state > 1"
|
placeholder="请选择"
|
size="small"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<!-- <el-form-item label="仪器名称:" style="margin-bottom: 0">
|
<el-input
|
v-model="equipForm.value0"
|
disabled
|
size="small"
|
placeholder=""
|
style="width: 170px"
|
></el-input>
|
</el-form-item> -->
|
<el-form-item label="仪器名称" style="margin-bottom: 0">
|
<el-select
|
ref="stressStrain"
|
multiple
|
collapse-tags
|
style="margin-left: 20px; width: 200px"
|
v-model="equipForm.value0"
|
size="small"
|
@change="blockModifications('stressStrain')"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.label"
|
:value="item.label"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="型号:" style="margin-bottom: 0">
|
<el-input
|
v-model="stressStrainInfo.model"
|
disabled
|
size="small"
|
placeholder=""
|
style="width: 170px"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="试验方法:" style="margin-bottom: 0">
|
<el-input
|
v-model="stressStrainInfo.methodS"
|
disabled
|
size="small"
|
placeholder=""
|
style="width: 170px"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="4">
|
<el-form-item label="" style="margin-bottom: 0"
|
><el-button
|
size="small"
|
type="primary"
|
style="margin-left: 40px"
|
@click="addStressStrain"
|
:disabled="state > 1"
|
>添 加</el-button
|
><el-button
|
size="small"
|
type="primary"
|
style="margin-left: 10px"
|
@click="saveStressStrain"
|
:disabled="state > 1"
|
>保 存</el-button
|
></el-form-item
|
>
|
</el-col>
|
</el-row>
|
</el-form>
|
<table
|
style="border-collapse: collapse"
|
border="1"
|
cellpadding="10"
|
class="thermal-table"
|
>
|
<tbody>
|
<tr style="background-color: #f0f1f5">
|
<td id="lineTd" style="background-color: #f0f1f5">
|
<span
|
style="
|
float: left;
|
margin-top: 20px;
|
background-color: #f0f1f5;
|
"
|
>力值</span
|
>
|
<span
|
style="
|
float: right;
|
margin-top: 0px;
|
background-color: #f0f1f5;
|
"
|
>位移(mm)</span
|
>
|
</td>
|
<td v-for="(m, i) in timeList" :key="i">{{ m }}min</td>
|
<td>操作</td>
|
</tr>
|
<tr v-for="(item, index) in powerList" :key="index">
|
<td>
|
<el-input
|
v-model="item.value"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
></el-input>
|
</td>
|
<td v-for="(m, i) in timeList" :key="i">
|
<el-input
|
v-model="item.arr[i]"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
></el-input>
|
</td>
|
<td>
|
<el-button
|
size="small"
|
type="text"
|
@click="delStressStrain(index)"
|
style="color: red"
|
>删除</el-button
|
>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
<div
|
style="
|
display: flex;
|
align-items: center;
|
margin-top: 16px;
|
margin-bottom: 20px;
|
"
|
>
|
<span>弹性模量:</span>
|
<el-input
|
size="small"
|
style="width: 100px"
|
@change="changeElasticity"
|
v-model="stressStrainInfo.elasticity"
|
:disabled="state > 1"
|
></el-input>
|
<span style="color: red; font-size: 12px; margin-left: 16px"
|
>标准量为:{{
|
stressStrainInfo.ask ? stressStrainInfo.ask : "-"
|
}}
|
,不能超过标准量的±2</span
|
>
|
</div>
|
</div>
|
<!-- 防振锤功率特性 -->
|
<div
|
v-loading="tableLoading"
|
v-else-if="
|
tableLists
|
.find((m) => m.templateId == currentTable)
|
.templateName.includes('防振锤功率特性')
|
"
|
>
|
<el-divider></el-divider>
|
<el-form
|
:inline="true"
|
:model="powerCharacteristicsInfo"
|
class="form-inline"
|
label-width="80px"
|
style="
|
justify-content: flex-start;
|
display: flex;
|
align-items: center;
|
width: 100%;
|
"
|
>
|
<el-row style="width: 100%">
|
<el-col :span="5">
|
<el-form-item label="仪器编号:" style="margin-bottom: 0">
|
<el-select
|
multiple
|
collapse-tags
|
style="margin-left: 20px; width: 280px"
|
v-model="equipForm.code0"
|
:disabled="state > 1"
|
placeholder="请选择"
|
size="small"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<!-- <el-form-item label="仪器名称:" style="margin-bottom: 0">
|
<el-input
|
v-model="equipForm.value0"
|
disabled
|
size="small"
|
placeholder=""
|
style="width: 170px"
|
></el-input>
|
</el-form-item> -->
|
<el-form-item label="仪器名称" style="margin-bottom: 0">
|
<el-select
|
ref="shockproofHammer"
|
multiple
|
collapse-tags
|
style="margin-left: 20px; width: 280px"
|
v-model="equipForm.value0"
|
size="small"
|
@change="blockModifications('shockproofHammer')"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.label"
|
:value="item.label"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="型号:" style="margin-bottom: 0">
|
<el-input
|
v-model="powerCharacteristicsInfo.model"
|
disabled
|
size="small"
|
placeholder=""
|
style="width: 170px"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="试验方法:" style="margin-bottom: 0">
|
<el-input
|
v-model="powerCharacteristicsInfo.methodS"
|
disabled
|
size="small"
|
placeholder=""
|
style="width: 170px"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="4">
|
<el-form-item label="" style="margin-top: 4px"
|
><el-button
|
size="small"
|
type="primary"
|
style="margin-left: 10px"
|
@click="savePowerCharacteristics"
|
:disabled="state > 1"
|
>保 存</el-button
|
></el-form-item
|
>
|
</el-col>
|
</el-row>
|
</el-form>
|
<table
|
style="border-collapse: collapse; margin-bottom: 20px"
|
border="1"
|
cellpadding="10"
|
class="thermal-table"
|
>
|
<tr
|
style="background-color: #f0f1f5; font-size: 18px; font-weight: 700"
|
>
|
<td colspan="8">(疲劳前)功率特性</td>
|
</tr>
|
<tr style="background-color: #f0f1f5">
|
<td colspan="4">谐振频率(Hz)</td>
|
<td colspan="4">耗能(W)</td>
|
</tr>
|
<tr>
|
<td>1</td>
|
<td>2</td>
|
<td>3</td>
|
<td>4</td>
|
<td>1</td>
|
<td>2</td>
|
<td>3</td>
|
<td>4</td>
|
</tr>
|
<tr>
|
<td v-for="(m, i) in powerCharacteristicsInfo.arr0" :key="i">
|
<el-input
|
v-model="powerCharacteristicsInfo.arr0[i].value"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
></el-input>
|
</td>
|
<td v-for="(m, i) in powerCharacteristicsInfo.arr1" :key="i + 9">
|
<el-input
|
v-model="powerCharacteristicsInfo.arr1[i].value"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
></el-input>
|
</td>
|
</tr>
|
</table>
|
|
<table
|
style="border-collapse: collapse; margin-bottom: 20px"
|
border="1"
|
cellpadding="10"
|
class="thermal-table"
|
>
|
<tr
|
style="background-color: #f0f1f5; font-size: 18px; font-weight: 700"
|
>
|
<td colspan="8">(疲劳后)功率特性</td>
|
</tr>
|
<tr style="background-color: #f0f1f5">
|
<td colspan="4">谐振频率(Hz)</td>
|
<td colspan="4">耗能(W)</td>
|
</tr>
|
<tr>
|
<td>1</td>
|
<td>2</td>
|
<td>3</td>
|
<td>4</td>
|
<td>1</td>
|
<td>2</td>
|
<td>3</td>
|
<td>4</td>
|
</tr>
|
<tr>
|
<td v-for="(m, i) in powerCharacteristicsInfo.arr2" :key="i + 19">
|
<el-input
|
v-model="powerCharacteristicsInfo.arr2[i].value"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
@change="(m) => changeArr2(m, i)"
|
></el-input>
|
</td>
|
<td v-for="(m, i) in powerCharacteristicsInfo.arr3" :key="i + 29">
|
<el-input
|
v-model="powerCharacteristicsInfo.arr3[i].value"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
@change="(m) => changeArr3(m, i)"
|
></el-input>
|
</td>
|
</tr>
|
<tr>
|
<td v-for="(m, i) in powerCharacteristicsInfo.arr2" :key="i + 39">
|
<span v-if="!m.state">待定</span>
|
<span v-if="m.state == 1" style="color: green">合格</span>
|
<span v-if="m.state == 2" style="color: red">不合格</span>
|
</td>
|
<td v-for="(m, i) in powerCharacteristicsInfo.arr3" :key="i + 49">
|
<span v-if="!m.state">待定</span>
|
<span v-if="m.state == 1" style="color: green">合格</span>
|
<span v-if="m.state == 2" style="color: red">不合格</span>
|
</td>
|
</tr>
|
</table>
|
|
<div style="margin-bottom: 20px; font-size: 12px; color: red">
|
提示:(疲劳前)功率特性存在的情况下,(疲劳后)功率特性下面的值需要在疲劳前值*0.8和疲劳前值*1.2之间。
|
</div>
|
</div>
|
<!-- 疲劳试验检验原始记录 -->
|
<div
|
v-loading="tableLoading"
|
v-else-if="
|
tableLists.find((m) => m.templateId == currentTable).templateName ==
|
'疲劳试验检验原始记录'
|
"
|
>
|
<el-divider></el-divider>
|
<el-form
|
:inline="true"
|
:model="fatigueTestInfo"
|
class="form-inline"
|
label-width="80px"
|
style="
|
justify-content: flex-start;
|
display: flex;
|
align-items: center;
|
width: 100%;
|
"
|
>
|
<el-row style="width: 100%">
|
<el-col :span="5">
|
<el-form-item label="仪器编号:" style="margin-bottom: 0">
|
<el-select
|
multiple
|
collapse-tags
|
v-model="equipForm.code0"
|
:disabled="state > 1"
|
placeholder="请选择"
|
size="small"
|
style="margin-left: 20px; width: 200px"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.value"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<!-- <el-form-item label="仪器名称:" style="margin-bottom: 0">
|
<el-input
|
v-model="equipForm.value0"
|
disabled
|
size="small"
|
placeholder=""
|
style="width: 170px"
|
></el-input>
|
</el-form-item> -->
|
<el-form-item label="仪器名称" style="margin-bottom: 0">
|
<el-select
|
ref="fatigueTest"
|
multiple
|
collapse-tags
|
style="margin-left: 20px; width: 200px"
|
v-model="equipForm.value0"
|
size="small"
|
@change="blockModifications('fatigueTest')"
|
>
|
<el-option
|
v-for="item in equipOptions"
|
:key="item.value"
|
:label="item.label"
|
:value="item.label"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="型号:" style="margin-bottom: 0">
|
<el-input
|
v-model="fatigueTestInfo.model"
|
disabled
|
size="small"
|
placeholder=""
|
style="width: 170px"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="试验方法:" style="margin-bottom: 0">
|
<el-input
|
v-model="fatigueTestInfo.methodS"
|
disabled
|
size="small"
|
placeholder=""
|
style="width: 170px"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="4">
|
<el-form-item label="" style="margin-top: 4px"
|
><el-button
|
size="small"
|
type="primary"
|
style="margin-left: 10px"
|
@click="saveFatigueTest"
|
:disabled="state > 1"
|
>保 存</el-button
|
></el-form-item
|
>
|
</el-col>
|
</el-row>
|
</el-form>
|
<table
|
style="border-collapse: collapse; margin-bottom: 20px"
|
border="1"
|
cellpadding="10"
|
class="thermal-table"
|
>
|
<tr>
|
<td class="background-grey">开始时间</td>
|
<td>
|
<el-date-picker
|
v-model="fatigueTestInfo.startTime"
|
type="datetime"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
style="width: 100%"
|
>
|
</el-date-picker>
|
</td>
|
<td class="background-grey">结束时间</td>
|
<td>
|
<el-date-picker
|
v-model="fatigueTestInfo.endTime"
|
type="datetime"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
style="width: 100%"
|
>
|
</el-date-picker>
|
</td>
|
<td class="background-grey">施加张力</td>
|
<td>
|
<el-input
|
v-model="fatigueTestInfo.tension"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="display: inline-block; width: 80%"
|
></el-input>
|
<span>kN</span>
|
</td>
|
</tr>
|
<tr>
|
<td class="background-grey">激振器到固定端距离</td>
|
<td>
|
<el-input
|
v-model="fatigueTestInfo.distance0"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="display: inline-block; width: 80%"
|
></el-input>
|
<span>m</span>
|
</td>
|
<td class="background-grey">激振器到悬垂线夹距离</td>
|
<td>
|
<el-input
|
v-model="fatigueTestInfo.distance1"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="display: inline-block; width: 80%"
|
></el-input>
|
<span>m</span>
|
</td>
|
<td class="background-grey">频率</td>
|
<td>
|
<el-input
|
v-model="fatigueTestInfo.frequency"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="display: inline-block; width: 80%"
|
></el-input>
|
<span>Hz</span>
|
</td>
|
</tr>
|
<tr>
|
<td class="background-grey">波腹振幅</td>
|
<td>
|
<el-input
|
v-model="fatigueTestInfo.amplitude0"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="display: inline-block; width: 80%"
|
></el-input>
|
<span>mm</span>
|
</td>
|
<td class="background-grey">半波长</td>
|
<td>
|
<el-input
|
v-model="fatigueTestInfo.wavelength"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="display: inline-block; width: 80%"
|
></el-input>
|
<span>m</span>
|
</td>
|
<td class="background-grey">弯曲振幅</td>
|
<td>
|
<el-input
|
v-model="fatigueTestInfo.amplitude1"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="display: inline-block; width: 80%"
|
></el-input>
|
<span>mm</span>
|
</td>
|
</tr>
|
<tr>
|
<td class="background-grey">弯曲应变</td>
|
<td>
|
<el-input
|
v-model="fatigueTestInfo.strain"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="display: inline-block; width: 80%"
|
></el-input>
|
<span>μ t</span>
|
</td>
|
<td class="background-grey">档距</td>
|
<td>
|
<el-input
|
v-model="fatigueTestInfo.pitch"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="display: inline-block; width: 80%"
|
></el-input>
|
<span>m</span>
|
</td>
|
<td class="background-grey">振动次数</td>
|
<td>
|
<el-input
|
v-model="fatigueTestInfo.num"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="display: inline-block; width: 80%"
|
></el-input>
|
<span>次</span>
|
</td>
|
</tr>
|
<tr>
|
<td class="background-grey">目视可见损伤</td>
|
<td>
|
<el-select
|
v-model="fatigueTestInfo.damage"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="display: inline-block; width: 80%"
|
>
|
<el-option label="符合" value="符合" />
|
<el-option label="不符合" value="不符合" />
|
</el-select>
|
</td>
|
<td
|
class="background-grey"
|
v-if="
|
fatigueTestInfo.sampleType &&
|
fatigueTestInfo.sampleType.includes('预绞式金具')
|
"
|
>
|
光纤附加衰减
|
</td>
|
<td
|
v-if="
|
fatigueTestInfo.sampleType &&
|
fatigueTestInfo.sampleType.includes('预绞式金具')
|
"
|
>
|
<el-input
|
v-model="fatigueTestInfo.attenuation"
|
:disabled="state > 1"
|
size="small"
|
placeholder=""
|
style="display: inline-block; width: 80%"
|
></el-input>
|
<span>dB</span>
|
</td>
|
</tr>
|
</table>
|
</div>
|
<el-upload
|
:action="action"
|
:data="{
|
orderId: id,
|
}"
|
v-if="state == 1 && fileAdd"
|
:on-success="handleSuccessUp"
|
:show-file-list="false"
|
accept=".jpg,.jpeg,.png,.bmp,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar"
|
:headers="headers"
|
:on-change="beforeUpload"
|
style="width: 80px !important"
|
:on-error="onError"
|
ref="upload"
|
>
|
<el-button size="small" type="primary" v-if="state == 1"
|
>附件上传</el-button
|
>
|
</el-upload>
|
<!-- <ValueTable
|
class="value-table"
|
ref="fileList"
|
:url="$api.insOrderPlan.getFileList"
|
:componentData="componentData0"
|
:delUrl="$api.insOrderPlan.delfile"
|
:key="upIndex"
|
style="height: 100%; margin-top: 16px"
|
/> -->
|
</div>
|
<el-drawer title="光纤切换" :visible.sync="fiberOpticVisible" :size="500">
|
<el-table
|
class="el-table"
|
ref="fiberOpticTable"
|
:data="fiberOptic"
|
height="100%"
|
tooltip-effect="dark"
|
border
|
highlight-current-row
|
@row-click="handleChangeOptic"
|
:row-class-name="tableRowClassName"
|
:current-row-key="currentKey2"
|
:row-key="(record) => record.index"
|
v-if="fiberOpticVisible"
|
>
|
<el-table-column
|
type="index"
|
align="center"
|
label="序号"
|
width="70px"
|
:key="Math.random()"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="bushColor"
|
label="管套色标"
|
min-width="100px"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
prop="color"
|
label="光纤色标"
|
min-width="100px"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
prop="model"
|
label="光纤规格"
|
min-width="130px"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
prop="standard"
|
label="参考标准"
|
width="100px"
|
show-overflow-tooltip
|
></el-table-column>
|
</el-table>
|
</el-drawer>
|
<el-drawer
|
title="光纤带切换"
|
:visible.sync="fiberOpticTapeVisible"
|
:size="500"
|
>
|
<el-table
|
class="el-table"
|
ref="fiberOpticTapeTable"
|
:data="fiberOpticTape"
|
height="100%"
|
tooltip-effect="dark"
|
border
|
highlight-current-row
|
@row-click="handleChangeTape"
|
:row-class-name="tableRowClassName"
|
:current-row-key="currentKey1"
|
:row-key="(record) => record.index"
|
v-if="fiberOpticTapeVisible"
|
>
|
<el-table-column
|
type="index"
|
align="center"
|
label="序号"
|
width="70px"
|
:key="Math.random()"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="code"
|
label="光纤带编号"
|
min-width="110px"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
prop="model"
|
label="光纤带规格"
|
min-width="110px"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
prop="standard"
|
label="参考标准"
|
width="90px"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
prop="num"
|
label="光纤检测量"
|
min-width="110px"
|
show-overflow-tooltip
|
></el-table-column>
|
</el-table>
|
</el-drawer>
|
<el-drawer title="套管切换" :visible.sync="bushingVisible" :size="500">
|
<el-table
|
class="el-table"
|
ref="bushingTable"
|
:data="bushing"
|
height="100%"
|
tooltip-effect="dark"
|
border
|
highlight-current-row
|
@row-click="handleChangeBushing"
|
:row-class-name="tableRowClassName"
|
:current-row-key="currentKey0"
|
:row-key="(record) => record.index"
|
v-if="bushingVisible"
|
>
|
<el-table-column
|
type="index"
|
align="center"
|
label="序号"
|
width="70px"
|
:key="Math.random()"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="color"
|
label="管色标"
|
min-width="100px"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
prop="standNum"
|
label="标量"
|
min-width="100px"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
prop="testNum"
|
label="测试量"
|
min-width="100px"
|
show-overflow-tooltip
|
></el-table-column>
|
</el-table>
|
</el-drawer>
|
<el-drawer title="样品切换" :visible.sync="sampleVisible" :size="500">
|
<div style="margin-bottom: 20px; margin-left: 20px">
|
<span>样品编号:</span>
|
<el-input
|
v-model="filterSampleCode"
|
size="small"
|
style="width: 40%; margin-right: 20px"
|
clearable
|
@change="filterSampleProduct"
|
placeholder="请输入样品编号"
|
@clear="filterSampleProduct"
|
@keyup.enter="filterSampleProduct"
|
>
|
</el-input>
|
<el-button
|
type="primary"
|
size="small"
|
@click="filterSampleProduct"
|
icon="el-icon-search"
|
>查询</el-button
|
>
|
</div>
|
<el-table
|
class="el-table"
|
ref="productTable"
|
:data="sampleProduct"
|
height="100%"
|
tooltip-effect="dark"
|
border
|
highlight-current-row
|
@row-click="handleChangeSample"
|
:row-class-name="tableRowClassName"
|
:current-row-key="currentKey"
|
:row-key="(record) => record.index"
|
v-if="sampleVisible"
|
>
|
<el-table-column
|
type="index"
|
align="center"
|
label="序号"
|
width="70px"
|
:key="Math.random()"
|
>
|
</el-table-column>
|
<el-table-column
|
prop="sampleCode"
|
label="样品编号"
|
min-width="100px"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
prop="model"
|
label="样品型号"
|
min-width="100px"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
prop="insState"
|
label="检测状态"
|
width="100px"
|
show-overflow-tooltip
|
>
|
<template slot-scope="scope">
|
<el-tag
|
v-for="(item, i) in typeList"
|
:key="i"
|
v-if="item.dictValue == scope.row.insState"
|
:type="item.listClass"
|
size="medium"
|
style="margin-right: 5px"
|
>{{ item.dictLabel }}</el-tag
|
>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="checkName"
|
label="检验人"
|
min-width="80px"
|
show-overflow-tooltip
|
></el-table-column>
|
<el-table-column
|
prop="isLeave"
|
label="是否留样"
|
width="95px"
|
show-overflow-tooltip
|
align="center"
|
>
|
<template slot-scope="scope">
|
<span>{{ scope.row.isLeave == 0 ? "否" : "是" }}</span>
|
</template>
|
</el-table-column>
|
<!-- 检验单会有一个是否有配套样品字段控制显示 -->
|
<el-table-column
|
prop="joinModel"
|
label="配套样品型号"
|
min-width="130px"
|
show-overflow-tooltip
|
v-if="insOrder.mating > 0"
|
></el-table-column>
|
<el-table-column
|
prop="joinName"
|
label="配套样品名称"
|
min-width="130px"
|
show-overflow-tooltip
|
v-if="insOrder.mating > 0"
|
></el-table-column>
|
<el-table-column
|
prop="joinNum"
|
label="配套样品数量"
|
min-width="130px"
|
show-overflow-tooltip
|
v-if="insOrder.mating > 0"
|
></el-table-column>
|
</el-table>
|
</el-drawer>
|
<el-drawer title="任务切换" :visible.sync="taskVisible" :size="500">
|
<!-- <ValueTable
|
class="value-table"
|
ref="insOrderPlan"
|
:url="$api.insOrderPlan.inspectionOrderDetailsTaskSwitching"
|
:componentData="componentData"
|
:key="upIndex"
|
style="height: 100%"
|
/> -->
|
</el-drawer>
|
<el-dialog title="检验复核" :visible.sync="reviewDia" width="500px">
|
<div class="body" style="display: flex; padding: 10px" v-if="reviewDia">
|
<div class="search_label" style="width: 150px">
|
<span class="required-span">* </span>不通过的理由:
|
</div>
|
<div class="search_input" style="width: 100%">
|
<el-input
|
size="small"
|
clearable
|
v-model="noReason"
|
type="textarea"
|
:autosize="{ minRows: 4 }"
|
></el-input>
|
</div>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="reviewDia = false">取 消</el-button>
|
<el-button
|
type="primary"
|
@click="handleReviewDia"
|
:loading="reviewLoading"
|
>确 定</el-button
|
>
|
</span>
|
</el-dialog>
|
<el-dialog title="指定复核人员" :visible.sync="addVerifyDia" width="400px">
|
<div
|
class="body"
|
style="display: flex; padding: 10px; align-items: center"
|
>
|
<div class="search_label" style="width: 150px">
|
<span class="required-span">*</span>复核人
|
</div>
|
<div class="search_input" style="width: 100%">
|
<el-select
|
v-model="verifyUser"
|
placeholder="请选择"
|
size="small"
|
style="width: 100%"
|
clearable
|
filterable
|
>
|
<!-- <el-option v-for="(item,i) in personList" :key="i" :label="item.label" :value="item.value">
|
</el-option> -->
|
<el-option-group
|
v-for="(item, index) in Object.keys(personList)"
|
:key="index"
|
:label="item"
|
>
|
<el-option
|
:disabled="
|
inspectorList.filter((name) => name == op.name).length > 0
|
"
|
v-for="op in personList[item]"
|
:key="op.id"
|
:label="op.name"
|
:value="op.id"
|
>
|
</el-option>
|
</el-option-group>
|
</el-select>
|
</div>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="addVerifyDia = false">取 消</el-button>
|
<el-button type="primary" @click="submit()">确 定</el-button>
|
</span>
|
</el-dialog>
|
<el-dialog
|
title="数据采集"
|
:visible.sync="dataGetDia"
|
:close-on-click-modal="false"
|
:close-on-press-escape="false"
|
:show-close="false"
|
custom-class="custom-dialog"
|
>
|
<div>
|
<table border="1" cellpadding="10" class="thermal-table">
|
<tr>
|
<td style="width: 120px">检验项</td>
|
<td style="width: 120px">检验子项</td>
|
<td>数采数据</td>
|
</tr>
|
<template v-for="(item, index) in getData">
|
<tr>
|
<td :rowspan="item.child.length">{{ item.faName }}</td>
|
<td>{{ item.child[0].name }}</td>
|
<td style="text-align: left">
|
<el-checkbox-group
|
v-model="getDataIndex"
|
:max="item.child[0].maxNum"
|
>
|
<el-checkbox
|
v-for="(n, j) in item.child[0].arr"
|
:label="j"
|
:key="j"
|
>{{ n }}</el-checkbox
|
>
|
</el-checkbox-group>
|
</td>
|
</tr>
|
<tr
|
v-for="(m, i) in item.child"
|
:key="i + 'bbbbbbbbbbbbbb'"
|
v-show="i > 0"
|
>
|
<td>{{ m.name }}</td>
|
<td style="text-align: left">
|
<el-checkbox-group v-model="getDataIndex" :max="m.maxNum">
|
<el-checkbox v-for="(n, j) in m.arr" :label="j" :key="j">{{
|
n
|
}}</el-checkbox>
|
</el-checkbox-group>
|
</td>
|
</tr>
|
</template>
|
</table>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button
|
type="primary"
|
@click="submitDataGet()"
|
:loading="getDataIndexLoading"
|
>确 定</el-button
|
>
|
</span>
|
</el-dialog>
|
<!-- 交接弹框 -->
|
<el-dialog title="检验交接" :visible.sync="connectVisible" width="400px">
|
<div class="search_thing">
|
<div class="search_label" style="width: 90px">
|
<span class="required-span">* </span>交接人员:
|
</div>
|
<div class="search_input">
|
<el-select
|
v-model="connect.connectPerson"
|
placeholder="请选择"
|
style="width: 100%"
|
filterable
|
>
|
<!-- <el-option
|
v-for="item in personList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option> -->
|
<el-option-group
|
v-for="(item, index) in Object.keys(handover)"
|
:key="index"
|
:label="item"
|
>
|
<el-option
|
:disabled="
|
inspectorList.filter((name) => name == op.name).length > 0
|
"
|
v-for="op in personList[item]"
|
:key="op.id"
|
:label="op.name"
|
:value="op.id"
|
>
|
</el-option>
|
</el-option-group>
|
</el-select>
|
</div>
|
</div>
|
<div class="search_thing">
|
<div class="search_label" style="width: 90px">
|
<span class="required-span">* </span>试验室:
|
</div>
|
<div class="search_input">
|
<el-select
|
v-model="connect.sonLaboratory"
|
placeholder="请选择"
|
style="width: 100%"
|
filterable
|
>
|
<el-option
|
v-for="item in sonLaboratoryList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</div>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="connectVisible = false">取 消</el-button>
|
<el-button type="primary" @click="confirmConnect" :loading="loading"
|
>确 定</el-button
|
>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import {
|
doInsOrder,
|
upPlanUser2,
|
upPlanUser,
|
saveInsContext2,
|
getSagTemperatureProducts,
|
temCycle,
|
write,
|
getInsProduct,
|
getReportModel,
|
verifyPlan,
|
checkSubmitPlan,
|
getEquipName,
|
submitPlan,
|
saveInsContext,
|
downFile,
|
} from "@/api/business/inspectionTask";
|
import {
|
temDataAcquisition,
|
temDataAcquisition2,
|
determineWhetherToCollectData,
|
selectDeviceByCategory,
|
} from "@/api/cnas/resourceDemand/device";
|
import { getLaboratoryPersonList } from "@/api/system/user";
|
import { getDicts } from "@/api/system/dict/data";
|
import { selectDictDataByName } from "@/api/system/dict/type";
|
import limsTable from "@/components/Table/lims-table.vue";
|
import file from "@/utils/file";
|
import excelFunction from "@/utils/excelFountion";
|
import { mapGetters } from "vuex";
|
import { getToken } from "@/utils/auth";
|
import Big from "big.js";
|
import InspectionWorker from "../../../workers/InspectionWorker.worker";
|
import InspectionWorkerAsData from "../../../workers/InspectionWorkerAsData.worker";
|
export default {
|
name: "Inspection",
|
components: {
|
limsTable,
|
},
|
data() {
|
return {
|
sonLaboratory: null,
|
orderId: null,
|
state: null,
|
inspectorList: [],
|
handover: [],
|
equipName: [],
|
insFibersId: null, //光纤带id
|
insOrderState: null,
|
sonLaboratoryList: [],
|
connect: {
|
connectPerson: "",
|
sonLaboratory: "",
|
},
|
connectVisible: false,
|
filterSampleCode: null,
|
fileterSampleProducts: [],
|
isEdit: false,
|
sagData: [],
|
sagForm: {},
|
dataGetDia: false,
|
wareTableDataLoading: false,
|
fileAdd: false,
|
sampleVisible: false,
|
taskVisible: false,
|
submitLoading: false,
|
searchForm: {
|
sampleName: null,
|
state: null,
|
},
|
id: 0,
|
componentData: {
|
entity: {
|
sonLaboratory: null,
|
},
|
isIndex: false,
|
showSelect: false,
|
select: false,
|
selectMethod: "handleChangeTask",
|
sort: false,
|
do: [],
|
isPage: false,
|
linkEvent: {},
|
tagField: {
|
type: {
|
select: [],
|
},
|
insState: {
|
select: [],
|
},
|
},
|
currentId: "",
|
selectField: {},
|
requiredAdd: [],
|
requiredUp: [],
|
},
|
componentData0: {
|
entity: {
|
insOrderId: "",
|
},
|
isIndex: true,
|
showSelect: false,
|
select: false,
|
sort: false,
|
init: false,
|
do: [
|
{
|
id: "handleDown",
|
font: "下载",
|
type: "text",
|
method: "handleDown",
|
},
|
{
|
id: "delete",
|
font: "删除",
|
type: "text",
|
method: "doDiy",
|
disabFun: (row, index) => {
|
return this.state != 1;
|
},
|
},
|
],
|
isPage: false,
|
linkEvent: {},
|
tagField: {
|
type: {
|
select: [
|
{
|
value: 1,
|
label: "图片",
|
},
|
{
|
value: 2,
|
label: "文件",
|
},
|
],
|
},
|
},
|
currentId: "",
|
selectField: {},
|
requiredAdd: [],
|
requiredUp: [],
|
},
|
upIndex: 0,
|
getReportModelLoading: false,
|
insOrder: {},
|
sampleProduct: [],
|
typeList: [],
|
urgentList: [],
|
currentSample: {}, //当前样品信息
|
tableList: [],
|
loading: false,
|
ps: {},
|
param: {},
|
currentKey: 1,
|
currentKey0: 1,
|
currentKey1: 1,
|
currentKey2: 1,
|
comparisonList: [],
|
excelMethodList: [],
|
equipOptions: [],
|
reviewLoading: false,
|
reviewDia: false,
|
noReason: "",
|
tableWidth: 1000,
|
currentTable: null,
|
tableLists: [],
|
widthList: [],
|
addVerifyDia: false,
|
verifyUser: null,
|
personList: [],
|
enumList: [],
|
fiberOpticVisible: false,
|
fiberOpticTapeVisible: false,
|
bushingVisible: false,
|
fiberOpticTape: [], //光纤带列表
|
fiberOptic: [], //光纤列表
|
bushing: [], //套管列表
|
currentFiberOpticTape: null, //当前光纤带
|
currentFiberOptic: null, //当前光纤
|
currentBushing: null, //当前套管
|
tableLoading: false,
|
upLoading: false,
|
temptList: null,
|
fiber: [],
|
fibers: [],
|
casing: [],
|
currentTab: null,
|
wareForm: {
|
inspectionItem: 1,
|
inspectionItemSubclass: "20(常温)",
|
},
|
wareForm0: {},
|
numOptions: [],
|
temperatureOptions: [],
|
wareTableData: [],
|
otherForm: {
|
humidity: null,
|
temperature: null,
|
},
|
equipForm: {
|
value0: null,
|
code0: null,
|
value1: null,
|
code1: null,
|
},
|
result: null,
|
worker: null,
|
worker0: null,
|
wareLength: [],
|
dataAcquisitionInfo: {},
|
dataAcquisitionInfoNew: {},
|
dataAcquisitionEidtAble: false,
|
isGet: false,
|
dataAcquisitionLoading: false,
|
collected: false,
|
// 热循环---开始
|
thermalCyclingInfo: {
|
max: 0,
|
inspectionItem: 1,
|
arr: [],
|
length: 1,
|
inspectionItemClass: null,
|
},
|
thermalCyclingLoading: false,
|
temDataAcquisition: false,
|
// 热循环---结束
|
getData: [
|
{
|
faName: "波长附加衰减",
|
child: [
|
{
|
name: "1285nm~1330nm",
|
arr: [12, 13, 14, 15],
|
},
|
{
|
name: "1525nm~1575nm",
|
arr: [12, 13, 14, 15],
|
},
|
],
|
},
|
{
|
faName: "截至波长",
|
child: [
|
{
|
name: "截至波长",
|
arr: [12, 13, 14, 15],
|
},
|
],
|
},
|
],
|
getDataIndex: [],
|
getDataIndexLoading: false,
|
changeType: null,
|
getDataTypeId: "",
|
getDataType: null,
|
singleRootVerticalInfo: {
|
model: "",
|
methodName: "",
|
num: 0,
|
arr: [],
|
ask: "",
|
elasticity: null, //弹性模量
|
},
|
loadList: [],
|
// 架空导地线-应力应变--开始
|
stressStrainInfo: {
|
elasticity: null,
|
},
|
timeList: [5, 10, 15, 30, 45, 60],
|
powerList0: [
|
{
|
value: "30%RTS",
|
arr: ["", "", "", "", "", ""],
|
},
|
{
|
value: "50%RTS",
|
arr: ["", "", "", "", "", ""],
|
},
|
{
|
value: "70%RTS",
|
arr: ["", "", "", "", "", ""],
|
},
|
{
|
value: "85%RTS",
|
arr: ["", "", "", "", "", ""],
|
},
|
],
|
powerList: [],
|
// 架空导地线-应力应变--结束
|
// 防振锤功率特性---开始
|
powerCharacteristicsInfo: {
|
model: null,
|
methodS: null,
|
arr0: [
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
], //(疲劳前)功率特性-谐振频率(Hz)
|
arr1: [
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
], //(疲劳前)功率特性-耗能(W)
|
arr2: [
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
], //(疲劳后)功率特性-谐振频率(Hz)
|
arr3: [
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
], //(疲劳后)功率特性-耗能(W)
|
},
|
powerCharacteristicsCopy: [
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
{
|
value: "",
|
state: 0,
|
},
|
],
|
// 防振锤功率特性---结束
|
// 疲劳试验---开始
|
fatigueTestInfo: {
|
model: null,
|
methodS: null,
|
sampleType: null,
|
// 以下的是输入参数
|
startTime: null,
|
endTime: null,
|
tension: null,
|
distance0: null,
|
distance1: null,
|
frequency: null,
|
amplitude0: null,
|
wavelength: null,
|
amplitude1: null,
|
strain: null,
|
pitch: null,
|
num: null,
|
damage: null,
|
attenuation: null,
|
},
|
// 疲劳试验---结束
|
};
|
},
|
// 用于上传文件的信息
|
computed: {
|
...mapGetters(["loginUserInfo"]),
|
headers() {
|
return { Authorization: "Bearer " + getToken() };
|
},
|
action() {
|
return this.javaApi + "/insOrderPlan/uploadFile";
|
},
|
},
|
created() {
|
console.log(this.$route.params);
|
this.sonLaboratory = this.$route.params.sonLaboratory;
|
this.orderId = this.$route.params.orderId;
|
this.state = this.$route.params.state;
|
this.inspectorList = this.$route.params.inspectorList;
|
this.handover = this.$route.params.handover;
|
// this.componentData.entity.sonLaboratory = this.sonLaboratory;
|
this.id = this.$route.params.orderId;
|
},
|
mounted() {
|
this.getSonLaboratoryList();
|
this.getTypeDicts();
|
this.getInsStateDicts();
|
this.getComparisonList();
|
this.getAuthorizedPerson();
|
this.scrollInit();
|
this.startWorker();
|
},
|
watch: {
|
// 监听任务id,获取任务信息
|
id(val) {
|
this.loading = true;
|
doInsOrder({
|
id: val,
|
laboratory: this.sonLaboratory,
|
})
|
.then(async (res) => {
|
if (res.code === 200) {
|
this.insOrder = res.data.insOrder;
|
this.insOrderState = res.data.insState;
|
this.componentData0.entity.insOrderId = val;
|
// this.$refs.fileList.selectList();
|
this.urgentList.forEach((m) => {
|
if (m.dictValue == this.insOrder.type) {
|
this.insOrder.typeName = m.dictLabel;
|
}
|
});
|
this.loading = false;
|
if (!res.data.sampleProduct || res.data.sampleProduct.length == 0) {
|
return this.$message.error("该任务没有样品信息");
|
}
|
// 赋值当前样品列表
|
this.sampleProduct = res.data.sampleProduct;
|
this.fileterSampleProducts = JSON.parse(
|
JSON.stringify(res.data.sampleProduct)
|
);
|
this.currentSample = this.HaveJson(this.sampleProduct[0]);
|
let insProduct = this.HaveJson(this.currentSample.insProduct);
|
// 温度、湿度赋值
|
if (insProduct && insProduct.length > 0) {
|
const filterList = insProduct.filter(
|
(ele) => ele.temperature || ele.humidity
|
);
|
if (filterList && filterList.length > 0) {
|
let { temperature, humidity } = filterList[0];
|
this.otherForm = {
|
temperature: temperature ? temperature : null,
|
humidity: humidity ? humidity : null,
|
};
|
}
|
}
|
// 获取当前样品的检验项
|
let list = await this.getCurrentProduct(this.currentSample.id, 0);
|
console.log(888, list);
|
if (list) {
|
this.currentSample.insProduct = this.HaveJson(list);
|
}
|
// 初始化传递到后端的参数
|
this.param = {};
|
this.changeType = 0;
|
this.currentSample.insProduct.forEach((a, j) => {
|
this.param[a.id] = {
|
insValue: [],
|
comValue: [],
|
resValue: null,
|
equipValue: [],
|
equipName: [],
|
insResult: null,
|
};
|
});
|
this.determineWhetherToCollectData(); //是否需要数采
|
this.getReportModel(this.currentSample.id); //获取套管、光纤带、光纤信息
|
if (this.currentSample.index == undefined)
|
this.currentSample["index"] = 1;
|
let bushing = this.currentSample.bushing;
|
this.getTableLists(); //处理模板列表信息
|
|
this.componentData.currentId = val;
|
this.currentKey = 1;
|
// 清空光纤配置相关数据---下面信息暂时可忽略
|
this.fiberOpticTape = [];
|
this.currentFiberOpticTape = null;
|
this.fiberOptic = [];
|
this.currentFiberOptic = null;
|
this.bushing = [];
|
this.currentBushing = null;
|
this.currentTab = null;
|
if (bushing && bushing.length > 0) {
|
this.bushing = bushing;
|
}
|
// 向 Worker 发送消息,开始处理逻辑
|
this.worker.postMessage(
|
JSON.stringify({
|
modelType: this.sampleProduct[0].model,
|
type: "saveData",
|
tableList: this.tableList,
|
param: this.param,
|
currentTable: this.currentTable,
|
})
|
);
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
// 监听当前模板变化
|
currentTable(val1, val0) {
|
if (val0 != null && val1 != val0) {
|
if (this.changeType && this.changeType > 0) {
|
// 如果是光纤、光纤带,则不执行下面操作
|
return;
|
}
|
this.tableLists.forEach(async (m, i) => {
|
if (m.templateId == val1) {
|
let list = await this.getCurrentProduct(this.currentSample.id, 0);
|
this.currentSample.insProduct = this.HaveJson(list); //赋值当前样品的检验项
|
this.param = {}; //初始化传到后端的参数
|
this.currentSample.insProduct.forEach((a, j) => {
|
this.param[a.id] = {
|
insValue: [],
|
comValue: [],
|
resValue: null,
|
equipValue: [],
|
equipName: [],
|
insResult: null,
|
};
|
});
|
this.getReportModel(this.currentSample.id); //获取套管、光纤带、光纤信息
|
// 去重模板,返回有几个模板
|
const mySet1 = new Set();
|
this.tableLists = this.currentSample.insProduct.filter((m) => {
|
let num0 = mySet1.size;
|
if (m.templateId != null && m.template != null) {
|
try {
|
mySet1.add(
|
JSON.stringify({
|
template: m.template,
|
templateId: m.templateId,
|
})
|
);
|
} catch (error) {
|
console.log(222, error);
|
}
|
}
|
let num1 = mySet1.size;
|
if (num1 > num0) {
|
return m;
|
}
|
});
|
if (this.tableLists && this.tableLists.length > 0) {
|
this.tableList = null;
|
this.tableList = this.tableLists.filter(
|
(m) => m.templateId == val1
|
);
|
// 对模板进行处理
|
this.handleTableData();
|
// 向 Worker 发送消息,开始处理逻辑
|
this.worker.postMessage(
|
JSON.stringify({
|
modelType: this.sampleProduct[0].model,
|
type: "saveData",
|
tableList: this.tableList,
|
param: this.param,
|
currentTable: this.currentTable,
|
})
|
);
|
}
|
}
|
});
|
}
|
},
|
// 特殊检验项--监听设备信息改变
|
"equipForm.code0": {
|
deep: true,
|
handler(oldVal, newVal) {
|
this.changEquip("code0");
|
},
|
},
|
"equipForm.code1": {
|
deep: true,
|
handler(oldVal, newVal) {
|
this.changEquip("code1");
|
},
|
},
|
// equipForm:{
|
// deep:true,
|
// handler(oldVal,newVal){
|
|
// }
|
// },
|
},
|
beforeDestroy() {
|
// 在组件销毁前确保停止 Worker,避免内存泄漏
|
this.stopWorker();
|
},
|
methods: {
|
blockModifications(val) {
|
// 恢复原始值
|
this.$nextTick(() => {
|
this.equipForm.value0 = JSON.parse(JSON.stringify(this.equipName));
|
if (this.$refs[val]) {
|
this.$refs[val].blur();
|
} else {
|
console.error(`No ref found with name ${val}`);
|
}
|
});
|
},
|
getSonLaboratoryList() {
|
upPlanUser2({
|
orderId: this.orderId,
|
})
|
.then((res) => {
|
if (res.code === 200 && res.data.length > 0) {
|
this.sonLaboratoryList = [];
|
res.data.forEach((m) => {
|
this.sonLaboratoryList.push({
|
value: m,
|
label: m,
|
});
|
});
|
this.connect.sonLaboratory = this.sonLaboratoryList[0].value;
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
// 内部交接
|
confirmConnect() {
|
if (
|
this.connect.connectPerson == null ||
|
this.connect.connectPerson == "" ||
|
this.connect.connectPerson == undefined
|
) {
|
this.$message.error("未选择交接人员");
|
return;
|
}
|
if (
|
this.connect.sonLaboratory == null ||
|
this.connect.sonLaboratory == "" ||
|
this.connect.sonLaboratory == undefined
|
) {
|
this.$message.error("未选择试验室");
|
return;
|
}
|
this.loading = true;
|
upPlanUser({
|
orderId: this.orderId,
|
userId: this.connect.connectPerson,
|
sonLaboratory: this.connect.sonLaboratory,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
if (res.code === 200) {
|
this.loading = false;
|
this.$message.success("操作成功");
|
}
|
this.connectVisible = false;
|
this.$emit("goback");
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
this.loading = false;
|
});
|
},
|
// 样品编号搜索
|
filterSampleProduct() {
|
console.log(123, this.filterSampleCode);
|
let list = JSON.parse(JSON.stringify(this.fileterSampleProducts));
|
this.sampleProduct = list.filter((m) =>
|
m.sampleCode.includes(this.filterSampleCode)
|
);
|
},
|
//修改设备
|
changEquip() {
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
(this.tableLists.find((m) => m.templateId == this.currentTable)
|
.templateName == "温度循环检验原始记录" ||
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("热循环") ||
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("温升试验") ||
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("单根垂直燃烧") ||
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("弧垂") ||
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("架空地线应力应变") ||
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("防振锤功率特性") ||
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("疲劳试验检验原始记录")) &&
|
this.equipOptions &&
|
this.equipOptions.length > 0
|
) {
|
let list = this.currentSample.insProduct.filter(
|
(m) =>
|
m.inspectionItem.includes("热循环") ||
|
m.inspectionItem.includes("温度循环") ||
|
m.inspectionItem.includes("温升") ||
|
m.inspectionItem.includes("单根垂直燃烧") ||
|
m.inspectionItem.includes("弧垂") ||
|
m.inspectionItem.includes("单根垂直燃烧") ||
|
m.inspectionItem.includes("应力应变") ||
|
m.inspectionItem.includes("防振锤功率特性") ||
|
m.inspectionItem.includes("振动疲劳") ||
|
m.inspectionItem.includes("舞动疲劳")
|
);
|
console.log(123, list);
|
list.forEach((m) => {
|
// 保存检验值
|
console.log(m);
|
if (m.inspectionItem == "单根垂直燃烧") {
|
this.param[m.id].insResult = {
|
i: m.id,
|
v: { v: m.insResult },
|
};
|
this.param[m.id].resValue = {
|
i: m.id,
|
v: { v: m.resValue },
|
};
|
this.param[m.id].insValue = [];
|
m.value.forEach((item) => {
|
let obj = {
|
i: m.id,
|
v: {
|
v: item,
|
},
|
};
|
this.param[m.id].insValue.push(obj);
|
});
|
}
|
// //重新赋值insValue
|
// if(m.insProductResult){
|
// const valueArr = JSON.parse(m.insProductResult.insValue)
|
// valueArr.forEach(ele=>{
|
// this.param[m.id].insValue.push({
|
// i:m.id,
|
// v:{v:ele.v}
|
// })
|
// })
|
// }
|
// 初始化设备信息
|
this.param[m.id].equipValue = [];
|
this.param[m.id].equipName = [];
|
if (this.equipForm.code0) {
|
// 赋值第一个设备的信息
|
// this.equipForm.value0 = this.equipOptions.find(
|
// (m) => m.value == this.equipForm.code0
|
// ).label;
|
|
if (
|
!m.inspectionItem.includes("温度循环") &&
|
!m.inspectionItem.includes("单根垂直燃烧")
|
) {
|
// 赋值设备名称
|
|
let list1 = [];
|
this.equipOptions
|
.filter((m) => this.equipForm.code0.includes(m.value))
|
.forEach((item) => {
|
list1.push(item.label);
|
});
|
this.equipForm.value0 = [...new Set(list1)];
|
this.equipForm.code0.forEach((item, index) => {
|
this.param[m.id].equipValue.push({
|
i: m.id,
|
v: {
|
v: item,
|
},
|
});
|
this.param[m.id].equipName.push({
|
i: m.id,
|
v: {
|
v: list1[index],
|
},
|
});
|
});
|
console.log("this.equipOptions", this.equipOptions);
|
} else {
|
this.equipForm.value0 = this.equipOptions.find(
|
(m) => m.value == this.equipForm.code0
|
).label;
|
this.param[m.id].equipValue.push({
|
i: m.id,
|
v: {
|
v: this.equipForm.code0,
|
},
|
});
|
this.param[m.id].equipName.push({
|
i: m.id,
|
v: {
|
v: this.equipForm.value0,
|
},
|
});
|
}
|
// this.param[m.id].equipValue.push({
|
// i: m.id,
|
// v: {
|
// v: code0,
|
// },
|
// });
|
// this.param[m.id].equipName.push({
|
// i: m.id,
|
// v: {
|
// v: value0,
|
// },
|
// });
|
}
|
if (
|
this.equipForm.code1 &&
|
(m.inspectionItem.includes("温度循环") ||
|
m.inspectionItem.includes("单根垂直燃烧"))
|
) {
|
// 赋值第二个设备的信息
|
this.equipForm.value1 = this.equipOptions.find(
|
(m) => m.value == this.equipForm.code1
|
).label;
|
this.param[m.id].equipValue.push({
|
i: m.id,
|
v: {
|
v: this.equipForm.code1,
|
},
|
});
|
this.param[m.id].equipName.push({
|
i: m.id,
|
v: {
|
v: this.equipForm.value1,
|
},
|
});
|
}
|
// 保存数据
|
this.saveInsContext(m.id);
|
});
|
}
|
},
|
// 疲劳试验特性---开始
|
getFatigueTestInfo() {
|
for (let i in this.fatigueTestInfo) {
|
this.fatigueTestInfo[i] = null;
|
}
|
let obj = this.currentSample.insProduct.filter(
|
(m) =>
|
m.inspectionItem.includes("振动疲劳") ||
|
m.inspectionItem.includes("舞动疲劳")
|
)[0];
|
// 获取设备列表
|
this.getEquipOptions(true, obj.id);
|
this.fatigueTestInfo.model = this.currentSample.model;
|
this.fatigueTestInfo.methodS = obj.methodS;
|
this.fatigueTestInfo.sampleType = obj.sampleType;
|
this.fatigueTestInfo.id = obj.id;
|
this.fatigueTestInfo.insProductResult = obj.insProductResult;
|
// 回显数据
|
if (
|
obj.insProductResult &&
|
obj.insProductResult.insValue &&
|
obj.insProductResult.insValue.length > 5
|
) {
|
this.fatigueTestInfo = {
|
...this.fatigueTestInfo,
|
...JSON.parse(obj.insProductResult.insValue),
|
};
|
}
|
},
|
//疲劳试验保存方法
|
saveFatigueTest() {
|
let obj = this.HaveJson(this.fatigueTestInfo);
|
delete obj.insProductResult;
|
delete obj.id;
|
delete obj.model;
|
delete obj.methodS;
|
delete obj.sampleType;
|
saveInsContext2({
|
id: this.fatigueTestInfo.insProductResult
|
? this.fatigueTestInfo.insProductResult.id
|
: "",
|
insProductId: this.fatigueTestInfo.id,
|
sampleId: this.currentSample.id,
|
orderId: this.currentSample.insOrderId,
|
insValue: JSON.stringify(obj),
|
templateName: "疲劳试验",
|
})
|
.then((res) => {
|
if (res.code == 201) {
|
this.$message.error("保存失败");
|
return;
|
}
|
this.$message.success("保存成功");
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
// 疲劳试验特性---结束
|
// 防振锤功率特性---开始
|
getPowerCharacteristicsInfo() {
|
this.powerCharacteristicsInfo.arr0 = this.HaveJson(
|
this.powerCharacteristicsCopy
|
);
|
this.powerCharacteristicsInfo.arr1 = this.HaveJson(
|
this.powerCharacteristicsCopy
|
);
|
this.powerCharacteristicsInfo.arr2 = this.HaveJson(
|
this.powerCharacteristicsCopy
|
);
|
this.powerCharacteristicsInfo.arr3 = this.HaveJson(
|
this.powerCharacteristicsCopy
|
);
|
let obj = this.currentSample.insProduct.filter((m) =>
|
m.inspectionItem.includes("防振锤功率特性")
|
)[0];
|
// 获取设备列表
|
this.getEquipOptions(true, obj.id);
|
this.powerCharacteristicsInfo.model = this.currentSample.model;
|
this.powerCharacteristicsInfo.methodS = obj.methodS;
|
this.powerCharacteristicsInfo.id = obj.id;
|
this.powerCharacteristicsInfo.insProductResult = obj.insProductResult;
|
// 回显数据
|
if (obj.insProductResult) {
|
if (
|
obj.insProductResult.insValue &&
|
obj.insProductResult.insValue.length > 5
|
) {
|
let obj0 = JSON.parse(obj.insProductResult.insValue);
|
this.powerCharacteristicsInfo.arr0 = obj0.arr0;
|
this.powerCharacteristicsInfo.arr1 = obj0.arr1;
|
}
|
if (
|
obj.insProductResult.comValue &&
|
obj.insProductResult.comValue.length > 5
|
) {
|
let obj1 = JSON.parse(obj.insProductResult.comValue);
|
this.powerCharacteristicsInfo.arr2 = obj1.arr2;
|
this.powerCharacteristicsInfo.arr3 = obj1.arr3;
|
}
|
}
|
},
|
// 改变疲劳后的谐振频率(Hz)
|
changeArr2(val, index) {
|
if (!this.powerCharacteristicsInfo.arr0[index].value || !val) {
|
return;
|
}
|
let num0 = Number(this.powerCharacteristicsInfo.arr0[index].value) * 0.8;
|
let num1 = Number(this.powerCharacteristicsInfo.arr0[index].value) * 1.2;
|
if (Number(val) > num0 && Number(val) < num1) {
|
this.powerCharacteristicsInfo.arr2[index].state = 1;
|
} else {
|
this.powerCharacteristicsInfo.arr2[index].state = 2;
|
}
|
},
|
// 改变疲劳后的谐耗能(W)
|
changeArr3(val, index) {
|
if (!this.powerCharacteristicsInfo.arr1[index].value || !val) {
|
return;
|
}
|
let num0 = Number(this.powerCharacteristicsInfo.arr1[index].value) * 0.8;
|
let num1 = Number(this.powerCharacteristicsInfo.arr1[index].value) * 1.2;
|
if (Number(val) > num0 && Number(val) < num1) {
|
this.powerCharacteristicsInfo.arr3[index].state = 1;
|
} else {
|
this.powerCharacteristicsInfo.arr3[index].state = 2;
|
}
|
},
|
//防振锤功率特性保存方法
|
savePowerCharacteristics() {
|
let obj0 = {};
|
obj0.arr0 = this.powerCharacteristicsInfo.arr0;
|
obj0.arr1 = this.powerCharacteristicsInfo.arr1;
|
let obj1 = {};
|
obj1.arr2 = this.powerCharacteristicsInfo.arr2;
|
obj1.arr3 = this.powerCharacteristicsInfo.arr3;
|
saveInsContext2({
|
id: this.powerCharacteristicsInfo.insProductResult
|
? this.powerCharacteristicsInfo.insProductResult.id
|
: "",
|
insProductId: this.powerCharacteristicsInfo.id,
|
sampleId: this.currentSample.id,
|
orderId: this.currentSample.insOrderId,
|
insValue: JSON.stringify(obj0),
|
comValue: JSON.stringify(obj1),
|
templateName: "防振锤功率特性",
|
})
|
.then((res) => {
|
if (res.code == 201) {
|
this.$message.error("保存失败");
|
return;
|
}
|
this.$message.success("保存成功");
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
// 防振锤功率特性---结束
|
// 架空导地线应力应变---开始
|
getStressStrainInfo() {
|
this.powerList = this.HaveJson(this.powerList0);
|
let obj = this.currentSample.insProduct.filter((m) =>
|
m.inspectionItem.includes("应力应变")
|
)[0];
|
// 获取设备列表
|
this.getEquipOptions(true, obj.id);
|
this.stressStrainInfo.model = this.currentSample.model;
|
this.stressStrainInfo.methodS = obj.methodS;
|
this.stressStrainInfo.id = obj.id;
|
this.stressStrainInfo.insProductResult = obj.insProductResult;
|
// 回显数据
|
this.stressStrainInfo.elasticity = obj.elasticityModulus;
|
if (
|
obj.insProductResult &&
|
obj.insProductResult.insValue &&
|
obj.insProductResult.insValue.length > 5
|
) {
|
this.powerList = [];
|
let obj0 = JSON.parse(obj.insProductResult.insValue);
|
for (let i in obj0) {
|
this.powerList.push({
|
value: i,
|
arr: obj0[i],
|
});
|
}
|
}
|
let ask = obj.ask
|
? obj.ask
|
.replace("=", "")
|
.replace("<", "")
|
.replace(">", "")
|
.replace(">", "")
|
.replace("<", "")
|
.replace("≥", "")
|
.replace("≤", "")
|
: 0;
|
this.stressStrainInfo.ask = ask;
|
},
|
//架空地线应力应变保存方法
|
saveStressStrain() {
|
if (
|
this.stressStrainInfo.elasticity == null ||
|
this.stressStrainInfo.elasticity == "" ||
|
undefined == this.stressStrainInfo.elasticity
|
) {
|
this.$message.error("请先填写弹性模量");
|
return;
|
}
|
let obj = {};
|
for (let i = 0; i < this.powerList.length; i++) {
|
if (this.powerList[i].value) {
|
obj[this.powerList[i].value] = this.powerList[i].arr;
|
}
|
}
|
obj.elasticityModulus = this.stressStrainInfo.elasticity;
|
saveInsContext2({
|
id: this.stressStrainInfo.insProductResult
|
? this.stressStrainInfo.insProductResult.id
|
: "",
|
sampleId: this.currentSample.id,
|
orderId: this.currentSample.insOrderId,
|
insProductId: this.stressStrainInfo.id,
|
insValue: JSON.stringify(obj),
|
templateName: "架空地线应力应变",
|
})
|
.then((res) => {
|
if (res.code == 201) {
|
this.$message.error("保存失败");
|
return;
|
}
|
this.$message.success("保存成功");
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
// 删除记录
|
delStressStrain(index) {
|
if (this.powerList.length == 1) {
|
this.$message.warning("至少需要一条数据");
|
return;
|
}
|
this.powerList.splice(index, 1);
|
},
|
// 添加记录
|
addStressStrain() {
|
this.powerList.push({
|
value: "",
|
arr: ["", "", "", "", "", ""],
|
});
|
},
|
// 填写弹性模量
|
changeElasticity(e) {
|
if (e) {
|
if (!this.stressStrainInfo.ask) {
|
this.$message.warning("请先去标准库维护标准量");
|
this.stressStrainInfo.elasticity = null;
|
return;
|
}
|
let num = Math.abs(e - Number(this.stressStrainInfo.ask));
|
if (num > 2) {
|
this.$message.warning("弹性模量不能超过标准量的±2");
|
this.stressStrainInfo.elasticity = null;
|
return;
|
}
|
this.stressStrainInfo.elasticity = e;
|
}
|
},
|
// 架空导地线应力应变---结束
|
// 弧垂特性---开始
|
// 删除行
|
deleteSag(index) {
|
if (this.sagData.length == 1) {
|
this.$message.warning("至少需要一条数据");
|
return;
|
}
|
this.sagData.splice(index, 1);
|
//this.saveSageInfo('高度','height')
|
this.saveSageInfo("弧垂", "sag");
|
this.saveSageInfo("室温", "temperature");
|
this.saveSageInfo("张力", "remark");
|
this.saveSageInfo("导线温度", this.sagData[this.sagData.length - 1]);
|
},
|
// 添加弧垂检测
|
addSag() {
|
this.sagData.push({
|
height: null,
|
sag: null,
|
value0: null,
|
value1: null,
|
value2: null,
|
value3: null,
|
value4: null,
|
value5: null,
|
average: null,
|
temperature: null,
|
remark: null,
|
});
|
},
|
// 初始化页面数据
|
getSageInfo() {
|
let obj = this.currentSample.insProduct.filter((m) =>
|
m.inspectionItem.includes("弧垂")
|
)[0];
|
// 获取设备列表
|
this.getEquipOptions(true, obj.id);
|
getSagTemperatureProducts({
|
sampleId: this.currentSample.id,
|
})
|
.then((res) => {
|
if (res.code == 201) return;
|
let { productVos, sampleVo } = res.data;
|
// 回显基础信息
|
this.sagForm = sampleVo;
|
this.sagForm.productVos = productVos;
|
productVos.forEach((item) => {
|
// 初始化后端参数
|
this.param[item.insProduct.id] = {
|
insValue: [],
|
comValue: [],
|
resValue: {
|
i: item.insProduct.id,
|
r: 0,
|
c: 0,
|
v: {
|
v: null,
|
},
|
},
|
equipValue: [],
|
equipName: [],
|
insResult: {
|
i: item.insProduct.id,
|
v: {
|
v: null,
|
},
|
},
|
};
|
// 有数据->回显数据
|
if (item.insProduct.insProductResult) {
|
let type = item.insProduct.inspectionItemSubclass;
|
let insValue = JSON.parse(
|
item.insProduct.insProductResult.insValue
|
);
|
if (
|
!(
|
type == "额定拉断力" ||
|
type == "跨距长度" ||
|
type == "载荷" ||
|
type == "导线温度"
|
)
|
) {
|
if (this.sagData.length < insValue.length) {
|
for (let i = this.sagData.length; i < insValue.length; i++) {
|
this.sagData.push({
|
height: null,
|
sag: null,
|
value0: null,
|
value1: null,
|
value2: null,
|
value3: null,
|
value4: null,
|
value5: null,
|
average: null,
|
temperature: null,
|
remark: null,
|
});
|
}
|
}
|
}
|
if (insValue.length > 0) {
|
switch (type) {
|
case "额定拉断力":
|
this.$set(this.sagForm, "tensileForce", insValue[0].v);
|
break;
|
case "跨距长度":
|
this.$set(this.sagForm, "spanLength", 100);
|
break;
|
case "载荷":
|
this.$set(this.sagForm, "load", insValue[0].v);
|
break;
|
// case '高度':
|
// insValue.forEach((m,i)=>{
|
// this.sagData[i].height = m.v
|
// })
|
// break;
|
case "弧垂":
|
insValue.forEach((m, i) => {
|
this.sagData[i].sag = m.v;
|
});
|
break;
|
case "室温":
|
insValue.forEach((m, i) => {
|
this.sagData[i].temperature = m.v;
|
});
|
break;
|
case "张力":
|
insValue.forEach((m, i) => {
|
this.sagData[i].remark = m.v;
|
});
|
break;
|
case "导线温度":
|
let comValue = JSON.parse(
|
item.insProduct.insProductResult.comValue
|
);
|
if (comValue.length > 0) {
|
comValue.forEach((m, i) => {
|
this.sagData[i].average = m.v ? m.v : null;
|
});
|
}
|
insValue.forEach((m, i) => {
|
this.sagData[m.c][`value${m.r}`] = m.v ? m.v : null;
|
});
|
break;
|
}
|
}
|
}
|
});
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
// 保存数据
|
saveSageInfo(type, value) {
|
let obj = this.sagForm.productVos.find(
|
(m) => m.insProduct.inspectionItemSubclass == type
|
);
|
if (obj) {
|
if (type == "额定拉断力" || type == "跨距长度" || type == "载荷") {
|
this.param[obj.insProduct.id].insValue = [
|
{
|
i: obj.insProduct.id,
|
r: 0,
|
c: 0,
|
v: {
|
v: value,
|
},
|
},
|
];
|
} else if (type == "导线温度") {
|
let arr = [];
|
for (let i = 0; i < 6; i++) {
|
arr.push(value[`value${i}`]);
|
}
|
arr = arr.filter((m) => m != null).map((m) => Number(m));
|
let num = 0;
|
arr.forEach((item) => {
|
num += item;
|
});
|
value.average = (num / arr.length).toFixed(2);
|
let comValueList = [];
|
let insValueList = [];
|
this.sagData.forEach((item, index) => {
|
comValueList.push({
|
i: obj.insProduct.id,
|
r: 0,
|
c: index,
|
v: {
|
v: item.average,
|
},
|
});
|
for (let i = 0; i < 6; i++) {
|
insValueList.push({
|
i: obj.insProduct.id,
|
r: i,
|
c: index,
|
v: {
|
v: item[`value${i}`],
|
},
|
});
|
}
|
});
|
this.param[obj.insProduct.id].insValue = insValueList;
|
this.param[obj.insProduct.id].comValue = comValueList;
|
} else {
|
let arr = this.sagData.map((m) => {
|
let obj0 = {
|
i: obj.insProduct.id,
|
r: 0,
|
c: 0,
|
v: {
|
v: m[value],
|
},
|
};
|
return obj0;
|
});
|
this.param[obj.insProduct.id].insValue = arr;
|
}
|
// 进行数据的保存
|
this.saveInsContext(obj.insProduct.id);
|
}
|
},
|
// 弧垂特性---结束
|
// 数据采集
|
getDataAcquisitionDevice() {
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
this.tableLists.find((m) => m.templateId == this.currentTable)
|
.templateName == "温度循环检验原始记录"
|
) {
|
// 温度循环检验原始记录----数采----PK8000
|
let temperature = this.wareForm.inspectionItemSubclass;
|
if (typeof temperature == "string" && temperature.includes("(常温)")) {
|
temperature = `20℃(常温)`;
|
} else {
|
temperature = temperature + "℃";
|
}
|
this.dataAcquisitionLoading = true;
|
temDataAcquisition({
|
entrustCode: this.insOrder.entrustCode,
|
sampleCode: this.currentSample.sampleCode,
|
model: this.wareForm0.model,
|
cycles: this.wareForm.inspectionItem,
|
temperature: temperature,
|
})
|
.then((res) => {
|
this.dataAcquisitionLoading = false;
|
if (res.code != 200) {
|
return;
|
}
|
// 赋值回显PK8000的数据
|
this.wareFormChange();
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
} else {
|
const _than = this;
|
// 一般的数据采集
|
_than.dataAcquisitionLoading = true;
|
// let urlStr =
|
// this.$api.deviceScope.dataCollection +
|
// "?entrustCode=" +
|
// this.insOrder.entrustCode +
|
// "&sampleCode=" +
|
// this.currentSample.sampleCode +
|
// "&id=" +
|
// this.currentSample.id;
|
let data = {
|
entrustCode: this.insOrder.entrustCode,
|
sampleCode: this.currentSample.sampleCode,
|
id: this.currentSample.id,
|
};
|
console.log(_than.fibers);
|
if (_than.fibers && _than.fibers.length > 0) {
|
//当前选中的光纤带
|
let currentFibers = _than.fibers.find(
|
(f) => f.id == _than.currentTab
|
);
|
if (null == currentFibers || currentFibers.length == 0) {
|
currentFibers = _than.fibers[0];
|
}
|
// urlStr +=
|
// "&fiberOpticRibbon=" +
|
// currentFibers.bushingColor +
|
// "-" +
|
// currentFibers.code;
|
data.fiberOpticRibbon =
|
currentFibers.bushingColor + "-" + currentFibers.code;
|
}
|
// let replaceUrlStr = urlStr
|
// .split("")
|
// .map((s) => s.replace("#", "%23"))
|
// .join("");
|
dataCollection(data)
|
.then((res) => {
|
this.dataAcquisitionLoading = false;
|
if (res.code != 200) {
|
return;
|
}
|
this.dataAcquisitionInfoNew = this.HaveJson(res.data);
|
// 对数采回来的值进行处理
|
this.handleDataAcquisition(res.data);
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
}
|
},
|
handleDataAcquisition(data) {
|
// 是否可以编辑数采数据
|
if (this.dataAcquisitionEidtAble) {
|
this.getDataType = 1;
|
} else {
|
this.getDataType = 2;
|
}
|
this.dataAcquisitionInfo = {};
|
this.getData = [];
|
for (let i in data) {
|
let obj = {
|
faName: i,
|
child: [],
|
};
|
// 循环数采数据
|
for (let j in data[i]) {
|
// 拼接字符串 检验项+检验子项
|
let str0 = "";
|
if (i == j) {
|
str0 = i + ",";
|
} else {
|
str0 = i + "," + j;
|
}
|
if (
|
j != "frequency" &&
|
data[i][j] &&
|
(!data[i][j].result || typeof data[i][j].result == "string")
|
) {
|
// 处理数采信息格式
|
if (data[i][j].result) {
|
this.dataAcquisitionInfo[str0] = {
|
value: data[i][j].result,
|
frequency: data[i].frequency,
|
};
|
}
|
let list = this.tableList[0].arr;
|
// 循环页面列表信息,判断数采数据对应页面列表信息的检验项是哪个,并给当前检验项绑定设备信息
|
list.forEach((item, index) => {
|
let num0 = 0;
|
let str = "";
|
item.forEach((m) => {
|
if (
|
m.v.ps &&
|
(m.v.ps.value == "检验子项" || m.v.ps.value == "检验项")
|
) {
|
if (m.v.ps && m.v.ps.value == "检验项") {
|
if (num0 == 0) {
|
str = m.v.v + ",";
|
num0++;
|
}
|
}
|
if (m.v.ps && m.v.ps.value == "检验子项") {
|
if (num0 == 1) {
|
str = str + m.v.v;
|
}
|
}
|
}
|
// 绑定设备信息
|
if (
|
data[i][j].equipName &&
|
data[i][j].equipValue &&
|
m.v &&
|
m.v.ps &&
|
m.v.ps.value == "设备编码" &&
|
str0 == str
|
) {
|
if (!m.v.v) {
|
this.changeEquip(
|
data[i][j].equipValue,
|
m,
|
data[i][j].equipName
|
);
|
}
|
}
|
});
|
});
|
} else if (
|
j != "frequency" &&
|
data[i][j] &&
|
Array.isArray(data[i][j].result)
|
) {
|
// 如果返回的数采数据是数组,则处理数组
|
// 以下逻辑为获取每个检验项可输入的检验值的最大个数
|
let str0 = "";
|
if (i == j) {
|
str0 = i + ",";
|
} else {
|
str0 = i + "," + j;
|
}
|
let list = this.tableList[0].arr;
|
let maxNum = 0;
|
list.forEach((item, index) => {
|
let num0 = 0;
|
let str = "";
|
item.forEach((m) => {
|
if (
|
m.v.ps &&
|
(m.v.ps.value == "检验子项" || m.v.ps.value == "检验项")
|
) {
|
if (m.v.ps && m.v.ps.value == "检验项") {
|
if (num0 == 0) {
|
str = m.v.v + ",";
|
num0++;
|
}
|
}
|
if (m.v.ps && m.v.ps.value == "检验子项") {
|
if (num0 == 1) {
|
str = str + m.v.v;
|
}
|
}
|
let num = 0;
|
list[index].forEach((n) => {
|
if (
|
n.v.ps &&
|
n.v.ps.value &&
|
typeof n.v.ps.value == "string" &&
|
n.v.ps.value.includes("检验值")
|
) {
|
num++;
|
}
|
});
|
if (str0 == str) {
|
maxNum = num;
|
}
|
}
|
// 绑定设备
|
if (
|
data[i][j].equipName &&
|
data[i][j].equipValue &&
|
m.v &&
|
m.v.ps &&
|
m.v.ps.value == "设备编码" &&
|
str0 == str
|
) {
|
if (!m.v.v) {
|
console.log(
|
"changeEquip-->>",
|
data[i][j].equipValue,
|
m,
|
data[i][j].equipName
|
);
|
this.changeEquip(
|
data[i][j].equipValue,
|
m,
|
data[i][j].equipName
|
);
|
}
|
}
|
});
|
});
|
// let arr3 = []
|
// for (let l=0 ;i<data[i][j].result.length;i++){
|
// arr3.push({
|
// id:,
|
// value:
|
// })
|
// }
|
// 获取到最大检验值输入个数后重组数据
|
let obj0 = {
|
name: j,
|
arr: data[i][j].result,
|
maxNum: maxNum,
|
value: [],
|
};
|
// 如果数采返回的数组长度大于最大输入个数,则将数采数据在弹框中展示,用户选择需要手动选择数采的信息
|
if (
|
data[i][j].result &&
|
Array.isArray(data[i][j].result) &&
|
data[i][j].result.length > maxNum
|
) {
|
obj.child.push(obj0);
|
} else {
|
this.dataAcquisitionInfo[str0] = {
|
value: data[i][j].result,
|
};
|
}
|
}
|
}
|
if (obj.child.length > 0) {
|
this.getData.push(obj);
|
}
|
}
|
// 如果存在数采返回的数组长度大于最大输入个数,则弹出弹框选择
|
if (this.getData.length > 0) {
|
this.dataGetDia = true;
|
this.getDataIndex = [];
|
} else {
|
// 如果都不存在,则,进入处理数采线程里去处理数据
|
try {
|
// 向 Worker 发送消息,开始处理逻辑
|
this.getDataIndexLoading = false;
|
this.dataGetDia = false;
|
this.getDataTypeId = "";
|
this.worker0.postMessage(
|
JSON.stringify({
|
dataAcquisitionInfo: this.dataAcquisitionInfo,
|
list: this.tableList[0].arr,
|
})
|
);
|
} catch (error) {
|
console.log(1111, error);
|
}
|
}
|
// 监听 Worker 返回的结果
|
this.worker0.onmessage = (event) => {
|
let result = JSON.parse(event.data);
|
if (result.method == "changeInput") {
|
// 采集后的数据,需要进行计算的线程进行计算
|
let { list, n } = result.value;
|
this.$set(this.tableList[0], "arr", list);
|
this.changeInput(
|
"",
|
`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,
|
n
|
);
|
} else if (result.getDataTypeId) {
|
// 获取到数采最后一项,检验项的ID
|
this.getDataTypeId = result.getDataTypeId;
|
}
|
};
|
},
|
// 如果存在数采返回的数组长度大于最大输入个数,则弹出弹框选择,这里是弹框的提交
|
submitDataGet() {
|
if (this.getDataIndex.length == 0) {
|
this.$message.error("请选择需要采集的数据");
|
return;
|
}
|
this.getDataIndex.sort((a, b) => a - b);
|
for (let i = 0; i < this.getData.length; i++) {
|
for (let j = 0; j < this.getData[i].child.length; j++) {
|
// 对用户选择的数采信息进行处理,赋值
|
let arr = [];
|
for (let k = 0; k < this.getDataIndex.length; k++) {
|
arr.push(
|
this.dataAcquisitionInfoNew[this.getData[i].faName][
|
this.getData[i].child[j].name
|
].result[this.getDataIndex[k]]
|
);
|
}
|
this.dataAcquisitionInfoNew[this.getData[i].faName][
|
this.getData[i].child[j].name
|
].result = arr;
|
}
|
}
|
this.getDataIndexLoading = true;
|
// 赋值完成后需要再次进入处理数采线程里去处理数据
|
this.handleDataAcquisition(this.dataAcquisitionInfoNew);
|
},
|
// 多线程
|
startWorker() {
|
if (this.worker) {
|
this.stopWorker(); // 确保之前的 Worker 已停止
|
}
|
// 创建 Worker 实例
|
this.worker = new InspectionWorker();
|
if (this.worker0) {
|
this.stopWorker(); // 确保之前的 Worker 已停止
|
}
|
// 创建 Worker 实例
|
this.worker0 = new InspectionWorkerAsData();
|
},
|
// 停止多线程
|
stopWorker() {
|
if (this.worker) {
|
this.worker.terminate();
|
this.worker = null;
|
}
|
if (this.worker0) {
|
this.worker0.terminate();
|
this.worker0 = null;
|
}
|
},
|
// 温度循环---开始
|
changeItem(row) {
|
// 内端、外端进行赋值逻辑处理
|
|
// 赋值到页面
|
if (row.value0 && !row.value1) {
|
// 赋值内端
|
this.$set(row, "comValue", Number(row.value0).toFixed(3));
|
} else if (!row.value0 && row.value1) {
|
// 赋值外端
|
this.$set(row, "comValue", Number(row.value1).toFixed(3));
|
} else if (row.value0 && row.value1) {
|
// 赋值计算值
|
this.$set(
|
row,
|
"comValue",
|
((Number(row.value0) + Number(row.value1)) / 2).toFixed(3)
|
);
|
} else {
|
return;
|
}
|
// 赋值到传到后端的参数---特殊项目必须严格按照这种格式传参,否则后端识别不了
|
// 赋值内外端
|
this.param[row.id].insValue = [
|
{
|
i: row.id,
|
v: {
|
v: row.value0,
|
},
|
},
|
{
|
i: row.id,
|
v: {
|
v: row.value1,
|
},
|
},
|
];
|
// 赋值计算值
|
this.param[row.id].comValue = [
|
{
|
i: row.id,
|
v: {
|
v: row.comValue,
|
},
|
},
|
];
|
// 判断结果,得出结论
|
if (this.wareForm.inspectionItemSubclass != "20(常温)") {
|
// 给页面列表赋值最终值
|
row.resValue = row.comValue
|
? Math.abs(row.comValue - Number(row.insProduct.complue)).toFixed(3)
|
: "";
|
// 给传递到后端的参数赋值最终值
|
this.param[row.id].resValue.v.v = row.resValue;
|
// 判断结论,给页面列表赋值结论
|
if (row.ask && row.resValue) {
|
if (row.ask.includes("<")) {
|
row.insResult = row.resValue < row.ask.split("<")[1] ? 1 : 0;
|
} else if (row.ask.includes(">")) {
|
row.insResult = row.resValue < row.ask.split(">")[1] ? 1 : 0;
|
} else if (row.ask.includes("=")) {
|
row.insResult = row.resValue == row.ask.split("=")[1] ? 1 : 0;
|
} else if (row.ask.includes("≥")) {
|
row.insResult = row.resValue >= row.ask.split("≥")[1] ? 1 : 0;
|
} else if (row.ask.includes("≤")) {
|
row.insResult = row.resValue <= row.ask.split("≤")[1] ? 1 : 0;
|
}
|
// 给传递到后端的参数赋值结论
|
this.param[row.id].insResult.v.v = row.insResult;
|
}
|
} else {
|
// 20(常温)默认合格
|
this.param[row.id].insResult.v.v = 1;
|
}
|
this.$refs.wareTableData.doLayout();
|
// 进行数据的保存
|
this.saveInsContext(row.id);
|
},
|
// 当循环次数、温度点变化、PK8000数采时会调用,主要是获取信息进行回显
|
wareFormChange(m, type) {
|
if (
|
!this.tableLists.find((m) => m.templateId == this.currentTable) ||
|
this.tableLists.find((m) => m.templateId == this.currentTable)
|
.templateName != "温度循环检验原始记录"
|
) {
|
return;
|
}
|
if (m && type) {
|
this.wareForm[type] = m;
|
}
|
let wareForm = { ...this.wareForm };
|
if (this.wareForm.inspectionItemSubclass == "20(常温)") {
|
wareForm.inspectionItemSubclass = "20℃(常温)";
|
} else {
|
wareForm.inspectionItemSubclass = wareForm.inspectionItemSubclass + "℃";
|
}
|
this.wareTableDataLoading = true;
|
temCycle({
|
sampleId: this.currentSample.id,
|
...wareForm,
|
})
|
.then((res) => {
|
this.wareTableDataLoading = false;
|
if (res.code == 201) return;
|
let { productVos, sampleVo } = res.data;
|
this.wareForm0 = sampleVo;
|
// 初始化传到后端的参数
|
productVos = productVos.map((m) => {
|
let obj = { ...m, ...m.insProduct };
|
this.param[obj.id] = {
|
insValue: [],
|
comValue: [],
|
resValue: {
|
i: obj.id,
|
v: {
|
v: null,
|
},
|
},
|
equipValue: [],
|
equipName: [],
|
insResult: {
|
i: obj.id,
|
v: {
|
v: null,
|
},
|
},
|
};
|
let insProductResult = obj.insProductResult;
|
// 给传递到后端的参数进行赋值,给页面数据赋值
|
if (insProductResult) {
|
for (let i in insProductResult) {
|
switch (i) {
|
// 检验值赋值
|
case "insValue":
|
let insValue = JSON.parse(insProductResult[i]);
|
if (insValue && insValue.length > 1) {
|
// 后端的参数进行赋值
|
this.param[obj.id].insValue = [
|
{
|
i: obj.id,
|
v: {
|
v: insValue[0].v,
|
},
|
},
|
{
|
i: obj.id,
|
v: {
|
v: insValue[1].v,
|
},
|
},
|
];
|
// 页面数据赋值
|
obj.value0 = insValue[0].v;
|
obj.value1 = insValue[1].v;
|
} else if (insValue && insValue.length == 1) {
|
// 后端的参数进行赋值
|
this.param[obj.id].insValue = [
|
{
|
i: obj.id,
|
v: {
|
v: insValue[0].v,
|
},
|
},
|
{
|
i: obj.id,
|
v: {
|
v: "",
|
},
|
},
|
];
|
// 页面数据赋值
|
obj.value0 = insValue[0].v;
|
obj.value1 = "";
|
}
|
break;
|
// 计算值赋值
|
case "comValue":
|
let comValue = JSON.parse(insProductResult[i]);
|
if (comValue && comValue.length > 0) {
|
// 后端的参数进行赋值
|
this.param[obj.id].comValue = [
|
{
|
i: obj.id,
|
v: {
|
v: comValue[0].v,
|
},
|
},
|
];
|
// 页面数据赋值
|
obj.comValue = comValue[0].v;
|
}
|
break;
|
default:
|
break;
|
}
|
}
|
// 最终值赋值
|
// 后端的参数进行赋值
|
this.param[obj.id].resValue = {
|
i: obj.id,
|
v: {
|
v: obj.lastValue,
|
},
|
};
|
// 页面数据赋值
|
obj.resValue = obj.lastValue;
|
// 结论赋值
|
// 后端的参数进行赋值
|
this.param[obj.id].insResult = {
|
i: obj.id,
|
v: {
|
v: obj.insResult,
|
},
|
};
|
}
|
return obj;
|
});
|
// 以下是对温度循环页面呈现进行处理,去重、数据重置等等
|
let arr = [];
|
let arr0 = [];
|
let mySet = new Set();
|
productVos.forEach((m, i) => {
|
let num0 = mySet.size;
|
mySet.add(m.inspectionItemClass);
|
let num1 = mySet.size;
|
if (num0 != num1) {
|
if (i > 0) {
|
arr.push(arr0);
|
}
|
arr0 = [];
|
arr0.push(m);
|
} else {
|
arr0.push(m);
|
}
|
});
|
arr.push(arr0);
|
let arr1 = [];
|
this.wareLength = [];
|
for (let i = 0; i < arr.length; i++) {
|
this.wareLength.push(arr[i][0].inspectionItemClass);
|
}
|
for (let i = 0; i < arr[0].length; i++) {
|
arr1.push([]);
|
}
|
arr.forEach((item, index) => {
|
item.forEach((m, i) => {
|
try {
|
arr1[i].push(m);
|
} catch (e) {
|
console.log(e);
|
}
|
});
|
});
|
let arr2 = [];
|
arr1.forEach((item) => {
|
let obj = {
|
bushColor: item[0].bushColor,
|
code: item[0].code,
|
color: item[0].color,
|
arr: item,
|
};
|
arr2.push(obj);
|
});
|
// 这是页面最终呈现的格式
|
this.wareTableData = arr2;
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
// 获取设备列表
|
this.getEquipOptions(true, this.currentSample.insProduct[0].id);
|
// this.$refs.wareTableData&&this.$refs.wareTableData.doLayout()
|
},
|
// 温度循环---结束
|
// 热循环---开始
|
// 循环次数切换时调用
|
thermalCyclingChange() {
|
this.thermalCyclingLoading = true;
|
temCycle({
|
sampleId: this.currentSample.id,
|
inspectionItem: this.thermalCyclingInfo.inspectionItem,
|
})
|
.then((res) => {
|
this.thermalCyclingLoading = false;
|
if (res.code == 201) return;
|
let { productVos, sampleVo } = res.data;
|
this.thermalCyclingInfo = { ...this.thermalCyclingInfo, ...sampleVo };
|
for (let i in this.param) {
|
if (this.param[i].inspectionItemSubclass) {
|
delete this.param[i];
|
}
|
}
|
if (productVos.length > 0) {
|
this.thermalCyclingInfo.inspectionItemClass =
|
productVos[0].insProduct.inspectionItemClass;
|
// 根据检验项,初始化传到后端的参数
|
productVos.forEach((item) => {
|
this.param[item.insProduct.id] = {
|
insValue: [],
|
comValue: [],
|
resValue: {
|
i: item.insProduct.id,
|
r: 0,
|
c: 0,
|
v: {
|
v: null,
|
},
|
},
|
equipValue: [],
|
equipName: [],
|
insResult: {
|
i: item.insProduct.id,
|
v: {
|
v: null,
|
},
|
},
|
inspectionItemSubclass: item.insProduct.inspectionItemSubclass,
|
};
|
let obj = { ...item, ...item.insProduct };
|
let insProductResult = obj.insProductResult;
|
if (insProductResult) {
|
// 给页面列表赋值,给后端传参赋值
|
for (let i in insProductResult) {
|
switch (i) {
|
case "insValue":
|
// 给页面列表赋值
|
let insValue = JSON.parse(insProductResult[i]);
|
if (insValue && insValue.length > 0) {
|
this.thermalCyclingInfo.length = 0;
|
this.thermalCyclingInfo.arr.forEach((a) => {
|
if (a.name == obj.inspectionItemSubclass) {
|
a.arr = [];
|
for (let i = 0; i < insValue.length; i++) {
|
a.arr.push({
|
value0: insValue[i].v,
|
value1: insValue[i].w,
|
});
|
this.thermalCyclingInfo.length++;
|
}
|
a.insResult = obj.insResult;
|
}
|
});
|
// 给后端传参赋值
|
this.param[obj.id].insValue = [];
|
insValue.forEach((m) => {
|
this.param[obj.id].insValue.push({
|
i: obj.id,
|
r: 0,
|
c: 0,
|
w: m.w,
|
v: {
|
v: m.v,
|
},
|
});
|
});
|
}
|
break;
|
}
|
}
|
// 给后端传参赋值
|
this.param[obj.id].insResult = {
|
i: obj.id,
|
v: {
|
v: obj.insResult,
|
},
|
};
|
} else {
|
// 给页面列表赋值
|
this.thermalCyclingInfo.arr.forEach((a) => {
|
if (a.name == obj.inspectionItemSubclass) {
|
a.insResult = null;
|
a.arr = [];
|
a.arr.push({
|
value0: "",
|
value1: "",
|
});
|
}
|
});
|
this.thermalCyclingInfo.length = 1;
|
}
|
});
|
}
|
// 获取设备列表
|
this.getEquipOptions(true, this.currentSample.insProduct[0].id);
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
// 添加检验值
|
handleAddThermal() {
|
this.thermalCyclingInfo.length++;
|
this.thermalCyclingInfo.arr.forEach((item) => {
|
item.arr.push({
|
value0: "",
|
value1: "",
|
});
|
});
|
},
|
// 删除检验值
|
handleDeleteThermal() {
|
if (this.thermalCyclingInfo.length == 1) {
|
this.$message.error("最后一条数据不能删除");
|
return;
|
} else {
|
this.thermalCyclingInfo.length--;
|
this.thermalCyclingInfo.arr.forEach((item) => {
|
item.arr.pop();
|
});
|
// 删除后需要保存一下数据
|
this.saveThermalCycling(true, { name: "导线温度" }, true, true);
|
}
|
},
|
saveThermalCycling(m, item, type, isDelete) {
|
console.log(m, item, type);
|
console.log(this.thermalCyclingInfo);
|
// 结果判断
|
if (m == "") {
|
m = "0";
|
}
|
if (m && item && type) {
|
if (
|
item.name == "导线温度" ||
|
item.name == "耐张温度" ||
|
item.name == "接续温度"
|
) {
|
this.thermalCyclingInfo.arr.forEach((a) => {
|
if (a.name == "耐张温度") {
|
a.arr.forEach((b, i) => {
|
// 获取对应的导线温度
|
let num0 = 0;
|
this.thermalCyclingInfo.arr.forEach((c) => {
|
if (c.name == "导线温度") {
|
num0 = c.arr[i].value0;
|
}
|
});
|
// 判断结论
|
if (!num0 || !b.value0) {
|
b.state = null;
|
} else if (Number(num0) > Number(b.value0)) {
|
b.state = 1;
|
} else {
|
b.state = 0;
|
}
|
});
|
let state = a.arr.filter((b) => b.state == null).length;
|
let state0 = a.arr.filter((b) => b.state == 0).length;
|
let state1 = a.arr.filter((b) => b.state == 1).length;
|
if (state > 0) {
|
// 待定
|
a.insResult = null;
|
} else if (state0 > 0) {
|
// 不合格
|
a.insResult = 0;
|
} else if (state1 == a.arr.length) {
|
// 合格
|
a.insResult = 1;
|
}
|
}
|
if (a.name == "接续温度") {
|
a.arr.forEach((b, i) => {
|
// 获取对应的导线温度
|
let num0 = 0;
|
this.thermalCyclingInfo.arr.forEach((c) => {
|
if (c.name == "导线温度") {
|
num0 = c.arr[i].value0;
|
}
|
});
|
if (!num0 || !b.value0) {
|
b.state = null;
|
} else if (Number(num0) > Number(b.value0)) {
|
b.state = 1;
|
} else {
|
b.state = 0;
|
}
|
});
|
let state = a.arr.filter((b) => b.state == null).length;
|
let state0 = a.arr.filter((b) => b.state == 0).length;
|
let state1 = a.arr.filter((b) => b.state == 1).length;
|
if (state > 0) {
|
a.insResult = null;
|
} else if (state0 > 0) {
|
a.insResult = 0;
|
} else if (state1 == a.arr.length) {
|
a.insResult = 1;
|
}
|
}
|
});
|
}
|
}
|
// 给后端传参赋值
|
this.thermalCyclingInfo.arr.forEach((item) => {
|
for (let i in this.param) {
|
if (this.param[i].inspectionItemSubclass == item.name) {
|
switch (item.name) {
|
case "环境温度":
|
this.param[i].insResult.v.v = 1;
|
this.param[i].insValue = [];
|
item.arr.forEach((insValue) => {
|
this.param[i].insValue.push({
|
i: i,
|
r: 0,
|
c: 0,
|
v: {
|
v: insValue.value0,
|
},
|
});
|
});
|
break;
|
case "导线温度":
|
this.param[i].insResult.v.v = 1;
|
this.param[i].insValue = [];
|
item.arr.forEach((insValue) => {
|
this.param[i].insValue.push({
|
i: i,
|
r: 0,
|
c: 0,
|
w: insValue.value1,
|
v: {
|
v: insValue.value0,
|
},
|
});
|
});
|
break;
|
case "耐张温度":
|
this.param[i].insValue = [];
|
item.arr.forEach((insValue) => {
|
this.param[i].insValue.push({
|
i: i,
|
r: 0,
|
c: 0,
|
w: insValue.value1,
|
v: {
|
v: insValue.value0,
|
},
|
});
|
});
|
this.param[i].insResult.v.v = item.insResult;
|
break;
|
case "接续温度":
|
this.param[i].insValue = [];
|
item.arr.forEach((insValue) => {
|
this.param[i].insValue.push({
|
i: i,
|
r: 0,
|
c: 0,
|
w: insValue.value1,
|
v: {
|
v: insValue.value0,
|
},
|
});
|
});
|
this.param[i].insResult.v.v = item.insResult;
|
break;
|
}
|
}
|
}
|
});
|
// 保存数据
|
let currentId = null;
|
for (let i in this.param) {
|
if (this.param[i].inspectionItemSubclass == item.name) {
|
currentId = i;
|
}
|
}
|
if (isDelete) {
|
this.saveInsContext(currentId, true);
|
} else {
|
this.saveInsContext(currentId);
|
}
|
},
|
// 热循环---结束
|
// 单根垂直燃烧---开始
|
singleRootVertical() {
|
let obj = this.currentSample.insProduct.filter((m) =>
|
m.inspectionItem.includes("单根垂直燃烧")
|
)[0];
|
this.singleRootVerticalInfo.arr = this.currentSample.insProduct.filter(
|
(m) => m.inspectionItem.includes("单根垂直燃烧")
|
);
|
if (obj) {
|
let tell = obj.tell;
|
this.singleRootVerticalInfo.num = Number(
|
tell.split(",")[1].replace("根", "")
|
);
|
this.singleRootVerticalInfo.model = obj.model;
|
this.singleRootVerticalInfo.methodName = obj.methodS;
|
this.singleRootVerticalInfo.arr.forEach((a) => {
|
this.$set(a, "value", []);
|
a.value = [];
|
for (let i = 0; i < this.singleRootVerticalInfo.num; i++) {
|
this.$set(a.value, i, "");
|
if (a.insProductResult) {
|
let valueList = JSON.parse(a.insProductResult.insValue);
|
if (valueList.length > 0) {
|
this.$set(a.value, i, valueList[i].v);
|
}
|
}
|
}
|
this.$set(a, "resValue", a.lastValue);
|
this.$set(a, "insResult", a.insResult);
|
});
|
this.getEquipOptions(true, obj.id);
|
}
|
},
|
changeSingleRootVertical(value, item) {
|
let arr = item.value.filter((m) => m !== "");
|
if (
|
item.inspectionItemSubclass == "上支架下缘和炭化部分上起点之间的距离"
|
) {
|
// 求最小值
|
item.resValue = Math.min(...arr);
|
} else {
|
// 求最大值
|
item.resValue = Math.max(...arr);
|
}
|
// 保存最终值
|
this.param[item.id].resValue = {
|
i: item.id,
|
v: {
|
v: item.resValue,
|
},
|
};
|
// 保存检验值
|
this.param[item.id].insValue = [];
|
item.value.forEach((a) => {
|
let obj = {
|
i: item.id,
|
v: {
|
v: a,
|
},
|
};
|
this.param[item.id].insValue.push(obj);
|
});
|
let ask = item.ask;
|
if (ask) {
|
if (ask.includes("~")) {
|
ask = ask.replace("~", "~");
|
}
|
if (ask.includes(">")) {
|
ask = ask.replace(">", ">");
|
}
|
if (ask.includes("<")) {
|
ask = ask.replace("<", "<");
|
}
|
if (ask.includes("=")) {
|
let val = ask.replace("=", "");
|
item.insResult = item.resValue == Number(val) ? 1 : 0;
|
} else if (ask.includes("≥")) {
|
let val = ask.replace("≥", "");
|
item.insResult =
|
item.resValue == Number(val) || item.resValue > Number(val) ? 1 : 0;
|
} else if (ask.includes("≤")) {
|
let val = ask.replace("≤", "");
|
item.insResult =
|
item.resValue == Number(val) || item.resValue < Number(val) ? 1 : 0;
|
} else if (ask.includes("<")) {
|
let val = ask.replace("<", "");
|
item.insResult = item.resValue < Number(val) ? 1 : 0;
|
} else if (ask.includes(">")) {
|
let val = ask.replace(">", "");
|
item.insResult = item.resValue > Number(val) ? 1 : 0;
|
}
|
// 保存结论
|
this.param[item.id].insResult = {
|
i: item.id,
|
v: {
|
v: item.insResult,
|
},
|
};
|
// 进行数据的保存
|
this.saveInsContext(item.id);
|
}
|
},
|
// 单根垂直燃烧---结束
|
// 保存湿度、温度数据
|
subOtherForm(m, type) {
|
write({
|
[type]: Number(m),
|
insOrderId: this.currentSample.insOrderId,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
this.$message.success("保存成功");
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
// 权限获取
|
getPower() {
|
let power = JSON.parse(sessionStorage.getItem("power"));
|
let fileDel = false;
|
let fileAdd = false;
|
let collected = false;
|
let temDataAcquisition = false;
|
for (var i = 0; i < power.length; i++) {
|
if (power[i].menuMethod == "uploadFile") {
|
fileAdd = true;
|
}
|
if (power[i].menuMethod == "delfile") {
|
fileDel = true;
|
}
|
if (power[i].menuMethod == "isItAllowedToModifyTheCollectedValues") {
|
collected = true;
|
}
|
if (power[i].menuMethod == "temDataAcquisition") {
|
temDataAcquisition = true;
|
}
|
}
|
if (!fileDel) {
|
this.componentData0.do.splice(1, 1);
|
}
|
this.fileAdd = fileAdd;
|
this.collected = collected;
|
this.temDataAcquisition = temDataAcquisition;
|
},
|
uploadSample() {
|
doInsOrder({
|
id: this.id,
|
laboratory: this.sonLaboratory,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
this.sampleProduct = res.data.sampleProduct;
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
// 根据类型、任务id、实验室来获取样品的检验项信息
|
async getCurrentProduct(id, type) {
|
this.tableLoading = true;
|
let res = await getInsProduct({
|
id: id,
|
type: type,
|
laboratory: this.sonLaboratory,
|
});
|
this.tableLoading = false;
|
return res.data;
|
},
|
handleChangeBushing(row, column, event) {
|
this.currentBushing = row;
|
this.fiberOpticTape = [];
|
this.currentFiberOpticTape = null;
|
this.fiberOptic = [];
|
this.currentFiberOptic = null;
|
if (row.fiber && row.fiber.length > 0) {
|
// 直接配置光纤
|
this.fiberOptic = row.fiber;
|
} else if (row.fibers && row.fibers.length > 0) {
|
// 配置光纤带后,再配置光纤
|
this.fiberOpticTape = row.fibers;
|
}
|
this.bushingVisible = false;
|
this.currentKey0 = row.index;
|
},
|
async handleChangeOptic(row, column, event) {
|
this.currentFiberOptic = row;
|
this.currentFiberOptic.productList.forEach((a) => {
|
this.param[a.id] = {
|
insValue: [],
|
comValue: [],
|
resValue: null,
|
equipValue: [],
|
equipName: [],
|
insResult: null,
|
};
|
});
|
this.fiberOpticVisible = false;
|
let list = await this.getCurrentProduct(row.id, 2);
|
this.getTableLists0(list);
|
this.currentKey2 = row.index;
|
},
|
async handleChangeTape(row, column, event) {
|
this.currentFiberOpticTape = row;
|
this.param = {};
|
this.fiberOptic = [];
|
this.currentFiberOptic = null;
|
this.currentFiberOpticTape.productList.forEach((a) => {
|
this.param[a.id] = {
|
insValue: [],
|
comValue: [],
|
resValue: null,
|
equipValue: [],
|
equipName: [],
|
insResult: null,
|
};
|
});
|
this.fiberOpticTapeVisible = false;
|
let list = await this.getCurrentProduct(row.id, 1);
|
this.getTableLists0(list);
|
if (row.fiber && row.fiber.length > 0) {
|
// 配置光纤
|
this.fiberOptic = row.fiber;
|
}
|
this.currentKey1 = row.index;
|
},
|
// 切换样品
|
async handleChangeSample(row, column, event) {
|
// 初始化数据
|
this.param = {};
|
// 清空光纤配置相关数据
|
this.fiberOpticTape = [];
|
this.currentFiberOpticTape = null;
|
this.fiberOptic = [];
|
this.currentFiberOptic = null;
|
this.bushing = [];
|
this.currentBushing = null;
|
this.sampleVisible = false;
|
this.filterSampleCode = null;
|
this.sampleProduct = JSON.parse(
|
JSON.stringify(this.fileterSampleProducts)
|
);
|
// 赋值样品
|
this.currentSample = this.HaveJson(row);
|
let list = await this.getCurrentProduct(row.id, 0);
|
// 赋值样品检验项
|
this.currentSample.insProduct = this.HaveJson(list);
|
// 初始化后端传参
|
this.param = {};
|
this.changeType = 0;
|
this.currentSample.insProduct.forEach((a, j) => {
|
this.param[a.id] = {
|
insValue: [],
|
comValue: [],
|
resValue: null,
|
equipValue: [],
|
equipName: [],
|
insResult: null,
|
};
|
});
|
// 获取套管,光纤带,光纤数据
|
this.getReportModel(row.id);
|
let bushing = this.currentSample.bushing;
|
if (bushing && bushing.length > 0) {
|
this.bushing = bushing;
|
}
|
// 处理页面列表数据
|
this.getTableLists();
|
// this.currentKey = row.index
|
this.currentKey = this.sampleProduct.findIndex((m) => m.id == row.id) + 1;
|
this.currentTab = null;
|
// 向多线程去保存页面列表数据,后端传参,当前模板信息
|
this.worker.postMessage(
|
JSON.stringify({
|
modelType: this.sampleProduct[0].model,
|
type: "saveData",
|
tableList: this.tableList,
|
param: this.param,
|
currentTable: this.currentTable,
|
})
|
);
|
},
|
// 松套管的判断\如果changeType不等于3那么页面不展示松套管检验项
|
handleCasing(inspectionItem) {
|
if (this.changeType != 3) {
|
if (inspectionItem.includes("松套管")) {
|
return false;
|
} else {
|
return true;
|
}
|
} else {
|
return true;
|
}
|
},
|
// 获取套管,光纤带,光纤数据
|
getReportModel(id) {
|
this.getReportModelLoading = true;
|
getReportModel({
|
sampleId: id,
|
sonLaboratory: this.sonLaboratory,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
this.getReportModelLoading = false;
|
this.fibers = res.data["光纤带"];
|
this.fiber = res.data["光纤"];
|
this.casing = res.data["套管"];
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
// 套管,光纤带,光纤等切换,对应原始记录模板也要切换
|
async handleChange(m, type) {
|
if (this.fiber && this.fiber.length > 0) {
|
const fiber = this.fiber.find((ele) => ele.id == m);
|
if (fiber) {
|
this.insFibersId = fiber.insFibersId;
|
}
|
}
|
this.changeType = type;
|
if (m) {
|
// 获取检验项
|
let list = await this.getCurrentProduct(m, type);
|
if (list.length > 0) {
|
// 初始化后端传参
|
this.param = {};
|
list.forEach((a) => {
|
this.param[a.id] = {
|
insValue: [],
|
comValue: [],
|
resValue: null,
|
equipValue: [],
|
equipName: [],
|
insResult: null,
|
};
|
});
|
// 页面列表数据处理
|
this.getTableLists0(list);
|
// 获取套管,光纤带,光纤数据
|
this.getReportModel(this.currentSample.id);
|
// 向多线程保存数据
|
this.worker.postMessage(
|
JSON.stringify({
|
modelType: this.sampleProduct[0].model,
|
type: "saveData",
|
tableList: this.tableList,
|
param: this.param,
|
currentTable: this.currentTable,
|
bushing: m,
|
})
|
);
|
} else {
|
this.tableLists = [];
|
this.tableList = [];
|
this.$message.error("检验项为空");
|
}
|
}
|
},
|
// 改变任务
|
handleChangeTask(row) {
|
if (row.length > 0) this.id = row[0].id;
|
this.taskVisible = false;
|
},
|
// 字典获取信息
|
getTypeDicts() {
|
getDicts("urgency_level")
|
.then((res) => {
|
if (res.code === 200) {
|
this.urgentList = res.data;
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
// getDicts("").then(res=>{
|
// if(res.status===200){
|
// console.log(res)
|
// }
|
// }).catch(error=>{
|
// console.error(error)
|
// })
|
// this.$axios
|
// .post(this.$api.enums.selectEnumByCategory, {
|
// category: "载荷",
|
// })
|
// .then((res) => {
|
// this.loadList = res.data;
|
// });
|
},
|
// 字典获取信息
|
getInsStateDicts() {
|
getDicts("inspection_task_state")
|
.then((res) => {
|
if (res.code === 200) {
|
this.typeList = res.data;
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
// 字典获取信息
|
getComparisonList() {
|
getDicts("coordinate_transformation")
|
.then((res) => {
|
if (res.code === 200) {
|
this.comparisonList = res.data;
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
// 获取检验值为下拉时的下拉列表
|
selectEnumByCategoryOfSelect(val) {
|
this.enumList = [];
|
if (val === undefined || val === null) {
|
return;
|
}
|
selectDictDataByName(val)
|
.then((res) => {
|
if (res.code === 200) {
|
this.enumList = res.data;
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
tableRowClassName({ row, rowIndex }) {
|
row.index = rowIndex + 1;
|
},
|
// 处理页面列表数据--去重,生成检验模板切换列表
|
getTableLists() {
|
const mySet1 = new Set();
|
this.tableLists = this.currentSample.insProduct.filter((m) => {
|
let num0 = mySet1.size;
|
if (m.templateId != null && m.template != null) {
|
try {
|
mySet1.add(
|
JSON.stringify({
|
template: m.template,
|
templateId: m.templateId,
|
})
|
);
|
} catch (error) {
|
console.log(222, error);
|
}
|
}
|
let num1 = mySet1.size;
|
if (num1 > num0) {
|
return m;
|
}
|
});
|
console.log(111, this.tableLists);
|
if (this.tableLists && this.tableLists.length > 0) {
|
this.tableList = null;
|
this.tableList = [this.tableLists[0]];
|
this.currentTable = this.tableLists[0].templateId;
|
// 处理页面列表数据
|
this.handleTableData();
|
}
|
},
|
// 光纤配置相关模板table列表
|
getTableLists0(list) {
|
const mySet1 = new Set();
|
this.tableLists = list.filter((m) => {
|
let num0 = mySet1.size;
|
if (m.templateId != null && m.template != null) {
|
try {
|
mySet1.add(
|
JSON.stringify({
|
template: m.template,
|
templateId: m.templateId,
|
})
|
);
|
} catch (error) {
|
console.log(333, error);
|
}
|
}
|
let num1 = mySet1.size;
|
if (num1 > num0) {
|
return m;
|
}
|
});
|
if (this.tableLists && this.tableLists.length > 0) {
|
this.tableList = null;
|
this.tableList = [this.tableLists[0]];
|
this.currentTable = this.tableLists[0].templateId;
|
this.currentSample.insProduct = this.HaveJson(list);
|
// 处理页面列表数据
|
this.handleTableData();
|
}
|
},
|
// 处理页面列表数据
|
handleTableData() {
|
this.excelMethodList = []; //excel函数列表
|
this.widthList = this.tableList[0].style.columnlen; //页面宽度--根据模板来的
|
// 特殊检验项设备数据清空
|
this.equipForm = {
|
value0: null,
|
code0: null,
|
value1: null,
|
code1: null,
|
};
|
// 温度循环检验原始记录--开始
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
this.tableLists.find((m) => m.templateId == this.currentTable)
|
.templateName == "温度循环检验原始记录"
|
) {
|
// 对要求值进行拆分处理,进而得出页面内容
|
let ask = this.currentSample.insProduct.filter(
|
(m) => m.inspectionItem == "温度循环"
|
)[0].ask;
|
let askList = ask.split(";");
|
// 获取循环次数
|
this.numOptions = [];
|
for (let i = 1; i <= askList[askList.length - 1]; i++) {
|
this.numOptions.push({
|
value: i,
|
label: i,
|
});
|
}
|
let mySet1 = new Set();
|
askList.forEach((m, i) => {
|
if (i < askList.length - 1) {
|
mySet1.add(m.split(",")[0].replace("℃", ""));
|
}
|
});
|
// 获取温度点列表
|
this.temperatureOptions = [];
|
mySet1.forEach((m) => {
|
this.temperatureOptions.push({
|
value: String(m),
|
label: m,
|
});
|
});
|
// 初始化页面数据
|
this.wareTableDataLoading = true;
|
temDataAcquisition2({
|
entrustCode: this.insOrder.entrustCode,
|
sampleCode: this.currentSample.sampleCode,
|
model: this.currentSample.model,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
this.wareFormChange();
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
}
|
// 温度循环检验原始记录---结束
|
// 热循环检验原始记录---开始
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
(this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("热循环") ||
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("温升试验"))
|
) {
|
// 根据要求值拆分数据,得到页面渲染的信息
|
// let ask = this.currentSample.insProduct[0].ask
|
let ask = this.currentSample.insProduct.filter(
|
(m) => m.inspectionItem == "热循环" || m.inspectionItem == "温升试验"
|
)[0].ask;
|
let askList = ask.split(";");
|
this.thermalCyclingInfo.max = Number(askList[askList.length - 1]);
|
let arr = [];
|
for (let i = 0; i < askList.length - 1; i++) {
|
arr.push(askList[i].split(",")[0]);
|
}
|
arr = arr.map((item) => {
|
let obj = {};
|
obj.name = item;
|
if (obj.insResult == null || obj.insResult == undefined) {
|
obj.arr = [
|
{
|
value0: "",
|
value1: "",
|
},
|
];
|
obj.insResult = null;
|
}
|
return obj;
|
});
|
this.thermalCyclingInfo.arr = arr;
|
// 初始化页面数据
|
this.thermalCyclingChange();
|
}
|
// 热循环检验原始记录---结束
|
// 单根垂直燃烧检验原始记录---开始
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("单根垂直燃烧")
|
) {
|
this.singleRootVertical();
|
}
|
// 单根垂直燃烧检验原始记录---结束
|
// 弧垂检验原始记录---开始
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("弧垂")
|
) {
|
this.getSageInfo();
|
}
|
// 弧垂检验原始记录---结束
|
|
// 架空地线应力应变检验原始记录---开始
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("架空地线应力应变")
|
) {
|
this.getStressStrainInfo();
|
}
|
// 架空地线应力应变检验原始记录---结束
|
|
// 防振锤功率特性检验原始记录---开始
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("防振锤功率特性")
|
) {
|
this.getPowerCharacteristicsInfo();
|
}
|
// 防振锤功率特性检验原始记录---结束
|
// 疲劳试验检验原始记录---开始
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
this.tableLists
|
.find((m) => m.templateId == this.currentTable)
|
.templateName.includes("疲劳试验检验原始记录")
|
) {
|
this.getFatigueTestInfo();
|
}
|
// 疲劳试验检验原始记录---结束
|
// 本次循环主要做页面渲染层面的处理--单元格合并预处理
|
this.tableList.forEach((a) => {
|
let mcList = [];
|
a.template.forEach((b) => {
|
if (
|
b.v.mc != undefined &&
|
b.v.mc.cs != undefined &&
|
b.v.mc.rs != undefined
|
) {
|
mcList.push(b);
|
}
|
});
|
let count = 0;
|
mcList.forEach((b) => {
|
for (var c in a.template) {
|
for (var i = 0; i < b.v.mc.cs; i++) {
|
for (var i2 = 0; i2 < b.v.mc.rs; i2++) {
|
if (
|
a.template[c].c === b.c + i &&
|
a.template[c].r === b.r + i2
|
) {
|
let bb = this.HaveJson(b);
|
a.template[c].v.v = bb.v.v;
|
a.template[c].v.ps = bb.v.ps;
|
a.template[c].v.fc = bb.v.fc;
|
a.template[c].v.fs = bb.v.fs;
|
a.template[c].v.ht = bb.v.ht;
|
a.template[c].mc = count;
|
break;
|
}
|
}
|
}
|
}
|
count++;
|
});
|
});
|
// 本次循环主要是控制合并,以及控制检验项信息是否展示出来,以便后续检验
|
this.tableList.forEach((a) => {
|
let dels = new Set(); //需要删除的行
|
let ids = []; //所有检验项的id
|
let set3 = new Set();
|
a.template.forEach((b) => {
|
let size1 = set3.size;
|
let size2 = set3.add(b.r).size;
|
if (size1 < size2) {
|
let str = "";
|
let count4 = 0;
|
let isThree = 0;
|
a.template.forEach((c) => {
|
// 获取到 检验项分类+检验项+检验子项的拼接,如果模板里的信息跟接口返回的检验项信息能够匹配则展示出来
|
if (b.r === c.r) {
|
if (
|
c.v.ps != undefined &&
|
c.v.ps.value === "检验项分类" &&
|
count4 === 0
|
) {
|
// 三级分类
|
isThree = 1;
|
} else if (
|
c.v.ps != undefined &&
|
c.v.ps.value === "检验项" &&
|
count4 === 0
|
) {
|
// 二级分类
|
isThree = 0;
|
}
|
if (isThree == 0) {
|
if (c.v.ps != undefined && c.v.ps.value === "检验项") {
|
if (count4 === 0) {
|
str += c.v.v;
|
count4 += 1;
|
}
|
} else if (
|
c.v.ps != undefined &&
|
c.v.ps.value === "检验子项"
|
) {
|
if (count4 === 1) {
|
str += c.v.v;
|
count4 += 1;
|
}
|
}
|
} else if (isThree == 1) {
|
if (c.v.ps != undefined && c.v.ps.value === "检验项分类") {
|
if (count4 === 0) {
|
str += c.v.v;
|
count4 += 1;
|
}
|
} else if (c.v.ps != undefined && c.v.ps.value === "检验项") {
|
if (count4 === 1) {
|
str += c.v.v;
|
count4 += 1;
|
}
|
} else if (
|
c.v.ps != undefined &&
|
c.v.ps.value === "检验子项"
|
) {
|
if (count4 === 2) {
|
str += c.v.v;
|
count4 += 1;
|
}
|
}
|
}
|
}
|
});
|
if (str != "") {
|
let count2 = 0;
|
for (let i in this.currentSample.insProduct) {
|
let inspectionItemClass =
|
this.currentSample.insProduct[i].inspectionItemClass ==
|
null ||
|
this.currentSample.insProduct[i].inspectionItemClass ==
|
undefined
|
? ""
|
: this.currentSample.insProduct[i].inspectionItemClass;
|
let inspectionItem =
|
this.currentSample.insProduct[i].inspectionItem == null ||
|
this.currentSample.insProduct[i].inspectionItem == undefined
|
? ""
|
: this.currentSample.insProduct[i].inspectionItem;
|
let inspectionItemSubclass =
|
this.currentSample.insProduct[i].inspectionItemSubclass ==
|
null ||
|
this.currentSample.insProduct[i].inspectionItemSubclass ==
|
undefined
|
? ""
|
: this.currentSample.insProduct[i].inspectionItemSubclass;
|
// 如果相等,那么说明找到了,并且把id存起来,后续检验项也会在页面中显示出来
|
const itemStr =
|
inspectionItemClass + inspectionItem + inspectionItemSubclass;
|
if (
|
this.currentSample.insProduct[i].templateId ===
|
a.templateId &&
|
itemStr === str &&
|
!(this.changeType != 3 && itemStr.includes("松套管"))
|
) {
|
ids.push({
|
r: b.r,
|
id: this.currentSample.insProduct[i].id,
|
product: this.currentSample.insProduct[i],
|
});
|
break;
|
}
|
count2++;
|
}
|
if (count2 == this.currentSample.insProduct.length) {
|
dels.add(b.r);
|
}
|
}
|
}
|
});
|
// 操作删除
|
dels.forEach((del) => {
|
for (let b = 0; b < a.template.length; b++) {
|
if (a.template[b].r === del) {
|
a.template.splice(b, 1);
|
b -= 1;
|
}
|
}
|
});
|
// 操作赋值--主要赋值单位,试验方法等信息
|
ids.forEach((id) => {
|
for (let b = 0; b < a.template.length; b++) {
|
if (a.template[b].r === id.r) {
|
a.template[b].i = id.id;
|
if (
|
a.template[b].v.ps != undefined &&
|
a.template[b].v.ps.value === "单位"
|
) {
|
a.template[b].v.v = id.product.unit;
|
}
|
if (
|
a.template[b].v.ps != undefined &&
|
(a.template[b].v.ps.value === "试验方法" ||
|
a.template[b].v.ps.value === "检测方法")
|
) {
|
a.template[b].v.v = id.product.methodS;
|
}
|
}
|
}
|
});
|
let set2 = new Set();
|
// 合并的数据处理,cs rs 代表合并的数量
|
a.template.forEach((b) => {
|
let size1 = set2.size;
|
let size2 = set2.add(b.mc).size;
|
if (b.mc != undefined && size1 < size2) {
|
b.v.mc.rs = 0;
|
b.v.mc.cs = 0;
|
a.template.forEach((c) => {
|
if (b.mc === c.mc) {
|
if (b.r === c.r) {
|
b.v.mc.cs += 1;
|
}
|
if (b.c === c.c) {
|
b.v.mc.rs += 1;
|
}
|
}
|
});
|
}
|
});
|
});
|
// 本次循环主要是对后端传参进行初始化,样式逻辑修改
|
this.tableList.forEach((a) => {
|
let arrs = [];
|
let set = new Set();
|
let count1 = 0;
|
let conclusionList = []; //结论列表
|
let finalList = []; //最终值列表
|
// 结论与最终值在这里一一对应,以下两个列表长度肯定是一样的,如果有不一样,那么多半是模板配置得问题
|
conclusionList = a.template.filter(
|
(n) => n.v.ps != undefined && n.v.ps.value === "结论"
|
); //结论列表
|
finalList = a.template.filter(
|
(n) => n.v.ps != undefined && n.v.ps.value === "最终值"
|
); //最终值列表
|
a.template.forEach((b) => {
|
if (
|
b.v.ps != undefined &&
|
b.v.ps.value === "序号" &&
|
(b.v.mc == undefined || Object.keys(b.v.mc).length === 4)
|
) {
|
// 对序号进行赋值
|
count1++;
|
b.v.v = count1;
|
}
|
if (b.v.ps != undefined && b.v.ps.value === "要求值") {
|
// 对要求值进行赋值
|
b.v.v = this.getAsk(b.i);
|
}
|
// 对页面的和给后端传参的检验值,计算值,设备编码,设备名称,最终值,结论进行初始化
|
if (
|
b.v.ps != undefined &&
|
typeof b.v.ps.value === "string" &&
|
b.v.ps.value.includes("检验值")
|
) {
|
this.$set(b.v, "v", "");
|
// b.v.v = ''
|
b.u = "";
|
b.i && this.param[b.i] && this.param[b.i].insValue.push(b);
|
}
|
if (b.v.ps != undefined && b.v.ps.value === "计算值") {
|
this.$set(b.v, "v", "");
|
// b.v.v = ''
|
b.i && this.param[b.i] && this.param[b.i].comValue.push(b);
|
}
|
if (b.v.ps != undefined && b.v.ps.value === "设备编码") {
|
// b.v.v = ''
|
this.$set(b.v, "v", "");
|
b.i && this.param[b.i] && this.param[b.i].equipValue.push(b);
|
}
|
if (b.v.ps != undefined && b.v.ps.value === "设备名称") {
|
this.$set(b.v, "v", "");
|
// b.v.v = ''
|
b.i && this.param[b.i] && this.param[b.i].equipName.push(b);
|
}
|
if (b.v.ps != undefined && b.v.ps.value === "最终值") {
|
// b.v.v = ''
|
this.$set(b.v, "v", "");
|
if (
|
b.i !== undefined &&
|
this.param[b.i] &&
|
!this.param[b.i].resValue
|
) {
|
this.param[b.i].resValue = b;
|
}
|
}
|
if (b.v.ps != undefined && b.v.ps.value === "结论") {
|
if (
|
b.i !== undefined &&
|
this.param[b.i] &&
|
!this.param[b.i].insResult
|
) {
|
this.param[b.i].insResult = b;
|
conclusionList.forEach((n, i) => {
|
if (n.r == b.r && n.c == b.c) {
|
b.v.f = `(${
|
this.comparisonList.find(
|
(j) => j.dictValue == finalList[i].c
|
).dictLabel
|
}${finalList[i].r + 1})`;
|
}
|
});
|
}
|
}
|
set.add(b.r);
|
// 如果模板列表的函数存在,那么加入到excel函数列表里面
|
if (b.v.f) {
|
this.excelMethodList.push(b);
|
}
|
});
|
// 以下是样式处理逻辑
|
set = Array.from(set).sort((a, b) => a - b);
|
set.forEach((b) => {
|
let arr = [];
|
a.template.forEach((c) => {
|
if (c.r === b) {
|
arr.push(c);
|
}
|
});
|
arrs.push(arr);
|
});
|
a.arr = arrs;
|
this.tableWidth = 0;
|
for (let i = 0; i < arrs[0].length; i++) {
|
this.tableWidth +=
|
a.style.columnlen[i] === undefined ? 100 : a.style.columnlen[i];
|
}
|
});
|
// 本次循环主要是对页面及后端传参进行初始化赋值
|
this.currentSample.insProduct.forEach(async (a) => {
|
try {
|
// 计算值赋值
|
let comValue = JSON.parse(a.insProductResult.comValue);
|
for (var i = 0; i < comValue.length; i++) {
|
// this.param[a.id].comValue[i].v.v = this.toFixed(comValue[i].v,this.param[a.id].comValue[i].v.ct)
|
if (
|
this.param[a.id].comValue.find(
|
(m) => m.c == comValue[i].c && m.r == comValue[i].r
|
)
|
) {
|
this.param[a.id].comValue.find(
|
(m) => m.c == comValue[i].c && m.r == comValue[i].r
|
).v.v = this.toFixed(
|
comValue[i].v,
|
this.param[a.id].comValue.find(
|
(m) => m.c == comValue[i].c && m.r == comValue[i].r
|
).v.ct
|
);
|
} else if (!comValue[i].c || !comValue[i].r) {
|
this.param[a.id].comValue[i].v.v = this.toFixed(
|
comValue[i].v,
|
this.param[a.id].comValue[i].v.ct
|
);
|
}
|
}
|
} catch (e) {}
|
try {
|
// 检验值赋值
|
let insValue = JSON.parse(a.insProductResult.insValue);
|
for (let i = 0; i < insValue.length; i++) {
|
if (
|
this.param[a.id].insValue.find(
|
(m) => m.c == insValue[i].c && m.r == insValue[i].r
|
)
|
) {
|
this.param[a.id].insValue.find(
|
(m) => m.c == insValue[i].c && m.r == insValue[i].r
|
).v.v = this.toFixed(
|
insValue[i].v,
|
this.param[a.id].insValue.find(
|
(m) => m.c == insValue[i].c && m.r == insValue[i].r
|
).v.ct
|
);
|
this.param[a.id].insValue.find(
|
(m) => m.c == insValue[i].c && m.r == insValue[i].r
|
).u = insValue[i].u;
|
// this.param[a.id].insValue[i].v.v = insValue[i].v
|
// this.param[a.id].insValue[i].u = insValue[i].u
|
}
|
}
|
} catch (e) {}
|
try {
|
// 设备编号赋值
|
let equipValue = JSON.parse(a.insProductResult.equipValue);
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
((this.tableLists.find((m) => m.templateId == this.currentTable)
|
.templateName == "温度循环检验原始记录" &&
|
a.inspectionItem.includes("温度循环")) ||
|
a.inspectionItem.includes("热循环") ||
|
a.inspectionItem.includes("温升试验") ||
|
a.inspectionItem.includes("单根垂直燃烧") ||
|
a.inspectionItem.includes("弧垂") ||
|
a.inspectionItem.includes("应力应变") ||
|
a.inspectionItem.includes("振动疲劳") ||
|
a.inspectionItem.includes("舞动疲劳"))
|
) {
|
// 特殊项目初始化
|
this.param[a.id].equipValue = [];
|
for (let i = 0; i < equipValue.length; i++) {
|
this.param[a.id].equipValue.push({
|
v: {
|
v: "",
|
},
|
});
|
}
|
}
|
for (let i = 0; i < equipValue.length; i++) {
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
((this.tableLists.find((m) => m.templateId == this.currentTable)
|
.templateName == "温度循环检验原始记录" &&
|
a.inspectionItem.includes("温度循环")) ||
|
a.inspectionItem.includes("热循环") ||
|
a.inspectionItem.includes("温升试验") ||
|
a.inspectionItem.includes("单根垂直燃烧") ||
|
a.inspectionItem.includes("弧垂") ||
|
a.inspectionItem.includes("应力应变") ||
|
a.inspectionItem.includes("振动疲劳") ||
|
a.inspectionItem.includes("舞动疲劳"))
|
) {
|
// 温度循环设备赋值
|
// this.$set(this.equipForm, `code` + i, equipValue[i].v);
|
// this.param[a.id].equipValue[i].v.v = equipValue[i].v;
|
if (
|
a.inspectionItem.includes("温度循环") ||
|
a.inspectionItem.includes("单根垂直燃烧")
|
) {
|
this.$set(this.equipForm, `code` + i, equipValue[i].v);
|
} else {
|
if (Array.isArray(this.equipForm.code0)) {
|
this.equipForm.code0.push(equipValue[i].v);
|
} else {
|
let arr = [];
|
arr.push(equipValue[i].v);
|
this.$set(this.equipForm, `code0`, arr);
|
}
|
}
|
this.param[a.id].equipValue[i].v.v = equipValue[i].v;
|
} else {
|
// 普通设备赋值
|
if (a.inspectionItem.includes("防振锤功率特性")) {
|
let filterList = this.param[a.id].equipValue.filter(
|
(m) => m.v.v != "" && m.v.v != null && m.v.v != undefined
|
);
|
if (filterList.length > 0) {
|
this.param[a.id].equipValue[i].v.v = filterList[0].v.v;
|
} else {
|
this.param[a.id].equipValue[i].v.v = equipValue[i].v;
|
}
|
} else {
|
this.param[a.id].equipValue[i].v.v = equipValue[i].v;
|
}
|
}
|
}
|
} catch (e) {}
|
try {
|
// 设备名称赋值
|
let equipName = JSON.parse(a.insProductResult.equipName);
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
((this.tableLists.find((m) => m.templateId == this.currentTable)
|
.templateName == "温度循环检验原始记录" &&
|
a.inspectionItem.includes("温度循环")) ||
|
a.inspectionItem.includes("热循环") ||
|
a.inspectionItem.includes("温升试验") ||
|
a.inspectionItem.includes("单根垂直燃烧") ||
|
a.inspectionItem.includes("弧垂") ||
|
a.inspectionItem.includes("应力应变") ||
|
a.inspectionItem.includes("振动疲劳") ||
|
a.inspectionItem.includes("舞动疲劳"))
|
) {
|
// 设备名称初始化
|
this.param[a.id].equipName = [];
|
for (let i = 0; i < equipName.length; i++) {
|
this.param[a.id].equipName.push({
|
v: {
|
v: "",
|
},
|
});
|
}
|
}
|
for (let i = 0; i < equipName.length; i++) {
|
if (
|
this.tableLists.find((m) => m.templateId == this.currentTable) &&
|
((this.tableLists.find((m) => m.templateId == this.currentTable)
|
.templateName == "温度循环检验原始记录" &&
|
a.inspectionItem.includes("温度循环")) ||
|
a.inspectionItem.includes("热循环") ||
|
a.inspectionItem.includes("温升试验") ||
|
a.inspectionItem.includes("单根垂直燃烧") ||
|
a.inspectionItem.includes("弧垂") ||
|
a.inspectionItem.includes("应力应变") ||
|
a.inspectionItem.includes("振动疲劳") ||
|
a.inspectionItem.includes("舞动疲劳"))
|
) {
|
// 温度循环赋值
|
// this.$set(this.equipForm, `value` + i, equipName[i].v);
|
if (
|
a.inspectionItem.includes("温度循环") ||
|
a.inspectionItem.includes("单根垂直燃烧")
|
) {
|
this.$set(this.equipForm, `value` + i, equipName[i].v);
|
} else {
|
if (Array.isArray(this.equipForm.value0)) {
|
this.equipForm.value0.push(equipName[i].v);
|
} else {
|
let arr = [];
|
arr.push(equipName[i].v);
|
this.$set(this.equipForm, `value0`, arr);
|
}
|
}
|
// 保留最初的一个设备名称
|
this.equipName = JSON.parse(
|
JSON.stringify(this.equipForm.value0)
|
);
|
this.param[a.id].equipName[i].v.v = equipName[i].v;
|
} else {
|
// 普通设备名称赋值
|
if (a.inspectionItem.includes("防振锤功率特性")) {
|
let filterList = this.param[a.id].equipName.filter(
|
(m) => m.v.v != "" && m.v.v != null && m.v.v != undefined
|
);
|
if (filterList.length > 0) {
|
this.param[a.id].equipName[i].v.v = equipName[0].v.v;
|
} else {
|
this.param[a.id].equipName[i].v.v = equipName[i].v;
|
}
|
}
|
this.param[a.id].equipName[i].v.v = equipName[i].v;
|
}
|
}
|
} catch (e) {}
|
try {
|
// 最终值赋值
|
this.param[a.id].resValue.v.v = this.toFixed(
|
a.lastValue,
|
this.param[a.id].resValue.v.ct
|
);
|
// 结论赋值
|
this.param[a.id].insResult.v.v = a.insResult;
|
} catch (e) {}
|
});
|
// 对excel函数进行处理
|
this.handleExcelMethod();
|
},
|
// 检验值输入后触发的函数
|
changeInput(m, code, n, getDataType) {
|
// 为数采定义一个逻辑参数
|
if (getDataType == "getDataType") {
|
this.getDataType = 2;
|
}
|
let currentInsItemId = null; //当前检验项id
|
if (n) {
|
currentInsItemId = JSON.parse(JSON.stringify(n.i));
|
// 需要科学计数法的可以走这里
|
if (
|
this.currentSample.insProduct.find(
|
(ele) =>
|
ele.id == currentInsItemId && ele.inspectionItem == "体积电阻率"
|
)
|
) {
|
if (parseFloat(n.v.v) >= 100000) {
|
let num2 = new Big(n.v.v);
|
n.v.v = num2.toExponential();
|
}
|
}
|
// 定义一个函数来验证分数是否有效
|
function isValidFraction(fraction) {
|
const [numerator, denominator] = fraction.split("/"); // 分子和分母
|
return !(!denominator || !numerator);
|
}
|
const isTrue = isValidFraction(n.v.v);
|
if (!isTrue) {
|
n.v.v = n.v.v.replace("/", "");
|
}
|
}
|
try {
|
// 向 Worker 发送消息,开始处理逻辑
|
this.worker.postMessage(
|
JSON.stringify({
|
code: code,
|
tableList: this.tableList,
|
excelMethodList: this.excelMethodList,
|
comparisonList: this.comparisonList,
|
currentSample: this.currentSample,
|
param: this.param,
|
currentTable: this.currentTable,
|
getDataTypeId: this.getDataTypeId,
|
modelType: this.sampleProduct[0].model,
|
currentInsItem: n,
|
})
|
);
|
} catch (error) {
|
console.log(444, error);
|
}
|
|
// 监听 Worker 返回的结果
|
this.worker.onmessage = (event) => {
|
this.result = JSON.parse(event.data);
|
switch (this.result.method) {
|
case "saveInsContext":
|
this.$nextTick(() => {
|
this.$set(
|
this.tableList[0],
|
"arr",
|
this.result.value.tableList[0].arr
|
);
|
this.param = this.result.value.param;
|
if (this.result.value.currentInsItemId) {
|
currentInsItemId = this.result.value.currentInsItemId;
|
}
|
// 特殊处理一下结论,会有这种特殊情况
|
for (var i in this.param) {
|
if (
|
this.param[i].insResult &&
|
this.param[i].insResult.v &&
|
this.param[i].insResult.v.v
|
) {
|
if (this.param[i].insResult.v.v == "合格") {
|
this.$set(this.param[i].insResult.v, "v", 1);
|
} else if (this.param[i].insResult.v.v == "不合格") {
|
this.$set(this.param[i].insResult.v, "v", 0);
|
}
|
}
|
}
|
this.saveInsContext(currentInsItemId);
|
});
|
break;
|
case "tableList":
|
this.$nextTick(() => {
|
// 更新数据
|
this.$delete(this.tableList[0], "arr");
|
this.$set(this.tableList[0], "arr", this.result.value[0].arr);
|
});
|
break;
|
case "getCurrentInsProduct":
|
// 更新页面数据
|
this.getCurrentInsProduct(this.result.value);
|
break;
|
}
|
};
|
},
|
// 是否需要数采
|
async determineWhetherToCollectData() {
|
let res = await determineWhetherToCollectData({
|
managementNumber: "",
|
});
|
this.isGet = res.data;
|
if (
|
this.currentSample.insProduct.filter(
|
(ele) => ele.inspectionItemType == "1"
|
).length > 0
|
) {
|
this.isEdit = true;
|
}
|
},
|
// 根据后端传参更新页面数据 param => this.tableList[0].insProductResult
|
getCurrentInsProduct(pId) {
|
if (!this.tableList[0].insProductResult) {
|
this.tableList[0].insProductResult = {};
|
}
|
for (let m in this.param[pId]) {
|
let value = this.param[pId][m];
|
switch (m) {
|
case "comValue":
|
// 赋值计算值
|
if (value && value.length > 0) {
|
this.tableList[0].insProductResult[m] = [];
|
value.forEach((a, i) => {
|
let obj = {
|
v: a.v.v,
|
};
|
this.tableList[0].insProductResult[m].push(obj);
|
});
|
try {
|
this.tableList[0].insProductResult[m] = JSON.stringify(
|
this.tableList[0].insProductResult[m]
|
);
|
} catch (error) {
|
console.log(555, error);
|
}
|
}
|
break;
|
// 赋值检验值
|
case "insValue":
|
if (value && value.length > 0) {
|
this.tableList[0].insProductResult[m] = [];
|
value.forEach((a, i) => {
|
let obj = {
|
v: a.v.v,
|
u: a.u,
|
};
|
this.tableList[0].insProductResult[m].push(obj);
|
});
|
try {
|
this.tableList[0].insProductResult[m] = JSON.stringify(
|
this.tableList[0].insProductResult[m]
|
);
|
} catch (error) {
|
console.log(666, error);
|
}
|
}
|
break;
|
// 赋值设备编号
|
case "equipValue":
|
if (value && value.length > 0) {
|
this.tableList[0].insProductResult[m] = [];
|
value.forEach((a, i) => {
|
let obj = {
|
v: a.v.v,
|
};
|
this.tableList[0].insProductResult[m].push(obj);
|
});
|
try {
|
this.tableList[0].insProductResult[m] = JSON.stringify(
|
this.tableList[0].insProductResult[m]
|
);
|
} catch (error) {
|
console.log(777, error);
|
}
|
}
|
break;
|
// 赋值设备名称
|
case "equipName":
|
if (value && value.length > 0) {
|
this.tableList[0].insProductResult[m] = [];
|
value.forEach((a, i) => {
|
let obj = {
|
v: a.v.v,
|
};
|
this.tableList[0].insProductResult[m].push(obj);
|
});
|
try {
|
this.tableList[0].insProductResult[m] = JSON.stringify(
|
this.tableList[0].insProductResult[m]
|
);
|
} catch (error) {
|
console.log(888, error);
|
}
|
}
|
break;
|
// 赋值最终值
|
case "resValue":
|
this.tableList[0].lastValue = value ? value.v.v : "";
|
break;
|
// 赋值结论
|
case "insResult":
|
this.tableList[0].insResult = value ? value.v.v : "";
|
break;
|
}
|
}
|
},
|
// 对EXCEL函数进行处理
|
handleExcelMethod() {
|
if (this.excelMethodList.length > 0) {
|
this.excelMethodList.map((item) => {
|
// 得到每个函数的参数列表
|
item.valueList = excelFunction.changeParameter(item.v.f);
|
return item;
|
});
|
}
|
},
|
getValue(v) {
|
// 对页面展示数据进行处理,@,代表换行
|
let str = v.v
|
? v.v
|
: v.v === 0
|
? v.v
|
: v.ct && v.ct.s
|
? v.ct.s.length > 0 &&
|
v.ct.s[0].v
|
.replace(new RegExp("\n", "g"), "<br/>")
|
.replace(new RegExp("@", "g"), "<br/>")
|
: "";
|
// 对数据保留小数点进行处理
|
if (v.ct && v.ct.fa && v.ct.fa.includes(".") && str) {
|
let num = 0;
|
let str0 = v.ct.fa.split(".")[1];
|
num = str0.length;
|
str = Number(str).toFixed(num);
|
}
|
if (v.v && typeof v.v == "string" && v.v.includes("@")) {
|
str = v.v.replace(new RegExp("@", "g"), "<br/>");
|
}
|
return str;
|
},
|
// 获取当前输入框类型
|
getInspectionValueType(id) {
|
for (var a in this.currentSample.insProduct) {
|
if (this.currentSample.insProduct[a].id == id) {
|
return this.currentSample.insProduct[a].inspectionValueType;
|
}
|
}
|
},
|
// 获取要求描述
|
getTell(id) {
|
for (var a in this.currentSample.insProduct) {
|
if (this.currentSample.insProduct[a].id == id) {
|
return this.currentSample.insProduct[a].tell;
|
}
|
}
|
},
|
// 动态获取单元格宽度
|
handleWidth(n) {
|
let sum = 0;
|
if (n.v.mc && n.v.mc.cs && n.v.mc.c != undefined) {
|
for (let i = 0; i < n.v.mc.cs; i++) {
|
let num = this.widthList[i + n.v.mc.c]
|
? this.widthList[i + n.v.mc.c]
|
: 100;
|
sum += num;
|
}
|
} else {
|
sum = this.widthList[n.c] ? this.widthList[n.c] : 100;
|
}
|
return sum;
|
},
|
// 对输入值进行格式校验
|
handleInput(n) {
|
try {
|
n.v.v = n.v.v.replace(/[^\d.^e\-/+]/g, "");
|
n.v.v = n.v.v.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
|
n.v.v = n.v.v
|
.replace(".", "$#$")
|
.replace(/\./g, "")
|
.replace("$#$", ".");
|
n.v.v = n.v.v.replace(/\/{2,}/g, "/"); //只保留第一个/清除多余的
|
n.v.v = n.v.v
|
.replace("/", "$#$")
|
.replace(/\//g, "")
|
.replace("$#$", "/");
|
} catch (error) {
|
console.log(error);
|
}
|
},
|
getInspectionItemType(id) {
|
for (var a in this.currentSample.insProduct) {
|
if (this.currentSample.insProduct[a].id == id) {
|
return this.currentSample.insProduct[a].inspectionItemType;
|
}
|
}
|
},
|
// 获取要求值
|
getAsk(id) {
|
for (var a in this.currentSample.insProduct) {
|
if (this.currentSample.insProduct[a].id == id) {
|
return this.currentSample.insProduct[a].ask;
|
}
|
}
|
},
|
getSystemValue(n) {
|
let code = null;
|
try {
|
this.param[n.i].equipValue.forEach((a) => {
|
if (a.r === n.r) {
|
if (a.v.v == null || a.v.v == "") {
|
this.$message.error("请先选择采集的设备");
|
return;
|
} else {
|
code = a.v.v;
|
}
|
}
|
});
|
} catch (e) {
|
// console.log(e);
|
this.$message.error("找不到设备内容");
|
}
|
// console.log(n, code);
|
fetch("http://localhost:82/微信图片_20240518100811.png")
|
.then((res) => res.blob())
|
.then((blob) => {
|
// console.log(blob);
|
const url = URL.createObjectURL(blob);
|
// console.log(url);
|
});
|
/* this.$message.error('采集失败【已开放手动方式】')
|
for (var a in this.currentSample.insProduct) {
|
if (this.currentSample.insProduct[a].id == n.i) {
|
this.currentSample.insProduct[a].inspectionItemType = 0
|
}
|
} */
|
},
|
// 获取设备
|
getEquipOptions(e, id) {
|
console.log(e);
|
if (e) {
|
this.equipOptions = [];
|
let product = this.currentSample.insProduct.find((m) => m.id == id);
|
selectDeviceByCategory({
|
inspectionItem: product.inspectionItem,
|
inspectionItemSubclass: product.inspectionItemSubclass,
|
sonLaboratory: product.sonLaboratory,
|
})
|
.then((res) => {
|
if (res.code === 200 && res.data) {
|
this.equipOptions = res.data.map((m) => {
|
m.value = m.managementNumber;
|
m.label = m.deviceName;
|
return m;
|
});
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
}
|
},
|
getDic(e, id) {
|
if (e) {
|
for (var a in this.currentSample.insProduct) {
|
if (this.currentSample.insProduct[a].id == id) {
|
let str = this.currentSample.insProduct[a].dic;
|
this.selectEnumByCategoryOfSelect(str);
|
return str;
|
}
|
}
|
}
|
},
|
// 复核
|
upInsReview(e) {
|
if (e == 1) {
|
// 通过
|
this.reviewLoading = true;
|
verifyPlan({
|
orderId: this.orderId,
|
type: 1,
|
laboratory: this.sonLaboratory,
|
tell: null,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
this.$message.success("操作成功");
|
this.$emit("goback");
|
}
|
this.reviewLoading = false;
|
})
|
.catch((error) => {
|
console.error(error);
|
this.reviewLoading = false;
|
});
|
} else {
|
// 不通过
|
this.reviewDia = true;
|
}
|
},
|
handleReviewDia() {
|
if (this.noReason) {
|
this.reviewLoading = true;
|
verifyPlan({
|
orderId: this.orderId,
|
type: 0,
|
laboratory: this.sonLaboratory,
|
tell: this.noReason,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
this.$message.success("操作成功");
|
this.$emit("goback");
|
}
|
this.reviewLoading = false;
|
})
|
.catch((error) => {
|
console.error(error);
|
this.reviewLoading = false;
|
});
|
} else {
|
this.$message.error("未输入不通过原因");
|
}
|
},
|
submit() {
|
if (this.verifyUser === null || this.verifyUser === "") {
|
this.$message.error("请指定复核人员");
|
return;
|
}
|
if (!this.otherForm.humidity) {
|
this.$message.error("请输入湿度");
|
return;
|
}
|
if (!this.otherForm.temperature) {
|
this.$message.error("请输入温度");
|
return;
|
}
|
this.addVerifyDia = false;
|
this.submitLoading = true;
|
checkSubmitPlan({
|
orderId: this.orderId,
|
laboratory: this.sonLaboratory,
|
humidity: this.otherForm.humidity,
|
temperature: this.otherForm.temperature,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
if (!res.data || res.data.length == 0) {
|
getEquipName({
|
orderId: this.orderId,
|
sonLaboratory: this.sonLaboratory,
|
})
|
.then((response) => {
|
if (response.data.length > 0) {
|
let newData = [];
|
const h = this.$createElement;
|
for (let i in response.data) {
|
newData.push(
|
h(
|
"p",
|
{ style: "font-size: 14px;color: red;" },
|
Number(i) + 1 + "、" + response.data[i]
|
)
|
);
|
}
|
newData.push(
|
h(
|
"p",
|
{
|
style:
|
"font-size: 16px;color:#000;margin-top:12px;overflow-y: auto;max-height:80vh",
|
},
|
"以上项目未选择设备,确定提交?"
|
)
|
);
|
this.$confirm("提示", {
|
title: "提示",
|
message: h("div", null, newData),
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "",
|
})
|
.then(() => {
|
submitPlan({
|
orderId: this.orderId,
|
laboratory: this.sonLaboratory,
|
verifyUser: this.verifyUser,
|
entrustCode: this.insOrder.entrustCode,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
this.$message.success("操作成功");
|
this.$emit("goback");
|
}
|
this.submitLoading = false;
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
})
|
.catch(() => {
|
this.submitLoading = false;
|
});
|
} else {
|
submitPlan({
|
orderId: this.orderId,
|
laboratory: this.sonLaboratory,
|
verifyUser: this.verifyUser,
|
entrustCode: this.insOrder.entrustCode,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
this.$message.success("操作成功");
|
this.$emit("goback");
|
}
|
this.submitLoading = false;
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
} else {
|
getEquipName({
|
orderId: this.orderId,
|
sonLaboratory: this.sonLaboratory,
|
})
|
.then((response) => {
|
if (response.data.length > 0) {
|
let newData = [];
|
const h = this.$createElement;
|
for (let i in response.data) {
|
newData.push(
|
h(
|
"p",
|
{ style: "font-size: 14px;color: red;" },
|
Number(i) + 1 + "、" + response.data[i]
|
)
|
);
|
}
|
newData.push(
|
h(
|
"p",
|
{
|
style:
|
"font-size: 16px;color:#000;margin-top:12px;overflow-y: auto;max-height:80vh",
|
},
|
"以上项目未选择设备,确定提交?"
|
)
|
);
|
this.$confirm("提示", {
|
title: "提示",
|
message: h("div", null, newData),
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "",
|
})
|
.then(() => {
|
let newData1 = [];
|
const h1 = this.$createElement;
|
// 去重不合格处理
|
let set = new Set();
|
res.data.forEach((item) => {
|
if (!set.has(item)) {
|
set.add(item);
|
}
|
});
|
res.data = Array.from(set);
|
for (let i in res.data) {
|
const lastChar = res.data[i].slice(-1);
|
if (lastChar == "-") {
|
res.data[i] = res.data[i].slice(0, -1);
|
}
|
newData1.push(
|
h1(
|
"p",
|
{ style: "font-size: 14px;color: red;" },
|
Number(i) + 1 + "、" + res.data[i]
|
)
|
);
|
}
|
newData1.push(
|
h1(
|
"p",
|
{
|
style:
|
"font-size: 16px;color:#000;margin-top:12px;overflow-y: auto;max-height:80vh",
|
},
|
"以上项目不合格,确定提交?"
|
)
|
);
|
this.$confirm("提示", {
|
title: "提示",
|
message: h1("div", null, newData1),
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "",
|
})
|
.then(() => {
|
submitPlan({
|
orderId: this.orderId,
|
laboratory: this.sonLaboratory,
|
verifyUser: this.verifyUser,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
this.$message.success("操作成功");
|
this.$emit("goback");
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
})
|
.catch(() => {});
|
})
|
.catch(() => {
|
this.submitLoading = false;
|
});
|
} else {
|
let newData = [];
|
const h = this.$createElement;
|
// 去重不合格处理
|
let set = new Set();
|
res.data.forEach((item) => {
|
if (!set.has(item)) {
|
set.add(item);
|
}
|
});
|
res.data = Array.from(set);
|
for (let i in res.data) {
|
const lastChar = res.data[i].slice(-1);
|
if (lastChar == "-") {
|
res.data[i] = res.data[i].slice(0, -1);
|
}
|
newData.push(
|
h(
|
"p",
|
{ style: "font-size: 14px;color: red;" },
|
Number(i) + 1 + "、" + res.data[i]
|
)
|
);
|
}
|
newData.push(
|
h(
|
"p",
|
{
|
style:
|
"font-size: 16px;color:#000;margin-top:12px;overflow-y: auto;max-height:80vh",
|
},
|
"以上项目不合格,确定提交?"
|
)
|
);
|
this.$confirm("提示", {
|
title: "提示",
|
message: h("div", null, newData),
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "",
|
})
|
.then(() => {
|
submitPlan({
|
orderId: this.orderId,
|
laboratory: this.sonLaboratory,
|
verifyUser: this.verifyUser,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
this.$message.success("操作成功");
|
this.$emit("goback");
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
})
|
.catch(() => {});
|
this.submitLoading = false;
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
}
|
}
|
this.submitLoading = false;
|
})
|
.catch((error) => {
|
console.error(error);
|
this.submitLoading = false;
|
});
|
return;
|
},
|
// 统一在这里保存数据
|
saveInsContext(currentInsItemId, isDelete = false) {
|
try {
|
if (this.param) {
|
let param = null;
|
if (currentInsItemId) {
|
param = { [currentInsItemId]: this.param[currentInsItemId] };
|
} else {
|
param = this.param;
|
}
|
saveInsContext({
|
param: param,
|
currentTable: this.currentTable,
|
sampleId: this.currentSample.id,
|
orderId: this.orderId,
|
sonLaboratory: this.sonLaboratory,
|
isDelete: isDelete,
|
})
|
.then((res) => {
|
if (res.code == 201) {
|
this.$message.error("保存失败");
|
return;
|
}
|
this.$message.success("已保存");
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
// 向 Worker 发送消息,开始处理逻辑
|
this.worker.postMessage(
|
JSON.stringify({
|
modelType: this.sampleProduct[0].model,
|
type: "saveData",
|
tableList: this.tableList,
|
param: this.param,
|
currentTable: this.currentTable,
|
})
|
);
|
}
|
} catch (error) {
|
console.log(999, error);
|
}
|
},
|
// 设备改变
|
changeEquip(val, n, v) {
|
this.$set(n.v, "v", val);
|
this.tableList[0].arr.forEach((item, index) => {
|
item.forEach((m, i) => {
|
if (this.param[m.i]) {
|
this.param[m.i].state = 1;
|
}
|
if (m.i == n.i && m.v.ps && m.v.ps.value == "设备名称" && v) {
|
this.$set(m.v, "v", v);
|
}
|
});
|
});
|
for (let i in this.param) {
|
if (this.param[i].state != 1) {
|
delete this.param[i];
|
}
|
}
|
if (val && v) {
|
for (let i1 in this.param[n.i].equipName) {
|
if (
|
this.param[n.i].equipName[i1].i === n.i &&
|
this.param[n.i].equipName[i1].r === n.r
|
) {
|
this.$delete(this.param[n.i].equipValue[i1].v, "v");
|
this.$set(this.param[n.i].equipValue[i1].v, "v", val);
|
this.$delete(this.param[n.i].equipName[i1].v, "v");
|
this.$set(this.param[n.i].equipName[i1].v, "v", v);
|
}
|
}
|
}
|
for (let i in this.equipOptions) {
|
if (this.equipOptions[i].value == val) {
|
for (let i1 in this.param[n.i].equipName) {
|
if (
|
this.param[n.i].equipName[i1].i === n.i &&
|
this.param[n.i].equipName[i1].r === n.r
|
) {
|
this.$delete(this.param[n.i].equipValue[i1].v, "v");
|
this.$set(this.param[n.i].equipValue[i1].v, "v", val);
|
this.$delete(this.param[n.i].equipName[i1].v, "v");
|
this.$set(
|
this.param[n.i].equipName[i1].v,
|
"v",
|
this.equipOptions[i].label
|
);
|
this.tableList[0].arr.forEach((item, index) => {
|
item.forEach((m) => {
|
if (m.i == n.i && m.v.ps && m.v.ps.value == "设备名称") {
|
this.$set(m.v, "v", this.equipOptions[i].label);
|
}
|
});
|
});
|
}
|
}
|
}
|
}
|
console.log("param", this.param);
|
console.log("tableList", this.tableList);
|
let ids = [];
|
ids.push(n.i);
|
// 选择设备需要将合并的单元格一起赋值
|
this.tableList[0].arr.forEach((item, index) => {
|
item.forEach((m, i) => {
|
if (m.i == n.i && m.v.ps && m.v.ps.value == "设备名称") {
|
if (m.v.mc) {
|
if (m.v.mc.rs) {
|
for (let j = 1; j < m.v.mc.rs; j++) {
|
let value = m.v.v; // 设备名称
|
this.tableList[0].arr[index + j][i].v.v = value;
|
}
|
}
|
}
|
}
|
if (m.i == n.i && m.v.ps && m.v.ps.value == "设备编码") {
|
if (m.v.mc) {
|
if (m.v.mc.rs) {
|
for (let j = 1; j < m.v.mc.rs; j++) {
|
let value = m.v.v; // 设备编码
|
this.tableList[0].arr[index + j][i].v.v = value;
|
let productId = this.tableList[0].arr[index + j][0].i;
|
ids.push(productId);
|
}
|
}
|
}
|
}
|
});
|
});
|
|
console.log("ids", ids);
|
console.log("tableList2", this.tableList);
|
//保存数据
|
ids.forEach((id) => {
|
setTimeout(() => {
|
this.saveInsContext(id);
|
}, 100);
|
});
|
|
//this.saveInsContext(ids[i]);
|
},
|
getAuthorizedPerson() {
|
getLaboratoryPersonList()
|
.then((res) => {
|
if (res.code === 200) {
|
this.personList = res.data;
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
scrollInit() {
|
// 获取要绑定事件的元素
|
const nav = document.getElementById("nav");
|
var flag; // 鼠标按下
|
var downX; // 鼠标点击的x下标
|
var scrollLeft; // 当前元素滚动条的偏移量
|
nav.addEventListener("mousedown", function (event) {
|
flag = true;
|
downX = event.clientX; // 获取到点击的x下标
|
scrollLeft = this.scrollLeft; // 获取当前元素滚动条的偏移量
|
});
|
nav.addEventListener("mousemove", function (event) {
|
if (flag) {
|
// 判断是否是鼠标按下滚动元素区域
|
var moveX = event.clientX; // 获取移动的x轴
|
var scrollX = moveX - downX; // 当前移动的x轴下标减去刚点击下去的x轴下标得到鼠标滑动距离
|
this.scrollLeft = scrollLeft - scrollX; // 鼠标按下的滚动条偏移量减去当前鼠标的滑动距离
|
}
|
});
|
// 鼠标抬起停止拖动
|
nav.addEventListener("mouseup", function () {
|
flag = false;
|
});
|
// 鼠标离开元素停止拖动
|
nav.addEventListener("mouseleave", function (event) {
|
flag = false;
|
});
|
},
|
// 页面里面切换样品
|
async caretSample(num) {
|
let index = this.currentKey + num;
|
if (index < 1) {
|
this.$message.error("当前是第一个样品");
|
return;
|
} else if (index > this.sampleProduct.length) {
|
this.$message.error("当前是最后一个样品");
|
return;
|
}
|
this.currentKey = index;
|
this.currentSample = this.HaveJson(this.sampleProduct[index - 1]);
|
// 获取检验项
|
let list = await this.getCurrentProduct(this.currentSample.id, 0);
|
this.currentSample.insProduct = this.HaveJson(list);
|
// 初始化后端传参
|
this.param = {};
|
this.changeType = 0;
|
this.currentSample.insProduct.forEach((a, j) => {
|
this.param[a.id] = {
|
insValue: [],
|
comValue: [],
|
resValue: null,
|
equipValue: [],
|
equipName: [],
|
insResult: null,
|
};
|
});
|
// 更新页面光纤选择
|
this.getReportModel(this.currentSample.id);
|
// 页面数据处理
|
this.getTableLists();
|
// 更新到多线程
|
this.worker.postMessage(
|
JSON.stringify({
|
modelType: this.sampleProduct[0].model,
|
type: "saveData",
|
tableList: this.tableList,
|
param: this.param,
|
currentTable: this.currentTable,
|
})
|
);
|
},
|
caretBushing(num) {
|
let index = this.currentKey0 + num;
|
if (index < 1) {
|
this.$message.error("当前是第一个套管");
|
return;
|
} else if (index > this.bushing.length) {
|
this.$message.error("当前是最后一个套管");
|
return;
|
}
|
this.currentKey0 = index;
|
this.currentBushing = this.HaveJson(this.bushing[index - 1]);
|
this.fiberOpticTape = [];
|
this.currentFiberOpticTape = null;
|
this.fiberOptic = [];
|
this.currentFiberOptic = null;
|
if (this.currentBushing.fiber && this.currentBushing.fiber.length > 0) {
|
// 直接配置光纤
|
this.fiberOptic = this.currentBushing.fiber;
|
} else if (
|
this.currentBushing.fibers &&
|
this.currentBushing.fibers.length > 0
|
) {
|
// 配置光纤带后,再配置光纤
|
this.fiberOpticTape = this.currentBushing.fibers;
|
}
|
},
|
async caretTape(num) {
|
let index = this.currentKey1 + num;
|
if (index < 1) {
|
this.$message.error("当前是第一个光纤带");
|
return;
|
} else if (index > this.fiberOpticTape.length) {
|
this.$message.error("当前是最后一个光纤带");
|
return;
|
}
|
this.currentKey1 = index;
|
this.currentFiberOpticTape = this.HaveJson(
|
this.fiberOpticTape[index - 1]
|
);
|
this.param = {};
|
this.fiberOptic = [];
|
this.currentFiberOptic = null;
|
this.currentFiberOpticTape.productList.forEach((a) => {
|
this.param[a.id] = {
|
insValue: [],
|
comValue: [],
|
resValue: null,
|
equipValue: [],
|
equipName: [],
|
insResult: null,
|
};
|
});
|
this.fiberOpticTapeVisible = false;
|
let list = await this.getCurrentProduct(this.currentFiberOpticTape.id, 1);
|
this.getTableLists0(list);
|
if (
|
this.currentFiberOpticTape.fiber &&
|
this.currentFiberOpticTape.fiber.length > 0
|
) {
|
// 配置光纤
|
this.fiberOptic = this.currentFiberOpticTape.fiber;
|
}
|
},
|
async caretOptic(num) {
|
let index = this.currentKey2 + num;
|
if (index < 1) {
|
this.$message.error("当前是第一个光纤");
|
return;
|
} else if (index > this.fiberOptic.length) {
|
this.$message.error("当前是最后一个光纤");
|
return;
|
}
|
this.currentKey2 = index;
|
this.currentFiberOptic = this.HaveJson(this.fiberOptic[index - 1]);
|
this.currentFiberOptic.productList.forEach((a) => {
|
this.param[a.id] = {
|
insValue: [],
|
comValue: [],
|
resValue: null,
|
equipValue: [],
|
equipName: [],
|
insResult: null,
|
};
|
});
|
let list = await this.getCurrentProduct(this.currentFiberOptic.id, 2);
|
this.getTableLists0(list);
|
},
|
handleSuccessUp(response) {
|
this.upLoading = false;
|
if (response.code == 200) {
|
this.$message.success("上传成功");
|
this.$refs.fileList.selectList();
|
}
|
},
|
beforeUpload(file) {
|
if (file.size > 1024 * 1024 * 10) {
|
this.$message.error("上传文件不超过10M");
|
this.$refs.upload.clearFiles();
|
return false;
|
} else {
|
this.upLoading = true;
|
return true;
|
}
|
},
|
onError(err, file, fileList) {
|
this.$message.error("上传失败");
|
this.$refs.upload.clearFiles();
|
},
|
handleDown(row) {
|
downFile({
|
id: row.id,
|
})
|
.then((res) => {
|
if (res.code === 200) {
|
let url = "";
|
if (res.data.type == 1) {
|
url = this.javaApi + "/img/" + res.data.fileUrl;
|
file.downloadIamge(url, row.fileName);
|
} else {
|
url = this.javaApi + "/word/" + res.data.fileUrl;
|
const link = document.createElement("a");
|
link.href = url;
|
link.download = row.fileName;
|
link.click();
|
}
|
}
|
})
|
.catch((error) => {
|
console.error(error);
|
});
|
},
|
/**
|
* 将数值v保留ct.fa中'##'后的指定小数位数,并返回格式化后的字符串。
|
*
|
* @param v 要格式化的数值
|
* @param ct 包含格式化配置的对象
|
* @param ct.fa 格式化配置字符串,若包含'##'则按照其后的内容确定小数位数
|
* @returns 格式化后的字符串或原始数值(若配置不符合要求)
|
*/
|
toFixed(v, ct) {
|
if (v && ct && ct.fa) {
|
if (ct.fa.includes(".")) {
|
let num = ct.fa.slice(4).length;
|
return Number(v).toFixed(num);
|
} else {
|
return v;
|
}
|
} else {
|
return v;
|
}
|
},
|
},
|
};
|
</script>
|