Commit ad63356d authored by 李驰骋's avatar 李驰骋

要货审批通用页面调整

parent 97b9b88f
...@@ -365,17 +365,17 @@ export default { ...@@ -365,17 +365,17 @@ export default {
isReadonly() { isReadonly() {
return false return false
}, },
firstApprovalNode() {
var node = this.findFirstApprovalNode()
return node;
},
isFirstApprovalNode() { isFirstApprovalNode() {
if (this.tablePathData.length > 1 && this.tablePathData[1].statusId === 'executing') { const node = this.firstApprovalNode
return true return node && node.statusId === 'executing'
}
return false
}, },
firstApprovalOpinion() { firstApprovalOpinion() {
if (this.tablePathData.length > 1) { const node = this.firstApprovalNode
return this.tablePathData[1].opinion || '' return node ? (node.opinion || '') : ''
}
return ''
} }
}, },
created() { created() {
...@@ -387,6 +387,36 @@ export default { ...@@ -387,6 +387,36 @@ export default {
this.initDetail() this.initDetail()
} }
}, },
mounted() {
// 强制刷新,解决企业微信缓存问题
// 在mounted中执行,确保DOM已加载
this.$nextTick(() => {
if (typeof window !== 'undefined' && window.location) {
try {
const searchParams = new URLSearchParams(window.location.search)
if (!searchParams.has('_t')) {
searchParams.set('_t', Date.now().toString())
const newUrl = window.location.pathname + '?' + searchParams.toString() + (window.location.hash || '')
window.history.replaceState({}, '', newUrl)
// 强制重新加载页面资源(仅在企业微信环境下)
if (window.navigator.userAgent.indexOf('wxwork') !== -1) {
// 企业微信环境,尝试清除可能的缓存
const links = document.querySelectorAll('link[rel="stylesheet"]')
links.forEach(link => {
if (link.href) {
const href = new URL(link.href, window.location.origin)
href.searchParams.set('_v', Date.now().toString())
link.href = href.toString()
}
})
}
}
} catch (e) {
console.warn('缓存控制处理失败:', e)
}
}
})
},
methods: { methods: {
handlePicker() { handlePicker() {
this.showPicker = this.flag this.showPicker = this.flag
...@@ -649,6 +679,23 @@ export default { ...@@ -649,6 +679,23 @@ export default {
1: '是' 1: '是'
}[val * 1] }[val * 1]
}, },
findFirstApprovalNode() {
const data = this.tablePathData
if (!Array.isArray(data) || data.length === 0) {
return null
}
let startIndex = 1
if (data.length > 1 && data[1].subProcUnitId === 'shunt') {
startIndex = 2
}
for (let i = startIndex; i < data.length; i++) {
const node = data[i]
if (node) {
return node
}
}
return null
},
onClickLeft() { onClickLeft() {
window.opener = null window.opener = null
window.open('', '_self', '') window.open('', '_self', '')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment