From 1de1ac13f61905480b81735c33030ee9e33c9f61 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 15 十二月 2025 12:58:24 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev

---
 manifest.json                                |    8 
 pages/MJGL/shangmudan/MouldUpperBillList.vue |    8 
 pages/MJGL/shangmudan/MouldUpperBill.vue     | 1239 ++++++++++++++++++++++++++++++++++++++-----------------
 pages/index/login.vue                        |   13 
 .hbuilderx/launch.json                       |    4 
 pages/tiaomachaima/tiaomachaima2.vue         |    2 
 pages/index/index.vue                        |    7 
 7 files changed, 887 insertions(+), 394 deletions(-)

diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json
index a7d9080..4dd14cd 100644
--- a/.hbuilderx/launch.json
+++ b/.hbuilderx/launch.json
@@ -21,11 +21,11 @@
             "type" : "uni-app:app-ios"
         },
         {
-            "customPlaygroundType" : "local",
+            "customPlaygroundType" : "device",
             "localRepoPath" : "D:/WorkBench/ZY_APP_Dev/STUWMS/unpackage/debug",
             "openVueDevtools" : true,
             "packageName" : "com.shebeiguanli.www",
-            "playground" : "custom",
+            "playground" : "standard",
             "type" : "uni-app:app-android"
         }
     ]
diff --git a/manifest.json b/manifest.json
index 7ba04c6..7485217 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,10 @@
     "name" : "鏅轰簯LMES",
     "appid" : "__UNI__B002F49",
     "description" : "",
+
     "versionName" : "2.0.35",
     "versionCode" : 235,
