Index: ssts-web/src/main/webapp/disinfectsystem/satisfactionsurvey/satisfactionSurveyTableView.jsp
===================================================================
diff -u -r31798 -r38925
--- ssts-web/src/main/webapp/disinfectsystem/satisfactionsurvey/satisfactionSurveyTableView.jsp (.../satisfactionSurveyTableView.jsp) (revision 31798)
+++ ssts-web/src/main/webapp/disinfectsystem/satisfactionsurvey/satisfactionSurveyTableView.jsp (.../satisfactionSurveyTableView.jsp) (revision 38925)
@@ -7,7 +7,9 @@
满意度调查表定义
<%@ include file="/common/includeExtJsAndCss.jsp"%>
+<%@ include file="/common/includeExtJs4_2.jsp"%>
+
Index: ssts-web/src/main/webapp/disinfectsystem/satisfactionsurvey/satisfactionSurveyTableForm.js
===================================================================
diff -u -r35821 -r38925
--- ssts-web/src/main/webapp/disinfectsystem/satisfactionsurvey/satisfactionSurveyTableForm.js (.../satisfactionSurveyTableForm.js) (revision 35821)
+++ ssts-web/src/main/webapp/disinfectsystem/satisfactionsurvey/satisfactionSurveyTableForm.js (.../satisfactionSurveyTableForm.js) (revision 38925)
@@ -16,8 +16,22 @@
function createSatisfactionCheckBox(record, satisfactionVal, id){
var checked = "";
var satisfaction = record.get('satisfaction');
- if(satisfaction && satisfaction == satisfactionVal){
- checked = "checked=\"checked\"";
+ var defaultSatisfactionOption = record.get('defaultSatisfactionOption');
+ if(sstsConfig.satisfactionSurveyMode == 1){
+ if(satisfaction == '无'){
+ if(defaultSatisfactionOption && defaultSatisfactionOption.satisfaction == satisfactionVal){
+ checked = "checked=\"checked\"";
+ record.set('satisfaction',satisfactionVal || '无')
+ }
+ }else {
+ if(satisfaction && satisfaction == satisfactionVal){
+ checked = "checked=\"checked\"";
+ }
+ }
+ }else {
+ if(satisfaction && satisfaction == satisfactionVal){
+ checked = "checked=\"checked\"";
+ }
}
if (id) {
return "";
@@ -51,6 +65,7 @@
,{name: 'id'} //满意度调查表实例的id
,{name: 'seqNum'} //序号
,{name: 'content'} //项目内容
+ ,{name: 'defaultSatisfactionOption'}
,{name: 'satisfaction'} //满意度
]});
@@ -66,6 +81,97 @@
}
}
});
+
+ var columnsArr = [{
+ header: '序号',dataIndex: 'seqNum', width: 80, xtype:'treecolumn', sortable: false, menuDisabled: true
+ },{
+ header: '项目内容',dataIndex: 'content', width: 310, sortable: false, menuDisabled: true
+ },{
+ header: '满意',dataIndex: 'option_1', width: 50, sortable: false, menuDisabled: true, renderer: function(v,p,record){
+ if(record.get('leaf')){
+ return createSatisfactionCheckBox(record, SATISFACTION, id);
+ }
+ }
+ },{
+ header: '较满意',dataIndex: 'option_2', width: 60, sortable: false, menuDisabled: true, renderer: function(v,p,record){
+ if(record.get('leaf')){
+ return createSatisfactionCheckBox(record, MORESATISFACTION, id);
+ }
+ }
+ },{
+ header: '基本满意',dataIndex: 'option_3', width: 80, sortable: false, menuDisabled: true, renderer: function(v,p,record){
+ if(record.get('leaf')){
+ return createSatisfactionCheckBox(record, BASICSATISFACTION, id);
+ }
+ }
+ },{
+ header: '不太满意',dataIndex: 'option_4', width: 80, sortable: false, menuDisabled: true, renderer: function(v,p,record){
+ if(record.get('leaf')){
+ return createSatisfactionCheckBox(record, NOTVERYSATISFACTION, id);
+ }
+ }
+ },{
+ header: '不满意',dataIndex: 'option_5', width: 60, sortable: false, menuDisabled: true, renderer: function(v,p,record){
+ if(record.get('leaf')){
+ return createSatisfactionCheckBox(record, NOSATISFACTION, id);
+ }
+ }
+ }]
+
+ if(sstsConfig.satisfactionSurveyMode == 1){
+ Ext4.Ajax.request({
+ url: WWWROOT + '/disinfectSystem/baseData/satisfactionOption/satisfactionOptionController/loadSatisfactionOption.mhtml',
+ async:false,
+ success : function(response, options) {
+ var result = Ext.decode(response.responseText);
+ var success = result.success;
+ if(success){
+ columnsArr = [{
+ header: '序号',dataIndex: 'seqNum', width: 80, xtype:'treecolumn', sortable: false, menuDisabled: true
+ },{
+ header: '项目内容',dataIndex: 'content', width: 310, sortable: false, menuDisabled: true
+ }]
+ for(var i=0;i'
+ }else {
+ return v || ''
+ }
+ }
+ }
+ })
+ }
+ }
+ });
+ }
/**
* 意度调查表实例项的top.Ext4.tree.Panel
@@ -80,41 +186,7 @@
rowLines: true,
cls: 'no-leaf-icons',
store : satisfactionSurveyTableItemTreeStore,
- columns : [{
- header: '序号',dataIndex: 'seqNum', width: 80, xtype:'treecolumn', sortable: false, menuDisabled: true
- },{
- header: '项目内容',dataIndex: 'content', width: 310, sortable: false, menuDisabled: true
- },{
- header: '满意',dataIndex: 'option_1', width: 40, sortable: false, menuDisabled: true, renderer: function(v,p,record){
- if(record.get('leaf')){
- return createSatisfactionCheckBox(record, SATISFACTION, id);
- }
- }
- },{
- header: '较满意',dataIndex: 'option_2', width: 50, sortable: false, menuDisabled: true, renderer: function(v,p,record){
- if(record.get('leaf')){
- return createSatisfactionCheckBox(record, MORESATISFACTION, id);
- }
- }
- },{
- header: '基本满意',dataIndex: 'option_3', width: 70, sortable: false, menuDisabled: true, renderer: function(v,p,record){
- if(record.get('leaf')){
- return createSatisfactionCheckBox(record, BASICSATISFACTION, id);
- }
- }
- },{
- header: '不太满意',dataIndex: 'option_4', width: 70, sortable: false, menuDisabled: true, renderer: function(v,p,record){
- if(record.get('leaf')){
- return createSatisfactionCheckBox(record, NOTVERYSATISFACTION, id);
- }
- }
- },{
- header: '不满意',dataIndex: 'option_5', width: 50, sortable: false, menuDisabled: true, renderer: function(v,p,record){
- if(record.get('leaf')){
- return createSatisfactionCheckBox(record, NOSATISFACTION, id);
- }
- }
- }],
+ columns : columnsArr,
viewConfig : {
toggleOnDblClick: false,
markDirty:false
@@ -322,16 +394,36 @@
var remark = top.Ext4.getCmp('remark').getValue();
if (childNode.get('leaf')) {
var satisfaction = childNode.get('satisfaction');
- if (!satisfaction || satisfaction == '无') {
- showResult("请为“" + node.content + "”内容项选择满意度!");
- return false;
- } else if (satisfaction == NOTVERYSATISFACTION && !remark) {
- showResult('请在意见或建议栏填写不太满意的具体原因,以便改进!');
- return false;
- } else if (satisfaction == NOSATISFACTION && !remark) {
- showResult('请在意见或建议栏填写不满意的具体原因,以便改进!');
- return false;
+ if(sstsConfig.satisfactionSurveyMode == 1){
+ var defaultSatisfactionOption = childNode.get('defaultSatisfactionOption');
+ var nodeId = childNode.get('nodeId');
+ if(defaultSatisfactionOption && defaultSatisfactionOption.recordReason == '是'){
+ var recordReason = top.document.getElementById('recordReason_'+nodeId).value;
+ if(defaultSatisfactionOption.reasonNotNull == '是' && recordReason == ''){
+ showResult(node.content +'需要填写原因,请补充。');
+ return false;
+ }
+ node.satisfactionOptionDetails = [{
+ satifyResaon:recordReason,
+ satisfactionOption:{
+ id:defaultSatisfactionOption.id,
+ satisfaction:defaultSatisfactionOption.satisfaction
+ }
+ }]
+ }
+ }else {
+ if (!satisfaction || satisfaction == '无') {
+ showResult("请为“" + node.content + "”内容项选择满意度!");
+ return false;
+ } else if (satisfaction == NOTVERYSATISFACTION && !remark) {
+ showResult('请在意见或建议栏填写不太满意的具体原因,以便改进!');
+ return false;
+ } else if (satisfaction == NOSATISFACTION && !remark) {
+ showResult('请在意见或建议栏填写不满意的具体原因,以便改进!');
+ return false;
+ }
}
+
node.satisfaction = satisfaction;
} else {
var children = [];
@@ -343,15 +435,34 @@
node2.id = childNode2.get('id');
node2.content = childNode2.get('content');
var satisfaction = childNode2.get('satisfaction');
- if (!satisfaction || satisfaction == '无') {
- showResult("请为“" + node2.content + "”内容项选择满意度!");
- return false;
- } else if (satisfaction == NOTVERYSATISFACTION && !remark) {
- showResult('请在意见或建议栏填写不太满意的具体原因,以便改进!');
- return false;
- } else if (satisfaction == NOSATISFACTION && !remark) {
- showResult('请在意见或建议栏填写不满意的具体原因,以便改进!');
- return false;
+ if(sstsConfig.satisfactionSurveyMode == 1){
+ var defaultSatisfactionOption = childNode2.get('defaultSatisfactionOption');
+ var nodeId = childNode2.get('nodeId');
+ if(defaultSatisfactionOption && defaultSatisfactionOption.recordReason == '是'){
+ var recordReason = top.document.getElementById('recordReason_'+nodeId).value;
+ if(defaultSatisfactionOption.reasonNotNull == '是' && recordReason == ''){
+ showResult(node2.content +'需要填写原因,请补充。');
+ return false;
+ }
+ node2.satisfactionOptionDetails = [{
+ satifyResaon:recordReason,
+ satisfactionOption:{
+ id:defaultSatisfactionOption.id,
+ satisfaction:defaultSatisfactionOption.satisfaction
+ }
+ }]
+ }
+ }else {
+ if (!satisfaction || satisfaction == '无') {
+ showResult("请为“" + node2.content + "”内容项选择满意度!");
+ return false;
+ } else if (satisfaction == NOTVERYSATISFACTION && !remark) {
+ showResult('请在意见或建议栏填写不太满意的具体原因,以便改进!');
+ return false;
+ } else if (satisfaction == NOSATISFACTION && !remark) {
+ showResult('请在意见或建议栏填写不满意的具体原因,以便改进!');
+ return false;
+ }
}
node2.satisfaction = satisfaction;
children.push(node2);
Index: ssts-web/src/main/webapp/disinfectsystem/satisfactionsurvey/satisfactionSurveyTemplateView.jsp
===================================================================
diff -u -r35821 -r38925
--- ssts-web/src/main/webapp/disinfectsystem/satisfactionsurvey/satisfactionSurveyTemplateView.jsp (.../satisfactionSurveyTemplateView.jsp) (revision 35821)
+++ ssts-web/src/main/webapp/disinfectsystem/satisfactionsurvey/satisfactionSurveyTemplateView.jsp (.../satisfactionSurveyTemplateView.jsp) (revision 38925)
@@ -12,6 +12,7 @@
满意度调查表定义
<%@ include file="/common/includeExtJsAndCss.jsp"%>
+<%@ include file="/common/includeExtJs4_2.jsp"%>
Index: ssts-web/src/main/webapp/disinfectsystem/config/szszyy/config.js
===================================================================
diff -u -r37940 -r38925
--- ssts-web/src/main/webapp/disinfectsystem/config/szszyy/config.js (.../config.js) (revision 37940)
+++ ssts-web/src/main/webapp/disinfectsystem/config/szszyy/config.js (.../config.js) (revision 38925)
@@ -98,6 +98,8 @@
enableBioreaderInterface:true,
//允许第三方系统申请未命名的外来器械包
enableThirdPartySystemApplyUnnamedForeignTousse:true,
+ //满意度调查模式
+ satisfactionSurveyMode:1,
//启用使用记录单推送至第三方系统功能
enableUseRecordTransportToThirdPartySystem:true
}
\ No newline at end of file
Index: ssts-web/src/main/webapp/disinfectsystem/satisfactionsurvey/satisfactionSurveyTemplateForm.js
===================================================================
diff -u -r35828 -r38925
--- ssts-web/src/main/webapp/disinfectsystem/satisfactionsurvey/satisfactionSurveyTemplateForm.js (.../satisfactionSurveyTemplateForm.js) (revision 35828)
+++ ssts-web/src/main/webapp/disinfectsystem/satisfactionsurvey/satisfactionSurveyTemplateForm.js (.../satisfactionSurveyTemplateForm.js) (revision 38925)
@@ -21,7 +21,36 @@
rootNode.appendChild(childNode);
}
+var defaultSatisfactionOption = [];
function addSatisfactionSurveyTemplate(id,status,ishidden,isclear){
+ var showDefaultSatisfactionOption = false;
+ if(sstsConfig.satisfactionSurveyMode == 1){
+ defaultSatisfactionOption = [{
+ id:'',
+ name:' '
+ }]
+ Ext4.Ajax.request({
+ url: WWWROOT + '/disinfectSystem/baseData/satisfactionOption/satisfactionOptionController/loadSatisfactionOption.mhtml',
+ async:false,
+ success : function(response, options) {
+ var result = Ext.decode(response.responseText);
+ var success = result.success;
+ if(success){
+ for(var i=0;i";
+ for(var i=0;i"+ defaultSatisfactionOption[i].name +"";
+ }
+ str += "";
+ return str;
+ }
+ },{
header:'删除',
width:40,
hidden:!ishidden,
@@ -83,7 +129,7 @@
hidden:!ishidden,
dataIndex:'remove',
renderer:function(v,p,record){
- return "
";
+ return "
";
}
}],
@@ -380,11 +426,11 @@
}
},'->',{
text:'默认满意度:',
- hidden:!sstsConfig.enableDefaultSatisfactionOptionsFunction
+ hidden:showDefaultSatisfactionOption ? true: !sstsConfig.enableDefaultSatisfactionOptionsFunction
},{
xtype : 'combo',
id : 'defaultSatisfactionCombo',
- hidden:!sstsConfig.enableDefaultSatisfactionOptionsFunction,
+ hidden:showDefaultSatisfactionOption ? true: !sstsConfig.enableDefaultSatisfactionOptionsFunction,
valueField : 'id',
displayField : 'value',
width:100,
@@ -462,7 +508,7 @@
}
//获取columnTreePanel数据
var treeData = getItemTreeData(satisfactionSurveyTree);
- if(treeData==""){
+ if(treeData.length == 0){
showResult('满意度调查项不能为空!');
return false;
}
@@ -476,7 +522,7 @@
return false;
}*/
- top.Ext.getCmp("treeItemData").setValue("["+treeData+"]");
+ top.Ext.getCmp("treeItemData").setValue(JSON.stringify(treeData));
var b = this;
top.Ext.MessageBox.confirm("请确认","是否提交满意调查模板信息?",function(btn) {
if(btn=='yes') {
@@ -555,6 +601,8 @@
moveUp(clickNode);
}else if(isClickMoveDown()) {//下移
moveDown(clickNode);
+ }else if(isSelect()) {//下移
+ changeOption(clickNode);
}
setClickType('');
});
@@ -688,6 +736,14 @@
}
}
+var changeItem = {};
+
+function changeOption(clickNode){
+ if(changeItem){
+ clickNode.attributes.defaultSatisfactionOption = changeItem;
+ }
+}
+
var currentClickType = '';//删除、添加、上下移动标识字符
function setClickType(v){
currentClickType=v;
@@ -704,6 +760,13 @@
function isClickMoveDown(){
return (currentClickType=='down'?true:false);
}
+function isSelect(){
+ return (currentClickType=='select'?true:false);
+}
+function changeDefaultSatisfactionOption(selectedIndex){
+ console.log(selectedIndex)
+ changeItem = defaultSatisfactionOption[selectedIndex];
+}
function replaceStr(str){
var replaceV = "";
@@ -721,30 +784,31 @@
rootNode.eachChild(function(pNode){
if(!pNode.isLeaf()){//父节点
var parentContent = pNode.attributes[0] ? pNode.attributes[0]:pNode.attributes.content;
- valArr.push("{id:'");
- valArr.push("'");
- valArr.push(",content:'");
- valArr.push(replaceStr(parentContent));
- valArr.push("'");
- valArr.push(",children:[");
+ var children = [];
pNode.eachChild(function(cNode){
var lastContent = cNode.attributes[0] ? cNode.attributes[0]:cNode.attributes.content;
- valArr.push("{id:'");
- valArr.push("'");
- valArr.push(",content:'");
- valArr.push(replaceStr(lastContent));
- valArr.push("'}");
- if(!cNode.isLast()){
- valArr.push(",");
- }
+ children.push({
+ id:'',
+ content:replaceStr(lastContent),
+ defaultSatisfactionOption:cNode.attributes.defaultSatisfactionOption
+ })
});
- valArr.push("]}");
- if(!pNode.isLast()){
- valArr.push(",");
+ if(children.length == 0){
+ valArr.push({
+ id:'',
+ content:replaceStr(parentContent),
+ defaultSatisfactionOption:pNode.attributes.defaultSatisfactionOption
+ })
+ }else {
+ valArr.push({
+ id:'',
+ content:replaceStr(parentContent),
+ children:children
+ })
}
}
});
- return valArr.join("");
+ return valArr;
}
function submitForm(form,wwindow,btnSave){