import request from '@/utils/request';
import qs from 'qs';
import { upcloud_base_wh_outbound ,upcloud_base_wh } from "@/config/serviceSettings";

//是否完成扫描监管码
export function isSupervised(parameter) {
  return request({
    method: 'post',
    url: upcloud_base_wh_outbound + '/supervisionCode/isSupervised',
    data: parameter
  })
}



/* 拣选任务/索取任务(零货拣货) post */
export function picktask_create_pickorder(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/create-pickorder',
    method: 'post',
    data: params
  })
}

/* 拣选任务/拣选单分页查询 get(零货拣货) */
export function picktask_page_pickorder(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/page-pickorder',
    method: 'get',
    params: params,
	headers: {
	  'content-type': 'application/x-www-form-urlencoded'
	}
  })
}
/* 拣选任务/右侧拣选任务主表分页查询 get(零货拣货) */
export function list_picktaskh(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/list-picktaskh',
    method: 'get',
    params: params,
	headers: {
	  'content-type': 'application/x-www-form-urlencoded'
	}
  })
}
/* 拣选任务/右侧 拣选任务明细分页查询 get(零货拣货) */
export function list_picktaskd(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/list-picktaskd',
    method: 'get',
    params: params,
	headers: {
	  'content-type': 'application/x-www-form-urlencoded'
	}
  })
}

/* 请扫描容器码或输入后按回车绑定任务
	拣选任务-绑定容器(零货拣货) post */
export function picktask_bind_container(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/bind-container',
    method: 'post',
    data: params
  })
}

/* 请扫描容器码或输入后按回车绑定任务
	拣选任务-绑 绑定容器-功能库房 post post */
export function picktask_bind_container_mix(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/bind-container-mix',
    method: 'post',
    data: params
  })
}

/* 零货—— 任务确认/右侧列表 (零货)拣选确认 分页查询 get(零货拣货) */
export function page_picktask(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/page-picktask',
    method: 'get',
    params: params,
	headers: {
	  'content-type': 'application/x-www-form-urlencoded'
	}
  })
}

/* 任务索取 左侧——> 取消拣选单 GET get(零货拣货) */
export function cancel_pickorder(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/cancel-pickorder',
    method: 'get',
    params: params,
	headers: {
	  'content-type': 'application/x-www-form-urlencoded'
	}
  })
}

/* （共用零货拣货、整货拣货、功能库房拣货）拣货确认 post post */
export function picktask_confirm(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/picktask-confirm',
    method: 'post',
    data: params
  })
}

/* （共用零货拣货、整货拣货、功能库房拣货） 冲红确认 post */
export function picktask_confirm_red(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/picktask-confirm-red',
    method: 'post',
    data: params
  })
}

/* =====================================================
	索取任务(整件) POST 
*/
export function create_pickorder2(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/create-pickorder2',
    method: 'post',
    data: params
  })
}

/* 任务索取 (整件)拣选任务分页查询 GET */
export function page_picktaskall(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/page-picktaskall',
    method: 'get',
    params: params,
	headers: {
	  'content-type': 'application/x-www-form-urlencoded'
	}
  })
}

/*  公用(整件/功能库房 公用)待索取任务tab 分页查询 GET */
export function page_waitpicktask(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/page-waitpicktask',
    method: 'get',
    params: params,
	headers: {
	  'content-type': 'application/x-www-form-urlencoded'
	}
  })
}


/*  公用(功能库房任务索取tab1、功能库房任务确认tab2) 分页查询 */
export function page_mixpicktaskall(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/page-mixpicktaskall',
    method: 'get',
    params: params,
	headers: {
	  'content-type': 'application/x-www-form-urlencoded'
	}
  })
}

/* (功能库房 任务索取tab1) 索取任务 POST */
export function create_pickorder3(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/create-pickorder3',
    method: 'post',
    data: params
  })
}
/* (整单拣选 任务索取tab1) 索取任务 POST */
export function create_pickorder4(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/create-pickorder4',
    method: 'post',
    data: params
  })
}

/*  查询拣货工作量  POST */
export function picktask_count(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/picktask-count',
    method: 'post',
    data: params
  })
}


/*  扫描监管码 */
export function scan_warehouse(params) {
  return request({
    url: upcloud_base_wh + '/warehouse',
    method: 'get',
    params: params,
	headers: {
	  'content-type': 'application/x-www-form-urlencoded'
	}
  })
}


/* 打印拣货纸单 post (零货拣货/任务索取) post 
	"pickTaskType":"0-整件 1-零货 2-功能库房"
*/
export function picktask_print_paperslip(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/print-paperslip',
    method: 'post',
    data: params
  })
}

export function print_whole_labels(params) {
  return request({
    url: upcloud_base_wh_outbound + '/picktask/print-whole-labels',
    method: 'post',
    data: params
  })
}
// 整件拣货-任务确认-校验是否需要绑定容器,确认VO 列表
export function bindContainerValidate(params) {
    return request({
      url: upcloud_base_wh_outbound + '/picktask/pickTaskConfirmValidate',
      method: 'post',
      data: params
    })
  }
  
  // 整件拣货-任务确认-绑定容器
  export function bindContainer(params) {
    return request({
      url: upcloud_base_wh_outbound + '/picktask/bind-container',
      method: 'post',
      data: qs.stringify(params),
      headers: {
        'content-type': 'application/x-www-form-urlencoded'
      }
    })
  }
