From 33ad9bff8eb0e6be50efbaab76ae71c76b6e218b Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期四, 21 八月 2025 14:17:33 +0800
Subject: [PATCH] PDA报工页面投料产量和汇报产量放到主页面,调整逻辑,接口联调,取消报工页面逻辑梳理,接口联调

---
 pages/product/report/index.vue |  148 +++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 119 insertions(+), 29 deletions(-)

diff --git a/pages/product/report/index.vue b/pages/product/report/index.vue
index 6129956..ac3a2e4 100644
--- a/pages/product/report/index.vue
+++ b/pages/product/report/index.vue
@@ -23,40 +23,48 @@
 			<u-form-item label="闆朵欢鎻忚堪" :border-bottom="false" prop="partName" style="font-size:small">
 				<u-input v-model="form.partName" placeholder="" disabled />
 			</u-form-item>
-			<u-form-item label="鎵归噺澶у皬" :border-bottom="false" prop="qtyRequired" style="font-size:small">
+			<!-- <u-form-item label="鎵归噺澶у皬" :border-bottom="false" prop="qtyRequired" style="font-size:small">
 				<u-input v-model="form.qtyRequired" placeholder="" disabled />
 			</u-form-item>
 			<u-form-item label="鍓╀綑鏁伴噺" :border-bottom="false" prop="Jianqtyfinished" style="font-size:small">
 				<u-input v-model="form.Jianqtyfinished" placeholder="" disabled />
+			</u-form-item> -->
+			<u-form-item label="鎶曟枡浜ч噺" :border-bottom="false" prop="FeedInputProductionVolume" style="font-size:small">
+				<u-input v-model="form.FeedInputProductionVolume" type="select" placeholder="璇峰~鍐欐姇鏂欎骇閲�"
+					@click="FeedInputProductionVolumeCLick" />
+			</u-form-item>
+			<u-form-item label="姹囨姤浜ч噺" :border-bottom="false" prop="reportProductionVolume" style="font-size:small">
+				<u-input v-model="form.reportProductionVolume" type="select" placeholder="璇峰~鍐欐眹鎶ヤ骇閲�"
+					@click="reportProductionVolumeCLick" />
 			</u-form-item>
 			<u-form-item label="搴撲綅" :border-bottom="false" prop="proposedLocation" style="font-size:small">
 				<u-input v-model="form.proposedLocation" placeholder="" disabled />
 			</u-form-item>
-			<u-form-item label="鎶ュ伐绫诲瀷" label-width="90px" prop="productType" style="font-size:small">
+			<!-- <u-form-item label="鎶ュ伐绫诲瀷" label-width="90px" prop="productType" style="font-size:small">
 				<u-radio-group v-model="form.productType" :disabled="subdisabled">
 					<u-radio name="dep"><span style="font-size:small">涓嬫満鎶ュ伐</span></u-radio>
 					<u-radio name="ndep"><span style="font-size:small">鏈笅鏈烘姤宸�</span></u-radio>
 				</u-radio-group>
-			</u-form-item>
-			<u-form-item label="鎺ユ敹闆朵欢" label-width="90px" prop="receive" style="font-size:small">
+			</u-form-item> -->
+			<!-- <u-form-item label="鎺ユ敹闆朵欢" label-width="90px" prop="receive" style="font-size:small">
 				<u-radio-group v-model="form.receive" :disabled="subdisabled">
 					<u-radio name="mo"><span style="font-size:small">杞﹂棿璁㈠崟</span></u-radio>
 					<u-radio name="part"><span style="font-size:small">鏇夸唬闆朵欢</span></u-radio>
 				</u-radio-group>
-			</u-form-item>
+			</u-form-item> -->
 			<u-form-item label="鐗╂枡" label-width="90px" prop="materialCost" style="font-size:small">
 				<u-radio-group v-model="form.materialCost" :disabled="true">
 					<u-radio name="鍊掑啿"><span style="font-size:small">鍊掑啿</span></u-radio>
 					<u-radio name="鎶曟枡"><span style="font-size:small">鎶曟枡</span></u-radio>
 				</u-radio-group>
 			</u-form-item>
-			<u-form-item label="绠�鍖栫墿鏂欐鏌�" label-width="90px" prop="simplifyMaterials" style="font-size:small">
+			<!-- <u-form-item label="绠�鍖栫墿鏂欐鏌�" label-width="90px" prop="simplifyMaterials" style="font-size:small">
 				<u-radio-group v-model="form.simplifyMaterials" :disabled="subdisabled || simplifyDisabled"
 					@change="radioChange">
 					<u-radio name="true"><span style="font-size:small">鏄�</span></u-radio>
 					<u-radio name="false"><span style="font-size:small">鍚�</span></u-radio>
 				</u-radio-group>
