<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import org.controlsfx.glyphfont.Glyph?>
<BorderPane fx:id="root" maxHeight="900" maxWidth="1024" minHeight="300" minWidth="200" prefHeight="561.0"
            prefWidth="800.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
            fx:controller="com.ecep.contract.controller.contract.ContractWindowController">
    <top>
        <ToolBar prefHeight="40.0" prefWidth="800.0" BorderPane.alignment="CENTER">
            <items>
                <Button onAction="#onContractOpenInExplorerAction" text="打开目录(_D)"/>
                <Button onAction="#onSyncContractAction" text="同步(_R)"/>
                <Button fx:id="saveBtn" disable="true" text="保存(_S)">
                    <graphic>
                        <Glyph fontFamily="FontAwesome" icon="SAVE"/>
                    </graphic>
                </Button>
                <Button fx:id="verifyBtn" onAction="#onContractVerifyAction" text="合规(_V)">
                    <graphic>
                        <Glyph fontFamily="FontAwesome" icon="CHECK"/>
                    </graphic>
                    <tooltip>
                        <Tooltip text="按照预定规则检测合同是否符合合规要求"/>
                    </tooltip>
                </Button>
            </items>
        </ToolBar>
    </top>
    <center>
        <TabPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="150.0"
                 tabClosingPolicy="UNAVAILABLE" tabMaxWidth="100.0" tabMinWidth="40.0">
            <tabs>
                <Tab fx:id="baseInfoTab" text="基本信息">
                    <content>
                        <ScrollPane fitToWidth="true" pannable="true" prefHeight="486.0" prefWidth="800.0">
                            <content>
                                <VBox>
                                    <children>
                                        <GridPane VBox.vgrow="NEVER">
                                            <columnConstraints>
                                                <ColumnConstraints fillWidth="false" halignment="CENTER" hgrow="NEVER"
                                                                   maxWidth="200.0" minWidth="80.0" prefWidth="120.0"/>
                                                <ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308"
                                                                   minWidth="100.0" prefWidth="180.0"/>
                                                <ColumnConstraints fillWidth="false" halignment="CENTER" hgrow="NEVER"
                                                                   maxWidth="200.0" minWidth="80.0" prefWidth="120.0"/>
                                                <ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308"
                                                                   minWidth="100.0" prefWidth="180.0"/>
                                            </columnConstraints>
                                            <rowConstraints>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
                                                                vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" maxHeight="1.7976931348623157E308"
                                                                minHeight="80.0" prefHeight="80.0" vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" maxHeight="1.7976931348623157E308"
                                                                minHeight="30.0" prefHeight="42.0" vgrow="NEVER"/>
                                                <RowConstraints fillHeight="false" maxHeight="1.7976931348623157E308"
                                                                minHeight="30.0" prefHeight="42.0" vgrow="NEVER"/>
                                            </rowConstraints>
                                            <children>
                                                <Label text="合同名称 *"/>
                                                <Label text="合同编码 *" GridPane.rowIndex="2"/>
                                                <Label text="状态 *" GridPane.columnIndex="2" GridPane.rowIndex="4"/>
                                                <TextField fx:id="codeField" GridPane.columnIndex="1"
                                                           GridPane.rowIndex="2"/>
                                                <TextField fx:id="stateField" GridPane.columnIndex="3"
                                                           GridPane.rowIndex="4"/>
                                                <HBox GridPane.columnIndex="1" GridPane.columnSpan="3">
                                                    <children>
                                                        <TextField fx:id="nameField" HBox.hgrow="ALWAYS"/>
                                                        <Button fx:id="contractRenameBtn" mnemonicParsing="false"
                                                                text="合同更名"/>
                                                    </children>
                                                </HBox>
                                                <Label layoutX="20.0" layoutY="28.0" text="GUID *"
                                                       GridPane.columnIndex="2" GridPane.rowIndex="17"/>
                                                <Label layoutX="20.0" layoutY="58.0" text="分组 *"
                                                       GridPane.columnIndex="2" GridPane.rowIndex="3"/>
                                                <Label layoutX="20.0" layoutY="28.0" text="备注"
                                                       GridPane.rowIndex="18"/>
                                                <TextField fx:id="groupField" layoutX="202.0" layoutY="114.0"
                                                           GridPane.columnIndex="3" GridPane.rowIndex="3"/>
                                                <TextField fx:id="guidField" GridPane.columnIndex="3"
                                                           GridPane.rowIndex="17"/>
                                                <Label layoutX="56.0" layoutY="118.0" text="类型 *"
                                                       GridPane.columnIndex="2" GridPane.rowIndex="1"/>
                                                <TextField fx:id="typeField" GridPane.columnIndex="3"
                                                           GridPane.rowIndex="1"/>
                                                <TextField fx:id="kindField" GridPane.columnIndex="3"
                                                           GridPane.rowIndex="2"/>
                                                <Label text="性质 *" GridPane.columnIndex="2" GridPane.rowIndex="2"/>
                                                <Label text="合同起止日期 *" GridPane.rowIndex="8"/>
                                                <Label text="存储目录" GridPane.rowIndex="15"/>
                                                <TextField fx:id="pathField" GridPane.columnIndex="1"
                                                           GridPane.columnSpan="3" GridPane.rowIndex="15">
                                                    <GridPane.margin>
                                                        <Insets/>
                                                    </GridPane.margin>
                                                </TextField>
                                                <Label text="创建日期" GridPane.rowIndex="17"/>
                                                <TextField fx:id="createdField" GridPane.columnIndex="1"
                                                           GridPane.rowIndex="17"/>
                                                <HBox GridPane.columnIndex="1" GridPane.rowIndex="8">
                                                    <children>
                                                        <DatePicker fx:id="startDateField"
                                                                    maxWidth="1.7976931348623157E308"
                                                                    promptText="启时日期" HBox.hgrow="ALWAYS">
                                                            <HBox.margin>
                                                                <Insets right="6.0"/>
                                                            </HBox.margin>
                                                        </DatePicker>
                                                        <DatePicker fx:id="endDateField"
                                                                    maxWidth="1.7976931348623157E308"
                                                                    promptText="截止日期" HBox.hgrow="ALWAYS"/>
                                                    </children>
                                                </HBox>
                                                <TextArea fx:id="descriptionField" GridPane.columnIndex="1"
                                                          GridPane.columnSpan="3" GridPane.rowIndex="18"/>
                                                <Label text="提交人 *" GridPane.columnIndex="2" GridPane.rowIndex="8"/>
                                                <HBox GridPane.columnIndex="3" GridPane.rowIndex="8">
                                                    <children>
                                                        <TextField fx:id="setupPersonField" HBox.hgrow="SOMETIMES"/>
                                                        <DatePicker fx:id="setupDateField" HBox.hgrow="SOMETIMES"/>
                                                    </children>
                                                </HBox>
                                                <Label text="签订日期 *" GridPane.rowIndex="9"/>
                                                <DatePicker fx:id="orderDateField" maxWidth="1.7976931348623157E308"
                                                            GridPane.columnIndex="1" GridPane.rowIndex="9"/>
                                                <Label text="生效人 *" GridPane.columnIndex="2" GridPane.rowIndex="9"/>
                                                <Label text="修改人 *" GridPane.columnIndex="2" GridPane.rowIndex="10"/>
                                                <HBox GridPane.columnIndex="3" GridPane.rowIndex="9">
                                                    <children>
                                                        <TextField fx:id="inurePersonField" HBox.hgrow="SOMETIMES"/>
                                                        <DatePicker fx:id="inureDateField" HBox.hgrow="SOMETIMES"/>
                                                    </children>
                                                </HBox>
                                                <HBox GridPane.columnIndex="3" GridPane.rowIndex="10">
                                                    <children>
                                                        <TextField fx:id="varyPersonField" HBox.hgrow="SOMETIMES"/>
                                                        <DatePicker fx:id="varyDateField" HBox.hgrow="SOMETIMES"/>
                                                    </children>
                                                </HBox>
                                                <TextField fx:id="parentCodeField" GridPane.columnIndex="1"
                                                           GridPane.rowIndex="3"/>
                                                <Label text="主合同编码" GridPane.rowIndex="3"/>
                                                <Label fx:id="versionLabel" text="\@Version" GridPane.rowIndex="19"/>
                                                <HBox alignment="CENTER_RIGHT" spacing="5.0" GridPane.columnIndex="1"
                                                      GridPane.columnSpan="3" GridPane.rowIndex="16">
                                                    <children>
                                                        <Button fx:id="contractPathCreateBtn" mnemonicParsing="false"
                                                                text="创建目录"/>
                                                        <Button fx:id="contractPathChangeBtn" mnemonicParsing="false"
                                                                text="变更目录"/>
                                                        <Button fx:id="contractPathAsNameBtn" mnemonicParsing="false"
                                                                text="与合同名称同名"/>
                                                        <Button fx:id="contractPathAsCodeBtn" mnemonicParsing="false"
                                                                text="与合同号同名"/>
                                                    </children>
                                                </HBox>
                                                <HBox alignment="CENTER_RIGHT" spacing="5.0" GridPane.columnIndex="1"
                                                      GridPane.rowIndex="4">
                                                    <children>
                                                        <Button fx:id="openMainContractBtn" mnemonicParsing="false"
                                                                text="打开主合同"/>
                                                        <Button fx:id="calcMainContractNoBtn" mnemonicParsing="false"
                                                                text="计算主合同编号"/>
                                                    </children>
                                                </HBox>
                                                <Label text="对方单位 *" GridPane.rowIndex="5"/>
                                                <HBox spacing="5.0" GridPane.columnIndex="1" GridPane.columnSpan="3"
                                                      GridPane.rowIndex="5">
                                                    <children>
                                                        <TextField fx:id="companyField" HBox.hgrow="SOMETIMES"/>
                                                        <Button mnemonicParsing="false"
                                                                onAction="#onContractOpenRelativeCompanyAction"
                                                                text="详情">
                                                            <HBox.margin>
                                                                <Insets/>
                                                            </HBox.margin>
                                                        </Button>
                                                        <Button fx:id="openRelativeCompanyCustomerBtn"
                                                                mnemonicParsing="false" text="客户">
                                                            <HBox.margin>
                                                                <Insets/>
                                                            </HBox.margin>
                                                        </Button>
                                                        <Button fx:id="openRelativeCompanyVendorBtn"
                                                                mnemonicParsing="false" text="供应商"/>
                                                    </children>
                                                </HBox>
                                                <Label text="业务员 *" GridPane.rowIndex="11"/>
                                                <VBox GridPane.columnIndex="1" GridPane.rowIndex="11">
                                                    <children>
                                                        <TextField fx:id="employeeField"/>
                                                    </children>
                                                    <GridPane.margin>
                                                        <Insets bottom="5.0" top="5.0"/>
                                                    </GridPane.margin>
                                                </VBox>
                                                <Label text="经办人" GridPane.columnIndex="2" GridPane.rowIndex="11"/>
                                                <VBox GridPane.columnIndex="3" GridPane.rowIndex="11">
                                                    <children>
                                                        <TextField fx:id="handlerField"/>
                                                    </children>
                                                    <GridPane.margin>
                                                        <Insets bottom="5.0" top="5.0"/>
                                                    </GridPane.margin>
                                                </VBox>

                                                <Label text="归属项目" GridPane.rowIndex="1"/>
                                                <HBox GridPane.columnIndex="1" GridPane.rowIndex="1">
                                                    <children>
                                                        <TextField fx:id="projectField" prefWidth="190.0"
                                                                   HBox.hgrow="ALWAYS"/>
                                                        <Button fx:id="linkContractProjectBtn" mnemonicParsing="false"
                                                                text="关联" textOverrun="CLIP">
                                                        </Button>
                                                    </children>
                                                </HBox>
                                                <Label text="1. (*) 字段数据同步自用友U8系统，同步时将被覆盖"
                                                       textFill="#888888" wrapText="true" GridPane.columnIndex="1"
                                                       GridPane.columnSpan="3" GridPane.rowIndex="20"/>
                                                <Label text="合同金额" GridPane.rowIndex="6"/>
                                                <TextField fx:id="amountField" alignment="CENTER_RIGHT"
                                                           GridPane.columnIndex="1" GridPane.rowIndex="6"/>
                                                <Label text="合同总数量 *" GridPane.rowIndex="12"/>
                                                <Label text="合同总金额 *" GridPane.rowIndex="13"/>
                                                <Label text="不含税总金额 *" GridPane.rowIndex="14"/>
                                                <Label text="执行总数量 *" GridPane.columnIndex="2"
                                                       GridPane.rowIndex="12"/>
                                                <Label text="执行总金额 *" GridPane.columnIndex="2"
                                                       GridPane.rowIndex="13"/>
                                                <Label text="不含税总金额 *" GridPane.columnIndex="2"
                                                       GridPane.rowIndex="14"/>
                                                <TextField fx:id="totalQuantityField" alignment="CENTER_RIGHT"
                                                           GridPane.columnIndex="1" GridPane.halignment="RIGHT"
                                                           GridPane.rowIndex="12"/>
                                                <TextField fx:id="totalAmountField" alignment="CENTER_RIGHT"
                                                           GridPane.columnIndex="1" GridPane.halignment="RIGHT"
                                                           GridPane.rowIndex="13"/>
                                                <TextField fx:id="totalUnTaxAmountField" alignment="CENTER_RIGHT"
                                                           GridPane.columnIndex="1" GridPane.halignment="RIGHT"
                                                           GridPane.rowIndex="14"/>
                                                <TextField fx:id="execQuantityField" alignment="CENTER_RIGHT"
                                                           GridPane.columnIndex="3" GridPane.halignment="RIGHT"
                                                           GridPane.rowIndex="12"/>
                                                <TextField fx:id="execAmountField" alignment="CENTER_RIGHT"
                                                           GridPane.columnIndex="3" GridPane.halignment="RIGHT"
                                                           GridPane.rowIndex="13"/>
                                                <TextField fx:id="execUnTaxAmountField" alignment="CENTER_RIGHT"
                                                           GridPane.columnIndex="3" GridPane.halignment="RIGHT"
                                                           GridPane.rowIndex="14"/>
                                                <Label text="付款方向 *" GridPane.columnIndex="2"
                                                       GridPane.rowIndex="6"/>
                                                <TextField fx:id="payWayField" GridPane.columnIndex="3"
                                                           GridPane.rowIndex="6"/>
                                            </children>
                                            <VBox.margin>
                                                <Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
                                            </VBox.margin>
                                        </GridPane>
                                        <Pane prefHeight="50.0" prefWidth="200.0"/>
                                    </children>
                                </VBox>
                            </content>
                        </ScrollPane>
                    </content>
                </Tab>
                <Tab fx:id="extendVendorInfo" text="采购信息">
                </Tab>
                <Tab fx:id="itemTab" text="合同内容">
                </Tab>
                <Tab fx:id="payPlanTab" text="付款计划">
                </Tab>
                <Tab fx:id="contractTab" text="子合同">
                </Tab>
                <Tab fx:id="bidVendorTab" text="供应商比价">
                </Tab>
                <Tab fx:id="fileTab" text="文件">
                </Tab>
            </tabs>
        </TabPane>
    </center>
    <bottom>
        <HBox id="HBox" alignment="CENTER_LEFT" prefWidth="800.0" spacing="5.0">
            <children>
                <Label fx:id="leftStatusLabel" maxHeight="1.7976931348623157E308" text="Left status"
                       HBox.hgrow="ALWAYS">
                </Label>
                <Pane HBox.hgrow="ALWAYS"/>
                <Label fx:id="rightStatusLabel" text="Right status" HBox.hgrow="NEVER"/>
            </children>
            <padding>
                <Insets bottom="3.0" left="3.0" right="3.0" top="3.0"/>
            </padding>
        </HBox>
    </bottom>
</BorderPane>
