/*
 * @Author: rao jiaguan
 * @Date: 2021年10月21日10:34:23
 * @LastEditors: rao jiaguan
 * @Description: 
 */
export default {
	execute: function (context, param) {
		if (param) {
			let id
			context.selects.forEach(v=>{
				id = v[param.billId]
			})
			let params = {
					tableName: param.tableName ? param.tableName :null,
					field: param.field ?param.field:null,
					id:id ? id :null,
					define:param.billDefine ? param.billDefine :null,
                    value :param.updateDate ? param.updateDate :null,
                    baseDataName: param.baseDataName ?  param.baseDataName :null
			}
			GMS.$http.post(`/rbc/bill/action/updateField`, JSON.stringify(params),{ 
				headers: {
                post: {
                    "Content-Type": "application/json",
				}
		      	}
            }).then((res) => {
					if (res.status==200&&res.data.code==0) {
						GMS.vbus.$emit('custom-query-refresh');
						GMS.vbus.$emit('tab-count-refresh');
						GMS.vbus.$Message.success(param.successMessage);
					} else if(res.status==200&&res.data.code!=0) {
						GAMS.Common.messagePrompt(res.data.msg);
					} else {
						GAMS.Common.messagePrompt("失败");
					}
				});
		} else {
			GAMS.Common.messagePrompt('缺少参数');
		}
	}
}