submitAction.js 2.17 KB
Newer Older
1 2 3
import Bridge from '../components-control/util/bridge'
import typesBill from '../components-control/typesBill.vue';

wangcong committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17
import { getUUID } from "../query-actions/util/lib";
export default {
  execute: function (bill, param) {
    let postData = {
      updatebillState: "2",
      actions: "workflow.submitToFlow"
    }
    if (bill) {
      bill.setControlsSate(param["_control_name_"], 'enable', false)
      bill.executeServerAction(postData, function (code, data) {
        bill.setControlsSate(param["_control_name_"], 'enable', true)
        if (code === 200) {
          const id = data.content.billData.id
          GMS.$hideContainer.$Message.success('提交成功');
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
          GMS.vbus.$emit("workflow-state-change", 90)
          // if (
          //   window.osConfig.appOpenMode &&
          //   window.osConfig.appOpenMode == "apploader"
          // ) {
          //   GMS.$hideContainer.$portalAPI.emit('nros-tag-close')
          //   GMS.$hideContainer.$portalAPI.emit(
          //     "open-new-page", //打开一个新的页签
          //     getUUID(),
          //     "runner-bill-form",
          //     {
          //       templateName: param.param.viewName,
          //       id,
          //       state:'readOnly'
          //     },
          //     {
          //       openWay: "FUNCTAB",
          //       title: "单据详情",
          //     }
          //   );
          // }
          // else {
          //   Bridge.vm.modal_visible = false
          //   GMS.$hideContainer.addComponent(typesBill, {}, function (c) {
          //     c.templateName = param.param.viewName;
          //     c.billId = id;
          //     c.init = true;
          //     c.modal_visible = true;
          //     c.isReadOnly = true
          //   })
          // }
wangcong committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62
        } else if (code === 201) {
          GMS.$hideContainer.$Spin.hide();
          GMS.$hideContainer.$Message.error("提交失败");
        } else if (code === 202) {
          GMS.$hideContainer.$Spin.hide();
          GMS.$hideContainer.$Message.error("暂存单据异常请联系管理员");
        }
      }.bind(this));
    } else {
      GMS.$hideContainer.$Spin.hide();
      alert('缺少参数');
    }
  }
}