import { axios } from '@/utils/request'
import { UPCLOUD_RDC_TMS_BUSINESS_SERVICE,UPCLOUD_RDC_TMS_MAINDATA_SERVICE } from '@/config/serviceSettings.js'
const serviceName = UPCLOUD_RDC_TMS_BUSINESS_SERVICE

// 调度
export const Dispatch = (data) => {
  return axios.post(serviceName + '/pending_dispatch/dispatch', data)
}

// 调度并审核
export const dispatch_review = (data) => {
  return axios.post(serviceName + '/pending_dispatch/dispatch_review', data)
}

// 分组调度
export const group_dispatch = (data) => {
  return axios.post(serviceName + '/pending_dispatch/group_dispatch', data)
}

// 分组调度并审核
export const group_dispatch_review = (data) => {
  return axios.post(serviceName + '/pending_dispatch/group_dispatch_review', data)
}

// 系统分组-查询
export const sys_group_query = (data) => {
  return axios.post(serviceName + '/pending_dispatch/sys_group_query', data)
}


export const getCarData = (context, plateNumber) => {
  return axios({
    url: UPCLOUD_RDC_TMS_MAINDATA_SERVICE + '/vehicle/popup',
    method: 'post',
    data: {
      plateNumber,
      pageNum:1,pageSize:10

    },
  }).then((response) => {
    if (response.success) {
      return response.data?.list[0] ?? null
    } else {
      context.$exception(response);
      return null

    }
  })
    .finally((error) => {
    });
};