ysy 2 년 전
부모
커밋
d66ca68b66

+ 1 - 1
App.vue

@@ -8,7 +8,7 @@ export default {
     //console.log('App Launch')
     // 配置1秒后自动关闭启动页
 
-
+ console.log('Vue version:', Vue.version);
     
     // #ifdef APP-PLUS
     const apiInfo = uni.getStorageSync('apiInfo')

+ 8 - 0
pages.json

@@ -1470,6 +1470,14 @@
 				"navigationStyle": "custom",
 				"navigationBarTextStyle": "white"
 			}
+		},
+		{
+			"path" : "pages/pda/sample/index/jobBooking",
+			"style" : 
+			{
+				"navigationStyle" : "custom",
+				"navigationBarTextStyle" : "white"
+			}
 		}
 
 

+ 1 - 1
pages/pda/components/bottomOperate.vue

@@ -87,7 +87,7 @@
 						},
 						{
 							name: '报工',
-							type: 'jobBooking'
+							type: 'sampleJob'
 						},
 					]
 				}

+ 51 - 12
pages/pda/sample/components/sampleBom.vue

@@ -2,8 +2,6 @@
 	<view>
 		<view class="title_box rx-bc">
 			<view class="name">取样</view>
-
-
 		</view>
 
 
@@ -44,17 +42,21 @@
 				<view class="item">
 					<view class="lable rx-cc">取样数量</view>
 					<view class="content content_num  rx-sc">
-						<input class="uni-input" v-model="item.sampleNum" type='digit'
+						<input class="uni-input" v-if="!isDetails" v-model="item.sampleNum" type='digit'
 							@blur='item.sampleNum > item.formedNum ?  item.sampleNum = item.formedNum : item.sampleNum'></input>
+						<view v-else>{{ item.sampleNum }}</view>
 						<view class="unit">{{item.unit}}</view>
-						<view class="penalize" @click="penalize">处置
-						
+						<view class="penalize" v-if='!isDetails' @click="penalize">处置
+
 						</view>
 
 					</view>
 				</view>
 
-		
+
+
+
+
 
 
 
@@ -81,17 +83,18 @@
 						</view>
 
 						<view class="item ww20 content_num">
-							<input class="uni-input" v-model="item.num"></input>
+							<input class="uni-input" v-if='!isDetails' v-model="item.num"></input>
+							<view v-else> {{ item.num }}</view>
 						</view>
 
 						<view class="item ww55  content_num">
-							<zxz-uni-data-select :localdata="warehouseList" v-if='item.selectType != 1'
-								v-model="item.warehouseId" dataValue='id' dataKey="name" filterable
-								format='{name}'></zxz-uni-data-select>
+							<zxz-uni-data-select :localdata="warehouseList" :disabled="isDetails"
+								v-if='item.selectType != 1' v-model="item.warehouseId" dataValue='id' dataKey="name"
+								filterable format='{name}'></zxz-uni-data-select>
 						</view>
 						<view class="item ww15">
 							<view class="left rx-ss" @click="getDelete(index)">
-								<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20"
+								<uni-icons custom-prefix="iconfont" v-if="!isDetails" type="icon-shanchu" size="20"
 									color="#fa3534"></uni-icons>
 							</view>
 						</view>
@@ -111,6 +114,28 @@
 
 		</view>
 
+
+
+		<view class="title_box rx-bc" v-if="isDetails">
+			<view class="name">报工</view>
+		</view>
+
+
+		<view class="material " v-if="isDetails">
+
+			<view class="content_table">
+				<view class="item">
+					<view class="lable rx-cc">合格数量</view>
+					<view class="content  content_num">
+						<input class="uni-input" v-model="workReportInfo.formedNum" type='digit'></input>
+					</view>
+				</view>
+
+			</view>
+
+		</view>
+
+
 		<u-popup :show="show" mode='center' v-if='show' :closeOnClickOverlay='false'>
 			<view class="popup_box">
 				<uni-data-select v-model="selectType" :localdata="rangeList"></uni-data-select>
@@ -142,6 +167,16 @@
 				default: () => {}
 			},
 
