Преглед изворни кода

Merge branch 'v3.0' into sit

snow пре 8 месеци
родитељ
комит
794d39a99a
34 измењених фајлова са 404 додато и 274 уклоњено
  1. 0 1
      src/api/invCategory/invCategory/index.ts
  2. 6 1
      src/components/PageContent/src/page-content.tsx
  3. 1 0
      src/components/PageContent/src/types.ts
  4. 0 0
      src/components/invCategory/invCategory/index.ts
  5. 0 2
      src/store/modules/user.ts
  6. 2 1
      src/views/InvoiceSales/capitalClaim/index.vue
  7. 9 2
      src/views/InvoiceSales/currentcyOrderRecord/detail.vue
  8. 1 1
      src/views/InvoiceSales/invoiceApply/components/execl-files-upload/columns-config.ts
  9. 16 6
      src/views/InvoiceSales/invoiceApply/components/execl-files-upload/index.vue
  10. 1 1
      src/views/InvoiceSales/invoiceApply/config/xls-template.ts
  11. 3 7
      src/views/InvoiceSales/invoiceApply/detail.vue
  12. 2 1
      src/views/InvoiceSales/invoiceApply/index.vue
  13. 104 0
      src/views/InvoiceSales/invoiceDetailImport/index.vue
  14. 73 0
      src/views/InvoiceSales/invoiceDetailImport/utils.ts
  15. 22 0
      src/views/dashboard/performanceReport/config/company.config.ts
  16. 1 1
      src/views/dashboard/performanceReport/config/wanyu.config.ts
  17. 12 7
      src/views/dashboard/performanceReport/config/wanyuCompletion.config.ts
  18. 29 0
      src/views/dashboard/performanceReport/config/wanyuType.config.ts
  19. 7 20
      src/views/dashboard/performanceReport/index.vue
  20. 0 1
      src/views/invCategory/invCategory/config/_options.ts
  21. 1 1
      src/views/invCategory/invCategory/config/content.config.ts
  22. 2 2
      src/views/invCategory/invCategory/index.vue
  23. 1 0
      src/views/purchase/orderRecord/config/xls-template.ts
  24. 1 1
      src/views/purchase/orderRecord/index.vue
  25. 4 2
      src/views/purchase/ticketReturn/components/execl-files-upload-inv/columns-config.ts
  26. 33 96
      src/views/purchase/ticketReturn/components/execl-files-upload-inv/index.vue
  27. 26 11
      src/views/purchase/ticketReturn/components/invoice-table.vue
  28. 5 6
      src/views/purchase/ticketReturn/index.vue
  29. 1 0
      src/views/supply/orderRecord/config/xls-template.ts
  30. 3 7
      src/views/supply/orderRecord/detail.vue
  31. 4 2
      src/views/supply/ticketReturn/components/execl-files-upload/columns-config.ts
  32. 29 91
      src/views/supply/ticketReturn/components/execl-files-upload/index.vue
  33. 2 2
      src/views/supply/ticketReturn/components/invoice-table.vue
  34. 3 1
      src/views/supply/ticketReturn/index.vue

+ 0 - 1
src/api/invCategory/invCategory/index.ts

@@ -3,7 +3,6 @@ import { loadEnv } from "@build/index";
 const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
 const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
 const userAPi = VITE_PROXY_DOMAIN_REAL;
 const userAPi = VITE_PROXY_DOMAIN_REAL;
 const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
 const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
