zhanghua
2023-02-10 a4904c4b4f2f47c3187ebf709b0eccabb49017cb
src/views/operate/disposal/casepool/notDeal/index.vue
@@ -5,9 +5,17 @@
                <div class="search">
                    <span>筛选条件:</span>
                    <div class="option">
                        <el-select v-model="mystatus" placeholder="违规" @change="setMystatus">
                            <el-option v-for="item in resourceOptions" :key="item.label" :label="item.label"
                                :value="item.value">
            <el-select
              v-model="mystatus"
              placeholder="违规"
              @change="setMystatus"
            >
              <el-option
                v-for="item in resourceOptions"
                :key="item.label"
                :label="item.label"
                :value="item.value"
              >
                            </el-option>
                        </el-select>
                    </div>
@@ -20,8 +28,14 @@
        <main>
            <div class="mainContent">
                <div class="type-nav">
                    <div @click="changeTypeChecked(index)" v-for="(item,index) in typeList" :key="item.name"
                        :class="[item.checked ? 'is-active':'','type-item']">{{item.name}}</div>
          <div
            @click="changeTypeChecked(index)"
            v-for="(item, index) in typeList"
            :key="item.name"
            :class="[item.checked ? 'is-active' : '', 'type-item']"
          >
            {{ item.name }}
          </div>
                </div>
                <!-- 数据展示 -->
                <el-table
