Просмотр исходного кода

首页代办展示数据量和报销中其他报销bug修复

user5 1 год назад
Родитель
Сommit
42d77512fe

+ 41 - 28
src/views/layout/_common_top.vue

@@ -59,6 +59,14 @@
                 <color-picker></color-picker>
           </template>
         </el-menu-item>-->
+
+        <el-menu-item class="jp-navbar__avatar" @click="backlogClick()">
+          <el-dropdown :show-timeout="0" placement="bottom">
+            <span class="el-dropdown-link">待办</span>
+            <el-badge class="mark" v-if="backlogCount !== 0" :value="backlogCount" :max="99"style="top:-10px;left: -8px;"/>
+          </el-dropdown>
+        </el-menu-item>
+
         <el-menu-item class="hide-sm">
           <template slot="title">
                 <notice-icon
@@ -120,21 +128,22 @@
           {
             title: '站内信',
             count: 0,
-            list: [
-            ],
+            list: [],
             emptyText: '你已读完所有消息',
             emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg'
-          },
-          {
-            title: '待办',
-            count: 0,
-            list: [
-            ],
-            emptyText: '你已查看所有待办',
-            emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg'
           }
+          // },
+          // {
+          //   title: '待办',
+          //   count: 0,
+          //   list: [
+          //   ],
+          //   emptyText: '你已查看所有待办',
+          //   emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg'
+          // }
         ],
-        timer: null
+        timer: null,
+        backlogCount: 0
       }
     },
     components: {
@@ -210,7 +219,6 @@
       if (this.defaultLayout === 'top') {
         this.fixTopMenu()
       }
-      console.log('mounted')
       // 页面加载后
       // 1.在执行定时器前先执行一次获取接口数据的操作函数, 否则接口会1秒钟后才调用
       // 2.为了避免退出当前页面后,在其他页面也继续调用接口,退出前需要清除定时器.
@@ -274,7 +282,6 @@
           this.$store.commit('common/updateLeftMenuList', this.allMenuList)
         }
         this.notifyService.list({readFlag: 0, isSelf: true, current: 1, size: 10}).then(({data}) => {
-          console.log('通知')
           this.noticeTabs[0].count = data.total
           this.noticeTabs[0].url = '/notify/MyNotifyList'
           this.noticeTabs[0].list = data.records.map((item) => {
@@ -289,7 +296,6 @@
           })
         })
         this.mailBoxService.list({readStatus: 0, current: 1, size: 10}).then(({data}) => {
-          console.log('站内信')
           this.noticeTabs[1].count = data.total
           this.noticeTabs[1].url = '/mailbox/index'
           this.noticeTabs[1].list = data.records.map((item) => {
@@ -304,20 +310,19 @@
           })
         })
         this.taskService.todoList({current: 1, size: 10}).then(({data}) => {
-          console.log('待办')
-          this.noticeTabs[2].count = data.total
-          this.noticeTabs[2].url = '/sys/dashboard/workBench/PendingList'
-          this.noticeTabs[2].list = data.records.map((item) => {
-            console.log(123456)
-            return {
-              id: item.id,
-              avatar: '',
-              title: item.vars.title,
-              description: item.processDefinitionName,
-              datetime: item.createTime,
-              type: '待办'
-            }
-          })
+          // this.noticeTabs[2].count = data.total
+          this.backlogCount = data.total
+          // this.noticeTabs[2].url = '/sys/dashboard/workBench/PendingList'
+          // this.noticeTabs[2].list = data.records.map((item) => {
+          //   return {
+          //     id: item.id,
+          //     avatar: '',
+          //     title: item.vars.title,
+          //     description: item.processDefinitionName,
+          //     datetime: item.createTime,
+          //     type: '待办'
+          //   }
+          // })
         })
       },
       fixTopMenu () {
@@ -364,6 +369,14 @@
             }
           })
         })
+      },
+      backlogClick () {
+        this.$router.push({
+          path: '/sys/dashboard/workBench/PendingList',
+          query: {
+            num: 3
+          }
+        })
       }
     }
   }

+ 36 - 32
src/views/modules/cw/reimbursementApproval/info/CwProgramPageForm.vue

@@ -103,7 +103,7 @@
 
       <span slot="footer" class="dialog-footer">
       <el-button size="small" @click="close()">关闭</el-button>
