package com.ecep.contract.controller.vendor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.ecep.contract.controller.AbstEntityController;
import com.ecep.contract.controller.vendor.purchase.purchase_bill.PurchaseBillVoucherTabSkinItems;
import com.ecep.contract.model.PurchaseBillVoucher;
import com.ecep.contract.service.PurchaseBillVoucherService;
import com.ecep.contract.util.FxmlPath;
import com.ecep.contract.vm.PurchaseBillVoucherViewModel;

import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.stage.Stage;

@Lazy
@Scope("prototype")
@Component
@FxmlPath("/ui/contract/purchase-bill-voucher.fxml")
public class PurchaseBillVoucherWindowController
        extends AbstEntityController<PurchaseBillVoucher, PurchaseBillVoucherViewModel> {
    public TabPane tabPane;
    public Tab baseInfoTab;
    public Tab itemTab;

    @Autowired
    private PurchaseBillVoucherService service;

    @Override
    public void show(Stage stage) {
        super.show(stage);
        getTitle().set("采购发票详情");
    }

    @Override
    protected void registerTabSkins() {
        registerTabSkin(itemTab, tab -> new PurchaseBillVoucherTabSkinItems(this));
    }

    @Override
    public PurchaseBillVoucherService getViewModelService() {
        return service;
    }
}
