import addInfoModal from '../components-control/add-info-modal.vue';
export default {
	execute: function (bill, param) {
		if (param) {
      let component = null;
      let name = GMS.$hideContainer.addComponent(addInfoModal, {}, function (c) {
        GMS.showDetailAction = true;//详情，点击确定按钮。记录此参数
        component = c;
        c.bill = bill;
        c.isReadOnly = true
        let tableName = null;
        if(param.param && param.param.tableName){
          tableName = param.param.tableName
        }
        let obj = c.getCurrentRowData(tableName);
        if(!obj['BILLNAME']&&tableName=='SRMXZB'){
          GAMS.Common.messagePrompt('此条数据没有详情信息');
          return
        }
        if(!obj['BILLNAME']){
          GAMS.Common.messagePrompt('无详情参数');
          return
        }
        c.showDetail = true; 
        c.selectBill = obj['BILLEDITNAME'].replace(/_E/ig, "_R");//后续创建了_R的单子再说吧
        //c.selectBill = obj['BILLEDITNAME'];
        c.billId = obj['BILLID'];
        c.subBillData = obj.BILLDETAILOBJ;
        c.modal_visible = true;
        console.log('param',param,obj);
      });
		} else {
			GAMS.Common.messagePrompt('无详情参数');
		}
	}
}