Index: ssts-web/src/main/webapp/disinfectsystem/useRecord/tabs/tousseInstanceInfoTab.js =================================================================== diff -u -r38061 -r38645 --- ssts-web/src/main/webapp/disinfectsystem/useRecord/tabs/tousseInstanceInfoTab.js (.../tousseInstanceInfoTab.js) (revision 38061) +++ ssts-web/src/main/webapp/disinfectsystem/useRecord/tabs/tousseInstanceInfoTab.js (.../tousseInstanceInfoTab.js) (revision 38645) @@ -31,7 +31,585 @@ var isTraceable = false; +//NYSY-67:显示配包注意事项 /** + * 重新刷新表格 + * @param {表格id} panelID + * idCardQuestionRegist:问题登记;idCardQuestionStop:问题停用;idCardRemarkRegist:备注登记;idCardRemarkStop:备注停用 + */ +function reloadGrid(panelID) { + var params = {}; + var idCardDefinitionId = top.Ext4.getCmp('idCardDefinitionId').getValue(); + if (panelID == 'idCardQuestionRegist') { + params = { + idCardDefinitionId: idCardDefinitionId, + status: '启用', + type: 'IDCardQuestionMaintain' + } + } else if (panelID == 'idCardQuestionStop') { + params = { + idCardDefinitionId: idCardDefinitionId, + status: '停用', + type: 'IDCardQuestionMaintain' + } + } else if (panelID == 'idCardRemarkRegist') { + params = { + idCardDefinitionId: idCardDefinitionId, + status: '启用', + type: 'IDCardRemarkMaintain' + } + } else if (panelID == 'idCardRemarkStop') {//备注停用 + params = { + idCardDefinitionId: idCardDefinitionId, + status: '停用', + type: 'IDCardRemarkMaintain' + } + } + top.Ext4.getCmp(panelID).getStore().load({ + params: params + }); +} + +/** + * 扫描条码 + * @param {条码} barcode + * @param {条码类型} barcodeType + * registUser:登记人;registUser:发现人 + */ +function scanedBarcode(barcode, barcodeType) { + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/idCardInfoMaintainAction!loadUserInfoByBarcode.do', + params: { barcode: barcode }, + async: false, + success: function (response, options) { + var result = Ext4.JSON.decode(response.responseText); + if (!result.success) { + showResult(result.message); + return false; + } else { + top.Ext4.getCmp(barcodeType).setValue(result.data.fullName); + } + }, + failure: function (response, opts) { + showResult(response.responseText); + } + }); +} + +/** + * 保存标识牌登记 + * @param {登记类型} type + * IDCardQuestionMaintain:问题登记;IDCardRemarkMaintain:备注登记 + */ +function saveRegist(type) { + var idCardDefinitionId = top.Ext4.getCmp('idCardDefinitionId').getValue(); + var registUser = top.Ext4.getCmp('registUser').getValue(); + var discoverUser = top.Ext4.getCmp('discoverUser').getValue(); + var remark = top.Ext4.getCmp('remark').getValue(); + var serialNumber = top.Ext4.getCmp('serialNumber').getValue(); + var id = top.Ext4.getCmp('questionID').getValue(); + var registTime = top.Ext4.getCmp('registTime').getValue(); + + var params = { + idCardDefinitionId: idCardDefinitionId, + registUser: registUser, + discoverUser: discoverUser, + type: type, + serialNumber: serialNumber, + text: remark, + id: id, + registTimeStr: registTime + } + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/idCardInfoMaintainAction!saveOrUpdateIDCardInfoMaintain.do', + params: params, + async: false, + success: function (response, options) { + var result = Ext4.JSON.decode(response.responseText); + if (!result.success) { + showResult(result.message); + return false; + } + }, + failure: function (response, opts) { + showResult(response.responseText); + } + }); +} + +/** + * 添加或修改问题登记 + * @param {表格id} panelID + * @param {问题id} id + * idCardQuestionRegist:问题登记;idCardRemarkRegist:备注登记 + */ +function addOrUpdateQuestionRegist(panelID, id) { + var text = (panelID == 'idCardQuestionRegist') ? '问题' : '备注'; + var labelWidth = 100; + var bodyStyle = 'margin-bottom:5px'; + var panelForm = new top.Ext4.form.Panel({ + id: 'panelForm', + frame: true, + border: 0, + labelSeparator: ':', + bodyPadding: '5 5 0', + autoScroll: true, + buttonAlign: 'center', + fieldDefaults: { + columnWidth: .5, + labelAlign: 'right', + labelWidth: labelWidth, + border: false, + layout: 'form', + anchor: "100%", + style: bodyStyle + }, + layout: 'column', + items: [{ + xtype: 'hidden', + id: 'questionID', + name: 'questionID', + value: id || '' + }, { + xtype: 'datefield', + format: 'Y-m-d H:i:s', + fieldLabel: '登记时间', + id: 'registTime', + name: 'registTime', + allowBlank: false, + listeners: { + change: function (thiz, newValue, oldValue) { + var newData = new Date(); + var newStr = Ext.util.Format.date(newValue, 'Y-m-d'); + var newTimeStr = Ext.util.Format.date(newValue, 'Y-m-d H:i:s'); + var hour = (newData.getHours() > 9) ? newData.getHours() : '0' + newData.getHours(); + var minutes = (newData.getMinutes() > 9) ? newData.getMinutes() : '0' + newData.getMinutes(); + var seconds = (newData.getSeconds() > 9) ? newData.getSeconds() : '0' + newData.getSeconds(); + if(newTimeStr && newTimeStr.split(' ')[1] == '00:00:00'){ + thiz.setValue(newStr + ' ' + hour + ':' + minutes + ':' + seconds) + } + } + } + }, { + xtype: 'numberfield', + fieldLabel: '序号', + id: 'serialNumber', + name: 'serialNumber', + allowBlank: false, + minValue: 1, + allowDecimals: false + }, { + columnWidth: 1, + xtype: 'textfield', + fieldLabel: text, + id: 'remark', + name: 'remark', + allowBlank: false, + maxLength: 100 + }, { + xtype: 'textfield', + fieldLabel: '登记人条码', + id: 'registUserCode', + name: 'registUserCode', + allowBlank: true, + listeners: { + specialkey: function (field, e) { + if (e.getKey() == Ext.EventObject.ENTER) { + if (field.value == '') { + return + } + scanedBarcode(field.value, 'registUser'); + top.Ext4.getCmp('registUserCode').setValue(''); + } + } + } + }, { + xtype: 'textfield', + fieldLabel: '登记人', + id: 'registUser', + name: 'registUser', + allowBlank: false + }, { + xtype: 'textfield', + fieldLabel: '发现人条码', + id: 'discoverUserCode', + name: 'discoverUserCode', + allowBlank: true, + listeners: { + specialkey: function (field, e) { + if (e.getKey() == Ext.EventObject.ENTER) { + if (field.value == '') { + return + } + scanedBarcode(field.value, 'discoverUser'); + top.Ext4.getCmp('discoverUserCode').setValue(''); + } + } + } + }, { + xtype: 'textfield', + fieldLabel: '发现人', + id: 'discoverUser', + name: 'discoverUser', + allowBlank: false + }], + listeners: { + render: function () { + if ((id || '') == '') { + setStartDate(top.Ext4, 'yyyy/MM/dd HH:mm:ss', 'registTime') + } + } + } + }); + var addWindow = new top.Ext4.window.Window({ + title: '标识牌' + text + '登记', + height: 200, + width: 550, + resizable: false, + modal: true, + border: false, + plain: true, + layout: 'fit', + buttonAlign: 'center', + items: [panelForm], + buttons: [{ + text: '保存', + handler: function () { + if (panelForm.getForm().isValid()) { + if (panelID == 'idCardQuestionRegist') { + saveRegist('IDCardQuestionMaintain'); + } else { + saveRegist('IDCardRemarkMaintain'); + } + reloadGrid(panelID) + addWindow.close(); + } else { + showResult('请填写表单!'); + return false; + } + } + }, { + text: '取消', + handler: function () { + addWindow.close(); + } + }] + }); + addWindow.show(); + + if ((id || '') !== '') { + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/idCardInfoMaintainAction!loadIDCardInfoMaintain.do', + params: { + id: id + }, + async: false, + success: function (response, options) { + var result = Ext4.JSON.decode(response.responseText); + if (!result.success) { + showResult(result.message); + return false; + } else { + top.Ext4.getCmp('discoverUser').setValue(result.data.discoverUser); + top.Ext4.getCmp('registUser').setValue(result.data.registUser); + top.Ext4.getCmp('remark').setValue(result.data.text); + top.Ext4.getCmp('serialNumber').setValue(result.data.serialNumber); + top.Ext4.getCmp('registTime').setValue(result.data.registTime); + } + }, + failure: function (response, opts) { + showResult(response.responseText); + } + }); + } +} + +/** + * 处理/启用问题登记或者备注登记 + * @param {表格id} panelID + * idCardQuestionRegist:问题登记;idCardQuestionStop:问题停用;idCardRemarkRegist:备注登记;idCardRemarkStop:备注停用 + * @param {启用或者禁用} status 启用/禁用 + */ +function dealQuestionRegist(panelID, status) { + var idCardQuestionRegist = top.Ext4.getCmp(panelID); + var records = idCardQuestionRegist.getSelectionModel().getSelection(); + if (records.length == 0) { + showResult('请至少选择一条记录!'); + return + } + top.Ext4.MessageBox.confirm("请确认", '是否' + status + '这' + records.length + '个问题?', function (btn) { + if (btn == 'yes') { + var ids = []; + for (var i = 0; i < records.length; i++) { + var id = records[i].data.id; + ids[i] = id; + } + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/idCardInfoMaintainAction!dealIDCardInfoMaintain.do', + params: { + infoIds: ids.join(';'), + status: status + }, + async: false, + success: function (response, options) { + var result = Ext4.JSON.decode(response.responseText); + if (!result.success) { + showResult(result.message); + return false; + } else { + showResult(status + '成功'); + reloadGrid(panelID); + if (panelID == 'idCardQuestionRegist') { + reloadGrid('idCardQuestionStop'); + } else if (panelID == 'idCardRemarkRegist') { + reloadGrid('idCardRemarkStop'); + } else if (panelID == 'idCardQuestionStop') { + reloadGrid('idCardQuestionRegist'); + } else if (panelID == 'idCardRemarkStop') { + reloadGrid('idCardRemarkRegist'); + } + } + }, + failure: function (response, opts) { + showResult(response.responseText); + } + }); + } + }) +} + +/** + * 删除问题登记或者备注登记 + * @param {表格id} panelID + * idCardQuestionRegist:问题登记;idCardQuestionStop:问题停用;idCardRemarkRegist:备注登记;idCardRemarkStop:备注停用 + */ +function deleteQuestionRegist(panelID) { + var idCardQuestionRegist = top.Ext4.getCmp(panelID); + var records = idCardQuestionRegist.getSelectionModel().getSelection(); + if (records.length == 0) { + showResult('请至少选择一条记录!'); + return + } + top.Ext4.MessageBox.confirm("请确认", '是否删除这' + records.length + '个问题?', function (btn) { + if (btn == 'yes') { + var ids = []; + for (var i = 0; i < records.length; i++) { + var id = records[i].data.id; + ids[i] = id; + } + Ext4.Ajax.request({ + url: WWWROOT + '/disinfectSystem/idCardInfoMaintainAction!deleteIDCardInfoMaintain.do', + params: { + infoIds: ids.join(';') + }, + async: false, + success: function (response, options) { + var result = Ext4.JSON.decode(response.responseText); + if (!result.success) { + showResult(result.message); + return false; + } else { + showResult('删除成功'); + reloadGrid(panelID); + } + }, + failure: function (response, opts) { + showResult(response.responseText); + } + }); + } + }) +} + +/** + * 获取标识牌区域的数据 + * @param {标识牌id} idCardDefinitionId + * @param {表格id} panelID + * idCardQuestionRegist:问题登记;idCardQuestionStop:问题停用;idCardRemarkRegist:备注登记;idCardRemarkStop:备注停用 + */ +function idCardInfoMaintain(idCardDefinitionId, panelID) { + var title = ''; + var status = ''; + var type = ''; + var tbar = []; + var text = ''; + var hidden = false; + if (panelID == 'idCardQuestionRegist') { + title = '标识牌问题登记区'; + status = '启用'; + type = 'IDCardQuestionMaintain'; + text = '问题'; + hidden = true; + } else if (panelID == 'idCardQuestionStop') { + title = '标识牌问题停用区'; + status = '停用'; + type = 'IDCardQuestionMaintain'; + text = '问题'; + hidden = false; + } else if (panelID == 'idCardRemarkRegist') { + title = '标识牌备注登记区'; + status = '启用'; + type = 'IDCardRemarkMaintain'; + text = '备注'; + hidden = true; + } else if (panelID == 'idCardRemarkStop') { + title = '标识牌备注停用区'; + status = '停用'; + type = 'IDCardRemarkMaintain'; + text = '备注' + hidden = false; + } + + var columns = [ + { text: '序号', dataIndex: 'serialNumber', width: 40 }, + { text: '登记时间', dataIndex: 'registTime', width: 130 }, + { + text: text, dataIndex: 'question', width: 175, renderer: function (v, p, record) { + var id = record.data.id; + if (panelID == 'idCardQuestionRegist' || panelID == 'idCardRemarkRegist') { + return "" + v + ""; + } else { + return v + } + } + }, + { text: '登记人', dataIndex: 'registUser', width: 60 }, + { text: '发现人', dataIndex: 'discoverUser', width: 60 }, + { text: '处理人', dataIndex: 'operator', width: 60, hidden: hidden } + ]; + + if (panelID == 'idCardQuestionRegist' || panelID == 'idCardRemarkRegist') { + tbar = [{ + text: '添加', + iconCls: 'btn_ext_application_add', + handler: function () { + addOrUpdateQuestionRegist(panelID); + } + }, { + text: '处理', + iconCls: 'btn_ext_application_edit', + handler: function () { + dealQuestionRegist(panelID, '停用'); + } + }, { + text: '删除', + iconCls: 'btn_ext_application_del', + handler: function () { + deleteQuestionRegist(panelID); + } + }] + } else if (panelID == 'idCardQuestionStop' || panelID == 'idCardRemarkStop') { + tbar = [{ + text: '启用', + iconCls: 'btn_ext_application_add', + handler: function () { + dealQuestionRegist(panelID, '启用'); + } + }, { + text: '删除', + iconCls: 'btn_ext_application_del', + handler: function () { + deleteQuestionRegist(panelID); + } + }] + } + + var storeData = new Ext4.data.Store({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/idCardInfoMaintainAction!getIDCardInfoMaintainListByIDCardDefinitionId.do', + reader: { + root: 'data' + } + }, + fields: [ + { name: 'id', mapping: 'id' }, + { name: 'discoverUser', mapping: 'discoverUser' }, + { name: 'question', mapping: 'question' }, + { name: 'registTime', mapping: 'registTime' }, + { name: 'registUser', mapping: 'registUser' }, + { name: 'serialNumber', mapping: 'serialNumber' }, + { name: 'operator', mapping: 'operator' }, + { name: 'status', mapping: 'status' } + ] + }) + + storeData.load({ + params: { + idCardDefinitionId: idCardDefinitionId, + status: status, + type: type + } + }) + + var gridPagnel = new top.Ext4.grid.Panel({ + title: title, + id: panelID, + store: storeData, + width: 250, + height: 250, + columns: columns, + frame: false, + bodyStyle: 'border:1px solid #afd7af', + viewConfig: { + autoFill: true + }, + selModel: new Ext4.selection.CheckboxModel(), + tbar: tbar + }) + + return gridPagnel; +} + +/** + * 弹窗标识牌信息维护的窗口 + * @param {标识牌ID} id + */ +function cardInfoMaintain(id) { + var tmpWindow = new top.Ext4.window.Window({ + title: '标识牌信息维护', + height: 600, + width: 1000, + resizable: false, + modal: true, + border: false, + plain: true, + layout: 'fit', + items: [{ + layout: 'column', + columnWidth: 1, + items: [{ + xtype: 'hidden', + id: 'idCardDefinitionId', + name: 'idCardDefinitionId', + value: id + }, { + height: 280, + columnWidth: .5, + layout: 'fit', + items: [idCardInfoMaintain(id, 'idCardQuestionRegist')] + }, { + height: 280, + columnWidth: .5, + layout: 'fit', + items: [idCardInfoMaintain(id, 'idCardRemarkRegist')] + }, { + height: 285, + columnWidth: .5, + layout: 'fit', + items: [idCardInfoMaintain(id, 'idCardQuestionStop')] + }, { + height: 285, + columnWidth: .5, + layout: 'fit', + items: [idCardInfoMaintain(id, 'idCardRemarkStop')] + }] + }] + }); + tmpWindow.show(); +} + +/** * 拍照 * @param tousseName 包定义名称 imageType * @param tousseDefinitionId 包定义id @@ -1017,6 +1595,10 @@ items : [{ layout : 'column', items : [{ + xtype:'hidden', + id:'tousseDefinitionAncestorID', + name:'tousseDefinitionAncestorID' + },{ layout : 'form', columnWidth : .5, cls:'edit-part2-labelwidth', @@ -1149,11 +1731,28 @@ //showTousseImages(tousseName,objectId,imageType); } }] - }] + },{ + layout : 'form', + columnWidth : 1, + hidden:sstsConfig.disableIdCard !== false, + items : [{ + xtype:'hidden', + id:'idCardDefinitionId', + name:'idCardDefinitionId' + },{ + id : 'idCardDefinitionDescription', + name : 'idCardDefinitionDescription', + xtype : 'textfield', + fieldLabel : '标识牌描述', + anchor : '100%', + readOnly : true, + cls : 'fieldReadOnlyNoRemove' + }] + }] },{ layout:'column', title :'装配视频', - width :580, + width:580, hidden:!sstsConfig.enableVideoMonitorModule,//启用了视频监控模块才显示 id : 'packingVideoBox', items:[{ @@ -1193,9 +1792,45 @@ singleSelect : true }) })] - }] - } - ], + }] + }, { + layout : 'column', + columnWidth : 1, + bodyStyle : 'padding:5px 0px 5px 0px', + items:[{ + layout : 'form', + columnWidth : .5, + items : [{ + xtype : 'button', + text : '配包注意事项', + handler : function (){ + var tousseDefinitionAncestorID = top.Ext.getCmp('tousseDefinitionAncestorID').getValue(); + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!loadTousseDefinitionNote.do', + params : {id : tousseDefinitionAncestorID}, + success : function(response, options) { + var result = Ext.decode(response.responseText); + if (result.success) { + top.Ext.MessageBox.alert("配包注意事项", result.data.noteText); + } + } + }); + } + }] + }, { + layout : 'form', + columnWidth : .5, + hidden: !sstsConfig.enableIdCardInfoMaintain, + items : [{ + xtype : 'button', + text : '标识牌信息维护', + handler : function (){ + var idCardDefinitionId = top.Ext.getCmp('idCardDefinitionId').getValue(); + cardInfoMaintain(idCardDefinitionId) + } + }] + }] + }], buttons : [this.cancelButton] })] },{ @@ -2959,6 +3594,15 @@ }else{ top.Ext.getCmp('departPackage').setValue(departPackage); //装配记录_所属科室 } + + //NYSY-67:标识牌描述(字段) + if(sstsConfig.disableIdCard == false){ + top.Ext.getCmp('idCardDefinitionDescription').setValue(result.idCardInfo.idCardDefinitionDescription); + top.Ext.getCmp('idCardDefinitionId').setValue(result.idCardInfo.idCardDefinitionId); + } + + top.Ext.getCmp('tousseDefinitionAncestorID').setValue(result.tousseInstance.tousseDefinitionAncestorID); + //装配记录视频 启用视频监控模块 if(sstsConfig.enableVideoMonitorModule){ var packingRecordVideoArray = result.packingRecordVideoJSON;