ysy 2 жил өмнө
parent
commit
583bd6e1eb

+ 15 - 1
api/pda/jobBooking.js

@@ -22,4 +22,18 @@ export async function getByCodeReport(code, taskId) {
     return data.data;
   }
   return Promise.reject(data.message);
-}
+}
+
+
+
+export async function jobSave(params) {
+  const data = await postJ(
+   Vue.prototype.apiUrl  + `/pda/mes/workreport/save`, params, true,
+  );
+  if (data.code == 0) {
+    return data.data;
+  }
+  return Promise.reject(data.message);
+}
+
+

+ 16 - 1
api/pda/workOrder.js

@@ -153,4 +153,19 @@ export async function scanLedger(code) {
 		return data.data;
 	}
 	return Promise.reject(data.message);
-}
+}
+
+
+// 查询仓库下拉列表
+
+export async function getWarehouseList() {
+	const data = await post(
+		Vue.prototype.apiUrl + `/wms/warehouse/getWarehouseList`
+	);
+
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
+}
+

+ 2 - 14
pages.json

@@ -1433,20 +1433,8 @@
 				"navigationBarTextStyle": "white"
 			}
 		},
-		{
-			"path": "pages/pda/components/searchPopup",
-			"style": {
-				"navigationBarTitleText": "",
-				"enablePullDownRefresh": false
-			}
-		},
-		{
-			"path": "pages/pda/feeding/components/deviceBom",
-			"style": {
-				"navigationBarTitleText": "",
-				"enablePullDownRefresh": false
-			}
-		},
+
+	
 		{
 			"path": "pages/pda/feeding/bill/index",
 			"style": {

+ 22 - 20
pages/pda/components/stepsNav.vue

@@ -27,39 +27,41 @@
 		data() {
 			return {
 				scrollable: true,
-				scrollLeft: 10,
+				scrollLeft: 0,
 				activeIndex: 0,
 
 			}
 		},
-		
+
 		watch: {
-			
-			taskId:{
-			    immediate: true,
+
+			taskId: {
+				immediate: true,
 				deep: true,
-			    handler(newVal){
-				 this.activeIndex = this.getIndexOfElementInArray(this.stepsList, newVal)
-			    }
+				handler(newVal) {
+					this.activeIndex = this.getIndexOfElementInArray(this.stepsList, newVal)
+					this.scrollLeft = 84 * this.activeIndex + 10
+				}
 			}
 		},
-		
-		
 
-	
+
+
+
 
 		methods: {
 			selectStep(item) {
-				console.log(item);
+				this.$emit('selectStep', item)
+
 			},
-			
-			 getIndexOfElementInArray(array, target) {
-			    for (let i = 0; i < array.length; i++) {
-			        if (array[i].taskId === target) {
-			            return i; // 返回第一次出现target的索引位置
-			        }
-			    }
-			    return -1; // 未找到目标值时返回-1
+
+			getIndexOfElementInArray(array, target) {
+				for (let i = 0; i < array.length; i++) {
+					if (array[i].taskId === target) {
+						return i; // 返回第一次出现target的索引位置
+					}
+				}
+				return -1; // 未找到目标值时返回-1
 			}
 
 

+ 38 - 7
pages/pda/components/uni-steps.vue

@@ -3,17 +3,17 @@
 		<view :class="[direction==='column'?'uni-steps__column':'uni-steps__row']">
 			<view :class="[direction==='column'?'uni-steps__column-container':'uni-steps__row-container']">
 				<view :class="[direction==='column'?'uni-steps__column-line-item':'uni-steps__row-line-item']"
-					v-for="(item,index) in options" :key="index" @click="toStep(item)">
+					v-for="(item,index) in options" :key="index" @click="toStep(item, index)">
 					<view
 						:class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--before':'uni-steps__row-line--before']"
 						:style="{backgroundColor:index<=active&&index!==0?activeColor:index===0?'transparent':deactiveColor}">
 					</view>
 					<view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']"
 						v-if="index === active">
-						<view class="uni-steps__row-circle activeRound">{{index + 1}}</view>
+						<view class="uni-steps__row-circle activeRound" :class="[ taskId == item.taskId ?'circleActive': 'activeRound']">{{index + 1}}</view>
 					</view>
-					<view :class="[direction==='column'?'uni-steps__column-circle':'uni-steps__row-circle']" v-else>
-						{{index + 1}}
+					<view :class="[direction=='column'?'uni-steps__column-circle': taskId == item.taskId ?'circleActive' :'uni-steps__row-circle']" v-else>
+						{{index + 1}} 
 					</view>
 					<view
 						:class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--after':'uni-steps__row-line--after']"
@@ -70,11 +70,31 @@
 			} // 数据
 		},
 		data() {
-			return {}
+			return {
+				taskId: null,
+			}
 		},
 		methods: {
-			toStep(item) {
-				this.$emit('selectStep', item);
+			toStep(item, index) {
+				
+				if(item.taskId == -2) {
+					uni.showToast({
+						title: "工序已到完结状态",
+						icon: "none",
+					})
+					return false
+				}
+				
+				if(item.number > 0 || index == this.active) {
+					this.taskId = item.taskId
+						this.$emit('selectStep', item);
+				} else {
+					uni.showToast({
+						title: "还未执行到次工序",
+						icon: "none",
+					})
+				}
+			
 			}
 		}
 	}
@@ -268,4 +288,15 @@
 		background: $theme-color;
 		color: #fff;
 	}
+	
+	.circleActive {
+		border: 1px solid #FFA929;
+		background: #FFA929;
+		width: 50upx;
+		height: 50upx;
+		border-radius: 50%;
+		text-align: center;
+		line-height: 50upx;
+		color: #fff;
+	}
 </style>

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

@@ -108,6 +108,7 @@
 						let modelList = [] // 模具
 						let instanceList = [] // 投料
 						let aridRegionList = [] // 干燥区
+						let turnover = [] // 周转车
 
 						selectList.forEach(f => {
 							if (f.rootCategoryLevelId == 5) {
@@ -116,7 +117,10 @@
 							} else if (f.rootCategoryLevelId == 1) {
 								instanceList = instanceList.concat(f)
 
-							} else if (f.rootCategoryLevelId == 11) {
+							} else if (f.rootCategoryLevelId == 7) {
+							 	turnover = turnover.concat(f)
+							 
+							 }else if (f.rootCategoryLevelId == 11) {
 								aridRegionList = aridRegionList.concat(f)
 							}
 
@@ -125,6 +129,7 @@
 
 						this.$set(m, 'modelList', modelList)
 						this.$set(m, 'instanceList', instanceList)
+						this.$set(m, 'turnover', turnover)
 						this.$set(m, 'aridRegionList', aridRegionList)
 
 

+ 10 - 3
pages/pda/jobBooking/components/byProductBom.vue

@@ -15,13 +15,14 @@
 				<view class="table">
 
 					<view class="tr row rx-sc" v-for="(item, index) in list" :key='index'>
+				
 						<view class="item ww30">{{item.code}}</view>
 						<view class="item ww30">{{item.name}}</view>
 						<view class="item ww40  content_num">
 
 							<input class="uni-input" v-model="item.recycleQuantity" type="digit"></input>
 							<view class="unit">{{item.unit}}</view>
-							<view class="penalize">处置</view>
+							<view class="penalize" :style="{ color: item.warehouseId ? 'rgb(255 170 42)' : ''}" @click="penalize(index)">处置</view>
 
 						</view>
 					</view>
@@ -49,9 +50,15 @@
 		},
 		data() {
 			return {
-				demandQuantity: null
+				
 			}
-		}
+		},
+		
+		methods: {
+			penalize(index) {
+				this.$emit('penalize', index)
+			}
+		},
 	}
 </script>
 

+ 33 - 6
pages/pda/jobBooking/components/jobBom.vue

@@ -55,21 +55,24 @@
 
 
 
-				<view class="item rx-sc">
+				<view class="item rx-sc" v-for="(not,notIndex) in notFormedList" :key='notIndex'>
+					
 					<view class="rx ww55 ">
+					
 						<view class="lable lable150 rx-cc ">不合格数量</view>
 						<view class="content content_num">
-							<input class="uni-input" v-model="item.workReportInfo.notFormedNum" type="digit"></input>
+							<input class="uni-input" v-model="not.notFormedNum" 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.workReportInfo.notFormedWeight" type="digit"></input>
+							<input class="uni-input" v-model="not.notFormedWeight" type="digit"></input>
 							<view class="unit">{{item.weightUnit}}</view>
-							<view class="penalize">处置</view>
+							
+							<view class="penalize"  :style="{ color: not.warehouseId ? 'rgb(255 170 42)' : ''}"  @click="penalize">处置</view>
 						</view>
 					</view>
 
@@ -83,7 +86,6 @@
 
 
 
-
 			</view>
 
 			<view class='content_table' v-for="(item,index) in palletList" :key='index'>
@@ -141,6 +143,10 @@
 				type: Object,
 				default: () => {}
 			},
