|
|
@ -1,5 +1,24 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="p-2">
|
|
|
|
<div class="p-2">
|
|
|
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
|
|
|
<!--部门树-->
|
|
|
|
|
|
|
|
<el-col :lg="4" :xs="24" style="">
|
|
|
|
|
|
|
|
<el-card shadow="hover">
|
|
|
|
|
|
|
|
<el-input v-model="inspectionTypeName" placeholder="请输入检测类型名称" clearable prefix-icon="Search" />
|
|
|
|
|
|
|
|
<el-tree
|
|
|
|
|
|
|
|
ref="inspectionTypeTreeRef"
|
|
|
|
|
|
|
|
class="mt-2"
|
|
|
|
|
|
|
|
:data="qcInspectionTypeList"
|
|
|
|
|
|
|
|
:props="{ label: 'typeName', children: 'children' }"
|
|
|
|
|
|
|
|
:expand-on-click-node="false"
|
|
|
|
|
|
|
|
:filter-node-method="filterNode"
|
|
|
|
|
|
|
|
highlight-current
|
|
|
|
|
|
|
|
default-expand-all
|
|
|
|
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :lg="20" :xs="24">
|
|
|
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
|
|
<div v-show="showSearch" class="mb-[10px]">
|
|
|
|
<div v-show="showSearch" class="mb-[10px]">
|
|
|
|
<el-card shadow="hover">
|
|
|
|
<el-card shadow="hover">
|
|
|
@ -46,6 +65,9 @@
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
|
|
|
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
|
|
|
<el-button type="primary" plain icon="Import" @click="handleImport">导入</el-button>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
@ -121,11 +143,15 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup name="QcInspectionItemCategory" lang="ts">
|
|
|
|
<script setup name="QcInspectionItemCategory" lang="ts">
|
|
|
|
import { listQcInspectionItemCategory, getQcInspectionItemCategory, delQcInspectionItemCategory, addQcInspectionItemCategory, updateQcInspectionItemCategory } from '@/api/qms/qcInspectionItemCategory';
|
|
|
|
import { listQcInspectionItemCategory, getQcInspectionItemCategory, delQcInspectionItemCategory, addQcInspectionItemCategory, updateQcInspectionItemCategory, importData } from '@/api/qms/qcInspectionItemCategory';
|
|
|
|
import { QcInspectionItemCategoryVO, QcInspectionItemCategoryQuery, QcInspectionItemCategoryForm } from '@/api/qms/qcInspectionItemCategory/types';
|
|
|
|
import { QcInspectionItemCategoryVO, QcInspectionItemCategoryQuery, QcInspectionItemCategoryForm } from '@/api/qms/qcInspectionItemCategory/types';
|
|
|
|
import {getQcInspectionTypeList} from "@/api/qms/qcInspectionType";
|
|
|
|
import {getQcInspectionTypeList} from "@/api/qms/qcInspectionType";
|
|
|
|
import { QcInspectionTypeVO } from '@/api/qms/qcInspectionType/types';
|
|
|
|
import { QcInspectionTypeVO } from '@/api/qms/qcInspectionType/types';
|
|
|
@ -154,7 +180,7 @@ const total = ref(0);
|
|
|
|
|
|
|
|
|
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
|
|
const qcInspectionItemCategoryFormRef = ref<ElFormInstance>();
|
|
|
|
const qcInspectionItemCategoryFormRef = ref<ElFormInstance>();
|
|
|
|
// const qcInspectionItemCategoryTableRef = ref<ElTableInstance>();
|
|
|
|
const qcInspectionItemCategoryTableRef = ref<ElTableInstance>();
|
|
|
|
const inspectionTypeTreeRef = ref<TreeInstance>();
|
|
|
|
const inspectionTypeTreeRef = ref<TreeInstance>();
|
|
|
|
const inspectionTypeName = ref('');
|
|
|
|
const inspectionTypeName = ref('');
|
|
|
|
|
|
|
|
|
|
|
@ -328,9 +354,35 @@ const handleNodeClick = (data: QcInspectionTypeVO) => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
watch(inspectionTypeName, val => {
|
|
|
|
watch(inspectionTypeName, val => {
|
|
|
|
|
|
|
|
|
|
|
|
inspectionTypeTreeRef.value?.filter(val);
|
|
|
|
inspectionTypeTreeRef.value?.filter(val);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 导入按钮操作 */
|
|
|
|
|
|
|
|
const fileInput = ref<HTMLInputElement>();
|
|
|
|
|
|
|
|
const uploading = ref(false);
|
|
|
|
|
|
|
|
const handleImport = () => {
|
|
|
|
|
|
|
|
fileInput.value?.click();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const onFileChange = async (event: Event) => {
|
|
|
|
|
|
|
|
const input = event.target as HTMLInputElement;
|
|
|
|
|
|
|
|
if (input.files && input.files.length > 0) {
|
|
|
|
|
|
|
|
const file = input.files[0];
|
|
|
|
|
|
|
|
uploading.value = true;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
await importData(file, true);
|
|
|
|
|
|
|
|
proxy?.$modal.msgSuccess("导入成功");
|
|
|
|
|
|
|
|
await getList();
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
|
|
proxy?.$modal.msgError("导入失败");
|
|
|
|
|
|
|
|
console.error(err);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
uploading.value = false;
|
|
|
|
|
|
|
|
input.value = '';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
getList();
|
|
|
|
getList();
|
|
|
|