From 6697f708b99c9b63e00a7e490f91d1cb4fa64450 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期二, 28 四月 2026 16:33:45 +0800
Subject: [PATCH] Merge branch 'dev_NEW_pro' of http://114.132.189.42:9002/r/product-inventory-management into dev_NEW_pro

---
 src/views/salesManagement/salesLedger/index.vue |  609 +++++++++++++++++++++++++------------------------------
 1 files changed, 276 insertions(+), 333 deletions(-)

diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 1185ca9..dc648be 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -475,26 +475,7 @@
           <el-col :span="24">
             <el-form-item label="闄勪欢鏉愭枡锛�"
                           prop="salesLedgerFiles">
-              <el-upload v-model:file-list="fileList"
-                         :action="upload.url"
-                         multiple
-                         ref="fileUpload"
-                         auto-upload
-                         :headers="upload.headers"
-                         :before-upload="handleBeforeUpload"
-                         :on-error="handleUploadError"
-                         :on-success="handleUploadSuccess"
-                         :on-remove="handleRemove">
-                <el-button type="primary"
-                           v-if="operationType !== 'view'">涓婁紶</el-button>
-                <template #tip
-                          v-if="operationType !== 'view'">
-                  <div class="el-upload__tip">
-                    鏂囦欢鏍煎紡鏀寔
-                    doc锛宒ocx锛寈ls锛寈lsx锛宲pt锛宲ptx锛宲df锛宼xt锛寈ml锛宩pg锛宩peg锛宲ng锛実if锛宐mp锛宺ar锛寊ip锛�7z
-                  </div>
-                </template>
-              </el-upload>
+              <FileUpload v-model:file-list="fileList" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -757,6 +738,7 @@
         </template>
       </el-upload>
     </FormDialog>
+<!-- // todo 闄勪欢棰勮鐩稿叧 -->
     <!-- 闄勪欢鍒楄〃寮圭獥 -->
     <FileListDialog ref="fileListRef"
                     v-model="fileListDialogVisible"
@@ -944,8 +926,11 @@
   import useFormData from "@/hooks/useFormData.js";
   import dayjs from "dayjs";
   import { getCurrentDate } from "@/utils/index.js";
+  import { useRouter, useRoute } from "vue-router";
   import { listCustomerPrivatePool } from "@/api/basicData/customerFile.js";
-
+  import FileUpload from "@/components/AttachmentUpload/file/index.vue";
+  const router = useRouter();
+  const route = useRoute();
   const userStore = useUserStore();
   const { proxy } = getCurrentInstance();
   const tableData = ref([]);
@@ -1040,12 +1025,6 @@
   const { productForm, productRules } = toRefs(productFormData);
   // 闃叉寰幆璁$畻鐨勬爣蹇�
   const isCalculating = ref(false);
-  const upload = reactive({
-    // 涓婁紶鐨勫湴鍧�
-    url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
-    // 璁剧疆涓婁紶鐨勮姹傚ご閮�
-    headers: { Authorization: "Bearer " + getToken() },
-  });
   // 鎵撳嵃鐩稿叧
   const printPreviewVisible = ref(false);
   const printData = ref([]);
@@ -1407,7 +1386,7 @@
         form.value = { ...res };
         form.value.entryPerson = Number(res.entryPerson);
         productData.value = form.value.productData;
-        fileList.value = form.value.salesLedgerFiles;
+        fileList.value = form.value.storageBlobVOs;
       });
     }
     // let userAll = await userStore.getInfo()
@@ -1527,42 +1506,6 @@
   function changs(val) {
     console.log(val);
   }
