yyb
2026-05-22 552ec6b7d8ccc56c379da195fc6c9c74312b1070
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<template>
  <view class="production-plan-detail">
    <PageHeader title="计划详情"
                @back="goBack" />
    <view class="detail-container"
          v-if="detailData">
      <!-- 基本信息卡片 -->
      <view class="detail-card">
        <view class="card-title">
          <up-icon name="info-circle"
                   size="18"
                   color="#3c9cff"></up-icon>
          <text class="title-text">基本信息</text>
        </view>
        <view class="card-content">
          <view class="info-item">
            <text class="label">主生产计划号</text>
            <text class="value">{{ detailData.mpsNo || '-' }}</text>
          </view>
          <view class="info-item">
            <text class="label">来源</text>
            <up-tag :text="detailData.source === '销售' ? '销售' : '内部'"
                    :type="detailData.source === '销售' ? 'primary' : 'info'"
                    size="mini" />
          </view>
          <view class="info-item">
            <text class="label">下发状态</text>
            <up-tag :text="getStatusText(detailData.status)"
                    :type="getStatusType(detailData.status)"
                    size="mini" />
          </view>
        </view>
      </view>
      <!-- 产品信息卡片 -->
      <view class="detail-card">
        <view class="card-title">
          <up-icon name="order"
                   size="18"
                   color="#3c9cff"></up-icon>
          <text class="title-text">产品信息</text>
        </view>
        <view class="card-content">
          <view class="info-item">
            <text class="label">产品名称</text>
            <text class="value font-bold">{{ detailData.productName || '-' }}</text>
          </view>
          <view class="info-item">
            <text class="label">规格型号</text>
            <text class="value">{{ detailData.model || '-' }}</text>
          </view>
          <view class="info-item">
            <text class="label">所需数量</text>
            <text class="value highlight">{{ detailData.qtyRequired || 0 }} {{ detailData.unit || '方' }}</text>
          </view>
          <view class="info-item">
            <text class="label">已下发数量</text>
            <text class="value">{{ detailData.quantityIssued || 0 }} {{ detailData.unit || '方' }}</text>
          </view>
        </view>
      </view>
      <!-- 日期与关联卡片 -->
      <view class="detail-card">
        <view class="card-title">
          <up-icon name="calendar"
                   size="18"
                   color="#3c9cff"></up-icon>
          <text class="title-text">日期与关联</text>
        </view>
        <view class="card-content">
          <view class="info-item">
            <text class="label">需求日期</text>
            <text class="value">{{ formatDate(detailData.requiredDate) }}</text>
          </view>
          <view class="info-item">
            <text class="label">承诺日期</text>
            <text class="value">{{ formatDate(detailData.promisedDeliveryDate) }}</text>
          </view>
          <view class="info-item">
            <text class="label">销售合同号</text>
            <text class="value">{{ detailData.salesContractNo || '-' }}</text>
          </view>
          <view class="info-item">
            <text class="label">客户名称</text>
            <text class="value">{{ detailData.customerName || '-' }}</text>
          </view>
          <view class="info-item">
            <text class="label">项目名称</text>
            <text class="value">{{ detailData.projectName || '-' }}</text>
          </view>
        </view>
      </view>
      <!-- 备注信息 -->
      <view class="detail-card">
        <view class="card-title">
          <up-icon name="edit-pen"
                   size="18"
                   color="#3c9cff"></up-icon>
          <text class="title-text">备注</text>
        </view>
        <view class="card-content">
          <view class="remark-box">
            <text class="remark-text">{{ detailData.remark || '无备注' }}</text>
          </view>
        </view>
      </view>
    </view>
    <view v-else
          class="no-data">
      <up-empty mode="data"
                text="暂无详情数据"></up-empty>
    </view>
  </view>
</template>
 
<script setup>
  import { ref, reactive, onMounted } from "vue";
  import { onLoad } from "@dcloudio/uni-app";
  import dayjs from "dayjs";
  import PageHeader from "@/components/PageHeader.vue";
 
  const detailData = ref(null);
 
  // 返回上一页
  const goBack = () => {
    uni.navigateBack();
  };
 
  // 格式化日期
  const formatDate = date => {
    return date ? dayjs(date).format("YYYY-MM-DD") : "-";
  };
 
  // 获取状态文本
  const getStatusText = status => {
    const statusMap = {
      0: "待下发",
      1: "部分下发",
      2: "已下发",
    };
    return statusMap[status] || "未知";
  };
 
  // 获取状态类型
  const getStatusType = status => {
    const typeMap = {
      0: "warning",
      1: "primary",
      2: "info",
    };
    return typeMap[status] || "info";
  };
 
  onLoad(options => {
    if (options.data) {
      try {
        detailData.value = JSON.parse(decodeURIComponent(options.data));
      } catch (e) {
        console.error("解析数据失败", e);
        uni.showToast({
          title: "数据加载失败",
          icon: "error",
        });
      }
    }
  });
</script>
 
<style scoped lang="scss">
  .production-plan-detail {
    min-height: 100vh;
    background: #f8f9fa;
    padding-bottom: 40rpx;
  }
 
  .detail-container {
    padding: 20rpx;
  }
 
  .detail-card {
    background: #fff;
    border-radius: 16rpx;
    margin-bottom: 24rpx;
    overflow: hidden;
    box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.03);
 
    .card-title {
      display: flex;
      align-items: center;
      padding: 24rpx;
      border-bottom: 1rpx solid #f0f0f0;
      background: #fafafa;
 
      .title-text {
        font-size: 28rpx;
        font-weight: bold;
        color: #333;
        margin-left: 12rpx;
      }
    }
 
    .card-content {
      padding: 10rpx 24rpx;
 
      .info-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20rpx 0;
        border-bottom: 1rpx solid #f9f9f9;
 
        &:last-child {
          border-bottom: none;
        }
 
        .label {
          font-size: 26rpx;
          color: #999;
        }
 
        .value {
          font-size: 26rpx;
          color: #333;
          text-align: right;
          max-width: 70%;
 
          &.font-bold {
            font-weight: bold;
          }
 
          &.highlight {
            color: #f56c6c;
            font-weight: bold;
          }
        }
      }
 
      .remark-box {
        padding: 20rpx 0;
 
        .remark-text {
          font-size: 26rpx;
          color: #666;
          line-height: 1.5;
        }
      }
    }
  }
 
  .no-data {
    padding-top: 200rpx;
  }
</style>