ysy 2 лет назад
Родитель
Сommit
d0643c860f

+ 36 - 28
pages/pda/jobBooking/components/oneJobBom.vue

@@ -122,7 +122,8 @@
 
 						<view class="item " v-else :class="[ isFirstTask == 1 ? 'ww25' : 'ww50' ]">
 							<zxz-uni-data-select :localdata="stepsList" v-model="it.extInfo.taskId" dataValue='taskId'
-								format='{taskTypeName}' dataKey="taskId" filterable   @change=" e => it.extInfo.taskName = e.taskTypeName" 
+								format='{taskTypeName}' dataKey="taskId" filterable
+								@change=" e => it.extInfo.taskName = e.taskTypeName"
 								:clear='false'></zxz-uni-data-select>
 
 						</view>
@@ -167,7 +168,7 @@
 
 					</view>
 
-					<view class="table" >
+					<view class="table">
 
 						<view class="tr row rx-sc" v-for="(it, idx) in paramList" :key='idx'>
 							<view class="item  rx-bc ww30">
@@ -191,45 +192,50 @@
 
 
 							<view class="item ww20" v-if=" (idx == 0 || idx != paramList.length - 1)">
-								< {{it.CVIWeight}} </view>
+								> {{it.CVIWeight}} </view>
 
-									<view class="item ww20" v-if=" paramList.length > 1 && idx == paramList.length - 1">
-										≥ {{it.CVIWeight }}
-									</view>
+							<view class="item ww20" v-if=" paramList.length > 1 && idx == paramList.length - 1">
+								≥ {{it.CVIWeight }}
+							</view>
 
+							<view class="item ww10 rx-cc" @click="getDelete(idx)">
+								<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20"
+									color="#fa3534"></uni-icons>
 							</view>
 
+						</view>
 
 
 
 
 
-						</view>
 
-						<view class="formula_box">计算公式: 物料重量/坯体密度*密度系数 </view>
+					</view>
 
+					<view class="formula_box">计算公式: 物料重量/坯体密度*密度系数 </view>
 
-						<view class="rx-cc">
-							<u-button size="small" class="u-reset-button" style="width: 300rpx;margin: 20rpx;"
-								type="success" @click="paramSave">工序列表保存</u-button>
-						</view>
 
-						<view class="reportWeight rx-sc">
-							物料重量: {{weight}} ;
-							报工重量: {{reportWeight}}
+					<view class="rx-cc">
+						<u-button size="small" class="u-reset-button" style="width: 300rpx;margin: 20rpx;"
+							type="success" @click="paramSave">工序列表保存</u-button>
+					</view>
 
-						</view>
+					<view class="reportWeight rx-sc">
+						物料重量: {{weight}} ;
+						报工重量: {{reportWeight}}
 
+					</view>
 
 
-					</view>
 
+				</view>
 
-					<view class="operate_box rx-sc">
-						<u-button size="small" class="u-reset-button" @click="cancel">取消</u-button>
-						<u-button size="small" class="u-reset-button" type="success" @click="save">确定</u-button>
-					</view>
+
+				<view class="operate_box rx-sc">
+					<u-button size="small" class="u-reset-button" @click="cancel">取消</u-button>
+					<u-button size="small" class="u-reset-button" type="success" @click="save">确定</u-button>
 				</view>
+			</view>
 
 
 		</u-popup>
@@ -330,7 +336,7 @@
 				getComputeParam(this.item.workOrderId, this.item.currentTaskDiagram.taskId).then(res => {
 					this.paramList = []
 					this.paramList = res.paramList
-					this.paramObj = res
+					this.paramObj = res || {}
 				})
 			},
 
@@ -400,7 +406,7 @@
 				}
 				let param = {}
 
