diff --git a/pages/process/order-check/index.js b/pages/process/order-check/index.js index 1ac8f26..57d73a7 100644 --- a/pages/process/order-check/index.js +++ b/pages/process/order-check/index.js @@ -62,7 +62,7 @@ Scene({ this.data.nowItem = this.data.paperList[this.data.cIndex] this.data.form.productId = this.data.nowItem.id this.data.form.unitPrice = this.data.nowItem.defaultUnitPrice - this.data.form.productName = detail.value + this.data.form.productName = this.data.nowItem.name this.statAmount() }, onHide: function(){ diff --git a/pages/process/order-price/index.js b/pages/process/order-price/index.js index b7ed9e2..c1f8717 100644 --- a/pages/process/order-price/index.js +++ b/pages/process/order-price/index.js @@ -69,7 +69,7 @@ Scene({ this.data.nowItem = this.data.paperList[this.data.cIndex] this.data.form.productId = this.data.nowItem.id var unitPrice = this.data.nowItem.defaultUnitPrice - this.setData({ visible: false, ['form.productName']: this.data.nowItem.categoryName, ['form.unitPrice']: unitPrice, cIndex: this.data.cIndex }) + this.setData({ visible: false, ['form.productName']: this.data.nowItem.name, ['form.unitPrice']: unitPrice, 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 23c53ca..6d7083a 100644 --- a/pages/process/outside-add/index.js +++ b/pages/process/outside-add/index.js @@ -117,7 +117,7 @@ Scene({ return } } - var product = {productId: nowItem.id, productCategoryName: nowItem.categoryName, unitPrice: nowItem.defaultUnitPrice} + var product = {productId: nowItem.id, productCategoryName: nowItem.name, unitPrice: nowItem.defaultUnitPrice} product.highestUnitPrice = nowItem.highestUnitPrice product.lowestUnitPrice = nowItem.lowestUnitPrice this.setData({ visible2: false, ['form.productCategoryInfos[' + this.data.cateIndex + ']']: product }) diff --git a/pages/process/outside-check-item/index.js b/pages/process/outside-check-item/index.js index 4bfcc24..d9de0b4 100644 --- a/pages/process/outside-check-item/index.js +++ b/pages/process/outside-check-item/index.js @@ -36,7 +36,7 @@ Component({ this.data.item.settleUnitPrice = nowItem.defaultUnitPrice this.data.item.highestUnitPrice = nowItem.highestUnitPrice this.data.item.lowestUnitPrice = nowItem.lowestUnitPrice - this.data.item.productCategoryName = nowItem.categoryName + this.data.item.productCategoryName = nowItem.name this.statAmount() wx.nextTick(() => { this.triggerEvent('change', {index: this.data.index, item: this.data.item }); diff --git a/pages/setting/paper-detial/index.js b/pages/setting/paper-detial/index.js index 5ec6556..134a103 100644 --- a/pages/setting/paper-detial/index.js +++ b/pages/setting/paper-detial/index.js @@ -50,8 +50,8 @@ Scene({ this.data.cIndex = e.currentTarget.dataset.index var nowItem = this.data.paperList[this.data.cIndex] this.data.form.categoryId = nowItem.categoryId - this.data.form.categoryName = nowItem.categoryName - this.setData({ visible: false, ['form.productName']: nowItem.categoryName, ['form.categoryName']: nowItem.categoryName, cIndex: this.data.cIndex }) + this.data.form.categoryName = nowItem.name + this.setData({ visible: false, ['form.productName']: nowItem.name, ['form.categoryName']: nowItem.categoryName, cIndex: this.data.cIndex }) }, onHide: function(){ this.setData({ visible: false }) diff --git a/pages/storage/order-create/index.js b/pages/storage/order-create/index.js index 8ea0fa9..3782c88 100644 --- a/pages/storage/order-create/index.js +++ b/pages/storage/order-create/index.js @@ -17,6 +17,7 @@ Scene({ activeNames: ['1'], paperList: [], visible: false, + cIndex: -1 }, /** * 生命周期函数--监听页面加载 @@ -109,8 +110,9 @@ Scene({ onHide: function() { this.setData({ visible: false }) }, - onConfirm: function({detail}){ - this.data.nowItem = this.data.paperList[detail.index] + onConfirm: function(e){ + this.data.cIndex = e.currentTarget.dataset.index + this.data.nowItem = this.data.paperList[this.data.cIndex] this.data.form.productId = this.data.nowItem.id var unitPrice = this.data.nowItem.defaultUnitPrice var amount = '' @@ -118,7 +120,9 @@ Scene({ this.data.form.unitPrice = math.times(unitPrice, 1000) amount = math.times(unitPrice, this.data.poundInfo.netWeight) } - this.setData({ visible: false, ['form.productName']: detail.value, ['form.unitPrice']: this.data.form.unitPrice, ['form.estimatedAmount']: amount }) + this.setData({ visible: false, + ['form.productName']: this.data.nowItem.name, + ['form.unitPrice']: this.data.form.unitPrice, ['form.estimatedAmount']: amount, cIndex: this.data.cIndex }) }, onChange: function({detail}) { this.setData({ activeNames: detail }) diff --git a/pages/storage/order-settlement/index.js b/pages/storage/order-settlement/index.js index 335cf39..863a0ad 100644 --- a/pages/storage/order-settlement/index.js +++ b/pages/storage/order-settlement/index.js @@ -96,9 +96,9 @@ Scene({ 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.categoryName, ['form.settleUnitPrice']: price, cIndex: this.data.cIndex }) + this.setData({ visible: false, ['form.categoryName']: this.data.nowItem.name, ['form.settleUnitPrice']: price, cIndex: this.data.cIndex }) } else { - this.setData({ visible: false, ['form.categoryName']: this.data.nowItem.categoryName, cIndex: this.data.cIndex }) + this.setData({ visible: false, ['form.categoryName']: this.data.nowItem.name, cIndex: this.data.cIndex }) } }, bindInput: function (e) {