Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/storageRecordView.jsp =================================================================== diff -u -r29513 -r30433 --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/storageRecordView.jsp (.../storageRecordView.jsp) (revision 29513) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/storageRecordView.jsp (.../storageRecordView.jsp) (revision 30433) @@ -1,7 +1,7 @@ -<%@page import="com.forgon.disinfectsystem.entity.basedatamanager.supplier.Supplier,com.forgon.disinfectsystem.entity.assestmanagement.GodownEntry "%> <%@ page contentType="text/html; charset=UTF-8"%> <%@ include file="/common/taglibs.jsp"%> <%@ include file="/common/includeExtJsAndCss.jsp"%> +<%@ include file="/common/includeExtJs4_2.jsp"%> <%@ page import="com.forgon.tools.SpringBeanManger" %> <% String userName = AcegiHelper.getLoginUser().getUserFullName(); @@ -11,60 +11,25 @@ 入库单信息 - - - - - - - - - - - - - - - + @@ -74,13 +39,5 @@
- -
- - - - -
- \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/storageRecordView.js =================================================================== diff -u -r25142 -r30433 --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/storageRecordView.js (.../storageRecordView.js) (revision 25142) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/disposableGoods/storageRecordView.js (.../storageRecordView.js) (revision 30433) @@ -1,191 +1,467 @@ -var grid; +var listStore; +var departGroupGrid; +//修改科室分组 +function modify(v, data) { + editConfig(data.id); +} -// 全部一次性物品 -var allDiposableGoodsStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ -// url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsData.do?allItems=yes', - url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsDataWithStock.do', - 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 : 'referencePrice',mapping : 'referencePrice'} - ]) -}); +//查询 +function search(listStore, params) { + listStore.proxy.extraParams = params; + listStore.loadPage(1); +} -// 科室能申请的一次性物品 -var diposableGoodsStore = new Ext.data.Store({ - pageSize : 100, - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsData.do', - 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 : 'referencePrice',mapping : 'referencePrice'} - ]) -}); +Ext4.onReady(function () { + Ext4.QuickTips.init(); + var columns = [ + { id: 'displayName', header: "物品名称", dataIndex: 'displayName', width: 200, menuDisabled: true }, + { header: "批次", dataIndex: 'batchNumber', width: 100, menuDisabled: true }, + { header: "单号", dataIndex: 'serialNumber', width: 100, menuDisabled: true }, + { header: "单类型", dataIndex: 'type', width: 100, menuDisabled: true }, + { header: "操作员", dataIndex: 'operator', width: 100, menuDisabled: true }, + { header: "操作内容", dataIndex: 'subType', width: 120, menuDisabled: true }, + { header: "操作时间", dataIndex: 'time', width: 140, menuDisabled: true }, + { header: "仓库", dataIndex: 'warehouseName', width: 120, menuDisabled: true }, + { header: "入库金额", dataIndex: 'totalPrice', width: 100, align: 'right', menuDisabled: true }, + { header: "入库单价", dataIndex: 'price', width: 100, align: 'right', menuDisabled: true }, + { header: "入库数量", dataIndex: 'amount', width: 100, align: 'right', menuDisabled: true }, + { header: "出库金额", dataIndex: 'outTotalPrice', width: 100, align: 'right', menuDisabled: true }, + { header: "出库数量", dataIndex: 'outAmout', width: 100, align: 'right', menuDisabled: true }, + { header: "申领科室", dataIndex: 'depart', width: 100, menuDisabled: true }, + { header: "结算科室", dataIndex: 'settleAccountsDepart', width: 100, menuDisabled: true } + ]; -Ext.onReady(function() { - Ext.QuickTips.init(); + listStore = new Ext4.data.JsonStore({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/diposableGoodsAction!loadDisposableGoodsStorageRecord.do', + reader: { + root: 'data' + } + }, + fields: [ + { name: 'operator' }, + { name: 'batchNumber' }, + { name: 'serialNumber' }, + { name: 'time' }, + { name: 'type' }, + { name: 'subType' }, + { name: 'warehouseName' }, + { name: 'amount' }, + { name: 'price' }, + { name: 'totalPrice' }, + { name: 'name' }, + { name: 'specification' }, + { name: 'displayName' }, + { name: 'outTotalPrice' }, + { name: 'outAmout' }, + { name: 'depart' }, + { name: 'settleAccountsDepart' } + ] + }); - var storageRecord = new StorageRecord(); - + departGroupGrid = new Ext4.grid.GridPanel({ + title: '一次性物品出入库记录', + columns: columns, + frame: false, + autoScroll: false, + store: listStore, + viewConfig: { + autoFill: true + } + }); + + //物品类型 + var GoodsTypeData = []; + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsType.do', + async: false, + success: function (response, options) { + var result = Ext4.decode(response.responseText); + GoodsTypeData = result; + } + }); + + var diposableGoodsTypeStore = new Ext4.data.SimpleStore({ + fields: ['typeName'], + data: [GoodsTypeData] + }) + + //查询方式 + var searchModelStore = new Ext4.data.SimpleStore({ + fields: ['value'], + data: [['明细查询'], ['汇总查询']] + }) + + //申领科室/结算科室 + var appDepartJsonStore = new Ext4.data.Store({ + proxy: { + type: 'ajax', + url: WWWROOT + '/systemmanage/orgUnit/searchApplyDepartmentByKeyWord.do', + reader: { + root: 'data' + }, + extraParams: { + onlyOneself: false, + showDisableOrgUnit: false + } + }, + fields: [ + { name: 'id', mapping: 'departmentCode' }, + { name: 'name', mapping: 'departmentName' } + ] + }); + + // 科室能申请的一次性物品 + var diposableGoodsStore = new Ext4.data.Store({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsData.do', + reader: { + totalProperty: 'totalCount', + root: 'data' + }, + pageSize: 100, + extraParams: { + onlyOneself: false, + showDisableOrgUnit: false + } + }, + fields: [ + { name: 'id', mapping: 'id' }, + { name: 'spelling', mapping: 'spelling' }, + { name: 'name', mapping: 'name' }, + { name: 'displayName', mapping: 'displayName' }, + { name: 'referencePrice', mapping: 'referencePrice' } + ] + }); + + //发货科室分组 + var invoiceDepartment = []; + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/invoiceDepartmentAction!loadDepartGroup.do', + async: false, + success: function (response, options) { + var result = Ext4.decode(response.responseText); + for (var i = 0; i < result.length; i++) { + invoiceDepartment[i] = { + id: result[i][0], + shift: result[i][1], + departCode: result[i][2] + } + } + } + }); + + var invoiceDepartmentIdStore = new Ext4.data.SimpleStore({ + fields: [ + { name: 'id', mapping: 'id' }, + { name: 'shift', mapping: 'shift' }, + { name: 'departCode', mapping: 'departCode' } + ], + data: invoiceDepartment + }) + var dt = new Date(); - var v = dt.getMonth()+1; - if(v < 10){ - v = "0" + (dt.getMonth()+1); + var v = dt.getMonth() + 1; + if (v < 10) { + v = "0" + (dt.getMonth() + 1); } var startDayofMonth = dt.getFullYear() + "/" + v + "/01"; - var form = new Ext.Panel({ - id : 'northPanel', - layout : 'table', - frame : true, - region : 'north', - border : false, - bodyBorder : false, - layoutConfig : {columns : 2}, - height : 63, - items : [{ - width :900, - layout : 'column', - items:[{ - columnWidth : .73, - layout : 'form', - labelWidth : 60, - items : [{ - fieldLabel : '关键字', - xtype : 'combo', - id : 'code', - name : 'code', - queryParam : 'spell', - minChars : 0, - valueField : 'id', - displayField : 'displayName', - width : 600, - pageSize : 100, - store : allDiposableGoodsStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - allowBlank : true, - anchor : '97%', - listeners : { - select : function(combo, record, index) { - Ext.getCmp('disposableGoodsID').setValue(record.data.id); - Ext.getCmp('code').setValue(record.data.name); - } - } + var form = new Ext4.form.Panel({ + region: 'north', + buttonAlign: 'center', + border: 0, + frame: true, + bodyStyle: 'padding:0px auto;margin:0px', + height: 100, + id: 'form', + items: [{ + layout: 'column', + autoHeight: true, + items: [{ + layout: 'form', + columnWidth: 0.25, + items: [{ + xtype: 'datefield', + fieldLabel: '开始日期', + labelAlign: 'right', + id: 'startDate', + name: 'startDate', + editable: false, + format: 'Y-m-d', + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + allowBlank: false, + anchor: '95%', + value: new Date(startDayofMonth) }] - },{ - columnWidth : .25, - layout : 'form', - labelWidth : 60, - items : [{ - xtype:'hidden', - id:'disposableGoodsID', - name:'disposableGoodsID' + }, { + layout: 'form', + columnWidth: 0.25, + items: [{ + xtype: 'datefield', + fieldLabel: '结束日期', + labelAlign: 'right', + id: 'endDate', + name: 'endDate', + editable: false, + format: 'Y-m-d', + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + allowBlank: false, + anchor: '95%', + value: new Date() }] - },{ - columnWidth : .5, - layout : 'form', - labelWidth : 60, - items : [{ - xtype : 'datefield', - fieldLabel : '开始日期', - name : 'startDate', - id : 'startDate', - readOnly : false, - altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', - editable : false, - format : 'Y-m-d', - value:new Date(startDayofMonth), - anchor : '94%' + }, { + xtype: 'hidden', + id: 'disposableGoodsId', + name: 'disposableGoodsId' + }, { + layout: 'form', + columnWidth: 0.25, + items: [{ + xtype: 'combo', + fieldLabel: '物品类型', + id: 'diposableGoodsType', + name: 'diposableGoodsType', + labelAlign: 'right', + valueField: 'typeName', + displayField: 'typeName', + store: diposableGoodsTypeStore, + forceSelection: true, + value: '', + editable: false, + mode: 'remote', + triggerAction: 'all', + anchor: '95%' }] - },{ - columnWidth : .5, - layout : 'form', - labelWidth : 60, - items : [{ - xtype : 'datefield', - fieldLabel : '结束日期', - name : 'endDate', - id : 'endDate', - readOnly : false, - altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', - editable : false, - format : 'Y-m-d', - value:new Date(), - anchor : '94%' - }] - }] - },{ - width :150, - layout : 'column', - items : [{ - columnWidth : .5, - layout :'form', - items : [{ - xtype : 'button', - text : '查询', - minWidth : 70, - iconCls : 'icon_search', - handler : function() { - var startDate = Ext.getCmp('startDate').getRawValue(); - var endDate = Ext.getCmp('endDate').getRawValue(); - var disposableGoodsID = Ext.getCmp('disposableGoodsID').getValue(); - if(startDate || endDate){ - if(!compareDate(startDate,endDate)){ - showResult("开始时间不能大于结束时间"); - return; - } + }, { + layout: 'form', + columnWidth: 0.25, + items: [{ + xtype: 'combo', + id: 'goodsSearch', + name: 'goodsSearch', + queryParam: 'spell', + fieldLabel: '物品名称', + labelAlign: 'right', + minChars: 0, + valueField: 'id', + displayField: 'displayName', + anchor: '95%', + store: diposableGoodsStore, + pageSize: 100, + width: 400, + listConfig: { width: 300 }, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: true, + listeners: { + select: function (combo, record, index) { + Ext4.getCmp('disposableGoodsId').setValue(record[0].data.id); + Ext4.getCmp('goodsSearch').setValue(record[0].data.name); } - if(isUndefinedOrNullOrEmpty(disposableGoodsID)){ - showResult("请选择一次性物品"); - return; - } - storageRecord.setDisposableGoodsId(disposableGoodsID); - storageRecord.loadData(null,startDate,endDate); } }] - },{ - columnWidth : .5, - layout :'form', - items : [{ - xtype : 'button', - text : '重置', - minWidth : 70, - iconCls : 'icon_set', - handler : function() { - //Ext.getCmp('code').setValue(""); - Ext.getCmp('startDate').setValue(""); - Ext.getCmp('endDate').setValue(""); - } + }, { + layout: 'form', + columnWidth: 0.25, + items: [{ + xtype: 'combo', + fieldLabel: '申领科室', + id: 'departCoding', + name: 'departCoding', + labelAlign: 'right', + valueField: 'id', + displayField: 'name', + minChars: 0, + queryParam: 'spell', + allowBlank: true, + store: appDepartJsonStore, + mode: 'remote', + triggerAction: 'all', + anchor: '95%' }] + }, { + layout: 'form', + columnWidth: 0.25, + items: [{ + xtype: 'combo', + fieldLabel: '结算科室', + id: 'settleAccountsDepartCoding', + name: 'settleAccountsDepartCoding', + labelAlign: 'right', + valueField: 'id', + displayField: 'name', + minChars: 0, + queryParam: 'spell', + allowBlank: true, + store: appDepartJsonStore, + mode: 'remote', + triggerAction: 'all', + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: 0.25, + items: [{ + xtype: 'combo', + fieldLabel: '发货科室分组', + id: 'invoiceDepartmentId', + name: 'invoiceDepartmentId', + labelAlign: 'right', + valueField: 'id', + displayField: 'shift', + minChars: 0, + queryParam: 'spell', + allowBlank: true, + store: invoiceDepartmentIdStore, + mode: 'remote', + triggerAction: 'all', + anchor: '95%' + }] + }, { + layout: 'form', + columnWidth: 0.25, + items: [{ + xtype: 'combo', + fieldLabel: '查询方式', + labelAlign: 'right', + id: 'searchModel', + name: 'searchModel', + valueField: 'value', + displayField: 'value', + store: searchModelStore, + forceSelection: true, + editable: false, + value: '明细查询', + mode: 'local', + triggerAction: 'all', + anchor: '95%' + }] }] + }], + buttons: [{ + xtype: 'button', + text: '查询', + minWidth: 70, + iconCls: 'icon_search', + handler: function () { + var startDate = Ext4.getCmp('startDate').getRawValue(); + var endDate = Ext4.getCmp('endDate').getRawValue(); + var disposableGoodsId = Ext4.getCmp('disposableGoodsId').getValue(); + var diposableGoodsType = Ext4.getCmp('diposableGoodsType').getValue(); + var departCoding = Ext4.getCmp('departCoding').getValue(); + var settleAccountsDepartCoding = Ext4.getCmp('settleAccountsDepartCoding').getValue(); + var invoiceDepartmentId = Ext4.getCmp('invoiceDepartmentId').getValue(); + var searchModel = Ext4.getCmp('searchModel').getValue(); + + if (startDate || endDate) { + if (!compareDate(startDate, endDate)) { + showResult("开始时间不能大于结束时间"); + return; + } + } + + var params = { + startDate: startDate, + endDate: endDate, + searchModel: searchModel + } + + //物品类型 + if (!isUndefinedOrNullOrEmpty(diposableGoodsType)) { + params.diposableGoodsType = diposableGoodsType; + } + //物品名称 + if (!isUndefinedOrNullOrEmpty(disposableGoodsId)) { + params.disposableGoodsId = disposableGoodsId; + } + //申请科室 + if (!isUndefinedOrNullOrEmpty(departCoding)) { + params.departCoding = departCoding; + } + //结算科室 + if (!isUndefinedOrNullOrEmpty(settleAccountsDepartCoding)) { + params.settleAccountsDepartCoding = settleAccountsDepartCoding; + } + //发货科室分组 + if (!isUndefinedOrNullOrEmpty(invoiceDepartmentId)) { + params.invoiceDepartmentId = invoiceDepartmentId; + } + + search(listStore, params); + } + }, { + xtype: 'button', + text: '重置', + minWidth: 70, + iconCls: 'icon_set', + handler: function () { + Ext4.getCmp('startDate').setValue(new Date(startDayofMonth)); + Ext4.getCmp('endDate').setValue(new Date()); + Ext4.getCmp('disposableGoodsId').setValue(""); + Ext4.getCmp('goodsSearch').setValue(""); + Ext4.getCmp('diposableGoodsType').setValue(""); + Ext4.getCmp('departCoding').setValue(""); + Ext4.getCmp('settleAccountsDepartCoding').setValue(""); + Ext4.getCmp('invoiceDepartmentId').setValue(""); + Ext4.getCmp('searchModel').setValue("明细查询"); + } + }, { + xtype: 'button', + text: '导出', + minWidth: 70, + iconCls: 'btn_ext_download', + handler: function () { + var startDate = Ext4.getCmp('startDate').getRawValue(); + var endDate = Ext4.getCmp('endDate').getRawValue(); + var disposableGoodsId = Ext4.getCmp('disposableGoodsId').getValue(); + var diposableGoodsType = Ext4.getCmp('diposableGoodsType').getValue(); + var departCoding = Ext4.getCmp('departCoding').getValue(); + var settleAccountsDepartCoding = Ext4.getCmp('settleAccountsDepartCoding').getValue(); + var invoiceDepartmentId = Ext4.getCmp('invoiceDepartmentId').getValue(); + var searchModel = Ext4.getCmp('searchModel').getValue(); + + var exportUrl = WWWROOT + "/disinfectSystem/diposableGoodsAction!exportDisposableGoodsStorageRecord.do"; + exportUrl += "?startDate=" + startDate; + exportUrl += "&endDate=" + endDate; + exportUrl += "&searchModel=" + searchModel; + + //物品类型 + if (!isUndefinedOrNullOrEmpty(diposableGoodsType)) { + exportUrl += "&diposableGoodsType=" + diposableGoodsType; + } + //物品名称 + if (!isUndefinedOrNullOrEmpty(disposableGoodsId)) { + exportUrl += "&disposableGoodsId=" + disposableGoodsId; + } + //申请科室 + if (!isUndefinedOrNullOrEmpty(departCoding)) { + exportUrl += "&departCoding=" + departCoding; + } + //结算科室 + if (!isUndefinedOrNullOrEmpty(settleAccountsDepartCoding)) { + exportUrl += "&settleAccountsDepartCoding=" + settleAccountsDepartCoding; + } + //发货科室分组 + if (!isUndefinedOrNullOrEmpty(invoiceDepartmentId)) { + exportUrl += "&invoiceDepartmentId=" + invoiceDepartmentId; + } + + location.href = exportUrl; + } }] }); - var viewport = new Ext.Viewport( { - layout : 'border', - items : [form,{ - region : 'center', - margins : '0 0 0 0', - layout : 'fit', - items:[storageRecord.getShowGrid()] + + new Ext4.container.Viewport({ + layout: 'border', + items: [form, { + region: 'center', + layout: 'fit', + items: [departGroupGrid] }] }); + }); \ No newline at end of file