From bcefcad229dc22a8994364afc7827aab8123dd79 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 29 六月 2026 11:29:16 +0800
Subject: [PATCH] 新疆大罗素 1.隐藏字段

---
 src/views/salesManagement/salesLedger/index.vue |  345 ++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 267 insertions(+), 78 deletions(-)

diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 4c13d3d..83a0597 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -2,6 +2,15 @@
   <div class="app-container">
     <div class="search_form">
       <el-form :model="searchForm" :inline="true">
+        <el-form-item label="鎬诲悎鍚屽彿锛�">
+          <el-input
+            v-model="searchForm.masterContractNo"
+            placeholder="璇疯緭鍏�"
+            clearable
+            prefix-icon="Search"
+            @change="handleQuery"
+          />
+        </el-form-item>
         <el-form-item label="瀹㈡埛鍚嶇О锛�">
           <el-input
             v-model="searchForm.customerName"
@@ -11,7 +20,7 @@
             @change="handleQuery"
           />
         </el-form-item>
-        <el-form-item label="閿�鍞悎鍚屽彿锛�">
+        <el-form-item label="璁㈠崟鍙凤細">
           <el-input
             v-model="searchForm.salesContractNo"
             placeholder="璇疯緭鍏�"
@@ -56,7 +65,7 @@
             >瀵煎叆
           </el-button>
           <el-button @click="handleOut">瀵煎嚭</el-button>
-          <el-button type="danger" plain @click="handleDelete">鍒犻櫎 </el-button>
+          <el-button type="danger" plain @click="handleDelete" v-hasPermi="['salesManagement:salesLedger:remove']">鍒犻櫎 </el-button>
           <el-button type="primary" plain @click="handlePrint">鎵撳嵃 </el-button>
         </div>
       </div>
@@ -183,9 +192,21 @@
         </el-table-column>
         <el-table-column align="center" label="搴忓彿" type="index" width="60" />
         <el-table-column
-          label="閿�鍞悎鍚屽彿"
+          label="閿�鍞�诲悎鍚屽彿"
+          prop="masterContractNo"
+          width="150"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="璁㈠崟鍙�"
           prop="salesContractNo"
           width="180"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="閲囪喘鍚堝悓鍙�"
+          prop="purchaseMasterContractNo"
+          width="150"
           show-overflow-tooltip
         />
         <el-table-column
@@ -248,24 +269,41 @@
           width="200"
           show-overflow-tooltip
         />
-        <el-table-column fixed="right" label="鎿嶄綔" width="220" align="center">
+        <el-table-column
+          label="閫�璐х姸鎬�"
+          prop="returnStatus"
+          align="center"
+          width="100"
+        >
           <template #default="scope">
+            <el-tag
+              :type="getReturnStatusType(scope.row.returnStatus)"
+              size="small"
+            >
+              {{ scope.row.returnStatus || '鏃犻��璐�' }}
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column fixed="right" label="鎿嶄綔" width="280" align="center">
+          <template #default="scope">
+						<el-button
+							link
+		          type="primary"
+		          @click="openForm('edit', scope.row)"
+						>缂栬緫
+						</el-button>
             <el-button link type="primary" @click="openForm('view', scope.row)"
               >璇︽儏
+            </el-button>
+            <el-button link type="primary" @click="openFileDialog(scope.row)"
+              >闄勪欢
             </el-button>
             <el-button
               link
               type="primary"
-              @click="openForm('edit', scope.row)"
-              :disabled="
-                !scope.row.isEdit ||
-                scope.row.hasProductionRecord ||
-                !canEditLedger(scope.row)
-              "
-              >缂栬緫
-            </el-button>
-            <el-button link type="primary" @click="openFileDialog(scope.row)"
-              >闄勪欢
+              v-if="scope.row.masterContractNo"
+              @click="openContractFileDialog(scope.row)"
+              >鎬诲悎鍚岄檮浠�
             </el-button>
           </template>
         </el-table-column>
@@ -311,7 +349,7 @@
         </el-row>
         <el-row :gutter="30">
           <el-col :span="12">
-            <el-form-item label="閿�鍞悎鍚屽彿锛�" prop="salesContractNo">
+            <el-form-item label="璁㈠崟鍙凤細" prop="salesContractNo">
               <div
                 style="
                   display: flex;
