From ad3ecc9167a5f837e0a6292d8e697b799eb6bfc2 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期五, 17 四月 2026 15:57:31 +0800
Subject: [PATCH] 发货审批人列表来源修改

---
 src/pages/sales/salesAccount/out.vue |  261 +++++++++++++++++++++++++++++----------------------
 1 files changed, 147 insertions(+), 114 deletions(-)

diff --git a/src/pages/sales/salesAccount/out.vue b/src/pages/sales/salesAccount/out.vue
index d4fc5be..74affb7 100644
--- a/src/pages/sales/salesAccount/out.vue
+++ b/src/pages/sales/salesAccount/out.vue
@@ -1,7 +1,7 @@
 <template>
   <view class="receipt-payment-detail">
     <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
-    <PageHeader title="鍙戣揣鐘舵��"
+    <PageHeader title="浜у搧鏄庣粏"
                 @back="goBack" />
     <!-- 缁熻淇℃伅 -->
     <view class="summary-info">
@@ -22,31 +22,88 @@
     <view class="detail-list"
           v-if="tableData.length > 0">
       <view v-for="(item, index) in tableData"
-            :key="index"
+            :key="rowKey(item, index)"
             class="detail-item">
-        <view class="item-header">
+        <view class="item-header"
+              @click="toggleRow(item, index)">
           <view class="item-left">
             <view class="record-icon">
               <up-icon name="file-text"
                        size="16"
                        color="#ffffff"></up-icon>
             </view>
-            <text class="item-index">{{ item.productCategory }}</text>
+            <view class="item-title-wrap">
+              <text class="item-index">{{ item.productCategory || "浜у搧" }}</text>
+            </view>
+          </view>
+          <view class="item-header-right">
+            <text class="toggle-text">{{ rowExpanded(item, index) ? "鏀惰捣" : "灞曞紑" }}</text>
+            <up-icon :name="rowExpanded(item, index) ? 'arrow-up' : 'arrow-down'"
+                     size="16"
+                     color="#999999"></up-icon>
           </view>
         </view>
         <up-divider></up-divider>
-        <view class="item-details">
+        <view v-if="!rowExpanded(item, index)"
+              class="item-preview">
           <view class="detail-row">
-            <text class="detail-label">浜у搧澶х被</text>
-            <text class="detail-value">{{ item.productCategory }}</text>
+            <text class="detail-label">妤煎眰缂栧彿</text>
+            <text class="detail-value">{{ dv(item.floorCode) }}</text>
           </view>
           <view class="detail-row">
             <text class="detail-label">瑙勬牸鍨嬪彿</text>
-            <text class="detail-value">{{ item.specificationModel }}</text>
+            <text class="detail-value">{{ dv(item.specificationModel) }}</text>
           </view>
           <view class="detail-row">
