田源
2023-12-14 67f7c054ae639bdf425c48309a62890b8c40809f
优化主数据代码
已修改1个文件
50 ■■■■■ 文件已修改
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -467,6 +467,7 @@
    templateOid: {
      handler(newval, oldval) {
        this.fileOptions.ownbizOid = "0";
        this.statusSelect = 'all'
      },
      deep: true,
    },
@@ -927,40 +928,48 @@
      })
    },
    // 排序
    sortChange(val) {
      // console.log(val)
    async sortChange(val) {
      try {
      this.isLoading = true;
      let order = "";
      if (val.order == "ascending") {
        order = "asc";
      } else {
        order = "desc";
      }
      TableData({
        const order = val.order == 'ascending' ? 'asc' : 'desc';
        const {data} = await TableData({
        templateOid: this.templateOid,
        codeClassifyOid: this.codeClassifyOid,
        order: order,
        sort: val.prop,
        page: this.page.currentPage,
        limit: this.page.pageSize,
      }).then((res) => {
        setTimeout(() => {
          this.data = res.data.data;
          this.isLoading = false;
        }, 100);
      });
        this.data = data.data;
      } finally {
        this.isLoading = false;
      }
    },
    //分页刷新
    async onLoad(val) {
      await TableData({
      this.isLoading = true;
      try {
        let conditionMap = {};
        if (this.statusSelect !== 'all') {
          conditionMap.lcstatus = this.statusSelect;
        }
        const res = await TableData({
        templateOid: this.templateOid,
        codeClassifyOid: this.codeClassifyOid,
        page: this.page.currentPage,
        limit: this.page.pageSize,
      }).then((res) => {
        this.tableData = res.data.data;
        this.doLayout()
          conditionMap
      });
        this.tableData = res.data.data;
        this.doLayout();
      } catch (error) {
        // 处理错误
      } finally {
        this.isLoading = false;
      }
    },
    //多选
    handleSelectionChange(list) {
@@ -1071,6 +1080,7 @@
    //输入回车搜索
    tableFindInp() {
      this.isLoading = true;
      try {
      TableData({
        templateOid: this.templateOid,
        codeClassifyOid: this.codeClassifyOid,
@@ -1080,8 +1090,10 @@
      }).then(res => {
        this.tableData = res.data.data;
        this.page.total = res.data.total;
        this.isLoading = false;
      })
      }  finally {
        this.isLoading = false;
      }
    }
  }