
export default {
  execute(bill, param) {
    GMS.$hideContainer.$Modal.confirm({
      title: "提示",
      content: "确认删除吗？",
      loading: true,
      onOk: () => {
        this.billDeleted(bill, param);
      }
    })
  },
  billDeleted(bill, param) {
    GMS.$http.post(
      '/rbc/bill/action/deleteExpenceAccount', {
      billDefine: bill.getBillDefine(),
      billId: bill.getMasterData().getValue('id'),
      subTableNames: param.subTableNames? param.subTableNames: 'BXMXZB'
    }
    ).then((data) => {
      if (data.status == 200 && data.data.code == 0) {
        GMS.$hideContainer.$Modal.remove(); 
        GMS.$hideContainer.$Message.success('删除成功');
        GMS.vbus.$emit('change-form-state', {state: '', billId: null})
      } else {
        GMS.$hideContainer.$Modal.remove();
        GMS.$hideContainer.$Message.error(data.data.message);
      }
    })
  }
}