snow преди 2 години
родител
ревизия
eaf7b42557

+ 4 - 1
src/views/InvoiceSales/invoiceApply/components/approval-process/src/upload-invoice.vue

@@ -107,6 +107,10 @@ 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 [invCode, invNum, subtotal_amount, open_time] = chunks;
@@ -216,7 +220,6 @@ watchEffect(() => {
           v-model="scanInputValue"
           :rows="1"
           type="textarea"
-          maxlength="30"
           placeholder="扫码枪输入处"
           @keydown="handleScanKeydown"
         />

+ 12 - 14
src/views/InvoiceSales/invoiceApply/components/execl-files-upload/columns-config.ts

@@ -1,25 +1,23 @@
 const initheaders = [
-  "卖方公司编码",
-  "卖方公司名称",
   "发票申请编号",
   "发票类型",
   "发票代码",
   "发票号码",
-  "发票税前金额",
-  "开票日期",
-  "校验码"
+  "发票金额",
+  "发票税后金额",
+  "校验码",
+  "开票日期"
 ];
 
 export const mapProp = {
-  value0: "_1",
-  value1: "_2",
-  value2: "invNo",
-  value3: "inv_type",
-  value4: "inv_code",
-  value5: "inv_number",
-  value6: "inv_subtotal",
-  value7: "open_date",
-  value8: "check_code"
+  value0: "invNo",
+  value1: "inv_type",
+  value2: "inv_code",
+  value3: "inv_number",
+  value4: "inv_total",
+  value5: "inv_subtotal",
+  value6: "check_code",
+  value7: "open_date"
 };
 
 const columns = () => {

+ 4 - 15
src/views/InvoiceSales/invoiceApply/config/xls-template.ts

@@ -1,21 +1,10 @@
 export const template = {
-  卖方公司编码: "GS2203161855277894",
-  卖方公司名称: "北京万宇恒通国际科贸有限公司",
   发票申请编号: "INV20210712w0vHkk",
   发票类型: "增值税电子普通发票",
   发票代码: "011002000711",
   发票号码: "51678540",
-  发票税前金额: "4900",
-  开票日期: "2020-12-17",
-  校验码: ""
-};
-
-export const template_electronics = {
-  卖方公司编码: "GS2203161855277894",
-  卖方公司名称: "北京万宇恒通国际科贸有限公司",
-  发票申请编号: "INV20210712w0vHkk",
-  发票类型: "增值税电子普通发票",
-  发票号码: "51678540",
-  发票税后金额: "4900",
-  开票日期: "2020-12-17"
+  发票金额: "4900",
+  发票税后金额: "",
+  校验码: "",
+  开票日期: "2020/12/17  0:00:00"
 };

+ 4 - 6
src/views/InvoiceSales/invoiceApply/index.vue

@@ -12,7 +12,7 @@ import { useAsync } from "/@/hooks/core/useAsync";
 import ExeclUpload from "./components/execl-files-upload/index.vue";
 import { ElMessage } from "element-plus";
 import { httpRequsetExport } from "/@/utils/export";
-import { template, template_electronics } from "./config/xls-template";
+import { template } from "./config/xls-template";
 import { writeFile, utils } from "xlsx";
 import { usePermission } from "/@/hooks/core/usePermission";
 
@@ -80,9 +80,7 @@ async function onDownloadOpenInv() {
 function onDownloadTemplate(electronics = false) {
   //创建数据表
   const workBook = utils.book_new();
-  const workSheet = utils.json_to_sheet([
-    !electronics ? template : template_electronics
-  ]);
+  const workSheet = utils.json_to_sheet([template]);
   utils.book_append_sheet(workBook, workSheet, "sheet");
 
   //导出模板
@@ -115,12 +113,12 @@ function onDownloadTemplate(electronics = false) {
           @click="() => onDownloadTemplate()"
           >下载发票信息导入模板</ElButton
         >
-        <ElButton
+        <!-- <ElButton
           v-if="hasPermissionWithCode('027')"
           :icon="useRenderIcon('arrow-down-line')"
           @click="() => onDownloadTemplate(true)"
           >下载发票信息导入模板(全电票)</ElButton
-        >
+        > -->
         <ElButton
           v-if="!isSuperUser && hasPermissionWithCode('028')"
           @click="() => execlUploadRef.onDisplay()"