Index: ssts-web/src/main/webapp/homepage/menuconfigure.js =================================================================== diff -u -r21930 -r21932 --- ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 21930) +++ ssts-web/src/main/webapp/homepage/menuconfigure.js (.../menuconfigure.js) (revision 21932) @@ -333,7 +333,7 @@ {hidden :SSTS_ExpensiveGoods_Menu,text:"高值耗材盘盈盘亏管理",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsGodownStockTakeView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ExpensiveGoods_Menu,text:"高值耗材盘点管理",href:WWWROOT+'/disinfectsystem/stocktakerecordmanager/inventoryrecordView.jsp'+'?type=' + inventoryTypeCodeExpensiveGoods,hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ExpensiveGoods_Menu,text:"高值耗材结算管理",href:WWWROOT+'/disinfectsystem/reportforms/stocktakeView.jsp',hrefTarget:linkTarget,leaf:true}, - {hidden :SSTS_ExpensiveGoods_Menu,text:"高值耗材发票管理",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsBillView.jsp',hrefTarget:linkTarget,leaf:true}, + {hidden :SSTS_ExpensiveGoods_Menu,text:"高值耗材发票管理",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsBill/expensiveGoodsBillView.jsp',hrefTarget:linkTarget,leaf:true}, {hidden :SSTS_ExpensiveGoods_Menu,text:"高值耗材授权管理",href:WWWROOT+'/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsAuthorizationView.jsp',hrefTarget:linkTarget,leaf:true} ] },{ Fisheye: Tag 21932 refers to a dead (removed) revision in file `ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsBillView.js'. Fisheye: No comparison available. Pass `N' to diff? Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsBill/expensiveGoodsBillForm.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsBill/expensiveGoodsBillForm.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsBill/expensiveGoodsBillForm.js (revision 21932) @@ -0,0 +1,627 @@ + +/** + * 打开已保存并结算的发票单(显示结算的实例明细) + */ +function openBillRecord(id,committedStatus){ + var rd = new top.Ext.data.JsonReader({ + fields : [ + {name : 'id'}, + {name : 'expensiveGoodsId'}, + {name : 'showName'}, + {name : 'entryType'}, + {name : 'price'}, + {name : 'entryDate'}, + {name : 'expDate'}, + {name : 'model'}, + {name : 'patientName'} + ] + }); + + //发票高值耗材实例明细 + var expensiveGoodsInstanceStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsBillAction!loadBillExpensiveGoodsInstanceById.do', + method : 'POST' + }), + reader : rd, + listeners : { + beforeload:function(thiz){ +// console.log("id"); + thiz.baseParams["id"] = id; + } + } + }); + + if(id==undefined || id == "" || id < 0){ + disableShowImageButton = true; + }else{ + disableShowImageButton = false; + expensiveGoodsInstanceStore.load(); + } + var form = new top.Ext.FormPanel({ + id : 'expensiveGoodBillForm', + frame : true, + labelSeparator : ':', + bodyStyle : 'padding:5px 5px 0px 5px', + width : 1100, + height : 650, + autoScroll : true, + labelAlign : 'left', + items:[{ + layout : 'column', + items : [{ + xtype : 'hidden', + name : 'id', + id : 'id' + },{ + xtype : 'hidden', + name : 'items', + id : 'items' + },{ + xtype : 'hidden', + name : 'instanceItems', + id : 'instanceItems' + },{ + xtype : 'hidden', + name : 'originalItems', + id : 'originalItems' + },{ + xtype : 'hidden', + name : 'formParams', + id : 'formParams' + },{ + xtype : 'hidden', + name : 'originalFormParams', + id : 'originalFormParams' + },{ + xtype : 'hidden', + name : 'supplierId', + id : 'supplierId' + },{ + //id : 'serialNum', + columnWidth : .5, + layout : 'form', + labelWidth : 60, + //hidden:true, + items : [{ + xtype : 'textfield', + fieldLabel : '发票号', + maxLength : '60', + id : 'serialNumber', + name : 'serialNumber', + allowBlank : false, + readOnly : false, + anchor : '95%' + }] + }, { + columnWidth : .5, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'textfield', + fieldLabel : '录入人', + maxLength : '60', + id : 'operator', + name : 'operator', + allowBlank : false, + readOnly : true, + //cls : 'fieldReadOnlyNoRemove', + value : $Id('userName').value, + anchor : '95%' + }] + }, { + columnWidth : .5, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'datefieldWithMin', + fieldLabel : '录入时间', + id : 'time', + name : 'time', + format : 'Y-m-d H:i', +// value : new Date(), + allowBlank : false, + anchor : '95%', + listeners : { + render : function() { + setStartDate(top.Ext, 'yyyy/MM/dd HH:mm', 'time'); //(操作时间,取服务器时间 cjr) + } + } + }] + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'datefieldWithMin', + fieldLabel : '开票时间', + id : 'settledTime', + name : 'settledTime', + format : 'Y-m-d H:i', + allowBlank : false, + anchor : '95%' + }] + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'combo', + fieldLabel : '供应商', + id : 'supplier1', + name : 'supplier1', + maxLength : '100', + queryParam : 'supplierName', + minChars : 0, + valueField : 'id', + displayField : 'name', + store : authorizedExpensiveGoodsSupplierStore, + forceSelection : false, + lazyInit : false, + triggerAction : 'all', + hideTrigger : false, + typeAhead : false, + allowBlank : true, + selectOnFocus :true, + editable:true, + width : 400, + tabIndex : 10, + anchor : '95%', + listeners : { + select : function(field, r) { + top.Ext.getCmp('name1').setValue(''); + top.Ext.getCmp('price').setValue(''); + top.Ext.getCmp('amount1').setValue(''); + top.Ext.getCmp('name1').enable(); + top.Ext.getCmp('supplier1').setValue(r.data.name); + top.Ext.getCmp('supplierId').setValue(r.data.id); + authorizedExpensiveGoodsStore.baseParams.supplierId = r.data.id; + authorizedExpensiveGoodsStore.load(); + //console.log(r.data.id) + } + } + }] + + },{ + columnWidth : .5, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'textfield', + fieldLabel : '总金额', + id : 'totalPrice', + name : 'totalPrice', + readOnly:true, + cls : 'fieldReadOnlyNoRemove', + anchor : '95%' + }] + },{ + columnWidth : 1, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'textarea', + fieldLabel : '备注', + height : 40, + id : 'remark', + name : 'remark', + maxLength : 665, + allowBlank : true, + anchor : '100%' + }] + },{ + layout : 'column', + columnWidth : 1, + labelWidth : 90, + items : [{ + layout : 'form', + columnWidth : 0.8, + labelWidth : 60, + items : [{ + xtype : 'textfield', + name : 'uploadImage', + id : 'uploadImage', + fieldLabel : "上传图片", + anchor : '100%' + }] + },{ + layout : 'form', + columnWidth : 0.08, + labelWidth : 60, + items : [{ + xtype:'button', + text : '上传', + handler : function(){ + if(id == null || id == ''){ + showResultQM("请先保存后再上传图片!"); + }else{ + uploadWindowA(imageType_expensiveGoodsBill,id); + } + } + }] + },{ + layout : 'form', + columnWidth : 0.12, + labelWidth : 60, + items : [{ + xtype:'button', + text : '预览', + disabled:disableShowImageButton, + iconCls : 'btn_ext_application_search', + handler : function(){ + showUploadImageWin(id); + } + }] + }] + } + ]},{ + layout:'column', + items:[{ + layout : 'form', + columnWidth : 0.45, + items : [ + new top.Ext.grid.EditorGridPanel({ + id : 'goodBillItemGrid', + bodyStyle : 'border:1px solid #afd7af', + frame :false, + title : '发票单明细', + width :500, + height : 390, + store : new top.Ext.data.Store({ + reader : new top.Ext.data.JsonReader({ + fields : [ + {name : 'id'}, + {name : 'name'}, + {name : 'amount'}, + {name : 'price'}, + {name : 'totalPrice'}, + {name : 'supplierName'}, + {name : 'deleteButton'}, + {name : 'expensiveGoodsId'} + ] + }) + }), + cm : new top.Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), + {header : "id",dataIndex : 'id',hidden : true}, + {header : "名称",dataIndex : 'name',width : 130,menuDisabled : true}, + {header : "供应商",dataIndex : 'supplierName',width : 125,menuDisabled : true}, + {header : "单价",dataIndex : 'price',width : 60,menuDisabled : true}, + {header : "数量",dataIndex : 'amount',width : 50,menuDisabled : true +// ,editor : new top.Ext.form.TextField({ +// regex: /^\d+$/, +// regexText:'只能输入数字', +// allowBlank : false, +// listeners:{ +// change :function(field,newVal,oldVal){ +//// var grid = top.Ext.getCmp('goodBillItemGrid'); +//// setTotalMoney(grid); +// } +// } +// }) + }, + {header : "金额",width : 50,menuDisabled : true,dataIndex : 'totalPrice', renderer:renderTotalPrice}, + {header : "删除",width : 50,menuDisabled : true,dataIndex : 'deleteButton', renderer:renderDeleteButton , hidden: (committedStatus == ""?false:true)} + ]), + selModel : new top.Ext.grid.RowSelectionModel({ + singleSelect : false + }), + listeners :{ + afteredit :function(){ + var grid = top.Ext.getCmp('goodBillItemGrid'); + setTotalMoney(grid); + } + }, + //工具栏 + tbar : [{ + xtype : 'hidden', + name : 'expensiveGoodsId', + id : 'expensiveGoodsId' + },{ + text : '物品名称:' + },{ + xtype : 'combo', + id : 'name1', + name : 'name1', + queryParam : 'spell', + minChars : 0, + valueField : 'id', + displayField : 'displayName', + pageSize : 100, +// listConfig: {width: 300}, + listWidth : 250, + store : authorizedExpensiveGoodsStore, + forceSelection : true, + lazyInit : false, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + allowBlank : true, + width : 150, + tabIndex : 1, + selectOnFocus : true, + disabled:true, + listeners : { + select : function(combo, record, index) { + top.Ext.getCmp('name1').setValue(record.data.displayName); + top.Ext.getCmp('name1').selectText(); + top.Ext.getCmp('expensiveGoodsId').setValue(record.data.id); + top.Ext.getCmp('price').setValue(record.data.referencePrice); + //console.log(record.data); + } + } + },{ + text : '数量:' + },{ + xtype : 'textfield', + maxLength : '16', + id : 'amount1', + name : 'amount1', + allowBlank:true, + width : 50, + regex: /^\d+$/, + regexText:'只能输入整数', + anchor : '95%', + tabIndex : 2, + listeners : { + specialkey : function(field, e) { + if (e.getKey() == Ext.EventObject.ENTER) { + focusTo('price'); + } + } + } + },{ + text:'单价:' + },{ + xtype : 'textfield', + maxLength : '16', + id : 'price', + name : 'price', + width : 50, + tabIndex : 7, + regex: /^(([1-9]+[0-9]*.{1}[0-9]+)|([0].{1}[1-9]+[0-9]*)|([1-9][0-9]*)|([0][.][0-9]+[1-9]*))$/, + regexText:'只能输入正数', + anchor : '95%', + allowBlank:true + },{ + text : '添加', + hidden : committedStatus, + //hidden: (id == ""?false:true), + iconCls : 'btn_ext_add', + id:'addBtn', + handler : function() { + if(addExpensiveGoodsBill() == true){ + focusTo('name1'); + } + } + }] + })] + } + ,{ + layout : 'form', + columnWidth : 0.55, + items:[new top.Ext.grid.EditorGridPanel({ + id : 'expensiveGoodsInstanceGrid', + title : '高值耗材实例明细', + store : expensiveGoodsInstanceStore, + cm : new top.Ext.grid.ColumnModel([ + {header : "id",dataIndex : 'id',hidden : true}, + {header : "高值耗材定义id",dataIndex : 'expensiveGoodsId',hidden : true}, + {header : "物品",dataIndex : 'showName',width : 100,menuDisabled : true}, + {header : "型号",dataIndex : 'model',width : 50,menuDisabled : true}, + {header : "入库类型",dataIndex : 'entryType',width : 50,menuDisabled : true}, + {header : "单价",dataIndex : 'price',width : 50,menuDisabled : true}, + {header : "入库日期",dataIndex : 'entryDate',width : 80,menuDisabled : true}, + {header : "病人姓名",dataIndex : 'patientName',width : 50,menuDisabled : true} + + ]), + enableHdMenu : false, + width : 570, + 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 : '打印预览', + //hidden: (id == ""?true:false), + hidden:true, + handler : function() { + printGoodPurchasePlan(id, 1); + } + },{ + text : '打印', + hidden:true, + // hidden: (id == ""?true:false), + handler : function() { + printGoodPurchasePlan(id, 0) + } + },{ + text : '暂存', + hidden : committedStatus, + //hidden: (id == ""?false:true), + handler : function() { + if(!form.getForm().isValid()){ + showResult('请正确填写表单各值'); + return false; + } + var time = top.Ext.getCmp('time').getValue().format('Y-m-d H:i:s'); + var settledTime = top.Ext.getCmp('settledTime').getValue().format('Y-m-d H:i:s'); + var items = buildJSONStringFromStore(top.Ext.getCmp('goodBillItemGrid').getStore()); + var instanceItems = buildJSONStringFromStore(top.Ext.getCmp('expensiveGoodsInstanceGrid').getStore()); + // 设置formParams表单参数json + setFormParams(form,['id','serialNumber','supplierId','supplier1','remark','operator']); + var FormParams = top.Ext.getCmp("formParams").getValue(); + //String转为json对象 + var json = JSON.parse(FormParams); + //添加录入时间,开票时间的string类型(防止JSON.encode转换date对象格式不对) + json.time = time; + json.settledTime = settledTime; + //json对象转为String + var jsonstr = JSON.stringify(json); + //console.log(jsonstr); + //console.log(items); + top.Ext.getCmp("formParams").setValue(jsonstr); + top.Ext.getCmp("items").setValue(items); + top.Ext.getCmp("instanceItems").setValue(instanceItems); + + // items为json数组字符串,不能为null + if(items == '[]'||items.length==0){ + showResult('发票列表不能为空'); + return false; + } + form.form.submit({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsBillAction!saveExpensiveGoodsBill.do', + method : 'POST', + params:{committedStatus:false},//给定一个参数,指定其状态是未提交 + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success : function(form, action) { + showResult(action.result.message); + grid.dwrReload(); + window.close(); + }, + failure : function(form, action) { + showResult(action.result.message); + } + }); + } + },{ + text : '保存并结算', + hidden: committedStatus, + // hidden:saveButton, + handler : function() { + if(!form.getForm().isValid()){ + showResult('请正确填写表单各值'); + return false; + } + var time = top.Ext.getCmp('time').getValue().format('Y-m-d H:i:s'); + var settledTime = top.Ext.getCmp('settledTime').getValue().format('Y-m-d H:i:s'); + var items = buildJSONStringFromStore(top.Ext.getCmp('goodBillItemGrid').getStore()); + var instanceItems = buildJSONStringFromStore(top.Ext.getCmp('expensiveGoodsInstanceGrid').getStore()); +// console.log(instanceItems); + // 设置表单参数json + setFormParams(form,['id','serialNumber','supplierId','supplier1','remark','operator']); + var FormParams = top.Ext.getCmp("formParams").getValue(); + //String转为json对象 + var json = JSON.parse(FormParams); + //添加录入时间,开票时间的string类型(防止JSON.encode转换date对象格式不对) + json.time = time; + json.settledTime = settledTime; + //json对象转为String + var jsonstr = JSON.stringify(json); + //console.log(items); + top.Ext.getCmp("formParams").setValue(jsonstr); + top.Ext.getCmp("items").setValue(items); + top.Ext.getCmp("instanceItems").setValue(instanceItems); +// console.log(items); + // items为json数组字符串,不会为null + if(items == '[]'||items.length==0){ + showResult('发票列表不能为空'); + return false; + } + form.form.submit({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsBillAction!saveExpensiveGoodsBill.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success : function(form, action) { + showResult(action.result.message); + grid.dwrReload(); + window.close(); + }, + failure : function(form, action) { + showResult(action.result.message); + } + }); + } + },{ + text : '取消', + handler : function() { + window.close(); + } + }] + }); + + var window = new top.Ext.Window( { + id : 'expensiveGoodsBill', + layout : 'fit', + title : '高值耗材发票单', + width : 1100, + height :610, + modal : true, + border :false, + plain : true, + items : [ form ], + listeners : { + close : function (){ + expensiveGoodsStore.baseParams.supplierId = null; + expensiveGoodsStore.load(); + authorizedExpensiveGoodsStore.baseParams.supplierId = null; + authorizedExpensiveGoodsStore.load(); + } + } + }); + window.show(); +// top.Ext.getCmp('name1').focus(false, 100); + +} +function addExpensiveGoodsInstanceItem(expensiveGoodsBillItem){ + var expensiveGoodsId = expensiveGoodsBillItem.data.expensiveGoodsId; + var amount = expensiveGoodsBillItem.data.amount; + var settledTime = top.Ext.getCmp('settledTime').getValue().format('Y-m-d H:i:s'); +// console.log(expensiveGoodsBillItem); +// console.log(expensiveGoodsId); +// console.log(amount); + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsBillAction!loadExpensiveGoodsInstanceByExpensiveGoodsId.do', + params : { + expensiveGoodsId : expensiveGoodsId, + amount : amount, + settledTime : settledTime + }, + success : function(response) { + var result = Ext.decode(response.responseText).data; + var message = Ext.decode(response.responseText).message; +// console.log(result); +// console.log(message); + if(message.warning!=null){ + showResult(message.warning); + } + if(result){ + for (var i = 0; i < result.length; i++) { + var expensiveGoodsInstanceItem = new expensiveGoodsInstanceItemRecord({ + id : result[i].id, + expensiveGoodsId : result[i].expensiveGoodsId, + showName : result[i].showName, + entryType : result[i].entryType, + price : result[i].price, + entryDate : result[i].entryDate, + expDate:result[i].expDate, + model: result[i].model, + patientName: result[i].patientName + }); + top.Ext.getCmp('expensiveGoodsInstanceGrid').getStore().insert(0 , expensiveGoodsInstanceItem); + } + } + + }, + failure : function(response, options) { + showResult(response.responseText); + } + }); +} Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsBill/expensiveGoodsBillView.js =================================================================== diff -u -r21090 -r21932 --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsBill/expensiveGoodsBillView.js (.../expensiveGoodsBillView.js) (revision 21090) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsBill/expensiveGoodsBillView.js (.../expensiveGoodsBill/expensiveGoodsBillView.js) (revision 21932) @@ -23,6 +23,30 @@ ]) }); +//高值耗材物品定义数据源(根据被受权的供应商获得) +var authorizedExpensiveGoodsStore = new Ext.data.Store({ + pageSize: 100, + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/expensiveGoodsAction!searchAuthorizedExpensiveGoods.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'spelling',mapping : 'spelling'}, + {name : 'name',mapping : 'name'}, + {name : 'displayName',mapping : 'displayName'}, + {name : 'showName',mapping : 'showName'}, + {name : 'referencePrice',mapping : 'referencePrice'}, + {name : 'validityTime',mapping : 'validityTime'}, + {name : 'certification',mapping : 'certification'}, + {name : 'madeCompanyName',mapping : 'madeCompanyName'}, + {name : 'madeCompanyId',mapping : 'madeCompanyId'} + ]) +}); + function dateCompare(date1,date2){ date1 = date1.replace(/\-/gi,"/"); date2 = date2.replace(/\-/gi,"/"); @@ -36,10 +60,25 @@ return 3; }} -//供应商 -var expensiveGoodsSupplierStore = new Ext.data.Store({ +////供应商 +//var expensiveGoodsSupplierStore = new Ext.data.Store({ +// proxy : new Ext.data.HttpProxy({ +// url : WWWROOT + '/disinfectSystem/baseData/expensiveGoodsSupplierAction!getSupplierData.do?supplierType='+encodeURI(expensiveGoodsSupplier), +// method : 'POST' +// }), +// reader : new Ext.data.JsonReader({ +// totalProperty : 'totalCount', +// root : 'data' +// }, [ +// {name : 'id',mapping : 'id'}, +// {name : 'name',mapping : 'name'} +// ]) +//}); + +//(被授权的)高值耗材供应商数据源 +var authorizedExpensiveGoodsSupplierStore = new Ext.data.Store({ proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierData.do?supplierType='+encodeURI(expensiveGoodsSupplier), + url : WWWROOT + '/disinfectSystem/baseData/expensiveGoodsSupplierAction!getAuthorizedSupplierData.do?supplierType='+encodeURI(expensiveGoodsSupplier), method : 'POST' }), reader : new Ext.data.JsonReader({ @@ -50,8 +89,7 @@ {name : 'name',mapping : 'name'} ]) }); - -//高值耗材采购单对象 +//高值耗材发票明细对象 var expensiveGoodBillItemRecord = Ext.data.Record.create([ {name : 'localID'}, {name : 'id'}, @@ -63,6 +101,18 @@ {name : 'expensiveGoodsId'} ]); +//高值耗材实例明细对象 +var expensiveGoodsInstanceItemRecord = Ext.data.Record.create([ + {name : 'id'}, + {name : 'showName'}, + {name : 'entryType'}, + {name : 'price'}, + {name : 'entryDate'}, + {name : 'expDate'}, + {name : 'batchNumber'}, + {name : 'patientName'} + ]); + //打印,目前只支持单个打印 function printGoodPurchasePlan(id, printType){ if(id == null) @@ -159,7 +209,6 @@ function addItems(name,amount,price,supplierName,expensiveGoodsId){ for(var i = 0;i < top.Ext.getCmp('goodBillItemGrid').getStore().getCount();i++){ //console.log(top.Ext.getCmp('goodBillItemGrid').getStore().getAt(i).data); - //console.log(name); if(top.Ext.getCmp('goodBillItemGrid').getStore().getAt(i).data.name == name){ showResult("该物品已经存在,不能重复添加!"); return false; @@ -196,14 +245,18 @@ supplierName : supplierName, expensiveGoodsId : expensiveGoodsId }); + //显示高值耗材实例 + addExpensiveGoodsInstanceItem(expensiveGoodsBillItem); top.Ext.getCmp('goodBillItemGrid').getStore().insert(0 , expensiveGoodsBillItem); setTotalMoney(top.Ext.getCmp('goodBillItemGrid')); clearForm(); return true; } function renderDeleteButton(v,p,record){ - return ""; + var localID = record.data.localID; + var expensiveGoodsId = record.data.expensiveGoodsId; + return ""; } /** * 精确计算arg1和arg2的乘积 @@ -273,7 +326,19 @@ return total; } -function deleteItem(localID){ +function deleteItem(localID,expensiveGoodsId){ + var expensiveGoodsInstanceGrid = top.Ext.getCmp('expensiveGoodsInstanceGrid').getStore(); + var count = expensiveGoodsInstanceGrid.getCount(); + var removeList = new Array(); + for(var i = 0;i