examineAction.js 1.67 KB
Newer Older
wangcong committed
1 2
import typesBill from "../components-control/typesBill.vue";
import { getUUID } from "./util/lib.js";
3
import {setQueryTag} from './util/queryTag.js';
wangcong committed
4 5 6 7 8 9
export default {
  execute(context, param) {
    if (!param.billId || !param.viewName || !param.taskId) {
      context.dom.$Message.info("请配置跳转页面的参数");
      return;
    }
10 11 12 13
    const uuid = getUUID();
    const billState = param.canEdit ? '': 'readOnly'
    let index = context.selects[0]._index||(context.selects[0]._serialIndex)*1-1;
    setQueryTag(context.currentDataQueryConditionSet,index,param.viewName,uuid);//上张下张用 
wangcong committed
14 15
    let templateName = param.viewName;
    let billId = context.selects[0][param.billId];
16
    window.GMS.workflowTaskId = context.selects[0][param.taskId]
wangcong committed
17 18 19 20 21 22
    if (
      window.osConfig.appOpenMode &&
      window.osConfig.appOpenMode == "apploader"
    ) {
      GMS.$hideContainer.$portalAPI.emit(
        "open-new-page", //打开一个新的页签
23
        uuid,
wangcong committed
24 25 26 27
        "runner-bill-form",
        {
          templateName: templateName,
          id: billId,
28
          state: billState
wangcong committed
29 30 31
        },
        {
          openWay: "FUNCTAB",
32
          title: param.displayName || "单据审批",
wangcong committed
33 34 35
        }
      );
    } else {
qiaoyanqi committed
36 37 38
      let component = null;
      let name = GMS.$hideContainer.addComponent(typesBill, {}, function(c) {
        component = c;
wangcong committed
39 40
        c.templateName = templateName;
        c.billId = billId;
41
        c.state = billState;
wangcong committed
42 43
        c.init = true;
        c.modal_visible = true;
qiaoyanqi committed
44 45 46 47 48 49 50
        c.$nextTick(()=>{
          component.addListener({
            close: function() {
              GMS.$hideContainer.remove(name);
            }
          });
        })
wangcong committed
51 52 53 54
      });
    }
  },
};