whycq
2023-12-01 6196d5efa014fc9d16227d5c77f20758c802715f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
*    添加物料
*     mat -- 物料详情
*     matList -- 已添加物料
*/
function matCheck(mat, matList) {
    let newMatList = [],
        add = true;
    if (matList.length > 0) {
        for (let item of matList) {
            if (item.matnr == mat.matnr) {
                if (item.batch == mat.batch) {
                    add = false
                    item.count = item.count + mat.count
                } else {
 
                }
            }
 
        }
    }
    if (add) {
        matList.unshift(mat)
    }
    return matList
}
module.exports = {
    matCheck: matCheck,
}