feat(pl): 吨千克克和升毫升按固定比例折算用证量。
同质量或体积单位不再要求手填系数,普通 http 页面也能生成幂等操作号。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e7f942b399
commit
da3ec62719
21 files changed
+277
-43
No files matched your search
@@ -40,6 +40,7 @@
|
||||
import { ElMessage } from 'element-plus'
|
||||
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
|
||||
import { quotaCertApi, type CertType, type QuotaCert } from '@/api/pl/quota-cert'
|
||||
import { randomOperationId } from '@/utils/random-id'
|
||||
import './cert-mobile.scss'
|
||||
|
||||
const props = defineProps<{ row?: QuotaCert | null }>()
|
||||
@@ -57,7 +58,7 @@
|
||||
watch(
|
||||
() => props.row?.id,
|
||||
() => {
|
||||
opening.operationId = crypto.randomUUID()
|
||||
opening.operationId = randomOperationId()
|
||||
opening.usedQty = '0'
|
||||
opening.singleUseConsumed = false
|
||||
opening.reason = ''
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
} from '@/api/pl/quota-cert'
|
||||
import { formatCertQty } from '@/views/pl/quota-cert/model'
|
||||
import { getProductUnitLabel } from '@/utils/crm-product-display'
|
||||
import { randomOperationId } from '@/utils/random-id'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import './cert-mobile.scss'
|
||||
|
||||
@@ -131,7 +132,7 @@
|
||||
return
|
||||
}
|
||||
const signature = JSON.stringify({ id: cert.value.id, ...body })
|
||||
if (signature !== attempt.signature) attempt = { signature, id: crypto.randomUUID() }
|
||||
if (signature !== attempt.signature) attempt = { signature, id: randomOperationId() }
|
||||
saving.value = true
|
||||
try {
|
||||
await quotaAdjustmentApi.total(props.kind, cert.value.id, { ...body, operationId: attempt.id })
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
import { formatCertQty } from './model'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { getProductUnitLabel } from '@/utils/crm-product-display'
|
||||
import { randomOperationId } from '@/utils/random-id'
|
||||
function inputQty(value: unknown) {
|
||||
const text = formatCertQty(value)
|
||||
return text === '—' ? '' : text
|
||||
@@ -144,7 +145,7 @@
|
||||
const id = cert.value.id,
|
||||
type = kind.value,
|
||||
signature = JSON.stringify({ id, type, ...body })
|
||||
if (signature !== attempt.signature) attempt = { signature, id: crypto.randomUUID() }
|
||||
if (signature !== attempt.signature) attempt = { signature, id: randomOperationId() }
|
||||
saving.value = true
|
||||
try {
|
||||
await quotaAdjustmentApi.total(type, id, { ...body, operationId: attempt.id })
|
||||
|
||||
@@ -607,6 +607,7 @@
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { getProductUnitLabel } from '@/utils/crm-product-display'
|
||||
import { randomOperationId } from '@/utils/random-id'
|
||||
import { fetchGetMenuCodes } from '@/api/auth'
|
||||
import {
|
||||
quotaCertApi,
|
||||
@@ -1573,7 +1574,7 @@
|
||||
function openConfirm(row: QuotaCert) {
|
||||
confirmRow.value = row
|
||||
Object.assign(opening, {
|
||||
operationId: crypto.randomUUID(),
|
||||
operationId: randomOperationId(),
|
||||
usedQty: '0',
|
||||
singleUseConsumed: false,
|
||||
reason: '',
|
||||
|
||||
Reference in new issue
Block a user