+			notFormed: {
+				type: Array,
+				default: () => []
+			},
 			isDetails: {
 				type: Boolean,
 				default: false
@@ -152,10 +158,27 @@
 			}
 
 		},
+		
+		watch: {
+		
+			notFormed: {
+				immediate: true,
+				deep: true,
+				handler(newVal) {
+					console.log(newVal)
+					this.notFormedList = newVal
+				
+				}
+			}
+		},
+		
+		
 		data() {
 			return {
 				classificationList: [],
 				boatList: [],
+				
+				notFormedList: []
 
 			}
 		},
@@ -212,6 +235,10 @@
 
 			handleType() {
 				this.$refs.treePicker._show()
+			},
+			
+			penalize() {
+				this.$emit('penalize', null)
 			}
 		}
 	}

+ 177 - 11
pages/pda/jobBooking/index/index.vue

@@ -17,9 +17,11 @@
 
 
 
-					<jobBom :item='objData' :palletList='objData.palletList'></jobBom>
+					<jobBom :item='objData' :palletList='objData.palletList' :notFormed='objData.notFormedList'
+						@penalize='penalize'></jobBom>
 
-					<byProductBom v-if='objData.productRecycleList.length != 0 ' :list='objData.productRecycleList'>
+					<byProductBom v-if='objData.productRecycleList.length != 0 ' :list='objData.productRecycleList'
+						@penalize='penalize'>
 					</byProductBom>
 
 					<turnoverBom v-if='objData.turnover.length != 0' :list='objData.turnover' :wordItem='objData'
