yusheng 1 сар өмнө
parent
commit
874ca415d9

+ 2 - 2
manifest.json

@@ -2,7 +2,7 @@
     "name" : "智慧工厂",
     "appid" : "__UNI__45B3907",
     "description" : "",
-    "versionName" : "V1.0.3.96",
+    "versionName" : "V1.0.3.97",
     "versionCode" : "100",
     "transformPx" : false,
     "h5" : {
@@ -12,7 +12,7 @@
                     // "target" : "http://192.168.1.110:18086/",
                     // "target" : "http://123.249.79.125/api/",
                     // "target" : "http://192.168.1.251:18086/",
-                    "target" : "http://192.168.1.125:18086/",
+                    "target" : "http://192.168.1.251:18086/",
                     // "target" : "http://110.41.182.105/api/",
                     // "target": "http://116.63.185.248:80/api",
                     // "target" : "http://192.168.1.251:18186/",

+ 5 - 2
pages/index/index.vue

@@ -134,7 +134,7 @@
 					</view>
 				</view>
 			</view>
-			<view v-if="energyManagement.length > 0" :id="'module-zhiliang'" :data-index="10">
+			<view v-if="energyManagement.length > 0" :id="'module-nengyuan'" :data-index="10">
 				<CellTip title="能源管理"></CellTip>
 				<view class="nav">
 					<view class="nav-content">
@@ -159,7 +159,7 @@
 					</view>
 				</view>
 			</view>
-		</view>
+		</view> 
 	</view>
 </template>
 
@@ -274,6 +274,7 @@
 							this.productionList = f.children;
 						} else if (f.path == "operationsList") {
 							const promise = statistics().then((res) => {
+								console.log(3)
 								this.workOrder = res;
 								f.children.forEach((item) => {
 									if (item.name == "保养工单") item.badge = res.maintenanceNum;
@@ -303,6 +304,7 @@
 							this.purchaseManageList = f.children;
 						} else if (f.path == "qualityManage") {
 							const promise = qualityTodoByPda().then((res) => {
+								console.log(2)
 								f.children.forEach((item) => {
 									if (item.name == "质检工单") item.badge = res.workOrderNum;
 									if (item.name == "我的质检工单")
@@ -328,6 +330,7 @@
 				// 等待所有异步数据加载完成后再生成导航
 				if (asyncPromises.length > 0) {
 					Promise.all(asyncPromises).then(() => {
+						console.log(1)
 						this.buildNavList();
 					});
 				} else {

+ 55 - 10
pages/pcs/list.vue

@@ -4,6 +4,10 @@
 		</uni-nav-bar>
 
 		<view class="top-wrapper">
+			<view class="tab-bar">
+				<view class="tab-item" :class="{ active: activeTab === 'mine' }" @click="switchTab('mine')">我的记录</view>
+				<view class="tab-item" :class="{ active: activeTab === 'all' }" @click="switchTab('all')">全部记录</view>
+			</view>
 			<uni-section>
 				<uni-easyinput prefixIcon="search" style="width: 460rpx" v-model="keyWord"
 					placeholder="工单单号,计划单号,记录规则名称">
@@ -11,11 +15,11 @@
 			</uni-section>
 			<button class="search_btn" @click="doSearch">搜索</button>
 		</view>
-		<div style="height: 100rpx; width: 475rpx"></div>
+		<div style="height: 180rpx; width: 475rpx"></div>
 		<view class="wrapper">
 			<u-list @scrolltolower="scrolltolower" class="listContent">
 				<view v-for="(item, index) in tableList" :key="index" style="position: relative">
-					<myCard :item="item" :index="index + 1" :btnList="btnList" :columns="columns" :title="item.code"
+					<myCard :item="item" :index="index + 1" :btnList="activeTab === 'all' ? [] : btnList" :columns="columns" :title="item.code"
 						:status="statusMap[item.status]" @goDetail="goDetail(item, 'view')" @openRedeployOther="openRedeployOther(item)"
 						@edit="goDetail(item, 'edit')">
 					</myCard>
@@ -164,6 +168,7 @@
 				isEnd: false,
 				keyWord: "",
 				userInfo: {},
+				activeTab: 'mine',
 			};
 		},
 		computed: {
@@ -192,6 +197,14 @@
             openRedeployOther(row){
 				 this.$refs.Assign.open(row)
 			},
+			switchTab(tab) {
+				if (this.activeTab === tab) return;
+				this.activeTab = tab;
+				this.isEnd = false;
+				this.page = 1;
+				this.tableList = [];
+				this.getList();
+			},
 			successInit() {
 				uni.showLoading({
 					title: "加载中",
@@ -202,8 +215,10 @@
 					size: this.tableList.length,
 					keyword: this.keyWord,
 					planType: this.planTypeList[this.pageName],
-					currentLoginUserId: this.userInfo.userId,
 				};
+				if (this.activeTab === 'mine') {
+					data.currentLoginUserId = this.userInfo.userId;
+				}
 
 				producetaskrulerecordQueryRecordWorkOrderPage(data)
 					.then((res) => {
@@ -233,8 +248,10 @@
 					size: this.size,
 					keyword: this.keyWord,
 					planType: this.planTypeList[this.pageName],
-					currentLoginUserId: this.userInfo.userId,
 				};
+				if (this.activeTab === 'mine') {
+					data.currentLoginUserId = this.userInfo.userId;
+				}
 
 				producetaskrulerecordQueryRecordWorkOrderPage(data)
 					.then((res) => {
@@ -271,18 +288,46 @@
 	.top-wrapper {
 		background-color: #fff;
 		display: flex;
+		flex-wrap: wrap;
 		width: 750rpx;
-		height: 88rpx;
 		padding: 16rpx 32rpx;
 		align-items: center;
-		// gap: 16rpx;
 		position: absolute;
 		z-index: 999;
-		// top: 44px;
-		// // #ifdef APP-PLUS
-		// top: 140rpx;
 
-		// // #endif
+		.tab-bar {
+			display: flex;
+			width: 100%;
+			margin-bottom: 16rpx;
+			border-bottom: 2rpx solid #eee;
+		}
+
+		.tab-item {
+			flex: 1;
+			text-align: center;
+			padding: 16rpx 0;
+			font-size: 30rpx;
+			color: #666;
+			position: relative;
+
+			&.active {
+				color: $theme-color;
+				font-weight: bold;
+
+				&::after {
+					content: '';
+					position: absolute;
+					bottom: 0;
+					left: 50%;
+					transform: translateX(-50%);
+					width: 60rpx;
+					height: 4rpx;
+					background: $theme-color;
+					border-radius: 4rpx;
+				}
+			}
+		}
+
 		/deep/.uni-section {
 			margin-top: 0px;
 		}