|
|
@@ -0,0 +1,852 @@
|
|
|
+<!-- 用户编辑弹窗 -->
|
|
|
+<template>
|
|
|
+ <ele-modal
|
|
|
+ :title="title + (type == 'detail' ? '详情' : '报工')"
|
|
|
+ :visible.sync="visible"
|
|
|
+ :before-close="handleClose"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ append-to-body
|
|
|
+ width="80%"
|
|
|
+ :maxable="true"
|
|
|
+ >
|
|
|
+ <ele-pro-table
|
|
|
+ :needPage="false"
|
|
|
+ :columns="workColumns"
|
|
|
+ :datasource="[form]"
|
|
|
+ >
|
|
|
+ <template v-slot:isRequired="{ column }">
|
|
|
+ <span class="is-required">{{ column.label }}</span>
|
|
|
+ </template>
|
|
|
+ <template v-slot:qualityType="{ row }">
|
|
|
+ {{ getDictValue('质检计划类型', row.qualityType) }}
|
|
|
+ </template>
|
|
|
+ <template v-slot:qualityMode="{ row }">
|
|
|
+ {{ getDictValue('取样类型', row.qualityMode) }}
|
|
|
+ </template>
|
|
|
+ <template v-slot:hours="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-model="row.hours"
|
|
|
+ placeholder="请输入"
|
|
|
+ type="number"
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ <template v-slot:lossNumber="{ row, $index }">
|
|
|
+ <el-input
|
|
|
+ v-model="row.lossNumber"
|
|
|
+ placeholder="请输入"
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ type="number"
|
|
|
+ @input="inputValue('lossNumber', row, $index)"
|
|
|
+ @click.native="curretNum = row.lossNumber"
|
|
|
+ >
|
|
|
+ <template slot="append">{{ sampleList[0].measureUnit }}</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ <template v-slot:lossNumberUnqualified="{ row, $index }">
|
|
|
+ <el-input
|
|
|
+ v-model="row.lossNumberUnqualified"
|
|
|
+ placeholder="请输入"
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ type="number"
|
|
|
+ @input="inputValue('lossNumberUnqualified', row, $index)"
|
|
|
+ @click.native="curretNum = row.lossNumberUnqualified"
|
|
|
+ >
|
|
|
+ <template slot="append">{{ sampleList[0].measureUnit }}</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ <template v-slot:retainedSampleQuantity="{ row, $index }">
|
|
|
+ <el-input
|
|
|
+ v-model="row.retainedSampleQuantity"
|
|
|
+ placeholder="请输入"
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ type="number"
|
|
|
+ @input="inputValue('retainedSampleQuantity', row, $index)"
|
|
|
+ @click.native="curretNum = row.retainedSampleQuantity"
|
|
|
+ >
|
|
|
+ <template slot="append">{{ sampleList[0].measureUnit }}</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ <template v-slot:retainedSampleUnqualified="{ row, $index }">
|
|
|
+ <el-input
|
|
|
+ v-model="row.retainedSampleUnqualified"
|
|
|
+ placeholder="请输入"
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ type="number"
|
|
|
+ @input="inputValue('retainedSampleUnqualified', row)"
|
|
|
+ @click.native="curretNum = row.retainedSampleUnqualified"
|
|
|
+ >
|
|
|
+ <template slot="append">{{ sampleList[0].measureUnit }}</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ <el-table
|
|
|
+ ref="showSampleListTable"
|
|
|
+ :data="sampleList"
|
|
|
+ tooltip-effect="dark"
|
|
|
+ height="500"
|
|
|
+ border
|
|
|
+ row-key="id"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ label="序号"
|
|
|
+ type="index"
|
|
|
+ width="50"
|
|
|
+ align="center"
|
|
|
+ fixed="left"
|
|
|
+ ></el-table-column>
|
|
|
+ <template v-for="(column, index) in tableColumns">
|
|
|
+ <el-table-column
|
|
|
+ :key="index"
|
|
|
+ :label="column.label"
|
|
|
+ :prop="column.prop"
|
|
|
+ :fixed="column.fixed"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ :width="column.width"
|
|
|
+ :align="column.align"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <template v-if="column.prop === 'categoryCode'">
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ @click="handleDetail(scope.$index, scope.row, 'detail')"
|
|
|
+ >
|
|
|
+ {{ scope.row.categoryCode }}
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="column.prop === 'materielDesignation'">
|
|
|
+ <el-input
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ v-model="scope.row.materielDesignation"
|
|
|
+ size="mini"
|
|
|
+ v-direction="{ x: 0, y: scope.$index }"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="column.prop === 'clientCode'">
|
|
|
+ <el-input
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ v-model="scope.row.clientCode"
|
|
|
+ size="mini"
|
|
|
+ v-direction="{ x: 1, y: scope.$index }"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="column.prop === 'engrave'">
|
|
|
+ <el-input
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ v-model="scope.row.engrave"
|
|
|
+ size="mini"
|
|
|
+ v-direction="{ x: 2, y: scope.$index }"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="column.prop === 'weight'">
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.weight"
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ oninput="value = value.replace(/[^\d.]/g, '')"
|
|
|
+ :min="0"
|
|
|
+ size="mini"
|
|
|
+ v-direction="{ x: 3, y: scope.$index }"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ {{ scope.row[column.prop] }}
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ <!-- *** fixed="right" -->
|
|
|
+ <el-table-column
|
|
|
+ label="处置状态"
|
|
|
+ prop="disposeType"
|
|
|
+ align="center"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ disposeTypeList[scope.row.disposeType] }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- *** fixed="right" -->
|
|
|
+ <el-table-column
|
|
|
+ label="处置时间"
|
|
|
+ prop="disposeTime"
|
|
|
+ align="center"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <!-- *** fixed="right" -->
|
|
|
+ <el-table-column
|
|
|
+ label="状态"
|
|
|
+ prop="status"
|
|
|
+ align="center"
|
|
|
+ fixed="right"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{
|
|
|
+ inspectionProjectStatus.find(
|
|
|
+ (item) => item.value == scope.row.status
|
|
|
+ )?.label
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column
|
|
|
+ label="质检状态"
|
|
|
+ prop="qualityStatus"
|
|
|
+ align="center"
|
|
|
+ fixed="right"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.qualityStatus == 0">未检</span>
|
|
|
+ <span v-if="scope.row.qualityStatus == 1">已检</span>
|
|
|
+ <span v-if="scope.row.qualityStatus == 2">待检</span></template
|
|
|
+ >
|
|
|
+ </el-table-column> -->
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ label="质检结果"
|
|
|
+ prop="qualityResults"
|
|
|
+ align="center"
|
|
|
+ width="180"
|
|
|
+ fixed="right"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row.qualityResults"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%"
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ @change="initQms"
|
|
|
+ size="mini"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in qualityResultsList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="不良类型"
|
|
|
+ align="center"
|
|
|
+ prop="badTypeId"
|
|
|
+ width="180"
|
|
|
+ >
|
|
|
+ <template v-slot="{ row, $index }">
|
|
|
+ <el-select
|
|
|
+ v-model="row.badTypeId"
|
|
|
+ placeholder="请选择不良类型"
|
|
|
+ size="small"
|
|
|
+ style="width: 100%"
|
|
|
+ remote
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ @change="badTypeChange(row)"
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in badTypeList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ label="不良名称"
|
|
|
+ align="center"
|
|
|
+ prop="badNameId"
|
|
|
+ width="180"
|
|
|
+ >
|
|
|
+ <template v-slot="{ row, $index }">
|
|
|
+ <el-select
|
|
|
+ v-model="row.badNameId"
|
|
|
+ placeholder="请选择不良名称"
|
|
|
+ size="small"
|
|
|
+ style="width: 100%"
|
|
|
+ remote
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ @change="badNameChange(row)"
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in badNameList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ fixed="right"
|
|
|
+ v-if="type != 'detail'"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link
|
|
|
+ :type="scope.row.isValid ? 'primary' : 'danger'"
|
|
|
+ :underline="false"
|
|
|
+ @click="handleDetail(scope.$index, scope.row, 'report')"
|
|
|
+ >
|
|
|
+ 质检
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <template v-slot:footer>
|
|
|
+ <el-button @click="handleClose">取消</el-button>
|
|
|
+ <el-button type="primary" @click="save" v-if="type != 'detail'">
|
|
|
+ 确认
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <sampleListDialog
|
|
|
+ ref="detailRef"
|
|
|
+ @handleConfirm="handleConfirm"
|
|
|
+ @handleDispose="handleDispose"
|
|
|
+ ></sampleListDialog>
|
|
|
+ </ele-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
+ import { inspectionProjectStatus } from '@/enum/dict.js';
|
|
|
+ import { getList as getBadNameList } from '@/api/unacceptedProduct/unqualifiedName';
|
|
|
+ import { getList as getBadTypeList } from '@/api/unacceptedProduct/unqualifiedType';
|
|
|
+ import sampleListDialog from './sampleListDialog.vue';
|
|
|
+ import {
|
|
|
+ exeTaskReportWork,
|
|
|
+ exeEntrustReportWork
|
|
|
+ } from '@/api/inspectionProjectTask';
|
|
|
+ import { init } from 'echarts/core';
|
|
|
+ export default {
|
|
|
+ mixins: [dictMixins],
|
|
|
+
|
|
|
+ components: { sampleListDialog },
|
|
|
+
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ workColumns: [
|
|
|
+ {
|
|
|
+ minWidth: 150,
|
|
|
+ prop: 'code',
|
|
|
+ align: 'center',
|
|
|
+ label: '质检项工单号',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 150,
|
|
|
+ prop: 'qualityWorkOrderCode',
|
|
|
+ align: 'center',
|
|
|
+ label: '质检工单编码',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 150,
|
|
|
+ prop: 'qualityWorkOrderName',
|
|
|
+ align: 'center',
|
|
|
+ label: '质检工单名称',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 150,
|
|
|
+ prop: 'qualityWorkOrderCode',
|
|
|
+ align: 'center',
|
|
|
+ label: '来源单号',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 100,
|
|
|
+ prop: 'qualityType',
|
|
|
+ slot: 'qualityType',
|
|
|
+ align: 'center',
|
|
|
+ label: '类型',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 100,
|
|
|
+ slot: 'qualityMode',
|
|
|
+ prop: 'qualityMode',
|
|
|
+ align: 'center',
|
|
|
+ label: '质检方式',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 120,
|
|
|
+ prop: 'productCode',
|
|
|
+ align: 'center',
|
|
|
+ label: '编码',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 120,
|
|
|
+ prop: 'productName',
|
|
|
+ align: 'center',
|
|
|
+ label: '名称',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ minWidth: 100,
|
|
|
+ prop: 'batchNo',
|
|
|
+ align: 'center',
|
|
|
+ label: '批次号',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 120,
|
|
|
+ prop: 'specification',
|
|
|
+ align: 'center',
|
|
|
+ label: '规格',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 100,
|
|
|
+ prop: 'brandNo',
|
|
|
+ align: 'center',
|
|
|
+ label: '牌号',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 120,
|
|
|
+ prop: 'produceTaskName',
|
|
|
+ align: 'center',
|
|
|
+ label: '工序名称',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ minWidth: 180,
|
|
|
+ prop: 'sampleQuantity',
|
|
|
+ align: 'center',
|
|
|
+ label: '样品数',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 180,
|
|
|
+ prop: 'sampleNoQualifiedNumber',
|
|
|
+ slot: 'sampleNoQualifiedNumber',
|
|
|
+ formatter: (row) => {
|
|
|
+ if (row.sampleNoQualifiedNumber) {
|
|
|
+ return (
|
|
|
+ row.sampleNoQualifiedNumber + (this.form.measureUnit || '')
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ align: 'center',
|
|
|
+ label: '样品不合格数',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 140,
|
|
|
+ prop: 'sampleQualifiedNumber',
|
|
|
+ headerSlot: 'isRequired',
|
|
|
+ slot: 'sampleQualifiedNumber',
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ if (row.sampleQualifiedNumber) {
|
|
|
+ return (
|
|
|
+ row.sampleQualifiedNumber + (this.form.measureUnit || '')
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ label: '样品合格数',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 180,
|
|
|
+ prop: 'lossNumber',
|
|
|
+ slot: 'lossNumber',
|
|
|
+ align: 'center',
|
|
|
+
|
|
|
+ label: '损耗数(合格品)',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 180,
|
|
|
+ prop: 'lossNumberUnqualified',
|
|
|
+ slot: 'lossNumberUnqualified',
|
|
|
+ align: 'center',
|
|
|
+
|
|
|
+ label: '损耗数(不合格品)',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 180,
|
|
|
+ prop: 'retainedSampleQuantity',
|
|
|
+ slot: 'retainedSampleQuantity',
|
|
|
+ align: 'center',
|
|
|
+
|
|
|
+ label: '留样数(合格品)',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 180,
|
|
|
+ prop: 'retainedSampleUnqualified',
|
|
|
+ slot: 'retainedSampleUnqualified',
|
|
|
+ align: 'center',
|
|
|
+ label: '留样数(不合格品)',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ minWidth: 120,
|
|
|
+ prop: 'hours',
|
|
|
+ slot: 'hours',
|
|
|
+ align: 'center',
|
|
|
+ label: '工时',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+
|
|
|
+ inspectionProjectStatus,
|
|
|
+ type: 'report',
|
|
|
+ title: '质检任务单',
|
|
|
+ visible: false,
|
|
|
+ form: {},
|
|
|
+ disposeTypeList: {
|
|
|
+ 1: '返工',
|
|
|
+ 2: '返修',
|
|
|
+ 3: '报废',
|
|
|
+ 4: '降级使用',
|
|
|
+ 5: '让步接收',
|
|
|
+ 6: '留样',
|
|
|
+ 7: '消耗',
|
|
|
+ 8: '回用/归批',
|
|
|
+ 9: '转试销',
|
|
|
+ 10: '退货'
|
|
|
+ },
|
|
|
+ tableColumns: [
|
|
|
+ {
|
|
|
+ label: '样品编码',
|
|
|
+ prop: 'sampleCode',
|
|
|
+ width: '200',
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '编码',
|
|
|
+ prop: 'categoryCode',
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '名称',
|
|
|
+ prop: 'categoryName',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ { label: '批次号', prop: 'batchNo', align: 'center' },
|
|
|
+ { label: '发货条码', prop: 'barcodes', align: 'center' },
|
|
|
+ { label: '包装编码', prop: 'packageNo', align: 'center' },
|
|
|
+ { label: '包装数量', prop: 'packingQuantity', align: 'center' },
|
|
|
+ { label: '包装单位', prop: 'packingUnit', align: 'center' },
|
|
|
+ { label: '计量数量', prop: 'measureQuantity', align: 'center' },
|
|
|
+ { label: '计量单位', prop: 'measureUnit', align: 'center' },
|
|
|
+ {
|
|
|
+ label: '供应商名称',
|
|
|
+ prop: 'supplierName',
|
|
|
+ align: 'center',
|
|
|
+ width: '120'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '供应商代号',
|
|
|
+ prop: 'supplierCode',
|
|
|
+ align: 'center',
|
|
|
+ width: '120'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '物料代号',
|
|
|
+ prop: 'materielDesignation',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'materielDesignation',
|
|
|
+ width: '120'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '客户代号',
|
|
|
+ prop: 'clientCode',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'clientCode',
|
|
|
+ width: '120'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '刻码',
|
|
|
+ prop: 'engrave',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'engrave',
|
|
|
+ width: '120'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '机型',
|
|
|
+ prop: 'modelKey',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '颜色',
|
|
|
+ prop: 'colorKey',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '型号',
|
|
|
+ prop: 'modelType',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '规格',
|
|
|
+ prop: 'specification',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '电压等级',
|
|
|
+ prop: 'voltage',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '重量',
|
|
|
+ prop: 'weight',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'weight',
|
|
|
+ width: '120'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '重量单位',
|
|
|
+ prop: 'weightUnit',
|
|
|
+ align: 'center',
|
|
|
+ width: 100
|
|
|
+ },
|
|
|
+ { label: '仓库', prop: 'warehouseName', align: 'center', width: 100 },
|
|
|
+ { label: '货区', prop: 'areaName', align: 'center' },
|
|
|
+ { label: '货架', prop: 'goodsShelfName', align: 'center' },
|
|
|
+ { label: '货位', prop: 'goodsAllocationName', align: 'center' },
|
|
|
+ { label: '生产日期', prop: 'productionDate', align: 'center' },
|
|
|
+ { label: '采购日期', prop: 'purchaseDate', align: 'center' }
|
|
|
+ ],
|
|
|
+ qualityResultsList: [
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: '合格'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 2,
|
|
|
+ label: '不合格'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 3,
|
|
|
+ label: '让步接收'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ pageName: '',
|
|
|
+ badNameList: [],
|
|
|
+ badTypeList: [],
|
|
|
+ sampleList: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+
|
|
|
+ created() {
|
|
|
+ this.getBadNameList();
|
|
|
+ this.getBadTypeList();
|
|
|
+ this.requestDict('质检计划类型');
|
|
|
+ this.requestDict('取样类型');
|
|
|
+ this.requestDict('质检标准类型');
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ inputValue(type) {
|
|
|
+ if (this.form[type] < 0) {
|
|
|
+ this.form[type] = 0;
|
|
|
+ }
|
|
|
+ //损耗数
|
|
|
+ if (type == 'lossNumber' || type == 'lossNumberUnqualified') {
|
|
|
+ if (
|
|
|
+ type == 'lossNumber' &&
|
|
|
+ Number(this.form[type]) + Number(this.form.retainedSampleQuantity) >
|
|
|
+ this.form.sampleQualifiedNumber
|
|
|
+ ) {
|
|
|
+ this.form[type] = 0;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ type == 'lossNumberUnqualified' &&
|
|
|
+ Number(this.form[type]) +
|
|
|
+ Number(this.form.retainedSampleUnqualified) >
|
|
|
+ this.form.sampleNoQualifiedNumber
|
|
|
+ ) {
|
|
|
+ this.form[type] = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //留样数
|
|
|
+ if (
|
|
|
+ type == 'retainedSampleQuantity' ||
|
|
|
+ type == 'retainedSampleUnqualified'
|
|
|
+ ) {
|
|
|
+ if (
|
|
|
+ type == 'retainedSampleQuantity' &&
|
|
|
+ Number(this.form[type]) + Number(this.form.lossNumber) >
|
|
|
+ this.form.sampleQualifiedNumber
|
|
|
+ ) {
|
|
|
+ this.form[type] = 0;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ type == 'retainedSampleUnqualified' &&
|
|
|
+ Number(this.form[type]) + Number(this.form.lossNumberUnqualified) >
|
|
|
+ this.form.sampleNoQualifiedNumber
|
|
|
+ ) {
|
|
|
+ this.form[type] = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleDetail(index, row, type) {
|
|
|
+ if (type) {
|
|
|
+ this.$refs.detailRef.openDia(
|
|
|
+ index,
|
|
|
+ row,
|
|
|
+ type,
|
|
|
+ [row],
|
|
|
+ null,
|
|
|
+ [],
|
|
|
+ this.pageName
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ this.$refs.detailRef.openDia(
|
|
|
+ null,
|
|
|
+ null,
|
|
|
+ 'report',
|
|
|
+ this.sampleList,
|
|
|
+ null,
|
|
|
+ [],
|
|
|
+ this.pageName
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ initQms(init) {
|
|
|
+ this.form.sampleNoQualifiedNumber = 0;
|
|
|
+ this.form.sampleQualifiedNumber = 0;
|
|
|
+ this.sampleList.forEach((item) => {
|
|
|
+ if (item.qualityResults == 1) {
|
|
|
+ this.form.sampleQualifiedNumber += 1;
|
|
|
+ } else {
|
|
|
+ this.form.sampleNoQualifiedNumber += 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (init) return;
|
|
|
+ [
|
|
|
+ 'lossNumber',
|
|
|
+ 'lossNumberUnqualified',
|
|
|
+ 'retainedSampleQuantity',
|
|
|
+ 'retainedSampleUnqualified'
|
|
|
+ ].forEach((key) => {
|
|
|
+ this.form[key] = 0;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 不良类型改变
|
|
|
+ badTypeChange(row) {
|
|
|
+ row.badTypeName = null;
|
|
|
+ // 赋值badTypeName
|
|
|
+ const badType = this.badTypeList.find(
|
|
|
+ (item) => item.id === row.badTypeId
|
|
|
+ );
|
|
|
+ if (badType) {
|
|
|
+ row.badTypeName = badType.name;
|
|
|
+ }
|
|
|
+ this.getBadNameList(row.badTypeId);
|
|
|
+ },
|
|
|
+ // 不良名称改变
|
|
|
+ badNameChange(row) {
|
|
|
+ // 赋值badNameName
|
|
|
+ const badItem = this.badNameList.find(
|
|
|
+ (item) => item.id === row.badNameId
|
|
|
+ );
|
|
|
+ if (badItem) {
|
|
|
+ row.badNameName = badItem.name;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查询不良类型
|
|
|
+ async getBadTypeList() {
|
|
|
+ const res = await getBadTypeList({
|
|
|
+ pageNum: 1,
|
|
|
+ size: 999
|
|
|
+ });
|
|
|
+ this.badTypeList = res.list;
|
|
|
+ },
|
|
|
+ // 查询不良名称
|
|
|
+ async getBadNameList() {
|
|
|
+ const res = await getBadNameList({
|
|
|
+ pageNum: 1,
|
|
|
+ size: 999
|
|
|
+ });
|
|
|
+ this.badNameList = res.list;
|
|
|
+ },
|
|
|
+ handleClose() {
|
|
|
+ this.visible = false;
|
|
|
+ this.sampleList = [];
|
|
|
+ },
|
|
|
+ async open(row, type, pageName) {
|
|
|
+ this.pageName = pageName;
|
|
|
+ this.type = type;
|
|
|
+ if (pageName == 'inspectionProjectTask') {
|
|
|
+ this.title = '质检任务单';
|
|
|
+ }
|
|
|
+ if (pageName == 'inspectionProjectRequest') {
|
|
|
+ this.title = '质检受托单';
|
|
|
+ }
|
|
|
+ this.form = JSON.parse(JSON.stringify(row));
|
|
|
+ console.log(this.form, 'this.form');
|
|
|
+ this.sampleList = this.form.sampleList;
|
|
|
+ this.initQms(true);
|
|
|
+
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
+ handleConfirm(data, index) {
|
|
|
+ console.log(data, 'data');
|
|
|
+ console.log(index, 'data');
|
|
|
+ if (index === 0 || index) {
|
|
|
+ this.$set(this.sampleList, index, data[0]);
|
|
|
+ } else {
|
|
|
+ this.sampleList = data;
|
|
|
+ }
|
|
|
+ this.initQms();
|
|
|
+ },
|
|
|
+ handleDispose() {},
|
|
|
+ save() {
|
|
|
+ let api =
|
|
|
+ this.pageName == 'inspectionProjectTask'
|
|
|
+ ? exeTaskReportWork
|
|
|
+ : exeEntrustReportWork;
|
|
|
+ api({
|
|
|
+ ...this.form,
|
|
|
+ sampleList: this.sampleList
|
|
|
+ }).then((res) => {
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.$emit('reload');
|
|
|
+ this.visible = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+ ::v-deep .warn {
|
|
|
+ color: red;
|
|
|
+ .el-input__inner {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|