|
|
|
@ -4,11 +4,11 @@
|
|
|
|
|
<el-row :hidden="!search" style="padding:6px 18px"> |
|
|
|
|
<!-- 查询模块 --> |
|
|
|
|
<el-form :inline="true" :model="query"> |
|
|
|
|
<el-form-item label="仓库名称:"> |
|
|
|
|
<el-input v-model="query.warehouseName" placeholder="请输入仓库名称"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="班组名称:"> |
|
|
|
|
<el-input v-model="query.teamGroupName" placeholder="请输入班组名称"></el-input> |
|
|
|
|
<!-- <el-form-item label="仓库名称:">--> |
|
|
|
|
<!-- <el-input v-model="query.warehouseName" placeholder="请输入仓库名称"></el-input>--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<el-form-item label="人员名称:"> |
|
|
|
|
<el-input v-model="query.name" placeholder="请输入人员名称"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<!-- 查询按钮 --> |
|
|
|
@ -56,8 +56,8 @@
|
|
|
|
|
<!-- 操作栏模块 --> |
|
|
|
|
<el-table-column prop="menu" label="操作" :width="220" align="center"> |
|
|
|
|
<template #="{row}"> |
|
|
|
|
<el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button> |
|
|
|
|
<el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button> |
|
|
|
|
<!-- <el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>--> |
|
|
|
|
<!-- <el-button type="primary" text icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>--> |
|
|
|
|
<el-button type="primary" text icon="el-icon-delete" @click="rowDel(row)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
@ -85,8 +85,8 @@
|
|
|
|
|
:before-close="beforeClose" |
|
|
|
|
append-to-body> |
|
|
|
|
<el-form :disabled="view" ref="form" :rules="rules" :model="form" label-width="80px"> |
|
|
|
|
<el-form-item label="仓库" prop="warehouseId"> |
|
|
|
|
<!-- <el-input v-model="form.staffId" placeholder="请输入员工表ID"/>--> |
|
|
|
|
<!--<el-form-item label="仓库" prop="warehouseId"> |
|
|
|
|
<!– <el-input v-model="form.staffId" placeholder="请输入员工表ID"/>–> |
|
|
|
|
<el-select v-model="form.warehouseId" clearable placeholder="请选择仓库" @change="clickDept($event)" style="width: 80%"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in warehouseList" |
|
|
|
@ -96,10 +96,10 @@
|
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form-item>--> |
|
|
|
|
<!-- 表单字段 --> |
|
|
|
|
<el-form-item label="班组" prop="teamGroupId"> |
|
|
|
|
<!-- <el-input v-model="form.teamGroupId" placeholder="请输入班组ID"/>--> |
|
|
|
|
<!-- <el-form-item label="班组" prop="teamGroupId"> |
|
|
|
|
<!– <el-input v-model="form.teamGroupId" placeholder="请输入班组ID"/>–> |
|
|
|
|
<el-select v-model="form.teamGroupId" clearable placeholder="请选择班组" @change="clickTeamGroup($event,1)" style="width: 80%"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in teamGroupList" |
|
|
|
@ -109,10 +109,10 @@
|
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="人员" prop="staffId"> |
|
|
|
|
</el-form-item>--> |
|
|
|
|
<el-form-item label="人员" prop="staffIds"> |
|
|
|
|
<!-- <el-input v-model="form.staffId" placeholder="请输入姓名"/>--> |
|
|
|
|
<el-select v-model="form.staffId" clearable placeholder="请选择人员" @change="clickTeamGroup($event,2)" style="width: 80%"> |
|
|
|
|
<el-select v-model="form.staffIds" multiple clearable placeholder="请选择人员" style="width: 80%"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in staffList" |
|
|
|
|
:key="item.id" |
|
|
|
@ -136,6 +136,7 @@
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { getList, getDetail, add, update, remove } from "@/api/basicdata/basicdataTeamStaff"; |
|
|
|
|
import { getDetail as getDetailGroup } from "@/api/basicdata/basicdataTeamGroup"; |
|
|
|
|
import option from "@/option/basicdata/basicdataTeamStaff"; |
|
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
|
import { getListUser } from '@/api/distribution/distributionStockup'; |
|
|
|
@ -187,10 +188,23 @@ export default {
|
|
|
|
|
teamGroupId: [ |
|
|
|
|
{ required: true, message: '请选择班组', trigger: 'change' } |
|
|
|
|
], |
|
|
|
|
staffId: [ |
|
|
|
|
staffIds: [ |
|
|
|
|
{ required: true, message: '请选择人员', trigger: 'change' } |
|
|
|
|
], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
groupEntity:{} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
watch:{ |
|
|
|
|
'$route.query.id': { |
|
|
|
|
handler(newVal, oldVal) { |
|
|
|
|
console.log(newVal, oldVal); |
|
|
|
|
if(!!this.$route.query.id){ |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
deep: true, |
|
|
|
|
immediate: true |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
@ -210,7 +224,7 @@ export default {
|
|
|
|
|
methods: { |
|
|
|
|
//点击部门 |
|
|
|
|
async clickDept(row){ |
|
|
|
|
// console.log("进发了部门",row); |
|
|
|
|
console.log("进发了部门",row); |
|
|
|
|
if(this.form.warehouId != row){ |
|
|
|
|
let id = ""; |
|
|
|
|
if(!!this.form.id){ |
|
|
|
@ -270,6 +284,13 @@ export default {
|
|
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (!this.form.id) { |
|
|
|
|
|
|
|
|
|
this.form.department = this.groupEntity.department ; |
|
|
|
|
this.form.departmentName = this.groupEntity.departmentName; |
|
|
|
|
this.form.teamGroupId = this.$route.query.id; |
|
|
|
|
this.form.teamGroupName = this.groupEntity.groupName; |
|
|
|
|
this.form.warehouseId = this.groupEntity.belongTo; |
|
|
|
|
this.form.warehouseName = this.groupEntity.warehouseName; |
|
|
|
|
console.log("添加",this.form); |
|
|
|
|
add(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
@ -302,24 +323,34 @@ export default {
|
|
|
|
|
this.getWarehouseList(); |
|
|
|
|
}, |
|
|
|
|
async getWarehouseList(){ |
|
|
|
|
let userDept = await getListUser(); |
|
|
|
|
this.deptId = userDept.data.data.deptId; |
|
|
|
|
let sole = await getUserDetail(userDept.data.data.userId); |
|
|
|
|
// console.log("名称11",sole.data.data.roleName); |
|
|
|
|
if(sole.data.data.roleName == '管理员'){ |
|
|
|
|
let deptW = await getDeptWarehouse({tenantId: userDept.data.data.tenantId }); |
|
|
|
|
// console.log("全部仓库",deptW); |
|
|
|
|
this.warehouseList = deptW.data.data; |
|
|
|
|
}else{ |
|
|
|
|
//有部门 |
|
|
|
|
let dept = await getDept(this.deptId); |
|
|
|
|
const da = dept.data.data; |
|
|
|
|
if(!!da.parentId && da.parentId != '0'){ |
|
|
|
|
//有部门的信息 查询仓库 |
|
|
|
|
let deptW = await getDeptWarehouse({department: da.id}); |
|
|
|
|
this.warehouseList = deptW.data.data; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let group = await getDetailGroup(this.$route.query.id); |
|
|
|
|
console.log("_+_+_+_+_+",group.data.data.department); |
|
|
|
|
this.groupEntity = group.data.data; |
|
|
|
|
//查询人员 |
|
|
|
|
this.staffList = []; |
|
|
|
|
let user = await getListOwn({deptId:this.groupEntity.department}); |
|
|
|
|
// console.log("查询人员》》》",user); |
|
|
|
|
this.staffList = user.data.data; |
|
|
|
|
|
|
|
|
|
// let userDept = await getListUser(); |
|
|
|
|
// this.deptId = userDept.data.data.deptId; |
|
|
|
|
// let sole = await getUserDetail(userDept.data.data.userId); |
|
|
|
|
// // console.log("名称11",sole.data.data.roleName); |
|
|
|
|
// if(sole.data.data.roleName == '管理员'){ |
|
|
|
|
// let deptW = await getDeptWarehouse({tenantId: userDept.data.data.tenantId }); |
|
|
|
|
// // console.log("全部仓库",deptW); |
|
|
|
|
// this.warehouseList = deptW.data.data; |
|
|
|
|
// }else{ |
|
|
|
|
// //有部门 |
|
|
|
|
// let dept = await getDept(this.deptId); |
|
|
|
|
// const da = dept.data.data; |
|
|
|
|
// if(!!da.parentId && da.parentId != '0'){ |
|
|
|
|
// //有部门的信息 查询仓库 |
|
|
|
|
// let deptW = await getDeptWarehouse({department: da.id}); |
|
|
|
|
// this.warehouseList = deptW.data.data; |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
async handleEdit (row) { |
|
|
|
|
await this.getWarehouseList(); |
|
|
|
@ -400,7 +431,7 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
selectionClear () { |
|
|
|
|
this.selectionList = []; |
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
// this.$refs.table.clearSelection(); |
|
|
|
|
}, |
|
|
|
|
currentChange (currentPage) { |
|
|
|
|
this.page.currentPage = currentPage; |
|
|
|
@ -412,6 +443,7 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
onLoad (page, params = {}) { |
|
|
|
|
this.loading = true; |
|
|
|
|
this.query.teamGroupId = this.$route.query.id; |
|
|
|
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
|
|
|
|
const data = res.data.data; |
|
|
|
|
this.page.total = data.total; |
|
|
|
|