@@ -30,42 +44,90 @@
                    ref="multipleTable"
                    :header-cell-style="{
                        // background:'#06122c',
                         'background':'#F5F5F5',
                        'font-weight':'650','line-height':'45px'}"
                    :data="tableData" style="width: 100%" :row-class-name="tableRowClassName"
                    @selection-change="tableChange">
                    <el-table-column type="selection" min-width="5">
                    </el-table-column>
            background: '#F5F5F5',
            'font-weight': '650',
            'line-height': '45px',
          }"
          :data="tableData"
          style="width: 100%"
          :row-class-name="tableRowClassName"
          @selection-change="tableChange"
        >
          <el-table-column type="selection" min-width="5"> </el-table-column>
                    <el-table-column prop="code" label="事件编号" min-width="18">
                        <template slot-scope="scope">
                            <el-link @click="JumpView(scope.row)">{{scope.row.code}}</el-link>
              <el-link @click="JumpView(scope.row)">{{
                scope.row.code
              }}</el-link>
                        </template>
                    </el-table-column>
                    <el-table-column prop="eventSource" label="问题来源" min-width="7">
                        <template slot-scope="scope">
                            <span>{{ scope.row.eventSource === 2 ? '人工上报' : '视频巡查' }}</span>
              <span>{{
                scope.row.eventSource === 2 ? "人工上报" : "视频巡查"
              }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column :prop="mystatus === 1 ? 'category' :'category'" :label="mystatus===1 ? '大类名称' : '违建类别'" :min-width="mystatus===1?'10':'20'">
          <el-table-column
            :prop="mystatus === 1 ? 'category' : 'category'"
            :label="mystatus === 1 ? '大类名称' : '违建类别'"
            :min-width="mystatus === 1 ? '10' : '20'"
          >
                    </el-table-column>
                    <el-table-column :prop="mystatus === 1 ? 'type' :'site'" :label="mystatus===1 ? '小类名称' : '违建地点'" min-width="10">
          <el-table-column
            :prop="mystatus === 1 ? 'type' : 'site'"
            :label="mystatus === 1 ? '小类名称' : '违建地点'"
            min-width="10"
          >
                    </el-table-column>
                    <el-table-column :prop="mystatus === 1 ? 'actionCause' :'communityId'" :label="mystatus===1 ? '案由' : '所属社区'" min-width="10">
          <el-table-column
            :prop="mystatus === 1 ? 'actionCause' : 'communityId'"
            :label="mystatus === 1 ? '案由' : '所属社区'"
            min-width="10"
          >
                    </el-table-column>
                    <el-table-column :prop="mystatus === 1 ? 'site' :''" :label="mystatus===1 ? '报警点位' : '违法建筑长、宽、高'" :min-width="mystatus===1?'10' :'20' ">
          <el-table-column
            :prop="mystatus === 1 ? 'site' : ''"
            :label="mystatus === 1 ? '报警点位' : '违法建筑长、宽、高'"
            :min-width="mystatus === 1 ? '10' : '20'"
          >
                        <template slot-scope="scope">
                            <div v-if="mystatus ===2"><span>{{scope.row.buildingLength+'米'+'、'+ scope.row.buildingWidth+'米'+'、'+scope.row.buildingHigh+'米'}}</span></div>
              <div v-if="mystatus === 2">
                <span>{{
                  scope.row.buildingLength +
                  "米" +
                  "、" +
                  scope.row.buildingWidth +
                  "米" +
                  "、" +
                  scope.row.buildingHigh +
                  "米"
                }}</span>
              </div>
                            <div v-else>{{scope.row.site}}</div>
                        </template>
                    </el-table-column>
                    <el-table-column :prop="mystatus === 1 ? 'street' :'buildingArea'" :label="mystatus===1 ? '所属区域' : '违法建筑面积'" min-width="10">
          <el-table-column
            :prop="mystatus === 1 ? 'street' : 'buildingArea'"
            :label="mystatus === 1 ? '所属区域' : '违法建筑面积'"
            min-width="10"
          >
                    </el-table-column>
                    <el-table-column prop="alarmTime" label="报警时间" min-width="15" v-if="mystatus===1">
          <el-table-column
            prop="alarmTime"
            label="报警时间"
            min-width="15"
            v-if="mystatus === 1"
          >
                        <template slot-scope="scope">
                            <span>{{filterTime(scope.row.alarmTime)}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column :prop="mystatus === 1 ? 'continueTime' :'materials'" :label="mystatus===1 ? '持续时间' : '违法建筑材料'" min-width="10">
          <el-table-column
            :prop="mystatus === 1 ? 'continueTime' : 'materials'"
            :label="mystatus === 1 ? '持续时间' : '违法建筑材料'"
            min-width="10"
          >
                    </el-table-column>
                    <el-table-column prop="operation" label="操作" min-width="20">
                        <template slot-scope="scope">
@@ -76,25 +138,47 @@
                    </el-table-column>
                </el-table>
                <!-- 详情页展示 -->
                <el-dialog :visible.sync="dialogView" width="60%" title="基础信息(人工)" v-if="dialogView"
                    :before-close="handleClose">
                    <MyDetail :info=info v-if="mystatus===1"></MyDetail>
                    <MyIllDetail :info=info v-else></MyIllDetail>
        <el-dialog
          :visible.sync="dialogView"
          width="60%"
          title="基础信息(人工)"
          v-if="dialogView"
          :before-close="handleClose"
        >
          <MyDetail :info="info" v-if="mystatus === 1"></MyDetail>
          <MyIllDetail :info="info" v-else></MyIllDetail>
                </el-dialog>
                <!-- 上传页面 -->
                <el-dialog :visible.sync="dialogUpload" width="60%" title="上传处置结果"
                    v-if="dialogUpload" :before-close="handleClose">
                    <uploadVio v-if="mystatus === 0" :caseId="caseId" @closeDialog="closeDialog"></uploadVio>
                    <uploadIll v-else :caseId="caseId" @closeDialog="closeDialog"></uploadIll>
        <el-dialog
          :visible.sync="dialogUpload"
          width="60%"
          title="上传处置结果"
          v-if="dialogUpload"
          :before-close="handleClose"
        >
          <uploadVio
            v-if="mystatus === 0"
            :caseId="caseId"
            @closeDialog="closeDialog"
          ></uploadVio>
          <uploadIll
            v-else
            :caseId="caseId"
            @closeDialog="closeDialog"
          ></uploadIll>
                </el-dialog>
                <!-- tools -->
                <div class="tools">
                    <div class="funs">
                        <div class="funsItem funs-sp funs-first">
                            <el-checkbox v-model="all" @change="selectAll()">全选</el-checkbox>
              <el-checkbox v-model="all" @change="selectAll()"
                >全选</el-checkbox
              >
                        </div>
                        <div class="funsItem funs-sp">
                            <el-checkbox v-model="unsame" @change="disSame(tableData)">反选</el-checkbox>
              <el-checkbox v-model="unsame" @change="disSame(tableData)"
                >反选</el-checkbox
              >
                        </div>
                        <!-- <div class="funsItem">
                            <el-select v-model="myIdx" placeholder="批量操作" @change="selectChange" disabled>
@@ -105,8 +189,14 @@
                        </div> -->
                    </div>
                    <div class="pagination">
                        <el-pagination background :current-page="currentPage" layout="prev, pager, next"
                            :total="totalNum" :page-size="pageSize" @current-change="changeCurrentPage">
            <el-pagination
              background
              :current-page="currentPage"
              layout="prev, pager, next"
              :total="totalNum"
              :page-size="pageSize"
              @current-change="changeCurrentPage"
            >
                        </el-pagination>
                    </div>
                </div>
@@ -115,17 +205,20 @@
    </div>
</template>
<script>
import uploadVio from './updateUser/uploadResult/vio'
import uploadIll from "./updateUser/uploadResult/ill"
import MyDetail from '@/components/detail'
import helper from '@/utils/mydate'
import MyIllDetail from '@/components/illdetail'
import uploadVio from "./updateUser/uploadResult/vio";
import uploadIll from "./updateUser/uploadResult/ill";
import MyDetail from "@/components/detail";
import helper from "@/utils/mydate";
import MyIllDetail from "@/components/illdetail";
import basecase from "@/api/operate/basecase";
import { RESOURCE_OPTIONS } from "@/utils/helper";
export default {
    components: {
        uploadVio,uploadIll,MyDetail,MyIllDetail
    uploadVio,
    uploadIll,
    MyDetail,
    MyIllDetail,
    },
    data() {
        return {
@@ -144,49 +237,49 @@
            options: [
                {
                    value: 0,
                    label: '批量操作',
          label: "批量操作",
                    disabled: true,
                },
                {
                    value: 1,
                    label: '批量启用',
          label: "批量启用",
                },
                {
                    value: 2,
                    label: '批量禁用',
          label: "批量禁用",
                },
                {
                    value: 3,
                    label: '批量删除',
                }
          label: "批量删除",
        },
            ],
            tempList: [],
            typeList: [
                {
                    name: '违规',
          name: "违规",
                    value: 1,
                    checked: true
          checked: true,
                },
                {
                    name: '违建',
          name: "违建",
                    value: 2,
                    checked: false,
                },
            ],
            statusArr:[],
            mystatus:1,
            caseId:'',
      caseId: "",
          resource: null,
          resourceOptions: RESOURCE_OPTIONS
        }
      resourceOptions: RESOURCE_OPTIONS,
    };
    },
    created() {
        this.statusArr[0] = 4;
        this.typeList.forEach(item => {
    this.typeList.forEach((item) => {
            if (item.checked) {
                this.statusArr[1] = item.value;
            }
        })
    });
        this.getUserList();
    },
    methods: {
@@ -199,15 +292,15 @@
        // 批量删除
        mulDelete(idArr){
            this.$axios({
                method:'delete',
                url:'sccg/violations/batch_delete?ids='+idArr,
            }).then(res=>{
        method: "delete",
        url: "sccg/violations/batch_delete?ids=" + idArr,
      }).then((res) => {
                this.getUserList();
                this.$message({
                    message:res.message,
                    type:res.code === 200 ? 'success' : 'warning'
                })
            })
          type: res.code === 200 ? "success" : "warning",
        });
      });
        },
        // 执行下拉框操作
        selectChange(list) {
@@ -219,17 +312,17 @@
            } else {
                this.myIdx = this.preMyIdx;
                this.$message({
                    type: 'warning',
                    message: '您还没选中任何数据',
                })
          type: "warning",
          message: "您还没选中任何数据",
        });
            }
        },
        // 监听表格
        tableChange(list) {
            this.tempList = [];
            list.forEach(item => {
      list.forEach((item) => {
                this.tempList.push(item.code);
            })
      });
            this.all = list.length === this.tableData.length;
        },
        // 全选
