ysy 2 年之前
父節點
當前提交
0e7e641aad

+ 18 - 0
api/pda/workOrder.js

@@ -322,4 +322,22 @@ export async function sampleTurnoverReview(params) {
 }
 
 
+// PDA 入库查询
+export async function listPDAToWarehouse(params) {
+	const data = await postJ(
+		Vue.prototype.apiUrl + `/pda/mes/workreport/listPDAToWarehouse`, params, true,
+	);
+
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
+}
+
+
+
+
+
+
+
 

+ 2 - 2
pages.json

@@ -1508,8 +1508,8 @@
 			"path" : "pages/pda/warehousing/index",
 			"style" : 
 			{
-				"navigationBarTitleText" : "",
-				"enablePullDownRefresh" : false
+			"navigationStyle" : "custom",
+			"navigationBarTextStyle" : "white"
 			}
 		}
 

+ 7 - 0
pages/pda/components/bottomOperate.vue

@@ -116,6 +116,13 @@
 					
 					],
 					
+					5: [{
+							name: '入库',
+							type: 'warehousing'
+						},
+					
+					],
+					
 				}
 			}
 		},

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

@@ -301,9 +301,6 @@
 			handleScan(id, type) {
 
 
-
-
-
 				let _this = this
 				uni.scanCode({
 					success: function(res) {
@@ -581,7 +578,10 @@
 				}
 
 
+
 				jobSave(this.objData).then(res => {
+					
+			
 					uni.hideLoading();
 
 					if (this.taskType == 4) {
@@ -589,10 +589,10 @@
 							title: '提示',
 							content: '打包完成是否去打包!',
 							confirmText: '确认', //这块是确定按钮的文字
-							success: function(res) {
-								if (res.confirm) {
+							success: rr=> {
+								if (rr.confirm) {
 									uni.navigateTo({
-										url: '/pages/pda/warehousing/index'
+									url: `/pages/pda/warehousing/index?workOrderId=${this.id}&taskId=${taskId}&workReportId=${res}`
 									})
 								} else {
 									uni.navigateBack()

+ 678 - 0
pages/pda/warehousing/components/packingBom.vue

@@ -0,0 +1,678 @@
+<template>
+
+	<view>
+		<view class="title_box rx-bc">
+			<view class="name">内包装</view>
+		</view>
+
+		<view class="material ">
+
+			<view class="content_table">
+				<view class="item">
+					<view class="lable rx-cc">包装总数</view>
+					<view class="content content_num">
+						<input class="uni-input" v-model="formedNumLast" type='digit'></input>
+						<view class="unit">{{objData.unit}}</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="quantity"></input>
+
+						</view>
+					</view>
+
+					<view class="rx ww45">
+						<view class="rx-cc ww80">
+							<view style="max-width: 100rpx; font-size: 24rpx;">{{objData.unit}}</view>/
+						</view>
+						<view class="content rx-sc">
+							<zxz-uni-data-select :localdata="unitList" v-model="unit" dataValue='Key' format='{Value}'
+								dataKey="Key" filterable :clear='false'></zxz-uni-data-select>
+
+							<view class="penalize" @click="handleSplit">确认</view>
+						</view>
+					</view>
+
+				</view>
+
+			</view>
+
+
+
+
+			<view class="content_table2" v-if='splitList.length'>
+				<view class="head row rx-sc">
+					<view class="item ww10">序号</view>
+					<view class="item ww30">数量</view>
+					<view class="item ww50">条码</view>
+					<view class="item ww10"></view>
+				</view>
+
+				<view class="table">
+					<u-list @scrolltolower="scrolltolower" class="z_list">
+						<view class="tr row rx-sc" v-for="(it, idx) in splitList" :key='idx'>
+							<view class="item ww10 rx-cc ">{{ it.computeSize }}</view>
+							<view class="item ww30 content_num rx-sc">
+								<input class="uni-input" v-model="it.quantity" type="digit"></input>
+								<view style="width: 260rpx; font-size: 22rpx;"> {{objData.unit}}/ {{it.unit}}</view>
+							</view>
+							<view class="item ww50">
+								{{ it.code }}
+							</view>
+							<view class="item ww10 rx-cc" v-if="!it.parentId" @click="handleCheck( idx, it)">
+								<image class="check" v-if='it.check' src='@/static/check.png'>
+								</image>
+								<image class="check" v-if=' !it.check' src='@/static/check_no.png'>
+								</image>
+							</view>
+
+						</view>
+
+					</u-list>
+				</view>
+			</view>
+
+
+
+		</view>
+
+
+		<view class="material ">
+
+			<view class="title_box rx-bc">
+				<view class="name">外包装</view>
+			</view>
+
+
+			<view class="content_table2" v-if='temporaryList.length'>
+				<view class="head row rx-sc">
+					<view class="item ww10">序号</view>
+					<view class="item ww30">数量</view>
+					<view class="item ww50">条码</view>
+					<view class="item ww10"></view>
+				</view>
+
+				<view class="table">
+
+					<view class="tr row rx-sc" v-for="(it, idx) in temporaryList" :key='idx'>
+						<view class="item ww10 rx-cc ">{{ idx + 1 }}</view>
+						<view class="item ww30 content_num rx-sc">
+							<input class="uni-input" v-model="it.quantity" disabled type="digit"></input>
+							<view style="width: 260rpx; font-size: 22rpx;"> {{objData.unit}}/ {{it.unit}}</view>
+						</view>
+						<view class="item ww50">
+							{{ it.code }}
+						</view>
+						<view class="item ww10 rx-cc">
+							<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20"
+								color="#fa3534"></uni-icons>
+						</view>
+
+
+					</view>
+
+					<view class="tr row rx-sc">
+						<view class="item ww10 rx-cc ">合并</view>
+						<view class="item ww90  rx-sc">
+							总共{{temporaryCount}} {{objData.unit}} / {{this.temporaryNum}} {{unit}}
+							--打包成 1
+							<zxz-uni-data-select :localdata="unitList" v-model="packUnit" dataValue='Key'
+								format='{Value}' dataKey="Key" filterable :clear='false'></zxz-uni-data-select>
+
+							<view class="penalize" @click="handlePack">打包</view>
+
+						</view>
+
+
+					</view>
+
+
+
+				</view>
+			</view>
+
+
+
+
+			<!-- 外包装  列表-->
+			<view class="content_table2" v-if='packTwoList.length > 0'>
+				<view class="head row rx-sc">
+					<view class="item ww10">序号</view>
+					<view class="item ww30">数量</view>
+
+					<view class="item ww50">条码</view>
+					<view class="item ww10"></view>
+				</view>
+
+				<view class="table">
+					<view class="tr row rx-sc " v-for="(it, idx) in packTwoList" :key='idx'>
+						<view class="item ww10 rx-cc ">{{ idx + 1 }}</view>
+						<view class="item ww30 content_num rx-sc">
+							{{ it.quantity}} {{ objData.unit }} / {{it.unit}}
+						</view>
+
+
+
+						<view class="item ww50">
+							{{ it.code }}
+						</view>
+						<view class="item ww10 rx-cc">
+
+						</view>
+
+
+					</view>
+
+
+				</view>
+
+			</view>
+
+
+
+
+
+
+
+
+
+		</view>
+
+
+
+
+
+	</view>
+</template>
+
+<script>
+	import {
+		getByCode
+	} from '@/api/pda/common.js'
+	import {
+		packingReport,
+		getPackingReport,
+
+		packingReportRepeat,
+		getPackingReportRepeat
+	} from '@/api/pda/workOrder.js'
+	export default {
+		props: {
+			objData: {
+				type: Object,
+				default: () => {}
+			},
+
+			taskId: {
+				type: String,
+				default: ''
+			},
+
+			workOrderId: {
+				type: String,
+				default: ''
+			}
+		},
+		data() {
+			return {
+				formedNumLast: 0,
+
+				quantity: '',
+				unit: '',
+
+				unitList: [],
+
+				splitList: [],
+
+
+
+				packUnit: null,
+				temporaryNum: 0,
+				temporaryCount: 0,
+				temporaryList: [],
+				packTwoList: []
+
+
+
+
+
+			}
+		},
+
+		created() {
+			this.formedNumLast = this.objData.formedNumLast
+			this.byCode(),
+
+				this.getPackingDetails()
+			this.getPackingDetailsTwo()
+		},
+
+		methods: {
+			byCode() {
+				getByCode('packing_unit').then(res => {
+
+					this.unitList = []
+
+					res.forEach((obj, index) => {
+						for (let key in obj) {
+							if (obj.hasOwnProperty(key)) { // 确保key是对象自身的属性
+
+								this.unitList.push({
+									Key: `${key}`,
+									Value: ` ${obj[key]}`
+								})
+
+
+							}
+						}
+					});
+
+				})
+			},
+
+
+			getPackingDetails() {
+				let param = {
+					workOrderId: this.workOrderId,
+					taskId: this.taskId,
+					tier: 1
+				}
+
+				getPackingReport(param).then(res => {
+
+					this.splitList = res.detailList
+					this.formedNumLast = res.totalQuantity
+					this.quantity = res.quantity
+					this.unit = res.unit
+
+
+				})
+			},
+
+
+
+			handleSplit() {
+
+				if (this.splitList.length) {
+					uni.showToast({
+						title: '产品已分包',
+						icon: 'none'
+					})
+					return false
+				}
+
+
+
+				if (!this.formedNumLast) {
+					uni.showToast({
+						title: '包装总数数量不能为空',
+						icon: 'none'
+					})
+					return false
+				}
+
+				if (!this.quantity) {
+					uni.showToast({
+						title: '内包装单元数量不能为空',
+						icon: 'none'
+					})
+					return false
+				}
+
+				if (!this.unit) {
+					uni.showToast({
+						title: '请选择包装单位',
+						icon: 'none'
+					})
+					return false
+				}
+
+				let param = {
+					totalQuantity: this.objData.formedNumLast,
+					quantity: this.quantity,
+					unit: this.unit,
+					workOrderId: this.workOrderId,
+					taskId: this.taskId,
+					tier: 1
+				}
+				packingReport(param).then(res => {
+					this.splitList = res.map(m => {
+
+						return {
+							check: false,
+							...m
+						}
+					})
+
+					this.getPackingDetails()
+				})
+
+
+			},
+
+			handleCheck(idx, it) {
+
+
+
+				if (it.quantity <= 0) {
+					uni.showToast({
+						icon: 'none',
+						title: '数量为空不能勾选'
+					})
+
+					return false
+				}
+				this.$set(this.splitList[idx], 'check', !it.check)
+
+				this.temporaryList = []
+
+
+				this.temporaryList = this.splitList.filter(e => {
+					return e.check
+				})
+				this.temporaryNum = 0
+				this.temporaryCount = 0
+				if (this.temporaryList.length > 0) {
+					this.temporaryList.forEach(e => {
+						this.temporaryNum = this.temporaryNum + 1
+						this.temporaryCount = this.temporaryCount + Number(e.quantity)
+					})
+				}
+
+
+			},
+
+			getPackingDetailsTwo() {
+				let param = {
+					totalQuantity: this.objData.formedNumLast,
+					quantity: this.quantity,
+					unit: this.unit,
+					workOrderId: this.workOrderId,
+					taskId: this.taskId,
+					tier: 2,
+
+				}
+				getPackingReportRepeat(param).then(res => {
+					this.packTwoList = res.detailList
+				})
+			},
+
+			handlePack() {
+				let param = {
+					detailList: this.temporaryList,
+					quantity: this.temporaryCount,
+					totalQuantity: this.formedNumLast,
+					unit: this.packUnit,
+					taskId: this.taskId,
+					workOrderId: this.workOrderId,
+					tier: 2
+				}
+
+				packingReportRepeat(param).then(res => {
+					this.temporaryList = []
+					this.getPackingDetails()
+					this.getPackingDetailsTwo()
+				})
+			},
+
+
+			scrolltolower() {
+
+			},
+
+			getData() {
+				let _packingReportMarginList = []
+
+				_packingReportMarginList = this.splitList.filter(e => {
+					return !e.parentId
+				})
+
+				let packInfo = {
+					packingReportList: this.packTwoList,
+					packingReportMarginList: _packingReportMarginList,
+					formedNumLast: this.formedNumLast
+				}
+				return packInfo
+			},
+		},
+	}
+</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;
+				}
+
+				.lable220 {
+					width: 220rpx !important;
+					font-size: 24rpx;
+				}
+
+				.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;
+					}
+
+
+
+				}
+
+
+
+				&:last-child {
+					border-bottom: none;
+				}
+			}
+
+
+
+			.ww55 {
+				width: 55%;
+			}
+
+			.ww45 {
+				width: 45%;
+			}
+
+
+		}
+	}
+
+
+
+
+	.content_table2 {
+		width: 100%;
+		margin-top: 16rpx;
+
+		.row {
+			width: 100%;
+
+
+			.item {
+
+				color: #404446;
+				font-size: 28rpx;
+				padding-left: 12rpx;
+
+			}
+
+			.color157 {
+				color: $theme-color;
+			}
+
+			.ww30 {
+				width: 30%;
+			}
+
+			.ww50 {
+				width: 50%;
+
+			}
+
+			.ww90 {
+				width: 90%;
+			}
+
+			.ww15 {
+				width: 15%;
+			}
+
+			.ww10 {
+				width: 10%;
+			}
+
+			.ww30 {
+				width: 30%;
+			}
+
+		}
+
+		.head {
+			height: 64rpx;
+			background: #F7F9FA;
+			border-top: 2rpx solid #E3E5E5;
+			border-left: 2rpx solid #E3E5E5;
+
+			.item {
+				height: 64rpx;
+				line-height: 64rpx;
+				border-right: 2rpx solid #E3E5E5;
+				box-sizing: border-box;
+			}
+		}
+
+
+
+		.tr {
+			border-top: 2rpx solid #E3E5E5;
+			border-left: 2rpx solid #E3E5E5;
+
+
+			.item {
+				font-size: 24rpx;
+				min-height: 64rpx;
+				display: flex;
+				align-items: center;
+				border-right: 2rpx solid #E3E5E5;
+				box-sizing: border-box;
+				white-space: normal;
+				word-break: break-all;
+
+			}
+
+			&:last-child {
+				border-bottom: 2rpx solid #E3E5E5;
+
+			}
+		}
+	}
+
+
+
+
+	.content_num {
+		display: flex;
+		align-items: center;
+		padding: 0 4rpx;
+
+		/deep/ .uni-input-input {
+			border: 2rpx solid #F0F8F2;
+			background: #F0F8F2;
+			color: $theme-color;
+		}
+
+
+	}
+
+	.penalize {
+		width: 86rpx;
+		line-height: 60rpx;
+		background: $theme-color;
+		font-size: 24rpx;
+		text-align: center;
+		color: #fff;
+	}
+
+	.check {
+		width: 30rpx;
+		height: 30rpx;
+	}
+
+	.z_list {
+		max-height: 500rpx;
+	}
+</style>

+ 152 - 5
pages/pda/warehousing/index.vue

@@ -1,22 +1,169 @@
 <template>
-	<view>
-		
+	<view class="content-box">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="入库" background-color="#F7F9FA" color="#000"
+			@clickLeft="back">
+
+		</uni-nav-bar>
+
+		<view class="list_box">
+			<u-list @scrolltolower="scrolltolower">
+				<view class="card_box">
+					<workOrderBom :item='objData' v-if='objData' @handleScan='handleScan'></workOrderBom>
+
+					<view class="select_box">
+						<zxz-uni-data-select :localdata="warehouseList" placeholder="请选择入库仓库" v-model="warehouseId"
+							dataValue='id' dataKey="name" filterable format='{name}'></zxz-uni-data-select>
+					</view>
+
+                     <view>
+						 
+						 <packingBom></packingBom>
+						 
+					 </view>
+					
+				</view>
+			</u-list>
+		</view>
+
+
+
+		<view class="bottom-wrapper">
+			<view class="btn_box" @click="save">一键报工</view>
+		</view>
+
 	</view>
 </template>
 
 <script>
+	import {
+		getByIdReport
+
+	} from '@/api/pda/jobBooking.js'
+
+	import {
+		getWarehouseList,
+		listPDAToWarehouse,
+	} from '@/api/pda/workOrder.js'
+
+	import packingBom from './components/packingBom.vue'
+	import workOrderBom from '../feeding/components/workOrderBom.vue'
 	export default {
+		components: {
+			workOrderBom,
+			packingBom
+		},
 		data() {
 			return {
+				id: null,
+				taskId: null,
+
+				objData: {},
+				warehouseList: [],
+				warehouseId: null,
 				
+				List: []
 			}
 		},
+
+		onLoad(options) {
+
+			this.id = options.workOrderId
+			this.taskId = options.taskId
+			this.workReportId = options.workReportId
+			this.getList()
+
+			this.getWarehouseListFn()
+			this.getWarehouse()
+		},
+
 		methods: {
-			
+			getList() {
+				getByIdReport(this.id, this.taskId).then(res => {
+					this.objData = res
+
+				})
+			},
+
+			getWarehouseListFn() {
+				getWarehouseList().then(res => {
+					this.warehouseList = res
+				})
+			},
+
+			getWarehouse() {
+				let param = {
+					workOrderId: this.id,
+					taskId: this.taskId,
+					workReportId: this.workReportId || '1780209440937308162'
+
+				}
+				listPDAToWarehouse(param).then(res => {
+					console.log(res)
+					this.List = res
+					
+				})
+			},
+
+			handleScan() {
+
+			},
+			scrolltolower() {},
+
+			save() {
+				if (!this.warehouseId) {
+					uni.showToast({
+						icon: 'none',
+						title: '请先选择入库仓库'
+					})
+				}
+			},
 		}
 	}
 </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;
+		}
 
-<style>
 
-</style>
+
+	}
+
+	.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;
+		}
+	}
+
+
+
+
+	.select_box {
+		margin-top: 20rpx;
+	}
+</style>

