刘璐珈噶东

This commit is contained in:
Vergil
2020-02-24 09:32:44 +08:00
parent b3513a9a3d
commit 6c08cd2ea8
19 changed files with 1217 additions and 822 deletions

View File

@@ -1,30 +1,20 @@
<template>
<section class="app-main">
<!-- <router-view :key="key"></router-view> -->
<!--<section class="app-main">-->
<section id="app-main" class="app-main">
<transition name="fade-transform" mode="out-in">
<keep-alive id="keepAlive">
<router-view v-if="$route.meta.keepAlive"/>
<!-- or name="fade" -->
<!-- <router-view :key="key"></router-view> -->
<keep-alive>
<router-view/>
</keep-alive>
</transition>
<transition name="fade-transform" mode="out-in">
<router-view v-if="!$route.meta.keepAlive"/>
</transition>
</section>
</template>
<script>
import store from '@/store'
export default {
name: 'AppMain',
computed: {
keepAliveList() {
var keepAliveList = ''
store.state.tagsView.cachedViews.map(v => {
keepAliveList = keepAliveList + v + ','
})
console.log(keepAliveList)
return keepAliveList
}
// key() {
// return this.$route.name !== undefined ? this.$route.name + +new Date() : this.$route + +new Date()
// }
@@ -35,9 +25,8 @@ export default {
<style scoped>
.app-main {
/*50 = navbar */
width: 1380px;
position: relative;
overflow: hidden;
/*min-height:calc(100vh - 85px);background: url('../../../../static/bg.jpg') repeat;*/
/*min-height:calc(100vh - 50px);background: url('../../../../static/bg.jpg') repeat;*/
}
</style>

View File

@@ -27,13 +27,6 @@
import { mapGetters } from 'vuex'
import Breadcrumb from '@/components/Breadcrumb'
import Hamburger from '@/components/Hamburger'
import { searchTable1 } from '@/api/PurchasingCenter/PurchaseContractApproval'
import { getMaterial, getMaterial_NOTES, setChakan } from '@/api/PurchasingCenter/MaterialManagement'
import { initApproval, initApprovalOffline } from '@/api/PurchasingCenter/FundApproval'
import { searchUrgentItem } from '@/api/ManufacturingCenter/InitialProduction'
import { searchTable1 as searchTableInvoice } from '@/api/PurchasingCenter/InvoiceSettlementApprove'
import { searchRequestFund } from '@/api/PurchasingCenter/PurchaseContractRequestFund'
import { getPickingList, setPickingList } from '@/api/Inventory/MaterialOut'
export default {
components: {
Breadcrumb,
@@ -64,200 +57,7 @@ export default {
'token'
])
},
mounted() {
if (this.id.toString() === '3') {
this.checkApproval()
this.timer = setInterval(this.checkApproval, 1000 * 60 * 5)
} else if (this.token.toString() === '11' || this.token.toString() === '12') {
this.comfirmMaterial()
this.timer = setInterval(this.comfirmMaterial, 1000 * 60 * 5)
} else if (this.token.toString() === '2' || this.token.toString() === '3') {
this.comfirmMaterial_CG()
this.timer = setInterval(this.comfirmMaterial_CG, 1000 * 60 * 5)
} else if (this.token.toString() === '15') {
this.comfirmMaterial_KG()
this.timer = setInterval(this.comfirmMaterial_KG, 1000 * 60 * 5)
} else if (this.token.toString() === '5') {
this.comfirmUrgentItem()
this.timer = setInterval(this.comfirmUrgentItem, 1000 * 60)
}
},
beforeDestroy() {
clearInterval(this.timer)
},
methods: {
comfirmMaterial_KG() {
getPickingList().then(res => {
if (res.data.length) {
this.noticeContractKG = null
this.noticeContractKG = this.$notify.success({
title: '提示',
message: '您有新的领料单需要备料确认,请及时处理,点击查看',
onClick: () => {
setPickingList().then(res => {
this.$router.push({ path: '/Inventory/MaterialOut' })
setTimeout(this.noticeContractKG.close(), 1000)
})
},
duration: 1000 * 60
})
}
})
},
comfirmMaterial_CG() {
getMaterial_NOTES().then(res => {
if (res.data.length) {
this.noticeContract1 = null
this.noticeContract1 = this.$notify.success({
title: '提示',
message: '有新采购物料审批结果,点击查看',
onClick: () => {
setChakan().then(res => {
this.$router.push({ path: '/PurchasingCenter/MaterialMProcure' })
setTimeout(this.noticeContract1.close(), 1000)
})
},
duration: 1000 * 60
})
}
})
if (this.token.toString() === '2') {
searchRequestFund(1, 9999, 0, 0, 0, 0, 0).then(res => {
if (res.data.length) {
this.noticeContract2 = null
this.noticeContract2 = this.$notify.success({
title: '提示',
message: '有合同请款申请审批结果,点击查看',
onClick: () => {
setChakan().then(res => {
this.$router.push({ path: '/PurchasingCenter/PurchaseContractRequestFund' })
setTimeout(this.noticeContract2.close(), 1000)
})
},
duration: 1000 * 60
})
}
})
initApproval(1, 999, 1).then(res => {
if (res.data.rows.length) {
this.noticeContract3 = null
this.noticeContract3 = this.$notify.success({
title: '提示',
message: '有合同请款申请待审批,点击查看',
onClick: () => {
setChakan().then(res => {
this.$router.push({ path: '/PurchasingCenter/FundApproval1' })
setTimeout(this.noticeContract3.close(), 1000)
})
},
duration: 1000 * 60
})
}
})
} else if (this.token.toString() === '3') {
searchRequestFund(1, 99999, 0, 0, 0, 0, 0).then(res => {
if (res.data.length) {
this.noticeContract4 = null
this.noticeContract4 = this.$notify.success({
title: '提示',
message: '有合同请款申请审批结果,点击查看',
onClick: () => {
setChakan().then(res => {
this.$router.push({ path: '/PurchasingCenter/PurchaseContractRequestFund' })
setTimeout(this.noticeContract4.close(), 1000)
})
},
duration: 1000 * 60
})
}
})
}
},
comfirmMaterial() {
getMaterial().then(res => {
if (res.data.length) {
this.noticeContract5 = null
this.noticeContract5 = this.$notify.success({
title: '提示',
message: '您有采购物料申请待审批,请及时处理,点击查看',
onClick: () => {
this.$router.push({ path: '/PurchasingCenter/MaterialManagement' })
setTimeout(this.noticeContract5.close(), 1000)
},
duration: 1000 * 60
})
}
})
},
checkApproval() {
searchTable1(1, 999, 0, null, null, 0, 0, 0, 0, 0, 0).then(res => {
if (res.data.total) {
this.noticeContract6 = null
this.noticeContract6 = this.$notify.success({
title: '提示',
message: '您有采购合同待审批,请及时处理,点击查看',
onClick: () => {
this.$router.push({ path: '/PurchasingCenter/PurchaseContractApproval' })
setTimeout(this.noticeContract6.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.success({
title: '提示',
message: '您有合同请款申请待审批,请及时处理,点击查看',
onClick: () => {
this.$router.push({ path: '/PurchasingCenter/FundApproval2' })
setTimeout(this.noticeFund.close(), 1000)
},
duration: 1000 * 60 * 5
})
}
})
searchTableInvoice(0, null, null, 1, 999, this.token).then(res => {
if (res.data.total) {
this.noticeInvoice = null
this.noticeInvoice = this.$notify.success({
title: '提示',
message: '您有发票结算申请待审批,请及时处理,点击查看',
onClick: () => {
this.$router.push({ path: '/PurchasingCenter/InvoiceSettlementApprove' })
setTimeout(this.noticeInvoice.close(), 1000)
},
duration: 1000 * 60 * 5
})
}
})
},
comfirmUrgentItem() {
console.log(1111)
searchUrgentItem().then(res => {
if (res.data.length > 0) {
this.noticeContractJJ = null
this.noticeContractJJ = this.$notify.success({
title: '提示',
message: '您有加急件未打印,请及时处理',
onClick: () => {
setTimeout(this.noticeContractJJ.close(), 1000)
},
duration: 1000 * 60
})
}
})
},
toggleSideBar() {
this.$store.dispatch('ToggleSideBar')
},

View File

@@ -39,7 +39,6 @@ import { validateURL } from '@/utils/validate'
import Item from './Item'
export default {
inject: ['reload'],
name: 'SidebarItem',
components: { Item },
props: {
@@ -98,8 +97,6 @@ export default {
e.preventDefault()
const path = this.resolvePath(routePath)
this.$router.push(path)
// 关闭标签不缓存 20200220 ZDY 974548
// this.reload()
}
}
}

View File

@@ -53,17 +53,21 @@ export default {
},
methods: {
// generateTitle, // generateTitle by vue-i18n
// generateRoute() {
// if (this.$route.name) {
// return this.$route
// }
// return false
// },
generateRoute() {
switch (this.$route.name) {
// 生产监控
case 'EquipmentMonitoring':
document.getElementsByClassName('app-main')[0].style.width = '1710px'
document.getElementsByClassName('main-container')[0].style.minWidth = '1710px'
document.getElementById('app-main').style.width = '1710px'
break
case '0': // 补位用switch至少两个case,否则显示警告)
break
// 默认
default:
document.getElementsByClassName('app-main')[0].style.width = '1380px'
document.getElementsByClassName('main-container')[0].style.minWidth = '1380px'
document.getElementById('app-main').style.width = '1380px'
}
if (this.$route.name) {
return this.$route
@@ -71,9 +75,6 @@ export default {
return false
},
isActive(route) {
if (!this.$route.meta.keepAlive) {
this.$route.meta.keepAlive = true
}
return route.path === this.$route.path || route.name === this.$route.name
},
addViewTags() {
@@ -104,14 +105,8 @@ export default {
if (this.isActive(view)) {
const latestView = views.slice(-1)[0]
if (latestView) {
if (this.$route.meta.keepAlive) {
this.$route.meta.keepAlive = false
}
this.$router.push(latestView.path)
} else {
if (this.$route.meta.keepAlive) {
this.$route.meta.keepAlive = false
}
this.$router.push('/')
}
}