workFlow.js
12.2 KB
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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
var business;
//获取业务配置信息
function getBusinessConfig(ywid, businessno) {
$.ajax({
type: "post", //提交方式
url: portal.api_url + "/portal/ApplyBusinessService/getBusinessFlow",//路径
dataType: "json",
async: false,
data: {
"ywid": ywid,
"businessNo": businessno
},
//数据,这里使用的是Json格式进行传输
success: function (result) {//返回数据根据结果进行相应的处理
if (result.code == 200 && result.data != null) {
business = result.data;
}
}
});
}
//获取业务配置信息
function loadBusinessConfig(ywid) {
$.ajax({
type: "post", //提交方式
url: portal.api_url + "/portal/ApplyBusinessService/getFQFBusinessFlow",//路径
dataType: "json",
async: false,
data: {
"ywid": ywid
},
//数据,这里使用的是Json格式进行传输
success: function (result) {//返回数据根据结果进行相应的处理
if (result.code == 200 && result.data != null) {
business = result.data;
}
}
});
}
//获取正在办理的流程业务
function getAcceptFlow(bsm_slsq, businessno) {
$.ajax({
type: "get", //提交方式
//contentType: 'application/json',
url: portal.api_url + "/portal/ApplyBusinessService/getApplyFlow",//路径
dataType: "json",
async: false,
data: {
"bsmSlsq": bsm_slsq,
"businessNo": businessno,
},
//数据,这里使用的是Json格式进行传输
success: function (result) {//返回数据根据结果进行相应的处理
if (result.code == 200 && result.data != null) {
business = result.data;
}
}
});
}
//获取申请信息记录
function getApplyRecord(bsm_slsq, businessno) {
let bdc = null;
$.ajax({
type: "get", //提交方式
//contentType: 'application/json',
url: portal.api_url + "/portal/FillInformation/getDetailBybsmSlsq",//路径
dataType: "json",
async: false,
data: {
"bsmSlsq": bsm_slsq,
"businessNo": businessno,
},
//数据,这里使用的是Json格式进行传输
success: function (result) {//返回数据根据结果进行相应的处理
if (result.code == 200 && result.data != null) {
bdc = result.data;
}
}
});
return bdc;
}
//设置步骤条信息
function setArticleSteps() {
$('.name_title h2').text(business.shortName);
var ArticleContent = $("#app_progress");
ArticleContent.empty();
$.each(business.stepList, function (index, item) {
switch (item.stepState) {
case 0:
ArticleContent.append('<li class="item_proress"><p></p><h5>' + item.stepname + '</h5></li>');
if ((index + 1) < business.stepList.length) {
ArticleContent.append('<li class="layui-progress"><div class="layui-progress-bar" lay-percent="0%"></div></li>');
}
break;
case 1:
ArticleContent.append('<li class="item_proress"><p class="activeing"></p><h5 class="activeingtext">' + item.stepname + '</h5></li>');
if ((index + 1) < business.stepList.length) {
ArticleContent.append('<li class="layui-progress"><div class="layui-progress-bar" style="width: 50%;" lay-percent="50%"></div></li>');
}
break;
case 2:
ArticleContent.append('<li class="item_proress"><p class="active"></p><h5>' + item.stepname + '</h5></li>');
if ((index + 1) < business.stepList.length) {
ArticleContent.append('<li class="layui-progress"><div class="layui-progress-bar" style="width:100%" lay-percent="100%"></div></li>');
}
break;
}
});
}
//获取业务发起流程方法
function getInitiateFLow(ywid, businessno,title) {
title=title||'网上申请'
getBusinessConfig(ywid, businessno);
window.open(portal.rootPath + business.stepList[0].pageurl + "?ywid=" + ywid + "&businessno=" + businessno+ "&title=" + title, "_self")
}
//发起流程方法
function createBusinesseFlow(ywid) {
loadBusinessConfig(ywid);
window.open(portal.rootPath + business.stepList[0].pageurl + "?ywid=" + ywid + "&businessno=" + business.businessno, "_self")
}
// 房屋独幢信息读取
function getFDCQ2(bsm_slsq) {
let bdc = null;
$.ajax({
type: "post", //提交方式
url: portal.api_url + "/portal/bdcqlReadService/getFDCQ2",//路径
dataType: "json",
async: false,
data: {
"bsm_ql": bsm_slsq,
},
//数据,这里使用的是Json格式进行传输
success: function (result) {//返回数据根据结果进行相应的处理
if (result.code == 200 && result.data != null) {
bdc = result.data;
}
}
});
return bdc;
}
//工作箱调取流程方法
function getWorkBoxFLow(bsm_slsq, businessno, title) {
title = title || '我的业务'
getAcceptFlow(bsm_slsq, businessno);
var pageurl;
$.each(business.stepList, function (index, item) {
if (item.stepState == 1) {
pageurl = item.pageurl;
return;
}
});
window.open(portal.rootPath + pageurl + "?bsm_slsq=" + bsm_slsq + "&businessno=" + businessno+ "&title=" + title, "_self")
}
//设置首环节页面相关内容
function setFristStepPageFLow(ywid, businessno) {
getBusinessConfig(ywid, businessno);
setArticleSteps();
}
//设置正在办理页面相关内容
function setAcceptFlow(bsmSlsq, businessNo) {
getAcceptFlow(bsmSlsq, businessNo);
setArticleSteps();
let num = 0;
for (var i=0; i< business.stepList.length; i++) {
if(business.stepList[i].stepState == '2') {
num++
}
}
// 设置头部导航
if (decodeURI(GetQueryString('title')) =='网上申请') {
addTabs('#wssq');
$('.layui-breadcrumb a').eq(1).attr('href','/staticViews/wssq.html');
}else {
$('.layui-breadcrumb a').eq(1).attr('href','/staticViews/wdyw.html');
}
$('.layui-breadcrumb a').eq(1).text(decodeURI(GetQueryString('title')));
if((business.ajzt != '4' || business.ajzt != '5') && (business.stepList.length!=(num+1))) {
$('.next_button').append('<button type="button" class="layui-btn layui-btn-normal">'
+ '<a onclick="skipClick()">下一步</a>'
+ '</button>')
}
}
//跳转下一个环节页面
function skipNextPage(bsm_slsq, businessno) {
let stepNo = getStep();
if (business.sqfs == '2' && business.zrffqhj && business.zrffqhj == stepNo) {
isApplicationBoth('78978979','renchao',bsm_slsq, businessno)
}else {
fetchStepNo(bsm_slsq, businessno)
}
// var nextStepIndex;
// $.each(business.stepList, function (index, item) {
// if (item.stepState == 1) {
// nextStepIndex = index + 1;
// return;
// }
// });
// var datajson = {
// "bsmSlsq": bsm_slsq,
// "businessNo": businessno,
// "stepNo": business.stepList[nextStepIndex].stepno
// };
// //更新当前流程所处环节
// $.ajax({
// type: "post", //提交方式
// contentType: 'application/json',
// url: portal.api_url + "/portal/FillInformation/updateStepNo",//路径
// dataType: "json",
// async: false,
// data: JSON.stringify(datajson),
// //数据,这里使用的是Json格式进行传输
// success: function (result) {//返回数据根据结果进行相应的处理
// if (result.code == 200) {
// window.location.href = portal.rootPath + business.stepList[nextStepIndex].pageurl + "?bsm_slsq=" + bsm_slsq + "&businessno=" + businessno+ "&stepno=" +business.stepList[nextStepIndex].stepno;
// }
// }
// });
}
// 下一步更新流程环节
function fetchStepNo(bsm_slsq,businessno) {
var nextStepIndex;
$.each(business.stepList, function (index, item) {
if (item.stepState == 1) {
nextStepIndex = index + 1;
return;
}
});
var datajson = {
"bsmSlsq": bsm_slsq,
"businessNo": businessno,
"stepNo": business.stepList[nextStepIndex].stepno
};
//更新当前流程所处环节
$.ajax({
type: "post", //提交方式
contentType: 'application/json',
url: portal.api_url + "/portal/FillInformation/updateStepNo",//路径
dataType: "json",
async: false,
data: JSON.stringify(datajson),
//数据,这里使用的是Json格式进行传输
success: function (result) {//返回数据根据结果进行相应的处理
if (result.code == 200) {
window.location.href = portal.rootPath + business.stepList[nextStepIndex].pageurl + "?bsm_slsq=" + bsm_slsq + "&businessno=" + businessno+ "&stepno=" +business.stepList[nextStepIndex].stepno+ "&title=" + decodeURI(GetQueryString('title'));
}
}
});
}
// 获取当前的环节
function getStep() {
var stepNo;
$.each(business.stepList, function (index, item) {
if (item.stepState == 1) {
stepNo = item.stepno;
}
});
return stepNo;
}
//跳转下一个环节之前判断是否双方申请-获取转入放信息
function isApplicationBoth(hth, userid, bsm_slsq, businessno) {
$.ajax({
type: "get",
url: portal.api_url + "/portal/ApplyBusinessService/getZRF",
dataType: "json",
data: {
"hth": hth,
"userid": userid,
},
success: function (result) {
if (result.code == 200) {
layuiOpen(result.data ,bsm_slsq, businessno)
}
}
});
}
//绘制单个div
function setDiv(item){
var div = '<li class="userList"><input type="radio" name="list" zrfName="'+item.zrfName+'" value="'+item.zrfIDCard+'"><span>姓名:</span>'+item.zrfName+'</li>'+
'<li class="userList"><span>身份证号:</span>'+item.zrfIDCard+'</li>'
return div
}
// 转给转入方进行流转
function layuiOpen(data ,bsm_slsq, businessno){
var html = '',titieInfo ='';
if(business.sqrlb=='1') {
titieInfo = '请选择义务人用户'
}else {
titieInfo = '请选择权利人用户'
}
for (var i = 0; i < data.length; i++) {
html += setDiv(data[i])
}
layui.use("layer", function () {
layer.open({
type:1,
title: titieInfo,
area: ['500px', '270px'],
scrollbar: false,
btn: ['确定'],
yes: function () {
if($('input:radio[name="list"]:checked').attr('value')==undefined) {
layer.msg('请先选择转入方');
return;
}else {
ToZRF(bsm_slsq, '1',$('input:radio[name="list"]:checked').attr('value'),$('input:radio[name="list"]:checked').attr('zrfName'), businessno)
}
},
content: html
});
});
}
// 转给转入方进行流转
function ToZRF(bsmSlsq, zjzl, zrfIDCard, zrfName, businessno) {
$.ajax({
type: "post", //提交方式
url: portal.api_url + "/portal/ApplyBusinessService/ToZRF",//路径
dataType: "json",
headers:{'Content-Type':'application/json;charset=utf8'},
data: JSON.stringify({
"bsmSlsq": bsmSlsq,
"zjzl": zjzl,
"zrfIDCard": zrfIDCard,
"zrfName": zrfName
}),
//数据,这里使用的是Json格式进行传输
success: function (result) {//返回数据根据结果进行相应的处理
layer.msg(result.message);
if (result.code == 200) {
setTimeout(function(){
layer.closeAll();
fetchStepNo(bsmSlsq, businessno);
},1000)
}
}
});
}