import * as apiService from "@/common/api" // 打印模板是否支持了打印命令 const isSupportCommandType = (type = '')=> { let allType = type.split(",") let supportTypes = [ 'TAN-GC-130' // 子单模板 ] // 判断是否全支持 let isSupportAll = allType.filter(v=> supportTypes.indexOf(v) > -1).length == allType.length // return isSupportAll return true } export const getBillPrintData = async (params)=> { let imageUrl = [], prtCmdData = '' if(isSupportCommandType(params.printType)) { let cmdPrtRes = await apiService.getRealGetPrintCommandByApp({ ...params, _loading: true }) prtCmdData = cmdPrtRes.data } else { let imgPrtRes = await apiService.getRealGetWaybillPrintData({ ...params, _loading: true }) imageUrl = imgPrtRes?.data?.map(t=> t.imageUrl) || [] imageUrl = imageUrl.filter(v=> !!v) } return { imageUrl, prtCmdData } }