南昌市物联网技防平台-前端
Administrator
2021-03-21 60e5202efdc7a91315d2620f505de1b7111cc7b7
src/views/policeTracking/policeTracking.vue
@@ -331,14 +331,17 @@
              <div>
                <el-image
                  :src="src"
                  :preview-src-list="srcList"
                  style="width: 150px; margin-left: 5px"
                ></el-image>
                <el-image
                  :src="src"
                  :preview-src-list="srcList"
                  style="width: 150px; margin-left: 5px"
                ></el-image>
                <el-image
                  :src="src"
                  :preview-src-list="srcList"
                  style="width: 150px; margin-left: 5px"
                ></el-image>
              </div>
@@ -374,7 +377,12 @@
          <el-row :align="center" style="margin-top: 40px">
            <el-col :offset="10">
              <el-button @click="onSubmit" type="danger">处理完成</el-button>
              <el-button
                @click="onSubmit"
                :disabled="form.jtype == 2 ? true : false"
                :type="form.jtype == 2 ? 'info' : 'danger'"
                >处理完成</el-button
              >
            </el-col>
          </el-row>
        </el-card>
@@ -412,6 +420,12 @@
      },
      src:
        "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg",
      srcList: [
        "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg",
        "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg",
        "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg",
        "https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg",
      ],
      form: {},
      itemOption: {
        menuBtn: false,
@@ -471,37 +485,143 @@
    this.getReceivingAlarm();
  },
  methods: {
    onSubmit() {
      var newAxios = axios.create({
        baseURL: "https://web.byisf.com:18001",
        withCredentials: false,
        headers: {},
      });
    getDate() {
      // 当前时间
      var timestamp = Date.parse(new Date());
      var serverDate = new Date(timestamp);
      newAxios
      // 本周周一的时间
      var mondayTime =
        timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
      var mondayData = new Date(mondayTime);
      //年
      var mondayY = mondayData.getFullYear();
      //月
      var mondayM =
        mondayData.getMonth() + 1 < 10
          ? "0" + (mondayData.getMonth() + 1)
          : mondayData.getMonth() + 1;
      //日
      var mondayD =
        mondayData.getDate() < 10
          ? "0" + mondayData.getDate()
          : mondayData.getDate();
      // 当前时间
      var currentData = new Date(timestamp);
      //年
      var currentY = currentData.getFullYear();
      //月
      var currentM =
        currentData.getMonth() + 1 < 10
          ? "0" + (currentData.getMonth() + 1)
          : currentData.getMonth() + 1;
      //日
      var currentD =
        currentData.getDate() < 10
          ? "0" + currentData.getDate()
          : currentData.getDate();
      //时
      var currenH =
        currentData.getHours() < 10
          ? "0" + currentData.getHours()
          : currentData.getHours();
      //分
      var currenM =
        currentData.getMinutes() < 10
          ? "0" + currentData.getMinutes()
          : currentData.getMinutes();
      //秒
      var currenS =
        currentData.getSeconds() < 10
          ? "0" + currentData.getSeconds()
          : currentData.getSeconds();
      return {
        day: {
          beginTime: currentY + "-" + currentM + "-" + currentD + " 00:00:00",
          endTime:
            currentY +
            "-" +
            currentM +
            "-" +
            currentD +
            " " +
            currenH +
            ":" +
            currenM +
            ":00",
        },
        week: {
          beginTime: mondayY + "-" + mondayM + "-" + mondayD + " 00:00:00",
          endTime:
            currentY +
            "-" +
            currentM +
            "-" +
            currentD +
            " " +
            currenH +
            ":" +
            currenM +
            ":00",
        },
        month: {
          beginTime: mondayY + "-" + mondayM + "-01 00:00:00",
          endTime:
            currentY +
            "-" +
            currentM +
            "-" +
            currentD +
            " " +
            currenH +
            ":" +
            currenM +
            ":00",
        },
        current:
          currentY +
          "-" +
          currentM +
          "-" +
          currentD +
          " " +
          currenH +
          ":" +
          currenM +
          ":" +
          currenS,
      };
    },
    onSubmit() {
      var that = this;
      axios
        .post(
          "/api/blade-jfpts/jingdan/jingdan/updateInfo",
          "/api/blade-jfpts/alarm/alarm/updateJtype",
          {},
          {
            params: {
              id: this.form.id,
              handleP: this.form.handleP,
              handName: this.form.handName,
              handletype: this.form.handletype,
              type: "2",
              jid: this.form.id,
              jtype: 2,
              rid: this.form.alarmId,
              bz: this.form.bz,
              snumber: this.form.alarmId,
              sname: this.form.alarmPeople,
              zc: "处理完成",
              zctime: this.getDate().current,
            },
          }
        )
        .then((res) => {
          if (res.data.msg == "修改成功") {
        .then(function (res) {
          if ((res.msg = "修改成功")) {
            var arr = [];
            this.$store.state.tags.tagList.forEach((item) => {
              if (item.value != this.$store.state.tags.tag.value) {
            that.$store.state.tags.tagList.forEach((item) => {
              if (item.value != that.$store.state.tags.tag.value) {
                arr.push(item);
              }
            });
            this.$store.state.tags.tagList = arr;
            this.$router.go(-1);
            that.$store.state.tags.tagList = arr;
            that.$router.go(-1);
          }
        });
    },