ysy 2 lat temu
rodzic
commit
f910cf9265

+ 25 - 0
api/pda/jobBooking.js

@@ -0,0 +1,25 @@
+import { postJ, post, get } from "@/utils/request";
+import Vue from "vue";
+
+// 报工  工单信息
+export async function getByIdReport(id, taskId) {
+  const data = await get(
+   Vue.prototype.apiUrl  + `/pda/mes/workorder/getByIdReport/${id}/${taskId}`,
+  );
+  if (data.code == 0) {
+    return data.data;
+  }
+  return Promise.reject(data.message);
+}
+
+// 报工-pad扫码切换工单
+
+export async function getByCodeReport(code, taskId) {
+  const data = await get(
+   Vue.prototype.apiUrl  + `/pda/mes/workorder/getByCodeReport/${code}/${taskId}`,
+  );
+  if (data.code == 0) {
+    return data.data;
+  }
+  return Promise.reject(data.message);
+}

+ 101 - 88
api/pda/workOrder.js

@@ -1,89 +1,93 @@
-import { postJ, post, get } from "@/utils/request";
+import {
+	postJ,
+	post,
+	get
+} from "@/utils/request";
 import Vue from "vue";
 
 
 // 工单列表
 export async function workorderPage(params) {
-  const data = await postJ(
-   Vue.prototype.apiUrl  + `/pda/mes/workorder/page`, params, true,
-  );
-  if (data.code == 0) {
-    return data.data;
-  }
-  return Promise.reject(data.message);
+	const data = await postJ(
+		Vue.prototype.apiUrl + `/pda/mes/workorder/page`, params, true,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
 }
 
 
 // 根据工单id获取工序列表
 
 export async function getTaskInstanceList(id) {
-  const data = await get(
-   Vue.prototype.apiUrl  + `/pda/mes/workorder/getTaskInstanceById/${id}`,
-  );
-  if (data.code == 0) {
-    return data.data;
-  }
-  return Promise.reject(data.message);
+	const data = await get(
+		Vue.prototype.apiUrl + `/pda/mes/workorder/getTaskInstanceById/${id}`,
+	);
+	if (data.code == 0) {
+		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);
+	const data = await get(
+		Vue.prototype.apiUrl + `/pda/mes/workorder/getById/${id}`,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
 }
 
 
 // 根据工单ids获取工单列表
 
 export async function workorderList(params) {
-  const data = await postJ(
-   Vue.prototype.apiUrl  + `/pda/mes/workorder/list`, params, true,
-  );
-  if (data.code == 0) {
-    return data.data;
-  }
-  return Promise.reject(data.message);
+	const data = await postJ(
+		Vue.prototype.apiUrl + `/pda/mes/workorder/list`, params, true,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
 }
 
 
 // 父级ID查询分类树
-export async function  treeByPid(params) {
-  const data = await get(
-   Vue.prototype.apiUrl  + `/pda/main/categoryLevel/pdaTreeByPid`, params,  true,
-  );
-  if (data.code == 0) {
-    return data.data;
-  }
-  return Promise.reject(data.message);
+export async function treeByPid(params) {
+	const data = await get(
+		Vue.prototype.apiUrl + `/pda/main/categoryLevel/pdaTreeByPid`, params, true,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
 }
 
 
 
 // 查询库存台账首页列表
-export async function  pageeLedgerMain(params) {
-  const data = await get(
-   Vue.prototype.apiUrl  + `/wms/outin/getRealTimeInventory`, params,  true,
-  );
-  if (data.code == 0) {
-    return data.data;
-  }
-  return Promise.reject(data.message);
+export async function pageeLedgerMain(params) {
+	const data = await get(
+		Vue.prototype.apiUrl + `/wms/outin/getRealTimeInventory`, params, true,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
 }
 
 // 
-export async function  assetPage(params) {
-  const data = await get(
-   Vue.prototype.apiUrl  + `/main/asset/pdaPage`, params,  true,
-  );
-  if (data.code == 0) {
-    return data.data;
-  }
-  return Promise.reject(data.message);
+export async function assetPage(params) {
+	const data = await get(
+		Vue.prototype.apiUrl + `/main/asset/pdaPage`, params, true,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
 }
 
 
@@ -91,53 +95,62 @@ export async function  assetPage(params) {
 
 // 生产明细
 export async function produceDetail(id) {
-  const data = await get(
-   Vue.prototype.apiUrl  + `/pda/mes/workorder/produceDetail/${id}`,
-  );
-  if (data.code == 0) {
-    return data.data;
-  }
-  return Promise.reject(data.message);
+	const data = await get(
+		Vue.prototype.apiUrl + `/pda/mes/workorder/produceDetail/${id}`,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
 }
 
 
 // 工艺路线
-export async function  producerouting(params) {
-  const data = await get(
-   Vue.prototype.apiUrl  + `/main/producerouting/page`, params,  true,
-  );
-  if (data.code == 0) {
-    return data.data;
-  }
-  return Promise.reject(data.message);
+export async function producerouting(params) {
+	const data = await get(
+		Vue.prototype.apiUrl + `/main/producerouting/page`, params, true,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
 }
 
 
-// 扫码切换工单
-
-export async function  getByCode(code) {
-  const data = await get(
-   Vue.prototype.apiUrl  + `/pda/mes/workorder/getByCode/${code}`
-  );
-
-  if (data.code == 0) {
-    return data.data;
-  }
-  return Promise.reject(data.message);
+// PDA检查投料状态
+export async function checkStatus(id,taskId) {
+	const data = await get(
+		Vue.prototype.apiUrl + `/pda/mes/feed/checkStatus/${id}/${taskId}`,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
 }
 
-// 扫码 获取台账
 
-export async function  scanLedger(code) {
-  const data = await get(
-   Vue.prototype.apiUrl  + `/main/asset/getByCode/${code}`
-  );
+// 扫码切换工单
+
+export async function getByCode(code) {
+	const data = await get(
+		Vue.prototype.apiUrl + `/pda/mes/workorder/getByCode/${code}`
+	);
 
-  if (data.code == 0) {
-    return data.data;
-  }
-  return Promise.reject(data.message);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
 }
 
+// 扫码 获取台账
 
+export async function scanLedger(code) {
+	const data = await get(
+		Vue.prototype.apiUrl + `/main/asset/getByCode/${code}`
+	);
 
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
+}

+ 1 - 1
pages/pda/feeding/components/modelBom.vue

@@ -81,7 +81,7 @@
 			},
 
 			handleScan(id) {
-				this.$emit('scanIt', id, )
+				this.$emit('scanIt', id )
 			},
 		}
 	}

+ 9 - 1
pages/pda/feeding/details.vue

@@ -69,6 +69,7 @@
 				title: '',
 				idsList: [],
 				List: [],
+				taskId: null
 
 
 			}
@@ -78,6 +79,9 @@
 			let queryArray = decodeURIComponent(options.arr);
 			this.idsList = JSON.parse(queryArray);
 
+			this.taskId = options.taskId
+			this.taskName = options.taskName
+
 
 			this.getList()
 
@@ -112,7 +116,7 @@
 				})
 
 
-		
+
 
 
 
@@ -153,6 +157,10 @@
 						m.modelList = [] // 模具
 						m.instanceList = [] // 投料
 						delete m.id
+						if (this.taskId) {
+							m.taskId = this.taskId
+							m.taskName = this.taskName
+						}
 						return {
 							...m
 						}

+ 260 - 0
pages/pda/jobBooking/components/jobBom.vue

@@ -0,0 +1,260 @@
+<template>
+	<view>
+		<view class="title_box rx-bc">
+			<view class="name">报工信息</view>
+
+
+		</view>
+
+
+		<view class="material ">
+
+
+			<view class="content_table">
+
+				<view class="item rx-sc">
+					<view class="rx ww55 ">
+						<view class="lable lable150 rx-cc ">要求成型数量</view>
+						<view class="content rx-sc">
+							<view>{{item.formingNum}}</view>
+							<view class="unit">{{item.unit}}</view>
+						</view>
+					</view>
+
+					<view class="rx ww45">
+						<view class="lable rx-cc ww80">重量</view>
+						<view class="content content_num">
+							<view>{{item.formingWeight}}</view>
+							<view class="unit">{{item.weightUnit}}</view>
+
+						</view>
+					</view>
+
+				</view>
+
+
+				<view class="item rx-sc">
+					<view class="rx ww55 ">
+						<view class="lable lable150 rx-cc ">合格品数量</view>
+						<view class="content content_num">
+							<input class="uni-input" v-model="item.demandQuantity" type="digit"></input>
+							<view class="unit">{{item.unit}}</view>
+						</view>
+					</view>
+
+					<view class="rx ww45">
+						<view class="lable rx-cc ww80">重量</view>
+						<view class="content content_num">
+							<input class="uni-input" v-model="item.demandQuantity" type="digit"></input>
+							<view class="unit">{{item.weightUnit}}</view>
+						</view>
+					</view>
+
+				</view>
+
+
+
+
+				<view class="item rx-sc">
+					<view class="rx ww55 ">
+						<view class="lable lable150 rx-cc ">不合格数量</view>
+						<view class="content content_num">
+							<input class="uni-input" v-model="item.demandQuantity" type="digit"></input>
+							<view class="unit">{{item.unit}}</view>
+						</view>
+					</view>
+
+					<view class="rx ww45">
+						<view class="lable rx-cc ww80">重量</view>
+						<view class="content content_num">
+							<input class="uni-input" v-model="item.demandQuantity" type="digit"></input>
+							<view class="unit">{{item.weightUnit}}</view>
+							<view class="penalize">处置</view>
+						</view>
+					</view>
+
+				</view>
+
+				<view class="item">
+					<view class="lable rx-cc">舟皿类型</view>
+					<view class="content"></view>
+				</view>
+
+
+
+				<view class="item">
+					<view class="lable rx-cc">舟皿名称</view>
+					<view class="content"></view>
+				</view>
+
+				<view class="item">
+					<view class="lable rx-cc">舟皿型号</view>
+					<view class="content"></view>
+				</view>
+
+
+
+
+
+
+			</view>
+		</view>
+
+
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			item: {
+				type: Object,
+				default: () => {}
+			},
+			isDetails: {
+				type: Boolean,
+				default: false
+			}
+
+		},
+		data() {
+			return {
+
+			}
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.title_box {
+		margin-top: 20rpx;
+
+		.name {
+			font-size: 28rpx;
+			font-style: normal;
+			font-weight: 400;
+			color: $theme-color;
+			padding-left: 20rpx;
+
+			position: relative;
+
+			&:before {
+				position: absolute;
+				content: '';
+				left: 0rpx;
+				top: 0rpx;
+				bottom: 0rpx;
+				width: 4rpx;
+				height: 28rpx;
+				background: $theme-color;
+				margin: auto;
+			}
+
+
+		}
+
+
+
+	}
+
+
+	.material {
+		margin-top: 10rpx;
+
+
+
+		.content_table {
+			width: 100%;
+			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;
+				}
+
+				.lable150 {
+					width: 156rpx !important;
+					font-size: 24rpx;
+				}
+
+				.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;
+
+
+					.unit {
+						padding: 0 4rpx;
+						font-size: 24rpx;
+						color: #404446;
+					}
+
+					.penalize {
+						width: 160rpx;
+						line-height: 60rpx;
+						background: $theme-color;
+						font-size: 24rpx;
+						text-align: center;
+						color: #fff;
+					}
+
+				}
+
+				.content_num {
+					display: flex;
+					align-items: center;
+					padding: 0 4rpx;
+
+					/deep/ .uni-input-input {
+						border: 2rpx solid #F0F8F2;
+						background: #F0F8F2;
+						color: $theme-color;
+					}
+
+
+				}
+
+				.pd4 {
+					padding: 4rpx 8rpx;
+				}
+
+
+
+				&:last-child {
+					border-bottom: none;
+				}
+			}
+
+			.ww55 {
+				width: 55%;
+			}
+
+			.ww45 {
+				width: 45%;
+			}
+		}
+	}
+</style>

+ 122 - 6
pages/pda/jobBooking/index/index.vue

@@ -1,22 +1,138 @@
 <template>
-	<view>
-		
+	<view class="content-box">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA"
+			color="#000" @clickLeft="back" right-icon="scan" @clickRight="HandlScanCode">
+		</uni-nav-bar>
+
+		<view class="list_box">
+			<u-list @scrolltolower="scrolltolower">
+
+				<view class="card_box">
+					<workOrderBom :item='objData' v-if='objData' @handleScan='handleScan'></workOrderBom>
+
+					<deviceBom v-if='objData.equipmentList.length != 0' :list='objData.equipmentList'></deviceBom>
+
+					<modelBom v-if='objData.modelList.length != 0' :list='objData.modelList'>
+					</modelBom>
+					
+					<jobBom :item='objData'></jobBom>
+
+				</view>
+
+			</u-list>
+		</view>
 	</view>
 </template>
 
 <script>
+	import {
+		getByIdReport,
+		getByCodeReport
+	} from '@/api/pda/jobBooking.js'
+
+	import workOrderBom from '../../feeding/components/workOrderBom.vue'
+	import deviceBom from '../../feeding/components/deviceBom.vue'
+	import modelBom from '../../feeding/components/modelBom.vue'
+	import jobBom from '../components/jobBom.vue'
+
+
 	export default {
+
+		components: {
+			workOrderBom,
+			deviceBom,
+			modelBom,
+			jobBom
+		},
 		data() {
 			return {
-				
+				title: '',
+
+				objData: {
+					equipmentList: [],
+					modelList: []
+				},
+
+				id: null,
+				taskId: null,
+
 			}
 		},
+		onLoad(options) {
+			this.title = options.taskName ? options.taskName + '-报工' : '报工'
+			this.id = options.id
+			this.taskId = options.taskId
+			this.getList()
+		},
+
 		methods: {
-			
+
+
+			// 相机扫码
+			HandlScanCode() {
+				let _this = this
+				uni.scanCode({
+					success: function(res) {
+						console.log(res)
+					}
+				})
+
+			},
+
+			handleScan(id, type) {
+
+
+				let _this = this
+				uni.scanCode({
+					success: function(res) {
+						_this.scanData(res.result, type, id)
+					}
+				})
+			},
+
+
+			scanData(result, type, id) {
+				if (type == 'wordOrder') {
+					getByCodeReport(result, this.taskId).then(res => {
+						this.objData = res
+					})
+				}
+			},
+
+			getList() {
+				getByIdReport(this.id, this.taskId).then(res => {
+					this.objData = res
+				})
+			},
+
+			scrolltolower() {}
 		}
 	}
 </script>
 
-<style>
+<style lang="scss" scoped>
+	.content-box {
+		height: 100vh;
+		overflow: hidden;
+		display: flex;
+		flex-direction: column;
+
+	}
+
+	.list_box {
+		flex: 1;
+		overflow: hidden;
+		padding: 4rpx 0;
 
-</style>
+		.u-list {
+			height: 100% !important;
+		}
+
+		.card_box {
+			padding: 16rpx 24rpx;
+		}
+
+
+
+	}
+</style>

+ 80 - 56
pages/pda/workOrder/extrusionMolding/index.vue

@@ -5,13 +5,11 @@
 
 
 		<view class="top-wrapper cx">
-			<stepsNav  v-if='info.taskId && stepsList.length' :stepsList="stepsList" :taskId="info.taskId"></stepsNav>
-
+			<stepsNav v-if='info.taskId && stepsList.length' :stepsList="stepsList" :taskId="info.taskId"></stepsNav>
 			<view class="tab_box rx-sc">
 				<view class="tab_item" :class="{active: tabType == 1}" @click="handTab(1)">基本信息</view>
 				<view class="tab_item" :class="{active: tabType == 2}" @click="handTab(2)">生产明细</view>
 			</view>
-
 		</view>
 
 		<view class="list_box">
@@ -89,45 +87,45 @@
 			</u-list>
 
 			<u-list @scrolltolower="scrolltolower" key="detail" v-if="tabType == 2">
-			
+
 				<view v-for="(item,index) in produceList" :key="index" class="detail-list">
 					<view class="name">{{item.taskName}}</view>
-					<view class="list rx-bc" >
+					<view class="list rx-bc">
 						<view class="title rx-sc">
-							<image  class="icon" src="~@/static/pda/layers.svg"></image>
+							<image class="icon" src="~@/static/pda/layers.svg"></image>
 							待投料数量
 						</view>
 
 						<view class="rx-ec">
-						{{item.waitFeedNum}}
-						<image  class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
+							{{item.waitFeedNum}}
+							<image class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
 						</view>
 					</view>
-					
-					<view class="list rx-bc" >
+
+					<view class="list rx-bc">
 						<view class="title rx-sc">
-							<image  class="icon" src="~@/static/pda/check-square.svg"></image>
+							<image class="icon" src="~@/static/pda/check-square.svg"></image>
 							生产中数量
 						</view>
-					
+
 						<view class="rx-ec">
-						 0
-						<image  class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
+							0
+							<image class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
 						</view>
 					</view>
-					
-					
-					<view class="list rx-bc" >
+
+
+					<view class="list rx-bc">
 						<view class="title rx-sc">
-						
-							<image  class="icon" src="~@/static/pda/target.svg"></image>
-					
+
+							<image class="icon" src="~@/static/pda/target.svg"></image>
+
 							待投料数量
 						</view>
-					
+
 						<view class="rx-ec">
-						{{item.waitFeedNum}}
-						<image  class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
+							{{item.waitFeedNum}}
+							<image class="arrow_right2" src="~@/static/pda/arrow_right2.svg"></image>
 						</view>
 					</view>
 				</view>
@@ -145,8 +143,16 @@
 <script>
 	import bottomOperate from '../../components/bottomOperate.vue'
 	import stepsNav from '../../components/stepsNav.vue'
-	
-		import { getTaskInstanceList, workorderInfo, produceDetail } from '@/api/pda/workOrder.js'
+
+	import {
+		getTaskInstanceList,
+		workorderInfo,
+		produceDetail,
+		checkStatus
+	} from '@/api/pda/workOrder.js'
+	import {
+		noop
+	} from 'lodash'
 	export default {
 		components: {
 			bottomOperate,
@@ -157,31 +163,33 @@
 				title: '',
 				tabType: 1,
 				id: null,
-				
+
 				stepsList: [],
 				info: {},
 				taskId: null,
-				
+
 				produceList: [],
+
+				feedAllow: true
 			}
 		},
 
 		onLoad(options) {
 			this.title = options.title
 			this.id = options.id
-			
+
 			uni.showLoading({
 				title: '加载中'
 			});
-			
+
 
 
 		},
-		
+
 		onShow() {
 			this.getSteps()
 			this.getInfo()
-			
+
 			this.produce()
 		},
 
@@ -193,55 +201,71 @@
 					this.tabType = type
 				}
 			},
-			
+
 			getSteps() {
 				getTaskInstanceList(this.id).then(res => {
 					this.stepsList = res
-				
 				})
 			},
-			
+
 			getInfo() {
 				workorderInfo(this.id).then(res => {
 					this.info = res
+					this.taskId = res.taskId
+					this.feedStatus()
 					uni.hideLoading();
 				}).catch(() => {
 					uni.hideLoading();
 				})
 			},
-			
-			operate(type) {
-				let url  
-				if(type == 'picking') {
-				url = '/pages/pda/picking/details'
-				let _arr = JSON.stringify([ this.info.id ])
-				url += `?arr=${encodeURIComponent(_arr)}&taskId=${this.info.taskId}`
-				uni.navigateTo({
-					url
+
+
+			feedStatus() {
+
+				checkStatus(this.id, this.info.taskId).then(res => {
+					this.feedAllow = res
 				})
-				} else if(type == 'feeding') {
-					url = '/pages/pda/feeding/details'
-					let _arr = JSON.stringify([ this.info.id ])
-					url += `?arr=${encodeURIComponent(_arr)}&taskName=${this.info.taskName}`
+			},
+
+			operate(type) {
+				let url
+				if (type == 'picking') {
+					url = '/pages/pda/picking/details'
+					let _arr = JSON.stringify([this.info.id])
+					url += `?arr=${encodeURIComponent(_arr)}&taskId=${this.taskId}`
 					uni.navigateTo({
 						url
 					})
-				} else if(type == 'jobBooking') {
+				} else if (type == 'feeding') {
+					if (this.feedAllow) {
+						url = '/pages/pda/feeding/details'
+						let _arr = JSON.stringify([this.info.id])
+						url += `?arr=${encodeURIComponent(_arr)}&taskId=${this.taskId }&taskName=${this.info.taskName}`
+						uni.navigateTo({
+							url
+						})
+					} else {
+						uni.showToast({
+							title: "已投料,请先报工",
+							icon: "none",
+						})
+					}
+
+				} else if (type == 'jobBooking') {
 					url = '/pages/pda/jobBooking/index/index'
-					let _arr = JSON.stringify([ this.info.id ])
-					url += `?arr=${encodeURIComponent(_arr)}&taskName=${this.info.taskName}`
+					url += `?id=${this.info.id}&taskId=${this.taskId }&taskName=${this.info.taskName}`
 					uni.navigateTo({
 						url
 					})
 				}
-	
+
 			},
-			
-			
+
+
 			produce() {
 				produceDetail(this.id).then(res => {
 					this.produceList = res.produceDetail
-				
+
 				})
 			},
 		}
@@ -345,8 +369,8 @@
 					height: 36rpx;
 					margin-right: 8rpx;
 				}
-				
-				.arrow_right2{
+
+				.arrow_right2 {
 					width: 12rpx;
 					height: 24rpx;
 					margin-left: 8rpx;

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

@@ -102,11 +102,10 @@
 			handleDetail(item) {
 				let url = '/pages/pda/workOrder/extrusionMolding/index'
 				url += `?id=${item.id}&title=${item.taskName}`
-				console.log(url)
+		
 				uni.navigateTo({
 					url
 				})
-				console.log(item)
 			},