gh_cfProject.js 1.26 KB
Newer Older
1 2 3 4
/*
 * @Description:项目结转
 */
export default {
qiaoyanqi committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
  execute(context, param) {
    if (!param.billId || !param.billDefine) {
      context.dom.$Message.info("请配置查询单据参数");
      return;
    }
    if (context.selects && context.selects.length == 0) {
      context.dom.$Message.info("请勾择需要结转的数据");
      return;
    }
    let billDefine = param.billDefine
      .replace(/_E/gi, "")
      .replace(/_R/gi, "")
      .replace(/_A/gi, "");
    let list = context.selects.map((v) => {
      v.billDefine = billDefine;
      v.billId = v[param.billId];
      return v;
    });
    this.generateVoucher(list, context);
  },
  generateVoucher(list, context) {
    window.GMS.$http
      .post("/rbczgh/carryForward/project",list)
      .then((res) => {
qiaoyanqi committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
        if(res.data.code == 0){
          context.dom.$Modal.warning({
            title: "信息提示",
            content: res.data.message,
            onOk: () => {
              GMS.vbus.$emit("custom-query-refresh");
              GMS.vbus.$emit("tab-count-refresh");
            },
          });
        }else{
          context.dom.$Modal.warning({
            title: "信息提示",
            content: res.data.message,
            onOk: () => {},
          });
        }
qiaoyanqi committed
45 46 47
      });
  },
};