@@ -366,6 +404,7 @@
                 clearable
                 :disabled="operationType === 'view'"
                 filterable
+                @change="handleCustomerChange"
               >
                 <el-option
                   v-for="item in customerOption"
@@ -381,6 +420,26 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
+            <el-form-item label="鎬诲悎鍚屽彿锛�">
+              <el-select
+                v-model="form.masterContractNo"
+                placeholder="璇峰厛閫夋嫨瀹㈡埛"
+                clearable
+                filterable
+                :disabled="operationType === 'view' || !form.customerId"
+              >
+                <el-option
+                  v-for="item in contractList"
+                  :key="item.id"
+                  :label="item.masterContractNo"
+                  :value="item.masterContractNo"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="30">
+          <el-col :span="12">
             <el-form-item label="椤圭洰鍚嶇О锛�" prop="projectName">
               <el-input
                 v-model="form.projectName"
@@ -390,8 +449,6 @@
               />
             </el-form-item>
           </el-col>
-        </el-row>
-        <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="绛捐鏃ユ湡锛�" prop="executionDate">
               <el-date-picker
@@ -406,11 +463,53 @@
               />
             </el-form-item>
           </el-col>
+        </el-row>
+        <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="浠樻鏂瑰紡">
-              <el-input
+              <el-select
                 v-model="form.paymentMethod"
-                placeholder="璇疯緭鍏�"
+                placeholder="璇烽�夋嫨"
+                clearable
+                :disabled="operationType === 'view'"
+                style="width: 100%"
+              >
+                <el-option label="鐜伴噾" value="鐜伴噾" />
+                <el-option label="鐢垫眹" value="鐢垫眹" />
+                <el-option label="寰俊" value="寰俊" />
+                <el-option label="鏀粯瀹�" value="鏀粯瀹�" />
+                <el-option label="鏀エ" value="鏀エ" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="閲囪喘鍚堝悓鍙凤細" prop="purchaseContractNumber">
+              <el-select
+                v-model="form.purchaseContractNumber"
+                placeholder="璇烽�夋嫨閲囪喘鍚堝悓鍙�"
+                clearable
+                filterable
+                style="width: 100%"
+                :disabled="operationType === 'view'"
+              >
+                <el-option
+                  v-for="item in purchaseContractOptions"
+                  :key="item.purchaseContractNumber"
+                  :label="item.purchaseContractNumber + ' - ' + item.supplierName"
+                  :value="item.purchaseContractNumber"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="浜よ揣鏃ユ湡锛�" prop="entryDate">
+              <el-date-picker
+                style="width: 100%"
+                v-model="form.deliveryDate"
+                value-format="YYYY-MM-DD"
+                format="YYYY-MM-DD"
+                type="date"
+                placeholder="璇烽�夋嫨"
                 clearable
                 :disabled="operationType === 'view'"
               />
@@ -454,22 +553,6 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row :gutter="30">
-          <el-col :span="12">
-            <el-form-item label="浜よ揣鏃ユ湡锛�" prop="entryDate">
-              <el-date-picker
-                style="width: 100%"
-                v-model="form.deliveryDate"
-                value-format="YYYY-MM-DD"
-                format="YYYY-MM-DD"
-                type="date"
-                placeholder="璇烽�夋嫨"
-                clearable
-                :disabled="operationType === 'view'"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
         <el-row>
           <el-form-item label="浜у搧淇℃伅锛�" prop="entryDate">
             <el-button
@@ -482,8 +565,7 @@
               v-if="operationType !== 'view'"
               plain
               type="danger"
-              @click="deleteProduct"
-              >鍒犻櫎
+              @click="deleteProduct">鍒犻櫎
             </el-button>
           </el-form-item>
         </el-row>
@@ -515,25 +597,26 @@
           <el-table-column
             label="鍚◣鍗曚环(鍏�)"
             prop="taxInclusiveUnitPrice"
-            :formatter="formattedNumber"
+            :formatter="sensitiveAmountFormatter"
           />
           <el-table-column
             label="鍚◣鎬讳环(鍏�)"
             prop="taxInclusiveTotalPrice"
-            :formatter="formattedNumber"
+            :formatter="sensitiveAmountFormatter"
           />
           <el-table-column
             label="涓嶅惈绋庢�讳环(鍏�)"
             prop="taxExclusiveTotalPrice"
