|
|
|
@ -32,9 +32,9 @@
|
|
|
|
|
<!-- <el-form-item label="祖级列表" prop="ancestors">-->
|
|
|
|
|
<!-- <el-input v-model="queryParams.ancestors" placeholder="请输入祖级列表" clearable @keyup.enter="handleQuery" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="检测项类别编码" prop="categoryCode" label-width="120px">
|
|
|
|
|
<el-input v-model="queryParams.categoryCode" placeholder="请输入检测项类别编码" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="检测项类别编码" prop="categoryCode" label-width="120px">-->
|
|
|
|
|
<!-- <el-input v-model="queryParams.categoryCode" placeholder="请输入检测项类别编码" clearable @keyup.enter="handleQuery" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="检测项类别名称" prop="categoryName" label-width="120px">
|
|
|
|
|
<el-input v-model="queryParams.categoryName" placeholder="请输入检测项类别名称" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -62,9 +62,9 @@
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['qms:qcInspectionItemCategory:add']">新增</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- <el-col :span="1.5">-->
|
|
|
|
|
<!-- <el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="primary" plain icon="Import" @click="handleImport">导入</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
@ -75,10 +75,10 @@
|
|
|
|
|
ref="qcInspectionItemCategoryTableRef"
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:data="qcInspectionItemCategoryList"
|
|
|
|
|
row-key="categoryId"
|
|
|
|
|
:default-expand-all="isExpandAll"
|
|
|
|
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
|
|
>
|
|
|
|
|
<!-- row-key="categoryId"
|
|
|
|
|
:default-expand-all="isExpandAll"
|
|
|
|
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"-->
|
|
|
|
|
<!-- <el-table-column label="检测项类别主键" align="center" prop="categoryId" />-->
|
|
|
|
|
<!-- <el-table-column label="父级ID" align="center" prop="parentId" />-->
|
|
|
|
|
<!-- <el-table-column label="祖级列表" align="center" prop="ancestors" />-->
|
|
|
|
@ -91,9 +91,9 @@
|
|
|
|
|
<el-tooltip content="修改" placement="top">
|
|
|
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['qms:qcInspectionItemCategory:edit']" />
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<el-tooltip content="新增" placement="top">
|
|
|
|
|
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['qms:qcInspectionItemCategory:add']" />
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<!-- <el-tooltip content="新增" placement="top">-->
|
|
|
|
|
<!-- <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['qms:qcInspectionItemCategory:add']" />-->
|
|
|
|
|
<!-- </el-tooltip>-->
|
|
|
|
|
<el-tooltip content="删除" placement="top">
|
|
|
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['qms:qcInspectionItemCategory:remove']" />
|
|
|
|
|
</el-tooltip>
|
|
|
|
@ -108,16 +108,16 @@
|
|
|
|
|
<!-- <el-form-item label="检测项类别主键" prop="categoryId">-->
|
|
|
|
|
<!-- <el-input v-model="form.categoryId" placeholder="请输入检测项类别主键" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="父级" prop="parentId">
|
|
|
|
|
<el-tree-select
|
|
|
|
|
v-model="form.parentId"
|
|
|
|
|
:data="qcInspectionItemCategoryOptions"
|
|
|
|
|
:props="{ value: 'categoryId', label: 'categoryName', children: 'children' }"
|
|
|
|
|
value-key="categoryId"
|
|
|
|
|
placeholder="请选择父级"
|
|
|
|
|
check-strictly
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="父级" prop="parentId">-->
|
|
|
|
|
<!-- <el-tree-select-->
|
|
|
|
|
<!-- v-model="form.parentId"-->
|
|
|
|
|
<!-- :data="qcInspectionItemCategoryOptions"-->
|
|
|
|
|
<!-- :props="{ value: 'categoryId', label: 'categoryName', children: 'children' }"-->
|
|
|
|
|
<!-- value-key="categoryId"-->
|
|
|
|
|
<!-- placeholder="请选择父级"-->
|
|
|
|
|
<!-- check-strictly-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label="祖级列表" prop="ancestors">-->
|
|
|
|
|
<!-- <el-input v-model="form.ancestors" placeholder="请输入祖级列表" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
@ -204,6 +204,8 @@ const initFormData: QcInspectionItemCategoryForm = {
|
|
|
|
|
const data = reactive<PageData<QcInspectionItemCategoryForm, QcInspectionItemCategoryQuery>>({
|
|
|
|
|
form: {...initFormData},
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
categoryId: undefined,
|
|
|
|
|
parentId: undefined,
|
|
|
|
|
ancestors: undefined,
|
|
|
|
@ -218,8 +220,8 @@ const data = reactive<PageData<QcInspectionItemCategoryForm, QcInspectionItemCat
|
|
|
|
|
// categoryId: [
|
|
|
|
|
// { required: true, message: "检测项类别主键不能为空", trigger: "blur" }
|
|
|
|
|
// ],
|
|
|
|
|
parentId: [
|
|
|
|
|
{ required: true, message: "父级不能为空", trigger: "blur" }
|
|
|
|
|
typeId: [
|
|
|
|
|
{ required: true, message: "检测类型不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
categoryCode: [
|
|
|
|
|
{ required: true, message: "检测项类别编码不能为空", trigger: "blur" }
|
|
|
|
@ -236,11 +238,13 @@ const { queryParams, form, rules } = toRefs(data);
|
|
|
|
|
const getList = async () => {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
const res = await listQcInspectionItemCategory(queryParams.value);
|
|
|
|
|
const data = proxy?.handleTree<QcInspectionItemCategoryVO>(res.data, "categoryId", "parentId");
|
|
|
|
|
if (data) {
|
|
|
|
|
qcInspectionItemCategoryList.value = data;
|
|
|
|
|
loading.value = false;
|
|
|
|
|
}
|
|
|
|
|
// const data = proxy?.handleTree<QcInspectionItemCategoryVO>(res.data, "categoryId", "parentId");
|
|
|
|
|
// if (data) {
|
|
|
|
|
// qcInspectionItemCategoryList.value = data;
|
|
|
|
|
// loading.value = false;
|
|
|
|
|
// }
|
|
|
|
|
qcInspectionItemCategoryList.value = res.rows;
|
|
|
|
|
loading.value = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 查询检测项类别下拉树结构 */
|
|
|
|
@ -278,7 +282,7 @@ const resetQuery = () => {
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
const handleAdd = (row?: QcInspectionItemCategoryVO) => {
|
|
|
|
|
reset();
|
|
|
|
|
getTreeselect();
|
|
|
|
|
// getTreeselect();
|
|
|
|
|
if (row != null && row.categoryId) {
|
|
|
|
|
form.value.parentId = row.categoryId;
|
|
|
|
|
} else {
|
|
|
|
@ -305,7 +309,7 @@ const toggleExpandAll = (data: QcInspectionItemCategoryVO[], status: boolean) =>
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
const handleUpdate = async (row: QcInspectionItemCategoryVO) => {
|
|
|
|
|
reset();
|
|
|
|
|
await getTreeselect();
|
|
|
|
|
// await getTreeselect();
|
|
|
|
|
if (row != null) {
|
|
|
|
|
form.value.parentId = row.parentId;
|
|
|
|
|
}
|
|
|
|
|