¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="account-view"> |
| | | <!-- 顶鍿 颿 --> |
| | | <view class="header"> |
| | | <up-icon name="arrow-left" size="20" color="#333" @click="goBack" /> |
| | | <text class="title">å°è´¦è¯¦æ
</text> |
| | | </view> |
| | | |
| | | <!-- åºæ¬ä¿¡æ¯å±ç¤º --> |
| | | <view class="info-section"> |
| | | <view class="section-title">åºæ¬ä¿¡æ¯</view> |
| | | <view class="info-grid"> |
| | | <view class="info-item"> |
| | | <text class="info-label">éå®ååå·</text> |
| | | <text class="info-value">{{ form.salesContractNo }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">客æ·ååå·</text> |
| | | <text class="info-value highlight">{{ form.customerContractNo }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">客æ·åç§°</text> |
| | | <text class="info-value">{{ form.customerName }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">ä¸å¡å</text> |
| | | <text class="info-value">{{ form.salesman }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">项ç®åç§°</text> |
| | | <text class="info-value">{{ form.projectName }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">ç¾è®¢æ¥æ</text> |
| | | <text class="info-value">{{ form.executionDate }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">仿¬¾æ¹å¼</text> |
| | | <text class="info-value">{{ form.paymentMethod }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">å½å
¥äºº</text> |
| | | <text class="info-value">{{ form.entryPersonName }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">å½å
¥æ¥æ</text> |
| | | <text class="info-value">{{ form.entryDate }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 产åä¿¡æ¯å±ç¤º --> |
| | | <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-header"> |
| | | <view class="product-title"> |
| | | <van-icon name="description" 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"> |
| | | <text class="info-label">产å大类</text> |
| | | <text class="info-value">{{ product.productCategory }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <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.unit }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">ç¨ç(%)</text> |
| | | <text class="info-value">{{ product.taxRate }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">å«ç¨åä»·(å
)</text> |
| | | <text class="info-value highlight">{{ product.taxInclusiveUnitPrice }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">æ°é</text> |
| | | <text class="info-value highlight">{{ product.quantity }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">å«ç¨æ»ä»·(å
)</text> |
| | | <text class="info-value highlight">{{ product.taxInclusiveTotalPrice }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">ä¸å«ç¨æ»ä»·(å
)</text> |
| | | <text class="info-value highlight">{{ product.taxExclusiveTotalPrice }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">å票类å</text> |
| | | <text class="info-value">{{ product.invoiceType }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- æ 产åä¿¡æ¯æç¤º --> |
| | | <view class="no-product" v-else> |
| | | <text>ææ äº§åä¿¡æ¯</text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, ref } from 'vue'; |
| | | import { getSalesLedgerWithProducts } from "@/api/salesManagement/salesLedger"; |
| | | |
| | | // è¡¨åæ°æ® |
| | | const form = ref({ |
| | | id: '', |
| | | salesContractNo: '', |
| | | customerContractNo: '', |
| | | customerId: '', |
| | | customerName: '', |
| | | projectName: '', |
| | | executionDate: '', |
| | | paymentMethod: '', |
| | | entryPerson: '', |
| | | entryPersonName: '', |
| | | entryDate: '', |
| | | salesman: '' |
| | | }); |
| | | |
| | | // äº§åæ°æ® |
| | | 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 || []; |
| | | }); |
| | | |
| | | // å¡«å
åºæ¬ä¿¡æ¯ |
| | | 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('è§£æç¼è¾æ°æ®å¤±è´¥:', error); |
| | | } |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .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); |
| | | } |
| | | |
| | | .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); |
| | | } |
| | | |
| | | .section-title { |
| | | font-size: 1rem; |
| | | font-weight: 600; |
| | | color: #333; |
| | | margin-bottom: 1rem; |
| | | padding-bottom: 1rem; |
| | | border-bottom: 0.0625rem solid #e8e8e8; |
| | | } |
| | | |
| | | .info-grid { |
| | | display: grid; |
| | | grid-template-columns: 1fr 1fr; |
| | | gap: 0.75rem; |
| | | } |
| | | |
| | | .info-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 0.25rem; |
| | | } |
| | | |
| | | .info-label { |
| | | font-size: 0.75rem; |
| | | color: #666; |
| | | font-weight: 400; |
| | | } |
| | | |
| | | .info-value { |
| | | font-size: 0.875rem; |
| | | color: #333; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .info-value.highlight { |
| | | color: #2979ff; |
| | | 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; |
| | | } |
| | | |
| | | .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-productCategory { |
| | | font-size: 0.875rem; |
| | | font-weight: 500; |
| | | color: #333; |
| | | } |
| | | |
| | | .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; |
| | | } |
| | | </style> |