From adeb8b768926ed50a3fb0857f366d6a0308d2cc0 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期五, 29 八月 2025 17:45:57 +0800 Subject: [PATCH] 修改组件 --- src/pages/sales/salesAccount/view.vue | 67 ++++++++++++--------------------- 1 files changed, 25 insertions(+), 42 deletions(-) diff --git a/src/pages/sales/salesAccount/view.vue b/src/pages/sales/salesAccount/view.vue index 558246f..acfb6e0 100644 --- a/src/pages/sales/salesAccount/view.vue +++ b/src/pages/sales/salesAccount/view.vue @@ -52,7 +52,8 @@ <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> @@ -99,19 +100,21 @@ </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 editData = ref(null); + const form = ref({ id: '', salesContractNo: '', @@ -130,9 +133,6 @@ // 浜у搧鏁版嵁 const productData = ref([]); -// 缂栬緫鏁版嵁 -const editData = ref(null); - // 杩斿洖涓婁竴椤� const goBack = () => { // 娓呯悊鏈湴瀛樺偍鐨勬暟鎹� @@ -145,23 +145,10 @@ if (!editData.value) return; // 鑾峰彇瀹屾暣鐨勪骇鍝佷俊鎭� - getSalesLedgerWithProducts({ id: editData.value.id, type: 1 }).then((res) => { + getSalesLedgerWithProducts({ id: editData.value.id, type: 1 }).then((res) => { productData.value = res.productData || []; + form.value = {...res} }); - - // 濉厖鍩烘湰淇℃伅 - 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(() => { @@ -197,8 +184,6 @@ position: sticky; top: 0; z-index: 100; - /* 鍏煎 iOS 鍒樻捣/鐏靛姩宀涘畨鍏ㄥ尯 */ - padding-top: env(safe-area-inset-top); } .title { @@ -217,12 +202,20 @@ box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.04); } +.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); +} + .section-title { font-size: 1rem; font-weight: 600; color: #333; margin-bottom: 1rem; - padding-bottom: 1rem; + padding-bottom: 0.5rem; border-bottom: 0.0625rem solid #e8e8e8; } @@ -255,31 +248,21 @@ font-weight: 600; } -.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); -} - .product-card { background: #f8f9fa; border-radius: 0.5rem; padding: 1rem; margin-bottom: 1rem; -} - -.product-card:last-child { - margin-bottom: 0; + border: 0.0625rem solid #e8e8e8; } .product-header { display: flex; align-items: center; - padding-bottom: 0.75rem; - border-bottom: 0.0625rem solid #e8e8e8; + justify-content: space-between; margin-bottom: 1rem; + padding-bottom: 0.5rem; + border-bottom: 0.0625rem solid #e8e8e8; } .product-title { -- Gitblit v1.9.3