保安服务企业管理项目备份
guoshilong
2023-12-13 1b3277c4b8c2fb401a1df8c52d0a063f64f07022
src/views/check/postFiling.vue
@@ -4,9 +4,9 @@
    $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
    $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : ''
  ]">
    <avue-crud class="tablesss" :option="option" :data="data" :page.sync="page" ref="crud" :permission="permissionList"
    <avue-crud class="tablesss" :option="option"       v-model="form" :data="data" :page.sync="page" ref="crud" :permission="permissionList"
      :search.sync="questionBankSearch" @on-load="onLoad" :table-loading="loading" @row-save="rowSave"
      @search-change="searchChange" @search-reset="searchReset" @row-update="rowUpdate" @row-del="rowDel"
      @search-change="searchChange" @search-reset="searchReset" @row-update="rowUpdate" @row-del="rowDel"   :before-open="beforeOpen"
      @selection-change="selectionChange" @refresh-change="refreshChange">
      <template slot="menuLeft">
        <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.clock_delete"
@@ -25,7 +25,8 @@
  getList,
  add,
  update,
  remove
  remove,
  getDetail
} from "@/api/check/postFiling";
import { mapGetters } from "vuex";
import { getToken } from "@/util/auth";
@@ -41,6 +42,7 @@
        total: 0,
        ...this.$store.state.control.changePageSize
      },
      form:{},
      query: {},
      questionBankSearch: {},
      data: [],
@@ -73,28 +75,9 @@
            overHidden: true
          },
          {
            label: "经度",
            prop: "x",
            span: 12,
            rules: [
              {
                required: true,
                message: "请输入经度",
                trigger: "click"
              }
            ],
          },
          {
            label: "纬度",
            prop: "y",
            span: 12,
            rules: [
              {
                required: true,
                message: "请输入纬度",
                trigger: "click"
              }
            ],
            label:"巡岗地点",
            prop:"position",
            display:false
          },
          {
            label: "上岗时间",
@@ -123,7 +106,40 @@
                trigger: "blur"
              }
            ]
          }
          },
          {
            label:"巡岗地点",
            prop:"address",
            type: "map",
            span:24,
            hide:true,
          },
          // {
          //   label: "经度",
          //   prop: "x",
          //   span: 12,
          //   rules: [
          //     {
          //       required: true,
          //       message: "请输入经度",
          //       trigger: "click"
          //     }
          //   ],
          // },
          // {
          //   label: "纬度",
          //   prop: "y",
          //   span: 12,
          //   rules: [
          //     {
          //       required: true,
          //       message: "请输入纬度",
          //       trigger: "click"
          //     }
          //   ],
          // },
        ],
        ...this.$store.state.control.clearOtherBut
      }
@@ -153,6 +169,17 @@
    this.$store.commit("setWindowSizeHeightAdd");
  },
  methods: {
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        getDetail(this.form.id).then(res => {
          this.form = res.data.data;
          this.form['address'] = [this.form.lon,this.form.lat,this.form.position]
        });
      }
      done();
    },
    sizeChange(val) {
      this.page1.currentPage = 1;
      this.page1.pageSize = val;
@@ -165,6 +192,10 @@
    },
    rowSave(form, done, loading) {
      form['type'] = 1;
      form.lon = form.address[0]
      form.lat = form.address[1]
      form.position = form.address[2]
      add(form).then(res => {
        if (res.data.success) {
          this.$message({
@@ -193,6 +224,11 @@
      this.onLoad(this.page);
    },
    rowUpdate(row, index, done, loading) {
      row.lon = row.address[0]
      row.lat = row.address[1]
      row.position = row.address[2]
      update(row).then(
        () => {
          this.onLoad(this.page);
@@ -295,12 +331,7 @@
    },
    onLoad(page, params = {}) {
      params = this.questionBankSearch;
      if (this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "民警" || this.userInfo.role_name == "administrator") {
        params["jurisdiction"] = this.userInfo.jurisdiction;
      }
      if (this.userInfo.role_name == "保安公司管理员" || this.userInfo.role_name == "分公司管理员") {
        params["deptId"] = this.userInfo.dept_id;
      }
      const { releaseTimeRange } = this.query;
      let values = {
@@ -311,15 +342,16 @@
          ...params,
          beginTime: releaseTimeRange[0],
          endTime: releaseTimeRange[1],
          ...this.query
          ...this.query,
        };
        values.releaseTimeRange = null;
      }
      this.loading = true;
      //固定岗
      getList(
        page.currentPage,
        page.pageSize,
        Object.assign(values, this.query)
        Object.assign({type:1},values, this.query)
      ).then(res => {
        const data = res.data.data;
        this.page.total = data.total;