From dad957f2d33ba871beeba251e7c51c1e7bb2b1ab Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期四, 02 六月 2022 10:46:33 +0800
Subject: [PATCH] 'lct;

---
 src/views/doublePreventAction/riskLevelManage/controlAction/index.vue |   94 +++++++++++++++++++++++++++++++++++++----------
 1 files changed, 74 insertions(+), 20 deletions(-)

diff --git a/src/views/doublePreventAction/riskLevelManage/controlAction/index.vue b/src/views/doublePreventAction/riskLevelManage/controlAction/index.vue
index 2987144..5ab5ee9 100644
--- a/src/views/doublePreventAction/riskLevelManage/controlAction/index.vue
+++ b/src/views/doublePreventAction/riskLevelManage/controlAction/index.vue
@@ -2,24 +2,46 @@
     <div class="app-container">
         <div class="filter-container">
             <div class="basic_search">
-                <span>单位名称:</span>
-                <el-input v-model="listQuery.filter.riskUnitName" style="width:200px">
+                <span>事件名称:</span>
+                <el-input v-model="listQuery.filter.riskEventName" style="width:200px">
                 </el-input>
             </div>
+            <div class="basic_search">
+                <span>管控方式:</span>
+                <el-select v-model="listQuery.filter.dataSrc" clearable style="width:200px">
+                    <el-option
+                        v-for="item in DataSrcList"
+                        :key="item.id"
+                        :value="item.text"
+                        :label="item.text"
+                    ></el-option>
+                </el-select>
+            </div>
             <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" icon="el-icon-refresh" @click="refreshHandle">搜索</el-button>
-            <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" icon="el-icon-plus" @click="showRiskControlMeasureForm('','新增')">新增</el-button>
+            <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" icon="el-icon-plus" @click="showRiskControlMeasureForm('','新增')" v-show="showCurrent">新增</el-button>
         </div>
         <div class="table_content">
             <el-table
                 v-loading="listLoading"
                 :key="tableKey"
+                @selection-change="handleSelectionChange"
                 :data="riskControlMeasureData"
                 border
                 fit
+                ref="table"
+                :row-key="getRowKey"
                 highlight-current-row
                 style="width: 100%;"
             >
+                 <el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column>
                 <el-table-column label="安全风险事件名称" prop="riskEventId" align="center">
+                    <template slot-scope="scope">
+                        <div v-for="item in riskEventList">
+                            <div v-if="item.id === scope.row.riskEventId">
+                                {{item.riskEventName}}
+                            </div>
+                        </div>
+                    </template>
                 </el-table-column>
                 <el-table-column label="管控方式" prop="dataSrc" align="center">
                 </el-table-column>
@@ -45,8 +67,9 @@
                 </el-table-column>
                 <el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width">
                     <template slot-scope="scope">
-                        <el-button type="text" @click="showRiskControlMeasureForm(scope.row,'编辑')">编辑</el-button>
-                        <el-button type="text" style="color: red" @click="deleteById(scope.row)">删除</el-button>
+                        <el-button type="text" @click="giveValue(scope.row,)" v-show="showOther">选择</el-button>
+                        <el-button type="text" @click="showRiskControlMeasureForm(scope.row,'编辑')" v-show="showCurrent">编辑</el-button>
+                        <el-button type="text" style="color: red" @click="deleteById(scope.row)" v-show="showCurrent">删除</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -65,7 +88,7 @@
             />
             <br>
         </div>
-        <el-dialog :title="title" :visible.sync="riskControlMeasureVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px">
+        <el-dialog :title="title" :visible.sync="riskControlMeasureVisible" append-to-body :close-on-click-modal="false" width="600px">
             <el-form ref="riskControlMeasureForm" :rules="riskControlMeasureFormRules" :model="riskControlMeasureForm" label-position="right" label-width="160px">
                 <el-form-item label="安全风险事件名称" prop="riskEventId">
                 <el-select v-model="riskControlMeasureForm.riskEventId" class="analyseUnit_input">
@@ -88,10 +111,10 @@
                     </el-select>
                 </el-form-item>
                 <el-form-item label="管控方式描述" prop="riskMeasureDesc">
