| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- // pages/voyages/uploadDischarge/uploadDischarge.js
- import {
- postApi
- } from "../../../apis/api"
- import {
- uploadImage
- } from "../../../utils/uploadImage"
- Page({
- data: {
- weighTime: '',
- carNum: '',
- receivingUnit: '',
- grossWeight: 0,
- tare: 0,
- netWeight: 0,
- fileObj: {}
- },
- async uploadBill(e) {
- let {
- type
- } = e.currentTarget.dataset
- let postData = {
- type,
- voyageId: this.data.voyageId
- }
- let res = await uploadImage("/voyage/uploadVoyageWayBill", postData)
- let {
- fileKey,
- viewUrl,
- downloadUrl
- } = res.result
- this.setData({
- fileKey,
- viewUrl,
- downloadUrl
- })
- },
- async submit() {
- let {
- weighTime,
- carNum,
- receivingUnit,
- grossWeight,
- tare,
- netWeight,
- portId,
- voyageId,
- fileKey,
- viewUrl,
- downloadUrl
- } = this.data
- let postData = {
- loginAccountId: wx.getStorageSync('loginAccountId'),
- voyageId,
- portId,
- carNum,
- receivingUnit,
- grossWeight,
- tare,
- netWeight,
- weighTime: weighTime.replaceAll('-', '/') + " 00:00:00",
- fileKey,
- viewUrl,
- downloadUrl
- }
- let res = await postApi("/voyage/addCarLoadRecord", postData)
- wx.setStorageSync('addStatus', 'success')
- wx.navigateBack()
- },
- onLoad(options) {
- this.setData({
- voyageId: options.voyageId,
- portId: options.portId
- })
- },
- })
|