@@ -31,7 +33,6 @@
 					<aridRegion v-if='objData.aridRegionList.length != 0' :list='objData.aridRegionList'
 						@handleScan='handleScan' :isType='true'></aridRegion>
 
-
 					<view class="operate_box rx-sc">
 						<u-button size="small" class="u-reset-button" type="success" @click="handAdd">手动添加</u-button>
 					</view>
@@ -47,17 +48,55 @@
 		</view>
 
 
+		<SearchPopup mode="bottom" v-if='searchShow'>
+			<template v-slot:list>
+				<view class="search_list">
+
+
+					<u-form labelPosition="left" :model="formData" labelWidth="180" labelAlign="left" class="baseForm">
+						<u-form-item label="仓库:" class="required-form" borderBottom prop="warehouseId">
+							<zxz-uni-data-select :localdata="warehouseList" v-model="formData.warehouseId"
+								dataValue='id' format='{name}'></zxz-uni-data-select>
+						</u-form-item>
+
+
+
+					</u-form>
+
+				</view>
+			</template>
+
+			<template v-slot:operate>
+				<view class="operate_box rx-bc">
+					<u-button size="small" class="u-reset-button" @click="searchCancel">
+						取消
+					</u-button>
+
+
+					<u-button type="success" size="small" class="u-reset-button" @click="popupOk">
+						确定
+					</u-button>
+
+				</view>
+			</template>
+
+		</SearchPopup>
+
+
 	</view>
 </template>
 
 <script>
 	import {
 		getByIdReport,
-		getByCodeReport
+		getByCodeReport,
+		jobSave
 	} from '@/api/pda/jobBooking.js'
 
 	import {
-		scanLedger
+		scanLedger,
+		getWarehouseList,
+
 	} from '@/api/pda/workOrder.js'
 
 
