Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplier/supplierCertificationWarningView.jsp
===================================================================
diff -u -r21064 -r22174
--- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplier/supplierCertificationWarningView.jsp (.../supplierCertificationWarningView.jsp) (revision 21064)
+++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplier/supplierCertificationWarningView.jsp (.../supplierCertificationWarningView.jsp) (revision 22174)
@@ -2,6 +2,8 @@
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@page import="com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods"%>
+<%@page import="com.forgon.disinfectsystem.entity.basedatamanager.imagefilemanager.ImageFile"%>
+<%@page import="com.forgon.disinfectsystem.entity.basedatamanager.supplier.ExpensiveGoodsSupplier"%>
@@ -24,17 +26,59 @@
warningType = "全部";
}
-
+
+
+
+
+
+
+
+
Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/basedatamanager/supplier/action/ExpensiveGoodsSupplierAction.java
===================================================================
diff -u -r22005 -r22174
--- ssts-basedata/src/main/java/com/forgon/disinfectsystem/basedatamanager/supplier/action/ExpensiveGoodsSupplierAction.java (.../ExpensiveGoodsSupplierAction.java) (revision 22005)
+++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/basedatamanager/supplier/action/ExpensiveGoodsSupplierAction.java (.../ExpensiveGoodsSupplierAction.java) (revision 22174)
@@ -69,6 +69,7 @@
private HttpOptionManager httpOptionManager;
private ObjectDao objectDao;
private SupplyRoomConfigManager supplyRoomConfigManager;
+ private RegistrationCertificationManager registrationCertificationManager;
public void setHttpOptionManager(HttpOptionManager httpOptionManager) {
this.httpOptionManager = httpOptionManager;
@@ -97,6 +98,12 @@
this.supplyRoomConfigManager = supplyRoomConfigManager;
}
+ public void setRegistrationCertificationManager(
+ RegistrationCertificationManager registrationCertificationManager) {
+ this.registrationCertificationManager = registrationCertificationManager;
+ }
+
+
/**
* 保存前检查是否重复
* @return
@@ -379,4 +386,36 @@
}
}
}
+ /**
+ *通过注册证ID获取到对应的高值耗材供应商
+ */
+ @SuppressWarnings("unchecked")
+ public void loadExpensiveGoodsSupplier() {
+ StrutsParamUtils.getResponse().setCharacterEncoding("UTF-8");
+ String registrationCertificationId = StrutsParamUtils.getPraramValue("id", null);
+ ExpensiveGoodsSupplier expensiveSupplier= new ExpensiveGoodsSupplier();
+ if(StringUtils.isNotBlank(registrationCertificationId)){
+ RegistrationCertification registrationCertification = registrationCertificationManager.getById(registrationCertificationId);
+ if(registrationCertification != null){
+ if(registrationCertification.getExpensiveGoodsSupplier() != null){
+ expensiveSupplier = registrationCertification.getExpensiveGoodsSupplier();
+ }
+ }
+ }
+ JsonConfig config = new JsonConfig();
+ PropertyFilter propertyFilter = new JsonPropertyFilter(new String[] {});
+ config.setJsonPropertyFilter(propertyFilter);
+ config.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT);
+
+ Map map = new HashMap();
+ map.put("success", true);
+ map.put("data", expensiveSupplier);
+ JSONObject jsonObject = JSONObject.fromObject(map, config);
+ String jsonStr = jsonObject.toString();
+ try {
+ StrutsParamUtils.getResponse().getWriter().println(jsonStr);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplier/supplierCertificationWarningForm.js
===================================================================
diff -u
--- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplier/supplierCertificationWarningForm.js (revision 0)
+++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplier/supplierCertificationWarningForm.js (revision 22174)
@@ -0,0 +1,760 @@
+var id;
+var formObj;
+var supplierWin;
+var registrationPanel;
+var registrationConfig;
+function addAndEditSupplier(id) {
+ this.id = id;
+ Ext.BLANK_IMAGE_URL = WWWROOT + '/ext/resources/images/default/s.gif';
+ var isDeposableStore = new Ext.data.SimpleStore( {
+ fields : [ 'value' ],
+ data : [[ madeCompany ],[expensivegoodssupplier]]
+ });
+
+ configStore = new top.Ext.data.Store({
+ });
+
+ //注册证
+ function newRow(){
+ var n = top.Ext.getCmp('configGrid').getStore().getCount();// 获得总行数
+ var p = new registrationCertificateConfig({
+ id : 0,
+ certificationType : registrationCertification,
+ certification : '',
+ validityTime : '',
+ type : '一类'
+ });
+ top.Ext.getCmp('configGrid').stopEditing();// 停止编辑
+ configStore.add(p);// 插入到最后一行
+ top.Ext.getCmp('configGrid').startEditing(n, 1);// 开始编辑0单元格
+ }
+ //营业执照
+ function newShopCard(){
+ var n = top.Ext.getCmp('configGrid').getStore().getCount();// 获得总行数
+ var p = new registrationCertificateConfig({
+ id : 0,
+ certificationType : businessLicense,
+ certification : '',
+ validityTime : '',
+ type : ''
+ });
+ top.Ext.getCmp('configGrid').stopEditing();// 停止编辑
+ configStore.add(p);// 插入到最后一行
+ }
+ //经营许可证
+ function newManageCard(){
+ var n = top.Ext.getCmp('configGrid').getStore().getCount();// 获得总行数
+ var p = new registrationCertificateConfig({
+ id : 0,
+ certificationType : businessCertificate,
+ certification : '',
+ validityTime : '',
+ type : ''
+ });
+ top.Ext.getCmp('configGrid').stopEditing();// 停止编辑
+ configStore.add(p);// 插入到最后一行
+ }
+ //生产许可证
+ function newCertificate(){
+ var n = top.Ext.getCmp('configGrid').getStore().getCount();// 获得总行数
+ var p = new registrationCertificateConfig({
+ id : 0,
+ certificationType : productionCertificate,
+ certification : '',
+ validityTime : '',
+ type : ''
+ });
+ top.Ext.getCmp('configGrid').stopEditing();// 停止编辑
+ configStore.add(p);// 插入到最后一行
+ }
+
+ var registrationCm = new top.Ext.grid.ColumnModel([{
+ id:'certificationType',
+ header:"证件类别",
+ width : 55,
+ dataIndex:'certificationType',
+ editor : new top.Ext.form.ComboBox({
+ xtype : 'combo',
+ valueField : 'certificationType',
+ displayField : 'certificationType',
+ store : new Ext.data.SimpleStore({
+ data: [[businessLicense],[businessCertificate],[productionCertificate],[registrationCertification]],
+ fields:['certificationType']
+ }),
+ mode : 'local',
+ forceSelection : true,
+ editable : false,
+ triggerAction : 'all',
+ listeners : {
+ specialKey : function(field,event){
+ if(event.getKey()==13 ){
+ if(isLastRow){//是最后一行,新增空白行
+ newRow();
+ }
+ }
+ }
+ }
+ })
+ }, {
+ id : 'certification',
+ header : "证件号",
+ dataIndex : 'certification',
+ width : 85 ,
+ editor : new top.Ext.form.TextField({
+ allowBlank : false,
+ minValue:1,
+ listeners : {
+
+ }
+ })
+ }, {
+ id : 'validityTime',
+ header : "失效期",
+ width : 50,
+ dataIndex : 'validityTime',
+ renderer: function(v,p,record){
+ v = v||{};
+ if(v.format){
+ return v.format('Y-m-d');
+ }else if(v.year && v.month && v.date){
+ return (v.year + 1900) + "-" + (v.month+1) + "-" + v.date;
+ }
+ return "";
+ },
+ editor : new top.Ext.form.DateExtensiableField( {
+ readOnly : false,
+ minWidth:177,
+ 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',
+ format : 'Y-m-d',
+ editable : false,
+ allowBlank : false
+ })
+ }, {
+ id:'type',
+ header:"注册证类别",
+ width : 50,
+ dataIndex:'type',
+ editor : new top.Ext.form.ComboBox({
+ xtype : 'combo',
+ valueField : 'type',
+ displayField : 'type',
+ store : new Ext.data.SimpleStore({
+ data:[['一类'],['二类'],['三类']],
+ fields:['type']
+ }),
+ mode : 'local',
+ forceSelection : true,
+ editable : false,
+ triggerAction : 'all',
+ listeners : {
+ specialKey : function(field,event){
+ if(event.getKey()==13 ){
+ if(isLastRow){//是最后一行,新增空白行
+ newRow();
+ }
+ }
+ },
+ focus : function(value) {
+ //获取所点证件的信息
+ var rows = top.Ext.getCmp('configGrid').getSelectionModel().getSelections();// 返回值为 Record 数组
+ //获取证件类型
+ var certificationType = rows[0].data.certificationType;
+ //对比是否是注册证类型
+ if(certificationType != registrationCertification){
+ showResult('只有注册证可以选择注册证类别!');
+ value.setValue('');
+ top.Ext.getCmp('configGrid').stopEditing();
+ return false;
+ }
+ }
+ }
+ })
+ }, {
+ id:'operation',
+ header:"操作",
+ width : 50,
+ dataIndex:'operation',
+ hidden:id == 0?true:false,
+ renderer: function(v,p,record){
+ var str = " ";
+ return str;
+ }
+ }]);
+
+ registrationPanel = new top.Ext.grid.EditorGridPanel({
+ id : 'configGrid',
+ name : 'configGrid',
+ store : configStore,
+ cm : registrationCm,
+ height:300,
+ frame : false,
+ bodyStyle : 'border:1px solid #afd7af',
+ autoExpandColumn : 'count',
+ viewConfig: {forceFit:true},
+ clicksToEdit : 1,//设置点击几次才可编辑
+ selModel : new top.Ext.grid.RowSelectionModel({
+ singleSelect : false
+ }),
+ tbar : [{
+ text : '新增证件',
+ width : 70 ,
+ iconCls : 'btn_ext_add',
+ handler : function() {
+ var rentTousse = top.Ext.getCmp('rentTousse').getValue();
+ if(sstsConfig.enableExpensiveGoods && rentTousse == madeCompany){ //高值耗材启用并且厂商类型为生产厂家商才可以添加注册证
+ newRow();
+ }else{
+ showResult("高值耗材未启用或厂商类型不为生产厂家不能添加注册证!");
+ }
+ }
+ }, {
+ text : '删除证件',
+ iconCls : 'btn_remove',
+ handler : function() {
+ var rows = top.Ext.getCmp('configGrid').getSelectionModel().getSelections();// 返回值为 Record 数组
+ if (rows.length == 0) {
+ showResult('最少选择一条信息,进行删除!');
+ } else {
+ top.Ext.MessageBox.confirm('提示框', '您确定要进行该操作?', function(btn) {
+ if (btn == 'yes') {
+ if (rows) {
+ for ( var i = 0; i < rows.length; i++) {
+ configStore.remove(rows[i]);
+ }
+ }
+ }
+ });
+ }
+ }
+ }],
+ listeners: {
+ beforeedit: function(obj){
+ eventEdit = obj;
+ },
+ afteredit:function(grid){
+ eventEdit = null;
+ }
+ }
+ });
+
+ var page = 1;
+ var totalPage = 0;
+ var toolbarPage = new top.Ext.Toolbar.TextItem({
+ text : '第1页'
+ });
+ var toolbarTotalPage = new top.Ext.Toolbar.TextItem({
+ text : '共0页'
+ });
+
+
+
+ Ext.Ajax.request({
+ url : WWWROOT + '/disinfectSystem/baseData/expensiveGoodsSupplierAction!getSupplierUploadPicTotalPage.do',
+ params : {
+ id : id
+ },
+ success : function(result){
+ var pageStr = result.responseText;
+ totalPage = parseInt(pageStr);
+ var element = top.Ext.get(toolbarTotalPage.el);
+ element.update('共' + totalPage + '页');
+ },
+ failure : function(){
+
+ }
+ });
+
+ var imagePanel = new top.Ext.Panel({
+ id : 'imagePanel',
+ layout : 'fit',
+ height : 270,
+ items : [{
+ xtype : 'box',
+ id : 'browseImage',
+ fieldLabel : "预览图片",
+ autoEl : {
+ id : 'imageBrowse',
+ tag : 'img',
+ autoHeight:true,
+ src : Ext.BLANK_IMAGE_URL,
+ style : 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);',
+ complete : 'off'
+ }
+ }]
+ });
+
+ var browseImage = imagePanel.findById('browseImage');
+ var url = WWWROOT + '/disinfectSystem/baseData/expensiveGoodsSupplierAction!getSupplierPic.do?id=' + id + '&page=' + page +'&time='+new Date();;
+ browseImage.autoEl.src=url;
+
+ var showCertificateImage = new top.Ext.Panel({
+ items : [{
+ xtype : 'panel',
+ id : 'pageToolbar',
+ bbar : ['->',{
+ xtype : 'button',
+ text : '<<',
+ tooltip :"上一页",
+ handler : function(){
+ if (page - 1 <= 0) {
+ showResult('已是第一页');
+ return;
+ }
+ page = page - 1;
+ var url = WWWROOT + '/disinfectSystem/baseData/expensiveGoodsSupplierAction!getSupplierPic.do?id=' + id + '&page=' + page +'&time='+new Date();;
+ var imageBrowse = top.Ext.get('imageBrowse');
+ var image = imageBrowse.dom;
+ image.src = url;// 覆盖原来的图片
+ var element = top.Ext.get(toolbarPage.el);
+ element.update('第' + page + '页');
+ }
+ },
+ toolbarPage,
+ toolbarTotalPage,{
+ xtype : 'button',
+ text : '>>',
+ tooltip :"下一页",
+ handler : function() {
+ if (page + 1 > totalPage) {
+ showResult('已是最后一页');
+ return;
+ }
+ page = page + 1;
+ var url = WWWROOT + '/disinfectSystem/baseData/expensiveGoodsSupplierAction!getSupplierPic.do?id=' + id + '&page=' + page +'&time='+new Date();
+ var imageBrowse = top.Ext.get('imageBrowse');
+ var image = imageBrowse.dom;
+ image.src = url;// 覆盖原来的图片
+ var element = top.Ext.get(toolbarPage.el);
+ element.update('第' + page + '页');
+ }
+ }]
+ },imagePanel]
+ });
+
+
+ formObj = new top.Ext.FormPanel( {
+ id : 'supplierForm',
+ frame : true,
+ labelAlign:'right',
+ labelSeparator : ':',
+ bodyStyle : 'padding:5px 5px 0px 5px',
+ labelWidth : 100,
+ autoHeight : true,
+ autoScroll : true,
+ items : [ {
+ xtype : 'hidden',
+ name : 'id',
+ id : 'id'
+ }, {
+ layout : 'column',
+ items : [ {
+ layout : 'form',
+ columnWidth : 1,
+ labelWidth : 70,
+ items : [ {
+ xtype : 'textfield',
+ fieldLabel : "公司名称",
+ allowBlank : true,
+ blankText : '请输入名称!',
+ name : "companyName",
+ id : "companyName",
+ allowBlank : false,
+ anchor : '97.5%'
+ }, {
+ xtype : 'textfield',
+ fieldLabel : "地址",
+ name : "address",
+ id : "address",
+ anchor : '97.5%'
+ }, {
+ xtype : 'textfield',
+ fieldLabel : "邮件",
+ name : "email",
+ id : "email",
+ vtype:'email',
+ vtypeText:"不是有效的邮箱地址",
+ anchor : '97.5%'
+ } ]
+ }, {
+ layout : 'form',
+ columnWidth : 0.5,
+ labelWidth : 70,
+ items : [ {
+ xtype : 'textfield',
+ width : 150,
+ fieldLabel : '电话',
+ id : 'phone',
+ name : 'phone',
+ regex: /^[0-9]{1}([0-9]|[-]){1,19}$/,
+ anchor : '95%'
+ } ]
+ }, {
+ layout : 'form',
+ columnWidth : 0.5,
+ labelWidth : 70,
+ items : [ {
+ xtype : 'textfield',
+ fieldLabel : "手机",
+ name : "cellPhone",
+ id : "cellPhone",
+ regex: /^[1-9]{1}[0-9]{10}$/,
+ anchor : '95%'
+ }]
+ }, {
+ layout : 'form',
+ columnWidth : 0.5,
+ labelWidth : 70,
+ items : [ {
+ xtype : 'textfield',
+ fieldLabel : "联系人",
+ name : "contact",
+ id : "contact",
+ anchor : '95%'
+ } ]
+ }, {
+ layout : 'form',
+ columnWidth : 0.5,
+ labelWidth : 70,
+ items : [{
+ xtype : 'combo',
+ fieldLabel : '厂商类型',
+ id : 'rentTousse',
+ name : 'rentTousse',
+ width : 130,
+ valueField : 'value',
+ displayField : 'value',
+ store : isDeposableStore,
+ forceSelection : true,
+ allowBlank : false,
+ editable : false,
+ mode : 'local',
+ triggerAction : 'all',
+ anchor : '95%',
+ listeners : {
+ select : function(combo,record,index ){
+ //创建2证,厂商类型不同证件类型不同
+ if(top.Ext.getCmp('rentTousse').getValue()== madeCompany){
+ configStore.removeAll();
+ newShopCard();
+ newCertificate();
+ }else{
+ configStore.removeAll();
+ newShopCard();
+ newManageCard();
+ }
+ }
+ }
+ }]
+ }, {
+ layout : 'form',
+ columnWidth : 0.5,
+ labelWidth : 70,
+ items : [
+ registrationPanel
+ ]
+ }, {
+ layout : 'form',
+ columnWidth : 0.5,
+ bodyStyle : 'border:1px solid #afd7af',
+ height:300,
+ labelWidth : 60,
+ items : [
+ showCertificateImage
+ ]
+ }]
+ } ],
+ buttons : [ {
+ id : 'saveBtn',
+ text : '保存',
+ handler : save
+ }, {
+ text : '取消',
+ id : 'saveAndNewBtn',
+ handler : cancel
+ } ]
+ });
+
+ supplierWin = new top.Ext.Window( {
+ id : 'supplierWin',
+ layout : 'fit',
+ title : '供应商信息',
+ width : 900,
+ border : false,
+ modal : true,
+ autoHeight : true,
+ plain : true,
+ items : [ formObj ]
+ });
+ supplierWin.show();
+
+ formObj.form
+ .load( {
+ url : WWWROOT + '/disinfectSystem/baseData/expensiveGoodsSupplierAction!loadExpensiveGoodsSupplier.do',
+ method : 'GET',
+ waitMsg : '正在加载数据,请稍候',
+ params : {
+ id : id
+ },
+ success : function(form, action) {
+ configStore.removeAll(); //清空上次器械包注册信息
+ var supplier = action.result.data;
+// //初始化供应商的授权许可证生产厂家没这许可证
+// if(supplier.businessCertificate != null && supplier.businessCertificate != ''){
+// var supplierBusinessCertificates = new registrationCertificateConfig({
+// id : supplier.id,
+// certification : supplier.businessCertificate,
+// validityTime :new Date(supplier.businessValidityTime.time),
+// type : supplier.businessType
+// });
+// configStore.add(supplierBusinessCertificates);
+// }
+
+ //初始化供应商的经营许可证
+ if(supplier.businessCertificate != null && supplier.businessCertificate != ''){
+ var supplierBusinessCertificates = new registrationCertificateConfig({
+ id : supplier.id,
+ certificationType : supplier.businessType,
+ certification : supplier.businessCertificate,
+ validityTime :new Date(supplier.businessValidityTime.time),
+ type : ''
+ });
+ configStore.add(supplierBusinessCertificates);
+ }
+ //初始化供应商的生产许可证
+ if(supplier.productionCertificate != null && supplier.productionCertificate != ''){
+ var supplierProductionCertificates = new registrationCertificateConfig({
+ id : supplier.id,
+ certificationType : supplier.productionType,
+ certification : supplier.productionCertificate,
+ validityTime :new Date(supplier.productionValidityTime.time),
+ type : ''
+ });
+ configStore.add(supplierProductionCertificates);
+ }
+ //初始化供应商的营业执照
+ if(supplier.businessLicense != null && supplier.businessLicense != ''){
+ var supplierBusinessLicenseCertificates = new registrationCertificateConfig({
+ id : supplier.id,
+ certificationType : supplier.licenseType,
+ certification : supplier.businessLicense,
+ validityTime :new Date(supplier.licenseValidityTime.time),
+ type : ''
+ });
+ configStore.add(supplierBusinessLicenseCertificates);
+ }
+ //初始化供应商包含的注册证
+ for(var i = 0 ;i < supplier.registrationCertificate.length;i++){
+ var supplierRegistrationCertificate = supplier.registrationCertificate[i];
+ var supplierRegistrationCertificates = new registrationCertificateConfig({
+ id : supplierRegistrationCertificate.id,
+ certificationType : registrationCertification,
+ certification : supplierRegistrationCertificate.certification,
+ validityTime :new Date(supplierRegistrationCertificate.validityTime.time),
+ type : supplierRegistrationCertificate.type
+ });
+ configStore.add(supplierRegistrationCertificates);
+ }
+ //类型为生产厂家是添加时带出2证
+ if(top.Ext.getCmp('rentTousse').getValue()== madeCompany && id==0){
+ newShopCard();
+ newCertificate();
+ }
+ },
+ failure : function(form, action) {
+ }
+ });
+
+}
+
+//图片上下操作
+function moveUp2(id){
+ ImageFileTableManager.moveUpImageFile(id, function(){
+ toussePackingTearchingStore.reload();
+ });
+}
+function moveDown2(id){
+ ImageFileTableManager.moveDownImageFile(id, function(){
+ toussePackingTearchingStore.reload();
+ });
+}
+
+function loadImag() {
+ var rows = top.Ext.getCmp('configGrid').getSelectionModel().getSelections();// 返回值为所点击的行
+ var configStore = top.Ext.getCmp('configGrid').getStore();
+ if (rows) {
+ for ( var i = 0; i < rows.length; i++) {
+ var index = configStore.indexOf(rows[i]); //获取本行数据下标
+ var record = configStore.getAt(index); //用本行数据下标获取点击行的证件信息
+ var id = record.data.id; //获取注册证ID
+ var type = record.data.type; //获取证件类型
+ if(type == '一类' || type == '二类' || type == '三类'){
+ uploadToussePackingImageFile(imageTypeCertification,id); //类型为注册证传注册证图片反之为高值耗材供应商证图片
+ }else{
+ uploadToussePackingImageFile(imageTypeExpensiveSupplier,id);
+ }
+ }
+ }
+}
+
+var registrationCertificateConfig = Ext.data.Record.create([
+ {name : 'id'},
+ {name : 'certificationType'},
+ {name : 'certification'},
+ {name : 'validityTime'},
+ {name : 'type'}
+]);
+
+function validateAndSubmit(){
+ //供应商相关注册证信息
+ var registrations = [];
+ var configStore = top.Ext.getCmp('configGrid').getStore();
+ var rowIndex = top.Ext.getCmp('configGrid').getStore().getCount();//grid的行数
+ for(var i =0 ;i < rowIndex ; i++ ){
+ var record = configStore.getAt(i);
+ var id = configStore.getAt(i).data.id;
+ var certificationType = record.get('certificationType');
+ var certification = record.get('certification');
+ var validityTime = record.data.validityTime.format('Y-m-d');
+ var type = record.get('type');
+ var registration = {
+ id : id,
+ certificationType: certificationType,
+ certification: certification,
+ validityTime: validityTime,
+ type: type
+ }
+ registrations.push(registration);
+ }
+ Ext.Ajax.request({
+ url : WWWROOT + '/disinfectSystem/baseData/expensiveGoodsSupplierAction!validate.do',
+ params : {validateId : top.Ext.getCmp('id').getValue(),valifateName:top.Ext.getCmp('companyName').getValue(), valifateType:top.Ext.getCmp('rentTousse').getValue()}, //多传一个供应商类型(陈家儒改)
+ success : function(response, options) {
+ var result = Ext.decode(response.responseText);
+ if(result.stauts==1){
+ formObj.form.submit( {
+ url : WWWROOT + '/disinfectSystem/baseData/expensiveGoodsSupplierAction!saveSupplier.do',
+ method : 'POST',
+ waitMsg : '正在保存数据,请稍候',
+ waitTitle : '提交表单',
+ params : {registrationsConfigResult : JSON.stringify(registrations)},
+ success : function(form, action) {
+ supplierWin.close();
+ showResult('保存成功');
+ grid.dwrReload();
+ },
+ failure : function(form, action) {
+ showResult(action.result.message);
+ top.Ext.getCmp('saveBtn').enable();
+ }
+ });
+ }else{
+ showResult(result.message);
+ top.Ext.getCmp('saveBtn').enable();
+ }
+ },
+ failure : function(response, options) {
+ var result = Ext.decode(response.responseText);
+ showResult(result.cause);
+ }
+ });
+}
+
+function save() {
+ this.disable();
+ if (!formObj.form.isValid()) {
+ showResult("请正确填写表单各值");
+ this.enable();
+ return false;
+ }
+
+ //验证证件号是否重复
+ var rowIndex = top.Ext.getCmp('configGrid').getStore().getCount();//grid的行数
+ var configStore = top.Ext.getCmp('configGrid').getStore();
+ var judge = [];
+ for(var i =0 ;i < rowIndex ; i++ ){
+ var certification = configStore.getAt(i).data.certification;
+ if(certification != ''){
+ if(judge.contains(certification)){
+ showResult('已包含相同证号:'+ certification +',不可重复添加!');
+ judge.splice(0,judge.length); //数组清空
+ this.enable();
+ return false;
+ }else{
+ judge.push(certification);
+ }
+ }else{
+ showResult('请填写证件号!');
+ this.enable();
+ return false;
+ }
+ }
+
+ var rentTousse = top.Ext.getCmp('rentTousse').getValue();
+ if(sstsConfig.enableExpensiveGoods){ //高值耗材启用才验各类证件
+ var certificationCount = configStore.getCount();
+ if (certificationCount <= 0 ){
+ showResult('请填写证件,证件不能为空!');
+ this.enable();
+ return false;
+ }
+
+ for(var i = 0 ;i < certificationCount;i++){
+ var certification = top.Ext.getCmp('configGrid').getView().getCell(i,1).firstChild.innerText;
+ if(certification == '' || certification == null || certification == ' '){
+ showResult('请填写证件号!');
+ this.enable();
+ return false;
+ }
+
+ var validityTime = top.Ext.getCmp('configGrid').getView().getCell(i,2).firstChild.innerText;
+ if(validityTime == '' || validityTime == null || validityTime == ' '){
+ showResult("请填写证件失效日期!");
+ this.enable();
+ return false;
+ }
+ }
+ }
+
+ var certificationCount = configStore.getCount();
+ var certificateTypes = new Array();
+ for(var i = 0 ;i < certificationCount;i++){
+ var licenseType = top.Ext.getCmp('configGrid').getView().getCell(i,0).firstChild.innerText;
+ certificateTypes.push(licenseType);
+ }
+ if(!certificateTypes.contains(businessLicense)){
+ showResult("请添加营业执照信息!");
+ this.enable();
+ return false;
+ }
+ if(rentTousse == madeCompany){
+ if(!certificateTypes.contains(productionCertificate)){
+ showResult("请添加生产许可证信息!");
+ this.enable();
+ return false;
+ }
+
+ if(!certificateTypes.contains(registrationCertification)){
+ showResult("请添加注册证信息!");
+ this.enable();
+ return false;
+ }
+ }else{
+ if(!certificateTypes.contains(businessCertificate)){
+ showResult("请添加经营许可证信息!");
+ this.enable();
+ return false;
+ }
+ }
+
+ var rentTousse = top.Ext.getCmp('rentTousse').getValue();
+ if(rentTousse == madeCompany && !sstsConfig.enableExpensiveGoods){
+ showResult("高值耗材未启用不能添加此类型供应商!");
+ this.enable();
+ return false;
+ }
+ validateAndSubmit();
+}
+
+function cancel() {
+ supplierWin.close();
+}
Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplier/supplierCertificationWarningView.js
===================================================================
diff -u -r21064 -r22174
--- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplier/supplierCertificationWarningView.js (.../supplierCertificationWarningView.js) (revision 21064)
+++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplier/supplierCertificationWarningView.js (.../supplierCertificationWarningView.js) (revision 22174)
@@ -2,14 +2,42 @@
var formObj;
var formWindow;
+var loadFormData = function(grid) {
+ var records = grid.getSelectionModel().getSelections();
+ if (records.length == 0) {
+ showResult("请选择要修改的供应商!");
+ return false;
+ }
+ if (records.length > 1) {
+ showResult("一次只能修改一个供应商!");
+ return false;
+ }
+ id = records[0].data['id'];
+ addAndEditSupplier(id);
+};
+function modify(v,data){
+ loadFormData(grid);
+}
+
+function rendeColor(v, p, record){
+ var expensiveGoodsSupplier = record.data;
+ if(expensiveGoodsSupplier != null){
+ //判断是否有注册证过期或达到预警期有就改变名称背景颜色为黄色
+ if(expensiveGoodsSupplier.expired){
+ return "" + v + "
";
+ }
+ }
+ return "" + v + "";
+}
+
Ext.onReady(function() {
Ext.QuickTips.init();
document.getElementById("parm_s_type").value = warningType;
//********* 2、ForgonGrid ***********
var columns = [
- {header : "注册号",width : 500,dataIndex : 'certification'},
+ {header : "注册号",width : 500,dataIndex : 'certification',renderer : rendeColor},
{header : "类别",width : 300,dataIndex : 'type'},
{id : 'operationRemark',header : "有效期",width : 200,dataIndex : 'validityTime'}
];