This commit is contained in:
@@ -124,7 +124,7 @@
|
||||
accept="image/*"
|
||||
content-type="image/jpeg"
|
||||
@uploading-change="voucherUploading = $event"
|
||||
@change="createFormRef?.validateField('payment_voucher_key')"
|
||||
@change="handleVoucherChange"
|
||||
/>
|
||||
</ElFormItem>
|
||||
<ElFormItem
|
||||
@@ -473,6 +473,7 @@
|
||||
const paymentMethodOptionsLoading = ref(false)
|
||||
const otherVoucherUploading = ref(false)
|
||||
const ocrLoading = ref(false)
|
||||
const recognizedVoucherKey = ref('')
|
||||
|
||||
// 搜索表单初始值
|
||||
const initialSearchState: AgentRechargeQueryParams = {
|
||||
@@ -1177,6 +1178,21 @@
|
||||
// 已上传的支付凭证对象键(OCR 识别取第一个)
|
||||
const offlineVoucherKeys = computed(() => toVoucherKeyList(createForm.payment_voucher_key))
|
||||
|
||||
// 凭证变更:校验字段,并对首次上传自动识别一次(已有流水号则跳过)
|
||||
const handleVoucherChange = (keys: string[] | string) => {
|
||||
createFormRef.value?.validateField('payment_voucher_key')
|
||||
const list = toVoucherKeyList(keys)
|
||||
const firstKey = list[0] || ''
|
||||
if (!firstKey) {
|
||||
recognizedVoucherKey.value = ''
|
||||
return
|
||||
}
|
||||
if (firstKey === recognizedVoucherKey.value) return
|
||||
recognizedVoucherKey.value = firstKey
|
||||
if (createForm.external_transaction_no?.trim()) return
|
||||
void handleRecognizeVoucher()
|
||||
}
|
||||
|
||||
// 识别付款凭证中的交易流水号:只做预填,失败不阻断人工填写
|
||||
const handleRecognizeVoucher = async () => {
|
||||
if (ocrLoading.value) return
|
||||
|
||||
Reference in New Issue
Block a user