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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<template>
<div class="currentPage">
<el-form :model="vpbsSeal" ref="vpbsSealForm" label-width="150px" label-position="right" label-suffix=":" size="small">
<c-row>
<c-col :span="11">
<el-form-item label="签章类型" prop="vptype">
<c-select v-model="vpbsSeal.vptype" placeholder="请选择签章类型" @change="changeVptype(vpbsSeal.vptype)" dbCode="VPTYPE">
</c-select>
</el-form-item>
</c-col>
</c-row>
<div class="text-center">
<c-button type="primary" icon="el-icon-search" :loading="false"
style="margin-right:50px;margin-bottom:25px" @click="onSearch()">
查询
</c-button>
</div>
<div style="height:40px;margin-top:-20px;">
<c-button type="primary" size="mini" @click="handleAdd()">新增</c-button>
</div>
</el-form>
<c-col :span="24">
<c-table :list="vpbsList" :columnsConfig="vpbsInfoColumns" :border="true">
</c-table>
</c-col>
<c-paging-table :data="tableData" ref="vpbsSealTableRef"
:pageSize="vpbsSeal.pageSize" :pageNumber="vpbsSeal.pageNum" :total="vpbsSeal.total"
@queryFunc="queryFunc" :border="true">
<el-table-column label="签章类型" prop="vptype" min-width="20%">
<template slot-scope="scope">{{scope.row.vptype}}</template>
</el-table-column>
<el-table-column label="签章机构" prop="branch" min-width="20%">
<template slot-scope="scope">{{scope.row.branch}}</template>
</el-table-column>
<el-table-column label="签章机构名称" prop="bchnam" min-width="20%">
<template slot-scope="scope">{{ scope.row.bchnam }}</template>
</el-table-column>
<el-table-column label="关键字" prop="keyword" min-width="15%">
<template slot-scope="scope">{{ scope.row.keyword }}</template>
</el-table-column>
<el-table-column label="操作" min-width="25%">
<template slot-scope="scope">
<el-button @click="handleAmend(scope.row)" type="primary" size="mini">修改</el-button>
<el-button @click="handleDelete(scope.row.inr)" type="danger" size="mini">删除</el-button>
</template>
</el-table-column>
</c-paging-table>
<el-dialog :visible.sync="DialogFormVisible" :title=DialogFormTitle :modal-append-to-body="false"
:lock-scroll="false" :show-close="false" :close-on-click-modal="false"
:close-on-press-escape="false" v-dialogDrag >
<el-form ref="vpbsCfgDialogForm" :model="vpbsCfgForm" label-width="120px" label-position="right" label-suffix=":" :rules="rules">
<el-row style="margin-top:20px;">
<el-col :span="10" class="rightLayoutDialog">
<el-form-item label="签章类型" prop="vptype">
<c-select v-model="vpbsCfgForm.vptype" :disabled="DialogFieldDisable" @change="handleChange" dbCode="VPTYPE">
</c-select>
</el-form-item>
</el-col>
<el-col :span="10" class="leftLayout">
<el-form-item label="签章机构" prop="branch">
<el-input event-render="loadText" type="text" v-model="vpbsCfgForm.branch" :disabled="DialogFieldDisable" maxlength="40"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10" class="leftLayout">
<el-form-item label="签章机构名称" prop="bchnam">
<el-input event-render="loadText" type="text" v-model="vpbsCfgForm.bchnam" :disabled="DialogFieldDisable" maxlength="40"></el-input>
</el-form-item>
</el-col>
<el-col :span="10" class="leftLayout">
<el-form-item label="关键字" prop="keyword">
<el-input event-render="loadText" type="text" v-model="vpbsCfgForm.keyword" :disabled="DialogFieldDisable" maxlength="20"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel">取 消</el-button>
<el-button type="primary" @click="handleSubmit" v-show="DialogSubBtnVisible" :loading="loadingStatus">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import DeptModel, { Pattern } from "./DeptModel.js";
import Utils from "~/utils";
import { queryVpbsCfgByPage, saveVpbsCfg, deleteVpbsCfg, getBchInfo } from "~/service/manage/dept.js";
import { cloneDeep } from 'lodash';
export default {
name: "",
props: {
orgBranch:String,
},
data() {
return {
rules: Pattern,
tableData: null,
vpbsSeal: new DeptModel().data.vpbsSeal,
vpbsCfgForm: new DeptModel().data.vpbsSeal,
DialogFormVisible:false,
DialogFieldDisable:true,
DialogFormTitle:'新增无纸化签章配置',
DialogSubBtnVisible:true,
deleteVpbsInr:null,
loadingStatus:false,
vptypelist:[
{vptype: "vp14", vptypeDsp: "电子凭证加盖电子签章" },
]
}
},
created() {
},
watch:{
// 会出现父组件传真,子组件更新不及时的情况
orgBranch:{
handler:function(newValue,oldValue){
if(newValue != '' && newValue != null && newValue != 'undefined'){
this.onSearch();
}
},
// 强制立即执行回调
immediate:true
}
},
components: {
},
methods: {
changeVptype(vptype){
},
onSearch() {
this.vpbsSeal.branch = this.orgBranch;
queryVpbsCfgByPage(this.vpbsSeal).then((res) => {
this.tableData = res.data.list;
this.vpbsSeal.total = res.data.total;
this.vpbsSeal.pageNum = res.data.pageNumber;
this.vpbsSeal.pageSize = res.data.pageSize;
})
},
queryFunc(pageNumber, pageSize) {
this.vpbsSeal.pageNum = pageNumber;
this.vpbsSeal.pageSize = pageSize;
this.onSearch()
},
// 【新增】按钮
handleAdd(){
// 选中节点后操作
if(!(this.orgBranch != '' && this.orgBranch != null)){
this.$message({message: '请选中具体分行、支行再操作!',center: true,type: 'warning'});
return;
}
getBchInfo(this.orgBranch).then((res)=>{
if(res.respCode == "AAAAAA"){
var bch = res.data;
if(bch == null){
this.$message({message: '请先在【国结机构信息】页签中新增该机构信息!',center: true,type: 'warning'});
return;
}
if(bch.lev == "0" || bch.lev == "A" || bch.lev == "B"){
this.$message({message: '请选中具体的分行、支行再操作!',center: true,type: 'warning'});
return;
}
this.DialogFieldDisable = false;
this.DialogFormVisible = true;
this.DialogSubBtnVisible = true;
this.DialogFormTitle = '新增无纸化签章配置';
} else {
this.$notify.error("获取机构号:["+this.orgBranch+"]机构信息失败!");
return;
}
}).catch((res)=>{
this.$notify.error("获取机构号:["+this.orgBranch+"]机构信息失败!");
});
},
// 【修改】按钮
handleAmend(row){
this.DialogFormVisible = true;
this.DialogFieldDisable = false;
this.DialogSubBtnVisible = true;
this.DialogFormTitle = '修改无纸化签章配置';
this.vpbsCfgForm = row;
},
// 【确定】按钮
handleSubmit(){
this.$refs.vpbsCfgDialogForm.validate((validated) => {
if(validated){
this.loadingStatus = true;
this.vpbsCfgForm.branch = this.orgBranch;
saveVpbsCfg(this.vpbsCfgForm).then((res)=>{
this.$notify.success("保存成功!");
// 关闭弹框
this.handleCancel();
// 刷新列表
this.onSearch();
this.loadingStatus = false;
}).catch((err)=>{
this.loadingStatus = false;
this.$notify.error("保存失败!");
});
} else {
Utils.formValidateTips(this.$refs.vpbsCfgDialog.fields)
}
})
},
// 【取消】按钮
handleCancel(){
// 关闭弹框
this.DialogFormVisible = false;
this.vpbsCfgForm.inr = '';
this.vpbsCfgForm.ver = '';
this.vpbsCfgForm.vptype = '';
this.vpbsCfgForm.branch = '';
this.vpbsCfgForm.bchnam = '';
this.vpbsCfgForm.keyword = '';
this.$refs['vpbsCfgDialogForm'].resetFields();
},
// 【删除】按钮
handleDelete(inr){
this.deleteVpbsInr = inr;
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(()=>{
this.vpbsCfgForm.inr = this.deleteVpbsInr;
deleteVpbsCfg(this.vpbsCfgForm).then((res)=>{
this.$notify.success("删除成功!");
this.deleteVpbsInr = null;
// 刷新列表
this.onSerach();
}).catch((err)=>{
this.$notify.error("删除失败!");
});
}).catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
// 强制更新
handleChange(){
this.$forceUpdate();
}
}
}
</script>
<style lang="less" scoped>
.currentPage{
.el-table--enable-row-hover .el-table__body tr:hover>td{
background-color: #c694dc !important;
}
}
</style>