|
|
@ -110,6 +110,7 @@ import pageye from '@/components/pagination/pageye' |
|
|
|
import ButtonBar from '@/components/ButtonBar' |
|
|
|
import req from '@/api/loanbalancerecognition/loanbalancerecognition' |
|
|
|
import { getStorage } from '@/utils/auth' |
|
|
|
import { getButtonPermissions } from '@/api/Common/dictcommons' |
|
|
|
import loanbalancerecognitionAdd from './loanbalancerecognitionAdd' |
|
|
|
import loanbalancerecognitionInfo from './loanbalancerecognitionInfo' |
|
|
|
|
|
|
@ -129,6 +130,13 @@ export default { |
|
|
|
centerDialogVisible: false, |
|
|
|
btndisabled: false, |
|
|
|
btnList: [ |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: '', |
|
|
|
btnKey: 'toPush', |
|
|
|
btnLabel: '重推' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'info', |
|
|
|
size: 'small', |
|
|
@ -170,7 +178,18 @@ export default { |
|
|
|
mounted() { |
|
|
|
// 在外部vue的window上添加postMessage的监听,而且绑定处理函数handleMessage |
|
|
|
window.addEventListener('message', this.handleMessage) |
|
|
|
this.$refs['btnbar'].setButtonList(this.btnList) |
|
|
|
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) { |
|
|
@ -275,6 +294,29 @@ export default { |
|
|
|
} |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
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.ctDiff({ 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: '请选择一条记录进行重推操作' }) |
|
|
|
} |
|
|
|
}, |
|
|
|
toEdit(row) { |
|
|
|
this.viewState = 2 |
|
|
|
this.$refs['divAdd'].showEdit(row) |
|
|
|