| | |
| | | </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> |
| | | <span style="margin-left: 4px;">℃</span> |
| | | </el-form-item> |
| | | <el-form-item label="湿度:" style="margin-bottom: 0;"> |
| | | <el-input v-model="otherForm.humidity" :disabled="state>1" size="small" placeholder="" style="width: 90px;" @change="m=>subOtherForm(m,'humidity')"></el-input> |
| | | <span style="margin-left: 4px;">%</span> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-button type="primary" size="small" v-if="(isGet||tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName=='温度循环检验原始记录'&&temDataAcquisition)&&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"> |
| | | <!-- <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> |
| | | <!-- 常规检验原始记录 --> |
| | | <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('电路试验'))"> |
| | |
| | | <el-button type="primary" :loading="versionLoading" @click="saveVersion">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog title="试验信息" :visible.sync="experimentDia" width="400px"> |
| | | <div class="body" style="display: flex;padding: 10px;align-items: center;"> |
| | | <div class="search_label" style="width: 150px;"><span class="required-span">*</span>实验阶段</div> |
| | | <div class="search_input" style="width: 100%;"> |
| | | <el-input clearable v-model="experimentInfo.term" size="small" placeholder=""></el-input> |
| | | </div> |
| | | </div> |
| | | <div class="body" style="display: flex;padding: 10px;align-items: center;"> |
| | | <div class="search_label" style="width: 150px;"><span class="required-span">*</span>实验操作</div> |
| | | <div class="search_input" style="width: 100%;"> |
| | | <el-input clearable v-model="experimentInfo.note" size="small" placeholder="" type="textarea" |
| | | :rows="2"></el-input> |
| | | </div> |
| | | </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> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | experimentDia:false, |
| | | experimentInfo:{ |
| | | note:'', |
| | | term:'' |
| | | }, |
| | | currentNum:0, |
| | | versionLoading:false, |
| | | versionDialogVisible:false, |
| | |
| | | }, |
| | | upIndex: 0, |
| | | changeType:null, |
| | | getReportModelLoading:false, |
| | | insOrder: {}, |
| | | sampleProduct: [], |
| | | typeList: [], |
| | |
| | | changeType:null, |
| | | getDataTypeId:'', |
| | | getDataType:null, |
| | | num:0 |
| | | num:0, |
| | | otherForm:{ |
| | | temperature:'', |
| | | humidity:'' |
| | | } |
| | | } |
| | | }, |
| | | // 用于上传文件的信息 |
| | |
| | | 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 = { |
| | | temperature:temperature?temperature:null, |
| | | humidity:humidity?humidity:null, |
| | | } |
| | | } |
| | | // 获取当前样品的检验项 |
| | | let list = await this.getCurrentProduct(this.currentSample.id,0) |
| | | this.currentSample.insProduct = this.HaveJson(list) |
| | |
| | | } |
| | | }) |
| | | this.determineWhetherToCollectData()//是否需要数采 |
| | | this.getReportModel(this.currentSample.id)//获取套管、光纤带、光纤信息 |
| | | if (this.currentSample.index == undefined) this.currentSample['index'] = 1 |
| | | let bushing = this.currentSample.bushing |
| | | this.getTableLists();//处理模板列表信息 |
| | |
| | | } |
| | | } |
| | | }) |
| | | this.getReportModel(this.currentSample.id)//获取套管、光纤带、光纤信息 |
| | | // 去重模板,返回有几个模板 |
| | | const mySet1 = new Set(); |
| | | this.tableLists = this.currentSample.insProduct.filter(m => { |
| | |
| | | this.saveInsContext() |
| | | }, |
| | | // 热循环---结束 |
| | | // 保存湿度、温度数据 |
| | | subOtherForm(m,type){ |
| | | let ids = [] |
| | | for (let i in this.param) { |
| | | ids.push(i) |
| | | } |
| | | this.$axios.post(this.$api.insOrderPlan.write,{ |
| | | [type]:Number(m), |
| | | ids |
| | | }, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | }, |
| | | noQs:true |
| | | }).then(res => { |
| | | if (res.code == 201) return |
| | | this.$message.success('保存成功') |
| | | }) |
| | | }, |
| | | // 权限获取 |
| | | getPower(){ |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |
| | |
| | | } |
| | | } |
| | | }) |
| | | // 获取套管,光纤带,光纤数据 |
| | | this.getReportModel(row.id) |
| | | let bushing = this.currentSample.bushing |
| | | if(bushing&&bushing.length>0){ |
| | | this.bushing = bushing |
| | |
| | | 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 |
| | |
| | | }) |
| | | // 页面列表数据处理 |
| | | this.getTableLists0(list) |
| | | // 获取套管,光纤带,光纤数据 |
| | | this.getReportModel(this.currentSample.id) |
| | | // 向多线程保存数据 |
| | | this.worker.postMessage(JSON.stringify({ |
| | | type: 'saveData', |
| | |
| | | this.$message.error('未输入不通过原因') |
| | | } |
| | | }, |
| | | handleSubmit(){ |
| | | submit0(){ |
| | | if(!this.experimentInfo.term){ |
| | | this.$message.error('请输入实验阶段') |
| | | return |
| | | } |
| | | if(!this.experimentInfo.note){ |
| | | this.$message.error('请输入实验操作') |
| | | return |
| | | } |
| | | this.experimentDia = false |
| | | if(this.insOrder.orderType=='C'){ |
| | | this.verifyUser = this.insOrder.prepareUserId |
| | | this.submit() |
| | | }else{ |
| | | this.addVerifyDia = true |
| | | } |
| | | }, |
| | | handleSubmit(){ |
| | | this.experimentDia = true |
| | | }, |
| | | submit() { |
| | | if (this.verifyUser === null || this.verifyUser === '') { |
| | |
| | | orderId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | verifyUser: this.verifyUser, |
| | | entrustCode: this.insOrder.entrustCode |
| | | entrustCode: this.insOrder.entrustCode, |
| | | ...this.experimentInfo |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功") |
| | |
| | | this.$axios.post(this.$api.insOrderPlan.submitPlan, { |
| | | orderId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | verifyUser: this.verifyUser |
| | | verifyUser: this.verifyUser, |
| | | ...this.experimentInfo |
| | | }).then( res => { |
| | | if (res.code === 200) { |
| | | this.submitLoading = false; |