odc.xiaohui
2023-02-09 f38274ed165590469eeed1329aba1a2852fe4190
src/views/operate/management/myIndex/index.vue
@@ -24,48 +24,102 @@
                    border
                    stripe
                    ref="multipleTable"
                    :header-cell-style="{ '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>
          :header-cell-style="{
            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="myproblem === 1 ? 'category' :'category'" :label="myproblem===1 ? '大类名称' : '违建类别'" :min-width="myproblem===1?'10':'20'">
          <el-table-column
            :prop="myproblem === 1 ? 'category' : 'category'"
            :label="myproblem === 1 ? '大类名称' : '违建类别'"
            :min-width="myproblem === 1 ? '10' : '20'"
          >
                    </el-table-column>
                    <el-table-column :prop="myproblem === 1 ? 'type' :'site'" :label="myproblem===1 ? '小类名称' : '违建地点'" min-width="10">
          <el-table-column
            :prop="myproblem === 1 ? 'type' : 'site'"
            :label="myproblem === 1 ? '小类名称' : '违建地点'"
            min-width="10"
          >
                    </el-table-column>
                    <el-table-column :prop="myproblem === 1 ? 'actionCause' :'communityId'" :label="myproblem===1 ? '案由' : '所属社区'" min-width="10">
          <el-table-column
            :prop="myproblem === 1 ? 'actionCause' : 'communityId'"
            :label="myproblem === 1 ? '案由' : '所属社区'"
            min-width="10"
          >
                    </el-table-column>
                    <el-table-column :prop="myproblem === 1 ? 'site' :''" :label="myproblem===1 ? '报警点位' : '违法建筑长、宽、高'" :min-width="myproblem===1?'10' :'20' ">
          <el-table-column
            :prop="myproblem === 1 ? 'site' : ''"
            :label="myproblem === 1 ? '报警点位' : '违法建筑长、宽、高'"
            :min-width="myproblem === 1 ? '10' : '20'"
          >
                        <template slot-scope="scope">
                            <div v-if="myproblem ===2"><span>{{scope.row.buildingLength+'米'+'、'+ scope.row.buildingWidth+'米'+'、'+scope.row.buildingHigh+'米'}}</span></div>
              <div v-if="myproblem === 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="myproblem === 1 ? 'street' :'buildingArea'" :label="myproblem===1 ? '所属区域' : '违法建筑面积'" min-width="10">
          <el-table-column
            :prop="myproblem === 1 ? 'street' : 'buildingArea'"
            :label="myproblem === 1 ? '所属区域' : '违法建筑面积'"
            min-width="10"
          >
                    </el-table-column>
                    <el-table-column prop="alarmTime" label="报警时间" min-width="15" v-if="myproblem===1">
          <el-table-column
            prop="alarmTime"
            label="报警时间"
            min-width="15"
            v-if="myproblem === 1"
          >
                        <template slot-scope="scope">
                            <span>{{filterTime(scope.row.alarmTime)}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column :prop="myproblem === 1 ? 'continueTime' :'materials'" :label="myproblem===1 ? '持续时间' : '违法建筑材料'" min-width="15">
          <el-table-column
            :prop="myproblem === 1 ? 'continueTime' : 'materials'"
            :label="myproblem === 1 ? '持续时间' : '违法建筑材料'"
            min-width="15"
          >
                    </el-table-column>
                    <el-table-column prop="operation" label="操作" min-width="15">
                        <template slot-scope="scope">
                            <div class="btn">
                                <!-- v-if="instatus===7 ? true : false" -->
                                <span @click="handleExamine(scope.row)" v-if="instatus===7">审核</span>
                                <span @click="handleClosure(scope.row)" v-if="instatus===8">结案</span>
                <span @click="handleExamine(scope.row)" v-if="instatus === 7"
                  >审核</span
                >
                <span @click="handleClosure(scope.row)" v-if="instatus === 8"
                  >结案</span
                >
                                <span class="line" v-if="instatus !==9">|</span>
                                <span @click="JumpView(scope.row)">查看</span>
                            </div>
@@ -73,22 +127,57 @@
                    </el-table-column>
                </el-table>
                <!-- 审核页面 -->
                <el-dialog :visible.sync="dialogExamine" width="60%" title="基础信息(人工)" v-if="dialogExamine"
                    :before-close="handleClose">
                    <MyExamine :info="info" v-if="myproblem === 1" @closeDialog="closeDialog"></MyExamine>
                    <MyIllExamine :info="info" v-else  @closeDialog="closeDialog"></MyIllExamine>
        <el-dialog
          :visible.sync="dialogExamine"
          width="60%"
          title="基础信息(人工)"
          v-if="dialogExamine"
          :before-close="handleClose"
        >
          <MyExamine
            :info="info"
            v-if="myproblem === 1"
            @closeDialog="closeDialog"
          ></MyExamine>
          <MyIllExamine
            :info="info"
            v-else
            @closeDialog="closeDialog"
          ></MyIllExamine>
                </el-dialog>
                <!-- 结案页面 -->
                <el-dialog :visible.sync="dialogClosure" width="60%" title="基础信息(人工)" v-if="dialogClosure"
                    :before-close="handleClose">
                    <MyClosure :info="info" v-if="myproblem === 1" @closeDialog="closeDialog"></MyClosure>
                    <MyIllClosure :info="info" v-else @closeDialog="closeDialog"></MyIllClosure>
        <el-dialog
          :visible.sync="dialogClosure"
          width="60%"
          title="基础信息(人工)"
          v-if="dialogClosure"
          :before-close="handleClose"
        >
          <MyClosure
            :info="info"
            v-if="myproblem === 1"
            @closeDialog="closeDialog"
          ></MyClosure>
          <MyIllClosure
            :info="info"
            v-else
            @closeDialog="closeDialog"
          ></MyIllClosure>
                </el-dialog>
                <!-- 详情页面 -->
                <el-dialog :visible.sync="dialogView" width="60%" title="基础信息(人工)" v-if="dialogView"
                    :before-close="handleNoClose">
                    <MyDetail :info=info v-if="myproblem === 1" :mycode = 'code'></MyDetail>
                    <MyIllDetail :info=info v-else :mycode="code"></MyIllDetail>
        <el-dialog
          :visible.sync="dialogView"
          width="60%"
          title="基础信息(人工)"
          v-if="dialogView"
          :before-close="handleNoClose"
        >
          <MyDetail
            :info="info"
            v-if="myproblem === 1"
            :mycode="code"
          ></MyDetail>
          <MyIllDetail :info="info" v-else :mycode="code"></MyIllDetail>
                </el-dialog>
                <!-- tools -->
                <!-- <div class="tools">
@@ -119,16 +208,21 @@
    </div>
</template>
<script>
import MyExamine from './components/examine'
import MyClosure from './components/closure'
import MyIllExamine from './components/illExamine'
import MyIllClosure from './components/illclosure'
import MyDetail from '@/components/detail'
import MyIllDetail from '@/components/illdetail'
import helper from '@/utils/mydate'
import MyExamine from "./components/examine";
import MyClosure from "./components/closure";
import MyIllExamine from "./components/illExamine";
import MyIllClosure from "./components/illclosure";
import MyDetail from "@/components/detail";
import MyIllDetail from "@/components/illdetail";
import helper from "@/utils/mydate";
export default {
    components: {
        MyExamine,MyClosure,MyDetail,MyIllDetail,MyIllExamine,MyIllClosure
    MyExamine,
    MyClosure,
    MyDetail,
    MyIllDetail,
    MyIllExamine,
    MyIllClosure,
    },
    data() {
        return {
@@ -147,40 +241,40 @@
            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,
                },
            ],
            caseId: '',
      caseId: "",
            myproblem: 1,
            instatus: 7,
            code:''
        }
      code: "",
    };
    },
    created() {
        this.getUserList();
@@ -189,15 +283,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) {
@@ -209,17 +303,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;
        },
        // 全选
