| | |
| | | <template> |
| | | <div v-loading="loading" class="inspection"> |
| | | <div v-loading="loading" class="inspection" style="background-color: rgb(245, 247, 251);"> |
| | | <el-row class="title"> |
| | | <el-col :span="8" style="text-align: left"> |
| | | <el-form :inline="true" :model="otherForm" class="form-inline" label-width="50px" |
| | |
| | | </el-form> |
| | | </el-col> |
| | | <el-col :span="16" style="text-align: right"> |
| | | <!-- <el-button size="small" type="primary" @click="refreshView">刷新</el-button> --> |
| | | <el-button v-if="typeSource === 1" size="small" type="primary" @click="openPurchase">进货验证</el-button> |
| | | <el-button v-if="state === 1 && typeSource === 1" size="small" type="primary" |
| | | @click="openUnPassDialog('add')">不合格处理</el-button> |
| | | <el-button size="small" type="primary" @click=" |
| | | sampleVisible = true; |
| | | uploadSample(); |
| | | ">样品切换</el-button> |
| | | <el-button size="small" type="primary" @click="refreshView">刷新</el-button> |
| | | <el-button v-if="typeSource == 1" size="small" type="primary" @click="openPurchase">进货验证</el-button> |
| | | <el-button v-if="state == 1 && typeSource == 1" size="small" type="primary" @click="openUnPassDialog('add')">不合格处理</el-button> |
| | | <el-button size="small" type="primary" @click="sampleVisible = true;uploadSample();">样品切换</el-button> |
| | | <el-button v-if="state == 1" size="small" type="primary" @click="taskVisible = true">任务切换</el-button> |
| | | <el-button v-if="state == 1" size="small" type="primary" @click="addVerifyDia = true">提交</el-button> |
| | | <!-- 复核 --> |
| | | <el-button v-if="state == 2" size="medium" type="primary" @click="openAddCheck">通过</el-button> |
| | | <el-button v-if="state == 2" size="medium" @click="upInsReview(0)">不通过</el-button> |
| | | <el-button type="primary" size="small" @click="exportTable('myTable')">下载原始记录</el-button> |
| | | <el-button size="small" @click="$emit('goback')">返回</el-button> |
| | | <el-button size="small" @click="goback">返回</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="search"> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="备注:"> |
| | | <!-- <span style="color:red">{{ insOrder.remark?insOrder.remark:'-' }}</span>--> |
| | | <el-input v-model="insOrder.remark" :disabled="state !== 1" clearable placeholder="请输入" size="small" |
| | | <el-input v-model="insOrder.remark" :disabled="state != 1" clearable placeholder="请输入" size="small" |
| | | @blur="subOtherForm(insOrder.remark, 'remark')"></el-input> |
| | | <!-- <el-tag v-if="currentKey">{{ insOrder.remark }}</el-tag> --> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-divider></el-divider> |
| | | </div> |
| | | <div class="center"> |
| | | <div class="search" style=" |
| | |
| | | </el-radio-group> |
| | | </div> |
| | | <div style="display: flex; align-items: center"> |
| | | <el-button v-if="state === 1" size="small" type="primary" @click="openAddUnpass">新增不合格复测</el-button> |
| | | <el-button v-if="state === 1" size="small" type="primary" @click="unpassCheck">不合格复测</el-button> |
| | | <el-button v-if="state == 1" size="small" type="primary" @click="openAddUnpass">新增不合格复测</el-button> |
| | | <el-button v-if="state == 1" size="small" type="primary" @click="unpassCheck">不合格复测</el-button> |
| | | <el-button v-if="state > 1" size="small" type="primary" @click="viewUnpassCheck">查看不合格复测</el-button> |
| | | <span v-if="cableTagList.length > 0"> 电缆配置:</span> |
| | | <el-select v-if="cableTagList.length > 0" v-model="currentTab" clearable placeholder="请选择" size="small" |
| | |
| | | </div> |
| | | <el-upload v-if="state == 1" ref="upload" :action="action" :before-upload="beforeUpload" :data="{ |
| | | orderId: id, |
| | | }" :headers="headers" :on-error="onError" :on-success="handleSuccessUp" :show-file-list="false" |
| | | }" :headers="uploadHeader" :on-error="onError" :on-success="handleSuccessUp" :show-file-list="false" |
| | | accept=".jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar" |
| | | style="width: 80px !important;margin-top: 10px;"> |
| | | <el-button v-if="state == 1" size="small" type="primary">附件上传</el-button></el-upload> |
| | |
| | | <el-button :loading="reviewLoading" type="primary" @click="upInsReview(1)">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!-- <add-un-pass v-if="addUnPassDialog" ref="addUnPassDialog" :addUnPassDialog="addUnPassDialog" |
| | | @resetAddUnPass="resetAddUnPass"></add-un-pass> --> |
| | | <!-- <UnPassDialog |
| | | v-if="unPassDialog" |
| | | ref="unPassDialog" |
| | | :orderId="orderId" |
| | | :unPassDialog="unPassDialog" |
| | | @resetForm="resetForm" |
| | | ></UnPassDialog> --> |
| | | <!-- <InspectionWord |
| | | v-if="unPassCheck" |
| | | :inspectorList="inspectorList" |
| | | :orderId="orderId" |
| | | :rawMaterialTag="rawMaterialTag" |
| | | :sonLaboratory="sonLaboratory" |
| | | :state="state" |
| | | :typeSource="typeSource" |
| | | :unPassCheck="unPassCheck" |
| | | @closeUnPassCheckDialog="closeUnPassCheckDialog" |
| | | @refreshView="refreshView" |
| | | /> --> |
| | | <!-- <purchase-verification |
| | | v-if="purchaseDialog" |
| | | ref="purchaseDialog" |
| | | :orderId="orderId" |
| | | :purchaseDialog="purchaseDialog" |
| | | @resetPurchaseDialog="resetPurchaseDialog" |
| | | ></purchase-verification> --> |
| | | <add-un-pass v-if="addUnPassDialog" ref="addUnPassDialog" :addUnPassDialog="addUnPassDialog" |
| | | @resetAddUnPass="resetAddUnPass"></add-un-pass> |
| | | <UnPassDialog v-if="unPassDialog" ref="unPassDialog" :orderId="orderId" :unPassDialog="unPassDialog" |
| | | @resetForm="resetForm"></UnPassDialog> |
| | | <InspectionWord v-if="unPassCheck" :inspectorList="inspectorList" :orderId="orderId" |
| | | :rawMaterialTag="rawMaterialTag" :sonLaboratory="sonLaboratory" :state="state" :typeSource="typeSource" |
| | | :unPassCheck="unPassCheck" @closeUnPassCheckDialog="closeUnPassCheckDialog" @refreshView="refreshView" /> |
| | | <purchase-verification v-if="purchaseDialog" ref="purchaseDialog" :orderId="orderId" |
| | | :purchaseDialog="purchaseDialog" @resetPurchaseDialog="resetPurchaseDialog"></purchase-verification> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import excelFunction from "@/utils/excelFountion"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | // import UnPassDialog from "../b1-unpass-manage/unPassDialog.vue"; |
| | | // import AddUnPass from "../b1-unpass-manage/addUnPass.vue"; |
| | | // import InspectionWord from "./InspectionWord.vue"; |
| | | // import PurchaseVerification from "../b1-unpass-manage/PurchaseVerification.vue"; |
| | | import UnPassDialog from "../unpass/components/addUnPass.vue"; |
| | | import AddUnPass from "../unpass/components/addUnPass.vue"; |
| | | import InspectionWord from "./components/InspectionWord.vue"; |
| | | import PurchaseVerification from "../unpass/components/PurchaseVerification.vue"; |
| | | import { |
| | | doInsOrder, |
| | | getCableTag, |
| | |
| | | import html2canvas from "html2canvas"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | // props: ["sonLaboratory", "orderId", "state", "inspectorList", "typeSource"], |
| | | name: 'inspection', |
| | | components: { |
| | | // PurchaseVerification, |
| | | // AddUnPass, |
| | | PurchaseVerification, |
| | | AddUnPass, |
| | | limsTable, |
| | | // UnPassDialog, |
| | | // InspectionWord, |
| | | UnPassDialog, |
| | | InspectionWord, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | // 用于上传文件的信息 |
| | | computed: { |
| | | ...mapGetters(["userId"]), |
| | | headers() { |
| | | return { |
| | | token: sessionStorage.getItem("token"), |
| | | }; |
| | | }, |
| | | action() { |
| | | return this.javaApi + "/insOrderPlan/uploadFile"; |
| | | }, |
| | |
| | | watch: { |
| | | // 监听任务id,获取任务信息 |
| | | id(val) { |
| | | this.loading = true; |
| | | doInsOrder({ |
| | | id: val, |
| | | laboratory: this.sonLaboratory, |
| | | }).then(async (res) => { |
| | | this.insOrder = res.data.insOrder; |
| | | this.supplierDensity = res.data.supplierDensity; |
| | | this.getList() |
| | | this.urgentList.forEach((m) => { |
| | | if (m.value == this.insOrder.type) { |
| | | this.insOrder.typeName = m.label; |
| | | } |
| | | }); |
| | | this.loading = false; |
| | | if (!res.data.sampleProduct || res.data.sampleProduct.length == 0) { |
| | | this.$emit("goback"); |
| | | return this.$message.error("该任务没有样品信息"); |
| | | } |
| | | // 赋值当前样品列表 |
| | | this.sampleProduct = res.data.sampleProduct; |
| | | this.currentSample = this.HaveJson(this.sampleProduct[0]); |
| | | let insProduct = this.HaveJson(this.currentSample.insProduct); |
| | | // 温度、湿度赋值 |
| | | this.otherForm = { |
| | | temperature: this.insOrder.temperature |
| | | ? this.insOrder.temperature |
| | | : null, |
| | | humidity: this.insOrder.humidity ? this.insOrder.humidity : null, |
| | | }; |
| | | if (this.typeSource == "1") { |
| | | this.getRawMaterialTag(this.currentSample.id); // 原材料的检验任务查询批数 |
| | | this.rawMaterialTag = "1"; |
| | | } |
| | | this.getEquipOptions(1); |
| | | // 获取当前样品的检验项 |
| | | let list = await this.getCurrentProduct(this.currentSample.id, 0); |
| | | this.currentSample.insProduct = this.HaveJson(list); |
| | | // 初始化传递到后端的参数 |
| | | this.param = {}; |
| | | this.changeType = 0; |
| | | this.currentSample.insProduct.forEach((a) => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null, |
| | | }; |
| | | }); |
| | | if (this.currentSample.index == undefined) |
| | | this.currentSample["index"] = 1; |
| | | let bushing = this.currentSample.bushing; |
| | | this.getTableLists(); //处理模板列表信息 |
| | | |
| | | this.currentKey = 1; |
| | | this.getCableTag(this.currentSample.id); // 查询是否有要多次检验的电缆配置 |
| | | this.getRepetitionTag(this.currentSample.id); // 查询是否有要重复检验项 |
| | | }); |
| | | this.refreshView() |
| | | }, |
| | | // 监听当前模板变化 |
| | | currentTable(val1, val0) { |
| | |
| | | this.checkUser = ""; |
| | | }, |
| | | // 刷新页面 |
| | | // refreshView() { |
| | | // this.$emit("refreshView"); |
| | | // }, |
| | | refreshView() { |
| | | this.loading = true; |
| | | doInsOrder({ |
| | | id: this.id, |
| | | laboratory: this.sonLaboratory, |
| | | }).then(async (res) => { |
| | | this.insOrder = res.data.insOrder; |
| | | this.supplierDensity = res.data.supplierDensity; |
| | | this.getList() |
| | | this.urgentList.forEach((m) => { |
| | | if (m.value == this.insOrder.type) { |
| | | this.insOrder.typeName = m.label; |
| | | } |
| | | }); |
| | | this.loading = false; |
| | | if (!res.data.sampleProduct || res.data.sampleProduct.length == 0) { |
| | | this.goback(); |
| | | return this.$message.error("该任务没有样品信息"); |
| | | } |
| | | // 赋值当前样品列表 |
| | | this.sampleProduct = res.data.sampleProduct; |
| | | this.currentSample = this.HaveJson(this.sampleProduct[0]); |
| | | let insProduct = this.HaveJson(this.currentSample.insProduct); |
| | | // 温度、湿度赋值 |
| | | this.otherForm = { |
| | | temperature: this.insOrder.temperature |
| | | ? this.insOrder.temperature |
| | | : null, |
| | | humidity: this.insOrder.humidity ? this.insOrder.humidity : null, |
| | | }; |
| | | if (this.typeSource == "1") { |
| | | this.getRawMaterialTag(this.currentSample.id); // 原材料的检验任务查询批数 |
| | | this.rawMaterialTag = "1"; |
| | | } |
| | | this.getEquipOptions(1); |
| | | // 获取当前样品的检验项 |
| | | let list = await this.getCurrentProduct(this.currentSample.id, 0); |
| | | this.currentSample.insProduct = this.HaveJson(list); |
| | | // 初始化传递到后端的参数 |
| | | this.param = {}; |
| | | this.changeType = 0; |
| | | this.currentSample.insProduct.forEach((a) => { |
| | | this.param[a.id] = { |
| | | insValue: [], |
| | | comValue: [], |
| | | resValue: null, |
| | | equipValue: [], |
| | | equipName: [], |
| | | insResult: null, |
| | | }; |
| | | }); |
| | | if (this.currentSample.index == undefined) |
| | | this.currentSample["index"] = 1; |
| | | let bushing = this.currentSample.bushing; |
| | | this.getTableLists(); //处理模板列表信息 |
| | | |
| | | this.currentKey = 1; |
| | | this.getCableTag(this.currentSample.id); // 查询是否有要多次检验的电缆配置 |
| | | this.getRepetitionTag(this.currentSample.id); // 查询是否有要重复检验项 |
| | | }); |
| | | }, |
| | | closeUnPassCheckDialog() { |
| | | this.unPassCheck = false; |
| | | }, |
| | |
| | | }, |
| | | // 打开进货验证弹框 |
| | | openPurchase() { |
| | | const operationType = this.state === 1 ? "add" : "view"; |
| | | const operationType = this.state == 1 ? "add" : "view"; |
| | | this.purchaseDialog = true; |
| | | const item = { |
| | | id: this.currentSample.id, |
| | |
| | | this.dataAcquisitionInfoNew = this.HaveJson(res.data); |
| | | // 对数采回来的值进行处理 |
| | | this.handleDataAcquisition(res.data); |
| | | }).catch(err => { |
| | | this.dataAcquisitionLoading = false; |
| | | }); |
| | | }, |
| | | objectOrder(obj) { |
| | |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$emit("goback"); |
| | | this.goback(); |
| | | this.addCheck = false; |
| | | } |
| | | this.reviewLoading = false; |
| | |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$emit("goback"); |
| | | this.goback(); |
| | | } |
| | | this.reviewLoading = false; |
| | | }) |
| | |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.$emit("goback"); |
| | | this.goback(); |
| | | this.submitLoading = false; |
| | | this.addVerifyDia = false; |
| | | } |
| | |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.addVerifyDia = false; |
| | | this.$emit("goback"); |
| | | this.goback(); |
| | | } |
| | | this.submitLoading = false; |
| | | }) |
| | |
| | | return v; |
| | | } |
| | | }, |
| | | goback() { |
| | | this.$tab.closeOpenPage({ path: "/business/inspectionTask" }); |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | >>>.el-divider { |
| | | margin: 0 !important; |
| | | } |
| | | |
| | | .custom-table .el-table__header-wrapper th { |
| | | background-color: #87ceeb; |
| | | /* 只对带有my-custom-table类的表格生效 */ |
| | |
| | | width: 100%; |
| | | background-color: #fff; |
| | | border-radius: 3px; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .search .form-inline { |
| | |
| | | align-items: center; |
| | | } |
| | | </style> |
| | | <style> |
| | | .inspection .el-form-item__label { |
| | | <style scoped> |
| | | /* .inspection .el-form-item__label { |
| | | color: #000; |
| | | } |
| | | } */ |
| | | |
| | | .inspection .el-drawer__header::before { |
| | | content: ""; |