Index: ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js =================================================================== diff -u -r33431 -r33475 --- ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 33431) +++ ssts-web/src/main/webapp/disinfectsystem/packing/packingView.js (.../packingView.js) (revision 33475) @@ -23,21 +23,21 @@ var idCardTaskNode = null; var MATERIAL_NAME_IDCARD = "器械包标识牌"; var packingBtnText = "装配并打印标签"; -if(sstsConfig.printLabelWhenSterilizing == true){ +if (sstsConfig.printLabelWhenSterilizing == true) { packingBtnText = "装配无菌物品"; } -if (sstsConfig.printLabelWhenReviewing == true && !sstsConfig.printLabelWhenSterilizing){ +if (sstsConfig.printLabelWhenReviewing == true && !sstsConfig.printLabelWhenSterilizing) { packingBtnText = "装配无菌物品"; } var inspectorName = "检查人"; -if(sstsConfig.aliasNameOfInspectorField){ +if (sstsConfig.aliasNameOfInspectorField) { inspectorName = sstsConfig.aliasNameOfInspectorField; } var reviewViewText; -if(sstsConfig.nameSchemeOfReviewModule == 2){ +if (sstsConfig.nameSchemeOfReviewModule == 2) { reviewViewText = "包装"; -}else{ +} else { reviewViewText = "审核"; } @@ -47,7 +47,7 @@ //SZSDSRMYY-54 var responsibilityPart = '清洗消毒' -if(sstsConfig.defaultResponsibilityPartInPackingModule){ +if (sstsConfig.defaultResponsibilityPartInPackingModule) { responsibilityPart = sstsConfig.defaultResponsibilityPartInPackingModule; } @@ -64,54 +64,54 @@ var filterDepartmentsWithoutToussesStore = new Ext4.data.Store({ //limit参数,每页显示条数,默认为25 pageSize: isIE6OrIE7 ? 15 : 50, - autoLoad:false, - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/packingAction!filterDepartmentsWithoutTousses.do', - reader : { - type : 'json', - totalProperty : 'totalCount', - root : 'data' + autoLoad: false, + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/packingAction!filterDepartmentsWithoutTousses.do', + reader: { + type: 'json', + totalProperty: 'totalCount', + root: 'data' }, - actionMethods: { - create : 'POST', - read : 'POST', // by default GET - update : 'POST', - destroy: 'POST' - } + actionMethods: { + create: 'POST', + read: 'POST', // by default GET + update: 'POST', + destroy: 'POST' + } }, - fields : [ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'} + fields: [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' } ] }); var appDepartJsonStore = new Ext4.data.Store({ - autoLoad:false, - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do', - reader : { - type : 'json', - totalProperty : 'totalCount', - root : 'data' + autoLoad: false, + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do', + reader: { + type: 'json', + totalProperty: 'totalCount', + root: 'data' } }, - fields : [ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'} + fields: [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' } ], - listeners:{ - beforeload : function( store, options ){ + listeners: { + beforeload: function (store, options) { var departmentGroupOption = top.Ext4.getCmp('departmentGroupOption'); - if(departmentGroupOption){ - var departmentGroupOptionName = (departmentGroupOption.getValue() == '全部')?'':departmentGroupOption.getValue(); + if (departmentGroupOption) { + var departmentGroupOptionName = (departmentGroupOption.getValue() == '全部') ? '' : departmentGroupOption.getValue(); store.proxy.extraParams.departmentGroupOptionType = '审核科室分组'; store.proxy.extraParams.limit = ''; store.proxy.extraParams.departmentGroupOptionName = departmentGroupOptionName; } }, - load:function(store){ - if(store.data.keys.length > 0){ + load: function (store) { + if (store.data.keys.length > 0) { filterDepartmentsWithoutToussesStore.proxy.extraParams.departCodes = store.data.keys.join(';'); filterDepartmentsWithoutToussesStore.load(); } @@ -120,112 +120,112 @@ }); //申请科室Store var appDepartJsonStoreExt2 = new Ext4.data.Store({ - proxy : new Ext4.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do', - method : 'POST' + proxy: new Ext4.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getApplicationDepartJson.do', + method: 'POST' }), - reader : new Ext4.data.JsonReader({ - root : 'data' - },[ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'} - ] + reader: new Ext4.data.JsonReader({ + root: 'data' + }, [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' } + ] ) }); //结算科室Store var departJsonStoreExt2 = new Ext4.data.Store({ - proxy : new Ext4.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSettleAccountsDepartJson.do', - method : 'POST' + proxy: new Ext4.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSettleAccountsDepartJson.do', + method: 'POST' }), - reader : new Ext4.data.JsonReader({ - root : 'data' - },[ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'} - ] + reader: new Ext4.data.JsonReader({ + root: 'data' + }, [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' } + ] ) }); -function reflushWaitPackingTreeGrid(){ +function reflushWaitPackingTreeGrid() { var tabTitle = parent.currentActiveTabTitle; - var taskGroup = getURLParameter("taskGroup","") + "装配"; + var taskGroup = getURLParameter("taskGroup", "") + "装配"; // 只有当装配界面是处于活动的Tab时,才刷新,以避免刷新后的界面为空白的问题 -// alert(tabTitle+','+taskGroup) - if (tabTitle == taskGroup){ + // alert(tabTitle+','+taskGroup) + if (tabTitle == taskGroup) { var waitPackingTreeGrid = Ext4.getCmp('waitPackingTreeGrid'); - if (waitPackingTreeGrid != null && waitPackingTreeGrid.isVisible() == true){ + if (waitPackingTreeGrid != null && waitPackingTreeGrid.isVisible() == true) { waitPackingTreeGrid.getStore().reload(); } } getErrorAndDamgeCount(); } -function reflushWaitPackingTreeGridImmediately(){ +function reflushWaitPackingTreeGridImmediately() { var waitPackingTreeGrid = Ext4.getCmp('waitPackingTreeGrid'); - if (waitPackingTreeGrid != null && waitPackingTreeGrid.isVisible() == true){ + if (waitPackingTreeGrid != null && waitPackingTreeGrid.isVisible() == true) { waitPackingTreeGrid.getStore().reload(); } } -function getErrorAndDamgeCount(){ +function getErrorAndDamgeCount() { Ext4.Ajax.request({ - url : WWWROOT + '/disinfectSystem/packingAction!getErrorAndDamageCount.do', - success : function(response, options) { + url: WWWROOT + '/disinfectSystem/packingAction!getErrorAndDamageCount.do', + success: function (response, options) { var result = Ext4.decode(response.responseText); - Ext4.getCmp("addErrorMaterial").setText("补充丢失器械("+result.errorCount+")"); - Ext4.getCmp("addDamageMaterial").setText("补充报损器械("+result.damageCount+")"); + Ext4.getCmp("addErrorMaterial").setText("补充丢失器械(" + result.errorCount + ")"); + Ext4.getCmp("addDamageMaterial").setText("补充报损器械(" + result.damageCount + ")"); }, - failure : function(response, options) { + failure: function (response, options) { var result = Ext4.decode(response.responseText); - showResult(result.cause , null , sstsConfig.messagePauseTimeOnPackingPage); + showResult(result.cause, null, sstsConfig.messagePauseTimeOnPackingPage); } }); } -function reflushGrid(){ +function reflushGrid() { Ext4.getCmp('basketTreeGrid').getStore().reload(); reflushWaitPackingTreeGrid(); getErrorAndDamgeCount(); } -function checkedAllNode(checked){ +function checkedAllNode(checked) { var rootNode = Ext4.getCmp('basketTreeGrid').getRootNode(); - if(rootNode != null){ + if (rootNode != null) { var count = 0; - Ext4.each(rootNode.childNodes, function(pNode){ - pNode.set('checked',checked); - if(checked){ + Ext4.each(rootNode.childNodes, function (pNode) { + pNode.set('checked', checked); + if (checked) { count++ - }else { + } else { count = 0 } - if(pNode.childNodes && pNode.childNodes.length > 0){ - Ext4.each(pNode.childNodes, function(lastNode){ - lastNode.set('checked',checked) + if (pNode.childNodes && pNode.childNodes.length > 0) { + Ext4.each(pNode.childNodes, function (lastNode) { + lastNode.set('checked', checked) }); } }); - if(count <= 1){ + if (count <= 1) { Ext4.getCmp('sterilingType').enable(); Ext4.getCmp('packageType').enable(); - }else { + } else { Ext4.getCmp('sterilingType').disable(); Ext4.getCmp('packageType').disable(); - } + } } - + Ext4.getCmp('basketTreeGrid').getView().refresh(); } -function checkAllWaitPackingTaskNode(checked){ +function checkAllWaitPackingTaskNode(checked) { var rootNode = Ext4.getCmp('waitPackingTreeGrid').getRootNode(); - if(rootNode != null){ - Ext4.each(rootNode.childNodes, function(pNode){ - pNode.set('checked',checked); - if(pNode.childNodes && pNode.childNodes.length > 0){ - Ext4.each(pNode.childNodes, function(lastNode){ - lastNode.set('checked',checked) + if (rootNode != null) { + Ext4.each(rootNode.childNodes, function (pNode) { + pNode.set('checked', checked); + if (pNode.childNodes && pNode.childNodes.length > 0) { + Ext4.each(pNode.childNodes, function (lastNode) { + lastNode.set('checked', checked) }); } }); @@ -234,51 +234,51 @@ } //配包教学视频 -function watchVideoModel(objectId){ +function watchVideoModel(objectId) { if (objectId !== '') { var params = { objectId: objectId } openModalWindowForExt(WWWROOT + "/disinfectsystem/basedatamanager/tousse/watchVideoModel.jsp", params, "配包教学视频", "800", "390"); - }else { - showResult("请选择装配任务" , null , sstsConfig.messagePauseTimeOnPackingPage); + } else { + showResult("请选择装配任务", null, sstsConfig.messagePauseTimeOnPackingPage); } } -function additionalMaterialCallback(success,type,packingTaskId){ - if(packingTaskId != ""){ +function additionalMaterialCallback(success, type, packingTaskId) { + if (packingTaskId != "") { var rootNode = Ext4.getCmp('basketTreeGrid').getRootNode(); - rootNode.cascade(function(n) { - if(n.get('leaf') && n.get('taskId') == packingTaskId){ - if(type == type_lost){ - n.set('errors',new Array()); - }else{ - n.set('damages',new Array()); + rootNode.cascade(function (n) { + if (n.get('leaf') && n.get('taskId') == packingTaskId) { + if (type == type_lost) { + n.set('errors', new Array()); + } else { + n.set('damages', new Array()); } //广东省人民医院珠海医院GDSRMYZHYY-15,装配页面丢失器械补充完成后物品黄色底色没有消失 - if(n.get('errors') == "" && n.get('damages') == ""){ - n.set('replenishMaterils',false); + if (n.get('errors') == "" && n.get('damages') == "") { + n.set('replenishMaterils', false); var nodes = n.parentNode.childNodes; - if(nodes.length > 0){ + if (nodes.length > 0) { var flag = true; - Ext4.Array.each(nodes, function(node){ + Ext4.Array.each(nodes, function (node) { var replenishMaterils = node.get("replenishMaterils"); - if(replenishMaterils == true){ + if (replenishMaterils == true) { flag = false; return true; } }) - - if(flag){ - n.parentNode.set("replenishMaterils",false); + + if (flag) { + n.parentNode.set("replenishMaterils", false); } } } - if(n.get('errors') == ""){ + if (n.get('errors') == "") { Ext4.getCmp('remark').setValue(''); Ext4.getCmp('errorMaterialsTip').setValue(''); Ext4.getCmp('errorRemark').setValue(''); - }else { + } else { Ext4.getCmp('remark').setValue(''); Ext4.getCmp('damageMaterialsTip').setValue(''); Ext4.getCmp('damageRemark').setValue(''); @@ -290,6027 +290,6031 @@ } clearInputedIDCardInfo(); } -function clearInputedIDCardInfo(){ +function clearInputedIDCardInfo() { idCardBarcode = ''; idCardInstanceID = ''; idCardInfo = null; idCardTaskNode = null; Ext4.getCmp('idCardBarcode').setValue(); Ext4.getCmp('idCardName').setValue(); Ext4.getCmp('idCardUseAmount').setValue(); - + showOrHideErrorAndDamageBtn(); } -function showOrHideErrorAndDamageBtn(){ - if(!idCardTaskNode){ +function showOrHideErrorAndDamageBtn() { + if (!idCardTaskNode) { hideErrorAndDamageBtn(); return; } - if(haveLost(idCardTaskNode)){ - Ext4.getCmp('lostBtn').show(); - }else{ - Ext4.getCmp('lostBtn').hide(); - } - if(haveDamages(idCardTaskNode)){ - Ext4.getCmp('damageBtn').show(); - }else{ - Ext4.getCmp('damageBtn').hide(); - } + if (haveLost(idCardTaskNode)) { + Ext4.getCmp('lostBtn').show(); + } else { + Ext4.getCmp('lostBtn').hide(); + } + if (haveDamages(idCardTaskNode)) { + Ext4.getCmp('damageBtn').show(); + } else { + Ext4.getCmp('damageBtn').hide(); + } } -function haveLost(record){ +function haveLost(record) { var supplent = true; - var errors = record.get('errors'); - for(var i = 0;i < errors.length ; i++) { - if(errorTypeAdd != errors[i].errorType && ((errors[i].amount - errors[i].additionalAmount) != 0)) { - supplent = false; - } - } - if(!supplent){ - return true; - } - return false; + var errors = record.get('errors'); + for (var i = 0; i < errors.length; i++) { + if (errorTypeAdd != errors[i].errorType && ((errors[i].amount - errors[i].additionalAmount) != 0)) { + supplent = false; + } + } + if (!supplent) { + return true; + } + return false; } -function haveDamages(record){ - var damages = record.get('damages'); - if(damages.length > 0){ - return true; - } - return false; +function haveDamages(record) { + var damages = record.get('damages'); + if (damages.length > 0) { + return true; + } + return false; } -function showErrorAndDamageBtn(){ +function showErrorAndDamageBtn() { Ext4.getCmp('lostBtn').show(); - Ext4.getCmp('damageBtn').show(); + Ext4.getCmp('damageBtn').show(); } -function hideErrorAndDamageBtn(){ +function hideErrorAndDamageBtn() { Ext4.getCmp('lostBtn').hide(); - Ext4.getCmp('damageBtn').hide(); + Ext4.getCmp('damageBtn').hide(); } -function addTaskNode(params){ +function addTaskNode(params) { var leaf = false; - if(params.taskId != ''){ + if (params.taskId != '') { leaf = true; } var newParams = params; newParams.tousseType = params.tousseType1; - var node = Ext4.create('cModel',newParams); - node.set("checked" ,false); + var node = Ext4.create('cModel', newParams); + node.set("checked", false); return node; } -Ext4.onReady(function() { +Ext4.onReady(function () { taskGroupObj = getTaskGroupObjByName(taskGroup); - packingPageAutoSetSterilizationProgramAfterSelectTousse = getBoolValueFromJs('sstsConfig.packingPageAutoSetSterilizationProgramAfterSelectTousse',true); - allowForeignToussePartiallyPacking = getBoolValueFromJs('sstsConfig.allowForeignToussePartiallyPacking',false); + packingPageAutoSetSterilizationProgramAfterSelectTousse = getBoolValueFromJs('sstsConfig.packingPageAutoSetSterilizationProgramAfterSelectTousse', true); + allowForeignToussePartiallyPacking = getBoolValueFromJs('sstsConfig.allowForeignToussePartiallyPacking', false); Ext4.QuickTips.init(); Ext4.BLANK_IMAGE_URL = WWWROOT + '/ext/resources/images/default/s.gif'; Ext4.tip.QuickTipManager.init(); Ext4.apply(Ext4.tip.QuickTipManager.getQuickTip(), { - dismissDelay: 0, - showDelay: 0 + dismissDelay: 0, + showDelay: 0 }); - + top.Ext4.tip.QuickTipManager.init(); top.Ext4.apply(top.Ext4.tip.QuickTipManager.getQuickTip(), { - dismissDelay: 0, - showDelay: 0 + dismissDelay: 0, + showDelay: 0 }); - + Ext4.define('packingRecordData', { - extend: 'Ext4.data.Model', - fields: [ - {name: 'id',type: "int" }, - {name: 'packTimeStr'}, - {name: 'sterilingMode'}, - {name: 'orgUnitName'}, - {name: 'depart'}, - {name: 'packer'}, - {name: 'tousseName'}, - {name: 'inspector'}, - {name: 'reviewer'}, - {name: 'supplierName'}, - {name: 'doctor'}, - {name: 'packageType'}, - {name: 'foreignMaterialsAmount'}, - {name: 'splitTousseName'}, - {name: 'isTran'}, - {name: 'amount'} - ] + extend: 'Ext4.data.Model', + fields: [ + { name: 'id', type: "int" }, + { name: 'packTimeStr' }, + { name: 'sterilingMode' }, + { name: 'orgUnitName' }, + { name: 'depart' }, + { name: 'packer' }, + { name: 'tousseName' }, + { name: 'inspector' }, + { name: 'reviewer' }, + { name: 'supplierName' }, + { name: 'doctor' }, + { name: 'packageType' }, + { name: 'foreignMaterialsAmount' }, + { name: 'splitTousseName' }, + { name: 'isTran' }, + { name: 'amount' } + ] }); var readerDetail = [ - {name: 'id',type: "int" }, - {name: 'packTimeStr'}, - {name: 'sterilingMode'}, - {name: 'orgUnitName'}, - {name: 'depart'}, - {name: 'packer'}, - {name: 'inspector'}, - {name: 'wrapper'}, - {name: 'sterileUser'}, - {name: 'tousseName'}, - {name: 'reviewer'}, - {name: 'supplierName'}, - {name: 'doctor'}, - {name: 'packageType'}, - {name: 'isTran'}, - {name: 'foreignMaterialsAmount'}, - {name: 'splitTousseName'}, - {name: 'patient'}, - {name: 'amount'} - ]; - - var filters = new Ext.grid.GridFilters({ - filters:[ - {type: 'string', dataIndex: 'reviewer'} - ] - }); + { name: 'id', type: "int" }, + { name: 'packTimeStr' }, + { name: 'sterilingMode' }, + { name: 'orgUnitName' }, + { name: 'depart' }, + { name: 'packer' }, + { name: 'inspector' }, + { name: 'wrapper' }, + { name: 'sterileUser' }, + { name: 'tousseName' }, + { name: 'reviewer' }, + { name: 'supplierName' }, + { name: 'doctor' }, + { name: 'packageType' }, + { name: 'isTran' }, + { name: 'foreignMaterialsAmount' }, + { name: 'splitTousseName' }, + { name: 'patient' }, + { name: 'amount' } + ]; - //是否一级供应室用户 + var filters = new Ext.grid.GridFilters({ + filters: [ + { type: 'string', dataIndex: 'reviewer' } + ] + }); + + //是否一级供应室用户 var isFirstRoomPeople = false; DWREngine.setAsync(false); //验证当前登录用户属于一级供应室还是二级供应室 - UserTableManager.checkForSupplyType(function(data){ + UserTableManager.checkForSupplyType(function (data) { var result = Ext.decode(data); - if(result.result){//一级供应室 + if (result.result) {//一级供应室 isFirstRoomPeople = true; - }else{//二级供应室 + } else {//二级供应室 isFirstRoomPeople = false; } }); DWREngine.setAsync(true); - - var columns =[ - {header: '科室', dataIndex: 'depart',width: 200,sortable:false}, - {header: '供应商', dataIndex: 'supplierName',width: 150,sortable:false}, - {header: '器械包', dataIndex: 'tousseName', width: 200,renderer:filterUnderScoreName,sortable:false}, - {header: '拆包名称', dataIndex: 'splitTousseName',width: 200,sortable:false}, - {header: '数量', dataIndex: 'amount',sortable:false}, - {header: '配包人', dataIndex: 'packer',sortable:false}, - {header: ''+reviewViewText+'人', dataIndex: 'reviewer',width: 100,hidden:sstsConfig.hideReviewerField,sortable:false}, - {header: '包装人', dataIndex: 'wrapper',width: 100,hidden:!sstsConfig.showWrapperField,sortable:false}, - {header: inspectorName, dataIndex: 'inspector',hidden:!sstsConfig.showInspectorField,sortable:false}, - {header: '灭菌人', dataIndex: 'sterileUser',hidden:!sstsConfig.showSterileField,sortable:false}, - {header: '包装类型', dataIndex: 'packageType',sortable:false}, - {header: '装配时间', dataIndex: 'packTimeStr',width: 150}, - {header: '灭菌方式', dataIndex: 'sterilingMode',width: 120,hidden:!(sstsConfig.generateProxySterilizationFormFunctionInHistoricalAssemblyRecords && !isFirstRoomPeople),sortable:false}, - {header: '已生成代理灭菌单', dataIndex: 'isTran',width: 120,hidden:!(sstsConfig.generateProxySterilizationFormFunctionInHistoricalAssemblyRecords && !isFirstRoomPeople),sortable:false}, - {header: '材料汇总', dataIndex: 'foreignMaterialsAmount',width: 200,sortable:false}, - {header: '医生', dataIndex: 'doctor',width: 100,sortable:false}, - {header: '患者姓名', dataIndex: 'patient',width: 100,sortable:false} - ] - - var packingRecordStore = Ext4.create('Ext4.data.Store', { - //分页大小 - pageSize: 20, - model: 'packingRecordData', - proxy: { - type: 'ajax', - url: WWWROOT + '/disinfectSystem/packingAction!loadPackingRecord.do', - extraParams : {taskGroup : taskGroup}, - reader: { root: 'items', totalProperty: 'total' } - }, - sorters: [{ - property: 'id', - direction: 'desc' - }] - }) - function getParamsJsonObj(exports){ - if(Ext4.getCmp('startTimeSearch') == null){ + + var columns = [ + { header: '科室', dataIndex: 'depart', width: 200, sortable: false }, + { header: '供应商', dataIndex: 'supplierName', width: 150, sortable: false }, + { header: '器械包', dataIndex: 'tousseName', width: 200, renderer: filterUnderScoreName, sortable: false }, + { header: '拆包名称', dataIndex: 'splitTousseName', width: 200, sortable: false }, + { header: '数量', dataIndex: 'amount', sortable: false }, + { header: '配包人', dataIndex: 'packer', sortable: false }, + { header: '' + reviewViewText + '人', dataIndex: 'reviewer', width: 100, hidden: sstsConfig.hideReviewerField, sortable: false }, + { header: '包装人', dataIndex: 'wrapper', width: 100, hidden: !sstsConfig.showWrapperField, sortable: false }, + { header: inspectorName, dataIndex: 'inspector', hidden: !sstsConfig.showInspectorField, sortable: false }, + { header: '灭菌人', dataIndex: 'sterileUser', hidden: !sstsConfig.showSterileField, sortable: false }, + { header: '包装类型', dataIndex: 'packageType', sortable: false }, + { header: '装配时间', dataIndex: 'packTimeStr', width: 150 }, + { header: '灭菌方式', dataIndex: 'sterilingMode', width: 120, hidden: !(sstsConfig.generateProxySterilizationFormFunctionInHistoricalAssemblyRecords && !isFirstRoomPeople), sortable: false }, + { header: '已生成代理灭菌单', dataIndex: 'isTran', width: 120, hidden: !(sstsConfig.generateProxySterilizationFormFunctionInHistoricalAssemblyRecords && !isFirstRoomPeople), sortable: false }, + { header: '材料汇总', dataIndex: 'foreignMaterialsAmount', width: 200, sortable: false }, + { header: '医生', dataIndex: 'doctor', width: 100, sortable: false }, + { header: '患者姓名', dataIndex: 'patient', width: 100, sortable: false } + ] + + var packingRecordStore = Ext4.create('Ext4.data.Store', { + //分页大小 + pageSize: 20, + model: 'packingRecordData', + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/packingAction!loadPackingRecord.do', + extraParams: { taskGroup: taskGroup }, + reader: { root: 'items', totalProperty: 'total' } + }, + sorters: [{ + property: 'id', + direction: 'desc' + }] + }) + function getParamsJsonObj(exports) { + if (Ext4.getCmp('startTimeSearch') == null) { return { - taskGroup : taskGroup + taskGroup: taskGroup }; } - var tousseName = Ext4.getCmp('tousseName').getValue(); + var tousseName = Ext4.getCmp('tousseName').getValue(); var orgUnit = Ext4.getCmp('orgUnit').getValue(); var barcode = Ext4.getCmp('scanTousseBarcode').getValue(); var q_packer = Ext4.getCmp('q_packer').getValue(); var startTimeSearch = Ext4.getCmp('startTimeSearch').getRawValue(); - var endTimeSearch = Ext4.getCmp('endTimeSearch').getRawValue(); + var endTimeSearch = Ext4.getCmp('endTimeSearch').getRawValue(); var direction = Ext4.getCmp('direction').getValue(); - + var params = { tousseName: tousseName, orgUnit: orgUnit, tousseBarcode: barcode, packer: q_packer, startTimeSearch: startTimeSearch, endTimeSearch: endTimeSearch, - direction:direction + direction: direction } - if(exports){ + if (exports) { params.taskGroups = taskGroup; - }else { + } else { params.taskGroup = taskGroup; } return params; - } + } - function reloadReport(){ + function reloadReport() { var jasperreportName = 'packingRecordReport.jasper'; var url = WWWROOT + '/jasperreports/jasperreportsAction!createReportFromJavaBeanSourceForOnlyPrint.do'; - + var params = getParamsJsonObj(true); params.jasperreportName = jasperreportName; params.reportName = 'packingRecordReport'; params.queryToday = true; - searchReport(url,params); + searchReport(url, params); } - + //定时器,查询后导出 - function timeOut(){ - var time = setTimeout(function(){ + function timeOut() { + var time = setTimeout(function () { var html = document.getElementById('thisIframe').contentWindow.document.body.innerHTML; - if(html.indexOf('table') > -1){ + if (html.indexOf('table') > -1) { clearTimeout(time); location.href = WWWROOT + "/jasperRtp/exportReport.jsp"; - }else { + } else { timeOut(); } }, 1000); } - - function isQueryParamsValid(){ + + function isQueryParamsValid() { var startTimeSearchCmp = Ext4.getCmp('startTimeSearch'); var endTimeSearchCmp = Ext4.getCmp('endTimeSearch'); - if(startTimeSearchCmp == null){ + if (startTimeSearchCmp == null) { return true; } var startTimeSearch = Ext4.getCmp('startTimeSearch').getValue(); var endTimeSearch = Ext4.getCmp('endTimeSearch').getValue(); - if(!startTimeSearchCmp.isValid()){ - showResult('开始时间格式不对!' , null , sstsConfig.messagePauseTimeOnPackingPage); + if (!startTimeSearchCmp.isValid()) { + showResult('开始时间格式不对!', null, sstsConfig.messagePauseTimeOnPackingPage); return false; } - if(!endTimeSearchCmp.isValid()){ - showResult('结束时间格式不对!' , null , sstsConfig.messagePauseTimeOnPackingPage); + if (!endTimeSearchCmp.isValid()) { + showResult('结束时间格式不对!', null, sstsConfig.messagePauseTimeOnPackingPage); return false; } - if(!isUndefinedOrNullOrEmpty(startTimeSearch) && !isUndefinedOrNullOrEmpty(endTimeSearch)){ - if(startTimeSearch > endTimeSearch){ - showResult('开始时间不能大于结束时间!' , null , sstsConfig.messagePauseTimeOnPackingPage); + if (!isUndefinedOrNullOrEmpty(startTimeSearch) && !isUndefinedOrNullOrEmpty(endTimeSearch)) { + if (startTimeSearch > endTimeSearch) { + showResult('开始时间不能大于结束时间!', null, sstsConfig.messagePauseTimeOnPackingPage); return false; } } return true; - } - function initQueryValueAndReload() { - if(!isQueryParamsValid()){ - return; - } - var store = Ext4.getCmp("todayHisPackingRecordPanel").getStore(); - store.reload(); -// packingRecordStore .load({ -// params: getParamsJsonObj()}); } + function initQueryValueAndReload() { + if (!isQueryParamsValid()) { + return; + } + var store = Ext4.getCmp("todayHisPackingRecordPanel").getStore(); + store.reload(); + // packingRecordStore .load({ + // params: getParamsJsonObj()}); + } -// 从树种查找标识牌的装配任务 -function findIDCardPackingTask(store,idCard){ - var existTask = false; - var taskList = idCard.packingTaskInfo; - var rootNode = store.getRootNode(); - rootNode.eachChild(function(node){ - if (!node.isLeaf()){ - node.eachChild(function(node2){ - var taskID = node2.get('taskId'); - if(!isUndefinedOrNullOrEmpty(taskList)){ - for(var i=0;i 0){ - // 后台有装配任务,前台没有,那么先刷新待装配任务列表 - var lastOptions = waitPackingTaskStore.lastOptions; - lastOptions = Ext4.clone(lastOptions); - lastOptions.callback = function(){ - loadIdCardByBarcode_bottomHalf(barcode,result,existTask,manualScan,autoSetIDCardBarcodeForPacking); - }; - waitPackingTaskStore.reload(lastOptions); - waitPackingTaskStore.lastOptions.callback = null; -// waitPackingTaskStore.load(lastParams); - return; - } - showResult('不存在该标识牌对应的装配任务!' , null , sstsConfig.messagePauseTimeOnPackingPage); - return; - }else{ - loadIdCardByBarcode_bottomHalf(barcode,result,existTask,manualScan,autoSetIDCardBarcodeForPacking); - } - } - else - { - showResult(result.errorMsg , null , sstsConfig.messagePauseTimeOnPackingPage); - Ext4.getCmp('idCardName').setValue(); - Ext4.getCmp('idCardUseAmount').setValue(); - } - }); -} -// -function loadIdCardByBarcode_bottomHalf(barcode,result,existTask,manualScan,autoSetIDCardBarcodeForPacking){ + /** + * 扫描条码(清洗篮筐条码或标识牌条码) + * @param tempBarcode 条码 + * @param manualScan 扫标识牌条码时传true,篮筐条码传false + */ + function loadIdCardByBarcode(tempBarcode, manualScan, autoSetIDCardBarcodeForPacking) { + var barcode = tempBarcode; + PackingTableManager.getIDCardInfoForPackingView(barcode, function (resultJsonStr) { + var result = JSON.parse(resultJsonStr); + if (isUndefinedOrNullOrEmpty(result.errorMsg)) { + barcode = result.idCard.barcode; + var tousseName = result.idCard.tousseDefinition.name; + var taskList = result.idCard.packingTaskInfo; + var existTask = findIDCardPackingTask(basketStore, result.idCard); + // 在待装配任务里面选择标识牌的包可以装配 + if (!existTask) { + existTask = findIDCardPackingTask(waitPackingTaskStore, result.idCard); + } - var tousseName = result.idCard.tousseDefinition.name; - var taskList = result.idCard.packingTaskInfo; - var errorDamageRemark = result.idCard.errorDamageRemark || ''; - var errorDamageRemarkId = result.idCard.errorDamageRemarkId || ''; - if(!existTask){ - existTask = findIDCardPackingTask(basketStore,result.idCard); + if (!existTask) { + if (taskList.length > 0) { + // 后台有装配任务,前台没有,那么先刷新待装配任务列表 + var lastOptions = waitPackingTaskStore.lastOptions; + lastOptions = Ext4.clone(lastOptions); + lastOptions.callback = function () { + loadIdCardByBarcode_bottomHalf(barcode, result, existTask, manualScan, autoSetIDCardBarcodeForPacking); + }; + waitPackingTaskStore.reload(lastOptions); + waitPackingTaskStore.lastOptions.callback = null; + // waitPackingTaskStore.load(lastParams); + return; + } + showResult('不存在该标识牌对应的装配任务!', null, sstsConfig.messagePauseTimeOnPackingPage); + return; + } else { + loadIdCardByBarcode_bottomHalf(barcode, result, existTask, manualScan, autoSetIDCardBarcodeForPacking); + } + } + else { + showResult(result.errorMsg, null, sstsConfig.messagePauseTimeOnPackingPage); + Ext4.getCmp('idCardName').setValue(); + Ext4.getCmp('idCardUseAmount').setValue(); + } + }); } - - // 在待装配任务里面选择标识牌的包可以装配 - if(!existTask){ - existTask = findIDCardPackingTask(waitPackingTaskStore,result.idCard); - } - - if(!existTask){ - showResult('不存在该标识牌对应的装配任务!' , null , sstsConfig.messagePauseTimeOnPackingPage); - return; - } - var taskType = idCardTaskNode.get('taskType'); - // 是否已清洗 - if((taskType!=taskType_returnGoods) && !idCardTaskNode.get('cleaned')){ - showResult('装配任务未清洗完成或清洗完成时间未到!' , null , sstsConfig.messagePauseTimeOnPackingPage); - return; - } - // 加载器械包信息 - if(manualScan){ - var tousseName = idCardTaskNode.get('tousseName'); - var vedioName = idCardTaskNode.get('uuid_vedioNames'); - var td_id = idCardTaskNode.get('tousseID'); - var taskId = idCardTaskNode.get('taskId'); - var isTraceable = idCardTaskNode.get('isTraceable'); - var allowModifyPackageType = idCardTaskNode.get('allowModifyPackageType'); - if(result.idCard.tousseDefinition.needInspectMaterials){ - var tousseID = result.idCard.tousseDefinition.id+'+标识牌'; - var tousseName = result.idCard.tousseDefinition.name; - var resultAmount = 1; - var arr = getPackingMaterialsForCheck.get(tousseID) || []; - arr[0] = tousseName; - arr[1] = resultAmount; - getPackingMaterialsForCheck.set(tousseID,arr); + // + function loadIdCardByBarcode_bottomHalf(barcode, result, existTask, manualScan, autoSetIDCardBarcodeForPacking) { + + var tousseName = result.idCard.tousseDefinition.name; + var taskList = result.idCard.packingTaskInfo; + var errorDamageRemark = result.idCard.errorDamageRemark || ''; + var errorDamageRemarkId = result.idCard.errorDamageRemarkId || ''; + if (!existTask) { + existTask = findIDCardPackingTask(basketStore, result.idCard); } - loadTousseInfo(tousseName,imageType_tousse,vedioName,td_id,isTraceable,taskId); - lastSelectTousseName = tousseName; - lastSelectimageTypeTousse = imageType_tousse; - lastSelectVedioName = vedioName; - lastSelectTdId = td_id; - var tousseType = idCardTaskNode.get('tousseType'); - var isPrint = idCardTaskNode.get('isPrint'); - var isReview = idCardTaskNode.get('isReview'); - showPackButton(isPrint,isReview,tousseType); - if(allowModifyPackageType == '否'){ - Ext4.getCmp('packageType').disable(); - }else { - Ext4.getCmp('packageType').enable(); + + // 在待装配任务里面选择标识牌的包可以装配 + if (!existTask) { + existTask = findIDCardPackingTask(waitPackingTaskStore, result.idCard); } - } - // 取消选中所有的装配任务,只选中该标识牌的 - uncheckAllExceptCurrentIDCardPackingTask(); - currentIDCardInfo = result.idCard; - if(autoSetIDCardBarcodeForPacking){ - Ext4.getCmp('idCardBarcode').setValue(barcode); - Ext4.getCmp('idCardName').setValue(tousseName + "(条码:" + barcode + ")"); - Ext4.getCmp('idCardUseAmount').setValue(result.idCard.idCardDefinition.useAmount); - idCardBarcode = barcode; - idCardInstanceID = result.idCard.id; - idCardInfo = result.idCard; - Ext4.getCmp('operatorBarcode').focus(); - }else { - Ext4.getCmp('idCardBarcode').focus(); - } - var sterilingType = idCardTaskNode.get("sterilingMethod"); - var packageType; - if(sstsConfig.enableIdCardDefaultPackageType){//标识牌增加包装类型 - packageType = result.idCard.idCardDefinition.packageType; - }else{ - packageType = idCardTaskNode.get("packageType"); - } - - Ext4.getCmp('packageType').setValue(packageType); - Ext4.getCmp('sterilingType').setValue(sterilingType); - Ext4.getCmp('remark').setValue(errorDamageRemark); - Ext4.getCmp('errorDamageRemarkInfo').setValue(errorDamageRemark); - Ext4.getCmp('errorDamageRemarkId').setValue(errorDamageRemarkId); - //根据灭菌程序设置灭菌方式的值 - setSterilingModeValueBySterilingType(sterilingType); - -// alert(idCardInstanceID) - // 做保养器械包的处理 - maintainTousse(); - refreshErrorAndDamageRemark(idCardTaskNode); - refreshRecyclingItemRemark(idCardTaskNode); - // 显示丢失报损按钮 - showOrHideErrorAndDamageBtn(); - if(manualScan){ - // 自动装配 - packingView_autoPacking(); - } -} + if (!existTask) { + showResult('不存在该标识牌对应的装配任务!', null, sstsConfig.messagePauseTimeOnPackingPage); + return; + } + var taskType = idCardTaskNode.get('taskType'); + // 是否已清洗 + if ((taskType != taskType_returnGoods) && !idCardTaskNode.get('cleaned')) { + showResult('装配任务未清洗完成或清洗完成时间未到!', null, sstsConfig.messagePauseTimeOnPackingPage); + return; + } + // 加载器械包信息 + if (manualScan) { + var tousseName = idCardTaskNode.get('tousseName'); + var vedioName = idCardTaskNode.get('uuid_vedioNames'); + var td_id = idCardTaskNode.get('tousseID'); + var taskId = idCardTaskNode.get('taskId'); + var isTraceable = idCardTaskNode.get('isTraceable'); + var allowModifyPackageType = idCardTaskNode.get('allowModifyPackageType'); + if (result.idCard.tousseDefinition.needInspectMaterials) { + var tousseID = result.idCard.tousseDefinition.id + '+标识牌'; + var tousseName = result.idCard.tousseDefinition.name; + var resultAmount = 1; + var arr = getPackingMaterialsForCheck.get(tousseID) || []; + arr[0] = tousseName; + arr[1] = resultAmount; + getPackingMaterialsForCheck.set(tousseID, arr); + } + loadTousseInfo(tousseName, imageType_tousse, vedioName, td_id, isTraceable, taskId); + lastSelectTousseName = tousseName; + lastSelectimageTypeTousse = imageType_tousse; + lastSelectVedioName = vedioName; + lastSelectTdId = td_id; + var tousseType = idCardTaskNode.get('tousseType'); + var isPrint = idCardTaskNode.get('isPrint'); + var isReview = idCardTaskNode.get('isReview'); + showPackButton(isPrint, isReview, tousseType); + if (allowModifyPackageType == '否') { + Ext4.getCmp('packageType').disable(); + } else { + Ext4.getCmp('packageType').enable(); + } + } + // 取消选中所有的装配任务,只选中该标识牌的 + uncheckAllExceptCurrentIDCardPackingTask(); + currentIDCardInfo = result.idCard; + if (autoSetIDCardBarcodeForPacking) { + Ext4.getCmp('idCardBarcode').setValue(barcode); + Ext4.getCmp('idCardName').setValue(tousseName + "(条码:" + barcode + ")"); + Ext4.getCmp('idCardUseAmount').setValue(result.idCard.idCardDefinition.useAmount); + idCardBarcode = barcode; + idCardInstanceID = result.idCard.id; + idCardInfo = result.idCard; + Ext4.getCmp('operatorBarcode').focus(); + } else { + Ext4.getCmp('idCardBarcode').focus(); + } + var sterilingType = idCardTaskNode.get("sterilingMethod"); + var packageType; + if (sstsConfig.enableIdCardDefaultPackageType) {//标识牌增加包装类型 + packageType = result.idCard.idCardDefinition.packageType; + } else { + packageType = idCardTaskNode.get("packageType"); + } -function onErrorDamageBtnClick2(type){ - if(!idCardTaskNode){ - return; + Ext4.getCmp('packageType').setValue(packageType); + Ext4.getCmp('sterilingType').setValue(sterilingType); + Ext4.getCmp('remark').setValue(errorDamageRemark); + Ext4.getCmp('errorDamageRemarkInfo').setValue(errorDamageRemark); + Ext4.getCmp('errorDamageRemarkId').setValue(errorDamageRemarkId); + //根据灭菌程序设置灭菌方式的值 + setSterilingModeValueBySterilingType(sterilingType); + + // alert(idCardInstanceID) + // 做保养器械包的处理 + maintainTousse(); + refreshErrorAndDamageRemark(idCardTaskNode); + refreshRecyclingItemRemark(idCardTaskNode); + + // 显示丢失报损按钮 + showOrHideErrorAndDamageBtn(); + if (manualScan) { + // 自动装配 + packingView_autoPacking(); + } } - if(type_lost == type){ - if(!haveLost(idCardTaskNode)){ + + function onErrorDamageBtnClick2(type) { + if (!idCardTaskNode) { return; - } - }else{ - if(!haveDamages(idCardTaskNode)){ - return; - } + } + if (type_lost == type) { + if (!haveLost(idCardTaskNode)) { + return; + } + } else { + if (!haveDamages(idCardTaskNode)) { + return; + } + } + var taskId = idCardTaskNode.get('taskId'); + onErrorDamageBtnClick(type, taskId); } - var taskId = idCardTaskNode.get('taskId'); - onErrorDamageBtnClick(type,taskId); -} -function reSetParentNodeAmount(delNode){ - if(delNode != null){ - var amount = delNode.get("amount"); - var pNode = delNode.parentNode; - var t_amount = pNode.get("amount"); - var t_unPackingAmount = pNode.get("unPackingAmount"); - if(t_amount == amount){ - pNode.remove(); - }else{ - pNode.set("amount",t_amount-amount); - pNode.set('unPackingAmount',t_unPackingAmount?(t_unPackingAmount-amount):(t_amount-amount)); + function reSetParentNodeAmount(delNode) { + if (delNode != null) { + var amount = delNode.get("amount"); + var pNode = delNode.parentNode; + var t_amount = pNode.get("amount"); + var t_unPackingAmount = pNode.get("unPackingAmount"); + if (t_amount == amount) { + pNode.remove(); + } else { + pNode.set("amount", t_amount - amount); + pNode.set('unPackingAmount', t_unPackingAmount ? (t_unPackingAmount - amount) : (t_amount - amount)); + } } } -} -deletePackingTask = function(ids,tousseID,amount,notLossReport,rowId) { - top.Ext4.MessageBox.confirm("请确认","是否删除所选择的待装配任务?", - function(button, text) { - if ("yes" == button){ - Ext4.Ajax.request({ - url : WWWROOT + '/disinfectSystem/packingAction!deletePackingTask.do', - params : { - ids : ids, - tousseID:tousseID, - amount:amount, - notLossReport:notLossReport - },success : function(response, options) { - var result = Ext4.decode(response.responseText); - var success = result.success; - if (true != success) { - showResult(result.cause , null , sstsConfig.messagePauseTimeOnPackingPage); - return; - } else { - showResult('删除成功!' , null , sstsConfig.messagePauseTimeOnPackingPage); - - //删除扫描篮筐后出现的装配任务 - var rootNode = Ext4.getCmp('basketTreeGrid').getRootNode(); - var tousseNodes = rootNode.childNodes; - if(tousseNodes.length > 0){ - var idsArray = ids.split(";"); - //for循环里面不能循环删除 - var deleteNodes = new Array(); - Ext4.Array.each(tousseNodes, function(pNode){ - Ext4.Array.each(pNode.childNodes,function(cNode){ - for(var i = 0;i < idsArray.length;i++){ - if(cNode.get('taskId') == idsArray[i]){ - if(rowId != null && rowId != cNode.id){ - continue; + deletePackingTask = function (ids, tousseID, amount, notLossReport, rowId) { + top.Ext4.MessageBox.confirm("请确认", "是否删除所选择的待装配任务?", + function (button, text) { + if ("yes" == button) { + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/packingAction!deletePackingTask.do', + params: { + ids: ids, + tousseID: tousseID, + amount: amount, + notLossReport: notLossReport + }, success: function (response, options) { + var result = Ext4.decode(response.responseText); + var success = result.success; + if (true != success) { + showResult(result.cause, null, sstsConfig.messagePauseTimeOnPackingPage); + return; + } else { + showResult('删除成功!', null, sstsConfig.messagePauseTimeOnPackingPage); + + //删除扫描篮筐后出现的装配任务 + var rootNode = Ext4.getCmp('basketTreeGrid').getRootNode(); + var tousseNodes = rootNode.childNodes; + if (tousseNodes.length > 0) { + var idsArray = ids.split(";"); + //for循环里面不能循环删除 + var deleteNodes = new Array(); + Ext4.Array.each(tousseNodes, function (pNode) { + Ext4.Array.each(pNode.childNodes, function (cNode) { + for (var i = 0; i < idsArray.length; i++) { + if (cNode.get('taskId') == idsArray[i]) { + if (rowId != null && rowId != cNode.id) { + continue; + } + var le = deleteNodes.length; + deleteNodes[le] = cNode; + } } - var le = deleteNodes.length; - deleteNodes[le] = cNode; - } + }); + }); + for (var i = 0; i < deleteNodes.length; i++) { + reSetParentNodeAmount(deleteNodes[i]); + deleteNodes[i].remove(); } - }); - }); - for(var i = 0;i < deleteNodes.length;i++){ - reSetParentNodeAmount(deleteNodes[i]); - deleteNodes[i].remove(); + } + // 刷新waitPackingTreeGrid + Ext4.getCmp('waitPackingTreeGrid').getStore().reload(); } + }, + failure: function (response, options) { + var result = Ext4.decode(response.responseText); + showResult(result.cause, null, sstsConfig.messagePauseTimeOnPackingPage); } - // 刷新waitPackingTreeGrid - Ext4.getCmp('waitPackingTreeGrid').getStore().reload(); - } - }, - failure : function(response, options) { - var result = Ext4.decode(response.responseText); - showResult(result.cause , null , sstsConfig.messagePauseTimeOnPackingPage); + }); } }); - } - }); -} + } -Ext4.define('cModel',{ - extend : 'Ext4.data.Model', - idProperty: 'nodeId', - fields: [ - {name : 'taskId'}, - {name : 'tousseName'}, - {name : 'tousseID'}, - {name : 'invoicePlanId'}, - {name : 'unPackingAmount'}, - {name : 'amount'}, - {name : 'urgentAmount'}, - {name : 'tousseType'}, - {name : 'packageType'}, - {name : 'packageSize'}, - {name : 'sterilingMethod'}, - {name : 'washTime'}, - {name : 'basketName'}, - {name : 'basketBarcode'}, - {name : 'status'}, - {name : 'dateTime'}, - {name : 'recyclingUser'}, - {name : 'errors'}, - {name : 'damages'}, - {name : 'supplierName'}, - {name : 'taskType'}, - {name : 'department'}, - {name : 'isTraceable'}, - {name : 'isPrint'}, - {name : 'isReview'}, - {name : 'replenishMaterils'}, - {name : 'packedPhotographed'}, - {name : 'partPacking'}, - {name : 'haveIDCard'}, - {name : 'uuid_vedioNames'}, - {name : 'isTimeout'}, - {name : 'allowModifyPackageType'}, - {name : 'errorRemark'}, - {name : 'recyclingItemRemark'}, - {name : 'damageRemark'}, - {name : 'urgentLevel'}, - {name : 'idCardBarcode'}, - {name : 'customSplitBasketAmount'}, - {name : 'serialNumber'}, - {name : 'cleaned'}, - {name : 'note'}, - {name : 'maxAmount'}, - {name : 'urgentLevelObj'}, - {name : 'colorCode'}, - {name : 'classifiedItemAmountInfo'}, - {name : 'patient'}, - {name : 'needInspectMaterials'}, - {name : 'washRecordId'} -]}); + Ext4.define('cModel', { + extend: 'Ext4.data.Model', + idProperty: 'nodeId', + fields: [ + { name: 'taskId' }, + { name: 'tousseName' }, + { name: 'tousseID' }, + { name: 'invoicePlanId' }, + { name: 'unPackingAmount' }, + { name: 'amount' }, + { name: 'urgentAmount' }, + { name: 'tousseType' }, + { name: 'packageType' }, + { name: 'packageSize' }, + { name: 'sterilingMethod' }, + { name: 'washTime' }, + { name: 'basketName' }, + { name: 'basketBarcode' }, + { name: 'status' }, + { name: 'dateTime' }, + { name: 'recyclingUser' }, + { name: 'errors' }, + { name: 'damages' }, + { name: 'supplierName' }, + { name: 'taskType' }, + { name: 'department' }, + { name: 'isTraceable' }, + { name: 'isPrint' }, + { name: 'isReview' }, + { name: 'replenishMaterils' }, + { name: 'packedPhotographed' }, + { name: 'partPacking' }, + { name: 'haveIDCard' }, + { name: 'uuid_vedioNames' }, + { name: 'isTimeout' }, + { name: 'allowModifyPackageType' }, + { name: 'errorRemark' }, + { name: 'recyclingItemRemark' }, + { name: 'damageRemark' }, + { name: 'urgentLevel' }, + { name: 'idCardBarcode' }, + { name: 'customSplitBasketAmount' }, + { name: 'serialNumber' }, + { name: 'cleaned' }, + { name: 'note' }, + { name: 'maxAmount' }, + { name: 'urgentLevelObj' }, + { name: 'colorCode' }, + { name: 'classifiedItemAmountInfo' }, + { name: 'patient' }, + { name: 'needInspectMaterials' }, + { name: 'washRecordId' } + ] + }); -var basketWidth = 72; -if(!sstsConfig.disableIdCard){ - basketWidth += 72; -} -if(sstsConfig.showBarcodeOfWashBasketInPackingTaskList){ - basketWidth += 72; -} + var basketWidth = 72; + if (!sstsConfig.disableIdCard) { + basketWidth += 72; + } + if (sstsConfig.showBarcodeOfWashBasketInPackingTaskList) { + basketWidth += 72; + } -function getGridColumns(headerName,treeId){ - if(headerName == '物品名称'){ - var obj = { - header: '物品名称', - minWidth:200, - sortable: true, - xtype : 'treecolumn', - dataIndex: 'tousseName', - renderer: function(v,p,record,rowIndex, columnIndex, store,view){ - p.style='word-wrap: break-word !important;'; - var tousseName = record.get('tousseName'); - var showName = '' + tousseName + ''; - if(record.get('taskType') == taskType_application || record.get('taskType') == taskType_returnGoods - || record.get('taskType') == taskType_qualityMonitor){ - showName = '' + showName; - } - if(record.get('replenishMaterils')){ - showName = '' + showName + ''; - } - //根据器械包大小物品名称显示不同颜色 - if(record.get('leaf') && sstsConfig.tousseSizeColor){ - if(record.get("packageSize") == "超大包"){ - showName = '' + showName + ''; - }else if(record.get("packageSize") == "大包"){ - showName = '' + showName + ''; - }else if(record.get("packageSize") == "中包"){ - showName = '' + showName + ''; - }else if(record.get("packageSize") == "小包"){ - showName = '' + showName + ''; - } - } - var resultName = ''; - if(record.get('leaf') && record.get('patient') !== '' && record.get('tousseType') == '外来器械包'){ - resultName = showName+'-'+ record.get('patient'); - }else { - resultName = showName; - } - if(record.get('tousseType') == '外来器械包'){ - if(sstsConfig.enableCheckUploadPhotoBeforePackingForeignTousse && sstsConfig.allowForeignToussePartSplitWhenPacking){ - if(record.get('partPacking') && !record.get('isTimeout')){ - p.css = 'tousseName_background'; + function getGridColumns(headerName, treeId) { + if (headerName == '物品名称') { + var obj = { + header: '物品名称', + minWidth: 200, + sortable: true, + xtype: 'treecolumn', + dataIndex: 'tousseName', + renderer: function (v, p, record, rowIndex, columnIndex, store, view) { + p.style = 'word-wrap: break-word !important;'; + var tousseName = record.get('tousseName'); + var showName = '' + tousseName + ''; + if (record.get('taskType') == taskType_application || record.get('taskType') == taskType_returnGoods + || record.get('taskType') == taskType_qualityMonitor) { + showName = '' + showName; + } + if (record.get('replenishMaterils')) { + showName = '' + showName + ''; + } + //根据器械包大小物品名称显示不同颜色 + if (record.get('leaf') && sstsConfig.tousseSizeColor) { + if (record.get("packageSize") == "超大包") { + showName = '' + showName + ''; + } else if (record.get("packageSize") == "大包") { + showName = '' + showName + ''; + } else if (record.get("packageSize") == "中包") { + showName = '' + showName + ''; + } else if (record.get("packageSize") == "小包") { + showName = '' + showName + ''; } - if(record.get('packedPhotographed') && !record.get('isTimeout')){ - p.css = 'tousseName_background_1'; + } + var resultName = ''; + if (record.get('leaf') && record.get('patient') !== '' && record.get('tousseType') == '外来器械包') { + resultName = showName + '-' + record.get('patient'); + } else { + resultName = showName; + } + if (record.get('tousseType') == '外来器械包') { + if (sstsConfig.enableCheckUploadPhotoBeforePackingForeignTousse && sstsConfig.allowForeignToussePartSplitWhenPacking) { + if (record.get('partPacking') && !record.get('isTimeout')) { + p.css = 'tousseName_background'; + } + if (record.get('packedPhotographed') && !record.get('isTimeout')) { + p.css = 'tousseName_background_1'; + } + } else if (sstsConfig.enableCheckUploadPhotoBeforePackingForeignTousse && !sstsConfig.allowForeignToussePartSplitWhenPacking) { + if (record.get('packedPhotographed') && !record.get('isTimeout')) { + p.css = 'tousseName_background_1'; + } + } else if (!sstsConfig.enableCheckUploadPhotoBeforePackingForeignTousse && sstsConfig.allowForeignToussePartSplitWhenPacking) { + if (record.get('partPacking') && !record.get('isTimeout')) { + p.css = 'tousseName_background'; + } } - }else if(sstsConfig.enableCheckUploadPhotoBeforePackingForeignTousse && !sstsConfig.allowForeignToussePartSplitWhenPacking){ - if(record.get('packedPhotographed') && !record.get('isTimeout')){ - p.css = 'tousseName_background_1'; + return resultName; + } else { + return resultName; + } + } + } + return obj; + } else if (headerName == '数量') { + var obj = { + header: '数量', + width: 50, + align: 'center', + sortable: true, + dataIndex: 'amount', + renderer: function (v, p, record, rowIndex, columnIndex, store, view) { + if (!sstsConfig.waitPackingTaskGrid_show_foreignTousse_customSplitBasketAmount) { + return v; + } + if ('basketTreeGrid' == treeId) { + return v; + } + if (record.get('leaf')) { + if (record.data.customSplitBasketAmount > 0) { + return v + '(' + record.data.customSplitBasketAmount + ')'; + } else { + return v; } - }else if(!sstsConfig.enableCheckUploadPhotoBeforePackingForeignTousse && sstsConfig.allowForeignToussePartSplitWhenPacking){ - if(record.get('partPacking') && !record.get('isTimeout')){ - p.css = 'tousseName_background'; + } else { + if (record.data.customSplitBasketAmount > 0 && record.data.children.length <= 1) { + return v + '(' + record.data.customSplitBasketAmount + ')'; + } else { + return v; } } - return resultName; - }else { - return resultName; - } - } - } - return obj; - }else if(headerName == '数量'){ - var obj = { - header: '数量', - width : 50, - align:'center', - sortable: true, - dataIndex: 'amount', - renderer: function(v,p,record,rowIndex, columnIndex, store,view){ - if(!sstsConfig.waitPackingTaskGrid_show_foreignTousse_customSplitBasketAmount){ - return v; - } - if('basketTreeGrid' == treeId){ - return v; - } - if(record.get('leaf')){ - if(record.data.customSplitBasketAmount > 0){ - return v+'('+record.data.customSplitBasketAmount+')'; - }else{ - return v; - } - }else{ - if(record.data.customSplitBasketAmount > 0 && record.data.children.length <= 1){ - return v+'('+record.data.customSplitBasketAmount+')'; - }else{ - return v; - } - } - - return v; - }, - editor: { - xtype: 'numberfield', - allowBlank: true, - allowDecimals :false, - minValue: 0, - listeners : { - focus:function(that){ - this.selectText(); - if(sstsConfig.enablePackingMaterialsCheckFunction){ - if('basketTreeGrid' == treeId){ - setTimeout(function(){ - var records = Ext4.getCmp(treeId).getSelectionModel().getSelection(); - getPackingMaterialsForCheckFun(records[0],that.value) - }, 2000); - }else { - var records = Ext4.getCmp(treeId).getSelectionModel().getSelection(); - if(records[0].data.tousseType == '敷料包' || records[0].data.taskType == 3){ - setTimeout(function(){ - getPackingMaterialsForCheckFun(records[0],that.value) + + return v; + }, + editor: { + xtype: 'numberfield', + allowBlank: true, + allowDecimals: false, + minValue: 0, + listeners: { + focus: function (that) { + this.selectText(); + if (sstsConfig.enablePackingMaterialsCheckFunction) { + if ('basketTreeGrid' == treeId) { + setTimeout(function () { + var records = Ext4.getCmp(treeId).getSelectionModel().getSelection(); + getPackingMaterialsForCheckFun(records[0], that.value) }, 2000); + } else { + var records = Ext4.getCmp(treeId).getSelectionModel().getSelection(); + if (records[0].data.tousseType == '敷料包' || records[0].data.taskType == 3) { + setTimeout(function () { + getPackingMaterialsForCheckFun(records[0], that.value) + }, 2000); + } } } } - } - } - } - } - return obj; - }else if(headerName == '操作'){ - var obj = { - header: '操作', - width : 120, - align:'center', - sortable: true, - renderer: function(v,p,record,rowIndex, columnIndex, store){ - var str = '
'; - if(record.get('leaf')){ - var taskid = record.get('taskId'); - var tousseName = record.get('tousseName'); - var tousseID = record.get('tousseID'); - var status = record.get('status'); - var amount = record.get('amount'); - var supplent = true; - var notLossReport = true; - if(status == '待装配'){ - var errors = record.get('errors'); - for(var i = 0;i < errors.length ; i++) { - if(errorTypeAdd != errors[i].errorType && ((errors[i].amount - errors[i].additionalAmount) != 0)) { - supplent = false; - notLossReport = false; - } - } - if(notLossReport){ - var damages = record.get('damages'); - if(damages.length > 0){ - notLossReport = false; - } - } - } - if(!SSTS_PackingTask_Delete){ - if(taskid != undefined && taskid != null){ - str += ""; - } } - if(status == '待装配'){ - var errorRemark = record.get('errorRemark'); - var damageRemark = record.get('damageRemark'); - if(!supplent){ - str += ""; - } - var damages = record.get('damages'); - if(damages.length > 0){ - str += ""; - } - } - if(record.get('tousseType') == '外来器械包' && treeId == 'basketTreeGrid'){ - var supplierName = record.get('supplierName'); - var basketBarcode = record.get('basketBarcode'); - var showName = tousseName; - var invoicePlanId = record.get('invoicePlanId'); - var packageType = record.get('packageType'); - var sterilingMethod = record.get('sterilingMethod'); - var tousseID = record.get('tousseID'); - if(!allowForeignToussePartiallyPacking){ - str += ""; - } - } } - str += '
'; - return str; } - } - return obj; - }else if(headerName == '加急数量'){ - var obj = { - header: '加急数量', - width : 80, - align:'center', - sortable: true, - dataIndex: 'urgentAmount', - hidden:!sstsConfig.enableUrgentFunction, - renderer: function(v,p,record,rowIndex, columnIndex, store,view){ - if(v > 0){ - var urgentAmountColor = ""; - if(sstsConfig.enableUrgentFunction){ - if(record.get("leaf")){//子级 - var urgentLevelObj = record.get("urgentLevelObj"); - if(urgentLevelObj != null){ - var colorCode = record.get("urgentLevelObj").colorCode; - if(colorCode != ""){//有加急的 - urgentAmountColor = "

" + v + "

"; + return obj; + } else if (headerName == '操作') { + var obj = { + header: '操作', + width: 120, + align: 'center', + sortable: true, + renderer: function (v, p, record, rowIndex, columnIndex, store) { + var str = '
'; + if (record.get('leaf')) { + var taskid = record.get('taskId'); + var tousseName = record.get('tousseName'); + var tousseID = record.get('tousseID'); + var status = record.get('status'); + var amount = record.get('amount'); + var supplent = true; + var notLossReport = true; + if (status == '待装配') { + var errors = record.get('errors'); + for (var i = 0; i < errors.length; i++) { + if (errorTypeAdd != errors[i].errorType && ((errors[i].amount - errors[i].additionalAmount) != 0)) { + supplent = false; + notLossReport = false; } } - }else{//父级 - var parentColor = record.get("colorCode"); - urgentAmountColor = "

" +v + "

"; + if (notLossReport) { + var damages = record.get('damages'); + if (damages.length > 0) { + notLossReport = false; + } + } } + if (!SSTS_PackingTask_Delete) { + if (taskid != undefined && taskid != null) { + str += ""; + } + } + if (status == '待装配') { + var errorRemark = record.get('errorRemark'); + var damageRemark = record.get('damageRemark'); + if (!supplent) { + str += ""; + } + var damages = record.get('damages'); + if (damages.length > 0) { + str += ""; + } + } + if (record.get('tousseType') == '外来器械包' && treeId == 'basketTreeGrid') { + var supplierName = record.get('supplierName'); + var basketBarcode = record.get('basketBarcode'); + var showName = tousseName; + var invoicePlanId = record.get('invoicePlanId'); + var packageType = record.get('packageType'); + var sterilingMethod = record.get('sterilingMethod'); + var tousseID = record.get('tousseID'); + if (!allowForeignToussePartiallyPacking) { + str += ""; + } + } } - return urgentAmountColor; - }else{ - return null; - } - } - } - return obj; - }else if(headerName == '加急级别'){ - var obj = { - header: '加急级别', - width: 80, - align: 'center', - sortable: true, - hidden:!sstsConfig.enableUrgentFunction, - dataIndex: 'urgentLevel', - renderer: function(v,p,record,rowIndex, columnIndex, store,view){ - if(v != "" ){ - var urgentLevel = ""; - if(sstsConfig.enableUrgentFunction){ - if(record.get("leaf")){//子级 - var urgentLevelObj = record.get("urgentLevelObj"); - if(urgentLevelObj != null){ - var colorCode = record.get("urgentLevelObj").colorCode; - if(colorCode != ""){ - urgentLevel = "

" +v + "

"; + str += '
'; + return str; + } + } + return obj; + } else if (headerName == '加急数量') { + var obj = { + header: '加急数量', + width: 80, + align: 'center', + sortable: true, + dataIndex: 'urgentAmount', + hidden: !sstsConfig.enableUrgentFunction, + renderer: function (v, p, record, rowIndex, columnIndex, store, view) { + if (v > 0) { + var urgentAmountColor = ""; + if (sstsConfig.enableUrgentFunction) { + if (record.get("leaf")) {//子级 + var urgentLevelObj = record.get("urgentLevelObj"); + if (urgentLevelObj != null) { + var colorCode = record.get("urgentLevelObj").colorCode; + if (colorCode != "") {//有加急的 + urgentAmountColor = "

" + v + "

"; + } } + } else {//父级 + var parentColor = record.get("colorCode"); + urgentAmountColor = "

" + v + "

"; } - - }else{//父级 - var parentColor = record.get("colorCode"); - urgentLevel = "

" +v + "

"; } + return urgentAmountColor; + } else { + return null; } - return urgentLevel; - }else{ - return null; } } - } - return obj; - }else if(headerName == '清洗篮筐'){ - var obj = { - header: '清洗篮筐', - width : basketWidth, - align:'center', - sortable: true, - dataIndex: 'basketName', - renderer:function (value, metaData, record, rowIdx, colIdx, store){ - var html = value; - var classifiedItemAmountInfo = record.get('classifiedItemAmountInfo') || ''; - if(classifiedItemAmountInfo !== '' && record.get('tousseType') == '外来器械包'){ - html = classifiedItemAmountInfo; + return obj; + } else if (headerName == '加急级别') { + var obj = { + header: '加急级别', + width: 80, + align: 'center', + sortable: true, + hidden: !sstsConfig.enableUrgentFunction, + dataIndex: 'urgentLevel', + renderer: function (v, p, record, rowIndex, columnIndex, store, view) { + if (v != "") { + var urgentLevel = ""; + if (sstsConfig.enableUrgentFunction) { + if (record.get("leaf")) {//子级 + var urgentLevelObj = record.get("urgentLevelObj"); + if (urgentLevelObj != null) { + var colorCode = record.get("urgentLevelObj").colorCode; + if (colorCode != "") { + urgentLevel = "

" + v + "

"; + } + } + + } else {//父级 + var parentColor = record.get("colorCode"); + urgentLevel = "

" + v + "

"; + } + } + return urgentLevel; + } else { + return null; + } } - metaData.style='white-space: normal !important;'; - metaData.tdAttr = 'data-qtip="' + Ext4.String.htmlEncode(html) + '"'; //在tips中展示列的全部内容. - if(value !== '' && record.get('basketBarcode') !== '' && sstsConfig.showBarcodeOfWashBasketInPackingTaskList){ - if(value.split(';').length > 1){ - var resultValue = [] - var basketBarcodes = record.get('basketBarcode'); - for(var i=0;i 1) { + var resultValue = [] + var basketBarcodes = record.get('basketBarcode'); + for (var i = 0; i < value.split(';').length; i++) { + resultValue[i] = value.split(';')[i] + '(' + basketBarcodes.split(';')[i] + ')'; + } + return resultValue.join(';'); + } else { + return value + '(' + record.get('basketBarcode') + ')'; } - return resultValue.join(';'); - }else { - return value+'('+record.get('basketBarcode')+')'; + } else { + return value; } - }else { - return value; } - } + } + return obj; + } else if (headerName == '申请科室') { + var obj = { + header: '申请科室', + width: 80, + align: 'center', + sortable: true, + dataIndex: 'department' + } + return obj; + } else if (headerName == '清洗时间') { + var obj = { + header: '清洗时间', + width: 110, + align: 'center', + sortable: true, + dataIndex: 'washTime' + } + return obj; + } else if (headerName == '回收人') { + var obj = { + header: '回收人', + width: 80, + align: 'center', + sortable: true, + hidden: !sstsConfig.showRecyclingPeopleColumnInPackingTasksList, + dataIndex: 'recyclingUser' + } + return obj; + } else if (headerName == '回收时间') { + var obj = { + header: '回收时间', + width: 110, + align: 'center', + sortable: true, + dataIndex: 'dateTime' + } + return obj; + } else if (headerName == '状态') { + var obj = { + header: '状态', + width: 60, + align: 'center', + sortable: true, + dataIndex: 'status' + } + return obj; + } else if (headerName == '序号') { + var obj = { + header: '序号', + width: 40, + align: 'center', + sortable: true, + hidden: !sstsConfig.enablePackingSerialNu, + dataIndex: 'serialNumber' + } + return obj; } - return obj; - }else if(headerName == '申请科室'){ - var obj = { - header: '申请科室', - width : 80, - align:'center', - sortable: true, - dataIndex: 'department' - } - return obj; - }else if(headerName == '清洗时间'){ - var obj = { - header: '清洗时间', - width : 110, - align:'center', - sortable: true, - dataIndex: 'washTime' - } - return obj; - }else if(headerName == '回收人'){ - var obj = { - header: '回收人', - width : 80, - align:'center', - sortable: true, - hidden:!sstsConfig.showRecyclingPeopleColumnInPackingTasksList, - dataIndex: 'recyclingUser' - } - return obj; - }else if(headerName == '回收时间'){ - var obj = { - header: '回收时间', - width : 110, - align:'center', - sortable: true, - dataIndex: 'dateTime' - } - return obj; - }else if(headerName == '状态'){ - var obj = { - header: '状态', - width : 60, - align:'center', - sortable: true, - dataIndex: 'status' - } - return obj; - }else if(headerName == '序号'){ - var obj = { - header: '序号', - width : 40, - align:'center', - sortable: true, - hidden:!sstsConfig.enablePackingSerialNu, - dataIndex: 'serialNumber' - } - return obj; } -} -function buildColumnTreeColumns(treeId){ - var columns = []; - if(sstsConfig.columnConfigOfpackingTaskList && sstsConfig.columnConfigOfpackingTaskList.length > 0){ - var columnConfigOfpackingTaskList = sstsConfig.columnConfigOfpackingTaskList; - for(var i=0;i 0) { + var columnConfigOfpackingTaskList = sstsConfig.columnConfigOfpackingTaskList; + for (var i = 0; i < columnConfigOfpackingTaskList.length; i++) { + if (getGridColumns(columnConfigOfpackingTaskList[i], treeId)) { + columns.push(getGridColumns(columnConfigOfpackingTaskList[i], treeId)); + } } + } else { + columns = [ + getGridColumns('物品名称', treeId), + getGridColumns('数量', treeId), + getGridColumns('操作', treeId), + getGridColumns('序号', treeId), + getGridColumns('加急数量', treeId), + getGridColumns('加急级别', treeId), + getGridColumns('清洗篮筐', treeId), + getGridColumns('申请科室', treeId), + getGridColumns('清洗时间', treeId), + getGridColumns('回收人', treeId), + getGridColumns('回收时间', treeId), + getGridColumns('状态', treeId) + ]; } - }else { - columns = [ - getGridColumns('物品名称',treeId), - getGridColumns('数量',treeId), - getGridColumns('操作',treeId), - getGridColumns('序号',treeId), - getGridColumns('加急数量',treeId), - getGridColumns('加急级别',treeId), - getGridColumns('清洗篮筐',treeId), - getGridColumns('申请科室',treeId), - getGridColumns('清洗时间',treeId), - getGridColumns('回收人',treeId), - getGridColumns('回收时间',treeId), - getGridColumns('状态',treeId) - ]; + return columns; } - return columns; -} -Ext4.define('columnTreeGrid',{ - extend: 'Ext4.tree.Panel', - xtype: 'tree-grid', - useArrows: true, - rootVisible: false, - multiSelect: false, - columnLines: true, - rowLines: true, - cls: 'no-leaf-icons', - initComponent: function() { - this.cellEditing = new Ext4.grid.plugin.CellEditing({ - clicksToEdit: 1, - listeners: { - beforeedit: function(editor, context, eOpts){ - var record = context.record; - if(record.data.errors.length > 0 || record.data.damages.length > 0){ - return false; - } - }, - afteredit:function(editor, context, eOpts){ - var record = context.record; - if(context.value == 0){ - showResult(record.get('tousseName') + "的数量不能为0", null , sstsConfig.messagePauseTimeOnPackingPage); - record.set('amount',context.originalValue); - return; - } - var parentUnPackingAmount; - var maxAmount; - var unPackingAmount; - if(context.grid.id == 'waitPackingTreeGrid'){ - parentUnPackingAmount = record.parentNode.get('unPackingAmount'); - maxAmount = record.raw.maxAmount; - unPackingAmount = record.get('unPackingAmount'); - }else { - parentUnPackingAmount = record.parentNode.get('maxAmount'); - maxAmount = record.data.maxAmount; - unPackingAmount = record.get('maxAmount'); - } - if(record.get('leaf')){ - var sum = 0; - Ext4.each(record.parentNode.childNodes, function(pNode) { - sum += parseInt(pNode.get('amount')); - }); - if(context.value > maxAmount){ - showResult(record.get('tousseName') + "的数量不能大于最大装配数量"+maxAmount , null , sstsConfig.messagePauseTimeOnPackingPage); - record.set('amount',context.originalValue); - return; + Ext4.define('columnTreeGrid', { + extend: 'Ext4.tree.Panel', + xtype: 'tree-grid', + useArrows: true, + rootVisible: false, + multiSelect: false, + columnLines: true, + rowLines: true, + cls: 'no-leaf-icons', + initComponent: function () { + this.cellEditing = new Ext4.grid.plugin.CellEditing({ + clicksToEdit: 1, + listeners: { + beforeedit: function (editor, context, eOpts) { + var record = context.record; + if (record.data.errors.length > 0 || record.data.damages.length > 0) { + return false; } - if(sum > parentUnPackingAmount){ - showResult(record.get('tousseName') + ",装配数量不能大于"+parentUnPackingAmount , null , sstsConfig.messagePauseTimeOnPackingPage); - record.set('amount',context.originalValue); + }, + afteredit: function (editor, context, eOpts) { + var record = context.record; + if (context.value == 0) { + showResult(record.get('tousseName') + "的数量不能为0", null, sstsConfig.messagePauseTimeOnPackingPage); + record.set('amount', context.originalValue); return; } - }else { - if(unPackingAmount !== '' && unPackingAmount < context.value){ - showResult(record.get('tousseName') + ",装配数量不能大于"+unPackingAmount , null , sstsConfig.messagePauseTimeOnPackingPage); - record.set('amount',unPackingAmount); + var parentUnPackingAmount; + var maxAmount; + var unPackingAmount; + if (context.grid.id == 'waitPackingTreeGrid') { + parentUnPackingAmount = record.parentNode.get('unPackingAmount'); + maxAmount = record.raw.maxAmount; + unPackingAmount = record.get('unPackingAmount'); + } else { + parentUnPackingAmount = record.parentNode.get('maxAmount'); + maxAmount = record.data.maxAmount; + unPackingAmount = record.get('maxAmount'); } + if (record.get('leaf')) { + var sum = 0; + Ext4.each(record.parentNode.childNodes, function (pNode) { + sum += parseInt(pNode.get('amount')); + }); + if (context.value > maxAmount) { + showResult(record.get('tousseName') + "的数量不能大于最大装配数量" + maxAmount, null, sstsConfig.messagePauseTimeOnPackingPage); + record.set('amount', context.originalValue); + return; + } + if (sum > parentUnPackingAmount) { + showResult(record.get('tousseName') + ",装配数量不能大于" + parentUnPackingAmount, null, sstsConfig.messagePauseTimeOnPackingPage); + record.set('amount', context.originalValue); + return; + } + } else { + if (unPackingAmount !== '' && unPackingAmount < context.value) { + showResult(record.get('tousseName') + ",装配数量不能大于" + unPackingAmount, null, sstsConfig.messagePauseTimeOnPackingPage); + record.set('amount', unPackingAmount); + } + } } } - } - }); - Ext4.apply(this, { - plugins: [this.cellEditing] - }); - this.superclass.initComponent.call(this); - } -}); + }); + Ext4.apply(this, { + plugins: [this.cellEditing] + }); + this.superclass.initComponent.call(this); + } + }); -function loadUserByBarcode(barcodeField,userNameField,userCodeField,focusField){ - - if(userNameField == null || userCodeField == null || barcodeField == null){ - showResult("参数错误,请联系管理员!" , null , sstsConfig.messagePauseTimeOnPackingPage); - return; + function loadUserByBarcode(barcodeField, userNameField, userCodeField, focusField) { + + if (userNameField == null || userCodeField == null || barcodeField == null) { + showResult("参数错误,请联系管理员!", null, sstsConfig.messagePauseTimeOnPackingPage); + return; + } + var peopleOfBarcode = barcodeField.getValue(); + + if (peopleOfBarcode) { + UserTableManager.getUserByBarcode(peopleOfBarcode, function (responseText) { + if (responseText != null && responseText != "") { + var result = Ext4.decode(responseText); + if (!result.success) { + result.isNotSameOrgUnit ? showResult("不允许登记非本科室人员,请扫描本科室人员条码") : showResult("输入的条码有误!", null, sstsConfig.messagePauseTimeOnPackingPage); //(cjr) + return; + } + userNameField.setValue(result.fullName); + userCodeField.setValue(result.name); + if (focusField != null) { + focusExtJSField(focusField); + } + } else { + showResult('找不到该条码所对应的人员信息', null, sstsConfig.messagePauseTimeOnPackingPage); + userNameField.setValue(); + } + }); + } + barcodeField.setValue(); } - var peopleOfBarcode = barcodeField.getValue(); - - if(peopleOfBarcode){ - UserTableManager.getUserByBarcode(peopleOfBarcode,function(responseText){ - if(responseText != null && responseText != ""){ - var result = Ext4.decode(responseText); - if(!result.success){ - result.isNotSameOrgUnit?showResult("不允许登记非本科室人员,请扫描本科室人员条码"):showResult("输入的条码有误!" , null , sstsConfig.messagePauseTimeOnPackingPage); //(cjr) - return; - } - userNameField.setValue(result.fullName); - userCodeField.setValue(result.name); - if(focusField != null){ - focusExtJSField(focusField); - } - }else{ - showResult('找不到该条码所对应的人员信息' , null , sstsConfig.messagePauseTimeOnPackingPage); - userNameField.setValue(); - } - }); - } - barcodeField.setValue(); -} -var imagePanel = new Ext4.Panel({ - id : 'imagePanel', - colspan: 2, - columnWidth : 1, - hidden : teachingPicture && teachingVideo, - height:((sstsConfig.showInspectorField || sstsConfig.showWrapperField || sstsConfig.showSterilizer) ? 230 : 297), - border : true, - layout:'fit', - items: [{ - xtype : 'panel', - layout:'absolute', - id: 'imageContentPanel', - items: [{ - xtype : 'image', - id : 'browseImage', - fieldLabel : "预览图片", - title:'双击预览图片', - src : Ext4.BLANK_IMAGE_URL - }] - } - ], - tbar:[ - { id:'imageName'} - ], - bbar: [ - {xtype:'hidden',id:'imageType'}, - {xtype:'hidden',id:'currentPage'}, - {xtype:'hidden',id:'materialId'}, - {xtype:'hidden',id:'vedioName'}, - {xtype:'hidden',id:'td_id'}, - {xtype:'hidden',id:'task_id'}, - {xtype:'hidden',id:'isTraceable'}, - {xtype:'hidden',id:'hideTousseName'}, - {xtype:'hidden',id:'hidePackedPhotographed'}, - '->', - { - xtype : 'button', - id:'btn_cameraCapture', - name:'btn_cameraCapture', - text : '拍摄', - hidden : !sstsConfig.showCameraPhoto, - handler : function(){ + var imagePanel = new Ext4.Panel({ + id: 'imagePanel', + colspan: 2, + columnWidth: 1, + hidden: teachingPicture && teachingVideo, + height: ((sstsConfig.showInspectorField || sstsConfig.showWrapperField || sstsConfig.showSterilizer) ? 230 : 297), + border: true, + layout: 'fit', + items: [{ + xtype: 'panel', + layout: 'absolute', + id: 'imageContentPanel', + items: [{ + xtype: 'image', + id: 'browseImage', + fieldLabel: "预览图片", + title: '双击预览图片', + src: Ext4.BLANK_IMAGE_URL + }] + } + ], + tbar: [ + { id: 'imageName' } + ], + bbar: [ + { xtype: 'hidden', id: 'imageType' }, + { xtype: 'hidden', id: 'currentPage' }, + { xtype: 'hidden', id: 'materialId' }, + { xtype: 'hidden', id: 'vedioName' }, + { xtype: 'hidden', id: 'td_id' }, + { xtype: 'hidden', id: 'task_id' }, + { xtype: 'hidden', id: 'isTraceable' }, + { xtype: 'hidden', id: 'hideTousseName' }, + { xtype: 'hidden', id: 'hidePackedPhotographed' }, + '->', + { + xtype: 'button', + id: 'btn_cameraCapture', + name: 'btn_cameraCapture', + text: '拍摄', + hidden: !sstsConfig.showCameraPhoto, + handler: function () { var isTraceable = Ext4.getCmp('isTraceable').getValue(); var hideTousseName = Ext4.getCmp('hideTousseName').getValue(); - if(isTraceable == '否'){ - showResult('【'+hideTousseName+'】是不追溯的物品,不支持采集图像/视频'); + if (isTraceable == '否') { + showResult('【' + hideTousseName + '】是不追溯的物品,不支持采集图像/视频'); return; } - var imageName = Ext4.getCmp('imageName').getText(); + var imageName = Ext4.getCmp('imageName').getText(); var td_id = Ext4.getCmp('td_id').getValue(); var task_id = Ext4.getCmp('task_id').getValue(); - if(isUndefinedOrNullOrEmpty(task_id)){ - showResult("请选择装配任务" , null , sstsConfig.messagePauseTimeOnPackingPage); - return ; - } - takeImgAndVideo(imageName,td_id,task_id,false,imageTypeCameraPacking,videoTypePacking); - } - }, - { - xtype : 'button', - id:'btn_cameraPhoto_application', - name:'btn_cameraPhoto_application', - text : '申请采集图片/视频', - hidden : !sstsConfig.showCameraPhoto, - handler : function(){ - var imageName = Ext4.getCmp('imageName').getText(); - var materialId = Ext4.getCmp('materialId').getValue(); - if(imageName != "" && materialId == ""){ - var td_id = Ext4.getCmp('td_id').getValue(); - takeImgAndVideo(imageName,td_id,'',true,imageTypeCameraApplication,videoType); - } - } - }, - { - xtype : 'button', - id:'btn_packingNote', - name:'btn_packingNote', - text : '配包注意事项', - hidden : teachingPicture, - handler : function(){ - var td_id = Ext4.getCmp('td_id').getValue(); - if(isUndefinedOrNullOrEmpty(td_id)){ - showResult("请选择装配任务" , null , sstsConfig.messagePauseTimeOnPackingPage); - }else{ - showToussePackingNote(td_id); - } - } - }, - { - xtype : 'button', - id:'btn_specification', - name:'btn_specification', - text : '说明书', - hidden : specificationPicture, - handler : function(){ - var imageName = Ext4.getCmp('imageName').getText(); - var materialId = Ext4.getCmp('materialId').getValue(); - if(imageName != "" && materialId == ""){ - var td_id = Ext4.getCmp('td_id').getValue(); - loadGoodsImage(imageName ,'器械包说明书' ,'',1 ,'' ,td_id); - setTimeout(function(){ + if (isUndefinedOrNullOrEmpty(task_id)) { + showResult("请选择装配任务", null, sstsConfig.messagePauseTimeOnPackingPage); + return; + } + takeImgAndVideo(imageName, td_id, task_id, false, imageTypeCameraPacking, videoTypePacking); + } + }, + { + xtype: 'button', + id: 'btn_cameraPhoto_application', + name: 'btn_cameraPhoto_application', + text: '申请采集图片/视频', + hidden: !sstsConfig.showCameraPhoto, + handler: function () { + var imageName = Ext4.getCmp('imageName').getText(); + var materialId = Ext4.getCmp('materialId').getValue(); + if (imageName != "" && materialId == "") { + var td_id = Ext4.getCmp('td_id').getValue(); + takeImgAndVideo(imageName, td_id, '', true, imageTypeCameraApplication, videoType); + } + } + }, + { + xtype: 'button', + id: 'btn_packingNote', + name: 'btn_packingNote', + text: '配包注意事项', + hidden: teachingPicture, + handler: function () { + var td_id = Ext4.getCmp('td_id').getValue(); + if (isUndefinedOrNullOrEmpty(td_id)) { + showResult("请选择装配任务", null, sstsConfig.messagePauseTimeOnPackingPage); + } else { + showToussePackingNote(td_id); + } + } + }, + { + xtype: 'button', + id: 'btn_specification', + name: 'btn_specification', + text: '说明书', + hidden: specificationPicture, + handler: function () { + var imageName = Ext4.getCmp('imageName').getText(); + var materialId = Ext4.getCmp('materialId').getValue(); + if (imageName != "" && materialId == "") { + var td_id = Ext4.getCmp('td_id').getValue(); + loadGoodsImage(imageName, '器械包说明书', '', 1, '', td_id); + setTimeout(function () { var row = { - tousseName:imageName, - td_id:td_id, - type:'器械包说明书', - materialId:'', - currentPage:1 + tousseName: imageName, + td_id: td_id, + type: '器械包说明书', + materialId: '', + currentPage: 1 } amendDisinfectionTousse(row); }, 500); - } - } - }, - { - xtype : 'button', - id:'btn_teachingPicture', - name:'btn_teachingPicture', - text : '教学图片', - hidden : teachingPicture, - handler : function(){ - var imageName = Ext4.getCmp('imageName').getText(); - var materialId = Ext4.getCmp('materialId').getValue(); - if(imageName != "" && materialId == ""){ - var td_id = Ext4.getCmp('td_id').getValue(); - loadGoodsImage(imageName ,'器械包装配教学图片' ,'',1 ,'' ,td_id); - setTimeout(function(){ + } + } + }, + { + xtype: 'button', + id: 'btn_teachingPicture', + name: 'btn_teachingPicture', + text: '教学图片', + hidden: teachingPicture, + handler: function () { + var imageName = Ext4.getCmp('imageName').getText(); + var materialId = Ext4.getCmp('materialId').getValue(); + if (imageName != "" && materialId == "") { + var td_id = Ext4.getCmp('td_id').getValue(); + loadGoodsImage(imageName, '器械包装配教学图片', '', 1, '', td_id); + setTimeout(function () { var row = { - tousseName:imageName, - td_id:td_id, - type:'器械包装配教学图片', - materialId:'', - currentPage:1 + tousseName: imageName, + td_id: td_id, + type: '器械包装配教学图片', + materialId: '', + currentPage: 1 } amendDisinfectionTousse(row); }, 500); - } - } - }, - { - xtype : 'button', - hidden : teachingVideo, - text : '配包视频', - id:'btn_watchVideoBar', - name:'btn_watchVideoBar', - handler : function(){ - var td_id = Ext4.getCmp('td_id').getValue(); - watchVideoModel(td_id); - } - }, - { - xtype : 'button', - id : 'btn_washQualityCheckPoint', - name : 'btn_washQualityCheckPoint', - hidden : true, - text : '清洗质量检查关注点', - handler : function(){ - if(!curSelMaterialId){ - showResult("请选择材料" , null , sstsConfig.messagePauseTimeOnPackingPage); - return; - } - loadGoodsImage(curSelMaterialName,IMAGE_TYPE_MATERIAL_WASHQUALITYCHECKPOINT,curSelMaterialId,1,"",""); - } - }, - { - xtype : 'button', - id : 'btn_washQualityCheckMethod', - name : 'btn_washQualityCheckMethod', - hidden : true, - text : '清洗质量检查方法', - handler : function(){ - if(!curSelMaterialId){ - showResult("请选择材料" , null , sstsConfig.messagePauseTimeOnPackingPage); - return; - } - loadGoodsImage(curSelMaterialName,IMAGE_TYPE_MATERIAL_WASHQUALITYCHECKMETHOD,curSelMaterialId,1,"",""); - } - }, - { - xtype : 'button', - id : 'btn_functionCheck', - name : 'btn_functionCheck', - hidden : true, - text : '功能检查', - handler : function(){ - if(!curSelMaterialId){ - showResult("请选择材料" , null , sstsConfig.messagePauseTimeOnPackingPage); - return; - } - loadGoodsImage(curSelMaterialName,IMAGE_TYPE_MATERIAL_FUNCTIONCHECK,curSelMaterialId,1,"",""); - } - }, - { - xtype : 'button', - id : 'btn_viewTousseImage', - name : 'btn_viewTousseImage', - text : '查看包图片', - handler : function(){ - if(lastSelectTousseName && lastSelectTdId){ - loadGoodsImage(lastSelectTousseName ,lastSelectimageTypeTousse ,'',1 ,lastSelectVedioName ,lastSelectTdId); - setTimeout(function(){ + } + } + }, + { + xtype: 'button', + hidden: teachingVideo, + text: '配包视频', + id: 'btn_watchVideoBar', + name: 'btn_watchVideoBar', + handler: function () { + var td_id = Ext4.getCmp('td_id').getValue(); + watchVideoModel(td_id); + } + }, + { + xtype: 'button', + id: 'btn_washQualityCheckPoint', + name: 'btn_washQualityCheckPoint', + hidden: true, + text: '清洗质量检查关注点', + handler: function () { + if (!curSelMaterialId) { + showResult("请选择材料", null, sstsConfig.messagePauseTimeOnPackingPage); + return; + } + loadGoodsImage(curSelMaterialName, IMAGE_TYPE_MATERIAL_WASHQUALITYCHECKPOINT, curSelMaterialId, 1, "", ""); + } + }, + { + xtype: 'button', + id: 'btn_washQualityCheckMethod', + name: 'btn_washQualityCheckMethod', + hidden: true, + text: '清洗质量检查方法', + handler: function () { + if (!curSelMaterialId) { + showResult("请选择材料", null, sstsConfig.messagePauseTimeOnPackingPage); + return; + } + loadGoodsImage(curSelMaterialName, IMAGE_TYPE_MATERIAL_WASHQUALITYCHECKMETHOD, curSelMaterialId, 1, "", ""); + } + }, + { + xtype: 'button', + id: 'btn_functionCheck', + name: 'btn_functionCheck', + hidden: true, + text: '功能检查', + handler: function () { + if (!curSelMaterialId) { + showResult("请选择材料", null, sstsConfig.messagePauseTimeOnPackingPage); + return; + } + loadGoodsImage(curSelMaterialName, IMAGE_TYPE_MATERIAL_FUNCTIONCHECK, curSelMaterialId, 1, "", ""); + } + }, + { + xtype: 'button', + id: 'btn_viewTousseImage', + name: 'btn_viewTousseImage', + text: '查看包图片', + handler: function () { + if (lastSelectTousseName && lastSelectTdId) { + loadGoodsImage(lastSelectTousseName, lastSelectimageTypeTousse, '', 1, lastSelectVedioName, lastSelectTdId); + setTimeout(function () { var row = { - tousseName:lastSelectTousseName, - td_id:lastSelectTdId, - type:lastSelectimageTypeTousse, - materialId:'', - currentPage:1 + tousseName: lastSelectTousseName, + td_id: lastSelectTdId, + type: lastSelectimageTypeTousse, + materialId: '', + currentPage: 1 } amendDisinfectionTousse(row); - }, 500); - } - } - }, - {xtype:'button',text:'<<',tooltip :"上一页", handler : function(){ - var imageName = Ext4.getCmp('imageName').getText(); - var imageType = Ext4.getCmp('imageType').getValue(); - var currentPage = Ext4.getCmp('currentPage').getValue(); - var materialId = Ext4.getCmp('materialId').getValue(); - var vedioName = Ext4.getCmp('vedioName').getValue(); - var td_id = Ext4.getCmp('td_id').getValue(); - if(currentPage <= 1){ - Ext4.getCmp('currentPage').setValue(1); - showResult("已是第一页!" , null , sstsConfig.messagePauseTimeOnPackingPage); - }else{ - loadGoodsImage(imageName,imageType,materialId,parseInt(currentPage)-1,vedioName,td_id); - } - }}, - {xtype:'button',text:'>>', tooltip :"下一页", handler : function(){ - var imageName = Ext4.getCmp('imageName').getText(); - var imageType = Ext4.getCmp('imageType').getValue(); - var currentPage = Ext4.getCmp('currentPage').getValue(); - var materialId = Ext4.getCmp('materialId').getValue(); - var vedioName = Ext4.getCmp('vedioName').getValue(); - var td_id = Ext4.getCmp('td_id').getValue(); - var params = { - id : td_id, - materialId: materialId, - imageType:imageType - } - if(imageType == '材料图片'){ - params = { - id : materialId, - imageType:imageType - } - } - Ext4.Ajax.request({ - url : WWWROOT + '/disinfectSystem/baseData/showImageAction!getToussePictureAmount.do', - params : params, - success : function(result){ - var pageCount = Ext4.JSON.decode(result.responseText); - var totalPage = parseInt(pageCount.count); - if(currentPage >= totalPage){ - Ext4.getCmp('currentPage').setValue(totalPage); - showResult("已是最后一页!" , null , sstsConfig.messagePauseTimeOnPackingPage); - }else{ - loadGoodsImage(imageName,imageType,materialId,parseInt(currentPage)+1,vedioName,td_id); - } - }, - failure : function(){} - }); - }} - ] -}); + }, 500); + } + } + }, + { + xtype: 'button', text: '<<', tooltip: "上一页", handler: function () { + var imageName = Ext4.getCmp('imageName').getText(); + var imageType = Ext4.getCmp('imageType').getValue(); + var currentPage = Ext4.getCmp('currentPage').getValue(); + var materialId = Ext4.getCmp('materialId').getValue(); + var vedioName = Ext4.getCmp('vedioName').getValue(); + var td_id = Ext4.getCmp('td_id').getValue(); + if (currentPage <= 1) { + Ext4.getCmp('currentPage').setValue(1); + showResult("已是第一页!", null, sstsConfig.messagePauseTimeOnPackingPage); + } else { + loadGoodsImage(imageName, imageType, materialId, parseInt(currentPage) - 1, vedioName, td_id); + } + } + }, + { + xtype: 'button', text: '>>', tooltip: "下一页", handler: function () { + var imageName = Ext4.getCmp('imageName').getText(); + var imageType = Ext4.getCmp('imageType').getValue(); + var currentPage = Ext4.getCmp('currentPage').getValue(); + var materialId = Ext4.getCmp('materialId').getValue(); + var vedioName = Ext4.getCmp('vedioName').getValue(); + var td_id = Ext4.getCmp('td_id').getValue(); + var params = { + id: td_id, + materialId: materialId, + imageType: imageType + } + if (imageType == '材料图片') { + params = { + id: materialId, + imageType: imageType + } + } + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/showImageAction!getToussePictureAmount.do', + params: params, + success: function (result) { + var pageCount = Ext4.JSON.decode(result.responseText); + var totalPage = parseInt(pageCount.count); + if (currentPage >= totalPage) { + Ext4.getCmp('currentPage').setValue(totalPage); + showResult("已是最后一页!", null, sstsConfig.messagePauseTimeOnPackingPage); + } else { + loadGoodsImage(imageName, imageType, materialId, parseInt(currentPage) + 1, vedioName, td_id); + } + }, + failure: function () { } + }); + } + } + ] + }); -var sterilizerTypeStore = new Ext4.data.Store({ - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/sterilizerAction!getSterilizerTypeAndSterilizationPurpose.do', - reader : { - type : 'array' - } - }, - fields : [ 'id','typeName','typeNameAndPurpose','sterilizationMode' ], - autoLoad : true -}); -//灭菌炉 -var sterilizerJsonStore = new Ext4.data.Store({ - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/sterilizerAction!getAllSterilizer.do?includeNone=yes', - reader : { - type : 'array' - } - }, - fields : [ 'sterilizerName' ], - autoLoad : true -}); -var packageTypeStore = new Ext4.data.Store({ - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/baseData/expirationDateInfoAction!getPackageTypeAndExpirationDateInfo.do', - reader : { - type : 'array' - } - }, - fields : ['typeName','validDate','validDateUnit','warningDate'], - autoLoad : true -}); + var sterilizerTypeStore = new Ext4.data.Store({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/baseData/sterilizerAction!getSterilizerTypeAndSterilizationPurpose.do', + reader: { + type: 'array' + } + }, + fields: ['id', 'typeName', 'typeNameAndPurpose', 'sterilizationMode'], + autoLoad: true + }); + //灭菌炉 + var sterilizerJsonStore = new Ext4.data.Store({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/baseData/sterilizerAction!getAllSterilizer.do?includeNone=yes', + reader: { + type: 'array' + } + }, + fields: ['sterilizerName'], + autoLoad: true + }); + var packageTypeStore = new Ext4.data.Store({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/baseData/expirationDateInfoAction!getPackageTypeAndExpirationDateInfo.do', + reader: { + type: 'array' + } + }, + fields: ['typeName', 'validDate', 'validDateUnit', 'warningDate'], + autoLoad: true + }); -var tousseWeightStore = new Ext4.data.Store({ - proxy : { - type : 'ajax', - url : WWWROOT + '/disinfectSystem/core/httpOptionAction!getHttpOptionsById.do', - extraParams: { - optionId: 'tousseWeight' + var tousseWeightStore = new Ext4.data.Store({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/core/httpOptionAction!getHttpOptionsById.do', + extraParams: { + optionId: 'tousseWeight' + }, + reader: { + type: 'json', + root: 'data' + } }, - reader : { - type: 'json', - root: 'data' - } - }, - fields : ['value'], - autoLoad : true -}); + fields: ['value'], + autoLoad: true + }); -function deleteTask(tousseName,packAmount,taskItemArray){ - var basketTree = Ext4.getCmp('basketTreeGrid'); - var rootNode = basketTree.getRootNode(); - var tousseNodes = rootNode.childNodes.slice(0); - var selNodes = basketTree.getView().getChecked(); - if(tousseNodes.length > 0){ - Ext4.Array.each(tousseNodes, function(node){ - if(node.get('tousseName') == tousseName){ - if(node.get('unPackingAmount') == packAmount){ - node.remove(); - }else{ - node.set('amount',node.get('unPackingAmount') - packAmount); - node.set('unPackingAmount',node.get('unPackingAmount') - packAmount); - var urgentAmount = node.get('urgentAmount') - packAmount; - if(urgentAmount < 0){ - urgentAmount = 0; - } - node.set('urgentAmount',urgentAmount); - var taskNodes = node.childNodes; - - var delNodes = new Array(); - for(var i = 0;i < taskItemArray.length;i++){ - var taskId = taskItemArray[i].taskId; - var amount = taskItemArray[i].amount; - Ext4.Array.each(taskNodes,function(cNode){ - if(cNode.get('taskId') == taskId){ - var errors = cNode.get('errors'); - var damages = cNode.get("damages"); - if((errors == null || errors.length == 0) && (damages == null || damages.length == 0)){ - if(amount < cNode.get('amount')){ - cNode.set('amount',cNode.get('amount') - amount); - }else{ - var len = delNodes.length; - delNodes[len] = cNode; - } - } - } - }); - } - for(var j = 0;j < delNodes.length;j++){ - delNodes[j].remove() + function deleteTask(tousseName, packAmount, taskItemArray) { + var basketTree = Ext4.getCmp('basketTreeGrid'); + var rootNode = basketTree.getRootNode(); + var tousseNodes = rootNode.childNodes.slice(0); + var selNodes = basketTree.getView().getChecked(); + if (tousseNodes.length > 0) { + Ext4.Array.each(tousseNodes, function (node) { + if (node.get('tousseName') == tousseName) { + if (node.get('unPackingAmount') == packAmount) { + node.remove(); + } else { + node.set('amount', node.get('unPackingAmount') - packAmount); + node.set('unPackingAmount', node.get('unPackingAmount') - packAmount); + var urgentAmount = node.get('urgentAmount') - packAmount; + if (urgentAmount < 0) { + urgentAmount = 0; + } + node.set('urgentAmount', urgentAmount); + var taskNodes = node.childNodes; + + var delNodes = new Array(); + for (var i = 0; i < taskItemArray.length; i++) { + var taskId = taskItemArray[i].taskId; + var amount = taskItemArray[i].amount; + Ext4.Array.each(taskNodes, function (cNode) { + if (cNode.get('taskId') == taskId) { + var errors = cNode.get('errors'); + var damages = cNode.get("damages"); + if ((errors == null || errors.length == 0) && (damages == null || damages.length == 0)) { + if (amount < cNode.get('amount')) { + cNode.set('amount', cNode.get('amount') - amount); + } else { + var len = delNodes.length; + delNodes[len] = cNode; + } + } + } + }); + } + for (var j = 0; j < delNodes.length; j++) { + delNodes[j].remove() + } } - } - } - }); + } + }); + } } -} -// 校验材料是否有丢失和报损还未补充 -function validateSupplement(cNode){ - var tousseName = cNode.get("tousseName"); - var status = cNode.get("status"); - var basketBarcode = cNode.get("basketBarcode"); - var taskId = cNode.get("taskId"); - var tousseType = cNode.get("tousseType"); - var damages = cNode.get("damages"); - var errors = cNode.get("errors"); - - if(status == '待确认'){ - showResult(tousseName+",有器械丢失,请确认!" , null , sstsConfig.messagePauseTimeOnPackingPage); - return false; - } - if(!allowPackingWhenUnSupplementMaterial){ - var lost = false; - for(var i = 0;i < errors.length ; i++) { - if(errorTypeAdd != errors[i].errorType && ((errors[i].amount - errors[i].additionalAmount) != 0)) { - lost = true; - } - } - if(lost){ - showResult("材料缺失,不够组成器械包,请补充缺失器械!" , null , sstsConfig.messagePauseTimeOnPackingPage); - return false; - } - if(damages != null && damages.length > 0){ - showResult("材料已报损,不够组成器械包,请补充报损器械!" , null , sstsConfig.messagePauseTimeOnPackingPage); - return false; - } - } - return true; -} -formPanel = new Ext4.Panel({ - id : 'formPanel', - minHeight: 110, - region: 'center', -// margin: '0 0 ' + (document.body.clientHeight-((sstsConfig.showInspectorField || sstsConfig.showWrapperField || sstsConfig.showSterilizer) ? 470 : 440)) + ' 0', - border: true, - buttonAlign : 'center', - layout: "column", - items:[imagePanel,{ - xtype : 'hidden', - id : 'taskGroup', - name : 'taskGroup' - },{ - xtype : 'hidden', - id : 'inspectorCode', - name : 'inspectorCode', - value : inspectorCode - },{ - xtype : 'hidden', - id : 'operatorCode', - name : 'operatorCode', - value : operatorCode - },{ - xtype : 'hidden', - id : 'reviewerCode', - name : 'reviewerCode', - value : reviewerCode - },{ - xtype : 'hidden', - id : 'sterileCode', - name : 'sterileCode', - value : sterileUserCode - },{ - xtype : 'hidden', - id : 'wrapperCode', - name : 'wrapperCode', - value : wrapperCode - },{ - xtype : 'hidden', - id : 'idCardBarcode', - name : 'idCardBarcode' - },{ - xtype : 'hidden', - id : 'packedPhotographed', - name : 'packedPhotographed' - },{ - columnWidth : .5, - hidden : sstsConfig.disableIdCard, - xtype : 'textfield', - id : 'scanIdCardBarcode', - fieldLabel : "标识牌条码", - componentCls:'formItemMgn', - labelWidth:90, - anchor : '90%', - labelAlign:'right', - enableKeyEvents: true, - listeners : { - keypress: function(thiz, e, eOpts ){ - if(e.getKey() == 13){ - if(processActionBarcode(thiz)){ - return; - } - loadIdCardByBarcode(thiz.getValue(),true,true); - thiz.setValue(); + // 校验材料是否有丢失和报损还未补充 + function validateSupplement(cNode) { + var tousseName = cNode.get("tousseName"); + var status = cNode.get("status"); + var basketBarcode = cNode.get("basketBarcode"); + var taskId = cNode.get("taskId"); + var tousseType = cNode.get("tousseType"); + var damages = cNode.get("damages"); + var errors = cNode.get("errors"); + + if (status == '待确认') { + showResult(tousseName + ",有器械丢失,请确认!", null, sstsConfig.messagePauseTimeOnPackingPage); + return false; + } + if (!allowPackingWhenUnSupplementMaterial) { + var lost = false; + for (var i = 0; i < errors.length; i++) { + if (errorTypeAdd != errors[i].errorType && ((errors[i].amount - errors[i].additionalAmount) != 0)) { + lost = true; } } + if (lost) { + showResult("材料缺失,不够组成器械包,请补充缺失器械!", null, sstsConfig.messagePauseTimeOnPackingPage); + return false; + } + if (damages != null && damages.length > 0) { + showResult("材料已报损,不够组成器械包,请补充报损器械!", null, sstsConfig.messagePauseTimeOnPackingPage); + return false; + } } - },{ - columnWidth : .5, - hidden : sstsConfig.disableIdCard, - xtype : 'textfield', - fieldLabel : '标识牌', - componentCls:'formItemMgn', - maxLength : '50', - id : 'idCardName', - name : 'idCardName', - labelWidth:90, - anchor : '95%', - labelAlign:'right', - allowBlank : true, - readOnly : true - },{ - columnWidth : .5, - hidden : sstsConfig.disableIdCard, - xtype : 'textfield', - fieldLabel : '使用次数', - componentCls:'formItemMgn', - maxLength : '50', - id : 'idCardUseAmount', - name : 'idCardUseAmount', - labelWidth:90, - anchor : '95%', - labelAlign:'right', - allowBlank : true, - readOnly : true - },{ - columnWidth :.5, - xtype : 'textfield', - fieldLabel : inspectorName + '条码', - componentCls:'formItemMgn', - id : 'inspectorBarcode', - name : 'inspectorBarcode', - hidden : !sstsConfig.showInspectorField, - labelWidth:90, - anchor : '90%', - labelAlign:'right', - listeners : { - specialkey : function(thiz, e){ - if(e.getKey() == 13){ - if(processActionBarcode(thiz)){ - return; + return true; + } + formPanel = new Ext4.Panel({ + id: 'formPanel', + minHeight: 110, + region: 'center', + // margin: '0 0 ' + (document.body.clientHeight-((sstsConfig.showInspectorField || sstsConfig.showWrapperField || sstsConfig.showSterilizer) ? 470 : 440)) + ' 0', + border: true, + buttonAlign: 'center', + layout: "column", + items: [imagePanel, { + xtype: 'hidden', + id: 'taskGroup', + name: 'taskGroup' + }, { + xtype: 'hidden', + id: 'inspectorCode', + name: 'inspectorCode', + value: inspectorCode + }, { + xtype: 'hidden', + id: 'operatorCode', + name: 'operatorCode', + value: operatorCode + }, { + xtype: 'hidden', + id: 'reviewerCode', + name: 'reviewerCode', + value: reviewerCode + }, { + xtype: 'hidden', + id: 'sterileCode', + name: 'sterileCode', + value: sterileUserCode + }, { + xtype: 'hidden', + id: 'wrapperCode', + name: 'wrapperCode', + value: wrapperCode + }, { + xtype: 'hidden', + id: 'idCardBarcode', + name: 'idCardBarcode' + }, { + xtype: 'hidden', + id: 'packedPhotographed', + name: 'packedPhotographed' + }, { + columnWidth: .5, + hidden: sstsConfig.disableIdCard, + xtype: 'textfield', + id: 'scanIdCardBarcode', + fieldLabel: "标识牌条码", + componentCls: 'formItemMgn', + labelWidth: 90, + anchor: '90%', + labelAlign: 'right', + enableKeyEvents: true, + listeners: { + keypress: function (thiz, e, eOpts) { + if (e.getKey() == 13) { + if (processActionBarcode(thiz)) { + return; + } + loadIdCardByBarcode(thiz.getValue(), true, true); + thiz.setValue(); + } } - loadUserByBarcode(thiz,Ext4.getCmp('inspector'),Ext4.getCmp('inspectorCode'),Ext4.getCmp('operatorBarcode')); - inspectorCode = Ext4.getCmp('inspectorCode').getValue(); - jobType_inspector_name = Ext4.getCmp('inspector').getValue(); } - } - } - - },{ - columnWidth :.5, - xtype : 'textfield', - fieldLabel : inspectorName, - componentCls:'formItemMgn', - id : 'inspector', - name : 'inspector', - hidden : !sstsConfig.showInspectorField, - labelWidth:90, - anchor : '95%', - allowBlank : false, - readOnly : true, - labelAlign:'right', - value : jobType_inspector_name - },{ - columnWidth :.5, - xtype : 'textfield', - fieldLabel : '配包人条码', - componentCls:'formItemMgn', - id : 'operatorBarcode', - name : 'operatorBarcode', - labelWidth:90, - anchor : '90%', - labelAlign:'right', - listeners : { - specialkey : function(thiz, e){ - if(e.getKey() == 13){ - if(processActionBarcode(thiz)){ - return; + }, { + columnWidth: .5, + hidden: sstsConfig.disableIdCard, + xtype: 'textfield', + fieldLabel: '标识牌', + componentCls: 'formItemMgn', + maxLength: '50', + id: 'idCardName', + name: 'idCardName', + labelWidth: 90, + anchor: '95%', + labelAlign: 'right', + allowBlank: true, + readOnly: true + }, { + columnWidth: .5, + hidden: sstsConfig.disableIdCard, + xtype: 'textfield', + fieldLabel: '使用次数', + componentCls: 'formItemMgn', + maxLength: '50', + id: 'idCardUseAmount', + name: 'idCardUseAmount', + labelWidth: 90, + anchor: '95%', + labelAlign: 'right', + allowBlank: true, + readOnly: true + }, { + columnWidth: .5, + xtype: 'textfield', + fieldLabel: inspectorName + '条码', + componentCls: 'formItemMgn', + id: 'inspectorBarcode', + name: 'inspectorBarcode', + hidden: !sstsConfig.showInspectorField, + labelWidth: 90, + anchor: '90%', + labelAlign: 'right', + listeners: { + specialkey: function (thiz, e) { + if (e.getKey() == 13) { + if (processActionBarcode(thiz)) { + return; + } + loadUserByBarcode(thiz, Ext4.getCmp('inspector'), Ext4.getCmp('inspectorCode'), Ext4.getCmp('operatorBarcode')); + inspectorCode = Ext4.getCmp('inspectorCode').getValue(); + jobType_inspector_name = Ext4.getCmp('inspector').getValue(); + } } - var focusField = Ext4.getCmp('reviewerBarcode'); - if(sstsConfig.hideReviewerField){ - if(sstsConfig.showSterileField){ - focusField = Ext4.getCmp('sterileBarcode'); - }else{ - focusField = Ext4.getCmp('wrapperBarcode'); + } + + }, { + columnWidth: .5, + xtype: 'textfield', + fieldLabel: inspectorName, + componentCls: 'formItemMgn', + id: 'inspector', + name: 'inspector', + hidden: !sstsConfig.showInspectorField, + labelWidth: 90, + anchor: '95%', + allowBlank: false, + readOnly: true, + labelAlign: 'right', + value: jobType_inspector_name + }, { + columnWidth: .5, + xtype: 'textfield', + fieldLabel: '配包人条码', + componentCls: 'formItemMgn', + id: 'operatorBarcode', + name: 'operatorBarcode', + labelWidth: 90, + anchor: '90%', + labelAlign: 'right', + listeners: { + specialkey: function (thiz, e) { + if (e.getKey() == 13) { + if (processActionBarcode(thiz)) { + return; + } + var focusField = Ext4.getCmp('reviewerBarcode'); + if (sstsConfig.hideReviewerField) { + if (sstsConfig.showSterileField) { + focusField = Ext4.getCmp('sterileBarcode'); + } else { + focusField = Ext4.getCmp('wrapperBarcode'); + } + } + loadUserByBarcode(thiz, Ext4.getCmp('operator'), Ext4.getCmp('operatorCode'), focusField); + operatorCode = Ext4.getCmp('operatorCode').getValue(); + jobType_pack_name = Ext4.getCmp('operator').getValue(); } } - loadUserByBarcode(thiz,Ext4.getCmp('operator'),Ext4.getCmp('operatorCode'),focusField); - operatorCode = Ext4.getCmp('operatorCode').getValue(); - jobType_pack_name = Ext4.getCmp('operator').getValue(); } - } - } - - },{ - columnWidth :.5, - xtype : 'textfield', - fieldLabel : '配包人', - componentCls:'formItemMgn', - id : 'operator', - name : 'operator', - labelWidth:90, - anchor : '95%', - allowBlank : false, - readOnly : true, - labelAlign:'right', - value : jobType_pack_name - - },{ - columnWidth :.5, - xtype : 'textfield', - fieldLabel : ''+reviewViewText+'人条码', - componentCls:'formItemMgn', - id : 'reviewerBarcode', - name : 'reviewerBarcode', - hidden : sstsConfig.printLabelWhenReviewing || sstsConfig.hideReviewerField, - labelWidth:90, - anchor : '90%', - labelAlign:'right', - listeners : { - specialkey : function(thiz, e){ - if(e.getKey() == 13){ - if(processActionBarcode(thiz)){ - return; + + }, { + columnWidth: .5, + xtype: 'textfield', + fieldLabel: '配包人', + componentCls: 'formItemMgn', + id: 'operator', + name: 'operator', + labelWidth: 90, + anchor: '95%', + allowBlank: false, + readOnly: true, + labelAlign: 'right', + value: jobType_pack_name + + }, { + columnWidth: .5, + xtype: 'textfield', + fieldLabel: '' + reviewViewText + '人条码', + componentCls: 'formItemMgn', + id: 'reviewerBarcode', + name: 'reviewerBarcode', + hidden: sstsConfig.printLabelWhenReviewing || sstsConfig.hideReviewerField, + labelWidth: 90, + anchor: '90%', + labelAlign: 'right', + listeners: { + specialkey: function (thiz, e) { + if (e.getKey() == 13) { + if (processActionBarcode(thiz)) { + return; + } + var focusField = Ext4.getCmp('wrapperBarcode'); + if (sstsConfig.showSterileField) { + focusField = Ext4.getCmp('sterileBarcode'); + } + loadUserByBarcode(thiz, Ext4.getCmp('reviewer'), Ext4.getCmp('reviewerCode'), focusField); + reviewerCode = Ext4.getCmp('reviewerCode').getValue(); + jobType_review_name = Ext4.getCmp('reviewer').getValue(); + } } - var focusField = Ext4.getCmp('wrapperBarcode'); - if(sstsConfig.showSterileField){ - focusField = Ext4.getCmp('sterileBarcode'); + } + + }, { + columnWidth: .5, + xtype: 'textfield', + fieldLabel: '' + reviewViewText + '人', + componentCls: 'formItemMgn', + id: 'reviewer', + name: 'reviewer', + hidden: sstsConfig.printLabelWhenReviewing || sstsConfig.hideReviewerField, + labelAlign: 'right', + labelWidth: 90, + anchor: '95%', + allowBlank: false, + allowBlank: false, + readOnly: true, + value: jobType_review_name + }, { + columnWidth: .5, + xtype: 'textfield', + fieldLabel: '灭菌人条码', + componentCls: 'formItemMgn', + id: 'sterileBarcode', + name: 'sterileBarcode', + hidden: !sstsConfig.showSterileField, + labelWidth: 90, + anchor: '90%', + labelAlign: 'right', + listeners: { + specialkey: function (thiz, e) { + if (e.getKey() == 13) { + if (processActionBarcode(thiz)) { + return; + } + if (sstsConfig.showSterileField) { + var focusField = Ext4.getCmp('wrapperBarcode'); + } + + loadUserByBarcode(thiz, Ext4.getCmp('sterileUser'), Ext4.getCmp('sterileCode'), focusField); + sterileUserCode = Ext4.getCmp('sterileCode').getValue(); + jobType_sterile_name = Ext4.getCmp('sterileUser').getValue(); + } } - loadUserByBarcode(thiz,Ext4.getCmp('reviewer'),Ext4.getCmp('reviewerCode'),focusField); - reviewerCode = Ext4.getCmp('reviewerCode').getValue(); - jobType_review_name = Ext4.getCmp('reviewer').getValue(); } - } - } - - },{ - columnWidth :.5, - xtype : 'textfield', - fieldLabel : ''+reviewViewText+'人', - componentCls:'formItemMgn', - id : 'reviewer', - name : 'reviewer', - hidden : sstsConfig.printLabelWhenReviewing || sstsConfig.hideReviewerField, - labelAlign:'right', - labelWidth:90, - anchor : '95%', - allowBlank : false, - allowBlank : false, - readOnly : true, - value:jobType_review_name - },{ - columnWidth :.5, - xtype : 'textfield', - fieldLabel : '灭菌人条码', - componentCls:'formItemMgn', - id : 'sterileBarcode', - name : 'sterileBarcode', - hidden : !sstsConfig.showSterileField, - labelWidth:90, - anchor : '90%', - labelAlign:'right', - listeners : { - specialkey : function(thiz, e){ - if(e.getKey() == 13){ - if(processActionBarcode(thiz)){ - return; + }, { + columnWidth: .5, + xtype: 'textfield', + fieldLabel: '灭菌人', + componentCls: 'formItemMgn', + id: 'sterileUser', + name: 'sterileUser', + hidden: !sstsConfig.showSterileField, + labelAlign: 'right', + labelWidth: 90, + anchor: '95%', + allowBlank: false, + allowBlank: false, + readOnly: true, + value: jobType_sterile_name + }, { + columnWidth: .5, + xtype: 'textfield', + fieldLabel: '包装人条码', + componentCls: 'formItemMgn', + id: 'wrapperBarcode', + name: 'wrapperBarcode', + hidden: !sstsConfig.showWrapperField, + labelWidth: 90, + anchor: '90%', + labelAlign: 'right', + listeners: { + specialkey: function (thiz, e) { + if (e.getKey() == 13) { + if (processActionBarcode(thiz)) { + return; + } + loadUserByBarcode(thiz, Ext4.getCmp('wrapper'), Ext4.getCmp('wrapperCode'), null); + wrapperCode = Ext4.getCmp('wrapperCode').getValue(); + jobType_wrapper_name = Ext4.getCmp('wrapper').getValue();; + } } - if(sstsConfig.showSterileField){ - var focusField = Ext4.getCmp('wrapperBarcode'); + } + + }, { + columnWidth: .5, + xtype: 'textfield', + fieldLabel: '包装人', + componentCls: 'formItemMgn', + id: 'wrapper', + name: 'wrapper', + hidden: !sstsConfig.showWrapperField, + labelAlign: 'right', + labelWidth: 90, + anchor: '95%', + allowBlank: false, + allowBlank: false, + readOnly: true, + value: jobType_wrapper_name + + }, { + columnWidth: .5, + xtype: 'combo', + fieldLabel: '灭菌程序', + id: 'sterilingType', + name: 'sterilingType', + componentCls: 'formItemMgn', + hidden: sstsConfig.hideSterilingType, + minChars: 0, + labelWidth: 90, + labelAlign: 'right', + valueField: 'typeName', + displayField: 'typeNameAndPurpose', + labelAlign: 'right', + store: sterilizerTypeStore, + forceSelection: true, + lazyInit: true, + anchor: '90%', + editable: false, + triggerAction: 'all', + typeAhead: false, + allowBlank: false, + listeners: { + select: function (combo, rec) { + Ext4.getCmp('sterilingMode').setValue(rec[0].data["sterilizationMode"]); } - - loadUserByBarcode(thiz,Ext4.getCmp('sterileUser'),Ext4.getCmp('sterileCode'),focusField); - sterileUserCode = Ext4.getCmp('sterileCode').getValue(); - jobType_sterile_name = Ext4.getCmp('sterileUser').getValue(); } - } - } - },{ - columnWidth :.5, - xtype : 'textfield', - fieldLabel : '灭菌人', - componentCls:'formItemMgn', - id : 'sterileUser', - name : 'sterileUser', - hidden : !sstsConfig.showSterileField, - labelAlign:'right', - labelWidth:90, - anchor : '95%', - allowBlank : false, - allowBlank : false, - readOnly : true, - value:jobType_sterile_name - },{ - columnWidth :.5, - xtype : 'textfield', - fieldLabel : '包装人条码', - componentCls:'formItemMgn', - id : 'wrapperBarcode', - name : 'wrapperBarcode', - hidden : !sstsConfig.showWrapperField, - labelWidth:90, - anchor : '90%', - labelAlign:'right', - listeners : { - specialkey : function(thiz, e){ - if(e.getKey() == 13){ - if(processActionBarcode(thiz)){ - return; + }, { + columnWidth: .5, + xtype: 'textfield', + fieldLabel: '灭菌方式', + hidden: sstsConfig.hideSterilingType, + id: 'sterilingMode', + name: 'sterilingMode', + componentCls: 'formItemMgn', + readOnly: true, + labelWidth: 90, + labelAlign: 'right', + anchor: '90%' + }, { + columnWidth: .5, + xtype: 'combo', + fieldLabel: '包装类型', + id: 'packageType', + name: 'packageType', + componentCls: 'formItemMgn', + minChars: 0, + labelWidth: 90, + labelAlign: 'right', + valueField: 'typeName', + displayField: 'typeName', + labelAlign: 'right', + store: packageTypeStore, + forceSelection: true, + lazyInit: true, + anchor: '95%', + editable: false, + triggerAction: 'all', + typeAhead: false, + allowBlank: false, + listeners: { + select: function (combo, record, index) { + if (record && record[0]) { + var validDate = record[0].data["validDate"]; + if (validDate == null || validDate === '') { + alert(record[0].data["typeName"] + '未配置失效期'); + } else if (validDate == '0') { + alert(record[0].data["typeName"] + '无失效期'); + } else { + alert(record[0].data["typeName"] + '失效期为' + record[0].data["validDate"] + record[0].data["validDateUnit"]); + } + } } - loadUserByBarcode(thiz,Ext4.getCmp('wrapper'),Ext4.getCmp('wrapperCode'),null); - wrapperCode = Ext4.getCmp('wrapperCode').getValue(); - jobType_wrapper_name = Ext4.getCmp('wrapper').getValue();; } - } - } - - },{ - columnWidth :.5, - xtype : 'textfield', - fieldLabel : '包装人', - componentCls:'formItemMgn', - id : 'wrapper', - name : 'wrapper', - hidden : !sstsConfig.showWrapperField, - labelAlign:'right', - labelWidth:90, - anchor : '95%', - allowBlank : false, - allowBlank : false, - readOnly : true, - value:jobType_wrapper_name - - },{ - columnWidth :.5, - xtype : 'combo', - fieldLabel : '灭菌程序', - id : 'sterilingType', - name : 'sterilingType', - componentCls:'formItemMgn', - hidden : sstsConfig.hideSterilingType, - minChars : 0, - labelWidth:90, - labelAlign:'right', - valueField : 'typeName', - displayField : 'typeNameAndPurpose', - labelAlign:'right', - store : sterilizerTypeStore, - forceSelection : true, - lazyInit : true, - anchor : '90%', - editable:false, - triggerAction : 'all', - typeAhead : false, - allowBlank : false, - listeners : { - select : function(combo,rec){ - Ext4.getCmp('sterilingMode').setValue(rec[0].data["sterilizationMode"]); - } - } - },{ - columnWidth :.5, - xtype : 'textfield', - fieldLabel : '灭菌方式', - hidden : sstsConfig.hideSterilingType, - id : 'sterilingMode', - name : 'sterilingMode', - componentCls:'formItemMgn', - readOnly : true, - labelWidth:90, - labelAlign:'right', - anchor : '90%' - },{ - columnWidth :.5, - xtype : 'combo', - fieldLabel : '包装类型', - id : 'packageType', - name : 'packageType', - componentCls:'formItemMgn', - minChars : 0, - labelWidth:90, - labelAlign:'right', - valueField : 'typeName', - displayField : 'typeName', - labelAlign:'right', - store : packageTypeStore, - forceSelection : true, - lazyInit : true, - anchor : '95%', - editable:false, - triggerAction : 'all', - typeAhead : false, - allowBlank : false, - listeners : { - select : function(combo,record,index){ - if(record && record[0]){ - var validDate = record[0].data["validDate"]; - if(validDate == null || validDate === ''){ - alert(record[0].data["typeName"]+'未配置失效期'); - }else if(validDate == '0'){ - alert(record[0].data["typeName"]+'无失效期'); - }else{ - alert(record[0].data["typeName"]+'失效期为'+record[0].data["validDate"]+record[0].data["validDateUnit"]); + + }, { + columnWidth: .5, + xtype: 'combo', + fieldLabel: '灭菌炉', + id: 'sterilizer', + name: 'sterilizer', + hidden: !sstsConfig.showSterilizer, + componentCls: 'formItemMgn', + minChars: 0, + labelWidth: 90, + labelAlign: 'right', + valueField: 'sterilizerName', + displayField: 'sterilizerName', + labelAlign: 'right', + store: sterilizerJsonStore, + forceSelection: true, + lazyInit: true, + anchor: '90%', + editable: false, + triggerAction: 'all', + typeAhead: false, + allowBlank: !sstsConfig.sterilizerNotAllowBlank, + listWidth: 140, + listeners: { + select: function (combo, record, index) { + var sterilizerTypeObj = Ext4.getCmp("sterilingType").getValue(); + var reset = false; + SterilizationRecordTableManager.getSterilisationAndMaxFrequencyMap(combo.value, 0, function (map) { + var sterilizerTypeData = new Array(); + sterilizerTypeData.push(new Array("0", "无", "", "")); + var frequency = 1; + if (map) { + if (map.sterilisationList) { + reset = true; + for (var k = 0, len = map.sterilisationList.length; k < len; k++) { + var sterilisationAndpurposeStr = ''; + var purpose = map.sterilisationList[k].sterilizationPurpose; + if (purpose != null && purpose != '') { + sterilisationAndpurposeStr = map.sterilisationList[k].sterilisation + '(' + purpose + ')'; + } + sterilizerTypeData.push(new Array(map.sterilisationList[k].id, map.sterilisationList[k].sterilisation, sterilisationAndpurposeStr, map.sterilisationList[k].sterilizationMode)); + if (sterilizerTypeObj == map.sterilisationList[k].sterilisation) { + reset = false; + } + } + frequency = map.maxFrequency; + } + else { + sterilizerTypeStore.reload(); + frequency = ""; + } + } + sterilizerTypeStore.loadData(sterilizerTypeData); + Ext4.getCmp('frequency').setValue(frequency); + if (reset) { + Ext4.getCmp("sterilingType").setValue(""); + Ext4.getCmp("sterilingMode").setValue(""); + } + }); } } + + }, { + columnWidth: .5, + xtype: 'numberfield', + fieldLabel: '炉次', + allowDecimals: false, + allowNegative: false, + id: 'frequency', + name: 'frequency', + hidden: !sstsConfig.showSterilizer, + componentCls: 'formItemMgn', + minValue: 1, + labelWidth: 90, + labelAlign: 'right', + allowBlank: !sstsConfig.sterilizerNotAllowBlank, + anchor: '95%' + + }, { + columnWidth: .5, + xtype: 'datefield', + fieldLabel: '灭菌日期', + componentCls: 'formItemMgn', + labelWidth: 90, + labelAlign: 'right', + id: 'sterileDate', + name: 'sterileDate', + hidden: sstsConfig.printLabelWhenReviewing || sstsConfig.hideSterileDate, + emptyText: '默认为今天', + minValue: new Date(), + inputAttrTpl: " data-qtip='空白表示灭菌日期为今天' ", + editable: 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', + selectOnFocus: true, + format: 'Y-m-d', + allowBlank: true, + anchor: '90%' + }, { + columnWidth: .5, + xtype: 'combo', + hidden: !sstsConfig.showTousseWeight, + fieldLabel: '重量', + id: 'tousseWeight', + name: 'tousseWeight', + componentCls: 'formItemMgn', + minChars: 0, + labelWidth: 90, + labelAlign: 'right', + valueField: 'value', + displayField: 'value', + labelAlign: 'right', + store: tousseWeightStore, + forceSelection: true, + lazyInit: true, + anchor: '95%', + editable: false, + triggerAction: 'all', + typeAhead: false, + allowBlank: true + }, { + columnWidth: .5, + xtype: 'textfield', + fieldLabel: '备注', + componentCls: 'formItemMgn', + id: 'remark', + name: 'remark', + maxLength: '1000', + labelWidth: 90, + anchor: '95%', + allowBlank: true, + labelAlign: 'right' + }, { + xtype: 'hidden', + id: 'errorDamageRemarkId', + name: 'errorDamageRemarkId' + }, { + xtype: 'hidden', + id: 'errorDamageRemarkInfo', + name: 'errorDamageRemarkInfo' + }, { + columnWidth: .99, + xtype: 'textfield', + fieldLabel: '丢失材料', + componentCls: 'formItemMgn', + id: 'errorMaterialsTip', + name: 'errorMaterialsTip', + maxLength: '250', + labelWidth: 90, + anchor: '95%', + allowBlank: true, + readOnly: true, + hidden: !sstsConfig.enablePackingMaterialErrorDamageRemark, + cls: 'fieldReadOnlyNoRemove', + labelAlign: 'right' + }, { + columnWidth: .99, + xtype: 'textfield', + fieldLabel: '丢失备注', + componentCls: 'formItemMgn', + id: 'errorRemark', + name: 'errorRemark', + maxLength: '250', + labelWidth: 90, + anchor: '95%', + allowBlank: true, + readOnly: true, + hidden: !sstsConfig.enablePackingMaterialErrorDamageRemark, + cls: 'fieldReadOnlyNoRemove', + labelAlign: 'right' + }, { + columnWidth: .99, + xtype: 'textfield', + fieldLabel: '报损材料', + componentCls: 'formItemMgn', + id: 'damageMaterialsTip', + name: 'damageMaterialsTip', + maxLength: '250', + labelWidth: 90, + anchor: '95%', + allowBlank: true, + readOnly: true, + hidden: !sstsConfig.enablePackingMaterialErrorDamageRemark, + cls: 'fieldReadOnlyNoRemove', + labelAlign: 'right' + }, { + columnWidth: .99, + xtype: 'textfield', + fieldLabel: '报损备注', + componentCls: 'formItemMgn', + id: 'damageRemark', + name: 'damageRemark', + maxLength: '250', + labelWidth: 90, + anchor: '95%', + allowBlank: true, + readOnly: true, + hidden: !sstsConfig.enablePackingMaterialErrorDamageRemark, + cls: 'fieldReadOnlyNoRemove', + labelAlign: 'right' + }, { + columnWidth: .99, + xtype: 'textfield', + fieldLabel: '回收备注', + componentCls: 'formItemMgn', + id: 'recyclingItemRemark', + name: 'recyclingItemRemark', + maxLength: '250', + labelWidth: 90, + anchor: '95%', + allowBlank: true, + readOnly: true, + hidden: !sstsConfig.enableRecyclingItemRemark, + cls: 'fieldReadOnlyNoRemove', + labelAlign: 'right' + }, { + columnWidth: .99, + xtype: 'panel', + border: false, + layout: { + type: 'hbox', + padding: '5', + pack: 'center', + align: 'middle' + }, + items: [{ + xtype: 'button', + id: "save_print", + text: '' + packingBtnText + '', + handler: function () { + packingTousseBtnClick0(this, true); + } + }, + { + xtype: 'button', + id: "packingLableBtn", + margin: '0 0 0 10', + hidden: !sstsConfig.showPackingGoodsBtn, + text: '' + '装配物品' + '', + handler: function () { + packingTousseBtnClick0(this, false); + } + }, + { + xtype: 'button', + id: "lostBtn", + margin: '0 0 0 10', + hidden: true, + text: '' + '丢失' + '', + handler: function () { + onErrorDamageBtnClick2(type_lost); + } + }, + { + xtype: 'button', + id: "damageBtn", + margin: '0 0 0 10', + hidden: true, + text: '' + '报损' + '', + handler: function () { + onErrorDamageBtnClick2(type_damage); + } + }] } + ] + }); + function amendDisinfectionTousse(row) { + var tousseName = row.tousseName; + var tousseDefinitionID = row.td_id; + var currentPage = row.currentPage; + var materialId = row.materialId; + var imgName = row.type; + var iframeHeight = window.screen.height; + var url = WWWROOT + '/disinfectsystem/touchScreen/recycle/tousseImage.jsp?resolution=1980&clientHeight=' + iframeHeight + '&parentPageName=packingView&tousseDefinitionID=' + tousseDefinitionID + '&materialId=' + materialId + '&tousseName=' + encodeURIComponent(tousseName) + '&imgName=' + encodeURIComponent(imgName) + '&number=' + currentPage; + openFullSizeWindowWithName(url, false, imgName); + } + function loadGoodsImage(tousseName, type, materialId, currentPage, vedioName, td_id, packedPhotographed) { + var url; + if (type == '器械包装配教学图片') { + url = WWWROOT + '/disinfectSystem/packingAction!getImage.do?id=' + td_id + '&page=' + currentPage + '&imageType=' + encodeURIComponent(type) + '&originalImg=true'; + } else { + url = WWWROOT + "/disinfectSystem/baseData/showImageAction!getToussePic.do?imageType=" + encodeURIComponent(type) + '&materialId=' + materialId + '&tousseId=' + td_id + '&page=' + currentPage + '&name=' + encodeURIComponent(tousseName); } - - },{ - columnWidth :.5, - xtype : 'combo', - fieldLabel : '灭菌炉', - id : 'sterilizer', - name : 'sterilizer', - hidden : !sstsConfig.showSterilizer, - componentCls:'formItemMgn', - minChars : 0, - labelWidth:90, - labelAlign:'right', - valueField : 'sterilizerName', - displayField : 'sterilizerName', - labelAlign:'right', - store : sterilizerJsonStore, - forceSelection : true, - lazyInit : true, - anchor : '90%', - editable:false, - triggerAction : 'all', - typeAhead : false, - allowBlank : !sstsConfig.sterilizerNotAllowBlank, - listWidth:140, - listeners : { - select : function(combo, record, index) { - var sterilizerTypeObj = Ext4.getCmp("sterilingType").getValue(); - var reset = false; - SterilizationRecordTableManager.getSterilisationAndMaxFrequencyMap(combo.value,0,function(map){ - var sterilizerTypeData = new Array(); - sterilizerTypeData.push(new Array("0","无","","")); - var frequency = 1; - if(map){ - if(map.sterilisationList){ - reset = true; - for(var k=0,len=map.sterilisationList.length;k