import request from '/@/utils/request';
import { AxiosPromise } from 'axios';
import type { ListBarcodesParams, ListBarcodes, UploadOrdersToLisParams, BatchUpdateExternalBarcodeParams } from './types';


/**
 * 查询外检推送条码号
 * @param params 
 * @returns 
 */
export function listBarcodesApi(params: ListBarcodesParams): AxiosPromise<ListBarcodes[]> {
    return request({
        url: '/lis/barcode/info/listBarcodes',
        method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        params
    })
}


/**
 * 外检推送用的（修改外部条码编号）
 * @param data 
 * @returns 
 */
export function lisBarcodeInfoUpdate(data: { code: string; externalBarcode: string; [key: string]: any}) {
    return request({
        url: '/lis/barcode/info/update',
        method: 'post',
        data
    })
}

/**
 * 外检推送用的（修改备注）
 * @param data 
 * @returns 
 */
export function lisBarcodeItemInfoUpdate(data: { code: string; remark: string; [key: string]: any}) {
    return request({
        url: '/lis/barcode/item/info/update',
        method: 'post',
        data
    })
}


/**
 * 推送条码号
 * @param params 
 * @returns 
 */
export function uploadOrdersToLisApi(params: UploadOrdersToLisParams) {
    return request({
        url: '/lis/barcode/info/uploadOrdersToLis',
        method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params
    })
}

/**
 * 批量修改外部条码号
 * @param params 
 * @returns 
 */
export function batchUpdateExternalBarcodeApi(params: BatchUpdateExternalBarcodeParams) {
    return request({
        url: '/lis/barcode/info/batchUpdateExternalBarcode',
        method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		params
    })
}