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/components/InspectionWord.vue | 1639 +++++++++++++++++++++------------------------------------
1 files changed, 607 insertions(+), 1,032 deletions(-)
diff --git a/src/views/business/inspectionTask/components/InspectionWord.vue b/src/views/business/inspectionTask/components/InspectionWord.vue
index 4b88e82..189de42 100644
--- a/src/views/business/inspectionTask/components/InspectionWord.vue
+++ b/src/views/business/inspectionTask/components/InspectionWord.vue
@@ -1,34 +1,26 @@
<template>
- <el-dialog :close-on-press-escape="false"
- :visible.sync="isShow"
- custom-class="unPassCheck"
- title="涓嶅悎鏍煎娴�"
- width="90%"
- @close="$emit('closeUnPassCheckDialog')">
+ <el-dialog :close-on-press-escape="false" :visible.sync="isShow" custom-class="unPassCheck" title="涓嶅悎鏍煎娴�" width="90%"
+ @close="$emit('closeUnPassCheckDialog')">
<div v-loading="loading" class="inspection">
-<!-- <el-row class="title">-->
-<!-- <el-col :span="24" style="text-align: right;">-->
-<!-- <el-button size="small" type="primary" @click="addVerifyDia = true" v-if="state==1">鎻愪氦</el-button>-->
-<!-- </el-col>-->
-<!-- </el-row>-->
+ <!-- <el-row class="title">-->
+ <!-- <el-col :span="24" style="text-align: right;">-->
+ <!-- <el-button size="small" type="primary" @click="addVerifyDia = true" v-if="state==1">鎻愪氦</el-button>-->
+ <!-- </el-col>-->
+ <!-- </el-row>-->
<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>
+ <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-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;">
- <span v-if="typeSource == '1'"> 澶嶆祴娆℃暟锛�</span>
- <el-select v-if="typeSource == '1'" v-model="retestTag"
- placeholder="璇烽�夋嫨"
- size="small" @change="m=>handleChangeCableTag(currentSample.id,4, 'cableTag', m)">
- <el-option
- v-for="item in unPassNumList"
- :key="item.retestTag"
- :label="item.retestTag"
+ <span> 澶嶆祴娆℃暟锛�</span>
+ <el-select v-model="retestTag" placeholder="璇烽�夋嫨" size="small"
+ @change="m => handleChangeCableTag(currentSample.id, 4, 'cableTag', m)">
+ <el-option v-for="item in unPassNumList" :key="item.retestTag" :label="item.retestTag"
:value="item.retestTag">
</el-option>
</el-select>
@@ -36,116 +28,101 @@
</div>
<!-- 甯歌妫�楠屽師濮嬭褰� -->
<div id="tableBox" v-loading="tableLoading" class="center-box">
- <table v-for="(item,index) in tableList" :key="index+currentTable+currentSample.id" border="1" cellpadding="10" class="tables">
+ <table v-for="(item, index) in tableList" :key="index + currentTable + currentSample.id" border="1"
+ cellpadding="10" class="tables">
<tbody>
- <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" :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')" />
-<!-- <el-select v-else-if="getInspectionValueType(n.i) == 5" v-model="n.v.v" :disabled="state>1||getInspectionItemType(n.i) == 1 || (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')"-->
-<!-- @visible-change="e=>getDic(e,n.i)">-->
-<!-- <el-option v-for="(e, i) in enumList" :key="i" :label="e.label" :value="e.value"></el-option>-->
-<!-- </el-select>-->
- <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-if="(getInspectionValueType(n.i) == 2 || getInspectionValueType(n.i) == 5) && state==1&&PROJECT=='瑁呭鐢电紗'"
- v-model="n.v.v" class="table_input" @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`, n,'getDataType')">
- <el-option :value="1" label="鍚堟牸"></el-option>
- <el-option :value="0" label="涓嶅悎鏍�"></el-option>
- <el-option :value="3" label="涓嶅垽瀹�"></el-option>
- <el-option :value="2" label="寰呭畾"></el-option>
- </el-select>
- <template v-if="state > 1">
- <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>
+ <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')" />
+ <!-- <el-select v-else-if="getInspectionValueType(n.i) == 5" v-model="n.v.v" :disabled="state>1||getInspectionItemType(n.i) == 1 || (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')"-->
+ <!-- @visible-change="e=>getDic(e,n.i)">-->
+ <!-- <el-option v-for="(e, i) in enumList" :key="i" :label="e.label" :value="e.value"></el-option>-->
+ <!-- </el-select>-->
+ <span v-else-if="getInspectionValueType(n.i) == 4"
+ :style="`font-family:${n.v.ff} !important;`">/</span>
</template>
- <template v-if="getInspectionValueType(n.i) != 2 && state==1">
- <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 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
+ 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>
- <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==='璁惧鍚嶇О'">
- <el-select v-model="n.v.v" :disabled="state>1"
- class="table_input" filterable
- multiple
- 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;`">{{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 :title="currentSample.sampleCode" style="display: flex;flex-wrap: nowrap;align-items: center;width: 100%">
- <i v-if="!currentFiberOpticTape&&!currentFiberOptic" 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 v-if="!currentFiberOpticTape&&!currentFiberOptic" 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&¤tSample.model!==null" :style="`font-family:${n.v.ff} !important;`">{{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;">
- <div :style="`font-family:${n.v.ff} !important;`">{{currentBushing?currentBushing.color:''}}</div>
- </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 v-if="currentFiberOpticTape" class="el-icon-caret-left table_caret" @click="caretTape(-1)
- "></i>
- <div :style="`font-family:${n.v.ff} !important;`">{{currentFiberOpticTape?currentFiberOpticTape.code:''}}</div>
- <i v-if="currentFiberOpticTape"
- class="el-icon-caret-right table_caret"
- @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 v-if="currentFiberOptic" class="el-icon-caret-left table_caret"
- @click="caretOptic(-1)"></i>
- <div :style="`font-family:${n.v.ff} !important;`">{{currentFiberOptic?currentFiberOptic.color:''}}
+ <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 v-if="!currentFiberOpticTape && !currentFiberOptic" 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 v-if="!currentFiberOpticTape && !currentFiberOptic" class="el-icon-caret-right table_caret"
+ style="width: 16px;" @click="caretSample(1)"></i>
</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>
+ </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>
+ <template v-else-if="n.v.ps != undefined && n.v.ps.value === '濂楃'">
+ <div style="display: flex;flex-wrap: nowrap;align-items: center;">
+ <div :style="`font-family:${n.v.ff} !important;`">{{ currentBushing ? currentBushing.color : ''
+ }}
+ </div>
+ </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 v-if="currentFiberOpticTape" class="el-icon-caret-left table_caret" @click="caretTape(-1)
+ "></i>
+ <div :style="`font-family:${n.v.ff} !important;`">
+ {{ currentFiberOpticTape ? currentFiberOpticTape.code : '' }}</div>
+ <i v-if="currentFiberOpticTape" class="el-icon-caret-right table_caret"
+ @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 v-if="currentFiberOptic" class="el-icon-caret-left table_caret" @click="caretOptic(-1)"></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>
@@ -154,30 +131,31 @@
<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>
+ <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-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 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-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" custom-class="custom-dialog" title="鏁版嵁閲囬泦">
+ <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
+ :visible.sync="dataGetDia" custom-class="custom-dialog" title="鏁版嵁閲囬泦">
<div>
<table border="1" cellpadding="10" class="thermal-table">
<tr>
@@ -185,23 +163,21 @@
<td style="width: 120px;">妫�楠屽瓙椤�</td>
<td>鏁伴噰鏁版嵁</td>
</tr>
- <template v-for="(item,index) in getData">
+ <template v-for="(item, index) in getData">
<tr>
- <td :rowspan="item.child.length">{{item.faName}}</td>
+ <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" :key="j" :label="j">{{n}}</el-checkbox>
+ <el-checkbox-group v-model="getDataIndex" :max="item.child[0].maxNum">
+ <el-checkbox v-for="(n, j) in item.child[0].arr" :key="j" :label="j">{{ n }}</el-checkbox>
</el-checkbox-group>
</td>
</tr>
- <tr v-for="(m,i) in item.child" v-show="i>0" :key="i+'bbbbbbbbbbbbbb'">
+ <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-checkbox-group
- v-model="getDataIndex" :max="m.maxNum">
- <el-checkbox v-for="(n,j) in m.arr" :key="j" :label="j">{{n}}</el-checkbox>
+ <el-checkbox-group v-model="getDataIndex" :max="m.maxNum">
+ <el-checkbox v-for="(n, j) in m.arr" :key="j" :label="j">{{ n }}</el-checkbox>
</el-checkbox-group>
</td>
</tr>
@@ -209,52 +185,48 @@
</table>
</div>
<span slot="footer" class="dialog-footer">
- <el-button :loading="getDataIndexLoading" type="primary" @click="submitDataGet()">纭� 瀹�</el-button>
- </span>
+ <el-button :loading="getDataIndexLoading" type="primary" @click="submitDataGet()">纭� 瀹�</el-button>
+ </span>
</el-dialog>
- <UnPassDialog v-if="unPassDialog" ref="unPassDialog"
- :orderId="orderId"
- :unPassDialog="unPassDialog"
- @resetForm="resetForm"></UnPassDialog>
- <el-dialog :close-on-click-modal="false" :visible.sync="addCheck"
- title="鎸囧畾鎶ュ憡瀹℃牳浜哄憳"
- width="400px"
- @close="closeAddVerifyDia">
+ <UnPassDialog v-if="unPassDialog" ref="unPassDialog" :orderId="orderId" :unPassDialog="unPassDialog"
+ @resetForm="resetForm"></UnPassDialog>
+ <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 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-button @click="closeAddVerifyDia">鍙� 娑�</el-button>
+ <el-button :loading="reviewLoading" type="primary" @click="upInsReview(1)">纭� 瀹�</el-button>
+ </span>
</el-dialog>
</div>
</el-dialog>
</template>
<script>
-// import ValueTable from '../../tool/value-table.vue'
-import file from '@/utils/file'
import excelFunction from '@/utils/excelFountion'
import UnPassDialog from "@/views/business/unpass/components/unPassDialog.vue";
import AddUnPass from "@/views/business/unpass/components/addUnPass.vue";
import {
checkSubmitPlan,
- doInsOrder,
+ doInsOrder, downFile,
getInsProductUnqualifiedRetest,
search, selectUserCondition,
submitPlan,
verifyPlan
} from "@/api/business/inspectionTask";
-import {getUserNow, saveUnqualifiedContext} from "@/api/business/rawMaterialOrder";
+import { getUserNow, saveUnqualifiedContext } from "@/api/business/rawMaterialOrder";
+import InspectionWorker from '@/workers/InspectionWorker.worker';
+import DataWorker from '@/workers/DataWorker.worker';
export default {
- props: ['sonLaboratory', 'orderId', 'state','inspectorList','typeSource', 'unPassCheck', 'rawMaterialTag'],
+ props: ['sonLaboratory', 'orderId', 'state', 'inspectorList', 'typeSource', 'unPassCheck', 'rawMaterialTag','cableTag', 'repetitionTag'],
components: {
AddUnPass,
UnPassDialog
@@ -272,9 +244,9 @@
spanLength: null,
load: null
},
- dataGetDia:false,
- wareTableDataLoading:false,
- fileAdd:false,
+ dataGetDia: false,
+ wareTableDataLoading: false,
+ fileAdd: false,
submitLoading: false,
searchForm: {
sampleName: null,
@@ -283,34 +255,34 @@
id: 0,
componentData0: {
entity: {
- insOrderId:''
+ insOrderId: ''
},
isIndex: true,
showSelect: false,
select: false,
sort: false,
- init: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
+ disabled: (row, index) => {
+ return this.state != 1
}
}
],
isPage: false,
linkEvent: {},
tagField: {
- type:{
- select:[
+ type: {
+ select: [
{
value: 1,
label: '鍥剧墖'
@@ -327,8 +299,8 @@
requiredAdd: [],
requiredUp: []
},
- changeType:null,
- getReportModelLoading:false,
+ changeType: null,
+ getReportModelLoading: false,
insOrder: {},
sampleProduct: [],
typeList: [],
@@ -356,84 +328,84 @@
verifyUser: null,
personList: [],
enumList: [],
- tableLoading:false,
- upLoading:false,
- temptList:null,
- currentTab:null,
- wareForm:{
- inspectionItem:1,
- inspectionItemSubclass:'20(甯告俯)',
+ tableLoading: false,
+ upLoading: false,
+ temptList: null,
+ currentTab: null,
+ wareForm: {
+ inspectionItem: 1,
+ inspectionItemSubclass: '20(甯告俯)',
},
- wareForm0:{},
- numOptions:[],
- temperatureOptions:[],
- wareTableData:[],
- otherForm:{
- humidity:null,
- temperature:null,
+ wareForm0: {},
+ numOptions: [],
+ temperatureOptions: [],
+ wareTableData: [],
+ otherForm: {
+ humidity: null,
+ temperature: null,
},
- equipForm:{
- value0:null,
- code0:null,
- value1:null,
- code1: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,
+ wareLength: [],
+ dataAcquisitionInfo: {},
+ dataAcquisitionInfoNew: {},
+ dataAcquisitionEidtAble: false,
+ isGet: false,
+ dataAcquisitionLoading: false,
+ collected: false,
// 鐑惊鐜�---寮�濮�
- thermalCyclingInfo:{
- max:0,
- inspectionItem:1,
- arr:[],
- length:1,
- inspectionItemClass:null,
+ thermalCyclingInfo: {
+ max: 0,
+ inspectionItem: 1,
+ arr: [],
+ length: 1,
+ inspectionItemClass: null,
},
- thermalCyclingLoading:false,
- temDataAcquisition:false,
- getData:[
+ thermalCyclingLoading: false,
+ temDataAcquisition: false,
+ getData: [
{
- faName:'娉㈤暱闄勫姞琛板噺',
- child:[
+ faName: '娉㈤暱闄勫姞琛板噺',
+ child: [
{
- name:'1285nm~1330nm',
- arr:[12,13,14,15],
+ name: '1285nm~1330nm',
+ arr: [12, 13, 14, 15],
},
{
- name:'1525nm~1575nm',
- arr:[12,13,14,15],
+ name: '1525nm~1575nm',
+ arr: [12, 13, 14, 15],
},
]
},
{
- faName:'鎴嚦娉㈤暱',
- child:[
+ faName: '鎴嚦娉㈤暱',
+ child: [
{
- name:'鎴嚦娉㈤暱',
- arr:[12,13,14,15],
+ name: '鎴嚦娉㈤暱',
+ arr: [12, 13, 14, 15],
}
]
}
],
- getDataIndex:[],
- getDataIndexLoading:false,
- getDataTypeId:'',
- getDataType:null,
+ getDataIndex: [],
+ getDataIndexLoading: false,
+ getDataTypeId: '',
+ getDataType: null,
unPassDialog: false, // 涓嶅悎鏍煎鐞嗗脊妗�
- retestTag: '', // 澶嶆祴娆℃暟
+ retestTag: '1', // 澶嶆祴娆℃暟
addCheck: false, // 鎸囧畾瀹℃牳浜哄憳寮规
checkUser: '',
type: '',
unPassNumList: [
- {retestTag: '1'},
- {retestTag: '2'},
+ { retestTag: '1' },
+ { retestTag: '2' },
],
}
},
@@ -474,7 +446,7 @@
this.insOrder.typeName = m.label
}
})
- if(!res.data.sampleProduct||res.data.sampleProduct.length==0){
+ if (!res.data.sampleProduct || res.data.sampleProduct.length == 0) {
return this.$message.error('璇ヤ换鍔℃病鏈夋牱鍝佷俊鎭�')
}
// 璧嬪�煎綋鍓嶆牱鍝佸垪琛�
@@ -483,38 +455,25 @@
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,
+ temperature: this.insOrder.temperature ? this.insOrder.temperature : null,
+ humidity: this.insOrder.humidity ? this.insOrder.humidity : null,
}
if (this.typeSource == '1') {
this.retestTag = '1'
}
this.getEquipOptions(1)
// 鑾峰彇褰撳墠鏍峰搧鐨勬楠岄」
- let list = await this.getCurrentProduct(this.currentSample.id,0)
+ let list = await this.getCurrentProduct(this.currentSample.id, 0)
if (list === undefined) {
this.$message.warning('鏆傛棤涓嶅悎鏍煎娴嬫暟鎹�')
this.$emit('closeUnPassCheckDialog')
return
}
this.currentSample.insProduct = this.HaveJson(list)
- // 鍒濆鍖栦紶閫掑埌鍚庣鐨勫弬鏁�
+ // 鍒濆鍖栦紶閫掑埌鍚庣鐨勫弬鏁�,鎸夆�滄ā鏉縤d + 鍗曞厓鏍煎潗鏍�(r-c)鈥濆瓨
this.param = {}
this.changeType = 0;
- this.currentSample.insProduct.forEach(a => {
- // 鏄惁涓烘垚鍝佺數缂嗕笅鐨勬澗濂楃椤圭洰锛屼笉鏄垯鎵ц鍒濆鍖�
- if(this.handleCasing(a.inspectionItem)){
- this.param[a.id] = {
- insValue: [],
- comValue: [],
- resValue: null,
- equipValue: [],
- equipName: [],
- insResult: null
- }
- }
- })
- await this.determineWhetherToCollectData()//鏄惁闇�瑕佹暟閲�
+ // await this.determineWhetherToCollectData()//鏄惁闇�瑕佹暟閲�
if (this.currentSample.index == undefined) this.currentSample['index'] = 1
let bushing = this.currentSample.bushing
this.getTableLists();//澶勭悊妯℃澘鍒楄〃淇℃伅
@@ -525,39 +484,27 @@
// 鐩戝惉褰撳墠妯℃澘鍙樺寲
currentTable(val1, val0) {
if (val0 != null && val1 != val0) {
- if(this.changeType&&this.changeType>0){
+ 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)
+ let list = await this.getCurrentProduct(this.currentSample.id, 0)
this.currentSample.insProduct = this.HaveJson(list)//璧嬪�煎綋鍓嶆牱鍝佺殑妫�楠岄」
- this.param = {}//鍒濆鍖栦紶鍒板悗绔殑鍙傛暟
- this.currentSample.insProduct.forEach((a, j) => {
- if(this.handleCasing(a.inspectionItem)){
- this.param[a.id] = {
- insValue: [],
- comValue: [],
- resValue: null,
- equipValue: [],
- equipName: [],
- insResult: null
- }
- }
- })
+ this.param = {}//鍒濆鍖栦紶鍒板悗绔殑鍙傛暟,鎸夆�滄ā鏉縤d + 鍗曞厓鏍煎潗鏍�(r-c)鈥濆瓨
// 鍘婚噸妯℃澘锛岃繑鍥炴湁鍑犱釜妯℃澘
const mySet1 = new Set();
this.tableLists = this.currentSample.insProduct.filter(m => {
let num0 = mySet1.size;
- if (m.templateId != null&&m.template != null) {
+ if (m.templateId != null && m.template != null) {
try {
mySet1.add(JSON.stringify({
template: m.template,
templateId: m.templateId
}))
} catch (error) {
- console.log(222,error);
+ console.log(222, error);
}
}
let num1 = mySet1.size;
@@ -576,49 +523,9 @@
}
},
// 鐗规畩妫�楠岄」--鐩戝惉璁惧淇℃伅鏀瑰彉
- equipForm:{
- deep:true,
- handler(val){
- 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.equipOptions&&this.equipOptions.length>0){
- // 鍒濆鍖栬澶囦俊鎭�
- this.param[this.currentSample.insProduct[0].id].equipValue = []
- this.param[this.currentSample.insProduct[0].id].equipName = []
- if(this.equipForm.code0){
- // 璧嬪�肩涓�涓澶囩殑淇℃伅
- this.equipForm.value0 = this.equipOptions.find(m=>m.value==this.equipForm.code0).label
- this.param[this.currentSample.insProduct[0].id].equipValue.push({
- i:this.currentSample.insProduct[0].id,
- v:{
- v:this.equipForm.code0
- }
- })
- this.param[this.currentSample.insProduct[0].id].equipName.push({
- i:this.currentSample.insProduct[0].id,
- v:{
- v:this.equipForm.value0
- }
- })
- }
- if(this.equipForm.code1){
- // 璧嬪�肩浜屼釜璁惧鐨勪俊鎭�
- this.equipForm.value1 = this.equipOptions.find(m=>m.value==this.equipForm.code1).label
- this.param[this.currentSample.insProduct[0].id].equipValue.push({
- i:this.currentSample.insProduct[0].id,
- v:{
- v:this.equipForm.code1
- }
- })
- this.param[this.currentSample.insProduct[0].id].equipName.push({
- i:this.currentSample.insProduct[0].id,
- v:{
- v:this.equipForm.value1
- }
- })
- }
- // 淇濆瓨鏁版嵁
- this.saveInsContext()
- }
- }
+ equipForm: {
+ deep: true,
+ handler(val) { },
},
},
beforeDestroy() {
@@ -626,142 +533,142 @@
this.stopWorker();
},
methods: {
- closeAddVerifyDia () {
+ closeAddVerifyDia() {
this.addCheck = false
this.checkUser = ''
},
// 鍏抽棴涓嶅悎鏍煎鐞嗗脊妗�
- resetForm () {
+ resetForm() {
this.$refs.unPassDialog.$refs['unPassForm'].resetFields();
this.unPassDialog = false
},
- handleDataAcquisition(data){
+ handleDataAcquisition(data) {
// 鏄惁鍙互缂栬緫鏁伴噰鏁版嵁
- if(this.dataAcquisitionEidtAble){
+ if (this.dataAcquisitionEidtAble) {
this.getDataType = 1;
- }else{
+ } else {
this.getDataType = 2;
}
this.dataAcquisitionInfo = {}
this.getData = []
- for (let i in data){
+ for (let i in data) {
let obj = {
- faName:i,
- child:[]
+ faName: i,
+ child: []
}
// 寰幆鏁伴噰鏁版嵁
- for(let j in data[i]){
+ for (let j in data[i]) {
// 鎷兼帴瀛楃涓� 妫�楠岄」+妫�楠屽瓙椤�
let str0 = ''
- if(i==j){
- str0 = i+','
- }else{
- str0 = i+','+j
+ 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 (j != 'frequency' && data[i][j] && (!data[i][j].result || typeof data[i][j].result == 'string')) {
// 澶勭悊鏁伴噰淇℃伅鏍煎紡
this.dataAcquisitionInfo[str0] = {
- value:data[i][j].result,
- frequency:data[i].frequency
+ value: data[i][j].result,
+ frequency: data[i].frequency
}
let list = this.tableList[0].arr
// 寰幆椤甸潰鍒楄〃淇℃伅锛屽垽鏂暟閲囨暟鎹搴旈〉闈㈠垪琛ㄤ俊鎭殑妫�楠岄」鏄摢涓紝骞剁粰褰撳墠妫�楠岄」缁戝畾璁惧淇℃伅
- list.forEach((item,index)=>{
+ 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+','
+ 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 (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)
+ 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)){
+ } else if (j != 'frequency' && data[i][j] && Array.isArray(data[i][j].result)) {
// 濡傛灉杩斿洖鐨勬暟閲囨暟鎹槸鏁扮粍锛屽垯澶勭悊鏁扮粍
// 浠ヤ笅閫昏緫涓鸿幏鍙栨瘡涓楠岄」鍙緭鍏ョ殑妫�楠屽�肩殑鏈�澶т釜鏁�
let str0 = ''
- if(i==j){
- str0 = i+','
- }else{
- str0 = i+','+j
+ if (i == j) {
+ str0 = i + ','
+ } else {
+ str0 = i + ',' + j
}
let list = this.tableList[0].arr
let maxNum = 0
- list.forEach((item,index)=>{
+ 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+','
+ 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 (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('妫�楠屽��')){
+ 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){
+ 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)
+ 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,
- value:[]
+ 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){
+ if (data[i][j].result && Array.isArray(data[i][j].result) && data[i][j].result.length > maxNum) {
obj.child.push(obj0)
- }else{
+ } else {
this.dataAcquisitionInfo[str0] = {
- value:data[i][j].result
+ value: data[i][j].result
}
}
}
}
- if(obj.child.length>0){
+ if (obj.child.length > 0) {
this.getData.push(obj)
}
}
// 濡傛灉瀛樺湪鏁伴噰杩斿洖鐨勬暟缁勯暱搴﹀ぇ浜庢渶澶ц緭鍏ヤ釜鏁帮紝鍒欏脊鍑哄脊妗嗛�夋嫨
- if(this.getData.length>0){
+ if (this.getData.length > 0) {
this.dataGetDia = true
this.getDataIndex = []
- }else{
+ } else {
// 濡傛灉閮戒笉瀛樺湪锛屽垯锛岃繘鍏ュ鐞嗘暟閲囩嚎绋嬮噷鍘诲鐞嗘暟鎹�
try {
// 鍚� Worker 鍙戦�佹秷鎭紝寮�濮嬪鐞嗛�昏緫
@@ -770,39 +677,39 @@
this.getDataTypeId = ''
this.worker0.postMessage(JSON.stringify({
dataAcquisitionInfo: this.dataAcquisitionInfo,
- list:this.tableList[0].arr
+ list: this.tableList[0].arr
}));
} catch (error) {
- console.log(1111,error);
+ console.log(1111, error);
}
}
// 鐩戝惉 Worker 杩斿洖鐨勭粨鏋�
this.worker0.onmessage = (event) => {
let result = JSON.parse(event.data);
- if(result.method=='changeInput'){
+ 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){
+ 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
}
};
},
// 濡傛灉瀛樺湪鏁伴噰杩斿洖鐨勬暟缁勯暱搴﹀ぇ浜庢渶澶ц緭鍏ヤ釜鏁帮紝鍒欏脊鍑哄脊妗嗛�夋嫨锛岃繖閲屾槸寮规鐨勬彁浜�
- submitDataGet(){
- if(this.getDataIndex.length==0){
+ 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++){
+ 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]])
+ 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
}
@@ -817,12 +724,12 @@
this.stopWorker(); // 纭繚涔嬪墠鐨� Worker 宸插仠姝�
}
// 鍒涘缓 Worker 瀹炰緥
- this.worker = new Worker('/static/js/worker.js');
+ this.worker = new InspectionWorker();
if (this.worker0) {
this.stopWorker(); // 纭繚涔嬪墠鐨� Worker 宸插仠姝�
}
// 鍒涘缓 Worker 瀹炰緥
- this.worker0 = new Worker('/static/js/worker0.js');
+ this.worker0 = new DataWorker();
},
// 鍋滄澶氱嚎绋�
stopWorker() {
@@ -836,7 +743,7 @@
}
},
// 鏍规嵁绫诲瀷銆佷换鍔d銆佸疄楠屽鏉ヨ幏鍙栨牱鍝佺殑妫�楠岄」淇℃伅
- async getCurrentProduct(id,type,cableTag){
+ async getCurrentProduct(id, type, cableTag) {
this.tableLoading = true;
type = this.typeSource == '1' ? 5 : type
this.type = type
@@ -846,8 +753,11 @@
laboratory: this.sonLaboratory,
retestTag: this.retestTag,
rawMaterialTag: this.rawMaterialTag,
+ repetitionTag: this.repetitionTag,
+ cableTag: this.cableTag,
}
- let res = getInsProductUnqualifiedRetest(params)
+ let res = await getInsProductUnqualifiedRetest(params)
+ console.log('res---', res)
if (res.code === 200 && res.data.length > 0) {
this.tableLoading = false;
this.scrollInit()
@@ -855,18 +765,18 @@
}
},
// 鏉惧绠$殑鍒ゆ柇\濡傛灉changeType涓嶇瓑浜�3閭d箞椤甸潰涓嶅睍绀烘澗濂楃妫�楠岄」
- handleCasing(inspectionItem){
- if(this.changeType!=3){
- if(inspectionItem.includes('鏉惧绠�')){
+ handleCasing(inspectionItem) {
+ if (this.changeType != 3) {
+ if (inspectionItem.includes('鏉惧绠�')) {
return false
- }else{
+ } else {
return true
}
- }else{
+ } else {
return true
}
},
- async handleChangeCableTag(m,type, num, m2){
+ async handleChangeCableTag(m, type, num, m2) {
let cableTag = ''
if (num === 'cableTag') {
cableTag = m2
@@ -875,29 +785,19 @@
type = 0
}
this.changeType = type
- if(m){
- let list = await this.getCurrentProduct(m,type, cableTag)
- if(list.length>0){
+ if (m) {
+ let list = await this.getCurrentProduct(m, type, cableTag)
+ 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.worker.postMessage(JSON.stringify({
type: 'saveData',
- tableList:this.tableList,
- param:this.param,
- currentTable:this.currentTable,
- bushing:m
+ tableList: this.tableList,
+ param: this.param,
+ currentTable: this.currentTable,
+ bushing: m
}));
- }else{
+ } else {
this.tableLists = []
this.tableList = []
this.$message.error('妫�楠岄」涓虹┖')
@@ -927,14 +827,14 @@
const mySet1 = new Set();
this.tableLists = this.currentSample.insProduct.filter(m => {
let num0 = mySet1.size;
- if (m.templateId != null&&m.template != null) {
+ if (m.templateId != null && m.template != null) {
try {
mySet1.add(JSON.stringify({
template: m.template,
templateId: m.templateId
}))
} catch (error) {
- console.log(222,error);
+ console.log(222, error);
}
}
let num1 = mySet1.size;
@@ -951,18 +851,18 @@
}
},
// 鍏夌氦閰嶇疆鐩稿叧妯℃澘table鍒楄〃
- getTableLists0(list){
+ getTableLists0(list) {
const mySet1 = new Set();
this.tableLists = list.filter(m => {
let num0 = mySet1.size;
- if (m.templateId != null&&m.template != null) {
+ if (m.templateId != null && m.template != null) {
try {
mySet1.add(JSON.stringify({
template: m.template,
templateId: m.templateId
}))
} catch (error) {
- console.log(333,error);
+ console.log(333, error);
}
}
let num1 = mySet1.size;
@@ -981,56 +881,56 @@
},
// 澶勭悊椤甸潰鍒楄〃鏁版嵁
handleTableData() {
- console.log("ttt-------->>>>",this.tableList);
+ console.log("ttt-------->>>>", this.tableList);
this.excelMethodList = []//excel鍑芥暟鍒楄〃
this.widthList = this.tableList[0].style.columnlen;//椤甸潰瀹藉害--鏍规嵁妯℃澘鏉ョ殑
// 娓╁害寰幆妫�楠屽師濮嬭褰�--寮�濮�
- if(this.tableLists.find(m=>m.templateId==this.currentTable)&&this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='娓╁害寰幆妫�楠屽師濮嬭褰�'){
+ if (this.tableLists.find(m => m.templateId == this.currentTable) && this.tableLists.find(m => m.templateId == this.currentTable).templateName == '娓╁害寰幆妫�楠屽師濮嬭褰�') {
// 瀵硅姹傚�艰繘琛屾媶鍒嗗鐞�,杩涜�屽緱鍑洪〉闈㈠唴瀹�
let ask = this.currentSample.insProduct[0].ask
let askList = ask.split(';')
// 鑾峰彇寰幆娆℃暟
this.numOptions = []
- for (let i = 1; i <= askList[askList.length-1]; i++) {
+ for (let i = 1; i <= askList[askList.length - 1]; i++) {
this.numOptions.push({
- value:i,
- label:i
+ value: i,
+ label: i
})
}
let mySet1 = new Set();
- askList.forEach((m,i) => {
- if(i<askList.length-1){
- mySet1.add(m.split(',')[0].replace('鈩�',''))
+ 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
+ value: String(m),
+ label: m
})
})
}
// 娓╁害寰幆妫�楠屽師濮嬭褰�---缁撴潫
// 鐑惊鐜楠屽師濮嬭褰�---寮�濮�
- 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('娓╁崌璇曢獙'))){
+ 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 askList = ask.split(';')
- this.thermalCyclingInfo.max = Number(askList[askList.length-1])
+ this.thermalCyclingInfo.max = Number(askList[askList.length - 1])
let arr = []
- for (let i = 0; i < askList.length-1; i++) {
+ for (let i = 0; i < askList.length - 1; i++) {
arr.push(askList[i].split(',')[0])
}
- arr = arr.map(item=>{
+ arr = arr.map(item => {
let obj = {}
obj.name = item;
- if(obj.insResult==null||obj.insResult==undefined){
+ if (obj.insResult == null || obj.insResult == undefined) {
obj.arr = [
{
- value0:'',
- value1:'',
+ value0: '',
+ value1: '',
}
]
obj.insResult = null;
@@ -1069,129 +969,19 @@
count++
})
})
- // 鏈寰幆涓昏鏄帶鍒跺悎骞�,浠ュ強鎺у埗妫�楠岄」淇℃伅鏄惁灞曠ず鍑烘潵,浠ヤ究鍚庣画妫�楠�
+ // 鎸夊悗绔笅鍙戠殑鈥滄ā鏉縄D + 妯℃澘琛屽彿鈥濈洿鎺ョ粦瀹氭楠岄」锛屼笉鍋氬悕绉版瘮瀵癸紝涓嶉殣钘忎换浣曡
this.tableList.forEach(a => {
- let dels = new Set()//闇�瑕佸垹闄ょ殑琛�
- let ids = []//鎵�鏈夋楠岄」鐨刬d
- 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 str2 = ''
- let unit2 = ''
- let count4 = 0
- let isThree = 0
- a.template.forEach(c => {
- // 鑾峰彇鍒� 妫�楠岄」鍒嗙被+妫�楠岄」+妫�楠屽瓙椤圭殑鎷兼帴,濡傛灉妯℃澘閲岀殑淇℃伅璺熸帴鍙h繑鍥炵殑妫�楠岄」淇℃伅鑳藉鍖归厤鍒欏睍绀哄嚭鏉�
- 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 === '鏈烘鎬ц兘骞叉�佹媺浼稿己搴�(绾靛悜)') {
- if (c.v.ps != undefined && c.v.ps.value === '鍗曚綅') {
- str2 = str + c.v.v
- unit2 = c.v.v
-
- }
- }
- }
- })
- 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
- if(inspectionItemSubclass === '骞叉�佹媺浼稿己搴�(绾靛悜)') {
- // 妫�楠屽瓙椤逛负'骞叉�佹媺浼稿己搴�(绾靛悜)'鏃讹紝妯$増閲屾槸涓や釜璁$畻鍊煎搴旂浉鍚岀殑妫�楠屽�煎苟涓旇绠楁柟寮忎笉鍚岋紝瑕佹牴鎹浉鍚岀殑'鍗曚綅'鍋氱壒娈婄殑娓叉煋
- const unit = this.currentSample.insProduct[i].unit
- if ((this.currentSample.insProduct[i].templateId === a.templateId && inspectionItemClass +inspectionItem+inspectionItemSubclass+unit === str2) || (this.currentSample.insProduct[i].templateId === a.templateId && !unit2.includes('/')&& inspectionItemClass +inspectionItem+inspectionItemSubclass === str)) {
- ids.push({
- r: b.r,
- id: this.currentSample.insProduct[i].id,
- product: this.currentSample.insProduct[i]
- })
- break
- }
- } else {
- // 濡傛灉鐩哥瓑,閭d箞璇存槑鎵惧埌浜�,骞朵笖鎶奿d瀛樿捣鏉�,鍚庣画妫�楠岄」涔熶細鍦ㄩ〉闈腑鏄剧ず鍑烘潵
- if (this.currentSample.insProduct[i].templateId === a.templateId && inspectionItemClass +inspectionItem+inspectionItemSubclass === str) {
- 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)
- }
+ 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;
}
- }
- })
- // 鎿嶄綔鍒犻櫎
- 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 浠h〃鍚堝苟鐨勬暟閲�
a.template.forEach(b => {
@@ -1218,60 +1008,24 @@
let arrs = []
let set = new Set()
let count1 = 0
- let conclusionList = []; //缁撹鍒楄〃
- let finalList = []; //鏈�缁堝�煎垪琛�
- // 缁撹涓庢渶缁堝�煎湪杩欓噷涓�涓�瀵瑰簲,浠ヤ笅涓や釜鍒楄〃闀垮害鑲畾鏄竴鏍风殑,濡傛灉鏈変笉涓�鏍�,閭d箞澶氬崐鏄ā鏉块厤缃緱闂
- 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 => {
+ 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.value==(finalList[i].c)).label}${finalList[i].r+1})`
-
- }
- })
+ // 鍒濆鍖栧彲濉啓/鍙绠楀崟鍏冩牸,鍚庣画鎸夊潗鏍囧洖鏄�
+ 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)
@@ -1281,7 +1035,8 @@
}
})
// 浠ヤ笅鏄牱寮忓鐞嗛�昏緫
- set = Array.sort(set)
+ // set = Array.sort(set)
+ set = [...set]
set.forEach(b => {
let arr = []
a.template.forEach(c => {
@@ -1297,107 +1052,53 @@
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)
- }
- } 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=='娓╁害寰幆妫�楠屽師濮嬭褰�'||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('鐑惊鐜�')||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.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=='娓╁害寰幆妫�楠屽師濮嬭褰�'||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('鐑惊鐜�')||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('娓╁崌璇曢獙'))){
- // 娓╁害寰幆璁惧璧嬪��
- this.$set(this.equipForm,`code`+i,equipValue[i].v)
- 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)
- for (let i = 0; i < equipName.length; i++) {
- equipName[i].v !== '' && equipName[i].v.map(val => {
- const index = this.equipOptions.findIndex(item => item.value === val)
- if (index > -1) {
- // 鏍规嵁璁惧缂栫爜杞崲涓虹浉搴旂殑璁惧鍚嶇О
- val = this.equipOptions[index].deviceName
- }
- })
- }
- 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.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=='娓╁害寰幆妫�楠屽師濮嬭褰�'||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('鐑惊鐜�')||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('娓╁崌璇曢獙'))){
- // 娓╁害寰幆璧嬪��
- this.$set(this.equipForm,`value`+i,equipName[i].v)
- this.param[a.id].equipName[i].v.v = equipName[i].v
- }else{
- // 鏅�氳澶囧悕绉拌祴鍊�
- this.param[a.id].equipName[i].v.v = equipName[i].v
- }
- }
- } catch (e) {
- console.log('璁惧鍚嶇О璧嬪��----', 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) {}
- })
+ // 鎸夆�滄ā鏉縤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) {
+ changeInput(m, code, n, getDataType) {
// 涓烘暟閲囧畾涔変竴涓�昏緫鍙傛暟
- if(getDataType=='getDataType'){
+ if (getDataType == 'getDataType') {
this.getDataType = 2;
}
- let currentInsItemId = null//褰撳墠妫�楠岄」id
if (n) {
- currentInsItemId = JSON.parse(JSON.stringify(n.i))
// 瀹氫箟涓�涓嚱鏁版潵楠岃瘉鍒嗘暟鏄惁鏈夋晥
if (typeof n.v.v == 'string') {
function isValidFraction(fraction) {
@@ -1414,161 +1115,52 @@
// 鍚� 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,
+ 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
}));
+ // 鍏堜繚瀛樹富绾跨▼涓凡缁忚緭鍏ョ殑鍘熷鍊笺�俉orker 瀹屾垚璁$畻鍚庝細鍐嶆鍏ラ槦淇濆瓨璁$畻缁撴灉銆�
+ if (n) {
+ this.saveInsContext()
+ }
} catch (error) {
- console.log(444,error);
+ console.log(444, error);
}
// 鐩戝惉 Worker 杩斿洖鐨勭粨鏋�
this.worker.onmessage = (event) => {
this.result = JSON.parse(event.data);
- switch (this.result.method){
+ switch (this.result.method) {
case 'saveInsContext':
- console.log(`output->`,11111111111111)
- this.$nextTick(()=>{
- // this.$delete(this.tableList[0],'arr')
- this.$set(this.tableList[0],'arr',this.result.value.tableList[0].arr)
- this.param = this.result.value.param
- if(this.result.value.currentInsItem){
- currentInsItemId = this.result.value.currentInsItem.i
- }
- // 鐗规畩澶勭悊涓�涓嬬粨璁�,浼氭湁杩欑鐗规畩鎯呭喌
- 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.$nextTick(() => {
+ const resultValue = this.result.value
+ this.$set(this.tableList[0], 'arr', resultValue.tableList[0].arr)
+ this.param = resultValue.param
+ this.saveInsContext()
})
break;
case 'tableList':
- this.$nextTick(()=>{
+ this.$nextTick(() => {
// 鏇存柊鏁版嵁
- this.$delete(this.tableList[0],'arr')
- this.$set(this.tableList[0],'arr',this.result.value[0].arr)
- // this.param = this.result.value.param
- if(this.result.value.currentInsItem){
- currentInsItemId = this.result.value.currentInsItem.i
- }
+ 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;
}
};
- // 淇濆瓨鏁版嵁
- setTimeout(()=>{
- this.saveInsContext(currentInsItemId)
- },200)
},
// 鏄惁闇�瑕佹暟閲�
- async determineWhetherToCollectData(){
- let res = determineWhetherToCollectData({managementNumber: ''})
- this.isGet = res.data
- },
- // 鏍规嵁鍚庣浼犲弬鏇存柊椤甸潰鏁版嵁 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;
- }
- }
- },
+ // async determineWhetherToCollectData() {
+ // let res = determineWhetherToCollectData({ managementNumber: '' })
+ // this.isGet = res.data
+ // },
// 瀵笶XCEL鍑芥暟杩涜澶勭悊
handleExcelMethod() {
if (this.excelMethodList.length > 0) {
@@ -1579,17 +1171,17 @@
})
}
},
- getValue(v){
+ 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/>'):''))
+ 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){
+ 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('@')){
+ if (v.v && typeof v.v == 'string' && v.v.includes('@')) {
str = v.v.replace(new RegExp('@', 'g'), '<br/>')
}
return str
@@ -1599,14 +1191,6 @@
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
}
}
},
@@ -1624,13 +1208,13 @@
return sum
},
// 瀵硅緭鍏ュ�艰繘琛屾牸寮忔牎楠�
- handleInput (n) {
+ 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("$#$","/");
+ 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);
}
@@ -1643,33 +1227,29 @@
}
}
},
- // 鑾峰彇瑕佹眰鍊�
- 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
- }
- }
+ this.tableList.forEach(table => {
+ (table.arr || []).forEach(row => {
+ row.forEach(cell => {
+ if (cell.i == n.i && cell.r === n.r && cell.v.ps && cell.v.ps.value === '璁惧缂栫爜') {
+ if (cell.v.v == null || cell.v.v == '') {
+ this.$message.error('璇峰厛閫夋嫨閲囬泦鐨勮澶�')
+ return
+ } else {
+ code = cell.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=>{
+ fetch('http://localhost:82/寰俊鍥剧墖_20240518100811.png').then(res => res.blob()).then(blob => {
// console.log(blob);
const url = URL.createObjectURL(blob)
// console.log(url);
@@ -1757,11 +1337,11 @@
this.$message.error("璇锋寚瀹氬鏍镐汉鍛�")
return
}
- if(!this.otherForm.humidity){
+ if (!this.otherForm.humidity) {
this.$message.error("璇疯緭鍏ユ箍搴�")
return
}
- if(!this.otherForm.temperature){
+ if (!this.otherForm.temperature) {
this.$message.error("璇疯緭鍏ユ俯搴�")
return
}
@@ -1771,13 +1351,14 @@
laboratory: this.sonLaboratory,
}).then(res => {
if (res.code === 200) {
- if(!res.data||res.data.length==0){
+ if (!res.data || res.data.errorMsg.length == 0) {
this.submitLoading = true;
submitPlan({
orderId: this.orderId,
laboratory: this.sonLaboratory,
verifyUser: this.verifyUser,
- entrustCode: this.insOrder.entrustCode
+ entrustCode: this.insOrder.entrustCode,
+ registerInsResults: false,
}).then(res => {
if (res.code === 200) {
this.$message.success("鎿嶄綔鎴愬姛")
@@ -1789,19 +1370,19 @@
console.error(error)
this.submitLoading = false;
})
- }else{
+ } else {
let newData = []
const h = this.$createElement
- for (let i in res.data) {
- const lastChar = res.data[i].slice(-1);
- if(lastChar=='-'){
- res.data[i] = res.data[i].slice(0, -1);
+ 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[i]))
+ 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:'鎻愮ず',
+ 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: "鍙栨秷",
@@ -1811,7 +1392,8 @@
submitPlan({
orderId: this.orderId,
laboratory: this.sonLaboratory,
- verifyUser: this.verifyUser
+ verifyUser: this.verifyUser,
+ registerInsResults: false,
}).then(res => {
if (res.code === 200) {
this.$message.success("鎿嶄綔鎴愬姛")
@@ -1823,7 +1405,7 @@
console.error(error)
this.submitLoading = false;
})
- }).catch(() => {})
+ }).catch(() => { })
}
}
}).catch(error => {
@@ -1832,98 +1414,100 @@
})
return
},
- // 缁熶竴鍦ㄨ繖閲屼繚瀛樻暟鎹�
- saveInsContext(currentInsItemId) {
- try {
- if(this.param){
- let param = null
- if(currentInsItemId){
- param = {[currentInsItemId] : this.param[currentInsItemId]}
- }else{
- param = this.param
+ // 鎸夆�滄ā鏉縤d + 鍗曞厓鏍煎潗鏍�(r-c)鈥濅粠褰撳墠妯℃澘蹇収鍑哄緟淇濆瓨鍙傛暟
+ buildParam() {
+ const param = {}
+ this.tableList.forEach(a => {
+ param[a.templateId] = {}
+ a.template.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 === '璁惧鍚嶇О')
+ if (!isEditable) {
+ return
}
- saveUnqualifiedContext({
- param: JSON.stringify(param),
- currentTable:this.currentTable,
- sampleId:this.currentSample.id
- }).then(res => {
- if (res.code == 201) {
- this.$message.error('淇濆瓨澶辫触')
- return
- }
- this.$message.success('宸蹭繚瀛�')
- })
- // 鍚� Worker 鍙戦�佹秷鎭紝寮�濮嬪鐞嗛�昏緫
- this.worker.postMessage(JSON.stringify({
- modelType: this.sampleProduct[0].model,
- type: 'saveData',
- tableList:this.tableList,
- param:this.param,
- currentTable:this.currentTable
- }));
+ if (
+ 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
}
- }catch (error) {
- console.log(999,error);
+ 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
+ }
+ })
+ })
+ saveUnqualifiedContext({
+ param: JSON.stringify(param),
+ currentTable: this.currentTable,
+ sampleId: this.currentSample.id,
+ isNoTestValue: isNoTestValue
+ }).then(res => {
+ this.$message.success('宸蹭繚瀛�')
+ })
+ // 鍚� 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) {
- try {
- // 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
+ 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)
+ }
}
- // 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)
- // }
- // }
- // }
- // this.equipOptions涓鸿澶囧悕绉颁笅鎷夋閫夐」鏁版嵁
- 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.join('锛�'))
- this.$delete(this.param[n.i].equipName[i1].v,'v')
- // 灏嗘暟缁勮祴鍊肩粰璁惧缂栫爜
- this.$set(this.param[n.i].equipName[i1].v,'v',val)
- 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',val.join('锛�'))
- }
- if(m.i==n.i&&m.v.ps&&m.v.ps.value=='璁惧鍚嶇О'){
- this.$set(m.v,'v',val)
- }
- })
- })
- }
- }
- // 淇濆瓨鏁版嵁
- this.saveInsContext(n.i)
- } catch (e) {
- console.log('changeEquip----', e)
- }
+ })
+ // 閫夋嫨銆佺Щ闄ゃ�佹竻绌哄潎鐢� change 浜嬩欢瑙﹀彂锛岀珛鍗充繚瀛樸��
+ this.saveInsContext()
},
getAuthorizedPerson() {
- selectUserCondition({ type: 0 }).then((res) => {
+ selectUserCondition({ type: 1 }).then((res) => {
let data = [];
res.data.forEach((a) => {
data.push({
@@ -1940,12 +1524,12 @@
let flag; // 榧犳爣鎸変笅
let downX; // 榧犳爣鐐瑰嚮鐨剎涓嬫爣
let scrollLeft; // 褰撳墠鍏冪礌婊氬姩鏉$殑鍋忕Щ閲�
- nav.addEventListener("mousedown", function(event) {
+ nav.addEventListener("mousedown", function (event) {
flag = true;
downX = event.clientX; // 鑾峰彇鍒扮偣鍑荤殑x涓嬫爣
scrollLeft = this.scrollLeft; // 鑾峰彇褰撳墠鍏冪礌婊氬姩鏉$殑鍋忕Щ閲�
});
- nav.addEventListener("mousemove", function(event) {
+ nav.addEventListener("mousemove", function (event) {
if (flag) { // 鍒ゆ柇鏄惁鏄紶鏍囨寜涓嬫粴鍔ㄥ厓绱犲尯鍩�
let moveX = event.clientX; // 鑾峰彇绉诲姩鐨剎杞�
let scrollX = moveX - downX; // 褰撳墠绉诲姩鐨剎杞翠笅鏍囧噺鍘诲垰鐐瑰嚮涓嬪幓鐨剎杞翠笅鏍囧緱鍒伴紶鏍囨粦鍔ㄨ窛绂�
@@ -1953,20 +1537,20 @@
}
});
// 榧犳爣鎶捣鍋滄鎷栧姩
- nav.addEventListener("mouseup", function() {
+ nav.addEventListener("mouseup", function () {
flag = false;
});
// 榧犳爣绂诲紑鍏冪礌鍋滄鎷栧姩
- nav.addEventListener("mouseleave", function(event) {
+ nav.addEventListener("mouseleave", function (event) {
flag = false;
});
},
- async caretTape(num){
+ async caretTape(num) {
let index = this.currentKey1 + num
- if(index < 1){
+ if (index < 1) {
this.$message.error('褰撳墠鏄涓�涓厜绾ゅ甫')
return
- } else if(index > this.fiberOpticTape.length){
+ } else if (index > this.fiberOpticTape.length) {
this.$message.error('褰撳墠鏄渶鍚庝竴涓厜绾ゅ甫')
return
}
@@ -1975,46 +1559,27 @@
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)
+ let list = await this.getCurrentProduct(this.currentFiberOpticTape.id, 1)
this.getTableLists0(list)
- if(this.currentFiberOpticTape.fiber&&this.currentFiberOpticTape.fiber.length>0){
+ if (this.currentFiberOpticTape.fiber && this.currentFiberOpticTape.fiber.length > 0) {
// 閰嶇疆鍏夌氦
this.fiberOptic = this.currentFiberOpticTape.fiber;
}
},
- async caretOptic(num){
+ async caretOptic(num) {
let index = this.currentKey2 + num
- if(index < 1){
+ if (index < 1) {
this.$message.error('褰撳墠鏄涓�涓厜绾�')
return
- } else if(index > this.fiberOptic.length){
+ } 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.param = {}
+ let list = await this.getCurrentProduct(this.currentFiberOptic.id, 2)
this.getTableLists0(list)
},
beforeUpload(file) {
@@ -2031,23 +1596,11 @@
this.$message.error('涓婁紶澶辫触')
this.$refs.upload.clearFiles()
},
- handleDown(row){
+ 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();
- }
- }
+ this.$download.saveAs(res.data.fileUrl, row.fileName);
}).catch(error => {
})
@@ -2060,15 +1613,15 @@
* @param ct.fa 鏍煎紡鍖栭厤缃瓧绗︿覆锛岃嫢鍖呭惈'##'鍒欐寜鐓у叾鍚庣殑鍐呭纭畾灏忔暟浣嶆暟
* @returns 鏍煎紡鍖栧悗鐨勫瓧绗︿覆鎴栧師濮嬫暟鍊硷紙鑻ラ厤缃笉绗﹀悎瑕佹眰锛�
*/
- toFixed(v,ct){
- if(v&&ct&&ct.fa){
- if(ct.fa.includes('.')){
+ 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{
+ } else {
return v
}
- }else{
+ } else {
return v
}
}
@@ -2077,17 +1630,21 @@
</script>
<style scoped>
.custom-table .el-table__header-wrapper th {
- background-color: #87CEEB; /* 鍙甯︽湁my-custom-table绫荤殑琛ㄦ牸鐢熸晥 */
+ background-color: #87CEEB;
+ /* 鍙甯︽湁my-custom-table绫荤殑琛ㄦ牸鐢熸晥 */
color: #fff;
}
+
.container {
- overflow: auto; /* 纭繚瀹瑰櫒鑳藉寘瑁规诞鍔ㄥ厓绱� */
+ overflow: auto;
+ /* 纭繚瀹瑰櫒鑳藉寘瑁规诞鍔ㄥ厓绱� */
margin-bottom: 10px;
}
.right-button {
float: right;
}
+
.inspection {
height: 100%;
overflow-y: auto;
@@ -2136,7 +1693,7 @@
cursor: grab;
}
-.center-box:active{
+.center-box:active {
cursor: grabbing;
}
@@ -2153,11 +1710,13 @@
word-wrap: break-word;
white-space: normal;
}
-.thermal-table{
+
+.thermal-table {
min-width: calc(100% - 10px);
margin: 5px 5px 0;
table-layout: fixed;
}
+
.thermal-table td {
min-width: 70px;
text-align: center;
@@ -2166,9 +1725,12 @@
white-space: normal;
padding: 5px;
}
+
.table-container {
- overflow-x: auto; /* 浣垮鍣ㄦ敮鎸佹í鍚戞粴鍔� */
- max-width: 100%; /* 闄愬埗瀹瑰櫒鐨勬渶澶у搴� */
+ overflow-x: auto;
+ /* 浣垮鍣ㄦ敮鎸佹í鍚戞粴鍔� */
+ max-width: 100%;
+ /* 闄愬埗瀹瑰櫒鐨勬渶澶у搴� */
margin-bottom: 16px;
}
@@ -2183,7 +1745,7 @@
user-select: none;
}
-.content *{
+.content * {
user-select: none;
}
@@ -2196,7 +1758,7 @@
}
.content-h-2 {
- justify-content: end;
+ justify-content: flex-end;
}
.content-v-0 {
@@ -2215,7 +1777,8 @@
width: 100%;
height: 100%;
}
-.table_input >>>.el-input__inner{
+
+.table_input>>>.el-input__inner {
border-color: rgba(0, 0, 0, 0.5) !important;
}
@@ -2233,28 +1796,35 @@
.collection:active {
opacity: .7;
}
-.table_caret{
+
+.table_caret {
font-size: 16px;
margin: 0 5px;
color: rgba(0, 0, 0, 0.5);
}
-.table_caret:hover{
+
+.table_caret:hover {
color: #409eff;
cursor: pointer;
}
-.table_caret:active{
+.table_caret:active {
opacity: .8;
}
+
>>>input::-webkit-inner-spin-button {
- -webkit-appearance: none !important; /* 闅愯棌寰皟鎸夐挳 */
- margin: 0 !important; /* 绉婚櫎寰皟鎸夐挳鐨勮竟璺� */
+ -webkit-appearance: none !important;
+ /* 闅愯棌寰皟鎸夐挳 */
+ margin: 0 !important;
+ /* 绉婚櫎寰皟鎸夐挳鐨勮竟璺� */
}
>>>input[type=number] {
- -moz-appearance: textfield !important; /* 閽堝 Firefox */
+ -moz-appearance: textfield !important;
+ /* 閽堝 Firefox */
}
->>>.el-form-item__content{
+
+>>>.el-form-item__content {
display: inline-flex;
align-items: center;
}
@@ -2312,19 +1882,24 @@
min-height: 100% !important;
}
-.inspection .tables .el-input{
+.inspection .tables .el-input {
display: flex;
align-items: center;
}
-.thermal-table .el-input{
+
+.thermal-table .el-input {
display: flex;
align-items: center;
}
+
.custom-dialog .el-dialog__body {
- max-width: 1000px; /* 璁剧疆鏈�澶у搴� */
+ max-width: 1000px;
+ /* 璁剧疆鏈�澶у搴� */
}
+
.unPassCheck .el-dialog__body {
overflow: auto;
- max-height: 800px; /* 璁剧疆鏈�澶у搴� */
+ max-height: 800px;
+ /* 璁剧疆鏈�澶у搴� */
}
</style>
--
Gitblit v1.9.3