From 31c32afd520773cba392003c8e2743827fb9ccac Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 27 一月 2026 09:55:39 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_new' into dev_new

---
 src/pages/sales/salesAccount/view.vue |  361 ++++++++++++++++++++++++--------------------------
 1 files changed, 174 insertions(+), 187 deletions(-)

diff --git a/src/pages/sales/salesAccount/view.vue b/src/pages/sales/salesAccount/view.vue
index 99a76b2..aca83d3 100644
--- a/src/pages/sales/salesAccount/view.vue
+++ b/src/pages/sales/salesAccount/view.vue
@@ -1,11 +1,8 @@
 <template>
   <view class="account-view">
-    <!-- 椤堕儴鏍囬鏍� -->
-    <view class="header">
-      <up-icon name="arrow-left" size="20" color="#333" @click="goBack" />
-      <text class="title">鍙拌处璇︽儏</text>
-    </view>
-
+    <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 -->
+    <PageHeader title="鍙拌处璇︽儏"
+                @back="goBack" />
     <!-- 鍩烘湰淇℃伅灞曠ず -->
     <view class="info-section">
       <view class="section-title">鍩烘湰淇℃伅</view>
@@ -48,18 +45,22 @@
         </view>
       </view>
     </view>
-
     <!-- 浜у搧淇℃伅灞曠ず -->
-    <view class="product-section" v-if="productData && productData.length > 0">
+    <view class="product-section"
+          v-if="productData && productData.length > 0">
       <view class="section-title">浜у搧淇℃伅</view>
-      <view class="product-card" v-for="(product, idx) in productData" :key="idx">
+      <view class="product-card"
+            v-for="(product, idx) in productData"
+            :key="idx">
         <view class="product-header">
           <view class="product-title">
-            <van-icon name="description" color="#2979ff" size="15" />
+            <!-- 鏇挎崲 van-icon 涓� u-icon -->
+            <u-icon name="file-text"
+                    color="#2979ff"
+                    size="15" />
             <text class="product-productCategory">浜у搧 {{ idx + 1 }}</text>
           </view>
         </view>
-        
         <view class="product-info">
           <view class="info-grid">
             <view class="info-item">
@@ -70,6 +71,10 @@
               <text class="info-label">瑙勬牸鍨嬪彿</text>
               <text class="info-value">{{ product.specificationModel }}</text>
             </view>
+            <!-- <view class="info-item">
+              <text class="info-label">缁戝畾鏈哄櫒</text>
+              <text class="info-value">{{ product.speculativeTradingName }}</text>
+            </view> -->
             <view class="info-item">
               <text class="info-label">鍗曚綅</text>
               <text class="info-value">{{ product.unit }}</text>
@@ -102,210 +107,192 @@
         </view>
       </view>
     </view>
-
-    <!-- 鏃犱骇鍝佷俊鎭彁绀� -->
-    <view class="no-product" v-else>
+    <view v-else
+          class="no-product">
       <text>鏆傛棤浜у搧淇℃伅</text>
     </view>
   </view>
 </template>
 
 <script setup>
-import { onMounted, ref } from 'vue';
-import { getSalesLedgerWithProducts } from "@/api/salesManagement/salesLedger";
+  import { onMounted, ref } from "vue";
+  import { getSalesLedgerWithProducts } from "@/api/salesManagement/salesLedger";
+  import PageHeader from "@/components/PageHeader.vue";
 
-// 琛ㄥ崟鏁版嵁
-const form = ref({
-  id: '',
-  salesContractNo: '',
-  customerContractNo: '',
-  customerId: '',
-  customerName: '',
-  projectName: '',
-  executionDate: '',
-  paymentMethod: '',
-  entryPerson: '',
-  entryPersonName: '',
-  entryDate: '',
-  salesman: ''
-});
+  // 鑾峰彇椤甸潰鍙傛暟
+  const editData = ref(null);
 
