|
@@ -4,14 +4,25 @@
|
|
|
<el-card shadow="never">
|
|
<el-card shadow="never">
|
|
|
<header-title>
|
|
<header-title>
|
|
|
<el-button @click="cancel">返回</el-button>
|
|
<el-button @click="cancel">返回</el-button>
|
|
|
- <el-button type="primary" @click="submit" :loading="loading">提交</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="submit" :loading="loading"
|
|
|
|
|
+ >提交</el-button
|
|
|
|
|
+ >
|
|
|
</header-title>
|
|
</header-title>
|
|
|
- <base-info ref="baseInfoRefs" v-if="baseForm" :form="baseForm" :btnType="btnType"></base-info>
|
|
|
|
|
- <ele-pro-table ref="table" :columns="tableColumns" :datasource="datasource" :pageSize="20"
|
|
|
|
|
- :pageSizes="[20, 30, 40, 50, 100]">
|
|
|
|
|
|
|
+ <base-info
|
|
|
|
|
+ ref="baseInfoRefs"
|
|
|
|
|
+ v-if="baseForm"
|
|
|
|
|
+ :form="baseForm"
|
|
|
|
|
+ :btnType="btnType"
|
|
|
|
|
+ ></base-info>
|
|
|
|
|
+ <ele-pro-table
|
|
|
|
|
+ ref="table"
|
|
|
|
|
+ :columns="tableColumns"
|
|
|
|
|
+ :datasource="datasource"
|
|
|
|
|
+ :pageSize="20"
|
|
|
|
|
+ :pageSizes="[20, 30, 40, 50, 100]"
|
|
|
|
|
+ >
|
|
|
<!-- 表头工具栏 -->
|
|
<!-- 表头工具栏 -->
|
|
|
- <template v-slot:toolbar>
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
+ <template v-slot:toolbar> </template>
|
|
|
<template v-slot:categoryCode="{ row }">
|
|
<template v-slot:categoryCode="{ row }">
|
|
|
<el-link type="primary" :underline="false">
|
|
<el-link type="primary" :underline="false">
|
|
|
{{ row.categoryCode }}
|
|
{{ row.categoryCode }}
|
|
@@ -22,7 +33,11 @@
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 操作列 -->
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
<template v-slot:action="{ row }">
|
|
|
- <el-link type="primary" :underline="false" @click="handleDispose(row, 'dispose')">
|
|
|
|
|
|
|
+ <el-link
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :underline="false"
|
|
|
|
|
+ @click="handleDispose(row, 'dispose')"
|
|
|
|
|
+ >
|
|
|
处置
|
|
处置
|
|
|
</el-link>
|
|
</el-link>
|
|
|
</template>
|
|
</template>
|
|
@@ -33,244 +48,430 @@
|
|
|
<!-- </template>-->
|
|
<!-- </template>-->
|
|
|
<!-- </ele-modal>-->
|
|
<!-- </ele-modal>-->
|
|
|
</el-card>
|
|
</el-card>
|
|
|
- <sampleDisposeDialog ref="disposeRef" @handleDisposeConfirm="handleDisposeConfirm"></sampleDisposeDialog>
|
|
|
|
|
|
|
+ <sampleDisposeDialog
|
|
|
|
|
+ ref="disposeRef"
|
|
|
|
|
+ @handleDisposeConfirm="handleDisposeConfirm"
|
|
|
|
|
+ ></sampleDisposeDialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { getSampleQWorkOrderIdPage, getById, disposeSubmit } from "@/api/samplemanagement";
|
|
|
|
|
-import baseInfo from './baseInfo.vue';
|
|
|
|
|
-import { finishPageTab } from "@/utils/page-tab-util";
|
|
|
|
|
-import sampleDisposeDialog from '@/views/inspectionWork/components/sampleDisposeDialog.vue';
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ getSampleQWorkOrderIdPage,
|
|
|
|
|
+ getById,
|
|
|
|
|
+ disposeSubmit
|
|
|
|
|
+ } from '@/api/samplemanagement';
|
|
|
|
|
+ import baseInfo from './baseInfo.vue';
|
|
|
|
|
+ import { finishPageTab } from '@/utils/page-tab-util';
|
|
|
|
|
+ import sampleDisposeDialog from '@/views/inspectionWork/components/sampleDisposeDialog.vue';
|
|
|
|
|
|
|
|
-export default {
|
|
|
|
|
- components: {
|
|
|
|
|
- baseInfo,
|
|
|
|
|
- sampleDisposeDialog
|
|
|
|
|
- },
|
|
|
|
|
- data() {
|
|
|
|
|
- const defaultForm = function () {
|
|
|
|
|
- return {
|
|
|
|
|
|
|
+ export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ baseInfo,
|
|
|
|
|
+ sampleDisposeDialog
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ const defaultForm = function () {
|
|
|
|
|
+ return {};
|
|
|
};
|
|
};
|
|
|
- };
|
|
|
|
|
- return {
|
|
|
|
|
- defaultForm,
|
|
|
|
|
- // 表单数据
|
|
|
|
|
- baseForm: { ...defaultForm() },
|
|
|
|
|
- title: null,
|
|
|
|
|
- btnType: null,
|
|
|
|
|
- visible: false,
|
|
|
|
|
- loading: false,
|
|
|
|
|
- qualityWorkOrderId: '',
|
|
|
|
|
- qualitySampleList: [],
|
|
|
|
|
- tableColumns: [
|
|
|
|
|
- { label: '编码', prop: 'categoryCode', width: '150', align: 'center', showOverflowTooltip: true, slot: 'categoryCode' },
|
|
|
|
|
- { label: '样品编码', prop: 'sampleCode', width: '150', align: 'center', showOverflowTooltip: true, slot: 'sampleCode' },
|
|
|
|
|
- { label: '名称', prop: 'categoryName', width: '150', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '批次号', prop: 'batchNo', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '发货条码', prop: 'barcodes', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '包装编码', prop: 'packageNo', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '包装数量', prop: 'packingQuantity', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '包装单位', prop: 'packingUnit', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '计量数量', prop: 'measureQuantity', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '计量单位', prop: 'measureUnit', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '物料代号', prop: 'materielDesignation', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '客户代号', prop: 'clientCode', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '刻码', prop: 'engrave', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '仓库', prop: 'warehouseName', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '货区', prop: 'areaName', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '货架', prop: 'goodsShelfName', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '货位', prop: 'goodsAllocationName', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '生产日期', prop: 'productionDate', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '采购日期', prop: 'purchaseDate', align: 'center', showOverflowTooltip: true },
|
|
|
|
|
- { label: '重量', prop: 'weight', align: 'center', showOverflowTooltip: true, fixed: 'right' },
|
|
|
|
|
- { label: '重量单位', prop: 'weightUnit', align: 'center', showOverflowTooltip: true, fixed: 'right' },
|
|
|
|
|
- {
|
|
|
|
|
- label: '处置状态', prop: 'disposalStatus', align: 'center', showOverflowTooltip: true, fixed: 'right', formatter: (row, column, cellValue) => {
|
|
|
|
|
- return cellValue == 1 ? '返工' : cellValue == 2 ? '返修' : cellValue == 3 ? '报废' : cellValue == 4 ? '降级使用' :
|
|
|
|
|
- cellValue == 5 ? '让步接收' : cellValue == 6 ? '留样' : cellValue == 7 ? '消耗' : cellValue == 8 ? '回用' : '';
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- { label: '处置时间', prop: 'disposeTime', align: 'center', showOverflowTooltip: true, fixed: 'right' },
|
|
|
|
|
- {
|
|
|
|
|
- label: '质检状态', prop: 'qualityStatus', align: 'center', showOverflowTooltip: true, fixed: 'right', formatter: (row, column, cellValue) => {
|
|
|
|
|
- return cellValue == 0 ? '未检' : cellValue == 1 ? '已检' : cellValue == 2 ? '待检' : '';
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '质检结果', prop: 'qualityResults', align: 'center', showOverflowTooltip: true, fixed: 'right', formatter: (row, column, cellValue) => {
|
|
|
|
|
- return cellValue == 1 ? '合格' : cellValue == 2 ? '不合格' : '';
|
|
|
|
|
|
|
+ return {
|
|
|
|
|
+ defaultForm,
|
|
|
|
|
+ // 表单数据
|
|
|
|
|
+ baseForm: { ...defaultForm() },
|
|
|
|
|
+ title: null,
|
|
|
|
|
+ btnType: null,
|
|
|
|
|
+ visible: false,
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ qualityWorkOrderId: '',
|
|
|
|
|
+ qualitySampleList: [],
|
|
|
|
|
+ tableColumns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '编码',
|
|
|
|
|
+ prop: 'categoryCode',
|
|
|
|
|
+ width: '150',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ slot: 'categoryCode'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '样品编码',
|
|
|
|
|
+ prop: 'sampleCode',
|
|
|
|
|
+ width: '150',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ slot: 'sampleCode'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '名称',
|
|
|
|
|
+ prop: 'categoryName',
|
|
|
|
|
+ width: '150',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '批次号',
|
|
|
|
|
+ prop: 'batchNo',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '发货条码',
|
|
|
|
|
+ prop: 'barcodes',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '包装编码',
|
|
|
|
|
+ prop: 'packageNo',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '包装数量',
|
|
|
|
|
+ prop: 'packingQuantity',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '包装单位',
|
|
|
|
|
+ prop: 'packingUnit',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '计量数量',
|
|
|
|
|
+ prop: 'measureQuantity',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '计量单位',
|
|
|
|
|
+ prop: 'measureUnit',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '物料代号',
|
|
|
|
|
+ prop: 'materielDesignation',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '客户代号',
|
|
|
|
|
+ prop: 'clientCode',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '刻码',
|
|
|
|
|
+ prop: 'engrave',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '仓库',
|
|
|
|
|
+ prop: 'warehouseName',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '货区',
|
|
|
|
|
+ prop: 'areaName',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '货架',
|
|
|
|
|
+ prop: 'goodsShelfName',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '货位',
|
|
|
|
|
+ prop: 'goodsAllocationName',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '生产日期',
|
|
|
|
|
+ prop: 'productionDate',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '采购日期',
|
|
|
|
|
+ prop: 'purchaseDate',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '重量',
|
|
|
|
|
+ prop: 'weight',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ fixed: 'right'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '重量单位',
|
|
|
|
|
+ prop: 'weightUnit',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ fixed: 'right'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '处置状态',
|
|
|
|
|
+ prop: 'disposalStatus',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ fixed: 'right',
|
|
|
|
|
+ formatter: (row, column, cellValue) => {
|
|
|
|
|
+ return cellValue == 1
|
|
|
|
|
+ ? '返工'
|
|
|
|
|
+ : cellValue == 2
|
|
|
|
|
+ ? '返修'
|
|
|
|
|
+ : cellValue == 3
|
|
|
|
|
+ ? '报废'
|
|
|
|
|
+ : cellValue == 4
|
|
|
|
|
+ ? '降级使用'
|
|
|
|
|
+ : cellValue == 5
|
|
|
|
|
+ ? '让步接收'
|
|
|
|
|
+ : cellValue == 6
|
|
|
|
|
+ ? '留样'
|
|
|
|
|
+ : cellValue == 7
|
|
|
|
|
+ ? '消耗'
|
|
|
|
|
+ : cellValue == 8
|
|
|
|
|
+ ? '回用'
|
|
|
|
|
+ : '';
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '处置时间',
|
|
|
|
|
+ prop: 'disposeTime',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ fixed: 'right'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '质检状态',
|
|
|
|
|
+ prop: 'qualityStatus',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ fixed: 'right',
|
|
|
|
|
+ formatter: (row, column, cellValue) => {
|
|
|
|
|
+ return cellValue == 0
|
|
|
|
|
+ ? '未检'
|
|
|
|
|
+ : cellValue == 1
|
|
|
|
|
+ ? '已检'
|
|
|
|
|
+ : cellValue == 2
|
|
|
|
|
+ ? '待检'
|
|
|
|
|
+ : '';
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '质检结果',
|
|
|
|
|
+ prop: 'qualityResults',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ fixed: 'right',
|
|
|
|
|
+ formatter: (row, column, cellValue) => {
|
|
|
|
|
+ return cellValue == 1 ? '合格' : cellValue == 2 ? '不合格' : '';
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'action',
|
|
|
|
|
+ label: '操作',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ resizable: false,
|
|
|
|
|
+ slot: 'action',
|
|
|
|
|
+ fixed: 'right'
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- { columnKey: 'action', label: '操作', align: 'center', width: 120, resizable: false, slot: 'action', fixed: 'right' }
|
|
|
|
|
- ],
|
|
|
|
|
- tableData: [],
|
|
|
|
|
- sampleCode: '',
|
|
|
|
|
-
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- computed: {
|
|
|
|
|
- },
|
|
|
|
|
- watch: {
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- created() {
|
|
|
|
|
- if (this.$route.query.id) {
|
|
|
|
|
- this.getDetail();
|
|
|
|
|
- }
|
|
|
|
|
- if (this.$route.query.sampleCode) {
|
|
|
|
|
- this.sampleCode = this.$route.query.sampleCode;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- methods: {
|
|
|
|
|
- async datasource({ page, where, limit }) {
|
|
|
|
|
- where.qualityWorkOrderId = this.$route.query.qualityWorkOrderId;
|
|
|
|
|
- const arr = await getSampleQWorkOrderIdPage({
|
|
|
|
|
- ...where,
|
|
|
|
|
- pageNum: page,
|
|
|
|
|
- size: limit
|
|
|
|
|
- });
|
|
|
|
|
- this.tableData = arr.list;
|
|
|
|
|
- console.log(arr, 'arr')
|
|
|
|
|
- return arr.list;
|
|
|
|
|
- },
|
|
|
|
|
- async getDetail() {
|
|
|
|
|
- this.visible = true;
|
|
|
|
|
- this.qualityWorkOrderId = this.$route.query.qualityWorkOrderId;
|
|
|
|
|
- getById(this.$route.query.id).then(res => {
|
|
|
|
|
- this.btnType = this.$route.query.type;
|
|
|
|
|
- console.log(res, 'res.data');
|
|
|
|
|
- this.baseForm = res.data;
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- async open(type, row) {
|
|
|
|
|
- this.btnType = type;
|
|
|
|
|
- this.title = type == 'add' ? '新增' : type == 'edit' ? '编辑' : '详情';
|
|
|
|
|
- if (this.btnType != 'add') {
|
|
|
|
|
- this.qualityWorkOrderId = row.qualityWorkOrderId;
|
|
|
|
|
- this.baseForm = JSON.parse(JSON.stringify(row));
|
|
|
|
|
- }
|
|
|
|
|
- this.visible = true;
|
|
|
|
|
- },
|
|
|
|
|
- resetForm() {
|
|
|
|
|
- this.baseForm = { ...this.defaultForm() };
|
|
|
|
|
- },
|
|
|
|
|
- handleClose() {
|
|
|
|
|
- this.resetForm();
|
|
|
|
|
- // this.resetTable();
|
|
|
|
|
- this.visible = false;
|
|
|
|
|
- },
|
|
|
|
|
- cancel() {
|
|
|
|
|
- finishPageTab();
|
|
|
|
|
- this.$router.go(-1);
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ tableData: [],
|
|
|
|
|
+ sampleCode: ''
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
- async submit() {
|
|
|
|
|
- console.log(this.tableData, '表格');
|
|
|
|
|
|
|
+ computed: {},
|
|
|
|
|
+ watch: {},
|
|
|
|
|
|
|
|
- for (let i = 0; i < this.tableData.length; i++) {
|
|
|
|
|
- const disposalStatus = this.tableData[i].disposalStatus;
|
|
|
|
|
- const disposeTime = this.tableData[i].disposeTime;
|
|
|
|
|
- const qualityStatus = this.tableData[i].qualityStatus;
|
|
|
|
|
- if (disposalStatus == null || disposeTime == null) {
|
|
|
|
|
- this.$message.error('请完善处置状态和处置时间!')
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (qualityStatus == '2') {
|
|
|
|
|
- this.$message.error('请完善质检状态!')
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ created() {
|
|
|
|
|
+ if (this.$route.query.id) {
|
|
|
|
|
+ this.getDetail();
|
|
|
}
|
|
}
|
|
|
- this.loading = true;
|
|
|
|
|
- let pData = {
|
|
|
|
|
- ...form,
|
|
|
|
|
- qualitySampleUpdatePOList: this.tableData,
|
|
|
|
|
|
|
+ if (this.$route.query.sampleCode) {
|
|
|
|
|
+ this.sampleCode = this.$route.query.sampleCode;
|
|
|
}
|
|
}
|
|
|
- disposeSubmit(pData)
|
|
|
|
|
- .then((msg) => {
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- this.$message.success(msg);
|
|
|
|
|
- this.cancel();
|
|
|
|
|
- this.$emit('done');
|
|
|
|
|
- })
|
|
|
|
|
- .catch((e) => {
|
|
|
|
|
- this.loading = false;
|
|
|
|
|
- });
|
|
|
|
|
},
|
|
},
|
|
|
- handleDispose(row, type) {
|
|
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ async datasource({ page, where, limit }) {
|
|
|
|
|
+ where.qualityWorkOrderId = this.$route.query.qualityWorkOrderId;
|
|
|
|
|
+ const arr = await getSampleQWorkOrderIdPage({
|
|
|
|
|
+ ...where,
|
|
|
|
|
+ pageNum: page,
|
|
|
|
|
+ size: limit
|
|
|
|
|
+ });
|
|
|
|
|
+ this.tableData = arr.list;
|
|
|
|
|
+ console.log(arr, 'arr');
|
|
|
|
|
+ return arr.list;
|
|
|
|
|
+ },
|
|
|
|
|
+ async getDetail() {
|
|
|
|
|
+ this.visible = true;
|
|
|
|
|
+ this.qualityWorkOrderId = this.$route.query.qualityWorkOrderId;
|
|
|
|
|
+ getById(this.$route.query.id).then((res) => {
|
|
|
|
|
+ this.btnType = this.$route.query.type;
|
|
|
|
|
+ console.log(res, 'res.data');
|
|
|
|
|
+ this.baseForm = res.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ async open(type, row) {
|
|
|
|
|
+ this.btnType = type;
|
|
|
|
|
+ this.title = type == 'add' ? '新增' : type == 'edit' ? '编辑' : '详情';
|
|
|
|
|
+ if (this.btnType != 'add') {
|
|
|
|
|
+ this.qualityWorkOrderId = row.qualityWorkOrderId;
|
|
|
|
|
+ this.baseForm = JSON.parse(JSON.stringify(row));
|
|
|
|
|
+ }
|
|
|
|
|
+ this.visible = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ resetForm() {
|
|
|
|
|
+ this.baseForm = { ...this.defaultForm() };
|
|
|
|
|
+ },
|
|
|
|
|
+ handleClose() {
|
|
|
|
|
+ this.resetForm();
|
|
|
|
|
+ // this.resetTable();
|
|
|
|
|
+ this.visible = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ cancel() {
|
|
|
|
|
+ finishPageTab();
|
|
|
|
|
+ this.$router.go(-1);
|
|
|
|
|
+ },
|
|
|
|
|
+ async submit() {
|
|
|
|
|
+ console.log(this.tableData, '表格');
|
|
|
|
|
|
|
|
- row.sampleDate = this.getNowTimes();
|
|
|
|
|
|
|
+ for (let i = 0; i < this.tableData.length; i++) {
|
|
|
|
|
+ const disposalStatus = this.tableData[i].disposalStatus;
|
|
|
|
|
+ const disposeTime = this.tableData[i].disposeTime;
|
|
|
|
|
+ const qualityStatus = this.tableData[i].qualityStatus;
|
|
|
|
|
+ if (disposalStatus == null || disposeTime == null) {
|
|
|
|
|
+ this.$message.error('请完善处置状态和处置时间!');
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (qualityStatus == '2') {
|
|
|
|
|
+ this.$message.error('请完善质检状态!');
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ let pData = {
|
|
|
|
|
+ ...form,
|
|
|
|
|
+ qualitySampleUpdatePOList: this.tableData
|
|
|
|
|
+ };
|
|
|
|
|
+ disposeSubmit(pData)
|
|
|
|
|
+ .then((msg) => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ this.$message.success(msg);
|
|
|
|
|
+ this.cancel();
|
|
|
|
|
+ this.$emit('done');
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((e) => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ handleDispose(row, type) {
|
|
|
|
|
+ row.sampleDate = this.getNowTimes();
|
|
|
|
|
|
|
|
- row.disposeTime = this.getNowTimes();
|
|
|
|
|
|
|
+ row.disposeTime = this.getNowTimes();
|
|
|
|
|
|
|
|
- console.log(null, row, type, this.$route.query.qualityType)
|
|
|
|
|
|
|
+ console.log(null, row, type, this.$route.query.qualityType);
|
|
|
|
|
|
|
|
- this.$refs.disposeRef.openDispose(null, row, type, this.$route.query.qualityType);
|
|
|
|
|
- },
|
|
|
|
|
- // 处理确认事件
|
|
|
|
|
- handleDisposeConfirm(row, index) {
|
|
|
|
|
- console.log(row, index, '处置确认');
|
|
|
|
|
- },
|
|
|
|
|
- getNowDate() {
|
|
|
|
|
- let date = new Date(),
|
|
|
|
|
- obj = {
|
|
|
|
|
- year: date.getFullYear(), //获取当前月份(0-11,0代表1月)
|
|
|
|
|
- month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
|
|
|
|
|
- strDate: date.getDate(), // 获取当前日(1-31)
|
|
|
|
|
- hour: date.getHours(), //获取当前小时(0 ~ 23)
|
|
|
|
|
- minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
|
|
|
|
|
- second: date.getSeconds() //获取当前秒数(0 ~ 59)
|
|
|
|
|
- };
|
|
|
|
|
- Object.keys(obj).forEach((key) => {
|
|
|
|
|
- if (obj[key] < 10) obj[key] = `0${obj[key]}`;
|
|
|
|
|
- });
|
|
|
|
|
- return obj;
|
|
|
|
|
- },
|
|
|
|
|
- getNowTime() {
|
|
|
|
|
- const nowDate = this.getNowDate()
|
|
|
|
|
- return nowDate.year + '-' + nowDate.month + '-' + nowDate.strDate + ' ' + nowDate.hour + ':' + nowDate.minute + ':' + nowDate.second
|
|
|
|
|
- },
|
|
|
|
|
- getNowTimes() {
|
|
|
|
|
- const nowDate = this.getNowDate()
|
|
|
|
|
- return nowDate.year + '-' + nowDate.month + '-' + nowDate.strDate
|
|
|
|
|
- },
|
|
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ this.$refs.disposeRef.openDispose(
|
|
|
|
|
+ null,
|
|
|
|
|
+ row,
|
|
|
|
|
+ type,
|
|
|
|
|
+ this.$route.query.qualityType
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ // 处理确认事件
|
|
|
|
|
+ handleDisposeConfirm(row, index) {
|
|
|
|
|
+ console.log(row, index, '处置确认');
|
|
|
|
|
+ },
|
|
|
|
|
+ getNowDate() {
|
|
|
|
|
+ let date = new Date(),
|
|
|
|
|
+ obj = {
|
|
|
|
|
+ year: date.getFullYear(), //获取当前月份(0-11,0代表1月)
|
|
|
|
|
+ month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
|
|
|
|
|
+ strDate: date.getDate(), // 获取当前日(1-31)
|
|
|
|
|
+ hour: date.getHours(), //获取当前小时(0 ~ 23)
|
|
|
|
|
+ minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
|
|
|
|
|
+ second: date.getSeconds() //获取当前秒数(0 ~ 59)
|
|
|
|
|
+ };
|
|
|
|
|
+ Object.keys(obj).forEach((key) => {
|
|
|
|
|
+ if (obj[key] < 10) obj[key] = `0${obj[key]}`;
|
|
|
|
|
+ });
|
|
|
|
|
+ return obj;
|
|
|
|
|
+ },
|
|
|
|
|
+ getNowTime() {
|
|
|
|
|
+ const nowDate = this.getNowDate();
|
|
|
|
|
+ return (
|
|
|
|
|
+ nowDate.year +
|
|
|
|
|
+ '-' +
|
|
|
|
|
+ nowDate.month +
|
|
|
|
|
+ '-' +
|
|
|
|
|
+ nowDate.strDate +
|
|
|
|
|
+ ' ' +
|
|
|
|
|
+ nowDate.hour +
|
|
|
|
|
+ ':' +
|
|
|
|
|
+ nowDate.minute +
|
|
|
|
|
+ ':' +
|
|
|
|
|
+ nowDate.second
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ getNowTimes() {
|
|
|
|
|
+ const nowDate = this.getNowDate();
|
|
|
|
|
+ return nowDate.year + '-' + nowDate.month + '-' + nowDate.strDate;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
-.location-warp {
|
|
|
|
|
- display: flex;
|
|
|
|
|
|
|
+ .location-warp {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
|
|
|
- .detail {
|
|
|
|
|
- margin-left: 10px;
|
|
|
|
|
|
|
+ .detail {
|
|
|
|
|
+ margin-left: 10px;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
-:deep(.el-form-item__content .el-input-group__prepend) {
|
|
|
|
|
- background-color: #fff;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ :deep(.el-form-item__content .el-input-group__prepend) {
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-:deep(.el-dialog:not(.ele-dialog-form) .el-dialog__body .el-form .el-form-item:last-child) {
|
|
|
|
|
- margin-bottom: 22px;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ :deep(
|
|
|
|
|
+ .el-dialog:not(.ele-dialog-form)
|
|
|
|
|
+ .el-dialog__body
|
|
|
|
|
+ .el-form
|
|
|
|
|
+ .el-form-item:last-child
|
|
|
|
|
+ ) {
|
|
|
|
|
+ margin-bottom: 22px;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-.add-product {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: flex-end;
|
|
|
|
|
- font-size: 30px;
|
|
|
|
|
- color: #1890ff;
|
|
|
|
|
- margin: 10px 0;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ .add-product {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
|
+ font-size: 30px;
|
|
|
|
|
+ color: #1890ff;
|
|
|
|
|
+ margin: 10px 0;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-.el-pagination {
|
|
|
|
|
- padding: 12px 16px;
|
|
|
|
|
- background: #fff;
|
|
|
|
|
- border: 1px solid #ebeef5;
|
|
|
|
|
- border-top: none;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ .el-pagination {
|
|
|
|
|
+ padding: 12px 16px;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border: 1px solid #ebeef5;
|
|
|
|
|
+ border-top: none;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|