From b973bcee308e99b5fd8a69640f11069e810346f4 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期二, 27 一月 2026 16:37:55 +0800
Subject: [PATCH] 采购台账重构

---
 src/pages/sales/salesAccount/out.vue |  407 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 407 insertions(+), 0 deletions(-)

diff --git a/src/pages/sales/salesAccount/out.vue b/src/pages/sales/salesAccount/out.vue
new file mode 100644
index 0000000..d4fc5be
--- /dev/null
+++ b/src/pages/sales/salesAccount/out.vue
@@ -0,0 +1,407 @@
+<template>
+  <view class="receipt-payment-detail">
+    <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
+    <PageHeader title="鍙戣揣鐘舵��"
+                @back="goBack" />
+    <!-- 缁熻淇℃伅 -->
+    <view class="summary-info">
+      <view class="summary-item">
+        <text class="summary-label">瀹㈡埛鍚嶇О</text>
+        <text class="summary-value">{{ outData.customerName }}</text>
+      </view>
+      <view class="summary-item">
+        <text class="summary-label">鍚堝悓閲戦</text>
+        <text class="summary-value">{{ outData.contractAmount }}</text>
+      </view>
+      <view class="summary-item">
+        <text class="summary-label">绛捐鏃ユ湡</text>
+        <text class="summary-value">{{ outData.executionDate }}</text>
+      </view>
+    </view>
+    <!-- 鍥炴璁板綍鏄庣粏鍒楄〃 -->
+    <view class="detail-list"
+          v-if="tableData.length > 0">
+      <view v-for="(item, index) in tableData"
+            :key="index"
+            class="detail-item">
+        <view class="item-header">
+          <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>
+        </view>
+        <up-divider></up-divider>
+        <view class="item-details">
+          <view class="detail-row">
+            <text class="detail-label">浜у搧澶х被</text>
+            <text class="detail-value">{{ item.productCategory }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">瑙勬牸鍨嬪彿</text>
+            <text class="detail-value">{{ item.specificationModel }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍗曚綅</text>
+            <text class="detail-value">{{ item.unit }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">浜у搧鐘舵��</text>
+            <text v-if="item.approveStatus === 1"
+                  class="detail-value highlight">鍏呰冻</text>
+            <text v-else
+                  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>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">蹇�掑崟鍙�</text>
+            <text class="detail-value">{{ item.expressNumber }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍙戣揣杞︾墝</text>
+            <u-tag size="mini"
+                   v-if="item.shippingCarNumber"
+                   type="success">{{ item.shippingCarNumber }}</u-tag>
+            <u-tag v-else
+                   size="mini"
+                   type="info">-</u-tag>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍙戣揣鏃ユ湡</text>
+            <text class="detail-value">{{ item.shippingDate || '-' }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鏁伴噺</text>
+            <text class="detail-value">{{ item.quantity }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">绋庣巼锛�%锛�</text>
+            <text class="detail-value">{{ item.taxRate }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍚◣鍗曚环锛堝厓锛�</text>
+            <text class="detail-value">{{ item.taxInclusiveUnitPrice }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍚◣鎬讳环锛堝厓锛�</text>
+            <text class="detail-value">{{ item.taxInclusiveTotalPrice }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">涓嶅惈绋庢�讳环锛堝厓锛�</text>
+            <text class="detail-value">{{ 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>
+    <view v-else
+          class="no-data">
+      <text>鏆傛棤鍥炴璁板綍</text>
+    </view>
+  </view>
+</template>
+
+<script setup>
+  import { ref, computed, onMounted } from "vue";
+  import { productList } from "@/api/salesManagement/salesLedger";
+
+  // 瀹㈡埛淇℃伅
+  const supplierId = ref("");
+
+  // 琛ㄦ牸鏁版嵁
+  const tableData = ref([]);
+
+  // 杩斿洖涓婁竴椤�
+  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
+    const storedSupplierId = uni.getStorageSync("supplierId");
+    if (storedSupplierId) {
+      supplierId.value = storedSupplierId;
+    }
+  };
+  const goout = item => {
+    uni.setStorageSync("goOutData", JSON.stringify(item));
+    uni.navigateTo({
+      url: "/pages/sales/salesAccount/goOut",
+    });
+  };
+
+  // 鏌ヨ鍒楄〃
+  const getList = () => {
+    showLoadingToast("鍔犺浇涓�...");
+    productList({
+      salesLedgerId: outData.value.id,
+      type: 1,
+    })
+      .then(res => {
+        tableData.value = res.data;
+        closeToast();
+      })
+      .catch(() => {
+        closeToast();
+        uni.showToast({
+          title: "鏌ヨ澶辫触",
+          icon: "error",
+        });
+      });
+  };
+  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({
+      title: message,
+      mask: true,
+    });
+  };
+
+  // 鍏抽棴鎻愮ず
+  const closeToast = () => {
+    uni.hideLoading();
+  };
+  const outData = ref({});
+
+  onMounted(() => {
+    // 椤甸潰鍔犺浇鏃惰幏鍙栧弬鏁板苟鍒锋柊鍒楄〃
+    getPageParams();
+    // 浠庢湰鍦板瓨鍌ㄨ幏鍙栧彂璐х姸鎬佹暟鎹�
+    outData.value = JSON.parse(uni.getStorageSync("outData"));
+    getList();
+  });
+</script>
+
+<style scoped lang="scss">
+  .receipt-payment-detail {
+    min-height: 100vh;
+    background: #f8f9fa;
+    position: relative;
+  }
+
+  .u-divider {
+    margin: 0 !important;
+  }
+
+  .summary-info {
+    background: #ffffff;
+    margin: 20px 20px 0 20px;
+    border-radius: 12px;
+    padding: 16px;
+    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+  }
+
+  .summary-item {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 8px;
+
+    &:last-child {
+      margin-bottom: 0;
+    }
+  }
+
+  .summary-label {
+    font-size: 14px;
+    color: #666;
+  }
+
+  .summary-value {
+    font-size: 14px;
+    color: #333;
+    font-weight: 500;
+  }
+
+  .summary-value.highlight {
+    color: #2979ff;
+    font-weight: 600;
+  }
+
+  .summary-value.danger {
+    color: #ff4757;
+    font-weight: 600;
+  }
+
+  .detail-list {
+    padding: 20px;
+  }
+
+  .detail-item {
+    background: #ffffff;
+    border-radius: 12px;
+    margin-bottom: 16px;
+    overflow: hidden;
+    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+    padding: 0 16px;
+  }
+
+  .item-header {
+    padding: 10px 0;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+  }
+
+  .item-left {
+    display: flex;
+    align-items: center;
+    gap: 8px;
+  }
+
+  .record-icon {
+    width: 24px;
+    height: 24px;
+    background: #2979ff;
+    border-radius: 4px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
+
+  .item-index {
+    font-size: 14px;
+    color: #333;
+    font-weight: 500;
+  }
+
+  .item-date {
+    font-size: 12px;
+    color: #666;
+  }
+
+  .item-details {
+    padding: 16px 0;
+  }
+
+  .detail-row {
+    display: flex;
+    align-items: flex-end;
+    justify-content: space-between;
+    margin-bottom: 8px;
+
+    &:last-child {
+      margin-bottom: 0;
+    }
+  }
+
+  .detail-label {
+    font-size: 12px;
+    color: #777777;
+    min-width: 60px;
+  }
+
+  .detail-value {
+    font-size: 12px;
+    color: #000000;
+    text-align: right;
+    flex: 1;
+    margin-left: 16px;
+  }
+
+  .detail-value.highlight {
+    color: #2979ff;
+    font-weight: 500;
+  }
+
+  .detail-value.danger {
+    color: #ff4757;
+    font-weight: 500;
+  }
+
+  .no-data {
+    padding: 40px 0;
+    text-align: center;
+    color: #999;
+  }
+</style>

--
Gitblit v1.9.3