// /**分页查询接口重试日志 */
import request from '@/utils/request'

import { UPCLOUD_RDC_TMS_MAINDATA_SERVICE, UPCLOUD_RDC_TMS_BUSINESS_SERVICE } from '@/config/serviceSettings.js'
const business = UPCLOUD_RDC_TMS_BUSINESS_SERVICE
//运输管理-待理货控制层
const serviceName = UPCLOUD_RDC_TMS_MAINDATA_SERVICE
export const adQueryUrl = business + '/waitPickUpGoods/advanced_query_shipbill'
export const advancedQueryUrl = business + '/waitPickUpGoods/advanced_query_shipbill'

export const mainTableInfoUrl = business + '/waitPickUpGoods/query_shipbill'
export const mainTableNextInfoUrl = business + '/waitPickUpGoods/query_receiver'

export const shipbillTableUrl = business + '/waitPickUpGoods/receiver_get_shipbill'

export const goodsTableUrl = business + '/waitPickUpGoods/item_detail'

export const packageTableUrl = business + '/waitPickUpGoods/package_detail'



//运输管理-待理货控制层/启运登记
export const feedBack = (_this, data, close) => {
  if (data.checkDetails) {
    data.checkDetails=data.checkDetails.join(',');
  }
  request({
    url: business + '/waitPickUpGoods/start_shipment',
    method: 'post',
    headers: {
      'Content-Type': 'application/json',
    },
    data,
  })
    .then((response) => {
      close()
      if (response.success) {
        _this.visible = false
        _this.clearChildrenTableAll()
        _this.$refs.mainTable.reload()

        _this.$message.success(response.message)
      } else {
        _this.$exception(response)
      }

      return resolve(response)
    })
    .catch((response) => {


    })
}



export const exportUrls = {
  allUrl: business + '/waitPickUpGoods/export_all_shipbill',
  currentUrl: business + '/waitPickUpGoods/export_page_shipbill',
  selectUrl: business + '/waitPickUpGoods/export_select_line_shipbill',
  ids: []

}
export const printUrl = business + '/waitPickUpGoods/print'

// 获取弹窗的商品数据
export const getDialogTableData = (data) => {
  return request({
    url: goodsTableUrl,
    method: 'post',
    data,
  })
}

// 是否显示启运温度
export const showTemperature = (data) => {
  return request({
    url: business + '/shipbill/showTemperature',
    method: 'post',
    data,
  })
}