lz 3 vuotta sitten
vanhempi
sitoutus
16e1ceed1f

+ 10 - 7
src/components/userChoice/index.vue

@@ -19,6 +19,7 @@
 			</div> -->
 		</div>
 		<span slot="footer" class="dialog-footer">
+			<el-input v-model="userName" disabled size="small" style="width: 100px; margin-right: 10px" />
 			<el-button type="primary" size="small" @click="submit">确 定</el-button>
 		</span>
 	</el-dialog>
@@ -37,7 +38,8 @@ export default {
 			userId: null, // 人员id
 			depList: [], // 公司部门树
 			postList: [], // 级别职称树
-			personList: [] // 人员列表
+			personList: [], // 人员列表
+			userName: '' //展示人名
 		}
 	},
 	components: { Treeselect },
@@ -62,7 +64,7 @@ export default {
 		},
 		//获取级别数据
 		getLevelList() {
-			getLevelTreeSelect().then((res) => {
+			getLevelTreeSelect().then(res => {
 				if (res.code == 200) {
 					this.postList = res.data
 					this.postList.unshift({ id: '0', label: '全部级别' })
@@ -81,20 +83,21 @@ export default {
 		// 人员查询
 		selectPerson() {
 			this.personList = []
-			selectListByDeptId(this.deptId, this.postId).then((res) => {
-				console.log(res)
+			selectListByDeptId(this.deptId, this.postId).then(res => {
 				this.personList = res.data
 			})
 		},
 		// 选定人员
-		selectedPerson() {},
+		selectedPerson(e) {
+			this.userName = this.personList.find(item => item.userId === e).realName
+		},
 		// 确认提交
 		submit() {
 			if (this.userId) {
 				this.$emit('selectedPerson', this.userId)
 				this.open = false
 			} else {
-				this.$notify({title: '警告', message: '请选择人员', type: 'warning'})
+				this.$notify({ title: '警告', message: '请选择人员', type: 'warning' })
 			}
 		}
 	}
@@ -103,7 +106,7 @@ export default {
 <style scoped>
 .list_item {
 	height: 200px;
-	overflow-y: scroll;
+	overflow-y: auto;
 	display: flex;
 	flex-wrap: wrap;
 	padding: 0px 10px;

+ 6 - 6
src/views/index.vue

@@ -3,12 +3,12 @@
 </template>
 
 <script>
-	export default {
-		data() {
-			return {}
-		},
-		mounted() {}
-	}
+export default {
+	data() {
+		return {}
+	},
+	mounted() {}
+}
 </script>
 
 <style scoped lang="scss"></style>

+ 16 - 25
src/views/system/stockLocation/index.vue

@@ -8,16 +8,7 @@
 						<div class="tag">库位信息</div>
 					</div>
 					<div class="actions">
-						<el-button
-							type="primary"
-							icon="el-icon-plus"
-							size="mini"
-							v-hasPermi="['system:dataPermissions:addRole']"
-							style="margin-right: 10px"
-							@click="addStockShow"
-							v-if="hasDeptIds.length"
-							>添加</el-button
-						>
+						<el-button type="primary" icon="el-icon-plus" size="mini" v-hasPermi="['system:dataPermissions:addRole']" style="margin-right: 10px" @click="addStockShow" v-if="hasDeptIds.length">添加</el-button>
 						<right-toolbar @queryTable="getList" :isShowSearch="false"></right-toolbar>
 					</div>
 				</div>
@@ -29,8 +20,8 @@
 					<el-table-column label="描述" prop="remark" />
 					<el-table-column label="操作" class-name="small-padding fixed-width" width="300" align="center">
 						<template slot-scope="scope">
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="choiceUser(scope.row)" v-hasPermi="['	system:dataPermissions:updRole']">保管员</el-button>
-							<el-button size="mini" type="text" icon="el-icon-edit" @click="updStock(scope.row)" v-hasPermi="['	system:dataPermissions:updRole']">修改</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="choiceUser(scope.row)" v-hasPermi="['system:dataPermissions:updRole']">保管员</el-button>
+							<el-button size="mini" type="text" icon="el-icon-edit" @click="updStock(scope.row)" v-hasPermi="['system:dataPermissions:updRole']">修改</el-button>
 							<el-button size="mini" type="text" icon="el-icon-delete" @click="delStock(scope.row)" v-hasPermi="['system:dataPermissions:delRole']">删除</el-button>
 						</template>
 					</el-table-column>
@@ -53,7 +44,7 @@
 						<el-button type="primary" size="small" @click="stockSub">保 存</el-button>
 					</div>
 				</el-dialog>
-				<UserChoice ref="userChoice" @selectedPerson="selectedPerson"/>
+				<UserChoice ref="userChoice" @selectedPerson="selectedPerson" />
 			</div>
 		</div>
 	</div>
@@ -87,7 +78,7 @@ export default {
 			stockForm: { deptId: '', locationName: '', remark: '', deptName: '' },
 			//库位表单验证
 			stockRules: { locationName: [{ required: true, message: '名称不能为空', trigger: 'blur' }] },
-			locationId: '', // 库位id
+			locationId: '' // 库位id
 		}
 	},
 	methods: {
@@ -98,7 +89,7 @@ export default {
 				return
 			}
 			this.loading = true
-			stockList({ deptIds: this.hasDeptIds }).then((res) => {
+			stockList({ deptIds: this.hasDeptIds }).then(res => {
 				if (res.code === 200) {
 					this.dataList = res.data
 					this.loading = false
@@ -121,7 +112,7 @@ export default {
 		},
 		//检测重名
 		checkName(data) {
-			let o = this.dataList.find((item) => item.locationName == data.locationName && item.locationId != data.locationId)
+			let o = this.dataList.find(item => item.locationName == data.locationName && item.locationId != data.locationId)
 			if (o) {
 				return '库位名称重复'
 			}
@@ -134,7 +125,7 @@ export default {
 		},
 		//库位弹窗提交
 		stockSub() {
-			this.$refs.stockForm.validate((valid) => {
+			this.$refs.stockForm.validate(valid => {
 				if (valid) {
 					let checkFiled = this.checkName(this.stockForm)
 					if (checkFiled) {
@@ -142,10 +133,10 @@ export default {
 						return
 					}
 					if (this.stockForm.locationId) {
-						stockUpd(this.stockForm).then((res) => {
+						stockUpd(this.stockForm).then(res => {
 							if (res.code === 200) {
 								this.$msg({ message: '修改成功' })
-								this.dataList = this.dataList.map((item) => {
+								this.dataList = this.dataList.map(item => {
 									if (item.locationId == this.stockForm.locationId) {
 										return {
 											...item,
@@ -160,7 +151,7 @@ export default {
 							}
 						})
 					} else {
-						stockAdd(this.stockForm).then((res) => {
+						stockAdd(this.stockForm).then(res => {
 							if (res.code === 200) {
 								this.$msg({ message: '添加成功' })
 								this.getList()
@@ -174,15 +165,15 @@ export default {
 		//选择人员
 		choiceUser(row) {
 			this.locationId = row.locationId
-			treeselect().then((response) => {
+			treeselect().then(response => {
 				this.deptOptions = response.data
-				this.deptOptions.unshift({id: '0', label: '全部部门'})
+				this.deptOptions.unshift({ id: '0', label: '全部部门' })
 				this.$refs.userChoice.init(true, this.deptOptions)
 			})
 		},
 		//人员回调
 		selectedPerson(data) {
-			updateKeeper({keeper: data, locationId: this.locationId}).then(res => {
+			updateKeeper({ keeper: data, locationId: this.locationId }).then(res => {
 				this.getList()
 			})
 		},
@@ -203,10 +194,10 @@ export default {
 			this.$modal
 				.confirm('确定要删除吗')
 				.then(() => {
-					stockDel(row.locationId).then((res) => {
+					stockDel(row.locationId).then(res => {
 						if (res.code == 200) {
 							this.$msg({ message: '删除成功' })
-							this.dataList = this.dataList.filter((item) => item.locationId != row.locationId)
+							this.dataList = this.dataList.filter(item => item.locationId != row.locationId)
 						} else {
 							this.$msg({ type: 'error', message: res.msg })
 						}