From 1b9fea7d4af68d8f933b2dc42bf6084b9646f64c Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期二, 04 三月 2025 08:39:55 +0800 Subject: [PATCH] 修改作业等级名称 --- src/views/doublePrevent/riskLevel/device/components/productionDeviceDialog.vue | 87 +++++++++++++++++++++---------------------- 1 files changed, 42 insertions(+), 45 deletions(-) diff --git a/src/views/doublePrevent/riskLevel/device/components/productionDeviceDialog.vue b/src/views/doublePrevent/riskLevel/device/components/productionDeviceDialog.vue index 6b9616e..497363d 100644 --- a/src/views/doublePrevent/riskLevel/device/components/productionDeviceDialog.vue +++ b/src/views/doublePrevent/riskLevel/device/components/productionDeviceDialog.vue @@ -1,69 +1,57 @@ <template> <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isShowProductionDeviceDialog" width="600px"> - <el-form - :model="productionDeviceForm" - :rules="productionDeviceFormRules" - ref="productionDeviceFormRef" - size="default" - label-width="120px" - > + <el-dialog :title="title" v-model="isShowProductionDeviceDialog" width="600px" :close-on-click-modal="false"> + <el-form :model="productionDeviceForm" :rules="productionDeviceFormRules" ref="productionDeviceFormRef" size="default" label-width="120px"> <el-row :gutter="35"> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-form-item label="生产装置名称" prop="produceDeviceName"> - <el-input - class="input-length" - v-model.trim="productionDeviceForm.produceDeviceName" - placeholder="请输入生产装置名称" - clearable - ></el-input> + <el-input class="input-add" :disabled="!disabled" v-model.trim="productionDeviceForm.produceDeviceName" placeholder="请输入生产装置名称" clearable></el-input> </el-form-item> </el-col> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-form-item label="所属部门" prop="depId"> - <el-cascader - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" - placeholder="请选择部门" - clearable - filterable - style="width: 85%" - v-model="productionDeviceForm.depId" - > - </el-cascader> + <el-cascader :options="departmentList" :disabled="!disabled" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请选择部门" clearable filterable style="width: 90%" v-model="productionDeviceForm.depId"> </el-cascader> <!-- <el-select class="input-length" v-model="productionDeviceForm.depName" placeholder="请选择所属部门" clearable filterable></el-select>--> </el-form-item> </el-col> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-form-item label="风险等级" prop="riskLevel"> - <el-select - class="input-length" - v-model="productionDeviceForm.riskLevel" - placeholder="请选择风险等级" - clearable - filterable - > + <el-select class="input-add" :disabled="!disabled" v-model="productionDeviceForm.riskLevel" placeholder="请选择风险等级" clearable filterable> <el-option v-for="item in levelList" :key="item.id" :label="item.name" :value="item.id"></el-option> </el-select> </el-form-item> </el-col> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-form-item label="区域位置" prop="location"> - <el-input - class="input-length" - v-model.trim="productionDeviceForm.location" - type="textarea" - placeholder="请输入区域位置" - maxlength="150" - ></el-input> + <el-input class="input-add" :disabled="!disabled" v-model.trim="productionDeviceForm.location" type="textarea" placeholder="请输入区域位置" maxlength="150"></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-show="personTime"> + <el-form-item label="创建人" prop="location"> + <el-input class="input-add" :disabled="!disabled" v-model.trim="productionDeviceForm.createByUserName" placeholder="请输入区域位置"></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-show="personTime"> + <el-form-item label="创建时间" prop="location"> + <el-input class="input-add" :disabled="!disabled" v-model.trim="productionDeviceForm.gmtCreate" placeholder="请输入区域位置"></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-show="personTime"> + <el-form-item label="最后修改人" prop="location"> + <el-input class="input-add" :disabled="!disabled" v-model.trim="productionDeviceForm.lastEditUserName" placeholder="请输入区域位置"></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-show="personTime"> + <el-form-item label="最后修改时间" prop="location"> + <el-input class="input-add" :disabled="!disabled" v-model.trim="productionDeviceForm.gmtModitify" placeholder="请输入区域位置"></el-input> </el-form-item> </el-col> </el-row> </el-form> <template #footer> - <span class="dialog-footer"> + <span class="dialog-footer" v-show="disabled"> <el-button @click="isShowProductionDeviceDialog = !isShowProductionDeviceDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitProductionDevice" v-throttle size="default">确 实</el-button> + <el-button type="primary" @click="submitProductionDevice" v-throttle size="default">确 定</el-button> </span> </template> </el-dialog> @@ -73,6 +61,8 @@ <script lang="ts"> interface stateType { isShowProductionDeviceDialog: Boolean; + disabled: Boolean; + personTime: Boolean; productionDeviceForm: { produceDeviceName: string; depId: number | null; @@ -94,6 +84,8 @@ const productionDeviceFormRef = ref(); const state = reactive<stateType>({ title: '', + disabled: false, + personTime: false, departmentList: [], isShowProductionDeviceDialog: false, levelList: [ @@ -124,6 +116,8 @@ productionDeviceFormRef.value.clearValidate(); }); if (type === '新增') { + state.disabled = true; + state.personTime = false; state.title = '新增生产装置'; state.productionDeviceForm = { produceDeviceName: '', @@ -131,7 +125,14 @@ riskLevel: null, location: '' }; + } else if (type === '查看') { + state.disabled = false; + state.personTime = true; + state.title = '查看生产装置'; + state.productionDeviceForm = JSON.parse(JSON.stringify(value)); } else { + state.disabled = true; + state.personTime = false; state.title = '修改生产装置'; state.productionDeviceForm = JSON.parse(JSON.stringify(value)); } @@ -193,8 +194,4 @@ }; </script> -<style scoped> -.input-length { - width: 85%; -} -</style> +<style scoped></style> -- Gitblit v1.9.2