| | |
| | | remark: '', |
| | | }); |
| | | |
| | | /** 未填写批号时生成唯一批号(前端生成,后端也可再覆盖) */ |
| | | const generateBatchNo = () => { |
| | | const d = new Date(); |
| | | const pad = (n) => String(n).padStart(2, "0"); |
| | | const ts = `${d.getFullYear()}${pad(d.getMonth() + 1)}${pad(d.getDate())}${pad(d.getHours())}${pad(d.getMinutes())}${pad(d.getSeconds())}`; |
| | | const r = Math.floor(Math.random() * 10000) |
| | | .toString() |
| | | .padStart(4, "0"); |
| | | return `PH${ts}${r}`; |
| | | }; |
| | | |
| | | const isShow = computed({ |
| | | get() { |
| | | return props.visible; |
| | |
| | | } |
| | | const payload = { ...formState.value }; |
| | | const bn = (payload.batchNo || "").trim(); |
| | | payload.batchNo = bn || generateBatchNo(); |
| | | payload.batchNo = bn; |
| | | |
| | | if (props.type === 'qualified') { |
| | | createStockInventory(payload).then(res => { |