|
|
@@ -26,13 +26,72 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<template v-slot:content>
|
|
|
- <user-list
|
|
|
- v-if="current"
|
|
|
- :category-id="current.id"
|
|
|
- @selectChange="selectChange"
|
|
|
- :root-id="rootId"
|
|
|
- ref="searchRef"
|
|
|
- />
|
|
|
+ <user-search @search="reload" ref="searchRef"> </user-search>
|
|
|
+ <!-- 数据表格 -->
|
|
|
+ <ele-pro-table
|
|
|
+ ref="table"
|
|
|
+ :columns="columns"
|
|
|
+ :datasource="datasource"
|
|
|
+ height="calc(100vh - 365px)"
|
|
|
+ full-height="calc(100vh - 116px)"
|
|
|
+ tool-class="ele-toolbar-form"
|
|
|
+ cache-key="inspectionClassify"
|
|
|
+ row-key="id"
|
|
|
+ :selection.sync="selection"
|
|
|
+ >
|
|
|
+ <!-- 表头工具栏 -->
|
|
|
+
|
|
|
+ <template v-slot:textType="{ row }">
|
|
|
+ {{
|
|
|
+ row.itemVO.textType == 1
|
|
|
+ ? '数值'
|
|
|
+ : row.itemVO.textType == 2
|
|
|
+ ? '选择'
|
|
|
+ : row.itemVO.textType == 3
|
|
|
+ ? '上下限'
|
|
|
+ : row.itemVO.textType == 4
|
|
|
+ ? '规格'
|
|
|
+ : row.itemVO.textType == 5
|
|
|
+ ? '时间'
|
|
|
+ : row.itemVO.textType == 6
|
|
|
+ ? '范围'
|
|
|
+ : ''
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:type="{ row }">
|
|
|
+ {{
|
|
|
+ getDictValue('质检标准类型', row.itemVO.qualityStandardType)
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:defaultValue="{ row }">
|
|
|
+ <div>
|
|
|
+ <span v-if="row.itemVO.textType == 3">
|
|
|
+ [ {{ row.itemVO.minValue }}-{{ row.itemVO.maxValue }}]
|
|
|
+ </span>
|
|
|
+ <span v-else>{{ row.itemVO.defaultValue }}</span>
|
|
|
+
|
|
|
+ <span> {{ row.itemVO.unit }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:toolList="{ row }">
|
|
|
+ <div
|
|
|
+ style="display: inline-block"
|
|
|
+ v-for="(item, idx) in row.itemVO.toolList"
|
|
|
+ :key="idx"
|
|
|
+ >{{ item.name }}
|
|
|
+ <span
|
|
|
+ v-if="
|
|
|
+ row.itemVO.toolList &&
|
|
|
+ idx != row.itemVO.toolList.length - 1
|
|
|
+ "
|
|
|
+ >,
|
|
|
+ </span></div
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
</template>
|
|
|
</ele-split-layout>
|
|
|
</el-card>
|
|
|
@@ -47,13 +106,15 @@
|
|
|
|
|
|
<script>
|
|
|
import AssetTree from '@/components/AssetTree';
|
|
|
- import userList from './components/user-list.vue';
|
|
|
- import { EventBus } from '@/utils/eventBus';
|
|
|
+ import userSearch from './components/user-search.vue';
|
|
|
+ import { getList } from '@/api/material/inspectionClassify';
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
|
|
|
export default {
|
|
|
+ mixins: [dictMixins],
|
|
|
components: {
|
|
|
AssetTree,
|
|
|
- userList
|
|
|
+ userSearch
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -65,23 +126,143 @@
|
|
|
rootId: '12',
|
|
|
visible: false,
|
|
|
|
|
|
- selectList: []
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ align: 'center',
|
|
|
+ reserveSelection: true
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'itemVO.categoryLevelName',
|
|
|
+ label: '质检类型',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'itemVO.inspectionCode',
|
|
|
+ label: '参数编码',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'itemVO.inspectionName',
|
|
|
+ label: '参数名称',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'itemVO.textType',
|
|
|
+ label: '参数类型',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center',
|
|
|
+ slot: 'textType',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'itemVO.defaultValue',
|
|
|
+ slot: 'defaultValue',
|
|
|
+ label: '工艺参数',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 150
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: '工艺要求',
|
|
|
+ prop: 'itemVO.inspectionStandard',
|
|
|
+ formatter: (row, column, cellValue) => {
|
|
|
+ return (
|
|
|
+ row.itemVO.symbol + ' ' + cellValue + ' ' + row.itemVO.unit
|
|
|
+ );
|
|
|
+ },
|
|
|
+ minWidth: 150
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '标准类型',
|
|
|
+ prop: 'itemVO.type',
|
|
|
+ slot: 'type'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'itemVO.qualityStandardName',
|
|
|
+ label: '标准名称',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: '状态',
|
|
|
+ prop: 'status',
|
|
|
+ formatter: (row, column, cellValue) => {
|
|
|
+ return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'itemVO.toolList',
|
|
|
+ slot: 'toolList',
|
|
|
+ label: '设备名称',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 150
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ prop: 'inspectionRemark'
|
|
|
+ }
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
- EventBus.$on('inspectionSelection', (data) => {
|
|
|
- this.handleClose();
|
|
|
- });
|
|
|
+ this.requestDict('质检方式');
|
|
|
+ this.requestDict('质检标准类型');
|
|
|
},
|
|
|
methods: {
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource({ page, limit, where }) {
|
|
|
+ let _data = null;
|
|
|
+ _data = getList({
|
|
|
+ ...where,
|
|
|
+ pageNum: page,
|
|
|
+ size: limit,
|
|
|
+ categoryLevelId: this.categoryLevelId || 12,
|
|
|
+ rootCategoryLevelId: this.rootId
|
|
|
+ });
|
|
|
+
|
|
|
+ return _data;
|
|
|
+ },
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+ this.$refs.table.reload({
|
|
|
+ pageNum: 1,
|
|
|
+ where: where,
|
|
|
+ categoryLevelId: this.categoryLevelId,
|
|
|
+ rootCategoryLevelId: this.rootId
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
handleNodeClick(info) {
|
|
|
this.current = info;
|
|
|
this.$nextTick(() => {
|
|
|
console.log(info);
|
|
|
- this.$refs.searchRef.clickSearch(info);
|
|
|
+ this.clickSearch(info);
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ clickSearch(info) {
|
|
|
+ this.categoryLevelId = info.id;
|
|
|
+ this.rootCategoryLevelId = info.rootCategoryLevelId;
|
|
|
+ this.reload();
|
|
|
+ },
|
|
|
+
|
|
|
// 获取根节点id
|
|
|
setRootId(id) {
|
|
|
if (id) {
|
|
|
@@ -94,16 +275,17 @@
|
|
|
},
|
|
|
|
|
|
handleClose() {
|
|
|
- this.selectList = [];
|
|
|
this.visible = false;
|
|
|
},
|
|
|
|
|
|
- selectChange(list) {
|
|
|
- this.selectList = list;
|
|
|
- },
|
|
|
-
|
|
|
handleSave() {
|
|
|
- console.log(this.selectList, 666);
|
|
|
+ let _arr = [];
|
|
|
+ _arr = this.selection.map((m) => {
|
|
|
+ return {
|
|
|
+ ...m
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.$emit('selectChange', _arr);
|
|
|
}
|
|
|
}
|
|
|
};
|