| | |
| | | |
| | | <script> |
| | | import { |
| | | addExemptionOrder, |
| | | addInsOrder, |
| | | addRawMaterOrderTemplate, delRawMaterOrderTemplate, |
| | | getInsOrder, |
| | |
| | | this.addObj.ifsInventoryId = this.customsInspection.id |
| | | this.noNeedCheckLoad = true |
| | | addExemptionOrder({ |
| | | str: JSON.stringify({ |
| | | insOrder: this.addObj, |
| | | list: JSON.stringify(sampleList.map(a => { |
| | | if (a.modelNum) { |
| | | // 根据x号判断型号参数与样品型号的拼接位置 |
| | | // 例如×4,就为500ML×4;4×,就为4×500ML |
| | | const index = a.modelNum.indexOf('×') |
| | | if (index === 0) { |
| | | a.model = a.model + a.modelNum |
| | | } else if (index === -1) { |
| | | a.model = a.model + '-' + a.modelNum |
| | | } else { |
| | | a.model = a.modelNum + a.model |
| | | } |
| | | insOrder: this.addObj, |
| | | list: sampleList.map(a => { |
| | | if (a.modelNum) { |
| | | // 根据x号判断型号参数与样品型号的拼接位置 |
| | | // 例如×4,就为500ML×4;4×,就为4×500ML |
| | | const index = a.modelNum.indexOf('×') |
| | | if (index === 0) { |
| | | a.model = a.model + a.modelNum |
| | | } else if (index === -1) { |
| | | a.model = a.model + '-' + a.modelNum |
| | | } else { |
| | | a.model = a.model + ((a.modelNum == null || a.modelNum == '' || a.modelNum == 'null') ? '' : ('-' + a.modelNum)) |
| | | a.model = a.modelNum + a.model |
| | | } |
| | | a.insProduct = a.insProduct.filter(b=>b.state === 1) |
| | | return a |
| | | })), |
| | | pairing: JSON.stringify(pairing) |
| | | }) |
| | | } else { |
| | | a.model = a.model + ((a.modelNum == null || a.modelNum == '' || a.modelNum == 'null') ? '' : ('-' + a.modelNum)) |
| | | } |
| | | a.insProduct = a.insProduct.filter(b=>b.state === 1) |
| | | return a |
| | | }), |
| | | pairing: pairing |
| | | }).then(res => { |
| | | this.noNeedCheckLoad = false |
| | | if (res.code == 201) return |
| | |
| | | this.addObj.ifsInventoryId = this.customsInspection.id |
| | | this.saveLoad = true |
| | | addInsOrder({ |
| | | str: JSON.stringify({ |
| | | insOrder: this.addObj, |
| | | list: JSON.stringify(sampleList.map(a => { |
| | | if (a.modelNum) { |
| | | // 根据x号判断型号参数与样品型号的拼接位置 |
| | | // 例如×4,就为500ML×4;4×,就为4×500ML |
| | | const index = a.modelNum.indexOf('×') |
| | | if (index === 0) { |
| | | a.model = a.model + a.modelNum |
| | | } else if (index === -1) { |
| | | a.model = a.model + '-' + a.modelNum |
| | | } else { |
| | | a.model = a.modelNum + a.model |
| | | } |
| | | insOrder: this.addObj, |
| | | list: sampleList.map(a => { |
| | | if (a.modelNum) { |
| | | // 根据x号判断型号参数与样品型号的拼接位置 |
| | | // 例如×4,就为500ML×4;4×,就为4×500ML |
| | | const index = a.modelNum.indexOf('×') |
| | | if (index === 0) { |
| | | a.model = a.model + a.modelNum |
| | | } else if (index === -1) { |
| | | a.model = a.model + '-' + a.modelNum |
| | | } else { |
| | | a.model = a.model + ((a.modelNum == null || a.modelNum == '' || a.modelNum == 'null') ? '' : ('-' + a.modelNum)) |
| | | a.model = a.modelNum + a.model |
| | | } |
| | | a.insProduct = a.insProduct.filter(b=>b.state === 1) |
| | | return a |
| | | })), |
| | | pairing: JSON.stringify(pairing) |
| | | }) |
| | | } else { |
| | | a.model = a.model + ((a.modelNum == null || a.modelNum == '' || a.modelNum == 'null') ? '' : ('-' + a.modelNum)) |
| | | } |
| | | a.insProduct = a.insProduct.filter(b=>b.state === 1) |
| | | return a |
| | | }), |
| | | pairing: pairing |
| | | }).then(res => { |
| | | this.saveLoad = false |
| | | if (res.code == 201) return |