+			workReportInfo: {
+				type: Object,
+				default: () => {}
+			},
+
+			isDetails: {
+				type: Boolean,
+				default: false
+			}
+
 
 		},
 		data() {
@@ -178,7 +213,7 @@
 
 			penalize() {
 
-				if (Number(this.item.sampleNum <= 0) ) {
+				if (Number(this.item.sampleNum <= 0)) {
 					uni.showToast({
 						icon: 'none',
 						title: '取样数量要大于0'
@@ -206,6 +241,10 @@
 					})
 				}
 
+
+
+
+
 			},
 
 			getDelete(idx) {

+ 37 - 10
pages/pda/sample/index/index.vue

@@ -6,14 +6,14 @@
 		<view class="list_box">
 			<u-list @scrolltolower="scrolltolower">
 				<view class="card_box" v-for="(item,index) in List" :key="index">
-					<workOrderBom :item='item' v-if='item' :isDetails='true'></workOrderBom>
+					<workOrderBom :item='item' v-if='item' @handleScan='handleWordScan'></workOrderBom>
 
-					<sampleBom :item='item.quality' v-if='item.quality'></sampleBom>
+					<sampleBom :item='item.quality' v-if='item.quality' :isDetails='false'></sampleBom>
 
 				</view>
 			</u-list>
 		</view>
-		
+
 		<view class="bottom-wrapper">
 			<view class="btn_box" @click="save">一键报工</view>
 		</view>
@@ -43,7 +43,8 @@
 				title: null,
 				id: null,
 				taskId: null,
-				List: []
+				List: [],
+				count: 0
 			}
 		},
 
@@ -61,7 +62,7 @@
 				}).then(res => {
 					this.List = res.map(m => {
 						m.workOrderId = m.id
-                        m.quality['sampleList'] = []
+						m.quality['sampleList'] = []
 						delete m.id
 						return {
 							...m
@@ -71,15 +72,41 @@
 			},
 
 			scrolltolower() {},
-			
+
+			handleWordScan() {
+				uni.showToast({
+					icon: 'none',
+					title: '不支持换工单'
+				})
+			},
+
 			save() {
-			    
+
 				console.log(this.List)
-			    return false
-			
+
+
+				this.count = 0;
+				this.List[0].quality.sampleList.forEach(e => {
+					if (Number(e.num) > 0 && Number(e.num) != NaN) {
+						this.count += Number(e.num);
+					}
+
+				})
+
+				if (this.List[0].quality.sampleNum != this.count) {
+					uni.showToast({
+						icon: 'none',
+						title: '处置数量和取样数量对应不上'
+					})
+
+					return false
+				}
+
+
+
 				batchSave(this.List).then(res => {
 					uni.navigateBack()
-			
+
 				})
 			},
 

+ 191 - 0
pages/pda/sample/index/jobBooking.vue

@@ -0,0 +1,191 @@
+<template>
+	<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>
+
+
+					<sampleBom :item='objData.quality' v-if='objData.quality' :workReportInfo='objData.workReportInfo'
+						:isDetails='true'></sampleBom>
+
+
+
+
+				</view>
+
+			</u-list>
+		</view>
+
+
+		<view class="bottom-wrapper">
+			<view class="btn_box" @click="save">一键报工</view>
+		</view>
+
+
+
+
+	</view>
+</template>
+
+<script>
+	import {
+		getByIdReport,
+
+		jobSave
+	} from '@/api/pda/jobBooking.js'
+
+
+	import sampleBom from '../components/sampleBom.vue'
+	import workOrderBom from '../../feeding/components/workOrderBom.vue'
+
+
+
+	export default {
+
+		components: {
+			workOrderBom,
+			sampleBom
+
+		},
+		data() {
+			return {
+				title: '',
+				objData: {},
+				id: null,
+				taskId: null,
+
+			}
+		},
+		onLoad(options) {
+			this.title = options.taskName ? options.taskName + '-报工' : '报工'
+			this.id = options.workOrderId
+			this.taskId = options.taskId
+			this.getList()
+		},
+
+		onShow() {
+
+
+		},
+
+		methods: {
+
+
+
+
+
+
+
+			getList() {
+				getByIdReport(this.id, this.taskId).then(res => {
+
+					res.workReportInfo = {
+						formingNum: null,
+						formingWeight: null,
+						formedNum: null,
+						formedWeight: null,
+						taskId: this.taskId,
+						reportType: 2
+
+					}
+					this.objData = res
+
+
+
+
+
+
+
+
+				})
+			},
+
+			scrolltolower() {},
+
+
+
+
+
+
+			save() {
+
+
+				if (Number(this.objData.workReportInfo.formedNum) <= 0 || this.objData.workReportInfo.formedNum == null) {
+					uni.showToast({
+						icon: 'none',
+						title: '请输入合格数量'
+					})
+
+					return false
+				}
+
+
+
+
+				jobSave(this.objData).then(res => {
+					if (res) {
+						uni.navigateBack()
+					}
+				})
+
+
+
+			}
+		}
+	}
+</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;
+		}
+
+
+
+	}
+
+	.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;
+		}
+	}
+
+
+
+
+	.search_list {
+		min-height: 500rpx;
+		padding: 0 32rpx;
+	}
+</style>

+ 9 - 0
pages/pda/workOrder/extrusionMolding/index.vue

@@ -327,7 +327,16 @@
 					uni.navigateTo({
 						url
 					})
+				} else if (type == 'sampleJob') {
+					url = '/pages/pda/sample/index/jobBooking'
+					url += `?workOrderId=${this.info.id}&taskId=${taskId }&taskName=${taskName}`
+					uni.navigateTo({
+						url
+					})
 				}
+				
+				
+				
 
 			},