-            :formatter="formattedNumber"
+            :formatter="sensitiveAmountFormatter"
           />
-          <el-table-column label="鏄惁鐢熶骇" prop="isProduction" width="150">
+          <!-- 鏄惁鐢熶骇鍒楀凡闅愯棌锛岄粯璁ゅ�间负 false -->
+          <!-- <el-table-column label="鏄惁鐢熶骇" prop="isProduction" width="150">
             <template #default="scope">
               <el-tag :type="scope.row.isProduction ? 'success' : 'info'">
                 {{ scope.row.isProduction ? "鏄�" : "鍚�" }}
               </el-tag>
             </template>
-          </el-table-column>
+          </el-table-column> -->
           <el-table-column
             fixed="right"
             label="鎿嶄綔"
@@ -823,14 +906,15 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="12">
+          <!-- 鏄惁鐢熶骇瀛楁宸查殣钘忥紝榛樿鍊间负 false -->
+          <!-- <el-col :span="12">
             <el-form-item label="鏄惁鐢熶骇锛�" prop="isProduction">
               <el-radio-group v-model="productForm.isProduction">
                 <el-radio label="鏄�" :value="true" />
                 <el-radio label="鍚�" :value="false" />
               </el-radio-group>
             </el-form-item>
-          </el-col>
+          </el-col> -->
         </el-row>
       </el-form>
     </FormDialog>
@@ -877,6 +961,29 @@
       record-type="sales_ledger"
       :record-id="recordId"
     />
