import {customerOrderFinishPie, transportTypeOrderFinishPie} from '../../../api/apiList';

export const getTransportTypeOrderFinishPie = async (callback,date) => {
  let choiceMap = {
    '10': '汽运',
    '20': '铁运',
    '30': '水运',
    '50': '码头/仓库',
  }
  let resList = new Array();
  await transportTypeOrderFinishPie(date).then(function (res) {
    for (let key in choiceMap) {
      resList.push({name: choiceMap[key], value: res.data[key].cur_unit_weight});
    }
  });
  callback(resList);
  return resList
}
export const getCustomerOrderFinishPie = async (callback,date) => {

  let resList = new Array();
  await customerOrderFinishPie(date).then(function (res) {
    for (let key in res.data) {
      resList.push({name: key, value: res.data[key].cur_unit_weight});
    }
  });
  callback(resList);
  return resList
}
