Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/instrumentRepairReportView.jsp =================================================================== diff -u -r35547 -r41573 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/instrumentRepairReportView.jsp (.../instrumentRepairReportView.jsp) (revision 35547) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/instrumentRepairReportView.jsp (.../instrumentRepairReportView.jsp) (revision 41573) @@ -13,6 +13,8 @@ <%@ include file="/common/includeExtJsAndCss.jsp"%> + + Index: ssts-web/src/main/webapp/disinfectsystem/instrumentRepairManagement/instrumentRepairManagementForm2.js =================================================================== diff -u -r41158 -r41573 --- ssts-web/src/main/webapp/disinfectsystem/instrumentRepairManagement/instrumentRepairManagementForm2.js (.../instrumentRepairManagementForm2.js) (revision 41158) +++ ssts-web/src/main/webapp/disinfectsystem/instrumentRepairManagement/instrumentRepairManagementForm2.js (.../instrumentRepairManagementForm2.js) (revision 41573) @@ -153,41 +153,6 @@ return userStore; } -//获取材料的store -function getMaterialDefinition(index) { - var materialDefinitionStore = new top.Ext4.data.Store({ - proxy: { - type: 'ajax', - url: WWWROOT + '/disinfectSystem/baseData/materialDefinitionAction!getMaterialDefinitionDataIncludeForeignMD.do?selectType=material', - reader: { - root: 'data', - totalProperty: 'totalCount' - } - }, - fields: [ - { name: 'id', mapping: 'id' }, - { name: 'spelling', mapping: 'spelling' }, - { name: 'name', mapping: 'name' }, - { name: 'count', mapping: 'count' } - ], - listeners: { - beforeload: function (thiz, options) { - if (index !== undefined && index !== 'undefined') { - if (top.Ext4.getCmp('tousseDefinitionID_' + index) && top.Ext4.getCmp('tousseDefinitionID_' + index).getValue()) { - materialDefinitionStore.proxy.extraParams.tousseDefinitionId = top.Ext4.getCmp('tousseDefinitionID_' + index).getValue(); - } - } else { - if (top.Ext4.getCmp('tousseDefinitionID') && top.Ext4.getCmp('tousseDefinitionID').getValue()) { - materialDefinitionStore.proxy.extraParams.tousseDefinitionId = top.Ext4.getCmp('tousseDefinitionID').getValue(); - } - } - } - } - }); - materialDefinitionStore.reload(); - return materialDefinitionStore; -} - function getTime(time) { if ((time || '') !== '') { var t = time.split(':')[0] + ':' + time.split(':')[1]; Index: ssts-web/src/main/webapp/disinfectsystem/instrumentRepairManagement/instrumentRepairManagementView.js =================================================================== diff -u -r35991 -r41573 --- ssts-web/src/main/webapp/disinfectsystem/instrumentRepairManagement/instrumentRepairManagementView.js (.../instrumentRepairManagementView.js) (revision 35991) +++ ssts-web/src/main/webapp/disinfectsystem/instrumentRepairManagement/instrumentRepairManagementView.js (.../instrumentRepairManagementView.js) (revision 41573) @@ -1,5 +1,13 @@ var listStore; var instrumentRepairGrid; +var roomNumberNmae = '房间号'; +var washHandNurseName = '发现者'; +var repairNurseName = '送修者'; +if(sstsConfig.InstrumentRepairManagementVersion == 3){ + roomNumberNmae = '术间号'; + washHandNurseName = '发现人'; + repairNurseName = '送修人'; +} //过滤 function search(listStore) { @@ -146,13 +154,13 @@ if (hiddenFieldsForInstrumentRepairRecords.length > 0) { for (var i = 0; i < hiddenFieldsForInstrumentRepairRecords.length; i++) { var item = hiddenFieldsForInstrumentRepairRecords[i]; - if (item == '房间号') { + if (item == roomNumberNmae) { roomNumberIsHidden = true; } - if (item == '发现者') { + if (item == washHandNurseName) { washHandNurseNameIsHidden = true; } - if (item == '送修者') { + if (item == repairNurseName) { repairNurseNameIsHidden = true; } if (item == '工程师') { @@ -193,9 +201,9 @@ { header: "登记时间", dataIndex: 'registerDateTime', width: 140 }, { header: "状态", dataIndex: 'repairStatus', sortable: false, width: 80, renderer: rendererRepairStatus }, { header: "器械名称", dataIndex: 'materialNameAndAmount', sortable: false, renderer: renderCallModifyFunction }, - { header: "房间号", dataIndex: 'roomNumber', sortable: false, hidden: roomNumberIsHidden }, - { header: "发现者", dataIndex: 'washHandNurseName', sortable: false, hidden: washHandNurseNameIsHidden }, - { header: "送修者", dataIndex: 'repairNurseName', sortable: false, hidden: repairNurseNameIsHidden }, + { header: roomNumberNmae, dataIndex: 'roomNumber', sortable: false, hidden: roomNumberIsHidden }, + { header: washHandNurseName, dataIndex: 'washHandNurseName', sortable: false, hidden: washHandNurseNameIsHidden }, + { header: repairNurseName, dataIndex: 'repairNurseName', sortable: false, hidden: repairNurseNameIsHidden }, { header: "工程师(现场)", dataIndex: 'engineer', sortable: false, hidden: engineerIsHidden }, { header: "送修类别", dataIndex: 'repairType', sortable: false, hidden: repairTypeIsHidden }, { header: "维修时间", dataIndex: 'repairDateTime', sortable: false, width: 140, hidden: repairDateTimeIsHidden }, @@ -303,17 +311,17 @@ xtype: 'menucheckitem', name: 'roomNumber', checked: true, - text: '房间号' + text: roomNumberNmae }, { xtype: 'menucheckitem', name: 'washHandNurseName', checked: true, - text: '洗手护士' + text: washHandNurseName }, { xtype: 'menucheckitem', name: 'repairNurseName', checked: true, - text: '送修者' + text: repairNurseName }, { xtype: 'menucheckitem', name: 'engineer', Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/instrumentRepairReportView.js =================================================================== diff -u -r36228 -r41573 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/instrumentRepairReportView.js (.../instrumentRepairReportView.js) (revision 36228) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/instrumentRepairReportView.js (.../instrumentRepairReportView.js) (revision 41573) @@ -1,8 +1,173 @@ var entityName = "器械维修记录报表"; var myMask; +function getMonthsBetween(start, end) { + // 1. 将输入字符串转换为Date对象,并确保设置为月份的第一天 + var startDate = new Date(start); // 添加 '-01' 以确保是月份的第一天 + var endDate = new Date(end); + + // 检查日期有效性 + if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) { + showResult('时间不能为空'); + return + } + + var monthsArray = []; + var currentDate = new Date(startDate); // 避免修改原startDate对象 + + // 3. 循环遍历每个月,直到当前日期超过结束日期 + while (currentDate <= endDate) { + const year = currentDate.getFullYear(); + // 月份从0开始,需要+1并补零 + const month = (currentDate.getMonth() + 1).toString().padStart(2, '0'); + monthsArray.push(`${year}-${month}`); + + // 将日期设置为下个月的第1天 + currentDate.setMonth(currentDate.getMonth() + 1); + } + + return monthsArray; +} + +//BJDXZLYY-85:获取器械类型,故障部位,发现环节 +function getHttpOptionStore(optionListId) { + var store = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/core/httpOptionController/getHttpOptionList.mhtml?optionListId=' + optionListId + }), + reader: new Ext.data.JsonReader({ + root: 'data' + }, [{ + name: 'id' + }, { + name: 'value' + }]), + listeners: { + load: function (store, options) { + var records = Ext.data.Record.create([ + { name: "id", type: "string" }, + { name: "value", type: "string" } + ]); + var record = new records({ + id: '-1', + value: '全部', + checked: true + }); + store.insert(0, record); + } + } + }); + store.load(); + return store; +} + +//BJDXZLYY-85:显示柱形图 +function searchReportForChart(dom, parametMap) { + var seriesData = []; + var legendData = []; + var title = parametMap.title; + var colors = ['#29AAE3', '#C33531']; + var startTime = Ext.getCmp('startTime').getRawValue(); + var endTime = Ext.getCmp('endTime').getRawValue(); + var xAxisData = getMonthsBetween(startTime, endTime); + if (parametMap.deviceTypeMap) { + for (var month in parametMap.deviceTypeMap) { + for (var item in parametMap.deviceTypeMap[month]) { + var data = []; + for (var i = 0; i < xAxisData.length; i++) { + if (xAxisData[i] == month) { + data.push(parametMap.deviceTypeMap[month][item]) + } else { + data.push(0) + } + } + legendData.push(item) + seriesData.push({ + name: item, + type: 'bar', + data: data, + itemStyle: { + normal: { + color: function (p) { + return colors[0]; + } + } + } + }); + } + } + } + if (parametMap.faultLocationMap) { + for (var month in parametMap.faultLocationMap) { + for (var item in parametMap.faultLocationMap[month]) { + var data = []; + for (var i = 0; i < xAxisData.length; i++) { + if (xAxisData[i] == month) { + data.push(parametMap.faultLocationMap[month][item]) + } else { + data.push(0) + } + } + legendData.push(item) + seriesData.push({ + name: item, + type: 'bar', + data: data, + itemStyle: { + normal: { + color: function (p) { + return colors[1]; + } + } + } + }); + } + } + } + var option = { + title: [ + { + left: 'center', + text: title + } + ], + // 工具提示 + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + crossStyle: { + color: '#999' + } + } + }, + legend: { + data: legendData, + bottom: '0%' + }, + xAxis: [ + { + type: 'category', + data: xAxisData, + axisPointer: { + type: 'shadow' + } + } + ], + yAxis: [ + { + type: 'value' + } + ], + series: seriesData + }; + var myechart = echarts.init(document.getElementById('thisIframe2').contentWindow.document.getElementById(dom)); + myechart.clear(); + myechart.setOption(option); +} + function getDate(dateType) { - var newToday = today.replace(/-/g,"/"); + var newToday = today.replace(/-/g, "/"); var newDate = new Date(newToday) if (dateType == 1) { //昨天的时间 newDate.setTime(newDate.getTime() - 24 * 60 * 60 * 1000); @@ -35,11 +200,11 @@ return } - if(repairStatus !== '' && repairStatus.indexOf('全部') >= 0){ + if (repairStatus !== '' && repairStatus.indexOf('全部') >= 0) { repairStatus = ''; } - if(reviewStatus == '全部'){ + if (reviewStatus == '全部') { reviewStatus = ''; } @@ -54,13 +219,65 @@ startTime: startTime, endTime: endTime, repairStatus: repairStatus, - reviewStatus:reviewStatus, + reviewStatus: reviewStatus, registrantName: registrantName, materialName: materialName, tousseName: tousseName, jasperreportName: 'instrumentRepairReport.jasper', reportName: 'instrumentRepairReport' } + + if (sstsConfig.InstrumentRepairManagementVersion == 3) { + var instrumentBarcode = Ext.getCmp('instrumentBarcode').getValue(); + var idCardInstanceBarcode = Ext.getCmp('idCardInstanceBarcode').getValue(); + var deviceTypeHttpOptionId = Ext.getCmp('deviceTypeHttpOptionId').getValue(); + var faultLocationHttpOptionId = Ext.getCmp('faultLocationHttpOptionId').getValue(); + var showType = Ext.getCmp('showType').getRawValue(); + if (deviceTypeHttpOptionId.indexOf('-1') >= 0) { + deviceTypeHttpOptionId = ''; + } + if (faultLocationHttpOptionId.indexOf('-1') >= 0) { + faultLocationHttpOptionId = ''; + } + params.instrumentBarcode = instrumentBarcode; + params.idCardInstanceBarcode = idCardInstanceBarcode; + params.deviceTypeHttpOptionId = deviceTypeHttpOptionId; + params.faultLocationHttpOptionId = faultLocationHttpOptionId; + params.jasperreportName = 'instrumentRepairReportVersion3.jasper'; + if (showType == '表格') { + params.reportName = 'instrumentRepairReport'; + } else { + var sym = startTime.split('-')[0] + '-' + startTime.split('-')[1]; + var eym = endTime.split('-')[0] + '-' + endTime.split('-')[1]; + params.startTime = sym; + params.endTime = eym; + document.getElementById('thisIframe').style.display = 'none'; + document.getElementById('thisIframe2').style.display = 'block'; + params.reportName = 'instrumentRepairBarChartReport'; + Ext.Ajax.request({ + url: WWWROOT + "/jasperreports/jasperreportsAction!queryDataSourceList.do", + async: false, + params: params, + timeout: 300000, + success: function (response) { + var result = Ext.decode(response.responseText); + if (result.parametMap) { + searchReportForChart('echarts', result.parametMap); + document.getElementById('thisIframe2').contentWindow.document.getElementById('table').style.display = 'none'; + document.getElementById('thisIframe2').contentWindow.document.getElementById('echarts').style.display = 'block'; + } + myMask.hide(); + }, + failure: function (response, options) { + showResult(response.responseText); + myMask.hide(); + } + }); + return + } + } + document.getElementById('thisIframe').style.display = 'block'; + document.getElementById('thisIframe2').style.display = 'none'; searchReport(url, params); } @@ -134,11 +351,11 @@ border: 0, frame: true, bodyStyle: 'padding:0px auto;margin:0px', - height: 140, + height: (sstsConfig.InstrumentRepairManagementVersion == 3) ? 160 : 140, labelWidth: 100, items: [{ layout: 'column', - height: 60, + height: (sstsConfig.InstrumentRepairManagementVersion == 3) ? 80 : 60, items: [{ columnWidth: .25, layout: 'form', @@ -251,7 +468,20 @@ layout: 'form', labelWidth: 100, labelAlign: 'right', + hidden: sstsConfig.InstrumentRepairManagementVersion !== 3, items: [{ + xtype: 'textfield', + fieldLabel: '器械条码', + id: 'instrumentBarcode', + name: 'instrumentBarcode', + anchor: '95%' + }] + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 100, + labelAlign: 'right', + items: [{ xtype: 'combo', id: 'materialName', name: 'materialName', @@ -317,6 +547,151 @@ typeAhead: false, allowBlank: true }] + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 100, + labelAlign: 'right', + hidden: sstsConfig.InstrumentRepairManagementVersion !== 3, + items: [{ + xtype: 'textfield', + fieldLabel: '标识牌条码', + id: 'idCardInstanceBarcode', + name: 'idCardInstanceBarcode', + anchor: '95%' + }] + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 100, + labelAlign: 'right', + hidden: sstsConfig.InstrumentRepairManagementVersion !== 3, + items: [{ + xtype: 'multiSelect', + fieldLabel: '器械类型', + id: 'deviceTypeHttpOptionId', + name: 'deviceTypeHttpOptionId', + minChars: 0, + valueField: 'id', + displayField: 'value', + store: getHttpOptionStore('deviceType'), + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: true, + allowBlank: true, + editable: false, + anchor: '95%', + separator: ';', + listeners: { + select: function (combo, record, index) { + //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择 + if (record.get('value') == '全部') { + if (record.get('checked')) { + combo.selectAll(); + } else { + combo.deselectAll(); + } + } + + //2、如果已经选中所有的项,则把“全部”项选中,反之把“全部”项取消选择 + var selectAll = true; + combo.store.each(function (record) { + if (record.get('value') != '全部' && !record.get(this.checkField)) { + selectAll = false; + return; + } + }, combo); + + var all = combo.store.getAt(0); + if (selectAll) { + all.set(combo.checkField, true); + } else { + all.set(combo.checkField, false); + } + + combo.setValue(combo.getCheckedValue()); + }, + render: function (thiz) { + thiz.selectAll(); + thiz.setRawValue('全部'); + } + } + }] + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 100, + labelAlign: 'right', + hidden: sstsConfig.InstrumentRepairManagementVersion !== 3, + items: [{ + xtype: 'multiSelect', + fieldLabel: '故障部位', + id: 'faultLocationHttpOptionId', + name: 'faultLocationHttpOptionId', + minChars: 0, + valueField: 'id', + displayField: 'value', + store: getHttpOptionStore('faultLocation'), + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: true, + allowBlank: true, + editable: false, + anchor: '95%', + separator: ';', + listeners: { + select: function (combo, record, index) { + //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择 + if (record.get('value') == '全部') { + if (record.get('checked')) { + combo.selectAll(); + } else { + combo.deselectAll(); + } + } + + //2、如果已经选中所有的项,则把“全部”项选中,反之把“全部”项取消选择 + var selectAll = true; + combo.store.each(function (record) { + if (record.get('value') != '全部' && !record.get(this.checkField)) { + selectAll = false; + return; + } + }, combo); + + var all = combo.store.getAt(0); + if (selectAll) { + all.set(combo.checkField, true); + } else { + all.set(combo.checkField, false); + } + + combo.setValue(combo.getCheckedValue()); + }, + render: function (thiz) { + thiz.selectAll(); + thiz.setRawValue('全部'); + } + } + }] + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 100, + labelAlign: 'right', + hidden: sstsConfig.InstrumentRepairManagementVersion !== 3, + height: 27, + items: [new Ext.ux.RadioGroup({ + fieldLabel: "显示类型", + horizontal: true, + defaultValue: '表格', + name: "showType", + id: "showType", + anchor: '95%', + radios: [{ boxLabel: '表格', value: '表格' }, { boxLabel: '簇状柱形图', value: '簇状柱形图' }] + })] }] }], buttons: [{ @@ -338,6 +713,12 @@ Ext.getCmp('registrantName').setValue(''); Ext.getCmp('materialName').setValue(''); Ext.getCmp('tousseName').setValue(''); + if (sstsConfig.InstrumentRepairManagementVersion == 3) { + Ext.getCmp('instrumentBarcode').setValue(''); + Ext.getCmp('idCardInstanceBarcode').setValue(''); + Ext.getCmp('deviceTypeHttpOptionId').setValue(''); + Ext.getCmp('faultLocationHttpOptionId').setValue(''); + } } }] }); @@ -347,7 +728,7 @@ autoScroll: true,//自动显示滚动条 collapsible: true,//允许展开和收缩 bodyPadding: 5, - html: '' + html: '' }); var viewport = new Ext.Viewport({ Index: ssts-web/src/main/webapp/disinfectsystem/instrumentRepairManagement/instrumentRepairManagementForm.js =================================================================== diff -u -r41149 -r41573 --- ssts-web/src/main/webapp/disinfectsystem/instrumentRepairManagement/instrumentRepairManagementForm.js (.../instrumentRepairManagementForm.js) (revision 41149) +++ ssts-web/src/main/webapp/disinfectsystem/instrumentRepairManagement/instrumentRepairManagementForm.js (.../instrumentRepairManagementForm.js) (revision 41573) @@ -97,12 +97,12 @@ if (index == undefined) { top.Ext4.getCmp('materialDefinitionID').setValue(materialDefinitionId); top.Ext4.getCmp('materialDefinitionName').setRawValue(materialDefinitionName + '(' + instrumentBarcode + ')'); - top.Ext4.getCmp('hiddenMaterialDefinitionName').setValue(materialDefinitionName); + top.Ext4.getCmp('hiddenMaterialDefinitionName').setValue(materialDefinitionName + '(' + instrumentBarcode + ')'); top.Ext4.getCmp('instrumentBarcode').setValue(instrumentBarcode); } else { top.Ext4.getCmp('materialDefinitionID_' + index).setValue(materialDefinitionId); top.Ext4.getCmp('materialDefinitionName_' + index).setRawValue(materialDefinitionName + '(' + instrumentBarcode + ')'); - top.Ext4.getCmp('hiddenMaterialDefinitionName_' + index).setValue(materialDefinitionName); + top.Ext4.getCmp('hiddenMaterialDefinitionName_' + index).setValue(materialDefinitionName + '(' + instrumentBarcode + ')'); top.Ext4.getCmp('instrumentBarcode_' + index).setValue(instrumentBarcode); } } else { @@ -180,6 +180,12 @@ instrumentSerialNumber: instrumentSerialNumber }] + if (sstsConfig.InstrumentRepairManagementVersion == 3) { + tousseMaterialInfo[0].deviceTypeHttpOptionId = top.Ext4.getCmp('deviceTypeHttpOptionId').getValue() || null; + tousseMaterialInfo[0].faultLocationHttpOptionId = top.Ext4.getCmp('faultLocationHttpOptionId').getValue() || null; + tousseMaterialInfo[0].manufacturer = top.Ext4.getCmp('manufacturer').getValue(); + } + if (tousseArray.length > 0) { var msg = ''; for (var i = 0; i < tousseArray.length; i++) { @@ -202,7 +208,7 @@ } } var amount = top.Ext4.getCmp('amount_' + j).getValue(); - tousseMaterialInfo.push({ + var itemParams = { amount: amount, materialDefinitionID: materialDefinitionID, tousseDefinitionID: tousseDefinitionID, @@ -211,7 +217,13 @@ idCardInstanceBarcode: idCardInstanceBarcode, instrumentBarcode: instrumentBarcode, instrumentSerialNumber: instrumentSerialNumber - }) + } + if (sstsConfig.InstrumentRepairManagementVersion == 3) { + itemParams.deviceTypeHttpOptionId = top.Ext4.getCmp('deviceTypeHttpOptionId_' + j).getValue() || null; + itemParams.faultLocationHttpOptionId = top.Ext4.getCmp('faultLocationHttpOptionId_' + j).getValue() || null; + itemParams.manufacturer = top.Ext4.getCmp('manufacturer_' + j).getValue(); + } + tousseMaterialInfo.push(itemParams) } if (msg !== '') { showResult(msg) @@ -242,6 +254,9 @@ discardDateTime: discardDateTime, remark: remark } + if (sstsConfig.InstrumentRepairManagementVersion == 3) { + params.discoveryPhaseOptionId = top.Ext4.getCmp('discoveryPhaseOptionId').getValue() || null; + } top.Ext4.Ajax.request({ url: WWWROOT + '/disinfectSystem/baseData/instrumentRepairAction!saveInstrumentRepair.do', params: params, @@ -291,9 +306,11 @@ } }, fields: [ - { name: 'id', mapping: 'id' }, + { name: 'materialDefintionId', mapping: 'materialDefintionId' }, { name: 'spelling', mapping: 'spelling' }, { name: 'name', mapping: 'name' }, + { name: 'nameAndBarcode', mapping: 'nameAndBarcode' }, + { name: 'instrumentBarcode', mapping: 'instrumentBarcode' }, { name: 'count', mapping: 'count' } ], listeners: { @@ -307,13 +324,47 @@ materialDefinitionStore.proxy.extraParams.tousseDefinitionId = top.Ext4.getCmp('tousseDefinitionID').getValue(); } } + materialDefinitionStore.proxy.extraParams.queryInstrumentBarcode = true; + }, + load: function (store, records) { + if (records.length > 0) { + for (var i = 0; i < records.length; i++) { + var item = records[i]; + if (item.get('nameAndBarcode') == '') { + item.set('nameAndBarcode', item.get('name')) + } + } + } } } }); - materialDefinitionStore.reload(); return materialDefinitionStore; } +//BJDXZLYY-85:获取器械类型,故障部位,发现环节 +function getHttpOptionStore(optionListId) { + var store = new top.Ext4.data.Store({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/core/httpOptionController/getHttpOptionList.mhtml?optionListId=' + optionListId, + reader: { + root: 'data' + } + }, + fields: [ + { name: 'id', mapping: 'id' }, + { name: 'value', mapping: 'value' } + ], + listeners: { + load: function (store, options) { + var data = { 'value': '  ', 'id': null }; + store.insert(0, data); + } + } + }); + return store; +} + function getTime(time) { if ((time || '') !== '') { var t = time.split(':')[0] + ':' + time.split(':')[1]; @@ -337,28 +388,66 @@ for (var i = 0; i < item.instrumentRepairGoodsList.length; i++) { var list = item.instrumentRepairGoodsList[i]; if (i == 0) { - top.Ext4.getCmp('materialDefinitionName').setValue(list.materialDefinitionName + '(' + list.instrumentBarcode + ')'); + if (list.instrumentBarcode && list.instrumentBarcode !== '') { + var nameAndBarcode = list.materialDefinitionName + '(' + list.instrumentBarcode + ')'; + top.Ext4.getCmp('materialDefinitionName').setValue(nameAndBarcode); + top.Ext4.getCmp('hiddenMaterialDefinitionName').setValue(nameAndBarcode); + } else { + top.Ext4.getCmp('materialDefinitionName').setValue(list.materialDefinitionName); + top.Ext4.getCmp('hiddenMaterialDefinitionName').setValue(list.materialDefinitionName); + } + if (list.idCardInstanceBarcode && list.idCardInstanceBarcode !== '') { + var nameAndBarcode = list.tousseDefinitionName + '(' + list.idCardInstanceBarcode + ')'; + top.Ext4.getCmp('tousseDefinitionName').setRawValue(nameAndBarcode); + top.Ext4.getCmp('hiddenTousseDefinitionName').setValue(nameAndBarcode); + } else { + top.Ext4.getCmp('tousseDefinitionName').setRawValue(list.tousseDefinitionName); + top.Ext4.getCmp('hiddenTousseDefinitionName').setValue(list.tousseDefinitionName); + } top.Ext4.getCmp('materialDefinitionID').setValue(list.materialDefinitionID); - top.Ext4.getCmp('tousseDefinitionName').setRawValue(list.tousseDefinitionName + '(' + list.idCardInstanceBarcode + ')'); top.Ext4.getCmp('tousseDefinitionID').setValue(list.tousseDefinitionID); top.Ext4.getCmp('idCardInstanceBarcode').setValue(list.idCardInstanceBarcode); top.Ext4.getCmp('instrumentBarcode').setValue(list.instrumentBarcode); - top.Ext4.getCmp('hiddenTousseDefinitionName').setValue(list.tousseDefinitionName); - top.Ext4.getCmp('hiddenMaterialDefinitionName').setValue(list.materialDefinitionName); top.Ext4.getCmp('instrumentSerialNumber').setValue(list.instrumentSerialNumber); top.Ext4.getCmp('amount').setValue(list.amount); + if (sstsConfig.InstrumentRepairManagementVersion == 3) { + top.Ext4.getCmp('deviceType').setValue(list.deviceType); + top.Ext4.getCmp('deviceTypeHttpOptionId').setValue(list.deviceTypeHttpOptionId); + top.Ext4.getCmp('faultLocation').setValue(list.faultLocation); + top.Ext4.getCmp('faultLocationHttpOptionId').setValue(list.faultLocationHttpOptionId); + top.Ext4.getCmp('manufacturer').setValue(list.manufacturer); + } } else { addTousseItems(i); - top.Ext4.getCmp('materialDefinitionName_' + i).setValue(list.materialDefinitionName + '(' + list.instrumentBarcode + ')'); + if (list.instrumentBarcode && list.instrumentBarcode !== '') { + var nameAndBarcode = list.materialDefinitionName + '(' + list.instrumentBarcode + ')'; + top.Ext4.getCmp('materialDefinitionName_' + i).setValue(nameAndBarcode); + top.Ext4.getCmp('hiddenMaterialDefinitionName_' + i).setValue(nameAndBarcode); + } else { + top.Ext4.getCmp('materialDefinitionName_' + i).setValue(list.materialDefinitionName); + top.Ext4.getCmp('hiddenMaterialDefinitionName_' + i).setValue(list.materialDefinitionName); + } + if (list.idCardInstanceBarcode && list.idCardInstanceBarcode !== '') { + var nameAndBarcode = list.tousseDefinitionName + '(' + list.idCardInstanceBarcode + ')'; + top.Ext4.getCmp('tousseDefinitionName_' + i).setRawValue(nameAndBarcode); + top.Ext4.getCmp('hiddenTousseDefinitionName_' + i).setValue(nameAndBarcode); + } else { + top.Ext4.getCmp('tousseDefinitionName_' + i).setRawValue(list.tousseDefinitionName); + top.Ext4.getCmp('hiddenTousseDefinitionName_' + i).setValue(list.tousseDefinitionName); + } top.Ext4.getCmp('materialDefinitionID_' + i).setValue(list.materialDefinitionID); - top.Ext4.getCmp('tousseDefinitionName_' + i).setRawValue(list.tousseDefinitionName + '(' + list.idCardInstanceBarcode + ')'); top.Ext4.getCmp('tousseDefinitionID_' + i).setValue(list.tousseDefinitionID); top.Ext4.getCmp('idCardInstanceBarcode_' + i).setValue(list.idCardInstanceBarcode); top.Ext4.getCmp('instrumentBarcode_' + i).setValue(list.instrumentBarcode); - top.Ext4.getCmp('hiddenTousseDefinitionName_' + i).setValue(list.tousseDefinitionName); - top.Ext4.getCmp('hiddenMaterialDefinitionName_' + i).setValue(list.materialDefinitionName); top.Ext4.getCmp('instrumentSerialNumber_' + i).setValue(list.instrumentSerialNumber); top.Ext4.getCmp('amount_' + i).setValue(list.amount); + if (sstsConfig.InstrumentRepairManagementVersion == 3) { + top.Ext4.getCmp('deviceType_' + i).setValue(list.deviceType); + top.Ext4.getCmp('deviceTypeHttpOptionId_' + i).setValue(list.deviceTypeHttpOptionId); + top.Ext4.getCmp('faultLocation_' + i).setValue(list.faultLocation); + top.Ext4.getCmp('faultLocationHttpOptionId_' + i).setValue(list.faultLocationHttpOptionId); + top.Ext4.getCmp('manufacturer_' + i).setValue(list.manufacturer); + } tousseArray.push(i); } } @@ -393,6 +482,10 @@ top.Ext4.getCmp('returnHandoverDateTime').setValue(getTime(item.returnHandoverDateTime)); top.Ext4.getCmp('discardDateTime').setValue(getTime(item.discardDateTime)); top.Ext4.getCmp('remark').setValue(item.remark); + if (sstsConfig.InstrumentRepairManagementVersion == 3) { + top.Ext4.getCmp('discoveryPhaseOptionId').setValue(item.discoveryPhaseOptionId); + top.Ext4.getCmp('discoveryPhase').setValue(item.discoveryPhase); + } } else { showResult('系统加载出错,请稍候再试'); } @@ -464,8 +557,12 @@ //添加器械包块 function addTousseItems(index) { var hiddenBarcode = true; + var disableBarcode = true; if (sstsConfig.enableInstrumentLifeCycleTraceabilityManagement) { hiddenBarcode = false; + if (sstsConfig.InstrumentRepairManagementVersion == 1 || sstsConfig.InstrumentRepairManagementVersion == 3) { + disableBarcode = false; + } } var instrumentSerialNumberIsHidden = false; var hiddenFieldsForInstrumentRepairRecords = sstsConfig.hiddenFieldsForInstrumentRepairRecords || []; @@ -628,6 +725,7 @@ layout: 'form', border: 0, style: 'margin-bottom:10px', + height: 27, items: [{ xtype: 'hidden', id: 'materialDefinitionID_' + index, @@ -643,20 +741,25 @@ name: 'materialDefinitionName_' + index, queryParam: 'spell', minChars: 0, - valueField: 'name', - displayField: 'name', + valueField: 'nameAndBarcode', + displayField: 'nameAndBarcode', store: getMaterialDefinition(index), lazyInit: true, triggerAction: 'all', hideTrigger: true, typeAhead: false, - disabled: !hiddenBarcode, + listWidth: 300, + disabled: disableBarcode, allowBlank: false, - anchor: '60%', + anchor: '95%', listeners: { select: function (combo, record, zIndex) { - top.Ext4.getCmp('materialDefinitionID_' + index).setValue(record[0].data.id); - top.Ext4.getCmp('hiddenMaterialDefinitionName_' + index).setValue(record[0].data.name); + top.Ext4.getCmp('materialDefinitionID_' + index).setValue(record[0].data.materialDefintionId); + top.Ext4.getCmp('hiddenMaterialDefinitionName_' + index).setValue(record[0].data.nameAndBarcode); + if (record[0].data.instrumentBarcode && record[0].data.instrumentBarcode !== '') { + top.Ext4.getCmp('scanMaterialBarcode_' + index).setValue(record[0].data.instrumentBarcode); + top.Ext4.getCmp('instrumentBarcode_' + index).setValue(record[0].data.instrumentBarcode); + } }, blur: function (field) { var hiddenMaterialDefinitionName = top.Ext4.getCmp('hiddenMaterialDefinitionName_' + index).getValue(); @@ -701,11 +804,90 @@ name: 'instrumentSerialNumber_' + index, anchor: '95%' }] + }, { + columnWidth: 0.33, + layout: 'form', + border: 0, + style: 'margin-bottom:10px', + hidden: sstsConfig.InstrumentRepairManagementVersion !== 3, + items: [{ + xtype: 'textfield', + fieldLabel: '器械厂家', + maxLength: 200, + id: 'manufacturer_' + index, + name: 'manufacturer_' + index, + anchor: '95%' + }] + }, { + columnWidth: 0.33, + layout: 'form', + border: 0, + style: 'margin-bottom:10px', + hidden: sstsConfig.InstrumentRepairManagementVersion !== 3, + items: [{ + xtype: 'hidden', + id: 'deviceTypeHttpOptionId_' + index, + name: 'deviceTypeHttpOptionId_' + index + }, { + xtype: 'combo', + fieldLabel: '器械类型', + id: 'deviceType_' + index, + name: 'deviceType_' + index, + minChars: 0, + valueField: 'value', + displayField: 'value', + store: getHttpOptionStore('deviceType'), + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: true, + allowBlank: true, + editable: false, + anchor: '95%', + listeners: { + select: function (combo, record, zindex) { + top.Ext4.getCmp('deviceTypeHttpOptionId_' + index).setValue(record[0].data.id); + } + } + }] + }, { + columnWidth: 0.33, + layout: 'form', + border: 0, + style: 'margin-bottom:10px', + hidden: sstsConfig.InstrumentRepairManagementVersion !== 3, + items: [{ + xtype: 'hidden', + id: 'faultLocationHttpOptionId_' + index, + name: 'faultLocationHttpOptionId_' + index + }, { + xtype: 'combo', + fieldLabel: '故障部位', + id: 'faultLocation_' + index, + name: 'faultLocation_' + index, + minChars: 0, + valueField: 'value', + displayField: 'value', + store: getHttpOptionStore('faultLocation'), + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: true, + allowBlank: true, + editable: false, + anchor: '95%', + listeners: { + select: function (combo, record, zindex) { + top.Ext4.getCmp('faultLocationHttpOptionId_' + index).setValue(record[0].data.id); + } + } + }] }] var items = [{ columnWidth: 1, layout: 'column', - border: 0, + xtype: "fieldset", + title: '器械包信息', id: 'tousseItem_' + index, items: item }] @@ -752,13 +934,13 @@ if (hiddenFieldsForInstrumentRepairRecords.length > 0) { for (var i = 0; i < hiddenFieldsForInstrumentRepairRecords.length; i++) { var item = hiddenFieldsForInstrumentRepairRecords[i]; - if (item == '房间号') { + if (item == roomNumberNmae) { roomNumberIsHidden = true; } - if (item == '发现者') { + if (item == washHandNurseName) { washHandNurseNameIsHidden = true; } - if (item == '送修者') { + if (item == repairNurseName) { repairNurseNameIsHidden = true; } if (item == '工程师') { @@ -809,8 +991,12 @@ dateEditable = true; } var hiddenBarcode = true; + var disableBarcode = true; if (sstsConfig.enableInstrumentLifeCycleTraceabilityManagement) { hiddenBarcode = false; + if (sstsConfig.InstrumentRepairManagementVersion == 1 || sstsConfig.InstrumentRepairManagementVersion == 3) { + disableBarcode = false; + } } formPanel = new top.Ext4.form.Panel({ id: 'configForm', @@ -830,6 +1016,7 @@ value: id || '' }, { layout: 'column', + border: 0, items: [{ columnWidth: 0.33, layout: 'form', @@ -902,8 +1089,9 @@ }] }, { columnWidth: 1, + xtype: "fieldset", + title: '器械包信息', layout: 'column', - border: 0, items: [{ columnWidth: 0.29, layout: 'form', @@ -1058,6 +1246,7 @@ layout: 'form', border: 0, style: 'margin-bottom:10px', + height: 27, items: [{ xtype: 'hidden', id: 'materialDefinitionID', @@ -1073,20 +1262,26 @@ name: 'materialDefinitionName', queryParam: 'spell', minChars: 0, - valueField: 'name', - displayField: 'name', + valueField: 'nameAndBarcode', + displayField: 'nameAndBarcode', store: getMaterialDefinition(), - lazyInit: true, triggerAction: 'all', hideTrigger: true, - disabled: !hiddenBarcode, + disabled: disableBarcode, typeAhead: false, allowBlank: false, - anchor: '60%', + anchor: '95%', + listConfig: { + cls: 'custom-combo-list' + }, listeners: { select: function (combo, record, index) { - top.Ext4.getCmp('materialDefinitionID').setValue(record[0].data.id); - top.Ext4.getCmp('hiddenMaterialDefinitionName').setValue(record[0].data.name); + top.Ext4.getCmp('materialDefinitionID').setValue(record[0].data.materialDefintionId); + top.Ext4.getCmp('hiddenMaterialDefinitionName').setValue(record[0].data.nameAndBarcode); + if (record[0].data.instrumentBarcode && record[0].data.instrumentBarcode !== '') { + top.Ext4.getCmp('scanMaterialBarcode').setValue(record[0].data.instrumentBarcode); + top.Ext4.getCmp('instrumentBarcode').setValue(record[0].data.instrumentBarcode); + } }, blur: function (field) { var hiddenMaterialDefinitionName = top.Ext4.getCmp('hiddenMaterialDefinitionName').getValue(); @@ -1132,6 +1327,87 @@ name: 'instrumentSerialNumber', anchor: '95%' }] + }, { + columnWidth: 0.33, + layout: 'form', + border: 0, + style: 'margin-bottom:10px', + hidden: sstsConfig.InstrumentRepairManagementVersion !== 3, + items: [{ + xtype: 'textfield', + fieldLabel: '器械厂家', + maxLength: 200, + id: 'manufacturer', + name: 'manufacturer', + anchor: '95%' + }] + }, { + columnWidth: 0.33, + layout: 'form', + border: 0, + style: 'margin-bottom:10px', + hidden: sstsConfig.InstrumentRepairManagementVersion !== 3, + items: [{ + xtype: 'hidden', + id: 'deviceTypeHttpOptionId', + name: 'deviceTypeHttpOptionId' + }, { + xtype: 'combo', + fieldLabel: '器械类型', + id: 'deviceType', + name: 'deviceType', + minChars: 0, + valueField: 'value', + displayField: 'value', + store: getHttpOptionStore('deviceType'), + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: true, + allowBlank: true, + editable: false, + anchor: '95%', + listConfig: { + width: 400 + }, + listeners: { + select: function (combo, record, index) { + top.Ext4.getCmp('deviceTypeHttpOptionId').setValue(record[0].data.id); + } + } + }] + }, { + columnWidth: 0.33, + layout: 'form', + border: 0, + style: 'margin-bottom:10px', + hidden: sstsConfig.InstrumentRepairManagementVersion !== 3, + items: [{ + xtype: 'hidden', + id: 'faultLocationHttpOptionId', + name: 'faultLocationHttpOptionId' + }, { + xtype: 'combo', + fieldLabel: '故障部位', + id: 'faultLocation', + name: 'faultLocation', + minChars: 0, + valueField: 'value', + displayField: 'value', + store: getHttpOptionStore('faultLocation'), + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: true, + allowBlank: true, + editable: false, + anchor: '95%', + listeners: { + select: function (combo, record, index) { + top.Ext4.getCmp('faultLocationHttpOptionId').setValue(record[0].data.id); + } + } + }] }] }, { columnWidth: 1, @@ -1146,7 +1422,7 @@ hidden: roomNumberIsHidden, items: [{ xtype: 'textfield', - fieldLabel: '房间号', + fieldLabel: roomNumberNmae, id: 'roomNumber', name: 'roomNumber', allowBlank: true, @@ -1160,7 +1436,7 @@ hidden: washHandNurseNameIsHidden, items: [{ xtype: 'combo', - fieldLabel: '发现者', + fieldLabel: washHandNurseName, id: 'washHandNurseName', name: 'washHandNurseName', queryParam: 'spell', @@ -1183,7 +1459,7 @@ hidden: repairNurseNameIsHidden, items: [{ xtype: 'combo', - fieldLabel: '送修者', + fieldLabel: repairNurseName, id: 'repairNurseName', name: 'repairNurseName', queryParam: 'spell', @@ -1227,6 +1503,59 @@ anchor: '95%' }] }, { + columnWidth: 0.33, + layout: 'form', + border: 0, + style: 'margin-bottom:10px', + hidden: repairDateTimeIsHidden, + items: [{ + xtype: dateXtype, + fieldLabel: '维修时间', + labelAlign: 'right', + id: 'repairDateTime', + name: 'repairDateTime', + format: 'Y-m-d H:i', + editable: dateEditable, + allowBlank: true, + anchor: '95%' + }] + }, { + columnWidth: 0.33, + layout: 'form', + border: 0, + style: 'margin-bottom:10px', + hidden: sstsConfig.InstrumentRepairManagementVersion !== 3, + items: [{ + xtype: 'hidden', + id: 'discoveryPhaseOptionId', + name: 'discoveryPhaseOptionId' + }, { + xtype: 'combo', + fieldLabel: '发现环节', + id: 'discoveryPhase', + name: 'discoveryPhase', + minChars: 0, + valueField: 'value', + displayField: 'value', + store: getHttpOptionStore('discoveryPhase'), + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: true, + allowBlank: true, + editable: false, + anchor: '95%', + listeners: { + select: function (combo, record, zindex) { + top.Ext4.getCmp('discoveryPhaseOptionId').setValue(record[0].data.id); + } + } + }] + }, { + columnWidth: 1, + layout: 'column', + border: 0 + }, { columnWidth: 0.5, layout: 'form', border: 0, @@ -1284,6 +1613,16 @@ columnWidth: 0.33, layout: 'form', border: 0, + style: 'margin-bottom:10px', + hidden: repairTypeIsHidden, + items: [{ + xtype: 'displayfield', + fieldLabel: '' + }] + }, { + columnWidth: 0.33, + layout: 'form', + border: 0, height: 28, style: 'margin-bottom:10px;', hidden: uniqueTousseIsHidden, @@ -1323,32 +1662,6 @@ columnWidth: 0.33, layout: 'form', border: 0, - style: 'margin-bottom:10px', - hidden: repairDateTimeIsHidden, - items: [{ - xtype: dateXtype, - fieldLabel: '维修时间', - labelAlign: 'right', - id: 'repairDateTime', - name: 'repairDateTime', - format: 'Y-m-d H:i', - editable: dateEditable, - allowBlank: true, - anchor: '95%' - }] - }, { - columnWidth: 0.33, - layout: 'form', - border: 0, - style: 'margin-bottom:10px', - items: [{ - xtype: 'displayfield', - fieldLabel: '' - }] - }, { - columnWidth: 0.33, - layout: 'form', - border: 0, height: 28, style: 'margin-bottom:10px;', hidden: infectedIsHidden, @@ -1396,6 +1709,16 @@ }] }] }, { + columnWidth: 0.33, + layout: 'form', + border: 0, + style: 'margin-bottom:10px', + hidden: infectedIsHidden, + items: [{ + xtype: 'displayfield', + fieldLabel: '' + }] + }, { columnWidth: 0.7, layout: 'form', border: 0,