From f20a697d4d3b666b2754b6d7057205f3d98503b7 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 26 一月 2026 09:30:09 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

---
 pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill.vue |  242 +++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 195 insertions(+), 47 deletions(-)

diff --git a/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill.vue b/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill.vue
index 6fe1e66..6145ffa 100644
--- a/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill.vue
+++ b/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill.vue
@@ -12,6 +12,8 @@
                 height: containerHeight + 'px',
                 overflow: 'auto'
             }">
+
+				<!-- 鍘熷唴瀹逛繚鎸佷笉鍙� -->
                 <view class="form-item">
                     <view class="title">鍣ㄥ叿鏉$爜:</view>
                     <view :class="enableEdit?'right':'righton'">
@@ -38,46 +40,54 @@
                         </uni-datetime-picker>
                     </view>
                 </view>
+				<!-- 鏂板婧愬崟绫诲瀷鍜屾晠闅滅櫥璁板崟閫夋嫨 -->
                 <view class="form-item">
-                    <view class="title">鍗曟嵁鍙�:</view>
-                    <view class="righton">
-                        <input disabled v-model="hform.HBillNo" />
+					<view class="title">婧愬崟绫诲瀷</view>
+					<view class="right" v-show="showHMainSourceBillType">
+						<picker :range="arrayHMainSourceBillType" @change="HMainSourceBillTypeChange">
+
+							<input disabled name="HMainSourceBillType" v-model="HMainSourceBillType"
+								placeholder="璇烽�夋嫨婧愬崟绫诲瀷" />
+							<view class="picker-overlay"></view>
+						</picker>
+                    </view>
+					<view class="righton" v-show="!showHMainSourceBillType">
+						<input name="HMainSourceBillType" disabled v-model="HMainSourceBillType"
+							placeholder="璇烽�夋嫨婧愬崟绫诲瀷" />
+                </view>
+				</view>
+                <view class="form-item">
+					<view class="title required">鏁呴殰鐧昏鍗�</view>
+					<view class="right" v-show="hform.HMainSourceBillType != 1">
+						<input type="text" name="HBarCode" v-model="hform.HMainSourceBillNo" />
+                    </view>
+					<view class="icon-wrapper" v-show="hform.HMainSourceBillType != 1"
+						:disabled="hform.HMainSourceBillType == -1">
+						<uni-icons type="search" size="20" @click="showBillList"></uni-icons>
+                </view>
+					<view class="righton" v-show="hform.HMainSourceBillType == 1">
+						<input type="text" disabled name="HBarCode" v-model="hform.HMainSourceBillNo" />
+                </view>
+				</view>
+                <view class="form-item">
+					<view class="title">鍗曟嵁鍙�:</view>
+					<view class="righton">
+						<input disabled v-model="hform.HBillNo" />
                     </view>
                 </view>
                 <view class="form-item">
-                    <view class="title">鍗曟嵁鏃ユ湡:</view>
-                    <view class="righton">
-                        <input disabled v-model="hform.HDate" />
+					<view class="title">鍗曟嵁鏃ユ湡:</view>
+					<view class="righton">
+						<input disabled v-model="hform.HDate" />
                     </view>
                 </view>
-                <view class="form-item">
-                    <view class="title">鏃堕棿鍗曚綅:</view>
-                    <zxz-uni-data-select class="right" :localdata="[
-                        {key: '灏忔椂', value: '灏忔椂'},
-                        {key: '澶�', value: '澶�'},
-                        {key: '鏈�', value: '鏈�'},
-                    ]" dataKey="key" dataValue="value" v-model="hform.HCycleUnit">
-                    </zxz-uni-data-select>
-                </view>
-                <view class="form-item">
-                    <view class="title required">璁″垝缁翠慨宸ユ椂:</view>
-                    <view class="right">
-                        <input type="number" v-model="hform.HPlanTimes" />
-                    </view>
-                </view>
-                <view class="form-item">
-                    <view class="title required">瀹為檯缁翠慨宸ユ椂:</view>
-                    <view class="right">
-                        <input type="number" v-model="hform.HTimes" />
-                    </view>
-                </view>
+
                 <view class="form-item">
                     <view class="title required">缁翠慨閮ㄩ棬:</view>
                     <zxz-uni-data-select required class="right" :localdata="HDeptList" dataKey="閮ㄩ棬鍚嶇О"
                         dataValue="HItemID" v-model="hform.HDeptID">
 
                     </zxz-uni-data-select>