-			</u-form-item>
+			</u-form-item> -->
 			<u-form-item label="鎶ュ伐鏂瑰紡" label-width="90px" prop="status" style="font-size:small">
 				<u-radio-group v-model="form.status" :disabled="subdisabled" @change="handleReportTypeChange">
 					<u-radio name="false"><span style="font-size:small">鎸夌彮缁勬姤宸�</span></u-radio>
@@ -210,8 +218,10 @@
 					moOn: "",
 					partNo: "",
 					partName: "",
-					qtyRequired: "",
-					Jianqtyfinished: "",
+					// qtyRequired: "",
+					// Jianqtyfinished: "",
+					FeedInputProductionVolume: null, //鎶曟枡浜ч噺
+					reportProductionVolume: null, //姹囨姤浜ч噺
 					proposedLocation: "",
 					productType: "dep",
 					receive: "mo",
@@ -222,7 +232,10 @@
 					Persons: '',
 					productStaffIds: [],
 					productStaffs: []
+
 				},
+				reportProductionVolumelist: {},
+				FeedInputProductionVolumeList: {}, //鎶曟枡浜ч噺
 				personList: [],
 				canSelectPerson: false,
 				rules: {
@@ -266,6 +279,17 @@
 						message: "璇烽�夋嫨浜哄憳",
 						trigger: ["change"],
 					}, ],
+					reportProductionVolume: [{
+						required: true,
+						message: "璇疯緭鍏ユ眹鎶ヤ骇閲�",
+						trigger: ["change"],
+					}, ],
+					// FeedInputProductionVolume: [{
+					// 	required: true,
+					// 	message: "璇疯緭鍏ユ姇鏂欎骇閲�",
+					// 	trigger: ["change"],
+					// }, ],
+
 				},
 				showSave: false,
 				operationTaskId: "",
@@ -286,15 +310,30 @@
 						mask: true,
 						title: "鍔犺浇涓�",
 					});
-					// 澶勭悊鎻愪氦閫昏緫
+					this.form.operationTaskId = this.form.id;
+					this.reportProductionVolumelist.operationTaskId = this.form.id;
+					this.reportProductionVolumelist.status = this.form.status;
+					this.reportProductionVolumelist.Persons = this.form.Persons;
+					this.reportProductionVolumelist.productStaffIds = this.form.productStaffIds;
+					this.reportProductionVolumelist.productStaffs = this.form.productStaffs;
+					this.reportProductionVolumelist.productInputList = Object.keys(this.FeedInputProductionVolumeList).length === 0 ? null : this.FeedInputProductionVolumeList;
+					this.reportProductionVolumelist.dutyRecordId = this.dutyId;
+					this.form.productOutputList = []; // 鍒涘缓涓�涓┖鏁扮粍
+					this.form.productOutputList.push(this.reportProductionVolumelist); // 鍚戞暟缁勪腑娣诲姞鍏冪礌
+					console.log("this.form", this.form);
 					this.$u.api.workReporting
-						.operationTask({
-							id: this.form.id,
-						})
+						.submitPDA(this.form)
 						.then((res) => {
-							res.data.name = this.form.name;
-							this.$refs.saveForm.open(res);
-							uni.hideLoading();
+							this.subdisabled = true;
+							this.$u.toast("鎻愪氦鎴愬姛");
+							this.InventoryReceiptList.unshift(this.form.productOutputList[0]);
+							this.reportProductionVolumelist = {},
+							this.FeedInputProductionVolumeList = {}, //鎶曟枡浜ч噺
+							this.form.FeedInputProductionVolume = null, //鎶曟枡浜ч噺
+							this.form.reportProductionVolume = null, //姹囨姤浜ч噺
+							console.log("this.InventoryReceiptList", this.InventoryReceiptList);
+						})
+						.finally(() => {
 						});
 				} else {
 					// 鍙互鑾峰彇鍏蜂綋鐨勯敊璇俊鎭�
@@ -322,10 +361,10 @@
 						// 鎵弿鎶ュ伐鍗曚簩缁寸爜
 						that.CopperReportingWork(codeInfo);
 					}
-					if (codeInfo.BN) {
-						// 鎵弿鎶ュ伐鍗曚簩缁寸爜
-						that.$refs.saveForm.saveForm(codeInfo);
-					}
+					// if (codeInfo.BN) {
+					// 	// 鎵弿鎶ュ伐鍗曚簩缁寸爜
+					// 	that.$refs.saveForm.saveForm(codeInfo);
+					// }
 				}
 			});
 		},
