| | |
| | | # 本地环境 |
| | | ENV = 'development' |
| | | |
| | | VITE_API_URL = 'http://192.168.0.35:8008' |
| | | #VITE_API_URL = 'http://192.168.0.35:8008' |
| | | #李宇飞接口地址 |
| | | |
| | | #VITE_API_URL = 'http://192.168.0.50:8008' |
| | | VITE_API_URL = 'http://192.168.0.50:8008' |
| | | #张凤接口地址 |
| | | |
| | | #VITE_API_URL = 'http://192.168.0.29:8008' |
| | |
| | | VITE_API_URL_SOCKET = 'http://121.239.169.27:16006/safeplatform' |
| | | #VITE_API_URL = 'http://192.168.0.52:8011/safeplatform' |
| | | #VITE_API_URL_OUT = 'http://192.168.0.52:8011/safeplatform-out' |
| | | #VITE_API_URL_SOCKET = 'http://192.168.0.52:8011/safeplatform' |
| | |
| | | // v1 |
| | | modApproveRule: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/work/ruleItemStand/update`, |
| | | url: import.meta.env.VITE_API_URL + `/rule/update`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | |
| | | |
| | | // 路由加载前 |
| | | router.beforeEach(async (to, from, next) => { |
| | | if (to.path === '/intelligentMap') { |
| | | if (to.path === '/intelligentLine') { |
| | | next(); |
| | | } else { |
| | | NProgress.configure({ showSpinner: false }); |
| | |
| | | <el-card shadow="hover"> |
| | | <div class="system-user-search mb15"> |
| | | <div class="basic-line"> |
| | | <span>生产装置名称:</span> |
| | | <span>生产装置名称: </span> |
| | | <el-input v-model="productionDeviceData.params.produceDeviceName" class="input-box"> </el-input> |
| | | </div> |
| | | <div class="basic-line"> |
| | | <span>风险等级:</span> |
| | | <span>风险等级: </span> |
| | | <el-select v-model="productionDeviceData.params.riskLevel" clearable filterable class="input-box" placeholder="请选择风险等级"> |
| | | <el-option v-for="item in levelList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic-line"> |
| | | <span>部门:</span> |
| | | <span>部门: </span> |
| | | <el-cascader :options="departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请选择部门" clearable filterable class="input-box" v-model="productionDeviceData.params.depId"> </el-cascader> |
| | | </div> |
| | | <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> |
| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="上传图片" prop="rfidImage"> |
| | | <el-upload accept="image/*" v-model:file-list="fileList" :http-request="upload" :action="uploadUrl" list-type="picture-card" :on-remove="handleRemove" :before-remove="beforeRemove" :before-upload="getUploadUrl"> |
| | | <el-upload accept="image/*" :on-preview="handlePictureCardPreview" :limits="1" v-model:file-list="fileList" :http-request="upload" :action="uploadUrl" list-type="picture-card" :on-remove="handleRemove" :before-remove="beforeRemove" :before-upload="getUploadUrl"> |
| | | <el-icon><Plus /></el-icon> |
| | | <template #tip> |
| | | <div class="el-upload__tip">上传 jpg/png 图片尺寸小于500KB</div> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogVisible"> |
| | | <img w-full :src="dialogImageUrl" alt="Preview Image" /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | RFIDForm: { |
| | | rfid: string; |
| | | rfidName: string; |
| | | rfidImage: string; |
| | | rfidImage: string | null; |
| | | }; |
| | | title: string; |
| | | dialogVisible: Boolean; |
| | | dialogImageUrl: string | null; |
| | | RFIDFormRules: {}; |
| | | uploadUrl: string; |
| | | fileList: []; |
| | | fileList: Array<file>; |
| | | } |
| | | interface levelListState {} |
| | | interface file { |
| | | url: string; |
| | | } |
| | | import { reactive, toRefs, ref } from 'vue'; |
| | | import { RFIDApi } from '/@/api/intellectInspectSystem/RFID'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus'; |
| | |
| | | RFIDForm: { |
| | | rfid: '', |
| | | rfidName: '', |
| | | rfidImage: '' |
| | | rfidImage: null |
| | | }, |
| | | uploadUrl: '', |
| | | |
| | | dialogVisible: false, |
| | | dialogImageUrl: null, |
| | | RFIDFormRules: { |
| | | rfid: [{ required: true, message: '请填写RFID编码', trigger: 'blur' }], |
| | | rfidName: [{ required: true, message: '请填写RFID名称', trigger: 'change' }], |
| | |
| | | rfidName: '', |
| | | rfidImage: '' |
| | | }; |
| | | state.fileList = []; |
| | | } else { |
| | | state.title = '修改RFID'; |
| | | state.fileList = []; |
| | | state.RFIDForm = JSON.parse(JSON.stringify(value)); |
| | | if (state.RFIDForm.rfidImage === null) return; |
| | | state.fileList = [{ url: state.RFIDForm.rfidImage }]; |
| | | } |
| | | }; |
| | | |
| | | // // 图片上传 |
| | | // const fileList = ref<UploadUserFile[]>([]); |
| | | |
| | | const handleRemove: UploadProps['onRemove'] = (file, uploadFiles) => { |
| | | console.log(file, uploadFiles); |
| | | }; |
| | | // |
| | | // const handleRemove = () => { |
| | | // ElMessageBox.confirm(`此操作将永久删除该图片,是否继续?`, '提示', { |
| | | // confirmButtonText: '确认', |
| | | // cancelButtonText: '取消', |
| | | // type: 'warning' |
| | | // }) |
| | | // .then(() => { |
| | | // state.RFIDForm.rfidImage = null; |
| | | // state.fileList = []; |
| | | // }) |
| | | // .catch(() => {}); |
| | | // }; |
| | | |
| | | const handlePreview: UploadProps['onPreview'] = (uploadFile) => { |
| | | console.log(uploadFile); |
| | | }; |
| | | |
| | | const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { |
| | | ElMessage.warning(`您选择的图片数量超出要求`); |
| | | }; |
| | | const getUploadUrl = async (rawFile: any) => { |
| | | const res = await RFIDApi().getUploadUrl(rawFile.name); |
| | | state.RFIDForm.rfidImage = res.data.rfidImage; |
| | |
| | | }; |
| | | |
| | | const upload = async (params: any) => { |
| | | debugger; |
| | | // const formData = new FormData(); |
| | | // formData.append('file', state.fileList[0].raw); |
| | | let reader = new FileReader(); |
| | |
| | | .put(state.uploadUrl, reader.result, { |
| | | header: { 'Content-Type': 'multipart/form-data' } |
| | | }) |
| | | .then(() => {}); |
| | | .then(() => { |
| | | if (state.fileList.length === 2) { |
| | | state.fileList.splice(0, 1); |
| | | } |
| | | }); |
| | | // let res = await RFIDApi().uploadFile(state.uploadUrl, reader.result); |
| | | // if (res.data.code === '200') { |
| | | // } else { |
| | |
| | | }; |
| | | }; |
| | | |
| | | const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { |
| | | return ElMessageBox.confirm(`Cancel the transfert of ${uploadFile.name} ?`).then( |
| | | () => true, |
| | | () => false |
| | | ); |
| | | const beforeRemove = (file: {}, fileList: []) => { |
| | | const result = new Promise((resolve, reject) => { |
| | | ElMessageBox.confirm('此操作将删除该图片, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(() => { |
| | | state.RFIDForm.rfidImage = null; |
| | | state.fileList = []; |
| | | // 请求删除接口 |
| | | }) |
| | | .catch(() => { |
| | | reject(false); |
| | | }); |
| | | }); |
| | | return result; |
| | | }; |
| | | |
| | | //新增修改提交 |
| | |
| | | }); |
| | | }; |
| | | |
| | | const handlePictureCardPreview = (uploadFile: { url: string }) => { |
| | | state.dialogImageUrl = uploadFile.url!; |
| | | state.dialogVisible = true; |
| | | }; |
| | | |
| | | return { |
| | | ...toRefs(state), |
| | | RFIDFormRef, |
| | | // fileList, |
| | | upload, |
| | | getUploadUrl, |
| | | handleRemove, |
| | | handlePreview, |
| | | handleExceed, |
| | | beforeRemove, |
| | | submitRFID, |
| | | openRFIDDialog |
| | | openRFIDDialog, |
| | | handlePictureCardPreview |
| | | }; |
| | | } |
| | | }; |
| | |
| | | <template> |
| | | <el-dialog v-model="approveItemDialog" :title="title"> |
| | | <el-dialog v-model="approveItemDialog" :title="title" :close-on-click-modal="false"> |
| | | <el-form :model="approveItemForm" label-width="150px" ref="approveItemFormRef" :rules="approveItemFormRule"> |
| | | <el-col :span="24" style="margin-bottom: 24px"> |
| | | <el-form-item label="审批项名称" prop="itemName"> |
| | |
| | | </el-col> |
| | | <el-col :span="24" style="margin-bottom: 24px"> |
| | | <el-form-item label="审批项类型" prop="type"> |
| | | <el-select v-model="approveItemForm.type" placeholder="请选择审批项类型" class="input-add"> |
| | | <el-select v-model="approveItemForm.type" @change="clearValue" placeholder="请选择审批项类型" class="input-add" clearable filterable> |
| | | <el-option v-for="item in typeList" :key="item.id" :value="item.id" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" style="margin-bottom: 24px"> |
| | | <!-- <el-col :span="24" style="margin-bottom: 24px">--> |
| | | <!-- <el-form-item label="措施或标准" prop="smType">--> |
| | | <!-- <el-select v-model="approveItemForm.smType" @change="clearValue" placeholder="请选择措施或标准" class="input-add" clearable filterable>--> |
| | | <!-- <el-option v-for="item in smTypeList" :key="item.id" :value="item.id" :label="item.name"></el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col v-if="approveItemForm.type === 2 || approveItemForm.type === 3" :span="24" style="margin-bottom: 24px"> |
| | | <el-form-item label="措施名称" prop="measureId"> |
| | | <el-select v-model="approveItemForm.measureId" placeholder="请选择措施" class="input-add"> |
| | | <el-select v-model="approveItemForm.measureId" placeholder="请选择措施" class="input-add" clearable filterable> |
| | | <el-option v-for="item in actionList" :key="item.id" :value="item.id" :label="item.context"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" style="margin-bottom: 20px"> |
| | | <el-col v-if="approveItemForm.type === 1" :span="24" style="margin-bottom: 20px"> |
| | | <el-form-item label="标准名称" prop="standId"> |
| | | <el-select v-model="approveItemForm.standId" class="input-add" placeholder="选择标准"> |
| | | <el-select v-model="approveItemForm.standId" class="input-add" placeholder="选择标准" clearable filterable> |
| | | <el-option v-for="item in standardList" :key="item.ruleStandId" :value="item.ruleStandId" :label="item.title"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, ref, onMounted } from 'vue'; |
| | | import { reactive, toRefs, ref, onMounted, nextTick } from 'vue'; |
| | | import { ElMessage } from 'element-plus/es'; |
| | | import { userApi } from '/@/api/systemManage/user'; |
| | | import { safetyActionApi } from '/@/api/specialWorkSystem/safetyAction'; |
| | |
| | | title: string; |
| | | activeName: string; |
| | | approveItemDialog: boolean; |
| | | approveItemForm: stepAddReqDTO; |
| | | approveItemForm: step; |
| | | approveItemFormRule: {}; |
| | | actionList: Array<type>; |
| | | typeList: Array<type>; |
| | | smTypeList: Array<type>; |
| | | standardList: []; |
| | | order: ''; |
| | | order: number | null; |
| | | } |
| | | interface stepAddReqDTO { |
| | | interface step { |
| | | itemName: string | null; |
| | | type: null; |
| | | measureId: number | null; |
| | | standId: number | null; |
| | | smType: number | null; |
| | | } |
| | | interface type { |
| | | id: number; |
| | |
| | | itemName: null, |
| | | type: null, |
| | | measureId: null, |
| | | smType: 1, |
| | | standId: null |
| | | }, |
| | | approveItemFormRule: {}, |
| | | approveItemFormRule: { |
| | | itemName: [{ required: true, message: '请填写审批项名称', trigger: 'blur' }], |
| | | type: [{ required: true, message: '请选择审批项类型', trigger: 'change' }], |
| | | measureId: [{ required: true, message: '请选择措施', trigger: 'change' }], |
| | | smType: [{ required: true, message: '请选择措施或标准', trigger: 'change' }], |
| | | standId: [{ required: true, message: '请选择标准', trigger: 'change' }] |
| | | }, |
| | | actionList: [], |
| | | typeList: [ |
| | | { id: 1, name: '数值' }, |
| | | { id: 2, name: '选项' }, |
| | | { id: 3, name: '填空' } |
| | | typeList: [], |
| | | smTypeList: [ |
| | | { id: 1, name: '标准' }, |
| | | { id: 2, name: '措施' } |
| | | ], |
| | | standardList: [], |
| | | order: null |
| | | }); |
| | | |
| | | const showApproveItemDialog = (type: string, value: {}, index: number) => { |
| | | const showApproveItemDialog = (type: string, value: {}, index: number, approveLevelForm: { type: number }, standardList: [], actionList: []) => { |
| | | data.approveItemDialog = true; |
| | | data.standardList = standardList; |
| | | data.actionList = actionList; |
| | | data.order = index; |
| | | if (approveLevelForm.type === 3) { |
| | | data.typeList = [ |
| | | { id: 1, name: '数值' }, |
| | | { id: 2, name: '选项' }, |
| | | { id: 3, name: '填空' } |
| | | ]; |
| | | } else { |
| | | data.typeList = [ |
| | | { id: 2, name: '选项' }, |
| | | { id: 3, name: '填空' } |
| | | ]; |
| | | } |
| | | nextTick(() => { |
| | | approveItemFormRef.value.clearValidate(); |
| | | }); |
| | | if (type === '新增') { |
| | | data.title = '新增审批项'; |
| | | data.approveItemForm = { |
| | | itemName: null, |
| | | type: null, |
| | | measureId: null, |
| | | standId: null |
| | | standId: null, |
| | | smType: 1 |
| | | }; |
| | | } else { |
| | | data.title = '修改审批项'; |
| | |
| | | }; |
| | | |
| | | const submitApproveItem = async () => { |
| | | context.emit('addApprovalItem', data.approveItemForm, data.title, data.order); |
| | | data.approveItemDialog = false; |
| | | approveItemFormRef.value.validate((valid: Boolean) => { |
| | | if (valid) { |
| | | data.approveItemForm.smType = 1; |
| | | context.emit('addApprovalItem', data.approveItemForm, data.title, data.order); |
| | | data.approveItemDialog = false; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '请完善审批项基本信息' |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | //获取措施项 |
| | | const getActionData = async () => { |
| | | let res = await safetyActionApi().getAllSafetyActionList({ workType: null, type: null, context: null }); |
| | | if (res.data.code === '200') { |
| | | data.actionList = res.data.data; |
| | | const clearValue = () => { |
| | | if (data.approveItemForm.type === 1) { |
| | | data.approveItemForm.measureId = null; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | data.approveItemForm.standId = null; |
| | | } |
| | | }; |
| | | |
| | | //获取标准 |
| | | const getStandardData = async () => { |
| | | let res = await approveBasicApi().getAllApproveBasicList({ ruleStandType: null, title: null }); |
| | | if (res.data.code === '200') { |
| | | data.standardList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getActionData(); |
| | | getStandardData(); |
| | | }); |
| | | return { |
| | | ...toRefs(data), |
| | | clearValue, |
| | | approveItemFormRef, |
| | | submitApproveItem, |
| | | showApproveItemDialog |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" style="margin-bottom: 24px"> |
| | | <el-form-item label="审批层级" prop="depId"> |
| | | <el-form-item label="审批层级" prop="type"> |
| | | <el-select v-model="approveLevelForm.type" placeholder="请选择审批层级" class="input-add"> |
| | | <el-option v-for="item in typeList" :key="item.id" :value="item.id" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" style="margin-bottom: 24px"> |
| | | <el-form-item label="审批人" prop="unitAddReqDTOList"> |
| | | <el-select v-model="approveLevelForm.unitAddReqDTOList" multiple placeholder="请选择审批人" class="input-add"> |
| | | <el-form-item label="审批人" prop="unitList"> |
| | | <el-select v-model="approveLevelForm.unitList" multiple placeholder="请选择审批人" class="input-add"> |
| | | <el-option v-for="item in userList" :key="item.uid" :value="item.uid" :label="item.realName"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" style="margin-bottom: 20px"> |
| | | <el-form-item label="审批有效时间" prop="continueTime"> |
| | | <el-input v-model="approveLevelForm.continueTime" placeholder="请输入审批有效时间" class="input-add"> |
| | | <el-input type="number" v-model="approveLevelForm.continueTime" placeholder="请输入审批有效时间" class="input-add"> |
| | | <template #prepend> |
| | | <el-select v-model="approveLevelForm.continueTimeUnit" placeholder="选择单位"> |
| | | <el-option v-for="item in timeList" :key="item.id" :value="item.id" :label="item.name"></el-option> |
| | |
| | | <el-tabs class="active" v-model="activeName"> |
| | | <el-tab-pane label="审批流程息" name="ApproveAction"> |
| | | <div class="filter-container"> |
| | | <el-button size="default" type="success" @click="openApproveActionDialog('新增', '', 0)"> |
| | | <el-button size="default" type="primary" @click="openApproveActionDialog('新增', '', 0)"> |
| | | <el-icon> |
| | | <ele-FolderAdd /> |
| | | </el-icon> |
| | | 新增审批流程 |
| | | 新增审批项 |
| | | </el-button> |
| | | </div> |
| | | |
| | | <el-table ref="table" :data="approveLevelForm.itemAddReqDTOList" style="width: 100%"> |
| | | <el-table ref="table" :data="approveLevelForm.itemList" style="width: 100%"> |
| | | <el-table-column property="itemName" label="审批项名称" show-overflow-tooltip> </el-table-column> |
| | | <el-table-column property="type" label="审批项类型" show-overflow-tooltip> </el-table-column> |
| | | <el-table-column property="measureId" label="措施名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column property="standId" label="标准名称" show-overflow-tooltip> </el-table-column> |
| | | <el-table-column property="type" label="审批项类型" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <span> |
| | | {{ parseNumber(scope.row.type, '审批项类型') }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="measureId" label="措施名称" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <span> |
| | | {{ parseNumber(scope.row.measureId, '措施名称') }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="standId" label="标准名称" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <span> |
| | | {{ parseNumber(scope.row.standId, '标准名称') }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="150" align="center"> |
| | | <template #default="scope"> |
| | | <el-button type="text" size="small" @click="openApproveActionDialog('修改', scope.row, scope.$index)">修改</el-button> |
| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, ref } from 'vue'; |
| | | import { reactive, toRefs, ref, nextTick, onMounted } from 'vue'; |
| | | import approveItemDialog from '/@/views/specialWorkSystem/workFlow/approveRule/components/approveItemDialog.vue'; |
| | | import { ElMessage } from 'element-plus/es'; |
| | | import { safetyActionApi } from '/@/api/specialWorkSystem/safetyAction'; |
| | | import { approveBasicApi } from '/@/api/specialWorkSystem/approveBasic'; |
| | | interface dataState { |
| | | title: string; |
| | | activeName: string; |
| | | approveLevelDialog: boolean; |
| | | approveLevelForm: stepAddReqDTO; |
| | | approveLevelForm: step; |
| | | approveLevelFormRule: {}; |
| | | departmentList: []; |
| | | userList: []; |
| | | timeList: Array<type>; |
| | | typeList: Array<type>; |
| | | workLevelList: []; |
| | | standardList: Array<stand>; |
| | | actionList: Array<action>; |
| | | } |
| | | interface stepAddReqDTO { |
| | | interface action { |
| | | id: number; |
| | | context: string; |
| | | } |
| | | interface stand { |
| | | ruleStandId: number; |
| | | title: string; |
| | | } |
| | | interface step { |
| | | id: number | null; |
| | | stepName: null; |
| | | stepSerial: number | null; |
| | | type: number | null; |
| | | continueTime: number | null; |
| | | continueTimeUnit: number | null; |
| | | unitAddReqDTOList: []; |
| | | itemAddReqDTOList: []; |
| | | unitList: Array<personType>; |
| | | itemList: Array<item>; |
| | | } |
| | | interface personType { |
| | | bindUid: number | {}; |
| | | } |
| | | interface item {} |
| | | interface type { |
| | | id: number; |
| | | name: string; |
| | |
| | | type: null, |
| | | continueTime: null, |
| | | continueTimeUnit: null, |
| | | unitAddReqDTOList: [], |
| | | itemAddReqDTOList: [] |
| | | unitList: [], |
| | | itemList: [] |
| | | }, |
| | | approveLevelFormRule: {}, |
| | | approveLevelFormRule: { |
| | | stepName: [{ required: true, message: '请填写层次名称', trigger: 'blur' }], |
| | | type: [{ required: true, message: '请选择审批层级', trigger: 'change' }], |
| | | unitList: [{ required: true, message: '请选择审批人', trigger: 'change' }], |
| | | continueTime: [{ required: true, message: '请填写有效时间', trigger: 'blur' }] |
| | | }, |
| | | departmentList: [], |
| | | userList: [], |
| | | timeList: [ |
| | |
| | | { id: 2, name: '多人' }, |
| | | { id: 3, name: '分析人' } |
| | | ], |
| | | workLevelList: [] |
| | | workLevelList: [], |
| | | actionList: [], |
| | | standardList: [] |
| | | }); |
| | | |
| | | const showApproveLevelDialog = (type: string, value: {}, userList: []) => { |
| | | data.approveLevelDialog = true; |
| | | data.userList = userList; |
| | | nextTick(() => { |
| | | approveLevelFormRef.value.clearValidate(); |
| | | }); |
| | | if (type === '新增') { |
| | | data.title = '新增审批层级'; |
| | | data.approveLevelForm = { |
| | |
| | | type: null, |
| | | continueTime: null, |
| | | continueTimeUnit: null, |
| | | unitAddReqDTOList: [], |
| | | itemAddReqDTOList: [] |
| | | unitList: [], |
| | | itemList: [] |
| | | }; |
| | | } else { |
| | | data.title = '修改审批层级'; |
| | | data.approveLevelForm = JSON.parse(JSON.stringify(value)); |
| | | data.approveLevelForm.unitList = data.approveLevelForm.unitList.map((item) => { |
| | | return item.bindUid; |
| | | }) as []; |
| | | } |
| | | }; |
| | | |
| | | const openApproveActionDialog = (type: string, value: {}, index: number) => { |
| | | approveItemDialogRef.value.showApproveItemDialog(type, value, index); |
| | | approveLevelFormRef.value.validate((valid: Boolean) => { |
| | | if (valid) { |
| | | approveItemDialogRef.value.showApproveItemDialog(type, value, index, data.approveLevelForm, data.standardList, data.actionList); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '请先完善审批层级信息,才能选择审批项' |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const submitApproveLevel = async () => { |
| | | data.approveLevelForm.unitAddReqDTOList = data.approveLevelForm.unitAddReqDTOList.map((item) => { |
| | | return { |
| | | bindUid: item |
| | | }; |
| | | approveLevelFormRef.value.validate((valid: Boolean) => { |
| | | if (valid) { |
| | | data.approveLevelForm.unitList = data.approveLevelForm.unitList.map((item) => { |
| | | return { bindUid: item }; |
| | | }); |
| | | context.emit('addApprovalLevel', data.approveLevelForm, data.title); |
| | | data.approveLevelDialog = false; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '请完善审批层级基本信息' |
| | | }); |
| | | } |
| | | }); |
| | | context.emit('addApprovalLevel', data.approveLevelForm, data.title); |
| | | data.approveLevelDialog = false; |
| | | }; |
| | | |
| | | const achieveApprovalItem = (value: stepAddReqDTO, title: string, index: number) => { |
| | | const achieveApprovalItem = (value: {}, title: string, index: number) => { |
| | | if (title === '新增审批项') { |
| | | data.approveLevelForm.itemAddReqDTOList.push(value); |
| | | data.approveLevelForm.itemList.push(value); |
| | | } else { |
| | | data.approveLevelForm.itemAddReqDTOList[index] = JSON.parse(JSON.stringify(value)); |
| | | data.approveLevelForm.itemList[index] = JSON.parse(JSON.stringify(value)); |
| | | } |
| | | }; |
| | | |
| | | const deleteApproveItem = async (index: number) => { |
| | | data.approveLevelForm.itemAddReqDTOList.splice(index, 1); |
| | | data.approveLevelForm.itemList.splice(index, 1); |
| | | }; |
| | | |
| | | //获取措施项 |
| | | const getActionData = async () => { |
| | | let res = await safetyActionApi().getAllSafetyActionList({ workType: null, type: null, context: null }); |
| | | if (res.data.code === '200') { |
| | | data.actionList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | //获取标准 |
| | | const getStandardData = async () => { |
| | | let res = await approveBasicApi().getAllApproveBasicList({ ruleStandType: null, title: null }); |
| | | if (res.data.code === '200') { |
| | | data.standardList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const parseNumber = (value: number, type: string) => { |
| | | if (type === '审批项类型') { |
| | | return data.typeList.find((item) => item.id === value)?.name; |
| | | } else if (type === '措施名称') { |
| | | return data.actionList.find((item) => item.id === value)?.context; |
| | | } else { |
| | | return data.standardList.find((item) => item.ruleStandId === value)?.title; |
| | | } |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getActionData(); |
| | | getStandardData(); |
| | | }); |
| | | |
| | | return { |
| | | ...toRefs(data), |
| | | parseNumber, |
| | | approveLevelFormRef, |
| | | approveItemDialogRef, |
| | | deleteApproveItem, |
| | |
| | | <template> |
| | | <div class="system-add-menu-container"> |
| | | <el-dialog v-model="ifShowApproveRuleDialog" :title="title"> |
| | | <el-dialog v-model="ifShowApproveRuleDialog" :title="title" :close-on-click-modal="false"> |
| | | <el-form :model="approveRuleForm" label-width="120px" ref="approveRuleFormRef" :rules="approveRuleFormRules"> |
| | | <el-row> |
| | | <el-col :span="12" style="margin-bottom: 20px"> |
| | | <el-form-item label="任务名称" prop="ruleName"> |
| | | <el-input v-model="approveRuleForm.ruleName" :disabled="!inspectPointConfirm" class="input-add" placeholder="请填写任务名称"> </el-input> |
| | | <el-input v-model="approveRuleForm.ruleName" :disabled="!disabled" class="input-add" placeholder="请填写任务名称"> </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 20px"> |
| | | <el-form-item label="部门名称" prop="depId"> |
| | | <el-cascader :disabled="!inspectPointConfirm" placeholder="请选择部门名称" :options="departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" clearable filterable class="input-add" v-model="approveRuleForm.depId"> </el-cascader> |
| | | <el-cascader :disabled="!disabled" placeholder="请选择部门名称" :options="departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" clearable filterable class="input-add" v-model="approveRuleForm.depId"> </el-cascader> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 20px"> |
| | | <el-form-item label="作业类型" prop="workType"> |
| | | <el-select v-model="approveRuleForm.workType" :disabled="!inspectPointConfirm" placeholder="请选择作业类型" class="input-add"> |
| | | <el-select v-model="approveRuleForm.workType" @change="clearValue" :disabled="!disabled" placeholder="请选择作业类型" class="input-add"> |
| | | <el-option v-for="item in workTypeList" :key="item.id" :value="item.id" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" style="margin-bottom: 20px"> |
| | | <el-col :span="12" style="margin-bottom: 20px" v-if="approveRuleForm.workType === 3 || approveRuleForm.workType === 6 || approveRuleForm.workType === 8 || approveRuleForm.workType === 1"> |
| | | <el-form-item label="作业等级" prop="workLevel"> |
| | | <el-select v-model="approveRuleForm.workLevel" :disabled="!inspectPointConfirm" placeholder="请选择作业等级" class="input-add"> |
| | | <el-option v-for="item in workLevelList" :key="item.id" :value="item.id" :label="item.groupName"></el-option> |
| | | <el-select v-model="approveRuleForm.workLevel" :disabled="!disabled" placeholder="请选择作业等级" class="input-add"> |
| | | <el-option v-for="item in workLevelList" :key="item.id" :value="item.id" :label="item.name"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="24"> |
| | | <el-form-item label="创建审批链"> |
| | | <div style="width: 100%; margin-bottom: 20px" v-show="inspectPointConfirm"> |
| | | <div style="width: 100%; margin-bottom: 20px" v-show="disabled"> |
| | | <el-button type="primary" :icon="Plus" size="default" @click="openApproveLevelDialog('新增', '')">新增巡检点</el-button> |
| | | </div> |
| | | <div style="width: 100%; margin-left: -30px"> |
| | | <div v-for="(item, index) in approveRuleForm.stepAddReqDTOList" class="stepItem"> |
| | | <div v-for="(item, index) in approveRuleForm.stepList" class="stepItem"> |
| | | <div class="stepNum">{{ index + 1 }}</div> |
| | | <div class="stepCard"> |
| | | <el-card class="box-card"> |
| | |
| | | <!-- <div class="text item">--> |
| | | <!-- 所属设备区域:<span>{{ item.regionId }}</span>--> |
| | | <!-- </div>--> |
| | | <div class="text item"> |
| | | 审批类型:<span>{{ item.type }}</span> |
| | | <div class="text item" v-for="i in typeList"> |
| | | <div v-if="i.id === item.type"> |
| | | 审批层级:<span>{{ i.name }}</span> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="text item">--> |
| | | <!-- 关联RFID:<span>{{ item.rfidId }}</span>--> |
| | | <!-- </div>--> |
| | | <div class="text item"> |
| | | 审批人:<span>{{ item.type }}</span> |
| | | 审批人:<span>{{ |
| | | item.unitList |
| | | .map((item) => { |
| | | return userList.find((i) => i.uid === item.bindUid)?.realName; |
| | | }) |
| | | .join('、') |
| | | }}</span> |
| | | </div> |
| | | <!-- <div class="text item">--> |
| | | <!-- 巡检指标:<span>{{ item.quotaId }}</span>--> |
| | | <!-- </div>--> |
| | | <div class="text item"> |
| | | 审批有效时长:<span>{{ item.name }}</span> |
| | | <div class="text item" v-for="i in timeList"> |
| | | <div v-if="i.id === item.continueTimeUnit"> |
| | | 审批有效时长:<span>{{ item.continueTime }}</span> |
| | | <span>{{ i.name }}</span> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="text item">--> |
| | | <!-- 数据填报类型:<span>{{ item.dataReportType }}</span>--> |
| | | <!-- </div>--> |
| | | <div class="text item"> |
| | | 审批项:<span>{{ item.firstReferenceValue ? item.firstReferenceValue : item.secondReferenceValue ? item.secondReferenceValue : item.thirdReferenceValue }}</span> |
| | | 审批项:<span>{{ |
| | | item.itemList |
| | | .map((item) => { |
| | | return item.itemName; |
| | | }) |
| | | .join('、') |
| | | }}</span> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <div v-show="inspectPointConfirm"> |
| | | <div v-show="disabled"> |
| | | <!-- <el-button type="primary" size="default" @click="addFlow(index)">新增下一区域</el-button>--> |
| | | <el-button type="primary" style="margin-left: 12px" size="default" @click="openApproveLevelDialog('修改', item)">修改</el-button> |
| | | <el-button type="danger" size="default" @click="deleteApproveLevel(index, item)">删除</el-button> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div align="right" v-show="inspectPointConfirm"> |
| | | <el-button type="warning" @click="inspectPointDialog = false" size="default" plain>取消</el-button> |
| | | <div align="right" v-show="disabled"> |
| | | <el-button type="warning" @click="ifShowApproveRuleDialog = false" size="default" plain>取消</el-button> |
| | | <el-button type="primary" @click="submitApproveRule()" size="default">确认</el-button> |
| | | </div> |
| | | </el-form> |
| | |
| | | interface dataState { |
| | | title: string; |
| | | pointTitle: string; |
| | | inspectPointConfirm: boolean; |
| | | inspectPointDialog: boolean; |
| | | disabled: boolean; |
| | | ifShowApproveRuleDialog: boolean; |
| | | inspectPointForm: stepAddReqDTO; |
| | | inspectPointForm: step; |
| | | approveRuleForm: { |
| | | id: number | null; |
| | | ruleName: number | null; |
| | | depId: number | null; |
| | | workType: number | null; |
| | | workLevel: number | null; |
| | | stepAddReqDTOList: Array<stepAddReqDTO>; |
| | | stepList: Array<step>; |
| | | }; |
| | | approveRuleFormRules: {}; |
| | | departmentList: []; |
| | | userList: []; |
| | | workTypeList: []; |
| | | workLevelList: []; |
| | | workTypeList: Array<type>; |
| | | timeList: Array<type>; |
| | | typeList: Array<type>; |
| | | workLevelList: Array<type>; |
| | | } |
| | | |
| | | interface quota { |
| | | interface type { |
| | | id: number; |
| | | type: string; |
| | | unit: string; |
| | | name: string; |
| | | } |
| | | interface stepAddReqDTO { |
| | | interface step { |
| | | id: number | null; |
| | | stepName: null; |
| | | stepSerial: number | null; |
| | | type: number | null; |
| | | continueTime: number | null; |
| | | continueTimeUnit: number | null; |
| | | unitAddReqDTOList: []; |
| | | itemAddReqDTOList: []; |
| | | unitList: []; |
| | | itemList: []; |
| | | } |
| | | export default { |
| | | name: 'approveRuleDialog', |
| | |
| | | const data = reactive<dataState>({ |
| | | title: '', |
| | | pointTitle: '', |
| | | inspectPointConfirm: true, |
| | | inspectPointDialog: false, |
| | | disabled: true, |
| | | ifShowApproveRuleDialog: false, |
| | | inspectPointForm: { |
| | | id: null, |
| | |
| | | type: null, |
| | | continueTime: null, |
| | | continueTimeUnit: null, |
| | | unitAddReqDTOList: [], |
| | | itemAddReqDTOList: [] |
| | | unitList: [], |
| | | itemList: [] |
| | | }, |
| | | approveRuleForm: { |
| | | id: null, |
| | |
| | | depId: null, |
| | | workType: null, |
| | | workLevel: null, |
| | | stepAddReqDTOList: [] |
| | | stepList: [] |
| | | }, |
| | | approveRuleFormRules: { |
| | | unitName: [{ required: true, message: '请填写巡检任务单元名称', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '请选择巡检任务类型', trigger: 'change' }], |
| | | execClassgroupId: [{ required: true, message: '请选择巡检班组', trigger: 'change' }], |
| | | execDepId: [{ required: true, message: '请选择巡检部门', trigger: 'blur' }], |
| | | checkCycle: [{ required: true, message: '请填写巡检周期', trigger: 'blur' }], |
| | | noticeTime: [{ required: true, message: '请填写提前通知时间', trigger: 'blur' }], |
| | | validTime: [{ required: true, message: '请填写有效时间', trigger: 'blur' }], |
| | | firstStartTime: [{ required: true, message: '请选择周期开始时间', trigger: 'change' }] |
| | | ruleName: [{ required: true, message: '请填写规则名称', trigger: 'blur' }], |
| | | depId: [{ required: true, message: '请选择部门', trigger: 'change' }], |
| | | workLevel: [{ required: true, message: '请选择作业等级', trigger: 'change' }], |
| | | workType: [{ required: true, message: '请选择作业类型', trigger: 'cahnge' }] |
| | | }, |
| | | departmentList: [], |
| | | userList: [], |
| | | workTypeList: [], |
| | | typeList: [ |
| | | { id: 1, name: '单人' }, |
| | | { id: 2, name: '多人' }, |
| | | { id: 3, name: '分析人' } |
| | | ], |
| | | timeList: [ |
| | | { id: 1, name: '日' }, |
| | | { id: 2, name: '时' }, |
| | | { id: 3, name: '分' } |
| | | ], |
| | | workTypeList: [ |
| | | { id: 1, name: '动火作业' }, |
| | | { id: 2, name: '受限空间作业' }, |
| | | { id: 3, name: '吊装作业' }, |
| | | { id: 4, name: '动土作业' }, |
| | | { id: 5, name: '断路作业' }, |
| | | { id: 6, name: '高处作业' }, |
| | | { id: 7, name: '临时用电作业' }, |
| | | { id: 8, name: '盲板抽堵作业' } |
| | | ], |
| | | workLevelList: [] |
| | | }); |
| | | |
| | |
| | | approveLevelDialogRef.value.showApproveLevelDialog(type, value, data.userList); |
| | | }; |
| | | |
| | | const achieveApprovalLevel = (value: stepAddReqDTO, title: string) => { |
| | | debugger; |
| | | const achieveApprovalLevel = (value: step, title: string) => { |
| | | if (title === '新增审批层级') { |
| | | if (data.approveRuleForm.stepAddReqDTOList.length === 0) { |
| | | if (data.approveRuleForm.stepList.length === 0) { |
| | | value.stepSerial = 1; |
| | | data.approveRuleForm.stepAddReqDTOList.push(value); |
| | | data.approveRuleForm.stepList.push(value); |
| | | } else { |
| | | value.stepSerial = data.approveRuleForm.stepAddReqDTOList[data.approveRuleForm.stepAddReqDTOList.length - 1].stepSerial + 1; |
| | | data.approveRuleForm.stepAddReqDTOList.push(value); |
| | | value.stepSerial = (data.approveRuleForm.stepList[data.approveRuleForm.stepList.length - 1]?.stepSerial as number) + 1; |
| | | data.approveRuleForm.stepList.push(value); |
| | | } |
| | | } else { |
| | | let result = data.approveRuleForm.stepAddReqDTOList.findIndex((item) => item.stepSerial === value.stepSerial); |
| | | data.approveRuleForm.stepAddReqDTOList[result] = JSON.parse(JSON.stringify(value)); |
| | | let result = data.approveRuleForm.stepList.findIndex((item) => item.stepSerial === value.stepSerial); |
| | | data.approveRuleForm.stepList[result] = JSON.parse(JSON.stringify(value)); |
| | | } |
| | | }; |
| | | |
| | | const showApproveRuleDialog = (type: string, value: {}, departmentList: [], userList: [], workTypeList: []) => { |
| | | const showApproveRuleDialog = (type: string, value: { workType: number }, departmentList: [], userList: [], workTypeList: []) => { |
| | | data.ifShowApproveRuleDialog = true; |
| | | data.userList = userList; |
| | | data.workTypeList = workTypeList; |
| | | data.departmentList = departmentList; |
| | | if (type === '新增') { |
| | | data.disabled = true; |
| | | data.title = '新增审批规则'; |
| | | data.approveRuleForm = { |
| | | id: null, |
| | |
| | | depId: null, |
| | | workType: null, |
| | | workLevel: null, |
| | | stepAddReqDTOList: [] |
| | | stepList: [] |
| | | }; |
| | | } else { |
| | | } else if (type === '修改') { |
| | | data.disabled = true; |
| | | data.title = '修改审批规则'; |
| | | data.approveRuleForm = JSON.parse(JSON.stringify(value)); |
| | | setValue(value.workType); |
| | | } else { |
| | | data.disabled = false; |
| | | data.title = '查看审批规则'; |
| | | setValue(value.workType); |
| | | data.approveRuleForm = JSON.parse(JSON.stringify(value)); |
| | | } |
| | | }; |
| | | |
| | | const deleteApproveLevel = (index: number, item: any) => { |
| | | data.approveRuleForm.stepAddReqDTOList.splice(index, 1); |
| | | data.approveRuleForm.stepList.splice(index, 1); |
| | | }; |
| | | |
| | | const clearValue = () => { |
| | | if (data.approveRuleForm.workType === 1) { |
| | | data.approveRuleForm.workLevel = null; |
| | | data.workLevelList = [ |
| | | { id: 1, name: '一级动火作业' }, |
| | | { id: 2, name: '二级动火作业' }, |
| | | { id: 3, name: '三级动火作业' } |
| | | ]; |
| | | } else if (data.approveRuleForm.workType === 3) { |
| | | data.approveRuleForm.workLevel = null; |
| | | data.workLevelList = [ |
| | | { id: 8, name: '一级吊装作业' }, |
| | | { id: 9, name: '二级吊装作业' }, |
| | | { id: 10, name: '三级吊装作业' } |
| | | ]; |
| | | } else if (data.approveRuleForm.workType === 6) { |
| | | data.approveRuleForm.workLevel = null; |
| | | data.workLevelList = [ |
| | | { id: 4, name: '一级高处作业' }, |
| | | { id: 5, name: '二级高处作业' }, |
| | | { id: 6, name: '三级高处作业' }, |
| | | { id: 7, name: '四级高处作业' } |
| | | ]; |
| | | } else if (data.approveRuleForm.workType === 8) { |
| | | data.approveRuleForm.workLevel = null; |
| | | data.workLevelList = [ |
| | | { id: 11, name: '抽盲板作业' }, |
| | | { id: 12, name: '堵盲板作业' } |
| | | ]; |
| | | } else { |
| | | data.approveRuleForm.workLevel = null; |
| | | data.workLevelList = []; |
| | | } |
| | | }; |
| | | |
| | | const setValue = (workType: number) => { |
| | | if (workType === 1) { |
| | | data.workLevelList = [ |
| | | { id: 1, name: '一级动火作业' }, |
| | | { id: 2, name: '二级动火作业' }, |
| | | { id: 3, name: '三级动火作业' } |
| | | ]; |
| | | } else if (workType === 3) { |
| | | data.workLevelList = [ |
| | | { id: 8, name: '一级吊装作业' }, |
| | | { id: 9, name: '二级吊装作业' }, |
| | | { id: 10, name: '三级吊装作业' } |
| | | ]; |
| | | } else if (workType === 6) { |
| | | data.workLevelList = [ |
| | | { id: 4, name: '一级高处作业' }, |
| | | { id: 5, name: '二级高处作业' }, |
| | | { id: 6, name: '三级高处作业' }, |
| | | { id: 7, name: '四级高处作业' } |
| | | ]; |
| | | } else if (workType === 8) { |
| | | data.workLevelList = [ |
| | | { id: 11, name: '抽盲板作业' }, |
| | | { id: 12, name: '堵盲板作业' } |
| | | ]; |
| | | } else { |
| | | data.workLevelList = []; |
| | | } |
| | | }; |
| | | |
| | | const parseNumber = (type: string, value: number) => { |
| | | if (type === '时间单位') { |
| | | debugger; |
| | | return data.timeList.find((item) => item.id === value)?.name; |
| | | } |
| | | }; |
| | | |
| | | const submitApproveRule = () => { |
| | |
| | | |
| | | return { |
| | | ...toRefs(data), |
| | | clearValue, |
| | | parseNumber, |
| | | approveLevelDialog, |
| | | approveRuleFormRef, |
| | | approveLevelDialogRef, |
| | |
| | | <div style="height: 100%"> |
| | | <el-row class="homeCard"> |
| | | <div class="basic-line"> |
| | | <span>任务类型:</span> |
| | | <el-select v-model="tableData.params.workType" clearable filterable class="input-box" placeholder="任务类型"> |
| | | <span>规则名称:</span> |
| | | <el-select v-model="tableData.params.searchParams.ruleName" clearable filterable class="input-box" placeholder="任务类型"> |
| | | <el-option v-for="item in workTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic-line"> |
| | | <span>任务类型:</span> |
| | | <el-select v-model="tableData.params.workType" clearable filterable class="input-box" placeholder="任务类型"> |
| | | <span>部门:</span> |
| | | <el-cascader placeholder="部门名称" :options="departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" clearable filterable class="input-box" v-model="tableData.params.searchParams.depId"> </el-cascader> |
| | | </div> |
| | | <div class="basic-line"> |
| | | <span>作业类型:</span> |
| | | <el-select v-model="tableData.params.searchParams.workType" clearable filterable class="input-box" placeholder="作业类型"> |
| | | <el-option v-for="item in workTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic-line"> |
| | | <span>任务类型:</span> |
| | | <el-select v-model="tableData.params.workType" clearable filterable class="input-box" placeholder="任务类型"> |
| | | <el-option v-for="item in workTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="basic-line"> |
| | | <span>任务类型:</span> |
| | | <el-select v-model="tableData.params.workType" clearable filterable class="input-box" placeholder="任务类型"> |
| | | <el-option v-for="item in workTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | <span>作业等级:</span> |
| | | <el-select v-model="tableData.params.searchParams.workLevel" clearable filterable class="input-box" placeholder="作业等级"> |
| | | <el-option v-for="item in workLevelList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div style="padding-bottom: 10px"> |
| | |
| | | </el-col> |
| | | <el-button type="primary" :icon="Refresh" size="default" /> |
| | | </el-row> |
| | | <el-table ref="multipleTableRef" :data="tableData.ApproveRuleData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }" @selection-change="handleSelectionChange"> |
| | | <el-table ref="multipleTableRef" :data="tableData.approveRuleData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column property="unitName" label="任务名称" /> |
| | | <el-table-column property="workType" label="任务类型"> |
| | | <el-table-column property="ruleName" label="任务名称" /> |
| | | <el-table-column property="workType" label="作业类型"> |
| | | <template #default="scope"> |
| | | <span> |
| | | {{ parseNumber(scope.row.workType, '任务类型') }} |
| | | {{ parseNumber(scope.row.workType, '作业类型') }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="execClassgroupId" label="巡检班组"> |
| | | <el-table-column property="workLevel" label="作业等级"> |
| | | <template #default="scope"> |
| | | <span> |
| | | {{ parseNumber(scope.row.execClassgroupId, '巡检班组') }} |
| | | {{ parseNumber(scope.row.workLevel, '作业等级') }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="frequency" label="检查频次"> |
| | | <template #default="scope"> |
| | | <span> |
| | | {{ scope.row.checkCycle }} |
| | | </span> |
| | | <span> |
| | | {{ scope.row.checkCycleUnit }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="firstStartTime" label="任务开始时间" /> |
| | | <el-table-column prop="createUserName" label="创建人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createUname" label="创建人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column property="status" label="状态" width="60" /> |
| | | <el-table-column prop="modifiedUname" label="最后修改人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gmtModified" label="最后修改时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column fixed="right" label="操作" align="center" width="300"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="View" @click="openApproveRuleDialog('查看', scope.row)">查看</el-button> |
| | |
| | | workTypeList: Array<type>; |
| | | departmentList: []; |
| | | userList: []; |
| | | workLevelList: Array<type>; |
| | | deleteList: { ids: Array<deleteType> }; |
| | | timeType: Array<type>; |
| | | } |
| | | interface deleteType { |
| | | ruleId: number; |
| | | } |
| | | |
| | | interface type { |
| | | id: number; |
| | | name: string; |
| | |
| | | { id: 7, name: '临时用电作业' }, |
| | | { id: 8, name: '盲板抽堵作业' } |
| | | ], |
| | | workLevelList: [ |
| | | { id: 1, name: '一级动火作业' }, |
| | | { id: 2, name: '二级动火作业' }, |
| | | { id: 3, name: '三级动火作业' }, |
| | | { id: 4, name: '一级高处作业' }, |
| | | { id: 5, name: '二级高处作业' }, |
| | | { id: 6, name: '三级高处作业' }, |
| | | { id: 7, name: '四级高处作业' }, |
| | | { id: 8, name: '一级吊装作业' }, |
| | | { id: 9, name: '二级吊装作业' }, |
| | | { id: 10, name: '三级吊装作业' }, |
| | | { id: 11, name: '抽盲板作业' }, |
| | | { id: 12, name: '堵盲板作业' } |
| | | ], |
| | | departmentList: [], |
| | | userList: [], |
| | | deleteList: { ids: [] }, |
| | | timeType: [ |
| | | { id: 1, name: '分' }, |
| | | { id: 2, name: '小时' }, |
| | |
| | | const getApproveRule = async () => { |
| | | let res = await approveRuleApi().getApproveRuleList(state.tableData.params); |
| | | if (res.data.code === '200') { |
| | | state.tableData.approveRuleData = res.data.data.records; |
| | | state.tableData.total = res.data.data.total; |
| | | state.tableData.approveRuleData = res.data.data; |
| | | state.tableData.total = res.data.total; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | let res = await approveRuleApi().deleteApproveRule({ id: row.id }); |
| | | let res = await approveRuleApi().deleteApproveRule(state.deleteList); |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | |
| | | }; |
| | | |
| | | const parseNumber = (value: number, type: string) => { |
| | | if (type === '任务类型') { |
| | | if (type === '作业类型') { |
| | | return state.workTypeList.find((item) => item.id === value)?.name; |
| | | } else if (type === '检查频次') { |
| | | return state.timeType.find((item) => item.id == value)?.name; |
| | | } else if (type === '作业等级') { |
| | | return state.workLevelList.find((item) => item.id == value)?.name; |
| | | } else { |
| | | } |
| | | }; |
| | | |
| | | const handleSelectionChange = (val: Array<deleteType>) => { |
| | | state.deleteList.ids = val.map((item) => { |
| | | return item.ruleId; |
| | | }) as []; |
| | | }; |
| | | |
| | | // 分页改变 |
| | |
| | | parseNumber, |
| | | deleteApproveRule, |
| | | getApproveRule, |
| | | handleSelectionChange, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | approveRuleDialogRef, |