|
|
@ -122,6 +122,7 @@ import req from '@/api/deduct/deduct' |
|
|
|
import { getStorage } from '@/utils/auth' |
|
|
|
import deductAdd from './deductAdd' |
|
|
|
import deductInfo from './deductInfo' |
|
|
|
import { getButtonPermissions } from '@/api/Common/dictcommons' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'Deduct', |
|
|
@ -139,6 +140,13 @@ export default { |
|
|
|
centerDialogVisible: false, |
|
|
|
btndisabled: false, |
|
|
|
btnList: [ |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: '', |
|
|
|
btnKey: 'toPush', |
|
|
|
btnLabel: '重推' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'danger', |
|
|
|
size: 'small', |
|
|
@ -165,7 +173,7 @@ export default { |
|
|
|
// 翻页 |
|
|
|
listQuery: { |
|
|
|
current: 1, |
|
|
|
size: 10, |
|
|
|
size: 5, |
|
|
|
total: 0, |
|
|
|
params: { |
|
|
|
applyName: '', |
|
|
@ -189,7 +197,18 @@ export default { |
|
|
|
mounted() { |
|
|
|
// 在外部vue的window上添加postMessage的监听,而且绑定处理函数handleMessage |
|
|
|
window.addEventListener('message', this.handleMessage) |
|
|
|
getButtonPermissions({ userSid: window.sessionStorage.getItem('userSid'), url: this.$route.path, type: 0 }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
for (var i = 0; i < res.data.length; i++) { |
|
|
|
for (var k = 0; k < this.btnList.length; k++) { |
|
|
|
if (res.data[i].buttonId === this.btnList[k].btnKey) { |
|
|
|
this.btnList.splice(k, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.$refs['btnbar'].setButtonList(this.btnList) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async handleMessage(event) { |
|
|
@ -232,6 +251,9 @@ export default { |
|
|
|
btnHandle(btnKey) { |
|
|
|
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
|
|
|
switch (btnKey) { |
|
|
|
case 'toPush': |
|
|
|
this.toPush() |
|
|
|
break |
|
|
|
case 'doDel': |
|
|
|
this.doDel() |
|
|
|
break |
|
|
@ -282,7 +304,7 @@ export default { |
|
|
|
handleReset() { |
|
|
|
this.listQuery = { |
|
|
|
current: 1, |
|
|
|
size: 10, |
|
|
|
size: 5, |
|
|
|
total: 0, |
|
|
|
params: { |
|
|
|
applyName: '', |
|
|
@ -307,6 +329,29 @@ export default { |
|
|
|
this.viewState = 4 |
|
|
|
this.$refs['divInfo'].showInfo(row) |
|
|
|
}, |
|
|
|
toPush() { |
|
|
|
if (this.sids.length === 1) { |
|
|
|
const loading = this.$loading({ |
|
|
|
lock: true, |
|
|
|
text: '数据推送中', |
|
|
|
spinner: 'el-icon-loading', |
|
|
|
background: 'rgba(0, 0, 0, 0.7)' |
|
|
|
}) |
|
|
|
req.buckleVoucherRePush({ sid: this.sids[0] }).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
loading.close() |
|
|
|
this.$message({ showClose: true, type: 'success', message: '重推成功' }) |
|
|
|
this.getList() |
|
|
|
} else { |
|
|
|
loading.close() |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
loading.close() |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行重推操作' }) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 删除 |
|
|
|
doDel() { |
|
|
|
if (this.sids.length === 0) { |
|
|
|