From 2cb54a94783b0795a2dd7fdb5c3c5257204c4550 Mon Sep 17 00:00:00 2001
From: shj <1790240199@qq.com>
Date: 星期二, 09 八月 2022 15:26:26 +0800
Subject: [PATCH] 对接
---
src/views/facilityManagement/ProductionEquipment/index.vue | 2
src/views/facilityManagement/InstrumentationInformation/index.vue | 2
src/components/equipmentDailog/Dailog.vue | 18 ++++-
src/views/facilityManagement/safetyEquipment/index.vue | 2
src/components/equipmentDailog/categoryDailog.vue | 122 ++++++++++++++++++----------------------
5 files changed, 70 insertions(+), 76 deletions(-)
diff --git a/src/components/equipmentDailog/Dailog.vue b/src/components/equipmentDailog/Dailog.vue
index e2a5998..ff93503 100644
--- a/src/components/equipmentDailog/Dailog.vue
+++ b/src/components/equipmentDailog/Dailog.vue
@@ -6,7 +6,7 @@
<el-input v-model="form.qName" placeholder="请填写装置设施名称" />
</el-form-item>
<el-form-item label="装置设施位号" size="default" prop="positionNum">
- <el-input v-model="form.positionNum" placeholder="请填写装置设施位号" />
+ <el-input disabled v-model="form.positionNum" placeholder="请填写装置设施位号" />
</el-form-item>
<el-form-item label="装置设施用途" size="default" prop="qUsage">
<el-input v-model="form.qUsage" placeholder="请填写装置设施用途" />
@@ -14,8 +14,8 @@
<el-form-item label="装置设施型号" size="default" prop="model">
<el-input v-model="form.model" placeholder="请填写装置设施型号" />
</el-form-item>
- <el-form-item label="类型/类别外键" size="default" prop="equipmentTypeId">
- <el-input v-model="form.equipmentTypeId" placeholder="请选择">
+ <el-form-item label="类型/类别外键" size="default" prop="equipmentTypeName">
+ <el-input v-model="form.equipmentTypeName" placeholder="请选择">
<template #append>
<el-button :icon="Search" @click="opencategory"></el-button>
</template>
@@ -333,7 +333,7 @@
</span>
</template>
</el-dialog>
- <categoryDailog ref="categoryShow"></categoryDailog>
+ <categoryDailog ref="categoryShow" @typeId="Tid"></categoryDailog>
<regionDailog ref="regionShow"></regionDailog>
<DailogSearchUser ref="UserShow" @SearchUser="userId"></DailogSearchUser>
<maintenanceDailog ref="maintenanceShow" @onMain="main"></maintenanceDailog>
@@ -460,7 +460,8 @@
repaireDetailList: [],
- equipmentTypeId: 1,
+ equipmentTypeId: "",
+ equipmentTypeName:"",
useDate: '',
@@ -520,6 +521,7 @@
qUsage: [],
model: [],
equipmentTypeId: [],
+ equipmentTypeName:[],
departmentId: [],
setPart: [],
produceTime: [],
@@ -731,6 +733,11 @@
form.value.stopSubmitPersonName = val.realName;
}
};
+ const Tid=(data:any)=>{
+ form.value.equipmentTypeId=data.id
+ form.value.equipmentTypeName=data.typeName
+ form.value.positionNum=data.sortNum
+ }
//全屏
const full = ref(false);
const toggleFullscreen = () => {
@@ -759,6 +766,7 @@
};
const data = ref();
return {
+ Tid,
deepClone,
rules,
userId,
diff --git a/src/components/equipmentDailog/categoryDailog.vue b/src/components/equipmentDailog/categoryDailog.vue
index 4338c2d..4a8bf12 100644
--- a/src/components/equipmentDailog/categoryDailog.vue
+++ b/src/components/equipmentDailog/categoryDailog.vue
@@ -3,18 +3,18 @@
<el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
<el-row>
<el-col :span="17">
- <el-form ref="ruleFormRef" :model="ruleForm" status-icon>
+ <!-- <el-form ref="ruleFormRef" :model="ruleForm" status-icon>
<el-row>
<el-col :span="12">
<el-form-item size="default">
<el-input v-model="ruleForm.pass" placeholder="类别名称" />
</el-form-item>
</el-col>
- <!-- <el-col :span="6" :offset="1">
+ <el-col :span="6" :offset="1">
<el-form-item>
<el-input v-model="ruleForm.checkPass" placeholder="目标指标编号" />
</el-form-item>
- </el-col> -->
+ </el-col>
<el-col :span="11" :offset="1">
<el-form-item>
<el-button size="default" type="primary" @click="submitForm(ruleFormRef)">查询</el-button>
@@ -22,34 +22,22 @@
</el-form-item>
</el-col>
</el-row>
- </el-form>
- <el-button size="default" :icon="Delete">清除选择</el-button>
- <el-table :data="tableData" style="width: 100%; margin-top: 20px">
- <el-table-column align="center">
+ </el-form> -->
+ <el-button size="default" :icon="Delete" @click="clear">清除选择</el-button>
+ <el-table :data="tableData" style="width: 100%; margin-top: 20px" row-key="id" :tree-props="propse">
+ <el-table-column align="center" width="100px">
<template #default="scope">
- <el-radio-group v-model="radio1" @change="radio">
- <el-radio :label="scope.row.date" size="large">{{ null }}</el-radio>
+ <el-radio-group v-model="radio1">
+ <el-radio :label="scope.row.id" @click="radio(scope.row)" size="large">{{ null }}</el-radio>
</el-radio-group>
</template>
</el-table-column>
- <el-table-column align="center" prop="date" label="id" />
- <el-table-column align="center" prop="name" label="类别名称" />
+ <el-table-column align="center" prop="id" label="id" />
+ <el-table-column align="center" prop="typeName" label="类别名称" />
</el-table>
- <el-pagination
- style="padding: 20px 0; border-bottom: 1px solid #dedede"
- v-model:currentPage="currentPage4"
- v-model:page-size="pageSize4"
- :page-sizes="[100, 200, 300, 400]"
- :small="small"
- :disabled="disabled"
- :background="background"
- layout="total, sizes, prev, pager, next, jumper"
- :total="400"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
</el-col>
<el-col :span="7">
+ <div v-if="dynamicTags[0]==''?false:true">
<el-tag
v-for="tag in dynamicTags"
:key="tag"
@@ -59,14 +47,15 @@
:disable-transitions="false"
@close="handleClose(tag)"
>
- {{ tag }}
+ {{ tag.typeName }}
</el-tag>
+ </div>
</el-col>
</el-row>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false" size="default">关闭</el-button>
- <el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button>
+ <el-button type="primary" @click="submitForm" size="default">确定</el-button>
</span>
</template>
</el-dialog>
@@ -74,57 +63,54 @@
<script lang="ts">
import { defineComponent, reactive, ref } from 'vue';
import { Delete, FullScreen } from '@element-plus/icons-vue';
+import { facilityManagementApi } from '/@/api/facilityManagement';
+import { ElMessage,ElMessageBox } from 'element-plus';
export default defineComponent({
- setup() {
+ setup(props,{emit}) {
const dialogVisible = ref<boolean>(false);
const openDailog = () => {
dialogVisible.value = true;
+ listApi()
};
- // 搜索条件
- const ruleForm = reactive({
- pass: '',
- checkPass: '',
- });
+ // 列表
+ const listApi = () => {
+ facilityManagementApi()
+ .getequipmentTypeMngTreeData()
+ .then((res) => {
+ if (res.data.code == 200) {
+ tableData.value = res.data.data;
+ } else {
+ ElMessage({
+ showClose: true,
+ message: res.data.msg,
+ type: 'error',
+ });
+ }
+ });
+ };
// 表格
- const tableData = [
- {
- date: '2016-05-03',
- name: 'Tom',
- address: 'No. 189, Grove St, Los Angeles',
- },
- {
- date: '2016-05-02',
- name: 'Tom',
- address: 'No. 189, Grove St, Los Angeles',
- },
- {
- date: '2016-05-04',
- name: 'Tom',
- address: 'No. 189, Grove St, Los Angeles',
- },
- {
- date: '2016-05-01',
- name: 'Tom',
- address: 'No. 189, Grove St, Los Angeles',
- },
- ];
- const pageSize4 = ref(100);
- const handleSizeChange = (val: number) => {
- console.log(`${val} items per page`);
- };
- const handleCurrentChange = (val: number) => {
- console.log(`current page: ${val}`);
+ const tableData = ref([])
+ const propse = {
+ children: 'childList',
};
// 右方点击添加后显示标签
- const dynamicTags = ref(['2016-05-03']);
+ const dynamicTags = ref(['']);
const handleClose = (tag: string) => {
dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);
radio1.value = '';
};
- const radio1 = ref('2016-05-03');
- const radio = (event: any) => {
- dynamicTags.value[0] = event;
+ const radio1 = ref('');
+ const radio = (data: any) => {
+ dynamicTags.value[0] = data
};
+ const clear=()=>{
+ radio1.value=""
+ dynamicTags.value=['']
+ }
+ const submitForm=()=>{
+ emit('typeId',dynamicTags.value[0])
+ dialogVisible.value=false
+ }
//全屏
const full = ref(false);
const toggleFullscreen = () => {
@@ -135,13 +121,13 @@
}
};
return {
+ submitForm,
+ clear,
dialogVisible,
openDailog,
- ruleForm,
+ listApi,
+ propse,
tableData,
- pageSize4,
- handleSizeChange,
- handleCurrentChange,
dynamicTags,
handleClose,
radio1,
diff --git a/src/views/facilityManagement/InstrumentationInformation/index.vue b/src/views/facilityManagement/InstrumentationInformation/index.vue
index d4e4308..7cbe2af 100644
--- a/src/views/facilityManagement/InstrumentationInformation/index.vue
+++ b/src/views/facilityManagement/InstrumentationInformation/index.vue
@@ -299,7 +299,7 @@
return data.typeName.includes(value);
};
const handleNodeClick = (data: Tree) => {
- ruleForm.searchParams.positionNum = data.id;
+ ruleForm.searchParams.positionNum = data.sortNum;
listApi();
};
const data = ref([]);
diff --git a/src/views/facilityManagement/ProductionEquipment/index.vue b/src/views/facilityManagement/ProductionEquipment/index.vue
index ab8551e..a08f60f 100644
--- a/src/views/facilityManagement/ProductionEquipment/index.vue
+++ b/src/views/facilityManagement/ProductionEquipment/index.vue
@@ -299,7 +299,7 @@
return data.typeName.includes(value);
};
const handleNodeClick=(data: Tree)=>{
- ruleForm.searchParams.positionNum=data.id
+ ruleForm.searchParams.positionNum=data.sortNum
listApi();
}
const data=ref([])
diff --git a/src/views/facilityManagement/safetyEquipment/index.vue b/src/views/facilityManagement/safetyEquipment/index.vue
index 576cfb7..546b28b 100644
--- a/src/views/facilityManagement/safetyEquipment/index.vue
+++ b/src/views/facilityManagement/safetyEquipment/index.vue
@@ -300,7 +300,7 @@
return data.typeName.includes(value);
};
const handleNodeClick=(data: Tree)=>{
- ruleForm.searchParams.positionNum=data.id
+ ruleForm.searchParams.positionNum=data.sortNum
listApi();
}
const data=ref([])
--
Gitblit v1.9.2