-            <text class="detail-label">鍗曚綅</text>
-            <text class="detail-value">{{ item.unit }}</text>
+            <text class="detail-label">鏁伴噺</text>
+            <text class="detail-value">{{ dv(item.quantity) }}</text>
+          </view>
+        </view>
+        <view v-else
+              class="item-details">
+          <view class="detail-row">
+            <text class="detail-label">妤煎眰缂栧彿</text>
+            <text class="detail-value">{{ dv(item.floorCode) }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">浜у搧澶х被</text>
+            <text class="detail-value">{{ dv(item.productCategory) }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">瑙勬牸鍨嬪彿</text>
+            <text class="detail-value">{{ dv(item.specificationModel) }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍘氬害</text>
+            <text class="detail-value">{{ dv(item.thickness) }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">瀹�(mm)</text>
+            <text class="detail-value">{{ dv(item.width) }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">楂�(mm)</text>
+            <text class="detail-value">{{ dv(item.height) }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍛ㄩ暱(cm)</text>
+            <text class="detail-value">{{ dv(item.perimeter) }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鎬婚潰绉�(cm虏)</text>
+            <text class="detail-value">{{ dv(item.actualTotalArea) }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍔犲伐瑕佹眰</text>
+            <text class="detail-value">{{ dv(item.processRequirement) }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">澶囨敞</text>
+            <text class="detail-value">{{ dv(item.remark) }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">閲嶇</text>
+            <text class="detail-value">{{ dv(item.heavyBox) }}</text>
           </view>
           <view class="detail-row">
             <text class="detail-label">浜у搧鐘舵��</text>
@@ -56,17 +113,12 @@
                   class="detail-value danger">涓嶈冻</text>
           </view>
           <view class="detail-row">
-            <text class="detail-label">鍙戣揣鐘舵��</text>
-            <u-tag size="mini"
-                   :type="getShippingStatusType(item)">{{ getShippingStatusText(item) }}</u-tag>
-          </view>
-          <view class="detail-row">
             <text class="detail-label">蹇�掑叕鍙�</text>
-            <text class="detail-value">{{ item.expressCompany }}</text>
+            <text class="detail-value">{{ dv(item.expressCompany) }}</text>
           </view>
           <view class="detail-row">
             <text class="detail-label">蹇�掑崟鍙�</text>
-            <text class="detail-value">{{ item.expressNumber }}</text>
+            <text class="detail-value">{{ dv(item.expressNumber) }}</text>
           </view>
           <view class="detail-row">
             <text class="detail-label">鍙戣揣杞︾墝</text>
@@ -79,36 +131,28 @@
           </view>
           <view class="detail-row">
             <text class="detail-label">鍙戣揣鏃ユ湡</text>
-            <text class="detail-value">{{ item.shippingDate || '-' }}</text>
+            <text class="detail-value">{{ dv(item.shippingDate) }}</text>
           </view>
           <view class="detail-row">
             <text class="detail-label">鏁伴噺</text>
-            <text class="detail-value">{{ item.quantity }}</text>
+            <text class="detail-value">{{ dv(item.quantity) }}</text>
           </view>
           <view class="detail-row">
-            <text class="detail-label">绋庣巼锛�%锛�</text>
-            <text class="detail-value">{{ item.taxRate }}</text>
+            <text class="detail-label">绋庣巼(%)</text>
+            <text class="detail-value">{{ dv(item.taxRate) }}</text>
           </view>
           <view class="detail-row">
-            <text class="detail-label">鍚◣鍗曚环锛堝厓锛�</text>
-            <text class="detail-value">{{ item.taxInclusiveUnitPrice }}</text>
+            <text class="detail-label">鍚◣鍗曚环(鍏�)</text>
+            <text class="detail-value">{{ dv(item.taxInclusiveUnitPrice) }}</text>
           </view>
           <view class="detail-row">
-            <text class="detail-label">鍚◣鎬讳环锛堝厓锛�</text>
-            <text class="detail-value">{{ item.taxInclusiveTotalPrice }}</text>
+            <text class="detail-label">鍚◣鎬讳环(鍏�)</text>
+            <text class="detail-value">{{ dv(item.taxInclusiveTotalPrice) }}</text>
           </view>
           <view class="detail-row">
-            <text class="detail-label">涓嶅惈绋庢�讳环锛堝厓锛�</text>
-            <text class="detail-value">{{ item.taxExclusiveTotalPrice }}</text>
+            <text class="detail-label">涓嶅惈绋庢�讳环(鍏�)</text>
+            <text class="detail-value">{{ dv(item.taxExclusiveTotalPrice) }}</text>
           </view>
-          <up-divider></up-divider>
-          <u-button class="detail-button"
-                    size="small"
-                    type="primary"
-                    :disabled="!canShip(item)"
-                    @click="goout(item)">
-            鍙戣揣
-          </u-button>
         </view>
       </view>
     </view>
@@ -120,7 +164,7 @@
 </template>
 
 <script setup>
-  import { ref, computed, onMounted } from "vue";
+  import { ref, onMounted } from "vue";
   import { productList } from "@/api/salesManagement/salesLedger";
 
   // 瀹㈡埛淇℃伅
@@ -129,63 +173,34 @@
   // 琛ㄦ牸鏁版嵁
   const tableData = ref([]);
 
+  /** 姣忔潯鏄庣粏鎶樺彔鐘舵�侊細浠呬竴鏉℃椂榛樿灞曞紑锛屽鏉℃椂榛樿鏀惰捣 */
+  const expandedRows = ref({});
+
+  const rowKey = (item, index) =>
+    item?.id != null && item?.id !== "" ? `id-${item.id}` : `idx-${index}`;
+
+  const rowExpanded = (item, index) => !!expandedRows.value[rowKey(item, index)];
+
+  const toggleRow = (item, index) => {
+    const k = rowKey(item, index);
+    expandedRows.value = {
+      ...expandedRows.value,
+      [k]: !expandedRows.value[k],
+    };
+  };
+
+  const dv = v => {
+    if (v === null || v === undefined || v === "") return "-";
+    if (typeof v === "boolean") return v ? "鏄�" : "鍚�";
+    return v;
+  };
+
   // 杩斿洖涓婁竴椤�
   const goBack = () => {
     uni.removeStorageSync("supplierId");
     uni.navigateBack();
   };
-  const getShippingStatusType = row => {
-    // 濡傛灉宸插彂璐э紙鏈夊彂璐ф棩鏈熸垨杞︾墝鍙凤級锛屾樉绀虹豢鑹�
-    if (row.shippingDate || row.shippingCarNumber) {
-      return "success";
-    }
 
-    // 鑾峰彇鍙戣揣鐘舵�佸瓧娈�
-    const status = row.shippingStatus;
-
-    // 濡傛灉鐘舵�佷负绌烘垨鏈畾涔夛紝榛樿涓虹伆鑹诧紙寰呭彂璐э級
-    if (status === null || status === undefined || status === "") {
-      return "info";
-    }
-
-    // 鐘舵�佹槸瀛楃涓�
-    const statusStr = String(status).trim();
-    const typeTextMap = {
-      寰呭彂璐�: "info",
-      寰呭鏍�: "info",
-      瀹℃牳涓�: "warning",
-      瀹℃牳鎷掔粷: "danger",
-      瀹℃牳閫氳繃: "success",
-      宸插彂璐�: "success",
-    };
-    return typeTextMap[statusStr] || "info";
-  };
-  const getShippingStatusText = row => {
-    // 濡傛灉宸插彂璐э紙鏈夊彂璐ф棩鏈熸垨杞︾墝鍙凤級锛屾樉绀�"宸插彂璐�"
-    if (row.shippingDate || row.shippingCarNumber) {
-      return "宸插彂璐�";
-    }
-
-    // 鑾峰彇鍙戣揣鐘舵�佸瓧娈�
-    const status = row.shippingStatus;
-
-    // 濡傛灉鐘舵�佷负绌烘垨鏈畾涔夛紝榛樿涓�"寰呭彂璐�"
-    if (status === null || status === undefined || status === "") {
-      return "寰呭彂璐�";
-    }
-
-    // 鐘舵�佹槸瀛楃涓�
-    const statusStr = String(status).trim();
-    const statusTextMap = {
-      寰呭彂璐�: "寰呭彂璐�",
-      寰呭鏍�: "寰呭鏍�",
-      瀹℃牳涓�: "瀹℃牳涓�",
-      瀹℃牳鎷掔粷: "瀹℃牳鎷掔粷",
-      瀹℃牳閫氳繃: "瀹℃牳閫氳繃",
-      宸插彂璐�: "宸插彂璐�",
-    };
-    return statusTextMap[statusStr] || "寰呭彂璐�";
-  };
   // 鑾峰彇椤甸潰鍙傛暟
   const getPageParams = () => {
     // 浠庢湰鍦板瓨鍌ㄨ幏鍙栦緵搴斿晢ID
@@ -194,13 +209,6 @@
       supplierId.value = storedSupplierId;
     }
   };
-  const goout = item => {
-    uni.setStorageSync("goOutData", JSON.stringify(item));
-    uni.navigateTo({
-      url: "/pages/sales/salesAccount/goOut",
-    });
-  };
-
   // 鏌ヨ鍒楄〃
   const getList = () => {
     showLoadingToast("鍔犺浇涓�...");
@@ -209,7 +217,14 @@
       type: 1,
     })
       .then(res => {
-        tableData.value = res.data;
+        const list = res.data || res.records || [];
+        tableData.value = list;
+        if (list.length === 1) {
+          const k = rowKey(list[0], 0);
+          expandedRows.value = { [k]: true };
+        } else {
+          expandedRows.value = {};
+        }
         closeToast();
       })
       .catch(() => {
@@ -220,25 +235,6 @@
         });
       });
   };
-  const canShip = row => {
-    // 浜у搧鐘舵�佸繀椤绘槸鍏呰冻锛坅pproveStatus === 1锛�
-    if (row.approveStatus !== 1) {
-      return false;
-    }
-
-    // 鑾峰彇鍙戣揣鐘舵��
-    const shippingStatus = row.shippingStatus;
-
-    // 濡傛灉宸插彂璐э紙鏈夊彂璐ф棩鏈熸垨杞︾墝鍙凤級锛屼笉鑳藉啀娆″彂璐�
-    if (row.shippingDate || row.shippingCarNumber) {
-      return false;
-    }
-
-    // 鍙戣揣鐘舵�佸繀椤绘槸"寰呭彂璐�"鎴�"瀹℃牳鎷掔粷"
-    const statusStr = shippingStatus ? String(shippingStatus).trim() : "";
-    return statusStr === "寰呭彂璐�" || statusStr === "瀹℃牳鎷掔粷";
-  };
-
   // 鏄剧ず鍔犺浇鎻愮ず
   const showLoadingToast = message => {
     uni.showLoading({
@@ -331,12 +327,49 @@
     display: flex;
     align-items: center;
     justify-content: space-between;
+    gap: 12px;
+  }
+
+  .item-title-wrap {
+    display: flex;
+    flex-direction: column;
+    gap: 2px;
+    min-width: 0;
+  }
+
+  .item-header-right {
+    display: flex;
+    align-items: center;
+    gap: 4px;
+    flex-shrink: 0;
+  }
+
+  .toggle-text {
+    font-size: 12px;
+    color: #2979ff;
   }
 
   .item-left {
     display: flex;
     align-items: center;
     gap: 8px;
+    min-width: 0;
+    flex: 1;
+  }
+
+  .item-preview {
+    padding: 12px 0 16px;
+  }
+
+  .preview-tip {
+    margin-top: 8px;
+    margin-bottom: 0 !important;
+    justify-content: center;
+  }
+
+  .preview-tip-text {
+    font-size: 11px;
+    color: #bbb;
   }
 
   .record-icon {

--
Gitblit v1.9.3