ysy 1 год назад
Родитель
Сommit
05fd456e2e

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

@@ -372,7 +372,7 @@
 
 
 			handOutsource() {
-				console.log(this.newTaskObj)
+			
 
 				let param = {
 					taskId: this.newTaskObj.currentTaskId,

+ 167 - 38
pages/pda/components/outsourceList.vue

@@ -33,7 +33,16 @@
 				<u-list @scrolltolower="scrolltolower" class="z_list">
 
 					<view v-if="actTab == '物品清单'">
-						<checkbox-group v-for="(item, index) in pickOutInList" :key="index">
+						<view style="margin-left: 24rpx">
+							<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>
+						
+						<checkbox-group v-for="(item, index) in pickOutInList" :key="index"
+							@change="e => selectVal(e, item, index)">
 							<label class="listBox rx-bs">
 
 								<view class="listBox-sel">
@@ -93,6 +102,8 @@
 
 						</checkbox-group>
 
+				
+
 					</view>
 
 					<view v-if="actTab  == '带料清单'">
@@ -101,47 +112,88 @@
 							<view></view>
 							<view class="right_box rx-ec">
 								<u-button type="success" size="small" class="u-reset-button" @click="addPicking(2)"
-									text="添加物料"></u-button>
+									text="添加"></u-button>
 							</view>
 						</view>
+						<view v-for="(item, index) in bomMaterialList" :key="index">
+							<label class="listBox rx-bs">
+
+								<view class="listBox-sel">
+								</view>
+
+								<view class="listBox-con">
+
+
+									<view class="listBox-bottom rx">
+
+										<view class="items">
+											<text>名称</text>{{ item.name  }}
+										</view>
+
+
+										<view class="items">
+											<text>编码</text>{{ item.code  }}
+										</view>
+
+
+										<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 class="items" v-if="item.isDemandQuantity">
+											<text>数量</text>{{ item.demandQuantity  }}
+										</view>
+										<view class="items content_num" v-if="!item.isDemandQuantity">
+											<text>数量</text> <input style="8rpx !important"
+												v-model="item.demandQuantity"></input>
+										</view>
+
+
+
+									</view>
+
+								</view>
+
+
+							</label>
+
+						</view>
+
 
 					</view>
 
 					<view v-if="actTab  == '产出清单'">
 
-		             <view class="title_box rx-bc">
+						<view class="title_box rx-bc">
 							<view></view>
 							<view class="right_box rx-ec">
 								<u-button type="success" size="small" class="u-reset-button" @click="addPicking(3)"
-									text="添加产出"></u-button>
+									text="添加"></u-button>
 							</view>
 						</view>
-						
+
 						<view v-for="(item, index) in standardOutputList" :key="index">
 							<label class="listBox rx-bs">
 
-						
-						<view class="listBox-sel">
-				  
-						</view>
+								<view class="listBox-sel">
+								</view>
 
 								<view class="listBox-con">
-							
+
 
 									<view class="listBox-bottom rx">
-										
-										<view 
-											class="items">
+
+										<view class="items">
 											<text>名称</text>{{ item.name  }}
 										</view>
-										
-										
-										<view
-											class="items">
+
+
+										<view class="items">
 											<text>编码</text>{{ item.code  }}
 										</view>
-										
-										
+
+
 										<view v-for="(itm, index) in tableH(item.rootCategoryLevelId)" :key="index"
 											class="items" v-if="!itm.formatter">
 											<text>{{ itm.label }}</text>{{ item[itm.prop] }}
@@ -158,7 +210,7 @@
 							</label>
 
 						</view>
-						
+
 					</view>
 
 
@@ -169,7 +221,7 @@
 						取消
 					</u-button>
 					<u-button type="success" size="small" class="u-reset-button" @click="handOK">
-						确定
+						提交
 					</u-button>
 
 				</view>
@@ -204,7 +256,7 @@
 				outObj: {},
 
 				tabList: [{
-						name: '主体清单'
+						name: '物品清单'
 					},
 					{
 						name: '带料清单'
@@ -214,21 +266,32 @@
 					}
 				],
 
-				actTab: '主体清单',
+				actTab: '物品清单',
 
 				bomMaterialList: [],
 				pickOutInList: [],
 				materialList: [],
-				standardOutputList: []
+				standardOutputList: [],
+
+				isFirstTask: null,
+
+				clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo")
+					.clientEnvironmentId, // *1 主环境-601环境   2 soll-索尔环境    3 tg-碳谷环境
+
+
+				seletedAll: false, //全选状态
 			}
 		},
 
 		created() {
 			EventBus.$on('outEvent', this.handleEvent);
 		},
