Administrator
2022-04-11 79d9fc857559982b00b68b2d709807bdc4cd286f
src/views/dispatch/dispatchChildoperableSee.vue
@@ -1,24 +1,30 @@
<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="[
      'dispatchChildoperable',
      $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>
@@ -29,7 +35,7 @@
  update1,
  remove1,
  getDispatcherUnitByDeptId,
  overDispatcher,
  overDispatcher
} from "@/api/dispatch/dispatch";
import { update, getListByDeptId } from "@/api/system/user";
import { mapState } from "vuex";
@@ -46,6 +52,7 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize
      },
      form: {},
      query1: {},
@@ -65,6 +72,7 @@
        // menuWidth: 160,
        align: "center",
        selection: true,
        ...this.$store.state.control.clearOtherBut,
        column: [
          // },
          {
@@ -77,7 +85,7 @@
            // searchSpan: 4,
            minWidth: 210,
            addDisplay: false,
            editDisplay: false,
            editDisplay: false
          },
          {
            label: "保安公司",
@@ -90,7 +98,7 @@
            cascaderItem: ["userIds"],
            props: {
              label: "title",
              value: "id",
              value: "id"
            },
            width: 180,
            dicUrl: `/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697`,
@@ -98,9 +106,9 @@
              {
                required: true,
                message: "请输入保安公司",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "派遣单位",
@@ -110,7 +118,7 @@
            // dicUrl: "/api/dispatcherUnit/page-tree?deptId={{key}}",
            props: {
              label: "name",
              value: "id",
              value: "id"
            },
            hide: true,
            searchSpan: 4,
@@ -121,9 +129,9 @@
              {
                required: true,
                message: "请输入派遣单位",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "保安员",
@@ -137,7 +145,7 @@
            hide: true,
            props: {
              label: "realName",
              value: "id",
              value: "id"
            },
            // dicUrl: `/api/blade-user/page-security-units?dispatch=1&deptId={{key}}`,
            dicUrl: `/api/blade-user/page-security-units?status=1&deptId={{key}}`,
@@ -146,9 +154,9 @@
              {
                required: true,
                message: "请选择保安",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "保安员",
@@ -170,9 +178,9 @@
              {
                required: true,
                message: "请选择保安",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
@@ -186,9 +194,9 @@
              {
                required: true,
                message: "请输入身份证",
                trigger: "click",
              },
            ],
                trigger: "click"
              }
            ]
            // search: true,
            // searchSpan: 4,
            // overHidden: true
@@ -215,9 +223,9 @@
              {
                required: true,
                message: "请输入派遣时间",
                trigger: "click",
              },
            ],
                trigger: "click"
              }
            ]
            // overHidden: true
          },
          {
@@ -232,9 +240,9 @@
              {
                required: true,
                message: "请输入结束时间",
                trigger: "click",
              },
            ],
                trigger: "click"
              }
            ]
            // search: true,
            // searchSpan: 4,
            // overHidden: true
@@ -257,9 +265,9 @@
              {
                required: true,
                message: "请输入时间",
                trigger: "blur",
              },
            ],
                trigger: "blur"
              }
            ]
          },
          {
            label: "派遣地址",
@@ -269,15 +277,15 @@
              {
                required: true,
                message: "请输入派遣地址",
                trigger: "click",
              },
            ],
                trigger: "click"
              }
            ]
            // search: true,
            // searchSpan: 4,
            // overHidden: true
          },
        ],
      },
          }
        ]
      }
    };
  },
  created() {
@@ -299,17 +307,17 @@
    // },
    ids1() {
      let ids1 = [];
      this.selectionList1.forEach((ele) => {
      this.selectionList1.forEach(ele => {
        ids1.push(ele.id);
      });
      return ids1.join(",");
    },
    ...mapState({
      userInfo: (state) => state.user.userInfo,
      userInfo: state => state.user.userInfo
    }),
    deps() {
      return this.form.deptId;
    },
    }
  },
  methods: {
@@ -345,15 +353,15 @@
      // }
      adddata1(form).then(
        (res) => {
        res => {
          this.onLoad1(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -380,11 +388,11 @@
          this.onLoad1(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -394,7 +402,7 @@
      this.$confirm("确定结束当前派遣?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return overDispatcher(row);
@@ -403,7 +411,7 @@
          this.onLoad1(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
        });
    },
@@ -418,7 +426,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return remove1(this.ids1);
@@ -427,7 +435,7 @@
          this.onLoad1(this.page1);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          this.$refs.crudrec1.toggleSelection();
        });
@@ -473,13 +481,13 @@
          ...params,
          beginTime: releaseTimeRange[0],
          overTime: releaseTimeRange[1],
          ...this.query,
          ...this.query
        };
        values.releaseTimeRange = null;
      } else {
        values = {
          ...params,
          ...this.query,
          ...this.query
        };
      }
@@ -498,19 +506,20 @@
        page.pageSize,
        // Object.assign(params, this.query)
        values
      ).then((res) => {
      ).then(res => {
        const data = res.data.data;
        this.page1.total = data.total;
        this.data1 = data.records;
        this.loading1 = false;
        // this.$nextTick(() => this.$refs.crudrec1.dicInit("cascader"));
        console.log(this.form, 111111);
        this.$store.commit("setWindowSizeHeightAdd");
        // console.log(this.form, 111111);
      });
    },
    initData(type) {
      var that = this;
      if (type == 1) {
        getDispatcherUnitByDeptId(null).then((res) => {
        getDispatcherUnitByDeptId(null).then(res => {
          const dispatcherUnitIdColumn = that.findObject(
            this.option1.column,
            "dispatcherUnitId"
@@ -519,19 +528,19 @@
        });
      }
      if (type == 2) {
        getDispatcherUnitByDeptId(that.userInfo.dept_id).then((res) => {
        getDispatcherUnitByDeptId(that.userInfo.dept_id).then(res => {
          const dispatcherUnitIdColumn = that.findObject(
            this.option1.column,
            "dispatcherUnitId"
          );
          dispatcherUnitIdColumn.dicData = res.data.data;
        });
        getListByDeptId(that.userInfo.dept_id, 1).then((res) => {
        getListByDeptId(that.userInfo.dept_id, 1).then(res => {
          const userIdsColumn = that.findObject(this.option1.column, "userIds");
          userIdsColumn.dicData = res.data.data;
        });
      }
    },
    }
  },
  //  watch: {
  //   // "form.deptId"() {
@@ -541,8 +550,9 @@
  //   }
  // },
  mounted() {
    this.onLoad1(this.page1, this.query1);
  },
    this.$store.commit("setWindowSizeHeightAdd");
    // this.onLoad1(this.page1, this.query1);
  }
};
</script>