@@ -238,28 +331,27 @@
        },
        // 反选
        disSame(list) {
            list.forEach(row => {
                this.$refs.multipleTable.toggleRowSelection(row)
            })
      list.forEach((row) => {
        this.$refs.multipleTable.toggleRowSelection(row);
      });
        },
        // 删除单条数据
        handleDelete({ number }) {
            this.$confirm('确认删除?')
                .then(_ => {
      this.$confirm("确认删除?")
        .then((_) => {
                    this.$axios({
                        method: 'delete',
            method: "delete",
                        url: `sccg/violations/delete?id=${number}`,
                    })
                        .then(res => {
          }).then((res) => {
                            this.$message({
                                type: res.code === 200 ? 'success' : 'warning',
                                message: res.message
                            })
              type: res.code === 200 ? "success" : "warning",
              message: res.message,
            });
                            this.getUserList();
          });
                        })
                })
                .catch(_ => {  });
        .catch((_) => {});
        },
        // 获取用户列表
        getUserList() {
@@ -268,20 +360,21 @@
            state: this.statusArr[0] ?? null,
            size: this.pageSize,
            resource: this.resource,
            type: this.statusArr[1] ?? null
          }
          basecase.baseCasePoolList(params)
        type: this.statusArr[1] ?? null,
      };
      basecase
        .baseCasePoolList(params)
              .then(({ records, total }) => {
                this.tableData = records;
                this.totalNum = total;
              })
              .catch(err => this.$message.error(err))
        .catch((err) => this.$message.error(err));
        },
        // 更改违规/违建
        changeTypeChecked(idx) {
            this.typeList.forEach((item, index) => {
                item.checked = index === idx;
            })
      });
            this.mystatus = idx + 1;
            this.statusArr[1] = this.typeList[idx].value;
            this.getUserList();
