import http from '@/request/index.js';
export const state = {
	orderDelData: [] //采购计划详情数据
};
export const mutations = {
	setOrderDelsData(state, data) {
		state.orderDelData = data
	},
}
export const actions = {
	getTakingData({
		commit,
		rootState
	}, data) {
		return new Promise((resolve, reject) => {
			http('orderTaking.getData', {
				...data.pam,
			}, '加载中').then(res => {
				if (res.success == true) {
					data.that.$refs.paging.complete(res.data.records);
				}
			}).catch(e => {
				reject(e)
			})

		})
	},
	getOrderDetail({
		commit,
		rootState
	}, data) {
		return new Promise((resolve, reject) => {
			http('orderTaking.details', {
				...data,
				current: 1,
				size: 10000
			}, '加载中').then(res => {
				if (res.success == true) {
					commit('setOrderDelsData', res.data);
				}

			}).catch(e => {
				reject(e)
			})
		})
	},
}