Index: ssts-web/src/main/webapp/disinfectsystem/invoice/customInvoiceForm.jsp =================================================================== diff -u -r29513 -r41535 --- ssts-web/src/main/webapp/disinfectsystem/invoice/customInvoiceForm.jsp (.../customInvoiceForm.jsp) (revision 29513) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/customInvoiceForm.jsp (.../customInvoiceForm.jsp) (revision 41535) @@ -54,6 +54,7 @@ + Index: ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationInvoiceView.jsp =================================================================== diff -u -r37356 -r41535 --- ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationInvoiceView.jsp (.../operationReservationInvoiceView.jsp) (revision 37356) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationInvoiceView.jsp (.../operationReservationInvoiceView.jsp) (revision 41535) @@ -37,6 +37,7 @@ + Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.jsp =================================================================== diff -u -r40459 -r41535 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.jsp (.../invoicePlanExtractedView.jsp) (revision 40459) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.jsp (.../invoicePlanExtractedView.jsp) (revision 41535) @@ -175,7 +175,7 @@ - + Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js =================================================================== diff -u -r41520 -r41535 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js (.../invoicePlanExtractedForm.js) (revision 41520) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js (.../invoicePlanExtractedForm.js) (revision 41535) @@ -14,7 +14,6 @@ var isScanAmountEqualsAppAmountConfirmed = false; var EXPENSIVEGOODS_TYPE_NAME = '高值耗材'; var goodsInfo; -var sendOutAbnormalGoodsStore;//异常物品列表参数 var allBarcodeArr = [];//异常物品列表参数 var invoiceFormWindowTwo; var barcodeBtn; @@ -128,30 +127,6 @@ }); top.Ext.getCmp('sendOutGoodsSourceTree').show(); } -//异常物品列表删除选中的物品 -function removeSendOutAbnormalGoods(newBarcode) { - var rows = top.Ext.getCmp('sendOutAbnormalGoods').getSelectionModel().getSelections(); - if (newBarcode) { - rows = top.Ext.getCmp('sendOutAbnormalGoods').getStore().data.items; - } - if (rows && rows.length > 0) { - for (var i = 0; i < rows.length; i++) { - if (newBarcode) { - if (rows[i].data.barcode == newBarcode) { - sendOutAbnormalGoodsStore.remove(rows[i]); - return; - } - } else { - //DGSETYY-80:4.4在“异常物品列表”或“物品发货计划”列表中删除了相关的物品时,也需要实时将对应页面的物品进行删除 - if (sstsConfig.enableTraceableToussesShippedBackToTheOriginalApplyInfoFunction) { - removeSendOutGoods(rows[i].data.barcode); - } - sendOutAbnormalGoodsStore.remove(rows[i]); - return; - } - } - } -} //删除发货扫描的物品 function removeSendOutGoods(newBarcode) { //左边已扫物品的已选项 @@ -736,20 +711,6 @@ { name: 'tousseDefinitionId' } ]); -//异常物品列表 -var addAbnormalGridItem = Ext.data.Record.create([ - { name: 'id' }, - { name: 'barcode' }, - { name: 'name' }, - { name: 'appRecord' }, - { name: 'tousseFixedBarcode' }, - { name: 'showTousseName' }, - { name: 'status' }, - { name: 'depart' }, - { name: 'batchNumber' } -]); - - var AppGoodsItem = Ext.data.Record.create([ { name: 'showTousseName' }, { name: 'applicationAmount' }, @@ -801,26 +762,6 @@ } var barcodeToAppRecordMap = {}; var barcodeToScanGoodsMap = {}; -//异常物品列表 -function addAbnormalGoods(goods) { - var goodsName = goods.name; - var record = findRecordByGoodsVOFromRecyclingApplication(goods); - var add = true; - if (add) { - var newRecord = new addAbnormalGridItem({ - id: 0, - barcode: goods.barcode, - name: goods.name, - ttsName: goods.ttsName, - tousseFixedBarcode: goods.tousseFixedBarcode, - showTousseName: goods.showTousseName, - status: goods.status, - depart: goods.depart, - batchNumber: goods.batchNumber - }); - sendOutAbnormalGoodsStore.insert(0, newRecord); - } -} /** * 添加至已扫物品列表 @@ -1276,7 +1217,7 @@ }) } //扫描发货物品 -function loadGoodsByBarcode(orgUnitCoding,newBarcode) { +function loadGoodsByBarcode(orgUnitCoding, newBarcode) { var barcode = newBarcode || top.Ext.getCmp("scanText").getValue().Trim(); var barcodeEnd = top.Ext.getCmp("scanTextEnd").getValue().Trim(); var singleMode = true; @@ -1566,80 +1507,82 @@ var dataInfoWin; //GYSDERMYY-24:第三方器械包 -function loadTousseInstanceByBarcode(barcode,isThirdPartyTousse){ +function loadTousseInstanceByBarcode(barcode, isThirdPartyTousse) { Ext.Ajax.request({ url: WWWROOT + '/disinfectSystem/baseData/thirdPartyTousseReceiveRecordController/loadTousseInstanceByBarcode.mhtml', - params: { barcode: barcode, isThirdPartyTousse: isThirdPartyTousse}, + params: { barcode: barcode, isThirdPartyTousse: isThirdPartyTousse }, success: function (response, options) { var result = Ext.decode(response.responseText); - if(result.data){ + if (result.data) { top.Ext.getCmp('scanText').setValue(""); var orgUnitCoding = top.Ext.getCmp("orgUnitCoding").getValue(); - if(result.data.length > 0){ - if(result.data.length == 1){ - loadGoodsByBarcode(orgUnitCoding,result.data[0].barcode); - }else { + if (result.data.length > 0) { + if (result.data.length == 1) { + loadGoodsByBarcode(orgUnitCoding, result.data[0].barcode); + } else { showMultiDataInfoWin(result.data); } - }else { + } else { if (!barcodeBtn.processBarcode(barcode)) { loadGoodsByBarcode(orgUnitCoding); } } - }else { + } else { showResult(result.message); } } }); } //GYSDERMYY-24:显示多个第三方器械包 -function showMultiDataInfoWin(dataInfoArray){ +function showMultiDataInfoWin(dataInfoArray) { var dataInfoStore = new top.Ext.data.Store({ - data:dataInfoArray, - reader : new top.Ext.data.JsonReader({ - fields : [ - {name: 'barcode'}, - {name: 'thirdPartyBarcode'}, - {name: 'tousseName'} + data: dataInfoArray, + reader: new top.Ext.data.JsonReader({ + fields: [ + { name: 'barcode' }, + { name: 'thirdPartyBarcode' }, + { name: 'tousseName' } ] }) }); var dataInfoGrid = new top.Ext.grid.GridPanel({ - store:dataInfoStore, + store: dataInfoStore, columns: [ - {header: "器械包名称", width: 130, dataIndex: 'tousseName'}, - {header: "条码", width: 80,dataIndex: 'barcode'}, - {header: "第三方条码", width: 80,dataIndex: 'thirdPartyBarcode'}, - {header: "操作", width: 70,dataIndex: 'id',renderer : function(v, p, record){ - var barcode = record.data.barcode; - return "选择"; - }} + { header: "器械包名称", width: 130, dataIndex: 'tousseName' }, + { header: "条码", width: 80, dataIndex: 'barcode' }, + { header: "第三方条码", width: 80, dataIndex: 'thirdPartyBarcode' }, + { + header: "操作", width: 70, dataIndex: 'id', renderer: function (v, p, record) { + var barcode = record.data.barcode; + return "选择"; + } + } ], stripeRows: true, viewConfig: { - forceFit:true + forceFit: true }, - height:200, - width:600 + height: 200, + width: 600 }); dataInfoWin = new top.Ext.Window({ - autoHeight:true, - title : '器械包选择', - width:615, - draggable:true, - modal:true, - closeAction:'close', - items:[dataInfoGrid] - }); - dataInfoWin.show(); + autoHeight: true, + title: '器械包选择', + width: 615, + draggable: true, + modal: true, + closeAction: 'close', + items: [dataInfoGrid] + }); + dataInfoWin.show(); } //GYSDERMYY-24:选择第三方器械包 -function getdataInfo(barcode){ +function getdataInfo(barcode) { if (!barcodeBtn.processBarcode(barcode)) { var orgUnitCoding = top.Ext.getCmp("orgUnitCoding").getValue(); - loadGoodsByBarcode(orgUnitCoding,barcode); + loadGoodsByBarcode(orgUnitCoding, barcode); dataInfoWin.close(); } } @@ -1830,9 +1773,9 @@ } //GZFDZL-157:显示查询周期 -function showQueryTime(tousseDefinitionID,rowIndex){ +function showQueryTime(tousseDefinitionID, rowIndex) { var form = new top.Ext4.Panel({ - id:'configForm', + id: 'configForm', region: 'north', buttonAlign: 'center', border: 0, @@ -1845,14 +1788,14 @@ }, items: [{ layout: 'column', - border:0, - style:'background:none', + border: 0, + style: 'background:none', items: [{ layout: 'form', columnWidth: 0.18, border: 0, style: 'margin-bottom:10px', - height:21, + height: 21, items: [{ xtype: 'displayfield', fieldLabel: '查询周期', @@ -1894,7 +1837,7 @@ allowBlank: false, anchor: '95%' }] - },{ + }, { layout: 'form', columnWidth: 0.18, border: 0, @@ -1906,7 +1849,7 @@ labelAlign: 'right', anchor: '100%' }] - },{ + }, { layout: 'form', columnWidth: 0.15, border: 0, @@ -1921,7 +1864,7 @@ top.Ext4.getCmp('endDate').setRawValue(endDate); } }] - },{ + }, { layout: 'form', columnWidth: 0.15, border: 0, @@ -1936,7 +1879,7 @@ top.Ext4.getCmp('endDate').setRawValue(endDate); } }] - },{ + }, { layout: 'form', columnWidth: 0.15, border: 0, @@ -1959,13 +1902,13 @@ handler: function () { var startDate = top.Ext4.getCmp('startDate').getRawValue(); var endDate = top.Ext4.getCmp('endDate').getRawValue(); - if(startDate || endDate){ - if(!compareDate(startDate,endDate)){ + if (startDate || endDate) { + if (!compareDate(startDate, endDate)) { showResult("开始时间不能大于结束时间"); return; } } - getDisposableGoodsUseAmountByDiposableGoodsIds(startDate,endDate,tousseDefinitionID,rowIndex); + getDisposableGoodsUseAmountByDiposableGoodsIds(startDate, endDate, tousseDefinitionID, rowIndex); } }, { xtype: 'button', @@ -1980,49 +1923,49 @@ }); var window = new top.Ext4.Window({ - id:'queryTime', - autoHeight:true, - title : '查询周期设置', - width:600, - draggable:true, - modal:true, + id: 'queryTime', + autoHeight: true, + title: '查询周期设置', + width: 600, + draggable: true, + modal: true, items: [form] - }); + }); window.show(); - var startDate = getDefaultDate(newDate,1) + dayStartTime; + var startDate = getDefaultDate(newDate, 1) + dayStartTime; var endDate = getDefaultDate(newDate) + dayStartTime; top.Ext4.getCmp('startDate').setRawValue(startDate); top.Ext4.getCmp('endDate').setRawValue(endDate); } //GZFDZL-157:获取历史使用量 -function getDisposableGoodsUseAmountByDiposableGoodsIds(startDate,endDate,tousseDefinitionID,rowIndex){ +function getDisposableGoodsUseAmountByDiposableGoodsIds(startDate, endDate, tousseDefinitionID, rowIndex) { var departCode = top.Ext.getCmp("orgUnitCoding").getValue(); - if(departCode == ''){ + if (departCode == '') { showResult('请选择申请科室'); return } var params = { - departCode:departCode, - startDate:startDate, - endDate:endDate, - diposableGoodsIds:tousseDefinitionID + departCode: departCode, + startDate: startDate, + endDate: endDate, + diposableGoodsIds: tousseDefinitionID } Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/diposablegoods/disposableGoodsController/getDisposableGoodsUseAmountByDiposableGoodsIds.mhtml', - params : params, - success : function(response, options) { - var result = Ext.util.JSON.decode(response.responseText); - if(result.success){ - if(result.rows.length > 0){ + url: WWWROOT + '/disinfectSystem/diposablegoods/disposableGoodsController/getDisposableGoodsUseAmountByDiposableGoodsIds.mhtml', + params: params, + success: function (response, options) { + var result = Ext.util.JSON.decode(response.responseText); + if (result.success) { + if (result.rows.length > 0) { var record = recyclingapplicationStore1.getAt(rowIndex); - record.set('useAmount',result.rows[0].useAmount); + record.set('useAmount', result.rows[0].useAmount); top.Ext4.getCmp('queryTime').close(); - }else { + } else { showResult('查询不到数据'); } - }else { + } else { showResult(result.message); } } @@ -2046,22 +1989,6 @@ invoicePlanFormOpened = true; lastLoadWarehouseId = null; defaultFocusedFieldOnInvoiceForm = getStrValueFromJs('sstsConfig.defaultFocusedFieldOnInvoiceForm', defaultFocusedFieldOnInvoiceForm); - //异常物品列表--Ext.data.Store - sendOutAbnormalGoodsStore = new Ext.data.Store({ - reader: new Ext.data.JsonReader({ - fields: [ - { name: 'id' }, - { name: 'barcode' }, - { name: 'name' }, - { name: 'ttsName' }, - { name: 'appRecord' }, - { name: 'showTousseName' }, - { name: 'status' }, - { name: 'depart' }, - { name: 'batchNumber' } - ] - }) - }); // 发货物品 sendOutGoodsStore1 = new Ext.data.Store({ reader: new Ext.data.JsonReader({ @@ -2264,35 +2191,35 @@ } else { top.Ext.getCmp('btnBatchScanDisposableGoods').setVisible(false); } - - if(top.Ext.getCmp('orgUnitCoding').getValue() !== '' && ids.length > 0 && sstsConfig.enableTheHistoricalUsageStatisticsFeature){ + + if (top.Ext.getCmp('orgUnitCoding').getValue() !== '' && ids.length > 0 && sstsConfig.enableTheHistoricalUsageStatisticsFeature) { var startDate = getDefaultDate(newDate, 1) + dayStartTime; var endDate = getDefaultDate(newDate) + dayStartTime; var params = { - departCode:top.Ext.getCmp('orgUnitCoding').getValue(), - startDate:startDate, - endDate:endDate, - diposableGoodsIds:ids.join(',') + departCode: top.Ext.getCmp('orgUnitCoding').getValue(), + startDate: startDate, + endDate: endDate, + diposableGoodsIds: ids.join(',') } Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/diposablegoods/disposableGoodsController/getDisposableGoodsUseAmountByDiposableGoodsIds.mhtml', - params : params, - success : function(response, options) { - var res = Ext.util.JSON.decode(response.responseText); - if(res.success){ - if(res.rows.length > 0){ - for(var z=0;z 0) { + for (var z = 0; z < res.rows.length; z++) { + for (var k = 0; k < recyclingapplicationStore1.getCount(); k++) { + if (res.rows[z].diposableGoodsId == recyclingapplicationStore1.getAt(k).data.disposableGoodsId) { + recyclingapplicationStore1.getAt(k).set('useAmount', res.rows[z].useAmount); } } } - }else { + } else { showResult('查询不到历史使用量'); } - }else { + } else { showResult(result.message); } } @@ -2333,15 +2260,15 @@ } }, { - header: "历史使用量", dataIndex: 'useAmount', align: 'center', width: 90, menuDisabled: true,hidden:!sstsConfig.enableTheHistoricalUsageStatisticsFeature, renderer: function (v, p, record, rowIndex) { + header: "历史使用量", dataIndex: 'useAmount', align: 'center', width: 90, menuDisabled: true, hidden: !sstsConfig.enableTheHistoricalUsageStatisticsFeature, renderer: function (v, p, record, rowIndex) { var disposableGoodsId = record.data.disposableGoodsId; - if(disposableGoodsId !== '' && disposableGoodsId !== 0){ + if (disposableGoodsId !== '' && disposableGoodsId !== 0) { var html = '
'; - html += '
'+ (v || '') +'
' - html += '
' + html += '
' + (v || '') + '
' + html += '
' html += '
'; return html; - }else { + } else { return '
'; } @@ -2387,23 +2314,6 @@ { header: "缺失数量", dataIndex: 'count', width: 60, menuDisabled: true }, { header: '单价', id: 'price', dataIndex: 'price', width: 60, value: 0, menuDisabled: true } ]); - //异常物品列表字段 - var abnormalCm = new Ext.grid.ColumnModel([ - { header: "条码", dataIndex: 'barcode', width: 80, menuDisabled: true }, - { header: "物品名称", dataIndex: 'showTousseName', width: 100, menuDisabled: true }, - { - id: 'deleteItem', header: '删除', width: 15, align: 'center', menuDisabled: true, - renderer: function (v, p, record) { - var str = ""; - return str; - }, - dataIndex: 'button' - }, - { header: "包状态", dataIndex: 'status', width: 80, menuDisabled: true }, - { header: "回收科室", dataIndex: 'depart', width: 125, menuDisabled: true }, - { header: "name", dataIndex: 'name', hidden: true, menuDisabled: true }, - { header: "批次/灭菌日期", dataIndex: 'batchNumber', width: 110, menuDisabled: true } - ]); var sendOutGoodsColumnModel = new Ext.grid.ColumnModel([ { header: "条码", dataIndex: 'barcode', align: 'center', width: 72, menuDisabled: true, @@ -2462,10 +2372,6 @@ ] }); - //申请物品 - var invoicePlan_recyclingapplicationStore = new Ext.data.Store({ - reader: invoicePlan_rd - }); //申请物品(新加了一个带1的store,之前应该是受到待发物品的重名影响,会报未定义) var invoicePlan_recyclingapplicationStore1 = new Ext.data.Store({ reader: invoicePlan_rd @@ -2521,7 +2427,7 @@ isScanAmountEqualsAppAmountConfirmed = false; getTousseGridData1(); var signStorageLocationId = ''; - if(sstsConfig.enableDesignatedWarehouseReceiving){ + if (sstsConfig.enableDesignatedWarehouseReceiving) { signStorageLocationId = top.Ext.getCmp("storageLocationName").getValue() } form.form.submit({ @@ -2545,12 +2451,14 @@ for (var k = 0; k < result.resultData.length; k++) { if (result.resultData[k].barcode == barcode) { showMultipleResult(result.resultData[k].invoiceFailReason); - var doc = documentGetElementsByClassName('x-grid3-body',top.document.getElementById('sendOutGoods'))[0]; - documentGetElementsByClassName('x-grid3-row',doc)[i].style.backgroundColor = 'red'; + var doc = documentGetElementsByClassName('x-grid3-body', top.document.getElementById('sendOutGoods'))[0]; + documentGetElementsByClassName('x-grid3-row', doc)[i].style.backgroundColor = 'red'; if (sstsConfig.isUseAbnormalGoodsTable) { //加入异常物品列表 addAbnormalGoods(tousseInstancesBelongToThisComboTousse[j]); - top.Ext.getCmp('invoicePlan_recyclingApplicationForm').expand(); + if (!sstsConfig.enableAbnormalItemListFixedDisplay) { + top.Ext.getCmp('invoicePlan_recyclingApplicationForm').expand(); + } top.Ext.getCmp('tabpanel').activeTab = 1; top.Ext.getCmp('tabpanel').render(); } @@ -2562,12 +2470,14 @@ for (var k = 0; k < result.resultData.length; k++) { if (result.resultData[k].barcode == barcode) { showMultipleResult(result.resultData[k].invoiceFailReason); - var doc = documentGetElementsByClassName('x-grid3-body',top.document.getElementById('sendOutGoods'))[0]; - documentGetElementsByClassName('x-grid3-row',doc)[i].style.backgroundColor = 'red'; + var doc = documentGetElementsByClassName('x-grid3-body', top.document.getElementById('sendOutGoods'))[0]; + documentGetElementsByClassName('x-grid3-row', doc)[i].style.backgroundColor = 'red'; if (sstsConfig.isUseAbnormalGoodsTable) { //加入异常物品列表 addAbnormalGoods(record.data); - top.Ext.getCmp('invoicePlan_recyclingApplicationForm').expand(); + if (!sstsConfig.enableAbnormalItemListFixedDisplay) { + top.Ext.getCmp('invoicePlan_recyclingApplicationForm').expand(); + } top.Ext.getCmp('tabpanel').activeTab = 1; top.Ext.getCmp('tabpanel').render(); } @@ -3164,15 +3074,15 @@ if (e.getKey() == 13) {// 输入;号键,grid重新加载 var scanText = top.Ext.getCmp("scanText").getValue(); if (scanText != '') { - if(sstsConfig.enbaleThirdPartyTousseManagementFunction){ + if (sstsConfig.enbaleThirdPartyTousseManagementFunction) { var barcode = scanText; var isThirdPartyTousse = '否'; - if(scanText.indexOf('@@') >= 0){ + if (scanText.indexOf('@@') >= 0) { barcode = scanText.split('@@')[0]; isThirdPartyTousse = '是'; } - loadTousseInstanceByBarcode(barcode,isThirdPartyTousse); - }else { + loadTousseInstanceByBarcode(barcode, isThirdPartyTousse); + } else { if (!barcodeBtn.processBarcode(scanText)) { loadGoodsByBarcode(orgUnitCoding); } @@ -3431,15 +3341,15 @@ recalcDisposableGoodsAmount(name); } }, - render : function() { - if(sstsConfig.enableDesignatedWarehouseReceiving){ + render: function () { + if (sstsConfig.enableDesignatedWarehouseReceiving) { var orgUnitCoding = top.Ext.getCmp('orgUnitCoding').getValue() var warseHouseStore = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: WWWROOT + '/disinfectSystem/baseData/storageLocationAction!searchStorageLocationByKeyword.do', method: 'POST' }), - baseParams: { orgUnitCode: orgUnitCoding,searchLeafStorageLocation:true }, + baseParams: { orgUnitCode: orgUnitCoding, searchLeafStorageLocation: true }, reader: new Ext.data.JsonReader({ totalProperty: 'totalCount', root: 'data' @@ -3450,9 +3360,9 @@ ]) }) var tbar = new top.Ext.Toolbar({ - items :[{ - text : '签收库房:' - },{ + items: [{ + text: '签收库房:' + }, { xtype: 'combo', id: 'storageLocationName', name: 'storageLocationName', @@ -3461,7 +3371,7 @@ valueField: 'id', displayField: 'storageLocationPath', anchor: '95%', - width:500, + width: 500, store: warseHouseStore, forceSelection: true, lazyInit: true, @@ -3471,7 +3381,7 @@ listWidth: 400 }] }); - tbar.render(this.tbar); + tbar.render(this.tbar); } } } @@ -3497,8 +3407,9 @@ showResult('请先选择申请单!', null, sstsConfig.messagePauseTimeOnInvoiceplanPage); return; } - var w = top.Ext.getCmp('invoicePlan_recyclingApplicationForm'); - w.expand(); + if (!sstsConfig.enableAbnormalItemListFixedDisplay) { + top.Ext.getCmp('invoicePlan_recyclingApplicationForm').expand(); + } } }, { xtype: 'combo', @@ -3544,8 +3455,6 @@ params: { id: selectedInvoicePlanId }, success: function (response, options) { var obj = JSON.parse(response.responseText); - // openInvoicePlanWindow(obj); - // top.Ext.getCmp('invoicePlan_recyclingApplicationForm').show(); top.Ext.getCmp('invoicePlan_applicant').setValue(obj.applicant); top.Ext.getCmp('invoicePlan_applicationTime').setValue(obj.applicationTime); @@ -3601,7 +3510,51 @@ } })] }] - }], + }] + }); + + // 发货员 + var cookieSender = Ext.state.Manager.getProvider().get('cookieSender'); + if (getSystemSetConfig('rememberLastInvoiceSender', false) && cookieSender) { + top.Ext.getCmp('sender').setValue(cookieSender); + } + // 核对员 + var cookieAssistantSender = Ext.state.Manager.getProvider().get('cookieAssistantSender'); + if (getSystemSetConfig('rememberLastInvoiceAssistantSender', false) && cookieAssistantSender) { + top.Ext.getCmp('assistantSender').setValue(cookieAssistantSender); + } + var cookiePersonInCharge = Ext.state.Manager.getProvider().get('cookiePersonInCharge'); + var cookiePersonInChargeCode = Ext.state.Manager.getProvider().get('cookiePersonInChargeCode'); + var rememberLastInvoicePersonInCharge = getSystemSetConfig('rememberLastInvoicePersonInCharge', false); + if (rememberLastInvoicePersonInCharge) { + if (cookiePersonInCharge) { + top.Ext.getCmp('personInCharge').setValue(cookiePersonInCharge); + } + if (cookiePersonInChargeCode) { + top.Ext.getCmp('personInChargeCode').setValue(cookiePersonInChargeCode); + } + } + + var enableAbnormalItemListFixedDisplay = sstsConfig.enableAbnormalItemListFixedDisplay || false; + var invoicePlan_form = renderRecyclingApplicationForm(); + var winWidth = recyclingApplicationWinWidth; + if (enableAbnormalItemListFixedDisplay && sstsConfig.isUseAbnormalGoodsTable) { + winWidth = recyclingApplicationWinWidth + 590; + } + + invoiceFormWindowTwo = new top.Ext.Window({ + id: 'recyclingApplicationWin', + layout: 'border', + title: '科室发货计划', + resizable: false, + width: winWidth, + height: recyclingApplicationWinHeight, + border: false, + modal: true, + plain: true, + stateful: false, + items: [form, invoicePlan_form], + buttonAlign: 'center', buttons: [{ text: sstsConfig.aliasNameOfSaveKeywordInInvoiceForm ? sstsConfig.aliasNameOfSaveKeywordInInvoiceForm : '保存', id: 'saveButton', @@ -3643,262 +3596,12 @@ disabled: true, handler: function () { top.Ext.getCmp("recyclingApplicationWin").hide(); - openCanInvoiceTousseListForm(orgUnitCoding, depart, invoicePlanId,getWaitInvoiceGoodsGridData()); + openCanInvoiceTousseListForm(orgUnitCoding, depart, invoicePlanId, getWaitInvoiceGoodsGridData()); } }] }); - // Ext.Ajax.request({ - // url : WWWROOT + '/disinfectSystem/invoicePlanAction!loadDepartApplicationInfo.do', - // params : {orgUnitCoding : orgUnitCoding}, - // success : function(response, options) { - // var result = Ext.decode(response.responseText); - // var remark = result.remark; - // top.Ext.getCmp('remark2').setValue(remark); - // }, - // failure : function(form, action) { - // } - // }); - // 发货员 - var cookieSender = Ext.state.Manager.getProvider().get('cookieSender'); - if (getSystemSetConfig('rememberLastInvoiceSender', false) && cookieSender) { - top.Ext.getCmp('sender').setValue(cookieSender); - } - // 核对员 - var cookieAssistantSender = Ext.state.Manager.getProvider().get('cookieAssistantSender'); - if (getSystemSetConfig('rememberLastInvoiceAssistantSender', false) && cookieAssistantSender) { - top.Ext.getCmp('assistantSender').setValue(cookieAssistantSender); - } - var cookiePersonInCharge = Ext.state.Manager.getProvider().get('cookiePersonInCharge'); - var cookiePersonInChargeCode = Ext.state.Manager.getProvider().get('cookiePersonInChargeCode'); - var rememberLastInvoicePersonInCharge = getSystemSetConfig('rememberLastInvoicePersonInCharge', false); - if (rememberLastInvoicePersonInCharge) { - if (cookiePersonInCharge) { - top.Ext.getCmp('personInCharge').setValue(cookiePersonInCharge); - } - if (cookiePersonInChargeCode) { - top.Ext.getCmp('personInChargeCode').setValue(cookiePersonInChargeCode); - } - } - ///// - - // recyclingapplicationStore1.removeAll(); - // recyclingapplicationStore1.load(); - - var invoicePlan_recyclingapplicationCm = new Ext.grid.ColumnModel([ - { header: "申请的物品", dataIndex: 'showTousseName', width: 180, menuDisabled: true }, - { header: "数量", dataIndex: 'applicationAmount', width: 50, menuDisabled: true }, - { header: "已发", dataIndex: 'sendAmount', width: 50, menuDisabled: true }, - { header: "待发", dataIndex: 'count', width: 50, menuDisabled: true } - ]); - - - //异常物品列表Panel面板 - var sendOutAbnormalGoods_form = new top.Ext.Panel({ - id: 'sendOutAbnormalGoodsWin', - frame: true, - columnWidth: .20, - labelSeparator: ':', - bodyStyle: 'padding:5px 5px 0px 5px', - width: 590, - height: 480, - autoScroll: true, - labelAlign: 'right', - layout: 'form', - items: [ - new top.Ext.grid.EditorGridPanel({ - id: 'sendOutAbnormalGoods', - store: sendOutAbnormalGoodsStore, - style: 'padding:0px', - autoHeight: true, - columnWidth: 0.5, - cm: abnormalCm, - width: 580, - height: 425, - autoExpandColumn: 'deleteItem', - enableHdMenu: false, - frame: false, - bodyStyle: 'border:1px solid #afd7af', - viewConfig: { - autoFit: true - }, - clicksToEdit: 1,// 设置点击几次才可编辑 - selModel: new top.Ext.grid.RowSelectionModel({ - singleSelect: false - }), - tbar: [{ - text: '删除所有异常物品', - hidden: !sstsConfig.showButtonOfDeleteAllAbnormalGoods, - iconCls: 'btn_ext_application_del', - handler: function () { - sendOutAbnormalGoodsStore.removeAll(); - } - }] - }) - ] - }); - - var invoicePlan_form = new top.Ext.FormPanel({ - id: 'invoicePlan_recyclingApplicationForm', - frame: true, - region: 'east', - columnWidth: .20, - labelSeparator: ':', - bodyStyle: 'padding:5px 5px 0px 5px', - width: 590, - height: 580, - autoScroll: true, - labelAlign: 'right', - collapsible: true, - stateful: false, - collapsed: true, - title: '申请单信息', - layout: 'form', - items: [ - { - xtype: 'tabpanel', - id: 'tabpanel', - activeTab: 0, - autoHeight: true, - deferredRender: false, - items: [ - { - title: '申请单信息', - itemId: 'sq', - autoHeight: true, - items: [ - { - xtype: "fieldset", - title: "基础数据", - layout: 'column', - style: 'padding:0px', - autoHeight: true, - items: [{ - layout: 'column', - columnWidth: 1, - items: [{ - layout: 'form', - labelWidth: 100, - columnWidth: 1, - items: [{ - xtype: 'textfield', - fieldLabel: '申请时间', - maxLength: '100', - id: 'invoicePlan_applicationTime', - name: 'invoicePlan_applicationTime', - // value : depart, - readOnly: true, - anchor: '99%', - cls: 'fieldReadOnlyNoRemove' - }] - }, { - layout: 'form', - labelWidth: 100, - columnWidth: 1, - items: [{ - xtype: 'textfield', - fieldLabel: '回收时间', - maxLength: '41', - id: 'invoicePlan_recyclingTime', - name: 'invoicePlan_recyclingTime', - readOnly: true, - // allowBlank : false, - anchor: '99%', - // value:$Id('userName').value, - cls: 'fieldReadOnlyNoRemove' - }] - }, { - layout: 'form', - labelWidth: 100, - columnWidth: 1, - items: [{ - xtype: 'textfield', - fieldLabel: '回收状态', - maxLength: '41', - id: 'invoicePlan_recyclingStatus', - name: 'invoicePlan_recyclingStatus', - readOnly: true, - // allowBlank : false, - anchor: '99%', - // value:$Id('userName').value, - cls: 'fieldReadOnlyNoRemove' - }] - }, { - layout: 'form', - labelWidth: 100, - columnWidth: 1, - items: [{ - xtype: 'textfield', - fieldLabel: '申请人', - maxLength: '41', - id: 'invoicePlan_applicant', - name: 'invoicePlan_applicant', - readOnly: true, - //allowBlank : false, - anchor: '99%', - //value:$Id('userName').value, - cls: 'fieldReadOnlyNoRemove' - }] - }] - }] - }, { - layout: 'column', - items: [{ - layout: 'form', - columnWidth: 0.99, - items: [new top.Ext.grid.EditorGridPanel({ - id: 'invoicePlan_appGoodsDetail', - title: '物品明细', - store: invoicePlan_recyclingapplicationStore, - cm: invoicePlan_recyclingapplicationCm, - enableHdMenu: false, - width: 590, - height: 425, - loadMask: true, - autoExpandColumn: 'deleteItem', - frame: false, - bodyStyle: 'padding:0px;border:1px solid #afd7af', - viewConfig: { - forceFit: true - }, - selModel: new top.Ext.grid.RowSelectionModel({ - singleSelect: false - }), - listeners: { - validateedit: function (o) { - } - } - })] - }] - } - ] - }, { - title: '异常物品列表', - itemId: 'yc', - autoHeight: true, - items: [sendOutAbnormalGoods_form] - } - ] - } - ] - }); - - invoiceFormWindowTwo = new top.Ext.Window({ - id: 'recyclingApplicationWin', - layout: 'border', - title: '科室发货计划', - resizable: false, - width: recyclingApplicationWinWidth, - height: recyclingApplicationWinHeight, - border: false, - modal: true, - plain: true, - stateful: false, - items: [form, invoicePlan_form] - }); - - invoiceFormWindowTwo.on('close', function (w) { //切记注意:按取消关闭window后,一定要把已选择的申请单号变量清空 selectedInvoicePlanId = ""; @@ -3964,18 +3667,7 @@ postInitDataTimer = setInterval("postInitData()", 500); } } -// 打开申请单信息 -function openInvoicePlanWindow(invoicePlanId) { - var recyclingApplicationWin = top.Ext.getCmp('recyclingApplicationWin'); - var invoicePlan_recyclingApplicationForm = top.Ext.getCmp('invoicePlan_recyclingApplicationForm'); - if (invoicePlan_recyclingApplicationForm) { - recyclingApplicationWin.remove(invoicePlan_recyclingApplicationForm); - return; - } - recyclingApplicationWin.add(invoicePlan_form); -} - function postInitData() { // alert('wareHouseStoreLoaded='+wareHouseStoreLoaded+',recyclingapplicationStoreLoaded='+recyclingapplicationStoreLoaded) if (!wareHouseStoreLoaded || !recyclingapplicationStoreLoaded) { Index: ssts-web/src/main/webapp/disinfectsystem/invoice/customInvoiceForm.js =================================================================== diff -u -r40302 -r41535 --- ssts-web/src/main/webapp/disinfectsystem/invoice/customInvoiceForm.js (.../customInvoiceForm.js) (revision 40302) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/customInvoiceForm.js (.../customInvoiceForm.js) (revision 41535) @@ -14,43 +14,43 @@ //申请科室Store var appDepartJsonStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do?showDisableOrgUnit=false&dataIsolationModule='+dataIsolationModule, - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do?showDisableOrgUnit=false&dataIsolationModule=' + dataIsolationModule, + method: 'POST' }), - reader : new Ext.data.JsonReader({ - root : 'data' - },[ - {name : 'id',mapping : 'id'}, - {name : 'departCode',mapping : 'departCode'}, - {name : 'name',mapping : 'name'} - ] + reader: new Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'id', mapping: 'id' }, + { name: 'departCode', mapping: 'departCode' }, + { name: 'name', mapping: 'name' } + ] ) }); var wareHouseStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/wareHouseAction!getWareHouseData.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/wareHouseAction!getWareHouseData.do', + method: 'POST' }), - reader : new Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' + reader: new Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' }, [ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'}, - {name : 'orgUnitCode',mapping : 'orgUnitCode'}, + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' }, + { name: 'orgUnitCode', mapping: 'orgUnitCode' }, ]), - listeners : { - load : function(store,records) { + listeners: { + load: function (store, records) { var id = top.Ext.getCmp('sourceWarehouseId').getValue(); //var name = top.Ext.getCmp('sourceWarehouseName').getValue(); - if(records.length > 0 && (id == null || id == '')){ + if (records.length > 0 && (id == null || id == '')) { //id=records[0].data.id; //name = records[0].data.name; var combo = top.Ext.getCmp("warehouse"); // 触发选中事件 - combo.fireEvent('select', combo,records[0],0); + combo.fireEvent('select', combo, records[0], 0); } //top.Ext.getCmp('warehouse').setValue(id); //top.Ext.getCmp('sourceWarehouseId').setValue(id); @@ -59,44 +59,44 @@ } }); -if(sstsConfig.disableLoadToVirtualBasket == false){ +if (sstsConfig.disableLoadToVirtualBasket == false) { beginBarcodeLabel = '条码/篮筐(首):'; hiddenEndBarcode = false;//显示尾篮筐 } //条码扫描模式(单个条码逐个扫描或首尾条码段扫描两种模式) var currentScanMode = "single"; -if(sstsConfig.invoicePageScanMode && sstsConfig.invoicePageScanMode != null){ +if (sstsConfig.invoicePageScanMode && sstsConfig.invoicePageScanMode != null) { currentScanMode = sstsConfig.invoicePageScanMode; } -function getDefaultAmount(v,p,record){ - if (v==null || v.length <= 0){ +function getDefaultAmount(v, p, record) { + if (v == null || v.length <= 0) { return 0; - }else{ - return v; + } else { + return v; } } -function formatStorage(v,p,record){ - if (v==null || v.length <= 0){ +function formatStorage(v, p, record) { + if (v == null || v.length <= 0) { return ''; - }else{ - return v; + } else { + return v; } } -function sayGoods(record){ - if(record && record.data){ +function sayGoods(record) { + if (record && record.data) { speaker.speak(record.data.showTousseName + ",数量为" + record.data.count); } } //删除发货扫描的物品 -function removeSendOutGoods(id){ +function removeSendOutGoods(id) { var rows = top.Ext.getCmp('sendOutGoods').getSelectionModel().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']; + var amount = rows[i].data['count']; sendOutGoodsStore.remove(rows[i]); refreshSumInfo(); sendDeleteScannedGoodsLog(rows[i].data); @@ -105,67 +105,67 @@ } // 刷新汇总信息 -function refreshSumInfo(){ +function refreshSumInfo() { var map = {}; var submitItems = []; recyclingapplicationStore.removeAll(); - for ( var i = 0; i < sendOutGoodsStore.getCount(); i++) { + for (var i = 0; i < sendOutGoodsStore.getCount(); i++) { var scanItem = sendOutGoodsStore.getAt(i).data; var showTousseName = scanItem.showTousseName; var amount = scanItem.count; var fluctuationPrice = parseFloat(scanItem.fluctuationPrice); var item = map[showTousseName]; - if(item){ -// item.fluctuationPrice += fluctuationPrice; + if (item) { + // item.fluctuationPrice += fluctuationPrice; item.itemTotalFluctuationPrice += fluctuationPrice; item.amount += amount; - }else{ + } else { item = { - showTousseName:showTousseName, - fluctuationPrice:fluctuationPrice, - itemTotalFluctuationPrice:fluctuationPrice, - amount:amount + showTousseName: showTousseName, + fluctuationPrice: fluctuationPrice, + itemTotalFluctuationPrice: fluctuationPrice, + amount: amount } map[showTousseName] = item; } } var totalFluctuationPrice = 0; var totalAmount = 0; - for( var showTousseName in map ){ - if(map.hasOwnProperty(showTousseName)){ + for (var showTousseName in map) { + if (map.hasOwnProperty(showTousseName)) { var item = map[showTousseName]; - totalFluctuationPrice += item.itemTotalFluctuationPrice ; + totalFluctuationPrice += item.itemTotalFluctuationPrice; totalAmount += item.amount; - item.fluctuationPrice = Ext.util.Format.usMoney(item.itemTotalFluctuationPrice/item.amount); + item.fluctuationPrice = Ext.util.Format.usMoney(item.itemTotalFluctuationPrice / item.amount); var record = new SumGridItem(item); - recyclingapplicationStore.insert(0,record); + recyclingapplicationStore.insert(0, record); } } - top.Ext.getCmp('sum_price').setText("总价:"+Ext.util.Format.usMoney(totalFluctuationPrice)); - top.Ext.getCmp('sum_amount').setText("数量:"+totalAmount); + top.Ext.getCmp('sum_price').setText("总价:" + Ext.util.Format.usMoney(totalFluctuationPrice)); + top.Ext.getCmp('sum_amount').setText("数量:" + totalAmount); } //删除发货明细项 -function removeSendOutTousseByBarcode(barcode){ - var record = findRecordByNameAndValueFromStore(sendOutGoodsStore,'barcode',barcode); - if(record != null){ +function removeSendOutTousseByBarcode(barcode) { + var record = findRecordByNameAndValueFromStore(sendOutGoodsStore, 'barcode', barcode); + if (record != null) { var name = record.data['name']; - sendOutGoodsStore.remove(record); - - refreshSumInfo(); + sendOutGoodsStore.remove(record); + + refreshSumInfo(); } } //验证条码是否重复扫描 -function isBarcodeRepeat(barcode){ - if(barcode != null && barcode.length > 0){ - for ( var i = 0; i < sendOutGoodsStore.getCount(); i++) { - var record = sendOutGoodsStore.getAt(i); - var tempBarcode =record.get('barcode'); - if(barcode == tempBarcode){ - return true; - break; - } +function isBarcodeRepeat(barcode) { + if (barcode != null && barcode.length > 0) { + for (var i = 0; i < sendOutGoodsStore.getCount(); i++) { + var record = sendOutGoodsStore.getAt(i); + var tempBarcode = record.get('barcode'); + if (barcode == tempBarcode) { + return true; + break; + } } } return false; @@ -175,242 +175,242 @@ function validGridAmount() { //申请的物品 var b = true; - for ( var i = 0; i < sendOutGoodsStore.getCount(); i++) { - var record = sendOutGoodsStore.getAt(i); - var count =record.get('count'); - if(/[^0-9]/g.test(count)){ - showResult('['+record.get('name')+'] 申请数量必须是数字,保存失败!'); - top.Ext.getCmp('sendOutGoods').getView().getRow(i).style.backgroundColor = '#FFB5B5'; - b = false; - break; - } + for (var i = 0; i < sendOutGoodsStore.getCount(); i++) { + var record = sendOutGoodsStore.getAt(i); + var count = record.get('count'); + if (/[^0-9]/g.test(count)) { + showResult('[' + record.get('name') + '] 申请数量必须是数字,保存失败!'); + top.Ext.getCmp('sendOutGoods').getView().getRow(i).style.backgroundColor = '#FFB5B5'; + b = false; + break; + } } return b; } //获取代理灭菌物品 function getProxySterileTousse() { var proxySterileTousseArray = []; - for ( var i = 0; i < sendOutGoodsStore.getCount(); i++) { - var record = sendOutGoodsStore.getAt(i); - if(record.get('proxyDisinfection_id')){ - proxySterileTousseArray.push(record); - } + for (var i = 0; i < sendOutGoodsStore.getCount(); i++) { + var record = sendOutGoodsStore.getAt(i); + if (record.get('proxyDisinfection_id')) { + proxySterileTousseArray.push(record); + } } return proxySterileTousseArray; } var addGridItem = Ext.data.Record.create([ - {name : 'id'}, - {name : 'barcode'}, - {name : 'name'}, - {name : 'tousseFixedBarcode'}, - {name : 'showTousseName'}, - {name : 'count'}, - {name : 'diposable'}, - {name : 'price'}, - {name : 'fluctuationPrice'}, - {name : 'storage'}, - {name : 'batchNumber'}, - {name : 'tousseType'}, - {name : 'typeInfoOnScanned'}, - {name : 'sterilizerName'}, - {name : 'frequency'}, - {name : 'isTracable'}, - {name : 'tousseDefinitionId'}, - {name : 'proxyDisinfection_id'} - ]); + { name: 'id' }, + { name: 'barcode' }, + { name: 'name' }, + { name: 'tousseFixedBarcode' }, + { name: 'showTousseName' }, + { name: 'count' }, + { name: 'diposable' }, + { name: 'price' }, + { name: 'fluctuationPrice' }, + { name: 'storage' }, + { name: 'batchNumber' }, + { name: 'tousseType' }, + { name: 'typeInfoOnScanned' }, + { name: 'sterilizerName' }, + { name: 'frequency' }, + { name: 'isTracable' }, + { name: 'tousseDefinitionId' }, + { name: 'proxyDisinfection_id' } +]); var SumGridItem = Ext.data.Record.create([ - {name : 'id'}, - {name : 'name'}, - {name : 'showTousseName'}, - {name : 'amount'}, - {name : 'price'}, - {name : 'fluctuationPrice'} - ]); + { name: 'id' }, + { name: 'name' }, + { name: 'showTousseName' }, + { name: 'amount' }, + { name: 'price' }, + { name: 'fluctuationPrice' } +]); // 根据条码获取发送项 -function getSendOutGoodsRecordByBarcode(barcode){ - if(isUndefinedOrNullOrEmpty(barcode)){ +function getSendOutGoodsRecordByBarcode(barcode) { + if (isUndefinedOrNullOrEmpty(barcode)) { return null; } - for ( var i = 0; i < sendOutGoodsStore.getCount(); i++) { - var record = sendOutGoodsStore.getAt(i); - var tempBarcode =record.get('barcode'); - if(barcode == tempBarcode){ - return record; - } + for (var i = 0; i < sendOutGoodsStore.getCount(); i++) { + var record = sendOutGoodsStore.getAt(i); + var tempBarcode = record.get('barcode'); + if (barcode == tempBarcode) { + return record; + } } return null; } -function getSendOutGoodsByBarcode(barcode){ - if(isUndefinedOrNullOrEmpty(barcode)){ +function getSendOutGoodsByBarcode(barcode) { + if (isUndefinedOrNullOrEmpty(barcode)) { return null; } - for ( var i = 0; i < sendOutGoodsStore.getCount(); i++) { - var record = sendOutGoodsStore.getAt(i); - var tempBarcode =record.get('barcode'); - if(barcode == tempBarcode){ - return record.data; - } + for (var i = 0; i < sendOutGoodsStore.getCount(); i++) { + var record = sendOutGoodsStore.getAt(i); + var tempBarcode = record.get('barcode'); + if (barcode == tempBarcode) { + return record.data; + } } return null; } // 名字到数量的map -function getTousseNameToAmountMap(scannedResult){ +function getTousseNameToAmountMap(scannedResult) { var map = {}; - for(var i=0;i= storageAmount){ + if (containerBarcode) { + if (scannedAmount >= storageAmount) { return; } count = storageAmount - scannedAmount; - - }else{ - if(scannedAmount >= storageAmount){ + + } else { + if (scannedAmount >= storageAmount) { return; } - count = Math.min(storageAmount - scannedAmount,goods.scanAmount); + count = Math.min(storageAmount - scannedAmount, goods.scanAmount); } add = false; - }else{ + } else { count = storageAmount; } var totalAmount = scannedAmount + count; - if(scannedGoods){ - scannedGoods.set('count',totalAmount); - }else{ + if (scannedGoods) { + scannedGoods.set('count', totalAmount); + } else { var price = goods.price; var record = new addGridItem({ - id : 0, - barcode : goods.barcode, - name : goods.name, - tousseFixedBarcode : goods.tousseFixedBarcode, - showTousseName : goods.showTousseName, - count : count, - diposable : goods.diposable, - price : price, - fluctuationPrice : goods.fluctuationPrice, - storage : storageAmount, - batchNumber : goods.batchNumber, - tousseType : goods.tousseType, - typeInfoOnScanned : goods.typeInfoOnScanned, - sterilizerName : goods.sterilizerName, - frequency : goods.frequency, - isTracable : goods.isTracable, - tousseDefinitionId : goods.tousseDefinitionId, - externalCode : goods.externalCode, - isRoutine : goods.isRoutine, - proxyDisinfection_id : goods.proxyDisinfection_id + id: 0, + barcode: goods.barcode, + name: goods.name, + tousseFixedBarcode: goods.tousseFixedBarcode, + showTousseName: goods.showTousseName, + count: count, + diposable: goods.diposable, + price: price, + fluctuationPrice: goods.fluctuationPrice, + storage: storageAmount, + batchNumber: goods.batchNumber, + tousseType: goods.tousseType, + typeInfoOnScanned: goods.typeInfoOnScanned, + sterilizerName: goods.sterilizerName, + frequency: goods.frequency, + isTracable: goods.isTracable, + tousseDefinitionId: goods.tousseDefinitionId, + externalCode: goods.externalCode, + isRoutine: goods.isRoutine, + proxyDisinfection_id: goods.proxyDisinfection_id }); - sendOutGoodsStore.insert(0,record); + sendOutGoodsStore.insert(0, record); } - speakBasket.addGoods('',goods.showTousseName,totalAmount); + speakBasket.addGoods('', goods.showTousseName, totalAmount); refreshSumInfo(); -// clearScanText(); + // clearScanText(); } -function clearScanText(){ +function clearScanText() { var barcodeEnd = top.Ext.getCmp("scanTextEnd").getValue().Trim(); - if(barcodeEnd == ''){ - if(hiddenEndBarcode || currentScanMode == 'single'){ + if (barcodeEnd == '') { + if (hiddenEndBarcode || currentScanMode == 'single') { top.Ext.getCmp('scanText').setValue("");//如果使用虚拟篮筐机制,扫描成功后需要清除该文本内容 - }else{ + } else { top.Ext.getCmp('scanTextEnd').focus();//否则不清除,条码/篮筐(尾)获得焦点 } } } -function preprocessBeforeGetBarcodeInfo(){ +function preprocessBeforeGetBarcodeInfo() { var barcode = top.Ext.getCmp("scanText").getValue().Trim(); var barcodeEnd = top.Ext.getCmp("scanTextEnd").getValue().Trim(); var singleMode = true; - if(barcodeEnd != ''){ + if (barcodeEnd != '') { singleMode = false; } var sourceWarehouseId = top.Ext.getCmp("sourceWarehouseId").getValue(); - if(isUndefinedOrNullOrEmpty(sourceWarehouseId)){ + if (isUndefinedOrNullOrEmpty(sourceWarehouseId)) { showResult('请先选择仓库!'); return false; } - if(singleMode){// 判断是否已经扫描过该条码 + if (singleMode) {// 判断是否已经扫描过该条码 var goods = getSendOutGoodsByBarcode(barcode); - if(goods != null && !goods.tousseFixedBarcode){ - showResult('条形码:'+barcode+' 已经存在!'); + if (goods != null && !goods.tousseFixedBarcode) { + showResult('条形码:' + barcode + ' 已经存在!'); return false; } } return true; } var timeOut; //150毫秒播放一次,随时停止播放 -function setTime(time){ - if(time > 0){ - timeOut = setTimeout(function(){ - if(isIE()){ - document.getElementById('invoicePlanAudioIE').setAttribute('src',WWWROOT+'/common/audio/beep.wav'); - }else { - var myAudio = new Audio(); - myAudio.preload = true; - myAudio.controls = true; - myAudio.src = WWWROOT+'/common/audio/beep.ogg'; - myAudio.play(); +function setTime(time) { + if (time > 0) { + timeOut = setTimeout(function () { + if (isIE()) { + document.getElementById('invoicePlanAudioIE').setAttribute('src', WWWROOT + '/common/audio/beep.wav'); + } else { + var myAudio = new Audio(); + myAudio.preload = true; + myAudio.controls = true; + myAudio.src = WWWROOT + '/common/audio/beep.ogg'; + myAudio.play(); myAudio.loop = false; } - time --; + time--; setTime(time); }, 150); } } //先播放报警声后弹出提示 function loadBeep(resultMsg) { setTime(33); - var timeOut2 = setTimeout(function() { + var timeOut2 = setTimeout(function () { speakMessage(resultMsg); }, 5000); - top.Ext.MessageBox.confirm = function(title, msg, fn) { + top.Ext.MessageBox.confirm = function (title, msg, fn) { this.show({ - title : title, - msg : msg, - buttons:{yes:'确认'}, - fn : fn, - icon : this.QUESTION + title: title, + msg: msg, + buttons: { yes: '确认' }, + fn: fn, + icon: this.QUESTION }); return this; } - top.Ext.MessageBox.confirm('提示',resultMsg,function(btn){ + top.Ext.MessageBox.confirm('提示', resultMsg, function (btn) { clearTimeout(timeOut); clearTimeout(timeOut2); }) @@ -421,121 +421,143 @@ var barcode = top.Ext.getCmp("scanText").getValue().Trim(); var barcodeEnd = top.Ext.getCmp("scanTextEnd").getValue().Trim(); var singleMode = true; - if(barcodeEnd != ''){ + if (barcodeEnd != '') { singleMode = false; } - if(isUndefinedOrNullOrEmpty(orgUnitCoding)){ + if (isUndefinedOrNullOrEmpty(orgUnitCoding)) { showResult('请先选择科室!'); return false; } var sourceWarehouseId = top.Ext.getCmp("sourceWarehouseId").getValue(); - if(!preprocessBeforeGetBarcodeInfo()){ + if (!preprocessBeforeGetBarcodeInfo()) { return; } // 如果条码/篮筐(尾)不为空 - if(barcodeEnd != ''){ + if (barcodeEnd != '') { barcode += ";" + barcodeEnd; } // 开始查询条码信息 top.Ext.getCmp("sendOutGoods").getEl().mask("后台处理中,请稍候..."); - Ext.Ajax.timeout=300*1000; + Ext.Ajax.timeout = 300 * 1000; clearScanText();// 清除条码 Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/invoiceAction!loadGoodsByBarcode.do', - params : {barcode : barcode,orgUnitCoding : orgUnitCoding,sourceWarehouseId: sourceWarehouseId,invoiceType: TYPE_CUSTOM,dataIsolationModule:dataIsolationModule}, - success : function(response, options) { + url: WWWROOT + '/disinfectSystem/invoiceAction!loadGoodsByBarcode.do', + params: { barcode: barcode, orgUnitCoding: orgUnitCoding, sourceWarehouseId: sourceWarehouseId, invoiceType: TYPE_CUSTOM, dataIsolationModule: dataIsolationModule }, + success: function (response, options) { top.Ext.getCmp("sendOutGoods").getEl().unmask(); var result = Ext.decode(response.responseText); var noticeMessage = result.errMsg || result.error || result.message; + if (result.data.length == 0) { + showResult("找不到该条码对应的信息。"); + return; + } // 首先处理错误信息 - if(!isUndefinedOrNullOrEmpty(noticeMessage)){ - if(sstsConfig.enableTheAlarmConfirmationDialogBoxPopsUpWhenTheShipmentScansAbnormalItems){ + if (!isUndefinedOrNullOrEmpty(noticeMessage)) { + if(sstsConfig.enableAbnormalItemListFixedDisplay){ + var typeInfoOnScanned = result.data[0].typeInfoOnScanned; + if (typeInfoOnScanned !== "orgUnit") { + if (sstsConfig.isUseAbnormalGoodsTable && sstsConfig.isUseAbnormalGoodsTable == true) { + //加入异常物品列表 + if (result.data[0].barcode != null) { + addAbnormalGoods(result.data[0]); + } + } + } + } + if (sstsConfig.enableTheAlarmConfirmationDialogBoxPopsUpWhenTheShipmentScansAbnormalItems) { loadBeep(noticeMessage); - }else { + } else { showResult(noticeMessage); } return; } - if(result.data.length == 0){ - showResult("找不到该条码对应的信息。"); - return; - } //扫描的灭菌篮筐 var containerBarcode = result.containerBarcode; //容器中 的包数量 var tousseAmountInContainer = 0; var speakBasket = new SpeakBasket(); - for(var x=0;x 0){ - showResult("已添加篮筐内的"+ tousseAmountInContainer +"个包"); + if (containerBarcode && tousseAmountInContainer > 0) { + showResult("已添加篮筐内的" + tousseAmountInContainer + "个包"); } - -// for(var x=0;x 0){ -// showResult(msg); -// } -// } - newAddAudioTips("invoicePlanAudio","",speakBasket); -// if(result.data.length > 0 && alreadyAddAmount == 0){ -// showResult("器械包已扫描或不在发货单中"); -// } + + // for(var x=0;x 0){ + // showResult(msg); + // } + // } + newAddAudioTips("invoicePlanAudio", "", speakBasket); + // if(result.data.length > 0 && alreadyAddAmount == 0){ + // showResult("器械包已扫描或不在发货单中"); + // } }, - failure : function(response, options) { + failure: function (response, options) { top.Ext.getCmp("sendOutGoods").getEl().unmask(); showResult('获取条码信息失败'); } - + }); } @@ -548,56 +570,56 @@ //} // function findRecordByGoodsVOFromRecyclingApplication(vo) { - for ( var i = 0; i < recyclingapplicationStore.getCount(); i++) { + for (var i = 0; i < recyclingapplicationStore.getCount(); i++) { var record = recyclingapplicationStore.getAt(i); var name = record.get('name'); var diposable = record.get('diposable'); var disposableGoodsIdSet = record.get('disposableGoodsIdSet'); var expensiveGoodsIdSet = record.get('expensiveGoodsIdSet'); - if(name == vo.name && diposable != vo.diposable){ - var msg = '待发物品['+name+']为一次性物品,请扫描一次性物品条码!'; - if(diposable != '是'){ - msg = '待发物品['+name+']为器械包,请扫描器械包条码!'; + if (name == vo.name && diposable != vo.diposable) { + var msg = '待发物品[' + name + ']为一次性物品,请扫描一次性物品条码!'; + if (diposable != '是') { + msg = '待发物品[' + name + ']为器械包,请扫描器械包条码!'; } - showResult(msg , null , sstsConfig.messagePauseTimeOnInvoiceplanPage); + showResult(msg, null, sstsConfig.messagePauseTimeOnInvoiceplanPage); return null; } - - if(diposable == '是'){ + + if (diposable == '是') { // 一次性物品优先根据id来匹配 - if(disposableGoodsIdSet.length > 0 && !isUndefinedOrNullOrEmpty(vo.typeInfoOnScanned)){ + if (disposableGoodsIdSet.length > 0 && !isUndefinedOrNullOrEmpty(vo.typeInfoOnScanned)) { var typeInfoOnScanned = JSON.parse(vo.typeInfoOnScanned); - for(var di=0;di 0 && !isUndefinedOrNullOrEmpty(vo.typeInfoOnScanned)){ + if (expensiveGoodsIdSet.length > 0 && !isUndefinedOrNullOrEmpty(vo.typeInfoOnScanned)) { var typeInfoOnScanned = JSON.parse(vo.typeInfoOnScanned); - for(var di=0;di'+value+''; + + + var recyclingapplicationCm = new Ext.grid.ColumnModel([ + { id: 'sum_tousseName', header: "物品名称", dataIndex: 'showTousseName', width: 100, menuDisabled: true, align: 'center' }, + { + header: '单价', dataIndex: 'fluctuationPrice', width: 50, value: 0, menuDisabled: true, align: 'center', renderer: function (value) { + return '
' + value + '
'; } }, - {header : '数量',dataIndex : 'amount',width : 50,value : 0, menuDisabled: true,align:'center',renderer:function(value){ - return '
'+value+'
'; + { + header: '数量', dataIndex: 'amount', width: 50, value: 0, menuDisabled: true, align: 'center', renderer: function (value) { + return '
' + value + '
'; } } ]); - + var recyclingErrorCm = new Ext.grid.ColumnModel([ - {header : "材料名称",dataIndex : 'goodsName',width : 170,menuDisabled: true}, - {header : "缺失数量",dataIndex : 'count',width : 60, menuDisabled: true}, - {header : '单价',id : 'price',dataIndex : 'price',width : 60,value : 0,menuDisabled: true} + { header: "材料名称", dataIndex: 'goodsName', width: 170, menuDisabled: true }, + { header: "缺失数量", dataIndex: 'count', width: 60, menuDisabled: true }, + { header: '单价', id: 'price', dataIndex: 'price', width: 60, value: 0, menuDisabled: true } ]); - + var cm = new Ext.grid.ColumnModel([ - {header : "条码",dataIndex : 'barcode',width : 90,menuDisabled: true,align:'center'}, - {header : "物品名称",dataIndex : 'showTousseName',width : 190,menuDisabled: true,align:'center'}, - {header : "name",dataIndex : 'name',hidden : true,menuDisabled: true}, - {header : "批次/灭菌日期",dataIndex : 'batchNumber',width : 100,menuDisabled: true,align:'center'}, - {header : "灭菌炉名称",dataIndex : 'sterilizerName',width : 200,menuDisabled: true,hidden :true,align:'center'}, - {header : "炉次",dataIndex : 'frequency',width : 50,menuDisabled: true,hidden :true,align:'center'}, - {id : 'diposable',header : "是否一次性材料",dataIndex : 'diposable',hidden :true,width : 150,align:'center'}, - {header : "单价",dataIndex : 'fluctuationPrice',width : 50, align:'center', menuDisabled: true,renderer:function(value){ - return '
'+value+'
'; + { header: "条码", dataIndex: 'barcode', width: 90, menuDisabled: true, align: 'center' }, + { header: "物品名称", dataIndex: 'showTousseName', width: 190, menuDisabled: true, align: 'center' }, + { header: "name", dataIndex: 'name', hidden: true, menuDisabled: true }, + { header: "批次/灭菌日期", dataIndex: 'batchNumber', width: 100, menuDisabled: true, align: 'center' }, + { header: "灭菌炉名称", dataIndex: 'sterilizerName', width: 200, menuDisabled: true, hidden: true, align: 'center' }, + { header: "炉次", dataIndex: 'frequency', width: 50, menuDisabled: true, hidden: true, align: 'center' }, + { id: 'diposable', header: "是否一次性材料", dataIndex: 'diposable', hidden: true, width: 150, align: 'center' }, + { + header: "单价", dataIndex: 'fluctuationPrice', width: 50, align: 'center', menuDisabled: true, renderer: function (value) { + return '
' + value + '
'; } }, - {header : "数量",dataIndex : 'count',width : 50, align:'right', menuDisabled: true, - editor : new Ext.form.TextField( { - allowBlank : false, - listeners : { - focus : function(thiz){ + { + header: "数量", dataIndex: 'count', width: 50, align: 'right', menuDisabled: true, + editor: new Ext.form.TextField({ + allowBlank: false, + listeners: { + focus: function (thiz) { thiz.selectText(); } } - })}, - {id : 'deleteItem',header:'删除',width : 25, align:'center', menuDisabled: true, - renderer: function(v,p,record){ - var str = ""; - return str; + }) }, - dataIndex:'button' - }]); - function callback_yes(){ + { + id: 'deleteItem', header: '删除', width: 25, align: 'center', menuDisabled: true, + renderer: function (v, p, record) { + var str = ""; + return str; + }, + dataIndex: 'button' + }]); + function callback_yes() { doSaveAction(); } - function callback_no(){ + function callback_no() { doCancelAction(); } - var barcodeBtn = new BarcodeBtn(function(){callback_yes();},function(){callback_no();}); + var recyclingApplicationWinWidth = windowW < 1280 ? windowW - 4 : 1280; + var barcodeBtn = new BarcodeBtn(function () { callback_yes(); }, function () { callback_no(); }); var form = new top.Ext.FormPanel({ - id : 'recyclingApplicationForm', - frame : true, - labelSeparator : ':', - bodyStyle : 'padding:5px 5px 0px 5px', - width : 1020, - autoHeight:true, - autoScroll : true, - labelAlign:'right', - labelWidth :120, - layout : 'form', - items : [{ - xtype : "fieldset", - title : "基础数据", - layout : 'column', + id: 'recyclingApplicationForm', + frame: true, + region: 'center', + labelSeparator: ':', + bodyStyle: 'padding:5px 5px 0px 5px', + width: windowW < 1280 ? windowW - 4 : 1280, + autoHeight: true, + // autoScroll : true, + labelAlign: 'right', + layout: 'form', + items: [{ + xtype: "fieldset", + title: "基础数据", + layout: 'column', style: 'padding:0px', - autoHeight : true, - items : [{ - layout : 'column', - columnWidth :1, - items:[{ - xtype : 'hidden', - name : 'id', - id : 'id' - },{ - xtype : 'hidden', - name : 'sendOutGoodsStoreData', - id : 'sendOutGoodsStoreData' - },{ - xtype :'hidden', - name : 'recyclingappStoreData', - id : 'recyclingappStoreData' - },{ - xtype :'hidden', - name : 'status', - id : 'status' - },{ - xtype :'hidden', - name : 'orgUnitCoding', - id : 'orgUnitCoding', - value:orgUnitCoding - },{ - xtype :'hidden', - name : 'applyDate', - id : 'applyDateHidden', - value:selectedApplyDate - },{ - xtype :'hidden', - name : 'tousseType', - id : 'tousseTypeHidden', - value:selectedTousseType - },{ - xtype :'hidden', - name : 'invoicePlanId', - id : 'invoicePlanIdHidden', - value:selectedInvoicePlanId - },{ - xtype : 'hidden', - name : 'invoiceType', - id : 'invoiceType', - value:TYPE_CUSTOM - },{ - xtype :'hidden', - name : 'personInChargeCode', - id : 'personInChargeCode' - },{ - xtype : 'hidden', - name : 'sourceWarehouseId', - id : 'sourceWarehouseId' - },{ - xtype : 'hidden', - name : 'sourceWarehouseName', - id : 'sourceWarehouseName' - },{ - xtype : 'hidden', - name : 'warehouseID', - id : 'warehouseID' - },{ - xtype : 'hidden', - name : 'warehouseName', - id : 'warehouseName' - },{ - layout : 'form', - columnWidth :.33, - height:26, - items : [{ - xtype : 'textfield', - fieldLabel : '科室条码', - maxLength : '16', - id : 'departBarcode', - name : 'departBarcode', - anchor : '100%', - listeners : { - render : function(p) { - p.getEl().on('keypress',function(e) { + autoHeight: true, + items: [{ + layout: 'column', + columnWidth: 1, + items: [{ + xtype: 'hidden', + name: 'id', + id: 'id' + }, { + xtype: 'hidden', + name: 'sendOutGoodsStoreData', + id: 'sendOutGoodsStoreData' + }, { + xtype: 'hidden', + name: 'recyclingappStoreData', + id: 'recyclingappStoreData' + }, { + xtype: 'hidden', + name: 'status', + id: 'status' + }, { + xtype: 'hidden', + name: 'orgUnitCoding', + id: 'orgUnitCoding', + value: orgUnitCoding + }, { + xtype: 'hidden', + name: 'applyDate', + id: 'applyDateHidden', + value: selectedApplyDate + }, { + xtype: 'hidden', + name: 'tousseType', + id: 'tousseTypeHidden', + value: selectedTousseType + }, { + xtype: 'hidden', + name: 'invoicePlanId', + id: 'invoicePlanIdHidden', + value: selectedInvoicePlanId + }, { + xtype: 'hidden', + name: 'invoiceType', + id: 'invoiceType', + value: TYPE_CUSTOM + }, { + xtype: 'hidden', + name: 'personInChargeCode', + id: 'personInChargeCode' + }, { + xtype: 'hidden', + name: 'sourceWarehouseId', + id: 'sourceWarehouseId' + }, { + xtype: 'hidden', + name: 'sourceWarehouseName', + id: 'sourceWarehouseName' + }, { + xtype: 'hidden', + name: 'warehouseID', + id: 'warehouseID' + }, { + xtype: 'hidden', + name: 'warehouseName', + id: 'warehouseName' + }, { + layout: 'form', + columnWidth: .33, + height: 26, + items: [{ + xtype: 'textfield', + fieldLabel: '科室条码', + maxLength: '16', + id: 'departBarcode', + name: 'departBarcode', + anchor: '100%', + listeners: { + render: function (p) { + p.getEl().on('keypress', function (e) { if (e.getKey() == 13) {//回车键 - InvoiceTableManager.getApplicationOrgByBarcode( - top.Ext.getCmp('departBarcode').getValue(),function(orgStr) { + InvoiceTableManager.getApplicationOrgByBarcode( + top.Ext.getCmp('departBarcode').getValue(), function (orgStr) { if (orgStr != null) { var result = top.Ext.decode(orgStr); - if(!result.success){ - showResult(result.message); - return; - } - var deptCoding = result.orgUnitCoding; + if (!result.success) { + showResult(result.message); + return; + } + var deptCoding = result.orgUnitCoding; top.Ext.getCmp("depart").setValue(result.name); top.Ext.getCmp("orgUnitCoding").setValue(result.orgUnitCoding); - if(top.Ext.getCmp('assistantSenderBarcode_parent').isVisible()){ + if (top.Ext.getCmp('assistantSenderBarcode_parent').isVisible()) { top.Ext.getCmp('assistantSenderBarcode').focus(); - }else if(top.Ext.getCmp('personInChargeBarcode_parent').isVisible()){ + } else if (top.Ext.getCmp('personInChargeBarcode_parent').isVisible()) { top.Ext.getCmp('personInChargeBarcode').focus(); - }else{ + } else { top.Ext.getCmp('scanText').focus(); } //根据申请科室设置其默认结算科室 - if(deptCoding){ + if (deptCoding) { setDefaultSettleAccountDepartByDeptCoding(deptCoding); } } - + }); - top.Ext.getCmp('departBarcode').setValue(""); + top.Ext.getCmp('departBarcode').setValue(""); } }); } } }] - },{ - layout : 'form', - columnWidth :.33, - height:26, - items : [{ - xtype : 'combo', - fieldLabel : '申请科室', - id : 'depart', - name : 'depart', - queryParam : 'spell', - minChars : 0, - valueField : 'name', - displayField : 'name', - store : appDepartJsonStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : false, - anchor : '100%', - listeners:{ - select:function(combo, record, index){ + }, { + layout: 'form', + columnWidth: .33, + height: 26, + items: [{ + xtype: 'combo', + fieldLabel: '申请科室', + id: 'depart', + name: 'depart', + queryParam: 'spell', + minChars: 0, + valueField: 'name', + displayField: 'name', + store: appDepartJsonStore, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: false, + allowBlank: false, + anchor: '100%', + listeners: { + select: function (combo, record, index) { var deptCoding = record.data.departCode; top.Ext.getCmp("orgUnitCoding").setValue(deptCoding); //根据申请科室设置其默认结算科室 setDefaultSettleAccountDepartByDeptCoding(deptCoding); }, - focus : function(thiz){ + focus: function (thiz) { thiz.selectText(); } - } + } }] }, { //结算科室编码 xtype: 'hidden', name: 'settleAccountsDepartCoding', id: 'settleAccountsDepartCoding' - },{ - layout : 'form', - columnWidth :.33, - height:26, - items : [{ - xtype : 'combo', - fieldLabel : '结算科室', - id : 'settleAccountsDepart', - name : 'settleAccountsDepart', - queryParam : 'spell', - minChars : 0, - valueField : 'name', - displayField : 'name', - store : appDepartJsonStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : false, - typeAhead : false, - allowBlank : false, - anchor : '100%', - listeners:{ - select:function(combo, record, index){ + }, { + layout: 'form', + columnWidth: .33, + height: 26, + items: [{ + xtype: 'combo', + fieldLabel: '结算科室', + id: 'settleAccountsDepart', + name: 'settleAccountsDepart', + queryParam: 'spell', + minChars: 0, + valueField: 'name', + displayField: 'name', + store: appDepartJsonStore, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: false, + allowBlank: false, + anchor: '100%', + listeners: { + select: function (combo, record, index) { var deptCoding = record.data.departCode; top.Ext.getCmp("settleAccountsDepartCoding").setValue(deptCoding); }, - focus : function(thiz){ + focus: function (thiz) { thiz.selectText(); } - } - }] - }] - },{ - layout : 'form', - columnWidth :.33, - height:26, - items : [{ - xtype : 'textfield', - fieldLabel : '发货员', - maxLength : '41', - id : 'sender', - name : 'sender', - readOnly:true, - allowBlank : false, - anchor : '100%', - value:$Id('userName').value, - cls:'fieldReadOnlyNoRemove' + } }] - },{ - layout : 'form', - columnWidth :.33, - id : 'assistantSenderBarcode_parent', - name : 'assistantSenderBarcode_parent', - hidden: !getSystemSetConfig('showInvoiceAssistantSender',true), - height:26, - items : [{ - xtype : 'textfield', - fieldLabel : '核对员条码', - maxLength : '16', - id : 'assistantSenderBarcode', - name : 'assistantSenderBarcode', - anchor : '100%', - listeners : { - render : function(p) { - p.getEl().on('keypress',function(e) { - if (e.getKey() == 13) {//回车键 - InvoiceTableManager.getUserNameOfCurrentLoginUserOrgsByBarcode( - top.Ext.getCmp('assistantSenderBarcode').getValue(),function(userName) { - if (userName != null) { - var resultArray = userName.split(":"); - if(resultArray[0] == "success"){ - top.Ext.getCmp('assistantSender').setValue(resultArray[1]); - Ext.state.Manager.getProvider().set('cookieAssistantSender',resultArray[1]); - }else{ - showResult(resultArray[1]); - top.Ext.getCmp('assistantSender').setValue(""); - } + }] + }, { + layout: 'form', + columnWidth: .33, + height: 26, + items: [{ + xtype: 'textfield', + fieldLabel: '发货员', + maxLength: '41', + id: 'sender', + name: 'sender', + readOnly: true, + allowBlank: false, + anchor: '100%', + value: $Id('userName').value, + cls: 'fieldReadOnlyNoRemove' + }] + }, { + layout: 'form', + columnWidth: .33, + id: 'assistantSenderBarcode_parent', + name: 'assistantSenderBarcode_parent', + hidden: !getSystemSetConfig('showInvoiceAssistantSender', true), + height: 26, + items: [{ + xtype: 'textfield', + fieldLabel: '核对员条码', + maxLength: '16', + id: 'assistantSenderBarcode', + name: 'assistantSenderBarcode', + anchor: '100%', + listeners: { + render: function (p) { + p.getEl().on('keypress', function (e) { + if (e.getKey() == 13) {//回车键 + InvoiceTableManager.getUserNameOfCurrentLoginUserOrgsByBarcode( + top.Ext.getCmp('assistantSenderBarcode').getValue(), function (userName) { + if (userName != null) { + var resultArray = userName.split(":"); + if (resultArray[0] == "success") { + top.Ext.getCmp('assistantSender').setValue(resultArray[1]); + Ext.state.Manager.getProvider().set('cookieAssistantSender', resultArray[1]); + } else { + showResult(resultArray[1]); + top.Ext.getCmp('assistantSender').setValue(""); } - top.Ext.getCmp('assistantSenderBarcode').setValue(""); -// top.Ext.getCmp('personInChargeBarcode').focus(); - if(top.Ext.getCmp('personInChargeBarcode_parent').isVisible()){ - top.Ext.getCmp('personInChargeBarcode').focus(); - }else{ - top.Ext.getCmp('scanText').focus(); - } - }); - } - }); - } + } + top.Ext.getCmp('assistantSenderBarcode').setValue(""); + // top.Ext.getCmp('personInChargeBarcode').focus(); + if (top.Ext.getCmp('personInChargeBarcode_parent').isVisible()) { + top.Ext.getCmp('personInChargeBarcode').focus(); + } else { + top.Ext.getCmp('scanText').focus(); + } + }); + } + }); } - }] - },{ - layout : 'form', - columnWidth :.33, - hidden: !getSystemSetConfig('showInvoiceAssistantSender',true), - height:26, - items : [{ - xtype : 'textfield', - fieldLabel : '核对员', - maxLength : '41', - id : 'assistantSender', - name : 'assistantSender', - readOnly:true, - allowBlank : false, - allowBlank : !getSystemSetConfig('showInvoiceAssistantSender',true) || !getSystemSetConfig('invoiceAssistantSenderRequired',true), - anchor : '100%', - cls:'x-item-disabled' - }] - },{ - layout : 'form', - columnWidth :.33, - id : 'personInChargeBarcode_parent', - name : 'personInChargeBarcode_parent', - hidden: !getSystemSetConfig('showInvoicePersonInCharge',true), - height:26, - items : [{ - xtype : 'textfield', - fieldLabel : '下送责任人条码', - maxLength : '16', - id : 'personInChargeBarcode', - name : 'personInChargeBarcode', - anchor : '100%', - listeners : { - render : function(p) { - p.getEl().on('keypress',function(e) { - if (e.getKey() == 13) {//回车键 - var barcode = top.Ext.getCmp('personInChargeBarcode').getValue(); - top.Ext.getCmp('personInChargeBarcode').setValue(""); - UserTableManager.getUserByBarcode(barcode,function(responseText){ - if(!isUndefinedOrNullOrEmpty(responseText)){ - var result = top.Ext.decode(responseText); - if(!result.success){ - showResult(result.message || "输入的条码有误!"); - return; - } - top.Ext.getCmp('personInCharge').setValue(result.fullName); - top.Ext.getCmp('personInChargeCode').setValue(result.name); - }else{ - showResult('找不到该条码所对应的人员信息'); - } - }); - } - }); - } + } + }] + }, { + layout: 'form', + columnWidth: .33, + hidden: !getSystemSetConfig('showInvoiceAssistantSender', true), + height: 26, + items: [{ + xtype: 'textfield', + fieldLabel: '核对员', + maxLength: '41', + id: 'assistantSender', + name: 'assistantSender', + readOnly: true, + allowBlank: false, + allowBlank: !getSystemSetConfig('showInvoiceAssistantSender', true) || !getSystemSetConfig('invoiceAssistantSenderRequired', true), + anchor: '100%', + cls: 'x-item-disabled' + }] + }, { + layout: 'form', + columnWidth: .33, + id: 'personInChargeBarcode_parent', + name: 'personInChargeBarcode_parent', + hidden: !getSystemSetConfig('showInvoicePersonInCharge', true), + height: 26, + items: [{ + xtype: 'textfield', + fieldLabel: '下送责任人条码', + maxLength: '16', + id: 'personInChargeBarcode', + name: 'personInChargeBarcode', + anchor: '100%', + listeners: { + render: function (p) { + p.getEl().on('keypress', function (e) { + if (e.getKey() == 13) {//回车键 + var barcode = top.Ext.getCmp('personInChargeBarcode').getValue(); + top.Ext.getCmp('personInChargeBarcode').setValue(""); + UserTableManager.getUserByBarcode(barcode, function (responseText) { + if (!isUndefinedOrNullOrEmpty(responseText)) { + var result = top.Ext.decode(responseText); + if (!result.success) { + showResult(result.message || "输入的条码有误!"); + return; + } + top.Ext.getCmp('personInCharge').setValue(result.fullName); + top.Ext.getCmp('personInChargeCode').setValue(result.name); + } else { + showResult('找不到该条码所对应的人员信息'); + } + }); + } + }); } - }] - },{ - layout : 'form', - columnWidth :.33, - hidden: !getSystemSetConfig('showInvoicePersonInCharge',true), - height:26, - items : [{ - xtype : 'textfield', - fieldLabel : '下送责任人', - maxLength : '41', - id : 'personInCharge', - name : 'personInCharge', - readOnly:true, - allowBlank : !getSystemSetConfig('showInvoicePersonInCharge',true) || !getSystemSetConfig('invoicePersonInChargeRequired',false), - anchor : '100%', - cls:'x-item-disabled' - }] - },{ - layout : 'form', - columnWidth :.33, - height:26, - 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', -// value:new Date(), - anchor : '100%', - listeners : { - render : function() { - setStartDate(top.Ext, 'yyyy/MM/dd HH:mm', 'sendTime'); //(发货时间,取服务器时间 cjr) - } + } + }] + }, { + layout: 'form', + columnWidth: .33, + hidden: !getSystemSetConfig('showInvoicePersonInCharge', true), + height: 26, + items: [{ + xtype: 'textfield', + fieldLabel: '下送责任人', + maxLength: '41', + id: 'personInCharge', + name: 'personInCharge', + readOnly: true, + allowBlank: !getSystemSetConfig('showInvoicePersonInCharge', true) || !getSystemSetConfig('invoicePersonInChargeRequired', false), + anchor: '100%', + cls: 'x-item-disabled' + }] + }, { + layout: 'form', + columnWidth: .33, + height: 26, + 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', + // value:new Date(), + anchor: '100%', + listeners: { + render: function () { + setStartDate(top.Ext, 'yyyy/MM/dd HH:mm', 'sendTime'); //(发货时间,取服务器时间 cjr) } - }] - },{ - columnWidth : .5, - layout : 'form', - columnWidth :.33, - height:26, - items:[{ - xtype : 'combo', - fieldLabel : '仓库', - id : 'warehouse', - name : 'warehouse', - minChars : 0, - valueField : 'id', - displayField : 'name', - store : wareHouseStore, - forceSelection : true, - lazyInit : false, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - allowBlank : false, - anchor : '100%', - listeners : { - select : function(combo, record, index) { - top.Ext.getCmp('warehouse').setValue(record.data.name); - top.Ext.getCmp('sourceWarehouseId').setValue(record.data.id); - top.Ext.getCmp('sourceWarehouseName').setValue(record.data.name); -// top.Ext.getCmp('remark2').focus(); - }, - specialkey : function(field, ee) { - if (ee.getKey() == Ext.EventObject.ENTER) { -// top.Ext.getCmp('remark2').focus(); - } + } + }] + }, { + columnWidth: .5, + layout: 'form', + columnWidth: .33, + height: 26, + items: [{ + xtype: 'combo', + fieldLabel: '仓库', + id: 'warehouse', + name: 'warehouse', + minChars: 0, + valueField: 'id', + displayField: 'name', + store: wareHouseStore, + forceSelection: true, + lazyInit: false, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: false, + anchor: '100%', + listeners: { + select: function (combo, record, index) { + top.Ext.getCmp('warehouse').setValue(record.data.name); + top.Ext.getCmp('sourceWarehouseId').setValue(record.data.id); + top.Ext.getCmp('sourceWarehouseName').setValue(record.data.name); + // top.Ext.getCmp('remark2').focus(); + }, + specialkey: function (field, ee) { + if (ee.getKey() == Ext.EventObject.ENTER) { + // top.Ext.getCmp('remark2').focus(); } } - }] - },{ - layout : 'form', - columnWidth : 1, - items : [{ - xtype : 'textarea', - fieldLabel : '备注', - id : 'remark2', - name : 'invoiceRemark', - anchor : '98.5%', - height : 40 - }] + } }] - - },{ - layout:'column', - items:[{ - layout : 'form', - columnWidth : top.screen.width < 1280 ? 0.57 : 0.55, - items:[ - new top.Ext.grid.EditorGridPanel({ - id : 'sendOutGoods', - store : sendOutGoodsStore, - columnWidth : 0.5, - cm : cm, - width : top.screen.width < 1280 ? top.screen.width*0.57-25 : 680, - height : top.screen.height < 864 ? windowH-250 : 445, - autoExpandColumn : 'deleteItem', - enableHdMenu : false, - frame : false, - bodyStyle : 'border:1px solid #afd7af', - viewConfig: { - autoFit:true - }, - clicksToEdit : 1,// 设置点击几次才可编辑 - selModel : new top.Ext.grid.RowSelectionModel({ - singleSelect : false - }), - tbar : [{ - text : '扫描模式:', - hidden : hiddenEndBarcode - },{ - xtype:'combo', - id : 'scanMode', - name : 'scanMode', - hidden : hiddenEndBarcode, - fieldLabel : '扫描模式', - valueField : 'scanModeCode', - displayField : 'scanModeName', - triggerAction : 'all', - width : 80, - allowBlank : true, - editable : false, - value:currentScanMode, - store : new Ext.data.SimpleStore({ - fields : ['scanModeCode', 'scanModeName' ], - data : [['single','单个条码'],['area','首尾条码']] - }), - mode:'local', - forceSelection : true, - triggerAction : 'all', - listeners : { - select : function(combo, record, index){ - //alert(record.get("scanModeCode")); - currentScanMode = record.get("scanModeCode"); + }, { + layout: 'form', + columnWidth: 1, + items: [{ + xtype: 'textarea', + fieldLabel: '备注', + id: 'remark2', + name: 'invoiceRemark', + anchor: '98.5%', + height: 40 + }] + }] + + }, { + layout: 'column', + items: [{ + layout: 'form', + columnWidth: top.screen.width < 1280 ? 0.57 : 0.55, + items: [ + new top.Ext.grid.EditorGridPanel({ + id: 'sendOutGoods', + store: sendOutGoodsStore, + columnWidth: 0.5, + cm: cm, + width: top.screen.width < 1280 ? top.screen.width * 0.57 - 25 : 680, + height: top.screen.height < 864 ? windowH - 250 : 445, + autoExpandColumn: 'deleteItem', + enableHdMenu: false, + frame: false, + bodyStyle: 'border:1px solid #afd7af', + viewConfig: { + autoFit: true + }, + clicksToEdit: 1,// 设置点击几次才可编辑 + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false + }), + tbar: [{ + text: '扫描模式:', + hidden: hiddenEndBarcode + }, { + xtype: 'combo', + id: 'scanMode', + name: 'scanMode', + hidden: hiddenEndBarcode, + fieldLabel: '扫描模式', + valueField: 'scanModeCode', + displayField: 'scanModeName', + triggerAction: 'all', + width: 80, + allowBlank: true, + editable: false, + value: currentScanMode, + store: new Ext.data.SimpleStore({ + fields: ['scanModeCode', 'scanModeName'], + data: [['single', '单个条码'], ['area', '首尾条码']] + }), + mode: 'local', + forceSelection: true, + triggerAction: 'all', + listeners: { + select: function (combo, record, index) { + //alert(record.get("scanModeCode")); + currentScanMode = record.get("scanModeCode"); + } + }, + anchor: '100%' + }, { + text: beginBarcodeLabel + }, { + xtype: 'textfield', + id: 'scanText', + name: 'scanText', + width: 90, + enableKeyEvents: true, + listeners: { + render: function (c) { + c.getEl().on('keypress', function (e) { + if (e.getKey() == 13) {// 输入;号键,grid重新加载 + if (top.Ext.getCmp("scanText").getValue() != '') { + if (barcodeBtn.processBarcode(top.Ext.getCmp("scanText").getValue())) { + return; + } + loadGoodsByBarcode(orgUnitCoding); + } else { + showResult("请扫描输入器械包/篮筐(首)条码!"); + } } - }, - anchor : '100%' - },{ - text : beginBarcodeLabel - },{ - xtype : 'textfield', - id : 'scanText', - name : 'scanText', - width : 90, - enableKeyEvents : true, - listeners : { - render : function(c) { - c.getEl().on('keypress',function(e) { - if (e.getKey() == 13) {// 输入;号键,grid重新加载 - if(top.Ext.getCmp("scanText").getValue() != ''){ - if(barcodeBtn.processBarcode(top.Ext.getCmp("scanText").getValue())){ - return; - } - loadGoodsByBarcode(orgUnitCoding); - }else{ - showResult("请扫描输入器械包/篮筐(首)条码!"); - } + }); + c.getEl().on('focus', function (e) { + top.Ext.getCmp('scanText').setValue(''); + }); + } + } + }, { + text: '条码/篮筐(尾):', + hidden: hiddenEndBarcode + }, { + xtype: 'textfield', + id: 'scanTextEnd', + name: 'scanTextEnd', + hidden: hiddenEndBarcode, + width: 90, + enableKeyEvents: true, + listeners: { + render: function (c) { + c.getEl().on('keypress', function (e) { + if (e.getKey() == 13) {// 输入;号键,grid重新加载 + if (top.Ext.getCmp("scanTextEnd").getValue() != '') { + if (barcodeBtn.processBarcode(top.Ext.getCmp("scanTextEnd").getValue())) { + return; } - }); - c.getEl().on('focus',function(e) { - top.Ext.getCmp('scanText').setValue(''); - }); + loadGoodsByBarcode(orgUnitCoding); + } else { + showResult("请扫描输入器械包/篮筐(尾)条码!"); + } } + }); + c.getEl().on('focus', function (e) { + top.Ext.getCmp('scanTextEnd').setValue(''); + }); + } + } + }], + listeners: { + beforeedit: function (grid) {//只有一次性物品才能编辑数量 + var record = grid.record; + if (record.data.diposable == '否') { + return false; + } + }, + afteredit: function (grid) { + var id = grid.record.data['id']; + var name = grid.record.data['name']; + var count = grid.record.data['count']; + var storage = grid.record.data['storage']; + var storageInt = parseInt(storage); + if (id == 0) { + if (parseInt(count) <= storageInt) { + updateAmount2(name, count); + } else { + showResult('库存量为:' + storage + ',已超过库存量!'); + var index = recyclingapplicationStore.find("name", name); + var tempAmount = recyclingapplicationStore.getAt(index).data['tempAmount']; + grid.record.set('count', storageInt); } - },{ - text : '条码/篮筐(尾):', - hidden : hiddenEndBarcode - },{ - xtype : 'textfield', - id : 'scanTextEnd', - name : 'scanTextEnd', - hidden : hiddenEndBarcode, - width : 90, - enableKeyEvents : true, - listeners : { - render : function(c) { - c.getEl().on('keypress',function(e) { - if (e.getKey() == 13) {// 输入;号键,grid重新加载 - if(top.Ext.getCmp("scanTextEnd").getValue() != ''){ - if(barcodeBtn.processBarcode(top.Ext.getCmp("scanTextEnd").getValue())){ - return; - } - loadGoodsByBarcode(orgUnitCoding); - }else{ - showResult("请扫描输入器械包/篮筐(尾)条码!"); - } - } - }); - c.getEl().on('focus',function(e) { - top.Ext.getCmp('scanTextEnd').setValue(''); - }); + } else { + var record = getRecord(recyclingapplicationStore, "name", name, 0); + if (record != null) { + var tempAmount = record.data['tempAmount']; + if (parseInt(count) <= (storageInt + parseInt(tempAmount))) { + updateAmount2(name, count); + } else { + showResult('库存量为:' + storage + ',已超过库存量!'); + grid.record.set('count', tempAmount); } } - }], - listeners : { - beforeedit : function(grid){//只有一次性物品才能编辑数量 - var record = grid.record; - if(record.data.diposable == '否') { - return false; - } - }, - afteredit :function(grid){ - var id = grid.record.data['id']; - var name = grid.record.data['name']; - var count = grid.record.data['count']; - var storage = grid.record.data['storage']; - var storageInt = parseInt(storage); - if(id==0){ - if(parseInt(count) <= storageInt){ - updateAmount2(name,count); - } else { - showResult('库存量为:' + storage + ',已超过库存量!'); - var index = recyclingapplicationStore.find("name",name); - var tempAmount = recyclingapplicationStore.getAt(index).data['tempAmount']; - grid.record.set('count',storageInt); - } - } else { - var record = getRecord(recyclingapplicationStore, "name", name, 0); - if(record != null) { - var tempAmount = record.data['tempAmount']; - if(parseInt(count) <= (storageInt + parseInt(tempAmount))){ - updateAmount2(name,count); - } else { - showResult('库存量为:' + storage + ',已超过库存量!'); - grid.record.set('count',tempAmount); - } - } - } - } } } + } + } )] - },{ - layout : 'form', - columnWidth : top.screen.width < 1280 ? 0.43 : 0.45, - items:[new top.Ext.grid.EditorGridPanel({ - id : 'sendOutGoodsDetail', - title : '发货单明细', - store : recyclingapplicationStore, - cm : recyclingapplicationCm, - enableHdMenu : false, - width : top.screen.width < 1280 ? top.screen.width*0.43-20 : 560, - height : top.screen.height < 864 ? windowH-250 : 445, - loadMask : true, - tbar:[{ - text:'发货汇总' - },{ - text: "", - id : 'tousseAmountInfo' - }], - bbar:[{ - text:'合计' - },{ - id : 'sum_price', - text:'总价:0.0' - },{ - id : 'sum_amount', - text:'数量:0' - }], -// autoExpandColumn : 'sum_tousseName', - frame : false, - bodyStyle : 'border:1px solid #afd7af', - viewConfig: { - forceFit:true - }, - selModel : new top.Ext.grid.RowSelectionModel({ - singleSelect : false - }), - listeners:{ - validateedit : function(o){ - if(!isPositiveInteger(o.value))return false; - } - } - })] + }, { + layout: 'form', + columnWidth: top.screen.width < 1280 ? 0.43 : 0.45, + items: [new top.Ext.grid.EditorGridPanel({ + id: 'sendOutGoodsDetail', + title: '发货单明细', + store: recyclingapplicationStore, + cm: recyclingapplicationCm, + enableHdMenu: false, + width: top.screen.width < 1280 ? top.screen.width * 0.43 - 20 : 560, + height: top.screen.height < 864 ? windowH - 250 : 445, + loadMask: true, + tbar: [{ + text: '发货汇总' + }, { + text: "", + id: 'tousseAmountInfo' + }], + bbar: [{ + text: '合计' + }, { + id: 'sum_price', + text: '总价:0.0' + }, { + id: 'sum_amount', + text: '数量:0' + }], + // autoExpandColumn : 'sum_tousseName', + frame: false, + bodyStyle: 'border:1px solid #afd7af', + viewConfig: { + forceFit: true + }, + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false + }), + listeners: { + validateedit: function (o) { + if (!isPositiveInteger(o.value)) return false; } - ] - }], - buttons : [{ - text : sstsConfig.aliasNameOfSaveKeywordInInvoiceForm ? sstsConfig.aliasNameOfSaveKeywordInInvoiceForm : '保存', - id:'saveButton', - handler : function() { - doSaveAction(); } - },{ - text : sstsConfig.aliasNameOfSaveKeywordInInvoiceForm ? sstsConfig.aliasNameOfSaveKeywordInInvoiceForm+'并打印' : '保存并打印', - id:'saveAndPrintButton', -// hidden:!sstsConfig.enableSaveAndPrintWhenInvoice, - handler : function(){doSaveAction(printInvoiceAfterInvoice);} - }, { - text : '取消', - id:'cancelButton', - handler : function() { - doCancelAction(); - } - }] - }); - - function doSaveAction(printInvoiceCallback){ + })] + } + ] + }], + }); + function doSaveAction(printInvoiceCallback) { + if (!form.getForm().isValid()) { showResult('请正确填写表单各值'); return false; } //验证发货物品表格 - if(!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0){ + if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { showResult('发货物品不能为空!'); return false; } - + var bool = validGridAmount(); - if(!bool){ + if (!bool) { return false; } //代理灭菌的器械包 var proxySterileTousseArray = getProxySterileTousse(); var proxySterileTousseArrayLength = proxySterileTousseArray.length; - if(proxySterileTousseArray.length > 0){ - if(sstsConfig.enableProxyDisinfectionToussesCustomInvoice){ + if (proxySterileTousseArray.length > 0) { + if (sstsConfig.enableProxyDisinfectionToussesCustomInvoice) { top.Ext.MessageBox.confirm("请确认", "本次发货含有进行了代理灭菌的器械包,是否继续操作?", function (button, text) { if ("yes" == button) { doSubmitForm(printInvoiceCallback); } else { return false; } }); - }else{ + } else { var proxySterileTousseBarcodeArray = []; - for(var i = 0;i < proxySterileTousseArrayLength;i++){ + for (var i = 0; i < proxySterileTousseArrayLength; i++) { proxySterileTousseBarcodeArray.push(proxySterileTousseArray[i].get("barcode")); } var proxySterileTousseBarcodes = proxySterileTousseBarcodeArray.join(",") + (proxySterileTousseArrayLength > 5) ? "..." : ""; showResult("本次发货含有以下条码代理灭菌的器械包,请移除后再保存!
" + proxySterileTousseBarcodes); } - }else{ + } else { doSubmitForm(printInvoiceCallback); } } /** * 表章提交 */ - function doSubmitForm(printInvoiceCallback){ + function doSubmitForm(printInvoiceCallback) { getTousseGridData(); - form.form.submit( { + form.form.submit({ //url : WWWROOT + '/disinfectSystem/invoiceAction!saveDepartInvoice.do', - url : WWWROOT + '/disinfectSystem/invoiceAction!saveInvoiceByDepartOrInvoicePlanId.do', - method : 'POST', - waitMsg : '正在保存数据,请稍候', - waitTitle : '提交表单', - success : function(form, action) { + url: WWWROOT + '/disinfectSystem/invoiceAction!saveInvoiceByDepartOrInvoicePlanId.do', + method: 'POST', + waitMsg: '正在保存数据,请稍候', + waitTitle: '提交表单', + success: function (form, action) { // 一定要事务提交成功才返回发货计划列表界面 showResult(action.result.message); - if(action.result.success){ - if(printInvoiceCallback != null){ + if (action.result.success) { + if (printInvoiceCallback != null) { printInvoiceCallback(action.result.invoiceIds); } window.close(); reloadSelf(); } }, - failure : function(form, action) { - if(!isUndefinedOrNullOrEmpty(action.result) && !isUndefinedOrNullOrEmpty(action.result.message)){ + failure: function (form, action) { + if (!isUndefinedOrNullOrEmpty(action.result) && !isUndefinedOrNullOrEmpty(action.result.message)) { showResult(action.result.message); - }else{ + } else { showResult("发货超时,请稍后查看发货单以确定发货是否成功,避免重复发货!"); //window.close(); } } }); } - function doCancelAction(){ + function doCancelAction() { //切记注意:按取消关闭window后,一定要把已选择的申请单号变量清空 selectedInvoicePlanId = ""; window.close(); -// reloadSelf(); + // reloadSelf(); } - - function printInvoiceAfterInvoice(invoiceIds){ - if(!isUndefinedOrNull(invoiceIds)){ - var invoicePrintModule = new InvoicePrintModule(null,$Id('userName').value); - invoicePrintModule.batchPrintInvoiceWithType_dwr(invoiceIds.join(","),'全部'); + + function printInvoiceAfterInvoice(invoiceIds) { + if (!isUndefinedOrNull(invoiceIds)) { + var invoicePrintModule = new InvoicePrintModule(null, $Id('userName').value); + invoicePrintModule.batchPrintInvoiceWithType_dwr(invoiceIds.join(","), '全部'); } } - + var cookieAssistantSender = Ext.state.Manager.getProvider().get('cookieAssistantSender'); - if(getSystemSetConfig('rememberLastInvoiceAssistantSender',false) && cookieAssistantSender){ + if (getSystemSetConfig('rememberLastInvoiceAssistantSender', false) && cookieAssistantSender) { top.Ext.getCmp('assistantSender').setValue(cookieAssistantSender); } var currentHeight; - if(!getSystemSetConfig('showInvoiceAssistantSender',true)){ - currentHeight = top.screen.height < 854 ? windowH-10 : 690; - }else { - currentHeight = top.screen.height < 864 ? windowH+10 : 710; + if (!getSystemSetConfig('showInvoiceAssistantSender', true)) { + currentHeight = top.screen.height < 854 ? windowH - 10 : 690; + } else { + currentHeight = top.screen.height < 864 ? windowH + 10 : 710; } - var window = new top.Ext.Window( { - id : 'recyclingApplicationWin', - layout : 'fit', - title : '发货单', - width : top.screen.width < 1280 ? windowW : 1280, - height:currentHeight, - border : false, - modal : true, - plain : true, - items : [form] - }); - - window.on('close',function(w){ + var window; + var enableAbnormalItemListFixedDisplay = sstsConfig.enableAbnormalItemListFixedDisplay || false; + if (enableAbnormalItemListFixedDisplay && sstsConfig.isUseAbnormalGoodsTable) { + var winWidth = recyclingApplicationWinWidth + 590; + var invoicePlan_form = renderRecyclingApplicationForm('customInvoiceForm'); + window = new top.Ext.Window({ + id: 'recyclingApplicationWin', + layout: 'border', + title: '发货单', + resizable: false, + width: winWidth, + height: currentHeight, + border: false, + modal: true, + plain: true, + stateful: false, + buttonAlign: 'center', + items: [form, invoicePlan_form], + buttons: [{ + text: sstsConfig.aliasNameOfSaveKeywordInInvoiceForm ? sstsConfig.aliasNameOfSaveKeywordInInvoiceForm : '保存', + id: 'saveButton', + handler: function () { + doSaveAction(); + } + }, { + text: sstsConfig.aliasNameOfSaveKeywordInInvoiceForm ? sstsConfig.aliasNameOfSaveKeywordInInvoiceForm + '并打印' : '保存并打印', + id: 'saveAndPrintButton', + handler: function () { doSaveAction(printInvoiceAfterInvoice); } + }, { + text: '取消', + id: 'cancelButton', + handler: function () { + doCancelAction(); + } + }] + }); + } else { + window = new top.Ext.Window({ + id: 'recyclingApplicationWin', + layout: 'fit', + title: '发货单', + width: top.screen.width < 1280 ? windowW : 1280, + height: currentHeight, + border: false, + modal: true, + plain: true, + buttonAlign: 'center', + items: [form], + buttons: [{ + text: sstsConfig.aliasNameOfSaveKeywordInInvoiceForm ? sstsConfig.aliasNameOfSaveKeywordInInvoiceForm : '保存', + id: 'saveButton', + handler: function () { + doSaveAction(); + } + }, { + text: sstsConfig.aliasNameOfSaveKeywordInInvoiceForm ? sstsConfig.aliasNameOfSaveKeywordInInvoiceForm + '并打印' : '保存并打印', + id: 'saveAndPrintButton', + handler: function () { doSaveAction(printInvoiceAfterInvoice); } + }, { + text: '取消', + id: 'cancelButton', + handler: function () { + doCancelAction(); + } + }] + }); + } + + window.on('close', function (w) { //切记注意:按取消关闭window后,一定要把已选择的申请单号变量清空 selectedInvoicePlanId = ""; }); window.show(); -// top.Ext.getCmp(defaultFocusedFieldOnInvoiceForm).focus(false, 100); + // top.Ext.getCmp(defaultFocusedFieldOnInvoiceForm).focus(false, 100); top.Ext.getCmp('departBarcode').focus(false, 100); - + wareHouseStore.load(); + + if (enableAbnormalItemListFixedDisplay && sstsConfig.isUseAbnormalGoodsTable) { + var tabs = top.Ext.getCmp('tabpanel') + tabs.hideTabStripItem(0); + } } //展示器械包信息 function showDisinfectMaterial(tousseName) { - var materialStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getMaterialDefinitionByTousseName.do', - method : 'POST' - }), - baseParams : {tousseName : tousseName}, - reader : new Ext.data.JsonReader({ - fields : [ - {name : 'materialDefinitionId'}, - {name : 'name'}, - {name : 'count'} - ] - }) - }); - materialStore.load(); - var materialGrid = new top.Ext.grid.GridPanel({ - id :'materialGrid', - store: materialStore, - columns: [ - {hidden : true, dataIndex : 'materialDefinitionId'}, - {header : "材料名称",width : 80, menuDisabled: true,dataIndex : 'name'}, - {header : "数量",width : 27, menuDisabled: true,dataIndex : 'count'} - ], - viewConfig: { - forceFit: true - }, - autoExpandColumn : 'materialAmount', - frame:false - }); - - var window = new top.Ext.Window({ - title : tousseName + '信息', - width : 400, - height :200, - border : false, - autoScroll: true, - layout : 'fit', - modal : true, - items : [materialGrid] - }); - window.show(); + var materialStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getMaterialDefinitionByTousseName.do', + method: 'POST' + }), + baseParams: { tousseName: tousseName }, + reader: new Ext.data.JsonReader({ + fields: [ + { name: 'materialDefinitionId' }, + { name: 'name' }, + { name: 'count' } + ] + }) + }); + materialStore.load(); + var materialGrid = new top.Ext.grid.GridPanel({ + id: 'materialGrid', + store: materialStore, + columns: [ + { hidden: true, dataIndex: 'materialDefinitionId' }, + { header: "材料名称", width: 80, menuDisabled: true, dataIndex: 'name' }, + { header: "数量", width: 27, menuDisabled: true, dataIndex: 'count' } + ], + viewConfig: { + forceFit: true + }, + autoExpandColumn: 'materialAmount', + frame: false + }); + + var window = new top.Ext.Window({ + title: tousseName + '信息', + width: 400, + height: 200, + border: false, + autoScroll: true, + layout: 'fit', + modal: true, + items: [materialGrid] + }); + window.show(); } //获取扫描的物品 function getTousseGridData() { var submitItems = []; - for ( var i = 0; i < sendOutGoodsStore.getCount(); i++) { + for (var i = 0; i < sendOutGoodsStore.getCount(); i++) { var record = sendOutGoodsStore.getAt(i); record.data.sendAmount = record.data.count; submitItems.push(record.data); @@ -1512,7 +1584,7 @@ * 根据申请科室设置其默认结算科室 * @param deptCoding 申请科室编码 */ -function setDefaultSettleAccountDepartByDeptCoding(deptCoding){ +function setDefaultSettleAccountDepartByDeptCoding(deptCoding) { Ext.Ajax.request({ url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getDefaultSettleAccountDepart.do', params: { @@ -1532,8 +1604,8 @@ }); } -Ext.onReady(function() { +Ext.onReady(function () { Ext.QuickTips.init(); - - addAndEditInvoicePlan('',''); + + addAndEditInvoicePlan('', ''); }); \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationInvoiceView.js =================================================================== diff -u -r37410 -r41535 --- ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationInvoiceView.js (.../operationReservationInvoiceView.js) (revision 37410) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationInvoiceView.js (.../operationReservationInvoiceView.js) (revision 41535) @@ -4,42 +4,42 @@ var TYPE_OPERATION_RESERVATION = '手术预约发货'; var INVOICE_MODE_DEPART = 'invoicePlan'; //明细grid删除按钮 -function renderDeleteButton(v,p,record,rowIndex){ - return ""; +function renderDeleteButton(v, p, record, rowIndex) { + return ""; } //删除grid明细 -function deleteItem(tousseDefinitionId){ +function deleteItem(tousseDefinitionId) { var gridStore = top.Ext.getCmp('operationReservationGrid').getStore(); - for(var i = 0;i < gridStore.getCount();i++){ + for (var i = 0; i < gridStore.getCount(); i++) { var record = gridStore.getAt(i); - if(record.data.tousseDefinitionId == tousseDefinitionId){ + if (record.data.tousseDefinitionId == tousseDefinitionId) { gridStore.remove(record); break; } } } //Ext.form.DateField在IE8下显示不全 Ext.override(top.Ext.menu.Menu, { - autoWidth: function() { - this.width += "px"; - } + autoWidth: function () { + this.width += "px"; + } }); var goodsItemRecord = Ext.data.Record.create([ - {name : 'itemId'}, - {name : 'tousseDefinitionId'}, - {name : 'name'}, - {name : 'amount'} + { name: 'itemId' }, + { name: 'tousseDefinitionId' }, + { name: 'name' }, + { name: 'amount' } ]); -function editOperationReservation(id) {} +function editOperationReservation(id) { } // 删除 -function deleteOperationReservation(grid) {} +function deleteOperationReservation(grid) { } -function editRecord(id){ -// editOperationReservation(id); +function editRecord(id) { + // editOperationReservation(id); var records = grid.getSelectionModel().getSelections(); if (records.length == 0) { showResult("请选择要发货的手术预约单!"); @@ -53,66 +53,66 @@ var depart = records[0].data['depart']; //提交状态,true表示已提交,false表示未提交 var committedStatus = records[0].data['committedStatus']; - addAndEditInvoicePlan(departCoding,depart,id,committedStatus,records[0].data); + addAndEditInvoicePlan(departCoding, depart, id, committedStatus, records[0].data); } -function modify(v,data){ +function modify(v, data) { editRecord(data['id']); } //BJDXZLYY-46:智能货柜查询 -function showOperationReservationStorageTousse(id){ +function showOperationReservationStorageTousse(id) { var operationReservationStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectsystem/operationReservationAction!loadOperationReservationStorageTousse.do', - method : 'POST' - }), - baseParams : {id : id}, - reader : new Ext.data.JsonReader({ - root : 'data' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectsystem/operationReservationAction!loadOperationReservationStorageTousse.do', + method: 'POST' + }), + baseParams: { id: id }, + reader: new Ext.data.JsonReader({ + root: 'data' }, [ - {name : 'id',mapping : 'id'}, - {name : 'showTousseName',mapping : 'showTousseName'}, - {name : 'barcode',mapping : 'barcode'}, - {name : 'storageLocation',mapping : 'storageLocation'}, - {name : 'validUntilStr',mapping : 'validUntilStr'} + { name: 'id', mapping: 'id' }, + { name: 'showTousseName', mapping: 'showTousseName' }, + { name: 'barcode', mapping: 'barcode' }, + { name: 'storageLocation', mapping: 'storageLocation' }, + { name: 'validUntilStr', mapping: 'validUntilStr' } ]) - }); - operationReservationStore.load(); + }); + operationReservationStore.load(); var selectModel = new top.Ext.grid.CheckboxSelectionModel(); - - var operationReservationGrid = new top.Ext.grid.GridPanel({ - id :'operationReservationlGrid', - store: operationReservationStore, - cm: new top.Ext.grid.ColumnModel([selectModel, + + var operationReservationGrid = new top.Ext.grid.GridPanel({ + id: 'operationReservationlGrid', + store: operationReservationStore, + cm: new top.Ext.grid.ColumnModel([selectModel, { menuDisabled: true, - header : "器械包名称", - width:250, - dataIndex : 'showTousseName' - },{ + header: "器械包名称", + width: 250, + dataIndex: 'showTousseName' + }, { menuDisabled: true, - header : "器械包条码", - width:80, - dataIndex : 'barcode' - },{ + header: "器械包条码", + width: 80, + dataIndex: 'barcode' + }, { menuDisabled: true, - header : "抽屉名称", - width:130, - dataIndex : 'storageLocation' - },{ + header: "抽屉名称", + width: 130, + dataIndex: 'storageLocation' + }, { menuDisabled: true, - header : "失效日期", - width:120, - dataIndex : 'validUntilStr' + header: "失效日期", + width: 120, + dataIndex: 'validUntilStr' } - ]), - sm:selectModel, - viewConfig: {forceFit:true}, - height: 240, - frame : false - }); + ]), + sm: selectModel, + viewConfig: { forceFit: true }, + height: 240, + frame: false + }); var configWin = new top.Ext.Window({ id: 'configWin', @@ -123,7 +123,7 @@ border: false, plain: true, modal: true, - buttonAlign:'center', + buttonAlign: 'center', items: [{ region: 'center', width: 500, @@ -134,20 +134,20 @@ text: '保存', handler: function () { var records = operationReservationGrid.getSelectionModel().getSelections(); - if(records.length > 0){ + if (records.length > 0) { var orgUnitCoding = top.Ext.getCmp('orgUnitCoding').getValue(); - for(var i=0;i" + v + "

