From 5e234e7e92f694cb40ad395f10544e5e2faa3318 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期三, 06 八月 2025 15:10:17 +0800
Subject: [PATCH] 委外工序接收单 添加工序/部门选择框 流转卡添加搜索按钮

---
 pages/index/tab2.vue |  452 +++++++++++++++++++++++++++++++++----------------------
 1 files changed, 271 insertions(+), 181 deletions(-)

diff --git a/pages/index/tab2.vue b/pages/index/tab2.vue
index ae14c60..f4f8f34 100644
--- a/pages/index/tab2.vue
+++ b/pages/index/tab2.vue
@@ -1,12 +1,25 @@
 <template>
 	<view class="content">
+		<view class="header">
+			<view class="switch-button">
+				<uni-icons type="loop" @click="switchIconsModeHandler"></uni-icons>
+			</view>
+		</view>
 		<view class="mains">
-			<view class="box" v-for="(item,index) in itemData" :key="index" @tap="toUrl(item)">
+			<view v-if="!canEdit" :hidden="item.hidden" class="box" v-for="(item,index) in itemData" :key="index"
+				@tap="toUrl(item)">
 				<image :src="item.img" mode=""></image>
 				<view class="texts">
 					{{item.text}}
 				</view>
-				<!-- <uni-icons type="forward" color="#888" style="position: absolute;right: 40rpx;" size="18"></uni-icons> -->
+			</view>
+			<view :enable-hidden="item.hidden" v-if="canEdit" class="box edit" v-for="(item,index) in itemData"
+				:key="index" @tap="switchHidden(index)">
+				<uni-icons class="edit-mark" color="red" type="closeempty"></uni-icons>
+				<image :src="item.img" mode=""></image>
+				<view class="texts">
+					{{item.text}}
+				</view>
 			</view>
 		</view>
 	</view>
