李林
2024-01-09 0dc1e26569ab570259fef29cd5cde70cb96d7f2c
src/components/view/data-comparison.vue
@@ -45,19 +45,20 @@
      </div>
      <div class="search">
         <div class="search_thing">
            <div class="search_label">账户名称:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="componentData.entity.name"
               ></el-input></div>
            <div class="search_label">主账户名称:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable
                  v-model="componentData.entity.name"></el-input></div>
         </div>
            <div class="search_thing">
            <div class="search_label">对比的账户名称:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="componentData.entity.comparisonName"
               ></el-input></div>
         <div class="search_thing">
            <div class="search_label">子账户名称:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable
                  v-model="componentData.entity.comparisonName"></el-input></div>
         </div>
            <div class="search_thing">
         <div class="search_thing">
            <div class="search_label">登记日期:</div>
            <div class="search_input">
               <el-date-picker size="small" v-model="componentData.entity.createTime" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" clearable></el-date-picker>
               <el-date-picker size="small" v-model="componentData.entity.createTime" type="date" placeholder="选择日期"
                  value-format="yyyy-MM-dd" clearable></el-date-picker>
            </div>
         </div>
         <div class="search_thing" style="padding-left: 30px;">
@@ -66,7 +67,8 @@
         </div>
      </div>
      <div class="table">
         <ValueTable ref="ValueTable" :url="$api.dataReporting.selectDataComparisonDtoPageList" :componentData="componentData" :key="upIndex"/>
         <ValueTable ref="ValueTable" :url="$api.dataReporting.selectDataComparisonDtoPageList"
            :componentData="componentData" :key="upIndex" />
      </div>
   </div>
</template>
@@ -82,8 +84,8 @@
            componentData: {
               entity: {
                  name: null,
                        comparisonName:null,
                        createTime: null,
                  comparisonName: null,
                  createTime: null,
                  orderBy: {
                     field: 'createTime',
                     order: 'desc'
@@ -102,7 +104,7 @@
            outPower: true
         }
      },
        created() {
      created() {
         var today = new Date();
         var yesterday = new Date(today);
         yesterday.setDate(today.getDate() - 1);
@@ -119,28 +121,32 @@
      },
      mounted() {
         this.entityCopy = this.HaveJson(this.componentData.entity)
         this.selectDataComparisonDtoPageList()
         // this.selectDataComparisonDtoPageList()
      },
      methods: {
         refreshTable() {
                if(this.componentData.entity.name == null || this.componentData.entity.name == '') {
                    this.$message.error('账户名称是必填项')
                }else if(this.componentData.entity.comparisonName == null || this.componentData.entity.comparisonName == '') {
                    this.$message.error('对比的账户名称是必填项')
                }else if(this.componentData.entity.createTime == null) {
                    this.$message.error('登记时间是必填项')
                }else if(this.componentData.entity.name === this.componentData.entity.comparisonName) {
                    this.$message.error('对比的账户不能重复')
                }else {
                    this.$refs['ValueTable'].selectList()
                }
            if (this.componentData.entity.name == null || this.componentData.entity.name == '') {
               this.$message.error('账户名称是必填项')
            } else if (this.componentData.entity.comparisonName == null || this.componentData.entity.comparisonName == '') {
               this.$message.error('对比的账户名称是必填项')
            } else if (this.componentData.entity.createTime == null) {
               this.$message.error('登记时间是必填项')
            } else if (this.componentData.entity.name === this.componentData.entity.comparisonName) {
               this.$message.error('对比的账户不能重复')
            } else {
               this.$refs['ValueTable'].selectList()
            }
         },
         refresh() {
            this.componentData.entity = this.HaveJson(this.entityCopy)
            this.upIndex++
         },
         selectDataComparisonDtoPageList() {
            this.$axios.get(this.$api.dataReporting.selectDataComparisonDtoPageList).then(res => {
            this.$axios.post(this.$api.dataReporting.selectDataComparisonDtoPageList, {
               headers: {
                  'Content-Type': 'application/json'
               }
            }).then(res => {
               res.data.forEach(a => {
                  a.isClick = false
                  a.look = false