创建编辑更改通知单双击输入弹出单独大的输入框 #32

Merged
lidy merged 1 commits from ldy into main 6 months ago

@ -147,6 +147,9 @@ public class CreateEcnController extends KFXPanelController {
private ComboBox<String> pmCombox; private ComboBox<String> pmCombox;
@FXML @FXML
private TextArea remarkArea; private TextArea remarkArea;
@FXML
private Button createBtn;
private CreateEcnController controller; private CreateEcnController controller;
private CreateEcnFrame frame; private CreateEcnFrame frame;
@ -158,6 +161,30 @@ public class CreateEcnController extends KFXPanelController {
private final int PAGE_ROW_CNT = 16;//每页行数 private final int PAGE_ROW_CNT = 16;//每页行数
private final int ITEM_ROW_CNT = 1;//每个对象行数 private final int ITEM_ROW_CNT = 1;//每个对象行数
private final int TITLE_ROW_CNT = 7;//表头行数 private final int TITLE_ROW_CNT = 7;//表头行数
private String contractNo; // 合同代号
private String contractName;// 合同名称
private String productModel; // 产品型号
private String changeType; // 正式临时
private String changeTime;// 更改实施日期
private String changeUnit1; // 属性变更发往部门
private int pages = 0;
private String[] changeDrawingNo; // 属性zt2_ChangeDrawingNo
private String[] sign; // 属性zt2_Sign
// private String[] placesNo; //属性zt2_PlacesNo
private String[] partition; // 属性zt2_Partition
private String[] changeBefore1; // 属性zt2_ChangeBefore1
private String[] changeAfter1; // 属性zt2_ChangeAfter1
private String[] changeReason; // 属性zt2_ChangeReason
private String[] processType1; // 属性zt2_ProcessType1
private String[] szVersionBefs; // 变更前版本
private String[] szVersionAfts; // 变更后版本
private String[] productSzs; // 变更后版本
private String[] processSzs; // 变更后版本
@FXML
public TextField relateEcnText;
@Override @Override
public void initData(KFXPanel paramKFXPanel) throws Exception { public void initData(KFXPanel paramKFXPanel) throws Exception {
@ -189,12 +216,8 @@ public class CreateEcnController extends KFXPanelController {
// 获取选中的对象 // 获取选中的对象
initText(); initText();
} }
@FXML
private Button createBtn;
/** /**
* @param event * @param event
* @throws Exception * @throws Exception
@ -692,13 +715,6 @@ public class CreateEcnController extends KFXPanelController {
} }
} }
private String contractNo; // 合同代号
private String contractName;// 合同名称
private String productModel; // 产品型号
private String changeType; // 正式临时
private String changeTime;// 更改实施日期
private String changeUnit1; // 属性变更发往部门
/** /**
* @param item * @param item
* @param changeName * @param changeName
@ -817,20 +833,6 @@ public class CreateEcnController extends KFXPanelController {
item.getTCProperty("zt2_SZProcess").setStringValueArray(processSzs); item.getTCProperty("zt2_SZProcess").setStringValueArray(processSzs);
} }
private int pages = 0;
private String[] changeDrawingNo; // 属性zt2_ChangeDrawingNo
private String[] sign; // 属性zt2_Sign
// private String[] placesNo; //属性zt2_PlacesNo
private String[] partition; // 属性zt2_Partition
private String[] changeBefore1; // 属性zt2_ChangeBefore1
private String[] changeAfter1; // 属性zt2_ChangeAfter1
private String[] changeReason; // 属性zt2_ChangeReason
private String[] processType1; // 属性zt2_ProcessType1
private String[] szVersionBefs; // 变更前版本
private String[] szVersionAfts; // 变更后版本
private String[] productSzs; // 变更后版本
private String[] processSzs; // 变更后版本
/** /**
* @param event * @param event
* @function * @function
@ -941,6 +943,7 @@ public class CreateEcnController extends KFXPanelController {
EcnBean ecnBean = new EcnBean(rowNum, reasons, wips, ChangeDrawingNo[j], sign[j], placesNo[j], EcnBean ecnBean = new EcnBean(rowNum, reasons, wips, ChangeDrawingNo[j], sign[j], placesNo[j],
ChangeBefore1[j], ChangeAfter1[j], ChangeReason[j], ProcessType1[j], szVersionBef[j], ChangeBefore1[j], ChangeAfter1[j], ChangeReason[j], ProcessType1[j], szVersionBef[j],
szVersionAft[j], products, szProduct[j]); szVersionAft[j], products, szProduct[j]);
ecnBean.addActionListener(frame);
ecnBeans.add(ecnBean); ecnBeans.add(ecnBean);
// ecnBean.setProductSz(szProduct[j]); // ecnBean.setProductSz(szProduct[j]);
} }
@ -1080,19 +1083,17 @@ public class CreateEcnController extends KFXPanelController {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private void createDetailTable() { private void createDetailTable() {
// Auto-generated method stub // Auto-generated method stub
TableColumn<EcnBean, Integer> tc_xh = new TableColumn<EcnBean, Integer>("序号");
TableColumn<EcnBean, TextArea> tc_beforChange = new TableColumn<EcnBean, TextArea>("更改前");
TableColumn<EcnBean, TextArea> tc_afterChange = new TableColumn<EcnBean, TextArea>("更改后");
TableColumn<EcnBean, TextArea> tc_afterVer = new TableColumn<EcnBean, TextArea>("更改后版本");
TableColumn<EcnBean, TextArea> tc_drawNo = new TableColumn<EcnBean, TextArea>("图样代号"); TableColumn<EcnBean, TextArea> tc_drawNo = new TableColumn<EcnBean, TextArea>("图样代号");
TableColumn<EcnBean, TextArea> tc_mark = new TableColumn<EcnBean, TextArea>("标记"); TableColumn<EcnBean, TextArea> tc_mark = new TableColumn<EcnBean, TextArea>("标记");
TableColumn<EcnBean, Integer> tc_xh = new TableColumn<EcnBean, Integer>("序号"); TableColumn<EcnBean, TextArea> tc_poiNum = new TableColumn<EcnBean, TextArea>("处数");
TableColumn<EcnBean, ComboBox<String>> tc_wipTreat = new TableColumn<EcnBean, ComboBox<String>>("在制品处理"); TableColumn<EcnBean, TextArea> tc_beforChange = new TableColumn<EcnBean, TextArea>("更改前");
TableColumn<EcnBean, TextArea> tc_beforVer = new TableColumn<EcnBean, TextArea>("更改前版本"); TableColumn<EcnBean, TextArea> tc_beforVer = new TableColumn<EcnBean, TextArea>("更改前版本");
TableColumn<EcnBean, TextArea> tc_afterChange = new TableColumn<EcnBean, TextArea>("更改后");
TableColumn<EcnBean, TextArea> tc_afterVer = new TableColumn<EcnBean, TextArea>("更改后版本");
TableColumn<EcnBean, ComboBox<String>> productSz = new TableColumn<EcnBean, ComboBox<String>>("特性等级"); TableColumn<EcnBean, ComboBox<String>> productSz = new TableColumn<EcnBean, ComboBox<String>>("特性等级");
TableColumn<EcnBean, ComboBox<String>> tc_reason = new TableColumn<EcnBean, ComboBox<String>>("更改原因"); TableColumn<EcnBean, ComboBox<String>> tc_reason = new TableColumn<EcnBean, ComboBox<String>>("更改原因");
TableColumn<EcnBean, TextArea> tc_poiNum = new TableColumn<EcnBean, TextArea>("处数"); TableColumn<EcnBean, ComboBox<String>> tc_wipTreat = new TableColumn<EcnBean, ComboBox<String>>("在制品处理");
tableView.getColumns().addAll(tc_xh, tc_drawNo, tc_mark, tc_poiNum, tc_beforChange, tc_beforVer, tc_afterChange, tableView.getColumns().addAll(tc_xh, tc_drawNo, tc_mark, tc_poiNum, tc_beforChange, tc_beforVer, tc_afterChange,
tc_afterVer, productSz, tc_reason, tc_wipTreat); tc_afterVer, productSz, tc_reason, tc_wipTreat);
@ -1525,6 +1526,7 @@ public class CreateEcnController extends KFXPanelController {
void addRows(ActionEvent event) { void addRows(ActionEvent event) {
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
EcnBean bean = new EcnBean(ecnBeans.size() + 1, reasons, wips, products); EcnBean bean = new EcnBean(ecnBeans.size() + 1, reasons, wips, products);
bean.addActionListener(frame);
bean.getProductSz().setValue("C");//特性等级默认为“C” bean.getProductSz().setValue("C");//特性等级默认为“C”
ecnBeans.add(bean); ecnBeans.add(bean);
} }
@ -1540,6 +1542,7 @@ public class CreateEcnController extends KFXPanelController {
@FXML @FXML
void addRow(ActionEvent event) { void addRow(ActionEvent event) {
EcnBean bean = new EcnBean(ecnBeans.size() + 1, reasons, wips, products); EcnBean bean = new EcnBean(ecnBeans.size() + 1, reasons, wips, products);
bean.addActionListener(frame);
bean.getProductSz().setValue("C");//特性等级默认为“C” bean.getProductSz().setValue("C");//特性等级默认为“C”
ecnBeans.add(bean); ecnBeans.add(bean);
ObservableList<EcnBean> data = FXCollections.observableArrayList(ecnBeans); ObservableList<EcnBean> data = FXCollections.observableArrayList(ecnBeans);
@ -1582,9 +1585,6 @@ public class CreateEcnController extends KFXPanelController {
} }
} }
@FXML
public TextField relateEcnText;
/** /**
* @param event * @param event
* @function * @function

@ -8,17 +8,20 @@ import javafx.scene.control.TextArea;
public class EcnBean { public class EcnBean {
protected SimpleIntegerProperty num; private SimpleIntegerProperty num;
protected TextArea drawNo;// 图样代号 private TextArea drawNo;// 图样代号
protected TextArea mark; // 标记 private TextArea mark; // 标记
protected TextArea poiNum; // 处数 private TextArea poiNum; // 处数
protected TextArea overChange;// 更改前 private TextArea overChange;// 更改前
protected TextArea overVersion;// 更改前版本 // private Button overChange = new Button("查看");// 更改前
protected TextArea afterVersion;// 更改后版本 private TextArea overVersion;// 更改前版本
protected TextArea afterChange;// 更改后 private TextArea afterChange;// 更改后
protected ComboBox<String> productSz = new ComboBox<String>();// 特性等级 private TextArea afterVersion;// 更改后版本
protected ComboBox<String> changeReason = new ComboBox<String>();// 更改原因 private ComboBox<String> productSz = new ComboBox<String>();// 特性等级
protected ComboBox<String> wipTreat = new ComboBox<String>();// 在制品处理 private ComboBox<String> changeReason = new ComboBox<String>();// 更改原因
private ComboBox<String> wipTreat = new ComboBox<String>();// 在制品处理
// private String overChangeTxt;
public ComboBox<String> getProductSz() { public ComboBox<String> getProductSz() {
return productSz; return productSz;
@ -41,12 +44,17 @@ public class EcnBean {
overChange = new TextArea(); // ComboBoxTextArea overChange = new TextArea(); // ComboBoxTextArea
overChange.setPrefSize(200, 40); overChange.setPrefSize(200, 40);
overChange.setWrapText(true);
// overChange = new Button("查看");
// overChangeTxt = "";
overVersion = new TextArea(); // ComboBoxTextArea overVersion = new TextArea(); // ComboBoxTextArea
overVersion.setPrefSize(200, 40); overVersion.setPrefSize(200, 40);
afterChange = new TextArea(); // ComboBoxTextArea afterChange = new TextArea(); // ComboBoxTextArea
afterChange.setPrefSize(200, 40); afterChange.setPrefSize(200, 40);
afterChange.setWrapText(true);
afterVersion = new TextArea(); // ComboBoxTextArea afterVersion = new TextArea(); // ComboBoxTextArea
afterVersion.setPrefSize(200, 40); afterVersion.setPrefSize(200, 40);
@ -75,6 +83,10 @@ public class EcnBean {
overChange = new TextArea(); // ComboBoxTextArea overChange = new TextArea(); // ComboBoxTextArea
overChange.setPrefSize(200, 40); overChange.setPrefSize(200, 40);
overChange.setText(changeBefore); overChange.setText(changeBefore);
overChange.setWrapText(true);
// overChange = new Button("查看");
// overChangeTxt = changeBefore;
overVersion = new TextArea(); // ComboBoxTextArea overVersion = new TextArea(); // ComboBoxTextArea
overVersion.setPrefSize(200, 40); overVersion.setPrefSize(200, 40);
@ -83,6 +95,7 @@ public class EcnBean {
afterChange = new TextArea(); // ComboBoxTextArea afterChange = new TextArea(); // ComboBoxTextArea
afterChange.setPrefSize(200, 40); afterChange.setPrefSize(200, 40);
afterChange.setText(changeAfter); afterChange.setText(changeAfter);
afterChange.setWrapText(true);
afterVersion = new TextArea(); // ComboBoxTextArea afterVersion = new TextArea(); // ComboBoxTextArea
afterVersion.setPrefSize(200, 40); afterVersion.setPrefSize(200, 40);
@ -96,6 +109,19 @@ public class EcnBean {
productSz.getItems().addAll(products); productSz.getItems().addAll(products);
productSz.getSelectionModel().select(product); productSz.getSelectionModel().select(product);
} }
protected void addActionListener(CreateEcnFrame frame) {
overChange.setOnMouseClicked(event -> {
if (event.getClickCount() == 2) {
new EditTextDialog(frame, true, true, overChange).showDialog();
}
});
afterChange.setOnMouseClicked(event -> {
if (event.getClickCount() == 2) {
new EditTextDialog(frame, false, true, afterChange).showDialog();
}
});
}
public Integer getNum() { public Integer getNum() {
return num.get(); return num.get();
@ -137,6 +163,14 @@ public class EcnBean {
this.overChange = overChange; this.overChange = overChange;
} }
// public String getOverChangeTxt() {
// return overChangeTxt;
// }
//
// public void setOverChangeTxt(String overChangeTxt) {
// this.overChangeTxt = overChangeTxt;
// }
public TextArea getOverVersion() { public TextArea getOverVersion() {
return overVersion; return overVersion;
} }

@ -15,6 +15,7 @@ import javax.swing.JTextArea;
import com.teamcenter.rac.aif.AbstractAIFDialog; import com.teamcenter.rac.aif.AbstractAIFDialog;
import javafx.scene.control.TableView; import javafx.scene.control.TableView;
import javafx.scene.control.TextArea;
/** /**
* : * :
* :2024-12-02 * :2024-12-02
@ -31,28 +32,44 @@ public class EditTextDialog extends AbstractAIFDialog {
private JTextArea textArea; private JTextArea textArea;
private JButton okBtn; private JButton okBtn;
private JButton cancelBtn; private JButton cancelBtn;
private TableView<EcnBean> refTable; private String value;
private List<EcnBean> refTableBeans; private TextArea changeArea;
private int row;
private boolean before;
public EditTextDialog(CreateEcnFrame parent, TableView<EcnBean> refTable, int row, List<EcnBean> refTableBeans, public EditTextDialog(CreateEcnFrame parent, TableView<EcnBean> refTable, int row, List<EcnBean> refTableBeans,
boolean before, boolean edit) { boolean before, boolean edit, String value) {
super(parent, true); super(parent, true);
this.refTable = refTable; this.value = value;
this.refTableBeans = refTableBeans;
this.row = row;
this.before = before;
initUI(edit); initUI(before, edit);
}
public EditTextDialog(CreateEcnFrame parent, boolean before, boolean edit, String value) {
super(parent, true);
this.value = value;
initUI(before, edit);
} }
private void initUI(boolean edit) {
public EditTextDialog(CreateEcnFrame parent, boolean before, boolean edit, TextArea area) {
super(parent, true);
this.changeArea = area;
initUI(before, edit);
}
private void initUI(boolean before, boolean edit) {
setTitle(before ? "¸ü¸Äǰ" : "¸ü¸Äşó");
textArea = new JTextArea(); textArea = new JTextArea();
textArea.setLineWrap(true);
textArea.setWrapStyleWord(true); textArea.setWrapStyleWord(true);
textArea.setEditable(edit); textArea.setEditable(edit);
if(value != null)
textArea.setText(value);
else if(changeArea != null)
textArea.setText(changeArea.getText());
JPanel panel = new JPanel(new FlowLayout()); JPanel panel = new JPanel(new FlowLayout());
okBtn = new JButton("确定"); okBtn = new JButton("确定");
@ -67,7 +84,7 @@ public class EditTextDialog extends AbstractAIFDialog {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(BorderLayout.CENTER, new JScrollPane(textArea)); this.add(BorderLayout.CENTER, new JScrollPane(textArea));
this.add(BorderLayout.SOUTH, panel); this.add(BorderLayout.SOUTH, panel);
this.setPreferredSize(new Dimension(1400, 400)); this.setPreferredSize(new Dimension(800, 400));
Dimension screen = getToolkit().getScreenSize(); Dimension screen = getToolkit().getScreenSize();
setLocation((screen.width - getSize().width) / 2, (screen.height - getSize().height) / 2); setLocation((screen.width - getSize().width) / 2, (screen.height - getSize().height) / 2);
setAlwaysOnTop(true); setAlwaysOnTop(true);
@ -83,12 +100,7 @@ public class EditTextDialog extends AbstractAIFDialog {
okBtn.addActionListener(new ActionListener() { okBtn.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
if(before) { changeArea.setText(textArea.getText());
refTableBeans.get(EditTextDialog.this.row).getOverChange().setText(textArea.getText());
}else {
refTableBeans.get(EditTextDialog.this.row).getAfterChange().setText(textArea.getText());
}
refTable.refresh();
dispose(); dispose();
} }
}); });

@ -1,8 +1,6 @@
package com.chint.plm.createEcn; package com.chint.plm.createEcn;
import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.SimpleStringProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.control.CheckBox; import javafx.scene.control.CheckBox;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;

Loading…
Cancel
Save