luobisheng
2022-12-07 0426c72922004cbaa47fafbb0ee6eb5d9386a063
预警研判增加调度弹窗
3个文件已修改
178 ■■■■ 已修改文件
src/components/dispatch/index.vue 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/intelligentPatrol/studyJudge/index.vue 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/disposal/casepool/pool/createUser/vio/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/dispatch/index.vue
@@ -47,9 +47,7 @@
          <el-select
            v-model="dispatch.enforcementTeam"
            placeholder="选择中队"
            :disabled="
              squadronOptions.length !== 0 && squadronOptions ? false : true
            "
            :disabled="!(squadronOptions.length !== 0 && squadronOptions)"
            @change="handleMidChange"
          >
            <el-option
@@ -66,9 +64,7 @@
          <el-select
            v-model="dispatch.lawEnforcer"
            placeholder="请选择人员"
            :disabled="
              personOptions.length !== 0 && personOptions ? false : true
            "
            :disabled="!(personOptions.length !== 0 && personOptions)"
            @change="handlePerChange"
          >
            <el-option
@@ -121,15 +117,15 @@
</template>
<script>
import MyMap from "@/components/map";
import { parseTime } from "@/utils/index";
export default {
  components: {
    MyMap,
  },
  props: ["id", "changeDialog", "refresh", "mytype"],
  props: ["id", "changeDialog", "refresh", "mytype", "isGetData"],
  created() {
    // 判断车辆类型
    this.mytype === 1 ? this.getLawCarList() : this.getSoilCarList();
    this.isGetDispatchData = this.isGetData ? this.isGetData : false;
    this.getDepartList();
  },
  data() {
@@ -150,13 +146,6 @@
        callback();
      } else {
        callback(new Error("派遣意见不能为空"));
      }
    };
    const checkDistance = (rule, value, callback) => {
      if (value) {
        callback();
      } else {
        callback(new Error("距离不能为空"));
      }
    };
    const checkTeam = (rule, value, callback) => {
@@ -218,12 +207,6 @@
        dispatchOpinion: [
          { required: true, trigger: "change", validator: checkOpinion },
        ],
        // distance: [
        //   { required: true, trigger: "change", validator: checkDistance },
        // ],
        // enforcementTeam: [
        //     { required: true, trigger: 'change', validator: checkTeam }
        // ],
        lawEnforcer: [
          { required: true, trigger: "change", validator: checkPerson },
        ],
@@ -238,57 +221,38 @@
          },
        ],
      },
      carOptions: [
        {
          label: "车辆一",
          value: 1,
        },
        {
          label: "车辆二",
          value: 2,
        },
      ],
      carOptions: [],
      departOptions: [],
      carOptions: [
        {
          label: "车辆一",
          value: 1,
        },
        {
          label: "车辆二",
          value: 2,
        },
      ],
      squadronOptions: [],
      personOptions: [],
      isGetDispatchData: true
    };
  },
  methods: {
    // 执行调度
    handleDispatch() {
      console.log(this.dispatch);
      this.$refs.form.validate((valid) => {
        console.log(valid);
        if (valid) {
          const { dispatch, id } = this;
          // dispatch.disposeDate = new Date();
          console.log(id);
          dispatch.baseCaseId = id;
          console.log(dispatch);
          this.$axios({
            method: "post",
            url: `sccg/dispatch_handle/dispatch`,
            data: dispatch,
          }).then((res) => {
            this.$message({
              type: res.code === 200 ? "success" : "error",
              message: res.code === 200 ? "调度成功" : res.message,
          if (this.isGetDispatchData) {
            this.$emit('getDispatchData', this.dispatch);
          } else {
            const { dispatch, id } = this;
            dispatch.baseCaseId = id;
            this.$axios({
              method: "post",
              url: `sccg/dispatch_handle/dispatch`,
              data: dispatch,
            }).then((res) => {
              this.$message({
                type: res.code === 200 ? "success" : "error",
                message: res.code === 200 ? "调度成功" : res.message,
              });
              this.refresh();
            });
            this.$emit("changeDialog", { flag: false });
            this.refresh();
          });
          }
          this.$emit("changeDialog", { flag: false });
        } else {
          return false;
          this.$message.warning('请检查必填项');
        }
      });
    },
@@ -303,7 +267,6 @@
        url: `sccg/car_Manage/query_enforce?current=1&size=1000`,
      }).then((res) => {
        this.carOptions = res.data.records;
        console.log(res, this.carOptions);
      });
    },
    // 获取渣土车辆
