// import { boxMarkListPrint } from "@/utils/print/boxMark/boxMarkListPrint";
import { handleAddDisNo, handleGenerateDisYes, initFormData } from "./details";

export const handleBtnsFunObj = {
    Switch: (params: any) => {
        const { datas, data } = params;
        datas.printNumber = data;
        return;
    },
    numberCode: (params: any) => {
        const { datas, data } = params;
        datas.isNumberCode = data;
        datas.isNumberSwitch = data;
    },
    Add: (params: any) => {
        const { datas, orgCode } = params;
        initFormData(datas);
        handleAddDisNo(datas);
        datas.isGenerate = false;
        datas.isPrint = true;
        datas.ruleForm.orgCode = orgCode;
        datas.isNumberCode = false;
        datas.isNumberSwitch = false;
    },
    Generate: (params: any) => {
        const { datas, result } = params;
        for (let key in result.data) {
            datas.ruleForm[key] = result.data[key];
        }
        datas.printList = [];
        datas.printList = result.printList;
        datas.isPrint = false;
        datas.isGenerate = true;
        handleGenerateDisYes(datas);
        datas.formData4[0].startDisabled = true;
    }
    // Print: (params: any) => {
    //     const { datas } = params;
    //     boxMarkListPrint(datas.printList, datas.printNumber);
    // }
};
