// /**分页查询接口重试日志 */
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 mainTableInfoUrl = business + '/pending_receipt/shipbill_page'
export const mainTableNextInfoUrl = business + '/pending_receipt/consignee_page'
export const advancedQueryUrl = business + '/pending_receipt/advanced_query_shipbill'


export const shipbillTableUrl = business + '/pending_receipt/loading_shipbill'
export const goodsTableUrl = business + '/pending_receipt/loading_shipbill_detail	'
export const packageTableUrl = business + '/pending_receipt/loading_shipbill_package'

//运输管理-/ 回单确认 POST
export const completeArrangeGoods = (_this, data, close) => {
  let confirmLoading = true
  return new Promise((resolve) => {
    _this.$confirm({
      title: '是否回单确认?',
      confirmLoading,
      onOk(clear) {
        confirmLoading = true
        return request({
          url: business + '/pending_receipt/receipt_confirm	',
          method: 'post',
          data,
        })
          .then((response) => {
            close()
            _this.visible = false
            if (response.success) {
              clear()
              _this.clearChildrenTableAll()
              _this.$refs.mainTable.reload()
              _this.$message.success(response.message)
            } else {
              _this.$exception(response)
            }
            setTimeout(() => {
              confirmLoading = false
            }, 1000)
            return resolve(response)
          })
          .catch((response) => {
            _this.visible = false
            confirmLoading = false
          })
      },
    })
  })
}

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

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