Administrator
2021-08-07 bc3f630d4cdbaad3cd4620cc01fd6f693f07dfcd
src/views/dispatch/dispatchChildoperable.vue
@@ -77,9 +77,11 @@
  update1,
  remove1,
} from "@/api/dispatch/dispatch";
import { getDept } from "@/api/system/dept";
export default {
  data() {
    let baseUrl = "https://cli.avuejs.com/api/area";
    return {
      // typeTABS: {}, //标签页
      // optionTABS: {
@@ -133,6 +135,8 @@
      //   selection: true,
      //   column: column,
      // },
      deptCategory: "",
      deptId: "",
      loading1: true, //派遣记录
      selectionList1: [],
@@ -150,12 +154,12 @@
        // menu: false,
        searchSize: "mini",
        searchMenuSpan: 8,
        height: 563,
        height: 623,
        cellBtn: false,
        // addBtn: false,
        // menuWidth: 160,
        align: "center",
        // selection: true,
        selection: true,
        column: [
          // 派遣服务公司登记
          // {
@@ -168,21 +172,74 @@
          //     // editDisplay: false,
          //     // addDisplay: false
          // },
          // {
          //   label: "保安公司",
          //   prop: "deptId",
          //   labelWidth: 120,
          //   searchLabelWidth: 120,
          //   searchSpan: 4,
          //   dicUrl:
          //     "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
          //   props: {
          //     label: "title",
          //     value: "id",
          //   },
          //   search: true,
          //   overHidden: true,
          //   type: "select",
          //   rules: [
          //     {
          //       required: true,
          //       message: "请输入保安公司",
          //       trigger: "blur",
          //     },
          //   ],
          // },
          {
            label: "派遣单位",
            prop: "dispatcherCompany",
            addDisplay: false,
            editDisplay: false,
          },
          // {
          //   label: "派遣单位",
          //   prop: "dispatcherUnitId",
          //   labelWidth: 120,
          //   searchLabelWidth: 120,
          //   dicUrl: "/api/dispatcherUnit/page-tree",
          //   props: {
          //     label: "name",
          //     value: "id",
          //   },
          //   hide: true,
          //   searchSpan: 4,
          //   search: true,
          //   overHidden: true,
          //   type: "tree",
          //   rules: [
          //     {
          //       required: true,
          //       message: "请输入保安公司",
          //       trigger: "blur",
          //     },
          //   ],
          // },
          {
            label: "保安公司",
            prop: "deptId",
            labelWidth: 120,
            searchLabelWidth: 120,
            searchSpan: 4,
            dicUrl:
              "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
            search: true,
            overHidden: true,
            type: "tree",
            searchSpan: 5,
            cascaderItem: ["name"],
            // cascaderItem: ["city", "area"],
            props: {
              label: "title",
              value: "id",
            },
            search: true,
            overHidden: true,
            type: "select",
            dicUrl: `/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697`,
            rules: [
              {
                required: true,
@@ -192,47 +249,73 @@
            ],
          },
          {
            label: "派遣单位",
            prop: "id",
            width: 120,
            label: "保安员",
            prop: "name",
            labelWidth: 120,
            searchLabelWidth: 120,
            dicUrl: "/api/page-tree",
            type: "tree",
            search: true,
            searchSpan: 5,
            cell: true,
            props: {
              label: "name",
              label: "realName",
              value: "id",
            },
            searchSpan: 4,
            search: true,
            overHidden: true,
            type: "select",
            dicUrl: `/api/blade-user/page-security-unit?deptId={{deptId}}`,
            rules: [
              {
                required: true,
                message: "请输入保安公司",
                message: "请选择保安",
                trigger: "blur",
              },
            ],
          },
          {
            label: "保安人名称",
            prop: "name",
            search: true,
            searchSpan: 4,
            labelWidth: 120,
            searchLabelWidth: 120,
            // overHidden: true
            rules: [
              {
                required: true,
                message: "请输入保安人名称",
                trigger: "click",
              },
            ],
          },
          // {
          //   width: 120,
          //   label: "保安人名称",
          //   prop: "area",
          //   cell: true,
          //   props: {
          //     label: "name",
          //     value: "code",
          //   },
          //   type: "select",
          //   dicUrl: `${baseUrl}/getArea/{{key}}`,
          //   rules: [
          //     {
          //       required: true,
          //       message: "请选择地区",
          //       trigger: "blur",
          //     },
          //   ],
          // },
          // {
          //   label: "保安人名称",
          //   prop: "name",
          //   search: true,
          //   searchSpan: 4,
          //   labelWidth: 120,
          //   searchLabelWidth: 120,
          //   // overHidden: true
          //   type: "tree",
          //   dicUrl: "/api/blade-user/page-security",
          //   props: {
          //     label: "realName",
          //     value: "postId",
          //   },
          //   rules: [
          //     {
          //       required: true,
          //       message: "请输入保安人名称",
          //       trigger: "click",
          //     },
          //   ],
          // },
          {
            label: "身份证",
            prop: "cardid",
            labelWidth: 120,
            overHidden: true,
            rules: [
              {
                required: true,
@@ -260,7 +343,8 @@
            valueFormat: "yyyy-MM-dd hh:mm:ss",
            labelWidth: 120,
            searchSpan: 4,
            search: true,
            // search: true,
            overHidden: true,
            rules: [
              {
                required: true,
@@ -277,6 +361,7 @@
            format: "yyyy-MM-dd hh:mm:ss",
            valueFormat: "yyyy-MM-dd hh:mm:ss",
            labelWidth: 120,
            overHidden: true,
            rules: [
              {
                required: true,
@@ -287,6 +372,28 @@
            // search: true,
            // searchSpan: 5,
            // overHidden: true
          },
          {
            label: "派遣时间",
            prop: "releaseTimeRange",
            type: "datetime",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            searchValue: [this.getStartTime(), this.getEndTime()],
            searchRange: true,
            searchSpan: 5,
            hide: true,
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            search: true,
            rules: [
              {
                required: true,
                message: "请输入时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "派遣地址",
@@ -602,6 +709,26 @@
      this.onLoad1(this.page1, this.query1);
    },
    getStartTime() {
      if (
        this.$route.query.startTime != undefined &&
        this.$route.query.startTime != null &&
        this.$route.query.startTime != ""
      ) {
        return this.$route.query.startTime;
      }
      return "";
    },
    getEndTime() {
      if (
        this.$route.query.endTime != undefined &&
        this.$route.query.endTime != null &&
        this.$route.query.endTime != ""
      ) {
        return this.$route.query.endTime;
      }
      return "";
    },
    //
    onLoad1(page, params = {}) {
      this.loading1 = true;
@@ -611,10 +738,29 @@
      // params["dispatcherUnitId"] = this.id;
      // console.log(params, "get");
      // console.log(page);
      var values;
      const { releaseTimeRange } = this.query1;
      if (releaseTimeRange) {
        values = {
          ...params,
          beginTime: releaseTimeRange[0],
          overTime: releaseTimeRange[1],
          ...this.query,
        };
        values.releaseTimeRange = null;
      } else {
        values = {
          ...params,
          ...this.query,
        };
      }
      console.log(values);
      getdata1(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
        // Object.assign(params, this.query)
        values
      ).then((res) => {
        // console.log(res);
        const data = res.data.data;
@@ -668,6 +814,27 @@
    //   this.obj0.name = " 未选择派遣单位";
    // }
  },
  // onLoad(page, params = {}) {
  //   this.deptId = JSON.parse(
  //       window.localStorage.getItem("saber-userInfo")
  //     ).content.dept_id;
  //     //获取当前用户部门信息,判断是否为公安,如果是公安,则只能查看公告信息
  //     var that = this;
  //     getDept(this.deptId).then((res) => {
  //       var deptCategory = res.data.data.deptCategory;
  //       deptCategory == 1
  //         ? (that.deptCategory = true)
  //         : (that.deptCategory = false);
  //       if (that.deptCategory) {
  //         params["deptId"] = this.deptId;
  //       }
  //       let values = {
  //         ...params,
  //       };
  //    })
  // }
};
</script>