diff --git a/src/views/PurchasingCenter/FundApproval2/index.vue b/src/views/PurchasingCenter/FundApproval2/index.vue
index 060db5c8..3037b8cc 100644
--- a/src/views/PurchasingCenter/FundApproval2/index.vue
+++ b/src/views/PurchasingCenter/FundApproval2/index.vue
@@ -117,9 +117,9 @@
@current-change="handleCurrentChange2"/>
-
采购合同
+ 采购合同
- 离线合同
+ 离线合同
@@ -205,11 +205,13 @@ export default {
},
methods: {
searchContactDetail(row) {
+ window.location.hash = '#firstAnchor'
searchContactDetail(row.采购合同流水号).then(response => {
this.contractDetail1 = response.data[0].合同内容
})
},
searchOfflineContactDetail(row) { // 查询离线合同明细
+ window.location.hash = '#secondAnchor'
searchMateriel(row.离线合同流水号).then(response => {
this.contractDetail2 = response.data
})
@@ -245,7 +247,6 @@ export default {
},
searchTable1() {
initApproval(this.pageCurrent1, this.pageSize1, 1).then(response => {
- console.log(response.data)
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
@@ -261,7 +262,6 @@ export default {
},
searchTable2() {
initApprovalOffline(this.pageCurrent2, this.pageSize2, 1).then(response => {
- console.log(response.data.rows)
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue
index 2a7eeab4..36fd2587 100644
--- a/src/views/layout/components/Navbar.vue
+++ b/src/views/layout/components/Navbar.vue
@@ -25,19 +25,77 @@
import { mapGetters } from 'vuex'
import Breadcrumb from '@/components/Breadcrumb'
import Hamburger from '@/components/Hamburger'
-
+import { searchTable1 } from '@/api/PurchasingCenter/PurchaseContractApproval'
+import { initApproval, initApprovalOffline } from '@/api/PurchasingCenter/FundApproval'
export default {
components: {
Breadcrumb,
Hamburger
},
+ data() {
+ return {
+ timer: '',
+ noticeContract: null,
+ noticeFund: null
+ }
+ },
computed: {
...mapGetters([
'sidebar',
- 'avatar'
+ 'avatar',
+ 'name',
+ 'id'
])
},
+ mounted() {
+ if (this.id.toString() === '3') {
+ this.checkApproval()
+ this.timer = setInterval(this.checkApproval, 1000 * 60)
+ }
+ },
+ beforeDestroy() {
+ clearInterval(this.timer)
+ },
methods: {
+ checkApproval() {
+ searchTable1(1, 999, 0, null, null, 0, 0, 0, 0, 0, 0).then(res => {
+ if (res.data.total) {
+ this.noticeContract = null
+ this.noticeContract = this.$notify.info({
+ title: '提示',
+ message: '您有采购合同待审批,请及时处理,点击查看',
+ onClick: () => {
+ this.$router.push({ path: '/PurchaseContractApproval/index' })
+ setTimeout(this.noticeContract.close(), 1000)
+ },
+ duration: 1000 * 60
+ })
+ }
+ })
+ const p1 = new Promise((resolve, reject) => {
+ initApproval(1, 999, 1).then(res => {
+ resolve(res)
+ })
+ })
+ const p2 = new Promise((resolve, reject) => {
+ initApprovalOffline(1, 999, 1).then(res => {
+ resolve(res)
+ })
+ })
+ Promise.race([p1, p2]).then(res => {
+ if (res.data.total) {
+ this.noticeFund = this.$notify.info({
+ title: '提示',
+ message: '您有合同请款申请待审批,请及时处理,点击查看',
+ onClick: () => {
+ this.$router.push({ path: '/FundApproval2/index' })
+ setTimeout(this.noticeFund.close(), 1000)
+ },
+ duration: 1000 * 60
+ })
+ }
+ })
+ },
toggleSideBar() {
this.$store.dispatch('ToggleSideBar')
},