From dacc95761cf7090c628fc37a5d4f8bb825ccbbb0 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期六, 16 五月 2026 15:41:45 +0800
Subject: [PATCH] 企业新闻和通知公告

---
 src/views/salesManagement/deliveryLedger/index.vue |  688 ++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 465 insertions(+), 223 deletions(-)

diff --git a/src/views/salesManagement/deliveryLedger/index.vue b/src/views/salesManagement/deliveryLedger/index.vue
index 52e14cb..c8890cc 100644
--- a/src/views/salesManagement/deliveryLedger/index.vue
+++ b/src/views/salesManagement/deliveryLedger/index.vue
@@ -3,19 +3,37 @@
     <div class="search_form">
       <el-form :model="searchForm" :inline="true">
         <el-form-item label="閿�鍞鍗曞彿锛�">
-          <el-input v-model="searchForm.salesContractNo" placeholder="璇疯緭鍏�" clearable prefix-icon="Search" style="width: 200px"
-            @change="handleQuery" />
+          <el-input
+            v-model="searchForm.salesContractNo"
+            placeholder="璇疯緭鍏�"
+            clearable
+            prefix-icon="Search"
+            style="width: 200px"
+            @change="handleQuery"
+          />
         </el-form-item>
         <el-form-item label="杞︾墝鍙凤細">
-          <el-input v-model="searchForm.shippingCarNumber" placeholder="璇疯緭鍏�" clearable prefix-icon="Search" style="width: 200px"
-            @change="handleQuery" />
+          <el-input
+            v-model="searchForm.shippingCarNumber"
+            placeholder="璇疯緭鍏�"
+            clearable
+            prefix-icon="Search"
+            style="width: 200px"
+            @change="handleQuery"
+          />
         </el-form-item>
         <el-form-item label="蹇�掑崟鍙凤細">
-          <el-input v-model="searchForm.expressNumber" placeholder="璇疯緭鍏�" clearable prefix-icon="Search" style="width: 200px"
-            @change="handleQuery" />
+          <el-input
+            v-model="searchForm.expressNumber"
+            placeholder="璇疯緭鍏�"
+            clearable
+            prefix-icon="Search"
+            style="width: 200px"
+            @change="handleQuery"
+          />
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="handleQuery"> 鎼滅储 </el-button>
+          <el-button type="primary" @click="handleQuery"> 鎼滅储</el-button>
         </el-form-item>
       </el-form>
     </div>
@@ -27,47 +45,132 @@
           <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
         </div>
       </div>
-      <el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
-        :row-key="(row) => row.id" style="width: 100%" height="calc(100vh - 21.5em)">
+      <el-table
+        :data="tableData"
+        border
+        v-loading="tableLoading"
+        @selection-change="handleSelectionChange"
+        :row-key="(row) => row.id"
+        style="width: 100%"
+        height="calc(100vh - 21.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="shippingNo" show-overflow-tooltip />
-        <el-table-column label="瀹㈡埛鍚嶇О" prop="customerName" show-overflow-tooltip />
-        <el-table-column label="鍙戣揣鏃堕棿" prop="shippingDate" show-overflow-tooltip />
-        <el-table-column label="鍙戣揣杞︾墝鍙�" prop="shippingCarNumber" show-overflow-tooltip />
-        <el-table-column label="蹇�掑叕鍙�" prop="expressCompany" show-overflow-tooltip />
-        <el-table-column label="蹇�掑崟鍙�" prop="expressNumber" show-overflow-tooltip />
-        <el-table-column label="瀹℃牳鐘舵��" prop="status" align="center" width="120">
+        <el-table-column
+          label="閿�鍞鍗�"
+          prop="salesContractNo"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="鍙戣揣璁㈠崟鍙�"
+          prop="shippingNo"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="瀹㈡埛鍚嶇О"
+          prop="customerName"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="浜у搧鍚嶇О"
+          prop="productName"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="瑙勬牸鍨嬪彿"
+          prop="specificationModel"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="鍙戣揣鏃堕棿"
+          prop="shippingDate"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="鍙戣揣鏁伴噺"
+          prop="totalQuantity"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="鍙戣揣杞︾墝鍙�"
+          prop="shippingCarNumber"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="蹇�掑叕鍙�"
+          prop="expressCompany"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="蹇�掑崟鍙�"
+          prop="expressNumber"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="瀹℃牳鐘舵��"
+          prop="status"
+          align="center"
+          width="100"
+        >
           <template #default="scope">
             <el-tag :type="getApprovalStatusType(scope.row.status)">
               {{ getApprovalStatusText(scope.row.status) }}
             </el-tag>
           </template>
         </el-table-column>