@@ -341,6 +380,47 @@
 			}
 		},
 		methods: {
+			// 鎶曟枡浜ч噺
+			FeedInputProductionVolumeCLick() {
+				if (this.form.taskNo === "") {
+					uni.showToast({
+						title: "璇峰厛鎵爜",
+						icon: "none",
+					});
+					return;
+				}
+				if (this.simplifyDisabled) {
+					uni.showToast({
+						title: "鍊掑啿鏃犻渶鎶曟枡",
+						icon: "none",
+					});
+					return;
+				}
+				uni.navigateTo({
+					url: "/pages/product/report/seachPersonnelNo?moOn=" + this.form.moOn,
+
+				});
+			},
+			// 姹囨姤浜ч噺
+			reportProductionVolumeCLick() {
+				if (this.form.taskNo === "") {
+					uni.showToast({
+						title: "璇峰厛鎵爜",
+						icon: "none",
+					});
+					return;
+				}
+				// 澶勭悊鎻愪氦閫昏緫
+				this.$u.api.workReporting
+					.operationTask({
+						id: this.form.id,
+					})
+					.then((res) => {
+						res.data.name = this.form.name;
+						this.$refs.saveForm.open(res);
+						uni.hideLoading();
+					});
+			},
 			// 澶勭悊鎶ュ伐鏂瑰紡鍙樻洿
 			handleReportTypeChange() {
 				// 鍒囨崲鎶ュ伐鏂瑰紡鏃舵竻绌轰汉鍛樺悕绉�
@@ -416,8 +496,8 @@
 						copperList.productStaffIds = this.form.productStaffIds;
 						copperList.productStaffs = this.form.productStaffs;
 						this.form.productOutputList = [];
-            this.form.operationTaskId = this.form.id;
-            this.form.dutyRecordId = this.dutyId;
+						this.form.operationTaskId = this.form.id;
+						this.form.dutyRecordId = this.dutyId;
 						this.form.productOutputList.push(copperList);
 						console.log('this.form', this.form)
 						this.$u.api.workReporting.submitPDA(this.form).then((res) => {
@@ -460,7 +540,7 @@
 			},
 
 			confirmModle() {
-				console.log("鐐瑰嚮纭鍚庤幏鍙栧彇娑堟姤宸ヨ褰�");
+				console.log("鐐瑰嚮纭鍚庤幏鍙栧彇娑堟姤宸ヨ褰�",this.detailedList);
 				// 澶勭悊纭閫昏緫
 				this.$u.api.cancelReporting
 					.cancelDTAOfWorkApplication({
@@ -469,7 +549,7 @@
 					})
 					.then((res) => {
 						console.log("res", res);
-						this.detailedList.splice(this.index, 1)
+						this.InventoryReceiptList.splice(this.index, 1)
 						this.showModal = false;
 						// this.getHandelList();
 						this.$u.toast("鍙栨秷鎶ュ伐鎴愬姛");
@@ -479,7 +559,7 @@
 				this.showModal = false; // 鍏抽棴寮圭獥
 			},
 			// 鍙栨秷鎶ュ伐
-			cancelReport(item,index) {
+			cancelReport(item, index) {
 				let that = this;
 				that.index = index;
 				uni.showModal({
@@ -516,9 +596,11 @@
 			// }
 			// },
 			handleUpdate(val) {
-				this.subdisabled = true;
+				this.reportProductionVolumelist = val
+				this.form.reportProductionVolume = val.outBatchNo;
+				// this.subdisabled = true;
 				// this.getHandelList();
-				this.InventoryReceiptList.unshift(val);
+				// this.InventoryReceiptList.unshift(val);
 			},
 			// 鎵撳紑寮规--鍚庨潰杩橀渶瑕佺洃鍚壂鐮佹灙鎵爜缁撴灉锛岃祴鍊肩粰鎶ュ伐鍗曞彿瀛楁锛岀劧鍚庢墦寮�寮规閫夋嫨璁㈠崟鍙风瓑鎿嶄綔
 			open() {
@@ -543,6 +625,14 @@
 			setNo(val) {
 				this.form.moOn = val.moNo;
 			},
+			setFeedInputProductionVolume(val) {
+				console.log('val', val)
+				this.FeedInputProductionVolumeList = val;
+				const values = this.FeedInputProductionVolumeList.map((item) => item.ifsBatchNo)
+				console.log('values', values)
+
+          		this.form.FeedInputProductionVolume = values.join('锛�')
+			},
 			// 鍥炴樉鎵爜鐨勪俊鎭�-鎶ュ伐鍗�
 			saveForm(val) {
 				this.form = {
@@ -554,8 +644,8 @@
 					moOn: val.moOn,
 					partNo: val.partNo,
 					partName: val.partName,
-					qtyRequired: val.qtyRequired,
-					Jianqtyfinished: val.qtyRequired - val.qtyFinished,
+					// qtyRequired: val.qtyRequired,
+					// Jianqtyfinished: val.qtyRequired - val.qtyFinished,
 					proposedLocation: val.proposedLocation,
 					productType: "dep",
 					receive: "mo",

--
Gitblit v1.9.3