-// 浜у搧鏁版嵁
-const productData = ref([]);
-
-// 缂栬緫鏁版嵁
-const editData = ref(null);
-
-// 杩斿洖涓婁竴椤�
-const goBack = () => {
-  // 娓呯悊鏈湴瀛樺偍鐨勬暟鎹�
-  uni.removeStorageSync('editData');
-  uni.navigateBack();
-};
-
-// 濉厖琛ㄥ崟鏁版嵁
-const fillFormData = () => {
-  if (!editData.value) return;
-  
-  // 鑾峰彇瀹屾暣鐨勪骇鍝佷俊鎭�
-  getSalesLedgerWithProducts({ id: editData.value.id, type: 1 }).then((res) => {
-    productData.value = res.productData || [];
+  const form = ref({
+    id: "",
+    salesContractNo: "",
+    customerContractNo: "",
+    customerId: "",
+    customerName: "",
+    projectName: "",
+    executionDate: "",
+    paymentMethod: "",
+    entryPerson: "",
+    entryPersonName: "",
+    entryDate: "",
+    salesman: "",
   });
-  
-  // 濉厖鍩烘湰淇℃伅
-  form.value.salesContractNo = editData.value.salesContractNo || '';
-  form.value.customerContractNo = editData.value.customerContractNo || '';
-  form.value.customerName = editData.value.customerName || '';
-  form.value.projectName = editData.value.projectName || '';
-  form.value.executionDate = editData.value.executionDate || '';
-  form.value.paymentMethod = editData.value.paymentMethod || '';
-  form.value.salesman = editData.value.salesman || '';
-  form.value.entryPerson = editData.value.entryPerson || '';
-  form.value.entryPersonName = editData.value.entryPersonName || '';
-  form.value.entryDate = editData.value.entryDate || '';
-  form.value.id = editData.value.id || '';
-  form.value.customerId = editData.value.customerId || '';
-};
 
-onMounted(() => {
-  // 鑾峰彇缂栬緫鏁版嵁骞跺~鍏呰〃鍗�
-  const editDataStr = uni.getStorageSync('editData');
-  if (editDataStr) {
-    try {
-      editData.value = JSON.parse(editDataStr);
-      // 浣跨敤 nextTick 纭繚鏁版嵁鍔犺浇瀹屾垚鍚庡啀濉厖
-      setTimeout(() => {
-        fillFormData();
-      }, 100);
-    } catch (error) {
-      console.error('瑙f瀽缂栬緫鏁版嵁澶辫触:', error);
+  // 浜у搧鏁版嵁
+  const productData = ref([]);
+
+  // 杩斿洖涓婁竴椤�
+  const goBack = () => {
+    // 娓呯悊鏈湴瀛樺偍鐨勬暟鎹�
+    uni.removeStorageSync("editData");
+    uni.navigateBack();
+  };
+
+  // 濉厖琛ㄥ崟鏁版嵁
+  const fillFormData = () => {
+    if (!editData.value) return;
+
+    // 鑾峰彇瀹屾暣鐨勪骇鍝佷俊鎭�
+    getSalesLedgerWithProducts({ id: editData.value.id, type: 1 }).then(res => {
+      productData.value = res.productData || [];
+      form.value = { ...res };
+    });
+  };
+
+  onMounted(() => {
+    // 鑾峰彇缂栬緫鏁版嵁骞跺~鍏呰〃鍗�
+    const editDataStr = uni.getStorageSync("editData");
+    if (editDataStr) {
+      try {
+        editData.value = JSON.parse(editDataStr);
+        // 浣跨敤 nextTick 纭繚鏁版嵁鍔犺浇瀹屾垚鍚庡啀濉厖
+        setTimeout(() => {
+          fillFormData();
+        }, 100);
+      } catch (error) {
+        console.error("瑙f瀽缂栬緫鏁版嵁澶辫触:", error);
+      }
     }
-  }
-});
+  });
 </script>
 
 <style scoped lang="scss">
-.account-view {
-  min-height: 100vh;
-  background: #f8f9fa;
-  padding-bottom: 2rem;
-}
+  .account-view {
+    min-height: 100vh;
+    background: #f8f9fa;
+    padding-bottom: 2rem;
+  }
 
-.header {
-  display: flex;
-  align-items: center;
-  background: #fff;
-  padding: 1rem 1.25rem;
-  border-bottom: 0.0625rem solid #f0f0f0;
-  position: sticky;
-  top: 0;
-  z-index: 100;
-  /* 鍏煎 iOS 鍒樻捣/鐏靛姩宀涘畨鍏ㄥ尯 */
-  padding-top: env(safe-area-inset-top);
-}
+  .header {
+    display: flex;
+    align-items: center;
+    background: #fff;
+    padding: 1rem 1.25rem;
+    border-bottom: 0.0625rem solid #f0f0f0;
+    position: sticky;
+    top: 0;
+    z-index: 100;
+  }
 
-.title {
-  flex: 1;
-  text-align: center;
-  font-size: 1.125rem;
-  font-weight: 600;
-  color: #333;
-}
+  .title {
+    flex: 1;
+    text-align: center;
+    font-size: 1.125rem;
+    font-weight: 600;
+    color: #333;
+  }
 
-.info-section {
-  background: #fff;
-  margin: 1rem;
-  padding: 1rem;
-  border-radius: 0.5rem;
-  box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.04);
-}
+  .info-section {
+    background: #fff;
+    margin: 1rem;
+    padding: 1rem;
+    border-radius: 0.5rem;
+    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.04);
+  }
 
-.section-title {
-  font-size: 1rem;
-  font-weight: 600;
-  color: #333;
-  margin-bottom: 1rem;
-  padding-bottom: 1rem;
-  border-bottom: 0.0625rem solid #e8e8e8;
-}
+  .product-section {
+    background: #fff;
+    margin: 1rem;
+    padding: 1rem;
+    border-radius: 0.5rem;
+    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.04);
+  }
 