-        <el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
+        <el-table-column
+          label="鍑哄簱鍗曞彿"
+          prop="outboundBatches"
+          show-overflow-tooltip
+          width="130"
+        />
+        <el-table-column fixed="right" label="鎿嶄綔" width="220" align="center">
           <template #default="scope">
-            <el-button 
-              link 
-              type="primary" 
-              size="small" 
+            <!--            <el-button-->
+            <!--                link-->
+            <!--                type="primary"-->
+            <!--                :disabled="!isApproved(scope.row.status)"-->
+            <!--                @click="openForm('edit', scope.row)">鍙戣揣-->
+            <!--            </el-button>-->
+            <el-button
+              link
+              type="primary"
+              style="color: #67c23a"
+              @click="openDetail(scope.row)"
+              >璇︽儏
+            </el-button>
+            <el-button
+              link
+              type="danger"
               :disabled="isApproving(scope.row.status)"
-              @click="openForm('edit', scope.row)">琛ュ厖鍙戣揣淇℃伅</el-button>
-            <el-button 
-              link 
-              type="danger" 
-              size="small" 
-              :disabled="isApproving(scope.row.status)"
-              @click="handleDeleteSingle(scope.row)">鍒犻櫎</el-button>
+              @click="handleDeleteSingle(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="operationType === 'add' ? '鏂板鍙戣揣鍙拌处' : '缂栬緫鍙戣揣鍙拌处'" width="40%"
-      @close="closeDia">
-      <el-form :model="form" label-width="120px" label-position="top" :rules="rules" ref="formRef">
+    <el-dialog
+      v-model="dialogFormVisible"
+      :title="operationType === 'add' ? '鏂板鍙戣揣鍙拌处' : '缂栬緫鍙戣揣鍙拌处'"
+      width="40%"
+      @close="closeDia"
+    >
+      <el-form
+        :model="form"
+        label-width="120px"
+        label-position="top"
+        :rules="rules"
+        ref="formRef"
+      >
         <el-row :gutter="30">
           <el-col :span="24">
             <el-form-item label="鍙戣揣绫诲瀷锛�" prop="type">
@@ -132,29 +235,7 @@
         <el-row :gutter="30">
           <el-col :span="24">
             <el-form-item label="鍙戣揣鍥剧墖锛�">
-              <el-upload 
-                v-model:file-list="deliveryFileList" 
-                :action="upload.url" 
-                multiple 
-                ref="deliveryFileUpload" 
-                auto-upload
-                :headers="upload.headers" 
-                :data="{ type: 9 }"
-                :before-upload="handleDeliveryBeforeUpload" 
-                :on-error="handleDeliveryUploadError"
-                :on-success="handleDeliveryUploadSuccess" 
-                :on-remove="handleDeliveryRemove"
-                list-type="picture-card"
-                :limit="9"
-                accept="image/png,image/jpeg,image/jpg"
-              >
-                <el-icon class="avatar-uploader-icon"><Plus /></el-icon>
-                <template #tip>
-                  <div class="el-upload__tip">
-                    鏀寔 jpg銆乯peg銆乸ng 鏍煎紡锛屾渶澶氫笂浼� 9 寮狅紝鍗曞紶澶у皬涓嶈秴杩� 10MB
-                  </div>
-                </template>
-              </el-upload>
+              <ImageUpload v-model:file-list="deliveryFileList" :limit="9" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -166,6 +247,93 @@
         </div>
       </template>
     </el-dialog>
