瀏覽代碼

订单汇总excel导出

cz 11 月之前
父節點
當前提交
af5e2bdca8

+ 11 - 8
src/views/EHSD/saleContract/shipmentRegistration/index.vue

@@ -41,13 +41,9 @@
                 </template>
               </el-table-column>
               <el-table-column prop="productColor" label="颜色" width="150" />
-              <!-- <el-table-column prop="productFrontalTexture" label="纹路" width="130"
-                             :formatter="(row) => dictKeyValue(row.productFrontalTexture, frontLinesData)" /> -->
               <el-table-column prop="productNetWeight" label="净重" width="100" />
               <el-table-column prop="productUnit" label="单位" width="100" />
-              <!-- <el-table-column label="订单数量" width="100" prop="orderQuantity" />
-            <el-table-column label="单价" width="100" prop="price" />
-            <el-table-column label="已发货数量" width="100" prop="saleOutboundQuantity" fixed="right" /> -->
+              <el-table-column label="申请数量" width="100" prop="quantity" />
               <el-table-column prop="truckQuantity" label="装车数量" width="140" fixed="right">
                 <template #default="{ row, $index }">
                   <el-form-item :prop="'outboundRecordList.' + $index + '.truckQuantity'" :rules="rules.truckQuantity" :inline-message="true"
