zhanghua
2023-02-10 a4904c4b4f2f47c3187ebf709b0eccabb49017cb
src/views/operate/disposal/casepool/dispatch/index.vue
@@ -6,8 +6,12 @@
                    <span>筛选条件:</span>
                    <div class="option">
                        <el-select v-model="resource" placeholder="请选择">
                            <el-option v-for="item in resourceOptions" :key="item.label" :label="item.label"
                                :value="item.value">
              <el-option
                v-for="item in resourceOptions"
                :key="item.label"
                :label="item.label"
                :value="item.value"
              >
                            </el-option>
                        </el-select>
                    </div>
@@ -20,60 +24,106 @@
        <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
                    border
                    stripe
                    ref="multipleTable" :header-cell-style="{
          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="8">
                        <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="12">
          <el-table-column
            :prop="mystatus === 1 ? 'street' : 'buildingArea'"
            :label="mystatus === 1 ? '所属区域' : '违法建筑面积'"
            min-width="12"
          >
                    </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="12">
          <el-table-column
            :prop="mystatus === 1 ? 'continueTime' : 'materials'"
            :label="mystatus === 1 ? '持续时间' : '违法建筑材料'"
            min-width="12"
          >
                    </el-table-column>
                    <el-table-column prop="operation" label="操作" min-width="15">
                        <template slot-scope="scope">
@@ -86,37 +136,78 @@
                    </el-table-column>
                </el-table>
                <!-- 详情页展示 -->
                <el-dialog :visible.sync="dialogView" 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"
          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" title="上传处置结果" v-if="dialogUpload" :before-close="handleClose">
                    <uploadVio v-if="mystatus === 1" :imageResourceId="imageResourceId" :caseId="caseId"
                        :mycode="caseCode" :vioData="vioData" @closeDialog="closeDialog"></uploadVio>
                    <uploadIll v-else :caseId="caseId" :mycode="caseCode" @closeDialog="closeDialog" :illData="illData">
        <el-dialog
          :visible.sync="dialogUpload"
          title="上传处置结果"
          v-if="dialogUpload"
          :before-close="handleClose"
        >
          <uploadVio
            v-if="mystatus === 1"
            :imageResourceId="imageResourceId"
            :caseId="caseId"
            :mycode="caseCode"
            :vioData="vioData"
            @closeDialog="closeDialog"
          ></uploadVio>
          <uploadIll
            v-else
            :caseId="caseId"
            :mycode="caseCode"
            @closeDialog="closeDialog"
            :illData="illData"
          >
                    </uploadIll>
                </el-dialog>
                <!-- tools -->
                <div class="tools">
                    <div class="funs">
                        <div class="funsItem funs-sp">
                            <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">
                                <el-option v-for="item in options" :key="item.value" :label="item.label"
                                    :value="item.value" :disabled="item.disabled">
              <el-select
                v-model="myIdx"
                placeholder="批量操作"
                @change="selectChange"
              >
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                  :disabled="item.disabled"
                >
                                </el-option>
                            </el-select>
                        </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>
@@ -125,18 +216,21 @@
    </div>
</template>
<script>
import uploadVio from './updateUser/uploadResult/vio'
import uploadIll from "./updateUser/uploadResult/ill"
import MyDetail from '@/components/detail'
import MyIllDetail from '@/components/illdetail'
import uploadVio from "./updateUser/uploadResult/vio";
import uploadIll from "./updateUser/uploadResult/ill";
import MyDetail from "@/components/detail";
import MyIllDetail from "@/components/illdetail";
import casequery from "@/api/operate/basecase";
import helper from '@/utils/mydate'
import helper from "@/utils/mydate";
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 {
@@ -156,7 +250,7 @@
            options: [
                {
                    value: 0,
                    label: '批量操作',
          label: "批量操作",
                    disabled: true,
                },
                // {
@@ -169,39 +263,39 @@
                // },
                {
                    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: "",
            caseCode: null,
            vioData: null,
            illData: null,
            resource: null,
            resourceOptions: RESOURCE_OPTIONS
        }
      resourceOptions: RESOURCE_OPTIONS,
    };
    },
    created() {
        this.statusArr[0] = 6;
        this.typeList.forEach(item => {
    this.typeList.forEach((item) => {
            if (item.checked) {
                this.statusArr[1] = item.value;
            }
        })
    });
        this.getUserList();
    },
    methods: {
@@ -213,15 +307,15 @@
        // 批量删除
        mulDelete(idArr) {
            this.$axios({
                method: 'delete',
                url: 'sccg/base_case/batch_case_delete?ids=' + idArr,
            }).then(res => {
        method: "delete",
        url: "sccg/base_case/batch_case_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) {
@@ -233,17 +327,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.id);
            })
      });
            this.all = list.length === this.tableData.length;
        },
        // 全选
@@ -252,28 +346,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() {
@@ -282,20 +375,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();
@@ -303,9 +397,9 @@
        // 设置表格斑马纹
        tableRowClassName({ row, rowIndex }) {
            if ((rowIndex + 1) % 2 === 0) {
                return 'warning-row';
        return "warning-row";
            } else {
                return 'success-row';
        return "success-row";
            }
        },
        // 当前页改变触发事件
@@ -314,12 +408,12 @@
            this.getUserList();
        },
        handleClose(done) {
            this.$confirm('确认关闭?')
                .then(_ => {
      this.$confirm("确认关闭?")
        .then((_) => {
                    this.dialogUpload = false;
                    done();
                })
                .catch(_ => { });
        .catch((_) => {});
        },
        async JumpView(data) {
            await this.getEventInfo(data.code);
@@ -327,22 +421,22 @@
        // 获取案件信息
        async getEventInfo(code) {
            await 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;
                })
      });
        },
        async openDialog(data) {
            await casequery.getBaseCaseDetail(data.code)
      await casequery
        .getBaseCaseDetail(data.code)
                .then(({ baseCase, currentSitVo, filesPictureVo, handlePassVo }) => {
                    this.vioData = currentSitVo;
                    this.illData = currentSitVo;
                    this.imageResourceId = filesPictureVo.imageResources[0]?.id;
                })
                .catch(err => this.$message.error(err))
        .catch((err) => this.$message.error(err));
            this.dialogUpload = true;
            this.caseId = data.id;
            this.caseCode = data.code;
@@ -355,15 +449,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;
@@ -392,7 +486,6 @@
                        //border: 1px solid #17324c;
                    }
                }
            }
            .findBtn {
@@ -462,7 +555,7 @@
            //padding: 0 20px;
            .funs-sp {
              border: 1px solid #DCDFE6;
        border: 1px solid #dcdfe6;
            }
            .funs {
@@ -493,7 +586,6 @@
                        color: #4b9bb7;
                    }
                }
            }
            .pagination {
@@ -503,7 +595,6 @@
                justify-content: center;
                .el-pagination {
                    &::v-deep li,
                    &::v-deep .btn-prev,
                    &::v-deep .btn-next {
@@ -531,9 +622,7 @@
                .el-checkbox {
                    // display: none;
                }
            }
            .operation {
                display: flex;