zhanghua
2022-12-08 1ec00a645693dbc08b7ea70855451bbd72c43a6a
src/views/intelligentPatrol/studyJudge/index.vue
@@ -1,7 +1,7 @@
<template>
  <div class="study-judge">
    <div class="study-judge-header">
      <span>您有{{ eventList.length }}条待审核报警信息,今日立案0条,再学习{{ countData.review }}条</span>
      <span>您有{{ countData.register }}条待审核报警信息,今日立案{{ countData.review }}条,再学习{{ countData.study }}条</span>
    </div>
    <div class="study-judge-main">
      <div class="sjm-header">
@@ -39,10 +39,10 @@
                <span>{{ currentEvent.grade }}</span>
              </el-form-item>
              <el-form-item label="首次报警时间:">
                <span>{{ currentEvent.firstTime }}</span>
                <span>{{ currentEvent.alarmTime }}</span>
              </el-form-item>
              <el-form-item label="最近报警时间:">
                <span>{{ currentEvent.recentTime }}</span>
                <span>{{ currentEvent.currentAlarmTime }}</span>
              </el-form-item>
              <el-form-item label="持续时间:">
                <span>{{ currentEvent.conntinueTime }}</span>
@@ -55,9 +55,9 @@
              <el-form-item v-if="eventInfoData.store" label="店铺得分:">
                <span>{{ selectStoreChange(eventInfoData.store).storeScore }}</span>
              </el-form-item>
              <el-form-item label="处理意见:" prop="advice">
                <el-radio-group v-model="eventInfoData.advice">
                  <el-radio :label="item.id" v-for="item in adviceList" :key="item.id">{{ item.label }}</el-radio>
              <el-form-item label="处理意见:" prop="state">
                <el-radio-group v-model="eventInfoData.state">
                  <el-radio :label="item.id" v-for="item in stateList" :key="item.id">{{ item.label }}</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="大类名称:" prop="categoryId">
@@ -144,12 +144,13 @@
      }
    };
    return {
      eventList: [],
      countData: {
        review: 0
        study: 0,
        review: 0,
        register: 0
      },
      currentEvent: {},
      adviceList: [
      stateList: [
        {
          id: 2,
          label: '上报',
@@ -169,7 +170,7 @@
      ],
      eventInfoData: null,
      rules:{
        advice:[
        state:[
          {
            required: true, trigger:['blur', 'change'], message: '处理意见不能为空'
          },
@@ -208,10 +209,17 @@
    getInspectionData() {
      basecase.getInspectionData({ current: this.currentPage })
          .then(({ records }) => {
            this.eventList = records;
            this.currentEvent = this.eventList[0];
            this.currentEvent = records[0];
            if (this.currentEvent?.picData) {
              this.imageList = this.currentEvent.picData.split(',').map(item => `${FILE_ORIGINAL_URL}${item}`);
            }
            if (this.currentEvent?.alarmTime || this.currentEvent?.currentAlarmTime) {
              const { alarmTime, currentAlarmTime } = this.currentEvent;
              const continueAlarmTime = new Date().getTime() -
                  (currentAlarmTime ? new Date(currentAlarmTime).getTime() : new Date(alarmTime).getTime());
              const CONTINUE_DAY = continueAlarmTime / 1000 / 60 / 60 / 24;
              const CONTINUE_HOURS = (CONTINUE_DAY - parseInt(CONTINUE_DAY)) * 24;
              this.currentEvent.conntinueTime = `${parseInt(CONTINUE_DAY)}天${parseInt(CONTINUE_HOURS)}小时`;
            }
          })
          .catch(err => this.$message.error(err))
@@ -221,10 +229,10 @@
    handleConfirm(){
      this.$refs.currentEvent.validate((flag)=>{
        if(flag){
          this.eventInfoData.baseId = this.currentEvent.code;
          this.eventInfoData.baseId = this.currentEvent.baseId;
          // 调度
          if (this.eventInfoData.advice === 6) {
          if (this.eventInfoData.state === 6) {
            this.isShowDialog = true;
          } else {
            this.confirmInspection();
@@ -239,7 +247,7 @@
      this.eventInfoData = {
        baseId: null,
        store: null,
        advice: null,
        state: null,
        categoryId: null,
        typeId: null,
        carNumber: null,
@@ -254,7 +262,12 @@
    },
    confirmInspection(data) {
      basecase.confirmInspection({ ...this.eventInfoData, ...data })
      if (data) {
        data.baseCaseId = data.id;
      }
      const eventParams = Object.assign({}, this.eventInfoData);
      delete eventParams.store;
      basecase.confirmInspection({ ...eventParams, ...data })
          .then(() => {
            this.$message.success('操作成功');
            this.getInspectionData();
@@ -269,7 +282,7 @@
    selectStoreChange(id) {
      const selectedStore = this.storeList.find(store => store.id === id);
      this.eventInfoData.shopName = selectedStore.storeName;
      this.eventInfoData.shopName = selectedStore.id;
      this.eventInfoData.linkShop = 1;
      return selectedStore;
    }