|
|
@ -12,20 +12,23 @@ Scene({ |
|
|
* 页面的初始数据 |
|
|
* 页面的初始数据 |
|
|
*/ |
|
|
*/ |
|
|
data: { |
|
|
data: { |
|
|
|
|
|
height: app.globalData.fragmentHeight, |
|
|
safeBottom: app.globalData.safeBottom, |
|
|
safeBottom: app.globalData.safeBottom, |
|
|
paperList: [], |
|
|
paperList: [], |
|
|
form: null |
|
|
|
|
|
|
|
|
form: null, |
|
|
|
|
|
intoview: '' |
|
|
}, |
|
|
}, |
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面加载 |
|
|
* 生命周期函数--监听页面加载 |
|
|
*/ |
|
|
*/ |
|
|
onLoad: function (options) { |
|
|
onLoad: function (options) { |
|
|
if(options.id){ |
|
|
if(options.id){ |
|
|
|
|
|
var height = app.globalData.fragmentHeight - app.globalData.safeBottom - 120 |
|
|
wx.showLoading({ title: '正在获取', mask: true }) |
|
|
wx.showLoading({ title: '正在获取', mask: true }) |
|
|
getPaperList({pageNum: 1, pageSize: 100}).then(result => { |
|
|
getPaperList({pageNum: 1, pageSize: 100}).then(result => { |
|
|
this.setData({ safeBottom: app.globalData.safeBottom, paperList: result.data.records }) |
|
|
|
|
|
|
|
|
this.setData({ safeBottom: app.globalData.safeBottom, paperList: result.data.records, height }) |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
this.setData({ safeBottom: app.globalData.safeBottom }) |
|
|
|
|
|
|
|
|
this.setData({ safeBottom: app.globalData.safeBottom, height }) |
|
|
util.showToast(err) |
|
|
util.showToast(err) |
|
|
}) |
|
|
}) |
|
|
getSideOrderInfo({ id: options.id }).then(result => { |
|
|
getSideOrderInfo({ id: options.id }).then(result => { |
|
|
@ -79,11 +82,11 @@ Scene({ |
|
|
const element = this.data.form.productCategoryInfos[index] |
|
|
const element = this.data.form.productCategoryInfos[index] |
|
|
if(util.isEmpty(element.settleUnitPrice) || Number(element.settleUnitPrice) <= 0){ |
|
|
if(util.isEmpty(element.settleUnitPrice) || Number(element.settleUnitPrice) <= 0){ |
|
|
util.showToast('请输入第' + (index + 1) + '项废纸品类结算单价') |
|
|
util.showToast('请输入第' + (index + 1) + '项废纸品类结算单价') |
|
|
|
|
|
this.setData({ intoview: 'item' + index }) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if(!util.isEmpty(this.data.form.scrapPaperReceiptId)){ |
|
|
if(!util.isEmpty(this.data.form.scrapPaperReceiptId)){ |
|
|
var cate = this.findCateById(element.productId) |
|
|
var cate = this.findCateById(element.productId) |
|
|
console.log(cate) |
|
|
|
|
|
if(cate){ |
|
|
if(cate){ |
|
|
element.highestUnitPrice = cate.highestUnitPrice |
|
|
element.highestUnitPrice = cate.highestUnitPrice |
|
|
element.lowestUnitPrice = cate.lowestUnitPrice |
|
|
element.lowestUnitPrice = cate.lowestUnitPrice |
|
|
@ -91,10 +94,12 @@ Scene({ |
|
|
} |
|
|
} |
|
|
if(element.highestUnitPrice && Number(element.settleUnitPrice) > Number(element.highestUnitPrice)){ |
|
|
if(element.highestUnitPrice && Number(element.settleUnitPrice) > Number(element.highestUnitPrice)){ |
|
|
util.showToast('第' + (index + 1) + '项废纸品类单价不得高于:' + element.highestUnitPrice + '元/公斤') |
|
|
util.showToast('第' + (index + 1) + '项废纸品类单价不得高于:' + element.highestUnitPrice + '元/公斤') |
|
|
|
|
|
this.setData({ intoview: 'item' + index }) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if(element.lowestUnitPrice && Number(element.settleUnitPrice) < Number(element.lowestUnitPrice)){ |
|
|
if(element.lowestUnitPrice && Number(element.settleUnitPrice) < Number(element.lowestUnitPrice)){ |
|
|
util.showToast('第' + (index + 1) + '项废纸品类单价不得低于:' + element.lowestUnitPrice + '元/公斤') |
|
|
util.showToast('第' + (index + 1) + '项废纸品类单价不得低于:' + element.lowestUnitPrice + '元/公斤') |
|
|
|
|
|
this.setData({ intoview: 'item' + index }) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
var item = { productId: element.productId, scrapPaperPurchaseOrderId: element.scrapPaperPurchaseOrderId } |
|
|
var item = { productId: element.productId, scrapPaperPurchaseOrderId: element.scrapPaperPurchaseOrderId } |
|
|
|