Index: ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectForm.js =================================================================== diff -u -r21373 -r21382 --- ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectForm.js (.../washAndDisinfectForm.js) (revision 21373) +++ ssts-web/src/main/webapp/disinfectsystem/washanddisinfectmanager/washanddisinfectrecord/washAndDisinfectForm.js (.../washAndDisinfectForm.js) (revision 21382) @@ -1374,14 +1374,17 @@ }); if(id != 0){ - loadDisinfectedMaterial(id); isAddorAlter = false ; //修改时为flase; + pitchOn = true; + var oldPerson = null; //清空后台传过来的清洗责任人 + var oldPersonCode = null; //清空后台传过来的清洗责任人登录名 + loadDisinfectedMaterial(id); }else{ - washingMachineStore.load(); pitchOn = true; isAddorAlter = true ; var oldPerson = null; //清空后台传过来的清洗责任人 var oldPersonCode = null; //清空后台传过来的清洗责任人登录名 + washingMachineStore.load(); } } function addPendingWashAndDisinfectBasketToRecord(barcode,idCardBarcode,isRetrospectTousse){ @@ -1829,7 +1832,7 @@ root.eachChild(function(child) { var personInCharge = child.attributes.personInCharge; if( child.attributes.personInCharge == null || child.attributes.personInCharge == ''){ - child.attributes.personInCharge = result.fullName; +// child.attributes.personInCharge = result.fullName; child.attributes.personInChargeCode = result.name; var newBasket = cloneBasket(child); var curIndex = root.indexOf(child); Index: ssts-web/src/main/webapp/disinfectsystem/interfere/interferewashAndDisinfectForm.js =================================================================== diff -u -r18491 -r21382 --- ssts-web/src/main/webapp/disinfectsystem/interfere/interferewashAndDisinfectForm.js (.../interferewashAndDisinfectForm.js) (revision 18491) +++ ssts-web/src/main/webapp/disinfectsystem/interfere/interferewashAndDisinfectForm.js (.../interferewashAndDisinfectForm.js) (revision 21382) @@ -6,6 +6,10 @@ var pendingWashAndDisinfectColumnTree; var startDateTimerHandle = null; //开始时间定时器的句柄 var endDateTimerHandle = null; //结束时间定时器的句柄 +var oldPerson = null; //修改时后台传过来的清洗责任人 +var oldPersonCode = null; //修改时后台传过来的清洗责任人登录名 +var pitchOn = true; //判断是否点击了责任人后扫描条码 true没修改, flase修改过 +var isAddorAlter = true ; //判断是否是修改还是添加 true是添加,flase是修改 var materialDefinitionStore = new Ext.data.Store({ pageSize: 100, @@ -423,9 +427,15 @@ } var root = top.Ext.getCmp('basketTreePanel').root; root.appendChild(basket); - if(basket.attributes.personInCharge != null && basket.attributes.personInCharge != ''){ - top.Ext.getCmp('personInCharge').setValue(basket.attributes.personInCharge); - top.Ext.getCmp('personInChargeCode').setValue(basket.attributes.personInChargeCode); +// if(basket.attributes.personInCharge != null && basket.attributes.personInCharge != ''){ +// top.Ext.getCmp('personInCharge').setValue(basket.attributes.personInCharge); +// top.Ext.getCmp('personInChargeCode').setValue(basket.attributes.personInChargeCode); +// } + if(basketJson.washPersonInCharge != null && basketJson.washPersonInCharge != ''){ //清洗记录责任人取清洗记录自己保存的责任人 + oldPerson = basketJson.washPersonInCharge; + oldPersonCode = basketJson.washPersonInChargeCode; + top.Ext.getCmp('personInCharge').setValue(basketJson.washPersonInCharge); + top.Ext.getCmp('personInChargeCode').setValue(basketJson.washPersonInChargeCode); } if(basket.attributes.position != null && basket.attributes.position != ''){ top.Ext.getCmp('position').setValue(basket.attributes.position); @@ -441,6 +451,12 @@ amount : materialJson.amount }); materialStore.add(material); + if(materialJson.washPersonInCharge != null && materialJson.washPersonInCharge != ''){ //清洗记录责任人取自己清洗记录保存的责任人 + oldPerson = materialJson.washPersonInCharge; + oldPersonCode = materialJson.washPersonInChargeCode; + top.Ext.getCmp('personInCharge').setValue(materialJson.washPersonInCharge); + top.Ext.getCmp('personInChargeCode').setValue(materialJson.washPersonInChargeCode); + } } resetContainerCount();//编辑时计算已扫描篮筐数量 }, @@ -653,7 +669,13 @@ readOnly : true, id : "personInCharge", anchor : '99%', - cls:'fieldReadOnlyNoRemove' + cls:'fieldReadOnlyNoRemove', + listeners : { + focus: function(){ + //获取焦点 + pitchOn = false; //修改时点击责任人获取焦点才能修改清洗责任人 + } + } }] },{ xtype : 'hidden', @@ -1134,8 +1156,16 @@ }); if(id != 0){ + isAddorAlter = false ; //修改时为flase; + pitchOn = true; + var oldPerson = null; //清空后台传过来的清洗责任人 + var oldPersonCode = null; //清空后台传过来的清洗责任人登录名 loadDisinfectedMaterial(id); }else{ + pitchOn = true; + isAddorAlter = true ; + var oldPerson = null; //清空后台传过来的清洗责任人 + var oldPersonCode = null; //清空后台传过来的清洗责任人登录名 washingMachineStore.load(); } } @@ -1334,12 +1364,23 @@ var conCurrent = top.Ext.getCmp("conCurrent").getValue(); var orgWashStartTime = top.Ext.getCmp('orgWashStartTime').getValue(); var orgWashEndTime = top.Ext.getCmp('orgWashEndTime').getValue(); + if(isAddorAlter){ //新添加纪录取责任人框内数据 + var washPersonInCharge = top.Ext.getCmp('personInCharge').getValue(); //取界面最后显示的责任人为清洗责任人 + var washPersonInChargeCode = top.Ext.getCmp('personInChargeCode').getValue(); + }else if(pitchOn){ //修改时是否点击责任人修改过 true没修改 false修改过 + var washPersonInCharge = oldPerson; //取加载旧责任人为清洗责任人 + var washPersonInChargeCode = oldPersonCode; + }else{ + var washPersonInCharge = top.Ext.getCmp('personInCharge').getValue(); //取界面最后显示的责任人为清洗责任人 + var washPersonInChargeCode = top.Ext.getCmp('personInChargeCode').getValue(); + } + Ext.getCmp('washSaveSubmitResult').setValue("0"); top.Ext.getCmp("disinfectProgram").setValue(top.Ext.getCmp("disinfectProgram").getRawValue()); var washRecordMsg = top.Ext.getCmp('washRecordMsg').getValue(); formObj.form.submit({ url : WWWROOT + '/disinfectSystem/washAndDisinfect/washAndDisinfectRecordAction!interfereWashAndDisinfectRecord.do', - params : {conCurrent :conCurrent, orgWashStartTime : orgWashStartTime, orgWashEndTime : orgWashEndTime,washRecordMsg : washRecordMsg}, + params : {conCurrent :conCurrent, orgWashStartTime : orgWashStartTime, orgWashEndTime : orgWashEndTime,washRecordMsg : washRecordMsg, washPersonInCharge : washPersonInCharge, washPersonInChargeCode : washPersonInChargeCode}, method : 'POST', waitMsg : '正在保存数据,请稍候', waitTitle : '提交表单', @@ -1355,11 +1396,15 @@ Ext.getCmp('washSaveSubmitResult').setValue("-1"); top.Ext.getCmp("saveBtn").enable(); } + oldPerson = null; //成功保存清空旧的责任人 + oldPersonCode = null; }, failure : function(form, action) { showResult(action.result.message); Ext.getCmp('washSaveSubmitResult').setValue("-1"); top.Ext.getCmp("saveBtn").enable(); + oldPerson = null; //失败清空旧的责任人 + oldPersonCode = null; } }); } @@ -1496,7 +1541,7 @@ root.eachChild(function(child) { var personInCharge = child.attributes.personInCharge; if( child.attributes.personInCharge == null || child.attributes.personInCharge == ''){ - child.attributes.personInCharge = result.fullName; +// child.attributes.personInCharge = result.fullName; child.attributes.personInChargeCode = result.name; var newBasket = cloneBasket(child); var curIndex = root.indexOf(child);