-  // 涓婁紶鍓嶆牎妫�
-  function handleBeforeUpload(file) {
-    // 鏍℃鏂囦欢澶у皬
-    // if (file.size > 1024 * 1024 * 10) {
-    //   proxy.$modal.msgError("涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃10MB!");
-    //   return false;
-    // }
-    proxy.$modal.loading("姝e湪涓婁紶鏂囦欢锛岃绋嶅��...");
-    return true;
-  }
-  // 涓婁紶澶辫触
-  function handleUploadError(err) {
-    proxy.$modal.msgError("涓婁紶鏂囦欢澶辫触");
-    proxy.$modal.closeLoading();
-  }
-  // 涓婁紶鎴愬姛鍥炶皟
-  function handleUploadSuccess(res, file, uploadFiles) {
-    proxy.$modal.closeLoading();
-    if (res.code === 200) {
-      file.tempId = res.data.tempId;
-      proxy.$modal.msgSuccess("涓婁紶鎴愬姛");
-    } else {
-      proxy.$modal.msgError(res.msg);
-      proxy.$refs.fileUpload.handleRemove(file);
-    }
-  }
-  // 绉婚櫎鏂囦欢
-  function handleRemove(file) {
-    if (operationType.value === "edit") {
-      let ids = [];
-      ids.push(file.id);
-      delLedgerFile(ids).then(res => {
-        proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-      });
-    }
-  }
   // 鎻愪氦琛ㄥ崟
   const submitForm = () => {
     proxy.$refs["formRef"].validate(valid => {
@@ -1574,11 +1517,7 @@
           proxy.$modal.msgWarning("璇锋坊鍔犱骇鍝佷俊鎭�");
           return;
         }
-        let tempFileIds = [];
-        if (fileList.value !== null && fileList.value.length > 0) {
-          tempFileIds = fileList.value.map(item => item.tempId);
-        }
-        form.value.tempFileIds = tempFileIds;
+        form.value.storageBlobDTOs = fileList;
         form.value.type = 1;
         addOrUpdateSalesLedger(form.value).then(res => {
           proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
@@ -1897,279 +1836,282 @@
 
     // 鏋勫缓鎵撳嵃鍐呭
     let printContent = `
-                                          <!DOCTYPE html>
-                                          <html>
-                                          <head>
-                                            <meta charset="UTF-8">
-                                            <title>鎵撳嵃棰勮</title>
-                                            <style>
-                                              body {
-                                                margin: 0;
-                                                padding: 0;
-                                                font-family: "SimSun", serif;
-                                                background: white;
-                                              }
-                                                                                           .print-page {
-                                                  width: 200mm;
-                                                  height: 75mm;
-                                                  padding: 10mm;
-                                                  padding-left: 20mm;
-                                                  background: white;
-                                                  box-sizing: border-box;
-                                                  page-break-after: always;
-                                                  page-break-inside: avoid;
-                                                }
-                                               .print-page:last-child {
-                                                 page-break-after: avoid;
-                                               }
-                                              .delivery-note {
-                                                width: 100%;
-                                                height: 100%;
-                                                font-size: 12px;
-                                                line-height: 1.2;
-                                                display: flex;
-                                                flex-direction: column;
-                                                color: #000;
-                                              }
-                                              .header {
-                                                text-align: center;
-                                                margin-bottom: 8px;
-                                              }
-                                              .company-name {
-                                                font-size: 18px;
-                                                font-weight: bold;
-                                                margin-bottom: 4px;
-                                              }
-                                              .document-title {
-                                                font-size: 16px;
-                                                font-weight: bold;
-                                              }
-                                              .info-section {
-                                                margin-bottom: 8px;
-                                                display: flex;
-                                                justify-content: space-between;
-                                                align-items: center;
-                                              }
-                                              .info-row {
-                                                line-height: 20px;
-                                              }
-                                              .label {
-                                                font-weight: bold;
-                                                width: 60px;
-                                                font-size: 12px;
-                                              }
-                                              .value {
-                                                margin-right: 20px;
-                                                min-width: 80px;
-                                                font-size: 12px;
-                                              }
-                                                       .table-section {
-                                                       margin-bottom: 40px;
-                                                //  flex: 0.6;
-                                               }
-                                              .product-table {
-                                                width: 100%;
-                                                border-collapse: collapse;
-                                                border: 1px solid #000;
-                                              }
-                                                       .product-table th, .product-table td {
-                                                 border: 1px solid #000;
-                                                 padding: 6px;
-                                                 text-align: center;
-                                                 font-size: 12px;
-                                                 line-height: 1.4;
-                                               }
-                                              .product-table th {
-                                                font-weight: bold;
-                                              }
-                                              .total-value {
-                                                font-weight: bold;
-                                              }
-                                              .footer-section {
-                                                margin-top: auto;
-                                              }
-                                              .footer-row {
-                                                display: flex;
-                                                margin-bottom: 3px;
-                                                line-height: 22px;
-                                                justify-content: space-between;
-                                              }
-                                              .footer-item {
-                                                display: flex;
-                                                margin-right: 20px;
-                                              }
-                                              .footer-item .label {
-                                                font-weight: bold;
-                                                width: 80px;
-                                                font-size: 12px;
-                                              }
-                                              .footer-item .value {
-                                                min-width: 80px;
-                                                font-size: 12px;
-                                              }
-                                              .address-item .address-value {
-                                                min-width: 200px;
-                                              }
-                                              @media print {
-                                                body {
-                                                  margin: 0;
-                                                  padding: 0;
-                                                }
-                                                           .print-page {
-                                                   margin: 0;
-                                                   padding: 10mm;
-                                                   /* padding-left: 20mm; */
-                                                   page-break-inside: avoid;
-                                                   page-break-after: always;
-                                                 }
-                                                 .print-page:last-child {
-                                                   page-break-after: avoid;
-                                                 }
-                                              }
-                                            </style>
-                                          </head>
-                                          <body>
-                                        `;
+                                                    <!DOCTYPE html>
+                                                    <html>
+                                                    <head>
+                                                      <meta charset="UTF-8">
+                                                      <title>鎵撳嵃棰勮</title>
+                                                      <style>
+                                                        body {
+                                                          margin: 0;
+                                                          padding: 0;
+                                                          font-family: "SimSun", serif;
+                                                          background: white;
+                                                        }
+                                                                                                     .print-page {
+                                                            width: 200mm;
+                                                            height: 75mm;
+                                                            padding: 10mm;
+                                                            padding-left: 20mm;
+                                                            background: white;
+                                                            box-sizing: border-box;
+                                                            page-break-after: always;
+                                                            page-break-inside: avoid;
+                                                          }
+                                                         .print-page:last-child {
+                                                           page-break-after: avoid;
+                                                         }
+                                                        .delivery-note {
+                                                          width: 100%;
+                                                          height: 100%;
+                                                          font-size: 12px;
+                                                          line-height: 1.2;
+                                                          display: flex;
+                                                          flex-direction: column;
+                                                          color: #000;
+                                                        }
+                                                        .header {
+                                                          text-align: center;
+                                                          margin-bottom: 8px;
+                                                        }
+                                                        .company-name {
+                                                          font-size: 18px;
+                                                          font-weight: bold;
+                                                          margin-bottom: 4px;
+                                                        }
+                                                        .document-title {
+                                                          font-size: 16px;
+                                                          font-weight: bold;
+                                                        }
+                                                        .info-section {
+                                                          margin-bottom: 8px;
+                                                          display: flex;
+                                                          justify-content: space-between;
+                                                          align-items: center;
+                                                        }
+                                                        .info-row {
+                                                          line-height: 20px;
+                                                        }
+                                                        .label {
+                                                          font-weight: bold;
+                                                          width: 60px;
+                                                          font-size: 12px;
+                                                        }
+                                                        .value {
+                                                          margin-right: 20px;
+                                                          min-width: 80px;
+                                                          font-size: 12px;
+                                                        }
+                                                                 .table-section {
+                                                                 margin-bottom: 40px;
+                                                          //  flex: 0.6;
+                                                         }
+                                                        .product-table {
+                                                          width: 100%;
+                                                          border-collapse: collapse;
+                                                          border: 1px solid #000;
+                                                        }
+                                                                 .product-table th, .product-table td {
+                                                           border: 1px solid #000;
+                                                           padding: 6px;
+                                                           text-align: center;
+                                                           font-size: 12px;
+                                                           line-height: 1.4;
+                                                         }
+                                                        .product-table th {
+                                                          font-weight: bold;
+                                                        }
+                                                        .total-value {
+                                                          font-weight: bold;
+                                                        }
+                                                        .footer-section {
+                                                          margin-top: auto;
+                                                        }
+                                                        .footer-row {
+                                                          display: flex;
+                                                          margin-bottom: 3px;
+                                                          line-height: 22px;
+                                                          justify-content: space-between;
+                                                        }
+                                                        .footer-item {
+                                                          display: flex;
+                                                          margin-right: 20px;
+                                                        }
+                                                        .footer-item .label {
+                                                          font-weight: bold;
+                                                          width: 80px;
+                                                          font-size: 12px;
+                                                        }
+                                                        .footer-item .value {
+                                                          min-width: 80px;
+                                                          font-size: 12px;
+                                                        }
+                                                        .address-item .address-value {
+                                                          min-width: 200px;
+                                                        }
+                                                        @media print {
+                                                          body {
+                                                            margin: 0;
+                                                            padding: 0;
+                                                          }
+                                                                     .print-page {
+                                                             margin: 0;
+                                                             padding: 10mm;
+                                                             /* padding-left: 20mm; */
+                                                             page-break-inside: avoid;
+                                                             page-break-after: always;
+                                                           }
+                                                           .print-page:last-child {
+                                                             page-break-after: avoid;
+                                                           }
+                                                        }
+                                                      </style>
+                                                    </head>
+                                                    <body>
+                                                  `;
 
     // 涓烘瘡鏉℃暟鎹敓鎴愭墦鍗伴〉闈�
     printData.value.forEach((item, index) => {
       printContent += `
-                                            <div class="print-page">
-                                              <div class="delivery-note">
-                                                <div class="header">
-                                                  <div class="document-title">闆跺敭鍙戣揣鍗�</div>
-                                                </div>
-                                                
-                                                <div class="info-section">
-                                                  <div class="info-row">
-                                                    <div>
-                                                      <span class="label">鍙戣揣鏃ユ湡锛�</span>
-                                                      <span class="value">${formatDate(
-                                                        item.createTime
-                                                      )}</span>
-                                                    </div>
-                                                    <div>
-                                                      <span class="label">瀹㈡埛鍚嶇О锛�</span>
-                                                      <span class="value">${
-                                                        item.customerName
-                                                      }</span>
-                                                    </div>
-                                                  </div>
-                                                  <div class="info-row">
-                                                    <span class="label">鍗曞彿锛�</span>
-                                                    <span class="value">${
-                                                      item.salesContractNo || ""
-                                                    }</span>
-                                                  </div>
-                                                </div>
+                                                      <div class="print-page">
+                                                        <div class="delivery-note">
+                                                          <div class="header">
+                                                            <div class="document-title">闆跺敭鍙戣揣鍗�</div>
+                                                          </div>
+                                                          
+                                                          <div class="info-section">
+                                                            <div class="info-row">
+                                                              <div>
+                                                                <span class="label">鍙戣揣鏃ユ湡锛�</span>
+                                                                <span class="value">${formatDate(
+                                                                  item.createTime
+                                                                )}</span>
+                                                              </div>
+                                                              <div>
+                                                                <span class="label">瀹㈡埛鍚嶇О锛�</span>
+                                                                <span class="value">${
+                                                                  item.customerName
+                                                                }</span>
+                                                              </div>
+                                                            </div>
+                                                            <div class="info-row">
+                                                              <span class="label">鍗曞彿锛�</span>
+                                                              <span class="value">${
+                                                                item.salesContractNo ||
+                                                                ""
+                                                              }</span>
+                                                            </div>
+                                                          </div>
 
-                                                <div class="table-section">
-                                                  <table class="product-table">
-                                                    <thead>
-                                                      <tr>
-                                                        <th>浜у搧鍚嶇О</th>
-                                                        <th>瑙勬牸鍨嬪彿</th>
-                                                        <th>鍗曚綅</th>
-                                                        <th>鍗曚环</th>
-                                                        <th>闆跺敭鏁伴噺</th>
-                                                        <th>闆跺敭閲戦</th>
-                                                      </tr>
-                                                    </thead>
-                                                    <tbody>
-                                                      ${
-                                                        item.products &&
-                                                        item.products.length > 0
-                                                          ? item.products
-                                                              .map(
-                                                                product => `
-                                                          <tr>
-                                                            <td>${
-                                                              product.productCategory ||
-                                                              ""
-                                                            }</td>
-                                                            <td>${
-                                                              product.specificationModel ||
-                                                              ""
-                                                            }</td>
-                                                            <td>${
-                                                              product.unit || ""
-                                                            }</td>
-                                                            <td>${
-                                                              product.taxInclusiveUnitPrice ||
-                                                              "0"
-                                                            }</td>
-                                                            <td>${
-                                                              product.quantity ||
-                                                              "0"
-                                                            }</td>
-                                                            <td>${
-                                                              product.taxInclusiveTotalPrice ||
-                                                              "0"
-                                                            }</td>
-                                                          </tr>
-                                                        `
-                                                              )
-                                                              .join("")
-                                                          : '<tr><td colspan="6" style="text-align: center; color: #999;">鏆傛棤浜у搧鏁版嵁</td></tr>'
-                                                      }
-                                                    </tbody>
-                                                    <tfoot>
-                                                      <tr>
-                                                        <td class="label">鍚堣</td>
-                                                        <td class="total-value"></td>
-                                                        <td class="total-value"></td>
-                                                        <td class="total-value"></td>
-                                                        <td class="total-value">${getTotalQuantityForPrint(
-                                                          item.products
-                                                        )}</td>
-                                                        <td class="total-value">${getTotalAmountForPrint(
-                                                          item.products
-                                                        )}</td>
-                                                      </tr>
-                                                    </tfoot>
-                                                  </table>
-                                                </div>
+                                                          <div class="table-section">
+                                                            <table class="product-table">
+                                                              <thead>
+                                                                <tr>
+                                                                  <th>浜у搧鍚嶇О</th>
+                                                                  <th>瑙勬牸鍨嬪彿</th>
+                                                                  <th>鍗曚綅</th>
+                                                                  <th>鍗曚环</th>
+                                                                  <th>闆跺敭鏁伴噺</th>
+                                                                  <th>闆跺敭閲戦</th>
+                                                                </tr>
+                                                              </thead>
+                                                              <tbody>
+                                                                ${
+                                                                  item.products &&
+                                                                  item.products
+                                                                    .length > 0
+                                                                    ? item.products
+                                                                        .map(
+                                                                          product => `
+                                                                    <tr>
+                                                                      <td>${
+                                                                        product.productCategory ||
+                                                                        ""
+                                                                      }</td>
+                                                                      <td>${
+                                                                        product.specificationModel ||
+                                                                        ""
+                                                                      }</td>
+                                                                      <td>${
+                                                                        product.unit ||
+                                                                        ""
+                                                                      }</td>
+                                                                      <td>${
+                                                                        product.taxInclusiveUnitPrice ||
+                                                                        "0"
+                                                                      }</td>
+                                                                      <td>${
+                                                                        product.quantity ||
+                                                                        "0"
+                                                                      }</td>
+                                                                      <td>${
+                                                                        product.taxInclusiveTotalPrice ||
+                                                                        "0"
+                                                                      }</td>
+                                                                    </tr>
+                                                                  `
+                                                                        )
+                                                                        .join("")
+                                                                    : '<tr><td colspan="6" style="text-align: center; color: #999;">鏆傛棤浜у搧鏁版嵁</td></tr>'
+                                                                }
+                                                              </tbody>
+                                                              <tfoot>
+                                                                <tr>
+                                                                  <td class="label">鍚堣</td>
+                                                                  <td class="total-value"></td>
+                                                                  <td class="total-value"></td>
+                                                                  <td class="total-value"></td>
+                                                                  <td class="total-value">${getTotalQuantityForPrint(
+                                                                    item.products
+                                                                  )}</td>
+                                                                  <td class="total-value">${getTotalAmountForPrint(
+                                                                    item.products
+                                                                  )}</td>
+                                                                </tr>
+                                                              </tfoot>
+                                                            </table>
+                                                          </div>
 
-                                                <div class="footer-section">
-                                                  <div class="footer-row">
-                                                    <div class="footer-item">
-                                                      <span class="label">鏀惰揣鐢佃瘽锛�</span>
-                                                      <span class="value"></span>
-                                                    </div>
-                                                    <div class="footer-item">
-                                                      <span class="label">鏀惰揣浜猴細</span>
-                                                      <span class="value"></span>
-                                                    </div>
-                                                    <div class="footer-item address-item">
-                                                      <span class="label">鏀惰揣鍦板潃锛�</span>
-                                                      <span class="value address-value"></span>
-                                                    </div>
-                                                  </div>
-                                                  <div class="footer-row">
-                                                    <div class="footer-item">
-                                                      <span class="label">鎿嶄綔鍛橈細</span>
-                                                      <span class="value">${
-                                                        userStore.nickName ||
-                                                        "鎾曞紑鍓�"
-                                                      }</span>
-                                                    </div>
-                                                    <div class="footer-item">
-                                                      <span class="label">鎵撳嵃鏃ユ湡锛�</span>
-                                                      <span class="value">${formatDateTime(
-                                                        new Date()
-                                                      )}</span>
-                                                    </div>
-                                                  </div>
-                                                </div>
-                                              </div>
-                                            </div>
-                                          `;
+                                                          <div class="footer-section">
+                                                            <div class="footer-row">
+                                                              <div class="footer-item">
+                                                                <span class="label">鏀惰揣鐢佃瘽锛�</span>
+                                                                <span class="value"></span>
+                                                              </div>
+                                                              <div class="footer-item">
+                                                                <span class="label">鏀惰揣浜猴細</span>
+                                                                <span class="value"></span>
+                                                              </div>
+                                                              <div class="footer-item address-item">
+                                                                <span class="label">鏀惰揣鍦板潃锛�</span>
+                                                                <span class="value address-value"></span>
+                                                              </div>
+                                                            </div>
+                                                            <div class="footer-row">
+                                                              <div class="footer-item">
+                                                                <span class="label">鎿嶄綔鍛橈細</span>
+                                                                <span class="value">${
+                                                                  userStore.nickName ||
+                                                                  "鎾曞紑鍓�"
+                                                                }</span>
+                                                              </div>
+                                                              <div class="footer-item">
+                                                                <span class="label">鎵撳嵃鏃ユ湡锛�</span>
+                                                                <span class="value">${formatDateTime(
+                                                                  new Date()
+                                                                )}</span>
+                                                              </div>
+                                                            </div>
+                                                          </div>
+                                                        </div>
+                                                      </div>
+                                                    `;
     });
 
     printContent += `
-                                          </body>
-                                          </html>
-                                        `;
+                                                    </body>
+                                                    </html>
+                                                  `;
 
     // 鍐欏叆鍐呭鍒版柊绐楀彛
     printWindow.document.write(printContent);
@@ -2584,6 +2526,7 @@
     currentFactoryName.value = res.user.currentFactoryName;
   };
   onMounted(() => {
+    searchForm.salesContractNo = route.query.salesContractNo;
     getList();
     userListNoPage().then(res => {
       userList.value = res.data;

--
Gitblit v1.9.3