| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" :before-close="resetForm" draggable :title="titles" width="60%"> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form :model="form" :disabled="disabled" label-width="120px" class="formType"> |
| | | <el-form :model="form" ref="ruleFormRef" :rules="rules" :disabled="disabled" label-width="120px" class="formType"> |
| | | <el-form-item label="装置设施名称" size="default"> |
| | | <el-input v-model="form.qName" placeholder="请填写装置设施名称" /> |
| | | </el-form-item> |
| | |
| | | <el-date-picker v-model="form.nextTakecareDate" format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择日期时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="负责人" size="default"> |
| | | <el-input v-model="form.leadingPersonId" placeholder="请选择"> |
| | | <el-input v-model="form.leadingPersonName" placeholder="请选择"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="openUser(0)"></el-button> |
| | | <el-button :icon="Search" @click="openUser(1)"></el-button> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | |
| | | <el-date-picker v-model="form.actualStopDate" format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="选择日期时间" style="width: 100%" /> |
| | | </el-form-item> |
| | | <el-form-item label="停用提交人" size="default"> |
| | | <el-input v-model="form.stopSubmitPersonId" placeholder="请选择"> |
| | | <el-input v-model="form.stopSubmitPersonName" placeholder="请选择"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="openUser(1)"></el-button> |
| | | <el-button :icon="Search" @click="openUser(2)"></el-button> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | |
| | | <el-button type="primary" size="default" @click="openMaintenance('新增', '')">新增</el-button> |
| | | <el-table :data="form.takecareDetailList" style="width: 100%"> |
| | | <el-table-column align="center" prop="takecareMemo" label="保养情况" /> |
| | | <el-table-column align="center" prop="leadingPersonId" label="保养负责人" /> |
| | | <el-table-column align="center" prop="leadingPersonName" label="保养负责人" /> |
| | | <el-table-column align="center" prop="takecareDate" :formatter="timeDate" label="保养日期" /> |
| | | <el-table-column align="center" prop="leadingPersonDepartmentId" label="保养负责人单位" /> |
| | | <el-table-column align="center" label="操作"> |
| | |
| | | </el-tabs> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="resetForm">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm">确定</el-button> |
| | | <el-button @click="resetForm(ruleFormRef)">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm(ruleFormRef)">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | import maintenanceDailog from './maintenanceDailog.vue'; |
| | | import detectDailog from './detectDailog.vue'; |
| | | import repairDailog from './repairDailog.vue'; |
| | | import {timeDate} from '/@/assets/index.ts' |
| | | import { timeDate } from '/@/assets/index.ts'; |
| | | import standardDailog from './standardDailog.vue'; |
| | | import DailogSearchUser from '/@/components/DailogSearchUser/index.vue'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus'; |
| | | import { ElMessage, ElMessageBox, FormInstance, FormRules } from 'element-plus'; |
| | | import type { UploadProps, UploadUserFile } from 'element-plus'; |
| | | import { facilityManagementApi } from '/@/api/facilityManagement'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | import { number } from 'echarts'; |
| | | export default defineComponent({ |
| | | components: { categoryDailog, regionDailog, DailogSearchUser, maintenanceDailog, detectDailog, repairDailog, standardDailog }, |
| | | setup(props, { emit }) { |
| | | const dialogVisible = ref(false); |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | const form = ref({ |
| | | supplyName: '', |
| | | |
| | |
| | | checkPoint: '', |
| | | |
| | | leadingPersonId: '', |
| | | leadingPersonName: '', |
| | | |
| | | qName: '', |
| | | |
| | |
| | | lockNum: '', |
| | | |
| | | stopSubmitPersonId: '', |
| | | |
| | | stopSubmitPersonName: '', |
| | | afterStopStep: '', |
| | | |
| | | lifeCycle: '', |
| | |
| | | } |
| | | }); |
| | | }; |
| | | const rules = reactive<FormRules>({}); |
| | | // 提交 |
| | | const submitForm = () => { |
| | | form.value.delTakecareDetails = deleteAId.value.toString(); |
| | | form.value.delTestDetails = deleteBId.value.toString(); |
| | | form.value.delRepaireDetails = deleteCId.value.toString(); |
| | | form.value.delCheckStandardeDetails = deleteDId.value.toString(); |
| | | dialogVisible.value = false; |
| | | facilityManagementApi() |
| | | .getequipmentInfoAddOrUpdate(form.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | form.value.delTakecareDetails = deleteAId.value.toString(); |
| | | form.value.delTestDetails = deleteBId.value.toString(); |
| | | form.value.delRepaireDetails = deleteCId.value.toString(); |
| | | form.value.delCheckStandardeDetails = deleteDId.value.toString(); |
| | | dialogVisible.value = false; |
| | | facilityManagementApi() |
| | | .getequipmentInfoAddOrUpdate(form.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | emit('navAddorUpdata'); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | emit('navAddorUpdata'); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | form.value = { |
| | | supplyName: '', |
| | | |
| | | nextTestDate: '', |
| | | |
| | | qUsage: '', |
| | | |
| | | departmentId: '', |
| | | |
| | | produceTime: '', |
| | | |
| | | actualStopDate: '', |
| | | |
| | | takecareDetailList: [], |
| | | |
| | | infoType: '', |
| | | |
| | | leadingDepartmentId: '', |
| | | |
| | | useEndDay: '', |
| | | |
| | | previousTakecareDate: '', |
| | | |
| | | previousCheckDate: '', |
| | | |
| | | model: '', |
| | | |
| | | stopStatus: '', |
| | | |
| | | testWarn: '', |
| | | |
| | | stopSubmitDate: '', |
| | | |
| | | repairStatus: '', |
| | | |
| | | takecareStardardeDetailList: [ |
| | | { |
| | | filePath: '123', |
| | | }, |
| | | ], |
| | | |
| | | nextCheckDate: '', |
| | | |
| | | checkCycle: '', |
| | | |
| | | checkPoint: '', |
| | | |
| | | leadingPersonId: '', |
| | | |
| | | qName: '', |
| | | |
| | | nextTakecareDate: '', |
| | | |
| | | setPart: '', |
| | | |
| | | checkStandardeDetailList: [], |
| | | |
| | | actualDestoryDate: '', |
| | | |
| | | isNeedTest: '', |
| | | |
| | | alertNum: '', |
| | | |
| | | checkContent: '', |
| | | |
| | | useMemo: '', |
| | | |
| | | previousTestDate: '', |
| | | |
| | | isNeedTakecare: '', |
| | | |
| | | destoryReason: '', |
| | | |
| | | checkDetailList: [], |
| | | |
| | | positionNum: '', |
| | | |
| | | testCycle: '', |
| | | |
| | | recoveryReason: '', |
| | | |
| | | isNeedCheck: '', |
| | | |
| | | actualRecoveryDate: '', |
| | | |
| | | leadingPersonDepartmentId: '', |
| | | |
| | | stopReason: '', |
| | | |
| | | destorySubmitDate: '', |
| | | |
| | | testDetailList: [], |
| | | |
| | | checkWarn: '', |
| | | |
| | | repaireDetailList: [], |
| | | |
| | | equipmentTypeId: 1, |
| | | |
| | | useDate: '', |
| | | |
| | | recoverySubmitDate: '', |
| | | |
| | | lockNum: '', |
| | | |
| | | stopSubmitPersonId: '', |
| | | |
| | | afterStopStep: '', |
| | | |
| | | lifeCycle: '', |
| | | |
| | | delCheckStandardeDetails: '', |
| | | |
| | | delTakecareStardardeDetails: '', |
| | | |
| | | delTakecareDetails: '', |
| | | |
| | | delRepaireDetails: '', |
| | | |
| | | delTestDetails: '', |
| | | }; |
| | | } |
| | | }); |
| | | }; |
| | | // 取消 |
| | | const resetForm = () => { |
| | | dialogVisible.value = false; |
| | | form.value = { |
| | | supplyName: '', |
| | | |
| | | nextTestDate: '', |
| | | |
| | | qUsage: '', |
| | | |
| | | departmentId: '', |
| | | |
| | | produceTime: '', |
| | | |
| | | actualStopDate: '', |
| | | |
| | | takecareDetailList: [], |
| | | |
| | | infoType: '', |
| | | |
| | | leadingDepartmentId: '', |
| | | |
| | | useEndDay: '', |
| | | |
| | | previousTakecareDate: '', |
| | | |
| | | previousCheckDate: '', |
| | | |
| | | model: '', |
| | | |
| | | stopStatus: '', |
| | | |
| | | testWarn: '', |
| | | |
| | | stopSubmitDate: '', |
| | | |
| | | repairStatus: '', |
| | | |
| | | takecareStardardeDetailList: [ |
| | | { |
| | | filePath: '123', |
| | | }, |
| | | ], |
| | | |
| | | nextCheckDate: '', |
| | | |
| | | checkCycle: '', |
| | | |
| | | checkPoint: '', |
| | | |
| | | leadingPersonId: '', |
| | | |
| | | qName: '', |
| | | |
| | | nextTakecareDate: '', |
| | | |
| | | setPart: '', |
| | | |
| | | checkStandardeDetailList: [], |
| | | |
| | | actualDestoryDate: '', |
| | | |
| | | isNeedTest: '', |
| | | |
| | | alertNum: '', |
| | | |
| | | checkContent: '', |
| | | |
| | | useMemo: '', |
| | | |
| | | previousTestDate: '', |
| | | |
| | | isNeedTakecare: '', |
| | | |
| | | destoryReason: '', |
| | | |
| | | checkDetailList: [], |
| | | |
| | | positionNum: '', |
| | | |
| | | testCycle: '', |
| | | |
| | | recoveryReason: '', |
| | | |
| | | isNeedCheck: '', |
| | | |
| | | actualRecoveryDate: '', |
| | | |
| | | leadingPersonDepartmentId: '', |
| | | |
| | | stopReason: '', |
| | | |
| | | destorySubmitDate: '', |
| | | |
| | | testDetailList: [], |
| | | |
| | | checkWarn: '', |
| | | |
| | | repaireDetailList: [], |
| | | |
| | | equipmentTypeId: 1, |
| | | |
| | | useDate: '', |
| | | |
| | | recoverySubmitDate: '', |
| | | |
| | | lockNum: '', |
| | | |
| | | stopSubmitPersonId: '', |
| | | |
| | | afterStopStep: '', |
| | | |
| | | lifeCycle: '', |
| | | |
| | | delCheckStandardeDetails: '', |
| | | |
| | | delTakecareStardardeDetails: '', |
| | | |
| | | delTakecareDetails: '', |
| | | |
| | | delRepaireDetails: '', |
| | | |
| | | delTestDetails: '', |
| | | }; |
| | | }; |
| | | const activeName = ref('first'); |
| | | const index = ref<any>(); |
| | |
| | | }; |
| | | const userId = (val: any, type: number) => { |
| | | console.log(val, type); |
| | | if (type == 0) { |
| | | if (type == 1) { |
| | | form.value.leadingPersonId = val.uid; |
| | | } else if (type == 1) { |
| | | form.value.leadingPersonName = val.realName; |
| | | } else if (type == 2) { |
| | | form.value.stopSubmitPersonId = val.uid; |
| | | form.value.stopSubmitPersonName = val.realName; |
| | | } |
| | | }; |
| | | //全屏 |
| | |
| | | }; |
| | | const data = ref(); |
| | | return { |
| | | rules, |
| | | userId, |
| | | department, |
| | | propse, |
| | |
| | | full, |
| | | toggleFullscreen, |
| | | FullScreen, |
| | | timeDate, |
| | | timeDate, |
| | | ruleFormRef, |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" :title="titles" width="50%" draggable> |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" @close="resetForm(ruleFormRef)" :title="titles" width="50%" draggable> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form :model="form" :disabled="disabled" label-width="120px"> |
| | | <el-form :model="form" :disabled="disabled" ref="ruleFormRef" :rules="rules" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="是否为设备内容" size="default"> |
| | | <el-form-item label="是否为设备内容" size="default" prop="isContent"> |
| | | <el-select v-model="form.isContent" placeholder="请选择" style="width: 100%"> |
| | | <el-option label="是" value="1" /> |
| | | <el-option label="否" value="2" /> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="父级编号" size="default"> |
| | | <el-tree-select check-strictly="true" v-model="form.parentId" :data="data" :props="propst" class="w100" placeholder="请选择" /> |
| | | <el-form-item label="父级编号" size="default" prop="parentId"> |
| | | <el-tree-select clearable check-strictly="true" v-model="form.parentId" :data="data" :props="propst" class="w100" placeholder="请选择" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="类别名称" size="default"> |
| | | <el-form-item label="类别名称" size="default" prop="typeName"> |
| | | <el-input v-model="form.typeName" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="排列序列" size="default"> |
| | | <el-input v-model="form.sortNum" /> |
| | | <el-form-item label="排列序列" size="default" prop="sortNum"> |
| | | <el-input v-model.number="form.sortNum" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="resetForm">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm">确定</el-button> |
| | | <el-button @click="resetForm(ruleFormRef)">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm(ruleFormRef)">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref } from 'vue'; |
| | | import { defineComponent, ref, reactive } from 'vue'; |
| | | import type { FormInstance, FormRules } from 'element-plus'; |
| | | import { FullScreen } from '@element-plus/icons-vue'; |
| | | import { facilityManagementApi } from '/@/api/facilityManagement'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { type } from 'os'; |
| | | export default defineComponent({ |
| | | setup(prpos, { emit }) { |
| | | const dialogVisible = ref(false); |
| | | const form = ref({ |
| | | isContent: '', ////是否为设备内容 1:是 2:否 |
| | | typeName: '', ////类别名称 |
| | | parentId: 0, ////父级ID,如果没有父级,为0 |
| | | parentId: "", ////父级ID,如果没有父级,为0 |
| | | isCheck: 0, ////是否检测 1:是 2:否 |
| | | isVisit: 0, ////是否巡检 1:是 2:否 |
| | | sortNum: '', //排列序列 |
| | |
| | | } else if (title == '修改') { |
| | | detail(id); |
| | | } else if (title == '添加') { |
| | | // detail(id); |
| | | form.value.parentId=id |
| | | } |
| | | }; |
| | | const detail = (id: number) => { |
| | |
| | | children: 'childList', |
| | | value: 'id', |
| | | }; |
| | | const submitForm = () => { |
| | | facilityManagementApi() |
| | | .getequipmentTypeMngAddOrUpdate(form.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | dialogVisible.value = false; |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | const rules = reactive<FormRules>({ |
| | | isContent: [{ required: true, message: '是否为设备内容不能为空', trigger: 'change' }], |
| | | parentId: [], |
| | | typeName: [{ required: true, message: '类别名称不能为空', trigger: 'change' }], |
| | | sortNum: [ |
| | | { required: true, message: '排列序列不能为空', trigger: 'change' }, |
| | | { type: 'number', message: '请输入数字!', trigger: 'change' }, |
| | | ], |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | facilityManagementApi() |
| | | .getequipmentTypeMngAddOrUpdate(form.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | dialogVisible.value = false; |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | emit('onAdd'); |
| | | formEl.resetFields(); |
| | | } else { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'error', |
| | | }); |
| | | } |
| | | }); |
| | | emit('onAdd'); |
| | | } else { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'error', |
| | | }); |
| | | } |
| | | }); |
| | | form.value = { |
| | | isContent: '', ////是否为设备内容 1:是 2:否 |
| | | typeName: '', ////类别名称 |
| | | parentId: 0, ////父级ID,如果没有父级,为0 |
| | | isCheck: 0, ////是否检测 1:是 2:否 |
| | | isVisit: 0, ////是否巡检 1:是 2:否 |
| | | sortNum: '', //排列序列 |
| | | id: '', //设备类型ID ,更新时必填 |
| | | }; |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | }; |
| | | const resetForm = () => { |
| | | form.value = { |
| | | isContent: '', ////是否为设备内容 1:是 2:否 |
| | | typeName: '', ////类别名称 |
| | | parentId: 0, ////父级ID,如果没有父级,为0 |
| | | isCheck: 0, ////是否检测 1:是 2:否 |
| | | isVisit: 0, ////是否巡检 1:是 2:否 |
| | | sortNum: '', //排列序列 |
| | | id: '', //设备类型ID ,更新时必填 |
| | | }; |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | dialogVisible.value = false; |
| | | }; |
| | | //全屏 |
| | | const full = ref(false); |
| | |
| | | }; |
| | | return { |
| | | detail, |
| | | rules, |
| | | ruleFormRef, |
| | | listApi, |
| | | propst, |
| | | submitForm, |