+
     "transformPx" : false,
     /* 5+App鐗规湁鐩稿叧 */
     "app-plus" : {
@@ -61,6 +63,7 @@
             },
             "icons" : {
                 "android" : {
+
                     "hdpi" : "unpackage/res/icons/72x72.png",
                     "xhdpi" : "unpackage/res/icons/96x96.png",
                     "xxhdpi" : "unpackage/res/icons/144x144.png",
@@ -69,17 +72,21 @@
                 "ios" : {
                     "appstore" : "unpackage/res/icons/1024x1024.png",
                     "ipad" : {
+
                         "app" : "unpackage/res/icons/76x76.png",
                         "app@2x" : "unpackage/res/icons/152x152.png",
                         "notification" : "unpackage/res/icons/20x20.png",
                         "notification@2x" : "unpackage/res/icons/40x40.png",
+
                         "proapp@2x" : "unpackage/res/icons/167x167.png",
                         "settings" : "unpackage/res/icons/29x29.png",
                         "settings@2x" : "unpackage/res/icons/58x58.png",
+
                         "spotlight" : "unpackage/res/icons/40x40.png",
                         "spotlight@2x" : "unpackage/res/icons/80x80.png"
                     },
                     "iphone" : {
+
                         "app@2x" : "unpackage/res/icons/120x120.png",
                         "app@3x" : "unpackage/res/icons/180x180.png",
                         "notification@2x" : "unpackage/res/icons/40x40.png",
@@ -162,6 +169,7 @@
         "landscape-secondary",
         //鑷劧鏂瑰悜
         "default"
+
     ],
     "locale" : "zh-Hans"
 }
diff --git a/pages/MJGL/shangmudan/MouldUpperBill.vue b/pages/MJGL/shangmudan/MouldUpperBill.vue
index 70a01c7..53591d2 100644
--- a/pages/MJGL/shangmudan/MouldUpperBill.vue
+++ b/pages/MJGL/shangmudan/MouldUpperBill.vue
@@ -4,144 +4,140 @@
 			<view class="form-item">
 				<view class="title">鏉$爜</view>
 				<view class="right" style="width: 350rpx;">
-					<input v-model="hform.HBarCode" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜" @confirm="getCode(hform.HBarCode)" @blur="getCode(hform.HBarCode)"/>
+					<input type="text" :focus="HBarCodeFocus" v-model="hform.HBarCode" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
+						@confirm="getHBarCodeData(hform.HBarCode)" />
 				</view>
 				<uni-icons type="scan"
 					style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
 					size="20" @click="toScanCode"></uni-icons>
 			</view>
-			<view class="form-item">
-				<view class="title">鍗曟嵁鍙�:</view>
-				<view class="righton">
-					<input name="HBillNo" disabled v-model="hform.HBillNo" />
-				</view>
+			<view class="tabs">
+				<view :class="tabs == 0 ? 'on':''" @tap="() => { tabs = 0; reFocusBarCode(); }">鍗曟嵁淇℃伅</view>
+				<view :class="tabs == 1 ? 'on':''" @tap="() => { tabs = 1; reFocusBarCode(); }">妯″叿淇℃伅</view>
 			</view>
-			<view class="form-item">
-				<view class="title">鍗曟嵁鏃ユ湡:</view>
-				<view class="right">
-					<picker mode="date" v-model="hform.HDate" @change="HDateChange">
-						<input disabled v-model="hform.HDate" placeholder="璇烽�夋嫨鏃ユ湡" />
-					</picker>
+
+			<!-- 鍗曟嵁淇℃伅 -->
+			<view v-if="tabs == 0">
+				<view class="form-item">
+					<view class="title">鍗曟嵁鍙�:</view>
+					<view class="righton">
+						<input name="HBillNo" disabled v-model="hform.HBillNo" />
+					</view>
 				</view>
-			</view>
-			<view class="form-item">
-				<view class="title"><text>*</text>浣跨敤閮ㄩ棬:</view>
-				<view class="right">
-					<uni-combox :candidates="arrayHDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" v-model="hform.HDeptName" @input="HDeptNameChange"></uni-combox>
+				<view class="form-item">
+					<view class="title">鍗曟嵁鏃ユ湡:</view>
+					<view class="right">
+						<picker mode="date" v-model="hform.HDate" @change="HDateChange">
+							<input disabled v-model="hform.HDate" placeholder="璇烽�夋嫨鏃ユ湡" />
+						</picker>
+					</view>
 				</view>
-			</view>
-			<view class="form-item">
-				<view class="title"><text>*</text>鎿嶄綔鍛�:</view>
-				<view class="right">
-					<uni-combox :candidates="arrayHEmpName" placeholder="璇烽�夋嫨鎿嶄綔鍛�" v-model="hform.HEmpName" @input="HEmpNameChange"></uni-combox>
+				<view class="form-item">
+					<view class="title"><text>*</text>浣跨敤閮ㄩ棬:</view>
+					<view class="right">
+						<uni-combox :candidates="arrayHDeptName" placeholder="璇烽�夋嫨閮ㄩ棬" v-model="hform.HDeptName"
+							@input="HDeptNameChange"></uni-combox>
+					</view>
 				</view>
-			</view>
-			<view class="form-item">
-				<view class="title"><text>*</text>璐熻矗浜�:</view>
-				<view class="right">
-					<uni-combox :candidates="arrayHEmpName" placeholder="璇烽�夋嫨璐熻矗浜�" v-model="hform.HMangerName" @input="HManagerNameChange"></uni-combox>
+				<view class="form-item">
+					<view class="title"><text>*</text>鎿嶄綔鍛�:</view>
+					<view class="right">
+						<uni-combox :candidates="arrayHEmpName" placeholder="璇烽�夋嫨鎿嶄綔鍛�" v-model="hform.HEmpName"
+							@input="HEmpNameChange"></uni-combox>
+					</view>
 				</view>
-			</view>
-			<view class="form-item">
-				<view class="title">鐢熶骇璧勬簮:</view>
-				<view class="right">
-					<uni-combox :candidates="arrayHSourceName" placeholder="璇烽�夋嫨鐢熶骇璧勬簮" v-model="hform.HSourceName" @input="HSourceNameChange"></uni-combox>
+				<view class="form-item">
+					<view class="title"><text>*</text>璐熻矗浜�:</view>
+					<view class="right">
+						<uni-combox :candidates="arrayHEmpName" placeholder="璇烽�夋嫨璐熻矗浜�" v-model="hform.HMangerName"
+							@input="HManagerNameChange"></uni-combox>
+					</view>
 				</view>
-			</view>
-			<view class="form-item">
-				<view class="title">鍣ㄥ叿缂栫爜:</view>
-				<view class="righton">
-					<input name="HMouldNumber" v-model="hform.HMouldNumber" disabled placeholder="璇疯緭鍏ュ櫒鍏风紪鐮�" />
+				<view class="form-item">
+					<view class="title">鐢熶骇璧勬簮:</view>
+					<view class="right">
+						<uni-combox :candidates="arrayHSourceName" placeholder="璇烽�夋嫨鐢熶骇璧勬簮" v-model="hform.HSourceName"
+							@input="HSourceNameChange"></uni-combox>
+					</view>
 				</view>
-			</view>
-			<view class="form-item">
-				<view class="title">鍣ㄥ叿鍚嶇О:</view>
-				<view class="righton">
-					<input name="HMouldName" v-model="hform.HMouldName" disabled placeholder="璇疯緭鍏ュ櫒鍏峰悕绉�" />
+				<view class="form-item">
+					<view class="title">涓婃ā鏃堕棿:</view>
+					<view class="righton">
+						<input name="HScanDate" disabled v-model="hform.HScanDate" placeholder="璇烽�夋嫨" />
+					</view>
 				</view>
-			</view>
-			<view class="form-item">
-				<view class="title">鍣ㄥ叿鍨嬪彿:</view>
-				<view class="righton">
-					<input name="HMouldModel" v-model="hform.HMouldModel" disabled placeholder="璇疯緭鍏ュ櫒鍏峰瀷鍙�" />
+				<view class="form-item">
+					<view class="title">鐢熶骇璁㈠崟:</view>
+					<view class="righton">
+						<input name="HICMOBillNo" disabled v-model="hform.HICMOBillNo" />
+					</view>
 				</view>
-			</view>
-			<view class="form-item">
-				<view class="title">鏁伴噺:</view>
-				<view class="righton">
-					<input name="HQty" v-model="hform.HQty" disabled placeholder="璇疯緭鍏ユ暟閲�" />
+				<view class="form-item">
+					<view class="title">娴佽浆鍗�:</view>
+					<view class="righton">
+						<input disabled v-model="hform.HProcExchBillNo" />
+					</view>
 				</view>
-			</view>
-			<view class="form-item">
-				<view class="title">涓婃ā鏃堕棿:</view>
-				<view class="righton">
-					<input name="HScanDate" disabled v-model="hform.HScanDate" placeholder="璇烽�夋嫨" />
+
+				<view class="form-item">
+					<view class="title">澶囨敞:</view>
+					<view class="right">
+						<textarea name="HRemark" v-model="hform.HRemark" auto-height placeholder="璇疯緭鍏ュ娉�"></textarea>
+					</view>
 				</view>
+
 			</view>
-			
-			<view class="form-item">
-				<view class="title">鐢熶骇璁㈠崟:</view>
-				<view class="righton">
-					<input name="HICMOBillNo" disabled v-model="hform.HICMOBillNo" />
-				</view>
+			<!-- 妯″叿淇℃伅 -->
+			<view v-if="tabs == 1">
+				<zb-table id="list-table" :checked-highlight="true" :fit="true"
+					:style="{height: `${listTableHeight}px`}" :columns="columns" :data="listData" :show-header="true"
+					:border="true" :row-key="row => row.index" @toggleRowSelection="handleSelect"
+					@toggleAllSelection="handleSelectAll" @rowClick="onTableRowClickHandler" />
 			</view>
-			<view class="form-item">
-				<view class="title">娴佽浆鍗�:</view>
-				<view class="righton">
-					<input disabled v-model="hform.HProcExchBillNo" />
-				</view>
-			</view>
-		
-			<view class="form-item">
-				<view class="title">澶囨敞:</view>
-				<view class="right">
-					<textarea name="HRemark" v-model="hform.HRemark" auto-height placeholder="璇疯緭鍏ュ娉�"></textarea>
-				</view>
-			</view>
-			
+
 			<view class="tab_area"></view>
-			
-			<view v-if="showmore">				
+
+			<view v-if="showmore">
 				<view class="form-item">
 					<view class="title">鍒跺崟浜�:</view>
 					<view class="righton">
-						<input v-model="hform.HMaker" disabled/>
+						<input v-model="hform.HMaker" disabled />
 					</view>
 				</view>
 				<view class="form-item">
 					<view class="title">鍒跺崟鏃ユ湡:</view>
 					<view class="righton">
-						<input v-if="hform.HMakeDate" v-model="hform.HMakeDate.substr(0,10)" disabled/>
-						<input v-else v-model="hform.HMakeDate" disabled/>
+						<input v-if="hform.HMakeDate" v-model="hform.HMakeDate.substr(0,10)" disabled />
+						<input v-else v-model="hform.HMakeDate" disabled />
 					</view>
 				</view>
 				<view class="form-item">
 					<view class="title">淇敼浜�:</view>
 					<view class="righton">
-						<input v-model="hform.HUpDater" disabled/>
+						<input v-model="hform.HUpDater" disabled />
 					</view>
 				</view>
 				<view class="form-item">
 					<view class="title">淇敼鏃ユ湡:</view>
 					<view class="righton">
-						<input v-if="hform.HUpDateDate" v-model="hform.HUpDateDate.substr(0,10)" disabled/>
-						<input v-else v-model="hform.HUpDateDate" disabled/>
+						<input v-if="hform.HUpDateDate" v-model="hform.HUpDateDate.substr(0,10)" disabled />
+						<input v-else v-model="hform.HUpDateDate" disabled />
 					</view>
 				</view>
 				<view class="form-item">
 					<view class="title">瀹℃牳浜�:</view>
 					<view class="righton">
-						<input v-model="hform.HChecker" disabled/>
+						<input v-model="hform.HChecker" disabled />
 					</view>
 				</view>
 				<view class="form-item">
 					<view class="title">瀹℃牳鏃ユ湡:</view>
 					<view class="righton">
-						<input v-if="hform.HCheckDate" v-model="hform.HCheckDate.substr(0,10)" disabled/>
-						<input v-else v-model="hform.HCheckDate" disabled/>
+						<input v-if="hform.HCheckDate" v-model="hform.HCheckDate.substr(0,10)" disabled />
+						<input v-else v-model="hform.HCheckDate" disabled />
 					</view>
 				</view>
-			
+
 			</view>
 			<view class="other">
 				<view v-if="!showmore" @tap="showmore = true">
@@ -151,137 +147,278 @@
 					鎶樺彔鍏朵粬淇℃伅<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="top"></uni-icons>
 				</view>
 			</view>
-				
+
 			<view class="tab_area"></view>
-				
+
 			<view class="bottom-btn">
 				<button v-if="btnType == 1 && !isEdit" class="btn-a" size="mini" @tap="submit">鎻愪氦</button>
 				<button v-if="btnType != 1 && !isEdit" class="btn-a" size="mini" @tap="ifEdit">淇敼</button>
-				<button v-if="btnType != 1 && isEdit" class="btn-a" size="mini" @tap="submit">鎻愪氦</button>					
+				<button v-if="btnType != 1 && isEdit" class="btn-a" size="mini" @tap="submit">鎻愪氦</button>
 				<button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
 			</view>
 		</view>
-		
+
 	</view>
 </template>
 <script>
 	import getDateTime from '@/utils/getdateTime.js';
-	import { getUserInfo } from "@/utils/auth.js";
-    export default {
-        data() {
-            return {
-				userInfo:getUserInfo(),
-				serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
-				linterid:'',
-				HBillNo:'',
-				btnType:1,//1鏂板锛�3淇敼
+	import {
+		getUserInfo
+	} from "@/utils/auth.js";
+	export default {
+		data() {
+			return {
+				// 璁$畻鍒楄〃楂樺害
+				bottomBtnTop: 0,
+				listTableTop: 0,
+				tabs: 0,
+
+				userInfo: getUserInfo(),
+				serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
+				linterid: '',
+				HBillNo: '',
+				btnType: 1, //1鏂板锛�3淇敼
 				showmore: false,
-				
-				arrayHDeptName:[],//閮ㄩ棬
-				HDeptNameList:[],
-				arrayHEmpName:[],//鍙戠幇浜�/璐熻矗浜�
-				HEmpNameList:[],
-				arrayHSourceName:[],//鐢熶骇璧勬簮
-				HSourceNameList:[],
-				
-				
+				HBarCodeFocus: false,
+
+				arrayHDeptName: [], //閮ㄩ棬
+				HDeptNameList: [],
+				arrayHEmpName: [], //鍙戠幇浜�/璐熻矗浜�
+				HEmpNameList: [],
+				arrayHSourceName: [], //鐢熶骇璧勬簮
+				HSourceNameList: [],
+
+
 				isEdit: false,
-				hform:{
-					HInterID:'',
-					HBillNo:'',
-					HDate:getDateTime.dateTimeStr('y-m-d'),
-					HBarCode:'',
-					HDeptName:'',
-					HDeptID:'',
-					HEmpName:'',
-					HEmpID:'',
-					HMangerName:'',
-					HMangerID:'',
-					
-					
-					HSourceName:'',
-					HSourceID:'',
-					HMouldNumber:'',
-					HMouldID:'',
-					HMouldName:'',
-					HMouldModel:'',
-					HQty:'',
-					HScanDate:getDateTime.dateTimeStr('y-m-d h:i:s'),
-					HICMOBillNo:'',
-					HICMOInterID:'',
-					HICMOEntryID:'',
-					HProcExchBillNo:'',
-					HProcExchInterID:'',
-					HProcExchEntryID:'',
-					HOrgID:uni.getStorageSync('OrganizationID'),
-					
-					HMaker:'',
-					HMakeDate:'',
-					HUpDater:'',
-					HUpDateDate:'',		
-					HChecker:'',
-					HCheckDate:'',
-					HCloseMan:'',
-					HCloseDate:'',		
-					HDeleteMan:'',
-					HDeleteDate:'',
-					
-					eventType:'Add'
+				listOption: [], // 鍒楄〃閫夐」
+				listData: [], // 琛ㄦ牸鏁版嵁
+				selectedRows: [], // 琛ㄦ牸閫変腑鐨勬暟鎹�
+				// 鍦╟olumns閰嶇疆涓坊鍔犳搷浣滃垪
+				columns: [ // 琛ㄦ牸鍒楅厤缃�
+					{
+						type: 'selection',
+						fixed: true,
+						width: 50
+					},
+					{
+						name: 'index',
+						label: '搴忓彿',
+						width: 60,
+						hidden: true
+					},
+					{
+						name: 'HMouldID',
+						label: 'HMouldID',
+						width: 100,
+						hidden: true
+					},
+					{
+						name: '鍣ㄥ叿鏁伴噺',
+						label: '鍣ㄥ叿鏁伴噺',
+						width: 120
+					},
+					{
+						name: '鍣ㄥ叿缂栫爜',
+						label: '鍣ㄥ叿缂栫爜',
+						width: 150
+					},
+					{
+						name: '鍣ㄥ叿鍚嶇О',
+						label: '鍣ㄥ叿鍚嶇О',
+						width: 120
+					},
+					{
+						name: '鍣ㄥ叿鍨嬪彿',
+						label: '鍣ㄥ叿鍨嬪彿',
+						width: 120
+					},
+					{
+						name: '鍣ㄥ叿鏉$爜',
+						label: '鍣ㄥ叿鏉$爜',
+						width: 120
+					}
+				],
+
+				hform: {
+					HInterID: '',
+					HBillNo: '',
+					HDate: getDateTime.dateTimeStr('y-m-d'),
+					HBarCode: '',
+					HDeptName: uni.getStorageSync('HDeptName'),
+					HDeptID: uni.getStorageSync('HDeptID'),
+					HEmpName: uni.getStorageSync('HEmpName'),
+					HEmpID: uni.getStorageSync('HEmpID'),
+					HMangerName: uni.getStorageSync('HEmpName'),
+					HMangerID: uni.getStorageSync('HEmpID'),
+
+
+					HSourceName: '',
+					HSourceID: '0',
+					HQty: '0',
+					HScanDate: getDateTime.dateTimeStr('y-m-d h:i:s'),
+					HMaterID: '0',
+					HICMOBillNo: '',
+					HICMOInterID: '0',
+					HICMOEntryID: '0',
+					HProcExchBillNo: '',
+					HProcExchInterID: '0',
+					HProcExchEntryID: '0',
+					HOrgID: uni.getStorageSync('OrganizationID'),
+
+					HMaker: '',
+					HMakeDate: '',
+					HUpDater: '',
+					HUpDateDate: '',
+					HChecker: '',
+					HCheckDate: '',
+					HCloseMan: '',
+					HCloseDate: '',
+					HDeleteMan: '',
+					HDeleteDate: '',
+
+					eventType: 'Add'
 				}
-            }
-        },
+			}
+		},
 		onLoad(e) {
-			
+			this.HBarCodeFocus = true
+			this.getHDeptList()
+			this.getHEmpList()
+			this.getHSourceList()
 			this.hform.HMaker = uni.getStorageSync('HUserName')
-			console.log(e,this.userInfo)
-			if(e.linterid){
+			console.log(e, this.userInfo)
+			if (e.linterid) {
 				this.btnType = 3
 				this.linterid = e.linterid
 				this.HBillNo = e.HBillNo
 				this.getEditData(e.linterid, e.HBillNo)
-			}else{
+				this.getMouldDetailData(e.linterid, e.HBillNo);
+			} else {
 				this.getNewData()
 			}
-	
-			this.getHDeptList()
-			this.getHEmpList()
-			this.getHSourceList()
+			this.tabs = 0
 		},
-        methods: {
+		// ==================== 璁$畻灞炴�� ====================
+		computed: {
+			// 璁$畻琛ㄦ牸楂樺害
+			listTableHeight: {
+				get() {
+					return this.bottomBtnTop - this.listTableTop - 10
+				}
+			}
+		},
+		methods: {
 			//鎵爜
-			toScanCode(){		
+			toScanCode() {
 				var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
 				mpaasScanModule.mpaasScan({
 					'hideAlbum': true,
-					'timeoutInterval':'10', //瓒呮椂鏃堕棿
-					'timeoutText':'鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋            
-				},(ret) => {
+					'timeoutInterval': '10', //瓒呮椂鏃堕棿
+					'timeoutText': '鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋            
+				}, (ret) => {
 					console.log(ret.resp_result)
 					this.hform.HBarCode = ret.resp_result
 					this.getHBarCodeData(ret.resp_result)
 				})
 			},
+			//鍏夋爣
+			async refreshBarCodeState() {
+				this.HBarCodeFocus = false
+				await this.$nextTick(() => {
+					this.HBarCodeFocus = true
+					this.hform.HBarCode = ""
+				})
+			},
+			// 娣诲姞涓�涓噸鏂拌仛鐒︾殑鏂规硶
+			reFocusBarCode() {
+				this.HBarCodeFocus = false;
+				this.$nextTick(() => {
+					this.HBarCodeFocus = true;
+				});
+			},
+			// 琛ㄦ牸琛岀偣鍑诲鐞�
+			onTableRowClickHandler(row, index) {
+				if (!this.listData[index].checked) {
+					this.$set(this.listData[index], 'checked', true)
+				} else {
+					this.listData[index].checked = !this.listData[index].checked
+				}
+			},
+
+			// 琛ㄦ牸閫夋嫨澶勭悊
+			handleSelect(selected, array) {
+				this.selectedRows = array
+			},
+
+			// 琛ㄦ牸鍏ㄩ�夊鐞�
+			handleSelectAll(selected, array) {
+				this.selectedRows = array
+			},
+			// 琛ㄦ牸琛屽垹闄�
+			deleteSelected() {
+				if (this.selectedRows.length === 0) {
+					uni.showToast({
+						title: '璇峰厛閫夋嫨瑕佸垹闄ょ殑妯″叿',
+						icon: 'none'
+					})
+					return
+				}
+
+				// 鏄剧ず纭瀵硅瘽妗�
+				uni.showModal({
+					title: '纭鍒犻櫎',
+					content: `纭畾瑕佸垹闄ら�変腑鐨�${this.selectedRows.length}鏉℃暟鎹悧锛焋,
+					success: (res) => {
+						if (res.confirm) {
+							// 鑾峰彇閫変腑琛岀殑HMouldID闆嗗悎
+							const selectedIds = this.selectedRows.map(row => row.HMouldID)
+
+							// 杩囨护鎺夐�変腑鐨勬暟鎹�
+							this.listData = this.listData.filter(item =>
+								!selectedIds.includes(item.HMouldID)
+							)
+
+							// 閲嶆柊璁$畻搴忓彿
+							this.listData.forEach((item, index) => {
+								item.index = index + 1
+							})
+
+							// 娓呯┖閫変腑鐘舵��
+							this.selectedRows = []
+
+							uni.showToast({
+								title: '鍒犻櫎鎴愬姛',
+								icon: 'success'
+							})
+						}
+					}
+				})
+			},
+
 			//鏃ユ湡
-			HDateChange(e){
+			HDateChange(e) {
 				console.log(e.detail.value)
 				this.hform.HDate = e.detail.value
 			},
 			getHBarCodeData(HBarCode) {
-				if(!this.hform.HSourceName){
-					uni.showToast({
-						title:'璇峰厛閫夋嫨鐢熶骇璧勬簮',
-						icon:'none'
-					});
-					return;
+				if (uni.getStorageSync('Organization') == "鏉窞鏂帿灏旂鎬ф潗鏂欐湁闄愬叕鍙�") {
+					if (!this.hform.HSourceName) {
+						uni.showToast({
+							title: '璇峰厛閫夋嫨鐢熶骇璧勬簮',
+							icon: 'none'
+						});
+						return;
+					}
 				}
 				var HBillType = "";
 				var barNo = "";
 				if (HBarCode.length < 22) {
-					barNo = HBarCode.substr(0, 4);
-					switch (barNo) {
-						case "GXLX":
+					if (HBarCode.substr(0, 4) === "GXLX") {
 						HBillType = "3772";
-							break;
+					} else if (HBarCode.substr(0, 2) === "WP") {
+						HBillType = "3710";
+					} else if (HBarCode.substr(0, 4) === "SCRW") {
+						HBillType = "3710";
 					}
 				}
 
@@ -297,42 +434,128 @@
 						case "https://www.aliwork.com":
 							HBillType = "3308";
 							break;
-                    }
-                }
+					}
+				}
 				uni.request({
 					url: this.serverUrl + '/Sc_MouldUpperBill/txtHBarCode_KeyDown',
 					data: {
 						HBarCode: this.hform.HBarCode,
-						HSourceID:this.hform.HSourceID,
-						UserID:uni.getStorageSync('Czybm'),
-						HBillType:HBillType
+						HSourceID: this.hform.HSourceID,
+						UserID: uni.getStorageSync('Czybm'),
+						HBillType: HBillType
 					},
 					success: (res) => {
 						console.log(2, res.data);
 						if (res.data.code == 1) {
 							var data = res.data.data[0];
 							console.log(3, data);
-							var num=data.Num;
+							var num = data.Num;
 							console.log(4, num);
 							switch (num) {
 								case 1:
 									this.hform.HSourceID = data.HItemID;
 									this.hform.HSourceName = data.HName;
-								break;
+									this.refreshBarCodeState();
+									break;
 
 								case 2:
 									this.hform.HICMOBillNo = data.鍗曟嵁鍙�;
 									this.hform.HICMOInterID = data.hmainid;
 									this.hform.HICMOEntryID = data.HEntryID;
-								break;
+									this.hform.HMaterID = data.HMaterID;
+									this.refreshBarCodeState();
+									if (uni.getStorageSync('OrganizationID') == "100007" && uni.getStorageSync(
+											'Organization') == "浜嬩笟涓�澶�") {
+										//鑾峰彇鍣ㄥ叿娓呭崟
+										this.GetMaterialMouldList();
+									}
+									break;
 
 								case 3:
-									this.hform.HMouldID = data.hmainid;
-									this.hform.HMouldNumber = data.妯″叿缂栧彿;
-									this.hform.HMouldName = data.妯″叿鍚嶇О;
-									this.hform.HMouldModel = data.妯″叿鍨嬪彿;
-									this.hform.HQty = 1;
-								break;
+									if (!this.hform.HICMOBillNo && !this.hform.HProcExchBillNo) {
+										uni.showToast({
+											title: '璇峰厛鎵弿鐢熶骇宸ュ崟',
+											icon: 'none'
+										});
+										return;
+									}
+
+									// 鍏堣皟鐢ㄦā鍏锋。妗堟鏌ワ紝鏍¢獙閫氳繃鍚庢墠娣诲姞鏁版嵁
+									this.getMould_FC().then(isValid => {
+										if (isValid) {
+											this.tabs = 1;
+											// 妫�鏌ユā鍏锋槸鍚﹀凡瀛樺湪浜庤〃鏍间腑
+											const existingIndex = this.listData.findIndex(item =>
+												item.HMouldID === data.hmainid
+											);
+											if (uni.getStorageSync('OrganizationID') == "100007" && uni
+												.getStorageSync('Organization') == "浜嬩笟涓�澶�") {
+												if (existingIndex === -1) {
+													// 濡傛灉涓嶅瓨鍦紝娣诲姞鍒拌〃鏍�
+													uni.showToast({
+														title: '褰撳墠妫�鍏蜂笉鍦ㄥ綋鍓嶇墿鏂欑殑妫�鍏锋竻鍗曚腑',
+														icon: 'none',
+														duration: 1500
+													});
+													this.refreshBarCodeState();
+												} else {
+													// 濡傛灉宸插瓨鍦紝妫�鏌ュ櫒鍏锋暟閲�
+													if (this.listData[existingIndex].鍣ㄥ叿鏁伴噺 === 0) {
+														// 鍣ㄥ叿鏁伴噺涓�0锛屾洿鏂版潯鐮佸苟灏嗘暟閲忓彉涓�1
+														this.listData[existingIndex].鍣ㄥ叿鏉$爜 = this.hform
+															.HBarCode;
+														this.listData[existingIndex].鍣ㄥ叿鏁伴噺 = 1;
+														uni.showToast({
+															title: '鎵弿鎴愬姛',
+															icon: 'success',
+															duration: 1500
+														});
+														this.refreshBarCodeState();
+													} else {
+														// 鍣ㄥ叿鏁伴噺宸蹭负1锛屾彁绀轰笉鍏佽閲嶅鎵弿
+														uni.showToast({
+															title: '璇ユā鍏峰凡鎵弿锛屼笉鍏佽閲嶅鎵弿',
+															icon: 'none',
+															duration: 1500
+														});
+														this.refreshBarCodeState();
+													}
+												}
+											} else {
+												if (existingIndex === -1) {
+													// 濡傛灉涓嶅瓨鍦紝娣诲姞鍒拌〃鏍�
+													const newRow = {
+														index: this.listData.length + 1,
+														HMouldID: data.hmainid,
+														鍣ㄥ叿缂栫爜: data.妯″叿缂栧彿,
+														鍣ㄥ叿鍚嶇О: data.妯″叿鍚嶇О,
+														鍣ㄥ叿鍨嬪彿: data.妯″叿鍨嬪彿,
+														鍣ㄥ叿鏉$爜: this.hform.HBarCode,
+														鍣ㄥ叿鏁伴噺: 1,
+														checked: false // 榛樿涓嶉�変腑
+													};
+													this.listData.push(newRow);
+													this.refreshBarCodeState();
+												} else {
+													// 濡傛灉宸插瓨鍦紝鎻愮ず鐢ㄦ埛
+													uni.showToast({
+														title: '璇ユā鍏峰凡鎵弿',
+														icon: 'none',
+														duration: 1500
+													});
+													this.refreshBarCodeState();
+												}
+											}
+
+										} else {
+											// 鏍¢獙涓嶉�氳繃锛屾竻绌烘潯鐮佷絾涓嶆坊鍔犳暟鎹�
+											this.refreshBarCodeState();
+										}
+									}).catch(error => {
+										console.log('鏍¢獙澶辫触:', error);
+										this.refreshBarCodeState();
+									});
+									break;
 
 								case 4:
 									this.hform.HProcExchBillNo = data.鍗曟嵁鍙�;
@@ -341,14 +564,22 @@
 									this.hform.HICMOBillNo = data.浠诲姟鍗曞彿;
 									this.hform.HICMOInterID = data.hicmointerid;
 									this.hform.HICMOEntryID = data.HICMOEntryID;
-								break;
+									this.hform.HMaterID = data.HMaterID;
+									this.refreshBarCodeState();
+									if (uni.getStorageSync('OrganizationID') == "100007" && uni.getStorageSync(
+											'Organization') == "浜嬩笟涓�澶�") {
+										//鑾峰彇鍣ㄥ叿娓呭崟
+										this.GetMaterialMouldList();
+									}
+									break;
 								default:
 									uni.showToast({
 										title: '鏈煡鐨勮繑鍥炵被鍨�',
 										icon: 'none',
 									});
-								break;
+									break;
 							}
+
 						} else {
 							uni.showToast({
 								title: res.data.Message,
@@ -364,362 +595,570 @@
 						})
 					},
 				});
-			},			
+			},
 			//鑾峰彇浣跨敤閮ㄩ棬鏁版嵁
-			getHDeptList(){
+			getHDeptList() {
 				uni.request({
-				    url: this.serverUrl + '/PublicPageMethod/DeptList', 
-					data: { sWhere: "where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + uni.getStorageSync('OrganizationID') + "" },
-				    success: (res) => {
-						if(res.data.count == 1){
+					url: this.serverUrl + '/PublicPageMethod/DeptList',
+					data: {
+						sWhere: "where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + uni.getStorageSync(
+							'OrganizationID') + ""
+					},
+					success: (res) => {
+						if (res.data.count == 1) {
 							this.HDeptNameList = res.data.data
-							for(var i=0;i<res.data.data.length;i++){
+							for (var i = 0; i < res.data.data.length; i++) {
 								this.arrayHDeptName[i] = res.data.data[i].HName
 							}
 							this.$forceUpdate();
-						}else{
+						} else {
 							uni.showToast({
-								title:res.data.Message,
-								icon:'none'
+								title: res.data.Message,
+								icon: 'none'
 							})
 						}
 					},
 					fail: (res) => {
 						console.log(res);
 						uni.showToast({
-							title:'鎺ュ彛璇锋眰澶辫触',
-							icon:'none'
+							title: '鎺ュ彛璇锋眰澶辫触',
+							icon: 'none'
 						})
 					},
 				});
 			},
 			//閫夋嫨浣跨敤閮ㄩ棬
-			HDeptNameChange(e){
-				for(var i=0;i<this.HDeptNameList.length;i++){
-					if(this.HDeptNameList[i].HName == e){
+			HDeptNameChange(e) {
+				for (var i = 0; i < this.HDeptNameList.length; i++) {
+					if (this.HDeptNameList[i].HName == e) {
 						this.hform.HDeptID = this.HDeptNameList[i].HItemID
 					}
 				}
 			},
 			//鎿嶄綔鍛樸�佽礋璐d汉
-			getHEmpList(){
+			getHEmpList() {
 				uni.request({
-					url: this.serverUrl + '/Web/GetEmployeeList_Json', 
-					data: { Employee: '',HGroupID:0 },
+					url: this.serverUrl + '/Web/GetEmployeeList_Json',
+					data: {
+						Employee: '',
+						HGroupID: 0
+					},
 					success: (res) => {
-						if(res.data.count == 1){
+						if (res.data.count == 1) {
 							this.HEmpNameList = res.data.data
-							for(var i=0;i<res.data.data.length;i++){
+							for (var i = 0; i < res.data.data.length; i++) {
 								this.arrayHEmpName[i] = res.data.data[i].HName
 							}
 							this.$forceUpdate();
-						}else{
+						} else {
 							uni.showToast({
-								title:res.data.Message,
-								icon:'none'
+								title: res.data.Message,
+								icon: 'none'
 							})
 						}
 					},
 					fail: (res) => {
 						console.log(res);
 						uni.showToast({
-							title:'鎺ュ彛璇锋眰澶辫触',
-							icon:'none'
+							title: '鎺ュ彛璇锋眰澶辫触',
+							icon: 'none'
 						})
 					},
 				});
 			},
 			//閫夋嫨鎿嶄綔鍛�
-			HEmpNameChange(e){
-				for(var i=0;i<this.HEmpNameList.length;i++){
-					if(this.HEmpNameList[i].HName == e){
+			HEmpNameChange(e) {
+				for (var i = 0; i < this.HEmpNameList.length; i++) {
+					if (this.HEmpNameList[i].HName == e) {
 						this.hform.HEmpID = this.HEmpNameList[i].HItemID
 					}
 				}
 			},
 			//閫夋嫨璐熻矗浜�
-			HManagerNameChange(e){
-				for(var i=0;i<this.HEmpNameList.length;i++){
-					if(this.HEmpNameList[i].HName == e){
+			HManagerNameChange(e) {
+				for (var i = 0; i < this.HEmpNameList.length; i++) {
+					if (this.HEmpNameList[i].HName == e) {
 						this.hform.HMangerID = this.HEmpNameList[i].HItemID
 					}
 				}
 			},
 			//鐢熶骇璧勬簮
-			getHSourceList(){
+			getHSourceList() {
 				uni.request({
-					url: this.serverUrl + '/api/newBill/getSourceList', 
-					data: { sWhere: '' },
+					url: this.serverUrl + '/api/newBill/getSourceList',
+					data: {
+						sWhere: " and HUSEORGID = " + uni.getStorageSync('OrganizationID') + ""
+					},
 					success: (res) => {
-						if(res.data.code == 1){
+						if (res.data.code == 1) {
 							this.HSourceNameList = res.data.data.Gy_Source
-							for(var i=0;i<res.data.data.Gy_Source.length;i++){
+							for (var i = 0; i < res.data.data.Gy_Source.length; i++) {
 								this.arrayHSourceName[i] = res.data.data.Gy_Source[i].鐢熶骇璧勬簮
 							}
 							this.$forceUpdate();
-						}else{
+						} else {
 							uni.showToast({
-								title:res.data.Message,
-								icon:'none'
+								title: res.data.Message,
+								icon: 'none'
 							})
 						}
 					},
 					fail: (res) => {
 						console.log(res);
 						uni.showToast({
-							title:'鎺ュ彛璇锋眰澶辫触',
-							icon:'none'
+							title: '鎺ュ彛璇锋眰澶辫触',
+							icon: 'none'
 						})
 					},
 				});
 			},
 			//閫夋嫨鐢熶骇璧勬簮
-			HSourceNameChange(e){
-				for(var i=0;i<this.HSourceNameList.length;i++){
-					if(this.HSourceNameList[i].鐢熶骇璧勬簮 == e){
+			HSourceNameChange(e) {
+				for (var i = 0; i < this.HSourceNameList.length; i++) {
+					if (this.HSourceNameList[i].鐢熶骇璧勬簮 == e) {
 						this.hform.HSourceID = this.HSourceNameList[i].HItemID
 					}
 				}
 			},
-			ifEdit(){
+			ifEdit() {
 				this.isEdit = true
 				this.hform.eventType = 'Modify'
 			},
 			//缂栬緫鍥炴樉
-			getEditData(linterid,HBillNo){				
+			getEditData(linterid, HBillNo) {
 				//涓昏〃
 				var sWhere = " and hmainid='" + linterid + "'";
 				uni.request({
-				    url: this.serverUrl + '/Sc_MouldUpperBill/Sc_MouldUpperBillList', 
-					data: { sWhere: sWhere,user: uni.getStorageSync('HUserName') },
-				    success: (res) => {
-				        console.log(1,res.data.data[0]);
-						if(res.data.code == 1){
-							var data = res.data.data[0]							
-							this.btnType=3
-							this.hform.HInterID= data.hmainid
-							this.hform.HBillNo= data.鍗曟嵁鍙�
-							this.hform.HBarCode= data.鏉″舰鐮�
-							this.hform.HDeptID= data.HDeptID
-							this.hform.HDeptName= data.閮ㄩ棬
-							this.hform.HEmpID= data.HEmpID
-							this.hform.HEmpName= data.鎿嶄綔鍛�
-							this.hform.HMangerID= data.HMangerID
-							this.hform.HMangerName= data.璐熻矗浜�
-							this.hform.HRemark= data.琛ㄥご澶囨敞						
-							this.hform.HDate = data.鏃ユ湡.substr(0,10)
-							
-							this.hform.HSourceID=data.HSourceID,
-							this.hform.HSourceName=data.鐢熶骇璧勬簮,							
-							this.hform.HMouldID=data.HMouldID,
-							this.hform.HMouldNumber=data.妯″叿缂栫爜,
-							this.hform.HMouldName=data.妯″叿鍚嶇О,
-							this.hform.HMouldModel=data.妯″叿瑙勬牸,
-							this.hform.HQty=data.鏁伴噺,
-							this.hform.HScanDate=data.涓婃ā鎵爜鏃堕棿,
-							this.hform.HICMOBillNo=data.HICMOBillNo,
-							this.hform.HICMOInterID=data.HICMOInterID,
-							this.hform.HICMOEntryID=data.HICMOEntryID,
-							this.hform.HProcExchBillNo=data.HProcExchBillNo,
-							this.hform.HProcExchInterID=data.HProcExchInterID,
-							this.hform.HProcExchEntryID=data.HProcExchEntryID,
-							this.hform.HOrgID=data.HOrgID,
-																				
-							this.hform.HMaker= data.鍒跺崟浜�
-							this.hform.HMakeDate= data.鍒跺崟鏃ユ湡
-							this.hform.HUpDater= data.淇敼浜�
-							this.hform.HUpDateDate= data.淇敼鏃ユ湡
-							this.hform.HChecker= data.瀹℃牳浜�
-							this.hform.HCheckDate= data.瀹℃牳鏃ユ湡							
-							this.hform.HDeleteMan= data.浣滃簾浜�
-							this.hform.HDeleteDate= data.浣滃簾鏃ユ湡
-						}else{
+					url: this.serverUrl + '/Sc_MouldUpperBill/Sc_MouldUpperBillList',
+					data: {
+						sWhere: sWhere,
+						user: uni.getStorageSync('HUserName')
+					},
+					success: (res) => {
+						console.log(1, res.data.data[0]);
+						if (res.data.code == 1) {
+							var data = res.data.data[0]
+							this.btnType = 3
+							this.hform.HInterID = data.hmainid
+							this.hform.HBillNo = data.鍗曟嵁鍙�
+							this.hform.HBarCode = data.鏉″舰鐮�
+							this.hform.HDeptID = data.HDeptID
+							this.hform.HDeptName = data.閮ㄩ棬
+							this.hform.HEmpID = data.HEmpID
+							this.hform.HEmpName = data.鎿嶄綔鍛�
+							this.hform.HMangerID = data.HMangerID
+							this.hform.HMangerName = data.璐熻矗浜�
+							this.hform.HRemark = data.琛ㄥご澶囨敞
+							this.hform.HDate = data.鏃ユ湡.substr(0, 10)
+
+							this.hform.HSourceID = data.HSourceID,
+								this.hform.HSourceName = data.鐢熶骇璧勬簮,
+								this.hform.HQty = data.鏁伴噺,
+								this.hform.HScanDate = data.涓婃ā鎵爜鏃堕棿,
+								this.hform.HICMOBillNo = data.HICMOBillNo,
+								this.hform.HICMOInterID = data.HICMOInterID,
+								this.hform.HICMOEntryID = data.HICMOEntryID,
+								this.hform.HProcExchBillNo = data.HProcExchBillNo,
+								this.hform.HProcExchInterID = data.HProcExchInterID,
+								this.hform.HProcExchEntryID = data.HProcExchEntryID,
+								this.hform.HOrgID = data.HOrgID,
+
+								this.hform.HMaker = data.鍒跺崟浜�
+							this.hform.HMakeDate = data.鍒跺崟鏃ユ湡
+							this.hform.HUpDater = data.淇敼浜�
+							this.hform.HUpDateDate = data.淇敼鏃ユ湡
+							this.hform.HChecker = data.瀹℃牳浜�
+							this.hform.HCheckDate = data.瀹℃牳鏃ユ湡
+							this.hform.HDeleteMan = data.浣滃簾浜�
+							this.hform.HDeleteDate = data.浣滃簾鏃ユ湡
+
+						} else {
 							uni.showToast({
-								title:res.data.Message,
-								icon:'none'
+								title: res.data.Message,
+								icon: 'none'
 							})
 						}
 					},
 					fail: (res) => {
 						console.log(res);
 						uni.showToast({
-							title:'鎺ュ彛璇锋眰澶辫触',
-							icon:'none'
+							title: '鎺ュ彛璇锋眰澶辫触',
+							icon: 'none'
 						})
 					},
-				});				
+				});
+			},
+			// 缂栬緫鑾峰彇妯″叿鏄庣粏鐨勬柟娉�
+			getMouldDetailData(linterid) {
+				var sWhere = " and hmainid='" + linterid + "'";
+				uni.request({
+					url: this.serverUrl + '/Sc_MouldUpperBill/Sc_MouldUpperBillList',
+					data: {
+						sWhere: sWhere,
+						user: uni.getStorageSync('HUserName')
+					},
+					success: (res) => {
+						if (res.data.code == 1 && res.data.data && res.data.data.length > 0) {
+							this.listData = [];
+
+							res.data.data.forEach((item, index) => {
+								this.listData.push({
+									index: index + 1,
+									HMouldID: item.HMouldID,
+									鍣ㄥ叿缂栫爜: item.妯″叿缂栫爜 || item.HMouldNumber,
+									鍣ㄥ叿鍚嶇О: item.妯″叿鍚嶇О || item.HMouldName,
+									鍣ㄥ叿鍨嬪彿: item.妯″叿瑙勬牸 || item.HMouldModel,
+									鍣ㄥ叿鏉$爜: item.鏉″舰鐮� || item.HBarCode,
+									鍣ㄥ叿鏁伴噺: item.鏁伴噺 || item.HBarCode
+								});
+							});
+
+							this.selectedRows = [...this.listData];
+						}
+					},
+					fail: (res) => {
+						console.log('鑾峰彇妯″叿鏄庣粏澶辫触:', res);
+					}
+				});
+			},
+			// 鎻愪緵宸ュ崟鐨勭墿鏂欒嚜鍔ㄥ甫鍑哄搴旂殑浜у搧鍣ㄥ叿娓呭崟
+			GetMaterialMouldList() {
+				var sWhere = " and HMaterID='" + this.hform.HMaterID + "'";
+				uni.request({
+					url: this.serverUrl + '/Sc_MouldUpperBill/GetMaterialMouldList',
+					data: {
+						sWhere: sWhere,
+						user: uni.getStorageSync('HUserName')
+					},
+					success: (res) => {
+						if (res.data.code == 1 && res.data.data && res.data.data.length > 0) {
+							this.listData = [];
+							this.tabs=1;
+							res.data.data.forEach((item, index) => {
+								this.listData.push({
+									index: index + 1,
+									HMouldID: item.HMouldID,
+									鍣ㄥ叿缂栫爜: item.妯″叿缂栧彿 || item.HMouldNumber,
+									鍣ㄥ叿鍚嶇О: item.妯″叿鍚嶇О || item.HMouldName,
+									鍣ㄥ叿鍨嬪彿: item.妯″叿鍨嬪彿 || item.HMouldModel,
+									鍣ㄥ叿鏉$爜: item.鏉″舰鐮� || item.HBarCode,
+									鍣ㄥ叿鏁伴噺: 0
+								});
+							});
+							
+							this.selectedRows = [...this.listData];
+						} else {
+							uni.showToast({
+								title: res.data.Message,
+								icon: 'none'
+							})
+						}
+					},
+					fail: (res) => {
+						console.log('鑾峰彇妯″叿鏄庣粏澶辫触:', res);
+					}
+				});
+			},
+			// 鏉$爜鎵弿鏃跺�欏垽鏂槸鍚︽槸瀛樺湪妯″叿妗f 骞朵笖鏄惁瀛樺湪浜у搧鍣ㄥ叿娓呭崟
+			getMould_FC() {
+				return new Promise((resolve, reject) => {
+					uni.request({
+						url: this.serverUrl + '/Sc_MouldUpperBill/GetBarCode_FC',
+						data: {
+							HBarCode: this.hform.HBarCode,
+							HMaterID: this.hform.HMaterID
+						},
+						success: (res) => {
+							if (res.data.code == 1) {
+								// 鏍¢獙閫氳繃
+								resolve(true);
+							} else {
+								// 鏍¢獙涓嶉�氳繃锛屾樉绀洪敊璇俊鎭�
+								uni.showToast({
+									title: res.data.Message || '妯″叿妗f鏍¢獙澶辫触',
+									icon: 'none'
+								});
+								resolve(false);
+							}
+						},
+						fail: (res) => {
+							console.log('鑾峰彇妯″叿鏉$爜澶辫触:', res);
+							uni.showToast({
+								title: '鏍¢獙澶辫触锛岃妫�鏌ョ綉缁�',
+								icon: 'none'
+							});
+							resolve(false);
+						}
+					});
+				});
 			},
 			//鏂板
-			getNewData(){
+			getNewData() {
 				uni.request({
-				    url: this.serverUrl + '/Web/GetMAXNum', 
-					data: { HBillType: '3846' },
-				    success: (res) => {
+					url: this.serverUrl + '/Web/GetMAXNum',
+					data: {
+						HBillType: '3846'
+					},
+					success: (res) => {
 						console.log(res.data)
-						if(res.data.count == 1){
+						if (res.data.count == 1) {
 							this.hform.HInterID = res.data.data[0].HInterID
 							this.hform.HBillNo = res.data.data[0].HBillNo
 							this.hform.HMakeDate = getDateTime.dateTimeStr('y-m-d')
-							this.btnType=1
-						}else{
+							this.btnType = 1
+						} else {
 							uni.showToast({
-								title:res.data.Message,
-								icon:'none'
+								title: res.data.Message,
+								icon: 'none'
 							})
 						}
 					},
 					fail: (res) => {
 						console.log(res);
 						uni.showToast({
-							title:'鎺ュ彛璇锋眰澶辫触',
-							icon:'none'
+							title: '鎺ュ彛璇锋眰澶辫触',
+							icon: 'none'
 						})
 					},
 				});
 			},
-            submit() {
-            	if(!this.hform.HBarCode){
-            		uni.showToast({
-            			title:'璇锋壂鎻忔ā鍏锋潯褰㈢爜',
-            			icon:'none'
-            		})
-				}else if(!this.hform.HSourceName){
+			submit() {
+				if (uni.getStorageSync('Organization') == "鏉窞鏂帿灏旂鎬ф潗鏂欐湁闄愬叕鍙�") {
+					if (!this.hform.HSourceName) {
+						uni.showToast({
+							title: '璇峰厛閫夋嫨鐢熶骇璧勬簮',
+							icon: 'none'
+						});
+						return;
+					}
+				}
+				if (this.listData.length === 0) {
 					uni.showToast({
-						title:'璇烽�夋嫨鐢熶骇璧勬簮',
-						icon:'none'
+						title: '璇疯嚦灏戞坊鍔犱竴涓ā鍏�',
+						icon: 'none'
 					})
-				}else if(!this.hform.HMouldName){
+				}
+				// 濡傛灉鏄簨涓氫竴澶勭粍缁囷紝鏍¢獙鍣ㄥ叿鏁伴噺
+				if (uni.getStorageSync('OrganizationID') === "100007" && uni.getStorageSync('Organization') === "浜嬩笟涓�澶�") {
+					const zeroQtyItem = this.listData.find(item => {
+					  // 鑰冭檻0銆乶ull銆乽ndefined绛夊紓甯告儏鍐�
+					  const qty = Number(item.鍣ㄥ叿鏁伴噺) || 0;
+					  return qty <= 0;
+					});
+					
+					if (zeroQtyItem) {
+					  // 鎵惧埌绗竴涓暟閲忓紓甯搁」鐨勪綅缃紙绱㈠紩+1锛�
+					  const index = this.listData.indexOf(zeroQtyItem) + 1;
+					  const code = zeroQtyItem.鍣ㄥ叿缂栫爜 || '鏈煡缂栫爜';
+					  uni.showToast({
+					    title: `绗�${index}琛屻��${code}銆戝櫒鍏锋暟閲忎负0锛岃妫�鏌,
+					    icon: 'none',
+					    duration: 3000
+					  });
+					  return;
+					}
+				}
+				if (!this.hform.HEmpName) {
 					uni.showToast({
-						title:'妯″叿涓嶈兘涓虹┖',
-						icon:'none'
+						title: '璇烽�夋嫨鎿嶄綔鍛�',
+						icon: 'none'
 					})
-            	}else if(!this.hform.HEmpName){
+				} else if (!this.hform.HMangerName) {
 					uni.showToast({
-						title:'璇烽�夋嫨鎿嶄綔鍛�',
-						icon:'none'
+						title: '璇烽�夋嫨璐熻矗浜�',
+						icon: 'none'
 					})
-				}else if(!this.hform.HMangerName){
+				} else if (!this.hform.HDeptName) {
 					uni.showToast({
-						title:'璇烽�夋嫨璐熻矗浜�',
-						icon:'none'
+						title: '璇烽�夋嫨閮ㄩ棬',
+						icon: 'none'
 					})
-            	}else{
-            		uni.showLoading({
-            			title:'璇风◢鍊�'
-            		})
-					var sMainStr = JSON.stringify(this.hform);
-					var sMainSub = sMainStr + ";" + uni.getStorageSync('HUserName')+";"+this.btnType;
-            		console.log(sMainSub);
-            		uni.request({
-            		    url: this.serverUrl + '/Sc_MouldUpperBill/AddSc_MouldUpperBill_PDA',
-            			method:'POST',
-            			dataType:"json",
-            			data:{ oMain: sMainSub },
-            		    success: (res) => {
-            		        console.log(1,res);
+				} else {
+					uni.showLoading({
+						title: '璇风◢鍊�'
+					})
+					// ========== 绗竴姝ワ細鏋勫缓涓昏〃鏁版嵁 ==========
+					const mainData = {
+						HBillNo: this.hform.HBillNo,
+						HInterID: this.hform.HInterID,
+						HDate: this.hform.HDate,
+
+						// 鎵爜淇℃伅
+						HBarCode: this.hform.HBarCode,
+
+						// 閮ㄩ棬淇℃伅
+						HDeptName: this.hform.HDeptName,
+						HDeptID: this.hform.HDeptID,
+
+						// 浜哄憳淇℃伅
+						HEmpName: this.hform.HEmpName,
+						HEmpID: this.hform.HEmpID,
+						HMangerName: this.hform.HMangerName,
+						HMangerID: this.hform.HMangerID,
+
+						// 鍏朵粬淇℃伅
+						HRemark: this.hform.HRemark || "",
+						HOrgID: this.hform.HOrgID,
+
+						// 绯荤粺瀛楁
+						HMaker: this.hform.HMaker || uni.getStorageSync('HUserName'),
+						hupdater: this.hform.HUpDater || uni.getStorageSync('HUserName'),
+						hchecker: this.hform.HChecker || "",
+						HMakeDate: this.hform.HMakeDate || getDateTime.dateTimeStr('y-m-d'),
+						hupdatedate: this.hform.HUpDateDate || getDateTime.dateTimeStr('y-m-d'),
+						hcheckdate: this.hform.HCheckDate || "",
+						hdeleteman: this.hform.HDeleteMan || "",
+						hdeletedate: this.hform.HDeleteDate || "",
+					};
+
+					// ========== 绗簩姝ワ細鏋勫缓鏄庣粏鏁版嵁 ==========					       
+					const detailData = this.listData.map((item, index) => ({
+						HMouldID: item.HMouldID,
+						HMouldNumber: item.鍣ㄥ叿缂栫爜,
+						HMouldName: item.鍣ㄥ叿鍚嶇О,
+						HMouldModel: item.鍣ㄥ叿鍨嬪彿,
+						HBarCode: item.鍣ㄥ叿鏉$爜,
+						HQty: 1, // 姣忎釜妯″叿鏁伴噺榛樿涓�1
+
+						// 浠巋form涓鐢ㄧ殑鐢熶骇淇℃伅
+						HSourceID: this.hform.HSourceID,
+						HSourceName: this.hform.HSourceName,
+						HICMOInterID: this.hform.HICMOInterID || "0",
+						HICMOEntryID: this.hform.HICMOEntryID || "0",
+						HICMOBillNo: this.hform.HICMOBillNo || "",
+
+						LAY_TABLE_INDEX: index // 浠�0寮�濮嬬殑绱㈠紩
+					}));
+
+					// ========== 绗笁姝ワ細鎷兼帴瀹屾暣鏁版嵁 ==========
+					const submitStr = JSON.stringify(mainData) + ";" + JSON.stringify(detailData) + ";" + this.btnType +
+						";" + uni.getStorageSync('HUserName');
+
+
+					console.log(submitStr);
+					uni.request({
+						url: this.serverUrl + '/Sc_MouldUpperBill/AddSc_MouldUpperBill_APP',
+						method: 'POST',
+						dataType: "json",
+						data: {
+							sMainSub: submitStr
+						},
+						success: (res) => {
+							console.log(1, res);
 							uni.hideLoading()
-            				if(res.data.count == 1){
+							if (res.data.count == 1) {
 								let pages = getCurrentPages();
-								let prePage = pages[pages.length - 2]; 
-								prePage.$vm.getList()
-								if(this.isEdit){
-									setTimeout(()=>{
+								let prePage = pages[pages.length - 2];
+
+								if (this.isEdit) {
+									setTimeout(() => {
 										uni.redirectTo({
-											url:'/pages/weiwaigxIn/Cj_StationEntrustInBill?linterid=' + this.linterid + '&HBillNo=' + this.linterid
+											url: '/pages/shangmudan/MouldUpperBill?linterid=' +
+												this.linterid + '&HBillNo=' + this.HBillNo
 										})
-									},1000)
-								}else{
-									setTimeout(()=>{
+									}, 1000)
+								} else {
+									setTimeout(() => {
 										uni.navigateBack()
-									},1000)
+									}, 1000)
 								}
-            				}
-            				uni.showToast({
-            					title:res.data.Message,
-            					icon:'none'
-            				})
-            			},
-            			fail: (res) => {
-            				console.log(res);
-            				uni.showToast({
-            					title:'鎺ュ彛璇锋眰澶辫触',
-            					icon:'none'
-            				})
-            			},
-            		});
-            	}
-            },
-            goBack(){
+							}
+							uni.showToast({
+								title: res.data.Message,
+								icon: 'none'
+							})
+						},
+						fail: (res) => {
+							console.log(res);
+							uni.showToast({
+								title: '鎺ュ彛璇锋眰澶辫触',
+								icon: 'none'
+							})
+						},
+					});
+				}
+			},
+			goBack() {
 				uni.showModal({
-				    title: '鎻愮ず',
-				    content: '纭瑕侀��鍑哄綋鍓嶉〉闈㈠悧锛�',
-				    success: (res) => {
-				        if (res.confirm) {
-				            console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+					title: '鎻愮ず',
+					content: '纭瑕侀��鍑哄綋鍓嶉〉闈㈠悧锛�',
+					success: (res) => {
+						if (res.confirm) {
+							console.log('鐢ㄦ埛鐐瑰嚮纭畾');
 							uni.navigateBack()
-				        } else if (res.cancel) {
-				            console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
-				        }
-				    }
+						} else if (res.cancel) {
+							console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+						}
+					}
 				});
-            }
-        }
-    }
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
-	.form{
+	.form {
 		width: 668rpx;
 		margin: 20rpx auto;
 		padding-bottom: 240rpx;
 	}
-	.tab_area{
+
+	.tab_area {
 		width: 100%;
 		height: 50rpx;
 	}
-	.other{
+
+	.other {
 		margin-top: 8rpx;
 		text-align: center;
 		font-size: 28rpx;
 		padding: 4rpx 18rpx;
 		color: #1890FF;
 	}
-    .form-item{
+
+	.form-item {
 		display: flex;
 		align-items: center;
 		font-size: 30rpx;
 		padding: 6rpx 0;
-		.title{
+
+		.title {
 			width: 208rpx;
-			text{
+
+			text {
 				color: red;
 				font-weight: bold;
 			}
 		}
-		.right{
+
+		.right {
 			width: 450rpx;
 			border-radius: 22rpx;
 			border: 1px solid #acacac;
 		}
-		.righton{
+
+		.righton {
 			width: 450rpx;
 			border-radius: 22rpx;
 			border: 1px solid #e4e4e4;
 			background-color: #e4e4e4;
 		}
-		input{
+
+		input {
 			width: 100%;
 			padding: 8rpx 20rpx;
 			font-size: 30rpx;
 		}
-		textarea{
+
+		textarea {
 			width: 98%;
 			padding: 8rpx 20rpx;
 			font-size: 30rpx;
 		}
 
 	}
-	.bottom-btn{
+
+	.bottom-btn {
 		width: 100%;
 		// height: 120rpx;
 		position: fixed;
@@ -728,30 +1167,56 @@
 		background-color: #fff;
 		box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
 		padding: 30rpx 40rpx 40rpx 40rpx;
-		button{
+
+		button {
 			border-radius: 50rpx;
 			width: 180rpx;
 			height: 66rpx;
 			line-height: 66rpx;
 			font-size: 28rpx;
 		}
-		.btn-a{
+
+		.btn-a {
 			background-color: #3A78FF;
 			color: #fff;
 		}
-		.btn-b{
+
+		.btn-b {
 			background-color: #41a863;
 			color: #fff;
 		}
-		.btn-c{
+
+		.btn-c {
 			background-color: #acacac;
 			color: #fff;
 			position: absolute;
 			right: 120rpx;
 		}
-		.btn-d{
+
+		.btn-d {
 			background-color: #ff8901;
 			color: #fff;
 		}
 	}
+
+	.tabs {
+		width: 100%;
+		display: flex;
+		border-bottom: 1px solid #ddd;
+		margin: 20rpx 0;
+
+		view {
+			width: 25%;
+			font-size: 30rpx;
+			color: #555;
+			text-align: center;
+			padding: 16rpx 0;
+		}
+
+		.on {
+			color: #3a78ff;
+			font-weight: bold;
+			border-bottom: 3px solid #3a78ff;
+		}
+	}
 </style>
\ No newline at end of file
diff --git a/pages/MJGL/shangmudan/MouldUpperBillList.vue b/pages/MJGL/shangmudan/MouldUpperBillList.vue
index 2dd6266..ee00a1d 100644
--- a/pages/MJGL/shangmudan/MouldUpperBillList.vue
+++ b/pages/MJGL/shangmudan/MouldUpperBillList.vue
@@ -281,11 +281,11 @@
 						this.sWhere += " and 鍏抽棴浜�<>''";
 					}
 				}
-				if (this.hform.BenginHCreateDate) {
-					this.sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + this.hform.BenginHCreateDate + "'";
+				if (this.hform.HBeginDate) {
+					this.sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + this.hform.HBeginDate + "'";
 				}
-				if (this.hform.EndHCreateDate) {
-					this.sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + this.hform.EndHCreateDate + "'";
+				if (this.hform.HEndDate) {
+					this.sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + this.hform.HEndDate + "'";
 				}
 				if (this.hform.HBillNo) {
 					this.sWhere += " and 鍗曟嵁鍙� like '%" + this.hform.HBillNo + "%'";
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 82d56ed..a550a52 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -307,6 +307,13 @@
 						id: 35,
 						hidden: false,
 					},
+					{
+						img: '../../static/icon/icon8.png',
+						text: '涓婃ā鍗�',
+						url: `/pages/MJGL/shangmudan/MouldUpperBill`,
+						id: 35,
+						hidden: false,
+					},
 				],
 				// itemData: [{
 				// 		img: '../../static/icon/icon1.png',
diff --git a/pages/index/login.vue b/pages/index/login.vue
index ada1ec5..2fbe988 100644
--- a/pages/index/login.vue
+++ b/pages/index/login.vue
@@ -298,6 +298,19 @@
                                 uni.setStorageSync('login', "login");
                                 uni.setStorageSync('Organization', this.Organization);
                                 uni.setStorageSync('OrganizationID', this.HOrgName);
+								//瀛樺偍閮ㄩ棬 鑱屽憳 浠撳簱 绛変俊鎭�
+								uni.setStorageSync('HDeptID', res.data.data[0].HDeptID); //閮ㄩ棬
+								uni.setStorageSync('HDeptName', res.data.data[0].HDeptName);
+								uni.setStorageSync('HEmpID', res.data.data[0].HEmpID); //鑱屽憳
+								uni.setStorageSync('HEmpName', res.data.data[0].HEmpName);
+								uni.setStorageSync('HSCWHID', res.data.data[0].HSCWHID); //璋冨叆浠撳簱
+								uni.setStorageSync('HSCWHName', res.data.data[0].HSCWHName);
+								uni.setStorageSync('HWhID', res.data.data[0].HWhID);//瀵瑰簲浠撳簱
+								uni.setStorageSync('HWhName', res.data.data[0].HWhName);
+								uni.setStorageSync('HWorkCenterID', res.data.data[0].HWorkCenterID);//宸ヤ綔涓績
+								uni.setStorageSync('HWorkCenterName', res.data.data[0].HWorkCenterName);
+								uni.setStorageSync('HSecManagerID', res.data.data[0].HSecManagerID); //瀵瑰簲楠屾敹
+								uni.setStorageSync('HSecManagerName', res.data.data[0].HSecManagerName);
                                 this.CommonUtils.setServerUrl(this.serverUrl)
                                 uni.reLaunch({
                                     url: '/pages/index/index'
diff --git a/pages/tiaomachaima/tiaomachaima2.vue b/pages/tiaomachaima/tiaomachaima2.vue
index 8bccf81..6f3c636 100644
--- a/pages/tiaomachaima/tiaomachaima2.vue
+++ b/pages/tiaomachaima/tiaomachaima2.vue
@@ -472,7 +472,7 @@
 
 					const item = printData;
 					// 鍑礉濂堢壒鎵撳嵃妯℃澘
-					this.printInfo = `! 0 200 200 500 1
+					this.printInfo = `! 0 200 200 400 1
 			      PAGE-WIDTH 800
 			      SETQRVER 2
 			      B QR 450 120 Q 0 U 4

--
Gitblit v1.9.1