-
 interface ResponseType extends Promise<any> {
 interface ResponseType extends Promise<any> {
   data?: object;
   data?: object;
   code?: number;
   code?: number;

+ 6 - 1
src/components/PageContent/src/page-content.tsx

@@ -236,7 +236,7 @@ const PageContent = defineComponent({
 
 
     function renderPureTable(size, checkList) {
     function renderPureTable(size, checkList) {
       const { contentConfig } = props;
       const { contentConfig } = props;
-      const { treeProps, rowKey, isTree,maxHeight, tableRowClassName } = contentConfig;
+      const { treeProps, rowKey, isTree,maxHeight,tableRowClassName, spanMethod } = contentConfig;
 
 
       return (
       return (
         <PureTable
         <PureTable
@@ -253,6 +253,11 @@ const PageContent = defineComponent({
           treeProps={treeProps}
           treeProps={treeProps}
           data={dataList.value}
           data={dataList.value}
           checkList={checkList}
           checkList={checkList}
+          maxHeight={ maxHeight ? maxHeight : '660px'}
+          paginationSmall={
+            size === "small" ? true : false
+          }
+          spanMethod={spanMethod? (data) => spanMethod(data, dataList.value) : undefined}
           rowClassName={tableRowClassName}
           rowClassName={tableRowClassName}
           maxHeight={ maxHeight ? maxHeight : '660px'}
           maxHeight={ maxHeight ? maxHeight : '660px'}
           paginationSmall={ size === "small" ? true : false }
           paginationSmall={ size === "small" ? true : false }

+ 1 - 0
src/components/PageContent/src/types.ts

@@ -13,6 +13,7 @@ import PageContent from "./page-content";
  * @param treeProps
  * @param treeProps
  */
  */
 export interface ContentConfig {
 export interface ContentConfig {
+  spanMethod?: any;
   title: string;
   title: string;
   transformCompany: boolean;
   transformCompany: boolean;
   maxHeight?: string;
   maxHeight?: string;

+ 0 - 0
src/components/invCategory/invCategory/index.ts


+ 0 - 2
src/store/modules/user.ts

@@ -290,8 +290,6 @@ export const useUserStore = defineStore({
 
 
                   data.forEach(e => {
                   data.forEach(e => {
                     e.child?.forEach(s => {
                     e.child?.forEach(s => {
-                      console.log(s.menu_route);
-
                       const item = {
                       const item = {
                         menu_route: (s.menu_route.split('_collection'))[0],
                         menu_route: (s.menu_route.split('_collection'))[0],
                         action: s.action
                         action: s.action

+ 2 - 1
src/views/InvoiceSales/capitalClaim/index.vue

@@ -171,7 +171,8 @@ async function onDownloadCapitalInfo() {
 
 
               <el-button 
               <el-button 
                 type="success" plain
                 type="success" plain
-               @click="() => onDownloadCapitalInfo()"
+                v-if="hasPermissionWithCode('057')"
+                @click="() => onDownloadCapitalInfo()"
                :loading="loading" 
                :loading="loading" 
                >
                >
                3.导出资金信息
                3.导出资金信息

+ 9 - 2
src/views/InvoiceSales/currentcyOrderRecord/detail.vue

@@ -9,8 +9,11 @@ import OrderForm from "./components/order-form.vue"
 import { useAsync } from "/@/hooks/core/useAsync";
 import { useAsync } from "/@/hooks/core/useAsync";
 import { httpStatus } from "/@/api/purchase/orderRecord";
 import { httpStatus } from "/@/api/purchase/orderRecord";
 import { DefaultApprovalNode } from "/@/components/ApprovalNode";
 import { DefaultApprovalNode } from "/@/components/ApprovalNode";
+import { useUserInfo } from "/@/hooks/core/useUser";
 
 
 const pageName = "currentcyOrderRecordDetail"
 const pageName = "currentcyOrderRecordDetail"
+const status = computed(() => formRef.value?.detail.status || "");
+const is_common = computed(() =>  formRef.value?.detail && String(formRef.value?.detail.is_comon) === '1');
 
 
 const status = computed(() => formRef.value?.detail.status || "");
 const status = computed(() => formRef.value?.detail.status || "");
 const { id, title, isDetail, collapses } = useDetail({
 const { id, title, isDetail, collapses } = useDetail({
@@ -21,6 +24,8 @@ const { id, title, isDetail, collapses } = useDetail({
 const { push } = useRouter();
 const { push } = useRouter();
 const loading = shallowRef(false);
 const loading = shallowRef(false);
 
 
+const { isSuperUser } = useUserInfo();
+
 const formRef = ref<InstanceType<typeof ReconciliationForm>>(null);
 const formRef = ref<InstanceType<typeof ReconciliationForm>>(null);
 const { run: approval } = useAsync({ success: () => formRef.value.refresh() });
 const { run: approval } = useAsync({ success: () => formRef.value.refresh() });
 const { hasPermissionWithCode } = usePermission(pageName);
 const { hasPermissionWithCode } = usePermission(pageName);
@@ -37,7 +42,7 @@ function handleApproval(data) {
 
 
 
 
 <template>
 <template>
-  <div class="padding__container">
+  <div class="padding__container" v-loading="loading">
     <ElTabs>
     <ElTabs>
       <ElTabPane :label="title">
       <ElTabPane :label="title">
         <ElCollapse v-model="collapses">
         <ElCollapse v-model="collapses">
@@ -46,9 +51,11 @@ function handleApproval(data) {
             <OrderForm v-else @create="() => push('/InvoiceSales/currentcyOrderRecord')" />
             <OrderForm v-else @create="() => push('/InvoiceSales/currentcyOrderRecord')" />
           </ElCollapseItem>
           </ElCollapseItem>
 
 
-          <ElCollapseItem name="2" title="买方公司业务审核" v-if="String(status) === '1' && hasPermissionWithCode('039')">
+          <template v-if="isDetail && !isSuperUser && is_common">
+            <ElCollapseItem name="2" title="买方公司业务审核" v-if="String(status) === '1' && hasPermissionWithCode('039')">
               <DefaultApprovalNode approveValue="2" rejectValue="3" @approval="handleApproval" />
               <DefaultApprovalNode approveValue="2" rejectValue="3" @approval="handleApproval" />
             </ElCollapseItem>
             </ElCollapseItem>
+          </template>
         </ElCollapse>
         </ElCollapse>
       </ElTabPane>
       </ElTabPane>
     </ElTabs>
     </ElTabs>

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

@@ -4,7 +4,7 @@ const initheaders = [
   "发票代码",
   "发票代码",
   "发票号码",
   "发票号码",
   "价税合计",
   "价税合计",
-  "发票金额",
+  "发票税前金额",
   "校验码",
   "校验码",
   "开票日期"
   "开票日期"
 ];
 ];

+ 16 - 6
src/views/InvoiceSales/invoiceApply/components/execl-files-upload/index.vue

@@ -73,6 +73,7 @@ const handleSubmit = async () => {
   const invErrors: any[] = [];
   const invErrors: any[] = [];
   const checkedErrors: any[] = [];
   const checkedErrors: any[] = [];
   const totalErrors: any[] = [];
   const totalErrors: any[] = [];
+  const subTotalErrors: any[] = [];
   const numberErrors: any[] = [];
   const numberErrors: any[] = [];
   const openErrors: any[] = [];
   const openErrors: any[] = [];
 
 
@@ -93,12 +94,7 @@ const handleSubmit = async () => {
 
 
   data.forEach((item, index) => {
   data.forEach((item, index) => {
     const { inv_type } = item;
     const { inv_type } = item;
-
-    console.log(item);
-
-    const invType = xs_inv_type_list.find(
-      ({ label }) => label === inv_type.trim()
-    );
+    const invType = xs_inv_type_list.find(({ label }) => label === inv_type.trim());
 
 
     if (invType) {
     if (invType) {
       item.inv_type = invType.value;
       item.inv_type = invType.value;
@@ -125,6 +121,14 @@ const handleSubmit = async () => {
        totalErrors.push(index + 1);
        totalErrors.push(index + 1);
     }
     }
 
 
+
+    if (
+      (item.inv_type === "fully_digitalized_special_electronic" || item.inv_type === "fully_digitalized_normal_electronic") &&
+      String(item.inv_subtotal).trim() === ""
+    ) { 
+      subTotalErrors.push(index + 1);
+    }
+
      if (
      if (
       (item.inv_type === "fully_digitalized_special_electronic" || item.inv_type === "fully_digitalized_normal_electronic") &&
       (item.inv_type === "fully_digitalized_special_electronic" || item.inv_type === "fully_digitalized_normal_electronic") &&
       String(item.open_date).trim() === ""
       String(item.open_date).trim() === ""
@@ -159,6 +163,12 @@ const handleSubmit = async () => {
     return;
     return;
   }
   }
 
 
+  // if (subTotalErrors.length > 0) {
+  //   ElMessage.error(`第 ${subTotalErrors.join(",")} 行,全电票发票税前金额不能为空`);
+  //   loading.value = false;
+  //   return;
+  // }
+
   if (openErrors.length > 0) {
   if (openErrors.length > 0) {
     ElMessage.error(`第 ${openErrors.join(",")} 行,全电票开票日期不能为空`);
     ElMessage.error(`第 ${openErrors.join(",")} 行,全电票开票日期不能为空`);
     loading.value = false;
     loading.value = false;

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

@@ -4,7 +4,7 @@ export const template = {
   发票代码: "011002000711",
   发票代码: "011002000711",
   发票号码: "51678540",
   发票号码: "51678540",
   价税合计: "4900",
   价税合计: "4900",
-  发票金额: "",
+  发票税前金额: "",
   校验码: "",
   校验码: "",
   开票日期: "2020/12/17  0:00:00"
   开票日期: "2020/12/17  0:00:00"
 };
 };

+ 3 - 7
src/views/InvoiceSales/invoiceApply/detail.vue

@@ -2,7 +2,6 @@
 import { shallowRef, computed, onMounted ,ref } from "vue";
 import { shallowRef, computed, onMounted ,ref } from "vue";
 import { useRoute, useRouter } from "vue-router";
 import { useRoute, useRouter } from "vue-router";
 import { useAsync, useResponseHandle } from "/@/hooks";
 import { useAsync, useResponseHandle } from "/@/hooks";
-import { examRecord } from "/@/components/examRecord";
 import Invoice from "/@/components/Invoice";
 import Invoice from "/@/components/Invoice";
 import { approvalProcess } from "./components/approval-process";
 import { approvalProcess } from "./components/approval-process";
 import InvoiceDetailVue from "./components/invoice-detail/index.vue";
 import InvoiceDetailVue from "./components/invoice-detail/index.vue";
@@ -174,10 +173,10 @@ onMounted(() => {
             <Invoice :inv-number="list[0].inv_number" type="sale" />
             <Invoice :inv-number="list[0].inv_number" type="sale" />
           </el-collapse-item>
           </el-collapse-item>
 
 
-          <template v-if="!isSuperUser">
+          <!-- <template v-if="!isSuperUser"> -->
             <el-collapse-item
             <el-collapse-item
-              :title="currentProcess.title"
               name="4"
               name="4"
+              :title="currentProcess.title"
               v-if="Object.keys(currentProcess).length && showApproval"
               v-if="Object.keys(currentProcess).length && showApproval"
             >
             >
               <component
               <component
@@ -190,12 +189,9 @@ onMounted(() => {
                 @change-status="handleChangeStatus"
                 @change-status="handleChangeStatus"
               />
               />
             </el-collapse-item>
             </el-collapse-item>
-          </template>
+          <!-- </template> -->
         </el-collapse>
         </el-collapse>
       </el-tab-pane>
       </el-tab-pane>
-      <!-- <el-tab-pane label="审批记录" name="2" v-if="!isCreate">
-        <examRecord :examCode="examCode" />
-      </el-tab-pane> -->
     </el-tabs>
     </el-tabs>
   </div>
   </div>
 </template>
 </template>

+ 2 - 1
src/views/InvoiceSales/invoiceApply/index.vue

@@ -131,8 +131,9 @@ function onDownloadTemplate() {
           @click="() => onDownloadTemplate()"
           @click="() => onDownloadTemplate()"
           >下载发票信息导入模板</ElButton
           >下载发票信息导入模板</ElButton
         >
         >
+
+        <!-- v-if="!isSuperUser && hasPermissionWithCode('028')" -->
         <ElButton
         <ElButton
-          v-if="!isSuperUser && hasPermissionWithCode('028')"
           @click="() => execlUploadRef.onDisplay()"
           @click="() => execlUploadRef.onDisplay()"
           size="small"
           size="small"
           >批量导入财务开票结果(发票申请)</ElButton
           >批量导入财务开票结果(发票申请)</ElButton

+ 104 - 0
src/views/InvoiceSales/invoiceDetailImport/index.vue

@@ -0,0 +1,104 @@
+<script setup lang="ts">
+import { ref } from "vue";
+import { httpUpload } from "/@/api/InvoiceSales/invoiceApply";
+import { responseHandle } from "/@/utils/responseHandle";
+import { execlUpload } from "/@/components/execlUpload";
+import { useNav } from "/@/layout/hooks/nav";
+import { ElMessage } from "element-plus";
+import dayjs from "dayjs";
+
+
+import { columns, isEmpty, isHeaderSame, generateTableData } from "./utils";
+
+
+const loading = ref(false);
+const tableData = ref([]);
+const { logout } = useNav();
+const emit = defineEmits(["onSuccess"]);
+
+const Uploadsuccess = ({ results, header }) => {
+  loading.value = true;
+
+  if (isEmpty(results)) {
+    ElMessage.error("表格无有效数据!");
+    loading.value = false;
+    return;
+  }
+
+  if(isHeaderSame(header)){
+    ElMessage.error("表头与导入模板不匹配!");
+    loading.value = false;
+    return;
+
+  }
+
+  tableData.value = generateTableData(results)
+  loading.value = false;
+};
+
+
+//提交
+const handleSubmit = async () => {
+  if (loading.value) return;
+  loading.value = true;
+
+  const data = ""
+
+  const { code, message } = await httpUpload({ data });
+  loading.value = false;
+  responseHandle({
+    code,
+    message,
+    logout,
+    handler: () => {
+      ElMessage.success("数据导入成功!");
+      emit("onSuccess");
+    }
+  });
+};
+
+const cancel = () => {
+  tableData.value = [];
+};
+</script>
+
+<template>
+  <div class="flex flex-col bg-white">
+    <execlUpload class="mb-[10px]" @on-success="Uploadsuccess" v-if="tableData.length === 0" />
+
+    <el-table
+      :data="tableData"
+      stripe
+      border
+      max-height="500px"
+      size="small"
+      style="width: 100%"
+    >
+      <el-table-column
+        v-for="(column, index) in columns"
+        v-bind="column"
+        :prop="(column.label === '序号' && index === 1) ? 'invNo' : column.prop"
+        :label="(column.label === '序号' && index === 1) ? '发票申请编号' : column.label"
+        :key="index"
+        show-overflow-tooltip
+      />
+    </el-table>
+    <div
+      flex
+      justify-end
+      gap-2
+      v-if="tableData.length !== 0"
+      style="padding: 10px 0 0 0"
+    >
+      <el-button size="small" @click="cancel">取消</el-button>
+      <el-button size="small" type="primary" :loading="loading" @click="handleSubmit">保存</el-button
+      >
+    </div>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+:deep(.el-upload-list__item) {
+  display: none !important;
+}
+</style>

+ 73 - 0
src/views/InvoiceSales/invoiceDetailImport/utils.ts

@@ -0,0 +1,73 @@
+export const initheaders = [
+  { label : "序号", width: '160px', prop:'invNo' },
+  { label : "发票代码",  width: '120px', prop: 'inv_code' },
+  { label : "发票号码",  width: '120px', prop:'inv_number' },
+  { label : "数电票号码",  width: '160px', prop: 'inv_number_electionic' },
+  { label : "销方识别号",  width: '160px', prop: 'seller_id' },
+  { label : "销方名称",  width: '120px', prop: 'seller_title' },
+  { label : "购方识别号",  width: '140px', prop: 'buyer_id' },
+  { label : "购买方名称",  width: '140px', prop: 'buyer_title' },
+  { label : "开票日期",  width: '140px', prop: 'open_date' },
+  { label : "货物或应税劳务名称",  width: '140px', prop: 'XMMC' },
+  { label : "规格型号",  width: '140px', prop: 'GGXH' },
+  { label : "单位",  width: '140px', prop: 'DW' },
+  { label : "数量",  width: '140px', prop: 'SPSL' },
+  { label : "单价",  width: '140px', prop: 'DJ' },
+  { label : "金额",  width: '140px', prop: 'JE' },
+  { label : "税率",  width: '140px', prop: 'SL' },
+  { label : "税额",  width: '140px', prop: 'SE' },
+  { label : "价税合计",  width: '140px', prop: 'JSHJ' },
+  { label : "发票来源",  width: '140px', prop: 'source' },
+  { label : "发票票种",  width: '140px', prop: 'inv_type' },
+  { label : "发票状态",  width: '140px', prop: 'status' },
+  { label : "是否正数发票",  width: '140px', prop: 'type' },
+  { label : "发票风险等级",  width: '140px', prop: 'warning' },
+  { label : "开票人",  width: '140px', prop: 'person' },
+  { label : "备注",  width: '140px', prop: 'remark' },
+];
+
+export const mapLabel2Field = initheaders.reduce((previous, current) => ({
+  ...previous,
+  [current.label]: current.prop
+}), {})
+
+console.log(mapLabel2Field)
+
+export const columns = [
+  { type: "index", width: "50", fixed: "left", label: "序号" },
+  ...initheaders
+]
+
+// 校验数据是否为空
+export const isEmpty = (results:any[]) => results.length === 0
+
+// 校验导入模板表头是否一致
+export function isHeaderSame(importHeader: any[]){
+  if(importHeader.length !== initheaders.length){
+    return false
+  }
+
+  for(const index in importHeader){
+    if(initheaders[index] !== importHeader[index]){ return false }
+  }
+
+  return true
+}
+
+
+// 生成导入数据
+export function generateTableData(results: any[]){
+  const tableData = []
+  for (const item of results) {
+    const tableItem = {}
+    const labels = Object.keys(item)
+    for(const label of labels){
+      const field = mapLabel2Field[label]
+      tableItem[field] = item[label]
+    }
+    tableData.push(tableItem)
+  }
+
+  console.log(tableData)
+  return tableData
+}

+ 22 - 0
src/views/dashboard/performanceReport/config/company.config.ts

@@ -52,6 +52,28 @@ const getDiffDay = function (date) {
   return totalDays // 相差的天数
   return totalDays // 相差的天数
 }
 }
 
 
+function getSpanNumber(data, prop) {
+  let length = Array.isArray(data) ? data.length : 0;
+  if (length > 0) {
+    let position = 0;
+    let temp = data[0][prop];
+    let result = [1];
+    for (let i = 1; i < length; i++) {
+      if (data[i][prop] == temp) {
+        result[position] += 1;
+        result[i] = 0;
+      } else {
+        position = i;
+        result[i] = 1;
+        temp = data[i][prop];
+      }
+    }
+    return result;
+  } else {
+    return [0];
+  }
+}
+
 const contentConfig = (companyNo): ContentConfig => ({
 const contentConfig = (companyNo): ContentConfig => ({
   title: "",
   title: "",
   superUserNoAction: false,
   superUserNoAction: false,

+ 1 - 1
src/views/dashboard/performanceReport/config/wanyu.config.ts

@@ -49,7 +49,7 @@ const columns = [
         label: "净销售完成率",
         label: "净销售完成率",
         prop: "pure_month_sale",
         prop: "pure_month_sale",
         cellRenderer({ row }) {
         cellRenderer({ row }) {
-          return row.monthinfo.monthProportion + '%'
+          return (row.monthinfo.monthProportion === 'Infinity' ? 0 : row.monthinfo.monthProportion) + '%'
         }
         }
       }
       }
     ]
     ]

+ 12 - 7
src/views/dashboard/performanceReport/config/wanyuCompletion.config.ts

@@ -49,7 +49,9 @@ const columns = [
         label: "净销售完成率",
         label: "净销售完成率",
         prop: "pure_month_sale",
         prop: "pure_month_sale",
         cellRenderer({ row }) {
         cellRenderer({ row }) {
-          return row.monthinfo.monthProportion + '%'
+          console.log(row.monthinfo.monthProportion)
+
+          return (row.monthinfo.monthProportion === 'Infinity' ?  0 : row.monthinfo.monthProportion) + '%'
         }
         }
       }
       }
     ]
     ]
@@ -104,19 +106,22 @@ const contentConfig: ContentConfig = {
             day: 0
             day: 0
           })
           })
 
 
+
           tableData = tableData.map(({ depart, total_tips, dayinfo, monthinfo }) => {
           tableData = tableData.map(({ depart, total_tips, dayinfo, monthinfo }) => {
             /* 月净销售 = 月销售 - 月退货 **/
             /* 月净销售 = 月销售 - 月退货 **/
             let monthNetSales = subtraction(monthinfo.msale_total, monthinfo.mth_total) as unknown as number
             let monthNetSales = subtraction(monthinfo.msale_total, monthinfo.mth_total) as unknown as number
             let dayNetSales = subtraction(dayinfo.sale_total, dayinfo.th_total) as unknown as number
             let dayNetSales = subtraction(dayinfo.sale_total, dayinfo.th_total) as unknown as number
             const supplierSalekey = Object.keys(mapCompanySupplierSale).find(key => key.includes(depart))
             const supplierSalekey = Object.keys(mapCompanySupplierSale).find(key => key.includes(depart))
             const supplierSaleDaykey = Object.keys(mapCompanySupplierSaleDay).find(key => key.includes(depart))
             const supplierSaleDaykey = Object.keys(mapCompanySupplierSaleDay).find(key => key.includes(depart))
-            if (supplierSalekey) { monthNetSales = addition(monthNetSales, mapCompanySupplierSale[supplierSalekey]) }
-            if (supplierSaleDaykey) { dayNetSales = addition(dayNetSales, mapCompanySupplierSaleDay[supplierSaleDaykey]) }
-            if (supplierSalekey === '北京普润心堂商贸有限公司') { monthNetSales = addition(monthNetSales, mapCompanySupplierSale['北京锦兴弘昌科技有限公司']) }
-            if (supplierSaleDaykey === '北京普润心堂商贸有限公司') { dayNetSales = addition(dayNetSales, mapCompanySupplierSaleDay['北京锦兴弘昌科技有限公司']) }
-
+           
+            if (supplierSalekey) {   monthNetSales = addition(monthNetSales, mapCompanySupplierSale[supplierSalekey] || 0) }
+            if (supplierSaleDaykey) { dayNetSales = addition(dayNetSales, mapCompanySupplierSaleDay[supplierSaleDaykey] || 0) }
+            if (supplierSalekey === '北京普润心堂商贸有限公司') {  monthNetSales = addition(monthNetSales, mapCompanySupplierSale['北京锦兴弘昌科技有限公司'] || 0) }
+            if (supplierSaleDaykey === '北京普润心堂商贸有限公司') { dayNetSales = addition(dayNetSales, mapCompanySupplierSaleDay['北京锦兴弘昌科技有限公司'] || 0) }
+            
             /* 月经销售完成率 = 月净销售 / 销售指标 **/
             /* 月经销售完成率 = 月净销售 / 销售指标 **/
             const monthProportion = multiplication(division(monthNetSales, total_tips), 100).toFixed(2)
             const monthProportion = multiplication(division(monthNetSales, total_tips), 100).toFixed(2)
+
             return {
             return {
               depart,
               depart,
               total_tips,
               total_tips,
@@ -131,7 +136,7 @@ const contentConfig: ContentConfig = {
             }
             }
           })
           })
 
 
-
+          console.log(tableData)
           resolve(tableData)
           resolve(tableData)
         }
         }
       })
       })

+ 29 - 0
src/views/dashboard/performanceReport/config/wanyuType.config.ts

@@ -46,9 +46,38 @@ const columns = [
   }
   }
 ];
 ];
 
 
+function getSpanNumber(data, prop) {
+  let length = Array.isArray(data) ? data.length : 0;
+  if (length > 0) {
+    let position = 0;
+    let temp = data[0][prop];
+    let result = [1];
+    for (let i = 1; i < length; i++) {
+      if (data[i][prop] == temp) {
+        result[position] += 1;
+        result[i] = 0;
+      } else {
+        position = i;
+        result[i] = 1;
+        temp = data[i][prop];
+      }
+    }
+    return result;
+  } else {
+    return [0];
+  }
+}
+
+
 const contentConfig: ContentConfig = {
 const contentConfig: ContentConfig = {
   title: "",
   title: "",
   superUserNoAction: false,
   superUserNoAction: false,
+  spanMethod({ row:_1, column:_2, rowIndex, columnIndex }: any, data: any[]){
+    if(Number(columnIndex) === 0){
+      let nameSpan = getSpanNumber(data, "depart");
+      return { rowspan: nameSpan[rowIndex],colspan: 1};
+    }
+  },
   handleData(data = []) {
   handleData(data = []) {
     return data.reduce((prev, current) => {
     return data.reduce((prev, current) => {
       const {
       const {

+ 7 - 20
src/views/dashboard/performanceReport/index.vue

@@ -75,10 +75,12 @@ const companyDimensionTotal = reactive(companies.reduce((prev,{companyNo}) => ({
 }),{}))
 }),{}))
 
 
 const getPlatformReportResult = function (data: Record<string, any>[] = [], property:string) {
 const getPlatformReportResult = function (data: Record<string, any>[] = [], property:string) {
+  console.log(data)
+
   platformDimensionTotal[property] = data.reduce((prev, current) => {
   platformDimensionTotal[property] = data.reduce((prev, current) => {
     const total_tips = addition(prev.total_tips, current.total_tips);
     const total_tips = addition(prev.total_tips, current.total_tips);
     const sale_total = addition(prev.sale_total, current.monthinfo.monthNetSales);
     const sale_total = addition(prev.sale_total, current.monthinfo.monthNetSales);
-    const completionRate = multiplication(division(sale_total, total_tips),100);
+    const completionRate = Number(Number(multiplication(division(sale_total, total_tips),100)).toFixed(2));
     return { total_tips, sale_total, completionRate };
     return { total_tips, sale_total, completionRate };
   }, initalTotal);
   }, initalTotal);
 };
 };
@@ -115,12 +117,6 @@ daytime.value = transformTime();
   <PageAuth :pageName="PageName">    
   <PageAuth :pageName="PageName">    
     <div class="bg-white">
     <div class="bg-white">
       <div w-full flex justify-end p-2 items-center>
       <div w-full flex justify-end p-2 items-center>
-        <!-- 
-          <ElButton class="mr-[10px]" type="primary" @click="() => isTenThound = !isTenThound;">
-            显示{{ isTenThound ? '元' : '万元' }}
-          </ElButton> 
-        -->
-
         <p class="mr-[5px]" style="font-weight:700">显示单位:</p>
         <p class="mr-[5px]" style="font-weight:700">显示单位:</p>
         <ElSwitch
         <ElSwitch
           class="mr-[15px]"
           class="mr-[15px]"
@@ -141,7 +137,7 @@ daytime.value = transformTime();
 
 
       <div class="ml-[15px]">
       <div class="ml-[15px]">
         <h2 style="font-size: 20px; font-weight: 700; margin-bottom: 10px">
         <h2 style="font-size: 20px; font-weight: 700; margin-bottom: 10px">
-          整体搞了
+        整体搞了
             {{ 
             {{ 
             isTenThound ? unit2TenThousand(platformDimensionTotal.wanyuCompletion.sale_total)  : (formatNumber(platformDimensionTotal.wanyuCompletion.sale_total))
             isTenThound ? unit2TenThousand(platformDimensionTotal.wanyuCompletion.sale_total)  : (formatNumber(platformDimensionTotal.wanyuCompletion.sale_total))
             }} 
             }} 
@@ -172,9 +168,7 @@ daytime.value = transformTime();
         :events="{content: { handleResult: data => getPlatformReportResult(data, 'wanyuCompletion') }}"
         :events="{content: { handleResult: data => getPlatformReportResult(data, 'wanyuCompletion') }}"
       />
       />
 
 
-      <h2
-        style="font-size: 20px; font-weight: 700; margin-bottom: 10px; margin-left: 15px; "
-      >
+      <h2 style="font-size: 20px; font-weight: 700; margin-bottom: 10px; margin-left: 15px; ">
         平台维度
         平台维度
       </h2>
       </h2>
 
 
@@ -205,11 +199,7 @@ daytime.value = transformTime();
           <PageContainer
           <PageContainer
             ref="wanyuReportRef"
             ref="wanyuReportRef"
             :contentConfig="wanyuConfig"
             :contentConfig="wanyuConfig"
-            :events="{
-              content: {
-                handleResult: data => getPlatformReportResult(data, 'wanyu')
-              }
-            }"
+            :events="{ content: { handleResult: data => getPlatformReportResult(data, 'wanyu') }}"
           />
           />
         </ElCol>
         </ElCol>
 
 
@@ -272,10 +262,7 @@ daytime.value = transformTime();
             ref="dashboardRef"
             ref="dashboardRef"
             :contentConfig="createCompanyConfig(company.companyNo)"
             :contentConfig="createCompanyConfig(company.companyNo)"
             :events="{
             :events="{
-              content: {
-                handleResult: data =>
-                  getCompanyReportResult(data, company.companyNo)
-              }
+              content: { handleResult: data => getCompanyReportResult(data, company.companyNo) }
             }"
             }"
           />
           />
         </ElCol>
         </ElCol>

+ 0 - 1
src/views/invCategory/invCategory/config/_options.ts

@@ -2,4 +2,3 @@ export const statusOptions = [
   { value: '2',label:'是', type:'success' },
   { value: '2',label:'是', type:'success' },
   { value: '3',label:'否', type:'warning' }
   { value: '3',label:'否', type:'warning' }
 ]
 ]
-

+ 1 - 1
src/views/invCategory/invCategory/config/content.config.ts

@@ -25,7 +25,7 @@ const columns = [
     prop: 'supplierName',
     prop: 'supplierName',
     minWidth: '80px',
     minWidth: '80px',
     cellRenderer({ row }){
     cellRenderer({ row }){
-      return row.tax[0]
+      return row.tax.join('、')
     }
     }
   },
   },
   {
   {

+ 2 - 2
src/views/invCategory/invCategory/index.vue

@@ -5,7 +5,7 @@ import searchConfig from "./config/search.config";
 
 
 import dayjs from "dayjs"
 import dayjs from "dayjs"
 
 
-const PageName = "invCategory";
+const pageName = "invCategory";
 
 
 const hooks: PageHooks = {
 const hooks: PageHooks = {
   pageSearchHook: () => usePageSearch((params = {}) => {
   pageSearchHook: () => usePageSearch((params = {}) => {
@@ -25,7 +25,7 @@ const hooks: PageHooks = {
 </script>
 </script>
 
 
 <template>
 <template>
-  <PageAuth :pageName="PageName">
+  <PageAuth :pageName="pageName">
     <PageContainer
     <PageContainer
       :hooks="hooks"
       :hooks="hooks"
       :contentConfig="contentConfig"
       :contentConfig="contentConfig"

+ 1 - 0
src/views/purchase/orderRecord/config/xls-template.ts

@@ -8,6 +8,7 @@ export const template = {
   发票代码: "",
   发票代码: "",
   发票号码: "",
   发票号码: "",
   发票税前金额: "",
   发票税前金额: "",
+  发票税后金额: "",
   开票日期: "",
   开票日期: "",
   "校验码": ""
   "校验码": ""
 };
 };

+ 1 - 1
src/views/purchase/orderRecord/index.vue

@@ -96,7 +96,7 @@ function onDownloadTemplate() {
     } else {
     } else {
       _data.push({
       _data.push({
         ...template,
         ...template,
-        ["对账编"]: payNo,
+        ["对账编"]: payNo,
         ['买方公司编码']: companyNo,
         ['买方公司编码']: companyNo,
         ["卖方公司编码"]: supplierNo,
         ["卖方公司编码"]: supplierNo,
         ['买方公司名称']: companyName,
         ['买方公司名称']: companyName,

+ 4 - 2
src/views/purchase/ticketReturn/components/execl-files-upload-inv/columns-config.ts

@@ -8,6 +8,7 @@ const initheaders = [
   "发票代码",
   "发票代码",
   "发票号码",
   "发票号码",
   "发票税前金额",
   "发票税前金额",
+  "发票税后金额",
   "开票日期",
   "开票日期",
   "校验码"
   "校验码"
 ];
 ];
@@ -22,8 +23,9 @@ export const mapProp = {
   value6: "invoiceCode",
   value6: "invoiceCode",
   value7: "invoiceNumber",
   value7: "invoiceNumber",
   value8: "inv_subtotal_amount",
   value8: "inv_subtotal_amount",
-  value9: "open_time",
-  value10: "checkNumber"
+  value9: "inv_total",
+  value10: "open_time",
+  value11: "checkNumber"
 };
 };
 
 
 export const requireHeaders = [];
 export const requireHeaders = [];

+ 33 - 96
src/views/purchase/ticketReturn/components/execl-files-upload-inv/index.vue

@@ -64,9 +64,7 @@ const Uploadsuccess = ({ results, header }) => {
   for (const v1 of results) {
   for (const v1 of results) {
     const b = Object.values(v1);
     const b = Object.values(v1);
     let model = {};
     let model = {};
-    b.forEach((si, sii) => {
-      model["value" + sii] = si + "";
-    });
+    b.forEach((si, sii) => { model["value" + sii] = si + ""; });
     tableData.value.push(model);
     tableData.value.push(model);
     row.value = row.value + 1;
     row.value = row.value + 1;
   }
   }
@@ -84,11 +82,13 @@ const Uploadsuccess = ({ results, header }) => {
       data.push(obj);
       data.push(obj);
     });
     });
 
 
+
     const typeErrors: string[] = [];
     const typeErrors: string[] = [];
     const checkErrors: string[] = [];
     const checkErrors: string[] = [];
     const codeErrors: string[] = [];
     const codeErrors: string[] = [];
     const numberErrors: string[] = [];
     const numberErrors: string[] = [];
     const priceErrors: string[] = [];
     const priceErrors: string[] = [];
+    const fullyElectionicPriceErrors: string[] = [];
 
 
     
     
   const openDateErrors: string[] = [];
   const openDateErrors: string[] = [];
@@ -112,25 +112,29 @@ const Uploadsuccess = ({ results, header }) => {
         }
         }
       }
       }
 
 
-      if(row.open_time && !dayjs(row.open_time).isSame(dayjs(now)) && !dayjs(row.open_time).isBefore(dayjs(now))){
+      const isFullyElectionic = row.invoiceType === 'fully_digitalized_special_electronic' || row.invoiceType === 'fully_digitalized_normal_electronic'
+
+      if(!row.open_time || (row.open_time && !dayjs(row.open_time).isSame(dayjs(now)) && !dayjs(row.open_time).isBefore(dayjs(now)))){
         openDateErrors.push(String(index + 1))
         openDateErrors.push(String(index + 1))
       }
       }
 
 
       const reg = /^\d+(\.\d+)?$/;
       const reg = /^\d+(\.\d+)?$/;
 
 
-      if (!reg.test(row.invoiceCode)) {
+      if (!reg.test(row.invoiceCode) && !isFullyElectionic) {
         codeErrors.push(String(index + 1));
         codeErrors.push(String(index + 1));
       }
       }
 
 
-
       if (!reg.test(row.invoiceNumber)) {
       if (!reg.test(row.invoiceNumber)) {
         numberErrors.push(String(index + 1));
         numberErrors.push(String(index + 1));
       }
       }
 
 
-      if (!reg.test(row.inv_subtotal_amount) || Number(row.inv_subtotal_amount) < 0) {
+      if ((!reg.test(row.inv_subtotal_amount) || Number(row.inv_subtotal_amount) < 0) && !isFullyElectionic) {
         priceErrors.push(String(index + 1));
         priceErrors.push(String(index + 1));
       }
       }
 
 
+      if ((!reg.test(row.inv_total) || Number(row.inv_total) < 0) && isFullyElectionic) {
+        fullyElectionicPriceErrors.push(String(index + 1));
+      }
     });
     });
 
 
     if (typeErrors.length > 0) {
     if (typeErrors.length > 0) {
@@ -183,17 +187,25 @@ const Uploadsuccess = ({ results, header }) => {
       return;
       return;
     }
     }
 
 
-    if (openDateErrors.length > 0) {
+    if (fullyElectionicPriceErrors.length > 0) {
       ElMessage({
       ElMessage({
         type: "error",
         type: "error",
-        message: `第 ${openDateErrors.join(",")} 行,开票日期不能超过当前日期`
+        message: `第 ${fullyElectionicPriceErrors.join(",")} 行,发票税后金额必须为数字且不能是负数`
       });
       });
       loading.value = false;
       loading.value = false;
       tableData.value = [];
       tableData.value = [];
       return;
       return;
     }
     }
 
 
-
+    if (openDateErrors.length > 0) {
+      ElMessage({
+        type: "error",
+        message: `第 ${openDateErrors.join(",")} 行,开票日期不能为空且不能超过当前日期`
+      });
+      loading.value = false;
+      tableData.value = [];
+      return;
+    }
   loading.value = false;
   loading.value = false;
 };
 };
 
 
@@ -202,12 +214,10 @@ const handleSubmit = async () => {
   try {
   try {
     if (loading.value) return;
     if (loading.value) return;
     loading.value = true;
     loading.value = true;
-
     const data = [];
     const data = [];
 
 
     tableData.value.forEach((key, index) => {
     tableData.value.forEach((key, index) => {
       const obj: Record<string, string> = {};
       const obj: Record<string, string> = {};
-
       for (let i in key) {
       for (let i in key) {
         const prop = mapProp[i];
         const prop = mapProp[i];
         const value = key[i];
         const value = key[i];
@@ -216,93 +226,11 @@ const handleSubmit = async () => {
       data.push(obj);
       data.push(obj);
     });
     });
 
 
-    console.log(data)
-
-    const typeErrors: string[] = [];
-    const checkErrors: string[] = [];
-    const codeErrors: string[] = [];
-    const numberErrors: string[] = [];
-    const priceErrors: string[] = [];
-
     data.forEach((row, index) => {
     data.forEach((row, index) => {
       const source = row.invoiceType.trim();
       const source = row.invoiceType.trim();
       const target = cg_inv_type_list.find(({ label }) => label === source);
       const target = cg_inv_type_list.find(({ label }) => label === source);
-
-      if (!target) {
-        typeErrors.push(String(index + 1));
-      } else {
-        row.invoiceType = target.value;
-
-        if (
-          (target.value === "normal" || target.value === "electronic") &&
-          !row.checkNumber
-        ) {
-          checkErrors.push(String(index + 1));
-        }
-      }
-
-      const reg = /^\d+(\.\d+)?$/;
-
-      if (!reg.test(row.invoiceCode)) {
-        codeErrors.push(String(index + 1));
-      }
-
-
-      if (!reg.test(row.invoiceNumber)) {
-        numberErrors.push(String(index + 1));
-      }
-
-      if (!reg.test(row.inv_subtotal_amount) || Number(row.inv_subtotal_amount) < 0) {
-        priceErrors.push(String(index + 1));
-      }
-
-    });
-
-    if (typeErrors.length > 0) {
-      ElMessage({
-        type: "error",
-        message: createInvErrorMessage(typeErrors.join(","))
-      });
-      loading.value = false;
-      return;
-    }
-
-    if (checkErrors.length > 0) {
-      ElMessage({
-        type: "error",
-        message: `第 ${checkErrors.join(",")} 行,校验码不能为空。`
-      });
-      loading.value = false;
-      return;
-    }
-
-    if (codeErrors.length > 0) {
-      ElMessage({
-        type: "error",
-        message: `第 ${codeErrors.join(",")} 行,发票代码必须为数字。`
-      });
-      loading.value = false;
-      return;
-    }
-
-
-    if (numberErrors.length > 0) {
-      ElMessage({
-        type: "error",
-        message: `第 ${numberErrors.join(",")} 行,发票号码必须为数字。`
-      });
-      loading.value = false;
-      return;
-    }
-
-    if (priceErrors.length > 0) {
-      ElMessage({
-        type: "error",
-        message: `第 ${priceErrors.join(",")} 行,发票税前金额必须为数字且不能是负数`
-      });
-      loading.value = false;
-      return;
-    }
+      row.invoiceType = target.value;
+    })
 
 
     const sellers = data.map(({ companyNo }) => companyNo);
     const sellers = data.map(({ companyNo }) => companyNo);
     const setSellers = [...new Set(sellers)];
     const setSellers = [...new Set(sellers)];
@@ -322,12 +250,21 @@ const handleSubmit = async () => {
     }
     }
 
 
     data.forEach(item => {
     data.forEach(item => {
+      const isFullyElectionic = item.invoiceType === 'fully_digitalized_special_electronic' || item.invoiceType === 'fully_digitalized_normal_electronic'
+
+      if(isFullyElectionic){
+        item.inv_subtotal_amount = item.inv_total
+      }
+
+      delete item['inv_total']
       delete item["supplierNo"];
       delete item["supplierNo"];
       delete item["supplierName"];
       delete item["supplierName"];
       delete item["companyName"];
       delete item["companyName"];
       delete item["companyNo"];
       delete item["companyNo"];
     });
     });
 
 
+
+
     const { code, message, data:_d } = await httpBatchAdd({
     const { code, message, data:_d } = await httpBatchAdd({
       list: data,
       list: data,
       is_comon: '0',
       is_comon: '0',

+ 26 - 11
src/views/purchase/ticketReturn/components/invoice-table.vue

@@ -26,16 +26,14 @@ function handleDelete({ $index }) {
       >添加</el-button
       >添加</el-button
     >
     >
   </div>
   </div>
+
   <el-table size="small" :data="invArr" border>
   <el-table size="small" :data="invArr" border>
     <el-table-column type="index" width="50" />
     <el-table-column type="index" width="50" />
-
-<!--    <el-table-column label="发票类型" prop="invType" show-overflow-tooltip>-->
-<!--      <template #="{ row }">-->
-<!--        <el-tag>{{-->
-<!--          inv_type_ls_cg.find(t => t.value === row.invType)?.label-->
-<!--        }}</el-tag>-->
-<!--      </template>-->
-<!--    </el-table-column>-->
+   <!-- <el-table-column label="发票类型" prop="invType" show-overflow-tooltip>
+     <template #="{ row }">
+       <el-tag>{{ inv_type_ls_cg.find(t => t.value === row.invType)?.label}}</el-tag>
+      </template>
+    </el-table-column> -->
 
 
     <el-table-column label="发票号码" prop="invNumber" show-overflow-tooltip />
     <el-table-column label="发票号码" prop="invNumber" show-overflow-tooltip />
     <el-table-column label="发票代码" prop="invCode" show-overflow-tooltip />
     <el-table-column label="发票代码" prop="invCode" show-overflow-tooltip />
@@ -51,10 +49,27 @@ function handleDelete({ $index }) {
         />
         />
       </template>
       </template>
     </el-table-column> -->
     </el-table-column> -->
-    <el-table-column label="税前金额" prop="subtotal_amount" />
-
+    <el-table-column label="税前金额" prop="subtotal_amount">
+      <template #="{ row }">
+        {{
+          row.invoiceType === 'fully_digitalized_special_electronic' || row.invoiceType === 'fully_digitalized_normal_electronic'
+            ? ''
+            : row.subtotal_amount
+       }}
+      </template>
+    </el-table-column>
+    <el-table-column label="税后金额" prop="subtotal_amount">
+      <template #="{ row }">
+        {{
+          row.invoiceType === 'fully_digitalized_special_electronic' || row.invoiceType === 'fully_digitalized_normal_electronic'
+            ? row.subtotal_amount
+            : ''
+       }}
+      </template>
+    </el-table-column>
+    
+    
     <el-table-column label="开票日期" prop="open_time" show-overflow-tooltip />
     <el-table-column label="开票日期" prop="open_time" show-overflow-tooltip />
-
     <el-table-column label="操作" width="60px">
     <el-table-column label="操作" width="60px">
       <template #="scope">
       <template #="scope">
         <el-button link type="primary" @click="() => handleDelete(scope)"
         <el-button link type="primary" @click="() => handleDelete(scope)"

+ 5 - 6
src/views/purchase/ticketReturn/index.vue

@@ -99,22 +99,21 @@ function onDownloadTemplate() {
     >
     >
       <template #content_table_header>
       <template #content_table_header>
         <p v-if="state.payNo || state.hpNo">
         <p v-if="state.payNo || state.hpNo">
-          合计:发票税前金额:{{ data.inv_subtotal_amount }},价税合计:{{
-            data.total
-          }}
+          合计:发票税前金额:{{ data.inv_subtotal_amount }},价税合计:{{ data.total }}
         </p>
         </p>
       </template>
       </template>
 
 
       <template #content_header>
       <template #content_header>
         <ElButton
         <ElButton
           size="small"
           size="small"
-          v-if="hasPermissionWithCode('017')"
-          :icon="useRenderIcon('arrow-down-line')"
           :loading="loading"
           :loading="loading"
           @click="() => handleDownload()"
           @click="() => handleDownload()"
+          v-if="hasPermissionWithCode('017')"
+          :icon="useRenderIcon('arrow-down-line')"
           >导出回票数据</ElButton
           >导出回票数据</ElButton
         >
         >
 
 
+
         <ElButton
         <ElButton
           size="small"
           size="small"
           v-if="hasPermissionWithCode('033') && !isSuperUser"
           v-if="hasPermissionWithCode('033') && !isSuperUser"
@@ -138,7 +137,7 @@ function onDownloadTemplate() {
           @click="() => onDownloadTemplate()"
           @click="() => onDownloadTemplate()"
           >
           >
             下载认证模板
             下载认证模板
-           </ElButton>
+          </ElButton>
       </template>
       </template>
 
 
       <template #content_action="row">
       <template #content_action="row">

+ 1 - 0
src/views/supply/orderRecord/config/xls-template.ts

@@ -8,6 +8,7 @@ export const template = {
   发票代码: "",
   发票代码: "",
   发票号码: "",
   发票号码: "",
   发票税前金额: "",
   发票税前金额: "",
+  发票税后金额: "",
   开票日期: "",
   开票日期: "",
   "校验码": ""
   "校验码": ""
 };
 };

+ 3 - 7
src/views/supply/orderRecord/detail.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
 <script setup lang="ts">
-import { ref, onMounted } from "vue";
+import { ref } from "vue";
 import { useDetail } from "/@/hooks/core/useDetail";
 import { useDetail } from "/@/hooks/core/useDetail";
 import { httpAdd } from "/@/api/purchase/orderRecord";
 import { httpAdd } from "/@/api/purchase/orderRecord";
 import ReconciliationForm from "/@/components/ReconciliationForm";
 import ReconciliationForm from "/@/components/ReconciliationForm";
@@ -12,7 +12,7 @@ import PrintOrderRecord from "/@/components/PrintOrderRecord";
 const { push } = useRouter();
 const { push } = useRouter();
 const { query } = useRoute();
 const { query } = useRoute();
 const formRef = ref<InstanceType<typeof ReconciliationForm>>(null);
 const formRef = ref<InstanceType<typeof ReconciliationForm>>(null);
-  const PrintOrderRecordRef = ref<InstanceType<typeof PrintOrderRecord> | null>(null);
+const PrintOrderRecordRef = ref<InstanceType<typeof PrintOrderRecord> | null>(null);
 
 
 const { id, title, isDetail, collapses } = useDetail({
 const { id, title, isDetail, collapses } = useDetail({
   baseName: "订单对账",
   baseName: "订单对账",
@@ -21,7 +21,7 @@ const { id, title, isDetail, collapses } = useDetail({
 
 
 const record = ref({})
 const record = ref({})
 const _loading = ref(false);
 const _loading = ref(false);
-const { hasPermissionWithCode, permissions } = usePermission("supplyOrderRecordDetail");
+const { hasPermissionWithCode } = usePermission("supplyOrderRecordDetail");
 
 
 const { run: create, loading } = useAsync({
 const { run: create, loading } = useAsync({
   success: () => push(`/supply/${query.isQuery ? "supplyOrderRecord" : "supplyOrderRecord"}`)
   success: () => push(`/supply/${query.isQuery ? "supplyOrderRecord" : "supplyOrderRecord"}`)
@@ -32,10 +32,6 @@ function handleCreate({ cids }: any) {
   create(httpAdd(params));
   create(httpAdd(params));
 }
 }
 
 
-onMounted(() => {
-  console.log(permissions.value);
-})
-
 async function onDownloadPayInfo() {
 async function onDownloadPayInfo() {
   await httpRequsetExport({
   await httpRequsetExport({
     url: "paycgdexport",
     url: "paycgdexport",

+ 4 - 2
src/views/supply/ticketReturn/components/execl-files-upload/columns-config.ts

@@ -8,6 +8,7 @@ const initheaders = [
   "发票代码",
   "发票代码",
   "发票号码",
   "发票号码",
   "发票税前金额",
   "发票税前金额",
+  "发票税后金额",
   "开票日期",
   "开票日期",
   "校验码"
   "校验码"
 ];
 ];
@@ -22,8 +23,9 @@ export const mapProp = {
   value6: "invoiceCode",
   value6: "invoiceCode",
   value7: "invoiceNumber",
   value7: "invoiceNumber",
   value8: "inv_subtotal_amount",
   value8: "inv_subtotal_amount",
-  value9: "open_time",
-  value10: "checkNumber"
+  value9: "inv_total",
+  value10: "open_time",
+  value11: "checkNumber"
 };
 };
 
 
 export const requireHeaders = [];
 export const requireHeaders = [];

+ 29 - 91
src/views/supply/ticketReturn/components/execl-files-upload/index.vue

@@ -34,7 +34,6 @@ const responseHandle = useResponseHandle();
 
 
 const Uploadsuccess = ({ results, header }) => {
 const Uploadsuccess = ({ results, header }) => {
   loading.value = true;
   loading.value = true;
-
   if (results.length === 0) {
   if (results.length === 0) {
     ElMessage.error("表格无有效数据!");
     ElMessage.error("表格无有效数据!");
     loading.value = false;
     loading.value = false;
@@ -63,9 +62,7 @@ const Uploadsuccess = ({ results, header }) => {
   for (const v1 of results) {
   for (const v1 of results) {
     const b = Object.values(v1);
     const b = Object.values(v1);
     let model = {};
     let model = {};
-    b.forEach((si, sii) => {
-      model["value" + sii] = si + "";
-    });
+    b.forEach((si, sii) => { model["value" + sii] = si + ""; });
     tableData.value.push(model);
     tableData.value.push(model);
     row.value = row.value + 1;
     row.value = row.value + 1;
   }
   }
@@ -83,13 +80,16 @@ const Uploadsuccess = ({ results, header }) => {
       data.push(obj);
       data.push(obj);
     });
     });
 
 
+
     const typeErrors: string[] = [];
     const typeErrors: string[] = [];
     const checkErrors: string[] = [];
     const checkErrors: string[] = [];
     const codeErrors: string[] = [];
     const codeErrors: string[] = [];
     const numberErrors: string[] = [];
     const numberErrors: string[] = [];
     const priceErrors: string[] = [];
     const priceErrors: string[] = [];
+    const fullyElectionicPriceErrors: string[] = [];
 
 
-    const openDateErrors: string[] = [];
+    
+  const openDateErrors: string[] = [];
   const now = dayjs(new Date()).format('YYYY-MM-DD');
   const now = dayjs(new Date()).format('YYYY-MM-DD');
 
 
     data.forEach((row, index) => {
     data.forEach((row, index) => {
@@ -109,25 +109,29 @@ const Uploadsuccess = ({ results, header }) => {
         }
         }
       }
       }
 
 
-      if(row.open_time && !dayjs(row.open_time).isSame(dayjs(now)) && !dayjs(row.open_time).isBefore(dayjs(now))){
+      const isFullyElectionic = row.invoiceType === 'fully_digitalized_special_electronic' || row.invoiceType === 'fully_digitalized_normal_electronic'
+
+      if(!row.open_time || (row.open_time && !dayjs(row.open_time).isSame(dayjs(now)) && !dayjs(row.open_time).isBefore(dayjs(now)))){
         openDateErrors.push(String(index + 1))
         openDateErrors.push(String(index + 1))
       }
       }
 
 
       const reg = /^\d+(\.\d+)?$/;
       const reg = /^\d+(\.\d+)?$/;
 
 
-      if (!reg.test(row.invoiceCode)) {
+      if (!reg.test(row.invoiceCode) && !isFullyElectionic) {
         codeErrors.push(String(index + 1));
         codeErrors.push(String(index + 1));
       }
       }
 
 
-
       if (!reg.test(row.invoiceNumber)) {
       if (!reg.test(row.invoiceNumber)) {
         numberErrors.push(String(index + 1));
         numberErrors.push(String(index + 1));
       }
       }
 
 
-      if (!reg.test(row.inv_subtotal_amount) || Number(row.inv_subtotal_amount) < 0) {
+      if ((!reg.test(row.inv_subtotal_amount) || Number(row.inv_subtotal_amount) < 0) && !isFullyElectionic) {
         priceErrors.push(String(index + 1));
         priceErrors.push(String(index + 1));
       }
       }
 
 
+      if ((!reg.test(row.inv_total) || Number(row.inv_total) < 0) && isFullyElectionic) {
+        fullyElectionicPriceErrors.push(String(index + 1));
+      }
     });
     });
 
 
     if (typeErrors.length > 0) {
     if (typeErrors.length > 0) {
@@ -180,10 +184,20 @@ const Uploadsuccess = ({ results, header }) => {
       return;
       return;
     }
     }
 
 
+    if (fullyElectionicPriceErrors.length > 0) {
+      ElMessage({
+        type: "error",
+        message: `第 ${fullyElectionicPriceErrors.join(",")} 行,发票税后金额必须为数字且不能是负数`
+      });
+      loading.value = false;
+      tableData.value = [];
+      return;
+    }
+
     if (openDateErrors.length > 0) {
     if (openDateErrors.length > 0) {
       ElMessage({
       ElMessage({
         type: "error",
         type: "error",
-        message: `第 ${openDateErrors.join(",")} 行,开票日期不能超过当前日期`
+        message: `第 ${openDateErrors.join(",")} 行,开票日期不能为空且不能超过当前日期`
       });
       });
       loading.value = false;
       loading.value = false;
       tableData.value = [];
       tableData.value = [];
@@ -198,7 +212,6 @@ const handleSubmit = async () => {
   try {
   try {
     if (loading.value) return;
     if (loading.value) return;
     loading.value = true;
     loading.value = true;
-
     const data = [];
     const data = [];
 
 
     tableData.value.forEach((key, index) => {
     tableData.value.forEach((key, index) => {
@@ -212,91 +225,12 @@ const handleSubmit = async () => {
       data.push(obj);
       data.push(obj);
     });
     });
 
 
-    const typeErrors: string[] = [];
-    const checkErrors: string[] = [];
-    const codeErrors: string[] = [];
-    const numberErrors: string[] = [];
-    const priceErrors: string[] = [];
-
     data.forEach((row, index) => {
     data.forEach((row, index) => {
       const source = row.invoiceType.trim();
       const source = row.invoiceType.trim();
       const target = cg_inv_type_list.find(({ label }) => label === source);
       const target = cg_inv_type_list.find(({ label }) => label === source);
-
-      if (!target) {
-        typeErrors.push(String(index + 1));
-      } else {
-        row.invoiceType = target.value;
-
-        if (
-          (target.value === "normal" || target.value === "electronic") &&
-          !row.checkNumber
-        ) {
-          checkErrors.push(String(index + 1));
-        }
-      }
-
-      const reg = /^\d+(\.\d+)?$/;
-
-      if (!reg.test(row.invoiceCode)) {
-        codeErrors.push(String(index + 1));
-      }
-
-
-      if (!reg.test(row.invoiceNumber)) {
-        numberErrors.push(String(index + 1));
-      }
-
-      if (!reg.test(row.inv_subtotal_amount) || Number(row.inv_subtotal_amount) < 0) {
-        priceErrors.push(String(index + 1));
-      }
-
+      row.invoiceType = target.value;
     });
     });
 
 
-    if (typeErrors.length > 0) {
-      ElMessage({
-        type: "error",
-        message: createInvErrorMessage(typeErrors.join(","))
-      });
-      loading.value = false;
-      return;
-    }
-
-    if (checkErrors.length > 0) {
-      ElMessage({
-        type: "error",
-        message: `第 ${checkErrors.join(",")} 行,校验码不能为空。`
-      });
-      loading.value = false;
-      return;
-    }
-
-    if (codeErrors.length > 0) {
-      ElMessage({
-        type: "error",
-        message: `第 ${codeErrors.join(",")} 行,发票代码必须为数字。`
-      });
-      loading.value = false;
-      return;
-    }
-
-
-    if (numberErrors.length > 0) {
-      ElMessage({
-        type: "error",
-        message: `第 ${numberErrors.join(",")} 行,发票号码必须为数字。`
-      });
-      loading.value = false;
-      return;
-    }
-
-    if (priceErrors.length > 0) {
-      ElMessage({
-        type: "error",
-        message: `第 ${priceErrors.join(",")} 行,发票税前金额必须为数字且不能是负数`
-      });
-      loading.value = false;
-      return;
-    }
 
 
     const buyers = data.map(({ supplierNo }) => supplierNo);
     const buyers = data.map(({ supplierNo }) => supplierNo);
     const setBuyers = [...new Set(buyers)];
     const setBuyers = [...new Set(buyers)];
@@ -316,6 +250,10 @@ const handleSubmit = async () => {
     }
     }
 
 
     data.forEach(item => {
     data.forEach(item => {
+      const isFullyElectionic = item.invoiceType === 'fully_digitalized_special_electronic' || item.invoiceType === 'fully_digitalized_normal_electronic'
+      if(isFullyElectionic){ item.inv_subtotal_amount = item.inv_total }
+      
+      delete item['inv_total']
       delete item["supplierNo"];
       delete item["supplierNo"];
       delete item["supplierName"];
       delete item["supplierName"];
       delete item["companyName"];
       delete item["companyName"];

+ 2 - 2
src/views/supply/ticketReturn/components/invoice-table.vue

@@ -43,7 +43,7 @@ function handleDelete({ $index }) {
       <template #="{ row }">
       <template #="{ row }">
         <span
         <span
           v-if="
           v-if="
-            String(row.invoiceType) !== '31' && String(row.invoiceType) !== '32'
+            String(row.invoiceType) !== 'fully_digitalized_special_electronic' && String(row.invoiceType) !== 'fully_digitalized_normal_electronic'
           "
           "
           >{{ row.subtotal_amount }}</span
           >{{ row.subtotal_amount }}</span
         >
         >
@@ -52,7 +52,7 @@ function handleDelete({ $index }) {
     </el-table-column>
     </el-table-column>
     <el-table-column label="税后金额" prop="subtotal_amount">
     <el-table-column label="税后金额" prop="subtotal_amount">
       <template #="{ row }">
       <template #="{ row }">
-        <span v-if="row.invoiceType === '31' || row.invoiceType === '32'">{{
+        <span v-if="row.invoiceType === 'fully_digitalized_special_electronic' || row.invoiceType === 'fully_digitalized_normal_electronic'">{{
           row.subtotal_amount
           row.subtotal_amount
         }}</span>
         }}</span>
         <span v-else />
         <span v-else />

+ 3 - 1
src/views/supply/ticketReturn/index.vue

@@ -81,12 +81,13 @@ async function handleDownload() {
       :search-config="searchConfig"
       :search-config="searchConfig"
       :get-content-ref="(ref:any) => pageContentRef = ref"
       :get-content-ref="(ref:any) => pageContentRef = ref"
     >
     >
+
       <template #content_header>
       <template #content_header>
         <ElButton
         <ElButton
           size="small"
           size="small"
-          v-if="hasPermissionWithCode('033') && !isSuperUser"
           :icon="useRenderIcon('arrow-up-line')"
           :icon="useRenderIcon('arrow-up-line')"
           @click="() => execelUploadRef.onDisplay()"
           @click="() => execelUploadRef.onDisplay()"
+          v-if="hasPermissionWithCode('033') && !isSuperUser"
           >批量创建开票数据</ElButton
           >批量创建开票数据</ElButton
         >
         >
         <!-- <ElButton
         <!-- <ElButton
@@ -110,6 +111,7 @@ async function handleDownload() {
     </PageContainer>
     </PageContainer>
 
 
     <InvoiceModal ref="invoiceModalRef" />
     <InvoiceModal ref="invoiceModalRef" />
+
     <ExeclUpoad
     <ExeclUpoad
       ref="execelUploadRef"
       ref="execelUploadRef"
       @on-success="() => (pageContentRef as any).onSearch()"
       @on-success="() => (pageContentRef as any).onSearch()"