@@ -132,14 +128,21 @@ const config = computed(() => {
       attrs: {
         label: "申请款数",
         prop: "modCount",
-        // width: 100,
+        width: 100,
       },
     },
     {
       attrs: {
-        label: "申请数",
+        label: "申请数",
         prop: "sumQuantity",
-        // width: 110,
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "装车总数",
+        prop: "sumTruckQuantity",
+        width: 100,
       },
     },
     {

+ 2 - 2
src/views/finance/fundManage/kdCompany/index.vue

@@ -20,7 +20,7 @@
       </template>
     </el-dialog>
 
-    <el-dialog title="配置月发生额" v-if="openSetDialog" v-model="openSetDialog" width="70%">
+    <el-dialog title="配置月发生额" v-if="openSetDialog" v-model="openSetDialog" width="90%">
       <byForm :formConfig="formShortConfig" :formOption="formOption" v-model="setFormData.data" :rules="setRules" ref="setFormDom">
         <template #list>
           <div style="width:100%">
@@ -368,7 +368,7 @@ const formShortConfig = computed(() => {
   ];
 });
 const setRules = ref({
-  amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
+  // amount: [{ required: true, message: "请输入金额", trigger: "blur" }],
   year: [{ required: true, message: "请输入年份", trigger: "blur" }],
 });
 const rowData = ref({});

+ 18 - 4
src/views/purchaseManage/supplier/supplier/index.vue

@@ -206,7 +206,7 @@ let dialogVisible = ref(false);
 let modalType = ref("add");
 const uploadData = ref({});
 let rules = ref({
-  companyId: [{ required: true, message: "请选择业务公司", trigger: "change" }],
+  companyId: [{ required: true, message: "请选择生产公司", trigger: "change" }],
   devUserId: [{ required: true, message: "请选择开发人员", trigger: "change" }],
   deptId: [{ required: true, message: "请选择业务部门", trigger: "change" }],
   name: [{ required: true, message: "请输入供应商名称", trigger: "blur" }],
@@ -224,6 +224,20 @@ let rules = ref({
   name2: [{ required: true, message: "请输入姓名", trigger: "blur" }],
   position: [{ required: true, message: "请输入职位", trigger: "blur" }],
   phoneNum: [{ required: true, message: "请输入电话", trigger: "blur" }],
+  accountPeriod: [{ required: true, message: "请输入账期", trigger: "blur" }],
+  accountPeriodRemark: [
+    { required: true, message: "请输入账期说明", trigger: "blur" },
+  ],
+  fax: [{ required: true, message: "请输入传真", trigger: "blur" }],
+  privIncludingTax: [
+    { required: true, message: "请选择报价是否含税", trigger: "change" },
+  ],
+  privTaxPoints: [
+    { required: true, message: "请输入供应商税点", trigger: "blur" },
+  ],
+  licenseFileList: [
+    { required: true, message: "请上传营业执照", trigger: "change" },
+  ],
 });
 const selectConfig = computed(() => [
   {
@@ -232,7 +246,7 @@ const selectConfig = computed(() => [
     data: supplierType.value,
   },
   {
-    label: "业务公司",
+    label: "生产公司",
     prop: "companyId",
     data: companyData.value,
   },
@@ -241,7 +255,7 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: "业务公司",
+        label: "生产公司",
         prop: "companyName",
         width: 130,
       },
@@ -387,7 +401,7 @@ const formConfig = computed(() => {
     {
       type: "treeSelect",
       prop: "companyId",
-      label: "业务公司",
+      label: "生产公司",
       data: treeData.value,
       propsTreeLabel: "deptName",
       propsTreeValue: "deptId",

+ 104 - 6
src/views/report/expressPaymentSummary/index.vue

@@ -2,7 +2,11 @@
   <div class="pageIndexClass">
     <div class="content">
       <byTable :source="sourceList.data" :pagination="sourceList.pagination" :selectConfig="selectConfig" :config="config" highlight-current-row
-               :action-list="[
+               :action-list="[{
+                text: '导出Excel',
+                action: () => exportExcel(),
+                disabled: false,
+              }
         ]" @get-list="getList" :hideTable="true" :hidePagination="true">
         <template #code="{item}">
           <div style="width:100%">
@@ -12,8 +16,18 @@
       </byTable>
 
       <div style="padding:0 15px;background:#fff">
-        <el-table :data="sourceList.data" :height="tableHeight" style="width: 100%;margin-top:-10px" v-loading="loading" border id="my-table">
-          <el-table-column prop="name" label="快递公司" width="130" fixed="left" />
+        <el-table :data="sourceList.data" :height="tableHeight" style="width: 100%;margin-top:-10px" v-loading="loading" border
+                  :span-method="objectSpanMethod" :row-class-name="getRowClass" id="my-table">
+          <el-table-column prop="name" label="快递公司" width="130" fixed="left">
+            <template #default="{ row, $index }">
+              <div style="width: 100%">
+                <span v-if="$index < sourceList.data.length - 1"> {{row.name}}</span>
+                <div style="text-align:right" v-else>
+                  合计:
+                </div>
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column prop="yearBeginPayableBalance" label="年初余额" width="80" fixed="left" align="right">
             <template #default="{ row, $index }">
               <div style="width: 100%">
@@ -40,15 +54,15 @@
                 </el-table-column>
                 <el-table-column label="抵扣充值" width="80" align="right">
                   <template #default="{ row, $index }">
-                    <div style="width: 100%" v-if="row[col.key] && row[col.key].deductionAmount">
-                      {{moneyFormat(row[col.key].deductionAmount,2)}}
+                    <div style="width: 100%" v-if="row[col.key] && row[col.key].paymentDeductionAmount">
+                      {{moneyFormat(row[col.key].paymentDeductionAmount,2)}}
                     </div>
                   </template>
                 </el-table-column>
               </el-table-column>
               <el-table-column label="期末余额" width="80" align="right">
                 <template #default="{ row, $index }">
-                  <div style="width: 100%" v-if="row[col.key] && row[col.key].endingPayableBalance">
+                  <div style="width: 100%">
                     {{moneyFormat(row[col.key].endingPayableBalance,2)}}
                   </div>
                 </template>
@@ -77,6 +91,8 @@ import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import moment from "moment";
+import FileSaver from "file-saver";
+import * as XLSX from "xlsx";
 
 const { proxy } = getCurrentInstance();
 const tableHeight = ref(0);
@@ -665,6 +681,80 @@ const getDtl = (row) => {
     },
   });
 };
+
+const exportExcel = () => {
+  proxy.msgTip("正在导出,请稍后", 2);
+  const wb = XLSX.utils.table_to_book(document.querySelector("#my-table")); // 关联dom节点
+  // 设置百分比列的单元格样式
+  const percentStyle = {
+    font: { bold: true },
+    fill: { fgColor: { rgb: "FFFF00" } },
+    border: { top: { style: "thin" }, bottom: { style: "thin" } },
+  };
+
+  // if (wb.Sheets.Sheet1) {
+  //   // 达成率单元格的key开头
+  //   let cellKey = "";
+  //   for (const key in wb.Sheets.Sheet1) {
+  //     let value = wb.Sheets.Sheet1[key];
+  //     if (value && value.v == "月达成率") {
+  //       cellKey = key.match(/[a-zA-Z]+/g)[0];
+  //     }
+  //     // key有包含cellKey的
+  //     if (cellKey && key.includes(cellKey)) {
+  //       // 单元格的样式
+  //       wb.Sheets.Sheet1[key].s = percentStyle;
+  //       // 用于指定单元格中显示值的格式,例如日期格式、百分比格式等
+  //       wb.Sheets.Sheet1[key].z = "0.00%";
+  //     }
+  //   }
+  // }
+  const wbout = XLSX.write(wb, {
+    bookType: "xlsx",
+    bookSST: true,
+    type: "array",
+  });
+  try {
+    FileSaver.saveAs(
+      new Blob([wbout], {
+        type: "application/octet-stream",
+      }),
+      "应付账款汇总(快递).xlsx"
+    );
+  } catch (e) {
+    console.log(e, wbout);
+  }
+  return wbout;
+};
+
+const objectSpanMethod = ({ row, column, rowIndex, columnIndex }) => {
+  // 手动配置合计列
+  if (rowIndex == sourceList.value.data.length - 1) {
+    if (columnIndex == 0) {
+      return {
+        rowspan: 1,
+        colspan: 2,
+      };
+    } else if (columnIndex == 1) {
+      return {
+        rowspan: 1,
+        colspan: 0,
+      };
+    } else {
+      return {
+        rowspan: 1,
+        colspan: 1,
+      };
+    }
+  }
+};
+
+const getRowClass = ({ row, rowIndex }) => {
+  if (rowIndex == sourceList.value.data.length - 1) {
+    return "sumRow";
+  }
+  return "";
+};
 </script>
 
 <style lang="scss" scoped>
@@ -687,4 +777,12 @@ const getDtl = (row) => {
   padding: 0 8px !important;
   font-size: 12px !important;
 }
+
+:deep(.sumRow) {
+  background-color: #f5f7fa !important;
+  .el-table-fixed-column--left,
+  .el-table-fixed-column--right {
+    background-color: #f5f7fa !important;
+  }
+}
 </style>

+ 102 - 4
src/views/report/expressRechargeSummary/index.vue

@@ -2,7 +2,11 @@
   <div class="pageIndexClass">
     <div class="content">
       <byTable :source="sourceList.data" :pagination="sourceList.pagination" :selectConfig="selectConfig" :config="config" highlight-current-row
-               :action-list="[
+               :action-list="[{
+                text: '导出Excel',
+                action: () => exportExcel(),
+                disabled: false,
+              }
         ]" @get-list="getList" :hideTable="true" :hidePagination="true">
         <template #code="{item}">
           <div style="width:100%">
@@ -11,8 +15,18 @@
         </template>
       </byTable>
       <div style="padding:0 15px;background:#fff">
-        <el-table :data="sourceList.data" :height="tableHeight" style="width: 100%;margin-top:-10px" v-loading="loading" border id="my-table">
-          <el-table-column prop="name" label="快递公司" width="130" fixed="left" />
+        <el-table :data="sourceList.data" :height="tableHeight" style="width: 100%;margin-top:-10px" v-loading="loading" border
+                  :span-method="objectSpanMethod" :row-class-name="getRowClass" id="my-table">
+          <el-table-column prop="name" label="快递公司" width="130" fixed="left">
+            <template #default="{ row, $index }">
+              <div style="width: 100%">
+                <span v-if="$index < sourceList.data.length - 1"> {{row.name}}</span>
+                <div style="text-align:right" v-else>
+                  合计:
+                </div>
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column prop="yearBeginBalance" label="年初余额" width="80" fixed="left" align="right">
             <template #default="{ row, $index }">
               <div style="width: 100%">
@@ -40,7 +54,7 @@
 
               <el-table-column label="期末余额" width="80" align="right">
                 <template #default="{ row, $index }">
-                  <div style="width: 100%" v-if="row[col.key] && row[col.key].endingBalance">
+                  <div style="width: 100%">
                     {{moneyFormat(row[col.key].endingBalance,2)}}
                   </div>
                 </template>
@@ -70,6 +84,8 @@ import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import moment from "moment";
+import FileSaver from "file-saver";
+import * as XLSX from "xlsx";
 
 const { proxy } = getCurrentInstance();
 const tableHeight = ref(0);
@@ -657,6 +673,80 @@ const getDtl = (row) => {
     },
   });
 };
