ysy 2 jaren geleden
bovenliggende
commit
8ed52c9a13
4 gewijzigde bestanden met toevoegingen van 581 en 8 verwijderingen
  1. 6 0
      pages/index/index.vue
  2. 167 0
      pages/pda/feeding/components/pickCard.vue
  3. 1 5
      pages/pda/feeding/details.vue
  4. 407 3
      pages/pda/feeding/index/index.vue

+ 6 - 0
pages/index/index.vue

@@ -102,6 +102,12 @@
 						link_url: "/pages/pda/picking/index/index",
 					},
 					
+					{
+						class: "iconfont icon-gongdanguanli",
+						title: "投料",
+						link_url: "/pages/pda/feeding/index/index",
+					},
+					
 					{
 						class: "iconfont icon-gongdanguanli",
 						title: "退料",

+ 167 - 0
pages/pda/feeding/components/pickCard.vue

@@ -0,0 +1,167 @@
+<template>
+	<view>
+
+		<checkbox-group v-for="(item, index) in list" :key="index" @change="e => selectVal(e, item, index)">
+		     <label>
+			<view class="card_box" @click="openDetails(item.pickStatus, item.id)">
+				<view class="item_box rx-bc">
+					<view class="rx-sc">
+						<checkbox  v-if='item.pickStatus == 0' :checked="item.checked" />
+							
+						<view class="orderId">{{item.code}} </view>
+					</view>
+					<view class="status " :class="[item.pickStatus == 0 ? 'FAA': '' ]"> {{ item.pickStatus == 0 ? '未领料' : item.pickStatus == 1 ? '已领料' : item.pickStatus == 2 ? '已出库' : '' }}</view>
+				</view>
+
+				<view class="item_box rx-bc">
+					<view class="item_one perce50 rx-sc">
+						<view class="lable">产品编码:</view>
+						<view>{{item.productCode}}</view>
+					</view>
+					<view class="item_one perce50 rx-sc">
+						<view>名称:</view>
+						<view>{{item.productName}}</view>
+					</view>
+				</view>
+
+
+				<view class="item_box rx-bc">
+					<view class="item_one perce50 rx-sc">
+						<view class="lable">牌号:</view>
+						<view>{{item.brandNo}}</view>
+					</view>
+					<view class="item_one perce50 rx-sc">
+						<view>型号:</view>
+						<view>{{item.model}}</view>
+					</view>
+				</view>
+
+
+				<view class="item_box rx-bc">
+					<view class="item_one perce50 rx-sc">
+						<view class="lable">生产数量:</view>
+						<view>{{item.formingWeight}}</view>
+					</view>
+					<view class="item_one perce50 rx-sc">
+						<view>状态:</view>
+						<view>{{statusList[item.status]}}</view>
+					</view>
+				</view>
+
+
+				<view class="item_box rx-sc">
+					<view class="item_one rx-sc">
+						<view class="lable">工艺路线:</view>
+						<view class="gylx">{{item.produceRoutingName}}</view>
+					</view>
+
+				</view>
+
+
+
+			</view>
+			</label>
+
+		</checkbox-group>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			list: {
+				type: Array,
+				default: () => []
+			},
+		},
+
+		data() {
+			return {
+				statusList: {
+					4: '待生产',
+					5: '生产中',
+					6: '已完成',
+					7: '已延期',
+					8: '待下达'
+				}
+			}
+		},
+		methods: {
+			selectVal(e, val, index) {
+				this.list[index].checked = !this.list[index].checked
+			},
+			
+			openDetails(pickStatus, id) {
+				if(pickStatus == 1) {
+					 let url =  `/pages/pda/picking/bill/index?id=${id}`
+					uni.navigateTo({
+						url
+					})
+				}
+			}
+		}
+
+	}
+</script>
+
+
+<style lang="scss" scoped>
+	.card_box {
+		width: 750rpx;
+		padding: 16rpx 24rpx;
+		box-sizing: border-box;
+		border-bottom: 2rpx solid #E1E1E1;
+
+
+		.item_box {
+			margin-top: 10rpx;
+
+		
+
+			.orderId {
+				color: #000;
+				font-family: PingFang HK;
+				font-size: 28rpx;
+				font-style: normal;
+				font-weight: 600;
+				margin-left: 16rpx;
+				margin-top: 8rpx;
+			}
+
+			.item_one {
+				width: 100%;
+				font-size: 26rpx;
+				font-style: normal;
+				font-weight: 400;
+				line-height: 38rpx;
+				word-wrap: break-word;
+			}
+
+			.gylx {
+				color: $theme-color;
+			}
+
+			.perce50 {
+				width: 50%;
+			}
+
+			.status {
+				font-size: 26rpx;
+
+				&.FAA {
+					color: #FFA929;
+				}
+			}
+			
+			
+			/deep/ .uni-checkbox-input-checked {
+				background-color: $theme-color !important;
+				border-color: $theme-color !important;
+			}
+		}
+	}
+	
+	
+	
+</style>

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

