|
|
|
@ -12,13 +12,15 @@ Scene({ |
|
|
|
* 页面的初始数据 |
|
|
|
*/ |
|
|
|
data: { |
|
|
|
height: app.globalData.fragmentHeight, |
|
|
|
id: null, |
|
|
|
form: null, |
|
|
|
param: { |
|
|
|
scrapPaperReceiptId: null, |
|
|
|
offsiteGrossWeight: null, |
|
|
|
offsiteTareWeight: null, |
|
|
|
} |
|
|
|
}, |
|
|
|
intoview: '' |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
@ -35,7 +37,8 @@ Scene({ |
|
|
|
wx.hideLoading() |
|
|
|
this.data.param.offsiteGrossWeight = result.data.offsiteGrossWeight |
|
|
|
this.data.param.offsiteTareWeight = result.data.offsiteTareWeight |
|
|
|
this.setData({ form: result.data, admin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0 }) |
|
|
|
var height = app.globalData.fragmentHeight - app.globalData.safeBottom - 120 |
|
|
|
this.setData({ form: result.data, admin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0, height }) |
|
|
|
}).catch(err => { |
|
|
|
wx.hideLoading() |
|
|
|
util.showToast(err) |
|
|
|
@ -109,22 +112,14 @@ Scene({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
submitForm: function(){ |
|
|
|
if(util.isEmpty(this.data.param.offsiteGrossWeight)){ |
|
|
|
util.showToast('请输入厂外毛重') |
|
|
|
return |
|
|
|
} |
|
|
|
if(util.isEmpty(this.data.param.offsiteTareWeight)){ |
|
|
|
util.showToast('请输入厂外皮重') |
|
|
|
return |
|
|
|
} |
|
|
|
var weightNoteList = [] |
|
|
|
for (let index = 0; index < this.data.form.productCategoryInfos.length; index++) { |
|
|
|
const element = this.data.form.productCategoryInfos[index] |
|
|
|
if(util.isEmpty(element.grossWeight)){ |
|
|
|
if(util.isEmpty(element.grossWeight) || Number(element.grossWeight) <= 0){ |
|
|
|
util.showToast('请输入第' + (index + 1) + '项废纸品类毛重') |
|
|
|
return |
|
|
|
} |
|
|
|
if(util.isEmpty(element.tareWeight)){ |
|
|
|
if(util.isEmpty(element.tareWeight) || Number(element.tareWeight) <= 0){ |
|
|
|
util.showToast('请输入第' + (index + 1) + '项废纸品类皮重') |
|
|
|
return |
|
|
|
} |
|
|
|
@ -140,6 +135,16 @@ Scene({ |
|
|
|
item.scrapPaperPurchaseOrderId = element.scrapPaperPurchaseOrderId |
|
|
|
weightNoteList.push(item) |
|
|
|
} |
|
|
|
if(util.isEmpty(this.data.param.offsiteTareWeight)){ |
|
|
|
this.setData({ intoview: 'offsiteTareWeight' }) |
|
|
|
util.showToast('请输入厂外皮重') |
|
|
|
return |
|
|
|
} |
|
|
|
if(util.isEmpty(this.data.param.offsiteGrossWeight)){ |
|
|
|
this.setData({ intoview: 'offsiteGrossWeight' }) |
|
|
|
util.showToast('请输入厂外毛重') |
|
|
|
return |
|
|
|
} |
|
|
|
this.data.param.scrapPaperReceiptId = this.data.form.scrapPaperReceiptId |
|
|
|
this.data.param.weightNoteList = weightNoteList |
|
|
|
wx.showLoading({ title: '处理中', mask: true }) |
|
|
|
|