From 23f1bf22c42a904c05cee63e10c9fd8b60dfe8f5 Mon Sep 17 00:00:00 2001 From: Admin <978517621@qq.com> Date: 星期二, 20 九月 2022 14:54:56 +0800 Subject: [PATCH] Default Changelist --- src/views/specialWorkSystem/workFlow/approveBasic/index.vue | 145 ++++++++++++++++++++++++++---------------------- 1 files changed, 78 insertions(+), 67 deletions(-) diff --git a/src/views/specialWorkSystem/workFlow/approveBasic/index.vue b/src/views/specialWorkSystem/workFlow/approveBasic/index.vue index 6841635..9f2ec17 100644 --- a/src/views/specialWorkSystem/workFlow/approveBasic/index.vue +++ b/src/views/specialWorkSystem/workFlow/approveBasic/index.vue @@ -3,16 +3,14 @@ <div style="height: 100%"> <el-row class="homeCard"> <div class="basic-line"> - <span>任务类型:</span> - <el-select v-model="tableData.params.workType" clearable filterable class="input-box" placeholder="任务类型"> - <el-option v-for="item in workTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + <span>标准类型:</span> + <el-select v-model="tableData.params.searchParams.ruleStandType" clearable filterable class="input-box" placeholder="标准类型"> + <el-option v-for="item in ruleStandTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> </el-select> </div> <div class="basic-line"> - <span>执行班组:</span> - <el-select v-model="tableData.params.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> - </el-select> + <span>标题:</span> + <el-input v-model.trim="tableData.params.searchParams.title" clearable filterable class="input-box" placeholder="标题"> </el-input> </div> <div style="padding-bottom: 10px"> <el-button type="primary" @click="getInspectionTask">查询</el-button> @@ -23,12 +21,13 @@ <div class="main-card"> <el-row class="cardTop"> <el-col :span="12" class="mainCardBtn"> - <el-button type="primary" :icon="Plus" size="default" @click="openApproveBasicDialog('新增', {})">新建</el-button> - <!-- <el-button type="danger" :icon="Delete" size="default" plain>删除</el-button>--> + <el-button type="primary" :icon="Plus" size="default" @click="openApproveBasicDialog('新增', {})">新增</el-button> + <el-button type="danger" :icon="Delete" size="default" @click="deleteMoreApproveBasic" plain>批量删除</el-button> </el-col> <el-button type="primary" :icon="Refresh" size="default" /> </el-row> - <el-table ref="multipleTableRef" :data="tableData.approveBasicData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }"> + <el-table ref="multipleTableRef" :data="tableData.approveBasicData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" /> <el-table-column property="title" label="标题" /> <el-table-column property="ruleStandType" label="标准类型"> <template #default="scope"> @@ -43,13 +42,13 @@ {{ parseNumber(scope.row.minValMatchPattern, '最低值') }} </span> <span> - {{scope.row.minVal}} + {{ scope.row.minVal }} </span> </template> </el-table-column> <el-table-column property="maxVal" label="最高值"> <template #default="scope"> - <span> + <span> {{ parseNumber(scope.row.maxValMatchPattern, '最高值') }} </span> <span> @@ -58,10 +57,10 @@ </template> </el-table-column> <el-table-column property="info" label="描述" /> - <el-table-column prop="createUserName" label="创建人" show-overflow-tooltip></el-table-column> + <el-table-column prop="createUname" label="创建人" show-overflow-tooltip></el-table-column> <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> - <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> + <el-table-column prop="modifiedUname" label="最后修改人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtModified" label="最后修改时间" show-overflow-tooltip></el-table-column> <el-table-column property="status" label="状态" width="60" /> <el-table-column fixed="right" label="操作" align="center" width="300"> <template #default="scope"> @@ -71,20 +70,8 @@ </template> </el-table-column> </el-table> - <br> - <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> - + <br /> + <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> </div> </div> </div> @@ -114,25 +101,25 @@ params: { pageIndex: number | null; pageSize: number | null; - unitName: string | null; - workType: number | null; - createUserId: number | null; - execClassgroupId: number | null; - checkCycle: number | null; - checkCycleUnit: number | null; + searchParams: { + ruleStandType: number | null; + title: string | null; + }; }; }; ruleStandTypeList: Array<type>; typeList: Array<type>; typeTwoList: Array<type>; + deleteList: { + ids: Array<number>; + }; } interface type { id: number; name: string; } -interface classGroup { - id: number; - groupName: string; +interface ruleType { + ruleStandId: number; } export default { name: 'index', @@ -147,12 +134,10 @@ params: { pageIndex: 1, pageSize: 10, - unitName: null, - workType: null, - createUserId: null, - execClassgroupId: null, - checkCycle: null, - checkCycleUnit: null + searchParams: { + ruleStandType: null, + title: null + } } }, ruleStandTypeList: [ @@ -162,19 +147,21 @@ { id: 4, name: '硫化氢浓度' }, { id: 5, name: '温度' }, { id: 6, name: '压力' }, - { id: 7, name: '震动' }, + { id: 7, name: '震动' } ], - typeList:[ + typeList: [ { id: 1, name: '大于' }, { id: 2, name: '等于' }, - { id: 4, name: '大于等于' }, + { id: 4, name: '大于等于' } ], - typeTwoList:[ + typeTwoList: [ { id: 3, name: '小于' }, { id: 2, name: '等于' }, - { id: 5, name: '小于等于' }, + { id: 5, name: '小于等于' } ], - + deleteList: { + ids: [] + } }); //获取巡检任务数据 @@ -212,7 +199,34 @@ type: 'warning' }) .then(async () => { - let res = await approveBasicApi().deleteApproveBasic({ id: row.id }); + let res = await approveBasicApi().deleteApproveBasic({ ids: [row.ruleStandId] }); + if (res.data.code === '200') { + state.deleteList.ids = []; + ElMessage({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await getInspectionTask(); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }; + + // 批量删除 + const deleteMoreApproveBasic = (row: any) => { + ElMessageBox.confirm(`此操作将永久删除这些标准项,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await approveBasicApi().deleteApproveBasic(state.deleteList); if (res.data.code === '200') { ElMessage({ type: 'success', @@ -228,6 +242,12 @@ } }) .catch(() => {}); + }; + + const handleSelectionChange = (val: Array<ruleType>) => { + state.deleteList.ids = val.map((item) => { + return item.ruleStandId; + }); }; const openApproveBasicDialog = (type: string, value: {}) => { @@ -259,12 +279,10 @@ state.tableData.params = { pageIndex: 1, pageSize: 10, - unitName: null, - workType: null, - createUserId: null, - execClassgroupId: null, - checkCycle: null, - checkCycleUnit: null + searchParams: { + ruleStandType: null, + title: null + } }; }; @@ -281,7 +299,9 @@ Plus, reset, parseNumber, + handleSelectionChange, deleteApproveBasic, + deleteMoreApproveBasic, getInspectionTask, onHandleSizeChange, onHandleCurrentChange, @@ -296,7 +316,7 @@ <style scoped lang="scss"> $homeNavLengh: 8; .home-container { - height: calc(100vh - 114px); + height: calc(100vh - 144px); box-sizing: border-box; overflow: hidden; .homeCard { @@ -418,15 +438,6 @@ border: 2px solid #0098f5; color: #0098f5; } -} -.el-input { - width: 100% !important; -} -:deep(.el-date-editor) { - width: 100%; -} -.el-select { - width: 100%; } :deep(.el-textarea.is-disabled .el-textarea__inner) { background-color: var(--el-card-bg-color); -- Gitblit v1.9.2