Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js
===================================================================
diff -u -r17660 -r17724
--- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 17660)
+++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 17724)
@@ -716,6 +716,12 @@
}
+function addReturnDisposableGoodsByInvoicePlan(invoicePlanId){
+ document.location.href = WWWROOT+'/disinfectsystem/returnGoodsRecord/returnDisposableGoodsByInvoicePlan.jsp?invoicePlanId='+invoicePlanId;
+}
+function addReturnTousseByInvoicePlan(invoicePlanId){
+ document.location.href = WWWROOT+'/disinfectsystem/returnGoodsRecord/returnTousseByInvoicePlan.jsp?invoicePlanId='+invoicePlanId;
+}
/**
* 重新设置一次性物品节点的值
* @param targetNode 对应的节点
@@ -3830,11 +3836,13 @@
{header : "拼音码",width : 120 * fontSizeScale,dataIndex : 'spelling',hidden:true},
{header : "五笔码",width : 120 * fontSizeScale,dataIndex : 'wbCode',hidden:true},
{header: "发货单状态", dataIndex: 'invoiceStatus',hidden:true},
- {header : "操作",width : 175 * fontSizeScale,renderer: function(v,p,record){
+ {header : "操作",width : 420 * fontSizeScale,renderer: function(v,p,record){
var invoiceStatus = record.data.invoiceStatus;
var deliverStatus = record.data.deliverStatus;
var inoviceButton = "";
var returnButton = "";
+ var returnGoodsButton = "";
+ var viewReturnGoodsButton = "";
// 未提交或者待发货的单,不显示签收以及查看发货单按钮
if (record.data.committedStatus == '' || deliverStatus == '待发货'){
return "";
@@ -3853,6 +3861,13 @@
inoviceButton = "";
}
}
+ if(deliverStatus == '已发货' || deliverStatus == '部分发货' || invoiceStatus == '部分签收' || invoiceStatus == '已签收'){
+ returnGoodsButton += "";
+ returnGoodsButton += "";
+ }
+ if(record.data.returnedGoods == '是'){
+ viewReturnGoodsButton = "";
+ }
var departCoding = $Id('departCoding').value; //用户的当前科室科室编码
var handleDepartCoding = record.data.handleDepartCoding; //处理科室的科室编码
@@ -3862,7 +3877,7 @@
&& (returnStatusArr[0] == record.data.returnStatus || returnStatusArr[1] == record.data.returnStatus)){
returnButton = "";
}
- return inoviceButton+returnButton;
+ return inoviceButton+returnButton+returnGoodsButton+viewReturnGoodsButton;
}
},
{header : "预回收人",width : 65 * fontSizeScale,dataIndex : 'prepareRecycleOperator',hidden : sstsConfig.hiddenRecyclingPeople},
@@ -3900,6 +3915,7 @@
{name : 'prepareRecycleComfirmor'},
{name : 'prepareRecycleDateTime'},
{name : 'recyclingTime'},
+ {name : 'returnedGoods'},
{name : 'handleDepartCoding'}
];
Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/viewReturnGoodsRecord.js
===================================================================
diff -u
--- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/viewReturnGoodsRecord.js (revision 0)
+++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/viewReturnGoodsRecord.js (revision 17724)
@@ -0,0 +1,150 @@
+
+/******** 退货单窗口 start ********/
+
+//退货单窗口
+function searchReturnGoodsRecord(id){
+ var expander = new Ext.grid.RowExpander({
+ lazyRender : false,
+ enableCaching : false,
+ tpl : new Ext.Template(
+ '退货物品列表:
条码 | 物品名称 | 批次/灭菌日期 | 退货数量 | 单价 |
{invoiceItems}
'
+ )
+ });
+
+ var invoiceColumns = new Ext.grid.ColumnModel([
+ expander,
+ {
+ header : "流水号",
+ width : 80,
+ dataIndex : 'serialNumber',
+ menuDisabled:true
+ },{
+ header : "退货科室",
+ width : 120,
+ dataIndex : 'depart',
+ menuDisabled:true
+ },{
+ header : "退货员",
+ width : 60,
+ dataIndex : 'sender',
+ menuDisabled:true
+ },{
+ header : "退货时间",
+ width : 120,
+ dataIndex : 'returnTime',
+ renderer : myDateFormatByMinute,
+ menuDisabled:true
+ },{
+ header : "备注",
+ width : 100,
+ hidden : true,
+ dataIndex : 'remark',
+ menuDisabled:true
+ }]);
+
+ var rd = new Ext.data.JsonReader( {
+ totalProperty : 'totalProperty',
+ root : 'root'},
+ [ {
+ name : 'id'
+ },{
+ name : 'serialNumber'
+ },{
+ name : 'applicant'
+ },{
+ name : 'depart'
+ }, {
+ name : 'sender'
+ }, {
+ name : 'returnTime'
+ }, {
+ name : 'status'
+ }, {
+ name : 'remark'
+ },{
+ name : 'receiptor'
+ },{
+ name : 'receiptingTime'
+ },{
+ name : 'invoiceItems'
+ }]
+ );
+
+ var invoiceStore = new Ext.data.Store({
+ proxy : new Ext.data.HttpProxy({
+ url : WWWROOT + '/disinfectSystem/returnGoodsRecordAction!findReturnGoodsRecords.do',
+ method : 'POST'
+ }),
+ baseParams : { invoicePlanId: id },
+ reader : rd
+ });
+ invoiceStore.load();
+
+ //退货单列表视图
+ invoiceGrid = new top.Ext.grid.EditorGridPanel( {
+ bodyStyle : 'border:1px solid #afd7af',
+ cm : invoiceColumns,
+ store : invoiceStore,
+ plugins: expander,
+ width : 835,
+ height : 400,
+ frame : false,
+ viewConfig: {
+ forceFit:true
+ },
+ border : false,
+ clicksToEdit : 1,// 设置点击几次才可编辑
+ selModel : new top.Ext.grid.RowSelectionModel({
+ singleSelect : false
+ })
+ });
+
+ var invoiceWindow = new top.Ext.Window( {
+ id : 'invoiceWin',
+ layout : 'border',
+ title : '退货单列表',
+ width : 850,
+ autoHeight : false,
+ border : false,
+ height:430,
+ plain : true,
+ modal :true,
+ items : [{region:'center',
+ width: '75%',
+ items:[invoiceGrid]
+ }]
+ });
+ invoiceWindow.show();
+
+ expander.on("expand",function(expander,r,body,rowIndex){
+ var record = invoiceStore.getAt(rowIndex);
+ var invoiceID = record.data.id;
+
+ Ext.Ajax.request( {
+ url : WWWROOT + '/disinfectSystem/returnGoodsRecordAction!loadReturnGoodsRecordItemsByid.do',
+ method : 'GET',
+ params : { id : invoiceID },
+ waitMsg : '正在加载数据,请稍候',
+ success : function(response, options) {
+ var invoiceItems = '';
+ var result = response.responseText;
+ var jsonObject = eval('(' + result + ')');
+ for(var i=0;i' + invoiceItem.barcode + ' | ';
+ invoiceItems += '' + invoiceItem.showTousseName + ' | ';
+ invoiceItems += '' + invoiceItem.batchNumber + ' | ';
+ invoiceItems += '' + invoiceItem.count + ' | ';
+ invoiceItems += '' + invoiceItem.fluctuationPrice + ' | ';
+ }
+ record.set('invoiceItems',invoiceItems);
+ record.commit(true);
+ expander.bodyContent[record.id] = expander.tpl.apply(record.data);
+ },
+ failure : function(form, action) {
+ alert("数据加载失败,请稍后再试。");
+ }
+ });
+ });
+}
+/******** 退货单窗口 finish ********/
\ No newline at end of file
Index: ssts-web/src/main/webapp/disinfectsystem/returnGoodsRecord/returnTousseByInvoicePlan.js
===================================================================
diff -u -r17711 -r17724
--- ssts-web/src/main/webapp/disinfectsystem/returnGoodsRecord/returnTousseByInvoicePlan.js (.../returnTousseByInvoicePlan.js) (revision 17711)
+++ ssts-web/src/main/webapp/disinfectsystem/returnGoodsRecord/returnTousseByInvoicePlan.js (.../returnTousseByInvoicePlan.js) (revision 17724)
@@ -561,7 +561,7 @@
}
//
function addAndEditReturnDisposableGoodsByInvoicePlan(invoicePlanId){
- addAndEditReturnGoodsRecord('',true);
+ addAndEditReturnTousseRecord('',true);
}
function addAndEditReturnTousseRecord(id, enableBtn) {
editableConfig.editable = enableBtn;
@@ -662,128 +662,17 @@
bodyStyle : 'border:1px solid #afd7af',
loader : new top.Ext.tree.TreeLoader({
url : WWWROOT
- + '/disinfectSystem/returnGoodsRecordAction!loadReturnedTousseItems.do',
+ + '/disinfectSystem/returnGoodsRecordAction!loadReturnedTousseItemsByInvoicePlanId.do',
baseParams : {
- id : id
+ invoicePlanId : invoicePlanId
},
uiProviders : {
'col' : top.Ext.tree.ColumnNodeUI
}
}),
root : new top.Ext.tree.AsyncTreeNode({
text : '器械包'
- }),
- tbar : new top.Ext.Panel({
- border: false,
- items:[{
- xtype: 'toolbar',
- items: [{
- text : '扫描条码 :'
- },{
- xtype : 'textfield',
- id : 'barcode',
- name : 'barcode',
- width :200,
- enableKeyEvents : true,
- disabled:!enableBtn,
- listeners : {
- render : function(c) {
- c.getEl().on('keypress',function(e) {
- if (e.getKey() == 13) {// 输入;号键,grid重新加载
- loadReturnGoodsItem(true);
- }
- });
- }
- }
- }]
- }, {
- xtype: 'toolbar',
- items: [{
- text : '物品名称 :'
- },{
- xtype : 'combo',
- id : 'package1',
- name : 'package1',
- queryParam : 'spell',
- minChars : 0,
- valueField : 'id',
- displayField : 'name',
- width : 350,
- store : tousseStore,
- pageSize : 100,
- listConfig: {width: 300},
- forceSelection : true,
- disabled:!enableBtn,
- lazyInit : true,
- triggerAction : 'all',
- hideTrigger : true,
- emptyText : '器械包的拼音、五笔码或者名称',
- typeAhead : false,
- allowBlank : true,
- anchor : '97%',
- listeners : {
- select : function(combo, record, index) {
- top.Ext.getCmp('package1').setValue(record.data.name);
- },
- specialkey : function(field, ee) {
- if (ee.getKey() == Ext.EventObject.ENTER) {
- top.Ext.getCmp('count1').focus();
- }
- }
- }
- },{
- text : '数量 :'
- },{
- xtype : 'numberfield',
- id : 'count1',
- name : 'count1',
- style : 'text-align: left',
- anchor : '95%',
- width : 50,
- disabled:!enableBtn,
- allowNegative : false,
- allowDecimals : false,
- listeners : {
- specialkey : function(field, ee) {
- if (ee.getKey() == Ext.EventObject.ENTER) {
- var tousseName = top.Ext.getCmp("package1").getValue();
- var toussePrice = 0.00;
- DWREngine.setAsync(false);
- ReturnGoodsRecordTableManager.getToussePrice(tousseName,function(price){
- if(price != null){
- toussePrice = price;
- }
- });
- DWREngine.setAsync(true);
- if(addReturnTousseItemToTree('',tousseName,top.Ext.getCmp("count1").getValue(),toussePrice)){
- top.Ext.getCmp("package1").setValue('');
- top.Ext.getCmp("count1").setValue('');
- }
- }
- }
- }
- },{
- text : '添加',
- disabled:!enableBtn,
- iconCls : 'btn_ext_add',
- handler : function() {
- var tousseName = top.Ext.getCmp("package1").getValue();
- var toussePrice = 0.00;
- DWREngine.setAsync(false);
- ReturnGoodsRecordTableManager.getToussePrice(tousseName,function(price){
- if(price != null){
- toussePrice = price;
- }
- });
- DWREngine.setAsync(true);
- if(addReturnTousseItemToTree('',tousseName,top.Ext.getCmp("count1").getValue(),toussePrice)){
- top.Ext.getCmp("package1").setValue('');
- top.Ext.getCmp("count1").setValue('');
- }
- }
- }]
- }]
- })
+ })
});
returnGoodsColumnTree.on('load', function(store,node,response){
returnGoodsColumnTree.expandAll();
@@ -808,7 +697,7 @@
var obj = eObj.target;
if(obj){
if(obj.name == 'divName_amount') {//只有数量能编辑 divName_ + dataIndex
- return true;
+ return false;
}
}
}
@@ -854,6 +743,11 @@
name : 'departCoding',
id : 'departCoding'
},{
+ xtype : 'hidden',
+ name : 'invoicePlanId',
+ id : 'invoicePlanId',
+ value:invoicePlanId
+ },{
columnWidth : .5,
layout : 'form',
labelWidth : 80,
@@ -1056,8 +950,9 @@
waitTitle : '提交表单',
success : function(form, action) {
if(action.result.success){
- grid.dwrReload();
- window.close();
+// grid.dwrReload();
+ this_window.close();
+ document.location.href = WWWROOT+'/disinfectsystem/returnGoodsRecord/returnGoodsRecordView.jsp';
} else if (action.result.message){
showResult(action.result.message);
} else {
@@ -1080,12 +975,13 @@
},{
text : '取消',
handler : function() {
- window.close();
+ this_window.close();
+ document.location.href = WWWROOT+'/disinfectsystem/returnGoodsRecord/returnGoodsRecordView.jsp';
}
}]
});
- var window = new top.Ext.Window({
+ var this_window = new top.Ext.Window({
id : 'returnTousseRecordWin',
layout : 'fit',
title : entityName + '信息',
@@ -1097,551 +993,20 @@
plain : true,
items : [ form ]
});
- window.show();
-}
-function addAndEditReturnGoodsRecord(id, enableBtn) {
- editableConfig.editable = enableBtn;
- var diposableGoodsStore = new Ext.data.Store({
- pageSize: 100,
- proxy : new Ext.data.HttpProxy({
- url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsData.do?allItems=yes',
- method : 'POST'
- }),
- reader : new Ext.data.JsonReader({
- totalProperty : 'totalCount',
- root : 'data'
- }, [
- {name : 'id',mapping : 'id'},
- {name : 'spelling',mapping : 'spelling'},
- {name : 'name',mapping : 'name'},
- {name : 'displayName',mapping : 'displayName'},
- {name : 'amount',mapping : 'amount'}
- ]
- )
- });
+ this_window.show();
- if(diposableGoodsBatchNumStore == null){
- diposableGoodsBatchNumStore = new Ext.data.Store({
- reader : new Ext.data.JsonReader({
- fields : [
- {name : 'batchNumber'},
- {name : 'batchID'},
- {name : 'barcode'},
- {name : 'cost'},
- {name : 'expDate'}
- ]
- })
- });
- }
-
- if(BatchRecord == null){
- BatchRecord = Ext.data.Record.create([
- {name : 'batchNumber'},
- {name : 'disposableGoodsId'},
- {name : 'disposableGoodsStockId'},
- {name : 'disposableGoodsBatchId'},
- {name : 'disposableGoodsBatchStockId'},
- {name : 'barcode'},
- {name : 'cost'},
- {name : 'expDate'}
- ]);
- }
- //单价数据源
- if(priceStore == null){
- priceStore = new Ext.data.Store({
- reader : new Ext.data.JsonReader({
- fields : [
- {name : 'price'},
- {name : 'fluctuationPrice'},
- {name : 'sentAmount'},
- {name : 'returnedAmount'},
- ]
- })
- });
- }
- if(PriceRecord == null){
- PriceRecord = Ext.data.Record.create([
- {name : 'price'},
- {name : 'fluctuationPrice'},
- {name : 'sentAmount'},
- {name : 'returnedAmount'},
- ]);
- }
- //该退货记录已经录入的退货详细信息
- var dataReader = new Ext.data.JsonReader({
- fields : [
- {name : 'id'},
- {name : 'tousseName'},
- {name : 'unit'},
- {name : 'disposableGoodsID'},
- {name : 'disposableGoodsStockID'},
- {name : 'disposableGoodsBatchID'},
- {name : 'disposableGoodsBatchStockID'},
- {name : 'identificationID'},
- {name : 'expensiveDisposablegoodsId'},
- {name : 'amount'},
- {name : 'amountCanReturn'},
- {name : 'barcode'},
- {name : 'batchNumber'},
- {name : 'price'},
- {name : 'fluctuationPrice'},
- {name : 'isDelivery'},
- {name : 'expDate'}
- ]
- });
-
- //初始化加载器械包
- returnGoodsItemStore = new Ext.data.Store({
- proxy : new Ext.data.HttpProxy({
- url : WWWROOT + '/disinfectSystem/returnGoodsRecordAction!loadReturnGoodsItemByInvoicePlanId.do',
- method : 'POST'
- }),
- reader : dataReader,
- listeners : {
- load : function() {
- setTotalMoney();
- }
- }
- });
-
- function rowTotalRender(value, cellmeta, record, rowIndex, columnIndex, store) {
- return accMul(record.data.fluctuationPrice,record.data.amount);
- }
- var isToDeliveryStore = new top.Ext.data.SimpleStore( {
- fields : [ 'value'],
- data : [['是'],['否']]
- });
-
- var cmArr = new Array(new Ext.grid.RowNumberer(),
- {header : "条码",width : 80,dataIndex : 'barcode',menuDisabled:true},
- {id : 'autoWidth',header : "物品",dataIndex : 'tousseName',width : 180,menuDisabled:true},
- {header : "退货数量",width : 70,dataIndex : 'amount',menuDisabled:true,
- editor : new top.Ext.form.NumberField({
- allowBlank : false,
- disabled:!enableBtn,
- allowNegative : false,
- style : 'text-align: left',
- allowDecimals : false
- })
- },
- {header : "单位",width : 50,dataIndex : 'unit',menuDisabled:true},
- {header : "可退货数量",width : 70,dataIndex : 'amountCanReturn',menuDisabled:true},
- {header : "批次",width : 100,dataIndex : 'batchNumber',menuDisabled:true},
- {header : "单价",width : 50,dataIndex : 'fluctuationPrice',menuDisabled:true},
- {header : "失效日期",width : 80,dataIndex : 'expDate',menuDisabled:true},
- {header : "金额",width : 60,dataIndex : 'rowTotal',renderer:rowTotalRender,menuDisabled:true},
- {header : '删除',dataIndex:'button',width:60,menuDisabled:true,
- renderer: function(v,p,record){
- var str = '';
- if(editableConfig.editable){
- str = "
";
- }
-
- return str;
- }
- });
-
- if(id){
- cmArr.splice(2,0,{header : "是否重发",dataIndex : 'isDelivery',width : 60,menuDisabled:true});
- }else{
- cmArr.splice(2,0,{header : "是否重发",dataIndex : 'isDelivery',width : 60,menuDisabled:true,
- editor : new top.Ext.form.ComboBox({
- id : 'isDeliveryComboBox',
- name : 'isDeliveryComboBox',
- valueField : 'value',
- displayField : 'value',
- store : isToDeliveryStore,
- forceSelection : true,
- mode : 'local',
- triggerAction : 'all'
- })
- });
- }
-
- var cm = new top.Ext.grid.ColumnModel(cmArr);
-
-
- returnGoodsItemStore.on("beforeload", function(thiz, options) {
- thiz.baseParams["invoicePlanId"] = invoicePlanId;
- thiz.baseParams["warehouseId"] = top.Ext.getCmp('warehouseID').getValue();
- });
-
- /*var deptStore = new Ext.data.SimpleStore({
- fields : [ 'departName','departCoding' ],
- url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getAllOrgUnitName.do'
- });*/
-
- form = new top.Ext.FormPanel({
- id : 'returnGoodsRecordForm',
- frame : true,
- border : 0,
- labelSeparator : ':',
- bodyStyle : 'padding:5px 5px 0px 5px',
- width : 950,
- labelAlign:'right',
- autoHeight : true,
- autoScroll : true,
- items : [{
- xtype:"fieldset",
- layout:'column',
- title :'退货记录信息',
- autoHeight:true,
- items:[{
- layout : 'column',
- items : [{
- xtype : 'hidden',
- name : 'id',
- id : 'id'
- },{
- xtype : 'hidden',
- name : 'returnGoodsItemIds',
- id : 'returnGoodsItemIds'
- },{
- xtype : 'hidden',
- name : 'departCoding',
- id : 'departCoding'
- },{
- xtype : 'hidden',
- name : 'warehouseID',
- id : 'warehouseID'
- },{
- xtype : 'hidden',
- name : 'warehouseName',
- id : 'warehouseName'
- },{
- xtype : 'hidden',
- name : 'invoicePlanId',
- id : 'invoicePlanId',
- value:invoicePlanId
- },{
- columnWidth : .5,
- layout : 'form',
- labelWidth : 80,
- items : [{
- xtype : 'textfield',
- fieldLabel : '操作人',
- maxLength : '16',
- id : 'operator',
- name : 'operator',
- allowBlank : false,
- value : $Id('userName').value,
- anchor : '80%',
- readOnly : true,
- cls:'fieldReadOnlyNoRemove'
- }]
- }, {
- columnWidth : .5,
- layout : 'form',
- labelWidth : 70,
- items : [{
- xtype : 'datefieldWithMin',
- fieldLabel : '时间',
- id : 'returnTime',
- name : 'returnTime',
- editable:false,
- disabled:!editableConfig.editable,
- allowBlank: false,
- format:'Y-m-d H:i',
-// value: new Date(),
- anchor : '80%',
- listeners : {
- render : function() { //一次性物品的的退货时间,取服务器时间 cjr)
- (!id) ? setStartDate(top.Ext, 'yyyy/MM/dd HH:mm', 'returnTime') : (function(){})();
- }
- }
-
- }]
- }, {
- columnWidth : .5,
- layout : 'form',
- labelWidth : 80,
- items : [{
- xtype : 'textfield',
- fieldLabel : '退货人员工号',
- id : 'returnOfPeopleBarcode',
- name : 'returnOfPeopleBarcode',
- disabled:!editableConfig.editable,
- allowBlank : true,
- listeners : {
- specialkey : function(field,e){
- if(e.getKey() == 13){
- loadPeopleByStaffNum_forDiposableGoods(field);
- }
- }
- },
- anchor : '80%'
- }]
- } ,{
- columnWidth : .5,
- layout : 'form',
- labelWidth : 70,
- items : [{
- xtype : 'textfield',
- fieldLabel : '退货人',
- id : 'returnOfPeople',
- name : 'returnOfPeople',
- allowBlank : true,
- anchor : '80%',
- readOnly : true,
- cls:'x-item-disabled'
- }]
- } , {
- columnWidth : .5,
- layout : 'form',
- labelWidth : 80,
- items : [{
- xtype : 'combo',
- id : 'depart',
- name : 'depart',
- disabled:!editableConfig.editable,
- queryParam : 'spell',
- fieldLabel : '退货人科室',
- queryParam : 'spell',
- minChars : 0,
- valueField : 'name',
- displayField : 'name',
- anchor : '80%',
- store : departJsonStore,
- forceSelection : true,
- lazyInit : true,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : false,
- listeners :{
- select:function(combo, record, index ){
- var tem = record.data.id;
- top.Ext.getCmp('departCoding').setValue(tem);
- }
- }
- }]
- } ,{
- columnWidth : .5,
- layout : 'form',
- labelWidth : 70,
- items:[{
- xtype : 'combo',
- fieldLabel : '退货仓库',
- id : 'warehouse',
- name : 'warehouse',
- minChars : 0,
- valueField : 'id',
- displayField : 'name',
- store : wareHouseStore,
- forceSelection : true,
- lazyInit : false,
- mode : 'local',
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : false,
- width : 100,
- listeners : {
- select : function(combo, record, index) {
-// top.Ext.getCmp('warehouse').setValue(record.data.name);
- top.Ext.getCmp('warehouseID').setValue(record.data.id);
- top.Ext.getCmp('warehouseName').setValue(record.data.name);
-
- returnGoodsItemStore.removeAll();
- returnGoodsItemStore.load();
- setTotalMoney();
- },
- specialkey : function(field, ee) {
- if (ee.getKey() == Ext.EventObject.ENTER) {
- top.Ext.getCmp('remark').focus();
- }
- }
- }
- }]
- },{
- columnWidth : .5,
- layout : 'form',
- labelWidth : 80,
- items : [{
- xtype : 'textfield',
- fieldLabel : '总金额',
- maxLength : '16',
- id : 'totalMoney',
- name : 'totalMoney',
- anchor : '80%',
- readOnly : true,
- cls:'x-item-disabled'
- }]
- },{
- columnWidth : 1,
- layout : 'form',
- labelWidth : 80,
- items : [{
- xtype : 'textarea',
- height : 45,
- fieldLabel : '备注',
- id : 'remark',
- name : 'remark',
- disabled:!editableConfig.editable,
- allowBlank : true,
- anchor : '90%'
- }]
- }]
- }]
- },{
- xtype:"fieldset",
- layout:'column',
- title :'退货记录明细',
- autoHeight:true,
- items:[{
- layout : 'form',
- columnWidth : 1,
- items :[new top.Ext.grid.EditorGridPanel({
- id : 'returnGoodsItemGrid',
- store : returnGoodsItemStore,
- bodyStyle : 'border:1px solid #afd7af',
- cm : cm,
- width :920,
- height : 270,
- autoExpandColumn : 'autoWidth',
- border : true,
- frame : false,
- viewConfig: {
- forceFit:true
- },
- clicksToEdit : 1,// 设置点击几次才可编辑
- selModel : new top.Ext.grid.RowSelectionModel({
- singleSelect : false
- }),
- listeners:{
- afteredit : function() {
- setTotalMoney();
- }
- }
- })]
- }]
- }],
- buttonAlign :'center',
- buttons : [{
- text : '打印',
- handler : function() {
- var title = "";
- DWREngine.setAsync(false);
- SupplyRoomConfigTableManager.getStartTimeObject(function(config){
- if(config != null){
- title = config.unitName;
- }
- });
- DWREngine.setAsync(true);
- var operator = top.Ext.getCmp('operator').getValue();
- var returnTime = new Date(top.Ext.getCmp('returnTime').getValue()).format('Y-m-d');
- var depart = top.Ext.getCmp('depart').getValue();
- var totalMoney = top.Ext.getCmp('totalMoney').getValue();
- var remark = top.Ext.getCmp('remark').getValue();
- var returnGoodsItems = getReturnGoodsDetailGridDataToPrint();
- printReturnGoodsRecord(title,operator,returnTime,depart,totalMoney,remark,returnGoodsItems,0);
- }
- },{
- text : '保存',
- id : 'saveBtn',
- hidden:SSTS_ReturnGoodsRecord_Create && SSTS_ReturnGoodsRecord_Update,
- disabled:!enableBtn,
- handler : function(){
- top.Ext.MessageBox.confirm("请确认","是否保存"+ entityName + "信息?",function(btn) {
- if(btn=='yes') {
- if(!form.getForm().isValid()){
- showResult('请正确填写表单各值');
- return false;
- }
-// if(top.Ext.getCmp('returnOfPeople').getValue().length<1){
-// showResult('退货人信息不能为空');
-// return false;
-// }
-
- if(returnGoodsItemStore.getCount()<1){
- showResult('退货详细信息列表不能为空');
- return false;
- }
-
- //获取grid数据
- getReturnGoodsDetailGridData();
- top.Ext.getCmp("depart").enable();
- /*top.Ext.getCmp('returnOfPeople').setDisabled(false);
- top.Ext.getCmp('depart').setDisabled(false);*/
-// return false;
- form.form.submit({
- url : WWWROOT + '/disinfectSystem/returnGoodsRecordAction!saveReturnGoodsRecord.do',
- method : 'POST',
- waitMsg : '正在保存数据,请稍候',
- waitTitle : '提交表单',
- success : function(form, action) {
- if(action.result.success){
- showResult('保存成功');
- } else if (action.result.error){
- showResult(action.result.error);
- } else if(action.result.errMsg){
- showResult(action.result.errMsg);
- } else {
- showResult('保存失败');
- }
-// grid.dwrReload();
- top.Ext.getCmp('returnGoodsRecordWin').close();
- document.location.href = WWWROOT+'/disinfectsystem/returnGoodsRecord/returnGoodsRecordView.jsp';
- },
- failure : function(form, action) {
- top.Ext.getCmp("depart").disable();// 禁止修改科室
- if (action.result.error){
- showResult(action.result.error);
- } else if(action.result.errMsg){
- showResult(action.result.errMsg);
- } else {
- showResult('保存失败');
- }
- }
- });
- }
- });
- }
- },{
- text : '取消',
- handler : function() {
- top.Ext.getCmp('returnGoodsRecordWin').close();
- }
- }]
- });
-
- var win = new top.Ext.Window({
- id : 'returnGoodsRecordWin',
- layout : 'fit',
- title : entityName + '信息',
- width : 930,
- modal : true,
-// autoHeight : true,
- border : false,
- height:580,
- plain : true,
- items : [ form ]
- });
- win.show();
-
DWREngine.setAsync(false);
ReturnGoodsRecordTableManager.getInvoicePlanInfo(invoicePlanId,function(batchesStr){
var invoicePlanInfo = top.Ext4.JSON.decode(batchesStr);
- var warehouses = invoicePlanInfo.warehouses;
- wareHouseStore.removeAll();
- for(var i=0;i 0){
- // 选中第一个
- var combo = top.Ext.getCmp("warehouse");
- combo.setValue(warehouses[0].id);
- // 触发选中事件
- combo.fireEvent('select', combo,wareHouseStore.getAt(0),0);
- }
+
top.Ext.getCmp('depart').setValue(invoicePlanInfo.depart);
top.Ext.getCmp('departCoding').setValue(invoicePlanInfo.departCoding);
});
DWREngine.setAsync(true);
}
+
// 器械包,科室退货人为空时才能更改退货人科室
function loadPeopleByStaffNum(staffNumField){
var staffNum = staffNumField.getValue();
Index: ssts-returngoods/src/main/java/com/forgon/disinfectsystem/returngoodsrecord/dwr/table/ReturnGoodsRecordTableManager.java
===================================================================
diff -u -r15567 -r17724
--- ssts-returngoods/src/main/java/com/forgon/disinfectsystem/returngoodsrecord/dwr/table/ReturnGoodsRecordTableManager.java (.../ReturnGoodsRecordTableManager.java) (revision 15567)
+++ ssts-returngoods/src/main/java/com/forgon/disinfectsystem/returngoodsrecord/dwr/table/ReturnGoodsRecordTableManager.java (.../ReturnGoodsRecordTableManager.java) (revision 17724)
@@ -3,24 +3,30 @@
import java.util.List;
import java.util.Map;
-import com.forgon.search.service.TBarFilterManager;
+import javax.annotation.Resource;
+
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
import org.apache.commons.lang.StringUtils;
import com.forgon.component.grid.GridManager;
import com.forgon.databaseadapter.service.DateQueryAdapter;
import com.forgon.directory.acegi.tools.AcegiHelper;
import com.forgon.disinfectsystem.basedatamanager.supplyroomconfig.service.SupplyRoomConfigManager;
-import com.forgon.disinfectsystem.entity.basedatamanager.supplyroomconfig.SupplyRoomConfig;
+import com.forgon.disinfectsystem.basedatamanager.warehouse.service.WareHouseManager;
import com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseDefinition;
+import com.forgon.disinfectsystem.entity.basedatamanager.warehouse.WareHouse;
+import com.forgon.disinfectsystem.entity.invoicemanager.Invoice;
+import com.forgon.disinfectsystem.entity.invoicemanager.InvoicePlan;
import com.forgon.disinfectsystem.entity.returngoodsrecord.ReturnGoodsItem;
import com.forgon.disinfectsystem.entity.returngoodsrecord.ReturnGoodsRecord;
import com.forgon.disinfectsystem.returngoodsrecord.service.ReturnGoodsItemVO;
import com.forgon.disinfectsystem.returngoodsrecord.service.ReturnGoodsRecordManager;
import com.forgon.disinfectsystem.tousse.toussedefinition.service.TousseDefinitionManager;
-import com.forgon.tools.MathTools;
+import com.forgon.search.service.TBarFilterManager;
+import com.forgon.tools.hibernate.ObjectDao;
-import javax.annotation.Resource;
-
/**
* @author panhaowen
*
@@ -41,6 +47,10 @@
@Resource(name = "returnGoodsRecordTableFilterManagerImpl")
private TBarFilterManager returnGoodsRecordTableFilterManagerImpl;
+ private ObjectDao objectDao;
+
+ private WareHouseManager wareHouseManager;
+
public void setSupplyRoomConfigManager(
SupplyRoomConfigManager supplyRoomConfigManager) {
this.supplyRoomConfigManager = supplyRoomConfigManager;
@@ -73,6 +83,14 @@
return gridManager.renderGrid(parameterMap, ReturnGoodsRecord.class.getSimpleName(), sql.toString(), new String[] {"returnGoodsItems", "recyclingApplication" });
}
+ public void setObjectDao(ObjectDao objectDao) {
+ this.objectDao = objectDao;
+ }
+
+ public void setWareHouseManager(WareHouseManager wareHouseManager) {
+ this.wareHouseManager = wareHouseManager;
+ }
+
public ReturnGoodsRecord getReturnGoodsRecordById(String id) {
return returnGoodsRecordManager.getById(id);
}
@@ -116,4 +134,30 @@
}
return returnGoodsItems;
}
+
+ public String getInvoicePlanInfo(String invoicePlanId) {
+ JSONObject obj = new JSONObject();
+ JSONArray warehouses = new JSONArray();
+ InvoicePlan invoicePlan = (InvoicePlan) objectDao.getByProperty(
+ InvoicePlan.class.getSimpleName(), "id", Long.valueOf(invoicePlanId));
+ if(invoicePlan != null){
+ List list = objectDao.findBySql(Invoice.class.getSimpleName(), String.format(" where po.invoicePlan.id=%s", invoicePlan.getId()));
+ obj.put("depart", invoicePlan.getDepart());
+ obj.put("departCoding", invoicePlan.getDepartCoding());
+// WareHouse defaultWareHouse = wareHouseManager.getDefaultWareHouseByUnitCode(invoicePlan.getDepartCoding());
+ if(list != null){
+ for (Invoice invoice : list) {
+ Long warehouseId = invoice.getSourceWarehouseId();
+ String warehouseName = invoice.getSourceWarehouseName();
+ JSONObject warehouse = new JSONObject();
+ warehouse.put("id", warehouseId);
+ warehouse.put("name", warehouseName);
+
+ warehouses.add(warehouse);
+ }
+ }
+ }
+ obj.put("warehouses", warehouses);
+ return obj.toString();
+ }
}
Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.jsp
===================================================================
diff -u -r16838 -r17724
--- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.jsp (.../goodsApplicationView.jsp) (revision 16838)
+++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.jsp (.../goodsApplicationView.jsp) (revision 17724)
@@ -345,6 +345,7 @@
+
@@ -377,6 +378,7 @@
.script("goodsAppHelper.js")
.script("signForInvoiceWin.js")
+ .script("viewReturnGoodsRecord.js")
.script("${ctx}/disinfectsystem/showTousseImage/ext4ShowTousseImage.js")