// 计算百分比
var pre=(a,b)=>{return (a/b*100).toFixed(2)+'%' }
var isFloat = false;
var arr=['CM2','G','KG','L','M','M2','ML','MM'];
isFloat = arr.includes(返回的物料单位);
let caltime =(oneKilometerTimeInSeconds)=>{ return `如果一公里用时为 ${oneKilometerTimeInSeconds} 秒 ,马拉松成绩为${Math.floor((oneKilometerTimeInSeconds * 42.195) / 3600)}小时${Math.floor(((oneKilometerTimeInSeconds * 42.195) % 3600) / 60)}分钟${Math.floor(((oneKilometerTimeInSeconds * 42.195) % 3600) % 60)}秒`;
}
var state = true;
var count=0;
var count2=0;
for(var k =0; k < selelist.length; k++ ){
var contA=selelist[k].MaterialCode.indexOf("A");
console.log(contA);
if(contA!=-1){
count=count+1;
}
var countB=selelist[k].MaterialCode.indexOf("B");
if(countB!=-1){count2=count2+1;}
}
if(count!=selelist.length&count2!=selelist.length){state = false;}
-- 截取@u后面的字符 特殊格式二维码,@u后面是uid
let pn=(a)=>{ if(a.indexOf("@U")!=-1){ return a.slice(a.indexOf("@U")+2)}else{return a}}
let pnuid=(a)=>{if(a.split('@').length==7){return a.slice(0,(a.indexOf('@'))); }else{return a;} }
var relationObj={
"ALL" :"全部" ,
"delivery" :"送货单",
"receive" :"收料单" ,
"material_instock" :"入库单" ,
"warehouse_return" :"仓退单" ,
"pick" :"发料单" ,
"production_return_intosetof" :"生产退料单" ,
"transfer" :"调拨单" ,
"material_pandian" :"盘点单" ,
"googs_instock" :"完工入库单" ,
"shipment" :"出货单" ,
"sale_return" :"销售退货单" ,
"Lend_out" :"借出单" ,
"Borrow" :"借入单" ,
"Lend_and_return" :"借出归还单" ,
"Borrow_and_return" :"借入归还单" ,
"outsourced_return" :"委外退货单" ,
"scrap_reveive_other" :"报废单" ,
"GetMateOut" :"零星物料领用作业" ,
"GetMateba" :"内部物料退库作业" ,
"GetMkorba" :"托工物料重工作业" ,
"GetBaord" :"订单退货处理作业"
}
let re_value=(name)=>{return relationObj[name];}
encodeURIComponent(newsernumber)
称重只取数字部分
var OnlyWeightNum=(weight)=>{ return parseFloat(weight.match(/\d+\.?\d+/g).join(""))}
作者:王世杰 创建时间:2023-09-05 13:38
最后编辑:王世杰 更新时间:2024-12-16 16:07
最后编辑:王世杰 更新时间:2024-12-16 16:07