-                    <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
                 </view>
                 <view class="form-item">
                     <view class="title required">缁翠慨浜�:</view>
@@ -85,7 +95,6 @@
                         dataValue="HItemID" v-model="hform.HEmpID">
 
                     </zxz-uni-data-select>
-                    <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
                 </view>
                 <view class="form-item">
                     <view class="title required">缁翠慨椤圭洰:</view>
@@ -93,7 +102,6 @@
                         dataValue="hitemid" v-model="hform.HRepairID">
 
                     </zxz-uni-data-select>
-                    <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
                 </view>
                 <view class="form-item">
                     <view class="title required">涓荤:</view>
@@ -101,7 +109,6 @@
                         dataValue="HItemID" v-model="hform.HManagerID">
 
                     </zxz-uni-data-select>
-                    <!-- <input disabled v-model="hform.HDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" /> -->
                 </view>
                 <view class="form-item">
                     <view class="title">鍣ㄥ叿鍚嶇О:</view>
@@ -130,6 +137,27 @@
                 overflow: 'auto'
             }">
                 <view class="form-item">
+					<view class="title">鏃堕棿鍗曚綅:</view>
+					<zxz-uni-data-select class="right" :localdata="[
+               			        {key: '灏忔椂', value: '灏忔椂'},
+               			        {key: '澶�', value: '澶�'},
+               			        {key: '鏈�', value: '鏈�'},
+               			    ]" dataKey="key" dataValue="value" v-model="hform.HCycleUnit">
+					</zxz-uni-data-select>
+				</view>
+				<view class="form-item">
+					<view class="title">璁″垝缁翠慨宸ユ椂:</view>
+					<view class="right">
+						<input type="number" v-model="hform.HPlanTimes" />
+					</view>
+				</view>
+				<view class="form-item">
+					<view class="title">瀹為檯缁翠慨宸ユ椂:</view>
+					<view class="right">
+						<input type="number" v-model="hform.HTimes" />
+					</view>
+				</view>
+				<view class="form-item">
                     <view class="title">渚涘簲鍟�:</view>
                     <view class="right">
                         <input v-model="hform.HSupID" placeholder="" />
@@ -242,8 +270,8 @@
                     </view>
                 </view>
             </view>
+		</template>
 
-        </template>
         <!-- 鎿嶄綔鎸夐挳 -->
         <view class="buttons" id="buttons">
             <button class="btn-a" size="mini" @tap="submit">鎻愪氦</button>
@@ -251,6 +279,11 @@
             <button class="btn-a" size="mini" @tap="addNew">鏂板</button>
             <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
         </view>
+
+		<!-- 鏂板寮圭獥缁勪欢 -->
+		<BillListPopupMouldConkBookBillVue ref="billList" :HBillType="hform.HBillType"
+			:HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID">
+		</BillListPopupMouldConkBookBillVue>
     </view>
 </template>
 
@@ -265,13 +298,22 @@
     import {
         getUserInfo
     } from "../../../utils/auth";
