| | |
| | | const submitData = pickList.map(item => { |
| | | return { |
| | | frozen: item.frozen, |
| | | frozenLoc: item.frozen, |
| | | matnr: item.matnr, // 物料编号 |
| | | maktx: item.maktx, |
| | | batch: item.batch, // 批号 |
| | |
| | | } |
| | | }) |
| | | |
| | | console.log('准备出库的物料:', submitData) |
| | | |
| | | this.outboundRequest(submitData) |
| | | |
| | | }, |
| | | // 直接调用出库接口的方法 |
| | | outboundRequest(submitData) { |
| | | console.info(submitData) |
| | | uni.showLoading({ title: '出库中...', mask: true }) |
| | | |
| | | uni.request({ |
| | | url: this.baseUrl + '/out/pakout/auth', // 替换成你的出库接口地址 |
| | | url: this.baseUrl + '/out/pakout/auth', // |
| | | method: 'POST', |
| | | header: { |
| | | 'Content-Type': 'application/json', |
| | | 'token': this.token |
| | | }, |
| | | data: { |
| | | list: submitData // 选中的物料列表 |
| | | }, |
| | | data: submitData, // 选中的物料列表 |
| | | |
| | | success(res) { |
| | | let result = res.data |
| | | if (typeof result === 'string') { |
| | |
| | | </view> |
| | | </view> |
| | | <view class="info-row"> |
| | | <view class="info-label">工单号:</view> |
| | | <view class="info-value"> |
| | | <text class="tag tag-primary">{{item.standby1 || '-'}}</text> |
| | | </view> |
| | | </view> |
| | | <view class="info-row"> |
| | | <view class="info-label">批号:</view> |
| | | <view class="info-value"> |
| | | <text class="tag tag-warning">{{item.batch || '-'}}</text> |
| | |
| | | </view> |
| | | </view> |
| | | <view class="popup-item"> |
| | | <view class="popup-item-left">重量:</view> |
| | | <view class="popup-item-left">工单号:</view> |
| | | <view class="popup-item-right"> |
| | | <input type="text" v-model="weight" class="popup-input" placeholder="请输入重量"> |
| | | <input type="text" v-model="standby1" class="popup-input" placeholder="请输入工单号"> |
| | | </view> |
| | | </view> |
| | | <view class="popup-item"> |
| | | <view class="popup-item-left">批号:</view> |
| | | <view class="popup-item-right"> |
| | | <input type="text" v-model="batch" class="popup-input" placeholder="请输入批号"> |
| | | </view> |
| | | </view> |
| | | <view class="popup-item"> |
| | |
| | | msgType1: 'success', |
| | | msgType: 'success', |
| | | messageText: '', |
| | | standby1: '', |
| | | title: '', |
| | | content: '', |
| | | barcodeFocus: true, |
| | |
| | | }, |
| | | resetClose() {}, |
| | | revise(item, i) { |
| | | this.standby1 = this.dataList[i].standby1 || '' //添加工单号赋值 |
| | | this.matnr1 = this.dataList[i].matnr |
| | | this.count = this.dataList[i].anfme |
| | | this.batch = this.dataList[i].batch |
| | | this.batch = this.dataList[i].batch |
| | | this.weight = this.dataList[i].weight |
| | | this.maxCount = this.dataList[i].maxCount |
| | | this.maxCount = this.dataList[i].maxCount|| this.dataList[i].anfme || 0 // 添加默认值 |
| | | this.rowNum = i |
| | | this.eject() |
| | | }, |
| | |
| | | this.dataList.splice(this.removeNum, 1) |
| | | }, |
| | | reviseConfirm() { |
| | | this.dataList[this.rowNum].anfme = this.count |
| | | this.dataList[this.rowNum].batch = this.batch |
| | | this.dataList[this.rowNum].weight = this.weight |
| | | uni.showToast({ title:"修改成功", icon: "success", position: 'center' }) |
| | | this.$refs.revise.close() |
| | | this.$forceUpdate() |
| | | // 再次校验数量是否超过最大值 |
| | | if (this.count > this.maxCount) { |
| | | uni.showToast({ |
| | | title: `数量不能超过最大值 ${this.maxCount}`, |
| | | icon: "none", |
| | | position: 'center' |
| | | }) |
| | | // 恢复成最大值 |
| | | this.count = this.maxCount |
| | | return // 阻止保存 |
| | | } |
| | | |
| | | // 校验数量是否小于1 |
| | | if (this.count < 1) { |
| | | uni.showToast({ |
| | | title: "数量至少为 1", |
| | | icon: "none", |
| | | position: 'center' |
| | | }) |
| | | this.count = 1 |
| | | return // 阻止保存 |
| | | } |
| | | |
| | | // 校验通过,保存数据 |
| | | this.dataList[this.rowNum].standby1 = this.standby1 |
| | | this.dataList[this.rowNum].anfme = this.count |
| | | this.dataList[this.rowNum].batch = this.batch |
| | | this.dataList[this.rowNum].weight = this.weight |
| | | uni.showToast({ title:"修改成功", icon: "success", position: 'center' }) |
| | | this.$refs.revise.close() |
| | | this.$forceUpdate() |
| | | }, |
| | | reviseClose() { |
| | | this.$refs.revise.close() |
| | | }, |
| | | changeValue(value) { |
| | | this.count = value |
| | | // 限制数量不能超过 maxCount |
| | | if (value > this.maxCount) { |
| | | uni.showToast({ |
| | | title: `数量不能超过最大值 ${this.maxCount}`, |
| | | icon: "none", |
| | | position: 'center' |
| | | }) |
| | | this.count = this.maxCount |
| | | // 将值设置为最大值 |
| | | return |
| | | } |
| | | // 限制数量不能小于 1 |
| | | if (value < 1) { |
| | | uni.showToast({ |
| | | title: "数量至少为 1", |
| | | icon: "none", |
| | | position: 'center' |
| | | }) |
| | | this.count = 1 |
| | | return |
| | | } |
| | | this.count = value |
| | | }, |
| | | resst() { |
| | | this.dataList = [] |
| | |
| | | </view> |
| | | </view> |
| | | <view class="info-row"> |
| | | <view class="info-label">工单号:</view> |
| | | <view class="info-value"> |
| | | <text class="tag tag-primary">{{orderDetl.standby1 || '-'}}</text> |
| | | </view> |
| | | </view> |
| | | <view class="info-row"> |
| | | <view class="info-label">批号:</view> |
| | | <view class="info-value"> |
| | | <text class="tag tag-warning">{{orderDetl.batch || '-'}}</text> |
| | |
| | | |
| | | <!-- 底部操作按钮 --> |
| | | <view class="bottom-bar"> |
| | | <button class="btn-submit" size="default" type="primary" @click="reset()"> |
| | | <text>重置</text> |
| | | </button> |
| | | <button class="btn-submit" size="default" type="primary" @click="addItems()"> |
| | | <uni-icons type="checkmarkempty" size="18" color="#ffffff"></uni-icons> |
| | | <text>提取选中物料</text> |
| | |
| | | }, |
| | | methods: { |
| | | onFilterInput() { |
| | | let that = this |
| | | // 方法1:分割成数组 |
| | | let arr = that.filterMatnr.split('|') |
| | | // 方法2:遍历每一段 |
| | | arr.forEach((item, index) => { |
| | | switch(index){ |
| | | case 2: that.filterMatnr = item |
| | | break; |
| | | } |
| | | }) |
| | | this.applyFilter() |
| | | }, |
| | | |
| | |
| | | addItem(mat) { |
| | | this.getOpenerEventChannel().emit('sMat', {data: mat}); |
| | | uni.navigateBack({}) |
| | | }, |
| | | reset(){ |
| | | this.filterMatnr = '' |
| | | this.orderNo = '' |
| | | this.dataList = [] |
| | | this.filteredList = [] |
| | | } |
| | | }, |
| | | |
| | |
| | | |
| | | /* 底部按钮栏 */ |
| | | .bottom-bar { |
| | | display: flex; |
| | | flex-direction: row; |
| | | position: fixed; |
| | | bottom: 0; |
| | | left: 0; |