| | |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 单份报告下载 |
| | | export function downloadReport(id) { |
| | | return request({ |
| | | url: '/insReport/download', |
| | | method: 'get', |
| | | params: { id }, |
| | | responseType: 'blob' |
| | | }) |
| | | } |
| | | // 报告退回到检验任务 |
| | | export function sendBackTask(query) { |
| | | return request({ |
| | |
| | | return row.checkName == null || (row.checkName && !row.checkName.includes(this.nickName)) |
| | | } |
| | | }, |
| | | { |
| | | name: "下载报告", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.download(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "上传", |
| | | type: "upload", |
| | | accept: '.doc,.docx', |
| | | url: '/insReport/inReport', |
| | | uploadIdFun: (row) => { |
| | | return row.insReportId |
| | | } |
| | | }, |
| | | { |
| | | name: "还原", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleRestore(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "查看报告", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleIssued(row); |
| | | } |
| | | }, |
| | | // { |
| | | // name: "下载报告", |
| | | // type: "text", |
| | | // clickFun: (row) => { |
| | | // this.download(row); |
| | | // }, |
| | | // }, |
| | | // { |
| | | // name: "上传", |
| | | // type: "upload", |
| | | // accept: '.doc,.docx', |
| | | // url: '/insReport/inReport', |
| | | // uploadIdFun: (row) => { |
| | | // return row.insReportId |
| | | // } |
| | | // }, |
| | | // { |
| | | // name: "还原", |
| | | // type: "text", |
| | | // clickFun: (row) => { |
| | | // this.handleRestore(row); |
| | | // }, |
| | | // }, |
| | | // { |
| | | // name: "查看报告", |
| | | // type: "text", |
| | | // clickFun: (row) => { |
| | | // this.handleIssued(row); |
| | | // } |
| | | // }, |
| | | // { |
| | | // name: "产业链", |
| | | // type: "text", |
| | |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | <div style="text-align: left; margin-top: 8px;"> |
| | | <el-form :inline="true" :model="currentOtherForm" class="form-inline" label-width="50px" |
| | | style="text-align: left; display: inline"> |
| | | <el-form-item label="温度:" style="margin-bottom: 0"> |
| | | <el-input v-model="currentOtherForm.temperature" :disabled="state > 1" placeholder="" size="small" |
| | | 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="currentOtherForm.humidity" :disabled="state > 1" placeholder="" size="small" |
| | | style="width: 90px" @change="m => subOtherForm(m, 'humidity')"></el-input> |
| | | <span style="margin-left: 4px">%RH</span> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <!-- 常规检验原始记录 --> |
| | | <div id="tableBox" v-loading="tableLoading" class="center-box"> |
| | | <table v-for="(item, index) in tableList" :key="index + currentTable + currentSample.id" border="1" |
| | |
| | | getInsProductUnqualifiedRetest, |
| | | search, selectUserCondition, |
| | | submitPlan, |
| | | verifyPlan |
| | | verifyPlan, |
| | | write |
| | | } from "@/api/business/inspectionTask"; |
| | | import { getUserNow, saveUnqualifiedContext } from "@/api/business/rawMaterialOrder"; |
| | | import InspectionWorker from '@/workers/InspectionWorker.worker'; |
| | |
| | | numOptions: [], |
| | | temperatureOptions: [], |
| | | wareTableData: [], |
| | | otherForm: { |
| | | humidity: null, |
| | | temperature: null, |
| | | }, |
| | | // 温度、湿度按模板 id 分组:{ [templateId]: { temperature, humidity } } |
| | | otherForm: {}, |
| | | equipForm: { |
| | | value0: null, |
| | | code0: null, |
| | |
| | | }, |
| | | action() { |
| | | return this.javaApi + "/insOrderPlan/uploadFile"; |
| | | }, |
| | | // 当前模板对应的温度、湿度 |
| | | currentOtherForm() { |
| | | return this.otherForm[this.currentTable] || { |
| | | temperature: null, |
| | | humidity: null |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.sampleProduct = res.data.sampleProduct |
| | | this.currentSample = this.HaveJson(this.sampleProduct[0]) |
| | | let insProduct = this.HaveJson(this.currentSample.insProduct) |
| | | // 温度、湿度赋值 |
| | | this.otherForm = { |
| | | temperature: this.insOrder.temperature ? this.insOrder.temperature : null, |
| | | humidity: this.insOrder.humidity ? this.insOrder.humidity : null, |
| | | } |
| | | // 温度、湿度赋值:按模板 id 分组回显 |
| | | this.otherForm = {} |
| | | const conditionList = this.insOrder.templateConditions || [] |
| | | conditionList.forEach(item => { |
| | | this.$set(this.otherForm, item.templateId, { |
| | | temperature: item.temperature != null ? item.temperature : null, |
| | | humidity: item.humidity != null ? item.humidity : null |
| | | }) |
| | | }) |
| | | if (this.typeSource == '1') { |
| | | this.retestTag = '1' |
| | | } |
| | |
| | | if (this.tableLists && this.tableLists.length > 0) { |
| | | this.tableList = null; |
| | | this.tableList = this.tableLists.filter(m => m.templateId == val1) |
| | | // 模板集合可能变化,补齐温度、湿度槽位 |
| | | this.tableLists.forEach(m => this.ensureOtherForm(m.templateId)) |
| | | // 对模板进行处理 |
| | | this.handleTableData() |
| | | } |
| | |
| | | this.tableList = null; |
| | | this.tableList = [this.tableLists[0]] |
| | | this.currentTable = this.tableLists[0].templateId; |
| | | // 补齐每个模板的温度、湿度槽位 |
| | | this.tableLists.forEach(m => this.ensureOtherForm(m.templateId)) |
| | | // 处理页面列表数据 |
| | | this.handleTableData() |
| | | } |
| | |
| | | this.tableList = [this.tableLists[0]] |
| | | this.currentTable = this.tableLists[0].templateId; |
| | | this.currentSample.insProduct = this.HaveJson(list) |
| | | // 补齐每个模板的温度、湿度槽位 |
| | | this.tableLists.forEach(m => this.ensureOtherForm(m.templateId)) |
| | | // 处理页面列表数据 |
| | | this.handleTableData() |
| | | } |
| | |
| | | // 对输入值进行格式校验 |
| | | handleInput(n) { |
| | | try { |
| | | n.v.v = n.v.v.replace(/[^\d.^e>\-/+]/g, ''); |
| | | n.v.v = n.v.v.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的 |
| | | n.v.v = n.v.v.replace(".", "$#$").replace(/\./g, "").replace("$#$", "."); |
| | | n.v.v = n.v.v.replace(/\/{2,}/g, "/"); //只保留第一个/清除多余的 |
| | | n.v.v = n.v.v.replace("/", "$#$").replace(/\//g, "").replace("$#$", "/"); |
| | | const v = n.v.v; |
| | | // 能力范围已废弃,检验值类型不再作为判断依据。整串只由算式字符组成时才规范化格式, |
| | | // 出现中文等其它字符即按文本处理原样保留,否则文字会被逐字删掉 |
| | | if (typeof v !== "string" || /[^\d.^e>>≥≤<<断裂脆化\-/+]/.test(v)) { |
| | | return; |
| | | } |
| | | n.v.v = v |
| | | .replace(/\.{2,}/g, ".") //只保留第一个. 清除多余的 |
| | | .replace(".", "$#$") |
| | | .replace(/\./g, "") |
| | | .replace("$#$", ".") |
| | | .replace(/\/{2,}/g, "/") //只保留第一个/清除多余的 |
| | | .replace("/", "$#$") |
| | | .replace(/\//g, "") |
| | | .replace("$#$", "/"); |
| | | } catch (error) { |
| | | console.log(error); |
| | | } |
| | | |
| | | }, |
| | | getInspectionItemType(id) { |
| | | for (var a in this.currentSample.insProduct) { |
| | |
| | | this.$message.error('未输入不通过原因') |
| | | } |
| | | }, |
| | | // 保证模板的温度、湿度槽位存在 |
| | | ensureOtherForm(templateId) { |
| | | if (templateId == null) return |
| | | if (!this.otherForm[templateId]) { |
| | | this.$set(this.otherForm, templateId, { |
| | | temperature: null, |
| | | humidity: null |
| | | }) |
| | | } |
| | | }, |
| | | // 保存当前模板的温度、湿度 |
| | | subOtherForm(m, type) { |
| | | write({ |
| | | id: this.insOrder.id, |
| | | templateId: this.currentTable, |
| | | [type]: Number(m) |
| | | }).then(res => { |
| | | this.$message.success("保存成功") |
| | | }) |
| | | }, |
| | | 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("请输入温度") |
| | | const labels = { temperature: "温度", humidity: "湿度" } |
| | | const keys = ["temperature", "humidity"] |
| | | const missing = [] |
| | | this.tableLists.forEach(m => { |
| | | const form = this.otherForm[m.templateId] || {} |
| | | keys.forEach(key => { |
| | | if (!form[key]) missing.push(`「${m.templateName}」的${labels[key]}`) |
| | | }) |
| | | }) |
| | | if (missing.length > 0) { |
| | | this.$message.error(`请填写${missing[0]}`) |
| | | return |
| | | } |
| | | this.submitLoading = true; |
| | |
| | | <div v-loading="loading" class="inspection" style="background-color: rgb(245, 247, 251);"> |
| | | <el-row class="title"> |
| | | <el-col v-if="insOrder.ifsOrderType!=='02wg'" :span="8" style="text-align: left"> |
| | | <el-form :inline="true" :model="otherForm" class="form-inline" label-width="50px" |
| | | <el-form :inline="true" :model="currentOtherForm" class="form-inline" label-width="50px" |
| | | style="text-align: right; padding-top: 0; display: inline"> |
| | | <el-form-item label="温度:" style="margin-bottom: 0"> |
| | | <el-input v-model="otherForm.temperature" :disabled="state > 1" placeholder="" size="small" |
| | | <el-input v-model="currentOtherForm.temperature" :disabled="state > 1" placeholder="" size="small" |
| | | style="width: 90px; line-height: 60px" @change="(m) => subOtherForm(m, 'temperature')"></el-input> |
| | | <span style="margin-left: 4px">℃</span> |
| | | </el-form-item> |
| | | <el-form-item label="湿度:" style="margin-bottom: 0"> |
| | | <el-input v-model="otherForm.humidity" :disabled="state > 1" placeholder="" size="small" |
| | | <el-input v-model="currentOtherForm.humidity" :disabled="state > 1" placeholder="" size="small" |
| | | style="width: 90px; line-height: 60px" @change="(m) => subOtherForm(m, 'humidity')"></el-input> |
| | | <span style="margin-left: 4px">%</span> |
| | | <span style="margin-left: 4px">%RH</span> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-col> |
| | |
| | | <el-button v-if="typeSource == 1" size="small" type="primary" @click="openPurchase">进货验证</el-button> |
| | | <el-button v-if="state == 1 && [0,1].includes(Number(typeSource))" size="small" type="primary" |
| | | @click="openUnPassDialog('add')">不合格处理</el-button> |
| | | <el-button size="small" type="primary" @click="sampleVisible = true; uploadSample();">样品切换</el-button> |
| | | <!-- <el-button size="small" type="primary" @click="sampleVisible = true; uploadSample();">样品切换</el-button> --> |
| | | <!-- <el-button v-if="state == 1" size="small" type="primary" @click="taskVisible = true">任务切换</el-button>--> |
| | | <el-button v-if="state == 1" size="small" type="primary" @click="addVerifyDia = true">提交</el-button> |
| | | <!-- 复核 --> |
| | |
| | | align-items: center; |
| | | width: 100%; |
| | | "> |
| | | <i class="el-icon-caret-left table_caret" style="width: 16px" @click="caretSample(-1)"></i> |
| | | <!-- <i class="el-icon-caret-left table_caret" style="width: 16px" @click="caretSample(-1)"></i> --> |
| | | <div |
| | | :style="`font-family:${n.v.ff} !important;overflow: hidden;white-space: nowrap;width: calc(100% - 32px);`"> |
| | | {{ currentSample.sampleCode }} |
| | | </div> |
| | | <i class="el-icon-caret-right table_caret" style="width: 16px" @click="caretSample(1)"></i> |
| | | <!-- <i class="el-icon-caret-right table_caret" style="width: 16px" @click="caretSample(1)"></i> --> |
| | | </div> |
| | | </template> |
| | | <template v-else-if=" |
| | |
| | | <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading" |
| | | :height="'calc(100vh - 290px)'" @pagination="pagination" style="height: 100%; margin-top: 16px"></lims-table> |
| | | </div> |
| | | <!-- 样品切换已停用 |
| | | <el-drawer :size="550" :visible.sync="sampleVisible" title="样品切换"> |
| | | <el-table v-if="sampleVisible" ref="productTable" :current-row-key="currentKey" :data="sampleProduct" |
| | | :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border |
| | |
| | | <span>{{ scope.row.isLeave == 0 ? "否" : "是" }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | --> |
| | | <!-- 检验单会有一个是否有配套样品字段控制显示 --> |
| | | <!-- |
| | | <el-table-column v-if="insOrder.mating > 0" label="配套样品型号" min-width="130px" prop="joinModel" |
| | | show-overflow-tooltip></el-table-column> |
| | | <el-table-column v-if="insOrder.mating > 0" label="配套样品名称" min-width="130px" prop="joinName" |
| | |
| | | show-overflow-tooltip></el-table-column> |
| | | </el-table> |
| | | </el-drawer> |
| | | --> |
| | | <el-drawer :size="500" :visible.sync="taskVisible" title="任务切换"> |
| | | <lims-table :tableData="tableData0" :column="column0" :page="page0" :tableLoading="tableLoading0" |
| | | :height="'calc(100vh - 90px)'" :currentChange="handleChangeTask"></lims-table> |
| | |
| | | inspectionItem: 1, |
| | | inspectionItemSubclass: "20(常温)", |
| | | }, |
| | | otherForm: { |
| | | humidity: null, |
| | | temperature: null, |
| | | }, |
| | | // 温度、湿度按模板 id 分组:{ [templateId]: { temperature, humidity } } |
| | | otherForm: {}, |
| | | equipForm: { |
| | | value0: null, |
| | | code0: null, |
| | |
| | | action() { |
| | | return this.javaApi + "/insOrderPlan/uploadFile"; |
| | | }, |
| | | // 当前模板对应的温度、湿度 |
| | | currentOtherForm() { |
| | | return ( |
| | | this.otherForm[this.currentTable] || { |
| | | temperature: null, |
| | | humidity: null, |
| | | } |
| | | ); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.saveQueue = Promise.resolve(); |
| | |
| | | this.tableList = this.tableLists.filter( |
| | | (m) => m.templateId == val1 |
| | | ); |
| | | // 模板集合可能变化,补齐温度、湿度槽位 |
| | | this.tableLists.forEach((m) => this.ensureOtherForm(m.templateId)); |
| | | // 对模板进行处理 |
| | | this.handleTableData(); |
| | | } |
| | |
| | | this.sampleProduct = res.data.sampleProduct; |
| | | this.currentSample = this.HaveJson(this.sampleProduct[0]); |
| | | let insProduct = this.HaveJson(this.currentSample.insProduct); |
| | | // 温度、湿度赋值 |
| | | this.otherForm = { |
| | | temperature: this.insOrder.temperature |
| | | ? this.insOrder.temperature |
| | | : null, |
| | | humidity: this.insOrder.humidity ? this.insOrder.humidity : null, |
| | | }; |
| | | // 温度、湿度赋值:按模板 id 分组回显 |
| | | this.otherForm = {}; |
| | | (this.insOrder.templateConditions || []).forEach((item) => { |
| | | this.$set(this.otherForm, item.templateId, { |
| | | temperature: item.temperature != null ? item.temperature : null, |
| | | humidity: item.humidity != null ? item.humidity : null, |
| | | }); |
| | | }); |
| | | this.tableLists.forEach((m) => this.ensureOtherForm(m.templateId)); |
| | | if (this.typeSource == "1") { |
| | | this.getRawMaterialTag(this.currentSample.id); // 原材料的检验任务查询批数 |
| | | this.rawMaterialTag = "1"; |
| | |
| | | this.worker0 = null; |
| | | } |
| | | }, |
| | | // 保存湿度、温度数据 |
| | | // 保证模板的温度、湿度槽位存在 |
| | | ensureOtherForm(templateId) { |
| | | if (templateId == null) return; |
| | | if (!this.otherForm[templateId]) { |
| | | this.$set(this.otherForm, templateId, { |
| | | temperature: null, |
| | | humidity: null, |
| | | }); |
| | | } |
| | | }, |
| | | // 保存当前模板的温度、湿度;备注是单据级,不带模板 |
| | | subOtherForm(m, type) { |
| | | write({ |
| | | [type]: type === "remark" ? m : Number(m), |
| | | id: this.insOrder.id, |
| | | }).then((res) => { |
| | | const payload = { id: this.insOrder.id }; |
| | | if (type === "remark") { |
| | | payload.remark = m; |
| | | } else { |
| | | payload.templateId = this.currentTable; |
| | | payload[type] = Number(m); |
| | | } |
| | | write(payload).then((res) => { |
| | | this.$message.success("保存成功"); |
| | | }); |
| | | }, |
| | |
| | | this.tableList = null; |
| | | this.tableList = [this.tableLists[0]]; |
| | | this.currentTable = this.tableLists[0].templateId; |
| | | // 补齐每个模板的温度、湿度槽位 |
| | | this.tableLists.forEach((m) => this.ensureOtherForm(m.templateId)); |
| | | // 处理页面列表数据 |
| | | this.handleTableData(); |
| | | } |
| | |
| | | // 对输入值进行格式校验 |
| | | handleInput(n) { |
| | | try { |
| | | n.v.v = n.v.v.replace(/[^\d.^e>>≥≤<<断裂脆化\-/+]/g, ""); |
| | | n.v.v = n.v.v.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的 |
| | | n.v.v = n.v.v |
| | | const v = n.v.v; |
| | | // 能力范围已废弃,检验值类型不再作为判断依据。整串只由算式字符组成时才规范化格式, |
| | | // 出现中文等其它字符即按文本处理原样保留,否则文字会被逐字删掉 |
| | | if (typeof v !== "string" || /[^\d.^e>>≥≤<<断裂脆化\-/+]/.test(v)) { |
| | | return; |
| | | } |
| | | n.v.v = v |
| | | .replace(/\.{2,}/g, ".") //只保留第一个. 清除多余的 |
| | | .replace(".", "$#$") |
| | | .replace(/\./g, "") |
| | | .replace("$#$", "."); |
| | | n.v.v = n.v.v.replace(/\/{2,}/g, "/"); //只保留第一个/清除多余的 |
| | | n.v.v = n.v.v |
| | | .replace("$#$", ".") |
| | | .replace(/\/{2,}/g, "/") //只保留第一个/清除多余的 |
| | | .replace("/", "$#$") |
| | | .replace(/\//g, "") |
| | | .replace("$#$", "/"); |
| | |
| | | this.$message.error("请选择设备"); |
| | | return; |
| | | } |
| | | if (!this.otherForm.humidity && this.insOrder.ifsOrderType!=='02wg') { |
| | | this.$message.error("请输入湿度"); |
| | | return; |
| | | } |
| | | if (!this.otherForm.temperature && this.insOrder.ifsOrderType!=='02wg') { |
| | | this.$message.error("请输入温度"); |
| | | return; |
| | | if (this.insOrder.ifsOrderType !== "02wg") { |
| | | const labels = { temperature: "温度", humidity: "湿度" }; |
| | | const missing = []; |
| | | this.tableLists.forEach((m) => { |
| | | const form = this.otherForm[m.templateId] || {}; |
| | | ["temperature", "humidity"].forEach((key) => { |
| | | if (!form[key]) missing.push(`「${m.templateName}」的${labels[key]}`); |
| | | }); |
| | | }); |
| | | if (missing.length > 0) { |
| | | this.$message.error(`请填写${missing[0]}`); |
| | | return; |
| | | } |
| | | } |
| | | if (!this.insOrder.lotPartId && this.insOrder.ifsOrderType==='02wg') { |
| | | this.$message.error("请填写IFS库存物料批次属性"); |
| | |
| | | openAddVerifyDia() { |
| | | this.addVerifyDia = true; |
| | | }, |
| | | submit() { |
| | | async submit() { |
| | | if (this.verifyUser === null || this.verifyUser === "") { |
| | | this.$message.error("请指定复核人员"); |
| | | return; |
| | |
| | | this.$message.error("请输入温度"); |
| | | return; |
| | | } |
| | | await this.waitForPendingSaves(); |
| | | this.submitLoading = true; |
| | | checkSubmitPlan({ |
| | | orderId: this.orderId, |
| | |
| | | productionEn: null, |
| | | typeSource: 1, |
| | | ifsInventoryId: '', |
| | | sampleStatus: 'In good condition', |
| | | sampleStatus: '', |
| | | }, |
| | | addObjRules: { // 表单校验规则 |
| | | testQuantity: [ |
| | |
| | | productionEn: null, |
| | | typeSource: 1, |
| | | ifsInventoryId: '', |
| | | sampleStatus: 'In good condition', |
| | | sampleStatus: '', |
| | | }, |
| | | addObjRules: { // 表单校验规则 |
| | | testQuantity: [ |
| | |
| | | <el-col :span="6"><el-form-item label="委托单位"><el-input v-model="addObj.company" disabled size="small"><template slot="append"><el-button :disabled="active>1" icon="el-icon-search" @click="openCompanyList" /></template></el-input></el-form-item></el-col> |
| | | <el-col :span="6"><el-form-item label="检验类别"><el-select v-model="addObj.orderType" :disabled="active>1" size="small"><el-option v-for="item in dict.type.check_type1" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item></el-col> |
| | | </el-row> |
| | | <el-row v-if="addObj.standardTreeId || boundTemplateList.length"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="原始记录模板"> |
| | | <div v-loading="templateBindingLoading" class="template-tag-list"> |
| | | <el-tag v-for="item in boundTemplateList" :key="item.templateId" size="small" effect="plain">{{ item.name }}</el-tag> |
| | | <span v-if="!templateBindingLoading && boundTemplateList.length === 0" class="empty-template-text">暂未绑定原始记录模板</span> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"><el-form-item label="样品数量"><el-input v-model="addObj.testQuantity" :disabled="active>1" placeholder="如:2桶、500mL" size="small" /></el-form-item></el-col> |
| | | <el-col :span="6"><el-form-item label="样品编号"><el-input v-model="sampleCode" :disabled="active>1" size="small" /></el-form-item></el-col> |
| | |
| | | <el-col :span="6"><el-form-item label="送样日期"><el-date-picker v-model="addObj.sampleDate" type="date" value-format="yyyy-MM-dd" :disabled="active>1" size="small" /></el-form-item></el-col> |
| | | <el-col :span="6"><el-form-item label="联系方式"><el-input v-model="addObj.phone" :disabled="active>1" size="small" /></el-form-item></el-col> |
| | | </el-row> |
| | | <el-row><el-col :span="6"><el-form-item label="环境条件"><el-input v-model="addObj.temperature" :disabled="active>1" placeholder="温度" size="small" /></el-form-item></el-col><el-col :span="6"><el-form-item label="湿度"><el-input v-model="addObj.humidity" :disabled="active>1" size="small" /></el-form-item></el-col><el-col :span="6"><el-form-item label="备注"><el-input v-model="addObj.remark" :disabled="active>1" size="small" /></el-form-item></el-col></el-row> |
| | | <el-row><el-col :span="12"><el-form-item label="备注"><el-input v-model="addObj.remark" :disabled="active>1" size="small" /></el-form-item></el-col></el-row> |
| | | </el-form> |
| | | <el-form v-if="false" ref="addObj" :inline="true" :model="addObj" :rules="addObjRules" label-width="108px" label-position="right"> |
| | | <el-row> |
| | |
| | | upInsOrderOfState |
| | | } from "@/api/business/add"; |
| | | import {selectUserCondition} from "@/api/performance/class"; |
| | | import {selectsStandardMethodByFLSSM} from "@/api/standard/standardLibrary"; |
| | | import {selectTemplateBindings, selectsStandardMethodByFLSSM} from "@/api/standard/standardLibrary"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import {selectCustomPageList} from "@/api/system/customer"; |
| | | import {mapGetters} from "vuex"; |
| | |
| | | tabIndex: '', |
| | | currentId: '', |
| | | sampleCode: '', |
| | | boundTemplateList: [], |
| | | templateBindingLoading: false, |
| | | sampleSelectionList: [],//样品表格选中数据 |
| | | editTable:[], |
| | | template: null, |
| | |
| | | orderType: null, |
| | | send: 1, |
| | | formType: '送检', // 来样方式 |
| | | sampleStatus: 'In good condition', // 样品状态 |
| | | sampleStatus: '', // 样品状态 |
| | | testQuantity: '', // 样品状态 |
| | | production: null, |
| | | productionEn: null, |
| | |
| | | }; |
| | | this.addObj.type = String(this.addObj.type) |
| | | const samples = this.HaveJson(res.data.sampleProduct) |
| | | this.sampleCode = samples.length ? samples[0].sampleCode || '' : '' |
| | | this.boundTemplateList = this.sortTemplateList(res.data.templateList) |
| | | const loadSamples = this.canSelectProduct |
| | | ? Promise.all(samples.map(sample => this.loadSelectableProducts(sample))) |
| | | : Promise.resolve(samples) |
| | |
| | | }) |
| | | }else{ |
| | | // 常规提交 |
| | | const newJuOrder = {...this.addObj,typeSource:-1} |
| | | delete newJuOrder.temperature |
| | | delete newJuOrder.humidity |
| | | const payload = this.addObj.standardTreeId |
| | | ? { insOrder: {...this.addObj,typeSource:-1}, standardTreeId: this.addObj.standardTreeId, sampleCode: this.sampleCode } |
| | | ? { insOrder: newJuOrder, standardTreeId: this.addObj.standardTreeId, sampleCode: this.sampleCode } |
| | | : { insOrder: {...this.addObj,typeSource:-1}, sampleList: sampleList } |
| | | addInsOrder(payload).then(res => { |
| | | this.saveLoad = false |
| | |
| | | const productName = this.selectTreeNode.data.label |
| | | this.addObj.sample = productName |
| | | this.addObj.standardTreeId = this.selectTreeNode.data.id |
| | | this.loadTemplateBindings(this.addObj.standardTreeId) |
| | | this.selectStandardTree = false |
| | | this.sampleList = [] |
| | | }, |
| | | sortTemplateList(list) { |
| | | return (list || []).slice().sort((a, b) => (a.sort || 0) - (b.sort || 0)) |
| | | }, |
| | | async loadTemplateBindings(standardTreeId) { |
| | | this.boundTemplateList = [] |
| | | if (!standardTreeId) return |
| | | this.templateBindingLoading = true |
| | | try { |
| | | const res = await selectTemplateBindings({standardTreeId}) |
| | | this.boundTemplateList = this.sortTemplateList(res.data) |
| | | } finally { |
| | | this.templateBindingLoading = false |
| | | } |
| | | }, |
| | | // 用指定型号替换树路径末段(末段即标准/型号) |
| | | buildFactoryPath(model) { |
| | |
| | | color: orange; |
| | | font-size: 18px; |
| | | } |
| | | .template-tag-list { |
| | | min-height: 32px; |
| | | display: flex; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | gap: 8px; |
| | | } |
| | | .empty-template-text { |
| | | color: #909399; |
| | | } |
| | | </style> |
| | |
| | | <el-col :span="6"><el-form-item label="委托单位"><el-input v-model="addObj.company" disabled size="small" /></el-form-item></el-col> |
| | | <el-col :span="6"><el-form-item label="检验类别"><el-select v-model="addObj.orderType" disabled size="small"><el-option v-for="item in dict.type.check_type1" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item></el-col> |
| | | </el-row> |
| | | <el-row v-if="boundTemplateList.length"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="原始记录模板"> |
| | | <div class="template-tag-list"> |
| | | <el-tag v-for="item in boundTemplateList" :key="item.templateId" size="small" effect="plain">{{ item.name }}</el-tag> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"><el-form-item label="样品数量"><el-input v-model="addObj.testQuantity" disabled size="small" /></el-form-item></el-col> |
| | | <el-col :span="6"><el-form-item label="样品编号"><el-input v-model="sampleCode" disabled size="small" /></el-form-item></el-col> |
| | |
| | | <el-col :span="6"><el-form-item label="联系方式"><el-input v-model="addObj.phone" disabled size="small" /></el-form-item></el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="6"><el-form-item label="环境条件"><el-input v-model="addObj.temperature" disabled placeholder="温度" size="small" /></el-form-item></el-col> |
| | | <el-col :span="6"><el-form-item label="湿度"><el-input v-model="addObj.humidity" disabled size="small" /></el-form-item></el-col> |
| | | <el-col :span="12"><el-form-item label="备注"><el-input v-model="addObj.remark" disabled size="small" style="width: 520px" /></el-form-item></el-col> |
| | | </el-row> |
| | | </el-form> |
| | |
| | | tabIndex: '', |
| | | currentId: '', |
| | | sampleCode: '', |
| | | boundTemplateList: [], |
| | | sampleSelectionList: [],//样品表格选中数据 |
| | | editTable:[], |
| | | template: null, |
| | |
| | | orderType: null, |
| | | send: 1, |
| | | formType: '送检', // 来样方式 |
| | | sampleStatus: 'In good condition', // 样品状态 |
| | | sampleStatus: '', // 样品状态 |
| | | testQuantity: '', // 样品状态 |
| | | production: null, |
| | | productionEn: null, |
| | |
| | | this.addObj.type = String(this.addObj.type) |
| | | this.sampleList = this.HaveJson(res.data.sampleProduct); |
| | | this.sampleCode = this.sampleList.length ? this.sampleList[0].sampleCode : '' |
| | | this.boundTemplateList = (res.data.templateList || []).slice().sort((a, b) => (a.sort || 0) - (b.sort || 0)) |
| | | this.specialStandardMethod = this.sampleList[0].specialStandardMethod |
| | | this.getProNum() |
| | | this.addObj.sampleNum = this.sampleList.length |
| | |
| | | color: orange; |
| | | font-size: 18px; |
| | | } |
| | | .template-tag-list { |
| | | min-height: 32px; |
| | | display: flex; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | gap: 8px; |
| | | } |
| | | </style> |
| | |
| | | :isSelection="true" :handleSelectionChange="handleChange" :height="'calc(100vh - 290px)'" |
| | | @pagination="pagination" key="valueTableData"> |
| | | <div slot="action" slot-scope="scope"> |
| | | <el-button size="small" type="text" @click="viewIssued(scope.row)">查看报告</el-button> |
| | | <!-- <el-button size="small" type="text" @click="viewIssued(scope.row)">查看报告</el-button>--> |
| | | <el-upload ref='upload1' style="display: inline;margin: 0 6px" :action="fileAction1 + '?id=' + scope.row.id" |
| | | :auto-upload="true" :before-upload="fileBeforeUpload1" :headers="uploadHeader" :on-error="onError1" |
| | | :on-success="handleSuccessUp1" :show-file-list="false" accept='.doc,.docx'> |
| | | <el-button size="small" type="text" |
| | | :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName">上传</el-button> |
| | | </el-upload> |
| | | <el-button type="text" size="small" :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName" |
| | | @click="handleRestore(scope.row)">还原</el-button> |
| | | <!-- <el-button type="text" size="small" :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName"--> |
| | | <!-- @click="handleRestore(scope.row)">还原</el-button>--> |
| | | <el-button type="text" size="small" :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName" |
| | | @click="sendBackTask(scope.row)">退回任务</el-button> |
| | | <el-button type="text" size="small" :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName" |
| | |
| | | <el-button type="text" size="small" |
| | | :disabled="scope.row.state == null || scope.row.state == 0 || scope.row.isExamine == 0 || scope.row.isExamine == null || scope.row.isRatify == 1 || nickName !== scope.row.ratifyUser" |
| | | @click="handleApprove(scope.row)">批准</el-button> |
| | | <el-popover placement="bottom" trigger="hover" style="margin-left: 6px"> |
| | | <template #reference> |
| | | <el-button link type="text" size="small">更多</el-button> |
| | | </template> |
| | | <div> |
| | | <el-button style="margin-left: 10px" type="text" size="small" @click="download(scope.row)">下载</el-button> |
| | | <el-button type="text" size="small" @click="viewInspectInfo(scope.row)">原始记录</el-button> |
| | | <el-button type="text" size="small" @click="handleFileLook(scope.row)">附件上传</el-button> |
| | | </div> |
| | | </el-popover> |
| | | <el-button style="margin-left: 10px" type="text" size="small" |
| | | :disabled="!scope.row.url && !scope.row.urlS" @click="download(scope.row)">下载</el-button> |
| | | <el-button type="text" size="small" @click="viewInspectInfo(scope.row)">原始记录</el-button> |
| | | <el-button type="text" size="small" @click="handleFileLook(scope.row)">附件上传</el-button> |
| | | </div> |
| | | </lims-table> |
| | | </div> |
| | |
| | | // import ShowInfo from "../do/b1-material-ins-order/showInfo.vue"; |
| | | import { |
| | | downAll, |
| | | downloadReport, |
| | | examineReport, |
| | | pageInsReport, |
| | | ratifyReport, |
| | |
| | | } |
| | | }, |
| | | download(row) { |
| | | let url = row.urlS ? row.urlS : row.url; |
| | | const link = document.createElement('a'); |
| | | link.href = this.javaApi + url; |
| | | link.target = '_blank'; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | downloadReport(row.id).then(res => { |
| | | if (res.type && res.type.includes('application/json')) { |
| | | const reader = new FileReader() |
| | | reader.onload = () => { |
| | | try { |
| | | this.$message.error(JSON.parse(reader.result).msg || '报告下载失败') |
| | | } catch (e) { |
| | | this.$message.error('报告下载失败') |
| | | } |
| | | } |
| | | reader.readAsText(res) |
| | | return |
| | | } |
| | | const reportUrl = row.urlS || row.url || '' |
| | | const filename = decodeURIComponent(reportUrl.substring(reportUrl.lastIndexOf('/') + 1)) || `${row.code}.docx` |
| | | this.$download.saveAs(res, filename) |
| | | }).catch(() => { |
| | | this.$message.error('报告下载失败') |
| | | }) |
| | | }, |
| | | // 还原操作 |
| | | handleRestore(row) { |
| | |
| | | return "断裂脆化"; |
| | | } |
| | | } |
| | | // 参数代入后含中文时(如检验值填了"均匀"),不能再当公式 eval —— |
| | | // eval("均匀") 会抛 ReferenceError,被外层 catch 吞掉后返回 undefined, |
| | | // 该单元格的结果既不写回也不向下游公式传递,整条计算链断在这里 |
| | | if (/[一-龥]/.test(str)) { |
| | | return str.trim(); |
| | | } |
| | | // 计算常规的 |
| | | const value = eval(str); |
| | | // 除零等非有限结果不写回单元格(与 Excel 的 #DIV/0! 一致:不出值) |