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
//已办点击查看后跳页渲染方法
//already-click页面
//输出元素
var staticElement='';
//标题名字
var titleName = '';
//当字段为超链接时,储存文件名和路径
var Elementname='';
var ElementPath='';
//储存静态元素值,没啥作用(万一以后有呢)
var uploadJson={};
//判断key是否存在于dataInfo中,如果存在则包装渲染,若不存在则不渲染
var flage;
//获取输入框标题
function jsonToCompleteStatic(data){
var dataInfo = JSON.parse(data);
if (dataInfo.jzMatintain) {
dataInfo['maintainername'] = dataInfo.jzMatintain.maintainername;
}
delete dataInfo['jzMatintain']
for (let key in dataInfo ){
flage = true;
var staticTempJson={};
switch (key) {
case "jzProspectlist":
Elementname = dataInfo[key].jzProspectlistName
ElementPath = dataInfo[key].jzProspectlistPath
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" +ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzProspectlistName,15,true)+'</a>'
titleName="勘查单";
break;
case "jzDesigndrawing":
Elementname = dataInfo[key].jzDesigndrawingName
ElementPath = dataInfo[key].jzDesigndrawingPath
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzDesigndrawingName,15,true)+'</a>'
titleName="设计图";
break;
case "jzElementlist":
Elementname = dataInfo[key].jzElementlistName
ElementPath = dataInfo[key].jzElementlistPath
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzElementlistName,15,true)+'</a>'
titleName="要素表";
break;
case "jzOutboundlist":
Elementname = dataInfo[key].jzOutboundlistName
ElementPath = dataInfo[key].jzOutboundlistPath
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzOutboundlistName,15,true)+'</a>'
titleName="出库单";
break;
case "jzOperatoracceptlist":
Elementname = dataInfo[key].jzOperatoracceptlistName
ElementPath = dataInfo[key].jzOperatoracceptlistPath;
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzOperatoracceptlistName,15,true)+'</a>'
titleName="运营商验收单";
break;
case "jzRoutedrawing":
Elementname = dataInfo[key].jzRoutedrawingName
ElementPath = dataInfo[key].jzRoutedrawingPath;
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzRoutedrawingName,15,true)+'</a>'
titleName="路由图";
break;
case "jzCompletedacceptlist":
Elementname = dataInfo[key].jzCompletedacceptlistName
ElementPath = dataInfo[key].jzCompletedacceptlistPath
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzCompletedacceptlistName,15,true)+'</a>'
titleName="竣工验收单";
break;
case "jzBudgetofelectic":
Elementname = dataInfo[key].jzBudgetofelecticName
ElementPath = dataInfo[key].jzBudgetofelecticPath
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzBudgetofelecticName,15,true)+'</a>'
titleName="电力预算清单";
break;
case "jzMatterlist":
Elementname = dataInfo[key].jzMatterlistName
ElementPath = dataInfo[key].jzMatterlistPath
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzMatterlistName,15,true)+'</a>'
titleName="立项物资清单";
break;
case "jzConstructprocept":
Elementname = dataInfo[key].jzConstructproceptName
ElementPath = dataInfo[key].jzConstructproceptPath;
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzConstructproceptName,15,true)+'</a>'
titleName="施工组织方案";
break;
case "jzOpenrepory":
Elementname = dataInfo[key].jzOpenreporyName
ElementPath = dataInfo[key].jzOpenreporyPath;
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzOpenreporyName,15,true)+'</a>'
titleName="开工报告";
break;
case "jzCompletedreport":
Elementname = dataInfo[key].jzCompletedreportName
ElementPath = dataInfo[key].jzCompletedreportPath;
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzCompletedreportName,15,true)+'</a>'
titleName="完工报告";
break;
case "jzCompletedphoto":
Elementname = dataInfo[key].jzCompletedphotoName
ElementPath = dataInfo[key].jzCompletedphotoPath ;
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzCompletedphotoName,15,true)+'</a>'
titleName="完工照片";
break;
case "jzRentdrawing" :
Elementname = dataInfo[key].jzRentdrawingName
ElementPath = dataInfo[key].jzRentdrawingPath;
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzRentdrawingName,15,true)+'</a>'
titleName="起租截图";
break;
// case "jzUppermachineroomname":
// staticElement='<input disabled value="'+dataInfo[key]+'" id="" class="layui-input" style="color: #D2D2D2!important"/>'
// titleName="上联机房名称";
// uploadJson[key] =dataInfo[key]
// break;
case "jzUppermachineroomplace":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
titleName="上联机房位置";
break;
case "jzOpendrawing":
Elementname = dataInfo[key].jzOpendrawingName
ElementPath = dataInfo[key].jzOpendrawingPath;
staticElement='<a target="_parent" id="href_'+key+'" href="'+util.interfaceUrl+interfacenName.fileDown + "?fileName="+Elementname +"&filePath=" + ElementPath+'" >'+util.dealWithFormatTextByLen(dataInfo[key].jzOpendrawingName,15,true)+'</a>'
titleName="开通截图";
break;
case "jzNeId":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
titleName="网元id";
break;
case "jzPropertycode":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
titleName="资产编码";
break;
case "jzIsconnectwithowner":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
titleName="是否与业务主交接";
break;
case "jzPropertyname":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
titleName="接维物业名称";
break;
case "jzOwnercontactinfo":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
titleName="业主联系方式";
break;
case "maintainername":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
titleName="交维人员";
break;
// case "deptMaintain":
// staticElement='<input disabled value="'+dataInfo[key]+'" id="" class="layui-input"style="color: #D2D2D2!important" />'
// titleName="建维专员部门";
// break;
case "jzCode":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
uploadJson[key] =dataInfo[key]
titleName="基站号";
break;
case "jzName":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
titleName="基站名";
break;
case "projectCode":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
uploadJson[key] =dataInfo[key]
titleName="项目编号";
break;
case "jzLatitude":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
uploadJson[key] =dataInfo[key]
titleName="纬度";
break;
case "jzLongitude":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
uploadJson[key] =dataInfo[key]
titleName="经度";
break;
case "jzRequire":
if(dataInfo[key]==''){
return false;
}
else{
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
uploadJson[key] =dataInfo[key]
titleName="需求号";
break;
}
case "businessLine":
util.ajax({
url:util.interfaceUrl+ interfacenName.getDic +'/'+ "JZ_YWX",
type:"get",
dataType:"json",
data:{type:'JZ_YWX'},
async:false,
success:function (res) {
if(res.code==200) {
var busdata = res.data;
for( m in busdata){
if(dataInfo[key] == busdata[m].value ){
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(busdata[m].name,20,true)+'</span>'
break;
}
}
}
else {
layer.msg("网络链接错误,获取业务线失败")
}
},
error:function () {
layer.msg('网络链接错误,获取业务线失败')
}
});
titleName="业务线";
break;
case "projectAddress":
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
uploadJson[key] =dataInfo[key]
titleName="基站地址";
break;
// case "resourcePoint":
// staticElement='<input disabled value="'+dataInfo[key]+'" id="" class="layui-input"/>'
// uploadJson[key] =dataInfo[key]
// titleName="资源点";
// break;
// case "resourcePointewm":
// staticElement='<input disabled value="'+dataInfo[key]+'" id="" class="layui-input"/>'
// uploadJson[key] =dataInfo[key]
// titleName="资源点标签二维码";
// break;
case "changeSalesmanName":
// getUserName(dataInfo[key],function(rs){
// $("#"+key+"").val(rs)
// });
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
titleName="更换阶段负责人为";
break;
case "oldSalesmanName":
// getUserName(dataInfo[key],function(rs){
// $("#"+key+"").val(rs)
// });
staticElement='<span id="'+key+'" >'+util.dealWithFormatTextByLen(dataInfo[key],20,true)+'</span>'
titleName="原阶段负责人";
break;
default:
flage = false;
break;
}
if(flage){
let title = '<label style="white-space: nowrap;min-width: 120px;padding: 16px 15px"class="layui-form-label">' + titleName+ ':</label>';
let StaticinfoDiv = '<div class="layui-form-item" style="margin: 0;height: 65px;" id="StaticinfoDiv"><div class="layui-inline controllstyle" style="text-align: start;white-space: nowrap;line-height: 37px;margin-bottom: 0px" >' +
title + '<div class="layui-input-inline" style="white-space: nowrap;width: 287px;margin-top: 4.6px">' + staticElement + '</div>';
'</div></div>';
$('#completeStatic').append(StaticinfoDiv);
}
}
// function getUserName(userId,callback){
//
// util.ajax({
// type: "get",
// url: util.interfaceUrl+interfacenName.getUserNameById+"/"+userId,
// success: (res) => {
// if (res.code === 200) {
// var userName = res.data.name;
// callback(userName)
// console.log(userName)
// } else {
// error: function err(err) {
// console.log("错误信息:" + err)
// }
// }
// }
// });
//
// }
}