ysy 2 лет назад
Родитель
Сommit
1b5f6d6a4c

+ 11 - 0
api/pda/workOrder.js

@@ -24,4 +24,15 @@ export async function getTaskInstanceList(id) {
     return data.data;
   }
   return Promise.reject(data.message);
+}
+
+// 工单信息
+export async function workorderInfo(id) {
+  const data = await get(
+   Vue.prototype.apiUrl  + `/pda/mes/workorder/getById/${id}`,
+  );
+  if (data.code == 0) {
+    return data.data;
+  }
+  return Promise.reject(data.message);
 }

+ 9 - 0
pages.json

@@ -1329,6 +1329,15 @@
 			}
 		},
 		
+		{
+			"path": "pages/pda/picking/details",
+			"style": {
+				"navigationBarTitleText": "领料",
+				"navigationStyle": "custom",
+				"navigationBarTextStyle": "white"
+			}
+		},
+		
 		{
 			"path": "pages/pda/material_return/index/index",
 			"style": {

+ 11 - 9
pages/pda/components/bottomOperate.vue

@@ -7,7 +7,7 @@
 
 
 		<view class="operate_list" v-show="isOperate">
-			<view v-for="(item, index) in btnList[state]" :key="index" class="list rx-bc">
+			<view v-for="(item, index) in btnList[state]" :key="index" class="list rx-bc" @click="operate(item.type)">
 				<view class="round">{{index + 1}}</view>
 				<view class="name">{{item.name}}</view>
 				<image class="arrow_right" src="~@/static/pda/arrow_right.svg"></image>
@@ -35,9 +35,10 @@
 
 
 				btnList: {
-					'1': [{
-							name: '清缸',
-							type: ''
+					'1': [
+						{
+							name: '领料',
+							type: 'picking'
 						},
 						{
 							name: '投料',
@@ -47,10 +48,7 @@
 							name: '报工',
 							type: ''
 						},
-						{
-							name: '添加附件',
-							type: ''
-						}
+						
 
 					]
 				}
@@ -60,7 +58,11 @@
 		methods: {
 			open() {
 				this.isOperate = !this.isOperate
-			}
+			},
+			
+			operate(type) {
+				this.$emit('operate', type)
+			},
 		}
 	}
 </script>

+ 29 - 7
pages/pda/components/stepsNav.vue

@@ -17,28 +17,50 @@
 			stepsList: {
 				type: Array,
 				default: () => []
+			},
+
+			taskId: {
+				type: String,
+				default: ''
 			}
 		},
 		data() {
 			return {
 				scrollable: true,
 				scrollLeft: 10,
-				activeIndex: 5,
-	
+				activeIndex: 0,
+
 			}
 		},
 		
-		created() {
-			console.log(this.stepsList)
-			this.$nextTick(() => {
-				// this.scrollLeft = 10
-			})
+		watch: {
+			
+			taskId:{
+			    immediate: true,
+				deep: true,
+			    handler(newVal){
+				 this.activeIndex = this.getIndexOfElementInArray(this.stepsList, newVal)
+			    }
+			}
 		},
+		
+		
+
+	
 
 		methods: {
 			selectStep(item) {
 				console.log(item);
 			},
+			
+			 getIndexOfElementInArray(array, target) {
+			    for (let i = 0; i < array.length; i++) {
+			        if (array[i].taskId === target) {
+			            return i; // 返回第一次出现target的索引位置
+			        }
+			    }
+			    return -1; // 未找到目标值时返回-1
+			}
 
 
 		}

+ 307 - 0
pages/pda/picking/details.vue

@@ -0,0 +1,307 @@
+<template>
+	<view class="content-box">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="领料" background-color="#F7F9FA"
+			color="#404446" @clickLeft="back"></uni-nav-bar>
+
+		<view class="list_box">
+			<u-list @scrolltolower="scrolltolower">
+
+				<view v-for="(item,index) in idsList" :key="index" class="card_box">
+					<view class="title_box rx-bc">
+						<view class="left rx-sc">
+							<view class="round">{{index + 1}}</view>
+							<view class="code">工单编号:{{item.code}}</view>
+						</view>
+
+						<view class="right_box rx-ec">
+							<view class="btn">添加物料</view>
+						</view>
+
+					</view>
+
+					<view class="material rx-ss">
+
+						<view class="left rx-ss" @click="item.checked = ! item.checked">
+							<view class="zdy_check rx-cc" :class="{ check_active : item.checked  }">
+								<u-icon size="28" v-if='item.checked' name='checkbox-mark'></u-icon>
+							</view>
+						</view>
+						<view class="content_table">
+							<view class="item">
+								<view class="lable rx-cc">物料编码</view>
+								<view class="content">
+									624644626624644626624644626</view>
+							</view>
+
+							<view class="item">
+								<view class="lable rx-cc">名称</view>
+								<view class="content">物料名称物料名称物料</view>
+							</view>
+
+							<view class="item rx-sc">
+								<view class="rx ww55 ">
+									<view class="lable rx-cc">牌号</view>
+									<view class="content ">YL10Y</view>
+								</view>
+
+								<view class="rx ww45" >
+									<view class="lable rx-cc ww80" >数量</view>
+									<view class="content content_num">
+											<input class="uni-input"   type="digit"></input>
+											<view class="unit">kg</view>
+									</view>
+								</view>
+
+							</view>
+							
+							
+							<view class="item">
+								<view class="lable rx-cc">领料仓库</view>
+								<view class="content">
+							<zxz-uni-data-select :localdata="localdata"  v-model="value"
+								 dataValue='id' format='{name}' :clear='false'></zxz-uni-data-select>
+								</view>
+							</view>
+
+						</view>
+					</view>
+				</view>
+			</u-list>
+
+		</view>
+
+		<view class="bottom-wrapper">
+			<view class="btn_box" @click="save">确认</view>
+			
+		</view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				idsList: [{
+					checked: false,
+					code: 55
+				}],
+				
+				value: 2,
+				localdata: [
+					{
+						id: 1,
+						name: '测试'
+					},
+					{
+						id: 2,
+						name: '测试2'
+					}
+				],
+
+			}
+		},
+		onLoad(options) {
+			// let queryArray = decodeURIComponent(options.arr);
+			// this.idsList = JSON.parse(queryArray);
+
+			console.log(this.idsList)
+
+		},
+
+		methods: {
+			scrolltolower() {},
+
+			save() {
+				console.log(this.idsList)
+			},
+
+			groupChange(n) {
+				console.log('groupChange', n);
+			},
+			
+			handleUserChange(e) {
+				console.log(e)
+			}
+
+		},
+
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content-box {
+		height: 100vh;
+		overflow: hidden;
+		display: flex;
+		flex-direction: column;
+
+	}
+
+
+	.list_box {
+		flex: 1;
+		overflow: hidden;
+		padding: 4rpx 0;
+
+		.u-list {
+			height: 100% !important;
+		}
+
+		.card_box {
+			padding: 16rpx 24rpx;
+			
+
+		}
+
+
+		.title_box {
+			.round {
+				width: 32rpx;
+				height: 32rpx;
+				line-height: 32rpx;
+				border-radius: 50%;
+				background: $theme-color;
+				color: #fff;
+				text-align: center;
+				font-size: 20rpx;
+			}
+
+			.code {
+				margin-left: 16rpx;
+				font-family: PingFang SC;
+				font-size: 28rpx;
+				font-style: normal;
+				font-weight: 400;
+				color: $theme-color;
+			}
+		}
+
+		.right_box {
+			.btn {
+				height: 40rpx;
+				line-height: 40rpx;
+				padding: 4rpx 8rpx;
+				background: #157A2C;
+				font-size: 24rpx;
+				font-style: normal;
+				font-weight: 400;
+				color: #fff;
+				border-radius: 4rpx;
+			}
+
+		}
+
+
+		.material {
+			margin-top: 10rpx;
+
+			.left {
+				width: 40rpx;
+			}
+
+			.zdy_check {
+				width: 30rpx;
+				height: 30rpx;
+				border: 2rpx solid #c8c9cc;
+				border-radius: 4rpx;
+
+
+			}
+
+			.check_active {
+				background: $theme-color;
+				border: 2rpx solid $theme-color;
+
+				/deep/ .u-icon__icon {
+					color: #fff !important;
+				}
+			}
+
+			.content_table {
+				width: 652rpx;
+				border: 2rpx solid $border-color;
+
+				.item {
+					display: flex;
+					border-bottom: 2rpx solid $border-color;
+
+
+					.lable {
+						width: 132rpx;
+						text-align: center;
+						background-color: #F7F9FA;
+						font-size: 26rpx;
+						border-right: 2rpx solid $border-color;
+						flex-shrink: 0;
+					}
+
+					.ww80 {
+						width: 80rpx;
+					}
+
+					.content {
+						width: 518rpx;
+						min-height: 64rpx;
+						font-size: 28rpx;
+						line-height: 28rpx;
+						font-style: normal;
+						font-weight: 400;
+						padding: 18rpx 8rpx;
+						box-sizing: border-box;
+						word-wrap: break-word;
+						flex-grow: 1 !important;
+
+					}
+					
+					.content_num{
+						display: flex;
+						align-items: center;
+						padding:0 4rpx;
+						/deep/ .uni-input-input{
+							border: 2rpx solid #F0F8F2;
+							background:#F0F8F2;
+							color: $theme-color;
+						}
+						
+						.unit{
+							 padding: 0 4rpx;
+							 font-size: 24rpx;
+							 color: #404446;
+						}
+					}
+					
+					
+
+					&:last-child {
+						border-bottom: none;
+					}
+				}
+
+				.ww55 {
+					width: 55%;
+				}
+
+				.ww45 {
+					width: 45%;
+				}
+			}
+		}
+
+
+	}
+
+	.bottom-wrapper {
+		.btn_box {
+			width: 750rpx;
+			height: 88rpx;
+			line-height: 88rpx;
+			background: $theme-color;
+			text-align: center;
+			font-size: 36rpx;
+			font-style: normal;
+			font-weight: 400;
+			color: #fff;
+		}
+	}
+</style>

