Files
hazardousWaste_app/pages/uniqueCode/until.js

55 lines
1.1 KiB
JavaScript

export const getTypeParentNames = (val) => {
if (val) {
let value = val.replace("/", ",");
const arr = `${value}`.split(",");
return arr[arr?.length - 1];
}
};
const statusMenu = [
{
value: 0,
label: "初始化创建",
},
{
value: 1,
label: "已打印",
},
{
value: 2,
label: "已入库",
},
{
value: 3,
label: "已出库,",
},
{
value: 3,
label: "已配送,",
},
];
export const getStatusName = (val) => {
if (val) {
return statusMenu.find((i) => i.value == val)?.label || "";
}
return "";
};
// 唯一码修改 生成想要的对象 切勿解构对象 会覆盖前值 数据错误
export const getDetail = (info) => {
return {
materialName: info.materialName,
materialCode: info.materialCode,
materialShortName: info.materialShortName,
model: info.model,
specification: info.specification,
typeName: info.typeName,
unitName: info.unitName,
typeParentNames: info.typeParentNames,
description: info.description,
weight: info.weight,
kgFactor: info.kgFactor,
}
}