田源
2023-12-20 7ea14dca63a1060547bd8a1e4aa44bbc9aaa1ec8
主数据日期搜索
已修改3个文件
67 ■■■■ 文件已修改
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/template/Business.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/styles/tags.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -15,14 +15,23 @@
                  item.name
                }}
              </el-button>
              <span v-if="tableHeadFindData.length > 0">
              <el-select slot="prepend" v-model="keyWordFind" placeholder="请选择" size="small">
                <el-option v-for="item in tableHeadFindData" :key="item.id" :label="item.label"
                           :value="item.prop"></el-option>
              <span v-if="tableHeadFindData.length > 0 ">
              <el-select slot="prepend" v-model="keyWordFind" placeholder="请选择" size="small" @change="searchChange">
                <el-option v-for="item in tableHeadFindData" :key="item.id" :label="item.label" :value="item.prop" ></el-option>
              </el-select>
              <el-input v-model="WupinFindValue" placeholder="请输入关键字按回车查询"
                        size="small" style="width: 180px; margin-left: 5px; margin-top: 10px"
                        size="small" style="width: 180px; margin-left: 5px; margin-top: 10px" v-if="!isTimeStatus"
                        @keyup.enter.native="tableFindInp"></el-input>
              </span>
              <span class="block"  v-if="tableHeadFindData.length > 0  && isTimeStatus">
                <el-date-picker
                  v-model="dateValue"
                  size="small"
                  type="date"
                  style="margin-left: 5px"
                  @change="dateChange"
                  placeholder="选择日期">
                </el-date-picker>
              </span>
              <span v-if="tableHeadFindData.length > 0" style="margin-left: 10px">
               <p style="font-size: 13px;display: inline-block;"> 状态:</p>
@@ -191,6 +200,7 @@
import fileInHtml from "@/components/file/inHtml.vue";
import {getUserInfo} from "@/api/system/user";
import func from "@/util/func";
import moment from "moment/moment";
export default {
  components: {
@@ -255,6 +265,9 @@
  },
  data() {
    return {
      isTimeStatus:false,
      isTimeName:'',
      dateValue:"",
      //批量编辑对话框
      bulkeditvisible: false,
      LinkVisible: false,
@@ -426,7 +439,12 @@
          if (_index == 0) {
            this.keyWordFind = record.queryField;
          }
          };
          // if(record.fieldType === "datetime"){
          //       this.isTimeStatus = true;
          //       console.log(this.isTimeStatus)
          //       console.log(record)
          // }
        })
        this.tableHeadFindDatas = newval;
        if (newval) {
@@ -1090,6 +1108,37 @@
      this.batchImportData.type = type
      this.batchImportData.codeClassifyOid = this.codeClassifyOid
    },
    searchChange(val) {
      this.isTimeName = val;
      this.isTimeStatus = this.tableHeadFindData.some(item => {
        if (item.fieldType === "datetime" && item.prop === val) {
          return true;
        }
        return false;
      });
      // console.log(this.isTimeStatus)
    },
    dateChange(val){
      if(val){
        const momentDate = moment(this.dateValue);
        const dateString = momentDate.format("yyyy-MM-DD");
        this.isLoading = true;
        try {
          TableData({
            templateOid: this.templateOid,
            codeClassifyOid: this.codeClassifyOid,
            page: this.page.currentPage,
            limit: this.page.pageSize,
            ['conditionMap[' + this.keyWordFind + ']']:  dateString
          }).then(res => {
            this.tableData = res.data.data;
            this.page.total = res.data.total;
          })
        } finally {
          this.isLoading = false;
        }
      }
    },
    //输入回车搜索
    tableFindInp() {
      this.isLoading = true;
Source/UBCS-WEB/src/components/template/Business.vue
@@ -202,4 +202,4 @@
            margin: 15px 0 16px;
        }
    }
</style>
</style>
Source/UBCS-WEB/src/styles/tags.scss
@@ -1,7 +1,7 @@
.avue-tags {
    user-select: none;
    user-select: none;
    position: relative;
    padding: 0 10px;
    margin-bottom: 10px;
@@ -89,4 +89,4 @@
        padding: 1px 0 0 15px;
        box-sizing: border-box;
    }
}
}