Compare commits

...

2 Commits

@ -148,6 +148,9 @@ public class CreateEcnController extends KFXPanelController {
@FXML
private TextArea remarkArea;
@FXML
private Button createBtn;
private CreateEcnController controller;
private CreateEcnFrame frame;
private String[] database;
@ -159,6 +162,30 @@ public class CreateEcnController extends KFXPanelController {
private final int ITEM_ROW_CNT = 1;//每个对象行数
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
public void initData(KFXPanel paramKFXPanel) throws Exception {
// Auto-generated method stub
@ -189,12 +216,8 @@ public class CreateEcnController extends KFXPanelController {
// 获取选中的对象
initText();
}
@FXML
private Button createBtn;
/**
* @param event
* @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 changeName
@ -817,20 +833,6 @@ public class CreateEcnController extends KFXPanelController {
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
* @function
@ -941,6 +943,7 @@ public class CreateEcnController extends KFXPanelController {
EcnBean ecnBean = new EcnBean(rowNum, reasons, wips, ChangeDrawingNo[j], sign[j], placesNo[j],
ChangeBefore1[j], ChangeAfter1[j], ChangeReason[j], ProcessType1[j], szVersionBef[j],
szVersionAft[j], products, szProduct[j]);
ecnBean.addActionListener(frame);
ecnBeans.add(ecnBean);
// ecnBean.setProductSz(szProduct[j]);
}
@ -1080,19 +1083,17 @@ public class CreateEcnController extends KFXPanelController {
@SuppressWarnings("unchecked")
private void createDetailTable() {
// Auto-generated method stub
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, Integer> tc_xh = new TableColumn<EcnBean, Integer>("序号");
TableColumn<EcnBean, TextArea> tc_drawNo = new TableColumn<EcnBean, TextArea>("图样代号");
TableColumn<EcnBean, TextArea> tc_mark = new TableColumn<EcnBean, TextArea>("标记");
TableColumn<EcnBean, Integer> tc_xh = new TableColumn<EcnBean, Integer>("序号");
TableColumn<EcnBean, ComboBox<String>> tc_wipTreat = new TableColumn<EcnBean, ComboBox<String>>("在制品处理");
TableColumn<EcnBean, TextArea> tc_poiNum = new TableColumn<EcnBean, TextArea>("处数");
TableColumn<EcnBean, TextArea> tc_beforChange = 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>> 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,
tc_afterVer, productSz, tc_reason, tc_wipTreat);
@ -1525,6 +1526,7 @@ public class CreateEcnController extends KFXPanelController {
void addRows(ActionEvent event) {
for (int i = 0; i < 5; i++) {
EcnBean bean = new EcnBean(ecnBeans.size() + 1, reasons, wips, products);
bean.addActionListener(frame);
bean.getProductSz().setValue("C");//特性等级默认为“C”
ecnBeans.add(bean);
}
@ -1540,6 +1542,7 @@ public class CreateEcnController extends KFXPanelController {
@FXML
void addRow(ActionEvent event) {
EcnBean bean = new EcnBean(ecnBeans.size() + 1, reasons, wips, products);
bean.addActionListener(frame);
bean.getProductSz().setValue("C");//特性等级默认为“C”
ecnBeans.add(bean);
ObservableList<EcnBean> data = FXCollections.observableArrayList(ecnBeans);
@ -1582,9 +1585,6 @@ public class CreateEcnController extends KFXPanelController {
}
}
@FXML
public TextField relateEcnText;
/**
* @param event
* @function

@ -8,17 +8,20 @@ import javafx.scene.control.TextArea;
public class EcnBean {
protected SimpleIntegerProperty num;
protected TextArea drawNo;// 图样代号
protected TextArea mark; // 标记
protected TextArea poiNum; // 处数
protected TextArea overChange;// 更改前
protected TextArea overVersion;// 更改前版本
protected TextArea afterVersion;// 更改后版本
protected TextArea afterChange;// 更改后
protected ComboBox<String> productSz = new ComboBox<String>();// 特性等级
protected ComboBox<String> changeReason = new ComboBox<String>();// 更改原因
protected ComboBox<String> wipTreat = new ComboBox<String>();// 在制品处理
private SimpleIntegerProperty num;
private TextArea drawNo;// 图样代号
private TextArea mark; // 标记
private TextArea poiNum; // 处数
private TextArea overChange;// 更改前
// private Button overChange = new Button("查看");// 更改前
private TextArea overVersion;// 更改前版本
private TextArea afterChange;// 更改后
private TextArea afterVersion;// 更改后版本
private ComboBox<String> productSz = new ComboBox<String>();// 特性等级
private ComboBox<String> changeReason = new ComboBox<String>();// 更改原因
private ComboBox<String> wipTreat = new ComboBox<String>();// 在制品处理
// private String overChangeTxt;
public ComboBox<String> getProductSz() {
return productSz;
@ -41,12 +44,17 @@ public class EcnBean {
overChange = new TextArea(); // ComboBoxTextArea
overChange.setPrefSize(200, 40);
overChange.setWrapText(true);
// overChange = new Button("查看");
// overChangeTxt = "";
overVersion = new TextArea(); // ComboBoxTextArea
overVersion.setPrefSize(200, 40);
afterChange = new TextArea(); // ComboBoxTextArea
afterChange.setPrefSize(200, 40);
afterChange.setWrapText(true);
afterVersion = new TextArea(); // ComboBoxTextArea
afterVersion.setPrefSize(200, 40);
@ -75,6 +83,10 @@ public class EcnBean {
overChange = new TextArea(); // ComboBoxTextArea
overChange.setPrefSize(200, 40);
overChange.setText(changeBefore);
overChange.setWrapText(true);
// overChange = new Button("查看");
// overChangeTxt = changeBefore;
overVersion = new TextArea(); // ComboBoxTextArea
overVersion.setPrefSize(200, 40);
@ -83,6 +95,7 @@ public class EcnBean {
afterChange = new TextArea(); // ComboBoxTextArea
afterChange.setPrefSize(200, 40);
afterChange.setText(changeAfter);
afterChange.setWrapText(true);
afterVersion = new TextArea(); // ComboBoxTextArea
afterVersion.setPrefSize(200, 40);
@ -97,6 +110,19 @@ public class EcnBean {
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() {
return num.get();
}
@ -137,6 +163,14 @@ public class EcnBean {
this.overChange = overChange;
}
// public String getOverChangeTxt() {
// return overChangeTxt;
// }
//
// public void setOverChangeTxt(String overChangeTxt) {
// this.overChangeTxt = overChangeTxt;
// }
public TextArea getOverVersion() {
return overVersion;
}

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

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

Loading…
Cancel
Save