¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div v-loading="loading" class="inspection" style="background-color: rgb(245, 247, 251);"> |
| | | <el-row class="title"> |
| | | <el-col :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="16" style="text-align: right"> |
| | | <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 && typeSource == 1" 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> |
| | | </el-form> |
| | | </div> |
| | | <div class="center"> |
| | | <div class="search" style=" |
| | | text-align: left; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | "> |
| | | <div style="display: flex; align-items: center"> |
| | | <span v-if="tableList.length > 0">æ£éªæ¨¡æ¿ï¼</span> |
| | | <el-radio-group v-model="currentTable" size="small"> |
| | | <el-radio-button 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 in cableTagList" :key="item.cableTag" :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 in repetitionTagList" :key="item.repetitionTag" :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 in rawMaterialTagList" :key="item.rawMaterialTag" :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" |
| | | :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 |
| | | " v-model="n.v.v" class="table_input" @change="(m) => |
| | | changeInput( |
| | | m, |
| | | `${item.templateId}-${n.r}-${n.c}-${n.i}`, |
| | | n, |
| | | 'getDataType', |
| | | 'changeSelect' |
| | | ) |
| | | "> |
| | | <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> |
| | | </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> |
| | | </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 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" |
| | | :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> |
| | | </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 "../inspectionTask/components/InspectionWord.vue"; |
| | | import PurchaseVerification from "../unpass/components/PurchaseVerification.vue"; |
| | | import { |
| | | doInsOrder, |
| | | getCableTag, |
| | | getRepetitionTag, |
| | | getRawMaterialTag, |
| | | dataCollection, |
| | | write, |
| | | getInsProduct, |
| | | search, |
| | | verifyPlan, |
| | | checkSubmitPlan, |
| | | submitPlan, |
| | | saveInsContext, |
| | | selectUserCondition, |
| | | downFile, |
| | | getFileList, |
| | | delfile, |
| | | inspectionOrderDetailsTaskSwitching |
| | | } from "@/api/business/inspectionTask.js"; |
| | | import InspectionWorker from '@/workers/InspectionWorker.worker'; |
| | | import DataWorker from '../../../workers/DataWorker.worker'; |
| | | import html2canvas from "html2canvas"; |
| | | import { mapGetters } from "vuex"; |
| | | import viewManHourDia from "@/views/business/inspectionTask/components/viewManHourDia.vue"; |
| | | export default { |
| | | name: 'InspectionView', |
| | | components: { |
| | | viewManHourDia, |
| | | PurchaseVerification, |
| | | AddUnPass, |
| | | limsTable, |
| | | UnPassDialog, |
| | | InspectionWord, |
| | | }, |
| | | data() { |
| | | return { |
| | | 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: [], |
| | | reviewLoading: false, |
| | | reviewDia: false, |
| | | noReason: "", |
| | | 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, |
| | | 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, |
| | | }, |
| | | tableLoading: false, |
| | | // æä»¶å表ç¸å
³--ç»æ |
| | | // ä»»å¡åæ¢å表--å¼å§ |
| | | 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() { |
| | | 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() |
| | | }, |
| | | // çå¬å½å模æ¿åå |
| | | currentTable(val1, val0) { |
| | | if (val0 != null && val1 != val0) { |
| | | if (this.changeType && this.changeType > 0) { |
| | | // 妿æ¯å
纤ãå
纤带ï¼å䏿§è¡ä¸é¢æä½ |
| | | return; |
| | | } |
| | | this.tableLists.forEach(async (m, i) => { |
| | | if (m.templateId == val1) { |
| | | let list = await this.getCurrentProduct(this.currentSample.id, 0); |
| | | this.currentSample.insProduct = this.HaveJson(list); //èµå¼å½åæ ·åçæ£éªé¡¹ |
| | | this.param = {}; //åå§åä¼ å°å端çåæ° |
| | | this.currentSample.insProduct.forEach((a, j) => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null, |
| | | }; |
| | | }); |
| | | // å»é模æ¿ï¼è¿åæå ä¸ªæ¨¡æ¿ |
| | | 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: { |
| | | // æä»¶ç®¡ç--å¼å§ |
| | | 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 = ""; |
| | | }, |
| | | // å·æ°é¡µé¢ |
| | | refreshView() { |
| | | this.loading = true; |
| | | doInsOrder({ |
| | | id: this.id, |
| | | laboratory: this.sonLaboratory, |
| | | }).then(async (res) => { |
| | | this.insOrder = res.data.insOrder; |
| | | 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); |
| | | // è·åå½åæ ·åçæ£éªé¡¹ |
| | | let list = await this.getCurrentProduct(this.currentSample.id, 0); |
| | | this.currentSample.insProduct = this.HaveJson(list); |
| | | // åå§åä¼ éå°å端çåæ° |
| | | this.param = {}; |
| | | this.changeType = 0; |
| | | this.currentSample.insProduct.forEach((a) => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null, |
| | | }; |
| | | }); |
| | | 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: "", |
| | | rawMaterialTag: this.rawMaterialTag, |
| | | }; |
| | | 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) { |
| | | // è·åå°æ°éæåä¸é¡¹ï¼æ£éªé¡¹çID |
| | | 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åºçæcanvas |
| | | html2canvas(table).then(function (canvas) { |
| | | // å建ä¸ä¸ªå¾çå
ç´ |
| | | var img = canvas.toDataURL("image/png"); |
| | | |
| | | // å建ä¸ä¸ªaæ ç¾æ¨¡æç¹å»è¿è¡ä¸è½½ |
| | | 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; |
| | | }); |
| | | }, |
| | | // æ ¹æ®ç±»åãä»»å¡idãå®éªå®¤æ¥è·åæ ·åçæ£éªé¡¹ä¿¡æ¯ |
| | | 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) { |
| | | // åå§åæ°æ® |
| | | 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.currentSample.insProduct.forEach((a, j) => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null, |
| | | }; |
| | | }); |
| | | // å¤ç页é¢åè¡¨æ°æ® |
| | | 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 = {}; |
| | | 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, |
| | | }) |
| | | ); |
| | | } 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); |
| | | }); |
| | | }, |
| | | // è·åæ£éªå¼ä¸ºä¸ææ¶ç䏿å表 |
| | | // selectEnumByCategoryOfSelect(val) { |
| | | // this.enumList = []; |
| | | // if (val === undefined || val === null) { |
| | | // return; |
| | | // } |
| | | // this.$axios |
| | | // .post(this.$api.enums.selectEnumByCategory, { |
| | | // category: val, |
| | | // }) |
| | | // .then((res) => { |
| | | // this.enumList = res.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++; |
| | | }); |
| | | }); |
| | | // æ¬æ¬¡å¾ªç¯ä¸»è¦æ¯æ§å¶åå¹¶,以忧嶿£éªé¡¹ä¿¡æ¯æ¯å¦å±ç¤ºåºæ¥,以便åç»æ£éª |
| | | this.tableList.forEach((a) => { |
| | | let dels = new Set(); //éè¦å é¤çè¡ |
| | | let ids = []; //æææ£éªé¡¹çid |
| | | let set3 = new Set(); |
| | | a.template.forEach((b) => { |
| | | let size1 = set3.size; |
| | | let size2 = set3.add(b.r).size; |
| | | if (size1 < size2) { |
| | | let str = ""; |
| | | let str2 = ""; |
| | | let unit2 = ""; |
| | | let count4 = 0; |
| | | let isThree = 0; |
| | | a.template.forEach((c) => { |
| | | // è·åå° æ£éªé¡¹åç±»+æ£éªé¡¹+æ£éªåé¡¹çæ¼æ¥,å¦ææ¨¡æ¿éçä¿¡æ¯è·æ¥å£è¿åçæ£éªé¡¹ä¿¡æ¯è½å¤å¹é
åå±ç¤ºåºæ¥ |
| | | if (b.r === c.r) { |
| | | if ( |
| | | c.v.ps != undefined && |
| | | c.v.ps.value === "æ£éªé¡¹åç±»" && |
| | | count4 === 0 |
| | | ) { |
| | | // ä¸çº§åç±» |
| | | isThree = 1; |
| | | } else if ( |
| | | c.v.ps != undefined && |
| | | c.v.ps.value === "æ£éªé¡¹" && |
| | | count4 === 0 |
| | | ) { |
| | | // äºçº§åç±» |
| | | isThree = 0; |
| | | } |
| | | if (isThree == 0) { |
| | | if (c.v.ps != undefined && c.v.ps.value === "æ£éªé¡¹") { |
| | | if (count4 === 0) { |
| | | if (c.v.v) { |
| | | c.v.v = c.v.v.replace(/\s*/g, ""); |
| | | } |
| | | str += c.v.v; |
| | | count4 += 1; |
| | | } |
| | | } else if ( |
| | | c.v.ps != undefined && |
| | | c.v.ps.value === "æ£éªå项" |
| | | ) { |
| | | if (count4 === 1) { |
| | | if (c.v.v) { |
| | | c.v.v = c.v.v.replace(/\s*/g, ""); |
| | | } |
| | | str += c.v.v; |
| | | count4 += 1; |
| | | } |
| | | } |
| | | } else if (isThree == 1) { |
| | | if (c.v.ps != undefined && c.v.ps.value === "æ£éªé¡¹åç±»") { |
| | | if (count4 === 0) { |
| | | if (c.v.v) { |
| | | c.v.v = c.v.v.replace(/\s*/g, ""); |
| | | } |
| | | str += c.v.v; |
| | | count4 += 1; |
| | | } |
| | | } else if (c.v.ps != undefined && c.v.ps.value === "æ£éªé¡¹") { |
| | | if (count4 === 1) { |
| | | if (c.v.v) { |
| | | c.v.v = c.v.v.replace(/\s*/g, ""); |
| | | } |
| | | str += c.v.v; |
| | | count4 += 1; |
| | | } |
| | | } else if ( |
| | | c.v.ps != undefined && |
| | | c.v.ps.value === "æ£éªå项" |
| | | ) { |
| | | if (count4 === 2) { |
| | | if (c.v.v) { |
| | | c.v.v = c.v.v.replace(/\s*/g, ""); |
| | | } |
| | | str += c.v.v; |
| | | count4 += 1; |
| | | } |
| | | } |
| | | } |
| | | if (str === "æºæ¢°æ§è½å¹²ææä¼¸å¼ºåº¦(纵å)") { |
| | | if (c.v.ps != undefined && c.v.ps.value === "åä½") { |
| | | if (c.v.v) { |
| | | c.v.v = c.v.v.replace(/\s*/g, ""); |
| | | } |
| | | 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; |
| | | inspectionItemClass = inspectionItemClass.replace(/\s*/g, ""); |
| | | let inspectionItem = |
| | | this.currentSample.insProduct[i].inspectionItem == null || |
| | | this.currentSample.insProduct[i].inspectionItem == undefined |
| | | ? "" |
| | | : this.currentSample.insProduct[i].inspectionItem; |
| | | inspectionItem = inspectionItem.replace(/\s*/g, ""); |
| | | let inspectionItemSubclass = |
| | | this.currentSample.insProduct[i].inspectionItemSubclass == |
| | | null || |
| | | this.currentSample.insProduct[i].inspectionItemSubclass == |
| | | undefined |
| | | ? "" |
| | | : this.currentSample.insProduct[i].inspectionItemSubclass; |
| | | inspectionItemSubclass = inspectionItemSubclass.replace( |
| | | /\s*/g, |
| | | "" |
| | | ); |
| | | 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 { |
| | | // 妿ç¸ç,é£ä¹è¯´ææ¾å°äº,并䏿idåèµ·æ¥,åç»æ£éªé¡¹ä¹ä¼å¨é¡µé¢ä¸æ¾ç¤ºåºæ¥ |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | // æä½å é¤ |
| | | dels.forEach((del) => { |
| | | for (let b = 0; b < a.template.length; b++) { |
| | | if (a.template[b].r === del) { |
| | | a.template.splice(b, 1); |
| | | b -= 1; |
| | | } |
| | | } |
| | | }); |
| | | // æä½èµå¼--主è¦èµå¼åä½,è¯éªæ¹æ³çä¿¡æ¯ |
| | | ids.forEach((id) => { |
| | | for (let b = 0; b < a.template.length; b++) { |
| | | if (a.template[b].r === id.r) { |
| | | a.template[b].i = id.id; |
| | | if ( |
| | | a.template[b].v.ps != undefined && |
| | | a.template[b].v.ps.value === "åä½" |
| | | ) { |
| | | a.template[b].v.v = id.product.unit; |
| | | } |
| | | if ( |
| | | a.template[b].v.ps != undefined && |
| | | (a.template[b].v.ps.value === "è¯éªæ¹æ³" || |
| | | a.template[b].v.ps.value === "æ£æµæ¹æ³") |
| | | ) { |
| | | a.template[b].v.v = id.product.methodS; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | let set2 = new Set(); |
| | | // åå¹¶çæ°æ®å¤ç,cs rs 代表åå¹¶çæ°é |
| | | a.template.forEach((b) => { |
| | | let size1 = set2.size; |
| | | let size2 = set2.add(b.mc).size; |
| | | if (b.mc != undefined && size1 < size2) { |
| | | b.v.mc.rs = 0; |
| | | b.v.mc.cs = 0; |
| | | a.template.forEach((c) => { |
| | | if (b.mc === c.mc) { |
| | | if (b.r === c.r) { |
| | | b.v.mc.cs += 1; |
| | | } |
| | | if (b.c === c.c) { |
| | | b.v.mc.rs += 1; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | // æ¬æ¬¡å¾ªç¯ä¸»è¦æ¯å¯¹åç«¯ä¼ åè¿è¡åå§å,æ ·å¼é»è¾ä¿®æ¹ |
| | | this.tableList.forEach((a) => { |
| | | let arrs = []; |
| | | let set = new Set(); |
| | | let count1 = 0; |
| | | let conclusionList = []; //ç»è®ºå表 |
| | | let finalList = []; //æç»å¼å表 |
| | | // ç»è®ºä¸æç»å¼å¨è¿éä¸ä¸å¯¹åº,以ä¸ä¸¤ä¸ªå表é¿åº¦è¯å®æ¯ä¸æ ·ç,妿æä¸ä¸æ ·,é£ä¹å¤åæ¯æ¨¡æ¿é
ç½®å¾é®é¢ |
| | | conclusionList = a.template.filter( |
| | | (n) => n.v.ps != undefined && n.v.ps.value === "ç»è®º" |
| | | ); //ç»è®ºå表 |
| | | finalList = a.template.filter( |
| | | (n) => n.v.ps != undefined && n.v.ps.value === "æç»å¼" |
| | | ); //æç»å¼å表 |
| | | a.template.forEach((b) => { |
| | | if ( |
| | | b.v.ps != undefined && |
| | | b.v.ps.value === "åºå·" && |
| | | (b.v.mc == undefined || Object.keys(b.v.mc).length === 4) |
| | | ) { |
| | | // 对åºå·è¿è¡èµå¼ |
| | | count1++; |
| | | b.v.v = count1; |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === "è¦æ±å¼") { |
| | | // å¯¹è¦æ±å¼è¿è¡èµå¼ |
| | | b.v.v = this.getAsk(b.i); |
| | | } |
| | | // 对页é¢çåç»åç«¯ä¼ åçæ£éªå¼,计ç®å¼,设å¤ç¼ç ,设å¤åç§°,æç»å¼,ç»è®ºè¿è¡åå§å |
| | | if ( |
| | | b.v.ps != undefined && |
| | | typeof b.v.ps.value === "string" && |
| | | b.v.ps.value.includes("æ£éªå¼") |
| | | ) { |
| | | this.$set(b.v, "v", ""); |
| | | // b.v.v = '' |
| | | b.u = ""; |
| | | b.i && this.param[b.i] && this.param[b.i].insValue.push(b); |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === "计ç®å¼") { |
| | | this.$set(b.v, "v", ""); |
| | | // b.v.v = '' |
| | | b.i && this.param[b.i] && this.param[b.i].comValue.push(b); |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === "设å¤ç¼ç ") { |
| | | // b.v.v = '' |
| | | this.$set(b.v, "v", ""); |
| | | b.i && this.param[b.i] && this.param[b.i].equipValue.push(b); |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === "设å¤åç§°") { |
| | | this.$set(b.v, "v", ""); |
| | | // b.v.v = '' |
| | | b.i && this.param[b.i] && this.param[b.i].equipName.push(b); |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === "æç»å¼") { |
| | | // b.v.v = '' |
| | | this.$set(b.v, "v", ""); |
| | | if ( |
| | | b.i !== undefined && |
| | | this.param[b.i] && |
| | | !this.param[b.i].resValue |
| | | ) { |
| | | this.param[b.i].resValue = b; |
| | | } |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === "ç»è®º") { |
| | | if ( |
| | | b.i !== undefined && |
| | | this.param[b.i] && |
| | | !this.param[b.i].insResult |
| | | ) { |
| | | this.param[b.i].insResult = b; |
| | | conclusionList.forEach((n, i) => { |
| | | if (n.r == b.r && n.c == b.c) { |
| | | b.v.f = `(${this.comparisonList.find((j) => j.value == finalList[i].c) |
| | | .label |
| | | }${finalList[i].r + 1})`; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | set.add(b.r); |
| | | // å¦ææ¨¡æ¿å表ç彿°åå¨,é£ä¹å å
¥å°excel彿°å表éé¢ |
| | | 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]; |
| | | } |
| | | }); |
| | | // æ¬æ¬¡å¾ªç¯ä¸»è¦æ¯å¯¹é¡µé¢ååç«¯ä¼ åè¿è¡åå§åèµå¼ |
| | | this.currentSample.insProduct.forEach(async (a) => { |
| | | try { |
| | | // 计ç®å¼èµå¼ |
| | | let comValue = JSON.parse(a.insProductResult.comValue); |
| | | for (var i = 0; i < comValue.length; i++) { |
| | | if ( |
| | | this.param[a.id].comValue.find( |
| | | (m) => m.c == comValue[i].c && m.r == comValue[i].r |
| | | ) |
| | | ) { |
| | | this.param[a.id].comValue.find( |
| | | (m) => m.c == comValue[i].c && m.r == comValue[i].r |
| | | ).v.v = this.toFixed( |
| | | comValue[i].v, |
| | | this.param[a.id].comValue.find( |
| | | (m) => m.c == comValue[i].c && m.r == comValue[i].r |
| | | ).v.ct |
| | | ); |
| | | } else if (!comValue[i].c || !comValue[i].r) { |
| | | this.param[a.id].comValue[i].v.v = this.toFixed( |
| | | comValue[i].v, |
| | | this.param[a.id].comValue[i].v.ct |
| | | ); |
| | | } |
| | | } |
| | | } catch (e) { } |
| | | try { |
| | | // æ£éªå¼èµå¼ |
| | | let insValue = JSON.parse(a.insProductResult.insValue); |
| | | for (let i = 0; i < insValue.length; i++) { |
| | | if ( |
| | | this.param[a.id].insValue.find( |
| | | (m) => m.c == insValue[i].c && m.r == insValue[i].r |
| | | ) |
| | | ) { |
| | | this.param[a.id].insValue.find( |
| | | (m) => m.c == insValue[i].c && m.r == insValue[i].r |
| | | ).v.v = this.toFixed( |
| | | insValue[i].v, |
| | | this.param[a.id].insValue.find( |
| | | (m) => m.c == insValue[i].c && m.r == insValue[i].r |
| | | ).v.ct |
| | | ); |
| | | this.param[a.id].insValue.find( |
| | | (m) => m.c == insValue[i].c && m.r == insValue[i].r |
| | | ).u = insValue[i].u; |
| | | // this.param[a.id].insValue[i].v.v = insValue[i].v |
| | | // this.param[a.id].insValue[i].u = insValue[i].u |
| | | } |
| | | } |
| | | } catch (e) { } |
| | | try { |
| | | // 设å¤ç¼å·èµå¼ |
| | | let equipValue = JSON.parse(a.insProductResult.equipValue); |
| | | for (let i = 0; i < equipValue.length; i++) { |
| | | // æ®é设å¤èµå¼ |
| | | 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; |
| | | } |
| | | }); |
| | | } |
| | | for (let i = 0; i < equipName.length; i++) { |
| | | // æ®é设å¤åç§°èµå¼ |
| | | 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) { } |
| | | }); |
| | | // 对excel彿°è¿è¡å¤ç |
| | | this.handleExcelMethod(); |
| | | }, |
| | | // æ£éªå¼è¾å
¥å触åç彿° |
| | | changeInput(m, code, n, getDataType, changeSelect) { |
| | | // 为æ°éå®ä¹ä¸ä¸ªé»è¾åæ° |
| | | 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) { |
| | | const [numerator, denominator] = fraction.split("/"); // ååå忝 |
| | | return !(!denominator || !numerator); |
| | | } |
| | | const isTrue = isValidFraction(n.v.v); |
| | | if (!isTrue) { |
| | | n.v.v = n.v.v.replace("/", ""); |
| | | } |
| | | } |
| | | } |
| | | try { |
| | | // å Worker åéæ¶æ¯ï¼å¼å§å¤çé»è¾ |
| | | this.worker.postMessage( |
| | | JSON.stringify({ |
| | | code: code, |
| | | tableList: this.tableList, |
| | | excelMethodList: this.excelMethodList, |
| | | comparisonList: this.comparisonList, |
| | | currentSample: this.currentSample, |
| | | PROJECT: this.PROJECT, |
| | | param: this.param, |
| | | currentTable: this.currentTable, |
| | | getDataTypeId: this.getDataTypeId, |
| | | modelType: this.sampleProduct[0].model, |
| | | currentInsItem: n, |
| | | }) |
| | | ); |
| | | } catch (error) { |
| | | console.log(444, error); |
| | | } |
| | | |
| | | // çå¬ Worker è¿åçç»æ |
| | | this.worker.onmessage = (event) => { |
| | | this.result = JSON.parse(event.data); |
| | | switch (this.result.method) { |
| | | case "saveInsContext": |
| | | this.$nextTick(() => { |
| | | // this.$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.currentInsItemId) { |
| | | currentInsItemId = this.result.value.currentInsItemId; |
| | | } |
| | | // ç¹æ®å¤çä¸ä¸ç»è®º,伿è¿ç§ç¹æ®æ
åµ |
| | | for (var i in this.param) { |
| | | if ( |
| | | this.param[i].insResult && |
| | | this.param[i].insResult.v && |
| | | this.param[i].insResult.v.v |
| | | ) { |
| | | if (this.param[i].insResult.v.v == "åæ ¼") { |
| | | this.$set(this.param[i].insResult.v, "v", 1); |
| | | } else if (this.param[i].insResult.v.v == "ä¸åæ ¼") { |
| | | this.$set(this.param[i].insResult.v, "v", 0); |
| | | } |
| | | } |
| | | } |
| | | this.saveInsContext(currentInsItemId); |
| | | }); |
| | | break; |
| | | case "tableList": |
| | | this.$nextTick(() => { |
| | | // æ´æ°æ°æ® |
| | | this.$delete(this.tableList[0], "arr"); |
| | | this.$set(this.tableList[0], "arr", this.result.value[0].arr); |
| | | // this.param = this.result.value.param |
| | | if (this.result.value.currentInsItem) { |
| | | currentInsItemId = this.result.value.currentInsItem.i; |
| | | } |
| | | }); |
| | | break; |
| | | case "getCurrentInsProduct": |
| | | // æ´æ°é¡µé¢æ°æ® |
| | | this.getCurrentInsProduct(this.result.value); |
| | | break; |
| | | } |
| | | }; |
| | | // ä¿åæ°æ® |
| | | setTimeout(() => { |
| | | if (changeSelect) { |
| | | this.saveInsContext(currentInsItemId); |
| | | } |
| | | }, 200); |
| | | }, |
| | | // æ ¹æ®åç«¯ä¼ åæ´æ°é¡µé¢æ°æ® param => this.tableList[0].insProductResult |
| | | getCurrentInsProduct(pId) { |
| | | if (!this.tableList[0].insProductResult) { |
| | | this.tableList[0].insProductResult = {}; |
| | | } |
| | | for (let m in this.param[pId]) { |
| | | let value = this.param[pId][m]; |
| | | switch (m) { |
| | | case "comValue": |
| | | // èµå¼è®¡ç®å¼ |
| | | if (value && value.length > 0) { |
| | | this.tableList[0].insProductResult[m] = []; |
| | | value.forEach((a, i) => { |
| | | let obj = { |
| | | v: a.v.v, |
| | | }; |
| | | this.tableList[0].insProductResult[m].push(obj); |
| | | }); |
| | | try { |
| | | this.tableList[0].insProductResult[m] = JSON.stringify( |
| | | this.tableList[0].insProductResult[m] |
| | | ); |
| | | } catch (error) { |
| | | console.log(555, error); |
| | | } |
| | | } |
| | | break; |
| | | // èµå¼æ£éªå¼ |
| | | case "insValue": |
| | | if (value && value.length > 0) { |
| | | this.tableList[0].insProductResult[m] = []; |
| | | value.forEach((a, i) => { |
| | | let obj = { |
| | | v: a.v.v, |
| | | u: a.u, |
| | | }; |
| | | this.tableList[0].insProductResult[m].push(obj); |
| | | }); |
| | | try { |
| | | this.tableList[0].insProductResult[m] = JSON.stringify( |
| | | this.tableList[0].insProductResult[m] |
| | | ); |
| | | } catch (error) { |
| | | console.log(666, error); |
| | | } |
| | | } |
| | | break; |
| | | // èµå¼è®¾å¤ç¼å· |
| | | case "equipValue": |
| | | if (value && value.length > 0) { |
| | | this.tableList[0].insProductResult[m] = []; |
| | | value.forEach((a, i) => { |
| | | let obj = { |
| | | v: a.v.v, |
| | | }; |
| | | this.tableList[0].insProductResult[m].push(obj); |
| | | }); |
| | | try { |
| | | this.tableList[0].insProductResult[m] = JSON.stringify( |
| | | this.tableList[0].insProductResult[m] |
| | | ); |
| | | } catch (error) { |
| | | console.log(777, error); |
| | | } |
| | | } |
| | | break; |
| | | // èµå¼è®¾å¤åç§° |
| | | case "equipName": |
| | | if (value && value.length > 0) { |
| | | this.tableList[0].insProductResult[m] = []; |
| | | value.forEach((a, i) => { |
| | | let obj = { |
| | | v: a.v.v, |
| | | }; |
| | | this.tableList[0].insProductResult[m].push(obj); |
| | | }); |
| | | try { |
| | | this.tableList[0].insProductResult[m] = JSON.stringify( |
| | | this.tableList[0].insProductResult[m] |
| | | ); |
| | | } catch (error) { |
| | | console.log(888, error); |
| | | } |
| | | } |
| | | break; |
| | | // èµå¼æç»å¼ |
| | | case "resValue": |
| | | this.tableList[0].lastValue = value ? value.v.v : ""; |
| | | break; |
| | | // èµå¼ç»è®º |
| | | case "insResult": |
| | | this.tableList[0].insResult = value ? value.v.v : ""; |
| | | break; |
| | | } |
| | | } |
| | | }, |
| | | // 对EXCEL彿°è¿è¡å¤ç |
| | | handleExcelMethod() { |
| | | if (this.excelMethodList.length > 0) { |
| | | this.excelMethodList.map((item) => { |
| | | // å¾å°æ¯ä¸ªå½æ°çåæ°å表 |
| | | item.valueList = excelFunction.changeParameter(item.v.f); |
| | | return item; |
| | | }); |
| | | } |
| | | }, |
| | | getValue(v) { |
| | | // 对页é¢å±ç¤ºæ°æ®è¿è¡å¤ç,@,代表æ¢è¡ |
| | | let str = v.v |
| | | ? v.v |
| | | : v.v === 0 |
| | | ? v.v |
| | | : v.ct && v.ct.s |
| | | ? v.ct.s.length > 0 && |
| | | v.ct.s[0].v |
| | | .replace(new RegExp("\n", "g"), "<br/>") |
| | | .replace(new RegExp("@", "g"), "<br/>") |
| | | : ""; |
| | | // å¯¹æ°æ®ä¿çå°æ°ç¹è¿è¡å¤ç |
| | | if (v.ct && v.ct.fa && v.ct.fa.includes(".") && str) { |
| | | let num = 0; |
| | | let str0 = v.ct.fa.split(".")[1]; |
| | | num = str0.length; |
| | | str = Number(str).toFixed(num); |
| | | } |
| | | if (v.v && typeof v.v == "string" && v.v.includes("@")) { |
| | | str = v.v.replace(new RegExp("@", "g"), "<br/>"); |
| | | } |
| | | return str; |
| | | }, |
| | | // è·åå½åè¾å
¥æ¡ç±»å |
| | | getInspectionValueType(id) { |
| | | for (var a in this.currentSample.insProduct) { |
| | | if (this.currentSample.insProduct[a].id == id) { |
| | | return this.currentSample.insProduct[a].inspectionValueType; |
| | | } |
| | | } |
| | | }, |
| | | // è·åè¦æ±æè¿° |
| | | getTell(id) { |
| | | for (var a in this.currentSample.insProduct) { |
| | | if (this.currentSample.insProduct[a].id == id) { |
| | | return this.currentSample.insProduct[a].tell; |
| | | } |
| | | } |
| | | }, |
| | | // 卿è·ååå
æ ¼å®½åº¦ |
| | | handleWidth(n) { |
| | | let sum = 0; |
| | | if (n.v.mc && n.v.mc.cs && n.v.mc.c != undefined) { |
| | | for (let i = 0; i < n.v.mc.cs; i++) { |
| | | let num = this.widthList[i + n.v.mc.c] |
| | | ? this.widthList[i + n.v.mc.c] |
| | | : 100; |
| | | sum += num; |
| | | } |
| | | } else { |
| | | sum = this.widthList[n.c] ? this.widthList[n.c] : 100; |
| | | } |
| | | return sum; |
| | | }, |
| | | // 对è¾å
¥å¼è¿è¡æ ¼å¼æ ¡éª |
| | | handleInput(n) { |
| | | try { |
| | | n.v.v = n.v.v.replace(/[^\d.^e>ï¼â¥â¤<ï¼æè£èå\-/+]/g, ""); |
| | | n.v.v = n.v.v.replace(/\.{2,}/g, "."); //åªä¿ç第ä¸ä¸ª. æ¸
é¤å¤ä½ç |
| | | n.v.v = n.v.v |
| | | .replace(".", "$#$") |
| | | .replace(/\./g, "") |
| | | .replace("$#$", "."); |
| | | n.v.v = n.v.v.replace(/\/{2,}/g, "/"); //åªä¿ç第ä¸ä¸ª/æ¸
é¤å¤ä½ç |
| | | n.v.v = n.v.v |
| | | .replace("/", "$#$") |
| | | .replace(/\//g, "") |
| | | .replace("$#$", "/"); |
| | | } catch (error) { |
| | | console.log(error); |
| | | } |
| | | }, |
| | | getInspectionItemType(id) { |
| | | for (var a in this.currentSample.insProduct) { |
| | | if (this.currentSample.insProduct[a].id == id) { |
| | | return this.currentSample.insProduct[a].inspectionItemType; |
| | | } |
| | | } |
| | | }, |
| | | // è·åè¦æ±å¼ |
| | | getAsk(id) { |
| | | for (var a in this.currentSample.insProduct) { |
| | | if (this.currentSample.insProduct[a].id == id) { |
| | | return this.currentSample.insProduct[a].ask; |
| | | } |
| | | } |
| | | }, |
| | | // è·åææè®¾å¤ |
| | | 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); |
| | | }); |
| | | } |
| | | }, |
| | | // getDic(e, id) { |
| | | // if (e) { |
| | | // for (var a in this.currentSample.insProduct) { |
| | | // if (this.currentSample.insProduct[a].id == id) { |
| | | // let str = this.currentSample.insProduct[a].dic; |
| | | // this.selectEnumByCategoryOfSelect(str); |
| | | // return str; |
| | | // } |
| | | // } |
| | | // } |
| | | // }, |
| | | openAddCheck() { |
| | | this.addCheck = true; |
| | | }, |
| | | // 夿 ¸ |
| | | upInsReview(e) { |
| | | if (e == 1) { |
| | | // éè¿ |
| | | this.reviewLoading = true; |
| | | verifyPlan({ |
| | | orderId: this.orderId, |
| | | type: 1, |
| | | laboratory: this.sonLaboratory, |
| | | tell: null, |
| | | userId: this.checkUser, |
| | | }).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; |
| | | }, |
| | | submit() { |
| | | if (this.verifyUser === null || this.verifyUser === "") { |
| | | this.$message.error("请æå®å¤æ ¸äººå"); |
| | | return; |
| | | } |
| | | if (!this.otherForm.humidity) { |
| | | this.$message.error("请è¾å
¥æ¹¿åº¦"); |
| | | return; |
| | | } |
| | | if (!this.otherForm.temperature) { |
| | | this.$message.error("请è¾å
¥æ¸©åº¦"); |
| | | return; |
| | | } |
| | | this.submitLoading = true; |
| | | checkSubmitPlan({ |
| | | orderId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | if (!res.data || res.data.length == 0) { |
| | | this.submitLoading = true; |
| | | submitPlan({ |
| | | orderId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | verifyUser: this.verifyUser, |
| | | entrustCode: this.insOrder.entrustCode, |
| | | }).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; |
| | | }); |
| | | } 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); |
| | | } |
| | | newData.push( |
| | | h( |
| | | "p", |
| | | { style: "font-size: 14px;color: red;" }, |
| | | Number(i) + 1 + "ã" + res.data[i] |
| | | ) |
| | | ); |
| | | } |
| | | newData.push( |
| | | h( |
| | | "p", |
| | | { |
| | | style: |
| | | "font-size: 16px;color:#000;margin-top:12px;overflow-y: auto;max-height:80vh", |
| | | }, |
| | | "以ä¸é¡¹ç®ä¸åæ ¼ï¼ç¡®å®æäº¤ï¼" |
| | | ) |
| | | ); |
| | | this.$confirm("æç¤º", { |
| | | title: "æç¤º", |
| | | message: h("div", null, newData), |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "", |
| | | }) |
| | | .then(() => { |
| | | this.submitLoading = true; |
| | | 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; |
| | | }, |
| | | // ç»ä¸å¨è¿éä¿åæ°æ® |
| | | saveInsContext(currentInsItemId) { |
| | | try { |
| | | if (this.param) { |
| | | let param = null; |
| | | if (currentInsItemId) { |
| | | param = { [currentInsItemId]: this.param[currentInsItemId] }; |
| | | } else { |
| | | param = this.param; |
| | | } |
| | | saveInsContext({ |
| | | param: JSON.stringify(param), |
| | | currentTable: this.currentTable, |
| | | sampleId: this.currentSample.id, |
| | | orderId: this.orderId, |
| | | sonLaboratory: this.sonLaboratory |
| | | }).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; |
| | | } |
| | | // 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]; |
| | | } |
| | | } |
| | | // 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); |
| | | } |
| | | }, |
| | | 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; // é¼ æ ç¹å»çx䏿 |
| | | var scrollLeft; // å½åå
ç´ æ»å¨æ¡çåç§»é |
| | | nav.addEventListener("mousedown", function (event) { |
| | | flag = true; |
| | | downX = event.clientX; // è·åå°ç¹å»çx䏿 |
| | | scrollLeft = this.scrollLeft; // è·åå½åå
ç´ æ»å¨æ¡çåç§»é |
| | | }); |
| | | nav.addEventListener("mousemove", function (event) { |
| | | if (flag) { |
| | | // 夿æ¯å¦æ¯é¼ æ æä¸æ»å¨å
ç´ åºå |
| | | var moveX = event.clientX; // è·åç§»å¨çxè½´ |
| | | var scrollX = moveX - downX; // å½åç§»å¨çxè½´ä¸æ åå»åç¹å»ä¸å»çxè½´ä¸æ å¾å°é¼ æ æ»å¨è·ç¦» |
| | | this.scrollLeft = scrollLeft - scrollX; // é¼ æ æä¸çæ»å¨æ¡åç§»éåå»å½åé¼ æ çæ»å¨è·ç¦» |
| | | } |
| | | }); |
| | | // é¼ æ æ¬èµ·åæ¢æå¨ |
| | | nav.addEventListener("mouseup", function () { |
| | | flag = false; |
| | | }); |
| | | // é¼ æ 离å¼å
ç´ åæ¢æå¨ |
| | | nav.addEventListener("mouseleave", function (event) { |
| | | flag = false; |
| | | }); |
| | | }, |
| | | // 页é¢éé¢åæ¢æ ·å |
| | | async caretSample(num) { |
| | | let index = this.currentKey + num; |
| | | if (index < 1) { |
| | | this.$message.error("å½åæ¯ç¬¬ä¸ä¸ªæ ·å"); |
| | | return; |
| | | } else if (index > this.sampleProduct.length) { |
| | | this.$message.error("å½åæ¯æåä¸ä¸ªæ ·å"); |
| | | return; |
| | | } |
| | | this.currentKey = index; |
| | | this.currentSample = this.HaveJson(this.sampleProduct[index - 1]); |
| | | // è·åæ£éªé¡¹ |
| | | let list = await this.getCurrentProduct(this.currentSample.id, 0); |
| | | this.currentSample.insProduct = this.HaveJson(list); |
| | | // åå§ååç«¯ä¼ å |
| | | this.param = {}; |
| | | this.changeType = 0; |
| | | this.currentSample.insProduct.forEach((a, j) => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null, |
| | | }; |
| | | }); |
| | | // 页颿°æ®å¤ç |
| | | this.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) => { }); |
| | | }, |
| | | /** |
| | | * å°æ°å¼vä¿çct.faä¸'##'åçæå®å°æ°ä½æ°ï¼å¹¶è¿åæ ¼å¼ååçå符串ã |
| | | * |
| | | * @param v è¦æ ¼å¼åçæ°å¼ |
| | | * @param ct å
嫿 ¼å¼åé
ç½®ç对象 |
| | | * @param ct.fa æ ¼å¼åé
ç½®å符串ï¼è¥å
å«'##'åæç
§å
¶åçå
容确å®å°æ°ä½æ° |
| | | * @returns æ ¼å¼ååçå符串æåå§æ°å¼ï¼è¥é
ç½®ä¸ç¬¦åè¦æ±ï¼ |
| | | */ |
| | | toFixed(v, ct) { |
| | | if (v && ct && ct.fa) { |
| | | if (ct.fa.includes(".")) { |
| | | let num = ct.fa.slice(4).length; |
| | | return Number(v).toFixed(num); |
| | | } else { |
| | | return v; |
| | | } |
| | | } else { |
| | | return v; |
| | | } |
| | | }, |
| | | goback() { |
| | | 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; |
| | | } |
| | | |
| | | .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> |