Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/godownEntry/goodPurchasePlanView.jsp
===================================================================
diff -u -r23133 -r23512
--- ssts-web/src/main/webapp/disinfectsystem/assestManagement/godownEntry/goodPurchasePlanView.jsp (.../goodPurchasePlanView.jsp) (revision 23133)
+++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/godownEntry/goodPurchasePlanView.jsp (.../goodPurchasePlanView.jsp) (revision 23512)
@@ -40,6 +40,7 @@
var supplier = '<%=Supplier.SUPPLIER_TYPE_SUPPLIER%>';//供货单位
+
Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/godownEntry/goodPurchasePlanView.js
===================================================================
diff -u -r23133 -r23512
--- ssts-web/src/main/webapp/disinfectsystem/assestManagement/godownEntry/goodPurchasePlanView.js (.../goodPurchasePlanView.js) (revision 23133)
+++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/godownEntry/goodPurchasePlanView.js (.../goodPurchasePlanView.js) (revision 23512)
@@ -45,34 +45,131 @@
return 3;
}}
-var supplierStore = new Ext.data.Store({
- proxy : new Ext.data.HttpProxy({
- url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierData.do?supplierType='+encodeURI(supplier),
- method : 'POST'
- }),
- reader : new Ext.data.JsonReader({
- totalProperty : 'totalCount',
- root : 'data'
- }, [
- {name : 'id',mapping : 'id'},
- {name : 'name',mapping : 'name'}
- ])
-});
+//var madeCompanyNeedVerifyStore = new Ext.data.Store({
+// proxy : new Ext.data.HttpProxy({
+// url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierData.do?supplierType='+encodeURI(supplier),
+// method : 'POST'
+// }),
+// reader : new Ext.data.JsonReader({
+// totalProperty : 'totalCount',
+// root : 'data'
+// }, [
+// {name : 'id',mapping : 'id'},
+// {name : 'name',mapping : 'name'}
+// ])
+//});
-var madeCompanyStore = new Ext.data.Store({
- proxy : new Ext.data.HttpProxy({
- url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierData.do?supplierType='+encodeURI(madeCompany),
- method : 'POST'
- }),
- reader : new Ext.data.JsonReader({
- totalProperty : 'totalCount',
- root : 'data'
- }, [
- {name : 'id',mapping : 'id'},
- {name : 'name',mapping : 'name'}
- ])
-});
+//var madeCompanyStore = new Ext.data.Store({
+// proxy : new Ext.data.HttpProxy({
+// url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierData.do?supplierType='+encodeURI(madeCompany),
+// method : 'POST'
+// }),
+// reader : new Ext.data.JsonReader({
+// totalProperty : 'totalCount',
+// root : 'data'
+// }, [
+// {name : 'id',mapping : 'id'},
+// {name : 'name',mapping : 'name'}
+// ])
+//});
+//var supplierNeedVerifyStore = new Ext.data.Store({
+// proxy : new Ext.data.HttpProxy({
+// url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierDataNeedVerify.do?supplierType='+encodeURI(supplier),
+// method : 'POST'
+// }),
+// reader : new Ext.data.JsonReader({
+// totalProperty : 'totalCount',
+// root : 'data'
+// }, [
+// {name : 'id',mapping : 'id'},
+// {name : 'name',mapping : 'name'}
+// ]),
+// listeners: {
+// beforeload: function(s,options){
+// selectedRecord = top.Ext.getCmp('goodPurchaseItemGrid').getSelectionModel().getSelections()[0];
+// var disposableGoodsId = selectedRecord.data["disposableGoodsId"];//一次性物品id
+// var manufacturerId = selectedRecord.data["manufacturerId"];//生产厂家id
+// s.baseParams.disposableGoodsID ="";
+// s.baseParams.manufacturerId ="";
+// s.baseParams.needVerify = "";
+//// //若有一次性物品id 且 配置了需要校验则:过滤校验供应商
+// if(!isUndefinedOrNullOrEmpty(disposableGoodsId) && sstsConfig.godownEntryNeedVerify){
+// s.baseParams.disposableGoodsID = disposableGoodsId;
+// s.baseParams.needVerify = true;//需要校验
+// if(!isUndefinedOrNullOrEmpty(manufacturerId)){
+// s.baseParams.manufacturerId = manufacturerId;
+// }
+// }
+// }
+// }
+//});
+
+//供应商数据源(根据一次性物品采购计划入库是否需要校验配置项 和 是否为一次性物品 启用校验过滤)
+var supplierStore = new Ext.data.Store({
+ proxy : new Ext.data.HttpProxy({
+ url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierDataNeedVerify.do?supplierType='+encodeURI(supplier),
+ method : 'POST'
+ }),
+ reader : new Ext.data.JsonReader({
+ totalProperty : 'totalCount',
+ root : 'data'
+ }, [
+ {name : 'id',mapping : 'id'},
+ {name : 'name',mapping : 'name'}
+ ]),
+ listeners: {
+ beforeload: function(s,options){
+ var disposableGoodsId = top.Ext.getCmp('disposableGoodsId').getValue();//一次性物品id
+ var manufacturerId = top.Ext.getCmp('manufacturerId').getValue();//生产厂家id
+ s.baseParams.disposableGoodsID ="";
+ s.baseParams.manufacturerId ="";
+ s.baseParams.needVerify = "";
+ //若有一次性物品id且配置了需要校验则:过滤校验供应商
+ if(!isUndefinedOrNullOrEmpty(disposableGoodsId) && sstsConfig.godownEntryNeedVerify){
+ s.baseParams.disposableGoodsID = disposableGoodsId;
+ s.baseParams.needVerify = true;//需要校验
+ if(!isUndefinedOrNullOrEmpty(manufacturerId)){
+ s.baseParams.manufacturerId = manufacturerId;
+ }
+ }
+ }
+ }
+ });
+
+//生产厂家数据源(根据一次性物品采购计划入库是否需要校验配置项 和 是否为一次性物品 启用校验过滤)
+ var madeCompanyStore = new Ext.data.Store({
+ proxy : new Ext.data.HttpProxy({
+ url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierDataNeedVerify.do?supplierType='+encodeURI(madeCompany),
+ method : 'POST'
+ }),
+ reader : new Ext.data.JsonReader({
+ totalProperty : 'totalCount',
+ root : 'data'
+ }, [
+ {name : 'id',mapping : 'id'},
+ {name : 'name',mapping : 'name'}
+ ]),
+ listeners: {
+ beforeload: function(s,options){
+ var disposableGoodsId = top.Ext.getCmp('disposableGoodsId').getValue();//一次性物品id
+ var supplierId = top.Ext.getCmp('supplierId').getValue();//供应商id
+ s.baseParams.disposableGoodsID ="";
+ s.baseParams.manufacturerId ="";
+ s.baseParams.needVerify = "";
+ //若有一次性物品id且配置了需要校验则:过滤校验生产厂家
+ if(!isUndefinedOrNullOrEmpty(disposableGoodsId) && sstsConfig.godownEntryNeedVerify){
+ s.baseParams.disposableGoodsID = disposableGoodsId;
+ s.baseParams.needVerify = true;//需要校验
+ if(!isUndefinedOrNullOrEmpty(supplierId)){
+ s.baseParams.supplierId = supplierId;
+ }
+ }
+
+ }
+ }
+ });
+
var GoodPurchasePlanItemRecord = Ext.data.Record.create([
{name : 'localID'},
{name : 'id'},
@@ -128,80 +225,6 @@
});
}
-function validateForm(){
- if(!top.Ext.getCmp('goodPurchaseForm').form.isValid()){
- showResult('请正确填写表单各值');
- return false;
- }
- var name = top.Ext.getCmp('name1').getValue();
- if(name.length==0){
- showResult('请填写物品名称!');
- top.Ext.getCmp('name1').focus(false,100);
- return false;
- }
- var count = top.Ext.getCmp('amount1').getValue();
- if(count.length==0){
- showResult('请填写物品数量!');
- top.Ext.getCmp('amount1').focus(false,100);
- return false;
- }
- //var countNum = Ext.num(parseInt(count),0)
- if(!/^\d+$/.test(count)){
- showResult('物品数量只能是整数');
- top.Ext.getCmp('amount1').focus(false,100);
- return false;
- }
-
- var lastConsumption = top.Ext.getCmp('lastConsumption1').getValue();
- if(lastConsumption != null && lastConsumption.length > 0){
- //var lastConsumptionNum = Ext.num(parseInt(lastConsumption),0)
- if(!/^\d+$/.test(lastConsumption)){
- showResult('上期消耗量只能是整数');
- top.Ext.getCmp('lastConsumption1').focus(false,100);
- return false;
- }
- }
-
- var stockQuantity = top.Ext.getCmp('stockQuantity').getValue();
- if(stockQuantity != null && stockQuantity.length > 0){
- if(!/^\d+$/.test(stockQuantity)){
- showResult('库存数量只能是整数');
- top.Ext.getCmp('stockQuantity').focus(false,100);
- return false;
- }
- }
-
- var unit = top.Ext.getCmp('unit1').getValue();
- if(unit.length==0){
- showResult('请填写物品单位!');
- top.Ext.getCmp('unit1').focus(false,100);
- return false;
- }
- /*var specification = top.Ext.getCmp('specification1').getValue();
- if(specification.length==0){
- showResult('请填写物品规格!');
- top.Ext.getCmp('specification1').focus(false,100);
- return false;
- }*/
- var cost = top.Ext.getCmp('purchase').getValue();
- if(cost.length==0){
- showResult('请填写物品进价!');
- top.Ext.getCmp('purchase').focus(false,100);
- return false;
- }
- if(!/^(([1-9]+[0-9]*.{1}[0-9]+)|([0].{1}[1-9]+[0-9]*)|([1-9][0-9]*)|([0][.][0-9]+[1-9]*))$/.test(cost)){
- showResult('物品进价只能是正数');
- top.Ext.getCmp('purchase').focus(false,100);
- return false;
- }
-
- if(top.Ext.getCmp('supplier1').getValue() == null || top.Ext.getCmp('supplier1').getValue() == ''){
- showResult("请填写供应商!");
- top.Ext.getCmp('supplier1').focus(false,100);
- return false;
- }
- return true;
-}
function clearForm(){
top.Ext.getCmp('name1').setValue('');
top.Ext.getCmp('amount1').setValue('');
@@ -218,68 +241,6 @@
top.Ext.getCmp('manufacturer').setValue('');
top.Ext.getCmp('name1').focus();
}
-function addItems(departName,departCoding,name,unit,specification,lastConsuption,
- stockQuantity,scheduleAmount,purchase,manufacturer,supplierName,disposableGoodsId,materialDefinitionId,supplierId,manufacturerId){
- for(var i = 0;i < top.Ext.getCmp('goodPurchaseItemGrid').getStore().getCount();i++){
- if(top.Ext.getCmp('goodPurchaseItemGrid').getStore().getAt(i).data.name == name){
- showResult("该物品已经存在,不能重复添加!");
- return false;
- }
- }
- var lastConsuptionNum = Ext.num(parseInt(lastConsuption),0)
- if(isNaN(lastConsuptionNum)){
- lastConsuptionNum = '';
- }
-
- var stockQuantityNum = Ext.num(parseInt(stockQuantity),0)
- if(isNaN(stockQuantityNum)){
- stockQuantityNum = '';
- }
-
- var scheduleAmountNum = Ext.num(parseInt(scheduleAmount),0)
- if(isNaN(scheduleAmountNum)){
- scheduleAmountNum = '';
- }
-
- var purchaseNum = Ext.num(parseFloat(purchase),0)
- if(isNaN(purchaseNum)){
- purchaseNum = '';
- }
-
- var totalPriceNum = Ext.num(parseInt(scheduleAmount) * parseFloat(purchase),0)
- if(isNaN(totalPriceNum)){
- totalPriceNum = '';
- }
- //添加操作
- var goodPurchasePlanItem = new GoodPurchasePlanItemRecord({
- localID:g_localID++,
- id : "",
- departName : departName,
- departCoding : departCoding,
- name : name,
- unit : unit,
- specification : specification,
- lastConsuption : lastConsuptionNum,
- stockQuantity : stockQuantityNum,
- scheduleAmount : scheduleAmountNum,
- purchase : purchaseNum,
- totalPrice:totalPriceNum,
- manufacturer:manufacturer,
- supplierName : supplierName,
- disposableGoodsId : disposableGoodsId,
- materialDefinitionId : materialDefinitionId,
- supplierId : supplierId,
- manufacturerId : manufacturerId
- });
- //alert(purchase + " " + scheduleAmount + " " );
- //alert("lastConsuption:" + lastConsuption);
- //alert("tatalPrice:" + Ext.num(parseFloat(scheduleAmount) * parseFloat(purchase),0));
- //top.Ext.getCmp('goodPurchaseItemGrid').getStore().add(goodPurchasePlanItem);
- top.Ext.getCmp('goodPurchaseItemGrid').getStore().insert(0 , goodPurchasePlanItem);
- setTotalMoney(top.Ext.getCmp('goodPurchaseItemGrid'));
- clearForm();
- return true;
-}
function renderDeleteButton(v,p,record){
return "";
@@ -367,675 +328,7 @@
top.Ext.getCmp(id).focus();
top.Ext.getCmp(id).selectText();
}
-function addGoodPurchasePlan(id) {
- var form = new top.Ext.FormPanel({
- id : 'goodPurchaseForm',
- frame : true,
- labelSeparator : ':',
- bodyStyle : 'padding:5px 5px 0px 5px',
- width : 850,
- autoScroll : true,
- labelAlign : 'left',
- items:[{
- layout : 'column',
- items : [{
- xtype : 'hidden',
- name : 'id',
- id : 'id'
- },{
- xtype : 'hidden',
- name : 'items',
- id : 'items'
- },{
- xtype : 'hidden',
- name : 'originalItems',
- id : 'originalItems'
- },{
- xtype : 'hidden',
- name : 'formParams',
- id : 'formParams'
- },{
- xtype : 'hidden',
- name : 'originalFormParams',
- id : 'originalFormParams'
- },{
- id : 'serialNum',
- columnWidth : .25,
- layout : 'form',
- labelWidth : 40,
- hidden:true,
- items : [{
- xtype : 'textfield',
- fieldLabel : '单号',
- maxLength : '41',
- id : 'serialNumber',
- name : 'serialNumber',
- cls : 'fieldReadOnlyNoRemove',
- allowBlank : true,
- readOnly : true,
- anchor : '95%'
- }]
- }, {
- columnWidth : .25,
- layout : 'form',
- labelWidth : 60,
- items : [{
- xtype : 'textfield',
- fieldLabel : '操作员',
- maxLength : '50',
- id : 'operator',
- name : 'operator',
- allowBlank : false,
- readOnly : true,
- cls : 'fieldReadOnlyNoRemove',
- value : $Id('userName').value,
- anchor : '95%'
- }]
- }, {
- columnWidth : .25,
- 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 : .25,
- layout : 'form',
- labelWidth : 80,
- items : [{
- xtype : 'textfield',
- fieldLabel : '总金额',
- id : 'totalPrice',
- name : 'totalPrice',
- readOnly:true,
- cls : 'fieldReadOnlyNoRemove',
- anchor : '95%'
- }]
-
- }, {
- columnWidth : 1,
- layout : 'form',
- labelWidth : 40,
- items : [{
- xtype : 'textarea',
- fieldLabel : '备注',
- height : 50,
- id : 'remark',
- name : 'remark',
- maxLength : 665,
- allowBlank : true,
- anchor : '100%'
- }]
- }]
- },new top.Ext.grid.EditorGridPanel({
- id : 'goodPurchaseItemGrid',
- bodyStyle : 'border:1px solid #afd7af',
- frame :false,
- height : 390,
- store : new top.Ext.data.Store({
- reader : new top.Ext.data.JsonReader({
- fields : [
- {name : 'id'},
- {name : 'departName'},
- {name : 'departCoding'},
- {name : 'name'},
- {name : 'unit'},
- {name : 'specification'},
-
- {name : 'lastConsuption'},
- {name : 'stockQuantity'},
- {name : 'scheduleAmount'},
- {name : 'purchase'},
- {name : 'totalPrice'},
- {name : 'manufacturer'},
- {name : 'supplierName'},
- {name : 'deleteButton'},
- {name : 'disposableGoodsId'},
- {name : 'materialDefinitionId'},
- {name : 'manufacturerId'},
- {name : 'supplierId'}
- ]
- })
- }),
- cm : new top.Ext.grid.ColumnModel([new Ext.grid.RowNumberer(),
- {header : "id",dataIndex : 'id',hidden : true},
- {header : "科室",dataIndex : 'departName',width : 80,menuDisabled : true},
- {header : "编码",dataIndex : 'departCoding',width : 60,menuDisabled : true},
- {header : "名称",dataIndex : 'name',width : 200,menuDisabled : true},
- {header : "规格",dataIndex : 'specification',width : 90,menuDisabled : true},
- {header : "单位",dataIndex : 'unit',width : 50,menuDisabled : true},
- {header : "上期消耗量",dataIndex : 'lastConsuption',width : 80,menuDisabled : true,
- editor : new top.Ext.form.TextField({
- regex: /^\d+$/,
- regexText:'只能输入数字',
- allowBlank : false
- })
- },
- {header : "库存数量",width : 70,dataIndex : 'stockQuantity',menuDisabled : true},
- {header : "计划数",width : 60,dataIndex : 'scheduleAmount',menuDisabled : true,
- editor : new top.Ext.form.TextField({
- regex: /^\d+$/,
- regexText:'只能输入数字',
- allowBlank : false,
- listeners:{
- change :function(field,newVal,oldVal){
- var grid = top.Ext.getCmp('goodPurchaseItemGrid');
- setTotalMoney(grid);
- }
- }
- })
- },
- {header : "进价",dataIndex : 'purchase',width : 70,menuDisabled : true,
- editor : new top.Ext.form.TextField({
- regex: /^(([1-9]+[0-9]*.{1}[0-9]+)|([0].{1}[1-9]+[0-9]*)|([1-9][0-9]*)|([0][.][0-9]+[1-9]*))$/,
- regexText:'只能输入正数',
- allowBlank : false,
- listeners:{
- change :function(field,newVal,oldVal){
- var grid = top.Ext.getCmp('goodPurchaseItemGrid');
- setTotalMoney(grid);
- }
- }
- })
- },
- {header : "金额",width : 80,menuDisabled : true,dataIndex : 'totalPrice', renderer:renderTotalPrice},
- {header : "供应商",width : 150,dataIndex : 'supplierName',menuDisabled : true,
- editor : new top.Ext.form.ComboBox({
- queryParam : 'supplierName',
- minChars : 0,
- valueField : 'id',
- displayField : 'name',
- store : supplierStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : true,
- width : 100,
- listeners : {
- select : function(combo, record, index) {
- combo.setValue(record.data.name);
- selectedRecord = top.Ext.getCmp('goodPurchaseItemGrid').getSelectionModel().getSelections()[0];
- selectedRecord.set("supplierId",record.data.id);
- }
- }
- })
- },
- {header : "生产商",width : 150,dataIndex : 'manufacturer',menuDisabled : true,
- editor : new top.Ext.form.ComboBox({
- queryParam : 'supplierName',
- minChars : 0,
- valueField : 'id',
- displayField : 'name',
- store : madeCompanyStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : true,
- width : 100,
- listeners : {
- select : function(combo, record, index) {
- combo.setValue(record.data.name);
- selectedRecord = top.Ext.getCmp('goodPurchaseItemGrid').getSelectionModel().getSelections()[0];
- selectedRecord.set("manufacturerId",record.data.id);
-// console.log(selectedRecord);
- }
- }
- })
- },
- {header : "删除",width : 70,menuDisabled : true,dataIndex : 'deleteButton', renderer:renderDeleteButton}
- ]),
- width :983,
- selModel : new top.Ext.grid.RowSelectionModel({
- singleSelect : false
- }),
- tbar : [{
- xtype : 'hidden',
- name : 'disposableGoodsId',
- id : 'disposableGoodsId'
- },{
- xtype : 'hidden',
- name : 'materialDefinitionId',
- id : 'materialDefinitionId'
- },{
- xtype : 'hidden',
- name : 'barcode',
- id : 'barcode'
- },{
- xtype : 'hidden',
- name : 'supplierId',
- id : 'supplierId'
- },{
- xtype : 'hidden',
- name : 'manufacturerId',
- id : 'manufacturerId'
- },{
- text : ' 物品名称:'
- },{
- xtype : 'combo',
- id : 'name1',
- name : 'name1',
- queryParam : 'spell',
- minChars : 0,
- valueField : 'name',
- displayField : 'name',
- store : disposableGoodsAndMaterialStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : true,
- width : 270,
- tabIndex : 1,
- selectOnFocus : true,
- listeners : {
- select : function(combo, record, index) {
- top.Ext.getCmp('name1').setValue(record.data.name);
- top.Ext.getCmp('name1').selectText();
- var disposableGoodsId = record.data.disposableGoodsId;
- var materialDefinitionId = record.data.materialDefinitionId;
-
- //加载相关的信息
- /*DiposableGoodsTableManager.getDiposableGoodsInfoForGoodPurchase(record.data.id,function(result){
- if(result != ""){
- var array = result.split("#;");
- top.Ext.getCmp('stockQuantity').setValue(array[0]);
- top.Ext.getCmp('specification1').setValue(array[1]);
- top.Ext.getCmp('unit1').setValue(array[2]);
- top.Ext.getCmp('supplier1').setValue(array[3]);
- top.Ext.getCmp('manufacturer').setValue(array[4]);
- }
- });*/
-
- if(disposableGoodsId){
- top.Ext.getCmp('materialDefinitionId').setValue("");
- top.Ext.getCmp('disposableGoodsId').setValue(disposableGoodsId);
- top.Ext.getCmp('purchase').setValue(record.data.referencePrice);
- //选择物品后自动带出上一次录入的数据,增加进价
- GoodPurchaseTableManager.getLastGoodPurchaseItemByDisposableGoodsId(disposableGoodsId,function(result){
- if(result && result != ""){
- var lastGoodPurchaseItem = Ext.decode(result);
- top.Ext.getCmp('stockQuantity').setValue(lastGoodPurchaseItem.stockQuantity);
- top.Ext.getCmp('specification1').setValue(lastGoodPurchaseItem.specification1);
- top.Ext.getCmp('purchase').setValue(lastGoodPurchaseItem.purchase);
- top.Ext.getCmp('unit1').setValue(lastGoodPurchaseItem.unit1);
- top.Ext.getCmp('supplier1').setValue(lastGoodPurchaseItem.supplier1);
- top.Ext.getCmp('manufacturer').setValue(lastGoodPurchaseItem.manufacturer);
- top.Ext.getCmp('supplierId').setValue(lastGoodPurchaseItem.supplierId);
- top.Ext.getCmp('manufacturerId').setValue(lastGoodPurchaseItem.manufacturerId);
- }
- });
- }else if(materialDefinitionId){
- top.Ext.getCmp('disposableGoodsId').setValue("");
- top.Ext.getCmp('materialDefinitionId').setValue(materialDefinitionId);
- //选择物品后自动带出上一次录入的数据,增加进价
- GoodPurchaseTableManager.getLastGoodPurchaseItemByMaterialDefinitionId(materialDefinitionId,function(result){
- if(result && result != ""){
- var lastGoodPurchaseItem = Ext.decode(result);
- top.Ext.getCmp('stockQuantity').setValue(lastGoodPurchaseItem.stockQuantity);
- top.Ext.getCmp('specification1').setValue(lastGoodPurchaseItem.specification1);
- top.Ext.getCmp('purchase').setValue(lastGoodPurchaseItem.purchase);
- top.Ext.getCmp('unit1').setValue(lastGoodPurchaseItem.unit1);
- top.Ext.getCmp('supplier1').setValue(lastGoodPurchaseItem.supplier1);
- top.Ext.getCmp('manufacturer').setValue(lastGoodPurchaseItem.manufacturer);
- top.Ext.getCmp('supplierId').setValue(lastGoodPurchaseItem.supplierId);
- top.Ext.getCmp('manufacturerId').setValue(lastGoodPurchaseItem.manufacturerId);
- }
- });
- }
- top.Ext.getCmp('amount1').focus();
- top.Ext.getCmp('amount1').selectText();
- },
- specialkey : function(field, ee) {
- if (ee.getKey() == Ext.EventObject.ENTER) {
- focusTo('amount1');
- }
- }
- }
- },{
- text : '数 量:'
- },{
- xtype : 'textfield',
- maxLength : '16',
- id : 'amount1',
- name : 'amount1',
- allowBlank:true,
- width : 100,
- regex: /^\d+$/,
- regexText:'只能输入整数',
- anchor : '95%',
- tabIndex : 2,
- listeners : {
- specialkey : function(field, e) {
- if (e.getKey() == Ext.EventObject.ENTER) {
- focusTo('unit1');
- }
- }
- }
- },{
- text : '规 格:'
- },{
- xtype : 'textfield',
- allowBlank:true,
- id : 'specification1',
- name : 'specification1',
- maxLength : '30',
- width : 150,
- tabIndex : 4,
- anchor : '95%',
- listeners : {
- specialkey : function(field, ee) {
- if (ee.getKey() == Ext.EventObject.ENTER) {
- focusTo('lastConsumption1');
- }
- }
- }
- }],
- listeners: {
- render : function() {
- var tbar = new top.Ext.Toolbar ({
- items : [{
- text : '上期消耗量:'
- },{
- xtype : 'textfield',
- maxLength : '16',
- id : 'lastConsumption1',
- name : 'lastConsumption1',
- allowBlank:true,
- width : 100,
- regex: /^\d+$/,
- regexText:'只能输入整数',
- anchor : '95%',
- tabIndex : 5,
- listeners : {
- specialkey : function(field, e) {
- if (e.getKey() == Ext.EventObject.ENTER) {
- focusTo('stockQuantity');
- }
- }
- }
- },{
- text : '库存数量:'
- },{
- xtype : 'textfield',
- maxLength : '16',
- id : 'stockQuantity',
- name : 'stockQuantity',
- allowBlank:true,
- width : 108,
- regex: /^\d+$/,
- regexText:'只能输入整数',
- anchor : '95%',
- tabIndex : 6,
- listeners : {
- specialkey : function(field, e) {
- if (e.getKey() == Ext.EventObject.ENTER) {
- focusTo('purchase');
- }
- }
- }
- },{
- text:'进 价:'
- },{
- xtype : 'textfield',
- maxLength : '16',
- id : 'purchase',
- name : 'purchase',
- width : 100,
- 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,
- listeners : {
- specialkey : function(field, e) {
- if (e.getKey() == Ext.EventObject.ENTER) {
- focusTo('supplier1');
- }
- }
- }
- },{
- text : '单 位:'
- },{
- xtype : 'textfield',
- allowBlank:true,
- id : 'unit1',
- name : 'unit1',
- maxLength : '30',
- width : 150,
- tabIndex : 3,
- anchor : '95%',
- listeners : {
- specialkey : function(field, ee) {
- if (ee.getKey() == Ext.EventObject.ENTER) {
- focusTo('specification1');
- }
- }
- }
- }]
- });
- tbar.render(top.Ext.getCmp('goodPurchaseItemGrid').tbar);
-
- var tbar3 = new top.Ext.Toolbar ({
- items : [{
- text : ' 供 应 商:'
- },{
- xtype : 'combo',
- id : 'supplier1',
- name : 'supplier1',
- queryParam : 'supplierName',
- minChars : 0,
- valueField : 'name',
- displayField : 'name',
- store : supplierStore,
- forceSelection : false,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- selectOnFocus :true,
- allowBlank : true,
- width : 270,
- tabIndex : 8,
- listeners : {
- select : function(field, r) {
- top.Ext.getCmp('supplierId').setValue(r.data.id);
- focusTo('manufacturer');
- },
- specialKey:function(f,e){
- if (e.getKey() == Ext.EventObject.ENTER) {
- focusTo('manufacturer');
- }
- }
- }
- },{
- text : '生产商:'
- },{
- xtype : 'combo',
- id : 'manufacturer',
- name : 'manufacturer',
- maxLength : '60',
- queryParam : 'supplierName',
- minChars : 0,
- valueField : 'name',
- displayField : 'name',
- store : madeCompanyStore,
- forceSelection : false,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : false,
- typeAhead : false,
- allowBlank : true,
- selectOnFocus :true,
- editable:true,
- width : 300,
- tabIndex : 9,
- listeners : {
- select : function(field, r) {
- top.Ext.getCmp('manufacturerId').setValue(r.data.id);
- },
- 'keydown' : function(obj, e){
- if (e.getKey() == e.BACKSPACE) {e.stopEvent();}
- }
- }
- },{
- text : '添加',
- iconCls : 'btn_ext_add',
- id:'addBtn',
- handler : function() {
- if(addPurchaseGoods() == true){
- focusTo('name1');
- }
- }
- }]
- });
- tbar3.render(top.Ext.getCmp('goodPurchaseItemGrid').tbar);
- }
- }
- })],
- buttons : [{
- text : '打印预览',
- hidden: (id == ""?true:false),
- handler : function() {
- printGoodPurchasePlan(id, 1);
- }
- },{
- text : '打印',
- hidden: (id == ""?true:false),
- handler : function() {
- printGoodPurchasePlan(id, 0)
- }
- },{
- text : '保存',
- hidden:saveButton,
- handler : function() {
- if(!form.getForm().isValid()){
- showResult('请正确填写表单各值');
- return false;
- }
- var name = top.Ext.getCmp('name1').getValue();
-
- var items = buildJSONStringFromStore(top.Ext.getCmp('goodPurchaseItemGrid').getStore());
- // console.log(items);
- // 设置表单参数json
- setFormParams(form,['id','remark','time']);
- top.Ext.getCmp("items").setValue(items);
-
- // items为json数组字符串,不会为null
- if(items == '[]'){
- showResult('请正确填写表单各值');
- return false;
- }
- form.form.submit({
- url : WWWROOT + '/disinfectSystem/goodPurchaseAction!saveGoodPurchasePlan.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 : 'recyclingApplicationWin',
- layout : 'fit',
- title : '采购单信息',
- width : 1020,
- height :550,
- modal : true,
-// autoHeight : true,
- border :false,
- plain : true,
- items : [ form ]
- });
- window.show();
- top.Ext.getCmp('name1').focus(false, 100);
-}
-//添加
-function addPurchaseGoods(){
- if(!validateForm()){
- return false;
- }
- /*if(!top.Ext.getCmp('goodPurchaseForm').form.isValid()){
- showResult('请正确填写表单各值');
- return false;
- }*/
- var disposableGoodsId = top.Ext.getCmp('disposableGoodsId').getValue();
- var materialDefinitionId = top.Ext.getCmp('materialDefinitionId').getValue();
- var supplierId = top.Ext.getCmp('supplierId').getValue();
- var manufacturerId = top.Ext.getCmp('manufacturerId').getValue();
- var name = top.Ext.getCmp('name1').getValue();
- /*if(name.length==0){
- showResult('请填写物品名称!');
- top.Ext.getCmp('name1').focus(false,100);
- return false;
- }*/
- var scheduleAmount = top.Ext.getCmp('amount1').getValue();
- /*if(scheduleAmount.length==0){
- showResult('请填写物品数量!');
- top.Ext.getCmp('amount1').focus(false,100);
- return false;
- }*/
- var unit = top.Ext.getCmp('unit1').getValue();
- /*if(unit.length==0){
- showResult('请填写物品单位!');
- top.Ext.getCmp('unit1').focus(false,100);
- return false;
- }*/
- var specification = top.Ext.getCmp('specification1').getValue();
- /*if(specification.length==0){
- showResult('请填写物品规格!');
- top.Ext.getCmp('specification1').focus(false,100);
- return false;
- }*/
- var purchase = top.Ext.getCmp('purchase').getValue();
- /*if(purchase.length==0){
- showResult('请填写物品进价!');
- top.Ext.getCmp('purchase').focus(false,100);
- return false;
- }*/
-
- var supplierName = top.Ext.getCmp('supplier1').getValue();
- var manufacturer = top.Ext.getCmp('manufacturer').getRawValue();
- var stockQuantity = top.Ext.getCmp('stockQuantity').getRawValue();
- var departName = $Id('departName').value;
- var departCoding = $Id('departCoding').value;
- var lastConsuption = top.Ext.getCmp('lastConsumption1').getValue();
- //alert(departName + " " + departCoding);
- return addItems(departName,departCoding,name,unit,specification,lastConsuption,
- stockQuantity,scheduleAmount,purchase,manufacturer,supplierName,disposableGoodsId,materialDefinitionId,supplierId,manufacturerId);
-}
-
// 删除
function deleteGoodPurchasePlan(grid) {
var records = grid.getSelectionModel().getSelections();
Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/godownEntry/godownEntryView.js
===================================================================
diff -u -r23147 -r23512
--- ssts-web/src/main/webapp/disinfectsystem/assestManagement/godownEntry/godownEntryView.js (.../godownEntryView.js) (revision 23147)
+++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/godownEntry/godownEntryView.js (.../godownEntryView.js) (revision 23512)
@@ -155,6 +155,114 @@
}
}
});
+
+//供应商数据源(校验用)
+ var supplierNeedVerifyStore = new Ext.data.Store({
+ proxy : new Ext.data.HttpProxy({
+ url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierDataNeedVerify.do?supplierType='+encodeURI(supplier),
+ method : 'POST'
+ }),
+ reader : new Ext.data.JsonReader({
+ totalProperty : 'totalCount',
+ root : 'data'
+ }, [
+ {name : 'id',mapping : 'id'},
+ {name : 'name',mapping : 'name'}
+ ]),
+ listeners: {
+ beforeload: function(s,options){
+ var disposableGoodsID = top.Ext.getCmp('disposableGoodsID').getValue();//一次性物品id
+ var manufacturerId = top.Ext.getCmp('manufacturerId').getValue();//生产厂家id
+// console.log(disposableGoodsID);
+ s.baseParams.manufacturerId ="";
+ s.baseParams.disposableGoodsID ="";
+ s.baseParams.needVerify = true;//需要校验用
+ if(!isUndefinedOrNullOrEmpty(manufacturerId)){
+ s.baseParams.manufacturerId = manufacturerId;
+ }
+ if(!isUndefinedOrNullOrEmpty(disposableGoodsID)){
+ s.baseParams.disposableGoodsID = disposableGoodsID;
+ }
+ }
+ }
+ });
+
+//生产厂家数据源(校验用)
+ var madeCompanyNeedVerifyStore = new Ext.data.Store({
+ proxy : new Ext.data.HttpProxy({
+ url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getSupplierDataNeedVerify.do?supplierType='+encodeURI(madeCompany),
+ method : 'POST'
+ }),
+ reader : new Ext.data.JsonReader({
+ totalProperty : 'totalCount',
+ root : 'data'
+ }, [
+ {name : 'id',mapping : 'id'},
+ {name : 'name',mapping : 'name'}
+ ]),
+ listeners: {
+ beforeload: function(s,options){
+ var disposableGoodsID = top.Ext.getCmp('disposableGoodsID').getValue();//一次性物品id
+ var supplierId = top.Ext.getCmp('supplierId').getValue();//供应商id
+// console.log(supplierId);
+ s.baseParams.supplierId ="";
+ s.baseParams.disposableGoodsID ="";
+ s.baseParams.needVerify = true;//需要校验用
+ if(!isUndefinedOrNullOrEmpty(supplierId)){
+ s.baseParams.supplierId = supplierId;
+ }
+ if(!isUndefinedOrNullOrEmpty(disposableGoodsID)){
+ s.baseParams.disposableGoodsID = disposableGoodsID;
+ }
+ }
+ }
+ });
+
+//注册证号数据源(校验用)
+ certificationStore = new top.Ext.data.Store({
+ proxy : new top.Ext.data.HttpProxy({
+ url : WWWROOT + '/disinfectSystem/baseData/supplierAction!getCertificationStoreList.do',
+ method : 'POST'
+ }),
+ reader : new top.Ext.data.JsonReader(
+ {
+ totalProperty : 'totalCount',
+ root : 'data'
+ },[
+ {name : 'id'},
+ {name : 'certificateNumber'}
+ ]),
+ listeners: {
+ beforeload: function(s,options){
+ var manufacturerId = top.Ext.getCmp('manufacturerId').getValue();//生产厂家id
+ var disposableGoodsID = top.Ext.getCmp('disposableGoodsID').getValue();//一次性物品id
+ s.baseParams.manufacturerId = '';
+ s.baseParams.disposableGoodsID = '';
+ if(!isUndefinedOrNullOrEmpty(manufacturerId)){
+ s.baseParams.manufacturerId = manufacturerId;
+ }
+ if(!isUndefinedOrNullOrEmpty(disposableGoodsID)){
+ s.baseParams.disposableGoodsID = disposableGoodsID;
+ }
+ },
+ load : function(store,records) {
+ //注册证自动填入
+// console.log(records);
+ if(records.length > 0){
+ var combo = top.Ext.getCmp('certification1');
+ combo.setValue(records[0].data.id);
+ // 触发选中事件
+ combo.fireEvent('select', combo,records[0],0);
+ }else{
+ var combo = top.Ext.getCmp('certification1');
+ combo.setValue("");
+ // 触发选中事件
+ combo.fireEvent('select', combo,"",0);
+ }
+ }
+
+ }
+ })
var hasTypeStore = new Ext.data.SimpleStore({
fields : ['hasType'],
data : [[HAS_TYPE_NO],[HAS_TYPE_YES]]
@@ -271,6 +379,28 @@
return false;
}
}
+
+ //是否需要校验物品关联的供应商,生产厂家,注册证
+ if(sstsConfig.godownEntryNeedVerify){
+ if(top.Ext.isEmpty(top.Ext.getCmp('supplier1').getValue()) || manufacturerId == null){
+ showResult("请填写供应商!");
+ return false;
+ }
+ if(top.Ext.isEmpty(top.Ext.getCmp('manufacturer').getValue()) || supplierId == null){
+ showResult("请填写生产厂家!");
+ return false;
+ }
+ var certificationId = top.Ext.getCmp('certification1').getValue();
+ if(certificationId == '' || certification == null){
+ showResult("请填写注册证号!");
+ return false;
+ }
+ //检查物品相关证件是否过期
+ if(!checkGoodsValidityTime(disposableGoodsID,supplierId,manufacturerId,certificationId)){
+ return false;
+ }
+ }
+
var qualifiedCheck = top.Ext.getCmp("qualifiedCheck").getValue();
var qualifiedLabel = top.Ext.getCmp("qualifiedLabel").getValue();
@@ -316,13 +446,17 @@
top.Ext.getCmp('supplierId').setValue('');
top.Ext.getCmp('sterileBatchNumber').setValue('');
top.Ext.getCmp('manufacturer').setValue('');
- top.Ext.getCmp('certification').setValue('');
+ top.Ext.getCmp('certification1').setValue('');
// top.Ext.getCmp('qualifiedCheck').setValue('');
// top.Ext.getCmp('qualifiedLabel').setValue('');
top.Ext.getCmp('name1').focus();
batchNumStore.baseParams.disposableGoodsID = '';
batchNumStore.load();
+ //配置godownEntryNeedVerify为true:注册证stroe
+ if(sstsConfig.godownEntryNeedVerify){
+ certificationStore.load();
+ }
}
function renderDeleteButton(v,p,record){
@@ -445,7 +579,7 @@
top.Ext.getCmp('supplier1').setValue(info.supplierName);
}
if(!isUndefinedOrNullOrEmpty(info.certification)){
- top.Ext.getCmp('certification').setValue(info.certification);
+ top.Ext.getCmp('certification1').setValue(info.certification);
}
}else{
@@ -496,1391 +630,11 @@
}
},
failure : function(response, options) {
- alert(1);
var result = Ext.decode(response.responseText);
}
});
}
-var selectModel = new top.Ext.grid.CheckboxSelectionModel();
-//从入库单列表点添加或点击列表中某一行的单都会调用此function
-function addGodownEntry() {
- Ext.getCmp("formSubmitResult").setValue(formSubmitResultInit);
- wareHouseStore.load();
- var form = new top.Ext.FormPanel({
- id : 'godownEntryForm',
- frame : true,
- labelSeparator : ':',
- bodyStyle : 'padding:5px 5px 0px 5px',
- width : 850,
- autoScroll : true,
- labelAlign : 'left',
- items:[{
- layout : 'column',
- items : [{
- xtype : 'hidden',
- name : 'id',
- id : 'id'
- },{
- xtype : 'hidden',
- name : 'type',
- value : TYPE_IN
- },{
- xtype : 'hidden',
- name : 'items',
- id : 'items'
- },{
- xtype : 'hidden',
- name : 'originalItems',
- id : 'originalItems'
- },{
- xtype : 'hidden',
- name : 'formParams',
- id : 'formParams'
- },{
- xtype : 'hidden',
- name : 'originalFormParams',
- id : 'originalFormParams'
- },{
- xtype : 'hidden',
- name : 'warehouseID',
- id : 'warehouseID'
- },{
- xtype : 'hidden',
- name : 'warehouseName',
- id : 'warehouseName'
- },{
- id : 'serialNum',
- columnWidth : .20,
- layout : 'form',
- labelWidth : 40,
- hidden:true,
- items : [{
- xtype : 'textfield',
- fieldLabel : '单号',
- maxLength : '41',
- id : 'serialNumber',
- name : 'serialNumber',
- cls : 'fieldReadOnlyNoRemove',
- allowBlank : true,
- readOnly : true,
- anchor : '95%'
- }]
- },{
- columnWidth : .20,
- layout : 'form',
- labelWidth : 40,
- items:[{
- xtype : 'combo',
- fieldLabel : '仓库',
- id : 'wareHouse1',
- name : 'wareHouse1',
- minChars : 0,
- valueField : 'id',
- displayField : 'name',
- store : wareHouseStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : true,
- width : 100,
- listeners : {
- select : function(combo, record, index) {
- setWareHouseInfo(record.data.id,record.data.name);
- top.Ext.getCmp('wareHouse1').setValue(record.data.id);
- //diposableGoodsStore.proxy.extraParams.warehouseID = record.data.id;
- //diposableGoodsStore.proxy.conn.extraParams.spell = top.Ext.getCmp('name1').getValue();
- /*diposableGoodsStore.reload({
- callback:function(e){
- console.log(e);
- }
- });*/
-
- top.Ext.getCmp('name1').focus();
- top.Ext.getCmp('name1').enable();
- },
- specialkey : function(field, ee) {
- if (ee.getKey() == Ext.EventObject.ENTER) {
- top.Ext.getCmp('name1').focus();
- }
- }
- }
- }]
- }, {
- columnWidth : .15,
- layout : 'form',
- labelWidth : 60,
- items : [{
- xtype : 'textfield',
- fieldLabel : '操作员',
- maxLength : '50',
- id : 'operator',
- name : 'operator',
- allowBlank : false,
- readOnly : true,
- cls : 'fieldReadOnlyNoRemove',
- value : $Id('userName').value,
- anchor : '95%'
- }]
- }, {
- columnWidth : .25,
- layout : 'form',
- labelWidth : 60,
- items : [{
- xtype : 'datefieldWithMin',
- fieldLabel : '入库时间',
- id : 'time',
- name : 'time',
- format : 'Y-m-d H:i',
- 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',
-// value : new Date(),
- allowBlank : false,
- anchor : '95%',
- listeners : {
- render : function() {
- setStartDate(top.Ext, 'yyyy/MM/dd HH:mm', 'time'); //(入库时间,取服务器时间 cjr)
- }
- }
- }]
- }, {
- columnWidth : .20,
- layout : 'form',
- labelWidth : 80,
- items : [{
- xtype : 'textfield',
- fieldLabel : '入库单总价',
- id : 'totalPrice',
- name : 'totalPrice',
- readOnly:true,
- cls : 'fieldReadOnlyNoRemove',
- anchor : '95%'
- }]
- },{
- hidden : !sstsConfig.showDisposableGoodsGodownEntryVerifier || (commonEntry.isOpen() ? false:true),
- columnWidth : .25,
- layout : 'form',
- labelWidth : 130,
- items :[{
- xtype : 'textfield',
- fieldLabel :'扫描供应室核对人条码',
- id : 'supplyRoomVerifierBarcode',
- name : 'supplyRoomVerifierBarcode',
- width : 100,
- enableKeyEvents : true,
- listeners : {
- render : function(c) {
- c.getEl().on('keypress',function(e) {
- if (e.getKey() == 13) {// 输入;号键,grid重新加载
- loadUserVerifierByBarcode('supplyRoomVerifierBarcode');
- }
- });
- }
- }
- }]
- },{
- hidden : !sstsConfig.showDisposableGoodsGodownEntryVerifier|| (commonEntry.isOpen() ? false:true),
- columnWidth : .25,
- layout : 'form',
- labelWidth : 80,
- items:[{
- xtype : 'combo',
- fieldLabel : '供应室核对人',
- id : 'supplyRoomVerifier',
- name : 'supplyRoomVerifier',
- queryParam : 'spell',
- valueField : 'name',
- displayField : 'name',
- store : verifierStore,
- forceSelection : true,
- lazyInit : true,
- minChars : 0,
- listWidth:100,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : true,
- width : 100,
- listeners : {
- select : function(combo, record, index) {
- top.Ext.getCmp('supplyRoomVerifier').setValue(record.data.name);
- top.Ext.getCmp('equipmentVerifierBarcode').focus();
- },
- specialkey : function(field, ee) {
- if (ee.getKey() == Ext.EventObject.ENTER) {
- top.Ext.getCmp('equipmentVerifierBarcode').focus();
- }
- }
- }
- }]
- },{
- hidden : !sstsConfig.showDisposableGoodsGodownEntryVerifier|| (commonEntry.isOpen() ? false:true),
- columnWidth : .25,
- layout : 'form',
- labelWidth : 130,
- items :[{
- xtype : 'textfield',
- fieldLabel :'扫描设备科核对人条码',
- id : 'equipmentVerifierBarcode',
- name : 'equipmentVerifierBarcode',
- width : 100,
- enableKeyEvents : true,
- listeners : {
- render : function(c) {
- c.getEl().on('keypress',function(e) {
- if (e.getKey() == 13) {// 输入;号键,grid重新加载
- loadUserVerifierByBarcode('equipmentVerifierBarcode');
- }
- });
- }
- }
- }]
- },{
- hidden : !sstsConfig.showDisposableGoodsGodownEntryVerifier|| (commonEntry.isOpen() ? false:true),
- columnWidth : .25,
- layout : 'form',
- labelWidth : 80,
- items:[{
- xtype : 'combo',
- fieldLabel : '设备科核对人',
- id : 'equipmentVerifier',
- name : 'equipmentVerifier',
- queryParam : 'spell',
- valueField : 'name',
- displayField : 'name',
- store : verifierStore,
- forceSelection : true,
- lazyInit : true,
- minChars : 0,
- listWidth:100,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : true,
- width : 100,
- listeners : {
- select : function(combo, record, index) {
- top.Ext.getCmp('equipmentVerifier').setValue(record.data.name);
- }
- }
- }]
- },{
- columnWidth : 1,
- layout : 'form',
- labelWidth : 40,
- items : [{
- xtype : 'textarea',
- fieldLabel : '备注',
- height : 50,
- id : 'remark',
- name : 'remark',
- maxLength : 665,
- allowBlank : true,
- anchor : '100%'
- }]
- }]
- },new top.Ext.grid.EditorGridPanel({
- id : 'godownEntryItemGrid',
- bodyStyle : 'border:1px solid #afd7af',
- frame :false,
- sm : selectModel,
- height : 390,
- viewConfig: {
- forceFit:true
- },
- store : new top.Ext.data.Store({
- proxy : new top.Ext.data.HttpProxy({
- url : WWWROOT + '/disinfectSystem/godownEntryAction!loadGodownEntryItemByid.do',
- method : 'POST'
- }),
- reader : new top.Ext.data.JsonReader({
- fields : [
- {name : 'id'},
- {name : 'disposableGoodsID'},
- {name : 'name'},
- {name : 'amount'},
- {name : 'disposableGoodsBatchID'},
- {name : 'batchNumber'},
- {name : 'cost'},
- {name : 'expDate'},
- {name : 'supplierName'},
- {name : 'sterileBatchNumber'},
- {name : 'manufacturer'},
- {name : 'certification'},
- {name : 'totalPrice'},
- {name : 'deleteButton'},
- {name : 'hasBiologicalTestReport'},
- {name : 'hasInvoice'},
- {name : 'grade'},
- {name : 'manufacturerId'},
- {name : 'supplierId'},
- {name : 'qualifiedCheck'},//标签合格
- {name : 'qualifiedLabel'}//验收合格
- ]
- })
- }),
- cm : new top.Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), selectModel,
- {header : "id",dataIndex : 'id',hidden : true},
- {header : "disposableGoodsID",dataIndex : 'disposableGoodsID',hidden : true},
- {header : "名称",dataIndex : 'name',width : 250,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){
- if(commonEntry.isOpen()){
- field.setValue(oldVal);
- return false;
- }
- var grid = top.Ext.getCmp('godownEntryItemGrid');
- setTotalMoney(grid);
- },focus:function(){
- if(commonEntry.isOpen()){
- alert('查看和编辑入库单时不能修改数量');
- return false;
- }
- }
- }
- })
- },
- {header : "批次",width : 70,dataIndex : 'batchNumber',menuDisabled : true,
- editor : new top.Ext.form.TextField({
- allowBlank : false,
- listeners:{
- change :function(field,newVal,oldVal){
- var grid = top.Ext.getCmp('godownEntryItemGrid');
- setTotalMoney(grid);
- },focus:function(){
- if(!commonEntry.isOpen()){
- alert('添加入库单的时候不能修改批次号');
- return false;
- }
- }
- }
- })
- },
- {header : "失效日期",width : 80,dataIndex : 'expDate',menuDisabled : true, renderer:top.Ext.util.Format.dateRenderer('Y-m-d'),
- editor : new top.Ext.form.DateExtensiableField({
- minWidth : 177,
- format : 'Y-m-d',
- altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j',
- allowBlank : false
- })
- },
- {header : "单价",dataIndex : 'cost',width : 50,menuDisabled : true,
- editor : new top.Ext.form.TextField({
- regex: /^(([1-9]+[0-9]*.{1}[0-9]+)|([0].{1}[1-9]+[0-9]*)|([1-9][0-9]*)|([0][.][0-9]+[1-9]*))$/,
- regexText:'只能输入正数',
- allowBlank : false,
- listeners:{
- change :function(field,newVal,oldVal){
- if(commonEntry.isOpen()){
- field.setValue(oldVal);
- return false;
- }
- var grid = top.Ext.getCmp('godownEntryItemGrid');
- setTotalMoney(grid);
- },focus:function(){
- if(commonEntry.isOpen()){
- alert('查看和编辑入库单时不能修改单价');
- return false;
- }
- }
- }
- })
- },
- {id : 'expandColumn',header : "供应商",width : 180,dataIndex : 'supplierName',menuDisabled : true,
- editor : new top.Ext.form.ComboBox({
- queryParam : 'supplierName',
- minChars : 0,
- valueField : 'id',
- displayField : 'name',
- store : supplierStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : true,
- width : 100,
- listeners : {
- select : function(combo, record, index) {
- combo.setValue(record.data.name);
- selectedRecord = top.Ext.getCmp('godownEntryItemGrid').getSelectionModel().getSelections()[0];
- selectedRecord.set("supplierId",record.data.id);
- }
- }
- })
- },
- {header : "灭菌批号",width : 80,dataIndex : 'sterileBatchNumber',menuDisabled : true,
- editor : new top.Ext.form.TextField({
- maxLength : 30,
- allowBlank : true
- })
- },
- {header : "生产厂家",width : 100,dataIndex : 'manufacturer',menuDisabled : true,
- editor : new top.Ext.form.ComboBox({
- queryParam : 'supplierName',
- minChars : 0,
- valueField : 'id',
- displayField : 'name',
- store : madeCompanyStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : true,
- width : 100,
- listeners : {
- select : function(combo, record, index) {
- combo.setValue(record.data.name);
- selectedRecord = top.Ext.getCmp('godownEntryItemGrid').getSelectionModel().getSelections()[0];
- selectedRecord.set("manufacturerId",record.data.id);
- }
- }
- })
- },
- {header : "产地",width : 80,dataIndex : 'producingArea',menuDisabled : true,
- editor : new top.Ext.form.TextField({
- maxLength : 30,
- allowBlank : true
- })
- },
- {header : "注册证号",width : 120,dataIndex : 'certification',menuDisabled : true,
- editor : new top.Ext.form.TextField({
- maxLength : 30,
- allowBlank : true
- })
- },
- {header : "标签合格",width : 80,menuDisabled : true,dataIndex : 'qualifiedLabel',hidden:!sstsConfig.godownEntryShowQualified},
- {header : "验收合格",width : 80,menuDisabled : true,dataIndex : 'qualifiedCheck',hidden:!sstsConfig.godownEntryShowQualified},
- {header : "总价",width : 70,menuDisabled : true,dataIndex : 'totalPrice', renderer:renderTotalPrice},
- {header : "生物检测",width : 70,menuDisabled : true,dataIndex : 'hasBiologicalTestReport',
- editor : new top.Ext.form.ComboBox({
- minChars : 0,
- store : hasTypeStore,
- forceSelection : true,
- lazyInit : false,
- valueField : 'hasType',
- displayField : 'hasType',
- mode : 'local',
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : false,
- editable:false,
- width : 100,
- listeners : {
- select : function(combo, record, index) {
- combo.setValue(record.data.hasType);
- }
- }
- }),hidden:!sstsConfig.godownEntryShowBiologicalTestReport},
- {header : "有无发票",width : 70,menuDisabled : true,dataIndex : 'hasInvoice',
- editor : new top.Ext.form.ComboBox({
- minChars : 0,
- store : hasTypeStore,
- forceSelection : true,
- lazyInit : false,
- valueField : 'hasType',
- displayField : 'hasType',
- mode : 'local',
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : false,
- editable:false,
- width : 100,
- listeners : {
- select : function(combo, record, index) {
- combo.setValue(record.data.hasType);
- }
- }
- }),hidden:!sstsConfig.godownEntryShowInvoice},
- {header : '类别',width : 50,menuDisabled : true,dataIndex : 'grade',
- editor : new top.Ext.form.ComboBox({
- minChars : 0,
- store : gradeStore,
- forceSelection : true,
- lazyInit : false,
- valueField : 'name',
- displayField : 'name',
- mode : 'local',
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : false,
- editable:false,
- width : 100,
- listeners : {
- select : function(combo, record, index) {
- //combo.setValue(record.data.name);
- }
- }
- })},
- {header : "删除",width : 50,menuDisabled : true,dataIndex : 'deleteButton', renderer:renderDeleteButton}
- ]),
- width :1380,
- autoExpandColumn : 'expandColumn',
- selModel : new top.Ext.grid.RowSelectionModel({
- singleSelect : false
- }),
- tbar : [{
- xtype : 'hidden',
- name : 'disposableGoodsID',
- id : 'disposableGoodsID'
- },{
- xtype : 'hidden',
- name : 'supplierId',
- id : 'supplierId'
- },{
- xtype : 'hidden',
- name : 'manufacturerId',
- id : 'manufacturerId'
- },{
- xtype : 'hidden',
- name : 'barcode',
- id : 'barcode'
- },{
- text : '扫描条码 :'
- },{
- xtype : 'textfield',
- id : 'barcode',
- name : 'barcode',
- width :90,
- enableKeyEvents : true,
- listeners : {
- render : function(c) {
- c.getEl().on('keypress',function(e) {
- if (e.getKey() == 13) {// 输入;号键,grid重新加载
- loadReturnDiposableGoodsItem();
- }
- });
- }
- }
- },{
- text : '物品名称:'
- },{
- xtype : 'combo',
- id : 'name1',
- name : 'name1',
- queryParam : 'spell',
- minChars : 0,
- valueField : 'id',
- displayField : 'name',
- pageSize : 100,
- listConfig: {width: 300},
- store : sstsConfig.restrictGodownEntryDiposableGoods == true ? diposableGoodsStore:allDiposableGoodsStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- allowBlank : true,
- width : 270,
- tabIndex : 1,
- selectOnFocus : true,
- disabled:true,
- listeners : {
- select : function(combo, record, index) {
- top.Ext.getCmp('name1').setValue(record.data.name);
- top.Ext.getCmp('name1').selectText();
- top.Ext.getCmp('disposableGoodsID').setValue(record.data.id);
- top.Ext.getCmp('cost1').setValue(record.data.referencePrice);
- //根据一次性物品id加载最近一次入库的一次性物品的供应商、注册证号、生产厂家、灭菌批次、产地、类别、单价等
- GodownEntryTableManager.getLastDiposableGoodsFromGodownEntry(record.data.id,function(result){
- if(result && result != ""){
- var lastGodownEntryItem = Ext.decode(result);
- top.Ext.getCmp('supplier1').setValue(lastGodownEntryItem.supplierName);
- top.Ext.getCmp('certification').setValue(lastGodownEntryItem.certification);
- top.Ext.getCmp('manufacturer').setValue(lastGodownEntryItem.manufacturer);
- top.Ext.getCmp('supplierId').setValue(lastGodownEntryItem.supplierId);
- top.Ext.getCmp('manufacturerId').setValue(lastGodownEntryItem.manufacturerId);
- top.Ext.getCmp('sterileBatchNumber').setValue(lastGodownEntryItem.sterileBatchNumber);
- top.Ext.getCmp('producingArea').setValue(lastGodownEntryItem.producingArea);
- top.Ext.getCmp('grade').setValue(lastGodownEntryItem.grade);
- top.Ext.getCmp('cost1').setValue(lastGodownEntryItem.cost);
- }
- });
- batchNumStore.baseParams.disposableGoodsID = record.data.id;
- batchNumStore.load();
- top.Ext.getCmp('amount1').focus();
- top.Ext.getCmp('amount1').selectText();
- },
- specialkey : function(field, ee) {
- if (ee.getKey() == Ext.EventObject.ENTER) {
- top.Ext.getCmp('amount1').focus();
- top.Ext.getCmp('amount1').selectText();
- }
- }
- }
- },{
- text : '数 量:'
- },{
- xtype : 'textfield',
- maxLength : '16',
- id : 'amount1',
- name : 'amount1',
- allowBlank:true,
- width : 80,
- regex: /^\d+$/,
- regexText:'只能输入数字',
- anchor : '95%',
- tabIndex : 2,
- listeners : {
- specialkey : function(field, e) {
- if (e.getKey() == Ext.EventObject.ENTER) {
- top.Ext.getCmp('batchNumber1').focus();
- top.Ext.getCmp('batchNumber1').selectText();
- }
- }
- }
- },{
- text : '生产批次:'
- },{
- xtype : 'combo',
- id : 'batchNumber1',
- name : 'batchNumber1',
- maxLength : '30',
- queryParam : 'spell',
- minChars : 0,
- valueField : 'batchNumber',
- displayField : 'batchNumber',
- store : batchNumStore,
- forceSelection : false,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : false,
- typeAhead : false,
- allowBlank:true,
- selectOnFocus :true,
- width : 150,
- tabIndex : 3,
- anchor : '95%',
- listeners : {
- select : function(combo, record, index) {
- top.Ext.getCmp('batchNumber1').setValue(record.data.batchNumber);
-
- var goodsId = top.Ext.getCmp('disposableGoodsID').getValue();
- var batchNumber = record.data.batchNumber;
- //加载灭菌批号、生产厂家
- DiposableGoodsTableManager.getDisposableGoodsBatchPropertyByDisposableGoodsID(goodsId,batchNumber,function(result){
- if(result!=""){
- var array = result.split("#;");
- top.Ext.getCmp('manufacturer').setValue(array[0]);
- top.Ext.getCmp('sterileBatchNumber').setValue(array[1]);
- top.Ext.getCmp('expDate1').setValue(array[2]);
- top.Ext.getCmp('manufacturerId').setValue(array[3]);
- }
- });
-
- },
- specialkey : function(field, ee) {
- if (ee.getKey() == Ext.EventObject.ENTER) {
- top.Ext.getCmp('producingArea').focus();
- top.Ext.getCmp('producingArea').selectText();
- }
- }
- }
- },{
- text : '产地:'
- },{
- xtype : 'textfield',
- id : 'producingArea',
- name : 'producingArea',
- width : 80,
- tabIndex : 4,
- anchor : '95%',
- allowBlank:true,
- listeners:{
- specialkey : function(field, ee) {
- if (ee.getKey() == Ext.EventObject.ENTER) {
- if(sstsConfig.godownEntryShowBiologicalTestReport){
- top.Ext.getCmp('hasBiologicalTestReport').focus();
- top.Ext.getCmp('hasBiologicalTestReport').selectText();
- }else{
- top.Ext.getCmp('expDate1').focus();
- top.Ext.getCmp('expDate1').selectText();
- }
- }
- }
- }
- },{
- text:'生物检测:',
- hidden:!sstsConfig.godownEntryShowBiologicalTestReport
- },{
- xtype : 'combo',
- id : 'hasBiologicalTestReport',
- name : 'hasBiologicalTestReport',
- minChars : 0,
- valueField : 'hasType',
- displayField : 'hasType',
- mode : 'local',
- store : hasTypeStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : false,
- typeAhead : false,
- selectOnFocus :true,
- allowBlank : true,
- editable:false,
- width : 80,
- tabIndex : 5,
- hidden:!sstsConfig.godownEntryShowBiologicalTestReport,
- listeners : {
- select : function(field, r) {
- top.Ext.getCmp('expDate1').focus();
- },
- specialKey:function(f,e){
- if (e.getKey() == Ext.EventObject.ENTER) {
- top.Ext.getCmp('expDate1').focus();
- top.Ext.getCmp('expDate1').selectText();
- }
- }
- }
- }],
- listeners: {
- render : function() {
- var tbar = new top.Ext.Toolbar ({
- items : [{
- text : '失 效 期:'
- },{
- xtype : 'dateextensiablefield',//dateextensiablefield
- id : 'expDate1',
- name : 'expDate1',
- width : 190,
- minWidth : 190,
- tabIndex : 6,
- anchor : '95%',
- allowBlank:true,
- invalidText :'日期输入不正确',
- format : 'Y-m-d',
- altFormats:'Y-m|Y-n|y-n|y-m|Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ym|Ymd|Yn|Ynj|yn|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',
-// readOnly:true,
- listeners : {
- specialkey : function(field, e) {
- if (e.getKey() == Ext.EventObject.ENTER) {
- top.Ext.getCmp('batchNumber1'). collapse();
- var isOK = field.validate();
- if(isOK){
- var value = field.getValue();
- field.setValue(value);
- top.Ext.getCmp('cost1').focus();
- top.Ext.getCmp('cost1').selectText();
- }
-
- }
- }
- }
- },{
- text : '单 价:'
- },{
- xtype : 'textfield',
- maxLength : '16',
- id : 'cost1',
- name : 'cost1',
- width : 80,
- 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,
- listeners : {
- specialkey : function(field, e) {
- if (e.getKey() == Ext.EventObject.ENTER) {
- top.Ext.getCmp('batchNumber1'). collapse();
- top.Ext.getCmp('supplier1').focus();
- top.Ext.getCmp('supplier1').selectText();
- }
- }
- }
- },{
- text : '供 应 商:'
- },{
- xtype : 'combo',
- id : 'supplier1',
- name : 'supplier1',
- queryParam : 'supplierName',
- minChars : 0,
- valueField : 'name',
- displayField : 'name',
- store : supplierStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : true,
- typeAhead : false,
- selectOnFocus :true,
- allowBlank : true,
- width : 190,
- tabIndex : 8,
- listeners : {
- select : function(field, r) {
- top.Ext.getCmp('supplierId').setValue(r.data.id);
- top.Ext.getCmp('hasInvoice').focus();
- },
- specialKey:function(f,e){
- if (e.getKey() == Ext.EventObject.ENTER) {
- if(sstsConfig.godownEntryShowInvoice){
- top.Ext.getCmp('hasInvoice').focus();
- top.Ext.getCmp('hasInvoice').selectText();
- }else{
- top.Ext.getCmp('manufacturer').focus();
- top.Ext.getCmp('manufacturer').selectText();
- }
- }
- }
- }
- },{
- text:'有无发票:',
- hidden:!sstsConfig.godownEntryShowInvoice
- },{
- xtype : 'combo',
- id : 'hasInvoice',
- name : 'hasInvoice',
- minChars : 0,
- valueField : 'hasType',
- displayField : 'hasType',
- mode : 'local',
- store : hasTypeStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : false,
- typeAhead : false,
- selectOnFocus :true,
- allowBlank : true,
- editable:false,
- width : 80,
- tabIndex : 9,
- hidden:!sstsConfig.godownEntryShowInvoice,
- listeners : {
- select : function(field, r) {
- top.Ext.getCmp('manufacturer').focus();
- },
- specialKey:function(f,e){
- if (e.getKey() == Ext.EventObject.ENTER) {
- top.Ext.getCmp('manufacturer').focus();
- top.Ext.getCmp('manufacturer').selectText();
- }
- }
- }
- }]
- });
- tbar.render(top.Ext.getCmp('godownEntryItemGrid').tbar);
-
- var tbar3 = new top.Ext.Toolbar ({
- items : [{
- text : '生产厂家:'
- },{
- xtype : 'combo',
- id : 'manufacturer',
- name : 'manufacturer',
- maxLength : '60',
- queryParam : 'supplierName',
- minChars : 0,
- valueField : 'name',
- displayField : 'name',
- store : madeCompanyStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : false,
- typeAhead : false,
- allowBlank : true,
- selectOnFocus :true,
- width : 190,
- tabIndex : 10,
- listeners : {
- select : function(field, r) {
- top.Ext.getCmp('manufacturerId').setValue(r.data.id);
- top.Ext.getCmp('sterileBatchNumber').focus();
- },
- 'keydown' : function(obj, e){
- if (e.getKey() == e.BACKSPACE) {e.stopEvent();}
- },
- specialKey:function(f,e){
- var key = e.getKey();
- if (key == Ext.EventObject.ENTER) {
- top.Ext.getCmp('sterileBatchNumber').focus();
- top.Ext.getCmp('sterileBatchNumber').selectText();
- }
- }
- }
- },{
- text : '灭菌批号:'
- },{
- xtype : 'textfield',
- id : 'sterileBatchNumber',
- name : 'sterileBatchNumber',
- width : 80,
- tabIndex : 11,
- anchor : '95%',
- allowBlank:true,
- listeners : {
- specialkey : function(field, e) {
- if (e.getKey() == Ext.EventObject.ENTER) {
- top.Ext.getCmp('certification').focus();
- top.Ext.getCmp('certification').selectText();
- }
- }
- }
- },{
- text : '注册证号:'
- },{
- xtype : 'textfield',
- id : 'certification',
- name : 'certification',
- width : 190,
- tabIndex : 12,
- allowBlank:true,
- anchor : '100%',
- listeners : {
- specialkey : function(field, e) {
- var key = e.getKey();
- if (key == Ext.EventObject.ENTER) {
- addGodown();
- top.Ext.getCmp('name1').focus();
- top.Ext.getCmp('name1').selectText();
- }
- }
- }
- },{
- text : '类别:'
- },{
- xtype : 'combo',
- id : 'grade',
- name : 'grade',
- minChars : 0,
- valueField : 'name',
- displayField : 'name',
- mode : 'local',
- triggerAction : 'all',
- store : gradeStore,
- forceSelection : false,
- allowBlank : true,
- editable:false,
- width : 60
- },{
- text:'标签合格',
- hidden:!sstsConfig.godownEntryShowQualified
- },{
- xtype : 'combo',
- id : 'qualifiedLabel',
- name : 'qualifiedLabel',
- minChars : 0,
- valueField : 'qualifiedType',
- displayField : 'qualifiedType',
- mode : 'local',
- store : qualifiedStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : false,
- typeAhead : false,
- selectOnFocus :true,
- allowBlank : true,
- editable:false,
- width : 40,
- tabIndex : 9,
- hidden:!sstsConfig.godownEntryShowQualified,
- listeners : {
- render : function(field, e){
- if(sstsConfig.godownEntryShowQualified){
- field.setValue(HAS_TYPE_PASS);
- }
- }
- }
- },{
- text:'验收合格',
- hidden:!sstsConfig.godownEntryShowQualified
- },{
- xtype : 'combo',
- id : 'qualifiedCheck',
- name : 'qualifiedCheck',
- minChars : 0,
- valueField : 'qualifiedType',
- displayField : 'qualifiedType',
- mode : 'local',
- store : qualifiedStore,
- forceSelection : true,
- lazyInit : false,
- triggerAction : 'all',
- hideTrigger : false,
- typeAhead : false,
- selectOnFocus :true,
- allowBlank : true,
- editable:false,
- width : 40,
- tabIndex : 9,
- hidden:!sstsConfig.godownEntryShowQualified,
- listeners : {
- render : function(field, e){
- if(sstsConfig.godownEntryShowQualified){
- field.setValue(HAS_TYPE_PASS);
- }
- }
-
- }
- },{
- text : '添加',
- iconCls : 'btn_ext_add',
- id:'addBtn',
- hidden : commonEntry.isOpen(),
- handler : function() {
- addGodown();
- top.Ext.getCmp('name1').focus();
- top.Ext.getCmp('name1').selectText();
- }
- }]
- });
- tbar3.render(top.Ext.getCmp('godownEntryItemGrid').tbar);
- }
- }
- })],
- buttons : [
- {
- text : '修改物品',
- hidden : !commonEntry.isOpen(),
- handler : function() {
- var store = top.Ext.getCmp('godownEntryItemGrid').getStore();
- var modifyRecords = store.getModifiedRecords();
- var len = modifyRecords.length;
- if(len==0){
- showResult("请先修改物品");
- return;
- }
- var items = [];
- for (var i = 0; i < len; i++) {
- var record = modifyRecords[i];
- items.push({
- id : record.data.id,//入库明细id
- disposableGoodsID : record.data.disposableGoodsID,//一次性物品定义id
- batchID : record.data.disposableGoodsBatchID,//批次id
- batchNumber : record.data.batchNumber,//批次号
- expDate : record.data.expDate.format('Y-m-d'),//失效期
- supplierName : record.data.supplierName,//供应商
- supplierId : record.data.supplierId,//供应商id
- sterileBatchNumber : record.data.sterileBatchNumber,//灭菌批号
- manufacturer : record.data.manufacturer,//生产厂家
- manufacturerId : record.data.manufacturerId,//生产厂家id
- producingArea : record.data.producingArea,//产地
- certification : record.data.certification,//注册证号
- grade : record.data.grade//类别
- });
- }
- top.Ext.getCmp("items").setValue(JSON.stringify(items));
- form.form.submit({
- url : WWWROOT + '/disinfectSystem/godownEntryAction!modifyGodownEntryItemBaseData.do',
- method : 'POST',
- waitMsg : '正在保存数据,请稍候',
- waitTitle : '提交表单',
- success : function(form, action) {
- if(!isUndefinedOrNullOrEmpty(action.result.message)){
- showResult(action.result.message);
- return;
- }
- godownEntryWin.close();
- grid.dwrReload();
- },
- failure : function(form, action) {
- alert(action.result.message);
- }
- });
- }
- },{
- text : '保存核对人',
- hidden: verifierUpdateButton || !sstsConfig.showDisposableGoodsGodownEntryVerifier||(commonEntry.isOpen()?false:true),
- handler : function(){
- var supplyRoomVerifier = top.Ext.getCmp('supplyRoomVerifier').getValue();//供应室核对员
- var equipmentVerifier = top.Ext.getCmp('equipmentVerifier').getValue();//设备科核对员
- if(isUndefinedOrNullOrEmpty(equipmentVerifier)){
- showResult('设备科核对员不能为空!');
- return false;
- };
- if(isUndefinedOrNullOrEmpty(supplyRoomVerifier)){
- showResult('供应室核对员不能为空!');
- return false;
- };
- // 设置表单参数json
- setFormParams(form,['id','equipmentVerifier','supplyRoomVerifier']);
- form.form.submit({
- url : WWWROOT + '/disinfectSystem/godownEntryAction!saveGodownEntryVerifier.do',
- method : 'POST',
- waitMsg : '正在保存数据,请稍候',
- waitTitle : '提交表单',
- success : function(form, action) {
- showResult(action.result.message);
- godownEntryWin.close();
- grid.dwrReload();
- },
- failure : function(form, action) {
- alert(action.result.message);
- }
- });
- }
- },{
- text : '打印新批次',
- hidden : commonEntry.isOpen() ? false:true,
- handler : function(){
- var ids = top.Ext.getCmp("id").getValue();
- godownEntryWin.close();
- grid.dwrReload();
- commonEntry.printGodownEntryNewBatch(ids);
- }
- },{
- text : '选择打印',
- handler : function() {
- if(!form.getForm().isValid()){
- showResult('请正确填写表单各值');
- return false;
- }
- var items = [];
- var records = top.Ext.getCmp('godownEntryItemGrid').getSelectionModel().getSelections();
- if (records.length == 0) {
- showResult("请选择要打印的一次性物品!");
- return false;
- }
-
- for ( var i = 0, len = records.length; i < len; i++) {
- if(isUndefinedOrNullOrEmpty(records[i].data.id)){
- showResult(records[i].data.name + "未保存!请先保存再打印");
- return false;
- }
- items.push(records[i].data);
- }
- top.Ext.getCmp("items").setValue(JSON.stringify(items));
- form.form.submit({
- url : WWWROOT + '/disinfectSystem/godownEntryAction!printSomeGodownEntryItem.do',
- method : 'POST',
- waitMsg : '正在保存数据,请稍候',
- waitTitle : '提交表单',
- success : function(form, action) {
- if(!isUndefinedOrNullOrEmpty(action.result.errorMessage)){
- showResult(action.result.errorMessage);
- return;
- }
- Ext.getCmp("formSubmitResult").setValue(formSubmitResultSucc);
- godownEntryWin.close();
- grid.dwrReload();
- //打印条码
- commonEntry.printBarcode(action.result.items,false);
-
- },
- failure : function(form, action) {
- showResult(action.failureType);
- Ext.getCmp("formSubmitResult").setValue(formSubmitResultFail);
- }
- });
- }
- },{
- text : '保存并打印新标签',
- hidden:saveButton || (commonEntry.isOpen() ? true:false),
- handler : function() {
- if(!form.getForm().isValid()){
- showResult('请正确填写表单各值');
- return false;
- }
- /*var name = top.Ext.getCmp('name1').getValue();
- if(name.length==0){
- showResult('请填写物品名称!');
- return false;
- }
- var count = top.Ext.getCmp('amount1').getValue();
- if(count.length==0){
- showResult('请填写物品数量!');
- return false;
- }
- var cost = top.Ext.getCmp('cost1').getValue();
- if(cost.length==0){
- showResult('请填写物品价格!');
- return false;
- }
- var batchNumber = top.Ext.getCmp('batchNumber1').getRawValue();
- if(batchNumber.length==0){
- showResult('请填写物品批次号!');
- return false;
- }*/
- var items = buildJSONStringFromStore(top.Ext.getCmp('godownEntryItemGrid').getStore());
- top.Ext.getCmp("items").setValue(items);
- // items为json数组字符串,不会为null
- if(items == '[]'){
- showResult('请正确填写表单各值');
- return false;
- }
- form.form.submit({
- url : WWWROOT + '/disinfectSystem/godownEntryAction!saveGodownEntry.do',
- method : 'POST',
- params : {print : true},
- waitMsg : '正在保存数据,请稍候',
- waitTitle : '提交表单',
- success : function(form, action) {
- Ext.getCmp("formSubmitResult").setValue(formSubmitResultSucc);
- //保存返回的结果
- entryItemJsonArray = action.result.items;
- showResult(action.result.message);
- godownEntryWin.close();
- grid.dwrReload();
-
- //打印条码
- commonEntry.printBarcode(entryItemJsonArray,true);
-
- },
- failure : function(form, action) {
- showResult(action.result.message);
- Ext.getCmp("formSubmitResult").setValue(formSubmitResultFail);
- }
- });
- }
- },{
- text : '保存',
- hidden:saveButton || (commonEntry.isOpen()?true:false),
- handler : function() {
- if(!form.getForm().isValid()){
- showResult('请正确填写表单各值');
- return false;
- }
- var name = top.Ext.getCmp('name1').getValue();
- /*if(name.length==0){
- showResult('请填写物品名称!');
- return false;
- }
- var count = top.Ext.getCmp('amount1').getValue();
- if(count.length==0){
- showResult('请填写物品数量!');
- return false;
- }
- var cost = top.Ext.getCmp('cost1').getValue();
- if(cost.length==0){
- showResult('请填写物品价格!');
- return false;
- }
- var batchNumber = top.Ext.getCmp('batchNumber1').getRawValue();
- if(batchNumber.length==0){
- showResult('请填写物品批次号!');
- return false;
- }*/
- //var items = buildJSONStringFromStore(top.Ext.getCmp('godownEntryItemGrid').getStore());
-// var store = top.Ext.getCmp('godownEntryItemGrid').getStore();
-// var len = store.getCount();
-// for (var i = 0; i < len; i++) {
-// var record = store.getAt(i);
-// var expDate = record.data.expDate;
-// //若是修改入库单失效日期则需要.format('Y-m-d')防止失效期不正确
-// expDate=expDate.format('Y-m-d');
-// store.getAt(i).set("expDate", expDate);
-// };
-// var items = buildJSONStringFromStore(store);
- var store = top.Ext.getCmp('godownEntryItemGrid').getStore();
- var len = store.getCount();
- var items = [];
- for (var i = 0; i < len; i++) {
- var record = store.getAt(i);
-// console.log(record);
- items.push({
- amount : record.data.amount,
- batchID : record.data.batchID,
- batchNumber : record.data.batchNumber,
- certification : record.data.certification ,
- cost : record.data.cost,
- disposableGoodsID : record.data.disposableGoodsID,
- expDate : record.data.expDate.format('Y-m-d'),
- grade : record.data.grade,
- hasBiologicalTestReport : record.data.hasBiologicalTestReport,
- hasInvoice : record.data.hasInvoice,
- id : record.data.id,
- identification : record.data.identification,
- identificationID : record.data.identificationID,
- localID: record.data.localID,
- manufacturer : record.data.manufacturer,
- name :record.data.name,
- producingArea : record.data.producingArea,
- sterileBatchNumber : record.data.sterileBatchNumber,
- supplierName : record.data.supplierName,
- supplierId : record.data.supplierId,
- manufacturerId : record.data.manufacturerId,
- qualifiedLabel : record.data.qualifiedLabel,
- qualifiedCheck : record.data.qualifiedCheck,
- totalPrice: record.data.totalPrice
- });
-// console.log(items);
- }
- // 设置表单参数json
- setFormParams(form,['id','remark','time','warehouseName','warehouseID']);
-// top.Ext.getCmp("items").setValue(items);
- top.Ext.getCmp("items").setValue(JSON.stringify(items));
- // items为json数组字符串,不会为null
- if(items.length == 0){
- showResult('请正确填写表单各值');
- return false;
- }
-// console.log(items);
- form.form.submit({
- url : WWWROOT + '/disinfectSystem/godownEntryAction!saveGodownEntry.do',
- method : 'POST',
- waitMsg : '正在保存数据,请稍候',
- waitTitle : '提交表单',
- success : function(form, action) {
- showResult(action.result.message);
- Ext.getCmp("formSubmitResult").setValue(formSubmitResultSucc);
- godownEntryWin.close();
- grid.dwrReload();
- var barcodeStr = action.result.barcode;
- var tableHtml = "";
- if(barcodeStr != null){
- var barcodeArray = barcodeStr.split(";");
- for(var i = 0;i < barcodeArray.length;i++){
- var items = barcodeArray[i].split("#&");
- var name = items[0];
- var barcode = items[2];
- var expDate = items[3];
- var supplierName = items[4];
- var batchNumber = items[5];
- var specification = items[6];
- tableHtml += "
名称 | 规格 | 批次 | 条码 | 失效期 |