| | |
| | | <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; |
| | |
| | | .search .form-inline { |
| | | padding-top: 20px; |
| | | padding-left: 0px; |
| | | text-align: left; |
| | | } |
| | | |
| | | .center { |
| | |
| | | display: inline-flex; |
| | | align-items: center; |
| | | } |
| | | .history-btn{ |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | .noShow{ |
| | | opacity: 0; |
| | | } |
| | | </style> |
| | | <style> |
| | | .inspection .el-form-item__label { |
| | |
| | | |
| | | .inspection .el-drawer__header { |
| | | color: #303133; |
| | | text-align: left; |
| | | } |
| | | |
| | | .inspection .el-input-group__append { |
| | |
| | | <template> |
| | | <div v-loading="loading" class="inspection"> |
| | | <el-row class="title"> |
| | | <el-col :span="12" style="padding-left: 20px;text-align: left;" >检验单详情 |
| | | <el-col :span="12" style="padding-left: 20px;text-align: left;" :class="{noShow:noBack}">检验单详情 |
| | | </el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <!-- <el-button size="small" type="primary" @click="fiberOpticVisible=true" v-if="fiberOptic.length>0">光纤切换</el-button> |
| | | <el-button size="small" type="primary" @click="fiberOpticTapeVisible=true" v-if="fiberOpticTape.length>0">光纤带切换</el-button> |
| | | <el-button size="small" type="primary" @click="bushingVisible=true" v-if="bushing.length>0">套管切换</el-button> --> |
| | | <el-button size="small" type="primary" @click="sampleVisible=true;uploadSample()">样品切换</el-button> |
| | | <el-button size="small" type="primary" @click="taskVisible=true">任务切换</el-button> |
| | | <el-button size="small" type="primary" @click="addVerifyDia = true" v-if="state==1" |
| | | <el-col :span="12" style="text-align: right;display: flex;align-items: center;justify-content: end;height: 60px;"> |
| | | <el-button size="small" type="primary" @click="versionDialogVisible=true" v-if="state==1&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName.includes('电路试验')&&insOrder.sampleType!='无源器件'">电调/非电调模板切换</el-button> |
| | | <el-select v-model="template" size="medium" placeholder="电路预设模板" style="margin-right: 10px;margin-left: 10px;" v-if="state==1&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName.includes('电路试验')" |
| | | @change="selectInsProductTemplateById"> |
| | | <el-option v-for="(a, ai) in templates" :key="ai" :value="a.id" :label="a.name"> |
| | | <span style="float: left">{{ a.name }}</span> |
| | | <i class="el-icon-delete" style="float: right; color: #66b1ff; font-size: 16px;line-height: 34px;" |
| | | @click.stop="handleDelete(a)" v-if="addInsProductTemplatePower"></i> |
| | | </el-option> |
| | | </el-select> |
| | | <el-button size="medium" @click="templateDia=true" v-if="state==1&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName.includes('电路试验')&&addInsProductTemplatePower"> |
| | | <span style="color: #3A7BFA;">保存模板</span> |
| | | </el-button> |
| | | <!-- <el-button size="small" type="primary" @click="sampleVisible=true;uploadSample()">样品切换</el-button> --> |
| | | <el-button size="small" type="primary" @click="taskVisible=true" v-show="!isLook">任务切换</el-button> |
| | | <el-button size="small" type="primary" @click="handleSubmit" v-if="state==1" |
| | | :loading="submitLoading">提交</el-button> |
| | | <!-- 复核 --> |
| | | <el-button size="medium" type="primary" @click="upInsReview(1)" :loading="reviewLoading" |
| | | v-if="state>1">通过</el-button> |
| | | <el-button size="medium" @click="upInsReview(0)" v-if="state>1">不通过</el-button> |
| | | <el-button size="small" @click="$emit('goback')">返回</el-button> |
| | | <!-- <el-button size="small" type="primary" @click="upInsReview(1,'继续试验')" :loading="reviewLoading" |
| | | v-if="state>1&&!isLook">继续测试下一个样品</el-button> |
| | | <el-button size="small" @click="upInsReview(0,'再次试验')" v-if="state>1&&!isLook" type="danger">再次试验</el-button> |
| | | <el-button size="small" @click="upInsReview(2,'结束试验')" v-if="state>1&&!isLook">此委托单结束</el-button> --> |
| | | <el-button size="small" type="primary" @click="upInsReviewDia=true" v-if="state>1&&!isLook">复核</el-button> |
| | | <el-button size="small" @click="handleBack" v-if="!noBack">返回</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="search"> |
| | | <div class="search" v-show="!isLook"> |
| | | <el-form :inline="true" :model="searchForm" class="form-inline" label-width="100px" label-position="right"> |
| | | <el-form-item label="委托编号:"> |
| | | <el-input clearable v-model="insOrder.entrustCode" disabled size="small" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="样品编号:"> |
| | | <el-tooltip :disabled="!currentSample.sampleCode" :content="currentSample.sampleCode"> |
| | | <el-input clearable v-model="currentSample.sampleCode" disabled size="small" placeholder="请输入" ></el-input> |
| | | <el-input clearable v-model="currentSample.sampleCode" disabled size="small" placeholder="请输入" tooltip></el-input> |
| | | </el-tooltip> |
| | | </el-form-item> |
| | | <el-form-item label="样品名称:"> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="样品数量:"> |
| | | <el-input clearable v-model="sampleProduct.length" disabled size="small" placeholder="请输入" ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="试验标准:"> |
| | | <span>{{ currentSample.testRequirements?currentSample.testRequirements:'-' }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="下发时间:"> |
| | | <el-input clearable v-model="insOrder.sendTime" disabled size="small" placeholder="请输入"></el-input> |
| | |
| | | <el-form-item label="当前样品位数:"> |
| | | <el-tag v-if="currentKey">{{ `NO.${currentKey}` }}</el-tag> |
| | | </el-form-item> |
| | | <el-form-item label="" v-if="insOrder.rule"> |
| | | <el-tag>{{ !insOrder.rule.includes('不考虑不确定度')?insOrder.rule.split('-')[0]+' '+insOrder.rule.split('-')[1]+'%':insOrder.rule }}</el-tag> |
| | | </el-form-item> |
| | | <el-form-item label="备注:"> |
| | | <span style="color:red">{{ insOrder.remark?insOrder.remark:'-' }}</span> |
| | | <!-- <el-tag v-if="currentKey">{{ insOrder.remark }}</el-tag> --> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | <el-radio-button :label="item.templateId" v-for="(item,index) in tableLists" :key="index" |
| | | size="small">{{ item.templateName }}</el-radio-button> |
| | | </el-radio-group> |
| | | <!-- <span style="margin-left: 20px;margin-right: 10px;">模板版本:</span> |
| | | <el-radio-group v-model="currentTableState" size="small"> |
| | | <el-radio-button label="0" size="small">版本一</el-radio-button> |
| | | <el-radio-button label="1" size="small">版本二</el-radio-button> |
| | | </el-radio-group> --> |
| | | </div> |
| | | <div style="display: flex;align-items: center;"> |
| | | <span v-if="casing.length>0&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName=='成品缆检验原始记录'"> 套管:</span> |
| | | <el-select v-model="currentTab" placeholder="请选择" @change="m=>handleChange(m,3)" v-if="casing.length>0&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName=='成品缆检验原始记录'" size="small" :loading="getReportModelLoading" @focus="getReportModel(currentSample.id)"> |
| | | <el-option |
| | | v-for="item in casing" |
| | | :key="item.id" |
| | | :label="item.color" |
| | | :value="item.id"> |
| | | <span style="float: left">{{ item.color}}</span> |
| | | <el-tag :type="item.state==1?'success':'danger'" style="float: right;margin-top: 5px;" size="small">{{ item.state==1?'已检':'未检' }}</el-tag> |
| | | </el-option> |
| | | </el-select> |
| | | <span v-if="fibers.length>0&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName!='温度循环检验原始记录'"> 光纤带:</span> |
| | | <el-select v-model="currentTab" placeholder="请选择" @change="m=>handleChange(m,1)" v-if="fibers.length>0&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName!='温度循环检验原始记录'" size="small" :loading="getReportModelLoading" @focus="getReportModel(currentSample.id)"> |
| | | <el-option |
| | | v-for="item in fibers" |
| | | :key="item.value" |
| | | :label="item.code" |
| | | :value="item.id"> |
| | | <span style="float: left">{{ item.code}}</span> |
| | | <el-tag :type="item.state==1?'success':'danger'" style="float: right;margin-top: 5px;" size="small">{{ item.state==1?'已检':'未检' }}</el-tag> |
| | | </el-option> |
| | | </el-select> |
| | | <span v-if="fiber.length>0&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName!='温度循环检验原始记录'"> 光纤:</span> |
| | | <el-select v-model="currentTab" placeholder="请选择" @change="m=>handleChange(m,2)" v-if="fiber.length>0&&tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName!='温度循环检验原始记录'" size="small" :loading="getReportModelLoading" @focus="getReportModel(currentSample.id)"> |
| | | <el-option |
| | | v-for="item in fiber" |
| | | :label="item.bushColor+'-'+item.color" |
| | | :key="item.id" |
| | | :value="item.id"> |
| | | <span style="float: left">{{ item.bushColor+'-'+item.color }}</span> |
| | | <el-tag :type="item.state==1?'success':'danger'" style="float: right;margin-top: 5px;" size="small">{{ item.state==1?'已检':'未检' }}</el-tag> |
| | | </el-option> |
| | | </el-select> |
| | | <el-form :inline="true" :model="otherForm" class="form-inline" label-width="50px" style="padding-top: 0;padding-left: 10px;" v-if="PROJECT=='检测中心'"> |
| | | <el-form-item label="温度:" style="margin-bottom: 0;"> |
| | | <el-input v-model="otherForm.temperature" :disabled="state>1" size="small" placeholder="" style="width: 90px;" @change="m=>subOtherForm(m,'temperature')" ></el-input> |
| | |
| | | <el-button type="primary" size="small" v-if="(isGet||tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName=='温度循环检验原始记录'&&temDataAcquisition)&&PROJECT=='检测中心'&&state==1" @click="getDataAcquisitionDevice" :loading="dataAcquisitionLoading">数据采集</el-button> |
| | | <el-button :type="dataAcquisitionEidtAble?'':'primary'" size="small" v-if="(isGet||(tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName=='温度循环检验原始记录'))&&PROJECT=='检测中心'&&collected&&state==1" @click="dataAcquisitionEidtAble=!dataAcquisitionEidtAble">{{dataAcquisitionEidtAble?'关闭编辑':'编辑数采'}}</el-button> |
| | | </div> |
| | | <!-- <div class="history-btn" v-if="isLook"> |
| | | <el-button type="primary" icon="el-icon-arrow-left" size="small" @click="goHistory(-1)">上一条记录</el-button> |
| | | <span style="font-size: 14px;margin: 0 10px;">当前第{{num}}条</span> |
| | | <el-button type="primary" size="small" @click="goHistory(1)">下一条记录<i class="el-icon-arrow-right el-icon--right"></i></el-button> |
| | | </div> --> |
| | | </div> |
| | | <div class="center-box" id="nav" v-loading="tableLoading" v-if="!tableLists.find(m=>m.templateId==currentTable)||(tableLists.find(m=>m.templateId==currentTable).templateName!='温度循环检验原始记录'&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('热循环')&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('温升试验'))"> |
| | | <!-- 常规检验原始记录 --> |
| | | <div class="center-box" id="nav" v-loading="tableLoading" v-if="!tableLists.find(m=>m.templateId==currentTable)||(!tableLists.find(m=>m.templateId==currentTable).templateName.includes('电路试验')&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('温湿度试验')&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('功率容量'))"> |
| | | <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index+currentTable+currentSample.id"> |
| | | <tbody> |
| | | <tr v-for="(m,i) in item.arr" :key="i"> |
| | |
| | | :disabled="(getInspectionItemType(n.i) == 1 && !dataAcquisitionEidtAble )|| (n.u != userId && n.u != undefined && n.u != '')" |
| | | @input="handleInput(n)" |
| | | @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`, n,'getDataType')" @mousewheel.native.prevent :key="'abc-'+'000'+index+'000'+i+'000'+j" |
| | | @keydown.enter="changeInput('',`${item.templateId}-${n.r}-${n.c}-${n.i}`, n)"> |
| | | @keydown.enter="changeInput('',`${item.templateId}-${n.r}-${n.c}-${n.i}`, n, 'getDataType')"> |
| | | <!-- <el-button slot="append" type="primary" icon="el-icon-edit" size="mini" |
| | | v-if="getInspectionItemType(n.i) == 1" @click="getSystemValue(n)"></el-button> --> |
| | | </el-input> |
| | |
| | | </template> |
| | | <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='样品编号'"> |
| | | <div style="display: flex;flex-wrap: nowrap;align-items: center;width: 100%" :title="currentSample.sampleCode"> |
| | | <i class="el-icon-caret-left table_caret" style="width: 16px;" @click="caretSample(-1)" v-if="!currentFiberOpticTape&&!currentFiberOptic"></i> |
| | | <!-- <i class="el-icon-caret-left table_caret" style="width: 16px;" @click="caretSample(-1)" v-if="!currentFiberOpticTape&&!currentFiberOptic"></i> --> |
| | | <div :style="`font-family:${n.v.ff} !important;overflow: hidden;white-space: nowrap;width: calc(100% - 32px);`">{{currentSample.sampleCode}}</div> |
| | | <i class="el-icon-caret-right table_caret" style="width: 16px;" |
| | | v-if="!currentFiberOpticTape&&!currentFiberOptic" @click="caretSample(1)"></i> |
| | | <!-- <i class="el-icon-caret-right table_caret" style="width: 16px;" |
| | | v-if="!currentFiberOpticTape&&!currentFiberOptic" @click="caretSample(1)"></i> --> |
| | | </div> |
| | | </template> |
| | | <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='样品型号'"> |
| | | <div :style="`font-family:${n.v.ff} !important;`" v-if="currentSample.model!==undefined&¤tSample.model!==null">{{currentSample.model}}</div> |
| | | </template> |
| | | <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='试验标准'"> |
| | | <div :style="`font-family:${n.v.ff} !important;`" v-if="currentSample.testRequirements!==undefined&¤tSample.testRequirements!==null">{{currentSample.testRequirements}}</div> |
| | | </template> |
| | | <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='套管'"> |
| | | <div style="display: flex;flex-wrap: nowrap;align-items: center;"> |
| | |
| | | v-if="currentFiberOptic" class="el-icon-caret-right table_caret" @click="caretOptic(1)"></i> |
| | | </div> |
| | | </template> |
| | | <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='试验前样品检查'"> |
| | | <el-select class="table_input" v-model="n.v.v" |
| | | :disabled="state>1|| (n.u != userId && n.u != undefined && n.u != '')" @change="(val)=>changeSampleCheck(val, n,'前')"> |
| | | <el-option label="完好" :value="'完好'"></el-option> |
| | | <el-option label="破损" :value="'破损'"></el-option> |
| | | </el-select> |
| | | </template> |
| | | <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='试验后样品检查'"> |
| | | <el-select class="table_input" v-model="n.v.v" |
| | | :disabled="state>1|| (n.u != userId && n.u != undefined && n.u != '')" @change="(val)=>changeSampleCheck(val, n,'后')"> |
| | | <el-option label="完好" :value="'完好'"></el-option> |
| | | <el-option label="破损" :value="'破损'"></el-option> |
| | | </el-select> |
| | | </template> |
| | | <span v-else :style="`font-family:${n.v.ff} !important;`" v-html="getValue(n.v)" ></span> |
| | | </div> |
| | | </td> |
| | |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | <!-- 温度循环检验原始记录 --> |
| | | <div v-loading="tableLoading" v-else-if="tableLists.find(m=>m.templateId==currentTable).templateName=='温度循环检验原始记录'"> |
| | | <el-divider></el-divider> |
| | | <h4 style="margin-bottom: 20px;font-size: 24px;font-weight: 400;text-align: center;">温度循环检验原始记录</h4> |
| | |
| | | </template> |
| | | </el-table> |
| | | </div> |
| | | <!-- 热循环/温升试验检验原始记录 --> |
| | | <div v-loading="tableLoading" v-else-if="tableLists.find(m=>m.templateId==currentTable).templateName.includes('热循环')||tableLists.find(m=>m.templateId==currentTable).templateName.includes('温升试验')"> |
| | | <el-divider></el-divider> |
| | | <h4 style="margin-bottom: 20px;font-size: 24px;font-weight: 400;text-align: center;">{{tableLists.find(m=>m.templateId==currentTable).templateName}}</h4> |
| | |
| | | </table> |
| | | </div> |
| | | </div> |
| | | <!-- 电路试验 --> |
| | | <div v-else-if="tableLists.find(m=>m.templateId==currentTable).templateName.includes('电路试验')" style="width: 100%;overflow-x: auto;overflow-y: visible;"> |
| | | <!-- <Circuit></Circuit> --> |
| | | <!-- 电调 --> |
| | | <CircuitParameters1 v-if="currentTableState==0" :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state" :num="currentSample.num1" :isLook="isLook" :currentNum="currentNum" ref="CircuitParameters"></CircuitParameters1> |
| | | <!-- 非电调 --> |
| | | <CircuitParameters2 v-if="currentTableState==1" :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state" :num="currentSample.num1" :isLook="isLook" :currentNum="currentNum" ref="CircuitParameters"></CircuitParameters2> |
| | | <!-- 无源器件 --> |
| | | <CircuitParameters3 v-if="this.insOrder.sampleType=='无源器件' " :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state" :num="currentSample.num1" :isLook="isLook" :currentNum="currentNum" ref="CircuitParameters"></CircuitParameters3> |
| | | </div> |
| | | <!-- 温湿度试验 --> |
| | | <div v-else-if="tableLists.find(m=>m.templateId==currentTable).templateName.includes('温湿度试验')"> |
| | | <Humidity :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state" :isLook="isLook" :num="currentSample.num1"/> |
| | | </div> |
| | | <!-- 功率试验 --> |
| | | <div v-else-if="tableLists.find(m=>m.templateId==currentTable).templateName.includes('功率容量')"> |
| | | <PowerCapacity :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state" :isLook="isLook" :num="currentSample.num1"/> |
| | | </div> |
| | | <el-upload :action="action" |
| | | :data="{ |
| | | orderId:id |
| | | orderId:this.orderId0, |
| | | sampleId:id, |
| | | sonLaboratory:sonLaboratory |
| | | }" |
| | | v-if="state==1&&fileAdd" |
| | | :on-success="handleSuccessUp" :show-file-list="false" |
| | | accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers" :on-change="beforeUpload" |
| | | accept='.jpg,.jpeg,.png,.gif,.docx,.xls,.xlsx,.pdf,.zip,.rar,.csv' :headers="headers" :before-upload="beforeUpload" |
| | | style="width: 80px !important;" |
| | | :on-error="onError" ref='upload'> |
| | | <el-button size="small" type="primary" v-if="state==1">附件上传</el-button></el-upload> |
| | | <!-- <span v-if="sonLaboratory === '远场'||sonLaboratory === '近场'" style="color: red;font-size: 12px;">辐射试验尽量上传设备导出的csv文件,不然触发不了报告生成</span> --> |
| | | <ValueTable class="value-table" ref="fileList" :url="$api.insOrderPlan.getFileList" |
| | | :componentData="componentData0" |
| | | :delUrl="$api.insOrderPlan.delfile" |
| | | :key="upIndex" style="height: 100%;margin-top: 16px;"/> |
| | | </div> |
| | | <el-drawer title="光纤切换" :visible.sync="fiberOpticVisible" :size="500"> |
| | | <el-table class="el-table" ref="fiberOpticTable" :data="fiberOptic" height="100%" tooltip-effect="dark" border |
| | | highlight-current-row @row-click="handleChangeOptic" :row-class-name="tableRowClassName" |
| | | :current-row-key="currentKey2" :row-key="record=>record.index" v-if="fiberOpticVisible"> |
| | | <el-table-column type="index" align="center" label="序号" width="70px" :key="Math.random()"> |
| | | </el-table-column> |
| | | <el-table-column prop="bushColor" label="管套色标" min-width="100px" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="color" label="光纤色标" min-width="100px" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="model" label="光纤规格" min-width="130px" show-overflow-tooltip |
| | | ></el-table-column> |
| | | <el-table-column prop="standard" label="参考标准" width="100px" show-overflow-tooltip></el-table-column> |
| | | </el-table> |
| | | </el-drawer> |
| | | <el-drawer title="光纤带切换" :visible.sync="fiberOpticTapeVisible" :size="500"> |
| | | <el-table class="el-table" ref="fiberOpticTapeTable" :data="fiberOpticTape" height="100%" tooltip-effect="dark" border |
| | | highlight-current-row @row-click="handleChangeTape" :row-class-name="tableRowClassName" |
| | | :current-row-key="currentKey1" :row-key="record=>record.index" v-if="fiberOpticTapeVisible"> |
| | | <el-table-column type="index" align="center" label="序号" width="70px" :key="Math.random()"> |
| | | </el-table-column> |
| | | <el-table-column prop="code" label="光纤带编号" min-width="110px" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="model" label="光纤带规格" min-width="110px" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="standard" label="参考标准" width="90px" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="num" label="光纤检测量" min-width="110px" show-overflow-tooltip |
| | | ></el-table-column> |
| | | </el-table> |
| | | </el-drawer> |
| | | <el-drawer title="套管切换" :visible.sync="bushingVisible" :size="500"> |
| | | <el-table class="el-table" ref="bushingTable" :data="bushing" height="100%" tooltip-effect="dark" border |
| | | highlight-current-row @row-click="handleChangeBushing" :row-class-name="tableRowClassName" |
| | | :current-row-key="currentKey0" :row-key="record=>record.index" v-if="bushingVisible"> |
| | | <el-table-column type="index" align="center" label="序号" width="70px" :key="Math.random()"> |
| | | </el-table-column> |
| | | <el-table-column prop="color" label="管色标" min-width="100px" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="standNum" label="标量" min-width="100px" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="testNum" label="测试量" min-width="100px" show-overflow-tooltip></el-table-column> |
| | | </el-table> |
| | | </el-drawer> |
| | | <el-drawer title="样品切换" :visible.sync="sampleVisible" :size="500"> |
| | | <el-drawer title="样品切换" :visible.sync="sampleVisible" :size="500" :modal="!noBack"> |
| | | <el-table class="el-table" ref="productTable" :data="sampleProduct" height="100%" tooltip-effect="dark" border |
| | | highlight-current-row @row-click="handleChangeSample" :row-class-name="tableRowClassName" |
| | | :current-row-key="currentKey" :row-key="record=>record.index" v-if="sampleVisible"> |
| | |
| | | </el-drawer> |
| | | <el-dialog title="检验复核" :visible.sync="reviewDia" width="500px"> |
| | | <div class="body" style="display: flex;padding: 10px;" v-if="reviewDia"> |
| | | <div class="search_label" style="width: 150px;"><span class="required-span">* </span>不通过的理由:</div> |
| | | <div class="search_label" style="width: 150px;"><span class="required-span">* </span>再次试验的理由:</div> |
| | | <div class="search_input" style="width: 100%;"> |
| | | <el-input size="small" clearable v-model="noReason" type="textarea" :autosize="{ minRows: 4}"></el-input> |
| | | </div> |
| | |
| | | <el-button type="primary" @click="submitDataGet()" :loading="getDataIndexLoading">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="选择电路检验模板版本" |
| | | :visible.sync="versionDialogVisible" |
| | | width="30%" |
| | | :close-on-click-modal="false" |
| | | :close-on-press-escape="false" |
| | | :show-close="false"> |
| | | <el-radio-group v-model="currentTableState"> |
| | | <el-radio :label="0">电调-电路检验原始记录</el-radio> |
| | | <el-radio :label="1">非电调-电路检验原始记录</el-radio> |
| | | </el-radio-group> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" :loading="versionLoading" @click="saveVersion">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="试验信息" :visible.sync="experimentDia" width="50%"> |
| | | <div style="height: 80vh;overflow-y: auto;"> |
| | | <div class="body" style="display: flex;padding: 10px;align-items: center;" v-if="experimentDia0"> |
| | | <div class="search_label" style="width: 150px;"><span class="required-span">*</span>实验阶段</div> |
| | | <div class="search_input" style="width: 100%;"> |
| | | <el-input clearable v-model="experimentInfo.term" size="small" placeholder=""></el-input> |
| | | </div> |
| | | </div> |
| | | <div class="body" style="display: flex;padding: 10px;align-items: center;" v-if="experimentDia0"> |
| | | <div class="search_label" style="width: 150px;"><span class="required-span">*</span>实验操作</div> |
| | | <div class="search_input" style="width: 100%;"> |
| | | <el-input clearable v-model="experimentInfo.note" size="small" placeholder="" type="textarea" |
| | | :rows="2"></el-input> |
| | | </div> |
| | | </div> |
| | | <template v-for="(x,y) in newUserInfo"> |
| | | <p style="margin: 10px 0;"><el-tag size="small">{{x.name}}</el-tag> 工时填写</p> |
| | | <table border="1" cellpadding="10" class="thermal-table"> |
| | | <tr style="font-size: 18px;font-weight: 500;background-color: #F0F1F5;padding: 10px 0;box-sizing: border-box;"> |
| | | <td>样品</td> |
| | | <td>样品编号</td> |
| | | <td>型号</td> |
| | | <td>检验项</td> |
| | | <td>检验子项</td> |
| | | <td>工时</td> |
| | | </tr> |
| | | <template v-for="(item,index) in sampleProduct"> |
| | | <tr> |
| | | <td :rowspan="item.insProduct.length+1">{{ item.sample }}</td> |
| | | <td :rowspan="item.insProduct.length+1">{{ item.sampleCode }}</td> |
| | | <td :rowspan="item.insProduct.length+1">{{ item.model }}</td> |
| | | </tr> |
| | | <tr v-for="(m,i) in item.insProduct" :key="item.id+i"> |
| | | <td>{{ m.inspectionItem }}</td> |
| | | <td>{{ m.inspectionItemSubclass }}</td> |
| | | <td><el-input-number v-model="x.timeArr[i]" :min="0" :max="100" label="工时" size="small"></el-input-number></td> |
| | | </tr> |
| | | </template> |
| | | </table> |
| | | </template> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="experimentDia = false">取 消</el-button> |
| | | <el-button type="primary" @click="submit0">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="文件预览" |
| | | :visible.sync="lookFileVisible" |
| | | width="60%" fullscreen :modal="false"> |
| | | <filePreview v-if="lookFileVisible" :fileUrl="currentFile.url" |
| | | :currentFile="currentFile" style="max-height: 87vh;overflow-y: auto;"/> |
| | | </el-dialog> |
| | | <el-dialog title="保存模板" :visible.sync="templateDia" width="400px"> |
| | | <div class="body" style="display: flex;align-items: center;" v-if="templateDia"> |
| | | <div class="search_label" style="width: 90px;"><span class="required-span">* </span>模板名称:</div> |
| | | <div class="search_input"> |
| | | <el-input size="small" clearable v-model="templateName"></el-input> |
| | | </div> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="templateDia = false">取 消</el-button> |
| | | <el-button type="primary" @click="addTemplateDia" :loading="templateLoading">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="复核" :visible.sync="upInsReviewDia" width="400px"> |
| | | <el-radio-group v-model="upInsReviewType" style="display: flex;flex-direction: column"> |
| | | <el-radio :label="1" style="margin: 10px 0; ">继续测试下一个样品或其他站点任务</el-radio> |
| | | <el-radio :label="0" style="margin: 10px 0; ">再次检验该样品</el-radio> |
| | | <el-radio :label="2" style="margin: 10px 0; ">此委托单结束</el-radio> |
| | | <p style="font-size: 12px;color:red">慎重:如果还有其他样品在检,点击结束可能会中断,请确保所有样品都检验且复核完成再点击</p> |
| | | </el-radio-group> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="upInsReviewDia = false">取 消</el-button> |
| | | <el-button type="primary" @click="upInsReview" :loading="reviewLoading">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import ValueTable from '../../tool/value-table.vue' |
| | | import file from '../../../util/file' |
| | | import excelFunction from '../../../util/excelFountion' |
| | | import CircuitParameters1 from './circuit-parameters1.vue' |
| | | import CircuitParameters2 from './circuit-parameters2.vue' |
| | | import CircuitParameters3 from './circuit-parameters3.vue' |
| | | import Humidity from './humidity.vue' |
| | | import PowerCapacity from './power-capacity.vue' |
| | | import filePreview from '../../tool/file-preview.vue' |
| | | export default { |
| | | props: ['sonLaboratory', 'orderId', 'state','inspectorList'], |
| | | props: ['sonLaboratory', 'orderId', 'state','inspectorList','version','orderStateId','isLook','num1','noBack','orderId0','userInfo'], |
| | | components: { |
| | | ValueTable, |
| | | CircuitParameters1, |
| | | CircuitParameters2, |
| | | CircuitParameters3, |
| | | filePreview, |
| | | Humidity, |
| | | PowerCapacity, |
| | | }, |
| | | data() { |
| | | return { |
| | | lookFileVisible:false,//预览文件 |
| | | experimentDia:false, |
| | | experimentDia0:false, |
| | | upInsReviewDia:false, |
| | | upInsReviewType:1, |
| | | experimentInfo:{ |
| | | note:'', |
| | | term:'' |
| | | }, |
| | | currentNum:0, |
| | | versionLoading:false, |
| | | versionDialogVisible:false, |
| | | currentTableState:0, |
| | | dataGetDia:false, |
| | | wareTableDataLoading:false, |
| | | fileAdd:false, |
| | |
| | | }, |
| | | componentData0: { |
| | | entity: { |
| | | insSampleId:'', |
| | | sonLaboratory:this.sonLaboratory, |
| | | insOrderId:'' |
| | | }, |
| | | isIndex: true, |
| | |
| | | disabFun: (row, index) => { |
| | | return this.state!=1 |
| | | } |
| | | }, |
| | | { |
| | | id: '1', |
| | | font: '预览', |
| | | type: 'text', |
| | | method: 'lookFile', |
| | | } |
| | | ], |
| | | isPage: false, |
| | |
| | | }, |
| | | upIndex: 0, |
| | | changeType:null, |
| | | getReportModelLoading:false, |
| | | insOrder: {}, |
| | | sampleProduct: [], |
| | | typeList: [], |
| | |
| | | verifyUser: null, |
| | | personList: [], |
| | | enumList: [], |
| | | fiberOpticVisible:false, |
| | | fiberOpticTapeVisible:false, |
| | | bushingVisible:false, |
| | | fiberOpticTape:[],//光纤带列表 |
| | | fiberOptic:[],//光纤列表 |
| | | bushing:[],//套管列表 |
| | |
| | | numOptions:[], |
| | | temperatureOptions:[], |
| | | wareTableData:[], |
| | | otherForm:{ |
| | | humidity:null, |
| | | temperature:null, |
| | | }, |
| | | equipForm:{ |
| | | value0:null, |
| | | code0:null, |
| | |
| | | }, |
| | | thermalCyclingLoading:false, |
| | | temDataAcquisition:false, |
| | | getData:[ |
| | | { |
| | | faName:'波长附加衰减', |
| | | child:[ |
| | | { |
| | | name:'1285nm~1330nm', |
| | | arr:[12,13,14,15], |
| | | }, |
| | | { |
| | | name:'1525nm~1575nm', |
| | | arr:[12,13,14,15], |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | faName:'截至波长', |
| | | child:[ |
| | | { |
| | | name:'截至波长', |
| | | arr:[12,13,14,15], |
| | | } |
| | | ] |
| | | } |
| | | ], |
| | | getData:[], |
| | | getDataIndex:[], |
| | | getDataIndexLoading:false, |
| | | changeType:null, |
| | | getDataTypeId:'', |
| | | getDataType:null |
| | | getDataType:null, |
| | | num:0, |
| | | otherForm:{ |
| | | temperature:'', |
| | | humidity:'' |
| | | }, |
| | | currentFile:{},//当前文件 |
| | | templates:[],//电路试验模板 |
| | | templateDia:false,//电路试验模板保存模板弹框 |
| | | template:null, |
| | | templateLoading:false, |
| | | templateName:'', |
| | | addInsProductTemplatePower:false,//配置模板权限 |
| | | newUserInfo:[] |
| | | } |
| | | }, |
| | | // 用于上传文件的信息 |
| | | computed: { |
| | | headers() { |
| | | return { |
| | |
| | | created() { |
| | | this.componentData.entity.sonLaboratory = this.sonLaboratory; |
| | | this.id = this.orderId; |
| | | this.currentTableState = this.version |
| | | this.num = this.num1 |
| | | this.getUserInfo() |
| | | }, |
| | | mounted() { |
| | |
| | | this.startWorker() |
| | | }, |
| | | watch: { |
| | | // 监听任务id,获取任务信息 |
| | | id(val) { |
| | | this.loading = true |
| | | this.$axios.post(this.$api.insOrderPlan.doInsOrder, { |
| | | id: val, |
| | | sampleId: val, |
| | | laboratory: this.sonLaboratory |
| | | }).then(async res => { |
| | | this.insOrder = res.data.insOrder; |
| | | this.componentData0.entity.insOrderId = val; |
| | | this.componentData0.entity.insSampleId = val; |
| | | this.componentData0.entity.insOrderId = this.orderId0; |
| | | this.$refs.fileList.selectList() |
| | | this.selectInsProductTemplate() |
| | | this.urgentList.forEach(m => { |
| | | if (m.value == this.insOrder.type) { |
| | | this.insOrder.typeName = m.label |
| | |
| | | if(!res.data.sampleProduct||res.data.sampleProduct.length==0){ |
| | | return this.$message.error('该任务没有样品信息') |
| | | } |
| | | // 赋值当前样品列表 |
| | | this.sampleProduct = res.data.sampleProduct |
| | | this.currentSample = this.HaveJson(this.sampleProduct[0]) |
| | | let insProduct = this.HaveJson(this.currentSample.insProduct) |
| | | // 温度、湿度赋值 |
| | | if(insProduct&&insProduct.length>0){ |
| | | let {temperature,humidity} = insProduct[0]; |
| | | this.otherForm = { |
| | |
| | | humidity:humidity?humidity:null, |
| | | } |
| | | } |
| | | // 获取当前样品的检验项 |
| | | 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 => { |
| | | // 是否为成品电缆下的松套管项目,不是则执行初始化 |
| | | if(this.handleCasing(a.inspectionItem)){ |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | insResult: null, |
| | | beforeCheck:null, |
| | | afterCheck:null, |
| | | } |
| | | } |
| | | }) |
| | | this.determineWhetherToCollectData() |
| | | this.getReportModel(this.currentSample.id) |
| | | this.determineWhetherToCollectData()//是否需要数采 |
| | | if (this.currentSample.index == undefined) this.currentSample['index'] = 1 |
| | | let bushing = this.currentSample.bushing |
| | | this.getTableLists(); |
| | | this.getTableLists();//处理模板列表信息 |
| | | |
| | | this.componentData.currentId = val; |
| | | this.currentKey = 1; |
| | | |
| | | // 清空光纤配置相关数据 |
| | | // 清空光纤配置相关数据---下面信息暂时可忽略 |
| | | this.fiberOpticTape = [] |
| | | this.currentFiberOpticTape = null; |
| | | this.fiberOptic = [] |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // 监听当前模板变化 |
| | | currentTable(val1, val0) { |
| | | if (val0 != null && val1 != val0) { |
| | | if(this.tableLists.find(m=>m.templateId==val1)&&(this.tableLists.find(m=>m.templateId==val1).templateName=='成品缆检验原始记录')){ |
| | | if(this.casing.length>0){ |
| | | this.handleChange(this.casing[0].id,3) |
| | | } |
| | | return |
| | | } |
| | | // if(this.tableLists.find(m=>m.templateId==val1)&&(this.tableLists.find(m=>m.templateId==val1).templateName=='成品缆检验原始记录')){ |
| | | // if(this.casing.length>0){ |
| | | // this.handleChange(this.casing[0].id,3) |
| | | // } |
| | | // return |
| | | // } |
| | | 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 => { |
| | | this.currentSample.insProduct = this.HaveJson(list)//赋值当前样品的检验项 |
| | | this.param = {}//初始化传到后端的参数 |
| | | this.currentSample.insProduct.forEach((a, j) => { |
| | | if(this.handleCasing(a.inspectionItem)){ |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | |
| | | } |
| | | } |
| | | }) |
| | | this.getReportModel(this.currentSample.id) |
| | | // 去重模板,返回有几个模板 |
| | | const mySet1 = new Set(); |
| | | this.tableLists = this.currentSample.insProduct.filter(m => { |
| | | let num0 = mySet1.size; |
| | |
| | | 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){ |
| | | if(this.tableLists.find(m=>m.templateId==this.currentTable)&&(this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='温度循环检验原始记录'||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('热循环')||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('温升试验'))&&this.equipOptions&&this.equipOptions.length>0){ |
| | | // 初始化设备信息 |
| | | this.param[this.currentSample.insProduct[0].id].equipValue = [] |
| | | this.param[this.currentSample.insProduct[0].id].equipName = [] |
| | | if(this.equipForm.code0){ |
| | | // 赋值第一个设备的信息 |
| | | this.equipForm.value0 = this.equipOptions.find(m=>m.value==this.equipForm.code0).label |
| | | this.param[this.currentSample.insProduct[0].id].equipValue.push({ |
| | | i:this.currentSample.insProduct[0].id, |
| | |
| | | }) |
| | | } |
| | | if(this.equipForm.code1){ |
| | | // 赋值第二个设备的信息 |
| | | this.equipForm.value1 = this.equipOptions.find(m=>m.value==this.equipForm.code1).label |
| | | this.param[this.currentSample.insProduct[0].id].equipValue.push({ |
| | | i:this.currentSample.insProduct[0].id, |
| | |
| | | } |
| | | }) |
| | | } |
| | | this.saveInsContext() |
| | | // 保存数据 |
| | | this.saveInsContext(this.currentSample.insProduct[0].id) |
| | | } |
| | | } |
| | | }, |
| | |
| | | if(res.code!=200){ |
| | | return |
| | | } |
| | | // console.log(res.data) |
| | | // 赋值回显PK8000的数据 |
| | | this.wareFormChange() |
| | | }) |
| | | }else{ |
| | |
| | | return |
| | | } |
| | | this.dataAcquisitionInfoNew = this.HaveJson(res.data) |
| | | // 对数采回来的值进行处理 |
| | | this.handleDataAcquisition(res.data) |
| | | }) |
| | | } |
| | | }, |
| | | handleDataAcquisition(data){ |
| | | // 是否可以编辑数采数据 |
| | | if(this.dataAcquisitionEidtAble){ |
| | | this.getDataType = 1; |
| | | }else{ |
| | |
| | | faName:i, |
| | | child:[] |
| | | } |
| | | // 循环数采数据 |
| | | for(let j in data[i]){ |
| | | // 拼接字符串 检验项+检验子项 |
| | | let str0 = '' |
| | | if(i==j){ |
| | | str0 = i+',' |
| | | }else{ |
| | | str0 = i+','+j |
| | | } |
| | | if(j!='frequency'&&data[i][j]&&typeof data[i][j].result == 'string'){ |
| | | if(j!='frequency'&&data[i][j]&&(!data[i][j].result||typeof data[i][j].result == 'string')){ |
| | | // 处理数采信息格式 |
| | | this.dataAcquisitionInfo[str0] = { |
| | | value:data[i][j].result, |
| | | frequency:data[i].frequency |
| | | } |
| | | let list = this.tableList[0].arr |
| | | // 循环页面列表信息,判断数采数据对应页面列表信息的检验项是哪个,并给当前检验项绑定设备信息 |
| | | list.forEach((item,index)=>{ |
| | | let num0 = 0; |
| | | let str = '' |
| | |
| | | } |
| | | } |
| | | } |
| | | // 绑定设备信息 |
| | | if(data[i][j].equipName&&data[i][j].equipValue&&m.v&&m.v.ps&&m.v.ps.value=='设备编码'&&str0==str){ |
| | | if(!m.v.v){ |
| | | this.changeEquip(data[i][j].equipValue,m,data[i][j].equipName) |
| | |
| | | }) |
| | | }) |
| | | }else if(j!='frequency'&&data[i][j]&&Array.isArray(data[i][j].result)){ |
| | | // 如果返回的数采数据是数组,则处理数组 |
| | | // 以下逻辑为获取每个检验项可输入的检验值的最大个数 |
| | | let str0 = '' |
| | | if(i==j){ |
| | | str0 = i+',' |
| | |
| | | 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) |
| | |
| | | // value: |
| | | // }) |
| | | // } |
| | | // 获取到最大检验值输入个数后重组数据 |
| | | let obj0 = { |
| | | name:j, |
| | | arr:data[i][j].result, |
| | | maxNum:maxNum, |
| | | value:[] |
| | | } |
| | | // 如果数采返回的数组长度大于最大输入个数,则将数采数据在弹框中展示,用户选择需要手动选择数采的信息 |
| | | if(data[i][j].result&&Array.isArray(data[i][j].result)&&data[i][j].result.length>maxNum){ |
| | | obj.child.push(obj0) |
| | | }else{ |
| | |
| | | this.getData.push(obj) |
| | | } |
| | | } |
| | | // 如果存在数采返回的数组长度大于最大输入个数,则弹出弹框选择 |
| | | if(this.getData.length>0){ |
| | | this.dataGetDia = true |
| | | this.getDataIndex = [] |
| | | }else{ |
| | | // 如果都不存在,则,进入处理数采线程里去处理数据 |
| | | try { |
| | | // 向 Worker 发送消息,开始处理逻辑 |
| | | this.getDataIndexLoading = false |
| | |
| | | this.worker0.onmessage = (event) => { |
| | | let result = JSON.parse(event.data); |
| | | if(result.method=='changeInput'){ |
| | | // 采集后的数据,需要进行计算的线程进行计算 |
| | | let {list,n} = result.value |
| | | this.$set(this.tableList[0],'arr',list) |
| | | this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n) |
| | | }else if(result.getDataTypeId){ |
| | | // 获取到数采最后一项,检验项的ID |
| | | this.getDataTypeId = result.getDataTypeId |
| | | } |
| | | }; |
| | | }, |
| | | // 如果存在数采返回的数组长度大于最大输入个数,则弹出弹框选择,这里是弹框的提交 |
| | | submitDataGet(){ |
| | | if(this.getDataIndex.length==0){ |
| | | this.$message.error('请选择需要采集的数据') |
| | |
| | | this.getDataIndex.sort((a, b) => a - b); |
| | | for (let i=0;i<this.getData.length;i++){ |
| | | for(let j=0;j<this.getData[i].child.length;j++){ |
| | | // 对用户选择的数采信息进行处理,赋值 |
| | | let arr = [] |
| | | for(let k=0;k<this.getDataIndex.length;k++){ |
| | | arr.push( this.dataAcquisitionInfoNew[this.getData[i].faName][this.getData[i].child[j].name].result[this.getDataIndex[k]]) |
| | |
| | | } |
| | | } |
| | | this.getDataIndexLoading = true |
| | | // 赋值完成后需要再次进入处理数采线程里去处理数据 |
| | | this.handleDataAcquisition(this.dataAcquisitionInfoNew) |
| | | }, |
| | | // 多线程 |
| | |
| | | // 创建 Worker 实例 |
| | | this.worker0 = new Worker('/static/js/worker0.js'); |
| | | }, |
| | | // 停止多线程 |
| | | stopWorker() { |
| | | if (this.worker) { |
| | | this.worker.terminate(); |
| | |
| | | }, |
| | | // 温度循环---开始 |
| | | changeItem(row){ |
| | | // 内端、外端进行赋值逻辑处理 |
| | | |
| | | // 赋值到页面 |
| | | if(row.value0&&!row.value1){ |
| | | // 赋值内端 |
| | | this.$set(row,'comValue',Number(row.value0).toFixed(3)) |
| | | }else if(!row.value0&&row.value1){ |
| | | // 赋值外端 |
| | | this.$set(row,'comValue',Number(row.value1).toFixed(3)) |
| | | }else if(row.value0&&row.value1){ |
| | | // 赋值计算值 |
| | | this.$set(row,'comValue',((Number(row.value0)+Number(row.value1))/2).toFixed(3)) |
| | | }else{ |
| | | return |
| | | } |
| | | // 赋值到传到后端的参数---特殊项目必须严格按照这种格式传参,否则后端识别不了 |
| | | // 赋值内外端 |
| | | this.param[row.id].insValue = [ |
| | | { |
| | | i:row.id, |
| | |
| | | } |
| | | } |
| | | ] |
| | | // 赋值计算值 |
| | | this.param[row.id].comValue = [{ |
| | | i:row.id, |
| | | v:{ |
| | | v:row.comValue |
| | | } |
| | | }] |
| | | // 判断结果,得出结论 |
| | | if(this.wareForm.inspectionItemSubclass!='20(常温)'){ |
| | | // 给页面列表赋值最终值 |
| | | row.resValue = row.comValue?Math.abs(row.comValue-Number(row.insProduct.complue)).toFixed(3):'' |
| | | // 给传递到后端的参数赋值最终值 |
| | | this.param[row.id].resValue.v.v = row.resValue |
| | | // 判断结论,给页面列表赋值结论 |
| | | if(row.ask&&row.resValue){ |
| | | if(row.ask.includes('<')){ |
| | | row.insResult = row.resValue<row.ask.split('<')[1]?1:0 |
| | |
| | | }else if(row.ask.includes('≤')){ |
| | | row.insResult = row.resValue<=row.ask.split('≤')[1]?1:0 |
| | | } |
| | | // 给传递到后端的参数赋值结论 |
| | | this.param[row.id].insResult.v.v = row.insResult |
| | | } |
| | | }else{ |
| | | // 20(常温)默认合格 |
| | | this.param[row.id].insResult.v.v = 1 |
| | | } |
| | | this.$refs.wareTableData.doLayout() |
| | | // 进行数据的保存 |
| | | this.saveInsContext() |
| | | }, |
| | | // 当循环次数、温度点变化、PK8000数采时会调用,主要是获取信息进行回显 |
| | | wareFormChange(m,type){ |
| | | if(this.PROJECT!='检测中心'||!this.tableLists.find(m=>m.templateId==this.currentTable)||this.tableLists.find(m=>m.templateId==this.currentTable).templateName!='温度循环检验原始记录'){ |
| | | return |
| | |
| | | if (res.code == 201) return |
| | | let {productVos,sampleVo} = res.data |
| | | this.wareForm0 = sampleVo |
| | | // 初始化传到后端的参数 |
| | | productVos = productVos.map(m=>{ |
| | | let obj = {...m,...m.insProduct} |
| | | this.param[obj.id] = { |
| | |
| | | } |
| | | } |
| | | let insProductResult = obj.insProductResult |
| | | // 给传递到后端的参数进行赋值,给页面数据赋值 |
| | | if(insProductResult){ |
| | | for(let i in insProductResult){ |
| | | switch (i) { |
| | | // 检验值赋值 |
| | | case 'insValue': |
| | | let insValue = JSON.parse(insProductResult[i]) |
| | | if(insValue&&insValue.length>1){ |
| | | // 后端的参数进行赋值 |
| | | this.param[obj.id].insValue = [ |
| | | { |
| | | i:obj.id, |
| | |
| | | } |
| | | } |
| | | ] |
| | | // 页面数据赋值 |
| | | obj.value0 = insValue[0].v |
| | | obj.value1 = insValue[1].v |
| | | }else if(insValue&&insValue.length==1){ |
| | | // 后端的参数进行赋值 |
| | | this.param[obj.id].insValue = [ |
| | | { |
| | | i:obj.id, |
| | |
| | | } |
| | | } |
| | | ] |
| | | // 页面数据赋值 |
| | | obj.value0 = insValue[0].v |
| | | obj.value1 = '' |
| | | } |
| | | break; |
| | | // 计算值赋值 |
| | | case 'comValue': |
| | | let comValue = JSON.parse(insProductResult[i]) |
| | | if(comValue&&comValue.length>0){ |
| | | // 后端的参数进行赋值 |
| | | this.param[obj.id].comValue = [ |
| | | { |
| | | i:obj.id, |
| | |
| | | } |
| | | } |
| | | ] |
| | | // 页面数据赋值 |
| | | obj.comValue = comValue[0].v |
| | | } |
| | | break; |
| | |
| | | break; |
| | | } |
| | | } |
| | | // 最终值赋值 |
| | | // 后端的参数进行赋值 |
| | | this.param[obj.id].resValue = { |
| | | i:obj.id, |
| | | v:{ |
| | | v:obj.lastValue |
| | | } |
| | | } |
| | | // 页面数据赋值 |
| | | obj.resValue = obj.lastValue |
| | | // 结论赋值 |
| | | // 后端的参数进行赋值 |
| | | this.param[obj.id].insResult = { |
| | | i:obj.id, |
| | | v:{ |
| | |
| | | } |
| | | return obj |
| | | }) |
| | | // 以下是对温度循环页面呈现进行处理,去重、数据重置等等 |
| | | let arr = [] |
| | | let arr0 = [] |
| | | let mySet = new Set() |
| | |
| | | } |
| | | arr2.push(obj) |
| | | }) |
| | | // 这是页面最终呈现的格式 |
| | | this.wareTableData = arr2 |
| | | }) |
| | | // 获取设备列表 |
| | | this.getEquipOptions(true,this.currentSample.insProduct[0].id) |
| | | // this.$refs.wareTableData&&this.$refs.wareTableData.doLayout() |
| | | }, |
| | | // 温度循环---结束 |
| | | // 热循环---开始 |
| | | // 循环次数切换时调用 |
| | | thermalCyclingChange(){ |
| | | this.thermalCyclingLoading = true |
| | | this.$axios.post(this.$api.insOrderPlan.temCycle,{ |
| | |
| | | } |
| | | if(productVos.length>0){ |
| | | this.thermalCyclingInfo.inspectionItemClass = productVos[0].insProduct.inspectionItemClass |
| | | // 根据检验项,初始化传到后端的参数 |
| | | productVos.forEach(item=>{ |
| | | this.param[item.insProduct.id] = { |
| | | insValue: [], |
| | |
| | | let obj = {...item,...item.insProduct} |
| | | let insProductResult = obj.insProductResult |
| | | if(insProductResult){ |
| | | // 给页面列表赋值,给后端传参赋值 |
| | | for(let i in insProductResult){ |
| | | switch (i) { |
| | | case 'insValue': |
| | | // 给页面列表赋值 |
| | | let insValue = JSON.parse(insProductResult[i]) |
| | | if(insValue&&insValue.length>0){ |
| | | this.thermalCyclingInfo.length = 0 |
| | |
| | | a.insResult = obj.insResult |
| | | } |
| | | }) |
| | | // 给后端传参赋值 |
| | | this.param[obj.id].insValue = [] |
| | | insValue.forEach(m=>{ |
| | | this.param[obj.id].insValue.push({ |
| | |
| | | break; |
| | | } |
| | | } |
| | | // 给后端传参赋值 |
| | | this.param[obj.id].insResult = { |
| | | i:obj.id, |
| | | v:{ |
| | |
| | | } |
| | | } |
| | | }else{ |
| | | // 给页面列表赋值 |
| | | this.thermalCyclingInfo.arr.forEach(a=>{ |
| | | a.insResult = null |
| | | a.arr = [] |
| | |
| | | } |
| | | }) |
| | | } |
| | | // 获取设备列表 |
| | | this.getEquipOptions(true,this.currentSample.insProduct[0].id) |
| | | }) |
| | | }, |
| | | // 添加检验值 |
| | | handleAddThermal(){ |
| | | this.thermalCyclingInfo.length++ |
| | | this.thermalCyclingInfo.arr.forEach(item=>{ |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | // 删除检验值 |
| | | handleDeleteThermal(){ |
| | | if(this.thermalCyclingInfo.length==1){ |
| | | this.$message.error('最后一条数据不能删除') |
| | |
| | | this.thermalCyclingInfo.arr.forEach(item=>{ |
| | | item.arr.pop() |
| | | }) |
| | | // 删除后需要保存一下数据 |
| | | this.saveThermalCycling(true,{name:'导线温度'},true) |
| | | } |
| | | }, |
| | |
| | | num0 = c.arr[i].value0 |
| | | } |
| | | }) |
| | | // 判断结论 |
| | | if(!num0||!b.value0){ |
| | | b.state = null |
| | | }else if(Number(num0)>Number(b.value0)){ |
| | |
| | | let state0 = a.arr.filter(b=>b.state==0).length |
| | | let state1 = a.arr.filter(b=>b.state==1).length |
| | | if(state>0){ |
| | | // 待定 |
| | | a.insResult = null |
| | | }else if(state0>0){ |
| | | // 不合格 |
| | | a.insResult = 0 |
| | | }else if(state1==a.arr.length){ |
| | | // 合格 |
| | | a.insResult = 1 |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | } |
| | | // 赋值 |
| | | // 给后端传参赋值 |
| | | this.thermalCyclingInfo.arr.forEach(item=>{ |
| | | for (let i in this.param){ |
| | | if(this.param[i].inspectionItemSubclass==item.name){ |
| | |
| | | } |
| | | } |
| | | }) |
| | | // console.log(1111,this.param) |
| | | // 保存数据 |
| | | this.saveInsContext() |
| | | }, |
| | | // 热循环---结束 |
| | | // 保存湿度、温度数据 |
| | | subOtherForm(m,type){ |
| | | let ids = [] |
| | | for (let i in this.param) { |
| | |
| | | this.$message.success('保存成功') |
| | | }) |
| | | }, |
| | | // 权限获取 |
| | | getPower(){ |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |
| | | let fileDel = false |
| | | let fileAdd = false |
| | | let collected = false |
| | | let temDataAcquisition = false |
| | | let addInsProductTemplatePower = false; |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == 'uploadFile') { |
| | | fileAdd = true |
| | |
| | | if (power[i].menuMethod == 'temDataAcquisition') { |
| | | temDataAcquisition = true |
| | | } |
| | | if(power[i].menuMethod == 'addInsProductTemplate'){ |
| | | addInsProductTemplatePower = true |
| | | } |
| | | } |
| | | if (!fileDel) { |
| | | this.componentData0.do.splice(1, 1) |
| | |
| | | this.fileAdd = fileAdd |
| | | this.collected = collected |
| | | this.temDataAcquisition = temDataAcquisition |
| | | this.addInsProductTemplatePower = addInsProductTemplatePower |
| | | }, |
| | | uploadSample(){ |
| | | this.$axios.post(this.$api.insOrderPlan.doInsOrder, { |
| | |
| | | this.sampleProduct = res.data.sampleProduct |
| | | }) |
| | | }, |
| | | // 根据类型、任务id、实验室来获取样品的检验项信息 |
| | | async getCurrentProduct(id,type){ |
| | | this.tableLoading = true; |
| | | let res = await this.$axios.post(this.$api.insOrderPlan.getInsProduct+'?id='+id+'&type='+type+'&laboratory='+this.sonLaboratory) |
| | | let res = null; |
| | | if(!this.isLook){ |
| | | res = await this.$axios.post(this.$api.insOrderPlan.getInsProduct+'?id='+id+'&type='+type+'&laboratory='+this.sonLaboratory) |
| | | }else{ |
| | | res = await this.$axios.post(this.$api.insOrderPlan.getInsProduct2+'?id='+id+'&type='+type+'&laboratory='+this.sonLaboratory+'&num='+this.num) |
| | | } |
| | | this.tableLoading = false; |
| | | return res.data |
| | | }, |
| | | handleChangeBushing(row, column, event){ |
| | | this.currentBushing = row; |
| | | this.fiberOpticTape = [] |
| | | this.currentFiberOpticTape = null; |
| | | this.fiberOptic = [] |
| | | this.currentFiberOptic = null; |
| | | if(row.fiber&&row.fiber.length>0){ |
| | | // 直接配置光纤 |
| | | this.fiberOptic = row.fiber; |
| | | }else if(row.fibers&&row.fibers.length>0){ |
| | | // 配置光纤带后,再配置光纤 |
| | | this.fiberOpticTape = row.fibers; |
| | | } |
| | | this.bushingVisible = false; |
| | | this.currentKey0 = row.index |
| | | }, |
| | | async handleChangeOptic(row, column, event){ |
| | | this.currentFiberOptic = row; |
| | | this.currentFiberOptic.productList.forEach(a => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | } |
| | | }) |
| | | this.fiberOpticVisible = false; |
| | | let list = await this.getCurrentProduct(row.id,2) |
| | | this.getTableLists0(list) |
| | | this.currentKey2 = row.index |
| | | }, |
| | | async handleChangeTape(row, column, event){ |
| | | this.currentFiberOpticTape = row; |
| | | this.param = {} |
| | | this.fiberOptic = [] |
| | | this.currentFiberOptic = null; |
| | | this.currentFiberOpticTape.productList.forEach(a => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | } |
| | | }) |
| | | this.fiberOpticTapeVisible = false; |
| | | let list = await this.getCurrentProduct(row.id,1) |
| | | this.getTableLists0(list) |
| | | if(row.fiber&&row.fiber.length>0){ |
| | | // 配置光纤 |
| | | this.fiberOptic = row.fiber; |
| | | } |
| | | this.currentKey1 = row.index |
| | | }, |
| | | // 切换样品 |
| | | async handleChangeSample(row, column, event) { |
| | | // 初始化数据 |
| | | this.param = {} |
| | | // 清空光纤配置相关数据 |
| | | this.fiberOpticTape = [] |
| | | this.template = '' |
| | | this.currentFiberOpticTape = null; |
| | | this.fiberOptic = [] |
| | | this.currentFiberOptic = null; |
| | | this.bushing = [] |
| | | this.currentBushing = null; |
| | | 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 => { |
| | | this.currentSample.insProduct.forEach((a,j) => { |
| | | if(this.handleCasing(a.inspectionItem)){ |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | insResult: null, |
| | | beforeCheck:null, |
| | | afterCheck:null, |
| | | } |
| | | } |
| | | }) |
| | | this.getReportModel(row.id) |
| | | let bushing = this.currentSample.bushing |
| | | if(bushing&&bushing.length>0){ |
| | | this.bushing = bushing |
| | | } |
| | | // this.handleTableData() |
| | | // 处理页面列表数据 |
| | | this.getTableLists(); |
| | | this.currentKey = row.index |
| | | this.currentKey = row.index?row.index:0 |
| | | this.currentTab = null; |
| | | // 向多线程去保存页面列表数据,后端传参,当前模板信息 |
| | | this.worker.postMessage(JSON.stringify({ |
| | | type: 'saveData', |
| | | tableList:this.tableList, |
| | |
| | | currentTable:this.currentTable |
| | | })); |
| | | }, |
| | | // 松套管的判断\如果changeType不等于3那么页面不展示松套管检验项 |
| | | handleCasing(inspectionItem){ |
| | | if(this.changeType!=3){ |
| | | if(inspectionItem.includes('松套管')){ |
| | |
| | | return true |
| | | } |
| | | }, |
| | | getReportModel(id){ |
| | | if(this.PROJECT!='检测中心'){ |
| | | return |
| | | } |
| | | this.getReportModelLoading = true |
| | | this.$axios.post(this.$api.insOrderPlan.getReportModel+'?sampleId='+id, {}).then(res => { |
| | | this.getReportModelLoading = false |
| | | this.fibers = res.data['光纤带'] |
| | | this.fiber = res.data['光纤'] |
| | | this.casing = res.data['套管'] |
| | | }) |
| | | }, |
| | | // 套管,光纤带,光纤等切换,对应原始记录模板也要切换 |
| | | async handleChange(m,type){ |
| | | this.changeType = type |
| | | if(m){ |
| | | // 获取检验项 |
| | | let list = await this.getCurrentProduct(m,type) |
| | | if(list.length>0){ |
| | | // 初始化后端传参 |
| | | this.param = {} |
| | | list.forEach(a => { |
| | | this.param[a.id] = { |
| | |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | insResult: null, |
| | | beforeCheck:null, |
| | | afterCheck:null, |
| | | } |
| | | }) |
| | | // 页面列表数据处理 |
| | | this.getTableLists0(list) |
| | | this.getReportModel(this.currentSample.id) |
| | | // 向多线程保存数据 |
| | | this.worker.postMessage(JSON.stringify({ |
| | | type: 'saveData', |
| | | tableList:this.tableList, |
| | |
| | | } |
| | | } |
| | | }, |
| | | // 改变任务 |
| | | handleChangeTask(row) { |
| | | if (row.length > 0) this.id = row[0].id; |
| | | this.taskVisible = false; |
| | | }, |
| | | // 字典获取信息 |
| | | getTypeDicts() { |
| | | this.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | | category: "紧急程度" |
| | |
| | | this.componentData.tagField.type.select = data |
| | | }) |
| | | }, |
| | | // 字典获取信息 |
| | | getInsStateDicts() { |
| | | this.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | | category: "检验任务状态" |
| | |
| | | this.componentData.tagField.insState.select = data |
| | | }) |
| | | }, |
| | | // 字典获取信息 |
| | | getComparisonList() { |
| | | this.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | | category: "表格坐标转换" |
| | |
| | | this.comparisonList = data; |
| | | }) |
| | | }, |
| | | // 获取检验值为下拉时的下拉列表 |
| | | selectEnumByCategoryOfSelect(val) { |
| | | this.enumList = [] |
| | | if (val === undefined || val === null) { |
| | |
| | | }) { |
| | | row.index = rowIndex + 1; |
| | | }, |
| | | // 处理页面列表数据--去重,生成检验模板切换列表 |
| | | getTableLists() { |
| | | const mySet1 = new Set(); |
| | | this.tableLists = this.currentSample.insProduct.filter(m => { |
| | |
| | | this.tableList = null; |
| | | this.tableList = [this.tableLists[0]] |
| | | this.currentTable = this.tableLists[0].templateId; |
| | | if(this.tableLists.find(m=>m.templateId==this.currentTable)&&this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('电路试验')&&this.currentTableState!=0&&this.currentTableState!=1&&this.insOrder.sampleType!='无源器件'){ |
| | | this.versionDialogVisible = true |
| | | } |
| | | // 处理页面列表数据 |
| | | this.handleTableData() |
| | | } |
| | | }, |
| | |
| | | this.tableList = [this.tableLists[0]] |
| | | this.currentTable = this.tableLists[0].templateId; |
| | | this.currentSample.insProduct = this.HaveJson(list) |
| | | // 处理页面列表数据 |
| | | this.handleTableData() |
| | | } |
| | | }, |
| | | // 处理页面列表数据 |
| | | handleTableData() { |
| | | this.excelMethodList = [] |
| | | this.widthList = this.tableList[0].style.columnlen; |
| | | this.excelMethodList = []//excel函数列表 |
| | | this.widthList = this.tableList[0].style.columnlen;//页面宽度--根据模板来的 |
| | | // 温度循环检验原始记录--开始 |
| | | if(this.tableLists.find(m=>m.templateId==this.currentTable)&&this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='温度循环检验原始记录'){ |
| | | // 对要求值进行拆分处理,进而得出页面内容 |
| | | let ask = this.currentSample.insProduct[0].ask |
| | | let askList = ask.split(';') |
| | | // 获取循环次数 |
| | | this.numOptions = [] |
| | | for (let i = 1; i <= askList[askList.length-1]; i++) { |
| | | this.numOptions.push({ |
| | |
| | | mySet1.add(m.split(',')[0].replace('℃','')) |
| | | } |
| | | }) |
| | | // 获取温度点列表 |
| | | this.temperatureOptions = [] |
| | | mySet1.forEach(m => { |
| | | this.temperatureOptions.push({ |
| | |
| | | label:m |
| | | }) |
| | | }) |
| | | // 初始化页面数据 |
| | | this.wareTableDataLoading = true |
| | | this.$axios.post(this.$api.deviceScope.temDataAcquisition2,{ |
| | | entrustCode:this.insOrder.entrustCode, |
| | |
| | | // 温度循环检验原始记录---结束 |
| | | // 热循环检验原始记录---开始 |
| | | if(this.tableLists.find(m=>m.templateId==this.currentTable)&&(this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('热循环')||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('温升试验'))){ |
| | | // 根据要求值拆分数据,得到页面渲染的信息 |
| | | let ask = this.currentSample.insProduct[0].ask |
| | | let askList = ask.split(';') |
| | | this.thermalCyclingInfo.max = Number(askList[askList.length-1]) |
| | |
| | | return obj |
| | | }) |
| | | this.thermalCyclingInfo.arr = arr; |
| | | // console.log(this.thermalCyclingInfo) |
| | | // 初始化页面数据 |
| | | this.thermalCyclingChange() |
| | | } |
| | | // 热循环检验原始记录---结束 |
| | | // 本次循环主要做页面渲染层面的处理--单元格合并预处理 |
| | | this.tableList.forEach(a => { |
| | | let mcList = [] |
| | | a.template.forEach(b => { |
| | |
| | | count++ |
| | | }) |
| | | }) |
| | | // 本次循环主要是控制合并,以及控制检验项信息是否展示出来,以便后续检验 |
| | | this.tableList.forEach(a => { |
| | | let dels = new Set() |
| | | let ids = [] |
| | | let dels = new Set()//需要删除的行 |
| | | let ids = []//所有检验项的id |
| | | let set3 = new Set() |
| | | a.template.forEach(b => { |
| | | let size1 = set3.size |
| | |
| | | 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){ |
| | | // 三级分类 |
| | |
| | | .insProduct[i].inspectionItemSubclass==null||this.currentSample |
| | | .insProduct[i].inspectionItemSubclass==undefined?'':this.currentSample |
| | | .insProduct[i].inspectionItemSubclass |
| | | // 如果相等,那么说明找到了,并且把id存起来,后续检验项也会在页面中显示出来 |
| | | if (this.currentSample.insProduct[i].templateId === a.templateId && inspectionItemClass +inspectionItem+inspectionItemSubclass === |
| | | str) { |
| | | ids.push({ |
| | |
| | | } |
| | | } |
| | | }) |
| | | // 操作删除 |
| | | dels.forEach(del => { |
| | | for (let b = 0; b < a.template.length; b++) { |
| | | if (a.template[b].r === del) { |
| | |
| | | } |
| | | } |
| | | }) |
| | | console.log(4444,a.template) |
| | | // 操作赋值--主要赋值单位,试验方法等信息 |
| | | ids.forEach(id => { |
| | | for (let b = 0; b < a.template.length; b++) { |
| | | if (a.template[b].r === id.r) { |
| | |
| | | .ps.value === '检测方法')) { |
| | | a.template[b].v.v = id.product.methodS |
| | | } |
| | | // if (a.template[b].v.ps != undefined && (a.template[b].v.ps.value === '试验标准')) { |
| | | // a.template[b].v.v = id.product.testRequirements |
| | | // } |
| | | } |
| | | } |
| | | }) |
| | | let set2 = new Set() |
| | | // 合并的数据处理,cs rs 代表合并的数量 |
| | | a.template.forEach(b => { |
| | | let size1 = set2.size |
| | | let size2 = set2.add(b.mc).size |
| | |
| | | } |
| | | }) |
| | | }) |
| | | // 本次循环主要是对后端传参进行初始化,样式逻辑修改 |
| | | 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 === '最终值') |
| | | // 结论与最终值在这里一一对应,以下两个列表长度肯定是一样的,如果有不一样,那么多半是模板配置得问题 |
| | | 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].insValue.push(b) |
| | | 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].comValue.push(b) |
| | | 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].equipValue.push(b) |
| | | 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].equipName.push(b) |
| | | 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) { |
| | | for (var c in this.param) { |
| | | this.param[c].resValue = b |
| | | } |
| | | } else { |
| | | this.param[b.i].resValue = b |
| | | } */ |
| | | if (b.i !== undefined&&!this.param[b.i].resValue) { |
| | | 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].insResult) { |
| | | if (b.i !== undefined&&this.param[b.i]&&!this.param[b.i].insResult) { |
| | | this.param[b.i].insResult = b |
| | | conclusionList.forEach((n, i) => { |
| | | if (n.r == b.r && n.c == b.c) { |
| | | b.v.f = |
| | | `(${this.comparisonList.find(j=>j.value==(finalList[i].c)).label}${finalList[i].r+1})` |
| | | |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === '试验前样品检查') { |
| | | // b.v.v = '' |
| | | this.$set(b.v, 'v', '' ) |
| | | this.param[b.i].beforeCheck = b |
| | | } |
| | | if (b.v.ps != undefined && b.v.ps.value === '试验后样品检查') { |
| | | // b.v.v = '' |
| | | this.$set(b.v, 'v', '' ) |
| | | this.param[b.i].afterCheck = b |
| | | } |
| | | set.add(b.r) |
| | | // 如果模板列表的函数存在,那么加入到excel函数列表里面 |
| | | if (b.v.f) { |
| | | this.excelMethodList.push(b) |
| | | } |
| | | }) |
| | | // 以下是样式处理逻辑 |
| | | set = Array.sort(set) |
| | | set.forEach(b => { |
| | | let arr = [] |
| | |
| | | this.tableWidth += (a.style.columnlen[i] === undefined ? 100 : a.style.columnlen[i]) |
| | | } |
| | | }) |
| | | // 本次循环主要是对页面及后端传参进行初始化赋值 |
| | | this.currentSample.insProduct.forEach(async a => { |
| | | try { |
| | | // 计算值赋值 |
| | | let comValue = JSON.parse(a.insProductResult.comValue) |
| | | for (var i = 0; i < comValue.length; i++) { |
| | | this.param[a.id].comValue[i].v.v = this.toFixed(comValue[i].v,this.param[a.id].comValue[i].v.ct) |
| | | } |
| | | } catch (e) {} |
| | | try { |
| | | // 检验值赋值 |
| | | let insValue = JSON.parse(a.insProductResult.insValue) |
| | | for (let i = 0; i < insValue.length; i++) { |
| | | if(this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r)){ |
| | |
| | | } |
| | | } catch (e) {} |
| | | try { |
| | | // 设备编号赋值 |
| | | let equipValue = JSON.parse(a.insProductResult.equipValue) |
| | | if(this.tableLists.find(m=>m.templateId==this.currentTable)&&(this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='温度循环检验原始记录'||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('热循环')||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('温升试验'))){ |
| | | // 特殊项目初始化 |
| | | this.param[a.id].equipValue = [] |
| | | for (let i = 0; i < equipValue.length; i++) { |
| | | this.param[a.id].equipValue.push({ |
| | |
| | | this.$set(this.equipForm,`code`+i,equipValue[i].v) |
| | | this.param[a.id].equipValue[i].v.v = equipValue[i].v |
| | | }else{ |
| | | // 普通设备赋值 |
| | | this.param[a.id].equipValue[i].v.v = equipValue[i].v |
| | | } |
| | | } |
| | | } catch (e) {} |
| | | try { |
| | | // 设备名称赋值 |
| | | let equipName = JSON.parse(a.insProductResult.equipName) |
| | | // console.log(2222222,equipName) |
| | | if(this.tableLists.find(m=>m.templateId==this.currentTable)&&(this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='温度循环检验原始记录'||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('热循环')||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('温升试验'))){ |
| | | // 设备名称初始化 |
| | | this.param[a.id].equipName = [] |
| | | for (let i = 0; i < equipName.length; i++) { |
| | | this.param[a.id].equipName.push({ |
| | |
| | | } |
| | | for (let i = 0; i < equipName.length; i++) { |
| | | if(this.tableLists.find(m=>m.templateId==this.currentTable)&&(this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='温度循环检验原始记录'||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('热循环')||this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('温升试验'))){ |
| | | console.log(2222222,equipName) |
| | | // 温度循环赋值 |
| | | this.$set(this.equipForm,`value`+i,equipName[i].v) |
| | | this.param[a.id].equipName[i].v.v = equipName[i].v |
| | | }else{ |
| | | // 普通设备名称赋值 |
| | | this.param[a.id].equipName[i].v.v = equipName[i].v |
| | | } |
| | | } |
| | | } catch (e) {} |
| | | 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) {} |
| | | // 最终值赋值 |
| | | this.param[a.id].resValue = {v:{v:a.lastValue}} |
| | | // 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}} |
| | | // this.param[a.id].insResult.v.v = a.insResult |
| | | // 检验前样品检查赋值 |
| | | this.param[a.id].afterCheck.v.v = a.insProductResult.afterCheck |
| | | // 检验后样品检查赋值 |
| | | this.param[a.id].beforeCheck.v.v = a.insProductResult.beforeCheck |
| | | } catch (e) { |
| | | console.log('error',e) |
| | | } |
| | | }) |
| | | // 对excel函数进行处理 |
| | | this.handleExcelMethod() |
| | | }, |
| | | // 检验值输入后触发的函数 |
| | | changeInput(m, code, n,getDataType) { |
| | | // 为数采定义一个逻辑参数 |
| | | if(getDataType=='getDataType'){ |
| | | this.getDataType = 2; |
| | | } |
| | | // let str = code.split('-') |
| | | // let pId = str[3] |
| | | // if(!this.param[pId].equipValue||this.param[pId].equipValue.length==0||!this.param[pId].equipValue[0].v.v){ |
| | | // let inspectionItem = '' |
| | | // let idS = [] |
| | | // let child = 0 |
| | | // for (let i in this.currentSample.insProduct) { |
| | | // if(this.currentSample.insProduct[i].id==pId){ |
| | | // inspectionItem = this.currentSample.insProduct[i].inspectionItem |
| | | // } |
| | | // } |
| | | // for (let i in this.currentSample.insProduct) { |
| | | // if(this.currentSample.insProduct[i].inspectionItem==inspectionItem&&this.currentSample.insProduct[i].id!=pId){ |
| | | // idS.push(this.currentSample.insProduct[i].id) |
| | | // } |
| | | // } |
| | | // for (let i = 0;i<idS.length;i++) { |
| | | // if(this.param[idS[i]].equipValue&&this.param[idS[i]].equipValue.length>0&&this.param[idS[i]].equipValue[0].v.v){ |
| | | // child++ |
| | | // } |
| | | // } |
| | | // if(child==0){ |
| | | // n.v.v = null |
| | | // this.$message.error('请先填写设备信息') |
| | | // return |
| | | // } |
| | | // } |
| | | let str = code.split('-') |
| | | let pId = str[3] |
| | | for(let i =0;i<this.currentSample.insProduct.length;i++){ |
| | | if(this.currentSample.insProduct[i].id==pId&&(this.currentSample.insProduct[i].ask=='-'||this.currentSample.insProduct[i].ask=='/'||this.currentSample.insProduct[i].ask=='—')){ |
| | | this.tableList[0].arr.forEach(item=>{ |
| | | item.forEach(m=>{ |
| | | if(m.i==pId&&m.v.ps&&m.v.ps.value=='结论'){ |
| | | this.$set(m.v,'v',3) |
| | | } |
| | | }) |
| | | }) |
| | | if(this.param[pId].insResult&&this.param[pId].insResult.v){ |
| | | this.param[pId].insResult.v.v = 3 |
| | | } |
| | | this.saveInsContext() |
| | | return |
| | | } |
| | | } |
| | | // this.currentTable. |
| | | // if(!this.param[pId].equipValue||this.param[pId].equipValue.length==0||!this.param[pId].equipValue[0].v.v){} |
| | | let currentInsItemId = null//当前检验项id |
| | | if (n) { |
| | | // if (this.PROJECT === '装备电缆') { |
| | | // let num2 = new this.$Big(n.v.v) |
| | | // n.v.v = num2.toExponential() |
| | | // } |
| | | currentInsItemId = JSON.parse(JSON.stringify(n.i)) |
| | | // 需要科学计数法的可以走这里 |
| | | if (this.PROJECT === '检测中心') { |
| | | if(this.tableList.find(ele=>ele.inspectionItem=='体积电阻率')){ |
| | | if(parseFloat(n.v.v)>=100000){ |
| | | let num2 = new this.$Big(n.v.v) |
| | | n.v.v = num2.toExponential() |
| | | } |
| | | } |
| | | } |
| | | // 定义一个函数来验证分数是否有效 |
| | | function isValidFraction(fraction) { |
| | | const [numerator, denominator] = fraction.split('/'); // 分子和分母 |
| | | return !(!denominator || !numerator); |
| | | } |
| | | console.log("aaa------>>>>",n); |
| | | const isTrue = isValidFraction(n.v.v) |
| | | if (!isTrue) { |
| | | n.v.v = n.v.v.replace('/', '') |
| | | } |
| | | } |
| | | // 通信特殊处理,检验值填入之后直接保存数据,判断结果默认为3 |
| | | for (var i in this.param){ |
| | | this.param[i].insResult = {v:{v:3}} |
| | | } |
| | | this.saveInsContext(n.i) |
| | | return; |
| | | // 以下是正常的判断流程,后面有需要则进入此流程 |
| | | try { |
| | | // 向 Worker 发送消息,开始处理逻辑 |
| | | this.worker.postMessage(JSON.stringify({ |
| | |
| | | } catch (error) { |
| | | console.log(444,error); |
| | | } |
| | | |
| | | // 监听 Worker 返回的结果 |
| | | this.worker.onmessage = (event) => { |
| | | this.result = JSON.parse(event.data); |
| | |
| | | // 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 |
| | | } |
| | | // console.log(this.result,123); |
| | | // 特殊处理一下结论,会有这种特殊情况 |
| | | 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=='合格'){ |
| | |
| | | } |
| | | } |
| | | } |
| | | console.log(99999,this.result.value.getDataTypeId) |
| | | if(this.isGet&&!this.dataAcquisitionEidtAble){ |
| | | if(this.result.value.getDataTypeId==''){ |
| | | return |
| | | } |
| | | setTimeout(()=>{ |
| | | this.saveInsContext() |
| | | },2000) |
| | | }else if(this.isGet&&this.dataAcquisitionEidtAble){ |
| | | if(this.getDataType==1){ |
| | | if(this.result.value.getDataTypeId==''){ |
| | | return |
| | | } |
| | | setTimeout(()=>{ |
| | | this.saveInsContext() |
| | | },2000) |
| | | }else{ |
| | | this.saveInsContext() |
| | | } |
| | | }else{ |
| | | this.saveInsContext() |
| | | } |
| | | this.saveInsContext(currentInsItemId) |
| | | }) |
| | | break; |
| | | case 'tableList': |
| | | this.$nextTick(()=>{ |
| | | // 更新数据 |
| | | this.$delete(this.tableList[0],'arr') |
| | | this.$set(this.tableList[0],'arr',this.result.value[0].arr) |
| | | }) |
| | | break; |
| | | case 'getCurrentInsProduct': |
| | | // 更新页面数据 |
| | | this.getCurrentInsProduct(this.result.value) |
| | | break; |
| | | } |
| | | }; |
| | | }, |
| | | // 是否需要数采 |
| | | async determineWhetherToCollectData(){ |
| | | let res = await this.$axios.get(this.$api.deviceScope.determineWhetherToCollectData+"?managementNumber=''") |
| | | this.isGet = res.data |
| | | }, |
| | | handleFraction(str){ |
| | | if(str&&typeof(str)=='string'&&str.includes('/')){ |
| | | return eval(str.split('/')[0]/str.split('/')[1]) |
| | | } else if (str && typeof(str) == 'string' && str.includes('*') && str.includes('^')) { |
| | | const num1 = str.split('*') |
| | | const num2 = num1[1].split('^') |
| | | let num3 = new this.$Big(num2[0]); |
| | | let num4 = new this.$Big(num2[1]); |
| | | let num5 = Math.pow(num3, num4) // 计算次方 |
| | | return num1[0] * num5 // 最后计算乘法 |
| | | } else{ |
| | | return str |
| | | } |
| | | }, |
| | | // 根据后端传参更新页面数据 param => this.tableList[0].insProductResult |
| | | getCurrentInsProduct(pId) { |
| | | if (!this.tableList[0].insProductResult) { |
| | | this.tableList[0].insProductResult = {} |
| | |
| | | let value = this.param[pId][m] |
| | | switch (m) { |
| | | case 'comValue': |
| | | // 赋值计算值 |
| | | if (value && value.length > 0) { |
| | | this.tableList[0].insProductResult[m] = []; |
| | | value.forEach((a, i) => { |
| | |
| | | } |
| | | } |
| | | break; |
| | | // 赋值检验值 |
| | | case 'insValue': |
| | | if (value && value.length > 0) { |
| | | this.tableList[0].insProductResult[m] = []; |
| | |
| | | } |
| | | } |
| | | break; |
| | | // 赋值设备编号 |
| | | case 'equipValue': |
| | | if (value && value.length > 0) { |
| | | this.tableList[0].insProductResult[m] = []; |
| | |
| | | } |
| | | } |
| | | break; |
| | | // 赋值设备名称 |
| | | case 'equipName': |
| | | if (value && value.length > 0) { |
| | | this.tableList[0].insProductResult[m] = []; |
| | |
| | | } |
| | | } |
| | | 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; |
| | | }) |
| | | } |
| | | }, |
| | | median(arr) { |
| | | // 对数组进行排序 |
| | | const sortedArr = arr.sort((a, b) => a - b); |
| | | // 计算数组长度的一半 |
| | | const half = Math.floor(sortedArr.length / 2); |
| | | // 如果数组长度为奇数,返回中间的元素;如果为偶数,返回中间两个元素的平均值 |
| | | if (sortedArr.length % 2) { |
| | | // 奇数位置的元素 |
| | | return sortedArr[half]; |
| | | } else { |
| | | // 偶数位置的平均值 |
| | | return (sortedArr[half - 1] + sortedArr[half]) / 2; |
| | | } |
| | | }, |
| | | 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] |
| | |
| | | } |
| | | return str |
| | | }, |
| | | // 获取当前输入框类型 |
| | | getInspectionValueType(id) { |
| | | for (var a in this.currentSample.insProduct) { |
| | | if (this.currentSample.insProduct[a].id == id) { |
| | |
| | | } |
| | | } |
| | | }, |
| | | // 获取要求描述 |
| | | getTell(id) { |
| | | for (var a in this.currentSample.insProduct) { |
| | | if (this.currentSample.insProduct[a].id == id) { |
| | |
| | | } |
| | | } |
| | | }, |
| | | // 动态获取单元格宽度 |
| | | handleWidth(n) { |
| | | let sum = 0; |
| | | if (n.v.mc && n.v.mc.cs && n.v.mc.c != undefined) { |
| | |
| | | } |
| | | return sum |
| | | }, |
| | | // 对输入值进行格式校验 |
| | | handleInput (n) { |
| | | try { |
| | | n.v.v = n.v.v.replace(/[^\d.^e\-/+]/g, ''); |
| | |
| | | } |
| | | } |
| | | }, |
| | | // 获取要求值 |
| | | getAsk(id) { |
| | | for (var a in this.currentSample.insProduct) { |
| | | if (this.currentSample.insProduct[a].id == id) { |
| | |
| | | } |
| | | } */ |
| | | }, |
| | | // 获取设备 |
| | | getEquipOptions(e, id) { |
| | | if (e) { |
| | | this.equipOptions = [] |
| | |
| | | }) |
| | | }, |
| | | // 复核 |
| | | upInsReview(e) { |
| | | if (e == 1) { |
| | | // 通过 |
| | | upInsReview() { |
| | | if (this.upInsReviewType == 1||this.upInsReviewType==2) { |
| | | // 继续试验 |
| | | this.reviewLoading = true; |
| | | this.$axios.post(this.$api.insOrderPlan.verifyPlan, { |
| | | orderId: this.orderId, |
| | | type: 1, |
| | | sampleId: this.orderId, |
| | | type: this.upInsReviewType, |
| | | laboratory: this.sonLaboratory, |
| | | tell: null |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功") |
| | | this.upInsReviewDia = false; |
| | | this.$emit('goback') |
| | | } |
| | | this.reviewLoading = false; |
| | |
| | | console.error(error) |
| | | this.reviewLoading = false; |
| | | }) |
| | | } else { |
| | | // 不通过 |
| | | } else{ |
| | | // 再次试验 |
| | | this.reviewDia = true; |
| | | } |
| | | }, |
| | |
| | | if (this.noReason) { |
| | | this.reviewLoading = true; |
| | | this.$axios.post(this.$api.insOrderPlan.verifyPlan, { |
| | | orderId: this.orderId, |
| | | sampleId: this.orderId, |
| | | type: 0, |
| | | laboratory: this.sonLaboratory, |
| | | tell: this.noReason |
| | |
| | | this.$message.error('未输入不通过原因') |
| | | } |
| | | }, |
| | | submit0(){ |
| | | if(this.sonLaboratory === '电路试验'){ |
| | | if(!this.experimentInfo.term){ |
| | | this.$message.error('请输入实验阶段') |
| | | return |
| | | } |
| | | if(!this.experimentInfo.note){ |
| | | this.$message.error('请输入实验操作') |
| | | return |
| | | } |
| | | } |
| | | // let num =0 |
| | | // this.newUserInfo.forEach(item=>{ |
| | | // item.timeArr.forEach(a=>{ |
| | | // if(!a){ |
| | | // num++ |
| | | // } |
| | | // }) |
| | | // }) |
| | | // if(num>0){ |
| | | // this.$message.error('请输入完成工时') |
| | | // return |
| | | // } |
| | | this.experimentDia = false |
| | | this.experimentDia0 = false |
| | | if(this.insOrder.orderType=='C'){ |
| | | this.verifyUser = this.insOrder.prepareUserId |
| | | this.submit() |
| | | }else{ |
| | | this.addVerifyDia = true |
| | | } |
| | | }, |
| | | async handleSubmit(){ |
| | | if(!this.otherForm.temperature){ |
| | | this.$message.error('请输入温度') |
| | | return |
| | | } |
| | | if(!this.otherForm.humidity){ |
| | | this.$message.error('请输入湿度') |
| | | return |
| | | } |
| | | this.loading = true |
| | | if(this.sonLaboratory === '电路试验'&&!(await this.$refs.CircuitParameters.saveAll())){ |
| | | this.loading = false |
| | | return |
| | | }else{ |
| | | this.loading = false |
| | | } |
| | | this.experimentDia = true |
| | | this.newUserInfo = [] |
| | | this.userInfo.name.forEach((item,index)=>{ |
| | | let timeArr = [] |
| | | this.sampleProduct.forEach(m=>{ |
| | | m.insProduct.forEach(a=>{ |
| | | timeArr.push(0) |
| | | }) |
| | | }) |
| | | let obj = { |
| | | name:item, |
| | | id:this.userInfo.ids[index], |
| | | timeArr:timeArr |
| | | } |
| | | this.newUserInfo.push(obj) |
| | | }) |
| | | if (this.sonLaboratory === '电路试验') { |
| | | this.experimentDia0 = 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.addVerifyDia = false |
| | | this.submitLoading = true; |
| | | this.$axios.post(this.$api.insOrderPlan.checkSubmitPlan, { |
| | | orderId: this.orderId, |
| | | sampleId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | let auxiliaryOutputWorkingHoursList = [] |
| | | this.sampleProduct.forEach(item=>{ |
| | | item.insProduct.forEach((a,i)=>{ |
| | | this.newUserInfo.forEach(b=>{ |
| | | let obj = { |
| | | inspectionItem:a.inspectionItem, |
| | | outputWorkTime:b.timeArr[i], |
| | | inspectionItemSubclass:a.inspectionItemSubclass, |
| | | sample:item.sampleCode, |
| | | insProductId:a.id, |
| | | num:item.num1, |
| | | check:b.id |
| | | } |
| | | auxiliaryOutputWorkingHoursList.push(obj) |
| | | }) |
| | | }) |
| | | }) |
| | | if(!res.data||res.data.length==0){ |
| | | this.$axios.post(this.$api.insOrderPlan.submitPlan, { |
| | | orderId: this.orderId, |
| | | sampleId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | verifyUser: this.verifyUser, |
| | | entrustCode: this.insOrder.entrustCode |
| | | }).then(res => { |
| | | entrustCode: this.insOrder.entrustCode, |
| | | auxiliaryOutputWorkingHoursList:auxiliaryOutputWorkingHoursList, |
| | | ...this.experimentInfo |
| | | }, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | }, |
| | | noQs:true}).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功") |
| | | this.$emit('goback') |
| | |
| | | type: "" |
| | | }).then(() => { |
| | | this.$axios.post(this.$api.insOrderPlan.submitPlan, { |
| | | orderId: this.orderId, |
| | | sampleId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | verifyUser: this.verifyUser |
| | | }).then(res => { |
| | | verifyUser: this.verifyUser, |
| | | auxiliaryOutputWorkingHoursList:auxiliaryOutputWorkingHoursList, |
| | | ...this.experimentInfo |
| | | }, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | }, |
| | | noQs:true}).then( res => { |
| | | if (res.code === 200) { |
| | | this.submitLoading = false; |
| | | this.$message.success("操作成功") |
| | | this.$emit('goback') |
| | | } |
| | |
| | | } |
| | | |
| | | } |
| | | this.submitLoading = false; |
| | | }).catch(error => { |
| | | console.error(error) |
| | | this.submitLoading = false; |
| | | }) |
| | | return |
| | | }, |
| | | saveInsContext() { |
| | | async handleCType(){ |
| | | if(this.insOrder.departmentLims=='质量部'){ |
| | | await this.$axios.post(this.$api.insOrderPlan.verifyPlan, { |
| | | sampleId: this.orderId, |
| | | type: 1, |
| | | laboratory: this.sonLaboratory, |
| | | tell: null |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | } |
| | | }).catch(error => { |
| | | }) |
| | | } |
| | | }, |
| | | // 统一在这里保存数据 |
| | | saveInsContext(currentInsItemId) { |
| | | try { |
| | | console.log(1111,this.param) |
| | | if(this.param){ |
| | | let param = null |
| | | if(currentInsItemId){ |
| | | param = {[currentInsItemId] : this.param[currentInsItemId]} |
| | | }else{ |
| | | param = this.param |
| | | } |
| | | this.$axios.post(this.$api.insOrderPlan.saveInsContext, { |
| | | param: JSON.stringify(this.param) |
| | | param: JSON.stringify(param), |
| | | currentTable:this.currentTable, |
| | | num:this.currentSample.num1 |
| | | }).then(res => { |
| | | if (res.code == 201) { |
| | | this.$message.error('保存失败') |
| | |
| | | console.log(999,error); |
| | | } |
| | | }, |
| | | // 设备改变 |
| | | changeEquip(val, n,v) { |
| | | this.$set(n.v,'v',val) |
| | | this.tableList[0].arr.forEach((item,index)=>{ |
| | |
| | | } |
| | | } |
| | | } |
| | | this.saveInsContext() |
| | | // 保存数据 |
| | | this.saveInsContext(n.i) |
| | | }, |
| | | // 样品检查 |
| | | changeSampleCheck(val, n,type){ |
| | | this.$set(n.v,'v',val) |
| | | if(type=='前'){ |
| | | // 检验前 |
| | | this.saveInsContext(n.i) |
| | | }else{ |
| | | // 检验后 |
| | | this.saveInsContext(n.i) |
| | | } |
| | | }, |
| | | getAuthorizedPerson() { |
| | | this.$axios.get(this.$api.user.getUserMenu).then(res => { |
| | |
| | | flag = false; |
| | | }); |
| | | }, |
| | | // 页面里面切换样品 |
| | | async caretSample(num){ |
| | | let index = this.currentKey + num |
| | | if(index < 1){ |
| | |
| | | } |
| | | 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 => { |
| | | this.currentSample.insProduct.forEach((a, j) => { |
| | | if(this.handleCasing(a.inspectionItem)){ |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null |
| | | insResult: null, |
| | | beforeCheck:null, |
| | | afterCheck:null, |
| | | } |
| | | } |
| | | }) |
| | | // 页面数据处理 |
| | | this.getTableLists() |
| | | // 更新到多线程 |
| | | this.worker.postMessage(JSON.stringify({ |
| | | type: 'saveData', |
| | | tableList:this.tableList, |
| | |
| | | insResult: null |
| | | } |
| | | }) |
| | | this.fiberOpticTapeVisible = false; |
| | | let list = await this.getCurrentProduct(this.currentFiberOpticTape.id,1) |
| | | this.getTableLists0(list) |
| | | if(this.currentFiberOpticTape.fiber&&this.currentFiberOpticTape.fiber.length>0){ |
| | |
| | | let list = await this.getCurrentProduct(this.currentFiberOptic.id,2) |
| | | this.getTableLists0(list) |
| | | }, |
| | | handleSuccessUp(response, ) { |
| | | async handleSuccessUp(response, ) { |
| | | this.upLoading = false; |
| | | if (response.code == 200) { |
| | | this.$message.success('上传成功'); |
| | | this.$refs.fileList.selectList() |
| | | if(this.sonLaboratory === '电路试验'){ |
| | | // // 电路试验数采 |
| | | // 获取当前样品的检验项 |
| | | let list = await this.getCurrentProduct(this.currentSample.id,0) |
| | | this.currentSample.insProduct = this.HaveJson(list) |
| | | this.currentNum++ |
| | | } |
| | | }else { |
| | | this.$message.error(response.message); |
| | | } |
| | | }, |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('上传文件不超过10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | this.upLoading = true; |
| | | return true; |
| | | } |
| | | if(this.sonLaboratory === '电路试验'&&(file.name.includes('交调')||file.name.includes('互调'))&&!this.$refs.CircuitParameters.allBandList.find(m=>m.band)){ |
| | | this.$message.error('上传附件前请先填写并保存频段'); |
| | | return false |
| | | }else{ |
| | | // if(file.name.includes('交调')||file.name.includes('互调')){ |
| | | // this.$refs.CircuitParameters.saveAll() |
| | | // } |
| | | 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('上传失败') |
| | |
| | | }else{ |
| | | return v |
| | | } |
| | | }, |
| | | async getCurrentItem(){ |
| | | let list = await this.getCurrentProduct(this.currentSample.id,0) |
| | | this.currentSample.insProduct = this.HaveJson(list) |
| | | }, |
| | | saveVersion(){ |
| | | if(this.currentTableState!=0&&this.currentTableState!=1){ |
| | | this.$message.error('请选择版本') |
| | | return |
| | | } |
| | | this.versionLoading = true; |
| | | this.$axios.post(this.$api.insOrderPlan.chooseVersion, { |
| | | orderStateId: this.orderStateId, |
| | | version: this.currentTableState |
| | | }).then(res => { |
| | | this.versionLoading = false; |
| | | if(res.code==201){ |
| | | return |
| | | } |
| | | this.versionDialogVisible = false |
| | | }) |
| | | }, |
| | | async goHistory(num){ |
| | | if(this.num==1&&num==-1){ |
| | | this.$message.error('当前是第一条记录') |
| | | return |
| | | }else if(this.num1==this.num&&num==1){ |
| | | this.$message.error('当前是最后一条记录') |
| | | return |
| | | } |
| | | this.num = this.num + num |
| | | this.tableLoading = true |
| | | await this.handleChangeSample(this.currentSample) |
| | | this.currentNum++ |
| | | this.tableLoading = false |
| | | }, |
| | | lookFile(row){ |
| | | this.currentFile = row; |
| | | if(row.type==1){ |
| | | this.currentFile.url = this.javaApi+'/img/'+row.fileUrl |
| | | }else{ |
| | | this.currentFile.url = this.javaApi+'/word/'+row.fileUrl |
| | | } |
| | | this.lookFileVisible = true |
| | | }, |
| | | handleBack(){ |
| | | try { |
| | | if(!this.isLook&&this.state==1&&this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('电路试验')){ |
| | | this.$confirm('请确认当前数据是否全部保存,是否返回?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(async () => { |
| | | this.loading = true |
| | | if(await this.$refs.CircuitParameters.saveAll()){ |
| | | this.$emit('goback') |
| | | this.loading = false |
| | | }else{ |
| | | this.loading = false |
| | | } |
| | | }) |
| | | }else{ |
| | | this.$emit('goback') |
| | | } |
| | | } catch (error) { |
| | | this.$emit('goback') |
| | | } |
| | | }, |
| | | selectInsProductTemplate(){ |
| | | this.$axios.post(this.$api.insProductTemplate.chooseInsProductTemplate,{ |
| | | version:this.insOrder.sampleType=='无源器件'?2:'' |
| | | }).then(res => { |
| | | if (res.code == 201) return |
| | | this.templates = res.data |
| | | }) |
| | | }, |
| | | selectInsProductTemplateById(e){ |
| | | if(e){ |
| | | this.$axios.post(this.$api.insProductTemplate.getInsProductTemplate + '?id=' + e).then(res => { |
| | | if (res.code == 201) return |
| | | let obj = JSON.parse(res.data.message) |
| | | if(this.currentTableState!=res.data.version&&this.insOrder.sampleType!='无源器件'){ |
| | | this.$message.error('电调/非电调模板版本不一致,请重新选择') |
| | | this.template = null |
| | | return |
| | | } |
| | | // 当前模板中未包含所有项目 |
| | | let state = this.currentSample.insProduct.every(item=>{ |
| | | if(obj.allBandList&&obj.allBandList.length>0&&obj.allBandList[0].projectList&&obj.allBandList[0].projectList.length>0&&item.inspectionItemSubclass&&obj.allBandList[0].projectList.find(m=>m.inspectionItemSubclass==item.inspectionItemSubclass)){ |
| | | return true |
| | | }else{ |
| | | return false |
| | | } |
| | | }) |
| | | if(!state){ |
| | | this.template = null |
| | | this.$message.error('当前模板中未包含所有项目,请重新选择') |
| | | return |
| | | } |
| | | // 保存版本 |
| | | // this.saveVersion() |
| | | // 如果模板的检验项多了,则删除多余的 |
| | | obj.allBandList.forEach(item=>{ |
| | | item.projectList.forEach((m,i)=>{ |
| | | if(!this.currentSample.insProduct.find(n=>m.inspectionItemSubclass==n.inspectionItemSubclass)){ |
| | | item.projectList.splice(i,1) |
| | | } |
| | | }) |
| | | }) |
| | | this.$refs.CircuitParameters.upTemplate(obj) |
| | | }) |
| | | } |
| | | }, |
| | | addTemplateDia(){ |
| | | let obj = { |
| | | allBandList:this.$refs.CircuitParameters.allBandList, |
| | | intermodulationNum:this.$refs.CircuitParameters.intermodulationNum, |
| | | angleList:this.$refs.CircuitParameters.angleList, |
| | | } |
| | | if (this.templateName) { |
| | | this.templateLoading = true; |
| | | this.$axios.post(this.$api.insProductTemplate.addInsProductTemplate, { |
| | | name: this.templateName, |
| | | version:this.insOrder.sampleType=='无源器件'?2:this.currentTableState, |
| | | message:JSON.stringify(obj) |
| | | }, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then(res => { |
| | | if (res.code == 201) return |
| | | this.templateLoading = false; |
| | | this.templateDia = false; |
| | | this.$message.success('保存成功') |
| | | this.selectInsProductTemplate() |
| | | this.templateName = '' |
| | | }) |
| | | } else { |
| | | this.$message.error('请填写模板名称') |
| | | } |
| | | }, |
| | | handleDelete(row){ |
| | | this.$confirm('是否删除当前数据?', "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | this.$axios.post(this.$api.insProductTemplate.delInsProductTemplate, { |
| | | id: row.id |
| | | }).then(res => { |
| | | if (res.code === 201) { |
| | | return |
| | | } |
| | | this.$message.success('删除成功') |
| | | this.selectInsProductTemplate() |
| | | }).catch(e => { |
| | | this.$message.error('删除失败') |
| | | }) |
| | | }).catch(() => {}) |
| | | } |
| | | } |
| | | } |