From 648a174a2a7df6a5d52e956b310e42e814178bd5 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期四, 28 八月 2025 10:27:00 +0800
Subject: [PATCH] 修改 收料通知单条码新增,添加缺失字段

---
 pages/tiaomaguanli/table_son.vue    |   65 ++++++++++++++++++++++----------
 pages/shouliaotongzhi/table_son.vue |   13 ++++++
 pages/index/index.vue               |   16 ++++---
 3 files changed, 65 insertions(+), 29 deletions(-)

diff --git a/pages/index/index.vue b/pages/index/index.vue
index d5ac64a..b8f6752 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -49,13 +49,15 @@
                 menuListName: 'index',
                 canEdit: false,
                 serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
-                itemData: [{
-                    img: '../../static/icon/icon8.png',
-                    text: '鏉$爜绠$悊-鏀舵枡閫氱煡鍗�',
-                    url: '/pages/tiaomaguanli/table?HBillType=1103',
-                    id: 1,
-                    hidden: false,
-                }, {
+                itemData: [
+                //     {
+                //     img: '../../static/icon/icon8.png',
+                //     text: '鏉$爜绠$悊-鏀舵枡閫氱煡鍗�',
+                //     url: '/pages/tiaomaguanli/table?HBillType=1103',
+                //     id: 1,
+                //     hidden: false,
+                // },
+                {
                     img: '../../static/icon/icon8.png',
                     text: '閲囪喘璁㈠崟鏍囩',
                     url: '/pages/caigoudingdan/caigoudingdan',
diff --git a/pages/shouliaotongzhi/table_son.vue b/pages/shouliaotongzhi/table_son.vue
index d59c264..0d136ff 100644
--- a/pages/shouliaotongzhi/table_son.vue
+++ b/pages/shouliaotongzhi/table_son.vue
@@ -50,6 +50,12 @@
 					<input v-model="baseInfo.HBQty" disabled />
 				</view>
 			</view>
+            <view class="form-item">
+            	<view class="title">娆惧彿:</view>
+            	<view class="righton">
+            		<input v-model="baseInfo.HCoilNO" disabled />
+            	</view>
+            </view>
 			<view class="buttons">
 				<button class="btn-b" size="mini" type="default" @tap="getList()">鏉$爜鐢熸垚</button>
 				<!-- <button class="btn-c" size="mini" type="default" @tap="searchLabelPrinter()">鎼滅储鎵撳嵃鏈�</button> -->
@@ -72,6 +78,9 @@
 					<view class="detail">
 						<text>鏁伴噺锛�</text>{{item.鏁伴噺}}
 					</view>
+                    <view class="detail">
+                    	<text>娆惧彿锛�</text>{{item.娆惧彿}}
+                    </view>
 					<view class="detail" style="width: 100%;">
 						<text>鏉$爜缂栧彿锛�</text>{{item.鏉$爜缂栧彿}}
 					</view>
@@ -171,6 +180,7 @@
 					HSupNumber: '',
 					HSupName: '',
 					HUnitID: '',
+                    HBillType: '',
 					HPcsName: '',
 					HSupNameShort: '',
 					HMTONo: '',
@@ -235,10 +245,11 @@
 						if (res.data.count == 1) {
 							var data = res.data.data
 							this.baseInfo = Object.assign(this.baseInfo, {
-								HMainID: data[0].linterid,
+								HMainID: data[0].hmainid,
 								HSubID: data[0].hsubid,
 								HBillNo: data[0].鍗曟嵁鍙�,
 								HSourceBillNo: data[0].鍗曟嵁鍙�,
+                                HBillType: data[0]['HBillType'],
 								HInnerBillNo: data[0].閲囪喘璁㈠崟鍙�,
 								HMaterID: data[0].HMaterID,
 								HMaterNumber: data[0].鐗╂枡浠g爜,
diff --git a/pages/tiaomaguanli/table_son.vue b/pages/tiaomaguanli/table_son.vue
index 5b785f6..0bacbc3 100644
--- a/pages/tiaomaguanli/table_son.vue
+++ b/pages/tiaomaguanli/table_son.vue
@@ -39,15 +39,15 @@
             </view>
             <view class="form-item">
                 <view class="title">姣忕鏁伴噺:</view>
-                <view class="right">
-                    <input v-model="baseInfo.HMinQty" type="number" placeholder="璇疯緭鍏ユ暟閲�" @confirm="getNum()"
+                <view class="righton">
+                    <input disabled v-model="baseInfo.HMinQty" type="number" placeholder="璇疯緭鍏ユ暟閲�" @confirm="getNum()"
                         @blur="getNum()" />
                 </view>
             </view>
             <view class="form-item">
                 <view class="title">绠辨暟:</view>
-                <view class="righton">
-                    <input v-model="baseInfo.HBQty" disabled />
+                <view class="right">
+                    <input v-model="baseInfo.HBQty" @blur="getHMinQtyByBQty()" />
                 </view>
             </view>
             <view class="buttons">
@@ -62,7 +62,7 @@
         <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
 
         <view class="list" v-for="(item,index) in listData" :key="index">
-            <uni-card :title="item.鐗╂枡浠g爜" :extra="'No. ' + Number(index+1)" style="margin: 10px;">
+            <uni-card :title="item.鐗╂枡浠g爜 || item.HMaterNumber" :extra="'No. ' + Number(index+1)" style="margin: 10px;">
                 <view class="card-detail">
                     <view class="detail">
                         <text>鐗╂枡鍚嶇О锛�</text>{{item.HMaterName || item['鐗╂枡鍚嶇О']}}
@@ -240,7 +240,7 @@
                         if (res.data.count == 1) {
                             var data = res.data.data
                             this.baseInfo = Object.assign(this.baseInfo, {
-                                HMainID: data[0].linterid,
+                                HMainID: data[0].hmainid,
                                 HSubID: data[0].hsubid,
                                 HBillNo: data[0].鍗曟嵁鍙�,
                                 HSourceBillNo: data[0].鍗曟嵁鍙�,
@@ -271,6 +271,7 @@
                             this.baseInfo.HBQty = Math.ceil(this.baseInfo.HQty / this.baseInfo.HMinQty)
 
                             this.listData = data
+                            
                         } else {
                             uni.showToast({
                                 title: res.data.Message,
@@ -291,6 +292,20 @@
                 if (this.baseInfo.HMinQty && this.baseInfo.HMinQty > 0) {
                     var a = Number(this.baseInfo.HQty) / Number(this.baseInfo.HMinQty)
                     this.baseInfo.HBQty = Math.ceil(Number(this.baseInfo.HQty) / Number(this.baseInfo.HMinQty))
+                    this.$forceUpdate()
+                } else {
+                    uni.showToast({
+                        title: '璇疯緭鍏ュぇ浜�0鐨勫悎鐞嗘暟閲�',
+                        icon: "none"
+                    })
+                }
+            },
+            getHMinQtyByBQty() {
+                if (this.baseInfo.HBQty && this.baseInfo.HBQty > 0) {
+                    let minQty = Math.ceil(this.baseInfo.HQty / this.baseInfo.HBQty)
+                    
+                  
+                    this.baseInfo.HMinQty = minQty
                     this.$forceUpdate()
                 } else {
                     uni.showToast({
@@ -321,12 +336,12 @@
                     if (receiveQty - this.baseInfo.HMinQty >= 0) {
                         listDataTemp.push(Object.assign(baseInfoClone, {
                             HQty: this.baseInfo.HMinQty,
-                            HInterID: this.receiveQty,
+                            HInterID: receiveQty + 1,
                         }))
                     } else {
                         listDataTemp.push(Object.assign(baseInfoClone, {
                             HQty: receiveQty % this.baseInfo.HMinQty,
-                            HInterID: this.receiveQty,
+                            HInterID: receiveQty + 1,
                         }))
                     }
                     barCodeNo =
@@ -339,12 +354,13 @@
                 }
 
                 this.listData = listDataTemp
+                console.log(listDataTemp)
                 HBarCodeNoStrs = JSON.stringify(HBarCodeNoStrs)
                 sMain = listDataTemp
                 let sMainStr = JSON.stringify(listDataTemp)
-                let sMainSub = sMainStr + ';' + HOrgType + ';' + HSourceBillType + ';' + HSelectBarCodeType + ';' +
-                    CampanyName + ';' + UserName + ';' + HBarCodeNoStrs + ';' + this.baseInfo.HFactory + ';' + this
-                    .baseInfo.HCoilNO + ';' + this.baseInfo.HFurnaceNO + '';
+                let sMainSub = `${sMainStr};${HOrgType};${HSourceBillType};${HSelectBarCodeType};${CampanyName};${UserName};${HBarCodeNoStrs};${this.baseInfo.HFactory || ''};${this
+                    .baseInfo.HCoilNO || ''}; ${this.baseInfo.HFurnaceNO || ''}` 
+                console.log('sMainSub: ',sMainSub);
                 uni.showLoading()
                 uni.request({
                     url: this.serverUrl + '/Sc_BarCode/SaveBarCode_NoGenerate_Batch',
@@ -355,12 +371,18 @@
                     },
                     success: (res) => {
                         if (res.data.count == 1) {
-                            this.codeGenComplete = true
-                            console.log(this.listData)
-                            uni.showToast({
-                                title: res.data.Message,
-                                icon: 'none'
-                            })
+                            if(res.data.code == 2) {
+                                // 鏁版嵁宸插瓨鍦ㄧ殑鎯呭喌
+                                console.log(res.data.data)
+                                console.log(listDataTemp)
+                            }else {
+                                this.codeGenComplete = true
+                                console.log(this.listData)
+                                uni.showToast({
+                                    title: res.data.Message,
+                                    icon: 'none'
+                                })
+                            }
                         } else {
                             uni.showToast({
                                 title: res.data.Message,
@@ -461,7 +483,7 @@
                         // T 55 0 440 370 (Spec. accepted) 
                         // FORM
                         // PRINT`)
-                        let Message = await this.getPrintTemplate()
+                        let Message = await this.getPrintTemplate(listOne.HMainID)
                         printContent.push(Message)
                         count++;
                         if (count == 10) {
@@ -480,7 +502,7 @@
                     })
                 }
             },
-            async getPrintTemplate() {
+            async getPrintTemplate(HInterID) {
                 return new Promise((resolve, reject) => {
                     CommonUtils.doRequest2({
                         url: "/Sc_BarCode/Get_BarCodePrintCode_CPCL",
@@ -489,7 +511,8 @@
                             HBillInterID: this.linterid,
                             HBillEntryID: this.HEntryID,
                             HViewName: 'h_v_IF_POInStockBillList',
-                            HBillSubType: '1203'
+                            HBillSubType: '1203',
+                            HInterID: HInterID
                         },
                         resFunction: (res) => {
                             let {
@@ -509,7 +532,7 @@
                         errFunction: (err) => {
                             reject();
                         },
-                       
+
                     })
                 })
             },

--
Gitblit v1.9.1