searchBillAction.js 1 KB
Newer Older
wangcong committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
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('缺少参数');
		}
	}
}