|
...
|
...
|
@@ -5,12 +5,14 @@ |
|
5
|
5
|
<view class="section">
|
|
6
|
6
|
<text class="row company">{{ form.customerName }}</text>
|
|
7
|
7
|
<view :class="['status', `status_${form.status}`]" />
|
|
8
|
|
- <view class="row"><text class="label">发货日期</text><text class="value">{{ form.shipmentsDate }}</text></view>
|
|
|
8
|
+ <view class="row"><text class="label">原发货日期</text><text class="value">{{ form.shipmentsDate }}</text></view>
|
|
|
9
|
+ <view class="row"><text class="label">实际发货日期</text><text class="value">{{ form.newShipmentDate }}</text></view>
|
|
9
|
10
|
<view class="row"><text class="label">生产厂</text><text class="value">{{ form.workshopName }}</text></view>
|
|
10
|
11
|
<view class="row"><text class="label">办事处</text><text class="value">{{ form.deptName }}</text></view>
|
|
11
|
12
|
<view class="row"><text class="label">区域</text><text class="value">{{ form.regionName }}</text></view>
|
|
12
|
13
|
<view class="row"><text class="label">交货方式</text><text class="value">{{ form.deliveryType }}</text></view>
|
|
13
|
14
|
<view class="row"><text class="label">目的地</text><text class="value">{{ form.destination }}</text></view>
|
|
|
15
|
+ <view class="row"><text class="label">是否当日发货</text><text class="value">{{ form.onTimeShipment === true ? '是' : (form.onTimeShipment === false ? '否' : '') }}</text></view>
|
|
14
|
16
|
</view>
|
|
15
|
17
|
|
|
16
|
18
|
<!-- 产品 -->
|
|
...
|
...
|
@@ -41,6 +43,36 @@ |
|
41
|
43
|
</view>
|
|
42
|
44
|
</view>
|
|
43
|
45
|
</uni-popup>
|
|
|
46
|
+ <!-- 填写日期 -->
|
|
|
47
|
+ <uni-popup ref="fillDatePopup" type="bottom" :mask-click="false">
|
|
|
48
|
+ <view class="dialog">
|
|
|
49
|
+ <view class="dialog_header">
|
|
|
50
|
+ <text>填写日期</text>
|
|
|
51
|
+ <view class="dialog_close" @click="closeFillDateInfo"></view>
|
|
|
52
|
+ </view>
|
|
|
53
|
+ <view class="dialog_body fill-data_body">
|
|
|
54
|
+ <uni-list>
|
|
|
55
|
+ <uni-list-item title="原发货日期">
|
|
|
56
|
+ <template v-slot:footer>
|
|
|
57
|
+ <view class="value">{{ fillDateForm.shipmentsDate }}</view>
|
|
|
58
|
+ </template>
|
|
|
59
|
+ </uni-list-item>
|
|
|
60
|
+ <uni-list-item>
|
|
|
61
|
+ <template v-slot:body>
|
|
|
62
|
+ <view class="item-title"><text class="required">*</text><text>实际发货日期</text></view>
|
|
|
63
|
+ </template>
|
|
|
64
|
+ <template v-slot:footer>
|
|
|
65
|
+ <uni-datetime-picker type="date" :start="todayDate"
|
|
|
66
|
+ v-model="fillDateForm.newShipmentDate" />
|
|
|
67
|
+ </template>
|
|
|
68
|
+ </uni-list-item>
|
|
|
69
|
+ </uni-list>
|
|
|
70
|
+ </view>
|
|
|
71
|
+ <view class="dialog_footer">
|
|
|
72
|
+ <button class="btn confirm" type="primary" @click="onFillDateSave">保存</button>
|
|
|
73
|
+ </view>
|
|
|
74
|
+ </view>
|
|
|
75
|
+ </uni-popup>
|
|
44
|
76
|
<!-- 申请延期 -->
|
|
45
|
77
|
<uni-popup ref="applyDelayPopup" type="bottom" :mask-click="false">
|
|
46
|
78
|
<view class="dialog">
|
|
...
|
...
|
@@ -136,7 +168,7 @@ |
|
136
|
168
|
</template>
|
|
137
|
169
|
|
|
138
|
170
|
<script>
|
|
139
|
|
-import { getDetailApi, saveSignInTicket, checkApi, splitDataApi } from '@/api/invoice.js'
|
|
|
171
|
+import { getDetailApi, saveSignInTicket, checkApi, splitDataApi, updateApi } from '@/api/invoice.js'
|
|
140
|
172
|
import Product from './product.vue'
|
|
141
|
173
|
import DetailButtons from '@/components/detail-buttons/index.vue'
|
|
142
|
174
|
import FileUpload from '@/components/file-upload/index.vue'
|
|
...
|
...
|
@@ -154,12 +186,18 @@ export default { |
|
154
|
186
|
// { text: '编辑', visible: true, variant: 'outline', event: 'edit' },
|
|
155
|
187
|
{ text: '填写实发数', visible: true, variant: 'outline', event: 'fill' },
|
|
156
|
188
|
{ text: '上传签收单据', visible: true, variant: 'primary', event: 'upload' },
|
|
|
189
|
+ { text: '填写日期', visible: true, variant: 'primary', event: 'fillDate' },
|
|
157
|
190
|
],
|
|
158
|
191
|
uploadFile: { id: '', name: '' },
|
|
159
|
192
|
applyDelayForm: {},
|
|
160
|
193
|
splitForm: {
|
|
161
|
194
|
initItem: {},
|
|
162
|
195
|
},
|
|
|
196
|
+ fillDateForm: {
|
|
|
197
|
+ id: '',
|
|
|
198
|
+ shipmentsDate: '',
|
|
|
199
|
+ newShipmentDate: '',
|
|
|
200
|
+ },
|
|
163
|
201
|
}
|
|
164
|
202
|
},
|
|
165
|
203
|
computed: {
|
|
...
|
...
|
@@ -168,8 +206,10 @@ export default { |
|
168
|
206
|
const e = String(m.status || '')
|
|
169
|
207
|
return {
|
|
170
|
208
|
canEdit: e === 'UN_SHIPMENTS',
|
|
171
|
|
- canFill: e === 'UN_SHIPMENTS',
|
|
|
209
|
+ // onTimeShipment 有值(true || false), 填写实发数按钮不显示
|
|
|
210
|
+ canFill: e === 'UN_SHIPMENTS' && (m.onTimeShipment !== false && m.onTimeShipment !== true),
|
|
172
|
211
|
canUpload: e === 'SHIPMENTS',
|
|
|
212
|
+ canFillDate: e === 'UN_SHIPMENTS' && m.onTimeShipment === false && !m.newShipmentDate,
|
|
173
|
213
|
}
|
|
174
|
214
|
},
|
|
175
|
215
|
displayButtons() {
|
|
...
|
...
|
@@ -178,7 +218,15 @@ export default { |
|
178
|
218
|
// { ...this.buttons[0], visible: f.canEdit && this.$auth.hasPermi('shipping-plan-manage:invoice:modify') },
|
|
179
|
219
|
{ ...this.buttons[0], visible: f.canFill && this.$auth.hasPermi('shipping-plan-manage:invoice:fill') },
|
|
180
|
220
|
{ ...this.buttons[1], visible: f.canUpload && this.$auth.hasPermi('shipping-plan-manage:invoice:upload') },
|
|
|
221
|
+ { ...this.buttons[2], visible: f.canFillDate && this.$auth.hasPermi('shipping-plan-manage:invoice:fill-date') },
|
|
181
|
222
|
]
|
|
|
223
|
+ },
|
|
|
224
|
+ todayDate() {
|
|
|
225
|
+ const now = new Date()
|
|
|
226
|
+ const y = now.getFullYear()
|
|
|
227
|
+ const m = String(now.getMonth() + 1).padStart(2, '0')
|
|
|
228
|
+ const d = String(now.getDate()).padStart(2, '0')
|
|
|
229
|
+ return `${y}-${m}-${d}`
|
|
182
|
230
|
}
|
|
183
|
231
|
},
|
|
184
|
232
|
onLoad(query) {
|
|
...
|
...
|
@@ -200,6 +248,7 @@ export default { |
|
200
|
248
|
// edit: () => this.onEdit(),
|
|
201
|
249
|
fill: () => this.onFill(),
|
|
202
|
250
|
upload: () => this.onUpload(),
|
|
|
251
|
+ fillDate: () => this.onFillDate(),
|
|
203
|
252
|
}
|
|
204
|
253
|
const fn = map[btn.event]
|
|
205
|
254
|
if (typeof fn === 'function') fn()
|
|
...
|
...
|
@@ -221,6 +270,11 @@ export default { |
|
221
|
270
|
onUpload() {
|
|
222
|
271
|
this.$refs.uploadPopup && this.$refs.uploadPopup.open()
|
|
223
|
272
|
},
|
|
|
273
|
+ onFillDate() {
|
|
|
274
|
+ this.fillDateForm.id = this.form.id;
|
|
|
275
|
+ this.fillDateForm.shipmentsDate = this.form.shipmentsDate;
|
|
|
276
|
+ this.$refs.fillDatePopup && this.$refs.fillDatePopup.open()
|
|
|
277
|
+ },
|
|
224
|
278
|
downloadFile,
|
|
225
|
279
|
closeUploadInfo() {
|
|
226
|
280
|
this.uploadFile = { id: '', name: '' };
|
|
...
|
...
|
@@ -248,6 +302,31 @@ export default { |
|
248
|
302
|
uni.showToast({ title: (e && e.msg) || '保存失败', icon: 'none' })
|
|
249
|
303
|
}
|
|
250
|
304
|
},
|
|
|
305
|
+ closeFillDateInfo() {
|
|
|
306
|
+ this.uploadFile = { id: '', name: '' };
|
|
|
307
|
+ this.$refs.fillDatePopup && this.$refs.fillDatePopup.close()
|
|
|
308
|
+ },
|
|
|
309
|
+ async onFillDateSave() {
|
|
|
310
|
+ console.log('onFillDateSave__this.fillDateForm', this.fillDateForm)
|
|
|
311
|
+ if (!this.fillDateForm.newShipmentDate) {
|
|
|
312
|
+ uni.showToast({
|
|
|
313
|
+ title: '请选择实际发货日期',
|
|
|
314
|
+ icon: 'none'
|
|
|
315
|
+ })
|
|
|
316
|
+ return
|
|
|
317
|
+ }
|
|
|
318
|
+ const params = {
|
|
|
319
|
+ id: this.fillDateForm.id,
|
|
|
320
|
+ newShipmentDate: this.fillDateForm.newShipmentDate,
|
|
|
321
|
+ }
|
|
|
322
|
+ try {
|
|
|
323
|
+ await updateApi(params)
|
|
|
324
|
+ uni.showToast({ title: '保存成功', icon: 'success' })
|
|
|
325
|
+ setTimeout(() => { uni.redirectTo({ url: '/pages/invoice/index' }) }, 300)
|
|
|
326
|
+ } catch (e) {
|
|
|
327
|
+ uni.showToast({ title: (e && e.msg) || '保存失败', icon: 'none' })
|
|
|
328
|
+ }
|
|
|
329
|
+ },
|
|
251
|
330
|
// 申请延期
|
|
252
|
331
|
applyDelayFun(id) {
|
|
253
|
332
|
getShipmentPlanDetailApi(id).then(res => {
|
|
...
|
...
|
@@ -501,6 +580,7 @@ export default { |
|
501
|
580
|
padding: 12rpx 4rpx 24rpx;
|
|
502
|
581
|
max-height: 70vh;
|
|
503
|
582
|
overflow-y: auto;
|
|
|
583
|
+
|
|
504
|
584
|
}
|
|
505
|
585
|
|
|
506
|
586
|
.split_body {
|
|
...
|
...
|
@@ -740,4 +820,11 @@ export default { |
|
740
|
820
|
}
|
|
741
|
821
|
}
|
|
742
|
822
|
}
|
|
|
823
|
+.fill-data_body {
|
|
|
824
|
+ ::v-deep .uni-list-item {
|
|
|
825
|
+ &__container {
|
|
|
826
|
+ align-items: center;
|
|
|
827
|
+ }
|
|
|
828
|
+ }
|
|
|
829
|
+}
|
|
743
|
830
|
</style> |
...
|
...
|
|