goToDetail.js 2.04 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) {
            context.dom.$Message.info("请配置跳转页面的参数");
            return;
        }
10 11 12 13 14
        const uuid = getUUID();
        const templateName = context.selects[0][param.viewName];
        const index = context.selects[0]._index||(context.selects[0]._serialIndex)*1-1;

        setQueryTag(context.currentDataQueryConditionSet,index,templateName,uuid);//上张下张用 
wangcong committed
15 16 17 18 19 20
        if (
            window.osConfig.appOpenMode &&
            window.osConfig.appOpenMode == "apploader"
        ) {
            GMS.$hideContainer.$portalAPI.emit(
                "open-new-page", //打开一个新的页签
21
                uuid,
wangcong committed
22 23
                "runner-bill-form",
                {
24
                    templateName: templateName,
wangcong committed
25
                    id: context.selects[0][param.billId],
26 27
                    state: 'readOnly',
                    hideButtonGroup: param.hideButton? true: false
wangcong committed
28 29 30
                },
                {
                    openWay: "FUNCTAB",
31
                    title: param.displayName || "单据详情",
wangcong committed
32 33 34
                }
            );
        } else {
qiaoyanqi committed
35 36
            let component = null;
            let name = GMS.$hideContainer.addComponent(typesBill, {}, function (c) {
37
                c.templateName = templateName;
wangcong committed
38 39 40 41
                c.billId = context.selects[0][param.billId];
                c.init = true;
                c.modal_visible = true;
                c.isReadOnly = true
42
                c.state = 'readOnly'
qiaoyanqi committed
43 44 45 46 47 48 49 50 51
                c.hideButtonGroup = param.hideButton? true: false;
                component = c;
                c.$nextTick(()=>{
                    component.addListener({
                      close: function() {
                        GMS.$hideContainer.remove(name);
                      }
                    });
                })
wangcong committed
52 53 54 55
            })
        }
    }
}