From 4b1304917b0b16b09dd50191fab59d96933c0cf3 Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期二, 17 六月 2025 17:31:11 +0800
Subject: [PATCH] feat: 6月15日任务完90%

---
 src/views/salesManagement/invoiceLedger/index.vue |  553 +++++++++++++++++++++++++++++++++---------------------
 1 files changed, 338 insertions(+), 215 deletions(-)

diff --git a/src/views/salesManagement/invoiceLedger/index.vue b/src/views/salesManagement/invoiceLedger/index.vue
index d5f5d76..fe2ca15 100644
--- a/src/views/salesManagement/invoiceLedger/index.vue
+++ b/src/views/salesManagement/invoiceLedger/index.vue
@@ -1,69 +1,149 @@
 <template>
   <div class="app-container">
     <div class="search_form">
-      <div>
-        <span class="search_title">瀹㈡埛鍚嶇О/鍚堝悓鍙凤細</span>
-        <el-input
+      <el-form :inline="true" :model="searchForm">
+        <el-form-item label="瀹㈡埛鍚嶇О/鍚堝悓鍙�">
+          <el-input
             v-model="searchForm.searchText"
             style="width: 240px"
             placeholder="杈撳叆瀹㈡埛鍚嶇О/鍚堝悓鍙锋悳绱�"
             @change="handleQuery"
             clearable
             :prefix-icon="Search"
-        />
-        <span class="search_title" style="margin-left: 10px">寮�绁ㄦ棩鏈燂細</span>
-        <el-date-picker
+          />
+        </el-form-item>
+        <el-form-item label="寮�绁ㄦ棩鏈�">
+          <el-date-picker
             style="width: 240px"
             v-model="searchForm.invoiceDate"
             value-format="YYYY-MM-DD"
             format="YYYY-MM-DD"
-            type="date"
-            placeholder="璇烽�夋嫨"
+            type="daterange"
+            start-placeholder="寮�濮嬫椂闂�"
+            end-placeholder="缁撴潫鏃堕棿"
             clearable
-        />
-        <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
-      </div>
-      <div>
-        <el-button @click="handleOut" type="primary" style="width: 100px">瀵煎嚭</el-button>
-      </div>
+            @change="changeDateRange"
+            @clear="clearRange"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="handleQuery"> 鎼滅储 </el-button>
+          <el-button @click="resetForm"> 閲嶇疆 </el-button>
+          <el-button @click="handleOut" type="primary">瀵煎嚭</el-button>
+        </el-form-item>
+      </el-form>
     </div>
     <div class="table_list">
-      <el-table :data="tableData" border v-loading="tableLoading"
-                @selection-change="handleSelectionChange"
-                :row-key="row => row.id"
-                show-summary
-                :summary-method="summarizeMainTable"
-                height="calc(100vh - 18.5em)">
+      <el-table
+        :data="tableData"
+        border
+        v-loading="tableLoading"
+        @selection-change="handleSelectionChange"
+        :row-key="(row) => row.id"
+        show-summary
+        :summary-method="summarizeMainTable"
+        height="calc(100vh - 18.5em)"
+      >
         <el-table-column align="center" type="selection" width="55" />
         <el-table-column align="center" label="搴忓彿" type="index" width="60" />
-        <el-table-column label="閿�鍞悎鍚屽彿" prop="salesContractNo" show-overflow-tooltip/>
-        <el-table-column label="瀹㈡埛鍚堝悓鍙�" prop="customerContractNo" show-overflow-tooltip/>
-        <el-table-column label="瀹㈡埛鍚嶇О" prop="customerName" show-overflow-tooltip/>
+        <el-table-column
+          label="閿�鍞悎鍚屽彿"
+          prop="salesContractNo"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="瀹㈡埛鍚堝悓鍙�"
+          prop="customerContractNo"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="瀹㈡埛鍚嶇О"
+          prop="customerName"
+          show-overflow-tooltip
+        />
         <el-table-column label="浜у搧澶х被" prop="productCategory" />
         <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
