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

---
 pages/daily/production-person/production-person.vue |  297 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 297 insertions(+), 0 deletions(-)

diff --git a/pages/daily/production-person/production-person.vue b/pages/daily/production-person/production-person.vue
new file mode 100644
index 0000000..c1a9740
--- /dev/null
+++ b/pages/daily/production-person/production-person.vue
@@ -0,0 +1,297 @@
+<template>
+	<view class="work-order-list">
+		<view class="page-head">
+			<u-navbar title="浜哄憳鍒楄〃"  :border-bottom="false"
+			          :background="background"
+			          :title-bold="true" title-color="#000"
+			          back-icon-color="#000" />
+			<view class="search">
+				<u-search placeholder="璇疯緭鍏ヤ汉鍛樺悕绉�" v-model="staffName"
+				          border-color="#ADC8E4" shape="square" bg-color="rgba(250,252,255,0.36)"
+				          placeholderColor="#8992A3" :showAction="false" style="margin: 35rpx;"
+				          searchIconColor="#333333" height="74" @search="search" @change="search"></u-search>
+			</view>
+			<span class="title">妫�鏌ョ粨鏋滈�夋嫨</span>
+			<view class="list">
+				<view v-for="(item, index) in personList" :key="index" class="person-card">
+					<view class="card-info">
+						<span>
+							<u-icon class="icon_num" size="26rpx"/>
+							<span class="h5-title">浜哄憳缂栧彿:</span>
+							<span class="h5-info">{{item.staffNo}}</span>
+						</span>
+						<span>
+							<u-icon class="icon_person" size="26rpx"/>
+							<span class="h5-title">浜哄憳鍚嶇О:</span>
+							<span class="h5-info">{{item.staffName}}</span>
+						</span>
+					</view>
+					<u-checkbox active-color="#428BF7" icon-size="24rpx" class="checkbox" v-model="item.checked" @change="checkboxChange(item)"></u-checkbox>
+				</view>
+				<view class="loadmore" @click="loadMore">
+					<u-loadmore :status="loadStatus"></u-loadmore>
+				</view>
+			</view>
+		</view>
+		<view class="bottom">
+			<u-button class="u-button" :loading="loading" type="primary" @click="submit">鎻愪氦</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+import content_bg from '@/static/custom/daily/background.png'
+import UIcon from "../../../uview-ui/components/u-icon/u-icon.vue";
+
+export default {
+	name: "production-person",
+	// import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
+	components: {UIcon},
+	data() {
+		// 杩欓噷瀛樻斁鏁版嵁
+		return {
+			background: {
+				// background:'transparent'
+				backgroundImage: `url(${content_bg})`,
+				backgroundAttachment: 'fixed',
+				backgroundSize: '100% auto',
+				backgroundRepeat: 'no-repeat',
+			},
+			loading:false,
+			staffName:'',
+			personCheckedList : [],
+			personList: [],
+			query: {
+				current: 1,
+				size: 20,
+				staffName: '',
+				divisionName:"鐢熶骇閮�"
+			},
+			loadStatus: 'loadmore',
+		}
+	},
+	async onLoad(options) {
+		this.personCheckedList = []
+		this.personCheckedList = JSON.parse(decodeURIComponent(options.list))
+		await this.loadList()
+	},
+	// 鏂规硶闆嗗悎
+	methods: {
+		checkboxChange (item) {
+			if(!item.checked) {
+				const obj = {
+					staffName: item.staffName,
+					staffNo: item.staffNo
+				}
+				this.personCheckedList.push(obj)
+			} else {
+				var index = this.personCheckedList.findIndex((i) => {
+					return i.staffNo==item.staffNo;
+				})
+				this.personCheckedList.splice(index,1);
+			}
+			this.$set(item, 'checked', !item.checked)
+		},
+		submit () {
+			console.log(`output->this.personCheckedList`,this.personCheckedList)
+			this.loading = true;
+			uni.$emit('checkedList',this.personCheckedList)
+			uni.navigateBack({
+				//鍏抽棴褰撳墠椤甸潰锛岃繑鍥炰笂涓�椤甸潰鎴栧绾ч〉闈€��
+				delta:1
+			});
+			this.loading = false;
+		},
+		// async getUserInfoFun() {
+		// 	const params = {
+		// 		current: this.page.current,
+		// 		size: this.page.size,
+		// 		staffName: this.staffName
+		// 	}
+		// 	await this.$u.api.dailyPaper.getUserInfo(params).then(res => {
+		// 		this.personList = res.data.records
+		// 		this.choosingFUn(this.personList, this.personCheckedList)
+		// 	})
+		// },
+		search (e) {
+			this.query = {
+				current:1,
+				size:20,
+				staffName: e,
+				divisionName:"鐢熶骇閮�"
+			}
+			this.loadList()
+		},
+		// 鍦ㄦ鍔犺浇鍒楄〃
+		loadList(){
+			this.$u.api.dailyPaper.getUserInfo(this.query).then(res => {
+				console.log(res)
+				if (res.code === 0) {
+					if (!res.data.records || res.data.records.length === 0) {
+						this.loadStatus = "nomore";
+						return;
+					}
+					if (this.query.current === 1) {
+						this.personList = res.data.records
+					} else {
+						this.personList = this.personList.concat(res.data.records);
+					}
+					this.choosingFUn(this.personList, this.personCheckedList)
+					this.total = res.data.total;
+					this.query.current = res.data.current;
+					this.query.size = res.data.size;
+					this.loadStatus = "loadmore";
+				}
+			});
+		},
+		// 鎼滅储涓嶄細浣块�変腑娑堝け
+		/**
+		 *
+		 * @param {涓绘暟鎹垪琛▆ mainList
+		 * @param {閫変腑鐨勬暟鎹垪琛▆ selectList
+		 */
+		choosingFUn(mainList, selectList) {
+			for (const i in mainList) {
+				let isExit = false
+				for (const j in selectList) {
+					if(mainList[i].staffNo === selectList[j].staffNo) {
+						isExit = true
+						this.$set(mainList[i], 'checked', true)
+					}
+				}
+				if(!isExit) {
+					this.$set(mainList[i], 'checked', false)
+				}
+			}
+		},
+		loadMore() {
+			this.loadStatus = "loading";
+			setTimeout(() => {
+				this.query.current += 1;
+				this.loadList();
+			}, 100);
+		},
+	},
+
+}
+</script>
+
+<style scoped lang="scss">
+.work-order-list{
+	width: 100%;
+	height: 100vh;
+	background: #F6F9FF;
+	box-sizing: border-box;
+	padding-bottom: 24rpx;
+	.page-head{
+		height: 750rpx;
+		background-image: url('~@/static/custom/daily/background.png');
+		background-size: 100% auto;
+		background-repeat: no-repeat;
+		.title {
+			font-weight: 500;
+			font-size: 28rpx;
+			color: #6D82A1;
+			margin-left: 30rpx;
+		}
+		.list {
+			overflow-y: auto;
+			padding: 0 30rpx;
+			display: flex;
+			flex-direction: row;
+			flex-wrap: wrap;
+			justify-content: space-between;
+			align-content: flex-start;
+			margin-top: 20rpx;
+			height: calc(100vh - 450rpx);
+			.person-card {
+				margin-top: 30rpx;
+				width: 336rpx;
+				height: 138rpx;
+				background: linear-gradient(180deg, #DFEDFF 0%, #F7F7F8 100%);
+				border-radius: 10rpx;
+				border: 1px solid #FFFFFF;
+				position: relative;
+				display:table-cell; vertical-align:middle;
+				.card-info {
+					display: flex;
+					flex-direction: column;
+					justify-content: center;
+					height: 100%;
+					padding: 0 16rpx;
+					.icon_num {
+						background-image: url('~@/static/custom/daily/icon_num.png');
+						background-repeat: no-repeat;
+						background-size: cover;
+						height: 26rpx;
+						width: 26rpx;
+						position: relative;
+						vertical-align: middle
+					}
+					.icon_person {
+						background-image: url('~@/static/custom/daily/icon_person.png');
+						background-repeat: no-repeat;
+						background-size: cover;
+						height: 26rpx;
+						width: 26rpx;
+						position: relative;
+						vertical-align: middle
+					}
+					.h5-title {
+						font-weight: 500;
+						font-size: 26rpx;
+						color: #666666;
+						margin: 0 6rpx;
+						line-height: 48rpx;
+					}
+					.h5-info {
+						font-weight: 500;
+						font-size: 26rpx;
+						color: #333333;
+						line-height: 48rpx;
+					}
+				}
+				.checkbox {
+					position: absolute;
+					bottom: 12rpx;
+					right: 16rpx;
+				}
+			}
+			.loadmore {
+				margin: 20rpx auto;
+				width: 100%;
+				height: 60rpx;
+			}
+		}
+	}
+	.bottom {
+		width: 100vw;
+		position:fixed;
+		bottom:60rpx;
+		.u-button {
+			width: 690rpx;
+			height: 80rpx;
+			background: #214DED;
+			border-radius: 8rpx;
+			font-weight: 500;
+			font-size: 34rpx;
+			color: #FFFFFF;
+			z-index: 99;
+		}
+	}
+}
+::v-deep.uni-input-placeholder {
+	font-weight: 400;
+	font-size: 30rpx;
+	color: #8992A3;
+	line-height: 80rpx;
+}
+::v-deep.u-checkbox {
+	display: inline;
+}
+::v-deep.u-checkbox__icon-wrap {
+	background: #F5F9FF;
+	border-radius: 2rpx;
+	border: 1px solid #428BF7;
+}
+</style>

--
Gitblit v1.9.3