|
@@ -1,7 +1,7 @@
|
|
|
<script setup lang="ts">
|
|
|
import { dayjs, ElForm, ElInput, ElMessage, UploadProps } from "element-plus";
|
|
|
import { ticketFormItems, ticketAddRules } from "../../config/configs";
|
|
|
-import { computed, ref, watch, nextTick } from "vue";
|
|
|
+import { computed, ref, watch, watchEffect } from "vue";
|
|
|
import { httpAdd } from "/@/api/purchase/ticketReturn";
|
|
|
import { useResponseHandle } from "/@/hooks";
|
|
|
import { httpImageUpload, baseUrl } from "/@/api/other";
|
|
@@ -71,6 +71,7 @@ function handleClose() {
|
|
|
}
|
|
|
|
|
|
function handleScanKeydown(evt: KeyboardEvent) {
|
|
|
+ console.log("123");
|
|
|
const { keyCode } = evt;
|
|
|
|
|
|
if (keyCode !== 13) return;
|
|
@@ -81,9 +82,8 @@ function handleScanKeydown(evt: KeyboardEvent) {
|
|
|
return (scanInputValue.value = "");
|
|
|
}
|
|
|
|
|
|
- const [_, ...chunks] = scanInputValue.value.split(",");
|
|
|
- const [invoiceType, invCode, invNumber, gold, open_time, checkNumber] =
|
|
|
- chunks;
|
|
|
+ const [_1, invoiceType, ...chunks] = scanInputValue.value.split(",");
|
|
|
+ const [invCode, invNumber, subtotal_amount, open_time, checkNumber] = chunks;
|
|
|
|
|
|
const year = open_time.slice(0, 4);
|
|
|
const month = open_time.slice(4, 6);
|
|
@@ -92,12 +92,12 @@ function handleScanKeydown(evt: KeyboardEvent) {
|
|
|
formData.value = {
|
|
|
invoiceType,
|
|
|
invCode,
|
|
|
- gold,
|
|
|
+ subtotal_amount,
|
|
|
open_time: dayjs(`${year}-${month}-${day}`).format("YYYY-MM-DD HH:mm:ss"),
|
|
|
invNumber,
|
|
|
checkNumber
|
|
|
};
|
|
|
- console.log(formData.value);
|
|
|
+
|
|
|
scanInputValue.value = "";
|
|
|
}
|
|
|
|
|
@@ -128,19 +128,15 @@ watch(
|
|
|
);
|
|
|
|
|
|
//增值税专票校验码不必填
|
|
|
-watch(
|
|
|
- () => formData.value,
|
|
|
- () => {
|
|
|
- nextTick(
|
|
|
- () =>
|
|
|
- (rules.value.checkNumber[0].required = formData.value.invName !== "01")
|
|
|
- );
|
|
|
- },
|
|
|
- {
|
|
|
- deep: true
|
|
|
- }
|
|
|
+watchEffect(
|
|
|
+ () =>
|
|
|
+ (rules.value.checkNumber[0].required = formData.value.invoiceType !== "01")
|
|
|
);
|
|
|
|
|
|
+const disabledDate = time => {
|
|
|
+ return time.getTime() > Date.now();
|
|
|
+};
|
|
|
+
|
|
|
defineExpose({
|
|
|
onDisplay: (_payNo: string) => {
|
|
|
visible.value = true;
|
|
@@ -214,6 +210,7 @@ defineExpose({
|
|
|
<template v-else-if="item.prop === 'open_time'">
|
|
|
<el-date-picker
|
|
|
v-model="formData[item.prop]"
|
|
|
+ :disabled-date="disabledDate"
|
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
placeholder="请输入开票日期"
|
|
|
/>
|