⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yewuxinxi.java

📁 业务信息管理平台,适用于企业内部信息管理,合同管理
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
				stat1=dbConn1.createStatement(); 
   				ResultSet resSetyewuname=stat1.executeQuery("select distinct truename from zhuceTable where truename!=''");
 				StringVector vec1=new StringVector();
 				while(resSetyewuname.next()){
 					vec1.add(resSetyewuname.getString("truename"));
 				}
 				yewuyuan.removeAll();
 				for(int i=0;i<vec1.size();i++){
 					yewuyuan.add(vec1.get(i));
 				}
 				stat1.close();
 				dbConn1.close();
 					//------------------------------------
   	 		}catch(Exception eee){
   	 		
   			}
   		}else{
     		yewuyuan.removeAll();
   			yewuyuan.add(truename);
   		}
   		
  		chuchangChoice=new Choice();
   		chuchangChoice.add("                                                       .");
   		chuchangChoice.setFont(font);
   		chuchangChoice.addItemListener(this);
   		chuchangTime=new JTextField(10);
  	    chuchangTime.setFont(font);
   		chuchangTime.setToolTipText("出厂时间请点击右侧按扭选择→");
   		chuchangTime.setEditable(false);
  		huichangTime=new JTextField(10);
   		huichangTime.setFont(font);	
   		huichangTime.setToolTipText("回厂时间默认为本地系统时间");
   		kehumingcheng=new JTextField(10);
   		kehumingcheng.setFont(font);
   		kehumingcheng.setToolTipText("请输入客户单位名称,12字符以内");
   		dizhi=new JTextField(10);
   		dizhi.setFont(font);
   		dizhi.setToolTipText("请输入客户地址25字符已内");
   		lianxiren=new JTextField(10);
   		lianxiren.setFont(font);
   		lianxiren.setToolTipText("请输入联系人的姓名4字符已内");
   		dianhua=new JTextField(10);
   		dianhua.setFont(font);
   		dianhua.setToolTipText("请输入客户的联系电话,手机或固话,可逗号隔开 22字符以内");
   
   		chuanzhen=new JTextField(10);
   
   		chuanzhen.setFont(font);
   		chuanzhen.setToolTipText("请输入客户的传真号码,如没有传真可不填 ");
   
   		luruButton=new JButton(" 录 入 "); 
   		luruButton.setFont(font);
   		huichangb=new JButton("当前时间");
   		huichangb.setFont(font);
   		chongzhiButton=new JButton(" 重 置 ");
   		chongzhiButton.setFont(font);
   		xiugaib=new JButton(" 修 改 ");
   		xiugaib.setFont(font);
   		shanchub=new JButton(" 删 除 ");
   		shanchub.setFont(font);
   		kehub=new JButton("查询客户");
   		kehub.setFont(font);
   
   		shanchub.setVisible(false);//默认不显示
   		xiugaib.setVisible(false);
   		luruButton.setVisible(false);
   		chongzhiButton.setVisible(false);
   		kehub.addActionListener(this);
   		chongzhiButton.addActionListener(this);
   		luruButton.addActionListener(this);
   		huichangb.addActionListener(this);
   		xiugaib.addActionListener(this);
   		shanchu.addActionListener(this);
   		shanchub.addActionListener(this);
   
		//--------------------------------------------------------------------------------------------------
 
   		Box box1=Box.createHorizontalBox();      //盒子 
   		yewuyuanlb=new JLabel("业 务 员:  ",JLabel.CENTER);
   
   		yewuyuanlb.setFont(font);    
   		box1.add(yewuyuanlb);
   		box1.add(yewuyuan);

   		Box box2=Box.createHorizontalBox();  
   		chuchangTimelb =new JLabel("出厂时间:  ",JLabel.CENTER);  
   		chuchangTimelb.setFont(font);           
   		box2.add(chuchangTimelb);
   		box2.add(chuchangTime);
   		box2.add(chuchang);
   		box2.add(chuchangChoice);
       
   		Box box3=Box.createHorizontalBox(); 
   		huichangTimelb=new JLabel("回厂时间:  ",JLabel.CENTER);  
   		huichangTimelb.setFont(font);            
   		box3.add(huichangTimelb);
  		// huichangTime.setText(timestr);//读取系统时间
   		box3.add(huichangTime);
   		box3.add(huichangb);

   		Box box4=Box.createHorizontalBox();
   		kehumingchenglb=new JLabel("客户名称:  ",JLabel.CENTER);
   		kehumingchenglb.setFont(font);               
   		box4.add(kehumingchenglb);
   		box4.add(kehumingcheng);
   		box4.add(kehub);
   		box4.add(kehuChoice);
   
   
   		Box box5=Box.createHorizontalBox();  
   		dizhilb=new JLabel("联系地址:  ",JLabel.CENTER);
   		dizhilb.setFont(font);            
   		box5.add(dizhilb);
   		box5.add(dizhi);
   		lianxirenlb=new JLabel("  联 系 人:  ",JLabel.CENTER);
   
   		lianxirenlb.setFont(font);
   		box5.add(lianxirenlb);
   		box5.add(lianxiren);
   
   		Box box6=Box.createHorizontalBox();  
   
  		dianhualb=new JLabel("联系电话:  ",JLabel.CENTER);
  		dianhualb.setFont(font); 
   		box6.add(dianhualb);
   		box6.add(dianhua);
   
   		chuanzhenlb=new JLabel("  传真地址:  ",JLabel.CENTER);
   		chuanzhenlb.setFont(font); 
   		box6.add(chuanzhenlb);
   		box6.add(chuanzhen);
   
   		Box box7=Box.createHorizontalBox();
   		xinghao=new JLabel("产品型号:");
   		xinghaot=new JTextField(5);
   		xinghaot.setToolTipText("请输入产品型号");
   
   		qiandingriqi=new JLabel("签订日期:");
   		qiandingriqit=new JTextField(5);
   		qiandingriqit.setEditable(false);
   		qiandingriqit.setToolTipText("请选择签订日期");
   		qiandingren=new JLabel("需 方 人:");
   		qiandingrent=new JTextField(5);
   		qiandingrent.setToolTipText("请输入与我公司签订合同的对方当事人姓名");
   
   		box7.add(xinghao);
   		box7.add(xinghaot);
   		box7.add(qiandingren);
   		box7.add(qiandingrent);
   		box7.add(qiandingriqi);
   		box7.add(qiandingriqit);
  		qiandingb.setFont(font);   
   		box7.add(qiandingb);
   
  		Box box8=Box.createHorizontalBox();
   		hetongzonge=new JLabel("合同总额:");
   		hetongzonget=new JTextField(5);
   		hetongzonget.setToolTipText("请输入合同总额 单位(元)");
  		zhifujine=new JLabel("已收货款:");
  		zhifujinet=new JTextField(5);
   		zhifujinet.setToolTipText("请输入支付金额 单位(元)");
   		zhifuriqi=new JLabel("收款日期:");
   		zhifuriqit=new JTextField(5);
   		zhifuriqit.setToolTipText("请选择支付日期");
   		zhifuriqit.setEditable(false);
   		box8.add(hetongzonge);
   		box8.add(hetongzonget);
   		box8.add(zhifujine);
   		box8.add(zhifujinet);
   		box8.add(zhifuriqi);
  		box8.add(zhifuriqit);
   		zhifub.setFont(font);
   		box8.add(zhifub);
   		Box box13=Box.createHorizontalBox();
   		zhifuyue=new JLabel("尚欠货款:");
   		zhifuyuet=new JTextField(5);
   		zhifuyuet.setToolTipText("请输入支付余额 单位(元)");
   		shoukuanren=new JLabel("收 款 人:");
   		shoukuanrent=new JTextField(5);
   		shoukuanrent.setToolTipText("请输入收款人姓名");
   		hetongqixian=new JLabel("清收期限:");
   		hetongqixiant=new JTextField(5);
   		hetongqixiant.setToolTipText("请选择合同截止日期");
   		hetongqixiant.setEditable(false);
   		box13.add(zhifuyue);
   		box13.add(zhifuyuet);
   		box13.add(shoukuanren);
   		box13.add(shoukuanrent);
   		box13.add(hetongqixian);
   		box13.add(hetongqixiant);
   		qixianb.setFont(font);
   		box13.add(qixianb);
  
   		Box box9=Box.createHorizontalBox();  
   		JPanel beizhup=new JPanel();
   		beizhup.setBorder(new TitledBorder("业务备注"));
   		beizhup.add(beizhu);
   		box9.add(new JScrollPane(beizhup));
   		Box box10=Box.createHorizontalBox();
   		JPanel pizhup=new JPanel();
   		pizhup.setBorder(new TitledBorder("领导批注"));
   
   		if(!(name.equals("master"))){
       		pizhu.setEnabled(false);
      
   		}
   		pizhu.setCaretColor(Color.red);
   		pizhu.setDisabledTextColor(Color.red);

   		pizhup.add(pizhu);
   		box10.add(new JScrollPane(pizhup));

   		Box box12=Box.createHorizontalBox(); 
   		box12.add(luruButton);
   		box12.add(xiugaib); 
   		box12.add(shanchub); 
   		box12.add(chongzhiButton);
   		box12.add(zhongdian);
   		box12.add(shibaiBox);
   		box12.add(zuofeiBox);
   
   		zhongdian.setVisible(false);
   		shibaiBox.setVisible(false);
   		zuofeiBox.setVisible(false);
   
   		Box boxH=Box.createVerticalBox();              
   		boxH.add(box1);
   		boxH.add(box2);
   		boxH.add(box3);
   		boxH.add(box4);
   		boxH.add(box5);
   		boxH.add(box6);
   		boxH.setBorder(new TitledBorder("基本信息"));
   		boxH.add(Box.createVerticalGlue());  

   		Box boxW=Box.createVerticalBox();   
   		boxW.add(box7); 
   		boxW.add(box8);
   		boxW.add(box13);
   		boxW.setBorder(new TitledBorder("合同信息"));
   		boxW.add(Box.createVerticalGlue()); 
   		Box boxM=Box.createVerticalBox();    
   		boxM.add(box9);
   		boxM.add(box10);
   		boxM.add(box12);
   		boxM.add(Box.createVerticalGlue()); 
   		Box boxN=Box.createVerticalBox();    
   		boxN.add(boxH);
   		boxN.add(boxW);
   		boxN.add(boxM);
   		boxN.add(Box.createVerticalGlue()); 
   		//-------------------------------------------
    	pp=new JPanel();
    	pp.add(boxN);

		lurujsp=new JScrollPane(pp);
	
		type=1;//结尾改变 1
		
	
   	}//run1() 业务信息函数
   	
	public void actionPerformed(ActionEvent e){
		
		if(e.getSource()==kehub){
			chuchangTime.setText(null);
        	huichangTime.setText(null);
        	dizhi.setText(null);
        	lianxiren.setText(null);
        	dianhua.setText(null);
        	chuanzhen.setText(null);
        	beizhu.setText(null);
        	pizhu.setText(null);
        	xinghaot.setText(null);
        	qiandingrent.setText(null);
        	hetongzonget.setText(null);
        	zhifujinet.setText(null);
        	zhifuyuet.setText(null);
        	shoukuanrent.setText(null);
  			qiandingriqit.setText(null);
  			zhifuriqit.setText(null);
  			hetongqixiant.setText(null);
			
			if(kehumingcheng.getText().trim().length()==0){
				JOptionPane.showMessageDialog(null,"请输入您要查询的客户名"); 
			}else{
				
        		ResultSet resSet;	
     			Connection dbConn;
     			Statement stat;
     			Vector vec=new Vector();
     			int ff=0;	
    			try{
    				Class.forName(Yewu.forName);
   	 				dbConn=DriverManager.getConnection(Yewu.jdbc);
     				stat=dbConn.createStatement();  	
     				if(name.equals("master")||name.equals("root")){
     					StringBuffer sql=new StringBuffer();
     					sql.append("select kehuname from yewuTab where kehuname like '%").append(kehumingcheng.getText().trim()).append("%'");
						resSet=stat.executeQuery(sql.toString());
					}else{
						StringBuffer bufer=new StringBuffer();
						bufer.append("select kehuname from yewuTab where kehuname like '%").append(kehumingcheng.getText().trim()).append("%' and yewuname='").append(truename).append("'");
						resSet=stat.executeQuery(bufer.toString());
					}  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -