tangzy
2021-11-16 7edeaaa39078fcbc9fc773a86aa0cc9775d48306
src/views/securityEquipment/car.vue
@@ -26,7 +26,6 @@
            >删 除
          </el-button>
          <el-button
            style="display: none"
            type="success"
            size="small"
            plain
@@ -66,6 +65,7 @@
  props: ["fromDeptId"],
  data() {
    return {
      deptIds: "",
      excelBox: false,
      excelForm: {},
      excelOption: {
@@ -83,7 +83,7 @@
              res: "data",
            },
            tip: "请上传 .xls,.xlsx 标准格式文件",
            action: "/api/car/import-examSubject",
            action: "/api/car/import-car?deptId=" + this.deptIds,
          },
          {
            label: "模板下载",
@@ -130,6 +130,9 @@
      return ids.join(",");
    },
  },
  mounted() {
    this.deptIds = this.userInfo.dept_id;
  },
  created() {
    var that = this;
    if (
@@ -159,7 +162,7 @@
      done();
    },
    handleTemplate() {
      window.open(`/api/car/export-template`);
      window.open(`/api/car/export-template-car`);
    },
    sizeChange(val) {
      this.page1.currentPage = 1;
@@ -173,14 +176,6 @@
      //   this.$message.success("页码" + val);
    },
    rowSave(form, done, loading) {
      // var that = this;
      //   var form = this.data[0];
      //   delete form.id;
      //   for (var k = 0; k < 13; k++) {
      // console.log
      // form["deptId"] = form.tenantName;
      // delete form.tenantName;
      // console.log(form);
      if (this.fromDeptId != undefined) {
        form["deptId"] = this.fromDeptId;
      }
@@ -188,7 +183,7 @@
        form["deptId"] = this.useifid;
      }
      adddata(form).then(
        (res) => {
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
@@ -311,17 +306,7 @@
        params["deptId"] = this.fromDeptId;
        // this.closeDep("deptId");
      } else if (this.useifid != 266) {
        console.log(123);
        params["deptId"] = this.useifid;
        // this.closeDep("deptId");
        // for (let k in this.option.column) {
        // if (this.option.column[k].prop == "deptId") {
        // this.option.column[4].search = false;
        // this.option.column[k].hide = true;
        // this.option.column[k].addDisplay = false;
        // this.option.column[k].editDisplay = false;
        // }
        // }
      } else {
        this.openDep("deptId");
      }
@@ -330,28 +315,38 @@
      if (this.userInfo.role_name == "公安管理员") {
        params["jurisdiction"] = that.userInfo.jurisdiction;
      }
      //保安公司进入
      if (this.userInfo.role_name == "保安公司管理员") {
        params["deptId"] = that.userInfo.dept_id;
        //导入action 修改
        const importColumn = that.findObject(
          that.excelOption.column,
          "excelFile"
        );
        importColumn.action =
          "/api/car/import-car?deptId=" + that.userInfo.dept_id;
      }
      getdata(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).then((res) => {
        // console.log(res);
        const data = res.data.data;
        this.page.total = data.total;
        data.records.forEach(item=>{
          if(item.numberType==-1){
            item.numberType=null;
          }
          if(item.carType==-1){
            item.carType=null;
          }
        })
        this.data = data.records;
        console.log(this.data);
        this.loading = false;
      });
    },
  },
  mounted() {
    // this.Ourdata = data;
    // this.getData();
    // this.onLoad(this.page);
    // var dept_id = JSON.parse(
    //   window.localStorage.getItem("saber-userInfo")
    // ).content.dept_id;
  },
};
</script>