import {
  get,
  post,
} from '@/common/utils/http-util.ts'

export default {
  paging(data: OrderTypes.SearchOrderParam) {
    return get<G.PageResult<OrderTypes.SearchOrderResult>>('/order/paging', data)
  },
  detail(id: string, orderType?: 'YuYue' | 'ShiShi' | 'LiShi' | 'QuXiao') {
    return get<OrderTypes.SearchOrderResult>('/order/detail', {id, orderType})
  },
  add(data: OrderTypes.AddOrderParam) {
    return post('/order/add', data)
  },
  modify(data: OrderTypes.ModifyOrderParam) {
    return post('/order/modify', data)
  },
  del(ids: string[]) {
    return post('/order/del', ids)
  },
  dispatch(data: OrderTypes.DispatchParam) {
    return post('/order/dispatch', data)
  },
  assignmentOrg(data: any) {
    return post('/order/assignmentOrg', data)
  },
  orderTrans(data: OrderTypes.SearchOrderParam) {
    return get<G.PageResult<OrderTypes.SearchOrderResult>>('/order_trans/paging', data)
  },
  assignmentDriver(data: OrderTypes.AssignmentDriver) {
    return post('/order/assignmentDriver', data)
  },
  truckComing(data: OrderTypes.TruckComingLeavingParam) {
    return post('/order/truck_coming', data)
  },
  truckLeaving(data: OrderTypes.TruckComingLeavingParam) {
    return post('/order/truck_leaving', data)
  },
  check(data: OrderTypes.CheckParam) {
    return post('/order/check', data)
  },
}
