From f26f29d84e0a68831a6af14dab3eec5500496d2e Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 28 五月 2025 16:48:52 +0800
Subject: [PATCH] 初始化项目

---
 pages/product/produce/editReportWork.vue |  292 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 292 insertions(+), 0 deletions(-)

diff --git a/pages/product/produce/editReportWork.vue b/pages/product/produce/editReportWork.vue
new file mode 100644
index 0000000..04f025a
--- /dev/null
+++ b/pages/product/produce/editReportWork.vue
@@ -0,0 +1,292 @@
+<template>
+	<view class="wrap">
+		<view class="production-index-bg" />
+		<u-navbar title="缂栬緫浜у嚭" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
+			back-icon-color="#000" />
+		<view class="content">
+			<scroll-view class="scroll-list edit-product-out-scroll" scroll-y="true">
+				<u-cell-group class="list" :border="false">
+					<u-card :title="item.username" :sub-title="item.phone" v-for="(item, index) in editProductOutList"
+						:key="item.id" :index="item.id" :showHead="showEditCardHead">
+						<view slot="body">
+							<view class="row-list">
+								<u-row justify="space-between">
+									<u-col span="4">
+										<span class="span-lable">SN鍙凤細</span>
+									</u-col>
+									<u-col span="8">
+										<view>
+											<span>{{item.outBatchNo}}</span>
+										</view>
+									</u-col>
+								</u-row>
+							</view>
+							<view class="row-list">
+								<u-row justify="space-between">
+									<u-col span="4">
+										<span class="span-lable">璧峰鏁伴噺锛�</span>
+									</u-col>
+									<u-col span="8">
+										<view>
+											<u-input class="custom-edit-input" v-model="item.startMeterMark"
+												type="digit" :clearable=false height="50"
+												@blur="startMeterBlur(item)"></u-input>
+										</view>
+									</u-col>
+								</u-row>
+							</view>
+							<view class="row-list">
+								<u-row justify="space-between">
+									<u-col span="4">
+										<span class="span-lable">鎴鏁伴噺锛�</span>
+									</u-col>
+									<u-col span="8">
+										<view>
+											<u-input class="custom-edit-input" v-model="item.endMeterMark"
+												:clearable=false height="50" type="digit"
+												@blur="endMeterBlur(item)"></u-input>
+										</view>
+									</u-col>
+								</u-row>
+							</view>
+							<view class="row-list">
+								<u-row justify="space-between">
+									<u-col span="4">
+										<span class="span-lable">鐢熶骇鏁伴噺锛�</span>
+									</u-col>
+									<u-col span="8">
+										<view>
+											<span>{{item.productQty}}</span>
+										</view>
+									</u-col>
+								</u-row>
+							</view>
+							<view class="row-list">
+								<u-row justify="space-between">
+									<u-col span="4">
+										<span class="span-lable">鎶ュ簾鏁伴噺锛�</span>
+									</u-col>
+									<u-col span="8">
+										<view>
+											<u-input class="custom-edit-input" v-model="item.scrapQty" :clearable=false
+												height="50" type="digit"></u-input>
+										</view>
+									</u-col>
+								</u-row>
+							</view>
+							<view class="row-list">
+								<u-row justify="space-between">
+									<u-col span="4">
+										<span class="span-lable">鐢熶骇鎻忚堪锛�</span>
+									</u-col>
+									<u-col span="8">
+										<view>
+											<u-input class="custom-edit-input" v-model="item.segmentDesc" type="text"
+												:clearable=false height="50"></u-input>
+										</view>
+									</u-col>
+								</u-row>
+							</view>
+						</view>
+					</u-card>
+				</u-cell-group>
+			</scroll-view>
+		</view>
+		<view class="edit-product-out-btn-view">
+			<u-button text="纭畾" type="primary" size="medium" :customStyle="{width:'150rpx'}" @click="updateProductOut">
+				纭畾</u-button>
+		</view>
+	</view>
+</template>
+<script>
+	import content_bg from '@/static/custom/product/productBg.png'
+
+	export default {
+		data() {
+			return {
+				background: {
+					backgroundImage: `url(${content_bg})`,
+					backgroundAttachment: 'fixed',
+					backgroundSize: '100% auto',
+					backgroundRepeat: 'no-repeat',
+				},
+				editProductOutList: [],
+				showEditCardHead: false
+			};
+		},
+		onLoad(params) {
+			if (params.item) {
+				let list = JSON.parse(decodeURIComponent(params.item));
+				this.editProductOutList = list
+			}
+		},
+		onShow() {
+
+		},
+		methods: {
+			startMeterBlur(item) {
+				if (item.endMeterMark !== "") {
+					let qty = parseFloat(item.endMeterMark) - parseFloat(item.startMeterMark)
+					qty = parseFloat(qty.toFixed(4))
+					this.$set(item, 'productQty', qty);
+				}
+			},
+			endMeterBlur(item) {
+				if (item.startMeterMark !== "") {
+					let qty = parseFloat(item.endMeterMark) - parseFloat(item.startMeterMark)
+					qty = parseFloat(qty.toFixed(4))
+					this.$set(item, 'productQty', qty);
+				}
+			},
+			async updateProductOut() {
+
+				for (let i = 0; i < this.editProductOutList.length; i++) {
+
+					// 璧峰绫虫爣鏍¢獙
+					if (!this.isNumber(this.editProductOutList[i].startMeterMark)) {
+						this.$u.toast('绗�' + (i + 1) + '琛岋紝銆愯捣濮嬫暟閲忋�戣杈撳叆闈炶礋鏁帮紝灏忔暟浣嶆渶澶�4浣嶏紒')
+						return
+					}
+					// 鎴绫虫爣鏍¢獙
+					if (!this.isNumber(this.editProductOutList[i].endMeterMark)) {
+						this.$u.toast('绗�' + (i + 1) + '琛岋紝銆愭埅姝㈡暟閲忋�戣杈撳叆闈炶礋鏁帮紝灏忔暟浣嶆渶澶�4浣嶏紒')
+						return
+					}
+					// 鎴绫虫爣闇�澶т簬寮�濮嬬背鏍�
+					if (
+						Number(this.editProductOutList[i].endMeterMark) <
+						Number(this.editProductOutList[i].startMeterMark)
+					) {
+						this.$u.toast('绗�' + (i + 1) + '琛岋紝銆愭埅姝㈢背鏍囥�戦渶澶т簬銆愯捣濮嬬背鏍囥��')
+						return
+					}
+				}
+
+				let data = []
+				this.editProductOutList.forEach((el) => {
+					let productVo = {}
+					productVo.id = el.id
+					let productOuts = []
+					let productOut = {}
+					productOut.startMeterMark = parseFloat(el.startMeterMark)
+					productOut.endMeterMark = parseFloat(el.endMeterMark)
+					productOut.productQty = el.productQty
+					productOut.segmentDesc = el.segmentDesc
+					productOut.scrapQty = el.scrapQty
+					productOut.ifsBatchNo = el.ifsBatchNo
+					productOut.reelNumber = el.reelNumber
+					productOut.remark = el.remark
+					productOuts.push(productOut)
+					productVo.productOutputList = productOuts
+					data.push(productVo)
+				})
+
+				let res = await this.$u.api.outputRegister.batchUpdateProductMain(data)
+				let that = this
+				if (res.code == 0) {
+					uni.showModal({
+						title: '鎻愮ず',
+						content: '缂栬緫鎴愬姛',
+						showCancel: false,
+						success: function() {
+							that.refreshLastPage()
+							// setTimeout(()=> {								
+							// 	that.refreshLastPage()	
+							// 	}, 5500);							 				  
+						}
+					})
+
+				} else {
+					uni.showModal({
+						title: '鎻愮ず',
+						content: '缂栬緫澶辫触',
+						showCancel: false,
+						success: function() {}
+					})
+				}
+			},
+			isNumber(value) {
+				var reg = /^[0-9]+(.[0-9]{1,4})?$/
+				if (
+					value == undefined ||
+					value == null ||
+					value === '' ||
+					value.trim === ''
+				) {
+					return false
+				} else {
+					if (!reg.test(value)) {
+						return false
+					} else {
+						return true
+					}
+				}
+			},
+			//鍒锋柊涓婁竴涓〉闈�
+			refreshLastPage() {
+				// 鍛婄煡 A.vue 鏇存柊鏁版嵁
+				// 鑾峰彇椤甸潰鏍�
+				let pages = getCurrentPages()
+
+				// 鑾峰彇涓婁竴椤垫爤
+				let prevPage = pages[pages.length - 2]
+
+				// 瑙﹀彂涓婁竴椤� upData 鍑芥暟(骞舵惡甯﹀弬鏁�)
+				prevPage.$vm.refreshTrackingRecord()
+
+				// 杩斿洖涓婁竴椤�
+				uni.navigateBack({
+					delta: 1
+				})
+			},
+		}
+	};
+</script>
+<style lang="scss">
+	.production-index-bg {
+		background-color: #F6F9FF;
+		background-image: url('~@/static/custom/product/productBg.png');
+		// background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
+		padding: 0 20rpx;
+		background-attachment: fixed;
+		background-size: 100% auto;
+		background-repeat: no-repeat;
+		position: fixed;
+		top: 0;
+		bottom: 0;
+		width: 100%;
+		z-index: -1;
+	}
+	
+	.content {
+		display: flex;
+		height: calc(100vh - var(--window-top) - var(--window-bottom) - 334rpx);
+		width: 100%;
+		line-height: 80rpx;
+		font-size: 28rpx;
+	}
+
+	.edit-product-out-scroll {
+		background-color: #f8f8f8;
+	}
+
+	.edit-product-out-scroll {
+		::v-deep .u-cell-item-box {
+			background-color: #f8f8f8;
+		}
+	}
+
+	.edit-product-out-btn-view {
+		display: flex;
+		justify-content: space-between;
+		margin-top: 20rpx;
+	}
+
+	.custom-edit-input {
+		border-bottom: 2rpx solid #F8F8F8;
+	}
+	
+	.row-list{
+		font-size: 32rpx;
+	}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3