+
+    <!-- 璇︽儏寮规 -->
+    <el-dialog
+      v-model="detailDialogVisible"
+      title="鍙戣揣鍙拌处璇︽儏"
+      width="55%"
+      @close="closeDetail"
+    >
+      <div v-if="detailRow" class="detail-wrapper">
+        <el-descriptions :column="2" border>
+          <el-descriptions-item label="閿�鍞鍗�">{{
+            detailRow.salesContractNo || "--"
+          }}</el-descriptions-item>
+          <el-descriptions-item label="鍙戣揣璁㈠崟鍙�">{{
+            detailRow.shippingNo || "--"
+          }}</el-descriptions-item>
+          <el-descriptions-item label="瀹㈡埛鍚嶇О">{{
+            detailRow.customerName || "--"
+          }}</el-descriptions-item>
+          <el-descriptions-item label="浜у搧鍚嶇О">{{
+            detailRow.productName || "--"
+          }}</el-descriptions-item>
+          <el-descriptions-item label="瑙勬牸鍨嬪彿">{{
+            detailRow.specificationModel || "--"
+          }}</el-descriptions-item>
+          <el-descriptions-item label="鍙戣揣绫诲瀷">{{
+            detailRow.type || "--"
+          }}</el-descriptions-item>
+          <el-descriptions-item label="鍙戣揣鏃ユ湡">{{
+            detailRow.shippingDate || "--"
+          }}</el-descriptions-item>
+          <el-descriptions-item label="瀹℃牳鐘舵��">{{
+            getApprovalStatusText(detailRow.status)
+          }}</el-descriptions-item>
+          <el-descriptions-item label="鍙戣揣杞︾墝鍙�">{{
+            detailRow.shippingCarNumber || "--"
+          }}</el-descriptions-item>
+          <el-descriptions-item label="蹇�掑叕鍙�">{{
+            detailRow.expressCompany || "--"
+          }}</el-descriptions-item>
+          <el-descriptions-item label="蹇�掑崟鍙�" :span="2">{{
+            detailRow.expressNumber || "--"
+          }}</el-descriptions-item>
+          <el-descriptions-item label="鍑哄簱鍗曞彿" :span="2">{{
+            detailRow.outboundBatches || "--"
+          }}</el-descriptions-item>
+        </el-descriptions>
+        <el-table
+          :data="getDeliveryProductInfoList()"
+          border
+          size="small"
+          class="delivery-product-table"
+          style="width: 100%; margin-top: 16px"
+        >
+          <el-table-column
+            label="鎵瑰彿"
+            prop="batchNo"
+            min-width="160"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            label="浜у搧鍚嶇О"
+            prop="productName"
+            min-width="160"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            label="瑙勬牸鍨嬪彿"
+            prop="specificationModel"
+            min-width="160"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            label="鍙戣揣鏁伴噺"
+            prop="deliveryQuantity"
+            min-width="120"
+            align="center"
+          />
+        </el-table>
+        <ImagePreview :file-list="detailRow.storageBlobVOs || []" />
+      </div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="closeDetail">鍏抽棴</el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -173,16 +341,16 @@
 import pagination from "@/components/PIMTable/Pagination.vue";
 import { onMounted, ref, reactive, toRefs, getCurrentInstance } from "vue";
 import { ElMessageBox } from "element-plus";
-import { Plus } from "@element-plus/icons-vue";
-import { getToken } from "@/utils/auth";
 import { getCurrentDate } from "@/utils/index.js";
 import {
-	deliveryLedgerListPage,
-	addOrUpdateDeliveryLedger,
-	delDeliveryLedger, deductStock,
+  deliveryLedgerListPage,
+  delDeliveryLedger,
+  deductStock,
+  getDeliveryDetail,
 } from "@/api/salesManagement/deliveryLedger.js";
 import { delLedgerFile } from "@/api/salesManagement/salesLedger.js";
- 
+import ImageUpload from "@/components/AttachmentUpload/image/index.vue";
+import ImagePreview from "@/components/AttachmentPreview/image/index.vue";
 
 const { proxy } = getCurrentInstance();
 const tableData = ref([]);
@@ -195,15 +363,10 @@
 });
 const total = ref(0);
 const deliveryFileList = ref([]);
-const javaApi = proxy.javaApi;
-
-// 涓婁紶閰嶇疆
-const upload = reactive({
-  // 涓婁紶鐨勫湴鍧�
-  url: import.meta.env.VITE_APP_BASE_API + "/file/upload",
-  // 璁剧疆涓婁紶鐨勮姹傚ご閮�
-  headers: { Authorization: "Bearer " + getToken() },
-});
+// 璇︽儏寮规
+const detailDialogVisible = ref(false);
+const detailRow = ref(null);
+const detailProductList = ref([]);
 
 // 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
 const operationType = ref("");
@@ -218,6 +381,8 @@
     id: null,
     salesContractNo: "",
     customerName: "",
+    specificationModel: "",
+    productName: "",
     type: "璐ц溅", // 璐ц溅, 蹇��
     shippingDate: "",
     shippingCarNumber: "",