-        <el-table-column label="鍙戠エ鍙�" prop="invoiceNo" show-overflow-tooltip/>
-        <el-table-column label="鍙戠エ閲戦(鍏�)" prop="invoiceTotal" show-overflow-tooltip :formatter="formattedNumber"/>
-        <el-table-column label="绋庣巼" prop="taxRate" show-overflow-tooltip/>
-        <el-table-column label="寮�绁ㄤ汉" prop="invoicePerson" show-overflow-tooltip/>
-        <el-table-column label="寮�绁ㄦ棩鏈�" prop="invoiceDate" show-overflow-tooltip/>
-        <el-table-column label="鍙戠エ" prop="invoiceFileName" show-overflow-tooltip>
+        <el-table-column
+          label="鍙戠エ鍙�"
+          prop="invoiceNo"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="鍙戠エ閲戦(鍏�)"
+          prop="invoiceTotal"
+          show-overflow-tooltip
+          :formatter="formattedNumber"
+        />
+        <el-table-column label="绋庣巼" prop="taxRate" show-overflow-tooltip />
+        <el-table-column
+          label="寮�绁ㄤ汉"
+          prop="invoicePerson"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="寮�绁ㄦ棩鏈�"
+          prop="invoiceDate"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="鍙戠エ"
+          prop="invoiceFileName"
+          show-overflow-tooltip
+        >
           <template #default="scope">
-            <span v-if="scope.row.invoiceFileName">{{ scope.row.invoiceFileName }}</span>
-            <el-button v-else link type="primary" @click="handleDownload(scope.row)">涓婁紶</el-button>
+            <span v-if="scope.row.invoiceFileName">{{
+              scope.row.invoiceFileName
+            }}</span>
+            <el-button
+              v-else
+              link
+              type="primary"
+              @click="handleDownload(scope.row)"
+              >涓婁紶</el-button
+            >
           </template>
         </el-table-column>
-        <el-table-column fixed="right" label="鎿嶄綔" width="150" align="center" >
+        <el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
           <template #default="scope">
-            <el-button link type="primary" size="small" @click="openForm(scope.row);">缂栬緫</el-button>
-            <el-button link type="primary" size="small" @click="delInvoiceLedger(scope.row);">鍒犻櫎</el-button>
+            <el-button
+              link
+              type="primary"
+              size="small"
+              @click="openForm(scope.row)"
+              >缂栬緫</el-button
+            >
+            <el-button
+              link
+              type="primary"
+              size="small"
+              @click="delInvoiceLedger(scope.row)"
+              >鍒犻櫎</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
-      <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" :page="page.current"
-                  :limit="page.size" @pagination="paginationChange" />
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        layout="total, sizes, prev, pager, next, jumper"
+        :page="page.current"
+        :limit="page.size"
+        @pagination="paginationChange"
+      />
     </div>
-    <el-dialog v-model="dialogFormVisible" title="寮�绁ㄥ彴璐﹂〉闈�" width="70%" @close="closeDia">
-      <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
+    <el-dialog
+      v-model="dialogFormVisible"
+      title="寮�绁ㄥ彴璐﹂〉闈�"
+      width="70%"
+      @close="closeDia"
+    >
+      <el-form
+        :model="form"
+        label-width="140px"
+        label-position="top"
+        :rules="rules"
+        ref="formRef"
+      >
         <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="閿�鍞悎鍚屽彿锛�" prop="salesContractNo">
@@ -72,39 +152,58 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="瀹㈡埛鍚嶇О锛�" prop="customerName">
-              <el-input v-model="form.customerName" placeholder="鑷姩濉厖" clearable disabled/>
+              <el-input
+                v-model="form.customerName"
+                placeholder="鑷姩濉厖"
+                clearable
+                disabled
+              />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="鍙戠エ鍙凤細" prop="invoiceNo">
-              <el-input v-model="form.invoiceNo" placeholder="璇疯緭鍏�" clearable/>
+              <el-input
+                v-model="form.invoiceNo"
+                placeholder="璇疯緭鍏�"
+                clearable
+              />
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="鍙戠エ閲戦(鍏�)锛�" prop="invoiceTotal">
-              <el-input type="number" :step="0.01" v-model="form.invoiceTotal" placeholder="璇疯緭鍏�" clearable/>
+              <el-input
+                type="number"
+                :step="0.01"
+                v-model="form.invoiceTotal"
+                placeholder="璇疯緭鍏�"
+                clearable
+              />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="寮�绁ㄤ汉锛�" prop="invoicePerson">
-              <el-input v-model="form.invoicePerson" placeholder="璇疯緭鍏�" clearable disabled/>
+              <el-input
+                v-model="form.invoicePerson"
+                placeholder="璇疯緭鍏�"
+                clearable
+                disabled
+              />
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="寮�绁ㄦ棩鏈燂細" prop="invoiceDate">
               <el-date-picker
