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

import {UPCLOUD_RDC_TMS_BMS_SERVICE, UPCLOUD_RDC_TMS_MAINDATA_SERVICE, UPCLOUD_RDC_TMS_BUSINESS_SERVICE } from '@/config/serviceSettings.js'

const serviceName = UPCLOUD_RDC_TMS_MAINDATA_SERVICE


export const setMessageRead = (context,idList,item) => {
  return request({
    url: serviceName + '/message/read',
    method: 'post',
    data: { idList },
  }).then((response) => {
    if (response.success) {
      if (item) {
        item.whetherRead = 'Y'
        }
        context.$store?.dispatch('getCountMessage')


      } else {
        context.$exception(response)
      }
    })
}
export const resetPage = (context) => {
  context.$store.dispatch('getCountMessage')
  const { pageNum, pageSize } = context.remindData;
  context.loading = true;
  let params = { pageNum,pageSize,noticeType: context.openKeys[0], ...context.btnTabType[context.defBtn] }
  context.$store.dispatch('resetRemind', params).finally(() => {
    context.loading = false;
  });
};
export const setReadAll = (context,data) => {
  return request({
    url: serviceName + '/message/readAll',
    method: 'post',
    data,
  }).then((response) => {
      if (response.success) {
        context.$store?.dispatch('getCountMessage')
        resetPage(context)
      } else {
        context.$exception(response)
      }
    })
}
let obj = {

  '100': '未及时提货',
  '101': '未及时送达',
  '102': '未及时纸质回单'
}