@@ -19,11 +19,7 @@
 
 
 		onLoad(options) {
-			this.title = options.taskName
-
-
-
-
+			this.title = options.taskName ?  options.taskName + '-投料' : '投料'
 
 		},
 

+ 407 - 3
pages/pda/feeding/index/index.vue

@@ -1,21 +1,425 @@
 <template>
-	<view>
-      
+	<view class="content-box">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="投料" background-color="#157A2C" color="#fff"
+			@clickLeft="back" right-icon="scan" @clickRight="HandlScanCode">
+		</uni-nav-bar>
+
+		<view class="top-wrapper">
+			<!-- 	<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 class="nav_box rx-sc">
+				<view class="nav_item " :class="{active: pickStatus == 0}" @click="handNav(0)">
+					未投料({{navObj.unclaimedQuantity}})</view>
+				<view class="nav_item" :class="{active: pickStatus == 1}" @click="handNav(1)">
+					已投料({{navObj.claimedQuantity}})</view>
+				
+
+				<view class="menu_box" @click="handleSearch">
+					<image class="menu_icon" src="~@/static/pda/menu.svg"></image>
+				</view>
+
+
+
+			</view>
+		</view>
+
+		<view class="list_box">
+
+			<u-list @scrolltolower="scrolltolower">
+				<pickCard v-if='dataList.length' :list="dataList"> </pickCard>
+
+
+				<view v-else style='margin-top: 20vh;'>
+					<u-empty iconSize='150' textSize='32' text='暂无工单'>
+					</u-empty>
+				</view>
+
+			</u-list>
+
+
+
+		</view>
+
+		<view class="bottom-wrapper rx-bc" v-if='pickStatus == 0'>
+			<view>
+				<checkbox v-if="!seletedAll" color="#fff" :checked="seletedAll" @tap="_seletedAll">全选</checkbox>
+				<checkbox class="select-all" color="#fff" v-else :checked="seletedAll" @tap="_seletedAll">取消全选
+				</checkbox>
+			</view>
+			<view>
+				<u-button type="success" size="small" class="u-reset-button" :disabled="!checkListLen" @click="jumpAdd">
+					<view> 选择( {{ checkListLen }} ) </view>
+				</u-button>
+			</view>
+		</view>
+
+
+		<SearchPopup mode="top" 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="assetType"
+				   >
+				   
+				   <zxz-uni-data-select :localdata="produceList" v-model="formData.produceRoutingId"
+				   	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="search">
+						确定
+					</u-button>
+
+				</view>
+			</template>
+
+		</SearchPopup>
+
+
 	</view>
 </template>
 
 <script>