+	// 鏂板寮曞叆缁勪欢
+	import BillListPopupMouldConkBookBillVue from '../../../components/BillListPopup/BillListPopupMouldConkBookBill.vue';
+
     export default {
         // 鍣ㄥ叿缁翠慨娲惧伐鍗�
         name: 'Sc_MouldRepairSendWorkBill',
+		components: {
+			BillListPopupMouldConkBookBillVue,
+		},
         data() {
             return {
                 tabs: 0,
-                HMainSourceBillType: "",
+				HMainSourceBillType: '妯″叿鏁呴殰鐧昏鍗�', // 鏂板
+				showHMainSourceBillType: true, // 鏂板
+				arrayHMainSourceBillType: ['妯″叿鏁呴殰鐧昏鍗�'], // 鏂板
+				arrayHMainSourceBillTypeID: ['3815'], // 鏂板
                 btnTop: 0,
                 tabsBottom: 0,
                 HModName: "Sc_MouldRepairSendWorkBill",
@@ -305,13 +347,13 @@
                     "HManagerName": getUserInfo().HSecManager,
                     "HManagerID": getUserInfo().HSecManagerID,
                     "HRepairBeginDate": dayjs(new Date()).format('YYYY-MM-DD'),
-                    "HMainSourceBillType": "",
-                    "HMainSourceInterID": "0",
-                    "HMainSourceEntryID": "0",
+					"HMainSourceBillType": 3815, // 鏂板锛氶粯璁ゆā鍏锋晠闅滅櫥璁板崟
+					"HMainSourceInterID": "0", // 鏂板
+					"HMainSourceEntryID": "0", // 鏂板
                     "HPlanTimes": "0",
                     "HTimes": "0",
                     "HRepairEndDate": dayjs(new Date()).format('YYYY-MM-DD'),
-                    "HMainSourceBillNo": "",
+					"HMainSourceBillNo": "", // 鏂板
                     "HSupIDName": "",
                     "HSupID": "0",
                     "HRepairType": "鍐呴儴缁翠慨",
@@ -336,6 +378,7 @@
                     HMouldName: "",
                     HMouldSpec: "",
                     HMouldModel: "",
+					"HStockOrgID": uni.getStorageSync("OrganizationID") || "0" // 鏂板
                 },
                 HDetailList: [{ // 鍚庣鎺ュ彛鎻愪氦闇�瑕� 鏄庣粏淇℃伅
                     "瀛愮淮淇」鐩�": "",
@@ -358,6 +401,43 @@
             },
         },
         methods: {
+			// 鏂板锛氶�夋嫨婧愬崟绫诲瀷
+			HMainSourceBillTypeChange(e) {
+				if (e.detail.value == -1 || e.detail.value == NaN) {
+					this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+					this.hform.HMainSourceBillType = -1
+					return
+				}
+				console.log(e.detail.value)
+				console.log(e)
+				this.HMainSourceBillType = this.arrayHMainSourceBillType[e.detail.value]
+				this.hform.HMainSourceBillType = this.arrayHMainSourceBillTypeID[e.detail.value]
+
+				// 缂撳瓨褰撳墠椤甸潰閫夋嫨
+				const pages = getCurrentPages()
+				const currentPage = pages[pages.length - 1]
+				uni.setStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`, {
+					HSourceBillTypeName: this.HMainSourceBillType,
+					HSourceBillType: this.hform.HMainSourceBillType
+				})
+			},
+
+			// 鏂板锛氭樉绀哄崟鎹垪琛ㄥ脊绐�
+			showBillList() {
+				this.$refs.billList.showPopup()
+			},
+
+			// 鏂板锛氳鍙栫紦瀛�
+			loadCache() {
+				const pages = getCurrentPages()
+				const currentPage = pages[pages.length - 1]
+				let HBillTypeCache = uni.getStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`)
+				if (HBillTypeCache) {
+					this.HMainSourceBillType = HBillTypeCache.HSourceBillTypeName
+					this.hform.HMainSourceBillType = HBillTypeCache.HSourceBillType
+				}
+			},
+
             // 缁翠慨椤圭洰
             async getRepairList() {
                 try {
@@ -395,6 +475,14 @@
             },
             // 鎻愪氦鏁版嵁鏈夋晥鎬ф牎楠�
             ValidCheck() {
+				// 鏂板锛氭鏌ユ晠闅滅櫥璁板崟
+				if (this.hform.HMainSourceBillType != 1 && !this.hform.HMainSourceBillNo) {
+					return {
+						Message: "鏁呴殰鐧昏鍗曚笉寰椾负绌�!",
+						state: false
+					}
+				}
+
                 if (this.hform.HMouldID == 0) {
                     return {
                         Message: "鏈綍鍏ュ櫒鍏蜂俊鎭紝璇峰厛褰曞叆鍣ㄥ叿淇℃伅!",
@@ -409,19 +497,19 @@
                 }
                 if (this.hform.HEmpID == 0) {
                     return {
-                        Message: "楠屾敹浜轰笉寰椾负绌�!",
+						Message: "缁翠慨浜轰笉寰椾负绌�!",
                         state: false
                     }
                 }
-                if (this.hform.HRepairCheckMainID == 0) {
+				if (this.hform.HRepairID == 0) {
                     return {
-                        Message: "楠岃瘉椤圭洰涓嶅緱涓虹┖!",
+						Message: "缁翠慨椤圭洰涓嶅緱涓虹┖!",
                         state: false
                     }
                 }
                 if (this.hform.HManagerID == 0) {
                     return {
-                        Message: "璐熻矗浜轰笉寰椾负绌�!",
+						Message: "涓荤涓嶅緱涓虹┖!",
                         state: false
                     }
                 }
@@ -437,7 +525,6 @@
                         state: false
                     }
                 }
-
 
                 return {
                     Message: "",
@@ -555,7 +642,7 @@
             },
             toScanCode() {
                 MpaasScan.scanCode(cb => {
-                    this.hform.HBarCode = cb
+                    // this.hform.HBarCode = cb
                     this.GetMessageByBarCode(cb)
                 })
             },
@@ -567,7 +654,6 @@
                             HBarCode: HBarCode,
                         },
                     })
-
 
                     if (!res) {
                         return
@@ -732,7 +818,7 @@
                                 if (res.confirm) {
                                     console.log('鐢ㄦ埛鐐瑰嚮纭畾');
                                     uni.redirectTo({
-                                        url: './Sb_EquipRepairSendWorkBill?operationType=1'
+										// url: './Sc_MouldRepairSendWorkBill?operationType=1'
                                     })
                                 } else if (res.cancel) {
                                     console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
@@ -748,7 +834,6 @@
                             message: "鎻愪氦鍗曟嵁澶辫触: " + Message
                         })
                     }
