|
|
@@ -12,25 +12,25 @@
|
|
|
<header-title title="基础信息"> </header-title>
|
|
|
<el-form
|
|
|
label-width="115px"
|
|
|
- :model="{}"
|
|
|
- :rules="[]"
|
|
|
+ :model="form"
|
|
|
+ :rules="[{}]"
|
|
|
ref="formRef"
|
|
|
:disabled="type == 'detail'"
|
|
|
>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="质检项:" prop="inspectionName">
|
|
|
- {{ projectData.inspectionName }}</el-form-item
|
|
|
+ {{ tableData[0].inspectionName }}</el-form-item
|
|
|
>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="编码:" prop="inspectionCode">
|
|
|
- {{ projectData.inspectionCode }}
|
|
|
+ {{ tableData[0].inspectionCode }}
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="批次号:" prop="batchNo">
|
|
|
- {{ projectData.batchNo }}
|
|
|
+ {{ tableData[0].batchNo }}
|
|
|
</el-form-item>
|
|
|
</el-col></el-row
|
|
|
>
|
|
|
@@ -38,25 +38,18 @@
|
|
|
<ele-pro-table
|
|
|
:needPage="false"
|
|
|
:columns="workColumns"
|
|
|
- :datasource="[projectData]"
|
|
|
+ :datasource="tableData"
|
|
|
>
|
|
|
- <template v-slot:qualityResultContent="{ row }">
|
|
|
- <el-input
|
|
|
- v-model="row.qualityResultContent"
|
|
|
- placeholder="请输入内容"
|
|
|
- :disabled="type == 'detail'"
|
|
|
- @input="handleInput(row, row.qualityResultContent)"
|
|
|
- >
|
|
|
- <template slot="append" v-if="row.unitName">
|
|
|
- {{ row.unitName }}
|
|
|
- </template>
|
|
|
- </el-input>
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ 当前质检剩余样品数:{{ getSampleQuantityCount1 }}
|
|
|
</template>
|
|
|
<template v-slot:sampleQuantity="{ row, $index }">
|
|
|
<el-input
|
|
|
v-model="row.sampleQuantity"
|
|
|
placeholder="请输入"
|
|
|
+ :disabled="type == 'detail'"
|
|
|
type="number"
|
|
|
+ @input="inputValue('sampleQuantity', row, $index)"
|
|
|
>
|
|
|
</el-input>
|
|
|
</template>
|
|
|
@@ -67,6 +60,7 @@
|
|
|
placeholder="请输入"
|
|
|
:disabled="type == 'detail'"
|
|
|
type="number"
|
|
|
+ @input="inputValue('qualifiedQuantity', row, $index)"
|
|
|
>
|
|
|
</el-input>
|
|
|
</template>
|
|
|
@@ -76,6 +70,7 @@
|
|
|
placeholder="请输入"
|
|
|
:disabled="type == 'detail'"
|
|
|
type="number"
|
|
|
+ @input="inputValue('noQualifiedQuantity', row, $index)"
|
|
|
>
|
|
|
</el-input>
|
|
|
</template>
|
|
|
@@ -85,6 +80,8 @@
|
|
|
placeholder="请输入"
|
|
|
:disabled="type == 'detail'"
|
|
|
type="number"
|
|
|
+ @input="inputValue('lossNumber', row, $index)"
|
|
|
+ @click.native="curretNum = row.lossNumber"
|
|
|
>
|
|
|
</el-input>
|
|
|
</template>
|
|
|
@@ -94,6 +91,8 @@
|
|
|
placeholder="请输入"
|
|
|
:disabled="type == 'detail'"
|
|
|
type="number"
|
|
|
+ @input="inputValue('lossNumberUnqualified', row, $index)"
|
|
|
+ @click.native="curretNum = row.lossNumberUnqualified"
|
|
|
>
|
|
|
</el-input>
|
|
|
</template>
|
|
|
@@ -103,6 +102,8 @@
|
|
|
placeholder="请输入"
|
|
|
:disabled="type == 'detail'"
|
|
|
type="number"
|
|
|
+ @input="inputValue('retainedSampleQuantity', row, $index)"
|
|
|
+ @click.native="curretNum = row.retainedSampleQuantity"
|
|
|
>
|
|
|
</el-input>
|
|
|
</template>
|
|
|
@@ -112,40 +113,37 @@
|
|
|
placeholder="请输入"
|
|
|
:disabled="type == 'detail'"
|
|
|
type="number"
|
|
|
+ @input="inputValue('retainedSampleUnqualified', row, $index)"
|
|
|
+ @click.native="curretNum = row.retainedSampleUnqualified"
|
|
|
>
|
|
|
- </el-input> </template
|
|
|
- ></ele-pro-table>
|
|
|
- <header-title title="实验数据"> </header-title>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ <header-title title="实验数据" style="margin-top: 15px"> </header-title>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="实验编号:" prop="industryType">
|
|
|
- <el-input
|
|
|
- v-model="form.retainedSampleUnqualified1"
|
|
|
- placeholder="请输入"
|
|
|
- :disabled="true"
|
|
|
- type="number"
|
|
|
- >
|
|
|
+ <el-form-item label="实验编号:" prop="code">
|
|
|
+ <el-input v-model="form.code" placeholder="请输入" :disabled="true">
|
|
|
</el-input>
|
|
|
</el-form-item> </el-col
|
|
|
></el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="实验时间:" prop="industryType">
|
|
|
+ <el-form-item label="实验时间:" prop="experimentalTime">
|
|
|
<el-date-picker
|
|
|
- v-model="form.retainedSampleUnqualified2"
|
|
|
+ v-model="form.experimentalTime"
|
|
|
type="datetime"
|
|
|
placeholder="选择日期时间"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="执行标准:" prop="pcode">
|
|
|
+ <el-form-item label="执行标准:" prop="qualityStandardName">
|
|
|
<el-input
|
|
|
- :value="
|
|
|
- getDictValue('质检标准类型', projectData.qualityStandardType)
|
|
|
- "
|
|
|
+ :value="getDictValue('质检标准类型', form.qualityStandardName)"
|
|
|
placeholder="请输入"
|
|
|
:disabled="true"
|
|
|
>
|
|
|
@@ -156,9 +154,9 @@
|
|
|
<header-title title="实验试/实验设备"> </header-title>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="实验室:" prop="industryType">
|
|
|
+ <el-form-item label="实验室:" prop="workshopId">
|
|
|
<el-select
|
|
|
- v-model="form.retainedSampleUnqualified3"
|
|
|
+ v-model="form.workshopId"
|
|
|
style="width: 100%"
|
|
|
placeholder="请选择"
|
|
|
>
|
|
|
@@ -167,28 +165,29 @@
|
|
|
:key="item.workshopId"
|
|
|
:label="item.workshopName"
|
|
|
:value="item.workshopId"
|
|
|
+ @click.native="form.workshopName = item.workshopName"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row v-for="(item, index) in laboratoryItemList">
|
|
|
+ <el-row v-for="(item, index) in form.experimentEquipmentList">
|
|
|
<el-col :span="24">
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item
|
|
|
:label="'实验设备' + (index + 1) + ':'"
|
|
|
- prop="industryType"
|
|
|
+ prop="equipmentName"
|
|
|
>
|
|
|
- <el-select
|
|
|
- v-model="item.retainedSampleUnqualified4"
|
|
|
- style="width: calc(100% - 30px)"
|
|
|
+ <el-input
|
|
|
placeholder="请选择"
|
|
|
+ v-model="item.equipmentName"
|
|
|
+ @click.native="equipmentOpen(index)"
|
|
|
+ readonly
|
|
|
+ style="width: calc(100% - 30px)"
|
|
|
>
|
|
|
- <el-option :label="'测试设备1'" :value="1"> </el-option>
|
|
|
- <el-option :label="'测试设备2'" :value="2"> </el-option>
|
|
|
- </el-select>
|
|
|
+ </el-input>
|
|
|
<i
|
|
|
class="el-icon-delete"
|
|
|
style="
|
|
|
@@ -206,22 +205,24 @@
|
|
|
<el-col :span="24">
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="开始时间:" prop="industryType">
|
|
|
+ <el-form-item label="开始时间:" prop="startTime">
|
|
|
<el-date-picker
|
|
|
- v-model="item.retainedSampleUnqualified5"
|
|
|
+ v-model="item.startTime"
|
|
|
type="datetime"
|
|
|
placeholder="选择日期时间"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
</el-date-picker
|
|
|
></el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="结束时间:" prop="industryType">
|
|
|
+ <el-form-item label="结束时间:" prop="endTime">
|
|
|
<el-date-picker
|
|
|
- v-model="item.retainedSampleUnqualified6"
|
|
|
+ v-model="item.endTime"
|
|
|
type="datetime"
|
|
|
placeholder="选择日期时间"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
</el-date-picker
|
|
|
@@ -232,9 +233,9 @@
|
|
|
<el-col :span="24">
|
|
|
<el-row>
|
|
|
<el-col :span="16">
|
|
|
- <el-form-item label="运行参数:" prop="industryType">
|
|
|
+ <el-form-item label="运行参数:" prop="operatingParameters">
|
|
|
<el-input
|
|
|
- v-model="item.retainedSampleUnqualified7"
|
|
|
+ v-model="item.operatingParameters"
|
|
|
placeholder="请输入"
|
|
|
>
|
|
|
</el-input
|
|
|
@@ -246,7 +247,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label=" " prop="industryType">
|
|
|
- <el-button type="primary" @click="addlLaboratoryItemList">
|
|
|
+ <el-button type="primary" @click="addExperimentEquipmentList">
|
|
|
新增实验设备
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
@@ -267,25 +268,26 @@
|
|
|
type="textarea"
|
|
|
:rows="1"
|
|
|
placeholder="请输入内容"
|
|
|
- v-model="projectData.defaultValue"
|
|
|
+ :disabled="true"
|
|
|
+ v-model="form.processRequirementsJson"
|
|
|
>
|
|
|
</el-input>
|
|
|
|
|
|
- <el-row> <el-col :span="24"> </el-col></el-row>
|
|
|
- <header-title title="实验工具"> </header-title>
|
|
|
- <el-button type="primary" size="small" @click="handleAdd('unitList')"
|
|
|
+ <header-title title="实验工具" style="margin-top: 15px"> </header-title>
|
|
|
+ <el-button type="primary" size="small" @click="handleAdd('toolJson')"
|
|
|
>选择实验工具</el-button
|
|
|
>
|
|
|
<ele-pro-table
|
|
|
:needPage="false"
|
|
|
:columns="unitColumns"
|
|
|
- :datasource="unitList"
|
|
|
+ :datasource="form.toolJson"
|
|
|
+ style="margin-top: 15px"
|
|
|
>
|
|
|
<template v-slot:action="{ row, $index }">
|
|
|
<el-popconfirm
|
|
|
class="ele-action"
|
|
|
title="确定要删除此条数据吗?"
|
|
|
- @confirm="remove($index, 'unitList')"
|
|
|
+ @confirm="remove($index, 'toolJson')"
|
|
|
>
|
|
|
<template v-slot:reference>
|
|
|
<el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
@@ -295,14 +297,19 @@
|
|
|
</el-popconfirm>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
- <header-title title="实验耗材"> </header-title>
|
|
|
- <el-button type="primary" size="small" @click="handleAdd('unitList1')"
|
|
|
+
|
|
|
+ <header-title title="实验耗材" style="margin-top: 15px"> </header-title>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click="handleAdd('consumablesJson')"
|
|
|
>选择实验耗材</el-button
|
|
|
>
|
|
|
<ele-pro-table
|
|
|
:needPage="false"
|
|
|
:columns="unitColumns1"
|
|
|
- :datasource="unitList1"
|
|
|
+ style="margin-top: 15px"
|
|
|
+ :datasource="form.consumablesJson"
|
|
|
>
|
|
|
<template v-slot:remark="{ row, $index }">
|
|
|
<el-input type="textarea" v-model="row.remark"></el-input>
|
|
|
@@ -311,7 +318,7 @@
|
|
|
<el-popconfirm
|
|
|
class="ele-action"
|
|
|
title="确定要删除此条数据吗?"
|
|
|
- @confirm="remove($index, 'unitList1')"
|
|
|
+ @confirm="remove($index, 'consumablesJson')"
|
|
|
>
|
|
|
<template v-slot:reference>
|
|
|
<el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
@@ -321,24 +328,24 @@
|
|
|
</el-popconfirm>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
- <header-title title="实验记录"> </header-title>
|
|
|
+ <header-title title="实验记录" style="margin-top: 15px"> </header-title>
|
|
|
<el-button type="primary" size="small" @click="releaseRulesRefOpen(7)"
|
|
|
>选择实验记录</el-button
|
|
|
>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<experimentationProcess
|
|
|
- ref="experimentationProcess3"
|
|
|
+ ref="experimentationProcess2"
|
|
|
></experimentationProcess> </el-col
|
|
|
></el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="16">
|
|
|
- <el-form-item label="实验结果:" prop="industryType">
|
|
|
+ <el-form-item label="实验结果:" prop="resultsDescription">
|
|
|
<el-input
|
|
|
- type="textarea"
|
|
|
+ type="resultsDescription"
|
|
|
:rows="4"
|
|
|
placeholder="请输入内容"
|
|
|
- v-model="projectData.textarea"
|
|
|
+ v-model="form.resultsDescription"
|
|
|
>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
@@ -346,11 +353,8 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="实验结论:" prop="industryType">
|
|
|
- <el-select
|
|
|
- v-model="projectData.retainedSampleUnqualified9"
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
+ <el-form-item label="实验结论:" prop="results">
|
|
|
+ <el-select v-model="form.results" placeholder="请选择">
|
|
|
<el-option :label="'合格'" :value="1"> </el-option>
|
|
|
<el-option :label="'不合格'" :value="2"> </el-option>
|
|
|
</el-select>
|
|
|
@@ -359,12 +363,16 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="实验图片:" prop="industryType"> </el-form-item>
|
|
|
+ <el-form-item label="实验图片:" prop="imgUrl">
|
|
|
+ <imgList v-model="form.imgUrl"></imgList>
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="附件图片:" prop="industryType"> </el-form-item>
|
|
|
+ <el-form-item label="附件图片:" prop="attachmentUrl">
|
|
|
+ <imgList v-model="form.attachmentUrl"></imgList>
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
@@ -372,13 +380,17 @@
|
|
|
<template v-slot:footer>
|
|
|
<el-button size="small" @click="handleClose">关闭</el-button>
|
|
|
<el-button type="primary" size="small" @click="save">保存</el-button>
|
|
|
- <el-button type="primary" size="small" @click="submit">提交</el-button>
|
|
|
+ <!-- <el-button type="primary" size="small" @click="submit">提交</el-button> -->
|
|
|
</template>
|
|
|
<releaseRules
|
|
|
ref="releaseRulesRef"
|
|
|
@success="releaseRulesSuccess"
|
|
|
></releaseRules>
|
|
|
- <ProductModal ref="productRefs" @chooseModal="chooseModal" />
|
|
|
+ <ProductModal
|
|
|
+ ref="productRefs"
|
|
|
+ @chooseModal="chooseModal"
|
|
|
+ @chooseCurrent="chooseCurrent"
|
|
|
+ />
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
@@ -387,23 +399,44 @@
|
|
|
import experimentationProcess from '@/components/templateDiv/experimentationProcess.vue';
|
|
|
import releaseRules from '@/components/releaseRules/index.vue';
|
|
|
import { getFactoryarea } from '@/api/aps/index.js';
|
|
|
+ import { save, getById, update } from '@/api/experimentReport/index.js';
|
|
|
import ProductModal from '@/views/inspectionProject/components/ProductModal.vue';
|
|
|
+ import imgList from '@/components/upload/imgList.vue';
|
|
|
+ import detailMixins from '../mixins/detailMixins';
|
|
|
+ import { recordrulesGetById } from '@/api/main/index';
|
|
|
|
|
|
export default {
|
|
|
- components: { experimentationProcess, releaseRules, ProductModal },
|
|
|
+ components: { experimentationProcess, releaseRules, ProductModal, imgList },
|
|
|
props: {},
|
|
|
- mixins: [dictMixins],
|
|
|
+ mixins: [dictMixins, detailMixins],
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
visible: false,
|
|
|
- projectData: {},
|
|
|
+ tableData: [],
|
|
|
unitListKey: '',
|
|
|
- form: {},
|
|
|
- laboratoryItemList: [{}],
|
|
|
+ curretNum: 0,
|
|
|
+ type: '',
|
|
|
+ getSampleQuantityCount: 0,
|
|
|
+ form: {
|
|
|
+ code: '',
|
|
|
+ correlationId: '',
|
|
|
+ consumablesJson: [],
|
|
|
+ toolJson: [],
|
|
|
+ attachmentUrl: [],
|
|
|
+ experimentalTime: '',
|
|
|
+ imgUrl: [],
|
|
|
+ procedureJson: null,
|
|
|
+ qualityStandardName: '',
|
|
|
+ qualityStandardId: '',
|
|
|
+ processRequirementsJson: '',
|
|
|
+ recordJson: null,
|
|
|
+ qualityWorkOrderId: '',
|
|
|
+ results: 1,
|
|
|
+ resultsDescription: '',
|
|
|
+ experimentEquipmentList: []
|
|
|
+ },
|
|
|
laboratoryList: [],
|
|
|
- unitList: [],
|
|
|
- unitList1: [],
|
|
|
unitColumns: [
|
|
|
{
|
|
|
minWidth: 200,
|
|
|
@@ -550,42 +583,90 @@
|
|
|
]
|
|
|
};
|
|
|
},
|
|
|
-
|
|
|
+ computed: {
|
|
|
+ getSampleQuantityCount1() {
|
|
|
+ return this.getSampleQuantityCount - this.numTotal;
|
|
|
+ },
|
|
|
+ numTotal() {
|
|
|
+ return (
|
|
|
+ (Number(this.tableData[0].lossNumber) || 0) +
|
|
|
+ (Number(this.tableData[0].lossNumberUnqualified) || 0) +
|
|
|
+ (Number(this.tableData[0].retainedSampleQuantity) || 0) +
|
|
|
+ (Number(this.tableData[0].retainedSampleUnqualified) || 0)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
watch: {},
|
|
|
methods: {
|
|
|
- open(row) {
|
|
|
- this.projectData = row;
|
|
|
+ async open(row) {
|
|
|
+ this.tableData = [row];
|
|
|
+ console.log(row, 'dasd');
|
|
|
+ this.getSampleQuantityCount = row.getSampleQuantityCount;
|
|
|
+ if (row.experimentId) {
|
|
|
+ this.$set(this, 'form', await getById(row.experimentId));
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.form.procedureJson) {
|
|
|
+ this.$refs.experimentationProcess1.init(
|
|
|
+ this.form.procedureJson.tempJson
|
|
|
+ );
|
|
|
+ }
|
|
|
+ if (this.form.recordJson) {
|
|
|
+ this.$refs.experimentationProcess2.init(
|
|
|
+ this.form.recordJson.tempJson
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.form.correlationId = row.id;
|
|
|
+ this.form.qualityStandardName = row.qualityStandardName;
|
|
|
+ this.form.qualityStandardId = row.qualityStandardId;
|
|
|
+ this.form.qualityWorkOrderId = row.qualityWorkOrderId;
|
|
|
+ this.form.processRequirementsJson = row.defaultValue;
|
|
|
+ this.$nextTick(async () => {
|
|
|
+ if (row.procedureId) {
|
|
|
+ const data = await recordrulesGetById(row.procedureId);
|
|
|
+ this.$refs.experimentationProcess1.init(data.tempJson.tempJson);
|
|
|
+ }
|
|
|
+ if (row.recordId) {
|
|
|
+ const data = await recordrulesGetById(row.recordId);
|
|
|
+ this.$refs.experimentationProcess2.init(data.tempJson.tempJson);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
this.getFactoryarea();
|
|
|
this.visible = true;
|
|
|
},
|
|
|
- handleAdd(type) {
|
|
|
- this.unitListKey = type;
|
|
|
- if (type == 'unitList') {
|
|
|
- this.$refs.productRefs.open(this.unitList);
|
|
|
- } else {
|
|
|
- this.$refs.productRefs.open(this.unitList1);
|
|
|
- }
|
|
|
+ equipmentOpen(index) {
|
|
|
+ this.$refs.productRefs.open([], index);
|
|
|
},
|
|
|
- remove(index, type) {
|
|
|
- if (type == 'unitList') {
|
|
|
- this.unitList.splice(index, 1);
|
|
|
- } else {
|
|
|
- this.unitList1.splice(index, 1);
|
|
|
- }
|
|
|
+ chooseCurrent(data) {
|
|
|
+ this.$set(
|
|
|
+ this.form.experimentEquipmentList[data[0].currentIndex],
|
|
|
+ 'equipmentId',
|
|
|
+ data[0].id
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.form.experimentEquipmentList[data[0].currentIndex],
|
|
|
+ 'equipmentName',
|
|
|
+ data[0].name
|
|
|
+ );
|
|
|
+ },
|
|
|
+ handleAdd(key) {
|
|
|
+ this.unitListKey = key;
|
|
|
+ this.$refs.productRefs.open(this.form[key]);
|
|
|
+ },
|
|
|
+ remove(index, key) {
|
|
|
+ this.form[key].splice(index, 1);
|
|
|
},
|
|
|
-
|
|
|
chooseModal(data) {
|
|
|
- if (this.unitListKey == 'unitList') {
|
|
|
- this.unitList = [...this.unitList, ...data];
|
|
|
- } else {
|
|
|
- this.unitList1 = [...this.unitList1, ...data];
|
|
|
- }
|
|
|
+ this.form[this.unitListKey] = [...this.form[this.unitListKey], ...data];
|
|
|
},
|
|
|
delLaboratoryItemList(index) {
|
|
|
- this.laboratoryItemList.splice(index, 1);
|
|
|
+ this.form.experimentEquipmentList.splice(index, 1);
|
|
|
},
|
|
|
- addlLaboratoryItemList(index) {
|
|
|
- this.laboratoryItemList.push({});
|
|
|
+ addExperimentEquipmentList() {
|
|
|
+ this.form.experimentEquipmentList.push({});
|
|
|
},
|
|
|
async getFactoryarea() {
|
|
|
const data = await getFactoryarea({
|
|
|
@@ -594,7 +675,6 @@
|
|
|
type: 3
|
|
|
});
|
|
|
this.laboratoryList = data.list;
|
|
|
- console.log(this.laboratoryList, 'data');
|
|
|
},
|
|
|
releaseRulesRefOpen(type) {
|
|
|
this.releaseRulesType = type;
|
|
|
@@ -604,12 +684,68 @@
|
|
|
if (this.releaseRulesType == 5) {
|
|
|
this.$refs.experimentationProcess1.init(data.tempJson.tempJson);
|
|
|
}
|
|
|
- if (this.releaseRulesType == 6) {
|
|
|
+
|
|
|
+ if (this.releaseRulesType == 7) {
|
|
|
this.$refs.experimentationProcess2.init(data.tempJson.tempJson);
|
|
|
}
|
|
|
- if (this.releaseRulesType == 7) {
|
|
|
- this.$refs.experimentationProcess3.init(data.tempJson.tempJson);
|
|
|
+ },
|
|
|
+ inputValue(type, item, index) {
|
|
|
+ //样品数
|
|
|
+ if (type == 'sampleQuantity') {
|
|
|
+ this.isSampleQuantity(item, index);
|
|
|
+ }
|
|
|
+ //样品合格数、不合格数
|
|
|
+ if (type == 'qualifiedQuantity' || type == 'noQualifiedQuantity') {
|
|
|
+ this.isQualifiedQuantity(item, index, type);
|
|
|
+ }
|
|
|
+ //损耗数
|
|
|
+ if (type == 'lossNumber' || type == 'lossNumberUnqualified') {
|
|
|
+ this.setNumber(item, index, type, '损耗', 'lossNumber');
|
|
|
+ if (this.numTotal > this.getSampleQuantityCount) {
|
|
|
+ this.$message.error('不能大于当前质检剩余样品数');
|
|
|
+ this.$set(this.tableData[index], type, 0);
|
|
|
+ }
|
|
|
}
|
|
|
+ //留样数
|
|
|
+ if (
|
|
|
+ type == 'retainedSampleQuantity' ||
|
|
|
+ type == 'retainedSampleUnqualified'
|
|
|
+ ) {
|
|
|
+ this.setNumber(item, index, type, '留样', 'retainedSampleQuantity');
|
|
|
+ if (this.numTotal > this.getSampleQuantityCount) {
|
|
|
+ this.$message.error('不能大于当前质检剩余样品数');
|
|
|
+ this.$set(this.tableData[index], type, 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ save() {
|
|
|
+ this.$refs.formRef.validate((valid) => {
|
|
|
+ if (!valid) return false;
|
|
|
+ let data = JSON.parse(JSON.stringify(this.form));
|
|
|
+ let procedureJson = this.$refs.experimentationProcess1.getValue();
|
|
|
+ let recordJson = this.$refs.experimentationProcess2.getValue();
|
|
|
+ if (procedureJson) {
|
|
|
+ data.procedureJson = {
|
|
|
+ tempJson: JSON.stringify(procedureJson)
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (recordJson) {
|
|
|
+ data.recordJson = {
|
|
|
+ tempJson: JSON.stringify(recordJson)
|
|
|
+ };
|
|
|
+ }
|
|
|
+ let api = data.id ? update : save;
|
|
|
+ api(data)
|
|
|
+ .then((msg) => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.success(msg);
|
|
|
+ this.handleClose();
|
|
|
+ this.$emit('done', this.tableData[0]);
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
handleClose() {
|
|
|
this.visible = false;
|