ysy 2 роки тому
батько
коміт
8c52c7c52e

+ 2 - 2
pages/pda/feeding/components/deviceBom.vue

@@ -39,7 +39,7 @@
 				</view>
 
 
-			<view class="item">
+				<view class="item" v-if="clientEnvironmentId == 3">
 					<view class="lable rx-cc">炉次</view>
 					<view class="content content_num">
 						<input class="uni-input" v-model="item.extInfo.heatNumber" type="number"></input>
@@ -74,7 +74,7 @@
 		},
 		data() {
 			return {
-
+				clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo").clientEnvironmentId
 			}
 		},
 		methods: {

+ 1 - 4
pages/pda/feeding/components/feedBom.js

@@ -5,10 +5,7 @@ export const tableHeader = selectEquiType => {
 		case 1:
 			return [
 
-				{
-					label: '编码',
-					prop: 'code'
-				},
+	
 
 				{
 					label: '名称',

+ 260 - 45
pages/pda/feeding/components/instanceBom.vue

@@ -2,79 +2,170 @@
 	<view>
 		<view class="title_box rx-bc">
 			<view class="name">物料清单</view>
+			<view class="btn_box rx-cc" v-if="deviceList.length > 1" @click="bindDevice">绑定设备</view>
 		</view>
 
-		<view class="material rx-ss" v-for="(mate, idx) in list" :key="idx">
-			<view class="left rx-ss" @click="getDelete(idx)" v-if='workOrderId'>
-				<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
-			</view>
-			<view class="content_table">
-       
+		<u-list @scrolltolower="scrolltolower" class="z_list" style="height: 100% !important;">
 
-				<view class="item" v-for="(itm, index) in tableH(mate.rootCategoryLevelId)" :key="index">
-					<view class="lable rx-cc">{{ itm.label }}</view>
-					<view class="content">{{ mate[itm.prop] }}</view>
-				</view>
-              
-				<view class="item" v-if='mate.isConsumable == 1'>
-					<view class="lable rx-cc">包装库存</view>
-					<view class="content">{{ mate.packingCountBase }}/ {{ mate.minUnit}}</view>
+			<view class="material rx-ss" v-for="(mate, idx) in list" :key="idx">
+				<view class="left rx-ss" @click="getDelete(idx)" v-if='workOrderId'>
+					<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
 				</view>
+				<view class="content_table">
 
 
-				<view class="item" v-if='mate.isConsumable == 0'>
-					<view class="lable rx-cc">重量</view>
-					<view class="content">{{mate.extInfo.weight || 0}} {{ mate.extInfo.weightUnit}} </view>
-				</view>
+					<view class="item rx-sc" v-if='mate.rootCategoryLevelId == 1 && mate.isConsumable == 1'>
+						<view class="rx ww50">
+							<view class="lable rx-cc">编码</view>
+							<view class="content">{{ mate.code }}</view>
+						</view>
+					</view>
 
+					<view class="item rx-bc" v-if='mate.rootCategoryLevelId == 1 && mate.isConsumable == 0'
+						@click="handleCheck(idx, mate)">
+						<view class="rx ww80">
+							<view class="lable rx-cc">编码</view>
+							<view class="content">{{ mate.code }}</view>
+						</view>
+
+						<view class="rx-cc ww20" v-if="deviceList.length > 1">
+							<image class="check" v-if="mate.check" src='../../../../static/check.png'></image>
+							<image class="check" v-if="!mate.check" src='../../../../static/check_no.png'></image>
+						</view>
+					</view>
 
-				<view class="item" v-if='mate.isConsumable == 0'>
-					<view class="lable rx-cc">刻码</view>
-					<view class="content">{{mate.extInfo.engrave}}</view>
-				</view>
 
 
-				<view class="item" v-if='mate.isConsumable == 0'>
-					<view class="lable rx-cc">物料代号</view>
-					<view class="content">{{mate.extInfo.materielCode}}</view>
-				</view>
 
 
-				<view class="item" v-if='mate.isConsumable == 0'>
-					<view class="lable rx-cc">客户代号</view>
-					<view class="content">{{mate.extInfo.clientCode}}</view>
-				</view>
 
+					<view class="item" v-for="(itm, index) in tableH(mate.rootCategoryLevelId)" :key="index">
+						<view class="lable rx-cc">{{ itm.label }}</view>
+						<view class="content">{{ mate[itm.prop] }}</view>
+					</view>
+
+					<view class="item" v-if='mate.isConsumable == 1'>
+						<view class="lable rx-cc">包装库存</view>
+						<view class="content">{{ mate.packingCountBase }}/ {{ mate.minUnit}}</view>
+					</view>
 
 
+					<view class="item rx-sc" v-if='mate.isConsumable == 0'>
+						<view class="rx ww50">
+							<view class="lable  rx-cc">重量</view>
+							<view class="content">{{mate.extInfo.weight || 0}} {{ mate.extInfo.weightUnit}} </view>
+						</view>
 
 
+						<view class="rx ww50">
+							<view class="lable ww80 rx-cc">刻码</view>
+							<view class="content">{{mate.extInfo.engrave}}</view>
+						</view>
 
-				<view class="item" v-if='mate.isConsumable == 0'>
-					<view class="lable rx-cc">位置</view>
-					<view class="content content_num ww400">
-						<input class="uni-input" v-model='mate.extInfo.position'></input>
 					</view>
-				</view>
 
 
 
 
 
-				<view class="item">
-					<view class="lable rx-cc">数量</view>
-					<view class="content content_num">
-						<input class="uni-input" v-model="mate.feedQuantity" type="digit"></input>
-						<view class="unit">/{{mate.unit}}</view>
+					<view class="item" v-if='mate.isConsumable == 0'>
+						<view class="lable rx-cc">物料代号</view>
+						<view class="content">{{mate.extInfo.materielCode}}</view>
 					</view>
-				</view>
 
 
+					<view class="item" v-if='mate.isConsumable == 0'>
+						<view class="lable rx-cc">客户代号</view>
+						<view class="content">{{mate.extInfo.clientCode}}</view>
+					</view>
 
 
+					<view class="item" v-if='mate.isConsumable == 0 && deviceList.length > 1'>
+						<view class="lable rx-cc">设备</view>
+						<view class="content content_num">
+							<zxz-uni-data-select :localdata="deviceList" v-model="mate.deviceId" dataValue='id'
+								format='{name}-{fixCode}' @change=" e => mate.deviceName = e.name" dataKey="id"
+								filterable :clear='false'></zxz-uni-data-select>
+						</view>
+					</view>
+
+
+
+					<view class="item rx-sc" v-if='mate.isConsumable == 0'>
+						<view class="rx ww50">
+							<view class="lable rx-cc">位置</view>
+							<view class="content content_num ">
+								<input class="uni-input" v-model='mate.extInfo.position'></input>
+							</view>
 
+						</view>
+
+						<view class="rx ww50">
+							<view class="lable rx-cc ww80">数量</view>
+							<view class="content content_num   ">
+								<input class="uni-input" v-model="mate.feedQuantity" type="digit"></input>
+								<view class="unit ">/{{mate.unit}}</view>
+							</view>
+						</view>
+
+					</view>
+
+
+
+
+
+					<view class="item" v-if='mate.isConsumable == 1'>
+						<view class="lable rx-cc">数量</view>
+						<view class="content content_num">
+							<input class="uni-input" v-model="mate.feedQuantity" type="digit"></input>
+							<view class="unit">/{{mate.unit}}</view>
+						</view>
+					</view>
+
+
+
+
+				</view>
 			</view>
-		</view>
+
+		</u-list>
+
+		<SearchPopup mode="center" v-if='deviveShow'>
+			<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="deviceList" v-model="formData.deviceId" dataValue='id'
+								format='{name}-{fixCode}' @change="e => formData.deviceName = e.name" dataKey="id"
+								filterable :clear='false'></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="deviceClose">
+						取消
+					</u-button>
+
+
+					<u-button type="success" size="small" class="u-reset-button" @click="deviceOk">
+						确定
+					</u-button>
+
+				</view>
+			</template>
+
+		</SearchPopup>
+
 
 	</view>
 </template>
@@ -83,7 +174,11 @@
 	import {
 		tableHeader
 	} from './feedBom.js'
+	import SearchPopup from '../../components/searchPopup.vue'
 	export default {
+		components: {
+			SearchPopup
+		},
 		props: {
 			workOrderId: {
 				type: String,
@@ -92,15 +187,38 @@
 			list: {
 				type: Array,
 				default: () => []
+			},
+			equipmentList: {
+				type: Array,
+				default: () => []
 			}
 		},
+
+		watch: {
+			equipmentList: {
+				immediate: true,
+				deep: true,
+				handler(newVal) {
+					this.deviceList = newVal
+					
+				
+				}
+			},
+		},
+
 		data() {
 			return {
+				deviceList: [],
 
+				deviveShow: false,
+				formData: {
+					deviceId: null,
+					deviceName: null,
+				}
 			}
 		},
 		created() {
-		
+
 		},
 		methods: {
 			tableH(type) {
@@ -110,6 +228,56 @@
 			getDelete(idx) {
 				this.list.splice(idx, 1)
 			},
+
+			scrolltolower() {},
+			
+		
+
+			handleCheck(idx, it) {
+				this.$set(this.list[idx], 'check', !it.check)
+			},
+
+			bindDevice() {
+				this.deviveShow = true
+			},
+
+			deviceOk() {
+				let arr = this.list.filter(e => {
+					return e.check
+				})
+				if (arr.length <= 0) {
+					uni.showToast({
+						icon: 'none',
+						title: '请先勾选物料'
+					})
+					return false
+				}
+
+				if (!this.formData.deviceId) {
+					uni.showToast({
+						icon: 'none',
+						title: '请先选择设备'
+					})
+					return false
+				}
+
+				this.list.forEach(e => {
+					if (e.check) {
+						e['deviceId'] = this.formData.deviceId
+						e['deviceName'] = this.formData.deviceName
+					}
+
+				})
+				this.$forceUpdate()
+				this.deviceClose()
+
+			},
+
+			deviceClose() {
+				this.formData.deviceName = null
+				this.formData.deviceId = null
+				this.deviveShow = false
+			},
 		}
 	}
 </script>
@@ -142,9 +310,12 @@
 
 		}
 
+
+
 		.btn_box {
 			padding: 0 18rpx;
-			height: 60rpx;
+			height: 48rpx;
+
 			background: $theme-color;
 			font-size: 26rpx;
 			font-style: normal;
@@ -189,7 +360,7 @@
 		}
 
 		.content_table {
-			width: 722rpx;
+			width: 680rpx;
 			border: 2rpx solid $border-color;
 
 			.item {
@@ -197,6 +368,7 @@
 				border-bottom: 2rpx solid $border-color;
 
 
+
 				.lable {
 					width: 132rpx;
 					text-align: center;
@@ -268,6 +440,49 @@
 			.ww45 {
 				width: 45%;
 			}
+
+			.ww50 {
+				width: 50%;
+
+			}
+
+			.ww80 {
+				width: 80%;
+			}
+
+			.ww20 {
+				width: 20%;
+			}
+
+			.check {
+				width: 30rpx;
+				height: 30rpx;
+			}
+		}
+	}
+
+
+	.z_list {
+		max-height: 2000rpx;
+	}
+
+
+
+
+	.search_list {
+		min-height: 100rpx;
+		width: 90vw;
+
+		/deep/ .baseForm {
+			padding: 0 20rpx;
+		}
+	}
+
+	.operate_box {
+		padding: 10rpx 32rpx;
+
+		/deep/ .u-button {
+			width: 40%;
 		}
 	}
 </style>

+ 1 - 1
pages/pda/feeding/components/workOrderBom.vue

@@ -71,7 +71,7 @@
 				type: Boolean,
 				default: false
 			}
-			
+
 		},
 		data() {
 			return {

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

@@ -11,6 +11,7 @@
 
 					<paramBom v-if='item.paramDetailList.length != 0' :list='item.paramDetailList'></paramBom>
 
+                   
 					<deviceBom v-if='item.equipmentList.length != 0' :workOrderId='item.workOrderId'
 						:list='item.equipmentList' @scanIt='scanIt'></deviceBom>
 
@@ -23,7 +24,7 @@
 					</modelBom>
 
 					<instanceBom v-if='item.instanceList.length != 0' :workOrderId='item.workOrderId'
-						:list='item.instanceList'></instanceBom>
+						:list='item.instanceList' :equipmentList="item.equipmentList"></instanceBom>
 
 
 					<turnoverBom v-if='item.turnover.length != 0' :list='item.turnover' :wordItem='item' pattern='feed'
@@ -102,7 +103,9 @@
 				title: '',
 				idsList: [],
 				List: [],
-				taskId: null
+				taskId: null,
+				
+				clientEnvironmentId: null
 
 
 			}
@@ -117,6 +120,9 @@
 
 
 			this.getList()
+			
+			this.clientEnvironmentId =  uni.getStorageSync("userInfo") &&   uni.getStorageSync("userInfo").clientEnvironmentId
+		
 
 		},
 		onShow() {
@@ -173,6 +179,21 @@
 			scrolltolower() {},
 
 			save() {
+				
+				
+				if(this.clientEnvironmentId == 3) {
+					this.List.forEach(e => {
+						 if(e.equipmentList.length == 1) {
+							 e.instanceList.forEach(o => {
+								 if(o.rootCategoryLevelId == 1 && o.isConsumable == 0) {
+									 o['deviceName'] =  e.equipmentList[0].name
+									 o['deviceId'] = e.equipmentList[0].id
+								 }
+							 })
+						 }
+					})
+					
+				}
 
 				this.List.forEach(f => {
 					f.instanceList.forEach(e => {
@@ -184,7 +205,8 @@
 				})
 
 
-
+              
+	
 
 				batchSave(this.List).then(res => {
 
@@ -495,7 +517,7 @@
 		}
 
 		.card_box {
-			padding: 16rpx 24rpx;
+			padding: 16rpx;
 		}
 
 

+ 1 - 1
pages/pda/feeding/index/index.vue

@@ -67,7 +67,7 @@
 						<u-form-item label="工艺路线:" class="required-form" borderBottom prop="assetType">
 
 							<zxz-uni-data-select :localdata="produceList" v-model="formData.produceRoutingId"
-								dataValue='id'   dataKey="name" filterable format='{name}'></zxz-uni-data-select>
+								dataValue='id'    dataKey="name" filterable format='{name}'></zxz-uni-data-select>
 
 						</u-form-item>
 

+ 24 - 7
pages/pda/jobBooking/components/jobBom.vue

@@ -305,7 +305,14 @@
 
 				let weight = Number(this.item.workReportInfo.formedNum) * Number(this.item.singleWeight) * Number(this
 					.item.weightMultiple)
-				weight = parseFloat(weight.toFixed(2))
+
+				if (this.item.singleWeightUnit == 'G' || this.item.singleWeightUnit == 'g' || this.item
+					.singleWeightUnit == '克') {
+					weight = parseFloat((weight / 1000).toFixed(2))
+				} else {
+					weight = parseFloat(weight.toFixed(2))
+				}
+
 				this.$set(this.item.workReportInfo, 'formedWeight', weight)
 
 
@@ -317,19 +324,29 @@
 
 				let weight = Number(this.notFormedList[0].notFormedNum) * Number(this.item.singleWeight) * Number(this
 					.item.weightMultiple)
-				weight = parseFloat(weight.toFixed(2))
+				if (this.item.singleWeightUnit == 'G' || this.item.singleWeightUnit == 'g' || this.item
+					.singleWeightUnit == '克') {
+					weight = parseFloat((weight / 1000).toFixed(2))
+				} else {
+					weight = parseFloat(weight.toFixed(2))
+				}
 				this.$set(this.notFormedList[0], 'notFormedWeight', weight)
 
 
 				if (this.item.formedNumLast > 0 && Number(this.notFormedList[0].notFormedNum)) {
 					this.$set(this.item.workReportInfo, 'formedNum', this.item.formedNumLast - Number(this.notFormedList[0]
 						.notFormedNum))
-						
-						
-						let weight = Number(this.item.workReportInfo.formedNum) * Number(this.item.singleWeight) * Number(this
-							.item.weightMultiple)
+
+
+					let weight = Number(this.item.workReportInfo.formedNum) * Number(this.item.singleWeight) * Number(this
+						.item.weightMultiple)
+					if (this.item.singleWeightUnit == 'G' || this.item.singleWeightUnit == 'g' || this.item
+						.singleWeightUnit == '克') {
+						weight = parseFloat((weight / 1000).toFixed(2))
+					} else {
 						weight = parseFloat(weight.toFixed(2))
-						this.$set(this.item.workReportInfo, 'formedWeight', weight)
+					}
+					this.$set(this.item.workReportInfo, 'formedWeight', weight)
 
 				}
 

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

@@ -729,7 +729,7 @@
 		}
 
 		.card_box {
-			padding: 16rpx 24rpx;
+			padding: 16rpx 20rpx;
 		}
 
 

+ 1 - 1
pages/pda/sample/index/index.vue

@@ -269,7 +269,7 @@
 		}
 
 		.card_box {
-			padding: 16rpx 24rpx;
+		padding: 16rpx;
 		}
 
 

+ 1 - 1
pages/pda/sample/index/jobBooking.vue

@@ -168,7 +168,7 @@
 		}
 
 		.card_box {
-			padding: 16rpx 24rpx;
+	padding: 16rpx;
 		}
 
 

+ 1 - 1
pages/pda/sample/inspection/job.vue

@@ -181,7 +181,7 @@
 		}
 
 		.card_box {
-			padding: 16rpx 24rpx;
+		padding: 16rpx;
 		}
 
 

+ 1 - 1
pages/pda/turnover/index/index.vue

@@ -147,7 +147,7 @@
 		}
 
 		.card_box {
-			padding: 16rpx 24rpx;
+			padding: 16rpx;
 		}
 
 

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

@@ -145,7 +145,7 @@
 		}
 
 		.card_box {
-			padding: 16rpx 24rpx;
+			padding: 16rpx;
 		}
 
 

+ 1 - 0
uni_modules/zxz-uni-data-select/components/zxz-uni-data-select/zxz-uni-data-select.vue

@@ -552,6 +552,7 @@
 		width: 100%;
 		flex: 1;
 		box-sizing: border-box;
+		background: #F0F8F2;
 	}
 
 	.uni-stat-box {