import typesBill from "../components-control/typesBill.vue";
import { getUUID } from "./util/lib.js";
export default {
  execute(context, param) {
    GMS.queryObject = {//上张下张用
      currentDataQueryConditionSet: context.currentDataQueryConditionSet,
      index: context.selects[0]._index,
      templateName:param.viewName,
      isReadOnly:false
    }
    GMS.vbus.$off("cacheEcho");
    let templateName = param.viewName;
    let billId = context.selects[0][param.billId];
    if (
      window.osConfig.appOpenMode &&
      window.osConfig.appOpenMode == "apploader"
    ) {
      GMS.$hideContainer.$portalAPI.emit(
        "open-new-page", //打开一个新的页签
        getUUID(),
        "runner-bill-form",
        {
          templateName: templateName,
          id: billId,
        },
        {
          openWay: "FUNCTAB",
          title: "编辑单据",
        }
      );
    } else {
      GMS.$hideContainer.addComponent(typesBill, {}, function(c) {
        c.templateName = templateName;
        c.billId = billId;
        c.init = true;
        c.modal_visible = true;
      });
    }
  },
};