+
+const exportExcel = () => {
+  proxy.msgTip("正在导出,请稍后", 2);
+  const wb = XLSX.utils.table_to_book(document.querySelector("#my-table")); // 关联dom节点
+  // 设置百分比列的单元格样式
+  const percentStyle = {
+    font: { bold: true },
+    fill: { fgColor: { rgb: "FFFF00" } },
+    border: { top: { style: "thin" }, bottom: { style: "thin" } },
+  };
+
+  // if (wb.Sheets.Sheet1) {
+  //   // 达成率单元格的key开头
+  //   let cellKey = "";
+  //   for (const key in wb.Sheets.Sheet1) {
+  //     let value = wb.Sheets.Sheet1[key];
+  //     if (value && value.v == "月达成率") {
+  //       cellKey = key.match(/[a-zA-Z]+/g)[0];
+  //     }
+  //     // key有包含cellKey的
+  //     if (cellKey && key.includes(cellKey)) {
+  //       // 单元格的样式
+  //       wb.Sheets.Sheet1[key].s = percentStyle;
+  //       // 用于指定单元格中显示值的格式,例如日期格式、百分比格式等
+  //       wb.Sheets.Sheet1[key].z = "0.00%";
+  //     }
+  //   }
+  // }
+  const wbout = XLSX.write(wb, {
+    bookType: "xlsx",
+    bookSST: true,
+    type: "array",
+  });
+  try {
+    FileSaver.saveAs(
+      new Blob([wbout], {
+        type: "application/octet-stream",
+      }),
+      "快递充值汇总.xlsx"
+    );
+  } catch (e) {
+    console.log(e, wbout);
+  }
+  return wbout;
+};
+
+const objectSpanMethod = ({ row, column, rowIndex, columnIndex }) => {
+  // 手动配置合计列
+  if (rowIndex == sourceList.value.data.length - 1) {
+    if (columnIndex == 0) {
+      return {
+        rowspan: 1,
+        colspan: 2,
+      };
+    } else if (columnIndex == 1) {
+      return {
+        rowspan: 1,
+        colspan: 0,
+      };
+    } else {
+      return {
+        rowspan: 1,
+        colspan: 1,
+      };
+    }
+  }
+};
+
+const getRowClass = ({ row, rowIndex }) => {
+  if (rowIndex == sourceList.value.data.length - 1) {
+    return "sumRow";
+  }
+  return "";
+};
 </script>
 
 <style lang="scss" scoped>