@@ -68,7 +107,7 @@
 	import byProductBom from '../components/byProductBom'
 	import turnoverBom from '../components/turnoverBom.vue'
 	import aridRegion from '../../feeding/components/aridRegion.vue'
-
+	import SearchPopup from '../../components/searchPopup.vue'
 
 	export default {
 
@@ -79,7 +118,8 @@
 			jobBom,
 			byProductBom,
 			turnoverBom,
-			aridRegion
+			aridRegion,
+			SearchPopup
 		},
 		data() {
 			return {
@@ -92,12 +132,21 @@
 					productRecycleList: [],
 					aridRegionList: [],
 					palletList: [],
-					workReportInfo: {
+					workReportInfo: {},
+
+					notFormedList: [], // 报工-不合格
 
-					}
 				},
 
 
+				searchShow: false,
+
+				warehouseList: [],
+				formData: {
+					warehouseId: ''
+				},
+				penalizeIndex: null,
+
 
 
 
@@ -290,14 +339,23 @@
 						formingWeight: null,
 						formedNum: null,
 						formedWeight: null,
+						taskId: this.taskId
+
+					}
+
+					this.objData.notFormedList = [{
 						notFormedNum: null,
 						notFormedWeight: null,
-					}
+						weightUnit: res.weightUnit,
+						unit: res.unit,
+						warehouseId: null, // 处置 仓库id
+					}]
 
 					this.objData.workReportInfo.formingNum = res.formingNum
 					this.objData.workReportInfo.formingWeight = res.formingWeight
 					this.objData.workReportInfo.unit = res.unit
 					this.objData.workReportInfo.weightUnit = res.weightUnit
+					this.objData.workReportInfo.workOrderId = res.workOrderId
 
 				})
 			},
@@ -313,8 +371,111 @@
 			},
 
 
+			penalize(index) {
+				if (index || index == 0) {
+					this.penalizeIndex = index
+					this.formData.warehouseId = this.objData.productRecycleList[this.penalizeIndex].warehouseId || ''
+				} else {
+					this.penalizeIndex = null
+					this.formData.warehouseId = this.objData.notFormedList[0].warehouseId || ''
+
+				}
+				this.$forceUpdate()
+
+				if (this.warehouseList.length == 0) {
+					getWarehouseList().then(res => {
+						this.warehouseList = res
+						this.searchShow = true
+					})
+				} else {
+					this.searchShow = true
+				}
+			},
+
+			searchCancel() {
+				this.searchShow = false
+			},
+			popupOk() {
+				if (this.penalizeIndex == null) {
+					this.$set(this.objData.notFormedList[0], 'warehouseId', this.formData.warehouseId || null)
+
+				} else {
+					this.objData.productRecycleList[this.penalizeIndex].warehouseId = this.formData.warehouseId
+				}
+				this.$forceUpdate()
+				this.searchShow = false
+
+			},
+
+
+
+
 			save() {
-             console.log(this.objData)
+				console.log(this.objData)
+				if (!this.objData.workReportInfo['formedNum'] && this.objData.workReportInfo['formedNum'] != 0) {
+					uni.showToast({
+						title: '请输入合格品数量',
+						icon: 'none'
+					})
+					return false
+				}
+				if (!this.objData.workReportInfo['formedWeight'] && this.objData.workReportInfo['formedWeight'] != 0) {
+					uni.showToast({
+						title: '请输入合格品重量',
+						icon: 'none'
+					})
+					return false
+				}
+
+
+				if (!this.objData.workReportInfo['formedWeight'] && this.objData.workReportInfo['formedWeight'] != 0) {
+					uni.showToast({
+						title: '请输入合格品重量',
+						icon: 'none'
+					})
+					return false
+				}
+
+				if (this.objData.notFormedList[0].notFormedNum > 0 && !this.objData.notFormedList[0].warehouseId) {
+					uni.showToast({
+						title: '请点击不合格品处置,选择仓库',
+						icon: 'none'
+					})
+					return false
+				}
+
+				if (this.objData.productRecycleList.length > 0) {
+					let bol
+					bol = this.objData.productRecycleList.every(e => {
+						return e.recycleQuantity >= 0 && e.warehouseId
+					})
+
+
+					if (!bol) {
+						uni.showToast({
+							title: '请选择副产品回收处置',
+							icon: 'none'
+						})
+						return false
+					}
+
+				}
+
+
+
+
+
+
+
+
+
+				jobSave(this.objData).then(res => {
+					if (res) {
+						uni.navigateBack()
+					}
+				})
+
+
 
 			}
 		}
