fix
zhoucong
2022-05-05 41b9a9861ab8693e5ad10398dddeac298b18d7fd
src/views/hiddenDangerRegistration/index.vue
@@ -177,12 +177,13 @@
                >添加</el-button
                >
                <el-button  size="small"
                            @click="deleteBatch"
                >删除</el-button
                >
            </el-col>
        </el-row>
        <el-table :data="tableData" style="width: 100%">
        <el-table :data="tableData" style="width: 100%"  @selection-change="changeBox">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
            <el-table-column prop="number" label="编号" align="center" width="120"></el-table-column>
            <el-table-column prop="check_branch" label="检查部门" align="center" width="120"></el-table-column>
@@ -225,10 +226,15 @@
            <el-table-column prop="DTRisk_level" label="风险等级" align="center"> </el-table-column>
            <el-table-column prop="warningLevel" label="初始警情" align="center"> </el-table-column>
            <el-table-column prop="curWarningLevel" label="当前警情" align="center"> </el-table-column>
            <el-table-column prop="date" label="流程操作" align="center"> </el-table-column>
            <el-table-column prop="date" label="基本操作" align="center">
            <el-table-column prop="date" label="流程操作" align="center"  fixed="right">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text" size="small">点击发送</el-button>
                </template>
            </el-table-column>
            <el-table-column prop="date" label="基本操作" align="center"  fixed="right">
                <template slot-scope="scope">
                    <el-button @click="updateClick(scope.row)" type="text" size="small">编辑</el-button>
                    <el-button @click="deleteClick(scope.row)" type="text" size="small">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
@@ -248,11 +254,12 @@
    </div>
</template>
<script>
import {getPageList} from "@/api/sgyhpczl/hiddenDangerRegistration";
import {getPageList,delDanger} from "@/api/sgyhpczl/hiddenDangerRegistration";
import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr} from "@/api/sgyhpczl/initSelect";
export default {
    data() {
        return {
            selectedList:[],
            reList:[{label:"未关联",value:0}],
            llrList:[],
            options: [],
@@ -288,6 +295,39 @@
        this.initYHBM()
    },
    methods:{
        deleteBatch(){
            if(this.selectedList==null ||this.selectedList.length==0 ){
                this.$message({type:'warning', message:'至少选中一条数据', duration:3000})
                return
            }
            var ids=this.selectedList.map((obj) => {
                return obj.id
            }).join(",")
            this.$confirm('确认删除吗','提示', {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning'
            })
                .then(()=>{
                    delDanger(ids).then(() => {
                        this.getPageList()
                        this.$notify({
                            title: "成功",
                            message: "删除成功",
                            type: "success",
                            duration: 2000,
                        });
                    });
                })
                .catch(error =>{
                });
        },
        changeBox(val){
            this.selectedList = []
            val.forEach((item) => {
                this.selectedList.push(item)
            })
        },
        initLlr(){
            initLlr().then(res=>{
                if (res.data.ok==1){
@@ -418,18 +458,42 @@
                }
            })
        },
        updateClick(row){
            this.$router.push({
                path:"/hiddenDangerAdd?id="+row.id
            })
        },
        jump(){
            this.$router.push({
                path:"/hiddenDangerAdd"
            })
        },
        // 发送隐患单跳转
        handleClick(){
        handleClick(row){
            this.$router.push({
                path:"/hiddenDangerList",
                path:"/hiddenDangerList?id="+row.id,
            })
        },
        deleteClick(row){
            this.$confirm('确认删除吗','提示', {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning'
            })
                .then(()=>{
                    delDanger(row.id).then(() => {
                        this.getPageList()
                        this.$notify({
                            title: "成功",
                            message: "删除成功",
                            type: "success",
                            duration: 2000,
                        });
                    });
                })
                .catch(error =>{
                });
        },
    }
};
</script>