import request from '@/utils/request'

// 查询上机列表
export function listUseRecord(query) {
	return request({
		url: '/tpmMould/useRecord/list',
		method: 'get',
		params: query
	})
}

// 查询上机详细
export function getUseRecord(id) {
	return request({
		url: '/tpmMould/useRecord/' + id,
		method: 'get'
	})
}

// 新增上机
export function addUseRecord(data) {
	return request({
		url: '/tpmMould/useRecord',
		method: 'post',
		data: data
	})
}

// 修改上机
export function updateUseRecord(data) {
	return request({
		url: '/tpmMould/useRecord',
		method: 'put',
		data: data
	})
}

// 删除上机
export function delUseRecord(id) {
	return request({
		url: '/tpmMould/useRecord/' + id,
		method: 'delete'
	})
}


// 夹具上机
export function bindMould(data) {
	return request({
		url: '/tpmMould/useRecord/bind',
		method: 'post',
		data: data
	})
}

// 夹具下机
export function unbindMould(data) {
	return request({
		url: '/tpmMould/useRecord/unbind',
		method: 'put',
		data: data
	})
}

//上模完成
export function endInstall(ids) {
	return request({
		url: '/tpmMould/useRecord/endInstall',
		method: 'post',
		data: ids
	})
}

//下模开始
export function startRemove(data) {
	return request({
		url: '/tpmMould/useRecord/startRemove',
		method: 'post',
		data: data
	})
}

//下模完成
export function endRemove(ids) {
	return request({
		url: '/tpmMould/useRecord/endRemove',
		method: 'post',
		data: ids
	})
}

// 查询可用上机列表
export function listUseRecordAvailable(query) {
	return request({
		url: '/tpmMould/useRecord/listAvailable',
		method: 'get',
		params: query
	})
}