审批half

This commit is contained in:
chenjianan
2019-05-28 15:24:29 +08:00
parent 9ff37964b5
commit d8357d9647
2 changed files with 64 additions and 6 deletions

View File

@@ -117,9 +117,9 @@
@current-change="handleCurrentChange2"/>
</div>
</el-card>
<h3 style="margin-top: 0">采购合同</h3>
<h3 id="firstAnchor" style="margin-top: 0">采购合同</h3>
<div id="print" class="print" style="min-height:500px;margin: 0px auto;width:800px;border:1px solid black" v-html="contractDetail1"/>
<h3 style="">离线合同</h3>
<h3 id="secondAnchor" style="">离线合同</h3>
<el-table v-loading="" :data="contractDetail2" :summary-method="getSummaries" border style="margin-top:10px;max-height: 500px;" height="500px" size="mini" show-summary>
<el-table-column label="离线合同编号" align="center" min-width="150">
<template slot-scope="scope">
@@ -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
})

View File

@@ -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')
},