From 5a5811e85ae92a93319fbd5b1fa7f6bdd3aac336 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 01 九月 2025 07:52:53 +0800
Subject: [PATCH] 添加 记录当前提交保存 单据 次数,单号,时间 请求函数

---
 pages/tiaomaguanli/table_son.vue |    2 
 pages/xiaoshouchuku/form.vue     |   93 ++++++++++++++++++++++---------
 pages/caigouruku/form.vue        |   74 ++++++++++++++++++------
 3 files changed, 122 insertions(+), 47 deletions(-)

diff --git a/pages/caigouruku/form.vue b/pages/caigouruku/form.vue
index 66ad2f1..3427434 100644
--- a/pages/caigouruku/form.vue
+++ b/pages/caigouruku/form.vue
@@ -274,6 +274,10 @@
 				HPageTitle: '閲囪喘鍏ュ簱鍗�',
 
 
+                materMeta: [
+                    
+                ],
+                
 				showHStockPlaceName: false,
 				showHMainSourceBillType: true,
 				showHSourceBillNo: true,
@@ -1077,6 +1081,7 @@
 									this.showHSupName = false
 									this.tabs = 2
 								} else { //鐗╂枡鏉$爜
+                                    this.materMeta.push(data)
 									this.tabs = 2
 									if (!this.hform.HSourceBillNo) {
 										this.hform.HSupName = data.hSupNameField
@@ -1156,6 +1161,7 @@
 						console.log('鐗╂枡', res.data)
 						if (res.data.count == 1) {
 							var data = res.data.data
+                            this.materMeta = data.BarCodeDetailslist
 							this.Materlist = data.Materlist
 							if (!data.BarCodeDetailslist[0].HBarCode) {
 								this.hform.HMaterName_B = ''
@@ -1389,27 +1395,39 @@
 							data: {
 								oMain: sMainStr
 							},
-							success: (res) => {
+							success: async (res) => {
 								console.log(1, res);
 								uni.hideLoading()
 								if (res.data.count == 1) {
-									uni.showModal({
-										title: '鎻愮ず',
-										content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
-										success: (res) => {
-											if (res.confirm) {
-												console.log('鐢ㄦ埛鐐瑰嚮纭畾');
-												uni.redirectTo({
-													url: '/pages/caigouruku/form?OperationType=1'
-												})
-											} else if (res.cancel) {
-												console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
-												setTimeout(() => {
-													uni.navigateBack();
-												}, 50)
-											}
-										}
-									});
+                                    let sMain = JSON.stringify(this.materMeta) + ';' + this.hform.HBillType + ';' + this.hform.HBillNo
+                                    try {
+                                        // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+                                        await this.Set_BarCodeBill(sMain)
+                                        uni.showModal({
+                                        	title: '鎻愮ず',
+                                        	content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+                                        	success: (res) => {
+                                        		if (res.confirm) {
+                                        			console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+                                        			uni.redirectTo({
+                                        				url: '/pages/caigouruku/form?OperationType=1'
+                                        			})
+                                        		} else if (res.cancel) {
+                                        			console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+                                        			setTimeout(() => {
+                                        				uni.navigateBack();
+                                        			}, 50)
+                                        		}
+                                        	}
+                                        });
+                                    }catch(err) {
+                                        uni.showToast({
+                                        	title: err,
+                                        	icon: 'none'
+                                        })
+                                    }
+                                    
+									
 								} else {
 									uni.showToast({
 										title: res.data.Message,
@@ -1432,7 +1450,25 @@
 			showBillList() {
 				this.$refs.billList.showPopup()
 			},
-
+            Set_BarCodeBill(sMain) {
+                return new Promise((resolve, reject) => {
+                    CommonUtils.doRequest2({
+                        method: 'POST',
+                        url: 'Sc_BarCode/Set_BarCodeBill',
+                        data: {
+                            msg: sMain
+                        },
+                        resFunction: (res) => {
+                            let {data, count, Message} = res.data
+                            if(count == 1) {
+                                resolve()
+                            }else {
+                                reject(Message)
+                            }
+                        }
+                    })
+                })
+            },
 			goBack() {
 				uni.showModal({
 					title: '鎻愮ず',
diff --git a/pages/tiaomaguanli/table_son.vue b/pages/tiaomaguanli/table_son.vue
index fb5c40a..27cd4c7 100644
--- a/pages/tiaomaguanli/table_son.vue
+++ b/pages/tiaomaguanli/table_son.vue
@@ -328,7 +328,7 @@
                 //鑾峰彇閫夋嫨鐨勬簮鍗曠被鍨�
                 var HSourceBillType = "鏀舵枡閫氱煡鍗�";
                 //鑾峰彇閫夋嫨鐨勬潯鐮佺被鍨�
-                var HSelectBarCodeType = "鍝佺鏉$爜";
+                var HSelectBarCodeType = "鍞竴鏉$爜";
                 //鑾峰彇褰撳墠鐧诲綍浜哄憳
                 var UserName = uni.getStorageSync('HUserName');
                 let listDataTemp = []
diff --git a/pages/xiaoshouchuku/form.vue b/pages/xiaoshouchuku/form.vue
index 8f7e5aa..f960aa4 100644
--- a/pages/xiaoshouchuku/form.vue
+++ b/pages/xiaoshouchuku/form.vue
@@ -285,10 +285,10 @@
                 <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
             </view>
         </view>
-        <PushSeOutStockBillPopupVue v-if="enableModule == 1" ref="billList" :HBillType="hform.HBillType" :HSourceBillType="hform.HMainSourceBillType"
-            :HStockOrgID="hform.HStockOrgID"></PushSeOutStockBillPopupVue>
-        <BillListPopupVue v-else-if="enableModule == 2" ref="billList" :HBillType="hform.HBillType" :HSourceBillType="hform.HMainSourceBillType"
-            :HStockOrgID="hform.HStockOrgID"></BillListPopupVue>
+        <PushSeOutStockBillPopupVue v-if="enableModule == 1" ref="billList" :HBillType="hform.HBillType"
+            :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID"></PushSeOutStockBillPopupVue>
+        <BillListPopupVue v-else-if="enableModule == 2" ref="billList" :HBillType="hform.HBillType"
+            :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID"></BillListPopupVue>
     </view>
 </template>
 <script>
@@ -301,6 +301,9 @@
     import {
         getUserStockRelation
     } from '../../utils/userRelationManager';
+    import {
+        CommonUtils
+    } from '../../utils/common';
     export default {
         data() {
             return {
@@ -318,6 +321,9 @@
                 showHSupName: true,
                 BarCodeFocus: false,
                 HSourceBillNoFocus: false,
+                materMeta: [
+
+                ],
 
                 tabs: 0,
                 HMainSourceBillType: '鍙戣揣閫氱煡鍗�',
@@ -394,14 +400,14 @@
         },
         computed: {
             enableModule: {
-                get(){
+                get() {
                     if (this.hform.HMainSourceBillType == 1402) {
                         return 1
                     } else {
                         return 2
                     }
                 }
-                
+
                 // 鍏朵粬鏉′欢
             },
         },
@@ -421,7 +427,7 @@
             this.getHSupList()
             this.getHEmpList()
             this.getHDeptList()
-            console.log('enableModule: ',this.enableModule);
+            console.log('enableModule: ', this.enableModule);
             this.getRelationStore()
 
             uni.$on('BillSelectComplete', (e) => {
@@ -434,7 +440,7 @@
             uni.$off('BillSelectComplete')
         },
         methods: {
-           
+
             async getRelationStore() {
                 let {
                     data,
@@ -1101,6 +1107,7 @@
                                     this.showHSupName = false
                                     this.tabs = 2
                                 } else { //鐗╂枡鏉$爜
+                                    this.materMeta.push(data)
                                     this.tabs = 2
                                     if (!this.hform.HSourceBillNo) {
                                         this.hform.HSupName = data.hSupNameField
@@ -1180,6 +1187,7 @@
                         console.log('鐗╂枡', res.data)
                         if (res.data.count == 1) {
                             var data = res.data.data
+                            this.materMeta = data.BarCodeDetailslist
                             this.Materlist = data.Materlist
                             if (data.FIFOlist.length != 0) {
                                 if (data.FIFOlist[0].HMaterID != 0) {
@@ -1410,33 +1418,42 @@
                             data: {
                                 oMain: sMainStr
                             },
-                            success: (res) => {
+                            success: async (res) => {
                                 console.log(1, res);
                                 uni.hideLoading()
                                 if (res.data.count == 1) {
-                                    uni.showModal({
-                                        title: '鎻愮ず',
-                                        content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
-                                        success: (res) => {
-                                            if (res.confirm) {
-                                                console.log('鐢ㄦ埛鐐瑰嚮纭畾');
-                                                uni.redirectTo({
-                                                    url: '/pages/xiaoshouchuku/form?OperationType=1'
-                                                })
-                                            } else if (res.cancel) {
-                                                console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
-                                                setTimeout(() => {
-                                                    uni.navigateBack();
-                                                }, 500)
+                                    let sMain = JSON.stringify(this.materMeta) + ';' + this.hform.HBillType + ';' + this.hform.HBillNo
+                                    try {
+                                        await this.Set_BarCodeBill(sMain)
+                                        uni.showModal({
+                                            title: '鎻愮ず',
+                                            content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+                                            success: (res) => {
+                                                if (res.confirm) {
+                                                    console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+                                                    uni.redirectTo({
+                                                        url: '/pages/xiaoshouchuku/form?OperationType=1'
+                                                    })
+                                                } else if (res.cancel) {
+                                                    console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+                                                    setTimeout(() => {
+                                                        uni.navigateBack();
+                                                    }, 50)
+                                                }
                                             }
-                                        }
-                                    });
+                                        });
+                                    } catch(e) {
+                                        uni.showToast({
+                                            title: e,
+                                            icon: 'none'
+                                        })
+                                    }
                                 } else {
                                     uni.showToast({
                                         title: res.data.Message,
                                         icon: 'none'
                                     })
-                                }
+                                } 
                             },
                             fail: (res) => {
                                 console.log(res);
@@ -1449,7 +1466,29 @@
                     }
                 }
             },
-
+            Set_BarCodeBill(sMain) {
+                return new Promise((resolve, reject) => {
+                    CommonUtils.doRequest2({
+                        method: 'POST',
+                        url: 'Sc_BarCode/Set_BarCodeBill',
+                        data: {
+                            msg: sMain
+                        },
+                        resFunction: (res) => {
+                            let {
+                                data,
+                                count,
+                                Message
+                            } = res.data
+                            if (count == 1) {
+                                resolve()
+                            } else {
+                                reject(Message)
+                            }
+                        }
+                    })
+                })
+            },
             goBack() {
                 uni.showModal({
                     title: '鎻愮ず',

--
Gitblit v1.9.1