@@ -369,4 +530,9 @@
 			width: 160rpx;
 		}
 	}
+
+	.search_list {
+		min-height: 300rpx;
+		padding: 0 32rpx;
+	}
 </style>

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

@@ -5,7 +5,7 @@
 
 
 		<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" @selectStep='selectStep'></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>
@@ -170,7 +170,10 @@
 
 				produceList: [],
 
-				feedAllow: true
+				feedAllow: true,
+				
+				currentTaskId: null,
+				currentTaskName: null
 			}
 		},
 
@@ -205,6 +208,7 @@
 			getSteps() {
 				getTaskInstanceList(this.id).then(res => {
 					this.stepsList = res
+					
 				})
 			},
 
@@ -212,6 +216,7 @@
 				workorderInfo(this.id).then(res => {
 					this.info = res
 					this.taskId = res.taskId
+					
 					this.feedStatus()
 					uni.hideLoading();
 				}).catch(() => {
@@ -226,13 +231,20 @@
 					this.feedAllow = res
 				})
 			},
+			
+			selectStep(item) {
+				this.currentTaskId = item.taskId
+				this.currentTaskName  = item.taskTypeName
+			},
 
 			operate(type) {
 				let url
+				let taskId = this.currentTaskId || this.taskId
+				let taskName = this.currentTaskName || this.info.taskName
 				if (type == 'picking') {
 					url = '/pages/pda/picking/details'
 					let _arr = JSON.stringify([this.info.id])
-					url += `?arr=${encodeURIComponent(_arr)}&taskId=${this.taskId}`
+					url += `?arr=${encodeURIComponent(_arr)}&taskId=${taskId}`
 					uni.navigateTo({
 						url
 					})
@@ -240,7 +252,7 @@
 					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}`
+						url += `?arr=${encodeURIComponent(_arr)}&taskId=${taskId }&taskName=${taskName}`
 						uni.navigateTo({
 							url
 						})
@@ -254,7 +266,7 @@
 				} else if (type == 'jobBooking') {
 					if (!this.feedAllow) {
 						url = '/pages/pda/jobBooking/index/index'
-						url += `?id=${this.info.id}&taskId=${this.taskId }&taskName=${this.info.taskName}`
+						url += `?id=${this.info.id}&taskId=${taskId }&taskName=${taskName}`
 						uni.navigateTo({
 							url
 						})

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

@@ -175,7 +175,7 @@
 
 				if (this.isType == 'feed') {
 					let _arr = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
-					this.memoList = [..._arr[0].modelList, ..._arr[0].equipmentList, ..._arr[0].instanceList, ..._arr[0].aridRegionList]
+					this.memoList = [..._arr[0].modelList, ..._arr[0].equipmentList, ..._arr[0].instanceList, ..._arr[0].aridRegionList, ..._arr[0].turnover]