+
+
+
+
 		methods: {
 			open(obj) {
-				console.log(obj, 999)
 				this.outObj = obj
 
 				this.outsourceMaterialFn()
@@ -243,9 +306,20 @@
 
 				}
 				checkOutsourceMaterial(param).then(res => {
+					if (this.clientEnvironmentId == 3 && res.isFirstTask == 1) {
+						this.pickOutInList = [...res.pickOutInList, ...res.materialList]
+					} else {
+						this.pickOutInList = res.pickOutInList
+					}
+
+
+					this.bomMaterialList = res.bomMaterialList.map((m) => {
+						return {
+							...m,
+							isDemandQuantity: true
 
-					this.pickOutInList = res.pickOutInList
-					this.bomMaterialList = res.bomMaterialList
+						}
+					})
 					this.standardOutputList = res.standardOutputList
 					this.$forceUpdate()
 				})
@@ -256,30 +330,70 @@
 			},
 
 			close() {
+				EventBus.$off('outEvent');
 				this.show = false
 			},
 
-			handleEvent({ message }) {
-			     if(message.pid == 3) {
-					 this.standardOutputList = message.memoList
-				 }
+			handleEvent({
+				message
+			}) {
+				if (message.pid == 3) {
+					this.standardOutputList = message.memoList
+				} else {
+					if (message.pid == 2) {
+						this.bomMaterialList = message.memoList
+					}
+				}
+
 
 			},
 
 			tableH(type) {
 				return tableHeader(type)
 			},
-
+			//勾选
+			selectVal(e, val, index) {
+				this.pickOutInList[index].checked = !this.pickOutInList[index].checked
+			},
+			
+			_seletedAll() {
+			
+				if (!this.seletedAll) {
+					this.seletedAll = true
+			
+					this.pickOutInList.map(item => {
+						this.$set(item, 'checked', true)
+					
+					})
+			
+			
+			
+				} else {
+					this.seletedAll = false
+					this.pickOutInList.map(item => {
+						this.$set(item, 'checked', false)
+					})
+				}
+			},
+			
+			
 
 			scrolltolower() {},
 
 			addPicking(id) {
 				const storageKey = Date.now() + "";
-				let arr = [
-					{
-						standardOutputList: this.standardOutputList
-					}
-				]
+				let arr = null
+				if (id == 3) {
+					arr = [{
+						standardOutputList: this.standardOutputList,
+					}]
+
+				} else {
+					arr = [{
+						bomMaterialList: this.bomMaterialList,
+					}]
+				}
+
 				uni.setStorageSync(storageKey, arr);
 				uni.navigateTo({
 					url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=zdy&taskId=${this.outObj.taskId}&classIds=[1,23,9]`
@@ -384,7 +498,7 @@
 
 
 	.card_box {
-		width: 750rpx;
+		width: 92vw;
 		padding: 16rpx 32rpx;
 		box-sizing: border-box;
 		border-bottom: 2rpx solid #E1E1E1;
@@ -413,4 +527,19 @@
 			}
 		}
 	}
+
+
+	.content_num {
+		display: flex;
+		align-items: center;
+		padding: 0 4rpx;
+
+		/deep/ .uni-input-input {
+			border: 2rpx solid #F0F8F2;
+			background: #F0F8F2;
+			color: $theme-color;
+		}
+
+
+	}
 </style>

+ 7 - 2
pages/pda/workOrder/search/index.vue

@@ -304,7 +304,6 @@
 		},
 
 		onLoad(option) {
-			console.log(88,option)
 			this.pid = option.id
 			this.isType = option.isType
 			if (option.taskId == 'undefined') {
@@ -352,7 +351,11 @@
 						this.memoList = this.memoList.concat(_arr[0].equipmentList)
 					} else if (_arr.length != 0 && Object.prototype.hasOwnProperty.call(_arr[0], 'standardOutputList')) {
 						this.memoList = this.memoList.concat(_arr[0].standardOutputList)
-					}
+					} else if (_arr.length != 0 && Object.prototype.hasOwnProperty.call(_arr[0], 'bomMaterialList')) {
+						this.memoList = this.memoList.concat(_arr[0].bomMaterialList)
+					} 
+					
+					
 
 				}
 
@@ -608,6 +611,8 @@
 								memoList: this.memoList,
 								pid:this.pid
 							}
+							
+						
 							EventBus.$emit('outEvent', { message: param });
 						} else {
 							uni.$emit('setSelectList', this.memoList, this.pid)