import { transaction, dict, file, FileApi,main } from '@/api'
import request from '@/utils/require'

// ;/transaction/addeeeinnorrrttxy / selectEntryAndExitOrder
// 场次下拉关联 - 没有关联场次de
export function selectEntryAndExitOrder(data) {
	return request({
		url: `${transaction}/entryandexitorder/selectEntryAndExitOrder`,
		method: 'post',
	})
}
// /transaction/entryandexitorder/selectEntryAndExitOrderBySite/{id}根据选择的场次获取对应数据
export function selectEntryAndExitOrderBySite(id) {
	return request({
		url: `${transaction}/entryandexitorder/selectEntryAndExitOrderBySite/${id}`,
		method: 'post',
	})
}
// //  /transaction/entryandexitorder/selectEntryAndExitOrder
// export function selectEntryAndExitOrder(id) {
// 	return request({
// 		url: `${transaction}/entryandexitorder/selectEntryAndExitOrder/${id}`,
// 		method: 'post',
// 	})
// }
// ;/transaction/trademark / selectList
// 获取场次列表
export function selectList(page, data) {
	return request({
		url: `${transaction}/trademark/selectList?pageNum=${page.pageNum}&pageSize=${page.pageSize}`,
		method: 'post',
		data: data || {},
	})
}
// ;/transaction/trademark / insertCC
// 场次 - 新增 标的号随之在后台生成
export function insertCC(data) {
	return request({
		url: `${transaction}/trademark/insertCC`,
		method: 'post',
		data: data,
	})
}

// transaction/trademark/selectCC/{id}场次查看
export function selectCC(id) {
	return request({
		url: `${transaction}/trademark/selectCC/${id}`,
		method: 'post',
	})
}
export function updateCC(data) {
	return request({
		url: `${transaction}/trademark/updateCC`,
		method: 'post',
		data: data,
	})
}
// /transaction/trademark/del/{id}
// 交易标的--查看--通过主键
export function delTrademark(id) {
	return request({
		url: `${transaction}/trademark/delCC/${id}`,
		method: 'delete',
	})
}
// 委托编码列表
export function selectwtList(data) {
	return request({
		url: `${transaction}/warehousingarrangement/select?pageNum=1&pageSize=100`,
		method: 'post',
		data: data || {},
	})
}
// ;/transaction/aadekmrrt / selectCode
// 生成场次 次数
export function selectCode() {
	return request({
		url: `${transaction}/trademark/selectCode`,
		method: 'post',
	})
}
// ;/transaction/aadekmrrt / valiCode场次 - 校验场次
export function valiCode(data) {
	return request({
		url: `${transaction}/trademark/valiCode?ccbm=${data.ccbm || ''}&cccode=${data.cccode}`,
		method: 'post',
	})
}

export function selectClickList(page, data) {
	return request({
		url: `${transaction}/transactionsignup/selectClickList?pageNum=${page.pageNum}&pageSize=${page.pageSize}`,
		method: 'post',
		data: data || {},
	})
}
//手动完成
export function clickTransactionSignUp(ccbm) {
	return request({
		url: `${transaction}/transactionsignup/clickTransactionSignUp/${ccbm}`,
		method: 'post',
	})
}

// 根据委托编码查标的信息
export function getBdInfo(wtbm) {
	return request({
		url: `${transaction}/entryandexitorder/v2/getDTO/${wtbm}`,
		method: 'get',
	})
}

// 交易底价列表
export function selectPage(data) {
  return request({
    url: `${transaction}/entryandexitorder/select`,
    method: 'post',
    data: data
  })
}

// 更新/编辑标的底价
export function updatePrice(data) {
  return request({
    url: `${transaction}/entryandexitorder/updatePrice`,
    method: 'put',
    data: data
  })
}

// 交易底价状态更新
export function updatePrice2NextNode(data) {
  return request({
    url: `${transaction}/entryandexitorder/updatePrice2NextNode`,
    method: 'put',
    data: data
  })
}

// 获取报名客户列表
export function customInfo(data) {
  return request({
    url: `${main}/jyccKhxx/selectKhxxByWtbh?ccId=${data}`,
    method: 'get',
  })
}
