snow 10 months ago
parent
commit
ccbd2d8ce5

BIN
dist-zip/build.zip


+ 18 - 0
src/views/InvoiceSaleSettings/_component/execl-files-upload/index.vue

@@ -14,6 +14,9 @@ import {
 } from "./columns-config";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
 
+import { useCompany } from "/@/hooks/core/useCompany";
+
+const company = useCompany();
 const visible = ref(false);
 const loading = ref(false);
 const tableData = ref([]);
@@ -92,6 +95,21 @@ const Uploadsuccess = ({ results, header }) => {
       tableData.value.push(model);
     }
 
+
+    const names = [... new Set(tableData.value.map(({ value3 }) => value3))]
+    if (names.length !== 1) {
+      ElMessage.error('上传的买入方公司必须一致')
+      tableData.value = []
+      return
+    } else {
+      if (names[0] !== company.currentCompany.value.companyName) {
+        ElMessage.error('上传的买入方公司与当前选择公司必须一致')
+        tableData.value = []
+        loading.value = false;
+        return
+      }
+    }
+
     loading.value = false;
   } catch (err) {
     return err;

+ 18 - 0
src/views/InvoiceSaleSettings/_component/procure-import/index.vue

@@ -13,6 +13,10 @@ import {
   requireHeaders
 } from "./columns-config";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import { useCompany } from "/@/hooks/core/useCompany";
+
+
+const company = useCompany()
 
 const visible = ref(false);
 const loading = ref(false);
@@ -71,6 +75,20 @@ const Uploadsuccess = ({ results, header }) => {
       tableData.value.push(model);
     }
 
+    const names = [... new Set(tableData.value.map(({ value3 }) => value3))]
+    if (names.length !== 1) {
+      ElMessage.error('上传的买入方公司必须一致')
+      tableData.value = []
+      return
+    } else {
+      if (names[0] !== company.currentCompany.value.companyName) {
+        ElMessage.error('上传的买入方公司与当前选择公司必须一致')
+        tableData.value = []
+        loading.value = false;
+        return
+      }
+    }
+
     loading.value = false;
   } catch (err) {
     return err;

+ 1 - 1
src/views/InvoiceSaleSettings/commodityCost/index.vue

@@ -142,7 +142,7 @@ async function handleExportPage() {
     onStart: () => (_loading.value = true),
     onSuccess: () => (_loading.value = false),
     onFail: () => (_loading.value = false),
-    params: { isZx: 0, ...params, companyNo: currentCompany.value.companyNo },
+    params: { isZx: 0, ...params, companyNo: currentCompany.value.companyNo , isChild: 0},
     admin: false
   });
 }

+ 16 - 10
src/views/InvoiceSaleSettings/consultingChildCost/index.vue

@@ -14,6 +14,7 @@ import { template, procureTemplate } from "./../_config/xls-template";
 import { utils, writeFile } from "xlsx";
 import { ElMessage } from "element-plus";
 import { useUserInfo } from "/@/hooks/core/useUser";
+import { httpSupplierList } from "/@/api/supplierManage/supplierAccoutManage";
 
 import { httpRequsetExport } from "/@/utils/export";
 