-                  style="width: 100%"
-                  v-model="form.invoiceDate"
-                  value-format="YYYY-MM-DD"
-                  format="YYYY-MM-DD"
-                  type="date"
-                  placeholder="璇烽�夋嫨"
-                  clearable
-                  disabled
+                style="width: 100%"
+                v-model="form.invoiceDate"
+                value-format="YYYY-MM-DD"
+                format="YYYY-MM-DD"
+                type="date"
+                placeholder="璇烽�夋嫨"
+                clearable
               />
             </el-form-item>
           </el-col>
@@ -113,25 +212,23 @@
           <el-col :span="24">
             <el-form-item label="闄勪欢鏉愭枡锛�" prop="remark">
               <el-upload
-                  v-model:file-list="fileList"
-                  :action="upload.url"
-                  multiple
-                  ref="fileUpload"
-                  auto-upload
-                  :headers="upload.headers"
-                  accept=".pdf"
-                  :limit="1"
-                  :before-upload="handleBeforeUpload"
-                  :on-error="handleUploadError"
-                  :on-success="handleUploadSuccess"
-                  :on-remove="handleRemove"
+                v-model:file-list="fileList"
+                :action="upload.url"
+                multiple
+                ref="fileUpload"
+                auto-upload
+                :headers="upload.headers"
+                accept=".pdf"
+                :limit="1"
+                :before-upload="handleBeforeUpload"
+                :on-error="handleUploadError"
+                :on-success="handleUploadSuccess"
+                :on-remove="handleRemove"
               >
                 <el-button type="primary">涓婁紶</el-button>
                 <template #tip>
-<!--                  鏂囦欢鏍煎紡鏀寔 doc锛宒ocx锛寈ls锛寈lsx锛宲pt锛宲ptx锛宲df锛宼xt锛寈ml锛宩pg锛宩peg锛宲ng锛実if锛宐mp锛宺ar锛寊ip锛�7z-->
-                  <div class="el-upload__tip">
-                    鏂囦欢鏍煎紡鏀寔 pdf
-                  </div>
+                  <!--                  鏂囦欢鏍煎紡鏀寔 doc锛宒ocx锛寈ls锛寈lsx锛宲pt锛宲ptx锛宲df锛宼xt锛寈ml锛宩pg锛宩peg锛宲ng锛実if锛宐mp锛宺ar锛寊ip锛�7z-->
+                  <div class="el-upload__tip">鏂囦欢鏍煎紡鏀寔 pdf</div>
                 </template>
               </el-upload>
             </el-form-item>
@@ -150,26 +247,24 @@
         <el-col :span="24">
           <el-form-item label="闄勪欢鏉愭枡锛�" prop="remark">
             <el-upload
-                v-model:file-list="fileList"
-                :action="upload.url"
-                multiple
-                ref="fileUpload"
-                auto-upload
-                :headers="upload.headers"
-                accept=".pdf"
-                :limit="1"
-                style="width: 100%"
-                :on-exceed="handleExceed"
-                :before-upload="handleBeforeUpload"
-                :on-error="handleUploadError"
-                :on-success="handleUploadSuccess"
-                :on-remove="handleRemove"
+              v-model:file-list="fileList"
+              :action="upload.url"
+              multiple
+              ref="fileUpload"
+              auto-upload
+              :headers="upload.headers"
+              accept=".pdf"
+              :limit="1"
+              style="width: 100%"
+              :on-exceed="handleExceed"
+              :before-upload="handleBeforeUpload"
+              :on-error="handleUploadError"
+              :on-success="handleUploadSuccess"
+              :on-remove="handleRemove"
             >
               <el-button type="primary">涓婁紶</el-button>
               <template #tip>
-                <div class="el-upload__tip">
-                  鏂囦欢鏍煎紡浠呮敮鎸� pdf
-                </div>
+                <div class="el-upload__tip">鏂囦欢鏍煎紡浠呮敮鎸� pdf</div>
               </template>
             </el-upload>
           </el-form-item>
@@ -178,7 +273,7 @@
       <template #footer>
         <div class="dialog-footer">
           <el-button @click="commiInvoicetFile" type="primary">纭</el-button>
-          <el-button  @click="uploadModal = false">鍙栨秷</el-button>
+          <el-button @click="uploadModal = false">鍙栨秷</el-button>
         </div>
       </template>
     </el-dialog>
@@ -186,45 +281,54 @@
 </template>
 
 <script setup>
