Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/qualitymonitoringConfig/qualityMonitoringDefinitionView.js =================================================================== diff -u -r40981 -r41253 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/qualitymonitoringConfig/qualityMonitoringDefinitionView.js (.../qualityMonitoringDefinitionView.js) (revision 40981) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/qualitymonitoringConfig/qualityMonitoringDefinitionView.js (.../qualityMonitoringDefinitionView.js) (revision 41253) @@ -1682,14 +1682,22 @@ if (isNameExist) { showResult(name + ",列表已存在!"); } else { + var options = ''; + if(type == '文本'){ + if(sstsConfig.enableElementAssociation){ + options = '自定义文本内容' + }else { + options = ''; + } + } var itemRecord = new formDefinitionItemRecord({ id: 0, name: name, type: type, requirement: requirement, repeatWrite: repeatWrite, - options: '', - optionsJson: "", + options: options, + optionsJson: options, isReportDisplay: '是', width: '', appendToRemark: '否', @@ -1867,7 +1875,23 @@ triggerAction: 'all' }) }, - { header: "参数值", width: 130, dataIndex: 'options' }, + { header: "参数值", width: 130, dataIndex: 'options', + editor: new top.Ext.form.ComboBox({ + valueField: 'value', + displayField: 'value', + allowBlank: false, + width: 80, + editable: false, + store: new top.Ext.data.SimpleStore({ + fields: ['value'], + data: [['自定义文本内容'], ['关联当前科室用户']] + }), + value:'自定义文本内容', + forceSelection: true, + mode: 'local', + triggerAction: 'all' + }) + }, { header: "追加到监测记录备注", width: 120, dataIndex: 'appendToRemark', hidden: !sstsConfig.enableInspectElementAppendToRemarkFunction, editor: new top.Ext.form.ComboBox({ @@ -1963,6 +1987,9 @@ if (record.field == "displayFormat" && record.value == '') { return false } + if(record.field == "options" && !sstsConfig.enableElementAssociation){ + return false + } } } }) @@ -2106,14 +2133,25 @@ if (items[i].type == '单选') { displayFormat = items[i].displayFormat || '打勾方式' } + var options = items[i].optionsStr; + var optionsJson = items[i].optionsJson; + if(items[i].type == '文本'){ + if(sstsConfig.enableElementAssociation && options == ''){ + options = '自定义文本内容'; + optionsJson = '自定义文本内容'; + }else { + options = ''; + optionsJson = ''; + } + } var itemRecord = new formDefinitionItemRecord({ id: items[i].id, name: items[i].name, type: items[i].type, requirement: items[i].requirement, repeatWrite: items[i].repeatWrite, - options: items[i].optionsStr, - optionsJson: items[i].optionsJson, + options: options, + optionsJson: optionsJson, isReportDisplay: items[i].isReportDisplay, width: items[i].width || '', appendToRemark: items[i].appendToRemark || '否', @@ -2235,13 +2273,21 @@ break; } } + var options = record.get('optionsJson'); + if(type == '文本'){ + if(sstsConfig.enableElementAssociation){ + options = record.get('options') + }else { + options = ''; + } + } jsonArray.push({ id: record.get('id'), name: name, type: type, requirement: record.get('requirement'), repeatWrite: record.get('repeatWrite'), - options: record.get('optionsJson'), + options: options, orderNumber: (i + 1), isReportDisplay: record.get('isReportDisplay'), appendToRemark: record.get('appendToRemark'), Index: ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceForm.js =================================================================== diff -u -r41241 -r41253 --- ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceForm.js (.../qualitymonitoringInstanceForm.js) (revision 41241) +++ ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceForm.js (.../qualitymonitoringInstanceForm.js) (revision 41253) @@ -31,6 +31,21 @@ var currentOrgUnitCoding = currentOrgUnitCoding || ''; var newTousseItems = [] var updateId = '' +var userReader = new Ext.data.JsonReader({ + fields: [ + { name: 'id' }, + { name: 'fullName' }, + { name: 'orgUnitName' } + ] +}); +// 查找某科室的人员的store +var departUsersStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/systemmanage/user/userAction!loadUsersBySearchString.do', + method: 'POST' + }), + reader: userReader +}); if (Ext.getCmp("tousseInfoFieldSet")) { var getWidth = Ext.getCmp("tousseInfoFieldSet").items.items[0].el.dom.clientWidth; } @@ -1398,22 +1413,71 @@ var columnWidth = actualWidth > 500 ? 0.5 : 1; if (type == '文本') { + var items = [{ + xtype: 'textfield', + fieldLabel: name, + maxLength: '30', + id: 'configItemOption' + id, + name: 'configItemOption' + id, + allowBlank: allowBlank, + value: value, + anchor: '95%' + }] + if (sstsConfig.enableElementAssociation && options == '关联当前科室用户') { + items = [{ + xtype: 'combo', + fieldLabel: name, + id: 'configItemOption' + id, + name: 'configItemOption' + id, + queryParam: 'spell', + minChars: 0, + displayField: 'fullName', + store: departUsersStore, + forceSelection: false, + lazyInit: true, + triggerAction: 'all', + hideTrigger: false, + typeAhead: false, + allowBlank: false, + anchor: '95%', + index: id, + listeners: { + specialkey: function (field, e) { + if (e.getKey() == 13) { + var text = field.getValue(); + if (isValidBarcode(text)) { + loadResponPersonByBarcode(text, 'configItemOption' + field.index); + } else if (isValidStaffNumber(text)) { + UserTableManager.getUserByLoginName(text, function (responseText) { + if (!isUndefinedOrNullOrEmpty(responseText)) { + var result = Ext.decode(responseText); + if (result.isBelongsToCurrentLoginUserOrgs == false) { + showResultQM("登记人需为当前科室用户!"); + return + } + Ext.getCmp('configItemOption' + field.index).setValue(result.fullName); + } else { + showResultQM('找不到该工号对应的人员信息'); + } + }); + } else { + showResultQM('该工号或条码不存在!'); + } + } + }, + focus: function (field) { + focusInputId = 'configItemOption' + field.index + } + } + }] + } return { columnWidth: columnWidth, layout: 'form', labelWidth: 90, hidden: hideElement, id: 'hideElement' + id, - items: [{ - xtype: 'textfield', - fieldLabel: name, - maxLength: '30', - id: 'configItemOption' + id, - name: 'configItemOption' + id, - allowBlank: allowBlank, - value: value, - anchor: '95%' - }] + items: items }; } else if (type == '文本框') { return { @@ -6106,7 +6170,7 @@ showResultQM('条码不能为空!'); return; } - UserTableManager.getUserByBarcodeAndCurrentOrgUnitCoding(barcode,Ext.getCmp("orgUnitCoding").getValue(), function (responseText) { + UserTableManager.getUserByBarcodeAndCurrentOrgUnitCoding(barcode, Ext.getCmp("orgUnitCoding").getValue(), function (responseText) { if (!isUndefinedOrNullOrEmpty(responseText)) { var result = Ext.decode(responseText); if (domId == 'responsiblePerson') { @@ -6956,7 +7020,7 @@ } // 加载监测项对所选的项赋初值,只是从其他环节进来执行一次. otherPartAddQM = false; - },beforeload:function (store){ + }, beforeload: function (store) { formDefinitionStore.baseParams.orgUnitCoding = Ext.getCmp("orgUnitCoding").getValue(); } } @@ -7019,21 +7083,6 @@ if (id != null && id != '') { labelWidthPosition = 91; } - var userReader = new Ext.data.JsonReader({ - fields: [ - { name: 'id' }, - { name: 'fullName' }, - { name: 'orgUnitName' } - ] - }); - // 查找某科室的人员的store - var departUsersStore = new Ext.data.Store({ - proxy: new Ext.data.HttpProxy({ - url: WWWROOT + '/systemmanage/user/userAction!loadUsersBySearchString.do', - method: 'POST' - }), - reader: userReader - }); var varibaleContent1; var varibaleContent2; // 责任环节带出监测项