Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js =================================================================== diff -u -r33277 -r33464 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js (.../invoiceView.js) (revision 33277) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js (.../invoiceView.js) (revision 33464) @@ -1,53 +1,53 @@ var entityName = "发货单"; var grid; -var tousseTypeDataArray = [['全部','全部'],['一次性物品','一次性物品'],['器械包','器械包'],['敷料包','敷料包'],['消毒物品','消毒物品'],['自定义器械包','自定义器械包'],['外来器械包','外来器械包'],['外来器械拆分小包','外来器械拆分小包'],['外部代理灭菌','外部代理灭菌']]; +var tousseTypeDataArray = [['全部', '全部'], ['一次性物品', '一次性物品'], ['器械包', '器械包'], ['敷料包', '敷料包'], ['消毒物品', '消毒物品'], ['自定义器械包', '自定义器械包'], ['外来器械包', '外来器械包'], ['外来器械拆分小包', '外来器械拆分小包'], ['外部代理灭菌', '外部代理灭菌']]; //预约或者自定义下的病人信息的显示与否 var isPatient = false; var isPatientHeight = 140; 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 : 'invoicePlanSerialNumber'}, - {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: 'invoicePlanSerialNumber' }, + { name: 'storage' }, + { name: 'batchNumber' }, + { name: 'sterilizerName' }, + { name: 'frequency' }, + { name: 'externalCode' }, + { name: 'tousseType' }, + { name: 'expireDate' }, + { name: 'manufacturer' }, + { name: 'certification' }, + { name: 'type' } ] }); @@ -60,9 +60,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]); @@ -72,9 +72,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]); @@ -83,20 +83,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); @@ -108,71 +108,71 @@ 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); } } } -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 : 'invoicePlanSerialNumber'}, - {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: 'invoicePlanSerialNumber' }, + { name: 'storage' }, + { name: 'batchNumber' }, + { name: 'tousseType' }, + { name: 'sterilizerName' }, + { name: 'frequency' }, + { name: 'isTracable' }, + { name: 'tousseDefinitionId' } ]); function loadTousseInstance(id, type) { @@ -185,13 +185,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) { @@ -204,31 +204,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; @@ -242,66 +242,66 @@ // 同一个批次有可能会有多个价格 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, - 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, + 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, - 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, + 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 + ']不在发货单中!'); } @@ -310,15 +310,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(); } // 验证条码是否是在发货单中存在--用于外部代理灭菌单 @@ -335,7 +335,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) { @@ -349,7 +349,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) { @@ -363,7 +363,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'); @@ -381,7 +381,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) { @@ -394,7 +394,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'); @@ -411,7 +411,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'); @@ -428,7 +428,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; @@ -439,323 +439,329 @@ // 发货单窗口 function openInvoiceForm(id, type, invoice) { //weizhenyu - if(invoice.invoicePlanType == "自定义发货"){ + if (invoice.invoicePlanType == "自定义发货") { isPatientHeight = 140; isPatient = true; } - if(invoice.invoicePlanType == "手术预约申请单"){ + if (invoice.invoicePlanType == "手术预约申请单") { isPatient = false; isPatientHeight = 236; } - + 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 : 35,value : 0,menuDisabled : true} + { header: "材料名称", dataIndex: 'name', width: 200, menuDisabled: true }, + { header: "缺失数量", dataIndex: 'count', width: 60, menuDisabled: true }, + { header: '单价', id: 'price', dataIndex: 'price', width: 35, value: 0, menuDisabled: true } ]); - + var cm = new Ext.grid.ColumnModel([ - {id : 'id',dataIndex : 'id',hidden : true}, - {header : "条码",dataIndex : 'barcode',width : 40,menuDisabled : true, - renderer : function(v, p, record) { - if(!isUndefinedOrNullOrEmpty(record.data.expensiveDGBarcode)){ - return record.data.expensiveDGBarcode; - } - var result = ""; - if(sstsConfig.enableUrgentFunction && record.json.urgentLevel && record.json.urgentLevel.colorCode){ - var colorCode = record.json.urgentLevel.colorCode; - var colorClassName = getClassNameForColor(record.json.urgentLevel.colorCode); - if(colorCode != ""){ - result += "
"; - result += ""; + { id: 'id', dataIndex: 'id', hidden: true }, + { + header: "条码", dataIndex: 'barcode', width: 40, menuDisabled: true, + renderer: function (v, p, record) { + if (!isUndefinedOrNullOrEmpty(record.data.expensiveDGBarcode)) { + return record.data.expensiveDGBarcode; } - }else{ - result = record.data.barcode; + var result = ""; + if (sstsConfig.enableUrgentFunction && record.json.urgentLevel && record.json.urgentLevel.colorCode) { + var colorCode = record.json.urgentLevel.colorCode; + var colorClassName = getClassNameForColor(record.json.urgentLevel.colorCode); + if (colorCode != "") { + result += "
"; + result += ""; + } + } else { + result = record.data.barcode; + } + return result; } - return result; - }}, - {header : "物品名称",dataIndex : 'showTousseName',width : 80,menuDisabled : true}, - {header : "name",dataIndex : 'name',hidden : true,menuDisabled : true}, - {header : "批次/灭菌日期",dataIndex : 'batchNumber',width : 60,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 : 30,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 : 30,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: 80, menuDisabled: true }, + { header: "name", dataIndex: 'name', hidden: true, menuDisabled: true }, + { header: "批次/灭菌日期", dataIndex: 'batchNumber', width: 60, 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: 30, 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 : 'invoicePlanSerialNumber',width : 50,menuDisabled : true,sortable:false}, - {header : "发货类型",dataIndex : 'type',width : 40,menuDisabled : true} + { + header: "数量", dataIndex: 'count', width: 30, 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: 'invoicePlanSerialNumber', width: 50, menuDisabled: true, sortable: false }, + { header: "发货类型", dataIndex: 'type', width: 40, 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 : '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, -// 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(""); @@ -768,297 +774,297 @@ } } }] - },{ - 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 : '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, - 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, - hidden : isPatient, - items : [{ - xtype : 'textfield', - fieldLabel : '手术名称', - id : 'operationName', - name : 'operationName', - value : invoice.invoicePlan.operationName, - anchor : '99.5%', - height : 40, - cls : 'x-item-disabled', - readOnly : true + layout: 'form', + columnWidth: 1, + labelWidth: 70, + hidden: isPatient, + items: [{ + xtype: 'textfield', + fieldLabel: '手术名称', + id: 'operationName', + name: 'operationName', + value: invoice.invoicePlan.operationName, + anchor: '99.5%', + height: 40, + cls: 'x-item-disabled', + readOnly: true }] - + }, { - layout : 'form', - labelWidth : 70, - columnWidth : .5, - hidden : isPatient, - items : [{ - xtype : 'textfield', - fieldLabel : '病人姓名', - value : invoice.invoicePlan.patientName, - maxLength : '41', - id : 'patientName', - name : 'patientName', - readOnly : true, - anchor : '99%', - cls : 'x-item-disabled' + layout: 'form', + labelWidth: 70, + columnWidth: .5, + hidden: isPatient, + items: [{ + xtype: 'textfield', + fieldLabel: '病人姓名', + value: invoice.invoicePlan.patientName, + maxLength: '41', + id: 'patientName', + name: 'patientName', + readOnly: true, + anchor: '99%', + cls: 'x-item-disabled' }] }, { - layout : 'form', - labelWidth : 70, - columnWidth : .5, - hidden : isPatient, - items : [{ - xtype : 'textfield', - fieldLabel : '医生姓名', - value : invoice.invoicePlan.doctors, - maxLength : '41', - id : 'doctors', - name : 'doctors', - readOnly : true, - anchor : '99%', - cls : 'x-item-disabled' + layout: 'form', + labelWidth: 70, + columnWidth: .5, + hidden: isPatient, + items: [{ + xtype: 'textfield', + fieldLabel: '医生姓名', + value: invoice.invoicePlan.doctors, + maxLength: '41', + id: 'doctors', + name: 'doctors', + readOnly: true, + anchor: '99%', + cls: 'x-item-disabled' }] }, { - layout : 'form', - labelWidth : 70, - columnWidth : .5, - hidden : isPatient, - items : [{ - xtype : 'textfield', - fieldLabel : '手术间', - maxLength : '41', - id : 'operatingRoom', - name : 'operatingRoom', - value : invoice.invoicePlan.operatingRoom, - readOnly : true, - anchor : '99%', - cls : 'x-item-disabled' + layout: 'form', + labelWidth: 70, + columnWidth: .5, + hidden: isPatient, + items: [{ + xtype: 'textfield', + fieldLabel: '手术间', + maxLength: '41', + id: 'operatingRoom', + name: 'operatingRoom', + value: invoice.invoicePlan.operatingRoom, + readOnly: true, + anchor: '99%', + cls: 'x-item-disabled' }] }, { - layout : 'form', - labelWidth : 70, - columnWidth : .5, - hidden : isPatient, - items : [{ - xtype : 'textfield', - fieldLabel : '手术台次', - maxLength : '41', - id : 'consoleName', - name : 'consoleName', - value : invoice.invoicePlan.consoleName, - readOnly : true, - anchor : '99%', - cls : 'x-item-disabled' + layout: 'form', + labelWidth: 70, + columnWidth: .5, + hidden: isPatient, + items: [{ + xtype: 'textfield', + fieldLabel: '手术台次', + maxLength: '41', + id: 'consoleName', + name: 'consoleName', + value: invoice.invoicePlan.consoleName, + readOnly: true, + anchor: '99%', + cls: 'x-item-disabled' }] }, { - layout : 'form', - columnWidth : 1, - labelWidth : 70, - items : [{ - xtype : 'textarea', - fieldLabel : '备注', - id : 'remark2', - name : 'remark', - anchor : '99%', - height : 70, - cls : 'x-item-disabled', - readOnly : true + layout: 'form', + columnWidth: 1, + labelWidth: 70, + items: [{ + xtype: 'textarea', + fieldLabel: '备注', + id: 'remark2', + name: 'remark', + anchor: '99%', + height: 70, + 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 : isPatientHeight, - 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: isPatientHeight, + 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 : 620, - 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: 620, + 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() { - printInvoiceLocal(1,type,id); - } - },{ - text : '打印', - handler : function() { - printInvoiceLocal(0,type,id); - } - },{ - text : '器械包退货', - handler : function() { - window.close(); - addReturnTousseByInvoice(id); - } - }, { - text : '取消', - handler : function() { - window.close(); - } - }] - }); + } + })] + }] + }], + buttons: [{ + 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 ? 700 : 500, - border : false, - modal : true, - plain : true, - items : [ form ] + id: 'recyclingApplicationWin', + layout: 'fit', + title: '发货单', + width: 1000, + height: top.screen.height > 800 ? 700 : 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 (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) { } }); } @@ -1073,39 +1079,39 @@ 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(); +function printInvoiceLocal(printType, type, id) { + var depart = top.Ext.getCmp("depart2").getValue(); // var sendTime = top.Ext.getCmp("sendTime").getRawValue().substring(0,10); - var sendTime = top.Ext.getCmp("sendTime").getRawValue().substring(0,16); - 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); + var sendTime = top.Ext.getCmp("sendTime").getRawValue().substring(0, 16); + 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'); @@ -1114,7 +1120,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'); @@ -1128,13 +1134,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; @@ -1146,7 +1152,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'); @@ -1158,8 +1164,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'); @@ -1187,24 +1193,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 = ""; @@ -1220,20 +1226,20 @@ obj.operationTime = operationTime; obj.validUntil = validUntil; obj.externalCode = externalCode; - + 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; @@ -1247,23 +1253,23 @@ obj.sterilizerName = sterilizerName; obj.frequency = frequency; obj.externalCode = externalCode; - + 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; @@ -1277,24 +1283,24 @@ obj.sterilizerName = sterilizerName; obj.frequency = frequency; obj.externalCode = externalCode; - + 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; @@ -1309,9 +1315,9 @@ obj.sterilizerName = ""; obj.frequency = ""; obj.externalCode = ""; - + jsonArray.push(obj); - + } return jsonArray; } @@ -1332,7 +1338,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']; @@ -1345,18 +1351,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); } }); } @@ -1367,139 +1373,139 @@ } } //更新打印状态 -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 isSameRemark(){ +function isSameRemark() { var records = grid.getSelectionModel().getSelections(); var remarkTemp = records[0].data['remark']; - if(isUndefinedOrNullOrEmpty(remarkTemp)) //第一个为空也不显示备注 + if (isUndefinedOrNullOrEmpty(remarkTemp)) //第一个为空也不显示备注 return false; - for ( var i = 1, len = records.length; i < len; i++) { - if(isUndefinedOrNullOrEmpty(records[i].data['remark']))//有为空为null则不显示备注 + for (var i = 1, len = records.length; i < len; i++) { + if (isUndefinedOrNullOrEmpty(records[i].data['remark']))//有为空为null则不显示备注 return false; - if(records[i].data['remark'] != remarkTemp)//有不相同的则不显示备注 + if (records[i].data['remark'] != remarkTemp)//有不相同的则不显示备注 return false; - } + } return true; } -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 sendTime = records[0].data['sendTime'].substring(0,16); - 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; - } - } - //如果选中的发货单备注记录不相同(或者有单为空)则不显示备注 - if(!isSameRemark()) - remark = ''; - - 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 sendTime = records[0].data['sendTime'].substring(0, 16); + 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; + } + } + //如果选中的发货单备注记录不相同(或者有单为空)则不显示备注 + if (!isSameRemark()) + remark = ''; + 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=300*000; - Ext.Ajax.request({ - timeout: 300*000, - url : WWWROOT + '/disinfectSystem/invoiceAction!mergeLoadToussePrintData.do', - params : {ids : ids}, - success : function(response){ - var result = Ext.decode(response.responseText); - if(result.success == true){ - 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); - }else{ - top.Ext.MessageBox.hide(); - showResult(result.message); - } - - }, - 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 = 300 * 000; + Ext.Ajax.request({ + timeout: 300 * 000, + url: WWWROOT + '/disinfectSystem/invoiceAction!mergeLoadToussePrintData.do', + params: { ids: ids }, + success: function (response) { + var result = Ext.decode(response.responseText); + if (result.success == true) { + 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); + } else { + top.Ext.MessageBox.hide(); + showResult(result.message); + } + + }, + failure: function (response) { + showResult("打印失败!"); + hideMessageBox(true); + } + }); } -var loadFormData = function(grid) { +var loadFormData = function (grid) { var records = grid.getSelectionModel().getSelections(); if (records.length == 0) { showResult("请选择发货单!"); @@ -1519,7 +1525,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)) { @@ -1529,7 +1535,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)) { @@ -1546,7 +1552,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'); @@ -1564,11 +1570,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) { @@ -1589,7 +1595,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)) { @@ -1603,15 +1609,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); @@ -1622,21 +1628,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); @@ -1645,26 +1651,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', '未处理的发货单']] }); /** @@ -1677,87 +1683,87 @@ function renderCallModifyFunction(v, p, record) { var values = ""; - if(sstsConfig.enableUrgentFunction && record.json.urgent && record.json.urgent == "是"){ + if (sstsConfig.enableUrgentFunction && record.json.urgent && record.json.urgent == "是") { var colorCode = record.json.invoicePlan.urgentLevel.colorCode; - if(colorCode != ""){ - values ="

