fix(pl): 司机回执缺品牌数量时仍保存单据,并按业务结果提示成败。

未填写品牌数量不再拦截照片和备注;已填写的品牌数量仍校验。小程序在 HTTP 200 的业务失败下不再弹出保存成功。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-11-06 23:57:34 +08:00
1 parent 13ed7f5be0
commit af79aa50a2
7 files changed
+97 -4

No files matched your search

+10 -1
View File
@@ -1,8 +1,9 @@
/**
* 地磅模块 HTTP(裸 JSON,非门户 code/data 信封)
* 地磅与运输小程序 HTTP。裸 JSON 原样返回;门户信封在 HTTP 200 下若 code 不是 200/0,按业务失败处理。
* 对齐 mobile-h5/src/utils/http/db.ts
*/
import { TOKEN_KEY, REFRESH_TOKEN_KEY, USER_INFO_KEY, resolveApiBase } from '@/config/api'
import { portalBusinessErrorMessage } from '@/utils/portalEnvelope'
const DB_COLLECTION_ROOT = /^\/(plans|inventory|weighing)$/
@@ -83,6 +84,14 @@ export function dbRequest(options = {}) {
return
}
if (status >= 200 && status < 300) {
const businessError = portalBusinessErrorMessage(data)
if (businessError) {
if (showError) {
uni.showToast({ title: businessError.slice(0, 40), icon: 'none' })
}
reject(new Error(businessError))
return
}
resolve(data)
return
}