@@ -14,208 +27,267 @@
 
 <script>
 	export default {
-	    data() {
-	        return {
-				serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
-				itemData:[{
-						img:'../../static/icon/icon17.png',
-						text:'閲囪喘鍏ュ簱鏆傚瓨鍒楄〃',
-						url:'/pages/caigouruku/table',
-						id:1
-					},{
-						img:'../../static/icon/icon18.png',
-						text:'閲囪喘閫�鏂欐殏瀛樺垪琛�',
-						url:'/pages/caigoutuiliao/table',
-						id:2,
-					},{
-						img:'../../static/icon/icon17.png',
-						text:'鍏朵粬鍏ュ簱鏆傚瓨鍒楄〃',
-						url:'/pages/qitaruku_v2/table',
-						id:3,
-					},{
-						img:'../../static/icon/icon18.png',
-						text:'鍏朵粬鍑哄簱鏆傚瓨鍒楄〃',
-						url:'/pages/qitachuku_v2/table',
-						id:4,
-					},{
-						img:'../../static/icon/icon32.png',
-						text:'鐩存帴璋冩嫧鏆傚瓨鍒楄〃',
-						url:'/pages/zhijiediaobo/table',
-						id:5,
-					},{
-						img:'../../static/icon/icon30.png',
-						text:'鐢熶骇棰嗘枡鏆傚瓨鍒楄〃',
-						url:'/pages/shengchanlingliaoshengdan/table',
-						id:6,
-					},{
-						img:'../../static/icon/icon31.png',
-						text:'鐢熶骇琛ユ枡鏆傚瓨鍒楄〃',
-						url: '/pages/shengchanbuliao/table' ,
-						// url: '',
-						id:7,
-					},{
-						img:'../../static/icon/icon17.png',
-						text:'鐢熶骇鍏ュ簱鏆傚瓨鍒楄〃',
-						url:'/pages/shengchanrukushengdan/table',
-						// url:'',
-						id:8,
-					},{
-						img:'../../static/icon/icon30.png',
-						text:'濮斿棰嗘枡鏆傚瓨鍒楄〃',
-						// url:'',
-						url:'/pages/weiwailingliao/table',
-						id:9,
-					},{
-						img:'../../static/icon/icon18.png',
-						text:'閿�鍞嚭搴撴殏瀛樺垪琛�',
-						url:'/pages/xiaoshouchuku/table',
-						id:10,
-					},{
-						img:'../../static/icon/icon20.png',
-						text:'閿�鍞��璐ф殏瀛樺垪琛�',
-						url:'/pages/xiaoshoutuihuo/table',
-						id:11
-					},{
-						img:'../../static/icon/icon30.png',
-						text:'鐢熶骇棰嗘枡鏍¢獙鏆傚瓨鍒楄〃',
-						url:'/pages/shengchanlingliao/table',
-						id:12,
-					},{
-						img:'../../static/icon/icon31.png',
-						text:'鐢熶骇琛ユ枡鏍¢獙鏆傚瓨鍒楄〃',
-						url:'/pages/shengchanbuliaojiaoyan/CacheList',
-						id:13,
-					},{
-						img:'../../static/icon/icon32.png',
-						text:'鐢熶骇璋冩嫧鏍¢獙鏆傚瓨鍒楄〃',
-						url:'/pages/shengchandiaobo/table',
-						id:14,
-					},{
-						img:'../../static/icon/icon18.png',
-						text:'鍏朵粬鍑哄簱鏍¢獙鏆傚瓨鍒楄〃',
-						url:'/pages/qitachuku/qitachuku',
-						id:15,
-					},{
-						img:'../../static/icon/icon17.png',
-						text:'鐢熶骇鍏ュ簱鏍¢獙鏆傚瓨鍒楄〃',
-						url:'/pages/shengchanruku/table',
-						id:16,
-					},{
-						img:'../../static/icon/icon18.png',
-						text:'閿�鍞嚭搴撴牎楠屾殏瀛樺垪琛�',
-						url:'/pages/xiaoshouchukujiaoyan/table',
-						id:17,
-					},{
-						img:'../../static/icon/icon30.png',
-						text:'濮斿棰嗘枡鏍¢獙鏆傚瓨鍒楄〃',
-						url:'/pages/weiwailingliaojiaoyan/table',
-						id:18,
-					},{
-						img:'../../static/icon/icon3.png',
-						text:'璁惧淇濆吇璁板綍鍗�',
-						url:'/pages/baoyangjilu/table',
-						id:19,
-					},{
-						img:'../../static/icon/icon5.png',
-						text:'璁惧鐐规璁板綍鍗�',
-						url:'',
-						id:20,
-					},{
-						img:'../../static/icon/icon6.png',
-						text:'璁惧鏁呴殰鐧昏琛�',
-						url:'/pages/guzhangdengji/table',
-						id:21,
-					},{
-						img:'../../static/icon/icon7.png',
-						text:'璁惧缁翠慨璁板綍鍗�',
-						url:'/pages/shebeiweixiu/table',
-						id:22,
-					},{
-						img:'../../static/icon/icon15.png',
-						text:'寮傚父鍙嶉鍗�',
-						url:'/pages/yichang/table',
-						id:23,
-					},{
-						img:'../../static/icon/icon16.png',
-						text:'寮傚父鍙嶉澶勭悊鍗�',
-						url:'/pages/yichang/list',
-						id:24,
-					},{
-						img:'../../static/icon/icon21.png',
-						text:'鏍囩鎵撳嵃',
-						url:'/pages/labelPrinter/index',
-						id:25,
-					},{
-						img:'../../static/icon/icon21.png',
-						text:'鏉$爜鎷嗙爜',
-						url:'/pages/tiaomachaima/tiaomachaima',
-						id:26,
-					}]
-	        }
-	    },
-		onLoad() {
-		
+		data() {
+			return {
+				canEdit: false,
+				serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
+				itemData: [{
+					img: '../../static/icon/icon17.png',
+					text: '閲囪喘鍏ュ簱鏆傚瓨鍒楄〃',
+					url: '/pages/caigouruku/table',
+					id: 1,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon18.png',
+					text: '閲囪喘閫�鏂欐殏瀛樺垪琛�',
+					url: '/pages/caigoutuiliao/table',
+					id: 2,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon17.png',
+					text: '鍏朵粬鍏ュ簱鏆傚瓨鍒楄〃',
+					url: '/pages/qitaruku_v2/table',
+					id: 3,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon18.png',
+					text: '鍏朵粬鍑哄簱鏆傚瓨鍒楄〃',
+					url: '/pages/qitachuku_v2/table',
+					id: 4,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon32.png',
+					text: '鐩存帴璋冩嫧鏆傚瓨鍒楄〃',
+					url: '/pages/zhijiediaobo/table',
+					id: 5,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon30.png',
+					text: '鐢熶骇棰嗘枡鏆傚瓨鍒楄〃',
+					url: '/pages/shengchanlingliaoshengdan/table',
+					id: 6,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon31.png',
+					text: '鐢熶骇琛ユ枡鏆傚瓨鍒楄〃',
+					url: '/pages/shengchanbuliao/table',
+					// url: '',
+					id: 7,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon17.png',
+					text: '鐢熶骇鍏ュ簱鏆傚瓨鍒楄〃',
+					url: '/pages/shengchanrukushengdan/table',
+					// url:'',
+					id: 8,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon30.png',
+					text: '濮斿棰嗘枡鏆傚瓨鍒楄〃',
+					// url:'',
+					url: '/pages/weiwailingliao/table',
+					id: 9,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon18.png',
+					text: '閿�鍞嚭搴撴殏瀛樺垪琛�',
+					url: '/pages/xiaoshouchuku/table',
+					id: 10,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon20.png',
+					text: '閿�鍞��璐ф殏瀛樺垪琛�',
+					url: '/pages/xiaoshoutuihuo/table',
+					id: 11,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon30.png',
+					text: '鐢熶骇棰嗘枡鏍¢獙鏆傚瓨鍒楄〃',
+					url: '/pages/shengchanlingliao/table',
+					id: 12,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon31.png',
+					text: '鐢熶骇琛ユ枡鏍¢獙鏆傚瓨鍒楄〃',
+					url: '/pages/shengchanbuliaojiaoyan/CacheList',
+					id: 13,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon32.png',
+					text: '鐢熶骇璋冩嫧鏍¢獙鏆傚瓨鍒楄〃',
+					url: '/pages/shengchandiaobo/table',
+					id: 14,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon18.png',
+					text: '鍏朵粬鍑哄簱鏍¢獙鏆傚瓨鍒楄〃',
+					url: '/pages/qitachuku/qitachuku',
+					id: 15,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon17.png',
+					text: '鐢熶骇鍏ュ簱鏍¢獙鏆傚瓨鍒楄〃',
+					url: '/pages/shengchanruku/table',
+					id: 16,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon18.png',
+					text: '閿�鍞嚭搴撴牎楠屾殏瀛樺垪琛�',
+					url: '/pages/xiaoshouchukujiaoyan/table',
+					id: 17,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon30.png',
+					text: '濮斿棰嗘枡鏍¢獙鏆傚瓨鍒楄〃',
+					url: '/pages/weiwailingliaojiaoyan/table',
+					id: 18,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon3.png',
+					text: '璁惧淇濆吇璁板綍鍗�',
+					url: '/pages/baoyangjilu/table',
+					id: 19,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon5.png',
+					text: '璁惧鐐规璁板綍鍗�',
+					url: '',
+					id: 20,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon6.png',
+					text: '璁惧鏁呴殰鐧昏琛�',
+					url: '/pages/guzhangdengji/table',
+					id: 21,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon7.png',
+					text: '璁惧缁翠慨璁板綍鍗�',
+					url: '/pages/shebeiweixiu/table',
+					id: 22,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon15.png',
+					text: '寮傚父鍙嶉鍗�',
+					url: '/pages/yichang/table',
+					id: 23,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon16.png',
+					text: '寮傚父鍙嶉澶勭悊鍗�',
+					url: '/pages/yichang/list',
+					id: 24,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon21.png',
+					text: '鏍囩鎵撳嵃',
+					url: '/pages/labelPrinter/index',
+					id: 25,
+					hidden: false,
+				}, {
+					img: '../../static/icon/icon21.png',
+					text: '鏉$爜鎷嗙爜',
+					url: '/pages/tiaomachaima/tiaomachaima',
+					id: 26,
+					hidden: false,
+				}]
+			}
 		},
-	    methods: {
-			toUrl(item){
-				if(item.url){
-					uni.navigateTo({
-						url:item.url
+		onLoad() {
+			this.getHiddenItem()
+		},
+		methods: {
+			getHiddenItem() {
+				let itemCache = uni.getStorageSync('HTab2ItemData') || ''
+				console.log('itemCache: ', itemCache);
+				if (itemCache !== '') {
+					this.itemData = itemCache
+				}
+			},
+			switchHidden(index) {
+				this.itemData[index].hidden = !this.itemData[index].hidden
+			},
+			switchIconsModeHandler() {
+				this.canEdit = !this.canEdit
+				if (this.canEdit == false) {
+					this.$nextTick(() => {
+						uni.setStorageSync("HTab2ItemData", this.itemData)
 					})
-				}else{
+				}
+				this.$forceUpdate()
+			},
+			toUrl(item) {
+				if (item.url) {
+					uni.navigateTo({
+						url: item.url
+					})
+				} else {
 					uni.showToast({
-						title:'鍔熻兘寮�鍙戜腑銆傘�傘��',
-						icon:'none'
+						title: '鍔熻兘寮�鍙戜腑銆傘�傘��',
+						icon: 'none'
 					})
 				}
 			}
-	    }
+		}
 	}
 </script>
 
 <style lang="scss" scoped>
-// .mains{
-// 	width: 720rpx;
-// 	margin: 0 auto;
-// 	display: flex;
-// 	flex-wrap: wrap;
-// 	margin-top: 10rpx;
-// 	padding-bottom: 80rpx;
-// 	.box{
-// 		width: 100%;
-// 		margin: 26rpx 26rpx 0 26rpx;
-// 		padding: 0 0 16rpx 10rpx;
-// 		display: flex;
-// 		align-items: center;
-// 		border-bottom: 1px solid #f0f0f0;
-// 		image{
-// 			width: 52rpx;
-// 			height: 52rpx;
-// 		}
-// 		.texts{
-// 			font-size: 30rpx;
-// 			color: #333333;
-// 			margin-left: 30rpx;
-// 		}
-// 	}
-// }
+	// .mains{
+	// 	width: 720rpx;
+	// 	margin: 0 auto;
+	// 	display: flex;
+	// 	flex-wrap: wrap;
+	// 	margin-top: 10rpx;
+	// 	padding-bottom: 80rpx;
+	// 	.box{
+	// 		width: 100%;
+	// 		margin: 26rpx 26rpx 0 26rpx;
+	// 		padding: 0 0 16rpx 10rpx;
+	// 		display: flex;
+	// 		align-items: center;
+	// 		border-bottom: 1px solid #f0f0f0;
+	// 		image{
+	// 			width: 52rpx;
+	// 			height: 52rpx;
+	// 		}
+	// 		.texts{
+	// 			font-size: 30rpx;
+	// 			color: #333333;
+	// 			margin-left: 30rpx;
+	// 		}
+	// 	}
+	// }
+
+	.header {
+		width: 100%;
+		height: 2em;
+		position: relative;
+
+		.switch-button {
+			position: absolute;
+			right: 10rpx;
+			bottom: 0;
+		}
+	}
+
 	.mains {
 		width: 720rpx;
 		margin: 0 auto;
 		display: flex;
 		flex-wrap: wrap;
 		padding-bottom: 80rpx;
-	
+
 		.box {
 			width: 25%;
 			margin-top: 2.5vh;
 			text-align: center;
-	
+
 			image {
 				width: 18vw;
 				height: 18vw;
 			}
-	
+
 			.texts {
 				width: 120rpx;
 				margin: 0 auto;
@@ -225,5 +297,23 @@
 				margin-top: .2vh;
 			}
 		}
+
+		.edit {
+			position: relative;
+		}
+
+		.edit-mark {
+			position: absolute;
+			top: 0;
+			right: 0;
+		}
+
+		view[enable-hidden] {
+			opacity: .4 !important;
+		}
+
+		view[hidden] {
+			display: none;
+		}
 	}
-</style>
+</style>
\ No newline at end of file

--
Gitblit v1.9.1