+ 46 - 17
pages/pda/workOrder/extrusionMolding/index.vue

@@ -5,7 +5,7 @@
 
 
 		<view class="top-wrapper cx">
-			<stepsNav :stepsList="stepsList"></stepsNav>
+			<stepsNav  :stepsList="stepsList" :taskId="info.taskId"></stepsNav>
 
 			<view class="tab_box rx-sc">
 				<view class="tab_item" :class="{active: tabType == 1}" @click="handTab(1)">基本信息</view>
@@ -19,69 +19,69 @@
 			<u-list @scrolltolower="scrolltolower" key="info" v-if="tabType == 1">
 				<view class="item_list rx-bc">
 					<text class="lable">生产工单号</text>
-					<text>21122403906633005</text>
+					<text>{{ info.code }}</text>
 				</view>
 
 				<view class="item_list rx-bc">
 					<text class="lable">计划编号</text>
-					<text>211224039</text>
+					<text>{{ info.productionPlanCode }}</text>
 				</view>
 
 				<view class="item_list rx-bc">
 					<text class="lable">工艺路线版本</text>
-					<text>2.0</text>
+					<text>{{ info.routingVersion }}</text>
 				</view>
 
 				<view class="item_list rx-bc">
 					<text class="lable">产品编码</text>
-					<text>W05363955011</text>
+					<text> {{ info.productCode }}</text>
 				</view>
 
 
 				<view class="item_list rx-bc">
 					<text class="lable">产品名称</text>
