1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<template>
<div class="dialog-wrap">
<el-dialog v-dialogDrag v-if="sptVisible" :visible.sync="sptVisible" :title="'当前业务存在以下待处理数据'" :append-to-body="true">
<el-table :data="dealSptData" style="width:100%" size="small" :border="true">
<el-table-column label="数据状态" prop="sta" align="left" min-width="80px">
<template slot-scope="scope">
<c-select-value-to-label v-model="scope.row.sta" dbCode="SPTSTA" disabled>
</c-select-value-to-label>
</template>
</el-table-column>
<el-table-column label="操作时间" prop="dattim" align="left" min-width="100px">
</el-table-column>
<el-table-column label="交易名称" prop="txt" align="left" min-width="100px">
</el-table-column>
<el-table-column label="交易码" prop="frm" align="left" min-width="100px">
</el-table-column>
<el-table-column label="描述" prop="objnam" align="left" min-width="200px">
</el-table-column>
<el-table-column label="操作人" prop="usr" align="left" min-width="80px">
</el-table-column>
</el-table>
<div slot="footer">
<el-button @click="sptVisible = false">取消</el-button>
<el-button type="primary" @click="$goRoute && $goRoute()">继续</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Api from "~/service/Api";
import commonProcess from "~/mixin/commonProcess";
import _ from "~/utils/Lodash"
export default {
props: {
},
components: {},
mixins: [commonProcess], // 里面包含了Default、Check等的公共处理
data() {
return {
sptVisible:false,
dealSptData:[],
};
},
methods: {
changeDialog(isVisable) {
this.$emit("changeBtn", isVisable);
},
getCodelabel(value, codenam) {
const codeobj = this.codes[codenam].find(obj => obj.value === value)
return codeobj ? codeobj.label : value;
},
async checkLockAndPending(obj){
const params = {
objInr: obj.objinr,
objType:obj.objtyp,
trnName: obj.trnName.toLowerCase(),
};
const rtnmsg = await Api.post(`/${this.moduleRouter()}/lock/isAccessible`, params);
if (rtnmsg.respCode != SUCCESS) {
let msg = '该笔业务数据已被锁定!'
if (rtnmsg.data && rtnmsg.data.usrId) {
msg = this.convertLockMsg(rtnmsg,msg)
}
this.changeDialog(false);
this.$notify.error({ title: '错误', message: msg });
return false;
}
let sptData = []
if (obj.objinr) {
let rtnmsg = await Api.post(`/${this.moduleRouter()}/lock/checkPending`,{
objinr: obj.objinr,
objtyp:obj.objtyp,
transName: obj.trnName.toLowerCase(),
})
if (rtnmsg.data) {
if (rtnmsg.data.penSptList && rtnmsg.data.penSptList.length) {
//依次提示
sptData = [...sptData, ...rtnmsg.data.penSptList]
}
if (rtnmsg.data.ameSptList && rtnmsg.data.ameSptList.length) {
sptData = [...sptData, ...rtnmsg.data.ameSptList]
}
if (rtnmsg.data.canSptList && rtnmsg.data.canSptList.length) {
sptData = [...sptData, ...rtnmsg.data.canSptList]
}
}
}
//去重
let tempObj = {}
sptData = sptData.filter(spt => {
if (tempObj[spt.inr]) {
return false
} else {
tempObj[spt.inr] = 'X'
return true
}
})
if (sptData.length) {
this.dealSptData = sptData
this.sptVisible = true
this.changeDialog(false);
//传递一个临时跳转函数
this.$goRoute = () => {
this.sptVisible = false
let params = {}
if(obj.trnName.toLowerCase() == 'jstopn'){
params = {
path: "/business/" + obj.trnName.toLowerCase(),
}
}else{
params = {
path: "/business/" + obj.trnName.toLowerCase(),
query: { inr: obj.objinr,pntinr: obj.pntinr,pnttyp:obj.pnttyp,ledinr:obj.ledinr }
}
}
this.routerPush(params);
this.$goRoute = null;
}
return false;
}
return true;
}
},
mounted() {
},
};
</script>
<style>
.btn-group-wrap {
max-height: 250px;
width: 100%;
overflow-y: auto;
display: block;
align-items: flex-start;
justify-content: flex-start;
flex-wrap: wrap;
}
.btn-item {
margin: 5px 5px 5px 7px ;
float:left;
border-radius: 5px;
width:260px;
height:40px;
}
.el-card__header{
background-color:lightgray
}
</style>