+	import pickCard from '../components/pickCard.vue'
+	import {
+		workorderPage,
+		producerouting
+	} from '@/api/pda/workOrder.js'
+
+	import {
+		pickStatistics
+	} from '@/api/pda/picking.js'
+	import SearchPopup from '../../components/searchPopup.vue'
+	let [isEnd] = [false]
+
 	export default {
+		components: {
+			pickCard,
+			SearchPopup
+		},
 		data() {
 			return {
+				tabType: 1,
+				pickStatus: 0,
+				
+				formData: {
+					produceRoutingId: ''
+				},
+
+				navObj: {
+					unclaimedQuantity: 0,
+					claimedQuantity: 0
+				},
+
+				page: 1,
+				size: 10,
+
+				dataList: [],
+				produceList: [],
+				seletedAll: false, //全选状态
+
+				searchShow: false,
+
+
 			}
 		},
+
+		//选择的列表长度
+		computed: {
+			checkListLen() {
+				let _fitArr = this.dataList.filter(f => f.checked)
+				return _fitArr.length
+			}
+
+		},
+
+		onLoad(option) {
+			this.pickStatus = option.pickStatus || 0
+			
+			this.produceFn()
+		},
+
+		onShow() {
+			this.page = 1
+			// this.dataList = []
+			this.getList()
+			this.getpickTics()
+		},
+
+
 		methods: {
+			
+			search() {
+				this.page = 1
+				this.getList()
+				this.searchShow = false
+			},
+
+
+			async getList() {
+				let params = {
+					pageNum: this.page,
+					size: this.size,
+					pickStatus: this.pickStatus,
+					produceRoutingId: this.formData.produceRoutingId
+
+				}
+
+				isEnd = false
+				const res = await workorderPage(params)
+
+
+				if (params.page === 1) {
+					this.dataList = []
+				}
+
+				let _list = res.list.map(m => {
+					return {
+						checked: false,
+						...m
+					}
+				})
+
+				this.dataList.push(..._list)
+				isEnd = this.dataList.length >= res.count
+
+			},
+
+			getpickTics() {
+				pickStatistics().then(res => {
+					this.navObj = res
+				})
+			},
 
+
+			handTab(type) {
+				if (type != this.tabType) {
+					this.tabType = type
+				}
+			},
+
+			handNav(type) {
+				if (type != this.pickStatus) {
+					this.pickStatus = type
+
+					this.page = 1
+					this.dataList = []
+					this.getList()
+				}
+			},
+
+
+			scrolltolower() {
+				if (isEnd) return
+				this.page++
+				this.getList()
+			},
+
+			_seletedAll() {
+
+				if (!this.seletedAll) {
+					this.seletedAll = true
+					this.dataList.forEach(e => {
+						e.checked = true
+					})
+
+				} else {
+					this.seletedAll = false
+					this.dataList.forEach(e => {
+						e.checked = false
+					})
+				}
+			},
+
+			jumpAdd() {
+				let url
+				url = '/pages/pda/feeding/details'
+
+				let arr = []
+				this.dataList.forEach(e => {
+					if (e.checked) {
+						arr.push(e.id)
+					}
+				})
+				let _arr = JSON.stringify(arr)
+				url += `?arr=${encodeURIComponent(_arr)}`
+				uni.navigateTo({
+					url
+				})
+			},
+
+
+			// 相机扫码
+			HandlScanCode() {
+				let _this = this
+				uni.scanCode({
+					success: function(res) {
+						console.log(res)
+					}
+				})
+				//_this.Scancodedate('res')
+			},
+
+
+			handleSearch() {
+				this.searchShow = true
+			},
+			
+			searchCancel() {
+				this.formData.produceRoutingId = ''
+				this.page = 1
+				this.getList()
+				this.searchShow = false
+			},
+			
+			produceFn() {
+				let param = {
+					pageNum: 1,
+					size: -1
+				}
+				producerouting(param).then(res => {
+					this.produceList = res.list
+					
+				})
+			},
+			
 		}
 	}
 </script>
 
-<style>
+<style lang="scss" scoped>
+	.content-box {
+		height: 100vh;
+		overflow: hidden;
+		display: flex;
+		flex-direction: column;
+		background-color: $page-bg;
+	}
+
+
+	.tab_box {
+		width: 100%;
+		height: 68rpx;
+		background: #fff;
+
+		.tab_item {
+			height: 68rpx;
+			line-height: 68rpx;
+			padding: 0 20rpx;
+			font-size: 32rpx;
+			color: #979C9E;
+
+		}
+
+		.active {
+			box-sizing: border-box;
+			border-bottom: 6rpx solid $theme-color;
+			color: $theme-color;
+		}
+
+
+	}
+
+	.nav_box {
+		padding: 6rpx 32rpx;
+		position: relative;
 
+		.nav_item {
+			font-size: 28rpx;
+			font-weight: 400;
+			color: $theme-color;
+			background: #F0F8F2;
+			margin-right: 16rpx;
+			padding: 4rpx 16rpx;
+			border-radius: 8rpx;
+			border: 2rpx solid #ACD4B5;
+
+		}
+
+		.menu_box {
+			position: absolute;
+			right: 20rpx;
+			top: 10rpx;
+
+			.menu_icon {
+				width: 44rpx;
+				height: 44rpx;
+			}
+
+		}
+
+
+
+		.active {
+			background: $theme-color;
+			border: 2rpx solid $theme-color;
+			color: #FFF;
+		}
+	}
+
+	.list_box {
+		flex: 1;
+		overflow: hidden;
+		padding: 4rpx 0;
+
+		.u-list {
+			height: 100% !important;
+		}
+	}
+
+
+	.bottom-wrapper {
+		height: 80rpx;
+		background: #fff;
+		padding: 0 32rpx;
+
+		/deep/ .uni-checkbox-input-checked {
+			background-color: $theme-color !important;
+			border-color: $theme-color !important;
+		}
+	}
+	
+	
+	.search_list{
+		min-height: 100rpx;
+		
+		/deep/ .baseForm{
+			padding: 0 20rpx;
+		}
+	}
+
+	.operate_box{
+		padding: 10rpx 32rpx;
+		/deep/ .u-button{
+			width: 40%;
+		}
+	}
 </style>