保安服务企业管理项目备份
zhongrj
2024-05-24 f2a74b0b28b74dc29be85ec8e6328bdd262f84b9
src/views/dispatch/dispatch.vue
@@ -10,10 +10,13 @@
    <span v-if="typeTABS.prop === 'tab1'"> -->
    <avue-crud
      class="tablesss"
      v-model="form"
      :option="option"
      :data="data"
      :page.sync="page"
      ref="crudrec"
      :permission="permissionList"
      :before-open="beforeOpen"
      @on-load="onLoad"
      :table-loading="loading"
      @row-save="rowSave"
@@ -31,6 +34,7 @@
          size="small"
          plain
          icon="el-icon-delete"
          v-if="permission.dispatch_delete"
          @click="handleDelete"
          >删 除
        </el-button>
@@ -40,6 +44,7 @@
          size="small"
          plain
          icon="el-icon-upload2"
          v-if="permission.dispatch_import"
          @click="handleImport"
          >批量导入
        </el-button>
@@ -107,7 +112,9 @@
import { mapGetters } from "vuex";
import { mapState } from "vuex";
import { getToken } from "@/util/auth";
import {getDetail} from "@/api/check/postFiling";
export default {
  name:"dispatchList",
  data() {
    var phones = (rule, value, callback) => {
      window.yanzhengphons = /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/;
@@ -169,32 +176,6 @@
            tip: "请上传 .xls,.xlsx 标准格式文件",
            action: "/api/dispatcherUnit/import-dispatcherUnit"
          },
          // {
          //     label: "数据覆盖",
          //     prop: "isCovered",
          //     type: "switch",
          //     align: "center",
          //     width: 80,
          //     dicData: [
          //     {
          //         label: "否",
          //         value: 0,
          //     },
          //     {
          //         label: "是",
          //         value: 1,
          //     },
          //     ],
          //     value: 0,
          //     slot: true,
          //     rules: [
          //     {
          //         required: true,
          //         message: "请选择是否覆盖",
          //         trigger: "blur",
          //     },
          //     ],
          // },
          {
            label: "模板下载",
            prop: "excelTemplate",
@@ -203,6 +184,7 @@
          }
        ]
      },
      form:{},
      option: {
        tip: false,
        index: true,
@@ -212,7 +194,7 @@
        menuWidth: 160,
        align: "center",
        selection: true,
        menu: false,
        // menu: false,
        ...this.$store.state.control.clearOtherBut,
        column: [
          {
@@ -222,7 +204,6 @@
            searchLabelWidth: 110,
            overHidden: true,
            searchSpan: 4,
            width: 210,
            labelWidth: 138,
            rules: [
              {
@@ -231,31 +212,6 @@
                trigger: "click"
              }
            ]
          },
          {
            label: "派遣单位类型",
            prop: "district",
            type: "select",
            search: false,
            dicUrl:
              "/api/blade-system/dict-biz/dictionary?code=dispatcherUnitType",
            props: {
              label: "dictValue",
              value: "dictKey"
            },
            searchLabelWidth: 110,
            overHidden: true,
            searchSpan: 4,
            width: 100,
            labelWidth: 138,
            rules: [
              {
                required: true,
                message: "请选择派遣单位类型",
                trigger: "click"
              }
            ],
            dataType: "number"
          },
          {
            label: "企业名称",
@@ -275,11 +231,66 @@
              }
            ],
            labelWidth: 138,
            width: 180,
            searchLabelWidth: 80,
            search: true,
            searchSpan: 4
          },
          {
            label: "派遣单位类型",
            prop: "district",
            type: "select",
            search: false,
            dicUrl:
              "/api/blade-system/dict-biz/dictionary?code=dispatcherUnitType",
            props: {
              label: "dictValue",
              value: "dictKey"
            },
            searchLabelWidth: 110,
            overHidden: true,
            searchSpan: 4,
            labelWidth: 138,
            rules: [
              {
                required: true,
                message: "请选择派遣单位类型",
                trigger: "click"
              }
            ],
            dataType: "number"
          },
          {
            label: "派遣单位行业",
            prop: "profession",
            type: "select",
            search: false,
            dicUrl:
              "/api/blade-system/dict-biz/dictionary?code=dispatchProfession",
            props: {
              label: "dictValue",
              value: "dictKey"
            },
            searchLabelWidth: 110,
            overHidden: true,
            searchSpan: 4,
            labelWidth: 138,
            rules: [
              {
                required: true,
                message: "请选择派遣单位行业",
                trigger: "click"
              }
            ],
            dataType: "number"
          },
          {
            label: " 派遣单位地址",
            prop: "address",
            labelWidth: 138,
            span:24,
          },
          {
            label: "保安服务类型",
            prop: "serveType",
@@ -349,7 +360,6 @@
            viewDisplay: false,
            overHidden: true,
            labelWidth: 138,
            width: 100,
            type: "tree",
            dicUrl: "/api/jurisdiction/lazy-tree",
            props: {
@@ -365,11 +375,6 @@
                trigger: "click"
              }
            ]
          },
          {
            label: " 派遣单位地址",
            prop: "address",
            labelWidth: 138
          },
          {
            label: "合同开始时间",
@@ -439,7 +444,6 @@
            label: "负责人联系方式",
            prop: "cell",
            labelWidth: 138,
            width: 110,
            rules: [
              {
                required: true,
@@ -458,7 +462,6 @@
            prop: "num",
            type: "number",
            labelWidth: 138,
            width: 110,
            rules: [
              {
                required: true,
@@ -466,7 +469,23 @@
                trigger: "click"
              }
            ]
          }
          },
          {
            label:"地图选点",
            labelWidth: 138,
            prop:"mapAddress",
            type: "map",
            span:24,
            hide:true,
            value:[112.85857823133,35.496284586473,""],
            rules: [
              {
                required: false,
                message: "请选择点位",
                trigger: "blur"
              }
            ]
          },
        ]
      },
