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/index.vue |  698 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 698 insertions(+), 0 deletions(-)

diff --git a/pages/product/produce/index.vue b/pages/product/produce/index.vue
new file mode 100644
index 0000000..6d619c8
--- /dev/null
+++ b/pages/product/produce/index.vue
@@ -0,0 +1,698 @@
+<template>
+	<view class="page">
+		<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="operation-task-param">
+			<view class="operation-task-param-view">
+				<view class="operation-task-param-item">
+					<view class="operation-task-param-item-left">
+						<text class="item-one">宸ヤ綔绔�</text>
+					</view>
+					<view class="operation-task-param-item-right">
+						<text class="item-one" @click="toWorkstation">( {{ workstationInfo.workCenter }} )  {{workstationInfo.workstationName}}</text>
+						<u-icon name="arrow-right" color="#687792" size="28" @click="toWorkstation"></u-icon>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="operation-task-list-search">
+			<u-search v-model="query.optaskNo" shape="square" bg-color="rgba(250,252,255,0.36)" :show-action="false"
+				placeholder="宸ュ崟鍙�" @clear="search" @custom="search" @search="search">
+			</u-search>
+		</view>
+		<view class="operation-task-tab">
+			<scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false" enable-flex>
+				<view v-for="(tab,index) in tabBars" :key="tab.id" class="uni-tab-item" :id="tab.id"
+					:data-current="index" @click="ontabtap">
+					<text class="uni-tab-item-title"
+						:class="tabIndex==index ? 'uni-tab-item-title-active' : ''">{{tab.name}}</text>
+				</view>
+			</scroll-view>
+		</view>
+		<view class="line-h"></view>
+		<view class="wrap" :current="tabIndex" @change="ontabchange">
+			<scroll-view class="operation-task-scroll-list" scroll-y="true" @scrolltolower="loadMore">
+				<u-cell-group class="operation-task-scroll-list-group" :border="false">
+					<div class="tip" style="text-align:center;" v-if="list.length==0">-鏆傛棤宸ュ崟-</div>
+					<view class="content" v-for="(item, index) in list" :key="item.id" :index="index" @click="goDetail(item)">
+						<view class="content-header">
+							<view class="header-item-top">
+								<viem class="header-item-right" @click.stop="toReportWork(item)">
+									<wu-button :custom-style="customStyle" size="mini" class="header-item-button" >
+										鎶ュ伐
+										<image src="/static/custom/operationTask/enter-icon.png"
+											style="width: 30rpx; height: 30rpx; padding-left: 5rpx; "></image>
+									</wu-button>
+								</viem>
+								<view class="header-item-left">
+									<view class="content-header-icon-one"></view>
+									<view class="content-header-title">宸ュ崟缂栧彿锛�</view>
+									<view class="content-header-value">{{ item.optaskNo }}</view>
+								</view>
+							</view>
+							<view class="header-item-top">
+								<view class="header-item-left">
+									<view class="content-header-icon-one"></view>
+									<view class="content-header-title">闆朵欢鍚嶇О锛�</view>
+									<view class="content-header-value">{{ item.partName }}</view>
+								</view>
+							</view>
+							<view class="header-item-top">
+								<view class="header-item-left">
+									<view class="content-header-icon-one"></view>
+									<view class="content-header-title">闆朵欢缂栧彿锛�</view>
+									<view class="content-header-value">{{ item.partNo }}</view>
+								</view>
+							</view>
+							<view class="header-item-top">
+								<view class="header-item-left">
+									<view class="content-header-icon-one"></view>
+									<view class="content-header-title">璁″垝缂栧彿锛�</view>
+									<view class="content-header-value">{{ item.mpsNo }}</view>
+								</view>
+							</view>
+							<view class="header-item-top">
+								<view class="header-item-left">
+									<view class="content-header-icon-one"></view>
+									<view class="content-header-title">鎴愬搧鍚嶇О锛�</view>
+									<view class="content-header-value">{{ item.productName }}</view>
+								</view>
+							</view>
+						</view>
+						<view class="content-footer">
+							<view class="row-list">
+								<view class="content-footer-time-icon"></view>
+								<view class="_label">
+									璁″垝瀹屾垚鏃堕棿锛�
+								</view>
+								<view class="_content">
+									{{ item.planFinishDay }}
+								</view>
+							</view>
+							<view class="progress-box">
+								<progress :percent="item.ratio" show-info stroke-width="8" />
+							</view>
+						</view>
+					</view>
+				</u-cell-group>
+				<view class="loadmore" @click="loadMore">
+					<u-loadmore :status="loadStatus"></u-loadmore>
+				</view>
+			</scroll-view>
+		</view>
+	</view>
+</template>
+<script>
+	import content_bg from '@/static/custom/product/productBg.png'
+
+	// 缂撳瓨姣忛〉鏈�澶�
+	const MAX_CACHE_DATA = 100;
+	// 缂撳瓨椤电鏁伴噺
+	const MAX_CACHE_PAGE = 3;
+
+	export default {
+		components: {},
+		computed: {
+			customStyle() {
+				return {
+					color: '#FFFFFF',
+					background: '#30AFFF',
+					width: '120rpx',
+					height: '80rpx',
+					
+				}
+			},
+		},
+		data() {
+			return {
+				background: {
+					backgroundImage: `url(${content_bg})`,
+					backgroundAttachment: 'fixed',
+					backgroundSize: '100% auto',
+					backgroundRepeat: 'no-repeat',
+				},
+				newsList: [],
+				cacheTab: [],
+				tabIndex: 0,
+				tabBars: [{
+					name: '鍏ㄩ儴',
+					id: 'total'
+				}, {
+					name: '寰呭紑濮�',
+					id: '01pending'
+				}, {
+					name: '杩涜涓�',
+					id: '02inProgress'
+				}, {
+					name: '宸茬粨鏉�',
+					id: '04completed'
+				}],
+				scrollInto: "",
+				showTips: false,
+				navigateFlag: false,
+				pulling: false,
+				refreshIcon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAB5QTFRFcHBw3Nzct7e39vb2ycnJioqK7e3tpqam29vb////D8oK7wAAAAp0Uk5T////////////ALLMLM8AAABxSURBVHja7JVBDoAgDASrjqj//7CJBi90iyYeOHTPMwmFZrHjYyyFYYUy1bwUZqtJIYVxhf1a6u0R7iUvWsCcrEtwJHp8MwMdvh2amHduiZD3rpWId9+BgPd7Cc2LIkPyqvlQvKxKBJ//Qwq/CacAAwDUv0a0YuKhzgAAAABJRU5ErkJggg==",
+				list: [],
+				array: [],
+				query: {
+					current: 1,
+					size: 10,
+					optaskNo: null,
+					state: null,
+					workstationId: null,
+					workCenter:null
+				},
+				workstationInfo: {
+					workstationId: null,
+					workstationNo: null,
+					workstationName: null,
+					workCenter: null,
+					dutyRecordId: null
+				},
+				loadStatus: 'loadmore',
+			};
+		},
+		onLoad() {
+			setTimeout(() => {
+				const workstation = JSON.parse(uni.getStorageSync('workstation'));
+				if (workstation) {
+					this.setWorkstation(workstation);
+				} else {
+					this.loadList(0);
+				}
+			}, 350)
+		},
+		onShow() {
+
+		},
+		methods: {
+			loadList(index) {
+				if (this.tabBars[index].id != "total") {
+					this.query.state = this.tabBars[index].id;
+				}
+				if (this.workstationInfo.workstationId) {
+					this.query.workstationId = this.workstationInfo.workstationId;
+					this.query.workCenter = this.workstationInfo.workCenter;
+				} else {
+					return;
+				}
+
+				this.$u.api.operationTask.getOperationTaskPage(this.query).then(res => {
+					if (!res.data.records || res.data.records.length == 0) {
+						this.loadStatus = "nomore";
+						return;
+					}
+					this.list = this.list.concat(res.data.records);
+					this.query.current = res.data.current;
+					this.query.size = res.data.size;
+					this.loadStatus = "loadmore";
+				});
+			},
+			goDetail(item) {
+				if (this.navigateFlag) {
+					return;
+				}
+				this.navigateFlag = true;
+				uni.navigateTo({
+					url: './operationTaskInfo?item=' + encodeURIComponent(JSON.stringify(item))
+				});
+				setTimeout(() => {
+					this.navigateFlag = false;
+				}, 200)
+			},
+			loadMore() {
+				if (this.loadStatus == "nomore") {
+					return;
+				}
+				this.loadStatus = "loading";
+				setTimeout(() => {
+					this.query.current += 1;
+					this.loadList(this.tabIndex);
+				}, 100);
+			},
+			ontabtap(e) {
+				let index = e.target.dataset.current || e.currentTarget.dataset.current;
+				this.switchTab(index);
+			},
+			ontabchange(e) {
+				let index = e.target.current || e.detail.current;
+				this.switchTab(index);
+			},
+			switchTab(index) {
+				if (this.tabIndex === index) {
+					return;
+				}
+
+				// 娓呯┖鏁版嵁
+				this.clearTabData();
+
+				if (this.list.length === 0) {
+					this.loadList(index);
+				}
+
+				this.tabIndex = index;
+				this.scrollInto = this.tabBars[index].id;
+			},
+			clearTabData(e) {
+				this.query.current = 1;
+				this.list = [];
+				this.query.state = null;
+			},
+			refreshData() {},
+			onrefresh(e) {
+				var tab = this.list[this.tabIndex];
+				if (!tab.refreshFlag) {
+					return;
+				}
+				tab.refreshing = true;
+				tab.refreshText = "姝e湪鍒锋柊...";
+
+				setTimeout(() => {
+					this.refreshData();
+					this.pulling = true;
+					tab.refreshing = false;
+					tab.refreshFlag = false;
+					tab.refreshText = "宸插埛鏂�";
+					setTimeout(() => { // TODO fix ios鍜孉ndroid 鍔ㄧ敾鏃堕棿鐩稿弽闂
+						this.pulling = false;
+					}, 500);
+				}, 2000);
+			},
+			onpullingdown(e) {
+				var tab = this.list[this.tabIndex];
+				if (tab.refreshing || this.pulling) {
+					return;
+				}
+				if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {
+					tab.refreshFlag = true;
+					tab.refreshText = "閲婃斁绔嬪嵆鍒锋柊";
+				} else {
+					tab.refreshFlag = false;
+					tab.refreshText = "涓嬫媺鍙互鍒锋柊";
+				}
+			},
+
+			search(value) {
+				this.list = [];
+				this.query.current = 1;
+				this.loadList(this.tabIndex);
+			},
+
+			toWorkstation() {
+				uni.navigateTo({
+					url: '/pages/product/produce/workstationList/index?id=' + this.workstationInfo.workstationId
+				})
+			},
+			toReportWork(operationTask) {
+				const params = {
+					operationTaskId: operationTask.id,
+					partId: operationTask.partId,
+					partNo: operationTask.partNo,
+					partName: operationTask.partName,
+					unit: operationTask.unit,
+					workstationId: this.workstationInfo.workstationId,
+					dutyRecordId: this.workstationInfo.dutyRecordId
+				};
+				uni.navigateTo({
+					url: '/pages/product/produce/reportWork?params=' + encodeURIComponent(JSON.stringify(params))
+				})
+			},
+			setWorkstation(workstation) {
+				this.workstationInfo.workstationId = workstation.id;
+				this.workstationInfo.workstationNo = workstation.workstationNo;
+				this.workstationInfo.workstationName = workstation.name;
+				this.workstationInfo.workCenter = workstation.workCenter;
+				this.workstationInfo.dutyRecordId = workstation.dutyRecordId;
+
+				this.clearTabData();
+				this.loadList(0);
+			}
+		}
+	};
+</script>
+<style lang="scss" scoped>
+	.operation-task-list-search {
+		padding: 10rpx 30rpx 20rpx 30rpx;
+	}
+
+	.operation-task-tab {
+		.scroll-h {
+			width: 750rpx;
+			display: flex;
+			justify-content: space-between;
+			height: 80rpx;
+			white-space: nowrap;
+
+			.uni-tab-item {
+				display: inline-block;
+				padding-left: 55rpx;
+				padding-right: 55rpx;
+			}
+		}
+	}
+
+	.line-h {
+		height: 1rpx;
+		background-color: #cccccc;
+	}
+
+	.uni-tab-item-title {
+		color: #555;
+		font-size: 30rpx;
+		height: 80rpx;
+		line-height: 80rpx;
+		flex-wrap: nowrap;
+		/* #ifndef APP-PLUS */
+		white-space: nowrap;
+		/* #endif */
+		font-weight: bold;
+	}
+
+	.uni-tab-item-title-active {
+		color: #00aaff;
+	}
+
+	.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;
+	}
+
+	.operation-task-param {
+		padding: 30rpx 30rpx 0rpx 30rpx;
+
+		.operation-task-param-view {
+			height: 100rpx;
+			background: rgba(255, 255, 255, 0.61);
+			box-shadow: 0rpx 6rpx 8rpx 0rpx rgba(110, 120, 135, 0.09);
+			border-radius: 10rpx;
+			padding: 0rpx 23rpx;
+			margin-bottom: 30rpx;
+
+			.operation-task-param-item {
+				height: 100rpx;
+				border: 1px solid #ADC8E4;
+				line-height: 100rpx;
+				display: flex;
+				justify-content: space-between;
+				border: none;
+
+				.operation-task-param-item-left {
+					.item-one {
+						font-size: 30rpx;
+						color: #4F4F4F;
+					}
+				}
+
+				.operation-task-param-item-right {
+					display: flex;
+					align-items: center;
+
+					.item-one {
+						font-size: 30rpx;
+						color: #333333;
+						margin-right: 6rpx;
+					}
+
+					.item-two {
+						font-size: 30rpx;
+						color: #A6B4CC;
+						margin-right: 6rpx;
+					}
+
+					.item-three {
+						font-size: 30rpx;
+						color: #214DED;
+						margin-right: 6rpx;
+					}
+
+					.scan {
+						background-image: url('~@/static/custom/materialReturn/scan.png');
+						background-size: 100% auto;
+						background-repeat: no-repeat;
+						height: 32rpx;
+						width: 32rpx;
+					}
+				}
+			}
+
+			.param-extra {
+				border-bottom: 1px solid #E8EBEE;
+			}
+		}
+	}
+
+	.wrap .operation-task-scroll-list {
+		height: calc(100vh - var(--window-top) - var(--window-bottom) - 494rpx);
+		width: 100%;
+	}
+
+	.operation-task-scroll-list-group {
+		::v-deep .u-cell-item-box {
+			background-color: rgba(250, 252, 255, 0.36) !important;
+			// padding: 0rpx 30rpx;
+		}
+
+		.content {
+			font-size: 12px;
+			background-color: #FFFFFF;
+			box-sizing: border-box;
+			border-radius: 10rpx;
+			margin: 30rpx;
+			// height: 412rpx;
+			line-height: normal;
+			padding: 20rpx 20rpx;
+			box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(127, 127, 127, 0.1) !important;
+			position: relative;
+
+			.content-header {
+				background-color: #d2e2fa;
+				padding: 20rpx;
+				
+				.header-item-top {
+					
+					
+					// display: flex;
+					// justify-content: space-between;
+					.header-item-left {
+						height: 80rpx;
+						display: flex;
+						// align-items: center;
+						justify-content: flex-start;
+						font-size: 26rpx;
+
+						.content-header-title {
+							margin-left: 11rpx;
+							margin-top: -4rpx;
+							font-weight: bold;
+						}
+						
+						.content-header-value {
+							width: 400rpx;
+						}
+
+						.content-header-icon-one {
+							background-image: url('~@/static/custom/materialReturn/label-icon-1.png');
+							background-size: 100% auto;
+							background-repeat: no-repeat;
+							height: 20rpx;
+							width: 20rpx;
+						}
+						
+						.content-footer-time-icon {
+							background-image: url('~@/static/custom/operationTask/time-icon.png');
+							background-size: 100% auto;
+							background-repeat: no-repeat;
+							height: 28rpx;
+							width: 28rpx;
+							margin-right: 3px;
+						}
+					}
+
+					.header-item-right {
+						position: absolute;
+						right: 20rpx;
+						top: 20rpx;
+						// float: left;
+						// top: 0rpx;
+						// .header-item-button {
+						// 	width: 120rpx;
+						// 	color: #00aff0;
+						// 	background-color: #00aff0;
+						// }
+					}
+				}
+
+				.header-item-bottom {
+					line-height: normal;
+					display: flex;
+					align-items: center;
+
+					.content-header-icon-two {
+						background-image: url('~@/static/custom/materialReturn/label-icon-2.png');
+						background-size: 100% auto;
+						background-repeat: no-repeat;
+						height: 28rpx;
+						width: 28rpx;
+					}
+
+					.content-header-title-ne {
+						margin-left: 11rpx;
+						font-size: 26rpx;
+						color: #333333;
+					}
+				}
+
+				.header-item-toolbar-selected {
+					position: absolute;
+					background-image: url('~@/static/custom/materialReturn/selected-btn-1.png');
+					background-size: 100% auto;
+					background-repeat: no-repeat;
+					height: 50rpx;
+					width: 50rpx;
+					right: 20rpx;
+					top: 12rpx;
+					display: flex;
+					justify-content: flex-end;
+					padding-top: 10rpx;
+					padding-right: 18rpx;
+				}
+
+				.header-item-toolbar-unselected {
+					position: absolute;
+					background-image: url('~@/static/custom/materialReturn/unselected-btn-1.png');
+					background-size: 100% auto;
+					background-repeat: no-repeat;
+					height: 50rpx;
+					width: 50rpx;
+					right: 20rpx;
+					top: 12rpx;
+					display: flex;
+					justify-content: flex-end;
+					padding-top: 10rpx;
+					padding-right: 18rpx;
+				}
+			}
+
+			.content-body {
+				height: 200rpx;
+				background: #F5F9FF;
+				border-radius: 10rpx;
+				padding: 25rpx 23rpx;
+
+				.row-list {
+					height: 50rpx;
+					display: flex;
+					flex-direction: row;
+					padding: 0px;
+					align-items: center;
+					justify-content: space-between;
+				}
+
+				.row-list ._label {
+					// display: flex;
+					// color: #666666;
+					// font-size: 26rpx;
+					// align-items: center;
+					// width: 170rpx;
+
+					.content-body-icon-one {
+						background-image: url('~@/static/custom/operationTask/label-icon-1.png');
+						background-size: 100% auto;
+						background-repeat: no-repeat;
+						height: 18rpx;
+						width: 18rpx;
+						margin-right: 10rpx;
+					}
+				}
+
+				.row-list ._content {
+					text-align: right;
+					color: #909399;
+					font-size: 24rpx;
+
+					._content-text {
+						color: #214ded;
+					}
+				}
+
+				.row-list ._input {
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+					border-bottom: 1px solid #4FA0FF;
+					height: 56rpx;
+
+					.edit_icon {
+						background-image: url('~@/static/custom/materialReturn/icon_edit.png');
+						background-size: 100% auto;
+						background-repeat: no-repeat;
+						height: 26rpx;
+						width: 26rpx;
+					}
+
+					::v-deep .uni-input-input {
+						color: #D35651;
+					}
+				}
+
+				.row-list .s1 {
+					display: flex;
+					color: #214DED;
+					font-size: 26rpx;
+					align-items: center;
+					width: 170rpx;
+				}
+			}
+
+			.content-footer {
+				padding-left: 5rpx;
+				margin-top: 5rpx;
+				.row-list {
+					display: flex;
+					align-items: center;
+
+					.content-footer-time-icon {
+						background-image: url('~@/static/custom/operationTask/time-icon.png');
+						background-size: 100% auto;
+						background-repeat: no-repeat;
+						height: 28rpx;
+						width: 28rpx;
+						margin-right: 3px;
+					}
+				}
+
+				.row-list ._label {
+					// display: flex;
+					// color: #666666;
+					// font-size: 26rpx;
+					// align-items: center;
+					// width: 200rpx;
+				}
+
+				.row-list ._content {
+					._content-text {
+						
+					}
+				}
+			}
+		}
+	}
+
+	.scan {
+		width: 60rpx;
+		height: 60rpx;
+		font-size: 60rpx;
+		color: #3281ff;
+	}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3