Index: ssts-web/src/main/webapp/disinfectsystem/problemReport/problemReportForm.js =================================================================== diff -u -r15523 -r28127 --- ssts-web/src/main/webapp/disinfectsystem/problemReport/problemReportForm.js (.../problemReportForm.js) (revision 15523) +++ ssts-web/src/main/webapp/disinfectsystem/problemReport/problemReportForm.js (.../problemReportForm.js) (revision 28127) @@ -3,12 +3,35 @@ function cancel() { problemWin.close(); } +var httpOptionTextAndValueStore= new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/core/httpOptionAction!getHttpOptionTextAndValueById.do?optionId=question_feedback', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + }, [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'} + ]) +}); +//时间戳转日期 +function timestampToTime(timestamp) { + var date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000 + Y = date.getFullYear(); + M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1); + D = (date.getDate()<10)?'0'+(date.getDate()):date.getDate(); + h = (date.getHours()<10)?'0'+(date.getHours()):date.getHours(); + m = (date.getMinutes()<10)?'0'+(date.getMinutes()):date.getMinutes(); + s = (date.getSeconds()<10)?'0'+(date.getSeconds()):date.getSeconds(); + return Y + '-' + M + '-' + D +' '+ h + ':' + m; +} /** * 增加问题 */ function addProblemReport(){ showWindow(); top.Ext.getCmp('answerArea').disable(); + top.Ext.getCmp('answerAreaButton').disable(); } function showWindow(){ formPanel = new top.Ext.FormPanel({ @@ -32,14 +55,15 @@ id : 'id' },{ xtype : 'hidden', + name : 'actionType', + id : 'actionType', + value:'new' + },{ + xtype : 'hidden', name : 'orgUnitCoding', id : 'orgUnitCoding', value : $Id('orgUnitCoding').value },{ - xtype : 'hidden', - name : 'actionType', - id : 'actionType' - },{ layout : 'form', columnWidth : .5, labelWidth : 90, @@ -51,6 +75,23 @@ anchor : '95%', allowBlank : false }] + },{ + layout : 'form', + columnWidth : .5, + labelWidth : 90, + items : [{ + xtype : 'combo', + id : 'type', + name : 'type', + valueField : 'name', + displayField : 'name', + anchor : '100%', + fieldLabel : '问题类型', + triggerAction : 'all', + forceSelection : true, + allowBlank : false, + store : httpOptionTextAndValueStore + }] }, { layout : 'form', columnWidth : .5, @@ -81,10 +122,6 @@ name : 'answer_Time', id : 'answer_Time', value : $Id('today').value - },{ - xtype : 'hidden', - name : 'status', - id : 'status' }] }, { layout : 'form', @@ -116,6 +153,18 @@ }] },{ layout : 'form', + columnWidth : .5, + labelWidth : 90, + items : [{ + xtype : 'textfield', + id : 'status', + name : 'status', + fieldLabel : '状态', + readOnly : true, + cls:'fieldReadOnlyNoRemove' + }] + },{ + layout : 'form', columnWidth : 1, labelWidth : 90, items : [ { @@ -137,9 +186,11 @@ name : 'remark', id : 'remark', width : 150, - height : 50, - fieldLabel : "备注", - anchor : '97%' + height : 100, + fieldLabel : "沟通记录", + anchor : '97%', + readOnly : true, + cls:'fieldReadOnlyNoRemove' }] },{ layout : 'form', @@ -148,13 +199,50 @@ id : "answerArea", items : [ { xtype : 'textarea', - name : 'answer', - id : 'answer', + name : 'answerValue', + id : 'answerValue', width : 150, height : 50, fieldLabel : "回复", anchor : '97%' }] + },{ + layout : 'form', + columnWidth : 1, + labelWidth : 90, + id : "answerAreaButton", + items : [ + new top.Ext.Button({ + text:'回复', + style:'margin: 15px 0px 10px 95px;', + handler: function(){ + var answerValue = top.Ext.getCmp('answerValue').getValue() || ''; + var id = top.Ext.getCmp('id').getValue(); + if(answerValue == ''){ + showResult('回复内容不能为空'); + return; + } + + top.Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/problemAction!replyProblem.do', + params : { + 'id':id, + 'content':answerValue + }, + success : function(response,options){ + var result = Ext.decode(response.responseText); + var status = top.Ext.getCmp('status').getValue(); + if(result.success){ + showResult(result.msg); + loadAndEditProblemData(id,status,"update",true) + }else { + showResult(result.msg); + } + } + }) + } + }) + ] }] }], buttons : [{ @@ -163,6 +251,14 @@ handler : function(){ saveProblem(this); } + },{ + id : 'solveBtn', + text : '已解决', + hidden:true, + handler : function(){ + top.Ext.getCmp('actionType').setValue('answered'); + saveProblem(this); + } }, { text : '取消', id : 'saveAndNewBtn', @@ -185,10 +281,11 @@ /*** * 加载数据 */ -function loadAndEditProblemData(id,status,action){ - +function loadAndEditProblemData(id,status,action,isReload){ //显示窗体 - showWindow(); + if(!isReload){ + showWindow(); + } if(!Ext.isEmpty(id)){ Ext.Ajax.request({ @@ -208,12 +305,25 @@ top.Ext.getCmp('registerPerson').setValue(result.data.registerPerson); top.Ext.getCmp('orgUnitCoding').setValue(result.data.orgUnitCoding); top.Ext.getCmp('description').setValue(result.data.description); - top.Ext.getCmp('remark').setValue(result.data.remark); - top.Ext.getCmp('status').setValue(result.data.status); - top.Ext.getCmp('answer').setValue(result.data.answer); + top.Ext.getCmp('actionType').setValue(action); - if(status == "已回复" && action !="answer"){ -// showResult("已回复的问题不能修改"); + top.Ext.getCmp('status').setValue(result.data.status); + var answers = result.data.answers; + var contents = ''; + for(var i=0;i +<%@page import="com.forgon.systemsetting.model.HttpOption"%> +<%@page import="com.forgon.systemsetting.service.HttpOptionManager"%> +<%@page import="java.util.List"%> <%@page import="java.text.SimpleDateFormat"%> <%@ page contentType="text/html; charset=UTF-8"%> <%@ include file="/common/taglibs.jsp"%> @@ -10,6 +13,12 @@ request.setAttribute("today", dateFormat.format(new Date())); %> +<% + HttpOptionManager httpOptionManager = (HttpOptionManager)SpringBeanManger.getBean("httpOptionManager"); + List causeList = httpOptionManager.getHttpOptionTextById(HttpOption.SYSTEMSETTING_QUESTION_FEEDBACK); + request.setAttribute("causeList",causeList); +%> + @@ -18,6 +27,16 @@ <%@ include file="/common/includeExtJsAndCss.jsp"%> @@ -28,6 +47,11 @@ + + + + +