| | |
| | | # 本地环境 |
| | | 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.29:8008' |
| | | VITE_API_URL = 'http://192.168.0.38:8008' |
| | | #黄振接口地址 |
| | | |
| | | #VITE_API_URL = 'http://192.168.0.179:8008' |
对比新文件 |
| | |
| | | Index: src/views/intellectInspect/inspectTaskManage/inspectTask/index.vue |
| | | IDEA additional info: |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP |
| | | <+><template>\r\n <div class=\"home-container\">\r\n <div style=\"height: 100%\">\r\n <el-row class=\"homeCard\">\r\n <div class=\"basic-line\">\r\n <span>任务类型:</span>\r\n <el-select v-model=\"tableData.params.workType\" clearable filterable class=\"input-box\" placeholder=\"任务类型\">\r\n <el-option v-for=\"item in workTypeList\" :key=\"item.id\" :label=\"item.name\" :value=\"item.id\"></el-option>\r\n </el-select>\r\n </div>\r\n <div class=\"basic-line\">\r\n <span>执行班组:</span>\r\n <el-select v-model=\"tableData.params.execClassgroupId\" clearable filterable class=\"input-box\" placeholder=\"执行班组\">\r\n <el-option v-for=\"item in classGroupList\" :key=\"item.id\" :label=\"item.groupName\" :value=\"item.id\"></el-option>\r\n </el-select>\r\n </div>\r\n <div style=\"padding-bottom: 10px\">\r\n <el-button type=\"primary\" @click=\"getInspectionTask\">查询</el-button>\r\n <el-button plain @click=\"reset\">重置</el-button>\r\n </div>\r\n </el-row>\r\n <div class=\"homeCard\">\r\n <div class=\"main-card\">\r\n <el-row class=\"cardTop\">\r\n <el-col :span=\"12\" class=\"mainCardBtn\">\r\n <el-button type=\"primary\" :icon=\"Plus\" size=\"default\" @click=\"openInspectTaskDialog('新增', {})\">新增</el-button>\r\n <!-- <el-button type=\"danger\" :icon=\"Delete\" size=\"default\" plain>删除</el-button>-->\r\n </el-col>\r\n <el-button type=\"primary\" :icon=\"Refresh\" size=\"default\" />\r\n </el-row>\r\n <el-table ref=\"multipleTableRef\" :data=\"tableData.inspectTaskData\" style=\"width: 100%\" height=\"calc(100% - 100px)\" :header-cell-style=\"{ background: '#fafafa' }\" @selection-change=\"handleSelectionChange\">\r\n <el-table-column type=\"selection\" width=\"55\" />\r\n <el-table-column property=\"unitName\" label=\"任务名称\" />\r\n <el-table-column property=\"workType\" label=\"任务类型\">\r\n <template #default=\"scope\">\r\n <span>\r\n {{ parseNumber(scope.row.workType, '任务类型') }}\r\n </span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column property=\"execClassgroupId\" label=\"巡检班组\">\r\n <template #default=\"scope\">\r\n <span>\r\n {{ parseNumber(scope.row.execClassgroupId, '巡检班组') }}\r\n </span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column property=\"frequency\" label=\"检查频次\">\r\n <template #default=\"scope\">\r\n <span>\r\n {{ scope.row.checkCycle }}\r\n </span>\r\n <span>\r\n {{ scope.row.checkCycleUnit }}\r\n </span>\r\n </template>\r\n </el-table-column>\r\n <!-- <el-table-column prop=\"validTime\" label=\"有效时间\" show-overflow-tooltip>-->\r\n <!-- <template #default=\"scope\">-->\r\n <!-- <span>-->\r\n <!-- {{ scope.row.validTime }}-->\r\n <!-- </span>-->\r\n <!-- <span>-->\r\n <!-- {{ parseNumber(scope.row.validTimeUnit, '检查频次') }}-->\r\n <!-- </span>-->\r\n <!-- </template>-->\r\n <!-- </el-table-column>-->\r\n <!-- <el-table-column prop=\"validTime\" label=\"提醒时间\" show-overflow-tooltip>-->\r\n <!-- <template #default=\"scope\">-->\r\n <!-- <span>-->\r\n <!-- {{ scope.row.noticeTime }}-->\r\n <!-- </span>-->\r\n <!-- <span>-->\r\n <!-- {{ parseNumber(scope.row.noticeTimeUnit, '检查频次') }}-->\r\n <!-- </span>-->\r\n <!-- </template>-->\r\n <!-- </el-table-column>-->\r\n <el-table-column property=\"firstStartTime\" label=\"任务开始时间\" />\r\n <el-table-column prop=\"createUserName\" label=\"创建人\" show-overflow-tooltip></el-table-column>\r\n <el-table-column prop=\"gmtCreate\" label=\"创建时间\" show-overflow-tooltip></el-table-column>\r\n <el-table-column prop=\"lastEditUserName\" label=\"最后修改人\" show-overflow-tooltip></el-table-column>\r\n <el-table-column prop=\"gmtModitify\" label=\"最后修改时间\" show-overflow-tooltip></el-table-column>\r\n <el-table-column property=\"taskUnitStatus\" label=\"状态\" width=\"60\">\r\n <template #default=\"scope\">\r\n <div>\r\n <div v-if=\"scope.row.taskUnitStatus === 1\">\r\n <el-tag :type=\"''\">\r\n {{ '开启' }}\r\n </el-tag>\r\n </div>\r\n <div v-if=\"scope.row.taskUnitStatus === 2\">\r\n <el-tag :type=\"'danger'\">\r\n {{ '关闭' }}\r\n </el-tag>\r\n </div>\r\n </div>\r\n </template>\r\n </el-table-column>\r\n <el-table-column fixed=\"right\" label=\"操作\" align=\"center\" width=\"300\">\r\n <template #default=\"scope\">\r\n <el-button link type=\"primary\" size=\"small\" :icon=\"View\" @click=\"openInspectTaskDialog('查看', scope.row)\">查看</el-button>\r\n <el-button link type=\"primary\" size=\"small\" :icon=\"Edit\" @click=\"openInspectTaskDialog('修改', scope.row)\">修改</el-button>\r\n <el-button link type=\"danger\" size=\"small\" :icon=\"Delete\" v-if=\"scope.row.taskUnitStatus === 2\" @click=\"deleteInspectTask(scope.row)\">删除</el-button>\r\n <div @click=\"changeStatus(scope.row)\">\r\n <el-switch v-model=\"scope.row.taskUnitStatus\" inline-prompt active-text=\"开\" inactive-text=\"关\" :active-value=\"1\" :inactive-value=\"2\" style=\"margin: 0 10px\" />\r\n </div>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n <div class=\"pageBtn\">\r\n <el-pagination @size-change=\"onHandleSizeChange\" @current-change=\"onHandleCurrentChange\" :pager-count=\"5\" :page-sizes=\"[10, 20, 30]\" v-model:current-page=\"tableData.params.pageIndex\" background v-model:page-size=\"tableData.params.pageSize\" layout=\"total, sizes, prev, pager, next, jumper\" :total=\"tableData.total\" class=\"page-position\"> </el-pagination>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <inspect-task-dialog ref=\"inspectTaskDialogRef\" @refreshInspectTask=\"getInspectionTask\"></inspect-task-dialog>\r\n </div>\r\n</template>\r\n\r\n<script lang=\"ts\">\r\nimport { toRefs, reactive, ref, onMounted } from 'vue';\r\nimport { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue';\r\nimport { ElTable, ElMessage, ElMessageBox } from 'element-plus';\r\nimport { inspectTaskApi } from '/@/api/intellectInspectSystem/inspectTask';\r\nimport inspectTaskDialog from './components/inspectTaskDialog.vue';\r\nimport { departmentApi } from '/@/api/systemManage/department';\r\nimport { teamManageApi } from '/@/api/systemManage/personShiftManage/teamManage';\r\nimport { inspectPointApi } from '/@/api/intellectInspectSystem/inspectPointManage';\r\nimport { facilityAreaApi } from '/@/api/intellectInspectSystem/facilityAreaManage';\r\nimport { RFIDApi } from '/@/api/intellectInspectSystem/RFID';\r\nlet global: any = {\r\n homeChartOne: null,\r\n homeChartTwo: null,\r\n homeCharThree: null,\r\n dispose: [null, '', undefined]\r\n};\r\n\r\ninterface stateType {\r\n tableData: {\r\n inspectTaskData: [];\r\n total: number;\r\n loading: boolean;\r\n params: {\r\n pageIndex: number | null;\r\n pageSize: number | null;\r\n unitName: string | null;\r\n workType: number | null;\r\n createUserId: number | null;\r\n execClassgroupId: number | null;\r\n checkCycle: number | null;\r\n checkCycleUnit: number | null;\r\n };\r\n };\r\n workTypeList: Array<type>;\r\n quotaList: [];\r\n departmentList: [];\r\n classGroupList: Array<classGroup>;\r\n inspectPointAllList: [];\r\n regionNameList: [];\r\n RFIDList: [];\r\n timeType: Array<type>;\r\n}\r\ninterface type {\r\n id: number;\r\n name: string;\r\n}\r\ninterface classGroup {\r\n id: number;\r\n groupName: string;\r\n}\r\nexport default {\r\n name: 'index',\r\n components: { inspectTaskDialog },\r\n setup() {\r\n const inspectTaskDialogRef = ref();\r\n const state = reactive<stateType>({\r\n tableData: {\r\n inspectTaskData: [],\r\n total: 0,\r\n loading: false,\r\n params: {\r\n pageIndex: 1,\r\n pageSize: 10,\r\n unitName: null,\r\n workType: null,\r\n createUserId: null,\r\n execClassgroupId: null,\r\n checkCycle: null,\r\n checkCycleUnit: null\r\n }\r\n },\r\n workTypeList: [\r\n { id: 1, name: '周期任务' },\r\n { id: 2, name: '单次任务' }\r\n ],\r\n quotaList: [],\r\n departmentList: [],\r\n classGroupList: [],\r\n inspectPointAllList: [],\r\n regionNameList: [],\r\n RFIDList: [],\r\n timeType: [\r\n { id: 1, name: '分' },\r\n { id: 2, name: '小时' },\r\n { id: 3, name: '日' },\r\n { id: 4, name: '月' },\r\n { id: 5, name: '年' }\r\n ]\r\n });\r\n\r\n //获取巡检任务数据\r\n const getInspectionTask = async () => {\r\n let res = await inspectTaskApi().getInspectTaskList(state.tableData.params);\r\n if (res.data.code === '200') {\r\n state.tableData.inspectTaskData = res.data.data.records;\r\n state.tableData.total = res.data.data.total;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n //获取部门\r\n const getDepartmentData = async () => {\r\n let res = await departmentApi().getDepartmentList();\r\n if (res.data.code === '200') {\r\n state.departmentList = res.data.data;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n //获取部门\r\n const getQuotaList = async () => {\r\n let res = await inspectTaskApi().getQuotaList();\r\n if (res.data.code === '200') {\r\n state.quotaList = res.data.data;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n //获取巡检点\r\n const getInspectTaskPoint = async () => {\r\n let res = await inspectPointApi().getInspectPointAll();\r\n if (res.data.code === '200') {\r\n state.inspectPointAllList = res.data.data;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n //获取所有设施区域名称\r\n const initFacilityAreaType = async () => {\r\n let res = await facilityAreaApi().getAllFacilityAreaList();\r\n if (res.data.code === '200') {\r\n state.regionNameList = JSON.parse(JSON.stringify(res.data.data));\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n //获取所有RFID名称\r\n const initRFIDList = async () => {\r\n let res = await RFIDApi().getAllRFIDList();\r\n if (res.data.code === '200') {\r\n state.RFIDList = JSON.parse(JSON.stringify(res.data.data));\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n //获取班组\r\n const getClassGroupData = async () => {\r\n let res = await teamManageApi().getRecord({ depIp: null, groupName: null, containGroupMemberEnable: null });\r\n if (res.data.code === '200') {\r\n state.classGroupList = res.data.data;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n const changeStatus = async (value: { taskUnitStatus: number; id: number }) => {\r\n if (value.taskUnitStatus === 2) {\r\n ElMessageBox.confirm(`此操作将关闭该巡检任务”,是否继续?`, '提示', {\r\n confirmButtonText: '确认',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n })\r\n .then(async () => {\r\n let res = await inspectTaskApi().openOrCloseInspectTask({ id: value.id, taskUnitStatus: 2 });\r\n if (res.data.code === '200') {\r\n await getInspectionTask();\r\n ElMessage({\r\n type: 'success',\r\n duration: 2000,\r\n message: '关闭成功'\r\n });\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n })\r\n .catch((error) => {});\r\n } else {\r\n ElMessageBox.confirm(`此操作将开启该巡检任务”,是否继续?`, '提示', {\r\n confirmButtonText: '确认',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n })\r\n .then(async () => {\r\n let res = await inspectTaskApi().openOrCloseInspectTask({ id: value.id, taskUnitStatus: 1 });\r\n if (res.data.code === '200') {\r\n await getInspectionTask();\r\n ElMessage({\r\n type: 'success',\r\n duration: 2000,\r\n message: '开启成功'\r\n });\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n })\r\n .catch((error) => {});\r\n }\r\n await getInspectionTask();\r\n };\r\n\r\n // 删除\r\n const deleteInspectTask = (row: any) => {\r\n ElMessageBox.confirm(`此操作将永久删除该任务:“${row.unitName}”,是否继续?`, '提示', {\r\n confirmButtonText: '确认',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n })\r\n .then(async () => {\r\n let res = await inspectTaskApi().deleteInspectTask({ id: row.id });\r\n if (res.data.code === '200') {\r\n ElMessage({\r\n type: 'success',\r\n duration: 2000,\r\n message: '删除成功'\r\n });\r\n await getInspectionTask();\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n })\r\n .catch(() => {});\r\n };\r\n\r\n const openInspectTaskDialog = (type: string, value: {}) => {\r\n inspectTaskDialogRef.value.showInspectTaskDialog(type, value, state.workTypeList, state.departmentList, state.timeType, state.classGroupList, state.quotaList, state.inspectPointAllList, state.regionNameList, state.RFIDList);\r\n };\r\n\r\n const parseNumber = (value: number, type: string) => {\r\n if (type === '任务类型') {\r\n return state.workTypeList.find((item) => item.id === value)?.name;\r\n } else if (type === '检查频次') {\r\n return state.timeType.find((item) => item.id == value)?.name;\r\n } else {\r\n return state.classGroupList.find((item) => item.id == value)?.groupName;\r\n }\r\n };\r\n\r\n // 分页改变\r\n const onHandleSizeChange = (val: number) => {\r\n state.tableData.params.pageSize = val;\r\n getInspectionTask();\r\n };\r\n // 分页改变\r\n const onHandleCurrentChange = (val: number) => {\r\n state.tableData.params.pageIndex = val;\r\n getInspectionTask();\r\n };\r\n\r\n const reset = () => {\r\n state.tableData.params = {\r\n pageIndex: 1,\r\n pageSize: 10,\r\n unitName: null,\r\n workType: null,\r\n createUserId: null,\r\n execClassgroupId: null,\r\n checkCycle: null,\r\n checkCycleUnit: null\r\n };\r\n };\r\n\r\n // 页面加载时\r\n onMounted(() => {\r\n getInspectionTask();\r\n getQuotaList();\r\n getDepartmentData();\r\n getClassGroupData();\r\n getInspectTaskPoint();\r\n initFacilityAreaType();\r\n initRFIDList();\r\n });\r\n\r\n return {\r\n View,\r\n Edit,\r\n Delete,\r\n Refresh,\r\n Plus,\r\n reset,\r\n changeStatus,\r\n parseNumber,\r\n deleteInspectTask,\r\n getInspectionTask,\r\n onHandleSizeChange,\r\n onHandleCurrentChange,\r\n inspectTaskDialogRef,\r\n openInspectTaskDialog,\r\n ...toRefs(state)\r\n };\r\n }\r\n};\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n$homeNavLengh: 8;\r\n.home-container {\r\n height: calc(100vh - 144px);\r\n box-sizing: border-box;\r\n overflow: hidden;\r\n .homeCard {\r\n width: 100%;\r\n padding: 20px;\r\n box-sizing: border-box;\r\n background: #fff;\r\n border-radius: 4px;\r\n\r\n .main-card {\r\n width: 100%;\r\n height: 100%;\r\n .cardTop {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n margin-bottom: 20px;\r\n .mainCardBtn {\r\n margin: 0;\r\n }\r\n }\r\n .pageBtn {\r\n height: 60px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: right;\r\n\r\n .demo-pagination-block + .demo-pagination-block {\r\n margin-top: 10px;\r\n }\r\n .demo-pagination-block .demonstration {\r\n margin-bottom: 16px;\r\n }\r\n }\r\n }\r\n &:last-of-type {\r\n height: calc(100% - 100px);\r\n }\r\n }\r\n .el-row {\r\n display: flex;\r\n align-items: center;\r\n margin-bottom: 20px;\r\n &:last-child {\r\n margin-bottom: 0;\r\n }\r\n .grid-content {\r\n align-items: center;\r\n min-height: 36px;\r\n }\r\n\r\n .topInfo {\r\n display: flex;\r\n align-items: center;\r\n font-size: 16px;\r\n font-weight: bold;\r\n\r\n & > div {\r\n white-space: nowrap;\r\n margin-right: 20px;\r\n }\r\n }\r\n }\r\n}\r\n.stepItem {\r\n width: 100%;\r\n display: flex;\r\n align-items: flex-start;\r\n margin-bottom: 30px;\r\n margin-left: 30px;\r\n padding-bottom: 30px;\r\n border-left: 2px solid #ccc;\r\n &:first-of-type {\r\n margin-top: 30px;\r\n }\r\n &:last-of-type {\r\n margin-bottom: 0;\r\n border-left: none;\r\n }\r\n .stepNum {\r\n width: 30px;\r\n height: 30px;\r\n border-radius: 15px;\r\n box-sizing: border-box;\r\n color: #333;\r\n border: 1px solid #999;\r\n line-height: 28px;\r\n text-align: center;\r\n margin-right: 10px;\r\n margin-left: -16px;\r\n margin-top: -30px;\r\n }\r\n .stepCard {\r\n width: 100%;\r\n margin-top: -30px;\r\n\r\n .box-card {\r\n width: 100%;\r\n &:deep(.el-card__header) {\r\n padding: 10px 15px;\r\n }\r\n .card-header {\r\n width: 100%;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n & > div:first-of-type {\r\n margin-right: 80px;\r\n font-size: 18px;\r\n font-weight: bold;\r\n }\r\n }\r\n }\r\n }\r\n &:hover .card-header {\r\n color: #0098f5;\r\n }\r\n &:hover .stepNum {\r\n border: 2px solid #0098f5;\r\n color: #0098f5;\r\n }\r\n}\r\n.el-input {\r\n width: 100% !important;\r\n}\r\n:deep(.el-date-editor) {\r\n width: 100%;\r\n}\r\n.el-select {\r\n width: 100%;\r\n}\r\n:deep(.el-textarea.is-disabled .el-textarea__inner) {\r\n background-color: var(--el-card-bg-color);\r\n color: var(--el-input-text-color, var(--el-text-color-regular));\r\n}\r\n:deep(.el-input.is-disabled .el-input__inner) {\r\n color: var(--el-input-text-color, var(--el-text-color-regular));\r\n}\r\n:deep(.el-input.is-disabled .el-input__wrapper) {\r\n background-color: var(--el-card-bg-color);\r\n}\r\n</style>\r\n |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| | | <+>UTF-8 |
| | | =================================================================== |
| | | diff --git a/src/views/intellectInspect/inspectTaskManage/inspectTask/index.vue b/src/views/intellectInspect/inspectTaskManage/inspectTask/index.vue |
| | | --- a/src/views/intellectInspect/inspectTaskManage/inspectTask/index.vue (revision 38f0a9145a29f570331f11505968f90bd1c08646) |
| | | +++ b/src/views/intellectInspect/inspectTaskManage/inspectTask/index.vue (date 1678177430360) |
| | | @@ -9,6 +9,13 @@ |
| | | </el-select> |
| | | </div> |
| | | <div class="basic-line"> |
| | | + <span>部门:</span> |
| | | + <el-cascader class="input-box" :options="departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" |
| | | + placeholder="请选择部门" clearable v-model="tableData.params.execDepId" |
| | | + @change="changeGroup" |
| | | + > </el-cascader> |
| | | + </div> |
| | | + <div class="basic-line"> |
| | | <span>执行班组:</span> |
| | | <el-select v-model="tableData.params.execClassgroupId" clearable filterable class="input-box" placeholder="执行班组"> |
| | | <el-option v-for="item in classGroupList" :key="item.id" :label="item.groupName" :value="item.id"></el-option> |
| | | @@ -143,6 +150,7 @@ |
| | | params: { |
| | | pageIndex: number | null; |
| | | pageSize: number | null; |
| | | + execDepId: number | null; |
| | | unitName: string | null; |
| | | workType: number | null; |
| | | createUserId: number | null; |
| | | @@ -182,6 +190,7 @@ |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | unitName: null, |
| | | + execDepId: null, |
| | | workType: null, |
| | | createUserId: null, |
| | | execClassgroupId: null, |
| | | @@ -205,7 +214,7 @@ |
| | | { id: 3, name: '日' }, |
| | | { id: 4, name: '月' }, |
| | | { id: 5, name: '年' } |
| | | - ] |
| | | + ], |
| | | }); |
| | | |
| | | //获取巡检任务数据 |
| | | @@ -300,6 +309,19 @@ |
| | | } |
| | | }; |
| | | |
| | | + const changeGroup = async () => { |
| | | + if(state.tableData.params.execDepId === null) { |
| | | + state.classGroupList = [] |
| | | + }else{ |
| | | + let res = await departmentApi().getByDepId({depId:state.tableData.params.execDepId}) |
| | | + if(res.data.code === '200'){ |
| | | + state.classGroupList = res.data.data |
| | | + }else{ |
| | | + |
| | | + } |
| | | + } |
| | | + }; |
| | | + |
| | | const changeStatus = async (value: { taskUnitStatus: number; id: number }) => { |
| | | if (value.taskUnitStatus === 2) { |
| | | ElMessageBox.confirm(`此操作将关闭该巡检任务”,是否继续?`, '提示', { |
| | | @@ -407,6 +429,7 @@ |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | unitName: null, |
| | | + execDepId: null, |
| | | workType: null, |
| | | createUserId: null, |
| | | execClassgroupId: null, |
| | | @@ -434,6 +457,7 @@ |
| | | Plus, |
| | | reset, |
| | | changeStatus, |
| | | + changeGroup, |
| | | parseNumber, |
| | | deleteInspectTask, |
| | | getInspectionTask, |
| | | Index: .env.development |
| | | IDEA additional info: |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP |
| | | <+># 本地环境\r\nENV = 'development'\r\n\r\nVITE_API_URL = 'http://192.168.0.35:8008'\r\n#李宇飞接口地址\r\n\r\n#VITE_API_URL = 'http://192.168.0.50:8008'\r\n#张凤接口地址\r\n\r\n#VITE_API_URL = 'http://192.168.0.29:8008'\r\n#黄振接口地址\r\n\r\n#VITE_API_URL = 'http://192.168.0.179:8008'\r\n#施正红接口地址\r\n\r\n#VITE_API_URL = 'http://192.168.0.69:8008'\r\n#戚会山接口地址\r\n\r\n#VITE_API_URL = 'http://121.239.169.27:16006/safeplatform'\r\n#线上正式环境接口地址\r\n\r\n#VITE_API_URL_OUT = 'http://121.239.169.27:16006/safeplatform-out'\r\n#线上正式环境外包接口地址\r\n\r\n#VITE_API_URL = 'http://192.168.0.52:8011/safeplatform'\r\n#本地预发接口地址\r\n\r\n#VITE_API_URL_OUT = 'http://192.168.0.52:8011/safeplatform-out'\r\n#本地外包预发接口地址\r\n\r\n\r\nVITE_API_URL_OUT = 'http://192.168.0.50:8009'\r\n#张凤外包接口地址\r\n\r\n#VITE_API_URL_OUT = 'http://192.168.0.52:7021/safeplatform-out'\r\n\r\n\r\n#VITE_API_URL = 'http://192.168.0.52:7021/safeplatform'\r\n#本地测试接口地址\r\n\r\nVITE_API_URL_SOCKET = 'http://192.168.0.52:7021/safeplatform'\r\n#本地测试websocket接口地址\r\n\r\n#VITE_API_URL = 'http://192.168.0.29:7008'\r\n#黄振接口test地址\r\n\r\n#VITE_API_URL_SOCKET = 'http://192.168.0.29:16107'\r\n#黄振websocket test接口地址\r\n\r\n#VITE_API_URL_SOCKET = 'http://192.168.0.29:8018'\r\n#黄振websocket接口地址\r\n |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| | | <+>UTF-8 |
| | | =================================================================== |
| | | diff --git a/.env.development b/.env.development |
| | | --- a/.env.development (revision 38f0a9145a29f570331f11505968f90bd1c08646) |
| | | +++ b/.env.development (date 1678175730920) |
| | | @@ -1,13 +1,13 @@ |
| | | # 本地环境 |
| | | 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.29:8008' |
| | | +VITE_API_URL = 'http://192.168.0.38:8008' |
| | | #黄振接口地址 |
| | | |
| | | #VITE_API_URL = 'http://192.168.0.179:8008' |
| | | Index: src/views/intellectInspect/inspectRecordManage/inspectRecord/index.vue |
| | | IDEA additional info: |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP |
| | | <+><template>\r\n <div class=\"home-container\">\r\n <div style=\"height: 100%\">\r\n <el-row class=\"homeCard\">\r\n <div class=\"basic-line\">\r\n <span>任务类型:</span>\r\n <el-select v-model=\"tableData.params.taskType\" clearable filterable class=\"input-box\" placeholder=\"任务类型\">\r\n <el-option v-for=\"item in workTypeList\" :key=\"item.id\" :label=\"item.name\" :value=\"item.id\"></el-option>\r\n </el-select>\r\n </div>\r\n <div class=\"basic-line\">\r\n <span>执行班组:</span>\r\n <el-select v-model=\"tableData.params.execClassgroupId\" clearable filterable class=\"input-box\" placeholder=\"执行班组\">\r\n <el-option v-for=\"item in classGroupList\" :key=\"item.id\" :label=\"item.groupName\" :value=\"item.id\"></el-option>\r\n </el-select>\r\n </div>\r\n <div class=\"basic-line\">\r\n <span>任务状态:</span>\r\n <el-select v-model=\"tableData.params.taskStatus\" clearable filterable class=\"input-box\" placeholder=\"执行班组\">\r\n <el-option v-for=\"item in taskStatusList\" :key=\"item.id\" :label=\"item.name\" :value=\"item.id\"></el-option>\r\n </el-select>\r\n </div>\r\n <div style=\"padding-bottom: 10px\">\r\n <el-button type=\"primary\" @click=\"getInspectRecord\">查询</el-button>\r\n <el-button plain @click=\"reset\">重置</el-button>\r\n </div>\r\n </el-row>\r\n <div class=\"homeCard\">\r\n <div class=\"main-card\">\r\n <el-row class=\"cardTop\">\r\n <el-button type=\"primary\" :icon=\"Refresh\" size=\"default\" />\r\n </el-row>\r\n <el-table ref=\"multipleTableRef\" :data=\"tableData.inspectRecordData\" style=\"width: 100%\" height=\"calc(100% - 100px)\" :header-cell-style=\"{ background: '#fafafa' }\">\r\n <el-table-column property=\"taskName\" label=\"任务名称\">\r\n <template #default=\"scope\">\r\n <div :class=\"hasJump == true && scope.row.startTime.slice(0, 10) == date && (tableData.params.taskStatus == 4 || tableData.params.taskStatus == 5) ? 'redTit' : ''\">\r\n {{ scope.row.taskName }}\r\n </div>\r\n </template>\r\n </el-table-column>\r\n <el-table-column property=\"taskType\" label=\"任务类型\">\r\n <template #default=\"scope\">\r\n <span>\r\n {{ parseNumber(scope.row.taskType, '任务类型') }}\r\n </span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column property=\"execClassgroupId\" label=\"巡检班组\">\r\n <template #default=\"scope\">\r\n <span>\r\n {{ parseNumber(scope.row.execClassgroupId, '巡检班组') }}\r\n </span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column property=\"frequency\" label=\"检查频次\">\r\n <template #default=\"scope\">\r\n <span>\r\n {{ scope.row.checkCycle }}\r\n </span>\r\n <span>\r\n {{ parseNumber(scope.row.checkCycleUnit, '检查频次') }}\r\n </span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column property=\"startTime\" label=\"任务开始时间\" />\r\n <el-table-column prop=\"execUserName\" label=\"执行人\" show-overflow-tooltip></el-table-column>\r\n <el-table-column property=\"taskStatus\" label=\"任务状态\" width=\"180\">\r\n <template #default=\"scope\">\r\n <el-tag :type=\"scope.row.resultStatus === 1 ? 'danger' : scope.row.taskStatus === 1 ? 'info' : scope.row.taskStatus === 2 ? '' : scope.row.taskStatus === 3 ? 'success' : 'danger'\">\r\n <span>\r\n {{ scope.row.resultStatus === 1 ? '已巡检存在异常' : parseNumber(scope.row.taskStatus, '任务状态') }}\r\n </span>\r\n </el-tag>\r\n </template>\r\n </el-table-column>\r\n <el-table-column property=\"resultStatus\" label=\"巡检结果\">\r\n <template #default=\"scope\">\r\n <span>\r\n {{ parseNumber(scope.row.resultStatus, '巡检状态') }}\r\n </span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column fixed=\"right\" label=\"操作\" align=\"center\" width=\"300\">\r\n <template #default=\"scope\">\r\n <el-button link type=\"primary\" size=\"small\" :icon=\"View\" @click=\"openInspectRecordDialog('查看', scope.row)\">查看</el-button>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n <div class=\"pageBtn\">\r\n <el-pagination @size-change=\"onHandleSizeChange\" @current-change=\"onHandleCurrentChange\" :pager-count=\"5\" :page-sizes=\"[10, 20, 30]\" v-model:current-page=\"tableData.params.pageIndex\" background v-model:page-size=\"tableData.params.pageSize\" layout=\"total, sizes, prev, pager, next, jumper\" :total=\"tableData.total\" class=\"page-position\"> </el-pagination>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <inspect-record-dialog ref=\"inspectRecordDialogRef\" @refreshInspectRecord=\"getInspectRecord\"></inspect-record-dialog>\r\n </div>\r\n</template>\r\n\r\n<script lang=\"ts\">\r\nimport { toRefs, reactive, ref, onMounted, nextTick } from 'vue';\r\nimport { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue';\r\nimport { ElTable, ElMessage } from 'element-plus';\r\nimport { inspectRecordApi } from '/@/api/intellectInspectSystem/inspectRecord';\r\nimport inspectRecordDialog from '../../inspectIndex/components/inspectRecordDialog.vue';\r\nimport { departmentApi } from '/@/api/systemManage/department';\r\nimport { teamManageApi } from '/@/api/systemManage/personShiftManage/teamManage';\r\nimport { inspectPointApi } from '/@/api/intellectInspectSystem/inspectPointManage';\r\nimport { inspectTaskApi } from '/@/api/intellectInspectSystem/inspectTask';\r\nimport { useRoute } from 'vue-router';\r\nlet global: any = {\r\n homeChartOne: null,\r\n homeChartTwo: null,\r\n homeCharThree: null,\r\n dispose: [null, '', undefined]\r\n};\r\n\r\ninterface stateType {\r\n isRed: boolean;\r\n hasJump: boolean;\r\n date: string;\r\n tableData: {\r\n inspectRecordData: [];\r\n total: number;\r\n loading: boolean;\r\n params: {\r\n pageIndex: number | null;\r\n pageSize: number | null;\r\n taskName: string | null;\r\n taskType: number | null;\r\n taskStatus: number | null;\r\n execUserId: number | null;\r\n execClassgroupId: number | null;\r\n execDepId: number | null;\r\n startTime: string | null;\r\n validTime: string | null;\r\n createUserId: number | null;\r\n reportTime: string | null;\r\n resultStatus: number | null;\r\n };\r\n };\r\n workTypeList: Array<type>;\r\n taskStatusList: Array<type>;\r\n quotaList: [];\r\n departmentList: [];\r\n classGroupList: Array<classGroup>;\r\n inspectPointAllList: [];\r\n timeType: Array<type>;\r\n resultStatusList: Array<type>;\r\n}\r\ninterface type {\r\n id: number;\r\n name: string;\r\n}\r\ninterface classGroup {\r\n id: number;\r\n groupName: string;\r\n}\r\ninterface timeType {}\r\nexport default {\r\n name: 'index',\r\n components: { inspectRecordDialog },\r\n setup() {\r\n const inspectRecordDialogRef = ref();\r\n const route = useRoute();\r\n const state = reactive<stateType>({\r\n hasJump: false,\r\n tableData: {\r\n inspectRecordData: [],\r\n total: 0,\r\n loading: false,\r\n params: {\r\n pageIndex: 1,\r\n pageSize: 10,\r\n taskName: null,\r\n taskType: null,\r\n taskStatus: 2,\r\n execUserId: null,\r\n execClassgroupId: null,\r\n execDepId: null,\r\n startTime: null,\r\n validTime: null,\r\n createUserId: null,\r\n reportTime: null,\r\n resultStatus: null\r\n }\r\n },\r\n isRed: false,\r\n date: '',\r\n workTypeList: [\r\n { id: 1, name: '周期任务' },\r\n { id: 2, name: '单次任务' }\r\n ],\r\n resultStatusList: [\r\n { id: 0, name: '正常' },\r\n { id: 1, name: '存在异常' },\r\n { id: 2, name: '备' }\r\n ],\r\n taskStatusList: [\r\n { id: 1, name: '待巡检' },\r\n { id: 2, name: '巡检中' },\r\n { id: 3, name: '已巡检正常' },\r\n { id: 5, name: '已巡检存在异常' },\r\n { id: 4, name: '超时未完成巡检' }\r\n ],\r\n quotaList: [],\r\n departmentList: [],\r\n classGroupList: [],\r\n inspectPointAllList: [],\r\n timeType: [\r\n { id: 1, name: '分' },\r\n { id: 2, name: '小时' },\r\n { id: 3, name: '日' },\r\n { id: 4, name: '月' },\r\n { id: 5, name: '年' }\r\n ]\r\n });\r\n\r\n //获取巡检记录数据\r\n const getInspectRecord = async () => {\r\n const data = JSON.parse(JSON.stringify(state.tableData.params));\r\n if (state.tableData.params.taskStatus == 3) {\r\n data.taskStatus = 3;\r\n data.resultStatus = 0;\r\n }\r\n if (state.tableData.params.taskStatus == 5) {\r\n data.taskStatus = 3;\r\n data.resultStatus = 1;\r\n }\r\n console.log(state.tableData.params.taskStatus, data.taskStatus, 'data');\r\n let res = await inspectRecordApi().getInspectRecordList(data);\r\n if (res.data.code === '200') {\r\n state.tableData.inspectRecordData = JSON.parse(JSON.stringify(res.data.data.records));\r\n state.tableData.total = res.data.data.total;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n //获取部门\r\n const getDepartmentData = async () => {\r\n let res = await departmentApi().getDepartmentList();\r\n if (res.data.code === '200') {\r\n state.departmentList = res.data.data;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n //获取部门\r\n const getQuotaList = async () => {\r\n let res = await inspectTaskApi().getQuotaList();\r\n if (res.data.code === '200') {\r\n state.quotaList = res.data.data;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n //获取巡检点\r\n const getInspectTaskPoint = async () => {\r\n let res = await inspectPointApi().getInspectPointAll();\r\n if (res.data.code === '200') {\r\n state.inspectPointAllList = res.data.data;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n //获取班组\r\n const getClassGroupData = async () => {\r\n let res = await teamManageApi().getRecord({ depIp: null, groupName: null, containGroupMemberEnable: null });\r\n if (res.data.code === '200') {\r\n state.classGroupList = res.data.data;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n // const turnRed =()=>{\r\n // date\r\n // }\r\n\r\n const openInspectRecordDialog = (type: string, value: {}) => {\r\n inspectRecordDialogRef.value.showInspectRecordDialog(type, value, state.workTypeList, state.departmentList, state.timeType, state.classGroupList, state.quotaList, state.inspectPointAllList);\r\n };\r\n\r\n const parseNumber = (value: number, type: string) => {\r\n if (type === '任务类型') {\r\n return state.workTypeList.find((item) => item.id === value)?.name;\r\n } else if (type === '检查频次') {\r\n return state.timeType.find((item) => item.id == value)?.name;\r\n } else if (type === '巡检状态') {\r\n return state.resultStatusList.find((item) => item.id == value)?.name;\r\n } else if (type === '任务状态') {\r\n return state.taskStatusList.find((item) => item.id == value)?.name;\r\n } else {\r\n return state.classGroupList.find((item) => item.id == value)?.groupName;\r\n }\r\n };\r\n\r\n // 分页改变\r\n const onHandleSizeChange = (val: number) => {\r\n state.tableData.params.pageSize = val;\r\n getInspectRecord();\r\n };\r\n // 分页改变\r\n const onHandleCurrentChange = (val: number) => {\r\n state.tableData.params.pageIndex = val;\r\n getInspectRecord();\r\n state.isRed = false;\r\n };\r\n // 时间格式化\r\n const timeForm: timeType = {\r\n hour12: false,\r\n year: 'numeric',\r\n month: '2-digit',\r\n day: '2-digit',\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n second: '2-digit'\r\n };\r\n const reset = () => {\r\n state.tableData.params = {\r\n pageIndex: 1,\r\n pageSize: 10,\r\n taskName: null,\r\n taskType: null,\r\n taskStatus: null,\r\n execUserId: null,\r\n execClassgroupId: null,\r\n execDepId: null,\r\n startTime: null,\r\n validTime: null,\r\n createUserId: null,\r\n resultStatus: null,\r\n reportTime: null\r\n };\r\n };\r\n // 当前时间\r\n const getDateTime = () => {\r\n const curTime = new Date().toLocaleString('zh', timeForm).replace(/\\//g, '-');\r\n state.date = curTime.slice(0, 10);\r\n };\r\n // 页面加载时\r\n onMounted(() => {\r\n getDateTime();\r\n if (route.query.id) {\r\n state.hasJump = true;\r\n state.tableData.params.taskStatus = Number(route.query.id);\r\n state.isRed = true;\r\n getInspectRecord();\r\n getQuotaList();\r\n getDepartmentData();\r\n getClassGroupData();\r\n getInspectTaskPoint();\r\n } else {\r\n getInspectRecord();\r\n getQuotaList();\r\n getDepartmentData();\r\n getClassGroupData();\r\n getInspectTaskPoint();\r\n }\r\n });\r\n\r\n return {\r\n View,\r\n Edit,\r\n Delete,\r\n Refresh,\r\n Plus,\r\n reset,\r\n parseNumber,\r\n getInspectRecord,\r\n onHandleSizeChange,\r\n onHandleCurrentChange,\r\n inspectRecordDialogRef,\r\n openInspectRecordDialog,\r\n ...toRefs(state)\r\n };\r\n }\r\n};\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n$homeNavLengh: 8;\r\n.home-container {\r\n height: calc(100vh - 144px);\r\n box-sizing: border-box;\r\n overflow: hidden;\r\n .homeCard {\r\n width: 100%;\r\n padding: 20px;\r\n box-sizing: border-box;\r\n background: #fff;\r\n border-radius: 4px;\r\n\r\n .main-card {\r\n width: 100%;\r\n height: 100%;\r\n .cardTop {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n margin-bottom: 20px;\r\n .mainCardBtn {\r\n margin: 0;\r\n }\r\n }\r\n .pageBtn {\r\n height: 60px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: right;\r\n\r\n .demo-pagination-block + .demo-pagination-block {\r\n margin-top: 10px;\r\n }\r\n .demo-pagination-block .demonstration {\r\n margin-bottom: 16px;\r\n }\r\n }\r\n }\r\n &:last-of-type {\r\n height: calc(100% - 100px);\r\n }\r\n }\r\n .el-row {\r\n display: flex;\r\n align-items: center;\r\n margin-bottom: 20px;\r\n &:last-child {\r\n margin-bottom: 0;\r\n }\r\n .grid-content {\r\n align-items: center;\r\n min-height: 36px;\r\n }\r\n\r\n .topInfo {\r\n display: flex;\r\n align-items: center;\r\n font-size: 16px;\r\n font-weight: bold;\r\n\r\n & > div {\r\n white-space: nowrap;\r\n margin-right: 20px;\r\n }\r\n }\r\n }\r\n}\r\n.stepItem {\r\n width: 100%;\r\n display: flex;\r\n align-items: flex-start;\r\n margin-bottom: 30px;\r\n margin-left: 30px;\r\n padding-bottom: 30px;\r\n border-left: 2px solid #ccc;\r\n &:first-of-type {\r\n margin-top: 30px;\r\n }\r\n &:last-of-type {\r\n margin-bottom: 0;\r\n border-left: none;\r\n }\r\n .stepNum {\r\n width: 30px;\r\n height: 30px;\r\n border-radius: 15px;\r\n box-sizing: border-box;\r\n color: #333;\r\n border: 1px solid #999;\r\n line-height: 28px;\r\n text-align: center;\r\n margin-right: 10px;\r\n margin-left: -16px;\r\n margin-top: -30px;\r\n }\r\n .stepCard {\r\n width: 100%;\r\n margin-top: -30px;\r\n\r\n .box-card {\r\n width: 100%;\r\n &:deep(.el-card__header) {\r\n padding: 10px 15px;\r\n }\r\n .card-header {\r\n width: 100%;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n & > div:first-of-type {\r\n margin-right: 80px;\r\n font-size: 18px;\r\n font-weight: bold;\r\n }\r\n }\r\n }\r\n }\r\n &:hover .card-header {\r\n color: #0098f5;\r\n }\r\n &:hover .stepNum {\r\n border: 2px solid #0098f5;\r\n color: #0098f5;\r\n }\r\n}\r\n.redTit {\r\n color: red;\r\n}\r\n.el-input {\r\n width: 100% !important;\r\n}\r\n:deep(.el-date-editor) {\r\n width: 100%;\r\n}\r\n.el-select {\r\n width: 100%;\r\n}\r\n:deep(.el-textarea.is-disabled .el-textarea__inner) {\r\n background-color: var(--el-card-bg-color);\r\n color: var(--el-input-text-color, var(--el-text-color-regular));\r\n}\r\n:deep(.el-input.is-disabled .el-input__inner) {\r\n color: var(--el-input-text-color, var(--el-text-color-regular));\r\n}\r\n:deep(.el-input.is-disabled .el-input__wrapper) {\r\n background-color: var(--el-card-bg-color);\r\n}\r\n</style>\r\n |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| | | <+>UTF-8 |
| | | =================================================================== |
| | | diff --git a/src/views/intellectInspect/inspectRecordManage/inspectRecord/index.vue b/src/views/intellectInspect/inspectRecordManage/inspectRecord/index.vue |
| | | --- a/src/views/intellectInspect/inspectRecordManage/inspectRecord/index.vue (revision 38f0a9145a29f570331f11505968f90bd1c08646) |
| | | +++ b/src/views/intellectInspect/inspectRecordManage/inspectRecord/index.vue (date 1678177506773) |
| | | @@ -9,6 +9,13 @@ |
| | | </el-select> |
| | | </div> |
| | | <div class="basic-line"> |
| | | + <span>部门:</span> |
| | | + <el-cascader class="input-box" :options="departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" |
| | | + placeholder="请选择部门" clearable v-model="tableData.params.execDepId" |
| | | + @change="changeGroup" |
| | | + > </el-cascader> |
| | | + </div> |
| | | + <div class="basic-line"> |
| | | <span>执行班组:</span> |
| | | <el-select v-model="tableData.params.execClassgroupId" clearable filterable class="input-box" placeholder="执行班组"> |
| | | <el-option v-for="item in classGroupList" :key="item.id" :label="item.groupName" :value="item.id"></el-option> |
| | | @@ -278,16 +285,16 @@ |
| | | } |
| | | }; |
| | | |
| | | - //获取班组 |
| | | - const getClassGroupData = async () => { |
| | | - let res = await teamManageApi().getRecord({ depIp: null, groupName: null, containGroupMemberEnable: null }); |
| | | - if (res.data.code === '200') { |
| | | - state.classGroupList = res.data.data; |
| | | - } else { |
| | | - ElMessage({ |
| | | - type: 'warning', |
| | | - message: res.data.msg |
| | | - }); |
| | | + const changeGroup = async () => { |
| | | + if(state.tableData.params.execDepId === null) { |
| | | + state.classGroupList = [] |
| | | + }else{ |
| | | + let res = await departmentApi().getByDepId({depId:state.tableData.params.execDepId}) |
| | | + if(res.data.code === '200'){ |
| | | + state.classGroupList = res.data.data |
| | | + }else{ |
| | | + |
| | | + } |
| | | } |
| | | }; |
| | | |
| | | @@ -366,13 +373,11 @@ |
| | | getInspectRecord(); |
| | | getQuotaList(); |
| | | getDepartmentData(); |
| | | - getClassGroupData(); |
| | | getInspectTaskPoint(); |
| | | } else { |
| | | getInspectRecord(); |
| | | getQuotaList(); |
| | | getDepartmentData(); |
| | | - getClassGroupData(); |
| | | getInspectTaskPoint(); |
| | | } |
| | | }); |
| | | @@ -385,6 +390,7 @@ |
| | | Plus, |
| | | reset, |
| | | parseNumber, |
| | | + changeGroup, |
| | | getInspectRecord, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | Index: src/views/system/user/index.vue |
| | | IDEA additional info: |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP |
| | | <+><template>\r\n <div class=\"system-user-container\">\r\n <el-card shadow=\"hover\">\r\n <div class=\"system-user-search mb15\">\r\n <el-cascader\r\n v-model=\"userTableData.listQuery.searchParams.depId\"\r\n :props=\"props\"\r\n :options=\"departmentList\"\r\n :show-all-levels=\"false\"\r\n placeholder=\"请选择部门\"\r\n clearable\r\n size=\"default\"\r\n ></el-cascader>\r\n <el-input size=\"default\" v-model.trim=\"userTableData.listQuery.searchParams.username\" placeholder=\"请输入用户名\" style=\"max-width: 180px;margin-left: 10px;margin-right: 10px\"> </el-input>\r\n <el-input size=\"default\" v-model.trim=\"userTableData.listQuery.searchParams.realName\" placeholder=\"请输入真实姓名\" style=\"max-width: 180px\"> </el-input>\r\n <el-button size=\"default\" type=\"primary\" class=\"ml10\" @click=\"initUserTableData\">\r\n <el-icon>\r\n <ele-Search />\r\n </el-icon>\r\n 查询\r\n </el-button>\r\n <el-button size=\"default\" type=\"success\" class=\"ml10\" @click=\"onOpenUserDialog('新增', '')\">\r\n <el-icon>\r\n <ele-FolderAdd />\r\n </el-icon>\r\n 新增用户\r\n </el-button>\r\n </div>\r\n <el-table :data=\"userTableData.data\" style=\"width: 100%\">\r\n <el-table-column type=\"index\" label=\"序号\" width=\"60\" />\r\n <el-table-column prop=\"username\" label=\"用户名\" show-overflow-tooltip></el-table-column>\r\n <el-table-column prop=\"realName\" label=\"真实姓名\" show-overflow-tooltip></el-table-column>\r\n <el-table-column prop=\"gender\" label=\"性别\" show-overflow-tooltip>\r\n <template #default=\"scope\">\r\n <el-tag type=\"success\" v-if=\"scope.row.gender == 1\">男</el-tag>\r\n <el-tag type=\"success\" v-else-if=\"scope.row.gender == 0\">女</el-tag>\r\n </template>\r\n </el-table-column>\r\n <el-table-column prop=\"positionId\" label=\"职务\" show-overflow-tooltip>\r\n <template #default=\"scope\">\r\n {{ parseNumber(scope.row.positionId) }}\r\n </template>\r\n </el-table-column>\r\n <el-table-column prop=\"type\" label=\"职务\" show-overflow-tooltip>\r\n <template #default=\"scope\">\r\n {{ `${userTypeList.find(item => item.id === scope.row.type)?.name}` }}\r\n </template>\r\n </el-table-column>\r\n <el-table-column prop=\"department.depName\" label=\"部门\" show-overflow-tooltip></el-table-column>\r\n <el-table-column prop=\"phone\" label=\"手机号\" show-overflow-tooltip></el-table-column>\r\n <el-table-column prop=\"email\" label=\"邮箱\" show-overflow-tooltip></el-table-column>\r\n <el-table-column prop=\"status\" label=\"用户状态\" show-overflow-tooltip>\r\n <template #default=\"scope\">\r\n <el-tag type=\"success\" v-if=\"scope.row.status\">启用</el-tag>\r\n <el-tag type=\"info\" v-else>禁用</el-tag>\r\n </template>\r\n </el-table-column>\r\n <el-table-column prop=\"gmtCreate\" label=\"创建时间\" show-overflow-tooltip></el-table-column>\r\n <el-table-column label=\"操作\" width=\"100\">\r\n <template #default=\"scope\">\r\n <el-button :disabled=\"scope.row.userName === 'admin'\" size=\"small\" text type=\"primary\" @click=\"onOpenUserDialog('修改', scope.row)\">修改</el-button>\r\n <el-button style=\"color: red\" :disabled=\"scope.row.userName === 'admin'\" size=\"small\" text type=\"primary\" @click=\"onRowDel(scope.row)\">删除</el-button>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n <br />\r\n <el-pagination @size-change=\"onHandleSizeChange\" @current-change=\"onHandleCurrentChange\" class=\"page-position\" :pager-count=\"5\" :page-sizes=\"[10, 20, 30]\" v-model:current-page=\"userTableData.listQuery.pageIndex\" background v-model:page-size=\"userTableData.listQuery.pageSize\" layout=\"total, sizes, prev, pager, next, jumper\" :total=\"userTableData.total\"> </el-pagination>\r\n <br />\r\n <br />\r\n </el-card>\r\n <userDialog ref=\"userRef\" @getUserList=\"initUserTableData\" />\r\n </div>\r\n</template>\r\n\r\n<script lang=\"ts\">\r\nimport { toRefs, reactive, onMounted, ref, defineComponent } from 'vue';\r\nimport { ElMessageBox, ElMessage } from 'element-plus';\r\nimport userDialog from '/@/views/system/user/component/userDialog.vue';\r\nimport { userApi } from '/@/api/systemManage/user';\r\nimport { dutyApi } from '/@/api/systemManage/duty';\r\nimport { departmentApi } from '/@/api/systemManage/department';\r\nimport { useRoleApi } from '/@/api/systemManage/role';\r\n\r\n// 定义接口来定义对象的类型\r\ninterface TableDataRow {\r\n userName: string;\r\n userNickname: string;\r\n roleSign: string;\r\n department: string[];\r\n phone: string;\r\n email: string;\r\n sex: string;\r\n password: string;\r\n overdueTime: Date;\r\n status: boolean;\r\n describe: string;\r\n createTime: string;\r\n}\r\ninterface DepartmentDataRow {}\r\ninterface TableDataState {\r\n userTableData: {\r\n data: Array<TableDataRow>;\r\n total: number;\r\n loading: boolean;\r\n listQuery: {\r\n searchParams: {\r\n depId: string | null;\r\n username: string | null;\r\n realName: string | null;\r\n };\r\n pageIndex: number;\r\n pageSize: number;\r\n };\r\n };\r\n departmentList: [];\r\n roleList: [];\r\n dutyList: [];\r\n userTypeList: Array<{id:number,name:string}>;\r\n props:{}\r\n}\r\n\r\nexport default defineComponent({\r\n name: 'systemUser',\r\n components: { userDialog },\r\n setup() {\r\n const userRef = ref();\r\n const state = reactive<TableDataState>({\r\n userTableData: {\r\n data: [],\r\n total: 0,\r\n loading: false,\r\n listQuery: {\r\n searchParams: {\r\n depId: null,\r\n username: null,\r\n realName: null\r\n },\r\n pageIndex: 1,\r\n pageSize: 10\r\n }\r\n },\r\n departmentList: [],\r\n roleList: [],\r\n dutyList: [],\r\n props: {\r\n label: 'depName',\r\n value: 'depId',\r\n checkStrictly: true,\r\n emitPath: false\r\n },\r\n userTypeList: [\r\n { id: 1, name: '超级管理员' },\r\n { id: 2, name: '管理员' },\r\n { id: 3, name: '普通员工' }\r\n ]\r\n });\r\n // 初始化表格数据\r\n const initUserTableData = async () => {\r\n let res = await userApi().getUserList(state.userTableData.listQuery);\r\n if (res.data.code === '200') {\r\n state.userTableData.data = res.data.data;\r\n state.userTableData.total = res.data.total;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n // 回显职务信息\r\n const parseNumber = (value: number) => {\r\n return state.dutyList.find((i) => i.positionId === value)?.positionName;\r\n };\r\n const getDepartmentData = async () => {\r\n let res = await departmentApi().getDepartmentList();\r\n if (res.data.code === '200') {\r\n state.departmentList = res.data.data;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n const getRoleData = async () => {\r\n let res = await useRoleApi().getRoleList();\r\n if (res.data.code === '200') {\r\n state.roleList = res.data.data;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n const getDutyData = async () => {\r\n let res = await dutyApi().getAllList({positionName: '',positionCode: ''});\r\n if (res.data.code === '200') {\r\n state.dutyList = res.data.data;\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n };\r\n\r\n // 打开新增修改用户弹窗\r\n const onOpenUserDialog = (type: string, value: any) => {\r\n userRef.value.openDialog(type, value, state.departmentList, state.roleList, state.dutyList);\r\n };\r\n\r\n // 删除用户\r\n const onRowDel = (row: TableDataRow) => {\r\n ElMessageBox.confirm(`此操作将永久删除账户名称:“${row.realName}”,是否继续?`, '提示', {\r\n confirmButtonText: '确认',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n })\r\n .then(async () => {\r\n let res = await userApi().deleteUser({ uid: row.uid });\r\n if (res.data.code === '200') {\r\n ElMessage({\r\n type: 'success',\r\n duration: 2000,\r\n message: '删除成功'\r\n });\r\n await initUserTableData();\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n })\r\n .catch(() => {});\r\n };\r\n // 分页改变\r\n const onHandleSizeChange = (val: number) => {\r\n state.userTableData.listQuery.pageSize = val;\r\n initUserTableData();\r\n };\r\n // 分页改变\r\n const onHandleCurrentChange = (val: number) => {\r\n state.userTableData.listQuery.pageIndex = val;\r\n initUserTableData();\r\n };\r\n // 页面加载时\r\n onMounted(() => {\r\n let a = { name: 1, c: { name: 1 } };\r\n let b = Object.assign({}, a);\r\n b.c.name = 2;\r\n console.log(a.c.name);\r\n initUserTableData();\r\n getDepartmentData();\r\n getRoleData();\r\n getDutyData()\r\n });\r\n return {\r\n userRef,\r\n onOpenUserDialog,\r\n onRowDel,\r\n parseNumber,\r\n onHandleSizeChange,\r\n initUserTableData,\r\n onHandleCurrentChange,\r\n ...toRefs(state)\r\n };\r\n }\r\n});\r\n</script>\r\n<style scoped>\r\n:deep(.el-textarea.is-disabled .el-textarea__inner) {\r\n background-color: var(--el-card-bg-color);\r\n color: var(--el-input-text-color, var(--el-text-color-regular));\r\n}\r\n:deep(.el-input.is-disabled .el-input__inner) {\r\n color: var(--el-input-text-color, var(--el-text-color-regular));\r\n}\r\n:deep(.el-input.is-disabled .el-input__wrapper) {\r\n background-color: var(--el-card-bg-color);\r\n}\r\n</style>\r\n |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| | | <+>UTF-8 |
| | | =================================================================== |
| | | diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue |
| | | --- a/src/views/system/user/index.vue (revision 38f0a9145a29f570331f11505968f90bd1c08646) |
| | | +++ b/src/views/system/user/index.vue (date 1678258566279) |
| | | @@ -31,15 +31,15 @@ |
| | | <el-table-column prop="username" label="用户名" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="realName" label="真实姓名" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gender" label="性别" show-overflow-tooltip> |
| | | - <template #default="scope"> |
| | | - <el-tag type="success" v-if="scope.row.gender == 1">男</el-tag> |
| | | - <el-tag type="success" v-else-if="scope.row.gender == 0">女</el-tag> |
| | | - </template> |
| | | + <template #default="scope"> |
| | | + <el-tag type="success" v-if="scope.row.gender == 1">男</el-tag> |
| | | + <el-tag type="success" v-else-if="scope.row.gender == 0">女</el-tag> |
| | | + </template> |
| | | </el-table-column> |
| | | <el-table-column prop="positionId" label="职务" show-overflow-tooltip> |
| | | - <template #default="scope"> |
| | | - {{ parseNumber(scope.row.positionId) }} |
| | | - </template> |
| | | + <template #default="scope"> |
| | | + {{ parseNumber(scope.row.positionId) }} |
| | | + </template> |
| | | </el-table-column> |
| | | <el-table-column prop="type" label="职务" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | @@ -143,10 +143,10 @@ |
| | | roleList: [], |
| | | dutyList: [], |
| | | props: { |
| | | - label: 'depName', |
| | | - value: 'depId', |
| | | - checkStrictly: true, |
| | | - emitPath: false |
| | | + label: 'depName', |
| | | + value: 'depId', |
| | | + checkStrictly: true, |
| | | + emitPath: false |
| | | }, |
| | | userTypeList: [ |
| | | { id: 1, name: '超级管理员' }, |
| | | @@ -196,17 +196,17 @@ |
| | | } |
| | | }; |
| | | |
| | | - const getDutyData = async () => { |
| | | - let res = await dutyApi().getAllList({positionName: '',positionCode: ''}); |
| | | - if (res.data.code === '200') { |
| | | - state.dutyList = res.data.data; |
| | | - } else { |
| | | - ElMessage({ |
| | | - type: 'warning', |
| | | - message: res.data.msg |
| | | - }); |
| | | - } |
| | | - }; |
| | | + const getDutyData = async () => { |
| | | + let res = await dutyApi().getAllList({positionName: '',positionCode: ''}); |
| | | + if (res.data.code === '200') { |
| | | + state.dutyList = res.data.data; |
| | | + } else { |
| | | + ElMessage({ |
| | | + type: 'warning', |
| | | + message: res.data.msg |
| | | + }); |
| | | + } |
| | | + }; |
| | | |
| | | // 打开新增修改用户弹窗 |
| | | const onOpenUserDialog = (type: string, value: any) => { |
| | | @@ -250,10 +250,6 @@ |
| | | }; |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | - let a = { name: 1, c: { name: 1 } }; |
| | | - let b = Object.assign({}, a); |
| | | - b.c.name = 2; |
| | | - console.log(a.c.name); |
| | | initUserTableData(); |
| | | getDepartmentData(); |
| | | getRoleData(); |
| | | Index: src/api/systemManage/department/index.ts |
| | | IDEA additional info: |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP |
| | | <+>import request from '/@/utils/request';\r\n\r\nexport function departmentApi() {\r\n return {\r\n // v2\r\n getDepartmentList: () => {\r\n return request({\r\n url: import.meta.env.VITE_API_URL + `/department/list`,\r\n method: 'post'\r\n });\r\n },\r\n // v2\r\n addDepartment: (data: object) => {\r\n return request({\r\n url: import.meta.env.VITE_API_URL + `/department/add`,\r\n method: 'post',\r\n data: data\r\n });\r\n },\r\n // v2\r\n modDepartment: (data: object) => {\r\n return request({\r\n url: import.meta.env.VITE_API_URL + `/department/mod`,\r\n method: 'post',\r\n data: data\r\n });\r\n },\r\n // v1\r\n deleteDepartment: (value?: object) => {\r\n return request({\r\n url: import.meta.env.VITE_API_URL + `/department/del`,\r\n method: 'post',\r\n data: value\r\n });\r\n }\r\n };\r\n}\r\n |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| | | <+>UTF-8 |
| | | =================================================================== |
| | | diff --git a/src/api/systemManage/department/index.ts b/src/api/systemManage/department/index.ts |
| | | --- a/src/api/systemManage/department/index.ts (revision 38f0a9145a29f570331f11505968f90bd1c08646) |
| | | +++ b/src/api/systemManage/department/index.ts (date 1678176094256) |
| | | @@ -32,6 +32,13 @@ |
| | | method: 'post', |
| | | data: value |
| | | }); |
| | | + }, |
| | | + getByDepId: (value: object) => { |
| | | + return request({ |
| | | + url: import.meta.env.VITE_API_URL + `/schedule/group/list`, |
| | | + method: 'post', |
| | | + data: value |
| | | + }); |
| | | } |
| | | }; |
| | | } |
| | | Index: src/views/system/user/component/userDialog.vue |
| | | IDEA additional info: |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP |
| | | <+><template>\r\n <div class=\"system-add-user-container\">\r\n <el-dialog :title=\"title\" v-model=\"isShowUserDialog\" width=\"769px\">\r\n <el-form :model=\"userForm\" size=\"default\" ref=\"userRef\" :rules=\"userFormRules\" label-width=\"90px\">\r\n <el-row :gutter=\"35\">\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\" v-if=\"disabled\">\r\n <el-form-item label=\"用户名\">\r\n <el-input v-model.trim=\"userForm.username\" :disabled=\"disabled\" placeholder=\"\" clearable></el-input>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\">\r\n <el-form-item label=\"真实姓名\" prop=\"realName\">\r\n <el-input v-model.trim=\"userForm.realName\" placeholder=\"请输入真实姓名\" clearable></el-input>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\">\r\n <el-form-item label=\"关联角色\" prop=\"roleId\">\r\n <el-select v-model=\"userForm.roleId\" placeholder=\"请选择\" clearable class=\"w100\">\r\n <el-option v-for=\"item in roleData\" :key=\"item.roleId\" :label=\"item.roleName\" :value=\"item.roleId\"> </el-option>\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\">\r\n <el-form-item label=\"部门\" prop=\"depId\">\r\n <el-cascader :options=\"departmentData\" :props=\"{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }\" placeholder=\"请选择部门\" clearable class=\"w100\" v-model=\"userForm.depId\"> </el-cascader>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\">\r\n <el-form-item label=\"职务\" prop=\"positionId\">\r\n <el-select v-model=\"userForm.positionId\" placeholder=\"请选择\" clearable class=\"w100\">\r\n <el-option v-for=\"item in dutyData\" :key=\"item.positionId\" :label=\"item.positionName\" :value=\"item.positionId\"> </el-option>\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\">\r\n <el-form-item label=\"手机号\" prop=\"phone\">\r\n <el-input v-model.trim=\"userForm.phone\" placeholder=\"请输入手机号\" clearable></el-input>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\">\r\n <el-form-item label=\"身份证\">\r\n <el-input v-model.trim=\"userForm.identify\" placeholder=\"请输入身份证\" clearable></el-input>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\">\r\n <el-form-item label=\"邮箱\">\r\n <el-input v-model.trim=\"userForm.email\" placeholder=\"请输入\" clearable></el-input>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\">\r\n <el-form-item label=\"性别\" prop=\"gender\">\r\n <el-select v-model=\"userForm.gender\" placeholder=\"请选择\" clearable class=\"w100\">\r\n <el-option v-for=\"item in sexList\" :key=\"item.id\" :value=\"item.id\" :label=\"item.name\"> </el-option>\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\">\r\n <el-form-item label=\"账户过期\" prop=\"expireTime\">\r\n <el-date-picker v-model=\"userForm.expireTime\" type=\"date\" placeholder=\"请选择\" class=\"w100\"> </el-date-picker>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\" v-if=\"!disabled\">\r\n <el-form-item label=\"账户密码\" prop=\"password\">\r\n <el-input v-model.trim=\"userForm.password\" placeholder=\"请输入\" type=\"password\" show-password>\r\n </el-input>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\">\r\n <el-form-item label=\"用户类型\" prop=\"type\">\r\n <el-select v-model=\"userForm.type\" placeholder=\"请选择\" clearable class=\"w100\">\r\n <el-option v-for=\"item in userTypeList.filter(item => userForm.type === 1 ? item.id === 1 : item.id !== 1)\" :key=\"item.id\" :label=\"item.name\" :value=\"item.id\"> </el-option>\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n <!--\t\t\t\t\t<el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\" class=\"mb20\">-->\r\n <!--\t\t\t\t\t\t<el-form-item label=\"用户状态\">-->\r\n <!--\t\t\t\t\t\t\t<el-switch v-model=\"userForm.status\" inline-prompt active-value = 1 inactive-value= 0 active-text=\"启\" inactive-text=\"禁\"></el-switch>-->\r\n <!--\t\t\t\t\t\t</el-form-item>-->\r\n <!--\t\t\t\t\t</el-col>-->\r\n </el-row>\r\n </el-form>\r\n <template #footer>\r\n <span class=\"dialog-footer\">\r\n <el-button @click=\"isShowUserDialog = !isShowUserDialog\" size=\"default\">取 消</el-button>\r\n <el-button type=\"primary\" v-throttle @click=\"onSubmit\" size=\"default\">确 定</el-button>\r\n </span>\r\n </template>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n\r\n<script lang=\"ts\">\r\nimport { reactive, toRefs, onMounted, defineComponent, ref } from 'vue';\r\nimport { ElMessageBox, ElMessage } from 'element-plus';\r\nimport { userApi } from '/@/api/systemManage/user';\r\n\r\n// 定义接口来定义对象的类型\r\ninterface DeptData {}\r\ninterface roleData {}\r\ninterface dutyData {}\r\ninterface sexData {}\r\ninterface UserState {\r\n title: string;\r\n disabled: boolean;\r\n isShowUserDialog: boolean;\r\n userForm: {\r\n username: string;\r\n realName: string;\r\n roleId: number | null;\r\n depId: number | null;\r\n positionId: number | null;\r\n phone: string;\r\n email: string;\r\n gender: number | null;\r\n password: string;\r\n expireTime: string;\r\n status: number;\r\n identify: string;\r\n };\r\n userFormRules:{\r\n\r\n },\r\n departmentData: Array<DeptData>;\r\n roleData: Array<roleData>;\r\n dutyData: Array<dutyData>;\r\n sexList: Array<sexData>;\r\n}\r\n\r\nexport default defineComponent({\r\n name: 'user',\r\n setup(props, context) {\r\n const userRef = ref()\r\n const state = reactive<UserState>({\r\n title: '',\r\n disabled: false,\r\n isShowUserDialog: false,\r\n userForm: {\r\n username: '', // 账户名称\r\n realName: '', // 用户昵称\r\n roleId: null, // 关联角色\r\n depId: null, // 部门\r\n phone: '', // 手机号\r\n email: '', // 邮箱\r\n identify: '',\r\n gender: null, // 性别\r\n password: '', // 账户密码\r\n positionId: null, // 岗位\r\n expireTime: '', // 账户过期\r\n status: 1 // 用户状态\r\n },\r\n userFormRules:{\r\n username: [{ required: true, message: '请填写用户名', trigger: 'blur' }],\r\n realName: [{ required: true, message: '请填写真实姓名', trigger: 'blur' }],\r\n roleId: [{ required: true, message: '请选择用户角色', trigger: 'change' }],\r\n depId: [{ required: true, message: '请选择部门', trigger: 'change' }],\r\n positionId: [{ required: true, message: '请选择职务', trigger: 'change' }],\r\n phone: [{ required: true, message: '请填写手机号', trigger: 'blur' }],\r\n gender: [{ required: true, message: '请选择性别', trigger: 'change' }],\r\n expireTime: [{ required: true, message: '请输入账户过期时间', trigger: 'blur' }],\r\n password: [{ required: true, message: '请输入账户密码', trigger: 'blur' }],\r\n },\r\n departmentData: [], // 部门数据\r\n roleData: [], //角色数据\r\n dutyData:[], //职务数据\r\n sexList: [\r\n { id: 1, name: '男' },\r\n { id: 0, name: '女' }\r\n ]\r\n });\r\n // 打开弹窗\r\n const openDialog = (type: string, value: any, departmentList: [], roleList: [], dutyList:[]) => {\r\n state.isShowUserDialog = true;\r\n state.departmentData = departmentList;\r\n state.roleData = roleList;\r\n state.dutyData = dutyList\r\n if (type === '新增') {\r\n state.disabled = false\r\n state.title = '新增用户';\r\n state.userForm = {\r\n username: '',\r\n realName: '',\r\n roleId: null,\r\n depId: null,\r\n phone: '',\r\n email: '',\r\n identify: '',\r\n positionId: null,\r\n gender: null,\r\n password: '',\r\n expireTime: '',\r\n status: 1\r\n };\r\n } else {\r\n state.disabled = true\r\n state.title = '修改用户';\r\n state.userForm = JSON.parse(JSON.stringify(value));\r\n }\r\n };\r\n\r\n // 新增修改\r\n const onSubmit = async () => {\r\n userRef.value.validate(async (valid:Boolean) => {\r\n if(valid){\r\n if (state.title === '新增用户') {\r\n let res = await userApi().addUser(state.userForm);\r\n if (res.data.code === '200') {\r\n ElMessage({\r\n type: 'success',\r\n message: '用户新增成功',\r\n duration: 2000\r\n });\r\n state.isShowUserDialog = false;\r\n context.emit('getUserList');\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n } else {\r\n let res = await userApi().modUser(state.userForm);\r\n if (res.data.code === '200') {\r\n ElMessage({\r\n type: 'success',\r\n message: '用户修改成功',\r\n duration: 2000\r\n });\r\n state.isShowUserDialog = false;\r\n context.emit('getUserList');\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n }\r\n }else{\r\n ElMessage({\r\n type:'warning',\r\n message:'请完善基本信息'\r\n })\r\n }\r\n })\r\n\r\n };\r\n\r\n // 页面加载时\r\n onMounted(() => {});\r\n return {\r\n userRef,\r\n openDialog,\r\n onSubmit,\r\n ...toRefs(state)\r\n };\r\n }\r\n});\r\n</script>\r\n |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| | | <+>UTF-8 |
| | | =================================================================== |
| | | diff --git a/src/views/system/user/component/userDialog.vue b/src/views/system/user/component/userDialog.vue |
| | | --- a/src/views/system/user/component/userDialog.vue (revision 38f0a9145a29f570331f11505968f90bd1c08646) |
| | | +++ b/src/views/system/user/component/userDialog.vue (date 1678258555207) |
| | | @@ -26,11 +26,11 @@ |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | - <el-form-item label="职务" prop="positionId"> |
| | | - <el-select v-model="userForm.positionId" placeholder="请选择" clearable class="w100"> |
| | | - <el-option v-for="item in dutyData" :key="item.positionId" :label="item.positionName" :value="item.positionId"> </el-option> |
| | | - </el-select> |
| | | - </el-form-item> |
| | | + <el-form-item label="职务" prop="positionId"> |
| | | + <el-select v-model="userForm.positionId" placeholder="请选择" clearable class="w100"> |
| | | + <el-option v-for="item in dutyData" :key="item.positionId" :label="item.positionName" :value="item.positionId"> </el-option> |
| | | + </el-select> |
| | | + </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="手机号" prop="phone"> |
| | | @@ -72,11 +72,11 @@ |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | - <!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">--> |
| | | - <!-- <el-form-item label="用户状态">--> |
| | | - <!-- <el-switch v-model="userForm.status" inline-prompt active-value = 1 inactive-value= 0 active-text="启" inactive-text="禁"></el-switch>--> |
| | | - <!-- </el-form-item>--> |
| | | - <!-- </el-col>--> |
| | | + <!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">--> |
| | | + <!-- <el-form-item label="用户状态">--> |
| | | + <!-- <el-switch v-model="userForm.status" inline-prompt active-value = 1 inactive-value= 0 active-text="启" inactive-text="禁"></el-switch>--> |
| | | + <!-- </el-form-item>--> |
| | | + <!-- </el-col>--> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | @@ -99,6 +99,7 @@ |
| | | interface roleData {} |
| | | interface dutyData {} |
| | | interface sexData {} |
| | | +interface type {} |
| | | interface UserState { |
| | | title: string; |
| | | disabled: boolean; |
| | | @@ -112,6 +113,7 @@ |
| | | phone: string; |
| | | email: string; |
| | | gender: number | null; |
| | | + type: number | null; |
| | | password: string; |
| | | expireTime: string; |
| | | status: number; |
| | | @@ -124,6 +126,7 @@ |
| | | roleData: Array<roleData>; |
| | | dutyData: Array<dutyData>; |
| | | sexList: Array<sexData>; |
| | | + userTypeList: Array<type>; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | @@ -145,6 +148,7 @@ |
| | | gender: null, // 性别 |
| | | password: '', // 账户密码 |
| | | positionId: null, // 岗位 |
| | | + type: null, // 用户类型 |
| | | expireTime: '', // 账户过期 |
| | | status: 1 // 用户状态 |
| | | }, |
| | | @@ -155,6 +159,7 @@ |
| | | depId: [{ required: true, message: '请选择部门', trigger: 'change' }], |
| | | positionId: [{ required: true, message: '请选择职务', trigger: 'change' }], |
| | | phone: [{ required: true, message: '请填写手机号', trigger: 'blur' }], |
| | | + type: [{ required: true, message: '请填写用户类型', trigger: 'blur' }], |
| | | gender: [{ required: true, message: '请选择性别', trigger: 'change' }], |
| | | expireTime: [{ required: true, message: '请输入账户过期时间', trigger: 'blur' }], |
| | | password: [{ required: true, message: '请输入账户密码', trigger: 'blur' }], |
| | | @@ -165,6 +170,11 @@ |
| | | sexList: [ |
| | | { id: 1, name: '男' }, |
| | | { id: 0, name: '女' } |
| | | + ], |
| | | + userTypeList: [ |
| | | + { id: 1, name: '超级管理员' }, |
| | | + { id: 2, name: '管理员' }, |
| | | + { id: 3, name: '普通员工' } |
| | | ] |
| | | }); |
| | | // 打开弹窗 |
| | | @@ -186,6 +196,7 @@ |
| | | identify: '', |
| | | positionId: null, |
| | | gender: null, |
| | | + type: null, |
| | | password: '', |
| | | expireTime: '', |
| | | status: 1 |
| | | Index: src/views/system/department/component/deptDialog.vue |
| | | IDEA additional info: |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP |
| | | <+><template>\r\n <div class=\"system-add-dept-container\">\r\n <el-dialog :title=\"title\" v-model=\"isShowDialog\" width=\"600px\">\r\n <el-form :model=\"departmentForm\" size=\"default\" label-width=\"90px\">\r\n <el-row :gutter=\"35\">\r\n <el-col :xs=\"24\" :sm=\"24\" :md=\"24\" :lg=\"24\" :xl=\"24\" class=\"mb20\">\r\n <el-form-item label=\"部门等级\">\r\n <el-select v-model=\"departmentForm.depLevel\" placeholder=\"请输入部门等级\" class=\"input-add\" clearable>\r\n <el-option\r\n v-for=\"item in depLevelList\"\r\n :key=\"item.id\"\r\n :label=\"item.name\"\r\n :value=\"item.id\"\r\n ></el-option>\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"24\" :md=\"24\" :lg=\"24\" :xl=\"24\" class=\"mb20\">\r\n <el-form-item label=\"上级部门\">\r\n <el-cascader :options=\"deptData\" class=\"input-add\" :props=\"{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }\" placeholder=\"请选择部门\" clearable v-model=\"departmentForm.parentDepId\"> </el-cascader>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"24\" :md=\"24\" :lg=\"24\" :xl=\"24\" class=\"mb20\">\r\n <el-form-item label=\"部门名称\">\r\n <el-input v-model=\"departmentForm.depName\" class=\"input-add\" placeholder=\"请输入部门名称\" clearable></el-input>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"24\" :md=\"24\" :lg=\"24\" :xl=\"24\" class=\"mb20\">\r\n <el-form-item label=\"部门描述\">\r\n <el-input v-model=\"departmentForm.depInfo\" class=\"input-add\" type=\"textarea\" placeholder=\"请输入部门描述\" maxlength=\"150\"></el-input>\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n </el-form>\r\n <template #footer>\r\n <span class=\"dialog-footer\">\r\n <el-button @click=\"onCancel\" size=\"default\">取 消</el-button>\r\n <el-button type=\"primary\" v-throttle @click=\"onSubmit\" size=\"default\">确 定</el-button>\r\n </span>\r\n </template>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n\r\n<script lang=\"ts\">\r\nimport { ElMessage } from 'element-plus';\r\nimport { reactive, toRefs, onMounted, defineComponent } from 'vue';\r\nimport { departmentApi } from '/@/api/systemManage/department';\r\n\r\n// 定义接口来定义对象的类型\r\ninterface TableDataRow {\r\n name: string;\r\n info: string;\r\n parentId: string;\r\n id: number;\r\n}\r\ninterface DeptSate {\r\n title: string;\r\n isShowDialog: boolean;\r\n departmentForm: {\r\n depName: string;\r\n depInfo: string;\r\n parentDepId: string;\r\n depLevel:null | number\r\n };\r\n deptData: Array<TableDataRow>;\r\n depLevelList: Array<Type>;\r\n}\r\ninterface Type{\r\n id:number;\r\n name:string\r\n}\r\n\r\nexport default defineComponent({\r\n name: 'systemAddDept',\r\n setup(prop, context) {\r\n const state = reactive<DeptSate>({\r\n title: '',\r\n isShowDialog: false,\r\n departmentForm: {\r\n depName: '',\r\n parentDepId: '',\r\n depInfo: '',\r\n depLevel:null,\r\n },\r\n deptData: [], // 部门数据\r\n depLevelList: [\r\n {id:1,name:'公司'},\r\n {id:2,name:'事业部'},\r\n {id:3,name:'车间'},\r\n ] // 部门数据\r\n });\r\n\r\n // 打开弹窗\r\n const openDialog = (type: string, value: any, departmentList: []) => {\r\n state.isShowDialog = true;\r\n state.deptData = JSON.parse(JSON.stringify(departmentList));\r\n if (type === '新增') {\r\n state.title = '新增部门';\r\n state.departmentForm = {\r\n depName: '',\r\n parentDepId: '',\r\n depLevel:null,\r\n depInfo: ''\r\n };\r\n } else {\r\n state.title = '修改部门';\r\n state.departmentForm = JSON.parse(JSON.stringify(value));\r\n }\r\n };\r\n // 关闭弹窗\r\n const closeDialog = () => {\r\n state.isShowDialog = false;\r\n };\r\n // 取消\r\n const onCancel = () => {\r\n closeDialog();\r\n };\r\n // 新增\r\n const onSubmit = async () => {\r\n if (state.title === '新增部门') {\r\n let res = await departmentApi().addDepartment(state.departmentForm);\r\n if (res.data.code === '200') {\r\n ElMessage({\r\n type: 'success',\r\n message: '部门新增成功',\r\n duration: 2000\r\n });\r\n closeDialog();\r\n context.emit('getDepartmentList');\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n } else {\r\n let res = await departmentApi().modDepartment(state.departmentForm);\r\n if (res.data.code === '200') {\r\n ElMessage({\r\n type: 'success',\r\n message: '部门修改成功',\r\n duration: 2000\r\n });\r\n closeDialog();\r\n context.emit('getDepartmentList');\r\n } else {\r\n ElMessage({\r\n type: 'warning',\r\n message: res.data.msg\r\n });\r\n }\r\n }\r\n };\r\n // 初始化部门数据\r\n const initTableData = () => {};\r\n // 页面加载时\r\n onMounted(() => {\r\n initTableData();\r\n });\r\n return {\r\n openDialog,\r\n closeDialog,\r\n onCancel,\r\n onSubmit,\r\n ...toRefs(state)\r\n };\r\n }\r\n});\r\n</script>\r\n |
| | | Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP |
| | | <+>UTF-8 |
| | | =================================================================== |
| | | diff --git a/src/views/system/department/component/deptDialog.vue b/src/views/system/department/component/deptDialog.vue |
| | | --- a/src/views/system/department/component/deptDialog.vue (revision 38f0a9145a29f570331f11505968f90bd1c08646) |
| | | +++ b/src/views/system/department/component/deptDialog.vue (date 1678081020198) |
| | | @@ -7,10 +7,10 @@ |
| | | <el-form-item label="部门等级"> |
| | | <el-select v-model="departmentForm.depLevel" placeholder="请输入部门等级" class="input-add" clearable> |
| | | <el-option |
| | | - v-for="item in depLevelList" |
| | | - :key="item.id" |
| | | - :label="item.name" |
| | | - :value="item.id" |
| | | + v-for="item in depLevelList" |
| | | + :key="item.id" |
| | | + :label="item.name" |
| | | + :value="item.id" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
对比新文件 |
| | |
| | | <changelist name="Uncommitted_changes_before_Update_at_2023_3_9_16_25_[Default_Changelist]" date="1678350639496" recycled="true" deleted="true"> |
| | | <option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2023_3_9_16_25_[Default_Changelist]/shelved.patch" /> |
| | | <option name="DESCRIPTION" value="Uncommitted changes before Update at 2023/3/9 16:25 [Default Changelist]" /> |
| | | </changelist> |
| | |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | // v1 |
| | | getRFIDById: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/SafeCheckRfid/select/getRfidById`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | // v1 |
| | | getAllRFIDList: () => { |
| | | return request({ |
| | |
| | | method: 'post', |
| | | data: value |
| | | }); |
| | | }, |
| | | getByDepId: (value: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/schedule/group/list`, |
| | | method: 'post', |
| | | data: value |
| | | }); |
| | | } |
| | | }; |
| | | } |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="处理人所属车间" prop="exceptionHandlerDepId"> |
| | | <el-cascader @change="getUser" :options="departmentData" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请输入RFID所属车间" clearable class="input-add" v-model="RFIDForm.exceptionHandlerDepId"> </el-cascader> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="异常处理人" prop="exceptionHandlerId"> |
| | | <el-select v-model="RFIDForm.exceptionHandlerId" filterable class="input-add" placeholder="请输入异常处理人"> |
| | | <el-option v-for="item in userList" :key="item.uid" :label="item.realName" :value="item.uid"></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="RFID所属车间" prop="rfidDepartmentId"> |
| | | <el-cascader :options="departmentData" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请输入RFID所属车间" clearable class="input-add" v-model="RFIDForm. rfidDepartmentId"> </el-cascader> |
| | | </el-form-item> |
| | | </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/*" :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> |
| | | |
| | | <script lang="ts"> |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | |
| | | interface stateType { |
| | | isShowRFIDDialog: Boolean; |
| | | RFIDForm: { |
| | | rfid: string; |
| | | rfidName: string; |
| | | rfidImage: string | null; |
| | | rfidDepartmentId: number | null, |
| | | exceptionHandlerId: number | null, |
| | | exceptionHandlerDepId: number | null, |
| | | }; |
| | | title: string; |
| | | dialogVisible: Boolean; |
| | |
| | | RFIDFormRules: {}; |
| | | uploadUrl: string; |
| | | fileList: Array<file>; |
| | | departmentData: []; |
| | | userList: []; |
| | | } |
| | | interface file { |
| | | url: string; |
| | | } |
| | | import { reactive, toRefs, ref } from 'vue'; |
| | | |
| | | import {reactive, toRefs, ref, onMounted} from 'vue'; |
| | | import { RFIDApi } from '/@/api/intellectInspectSystem/RFID'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus'; |
| | | import type { UploadProps, UploadUserFile } from 'element-plus'; |
| | |
| | | RFIDForm: { |
| | | rfid: '', |
| | | rfidName: '', |
| | | rfidDepartmentId: null, |
| | | exceptionHandlerId: null, |
| | | exceptionHandlerDepId: null, |
| | | rfidImage: null |
| | | }, |
| | | uploadUrl: '', |
| | |
| | | RFIDFormRules: { |
| | | rfid: [{ required: true, message: '请填写RFID编码', trigger: 'blur' }], |
| | | rfidName: [{ required: true, message: '请填写RFID名称', trigger: 'change' }], |
| | | riskLevel: [{ required: true, message: '请选择风险等级', trigger: 'change' }], |
| | | location: [{ required: true, message: '请填写区域位置', trigger: 'blur' }] |
| | | rfidDepartmentId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | exceptionHandlerDepId: [{ required: true, message: '请选择', trigger: 'change' }], |
| | | exceptionHandlerId: [{ required: true, message: '请选择', trigger: 'change' }] |
| | | }, |
| | | |
| | | fileList: [] |
| | | fileList: [], |
| | | departmentData: [], |
| | | userList: [] |
| | | }); |
| | | //打开模态框 |
| | | const openRFIDDialog = (type: string, value: object) => { |
| | | const openRFIDDialog = async (type: string, value: object, departmentList: []) => { |
| | | state.fileList = []; |
| | | state.isShowRFIDDialog = true; |
| | | state.departmentData = departmentList; |
| | | setTimeout(() => { |
| | | RFIDFormRef.value.clearValidate(); |
| | | }); |
| | |
| | | state.RFIDForm = { |
| | | rfid: '', |
| | | rfidName: '', |
| | | rfidDepartmentId: null, |
| | | exceptionHandlerId: null, |
| | | exceptionHandlerDepId: null, |
| | | rfidImage: '' |
| | | }; |
| | | } else { |
| | | state.title = '修改RFID'; |
| | | state.RFIDForm = JSON.parse(JSON.stringify(value)); |
| | | debugger |
| | | let res = await RFIDApi().getRFIDById({id:parseInt(value.id)}) |
| | | state.RFIDForm = res.data.data |
| | | getUser() |
| | | if (state.RFIDForm.rfidImage === null) return; |
| | | state.fileList = [{ url: state.RFIDForm.rfidImage }]; |
| | | } |
| | |
| | | }); |
| | | }; |
| | | |
| | | //获取用户列表 |
| | | const getUser = async () => { |
| | | let res = await userApi().getUserLByDepartment(state.RFIDForm.exceptionHandlerDepId); |
| | | if (res.data.code === '200') { |
| | | state.userList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const handlePictureCardPreview = (uploadFile: { url: string }) => { |
| | | state.dialogImageUrl = uploadFile.url!; |
| | | state.dialogVisible = true; |
| | |
| | | // fileList, |
| | | upload, |
| | | getUploadUrl, |
| | | getUser, |
| | | handlePreview, |
| | | beforeRemove, |
| | | submitRFID, |
| | |
| | | <el-table-column type="index" label="序号" width="60" /> |
| | | <el-table-column prop="rfidName" label="RFID名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="rfid" label="RFID编码" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="exceptionHandler" label="异常处理人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="exceptionHandlerPhone" label="异常处理人手机号" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="rfidDepartment" label="RFID所属车间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createUserName" 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> |
| | |
| | | import { RFIDApi } from '/@/api/intellectInspectSystem/RFID'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue'; |
| | | import type { UploadProps, UploadUserFile } from 'element-plus' |
| | | import {departmentApi} from "/@/api/systemManage/department"; |
| | | // 定义接口来定义对象的类型 |
| | | interface TableData { |
| | | quota: string; |
| | |
| | | interface TableDataState { |
| | | RFIDData: { |
| | | data: Array<TableData>; |
| | | departmentList: []; |
| | | total: number; |
| | | loading: boolean; |
| | | params: { |
| | |
| | | const state = reactive<TableDataState>({ |
| | | RFIDData: { |
| | | data: [], |
| | | departmentList: [], |
| | | total: 0, |
| | | loading: false, |
| | | params: { |
| | |
| | | |
| | | // 打开弹窗 |
| | | const onOpenDialogRef = (type: string, value: any) => { |
| | | RFIDDialogRef.value.openRFIDDialog(type, value); |
| | | RFIDDialogRef.value.openRFIDDialog(type, value, state.departmentList); |
| | | }; |
| | | // 删除 |
| | | const onDelProductionDevice = (row: any) => { |
| | |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | const getDepartmentData = async () => { |
| | | let res = await departmentApi().getDepartmentList(); |
| | | if (res.data.code === '200') { |
| | | state.departmentList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const handleSearch = () => { |
| | | initRFIDTableData(); |
| | | }; |
| | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | initRFIDTableData(); |
| | | getDepartmentData(); |
| | | }); |
| | | |
| | | return { |
| | |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="设备区域名称" prop="region"> |
| | | <el-input class="input-length" v-model.trim="facilityAreaForm.region" placeholder="请输入设备区域名称" clearable></el-input> |
| | | <el-input class="input-add" v-model.trim="facilityAreaForm.region" 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="regionTypeId"> |
| | | <el-select class="input-length" v-model="facilityAreaForm.regionTypeId" placeholder="请选择设备区域类型" clearable filterable> |
| | | <el-select class="input-add" v-model="facilityAreaForm.regionTypeId" placeholder="请选择设备区域类型" clearable filterable> |
| | | <el-option v-for="item in facilityAreaTypeList" :key="item.id" :label="item.regionType" :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="regionDepartmentId"> |
| | | <el-cascader :options="departmentData" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请输入RFID所属车间" clearable class="input-add" v-model="facilityAreaForm.regionDepartmentId"> </el-cascader> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import {departmentApi} from "/@/api/systemManage/department"; |
| | | |
| | | interface stateType { |
| | | isShowFacilityAreaDialog: Boolean; |
| | | facilityAreaForm: { |
| | | region: string; |
| | | regionTypeId: number | null; |
| | | regionDepartmentId: number | null; |
| | | }; |
| | | title: string; |
| | | facilityAreaTypeList: Array<facilityAreaTypeState>; |
| | | departmentData: []; |
| | | facilityAreaFormRules: {}; |
| | | } |
| | | interface facilityAreaTypeState { |
| | |
| | | id: number; |
| | | } |
| | | |
| | | import { reactive, toRefs, ref } from 'vue'; |
| | | import {reactive, toRefs, ref, onMounted} from 'vue'; |
| | | import { facilityAreaApi } from '/@/api/intellectInspectSystem/facilityAreaManage'; |
| | | import { ElMessage } from 'element-plus'; |
| | | export default { |
| | |
| | | const state = reactive<stateType>({ |
| | | title: '', |
| | | facilityAreaTypeList: [], |
| | | departmentData: [], |
| | | isShowFacilityAreaDialog: false, |
| | | facilityAreaForm: { |
| | | region: '', |
| | | regionTypeId: null |
| | | regionTypeId: null, |
| | | regionDepartmentId: null |
| | | }, |
| | | facilityAreaFormRules: { |
| | | region: [{ required: true, message: '请填写设备区域名称', trigger: 'blur' }], |
| | | regionTypeId: [{ required: true, message: '请选择设备区域类型', trigger: 'change' }] |
| | | regionTypeId: [{ required: true, message: '请选择设备区域类型', trigger: 'change' }], |
| | | regionDepartmentId: [{ required: true, message: '请选择所属部门', trigger: 'change' }] |
| | | } |
| | | }); |
| | | |
| | |
| | | state.title = '新增设备区域'; |
| | | state.facilityAreaForm = { |
| | | region: '', |
| | | regionTypeId: null |
| | | regionTypeId: null, |
| | | regionDepartmentId: null |
| | | }; |
| | | } else { |
| | | state.title = '修改设备区域'; |
| | |
| | | if (res.data.code === '200') { |
| | | state.facilityAreaForm = JSON.parse(JSON.stringify(res.data.data)); |
| | | } else { |
| | | } |
| | | }) |
| | | .catch((error) => {}); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const getDepartmentData = async () => { |
| | | let res = await departmentApi().getDepartmentList(); |
| | | if (res.data.code === '200') { |
| | | state.departmentData = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | |
| | | } |
| | | }); |
| | | }; |
| | | onMounted(() => { |
| | | getDepartmentData(); |
| | | }) |
| | | |
| | | return { |
| | | ...toRefs(state), |
| | |
| | | <el-table-column type="index" label="序号" width="60" /> |
| | | <el-table-column prop="region" label="设备区域名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="regionType" label="设备区域类型" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="regionDepartment" label="所属部门" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createByUserName" 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> |
| | |
| | | }); |
| | | // 初始化表格数据 |
| | | const initFacilityAreaTableData = async () => { |
| | | debugger |
| | | let res = await facilityAreaApi().getFacilityAreaList(state.facilityAreaData.params); |
| | | if (res.data.code === '200') { |
| | | state.facilityAreaData.data = res.data.data.records; |
| | |
| | | </el-select> |
| | | </div> |
| | | <div class="basic-line"> |
| | | <span>部门:</span> |
| | | <el-cascader class="input-box" :options="departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" |
| | | placeholder="请选择部门" clearable v-model="tableData.params.execDepId" |
| | | @change="changeGroup" |
| | | > </el-cascader> |
| | | </div> |
| | | <div class="basic-line"> |
| | | <span>执行班组:</span> |
| | | <el-select v-model="tableData.params.execClassgroupId" clearable filterable class="input-box" placeholder="执行班组"> |
| | | <el-option v-for="item in classGroupList" :key="item.id" :label="item.groupName" :value="item.id"></el-option> |
| | |
| | | } |
| | | }; |
| | | |
| | | //获取班组 |
| | | const getClassGroupData = async () => { |
| | | let res = await teamManageApi().getRecord({ depIp: null, groupName: null, containGroupMemberEnable: null }); |
| | | if (res.data.code === '200') { |
| | | state.classGroupList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | const changeGroup = async () => { |
| | | if(state.tableData.params.execDepId === null) { |
| | | state.classGroupList = [] |
| | | }else{ |
| | | let res = await departmentApi().getByDepId({depId:state.tableData.params.execDepId}) |
| | | if(res.data.code === '200'){ |
| | | state.classGroupList = res.data.data |
| | | }else{ |
| | | |
| | | } |
| | | } |
| | | }; |
| | | |
| | |
| | | getInspectRecord(); |
| | | getQuotaList(); |
| | | getDepartmentData(); |
| | | getClassGroupData(); |
| | | getInspectTaskPoint(); |
| | | } else { |
| | | getInspectRecord(); |
| | | getQuotaList(); |
| | | getDepartmentData(); |
| | | getClassGroupData(); |
| | | getInspectTaskPoint(); |
| | | } |
| | | }); |
| | |
| | | Plus, |
| | | reset, |
| | | parseNumber, |
| | | changeGroup, |
| | | getInspectRecord, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | |
| | | </el-select> |
| | | </div> |
| | | <div class="basic-line"> |
| | | <span>部门:</span> |
| | | <el-cascader class="input-box" :options="departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" |
| | | placeholder="请选择部门" clearable v-model="tableData.params.execDepId" |
| | | @change="changeGroup" |
| | | > </el-cascader> |
| | | </div> |
| | | <div class="basic-line"> |
| | | <span>执行班组:</span> |
| | | <el-select v-model="tableData.params.execClassgroupId" clearable filterable class="input-box" placeholder="执行班组"> |
| | | <el-option v-for="item in classGroupList" :key="item.id" :label="item.groupName" :value="item.id"></el-option> |
| | |
| | | params: { |
| | | pageIndex: number | null; |
| | | pageSize: number | null; |
| | | execDepId: number | null; |
| | | unitName: string | null; |
| | | workType: number | null; |
| | | createUserId: number | null; |
| | |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | unitName: null, |
| | | execDepId: null, |
| | | workType: null, |
| | | createUserId: null, |
| | | execClassgroupId: null, |
| | |
| | | { id: 3, name: '日' }, |
| | | { id: 4, name: '月' }, |
| | | { id: 5, name: '年' } |
| | | ] |
| | | ], |
| | | }); |
| | | |
| | | //获取巡检任务数据 |
| | |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const changeGroup = async () => { |
| | | if(state.tableData.params.execDepId === null) { |
| | | state.classGroupList = [] |
| | | }else{ |
| | | let res = await departmentApi().getByDepId({depId:state.tableData.params.execDepId}) |
| | | if(res.data.code === '200'){ |
| | | state.classGroupList = res.data.data |
| | | }else{ |
| | | |
| | | } |
| | | } |
| | | }; |
| | | |
| | |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | unitName: null, |
| | | execDepId: null, |
| | | workType: null, |
| | | createUserId: null, |
| | | execClassgroupId: null, |
| | |
| | | Plus, |
| | | reset, |
| | | changeStatus, |
| | | changeGroup, |
| | | parseNumber, |
| | | deleteInspectTask, |
| | | getInspectionTask, |
| | |
| | | <el-form-item label="部门等级"> |
| | | <el-select v-model="departmentForm.depLevel" placeholder="请输入部门等级" class="input-add" clearable> |
| | | <el-option |
| | | v-for="item in depLevelList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | v-for="item in depLevelList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="职务" prop="positionId"> |
| | | <el-select v-model="userForm.positionId" placeholder="请选择" clearable class="w100"> |
| | | <el-option v-for="item in dutyData" :key="item.positionId" :label="item.positionName" :value="item.positionId"> </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="职务" prop="positionId"> |
| | | <el-select v-model="userForm.positionId" placeholder="请选择" clearable class="w100"> |
| | | <el-option v-for="item in dutyData" :key="item.positionId" :label="item.positionName" :value="item.positionId"> </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="手机号" prop="phone"> |
| | |
| | | { id: 0, name: '女' } |
| | | ], |
| | | userTypeList: [ |
| | | { id: 1, name: '超级管理员' }, |
| | | { id: 2, name: '管理员' }, |
| | | { id: 3, name: '普通员工' } |
| | | ] |
| | | { id: 1, name: '超级管理员' }, |
| | | { id: 2, name: '管理员' }, |
| | | { id: 3, name: '普通员工' } |
| | | ], |
| | | }); |
| | | // 打开弹窗 |
| | | const openDialog = (type: string, value: any, departmentList: [], roleList: [], dutyList:[]) => { |
| | |
| | | <el-table-column prop="username" label="用户名" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="realName" label="真实姓名" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gender" label="性别" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-tag type="success" v-if="scope.row.gender == 1">男</el-tag> |
| | | <el-tag type="success" v-else-if="scope.row.gender == 0">女</el-tag> |
| | | </template> |
| | | <template #default="scope"> |
| | | <el-tag type="success" v-if="scope.row.gender == 1">男</el-tag> |
| | | <el-tag type="success" v-else-if="scope.row.gender == 0">女</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="positionId" label="职务" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{ parseNumber(scope.row.positionId) }} |
| | | </template> |
| | | <template #default="scope"> |
| | | {{ parseNumber(scope.row.positionId) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="type" label="职务" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | |
| | | roleList: [], |
| | | dutyList: [], |
| | | props: { |
| | | label: 'depName', |
| | | value: 'depId', |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | label: 'depName', |
| | | value: 'depId', |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | userTypeList: [ |
| | | { id: 1, name: '超级管理员' }, |
| | |
| | | } |
| | | }; |
| | | |
| | | const getDutyData = async () => { |
| | | let res = await dutyApi().getAllList({positionName: '',positionCode: ''}); |
| | | if (res.data.code === '200') { |
| | | state.dutyList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | const getDutyData = async () => { |
| | | let res = await dutyApi().getAllList({positionName: '',positionCode: ''}); |
| | | if (res.data.code === '200') { |
| | | state.dutyList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // 打开新增修改用户弹窗 |
| | | const onOpenUserDialog = (type: string, value: any) => { |
| | |
| | | }; |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | let a = { name: 1, c: { name: 1 } }; |
| | | let b = Object.assign({}, a); |
| | | b.c.name = 2; |
| | | console.log(a.c.name); |
| | | initUserTableData(); |
| | | getDepartmentData(); |
| | | getRoleData(); |