|
@@ -85,13 +85,18 @@ struct emptyBoxStorage {
|
|
|
}
|
|
|
//确认添加
|
|
|
onConfirmAdd=async()=>{
|
|
|
+ const getBoxNumber = (boxId: string) => {
|
|
|
+ if (!boxId || !boxId.includes('-')) return '';
|
|
|
+ const numPart = boxId.split('-')[1];
|
|
|
+ return parseInt(numPart).toString(); // 关键修改:parseInt会自动去除前导零
|
|
|
+ };
|
|
|
let res: MaterialBoxInfo[] = await WmsRequest.post("/api/v1/wms/vehicle/add", {
|
|
|
capacity:100,
|
|
|
category:'0',
|
|
|
code:this.isManualGenerating?this.manualGeneratedId:this.materialBoxRfid,
|
|
|
- name: this.isManualGenerating
|
|
|
- ? `料箱${this.manualGeneratedId.split('-')[1]}`
|
|
|
- : this.materialBoxRfid.split('-')[1],
|
|
|
+ name: `料箱${getBoxNumber(
|
|
|
+ this.isManualGenerating ? this.manualGeneratedId : this.materialBoxRfid
|
|
|
+ )}`,
|
|
|
propertyCode:'',
|
|
|
universal:0
|
|
|
} as RequestParamModel);
|