@@ -225,24 +390,34 @@
     expressNumber: "", // 蹇�掑崟鍙�
   },
   rules: {
-    salesContractNo: [{ required: true, message: "璇烽�夋嫨閿�鍞鍗�", trigger: "change" }],
-    customerName: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" }],
-    type: [
-      { required: true, message: "璇烽�夋嫨鍙戣揣绫诲瀷", trigger: "change" }
+    salesContractNo: [
+      { required: true, message: "璇烽�夋嫨閿�鍞鍗�", trigger: "change" },
     ],
-    shippingDate: [{ required: true, message: "璇烽�夋嫨鍙戣揣鏃堕棿", trigger: "change" }],
+    customerName: [
+      { required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" },
+    ],
+    type: [{ required: true, message: "璇烽�夋嫨鍙戣揣绫诲瀷", trigger: "change" }],
+    shippingDate: [
+      { required: true, message: "璇烽�夋嫨鍙戣揣鏃堕棿", trigger: "change" },
+    ],
     shippingCarNumber: [
-      { validator: (_, value, callback) => validateShippingCarNumber(value, callback), trigger: "blur" }
+      {
+        validator: (_, value, callback) =>
+          validateShippingCarNumber(value, callback),
+        trigger: "blur",
+      },
     ],
     expressCompany: [
-      { validator: (_, value, callback) => validateExpressCompany(value, callback), trigger: "blur" }
+      {
+        validator: (_, value, callback) =>
+          validateExpressCompany(value, callback),
+        trigger: "blur",
+      },
     ],
   },
 });
 const { form, rules } = toRefs(data);
 const { searchForm } = toRefs(data);