@@ -65,23 +66,23 @@ function onDownloadTemplate(isProcure = false) {
 
   const data: any[] = [];
   selects.value.forEach((item) => {
-    const _template = { ...judieTemplate };
+    const _template = { ...judieTemplate }; 
 
     if (isProcure) { // 采购
       _template["商品编码"] = item.spuCode;
       _template["商品名称"] = item.good_name;
-      _template["买入方公司编码"] = item.companyNo;
-      _template["买入方公司名称"] = item.companyName;
-      _template["卖出方公司编码"] = item.supplierNo;
-      _template["卖出方公司名称"] = item.supplierName;
+      _template["买入方公司编码"] = item.supplierNo;
+      _template["买入方公司名称"] = item.supplierName;
+      _template["卖出方公司编码"] = item.cgd_supplierNo;
+      _template["卖出方公司名称"] = item.cgd_supplierName;
       _template["开票商品名称"] = item.cgd_inv_good_name;
     } else {  // 财务
       _template["商品编码"] = item.spuCode;
       _template["商品名称"] = item.good_name;
-      _template["买入方公司编码"] = item.companyNo;
-      _template["买入方公司名称"] = item.companyName;
-      _template["卖出方公司编码"] = item.supplierNo;
-      _template["卖出方公司名称"] = item.supplierName;
+      _template["买入方公司编码"] = item.supplierNo;
+      _template["买入方公司名称"] = item.supplierName;
+      _template["卖出方公司编码"] = item.cgd_supplierNo;
+      _template["卖出方公司名称"] = item.cgd_supplierName;
       _template["采购类目编码"] = item.cgd_inv_cat_code;
       _template['采购类目名称'] = item.cgd_inv_cat_name;
       _template["采购开票商品名称"] = item.cgd_inv_good_name;
@@ -124,6 +125,11 @@ async function handleExportPage() {
   const startDays = start.daysInMonth();
   const endDays = end.daysInMonth();
 
+  // const supplierNo 
+  const { data } = await httpSupplierList({ name: currentCompany.value?.companyName })
+  const item = currentCompany.value?.companyName ? data.list.find(item => item.name === currentCompany.value?.companyName) || {} : {};
+  const transCompany = item.code;
+
   if (Math.abs(diffDay) > (startDays + endDays)) {
     ElMessage.warning('导出的时间区间不能超过两个月')
     return
@@ -135,7 +141,7 @@ async function handleExportPage() {
     onStart: () => (_loading.value = true),
     onSuccess: () => (_loading.value = false),
     onFail: () => (_loading.value = false),
-    params: { isZx: 1, ...params,companyNo:currentCompany.value.companyNo },
+    params: { isZx: 1, ...params, supplierNo: transCompany, isChild: 1, noRela: true },
     admin: false
   });
 }

+ 1 - 1
src/views/InvoiceSaleSettings/consultingCost/index.vue

@@ -135,7 +135,7 @@ async function handleExportPage() {
     onStart: () => (_loading.value = true),
     onSuccess: () => (_loading.value = false),
     onFail: () => (_loading.value = false),
-    params: { isZx: 1, ...params,companyNo:currentCompany.value.companyNo },
+    params: { isZx: 1, ...params, companyNo: currentCompany.value.companyNo, isChild: 0 },
     admin: false
   });
 }

+ 22 - 0
src/views/supplyInvoiceSaleSettings/_component/execl-files-upload/index.vue

@@ -13,6 +13,10 @@ import {
   requireHeaders
 } from "./columns-config";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import { useCompany } from "/@/hooks/core/useCompany";
+
+const company = useCompany();
+
 
 const visible = ref(false);
 const loading = ref(false);
@@ -92,6 +96,24 @@ const Uploadsuccess = ({ results, header }) => {
       tableData.value.push(model);
     }
 
+
+    const names = [... new Set(tableData.value.map(({ value5 }) => value5))]
+
+    console.log(names)
+    if (names.length !== 1) {
+      ElMessage.error('上传的卖出方公司必须一致')
+      tableData.value = []
+      return
+    } else {
+      if (names[0] !== company.currentCompany.value.companyName) {
+        ElMessage.error('上传的卖出方公司与当前选择公司必须一致')
+        tableData.value = []
+        loading.value = false;
+        return
+      }
+    }
+
+
     loading.value = false;
   } catch (err) {
     return err;

+ 21 - 0
src/views/supplyInvoiceSaleSettings/_component/procure-import/index.vue

@@ -14,6 +14,11 @@ import {
 } from "./columns-config";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
 
+
+import { useCompany } from "/@/hooks/core/useCompany";
+
+const company = useCompany();
+
 const visible = ref(false);
 const loading = ref(false);
 const tableData = ref([]);
@@ -41,6 +46,8 @@ const Uploadsuccess = ({ results, header }) => {
     return;
   }
 
+  // const companyNames = 
+
   let headok = true;
   if (header.length !== initheaders.length) {
     headok = false;
@@ -71,6 +78,20 @@ const Uploadsuccess = ({ results, header }) => {
       tableData.value.push(model);
     }
 
+
+    const names = [... new Set(tableData.value.map(({ value5 }) => value5))]
+    if (names.length !== 1) {
+      ElMessage.error('上传的卖出方公司必须一致')
+      tableData.value = []
+      return
+    } else {
+      if (names[0] !== company.currentCompany.value.companyName) {
+        ElMessage.error('上传的卖出方公司与当前选择公司必须一致')
+        tableData.value = []
+        loading.value = false;
+        return
+      }
+    }
     loading.value = false;
   } catch (err) {
     return err;

+ 8 - 8
src/views/supplyInvoiceSaleSettings/supplyConsultingChildCost/index.vue

@@ -63,18 +63,18 @@ function onDownloadTemplate(isProcure = false) {
     if (isProcure) { // 采购
       _template["商品编码"] = item.spuCode;
       _template["商品名称"] = item.good_name;
-      _template["买入方公司编码"] = item.companyNo;
-      _template["买入方公司名称"] = item.companyName;
-      _template["卖出方公司编码"] = item.supplierNo;
-      _template["卖出方公司名称"] = item.supplierName;
+      _template["买入方公司编码"] = item.supplierNo;
+      _template["买入方公司名称"] = item.supplierName;
+      _template["卖出方公司编码"] = item.cgd_supplierNo;
+      _template["卖出方公司名称"] = item.cgd_supplierName;
       _template["开票商品名称"] = item.cgd_inv_good_name;
     } else {  // 财务
       _template["商品编码"] = item.spuCode;
       _template["商品名称"] = item.good_name;
-      _template["买入方公司编码"] = item.companyNo;
-      _template["买入方公司名称"] = item.companyName;
-      _template["卖出方公司编码"] = item.supplierNo;
-      _template["卖出方公司名称"] = item.supplierName;
+      _template["买入方公司编码"] = item.supplierNo;
+      _template["买入方公司名称"] = item.supplierName;
+      _template["卖出方公司编码"] = item.cgd_supplierNo;
+      _template["卖出方公司名称"] = item.cgd_supplierName;
       _template["采购类目编码"] = item.cgd_inv_cat_code;
       _template['采购类目名称'] = item.cgd_inv_cat_name;
       _template["采购开票商品名称"] = item.cgd_inv_good_name;