-				if (!this.paramObj.hasOwnProperty('id')) {
+				if (!Object.prototype.hasOwnProperty.call(this.paramObj, 'id')) {
 
 					param = {
 						paramList: this.paramList,
@@ -462,13 +468,14 @@
 			save() {
 
 
+
 				if (this.isFirstTask == 1) {
 
 					this.resultObj = {}
 
 
 					if (Number(this.reportWeight) < this.paramList[0].CVIWeight) {
-						this.resultObj = this.paramList[0]
+						this.resultObj = this.stepsList[0]
 						this.setDataSave()
 						return false
 					}
@@ -480,10 +487,11 @@
 						return false
 					}
 
-					for (let i = 1; i < this.paramList.length; i++) {
-						if (Number(this.paramList[i - 1].CVIWeight) < Number(this.reportWeight) <= Number(this.paramList[i]
-								.CVIWeight)) {
-							this.resultObj = this.paramList[i]
+					let _arr = JSON.parse(JSON.stringify(this.paramList))
+					_arr = _arr.reverse()
+					for (let i = 1; i < _arr.length; i++) {
+						if (Number(this.reportWeight) > Number(_arr[i].CVIWeight)) {
+							this.resultObj = _arr[i]
 							break;
 						}
 					}

+ 59 - 47
pages/pda/jobBooking/components/oneJobQualityBom.vue

@@ -82,7 +82,7 @@
 					</view>
 
 				</view>
-				
+
 				<view class="item rx-sc">
 					<view class="rx ww50">
 						<view class="lable lable150 rx-cc ">设备</view>
@@ -90,41 +90,44 @@
 							<view>{{it.deviceName || it.extInfo.deviceName}}</view>
 						</view>
 					</view>
-				
+
 					<view class="rx ww50">
 						<view class="lable lable150  rx-cc ">炉次号</view>
 						<view class="content ">
 							<view>{{it.extInfo.heatNumber }}</view>
 						</view>
 					</view>
-				
+
 				</view>
-				
-				
+
+
 				<view class="item rx-sc">
 					<view class="rx ww50 ">
 						<view class="lable lable150 rx-cc ">外观</view>
 						<view class="content content_num ">
-							<view v-if='isDetails'>{{ it.extInfo.appearance == 1 ? '合格' : it.extInfo.appearance == 2 ?  '不合格' : '' }}</view>
-							<zxz-uni-data-select v-else :localdata="qualityList" v-model="it.extInfo.appearance" dataValue='value'
-								format='{name}' dataKey="value" filterable  
+							<view v-if='isDetails'>
+								{{ it.extInfo.appearance == 1 ? '合格' : it.extInfo.appearance == 2 ?  '不合格' : '' }}
+							</view>
+							<zxz-uni-data-select v-else :localdata="qualityList" v-model="it.extInfo.appearance"
+								dataValue='value' format='{name}' dataKey="value" filterable
 								:clear='false'></zxz-uni-data-select>
-				
+
 						</view>
 					</view>
-				
+
 					<view class="rx ww50">
 						<view class="lable lable150 rx-cc ">尺寸</view>
 						<view class="content content_num">
-							<view v-if='isDetails'>{{ it.extInfo.dimension == 1 ? '合格' : it.extInfo.dimension == 2 ?  '不合格' : '' }}</view>
-							<zxz-uni-data-select v-else :localdata="qualityList" v-model="it.extInfo.dimension" dataValue='value'
-								format='{name}' dataKey="value" filterable  
+							<view v-if='isDetails'>
+								{{ it.extInfo.dimension == 1 ? '合格' : it.extInfo.dimension == 2 ?  '不合格' : '' }}</view>
+							<zxz-uni-data-select v-else :localdata="qualityList" v-model="it.extInfo.dimension"
+								dataValue='value' format='{name}' dataKey="value" filterable
 								:clear='false'></zxz-uni-data-select>
 						</view>
 					</view>
-				
+
 				</view>
-				
+
 
 
 
@@ -146,7 +149,7 @@
 				<view class="table">
 
 					<view class="tr row rx-sc">
-						<view class="item ww25">{{it.extInfo.weight  }}
+						<view class="item ww25">{{it.extInfo.weight }}
 						</view>
 						<view class="item ww25 content_num">
 							<view v-if='isDetails'>{{it.extInfo.newWeight }}</view>
@@ -165,7 +168,8 @@
 
 						<view class="item " v-else :class="[ isFirstTask == 1 ? 'ww25' : 'ww50' ]">
 							<zxz-uni-data-select :localdata="stepsList" v-model="it.extInfo.taskId" dataValue='taskId'
-								format='{taskTypeName}' dataKey="taskId" filterable   @change=" e => it.extInfo.taskName = e.taskTypeName" 
+								format='{taskTypeName}' dataKey="taskId" filterable
+								@change=" e => it.extInfo.taskName = e.taskTypeName"
 								:clear='false'></zxz-uni-data-select>
 
 						</view>
@@ -234,45 +238,52 @@
 
 
 							<view class="item ww20" v-if=" (idx == 0 || idx != paramList.length - 1)">
-								< {{it.CVIWeight}} </view>
-
-									<view class="item ww20" v-if=" paramList.length > 1 && idx == paramList.length - 1">
-										≥ {{it.CVIWeight }}
-									</view>
+								> {{it.CVIWeight}}
+							</view>
 
+							<view class="item ww20" v-if=" paramList.length > 1 && idx == paramList.length - 1">
+								≥ {{it.CVIWeight }}
 							</view>
 
 
+							<view class="item ww10 rx-cc" @click="getDelete(idx)">
+								<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20"
+									color="#fa3534"></uni-icons>
+							</view>
 
+						</view>
 
 
 
-						</view>
 
-						<view class="formula_box">计算公式: 物料重量/坯体密度*密度系数 </view>
 
 
-						<view class="rx-cc">
-							<u-button size="small" class="u-reset-button" style="width: 300rpx;margin: 20rpx;"
-								type="success" @click="paramSave">工序列表保存</u-button>
-						</view>
+					</view>
 
-						<view class="reportWeight rx-sc">
-							物料重量: {{weight}} ;
-							报工重量: {{reportWeight}}
+					<view class="formula_box">计算公式: 物料重量/坯体密度*密度系数 </view>
 
-						</view>
 
+					<view class="rx-cc">
+						<u-button size="small" class="u-reset-button" style="width: 300rpx;margin: 20rpx;"
+							type="success" @click="paramSave">工序列表保存</u-button>
+					</view>
 
+					<view class="reportWeight rx-sc">
+						物料重量: {{weight}} ;
+						报工重量: {{reportWeight}}
 
 					</view>
 
 
-					<view class="operate_box rx-sc">
-						<u-button size="small" class="u-reset-button" @click="cancel">取消</u-button>
-						<u-button size="small" class="u-reset-button" type="success" @click="save">确定</u-button>
-					</view>
+
+				</view>
+
+
+				<view class="operate_box rx-sc">
+					<u-button size="small" class="u-reset-button" @click="cancel">取消</u-button>
+					<u-button size="small" class="u-reset-button" type="success" @click="save">确定</u-button>
 				</view>
+			</view>
 
 
 		</u-popup>
@@ -343,9 +354,8 @@
 
 				resultObj: {},
 				resultIdx: 0,
-				
-				qualityList: [
-					{
+
+				qualityList: [{
 						name: '合格',
 						value: 1
 					},
@@ -382,10 +392,10 @@
 
 			getCompute() {
 				getComputeParam(this.item.workOrderId, this.item.currentTaskDiagram.taskId).then(res => {
-					
+
 					this.paramList = []
 					this.paramList = res && res.paramList
-					this.paramObj = res
+					this.paramObj = res || {}
 				})
 			},
 
@@ -455,7 +465,7 @@
 				}
 				let param = {}
 
-				if (!this.paramObj.hasOwnProperty('id')) {
+			if (!Object.prototype.hasOwnProperty.call(this.paramObj, 'id')) {
 
 					param = {
 						paramList: this.paramList,
@@ -523,7 +533,7 @@
 
 
 					if (Number(this.reportWeight) < this.paramList[0].CVIWeight) {
-						this.resultObj = this.paramList[0]
+						this.resultObj = this.stepsList[0]
 						this.setDataSave()
 						return false
 					}
@@ -535,10 +545,11 @@
 						return false
 					}
 
-					for (let i = 1; i < this.paramList.length; i++) {
-						if (Number(this.paramList[i - 1].CVIWeight) < Number(this.reportWeight) <= Number(this.paramList[i]
-								.CVIWeight)) {
-							this.resultObj = this.paramList[i]
+					let _arr = JSON.parse(JSON.stringify(this.paramList))
+					_arr = _arr.reverse()
+					for (let i = 1; i < _arr.length; i++) {
+						if (Number(this.reportWeight) > Number(_arr[i].CVIWeight)) {
+							this.resultObj = _arr[i]
 							break;
 						}
 					}
@@ -550,6 +561,7 @@
 
 				}
 
+
 			},
 
 			setDataSave() {

+ 34 - 28
pages/pda/jobBooking/components/semiProductJobBom.vue

@@ -216,45 +216,50 @@
 
 
 							<view class="item ww20" v-if=" (idx == 0 || idx != paramList.length - 1)">
-								< {{it.CVIWeight}} </view>
-
-									<view class="item ww20" v-if=" paramList.length > 1 && idx == paramList.length - 1">
-										≥ {{it.CVIWeight }}
-									</view>
+								> {{it.CVIWeight}}
+							</view>
 
+							<view class="item ww20" v-if=" paramList.length > 1 && idx == paramList.length - 1">
+								≥ {{it.CVIWeight }}
 							</view>
 
+	                  	<view class="item ww10 rx-cc" @click="getDelete(idx)">
+						<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20"	color="#fa3534"></uni-icons>
+						</view>
 
 
+						</view>
 
 
+			
 
-						</view>
 
-						<view class="formula_box">计算公式: 物料重量/坯体密度*密度系数 </view>
+					</view>
 
+					<view class="formula_box">计算公式: 物料重量/坯体密度*密度系数 </view>
 
-						<view class="rx-cc">
-							<u-button size="small" class="u-reset-button" style="width: 300rpx;margin: 20rpx;"
-								type="success" @click="paramSave">工序列表保存</u-button>
-						</view>
 
-						<view class="reportWeight rx-sc">
-							物料重量: {{weight}} ;
-							报工重量: {{reportWeight}}
+					<view class="rx-cc">
+						<u-button size="small" class="u-reset-button" style="width: 300rpx;margin: 20rpx;"
+							type="success" @click="paramSave">工序列表保存</u-button>
+					</view>
 
-						</view>
+					<view class="reportWeight rx-sc">
+						物料重量: {{weight}} ;
+						报工重量: {{reportWeight}}
 
+					</view>
 
 
-					</view>
 
+				</view>
 
-					<view class="operate_box rx-sc">
-						<u-button size="small" class="u-reset-button" @click="cancel">取消</u-button>
-						<u-button size="small" class="u-reset-button" type="success" @click="save">确定</u-button>
-					</view>
+
+				<view class="operate_box rx-sc">
+					<u-button size="small" class="u-reset-button" @click="cancel">取消</u-button>
+					<u-button size="small" class="u-reset-button" type="success" @click="save">确定</u-button>
 				</view>
+			</view>
 
 
 		</u-popup>
@@ -355,7 +360,7 @@
 				getComputeParam(this.item.workOrderId, this.item.currentTaskDiagram.taskId).then(res => {
 					this.paramList = []
 					this.paramList = res && res.paramList || []
-					this.paramObj = res
+					this.paramObj = res || {}
 				})
 			},
 
@@ -425,7 +430,8 @@
 				}
 				let param = {}
 
-				if (!this.paramObj.hasOwnProperty('id')) {
+
+				if (!Object.prototype.hasOwnProperty.call(this.paramObj, 'id')) {
 
 					param = {
 						paramList: this.paramList,
@@ -434,7 +440,6 @@
 					}
 
 				} else {
-
 					this.paramObj.paramList = this.paramList
 					param = this.paramObj
 				}
@@ -493,7 +498,7 @@
 
 
 					if (Number(this.reportWeight) < this.paramList[0].CVIWeight) {
-						this.resultObj = this.paramList[0]
+						this.resultObj = this.stepsList[0]
 						this.setDataSave()
 						return false
 					}
@@ -505,10 +510,11 @@
 						return false
 					}
 
-					for (let i = 1; i < this.paramList.length; i++) {
-						if (Number(this.paramList[i - 1].CVIWeight) < Number(this.reportWeight) <= Number(this.paramList[i]
-								.CVIWeight)) {
-							this.resultObj = this.paramList[i]
+					let _arr = JSON.parse(JSON.stringify(this.paramList))
+					_arr = _arr.reverse()
+					for (let i = 1; i < _arr.length; i++) {
+						if (Number(this.reportWeight) > Number(_arr[i].CVIWeight)) {
+							this.resultObj = _arr[i]
 							break;
 						}
 					}