diff --git a/klp-ui/src/views/mes/qc/template/index.vue b/klp-ui/src/views/mes/qc/template/index.vue index 8ad4e5de..2b9657d6 100644 --- a/klp-ui/src/views/mes/qc/template/index.vue +++ b/klp-ui/src/views/mes/qc/template/index.vue @@ -9,8 +9,9 @@ @keyup.enter.native="handleQuery" /> - + + + @@ -44,9 +45,6 @@ - - @@ -54,7 +52,9 @@ - + + + @@ -173,36 +173,34 @@ export default { CheckItemTransfer, }, data() { - return { - // 按钮loading - buttonLoading: false, - // 遮罩层 - loading: true, - // 选中数组 - ids: [], - // 非单个禁用 - single: true, - // 非多个禁用 - multiple: true, - // 显示搜索条件 - showSearch: true, - // 总条数 - total: 0, - // 待检项方案表格数据 - inspectionItemTemplateList: [], - // 弹出层标题 - title: "", - // 是否显示弹出层 - open: false, - // 查询参数 - queryParams: { - pageNum: 1, - pageSize: 10, - templateName: undefined, - templateUnit: undefined, - templateDesc: undefined, - inspectionItem: undefined, - }, + return { + // 按钮loading + buttonLoading: false, + // 遮罩层 + loading: true, + // 选中数组 + ids: [], + // 非单个禁用 + single: true, + // 非多个禁用 + multiple: true, + // 显示搜索条件 + showSearch: true, + // 待检项方案表格数据 + inspectionItemTemplateList: [], + // 方案单位选项 + templateUnitOptions: [], + // 弹出层标题 + title: "", + // 是否显示弹出层 + open: false, + // 查询参数 + queryParams: { + templateName: undefined, + templateUnit: undefined, + templateDesc: undefined, + inspectionItem: undefined, + }, // 表单参数 form: {}, // 表单校验 @@ -235,8 +233,9 @@ export default { getList() { this.loading = true; listInspectionItemTemplate(this.queryParams).then(response => { - this.inspectionItemTemplateList = response.rows; - this.total = response.total; + this.inspectionItemTemplateList = response.rows || response.data || response; + const units = [...new Set(this.inspectionItemTemplateList.map(item => item.templateUnit).filter(Boolean))]; + this.templateUnitOptions = units.sort(); this.loading = false; }); }, @@ -369,7 +368,6 @@ export default { }, /** 搜索按钮操作 */ handleQuery() { - this.queryParams.pageNum = 1; this.getList(); }, /** 重置按钮操作 */