|
|
|
@ -4,9 +4,9 @@
|
|
|
|
|
<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.warehouseName" placeholder="请输入仓库名称"></el-input>--> |
|
|
|
|
<!-- </el-form-item>--> |
|
|
|
|
<el-form-item label="人员名称:"> |
|
|
|
|
<el-input v-model="query.name" placeholder="请输入人员名称"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
@ -79,7 +79,7 @@
|
|
|
|
|
append-to-body |
|
|
|
|
> |
|
|
|
|
<el-form :disabled="view" ref="form" :rules="rules" :model="form" label-width="80px"> |
|
|
|
|
<!--<el-form-item label="仓库" prop="warehouseId"> |
|
|
|
|
<!--<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 |
|
|
|
@ -92,7 +92,7 @@
|
|
|
|
|
|
|
|
|
|
</el-form-item>--> |
|
|
|
|
<!-- 表单字段 --> |
|
|
|
|
<!-- <el-form-item label="班组" prop="teamGroupId"> |
|
|
|
|
<!-- <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 |
|
|
|
@ -105,14 +105,8 @@
|
|
|
|
|
|
|
|
|
|
</el-form-item>--> |
|
|
|
|
<el-form-item label="人员" prop="staffIds"> |
|
|
|
|
<!-- <el-input v-model="form.staffId" placeholder="请输入姓名"/>--> |
|
|
|
|
<el-select |
|
|
|
|
v-model="form.staffIds" |
|
|
|
|
multiple |
|
|
|
|
clearable |
|
|
|
|
placeholder="请选择人员" |
|
|
|
|
style="width: 80%" |
|
|
|
|
> |
|
|
|
|
<!-- <el-input v-model="form.staffId" placeholder="请输入姓名"/>--> |
|
|
|
|
<el-select v-model="form.staffIds" multiple clearable placeholder="请选择人员" style="width: 80%"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in staffList" |
|
|
|
|
:key="item.id" |
|
|
|
@ -144,10 +138,10 @@
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<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 { 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'; |
|
|
|
|
import { getUserDetail } from '@/api/system/user'; |
|
|
|
|
import { getDept, getLazyList } from '@/api/system/dept'; |
|
|
|
@ -256,12 +250,30 @@ export default {
|
|
|
|
|
deptId: '', |
|
|
|
|
warehouId: '', |
|
|
|
|
rules: { |
|
|
|
|
warehouseId: [{ required: true, message: '请选择仓库', trigger: 'change' }], |
|
|
|
|
teamGroupId: [{ required: true, message: '请选择班组', trigger: 'change' }], |
|
|
|
|
staffIds: [{ required: true, message: '请选择人员', trigger: 'change' }], |
|
|
|
|
warehouseId: [ |
|
|
|
|
{ required: true, message: '请选择仓库', trigger: 'change' } |
|
|
|
|
], |
|
|
|
|
teamGroupId: [ |
|
|
|
|
{ required: true, message: '请选择班组', trigger: 'change' } |
|
|
|
|
], |
|
|
|
|
staffIds: [ |
|
|
|
|
{ required: true, message: '请选择人员', trigger: 'change' } |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
groupEntity: {}, |
|
|
|
|
}; |
|
|
|
|
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 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
'$route.query.id': { |
|
|
|
@ -386,11 +398,11 @@ export default {
|
|
|
|
|
this.selectionList = value; |
|
|
|
|
}, |
|
|
|
|
//点击部门 |
|
|
|
|
async clickDept(row) { |
|
|
|
|
console.log('进发了部门', row); |
|
|
|
|
if (this.form.warehouId != row) { |
|
|
|
|
let id = ''; |
|
|
|
|
if (!!this.form.id) { |
|
|
|
|
async clickDept(row){ |
|
|
|
|
console.log("进发了部门",row); |
|
|
|
|
if(this.form.warehouId != row){ |
|
|
|
|
let id = ""; |
|
|
|
|
if(!!this.form.id){ |
|
|
|
|
id = this.form.id; |
|
|
|
|
} |
|
|
|
|
this.form = {}; |
|
|
|
@ -449,13 +461,14 @@ export default {
|
|
|
|
|
this.$refs[formName].validate(valid => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (!this.form.id) { |
|
|
|
|
this.form.department = this.groupEntity.department; |
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
console.log("添加",this.form); |
|
|
|
|
add(this.form).then(() => { |
|
|
|
|
this.box = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
@ -484,13 +497,14 @@ export default {
|
|
|
|
|
this.box = true; |
|
|
|
|
this.getWarehouseList(); |
|
|
|
|
}, |
|
|
|
|
async getWarehouseList() { |
|
|
|
|
let group = await getDetailGroup(this.$route.query.id); |
|
|
|
|
console.log('_+_+_+_+_+', group.data.data.department); |
|
|
|
|
async getWarehouseList(){ |
|
|
|
|
|
|
|
|
|
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 }); |
|
|
|
|
let user = await getListOwn({deptId:this.groupEntity.department}); |
|
|
|
|
// console.log("查询人员》》》",user); |
|
|
|
|
this.staffList = user.data.data; |
|
|
|
|
|
|
|
|
|