@@ -326,7 +289,6 @@
    },
    // 获取中队
    async getTeamList(id) {
      console.log(id);
      await this.$axios({
        method: "get",
        url: `sccg/depart/query_father_children?fatherId=${id}`,
@@ -335,12 +297,10 @@
          this.squadronOptions = res.data;
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 获取部门下的用户
    async getDepartUserList(id) {
      console.log(id);
      await this.$axios({
        method: "get",
        url: `sccg/admin/getDepartUser/${id}`,
@@ -372,9 +332,6 @@
      this.dispatch.contactWay = "";
      this.dispatch.lawEnforcerName = "";
      await this.getTeamList(id);
      // if (this.squadronOptions.length === 0) {
      //     await this.getDepartUserList(id);
      // }
    },
    // 中队更改
    async handleMidChange(id) {
@@ -404,9 +361,7 @@
  watch: {
    "squadronOptions.length": {
      handler(newval, oldval) {
        console.log(newval);
        if (newval === 0) {
          console.log(1);
          this.$message({
            type: "warning",
            message: "该部门下没有中队",
src/views/intelligentPatrol/studyJudge/index.vue
@@ -31,7 +31,7 @@
              <span>报警记录</span>
              <span>乱停乱放违法占道</span>
            </div>
            <el-form ref="currentEvent" label-width="120px" :model="currentEvent" :rules="rules">
            <el-form ref="currentEvent" label-width="120px" :model="eventInfoData" :rules="rules">
              <el-form-item label="事件编号:">
                <span>{{ currentEvent.code }}</span>
              </el-form-item>
@@ -48,33 +48,33 @@
                <span>{{ currentEvent.conntinueTime }}</span>
              </el-form-item>
              <el-form-item label="关联店铺" prop="store">
                <el-select v-model="currentEvent.store" @change="selectStoreChange" placeholder="请选择关联店铺">
                <el-select v-model="eventInfoData.store" @change="selectStoreChange" placeholder="请选择关联店铺">
                  <el-option v-for="store in storeList" :value="store.id" :label="store.storeName" :key="store.id" />
                </el-select>
              </el-form-item>
              <el-form-item v-if="currentEvent.store" label="店铺得分:">
                <span>{{ selectStoreChange(currentEvent.store).storeScore }}</span>
              <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="currentEvent.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-radio-group>
              </el-form-item>
              <el-form-item label="大类名称:" prop="categoryId">
                <el-select v-model="currentEvent.categoryId" placeholder="请选择大类名称" @change="categoryChange">
                <el-select v-model="eventInfoData.categoryId" placeholder="请选择大类名称" @change="categoryChange">
                  <el-option v-for="category in categoryOptions" :key="category.id" :value="category.id" :label="category.name" />
                </el-select>
              </el-form-item>
              <el-form-item label="小类名称:" prop="typeId">
                <el-select v-model="currentEvent.typeId" placeholder="请选择小类名称">
                <el-select v-model="eventInfoData.typeId" placeholder="请选择小类名称">
                  <el-option v-for="type in typeOptions" :key="type.id" :value="type.id" :label="type.name" />
                </el-select>
              </el-form-item>
              <el-form-item label="车牌号:" prop="carNumber">
                <el-input v-model="currentEvent.carNumber" placeholder="请填写车牌号码"></el-input>
                <el-input v-model="eventInfoData.carNumber" placeholder="请填写车牌号码"></el-input>
              </el-form-item>
              <el-form-item label="备注:" prop="description">
                <el-input type="textarea" :rows="5" v-model="currentEvent.description"></el-input>
                <el-input type="textarea" :rows="5" v-model="eventInfoData.description"></el-input>
              </el-form-item>
              <el-form-item>
                <el-button :disabled="currentPage === 1" @click="pageChange('prev')">上一条</el-button>
@@ -86,6 +86,9 @@
        </div>
      </div>
    </div>
    <el-dialog :visible="isShowDialog" title="调度信息">
      <MyDispatch v-if="isShowDialog" :mytype="1" @confirmInspection="handleConfirm" :isGetData="true" @changeDialog="closeDialog"></MyDispatch>
    </el-dialog>
  </div>
</template>
@@ -95,10 +98,13 @@
import { getStoreInfoList } from "@/api/operate/storeManagement";
import { FILE_ORIGINAL_URL } from "@/utils";
import { validateCarNum } from "@/utils/validate";
import MyDispatch from '@/components/dispatch';
export default {
  components: { MyDispatch },
  created() {
    this.getInspectionData();
    this.initEventParams();
    basecase.getInspectionCountData()
        .then(res => {
          this.countData = res;
@@ -145,11 +151,11 @@
      currentEvent: {},
      adviceList: [
        {
          id: 1,
          id: 2,
          label: '上报',
        },
        {
          id: 2,
          id: 6,
          label: '调度',
        },
        {
@@ -161,6 +167,7 @@
          label: '暂不处理',
        },
      ],
      eventInfoData: null,
      rules:{
        advice:[
          {
@@ -184,7 +191,8 @@
      categoryOptions: [],
      typeOptions: [],
      storeList: [],
      typeList: []
      typeList: [],
      isShowDialog: false
    }
  },
  methods:{
@@ -213,30 +221,57 @@
    handleConfirm(){
      this.$refs.currentEvent.validate((flag)=>{
        if(flag){
          this.currentEvent.linkShop = 0;
          if (this.currentEvent.store) {
            const selectedStore = this.selectStoreChange(this.currentEvent.store);
            this.currentEvent.shopName = selectedStore.storeName;
            this.currentEvent.linkShop = 1;
          this.eventInfoData.baseId = this.currentEvent.code;
          // 调度
          if (this.eventInfoData.advice === 6) {
            this.isShowDialog = true;
          } else {
            this.confirmInspection();
          }
          basecase.confirmInspection(this.currentEvent)
              .then(() => {
                this.$message.success('操作成功');
                this.getInspectionData();
              })
              .catch(err => this.$message.error(err))
        } else {
          this.$message.warning('请检查必填项');
        }
      })
    },
    initEventParams() {
      this.eventInfoData = {
        baseId: null,
        store: null,
        advice: null,
        categoryId: null,
        typeId: null,
        carNumber: null,
        description: null,
        linkShop: 0,
        shopName: null
      }
    },
    categoryChange(id) {
      this.typeOptions = this.typeList.filter(type => type.parentId === id);
    },
    confirmInspection(data) {
      basecase.confirmInspection({ ...this.eventInfoData, ...data })
          .then(() => {
            this.$message.success('操作成功');
            this.getInspectionData();
            this.initEventParams();
          })
          .catch(err => this.$message.error(err))
    },
    closeDialog() {
      this.isShowDialog = false;
    },
    selectStoreChange(id) {
      return this.storeList.find(store => store.id === id);
      const selectedStore = this.storeList.find(store => store.id === id);
      this.eventInfoData.shopName = selectedStore.storeName;
      this.eventInfoData.linkShop = 1;
      return selectedStore;
    }
  }
}
src/views/operate/disposal/casepool/pool/createUser/vio/index.vue
@@ -387,7 +387,6 @@
    },
    created() {
        const { setBigKindList, getStreetList, getEventLevel } = this;
        console.log(this.mytype);
        this.vio.category = this.mytype + 1;
        setBigKindList();
        getStreetList(0);
@@ -544,7 +543,6 @@
        selectBlur(e) {
            if (e.target.value) {
                this.vio.actionCause = e.target.value;
                console.log(e.target.value);
            }
        }
    },