| | |
| | | |
| | | <!-- 弹窗 --> |
| | | <!-- 修改数量 --> |
| | | <uni-popup ref="revise" background-color="#fff" @change="change"> |
| | | |
| | | <uni-popup ref="revise" background-color="#fff"> |
| | | <view class="revise-box"> |
| | | <view class="revise-box-top"> |
| | | <view class="color-block-blue"></view> |
| | |
| | | </view> |
| | | <view class="changeBox"> |
| | | <view class="num-box"> |
| | | <uni-number-box v-model="counts" :min="0" :max="99999" color="#747474" /> |
| | | <uni-number-box :value="count" :max="999999999" color="#747474" @change="changeValue" /> |
| | | </view> |
| | | </view> |
| | | <view class="revise-box-buttom"> |
| | |
| | | matList:[], |
| | | result: '', |
| | | enableQty:'', |
| | | count:'', |
| | | counts:'', |
| | | minCount:0, |
| | | maxCount:'', |
| | |
| | | }, |
| | | remove(item,index) { |
| | | this.matList.splice(index,1) |
| | | |
| | | // for (var i = 0; i < this.matList.length; i++) { |
| | | // if (this.matList[i].checked == true) { |
| | | // this.matList.splice(i,1) |
| | | // } |
| | | // } |
| | | this.checkList(); |
| | | uni.vibrateShort(); |
| | | }, |
| | |
| | | }, |
| | | success: function(res) { |
| | | // 通过eventChannel向被打开页面传送数据 向另外一个页面传递值的 |
| | | res.eventChannel.emit('acceptDataFromOpenerPage', {baseIP:that.baseIP, basePORT:that.basePORT }) |
| | | res.eventChannel.emit('matData', {baseIP:that.baseIP, basePORT:that.basePORT }) |
| | | }, |
| | | |
| | | }); |
| | |
| | | events: { |
| | | // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 |
| | | matList: function(data) { |
| | | that.matList.push(data.data) |
| | | that.checkMat(data.data) |
| | | // that.matList.push(data.data) |
| | | }, |
| | | }, |
| | | success: function(res) { |
| | |
| | | }); |
| | | |
| | | }, |
| | | |
| | | // 添加商品 |
| | | addMat(mat) { |
| | | this.matList.unshift(mat) |
| | | }, |
| | | checkMat(mat) { |
| | | var len = this.matList.length |
| | | var add = true |
| | | for (var i = 0; i < len; i++) { |
| | | if (mat.matNo === this.matList[i].matNo) { |
| | | this.matList[i].count += mat.count |
| | | this.$forceUpdate() // 强制刷新 |
| | | add = false |
| | | } |
| | | } |
| | | if (add) { |
| | | this.matList.unshift(mat) |
| | | } |
| | | }, |
| | | change(e) { |
| | | console.log('当前模式:' + e.type + ',状态:' + e.show); |
| | | }, |
| | |
| | | this.$refs.goodsSearch.open(type) |
| | | }, |
| | | checkbox: function (e) { |
| | | var items = this.matList, |
| | | values = e.detail.value; |
| | | for (var i = 0, lenI = items.length; i < lenI; ++i) { |
| | | const item = items[i] |
| | | item.id = item.id + '' |
| | | if(values.indexOf(item.id) >= 0){ |
| | | this.$set(item,'checked',true) |
| | | }else{ |
| | | this.$set(item,'checked',false) |
| | | } |
| | | } |
| | | if (values.length == items.length) { |
| | | this.check = true |
| | | this.checkText = "取消全选" |
| | | } else { |
| | | this.check = false |
| | | this.checkText = "全选" |
| | | } |
| | | uni.vibrateShort(); |
| | | // var items = this.matList, |
| | | // values = e.detail.value; |
| | | // for (var i = 0, lenI = items.length; i < lenI; ++i) { |
| | | // const item = items[i] |
| | | // item.id = item.id + '' |
| | | // if(values.indexOf(item.id) >= 0){ |
| | | // this.$set(item,'checked',true) |
| | | // }else{ |
| | | // this.$set(item,'checked',false) |
| | | // } |
| | | // } |
| | | // if (values.length == items.length) { |
| | | // this.check = true |
| | | // this.checkText = "取消全选" |
| | | // } else { |
| | | // this.check = false |
| | | // this.checkText = "全选" |
| | | // } |
| | | // uni.vibrateShort(); |
| | | }, |
| | | revise(index) { |
| | | |
| | | this.rowNum = index |
| | | |
| | | this.count = this.matList[this.rowNum].count |
| | | this.$refs.revise.open() |
| | | |
| | | |
| | | // this.matList[this.rowNum].count = this.count |
| | | // this.eject() |
| | | // var maxCount = this.item.maxCount |
| | | // if (maxCount == undefined ) { |
| | | // this.matList[index]["maxCount"] = item.enableQty |
| | | // } |
| | | // this.enableQty = item.enableQty |
| | | // this.count = this.minCount |
| | | // this.maxCount = item.maxCount |
| | | |
| | | }, |
| | | changeCount(e) { |
| | | |
| | | }, |
| | | eject() { |
| | | // this.type = type |
| | | // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性 |
| | | this.$refs.revise.open() |
| | | changeValue(value) { |
| | | this.count = value |
| | | }, |
| | | |
| | | // 确认组托数量 |
| | | confirm() { |
| | | this.matList[this.rowNum].count = this.counts |
| | | this.matList = this.matList |
| | | console.log(this.counts) |
| | | console.log(this.matList[this.rowNum].count) |
| | | this.matList[this.rowNum].count = this.count |
| | | this.$refs.revise.close() |
| | | this.$forceUpdate() // 强制刷新 |
| | | }, |
| | | // 列表反选 |
| | | reChecked() { |