@@ -502,7 +521,7 @@
      //赋值
      column.value = that.userInfo.dept_id;
      this.useifid = this.userInfo.dept_id;
    } else if (roleName == "公安管理员" || roleName == "administrator") {
    } else if (roleName == "公安管理员" || roleName == "administrator" || roleName == "民警") {
      var columnDept = that.findObject(that.option.column, "deptId");
      columnDept.dicUrl =
        "/api/blade-system/dept/security_lazy-tree?jurisdiction=" +
@@ -516,7 +535,15 @@
    }
  },
  computed: {
    ...mapGetters(["userInfo"]),
    ...mapGetters(["permission", "userInfo"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.dispatch_add, false),
        viewBtn: this.vaildData(this.permission.dispatch_view, true),
        delBtn: this.vaildData(this.permission.dispatch_delete, false),
        editBtn: this.vaildData(this.permission.dispatch_edit, false)
      };
    },
    ids() {
      let ids = [];
      this.selectionList.forEach(ele => {
@@ -537,6 +564,12 @@
  },
  methods: {
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        this.form['mapAddress'] = [this.form.longitude,this.form.latitude,this.form.address]
      }
      done();
    },
    handleChangeTABS(column) {
      this.typeTABS = column;
      if (column.prop == "tab1") {
@@ -566,6 +599,8 @@
      if (this.useifid != 266) {
        form["deptId"] = this.useifid;
      }
      form.longitude =form.mapAddress[0]
      form.latitude = form.mapAddress[1]
      adddata(form).then(
        res => {
          this.onLoad(this.page);
@@ -596,6 +631,8 @@
      if (this.useifid != 266) {
        row["deptId"] = this.useifid;
      }
      row.longitude = this.form.mapAddress[0]
      row.latitude = this.form.mapAddress[1]
      update(row).then(
        () => {
          this.onLoad(this.page);
@@ -706,7 +743,7 @@
      if (this.useifid != 266) {
        values["deptId"] = this.useifid;
      }
      if (this.userInfo.role_name == "公安管理员") {
      if (this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "民警") {
        values["jurisdiction"] = that.userInfo.jurisdiction;
      }
      getdata(