| | |
| | | <!-- 底部操作按钮 --> |
| | | <view class="buttom"> |
| | | <button size="mini" @click="reset('warn')">重置</button> |
| | | <button size="mini" type="primary" @click="combConfirm('warn')">组托</button> |
| | | <button size="mini" type="primary" @click="combConfirm('warn')">入库</button> |
| | | </view> |
| | | <!-- 弹窗 --> |
| | | <!-- 修改数量 --> |
| | |
| | | <uni-popup-message :type="msgType1" :message="messageText" :duration="2000"></uni-popup-message> |
| | | </uni-popup> |
| | | </view> |
| | | <!-- 确认组托 --> |
| | | <!-- 确认入库 --> |
| | | <view> |
| | | <uni-popup ref="combConfirm" type="dialog"> |
| | | <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确认" :title="title" :content="content" |
| | |
| | | palletizingNo: '', |
| | | boxType: '', |
| | | createTime: '', |
| | | dataList: [ |
| | | // { |
| | | // matnr: '1', |
| | | // maktx: '2', |
| | | // boxNo: '3', |
| | | // position: '4', |
| | | // weight: '5', |
| | | // anfme: '6', |
| | | // batch: '7', |
| | | // specs: '8', |
| | | // } |
| | | ], |
| | | dataList: [], |
| | | count: 0, |
| | | rowNum: '', |
| | | matnr: '', |
| | |
| | | matFocus: false, |
| | | matData: '', |
| | | removeNum: 0, |
| | | checkFlag: true, |
| | | } |
| | | }, |
| | | onLoad() { |
| | |
| | | combConfirm(type) { |
| | | this.msgType = type |
| | | this.title = '警告' |
| | | this.content = '是否现在组托!' |
| | | this.content = '是否现在入库!' |
| | | this.$refs.combConfirm.open() |
| | | }, |
| | | combClose() { |
| | | this.$refs.combConfirm.close() |
| | | }, |
| | | comb() { |
| | | uni.vibrateShort(); |
| | | let that = this; |
| | | if (that.barcode === '') { |
| | | this.messageText = "请扫描托盘条码" |
| | | this.messageToggle('error') |
| | | return; |
| | | that.combCheck(that.palletizingNo,that.boxType,that.createTime); |
| | | if (that.checkFlag) { |
| | | return |
| | | } |
| | | if (that.dataList.length === 0) { |
| | | this.messageText = "请添加商品列表" |
| | | this.messageToggle('error') |
| | | return; |
| | | } |
| | | for (var i = 0; i < that.dataList.length; i++) { |
| | | if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') { |
| | | this.messageText = that.dataList[i].matnr + '组托数量不能为0' |
| | | this.messageToggle('error') |
| | | return; |
| | | } |
| | | } |
| | | console.log(that.dataList); |
| | | uni.request({ |
| | | url: that.baseUrl + '/mobile/comb/auth', |
| | | url: that.baseUrl + '/mobile/truss/comd/auth', |
| | | data: JSON.stringify({ |
| | | barcode: that.barcode, |
| | | combMats: that.dataList |
| | | palletizingNo: that.palletizingNo, |
| | | boxType: that.boxType, |
| | | createTime: that.createTime, |
| | | matLists: that.dataList |
| | | }), |
| | | method: 'POST', |
| | | header: { |
| | |
| | | var res = result.data |
| | | if (res.code === 200) { |
| | | that.resst(); |
| | | that.messageText = "组托成功" |
| | | that.messageText = "入库成功" |
| | | that.messageToggle('success') |
| | | const innerAudioContext = uni.createInnerAudioContext(); |
| | | innerAudioContext.src = '/static/music/pakinOk.mp3'; |
| | |
| | | } |
| | | }); |
| | | }, |
| | | // 提交校验 |
| | | combCheck(palletizingNo,boxType,createTime) { |
| | | if (this.barcode === '') { |
| | | this.messageText = "请添加托盘码" |
| | | this.messageToggle('error') |
| | | this.checkFlag = true; |
| | | return |
| | | } |
| | | if (palletizingNo === '') { |
| | | this.messageText = "请添加码垛位" |
| | | this.messageToggle('error') |
| | | this.checkFlag = true; |
| | | return |
| | | } |
| | | if (boxType === '') { |
| | | this.messageText = "请添加木箱类型" |
| | | this.messageToggle('error') |
| | | this.checkFlag = true; |
| | | return |
| | | } |
| | | if (createTime === '') { |
| | | this.messageText = "请添加创建时间" |
| | | this.messageToggle('error') |
| | | this.checkFlag = true; |
| | | return |
| | | } |
| | | if (this.dataList.length === 0) { |
| | | this.messageText = "请添加入库商品" |
| | | this.messageToggle('error') |
| | | this.checkFlag = true; |
| | | return |
| | | } |
| | | for (let i = 0; i < this.dataList.length; i++) { |
| | | if (this.dataList[i].anfme == 0 || this.dataList[i].anfme == '') { |
| | | this.messageText = this.dataList[i].matnr + '退库数量不能为0' |
| | | this.messageToggle('error') |
| | | this.checkFlag = true; |
| | | return |
| | | } |
| | | } |
| | | for (let i = 0; i < this.dataList.length; i++) { |
| | | if (this.dataList[i].anfme == 0 || this.dataList[i].anfme == '') { |
| | | this.messageText = this.dataList[i].matnr + '退库数量不能为0' |
| | | this.messageToggle('error') |
| | | this.checkFlag = true; |
| | | return |
| | | } |
| | | } |
| | | this.checkFlag = false; |
| | | }, |
| | | reset(type) { |
| | | this.msgType = type |
| | | this.title = '警告' |