|
|
@@ -46,10 +46,78 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <inspectionProjectList
|
|
|
- @openAdd="openAdd"
|
|
|
- :inspectList="inspectList"
|
|
|
- ></inspectionProjectList>
|
|
|
+ <ele-pro-table
|
|
|
+ ref="table"
|
|
|
+ :columns="columns"
|
|
|
+ :datasource="inspectionItems"
|
|
|
+ :need-page="false"
|
|
|
+ height="calc(100vh - 435px)"
|
|
|
+ full-height="calc(100vh - 156px)"
|
|
|
+ tool-class="ele-toolbar-form"
|
|
|
+ cache-key="newInspectionProjectList"
|
|
|
+ row-key="id"
|
|
|
+ >
|
|
|
+ <!-- 表头工具栏 -->
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ class="ele-btn-icon"
|
|
|
+ @click="openAdd()"
|
|
|
+ >
|
|
|
+ 添加质检项
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:textType="{ row }">
|
|
|
+ {{
|
|
|
+ row.textType == 1
|
|
|
+ ? '数值'
|
|
|
+ : row.textType == 2
|
|
|
+ ? '选择'
|
|
|
+ : row.textType == 3
|
|
|
+ ? '上下限'
|
|
|
+ : row.textType == 4
|
|
|
+ ? '规格'
|
|
|
+ : row.textType == 5
|
|
|
+ ? '时间'
|
|
|
+ : row.textType == 6
|
|
|
+ ? '范围'
|
|
|
+ : ''
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:type="{ row }">
|
|
|
+ {{ getDictValue('质检标准类型', row.type) }}
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:toolList="{ row }">
|
|
|
+ <div
|
|
|
+ style="display: inline-block"
|
|
|
+ v-for="(item, idx) in row.toolList"
|
|
|
+ :key="idx"
|
|
|
+ >{{ item.name }}
|
|
|
+ <span v-if="row.toolList && idx != row.toolList.length - 1"
|
|
|
+ >,
|
|
|
+ </span></div
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:action="{ row, $index }">
|
|
|
+ <el-popconfirm
|
|
|
+ class="ele-action"
|
|
|
+ title="确定要删除此质检项吗?"
|
|
|
+ @confirm="remove($index)"
|
|
|
+ >
|
|
|
+ <template v-slot:reference>
|
|
|
+ <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
+ 删除
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<template v-slot:footer>
|
|
|
@@ -77,13 +145,16 @@
|
|
|
import { save, update } from '@/api/inspectionPoint';
|
|
|
import fileUpload from '@/components/upload/fileUpload';
|
|
|
import EquipmentDialog from './newEquipmentDialog';
|
|
|
- import inspectionProjectList from './newInspectionProjectList';
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
export default {
|
|
|
+ mixins: [dictMixins],
|
|
|
components: {
|
|
|
fileUpload,
|
|
|
EquipmentDialog,
|
|
|
- inspectionProjectList
|
|
|
+
|
|
|
},
|
|
|
|
|
|
props: {
|
|
|
@@ -111,13 +182,117 @@
|
|
|
loading: false,
|
|
|
|
|
|
showEquipment: false,
|
|
|
- inspectList: []
|
|
|
+ inspectionItems: [],
|
|
|
+
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ prop: 'categoryLevelName',
|
|
|
+ label: '质检类型',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'inspectionCode',
|
|
|
+ label: '参数编码',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'inspectionName',
|
|
|
+ label: '参数名称',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'textType',
|
|
|
+ label: '参数类型',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center',
|
|
|
+ slot: 'textType',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'maxValue',
|
|
|
+ label: '参数上限',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'minValue',
|
|
|
+ label: '参数下限',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'defaultValue',
|
|
|
+ label: '默认值',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '工艺要求',
|
|
|
+ prop: 'inspectionStandard',
|
|
|
+ formatter: (row, column, cellValue) => {
|
|
|
+ return row.symbol + ' ' + cellValue + ' ' + row.unit;
|
|
|
+ },
|
|
|
+ minWidth: 150
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '标准类型',
|
|
|
+ prop: 'type',
|
|
|
+ slot: 'type'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'qualityStandardName',
|
|
|
+ label: '标准名称',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: '状态',
|
|
|
+ prop: 'status',
|
|
|
+ formatter: (row, column, cellValue) => {
|
|
|
+ return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'toolList',
|
|
|
+ slot: 'toolList',
|
|
|
+ label: '设备名称',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 150
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ prop: 'inspectionRemark'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '操作',
|
|
|
+ slot: 'action',
|
|
|
+ fixed: 'right',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
if (this.type == 'edit') {
|
|
|
this.form = this.editObj;
|
|
|
+ if (this.editObj.inspectionItems.length > 0) {
|
|
|
+
|
|
|
+ this.inspectionItems = this.editObj.inspectionItems;
|
|
|
+ } else {
|
|
|
+ this.inspectionItems = []
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -129,7 +304,9 @@
|
|
|
|
|
|
let param = {
|
|
|
...this.form,
|
|
|
- qualityLevelList: this.inspectList.map((item) => item.id)
|
|
|
+ qualityLevelList: this.inspectionItems.map(
|
|
|
+ (item) => item.qualityLevelId
|
|
|
+ )
|
|
|
};
|
|
|
|
|
|
let URL = this.type == 'add' ? save : update;
|
|
|
@@ -152,12 +329,16 @@
|
|
|
this.showEquipment = true;
|
|
|
},
|
|
|
|
|
|
+ remove(index) {
|
|
|
+ this.inspectionItems = this.inspectionItems.splice(index, 1);
|
|
|
+ },
|
|
|
+
|
|
|
closeDialog() {
|
|
|
this.showEquipment = false;
|
|
|
},
|
|
|
|
|
|
chooseModal(list) {
|
|
|
- this.inspectList = list || [];
|
|
|
+ this.inspectionItems = list || [];
|
|
|
}
|
|
|
}
|
|
|
};
|