From fcadf16afa65a8a5ca53a33c4b8f4bf2efe2ea03 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 16 九月 2026 09:21:44 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_新疆_新聚' into dev_新疆_新聚
---
src/views/business/inspectionTask/inspection.vue | 2911 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 2,911 insertions(+), 0 deletions(-)
diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue
index e69de29..68b3a9a 100644
--- a/src/views/business/inspectionTask/inspection.vue
+++ b/src/views/business/inspectionTask/inspection.vue
@@ -0,0 +1,2911 @@
+<template>
+ <div v-loading="loading" class="inspection" style="background-color: rgb(245, 247, 251);">
+ <el-row class="title">
+ <el-col v-if="insOrder.ifsOrderType!=='02wg'" :span="8" style="text-align: left">
+ <el-form :inline="true" :model="otherForm" class="form-inline" label-width="50px"
+ style="text-align: right; padding-top: 0; display: inline">
+ <el-form-item label="娓╁害:" style="margin-bottom: 0">
+ <el-input v-model="otherForm.temperature" :disabled="state > 1" placeholder="" size="small"
+ style="width: 90px; line-height: 60px" @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" placeholder="" size="small"
+ style="width: 90px; line-height: 60px" @change="(m) => subOtherForm(m, 'humidity')"></el-input>
+ <span style="margin-left: 4px">%</span>
+ </el-form-item>
+ </el-form>
+ </el-col>
+ <el-col :span="insOrder.ifsOrderType!=='02wg'?16:24" style="text-align: right">
+ <el-button v-if="insOrder.ifsOrderType && insOrder.ifsOrderType==='02wg'" size="small" type="primary" @click="showMaterialPropsDialog">IFS鐗╂枡灞炴�ф洿鏂�</el-button>
+ <el-button size="small" type="primary" @click="refreshView">鍒锋柊</el-button>
+ <el-button v-if="typeSource == 1" size="small" type="primary" @click="openPurchase">杩涜揣楠岃瘉</el-button>
+ <el-button v-if="state == 1 && [0,1].includes(Number(typeSource))" size="small" type="primary"
+ @click="openUnPassDialog('add')">涓嶅悎鏍煎鐞�</el-button>
+ <el-button size="small" type="primary" @click="sampleVisible = true; uploadSample();">鏍峰搧鍒囨崲</el-button>
+ <!-- <el-button v-if="state == 1" size="small" type="primary" @click="taskVisible = true">浠诲姟鍒囨崲</el-button>-->
+ <el-button v-if="state == 1" size="small" type="primary" @click="addVerifyDia = true">鎻愪氦</el-button>
+ <!-- 澶嶆牳 -->
+ <el-button v-if="state == 2" size="medium" type="primary" @click="openAddCheck">閫氳繃</el-button>
+ <el-button v-if="state == 2" size="medium" @click="upInsReview(0)">涓嶉�氳繃</el-button>
+ <el-button type="primary" size="small" @click="exportTable('myTable')">涓嬭浇鍘熷璁板綍</el-button>
+ <el-button size="small" @click="goback">杩斿洖</el-button>
+ </el-col>
+ </el-row>
+ <div class="search">
+<!-- <el-form :inline="true" :model="searchForm" class="form-inline" label-position="right" label-width="100px">-->
+<!-- <el-form-item label="濮旀墭缂栧彿:">-->
+<!-- <el-input v-model="insOrder.entrustCode" clearable disabled placeholder="璇疯緭鍏�" size="small"></el-input>-->
+<!-- </el-form-item>-->
+<!-- <el-form-item label="鏍峰搧缂栧彿:">-->
+<!-- <el-tooltip :content="currentSample.sampleCode" :disabled="!currentSample.sampleCode">-->
+<!-- <el-input v-model="currentSample.sampleCode" clearable disabled placeholder="璇疯緭鍏�" size="small"></el-input>-->
+<!-- </el-tooltip>-->
+<!-- </el-form-item>-->
+<!-- <el-form-item label="鏍峰搧鍚嶇О:">-->
+<!-- <el-input v-model="currentSample.sample" clearable disabled placeholder="璇疯緭鍏�" size="small"></el-input>-->
+<!-- </el-form-item>-->
+<!-- <el-form-item label="鏍峰搧鏁伴噺:">-->
+<!-- <el-input v-model="sampleProduct.length" clearable disabled placeholder="璇疯緭鍏�" size="small"></el-input>-->
+<!-- </el-form-item>-->
+<!-- <el-form-item label="鏍峰搧鍨嬪彿:">-->
+<!-- <el-input v-model="currentSample.model" clearable disabled placeholder="璇疯緭鍏�" size="small"></el-input>-->
+<!-- </el-form-item>-->
+<!-- <el-form-item label="涓嬪彂鏃堕棿:">-->
+<!-- <el-input v-model="insOrder.sendTime" clearable disabled placeholder="璇疯緭鍏�" size="small"></el-input>-->
+<!-- </el-form-item>-->
+<!-- <el-form-item label="绱ф�ョ▼搴�:">-->
+<!-- <el-input v-model="insOrder.typeName" clearable disabled placeholder="璇疯緭鍏�" size="small"></el-input>-->
+<!-- </el-form-item>-->
+<!-- <el-form-item label="绾﹀畾鏃堕棿:">-->
+<!-- <el-input v-model="insOrder.appointed" clearable disabled placeholder="璇疯緭鍏�" size="small"></el-input>-->
+<!-- </el-form-item>-->
+<!-- <el-form-item v-if="typeSource === 1" label="鎶芥鏁伴噺:">-->
+<!-- <el-input v-model="insOrder.testQuantity" clearable disabled placeholder="璇疯緭鍏�" size="small"></el-input>-->
+<!-- </el-form-item>-->
+<!-- <el-form-item v-if="typeSource === 1" label="鍘傚瀵嗗害:">-->
+<!-- <el-input v-model="supplierDensity" clearable disabled placeholder="璇疯緭鍏�" size="small"></el-input>-->
+<!-- </el-form-item>-->
+<!-- <el-form-item label="褰撳墠鏍峰搧浣嶆暟:" label-width="120px">-->
+<!-- <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-input v-model="insOrder.remark" :disabled="state != 1" clearable placeholder="璇疯緭鍏�" size="small"-->
+<!-- @blur="subOtherForm(insOrder.remark, 'remark')"></el-input>-->
+<!-- <!– <el-tag v-if="currentKey">{{ insOrder.remark }}</el-tag> –>-->
+<!-- </el-form-item>-->
+<!-- <template v-if="insOrder.isSplitOrder && insOrder.isSplitOrder===1">-->
+<!-- <el-form-item label="澶栨姢棰滆壊:">-->
+<!-- <el-input v-model="insOrder.outerColor" clearable disabled placeholder="" size="small"></el-input>-->
+<!-- </el-form-item>-->
+<!-- <el-form-item label="缁濈紭棰滆壊:">-->
+<!-- <el-input v-model="insOrder.insulationColor" clearable disabled placeholder="" size="small"></el-input>-->
+<!-- </el-form-item>-->
+<!-- <el-form-item label="鐩樺彿:">-->
+<!-- <el-input v-model="insOrder.drumNo" clearable disabled placeholder="" size="small"></el-input>-->
+<!-- </el-form-item>-->
+<!-- </template>-->
+<!-- </el-form>-->
+ <el-descriptions title="妫�楠屽崟姒傚喌" :column="4" border>
+ <template v-if="insOrder.ifsOrderType">
+ <el-descriptions-item label="闆朵欢鍙�">{{insOrder.partNo}}</el-descriptions-item>
+ <el-descriptions-item label="闆朵欢鍚嶇О">{{insOrder.partDetail}}</el-descriptions-item>
+ <el-descriptions-item label="鎵规鍙�">{{ insOrder.lotBatchNo }}</el-descriptions-item>
+ <el-descriptions-item label="鎶芥鏁伴噺">{{insOrder.testQuantity}}</el-descriptions-item>
+ <el-descriptions-item label="鍘傚瀵嗗害">{{supplierDensity}}</el-descriptions-item>
+ <template v-if="insOrder.ifsOrderType && insOrder.ifsOrderType==='02wg'">
+ <el-descriptions-item label="杞藉叿缂栧彿">{{insOrder.drumNo}}</el-descriptions-item>
+ <el-descriptions-item label="璧峰绫虫爣(km)">{{insOrder.startMeterMark}}</el-descriptions-item>
+ <el-descriptions-item label="鎴绫虫爣(km)">{{insOrder.endMeterMark}}</el-descriptions-item>
+ <el-descriptions-item label="鍏ュ簱闀垮害(km)">{{calcInbondLength(insOrder.startMeterMark,insOrder.endMeterMark)}}</el-descriptions-item>
+ <el-descriptions-item label="缁濈紭棰滆壊">{{insOrder.insulationColor}}</el-descriptions-item>
+ <el-descriptions-item label="澶栨姢棰滆壊">{{insOrder.outerColor}}</el-descriptions-item>
+ <el-descriptions-item label="鍗板瓧淇℃伅">{{insOrder.letteringInfo}}</el-descriptions-item>
+ </template>
+ </template>
+ <template v-else>
+ <el-descriptions-item label="濮旀墭缂栧彿">{{ insOrder.entrustCode }}</el-descriptions-item>
+ <el-descriptions-item label="鏍峰搧缂栧彿">{{ currentSample.sampleCode }}</el-descriptions-item>
+ <el-descriptions-item label="鏍峰搧鍚嶇О">{{ currentSample.sample }}</el-descriptions-item>
+ <el-descriptions-item label="鏍峰搧鏁伴噺">{{ insOrder.testQuantity }}</el-descriptions-item>
+ <el-descriptions-item label="涓嬪彂鏃堕棿">{{ insOrder.sendTime }}</el-descriptions-item>
+ <el-descriptions-item label="绱ф�ョ▼搴�">{{ insOrder.typeName }}</el-descriptions-item>
+ <el-descriptions-item label="绾﹀畾鏃堕棿">{{ insOrder.appointed }}</el-descriptions-item>
+ </template>
+ <el-descriptions-item label="褰撳墠鏍峰搧浣嶆暟"><el-tag v-if="currentKey">{{ `NO.${currentKey}` }}</el-tag></el-descriptions-item>
+ <el-descriptions-item label="澶囨敞">
+ <el-input v-model="insOrder.remark" :disabled="state != 1" clearable placeholder="璇疯緭鍏�" size="small"
+ @blur="subOtherForm(insOrder.remark, 'remark')"></el-input>
+ </el-descriptions-item>
+ <el-descriptions-item v-if="isDirectTemplateOrder()" label="璁惧" :span="2">
+ <el-select v-model="selectedDeviceIds" multiple filterable clearable size="small" placeholder="璇烽�夋嫨璁惧"
+ :disabled="state != 1" @change="saveOverviewDevices">
+ <el-option v-for="device in orderDeviceOptions" :key="device.id" :label="device.label" :value="device.id" />
+ </el-select>
+ </el-descriptions-item>
+ <el-descriptions-item label="妫�楠岀粨璁�">
+ <el-radio-group v-model="reviewInsResult" :disabled="state != 2">
+ <el-radio :label="1">鍚堟牸</el-radio>
+ <el-radio :label="0">涓嶅悎鏍�</el-radio>
+ </el-radio-group>
+ </el-descriptions-item>
+ </el-descriptions>
+ </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 v-for="(item, index) in tableLists" :key="index" :label="item.templateId" size="small">{{
+ item.templateName }}</el-radio-button>
+ </el-radio-group>
+ </div>
+ <div style="display: flex; align-items: center">
+ <el-button v-if="state == 1" size="small" type="primary" @click="openAddUnpass">鏂板涓嶅悎鏍煎娴�</el-button>
+ <el-button v-if="state == 1" size="small" type="primary" @click="unpassCheck">涓嶅悎鏍煎娴�</el-button>
+ <el-button v-if="state > 1" size="small" type="primary" @click="viewUnpassCheck">鏌ョ湅涓嶅悎鏍煎娴�</el-button>
+ <span v-if="cableTagList.length > 0"> 鐢电紗閰嶇疆锛�</span>
+ <el-select v-if="cableTagList.length > 0" v-model="currentTab" clearable placeholder="璇烽�夋嫨" size="small"
+ @change="(m) => handleChangeCableTag(currentSample.id, 0, 'cableTag', m)
+ " @focus="getCableTag(currentSample.id)">
+ <el-option v-for="(item, index) in cableTagList" :key="index" :label="item.cableTag" :value="item.cableTag">
+ <span style="float: left">{{ item.cableTag }}</span>
+ <el-tag v-if="item.status == 0" size="small" style="float: right; margin-top: 5px"
+ type="danger">鏈</el-tag>
+ <el-tag v-if="item.status == 1" size="small" style="float: right; margin-top: 5px"
+ type="warning">妫�楠屼腑</el-tag>
+ <el-tag v-if="item.status == 2" size="small" style="float: right; margin-top: 5px"
+ type="success">宸叉</el-tag>
+ </el-option>
+ </el-select>
+ <span v-if="repetitionTagList.length > 0"> 閲嶅妫�楠岄」锛�</span>
+ <el-select v-if="repetitionTagList.length > 0" v-model="repetitionTag" clearable placeholder="璇烽�夋嫨"
+ size="small" @change="(m) =>
+ handleChangeCableTag(currentSample.id, 0, 'repetitionTag', m)
+ " @focus="getRepetitionTag(currentSample.id)">
+ <el-option v-for="(item, index) in repetitionTagList" :key="index" :label="item.radius"
+ :value="item.repetitionTag">
+ <span style="float: left">{{ item.radius }}</span>
+ <el-tag v-if="item.status == 0" size="small" style="float: right; margin-top: 5px"
+ type="danger">鏈</el-tag>
+ <el-tag v-if="item.status == 1" size="small" style="float: right; margin-top: 5px"
+ type="warning">妫�楠屼腑</el-tag>
+ <el-tag v-if="item.status == 2" size="small" style="float: right; margin-top: 5px"
+ type="success">宸叉</el-tag>
+ </el-option>
+ </el-select>
+ <span v-if="typeSource == '1'"> 寰呮楠屾暟閲忥細</span>
+ <el-select v-if="typeSource == '1'" v-model="rawMaterialTag" placeholder="璇烽�夋嫨" size="small" @change="(m) => handleChangeCableTag(currentSample.id, 4, 'cableTag', m)
+ " @focus="getRawMaterialTag(currentSample.id)">
+ <el-option v-for="(item, index) in rawMaterialTagList" :key="index" :label="item.rawMaterialTag"
+ :value="item.rawMaterialTag">
+ <span style="float: left">{{ item.rawMaterialTag }}</span>
+ <el-tag v-if="item.status == 0" size="small" style="float: right; margin-top: 5px"
+ type="danger">鏈</el-tag>
+ <el-tag v-if="item.status == 1" size="small" style="float: right; margin-top: 5px"
+ type="warning">妫�楠屼腑</el-tag>
+ <el-tag v-if="item.status == 2" size="small" style="float: right; margin-top: 5px"
+ type="success">宸叉</el-tag>
+ </el-option>
+ </el-select>
+ <el-button :loading="dataAcquisitionLoading" v-if="state == 1" size="small" type="primary"
+ @click="getDataAcquisitionDevice">鏁版嵁閲囬泦</el-button>
+ <el-button :type="dataAcquisitionEidtAble ? '' : 'primary'" v-if="state == 1" size="small"
+ @click="dataAcquisitionEidtAble = !dataAcquisitionEidtAble">{{ dataAcquisitionEidtAble ? "鍏抽棴缂栬緫" : "缂栬緫鏁伴噰"
+ }}</el-button>
+ </div>
+ </div>
+ <!-- 甯歌妫�楠屽師濮嬭褰� -->
+ <div id="nav" v-loading="tableLoading" class="center-box">
+ <template v-if="
+ tableLists.find((m) => m.templateId == currentTable)">
+ <table v-for="(item, index) in tableList" :key="index + currentTable + currentSample.id" border="1"
+ cellpadding="10" class="tables" id="myTable">
+ <tbody>
+ <tr style="white-space: nowrap">
+ 濮旀墭缂栧彿锛歿{
+ insOrder.entrustCode
+ }}
+ </tr>
+ <tr v-for="(m, i) in item.arr" :key="i">
+ <td v-for="(n, j) in m" v-if="n.v.mc == undefined || Object.keys(n.v.mc).length === 4"
+ :id="item.templateId + '-' + n.i + '-' + n.r + '-' + n.c" :key="j"
+ :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-h-${n.v.ht} content-v-${n.v.vt}`" :style="`width:${handleWidth(n)}px !important;min-height:${item.style.rowlen[n.r]
+ }px;`" class="content">
+ <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 ||
+ (getInspectionValueType(n.i) != 2 && getInspectionValueType(n.i) != 4)
+ "
+ :key="'abc-' + '000' + index + '000' + i + '000' + j" v-model="n.v.v" :disabled="(getInspectionItemType(n.i) == 1 &&
+ !dataAcquisitionEidtAble) ||
+ (n.u != userId && n.u != undefined && n.u != '')
+ " class="table_input" @change="(m) =>
+ changeInput(
+ m,
+ `${item.templateId}-${n.r}-${n.c}-${n.i}`,
+ n,
+ 'getDataType'
+ )
+ " @input="handleInput(n)" @mousewheel.native.prevent @keydown.enter="
+ changeInput(
+ '',
+ `${item.templateId}-${n.r}-${n.c}-${n.i}`,
+ n,
+ 'getDataType'
+ )
+ ">
+ </el-input>
+ <el-input v-else-if="getInspectionValueType(n.i) == 2" v-model="n.v.v" :disabled="getInspectionItemType(n.i) == 1 ||
+ (n.u != userId && n.u != undefined && n.u != '')
+ " class="table_input" type="textarea" @change="(m) =>
+ changeInput(
+ m,
+ `${item.templateId}-${n.r}-${n.c}-${n.i}`,
+ n,
+ 'getDataType'
+ )
+ " />
+ <span v-else-if="getInspectionValueType(n.i) == 4"
+ :style="`font-family:${n.v.ff} !important;`">/</span>
+ </template>
+ <template v-else-if="
+ n.v.ps != undefined && n.v.ps.value === '璁惧鍚嶇О'
+ ">
+ <el-select v-model="n.v.v" :disabled="state > 1" class="table_input" filterable multiple clearable
+ placeholder="璁惧" remote @change="(val) => changeEquip(val, n)"
+ @visible-change="(e) => getEquipOptions(e, n.i)">
+ <el-option v-for="item in equipOptions" :key="item.value" :label="item.label"
+ :value="item.value">
+ {{ item.label + "--" + item.value }}
+ </el-option>
+ </el-select>
+ </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 :title="currentSample.sampleCode" style="
+ display: flex;
+ flex-wrap: nowrap;
+ align-items: center;
+ width: 100%;
+ ">
+ <i class="el-icon-caret-left table_caret" style="width: 16px" @click="caretSample(-1)"></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" @click="caretSample(1)"></i>
+ </div>
+ </template>
+ <template v-else-if="
+ n.v.ps != undefined && n.v.ps.value === '鏍峰搧鍨嬪彿'
+ ">
+ <div v-if="
+ currentSample.model !== undefined &&
+ currentSample.model !== null
+ " :style="`font-family:${n.v.ff} !important;`">
+ {{ currentSample.model }}
+ </div>
+ </template>
+ <span v-else :style="`font-family:${n.v.ff} !important;`" v-html="getValue(n.v)"></span>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </template>
+ </div>
+ <el-upload v-if="state == 1" ref="upload" :action="action" :before-upload="beforeUpload" :data="{
+ orderId: id,
+ }" :headers="uploadHeader" :on-error="onError" :on-success="handleSuccessUp" :show-file-list="false"
+ accept=".jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar"
+ style="width: 80px !important;margin-top: 10px;">
+ <el-button v-if="state == 1" size="small" type="primary">闄勪欢涓婁紶</el-button></el-upload>
+ <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
+ :height="'calc(100vh - 290px)'" @pagination="pagination" style="height: 100%; margin-top: 16px"></lims-table>
+ </div>
+ <el-drawer :size="550" :visible.sync="sampleVisible" title="鏍峰搧鍒囨崲">
+ <el-table v-if="sampleVisible" ref="productTable" :current-row-key="currentKey" :data="sampleProduct"
+ :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
+ :row-class-name="tableRowClassName" :row-key="(record) => record.index" border class="el-table" height="100%"
+ highlight-current-row tooltip-effect="dark" @row-click="handleChangeSample">
+ <el-table-column :key="Math.random()" align="center" label="搴忓彿" type="index" width="70px">
+ </el-table-column>
+ <el-table-column label="鏍峰搧缂栧彿" min-width="100px" prop="sampleCode" show-overflow-tooltip></el-table-column>
+ <el-table-column label="鏍峰搧鍨嬪彿" min-width="100px" prop="model" show-overflow-tooltip></el-table-column>
+ <el-table-column label="妫�娴嬬姸鎬�" prop="insState" show-overflow-tooltip width="100px">
+ <template slot-scope="scope">
+ <el-tag v-for="(item, i) in typeList" v-if="item.value == scope.row.insState" :key="i" :type="item.type"
+ size="medium" style="margin-right: 5px">{{ item.label }}</el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column align="center" label="鏄惁鐣欐牱" prop="isLeave" show-overflow-tooltip width="95px">
+ <template slot-scope="scope">
+ <span>{{ scope.row.isLeave == 0 ? "鍚�" : "鏄�" }}</span>
+ </template>
+ </el-table-column>
+ <!-- 妫�楠屽崟浼氭湁涓�涓槸鍚︽湁閰嶅鏍峰搧瀛楁鎺у埗鏄剧ず -->
+ <el-table-column v-if="insOrder.mating > 0" label="閰嶅鏍峰搧鍨嬪彿" min-width="130px" prop="joinModel"
+ show-overflow-tooltip></el-table-column>
+ <el-table-column v-if="insOrder.mating > 0" label="閰嶅鏍峰搧鍚嶇О" min-width="130px" prop="joinName"
+ show-overflow-tooltip></el-table-column>
+ <el-table-column v-if="insOrder.mating > 0" label="閰嶅鏍峰搧鏁伴噺" min-width="130px" prop="joinNum"
+ show-overflow-tooltip></el-table-column>
+ </el-table>
+ </el-drawer>
+ <el-drawer :size="500" :visible.sync="taskVisible" title="浠诲姟鍒囨崲">
+ <lims-table :tableData="tableData0" :column="column0" :page="page0" :tableLoading="tableLoading0"
+ :height="'calc(100vh - 90px)'" :currentChange="handleChangeTask"></lims-table>
+ </el-drawer>
+ <el-dialog :visible.sync="reviewDia" title="妫�楠屽鏍�" width="500px">
+ <div v-if="reviewDia" class="body" style="display: flex; padding: 10px">
+ <div class="search_label" style="width: 150px">
+ <span class="required-span">* </span>涓嶉�氳繃鐨勭悊鐢憋細
+ </div>
+ <div class="search_input" style="width: 100%">
+ <el-input v-model="noReason" :autosize="{ minRows: 4 }" clearable size="small" type="textarea"></el-input>
+ </div>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="reviewDia = false">鍙� 娑�</el-button>
+ <el-button :loading="reviewLoading" type="primary" @click="handleReviewDia">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog :visible.sync="addVerifyDia" title="鎸囧畾澶嶆牳浜哄憳" 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" clearable filterable placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+ <el-option v-for="(item, i) in personList" :key="i" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="addVerifyDia = false">鍙� 娑�</el-button>
+ <el-button :loading="submitLoading" type="primary" @click="submit()">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
+ :visible.sync="dataGetDia" title="鏁版嵁閲囬泦" width="80%">
+ <div>
+ <table border="1" cellpadding="10" class="thermal-table">
+ <tr>
+ <td style="width: 120px">妫�楠岄」鍒嗙被</td>
+ <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.sortName }}</td>
+ <td :rowspan="item.child.length">{{ item.faName }}</td>
+ <td>{{ item.child[0].name }}</td>
+ <td style="text-align: left">
+ <el-select v-if="item.child[0].isShowSelect" v-model="item.child[0].getDataIndex1"
+ :multiple-limit="item.child[0].maxNum" clearable filterable multiple placeholder="璇烽�夋嫨"
+ @change="setData(item)">
+ <el-option v-for="(item, index) in item.child[0].arr" :key="index" :filter-method="filterMethod"
+ :label="index + 1 + '^' + item.result" :value="index + '^' + item.result">
+ <span>{{
+ "搴忓彿锛�" +
+ (index + 1) +
+ "锛�" +
+ "缁撴灉锛�" +
+ item.result +
+ "锛�" +
+ "鍘氬害锛�" +
+ item.thickness +
+ "锛�" +
+ "鏃堕棿锛�" +
+ item.mergedDateTime
+ }}</span>
+ </el-option>
+ </el-select>
+ <el-checkbox-group v-if="!item.child[0].isShowSelect" v-model="item.child[0].getDataIndex1"
+ :max="item.child[0].maxNum">
+ <el-checkbox v-for="(n, j) in item.child[0].arr" :key="j" :label="j + '^' + n">{{ n }}</el-checkbox>
+ </el-checkbox-group>
+ </td>
+ </tr>
+ <tr v-for="(m, i) in item.child" v-show="i > 0" :key="i + 'bbbbbbbbbbbbbb'">
+ <td>{{ m.name }}</td>
+ <td style="text-align: left">
+ <el-select v-if="m.isShowSelect" v-model="m.getDataIndex1" :multiple-limit="m.maxNum" clearable
+ filterable multiple placeholder="璇烽�夋嫨">
+ <el-option v-for="(item, index1) in m.arr" :key="index1" :label="index + 1 + '^' + item.result"
+ :value="index1 + '^' + item.result">
+ <span>{{
+ "搴忓彿锛�" +
+ (index1 + 1) +
+ "锛�" +
+ "缁撴灉锛�" +
+ item.result +
+ "锛�" +
+ "鍘氬害锛�" +
+ item.thickness +
+ "锛�" +
+ "鏃堕棿锛�" +
+ item.mergedDateTime
+ }}</span>
+ </el-option>
+ </el-select>
+ <el-checkbox-group v-if="!m.isShowSelect" v-model="m.getDataIndex1" :max="m.maxNum">
+ <el-checkbox v-for="(n, j) in m.arr" :key="j" :label="j + '^' + n">{{ n }}</el-checkbox>
+ </el-checkbox-group>
+ </td>
+ </tr>
+ </template>
+ </table>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="dataGetDia = false">鍙� 娑�</el-button>
+ <el-button :loading="getDataIndexLoading" type="primary" @click="submitDataGet()">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog :close-on-click-modal="false" :visible.sync="addCheck" title="鎸囧畾鎶ュ憡瀹℃牳浜哄憳" width="400px"
+ @close="closeAddVerifyDia">
+ <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="checkUser" clearable filterable placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+ <el-option v-for="(item, i) in personList" :key="i" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="closeAddVerifyDia">鍙� 娑�</el-button>
+ <el-button :loading="reviewLoading" type="primary" @click="upInsReview(1)">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <!-- 娣诲姞涓嶅悎鏍煎娴嬪脊妗�-->
+ <add-un-pass v-if="addUnPassDialog" ref="addUnPassDialog" :addUnPassDialog="addUnPassDialog"
+ @resetAddUnPass="resetAddUnPass"></add-un-pass>
+ <!-- 涓嶅悎鏍煎鐞嗗脊妗�-->
+ <UnPassDialog v-if="unPassDialog" ref="unPassDialog" :orderId="orderId" :unPassDialog="unPassDialog"
+ @resetForm="resetForm"></UnPassDialog>
+ <!-- 涓嶅悎鏍煎娴嬪脊妗�-->
+ <InspectionWord v-if="unPassCheck" :inspectorList="inspectorList" :orderId="orderId"
+ :cableTag="temCableTag" :repetitionTag="repetitionTag"
+ :rawMaterialTag="rawMaterialTag" :sonLaboratory="sonLaboratory" :state="state" :typeSource="typeSource"
+ :unPassCheck="unPassCheck" @closeUnPassCheckDialog="closeUnPassCheckDialog" @refreshView="refreshView" />
+ <!-- 杩涜揣楠岃瘉寮规-->
+ <purchase-verification v-if="purchaseDialog" ref="purchaseDialog" :orderId="orderId"
+ :purchaseDialog="purchaseDialog" @resetPurchaseDialog="resetPurchaseDialog"></purchase-verification>
+ <!--鏌ョ湅宸ユ椂寮规-->
+ <viewManHourDia ref="viewManHourDia" @submit="openAddVerifyDia"></viewManHourDia>
+ <!-- IFS鐗╂枡灞炴�х紪杈戝脊妗�-->
+ <el-dialog
+ title="鏇存柊IFS搴撳瓨鐗╂枡鎵规灞炴��"
+ :visible.sync="ifsMaterialPropsVisible"
+ width="20%">
+ <el-form style="width:100%" :model="ifsMaterialPropsForm">
+ <el-form-item label="杞藉叿缂栧彿(Attr1):">
+ <el-input placeholder="杞藉叿缂栧彿" size="small" v-model="ifsMaterialPropsForm.drumNo"></el-input>
+ </el-form-item>
+ <el-form-item label="璧峰绫虫爣(Attr2):">
+ <el-input @blur="validateQuality()" placeholder="璧峰绫虫爣" size="small" v-model="ifsMaterialPropsForm.startMeterMark">
+ <span slot="suffix">km</span>
+ </el-input>
+ </el-form-item>
+ <el-form-item label="鎴绫虫爣(Attr3):">
+ <el-input @blur="validateQuality()" placeholder="鎴绫虫爣" size="small" v-model="ifsMaterialPropsForm.endMeterMark">
+ <span slot="suffix">km</span>
+ </el-input>
+ </el-form-item>
+ <!-- <el-form-item label="鍏ュ簱闀垮害">-->
+ <!-- <el-input v-model="ifsMaterialPropsForm.inboundLength"></el-input>-->
+ <!-- </el-form-item>-->
+ <el-form-item label="澶栨姢棰滆壊(Attr4):">
+ <el-select size="small" v-model="ifsMaterialPropsForm.outerColor">
+ <el-option v-for="(item,index) in outerColorList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="缁濈紭棰滆壊(Attr5):">
+ <el-select size="small" v-model="ifsMaterialPropsForm.insulationColor">
+ <el-option v-for="(item,index) in insulationColorList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鍗板瓧淇℃伅(Attr8):">
+ <el-select size="small" v-model="ifsMaterialPropsForm.letteringInfo" placeholder="璇烽�夋嫨">
+ <el-option v-for="(item,index) in letteringInfoList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="closePartPropDialog()">鍙� 娑�</el-button>
+ <el-button type="primary" @click="saveOrUpdatePartProp()">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import excelFunction from "@/utils/excelFountion";
+import limsTable from "@/components/Table/lims-table.vue";
+import UnPassDialog from "../unpass/components/unPassDialog.vue";
+import AddUnPass from "../unpass/components/addUnPass.vue";
+import InspectionWord from "./components/InspectionWord.vue";
+import PurchaseVerification from "../unpass/components/PurchaseVerification.vue";
+import {getOneByIfsId,saveOrUpdateProps} from "@/api/business/ifsPartProps.js";
+import {
+ doInsOrder,
+ getCableTag,
+ getRepetitionTag,
+ getRawMaterialTag,
+ dataCollection,
+ write,
+ getInsProduct,
+ search,
+ verifyPlan,
+ checkSubmitPlan,
+ submitPlan,
+ saveInsContext,
+ saveTemplateContext,
+ getOrderDevices,
+ saveOrderDevices,
+ selectUserCondition,
+ downFile,
+ getFileList,
+ delfile,
+ inspectionOrderDetailsTaskSwitching
+} from "@/api/business/inspectionTask.js";
+import InspectionWorker from '@/workers/InspectionWorker.worker.js';
+import DataWorker from '@/workers/DataWorker.worker.js';
+import html2canvas from "html2canvas";
+import { mapGetters } from "vuex";
+import viewManHourDia from "@/views/business/inspectionTask/components/viewManHourDia.vue";
+import {getDicts} from "@/api/system/dict/data";
+export default {
+ name: 'Inspection',
+ components: {
+ viewManHourDia,
+ PurchaseVerification,
+ AddUnPass,
+ limsTable,
+ UnPassDialog,
+ InspectionWord,
+ },
+ data() {
+ return {
+ outerColorList:[],
+ insulationColorList:[],
+ letteringInfoList: [],
+ ifsMaterialPropsForm:{
+ id:null,
+ ifsInventoryId: null,
+ drumNo: '', // 杞藉叿缂栧彿
+ startMeterMark: '', // 璧峰绫虫爣
+ endMeterMark: '', // 鎴绫虫爣
+ insulationColor: '', // 缁濈紭棰滆壊
+ outerColor: '', // 澶栨姢棰滆壊
+ inboundLength: '', // 鍏ュ簱闀垮害
+ letteringInfo: '', // 鍗板瓧淇℃伅
+ },
+ ifsMaterialPropsVisible:false,
+ sonLaboratory: null,
+ orderId: null,
+ state: null,
+ inspectorList: null,
+ typeSource: null,
+ sagData: [],
+ sagForm: {
+ sampleCode: null,
+ model: null,
+ inspection: null,
+ methodName: null,
+ tensileForce: null,
+ spanLength: null,
+ load: null,
+ },
+ dataGetDia: false,
+ fileAdd: false,
+ sampleVisible: false,
+ taskVisible: false,
+ submitLoading: false,
+ searchForm: {
+ sampleName: null,
+ state: null,
+ },
+ id: null,
+ changeType: null,
+ insOrder: {},
+ sampleProduct: [],
+ supplierDensity: "", // 鍘傚瀵嗗害
+ typeList: [],
+ urgentList: [],
+ currentSample: {}, //褰撳墠鏍峰搧淇℃伅
+ tableList: [],
+ loading: false,
+ ps: {},
+ param: {},
+ currentKey: 1,
+ currentKey0: 1,
+ currentKey1: 1,
+ currentKey2: 1,
+ comparisonList: [],
+ excelMethodList: [],
+ equipOptions: [],
+ orderDeviceOptions: [],
+ selectedDeviceIds: [],
+ reviewLoading: false,
+ reviewDia: false,
+ noReason: "",
+ reviewInsResult: null,
+ tableWidth: 1000,
+ currentTable: null,
+ tableLists: [],
+ widthList: [],
+ addVerifyDia: false,
+ verifyUser: null,
+ personList: [],
+ enumList: [],
+ tableLoading: false,
+ upLoading: false,
+ temptList: null,
+ currentTab: null,
+ wareForm: {
+ inspectionItem: 1,
+ inspectionItemSubclass: "20(甯告俯)",
+ },
+ otherForm: {
+ humidity: null,
+ temperature: null,
+ },
+ equipForm: {
+ value0: null,
+ code0: null,
+ value1: null,
+ code1: null,
+ },
+ result: null,
+ worker: null,
+ worker0: null,
+ // 妫�楠屽�兼寜瑙﹀彂椤哄簭涓茶淇濆瓨锛岄伩鍏嶅悓涓�妫�楠岄」鐨勬棫璇锋眰瑕嗙洊鏂拌姹傘��
+ saveQueue: null,
+ calculationRevision: 0,
+ completedCalculationRevision: 0,
+ wareLength: [],
+ dataAcquisitionInfo: {},
+ dataAcquisitionInfoNew: {},
+ dataAcquisitionEidtAble: false,
+ dataAcquisitionLoading: false,
+ collected: 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,
+ getDataTypeId: "",
+ getDataType: null,
+ unPassDialog: false, // 涓嶅悎鏍煎鐞嗗脊妗�
+ cableTagList: [],
+ rawMaterialTag: "", // 鎵规
+ rawMaterialTagList: [], // 鎵规閫夐」
+ addCheck: false, // 鎸囧畾瀹℃牳浜哄憳寮规
+ checkUser: "",
+ addUnPassDialog: false,
+ type: "",
+ retestTag: "",
+ unPassCheck: false,
+ unPassTableList: [],
+ unPassTableLoading: false,
+ purchaseDialog: false, // 杩涜揣楠岃瘉鍘熷璁板綍寮规
+ temCableTag: "",
+ repetitionTagList: [],
+ repetitionTag: "",
+ // 鏂囦欢鍒楄〃鐩稿叧--寮�濮�
+ tableData: [],
+ column: [
+ {
+ label: "绫诲瀷", prop: "type", dataType: "tag",
+ formatData: (params) => {
+ if (params == 1) {
+ return '鍥剧墖'
+ } else {
+ return '鏂囦欢'
+ }
+ }
+ },
+ { label: "闄勪欢鍚嶇О", prop: "fileName" },
+ { label: "涓婁紶浜�", prop: "name" },
+ { label: "涓婁紶鏃堕棿", prop: "createTime" },
+ {
+ dataType: "action",
+ fixed: "right",
+ label: "鎿嶄綔",
+ operation: [
+ {
+ name: "涓嬭浇",
+ type: "text",
+ clickFun: (row) => {
+ this.handleDown(row);
+ },
+ },
+ {
+ name: "鍒犻櫎",
+ type: "text",
+ clickFun: (row) => {
+ this.handleDelete(row);
+ },
+ disabled: (row) => {
+ return this.state != 1;
+ },
+ },
+ ],
+ },
+ ],
+ page: {
+ total: 0,
+ size: 10,
+ current: 0,
+ },
+ // 鏂囦欢鍒楄〃鐩稿叧--缁撴潫
+ // 浠诲姟鍒囨崲鍒楄〃--寮�濮�
+ tableData0: [],
+ column0: [
+ { label: "濮旀墭缂栧彿", prop: "entrustCode", width: '160px' },
+ { label: "妫�楠屽璞�", prop: "sampleType", width: '140px' },
+ {
+ label: "绱ф�ョ▼搴�", prop: "type", dataType: "tag",
+ formatData: (params) => {
+ return this.urgentList.find(m => m.value == params).label
+ },
+ formatType: (params) => {
+ return this.urgentList.find(m => m.value == params).type
+ }
+ },
+ {
+ label: "鐘舵��", prop: "insState", dataType: "tag",
+ formatData: (params) => {
+ return this.typeList.find(m => m.value == params).label
+ },
+ formatType: (params) => {
+ return this.typeList.find(m => m.value == params).type
+ }
+ },
+ { label: "绾﹀畾鏃堕棿", prop: "appointed", width: '140px' },
+ { label: "涓嬪彂鏃堕棿", prop: "sendTime", width: '140px' },
+ ],
+ page0: {
+ total: 0,
+ size: -1,
+ current: -1,
+ },
+ tableLoading0: false,
+ // 浠诲姟鍒囨崲鍒楄〃--缁撴潫
+ };
+ },
+ // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
+ computed: {
+ ...mapGetters(["userId"]),
+ action() {
+ return this.javaApi + "/insOrderPlan/uploadFile";
+ },
+ },
+ created() {
+ this.saveQueue = Promise.resolve();
+ let { sonLaboratory, orderId, state, inspectorList, typeSource } =
+ this.$route.query;
+ this.sonLaboratory = sonLaboratory;
+ this.orderId = orderId;
+ this.id = this.orderId;
+ this.state = state;
+ this.inspectorList = inspectorList;
+ this.typeSource = typeSource;
+ },
+ mounted() {
+ this.getTypeDicts(); // 鑾峰彇绱ф�ョ▼搴︿笅鎷夋閫夐」
+ this.getInsStateDicts();
+ this.getComparisonList();
+ this.getAuthorizedPerson();
+ this.startWorker();
+ // this.getList0() // 浠诲姟鍒囨崲
+ this.scrollInit();
+ },
+ activated() {
+ this.getTypeDicts(); // 鑾峰彇绱ф�ョ▼搴︿笅鎷夋閫夐」
+ this.getInsStateDicts();
+ this.getComparisonList();
+ this.getAuthorizedPerson();
+ this.startWorker();
+ // this.getList0() // 浠诲姟鍒囨崲
+ this.scrollInit();
+ },
+ watch: {
+ // 鐩戝惉浠诲姟id锛岃幏鍙栦换鍔′俊鎭�
+ id(val) {
+ this.refreshView()
+ },
+ // 鐩戝惉褰撳墠妯℃澘鍙樺寲
+ async currentTable(val1, val0) {
+ if (val0 != null && val1 != val0) {
+ await this.waitForPendingSaves();
+ 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 = {}; //鍒濆鍖栦紶鍒板悗绔殑鍙傛暟,鎸夆�滄ā鏉縤d + 鍗曞厓鏍煎潗鏍団�濆瓨
+ // 鍘婚噸妯℃澘锛岃繑鍥炴湁鍑犱釜妯℃澘
+ 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();
+ }
+ }
+ });
+ }
+ },
+ // 鐗规畩妫�楠岄」--鐩戝惉璁惧淇℃伅鏀瑰彉
+ equipForm: {
+ deep: true,
+ handler(val) { },
+ },
+ },
+ beforeDestroy() {
+ // 鍦ㄧ粍浠堕攢姣佸墠纭繚鍋滄 Worker锛岄伩鍏嶅唴瀛樻硠婕�
+ this.stopWorker();
+ },
+ methods: {
+ validateQuality(){
+ let inboundLength = Number(this.calcInbondLength(this.ifsMaterialPropsForm.startMeterMark,this.ifsMaterialPropsForm.endMeterMark));
+ let testQuantity = Number(this.insOrder.testQuantity);
+ if(inboundLength!=null && testQuantity!==inboundLength){
+ this.$message.warning(`鍏ュ簱闀垮害(${inboundLength}km)涓庢楠屾暟閲�(${testQuantity}km)涓嶇锛岃纭锛乣);
+ }
+ },
+ calcInbondLength(startMeterMark,endMeterMark){
+ let inboundLength = null;
+ if((startMeterMark!=null && startMeterMark!=='') && (endMeterMark!=null&&endMeterMark!=='')){
+ let minus = this.$Big(endMeterMark).minus(this.$Big(startMeterMark));
+ inboundLength = Math.abs(minus)
+ }
+ return inboundLength;
+ },
+ getLetteringInfoDicts(){
+ getDicts("lettering_info_type").then(res=>{
+ if(res.code==200){
+ this.letteringInfoList = res.data
+ }
+ })
+ },
+ getInsulationColorDicts(){
+ getDicts("insulation_color_type").then(res=>{
+ if(res.code==200){
+ this.insulationColorList = res.data
+ }
+ })
+ },
+ getOuterColorDicts(){
+ getDicts("outer_color_type").then(res=>{
+ if(res.code==200){
+ this.outerColorList = res.data
+ }
+ })
+ },
+ closePartPropDialog(){
+ this.ifsMaterialPropsForm = {
+ id:null,
+ ifsInventoryId: null,
+ drumNo: '', // 杞藉叿缂栧彿
+ startMeterMark: '', // 璧峰绫虫爣
+ endMeterMark: '', // 鎴绫虫爣
+ insulationColor: '', // 缁濈紭棰滆壊
+ outerColor: '', // 澶栨姢棰滆壊
+ inboundLength: '', // 鍏ュ簱闀垮害
+ letteringInfo: '', // 鍗板瓧淇℃伅
+ }
+ this.ifsMaterialPropsVisible = false;
+ },
+ getPartProps(ifsId){
+ getOneByIfsId(ifsId).then((res)=>{
+ if(res.code==200 && res.data){
+ this.ifsMaterialPropsForm = res.data;
+ }
+ })
+ },
+ saveOrUpdatePartProp(){
+ this.ifsMaterialPropsForm.ifsInventoryId = this.insOrder.ifsInventoryId
+ saveOrUpdateProps({
+ ...this.ifsMaterialPropsForm,
+ partNo: this.insOrder.partNo,
+ lotBatchNo: this.insOrder.lotBatchNo,
+ }).then((res)=>{
+ if(res.code==200){
+ this.$message.success("淇濆瓨鎴愬姛");
+ this.ifsMaterialPropsVisible = false;
+ this.refreshView()
+ }
+ })
+ },
+ //鎵撳紑IFS鐗╂枡灞炴�у脊妗�
+ showMaterialPropsDialog(){
+ this.getPartProps(this.insOrder.ifsInventoryId)
+ this.getOuterColorDicts()
+ this.getInsulationColorDicts()
+ this.getLetteringInfoDicts()
+ this.$nextTick(()=>{
+ this.ifsMaterialPropsVisible = true;
+ })
+ },
+ // 鏂囦欢绠$悊--寮�濮�
+ getList() {
+ this.tableLoading = true;
+ let param = { ...this.page };
+ delete param.total;
+ getFileList({ insOrderId: this.id, ...param })
+ .then((res) => {
+ this.tableLoading = false;
+ if (res.code === 200) {
+ this.tableData = res.data.records;
+ this.page.total = res.data.total;
+ }
+ })
+ .catch((err) => {
+ this.tableLoading = false;
+ });
+ },
+ pagination({ page, limit }) {
+ this.page.current = page;
+ this.page.size = limit;
+ this.getList();
+ },
+ handleDelete(row) {
+ this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }).then(() => {
+ delfile({ id: row.id }).then((res) => {
+ this.$message.success("鍒犻櫎鎴愬姛");
+ this.getList();
+ });
+ }).catch(() => { });
+ },
+ // 鏂囦欢绠$悊--缁撴潫
+
+ // 浠诲姟鍒囨崲--寮�濮�
+ getList0() {
+ this.tableLoading0 = true;
+ let param = { userId: this.userId, sonLaboratory: this.sonLaboratory, ...this.page0 };
+ delete param.total;
+ inspectionOrderDetailsTaskSwitching({ ...param })
+ .then((res) => {
+ this.tableLoading0 = false;
+ if (res.code === 200) {
+ this.tableData0 = res.data.records;
+ }
+ })
+ .catch((err) => {
+ this.tableLoading0 = false;
+ });
+ },
+ // 浠诲姟鍒囨崲--缁撴潫
+
+ closeAddVerifyDia() {
+ this.addCheck = false;
+ this.checkUser = "";
+ },
+ // 鍒锋柊椤甸潰
+ async refreshView() {
+ await this.waitForPendingSaves();
+ this.loading = true;
+ doInsOrder({
+ id: this.id,
+ laboratory: this.sonLaboratory,
+ }).then(async (res) => {
+ this.insOrder = res.data.insOrder;
+ this.reviewInsResult = this.insOrder.insResult;
+ if(res.data.insOrder.ifsOrderType==='02wg'){
+ //鏌ヨ闆朵欢灞炴��
+ this.getPartProps(res.data.insOrder.ifsInventoryId)
+ }
+ this.supplierDensity = res.data.supplierDensity;
+ this.getList()
+ this.urgentList.forEach((m) => {
+ if (m.value == this.insOrder.type) {
+ this.insOrder.typeName = m.label;
+ }
+ });
+ this.loading = false;
+ if (!res.data.sampleProduct || res.data.sampleProduct.length == 0) {
+ this.goback();
+ return this.$message.error("璇ヤ换鍔℃病鏈夋牱鍝佷俊鎭�");
+ }
+ // 璧嬪�煎綋鍓嶆牱鍝佸垪琛�
+ this.sampleProduct = res.data.sampleProduct;
+ this.currentSample = this.HaveJson(this.sampleProduct[0]);
+ let insProduct = this.HaveJson(this.currentSample.insProduct);
+ // 娓╁害銆佹箍搴﹁祴鍊�
+ this.otherForm = {
+ temperature: this.insOrder.temperature
+ ? this.insOrder.temperature
+ : null,
+ humidity: this.insOrder.humidity ? this.insOrder.humidity : null,
+ };
+ if (this.typeSource == "1") {
+ this.getRawMaterialTag(this.currentSample.id); // 鍘熸潗鏂欑殑妫�楠屼换鍔℃煡璇㈡壒鏁�
+ this.rawMaterialTag = "1";
+ }
+ this.getEquipOptions(1);
+ if (this.sonLaboratory === "鏂拌仛") {
+ this.loadOverviewDevices();
+ }
+ // 鑾峰彇褰撳墠鏍峰搧鐨勬楠岄」
+ let list = await this.getCurrentProduct(this.currentSample.id, 0);
+ this.currentSample.insProduct = this.HaveJson(list);
+ // 鍒濆鍖栦紶閫掑埌鍚庣鐨勫弬鏁�
+ this.param = {};
+ this.changeType = 0;
+ if (this.currentSample.index == undefined)
+ this.currentSample["index"] = 1;
+ let bushing = this.currentSample.bushing;
+ this.getTableLists(); //澶勭悊妯℃澘鍒楄〃淇℃伅
+
+ this.currentKey = 1;
+ this.getCableTag(this.currentSample.id); // 鏌ヨ鏄惁鏈夎澶氭妫�楠岀殑鐢电紗閰嶇疆
+ this.getRepetitionTag(this.currentSample.id); // 鏌ヨ鏄惁鏈夎閲嶅妫�楠岄」
+ });
+ },
+ closeUnPassCheckDialog() {
+ this.unPassCheck = false;
+ },
+ // 鏌ヨ鏄惁鏈夎澶氭妫�楠岀殑鐢电紗閰嶇疆
+ getCableTag() {
+ getCableTag({
+ id: this.currentSample.id,
+ laboratory: this.sonLaboratory,
+ }).then((res) => {
+ if (res.code === 200 && res.data.length > 0) {
+ this.cableTagList = res.data;
+ }
+ });
+ },
+ // 鏌ヨ鏄惁鏈夎閲嶅妫�楠岄」
+ getRepetitionTag() {
+ getRepetitionTag({
+ id: this.currentSample.id,
+ laboratory: this.sonLaboratory,
+ cableTag: this.temCableTag,
+ }).then((res) => {
+ if (res.code === 200) {
+ this.repetitionTagList = res.data;
+ }
+ });
+ },
+ getRawMaterialTag() {
+ getRawMaterialTag({
+ id: this.currentSample.id,
+ laboratory: this.sonLaboratory,
+ }).then((res) => {
+ if (res.code === 200) {
+ res.data.forEach((item) => {
+ this.rawMaterialTagList = res.data;
+ });
+ }
+ });
+ },
+ // 娣诲姞闇�瑕佸娴嬬殑涓嶅悎鏍兼楠岄」
+ openAddUnpass() {
+ this.addUnPassDialog = true;
+ const info = {
+ id: this.currentSample.id,
+ type: this.type,
+ laboratory: this.sonLaboratory,
+ cableTag: this.temCableTag,
+ rawMaterialTag: this.rawMaterialTag,
+ repetitionTag: this.repetitionTag,
+ };
+ this.$nextTick(() => {
+ this.$refs.addUnPassDialog.getInsOrder(info);
+ });
+ },
+ resetAddUnPass() {
+ this.addUnPassDialog = false;
+ },
+ // 杩涜涓嶅悎鏍煎娴�
+ unpassCheck() {
+ this.unPassCheck = true;
+ this.retestTag = "1";
+ },
+ viewUnpassCheck() {
+ this.unPassCheck = true;
+ this.retestTag = "1";
+ },
+ // 鎵撳紑涓嶅悎鏍煎鐞嗗脊妗�
+ openUnPassDialog(type) {
+ this.unPassDialog = true;
+ this.$nextTick(() => {
+ this.$refs.unPassDialog.getInsOrder(type);
+ });
+ },
+ // 鍏抽棴涓嶅悎鏍煎鐞嗗脊妗�
+ resetForm() {
+ this.$refs.unPassDialog.$refs["unPassForm"].resetFields();
+ this.unPassDialog = false;
+ },
+ // 鎵撳紑杩涜揣楠岃瘉寮规
+ openPurchase() {
+ const operationType = this.state == 1 ? "add" : "view";
+ this.purchaseDialog = true;
+ const item = {
+ id: this.currentSample.id,
+ sonLaboratory: this.sonLaboratory,
+ cableTag: this.temCableTag,
+ rawMaterialTag: this.rawMaterialTag,
+ typeSource: this.typeSource,
+ };
+ this.$nextTick(() => {
+ this.$refs.purchaseDialog.getInsOrder(operationType, item);
+ });
+ },
+ resetPurchaseDialog() {
+ this.$refs.purchaseDialog.$refs["purchaseForm"].resetFields();
+ this.purchaseDialog = false;
+ },
+ // 鏁版嵁閲囬泦
+ getDataAcquisitionDevice() {
+ let itemIds = [];
+ this.currentSample.insProduct.forEach((item) => {
+ if (item.inspectionItemType === "1") {
+ itemIds.push(item.id);
+ }
+ });
+ const params = {
+ entrustCode: this.insOrder.entrustCode,
+ sampleCode: this.currentSample.sampleCode,
+ id: this.currentSample.id,
+ itemIds: itemIds,
+ };
+ this.dataAcquisitionLoading = true;
+ dataCollection(params).then((res) => {
+ this.dataAcquisitionLoading = false;
+ if (res.code != 200) {
+ return;
+ }
+ this.dataAcquisitionInfoNew = this.HaveJson(res.data);
+ // 瀵规暟閲囧洖鏉ョ殑鍊艰繘琛屽鐞�
+ this.handleDataAcquisition(res.data);
+ }).catch(err => {
+ this.dataAcquisitionLoading = false;
+ });
+ },
+ objectOrder(obj) {
+ let newkey = Object.keys(obj).sort();
+ let newObj = {};
+ for (let i = 0; i < newkey.length; i++) {
+ newObj[newkey[i]] = obj[newkey[i]];
+ }
+ return newObj;
+ },
+ handleDataAcquisition(data, noDialog) {
+ // 鏄惁鍙互缂栬緫鏁伴噰鏁版嵁
+ if (this.dataAcquisitionEidtAble) {
+ this.getDataType = 1;
+ } else {
+ this.getDataType = 2;
+ }
+ this.dataAcquisitionInfo = {};
+ this.getData = [];
+ for (let i in this.objectOrder(data)) {
+ let obj = {};
+ if (i.includes("@")) {
+ obj = {
+ faName: i.split("@")[0],
+ sortName: i.split("@")[1],
+ child: [],
+ };
+ } else {
+ obj = {
+ faName: i,
+ child: [],
+ };
+ }
+ // 寰幆鏁伴噰鏁版嵁
+ for (let j in data[i]) {
+ // 鎷兼帴瀛楃涓� 妫�楠岄」鍒嗙被+妫�楠岄」+妫�楠屽瓙椤�
+ let str0 = "";
+ if (i.includes("@")) {
+ if (i.split("@")[0] == j) {
+ str0 = i.split("@")[0] + ",";
+ } else {
+ str0 = i.split("@")[1] + "," + i.split("@")[0] + "," + j;
+ }
+ } else {
+ 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 == "妫�楠岄」" ||
+ m.v.ps.value == "妫�楠岄」鍒嗙被")
+ ) {
+ if (m.v.ps && m.v.ps.value == "妫�楠岄」鍒嗙被") {
+ if (num0 == 0) {
+ num0++;
+ str = m.v.v + ",";
+ }
+ }
+ if (m.v.ps && m.v.ps.value == "妫�楠岄」") {
+ if (num0 == 1) {
+ str = str + m.v.v + ",";
+ num0++;
+ } else {
+ str = m.v.v + ",";
+ num0++;
+ }
+ }
+ if (m.v.ps && m.v.ps.value == "妫�楠屽瓙椤�") {
+ 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.includes("@")) {
+ if (i.split("@")[0] == j) {
+ str0 = i.split("@")[0] + ",";
+ } else {
+ str0 = i.split("@")[1] + "," + i.split("@")[0] + "," + j;
+ }
+ } else {
+ 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 == "妫�楠岄」" ||
+ m.v.ps.value == "妫�楠岄」鍒嗙被")
+ ) {
+ if (m.v.ps && m.v.ps.value == "妫�楠岄」鍒嗙被") {
+ if (num0 == 0) {
+ num0++;
+ str = m.v.v + ",";
+ }
+ }
+ if (m.v.ps && m.v.ps.value == "妫�楠岄」") {
+ if (num0 == 1) {
+ str = str + m.v.v + ",";
+ num0++;
+ } else {
+ str = m.v.v + ",";
+ num0++;
+ }
+ }
+ if (m.v.ps && m.v.ps.value == "妫�楠屽瓙椤�") {
+ 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) {
+ // this.changeEquip(data[i][j].equipValue,m,data[i][j].equipName)
+ }
+ }
+ });
+ });
+ // 鑾峰彇鍒版渶澶ф楠屽�艰緭鍏ヤ釜鏁板悗閲嶇粍鏁版嵁
+ let obj0 = {
+ name: j,
+ arr: data[i][j].result,
+ maxNum: maxNum,
+ equipValue: data[i][j].equipValue,
+ value: [],
+ };
+ // 濡傛灉鏁伴噰杩斿洖鐨勬暟缁勯暱搴﹀ぇ浜庢渶澶ц緭鍏ヤ釜鏁帮紝鍒欏皢鏁伴噰鏁版嵁鍦ㄥ脊妗嗕腑灞曠ず锛岀敤鎴烽�夋嫨闇�瑕佹墜鍔ㄩ�夋嫨鏁伴噰鐨勪俊鎭�
+ if (
+ (data[i][j].result &&
+ Array.isArray(data[i][j].result) &&
+ data[i][j].result.length > maxNum &&
+ noDialog !== "noDialog") ||
+ (obj0.equipValue === "JCZX-ZB-FF01014" && noDialog !== "noDialog")
+ ) {
+ obj.child.push(obj0);
+ } else {
+ this.dataAcquisitionInfo[str0] = {
+ value: data[i][j].result,
+ };
+ }
+ }
+ }
+ // 寰幆鏁伴噰鏁版嵁
+ if (obj.child.length > 0) {
+ obj.child.forEach((m) => {
+ this.$set(m, "getDataIndex1", []);
+ // 璁惧閫夋嫨涓烘媺鍔涙満锛屽氨鏄剧ず澶氶�変笅鎷夋
+ if (m.equipValue === "JCZX-ZB-FF01014") {
+ this.$set(m, "isShowSelect", true);
+ } else {
+ this.$set(m, "isShowSelect", false);
+ }
+ });
+ this.getData.push(obj);
+ }
+ }
+ // 濡傛灉瀛樺湪鏁伴噰杩斿洖鐨勬暟缁勯暱搴﹀ぇ浜庢渶澶ц緭鍏ヤ釜鏁帮紝鍒欏脊鍑哄脊妗嗛�夋嫨
+ if (this.getData.length > 0) {
+ this.dataGetDia = true;
+ } 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) {
+ // 鑾峰彇鍒版暟閲囨渶鍚庝竴椤癸紝妫�楠岄」鐨処D
+ this.getDataTypeId = result.getDataTypeId;
+ }
+ };
+ this.dataAcquisitionLoading = false;
+ },
+ setData(item) {
+ if (item.child.length > 1) {
+ let arr1 = [];
+ // 澶氫釜妫�楠屽瓙椤圭殑璇濓紝绗竴涓楠屽瓙椤归�夌殑绗嚑涓笅闈㈢殑灏辫祴鍊肩鍑犱釜
+ for (let j = 0; j < item.child.length; j++) {
+ let arr = [];
+ if (j === 0) {
+ for (let k = 0; k < item.child[j].getDataIndex1.length; k++) {
+ let val1 = item.child[j].getDataIndex1[k];
+ const index = val1.indexOf("^");
+ if (index > -1) {
+ val1 = val1.substring(0, index);
+ arr.push(val1);
+ }
+ }
+ arr1 = arr;
+ } else {
+ this.$set(item.child[j], "getDataIndex1", []);
+ arr1.map((a) => {
+ const value1 = a + "^" + item.child[j].arr[Number(a)].result;
+ item.child[j].getDataIndex1.push(value1);
+ });
+ }
+ }
+ }
+ },
+ // 鎷夊姏鏈烘暟閲�
+ filterMethod(val) {
+ console.log("val---", val);
+ },
+ // 濡傛灉瀛樺湪鏁伴噰杩斿洖鐨勬暟缁勯暱搴﹀ぇ浜庢渶澶ц緭鍏ヤ釜鏁帮紝鍒欏脊鍑哄脊妗嗛�夋嫨锛岃繖閲屾槸寮规鐨勬彁浜�
+ submitDataGet() {
+ 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.getData[i].child[j].getDataIndex1.length;
+ k++
+ ) {
+ if (this.getData[i].child[j].getDataIndex1[k].includes("^")) {
+ const index =
+ this.getData[i].child[j].getDataIndex1[k].indexOf("^");
+ if (index > -1) {
+ this.getData[i].child[j].getDataIndex1[k] = this.getData[
+ i
+ ].child[j].getDataIndex1[k].slice(
+ index + 1,
+ this.getData[i].child[j].getDataIndex1[k].length
+ );
+ }
+ }
+ arr.push(this.getData[i].child[j].getDataIndex1[k]);
+ }
+ if (this.getData[i].sortName) {
+ this.dataAcquisitionInfoNew[
+ this.getData[i].faName + "@" + this.getData[i].sortName
+ ][this.getData[i].child[j].name].result = arr;
+ } else {
+ this.dataAcquisitionInfoNew[this.getData[i].faName][
+ this.getData[i].child[j].name
+ ].result = arr;
+ }
+ }
+ }
+ this.getDataIndexLoading = true;
+ // 璧嬪�煎畬鎴愬悗闇�瑕佸啀娆¤繘鍏ュ鐞嗘暟閲囩嚎绋嬮噷鍘诲鐞嗘暟鎹�
+ this.handleDataAcquisition(this.dataAcquisitionInfoNew, "noDialog");
+ },
+ // 澶氱嚎绋�
+ startWorker() {
+ if (this.worker) {
+ this.stopWorker(); // 纭繚涔嬪墠鐨� Worker 宸插仠姝�
+ }
+ // 鍒涘缓 Worker 瀹炰緥
+ this.worker = new InspectionWorker();
+ if (this.worker0) {
+ this.stopWorker(); // 纭繚涔嬪墠鐨� Worker 宸插仠姝�
+ }
+ // 鍒涘缓 Worker 瀹炰緥
+ this.worker0 = new DataWorker();
+ },
+ // 鍋滄澶氱嚎绋�
+ stopWorker() {
+ if (this.worker) {
+ this.worker.terminate();
+ this.worker = null;
+ }
+ if (this.worker0) {
+ this.worker0.terminate();
+ this.worker0 = null;
+ }
+ },
+ // 淇濆瓨婀垮害銆佹俯搴︽暟鎹�
+ subOtherForm(m, type) {
+ write({
+ [type]: type === "remark" ? m : Number(m),
+ id: this.insOrder.id,
+ }).then((res) => {
+ this.$message.success("淇濆瓨鎴愬姛");
+ });
+ },
+ exportTable(tableId) {
+ // 鑾峰彇table鍏冪礌
+ var table = document.getElementById(tableId);
+
+ // 浣跨敤html2canvas搴撶敓鎴恈anvas
+ html2canvas(table).then(function (canvas) {
+ // 鍒涘缓涓�涓浘鐗囧厓绱�
+ var img = canvas.toDataURL("image/png");
+
+ // 鍒涘缓涓�涓猘鏍囩妯℃嫙鐐瑰嚮杩涜涓嬭浇
+ var a = document.createElement("a");
+ a.href = img;
+ a.download = "table.png";
+ a.click();
+ });
+ },
+ uploadSample() {
+ doInsOrder({
+ id: this.id,
+ laboratory: this.sonLaboratory,
+ }).then(async (res) => {
+ this.sampleProduct = res.data.sampleProduct;
+ });
+ },
+ // 鏍规嵁绫诲瀷銆佷换鍔d銆佸疄楠屽鏉ヨ幏鍙栨牱鍝佺殑妫�楠岄」淇℃伅
+ async getCurrentProduct(id, type, cableTag) {
+ if (cableTag === undefined) {
+ cableTag = "";
+ }
+ this.tableLoading = true;
+ type = this.typeSource == "1" ? 5 : type;
+ this.type = type;
+ let res = await getInsProduct({
+ id: id,
+ type: type,
+ laboratory: this.sonLaboratory,
+ cableTag: (cableTag ? cableTag : this.temCableTag),
+ rawMaterialTag: this.rawMaterialTag,
+ repetitionTag: this.repetitionTag
+ });
+ this.tableLoading = false;
+ if (res.data.length > 0) {
+ return res.data;
+ }
+ },
+ // 鍒囨崲鏍峰搧
+ async handleChangeSample(row, column, event) {
+ await this.waitForPendingSaves();
+ // 鍒濆鍖栨暟鎹�
+ this.param = {};
+ this.sampleVisible = false;
+ // 璧嬪�兼牱鍝�
+ 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.getTableLists();
+ this.currentKey = row.index;
+ this.currentTab = null;
+ // 鍚戝绾跨▼鍘讳繚瀛橀〉闈㈠垪琛ㄦ暟鎹�,鍚庣浼犲弬,褰撳墠妯℃澘淇℃伅
+ this.worker.postMessage(
+ JSON.stringify({
+ modelType: this.sampleProduct[0].model,
+ type: "saveData",
+ tableList: this.tableList,
+ param: this.param,
+ currentTable: this.currentTable,
+ })
+ );
+ },
+ async handleChangeCableTag(m, type, num, m2) {
+ let cableTag = "";
+ let repetitionTag = "";
+ if (num === "cableTag") {
+ cableTag = m2;
+ this.temCableTag = cableTag;
+ this.getRepetitionTag();
+ }
+ if (num === "repetitionTag") {
+ repetitionTag = m2;
+ this.repetitionTag = repetitionTag;
+ }
+ if (!m2) {
+ type = 0;
+ }
+ this.changeType = type;
+ if (m) {
+ let list = await this.getCurrentProduct(m, type, cableTag);
+ if (list && list.length > 0) {
+ this.param = {};
+ this.getTableLists0(list);
+ this.worker.postMessage(
+ JSON.stringify({
+ 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) this.id = row.id;
+ this.taskVisible = false;
+ },
+ // 瀛楀吀鑾峰彇淇℃伅
+ getTypeDicts() {
+ this.getDicts("urgency_level").then((response) => {
+ this.urgentList = this.dictToValue(response.data);
+ });
+ },
+ // 瀛楀吀鑾峰彇淇℃伅
+ getInsStateDicts() {
+ this.getDicts("inspection_task_state").then((response) => {
+ this.typeList = this.dictToValue(response.data);
+ });
+ },
+ // 瀛楀吀鑾峰彇淇℃伅
+ getComparisonList() {
+ this.getDicts("coordinate_transformation").then((response) => {
+ this.comparisonList = this.dictToValue(response.data);
+ });
+ },
+ 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;
+ }
+ });
+ 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.tableList.forEach((a) => {
+ let mcList = a.template.filter(
+ (b) =>
+ b.v.mc != undefined &&
+ b.v.mc.cs != undefined &&
+ b.v.mc.rs != undefined
+ );
+ let count = 0;
+ // 灏� a.template 杞崲涓� Map 浠ュ姞閫熸煡鎵�
+ let templateMap = new Map();
+ a.template.forEach((item) => {
+ templateMap.set(`${item.c}-${item.r}`, item);
+ });
+ mcList.forEach((b) => {
+ let cs = b.v.mc.cs;
+ let rs = b.v.mc.rs;
+ for (let i = 0; i < cs; i++) {
+ for (let i2 = 0; i2 < rs; i2++) {
+ let key = `${b.c + i}-${b.r + i2}`;
+ let item = templateMap.get(key);
+ if (item) {
+ let bb = this.HaveJson(b);
+ item.v.v = bb.v.v;
+ item.v.ps = bb.v.ps;
+ item.v.fc = bb.v.fc;
+ item.v.fs = bb.v.fs;
+ item.v.ht = bb.v.ht;
+ item.mc = count;
+ }
+ }
+ }
+ count++;
+ });
+ });
+ // 鎸夊悗绔笅鍙戠殑鈥滄ā鏉縄D + 妯℃澘琛屽彿鈥濈洿鎺ョ粦瀹氭楠岄」锛屼笉鍋氬悕绉版瘮瀵癸紝涓嶉殣钘忎换浣曡
+ this.tableList.forEach((a) => {
+ const directProducts = this.currentSample.insProduct.filter(
+ (product) => product.templateId === a.templateId &&
+ product.templateRowIndex !== null && product.templateRowIndex !== undefined
+ );
+ directProducts.forEach((product) => {
+ a.template.forEach((cell) => {
+ if (cell.r === product.templateRowIndex) {
+ cell.i = product.id;
+ }
+ });
+ });
+ let set2 = new Set();
+ // 鍚堝苟鐨勬暟鎹鐞�,cs rs 浠h〃鍚堝苟鐨勬暟閲�
+ 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;
+ 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 &&
+ typeof b.v.ps.value === "string" &&
+ (b.v.ps.value.includes("妫�楠屽��") ||
+ b.v.ps.value === "璁$畻鍊�" ||
+ b.v.ps.value === "鏈�缁堝��" ||
+ b.v.ps.value === "璁惧鍚嶇О")
+ ) {
+ this.$set(b.v, "v", "");
+ if (b.v.ps.value.includes("妫�楠屽��")) {
+ b.u = "";
+ }
+ }
+ set.add(b.r);
+ // 濡傛灉妯℃澘鍒楄〃鐨勫嚱鏁板瓨鍦�,閭d箞鍔犲叆鍒癳xcel鍑芥暟鍒楄〃閲岄潰
+ if (b.v.f) {
+ this.excelMethodList.push(b);
+ }
+ });
+ // 浠ヤ笅鏄牱寮忓鐞嗛�昏緫
+ set = [...set]
+ // set = set.sort();
+ 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];
+ }
+ });
+ // 鎸夆�滄ā鏉縤d + 鍗曞厓鏍煎潗鏍�(r-c)鈥濆洖鏄惧凡淇濆瓨鐨勫��
+ this.initParamByCoordinate();
+ // 瀵筫xcel鍑芥暟杩涜澶勭悊
+ this.handleExcelMethod();
+ },
+ // 鎸夆�滄ā鏉縤d + 鍗曞厓鏍煎潗鏍�(r-c)鈥濆洖鏄惧凡淇濆瓨鐨勫��
+ initParamByCoordinate() {
+ this.param = {};
+ this.tableList.forEach((a) => {
+ this.param[a.templateId] = {};
+ const product = this.currentSample.insProduct.find(
+ (m) => m.templateId === a.templateId
+ );
+ let saved =
+ (product && (product.recordValues || product.insProductResult)) || {};
+ if (typeof saved === "string") {
+ try {
+ saved = JSON.parse(saved);
+ } catch (e) {
+ saved = {};
+ }
+ }
+ a.template.forEach((cell) => {
+ const key = `${cell.r}-${cell.c}`;
+ const item = saved[key];
+ if (item === undefined || item === null) {
+ return;
+ }
+ const value = typeof item === "object" ? item.v : item;
+ if (value === undefined || value === null) {
+ return;
+ }
+ cell.v.v = value;
+ if (typeof item === "object" && item.u) {
+ cell.u = item.u;
+ }
+ this.param[a.templateId][key] = {
+ v: value,
+ u: typeof item === "object" ? item.u : cell.u,
+ };
+ });
+ });
+ },
+ // 妫�楠屽�艰緭鍏ュ悗瑙﹀彂鐨勫嚱鏁�
+ changeInput(m, code, n, getDataType) {
+ // 涓烘暟閲囧畾涔変竴涓�昏緫鍙傛暟
+ if (getDataType == "getDataType") {
+ this.getDataType = 2;
+ }
+ if (n) {
+ // 瀹氫箟涓�涓嚱鏁版潵楠岃瘉鍒嗘暟鏄惁鏈夋晥
+ if (typeof n.v.v == "string") {
+ 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 {
+ const revision = ++this.calculationRevision;
+ // 鍚� Worker 鍙戦�佹秷鎭紝寮�濮嬪鐞嗛�昏緫
+ this.worker.postMessage(
+ JSON.stringify({
+ code: code,
+ tableList: this.tableList,
+ excelMethodList: this.excelMethodList,
+ comparisonList: this.comparisonList,
+ currentSample: this.currentSample,
+ PROJECT: this.PROJECT,
+ param: this.param,
+ currentTable: this.currentTable,
+ getDataTypeId: this.getDataTypeId,
+ modelType: this.sampleProduct[0].model,
+ currentInsItem: n,
+ revision: revision,
+ })
+ );
+ // 鍏堜繚瀛樹富绾跨▼涓凡缁忚緭鍏ョ殑鍘熷鍊笺�俉orker 瀹屾垚璁$畻鍚庝細鍐嶆鍏ラ槦淇濆瓨璁$畻缁撴灉銆�
+ // 杩欐牱鍗充娇鐢ㄦ埛杈撳叆鍚庣珛鍗冲埛鏂般�佸垏鎹㈡垨杩斿洖锛屾渶鍚庣紪杈戠殑鍗曞厓鏍间篃涓嶄細涓㈠け銆�
+ if (n) {
+ this.saveInsContext();
+ }
+ } catch (error) {
+ console.log(444, error);
+ }
+
+ // 鐩戝惉 Worker 杩斿洖鐨勭粨鏋�
+ this.worker.onmessage = (event) => {
+ const workerResult = JSON.parse(event.data);
+ if (workerResult.revision != null && workerResult.revision < this.calculationRevision) {
+ return;
+ }
+ this.result = workerResult;
+ switch (workerResult.method) {
+ case "saveInsContext":
+ this.$nextTick(() => {
+ const resultValue = workerResult.value;
+ this.$set(
+ this.tableList[0],
+ "arr",
+ resultValue.tableList[0].arr
+ );
+ this.param = resultValue.param;
+ this.saveInsContext();
+ this.completedCalculationRevision = Math.max(
+ this.completedCalculationRevision,
+ workerResult.revision || 0
+ );
+ });
+ break;
+ case "tableList":
+ this.$nextTick(() => {
+ // 鏇存柊鏁版嵁
+ this.$delete(this.tableList[0], "arr");
+ this.$set(this.tableList[0], "arr", workerResult.value[0].arr);
+ });
+ break;
+ }
+ };
+ },
+ // 瀵笶XCEL鍑芥暟杩涜澶勭悊
+ handleExcelMethod() {
+ if (this.excelMethodList.length > 0) {
+ this.excelMethodList.map((item) => {
+ // 寰楀埌姣忎釜鍑芥暟鐨勫弬鏁板垪琛�
+ item.valueList = excelFunction.changeParameter(item.v.f);
+ return item;
+ });
+ }
+ },
+ getValue(v) {
+ // 瀵归〉闈㈠睍绀烘暟鎹繘琛屽鐞�,@,浠h〃鎹㈣
+ 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;
+ }
+ }
+ },
+ // 鍔ㄦ�佽幏鍙栧崟鍏冩牸瀹藉害
+ 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;
+ }
+ }
+ },
+ // 鑾峰彇鎵�鏈夎澶�
+ getEquipOptions(e, id) {
+ if (e) {
+ this.equipOptions = [];
+ search({ status: 0 }).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);
+ });
+ }
+ },
+ openAddCheck() {
+ this.addCheck = true;
+ },
+ // 澶嶆牳
+ upInsReview(e) {
+ if (e == 1) {
+ // 閫氳繃
+ if (this.reviewInsResult !== 0 && this.reviewInsResult !== 1) {
+ this.$message.error("璇烽�夋嫨妫�楠岀粨璁�");
+ return;
+ }
+ this.reviewLoading = true;
+ verifyPlan({
+ orderId: this.orderId,
+ type: 1,
+ laboratory: this.sonLaboratory,
+ tell: null,
+ userId: this.checkUser,
+ insResult: this.reviewInsResult,
+ }).then((res) => {
+ if (res.code === 200) {
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.goback();
+ this.addCheck = false;
+ }
+ 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.goback();
+ }
+ this.reviewLoading = false;
+ })
+ .catch((error) => {
+ console.error(error);
+ this.reviewLoading = false;
+ });
+ } else {
+ this.$message.error("鏈緭鍏ヤ笉閫氳繃鍘熷洜");
+ }
+ },
+ // 鏌ョ湅宸ユ椂
+ viewManHour() {
+ this.$refs.viewManHourDia.showDialog(this.id, 99);
+ },
+ openAddVerifyDia() {
+ this.addVerifyDia = true;
+ },
+ confirmSubmit(){
+ submitPlan({
+ orderId: this.orderId,
+ laboratory: this.sonLaboratory,
+ verifyUser: this.verifyUser,
+ entrustCode: this.insOrder.entrustCode,
+ registerInsResults: false,
+ }).then((res) => {
+ if (res.code === 200) {
+ this.$message.success("鎿嶄綔鎴愬姛");
+ this.goback();
+ this.submitLoading = false;
+ this.addVerifyDia = false;
+ }
+ })
+ .catch((error) => {
+ console.error(error);
+ this.submitLoading = false;
+ });
+ },
+ async submit() {
+ if (this.verifyUser === null || this.verifyUser === "") {
+ this.$message.error("璇锋寚瀹氬鏍镐汉鍛�");
+ return;
+ }
+ if (this.isDirectTemplateOrder() && (!this.selectedDeviceIds || this.selectedDeviceIds.length === 0)) {
+ this.$message.error("璇烽�夋嫨璁惧");
+ return;
+ }
+ if (!this.otherForm.humidity && this.insOrder.ifsOrderType!=='02wg') {
+ this.$message.error("璇疯緭鍏ユ箍搴�");
+ return;
+ }
+ if (!this.otherForm.temperature && this.insOrder.ifsOrderType!=='02wg') {
+ this.$message.error("璇疯緭鍏ユ俯搴�");
+ return;
+ }
+ if (!this.insOrder.lotPartId && this.insOrder.ifsOrderType==='02wg') {
+ this.$message.error("璇峰~鍐橧FS搴撳瓨鐗╂枡鎵规灞炴��");
+ return;
+ }
+ await this.waitForPendingSaves();
+ this.submitLoading = true;
+ checkSubmitPlan({
+ orderId: this.orderId,
+ laboratory: this.sonLaboratory,
+ }).then((res) => {
+ if (res.code === 200) {
+ if (!res.data || res.data.errorMsg.length == 0) {
+ this.submitLoading = true;
+ this.confirmSubmit();
+ } else {
+ let newData = [];
+ const h = this.$createElement;
+ for (let i in res.data.errorMsg) {
+ const lastChar = res.data.errorMsg[i].slice(-1);
+ if (lastChar == "-") {
+ res.data.errorMsg[i] = res.data.errorMsg[i].slice(0, -1);
+ }
+ newData.push(
+ h(
+ "p",
+ { style: "font-size: 14px;color: red;" },
+ Number(i) + 1 + "銆�" + res.data.errorMsg[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(() => {
+ this.submitLoading = true;
+ this.confirmSubmit()
+ // submitPlan({
+ // orderId: this.orderId,
+ // laboratory: this.sonLaboratory,
+ // verifyUser: this.verifyUser,
+ // }).then((res) => {
+ // if (res.code === 200) {
+ // this.$message.success("鎿嶄綔鎴愬姛");
+ // this.addVerifyDia = false;
+ // this.goback();
+ // }
+ // this.submitLoading = false;
+ // })
+ // .catch((error) => {
+ // console.error(error);
+ // this.submitLoading = false;
+ // });
+ })
+ .catch(() => { });
+ }
+ }
+ })
+ .catch((error) => {
+ console.error(error);
+ this.submitLoading = false;
+ });
+ return;
+ },
+ // 鎸夆�滄ā鏉縤d + 鍗曞厓鏍煎潗鏍�(r-c)鈥濅粠褰撳墠妯℃澘蹇収鍑哄緟淇濆瓨鍙傛暟
+ buildParam() {
+ const param = {};
+ this.tableList.forEach((a) => {
+ param[a.templateId] = {};
+ // Worker 鍥炰紶鍚� arr 鏄〉闈笂鐨勬渶鏂板璞★紝template 浠嶅彲鑳戒繚鐣欒绠楀墠鐨勬棫鍊笺��
+ const cells = a.arr && a.arr.length
+ ? a.arr.reduce((all, row) => all.concat(row), [])
+ : a.template;
+ const resultHeader = cells.find((cell) =>
+ cell.v && String(cell.v.v || "").trim() === "妫�楠岀粨鏋�"
+ );
+ const exportRows = new Set(cells.filter((cell) =>
+ cell.v && cell.v.ps && cell.v.ps.value === "瀵煎嚭鍊�"
+ ).map((cell) => cell.r));
+ cells.forEach((cell) => {
+ const isEditable =
+ cell.v.ps != undefined &&
+ typeof cell.v.ps.value === "string" &&
+ (cell.v.ps.value.includes("妫�楠屽��") ||
+ cell.v.ps.value === "璁$畻鍊�" ||
+ cell.v.ps.value === "鏈�缁堝��" ||
+ cell.v.ps.value === "璁惧鍚嶇О");
+ const isExportResult = resultHeader && exportRows.has(cell.r) && cell.c === resultHeader.c;
+ if (!isEditable && !isExportResult) {
+ return;
+ }
+ if (
+ isEditable &&
+ cell.v.ps.value.includes("妫�楠屽��") &&
+ (cell.v.v === "" || cell.v.v === null || cell.v.v === undefined)
+ ) {
+ return;
+ }
+ param[a.templateId][`${cell.r}-${cell.c}`] = {
+ v: cell.v.v,
+ u: cell.u,
+ };
+ });
+ });
+ return param;
+ },
+ // 缁熶竴鍦ㄨ繖閲屼繚瀛樻暟鎹�
+ saveInsContext() {
+ try {
+ if (!this.param) {
+ return;
+ }
+ const param = this.buildParam();
+ this.param = param;
+ let isNoTestValue = "";
+ this.tableList.forEach((a) => {
+ a.template.forEach((cell) => {
+ if (
+ cell.v.ps != undefined &&
+ typeof cell.v.ps.value === "string" &&
+ cell.v.ps.value.includes("妫�楠屽��") &&
+ (cell.v.v === "" || cell.v.v === null || cell.v.v === undefined)
+ ) {
+ isNoTestValue = 1;
+ }
+ });
+ });
+ const payload = {
+ param: JSON.stringify(param),
+ currentTable: this.currentTable,
+ sampleId: this.currentSample.id,
+ orderId: this.orderId,
+ sonLaboratory: this.sonLaboratory,
+ isNoTestValue: isNoTestValue
+ };
+ const previousSave = this.saveQueue || Promise.resolve();
+ this.saveQueue = previousSave
+ .catch(() => undefined)
+ .then(() => this.isDirectTemplateOrder()
+ ? saveTemplateContext({
+ orderId: this.orderId,
+ sampleId: this.currentSample.id,
+ templateId: this.currentTable,
+ values: param[this.currentTable] || {},
+ })
+ : saveInsContext(payload))
+ .then(() => {
+ this.$message.success("宸蹭繚瀛�");
+ })
+ .catch((error) => {
+ console.error("妫�楠屾暟鎹繚瀛樺け璐�", error);
+ this.$message.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);
+ }
+ },
+ async waitForPendingSaves() {
+ const targetRevision = this.calculationRevision;
+ if (this.completedCalculationRevision < targetRevision) {
+ await new Promise((resolve) => {
+ const startedAt = Date.now();
+ const waitWorker = () => {
+ if (this.completedCalculationRevision >= targetRevision || Date.now() - startedAt > 5000) {
+ resolve();
+ return;
+ }
+ setTimeout(waitWorker, 20);
+ };
+ waitWorker();
+ });
+ }
+ if (this.saveQueue) {
+ await this.saveQueue;
+ }
+ },
+ // 璁惧鏀瑰彉
+ changeEquip(val, n) {
+ const selectedDevices = Array.isArray(val) ? [...val] : [];
+ const deviceCodes = selectedDevices.join("锛�");
+ this.$set(n.v, "v", selectedDevices);
+ this.tableList.forEach((table) => {
+ (table.arr || []).forEach((row) => {
+ row.forEach((cell) => {
+ if (cell.i == n.i && cell.v.ps) {
+ if (cell.v.ps.value === "璁惧鍚嶇О") {
+ this.$set(cell.v, "v", [...selectedDevices]);
+ } else if (cell.v.ps.value === "璁惧缂栫爜") {
+ this.$set(cell.v, "v", deviceCodes);
+ }
+ }
+ });
+ });
+ });
+ // 閫夋嫨銆佺Щ闄ゃ�佹竻绌哄潎鐢� change 浜嬩欢瑙﹀彂锛岀珛鍗充繚瀛樸��
+ this.saveInsContext();
+ },
+ isDirectTemplateOrder() {
+ return this.sonLaboratory === "鏂拌仛" && this.currentSample &&
+ (this.currentSample.insProduct || []).some((product) => product.templateRowIndex != null);
+ },
+ loadOverviewDevices() {
+ Promise.all([search({ status: 0 }), getOrderDevices({ orderId: this.orderId })]).then(([devices, selected]) => {
+ this.orderDeviceOptions = (devices.data || []).map((device) => ({
+ id: device.id,
+ label: `${device.deviceName}--${device.managementNumber}`,
+ }));
+ this.selectedDeviceIds = selected.data || [];
+ });
+ },
+ saveOverviewDevices() {
+ return saveOrderDevices({ orderId: this.orderId, deviceIds: this.selectedDeviceIds })
+ .then(() => this.$message.success("璁惧宸蹭繚瀛�"));
+ },
+ getAuthorizedPerson() {
+ selectUserCondition({ type: 1 }).then((res) => {
+ let data = [];
+ res.data.forEach((a) => {
+ data.push({
+ label: a.name,
+ value: a.id,
+ });
+ });
+ this.personList = data;
+ });
+ },
+ scrollInit() {
+ // 鑾峰彇瑕佺粦瀹氫簨浠剁殑鍏冪礌
+ const nav = document.getElementById("nav");
+ var flag; // 榧犳爣鎸変笅
+ var downX; // 榧犳爣鐐瑰嚮鐨剎涓嬫爣
+ 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; // 鑾峰彇绉诲姩鐨剎杞�
+ var scrollX = moveX - downX; // 褰撳墠绉诲姩鐨剎杞翠笅鏍囧噺鍘诲垰鐐瑰嚮涓嬪幓鐨剎杞翠笅鏍囧緱鍒伴紶鏍囨粦鍔ㄨ窛绂�
+ 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.getTableLists();
+ // 鏇存柊鍒板绾跨▼
+ this.worker.postMessage(
+ JSON.stringify({
+ modelType: this.sampleProduct[0].model,
+ type: "saveData",
+ tableList: this.tableList,
+ param: this.param,
+ currentTable: this.currentTable,
+ })
+ );
+ },
+ handleSuccessUp(response) {
+ this.upLoading = false;
+ if (response.code == 200) {
+ this.$message.success("涓婁紶鎴愬姛");
+ this.getList();
+ }
+ },
+ 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) => {
+ this.$download.saveAs(res.data.fileUrl, row.fileName)
+ })
+ .catch((error) => { });
+ },
+ /**
+ * 灏嗘暟鍊紇淇濈暀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;
+ }
+ },
+ async goback() {
+ await this.waitForPendingSaves();
+ this.$router.go(-1)
+ }
+ },
+};
+</script>
+<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;
+ padding: 0 16px;
+}
+
+.search {
+ width: 100%;
+ background-color: #fff;
+ border-radius: 3px;
+ margin-bottom: 10px;
+ padding: 10px;
+}
+
+.search .form-inline {
+ padding-top: 20px;
+ padding-left: 0px;
+ text-align: left;
+}
+
+.center {
+ width: 100%;
+ /* 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: auto;
+ /* overflow-x: scroll; */
+ cursor: grab;
+}
+
+.center-box:active {
+ cursor: grabbing;
+}
+
+.tables {
+ table-layout: fixed;
+ margin: 5px 5px 16px;
+ border-collapse: collapse;
+}
+
+.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: flex-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;
+}
+</style>
+<style scoped>
+/* .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>
--
Gitblit v1.9.3