ysy 2 anni fa
parent
commit
2e94640502
5 ha cambiato i file con 414 aggiunte e 4 eliminazioni
  1. 11 0
      api/pda/workOrder.js
  2. 8 0
      pages.json
  3. 30 4
      pages/pda/feeding/details.vue
  4. 112 0
      pages/pda/feeding/single.js
  5. 253 0
      pages/pda/feeding/single.vue

+ 11 - 0
api/pda/workOrder.js

@@ -103,6 +103,17 @@ export async function qualityReview(params) {
 }
 
 
+// pda出库单-用于投料
+export async function feedOutInOrder(params) {
+	const data = await postJ(
+		Vue.prototype.apiUrl + `/pda/mes/feed/feedOutInOrder`, params, true,
+	);
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
+}
+
 
 
 // 查询库存台账首页列表

+ 8 - 0
pages.json

@@ -1511,6 +1511,14 @@
 			"navigationStyle" : "custom",
 			"navigationBarTextStyle" : "white"
 			}
+		},
+		{
+			"path" : "pages/pda/feeding/single",
+			"style" : 
+			{
+			"navigationStyle" : "custom",
+			"navigationBarTextStyle" : "white"
+			}
 		}
 
 

+ 30 - 4
pages/pda/feeding/details.vue

@@ -34,10 +34,12 @@
 					<packingBom v-if='item.packingList.length != 0' :list='item.packingList'></packingBom>
 
 
+                 	<view class='flex_btn'  @click="openDetails(item.workOrderId)">投料单</view>
+
+
 
 					<view class="operate_box rx-sc">
-						<!--  <u-button size="small" class="u-reset-button" type="success"
-							@click="handOutbound(item.workOrderId)">出库单</u-button> -->
+					
 
 						<u-button size="small" class="u-reset-button" type="success"
 							@click="handAdd(item.workOrderId)">手动添加</u-button>
@@ -443,11 +445,15 @@
 				})
 			},
 
-			handOutbound(id) {
+		
+			
+			
+			openDetails(id) {
 				const storageKey = Date.now() + "";
 				uni.setStorageSync(storageKey, this.List || []);
+				let url = `/pages/pda/feeding/single?id=${id}&taskId=${this.taskId}&storageKey=${storageKey}`
 				uni.navigateTo({
-					url: `/pages/pda/feeding/outbound/index?id=${id}&storageKey=${storageKey}taskId=${this.taskId}`
+					url
 				})
 			},
 
@@ -505,4 +511,24 @@
 			width: 160rpx;
 		}
 	}
+	
+	
+	
+	
+	.flex_btn {
+		position: fixed;
+	
+		right: 0;
+		bottom: 160rpx;
+		width: 140rpx;
+		height: 66rpx;
+		line-height: 66rpx;
+		border-radius: 22rpx 0 0 22rpx;
+		background: $theme-color;
+		text-align: center;
+		font-size: 22rpx;
+		font-style: normal;
+		font-weight: 400;
+		color: #fff;
+	}
 </style>

+ 112 - 0
pages/pda/feeding/single.js

@@ -0,0 +1,112 @@
+export const tableHeader = selectEquiType => {
+
+	// 1:物料;4:生产设备; 5:模具;6:备品备件; 7:周转车;8:舟皿;9:产品;10:消耗材料,11:干燥区,12.质检,13.包装材料,14.工装夹具 ,15.刀具 ,99.其他
+	switch (+selectEquiType) {
+		case 1:
+			return [{
+					label: '型号',
+					prop: 'modelType'
+				},
+				{
+					label: '规格',
+					prop: 'specification'
+				},
+
+				{
+					label: '牌号',
+					prop: 'brandNum'
+				},
+
+
+			]
+		case 5:
+			return [{
+					label: '牌号',
+					prop: 'brandNum'
+				},
+				{
+					label: '型号',
+					prop: 'modelType'
+				},
+				{
+					label: '模孔数量',
+					prop: 'dieHoleNum'
+				},
+
+				{
+					label: '芯棒直径',
+					prop: 'mandrelDiameter',
+
+				},
+
+			]
+
+
+		case 7:
+			return [{
+					label: '规格',
+					prop: 'modelType'
+				},
+				{
+					label: '材质',
+					prop: 'materialQuality',
+
+				},
+				{
+					label: '长宽高',
+					prop: '',
+					formatter(row) {
+						if (!row?.extInfo) return ''
+						const extendField = row.extInfo
+						return `${extendField.vehicleLen || '-'}*${extendField.wilde || '-'}*${
+											  extendField.hight || '-'
+											}`
+
+					}
+				}
+			]
+
+
+		case 8: //'舟皿'
+			return [{
+					label: '规格',
+					prop: 'specification'
+				},
+				{
+					label: '型号',
+					prop: 'modelType'
+				},
+				{
+					label: '槽数',
+					prop: 'slotNum'
+				},
+
+
+
+			]
+		case 10:
+			return []
+
+
+		case 13:
+			return [
+
+				{
+					label: '规格',
+					prop: 'specification'
+				},
+
+				{
+					label: '型号',
+					prop: 'modelType'
+				},
+
+			]
+
+
+	
+
+	}
+
+	return []
+}

+ 253 - 0
pages/pda/feeding/single.vue

