feat: 新增产品表单(ml/g/颗)+配方卡片显示产品容量
All checks were successful
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 5s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 5s
PR Preview / deploy-preview (pull_request) Successful in 13s
Test / e2e-test (push) Successful in 50s

- 精油价目新增分两个tab:新增精油(标准容量) / 新增其他产品(ml/g/颗)
- saveOil支持unit参数
- 配方卡片:含产品的配方直接显示产品用量+单位(如30g)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 16:30:46 +00:00
parent 42993d47ee
commit 30bb69f52c
3 changed files with 65 additions and 11 deletions

View File

@@ -77,14 +77,16 @@ export const useOilsStore = defineStore('oils', () => {
oilsMeta.value = newMeta
}
async function saveOil(name, bottlePrice, dropCount, retailPrice, enName = null) {
await api.post('/api/oils', {
async function saveOil(name, bottlePrice, dropCount, retailPrice, enName = null, unit = null) {
const payload = {
name,
bottle_price: bottlePrice,
drop_count: dropCount,
retail_price: retailPrice,
en_name: enName,
})
}
if (unit) payload.unit = unit
await api.post('/api/oils', payload)
await loadOils()
}