Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js =================================================================== diff -u -r36871 -r37524 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js (.../invoicePlanExtractedForm.js) (revision 36871) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js (.../invoicePlanExtractedForm.js) (revision 37524) @@ -129,53 +129,101 @@ top.Ext.getCmp('sendOutGoodsSourceTree').show(); } //异常物品列表删除选中的物品 -function removeSendOutAbnormalGoods(barcode) { - var AbnormalGoodsNum = top.Ext.getCmp('sendOutAbnormalGoods').getStore().data.keys; - var rows = top.Ext.getCmp('sendOutAbnormalGoods').getSelectionModel().getSelections();// 返回值为 - if (rows) { +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++) { - sendOutAbnormalGoodsStore.remove(rows[i]); - return; + 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() { +function removeSendOutGoods(newBarcode) { //左边已扫物品的已选项 var rows = top.Ext.getCmp('sendOutGoods').getSelectionModel().getSelections(); + if (newBarcode) { + rows = top.Ext.getCmp('sendOutGoods').getStore().data.items; + } if (rows && rows.length > 0) { for (var i = 0; i < rows.length; i++) { var goods = rows[i].data; var name = rows[i].data['name']; var amount = rows[i].data['count']; var barcode = rows[i].data['barcode']; var tousseType = rows[i].data['tousseType']; - sendOutGoodsStore1.remove(rows[i]); + if (newBarcode) { + if (barcode == newBarcode) { + sendOutGoodsStore1.remove(rows[i]); + //固定条码和批次条码判断的参数 + var reAllBarcodeArr = []; + for (var i = 0; i < allBarcodeArr.length; i++) { + if (allBarcodeArr[i].barcode != barcode) { + reAllBarcodeArr.push(allBarcodeArr[i]); + } + } + allBarcodeArr = reAllBarcodeArr; - //固定条码和批次条码判断的参数 - var reAllBarcodeArr = []; - for (var i = 0; i < allBarcodeArr.length; i++) { - if (allBarcodeArr[i].barcode != barcode) { - reAllBarcodeArr.push(allBarcodeArr[i]); - } - } - allBarcodeArr = reAllBarcodeArr; + if (goods.tousseType == '聚合包') { + adjustComboTousseAppListAoumt(goods, 'sub'); + continue; + } else { + var appRecord = barcodeToAppRecordMap[barcode]; + if (!isUndefinedOrNullOrEmpty(appRecord)) { + updateAmountByRecord(appRecord, -amount); + } else { + updateAmount1(name, amount); + } + } - if (goods.tousseType == '聚合包') { - adjustComboTousseAppListAoumt(goods, 'sub'); - continue; + if (tousseType == '一次性物品') { + recalcDisposableGoodsAmount(name); + } + } } else { - var appRecord = barcodeToAppRecordMap[barcode]; - if (!isUndefinedOrNullOrEmpty(appRecord)) { - updateAmountByRecord(appRecord, -amount); + sendOutGoodsStore1.remove(rows[i]); + //固定条码和批次条码判断的参数 + var reAllBarcodeArr = []; + for (var i = 0; i < allBarcodeArr.length; i++) { + if (allBarcodeArr[i].barcode != barcode) { + reAllBarcodeArr.push(allBarcodeArr[i]); + } + } + allBarcodeArr = reAllBarcodeArr; + + if (goods.tousseType == '聚合包') { + adjustComboTousseAppListAoumt(goods, 'sub'); + continue; } else { - updateAmount1(name, amount); + var appRecord = barcodeToAppRecordMap[barcode]; + if (!isUndefinedOrNullOrEmpty(appRecord)) { + updateAmountByRecord(appRecord, -amount); + } else { + updateAmount1(name, amount); + } } - } - //sendDeleteScannedGoodsLog(rows[i].data); - if (tousseType == '一次性物品') { - recalcDisposableGoodsAmount(name); + if (tousseType == '一次性物品') { + recalcDisposableGoodsAmount(name); + } + //DGSETYY-80:4.4在“异常物品列表”或“物品发货计划”列表中删除了相关的物品时,也需要实时将对应页面的物品进行删除 + if (sstsConfig.isUseAbnormalGoodsTable && sstsConfig.enableTraceableToussesShippedBackToTheOriginalApplyInfoFunction) { + removeSendOutAbnormalGoods(barcode); + } } } } @@ -1253,6 +1301,16 @@ async: false, success: function (response, options) { var result = Ext.decode(response.responseText); + + //DGSETYY-80:4.2提示发货失败信息 + if (sstsConfig.enableTraceableToussesShippedBackToTheOriginalApplyInfoFunctio && result.resultData && result.resultData.length > 0) { + for (var i = 0; i < result.resultData.length; i++) { + showMultipleResult(result.resultData[i].invoiceFailReason); + } + top.Ext.getCmp("sendOutGoods").getEl().unmask(); + return; + } + if (!result.success) { if (result.error) { showResult(result.error); @@ -1307,7 +1365,7 @@ if (result.isNeedRoutineMonitoringWarning != undefined && result.isNeedRoutineMonitoringWarning == true) { showResult("该物品灭菌炉没有进行监测,请登记!", null, sstsConfig.messagePauseTimeOnInvoiceplanPage); } - if(result.type && result.type == 'tousseInstanceSetCode'){ + if (result.type && result.type == 'tousseInstanceSetCode') { showResult('已添加符合条件的器械包。'); } // 验证灭菌筐内的物品是否符合发货条件,扫描的器械包数量是否大于申请数量 @@ -1804,7 +1862,7 @@ } if (selectedAppFormType) { urls += '&appFormType=' + encodeURI(selectedAppFormType); } - if(sstsConfig.enableInstrumentSetTypeSetting){ + if (sstsConfig.enableInstrumentSetTypeSetting) { var instrumentSetTypeIds = Ext.getCmp('instrumentSetTypeIds').getValue(); urls += '&instrumentSetTypeIds=' + instrumentSetTypeIds; } @@ -1890,7 +1948,7 @@ top.Ext.getCmp("sendOutGoodsDetail").getEl().mask("加载中,请稍候..."); } //器械包种类 - if(sstsConfig.enableInstrumentSetTypeSetting){ + if (sstsConfig.enableInstrumentSetTypeSetting) { var instrumentSetTypeIds = Ext.getCmp('instrumentSetTypeIds').getValue(); recyclingapplicationStore1.baseParams['instrumentSetTypeIds'] = instrumentSetTypeIds; } @@ -2131,6 +2189,50 @@ waitTitle: '提交表单', timeout: 60, success: function (form, action) { + var result = action.result; + //DGSETYY-80:4.2提示发货失败信息 + if (sstsConfig.enableTraceableToussesShippedBackToTheOriginalApplyInfoFunctio && result.resultData && result.resultData.length > 0) { + for (var i = 0; i < sendOutGoodsStore1.getCount(); i++) { + var record = sendOutGoodsStore1.getAt(i); + if (record.data.tousseInstancesBelongToThisComboTousse && record.data.tousseInstancesBelongToThisComboTousse.length > 0) { + var tousseInstancesBelongToThisComboTousse = record.data.tousseInstancesBelongToThisComboTousse; + for (var j = 0; j < tousseInstancesBelongToThisComboTousse.length; j++) { + var barcode = tousseInstancesBelongToThisComboTousse[j].barcode; + 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'; + if (sstsConfig.isUseAbnormalGoodsTable) { + //加入异常物品列表 + addAbnormalGoods(tousseInstancesBelongToThisComboTousse[j]); + top.Ext.getCmp('invoicePlan_recyclingApplicationForm').expand(); + top.Ext.getCmp('tabpanel').activeTab = 1; + top.Ext.getCmp('tabpanel').render(); + } + } + } + } + } else { + var barcode = record.data.barcode; + 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'; + if (sstsConfig.isUseAbnormalGoodsTable) { + //加入异常物品列表 + addAbnormalGoods(record.data); + top.Ext.getCmp('invoicePlan_recyclingApplicationForm').expand(); + top.Ext.getCmp('tabpanel').activeTab = 1; + top.Ext.getCmp('tabpanel').render(); + } + } + } + } + } + return + } // 一定要事务提交成功才返回发货计划列表界面 showResult(action.result.message, null, sstsConfig.messagePauseTimeOnInvoiceplanPage); if (action.result.success) { @@ -2242,7 +2344,7 @@ }, 10); }, load: function (_this, node, response) { - if(node.childNodes.length > 0){ + if (node.childNodes.length > 0) { node.childNodes[0].expand(); } setTimeout(function () { @@ -2928,7 +3030,7 @@ //如果不是一次性物品,即不追溯的各种类型的器械包时,要请求后台与系统实时库存数量进行对比 Ext.Ajax.request({ url: WWWROOT + '/disinfectSystem/invoiceAction!getUnTraceTousseStockByDepartCodingOrInvoicePlanId.do', - params: { invoicePlanId: selectedInvoicePlanId, departCoding: orgUnitCoding, tousseFixBarcode: barcode , sourceWarehouseId: top.Ext.getCmp("sourceWarehouseId").getValue()}, + params: { invoicePlanId: selectedInvoicePlanId, departCoding: orgUnitCoding, tousseFixBarcode: barcode, sourceWarehouseId: top.Ext.getCmp("sourceWarehouseId").getValue() }, success: function (response, options) { var obj = JSON.parse(response.responseText); if (obj.data && obj.data.stockAmount) { @@ -3254,14 +3356,10 @@ collapsed: true, title: '申请单信息', layout: 'form', - // listeners:{ - // beforestatesave : function(c,s){ - // s.collapsed = true; - // } - // }, items: [ { xtype: 'tabpanel', + id: 'tabpanel', activeTab: 0, autoHeight: true, deferredRender: false, @@ -3476,9 +3574,7 @@ recyclingApplicationWin.remove(invoicePlan_recyclingApplicationForm); return; } - recyclingApplicationWin.add(invoicePlan_form); - } function postInitData() {