@@ -289,9 +382,9 @@
        // 设置表格斑马纹
        tableRowClassName({ row, rowIndex }) {
            if ((rowIndex + 1) % 2 === 0) {
                return 'warning-row';
        return "warning-row";
            } else {
                return 'success-row';
        return "success-row";
            }
        },
        // 当前页改变触发事件
@@ -300,13 +393,13 @@
            this.getUserList();
        },
        handleClose(done) {
            this.$confirm('确认关闭?')
                .then(_ => {
      this.$confirm("确认关闭?")
        .then((_) => {
                    this.dialogUpload = false;
                    // this.dialogUpdate = false;
                    done();
                })
                .catch(_ => { });
        .catch((_) => {});
        },
        async JumpView(data){
            await this.getEventInfo(data.code);
@@ -314,13 +407,12 @@
        // 获取案件信息
        getEventInfo(code){
            this.$axios({
                method:'get',
                url:`sccg/base_case/baseCaseDetail/${code}`
            })
            .then(res=>{
        method: "get",
        url: `sccg/base_case/baseCaseDetail/${code}`,
      }).then((res) => {
                this.info = res.data;
                this.dialogView = true;
            })
      });
        },
        opernDialog(data){
            this.dialogUpload = true;
@@ -329,23 +421,22 @@
        // 重新处置
        handleReset({id}){
            this.$axios({
                method:'put',
                url:'sccg/base_case/case_status_update?caseId='+id+'&state=0'
            })
            .then(res=>{
        method: "put",
        url: "sccg/base_case/case_status_update?caseId=" + id + "&state=0",
      }).then((res) => {
                if(res.code === 200){
                    this.$message({
                        type:'success',
                        message:'处置成功',
                    })
            type: "success",
            message: "处置成功",
          });
                    this.getUserList();
                }else{
                    this.$message({
                        type:'error',
                        message:'操作失败'
                    })
            type: "error",
            message: "操作失败",
          });
                }
            })
      });
        },
        // 关闭上传界面
        closeDialog({flag}){
@@ -353,15 +444,15 @@
        },
        filterTime(time){
            return helper(time);
        }
    }
}
    },
  },
};
</script>
<style lang="scss" scoped>
.userList {
    text-align: left;
    padding: 10px 20px;
    color: #4b9bb7;
  // color: #4b9bb7;
  border: 1px solid #ccc;
    header {
        // background-color: #09152f;
@@ -385,7 +476,6 @@
                    flex: 2;
                    color: #1d3f57;
                }
            }
            .findBtn {
@@ -451,7 +541,7 @@
                margin-left: 0!important;
              }
                .funs-sp{
                  border: 1px solid #DCDFE6;
          border: 1px solid #dcdfe6;
                }
                .funsItem {
                    line-height: 28px;
@@ -478,7 +568,6 @@
                        color: #4b9bb7;
                    }
                }
            }
            .pagination {
@@ -488,7 +577,6 @@
                justify-content: center;
                .el-pagination {
                    &::v-deep li,
                    &::v-deep .btn-prev,
                    &::v-deep .btn-next {