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) {
				component = c;
				c.masterFieldsObj={};
				if(param.param && param.param.masterFields){
					param.param.masterFields.forEach(v=>{
						v.fieldBillRelation.forEach(item=>{
							if(item.targetField){
							   c.masterFieldsObj[item.targetField] = bill.getMasterData().getValue(item.targetField);
							}
						})
					})
				}
				c.bill = bill;
				c.actionParam = param;
				c.actionParam.param.viewArr.map(v=>v.title=v.title.split('[')[0])
				c.getAssetsModal();
				c.currentRowData = {};
				c.selectBill='';
				c.modal_visible = true;
				c.$nextTick(function () {
					component.addListener({
						close: function () {
							GMS.$hideContainer.remove(name);
						}
					});
				});
			});
		} else {
			GAMS.Common.messagePrompt('缺少参数');
		}
	}
}