-
- 
 
 // 鏌ヨ鍒楄〃
 const handleQuery = () => {
@@ -271,7 +446,9 @@
 
 // 閿�鍞鍗曞彉鍖栨椂鑷姩濉厖瀹㈡埛鍚嶇О
 const handleSalesOrderChange = (value) => {
-  const selectedOrder = salesOrderOptions.value.find(item => item.salesContractNo === value);
+  const selectedOrder = salesOrderOptions.value.find(
+    (item) => item.salesContractNo === value
+  );
   if (selectedOrder) {
     form.value.customerName = selectedOrder.customerName;
   }
@@ -284,16 +461,15 @@
 
 // 鎵撳紑寮规
 const openForm = async (type, row) => {
-  // 缂栬緫鏃舵鏌ュ鏍哥姸鎬侊紝鍙湁瀹℃牳涓笉鑳界紪杈�
-  if (type === 'edit' && row && isApproving(row.status)) {
-    proxy.$modal.msgWarning("瀹℃牳涓殑鏁版嵁涓嶈兘缂栬緫");
+  // 鍙戣揣锛氫粎鈥滃鏍搁�氳繃鈥濆厑璁哥紪杈�
+  if (type === "edit" && row && !isApproved(row.status)) {
+    proxy.$modal.msgWarning("鍙湁瀹℃牳閫氳繃鐨勬暟鎹墠鍙互鍙戣揣");
     return;
   }
-  
+
   operationType.value = type;
-  const baseUrl = import.meta.env.VITE_APP_BASE_API;
-  
-  if (type === 'edit' && row) {
+
+  if (type === "edit" && row) {
     form.value = {
       id: row.id ?? null,
       salesContractNo: row.salesContractNo ?? "",
@@ -304,95 +480,119 @@
       expressCompany: row.expressCompany ?? "",
       expressNumber: row.expressNumber ?? "",
     };
-    // 濡傛灉鏈夊浘鐗囷紝灏� commonFileList 杞崲涓烘枃浠跺垪琛ㄦ牸寮�
-    if (row.commonFileList && Array.isArray(row.commonFileList) && row.commonFileList.length > 0) {
-      deliveryFileList.value = row.commonFileList.map((file, index) => {
-        // 澶勭悊 URL锛氬皢 Windows 璺緞杞崲涓哄彲璁块棶鐨� URL
-        let fileUrl = file.url || '';
-        console.log('鍘熷 URL:', fileUrl);
-        
-        // 濡傛灉 URL 鏄� Windows 璺緞鏍煎紡锛堝寘鍚弽鏂滄潬锛夛紝闇�瑕佽浆鎹�
-        if (fileUrl && fileUrl.indexOf('\\') > -1) {
-          // 鏌ユ壘 uploads 鍏抽敭瀛楃殑浣嶇疆锛屼粠閭i噷寮�濮嬫彁鍙栫浉瀵硅矾寰�
-          const uploadsIndex = fileUrl.toLowerCase().indexOf('uploads');
-          if (uploadsIndex > -1) {
-            // 浠� uploads 寮�濮嬫彁鍙栬矾寰勶紝骞跺皢鍙嶆枩鏉犳浛鎹负姝f枩鏉�
-            const relativePath = fileUrl.substring(uploadsIndex).replace(/\\/g, '/');
-            fileUrl = '/' + relativePath;
-            console.log('杞崲鍚庣殑鐩稿璺緞:', fileUrl);
-          } else {
-            // 濡傛灉娌℃湁鎵惧埌 uploads锛屾彁鍙栨渶鍚庝竴涓洰褰曞拰鏂囦欢鍚�
-            const parts = fileUrl.split('\\');
-            const fileName = parts[parts.length - 1];
-            fileUrl = '/uploads/' + fileName;
-            console.log('鏈壘鍒� uploads锛屼娇鐢ㄦ枃浠跺悕:', fileUrl);
-          }
-        }
-        
-        // 纭繚鎵�鏈夐潪 http 寮�澶寸殑 URL 閮芥嫾鎺� baseUrl
-        if (fileUrl && !fileUrl.startsWith('http')) {
-          // 纭繚璺緞浠� / 寮�澶�
-          if (!fileUrl.startsWith('/')) {
-            fileUrl = '/' + fileUrl;
-          }
-          // 鎷兼帴 baseUrl
-          fileUrl = javaApi + fileUrl;
-          console.log('鏈�缁堟嫾鎺ョ殑 URL:', fileUrl);
-        }
-        
-        return {
-          uid: file.id || Date.now() + index,
-          name: file.name || `image_${index + 1}.jpg`,
-          url: fileUrl,
-          status: 'success',
-          response: {
-            code: 200,
-            data: {
-              tempId: file.id,
-              url: fileUrl
-            }
-          },
-          tempId: file.id // 淇濆瓨鏂囦欢ID锛岀敤浜庢彁浜ゆ椂浣跨敤
-        };
-      });
-    } else {
-      deliveryFileList.value = [];
-    }
-  } else {
-    form.value = {
-      id: null,
-      salesContractNo: "",
-      customerName: "",
-      type: "璐ц溅",
-      shippingDate: getCurrentDate(),
-      shippingCarNumber: "",
-      expressCompany: "",
-      expressNumber: "",
-    };
-    deliveryFileList.value = [];
+    deliveryFileList.value = row.storageBlobVOs || [];
   }
-  
+
   dialogFormVisible.value = true;
+};
+
+// 鎵撳紑璇︽儏寮规
+const openDetail = async (row) => {
+  detailRow.value = row || null;
+  detailProductList.value = [];
+  detailDialogVisible.value = true;
+  if (!row?.id) return;
+  try {
+    const res = await getDeliveryDetail(row.id);
+    const detailData = res?.data;
+    detailRow.value = {
+      ...row,
+      ...(Array.isArray(detailData) ? {} : detailData || {}),
+    };
+    detailProductList.value = resolveDeliveryDetailList(detailData);
+  } catch (error) {
+    proxy.$modal.msgError("鍔犺浇鍙戣揣鍙拌处璇︽儏澶辫触");
+  }
+};
+const resolveDeliveryDetailList = (data) => {
+  if (Array.isArray(data)) return data;
+  if (!data || typeof data !== "object") return [];
+  return (
+    [
+      data.batchNoDetailList,
+      data.batchNoList,
+      data.shippingBatchList,
+      data.shippingInfoDetailList,
+      data.detailList,
+      data.batchDetailList,
+      data.rows,
+      data.records,
+      data.list,
+      data.data,
+    ].find((value) => Array.isArray(value) && value.length) || []
+  );
+};
+const getDeliveryProductInfoList = () => {
+  const row = detailRow.value;
+  if (!row) return [];
+  const normalizeBatchNoList = (value) => {
+    if (Array.isArray(value)) return value;
+    if (typeof value === "string" && value.includes(",")) {
+      return value
+        .split(",")
+        .map((item) => item.trim())
+        .filter(Boolean);
+    }
+    return value ? [value] : [];
+  };
+  const detailList = detailProductList.value.length
+    ? detailProductList.value
+    : [
+        row.batchNoDetailList,
+        row.batchNoList,
+        row.shippingBatchList,
+        row.shippingInfoDetailList,
+        row.detailList,
+        row.batchDetailList,
+      ].find((value) => Array.isArray(value) && value.length);
+  const batchNoList = normalizeBatchNoList(row.batchNo);
+  const toTableRow = (item = {}) => ({
+    batchNo:
+      typeof item === "string" || typeof item === "number"
+        ? item
+        : item.batchNo ?? item.batchNumber ?? row.batchNo ?? "--",
+    productName: item.productName ?? row.productName ?? "--",
+    specificationModel:
+      item.specificationModel ?? item.model ?? row.specificationModel ?? "--",
+    deliveryQuantity:
+      item.deliveryQuantity ??
+      item.quantity ??
+      item.shippingQuantity ??
+      row.deliveryQuantity ??
+      row.quantity ??
+      "--",
+  });
+  if (detailList?.length) {
+    return detailList.map(toTableRow);
+  }
+  if (batchNoList.length) {
+    return batchNoList.map((batchNo) => toTableRow({ batchNo }));
+  }
+  return [toTableRow()];
+};
+const closeDetail = () => {
+  detailDialogVisible.value = false;
+  detailRow.value = null;
+  detailProductList.value = [];
 };
 
 // 鎻愪氦琛ㄥ崟
 const submitForm = () => {
   proxy.$refs["formRef"].validate((valid) => {
     if (valid) {
-      let tempFileIds = [];
-      if (deliveryFileList.value !== null && deliveryFileList.value.length > 0) {
-        tempFileIds = deliveryFileList.value.map((item) => item.tempId);
-      }
       const payload = {
         id: form.value.id,
         type: form.value.type,
         shippingDate: form.value.shippingDate,
-        shippingCarNumber: form.value.type === "璐ц溅" ? form.value.shippingCarNumber : "",
-        expressCompany: form.value.type === "蹇��" ? form.value.expressCompany : "",
-        expressNumber: form.value.type === "蹇��" ? form.value.expressNumber : "",
-        tempFileIds: tempFileIds,
+        shippingCarNumber:
+          form.value.type === "璐ц溅" ? form.value.shippingCarNumber : "",
+        expressCompany:
+          form.value.type === "蹇��" ? form.value.expressCompany : "",
+        expressNumber:
+          form.value.type === "蹇��" ? form.value.expressNumber : "",
+        storageBlobDTOs: deliveryFileList.value || [],
       };
-			deductStock(payload).then((res) => {
+      deductStock(payload).then((res) => {
         proxy.$modal.msgSuccess("鎿嶄綔鎴愬姛");
         closeDia();
         getList();
@@ -429,14 +629,16 @@
     proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
     return;
   }
-  
+
   // 妫�鏌ラ�変腑鐨勮鏄惁鏈�"瀹℃牳涓�"鐘舵��
-  const approvingRows = selectedRows.value.filter(row => isApproving(row.status));
+  const approvingRows = selectedRows.value.filter((row) =>
+    isApproving(row.status)
+  );
   if (approvingRows.length > 0) {
     proxy.$modal.msgWarning("瀹℃牳涓殑鏁版嵁涓嶈兘鍒犻櫎");
     return;
   }
-  
+
   const ids = selectedRows.value.map((item) => item.id);
   ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎", {
     confirmButtonText: "纭",
@@ -461,7 +663,7 @@
     proxy.$modal.msgWarning("瀹℃牳涓殑鏁版嵁涓嶈兘鍒犻櫎");
     return;
   }
-  
+
   ElMessageBox.confirm("姝ゆ搷浣滃皢鍒犻櫎璇ヨ褰曪紝鏄惁纭锛�", "鍒犻櫎", {
     confirmButtonText: "纭",
     cancelButtonText: "鍙栨秷",
@@ -495,7 +697,10 @@
 // 鍙戣揣鍥剧墖涓婁紶鍓嶆牎妫�
 function handleDeliveryBeforeUpload(file) {
   // 鏍℃鏂囦欢绫诲瀷
-  const isImage = file.type === 'image/png' || file.type === 'image/jpeg' || file.type === 'image/jpg';
+  const isImage =
+    file.type === "image/png" ||
+    file.type === "image/jpeg" ||
+    file.type === "image/jpg";
   if (!isImage) {
     proxy.$modal.msgError("鍙兘涓婁紶 jpg銆乯peg銆乸ng 鏍煎紡鐨勫浘鐗�!");
     return false;
@@ -509,11 +714,13 @@
   proxy.$modal.loading("姝e湪涓婁紶鍥剧墖锛岃绋嶅��...");
   return true;
 }
+
 // 鍙戣揣鍥剧墖涓婁紶澶辫触
 function handleDeliveryUploadError(err) {
   proxy.$modal.msgError("涓婁紶鍥剧墖澶辫触");
   proxy.$modal.closeLoading();
 }
+
 // 鍙戣揣鍥剧墖涓婁紶鎴愬姛鍥炶皟
 function handleDeliveryUploadSuccess(res, file, uploadFiles) {
   proxy.$modal.closeLoading();
@@ -525,26 +732,33 @@
     proxy.$refs.deliveryFileUpload.handleRemove(file);
   }
 }
+
 // 绉婚櫎鍙戣揣鍥剧墖
 function handleDeliveryRemove(file) {
-  console.log('file--', file)
+  console.log("file--", file);
   // 濡傛灉鏄紪杈戞ā寮忎笖鏂囦欢鏈� id锛岄渶瑕佽皟鐢ㄦ帴鍙e垹闄�
   if (operationType.value === "edit") {
     let ids = [];
     ids.push(file.uid);
-    delLedgerFile(ids).then((res) => {
-      proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-      // 浠庢枃浠跺垪琛ㄤ腑绉婚櫎
-      const index = deliveryFileList.value.findIndex(item => item.uid === file.uid);
-      if (index > -1) {
-        deliveryFileList.value.splice(index, 1);
-      }
-    }).catch(() => {
-      proxy.$modal.msgError("鍒犻櫎澶辫触");
-    });
+    delLedgerFile(ids)
+      .then((res) => {
+        proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+        // 浠庢枃浠跺垪琛ㄤ腑绉婚櫎
+        const index = deliveryFileList.value.findIndex(
+          (item) => item.uid === file.uid
+        );
+        if (index > -1) {
+          deliveryFileList.value.splice(index, 1);
+        }
+      })
+      .catch(() => {
+        proxy.$modal.msgError("鍒犻櫎澶辫触");
+      });
   } else {
     // 鏂板妯″紡鎴栨病鏈� id 鐨勬枃浠讹紝鐩存帴浠庡垪琛ㄤ腑绉婚櫎
-    const index = deliveryFileList.value.findIndex(item => item.uid === file.uid);
+    const index = deliveryFileList.value.findIndex(
+      (item) => item.uid === file.uid
+    );
     if (index > -1) {
       deliveryFileList.value.splice(index, 1);
     }
@@ -563,90 +777,92 @@
 
 // 鑾峰彇瀹℃牳鐘舵�佹枃鏈�
 const getApprovalStatusText = (status) => {
-  if (status === null || status === undefined || status === '') {
-    return '寰呭鏍�';
+  if (status === null || status === undefined || status === "") {
+    return "寰呭鏍�";
   }
   // 濡傛灉鏄暟瀛�
-  if (typeof status === 'number') {
+  if (typeof status === "number") {
     const statusMap = {
-      0: '寰呭鏍�',
-      1: '瀹℃牳涓�',
-      2: '瀹℃牳鎷掔粷',
-      3: '瀹℃牳閫氳繃'
+      0: "寰呭鏍�",
+      1: "瀹℃牳涓�",
+      2: "瀹℃牳鎷掔粷",
+      3: "瀹℃牳閫氳繃",
     };
-    return statusMap[status] || '寰呭鏍�';
+    return statusMap[status] || "寰呭鏍�";
   }
   // 濡傛灉鏄瓧绗︿覆锛岀洿鎺ヨ繑鍥炴垨鏄犲皠
   const statusStr = String(status).trim();
   const statusTextMap = {
-    '寰呭鏍�': '寰呭鏍�',
-    '瀹℃牳涓�': '瀹℃牳涓�',
-    '瀹℃牳鎷掔粷': '瀹℃牳鎷掔粷',
-    '瀹℃牳閫氳繃': '瀹℃牳閫氳繃',
-    '0': '寰呭鏍�',
-    '1': '瀹℃牳涓�',
-    '2': '瀹℃牳鎷掔粷',
-    '3': '瀹℃牳閫氳繃'
+    寰呭鏍�: "寰呭鏍�",
+    瀹℃牳涓�: "瀹℃牳涓�",
+    瀹℃牳鎷掔粷: "瀹℃牳鎷掔粷",
+    瀹℃牳閫氳繃: "瀹℃牳閫氳繃",
+    宸插彂璐�: "宸插彂璐�",
+    0: "寰呭鏍�",
+    1: "瀹℃牳涓�",
+    2: "瀹℃牳鎷掔粷",
+    3: "瀹℃牳閫氳繃",
   };
-  return statusTextMap[statusStr] || statusStr || '寰呭鏍�';
+  return statusTextMap[statusStr] || statusStr || "寰呭鏍�";
 };
 
 // 鑾峰彇瀹℃牳鐘舵�佹爣绛剧被鍨嬶紙棰滆壊锛�
 const getApprovalStatusType = (status) => {
-  if (status === null || status === undefined || status === '') {
-    return 'info';
+  if (status === null || status === undefined || status === "") {
+    return "info";
   }
   // 濡傛灉鏄暟瀛�
-  if (typeof status === 'number') {
+  if (typeof status === "number") {
     const typeMap = {
-      0: 'info',      // 寰呭鏍� - 鐏拌壊
-      1: 'warning',   // 瀹℃牳涓� - 榛勮壊
-      2: 'danger',    // 瀹℃牳鎷掔粷 - 绾㈣壊
-      3: 'success'    // 瀹℃牳閫氳繃 - 缁胯壊
+      0: "info", // 寰呭鏍� - 鐏拌壊
+      1: "warning", // 瀹℃牳涓� - 榛勮壊
+      2: "danger", // 瀹℃牳鎷掔粷 - 绾㈣壊
+      3: "success", // 瀹℃牳閫氳繃 - 缁胯壊
     };
-    return typeMap[status] || 'info';
+    return typeMap[status] || "info";
   }
   // 濡傛灉鏄瓧绗︿覆
   const statusStr = String(status).trim();
   const typeTextMap = {
-    '寰呭鏍�': 'info',
-    '瀹℃牳涓�': 'warning',
-    '瀹℃牳鎷掔粷': 'danger',
-    '瀹℃牳閫氳繃': 'success',
-    '0': 'info',
-    '1': 'warning',
-    '2': 'danger',
-    '3': 'success'
+    寰呭鏍�: "info",
+    瀹℃牳涓�: "warning",
+    瀹℃牳鎷掔粷: "danger",
+    瀹℃牳閫氳繃: "success",
+    宸插彂璐�: "success",
+    0: "info",
+    1: "warning",
+    2: "danger",
+    3: "success",
   };
-  return typeTextMap[statusStr] || 'info';
+  return typeTextMap[statusStr] || "info";
 };
 
 // 妫�鏌ュ鏍哥姸鎬佹槸鍚︿负"瀹℃牳閫氳繃"
 const isApproved = (status) => {
-  if (status === null || status === undefined || status === '') {
+  if (status === null || status === undefined || status === "") {
     return false;
   }
   // 濡傛灉鏄暟瀛楋紝3 琛ㄧず瀹℃牳閫氳繃
-  if (typeof status === 'number') {
+  if (typeof status === "number") {
     return status === 3;
   }
   // 濡傛灉鏄瓧绗︿覆
   const statusStr = String(status).trim();
-  return statusStr === '瀹℃牳閫氳繃' || statusStr === '3';
+  return statusStr === "瀹℃牳閫氳繃" || statusStr === "3";
 };
 
 // 妫�鏌ュ鏍哥姸鎬佹槸鍚︿负"瀹℃牳涓�"
 const isApproving = (status) => {
-  if (status === null || status === undefined || status === '') {
+  if (status === null || status === undefined || status === "") {
     return false;
   }
   // 濡傛灉鏄暟瀛楋紝1 琛ㄧず瀹℃牳涓�
-  if (typeof status === 'number') {
+  if (typeof status === "number") {
     return status === 1;
   }
   // 濡傛灉鏄瓧绗︿覆
   const statusStr = String(status).trim();
-  return statusStr === '瀹℃牳涓�' || statusStr === '1';
+  return statusStr === "瀹℃牳涓�" || statusStr === "1";
 };
 
 onMounted(() => {
@@ -671,5 +887,31 @@
     display: none;
   }
 }
-</style>
 
+.detail-wrapper {
+  padding: 8px 0;
+}
+
+.detail-images {
+  margin-top: 16px;
+}
+
+.detail-images-title {
+  font-weight: 600;
+  margin-bottom: 10px;
+  color: #303133;
+}
+
+.detail-image {
+  width: 120px;
+  height: 120px;
+  margin-right: 10px;
+  margin-bottom: 10px;
+  border-radius: 6px;
+}
+
+.detail-images-empty {
+  margin-top: 16px;
+  color: #909399;
+}
+</style>

--
Gitblit v1.9.3