From 3c5ca2f8ce690f2c8808548e5ce5f69da296de10 Mon Sep 17 00:00:00 2001 From: Your Name <123456> Date: 星期三, 17 八月 2022 09:12:33 +0800 Subject: [PATCH] lct --- src/views/specialWorkSystem/workFlow/approveBasic/index.vue | 108 +++++++++++++++++++++++------------------------------ 1 files changed, 47 insertions(+), 61 deletions(-) diff --git a/src/views/specialWorkSystem/workFlow/approveBasic/index.vue b/src/views/specialWorkSystem/workFlow/approveBasic/index.vue index 6841635..8720d1f 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> @@ -28,7 +26,8 @@ </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,7 @@ type: 'warning' }) .then(async () => { - let res = await approveBasicApi().deleteApproveBasic({ id: row.id }); + let res = await approveBasicApi().deleteApproveBasic(state.deleteList); if (res.data.code === '200') { ElMessage({ type: 'success', @@ -228,6 +215,12 @@ } }) .catch(() => {}); + }; + + const handleSelectionChange = (val: Array<ruleType>) => { + state.deleteList.ids = val.map((item) => { + return item.ruleStandId; + }); }; const openApproveBasicDialog = (type: string, value: {}) => { @@ -259,12 +252,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,6 +272,7 @@ Plus, reset, parseNumber, + handleSelectionChange, deleteApproveBasic, getInspectionTask, onHandleSizeChange, @@ -419,13 +411,7 @@ 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) { -- Gitblit v1.9.2