|
@@ -1,12 +1,13 @@
|
|
|
<script setup lang="ts">
|
|
|
import { ElMessage, dayjs, ElForm } from "element-plus";
|
|
|
import { computed, reactive, ref, watchEffect } from "vue";
|
|
|
+import { input_type_list, open_type_list } from "../../../status";
|
|
|
+
|
|
|
import {
|
|
|
upload_invoice_rules,
|
|
|
jsRequiredKeys,
|
|
|
noPassRequiredKeys
|
|
|
} from "../../../config/configs";
|
|
|
-import { input_type_list, open_type_list } from "../../../status";
|
|
|
|
|
|
const props = defineProps<{
|
|
|
isElectronic: boolean;
|
|
@@ -44,7 +45,6 @@ const formData = reactive({
|
|
|
invCode: "",
|
|
|
invNum: "",
|
|
|
open_date: null,
|
|
|
- total_fee: 0,
|
|
|
subtotal_fee: 0,
|
|
|
checkCode: ""
|
|
|
});
|
|
@@ -58,7 +58,6 @@ function handleSaveStatus() {
|
|
|
status,
|
|
|
remark,
|
|
|
subtotal_fee,
|
|
|
- total_fee,
|
|
|
checkCode,
|
|
|
...otherParams
|
|
|
} = formData;
|
|
@@ -70,13 +69,6 @@ function handleSaveStatus() {
|
|
|
params = { status: "5", remark: formData.remark };
|
|
|
break;
|
|
|
default:
|
|
|
- if (
|
|
|
- Number(subtotal_fee) >= Number(total_fee) &&
|
|
|
- formData.open_type !== "1"
|
|
|
- ) {
|
|
|
- return ElMessage.error("税前金额不能大于或等于税后金额");
|
|
|
- }
|
|
|
-
|
|
|
if (formData.open_type === "1") {
|
|
|
//金税开票 -> 财务审核
|
|
|
params = { status: "1", open_type: "1", remark };
|
|
@@ -84,7 +76,6 @@ function handleSaveStatus() {
|
|
|
//线下开票
|
|
|
params = {
|
|
|
status: "1",
|
|
|
- total_fee: total_fee.toFixed(2),
|
|
|
subtotal_fee: subtotal_fee.toFixed(2),
|
|
|
...(checkCode ? { checkCode } : {}),
|
|
|
...otherParams
|
|
@@ -107,14 +98,17 @@ function handleScanKeydown(evt: KeyboardEvent) {
|
|
|
ElMessage.error("不能包含中文逗号");
|
|
|
return (scanInputValue.value = "");
|
|
|
}
|
|
|
+
|
|
|
if (scanInputValue.value.trim().length !== 70) {
|
|
|
ElMessage.error("扫码枪识别数据格式不正确,请重新扫描。");
|
|
|
return (scanInputValue.value = "");
|
|
|
}
|
|
|
|
|
|
- const [_1, _2, ...chunks] = scanInputValue.value.split(",");
|
|
|
+ const [_1, invoiceType, ...chunks] = scanInputValue.value.split(",");
|
|
|
const [invCode, invNum, subtotal_amount, open_time] = chunks;
|
|
|
|
|
|
+ console.log(invoiceType);
|
|
|
+
|
|
|
const year = open_time.slice(0, 4);
|
|
|
const month = open_time.slice(4, 6);
|
|
|
const day = open_time.slice(6);
|
|
@@ -122,7 +116,6 @@ function handleScanKeydown(evt: KeyboardEvent) {
|
|
|
formData.invCode = invCode;
|
|
|
formData.invNum = invNum;
|
|
|
formData.subtotal_fee = Number(subtotal_amount);
|
|
|
- formData.total_fee = Number(subtotal_amount);
|
|
|
formData.open_date = dayjs(`${year}-${month}-${day}`).format(
|
|
|
"YYYY-MM-DD HH:mm:ss"
|
|
|
);
|
|
@@ -166,7 +159,7 @@ watchEffect(() => {
|
|
|
<el-option label="不通过" value="5" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="开票类型" prop="open_type" v-if="!noPass">
|
|
|
+ <el-form-item label="开票方式" prop="open_type" v-if="!noPass">
|
|
|
<el-select
|
|
|
v-model="formData.open_type"
|
|
|
style="width: 100%"
|
|
@@ -276,7 +269,7 @@ watchEffect(() => {
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ <!-- <el-col :span="8">
|
|
|
<el-form-item label="税后金额" prop="total_fee">
|
|
|
<el-input-number
|
|
|
v-model="formData.total_fee"
|
|
@@ -287,7 +280,7 @@ watchEffect(() => {
|
|
|
:disabled="disabled"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
</el-row>
|
|
|
<div class="flex justify-end">
|
|
|
<el-button type="primary" @click="handleSaveStatus">保存</el-button>
|