import request from '@/utils/http'

//车辆列表
export function supplierVehicleList(data){
    return request({
        url:'/supplierAppV2/dispatchApp/user/supplierVehicleList',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//编辑车辆信息
export function saveVehicle(data){
    return request({
        url:'/supplierAppV2/dispatchApp/user/saveVehicle',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//车辆属性预判（行驶证OCR识别出车辆所有人后调用，命中服务商信息则锁定为自有车辆）
export function preJudgeVirtualVehicle(data){
    return request({
        url:'/supplierAppV2/dispatchApp/user/preJudgeVirtualVehicle',
        method:'POST',
        data
    })
}
//提交审批车辆信息
export function saveSupplierApproval(data){
    return request({
        url:'/supplier/approval/saveSupplierDriverVehicleApproval',
        method:'POST',
        contentType:'application/json',
        data
    })
}
/*车辆更改状态 /supplierAppV2/dispatchApp/user/enableVehicle*/
export function enableVehicle(data){
    return request({
        url:'/supplierAppV2/dispatchApp/user/enableVehicle',
        method:'POST',
        contentType:'application/json',
        data
    })
}

//编辑车辆信息
export function updateInsurance(data){
    return request({
        url:'/supplierAppV2/dispatchApp/user/updateInsurance',
        method:'POST',
        data
    })
}

// 获取车辆信息（用于修改时回显的值,只需传vehicleId）
export function getInfoById(data){
    return request({
        url:'/supplierAppV2/dispatchApp/user/getInfoById',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//删除车辆信息(只需传vehicleId)
export function deleteVehicle(data){
    return request({
        url:'/supplierAppV2/dispatchApp/user/deleteVehicle',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//车辆类型列表
export function vehicleTypeList(){
    return request({
        url:'/supplierAppV2/dispatchApp/user/vehicleTypeList',
        method:'POST'
    })
}
 // 服务商服务能力
export function supplierServiceTree(data){
    console.log('ddddddd0', data)
    return request({
        url:'/supplierAppV2/dispatchApp/user/supplierServiceTree',
        method:'POST',
        data
    })
}

// 服务商服务能力
export function supplierServicePartTree(data){
    return request({
        url:'/supplier/approval/getSupplierServiceTree',
        method:'POST',
        data
    })
}

// 申请加入
export function saveSupplier(data){
    return request({
        url:'/supplier/potential/save',
        method:'POST',
        data
    })
}

// 申请加入
export function auditSupplier(data){
    return request({
        url:'/supplier/potential/audit',
        method:'POST',
        data
    })
}

// 修改申请信息
export function getSupplierInfo(key){
    return request({
        url:'/supplier/potential/getById',
        method:'GET',
        params:key
    })
}

// 根据id查询潜在服务商
export function supplierSelectById(params){
    return request({
        url:'/supplier/potential/supplierSelectById',
        method:'GET',
        params
    })
}

// 获取企微二维码
export function getOrCodeInfo(data){
    return request({
        url:'/agg-api/wxcp/createContactQrCode',
        method:'POST',
        data
    })
}

// 获取是否添加企微结果
export function getContactQrCodeResult(data){
    return request({
        url:'/agg-api/wxcp/getContactQrCodeResult',
        method:'POST',
        data
    })
}

// 添加企微
export function updateWechatId(data){
    return request({
        url:'/supplier/potential/updateWechatId',
        method:'POST',
        data
    })
}

 //司机列表
export function driverList(data){
    return request({
        url:'/supplierAppV2/dispatchApp/user/driverList',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//编辑司机信息
export function saveDriver(data){
    return request({
        url:'/supplierAppV2/dispatchApp/user/saveDriver',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//司机停启用操作
export function enableAction(data){
    return request({
        url:'/supplierAppV2/dispatchApp/user/enableAction',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//工单对账列表
export function accountRecordList(data){
    return request({
        url:'/supplierAppV2/dispatchApp/accountRecord/accountRecordList',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//工单对账详情
export function getAccountRecordDetail(data){
    return request({
        url:'/supplierAppV2/dispatchApp/accountRecord/getAccountRecordDetail',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//工单对账计算金额（计算）
export function accountRecordCompute(data){
    return request({
        url:'/supplierAppV2/dispatchApp/accountRecord/accountRecordCompute',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//修改服务商记账信息 （提交记账）
export function updateAccountRecordInfo(data){
    return request({
        url:'/supplierAppV2/dispatchApp/accountRecord/updateAccountRecordInfo',
        method:'POST',
        contentType:'multipart/form-data',
        data
    })
}
// 查询工单记账图片
export function selectRecordPictureList(data){
    return request({
        url:'/supplierAppV2/dispatchApp/accountRecord/selectRecordPictureList',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//删除记账图片
export function deleteImage(data){
    return request({
        url:'/supplierAppV2/dispatchApp/accountRecord/deleteImage',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//新增记账图片 form-data
/*export function insertRecordPicture(data){
    return request({
        url:'/supplierAppV2/dispatchApp/accountRecord/insertRecordPicture',
        method:'POST',
        contentType:'multipart/form-data',
        data,
        // headers: {
        //     'Content-Type': 'multipart/form-data',
        // },
    })
}*/

//开票通知列表
export function notifyInvoiceList(data){
    return request({
        url:'/order/taskInvoiceBatch/selectPageList',
        method:'POST',
        data
    })
}
// contentType:'application/json',
//开票通知详情
export function notifyInvoiceDetail(data){
    return request({
        url:'/order/taskInvoiceBatch/selectById',
        method:'POST',
        data
    })
}
// 关联案件
export function getOrderListByInvoice(data) {
    return request({
        url:'/order/taskOrderCostHisRecord/selectPageList',
        method:'POST',
        data
    })
}

//  调度app获取新签列表
export function pageList(data){
    return request({
        url:'/supplierAppV2/dispatchApp/user/supplierTrainingMaterialsPageList',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//  司机app获取新签列表
export function driverTrainList(key){
    return request({
        url:'/supplier/supplierTraining/trainingTask',
        method:'GET',
        params:key
    })
}

//获取普通材料
export function getNormalList(key) {
    return request({
        url: '/supplier/supplierTraining/normalList',
        method: 'GET',
        params:key
    });
}
//获取培训材料
export function getTrainingList(key) {
    return request({
        url: '/supplier/supplierTraining/trainingList',
        method: 'GET',
        params:key
    });
}
//用户操作权限
export function userOperationPermissions(){
    return request({
        url:'/supplierAppV2/dispatchApp/user/userOperationPermissions',
        method:'POST',
    })
}

// 上传图片
export function uploadImage(data){
    return request({
        url:'/order/uploadImage',
        method:'POST',
        contentType:'multipart/form-data',
        data
    })
}

// 发票上传
export function uploadInvoice(data){
    return request({
        url:'/order/taskInvoiceBatch/saveInvoiceImagesAndIdentify',
        method:'POST',
        contentType:'multipart/form-data',
        data
    })
}

// 删除发票
export function deleteInvoice(data) {
    return request({
        url:'/order/taskInvoiceBatch/deleteInfo',
        method:'POST',
        contentType:'multipart/form-data',
        data
    })
}

// 生成财务批次
export function createBatch(data) {
    return request({
        url:'/order/taskInvoiceBatch/supplierCreateFinanceBatch',
        method:'POST',
        contentType:'application/x-www-form-urlencoded',
        data,
        testFlag: true
    })
}

// 开票信息列表
export function getFinanceBatchList(data) {
    return request({
        url:'/order/taskInvoiceFinanceBatch/selectFinanceBatchPageList',
        method:'POST',
        data,
    })
}

// 批次对应发票信息列表
export function financeInvoiceList(data) {
    return request({
        url:'/order/taskInvoiceBatch/selectInvoicePageList',
        method:'POST',
        data,
    })
}

// 查看发票
export function selectInvoiceDetailInfo(data) {
    return request({
        url:'/order/taskInvoiceBatch/selectInvoiceDetailInfo',
        method:'POST',
        data,
    })
}

// 填写快递
export function saveBatchCourierNumber(data) {
    return request({
        url:'/order/taskInvoiceBatch/supplierSaveBatchCourierNumber',
        method:'POST',
        data,
    })
}

// 获取服务商发票信息
export function getBillingInfo(url, data) {
    return request({
          url: url,
          method:'POST',
          contentType:'multipart/form-data',
          data
    })
}

// ocr 识别
export function ocrHandler(data){
    return request({
        url:'/agg-api/tencent-ocr/unifiedOCR',
        method:'POST',
        contentType:'application/json',
        data
    })
}
///agg-api/tencent-ocr/unifiedOCRWithCompress
export function unifiedOCRWithCompress(data){
    return request({
        url:'/agg-api/tencent-ocr/unifiedOCRWithCompress',
        method:'POST',
        contentType:'application/json',
        data
    })
}

export function getArea(data){
    return request({
        url:'/base/area/tree',
        method:'POST',
        data
    })
}

// 服务商是否培训
export function jumpPage(data){
    return request({
        url:'/supplierAppV2/dispatchApp/user/jumpPage',
        method:'POST',
        contentType:'application/json',
        data
    })
}
//发送确认参保
export function sendInsuranceEmail(){
    return request({
        url:'/supplierAppV2/dispatchApp/user/sendInsuranceEmail',
        method:'POST',
    })
}
// 判断服务商是否参保
export function isSendInsuranceEmail(){
    return request({
        url:'/supplierAppV2/dispatchApp/user/isSendInsuranceEmail',
        method:'POST',
    })
}