-					<text>木工刀</text>
+					<text>{{ info.productName }}</text>
 				</view>
 
 
 				<view class="item_list rx-bc">
 					<text class="lable">牌号</text>
-					<text>H25.5</text>
+					<text>{{ info.brandNo }}</text>
 				</view>
 
 
 				<view class="item_list rx-bc">
 					<text class="lable">型号</text>
-					<text>H25.5</text>
+					<text>{{info.model}}</text>
 				</view>
 
 
 				<view class="item_list rx-bc">
 					<text class="lable">要求成型数量</text>
-					<text>1000 PCS</text>
+					<text>{{info.formingNum }} </text>
 				</view>
 
 
 
 				<view class="item_list rx-bc">
 					<text class="lable">要求成型重量</text>
-					<text>850.5 KG</text>
+					<text>{{ info.formingWeight }} KG</text>
 				</view>
 
 				<view class="item_list rx-bc">
 					<text class="lable">已完成生产数量</text>
-					<text>293 PCS</text>
+					<text></text>
 				</view>
 
 
 				<view class="item_list rx-bc">
 					<text class="lable">已完成生产重量</text>
-					<text>85.5 KG</text>
+					<text></text>
 				</view>
 
 				<view class="item_list rx-bc">
 					<text class="lable">计划开始时间</text>
