| | |
| | | <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> |
| | |
| | | <script lang="ts"> |
| | | interface stateType { |
| | | isShowProductionDeviceDialog: Boolean; |
| | | disabled: Boolean; |
| | | personTime: Boolean; |
| | | productionDeviceForm: { |
| | | produceDeviceName: string; |
| | | depId: number | null; |
| | |
| | | const productionDeviceFormRef = ref(); |
| | | const state = reactive<stateType>({ |
| | | title: '', |
| | | disabled: false, |
| | | personTime: false, |
| | | departmentList: [], |
| | | isShowProductionDeviceDialog: false, |
| | | levelList: [ |
| | |
| | | productionDeviceFormRef.value.clearValidate(); |
| | | }); |
| | | if (type === '新增') { |
| | | state.disabled = true; |
| | | state.personTime = false; |
| | | state.title = '新增生产装置'; |
| | | state.productionDeviceForm = { |
| | | produceDeviceName: '', |
| | |
| | | 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)); |
| | | } |
| | |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .input-length { |
| | | width: 85%; |
| | | } |
| | | </style> |
| | | <style scoped></style> |