+    <!-- 鎬诲悎鍚岄檮浠跺脊绐� -->
+    <el-dialog
+      v-model="contractFileDialogVisible"
+      title="鎬诲悎鍚岄檮浠�"
+      width="700px"
+      :close-on-click-modal="false"
+    >
+      <el-table :data="contractFileList" border v-if="contractFileList.length">
+        <el-table-column prop="name" label="鏂囦欢鍚嶇О" show-overflow-tooltip />
+        <el-table-column prop="byteSize" label="鏂囦欢澶у皬" width="120">
+          <template #default="{ row }">
+            {{ formatFileSize(row.byteSize) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="鎿嶄綔" width="150">
+          <template #default="{ row }">
+            <el-link type="primary" :href="row.previewURL" target="_blank">棰勮</el-link>
+            <el-link type="primary" :href="row.downloadURL" style="margin-left: 10px">涓嬭浇</el-link>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-empty v-else description="鏆傛棤闄勪欢" />
+    </el-dialog>
     <!-- 鎵撳嵃棰勮寮圭獥 -->
     <el-dialog
       v-model="printPreviewVisible"
@@ -1062,6 +1169,15 @@
               />
             </el-form-item>
           </el-col>
+          <el-col :span="24" v-if="deliveryForm.type === '璐ц溅'">
+            <el-form-item label="鍑哄簱鎵瑰彿锛�" prop="outboundBatches">
+              <el-input
+                v-model="deliveryForm.outboundBatches"
+                placeholder="璇疯緭鍏ュ嚭搴撴壒鍙�"
+                clearable
+              />
+            </el-form-item>
+          </el-col>
           <el-col :span="24" v-else>
             <el-form-item label="蹇�掑叕鍙革細" prop="expressCompany">
               <el-input
@@ -1180,12 +1296,14 @@
 } from "@/api/salesManagement/salesLedger.js";
 import { getStockInventoryByModelId } from "@/api/inventoryManagement/stockInventory.js";
 import { modelList, productTreeList } from "@/api/basicData/product.js";
+import { purchaseList } from "@/api/procurementManagement/procurementLedger.js";
 import useFormData from "@/hooks/useFormData.js";
 import dayjs from "dayjs";
 import FileUpload from "@/components/AttachmentUpload/file/index.vue";
 import ImageUpload from "@/components/AttachmentUpload/image/index.vue";
 import { getCurrentDate } from "@/utils/index.js";
 import { listCustomer } from "@/api/basicData/customer.js";
+import { getCustomerContractList, getContractFilesByNo } from "@/api/basicData/customerContract.js";
 
 const FileList = defineAsyncComponent(() =>
   import("@/components/Dialog/FileList.vue")
@@ -1204,6 +1322,7 @@
 const customerOption = ref([]);
 const productOptions = ref([]);
 const modelOptions = ref([]);
+const purchaseContractOptions = ref([]);
 const tableLoading = ref(false);
 const page = reactive({
   current: 1,
@@ -1212,6 +1331,11 @@
 const total = ref(0);
 const fileList = ref([]);
 const deliveryFileList = ref([]);
+// 鍚堝悓鍒楄〃锛堜緵涓嬫媺閫夋嫨锛�
+const contractList = ref([]);
+// 鎬诲悎鍚岄檮浠跺脊绐�
+const contractFileDialogVisible = ref(false);
+const contractFileList = ref([]);
 
 // 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
 const operationType = ref("");
@@ -1220,6 +1344,7 @@
   searchForm: {
     customerName: "", // 瀹㈡埛鍚嶇О
     salesContractNo: "", // 閿�鍞悎鍚岀紪鍙�
+    masterContractNo: "", // 鎬诲悎鍚屽彿
     entryDate: null, // 褰曞叆鏃ユ湡
     entryDateStart: undefined,
     entryDateEnd: undefined,
@@ -1237,6 +1362,8 @@
     executionDate: "",
     hasProductionRecord: false,
     createTime: "",
+    masterContractNo: "",
+    purchaseContractNumber: "",
   },
   rules: {
     salesman: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
@@ -1264,7 +1391,7 @@
     taxInclusiveTotalPrice: "",
     taxExclusiveTotalPrice: "",
     invoiceType: "",
-    isProduction: false,
+    isProduction: false, // 榛樿鍊间负 false锛堝惁锛�
   },
   productRules: {
     productCategory: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
@@ -1375,22 +1502,9 @@
 const getDeliveryBatchNoList = async (productModelId) => {
   if (!productModelId) return [];
   const res = await getStockInventoryByModelId(productModelId);
-  const rawList = Array.isArray(res?.data)
-    ? res.data
-    : res?.data?.records || res?.data?.rows || [];
+  const rawList = res.data || [];
   const seenIds = new Set();
   return rawList
-    .filter((item) => {
-      if (!item?.id || !item?.batchNo || seenIds.has(item.id)) {
-        return false;
-      }
-      seenIds.add(item.id);
-      return true;
-    })
-    .map((item) => ({
-      ...item,
-      deliveryQuantity: 0,
-    }));
 };
 const validateDeliveryShippingCarNumber = (_rule, value, callback) => {
   if (deliveryForm.value.type === "璐ц溅" && !value) {
@@ -1410,6 +1524,7 @@
     expressCompany: "",
     expressNumber: "",
     type: "璐ц溅", // 璐ц溅, 蹇��
+    outboundBatches: "",
   },
   deliveryRules: {
     shippingCarNumber: [
@@ -1729,10 +1844,6 @@
 };
 // 鎵撳紑寮规
 const openForm = async (type, row) => {
-  if (type === "edit" && row && !canEditLedger(row)) {
-    proxy.$modal.msgWarning("褰撳墠绯荤粺鐧诲綍浜轰笉鏄淮鎶や汉锛屼笉鑳界紪杈戞暟鎹�");
-    return;
-  }
   operationType.value = type;
   form.value = {};
   productData.value = [];
@@ -1742,6 +1853,8 @@
   listCustomer({ current: -1, size: -1, type: 0 }).then((res) => {
     customerOption.value = res.data.records;
   });
+  // 鑾峰彇閲囪喘鍚堝悓鍒楄〃
+  await getPurchaseContractList();
   form.value.entryPerson = userStore.id;
   if (type === "add") {
     // 鏂板鏃惰缃綍鍏ユ棩鏈熶负褰撳ぉ
@@ -1749,18 +1862,29 @@
     // 绛捐鏃ユ湡榛樿涓哄綋澶�
     form.value.executionDate = getCurrentDate();
     // 鍒涘缓鏃堕棿榛樿涓哄綋澶�
-    form.value.createTime = getCurrentDate();
-    // 榛樿鑷姩鐢熸垚閿�鍞悎鍚屽彿
+    form.value.createTime = dayjs().format("YYYY-MM-DD HH:mm:ss");
+    // 榛樿鑷姩鐢熸垚璁㈠崟鍙�
     form.value.autoGenerateContractNo = true;
   } else {
     currentId.value = row.id;
-    getSalesLedgerWithProducts({ id: row.id, type: 1 }).then((res) => {
+    getSalesLedgerWithProducts({ id: row.id, type: 1 }).then(async (res) => {
       form.value = { ...res };
       form.value.entryPerson = Number(res.entryPerson);
       productData.value = form.value.productData;
       fileList.value = form.value.storageBlobVOs;
       // 缂栬緫鏃惰缃嚜鍔ㄧ敓鎴愪负false锛屽厑璁告墜鍔ㄤ慨鏀�
       form.value.autoGenerateContractNo = false;
+      // 缂栬緫鏃跺姞杞藉鎴风殑鍚堝悓鍒楄〃浠ヤ究鍥炴樉鎬诲悎鍚屽彿
+      if (res.customerId) {
+        try {
+          const contractRes = await getCustomerContractList(res.customerId);
+          if (contractRes.code === 200) {
+            contractList.value = contractRes.data || [];
+          }
+        } catch (error) {
+          console.error('鑾峰彇瀹㈡埛鍚堝悓鍒楄〃澶辫触:', error);
+        }
+      }
     });
   }
   // let userAll = await userStore.getInfo()
@@ -1871,7 +1995,7 @@
       taxInclusiveTotalPrice: taxInclusiveTotalPrice,
       taxExclusiveTotalPrice: taxExclusiveTotalPrice,
       invoiceType: "澧炴櫘绁�",
-      isProduction: true,
+      isProduction: false, // 榛樿鍊间负 false锛堝惁锛�
       productId: p.productId,
       productModelId: p.productModelId,
     };
@@ -1927,7 +2051,7 @@
   productOperationType.value = type;
   productForm.value = {};
   if (type === "add") {
-    productForm.value.isProduction = true;
+    productForm.value.isProduction = false; // 榛樿鍊间负 false锛堝惁锛�
   }
   proxy.resetForm("productFormRef");
   if (type === "edit") {
@@ -1962,6 +2086,17 @@
     getProductOptions();
   }
   productFormVisible.value = true;
+};
+
+// 鑾峰彇閲囪喘鍚堝悓鍒楄〃
+const getPurchaseContractList = async () => {
+  try {
+    const res = await purchaseList({ current: -1, size: -1 });
+    purchaseContractOptions.value = res.rows;
+  } catch (error) {
+    console.error("鑾峰彇閲囪喘鍚堝悓鍒楄〃澶辫触", error);
+    purchaseContractOptions.value = [];
+  }
 };
 // 鎻愪氦浜у搧琛ㄥ崟
 const submitProduct = () => {
@@ -2085,7 +2220,7 @@
   return status === "宸插彂璐�" || status === "瀹℃牳閫氳繃";
 };
 
-/** 鍒ゆ柇閿�鍞鍗曚笅鏄惁瀛樺湪宸插彂璐�/鍙戣揣瀹屾垚鐨勪骇鍝侊紙涓嶅彲鍒犻櫎锛� */
+/** 鍒ゆ柇璁㈠崟鍙蜂笅鏄惁瀛樺湪宸插彂璐�/鍙戣揣瀹屾垚鐨勪骇鍝侊紙涓嶅彲鍒犻櫎锛� */
 const hasShippedProducts = (products) => {
   if (!products || !products.length) return false;
   return products.some((p) => {
@@ -2114,7 +2249,7 @@
   }
   const ids = selectedRows.value.map((item) => item.id);
 
-  // 妫�鏌ユ槸鍚︽湁宸茶繘琛屽彂璐ф垨鍙戣揣瀹屾垚鐨勯攢鍞鍗曪紝鑻ユ湁鍒欎笉鍏佽鍒犻櫎
+  // 妫�鏌ユ槸鍚︽湁宸茶繘琛屽彂璐ф垨鍙戣揣瀹屾垚鐨勮鍗曞彿锛岃嫢鏈夊垯涓嶅厑璁稿垹闄�
   const cannotDeleteNames = [];
   for (const row of selectedRows.value) {
     let products =
@@ -2133,7 +2268,7 @@
   }
   if (cannotDeleteNames.length > 0) {
     proxy.$modal.msgWarning(
-      "宸茶繘琛屽彂璐ф垨鍙戣揣瀹屾垚鐨勯攢鍞鍗曚笉鑳藉垹闄わ細" + cannotDeleteNames.join("銆�")
+      "宸茶繘琛屽彂璐ф垨鍙戣揣瀹屾垚鐨勮鍗曞彿涓嶈兘鍒犻櫎锛�" + cannotDeleteNames.join("銆�")
     );
     return;
   }
@@ -2155,7 +2290,7 @@
 };
 
 // 鎵撳嵃鍔熻兘
-const handlePrint = async () => {
+  const handlePrint = async () => {
   if (selectedRows.value.length === 0) {
     proxy.$modal.msgWarning("璇烽�夋嫨瑕佹墦鍗扮殑鏁版嵁");
     return;
@@ -2512,11 +2647,7 @@
 // 鏍煎紡鍖栨棩鏈�
 const formatDate = (dateString) => {
   if (!dateString) return getCurrentDate();
-  const date = new Date(dateString);
-  const year = date.getFullYear();
-  const month = String(date.getMonth() + 1).padStart(2, "0");
-  const day = String(date.getDate()).padStart(2, "0");
-  return `${year}/${month}/${day}`;
+  return dayjs(dateString).format("YYYY/MM/DD HH:mm:ss");
 };
 // 鏍煎紡鍖栨棩鏈熸椂闂�
 const formatDateTime = (date) => {
@@ -2860,6 +2991,7 @@
     type: "璐ц溅",
     batchNo: [],
     batchNoList,
+    outboundBatches: "",
   };
   deliveryFileList.value = [];
   deliveryFormVisible.value = true;
@@ -2902,6 +3034,10 @@
         shippingCarNumber:
           deliveryForm.value.type === "璐ц溅"
             ? deliveryForm.value.shippingCarNumber
+            : "",
+        outboundBatches:
+          deliveryForm.value.type === "璐ц溅"
+            ? deliveryForm.value.outboundBatches
             : "",
         expressCompany:
           deliveryForm.value.type === "蹇��"
@@ -2971,6 +3107,59 @@
   let res = await userStore.getInfo();
   currentFactoryName.value = res.user.currentFactoryName;
 };
+
+// 鑾峰彇閫�璐х姸鎬佹爣绛剧被鍨�
+const getReturnStatusType = (returnStatus) => {
+  const statusMap = {
+    '鏃犻��璐�': 'success',
+    '閮ㄥ垎閫�璐�': 'warning',
+    '鍏ㄩ儴閫�璐�': 'danger',
+  };
+  return statusMap[returnStatus] || 'info';
+};
+
+// 瀹㈡埛閫夋嫨鍙樺寲鏃讹紝鍔犺浇璇ュ鎴风殑鍚堝悓鍒楄〃
+const handleCustomerChange = async (customerId) => {
+  form.value.masterContractNo = '';
+  contractList.value = [];
+  if (!customerId) return;
+
+  try {
+    const res = await getCustomerContractList(customerId);
+    if (res.code === 200) {
+      contractList.value = res.data || [];
+    }
+  } catch (error) {
+    console.error('鑾峰彇瀹㈡埛鍚堝悓鍒楄〃澶辫触:', error);
+  }
+};
+
+// 鏌ョ湅鎬诲悎鍚岄檮浠�
+const openContractFileDialog = async (row) => {
+  if (!row.masterContractNo) {
+    proxy.$modal.msgWarning('璇ヨ褰曟病鏈夋�诲悎鍚屽彿');
+    return;
+  }
+  try {
+    const res = await getContractFilesByNo(row.masterContractNo);
+    if (res.code === 200) {
+      contractFileList.value = res.data || [];
+      contractFileDialogVisible.value = true;
+    }
+  } catch (error) {
+    console.error('鑾峰彇鍚堝悓闄勪欢澶辫触:', error);
+  }
+};
+
+// 鏍煎紡鍖栨枃浠跺ぇ灏�
+const formatFileSize = (bytes) => {
+  if (!bytes) return '0 B';
+  const k = 1024;
+  const sizes = ['B', 'KB', 'MB', 'GB'];
+  const i = Math.floor(Math.log(bytes) / Math.log(k));
+  return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
+};
+
 onMounted(() => {
   searchForm.salesContractNo = route.query.salesContractNo;
   getList();
@@ -3179,4 +3368,4 @@
     page-break-after: avoid;
   }
 }
-</style>
+</style>
\ No newline at end of file

--
Gitblit v1.9.3