-      <el-button size="small" type="primary" v-if="method != 'view'" @click="getProgram()" v-noMoreClick>({{dataListAllSelections.length}}) 确定</el-button>
+        <el-button size="small" type="primary" v-if="method != 'view'" @click="getProgram()" v-noMoreClick><span v-if="checkType === '1'">({{dataListAllSelections.length}})</span> 确定</el-button>
     </span>
     </el-dialog>
   </div>
@@ -215,42 +215,44 @@
         this.$emit('getProgram', rows)
       },
       list () {
-        this.loading = true
-        this.searchForm.status = '5'
-        this.projectRecordsService.list({
-          'current': this.tablePage.currentPage,
-          'size': this.tablePage.pageSize,
-          'orders': this.tablePage.orders,
-          ...this.searchForm
-        }).then(async ({data}) => {
-          this.dataList = data.records
-          this.tablePage.total = data.total
-          this.loading = false
-          // 在切换页后,将页面不需要勾选的数据取消勾选
-          let isCheck = []
-          for (let i = 0; i < this.tablePage.pageSize; i++) {
-            for (let j = 0; j < this.dataListAllSelections.length; j++) {
-              if (this.commonJS.isNotEmpty(this.dataList[i]) && this.commonJS.isNotEmpty(this.dataListAllSelections[j])) {
-                if (this.dataList[i].id === this.dataListAllSelections[j].id) { // 符合条件的数据勾选
-                  isCheck.push(this.dataList[i].id)
+        if (this.checkType === '1') {
+          this.loading = true
+          this.searchForm.status = '5'
+          this.projectRecordsService.list({
+            'current': this.tablePage.currentPage,
+            'size': this.tablePage.pageSize,
+            'orders': this.tablePage.orders,
+            ...this.searchForm
+          }).then(async ({data}) => {
+            this.dataList = data.records
+            this.tablePage.total = data.total
+            this.loading = false
+            // 在切换页后,将页面不需要勾选的数据取消勾选
+            let isCheck = []
+            for (let i = 0; i < this.tablePage.pageSize; i++) {
+              for (let j = 0; j < this.dataListAllSelections.length; j++) {
+                if (this.commonJS.isNotEmpty(this.dataList[i]) && this.commonJS.isNotEmpty(this.dataListAllSelections[j])) {
+                  if (this.dataList[i].id === this.dataListAllSelections[j].id) { // 符合条件的数据勾选
+                    isCheck.push(this.dataList[i].id)
+                  }
                 }
               }
             }
-          }
-          if (this.commonJS.isNotEmpty(isCheck)) {
-            for (let i = 0; i < this.tablePage.pageSize; i++) {
-              if (isCheck.includes(this.dataList[i].id)) {
-                await this.$refs.programTable.setCheckboxRow([this.dataList[i]], true)
-              } else {
+            if (this.commonJS.isNotEmpty(isCheck)) {
+              for (let i = 0; i < this.tablePage.pageSize; i++) {
+                if (isCheck.includes(this.dataList[i].id)) {
+                  await this.$refs.programTable.setCheckboxRow([this.dataList[i]], true)
+                } else {
+                  await this.$refs.programTable.setCheckboxRow([this.dataList[i]], false)
+                }
+              }
+            } else {
+              for (let i = 0; i < this.tablePage.pageSize; i++) {
                 await this.$refs.programTable.setCheckboxRow([this.dataList[i]], false)
               }
             }
-          } else {
-            for (let i = 0; i < this.tablePage.pageSize; i++) {
-              await this.$refs.programTable.setCheckboxRow([this.dataList[i]], false)
-            }
-          }
-        })
+          })
+        }
       },
       // 当前页
       currentChangeHandle ({currentPage, pageSize}) {
@@ -270,7 +272,9 @@
         this.list()
       },
       close () {
-        this.$refs.programTable.clearCheckboxReserve()
+        if (this.$refs.programTable) {
+          this.$refs.programTable.clearCheckboxReserve()
+        }
         this.dataListAllSelections = []
         this.detail = ''
         this.visible = false

+ 36 - 32
src/views/modules/finance/invoice/ProgramPageForm.vue

@@ -97,7 +97,7 @@
       </el-container>
       <span slot="footer" class="dialog-footer">
       <el-button size="small" @click="close()">关闭</el-button>
-      <el-button size="small" type="primary" v-if="method != 'view'" @click="getProgram()" v-noMoreClick>({{dataListAllSelections.length}}) 确定</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="getProgram()" v-noMoreClick><span v-if="checkType === '1'">({{dataListAllSelections.length}})</span> 确定</el-button>
     </span>
     </el-dialog>
   </div>
@@ -203,42 +203,44 @@
         this.$emit('getProgram', rows)
       },
       list () {
-        this.loading = true
-        this.searchForm.showInvoiceFlag = '1'  // showInvoiceFlag = '1'时,查询关联发票的开票状态。showInvoiceFlag为其他值或者为空时,不查询
-        this.programProjectListInfoService.list({
-          'current': this.tablePage.currentPage,
-          'size': this.tablePage.pageSize,
-          'orders': this.tablePage.orders,
-          ...this.searchForm
-        }).then(async ({data}) => {
-          this.dataList = data.records
-          this.tablePage.total = data.total
-          this.loading = false
-          // 在切换页后,将页面不需要勾选的数据取消勾选
-          let isCheck = []
-          for (let i = 0; i < this.tablePage.pageSize; i++) {
-            for (let j = 0; j < this.dataListAllSelections.length; j++) {
-              if (this.commonJS.isNotEmpty(this.dataList[i]) && this.commonJS.isNotEmpty(this.dataListAllSelections[j])) {
-                if (this.dataList[i].id === this.dataListAllSelections[j].id) { // 符合条件的数据勾选
-                  isCheck.push(this.dataList[i].id)
+        if (this.checkType === '1') {
+          this.loading = true
+          this.searchForm.showInvoiceFlag = '1'  // showInvoiceFlag = '1'时,查询关联发票的开票状态。showInvoiceFlag为其他值或者为空时,不查询
+          this.programProjectListInfoService.list({
+            'current': this.tablePage.currentPage,
+            'size': this.tablePage.pageSize,
+            'orders': this.tablePage.orders,
+            ...this.searchForm
+          }).then(async ({data}) => {
+            this.dataList = data.records
+            this.tablePage.total = data.total
+            this.loading = false
+            // 在切换页后,将页面不需要勾选的数据取消勾选
+            let isCheck = []
+            for (let i = 0; i < this.tablePage.pageSize; i++) {
+              for (let j = 0; j < this.dataListAllSelections.length; j++) {
+                if (this.commonJS.isNotEmpty(this.dataList[i]) && this.commonJS.isNotEmpty(this.dataListAllSelections[j])) {
+                  if (this.dataList[i].id === this.dataListAllSelections[j].id) { // 符合条件的数据勾选
+                    isCheck.push(this.dataList[i].id)
+                  }
                 }
               }
             }
-          }
-          if (this.commonJS.isNotEmpty(isCheck)) {
-            for (let i = 0; i < this.tablePage.pageSize; i++) {
-              if (isCheck.includes(this.dataList[i].id)) {
-                await this.$refs.programTable.setCheckboxRow([this.dataList[i]], true)
-              } else {
+            if (this.commonJS.isNotEmpty(isCheck)) {
+              for (let i = 0; i < this.tablePage.pageSize; i++) {
+                if (isCheck.includes(this.dataList[i].id)) {
+                  await this.$refs.programTable.setCheckboxRow([this.dataList[i]], true)
+                } else {
+                  await this.$refs.programTable.setCheckboxRow([this.dataList[i]], false)
+                }
+              }
+            } else {
+              for (let i = 0; i < this.tablePage.pageSize; i++) {
                 await this.$refs.programTable.setCheckboxRow([this.dataList[i]], false)
               }
             }
-          } else {
-            for (let i = 0; i < this.tablePage.pageSize; i++) {
-              await this.$refs.programTable.setCheckboxRow([this.dataList[i]], false)
-            }
-          }
-        })
+          })
+        }
       },
       // 当前页
       currentChangeHandle ({currentPage, pageSize}) {
@@ -258,7 +260,9 @@
         this.list()
       },
       close () {
-        this.$refs.programTable.clearCheckboxReserve()
+        if (this.$refs.programTable) {
+          this.$refs.programTable.clearCheckboxReserve()
+        }
         this.dataListAllSelections = []
         this.detail = ''
         this.visible = false