@@ -679,4 +769,12 @@ const getDtl = (row) => {
   padding: 0 8px !important;
   font-size: 12px !important;
 }
+
+:deep(.sumRow) {
+  background-color: #f5f7fa !important;
+  .el-table-fixed-column--left,
+  .el-table-fixed-column--right {
+    background-color: #f5f7fa !important;
+  }
+}
 </style>

+ 60 - 3
src/views/report/orderSummary/index.vue

@@ -2,7 +2,11 @@
   <div class="pageIndexClass">
     <div class="content">
       <byTable :source="sourceList.data" :pagination="sourceList.pagination" :selectConfig="selectConfig" :config="config" :loading="loading"
-               highlight-current-row :action-list="[
+               highlight-current-row :action-list="[{
+                text: '导出Excel',
+                action: () => exportExcel(),
+                disabled: false,
+              }
         
         ]" @get-list="getList">
 
@@ -55,6 +59,28 @@ const typeData = ref([
     value: "20",
   },
 ]);
+const accountAgeList = ref([
+  {
+    label: "0~30",
+    value: "0~30",
+  },
+  {
+    label: "30~60",
+    value: "30~60",
+  },
+  {
+    label: "60~90",
+    value: "60~90",
+  },
+  {
+    label: "90~120",
+    value: "90~120",
+  },
+  {
+    label: "120以上",
+    value: "120以上",
+  },
+]);
 const sourceList = ref({
   data: [],
   pagination: {
@@ -63,6 +89,8 @@ const sourceList = ref({
     pageSize: 10,
     keyword: "",
     isSettlement: "",
+    accountAgeDate: "",
+    accountAge: "",
   },
 });
 const loading = ref(false);
@@ -133,6 +161,23 @@ const selectConfig = computed(() => {
         },
       ],
     },
+    {
+      type: "time",
+      itemType: "date",
+      label: "账龄日期",
+      placeholder: "请选择",
+      prop: "accountAgeDate",
+      placeholderOne: "",
+      propOne: "",
+      fn: () => {
+        getList();
+      },
+    },
+    {
+      label: "账龄",
+      prop: "accountAge",
+      data: accountAgeList.value,
+    },
   ];
 });
 const config = computed(() => {
@@ -240,7 +285,7 @@ const config = computed(() => {
       attrs: {
         label: "客户名称",
         prop: "customerName",
-        "min-width": 150,
+        "min-width": 180,
       },
     },
     {
@@ -291,7 +336,10 @@ const config = computed(() => {
       attrs: {
         label: "账龄级别",
         prop: "accountAge",
-        width: 120,
+        width: 100,
+      },
+      render(val) {
+        return proxy.dictValueLabel(val, accountAgeList.value);
       },
     },
     // {
@@ -635,6 +683,15 @@ const changeDate = (settleStartDate, settleEndDate, id) => {
       .then((res) => {});
   }
 };
+
+const exportExcel = () => {
+  proxy.msgTip("正在导出,请稍后", 2);
+  proxy
+    .postTwo("/report/orderSummaryExcelExport", sourceList.value.pagination)
+    .then((res) => {
+      proxy.downloadFile(res, "订单汇总.xlsx");
+    });
+};
 </script>
 
 <style lang="scss" scoped>