@@ -228,46 +322,45 @@
        },
        // 反选
        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() {
            const { currentPage, pageSize, instatus, myproblem } = this;
            this.$axios({
                method: 'get',
                url: `sccg/base_case/query?state=${instatus}&current=${currentPage}&size=${pageSize}&type=${myproblem}`
            }).then(res => {
        method: "get",
        url: `sccg/base_case/query?state=${instatus}&current=${currentPage}&size=${pageSize}&type=${myproblem}`,
      }).then((res) => {
                this.totalNum = res.data.total;
                this.tableData = res.data.records;
            })
      });
        },
        // 设置表格斑马纹
        tableRowClassName({ row, rowIndex }) {
            if ((rowIndex + 1) % 2 === 0) {
                return 'warning-row';
        return "warning-row";
            } else {
                return 'success-row';
        return "success-row";
            }
        },
        // 当前页改变触发事件
@@ -286,52 +379,49 @@
            this.getUserList();
        },
        handleClose(done) {
            this.$confirm('确认关闭?')
                .then(_ => {
      this.$confirm("确认关闭?")
        .then((_) => {
                    this.dialogExamine = false;
                    done();
                })
                .catch(_ => { });
        .catch((_) => {});
        },
        handleNoClose(done) {
            done();
        },
        async JumpView(data) {
            this.code = data.code
      this.code = data.code;
            await this.getEventInfo(data.code);
        },
        // 获取案件信息
        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;
                })
      });
        },
        // 获取案件信息
        getEventInfo3(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.dialogExamine = true;
                })
      });
        },
        // 获取案件信息
        getEventInfo2(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.dialogClosure = true;
                })
      });
        },
        // 去审核
        handleExamine({code}) {
@@ -357,9 +447,9 @@
        },
        filterTime(time){
            return helper(time);
        }
    }
}
    },
  },
};
</script>
<style lang="scss" scoped>
.userList {
@@ -408,7 +498,7 @@
                margin-left: 0!important;
              }
                .funs-sp{
                  border: 1px solid #DCDFE6;
          border: 1px solid #dcdfe6;
                }
                .funsItem {
                    line-height: 28px;
@@ -440,7 +530,6 @@
                        color: #4b9bb7;
                    }
                }
            }
            .pagination {
@@ -450,7 +539,6 @@
                justify-content: center;
                .el-pagination {
                    &::v-deep li,
                    &::v-deep .btn-prev,
                    &::v-deep .btn-next {
@@ -493,7 +581,7 @@
                .line {
                    padding: 0 5px;
                }
        color: var(--operation-color);
                span:hover {
                    cursor: pointer;
                }