zengh
2021-07-20 c784b1b2e8384fe2696e88e48e1494bda3b2c024
事件上报—任务下发流程完善
4 files modified
788 ■■■■ changed files
src/views/feedbackReport/feedbackReport.vue 766 ●●●● patch | view | raw | blame | history
src/views/policeTracking/policeTracking.vue 1 ●●●● patch | view | raw | blame | history
src/views/realTimePolice/real.vue 19 ●●●● patch | view | raw | blame | history
src/views/system/cs.vue 2 ●●●●● patch | view | raw | blame | history
src/views/feedbackReport/feedbackReport.vue
@@ -28,386 +28,424 @@
          plain
          v-if="permission.feedback_delete"
          @click="handleDelete"
          >删 除
        >删 除
        </el-button>
      </template>
      <template slot-scope="scope" slot="menuLeft">
        <el-button type="danger" icon="el-icon-plus" size="small" plain @click.stop="$refs.crud.rowAdd()">新增</el-button>
      </template>
      <template slot-scope="{type,size, row}" slot="menu">
        <el-button icon="el-icon-check" :size="size" :type="type" @click="setReal(row)">接收</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import {
  getListReport,
  getDetails,
  adds,
  updates,
  remove,
} from "@/api/feedback/feedback";
import { getBaTree } from "@/api/client/client";
import { mapGetters } from "vuex";
  import {
    getListReport,
    getDetails,
    adds,
    updates,
    remove,
  } from "@/api/feedback/feedback";
  import {getBaTree} from "@/api/client/client";
  import {mapGetters} from "vuex";
