Parcourir la source

去掉 搜索页面 物料 弹框

ysy il y a 2 ans
Parent
commit
a3c0f90d96

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

@@ -97,7 +97,7 @@
 								modelList = modelList.concat(f)
 
 							} else if (f.rootCategoryLevelId == 1) {
-								instanceList = instanceList.concat(...f.mattList)
+								instanceList = instanceList.concat(f)
 
 							}
 

+ 26 - 84
pages/pda/workOrder/search/index.vue

@@ -30,9 +30,9 @@
 					<label class="listBox rx-bs">
 
 						<view class="listBox-sel">
-							<checkbox :value="item.code"
-								:class="item.rootCategoryLevelId == 1 &&  !item.checked ? 'checkedClass': ''"
-								color="#fff" :disabled="item.disabled" :checked="item.checked" />
+						
+							<checkbox :value="item.code" color="#fff" :disabled="item.disabled"
+								:checked="item.checked" />
 						</view>
 
 						<view class="listBox-con">
@@ -90,9 +90,7 @@
 		<ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
 			:localdata="classificationList" valueKey="id" textKey="name" childrenKey="children" />
 
-		<matterPop v-if='matterShow' :matterId='matterId' :categoryId='categoryId' :mattList='mattList' @close='close'
-			@mattSave='mattSave'>
-		</matterPop>
+
 
 	</view>
 </template>
@@ -107,13 +105,13 @@
 		pageeLedgerMain,
 		assetPage
 	} from '@/api/pda/workOrder.js'
