Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js =================================================================== diff -u -r38849 -r39746 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js (.../invoiceView.js) (revision 38849) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js (.../invoiceView.js) (revision 39746) @@ -49,8 +49,8 @@ { name: 'price' }, { name: 'fluctuationPrice' }, { name: 'invoicePlanSerialNumber' }, - { name : 'settleAccountsDepart'}, - { name : 'settleAccountsDepartCoding'}, + { name: 'settleAccountsDepart' }, + { name: 'settleAccountsDepartCoding' }, { name: 'storage' }, { name: 'batchNumber' }, { name: 'sterilizerName' }, @@ -155,16 +155,16 @@ method: 'POST' }), reader: rd, - listeners:{ - load:function(store,records) { - if(records.length > 0){ + listeners: { + load: function (store, records) { + if (records.length > 0) { var sum = 0; - for(var i=0;i 0){ + if (sstsConfig.enableApplyGoodsRemarkFunction) { + if (printConfig.invoiceCombo && printConfig.invoiceCombo.goodsTable && printConfig.invoiceCombo.goodsTable.columns && printConfig.invoiceCombo.goodsTable.columns.length > 0) { var columns = printConfig.invoiceCombo.goodsTable.columns; - for(var i=0;i>', - tooltip :"下一页", - handler : function() { + xtype: 'button', + text: '>>', + tooltip: "下一页", + handler: function () { var page = top.Ext.getCmp('hiddenPage').getValue(); var totalPage = top.Ext.getCmp('hiddenTotalPage').getValue(); if (parseInt(page) + 1 > totalPage) { showResult('已是最后一页'); return; } top.Ext.getCmp('hiddenPage').setValue(parseInt(page) + 1); - invoiceSignDetailForPage(idsArr[page],id); + invoiceSignDetailForPage(idsArr[page], id); var element = top.Ext.get(toolbarPage.el); - element.update('第' + (parseInt(page) + 1) + '页'); + element.update('第' + (parseInt(page) + 1) + '页'); } }], - items:[form] - }); + items: [form] + }); signImgWin.show(); - if(idsArr.length > 0){ + if (idsArr.length > 0) { var signRecordId = idsArr[0]; var element = top.Ext.get(toolbarTotalPage.el); - element.update('共' + idsArr.length + '页'); - invoiceSignDetailForPage(signRecordId,id); + element.update('共' + idsArr.length + '页'); + invoiceSignDetailForPage(signRecordId, id); top.Ext.getCmp('hiddenPage').setValue(1); top.Ext.getCmp('hiddenTotalPage').setValue(idsArr.length); } } -function invoiceSignDetailForPage(signRecordId,id){ +function invoiceSignDetailForPage(signRecordId, id) { Ext.Ajax.request({ url: WWWROOT + '/disinfectSystem/signRecordAction!getSignDetailBySignRecordId.do', - params: { signRecordId: signRecordId,invoiceId: id }, + params: { signRecordId: signRecordId, invoiceId: id }, success: function (response, options) { var result = Ext.decode(response.responseText); - if(result.success){ + if (result.success) { top.Ext.getCmp('signUserName').setValue(result.signUserName); - if(result.data && result.data.length > 0){ + if (result.data && result.data.length > 0) { invoiceSignDetailStore.removeAll() for (var i = 0; i < result.data.length; ++i) { var recordData = new invoiceSignDetailRecord({ @@ -2202,7 +2202,7 @@ invoiceSignDetailStore.add(recordData); } } - var url = WWWROOT + '/disinfectSystem/baseData/showImageAction!getImage.do?objectId='+signRecordId+'&page=1&imageType='+encodeURIComponent("PDA端签收签名(竖屏版)")+'&showSourceImg=true' + '&time=' + new Date().getTime(); + var url = WWWROOT + '/disinfectSystem/baseData/showImageAction!getImage.do?objectId=' + signRecordId + '&page=1&imageType=' + encodeURIComponent("PDA端签收签名(竖屏版)") + '&showSourceImg=true' + '&time=' + new Date().getTime(); var imageBrowse = top.Ext.get('imageBrowse'); var img = imageBrowse.dom; imageBrowse.parent().dom.style.height = '220PX' @@ -2394,15 +2394,17 @@ { header: "打印时间", width: 120, dataIndex: 'printTime', renderer: myDateFormatByMinute, hidden: printTimeHidden }, { header: "发货员", width: 70, dataIndex: 'sender', hidden: senderHidden }, - { header: "发货总数量", width: 80, renderer:function(v, p, record){ - var sum = 0; - if(record.data.itemArray && record.data.itemArray.length > 0){ - for(var i=0;i 0) { + for (var i = 0; i < record.data.itemArray.length; i++) { + sum += record.data.itemArray[i].amount; + } } + return sum; } - return sum; - } }, + }, { header: "核对员", width: 70, dataIndex: 'assistantSender', hidden: assistantSenderHidden }, { header: "责任人", width: 70, dataIndex: 'personInCharge', hidden: personInChargeHidden }, { header: "拼音码", width: 100, dataIndex: 'spelling', hidden: true }, @@ -2415,13 +2417,15 @@ { header: "签收人", width: 70, dataIndex: 'receiptor', hidden: receiptorHidden }, { header: "签收时间", width: 120, dataIndex: 'receiptingTime', renderer: myDateFormatByMinute, hidden: receiptingTimeHidden }, { header: "签收状态", width: 100, dataIndex: 'signStatus', hidden: signStatusHidden }, - { header: "手写签名", width: 100, hidden: !sstsConfig.enableHandwrittenSignatureFunction,renderer: function (v, p, record) { - var buttonGroup = ""; - if(record.data.handwrittenSignatureSignRecordId !== ''){ - buttonGroup += ""; + { + header: "手写签名", width: 100, hidden: !sstsConfig.enableHandwrittenSignatureFunction, renderer: function (v, p, record) { + var buttonGroup = ""; + if (record.data.handwrittenSignatureSignRecordId !== '') { + buttonGroup += ""; + } + return buttonGroup; } - return buttonGroup; - } }, + }, { header: "结算科室", width: 100, dataIndex: 'settleAccountsDepart', hidden: settleAccountsDepartHidden }, { header: "仓库", width: 100, dataIndex: 'warehouseName', id: 'warehouseName', hidden: warehouseNameHidden }, { header: "总价", width: 70, dataIndex: 'totalPrice', align: 'right', renderer: formartPrice, hidden: totalPriceHidden } @@ -2586,9 +2590,9 @@ text: '器械包种类:', hidden: !sstsConfig.enableInstrumentSetTypeSetting }, { - xtype:'hidden', - id:'instrumentSetTypeIds', - name:'instrumentSetTypeIds' + xtype: 'hidden', + id: 'instrumentSetTypeIds', + name: 'instrumentSetTypeIds' }, { xtype: 'trigger', fieldLabel: "器械包种类", @@ -2602,7 +2606,7 @@ onTriggerClick: function () { var ids = Ext.getCmp('instrumentSetTypeIds').getValue(); var names = Ext.getCmp('tousseSetTypeName').getValue(); - setInstrumentSetType('instrumentSetTypeIds', 'tousseSetTypeName', ids, names,function(ids){ + setInstrumentSetType('instrumentSetTypeIds', 'tousseSetTypeName', ids, names, function (ids) { reloadConditionPara(ids, 'parm_s_instrumentSetTypeIds'); }); }, @@ -2611,7 +2615,7 @@ item.getEl().on('click', function (p) { var ids = Ext.getCmp('instrumentSetTypeIds').getValue(); var names = Ext.getCmp('tousseSetTypeName').getValue(); - setInstrumentSetType('instrumentSetTypeIds', 'tousseSetTypeName', ids, names, function(ids){ + setInstrumentSetType('instrumentSetTypeIds', 'tousseSetTypeName', ids, names, function (ids) { reloadConditionPara(ids, 'parm_s_instrumentSetTypeIds'); }); }); @@ -2841,7 +2845,7 @@ columns: columns, plugins: filters, autoExpandColumn: 'warehouseName', - searchDisableIndexes : ['invoicePlanSerialNumber'], + searchDisableIndexes: ['invoicePlanSerialNumber'], renderTo: 'gridDiv', frame: false, listeners: { Index: ssts-web/src/main/webapp/disinfectsystem/interfere/invoice/invoiceView.js =================================================================== diff -u -r38862 -r39746 --- ssts-web/src/main/webapp/disinfectsystem/interfere/invoice/invoiceView.js (.../invoiceView.js) (revision 38862) +++ ssts-web/src/main/webapp/disinfectsystem/interfere/invoice/invoiceView.js (.../invoiceView.js) (revision 39746) @@ -1,50 +1,50 @@ var entityName = "发货单"; var grid; -var tousseTypeDataArray = [['全部','全部'],['一次性物品','一次性物品'],['器械包','器械包'],['敷料包','敷料包'],['消毒物品','消毒物品'],['自定义器械包','自定义器械包'],['外来器械包','外来器械包'],['外来器械拆分小包','外来器械拆分小包'],['外部代理灭菌','外部代理灭菌']]; +var tousseTypeDataArray = [['全部', '全部'], ['一次性物品', '一次性物品'], ['器械包', '器械包'], ['敷料包', '敷料包'], ['消毒物品', '消毒物品'], ['自定义器械包', '自定义器械包'], ['外来器械包', '外来器械包'], ['外来器械拆分小包', '外来器械拆分小包'], ['外部代理灭菌', '外部代理灭菌']]; var rd = new Ext.data.JsonReader({ - fields : [ - {name : 'id'}, - {name : 'barcode'}, - {name : 'name'}, - {name : 'unit'}, - {name : 'showTousseName'}, - {name : 'count'}, - {name : 'diposable'}, - {name : 'price'}, - {name : 'tempAmount'}, - {name : 'amount'}, - {name : 'applicationAmount'}, - {name : 'batchNumber'}, - {name : 'type'} + fields: [ + { name: 'id' }, + { name: 'barcode' }, + { name: 'name' }, + { name: 'unit' }, + { name: 'showTousseName' }, + { name: 'count' }, + { name: 'diposable' }, + { name: 'price' }, + { name: 'tempAmount' }, + { name: 'amount' }, + { name: 'applicationAmount' }, + { name: 'batchNumber' }, + { name: 'type' } ] }); var tousseInstanceStoreReader = new Ext.data.JsonReader({ - fields : [ - {name : 'id'}, - {name : 'barcode'}, - {name : 'expensiveDGBarcode'}, - {name : 'name'}, - {name : 'specification'}, - {name : 'showTousseName'}, - {name : 'count'}, - {name : 'unit'}, - {name : 'diposable'}, - {name : 'price'}, - {name : 'fluctuationPrice'}, - {name : 'settleAccountsDepart'}, - {name : 'settleAccountsDepartCoding'}, - {name : 'upDateSettleAccountsDepart'}, - {name : 'storage'}, - {name : 'batchNumber'}, - {name : 'sterilizerName'}, - {name : 'frequency'}, - {name : 'externalCode'}, - {name : 'tousseType'}, - {name : 'expireDate'}, - {name : 'manufacturer'}, - {name : 'certification'}, - {name : 'type'} + fields: [ + { name: 'id' }, + { name: 'barcode' }, + { name: 'expensiveDGBarcode' }, + { name: 'name' }, + { name: 'specification' }, + { name: 'showTousseName' }, + { name: 'count' }, + { name: 'unit' }, + { name: 'diposable' }, + { name: 'price' }, + { name: 'fluctuationPrice' }, + { name: 'settleAccountsDepart' }, + { name: 'settleAccountsDepartCoding' }, + { name: 'upDateSettleAccountsDepart' }, + { name: 'storage' }, + { name: 'batchNumber' }, + { name: 'sterilizerName' }, + { name: 'frequency' }, + { name: 'externalCode' }, + { name: 'tousseType' }, + { name: 'expireDate' }, + { name: 'manufacturer' }, + { name: 'certification' }, + { name: 'type' } ] }); @@ -57,9 +57,9 @@ } function removeGridItem(id) { var rows = top.Ext.getCmp('recyclingGrid2').getSelectionModel() - .getSelections();// 返回值为 + .getSelections();// 返回值为 if (rows) { - for ( var i = 0; i < rows.length; i++) { + for (var i = 0; i < rows.length; i++) { var name = rows[i].data['name']; var amount = rows[i].data['count']; tousseInstanceStore.remove(rows[i]); @@ -69,9 +69,9 @@ } function removeGridItem2(id) { var rows = top.Ext.getCmp('recyclingGrid1').getSelectionModel() - .getSelections();// 返回值为 + .getSelections();// 返回值为 if (rows) { - for ( var i = 0; i < rows.length; i++) { + for (var i = 0; i < rows.length; i++) { var name = rows[i].data['name']; var amount = rows[i].data['count']; invoiceStore.remove(rows[i]); @@ -80,20 +80,20 @@ top.Ext.getCmp('deleteInvoicePlanItems').setValue(name); } else { top.Ext.getCmp('deleteInvoicePlanItems').setValue( - str + ";" + name); + str + ";" + name); } } } } function removeGridForeignItem() { var rows = top.Ext.getCmp('recyclingGrid1').getSelectionModel() - .getSelections();// 返回值为 + .getSelections();// 返回值为 if (rows) { - for ( var i = 0; i < rows.length; i++) { + for (var i = 0; i < rows.length; i++) { removeForeignBarcodeItemArr.push(rows[i].data.barcode); var index = tousseInstanceStore.find('barcode', - rows[i].data.barcode); + rows[i].data.barcode); if (index != -1) { var record = tousseInstanceStore.getAt(index); tousseInstanceStore.remove(record); @@ -105,9 +105,9 @@ function removeGridForeignItem2() { var rows = top.Ext.getCmp('recyclingGrid2').getSelectionModel() - .getSelections();// 返回值为 + .getSelections();// 返回值为 if (rows) { - for ( var i = 0; i < rows.length; i++) { + for (var i = 0; i < rows.length; i++) { var barcode = rows[i].data['barcode']; tousseInstanceStore.remove(rows[i]); updateAmountWithBarcode(barcode, 0); @@ -117,209 +117,209 @@ //SZSDSRMYY-166:修改结算科室 var updateSettleAccountsDepartWin; -function updateSettleAccountsDepartFunction(){ +function updateSettleAccountsDepartFunction() { var record = top.Ext.getCmp('recyclingGrid2').getSelectionModel().getSelected(); var updateSettleAccountsDepartForm = new top.Ext.FormPanel({ - id : 'form', - frame : true, - labelSeparator : ':', - labelAlign : 'right', - bodyStyle : 'padding:5px 5px 0px 5px', - autoHeight : true, - autoScroll : true, - items : [ { - layout : 'column', - items : [ { - columnWidth : 0.5, - layout : 'form', - labelWidth : 100, - items : [ { - xtype : 'textfield', - fieldLabel : '器械包名称', - id : 'name', - name : 'name', - readOnly:true, - cls : 'fieldReadOnlyNoRemove', - value:record.data.name, - anchor : '100%' - } ] - },{ - columnWidth : 0.5, - layout : 'form', - labelWidth : 100, - items : [ { - xtype : 'textfield', - fieldLabel : '器械包条码', - id : 'barcode', - name : 'barcode', - readOnly:true, - cls : 'fieldReadOnlyNoRemove', - value:record.data.barcode, - anchor : '100%' - } ] - },{ - columnWidth : 1, - layout : 'form', - labelWidth : 100, - items : [ { - xtype : 'textfield', - fieldLabel : '当前结算科室', - id : 'settleAccountsDepart', - name : 'settleAccountsDepart', - readOnly:true, - cls : 'fieldReadOnlyNoRemove', - value:record.data.settleAccountsDepart, - anchor : '100%' - } ] - },{ - columnWidth : 1, - layout : 'form', - labelWidth : 100, - items : [{ - xtype:'hidden', - id:'newSettleAccountsDepartCoding', - name:'newSettleAccountsDepartCoding' - },{ - xtype : 'combo', - fieldLabel : '干预结算科室', - id : 'newSettleAccountsDepart', - name : 'newSettleAccountsDepart', - queryParam : 'spell', - minChars : 0, - valueField : 'name', - displayField : 'name', - store : new top.Ext.data.Store({ - proxy : new top.Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSettleAccountsDepartJson.do?showDisableOrgUnit=false', - method : 'POST' + id: 'form', + frame: true, + labelSeparator: ':', + labelAlign: 'right', + bodyStyle: 'padding:5px 5px 0px 5px', + autoHeight: true, + autoScroll: true, + items: [{ + layout: 'column', + items: [{ + columnWidth: 0.5, + layout: 'form', + labelWidth: 100, + items: [{ + xtype: 'textfield', + fieldLabel: '器械包名称', + id: 'name', + name: 'name', + readOnly: true, + cls: 'fieldReadOnlyNoRemove', + value: record.data.name, + anchor: '100%' + }] + }, { + columnWidth: 0.5, + layout: 'form', + labelWidth: 100, + items: [{ + xtype: 'textfield', + fieldLabel: '器械包条码', + id: 'barcode', + name: 'barcode', + readOnly: true, + cls: 'fieldReadOnlyNoRemove', + value: record.data.barcode, + anchor: '100%' + }] + }, { + columnWidth: 1, + layout: 'form', + labelWidth: 100, + items: [{ + xtype: 'textfield', + fieldLabel: '当前结算科室', + id: 'settleAccountsDepart', + name: 'settleAccountsDepart', + readOnly: true, + cls: 'fieldReadOnlyNoRemove', + value: record.data.settleAccountsDepart, + anchor: '100%' + }] + }, { + columnWidth: 1, + layout: 'form', + labelWidth: 100, + items: [{ + xtype: 'hidden', + id: 'newSettleAccountsDepartCoding', + name: 'newSettleAccountsDepartCoding' + }, { + xtype: 'combo', + fieldLabel: '干预结算科室', + id: 'newSettleAccountsDepart', + name: 'newSettleAccountsDepart', + queryParam: 'spell', + minChars: 0, + valueField: 'name', + displayField: 'name', + store: new top.Ext.data.Store({ + proxy: new top.Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSettleAccountsDepartJson.do?showDisableOrgUnit=false', + method: 'POST' }), - reader : new top.Ext.data.JsonReader({ - root : 'data' - },[ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'} - ] + reader: new top.Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' } + ] ) }), - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - allowBlank : false, - anchor : '95%', - listeners:{ - select:function(combo, records, index){ + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: false, + anchor: '95%', + listeners: { + select: function (combo, records, index) { top.Ext.getCmp('newSettleAccountsDepartCoding').setValue(records.data.id) }, - focus : function(thiz){ + focus: function (thiz) { thiz.selectText(); } } - } ] + }] }] - } ], - buttons : [ { - text : '确认', - handler : function(){ + }], + buttons: [{ + text: '确认', + handler: function () { var newSettleAccountsDepart = top.Ext.getCmp('newSettleAccountsDepart').getValue(); var newSettleAccountsDepartCoding = top.Ext.getCmp('newSettleAccountsDepartCoding').getValue(); - if(newSettleAccountsDepart == '' && newSettleAccountsDepartCoding == ''){ + if (newSettleAccountsDepart == '' && newSettleAccountsDepartCoding == '') { showResult('干预结算科室不能为空!'); return } - record.set('settleAccountsDepart',newSettleAccountsDepart); - record.set('settleAccountsDepartCoding',newSettleAccountsDepartCoding); - record.set('upDateSettleAccountsDepart',true); + record.set('settleAccountsDepart', newSettleAccountsDepart); + record.set('settleAccountsDepartCoding', newSettleAccountsDepartCoding); + record.set('upDateSettleAccountsDepart', true); updateSettleAccountsDepartWin.close(); } }, { - text : '取消', - handler : function(){ + text: '取消', + handler: function () { updateSettleAccountsDepartWin.close(); } - } ] + }] }); updateSettleAccountsDepartWin = new top.Ext.Window({ - id : 'updateSettleAccountsDepartWin', - layout : 'fit', - title : '修改结算科室 ', - width : 500, - border : false, - modal : true, - autoHeight : true, - plain : true, - items : [ updateSettleAccountsDepartForm ] + id: 'updateSettleAccountsDepartWin', + layout: 'fit', + title: '修改结算科室 ', + width: 500, + border: false, + modal: true, + autoHeight: true, + plain: true, + items: [updateSettleAccountsDepartForm] }); updateSettleAccountsDepartWin.show(); } //SZSDSRMYY-166:渲染结算科室 -function renderSettleAccountsDepartFunction(v, p, record){ - if(record.data.tousseType == '一次性物品' || SSTS_InterfereSettleDepart_ViewMenu){ +function renderSettleAccountsDepartFunction(v, p, record) { + if (record.data.tousseType == '一次性物品' || SSTS_InterfereSettleDepart_ViewMenu) { return v; - }else { + } else { var str = " " + v + " "; return str; } } -function addReturnTousseByInvoice(invoiceId){ - document.location.href = WWWROOT+'/disinfectsystem/returnGoodsRecord/returnTousseByInvoice.jsp?invoiceId='+invoiceId; +function addReturnTousseByInvoice(invoiceId) { + document.location.href = WWWROOT + '/disinfectsystem/returnGoodsRecord/returnTousseByInvoice.jsp?invoiceId=' + invoiceId; } var diposableGooodsStore = new Ext.data.SimpleStore({ - fields : [ 'typeName' ], - url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsType.do' + fields: ['typeName'], + url: WWWROOT + '/disinfectSystem/diposableGoodsAction!getDiposableGoodsType.do' }); // 发货时扫描的器械包 var tousseInstanceStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT - + '/disinfectSystem/invoiceAction!loadTousseInstaceByid.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + + '/disinfectSystem/invoiceAction!loadTousseInstaceByid.do', + method: 'POST' }), - reader : tousseInstanceStoreReader + reader: tousseInstanceStoreReader }); // 申请的物品 var invoiceStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/invoiceAction!loadRecyclingApplicationByid.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/invoiceAction!loadRecyclingApplicationByid.do', + method: 'POST' }), - reader : rd + reader: rd }); // 回收误差 var recyclingErrorStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/invoiceAction!loadRecyclingRecordByid.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/invoiceAction!loadRecyclingRecordByid.do', + method: 'POST' }), - reader : rd + reader: rd }); // 扫描抢扫器械包事件 var tempTousseInstanceJson = null; var tousseType = null; var addTousseInstance = Ext.data.Record.create([ - {name : 'id'}, - {name : 'barcode'}, - {name : 'name'}, - {name : 'showTousseName'}, - {name : 'count'}, - {name : 'diposable'}, - {name : 'price'}, - {name : 'fluctuationPrice'}, - {name : 'settleAccountsDepart'}, - {name : 'storage'}, - {name : 'batchNumber'}, - {name : 'tousseType'}, - {name : 'sterilizerName'}, - {name : 'frequency'}, - {name : 'isTracable'}, - {name : 'tousseDefinitionId'} + { name: 'id' }, + { name: 'barcode' }, + { name: 'name' }, + { name: 'showTousseName' }, + { name: 'count' }, + { name: 'diposable' }, + { name: 'price' }, + { name: 'fluctuationPrice' }, + { name: 'settleAccountsDepart' }, + { name: 'storage' }, + { name: 'batchNumber' }, + { name: 'tousseType' }, + { name: 'sterilizerName' }, + { name: 'frequency' }, + { name: 'isTracable' }, + { name: 'tousseDefinitionId' } ]); function loadTousseInstance(id, type) { @@ -332,13 +332,13 @@ return false; } Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/invoiceAction!loadTousseInstanceInfo.do', - params : { - idStr : id, - barcode : barcode, - invoiceType : invoiceType + url: WWWROOT + '/disinfectSystem/invoiceAction!loadTousseInstanceInfo.do', + params: { + idStr: id, + barcode: barcode, + invoiceType: invoiceType }, - success : function(response, options) { + success: function (response, options) { var result = Ext.decode(response.responseText); if (true) { var validatePass = result.data.validatePass; @@ -350,31 +350,31 @@ if (b) { var count = 1; var totalAmount = 0; // 总库存 - for ( var i = 0; i < result.data.storage - .split('#%').length; i++) { + for (var i = 0; i < result.data.storage + .split('#%').length; i++) { totalAmount += parseInt(result.data.storage - .split('#%')[i], 10); + .split('#%')[i], 10); } if (result.data.diposable == '是') { var index = invoiceStore.find( - "name", goodsName); + "name", goodsName); var waitDeliveryCount = invoiceStore - .getAt(index).data['count']; + .getAt(index).data['count']; var sendAmount = 0; if (waitDeliveryCount <= totalAmount) { - for ( var i = 0; i < tousseInstanceStore - .getCount(); i++) { + for (var i = 0; i < tousseInstanceStore + .getCount(); i++) { var record = tousseInstanceStore - .getAt(i); + .getAt(i); var tempGoodsName = record - .get("name"); + .get("name"); if (tempGoodsName == goodsName) { sendAmount += record - .get("count"); + .get("count"); } } if (sendAmount != 0 - || sendAmount < waitDeliveryCount) { + || sendAmount < waitDeliveryCount) { count = (waitDeliveryCount - sendAmount); } else { count = waitDeliveryCount; @@ -388,70 +388,70 @@ // 同一个批次有可能会有多个价格 var totalAddAmount = count; - for ( var i = 0; i < result.data.price - .split('#%').length; i++) { + for (var i = 0; i < result.data.price + .split('#%').length; i++) { if (count <= parseInt(result.data.storage - .split('#%')[i], 10)) { + .split('#%')[i], 10)) { var record = new addTousseInstance( - { - id : 0, - barcode : barcode, - name : result.data.name, - showTousseName : showTousseName, - count : count, - diposable : result.data.diposable, - price : result.data.price - .split('#%')[i], - fluctuationPrice : result.data.fluctuationPrice - .split('#%')[i], - storage : result.data.storage - .split('#%')[i], - batchNumber : result.data.batchNumber, - tousseType : result.data.tousseType, - sterilizerName : result.data.sterilizerName, - settleAccountsDepart : result.data.settleAccountsDepart || '', - settleAccountsDepartCoding : result.data.settleAccountsDepartCoding || '', - frequency : result.data.frequency, - isTracable : result.data.isTracable, - tousseDefinitionId : result.data.tousseDefinitionId, - externalCode : result.data.externalCode - }); + { + id: 0, + barcode: barcode, + name: result.data.name, + showTousseName: showTousseName, + count: count, + diposable: result.data.diposable, + price: result.data.price + .split('#%')[i], + fluctuationPrice: result.data.fluctuationPrice + .split('#%')[i], + storage: result.data.storage + .split('#%')[i], + batchNumber: result.data.batchNumber, + tousseType: result.data.tousseType, + sterilizerName: result.data.sterilizerName, + settleAccountsDepart: result.data.settleAccountsDepart || '', + settleAccountsDepartCoding: result.data.settleAccountsDepartCoding || '', + frequency: result.data.frequency, + isTracable: result.data.isTracable, + tousseDefinitionId: result.data.tousseDefinitionId, + externalCode: result.data.externalCode + }); tousseInstanceStore.add(record); count = 0; break; } else { var record = new addTousseInstance( - { - id : 0, - barcode : barcode, - name : result.data.name, - showTousseName : showTousseName, - count : result.data.storage - .split('#%')[i], - diposable : result.data.diposable, - price : result.data.price - .split('#%')[i], - fluctuationPrice : result.data.fluctuationPrice - .split('#%')[i], - storage : result.data.storage - .split('#%')[i], - batchNumber : result.data.batchNumber, - tousseType : result.data.tousseType, - sterilizerName : result.data.sterilizerName, - settleAccountsDepart : result.data.settleAccountsDepart || '', - settleAccountsDepartCoding : result.data.settleAccountsDepartCoding || '', - frequency : result.data.frequency, - isTracable : result.data.isTracable, - tousseDefinitionId : result.data.tousseDefinitionId, - externalCode : result.data.externalCode - }); + { + id: 0, + barcode: barcode, + name: result.data.name, + showTousseName: showTousseName, + count: result.data.storage + .split('#%')[i], + diposable: result.data.diposable, + price: result.data.price + .split('#%')[i], + fluctuationPrice: result.data.fluctuationPrice + .split('#%')[i], + storage: result.data.storage + .split('#%')[i], + batchNumber: result.data.batchNumber, + tousseType: result.data.tousseType, + sterilizerName: result.data.sterilizerName, + settleAccountsDepart: result.data.settleAccountsDepart || '', + settleAccountsDepartCoding: result.data.settleAccountsDepartCoding || '', + frequency: result.data.frequency, + isTracable: result.data.isTracable, + tousseDefinitionId: result.data.tousseDefinitionId, + externalCode: result.data.externalCode + }); tousseInstanceStore.add(record); count -= parseInt(result.data.storage - .split('#%')[i], 10); + .split('#%')[i], 10); } } updateAmount(result.data.name, totalAddAmount - - count); + - count); } else { showResult('[' + result.data.name + ']不在发货单中!'); } @@ -460,15 +460,15 @@ showResult('输入的条码无效!'); } }, - failure : function(response, options) { + failure: function (response, options) { var result = Ext.decode(response.responseText); showResult(result.data.showResult); } }); } -function refreshList(){ -// alert('refreshList') +function refreshList() { + // alert('refreshList') grid.dwrReload(); } // 验证条码是否是在发货单中存在--用于外部代理灭菌单 @@ -485,7 +485,7 @@ // 验证条码是否重复扫描 function isBarcodeRepeat(barcode) { if (barcode != null && barcode.length > 0) { - for ( var i = 0; i < tousseInstanceStore.getCount(); i++) { + for (var i = 0; i < tousseInstanceStore.getCount(); i++) { var record = tousseInstanceStore.getAt(i); var tempBarcode = record.get('barcode'); if (barcode == tempBarcode) { @@ -499,7 +499,7 @@ // 扫描的物品是否是发货单上的物品 function isInvoiceGoods(name) { if (name != null && name.length > 0) { - for ( var i = 0; i < invoiceStore.getCount(); i++) { + for (var i = 0; i < invoiceStore.getCount(); i++) { var record = invoiceStore.getAt(i); var name1 = record.get('showTousseName'); if (name == name1) { @@ -513,7 +513,7 @@ // 发货单明细累加 function updateAmount(name, amount) { if (name != null && name.length > 0) { - for ( var i = 0; i < invoiceStore.getCount(); i++) { + for (var i = 0; i < invoiceStore.getCount(); i++) { var record = invoiceStore.getAt(i); var tempName = record.get('showTousseName'); var tempAmount = record.get('tempAmount'); @@ -531,7 +531,7 @@ // 发货单明细累加 function updateAmountWithBarcode(barcode, amount) { if (barcode != null && barcode.length > 0) { - for ( var i = 0; i < invoiceStore.getCount(); i++) { + for (var i = 0; i < invoiceStore.getCount(); i++) { var record = invoiceStore.getAt(i); var tempBarcode = record.get('barcode'); if (tempBarcode == barcode) { @@ -544,7 +544,7 @@ // 发货单明细修改 function updateAmount2(name, amount) { if (name != null && name.length > 0) { - for ( var i = 0; i < invoiceStore.getCount(); i++) { + for (var i = 0; i < invoiceStore.getCount(); i++) { var record = invoiceStore.getAt(i); var tempName = record.get('name'); var tempAmount = record.get('tempAmount'); @@ -561,7 +561,7 @@ // 发货单明细累减 function updateAmount1(name, amount) { if (name != null && name.length > 0) { - for ( var i = 0; i < invoiceStore.getCount(); i++) { + for (var i = 0; i < invoiceStore.getCount(); i++) { var record = invoiceStore.getAt(i); var tempName = record.get('showTousseName'); var tempAmount = record.get('tempAmount'); @@ -578,7 +578,7 @@ // 查找对应的记录 function getRecord(store, field, value, startIndex) { - for ( var i = 0; i < store.getCount(); i++) { + for (var i = 0; i < store.getCount(); i++) { var record = store.getAt(i); if (record.get(field) == value) { return record; @@ -589,298 +589,304 @@ // 发货单窗口 function openInvoiceForm(id, type) { invoiceStore.removeAll(); - invoiceStore.on("beforeload", function(thiz, options) { + invoiceStore.on("beforeload", function (thiz, options) { thiz.baseParams["id"] = id; }); invoiceStore.load(); recyclingErrorStore.removeAll(); - recyclingErrorStore.on("beforeload", function(thiz, options) { + recyclingErrorStore.on("beforeload", function (thiz, options) { thiz.baseParams["id"] = id; }); recyclingErrorStore.load(); tousseInstanceStore.removeAll(); - tousseInstanceStore.on("beforeload", function(thiz, options) { + tousseInstanceStore.on("beforeload", function (thiz, options) { thiz.baseParams["id"] = id; }); tousseInstanceStore.load(); // 外部器械包代理灭菌申请单 - var isForeignProxyDisinfection = (type == invoicePlanTypeForeignProxy ? true: false); + var isForeignProxyDisinfection = (type == invoicePlanTypeForeignProxy ? true : false); var recyclingapplicationCm = new Ext.grid.ColumnModel([ - {header : "申请的物品",dataIndex : 'showTousseName',width : 140,menuDisabled : true}, - {header : "name",dataIndex : 'name',hidden : true,menuDisabled : true}, - {header : "申请",dataIndex : 'count',width : 35,menuDisabled : true, - editor : new Ext.form.TextField({ - allowBlank : false, - listeners : { - focus : function(thiz) { + { header: "申请的物品", dataIndex: 'showTousseName', width: 140, menuDisabled: true }, + { header: "name", dataIndex: 'name', hidden: true, menuDisabled: true }, + { + header: "申请", dataIndex: 'count', width: 35, menuDisabled: true, + editor: new Ext.form.TextField({ + allowBlank: false, + listeners: { + focus: function (thiz) { thiz.selectText(); } } }) }, - {header : '实发',id : 'tempAmount',dataIndex : 'tempAmount',width : 35,value : 0,menuDisabled : true,renderer : getDefaultAmount}, - {id : 'type',header : '类型',dataIndex : 'type',hidden:true,width : 40}, - {id : 'applicationAmount',header : "申请数量",dataIndex : 'applicationAmount',hidden : true,width : 50}, - {id : 'deleteItem',hidden:true,header : '删除',width : 30,menuDisabled : true, - renderer : function(v, p, record) { - var str = ""; + { header: '实发', id: 'tempAmount', dataIndex: 'tempAmount', width: 35, value: 0, menuDisabled: true, renderer: getDefaultAmount }, + { id: 'type', header: '类型', dataIndex: 'type', hidden: true, width: 40 }, + { id: 'applicationAmount', header: "申请数量", dataIndex: 'applicationAmount', hidden: true, width: 50 }, + { + id: 'deleteItem', hidden: true, header: '删除', width: 30, menuDisabled: true, + renderer: function (v, p, record) { + var str = ""; return str; }, - dataIndex : 'button' + dataIndex: 'button' } ]); var recyclingErrorCm = new Ext.grid.ColumnModel([ - {header : "材料名称",dataIndex : 'name',width : 200,menuDisabled : true}, - {header : "缺失数量",dataIndex : 'count',width : 60,menuDisabled : true}, - {header : '单价',id : 'price',dataIndex : 'price',width : 60,value : 0,menuDisabled : true} + { header: "材料名称", dataIndex: 'name', width: 200, menuDisabled: true }, + { header: "缺失数量", dataIndex: 'count', width: 60, menuDisabled: true }, + { header: '单价', id: 'price', dataIndex: 'price', width: 60, value: 0, menuDisabled: true } ]); - + var cm = new Ext.grid.ColumnModel([ - {id : 'id',dataIndex : 'id',hidden : true}, - {header : "条码",dataIndex : 'barcode',width : 50,menuDisabled : true, - renderer : function(v, p, record) { - if(!isUndefinedOrNullOrEmpty(record.data.expensiveDGBarcode)){ - return record.data.expensiveDGBarcode; + { id: 'id', dataIndex: 'id', hidden: true }, + { + header: "条码", dataIndex: 'barcode', width: 50, menuDisabled: true, + renderer: function (v, p, record) { + if (!isUndefinedOrNullOrEmpty(record.data.expensiveDGBarcode)) { + return record.data.expensiveDGBarcode; + } + return record.data.barcode; } - return record.data.barcode; - }}, - {header : "物品名称",dataIndex : 'showTousseName',width : 170,menuDisabled : true}, - {header : "name",dataIndex : 'name',hidden : true,menuDisabled : true}, - {header : "批次/灭菌日期",dataIndex : 'batchNumber',width : 70,menuDisabled : true}, - {header : "灭菌炉名称",dataIndex : 'sterilizerName',width : 100,menuDisabled : true,hidden : true}, - {header : "炉次",dataIndex : 'frequency',width : 50,menuDisabled : true,hidden : true}, - {id : 'diposable',header : "是否一次性材料",dataIndex : 'diposable',hidden : true,width : 50}, - {header : "单价",dataIndex : 'fluctuationPrice',width : 40,menuDisabled : false, - editor : new Ext.form.NumberField ({ - listeners : { - focus : function(thiz){ - if("自定义器械包申请单" == type){ - - var record = top.Ext.getCmp('recyclingGrid2').getSelectionModel().getSelected(); - top.Ext.MessageBox.prompt("自定义器械包价格修改提示","请输入价格",function(bu, txt){ - if(bu == "ok"){ - if(isPositiveNumeric(txt)){ - var invoiceId = top.Ext.getCmp('id').getValue(); - var customTousseBarcode = record.get('barcode'); - - Ext.Ajax.request({ - url: WWWROOT + '/disinfectSystem/invoiceAction!updateCustomToussePrice.do?id='+invoiceId+'&customTousseBarcode='+customTousseBarcode+'&newPrice='+txt, - success: function(response, options){ - showResult('价格更新成功'); - }, - failure: function(response, options) { - showResult('价格更新失败,请刷新页面再重试'); - } - }); - - record.set('price',txt); - record.set('fluctuationPrice',txt); - }else{ - showResult("请输入正确的价格"); - } - } - }); - - }else{ - top.Ext.MessageBox.alert("提示","非自定义器械包不能修改价格"); - } - } - } - }) }, - {header : "数量",dataIndex : 'count',width : 40,menuDisabled : true, - editor : new Ext.form.NumberField ({ - listeners : { - focus:function(thiz){ - if("一次性物品申请单" != type){ - top.Ext.MessageBox.alert("提示","非一次性物品不能修改数量"); - }else{ - top.Ext.MessageBox.prompt("一次性物品数量修改提示","请输入数量",function(bu, txt){ - if(bu == "ok"){ - if(isPositiveInteger(txt)){ - var record = top.Ext.getCmp('recyclingGrid2').getSelectionModel().getSelected(); - record.set('count',txt); - var id = record.data['id']; - var name = record.data['name']; - var count = record.data['count']; - var storage = record.data['storage']; - if(id==0){ - if(parseInt(count) <= parseInt(storage)){ - updateAmount2(name,count); - } else { - showResult('库存量为:' + storage + ',已超过库存量!'); - var index = invoiceStore.find("name",name); - var tempAmount = invoiceStore.getAt(index).data['tempAmount']; - record.set('count',tempAmount); - - } - } else { - var record2 = getRecord(invoiceStore, "name", name, 0); - if(record2 != null) { - var tempAmount = record2.data['tempAmount']; - if(parseInt(count) <= (parseInt(storage) + parseInt(tempAmount))){ - updateAmount2(name,count); - } else { - showResult('库存量为:' + storage + ',已超过库存量!'); - record.set('count',tempAmount); - } - } - } - }else{ - showResult("请输入正确的数量"); - } - } - }); + { header: "物品名称", dataIndex: 'showTousseName', width: 170, menuDisabled: true }, + { header: "name", dataIndex: 'name', hidden: true, menuDisabled: true }, + { header: "批次/灭菌日期", dataIndex: 'batchNumber', width: 70, menuDisabled: true }, + { header: "灭菌炉名称", dataIndex: 'sterilizerName', width: 100, menuDisabled: true, hidden: true }, + { header: "炉次", dataIndex: 'frequency', width: 50, menuDisabled: true, hidden: true }, + { id: 'diposable', header: "是否一次性材料", dataIndex: 'diposable', hidden: true, width: 50 }, + { + header: "单价", dataIndex: 'fluctuationPrice', width: 40, menuDisabled: false, + editor: new Ext.form.NumberField({ + listeners: { + focus: function (thiz) { + if ("自定义器械包申请单" == type) { + + var record = top.Ext.getCmp('recyclingGrid2').getSelectionModel().getSelected(); + top.Ext.MessageBox.prompt("自定义器械包价格修改提示", "请输入价格", function (bu, txt) { + if (bu == "ok") { + if (isPositiveNumeric(txt)) { + var invoiceId = top.Ext.getCmp('id').getValue(); + var customTousseBarcode = record.get('barcode'); + + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/invoiceAction!updateCustomToussePrice.do?id=' + invoiceId + '&customTousseBarcode=' + customTousseBarcode + '&newPrice=' + txt, + success: function (response, options) { + showResult('价格更新成功'); + }, + failure: function (response, options) { + showResult('价格更新失败,请刷新页面再重试'); + } + }); + + record.set('price', txt); + record.set('fluctuationPrice', txt); + } else { + showResult("请输入正确的价格"); + } + } + }); + + } else { + top.Ext.MessageBox.alert("提示", "非自定义器械包不能修改价格"); } } } }) }, - {header : "结算科室",dataIndex : 'settleAccountsDepart',width : 60,menuDisabled : true, hidden: !sstsConfig.enableSettleDepartIntervenesInTheSplitOfInvoiceView,renderer:renderSettleAccountsDepartFunction}, - {header : "发货类型",dataIndex : 'type',width : 60,menuDisabled : true} + { + header: "数量", dataIndex: 'count', width: 40, menuDisabled: true, + editor: new Ext.form.NumberField({ + listeners: { + focus: function (thiz) { + if ("一次性物品申请单" != type) { + top.Ext.MessageBox.alert("提示", "非一次性物品不能修改数量"); + } else { + top.Ext.MessageBox.prompt("一次性物品数量修改提示", "请输入数量", function (bu, txt) { + if (bu == "ok") { + if (isPositiveInteger(txt)) { + var record = top.Ext.getCmp('recyclingGrid2').getSelectionModel().getSelected(); + record.set('count', txt); + var id = record.data['id']; + var name = record.data['name']; + var count = record.data['count']; + var storage = record.data['storage']; + if (id == 0) { + if (parseInt(count) <= parseInt(storage)) { + updateAmount2(name, count); + } else { + showResult('库存量为:' + storage + ',已超过库存量!'); + var index = invoiceStore.find("name", name); + var tempAmount = invoiceStore.getAt(index).data['tempAmount']; + record.set('count', tempAmount); + + } + } else { + var record2 = getRecord(invoiceStore, "name", name, 0); + if (record2 != null) { + var tempAmount = record2.data['tempAmount']; + if (parseInt(count) <= (parseInt(storage) + parseInt(tempAmount))) { + updateAmount2(name, count); + } else { + showResult('库存量为:' + storage + ',已超过库存量!'); + record.set('count', tempAmount); + } + } + } + } else { + showResult("请输入正确的数量"); + } + } + }); + } + } + } + }) + }, + { header: "结算科室", dataIndex: 'settleAccountsDepart', width: 60, menuDisabled: true, hidden: !sstsConfig.enableSettleDepartIntervenesInTheSplitOfInvoiceView, renderer: renderSettleAccountsDepartFunction }, + { header: "发货类型", dataIndex: 'type', width: 60, menuDisabled: true } ]); var form = new top.Ext.FormPanel({ - id : 'recyclingApplicationForm', - frame : true, - labelSeparator : ':', - bodyStyle : 'padding:5px 5px 0px 5px', - width : 1000, - height : 620, + id: 'recyclingApplicationForm', + frame: true, + labelSeparator: ':', + bodyStyle: 'padding:5px 5px 0px 5px', + width: 1000, + height: 620, // autoHeight : true, - autoScroll : true, - labelAlign : 'right', - layout : 'form', - items : [{ - xtype : "fieldset", - title : "基础数据", - layout : 'column', - autoHeight : true, - items : [{ - layout : 'column', - columnWidth : .55, - items : [{ - xtype : 'hidden', - name : 'id', - id : 'id' - },{ - xtype : 'hidden', - name : 'tousseInstanceIds', - id : 'tousseInstanceIds' - },{ - xtype : 'hidden', - name : 'recyclingappStoreData', - id : 'recyclingappStoreData' - },{ - xtype : 'hidden', - name : 'deleteInvoicePlanItems', - id : 'deleteInvoicePlanItems' - },{ - xtype : 'hidden', - name : 'status', - id : 'status' - },{ - layout : 'form', - labelWidth : 70, - columnWidth : .5, - items : [{ - xtype : 'textfield', - fieldLabel : '流水号', - maxLength : '41', - id : 'serialNumber', - name : 'serialNumber', - readOnly : true, - anchor : '99%', - cls : 'fieldReadOnlyNoRemove' + autoScroll: true, + labelAlign: 'right', + layout: 'form', + items: [{ + xtype: "fieldset", + title: "基础数据", + layout: 'column', + autoHeight: true, + items: [{ + layout: 'column', + columnWidth: .55, + items: [{ + xtype: 'hidden', + name: 'id', + id: 'id' + }, { + xtype: 'hidden', + name: 'tousseInstanceIds', + id: 'tousseInstanceIds' + }, { + xtype: 'hidden', + name: 'recyclingappStoreData', + id: 'recyclingappStoreData' + }, { + xtype: 'hidden', + name: 'deleteInvoicePlanItems', + id: 'deleteInvoicePlanItems' + }, { + xtype: 'hidden', + name: 'status', + id: 'status' + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .5, + items: [{ + xtype: 'textfield', + fieldLabel: '流水号', + maxLength: '41', + id: 'serialNumber', + name: 'serialNumber', + readOnly: true, + anchor: '99%', + cls: 'fieldReadOnlyNoRemove' }] - },{ - layout : 'form', - labelWidth : 70, - columnWidth : .5, - items : [{ - xtype : 'textfield', - fieldLabel : '申请人', - maxLength : '41', - id : 'applicant2', - name : 'applicant', - readOnly : true, - anchor : '99%', - cls : 'fieldReadOnlyNoRemove' + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .5, + items: [{ + xtype: 'textfield', + fieldLabel: '申请人', + maxLength: '41', + id: 'applicant2', + name: 'applicant', + readOnly: true, + anchor: '99%', + cls: 'fieldReadOnlyNoRemove' }] - },{ - layout : 'form', - labelWidth : 70, - columnWidth : .5, - items : [{ - xtype : 'textfield', - fieldLabel : '申请科室', - maxLength : '100', - id : 'depart2', - name : 'depart', - readOnly : true, - anchor : '99%', - cls : 'fieldReadOnlyNoRemove' + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .5, + items: [{ + xtype: 'textfield', + fieldLabel: '申请科室', + maxLength: '100', + id: 'depart2', + name: 'depart', + readOnly: true, + anchor: '99%', + cls: 'fieldReadOnlyNoRemove' }] - },{ - layout : 'form', - labelWidth : 70, - columnWidth : .5, - items : [{ - xtype : 'textfield', - fieldLabel : '申请时间', - id : 'applicationTime2', - name : 'applicationTime', - readOnly : true, - anchor : '99%', - cls : 'fieldReadOnlyNoRemove' + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .5, + items: [{ + xtype: 'textfield', + fieldLabel: '申请时间', + id: 'applicationTime2', + name: 'applicationTime', + readOnly: true, + anchor: '99%', + cls: 'fieldReadOnlyNoRemove' }] - },{ - layout : 'form', - labelWidth : 70, - columnWidth : .5, -// hidden : true, - items : [{ - xtype : 'textfield', - fieldLabel : '责任人', - maxLength : '41', - id : 'personInCharge', - name : 'personInCharge', - readOnly : true, - allowBlank : false, - anchor : '99%', - cls : 'x-item-disabled' + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .5, + // hidden : true, + items: [{ + xtype: 'textfield', + fieldLabel: '责任人', + maxLength: '41', + id: 'personInCharge', + name: 'personInCharge', + readOnly: true, + allowBlank: false, + anchor: '99%', + cls: 'x-item-disabled' }] - - - },{ - layout : 'form', - labelWidth : 70, - columnWidth : .5, - hidden : true, - items : [{ - xtype : 'textfield', - fieldLabel : '发货员条码', - maxLength : '16', - id : 'senderBarcode', - name : 'senderBarcode', - anchor : '99%', - listeners : { - render : function(p) { - p.getEl().on('keypress',function(e) { + + + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .5, + hidden: true, + items: [{ + xtype: 'textfield', + fieldLabel: '发货员条码', + maxLength: '16', + id: 'senderBarcode', + name: 'senderBarcode', + anchor: '99%', + listeners: { + render: function (p) { + p.getEl().on('keypress', function (e) { if (e.getKey() == 13) {// 回车键 InvoiceTableManager.getUserNameByBarcode(top.Ext.getCmp('senderBarcode').getValue(), - function(userName) { + function (userName) { if (userName != null) { var resultArray = userName.split(":"); if (resultArray[0] == "success") { top.Ext.getCmp('sender').setValue(resultArray[1]); - Ext.state.Manager.getProvider().set('cookieSender',resultArray[1]); + Ext.state.Manager.getProvider().set('cookieSender', resultArray[1]); } else { showResult(resultArray[1]); top.Ext.getCmp('sender').setValue(""); @@ -893,250 +899,250 @@ } } }] - },{ - layout : 'form', - labelWidth : 70, - columnWidth : .5, - items : [{ - xtype : 'textfield', - fieldLabel : '发货员', - maxLength : '41', - id : 'sender', - name : 'sender', - readOnly : true, - allowBlank : false, - anchor : '99%', - cls : 'x-item-disabled' + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .5, + items: [{ + xtype: 'textfield', + fieldLabel: '发货员', + maxLength: '41', + id: 'sender', + name: 'sender', + readOnly: true, + allowBlank: false, + anchor: '99%', + cls: 'x-item-disabled' }] - },{ - layout : 'form', - labelWidth : 70, - columnWidth : .5, - items : [{ - xtype : 'datefieldWithMin', - fieldLabel : '发货时间', - id : 'sendTime', - name : 'sendTime', - allowBlank : 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', - format : 'Y-m-d H:i', - anchor : '99%' + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .5, + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '发货时间', + id: 'sendTime', + name: 'sendTime', + allowBlank: 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', + format: 'Y-m-d H:i', + anchor: '99%' }] - },{ - layout : 'form', - labelWidth : 70, - columnWidth : .5, - items : [{ - xtype : 'textfield', - fieldLabel : '住院号', - maxLength : '41', - id : 'hospitalNumber', - name : 'hospitalNumber', - readOnly : true, - anchor : '99%', - cls : 'x-item-disabled' + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .5, + items: [{ + xtype: 'textfield', + fieldLabel: '住院号', + maxLength: '41', + id: 'hospitalNumber', + name: 'hospitalNumber', + readOnly: true, + anchor: '99%', + cls: 'x-item-disabled' }] - },{ - layout : 'form', - columnWidth : 1, - labelWidth : 70, - items : [{ - xtype : 'textfield', - fieldLabel : '备注', - id : 'remark2', - name : 'remark', - anchor : '99.5%', - height : 40/*, + }, { + layout: 'form', + columnWidth: 1, + labelWidth: 70, + items: [{ + xtype: 'textfield', + fieldLabel: '备注', + id: 'remark2', + name: 'remark', + anchor: '99.5%', + height: 40/*, cls : 'x-item-disabled' , readOnly : true */ }] }] - },{ - layout : 'form', - hidden : (isForeignProxyDisinfection ? true: false), - columnWidth : 0.45, - items : [ + }, { + layout: 'form', + hidden: (isForeignProxyDisinfection ? true : false), + columnWidth: 0.45, + items: [ new top.Ext.grid.EditorGridPanel({ - id : 'recyclingError', - title : '丢失材料明细', - store : recyclingErrorStore, - cm : recyclingErrorCm, - enableHdMenu : false, - width : 405, - height : 135, - autoExpandColumn : 'price', - frame : false, - bodyStyle : 'border:1px solid #afd7af', - viewConfig : {forceFit : true}, - clicksToEdit : 1, - selModel : new top.Ext.grid.RowSelectionModel({ - singleSelect : false + id: 'recyclingError', + title: '丢失材料明细', + store: recyclingErrorStore, + cm: recyclingErrorCm, + enableHdMenu: false, + width: 405, + height: 135, + autoExpandColumn: 'price', + frame: false, + bodyStyle: 'border:1px solid #afd7af', + viewConfig: { forceFit: true }, + clicksToEdit: 1, + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false }) }) ] }] - },{ - layout : 'column', - items : [{ - layout : 'form', - columnWidth : 0.65, + }, { + layout: 'column', + items: [{ + layout: 'form', + columnWidth: 0.65, autoScroll: true, - items : [ + items: [ new top.Ext.grid.EditorGridPanel({ - id : 'recyclingGrid2', - store : tousseInstanceStore, - cm : cm, - width : 650, - height : 385, - autoExpandColumn : 'deleteItem', - enableHdMenu : false, - frame : false, - bodyStyle : 'border:1px solid #afd7af', - viewConfig : {forceFit : true}, - clicksToEdit : 1,// 设置点击几次才可编辑 - selModel : new top.Ext.grid.RowSelectionModel({ - singleSelect : false + id: 'recyclingGrid2', + store: tousseInstanceStore, + cm: cm, + width: 650, + height: 385, + autoExpandColumn: 'deleteItem', + enableHdMenu: false, + frame: false, + bodyStyle: 'border:1px solid #afd7af', + viewConfig: { forceFit: true }, + clicksToEdit: 1,// 设置点击几次才可编辑 + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false }) - })] - },{ - layout : 'form', - columnWidth : 0.35, - items : [ + })] + }, { + layout: 'form', + columnWidth: 0.35, + items: [ new top.Ext.grid.EditorGridPanel({ - id : 'recyclingGrid1', - title : '发货单明细', - store : invoiceStore, - cm : recyclingapplicationCm, - enableHdMenu : false, - width : 350, - height : 385, - autoExpandColumn : 'deleteItem', - frame : false, - bodyStyle : 'border:1px solid #afd7af', - viewConfig : {forceFit : true}, - clicksToEdit : 1, - selModel : new top.Ext.grid.RowSelectionModel({ - singleSelect : false - }), - listeners : { - validateedit : function(o) { - if (!isPositiveInteger(o.value)){ - return false; - } + id: 'recyclingGrid1', + title: '发货单明细', + store: invoiceStore, + cm: recyclingapplicationCm, + enableHdMenu: false, + width: 350, + height: 385, + autoExpandColumn: 'deleteItem', + frame: false, + bodyStyle: 'border:1px solid #afd7af', + viewConfig: { forceFit: true }, + clicksToEdit: 1, + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false + }), + listeners: { + validateedit: function (o) { + if (!isPositiveInteger(o.value)) { + return false; } } - })] - }] - }], - buttons : [{ - text : '保存', - handler : function() { - var settleAccountsDepartArr = []; - for ( var i = 0; i < tousseInstanceStore.getCount(); i++) { - var record = tousseInstanceStore.getAt(i); - settleAccountsDepartArr.push({ - settleAccountsDepart:record.data.settleAccountsDepart, - settleAccountsDepartCoding:record.data.settleAccountsDepartCoding, - tousseInstanceId:record.data.id, - tousseType:record.data.tousseType - }); } - //SZSDSRMYY-166:保存备注和结算科室 - Ext.Ajax.request({ - url: WWWROOT + '/disinfectSystem/invoiceAction!interfereInvoice.do', - params : { - invoiceId : id, - remark1:top.Ext.getCmp("remark2").getValue(), - settleAccountsDepartArr:JSON.stringify(settleAccountsDepartArr) - }, - success : function(response,options) { - var result = Ext.decode(response.responseText); - if(result.success){ - showResult('保存成功'); - window.close(); - grid.dwrReload(); - }else { - showResult(result.message); - } - }, - failure : function(response,options) { - showResult('保存失败'); - } - }); + })] + }] + }], + buttons: [{ + text: '保存', + handler: function () { + var settleAccountsDepartArr = []; + for (var i = 0; i < tousseInstanceStore.getCount(); i++) { + var record = tousseInstanceStore.getAt(i); + settleAccountsDepartArr.push({ + settleAccountsDepart: record.data.settleAccountsDepart, + settleAccountsDepartCoding: record.data.settleAccountsDepartCoding, + tousseInstanceId: record.data.id, + tousseType: record.data.tousseType + }); + } + //SZSDSRMYY-166:保存备注和结算科室 + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/invoiceAction!interfereInvoice.do', + params: { + invoiceId: id, + remark1: top.Ext.getCmp("remark2").getValue(), + settleAccountsDepartArr: JSON.stringify(settleAccountsDepartArr) + }, + success: function (response, options) { + var result = Ext.decode(response.responseText); + if (result.success) { + showResult('保存成功'); + window.close(); + grid.dwrReload(); + } else { + showResult(result.message); + } + }, + failure: function (response, options) { + showResult('保存失败'); } - },{ - text : '打印预览', - handler : function() { - printInvoiceLocal(1,type,id); - } - },{ - text : '打印', - handler : function() { - printInvoiceLocal(0,type,id); - } - },{ - text : '器械包退货', - handler : function() { - window.close(); - addReturnTousseByInvoice(id); - } - }, { - text : '取消', - handler : function() { - window.close(); - } - }] - }); + }); + } + }, { + text: '打印预览', + handler: function () { + printInvoiceLocal(1, type, id); + } + }, { + text: '打印', + handler: function () { + printInvoiceLocal(0, type, id); + } + }, { + text: '器械包退货', + handler: function () { + window.close(); + addReturnTousseByInvoice(id); + } + }, { + text: '取消', + handler: function () { + window.close(); + } + }] + }); var window = new top.Ext.Window({ - id : 'recyclingApplicationWin', - layout : 'fit', - title : '发货单', - width : 1000, - height : top.screen.height > 800 ? 660 : 500, - border : false, - modal : true, - plain : true, - items : [ form ] + id: 'recyclingApplicationWin', + layout: 'fit', + title: '发货单', + width: 1000, + height: top.screen.height > 800 ? 660 : 500, + border: false, + modal: true, + plain: true, + items: [form] }); window.show(); //top.Ext.getCmp('depart1').focus(false, 100); - + form.form.load({ - url : WWWROOT + '/disinfectSystem/invoiceAction!loadInvoice.do', - method : 'GET', - waitMsg : '正在加载数据,请稍候', - params : { - id : id + url: WWWROOT + '/disinfectSystem/invoiceAction!loadInvoice.do', + method: 'GET', + waitMsg: '正在加载数据,请稍候', + params: { + id: id }, - success : function(form, action) { + success: function (form, action) { top.Ext.getCmp('applicationTime2').setValue( - formatDateYear(action.result.data.applicationTime)); + formatDateYear(action.result.data.applicationTime)); var status = action.result.data.status; var applicationTime = action.result.data.applicationTime; top.Ext.getCmp('applicationTime2').setValue( - formatDateYear(applicationTime)); + formatDateYear(applicationTime)); if (status == '未发货') { top.Ext.getCmp('sendTime').setValue(new Date()); } else { top.Ext.getCmp('sendTime').setValue( - formatDateYear(action.result.data.sendTime)); + formatDateYear(action.result.data.sendTime)); } if (status == "收货签收") { top.Ext.getCmp('saveButton').disable(); } if (action.result.data.sender == null - || action.result.data.sender == "") { + || action.result.data.sender == "") { var cookieSender = Ext.state.Manager.getProvider().get( - 'cookieSender'); + 'cookieSender'); if (cookieSender) { top.Ext.getCmp('sender').setValue(cookieSender); } } }, - failure : function(form, action) { + failure: function (form, action) { } }); } @@ -1151,38 +1157,38 @@ return f_x; } -function getInvoicesInfoForPrint(){} +function getInvoicesInfoForPrint() { } function getDepartBarcodeByDepart(depart) { var departBarcode = ''; DWREngine.setAsync(false); - SupplyRoomConfigTableManager.getDepartBarcode(depart, function(result) { + SupplyRoomConfigTableManager.getDepartBarcode(depart, function (result) { if (result != null) { departBarcode = result; } }); DWREngine.setAsync(true); return departBarcode; } -function printInvoiceLocal(printType,type,id){ - var depart = top.Ext.getCmp("depart2").getValue(); - var sendTime = top.Ext.getCmp("sendTime").getRawValue().substring(0,10); - var sendFullTime = top.Ext.getCmp("sendTime").getRawValue(); - var serialNumber = top.Ext.getCmp("serialNumber").getValue(); - var sender = top.Ext.getCmp("sender").getValue(); - var remark = top.Ext.getCmp("remark2").getValue(); - var hospitalNumber = top.Ext.getCmp("hospitalNumber").getValue(); - var applicationTime2 = top.Ext.getCmp("applicationTime2").getValue(); - var applicant = top.Ext.getCmp("applicant2").getValue(); - - batchPrintInvoices(id, depart, printType,sendTime,sender,serialNumber,remark,applicationTime2,hospitalNumber,applicant,sendFullTime); +function printInvoiceLocal(printType, type, id) { + var depart = top.Ext.getCmp("depart2").getValue(); + var sendTime = top.Ext.getCmp("sendTime").getRawValue().substring(0, 10); + var sendFullTime = top.Ext.getCmp("sendTime").getRawValue(); + var serialNumber = top.Ext.getCmp("serialNumber").getValue(); + var sender = top.Ext.getCmp("sender").getValue(); + var remark = top.Ext.getCmp("remark2").getValue(); + var hospitalNumber = top.Ext.getCmp("hospitalNumber").getValue(); + var applicationTime2 = top.Ext.getCmp("applicationTime2").getValue(); + var applicant = top.Ext.getCmp("applicant2").getValue(); + batchPrintInvoices(id, depart, printType, sendTime, sender, serialNumber, remark, applicationTime2, hospitalNumber, applicant, sendFullTime); + } // 统计总价 function getTotalPrice(type) { var recyclingPrice = 0; - for ( var i = 0; i < recyclingErrorStore.getCount(); i++) { + for (var i = 0; i < recyclingErrorStore.getCount(); i++) { var record = recyclingErrorStore.getAt(i); var price = record.get('price'); var count = record.get('count'); @@ -1191,7 +1197,7 @@ } var toussePrice = 0; - for ( var i = 0; i < tousseInstanceStore.getCount(); i++) { + for (var i = 0; i < tousseInstanceStore.getCount(); i++) { var record = tousseInstanceStore.getAt(i); var price = record.get('fluctuationPrice'); var count = record.get('count'); @@ -1205,13 +1211,13 @@ function getTotalAmount(type) { var totalAmount = 0; - for ( var i = 0; i < recyclingErrorStore.getCount(); i++) { + for (var i = 0; i < recyclingErrorStore.getCount(); i++) { var record = recyclingErrorStore.getAt(i); var count = record.get('count'); totalAmount = totalAmount + count; } - for ( var i = 0; i < tousseInstanceStore.getCount(); i++) { + for (var i = 0; i < tousseInstanceStore.getCount(); i++) { var record = tousseInstanceStore.getAt(i); var count = record.get('count'); totalAmount = totalAmount + count; @@ -1223,7 +1229,7 @@ var goods = null; var map = new Map(); // group by 器械包名称 - for ( var i = 0; i < tousseInstanceStore.getCount(); i++) { + for (var i = 0; i < tousseInstanceStore.getCount(); i++) { var record = tousseInstanceStore.getAt(i); var name = record.get('name'); var count = record.get('count'); @@ -1235,8 +1241,8 @@ } } var jsonArray = []; - - for ( var i = 0; i < tousseInstanceStore.getCount(); i++) { + + for (var i = 0; i < tousseInstanceStore.getCount(); i++) { var record = tousseInstanceStore.getAt(i); var name = record.get('name'); var specification = record.get('specification'); @@ -1266,24 +1272,24 @@ var goodsBarcode = record.get('barcode'); DWREngine.setAsync(false); InvoiceTableManager.getDisinfectGoodsMaterial(goodsBarcode, - function(materialStr) { + function (materialStr) { if (materialStr.length > 0) { var materailArray = materialStr - .split("@@"); - for ( var n = 0; n < materailArray.length; n++) { + .split("@@"); + for (var n = 0; n < materailArray.length; n++) { var materialName = materailArray[n] - .split("&&")[0]; + .split("&&")[0]; var materialAmount = materailArray[n] - .split("&&")[1]; + .split("&&")[1]; var materialPrice = materailArray[n] - .split("&&")[2]; + .split("&&")[2]; var operationTime = materailArray[n] - .split("&&")[3]; + .split("&&")[3]; var validUntil = materailArray[n] - .split("&&")[4]; + .split("&&")[4]; var materialTotalPrice = Number(materialAmount) - * Number(materialPrice); - + * Number(materialPrice); + var obj = {}; obj.name = materialName; obj.specification = ""; @@ -1304,16 +1310,16 @@ obj.expireDate = expireDate; obj.certification = certification; obj.manufacturer = manufacturer; - - jsonArray.push(obj); - + + jsonArray.push(obj); + } } }); DWREngine.setAsync(true); continue; } - + var obj = {}; obj.name = printTousseName; obj.specification = specification; @@ -1332,19 +1338,19 @@ obj.expireDate = expireDate; obj.certification = certification; obj.manufacturer = manufacturer; - + jsonArray.push(obj); - + map.remove(name); } else if (diposable == "是") {// 一次性物品 var count = record.get('count'); - + var obj = {}; var position = name.indexOf("["); - if (position > 0){ + if (position > 0) { obj.name = name.substring(0, position); } - else{ + else { obj.name = name; } obj.specification = specification; @@ -1363,20 +1369,20 @@ obj.expireDate = expireDate; obj.certification = certification; obj.manufacturer = manufacturer; - + jsonArray.push(obj); - + } } - for ( var i = 0; i < recyclingErrorStore.getCount(); i++) { + for (var i = 0; i < recyclingErrorStore.getCount(); i++) { var record = recyclingErrorStore.getAt(i); var name = record.get('name'); var price = record.get('price'); var count = record.get('count'); var unit = record.get('unit'); var totalPrice = Number(price) * Number(count); - + var obj = {}; obj.name = name; obj.unit = unit; @@ -1393,9 +1399,9 @@ obj.externalCode = ""; obj.settleAccountsDepart = ""; obj.settleAccountsDepartCoding = ""; - + jsonArray.push(obj); - + } return jsonArray; } @@ -1416,7 +1422,7 @@ return false; } var ids = null; - for ( var i = 0, len = records.length; i < len; i++) { + for (var i = 0, len = records.length; i < len; i++) { var serialNumber = records[i].data['serialNumber']; var status = records[i].data['status']; @@ -1429,18 +1435,18 @@ } } if (ids != null) { - Ext.MessageBox.confirm("请确认","是否确定要删除选中的回收申领单信息?", - function(button, text) { + Ext.MessageBox.confirm("请确认", "是否确定要删除选中的回收申领单信息?", + function (button, text) { if ("yes" == button) { Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/invoiceAction!deleteInvoice.do', - params : {ids : ids}, - success : function(response,options) { - MsgTip.msg('提示', '删除成功!', true,3); + url: WWWROOT + '/disinfectSystem/invoiceAction!deleteInvoice.do', + params: { ids: ids }, + success: function (response, options) { + MsgTip.msg('提示', '删除成功!', true, 3); grid.dwrReload(); }, - failure : function(response,options) { - MsgTip.msg('提示',response.responseText,true, 3); + failure: function (response, options) { + MsgTip.msg('提示', response.responseText, true, 3); } }); } @@ -1451,118 +1457,118 @@ } } //更新打印状态 -function updatePrintStatus(ids){ - InvoiceTableManager.updatePrintStatus(ids,function(printSuccess){ - if(printSuccess){ - grid.dwrReload(); - showResult("已打印!"); - }else{ - showResult("更新打印状态失败!"); - } - }); +function updatePrintStatus(ids) { + InvoiceTableManager.updatePrintStatus(ids, function (printSuccess) { + if (printSuccess) { + grid.dwrReload(); + showResult("已打印!"); + } else { + showResult("更新打印状态失败!"); + } + }); } -function getSelectedIds(){ +function getSelectedIds() { var records = grid.getSelectionModel().getSelections(); if (records.length == 0) { showResult("请选择发货单!"); return false; } var ids = null; - for ( var i = 0, len = records.length; i < len; i++) { + for (var i = 0, len = records.length; i < len; i++) { if (ids == null) { ids = records[i].data['id']; } else { ids = ids + ',' + records[i].data['id']; } - } + } return ids; } -function mergePrintInvoices(){ - var records = grid.getSelectionModel().getSelections(); - if (records.length == 0) { - showResult("请选择要打印的发货单!"); - return; - } +function mergePrintInvoices() { + var records = grid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要打印的发货单!"); + return; + } - // 保证选的是同一部门的发货单 - var depart = records[0].data['depart']; - var sendTime = records[0].data['sendTime'].substring(0,10); - var sendFullTime = records[0].data['sendTime']; - var serialNumber = records[0].data['serialNumber']; - var sender = records[0].data['sender']; - var remark = records[0].data['remark']; - var applicant = records[0].data['applicant']; - var applicationTime = records[0].data['applicationTime']; - for ( var i = 1, len = records.length; i < len; i++){ - if(depart != records[i].data['depart']){ - showResult("请选择相同科室的发货单!"); - return; - } - } - - var ids = getSelectedIds(); -// for ( var i = 0, len = records.length; i < len; i++) { -// if (ids == null) { -// ids = records[i].data['id']; -// } else { -// ids = ids + ',' + records[i].data['id']; -// } -// } - batchPrintInvoices(ids, depart, 0,sendTime,sender,serialNumber,remark,applicationTime,null,applicant,sendFullTime); + // 保证选的是同一部门的发货单 + var depart = records[0].data['depart']; + var sendTime = records[0].data['sendTime'].substring(0, 10); + var sendFullTime = records[0].data['sendTime']; + var serialNumber = records[0].data['serialNumber']; + var sender = records[0].data['sender']; + var remark = records[0].data['remark']; + var applicant = records[0].data['applicant']; + var applicationTime = records[0].data['applicationTime']; + for (var i = 1, len = records.length; i < len; i++) { + if (depart != records[i].data['depart']) { + showResult("请选择相同科室的发货单!"); + return; + } + } + var ids = getSelectedIds(); + // for ( var i = 0, len = records.length; i < len; i++) { + // if (ids == null) { + // ids = records[i].data['id']; + // } else { + // ids = ids + ',' + records[i].data['id']; + // } + // } + batchPrintInvoices(ids, depart, 0, sendTime, sender, serialNumber, remark, applicationTime, null, applicant, sendFullTime); + } -function batchPrintInvoices(ids, depart, printType,sendTime,sender,serialNumber,remark,applicationTime,hospitalNumber,applicant,sendFullTime){ - if(ids == null) - return; - var departBarcode = getDepartBarcodeByDepart(depart); - top.Ext.MessageBox.show({ - title:'请等待', - msg:'打印中……', - width:350, - progress:true, - closable:false - }); - Ext.Ajax.timeout=300000; - Ext.Ajax.request({ - timeout: 300000, - url : WWWROOT + '/disinfectSystem/invoiceAction!mergeLoadToussePrintData.do', - params : {ids : ids}, - success : function(response){ - var result = Ext.decode(response.responseText); - result.depart = depart; - result.departBarcode = departBarcode; - result.sendTime = sendTime; - result.sendFullTime = sendFullTime; - result.sender = sender; - result.serialNumber2 = serialNumber; - result.remark2 = remark; - result.applicationTime = applicationTime; - result.applicant = applicant; - if(isUndefinedOrNullOrEmpty(result.hospitalNumber) && !isUndefinedOrNullOrEmpty(hospitalNumber)){ - result.hospitalNumber = hospitalNumber; - } - var dt = new Date(); - var printDate = dt.getFullYear() + "-" + (dt.getMonth() + 1) + "-"+dt.getDate(); - result.printDate = printDate; - invoicePrintModule.batchPrintInvoices_result(result, printType); - - if (printType == 0){ - updatePrintStatus(ids); - } - - hideMessageBox(true); - }, - failure: function(response){ - showResult("打印失败!"); - hideMessageBox(true); - } - }); +function batchPrintInvoices(ids, depart, printType, sendTime, sender, serialNumber, remark, applicationTime, hospitalNumber, applicant, sendFullTime) { + if (ids == null) + return; + var departBarcode = getDepartBarcodeByDepart(depart); + top.Ext.MessageBox.show({ + title: '请等待', + msg: '打印中……', + width: 350, + progress: true, + closable: false + }); + Ext.Ajax.timeout = 300000; + Ext.Ajax.request({ + timeout: 300000, + url: WWWROOT + '/disinfectSystem/invoiceAction!mergeLoadToussePrintData.do', + params: { ids: ids }, + success: function (response) { + var result = Ext.decode(response.responseText); + result.depart = depart; + result.departBarcode = departBarcode; + result.sendTime = sendTime; + result.sendFullTime = sendFullTime; + result.sender = sender; + result.serialNumber2 = serialNumber; + result.remark2 = remark; + result.applicationTime = applicationTime; + result.applicant = applicant; + if (isUndefinedOrNullOrEmpty(result.hospitalNumber) && !isUndefinedOrNullOrEmpty(hospitalNumber)) { + result.hospitalNumber = hospitalNumber; + } + var dt = new Date(); + var printDate = dt.getFullYear() + "-" + (dt.getMonth() + 1) + "-" + dt.getDate(); + result.printDate = printDate; + invoicePrintModule.batchPrintInvoices_result(result, printType); + + if (printType == 0) { + updatePrintStatus(ids); + } + + hideMessageBox(true); + }, + failure: function (response) { + showResult("打印失败!"); + hideMessageBox(true); + } + }); } -var loadFormData = function(grid) { +var loadFormData = function (grid) { var records = grid.getSelectionModel().getSelections(); if (records.length == 0) { showResult("请选择发货单!"); @@ -1582,7 +1588,7 @@ function validGridAmount() { // 申请的物品 var b = true; - for ( var i = 0; i < invoiceStore.getCount(); i++) { + for (var i = 0; i < invoiceStore.getCount(); i++) { var record = invoiceStore.getAt(i); var count = record.get('count'); if (/[^0-9]/g.test(count)) { @@ -1592,7 +1598,7 @@ break; } } - for ( var i = 0; i < tousseInstanceStore.getCount(); i++) { + for (var i = 0; i < tousseInstanceStore.getCount(); i++) { var record = tousseInstanceStore.getAt(i); var count = record.get('count'); if (/[^0-9]/g.test(count)) { @@ -1609,7 +1615,7 @@ function validTousseGridData() { // 申请的物品 var b = true; - for ( var i = 0; i < invoiceStore.getCount(); i++) { + for (var i = 0; i < invoiceStore.getCount(); i++) { var record = invoiceStore.getAt(i); var count = record.get('count'); var tempAmount = record.get('tempAmount'); @@ -1627,11 +1633,11 @@ } } // 验证发货物品和发货明细物品是否相同 - for ( var j = 0; j < tousseInstanceStore.getCount(); j++) { + for (var j = 0; j < tousseInstanceStore.getCount(); j++) { var goodsRecord = tousseInstanceStore.getAt(j); var goodsName = goodsRecord.get('showTousseName'); var deleted = true; - for ( var i = 0; i < invoiceStore.getCount(); i++) { + for (var i = 0; i < invoiceStore.getCount(); i++) { var record = invoiceStore.getAt(i); var showTousseName = record.get('showTousseName'); if (showTousseName == goodsName) { @@ -1652,7 +1658,7 @@ function validForeignTousseGridData() { var b = false; if (tousseInstanceStore.getCount() == invoiceStore.getCount()) { - for ( var i = 0; i < tousseInstanceStore.getCount(); i++) { + for (var i = 0; i < tousseInstanceStore.getCount(); i++) { var record = tousseInstanceStore.getAt(i); var barcode = record.get('barcode'); if (!isBarcodeRepeatForeignProxy(barcode)) { @@ -1666,15 +1672,15 @@ // 获取扫描的外部代理灭菌器械包 function getForeignTousseGridData() { var tousseIds = ""; - for ( var i = 0; i < tousseInstanceStore.getCount(); i++) { + for (var i = 0; i < tousseInstanceStore.getCount(); i++) { var record = tousseInstanceStore.getAt(i); if (tousseIds == null || tousseIds.length <= 0) { tousseIds = record.get('id') + "," + record.get('barcode') + "," - + record.get('count') + "," + record.get('name'); + + record.get('count') + "," + record.get('name'); } else { tousseIds = tousseIds + ";" + record.get('id') + "," - + record.get('barcode') + "," + record.get('count') + "," - + record.get('name'); + + record.get('barcode') + "," + record.get('count') + "," + + record.get('name'); } } top.Ext.getCmp('tousseInstanceIds').setValue(tousseIds); @@ -1685,21 +1691,21 @@ // 获取扫描的物品 function getTousseGridData() { var tousseIds = ""; - for ( var i = 0; i < tousseInstanceStore.getCount(); i++) { + for (var i = 0; i < tousseInstanceStore.getCount(); i++) { var record = tousseInstanceStore.getAt(i); if (tousseIds == null || tousseIds.length <= 0) { tousseIds = record.get('id') + "#&" + record.get('barcode') + "#&" - + record.get('count') + "#&" + record.get('diposable') - + "#&" + record.get('name') + "#&" + record.get('price') - + "#&" + record.get('batchNumber') + "#&" - + record.get('fluctuationPrice'); + + record.get('count') + "#&" + record.get('diposable') + + "#&" + record.get('name') + "#&" + record.get('price') + + "#&" + record.get('batchNumber') + "#&" + + record.get('fluctuationPrice'); } else { tousseIds = tousseIds + "#@" + record.get('id') + "#&" - + record.get('barcode') + "#&" + record.get('count') + "#&" - + record.get('diposable') + "#&" + record.get('name') - + "#&" + record.get('price') + "#&" - + record.get('batchNumber') + "#&" - + record.get('fluctuationPrice'); + + record.get('barcode') + "#&" + record.get('count') + "#&" + + record.get('diposable') + "#&" + record.get('name') + + "#&" + record.get('price') + "#&" + + record.get('batchNumber') + "#&" + + record.get('fluctuationPrice'); } } top.Ext.getCmp('tousseInstanceIds').setValue(tousseIds); @@ -1708,26 +1714,26 @@ var result = ""; function getRecyclingapplicationStoreData() { - - for ( var i = 0; i < invoiceStore.getCount(); i++) { + + for (var i = 0; i < invoiceStore.getCount(); i++) { var record = invoiceStore.getAt(i); if (result == null || result.length <= 0) { result = record.get('name') + "#&" + record.get('count') + "#&" - + record.get('diposable') + "#&" + record.get('amount') - + "#&" + record.get('applicationAmount'); + + record.get('diposable') + "#&" + record.get('amount') + + "#&" + record.get('applicationAmount'); } else { result = result + "#@" + record.get('name') + "#&" - + record.get('count') + "#&" + record.get('diposable') - + "#&" + record.get('amount') + "#&" - + record.get('applicationAmount'); + + record.get('count') + "#&" + record.get('diposable') + + "#&" + record.get('amount') + "#&" + + record.get('applicationAmount'); } } top.Ext.getCmp('recyclingappStoreData').setValue(result); } var invoiceTypeStore = new Ext.data.SimpleStore({ - fields : [ 'id', 'value' ], - data : [ [ '0', '全部' ], [ '1', '已处理的发货单' ], [ '2', '未处理的发货单' ] ] + fields: ['id', 'value'], + data: [['0', '全部'], ['1', '已处理的发货单'], ['2', '未处理的发货单']] }); /** @@ -1740,7 +1746,7 @@ function renderCallModifyFunction(v, p, record) { return "" + v - + ""; + + ""; } function formartPrice(v, p, record) { @@ -1777,64 +1783,64 @@ return false; } var updateTimeForm = new top.Ext.FormPanel({ - id : 'form', - frame : true, - labelSeparator : ':', - labelAlign : 'right', - bodyStyle : 'padding:5px 5px 0px 5px', - autoHeight : true, - autoScroll : true, - items : [ { - layout : 'column', - items : [ { - columnWidth : 0.5, - layout : 'form', - labelWidth : 60, - items : [ { - xtype : 'datefieldWithMin', - fieldLabel : '申请时间', - id : 'recyclingTime', - name : 'recyclingTime', - editable : false, - allowBlank : false, - format : 'Y-m-d H:i', - value : new Date(), - anchor : '100%' - } ] + id: 'form', + frame: true, + labelSeparator: ':', + labelAlign: 'right', + bodyStyle: 'padding:5px 5px 0px 5px', + autoHeight: true, + autoScroll: true, + items: [{ + layout: 'column', + items: [{ + columnWidth: 0.5, + layout: 'form', + labelWidth: 60, + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '申请时间', + id: 'recyclingTime', + name: 'recyclingTime', + editable: false, + allowBlank: false, + format: 'Y-m-d H:i', + value: new Date(), + anchor: '100%' + }] }, { - columnWidth : 0.5, - layout : 'form', - labelWidth : 60, - items : [ { - xtype : 'datefieldWithMin', - fieldLabel : '发货时间', - id : 'sendTime', - name : 'sendTime', - editable : false, - allowBlank : false, - format : 'Y-m-d H:i', - value : new Date(), - anchor : '100%' - } ] - } ] - } ], - buttons : [ { - id : 'saveBtn', - text : '保存', - handler : updateTime - } ] + columnWidth: 0.5, + layout: 'form', + labelWidth: 60, + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '发货时间', + id: 'sendTime', + name: 'sendTime', + editable: false, + allowBlank: false, + format: 'Y-m-d H:i', + value: new Date(), + anchor: '100%' + }] + }] + }], + buttons: [{ + id: 'saveBtn', + text: '保存', + handler: updateTime + }] }); chooseMonthWin = new top.Ext.Window({ - id : 'chooseMonthWin', - layout : 'fit', - title : '修改时间 ', - width : 450, - border : false, - modal : true, - autoHeight : true, - plain : true, - items : [ updateTimeForm ] + id: 'chooseMonthWin', + layout: 'fit', + title: '修改时间 ', + width: 450, + border: false, + modal: true, + autoHeight: true, + plain: true, + items: [updateTimeForm] }); chooseMonthWin.show(); } @@ -1848,30 +1854,30 @@ } var records = grid.getSelectionModel().getSelections(); var ids = null; - for ( var i = 0, len = records.length; i < len; i++) { + for (var i = 0, len = records.length; i < len; i++) { if (ids == null) { ids = records[i].data['id']; } else { ids = ids + ';' + records[i].data['id']; } } - top.Ext.MessageBox.confirm("请确认", "是否确定要修改选中的发货单申请、发货时间?", function(button, - text) { + top.Ext.MessageBox.confirm("请确认", "是否确定要修改选中的发货单申请、发货时间?", function (button, + text) { if ("yes" == button) { Ext.Ajax.request({ - url : WWWROOT - + '/disinfectSystem/invoiceAction!updateDateTime.do', - params : { - ids : ids, - recyclingTime : recyclingTime, - sendTime : sendTime + url: WWWROOT + + '/disinfectSystem/invoiceAction!updateDateTime.do', + params: { + ids: ids, + recyclingTime: recyclingTime, + sendTime: sendTime }, - success : function(response, options) { + success: function (response, options) { showResult("更新成功!"); grid.dwrReload(); chooseMonthWin.close(); }, - failure : function(response, options) { + failure: function (response, options) { showResult(response.responseText); } }); @@ -1890,36 +1896,36 @@ } var id = records[0].data['id']; var invoiceTime = records[0].data['sendTime']; - if(modifyInvoiceTime_tousseInstanceWindow){ + if (modifyInvoiceTime_tousseInstanceWindow) { return; } - showModifyInvoiceTimeWindow(id,invoiceTime); + showModifyInvoiceTimeWindow(id, invoiceTime); }; var invoicePrintModule; -Ext.onReady(function() { +Ext.onReady(function () { Ext.QuickTips.init(); Ext.BLANK_IMAGE_URL = WWWROOT - + '/ext/resources/images/default/s.gif'; + + '/ext/resources/images/default/s.gif'; // 记录cookies -// Ext.state.Manager.setProvider(new Ext.state.CookieProvider({ -// path : WWWROOT + '/disinfectsystem/invoice/', -// expires : new Date(new Date().getTime() + 2592000000) -// })); - diposableGooodsStore.on('load', function(){ -// Ext.getCmp('disposableGoodsType').selectAll(); + // Ext.state.Manager.setProvider(new Ext.state.CookieProvider({ + // path : WWWROOT + '/disinfectsystem/invoice/', + // expires : new Date(new Date().getTime() + 2592000000) + // })); + diposableGooodsStore.on('load', function () { + // Ext.getCmp('disposableGoodsType').selectAll(); }); diposableGooodsStore.load(); var departGroupStore = new Ext.data.SimpleStore({ - fields : ['id', 'shift','departCode' ], - url : WWWROOT + '/disinfectSystem/invoiceDepartmentAction!loadDepartGroup.do' + fields: ['id', 'shift', 'departCode'], + url: WWWROOT + '/disinfectSystem/invoiceDepartmentAction!loadDepartGroup.do' }); - departGroupStore.on('load', function(){ + departGroupStore.on('load', function () { ShiftDef = Ext.data.Record.create([ - {name: "id", type: "string"}, - {name: "shift", type: "string"}, - {name: "departCode", type: "string"} - ]); + { name: "id", type: "string" }, + { name: "shift", type: "string" }, + { name: "departCode", type: "string" } + ]); var record = new ShiftDef({ id: '', shift: "全部", @@ -1933,151 +1939,151 @@ fields: ['tousseGroupName', 'id'], url: WWWROOT + '/disinfectSystem/baseData/tousseGroupAction!getAllTousseGroup.do' }); - - + + var columns = [ - {header : "流水号",width : 100,dataIndex : 'serialNumber',renderer : renderCallModifyFunction}, - {header : "状态",width : 70,dataIndex : 'status',renderer : renderColor}, - {header : "已打印",width : 50,dataIndex : 'isPrint',renderer : renderPrintColor}, - {header : "申请科室",width : 120,dataIndex : 'depart'}, - {header : "申请时间",width : 120,dataIndex : 'applicationTime',renderer : myDateFormatByMinute}, - {header : "回收时间",width : 120,dataIndex : 'recyclingTime',renderer : myDateFormatByMinute}, - {header : "发货员",width : 70,dataIndex : 'sender'}, - {header : "拼音码",width : 100,dataIndex : 'spelling',hidden:true}, - {header : "五笔码",width : 100,dataIndex : 'wbCode',hidden:true}, - {header : "核对员",width : 70,dataIndex : 'assistantSender'}, - {header : "责任人",width : 70,dataIndex : 'personInCharge'}, - {header : "发货时间",width : 120,dataIndex : 'sendTime',renderer : myDateFormatByMinute}, - - {header : "类型",width : 110,dataIndex : 'invoicePlanType',sortable:false}, - {id : 'remark',header : "备注",width : 110,dataIndex : 'remark'}, - {header : "打印时间",width : 120,dataIndex : 'printTime',sortable:false,renderer : myDateFormatByMinute}, - - {header : "住院号",width : 70,dataIndex : 'hospitalNumber'}, - {header : "签收人",width : 70,dataIndex : 'receiptor'}, - {header : "签收时间",width : 120,dataIndex : 'receiptingTime',renderer : myDateFormatByMinute}, - {header : "结算科室",width : 100,dataIndex : 'settleAccountsDepart'}, - {header : "仓库",width : 100,dataIndex : 'warehouseName',id : 'warehouseName'}, - {header : "总价",width : 70,dataIndex : 'totalPrice',align : 'right',renderer : formartPrice} + { header: "流水号", width: 100, dataIndex: 'serialNumber', renderer: renderCallModifyFunction }, + { header: "状态", width: 70, dataIndex: 'status', renderer: renderColor }, + { header: "已打印", width: 50, dataIndex: 'isPrint', renderer: renderPrintColor }, + { header: "申请科室", width: 120, dataIndex: 'depart' }, + { header: "申请时间", width: 120, dataIndex: 'applicationTime', renderer: myDateFormatByMinute }, + { header: "回收时间", width: 120, dataIndex: 'recyclingTime', renderer: myDateFormatByMinute }, + { header: "发货员", width: 70, dataIndex: 'sender' }, + { header: "拼音码", width: 100, dataIndex: 'spelling', hidden: true }, + { header: "五笔码", width: 100, dataIndex: 'wbCode', hidden: true }, + { header: "核对员", width: 70, dataIndex: 'assistantSender' }, + { header: "责任人", width: 70, dataIndex: 'personInCharge' }, + { header: "发货时间", width: 120, dataIndex: 'sendTime', renderer: myDateFormatByMinute }, + + { header: "类型", width: 110, dataIndex: 'invoicePlanType', sortable: false }, + { id: 'remark', header: "备注", width: 110, dataIndex: 'remark' }, + { header: "打印时间", width: 120, dataIndex: 'printTime', sortable: false, renderer: myDateFormatByMinute }, + + { header: "住院号", width: 70, dataIndex: 'hospitalNumber' }, + { header: "签收人", width: 70, dataIndex: 'receiptor' }, + { header: "签收时间", width: 120, dataIndex: 'receiptingTime', renderer: myDateFormatByMinute }, + { header: "结算科室", width: 100, dataIndex: 'settleAccountsDepart' }, + { header: "仓库", width: 100, dataIndex: 'warehouseName', id: 'warehouseName' }, + { header: "总价", width: 70, dataIndex: 'totalPrice', align: 'right', renderer: formartPrice } ]; var readerDetail = [ - {name : 'id'}, - {name : 'serialNumber'}, - {name : 'depart'}, - {name : 'printTime'}, - {name : 'settleAccountsDepart'}, - {name : 'isPrint'}, - {name : 'spelling'}, - {name : 'wbCode'}, - {name : 'applicationTime'}, - {name : 'recyclingTime'}, - {name : 'sender'}, - {name : 'assistantSender'}, - {name : 'sendTime'}, - {name : 'status'}, - {name : 'totalPrice'}, - {name : 'remark'}, - {name : 'hospitalNumber'}, - {name : 'invoicePlanType'}, - {name : 'receiptor'}, - {name : 'receiptingTime'}, - {name : 'personInCharge'}, - {name : 'warehouseName'}, - {name : 'applicant'}, - {name : 'personInChargeCode'} + { name: 'id' }, + { name: 'serialNumber' }, + { name: 'depart' }, + { name: 'printTime' }, + { name: 'settleAccountsDepart' }, + { name: 'isPrint' }, + { name: 'spelling' }, + { name: 'wbCode' }, + { name: 'applicationTime' }, + { name: 'recyclingTime' }, + { name: 'sender' }, + { name: 'assistantSender' }, + { name: 'sendTime' }, + { name: 'status' }, + { name: 'totalPrice' }, + { name: 'remark' }, + { name: 'hospitalNumber' }, + { name: 'invoicePlanType' }, + { name: 'receiptor' }, + { name: 'receiptingTime' }, + { name: 'personInCharge' }, + { name: 'warehouseName' }, + { name: 'applicant' }, + { name: 'personInChargeCode' } ]; var filters = new Ext.grid.GridFilters({ - filters : [ - {type : 'string',dataIndex : 'sender'}, - {type : 'string',dataIndex : 'serialNumber'}, - {type : 'string',dataIndex : 'depart'}, - {type : 'string',dataIndex : 'settleAccountsDepart'}, - {type : 'list',dataIndex : 'status',options : [ invoiceStatusNo, invoiceStatusYes,invoiceStatusSigned ],phpMode : true}, - {type : 'list',dataIndex : 'isPrint',options : [ '是', '否' ],phpMode : true}, -// {type : 'string',dataIndex : 'isPrint'}, - {type : 'date',dataIndex : 'sendTime'}, - {type : 'date',dataIndex : 'applicationTime'}, - {type : 'string',dataIndex : 'invoicePlanType'}, - {type : 'numeric',dataIndex : 'totalPrice'}, - {type : 'string',dataIndex : 'hospitalNumber'}, - {type : 'string',dataIndex : 'remark'} + filters: [ + { type: 'string', dataIndex: 'sender' }, + { type: 'string', dataIndex: 'serialNumber' }, + { type: 'string', dataIndex: 'depart' }, + { type: 'string', dataIndex: 'settleAccountsDepart' }, + { type: 'list', dataIndex: 'status', options: [invoiceStatusNo, invoiceStatusYes, invoiceStatusSigned], phpMode: true }, + { type: 'list', dataIndex: 'isPrint', options: ['是', '否'], phpMode: true }, + // {type : 'string',dataIndex : 'isPrint'}, + { type: 'date', dataIndex: 'sendTime' }, + { type: 'date', dataIndex: 'applicationTime' }, + { type: 'string', dataIndex: 'invoicePlanType' }, + { type: 'numeric', dataIndex: 'totalPrice' }, + { type: 'string', dataIndex: 'hospitalNumber' }, + { type: 'string', dataIndex: 'remark' } ] }); //搜索的tbar createSearchTbar(); - + var tbar = [{ - text : '修改发货时间', - hidden : SSTS_Invoice_Update, - iconCls : 'btn_ext_application_go', - id : 'editTbar', - handler : function() { + text: '修改发货时间', + hidden: SSTS_Invoice_Update, + iconCls: 'btn_ext_application_go', + id: 'editTbar', + handler: function () { modifyInvoiceTime(); } }, { - text : '刷新列表', - iconCls : 'btn_ext_refresh1', - handler : function() { + text: '刷新列表', + iconCls: 'btn_ext_refresh1', + handler: function () { grid.dwrReload(); } - },{ - text : '科室分组:' - },{ - xtype : 'combo', - id : 'invoiceDepartGroup', - name : 'invoiceDepartGroup', - valueField : 'departCode', - displayField : 'shift', - allowBlank : false, - editable : false, - emptyText:'请选择科室分组', - width : 120, - store : departGroupStore, - forceSelection : true, - triggerAction : 'all', - listeners : { - select : function(combo, record, index){ + }, { + text: '科室分组:' + }, { + xtype: 'combo', + id: 'invoiceDepartGroup', + name: 'invoiceDepartGroup', + valueField: 'departCode', + displayField: 'shift', + allowBlank: false, + editable: false, + emptyText: '请选择科室分组', + width: 120, + store: departGroupStore, + forceSelection: true, + triggerAction: 'all', + listeners: { + select: function (combo, record, index) { refreshList(); } }, - anchor : '95%' - },{ - text : '物品类型:' - },{ - xtype : 'multiSelect', - id : 'tousseType', - name : 'tousseType', - valueField : 'value', - displayField : 'key', - allowBlank : true, - editable : false, - fieldLabel:'类型', - width : 150, - emptyText:'请选择物品类型', - mode:'local', - store : new Ext.data.SimpleStore({ - data:tousseTypeDataArray, - fields:['key','value'] + anchor: '95%' + }, { + text: '物品类型:' + }, { + xtype: 'multiSelect', + id: 'tousseType', + name: 'tousseType', + valueField: 'value', + displayField: 'key', + allowBlank: true, + editable: false, + fieldLabel: '类型', + width: 150, + emptyText: '请选择物品类型', + mode: 'local', + store: new Ext.data.SimpleStore({ + data: tousseTypeDataArray, + fields: ['key', 'value'] }), -// forceSelection : true, - triggerAction : 'all', - listeners : { - select : function(combo, record, index){ + // forceSelection : true, + triggerAction: 'all', + listeners: { + select: function (combo, record, index) { if (record.get('value') == '全部') { if (record.get('checked')) { combo.selectAll() } else { combo.deselectAll() } } - grid.dwrReload(); + grid.dwrReload(); } }, - anchor : '95%' - }, { + anchor: '95%' + }, { text: '器械包分组:' }, { xtype: 'combo', @@ -2102,9 +2108,9 @@ text: '器械包种类:', hidden: !sstsConfig.enableInstrumentSetTypeSetting }, { - xtype:'hidden', - id:'instrumentSetTypeIds', - name:'instrumentSetTypeIds' + xtype: 'hidden', + id: 'instrumentSetTypeIds', + name: 'instrumentSetTypeIds' }, { xtype: 'trigger', fieldLabel: "器械包种类", @@ -2118,7 +2124,7 @@ onTriggerClick: function () { var ids = Ext.getCmp('instrumentSetTypeIds').getValue(); var names = Ext.getCmp('tousseSetTypeName').getValue(); - setInstrumentSetType('instrumentSetTypeIds', 'tousseSetTypeName', ids, names,function(ids){ + setInstrumentSetType('instrumentSetTypeIds', 'tousseSetTypeName', ids, names, function (ids) { reloadConditionPara(ids, 'parm_s_instrumentSetTypeIds'); }); }, @@ -2127,7 +2133,7 @@ item.getEl().on('click', function (p) { var ids = Ext.getCmp('instrumentSetTypeIds').getValue(); var names = Ext.getCmp('tousseSetTypeName').getValue(); - setInstrumentSetType('instrumentSetTypeIds', 'tousseSetTypeName', ids, names, function(ids){ + setInstrumentSetType('instrumentSetTypeIds', 'tousseSetTypeName', ids, names, function (ids) { reloadConditionPara(ids, 'parm_s_instrumentSetTypeIds'); }); }); @@ -2136,66 +2142,66 @@ triggerClass: 'x-form-search-trigger', anchor: '95%' }, { - text : '一次性物品类型:', - hidden : !sstsConfig.invoicePlanExtractedView_showDisposableGoodsType - },{ - xtype : 'multiSelect', - id : 'disposableGoodsType', - name : 'disposableGoodsType', - hidden : !sstsConfig.invoicePlanExtractedView_showDisposableGoodsType, - valueField : 'typeName', - displayField : 'typeName', - allowBlank : true, - editable : false, - fieldLabel:'类型', - width : 150, - emptyText:'请选择物品类型', - mode:'local', - store : diposableGooodsStore, -// forceSelection : true, - triggerAction : 'all', - listeners : { - select : function(combo, record, index){ + text: '一次性物品类型:', + hidden: !sstsConfig.invoicePlanExtractedView_showDisposableGoodsType + }, { + xtype: 'multiSelect', + id: 'disposableGoodsType', + name: 'disposableGoodsType', + hidden: !sstsConfig.invoicePlanExtractedView_showDisposableGoodsType, + valueField: 'typeName', + displayField: 'typeName', + allowBlank: true, + editable: false, + fieldLabel: '类型', + width: 150, + emptyText: '请选择物品类型', + mode: 'local', + store: diposableGooodsStore, + // forceSelection : true, + triggerAction: 'all', + listeners: { + select: function (combo, record, index) { grid.dwrReload(); }, - beforeselect:function(combo, record, index){ -// var c = record.get(combo.checkField); -// if(combo.getCheckedCount() <= 1 && c){ -// return false; -// } + beforeselect: function (combo, record, index) { + // var c = record.get(combo.checkField); + // if(combo.getCheckedCount() <= 1 && c){ + // return false; + // } return true; } }, - anchor : '95%' - },{ - text : '申请单类型:', + anchor: '95%' + }, { + text: '申请单类型:', hidden: !sstsConfig.accordingToApplyTypeFilter - },{ + }, { xtype: 'multiSelect', hidden: !sstsConfig.accordingToApplyTypeFilter, - store : new Ext.data.Store({ - proxy: new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/invoicePlanAction!getAllApplyType.do?neddCustomDeliveryType=yes', - method: 'POST' - }), - reader: new Ext.data.JsonReader({ - root: 'data', - totalProperty: 'totalCount' - }, [{name: 'applyType', mapping: 'applyType'}] - ) - }), + store: new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/invoicePlanAction!getAllApplyType.do?neddCustomDeliveryType=yes', + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + root: 'data', + totalProperty: 'totalCount' + }, [{ name: 'applyType', mapping: 'applyType' }] + ) + }), fieldLabel: '请单类型', displayField: 'applyType', valueField: 'applyType', - allowBlank : true, - editable : false, - width : 150, - emptyText:'请选择申请单类型', + allowBlank: true, + editable: false, + width: 150, + emptyText: '请选择申请单类型', triggerAction: 'all', listWidth: 200, mode: 'remote', //这个要设置成false,不然多选鼠标离开之后,combo上面的值不会显示 - forceSelection : false, + forceSelection: false, listeners: { select: function (combo, record, index) { if (record.get('applyType') == '全部') { @@ -2205,139 +2211,142 @@ combo.deselectAll() } } - + var dom = document.getElementById('parm_s_applyType'); - dom.value = combo.getValue(); - grid.dwrReload(); + dom.value = combo.getValue(); + grid.dwrReload(); } } - },{ - type : 'button', - text : '打印'+entityName, - hidden : !(sstsConfig.printInvoiceVersion==2), - iconCls : 'icon_print', + }, { + type: 'button', + text: '打印' + entityName, + hidden: !(sstsConfig.printInvoiceVersion == 2), + iconCls: 'icon_print', menu: new Ext.menu.Menu({ - items: [ - {text: '批量打印' + entityName, hidden: !validateIsSupplyRoomUser,handler: function (){ - invoicePrintModule.batchPrint(); - } - }, - {text: '打印一次性物品', handler:function(){ - checkPrintStatus(function(){ - var ids = getSelectedIds(); - if (ids != null && ids != false){ - top.Ext.MessageBox.confirm("请确认", "要打印所选的发货单的一次性物品吗?", - function(btn) { - if (btn == 'yes') { - invoicePrintModule.batchPrintInvoiceWithType(ids,'一次性物品'); - } - }); - } - }); - } - },{ - text: '打印器械包', - hidden:!sstsConfig.splitTousseAndDisinfectInvoiceBtn, - handler:function(){ - checkPrintStatus(function(){ - var ids = getSelectedIds(); - if (ids != null && ids != false){ - top.Ext.MessageBox.confirm("请确认", "要打印所选的发货单的器械包吗?", - function(btn) { - if (btn == 'yes') { - invoicePrintModule.batchPrintInvoiceWithType(ids,'器械包'); - } - }); - } - }); - } - - },{ - text: '打印消毒物品', - hidden:!sstsConfig.splitTousseAndDisinfectInvoiceBtn, - handler:function(){ - checkPrintStatus(function(){ - var ids = getSelectedIds(); - if (ids != null && ids != false){ - top.Ext.MessageBox.confirm("请确认", "要打印所选的发货单的消毒物品吗?", - function(btn) { - if (btn == 'yes') { - invoicePrintModule.batchPrintInvoiceWithType(ids,'消毒物品'); - } - }); - } - }); - } - - },{ - text: '打印器械包及消毒物品', - hidden:sstsConfig.splitTousseAndDisinfectInvoiceBtn, - handler: function(){ - checkPrintStatus(function(){ - var ids = getSelectedIds(); - if (ids != null && ids != false){ - top.Ext.MessageBox.confirm("请确认", "要打印所选发货单的器械包及消毒物品吗?", - function(btn) { - if (btn == 'yes') { - invoicePrintModule.batchPrintInvoiceWithType(ids,'器械包及消毒物品'); - } - }); - } - }); - } - },{text: '打印全部物品', handler: function(){ - checkPrintStatus(function(){ - var ids = getSelectedIds(); - if (ids != null && ids != false){ - top.Ext.MessageBox.confirm("请确认", "要打印所选发货单的全部物品吗?", - function(btn) { - if (btn == 'yes') { - invoicePrintModule.batchPrintInvoiceWithType(ids,'全部'); - } - }); - } - }); - } - } - ] - }) - },{ - text : '打印', - hidden : true, // TODO:待实现 - iconCls : 'icon_print', - handler : function() { - var ids = getSelectedIds(); - if (ids != null && ids != false){ - top.Ext.MessageBox.confirm("请确认", "要打印所选的发货单吗?", - function(btn) { - if (btn == 'yes') { - var idArray = ids.split(";"); - for (var i=0;i