Commit 645acc800780c459af2dc8a28f1dcf7d8cf3c06c

Authored by gesilong
1 parent a54ad5e5

commit:是否推送

... ... @@ -47,6 +47,15 @@ export function createApi(params) {
47 47 contentType: ContentTypeEnum.JSON
48 48 })
49 49 }
  50 +//推送
  51 +export function pushApi(ids) {
  52 + return request({
  53 + url: baseUrl + '/push',
  54 + method: 'post',
  55 + data: ids,
  56 + contentType: ContentTypeEnum.JSON
  57 + })
  58 +}
50 59
51 60
52 61 // 修改保存
... ...
... ... @@ -184,7 +184,7 @@ import { getDetailApi, saveSignInTicket, checkApi, splitDataApi, updateApi } fro
184 184 import Product from './product.vue'
185 185 import DetailButtons from '@/components/detail-buttons/index.vue'
186 186 import FileUpload from '@/components/file-upload/index.vue'
187   -import { getShipmentPlanDetailApi, createApi } from '@/api/delay_invoice.js'
  187 +import { getShipmentPlanDetailApi, createApi, pushApi } from '@/api/delay_invoice.js'
188 188 import { downloadFile } from '@/utils/downloadFile.js'
189 189
190 190 export default {
... ... @@ -199,6 +199,7 @@ export default {
199 199 { text: '填写实发数', visible: true, variant: 'outline', event: 'fill' },
200 200 { text: '上传签收单据', visible: true, variant: 'primary', event: 'upload' },
201 201 { text: '填写日期', visible: true, variant: 'primary', event: 'fillDate' },
  202 + { text: '推送', visible: true, variant: 'primary', event: 'push' },
202 203 ],
203 204 uploadFile: { id: '', name: '' },
204 205 applyDelayForm: {},
... ... @@ -231,6 +232,7 @@ export default {
231 232 { ...this.buttons[0], visible: f.canFill && this.$auth.hasPermi('shipping-plan-manage:invoice:fill') },
232 233 { ...this.buttons[1], visible: f.canUpload && this.$auth.hasPermi('shipping-plan-manage:invoice:upload') },
233 234 { ...this.buttons[2], visible: f.canFillDate && this.$auth.hasPermi('shipping-plan-manage:invoice:fill-date') },
  235 + { ...this.buttons[3], visible: this.$auth.hasPermi('shipping-plan-manage:invoice:push') },
234 236 ]
235 237 },
236 238 todayDate() {
... ... @@ -261,6 +263,7 @@ export default {
261 263 fill: () => this.onFill(),
262 264 upload: () => this.onUpload(),
263 265 fillDate: () => this.onFillDate(),
  266 + push: () => this.onPush(),
264 267 }
265 268 const fn = map[btn.event]
266 269 if (typeof fn === 'function') fn()
... ... @@ -279,6 +282,16 @@ export default {
279 282 }
280 283 if (id) uni.navigateTo({ url: `/pages/invoice/fill?id=${id}&customerName=${this.form.customerName}` })
281 284 },
  285 + async onPush() {
  286 + const id = this.form.id || this.form.code;
  287 + try {
  288 + await pushApi([id])
  289 + } catch (e) {
  290 + uni.showToast({ title: (e && e.msg) || '推送失败', icon: 'none' })
  291 + return
  292 + }
  293 + if (id) uni.showToast({ title: '推送成功', icon: 'success' })
  294 + },
282 295 onUpload() {
283 296 this.$refs.uploadPopup && this.$refs.uploadPopup.open()
284 297 },
... ...