| | |
| | | <template> |
| | | <view class="account-view"> |
| | | <!-- 使用通用页面头部组件 --> |
| | | <PageHeader title="台账详情" @back="goBack" /> |
| | | |
| | | <PageHeader title="台账详情" |
| | | @back="goBack" /> |
| | | <!-- 基本信息展示 --> |
| | | <view class="info-section"> |
| | | <view class="section-title">基本信息</view> |
| | |
| | | </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 为 u-icon --> |
| | | <u-icon name="file-text" color="#2979ff" size="15" /> |
| | | <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"> |
| | |
| | | <text class="info-label">规格型号</text> |
| | | <text class="info-value">{{ product.specificationModel }}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <!-- <view class="info-item"> |
| | | <text class="info-label">绑定机器</text> |
| | | <text class="info-value">{{ product.speculativeTradingName }}</text> |
| | | </view> |
| | | </view> --> |
| | | <view class="info-item"> |
| | | <text class="info-label">单位</text> |
| | | <text class="info-value">{{ product.unit }}</text> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view v-else class="no-product"> |
| | | <view v-else |
| | | class="no-product"> |
| | | <text>暂无产品信息</text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {onMounted, ref} from 'vue'; |
| | | import { onMounted, ref } from "vue"; |
| | | import {getSalesLedgerWithProducts} from "@/api/salesManagement/salesLedger"; |
| | | import PageHeader from '@/components/PageHeader.vue'; |
| | | import PageHeader from "@/components/PageHeader.vue"; |
| | | |
| | | // 获取页面参数 |
| | | const editData = ref(null); |
| | | |
| | | const form = ref({ |
| | | id: '', |
| | | salesContractNo: '', |
| | | customerContractNo: '', |
| | | customerId: '', |
| | | customerName: '', |
| | | projectName: '', |
| | | executionDate: '', |
| | | paymentMethod: '', |
| | | entryPerson: '', |
| | | entryPersonName: '', |
| | | entryDate: '', |
| | | salesman: '' |
| | | id: "", |
| | | salesContractNo: "", |
| | | customerContractNo: "", |
| | | customerId: "", |
| | | customerName: "", |
| | | projectName: "", |
| | | executionDate: "", |
| | | paymentMethod: "", |
| | | entryPerson: "", |
| | | entryPersonName: "", |
| | | entryDate: "", |
| | | salesman: "", |
| | | }); |
| | | |
| | | // 产品数据 |
| | |
| | | // 返回上一页 |
| | | const goBack = () => { |
| | | // 清理本地存储的数据 |
| | | uni.removeStorageSync('editData'); |
| | | uni.removeStorageSync("editData"); |
| | | uni.navigateBack(); |
| | | }; |
| | | |
| | |
| | | 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 = { ...res }; |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | // 获取编辑数据并填充表单 |
| | | const editDataStr = uni.getStorageSync('editData'); |
| | | const editDataStr = uni.getStorageSync("editData"); |
| | | if (editDataStr) { |
| | | try { |
| | | editData.value = JSON.parse(editDataStr); |
| | |
| | | fillFormData(); |
| | | }, 100); |
| | | } catch (error) { |
| | | console.error('解析编辑数据失败:', error); |
| | | console.error("解析编辑数据失败:", error); |
| | | } |
| | | } |
| | | }); |