ocr保存将数据返回上一级

This commit is contained in:
hongchao 2025-06-05 10:52:03 +08:00
parent 1e0cce13db
commit 6265c1c0e8
1 changed files with 56 additions and 36 deletions

View File

@ -53,9 +53,12 @@
</uni-forms> </uni-forms>
</scroll-view> </scroll-view>
</view> </view>
<view class="outbound-btn" @tap="onHandleOutbound"> <view class="outbound-btn" @tap="onHandleSave">
<text style="color: #FFF;">出库</text> <text style="color: #FFF;">保存</text>
</view> </view>
<!-- <view class="outbound-btn" @tap="onHandleOutbound">
<text style="color: #FFF;">出库</text>
</view> -->
</view> </view>
</template> </template>
@ -269,49 +272,66 @@
// console.log(res) // console.log(res)
// this.codeData=res.rows[0]; // this.codeData=res.rows[0];
}, },
//出库按钮
async onHandleOutbound(){ //保存按钮
async onHandleSave(){
let maCodeList = [] let maCodeList = []
maCodeList.push({ maCodeList.push({
maId: this.codeData.maId, maId: this.codeData.maId,
maCode: this.codeData.maCode, maCode: this.codeData.maCode,
}) })
let paramsList = [] let params = {
paramsList.push({
leaseType: 0,
maCode: this.codeData.maCode, maCode: this.codeData.maCode,
maId: this.codeData.maId, maId: this.codeData.maId,
manageType:0,
outNum:1,
typeId:this.codeData.typeId, typeId:this.codeData.typeId,
parentId: this.queryParams.parentId,
maCodeList,
isApp: 0,
isNew: this.queryParams.isNew,
outType: 4,
})
console.log('333333333', paramsList)
uni.request({
url: '/material/lease_apply_info/leaseOut',
method: 'post',
data: { leaseOutDetailsList: paramsList },
success: res => {
res = res.data;
console.log(res)
if (res.code === 200) {
uni.showToast({
title: '出库成功!',
icon: 'none',
})
this.queryCodeParams.maCode = ''
this.codeData = {}
} }
}, uni.$emit('paramsReceived', params);
fail: err => { // 返回上一个页面
console.log(err) uni.navigateBack();
}
})
} }
//出库按钮
// async onHandleOutbound(){
// let maCodeList = []
// maCodeList.push({
// maId: this.codeData.maId,
// maCode: this.codeData.maCode,
// })
// let paramsList = []
// paramsList.push({
// leaseType: 0,
// maCode: this.codeData.maCode,
// maId: this.codeData.maId,
// manageType:0,
// outNum:1,
// typeId:this.codeData.typeId,
// parentId: this.queryParams.parentId,
// maCodeList,
// isApp: 0,
// isNew: this.queryParams.isNew,
// outType: 4,
// })
// console.log('333333333', paramsList)
// uni.request({
// url: '/material/lease_apply_info/leaseOut',
// method: 'post',
// data: { leaseOutDetailsList: paramsList },
// success: res => {
// res = res.data;
// console.log(res)
// if (res.code === 200) {
// uni.showToast({
// title: '出库成功!',
// icon: 'none',
// })
// this.queryCodeParams.maCode = ''
// this.codeData = {}
// }
// },
// fail: err => {
// console.log(err)
// }
// })
// }
} }
} }
</script> </script>