" + v - + "

"; + if (colorCode != "") { + values = "

" + v + + "

"; } - }else{ + } else { values = "" + v + ""; } return values; } //发货单号集合码 -function callSerialNumbersFunction(that){ +function callSerialNumbersFunction(that) { var number = that.innerText || ''; - if(number !== ''){ + if (number !== '') { showSerialNumbersWin(number); } } -function renderSerialNumbers(v, p, record){ +function renderSerialNumbers(v, p, record) { var arr = []; - if(record.get('invoiceSerialNumberSetBarcode') !== ''){ + if (record.get('invoiceSerialNumberSetBarcode') !== '') { arr = record.get('invoiceSerialNumberSetBarcode').split(','); } var values = ''; - for(var i=0;i'; - if(i < (arr.length-1)){ + for (var i = 0; i < arr.length; i++) { + values += '' + arr[i] + ''; + if (i < (arr.length - 1)) { values += ','; } } return values; } //弹出发货单集合码的窗口 -function showSerialNumbersWin(number){ +function showSerialNumbersWin(number) { var store = new top.Ext.data.Store({ - proxy : new top.Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/invoiceAction!getInvoiceSerialNumberSetBarcodeDetail.do?barcode='+number, - method : 'POST' + proxy: new top.Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/invoiceAction!getInvoiceSerialNumberSetBarcodeDetail.do?barcode=' + number, + method: 'POST' }), - reader : new Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' + reader: new Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' }, [ - {name : 'createUserID'}, - {name : 'createUserName'}, - {name : 'objectBarcodes'}, - {name : 'barcode'}, - {name : 'createDateTime'} - ] + { name: 'createUserID' }, + { name: 'createUserName' }, + { name: 'objectBarcodes' }, + { name: 'barcode' }, + { name: 'createDateTime' } + ] ) }); var cm = new top.Ext.grid.ColumnModel([ - {header : "发货单号集合码",id:"barcode",dataIndex : 'barcode',width : 100,menuDisabled : true}, - {header : "生成时间",id:"createDateTime",dataIndex : 'createDateTime',width : 130,menuDisabled : true}, - {header : "生成人",id:"createUserName",dataIndex : 'createUserName',width : 70,menuDisabled : true}, - {header : "发货单流水号",id:"objectBarcodes",dataIndex : 'objectBarcodes',width : 140,menuDisabled : true} + { header: "发货单号集合码", id: "barcode", dataIndex: 'barcode', width: 100, menuDisabled: true }, + { header: "生成时间", id: "createDateTime", dataIndex: 'createDateTime', width: 130, menuDisabled: true }, + { header: "生成人", id: "createUserName", dataIndex: 'createUserName', width: 70, menuDisabled: true }, + { header: "发货单流水号", id: "objectBarcodes", dataIndex: 'objectBarcodes', width: 140, menuDisabled: true } ]); store.load(); var grid = new top.Ext.grid.GridPanel({ - store : store, - cm : cm, - width : 350, - height : 385, + store: store, + cm: cm, + width: 350, + height: 385, stripeRows: true, viewConfig: { - forceFit:true + forceFit: true } }) var serialNumbersWin = new top.Ext.Window({ - id : 'serialNumbersWin', - layout : 'fit', - title : '发货单号集合码信息', - width : 600, - height : 300, - border : false, - modal : true, - plain : true, - items : [grid] + id: 'serialNumbersWin', + layout: 'fit', + title: '发货单号集合码信息', + width: 600, + height: 300, + border: false, + modal: true, + plain: true, + items: [grid] }); serialNumbersWin.show(); @@ -1797,64 +1803,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(); } @@ -1868,30 +1874,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); } }); @@ -1951,22 +1957,22 @@ } searchTbarWidth = tempWidth; } -function reloadTimeField(){ - var startDate = Ext.getCmp("startDate").getValue(); - var endDate = Ext.getCmp("endDate").getValue(); - if (isUndefinedOrNullOrEmpty(startDate) || isUndefinedOrNullOrEmpty(endDate)){ - Ext.Msg.alert('警告', '时间不能为空!'); - return; - } - var value1 = Date.parse(startDate); - var value2 = Date.parse(endDate); - if (value1 > value2) { - Ext.Msg.alert('警告', '开始时间不能大于结束时间!'); - return; - } - document.getElementById('parm_s_startTime').value = value1; - document.getElementById('parm_s_endTime').value = value2; - grid.dwrReload(); +function reloadTimeField() { + var startDate = Ext.getCmp("startDate").getValue(); + var endDate = Ext.getCmp("endDate").getValue(); + if (isUndefinedOrNullOrEmpty(startDate) || isUndefinedOrNullOrEmpty(endDate)) { + Ext.Msg.alert('警告', '时间不能为空!'); + return; + } + var value1 = Date.parse(startDate); + var value2 = Date.parse(endDate); + if (value1 > value2) { + Ext.Msg.alert('警告', '开始时间不能大于结束时间!'); + return; + } + document.getElementById('parm_s_startTime').value = value1; + document.getElementById('parm_s_endTime').value = value2; + grid.dwrReload(); } /** * 创建下拉选项统一方法(xtype可以是combo或者multiSelect,如果要使用multiSelect则要引入multiSelect的js和css) @@ -1976,67 +1982,67 @@ function createCombo(comboConfig) { var storeConfig = comboConfig.storeConfig; return { - xtype: comboConfig.xtype || 'combo', - id: comboConfig.id, - name: comboConfig.name, - fieldLabel: comboConfig.fieldLabel, - store: new Ext.data.Store({ - proxy: new Ext.data.HttpProxy({ - url: storeConfig.url, - method: 'POST' - }), - reader: new Ext.data.JsonReader({ - root: 'data', - totalProperty: 'totalCount' - }, storeConfig.model - ) - }), - width: comboConfig.width || 150, - mode: comboConfig.mode || 'remote', - triggerAction: 'all', - listWidth: comboConfig.listWidth || 150, - displayField: comboConfig.displayField, - valueField: comboConfig.valueField, - forceSelection: Ext.isEmpty(comboConfig.forceSelection) ? true : comboConfig.forceSelection, - value: (comboConfig.value == null ? '' : comboConfig.value), - editable: comboConfig.editable, - queryParam : comboConfig.queryParam ? comboConfig.queryParam : 'spell', - minChars : comboConfig.minChars ? comboConfig.minChars : 0, - listeners: comboConfig.listeners - }; + xtype: comboConfig.xtype || 'combo', + id: comboConfig.id, + name: comboConfig.name, + fieldLabel: comboConfig.fieldLabel, + store: new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: storeConfig.url, + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + root: 'data', + totalProperty: 'totalCount' + }, storeConfig.model + ) + }), + width: comboConfig.width || 150, + mode: comboConfig.mode || 'remote', + triggerAction: 'all', + listWidth: comboConfig.listWidth || 150, + displayField: comboConfig.displayField, + valueField: comboConfig.valueField, + forceSelection: Ext.isEmpty(comboConfig.forceSelection) ? true : comboConfig.forceSelection, + value: (comboConfig.value == null ? '' : comboConfig.value), + editable: comboConfig.editable, + queryParam: comboConfig.queryParam ? comboConfig.queryParam : 'spell', + minChars: comboConfig.minChars ? comboConfig.minChars : 0, + listeners: comboConfig.listeners + }; } /** * 创建申请科室的过滤条件. * @returns */ function createApplyDepartmentCombo() { var applyDepartmentConfig = { - url : WWWROOT + '/systemmanage/orgUnit/searchApplyDepartmentByKeyWord.do?onlyOneself=false', - model : [ - {name: 'departmentCode', mapping: 'departmentCode'}, - {name: 'departmentName', mapping: 'departmentName'} - ] - } - return createCombo({ - id: 'applyDepartment', - name: 'applyDepartment', - xtype: 'combo', - storeConfig : applyDepartmentConfig, - editable: true, - fieldLabel: '按申请科室', - displayField: 'departmentName', - valueField: 'departmentCode', - listWidth: 200, - forceSelection : true, - queryParam : 'spell', - value: '', - minChars : 0, - listeners: { - select: function (combo, record, index) { - reloadConditionPara(combo.getValue(), 'parm_s_applyDepartmentCode'); - } + url: WWWROOT + '/systemmanage/orgUnit/searchApplyDepartmentByKeyWord.do?onlyOneself=false', + model: [ + { name: 'departmentCode', mapping: 'departmentCode' }, + { name: 'departmentName', mapping: 'departmentName' } + ] + } + return createCombo({ + id: 'applyDepartment', + name: 'applyDepartment', + xtype: 'combo', + storeConfig: applyDepartmentConfig, + editable: true, + fieldLabel: '按申请科室', + displayField: 'departmentName', + valueField: 'departmentCode', + listWidth: 200, + forceSelection: true, + queryParam: 'spell', + value: '', + minChars: 0, + listeners: { + select: function (combo, record, index) { + reloadConditionPara(combo.getValue(), 'parm_s_applyDepartmentCode'); } - }); + } + }); } /** @@ -2045,26 +2051,26 @@ */ function createSettleAccountsDepartmentCombo() { var settleAccountsDepartmentConfig = { - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSettleAccountsDepartJson.do', - model : [ - {name: 'departmentCode', mapping: 'id'}, - {name: 'departmentName', mapping: 'name'} - ] + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSettleAccountsDepartJson.do', + model: [ + { name: 'departmentCode', mapping: 'id' }, + { name: 'departmentName', mapping: 'name' } + ] } return createCombo({ id: 'settleAccountsDepartment', - name: 'settleAccountsDepartment', + name: 'settleAccountsDepartment', xtype: 'combo', - storeConfig : settleAccountsDepartmentConfig, + storeConfig: settleAccountsDepartmentConfig, editable: true, fieldLabel: '按结算科室', displayField: 'departmentName', valueField: 'departmentCode', listWidth: 200, - forceSelection : true, - queryParam : 'spell', + forceSelection: true, + queryParam: 'spell', value: '', - minChars : 0, + minChars: 0, listeners: { select: function (combo, record, index) { reloadConditionPara(combo.getValue(), 'parm_s_settleAccountsDepartmentCode'); @@ -2078,26 +2084,26 @@ */ function createGoodsCombo() { var goodsConfig = { - url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!searchInsideTousseAndDiposableGoods.do', - model : [ - {name: 'id', mapping: 'id'}, - {name: 'name', mapping: 'name'}, - {name: 'type', mapping: 'type'} - ] + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!searchInsideTousseAndDiposableGoods.do', + model: [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' }, + { name: 'type', mapping: 'type' } + ] } return createCombo({ id: 'goods', name: 'goods', xtype: 'combo', - storeConfig : goodsConfig, + storeConfig: goodsConfig, editable: true, displayField: 'name', valueField: 'id', listWidth: 300, - forceSelection : true, - queryParam : 'spell', + forceSelection: true, + queryParam: 'spell', value: '', - minChars : 0, + minChars: 0, listeners: { select: function (combo, record, index) { var parm_s_goodsType = document.getElementById('parm_s_goodsType'); @@ -2115,107 +2121,107 @@ */ function createTousseTypeCombo() { var touseTypeStoreConfig = { - url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getAllTousseType.do', - model : [{name: 'tousseType', mapping: 'tousseType'}] - } - return createCombo({ - id: 'touseType', - name: 'touseType', - xtype : 'multiSelect', - fieldLabel : '按器械包类型', - valueField : 'tousseType', - displayField : 'tousseType', - storeConfig : touseTypeStoreConfig, - triggerAction : 'all', -// id : 'tousseType', -// name : 'tousseType', - allowBlank : false, - //这个要设置成false,不然多选鼠标离开之后,combo上面的值不会显示 - forceSelection : false, - readOnly:true, - listeners: { - select: function (combo, record, index) { - //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择 - if (record.get('tousseType') == '全部') { - if (record.get('checked')) { - combo.selectAll() - } else { - combo.deselectAll() - } - } - - //2、如果已经选中所有的项,则把“全部”项选中,反之把“全部”项取消选择 - var selectAll = true; - combo.store.each(function(record) { - if (record.get('tousseType') != '全部' && !record.get(this.checkField)) { - selectAll = false; - return; - } - }, combo); - - var all = combo.store.getAt(0); - if (selectAll) { - all.set(combo.checkField, true); - } else { - all.set(combo.checkField, false); - } - combo.setValue(combo.getCheckedValue()); - reloadConditionPara(combo.getValue(), 'parm_s_selectedTousseType'); - } - } - }); + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getAllTousseType.do', + model: [{ name: 'tousseType', mapping: 'tousseType' }] + } + return createCombo({ + id: 'touseType', + name: 'touseType', + xtype: 'multiSelect', + fieldLabel: '按器械包类型', + valueField: 'tousseType', + displayField: 'tousseType', + storeConfig: touseTypeStoreConfig, + triggerAction: 'all', + // id : 'tousseType', + // name : 'tousseType', + allowBlank: false, + //这个要设置成false,不然多选鼠标离开之后,combo上面的值不会显示 + forceSelection: false, + readOnly: true, + listeners: { + select: function (combo, record, index) { + //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择 + if (record.get('tousseType') == '全部') { + if (record.get('checked')) { + combo.selectAll() + } else { + combo.deselectAll() + } + } + + //2、如果已经选中所有的项,则把“全部”项选中,反之把“全部”项取消选择 + var selectAll = true; + combo.store.each(function (record) { + if (record.get('tousseType') != '全部' && !record.get(this.checkField)) { + selectAll = false; + return; + } + }, combo); + + var all = combo.store.getAt(0); + if (selectAll) { + all.set(combo.checkField, true); + } else { + all.set(combo.checkField, false); + } + combo.setValue(combo.getCheckedValue()); + reloadConditionPara(combo.getValue(), 'parm_s_selectedTousseType'); + } + } + }); } /* - 可以获取当天时间的,可以获取到当天的00:00和23:59 + 可以获取当天时间的,可以获取到当天的00:00和23:59 dateformat 日期格式 - extObj Ext对象 - fieldId 要设置时间区域的id + extObj Ext对象 + fieldId 要设置时间区域的id */ - function getServerCurTime(dateformat,extObj,fieldId){ +function getServerCurTime(dateformat, extObj, fieldId) { Ext.Ajax.request({ - url: WWWROOT + '/system/serverTimeAction!getTodayDataTime.do', - params: {dateformat: dateformat}, - success: function(response, options) { + url: WWWROOT + '/system/serverTimeAction!getTodayDataTime.do', + params: { dateformat: dateformat }, + success: function (response, options) { var result = Ext.decode(response.responseText); if (result.success) { - if(extObj && fieldId && extObj.getCmp(fieldId)){ + if (extObj && fieldId && extObj.getCmp(fieldId)) { extObj.getCmp(fieldId).setValue(result.data.startDateTime); } } else { showResult(result.message); } }, - failure : function(response, options) { + failure: function (response, options) { showResult('获取服务器时间失败!'); } }); } /* - 可以获取每月第一天的00:00和每月当天的23:59 + 可以获取每月第一天的00:00和每月当天的23:59 dateformat 日期格式 - extObj Ext对象 - fieldId 要设置时间区域的id + extObj Ext对象 + fieldId 要设置时间区域的id */ - function getServerTime2(dateformat,extObj,fieldId){ +function getServerTime2(dateformat, extObj, fieldId) { Ext.Ajax.request({ - url: WWWROOT + '/system/serverTimeAction!getDateTimeOfFirstDay.do', - params: {dateformat: dateformat}, - success: function(response, options) { + url: WWWROOT + '/system/serverTimeAction!getDateTimeOfFirstDay.do', + params: { dateformat: dateformat }, + success: function (response, options) { var result = Ext.decode(response.responseText); if (result.success) { - if(extObj && fieldId && extObj.getCmp(fieldId)){ - if(fieldId == "startDate"){ + if (extObj && fieldId && extObj.getCmp(fieldId)) { + if (fieldId == "startDate") { extObj.getCmp("startDate").setValue(result.data.startDateTime); - }else if(fieldId == "endDate"){ + } else if (fieldId == "endDate") { extObj.getCmp("endDate").setValue(result.data.endDateTime); } } } else { showResult(result.message); } }, - failure : function(response, options) { + failure: function (response, options) { showResult('获取服务器时间失败!'); } }); @@ -2225,36 +2231,36 @@ * 创建打印状态过滤的下拉选项 */ function createPrintCombo() { - var printStatus = new Ext.data.SimpleStore({ - fields: ['key', 'val'], - data: [ - ['all', '全部'], - ['是', '是'], - ['否', '否'], - ['部分打印', '部分打印'] - ] - }); + var printStatus = new Ext.data.SimpleStore({ + fields: ['key', 'val'], + data: [ + ['all', '全部'], + ['是', '是'], + ['否', '否'], + ['部分打印', '部分打印'] + ] + }); - var printCombo = { - id: 'print', - name: 'print', - xtype: 'combo', - fieldLabel: '打印筛选', - store: printStatus, - width: 80, - mode: 'local', - triggerAction: 'all', - displayField: 'val', - forceSelection: true, - editable: false, - listeners : { - select : function(combo, record, index){ - var key = record.get('key'); - reloadConditionPara(key, 'parm_s_print'); - } - } - }; - return printCombo; + var printCombo = { + id: 'print', + name: 'print', + xtype: 'combo', + fieldLabel: '打印筛选', + store: printStatus, + width: 80, + mode: 'local', + triggerAction: 'all', + displayField: 'val', + forceSelection: true, + editable: false, + listeners: { + select: function (combo, record, index) { + var key = record.get('key'); + reloadConditionPara(key, 'parm_s_print'); + } + } + }; + return printCombo; } /** @@ -2264,92 +2270,92 @@ */ function reloadConditionPara(fieldValue, domId) { var dom = document.getElementById(domId); - dom.value = fieldValue; - var applyDepartment = Ext.getCmp('applyDepartment').getRawValue(); - var settleAccountsDepartment = Ext.getCmp('settleAccountsDepartment').getRawValue(); - var goods = Ext.getCmp('goods').getRawValue(); - - if (!applyDepartment) { - var parm_s_applyDepartmentCode = document.getElementById('parm_s_applyDepartmentCode'); - parm_s_applyDepartmentCode.value = ''; - } - if (!settleAccountsDepartment) { - var parm_s_settleAccountsDepartmentCode = document.getElementById('parm_s_settleAccountsDepartmentCode'); - parm_s_settleAccountsDepartmentCode.value = ''; - } - if (!goods) { - var parm_s_goodsType = document.getElementById('parm_s_goodsType'); - var parm_s_goodsId = document.getElementById('parm_s_goodsId'); - parm_s_goodsType.value = ''; - parm_s_goodsId.value = ''; + dom.value = fieldValue; + var applyDepartment = Ext.getCmp('applyDepartment').getRawValue(); + var settleAccountsDepartment = Ext.getCmp('settleAccountsDepartment').getRawValue(); + var goods = Ext.getCmp('goods').getRawValue(); + + if (!applyDepartment) { + var parm_s_applyDepartmentCode = document.getElementById('parm_s_applyDepartmentCode'); + parm_s_applyDepartmentCode.value = ''; } - grid.dwrReload(); + if (!settleAccountsDepartment) { + var parm_s_settleAccountsDepartmentCode = document.getElementById('parm_s_settleAccountsDepartmentCode'); + parm_s_settleAccountsDepartmentCode.value = ''; + } + if (!goods) { + var parm_s_goodsType = document.getElementById('parm_s_goodsType'); + var parm_s_goodsId = document.getElementById('parm_s_goodsId'); + parm_s_goodsType.value = ''; + parm_s_goodsId.value = ''; + } + grid.dwrReload(); } //simon-add -function refresh(){ - grid.dwrReload(); +function refresh() { + grid.dwrReload(); } //simon-add -function reset(){ - document.getElementById('parm_s_invoiceType').value =''; - document.getElementById('parm_s_applyType').value =''; +function reset() { + document.getElementById('parm_s_invoiceType').value = ''; + document.getElementById('parm_s_applyType').value = ''; - document.getElementById('invoiceDepartGroup').value =''; - document.getElementById('parm_s_selectedDepartCodes').value =''; - - document.getElementById('tousseGroupName').value =''; - document.getElementById('parm_s_selectedTousseGroupID').value =''; + document.getElementById('invoiceDepartGroup').value = ''; + document.getElementById('parm_s_selectedDepartCodes').value = ''; - document.getElementById('parm_s_startTime').value =''; - document.getElementById('parm_s_endTime').value =''; + document.getElementById('tousseGroupName').value = ''; + document.getElementById('parm_s_selectedTousseGroupID').value = ''; + document.getElementById('parm_s_startTime').value = ''; + document.getElementById('parm_s_endTime').value = ''; + getServerCurTime('yyyy-MM-dd HH:mm', Ext, 'startDate') - getServerTime2('yyyy-MM-dd HH:mm' ,Ext,'endDate'); + getServerTime2('yyyy-MM-dd HH:mm', Ext, 'endDate'); - if(sstsConfig.invoicePlanExtractedView_showDisposableGoodsType){ - document.getElementById('disposableGoodsType').value =''; - document.getElementById('parm_s_disposableGoodsType').value =''; + if (sstsConfig.invoicePlanExtractedView_showDisposableGoodsType) { + document.getElementById('disposableGoodsType').value = ''; + document.getElementById('parm_s_disposableGoodsType').value = ''; } //先将所有的过滤条件恢复默认,然后再刷新 - if(!sstsConfig.notShowGoodsSearchTbar){ + if (!sstsConfig.notShowGoodsSearchTbar) { //按物品 - document.getElementById('parm_s_goodsType').value =''; - document.getElementById('parm_s_goodsId').value =''; - document.getElementById('goods').value =''; + document.getElementById('parm_s_goodsType').value = ''; + document.getElementById('parm_s_goodsId').value = ''; + document.getElementById('goods').value = ''; } - - if(!sstsConfig.notShowTousseTypeSearchTbar){ + + if (!sstsConfig.notShowTousseTypeSearchTbar) { //按器械包类型分组 document.getElementById('touseType').value = ''; document.getElementById('parm_s_selectedTousseType').value = ''; } - - if(!sstsConfig.notShowApplyDepartmentSearchTbar){ + + if (!sstsConfig.notShowApplyDepartmentSearchTbar) { //按申请科室 document.getElementById('applyDepartment').value = ''; document.getElementById('parm_s_applyDepartmentCode').value = ''; } - - if(!sstsConfig.notShowSettleAccountsDepartmentSearchTbar){ + + if (!sstsConfig.notShowSettleAccountsDepartmentSearchTbar) { //按结算科室 document.getElementById('settleAccountsDepartment').value = ''; document.getElementById('parm_s_settleAccountsDepartmentCode').value = ''; } - - if(!sstsConfig.notShowPrintSearchTbar){ + + if (!sstsConfig.notShowPrintSearchTbar) { //是否已打印 document.getElementById('print').value = ''; document.getElementById('parm_s_print').value = ''; } - if(sstsConfig.enableInvoiceSerialNumberCollectionCodeFunction){ + if (sstsConfig.enableInvoiceSerialNumberCollectionCodeFunction) { //发货单号集合码 document.getElementById('idNumber').value = ''; document.getElementById('parm_s_invoiceSerialNumberSetBarcode').value = ''; } - + grid.dwrReload(); } @@ -2359,90 +2365,90 @@ */ function createSearchTbar() { //2、按时间过滤(width=415) - var time = [{text: '开始日期:'},{ + var time = [{ text: '开始日期:' }, { //xtype: sstsConfig.timeSearchFmt ? 'datefieldWithMin' : 'datefield', xtype: 'datefieldWithMin', fieldLabel: '开始日期', name: 'startDate', //format: sstsConfig.timeSearchFmt || 'Y-m-d', - format : 'Y-m-d H:i', + format: 'Y-m-d H:i', id: 'startDate', - readOnly: false, - editable: false, - theHours : 0, - theMinutes : 0, - //width: sstsConfig.timeSearchFmt ? 120 : 90, - width: 120 - },{ text: '结束日期:'},{ + readOnly: false, + editable: false, + theHours: 0, + theMinutes: 0, + //width: sstsConfig.timeSearchFmt ? 120 : 90, + width: 120 + }, { text: '结束日期:' }, { //xtype: sstsConfig.timeSearchFmt ? 'datefieldWithMin' : 'datefield', xtype: 'datefieldWithMin', fieldLabel: '结束日期', name: 'endDate', id: 'endDate', readOnly: false, editable: false, - // format: sstsConfig.timeSearchFmt || 'Y-m-d', - format : 'Y-m-d H:i', - theHours : 23, - theMinutes : 59, - // width: sstsConfig.timeSearchFmt ? 120 : 90, - width: 120 - },{ + // format: sstsConfig.timeSearchFmt || 'Y-m-d', + format: 'Y-m-d H:i', + theHours: 23, + theMinutes: 59, + // width: sstsConfig.timeSearchFmt ? 120 : 90, + width: 120 + }, { xtype: 'button', text: '查询', iconCls: 'icon_search', - handler: reloadTimeField + handler: reloadTimeField }]; addSearchTbar(time, 415); //3、按申请科室过滤(width=230) - if(!sstsConfig.notShowApplyDepartmentSearchTbar){ + if (!sstsConfig.notShowApplyDepartmentSearchTbar) { var applyDepartmentSearchTbarArr = []; - applyDepartmentSearchTbarArr.push({text: '按申请科室:'}); + applyDepartmentSearchTbarArr.push({ text: '按申请科室:' }); applyDepartmentSearchTbarArr.push(createApplyDepartmentCombo()); addSearchTbar(applyDepartmentSearchTbarArr, 230); } //4、按结算科室过滤(width=230) - if(!sstsConfig.notShowSettleAccountsDepartmentSearchTbar){ + if (!sstsConfig.notShowSettleAccountsDepartmentSearchTbar) { var settleAccountsDepartmentSearchTbarArr = []; - settleAccountsDepartmentSearchTbarArr.push({text: '按结算科室:'}); + settleAccountsDepartmentSearchTbarArr.push({ text: '按结算科室:' }); settleAccountsDepartmentSearchTbarArr.push(createSettleAccountsDepartmentCombo()); addSearchTbar(settleAccountsDepartmentSearchTbarArr, 230); } - + //5、按物品过滤(width=200) - if(!sstsConfig.notShowGoodsSearchTbar){ + if (!sstsConfig.notShowGoodsSearchTbar) { var goodsSearchTbarArr = []; - goodsSearchTbarArr.push({text: '按物品:'}); + goodsSearchTbarArr.push({ text: '按物品:' }); goodsSearchTbarArr.push(createGoodsCombo()); addSearchTbar(goodsSearchTbarArr, 200); } //6、按物品类型(width=235) - if(!sstsConfig.notShowTousseTypeSearchTbar){ + if (!sstsConfig.notShowTousseTypeSearchTbar) { var tousseTypeSearchTbarArr = []; - tousseTypeSearchTbarArr.push({text: '按物品类型:'}); + tousseTypeSearchTbarArr.push({ text: '按物品类型:' }); tousseTypeSearchTbarArr.push({ - xtype : 'multiSelect', - id : 'touseType', - name : 'touseType', - valueField : 'value', - displayField : 'key', - allowBlank : true, - editable : false, - fieldLabel:'类型', - width : 150, - emptyText:'请选择物品类型', - mode:'local', - store : new Ext.data.SimpleStore({ - data:tousseTypeDataArray, - fields:['key','value'] + xtype: 'multiSelect', + id: 'touseType', + name: 'touseType', + 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) { //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择 if (record.get('value') == '全部') { if (record.get('checked')) { @@ -2451,7 +2457,7 @@ combo.deselectAll() } } - + combo.setValue(combo.getCheckedValue()); reloadConditionPara(combo.getValue(), 'parm_s_selectedTousseType'); } @@ -2461,25 +2467,25 @@ } //7、是否已打印(width=150) - if(!sstsConfig.notShowPrintSearchTbar){ + if (!sstsConfig.notShowPrintSearchTbar) { var printSearchTbarArr = []; - printSearchTbarArr.push({text: '是否已打印:'}); + printSearchTbarArr.push({ text: '是否已打印:' }); printSearchTbarArr.push(createPrintCombo()); addSearchTbar(printSearchTbarArr, 150); } //8、发货单号集合码(width=100) - if(sstsConfig.enableInvoiceSerialNumberCollectionCodeFunction){ + if (sstsConfig.enableInvoiceSerialNumberCollectionCodeFunction) { var invoiceSerialNumberSetBarcode = []; - invoiceSerialNumberSetBarcode.push({text: '发货单号集合码:'}); + invoiceSerialNumberSetBarcode.push({ text: '发货单号集合码:' }); invoiceSerialNumberSetBarcode.push({ - xtype : 'textfield', - id : 'idNumber', - name : 'idNumber', - width:100, - anchor : '95%', - listeners : { - specialkey : function(field, ee) { + xtype: 'textfield', + id: 'idNumber', + name: 'idNumber', + width: 100, + anchor: '95%', + listeners: { + specialkey: function (field, ee) { if (ee.getKey() == Ext.EventObject.ENTER) { var value = Ext.getCmp('idNumber').getValue(); reloadConditionPara(value, 'parm_s_invoiceSerialNumberSetBarcode'); @@ -2489,51 +2495,51 @@ }); addSearchTbar(invoiceSerialNumberSetBarcode, 100); } - + //simon-update //刷新按钮 - var refreshBtn={ + var refreshBtn = { xtype: 'button', text: '刷新', iconCls: 'btn_ext_refresh1', - handler: refresh + handler: refresh }; addSearchTbar(refreshBtn, 100); - + //重置按钮 - var resetBtn={ - xtype: 'button', - text: '重置', - iconCls: 'icon_set', - handler: reset + var resetBtn = { + xtype: 'button', + text: '重置', + iconCls: 'icon_set', + handler: reset }; addSearchTbar(resetBtn, 100); - + } 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(); }); 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: "全部", @@ -2544,8 +2550,8 @@ }); var tousseGroupStore = new Ext.data.JsonStore({ - fields : [ 'tousseGroupName','id' ], - url : WWWROOT + '/disinfectSystem/baseData/tousseGroupAction!getAllTousseGroup.do' + fields: ['tousseGroupName', 'id'], + url: WWWROOT + '/disinfectSystem/baseData/tousseGroupAction!getAllTousseGroup.do' }); var serialNumberHidden = false; @@ -2572,345 +2578,347 @@ var searchDisableIndexes = ['recyclingApplicationType']; - if(sstsConfig.hiddenColumnsOfInvoiceListView){ - if(sstsConfig.hiddenColumnsOfInvoiceListView.length > 0){ - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('流水号') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView) { + if (sstsConfig.hiddenColumnsOfInvoiceListView.length > 0) { + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('流水号') > -1) { serialNumberHidden = true; searchDisableIndexes.push('serialNumber'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('状态') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('状态') > -1) { statusHidden = true; searchDisableIndexes.push('status'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('已打印') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('已打印') > -1) { isPrintHidden = true; searchDisableIndexes.push('isPrint'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('发货单号集合码') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('发货单号集合码') > -1) { invoiceSerialNumberSetBarcodeHidden = true; } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('申请科室') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('申请科室') > -1) { departHidden = true; searchDisableIndexes.push('depart'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('发货时间') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('发货时间') > -1) { sendTimeHidden = true; searchDisableIndexes.push('sendTime'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('申请时间') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('申请时间') > -1) { applicationTimeHidden = true; searchDisableIndexes.push('applicationTime'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('回收时间') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('回收时间') > -1) { recyclingTimeHidden = true; searchDisableIndexes.push('recyclingTime'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('打印时间') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('打印时间') > -1) { printTimeHidden = true; searchDisableIndexes.push('printTime'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('发货员') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('发货员') > -1) { senderHidden = true; searchDisableIndexes.push('sender'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('核对员') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('核对员') > -1) { assistantSenderHidden = true; searchDisableIndexes.push('assistantSender'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('责任人') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('责任人') > -1) { personInChargeHidden = true; searchDisableIndexes.push('personInCharge'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('类型') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('类型') > -1) { invoicePlanTypeHidden = true; searchDisableIndexes.push('invoicePlanType'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('备注') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('备注') > -1) { remarkHidden = true; searchDisableIndexes.push('remark'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('住院号') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('住院号') > -1) { hospitalNumberHidden = true; searchDisableIndexes.push('hospitalNumber'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('签收人') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('签收人') > -1) { receiptorHidden = true; searchDisableIndexes.push('receiptor'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('签收时间') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('签收时间') > -1) { receiptingTimeHidden = true; searchDisableIndexes.push('receiptingTime'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('签收状态') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('签收状态') > -1) { signStatusHidden = true; searchDisableIndexes.push('signStatus'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('结算科室') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('结算科室') > -1) { settleAccountsDepartHidden = true; searchDisableIndexes.push('settleAccountsDepart'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('仓库') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('仓库') > -1) { warehouseNameHidden = true; searchDisableIndexes.push('warehouseName'); } - if(sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('总价') > -1){ + if (sstsConfig.hiddenColumnsOfInvoiceListView.indexOf('总价') > -1) { totalPriceHidden = true; searchDisableIndexes.push('totalPrice'); } } } - if(sstsConfig.enableInvoiceSerialNumberCollectionCodeFunction){ + if (sstsConfig.enableInvoiceSerialNumberCollectionCodeFunction) { invoiceSerialNumberSetBarcodeHidden = false; } var columns = [ - {header : "流水号",width : 100,dataIndex : 'serialNumber',renderer : renderCallModifyFunction,hidden:serialNumberHidden}, - {header : "状态",width : 70,dataIndex : 'status',renderer : renderColor,hidden:statusHidden}, - {header : "已打印",width : 50,dataIndex : 'isPrint',renderer : renderPrintColor,hidden:isPrintHidden}, - {header : "发货单号集合码",width : 140,renderer : renderSerialNumbers,hidden:invoiceSerialNumberSetBarcodeHidden}, - {header : "申请科室",width : 120,dataIndex : 'depart',hidden:departHidden}, - {header : "申请单号",width : 120,dataIndex : 'invoicePlanSerialNumber',hidden:departHidden,sortable:false,renderer : function(v, p, record){ - return record.json.invoicePlan.serialNumber; - }}, - {header : "发货时间",width : 120,dataIndex : 'sendTime',renderer : myDateFormatByMinute,hidden:sendTimeHidden}, - {header : "申请时间",width : 120,dataIndex : 'applicationTime',renderer : myDateFormatByMinute,hidden:applicationTimeHidden}, - {header : "回收时间",width : 120,dataIndex : 'recyclingTime',renderer : myDateFormatByMinute,hidden:recyclingTimeHidden}, - {header : "打印时间",width : 120,dataIndex : 'printTime',renderer : myDateFormatByMinute,hidden:printTimeHidden}, + { header: "流水号", width: 100, dataIndex: 'serialNumber', renderer: renderCallModifyFunction, hidden: serialNumberHidden }, + { header: "状态", width: 70, dataIndex: 'status', renderer: renderColor, hidden: statusHidden }, + { header: "已打印", width: 50, dataIndex: 'isPrint', renderer: renderPrintColor, hidden: isPrintHidden }, + { header: "发货单号集合码", width: 140, renderer: renderSerialNumbers, hidden: invoiceSerialNumberSetBarcodeHidden }, + { header: "申请科室", width: 120, dataIndex: 'depart', hidden: departHidden }, + { + header: "申请单号", width: 120, dataIndex: 'invoicePlanSerialNumber', hidden: departHidden, sortable: false, renderer: function (v, p, record) { + return record.json.invoicePlan.serialNumber; + } + }, + { header: "发货时间", width: 120, dataIndex: 'sendTime', renderer: myDateFormatByMinute, hidden: sendTimeHidden }, + { header: "申请时间", width: 120, dataIndex: 'applicationTime', renderer: myDateFormatByMinute, hidden: applicationTimeHidden }, + { header: "回收时间", width: 120, dataIndex: 'recyclingTime', renderer: myDateFormatByMinute, hidden: recyclingTimeHidden }, + { header: "打印时间", width: 120, dataIndex: 'printTime', renderer: myDateFormatByMinute, hidden: printTimeHidden }, - {header : "发货员",width : 70,dataIndex : 'sender',hidden:senderHidden}, - {header : "核对员",width : 70,dataIndex : 'assistantSender',hidden:assistantSenderHidden}, - {header : "责任人",width : 70,dataIndex : 'personInCharge',hidden:personInChargeHidden}, - {header : "拼音码",width : 100,dataIndex : 'spelling',hidden:true}, - {header : "五笔码",width : 100,dataIndex : 'wbCode',hidden:true}, - - {header : "类型",width : 110,dataIndex : 'invoicePlanType',sortable:false,hidden:invoicePlanTypeHidden}, - {id : 'remark',header : "备注",width : 110,dataIndex : 'remark',hidden:remarkHidden}, - - {header : "住院号",width : 70,dataIndex : 'hospitalNumber',hidden:hospitalNumberHidden}, - {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,dataIndex : 'settleAccountsDepart',hidden:settleAccountsDepartHidden}, - {header : "仓库",width : 100,dataIndex : 'warehouseName',id : 'warehouseName',hidden:warehouseNameHidden}, - {header : "总价",width : 70,dataIndex : 'totalPrice',align : 'right',renderer : formartPrice,hidden:totalPriceHidden} + { header: "发货员", width: 70, dataIndex: 'sender', hidden: senderHidden }, + { header: "核对员", width: 70, dataIndex: 'assistantSender', hidden: assistantSenderHidden }, + { header: "责任人", width: 70, dataIndex: 'personInCharge', hidden: personInChargeHidden }, + { header: "拼音码", width: 100, dataIndex: 'spelling', hidden: true }, + { header: "五笔码", width: 100, dataIndex: 'wbCode', hidden: true }, + + { header: "类型", width: 110, dataIndex: 'invoicePlanType', sortable: false, hidden: invoicePlanTypeHidden }, + { id: 'remark', header: "备注", width: 110, dataIndex: 'remark', hidden: remarkHidden }, + + { header: "住院号", width: 70, dataIndex: 'hospitalNumber', hidden: hospitalNumberHidden }, + { 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, dataIndex: 'settleAccountsDepart', hidden: settleAccountsDepartHidden }, + { header: "仓库", width: 100, dataIndex: 'warehouseName', id: 'warehouseName', hidden: warehouseNameHidden }, + { header: "总价", width: 70, dataIndex: 'totalPrice', align: 'right', renderer: formartPrice, hidden: totalPriceHidden } ]; var readerDetail = [ - {name : 'id'}, - {name : 'serialNumber'}, - {name : 'depart'}, - {name : 'printTime'}, - {name : 'settleAccountsDepart'}, - {name : 'isPrint'}, - {name : 'invoiceSerialNumberSetBarcode'}, - {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 : 'invoicePlan'}, - {name : 'receiptor'}, - {name : 'receiptingTime'}, - {name : 'signStatus'}, - {name : 'personInCharge'}, - {name : 'invoicePlanSerialNumber'}, - {name : 'warehouseName'}, - {name : 'applicant'}, - {name : 'personInChargeCode'}, - {name : 'itemArray'} //将鼠标移入时悬浮的信息内容设置到该属性里,用于显示,不再实时请求后台进行查询了 + { name: 'id' }, + { name: 'serialNumber' }, + { name: 'depart' }, + { name: 'printTime' }, + { name: 'settleAccountsDepart' }, + { name: 'isPrint' }, + { name: 'invoiceSerialNumberSetBarcode' }, + { 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: 'invoicePlan' }, + { name: 'receiptor' }, + { name: 'receiptingTime' }, + { name: 'signStatus' }, + { name: 'personInCharge' }, + { name: 'invoicePlanSerialNumber' }, + { name: 'warehouseName' }, + { name: 'applicant' }, + { name: 'personInChargeCode' }, + { name: 'itemArray' } //将鼠标移入时悬浮的信息内容设置到该属性里,用于显示,不再实时请求后台进行查询了 ]; 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'}, - {type: 'list',dataIndex:'signStatus', phpMode:true ,options:receiptingStatusArr} + 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' }, + { type: 'list', dataIndex: 'signStatus', phpMode: true, options: receiptingStatusArr } ] }); //搜索的tbar - createSearchTbar(); - + 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 () { loadFormData(grid); } }, { - text : '删除', - hidden : SSTS_Invoice_Delete, - iconCls : 'btn_ext_application_del', - hidden:true, - handler : function() { + text: '删除', + hidden: SSTS_Invoice_Delete, + iconCls: 'btn_ext_application_del', + hidden: true, + handler: function () { deleteInvoice(grid); } }, { - text : '刷新列表', - iconCls : 'btn_ext_refresh1', - handler : function() { + text: '刷新列表', + iconCls: 'btn_ext_refresh1', + handler: function () { grid.dwrReload(); } - },{ - text : '设为已打印', - hidden : !(sstsConfig.printInvoiceVersion==2), - iconCls : 'icon_print', - handler : function() { + }, { + text: '设为已打印', + hidden: !(sstsConfig.printInvoiceVersion == 2), + iconCls: 'icon_print', + handler: function () { var ids = getSelectedIds(); top.Ext.MessageBox.confirm("请确认", "要将所选发货单的状态设置为已打印吗?", - function(btn) { + function (btn) { if (btn == 'yes') { updatePrintStatus(ids); } }); } - },{ - text : '批量打印', - hidden : (sstsConfig.printInvoiceVersion==2), - iconCls : 'icon_print', - handler : function() { - mergePrintInvoices(); - } - },{ - text : '物品汇总', - hidden : !sstsConfig.enableInvoiceItemSummary, - iconCls : 'btn_ext_application_search', - handler : function() { - var records = grid.getSelectionModel().getSelections(); - if (records.length == 0) { - showResult("请选择发货单!"); - return false; - } - var ids = []; - for(var i = 0; i < records.length;++i){ - ids.push(records[i].data['id']); - } - InvoiceItemSummary.showSummaryView(ids.join(';')); - } - },{ - text : '科室分组:' - },{ - xtype : 'combo', - id : 'invoiceDepartGroup', - name : 'invoiceDepartGroup', - valueField : 'departCode', - displayField : 'shift', - allowBlank : true, - editable : false, - emptyText:'请选择科室分组', - width : 120, - store : departGroupStore, - forceSelection : true, - triggerAction : 'all', - listeners : { - select : function(combo, record, index){ + }, { + text: '批量打印', + hidden: (sstsConfig.printInvoiceVersion == 2), + iconCls: 'icon_print', + handler: function () { + mergePrintInvoices(); + } + }, { + text: '物品汇总', + hidden: !sstsConfig.enableInvoiceItemSummary, + iconCls: 'btn_ext_application_search', + handler: function () { + var records = grid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择发货单!"); + return false; + } + var ids = []; + for (var i = 0; i < records.length; ++i) { + ids.push(records[i].data['id']); + } + InvoiceItemSummary.showSummaryView(ids.join(';')); + } + }, { + text: '科室分组:' + }, { + xtype: 'combo', + id: 'invoiceDepartGroup', + name: 'invoiceDepartGroup', + valueField: 'departCode', + displayField: 'shift', + allowBlank: true, + editable: false, + emptyText: '请选择科室分组', + width: 120, + store: departGroupStore, + forceSelection: true, + triggerAction: 'all', + listeners: { + select: function (combo, record, index) { reloadConditionPara(combo.getValue(), 'parm_s_selectedDepartCodes'); } }, - anchor : '95%' - },{ - text : '器械包分组:' - },{ - xtype : 'combo', - id : 'tousseGroupName', - name : 'tousseGroupName', - valueField : 'id', - displayField : 'tousseGroupName', - allowBlank : true, - editable : false, - emptyText:'请选择器械包分组', - width : 120, - store : tousseGroupStore, - forceSelection : true, - triggerAction : 'all', - listeners : { - select : function(combo, record, index){ + anchor: '95%' + }, { + text: '器械包分组:' + }, { + xtype: 'combo', + id: 'tousseGroupName', + name: 'tousseGroupName', + valueField: 'id', + displayField: 'tousseGroupName', + allowBlank: true, + editable: false, + emptyText: '请选择器械包分组', + width: 120, + store: tousseGroupStore, + forceSelection: true, + triggerAction: 'all', + listeners: { + select: function (combo, record, index) { reloadConditionPara(combo.getValue(), 'parm_s_selectedTousseGroupID'); } }, - anchor : '95%' + 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) { reloadConditionPara(combo.getValue(), 'parm_s_disposableGoodsType'); }, - 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') == '全部') { @@ -2920,139 +2928,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