-import pagination from '@/components/PIMTable/Pagination.vue'
-import { ref } from 'vue'
-import {Search} from "@element-plus/icons-vue";
-import {ElMessageBox } from "element-plus";
-import { getToken } from "@/utils/auth"
+import pagination from "@/components/PIMTable/Pagination.vue";
+import { ref } from "vue";
+import { Search } from "@element-plus/icons-vue";
+import { ElMessageBox } from "element-plus";
+import { getToken } from "@/utils/auth";
 import {
   invoiceLedgerSaveOrUpdate,
   invoiceLedgerProductInfo,
   commitFile,
-  registrationProductPage, delInvoiceLedgerByRegProductId
+  registrationProductPage,
+  delInvoiceLedgerByRegProductId,
 } from "../../../api/salesManagement/invoiceLedger.js";
 import useUserStore from "@/store/modules/user.js";
-const { proxy } = getCurrentInstance()
-const tableData = ref([])
-const productData = ref([])
-const selectedRows = ref([])
-const tableLoading = ref(false)
+import useFormData from "@/hooks/useFormData";
+import dayjs from "dayjs";
+
+const { proxy } = getCurrentInstance();
+const tableData = ref([]);
+const productData = ref([]);
+const selectedRows = ref([]);
+const tableLoading = ref(false);
 const page = reactive({
   current: 1,
   size: 100,
-})
-const total = ref(0)
-const fileList = ref([])
-const dialogFormVisible = ref(false)
+});
+const total = ref(0);
+const fileList = ref([]);
+const dialogFormVisible = ref(false);
 const data = reactive({
   searchForm: {
-    searchText: '',
-    invoiceDate:''
+    searchText: "",
+    invoiceDate: [
+      dayjs().startOf("month").format("YYYY-MM-DD"),
+      dayjs().endOf("month").format("YYYY-MM-DD"),
+    ],
+    invoiceDateStart: dayjs().startOf("month").format("YYYY-MM-DD"),
+    invoiceDateEnd: dayjs().endOf("month").format("YYYY-MM-DD"),
   },
   form: {
-    salesLedgerId: '',
-    customerId: '',
-    invoiceNo: '',
-    invoiceTotal: '',
-    taxRate: '',
-    invoicePerson: '',
-    invoiceDate: '',
-    customerName:'',
-    fileList:[]
+    salesLedgerId: "",
+    customerId: "",
+    invoiceNo: "",
+    invoiceTotal: "",
+    taxRate: "",
+    invoicePerson: "",
+    invoiceDate: "",
+    customerName: "",
+    fileList: [],
   },
   rules: {
     salesLedgerId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
@@ -235,72 +339,74 @@
     invoicePerson: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
     invoiceDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
     customerName: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
-  }
-})
-const { searchForm, form, rules } = toRefs(data)
-const currentId = ref('')
-const userStore = useUserStore()
+  },
+});
+const { form, rules } = toRefs(data);
+const { form: searchForm, resetForm } = useFormData(data.searchForm);
+const currentId = ref("");
+const userStore = useUserStore();
 const upload = reactive({
   // 涓婁紶鐨勫湴鍧�
   url: import.meta.env.VITE_APP_BASE_API + "/invoiceLedger/uploadFile",
   // 璁剧疆涓婁紶鐨勮姹傚ご閮�
   headers: { Authorization: "Bearer " + getToken() },
-})
-const matchFileType = ref(['pdf'])
-const uploadModal = ref(false)
+});
+const matchFileType = ref(["pdf"]);
+const uploadModal = ref(false);
 const formattedNumber = (row, column, cellValue) => {
   return parseFloat(cellValue).toFixed(2);
 };
 // 鏌ヨ鍒楄〃
 /** 鎼滅储鎸夐挳鎿嶄綔 */
 const handleQuery = () => {
-  page.current = 1
-  getList()
-}
+  page.current = 1;
+  getList();
+};
 const paginationChange = (obj) => {
   page.current = obj.page;
   page.size = obj.limit;
-  getList()
-}
+  getList();
+};
 const getList = () => {
-  tableLoading.value = true
-  registrationProductPage({...searchForm.value, ...page}).then(res => {
-    tableLoading.value = false
+  tableLoading.value = true;
+  const { invoiceDate, ...rest } = searchForm;
+  registrationProductPage({ ...rest, ...page }).then((res) => {
+    tableLoading.value = false;
     tableData.value = res.data.records;
     total.value = res.data.total;
-  })
-}
+  });
+};
 // 琛ㄦ牸閫夋嫨鏁版嵁
 const handleSelectionChange = (selection) => {
-  selectedRows.value = selection
-}
+  selectedRows.value = selection;
+};
 // 涓昏〃鍚堣鏂规硶
 const summarizeMainTable = (param) => {
-  return proxy.summarizeTable(param, ['invoiceTotal'], {
+  return proxy.summarizeTable(param, ["invoiceTotal"], {
     ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
     futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
   });
 };
 // 鎵撳紑寮规
 const openForm = (row) => {
-  form.value = {}
-  productData.value = []
-  fileList.value = []
+  form.value = {};
+  productData.value = [];
+  fileList.value = [];
   currentId.value = row.id;
 
-  invoiceLedgerProductInfo({id: row.id}).then(res => {
-    form.value = {...res.data}
+  invoiceLedgerProductInfo({ id: row.id }).then((res) => {
+    form.value = { ...res.data };
     fileList.value = res.data.fileList;
-    if(!form.value.invoicePerson){
-      form.value.invoicePerson = userStore.nickName
+    if (!form.value.invoicePerson) {
+      form.value.invoicePerson = userStore.nickName;
       form.value.entryDate = getCurrentDate();
     }
-    if(!form.value.invoiceDate){
+    if (!form.value.invoiceDate) {
       form.value.invoiceDate = getCurrentDate();
     }
-  })
-  dialogFormVisible.value = true
-}
+  });
+  dialogFormVisible.value = true;
+};
 // 涓婁紶澶氫釜鏂囦欢灏辫鐩栧師鏉ョ殑
 const handleExceed = (files) => {
   proxy.$refs["fileUpload"].clearFiles();
@@ -310,131 +416,148 @@
 };
 // 涓婁紶鍓嶆牎妫�
 function handleBeforeUpload(file) {
-  console.log('file',file)
+  console.log("file", file);
   // 鏍℃鏂囦欢澶у皬
   if (file.size > 1024 * 1024 * 10) {
-    proxy.$modal.msgError('涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃10MB!')
-    return false
+    proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃10MB!");
+    return false;
   }
   // 鍒ゆ柇鏂囦欢鏍煎紡鏄惁绗﹀悎
-  const fileType = file.name.split('.').pop().toLowerCase();
-  if(!matchFileType.value.includes(fileType)) {
-    proxy.$modal.msgError('鏂囦欢鏍煎紡涓嶅尮閰�')
-    return false
+  const fileType = file.name.split(".").pop().toLowerCase();
+  if (!matchFileType.value.includes(fileType)) {
+    proxy.$modal.msgError("鏂囦欢鏍煎紡涓嶅尮閰�");
+    return false;
   }
-  proxy.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��...")
-  return true
+  proxy.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��...");
+  return true;
 }
 // 涓婁紶澶辫触
 function handleUploadError(err) {
-  proxy.$modal.msgError("涓婁紶鏂囦欢澶辫触")
-  proxy.$modal.closeLoading()
+  proxy.$modal.msgError("涓婁紶鏂囦欢澶辫触");
+  proxy.$modal.closeLoading();
 }
 // 涓婁紶鎴愬姛鍥炶皟
 function handleUploadSuccess(res, file, uploadFiles) {
-  proxy.$modal.closeLoading()
+  proxy.$modal.closeLoading();
   if (res.code === 200) {
-    proxy.$refs["fileUpload"].handleRemove(file)
-    fileList.value.push(res.data)
-    proxy.$modal.msgSuccess("涓婁紶鎴愬姛")
+    proxy.$refs["fileUpload"].handleRemove(file);
+    fileList.value.push(res.data);
+    proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
   } else {
-    proxy.$modal.msgError(res.msg)
-    proxy.$refs.fileUpload.handleRemove(file)
+    proxy.$modal.msgError(res.msg);
+    proxy.$refs.fileUpload.handleRemove(file);
   }
 }
 // 绉婚櫎鏂囦欢
-function handleRemove (file) {
-  let index = fileList.value.findIndex(item => item.url === file.url)
-  if(index > -1) {
-    fileList.value.splice(index, 1)
+function handleRemove(file) {
+  let index = fileList.value.findIndex((item) => item.url === file.url);
+  if (index > -1) {
+    fileList.value.splice(index, 1);
   }
 }
 // 鎻愪氦琛ㄥ崟
 const submitForm = () => {
-  proxy.$refs["formRef"].validate(valid => {
+  proxy.$refs["formRef"].validate((valid) => {
     if (valid) {
       form.value.fileList = fileList.value;
-      invoiceLedgerSaveOrUpdate(form.value).then(res => {
-        proxy.$modal.msgSuccess("鎻愪氦鎴愬姛")
-        closeDia()
-        getList()
-      })
+      invoiceLedgerSaveOrUpdate(form.value).then((res) => {
+        proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+        closeDia();
+        getList();
+      });
     }
-  })
-}
+  });
+};
 // 鍏抽棴寮规
 const closeDia = () => {
-  proxy.resetForm("formRef")
-  dialogFormVisible.value = false
-}
+  proxy.resetForm("formRef");
+  dialogFormVisible.value = false;
+};
 // 瀵煎嚭
 const handleOut = () => {
-  ElMessageBox.confirm(
-      '閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�',
-      '瀵煎嚭', {
-        confirmButtonText: '纭',
-        cancelButtonText: '鍙栨秷',
-        type: 'warning',
-      }
-  ).then(() => {
-    proxy.download("/invoiceLedger/export", {}, '寮�绁ㄥ彴璐�.xlsx')
-  }).catch(() => {
-    proxy.$modal.msg("宸插彇娑�")
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
   })
-}
+    .then(() => {
+      proxy.download("/invoiceLedger/export", {}, "寮�绁ㄥ彴璐�.xlsx");
+    })
+    .catch(() => {
+      proxy.$modal.msg("宸插彇娑�");
+    });
+};
 
 // 鎵撳紑闄勪欢涓婁紶寮圭獥
 const handleDownload = (val) => {
-  fileList.value = []
-  uploadModal.value = true
-  currentId.value = val.id
-}
+  fileList.value = [];
+  uploadModal.value = true;
+  currentId.value = val.id;
+};
 
 // 纭鏂囦欢涓婁紶
 const commiInvoicetFile = () => {
   const object = {
     fileList: fileList.value,
     id: currentId.value,
-  }
-  commitFile(object).then(res => {
+  };
+  commitFile(object).then((res) => {
     if (res.code === 200) {
-      proxy.$modal.msgSuccess("鎻愪氦鎴愬姛")
-      uploadModal.value = false
+      proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+      uploadModal.value = false;
     }
     getList();
-    currentId.value = ''
-    fileList.value = []
-  })
-}
+    currentId.value = "";
+    fileList.value = [];
+  });
+};
 // 鍒犻櫎寮�绁ㄥ彴璐�
 const delInvoiceLedger = (row) => {
-  ElMessageBox.confirm(
-      '璇ュ彂绁ㄥ彴璐﹀皢琚垹闄�,鏄惁纭鍒犻櫎', {
-        confirmButtonText: '纭',
-        cancelButtonText: '鍙栨秷',
-        type: 'warning',
-      }
-  ).then(() => {
-    delInvoiceLedgerByRegProductId(row.id).then(res => {
-      getList()
-    })
-  }).catch(() => {
-    proxy.$modal.msg("宸插彇娑�")
+  ElMessageBox.confirm("璇ュ彂绁ㄥ彴璐﹀皢琚垹闄�,鏄惁纭鍒犻櫎", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
   })
-}
+    .then(() => {
+      delInvoiceLedgerByRegProductId(row.id).then((res) => {
+        getList();
+      });
+    })
+    .catch(() => {
+      proxy.$modal.msg("宸插彇娑�");
+    });
+};
 
 // 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
 function getCurrentDate() {
   const today = new Date();
   const year = today.getFullYear();
-  const month = String(today.getMonth() + 1).padStart(2, '0'); // 鏈堜唤浠�0寮�濮�
-  const day = String(today.getDate()).padStart(2, '0');
+  const month = String(today.getMonth() + 1).padStart(2, "0"); // 鏈堜唤浠�0寮�濮�
+  const day = String(today.getDate()).padStart(2, "0");
   return `${year}-${month}-${day}`;
 }
+const changeDateRange = (date) => {
+  if (date) {
+    searchForm.invoiceDateStart = date[0];
+    searchForm.invoiceDateEnd = date[1];
+    getList();
+  }
+};
 
-getList()
+const clearRange = () => {
+  searchForm.invoiceDate = [];
+  searchForm.invoiceDateStart = undefined;
+  searchForm.invoiceDateEnd = undefined;
+  getList();
+};
+
+onMounted(() => {
+  getList();
+});
 </script>
 
 <style scoped lang="scss">
-
+.table_list {
+  margin-top: unset;
+}
 </style>

--
Gitblit v1.9.3