wujianwei
2025-12-29 371d568cc984422607bbcfd699c1716f5df6a898
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
<template>
  <view class="container">
    <!-- 标题栏 -->
    <Nav title="垫付列表" :customBack="customUrl"></Nav>
 
    <!-- 垫付列表-可下拉滚动 -->
    <scroll-view class="advance-scroll" scroll-y="true" style="height: calc(100vh - 80rpx);">
      <view class="advance-item" v-for="(item, index) in advanceList" :key="index">
        <view class="item-field">
          <view class="field-label">调度单号</view>
          <view class="field-value">{{ item.dispatchNo }}</view>
        </view>
        <view class="item-field">
          <view class="field-label">客户</view>
          <view class="field-value">{{ item.customerName }}</view>
        </view>
        <view class="item-field">
          <view class="field-label">上传时间</view>
          <view class="field-value">{{ item.feeCreateTime }}</view>
        </view>
        <view class="item-field">
          <view class="field-label">垫付费用类型</view>
          <view class="field-value">{{ item.statusStr }}</view>
        </view>
        <view class="item-field">
          <view class="field-label">垫付费用金额</view>
          <view class="field-value fee-amount">¥{{ item.actualFeeAmount }}</view>
        </view>
        <!-- 替换原有的voucher-grid部分 -->
        <view class="item-field">
          <view class="field-label">垫付凭证</view>
          <view class="voucher-grid">
            <view class="voucher-item" v-for="(img, imgIndex) in item.feeVoucherUrl" :key="imgIndex">
              <image class="voucher-img" :src="img" mode="aspectFill"></image>
            </view>
            <!-- 当没有图片时显示提示 -->
            <view v-if="!item.feeVoucherUrl || item.feeVoucherUrl.length === 0" class="no-voucher">
              暂无凭证
            </view>
          </view>
        </view>
      </view>
    </scroll-view>
  </view>
</template>
 
<script>
import { getTmsFinanceDetailList } from "@/common/paymentList";
import { getcarType, } from "@/common/examine";
 
export default {
  data() {
    return {
      advanceList: [
 
      ],
      formData: {},
      feeTypeList: [],
      customUrl: 'pages/beReferred/index'
    };
  },
 
  onLoad(options) {
    this.formData = options;
    if (options.id){
      this.customUrl ='pages/examine/index?id=' + options.id+'&name='+'上传行程'+'&router='+'pages/beReferred/index'
    }else{
      this.customUrl ='pages/beReferred/index'
    }
    // 获取 URL 参数
 
  }, created() {
    this.getList();
  },
  methods: {
    getList() {
 
 
      getcarType('fee_type').then((res) => {
        this.feeTypeList = res
        if (res.length > 0) {
          getTmsFinanceDetailList({dispatchId:this.formData.id}).then((res1) => {
            this.advanceList = res1;
            this.advanceList.forEach(item => {
              // 查找匹配的dictLabel
              const matchedDict = this.feeTypeList.find(dictItem => dictItem.dictValue == item.feeType);
              item.statusStr = matchedDict ? matchedDict.dictLabel : '';
 
              // 转换voucherUrl为数组
              if (item.feeVoucherUrl) {
                item.feeVoucherUrl = item.feeVoucherUrl.split(',').filter(url => url.trim() !== '');
              } else {
                item.feeVoucherUrl = [];
              }
            });
 
 
 
 
          }).catch(err => {
            console.error('获取调度信息失败:', err);
          });
        }
 
 
      }).catch(err => {
      });
    },
 
 
  }
};
</script>
 
<style scoped>
.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #f7f7f7;
}
 
/* 标题栏 */
.title-bar {
  height: 80rpx;
  line-height: 80rpx;
  text-align: center;
  font-size: 32rpx;
  font-weight: 500;
  background-color: #fff;
  border-bottom: 1rpx solid #ccc;
}
 
/* 垫付列表滚动区域 */
.advance-scroll {
  flex: 1;
  padding: 20rpx;
  box-sizing: border-box;
}
 
/* 垫付项 */
.advance-item {
  background-color: #fff;
  border: 1rpx solid #eee;
  border-radius: 12rpx;
  padding: 30rpx;
  margin-bottom: 20rpx;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}
 
/* 字段行 */
.item-field {
  display: flex;
  margin-bottom: 20rpx;
  align-items: flex-start;
}
 
/* 字段标签 */
.field-label {
  width: 180rpx;
  color: #666;
  font-size: 28rpx;
}
 
/* 字段值 */
.field-value {
  flex: 1;
  color: #333;
  font-size: 28rpx;
}
 
/* 费用金额特殊样式 */
.fee-amount {
  color: #e53e3e;
  font-weight: 500;
}
 
/* 凭证网格 */
.voucher-grid {
display: flex;
  flex-wrap: wrap; /* 允许换行 */
  gap: 10rpx;
}
 
/* 凭证项 */
.voucher-item {
  width: 120rpx;
  height: 120rpx;
  position: relative;
  border: 1rpx solid #eee;
  border-radius: 6rpx;
  overflow: hidden;
   flex-shrink: 0; /* 防止压缩 */
}
 
/* 凭证图片 */
.voucher-img {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
/* 添加无凭证提示样式 */
.no-voucher {
  color: #999;
  font-size: 28rpx;
  padding: 20rpx 0;
}
</style>