|
@@ -21,7 +21,9 @@ class HiddenPageInfo extends BaseWidget {
|
|
|
|
|
|
action: 3,
|
|
|
|
|
|
- coordinate: 4
|
|
|
+ coordinate: 4,
|
|
|
+
|
|
|
+ finishAudit: 5
|
|
|
};
|
|
|
|
|
|
actionType = {
|
|
@@ -70,7 +72,7 @@ class HiddenPageInfo extends BaseWidget {
|
|
|
if (item.type == "text") {
|
|
|
if (item.attributes.fileType && item.attributes.fileType.value == 'date' && type == this.actionType.write) {
|
|
|
let planBegindate = {
|
|
|
- format: 'YYYY-MM-DD',
|
|
|
+ format: 'YYYY-MM-DD',
|
|
|
isinitVal: true,
|
|
|
}
|
|
|
$.jeDate(item, planBegindate);
|
|
@@ -300,8 +302,330 @@ class HiddenPageInfo extends BaseWidget {
|
|
|
dom.find('.hideCoordinate').remove();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ for (var item of dom.find(".spanValue")) {
|
|
|
+ if (this.initTag.indexOf(item) == -1) {
|
|
|
+ if (this.initTag.indexOf(item) == -1) {
|
|
|
+ this.initTag.push(item);
|
|
|
+ for (var dataItem in data) {
|
|
|
+ if (dataItem == item.attributes.name.value) {
|
|
|
+ item.textContent=this.verificationHelper.setNullAndUndefinedEnpty(data[dataItem]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (var item of dom.find(".reportHisList")) {
|
|
|
+ if (this.initTag.indexOf(item) == -1) {
|
|
|
+ this.initTag.push(item);
|
|
|
+
|
|
|
+
|
|
|
+ let processData = data.troubleBaseHis;
|
|
|
+
|
|
|
+ let header_action = "<tr><th>隐患名称</th><th>隐患详情</th><th>是否自行处理</th><th>隐患附件</th></tr>";
|
|
|
+
|
|
|
+ let actionList = [];
|
|
|
+
|
|
|
+ let allHtml = "";
|
|
|
+ if (processData && processData.length > 0) {
|
|
|
+ processData.forEach(processItem => {
|
|
|
+ let html = "";
|
|
|
+
|
|
|
+ let auditUser = this.verificationHelper.setNullAndUndefinedEnpty(processItem.troubleName);
|
|
|
+ let auditUserHtml = "<td title='" + auditUser + "'>" + auditUser + "</td>";
|
|
|
+
|
|
|
+ let reportTimeHtml = "<td title='" + this.verificationHelper.setNullAndUndefinedEnpty(processItem.troubleInfo) + "'>" +
|
|
|
+ this.verificationHelper.setNullAndUndefinedEnpty(processItem.troubleInfo) + "</td>";
|
|
|
+
|
|
|
+ let auditResult = this.verificationHelper.setNullAndUndefinedEnpty(processItem.isDiscretionName);
|
|
|
+ let auditResultHtml = "<td title='" + auditResult + "'>" + auditResult + "</td>";
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ let fileAndVoice = this.getFileAndVoice(processItem, 'reportFile', 'reportVoiceList');
|
|
|
+
|
|
|
+ html = ("<tr>" + auditUserHtml+reportTimeHtml+auditResultHtml + fileAndVoice.file + "</tr>");
|
|
|
+ actionList.push({
|
|
|
+ time: parseInt(this.verificationHelper.setNullAndUndefinedEnpty(processItem.createTime).replace(/[^0-9]*/g, "")),
|
|
|
+ item: html,
|
|
|
+ type: "1"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ actionList.push({
|
|
|
+ time: 9999999999999999999999,
|
|
|
+ item: "<tr><td colspan='4'>暂无隐患上报历史内容</td></tr>",
|
|
|
+ type: "1"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ actionList.forEach((itemB, indexB) => {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (allHtml == "") {
|
|
|
+ allHtml += (header_action + itemB.item);
|
|
|
+ } else {
|
|
|
+ allHtml += itemB.item
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ $(item).append("<table class='table table-bordered'>" + allHtml + "</table>");
|
|
|
+ $(item).find('.tableImg').viewer();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ initLinkHtml_list(that, dom, data, type,auditList) {
|
|
|
+
|
|
|
+ for (var item of dom.find("input")) {
|
|
|
+ if (this.initTag.indexOf(item) == -1) {
|
|
|
+ this.initTag.push(item);
|
|
|
+ if (item.type == "text") {
|
|
|
+ if (item.attributes.fileType && item.attributes.fileType.value == 'date' && type == this.actionType.write) {
|
|
|
+ let planBegindate = {
|
|
|
+ format: 'YYYY-MM-DD',
|
|
|
+ isinitVal: true,
|
|
|
+ }
|
|
|
+ $.jeDate(item, planBegindate);
|
|
|
+ } else {
|
|
|
+ for (var dataItem in auditList) {
|
|
|
+ if (dataItem == item.name) {
|
|
|
+ item.value = this.verificationHelper.setNullAndUndefinedEnpty(auditList[dataItem]);
|
|
|
+ if ((item.value + "").indexOf("00:00:00") != -1) {
|
|
|
+ item.value = (item.value + "").replace("00:00:00", "");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (type == this.actionType.look) {
|
|
|
+ $(item).attr("readonly", "readonly");
|
|
|
+ $(item).attr("title", item.value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (item.type == "file" && that) {
|
|
|
+ let fileInit = false;
|
|
|
+ if (auditList && type == this.actionType.look) {
|
|
|
+ for (var dataItem in auditList) {
|
|
|
+ if (dataItem == item.attributes.showname.value) {
|
|
|
+ fileInit = true;
|
|
|
+ let imgHtml = "";
|
|
|
+ let imgList = [];
|
|
|
+ let fileHtml = "";
|
|
|
+ let fileList = [];
|
|
|
+ let notFile = "未上传附件";
|
|
|
+ if (auditList[dataItem].length && auditList[dataItem].length > 0) {
|
|
|
+ auditList[dataItem].forEach((fileItem, index) => {
|
|
|
+ if (this.ajaxSend.isImg(fileItem.path)) {
|
|
|
+ imgList.push({ fileName: fileItem.fileName, path: fileItem.path });
|
|
|
+ } else {
|
|
|
+ fileList.push({ fileName: fileItem.fileName, path: fileItem.path });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (imgList.length > 0) {
|
|
|
+ imgList.forEach((imgItem, index) => {
|
|
|
+ imgHtml += "<li><img src='" + this.ajaxSend.getIamgeAddress(that, imgItem.path) + "'></li>";
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (fileList.length > 0) {
|
|
|
+ fileList.forEach((fileItem, index) => {
|
|
|
+ fileHtml += "<li><a href=" + this.ajaxSend.getFileAddress(that, fileItem) + " download='" + fileItem.fileName + "'>" + fileItem.fileName + "</li>";
|
|
|
+ })
|
|
|
+ }
|
|
|
+ $(item).after("<div class='fileInfoList'></div>")
|
|
|
+ if (fileList.length > 0 || imgList.length > 0) {
|
|
|
+ let imgId = item.attributes.showname.value + "_imgList";
|
|
|
+ if (imgHtml != "") {
|
|
|
+ $(item).parents(".form-group").find(".fileInfoList").append("<div class='fileItemUl'><ul class='fileInfoListItem' id='" + imgId + "'>" + imgHtml + "</ul></div>");
|
|
|
+ $(item).parents(".form-group").find(".fileItemUl #" + imgId).viewer();
|
|
|
+ }
|
|
|
+ if (fileHtml != "") {
|
|
|
+ let fileId = item.name + "_fileList";
|
|
|
+ $(item).parents(".form-group").find(".fileInfoList").append("<div class='fileItemUl'><ul class='fileInfoListItem' id='" + fileId + "'>" + fileHtml + "</ul></div>")
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $(item).parents(".form-group").find(".fileInfoList").append("<span class='fileInfoNot'>" + notFile + "</span>")
|
|
|
+ }
|
|
|
+ $(item).remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!fileInit) {
|
|
|
+ let fileList = [];
|
|
|
+ for (var dataItem in auditList) {
|
|
|
+ if (item.attributes.showname && item.attributes.showname.value && dataItem == item.attributes.showname.value && auditList[dataItem]) {
|
|
|
+ if (auditList[dataItem] instanceof Array) {
|
|
|
+ fileList = auditList[dataItem]
|
|
|
+ } else {
|
|
|
+ fileList.push(auditList[dataItem])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (item.attributes.fileType.value == "file") {
|
|
|
+ let dom = $(item);
|
|
|
+ this.ajaxSend.initFileFileInputs(dom, fileList, that);
|
|
|
+ this.fileDom.push(dom);
|
|
|
+ } else if (item.attributes.fileType.value == "image") {
|
|
|
+ let dom = $(item)
|
|
|
+ this.ajaxSend.initFileImageInputs($(item), fileList, that);
|
|
|
+ this.fileDom.push(dom);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (var item of dom.find("textarea")) {
|
|
|
+ if (this.initTag.indexOf(item) == -1) {
|
|
|
+ this.initTag.push(item);
|
|
|
+ for (var dataItem in auditList) {
|
|
|
+ if (dataItem == item.name) {
|
|
|
+ item.value = this.verificationHelper.setNullAndUndefinedEnpty(auditList[dataItem]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (type == this.actionType.look) {
|
|
|
+ $(item).attr("readonly", "readonly");
|
|
|
+ $(item).attr("title", item.value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (var item of dom.find("select")) {
|
|
|
+ if (this.initTag.indexOf(item) == -1) {
|
|
|
+ this.initTag.push(item);
|
|
|
+ let index = 0;
|
|
|
+ let length = 0;
|
|
|
+ for (var dataItem in auditList) {
|
|
|
+ length++;
|
|
|
+ if (item.attributes.showname && dataItem == item.attributes.showname.value && type == this.actionType.look) {
|
|
|
+ $(item).after('<input type="text" class="form-control" readonly="readonly" value="' + this.verificationHelper.setNullAndUndefinedEnpty(auditList[dataItem]) + '">');
|
|
|
+ let parentDom = $(item).parents('.userSelect');
|
|
|
+ if (parentDom.length > 0) {
|
|
|
+ parentDom.find('.item:first-child').remove();
|
|
|
+ parentDom.find('.item').addClass('oneItem').removeClass('item');
|
|
|
+ }
|
|
|
+ $(item).remove();
|
|
|
+ } else { index++ };
|
|
|
+ }
|
|
|
+ if (index == length && type == this.actionType.look) {
|
|
|
+ $(item).after('<input type="text" class="form-control" readonly="readonly" >');
|
|
|
+ $(item).remove();
|
|
|
+ }
|
|
|
+ if (type == this.actionType.look) {
|
|
|
+ $(item).attr("readonly", "readonly");
|
|
|
+ } else {
|
|
|
+ if (auditList&&(this.verificationHelper.setNullAndUndefinedEnpty(auditList[item.name]) + "").trim() != "") {
|
|
|
+ $(item).val(this.verificationHelper.setNullAndUndefinedEnpty(auditList[item.name]));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (var item of dom.find(".voice")) {
|
|
|
+ if (this.initTag.indexOf(item) == -1) {
|
|
|
+ this.initTag.push(item);
|
|
|
+ for (var dataItem in auditList) {
|
|
|
+ let html = "";
|
|
|
+ if (item.attributes.name.value == dataItem) {
|
|
|
+ let dataInfo = auditList[dataItem];
|
|
|
+ if (!dataInfo || !(dataInfo instanceof Array) || dataInfo.length == 0) {
|
|
|
+ html = "<span class='voiceSpan'>未上传语音</span>"
|
|
|
+ } else {
|
|
|
+ dataInfo.forEach(e => {
|
|
|
+ html += "<audio style='height:30px;width:100%' controlsList='nodownload' oncontextmenu='return false' controls='controls'><source src='" + this.ajaxSend.getAudioAddress(that, e.path) + "'>您的浏览器不支持 audio 标签。</audio>";
|
|
|
+ })
|
|
|
+ }
|
|
|
+ $(item).empty().append(html);
|
|
|
+ $(item).attr("readonly", "readonly");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (var item of dom.find(".spanValue")) {
|
|
|
+ if (this.initTag.indexOf(item) == -1) {
|
|
|
+ if (this.initTag.indexOf(item) == -1) {
|
|
|
+ this.initTag.push(item);
|
|
|
+ for (var dataItem in auditList) {
|
|
|
+ if (dataItem == item.attributes.name.value) {
|
|
|
+ item.textContent=this.verificationHelper.setNullAndUndefinedEnpty(auditList[dataItem]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ for (var item of dom.find(".schedulerAuditOneHisList")) {
|
|
|
+ if (this.initTag.indexOf(item) == -1) {
|
|
|
+ this.initTag.push(item);
|
|
|
+
|
|
|
+
|
|
|
+ let processData = data.auditHisList;
|
|
|
+
|
|
|
+ let header_action = "<tr><th>审核人</th><th>审核时间</th><th>审核状态</th><th>审核意见</th></tr>";
|
|
|
+
|
|
|
+ let actionList = [];
|
|
|
+
|
|
|
+ let allHtml = "";
|
|
|
+ if (processData && processData.length > 0) {
|
|
|
+ processData.forEach(processItem => {
|
|
|
+ let html = "";
|
|
|
+
|
|
|
+ let auditUser = this.verificationHelper.setNullAndUndefinedEnpty(processItem.createUserName);
|
|
|
+ let auditUserHtml = "<td title='" + auditUser + "'>" + auditUser + "</td>";
|
|
|
+
|
|
|
+ let reportTimeHtml = "<td title='" + this.verificationHelper.setNullAndUndefinedEnpty(processItem.createTime) + "'>" +
|
|
|
+ this.verificationHelper.setNullAndUndefinedEnpty(processItem.createTime) + "</td>";
|
|
|
+ let auditResult = this.verificationHelper.setNullAndUndefinedEnpty(processItem.auditResultName);
|
|
|
+ let auditResultHtml = "<td title='" + auditResult + "'>" + auditResult + "</td>";
|
|
|
+
|
|
|
+ let description = this.verificationHelper.setNullAndUndefinedEnpty(processItem.auditNote);
|
|
|
+ let descriptionHtml = "<td title='" + description + "'>" + description + "</td>";
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ html = ("<tr>" + auditUserHtml+reportTimeHtml+auditResultHtml + descriptionHtml + "</tr>");
|
|
|
+ actionList.push({
|
|
|
+ time: parseInt(this.verificationHelper.setNullAndUndefinedEnpty(processItem.createTime).replace(/[^0-9]*/g, "")),
|
|
|
+ item: html,
|
|
|
+ type: "1"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ actionList.push({
|
|
|
+ time: 9999999999999999999999,
|
|
|
+ item: "<tr><td colspan='4'>暂无审核历史内容</td></tr>",
|
|
|
+ type: "1"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ actionList.forEach((itemB, indexB) => {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (allHtml == "") {
|
|
|
+ allHtml += (header_action + itemB.item);
|
|
|
+ } else {
|
|
|
+ allHtml += itemB.item
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ $(item).append("<table class='table table-bordered'>" + allHtml + "</table>");
|
|
|
+ $(item).find('.tableImg').viewer();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
* 根据id字段获取新型
|
|
|
* @param id 隐患id
|
|
@@ -444,6 +768,10 @@ class HiddenPageInfo extends BaseWidget {
|
|
|
case this.state.coordinate:
|
|
|
this.getCoordinatePage(that, formDom, item, type, data);
|
|
|
break;
|
|
|
+
|
|
|
+ case this.state.finishAudit:
|
|
|
+ this.getAuditPage(that, formDom, item, type, data);
|
|
|
+ break;
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -452,7 +780,7 @@ class HiddenPageInfo extends BaseWidget {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-
|
|
|
+
|
|
|
* @param that 用于获取全局的一些配置
|
|
|
* @param dDom 部门下拉框dom
|
|
|
* @param uDom 用户下拉框dom
|
|
@@ -591,19 +919,19 @@ class HiddenPageInfo extends BaseWidget {
|
|
|
case item.processId == 1:
|
|
|
reportSym.push(data)
|
|
|
break;
|
|
|
-
|
|
|
+
|
|
|
case item.processId == 2:
|
|
|
checkSym.push(data)
|
|
|
break;
|
|
|
-
|
|
|
+
|
|
|
case item.processId == 3:
|
|
|
organisationalSchemeSym.push(data)
|
|
|
break;
|
|
|
-
|
|
|
+
|
|
|
case item.processId == 4:
|
|
|
conductSchemeSym.push(data)
|
|
|
break;
|
|
|
-
|
|
|
+
|
|
|
default:
|
|
|
completeSchemeSym.push(data)
|
|
|
break;
|
|
@@ -695,7 +1023,7 @@ class HiddenPageInfo extends BaseWidget {
|
|
|
* */
|
|
|
goPoint(data) {
|
|
|
if (data && data.locationX && data.locationY) {
|
|
|
- this.map.setScale(this.config.zoomscale);
|
|
|
+ this.map.setScale(this.config.zoomscale);
|
|
|
this.map.centerAt(new Point(parseFloat(data.locationX), parseFloat(data.locationY), this.map.spatialReference));
|
|
|
}
|
|
|
}
|
|
@@ -713,6 +1041,7 @@ class HiddenPageInfo extends BaseWidget {
|
|
|
if (data['isDiscretionId'] == 0) {
|
|
|
dom.find('.selfConduct').hide();
|
|
|
}
|
|
|
+
|
|
|
this.initLinkHtml(that, dom, data, type);
|
|
|
}
|
|
|
|
|
@@ -730,7 +1059,7 @@ class HiddenPageInfo extends BaseWidget {
|
|
|
this.initLinkHtml(that, dom, data, type)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
* @param that 模块全局
|
|
|
* @param dom html代码渲染位置
|
|
|
* @param state 环节
|
|
@@ -757,6 +1086,10 @@ class HiddenPageInfo extends BaseWidget {
|
|
|
dom.find('.hideCoordinate').remove();
|
|
|
}
|
|
|
}
|
|
|
+ getAuditPage(that, dom, state, type, data){
|
|
|
+ this.setPageHtml(dom, state);
|
|
|
+ this.initLinkHtml_list(that, dom, data, type,data.auditList[0]);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
* 销毁对象
|
|
@@ -765,4 +1098,4 @@ class HiddenPageInfo extends BaseWidget {
|
|
|
this.domObj.remove();
|
|
|
this.afterDestroy();
|
|
|
}
|
|
|
-}
|
|
|
+}
|