@@ -0,0 +1,253 @@
+<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">
+
+				<checkbox-group v-for="(item, index) in list" :key="index" @change="e => selectVal(e, item, index)">
+					<label class="listBox rx-bs">
+
+						<view class="listBox-sel">
+							<checkbox :value="item.code" color="#fff" :disabled="item.disabled"
+								:checked="item.checked" />
+						</view>
+
+						<view class="listBox-con">
+							<view class="listBox-top rx-bc">
+								<view> {{ item.name }}</view>
+								<view class="code">{{ item.code}}</view>
+							</view>
+
+							<view class="listBox-bottom rx">
+								<view v-for="(itm, index) in tableH(item.rootCategoryLevelId)" :key="index"
+									class="items" v-if="!itm.formatter">
+									<text>{{ itm.label }}</text>{{ item[itm.prop] }}
+								</view>
+
+							</view>
+
+						</view>
+
+
+					</label>
+
+				</checkbox-group>
+				<!--  -->
+			</u-list>
+
+		</view>
+
+		<view class="bottom-wrapper rx-bc">
+			<view>
+
+			</view>
+			<view>
+				<u-button type="success" size="small" class="u-reset-button" @click="jumpAdd">
+					<view> 选择 </view>
+				</u-button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		tableHeader
+	} from './single.js'
+
+	import {
+		feedOutInOrder
+	} from '@/api/pda/workOrder.js'
+	export default {
+		data() {
+			return {
+				taskId: null,
+				id: null,
+				list: [],
+				memoList: [],
+
+				storageKey: null,
+			}
+		},
+
+		onLoad(option) {
+
+			this.id = option.id
+			if (option.taskId == 'undefined') {
+				this.taskId = null
+			} else {
+				this.taskId = option.taskId || null
+			}
+			if (option.storageKey) {
+				this.storageKey = option.storageKey
+
+				this.memoList = []
+
+
+				let _arr = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
+				this.memoList = [..._arr[0].modelList, ..._arr[0].equipmentList, ..._arr[0].instanceList, ..._arr[0]
+					.aridRegionList, ..._arr[0].turnover
+				]
+
+
+			}
+
+			this.getList()
+		},
+
+
+		onUnload() {
+			if (this.storageKey) {
+				uni.removeStorage(this.storageKey)
+			}
+
+		},
+
+
+		methods: {
+			getList() {
+				let param = {
+					workOrderId: this.id,
+					taskId: this.taskId
+				}
+				feedOutInOrder(param).then(res => {
+					this.list.push(
+						...res.map(i => {
+							const checked =
+								this.memoList.findIndex(itm => itm.id === i.id) > -1
+
+							return {
+								checked,
+								...i,
+
+							}
+						})
+					)
+				})
+			},
+
+			tableH(type) {
+				return tableHeader(type)
+			},
+
+			selectVal(e, val, index) {
+				this.list[index].checked = !this.list[index].checked
+
+				const idx = this.memoList.findIndex(
+					item => item.id === this.list[index].id
+				)
+
+				if (this.list[index].checked) {
+					if (idx === -1) {
+						this.memoList.push(this.list[index])
+					}
+				} else {
+					if (idx > -1) {
+						this.memoList.splice(idx, 1)
+					}
+				}
+			},
+
+
+			jumpAdd() {
+				uni.$emit('setSelectList', this.memoList, this.id)
+				uni.navigateBack()
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content-box {
+		height: 100vh;
+		overflow: hidden;
+		display: flex;
+		flex-direction: column;
+		background-color: $page-bg;
+	}
+
+
+	.list_box {
+		flex: 1;
+		overflow: hidden;
+		padding: 4rpx 0;
+
+
+		.u-list {
+			height: 100% !important;
+		}
+
+
+	}
+
+
+	.listBox {
+		margin-top: 8rpx;
+		padding: 8rpx 24rpx;
+		background: #fff;
+
+
+		/deep/ .uni-checkbox-input-checked {
+			background-color: $theme-color !important;
+			border-color: $theme-color !important;
+		}
+
+		.listBox-con {
+			width: 650rpx;
+			font-weight: 400;
+		}
+
+		.listBox-top {
+			margin-top: 6rpx;
+			color: #090A0A;
+			font-size: 28rpx;
+			font-style: normal;
+			font-weight: 800;
+		}
+
+		.listBox-bottom {
+			color: #090A0A;
+			font-size: 24rpx;
+			font-style: normal;
+			flex-wrap: wrap;
+
+			.items {
+
+				width: calc(50% - 1px);
+				border-left: 1rpx solid #E3E5E5;
+				border-right: 1rpx solid #E3E5E5;
+				border-bottom: 1rpx solid #E3E5E5;
+				box-sizing: border-box;
+
+				text {
+					display: inline-block;
+					background: #F7F9FA;
+					padding: 8rpx 10rpx;
+					color: #157A2C;
+
+				}
+
+				&:nth-child(1),
+				&:nth-child(2) {
+					border-top: 1rpx solid #E3E5E5;
+					margin-top: 8rpx;
+				}
+
+			}
+
+		}
+	}
+
+	.bottom-wrapper {
+		height: 80rpx;
+		background: #fff;
+		padding: 0 32rpx;
+
+		/deep/ .uni-checkbox-input-checked {
+			background-color: $theme-color !important;
+			border-color: $theme-color !important;
+		}
+	}
+</style>