export default {
  data() {
    return {
      form: {},
      query: {},
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
  export default {
    data() {
      return {
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0,
        },
        selectionList: [],
        option: {
          height: "auto",
          calcHeight: 54,
          menuWidth: 330,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          labelWidth: "125",
          dialogWidth: 1150,
          border: false,
          //stripe:true,
          index: true,
          viewBtn: true,
          selection: true,
          dialogClickModal: false,
          images: [],
          videos: [],
          column: [
            {
              label: "上报人姓名",
              prop: "sname",
              search: true,
              searchLabelWidth: 100,
              searchSpan: 5,
              addDisplay: false,
              editDisplay: false,
            },
            {
              label: "上报人姓名",
              prop: "snumber",
              type: "tree",
              dicUrl: "/api/catalogs/catalogs/getBigTree",
              props: {
                label: "title",
              },
              width: 72,
              hide: true,
              addDisplay: true,
              editDisplay: true,
              viewDisplay: false,
              rules: [
                {
                  required: true,
                  message: "请选择上报人",
                  trigger: "blur",
                },
              ],
            },
            {
              label: "上报地址",
              prop: "place",
              rules: [
                {
                  required: true,
                  message: "请输入事发地址",
                  trigger: "blur",
                },
              ],
            },
            {
              label: "经度",
              prop: "jd",
            },
            {
              label: "纬度",
              prop: "wd",
            },
            {
              label: "备注",
              prop: "result",
              rules: [
                {
                  required: true,
                  message: "请输入处理结果",
                  trigger: "blur",
                },
              ],
            },
            {
              label: "上报时间",
              prop: "stime",
              type: "datetime",
              format: "yyyy-MM-dd HH:mm:ss",
              valueFormat: "yyyy-MM-dd HH:mm:ss",
            },
            {
              label: "上报时间",
              prop: "dateTime",
              type: "datetime",
              format: "yyyy-MM-dd HH:mm:ss",
              valueFormat: "yyyy-MM-dd HH:mm:ss",
              searchRange: true,
              search: true,
              searchLabelWidth: 100,
              searchSpan: 6,
              addDisplay: false,
              viewDisplay: false,
              editDisplay: false,
              hide: true,
              rules: [
                {
                  required: true,
                  message: "请选择上报时间",
                  trigger: "blur",
                },
              ],
            },
            {
              label: "图片",
              prop: "images",
              dataType: "array",
              type: "upload",
              span: 24,
              hide: true,
              viewDisplay: true,
              listType: "picture-card",
              action: "/api/blade-resource/oss/endpoint/put-file",
              propsHttp: {
                res: "data",
                url: "link",
              },
            },
            {
              label: "视频",
              prop: "videos",
              dataType: "array",
              type: "upload",
              accept: "video/mp4",
              hide: true,
              viewDisplay: true,
              editDisabled: true,
              listType: "picture",
              span: 24,
              action: "http://web.byisf.com:82/blade-jfpts/depl/put-depl",
              propsHttp: {
                res: "data",
                url: "link",
              },
            },
          ],
        },
        data: [],
      };
    },
    watch: {
      handler(val) {
        var that = this;
        if (val != null && val != "") {
          getBaTree(val).then((res) => {
            if (res) {
              that.form.sname = res.data.data.records[0].name;
            }
          });
        }
      },
      selectionList: [],
      option: {
        height: "auto",
        calcHeight: 54,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        labelWidth: "125",
        dialogWidth: 1150,
        border: false,
        //stripe:true,
        index: true,
        viewBtn: true,
        selection: true,
        dialogClickModal: false,
        images: [],
        videos: [],
        column: [
          {
            label: "上报人姓名",
            prop: "sname",
            search: true,
            searchLabelWidth: 100,
            searchSpan: 5,
            addDisplay: false,
            editDisplay: false,
          },
          {
            label: "上报人姓名",
            prop: "snumber",
            type: "tree",
            dicUrl: "/api/catalogs/catalogs/getBigTree",
            props: {
              label: "title",
            },
            width: 72,
            hide: true,
            addDisplay: true,
            editDisplay: true,
            viewDisplay: false,
            rules: [
              {
                required: true,
                message: "请选择上报人",
                trigger: "blur",
              },
            ],
          },
          {
            label: "上报地址",
            prop: "place",
            rules: [
              {
                required: true,
                message: "请输入事发地址",
                trigger: "blur",
              },
            ],
          },
          {
            label: "备注",
            prop: "result",
            rules: [
              {
                required: true,
                message: "请输入处理结果",
                trigger: "blur",
              },
            ],
          },
          {
            label: "上报时间",
            prop: "stime",
            type: "datetime",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd HH:mm:ss",
          },
          {
            label: "上报时间",
            prop: "dateTime",
            type: "datetime",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd HH:mm:ss",
            searchRange: true,
            search: true,
            searchLabelWidth: 100,
            searchSpan: 6,
            addDisplay: false,
            viewDisplay: false,
            editDisplay: false,
            hide: true,
            rules: [
              {
                required: true,
                message: "请选择上报时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "图片",
            prop: "images",
            dataType: "array",
            type: "upload",
            span: 24,
            hide: true,
            viewDisplay: true,
            listType: "picture-card",
            action: "/api/blade-resource/oss/endpoint/put-file",
            propsHttp: {
              res: "data",
              url: "link",
            },
          },
          {
            label: "视频",
            prop: "videos",
            dataType: "array",
            type: "upload",
            accept: "video/mp4",
            hide: true,
            viewDisplay: true,
            editDisabled: true,
            listType: "picture",
            span: 24,
            action: "http://web.byisf.com:82/blade-jfpts/depl/put-depl",
            propsHttp: {
              res: "data",
              url: "link",
            },
          },
        ],
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.feedback_add, true),
          viewBtn: this.vaildData(this.permission.feedback_view, true),
          delBtn: this.vaildData(this.permission.feedback_delete, true),
          editBtn: this.vaildData(this.permission.feedback_edit, true),
        };
      },
      data: [],
    };
  },
  watch: {
    handler(val) {
      var that = this;
      if (val != null && val != "") {
        getBaTree(val).then((res) => {
          if (res) {
            that.form.sname = res.data.data.records[0].name;
      ids() {
        let ids = [];
        this.selectionList.forEach((ele) => {
          ids.push(ele.id);
        });
        return ids.join(",");
      },
    },
    methods: {
      rowSave(row, done, loading) {
        var data = {
          status: 1,
          tpaddress: "",
          spaddress: "",
          sname: row.$snumber,
          snumber: row.snumber,
          stime: row.stime,
          result: row.result,
          place: row.place,
        };
        if (row.images.length > 0) {
          var imageArr = row.images;
          imageArr.forEach((image) => {
            data.tpaddress += image + ",";
          });
          data.tpaddress = data.tpaddress.substring(0, data.tpaddress.length - 1);
        }
        if (row.videos.length > 0) {
          //var videoArr = row.videos;
          //videoArr.forEach( video =>{
          //data.spaddress += video + ",";
          //})
          //data.spaddress = data.spaddress.substring(0,data.spaddress.length-1);
          data.spaddress = row.videos;
        }
        adds(data).then(
          () => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            done();
          },
          (error) => {
            loading();
            window.console.log(error);
          }
        );
      },
      rowUpdate(row, index, done, loading) {
        var data = {
          id: row.id,
          status: 1,
          tpaddress: "",
          spaddress: "",
          sname: row.$snumber,
          snumber: row.snumber,
          stime: row.stime,
          result: row.result,
          place: row.place,
        };
        if (row.images.length > 0) {
          var imageArr = row.images;
          imageArr.forEach((image) => {
            data.tpaddress += image + ",";
          });
          data.tpaddress = data.tpaddress.substring(0, data.tpaddress.length - 1);
        }
        if (row.videos.length > 0) {
          //var videoArr = row.videos;
          //videoArr.forEach( video =>{
          //data.spaddress += video + ",";
          //})
          //data.spaddress = data.spaddress.substring(0,data.spaddress.length-1);
          data.spaddress = row.videos;
        }
        updates(data).then(
          () => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            done();
          },
          (error) => {
            loading();
            console.log(error);
          }
        );
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!",
            });
          });
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!",
            });
            this.$refs.crud.toggleSelection();
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetails(this.form.id).then((res) => {
            this.form = res.data.data;
            this.images = res.data.data.images;
            this.videos = res.data.data.videos;
          });
        }
        done();
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
      },
      //派遣任务
      setReal(row) {
        var arr = [];
        this.$store.state.tags.tagList.forEach((item) => {
          if (item.label != "任务下发") {
            arr.push(item);
          }
        });
      }
    },
  },
  computed: {
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.feedback_add, false),
        viewBtn: this.vaildData(this.permission.feedback_view, true),
        delBtn: this.vaildData(this.permission.feedback_delete, true),
        editBtn: this.vaildData(this.permission.feedback_edit, true),
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },
  },
  methods: {
    rowSave(row, done, loading) {
      var data = {
        status: 1,
        tpaddress: "",
        spaddress: "",
        sname: row.$snumber,
        snumber: row.snumber,
        stime: row.stime,
        result: row.result,
        place: row.place,
      };
      if (row.images.length > 0) {
        var imageArr = row.images;
        imageArr.forEach((image) => {
          data.tpaddress += image + ",";
        this.$store.state.tags.tagList = arr;
        row.bz = row.result;
        row.sjsb = 1;
        window.sessionStorage.setItem('sjsb', 1)
        this.$router.push({
          path: `/realTimePolice/index`,
          query: row
        });
        data.tpaddress = data.tpaddress.substring(0, data.tpaddress.length - 1);
      }
      if (row.videos.length > 0) {
        //var videoArr = row.videos;
        //videoArr.forEach( video =>{
        //data.spaddress += video + ",";
        //})
        //data.spaddress = data.spaddress.substring(0,data.spaddress.length-1);
        data.spaddress = row.videos;
      }
      adds(data).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          window.console.log(error);
        }
      );
    },
    rowUpdate(row, index, done, loading) {
      var data = {
        id: row.id,
        status: 1,
        tpaddress: "",
        spaddress: "",
        sname: row.$snumber,
        snumber: row.snumber,
        stime: row.stime,
        result: row.result,
        place: row.place,
      };
      if (row.images.length > 0) {
        var imageArr = row.images;
        imageArr.forEach((image) => {
          data.tpaddress += image + ",";
        });
        data.tpaddress = data.tpaddress.substring(0, data.tpaddress.length - 1);
      }
      if (row.videos.length > 0) {
        //var videoArr = row.videos;
        //videoArr.forEach( video =>{
        //data.spaddress += video + ",";
        //})
        //data.spaddress = data.spaddress.substring(0,data.spaddress.length-1);
        data.spaddress = row.videos;
      }
      updates(data).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          loading();
          console.log(error);
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(this.ids);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          this.$refs.crud.toggleSelection();
        });
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetails(this.form.id).then((res) => {
          this.form = res.data.data;
          this.images = res.data.data.images;
          this.videos = res.data.data.videos;
        });
      }
      done();
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },
    selectionChange(list) {
      this.selectionList = list;
    },
    selectionClear() {
      this.selectionList = [];
      this.$refs.crud.toggleSelection();
    },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = { status: 1 }) {
      const { dateTime } = this.query;
      let values = {
        ...params,
        status: 1,
      };
      if (dateTime) {
        values = {
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {status: 1}) {
        const {dateTime} = this.query;
        let values = {
          ...params,
          begTime: dateTime[0],
          endTime: dateTime[1],
          ...this.query,
          status: 1,
        };
        values.dateTime = null;
      }
      this.loading = true;
      getListReport(page.currentPage, page.pageSize, values).then((res) => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.selectionClear();
      });
        if (dateTime) {
          values = {
            ...params,
            begTime: dateTime[0],
            endTime: dateTime[1],
            ...this.query,
          };
          values.dateTime = null;
        }
        this.loading = true;
        getListReport(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
      },
    },
  },
};
  };