+ 22 - 2
pages/pda/workOrder/extrusionMolding/index.vue

@@ -209,7 +209,7 @@
 		onShow() {
 			this.getInfo()
 			this.getSteps()
-			
+
 
 			this.produce() // 生产明细
 		},
@@ -261,6 +261,11 @@
 			setTypeFn() {
 				this.stepsList.length && this.stepsList.find(f => {
 					let id = this.currentTaskId || this.taskId
+					
+					if (id == -1) {
+						this.currentType = 5
+						return false
+					}
 					if (f.taskId == id) {
 						this.currentType = f.type
 					}
@@ -278,7 +283,15 @@
 			selectStep(item) {
 				this.currentTaskId = item.taskId
 				this.currentTaskName = item.taskTypeName
-				this.currentType = item.type
+				
+				 
+				if(item.taskId == -1) {
+					this.currentType =  5
+				} else {
+				
+					this.currentType = item.type
+				}
+				
 				this.feedStatus()
 			},
 
@@ -357,6 +370,13 @@
 					uni.navigateTo({
 						url
 					})
+				} else if(type == 'warehousing') {
+		
+					url = '/pages/pda/warehousing/index'
+					url += `?workOrderId=${this.info.id}&taskId=${taskId}`
+					uni.navigateTo({
+						url
+					})
 				}