-.info-grid {
-  display: grid;
-  grid-template-columns: 1fr 1fr;
-  gap: 0.75rem;
-}
+  .section-title {
+    font-size: 1rem;
+    font-weight: 600;
+    color: #333;
+    margin-bottom: 1rem;
+    padding-bottom: 0.5rem;
+    border-bottom: 0.0625rem solid #e8e8e8;
+  }
 
-.info-item {
-  display: flex;
-  flex-direction: column;
-  gap: 0.25rem;
-}
+  .info-grid {
+    display: grid;
+    grid-template-columns: 1fr 1fr;
+    gap: 0.75rem;
+  }
 
-.info-label {
-  font-size: 0.75rem;
-  color: #666;
-  font-weight: 400;
-}
+  .info-item {
+    display: flex;
+    flex-direction: column;
+    gap: 0.25rem;
+  }
 
-.info-value {
-  font-size: 0.875rem;
-  color: #333;
-  font-weight: 500;
-}
+  .info-label {
+    font-size: 0.75rem;
+    color: #666;
+    font-weight: 400;
+  }
 
-.info-value.highlight {
-  color: #2979ff;
-  font-weight: 600;
-}
+  .info-value {
+    font-size: 0.875rem;
+    color: #333;
+    font-weight: 500;
+  }
 
-.product-section {
-  background: #fff;
-  margin: 1rem;
-  padding: 1rem;
-  border-radius: 0.5rem;
-  box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.04);
-}
+  .info-value.highlight {
+    color: #2979ff;
+    font-weight: 600;
+  }
 
-.product-card {
-  background: #f8f9fa;
-  border-radius: 0.5rem;
-  padding: 1rem;
-  margin-bottom: 1rem;
-}
+  .product-card {
+    background: #f8f9fa;
+    border-radius: 0.5rem;
+    padding: 1rem;
+    margin-bottom: 1rem;
+    border: 0.0625rem solid #e8e8e8;
+  }
 
-.product-card:last-child {
-  margin-bottom: 0;
-}
+  .product-header {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin-bottom: 1rem;
+    padding-bottom: 0.5rem;
+    border-bottom: 0.0625rem solid #e8e8e8;
+  }
 
-.product-header {
-  display: flex;
-  align-items: center;
-  padding-bottom: 0.75rem;
-  border-bottom: 0.0625rem solid #e8e8e8;
-  margin-bottom: 1rem;
-}
+  .product-title {
+    display: flex;
+    align-items: center;
+    gap: 0.5rem;
+  }
 
-.product-title {
-  display: flex;
-  align-items: center;
-  gap: 0.5rem;
-}
+  .product-productCategory {
+    font-size: 0.875rem;
+    font-weight: 500;
+    color: #333;
+  }
 
-.product-productCategory {
-  font-size: 0.875rem;
-  font-weight: 500;
-  color: #333;
-}
+  .product-info .info-grid {
+    grid-template-columns: 1fr 1fr;
+    gap: 0.5rem;
+  }
 
-.product-info .info-grid {
-  grid-template-columns: 1fr 1fr;
-  gap: 0.5rem;
-}
-
-.no-product {
-  text-align: center;
-  padding: 2rem;
-  color: #999;
-  font-size: 0.875rem;
-}
+  .no-product {
+    text-align: center;
+    padding: 2rem;
+    color: #999;
+    font-size: 0.875rem;
+  }
 </style>

--
Gitblit v1.9.3