Browse Source

其他入库单模块

LT31650A 1 month ago
parent
commit
f1d78a67bc

+ 4 - 4
api/production_replenishment.js

@@ -1,7 +1,7 @@
-import {
-	request,
-	request1
-} from '@/utils/request'
+import
+request
+from '@/utils/request'
+import request1 from '../utils/requestnew'
 export function getBillList(data) {
 	return request({
 		'url': 'DynamicFormService.BillQuery.common.kdsvc',

+ 107 - 112
pages/storage/index.vue

@@ -14,9 +14,8 @@
 		<view class="table-container" style="height: 100vh;">
 			<scroll-view class="table-content" :style="{'height': clientHeight + 'px'}" scroll-x scroll-y
 				:scroll-into-view="scrollItem">
-				<!-- <scroll-view scroll-x="true" class="scroll-view-header"> -->
 				<view class="table-header">
-					<view class="table-cell">操作</view>
+					<!-- <view class="table-cell">操作</view> -->
 					<view class="table-cell">扫描状态</view>
 					<view class="table-cell1">装箱单号</view>
 					<view class="table-cell">仓位</view>
@@ -27,24 +26,11 @@
 					<view class="table-cell1">计量单位</view>
 					<view class="table-cell">日期</view>
 					<view class="table-cell3">单据编号</view>
-					<!-- <view class="table-cell1">即时库存数量</view>
-					<view class="table-cell">面料订单号</view>
-					<view class="table-cell">等级</view>
-					<view class="table-cell2" v-if="showWorkCenter">工作中心</view>
-					<view class="table-cell" v-if="showRemark">备注</view>
-					<view class="table-cell">仓位原件数</view>
-					<view class="table-cell">发货件数</view>
-					<view class="table-cell">剩余件数</view>
-					<view class="table-cell" v-if="showApplicant">作业申请人</view>
-					<view class="table-cell">仓管员</view> -->
 				</view>
-				<!-- </scroll-view> -->
-				<!-- 	<scroll-view class="table-content" :style="{'height': clientHeight + 'px'}" scroll-x scroll-y
-				:scroll-into-view="scrollItem"> -->
 				<view class="table-row" v-for="(item, index) in indexList" :key="index" :id="'scrollItem-' + index"
 					:style="getStyle(item.smzt)">
-					<view class="table-cell"><button type="default" size="mini" @click="edit(item,index)">编辑</button>
-					</view>
+					<!-- <view class="table-cell"><button type="default" size="mini" @click="edit(item,index)">编辑</button>
+					</view> -->
 					<view class="table-cell">{{ item.smzt? '已扫描' : '未扫描' }}</view>
 					<view class="table-cell1" :style="getStyle(item.smzt)">{{ item["FEnchaseNum.LT"] }}</view>
 					<view class="table-cell">{{ item["FStockLocId.FF102029.FNumber"] }}</view>
@@ -69,8 +55,6 @@
 					style="display: flex;flex-direction: row;margin-top: 8px;font-size: 12px;margin-right: 15px;margin-bottom: 8px;">
 					<view style="margin-right: 15px;">源单明细:{{ indexList.length }}</view>
 					<view style="margin-right: 15px;">已扫描:{{ indexListLength }}</view>
-					<!-- <button type="default" @click="navigateToSearch">仓位</button> -->
-					<!-- <view>剩余件数:{{ balance }}</view> -->
 				</view>
 			</view>
 		</view>
@@ -101,7 +85,7 @@
 		getSaveParam,
 		getSubmitParam
 	} from '../../utils/params';
-	import submitHelper from '@/utils/commonSubmitHelper.js'; // 确保路径正确
+	import submitHelper from '@/utils/storageSubmitHelper.js'; // 确保路径正确
 	import {
 		executeSql
 	} from '../../utils/database';
@@ -202,7 +186,7 @@
 				searchValue: '',
 				scrollItem: '', // 滚动到的指定元素
 				color: '',
-				Location: '', //正操作仓位
+				stockNum: '', //正操作仓库
 				uniqueFStockLocId: [],
 				balance: 0,
 				isStage: false,
@@ -280,42 +264,52 @@
 			})
 			uni.$on('search', (data) => {
 				console.log(data)
-				this.indexList = data
+				console.log(this.indexList)
+				// 遍历 indexList 数组
 				this.indexList.forEach(item => {
-					// item.smzt = 0; // 增加属性 smzt,并设置初始值为0
-					this.$set(item, 'smzt', 0);
-				})
-				// 用于记录每个组合的计数
-				let countMap = {};
-				// 统计每个组合的行数
-				this.indexList.forEach(obj => {
-					// 获取当前对象的组合键
-					let key = obj.FBillNo + '|' + obj['FStockLocId.FF102029.fname'];
-
-					// 如果该组合已经存在于 countMap 中,则增加计数,否则初始化为 1
-					if (countMap[key]) {
-						countMap[key]++;
-					} else {
-						countMap[key] = 1;
+					// 检查 smzt 是否为 1
+					if (item.smzt === 1 && item['FStockLocId.FF102029.FNumber'] == null) {
+						// 修改 FStockLocId.FF102029.FNumber 为 'a'
+						item['FStockLocId.FF102029.FNumber'] = data;
 					}
 				});
 
-				// 将计数值添加到每个对象中
-				this.indexList.forEach(obj => {
-					let key = obj.FBillNo + '|' + obj['FStockLocId.FF102029.fname'];
-					// obj.rowCount = countMap[key];
-					this.$set(obj, 'rowCount', countMap[key])
-				});
-				// 1. 提取不同的仓位
-				this.uniqueFStockLocId = [...new Set(this.indexList.map(obj => obj[
-					'FStockLocId.FF102029.fname']))];
-				console.log(this.uniqueFStockLocId)
-				// this.processQuantity(this.uniqueFStockLocId[0])
-				this.updateIndexList(this.indexList)
-				this.$nextTick(() => {
-					this.searchValue = ''
-					this.isFocus = true;
-				})
+				// this.indexList = data
+				// this.indexList.forEach(item => {
+				// 	// item.smzt = 0; // 增加属性 smzt,并设置初始值为0
+				// 	this.$set(item, 'smzt', 0);
+				// })
+				// // 用于记录每个组合的计数
+				// let countMap = {};
+				// // 统计每个组合的行数
+				// this.indexList.forEach(obj => {
+				// 	// 获取当前对象的组合键
+				// 	let key = obj.FBillNo + '|' + obj['FStockLocId.FF102029.fname'];
+
+				// 	// 如果该组合已经存在于 countMap 中,则增加计数,否则初始化为 1
+				// 	if (countMap[key]) {
+				// 		countMap[key]++;
+				// 	} else {
+				// 		countMap[key] = 1;
+				// 	}
+				// });
+
+				// // 将计数值添加到每个对象中
+				// this.indexList.forEach(obj => {
+				// 	let key = obj.FBillNo + '|' + obj['FStockLocId.FF102029.fname'];
+				// 	// obj.rowCount = countMap[key];
+				// 	this.$set(obj, 'rowCount', countMap[key])
+				// });
+				// // 1. 提取不同的仓位
+				// this.uniqueFStockLocId = [...new Set(this.indexList.map(obj => obj[
+				// 	'FStockLocId.FF102029.fname']))];
+				// console.log(this.uniqueFStockLocId)
+				// // this.processQuantity(this.uniqueFStockLocId[0])
+				// this.updateIndexList(this.indexList)
+				// this.$nextTick(() => {
+				// 	this.searchValue = ''
+				// 	this.isFocus = true;
+				// })
 			})
 			uni.$on('summary', (data) => {
 				console.log(data)
@@ -411,29 +405,6 @@
 					let promises = [];
 					// 遍历 uniqueFStockLocId 数组
 					for (let fname of this.uniqueFStockLocId) {
-						// const data = {
-						// 	"parameters": [{
-						// 		"FormId": "STK_Inventory",
-						// 		"FieldKeys": "fID",
-						// 		"FilterString": [{
-						// 				"Left": "",
-						// 				"FieldName": "FStockLocId.FF102029.FName",
-						// 				"Compare": "67",
-						// 				"Value": fname,
-						// 				"Right": "",
-						// 				"Logic": 0
-						// 			},
-						// 			{
-						// 				"Left": "",
-						// 				"FieldName": "FBaseQty",
-						// 				"Compare": "21",
-						// 				"Value": "0",
-						// 				"Right": "",
-						// 				"Logic": 0
-						// 			}
-						// 		],
-						// 	}]           
-						// };
 						const requestData = createInventoryQueryRequest(fname)
 
 						// 发起异步请求,并将 promise 存储在数组中
@@ -458,33 +429,6 @@
 					console.error('Error updating indexList:', error);
 				}
 			},
-			// // 定义一个函数来创建请求数据
-			//  createInventoryQueryRequest(value) {
-			//   return {
-			//     parameters: [{
-			//       FormId: "STK_Inventory",
-			//       FieldKeys: "fID",
-			//       FilterString: [
-			//         {
-			//           Left: "",
-			//           FieldName: "FStockLocId.FF102029.FName",
-			//           Compare: "67",
-			//           Value: value,
-			//           Right: "",
-			//           Logic: 0
-			//         },
-			//         {
-			//           Left: "",
-			//           FieldName: "FBaseQty",
-			//           Compare: "21",
-			//           Value: "0",
-			//           Right: "",
-			//           Logic: 0
-			//         }
-			//       ]
-			//     }]
-			//   }
-			// },
 			scrollToItem(itemId) {
 				// 设置滚动到的指定元素的 ID
 				this.scrollItem = itemId;
@@ -507,7 +451,7 @@
 			},
 			edit(item, index) {
 				uni.navigateTo({
-					url: '/pages/stock-dispatch/show?item=' + encodeURIComponent(JSON.stringify(
+					url: '/pages/storage/show?item=' + encodeURIComponent(JSON.stringify(
 							item)) +
 						'&&index=' + encodeURIComponent(JSON.stringify(index))
 				});
@@ -538,25 +482,26 @@
 			},
 			//跳转到查询页面
 			navigateToSearch() {
-				if (this.indexList.length > 0) {
+				if (this.indexList.length == 0) {
 					// this.isRangeSelected = false; // 显示错误提示
 					playVoice(audioUrls.failVoiceUrl)
 					uni.showToast({
-						title: '源单已选择',
+						title: '请先扫描',
 						duration: 2000,
 						icon: "error"
 					});
 					return;
 				}
+				console.log(this.stockNum)
 				uni.navigateTo({
 					// url: '/pages/production-replenishment/search', //这是你的当前页面地址
-					url: `/pages/stock-dispatch/search?FormId=${this.formId}&FBillType=${this.fbillType}`
+					url: `/pages/storage/search?stockNum=${this.stockNum}`
 				});
 
 			},
 			navigateToSummary() {
 				uni.navigateTo({
-					url: '/pages/stock-dispatch/summary?Info=' + encodeURIComponent(JSON
+					url: '/pages/storage/summary?Info=' + encodeURIComponent(JSON
 						.stringify(this.indexList)) + '&&stageInfo=' + encodeURIComponent(JSON
 						.stringify(this.stageLists)), //这是你的当前页面地址
 				});
@@ -564,7 +509,7 @@
 			},
 			navigateToStage() {
 				uni.navigateTo({
-					url: '/pages/stock-dispatch/stage?Info=' + encodeURIComponent(JSON
+					url: '/pages/storage/stage?Info=' + encodeURIComponent(JSON
 						.stringify(this.indexList)), //这是你的当前页面地址
 				});
 
@@ -594,6 +539,23 @@
 				}
 				return false
 
+			},
+			isAllPositionsComplete(nowindex) {
+				console.log(this.indexList[nowindex].FBillNo)
+				console.log(this.indexList[nowindex]["FStockLocId.FF102029.FNumber"])
+				if (this.indexList.filter(item =>
+						item["FBillNo"] == this.indexList[nowindex].FBillNo && item["FStockLocId.FF102029.FNumber"] ==
+						null
+					).length == 0) {
+					console.log(this.indexList.filter(item =>
+						item["FBillNo"] == this.indexList[nowindex].FBillNo && item[
+						"FStockLocId.FF102029.FNumber"] ==
+						null
+					).length)
+					return true
+				}
+				return false
+
 			},
 			showToast() {
 				uni.showToast({
@@ -705,6 +667,31 @@
 					}.bind(this)
 				})
 			},
+			showModalAndHandlePosition(nowindex) {
+				let vm = this
+				// console.log(nowindex)
+				let bBillNo = this.indexList[nowindex]["FBillNo"]
+				// let FID = this.indexList[nowindex]["FID"]
+				// this.$nextTick(() => {
+				// 	this.searchValue = ''
+				// 	this.isFocus = true;
+				// })
+				// playVoice(audioUrls.allSuccessVoiceUrl)
+				uni.showModal({
+					title: "提示",
+					content: "单号(" + bBillNo + ")已扫描完毕,请选择仓位",
+					showCancel: true,
+					success: function(res) {
+						if (res.confirm) {
+							// this.submit(FID)
+							this.navigateToSearch()
+						} else {
+
+							// 执行取消后的操作
+						}
+					}.bind(this)
+				})
+			},
 			handleScanSuccess() {
 				// this.Location = this.indexList[nowindex]["FStockLocId.FF102029.fname"]
 				// this.indexList[nowindex].smzt = 1 //修改数据状态
@@ -720,13 +707,15 @@
 					if (this.indexList[i]["FEnchaseNum.LT"] === this.searchValue) {
 						// nowlocation = this.indexList[i]["FStockLocId.FF102029.fname"] //当前仓位
 						nowindex = i //当前索引
+						this.stockNum = this.indexList[nowindex]["FSTOCKID.FNumber"]
 						// this.balance = this.indexList[i]["quantity"] - this.indexList[i]["rowCount"]
 						break;
 					}
 				}
+				console.log(this.stockNum)
 				console.log(this.indexList.filter(obj => obj.smzt === 1).length)
 				const audioUrlsArr = [];
-					audioUrlsArr.push(audioUrls.success2VoiceUrl);
+				audioUrlsArr.push(audioUrls.success2VoiceUrl);
 				// console.log(this.getActualWorkQuantity(this.indexList[nowindex]))
 				//是否全发
 				// if (this.getActualWorkQuantity(this.indexList[nowindex]) == this.indexList[nowindex][
@@ -747,9 +736,15 @@
 				// 	audioUrlsArr.push(audioUrls.storeSuccessUrl);
 				// }
 				if (this.areAllDetailsScanned(nowindex)) { //校验单号是否全扫完
+					//校验仓位是否全填
 					audioUrlsArr.push(audioUrls.allSuccessVoiceUrl)
+					if (this.isAllPositionsComplete(nowindex)) {
+						this.showModalAndHandleSubmit(nowindex)
+					} else {
+						this.showModalAndHandlePosition(nowindex)
+
+					}
 					// playVoice(audioUrls.allSuccessVoiceUrl)
-					this.showModalAndHandleSubmit(nowindex)
 				} else { //单号未全扫完
 					// this.handlePositionScanCompletion()
 					this.$nextTick(() => {
@@ -803,7 +798,7 @@
 								this.$set(item, 'smzt', 0);
 							})
 							// this.indexList = BillList
-							 this.indexList = this.indexList.concat(BillList)
+							this.indexList = this.indexList.concat(BillList)
 							this.handleScanSuccess()
 							// this.indexList = this.indexList.map(item => {
 							// 	if (item["FEnchaseNum.LT"] == this.searchValue) {

+ 98 - 149
pages/storage/search.vue

@@ -3,85 +3,41 @@
 		<!-- 查询框 -->
 		<view class="container">
 			<view class="search-container">
-				<uni-easyinput prefixIcon="search" v-model="BillNo" placeholder="请输入单号" style="margin-right: 5px;">
+				<uni-easyinput prefixIcon="search" v-model="stockLocNum" placeholder="请输入仓位" style="margin-right: 5px;">
 				</uni-easyinput>
 				<button class="search-button" @click="search">查询</button>
 			</view>
-			<view style="padding:0 5px 2px 5px;">
+			<!-- <view style="padding:0 5px 2px 5px;">
 				<uni-datetime-picker v-model="range" type="daterange" @maskClick="maskClick" />
-			</view>
+			</view> -->
 		</view>
 		<!-- 表格容器 -->
-		<scroll-view class="table-scroll" scroll-x scroll-y @scroll="onScroll">
-			<!-- 表头 -->
-			<view class="table-header" ref="tableHeader" v-if="formId === 'PUR_MRB'">
-				<view class="table-cell1">单据编号</view>
-				<view class="table-cell">仓管员</view>
-				<view class="table-cell"
-					style="background-color: #f0f0f0;font-weight: bold;border-bottom: 1px solid #ccc;">供应商</view>
-				<view class="table-cell1"
-					style="background-color: #f0f0f0;font-weight: bold;border-bottom: 1px solid #ccc;">采购员</view>
-				<view class="table-cell"
-					style="background-color: #f0f0f0;font-weight: bold;border-bottom: 1px solid #ccc;">采购部门</view>
-				<view class="table-cell"
-					style="background-color: #f0f0f0;font-weight: bold;border-bottom: 1px solid #ccc;">单据日期</view>
-			</view>
+		<scroll-view class="table-scroll" scroll-y @scroll="onScroll">
 			<!-- 表头 -->
-			<view class="table-header" ref="tableHeader" v-else>
-				<view class="table-cell1">工作中心</view>
-				<view class="table-cell">作业申请人</view>
-				<view class="table-cell"
-					style="background-color: #f0f0f0;font-weight: bold;border-bottom: 1px solid #ccc;">仓管员</view>
-				<view class="table-cell1"
-					style="background-color: #f0f0f0;font-weight: bold;border-bottom: 1px solid #ccc;">单据编号</view>
-				<view class="table-cell"
-					style="background-color: #f0f0f0;font-weight: bold;border-bottom: 1px solid #ccc;">单据日期</view>
-				<view class="table-cell"
-					style="background-color: #f0f0f0;font-weight: bold;border-bottom: 1px solid #ccc;">备注</view>
+			<view class="table-header" ref="tableHeader">
+				<view class="table-cell1">仓位编号</view>
 			</view>
-
 			<!-- 表格内容 -->
-			<view class="table-body" v-if="formId === 'PUR_MRB'">
-				<checkbox-group @change="checkboxChange">
-					<view class="table-row" v-for="(item, index) in BillList" :key="item.FID">
-						<view class="table-cell1-1">
-							<checkbox :value="item.FID" :checked="item.checked" />
-							{{ item["FBillNo"]}}
+			<view class="table-body">
+				<!-- <checkbox-group @change="checkboxChange"> -->
+				<view class="table-row" v-for="(item, index) in stockList" :key="item.FStockLocNum">
+					<!-- <view class="table-cell1"> -->
+					<!-- <checkbox :value="item.FID" :checked="item.checked" />{{ item.FBillNo}} -->
+					<view class="checkbox-container">
+						<checkbox :value="item.FStockLocNum" :checked="item.checked"
+							@tap="handleCheckboxClick(item.FStockLocNum)" />
+						<view style="display: flex; justify-content: center; align-items: center;">
+							{{ item.FStockLocNum}}
 						</view>
-						<view class="table-cell">{{ item["FSTOCKERID.fname"] }}</view>
-						<view class="table-cell">{{ item["FSupplierID.fname"] }}</view>
-						<view class="table-cell1">{{ item["FPURCHASERID.fname"] }}</view>
-						<view class="table-cell">{{ item["FPURCHASEDEPTID.fname"] }}</view>
-						<view class="table-cell">{{ item["FDate"].substring(0, 10) }}</view>
-
 					</view>
-				</checkbox-group>
-			</view>
-			<view class="table-body" v-else>
-				<checkbox-group @change="checkboxChange">
-					<view class="table-row" v-for="(item, index) in BillList" :key="item.FID">
-						<view class="table-cell1-1" v-if="formId === 'LT_PRD_PMCWorkBench'">
-							<checkbox :value="item.FID" :checked="item.checked" />
-							{{ item["FWorkCenterId.LT.fname"]}}
-						</view>
-						<view class="table-cell1-1" v-else-if="formId === 'SP_PickMtrl'">
-							<checkbox :value="item.FID" :checked="item.checked" />
-							{{ item["FWorkCenterId.fname"]}}
-						</view>
-						<view class="table-cell1-1" v-else>
-							<checkbox :value="item.FID" :checked="item.checked" />
-							{{ item["FWorkCenterId.LT.fname"]}}
-						</view>
-						<view class="table-cell">{{ item["FApplicantId.fname"] }}</view>
-						<view class="table-cell">{{ item["FSTOCKERID.fname"] }}</view>
-						<view class="table-cell1-1">{{ item["FBillNo"] }}</view>
-						<view class="table-cell">{{ item["FDate"].substring(0, 10) }}</view>
-						<view class="table-cell">{{ item["FDescription"] }}</view>
 
-					</view>
-				</checkbox-group>
+					<!-- </view> -->
+
+				</view>
+				<!-- </checkbox-group> -->
 			</view>
 		</scroll-view>
+
 		<!-- 底部按钮 -->
 		<view class="bottom-bar">
 			<button class="mini-btn button" type="primary" size="default" @click="submit">确定</button>
@@ -94,7 +50,8 @@
 <script>
 	import {
 		getBillList,
-		getBillDetailList
+		getBillDetailList,
+		Querylocation
 	} from '../../api/production_replenishment';
 	import modal from '../../plugins/modal';
 	import {
@@ -110,18 +67,26 @@
 		data() {
 			return {
 				formId: '',
-				BillNo: '',
+				stockLocNum: '',
+				selectedItemId: null,
 				range: [], //正式
 				// range: ["2024-07-27",
 				// 	"2024-07-27"
 				// ], //测试
 				selected: [], // 保存每个数据项是否被选中的状态
 				// isRangeSelected: true // 标记是否选择了日期范围,默认为 true
-				BillList: [],
+				stockList: [],
 				BillDetailList: [],
+				stockNum: ''
 				// filteredData: [] // 过滤后的数据
 			};
 		},
+		onLoad(option) {
+			console.log(option)
+			this.stockNum = option.stockNum
+			// this.stageLists = JSON.parse(decodeURIComponent(option.stageInfo))
+			console.log(this.stockNum)
+		},
 		computed: {
 
 		},
@@ -167,50 +132,18 @@
 				console.log(items)
 			},
 			async submit() {
-				if (this.selected.length === 0) {
-					modal.msgError("请先选择")
-					playVoice(audioUrls.failVoiceUrl)
-					return;
-				}
-				try {
-					// let self = this
-					// 获取请求条件
-					const condition = this.createSubmitCondition();
-					const billDetailListParam = getBillDetailListParam(condition)
-					const res = await this.fetchBillDetails(billDetailListParam)
-					this.BillDetailList = res;
-					this.navigateBack();
-				} catch (error) {
+				if (this.selectedItemId == null) {
+					modal.msgError("请选择仓位")
 					playVoice(audioUrls.failVoiceUrl)
-					console.error('操作失败:', error);
-					modal.confirm(error|| '操作失败').then(res => {
-						if (res) {
-
-						} else {
-							// 用户点击取消,不执行任何操作
-						}
-					})
+					return
 				}
-				// getBillDetailList(JSON.stringify(billDetailListParam)).then(
-				// 	res => {
-				// 		console.log(res)
-				// 		this.BillDetailList = res
-				// 		uni.navigateBack({
-				// 			success: function() {
-				// 				// 传递数据给上一页
-				// 				uni.$emit('search', self.BillDetailList);
-				// 			}
-				// 		});
-
-				// 	}
-				// )
-
+				this.navigateBack();
 			},
 			// 返回上一页并传递数据
 			navigateBack() {
 				uni.navigateBack({
 					success: () => {
-						uni.$emit('search', this.BillDetailList);
+						uni.$emit('search', this.selectedItemId);
 					}
 				});
 			},
@@ -239,42 +172,23 @@
 				};
 			},
 			search() {
-				console.log(this.range)
-				// 检查是否选择了日期范围
-				if (this.range.length === 0) {
-					modal.msgError("请选择日期范围")
-					playVoice(audioUrls.failVoiceUrl)
-					return;
-				}
-				// const condition = {
-				// 	"FormId": uni.getStorageSync('formId'),
-				// 	"FBillType": uni.getStorageSync('fbillType'),
-				// 	"FStockOrgId": uni.getStorageSync('FStockOrgId'),
-				// 	"billNo": this.BillNo,
-				// 	"range": this.range
-				// }
-				const condition = this.createSearchCondition(this.range, this.BillNo);
-				const searchParam = getSearchParam(condition)
 				modal.loading('获取数据中,请耐心等待...')
-				getBillList(JSON.stringify(searchParam)).then(
-					res => this.handleResponse(res)
-					// res => {
-					// 	modal.closeLoading()
-
-					// 	console.log(res)
-					// 	if (res.length === 0) {
-					// 		console.log("dafafadf")
-					// 		modal.msg("请确认输入条件有效!")
-					// 		playVoice(audioUrls.failVoiceUrl)
-					// 		return
-					// 	}
-					// 	// 使用 Set 和 JSON.stringify 进行去重,会获取到明细数据
-					// 	let uniqueArray = Array.from(new Set(res.map(item => JSON.stringify(item)))).map(item =>
-					// 		JSON.parse(item))
-					// 	console.log(uniqueArray)
-					// 	this.BillList = uniqueArray
-					// }
-				)
+				let data = {
+					usertoken: "99302b4923aa42298c5922b7b68bcff9",
+					stockNum: this.stockNum,
+					stockLocNum: this.stockLocNum
+				}
+				Querylocation(data).then(res => {
+					console.log(res);
+					this.handleResponse(res)
+				})
+				// console.log(this.range)
+				// const condition = this.createSearchCondition(this.range, this.BillNo);
+				// const searchParam = getSearchParam(condition)
+				// modal.loading('获取数据中,请耐心等待...')
+				// getBillList(JSON.stringify(searchParam)).then(
+				// 	res => this.handleResponse(res)
+				// )
 			},
 			handleResponse(res) {
 				// 关闭加载提示
@@ -286,14 +200,36 @@
 					return;
 				}
 				// 处理数据去重并更新状态
-				this.updateBillList(res);
+				this.updateStockList(res);
 			},
-			updateBillList(data) {
+			updateStockList(data) {
 				// 使用 Set 和 JSON.stringify 进行去重
-				let uniqueArray = Array.from(new Set(data.map(item => JSON.stringify(item)))).map(item =>
-					JSON.parse(item));
-				console.log(uniqueArray);
-				this.BillList = uniqueArray;
+				// let uniqueArray = Array.from(new Set(data.map(item => JSON.stringify(item)))).map(item =>
+				// 	JSON.parse(item));
+				// console.log(uniqueArray);
+				console.log(data)
+				this.stockList = data.results;
+				console.log(this.stockList)
+			},
+			handleCheckboxClick(itemId) {
+				console.log(itemId)
+				// 取消之前选中的项
+				if (this.selectedItemId === itemId) {
+					this.selectedItemId = null;
+					this.stockList.forEach(item => {
+						item.checked = false;
+					});
+					console.log(this.stockList)
+				} else {
+					// 更新选中项
+					this.selectedItemId = itemId;
+					this.stockList.forEach(item => {
+						item.checked = (item.FStockLocNum === itemId);
+					});
+					console.log(this.stockList)
+				}
+				console.log(this.selectedItemId)
+				this.$forceUpdate()
 			},
 		}
 	};
@@ -354,7 +290,7 @@
 	}
 
 	.table-cell1 {
-		min-width: 150px;
+		width: 100%;
 		padding: 10px;
 		text-align: center;
 		border-right: 1px solid #ccc;
@@ -381,12 +317,13 @@
 
 	.table-body {
 		flex: 1;
-		width: fit-content;
+		/* width: fit-content; */
 		/* 使内容宽度适应内容的宽度 */
 	}
 
 	.table-row {
-		display: flex;
+		width: 100%;
+		/* display: flex; */
 		border-bottom: 1px solid #ccc;
 	}
 
@@ -413,4 +350,16 @@
 		margin: 0 10px;
 		/* padding: 10px 20px; */
 	}
+
+	.checkbox-container {
+		width: 100%;
+		padding: 10px;
+		/* text-align: center; */
+		border-right: 1px solid #ccc;
+		display: flex;
+		align-items: center;
+		/* 	margin-left: 10px;
+		margin-right: 10px; */
+		/* 可根据需要调整间距 */
+	}
 </style>

+ 1 - 0
pages/storage/summary.vue

@@ -309,6 +309,7 @@
 		justify-content: left;
 		align-items: center;
 		border-right: 1px solid #ccc;
+		/* border: 1px solid red; */
 	}
 
 	.table-cell1-1 {

+ 1 - 19
utils/newparams.js

@@ -1,16 +1,10 @@
 // 定义字段映射
 const FieldKeysMap = {
-<<<<<<< Updated upstream
 	"STK_MisDelivery": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FWorkCenterId.fname,FDate,FEntryNote,FPickingPeople_LT.fname,FSTOCKERID.fname,FWorkDeptId_LT.fname,FDeptId.FName,FPickerId.FName",
 	"SP_PickMtrl": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FActualQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FWorkCenterId.fname,FEntrtyMemo,FDate,FPickerId.fname,FSTOCKERID.fname,FStockActualQty,FWorkShopId.fname,FPickingPeople_LT.FName",
 	"LT_PRD_PMCWorkBench": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FActualQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FWorkCenterId_LT.fname,FEntrtyMemo,FDate,FApplicantId.fname,FSTOCKERID.fname,FStockActualQty,FWorkShopId.fname",
-=======
-	"STK_MisDelivery": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FWorkCenterId.fname,FDate,FEntryNote,FPickingPeople_LT.fname,FSTOCKERID.fname,FWorkDeptId_LT.fname",
-	"SP_PickMtrl": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FActualQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FWorkCenterId.fname,FEntrtyMemo,FDate,FPickerId.fname,FSTOCKERID.fname,FStockActualQty,FWorkShopId.fname",
-	"LT_PRD_PMCWorkBench": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FActualQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FEWorkCenterId_LT.fname,FEntrtyMemo,FDate,FApplicantId.fname,FSTOCKERID.fname,FStockActualQty,FWorkShopId.fname",
->>>>>>> Stashed changes
 	"PUR_MRB": "FID,FPURMRBENTRY_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FInventoryQty,FENCHASENUM_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FDate,FSTOCKERID.fname,FStockId.FNumber,FRMREALQTY,FFabricOrderNo,FPURCHASERID.fname",
-	"STK_MISCELLANEOUS": "FID,FEnchaseNum_LT,FSTOCKID.FName,FStockLocId.FF102029.FNumber,FMATERIALID.FNumber,FLOT.FNumber,FQty,FUnitID.FName,FDate,FBillNo"
+	"STK_MISCELLANEOUS": "FID,FEntity_FEntryID,FEnchaseNum_LT,FSTOCKID.FName,FStockLocId.FF102029.FNumber,FMATERIALID.FNumber,FLOT.FNumber,FQty,FUnitID.FName,FDate,FBillNo,FSTOCKID.FNumber"
 };
 
 export function getSearchParam(condition) {
@@ -104,19 +98,11 @@ export function getSearchParam(condition) {
 			"Logic": 0
 		});
 		FieldKeys =
-<<<<<<< Updated upstream
 			"FID,FWorkCenterId.fname,FPickingPeople_LT.fname,FSTOCKERID.fname,FBillNo,FDate,FNote,FStockOrgId,FDeptId.FName,FPickerId.FName"
 	}
 	if (condition.FormId == "SP_PickMtrl") { //简单生产领料单
 		FieldKeys =
 			"FID,FWorkCenterId.fname,FPickerId.fname,FSTOCKERID.fname,FBillNo,FDate,FDescription,FStockOrgId,FPickingPeople_LT.FName"
-=======
-			"FID,FWorkCenterId.fname,FPickingPeople_LT.fname,FSTOCKERID.fname,FBillNo,FDate,FNote,FStockOrgId"
-	}
-	if (condition.FormId == "SP_PickMtrl") { //简单生产领料单
-		FieldKeys =
-			"FID,FWorkCenterId.fname,FPickerId.fname,FSTOCKERID.fname,FBillNo,FDate,FDescription,FStockOrgId"
->>>>>>> Stashed changes
 	}
 	if (condition.FormId == "PUR_MRB") { //采购退料单
 		FieldKeys =
@@ -190,11 +176,7 @@ export function getStorageByBillNoParam(condition) {
 		"parameters": [{
 			"FormId": condition.FormId,
 			"FieldKeys": FieldKeysMap[condition.FormId],
-<<<<<<< Updated upstream
 			"FilterString": [{
-=======
-			"FilterString":  [{
->>>>>>> Stashed changes
 				"Left": "",
 				"FieldName": "FBillNo",
 				"Compare": "338",

+ 4 - 0
utils/requestnew.js

@@ -50,6 +50,8 @@ const request1 = config => {
 			success: res => {
 				if (res.statusCode == 200) {
 					xml2js.parseString(res.data, (err, result) => {
+						console.log(err)
+						console.log(result)
 						if (err) {
 							reject(err);
 						}
@@ -64,10 +66,12 @@ const request1 = config => {
 					});
 				} else {
 					reject("获取数据失败!")
+					console.log(res)
 				}
 
 			},
 			fail: err => {
+				console.log("获取数据失败")
 				reject(err)
 			},
 			complete: () => {

+ 362 - 0
utils/storageParams.js

@@ -0,0 +1,362 @@
+// 定义字段映射
+const FieldKeysMap = {
+	"STK_MisDelivery": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FWorkCenterId.fname,FDate,FEntryNote,FPickingPeople_LT.fname,FSTOCKERID.fname,FWorkDeptId_LT.fname,FDeptId.FName,FPickerId.FName",
+	"SP_PickMtrl": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FActualQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FWorkCenterId.fname,FEntrtyMemo,FDate,FPickerId.fname,FSTOCKERID.fname,FStockActualQty,FWorkShopId.fname,FPickingPeople_LT.FName",
+	"LT_PRD_PMCWorkBench": "FID,FEntity_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FActualQty,FInventoryQty,FENCHASENUM_LT,FFabricOrderNo,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FWorkCenterId_LT.fname,FEntrtyMemo,FDate,FApplicantId.fname,FSTOCKERID.fname,FStockActualQty,FWorkShopId.fname",
+	"PUR_MRB": "FID,FPURMRBENTRY_FEntryID,FBillNo,FStockLocId.FF102029.fname,FMaterialId.fnumber,FBOXNO_LT,FInventoryQty,FENCHASENUM_LT,FInventoryQty,FAuxPropId.FF101501.FDATAVALUE,Flot.FNumber,FDate,FSTOCKERID.fname,FStockId.FNumber,FRMREALQTY,FFabricOrderNo,FPURCHASERID.fname",
+	"STK_MISCELLANEOUS": "FID,FEnchaseNum_LT,FSTOCKID.FName,FStockLocId.FF102029.FNumber,FMATERIALID.FNumber,FLOT.FNumber,FQty,FUnitID.FName,FDate,FBillNo,FSTOCKID.FNumber"
+};
+
+export function getSearchParam(condition) {
+	let FilterString = [{ //其他出库
+			"Left": "(",
+			"FieldName": "FDocumentStatus",
+			"Compare": "105",
+			"Value": "A",
+			"Right": "",
+			"Logic": 1
+		},
+		// {//审核中
+		// 	"Left": "",
+		// 	"FieldName": "FDocumentStatus",
+		// 	"Compare": "105",
+		// 	"Value": "B",
+		// 	"Right": "",
+		// 	"Logic": 1
+		// },
+		{
+			"Left": "",
+			"FieldName": "FDocumentStatus",
+			"Compare": "105",
+			"Value": "D",
+			"Right": ")",
+			"Logic": 0
+		}, {
+			"Left": "",
+			"FieldName": "FStockOrgId.FNumber",
+			"Compare": "67",
+			"Value": condition.FStockOrgId,
+			"Right": "",
+			"Logic": 0
+		},
+		{
+			"FieldName": "FBillNo",
+			"Compare": "17",
+			"Value": condition.billNo,
+			"Left": "",
+			"Right": "",
+			"Logic": 0
+		},
+		{
+			"Left": "",
+			"FieldName": "FStockId.FName",
+			"Compare": "17",
+			"Value": "面料",
+			"Right": "",
+			"Logic": 0
+		},
+		{
+			"FieldName": "FDate",
+			"Compare": "39",
+			"Value": condition.range[0],
+			"Left": "(",
+			"Right": "",
+			"Logic": "0"
+		},
+		{
+			"FieldName": "FDate",
+			"Compare": "16",
+			"Value": condition.range[1],
+			"Left": "",
+			"Right": ")",
+			"Logic": "0"
+		}
+	]
+	let FieldKeys =
+		"FID,FWorkCenterId.fname,FPickingPeople_LT.fname,FSTOCKERID.fname,FBillNo,FDate,FNote,FStockOrgId"
+	console.log(condition.FBillType)
+	if (condition.FBillType != null) { //领料
+		FilterString.push({
+			"Left": "",
+			"FieldName": "FBillType",
+			"Compare": "105",
+			"Value": condition.FBillType,
+			"Right": "",
+			"Logic": 0
+		});
+		console.log('aaaa')
+		FieldKeys =
+			"FID,FWorkCenterId_LT.fname,FApplicantId.fname,FSTOCKERID.fname,FBillNo,FDate,FDescription,FStockOrgId"
+	}
+	if (condition.FormId == "STK_MisDelivery") { //其他出库
+		FilterString.push({
+			"Left": "",
+			"FieldName": "FStockDirect",
+			"Compare": "29",
+			"Value": "GENERAL",
+			"Right": "",
+			"Logic": 0
+		});
+		FieldKeys =
+			"FID,FWorkCenterId.fname,FPickingPeople_LT.fname,FSTOCKERID.fname,FBillNo,FDate,FNote,FStockOrgId,FDeptId.FName,FPickerId.FName"
+	}
+	if (condition.FormId == "SP_PickMtrl") { //简单生产领料单
+		FieldKeys =
+			"FID,FWorkCenterId.fname,FPickerId.fname,FSTOCKERID.fname,FBillNo,FDate,FDescription,FStockOrgId,FPickingPeople_LT.FName"
+	}
+	if (condition.FormId == "PUR_MRB") { //采购退料单
+		FieldKeys =
+			"FID,FSupplierID.fname,FPURCHASERID.fname,FPURCHASEDEPTID.fname,FSTOCKERID.fname,FBillNo,FDate,FStockOrgId"
+	}
+	console.log(FieldKeys)
+
+	return {
+		"parameters": [{
+			"FormId": condition.FormId,
+			"FieldKeys": FieldKeys,
+			"FilterString": FilterString
+		}]
+	}
+}
+export function getStorageSearchParam(condition) {
+	let FilterString = [{
+		"Left": "(",
+		"FieldName": "FDocumentStatus",
+		"Compare": "105",
+		"Value": "A",
+		"Right": "",
+		"Logic": 1
+	}, {
+		"Left": "",
+		"FieldName": "FDocumentStatus",
+		"Compare": "105",
+		"Value": "D",
+		"Right": ")",
+		"Logic": 0
+	}, {
+		"Left": "",
+		"FieldName": "FStockDirect",
+		"Compare": "29",
+		"Value": "GENERAL",
+		"Right": "",
+		"Logic": 0
+	}, {
+		"Left": "(",
+		"FieldName": "FEntryStoreType_LT.FDataValue",
+		"Compare": "67",
+		"Value": "自产入库",
+		"Right": "",
+		"Logic": 1
+	}, {
+		"Left": "",
+		"FieldName": "FEntryStoreType_LT.FDataValue",
+		"Compare": "67",
+		"Value": "衬衣面料内部调入",
+		"Right": ")",
+		"Logic": 0
+	}, {
+		"Left": "",
+		"FieldName": "FEnchaseNum_LT",
+		"Compare": "67",
+		"Value": condition.FEnchaseNum_LT,
+		"Right": "",
+		"Logic": 0
+	}]
+
+	return {
+		"parameters": [{
+			"FormId": condition.FormId,
+			"FieldKeys": FieldKeysMap[condition.FormId],
+			"FilterString": FilterString,
+		}]
+	}
+}
+export function getStorageByBillNoParam(condition) {
+	return {
+		"parameters": [{
+			"FormId": condition.FormId,
+			"FieldKeys": FieldKeysMap[condition.FormId],
+			"FilterString": [{
+				"Left": "",
+				"FieldName": "FBillNo",
+				"Compare": "338",
+				"Value": condition.FBillNo,
+				"Right": "",
+				"Logic": 0
+			}],
+		}]
+	}
+}
+export function getBillDetailListParam(condition) {
+	console.log(condition)
+	return {
+		"parameters": [{
+			"FormId": condition.FormId,
+			"FieldKeys": FieldKeysMap[condition.FormId],
+			"FilterString": [{
+				"Left": "",
+				"FieldName": "FID",
+				"Compare": "338",
+				"Value": condition.selectedFID,
+				"Right": "",
+				"Logic": 0
+			}],
+		}]
+	}
+
+}
+// 定义一个函数来创建库存查询请求数据
+export function createInventoryQueryRequest(value) {
+	return {
+		parameters: [{
+			FormId: "STK_Inventory",
+			FieldKeys: "fID",
+			FilterString: [{
+					Left: "",
+					FieldName: "FStockLocId.FF102029.FName",
+					Compare: "67",
+					Value: value,
+					Right: "",
+					Logic: 0
+				},
+				{
+					Left: "",
+					FieldName: "FBaseQty",
+					Compare: "21",
+					Value: "0",
+					Right: "",
+					Logic: 0
+				}
+			]
+		}]
+	};
+}
+
+function getActualQtyKey(FormId) {
+	const keyMap = {
+		'LT_PRD_PMCWorkBench': 'FActualQty',
+		'SP_PickMtrl': 'FActualQty',
+		'STK_MisDelivery': 'FQty',
+		'PUR_MRB': 'FRMREALQTY'
+	};
+	return keyMap[FormId] || 'FQty';
+}
+    // {
+    //     "FID": 1433700,
+    //     "FEnchaseNum.LT": "877895251",
+    //     "FSTOCKID.FName": "总公司衬衣面料仓库(国内)",
+    //     "FStockLocId.FF102029.FNumber": null,
+    //     "FMATERIALID.FNumber": "ML92730-222034LAM",
+    //     "FLOT.FNumber": "999423132132",
+    //     "FQty": 10000,
+    //     "FUnitID.FName": "米",
+    //     "FDate": "2024-09-04T00:00:00",
+    //     "FBillNo": "QTRK2409040002",
+    //     "FSTOCKID.FNumber": "MLCK003",
+    //     "smzt": 1
+    // },
+function createEntityObject(item, actualQtyKey) {
+	return {
+		"FEntryID": item["FEntity.FEntryID"],
+		// "FInventoryQty": item["FInventoryQty"],
+		// "FAuxPropId": {
+		// 	"FAUXPROPID__FF101501": {
+		// 		"FNumber": item["FAuxPropId.FF101501.FDATAVALUE"]
+		// 	}
+		// },
+		"FStockLocId": {
+			"FSTOCKLOCID__FF102029": {
+				"Fnumber": item["FStockLocId.FF102029.FNumber"]
+				
+			}
+		},
+		// "FLot": {
+		// 	"FNumber": item["Flot.FNumber"]
+		// },
+		// "FENCHASENUM_LT": item["FENCHASENUM.LT"],
+		// [actualQtyKey]: item[actualQtyKey] // 使用动态键名
+	};
+}
+
+export function getSaveParam(FormId, data, indexList) {
+	const targetFID = data;
+	// const actualQtyKey = getActualQtyKey(FormId);
+
+	const FEntityObjects = indexList
+		.filter(item => item.FID === targetFID)
+		.map(item => createEntityObject(item));
+
+	const needUpdateFields = [
+		// "FInventoryQty",
+		// "FAuxPropId",
+		"FStockLocId",
+		"FIsScanFabric",
+		// "FLot",
+		// "FENCHASENUM_LT",
+		// actualQtyKey // 直接添加到数组中
+	];
+
+	return {
+		"parameters": [
+			FormId,
+			{
+				"NeedUpDateFields": needUpdateFields,
+				"NeedReturnFields": ["FID"],
+				"IsDeleteEntry": "true",
+				"SubSystemId": "",
+				"IsVerifyBaseDataField": "false",
+				"IsEntryBatchFill": "true",
+				"ValidateFlag": "true",
+				"NumberSearch": "true",
+				"IsAutoAdjustField": "false",
+				"InterationFlags": "",
+				"IgnoreInterationFlag": "",
+				"IsControlPrecision": "false",
+				"ValidateRepeatJson": "false",
+				"Model": {
+					"FID": targetFID,
+					"FIsScanFabric": true,
+					"FEntity": FEntityObjects
+				}
+			}
+		]
+	};
+}
+export function getSubmitParam(FormId, data) {
+	const params = {
+		"parameters": [
+			FormId,
+			{
+				"CreateOrgId": 0,
+				"Numbers": [],
+				"Ids": data.toString(),
+				"SelectedPostId": 0,
+				"UseOrgId": 0,
+				"NetworkCtrl": "",
+				"IgnoreInterationFlag": ""
+			}
+		]
+	};
+	console.log(params);
+	return params;
+}
+export function getAuditParam(FormId, data) {
+	const params = {
+		"parameters": [
+			FormId,
+			{
+				"CreateOrgId": 0,
+				"Numbers": [],
+				"Ids": data.toString(),
+				"InterationFlags": "",
+				"UseOrgId": 0,
+				"NetworkCtrl": "",
+				"IsVerifyProcInst": "true",
+				"IgnoreInterationFlag": "",
+				"UseBatControlTimes": "false"
+			}
+		]
+	}
+	console.log(params)
+	return params
+}

+ 93 - 0
utils/storageSubmitHelper.js

@@ -0,0 +1,93 @@
+import {
+	audit,
+	save,
+	submit
+} from '../api/production_replenishment.js';
+import modal from '../plugins/modal.js';
+import {
+	audioUrls,
+	playVoice
+} from './audio2.js';
+import {
+	getSaveParam,
+	getSubmitParam,
+	getAuditParam
+} from './storageParams.js';
+
+
+export default {
+	async submit(FormId,FID, indexList) {
+		try {
+			modal.loading("提交中,请耐心等待...");
+			const saveParam = getSaveParam(FormId,FID, indexList);
+			console.log(saveParam)
+			const saveRes = await this.saveData(saveParam);
+			if (!saveRes.IsSuccess) {
+				throw new Error(saveRes.Errors[0].Message);
+			}
+
+			const submitParam = getSubmitParam(FormId,FID);
+			const submitRes = await this.submitData(submitParam);
+			if (!submitRes.IsSuccess) {
+				throw new Error(submitRes.Errors[0].Message);
+			}
+
+			const auditParam = getAuditParam(FormId,submitRes.SuccessEntitys[0].Id);
+			const auditRes = await this.auditData(auditParam);
+			if (!auditRes.IsSuccess) {
+				throw new Error(auditRes.Errors[0].Message);
+			}
+
+			this.handleSuccess(FID, indexList);
+
+		} catch (error) {
+			// this.handleError(error);
+			throw new Error(error);
+		} finally {
+			modal.closeLoading();
+		}
+	},
+
+	saveData(params) {
+		return save(JSON.stringify(params))
+			.then(res => res.Result.ResponseStatus);
+	},
+
+	submitData(params) {
+		return submit(JSON.stringify(params))
+			.then(res => res.Result.ResponseStatus);
+	},
+
+	auditData(params) {
+		return audit(JSON.stringify(params))
+			.then(res => res.Result.ResponseStatus);
+	},
+
+	handleSuccess(FID, indexList) {
+
+		// Assuming that you pass indexList back to where it's needed
+		uni.showModal({
+			title: "提示",
+			content: "提交成功",
+			showCancel: true,
+			success: (res) => {
+				if (res.confirm) {
+					// 用户点击确定
+				} else {
+					// 用户点击取消
+				}
+			}
+		});
+		playVoice(audioUrls.warningSuccessUrl);
+	},
+
+	handleError(error) {
+		uni.showToast({
+			title: error.message || '操作失败',
+			duration: 3000,
+			icon: "error"
+		});
+		playVoice(audioUrls.successVoiceUrl)
+		console.error('操作失败:', error);
+	}
+};