zhongrj
2024-03-27 cc1c0a396698648256c350f6f0fe2cb2f0b02c7e
src/views/securityGuardManagement/dispatchChildoperable.vue
@@ -1,26 +1,31 @@
<template>
  <basic-container>
    <div class="dispatchChildoperable">
      <avue-crud
        :option="option1"
        :data="data1"
        :page.sync="page1"
        ref="crudrec1"
        v-model="form"
        :table-loading="loading1"
        :before-open="beforeOpen"
        @row-save="rowSave1"
        @search-change="searchChange1"
        @search-reset="searchReset1"
        @row-update="rowUpdate1"
        @row-del="rowDel1"
        @selection-change="selectionChange1"
        @refresh-change="refreshChange1"
      >
      </avue-crud>
    </div>
  <basic-container
    :class="[
      $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '',
    ]"
  >
    <avue-crud
      class="tablesss"
      :option="option1"
      :data="data1"
      :page.sync="page1"
      ref="crudrec1"
      v-model="form"
      :table-loading="loading1"
      :before-open="beforeOpen"
      @row-save="rowSave1"
      @search-change="searchChange1"
      @search-reset="searchReset1"
      @row-update="rowUpdate1"
      @row-del="rowDel1"
      @selection-change="selectionChange1"
      @refresh-change="refreshChange1"
      @on-load="onLoad1"
    >
    </avue-crud>
  </basic-container>
</template>
</template>
<script>
import {
@@ -46,6 +51,7 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
      },
      form: {},
      query1: {},
@@ -67,6 +73,7 @@
        // menuWidth: 160,
        align: "center",
        selection: true,
        ...this.$store.state.control.clearOtherBut,
        column: [
          // },
          {
@@ -77,7 +84,7 @@
            // search: true,
            // labelWidth: 120,
            // searchSpan: 4,
            minWidth: 210,
            minWidth: 110,
            addDisplay: false,
            editDisplay: false,
          },
@@ -85,9 +92,11 @@
            label: "保安公司",
            prop: "deptId",
            search: true,
            overHidden: true,
            labelWidth: 120,
            type: "tree",
            searchSpan: 4,
            searchLabelWidth: 75,
            cascaderItem: ["userIds"],
            props: {
              label: "title",
@@ -130,9 +139,10 @@
            label: "保安员",
            prop: "userIds",
            type: "tree",
            width: 70,
            width: 65,
            labelWidth: 120,
            searchSpan: 3,
            searchLabelWidth: 62,
            searchSpan: 4,
            search: true,
            hide: true,
            props: {
@@ -246,6 +256,7 @@
            valueFormat: "yyyy-MM-dd",
            searchValue: [this.getStartTime(), this.getEndTime()],
            searchRange: true,
            searchLabelWidth: 75,
            searchSpan: 5,
            hide: true,
            addDisplay: false,
@@ -263,6 +274,7 @@
          {
            label: "派遣地址",
            prop: "dispatcheraddress",
            overHidden: true,
            labelWidth: 120,
            rules: [
              {
@@ -281,7 +293,7 @@
  },
  created() {
    if (this.userInfo.role_name == "保安公司管理员") {
      console.log("保安公司管理员登入");
      // console.log("保安公司管理员登入");
      const deptColumn = this.findObject(this.option1.column, "deptId");
      deptColumn.search = false;
    } else {
@@ -317,7 +329,7 @@
        // this.onLoad(this.page);
      } else if (column.prop == "tab2") {
        // this.loading = false;
        console.log(document.getElementsByClassName("el-card__body")[0]);
        // console.log(document.getElementsByClassName("el-card__body")[0]);
        this.onLoad1(this.page1); //第二个表格不会自动执行
      }
      // this.$message.success(JSON.stringify(column));
@@ -409,7 +421,7 @@
      // console.log(this.selectionList1.length);
    },
    handleDelete1() {
      console.log(this.selectionList1);
      // console.log(this.selectionList1);
      if (this.selectionList1.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
@@ -502,9 +514,10 @@
        const data = res.data.data;
        this.page1.total = data.total;
        this.data1 = data.records;
        this.$store.commit("setWindowSizeHeightAdd");
        this.loading1 = false;
        // this.$nextTick(() => this.$refs.crudrec1.dicInit("cascader"));
        console.log(this.form, 111111);
        // console.log(this.form, 111111);
      });
    },
    initData(type) {
@@ -543,7 +556,8 @@
  //   }
  // },
  mounted() {
    this.onLoad1(this.page1, this.query1);
    // this.onLoad1(this.page1, this.query1);
    this.$store.commit("setWindowSizeHeightAdd");
  },
};
</script>
@@ -558,4 +572,4 @@
.el-collapse-item {
  padding-top: 15px !important;
}
</style>
</style>