|
|
|
@ -56,7 +56,7 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
|
|
|
|
|
|
|
|
|
|
/*菜单栏*/
|
|
|
|
|
JLabel logoLabel,userMenuLabel1,homeMenuLabel,userMenuLabel,inMenuLabel,
|
|
|
|
|
outMenuLabel,storageMenuLabel,supplierMenuLabel,catalogMenuLabel;
|
|
|
|
|
outMenuLabel,storageMenuLabel,supplierMenuLabel,catalogMenuLabel;
|
|
|
|
|
|
|
|
|
|
static JLabel remindMenuLabel;/*全局调用刷新*/
|
|
|
|
|
|
|
|
|
@ -126,7 +126,6 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
|
|
|
|
|
this.addWindowListener(this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获得未进货的信息
|
|
|
|
|
Vector<InOrder> vInOrder;
|
|
|
|
|
vInOrder = inOrderImpl.findUnconfirmInOrder();
|
|
|
|
@ -364,92 +363,149 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override/*左侧菜单栏点击事件*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* cwf 2024/12/11
|
|
|
|
|
* 修改不同权限用户的功能代码
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
/* 左侧菜单栏点击事件 */
|
|
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
|
|
Object source = e.getSource();
|
|
|
|
|
if(source==homeMenuLabel) {
|
|
|
|
|
rightPanelLayout.show(rightPanel,"0");
|
|
|
|
|
location=0;
|
|
|
|
|
}else if(source==userMenuLabel) {
|
|
|
|
|
if(sSuper==0)
|
|
|
|
|
rightPanelLayout.show(rightPanel,"1");
|
|
|
|
|
else{
|
|
|
|
|
rightPanelLayout.show(rightPanel,"7");
|
|
|
|
|
Object source = e.getSource(); // 获取点击事件的来源
|
|
|
|
|
|
|
|
|
|
// 如果点击的是首页菜单
|
|
|
|
|
if (source == homeMenuLabel) {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "0"); // 显示首页界面
|
|
|
|
|
location = 0; // 设置当前位置为首页
|
|
|
|
|
}
|
|
|
|
|
// 如果点击的是人员管理菜单
|
|
|
|
|
else if (source == userMenuLabel) {
|
|
|
|
|
// 如果用户是管理员 (sSuper == 0) 或进货员 (sSuper == 1)
|
|
|
|
|
if (sSuper == 0 || sSuper == 1) {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "1"); // 显示人员管理界面
|
|
|
|
|
}
|
|
|
|
|
// 如果用户是普通用户 (sSuper == 3)
|
|
|
|
|
else if (sSuper == 3) {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
|
|
|
|
|
}
|
|
|
|
|
// 其他情况(例如普通用户权限)
|
|
|
|
|
else {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
|
|
|
|
|
}
|
|
|
|
|
location=1;
|
|
|
|
|
location = 1; // 设置当前位置为人员管理
|
|
|
|
|
}
|
|
|
|
|
else if(source==inMenuLabel) {
|
|
|
|
|
if(sSuper==2)
|
|
|
|
|
rightPanelLayout.show(rightPanel,"7");
|
|
|
|
|
else{
|
|
|
|
|
rightPanelLayout.show(rightPanel,"2");
|
|
|
|
|
|
|
|
|
|
// 如果点击的是进货系统菜单
|
|
|
|
|
else if (source == inMenuLabel) {
|
|
|
|
|
// 如果用户是普通用户 (sSuper == 2) 或进货员 (sSuper == 1)
|
|
|
|
|
if (sSuper == 2 || sSuper == 1) {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
|
|
|
|
|
}
|
|
|
|
|
// 其他情况(例如管理员权限)
|
|
|
|
|
else {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "2"); // 显示进货系统界面
|
|
|
|
|
}
|
|
|
|
|
location=2;
|
|
|
|
|
location = 2; // 设置当前位置为进货系统
|
|
|
|
|
}
|
|
|
|
|
else if(source==outMenuLabel) {
|
|
|
|
|
rightPanelLayout.show(rightPanel,"3");
|
|
|
|
|
location=3;
|
|
|
|
|
// 如果点击的是收银系统菜单
|
|
|
|
|
else if (source == outMenuLabel) {
|
|
|
|
|
// 如果用户是普通用户 (sSuper == 3) 或进货员 (sSuper == 1)
|
|
|
|
|
if (sSuper == 3 || sSuper == 1) {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
|
|
|
|
|
}
|
|
|
|
|
// 其他情况(例如管理员权限)
|
|
|
|
|
else {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "3"); // 显示收银系统界面
|
|
|
|
|
location = 3; // 设置当前位置为收银系统
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(source==storageMenuLabel) {
|
|
|
|
|
rightPanelLayout.show(rightPanel,"4");
|
|
|
|
|
location=4;
|
|
|
|
|
// 如果点击的是库存系统菜单
|
|
|
|
|
else if (source == storageMenuLabel) {
|
|
|
|
|
// 如果用户是进货员 (sSuper == 1)
|
|
|
|
|
if (sSuper == 1) {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
|
|
|
|
|
}
|
|
|
|
|
// 其他情况(例如管理员权限)
|
|
|
|
|
else {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "4"); // 显示库存系统界面
|
|
|
|
|
location = 4; // 设置当前位置为库存系统
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(source==supplierMenuLabel) {
|
|
|
|
|
rightPanelLayout.show(rightPanel,"5");
|
|
|
|
|
|
|
|
|
|
location=5;
|
|
|
|
|
|
|
|
|
|
// 如果点击的是供应商菜单
|
|
|
|
|
else if (source == supplierMenuLabel) {
|
|
|
|
|
// 如果用户是进货员 (sSuper == 1)
|
|
|
|
|
if (sSuper == 1) {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
|
|
|
|
|
}
|
|
|
|
|
// 其他情况(例如管理员权限)
|
|
|
|
|
else {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "5"); // 显示供应商界面
|
|
|
|
|
location = 5; // 设置当前位置为供应商
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(source==catalogMenuLabel) {
|
|
|
|
|
rightPanelLayout.show(rightPanel,"6");
|
|
|
|
|
location=6;
|
|
|
|
|
|
|
|
|
|
}else if(source==remindMenuLabel) {
|
|
|
|
|
if(sSuper==2)
|
|
|
|
|
rightPanelLayout.show(rightPanel,"7");
|
|
|
|
|
else{
|
|
|
|
|
rightPanelLayout.show(rightPanel,"8");
|
|
|
|
|
// 如果点击的是商品目录菜单
|
|
|
|
|
else if (source == catalogMenuLabel) {
|
|
|
|
|
// 如果用户是进货员 (sSuper == 1)
|
|
|
|
|
if (sSuper == 1) {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
|
|
|
|
|
}
|
|
|
|
|
location=7;
|
|
|
|
|
}else if(source==userMenuLabel1){
|
|
|
|
|
|
|
|
|
|
UserInfDialog userInfDialog = new UserInfDialog(this,user);
|
|
|
|
|
userInfDialog.setVisible(true);
|
|
|
|
|
location=8;
|
|
|
|
|
// 其他情况(例如管理员权限)
|
|
|
|
|
else {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "6"); // 显示商品目录界面
|
|
|
|
|
location = 6; // 设置当前位置为商品目录
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 如果点击的是提醒菜单
|
|
|
|
|
else if (source == remindMenuLabel) {
|
|
|
|
|
// 如果用户是普通用户 (sSuper == 2) 或进货员 (sSuper == 1)
|
|
|
|
|
if (sSuper == 2 || sSuper == 1) {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "7"); // 显示普通用户界面
|
|
|
|
|
}
|
|
|
|
|
// 其他情况(例如管理员权限)
|
|
|
|
|
else {
|
|
|
|
|
rightPanelLayout.show(rightPanel, "8"); // 显示进货信息提示界面
|
|
|
|
|
}
|
|
|
|
|
location = 7; // 设置当前位置为提醒
|
|
|
|
|
}
|
|
|
|
|
// 如果点击的是用户信息菜单
|
|
|
|
|
else if (source == userMenuLabel1) {
|
|
|
|
|
UserInfDialog userInfDialog = new UserInfDialog(this, user); // 创建用户信息对话框
|
|
|
|
|
userInfDialog.setVisible(true); // 显示用户信息对话框
|
|
|
|
|
location = 8; // 设置当前位置为用户信息
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
refreshRemove();
|
|
|
|
|
refreshRemove(); // 刷新当前界面的位置信息
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取当前位置
|
|
|
|
|
public void refreshRemove(){
|
|
|
|
|
public void refreshRemove(){
|
|
|
|
|
|
|
|
|
|
purposePanel.removeAll();
|
|
|
|
|
if(location==0){
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+homeMenuLabel.getText());
|
|
|
|
|
purposePanel.removeAll();
|
|
|
|
|
if(location==0){
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+homeMenuLabel.getText());
|
|
|
|
|
|
|
|
|
|
}else if(location==1){
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+userMenuLabel.getText());
|
|
|
|
|
}else if(location==1){
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+userMenuLabel.getText());
|
|
|
|
|
|
|
|
|
|
}else if(location==2){
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+inMenuLabel.getText());
|
|
|
|
|
}else if(location==2){
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+inMenuLabel.getText());
|
|
|
|
|
|
|
|
|
|
}else if(location==3){
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+outMenuLabel.getText());
|
|
|
|
|
}else if(location==3){
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+outMenuLabel.getText());
|
|
|
|
|
|
|
|
|
|
}else if(location==4){
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+storageMenuLabel.getText());
|
|
|
|
|
}else if(location==4){
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+storageMenuLabel.getText());
|
|
|
|
|
|
|
|
|
|
}else if(location==5){
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+supplierMenuLabel.getText());
|
|
|
|
|
}else if(location==5){
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+supplierMenuLabel.getText());
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+catalogMenuLabel.getText());
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
purposeLabel = new JLabel("当前位置是:"+catalogMenuLabel.getText());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
purposePanel.add(purposeLabel);
|
|
|
|
|
purposePanel.add(purposeLabel);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void mousePressed(MouseEvent e) {
|
|
|
|
@ -488,11 +544,10 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
|
|
|
|
|
}else if(source==catalogMenuLabel) {
|
|
|
|
|
catalogMenuLabel.setForeground(new Color(18, 150, 219));
|
|
|
|
|
catalogMenuLabel.setIcon(new ImageIcon("static\\icon\\catalog2.png"));
|
|
|
|
|
}
|
|
|
|
|
else if(source==userMenuLabel1) {
|
|
|
|
|
} else if(source==userMenuLabel1) {
|
|
|
|
|
userMenuLabel1.setForeground(new Color(18, 150, 219));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -501,8 +556,7 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
|
|
|
|
|
if(source==homeMenuLabel) {
|
|
|
|
|
homeMenuLabel.setForeground(Color.white);
|
|
|
|
|
homeMenuLabel.setIcon(new ImageIcon("static\\icon\\home1.png"));
|
|
|
|
|
}
|
|
|
|
|
else if(source==userMenuLabel) {
|
|
|
|
|
} else if(source==userMenuLabel) {
|
|
|
|
|
userMenuLabel.setForeground(Color.white);
|
|
|
|
|
userMenuLabel.setIcon(new ImageIcon("static\\icon\\user1.png"));
|
|
|
|
|
}else if(source==inMenuLabel) {
|
|
|
|
@ -520,11 +574,10 @@ public class MainView extends BaseView implements ActionListener, MouseListener,
|
|
|
|
|
}else if(source==catalogMenuLabel) {
|
|
|
|
|
catalogMenuLabel.setForeground(Color.white);
|
|
|
|
|
catalogMenuLabel.setIcon(new ImageIcon("static\\icon\\catalog1.png"));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
userMenuLabel1.setForeground(Color.white);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|