diff --git a/pages/process/order-check/index.js b/pages/process/order-check/index.js index dc0e391..1d7db11 100644 --- a/pages/process/order-check/index.js +++ b/pages/process/order-check/index.js @@ -74,8 +74,14 @@ Scene({ onConfirm: function(e){ this.data.cIndex = e.currentTarget.dataset.index this.data.nowItem = this.data.paperList[this.data.cIndex] + if(this.data.form.productId == this.data.nowItem.id){ + this.onHide() + return + } this.data.form.productId = this.data.nowItem.id - this.data.form.unitPrice = this.data.nowItem.defaultUnitPrice + // this.data.form.unitPrice = this.data.nowItem.defaultUnitPrice + this.data.form.konePrice = '指导价格:' + this.data.nowItem.defaultUnitPrice + this.data.form.unitPrice = '' this.data.form.productName = this.data.nowItem.name this.statAmount() }, diff --git a/pages/process/order-check/index.wxml b/pages/process/order-check/index.wxml index d59c107..6c5536a 100644 --- a/pages/process/order-check/index.wxml +++ b/pages/process/order-check/index.wxml @@ -61,7 +61,7 @@ placeholder="请输入单价" value="{{form.unitPrice || ''}}" bindinput="bindInput" /> --> - + * 单价(元/公斤) @@ -111,8 +111,8 @@ - 金额: - {{amout}} + 金额: + {{amout || '- -'}} 通过审核 diff --git a/pages/process/order-list/index.wxml b/pages/process/order-list/index.wxml index ca0a949..d4a3175 100644 --- a/pages/process/order-list/index.wxml +++ b/pages/process/order-list/index.wxml @@ -68,7 +68,7 @@ bind:click="cancelOrder" wx:if="{{item.status != 6 && item.status != 41 && item.status != 42}}">取消订单 定价 - 重新定价 审核 diff --git a/pages/process/order-price/index.js b/pages/process/order-price/index.js index 961d232..fff9a51 100644 --- a/pages/process/order-price/index.js +++ b/pages/process/order-price/index.js @@ -92,10 +92,13 @@ Scene({ onConfirm: function(e){ this.data.cIndex = e.currentTarget.dataset.index this.data.nowItem = this.data.paperList[this.data.cIndex] + if(this.data.form.productId == this.data.nowItem.id){ + this.onHide() + return + } this.data.form.productId = this.data.nowItem.id var konePrice = '指导价格:' + this.data.nowItem.defaultUnitPrice - // this.setData({ visible: false, ['form.productName']: this.data.nowItem.name, ['form.unitPrice']: unitPrice, cIndex: this.data.cIndex }) - this.setData({ visible: false, ['form.productName']: this.data.nowItem.name, konePrice, cIndex: this.data.cIndex }) + this.setData({ visible: false, ['form.productName']: this.data.nowItem.name, ['form.unitPrice']: '', konePrice, cIndex: this.data.cIndex }) }, loop: function(){ return false diff --git a/pages/process/outside-add/index.js b/pages/process/outside-add/index.js index c2a5ad1..7469c83 100644 --- a/pages/process/outside-add/index.js +++ b/pages/process/outside-add/index.js @@ -110,14 +110,18 @@ Scene({ onCateConfirm: function(e){ this.data.cIndex = e.currentTarget.dataset.index var nowItem = this.data.paperList[this.data.cIndex] + if(nowItem.id == this.data.form.productCategoryInfos[this.data.cateIndex].productId){ + this.setData({ visible2: false }) + return + } for (var index = 0; index < this.data.form.productCategoryInfos.length; index++) { if (this.data.form.productCategoryInfos[index].productId == nowItem.id && this.data.cateIndex != index){ - this.setData({ visible: false }) - util.showToast('纸品已经存在,请不要重复添加') + util.showToast('纸品已经存在,请不要重复添加') return } } - var product = {productId: nowItem.id, productCategoryName: nowItem.name, unitPrice: nowItem.defaultUnitPrice} + var konePrice = '指导价格:' + nowItem.defaultUnitPrice + var product = {productId: nowItem.id, productCategoryName: nowItem.name, unitPrice: '', konePrice} product.highestUnitPrice = nowItem.highestUnitPrice product.lowestUnitPrice = nowItem.lowestUnitPrice this.setData({ visible2: false, ['form.productCategoryInfos[' + this.data.cateIndex + ']']: product }) diff --git a/pages/process/outside-add/index.wxml b/pages/process/outside-add/index.wxml index a23cad9..0cf6645 100644 --- a/pages/process/outside-add/index.wxml +++ b/pages/process/outside-add/index.wxml @@ -68,7 +68,7 @@ {{item.productCategoryName || '请选择品类'}} - + * 单价(元/公斤) diff --git a/pages/process/outside-check-item/index.js b/pages/process/outside-check-item/index.js index 9612987..174fb44 100644 --- a/pages/process/outside-check-item/index.js +++ b/pages/process/outside-check-item/index.js @@ -25,6 +25,10 @@ Component({ onConfirm: function(e){ this.data.cIndex = e.currentTarget.dataset.index var nowItem = this.data.list[this.data.cIndex] + if(this.data.item.productId == nowItem.id){ + this.onHide() + return + } for (var i = 0; i < this.data.form.productCategoryInfos.length; i++) { if (this.data.form.productCategoryInfos[i].productId == nowItem.id){ this.setData({ visible: false }) @@ -33,7 +37,8 @@ Component({ } } this.data.item.productId = nowItem.id - this.data.item.settleUnitPrice = nowItem.defaultUnitPrice + this.data.item.settleUnitPrice = '' + this.data.item.konePrice = '指导价格:' + nowItem.defaultUnitPrice this.data.item.highestUnitPrice = nowItem.highestUnitPrice this.data.item.lowestUnitPrice = nowItem.lowestUnitPrice this.data.item.productCategoryName = nowItem.name diff --git a/pages/process/outside-check-item/index.wxml b/pages/process/outside-check-item/index.wxml index 19e0e36..9fc00ae 100644 --- a/pages/process/outside-check-item/index.wxml +++ b/pages/process/outside-check-item/index.wxml @@ -19,7 +19,7 @@ maxlength="8" placeholder="请输入结算单价" value="{{item.settleUnitPrice || ''}}" bindinput="bindInput" /> --> - + * 结算单价(元/公斤) diff --git a/pages/storage/order-settlement/index.js b/pages/storage/order-settlement/index.js index ff2df8e..5c6122c 100644 --- a/pages/storage/order-settlement/index.js +++ b/pages/storage/order-settlement/index.js @@ -94,10 +94,19 @@ Scene({ onConfirm: function(e){ this.data.cIndex = e.currentTarget.dataset.index this.data.nowItem = this.data.paperList[this.data.cIndex] + if(this.data.form.categoryId == this.data.nowItem.id){ + this.setData({ visible: false }) + return + } this.data.form.categoryId = this.data.nowItem.id if(!util.isEmpty(this.data.nowItem.defaultUnitPrice) && Number(this.data.nowItem.defaultUnitPrice) > 0){ - var price = math.times(this.data.nowItem.defaultUnitPrice, 1000) - this.setData({ visible: false, ['form.categoryName']: this.data.nowItem.name, ['form.settleUnitPrice']: price, cIndex: this.data.cIndex }) + this.setData({ + visible: false, + ['form.categoryName']: this.data.nowItem.name, + ['form.settleUnitPrice']: '', + ['form.konePrice']: '指导价格:' + math.times(this.data.nowItem.defaultUnitPrice, 1000), + cIndex: this.data.cIndex + }) } else { this.setData({ visible: false, ['form.categoryName']: this.data.nowItem.name, cIndex: this.data.cIndex }) } @@ -159,6 +168,16 @@ Scene({ }) }) }, + printOrderInfo: function(){ + wx.showLoading({ title: '正在处理', mask: true }) + printOrder({id: this.data.orderInfo.id, printType: 3 }).then(result => { + wx.hideLoading() + util.showToast('即将打印,请稍后') + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) + }, settlementForm: function(){ if(util.isEmpty(this.data.form.categoryId) || Number(this.data.form.categoryId) <= 0){ util.showToast('请选择废纸品类') diff --git a/pages/storage/order-settlement/index.wxml b/pages/storage/order-settlement/index.wxml index 2952c84..84c1179 100644 --- a/pages/storage/order-settlement/index.wxml +++ b/pages/storage/order-settlement/index.wxml @@ -18,7 +18,7 @@ {{form.categoryName || '请选择废纸品类'}} - + * 结算单价(元/吨) @@ -148,6 +148,12 @@ + + + + + + 关闭订单