import request from '@/utils/request'
import { upcloud_base_item, upcloud_base_common, upcloud_base_chain, SERVICE_DATA_API_BASE } from "@/config/serviceSettings";

export function getCargoOwnerProp(cargoOwnerId) {
    return request({
        method: 'post',
        url: SERVICE_DATA_API_BASE + '/search',
        data: {
            num: 'getCargoOwnerProp',
            params: { cargoOwnerId: cargoOwnerId }
        }
    })
}
// <!-- 是否校验商品停售召回 -->'0' as vaildateItemInbound
export function vaildateItemPurchaseAndSales(items) {
    return request({
        method: 'post',
        url: upcloud_base_item + '/item/vaildatePurchaseAndSales',
        data: {
            'type': 'in',
            'queryMap': items.map(t => {
                return { 'itemId': t.id, 'refId': t.name, 'flag': false, 'message': '' };
            })
        }
    })
}
// <!-- 是否校验商品大类 -->'0' as vaildateItemCategory
export function vaildateItemCategory(items) {
    return request({
        method: 'post',
        url: upcloud_base_item + '/item/vaildateCategory',
        data: {
            'type': 'in',
            'queryMap': items.map(t => {
                return { 'itemId': t.id, 'refId': t.name, 'flag': false, 'message': '' };
            })
        }
    })
}
// <!-- 是否校验商品证照 -->'0' as vaildateItemLicense
export function vaildateItemCertificate(items) {
    return request({
        method: 'post',
        url: upcloud_base_item + '/item/batchVaildateCertificate',
        data: {
            'type': 'in',
            'queryMap': items.map(t => {
                return { 'itemId': t.id, 'refId': t.name, 'flag': false, 'message': '' };
            })
        }
    })
}
// <!-- 是否校验商品体积 -->'0' as vaildateItemVol
export function vaildateItemVolInfo(items) {
    return request({
        method: 'post',
        url: upcloud_base_item + '/item/vaildateVolInfo',
        data: {
            'type': 'in',
            'queryMap': items.map(t => {
                return { 'itemId': t.id, 'refId': t.name, 'flag': false, 'message': '' };
            })
        }
    })
}

// <!-- 是否校验供应商证照 -->'0' as vaildateSuppilerAndCustomer
export function vaildateSupplier(items) {
    return request({
        method: 'post',
        url: upcloud_base_chain + '/baseSupplierMst/v1.0/healthLicense/vaildateAllWeb',
        data: [{ 'delegationPartyId': items[0].shipperid, 'row': items[0].name }]
    })
}

// <!-- 是否校验客户证照 -->'0' as vaildateSuppilerAndCustomer
export function vaildateCustomer(items) {
    return request({
        method: 'post',
        url: upcloud_base_chain + '/baseCustomerMst/v1.0/healthLicense/vaildateAllWeb',
        data: items.map(t => {
            return [{ 'delegationPartyId': items[0].shipperid, 'row': items[0].name }];
        })
    })
}
// <!-- 是否校验货主证照 -->'0' as vaildateLicense
export function vaildateCargoOwnerLicense(items) {
    return request({
        method: 'post',
        url: upcloud_base_chain + '/baseCargoOwnerMst/v1.0/vaildate-license',
        data: {
            allVaildate: 1,
            cargoOwnerId: items[0].cargoOwnerId
        }
    })
}
// <!-- 是否校验货主经营范围 -->'0' as vaildateCargoOwnerScop
export function vaildateCargoOwnerScope(items) {
    return request({
        method: 'post',
        url: upcloud_base_chain + '/baseCargoOwnerMst/v1.0/vaildate-scope',
        data: {
            'cargoOwnerId': items[0].cargoOwnerId,
            'queryMap': items.map(t => {
                return { 'itemId': t.id, itemCategoryCode: t.categoryCode, 'refId': t.name, 'flag': false, 'message': '' };
            })
        }
    })
}


















