import { BtnListType } from '@/common/components/btnList/interface';
import { QhjTradeGoodsPickup } from '@/services/go/ermcp/qhj/interface';

export function handleTableList(btnList: BtnListType[], record: QhjTradeGoodsPickup): BtnListType[] {
    // 1:备货中  完成备货
    // 2:待取货(自提) 确认取货
    // 4:待收货(邮寄) 上传物流信息、确认收货
    const arr: string[] = ['详情']
    switch (record.takeorderstatus) {
        case 1: // 1:备货中  完成备货
            arr.push('完成备货')
            break
        case 2: // 2:待取货(自提) 确认取货
            arr.push('确认取货')
            break
        case 4: // 4:待收货(邮寄) 上传物流信息、确认收货
            arr.push('上传物流')
            arr.push('确认收货')
            break
    }
    return btnList.filter((e) => arr.includes(e.lable));
}