|
@@ -9,7 +9,7 @@
|
|
|
<el-input v-model="queryParams.name" placeholder="请输入巡检项名称" clearable @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="巡检设备类型" prop="deviceDetailId">
|
|
|
- <el-select v-model="queryParams.deviceDetailId" clearable placeholder="请选择巡检设备类型">
|
|
|
+ <el-select v-model="queryParams.deviceDetailId" clearable placeholder="请选择巡检设备类型">
|
|
|
<el-option v-for="dict in dictGroup.deviceTypeDetailOptions" :key="dict.id"
|
|
|
:label="`${dict.ext1.brand}${dict.xh}`" :value="dict.id">
|
|
|
<span style="float: left">{{ dict.ext1.brand }}</span>
|
|
@@ -48,19 +48,25 @@
|
|
|
|
|
|
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="巡检项编号" align="center" show-overflow-tooltip prop="id" width="150" />
|
|
|
- <el-table-column label="巡检项名称" align="center" show-overflow-tooltip prop="name" width="180" />
|
|
|
- <el-table-column label="巡检设备类型" align="center" prop="deviceDetailId" width="180" >
|
|
|
+ <el-table-column label="计划名称" align="center" show-overflow-tooltip prop="name" width="150" />
|
|
|
+ <el-table-column label="计划编号" align="center" show-overflow-tooltip prop="id" width="150" />
|
|
|
+ <el-table-column label="计划开始时间" align="center" show-overflow-tooltip prop="startTime" width="150" />
|
|
|
+ <el-table-column label="计划结束时间" align="center" show-overflow-tooltip prop="endTime" width="150" />
|
|
|
+ <el-table-column label="巡检类型" align="center" width="100" >
|
|
|
<template #default="scope">
|
|
|
- {{formatDevice(scope.row.deviceDetailId)}}
|
|
|
+ <dict-tag :options="inspection_type" :value="scope.row.inspectionType" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="检验方法" align="center" prop="detectionMethod" width="120" />
|
|
|
- <el-table-column label="检验工具" align="center" show-overflow-tooltip prop="detectionTools" width="120" />
|
|
|
- <el-table-column label="检验标准" align="center" show-overflow-tooltip prop="detectionStandard" width="120" />
|
|
|
- <el-table-column label="判断标准" align="center" show-overflow-tooltip prop="judgeStandard" width="120" />
|
|
|
- <el-table-column label="标准上限" align="center" show-overflow-tooltip prop="judgeMaxValue" width="120" />
|
|
|
- <el-table-column label="标准下限" align="center" show-overflow-tooltip prop="judgeMinValue" width="120" />
|
|
|
+ <el-table-column label="巡检周期(天)" align="center" show-overflow-tooltip prop="inspectionCycle" width="100" />
|
|
|
+ <el-table-column label="巡检员" align="center" show-overflow-tooltip prop="ext1.inspectionPersonName" width="120" />
|
|
|
+ <el-table-column label="备注" align="center" show-overflow-tooltip prop="remark" width="150" />
|
|
|
+ <el-table-column label="计划状态" align="center" prop="status" width="120" >
|
|
|
+ <template #default="scope">
|
|
|
+ <dict-tag :options="inspection_status" :value="scope.row.status" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="已执行任务次数" align="center" show-overflow-tooltip prop="judgeMinValue" width="120" />
|
|
|
+ <el-table-column label="创建时间" align="center" show-overflow-tooltip prop="createTime" width="120" />
|
|
|
<el-table-column label="操作" align="center" width="150" fixed="right" class-name="small-padding fixed-width">
|
|
|
<template #default="scope">
|
|
|
<el-button size="small" link type="primary" @click="handleUpdate(scope.row)">修改</el-button>
|
|
@@ -72,64 +78,116 @@
|
|
|
:total="total" @pagination="getList" />
|
|
|
</el-card>
|
|
|
<!-- 添加或修改对话框 -->
|
|
|
- <el-dialog v-model="dialog.visible" :title="dialog.title" width="900px" append-to-body>
|
|
|
- <el-form ref="addFormRef" :model="form" label-width="100px">
|
|
|
+ <el-dialog v-model="dialog.visible" :title="dialog.title" width="950px" append-to-body>
|
|
|
+ <el-form ref="addFormRef" :model="form" label-width="110px">
|
|
|
<el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="巡检项名称" prop="name" :rules="[{ required: true, message: '巡检项名称不能为空', trigger: 'blur' }]">
|
|
|
- <el-input v-model="form.name" placeholder="请输入巡检项名称" />
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="计划名称" prop="name" :rules="[{ required: true, message: '计划名称不能为空', trigger: 'blur' }]">
|
|
|
+ <el-input v-model="form.name" placeholder="请输入计划名称" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="设备类型" prop="deviceDetailId"
|
|
|
- :rules="[{ required: true, message: '设备类型不能为空', trigger: 'change' }]">
|
|
|
- <el-select v-model="form.deviceDetailId" clearable placeholder="请选择设备类型">
|
|
|
- <el-option v-for="dict in dictGroup.deviceTypeDetailOptions" :key="dict.id"
|
|
|
- :label="`${dict.ext1.brand}${dict.xh}`" :value="dict.id">
|
|
|
- <span style="float: left">{{ dict.ext1.brand }}</span>
|
|
|
- <span style="float: right;color: var(--el-text-color-secondary);font-size: 13px;">
|
|
|
- {{ dict.xh }}
|
|
|
- </span>
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="计划开始时间" prop="startTime"
|
|
|
+ :rules="[{ required: true, message: '计划开始时间不能为空', trigger: 'change' }]">
|
|
|
+ <el-date-picker v-model="form.startTime" style="width: 100%;" value-format="YYYY-MM-DD hh:mm:ss" type="datetime"
|
|
|
+ placeholder="请选择开始时间" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="检验方法" prop="detectionMethod" :rules="[{ required: true, message: '检验方法不能为空', trigger: 'blur' }]">
|
|
|
- <el-input v-model="form.detectionMethod" placeholder="请输入检验方法" />
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="计划结束时间" prop="endTime"
|
|
|
+ :rules="[{ required: true, message: '计划结束时间不能为空', trigger: 'change' }]">
|
|
|
+ <el-date-picker v-model="form.endTime" style="width: 100%;" value-format="YYYY-MM-DD hh:mm:ss" type="datetime"
|
|
|
+ placeholder="请选择结束时间" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="检验工具" prop="detectionTools" >
|
|
|
- <el-input v-model="form.detectionTools" placeholder="请输入检验工具" />
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="巡检类型" prop="inspectionType"
|
|
|
+ :rules="[{ required: true, message: '巡检类型不能为空', trigger: 'change' }]">
|
|
|
+ <el-select v-model="form.inspectionType" clearable placeholder="请选择巡检类型" @change="inspectionTypeChange">
|
|
|
+ <el-option v-for="dict in inspection_type" :key="dict.value" :label="dict.label"
|
|
|
+ :value="dict.value"></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="检验标准" prop="detectionStandard" :rules="[{ required: true, message: '检验标准不能为空', trigger: 'blur' }]">
|
|
|
- <el-input v-model="form.detectionStandard" placeholder="请输入检验标准" />
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="巡检周期(天)" prop="inspectionCycle"
|
|
|
+ :rules="[{ required: true, message: '巡检周期不能为空', trigger: 'blur' }]">
|
|
|
+ <el-input-number v-model="form.inspectionCycle" :disabled="cycleDisabled" style="width:100%" :min="1" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="判断标准" prop="judgeStandard" :rules="[{ required: true, message: '判断标准不能为空', trigger: 'blur' }]">
|
|
|
- <el-input v-model="form.judgeStandard" placeholder="请输入判断标准" />
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="巡检范围" prop="inspectionRange"
|
|
|
+ :rules="[{ required: true, message: '巡检类型不能为空', trigger: 'change' }]">
|
|
|
+ <el-select v-model="form.inspectionRange" clearable placeholder="请选择巡检范围">
|
|
|
+ <el-option label="按设备" value="1"></el-option>
|
|
|
+ <el-option label="按道路点位" value="2"></el-option>
|
|
|
+ <el-option label="按项目" value="3"></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="标准上限" prop="judgeMaxValue" >
|
|
|
- <el-input v-model="form.judgeMaxValue" placeholder="请输入标准上限" />
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="巡检员" prop="inspectionPersonId"
|
|
|
+ :rules="[{ required: true, message: '巡检员不能为空', trigger: 'change' }]">
|
|
|
+ <el-cascader v-model="form.inspectionPersonId" :props="{ emitPath: false }" :options="userOptions"
|
|
|
+ placeholder="请选择巡检员" clearable :show-all-levels="false" @change="setUserInfo" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="标准下限" prop="judgeMinValue" >
|
|
|
- <el-input v-model="form.judgeMinValue" placeholder="请输入标准下限" />
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="联系电话" prop="ext1.phone">
|
|
|
+ <el-input v-model="form.ext1.phone" disabled placeholder="选巡检员带出" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="备注" prop="remark" >
|
|
|
- <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input v-model="form.remark" placeholder="请输入备注" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <SubTitle title="巡检内容" />
|
|
|
+ <el-table :data="form.inspectionItem" max-height="300">
|
|
|
+ <el-table-column label="设备类型名称" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-select v-model="scope.row.deviceTypeId" clearable placeholder="请选择设备类型名称"
|
|
|
+ @change="deviceTypeChange(scope.$index, $event)">
|
|
|
+ <el-option v-for="dict in dictGroup.deviceTypeOptions" :key="dict.id" :label="dict.name"
|
|
|
+ :value="dict.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="设备编号" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-select v-model="scope.row.deviceTypeDetailIds" multiple collapse-tags clearable placeholder="请选择设备编号">
|
|
|
+ <el-option v-for="dict in dictGroup.deviceOptions" :key="dict.id" :label="dict.sn" :value="dict.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="巡检项目" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-select v-model="scope.row.items" multiple collapse-tags clearable placeholder="请选择巡检项目">
|
|
|
+ <el-option v-for="dict in dictGroup.inspectionItemOptions" :key="dict.id" :label="dict.name"
|
|
|
+ :value="dict.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" width="80">
|
|
|
+ <template #header>
|
|
|
+ <div class="operateBtn">
|
|
|
+ <span>操作</span>
|
|
|
+ <el-icon @click="addInspectionItem">
|
|
|
+ <CirclePlus />
|
|
|
+ </el-icon>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #default="scope">
|
|
|
+ <el-icon @click="delInspectionItem(scope.$index)">
|
|
|
+ <Delete />
|
|
|
+ </el-icon>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
@@ -141,11 +199,15 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script setup name="PatrolItems" lang="ts">
|
|
|
-import { listInspectionItem, getInspectionItem, delInspectionItem, addInspectionItem, updateInspectionItem } from '@/api/deviceCheck/index';
|
|
|
+<script setup name="PatrolPlan" lang="ts">
|
|
|
+import { listInspectionTeam, listInspectionItem, listInspectionTask, getInspectionTask, delInspectionTask, addInspectionTask, updateInspectionTask } from '@/api/deviceCheck/index';
|
|
|
import {
|
|
|
+ listDeviceType,
|
|
|
getDeviceTypeDetailList
|
|
|
} from '@/api/deviceManage/deviceType';
|
|
|
+import {
|
|
|
+ listDevice,
|
|
|
+} from '@/api/deviceManage/device';
|
|
|
import { deepClone } from '@/utils';
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const tableList = ref([]);
|
|
@@ -165,15 +227,23 @@ const dialog = reactive<DialogOption>({
|
|
|
const initFormData = {
|
|
|
id: undefined,
|
|
|
name: undefined,
|
|
|
- deviceDetailId: undefined,
|
|
|
- detectionMethod: undefined,
|
|
|
- detectionStandard: undefined,
|
|
|
- detectionTools: undefined,
|
|
|
- judgeStandard: undefined,
|
|
|
- judgeMaxValue: undefined,
|
|
|
- judgeMinValue: undefined,
|
|
|
+ startTime: undefined,
|
|
|
+ endTime: undefined,
|
|
|
+ inspectionType: undefined,
|
|
|
+ inspectionCycle: 1,
|
|
|
+ status: 0,
|
|
|
+ inspectionRange: undefined,
|
|
|
+ inspectionPersonId: undefined,
|
|
|
+ inspectionItem: [{
|
|
|
+ deviceTypeId: undefined,
|
|
|
+ deviceTypeDetailIds: [],
|
|
|
+ items: []
|
|
|
+ }],
|
|
|
remark: undefined,
|
|
|
- ext1: undefined,
|
|
|
+ ext1: <any>{
|
|
|
+ phone: undefined,
|
|
|
+ inspectionPersonName: undefined,
|
|
|
+ },
|
|
|
ext2: undefined
|
|
|
};
|
|
|
const formData = reactive({
|
|
@@ -182,19 +252,24 @@ const formData = reactive({
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
name: undefined,
|
|
|
- deviceDetailId:undefined,
|
|
|
+ deviceDetailId: undefined,
|
|
|
params: {}
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+const cycleDisabled = ref(false)
|
|
|
const { queryParams, form } = toRefs(formData);
|
|
|
+const { inspection_type } = toRefs<any>(proxy?.useDict('inspection_type'));
|
|
|
+const { inspection_status } = toRefs<any>(proxy?.useDict('inspection_status'));
|
|
|
const dictGroup = reactive({
|
|
|
- deviceTypeDetailOptions: []
|
|
|
+ deviceOptions: [],
|
|
|
+ deviceTypeOptions: [],
|
|
|
+ inspectionItemOptions: []
|
|
|
})
|
|
|
+const userOptions = ref([])
|
|
|
/** 查询列表 */
|
|
|
const getList = async () => {
|
|
|
loading.value = true;
|
|
|
- const res = await listInspectionItem(queryParams.value);
|
|
|
+ const res = await listInspectionTask(queryParams.value);
|
|
|
tableList.value = res.rows.map((item) => ({
|
|
|
...item,
|
|
|
ext1: item.ext1 ? JSON.parse(item.ext1) : null,
|
|
@@ -237,30 +312,38 @@ const handleSelectionChange = (selection) => {
|
|
|
const handleAdd = () => {
|
|
|
reset();
|
|
|
dialog.visible = true;
|
|
|
- dialog.title = '新增巡检项';
|
|
|
+ dialog.title = '新增巡检计划';
|
|
|
};
|
|
|
/** 修改按钮操作 */
|
|
|
const handleUpdate = async (row) => {
|
|
|
reset();
|
|
|
const _id = row?.id || ids.value[0];
|
|
|
- const { data } = await getInspectionItem(_id);
|
|
|
+ const { data } = await getInspectionTask(_id);
|
|
|
data.ext1 = data.ext1 && JSON.parse(data.ext1);
|
|
|
Object.assign(form.value, data);
|
|
|
dialog.visible = true;
|
|
|
- dialog.title = '修改巡检项';
|
|
|
+ dialog.title = '修改巡检计划';
|
|
|
};
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
const submitForm = () => {
|
|
|
addFormRef.value?.validate(async (valid: boolean) => {
|
|
|
if (valid) {
|
|
|
- const { ext1 } = form.value;
|
|
|
+ const { ext1, inspectionItem } = form.value;
|
|
|
+ if (inspectionItem.length === 0) return proxy?.$modal.msgError('请添加巡检内容');
|
|
|
+ let validFlag = false
|
|
|
+ inspectionItem.forEach(item => {
|
|
|
+ if (item.deviceTypeId === '' || item.deviceTypeDetailIds.length == 0 || item.items.length == 0) {
|
|
|
+ validFlag = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (validFlag) return proxy?.$modal.msgError('请选择补充巡检内容信息');
|
|
|
buttonLoading.value = true;
|
|
|
- const params = Object.assign({}, form.value, { ext1: JSON.stringify(ext1) });
|
|
|
+ const params = Object.assign({}, form.value, { ext1: JSON.stringify(ext1), inspectionItem: JSON.stringify(inspectionItem) });
|
|
|
if (form.value.id) {
|
|
|
- await updateInspectionItem(params).finally(() => (buttonLoading.value = false));
|
|
|
+ await updateInspectionTask(params).finally(() => (buttonLoading.value = false));
|
|
|
} else {
|
|
|
- await addInspectionItem(params).finally(() => (buttonLoading.value = false));
|
|
|
+ await addInspectionTask(params).finally(() => (buttonLoading.value = false));
|
|
|
}
|
|
|
proxy?.$modal.msgSuccess('操作成功');
|
|
|
dialog.visible = false;
|
|
@@ -272,30 +355,114 @@ const submitForm = () => {
|
|
|
const handleDelete = async (row) => {
|
|
|
const _ids = row?.id || ids.value;
|
|
|
await proxy?.$modal.confirm('是否确认删除?').finally(() => (loading.value = false));
|
|
|
- await delInspectionItem(_ids);
|
|
|
+ await delInspectionTask(_ids);
|
|
|
proxy?.$modal.msgSuccess('删除成功');
|
|
|
await getList();
|
|
|
};
|
|
|
-const deviceTypeDetailList = async () => {
|
|
|
- const res = await getDeviceTypeDetailList({ });
|
|
|
- dictGroup.deviceTypeDetailOptions = res.rows.map((item) => ({
|
|
|
+const deviceTypeChange = (index, val) => {
|
|
|
+ form.value.inspectionItem[index].deviceTypeDetailIds = []
|
|
|
+ getDeviceList(val)
|
|
|
+}
|
|
|
+const getDeviceList = async (deviceTypeId) => {
|
|
|
+ let deviceTypeDetailList = []
|
|
|
+ dictGroup.deviceOptions = []
|
|
|
+ await getDeviceTypeDetailList({ deviceTypeId }).then(({ code, rows }) => {
|
|
|
+ if (code === 200) {
|
|
|
+ deviceTypeDetailList = rows
|
|
|
+ }
|
|
|
+ })
|
|
|
+ deviceTypeDetailList.forEach(async (item) => {
|
|
|
+ const res = await listDevice({ devTypeDetailId: item.id });
|
|
|
+ if (res.code === 200) {
|
|
|
+ dictGroup.deviceOptions.push(...res.rows.map((item) => ({
|
|
|
+ ...item,
|
|
|
+ ext1: item.ext1 ? JSON.parse(item.ext1) : null
|
|
|
+ })))
|
|
|
+ }
|
|
|
+ })
|
|
|
+};
|
|
|
+const deviceTypeList = async () => {
|
|
|
+ const res = await listDeviceType({});
|
|
|
+ dictGroup.deviceTypeOptions = res.rows.map((item) => ({
|
|
|
...item,
|
|
|
ext1: item.ext1 ? JSON.parse(item.ext1) : null
|
|
|
}));
|
|
|
};
|
|
|
-const formatDevice = (val) => {
|
|
|
- let label = ''
|
|
|
- dictGroup.deviceTypeDetailOptions.forEach((item) => {
|
|
|
- if (val===item.id) {
|
|
|
- label=`${item.ext1.brand}${item.xh}`
|
|
|
+const getInspectionItem = () => {
|
|
|
+ listInspectionItem({}).then(({ code, rows }) => {
|
|
|
+ if (code === 200) {
|
|
|
+ dictGroup.inspectionItemOptions = rows
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+const inspectionTypeChange = () => {
|
|
|
+ if (form.value.inspectionType === '1') {
|
|
|
+ form.value.inspectionCycle = 1
|
|
|
+ cycleDisabled.value = true
|
|
|
+ } else {
|
|
|
+ cycleDisabled.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+const setUserInfo = () => {
|
|
|
+ form.value.ext1.phone = ''
|
|
|
+ form.value.ext1.inspectionPersonName = ''
|
|
|
+ const { inspectionPersonId } = form.value
|
|
|
+ userOptions.value.forEach(item => {
|
|
|
+ item.children.forEach(el => {
|
|
|
+ if (inspectionPersonId === el.value) {
|
|
|
+ form.value.ext1.phone = el.phone
|
|
|
+ form.value.ext1.inspectionPersonName = el.label
|
|
|
}
|
|
|
+ })
|
|
|
+
|
|
|
})
|
|
|
- return label
|
|
|
+}
|
|
|
+const getInspectionTeamList = async () => {
|
|
|
+ const res = await listInspectionTeam({});
|
|
|
+ res.rows.forEach((item) => {
|
|
|
+ if (item.ext1) {
|
|
|
+ item.ext1 = JSON.parse(item.ext1)
|
|
|
+ }
|
|
|
+ if (item.members) {
|
|
|
+ item.members = JSON.parse(item.members)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ userOptions.value = res.rows.map(item => ({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ children: item.members.map(el => ({
|
|
|
+ label: el.userName,
|
|
|
+ value: el.userId,
|
|
|
+ phone:el.phone
|
|
|
+ }))
|
|
|
+ }))
|
|
|
+};
|
|
|
+const addInspectionItem = () => {
|
|
|
+ form.value.inspectionItem.push({
|
|
|
+ deviceTypeId: undefined,
|
|
|
+ deviceTypeDetailIds: [],
|
|
|
+ items: []
|
|
|
+ })
|
|
|
+}
|
|
|
+const delInspectionItem = (index) => {
|
|
|
+ form.value.inspectionItem.splice(index, 1)
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
getList();
|
|
|
- deviceTypeDetailList()
|
|
|
+ deviceTypeList()
|
|
|
+ getInspectionItem()
|
|
|
+ getInspectionTeamList()
|
|
|
});
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+.operateBtn {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .el-icon {
|
|
|
+ color: #409eff;
|
|
|
+ margin-left: 5px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|