|
|
@@ -1,39 +1,57 @@
|
|
|
<!-- 用户编辑弹窗 -->
|
|
|
<template>
|
|
|
- <ele-modal :title="title" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
|
|
|
- :close-on-press-escape="false" append-to-body width="80%" :maxable="true">
|
|
|
- <header-title title="基本信息"></header-title>
|
|
|
+ <div class="ele-body">
|
|
|
+ <el-card shadow="never">
|
|
|
+ <header-title>
|
|
|
+ <el-button @click="cancel">返回</el-button>
|
|
|
+ <el-button type="primary" @click="submit" :loading="loading" >提交</el-button>
|
|
|
+ </header-title>
|
|
|
<base-info ref="baseInfoRefs" v-if="baseForm" :form="baseForm" :btnType="btnType" ></base-info>
|
|
|
<ele-pro-table ref="table" :columns="tableColumns" :datasource="datasource">
|
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
|
</template>
|
|
|
- <template v-slot:code="{ row }">
|
|
|
+ <template v-slot:categoryCode="{ row }">
|
|
|
<el-link type="primary" :underline="false">
|
|
|
- {{ row.code }}
|
|
|
+ {{ row.categoryCode }}
|
|
|
</el-link>
|
|
|
</template>
|
|
|
+ <template v-slot:disposalStatus="{ row }">
|
|
|
+ {{ row.disposalStatus == 1 ? '返工' : row.disposalStatus == 2 ? '返修' : row.disposalStatus == 3? '报废' : row.disposalStatus == 4? '降级使用' : row.disposalStatus == 5? '让步接收' : row.disposalStatus == 6? '留样' : row.disposalStatus == 7? '消耗' : row.disposalStatus == 8? '回用' : '' }}
|
|
|
+ </template>
|
|
|
+ <template v-slot:qualityStatus="{ row }">
|
|
|
+ {{ row.qualityStatus == 0? '未检' : row.qualityStatus == 1? '已检' : row.qualityStatus == 2? '待检' : ''}}
|
|
|
+ </template>
|
|
|
+ <template v-slot:qualityResults="{ row }">
|
|
|
+ {{ row.qualityResults === '1'? '合格' : row.qualityResults === '2'? '不合格' : ''}}
|
|
|
+ </template>
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
- <el-link type="primary" :underline="false">
|
|
|
+ <el-link type="primary" :underline="false" @click="handleDispose(scope.$index, row, 'dispose')">
|
|
|
处置
|
|
|
</el-link>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
|
|
|
- <template v-slot:footer>
|
|
|
- <el-button @click="handleClose">取消</el-button>
|
|
|
- </template>
|
|
|
- </ele-modal>
|
|
|
+<!-- <template v-slot:footer>-->
|
|
|
+<!-- <el-button @click="handleClose">取消</el-button>-->
|
|
|
+<!-- </template>-->
|
|
|
+<!-- </ele-modal>-->
|
|
|
+ </el-card>
|
|
|
+ <sampleDisposeDialog ref="disposeRef" @handleDisposeConfirm="handleDisposeConfirm"></sampleDisposeDialog>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {getSampleQWorkOrderIdPage} from "@/api/samplemanagement";
|
|
|
+import {getSampleQWorkOrderIdPage,getById} 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
|
|
|
+ baseInfo,
|
|
|
+ sampleDisposeDialog
|
|
|
},
|
|
|
data() {
|
|
|
const defaultForm = function () {
|
|
|
@@ -47,12 +65,13 @@ export default {
|
|
|
title: null,
|
|
|
btnType: null,
|
|
|
visible: false,
|
|
|
+ loading: false,
|
|
|
qualityWorkOrderId: '',
|
|
|
qualitySampleList: [],
|
|
|
tableColumns: [
|
|
|
- { label: '编码',prop: 'categoryCode', width: '150',align: 'center',showOverflowTooltip: true},
|
|
|
+ { label: '编码',prop: 'categoryCode', width: '150',align: 'center',showOverflowTooltip: true,slot: 'categoryCode'},
|
|
|
{label: '名称',prop: 'categoryName',width: '150',align: 'center',showOverflowTooltip: true},
|
|
|
- { label: '批次号', prop: 'batchNo', align: 'center' ,showOverflowTooltip: true},
|
|
|
+ { label: '批次号22222', 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},
|
|
|
@@ -62,15 +81,18 @@ export default {
|
|
|
{ label: '物料代号', prop: 'materielDesignation', align: 'center' ,showOverflowTooltip: true},
|
|
|
{ label: '客户代号', prop: 'clientCode', align: 'center' ,showOverflowTooltip: true},
|
|
|
{ label: '刻码', prop: 'engrave', align: 'center' ,showOverflowTooltip: true},
|
|
|
- { label: '重量', prop: 'weight', align: 'center' ,showOverflowTooltip: true},
|
|
|
- { label: '重量单位', prop: 'weightUnit', 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: 'disposalStatus', align: 'center' ,showOverflowTooltip: true ,fixed: 'right'},
|
|
|
+ { 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'},
|
|
|
+ { label: '处置时间', prop: 'disposeTime', align: 'center' ,showOverflowTooltip: true,fixed: 'right'},
|
|
|
+ { label: '质检状态', prop: 'qualityStatus', align: 'center' ,showOverflowTooltip: true,fixed: 'right'},
|
|
|
+ { label: '质检结果', prop: 'qualityResults', align: 'center' ,showOverflowTooltip: true,fixed: 'right'},
|
|
|
{columnKey: 'action',label: '操作',align: 'center',width: 120,resizable: false,slot: 'action',fixed: 'right'}
|
|
|
],
|
|
|
};
|
|
|
@@ -80,16 +102,29 @@ export default {
|
|
|
watch: {
|
|
|
},
|
|
|
|
|
|
- created() { },
|
|
|
+ created() {
|
|
|
+ if (this.$route.query.id) {
|
|
|
+ this.getDetail();
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
datasource({ page, where, limit }) {
|
|
|
- where.qualityWorkOrderId = this.qualityWorkOrderId;
|
|
|
+ where.qualityWorkOrderId = this.$route.query.qualityWorkOrderId;
|
|
|
return getSampleQWorkOrderIdPage({
|
|
|
...where,
|
|
|
pageNum: page,
|
|
|
size: limit
|
|
|
});
|
|
|
},
|
|
|
+ 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'? '编辑': '详情';
|
|
|
@@ -107,6 +142,33 @@ export default {
|
|
|
// this.resetTable();
|
|
|
this.visible = false;
|
|
|
},
|
|
|
+ cancel() {
|
|
|
+ finishPageTab();
|
|
|
+ this.$router.go(-1);
|
|
|
+ },
|
|
|
+ submit() {
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
+ handleDispose(index, row, type) {
|
|
|
+ row.sampleDate = this.formatCurrentDate();
|
|
|
+ row.disposeTime = this.formatCurrentDate();
|
|
|
+ this.$refs.disposeRef.openDispose(index, row, type, null, null, this.baseForm.qualityType);
|
|
|
+ },
|
|
|
+ formatCurrentDate() {
|
|
|
+ const date = new Date();
|
|
|
+ const year = date.getFullYear();
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
+ const day = String(date.getDate()).padStart(2, '0');
|
|
|
+ return `${year}-${month}-${day}`;
|
|
|
+ },
|
|
|
+ // 处理确认事件
|
|
|
+ handleDisposeConfirm(list, index) {
|
|
|
+ if (index != null) {
|
|
|
+ this.$set(this.sampleList, index, list[0]);
|
|
|
+ } else {
|
|
|
+ this.$set(this.sampleList, null, list);
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|