给仓库模块增加负责人下拉框

This commit is contained in:
季圣华
2021-05-09 22:40:11 +08:00
parent 7b9f6ca52e
commit 9159f23362
2 changed files with 17 additions and 8 deletions

View File

@@ -16,9 +16,7 @@ const queryall = (params)=>getAction("/sys/role/queryall",params);
//用户管理
const addUser = (params)=>postAction("/user/addUser",params);
const editUser = (params)=>putAction("/user/updateUser",params);
const queryUserRole = (params)=>getAction("/sys/user/queryUserRole",params);
const getUserList = (params)=>getAction("/sys/user/list",params);
const frozenBatch = (params)=>putAction("/sys/user/frozenBatch",params);
const getUserList = (params)=>getAction("/user/getUserList",params);
//验证用户是否存在
const checkOnlyUser = (params)=>getAction("/sys/user/checkOnlyUser",params);
//改变密码
@@ -173,10 +171,8 @@ export {
findUserRole,
addUser,
editUser,
queryUserRole,
getUserList,
queryall,
frozenBatch,
checkOnlyUser,
changePassword,
getPermissionList,

View File

@@ -24,7 +24,11 @@
<a-input placeholder="请输入搬运费" v-decorator.trim="[ 'truckage' ]" suffix=""/>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="负责人">
<a-input placeholder="请输入负责人" v-decorator.trim="[ 'principalName' ]" />
<a-select placeholder="选择负责人" v-decorator="[ 'principal' ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in userList" :key="index" :value="item.id">
{{ item.userName }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="排序">
<a-input placeholder="请输入排序" v-decorator.trim="[ 'sort' ]" />
@@ -38,7 +42,7 @@
</template>
<script>
import pick from 'lodash.pick'
import {addDepot,editDepot,checkDepot } from '@/api/api'
import {addDepot,editDepot,checkDepot,getUserList } from '@/api/api'
export default {
name: "DepotModal",
data () {
@@ -46,6 +50,7 @@
title:"操作",
visible: false,
model: {},
userList: [],
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
@@ -67,6 +72,7 @@
}
},
created () {
this.initUser()
},
methods: {
add () {
@@ -78,7 +84,7 @@
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,
'name', 'address', 'warehousing', 'truckage', 'principalName', 'sort', 'remark'))
'name', 'address', 'warehousing', 'truckage', 'principal', 'sort', 'remark'))
});
},
close () {
@@ -130,6 +136,13 @@
callback(res.data);
}
});
},
initUser() {
getUserList({}).then((res)=>{
if(res) {
this.userList = res;
}
});
}
}
}