|
|
|
@ -1,7 +1,7 @@ |
|
|
|
// pages/storage/index/index.js
|
|
|
|
import Scene from '../../index/scene' |
|
|
|
import Dialog from '../../../components/dialog/dialog' |
|
|
|
import { getOutOrderInfo, getPaperList, receiptOutOrder, closeOutOrder, printOrder } from "../../../api/saas" |
|
|
|
import { getOutOrderInfo, getPaperList, receiptOutOrder, backupOutOrder, closeOutOrder, printOrder } from "../../../api/saas" |
|
|
|
const util = require('../../../utils/util') |
|
|
|
const event = require('../../../utils/event') |
|
|
|
const math = require('../../../utils/math') |
|
|
|
@ -202,7 +202,42 @@ Scene({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveForm: function(){ |
|
|
|
|
|
|
|
wx.showLoading({ title: '正在处理', mask: true }) |
|
|
|
var params = { id: this.data.orderInfo.id, categoryId: this.data.form.categoryId } |
|
|
|
params.otherFee = this.data.form.otherFee |
|
|
|
params.subsidy = this.data.form.subsidy |
|
|
|
params.proxyPaySurcharge = this.data.form.proxyPaySurcharge |
|
|
|
params.freight = this.data.form.freight |
|
|
|
params.deductPercent = this.data.form.deductPercent |
|
|
|
|
|
|
|
if(this.data.form.settleUnitPrice && Number(this.data.form.settleUnitPrice) > 0){ |
|
|
|
params.settleUnitPrice = math.divide(this.data.form.settleUnitPrice, 1000) |
|
|
|
} |
|
|
|
params.settlePrice = this.data.form.settlePrice |
|
|
|
if(this.data.form.netWeight && Number(this.data.form.netWeight) > 0){ |
|
|
|
params.netWeight = math.times(this.data.form.netWeight, 1000) |
|
|
|
} |
|
|
|
if(this.data.form.settleWeight && Number(this.data.form.settleWeight) > 0){ |
|
|
|
params.settleWeight = math.times(this.data.form.settleWeight, 1000) |
|
|
|
} |
|
|
|
var weightNoteImageUrls = [] |
|
|
|
for (let index = 0; index < this.data.fileList.length; index++) { |
|
|
|
const element = this.data.fileList[index] |
|
|
|
if(!util.isEmpty(element.url)){ |
|
|
|
weightNoteImageUrls.push(element.url) |
|
|
|
} |
|
|
|
} |
|
|
|
if(weightNoteImageUrls.length){ |
|
|
|
params.weightNoteImageUrls = weightNoteImageUrls |
|
|
|
} |
|
|
|
backupOutOrder(params).then(result => { |
|
|
|
wx.hideLoading() |
|
|
|
util.showBackToast('保存成功') |
|
|
|
event.emit('OrderMessage', { what: 21, desc: 'settlementForm' }) |
|
|
|
}).catch(err => { |
|
|
|
wx.hideLoading() |
|
|
|
util.showToast(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
settlementForm: function(){ |
|
|
|
if(util.isEmpty(this.data.form.categoryId) || Number(this.data.form.categoryId) <= 0){ |
|
|
|
|