-					<text>2023/08/10 02:00:00</text>
+					<text>{{ info.planStartTime }}</text>
 				</view>
 
 
@@ -111,7 +111,7 @@
 		</view>
 
 		<view class="bottom-wrapper">
-			<bottomOperate state='1'></bottomOperate>
+			<bottomOperate state='1' @operate='operate'></bottomOperate>
 		</view>
 
 	</view>
@@ -121,7 +121,7 @@
 	import bottomOperate from '../../components/bottomOperate.vue'
 	import stepsNav from '../../components/stepsNav.vue'
 	
-		import { getTaskInstanceList } from '@/api/pda/workOrder.js'
+		import { getTaskInstanceList, workorderInfo } from '@/api/pda/workOrder.js'
 	export default {
 		components: {
 			bottomOperate,
@@ -134,6 +134,8 @@
 				id: null,
 				
 				stepsList: [],
+				info: {},
+				taskId: null,
 
 				detailList: [{
 						name: '挤压成型',
@@ -172,9 +174,14 @@
 
 		onLoad(options) {
 			this.title = options.title
-			
 			this.id = options.id
+			
+			uni.showLoading({
+				title: '加载中'
+			});
+			
 			this.getSteps()
+			this.getInfo()
 
 		},
 
@@ -194,7 +201,29 @@
 					this.title = this.stepsList[0].taskTypeName
 					}
 				})
-			}
+			},
+			
+			getInfo() {
+				workorderInfo(this.id).then(res => {
+					this.info = res
+					uni.hideLoading();
+				}).catch(() => {
+					uni.hideLoading();
+				})
+			},
+			
+			operate(type) {
+				let url  
+				if(type == 'picking') {
+				url = '/pages/pda/picking/details'
+				let _arr = JSON.stringify([{id: this.info.id, code: this.info.code }])
+				url += `?arr=${encodeURIComponent(_arr)}&taskId=${this.info.taskId}`
+				uni.navigateTo({
+					url
+				})
+				}
+	
+			},
 		}
 	}
 </script>

+ 1 - 3
pages/pda/workOrder/index/index.vue

@@ -37,7 +37,7 @@
 
 <script>
 	import workCard from '../../components/workCard.vue'
-	import { getTaskInstanceList } from '@/api/pda/workOrder.js'
+
 	import {
 		workorderPage
 	} from '@/api/pda/workOrder.js'
@@ -97,8 +97,6 @@
 
 
 			handleDetail(item) {
-
-
 				let url = '/pages/pda/workOrder/extrusionMolding/index'
 				url += `?id=${item.id}&title=${item.produceTaskInstanceName}`
 				console.log(url)

+ 5 - 0
static/pda/ScanIt.svg

@@ -0,0 +1,5 @@
+<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="&#228;&#186;&#140;&#231;&#187;&#180;&#231;&#160;&#129;">
+<path id="Vector" d="M1.75 7H12.25M4.375 1.75H2.91667C2.27233 1.75 1.75 2.27233 1.75 2.91667V4.375M9.625 1.75H11.0833C11.7277 1.75 12.25 2.27233 12.25 2.91667V4.375M12.25 9.625V11.0833C12.25 11.7277 11.7277 12.25 11.0833 12.25H9.625M4.375 12.25H2.91667C2.27233 12.25 1.75 11.7277 1.75 11.0833V9.625" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
+</g>
+</svg>

+ 1 - 0
uni.scss

@@ -16,6 +16,7 @@
 $j-primary-green:#33cc66; //主题颜色 - 绿色
 $j-primary-border-green: #157a2c;
 $theme-color: #157A2C;
+$border-color: #E3E5E5;
 
 $page-bg: #f0f0f0;
 $page-tip-bg: #e8e8e8;

+ 1 - 1
utils/request.js

@@ -36,7 +36,7 @@ const http = ({
       header: header,
       ...other,
       complete: (res) => {
-        console.log('res',url, res)
+    
         if (showLoading) {
           uni.hideLoading();
         }