"; + return "

" + v + "

"; } - + //发货状态 - function renderDeliverStatusColor(v, p, record){ + function renderDeliverStatusColor(v, p, record) { var status = record.data['deliverStatus']; var color = ""; - if("待发货" == status){//待发货 黄色 + if ("待发货" == status) {//待发货 黄色 color = "yellow"; - }else if("部分发货" == status){ //部分发货 粉红色 + } else if ("部分发货" == status) { //部分发货 粉红色 color = "#F5A7FA"; } - return "

" + v + "

"; + return "

" + v + "

"; } - + var columns = [ - {header : "流水号",width : 100,dataIndex : 'serialNumber', renderer : modifyRecord}, - {header : "申请科室",width : 120,dataIndex : 'depart'}, - {header : "申请人",width : 60,dataIndex : 'applicant'}, - {header : "申请时间",width : 120,dataIndex : 'applicationTime', renderer : myDateFormatByMinute}, - {header : "医生",width : 120,dataIndex : 'doctors'}, - {header : "手术时间",width : 120,dataIndex : 'operationTime', renderer : myDateFormatByMinute}, - {header : "手术编号",width : 120,dataIndex : 'scheduleId', renderer : myDateFormatByMinute}, - {header : "手术间",width : 120,dataIndex : 'operationRoom'}, - {header : "手术台次",width : 120,dataIndex : 'consoleName', renderer : myDateFormatByMinute}, - {header : "提交状态",width : 65,dataIndex : 'committedStatus', renderer : renderCommittedStatusColor}, - {header : "发货状态",width : 65,dataIndex : 'deliverStatus', renderer : renderDeliverStatusColor}, - {id:'remark',header: "备注", dataIndex: 'remark'} - ]; + { header: "流水号", width: 100, dataIndex: 'serialNumber', renderer: modifyRecord }, + { header: "申请科室", width: 120, dataIndex: 'depart' }, + { header: "申请人", width: 60, dataIndex: 'applicant' }, + { header: "申请时间", width: 120, dataIndex: 'applicationTime', renderer: myDateFormatByMinute }, + { header: "医生", width: 120, dataIndex: 'doctors' }, + { header: "手术时间", width: 120, dataIndex: 'operationTime', renderer: myDateFormatByMinute }, + { header: "手术编号", width: 120, dataIndex: 'scheduleId', renderer: myDateFormatByMinute }, + { header: "手术间", width: 120, dataIndex: 'operationRoom' }, + { header: "手术台次", width: 120, dataIndex: 'consoleName', renderer: myDateFormatByMinute }, + { header: "提交状态", width: 65, dataIndex: 'committedStatus', renderer: renderCommittedStatusColor }, + { header: "发货状态", width: 65, dataIndex: 'deliverStatus', renderer: renderDeliverStatusColor }, + { id: 'remark', header: "备注", dataIndex: 'remark' } + ]; var readerDetail = [ - {name : 'id'}, - {name : 'serialNumber'}, - {name : 'depart'}, - {name : 'departCoding'}, - {name : 'operationTime'}, - {name : 'applicant'}, - {name : 'applicationTime'}, - {name : 'doctors'}, - {name : 'scheduleId'}, - {name : 'patientName'}, - {name : 'operationName'}, - {name : 'operatingRoom'}, - {name : 'consoleName'}, - {name : 'deliverStatus'}, - {name : 'operationRoom'}, - {name : 'committedStatus'}, - {name : 'remark'} + { name: 'id' }, + { name: 'serialNumber' }, + { name: 'depart' }, + { name: 'departCoding' }, + { name: 'operationTime' }, + { name: 'applicant' }, + { name: 'applicationTime' }, + { name: 'doctors' }, + { name: 'scheduleId' }, + { name: 'patientName' }, + { name: 'operationName' }, + { name: 'operatingRoom' }, + { name: 'consoleName' }, + { name: 'deliverStatus' }, + { name: 'operationRoom' }, + { name: 'committedStatus' }, + { name: 'remark' } ]; - + var filters = new Ext.grid.GridFilters({ - filters:[ - {type: 'string', dataIndex: 'serialNumber'}, - {type: 'string', dataIndex: 'depart'}, - {type: 'string', dataIndex: 'applicant'}, - {type: 'string', dataIndex: 'doctors'}, - {type: 'string', dataIndex: 'deliverStatus'}, - {type: 'string', dataIndex: 'remark'} - ]} + filters: [ + { type: 'string', dataIndex: 'serialNumber' }, + { type: 'string', dataIndex: 'depart' }, + { type: 'string', dataIndex: 'applicant' }, + { type: 'string', dataIndex: 'doctors' }, + { type: 'string', dataIndex: 'deliverStatus' }, + { type: 'string', dataIndex: 'remark' } + ] + } ); var sign = true; var tbar = [{ - text : '添加', - hidden : true, - iconCls : 'btn_ext_application_add', - handler : function() { + text: '添加', + hidden: true, + iconCls: 'btn_ext_application_add', + handler: function () { editOperationReservation(""); } }, { - text : '删除', - hidden : true, - iconCls : 'btn_ext_application_del', - handler : function() { + text: '删除', + hidden: true, + iconCls: 'btn_ext_application_del', + handler: function () { deleteOperationReservation(grid); } }, { - text : '刷新列表', - iconCls : 'btn_ext_refresh1', - handler : function() { + text: '刷新列表', + iconCls: 'btn_ext_refresh1', + handler: function () { grid.dwrReload(); } }]; - grid = new Ext.ux.ForgonPageGrid( { - id:'operationReservationInvoiceView_grid', - tbar : tbar, - pageSize : 20, - defaultSortField : 'id', - title : entityName + '列表', - defaultSortDirection : 'DESC', - isCheckboxSelectionModel : true, - rememberSelected : false, - isShowSearchField : true, - columns : columns, + grid = new Ext.ux.ForgonPageGrid({ + id: 'operationReservationInvoiceView_grid', + tbar: tbar, + pageSize: 20, + defaultSortField: 'id', + title: entityName + '列表', + defaultSortDirection: 'DESC', + isCheckboxSelectionModel: true, + rememberSelected: false, + isShowSearchField: true, + columns: columns, plugins: filters, - autoExpandColumn : 'remark', - renderTo : 'gridDiv', - frame : false + autoExpandColumn: 'remark', + renderTo: 'gridDiv', + frame: false }, readerDetail, OperationReservationTableManager.findWaitingForDeliveryOperationReservationTableList, - null + null ); - var viewport = new Ext.Viewport( { - layout : 'border', - items : [{ - region : 'center', - margins : '0 0 0 0', - layout : 'fit', - items : grid + var viewport = new Ext.Viewport({ + layout: 'border', + items: [{ + region: 'center', + margins: '0 0 0 0', + layout: 'fit', + items: grid }] }); }); @@ -294,28 +295,28 @@ var lastLoadWarehouseId = null; var wareHouseStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/wareHouseAction!getWareHouseData.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/wareHouseAction!getWareHouseData.do', + method: 'POST' }), - reader : new Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' + reader: new Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' }, [ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'}, - {name : 'orgUnitCode',mapping : 'orgUnitCode'} + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' }, + { name: 'orgUnitCode', mapping: 'orgUnitCode' } ]), - listeners : { - load : function(store,records) { + listeners: { + load: function (store, records) { var id = top.Ext.getCmp('sourceWarehouseId').getValue(); //var name = top.Ext.getCmp('sourceWarehouseName').getValue(); - if(records.length > 0 && (id == null || id == '')){ + if (records.length > 0 && (id == null || id == '')) { //id=records[0].data.id; //name = records[0].data.name; var combo = top.Ext.getCmp("warehouse"); // 触发选中事件 - combo.fireEvent('select', combo,records[0],0); + combo.fireEvent('select', combo, records[0], 0); } //top.Ext.getCmp('warehouse').setValue(id); //top.Ext.getCmp('sourceWarehouseId').setValue(id); @@ -325,138 +326,138 @@ }); var storageLocationStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/storageLocationAction!loadStorageLocationByOrgUnitCode.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/storageLocationAction!loadStorageLocationByOrgUnitCode.do', + method: 'POST' }), - reader : new Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' + reader: new Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' }, [ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'}, - {name : 'barcode',mapping : 'barcode'}, - {name : 'storageLocationCode',mapping : 'storageLocationCode'} + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' }, + { name: 'barcode', mapping: 'barcode' }, + { name: 'storageLocationCode', mapping: 'storageLocationCode' } ]), - listeners : { - beforeload:function(thiz){ - if(top.Ext.getCmp('orgUnitCoding')){ + listeners: { + beforeload: function (thiz) { + if (top.Ext.getCmp('orgUnitCoding')) { thiz.baseParams["orgUnitCode"] = top.Ext.getCmp('orgUnitCoding').getValue(); } } } }); -if(sstsConfig.disableLoadToVirtualBasket == false){ +if (sstsConfig.disableLoadToVirtualBasket == false) { beginBarcodeLabel = '条码/篮筐(首):'; hiddenEndBarcode = false;//显示尾篮筐 } //条码扫描模式(单个条码逐个扫描或首尾条码段扫描两种模式) var currentScanMode = "single"; -if(sstsConfig.invoicePageScanMode && sstsConfig.invoicePageScanMode != null){ +if (sstsConfig.invoicePageScanMode && sstsConfig.invoicePageScanMode != null) { currentScanMode = sstsConfig.invoicePageScanMode; } -function getDefaultAmount(v,p,record){ - if (v==null || v.length <= 0){ +function getDefaultAmount(v, p, record) { + if (v == null || v.length <= 0) { return 0; - }else{ - return v; + } else { + return v; } } -function formatStorage(v,p,record){ - if (v==null || v.length <= 0){ +function formatStorage(v, p, record) { + if (v == null || v.length <= 0) { return ''; - }else{ - return v; + } else { + return v; } } -function sayGoods(record){ - if(record && record.data){ +function sayGoods(record) { + if (record && record.data) { speaker.speak(record.data.showTousseName + ",数量为" + record.data.count); } } //发货单明细累减 -function updateAmount1(name,amount){ - if(name != null && name.length > 0){ - for ( var i = 0; i < recyclingapplicationStore.getCount(); i++) { - var record = recyclingapplicationStore.getAt(i); - var tempName = record.get('name'); - var tempAmount = record.get('tempAmount'); - if(tempName == name){ - if(tempAmount==null || tempAmount.length <= 0){ - tempAmount = 0; - } - record.set('tempAmount',Number(tempAmount) - Number(amount)); +function updateAmount1(name, amount) { + if (name != null && name.length > 0) { + for (var i = 0; i < recyclingapplicationStore.getCount(); i++) { + var record = recyclingapplicationStore.getAt(i); + var tempName = record.get('name'); + var tempAmount = record.get('tempAmount'); + if (tempName == name) { + if (tempAmount == null || tempAmount.length <= 0) { + tempAmount = 0; + } + record.set('tempAmount', Number(tempAmount) - Number(amount)); updateErrorAmount(record); refreshTotalAmount(); - } + } } } return false; } //删除发货扫描的物品 -function removeSendOutGoods(id){ +function removeSendOutGoods(id) { var rows = top.Ext.getCmp('sendOutGoods').getSelectionModel().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']; + var amount = rows[i].data['count']; sendOutGoodsStore.remove(rows[i]); - updateAmount1(name,amount); + updateAmount1(name, amount); sendDeleteScannedGoodsLog(rows[i].data); } } } //删除发货明细项 -function removeSendOutGoodsDetail(id){ +function removeSendOutGoodsDetail(id) { var rows = top.Ext.getCmp('sendOutGoodsDetail').getSelectionModel().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']; + var amount = rows[i].data['count']; recyclingapplicationStore.remove(rows[i]); } } } //删除发货明细项 -function removeSendOutTousseByBarcode(barcode){ - var record = findRecordByNameAndValueFromStore(sendOutGoodsStore,'barcode',barcode); - if(record != null){ +function removeSendOutTousseByBarcode(barcode) { + var record = findRecordByNameAndValueFromStore(sendOutGoodsStore, 'barcode', barcode); + if (record != null) { var name = record.data['name']; - sendOutGoodsStore.remove(record); - updateAmount1(name,1); + sendOutGoodsStore.remove(record); + updateAmount1(name, 1); } } //验证条码是否重复扫描 -function isBarcodeRepeat(barcode){ - if(barcode != null && barcode.length > 0){ - for ( var i = 0; i < sendOutGoodsStore.getCount(); i++) { - var record = sendOutGoodsStore.getAt(i); - var tempBarcode =record.get('barcode'); - if(barcode == tempBarcode){ - return true; - break; - } +function isBarcodeRepeat(barcode) { + if (barcode != null && barcode.length > 0) { + for (var i = 0; i < sendOutGoodsStore.getCount(); i++) { + var record = sendOutGoodsStore.getAt(i); + var tempBarcode = record.get('barcode'); + if (barcode == tempBarcode) { + return true; + break; + } } } return false; } -function removeTousseIfNeeded(goods){ +function removeTousseIfNeeded(goods) { var barcode = goods.barcode; - if(isBarcodeRepeat(barcode)){ + if (isBarcodeRepeat(barcode)) { var name = goods.name; for (var i = 0; i < recyclingapplicationStore.getCount(); i++) { var record = recyclingapplicationStore.getAt(i); var tempName = record.get('name'); var tempAmount = record.get('tempAmount'); - if(tempName == name){ + if (tempName == name) { var errorAmount = record.get('errorAmount'); - if(errorAmount < 0){ + if (errorAmount < 0) { removeSendOutTousseByBarcode(barcode); return true; } @@ -468,75 +469,75 @@ //扫描的物品是否是待发货物品 //name不是showTousseName字段 -function isInvoiceGoods(name){ - if(name != null && name.length > 0){ - for ( var i = 0; i < recyclingapplicationStore.getCount(); i++) { - var record = recyclingapplicationStore.getAt(i); - var name1 =record.get('name'); - if(name == name1){ - return true; - break; - } +function isInvoiceGoods(name) { + if (name != null && name.length > 0) { + for (var i = 0; i < recyclingapplicationStore.getCount(); i++) { + var record = recyclingapplicationStore.getAt(i); + var name1 = record.get('name'); + if (name == name1) { + return true; + break; + } } } return false; } //发货单明细累加 -function updateAmount(name,amount){ - if(name != null && name.length > 0){ +function updateAmount(name, amount) { + if (name != null && name.length > 0) { for (var i = 0; i < recyclingapplicationStore.getCount(); i++) { var record = recyclingapplicationStore.getAt(i); var tempName = record.get('name'); var tempAmount = record.get('tempAmount'); - if(tempName == name){ - if(tempAmount==null || tempAmount.length <= 0){ + if (tempName == name) { + if (tempAmount == null || tempAmount.length <= 0) { tempAmount = 0; } - record.set('tempAmount',Number(amount) + Number(tempAmount)); + record.set('tempAmount', Number(amount) + Number(tempAmount)); updateErrorAmount(record); refreshTotalAmount(); } } } return false; } -function updateErrorAmount(record){ +function updateErrorAmount(record) { var awaitSendingAmount = record.get('count'); var sentAmount = record.get('tempAmount'); - record.set('errorAmount',awaitSendingAmount - sentAmount); + record.set('errorAmount', awaitSendingAmount - sentAmount); } -function initErrorAmount(){ - for ( var i = 0; i < recyclingapplicationStore.getCount(); i++) { - var record = recyclingapplicationStore.getAt(i); - var awaitSendingAmount = record.get('count'); - var sentAmount = record.get('tempAmount'); - record.set('errorAmount',awaitSendingAmount - sentAmount); +function initErrorAmount() { + for (var i = 0; i < recyclingapplicationStore.getCount(); i++) { + var record = recyclingapplicationStore.getAt(i); + var awaitSendingAmount = record.get('count'); + var sentAmount = record.get('tempAmount'); + record.set('errorAmount', awaitSendingAmount - sentAmount); } } //校验物品数量是否为数字 function validGridAmount() { //申请的物品 var b = true; - for ( var i = 0; i < recyclingapplicationStore.getCount(); i++) { - var record = recyclingapplicationStore.getAt(i); - var count =record.get('count'); - if(/[^0-9]/g.test(count)){ - showResult('['+record.get('name')+'] 申请数量必须是数字,保存失败!'); - top.Ext.getCmp('sendOutGoodsDetail').getView().getRow(i).style.backgroundColor = '#FFB5B5'; - b = false; - break; - } + for (var i = 0; i < recyclingapplicationStore.getCount(); i++) { + var record = recyclingapplicationStore.getAt(i); + var count = record.get('count'); + if (/[^0-9]/g.test(count)) { + showResult('[' + record.get('name') + '] 申请数量必须是数字,保存失败!'); + top.Ext.getCmp('sendOutGoodsDetail').getView().getRow(i).style.backgroundColor = '#FFB5B5'; + b = false; + break; + } } - for ( var i = 0; i < sendOutGoodsStore.getCount(); i++) { - var record = sendOutGoodsStore.getAt(i); - var count =record.get('count'); - if(/[^0-9]/g.test(count)){ - showResult('['+record.get('name')+'] 申请数量必须是数字,保存失败!'); - top.Ext.getCmp('sendOutGoods').getView().getRow(i).style.backgroundColor = '#FFB5B5'; - b = false; - break; - } + for (var i = 0; i < sendOutGoodsStore.getCount(); i++) { + var record = sendOutGoodsStore.getAt(i); + var count = record.get('count'); + if (/[^0-9]/g.test(count)) { + showResult('[' + record.get('name') + '] 申请数量必须是数字,保存失败!'); + top.Ext.getCmp('sendOutGoods').getView().getRow(i).style.backgroundColor = '#FFB5B5'; + b = false; + break; + } } return b; } @@ -545,355 +546,376 @@ function validTousseGridData() { //申请的物品 var b = true; - for ( var i = 0; i < recyclingapplicationStore.getCount(); i++) { - var record = recyclingapplicationStore.getAt(i); - var count =record.get('count'); - var tempAmount = record.get('tempAmount'); - var applicationAmount = record.get('applicationAmount'); - if(count != tempAmount){//实际数量要与发货数量相同 - b = false; - top.Ext.getCmp('sendOutGoodsDetail').getView().getRow(i).style.backgroundColor = '#FFB5B5'; - showResult(record.get('showTousseName')+" 发货数量与实发数量不同!"); - } - if(Number(count) > Number(applicationAmount)){//发货数量不能大于待发货数量 - b = false; - top.Ext.getCmp('sendOutGoodsDetail').getView().getRow(i).style.backgroundColor = '#FFB5B5'; - showResult(record.get('name')+" 发货数量不能大于" + applicationAmount); - } + for (var i = 0; i < recyclingapplicationStore.getCount(); i++) { + var record = recyclingapplicationStore.getAt(i); + var count = record.get('count'); + var tempAmount = record.get('tempAmount'); + var applicationAmount = record.get('applicationAmount'); + if (count != tempAmount) {//实际数量要与发货数量相同 + b = false; + top.Ext.getCmp('sendOutGoodsDetail').getView().getRow(i).style.backgroundColor = '#FFB5B5'; + showResult(record.get('showTousseName') + " 发货数量与实发数量不同!"); + } + if (Number(count) > Number(applicationAmount)) {//发货数量不能大于待发货数量 + b = false; + top.Ext.getCmp('sendOutGoodsDetail').getView().getRow(i).style.backgroundColor = '#FFB5B5'; + showResult(record.get('name') + " 发货数量不能大于" + applicationAmount); + } } return b; } var addGridItem = Ext.data.Record.create([ - {name : 'id'}, - {name : 'barcode'}, - {name : 'name'}, - {name : 'showTousseName'}, - {name : 'count'}, - {name : 'diposable'}, - {name : 'price'}, - {name : 'fluctuationPrice'}, - {name : 'storage'}, - {name : 'batchNumber'}, - {name : 'tousseType'}, - {name : 'typeInfoOnScanned'}, - {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: 'storage' }, + { name: 'batchNumber' }, + { name: 'tousseType' }, + { name: 'typeInfoOnScanned' }, + { name: 'sterilizerName' }, + { name: 'frequency' }, + { name: 'isTracable' }, + { name: 'tousseDefinitionId' } +]); // 根据条码获取发送项 -function getSendOutGoodsByBarcode(barcode){ - if(isUndefinedOrNullOrEmpty(barcode)){ +function getSendOutGoodsByBarcode(barcode) { + if (isUndefinedOrNullOrEmpty(barcode)) { return null; } - for ( var i = 0; i < sendOutGoodsStore.getCount(); i++) { - var record = sendOutGoodsStore.getAt(i); - var tempBarcode =record.get('barcode'); - if(barcode == tempBarcode){ - return record.data; - } + for (var i = 0; i < sendOutGoodsStore.getCount(); i++) { + var record = sendOutGoodsStore.getAt(i); + var tempBarcode = record.get('barcode'); + if (barcode == tempBarcode) { + return record.data; + } } return null; } // 名字到数量的map -function getTousseNameToAmountMap(scannedResult){ +function getTousseNameToAmountMap(scannedResult) { var map = {}; - for(var i=0;i 0 && notSendAmount < storageAmount){// 待发货数量小于库存 -// count = notSendAmount; -// }else{ -// count = storageAmount; -// } + // var waitDeliveryCount = record.data['count'];// 申请数量 + // var sendAmount = Number(record.data['tempAmount']);// 已扫描数量 + // var notSendAmount = Number(waitDeliveryCount) - Number(sendAmount);// 待发货数量 + // var sendAmount = 0 ; + // if(notSendAmount > 0 && notSendAmount < storageAmount){// 待发货数量小于库存 + // count = notSendAmount; + // }else{ + // count = storageAmount; + // } count = storageAmount; - + var price = goods.price; var record = new addGridItem({ - id : 0, - barcode : goods.barcode, - name : goods.name, - showTousseName : goods.showTousseName, - count : count, - diposable : goods.diposable, - price : price, - fluctuationPrice : goods.fluctuationPrice, - storage : storageAmount, - batchNumber : goods.batchNumber, - tousseType : goods.tousseType, - typeInfoOnScanned : goods.typeInfoOnScanned, - sterilizerName : goods.sterilizerName, - frequency : goods.frequency, - isTracable : goods.isTracable, - tousseDefinitionId : goods.tousseDefinitionId, - externalCode : goods.externalCode, - isRoutine : goods.isRoutine + id: 0, + barcode: goods.barcode, + name: goods.name, + showTousseName: goods.showTousseName, + count: count, + diposable: goods.diposable, + price: price, + fluctuationPrice: goods.fluctuationPrice, + storage: storageAmount, + batchNumber: goods.batchNumber, + tousseType: goods.tousseType, + typeInfoOnScanned: goods.typeInfoOnScanned, + sterilizerName: goods.sterilizerName, + frequency: goods.frequency, + isTracable: goods.isTracable, + tousseDefinitionId: goods.tousseDefinitionId, + externalCode: goods.externalCode, + isRoutine: goods.isRoutine }); -// sendOutGoodsStore.add(record); - sendOutGoodsStore.insert(0,record); - speakBasket.addGoods('',record.data.showTousseName,record.data.count); -// clearScanText(); - updateAmount(goods.name,count); + // sendOutGoodsStore.add(record); + sendOutGoodsStore.insert(0, record); + speakBasket.addGoods('', record.data.showTousseName, record.data.count); + // clearScanText(); + updateAmount(goods.name, count); } -function clearScanText(){ +function clearScanText() { var barcodeEnd = top.Ext.getCmp("scanTextEnd").getValue().Trim(); - if(barcodeEnd == ''){ - if(hiddenEndBarcode || currentScanMode == 'single'){ + if (barcodeEnd == '') { + if (hiddenEndBarcode || currentScanMode == 'single') { top.Ext.getCmp('scanText').setValue("");//如果使用虚拟篮筐机制,扫描成功后需要清除该文本内容 - }else{ + } else { top.Ext.getCmp('scanTextEnd').focus();//否则不清除,条码/篮筐(尾)获得焦点 } } } -function getApplicationGoodsByName(goodsName){ - var record = findRecordByNameAndValueFromStore(recyclingapplicationStore,"name",goodsName); - if(record != null){ +function getApplicationGoodsByName(goodsName) { + var record = findRecordByNameAndValueFromStore(recyclingapplicationStore, "name", goodsName); + if (record != null) { return record.data; } return null; } -function preprocessBeforeGetBarcodeInfo(newBarcode){ +function preprocessBeforeGetBarcodeInfo(newBarcode) { var barcode = top.Ext.getCmp("scanText").getValue().Trim(); var barcodeEnd = top.Ext.getCmp("scanTextEnd").getValue().Trim(); var singleMode = true; - if(barcodeEnd != ''){ + if (barcodeEnd != '') { singleMode = false; } - if(newBarcode){ + if (newBarcode) { barcode = newBarcode; } var sourceWarehouseId = top.Ext.getCmp("sourceWarehouseId").getValue(); - if(isUndefinedOrNullOrEmpty(sourceWarehouseId)){ + if (isUndefinedOrNullOrEmpty(sourceWarehouseId)) { showResult('请先选择仓库!'); return false; } - if(singleMode){// 判断是否已经扫描过该条码 + if (singleMode) {// 判断是否已经扫描过该条码 var goods = getSendOutGoodsByBarcode(barcode); - if(goods != null){ - if(goods.tousseType == '器械包'){// 目前只处理普通器械包的误差,以及删除 + if (goods != null) { + if (goods.tousseType == '器械包') {// 目前只处理普通器械包的误差,以及删除 var appGoods = getApplicationGoodsByName(goods.name); - if(appGoods){ - if(appGoods.errorAmount >= 0){// 误差数量大于等于0时,能正常发货,此时重复扫描,按以前的逻辑处理,提示条码已存在 - showResult('条形码:'+barcode+' 已经存在!'); + if (appGoods) { + if (appGoods.errorAmount >= 0) {// 误差数量大于等于0时,能正常发货,此时重复扫描,按以前的逻辑处理,提示条码已存在 + showResult('条形码:' + barcode + ' 已经存在!'); return false; - }else{// 误差数量小于0时,说明扫描数量已经大于申请数量,此时重复扫描某个包,需要删除该包。 + } else {// 误差数量小于0时,说明扫描数量已经大于申请数量,此时重复扫描某个包,需要删除该包。 // 删除该器械包 removeSendOutTousseByBarcode(goods.barcode); return false; } - }else{ - showResult('条形码:'+barcode+' 已经存在!'); + } else { + showResult('条形码:' + barcode + ' 已经存在!'); return false; } - }else{ - showResult('条形码:'+barcode+' 已经存在!'); + } else { + showResult('条形码:' + barcode + ' 已经存在!'); return false; } } } return true; } //扫描发货物品 -function loadGoodsByBarcode(orgUnitCoding,newBarcode) { +function loadGoodsByBarcode(orgUnitCoding, newBarcode) { var barcode = top.Ext.getCmp("scanText").getValue().Trim(); var barcodeEnd = top.Ext.getCmp("scanTextEnd").getValue().Trim(); var singleMode = true; - if(barcodeEnd != ''){ + if (barcodeEnd != '') { singleMode = false; } var sourceWarehouseId = top.Ext.getCmp("sourceWarehouseId").getValue(); - if(!preprocessBeforeGetBarcodeInfo(newBarcode)){ + if (!preprocessBeforeGetBarcodeInfo(newBarcode)) { return; } // 如果条码/篮筐(尾)不为空 - if(barcodeEnd != ''){ + if (barcodeEnd != '') { barcode += ";" + barcodeEnd; } - if(newBarcode){ + if (newBarcode) { barcode = newBarcode; } // 开始查询条码信息 top.Ext.getCmp("sendOutGoods").getEl().mask("后台处理中,请稍候..."); - Ext.Ajax.timeout=300*1000; + Ext.Ajax.timeout = 300 * 1000; clearScanText();// 清除条码 Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/invoiceAction!loadGoodsByBarcode.do', - params : {barcode : barcode,orgUnitCoding : orgUnitCoding,sourceWarehouseId: sourceWarehouseId,invoiceType: TYPE_OPERATION_RESERVATION}, - success : function(response, options) { + url: WWWROOT + '/disinfectSystem/invoiceAction!loadGoodsByBarcode.do', + params: { barcode: barcode, orgUnitCoding: orgUnitCoding, sourceWarehouseId: sourceWarehouseId, invoiceType: TYPE_OPERATION_RESERVATION }, + success: function (response, options) { top.Ext.getCmp("sendOutGoods").getEl().unmask(); var result = Ext.decode(response.responseText); + if (result.data.length == 0) { + showResult("找不到该条码对应的信息。"); + return; + } // 首先处理错误信息 - if(!isUndefinedOrNullOrEmpty(result.errMsg)){ + if (!isUndefinedOrNullOrEmpty(result.errMsg)) { + if (sstsConfig.enableAbnormalItemListFixedDisplay) { + var typeInfoOnScanned = result.data[0].typeInfoOnScanned; + if (typeInfoOnScanned !== "orgUnit") { + if (sstsConfig.isUseAbnormalGoodsTable && sstsConfig.isUseAbnormalGoodsTable == true) { + //加入异常物品列表 + if (result.data[0].barcode != null) { + addAbnormalGoods(result.data[0]); + } + } + } + } showResult(result.errMsg); return; } - if(result.data.length == 0){ - showResult("找不到该条码对应的信息。"); - return; - } // 验证灭菌筐内的物品是否符合发货条件,扫描的器械包数量是否大于申请数量 var tousseNameToAmountMap = getTousseNameToAmountMap(result); var exceedAmountNames = {};// 超过待发数量的包 - if(result.isContainer != undefined && result.isContainer == true){ - for ( var i = 0; i < recyclingapplicationStore.getCount(); i++) { - var record = recyclingapplicationStore.getAt(i); - var name1 =record.get('name'); - var count =record.get('count'); - var tempAmount = record.get('tempAmount'); - var totalAmount = 0; - if(tousseNameToAmountMap.hasOwnProperty(name1)){ - totalAmount = tousseNameToAmountMap[name1]; - } - //待发数量是否大于篮筐内该物品的数量 - var sendAmount = Number(count) - Number(tempAmount);// 待发数量 - if(sendAmount < Number(totalAmount)){ - exceedAmountNames[name1] = { - scannedAmount: totalAmount - } - } + if (result.isContainer != undefined && result.isContainer == true) { + for (var i = 0; i < recyclingapplicationStore.getCount(); i++) { + var record = recyclingapplicationStore.getAt(i); + var name1 = record.get('name'); + var count = record.get('count'); + var tempAmount = record.get('tempAmount'); + var totalAmount = 0; + if (tousseNameToAmountMap.hasOwnProperty(name1)) { + totalAmount = tousseNameToAmountMap[name1]; + } + //待发数量是否大于篮筐内该物品的数量 + var sendAmount = Number(count) - Number(tempAmount);// 待发数量 + if (sendAmount < Number(totalAmount)) { + exceedAmountNames[name1] = { + scannedAmount: totalAmount + } + } } } - for( var name in exceedAmountNames ){ - if(exceedAmountNames.hasOwnProperty(name)){ -// showResult(name + ",篮筐内数量大于申请数量,请逐个扫描!"); + for (var name in exceedAmountNames) { + if (exceedAmountNames.hasOwnProperty(name)) { + // showResult(name + ",篮筐内数量大于申请数量,请逐个扫描!"); } } - + var speakBasket = new SpeakBasket(); - for(var x=0;x 0){ -// showResult(msg); -// } -// } + addGoods(goods, speakBasket); + } + + // for(var x=0;x 0){ + // showResult(msg); + // } + // } speakBasket.speakContent(); -// if(result.data.length > 0 && alreadyAddAmount == 0){ -// showResult("器械包已扫描或不在发货单中"); -// } + // if(result.data.length > 0 && alreadyAddAmount == 0){ + // showResult("器械包已扫描或不在发货单中"); + // } }, - failure : function(response, options) { + failure: function (response, options) { top.Ext.getCmp("sendOutGoods").getEl().unmask(); showResult('获取条码信息失败'); } - + }); } //发货单明细修改 function updateAmount2(name, amount) { if (name != null && name.length > 0) { - for ( var i = 0; i < recyclingapplicationStore.getCount(); i++) { + for (var i = 0; i < recyclingapplicationStore.getCount(); i++) { var record = recyclingapplicationStore.getAt(i); var tempName = record.get('name'); var tempAmount = record.get('tempAmount'); @@ -917,167 +939,167 @@ //} // function findRecordByGoodsVOFromRecyclingApplication(vo) { - for ( var i = 0; i < recyclingapplicationStore.getCount(); i++) { + for (var i = 0; i < recyclingapplicationStore.getCount(); i++) { var record = recyclingapplicationStore.getAt(i); var name = record.get('name'); var diposable = record.get('diposable'); - if(name == vo.name && diposable != vo.diposable){ - var msg = '待发物品['+name+']为一次性物品,请扫描一次性物品条码!'; - if(diposable != '是'){ - msg = '待发物品['+name+']为器械包,请扫描器械包条码!'; + if (name == vo.name && diposable != vo.diposable) { + var msg = '待发物品[' + name + ']为一次性物品,请扫描一次性物品条码!'; + if (diposable != '是') { + msg = '待发物品[' + name + ']为器械包,请扫描器械包条码!'; } showResult(msg); return null; } - if(name == vo.name && diposable == vo.diposable){ + if (name == vo.name && diposable == vo.diposable) { return record; } } return null; } //刷新库存 -function refreshStorage(warehouseId){ -// if(lastLoadWarehouseId != null && lastLoadWarehouseId == warehouseId){ -// return; -// } +function refreshStorage(warehouseId) { + // if(lastLoadWarehouseId != null && lastLoadWarehouseId == warehouseId){ + // return; + // } var ids = ''; - for ( var i = 0; i < recyclingapplicationStore.getCount(); i++) { - var record = recyclingapplicationStore.getAt(i); - var data = record.data; - if(data.diposable != '是'){ - continue; - } - var disposableGoodsIdSet = data.disposableGoodsIdSet; - if(disposableGoodsIdSet.length > 0){ - for(var di=0;di 0) { + for (var di = 0; di < disposableGoodsIdSet.length; ++di) { + var disposableGoodsId = disposableGoodsIdSet[di]; + if (ids == '') { + ids = disposableGoodsId; + } else { + ids += ',' + disposableGoodsId; + } + } + } } - if(ids == ''){ + if (ids == '') { return; } Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getStorageByDisposableGoodsIds.do', - params : {disposableGoodsIds : ids,warehouseId:warehouseId}, - success : function(response, options) { + url: WWWROOT + '/disinfectSystem/diposableGoodsAction!getStorageByDisposableGoodsIds.do', + params: { disposableGoodsIds: ids, warehouseId: warehouseId }, + success: function (response, options) { lastLoadWarehouseId = warehouseId; var storages = JSON.parse(response.responseText); setStorage(storages); }, - failure : function(form, action) { + failure: function (form, action) { } }); } // 刷新总包数 -function refreshTotalAmount(){ +function refreshTotalAmount() { var appAmount = 0; var scannedAmount = 0; - for ( var i = 0; i < recyclingapplicationStore.getCount(); i++) { - var record = recyclingapplicationStore.getAt(i); - var tempScannedAmount = record.get('tempAmount'); - var tempAppAmount = record.get('count'); - var diposable = record.get('diposable'); - if('是' == diposable){ - continue; - } - tempAppAmount = Number(tempAppAmount); - tempScannedAmount = Number(tempScannedAmount); - appAmount += tempAppAmount; - scannedAmount += tempScannedAmount; + for (var i = 0; i < recyclingapplicationStore.getCount(); i++) { + var record = recyclingapplicationStore.getAt(i); + var tempScannedAmount = record.get('tempAmount'); + var tempAppAmount = record.get('count'); + var diposable = record.get('diposable'); + if ('是' == diposable) { + continue; + } + tempAppAmount = Number(tempAppAmount); + tempScannedAmount = Number(tempScannedAmount); + appAmount += tempAppAmount; + scannedAmount += tempScannedAmount; } - var text = '申请总包数:'+appAmount+',已扫总包数:'+scannedAmount; + var text = '申请总包数:' + appAmount + ',已扫总包数:' + scannedAmount; var amountElement = top.Ext.getCmp('tousseAmountInfo'); - if(amountElement != null){ + if (amountElement != null) { amountElement.setText(text); } } -function setStorage(storages){ - if(storages.length > 0){ - for ( var i = 0; i < storages.length; i++) { +function setStorage(storages) { + if (storages.length > 0) { + for (var i = 0; i < storages.length; i++) { var storage = storages[i]; - var record = findRecordByNameAndValueFromStore(recyclingapplicationStore,'name',storage.name); - if(record){ - record.set('storage',storage.storage); + var record = findRecordByNameAndValueFromStore(recyclingapplicationStore, 'name', storage.name); + if (record) { + record.set('storage', storage.storage); } } } } -function printInvoiceAfterInvoice(invoiceIds){ - if(!isUndefinedOrNull(invoiceIds)){ - var invoicePrintModule = new InvoicePrintModule(grid,$Id('userName').value); - if(typeof invoiceIds == 'string'){ - invoicePrintModule.batchPrintInvoiceWithType(invoiceIds,'全部'); - }else { - invoicePrintModule.batchPrintInvoiceWithType(invoiceIds.join(","),'全部'); +function printInvoiceAfterInvoice(invoiceIds) { + if (!isUndefinedOrNull(invoiceIds)) { + var invoicePrintModule = new InvoicePrintModule(grid, $Id('userName').value); + if (typeof invoiceIds == 'string') { + invoicePrintModule.batchPrintInvoiceWithType(invoiceIds, '全部'); + } else { + invoicePrintModule.batchPrintInvoiceWithType(invoiceIds.join(","), '全部'); } } } //BJDXZLYY-42:存储未打印的发货单ID -function getInvoiceIds(invoiceIds){ +function getInvoiceIds(invoiceIds) { var hiddenInvoiceIds = top.Ext.getCmp('hiddenInvoiceIds').getValue(); - if(invoiceIds){ - if(hiddenInvoiceIds == ''){ + if (invoiceIds) { + if (hiddenInvoiceIds == '') { hiddenInvoiceIds = invoiceIds; - }else { - hiddenInvoiceIds += ',' + invoiceIds + } else { + hiddenInvoiceIds += ',' + invoiceIds } } return hiddenInvoiceIds; } //发货完成 -function invoiceAfterFun(saveType,invoiceIds,storageLocationName,window){ - if(saveType == 'saveAndPrintPage'){ +function invoiceAfterFun(saveType, invoiceIds, storageLocationName, window) { + if (saveType == 'saveAndPrintPage') { printInvoiceAfterInvoice(invoiceIds); grid.getStore().reload(); - if(storageLocationName == ''){ + if (storageLocationName == '') { window.close(); - }else { + } else { recyclingapplicationStore.load(); sendOutGoodsStore.removeAll(); } - }else if(saveType == 'saveAndPrintAll'){ + } else if (saveType == 'saveAndPrintAll') { var newInvoiceIds = getInvoiceIds(invoiceIds.join(',')); printInvoiceAfterInvoice(newInvoiceIds); top.Ext.getCmp('hiddenInvoiceIds').setValue(''); grid.getStore().reload(); - if(storageLocationName == ''){ + if (storageLocationName == '') { window.close(); - }else { + } else { recyclingapplicationStore.load(); sendOutGoodsStore.removeAll(); } - }else if(saveType == 'saveAndInvoice'){ + } else if (saveType == 'saveAndInvoice') { recyclingapplicationStore.load(); - setTimeout(function(){ - if(recyclingapplicationStore.getCount() > 0){ + setTimeout(function () { + if (recyclingapplicationStore.getCount() > 0) { var newInvoiceIds = getInvoiceIds(invoiceIds.join(',')); top.Ext.getCmp('hiddenInvoiceIds').setValue(newInvoiceIds); showResult('发货完成,您可以继续扫描物品进行发货'); sendOutGoodsStore.removeAll(); grid.getStore().reload(); - }else { + } else { showResult('发货成功'); grid.getStore().reload(); - if(storageLocationName == ''){ + if (storageLocationName == '') { window.close(); - }else { + } else { sendOutGoodsStore.removeAll(); } } }, 500); - }else { + } else { grid.getStore().reload(); - if(storageLocationName == ''){ + if (storageLocationName == '') { window.close(); - }else { + } else { var newInvoiceIds = getInvoiceIds(invoiceIds.join(',')); top.Ext.getCmp('hiddenInvoiceIds').setValue(newInvoiceIds); recyclingapplicationStore.load(); @@ -1087,85 +1109,85 @@ } //BJDXZLYY-42:saveType:save保存,saveAndInvoice保存并继续发货,saveAndPrintPage保存并打印当前页,saveAndPrintAll保存并打印所有 -function doSaveAction(form,window,saveType,allowInvoiceStorageLocGoodsWithOutChangeStorageLoc){ +function doSaveAction(form, window, saveType, allowInvoiceStorageLocGoodsWithOutChangeStorageLoc) { if (!form.getForm().isValid()) { showResult('请正确填写表单各值'); return false; } var bool = validGridAmount(); - if(!bool){ + if (!bool) { return false; } //BJDXZLYY-46:保存时二次提醒用户相关物品不会更改托盘位置 - if(allowInvoiceStorageLocGoodsWithOutChangeStorageLoc){ + if (allowInvoiceStorageLocGoodsWithOutChangeStorageLoc) { top.Ext.getCmp('allowInvoiceStorageLocGoodsWithOutChangeStorageLoc').setValue(true); } - + getTousseGridData(); - - Ext.Ajax.timeout = 2.5*60*1000; - form.form.submit( { + + Ext.Ajax.timeout = 2.5 * 60 * 1000; + form.form.submit({ //url : WWWROOT + '/disinfectSystem/invoiceAction!saveDepartInvoice.do', - url : WWWROOT + '/disinfectSystem/invoiceAction!saveInvoiceByDepartOrInvoicePlanId.do', - method : 'POST', - waitMsg : '正在保存数据,请稍候', - waitTitle : '提交表单', - timeout:2.5*60*1000, - success : function(res, action) { + url: WWWROOT + '/disinfectSystem/invoiceAction!saveInvoiceByDepartOrInvoicePlanId.do', + method: 'POST', + waitMsg: '正在保存数据,请稍候', + waitTitle: '提交表单', + timeout: 2.5 * 60 * 1000, + success: function (res, action) { //BJDXZLYY-46:保存时二次提醒用户相关物品不会更改托盘位置 - if(action.result.alertUserAllowInvoiceStorageLocGoodsWithOutChangeStorageLoc){ + if (action.result.alertUserAllowInvoiceStorageLocGoodsWithOutChangeStorageLoc) { top.Ext.Msg.confirm('请确认', '已经存在申请科室库位中的物品,本次发货将不更改库房位置,是否继续?', function (btn) { if (btn == 'yes') { - doSaveAction(form,window,saveType,true); + doSaveAction(form, window, saveType, true); } }) - }else { + } else { showResult(action.result.message); } - if(action.result.success){ - if(sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer){ + if (action.result.success) { + if (sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer) { var storageLocationName = top.Ext.getCmp('storageLocationName').getRawValue(); - invoiceAfterFun(saveType,action.result.invoiceIds,storageLocationName,window); - }else { - if(saveType == 'saveAndPrint'){ + invoiceAfterFun(saveType, action.result.invoiceIds, storageLocationName, window); + } else { + if (saveType == 'saveAndPrint') { printInvoiceAfterInvoice(action.result.invoiceIds); window.close(); grid.getStore().reload(); - }else if(saveType == 'saveAndInvoice'){ + } else if (saveType == 'saveAndInvoice') { recyclingapplicationStore.load(); - setTimeout(function(){ - if(recyclingapplicationStore.getCount() > 0){ + setTimeout(function () { + if (recyclingapplicationStore.getCount() > 0) { showResult('发货完成,您可以继续扫描物品进行发货'); sendOutGoodsStore.removeAll(); grid.getStore().reload(); - }else { + } else { showResult('发货成功'); window.close(); grid.getStore().reload(); } }, 500); - }else { + } else { window.close(); grid.getStore().reload(); } } } }, - failure : function(res, action) { - if(!isUndefinedOrNullOrEmpty(action.result) && !isUndefinedOrNullOrEmpty(action.result.message)){ + failure: function (res, action) { + if (!isUndefinedOrNullOrEmpty(action.result) && !isUndefinedOrNullOrEmpty(action.result.message)) { //BJDXZLYY-46:保存时二次提醒用户相关物品不会更改托盘位置 - if(action.result.alertUserAllowInvoiceStorageLocGoodsWithOutChangeStorageLoc){ + if (action.result.alertUserAllowInvoiceStorageLocGoodsWithOutChangeStorageLoc) { top.Ext.Msg.confirm('请确认', '已经存在申请科室库位中的物品,本次发货将不更改库房位置,是否继续?', function (btn) { if (btn == 'yes') { - doSaveAction(form,window,saveType,true); + doSaveAction(form, window, saveType, true); } }) - }else { + } else { showResult(action.result.message); } - }else{ + } else { showResult("发货超时,请稍后查看发货单以确定发货是否成功,避免重复发货!"); window.close(); grid.getStore().reload(); @@ -1175,42 +1197,42 @@ } //取出或存入托盘 -function sendKardexContainerTCPCommand(status){ +function sendKardexContainerTCPCommand(status) { var storageLocationId = top.Ext.getCmp("storageLocationId").getValue(); var storageLocationAddr = top.Ext.getCmp("storageLocationAddr").getValue(); var kardexContainerHost = top.Ext.getCmp("kardexContainerHost").getValue(); var kardexContainerPort = top.Ext.getCmp("kardexContainerPort").getValue(); - if(storageLocationAddr == ''){ + if (storageLocationAddr == '') { showResult('开口不能为空'); return; } - if(status == '取出'){ - if(storageLocationId == ''){ + if (status == '取出') { + if (storageLocationId == '') { showResult('托盘不能为空'); return; } - }else { + } else { storageLocationId = 0; } var params = { - storageLocationId:storageLocationId, - addr:storageLocationAddr, - status:status, - host:kardexContainerHost, - port:kardexContainerPort + storageLocationId: storageLocationId, + addr: storageLocationAddr, + status: status, + host: kardexContainerHost, + port: kardexContainerPort } showResult('已经发送命令给货柜,托盘调度中,请稍候!'); - Ext.Ajax.timeout=2*60*1000; + Ext.Ajax.timeout = 2 * 60 * 1000; Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/baseData/storageRecordAction!sendKardexContainerTCPCommand.do', - async:false, - params : params, - timeout: 2*60*1000, - success : function(response) { + url: WWWROOT + '/disinfectSystem/baseData/storageRecordAction!sendKardexContainerTCPCommand.do', + async: false, + params: params, + timeout: 2 * 60 * 1000, + success: function (response) { var result = Ext.decode(response.responseText); showResult(result.message); }, - failure : function(response, options) { + failure: function (response, options) { showResult(response.responseText); } }); @@ -1223,98 +1245,99 @@ * @param selectedInvoicePlanId 所选申请单的id * @param committedStatus 提交状态(true表示已提交,false未提交) */ -function addAndEditInvoicePlan(orgUnitCoding,depart,selectedInvoicePlanId,committedStatus,operationReservation) { +function addAndEditInvoicePlan(orgUnitCoding, depart, selectedInvoicePlanId, committedStatus, operationReservation) { //判断提交状态,true表示已提交,false表示未提交 - if(!committedStatus){ + if (!committedStatus) { alert("该手术预约单还未提交,不能发货只能查看!"); } selectedApplyDate = ''; selectedTousseType = ''; lastLoadWarehouseId = null; - defaultFocusedFieldOnInvoiceForm = getStrValueFromJs('sstsConfig.defaultFocusedFieldOnInvoiceForm',defaultFocusedFieldOnInvoiceForm); + defaultFocusedFieldOnInvoiceForm = getStrValueFromJs('sstsConfig.defaultFocusedFieldOnInvoiceForm', defaultFocusedFieldOnInvoiceForm); // 发货物品 sendOutGoodsStore = new Ext.data.Store({ - reader : new Ext.data.JsonReader({ - fields : [ - {name : 'id'}, - {name : 'barcode'}, - {name : 'name'}, - {name : 'showTousseName'}, - {name : 'count'}, - {name : 'diposable'}, - {name : 'price'}, - {name : 'fluctuationPrice'}, - {name : 'storage'}, - {name : 'batchNumber'}, - {name : 'sterilizerName'}, - {name : 'frequency'}, - {name : 'externalCode'} - ] + reader: new Ext.data.JsonReader({ + fields: [ + { name: 'id' }, + { name: 'barcode' }, + { name: 'name' }, + { name: 'showTousseName' }, + { name: 'count' }, + { name: 'diposable' }, + { name: 'price' }, + { name: 'fluctuationPrice' }, + { name: 'storage' }, + { name: 'batchNumber' }, + { name: 'sterilizerName' }, + { name: 'frequency' }, + { name: 'externalCode' } + ] }) }); - - var rd = new Ext.data.JsonReader( { - fields : [ - {name : 'id'}, - {name : 'barcode'}, - {name : 'name'}, - {name : 'showTousseName'}, - {name : 'count'}, - {name : 'middlePackageAmount'}, - {name : 'diposable'}, - {name : 'price'}, - {name : 'urgentAmount'}, - {name : 'tempAmount'}, - {name : 'errorAmount'}, - {name : 'storage'}, - {name : 'amount'}, - {name : 'applicationAmount'}, - {name : 'batchNumber'}, - {name : 'disposableGoodsIdSet'}, - {name : 'invoicePlanIDList'}, - {name : 'invoicePlanType'} + + var rd = new Ext.data.JsonReader({ + fields: [ + { name: 'id' }, + { name: 'barcode' }, + { name: 'name' }, + { name: 'showTousseName' }, + { name: 'count' }, + { name: 'middlePackageAmount' }, + { name: 'diposable' }, + { name: 'price' }, + { name: 'urgentAmount' }, + { name: 'tempAmount' }, + { name: 'errorAmount' }, + { name: 'storage' }, + { name: 'amount' }, + { name: 'applicationAmount' }, + { name: 'batchNumber' }, + { name: 'disposableGoodsIdSet' }, + { name: 'invoicePlanIDList' }, + { name: 'invoicePlanType' } ] }); //申请物品 recyclingapplicationStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/invoiceAction!loadDepartApplicationAllGoodsByCondition.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/invoiceAction!loadDepartApplicationAllGoodsByCondition.do', + method: 'POST' }), - reader : rd, + reader: rd, listeners: { - load: function(thiz,records,options){ + load: function (thiz, records, options) { initErrorAmount(); var sourceWarehouseIdCmp = top.Ext.getCmp('sourceWarehouseId'); - if(sourceWarehouseIdCmp != null){ + if (sourceWarehouseIdCmp != null) { var sourceWarehouseId = sourceWarehouseIdCmp.getValue(); refreshTotalAmount(); refreshStorage(sourceWarehouseId); } } } }); - + recyclingapplicationStore.removeAll(); - recyclingapplicationStore.on("beforeload", function(thiz, options) { + recyclingapplicationStore.on("beforeload", function (thiz, options) { thiz.baseParams["orgUnitCoding"] = orgUnitCoding; recyclingapplicationStore.baseParams['invoicePlanId'] = selectedInvoicePlanId; -// recyclingapplicationStore.baseParams['applyDate'] = selectedApplyDate; -// recyclingapplicationStore.baseParams['tousseType'] = encodeURI(selectedTousseType); + // recyclingapplicationStore.baseParams['applyDate'] = selectedApplyDate; + // recyclingapplicationStore.baseParams['tousseType'] = encodeURI(selectedTousseType); }); - + recyclingapplicationStore.load(); -// sendOutGoodsStore.removeAll(); -// sendOutGoodsStore.on("beforeload", function(thiz, options) { -// thiz.baseParams["orgUnitCoding"] = orgUnitCoding; -// }); -// sendOutGoodsStore.load(); - - var recyclingapplicationCm = new Ext.grid.ColumnModel([ - {header : "申请的物品",dataIndex : 'showTousseName',width : 180,menuDisabled: true}, - {header : "name",dataIndex : 'name',hidden : true,menuDisabled: true}, - {header : "待发",dataIndex : 'count',width : 50, menuDisabled: true/*, + // sendOutGoodsStore.removeAll(); + // sendOutGoodsStore.on("beforeload", function(thiz, options) { + // thiz.baseParams["orgUnitCoding"] = orgUnitCoding; + // }); + // sendOutGoodsStore.load(); + + var recyclingapplicationCm = new Ext.grid.ColumnModel([ + { header: "申请的物品", dataIndex: 'showTousseName', width: 180, menuDisabled: true }, + { header: "name", dataIndex: 'name', hidden: true, menuDisabled: true }, + { + header: "待发", dataIndex: 'count', width: 50, menuDisabled: true/*, editor : new Ext.form.TextField( { allowBlank : false, listeners : { @@ -1324,276 +1347,280 @@ } })*/ }, - {header : '加急',id : 'urgentAmount',dataIndex : 'urgentAmount',width : 50,value : 0, menuDisabled: true,renderer:getDefaultAmount}, - {header : '实发',id : 'tempAmount',dataIndex : 'tempAmount',width : 50,value : 0, menuDisabled: true,renderer:getDefaultAmount}, - {header : '误差',id : 'errorAmount',dataIndex : 'errorAmount',width : 50,value : 0, menuDisabled: true,renderer:getDefaultAmount}, - {header : '库存',id : 'storage',dataIndex : 'storage',width : 50,value : 0, menuDisabled: true,renderer:formatStorage}, - {id : 'diposable',header : "是否一次性材料",dataIndex : 'diposable',hidden :true}, - {id :'applicationAmount',header : "最大发货数量",dataIndex : 'applicationAmount',hidden : true,width :150} -// {id : 'deleteItem',header:'删除',hidden :true,width :40,menuDisabled: true, -// renderer: function(v,p,record){ -// var str = ""; -// return str; -// }, -// dataIndex:'button' -// } + { header: '加急', id: 'urgentAmount', dataIndex: 'urgentAmount', width: 50, value: 0, menuDisabled: true, renderer: getDefaultAmount }, + { header: '实发', id: 'tempAmount', dataIndex: 'tempAmount', width: 50, value: 0, menuDisabled: true, renderer: getDefaultAmount }, + { header: '误差', id: 'errorAmount', dataIndex: 'errorAmount', width: 50, value: 0, menuDisabled: true, renderer: getDefaultAmount }, + { header: '库存', id: 'storage', dataIndex: 'storage', width: 50, value: 0, menuDisabled: true, renderer: formatStorage }, + { id: 'diposable', header: "是否一次性材料", dataIndex: 'diposable', hidden: true }, + { id: 'applicationAmount', header: "最大发货数量", dataIndex: 'applicationAmount', hidden: true, width: 150 } + // {id : 'deleteItem',header:'删除',hidden :true,width :40,menuDisabled: true, + // renderer: function(v,p,record){ + // var str = ""; + // return str; + // }, + // dataIndex:'button' + // } ]); - + var recyclingErrorCm = new Ext.grid.ColumnModel([ - {header : "材料名称",dataIndex : 'goodsName',width : 170,menuDisabled: true}, - {header : "缺失数量",dataIndex : 'count',width : 60, menuDisabled: true}, - {header : '单价',id : 'price',dataIndex : 'price',width : 60,value : 0,menuDisabled: true} + { header: "材料名称", dataIndex: 'goodsName', width: 170, menuDisabled: true }, + { header: "缺失数量", dataIndex: 'count', width: 60, menuDisabled: true }, + { header: '单价', id: 'price', dataIndex: 'price', width: 60, value: 0, menuDisabled: true } ]); - + var cm = new Ext.grid.ColumnModel([ - {header : "条码",dataIndex : 'barcode',width : 65,menuDisabled: true}, - {header : "物品名称",dataIndex : 'showTousseName',width : 190,menuDisabled: true}, - {header : "name",dataIndex : 'name',hidden : true,menuDisabled: true}, - {header : "批次/灭菌日期",dataIndex : 'batchNumber',width : 125,menuDisabled: true}, - {header : "灭菌炉名称",dataIndex : 'sterilizerName',width : 200,menuDisabled: true,hidden :true}, - {header : "炉次",dataIndex : 'frequency',width : 50,menuDisabled: true,hidden :true}, - {id : 'diposable',header : "是否一次性材料",dataIndex : 'diposable',hidden :true,width : 150}, - {header : "单价",dataIndex : 'fluctuationPrice',width : 50, align:'right', menuDisabled: true}, - {header : "数量",dataIndex : 'count',width : 50, align:'right', menuDisabled: true, - editor : new Ext.form.TextField( { - allowBlank : false, - listeners : { - focus : function(thiz){ + { header: "条码", dataIndex: 'barcode', width: 65, menuDisabled: true }, + { header: "物品名称", dataIndex: 'showTousseName', width: 190, menuDisabled: true }, + { header: "name", dataIndex: 'name', hidden: true, menuDisabled: true }, + { header: "批次/灭菌日期", dataIndex: 'batchNumber', width: 125, menuDisabled: true }, + { header: "灭菌炉名称", dataIndex: 'sterilizerName', width: 200, menuDisabled: true, hidden: true }, + { header: "炉次", dataIndex: 'frequency', width: 50, menuDisabled: true, hidden: true }, + { id: 'diposable', header: "是否一次性材料", dataIndex: 'diposable', hidden: true, width: 150 }, + { header: "单价", dataIndex: 'fluctuationPrice', width: 50, align: 'right', menuDisabled: true }, + { + header: "数量", dataIndex: 'count', width: 50, align: 'right', menuDisabled: true, + editor: new Ext.form.TextField({ + allowBlank: false, + listeners: { + focus: function (thiz) { thiz.selectText(); } } - })}, - {id : 'deleteItem',header:'删除',width : 25, align:'center', menuDisabled: true, - renderer: function(v,p,record){ - var str = ""; - return str; + }) }, - dataIndex:'button' - }]); + { + id: 'deleteItem', header: '删除', width: 25, align: 'center', menuDisabled: true, + renderer: function (v, p, record) { + var str = ""; + return str; + }, + dataIndex: 'button' + }]); //BJDXZLYY-43:卡迪斯智能货柜开口配置 var kardexContainerOpeningStore = []; - if(sstsConfig.kardexContainerOpeningConfig){ + if (sstsConfig.kardexContainerOpeningConfig) { kardexContainerOpeningStore = sstsConfig.kardexContainerOpeningConfig; } var hiddenOperationReservation = true; - if(sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer){ - if(sstsConfig.extendedFunctionalityOfGoodsDepartShareConfig && sstsConfig.extendedFunctionalityOfGoodsDepartShareConfig.indexOf('warehousePosition') >= 0){ - if(operationReservation.deliverStatus == '部分发货' || operationReservation.deliverStatus == '待发货'){ + if (sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer) { + if (sstsConfig.extendedFunctionalityOfGoodsDepartShareConfig && sstsConfig.extendedFunctionalityOfGoodsDepartShareConfig.indexOf('warehousePosition') >= 0) { + if (operationReservation.deliverStatus == '部分发货' || operationReservation.deliverStatus == '待发货') { hiddenOperationReservation = false; } } } var form = new top.Ext.FormPanel({ - id : 'recyclingApplicationForm', - frame : true, - labelSeparator : ':', - bodyStyle : 'padding:5px 5px 0px 5px', - width : 1020, - autoScroll : true, - labelAlign:'right', - layout : 'form', - items : [{ - xtype : "fieldset", - title : "基础数据", - layout : 'column', + id: 'recyclingApplicationForm', + frame: true, + region: 'center', + labelSeparator: ':', + bodyStyle: 'padding:5px 5px 0px 5px', + width: 1020, + height: 450, + labelAlign: 'right', + layout: 'form', + items: [{ + xtype: "fieldset", + title: "基础数据", + layout: 'column', style: 'padding:0px', - autoHeight : true, - items : [{ - layout : 'column', - columnWidth :1, - items:[{ - xtype : 'hidden', - name : 'id', - id : 'id' - },{ - xtype : 'hidden', - name : 'sendOutGoodsStoreData', - id : 'sendOutGoodsStoreData' - },{ - xtype : 'hidden', - name : 'allowInvoiceStorageLocGoodsWithOutChangeStorageLoc', - id : 'allowInvoiceStorageLocGoodsWithOutChangeStorageLoc' - },{ - xtype :'hidden', - name : 'recyclingappStoreData', - id : 'recyclingappStoreData' - },{ - xtype :'hidden', - name : 'status', - id : 'status' - },{ - xtype :'hidden', - name : 'orgUnitCoding', - id : 'orgUnitCoding', - value:orgUnitCoding - },{ - xtype :'hidden', - name : 'applyDate', - id : 'applyDateHidden', - value:selectedApplyDate - },{ - xtype :'hidden', - name : 'tousseType', - id : 'tousseTypeHidden', - value:selectedTousseType - },{ - xtype :'hidden', - name : 'invoicePlanId', - id : 'invoicePlanIdHidden', - value:selectedInvoicePlanId - },{ - xtype : 'hidden', - name : 'invoiceType', - id : 'invoiceType', - value:TYPE_OPERATION_RESERVATION - },{ - xtype : 'hidden', - name : 'mode', - id : 'mode', - value:INVOICE_MODE_DEPART - },{ - xtype :'hidden', - name : 'personInChargeCode', - id : 'personInChargeCode' - },{ - xtype : 'hidden', - name : 'sourceWarehouseId', - id : 'sourceWarehouseId' - },{ - xtype : 'hidden', - name : 'sourceWarehouseName', - id : 'sourceWarehouseName' - },{ - xtype : 'hidden', - name : 'warehouseID', - id : 'warehouseID' - },{ - xtype : 'hidden', - name : 'warehouseName', - id : 'warehouseName' - },{ - xtype : 'hidden', - name : 'hiddenInvoiceIds', - id : 'hiddenInvoiceIds' - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - items : [{ - xtype : 'textfield', - fieldLabel : '申请科室', - maxLength : '100', - id : 'depart2', - name : 'depart', - value : depart, - readOnly:true, - anchor : '99%', - cls:'fieldReadOnlyNoRemove' - + autoHeight: true, + items: [{ + layout: 'column', + columnWidth: 1, + items: [{ + xtype: 'hidden', + name: 'id', + id: 'id' + }, { + xtype: 'hidden', + name: 'sendOutGoodsStoreData', + id: 'sendOutGoodsStoreData' + }, { + xtype: 'hidden', + name: 'allowInvoiceStorageLocGoodsWithOutChangeStorageLoc', + id: 'allowInvoiceStorageLocGoodsWithOutChangeStorageLoc' + }, { + xtype: 'hidden', + name: 'recyclingappStoreData', + id: 'recyclingappStoreData' + }, { + xtype: 'hidden', + name: 'status', + id: 'status' + }, { + xtype: 'hidden', + name: 'orgUnitCoding', + id: 'orgUnitCoding', + value: orgUnitCoding + }, { + xtype: 'hidden', + name: 'applyDate', + id: 'applyDateHidden', + value: selectedApplyDate + }, { + xtype: 'hidden', + name: 'tousseType', + id: 'tousseTypeHidden', + value: selectedTousseType + }, { + xtype: 'hidden', + name: 'invoicePlanId', + id: 'invoicePlanIdHidden', + value: selectedInvoicePlanId + }, { + xtype: 'hidden', + name: 'invoiceType', + id: 'invoiceType', + value: TYPE_OPERATION_RESERVATION + }, { + xtype: 'hidden', + name: 'mode', + id: 'mode', + value: INVOICE_MODE_DEPART + }, { + xtype: 'hidden', + name: 'personInChargeCode', + id: 'personInChargeCode' + }, { + xtype: 'hidden', + name: 'sourceWarehouseId', + id: 'sourceWarehouseId' + }, { + xtype: 'hidden', + name: 'sourceWarehouseName', + id: 'sourceWarehouseName' + }, { + xtype: 'hidden', + name: 'warehouseID', + id: 'warehouseID' + }, { + xtype: 'hidden', + name: 'warehouseName', + id: 'warehouseName' + }, { + xtype: 'hidden', + name: 'hiddenInvoiceIds', + id: 'hiddenInvoiceIds' + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .33, + items: [{ + xtype: 'textfield', + fieldLabel: '申请科室', + maxLength: '100', + id: 'depart2', + name: 'depart', + value: depart, + readOnly: true, + anchor: '99%', + cls: 'fieldReadOnlyNoRemove' + }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.67, - items : [{ - xtype : 'textfield', - fieldLabel : '发货员', - maxLength : '41', - id : 'deliveryPerson', - name : 'deliveryPerson', - readOnly:true, - allowBlank : false, - anchor : '99%', - value:$Id('userName').value, - cls:'fieldReadOnlyNoRemove' + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .67, + items: [{ + xtype: 'textfield', + fieldLabel: '发货员', + maxLength: '41', + id: 'deliveryPerson', + name: 'deliveryPerson', + readOnly: true, + allowBlank: false, + anchor: '99%', + value: $Id('userName').value, + cls: 'fieldReadOnlyNoRemove' }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - items : [{ - xtype : 'textfield', - fieldLabel : '病人姓名', - maxLength : '100', - id : 'patientName', - name : 'patientName', - value : operationReservation.patientName, - readOnly:true, - anchor : '99%', - cls:'fieldReadOnlyNoRemove' - + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .33, + items: [{ + xtype: 'textfield', + fieldLabel: '病人姓名', + maxLength: '100', + id: 'patientName', + name: 'patientName', + value: operationReservation.patientName, + readOnly: true, + anchor: '99%', + cls: 'fieldReadOnlyNoRemove' + }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - items : [{ - xtype : 'textfield', - fieldLabel : '手术间', - maxLength : '100', - id : 'operatingRoom', - name : 'operatingRoom', - value : operationReservation.operatingRoom, - readOnly:true, - anchor : '99%', - cls:'fieldReadOnlyNoRemove' - + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .33, + items: [{ + xtype: 'textfield', + fieldLabel: '手术间', + maxLength: '100', + id: 'operatingRoom', + name: 'operatingRoom', + value: operationReservation.operatingRoom, + readOnly: true, + anchor: '99%', + cls: 'fieldReadOnlyNoRemove' + }] - },{ - layout : 'form', - labelWidth :90, - columnWidth :.33, - items : [{ - xtype : 'textfield', - fieldLabel : '手术台次', - maxLength : '100', - id : 'consoleName', - name : 'consoleName', - value : operationReservation.consoleName, - readOnly:true, - anchor : '99%', - cls:'fieldReadOnlyNoRemove' - + }, { + layout: 'form', + labelWidth: 90, + columnWidth: .33, + items: [{ + xtype: 'textfield', + fieldLabel: '手术台次', + maxLength: '100', + id: 'consoleName', + name: 'consoleName', + value: operationReservation.consoleName, + readOnly: true, + anchor: '99%', + cls: 'fieldReadOnlyNoRemove' + }] - },{ - layout : 'form', - columnWidth : 1, - labelWidth :70, - items : [{ - xtype : 'textarea', - fieldLabel : '手术名称', - id : 'operationName', - name : 'operationName', - value : operationReservation.operationName, - anchor : '98.5%', - height : 40, - readOnly:true + }, { + layout: 'form', + columnWidth: 1, + labelWidth: 70, + items: [{ + xtype: 'textarea', + fieldLabel: '手术名称', + id: 'operationName', + name: 'operationName', + value: operationReservation.operationName, + anchor: '98.5%', + height: 40, + readOnly: true }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - 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: .33, + 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.getUserNameOfCurrentLoginUserOrgsByBarcode( - top.Ext.getCmp('senderBarcode').getValue(),function(userName) { + InvoiceTableManager.getUserNameOfCurrentLoginUserOrgsByBarcode( + top.Ext.getCmp('senderBarcode').getValue(), function (userName) { if (userName != null) { var resultArray = userName.split(":"); - if(resultArray[0] == "success"){ + if (resultArray[0] == "success") { top.Ext.getCmp('sender').setValue(resultArray[1]); - Ext.state.Manager.getProvider().set('cookieSender',resultArray[1]); - }else{ + Ext.state.Manager.getProvider().set('cookieSender', resultArray[1]); + } else { showResult(resultArray[1]); top.Ext.getCmp('sender').setValue(""); } @@ -1606,691 +1633,883 @@ } } }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - 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: .33, + items: [{ + xtype: 'textfield', + fieldLabel: '核对员', + maxLength: '41', + id: 'sender', + name: 'sender', + readOnly: true, + allowBlank: false, + anchor: '99%', + cls: 'x-item-disabled' }] - },{ - layout : 'form', - labelWidth :90, - columnWidth :.33, - items : [{ - xtype : 'textfield', - fieldLabel : '下送责任人条码', - maxLength : '16', - id : 'personInChargeBarcode', - name : 'personInChargeBarcode', - anchor : '99%', - listeners : { - render : function(p) { - p.getEl().on('keypress',function(e) { + }, { + layout: 'form', + labelWidth: 90, + columnWidth: .33, + items: [{ + xtype: 'textfield', + fieldLabel: '下送责任人条码', + maxLength: '16', + id: 'personInChargeBarcode', + name: 'personInChargeBarcode', + anchor: '99%', + listeners: { + render: function (p) { + p.getEl().on('keypress', function (e) { if (e.getKey() == 13) {//回车键 var barcode = top.Ext.getCmp('personInChargeBarcode').getValue(); top.Ext.getCmp('personInChargeBarcode').setValue(""); - UserTableManager.getUserByBarcode(barcode,function(responseText){ - if(!isUndefinedOrNullOrEmpty(responseText)){ - var result = top.Ext.decode(responseText); - if(!result.success){ - showResult(result.message || "输入的条码有误!"); - return; - } - top.Ext.getCmp('personInCharge').setValue(result.fullName); - top.Ext.getCmp('personInChargeCode').setValue(result.name); - }else{ - showResult('找不到该条码所对应的人员信息'); - } - }); + UserTableManager.getUserByBarcode(barcode, function (responseText) { + if (!isUndefinedOrNullOrEmpty(responseText)) { + var result = top.Ext.decode(responseText); + if (!result.success) { + showResult(result.message || "输入的条码有误!"); + return; + } + top.Ext.getCmp('personInCharge').setValue(result.fullName); + top.Ext.getCmp('personInChargeCode').setValue(result.name); + } else { + showResult('找不到该条码所对应的人员信息'); + } + }); } }); } } }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - items : [{ - xtype : 'textfield', - fieldLabel : '下送责任人', - maxLength : '41', - id : 'personInCharge', - name : 'personInCharge', - readOnly:true, - anchor : '99%', - cls:'x-item-disabled' + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .33, + items: [{ + xtype: 'textfield', + fieldLabel: '下送责任人', + maxLength: '41', + id: 'personInCharge', + name: 'personInCharge', + readOnly: true, + anchor: '99%', + cls: 'x-item-disabled' }] - },{ - layout : 'form', - labelWidth :70, - columnWidth :.33, - 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', - value:new Date(), - anchor : '99%' + }, { + layout: 'form', + labelWidth: 70, + columnWidth: .33, + 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', + value: new Date(), + anchor: '99%' }] - },{ - layout : 'form', - labelWidth : 90, - columnWidth :.33, - items:[{ - xtype : 'combo', - fieldLabel : '仓库', - id : 'warehouse', - name : 'warehouse', - minChars : 0, - valueField : 'id', - displayField : 'name', - store : wareHouseStore, - forceSelection : true, - lazyInit : false, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - allowBlank : false, - anchor : '99%', - listeners : { - select : function(combo, record, index) { + }, { + layout: 'form', + labelWidth: 90, + columnWidth: .33, + items: [{ + xtype: 'combo', + fieldLabel: '仓库', + id: 'warehouse', + name: 'warehouse', + minChars: 0, + valueField: 'id', + displayField: 'name', + store: wareHouseStore, + forceSelection: true, + lazyInit: false, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: false, + anchor: '99%', + listeners: { + select: function (combo, record, index) { top.Ext.getCmp('warehouse').setValue(record.data.name); top.Ext.getCmp('sourceWarehouseId').setValue(record.data.id); top.Ext.getCmp('sourceWarehouseName').setValue(record.data.name); // 刷新库存数据 refreshStorage(record.data.id); -// top.Ext.getCmp('remark2').focus(); + // top.Ext.getCmp('remark2').focus(); }, - specialkey : function(field, ee) { + specialkey: function (field, ee) { if (ee.getKey() == Ext.EventObject.ENTER) { -// top.Ext.getCmp('remark2').focus(); + // top.Ext.getCmp('remark2').focus(); } } } - }] - },{ - layout : 'form', - columnWidth :.33, - labelWidth :70, - hidden:!sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, - items:[{ - xtype:'hidden', - id:'storageLocationAddr', - name:'storageLocationAddr', - value:kardexContainerAddr - },{ - xtype : 'combo', - id : 'storageLocationAddrName', - name : 'storageLocationAddrName', - valueField : 'queryValue', - displayField : 'queryMode', - width:180, - fieldLabel : '开口选择', - mode : 'local', - readOnly : true, + }] + }, { + layout: 'form', + columnWidth: .33, + labelWidth: 70, + hidden: !sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, + items: [{ + xtype: 'hidden', + id: 'storageLocationAddr', + name: 'storageLocationAddr', + value: kardexContainerAddr + }, { + xtype: 'combo', + id: 'storageLocationAddrName', + name: 'storageLocationAddrName', + valueField: 'queryValue', + displayField: 'queryMode', + width: 180, + fieldLabel: '开口选择', + mode: 'local', + readOnly: true, editable: false, - triggerAction : 'all', - forceSelection : true, - anchor : '99%', - value:kardexContainerAddr, - store : new Ext.data.SimpleStore({ - fields : ['queryMode','queryValue'], - data : kardexContainerOpeningStore + triggerAction: 'all', + forceSelection: true, + anchor: '99%', + value: kardexContainerAddr, + store: new Ext.data.SimpleStore({ + fields: ['queryMode', 'queryValue'], + data: kardexContainerOpeningStore }), - listeners:{ - select:function(combo, record, index){ - top.Ext.getCmp('storageLocationAddr').setValue(record.data.queryValue); - } + listeners: { + select: function (combo, record, index) { + top.Ext.getCmp('storageLocationAddr').setValue(record.data.queryValue); + } } - }] - },{ - layout : 'form', - columnWidth :.33, - labelWidth :70, - hidden:!sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, - items:[{ - xtype:'hidden', - id:'storageLocationId', - name:'storageLocationId' - },{ - xtype:'hidden', - id:'kardexContainerHost', - name:'kardexContainerHost', - value:kardexContainerHost - },{ - xtype:'hidden', - id:'kardexContainerPort', - name:'kardexContainerPort', - value:kardexContainerPort - },{ - xtype : 'combo', - fieldLabel : '托盘选择', - id : 'storageLocationName', - name : 'storageLocationName', + }] + }, { + layout: 'form', + columnWidth: .33, + labelWidth: 70, + hidden: !sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, + items: [{ + xtype: 'hidden', + id: 'storageLocationId', + name: 'storageLocationId' + }, { + xtype: 'hidden', + id: 'kardexContainerHost', + name: 'kardexContainerHost', + value: kardexContainerHost + }, { + xtype: 'hidden', + id: 'kardexContainerPort', + name: 'kardexContainerPort', + value: kardexContainerPort + }, { + xtype: 'combo', + fieldLabel: '托盘选择', + id: 'storageLocationName', + name: 'storageLocationName', queryParam: 'spell', - minChars : 0, - valueField : 'name', - displayField : 'name', - store : storageLocationStore, - triggerAction : 'all', - forceSelection : true, - allowBlank : true, - anchor : '99%', - listeners : { - select : function(combo, record, index) { + minChars: 0, + valueField: 'name', + displayField: 'name', + store: storageLocationStore, + triggerAction: 'all', + forceSelection: true, + allowBlank: true, + anchor: '99%', + listeners: { + select: function (combo, record, index) { top.Ext.getCmp('storageLocationId').setValue(record.data.id); }, - blur:function(){ + blur: function () { var storageLocationName = top.Ext.getCmp('storageLocationName').getRawValue(); - if(storageLocationName == ''){ + if (storageLocationName == '') { top.Ext.getCmp('storageLocationId').setValue(''); } } } - }] - },{ - layout : 'form', - columnWidth :.1, - hidden:!sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, - items:[{ - xtype : 'button', - text : '取出托盘', - handler : function() { + }] + }, { + layout: 'form', + columnWidth: .1, + hidden: !sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, + items: [{ + xtype: 'button', + text: '取出托盘', + handler: function () { sendKardexContainerTCPCommand('取出'); } - }] - },{ - layout : 'form', - columnWidth :.1, - hidden:!sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, - items:[{ - xtype : 'button', - text : '存入托盘', - handler : function() { + }] + }, { + layout: 'form', + columnWidth: .1, + hidden: !sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, + items: [{ + xtype: 'button', + text: '存入托盘', + handler: function () { sendKardexContainerTCPCommand('存入'); } - }] - },{ - layout : 'form', - columnWidth : 1, - labelWidth :70, - items : [{ - xtype : 'textarea', - fieldLabel : '备注', - id : 'remark2', - name : 'remark', - anchor : '98.5%', - height : 40, - readOnly:true }] + }, { + layout: 'form', + columnWidth: 1, + labelWidth: 70, + items: [{ + xtype: 'textarea', + fieldLabel: '备注', + id: 'remark2', + name: 'remark', + anchor: '98.5%', + height: 40, + readOnly: true + }] }] }] - },{ - layout:'column', - items:[{ - layout : 'form', - columnWidth : 0.57, - items:[ - new top.Ext.grid.EditorGridPanel({ - id : 'sendOutGoods', - store : sendOutGoodsStore, - columnWidth : 0.5, - cm : cm, - width : 560, - height : 425, - autoExpandColumn : 'deleteItem', - enableHdMenu : false, - frame : false, - bodyStyle : 'border:1px solid #afd7af', - viewConfig: { - autoFit:true - }, - clicksToEdit : 1,// 设置点击几次才可编辑 - selModel : new top.Ext.grid.RowSelectionModel({ - singleSelect : false - }), - tbar : [{ - text : '扫描模式:', - hidden : hiddenEndBarcode - },{ - xtype:'combo', - id : 'scanMode', - name : 'scanMode', - hidden : hiddenEndBarcode, - fieldLabel : '扫描模式', - valueField : 'scanModeCode', - displayField : 'scanModeName', - triggerAction : 'all', - width : 80, - allowBlank : true, - editable : false, - value:currentScanMode, - store : new Ext.data.SimpleStore({ - fields : ['scanModeCode', 'scanModeName' ], - data : [['single','单个条码'],['area','首尾条码']] - }), - mode:'local', - forceSelection : true, - triggerAction : 'all', - listeners : { - select : function(combo, record, index){ - //alert(record.get("scanModeCode")); - currentScanMode = record.get("scanModeCode"); + }, { + layout: 'column', + items: [{ + layout: 'form', + columnWidth: 0.57, + items: [ + new top.Ext.grid.EditorGridPanel({ + id: 'sendOutGoods', + store: sendOutGoodsStore, + columnWidth: 0.5, + cm: cm, + width: 560, + height: 320, + autoExpandColumn: 'deleteItem', + enableHdMenu: false, + frame: false, + bodyStyle: 'border:1px solid #afd7af', + viewConfig: { + autoFit: true + }, + clicksToEdit: 1,// 设置点击几次才可编辑 + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false + }), + tbar: [{ + text: '扫描模式:', + hidden: hiddenEndBarcode + }, { + xtype: 'combo', + id: 'scanMode', + name: 'scanMode', + hidden: hiddenEndBarcode, + fieldLabel: '扫描模式', + valueField: 'scanModeCode', + displayField: 'scanModeName', + triggerAction: 'all', + width: 80, + allowBlank: true, + editable: false, + value: currentScanMode, + store: new Ext.data.SimpleStore({ + fields: ['scanModeCode', 'scanModeName'], + data: [['single', '单个条码'], ['area', '首尾条码']] + }), + mode: 'local', + forceSelection: true, + triggerAction: 'all', + listeners: { + select: function (combo, record, index) { + //alert(record.get("scanModeCode")); + currentScanMode = record.get("scanModeCode"); + } + }, + anchor: '100%' + }, { + text: beginBarcodeLabel + }, { + xtype: 'textfield', + id: 'scanText', + name: 'scanText', + width: 90, + enableKeyEvents: true, + listeners: { + render: function (c) { + c.getEl().on('keypress', function (e) { + if (e.getKey() == 13) {// 输入;号键,grid重新加载 + if (top.Ext.getCmp("scanText").getValue() != '') { + loadGoodsByBarcode(orgUnitCoding); + } else { + showResult("请扫描输入器械包/篮筐(首)条码!"); + } } - }, - anchor : '100%' - },{ - text : beginBarcodeLabel - },{ - xtype : 'textfield', - id : 'scanText', - name : 'scanText', - width : 90, - enableKeyEvents : true, - listeners : { - render : function(c) { - c.getEl().on('keypress',function(e) { - if (e.getKey() == 13) {// 输入;号键,grid重新加载 - if(top.Ext.getCmp("scanText").getValue() != ''){ - loadGoodsByBarcode(orgUnitCoding); - }else{ - showResult("请扫描输入器械包/篮筐(首)条码!"); - } - } - }); - c.getEl().on('focus',function(e) { - top.Ext.getCmp('scanText').setValue(''); - }); + }); + c.getEl().on('focus', function (e) { + top.Ext.getCmp('scanText').setValue(''); + }); + } + } + }, { + text: '条码/篮筐(尾):', + hidden: hiddenEndBarcode + }, { + xtype: 'textfield', + id: 'scanTextEnd', + name: 'scanTextEnd', + hidden: hiddenEndBarcode, + width: 90, + enableKeyEvents: true, + listeners: { + render: function (c) { + c.getEl().on('keypress', function (e) { + if (e.getKey() == 13) {// 输入;号键,grid重新加载 + if (top.Ext.getCmp("scanTextEnd").getValue() != '') { + loadGoodsByBarcode(orgUnitCoding); + } else { + showResult("请扫描输入器械包/篮筐(尾)条码!"); + } } + }); + c.getEl().on('focus', function (e) { + top.Ext.getCmp('scanTextEnd').setValue(''); + }); + } + } + }], + listeners: { + beforeedit: function (grid) {//只有一次性物品才能编辑数量 + var record = grid.record; + if (record.data.diposable == '否') { + return false; + } + }, + afteredit: function (grid) { + var id = grid.record.data['id']; + var name = grid.record.data['name']; + var count = grid.record.data['count']; + var storage = grid.record.data['storage']; + var storageInt = parseInt(storage); + if (id == 0) { + if (parseInt(count) <= storageInt) { + updateAmount2(name, count); + } else { + showResult('库存量为:' + storage + ',已超过库存量!'); + var index = recyclingapplicationStore.find("name", name); + var tempAmount = recyclingapplicationStore.getAt(index).data['tempAmount']; + grid.record.set('count', storageInt); } - },{ - text : '条码/篮筐(尾):', - hidden : hiddenEndBarcode - },{ - xtype : 'textfield', - id : 'scanTextEnd', - name : 'scanTextEnd', - hidden : hiddenEndBarcode, - width : 90, - enableKeyEvents : true, - listeners : { - render : function(c) { - c.getEl().on('keypress',function(e) { - if (e.getKey() == 13) {// 输入;号键,grid重新加载 - if(top.Ext.getCmp("scanTextEnd").getValue() != ''){ - loadGoodsByBarcode(orgUnitCoding); - }else{ - showResult("请扫描输入器械包/篮筐(尾)条码!"); - } - } - }); - c.getEl().on('focus',function(e) { - top.Ext.getCmp('scanTextEnd').setValue(''); - }); + } else { + var record = getRecord(recyclingapplicationStore, "name", name, 0); + if (record != null) { + var tempAmount = record.data['tempAmount']; + if (parseInt(count) <= (storageInt + parseInt(tempAmount))) { + updateAmount2(name, count); + } else { + showResult('库存量为:' + storage + ',已超过库存量!'); + grid.record.set('count', tempAmount); } } - }], - listeners : { - beforeedit : function(grid){//只有一次性物品才能编辑数量 - var record = grid.record; - if(record.data.diposable == '否') { - return false; - } - }, - afteredit :function(grid){ - var id = grid.record.data['id']; - var name = grid.record.data['name']; - var count = grid.record.data['count']; - var storage = grid.record.data['storage']; - var storageInt = parseInt(storage); - if(id==0){ - if(parseInt(count) <= storageInt){ - updateAmount2(name,count); - } else { - showResult('库存量为:' + storage + ',已超过库存量!'); - var index = recyclingapplicationStore.find("name",name); - var tempAmount = recyclingapplicationStore.getAt(index).data['tempAmount']; - grid.record.set('count',storageInt); - } - } else { - var record = getRecord(recyclingapplicationStore, "name", name, 0); - if(record != null) { - var tempAmount = record.data['tempAmount']; - if(parseInt(count) <= (storageInt + parseInt(tempAmount))){ - updateAmount2(name,count); - } else { - showResult('库存量为:' + storage + ',已超过库存量!'); - grid.record.set('count',tempAmount); - } - } - } - } } } + } + } )] - },{ - layout : 'form', - columnWidth : 0.43, - items:[new top.Ext.grid.EditorGridPanel({ - id : 'sendOutGoodsDetail', - title : '发货单明细', - store : recyclingapplicationStore, - cm : recyclingapplicationCm, - enableHdMenu : false, - width :423, - height :425, - loadMask : true, - tbar:[{ - text: "", - id : 'tousseAmountInfo' - }], - autoExpandColumn : 'deleteItem', - frame : false, - bodyStyle : 'border:1px solid #afd7af', - viewConfig: { - forceFit:true, - getRowClass : function(record,rowIndex,rowParams,store){ - if(record.data.errorAmount < 0){ - return 'my_row_red'; - }else if(record.data.errorAmount > 0){ - return 'my_row_yellow'; - }else{ - return 'my_row_green'; - } - } - }, - clicksToEdit:1, - selModel : new top.Ext.grid.RowSelectionModel({ - singleSelect : false - }), - listeners:{ - validateedit : function(o){ - if(!isPositiveInteger(o.value))return false; - } + }, { + layout: 'form', + columnWidth: 0.43, + items: [new top.Ext.grid.EditorGridPanel({ + id: 'sendOutGoodsDetail', + title: '发货单明细', + store: recyclingapplicationStore, + cm: recyclingapplicationCm, + enableHdMenu: false, + width: 423, + height: 320, + loadMask: true, + tbar: [{ + text: "", + id: 'tousseAmountInfo' + }], + autoExpandColumn: 'deleteItem', + frame: false, + bodyStyle: 'border:1px solid #afd7af', + viewConfig: { + forceFit: true, + getRowClass: function (record, rowIndex, rowParams, store) { + if (record.data.errorAmount < 0) { + return 'my_row_red'; + } else if (record.data.errorAmount > 0) { + return 'my_row_yellow'; + } else { + return 'my_row_green'; + } + } + }, + clicksToEdit: 1, + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false + }), + listeners: { + validateedit: function (o) { + if (!isPositiveInteger(o.value)) return false; + } + } + })] + } + ] + }] + }); + + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/invoicePlanAction!loadDepartApplicationInfo.do', + params: { orgUnitCoding: orgUnitCoding }, + success: function (response, options) { + var result = Ext.decode(response.responseText); + var remark = result.remark; + top.Ext.getCmp('remark2').setValue(remark); + }, + failure: function (form, action) { + } + }); + var cookieSender = Ext.state.Manager.getProvider().get('cookieSender'); + if (cookieSender) { + top.Ext.getCmp('sender').setValue(cookieSender); + } + var window; + var enableAbnormalItemListFixedDisplay = sstsConfig.enableAbnormalItemListFixedDisplay || false; + if (enableAbnormalItemListFixedDisplay && sstsConfig.isUseAbnormalGoodsTable) { + var windowW = top.Ext.getBody().dom.clientWidth; + var recyclingApplicationWinWidth = windowW < 1280 ? windowW - 4 : 1020; + var winWidth = recyclingApplicationWinWidth + 590; + var invoicePlan_form = renderRecyclingApplicationForm('operationReservationInvoiceView'); + window = new top.Ext.Window({ + id: 'recyclingApplicationWin', + layout: 'border', + title: '发货单', + resizable: false, + width: winWidth, + height: 650, + border: false, + modal: true, + plain: true, + stateful: false, + buttonAlign: 'center', + items: [form, invoicePlan_form], + buttons: [{ + text: '智能货柜查询', + hidden: hiddenOperationReservation, + handler: function () { + showOperationReservationStorageTousse(operationReservation.id); + } + }, { + text: '保存', + disabled: committedStatus ? false : true,//未提交则保存按钮置灰 + id: 'saveButton', + handler: function () { + //验证发货物品表格 + if (sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer) { + if ((!recyclingapplicationStore || recyclingapplicationStore.getCount() == 0) && (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0)) { + top.Ext.MessageBox.confirm("请确认", "无待发货物品,是否关闭页面?", function (button, text) { + if ("yes" == button) { + window.close(); } - })] + }); + } else if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { + showResult('发货物品不能为空!'); + return false; + } else { + doSaveAction(form, window, 'save'); } - ] - }], - buttons : [{ - text : '智能货柜查询', - hidden:hiddenOperationReservation, - handler : function() { - showOperationReservationStorageTousse(operationReservation.id); + } else { + if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { + showResult('发货物品不能为空!'); + return false; + } else { + doSaveAction(form, window, 'save'); + } } - },{ - text : '保存', - disabled : committedStatus ? false : true,//未提交则保存按钮置灰 - id:'saveButton', - handler : function() { - //验证发货物品表格 - if(sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer){ - if((!recyclingapplicationStore || recyclingapplicationStore.getCount() == 0) && (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0)){ - top.Ext.MessageBox.confirm("请确认","无待发货物品,是否关闭页面?", function(button, text) { - if ("yes" == button){ - window.close(); - } - }); - }else if(!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0){ - showResult('发货物品不能为空!'); - return false; - }else { - doSaveAction(form,window,'save'); - } - }else { - if(!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0){ - showResult('发货物品不能为空!'); - return false; - }else { - doSaveAction(form,window,'save'); - } + } + }, { + text: '保存并继续发货', + disabled: committedStatus ? false : true,//未提交则保存按钮置灰 + hidden: !sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, + handler: function () { + //验证发货物品表格 + if (sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer) { + if ((!recyclingapplicationStore || recyclingapplicationStore.getCount() == 0) && (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0)) { + top.Ext.MessageBox.confirm("请确认", "无待发货物品,是否关闭页面?", function (button, text) { + if ("yes" == button) { + window.close(); + } + }); + } else if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { + showResult('发货物品不能为空!'); + return false; + } else { + doSaveAction(form, window, 'saveAndInvoice'); } + } else { + if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { + showResult('发货物品不能为空!'); + return false; + } else { + doSaveAction(form, window, 'saveAndInvoice'); + } } - },{ - text : '保存并继续发货', - disabled : committedStatus ? false : true,//未提交则保存按钮置灰 - hidden:!sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, - handler : function() { - //验证发货物品表格 - if(sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer){ - if((!recyclingapplicationStore || recyclingapplicationStore.getCount() == 0) && (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0)){ - top.Ext.MessageBox.confirm("请确认","无待发货物品,是否关闭页面?", function(button, text) { - if ("yes" == button){ + } + }, { + text: '保存并打印', + disabled: committedStatus ? false : true,//未提交则保存按钮置灰 + id: 'saveAndPrintButton', + hidden: !sstsConfig.enableSaveAndPrintWhenInvoice, + handler: function () { + //验证发货物品表格 + if (sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer) { + var hiddenInvoiceIds = top.Ext.getCmp('hiddenInvoiceIds').getValue(); + if ((!recyclingapplicationStore || recyclingapplicationStore.getCount() == 0) && (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0)) { + if (hiddenInvoiceIds !== '') { + top.Ext.MessageBox.show({ + title: '请确认', + msg: '无待发货物品,是要打印所有本次未打印的发货单?', + buttons: { ok: '打印所有', cancel: '取消' }, + fn: function (btn) { + if (btn == 'ok') { + var storageLocationName = top.Ext.getCmp('storageLocationName').getRawValue(); + if (storageLocationName == '') { + printInvoiceAfterInvoice(hiddenInvoiceIds); + top.Ext.getCmp('hiddenInvoiceIds').setValue(''); + window.close(); + grid.getStore().reload(); + } else { + printInvoiceAfterInvoice(hiddenInvoiceIds); + top.Ext.getCmp('hiddenInvoiceIds').setValue(''); + recyclingapplicationStore.load(); + sendOutGoodsStore.removeAll(); + grid.getStore().reload(); + } + } + }, + icon: top.Ext.MessageBox.QUESTION + }); + } else { + top.Ext.MessageBox.confirm("请确认", "无待发货物品,是否关闭页面?", function (button, text) { + if ("yes" == button) { window.close(); } }); - }else if(!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0){ - showResult('发货物品不能为空!'); - return false; - }else { - doSaveAction(form,window,'saveAndInvoice'); } - }else { - if(!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0){ + } else if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { + if (hiddenInvoiceIds == '') { showResult('发货物品不能为空!'); return false; - }else { - doSaveAction(form,window,'saveAndInvoice'); + } else { + top.Ext.MessageBox.show({ + title: '请确认', + msg: '无待发货物品,是要打印所有本次未打印的发货单?', + buttons: { ok: '打印所有', cancel: '取消' }, + fn: function (btn) { + if (btn == 'ok') { + var storageLocationName = top.Ext.getCmp('storageLocationName').getRawValue(); + if (storageLocationName == '') { + printInvoiceAfterInvoice(hiddenInvoiceIds); + top.Ext.getCmp('hiddenInvoiceIds').setValue(''); + window.close(); + grid.getStore().reload(); + } else { + printInvoiceAfterInvoice(hiddenInvoiceIds); + top.Ext.getCmp('hiddenInvoiceIds').setValue(''); + recyclingapplicationStore.load(); + sendOutGoodsStore.removeAll(); + grid.getStore().reload(); + } + } + }, + icon: top.Ext.MessageBox.QUESTION + }); } + } else { + top.Ext.MessageBox.show({ + title: '请确认', + msg: '请确认只打印当前发货的物品发货单,还是需要打印本次所有未打印的发货单?', + buttons: { ok: '打印所有', yes: '打印当前', cancel: '取消' }, + fn: function (btn) { + if (btn == 'ok') { + doSaveAction(form, window, 'saveAndPrintAll'); + } else if (btn == 'yes') { + doSaveAction(form, window, 'saveAndPrintPage'); + } + }, + icon: top.Ext.MessageBox.QUESTION + }); } + } else { + if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { + showResult('发货物品不能为空!'); + return false; + } else { + doSaveAction(form, window, 'saveAndPrintPage'); + } } - },{ - text : '保存并打印', - disabled : committedStatus ? false : true,//未提交则保存按钮置灰 - id:'saveAndPrintButton', - hidden:!sstsConfig.enableSaveAndPrintWhenInvoice, - handler : function() { - //验证发货物品表格 - if(sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer){ - var hiddenInvoiceIds = top.Ext.getCmp('hiddenInvoiceIds').getValue(); - if((!recyclingapplicationStore || recyclingapplicationStore.getCount() == 0) && (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0)){ - if(hiddenInvoiceIds !== ''){ - top.Ext.MessageBox.show({ - title:'请确认', - msg: '无待发货物品,是要打印所有本次未打印的发货单?', - buttons: { ok: '打印所有', cancel: '取消' }, - fn: function(btn){ - if(btn == 'ok'){ - var storageLocationName = top.Ext.getCmp('storageLocationName').getRawValue(); - if(storageLocationName == ''){ - printInvoiceAfterInvoice(hiddenInvoiceIds); - top.Ext.getCmp('hiddenInvoiceIds').setValue(''); - window.close(); - grid.getStore().reload(); - }else { - printInvoiceAfterInvoice(hiddenInvoiceIds); - top.Ext.getCmp('hiddenInvoiceIds').setValue(''); - recyclingapplicationStore.load(); - sendOutGoodsStore.removeAll(); - grid.getStore().reload(); - } - } - }, - icon: top.Ext.MessageBox.QUESTION - }); - }else { - top.Ext.MessageBox.confirm("请确认","无待发货物品,是否关闭页面?", function(button, text) { - if ("yes" == button){ - window.close(); - } - }); + } + }, { + text: '取消', + handler: function () { + //切记注意:按取消关闭window后,一定要把已选择的申请单号变量清空 + selectedInvoicePlanId = ""; + window.close(); + } + }] + }); + } else { + window = new top.Ext.Window({ + id: 'recyclingApplicationWin', + layout: 'fit', + title: '发货单', + width: 1020, + height: 620, + border: false, + modal: true, + plain: true, + items: [form], + buttonAlign: 'center', + buttons: [{ + text: '智能货柜查询', + hidden: hiddenOperationReservation, + handler: function () { + showOperationReservationStorageTousse(operationReservation.id); + } + }, { + text: '保存', + disabled: committedStatus ? false : true,//未提交则保存按钮置灰 + id: 'saveButton', + handler: function () { + //验证发货物品表格 + if (sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer) { + if ((!recyclingapplicationStore || recyclingapplicationStore.getCount() == 0) && (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0)) { + top.Ext.MessageBox.confirm("请确认", "无待发货物品,是否关闭页面?", function (button, text) { + if ("yes" == button) { + window.close(); } - }else if(!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0){ - if(hiddenInvoiceIds == ''){ - showResult('发货物品不能为空!'); - return false; - }else { - top.Ext.MessageBox.show({ - title:'请确认', - msg: '无待发货物品,是要打印所有本次未打印的发货单?', - buttons: { ok: '打印所有', cancel: '取消' }, - fn: function(btn){ - if(btn == 'ok'){ - var storageLocationName = top.Ext.getCmp('storageLocationName').getRawValue(); - if(storageLocationName == ''){ - printInvoiceAfterInvoice(hiddenInvoiceIds); - top.Ext.getCmp('hiddenInvoiceIds').setValue(''); - window.close(); - grid.getStore().reload(); - }else { - printInvoiceAfterInvoice(hiddenInvoiceIds); - top.Ext.getCmp('hiddenInvoiceIds').setValue(''); - recyclingapplicationStore.load(); - sendOutGoodsStore.removeAll(); - grid.getStore().reload(); - } - } - }, - icon: top.Ext.MessageBox.QUESTION - }); + }); + } else if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { + showResult('发货物品不能为空!'); + return false; + } else { + doSaveAction(form, window, 'save'); + } + } else { + if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { + showResult('发货物品不能为空!'); + return false; + } else { + doSaveAction(form, window, 'save'); + } + } + } + }, { + text: '保存并继续发货', + disabled: committedStatus ? false : true,//未提交则保存按钮置灰 + hidden: !sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, + handler: function () { + //验证发货物品表格 + if (sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer) { + if ((!recyclingapplicationStore || recyclingapplicationStore.getCount() == 0) && (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0)) { + top.Ext.MessageBox.confirm("请确认", "无待发货物品,是否关闭页面?", function (button, text) { + if ("yes" == button) { + window.close(); } - }else { + }); + } else if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { + showResult('发货物品不能为空!'); + return false; + } else { + doSaveAction(form, window, 'saveAndInvoice'); + } + } else { + if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { + showResult('发货物品不能为空!'); + return false; + } else { + doSaveAction(form, window, 'saveAndInvoice'); + } + } + } + }, { + text: '保存并打印', + disabled: committedStatus ? false : true,//未提交则保存按钮置灰 + id: 'saveAndPrintButton', + hidden: !sstsConfig.enableSaveAndPrintWhenInvoice, + handler: function () { + //验证发货物品表格 + if (sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer) { + var hiddenInvoiceIds = top.Ext.getCmp('hiddenInvoiceIds').getValue(); + if ((!recyclingapplicationStore || recyclingapplicationStore.getCount() == 0) && (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0)) { + if (hiddenInvoiceIds !== '') { top.Ext.MessageBox.show({ - title:'请确认', - msg: '请确认只打印当前发货的物品发货单,还是需要打印本次所有未打印的发货单?', - buttons: { ok: '打印所有', yes: '打印当前', cancel: '取消' }, - fn: function(btn){ - if(btn == 'ok'){ - doSaveAction(form,window,'saveAndPrintAll'); - }else if(btn == 'yes'){ - doSaveAction(form,window,'saveAndPrintPage'); + title: '请确认', + msg: '无待发货物品,是要打印所有本次未打印的发货单?', + buttons: { ok: '打印所有', cancel: '取消' }, + fn: function (btn) { + if (btn == 'ok') { + var storageLocationName = top.Ext.getCmp('storageLocationName').getRawValue(); + if (storageLocationName == '') { + printInvoiceAfterInvoice(hiddenInvoiceIds); + top.Ext.getCmp('hiddenInvoiceIds').setValue(''); + window.close(); + grid.getStore().reload(); + } else { + printInvoiceAfterInvoice(hiddenInvoiceIds); + top.Ext.getCmp('hiddenInvoiceIds').setValue(''); + recyclingapplicationStore.load(); + sendOutGoodsStore.removeAll(); + grid.getStore().reload(); + } } }, icon: top.Ext.MessageBox.QUESTION }); + } else { + top.Ext.MessageBox.confirm("请确认", "无待发货物品,是否关闭页面?", function (button, text) { + if ("yes" == button) { + window.close(); + } + }); } - }else { - if(!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0){ + } else if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { + if (hiddenInvoiceIds == '') { showResult('发货物品不能为空!'); return false; - }else { - doSaveAction(form,window,'saveAndPrintPage'); + } else { + top.Ext.MessageBox.show({ + title: '请确认', + msg: '无待发货物品,是要打印所有本次未打印的发货单?', + buttons: { ok: '打印所有', cancel: '取消' }, + fn: function (btn) { + if (btn == 'ok') { + var storageLocationName = top.Ext.getCmp('storageLocationName').getRawValue(); + if (storageLocationName == '') { + printInvoiceAfterInvoice(hiddenInvoiceIds); + top.Ext.getCmp('hiddenInvoiceIds').setValue(''); + window.close(); + grid.getStore().reload(); + } else { + printInvoiceAfterInvoice(hiddenInvoiceIds); + top.Ext.getCmp('hiddenInvoiceIds').setValue(''); + recyclingapplicationStore.load(); + sendOutGoodsStore.removeAll(); + grid.getStore().reload(); + } + } + }, + icon: top.Ext.MessageBox.QUESTION + }); } + } else { + top.Ext.MessageBox.show({ + title: '请确认', + msg: '请确认只打印当前发货的物品发货单,还是需要打印本次所有未打印的发货单?', + buttons: { ok: '打印所有', yes: '打印当前', cancel: '取消' }, + fn: function (btn) { + if (btn == 'ok') { + doSaveAction(form, window, 'saveAndPrintAll'); + } else if (btn == 'yes') { + doSaveAction(form, window, 'saveAndPrintPage'); + } + }, + icon: top.Ext.MessageBox.QUESTION + }); } + } else { + if (!sendOutGoodsStore || sendOutGoodsStore.getCount() == 0) { + showResult('发货物品不能为空!'); + return false; + } else { + doSaveAction(form, window, 'saveAndPrintPage'); + } } - }, { - text : '取消', - handler : function() { - //切记注意:按取消关闭window后,一定要把已选择的申请单号变量清空 - selectedInvoicePlanId = ""; - window.close(); - } - }] - }); - - Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/invoicePlanAction!loadDepartApplicationInfo.do', - params : {orgUnitCoding : orgUnitCoding}, - success : function(response, options) { - var result = Ext.decode(response.responseText); - var remark = result.remark; - top.Ext.getCmp('remark2').setValue(remark); - }, - failure : function(form, action) { - } - }); - var cookieSender = Ext.state.Manager.getProvider().get('cookieSender'); - if(cookieSender){ - top.Ext.getCmp('sender').setValue(cookieSender); + } + }, { + text: '取消', + handler: function () { + //切记注意:按取消关闭window后,一定要把已选择的申请单号变量清空 + selectedInvoicePlanId = ""; + window.close(); + } + }] + }); } -//发货单弹窗 weizhenyu - var window = new top.Ext.Window( { - id : 'recyclingApplicationWin', - layout : 'fit', - title : '发货单', - width : 1020, - height : 620, - border : false, - modal : true, - plain : true, - items : [form] - }); - - window.on('close',function(w){ + + window.on('close', function (w) { //切记注意:按取消关闭window后,一定要把已选择的申请单号变量清空 selectedInvoicePlanId = ""; }); window.show(); top.Ext.getCmp(defaultFocusedFieldOnInvoiceForm).focus(false, 100); -// top.Ext.getCmp('senderBarcode').focus(false, 100); - + // top.Ext.getCmp('senderBarcode').focus(false, 100); + var sendOutGoodsDetailGrid = top.Ext.getCmp('sendOutGoodsDetail'); - sendOutGoodsDetailGrid.on('rowdblclick', function(grid, index) { + sendOutGoodsDetailGrid.on('rowdblclick', function (grid, index) { var record = grid.getStore().getAt(index); - if(record.data.invoicePlanType == invoicePlanType_disinfect){ + if (record.data.invoicePlanType == invoicePlanType_disinfect) { var goodsName = record.data.name; //显示消毒物品材料 showDisinfectMaterial(goodsName); } }, this, { - buffer : 250 + buffer: 250 }); wareHouseStore.load(); + + if (enableAbnormalItemListFixedDisplay && sstsConfig.isUseAbnormalGoodsTable) { + var tabs = top.Ext.getCmp('tabpanel') + tabs.hideTabStripItem(0); + } } //展示器械包信息 function showDisinfectMaterial(tousseName) { - var materialStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getMaterialDefinitionByTousseName.do', - method : 'POST' - }), - baseParams : {tousseName : tousseName}, - reader : new Ext.data.JsonReader({ - fields : [ - {name : 'materialDefinitionId'}, - {name : 'name'}, - {name : 'count'} - ] - }) - }); - materialStore.load(); - var materialGrid = new top.Ext.grid.GridPanel({ - id :'materialGrid', - store: materialStore, - columns: [ - {hidden : true, dataIndex : 'materialDefinitionId'}, - {header : "材料名称",width : 80, menuDisabled: true,dataIndex : 'name'}, - {header : "数量",width : 27, menuDisabled: true,dataIndex : 'count'} - ], - viewConfig: { - forceFit: true - }, - autoExpandColumn : 'materialAmount', - frame:false - }); - - var window = new top.Ext.Window({ - title : tousseName + '信息', - width : 400, - height :200, - border : false, - autoScroll: true, - layout : 'fit', - modal : true, - items : [materialGrid] - }); - window.show(); + var materialStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getMaterialDefinitionByTousseName.do', + method: 'POST' + }), + baseParams: { tousseName: tousseName }, + reader: new Ext.data.JsonReader({ + fields: [ + { name: 'materialDefinitionId' }, + { name: 'name' }, + { name: 'count' } + ] + }) + }); + materialStore.load(); + var materialGrid = new top.Ext.grid.GridPanel({ + id: 'materialGrid', + store: materialStore, + columns: [ + { hidden: true, dataIndex: 'materialDefinitionId' }, + { header: "材料名称", width: 80, menuDisabled: true, dataIndex: 'name' }, + { header: "数量", width: 27, menuDisabled: true, dataIndex: 'count' } + ], + viewConfig: { + forceFit: true + }, + autoExpandColumn: 'materialAmount', + frame: false + }); + + var window = new top.Ext.Window({ + title: tousseName + '信息', + width: 400, + height: 200, + border: false, + autoScroll: true, + layout: 'fit', + modal: true, + items: [materialGrid] + }); + window.show(); } //获取扫描的物品 function getTousseGridData() { var submitItems = []; - for ( var i = 0; i < sendOutGoodsStore.getCount(); i++) { + for (var i = 0; i < sendOutGoodsStore.getCount(); i++) { var record = sendOutGoodsStore.getAt(i); record.data.sendAmount = record.data.count; submitItems.push(record.data); Index: ssts-web/src/main/webapp/disinfectsystem/invoice/recyclingApplicationForm.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/invoice/recyclingApplicationForm.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/recyclingApplicationForm.js (revision 41535) @@ -0,0 +1,341 @@ +var sendOutAbnormalGoodsStore;//异常物品列表参数 +//异常物品列表删除选中的物品 +function removeSendOutAbnormalGoods(newBarcode) { + var rows = top.Ext.getCmp('sendOutAbnormalGoods').getSelectionModel().getSelections(); + if (newBarcode) { + rows = top.Ext.getCmp('sendOutAbnormalGoods').getStore().data.items; + } + if (rows && rows.length > 0) { + for (var i = 0; i < rows.length; i++) { + if (newBarcode) { + if (rows[i].data.barcode == newBarcode) { + sendOutAbnormalGoodsStore.remove(rows[i]); + return; + } + } else { + //DGSETYY-80:4.4在“异常物品列表”或“物品发货计划”列表中删除了相关的物品时,也需要实时将对应页面的物品进行删除 + if (sstsConfig.enableTraceableToussesShippedBackToTheOriginalApplyInfoFunction) { + if (removeSendOutGoods) { + removeSendOutGoods(rows[i].data.barcode); + } + } + sendOutAbnormalGoodsStore.remove(rows[i]); + return; + } + } + } +} + +//异常物品列表 +function addAbnormalGoods(goods) { + //异常物品列表 + var addAbnormalGridItem = Ext.data.Record.create([ + { name: 'id' }, + { name: 'barcode' }, + { name: 'name' }, + { name: 'appRecord' }, + { name: 'tousseFixedBarcode' }, + { name: 'showTousseName' }, + { name: 'status' }, + { name: 'depart' }, + { name: 'batchNumber' } + ]); + if (sendOutAbnormalGoodsStore.getCount() == 0) { + var newRecord = new addAbnormalGridItem({ + id: 0, + barcode: goods.barcode, + name: goods.name, + ttsName: goods.ttsName, + tousseFixedBarcode: goods.tousseFixedBarcode, + showTousseName: goods.showTousseName, + status: goods.status, + depart: goods.depart, + batchNumber: goods.batchNumber + }); + sendOutAbnormalGoodsStore.insert(0, newRecord); + } else { + var hasBarcode = false; + for (var i = 0; i < sendOutAbnormalGoodsStore.getCount(); i++) { + var record = sendOutAbnormalGoodsStore.getAt(i); + if (record.data.barcode == goods.barcode) { + hasBarcode = true; + break; + } + } + if (!hasBarcode) { + var newRecord = new addAbnormalGridItem({ + id: 0, + barcode: goods.barcode, + name: goods.name, + ttsName: goods.ttsName, + tousseFixedBarcode: goods.tousseFixedBarcode, + showTousseName: goods.showTousseName, + status: goods.status, + depart: goods.depart, + batchNumber: goods.batchNumber + }); + sendOutAbnormalGoodsStore.insert(0, newRecord); + } + } +} + +function renderRecyclingApplicationForm(formName) { + var enableAbnormalItemListFixedDisplay = sstsConfig.enableAbnormalItemListFixedDisplay || false; + if(!sstsConfig.isUseAbnormalGoodsTable){ + enableAbnormalItemListFixedDisplay = false; + } + var invoicePlan_rd = new Ext.data.JsonReader({ + fields: [ + { name: 'showTousseName' }, + { name: 'applicationAmount' }, + { name: 'sendAmount' }, + { name: 'count' } + ] + }); + + //申请物品 + var invoicePlan_recyclingapplicationStore = new Ext.data.Store({ + reader: invoicePlan_rd + }); + + var invoicePlan_recyclingapplicationCm = new Ext.grid.ColumnModel([ + { header: "申请的物品", dataIndex: 'showTousseName', width: 180, menuDisabled: true }, + { header: "数量", dataIndex: 'applicationAmount', width: 50, menuDisabled: true }, + { header: "已发", dataIndex: 'sendAmount', width: 50, menuDisabled: true }, + { header: "待发", dataIndex: 'count', width: 50, menuDisabled: true } + ]); + + //异常物品列表--Ext.data.Store + sendOutAbnormalGoodsStore = new Ext.data.Store({ + reader: new Ext.data.JsonReader({ + fields: [ + { name: 'id' }, + { name: 'barcode' }, + { name: 'name' }, + { name: 'ttsName' }, + { name: 'appRecord' }, + { name: 'showTousseName' }, + { name: 'status' }, + { name: 'depart' }, + { name: 'batchNumber' } + ] + }) + }); + + //异常物品列表字段 + var abnormalCm = new Ext.grid.ColumnModel([ + { header: "条码", dataIndex: 'barcode', width: 80, menuDisabled: true }, + { header: "物品名称", dataIndex: 'showTousseName', width: 100, menuDisabled: true }, + { + id: 'deleteItem', header: '删除', width: 15, align: 'center', menuDisabled: true, + renderer: function (v, p, record) { + var str = ""; + return str; + }, + dataIndex: 'button' + }, + { header: "包状态", dataIndex: 'status', width: 80, menuDisabled: true }, + { header: "回收科室", dataIndex: 'depart', width: 125, menuDisabled: true }, + { header: "name", dataIndex: 'name', hidden: true, menuDisabled: true }, + { header: "批次/灭菌日期", dataIndex: 'batchNumber', width: 110, menuDisabled: true } + ]); + + //异常物品列表Panel面板 + var sendOutAbnormalGoods_form = new top.Ext.Panel({ + id: 'sendOutAbnormalGoodsWin', + frame: true, + columnWidth: .20, + labelSeparator: ':', + bodyStyle: 'padding:5px 5px 0px 5px', + width: 590, + height: 480, + autoScroll: true, + labelAlign: 'right', + layout: 'form', + items: [ + new top.Ext.grid.EditorGridPanel({ + id: 'sendOutAbnormalGoods', + store: sendOutAbnormalGoodsStore, + style: 'padding:0px', + autoHeight: true, + columnWidth: 0.5, + cm: abnormalCm, + width: 580, + height: 425, + autoExpandColumn: 'deleteItem', + enableHdMenu: false, + frame: false, + bodyStyle: 'border:1px solid #afd7af', + viewConfig: { + autoFit: true + }, + clicksToEdit: 1,// 设置点击几次才可编辑 + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false + }), + tbar: [{ + text: '删除所有异常物品', + hidden: !sstsConfig.showButtonOfDeleteAllAbnormalGoods, + iconCls: 'btn_ext_application_del', + handler: function () { + sendOutAbnormalGoodsStore.removeAll(); + } + }] + }) + ] + }); + + var showHeader = true; + var activeTab = 0; + if (formName == 'customInvoiceForm' || formName == 'operationReservationInvoiceView') { + showHeader = false; + activeTab = 1; + } + var invoicePlan_form = new top.Ext.FormPanel({ + id: 'invoicePlan_recyclingApplicationForm', + frame: true, + region: 'east', + columnWidth: enableAbnormalItemListFixedDisplay ? 1 : .20, + labelSeparator: ':', + bodyStyle: 'padding:5px 5px 0px 5px', + width: 590, + autoHeight: true, + autoScroll: true, + labelAlign: 'right', + collapsible: !enableAbnormalItemListFixedDisplay, + stateful: false, + collapsed: !enableAbnormalItemListFixedDisplay, + title: '申请单信息', + header: showHeader, + layout: 'form', + items: [ + { + xtype: 'tabpanel', + id: 'tabpanel', + activeTab: activeTab, + autoHeight: true, + deferredRender: false, + items: [ + { + title: '申请单信息', + itemId: 'sq', + autoHeight: true, + items: [ + { + xtype: "fieldset", + title: "基础数据", + layout: 'column', + style: 'padding:0px', + autoHeight: true, + items: [{ + layout: 'column', + columnWidth: 1, + items: [{ + layout: 'form', + labelWidth: 100, + columnWidth: 1, + items: [{ + xtype: 'textfield', + fieldLabel: '申请时间', + maxLength: '100', + id: 'invoicePlan_applicationTime', + name: 'invoicePlan_applicationTime', + // value : depart, + readOnly: true, + anchor: '99%', + cls: 'fieldReadOnlyNoRemove' + }] + }, { + layout: 'form', + labelWidth: 100, + columnWidth: 1, + items: [{ + xtype: 'textfield', + fieldLabel: '回收时间', + maxLength: '41', + id: 'invoicePlan_recyclingTime', + name: 'invoicePlan_recyclingTime', + readOnly: true, + // allowBlank : false, + anchor: '99%', + // value:$Id('userName').value, + cls: 'fieldReadOnlyNoRemove' + }] + }, { + layout: 'form', + labelWidth: 100, + columnWidth: 1, + items: [{ + xtype: 'textfield', + fieldLabel: '回收状态', + maxLength: '41', + id: 'invoicePlan_recyclingStatus', + name: 'invoicePlan_recyclingStatus', + readOnly: true, + // allowBlank : false, + anchor: '99%', + // value:$Id('userName').value, + cls: 'fieldReadOnlyNoRemove' + }] + }, { + layout: 'form', + labelWidth: 100, + columnWidth: 1, + items: [{ + xtype: 'textfield', + fieldLabel: '申请人', + maxLength: '41', + id: 'invoicePlan_applicant', + name: 'invoicePlan_applicant', + readOnly: true, + //allowBlank : false, + anchor: '99%', + //value:$Id('userName').value, + cls: 'fieldReadOnlyNoRemove' + }] + }] + }] + }, { + layout: 'column', + items: [{ + layout: 'form', + columnWidth: 0.99, + items: [new top.Ext.grid.EditorGridPanel({ + id: 'invoicePlan_appGoodsDetail', + title: '物品明细', + store: invoicePlan_recyclingapplicationStore, + cm: invoicePlan_recyclingapplicationCm, + enableHdMenu: false, + width: 590, + height: 425, + loadMask: true, + autoExpandColumn: 'deleteItem', + frame: false, + bodyStyle: 'padding:0px;border:1px solid #afd7af', + viewConfig: { + forceFit: true + }, + selModel: new top.Ext.grid.RowSelectionModel({ + singleSelect: false + }), + listeners: { + validateedit: function (o) { + } + } + })] + }] + } + ] + }, { + title: '异常物品列表', + itemId: 'yc', + autoHeight: true, + items: [sendOutAbnormalGoods_form] + } + ] + } + ] + }); + + return invoicePlan_form; +} \ No newline at end of file