/*
 * @Author: shi ZongLiang
 * @Date: 2021-07-26 16:34:15
 * @LastEditors: shi ZongLiang
 * @Description: 
 */
export default {
	execute: function (context, param) {
		if (param&&param.updatebillState) {
			let id
			context.selects.forEach(v=>{
				id = v[param.billId]
			})
			let params = {
					table:'CNSFK_H',
					field:"BILLSTATECASH",
					id:id,
					define:param.billDefine,
					mdtablename:'MD_BILLSTATE_CASH'
			}
			GMS.$http.post(`/rbc/bill/action/change/work/${param.updatebillState}`, params)
				.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('出纳成功');
					} else if(res.status==200&&res.data.code!=0) {
						GAMS.Common.messagePrompt(res.data.msg);
					} else {
						GAMS.Common.messagePrompt("失败");
					}
				});
		} else {
			GAMS.Common.messagePrompt('缺少参数');
		}
	}
}