-
 
                 } catch (err) {
                     CommonUtils.showTips({
@@ -783,7 +868,28 @@
             this.getEmpList()
             this.getCheckProjList()
             this.getRepairList()
+			this.loadCache() // 鏂板锛氬姞杞界紦瀛�
+
+			// 鏂板锛氱洃鍚崟鎹�夋嫨瀹屾垚浜嬩欢
+			uni.$on('BillSelectComplete', (e) => {
+				console.log("鎺ユ敹鍒扮殑娑堟伅: ", e)
+				this.hform.HMainSourceInterID = e.HInterID
+				this.hform.HMainSourceBillNo = e.HBillNo
+				this.hform.HMainSourceEntryID = e.HEntryID
+				this.hform.HMouldID = e.HMouldID
+				this.hform.HMouldName = e.HMouldName
+				this.hform.HMouldSpec = e.HMouldSpec
+				this.hform.HMouldModel = e.HMouldModel
+				// 濡傛灉閫夋嫨鍗曟嵁鏃跺甫浜嗘潯鐮侊紝涔熻缃潯鐮�
+				if (e.HBarCode) {
+					this.hform.HBarCode = e.HBarCode
+				}
+				this.$refs.billList.exit()
+			})
         },
+		onUnload() {
+			uni.$off('BillSelectComplete') // 鏂板锛氱Щ闄や簨浠剁洃鍚�
+		},
         onReady() {
             const query = uni.createSelectorQuery().in(this)
             query.select("#buttons")
@@ -799,5 +905,47 @@
 </script>
 
 <style lang="scss" scoped>
-    @import "@/pages/MJGL/style/MJBillStyle.scss"
+	// @import "@/pages/MJGL/style/MJBillStyle.scss";
+
+	.picker-overlay {
+		position: absolute;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		z-index: 1;
+	}
+
+	.icon-wrapper {
+		background-color: #3A78FF;
+		width: 52rpx;
+		height: 52rpx;
+		border-radius: 100%;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+
+		.uni-icons {
+			color: #fff !important;
+		}
+	}
+
+	.icon-wrapper[disabled] {
+		background-color: rgba(228, 228, 228, 1);
+		pointer-events: none;
+		touch-action: none;
+	}
+
+	.required {
+		position: relative;
+	}
+
+	.required::after {
+		content: "*";
+		position: relative;
+		color: red;
+		left: 0;
+		top: 0;
+		font-size: inherit;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1