-	import matterPop from './matterPop.vue'
+
 
 	let [isEnd] = [false]
 	export default {
 		components: {
 			baTreePicker,
-			matterPop
+
 		},
 		data() {
 			return {
@@ -134,10 +132,7 @@
 				pid: null, // 上个页面id
 				storageKey: null,
 
-				matterShow: false, //物料 左弹框
-				matterId: null,
-				categoryId: null,
-				mattList: []
+
 			}
 		},
 
@@ -158,8 +153,8 @@
 
 				if (this.isType == 'feed') {
 					let _arr = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
-					this.memoList = [..._arr[0].modelList, ..._arr[0].equipmentList]
-					this.mattList = [..._arr[0].instanceList]
+					this.memoList = [..._arr[0].modelList, ..._arr[0].equipmentList, ..._arr[0].instanceList]
+
 
 
 				} else {
@@ -233,12 +228,14 @@
 
 			confirm(id, name) {
 				this.categoryLevelId = id
+				
+				this.list = []
 				this.getList()
 			},
 
 
 			doSearch() {
-				this.page = 1
+				this.list = []
 				this.getList()
 			},
 
@@ -257,7 +254,7 @@
 
 				}
 				isEnd = false
-				
+
 				if (this.isType == 'pick') {
 					param.dimension = 1
 					pageeLedgerMain(param).then(res => {
@@ -273,7 +270,7 @@
 									warehouseId,
 									...i,
 									instanceId: i.id,
-									categoryId: i.assetId,
+
 
 								}
 							})
@@ -292,9 +289,7 @@
 
 								const warehouseId = i.pathIds && i.pathIds.split(',')[0]
 
-								if (i.rootCategoryLevelId == 1) {
-									i.mattList = []
-								}
+
 
 								return {
 									checked,
@@ -316,73 +311,26 @@
 
 			//勾选
 			selectVal(e, val, index) {
-				if (this.isType == 'feed' && val.rootCategoryLevelId == 1) {
-					this.$set(this.list[index], 'checked', false)
-					if (val.mattList.length > 0) {
-						this.mattList = val.mattList
-					} else {
-						this.memoList.forEach(m => {
-							if (m.rootCategoryLevelId == 1) {
-								this.mattList = this.mattList.concat(m.mattList)
-							}
-						})
+				this.list[index].checked = !this.list[index].checked
+				this.seletedAll = !this.list.some(item => !item.checked)
+				const idx = this.memoList.findIndex(
+					item => item.id === this.list[index].id
+				)
+
+				if (this.list[index].checked) {
+					if (idx === -1) {
+						this.memoList.push(this.list[index])
 					}
-
-					this.categoryId = val.categoryId
-					this.matterId = val.id
-					this.matterShow = true
 				} else {
-					this.list[index].checked = !this.list[index].checked
-					this.seletedAll = !this.list.some(item => !item.checked)
-					const idx = this.memoList.findIndex(
-						item => item.id === this.list[index].id
-					)
-
-					if (this.list[index].checked) {
-						if (idx === -1) {
-							this.memoList.push(this.list[index])
-						}
-					} else {
-						if (idx > -1) {
-							this.memoList.splice(idx, 1)
-						}
+					if (idx > -1) {
+						this.memoList.splice(idx, 1)
 					}
 				}
 
-
-			},
-
-			close() {
-				this.matterShow = false
 			},
 
-			mattSave(maList, id) {
-				this.list.forEach(e => {
-					if (e.id == id) {
-						this.$set(e, 'checked', maList.length == 0 ? false : true)
-						e.mattList = maList
-						this.matterShow = false
-
-						const idx = this.memoList.findIndex(
-							item => item.id === id
-						)
-
-						this.list.forEach(e => {
-							if (e.id == id) {
-								if (e.checked && idx === -1) {
-									this.memoList.push(e)
-								} else if (!e.checked && idx > -1) {
-									this.memoList.splice(idx, 1)
-								}
-							}
-						})
-
-
 
-					}
-				})
 
-			},
 
 			//跳转回添加页面
 			jumpAdd() {
@@ -481,10 +429,4 @@
 		}
 	}
 
-	.checkedClass {
-		/deep/ .uni-checkbox-input-checked {
-			background-color: #fff !important;
-			border: 1px solid #d1d1d1 !important;
-		}
-	}
 </style>

+ 0 - 230
pages/pda/workOrder/search/matterPop.vue

@@ -1,230 +0,0 @@
-<template>
-	<view>
-		<u-popup :show="show" duration='300' :mode='mode' :closeOnClickOverlay='false'>
-			<view class="content-box">
-
-				<view class="list_box">
-
-					<u-list @scrolltolower="scrolltolower">
-
-						<checkbox-group v-for="(item, index) in list" :key="index"
-							@change="e => selectVal(e, item, index)">
-							<label class="listBox rx-bs">
-
-								<view class="listBox-sel">
-									<checkbox :value="item.code" color="#fff" :disabled="item.disabled"
-										:checked="item.checked" />
-								</view>
-
-								<view class="listBox-con">
-									<view class="listBox-top rx-bc">
-										<view> {{ item.name }}</view>
-										<view class="code">{{ item.code}}</view>
-									</view>
-
-									<view class="listBox-bottom rx">
-										<view v-for="(itm, index) in tableH(1)" :key="index" class="item100">
-											{{ itm.label }}:{{ item[itm.prop] }}
-										</view>
-
-
-									</view>
-
-								</view>
-
-
-							</label>
-
-						</checkbox-group>
-
-						<view style='margin-top: 20vh;' v-if='list.length == 0'>
-							<u-empty iconSize='150' textSize='32' text='暂无数据'>
-							</u-empty>
-						</view>
-
-
-					</u-list>
-				</view>
-
-				<view class="operate_box rx-sc">
-					<u-button size="small" class="u-reset-button" @click="handleClose">取消</u-button>
-					<u-button size="small" class="u-reset-button" type="success" @click="save">确认 </u-button>
-				</view>
-
-			</view>
-		</u-popup>
-	</view>
-</template>
-
-<script>
-	import {
-		tableHeader
-	} from '../../common.js'
-	import { getInventoryDetails } from '@/api/pda/feeding.js'
-	export default {
-		props: {
-			matterId: [String, Number],
-
-			categoryId: [String, Number],
-
-			mattList: {
-				type: Array,
-				default: () => {}
-			}
-		},
-		data() {
-			return {
-				show: true,
-				mode: 'right',
-				memoList: [],
-				list: []
-
-			}
-		},
-
-		created() {
-			this.getList()
-		},
-		methods: {
-			getList() {
-				let param = {
-					pageNum: 1,
-					size: -1,
-					categoryId: this.categoryId
-				}
-				getInventoryDetails(param).then(res => {
-							let list = []
-					
-							list.push(
-								...res.list.map(i => {
-									const checked =
-										this.mattList.findIndex(itm => itm.id == i.id) > -1
-									return {
-										checked,
-										...i
-									}
-								})
-							)
-					
-					
-					
-							this.list = list
-				})
-			},
-			scrolltolower() {},
-
-			save() {
-				let _arr = []
-				_arr = this.list.filter(f => f.checked)
-				this.$emit('mattSave', _arr, this.matterId)
-			},
-
-			//勾选
-			selectVal(e, val, index) {
-				this.list[index].checked = !this.list[index].checked
-
-
-
-				const idx = this.memoList.findIndex(
-					item => item.code === this.list[index].code
-				)
-
-				if (this.list[index].checked) {
-					if (idx === -1) {
-						this.memoList.push(this.list[index])
-
-					}
-				} else {
-					if (idx > -1) {
-						this.memoList.splice(idx, 1)
-					}
-				}
-
-			},
-
-			tableH(type) {
-				return tableHeader(type)
-			},
-			handleClose() {
-				this.$emit('close')
-			},
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	.content-box {
-		width: 80vw;
-		height: 100vh;
-		overflow: hidden;
-		display: flex;
-		flex-direction: column;
-		background-color: $page-bg;
-	}
-
-
-	.list_box {
-		flex: 1;
-		overflow: hidden;
-		padding: 4rpx 0;
-
-		.u-list {
-			height: 100% !important;
-		}
-
-
-
-
-	}
-
-
-	.listBox {
-		margin-top: 8rpx;
-		padding: 8rpx 24rpx;
-		background: #fff;
-
-
-		/deep/ .uni-checkbox-input-checked {
-			background-color: $theme-color !important;
-			border-color: $theme-color !important;
-		}
-
-		.listBox-con {
-			width: 650rpx;
-			font-weight: 400;
-		}
-
-		.listBox-top {
-			margin-top: 6rpx;
-			color: #090A0A;
-			font-size: 28rpx;
-			font-style: normal;
-		}
-
-		.listBox-bottom {
-			color: #090A0A;
-			font-size: 24rpx;
-			font-style: normal;
-			flex-wrap: wrap;
-
-			.item100 {
-				width: 100%;
-				margin-top: 8rpx;
-			}
-
-			.items {
-				width: 50%;
-				margin-top: 8rpx;
-			}
-		}
-	}
-
-	.operate_box {
-		background-color: #fff;
-		padding: 10rpx 100rpx;
-
-		/deep/ .u-button {
-			width: 160rpx;
-		}
-	}
-</style>