|
|
|
1
|
+<template>
|
|
|
|
2
|
+ <view class="detail-page">
|
|
|
|
3
|
+ <scroll-view class="scroll" scroll-y>
|
|
|
|
4
|
+ <view class="section">
|
|
|
|
5
|
+ <text class="row company">{{ safeText(form.procurementPlanCode) }}</text>
|
|
|
|
6
|
+ <view class="row">
|
|
|
|
7
|
+ <text class="label">供方</text>
|
|
|
|
8
|
+ <text class="value">{{ safeText(form.supplierName) }}</text>
|
|
|
|
9
|
+ </view>
|
|
|
|
10
|
+ <view class="row">
|
|
|
|
11
|
+ <text class="label">需方</text>
|
|
|
|
12
|
+ <text class="value">{{ safeText(form.companyFullName) }}</text>
|
|
|
|
13
|
+ </view>
|
|
|
|
14
|
+ <view class="row">
|
|
|
|
15
|
+ <text class="label">签订地点</text>
|
|
|
|
16
|
+ <text class="value">{{ safeText(form.signPlace, '芜湖市') }}</text>
|
|
|
|
17
|
+ </view>
|
|
|
|
18
|
+ <view class="row">
|
|
|
|
19
|
+ <text class="label">签订时间</text>
|
|
|
|
20
|
+ <text class="value">{{ formatDateOnly(form.signTime) }}</text>
|
|
|
|
21
|
+ </view>
|
|
|
|
22
|
+ <view class="row">
|
|
|
|
23
|
+ <text class="label">投诉编码</text>
|
|
|
|
24
|
+ <text class="value">{{ safeText(form.procurementPlanCode) }}</text>
|
|
|
|
25
|
+ </view>
|
|
|
|
26
|
+ <view class="row">
|
|
|
|
27
|
+ <text class="label">结算比例</text>
|
|
|
|
28
|
+ <text class="value">{{ formatPercent(form.settlementRatio) }}</text>
|
|
|
|
29
|
+ </view>
|
|
|
|
30
|
+ <view v-if="form.createUserName" class="row">
|
|
|
|
31
|
+ <text class="label">发起人</text>
|
|
|
|
32
|
+ <text class="value">{{ safeText(form.createUserName) }}</text>
|
|
|
|
33
|
+ </view>
|
|
|
|
34
|
+ <view v-if="approvalStatusVisible" class="row">
|
|
|
|
35
|
+ <text class="label">审核状态</text>
|
|
|
|
36
|
+ <text class="value">{{ getAuditStatusText(form.approvalStatus) }}</text>
|
|
|
|
37
|
+ </view>
|
|
|
|
38
|
+ <view v-if="attachmentList.length" class="row">
|
|
|
|
39
|
+ <text class="label">附件</text>
|
|
|
|
40
|
+ <view class="attach-list">
|
|
|
|
41
|
+ <view v-for="(at, idx) in attachmentList" :key="idx" class="attach-item">
|
|
|
|
42
|
+ <text class="attach-name">{{ at.name }}</text>
|
|
|
|
43
|
+ <text class="attach-view" @click.stop="onPreviewAttachment(at)">查看</text>
|
|
|
|
44
|
+ </view>
|
|
|
|
45
|
+ </view>
|
|
|
|
46
|
+ </view>
|
|
|
|
47
|
+ </view>
|
|
|
|
48
|
+
|
|
|
|
49
|
+ <ProductRel mode="view" :list="lineList" />
|
|
|
|
50
|
+
|
|
|
|
51
|
+ <view v-if="form.specialAgreement" class="title-header">
|
|
|
|
52
|
+ <image class="title-header_icon" src="/static/images/title.png" />
|
|
|
|
53
|
+ <span>特殊约定</span>
|
|
|
|
54
|
+ </view>
|
|
|
|
55
|
+ <view v-if="form.specialAgreement" class="section">
|
|
|
|
56
|
+ <text class="remark-text">{{ safeText(form.specialAgreement) }}</text>
|
|
|
|
57
|
+ </view>
|
|
|
|
58
|
+ </scroll-view>
|
|
|
|
59
|
+ </view>
|
|
|
|
60
|
+</template>
|
|
|
|
61
|
+
|
|
|
|
62
|
+<script>
|
|
|
|
63
|
+import ProductRel from './productRel.vue'
|
|
|
|
64
|
+import { domesticAgreementDetailApi } from '@/api/procure-manage/domesticAgreement.js'
|
|
|
|
65
|
+import { getDicByCodes, getDicName } from '@/utils/dic.js'
|
|
|
|
66
|
+
|
|
|
|
67
|
+export default {
|
|
|
|
68
|
+ name: 'DomesticAgreementViewer',
|
|
|
|
69
|
+ components: { ProductRel },
|
|
|
|
70
|
+ props: {
|
|
|
|
71
|
+ id: { type: [String, Number], default: '' }
|
|
|
|
72
|
+ },
|
|
|
|
73
|
+ data() {
|
|
|
|
74
|
+ return {
|
|
|
|
75
|
+ form: {},
|
|
|
|
76
|
+ lineList: [],
|
|
|
|
77
|
+ attachmentList: [],
|
|
|
|
78
|
+ dicOptions: {
|
|
|
|
79
|
+ AUDIT_STATUS: []
|
|
|
|
80
|
+ }
|
|
|
|
81
|
+ }
|
|
|
|
82
|
+ },
|
|
|
|
83
|
+ computed: {
|
|
|
|
84
|
+ approvalStatusVisible() {
|
|
|
|
85
|
+ return !!(this.form && this.form.approvalStatus)
|
|
|
|
86
|
+ }
|
|
|
|
87
|
+ },
|
|
|
|
88
|
+ created() {
|
|
|
|
89
|
+ this.loadDicData()
|
|
|
|
90
|
+ },
|
|
|
|
91
|
+ watch: {
|
|
|
|
92
|
+ id: {
|
|
|
|
93
|
+ immediate: true,
|
|
|
|
94
|
+ handler(val) {
|
|
|
|
95
|
+ const v = (val !== undefined && val !== null) ? String(val) : ''
|
|
|
|
96
|
+ if (v) this.loadDetail(v)
|
|
|
|
97
|
+ }
|
|
|
|
98
|
+ }
|
|
|
|
99
|
+ },
|
|
|
|
100
|
+ methods: {
|
|
|
|
101
|
+ async loadDicData() {
|
|
|
|
102
|
+ try {
|
|
|
|
103
|
+ const results = await getDicByCodes(['AUDIT_STATUS'])
|
|
|
|
104
|
+ this.dicOptions.AUDIT_STATUS = (results.AUDIT_STATUS && results.AUDIT_STATUS.data) || []
|
|
|
|
105
|
+ } catch (e) {
|
|
|
|
106
|
+ this.dicOptions.AUDIT_STATUS = []
|
|
|
|
107
|
+ }
|
|
|
|
108
|
+ },
|
|
|
|
109
|
+ getAuditStatusText(status) {
|
|
|
|
110
|
+ const v = status == null ? '' : String(status)
|
|
|
|
111
|
+ if (!v) return '-'
|
|
|
|
112
|
+ return getDicName('AUDIT_STATUS', v, this.dicOptions.AUDIT_STATUS) || v
|
|
|
|
113
|
+ },
|
|
|
|
114
|
+ safeText(v, def) {
|
|
|
|
115
|
+ const s = v == null ? '' : String(v)
|
|
|
|
116
|
+ if (s.trim()) return s
|
|
|
|
117
|
+ return def != null ? def : '-'
|
|
|
|
118
|
+ },
|
|
|
|
119
|
+ formatDateOnly(v) {
|
|
|
|
120
|
+ const s = v == null ? '' : String(v).trim()
|
|
|
|
121
|
+ if (!s) return '-'
|
|
|
|
122
|
+ if (s.length >= 10) return s.slice(0, 10)
|
|
|
|
123
|
+ return s
|
|
|
|
124
|
+ },
|
|
|
|
125
|
+ formatPercent(v) {
|
|
|
|
126
|
+ if (v === null || v === undefined || v === '') return '-'
|
|
|
|
127
|
+ const n = Number(v)
|
|
|
|
128
|
+ if (isNaN(n)) return String(v)
|
|
|
|
129
|
+ return n + '%'
|
|
|
|
130
|
+ },
|
|
|
|
131
|
+ buildAttachmentList() {
|
|
|
|
132
|
+ const ids = this.form.attachmentFileIds
|
|
|
|
133
|
+ const names = this.form.attachmentFileNames
|
|
|
|
134
|
+ const idArr = (typeof ids === 'string' && ids) ? ids.split(',').filter(Boolean) : (Array.isArray(ids) ? ids : [])
|
|
|
|
135
|
+ const nameArr = (typeof names === 'string' && names) ? names.split(',').filter(Boolean) : (Array.isArray(names) ? names : [])
|
|
|
|
136
|
+ const len = Math.max(idArr.length, nameArr.length)
|
|
|
|
137
|
+ const list = []
|
|
|
|
138
|
+ for (let i = 0; i < len; i++) {
|
|
|
|
139
|
+ list.push({ id: idArr[i] || '', name: nameArr[i] || ('附件' + (i + 1)) })
|
|
|
|
140
|
+ }
|
|
|
|
141
|
+ this.attachmentList = list
|
|
|
|
142
|
+ },
|
|
|
|
143
|
+ getFormValues() {
|
|
|
|
144
|
+ return JSON.parse(JSON.stringify(this.form || {}))
|
|
|
|
145
|
+ },
|
|
|
|
146
|
+ checkForm() {
|
|
|
|
147
|
+ return true
|
|
|
|
148
|
+ },
|
|
|
|
149
|
+ async loadDetail(id) {
|
|
|
|
150
|
+ try {
|
|
|
|
151
|
+ const res = await domesticAgreementDetailApi({ id: id })
|
|
|
|
152
|
+ const data = res && res.data ? (res.data.data || res.data) : {}
|
|
|
|
153
|
+ this.form = Object.assign({}, data)
|
|
|
|
154
|
+ const lines = data && Array.isArray(data.procurementContractLineList) ? data.procurementContractLineList : []
|
|
|
|
155
|
+ this.lineList = lines.map(l => Object.assign({}, l))
|
|
|
|
156
|
+ this.buildAttachmentList()
|
|
|
|
157
|
+ } catch (e) {
|
|
|
|
158
|
+ this.form = {}
|
|
|
|
159
|
+ this.lineList = []
|
|
|
|
160
|
+ this.attachmentList = []
|
|
|
|
161
|
+ }
|
|
|
|
162
|
+ },
|
|
|
|
163
|
+ onPreviewAttachment(at) {
|
|
|
|
164
|
+ if (!at || !at.id) {
|
|
|
|
165
|
+ uni.showToast({ title: '无法查看', icon: 'none' })
|
|
|
|
166
|
+ return
|
|
|
|
167
|
+ }
|
|
|
|
168
|
+ uni.showToast({ title: '查看附件 ' + at.name, icon: 'none' })
|
|
|
|
169
|
+ }
|
|
|
|
170
|
+ }
|
|
|
|
171
|
+}
|
|
|
|
172
|
+</script>
|
|
|
|
173
|
+
|
|
|
|
174
|
+<style lang="scss" scoped>
|
|
|
|
175
|
+.detail-page {
|
|
|
|
176
|
+ background: #f3f3f3;
|
|
|
|
177
|
+}
|
|
|
|
178
|
+.scroll {
|
|
|
|
179
|
+ flex: 1;
|
|
|
|
180
|
+ padding: 8rpx 0 144rpx;
|
|
|
|
181
|
+}
|
|
|
|
182
|
+.title-header {
|
|
|
|
183
|
+ display: flex;
|
|
|
|
184
|
+ align-items: center;
|
|
|
|
185
|
+ padding: 24rpx 32rpx 12rpx;
|
|
|
|
186
|
+ background-color: #ffffff;
|
|
|
|
187
|
+ .title-header_icon {
|
|
|
|
188
|
+ width: 36rpx;
|
|
|
|
189
|
+ height: 36rpx;
|
|
|
|
190
|
+ margin-right: 12rpx;
|
|
|
|
191
|
+ }
|
|
|
|
192
|
+ span {
|
|
|
|
193
|
+ font-size: 34rpx;
|
|
|
|
194
|
+ font-weight: 600;
|
|
|
|
195
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
196
|
+ }
|
|
|
|
197
|
+}
|
|
|
|
198
|
+.section {
|
|
|
|
199
|
+ padding: 32rpx;
|
|
|
|
200
|
+ background: #fff;
|
|
|
|
201
|
+ margin-bottom: 20rpx;
|
|
|
|
202
|
+}
|
|
|
|
203
|
+.row {
|
|
|
|
204
|
+ display: flex;
|
|
|
|
205
|
+ margin-bottom: 28rpx;
|
|
|
|
206
|
+ &:last-child { margin-bottom: 0; }
|
|
|
|
207
|
+ &.company {
|
|
|
|
208
|
+ font-size: 36rpx;
|
|
|
|
209
|
+ font-weight: 600;
|
|
|
|
210
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
211
|
+ padding-top: 8rpx;
|
|
|
|
212
|
+ line-height: 50rpx;
|
|
|
|
213
|
+ }
|
|
|
|
214
|
+ .label {
|
|
|
|
215
|
+ max-width: 420rpx;
|
|
|
|
216
|
+ margin-right: 20rpx;
|
|
|
|
217
|
+ line-height: 32rpx;
|
|
|
|
218
|
+ font-size: 28rpx;
|
|
|
|
219
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
|
220
|
+ }
|
|
|
|
221
|
+ .value {
|
|
|
|
222
|
+ flex: 1;
|
|
|
|
223
|
+ line-height: 32rpx;
|
|
|
|
224
|
+ font-size: 28rpx;
|
|
|
|
225
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
226
|
+ text-align: right;
|
|
|
|
227
|
+ word-break: break-all;
|
|
|
|
228
|
+ }
|
|
|
|
229
|
+}
|
|
|
|
230
|
+.attach-list {
|
|
|
|
231
|
+ flex: 1;
|
|
|
|
232
|
+ display: flex;
|
|
|
|
233
|
+ flex-direction: column;
|
|
|
|
234
|
+ align-items: flex-end;
|
|
|
|
235
|
+ gap: 8rpx;
|
|
|
|
236
|
+}
|
|
|
|
237
|
+.attach-item {
|
|
|
|
238
|
+ display: flex;
|
|
|
|
239
|
+ align-items: center;
|
|
|
|
240
|
+ gap: 16rpx;
|
|
|
|
241
|
+ .attach-name {
|
|
|
|
242
|
+ font-size: 26rpx;
|
|
|
|
243
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
244
|
+ }
|
|
|
|
245
|
+ .attach-view {
|
|
|
|
246
|
+ font-size: 26rpx;
|
|
|
|
247
|
+ color: $theme-primary;
|
|
|
|
248
|
+ }
|
|
|
|
249
|
+}
|
|
|
|
250
|
+.remark-text {
|
|
|
|
251
|
+ font-size: 28rpx;
|
|
|
|
252
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
253
|
+ line-height: 1.6;
|
|
|
|
254
|
+ white-space: pre-wrap;
|
|
|
|
255
|
+}
|
|
|
|
256
|
+</style> |