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

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

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