主数据管理:高级查询,状态查询,快速查询,当查询出多页时,点击分页的页码能够保留上一次的查询条件进行分页,点击分类树节点时则置空查询条件。
已修改3个文件
49 ■■■■ 文件已修改
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/advanced-query/advancedQuery.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/MasterData/items.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -348,6 +348,7 @@
      fileOptions: {},
      result: '',
      elapsedTime: '',
      conditionMap: [],
    };
  },
  computed: {
@@ -428,7 +429,7 @@
          if (_index == 0) {
            this.keyWordFind = record.queryField;
            console.log(record)
            //console.log(record)
          }
        })
        this.tableHeadFindDatas = newval;
@@ -480,11 +481,15 @@
    },
  },
  methods: {
    // 置空查询条件
    resetConditionMap() {
      this.conditionMap = {};
    },
    CodeLinkHandler(row) {
      this.LinkObject = row;
      this.LinkVisible = true;
      this.LinkList = Object.keys(row).map(property => property)
    },
    //状态搜索
    cellSelectHandler(row) {
@@ -496,6 +501,7 @@
    },
    cellStatusFind(lcstatus) {
      this.isLoading = true;
      this.conditionMap["conditionMap[lcstatus]"] = lcstatus;
      TableData({
        templateOid: this.templateOid,
        codeClassifyOid: this.codeClassifyOid,
@@ -855,6 +861,7 @@
        codeClassifyOid: this.codeClassifyOid,
        page: this.page.currentPage,
        limit: this.page.pageSize,
        ...this.conditionMap, /**带上分页查询条件 */
      });
      const endTime = performance.now();
      this.elapsedTime = Math.floor(endTime - startTime) * 1;
@@ -940,6 +947,7 @@
          sort: val.prop,
          page: this.page.currentPage,
          limit: this.page.pageSize,
          ...this.conditionMap
        });
        this.data = data.data;
      } finally {
@@ -949,7 +957,6 @@
    //分页刷新
    async onLoad(val) {
      this.isLoading = true;
      try {
        let conditionMap = {};
        if (this.statusSelect !== 'all') {
@@ -1002,11 +1009,14 @@
    },
    // 高级查询
    async echoContion(val) {
      this.conditionMap = val;
      try {
        const res = await FindData({
          templateOid: this.templateOid,
          codeClassifyOid: this.codeClassifyOid,
          ...val,
          page: this.page.currentPage = 1,/** 每次点击高级查询都应该从第一页开始*/
          limit: this.page.pageSize
        });
        this.tableData = res.data.data;
        this.page.total = res.data.total
@@ -1089,6 +1099,8 @@
    tableFindInp() {
      this.isLoading = true;
      try {
        // 存储查询条件,主要是为了点击页码时带上这个条件
        this.conditionMap["conditionMap[" + this.keyWordFind + "]"] = '*' + this.WupinFindValue + '*';
        TableData({
          templateOid: this.templateOid,
          codeClassifyOid: this.codeClassifyOid,
Source/UBCS-WEB/src/components/advanced-query/advancedQuery.vue
@@ -104,6 +104,7 @@
<script>
import { getDictionary } from "@/api/omd/enum";
import moment from 'moment';
import vciWebRefer from '../refer/vciWebRefer.vue';
export default {
  components: { vciWebRefer },
@@ -228,13 +229,12 @@
                            //console.log(item.referConfigData.options);
                            //console.log(item);
                        }
                        // TODO: 这儿修改一下参照的查询条件
                        let conditions = [];
                        if(item.fieldType==='text'){
                            conditions = this.searchConditions;
                        }else if (item.fieldType==='combox'|| item.fieldType==='truefalse'){
                          conditions = this.switchSearchConditions;
                        }else if (item.fieldType==='datetime') {
                    }else if (item.fieldType==='datetime' || item.fieldType==='date') {
                          conditions = this.dateConditions;
                        }else {
                            conditions = this.referSearchConditions;
@@ -254,7 +254,6 @@
            //console.log(this.initOptions);
            //console.log(this.searchFormArrays);
        },
        /** 为参照类型时值选择之后的处理 */
        setReferValue(data,index){
            if(data.field) {
@@ -313,15 +312,27 @@
                    // 存在相同的查询条件
                    if(condtionParam['conditionMap['+searchConditions[index].queryField+']']+'' != 'undefined' ) {
                        this.$message.warning("存在重复查询条件,请仔细核对!");
                        console.log(condtionParam['conditionMap['+searchConditions[index].queryField+']']);
                        //console.log(condtionParam['conditionMap['+searchConditions[index].queryField+']']);
                        return false;
                    }
                    let fieldType = this.initOptions[index].fieldType;
                    // 当出现查询日期的格式时,需要对日期格式进行处理
                    if(fieldType==='datetime' || fieldType==='date'){
                        // 将时间转换为本地时间
                        let localTime = moment.utc(searchConditions[index].fieldValue).local();
                        // 格式化时间为您想要的格式
                        let formattedTime = localTime.format('YYYY-MM-DD HH:mm:ss');
                        condtionParam['conditionMap['+searchConditions[index].queryField+searchConditions[index].condition+']'] = formattedTime;
                        //console.log(formattedTime);
                    }else{
                    //拼接成map对象,将查询对象和condition拼接在一起,组成高级查询map的key
                    condtionParam['conditionMap['+searchConditions[index].queryField+searchConditions[index].condition+']'] = searchConditions[index].fieldValue;
                }
            }
            }
            // 查询条件没有出现重复属性,并且过滤掉了空值,就传递给父组件
            console.log(condtionParam);
            //console.log(condtionParam);
            this.$emit('echoContion',condtionParam)
            this.isShowDialog = false;
        },
Source/UBCS-WEB/src/views/MasterData/items.vue
@@ -40,6 +40,7 @@
        :nodeClickList="this.nodeClickList"
        @currentPage="currentPages"
        @pageSize="pageSizes"
        ref="vciMasterCrud"
      >
      </VciMasterCrud>
    </el-main>
@@ -55,7 +56,7 @@
      page: {
        total: 0,
        currentPage: 1,
        pageSize: 10,
        pageSize: 100,
        pageSizes: [10, 30, 50, 100, 200],
      },
      pageSize: "100",
@@ -79,6 +80,12 @@
  methods: {
    nodeClickLists(val){
      this.nodeClickList=val;
      // 点击树节点时重置当前页和页数
      this.page.pageSize = 100;
      this.page.currentPage = 1;
      // 重置保存的高级查询查询条件和快速查询条件
      const childComponent = this.$refs.vciMasterCrud;
      childComponent.conditionMap = {}; // 修改子组件的data中的属性
    },
    TreeValueEmit(val) {
      this.TreeValue = val;
@@ -112,7 +119,6 @@
    },
    nodeClickTem(val) {
      this.templateOid = val;
    },
    tableHeadBttoms(val) {
      this.masterVrBtnList = val;