import addInfoModal from '../components-control/add-info-modal.vue';
export default {
	execute: function (bill, param) {
		if (param) {
      delete GMS.editSubIndex;
      let component = null;
      let name = GMS.$hideContainer.addComponent(addInfoModal, {}, function (c) {
        component = c;
        c.bill = bill;
        let arr = bill.action.filter(v=>v.execute=="searchBillAction");
        let tableName = null;
				if(arr.length>0){
          c.actionParam = arr[0];
          tableName = arr[0].param.field[0].targetTableName;
        }
        
        if(param.param && param.param.tableName){
          tableName = param.param.tableName
        }
        let obj = c.getCurrentRowData(tableName);
        if(!obj['BILLNAME']){
          GAMS.Common.messagePrompt('缺少参数');
          return
        }
        c.selectBill = obj['BILLEDITNAME'];
        c.billId = obj['BILLID'];
        c.subBillData = obj.BILLDETAILOBJ;
        c.modal_visible = true;
        GMS.editSubIndex = bill.getSubFocus();
        console.log('param',param,obj);
      });
		} else {
			GAMS.Common.messagePrompt('缺少参数');
		}
	}
}