</script>
<style>
src/views/policeTracking/policeTracking.vue
@@ -418,7 +418,6 @@
    this.vaddress = this.form.vaddress;
    this.getReceivingAlarm();
debugger
    if (this.form.alarmType == "巡逻任务"){
      this.baseUrl = `/map/index.html?ISinit=1&openid=AlertSecurity&id=${this.form.id}&jd=${this.form.jd}&wd=${this.form.wd}&pid=${this.form.deptId}&deptId=${this.form.deptId}&oneId=${this.form.oneId}&baid=${this.form.baid}`;
    }else{
src/views/realTimePolice/real.vue
@@ -468,8 +468,8 @@
          } else {
            that.form.map = {
              formattedAddress: "",
              latitude: 28.68235075592195,
              longitude: 115.9021417169273,
              latitude: 28.699957,
              longitude: 115.862118,
            };
          }
        },
@@ -515,6 +515,16 @@
    },
    created() {
      this.dateTime = this.getDate();
    },
    mounted(){
      debugger
      var xb = JSON.parse(window.sessionStorage.getItem('sjsb'));
      var data = this.$route.query;
      if (xb == 1){
        this.form = data;
        this.openAdd();
        window.sessionStorage.removeItem('sjsb');
      }
    },
    methods: {
      rowSave(row, done, loading) {
@@ -1130,7 +1140,6 @@
      },
      PoliceTracking(row) {
        var arr = [];
        this.$store.state.tags.tagList.forEach((item) => {
          if (item.label != "任务追踪") {
@@ -1142,6 +1151,10 @@
        this.$router.push({path: "/policeTracking/track", query: row});
      },
      //打开新增窗体
      openAdd(){
        this.$refs.crud.rowAdd();
      },
      //数据导出
      handleExport() {
src/views/system/cs.vue
@@ -789,7 +789,6 @@
    rowSave(row, done, loading) {
      add(row).then(
        () => {
          debugger;
          if (row.type == "0") {
            console.log(123);
            instery(
@@ -834,7 +833,6 @@
      );
    },
    rowUpdate(row, index, done, loading) {
      debugger;
      if (row.type == "0") {
        updateInfoy(
          row.dj,