审批half
This commit is contained in:
@@ -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')
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user