-                    <el-input v-model="riskControlMeasureForm.riskMeasureDesc" class="analyseUnit_input"></el-input>
+                    <el-input type="textarea" :rows="4" v-model="riskControlMeasureForm.riskMeasureDesc" class="analyseUnit_input"></el-input>
                 </el-form-item>
                 <el-form-item label="管控措施分类1" prop="classify1">
-                    <el-select v-model="riskControlMeasureForm.classify1" class="analyseUnit_input" @change="changeClassifyTwoList(val)">
+                    <el-select v-model="riskControlMeasureForm.classify1" class="analyseUnit_input" @change="changeClassifyTwoList()">
                         <el-option
                             v-for="item in classifyOneList"
                             :key="item.id"
@@ -114,12 +137,12 @@
                     <el-input v-model="riskControlMeasureForm.classify3" class="analyseUnit_input"></el-input>
                 </el-form-item>
                 <el-form-item label="隐患排查内容" prop="troubleshootContent">
-                    <el-input v-model="riskControlMeasureForm.troubleshootContent" class="analyseUnit_input"></el-input>
+                    <el-input type="textarea" :rows="4" v-model="riskControlMeasureForm.troubleshootContent" class="analyseUnit_input"></el-input>
                 </el-form-item>
             </el-form>
             <div  align="right">
-                <el-button @click="unitFormVisible = false">取消</el-button>
-                <el-button type="primary" @click="submitAnalyseUnit()">确认</el-button>
+                <el-button @click="riskControlMeasureVisible = false">取消</el-button>
+                <el-button type="primary" @click="submitAnalyseUnit()" v-show="ifShowSelf">确认</el-button>
             </div>
         </el-dialog>
     </div>
@@ -134,13 +157,6 @@
     export default {
         name: 'index',
         filters: {
-            parseMain(type){
-                if(type === 1){
-                    return "是"
-                }else if(type === 0){
-                    return "否"
-                }
-            },
         },
         computed: {
             ...mapGetters([
@@ -155,7 +171,11 @@
                 DataSrcList:[],
                 classifyOneList:[],
                 classifyTwoList:[],
+                riskControlMeasureIdList:[],
                 listLoading: false,
+                showCurrent:true,
+                showOther:false,
+                ifShowSelf:true,
                 pageSize: 10,
                 recordTotal: 0,
                 currentPage: 1,
@@ -194,7 +214,7 @@
                     pageIndex:1,
                     pageSize:10,
                     filter:{
-                        riskUnitName:'',
+                        riskEventName:'',
                     }
                 },
             }
@@ -353,7 +373,6 @@
                         })
                     }
                 })
-
             },
             deleteById(val){
                 this.$confirm('删除此条信息,是否继续','提示',{
@@ -383,6 +402,41 @@
                 this.listQuery.pageIndex = val
                 this.getRiskControlMeasureData()
             },
+
+            ifShowButton (value){
+                this.showCurrent = false
+                this.showOther = true
+                this.listQuery.pageSize = 1000
+                this.getRiskControlMeasureData()
+                this.$refs.table.clearSelection()
+                value.forEach(row => {
+                    this.$refs.table.toggleRowSelection(this.riskControlMeasureData.find(item => {
+                        return row.id === item.id
+                    }) , this.riskControlMeasureData.find(item => {return row.id === item.id}) === undefined ? false :true)
+                })
+
+            },
+
+            handleSelectionChange(val){
+                this.riskControlMeasureIdList = val
+            },
+
+            getRowKey(value){
+                return value.id
+            },
+
+            giveValue(value){
+                this.$emit('giveRiskControlId',this.riskControlMeasureIdList)
+                // this.$emit('giveRiskControlId',value)
+            },
+            showMeasureDetail(value){
+                this.riskControlMeasureVisible = true
+                this.getRiskControlMeasureData().then( ()=>{
+                    let riskControlMeasureForm = this.riskControlMeasureData.find(item => item.id === value.measureId)
+                    this.riskControlMeasureForm = riskControlMeasureForm
+                    this.$emit('closeDialog')
+                })
+            }
         }
     }
 </script>

--
Gitblit v1.9.2