|
@@ -7,7 +7,7 @@
|
|
|
<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>
|
|
<base-info ref="baseInfoRefs" v-if="baseForm" :form="baseForm" :btnType="btnType" ></base-info>
|
|
|
- <ele-pro-table ref="table" :columns="tableColumns" :datasource="datasource">
|
|
|
|
|
|
|
+ <ele-pro-table ref="table" :columns="tableColumns" :datasource="datasource" :pageSize="20" :pageSizes="[20, 30, 40, 50, 100]">
|
|
|
<!-- 表头工具栏 -->
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
<template v-slot:toolbar>
|
|
|
</template>
|
|
</template>
|
|
@@ -16,18 +16,9 @@
|
|
|
{{ row.categoryCode }}
|
|
{{ row.categoryCode }}
|
|
|
</el-link>
|
|
</el-link>
|
|
|
</template>
|
|
</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 }">
|
|
<template v-slot:action="{ row }">
|
|
|
- <el-link type="primary" :underline="false" @click="handleDispose(scope.$index, row, 'dispose')">
|
|
|
|
|
|
|
+ <el-link type="primary" :underline="false" @click="handleDispose(row, 'dispose')">
|
|
|
处置
|
|
处置
|
|
|
</el-link>
|
|
</el-link>
|
|
|
</template>
|
|
</template>
|
|
@@ -89,10 +80,17 @@ export default {
|
|
|
{ label: '采购日期', prop: 'purchaseDate', align: 'center' ,showOverflowTooltip: true},
|
|
{ label: '采购日期', prop: 'purchaseDate', align: 'center' ,showOverflowTooltip: true},
|
|
|
{ label: '重量', prop: 'weight', 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: 'weightUnit', align: 'center' ,showOverflowTooltip: true,fixed: 'right'},
|
|
|
- { label: '处置状态', prop: 'disposalStatus', 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: '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'},
|
|
|
|
|
|
|
+ { 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'}
|
|
|
],
|
|
],
|
|
|
};
|
|
};
|
|
@@ -108,9 +106,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- datasource({ page, where, limit }) {
|
|
|
|
|
|
|
+ datasource({page, where, limit}) {
|
|
|
where.qualityWorkOrderId = this.$route.query.qualityWorkOrderId;
|
|
where.qualityWorkOrderId = this.$route.query.qualityWorkOrderId;
|
|
|
- return getSampleQWorkOrderIdPage({
|
|
|
|
|
|
|
+ return getSampleQWorkOrderIdPage({
|
|
|
...where,
|
|
...where,
|
|
|
pageNum: page,
|
|
pageNum: page,
|
|
|
size: limit
|
|
size: limit
|
|
@@ -149,25 +147,42 @@ export default {
|
|
|
submit() {
|
|
submit() {
|
|
|
this.loading = false;
|
|
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}`;
|
|
|
|
|
|
|
+ handleDispose( row, type) {
|
|
|
|
|
+
|
|
|
|
|
+ row.sampleDate = this.getNowTimes();
|
|
|
|
|
+
|
|
|
|
|
+ row.disposeTime = this.getNowTimes();
|
|
|
|
|
+
|
|
|
|
|
+ console.log(null, row, type, this.$route.query.qualityType)
|
|
|
|
|
+
|
|
|
|
|
+ this.$refs.disposeRef.openDispose(null, row, type, this.$route.query.qualityType);
|
|
|
},
|
|
},
|
|
|
// 处理确认事件
|
|
// 处理确认事件
|
|
|
- handleDisposeConfirm(list, index) {
|
|
|
|
|
- if (index != null) {
|
|
|
|
|
- this.$set(this.sampleList, index, list[0]);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$set(this.sampleList, null, list);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ 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
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|