export default {
    execute: function (bill, param) {
        bill.executeServerAction(param.param, function(code, data) {
            this.clearListener(bill, param);
            if (code === 200) {
                GMS.vbus.$emit('saveEcho', bill.getBuillData(),param);
                GMS.vbus.$Message.success(param.param.successMssage || "保存成功");
            } else if (code === 201) {
                GMS.vbus.$Message.error(data.message);
            } else if (code === 202) {
                if (data.responseJSON.message && data.responseJSON.message.startsWith("FLOW-")) {
                    GMS.vbus.$Message.error({
                        content: data.responseJSON.message,
                        duration: 3
                    });
                } else {
                    GMS.vbus.$Message.error("创建单据异常请联系管理员");
                }
            }
        }.bind(this));
    },
    clearListener(bill, param){
        bill.changeLoadingStatus(param.define, false);
        GMS.$hideContainer.$Spin.hide();
    }
}