完善系统管理及采购订单管理
This commit is contained in:
@@ -1,13 +1,67 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
let tokens = window.sessionStorage.getItem('token');
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
// 查询分页列表
|
// 查询分页列表
|
||||||
listPage: function(params) {
|
listPage: function(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/wms/apiadmin/warehouserack/listPage',
|
url: '/oms/apiadmin/pmspurchasebill/listPage',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取添加商品列表
|
||||||
|
chooseproducts: function(params) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/apiadmin/pmspurchasebill/purGoodsListPage',
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 新增采购订单
|
||||||
|
save: function(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/apiadmin/pmspurchasebill/save',
|
||||||
|
method: 'POST',
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 详情
|
||||||
|
fetchDetailsBySid: function(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/apiadmin/pmspurchasebill/fetchDetailsBySid/' + data,
|
||||||
|
method: 'get',
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 采购订单- 删除
|
||||||
|
deleteBySids: function(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/apiadmin/pmspurchasebill/delBySids',
|
||||||
|
method: 'DELETE',
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export function pageList(data) {
|
|||||||
// 查询左侧部门列表
|
// 查询左侧部门列表
|
||||||
export function orgList(data) {
|
export function orgList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysorganization/list',
|
url: '/oms/apiadmin/sysorganization/list/' + data,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {
|
headers: {
|
||||||
@@ -67,7 +67,7 @@ export function addOrgTree(data) {
|
|||||||
// 回显
|
// 回显
|
||||||
export function selectBySid(data) {
|
export function selectBySid(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'portal/v1/sysorganization/fetchBySid/' + data,
|
url: '/oms/apiadmin/sysorganization/fetchBySid/' + data,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -3,23 +3,26 @@ import qs from 'qs'
|
|||||||
//let tokens = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTm8iOiI2IiwiaXNzIjoiV0JLIiwiZXhwIjoxNjI5OTQxNjI1fQ.aOFOz0h7c8YQs-ti2GLpqeWu4AE9mifx_043hLJQf8g'
|
//let tokens = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTm8iOiI2IiwiaXNzIjoiV0JLIiwiZXhwIjoxNjI5OTQxNjI1fQ.aOFOz0h7c8YQs-ti2GLpqeWu4AE9mifx_043hLJQf8g'
|
||||||
let tokens = window.sessionStorage.getItem('token');
|
let tokens = window.sessionStorage.getItem('token');
|
||||||
// 业务角色 列表
|
// 业务角色 列表
|
||||||
export function roleOrgList(data){
|
export function roleOrgList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysrole/listPage',
|
url: '/oms/apiadmin/sysrole/listPage',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function postList(data){
|
export function postList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/syspost/list',
|
url: '/oms/apiadmin/syspost/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json'}
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,8 +58,9 @@ export function saveOrgroles(data) {
|
|||||||
url: '/oms/apiadmin/sysrole/save',
|
url: '/oms/apiadmin/sysrole/save',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -72,8 +76,9 @@ export function putOrgroles(data) {
|
|||||||
url: `/oms/apiadmin/sysrole/update/${data.sid}`,
|
url: `/oms/apiadmin/sysrole/update/${data.sid}`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -87,8 +92,9 @@ export function delOrgroles(data) {
|
|||||||
url: `/oms/apiadmin/sysrole/delBySids/${data.sid}`,
|
url: `/oms/apiadmin/sysrole/delBySids/${data.sid}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -97,7 +103,9 @@ export function getRoleMenuList(data) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysmobilemenurole/getRoleMenuList',
|
url: '/oms/apiadmin/sysmobilemenurole/getRoleMenuList',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params: { roleSid: data }
|
params: {
|
||||||
|
roleSid: data
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,8 +115,9 @@ export function saveRoleMenuList(data) {
|
|||||||
url: `/oms/apiadmin/sysmobilemenurole/saveRoleMenuList`,
|
url: `/oms/apiadmin/sysmobilemenurole/saveRoleMenuList`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -119,8 +128,9 @@ export function roleMenuTree(data) {
|
|||||||
url: `/oms/apiadmin/sysmenu/listAllByRoleSid`,
|
url: `/oms/apiadmin/sysmenu/listAllByRoleSid`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -128,11 +138,12 @@ export function roleMenuTree(data) {
|
|||||||
// 菜单授权保存
|
// 菜单授权保存
|
||||||
export function saveorgrolemenus(data) {
|
export function saveorgrolemenus(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/oms/apiadmin/sysrikeauthorize/updateRoleAndMenu`,
|
url: `/oms/apiadmin/sysroleauthorize/updateRoleAndMenu`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -142,8 +153,9 @@ export function sourceMenuTree(data) {
|
|||||||
url: `/oms/apiadmin/syssource/listAllByRoleSid`,
|
url: `/oms/apiadmin/syssource/listAllByRoleSid`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -153,8 +165,9 @@ export function saveSource(data) {
|
|||||||
url: `/oms/apiadmin/syssourcerole/updateRoleAndSource`,
|
url: `/oms/apiadmin/syssourcerole/updateRoleAndSource`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -171,8 +184,9 @@ export function savefunMenu(data) {
|
|||||||
url: `/oms/apiadmin/sysrolefunction/updateRoleAndFunction`,
|
url: `/oms/apiadmin/sysrolefunction/updateRoleAndFunction`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -183,7 +197,10 @@ export function selMenuByRole(data) {
|
|||||||
url: `/oms/apiadmin/sysmenurole/selMenuByRole`,
|
url: `/oms/apiadmin/sysmenurole/selMenuByRole`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
headers: { 'Content-Type': 'application/json', 'token': tokens }
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,6 +210,9 @@ export function updateDataByRoleMenu(data) {
|
|||||||
url: `/oms/apiadmin/sysmenurole/updateDataByRoleMenu`,
|
url: `/oms/apiadmin/sysmenurole/updateDataByRoleMenu`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
headers: { 'Content-Type': 'application/json', 'token': tokens }
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,136 +3,162 @@ import qs from 'qs'
|
|||||||
// 用户列表
|
// 用户列表
|
||||||
//let tokens = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTm8iOiI2IiwiaXNzIjoiV0JLIiwiZXhwIjoxNjI5OTQxNjI1fQ.aOFOz0h7c8YQs-ti2GLpqeWu4AE9mifx_043hLJQf8g'
|
//let tokens = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTm8iOiI2IiwiaXNzIjoiV0JLIiwiZXhwIjoxNjI5OTQxNjI1fQ.aOFOz0h7c8YQs-ti2GLpqeWu4AE9mifx_043hLJQf8g'
|
||||||
let tokens = window.sessionStorage.getItem('token');
|
let tokens = window.sessionStorage.getItem('token');
|
||||||
export function userList(data){
|
export function userList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysuser/listPage',
|
url: '/oms/apiadmin/sysuser/listPage',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 新增
|
// 新增
|
||||||
export function userAdd(data){
|
export function userAdd(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysuser/save',
|
url: '/oms/apiadmin/sysstaffinfo/save',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 更新
|
|
||||||
export function userUpdata(data){
|
// 初始化 用户
|
||||||
|
export function initUserInfo(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysuser/update/' +data.sid,
|
url: '/wms/apiadmin/sysstaffinfo/fetchBySid/' + data.sid,
|
||||||
|
method: 'get',
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新
|
||||||
|
export function userUpdata(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/apiadmin/sysstaffinfo/update/' + data.sid,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
export function delUser(data){
|
export function delUser(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysuser/delBySid/' +data.sid,
|
url: '/oms/apiadmin/sysuser/delBySid/' + data.sid,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 初始化密码
|
// 初始化密码
|
||||||
export function initPwd(data){
|
export function initPwd(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysuser/initPwd/' +data.sid,
|
url: '/oms/apiadmin/sysuser/initPwd/' + data.sid,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 根据sid查询一条信息
|
// 根据sid查询一条信息
|
||||||
export function userSingle(data){
|
export function userSingle(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysuser/fetchBySid/' +data.sid,
|
url: '/oms/apiadmin/sysuser/fetchBySid/' + data.sid,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 单条用户的角色列表
|
// 单条用户的角色列表
|
||||||
export function setRole(data){
|
export function setRole(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysrole/listAllByUserSid/' +data.sid,
|
url: '/oms/apiadmin/sysrole/listAllByUserSid/' + data.sid,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 角色列表
|
// 角色列表
|
||||||
export function saveOrgRole(data){
|
export function saveOrgRole(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysuserrole/update',
|
url: '/oms/apiadmin/sysuserrole/update',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 查询角色列表
|
// 查询角色列表
|
||||||
export function roleList(data){
|
export function roleList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysrole/listAll',
|
url: '/oms/apiadmin/sysrole/listAll',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 查询部门列表
|
// 查询部门列表
|
||||||
export function orgList(data){
|
export function orgList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysorganization/list',
|
url: '/oms/apiadmin/sysorganization/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 查询岗位列表
|
// 查询岗位列表
|
||||||
export function postList(data){
|
export function postList(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/syspost/fetchByOrgSid/'+data.sid,
|
url: '/oms/apiadmin/syspost/fetchByOrgSid/' + data.sid,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
export function getCode(data){
|
export function getCode(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/apiadmin/sysuser/sendMessageCode/'+data.phone,
|
url: '/oms/apiadmin/sysuser/sendMessageCode/' + data.phone,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
data: data,
|
data: data,
|
||||||
headers: {'Content-Type': 'application/json',
|
headers: {
|
||||||
'token':tokens
|
'Content-Type': 'application/json',
|
||||||
|
'token': tokens
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,11 +42,12 @@
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
window.sessionStorage.clear()
|
window.sessionStorage.clear()
|
||||||
this.$router.push({
|
|
||||||
path: '/login'
|
this.$router.push({
|
||||||
})
|
path: '/login'
|
||||||
location.reload()
|
})
|
||||||
|
location.reload()
|
||||||
// this.$store.commit('user/SET_UESRINFO', '')
|
// this.$store.commit('user/SET_UESRINFO', '')
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
params: {
|
params: {
|
||||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44', // oms 资源sid
|
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44', // oms 资源sid
|
||||||
orgSid: window.sessionStorage.getItem('orgSid'),
|
orgSid: window.sessionStorage.getItem('orgSid'),
|
||||||
userSid: window.sessionStorage.getItem('sid')
|
userSid: window.sessionStorage.getItem('userSid')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,29 +9,52 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
<div v-show="isSearchShow" class="search">
|
<div v-show="isSearchShow" class="search">
|
||||||
<el-form :inline="true" class="tab-header">
|
<el-form :inline="true" class="tab-header">
|
||||||
<el-form-item label="制单人">
|
<el-form-item label="单据编号">
|
||||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="单据日期">
|
<el-form-item label="单据日期">
|
||||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
<el-date-picker v-model="queryParams.params.createStartTime" type="date" placeholder="选择日期"
|
||||||
|
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||||
|
</el-date-picker>至
|
||||||
|
<el-date-picker v-model="queryParams.params.createEndTime" type="date" placeholder="选择日期"
|
||||||
|
format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;">
|
||||||
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="单据编号">
|
<el-form-item label="制单人">
|
||||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
<el-input v-model="queryParams.params.createByName" placeholder="" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="供应商">
|
<el-form-item label="采购员">
|
||||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
<el-input v-model="queryParams.params.purchaserName" placeholder="" clearable />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="收货仓库">
|
|
||||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="业务员">
|
|
||||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="单据状态">
|
|
||||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="物流单号">
|
<el-form-item label="物流单号">
|
||||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
<el-input v-model="queryParams.params.logisticsNum" placeholder="" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="供应商">
|
||||||
|
<el-select v-model="queryParams.params.supplierName" clearable placeholder="请选择供应商"
|
||||||
|
style="width: 220px;">
|
||||||
|
<el-option v-for="item in supplierList" :key="item.sid" :label="item.supplierName" :value="item.sid">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="收货仓库">
|
||||||
|
<el-select v-model="queryParams.params.warehouseName" placeholder="请选择仓库" style="width: 220px;">
|
||||||
|
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName"
|
||||||
|
:value="item.sid" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="收货状态">
|
||||||
|
<el-select v-model="queryParams.params.receiveStateKey" placeholder="请选择" style="width: 220px;">
|
||||||
|
<el-option v-for="(item,i) in receiveStateList" :key="i" :label="item.dictValue"
|
||||||
|
:value="item.dictKey">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="发货状态">
|
||||||
|
<el-select v-model="queryParams.params.deliveryStateKey" placeholder="请选择" style="width: 220px;">
|
||||||
|
<el-option v-for="(item,i) in deliveryStateList" :key="i" :label="item.dictValue"
|
||||||
|
:value="item.dictKey">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -44,30 +67,36 @@
|
|||||||
<!-- Start 项目列表头部 -->
|
<!-- Start 项目列表头部 -->
|
||||||
<div class="listtop">
|
<div class="listtop">
|
||||||
<div class="tit">采购订单列表</div>
|
<div class="tit">采购订单列表</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- End 项目列表头部 -->
|
<!-- End 项目列表头部 -->
|
||||||
<!-- Start 项目列表 -->
|
<!-- Start 项目列表 -->
|
||||||
<div class="">
|
<div class="">
|
||||||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
|
||||||
@selection-change="selectionLineChangeHandle">
|
@selection-change="selectionLineChangeHandle" @row-click="rowItemClick" :row-style="isRed">
|
||||||
<el-table-column fixed width="50" type="selection" align="center" />
|
<el-table-column fixed width="50" type="selection" align="center" />
|
||||||
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
<el-table-column label="操作" align="center" width="100">
|
<el-table-column fixed label="操作" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">查看</el-button>
|
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">查看</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="brandName" label="单据日期" align="center" />
|
<el-table-column prop="createTime" label="单据日期" width="120" align="center" />
|
||||||
<el-table-column prop="brandCode" label="单据编号" align="center" />
|
<el-table-column prop="billNo" label="单据编号" align="center" />
|
||||||
<el-table-column prop="letter" label="供应商" align="center" />
|
<el-table-column prop="supplierName" label="供应商" align="center" />
|
||||||
<el-table-column prop="remarks" label="收货仓库" align="center" />
|
<el-table-column prop="purchaserName" label="业务员" align="center" />
|
||||||
<el-table-column prop="remarks" label="物流单号" align="center" />
|
<el-table-column prop="wareHouseName" label="收货仓库" align="center" />
|
||||||
<el-table-column prop="remarks" label="业务员" align="center" />
|
<el-table-column prop="amountTotal" label="商品总额" align="center" />
|
||||||
<el-table-column prop="remarks" label="制单人" align="center" />
|
<el-table-column prop="freight" label="采购运费" align="center" />
|
||||||
<el-table-column prop="remarks" label="采购运费" align="center" />
|
<el-table-column prop="otherAmount" label="其他费用" align="center" />
|
||||||
<el-table-column prop="remarks" label="其他费用" align="center" />
|
<el-table-column prop="prepayment" label="预付金额" align="center" />
|
||||||
<el-table-column prop="remarks" label="商品总额" align="center" />
|
<el-table-column prop="logisticsNum" label="物流单号" align="center" />
|
||||||
<el-table-column prop="remarks" label="总采购数量" align="center" />
|
<el-table-column prop="productProgress" label="生产进度" align="center" />
|
||||||
|
<el-table-column prop="countTotal" label="总采购数量" width="120" align="center" />
|
||||||
|
<el-table-column prop="receiveStateValue" label="收货状态" align="center" />
|
||||||
|
<el-table-column prop="deliveryStateValue" label="发货状态" align="center" />
|
||||||
|
<el-table-column prop="createByName" label="制单人" align="center" />
|
||||||
|
<el-table-column prop="remarks" label="备注" align="center" />
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<!-- End 项目列表 -->
|
<!-- End 项目列表 -->
|
||||||
@@ -77,12 +106,90 @@
|
|||||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-menu :default-active="activeIndex" class="el-menu-demo" style="margin-top: -10px;" mode="horizontal"
|
||||||
|
@select="handleSelect">
|
||||||
|
<el-menu-item index="1">采购明细</el-menu-item>
|
||||||
|
<el-menu-item index="2">费用/预付款</el-menu-item>
|
||||||
|
<el-menu-item index="3">附件</el-menu-item>
|
||||||
|
</el-menu>
|
||||||
|
|
||||||
|
<div v-show="activeIndex=='1'" style="margin-bottom: 50px;">
|
||||||
|
<el-table :data="formobj.purchaseBillDetailList" border style="width: 100%">
|
||||||
|
<el-table-column width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
|
<el-table-column prop="goodsSpuName" label="商品名称" align="center" />
|
||||||
|
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||||
|
<el-table-column prop="goodsSkuOwnSpec" label="规格型号" align="center" />
|
||||||
|
<el-table-column prop="unit" label="单位" align="center" />
|
||||||
|
<el-table-column prop="count" label="采购数量" align="center" />
|
||||||
|
<el-table-column prop="cost" label="单价" align="center" />
|
||||||
|
<el-table-column prop="discountRate" label="折扣率(%)" align="center" />
|
||||||
|
<el-table-column prop="discountPrice" label="折扣单价" align="center" />
|
||||||
|
<el-table-column prop="shareAmount" label="分摊金额" align="center" />
|
||||||
|
<el-table-column prop="amount" label="总价" align="center" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-show="activeIndex=='2'" style="margin-bottom: 50px;">
|
||||||
|
|
||||||
|
<el-form ref="dataForm" class="formaddcopy02" :model="formobj.purchaseBillAmount">
|
||||||
|
<el-row class="first_row">
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">采购运费</div>
|
||||||
|
<el-form-item> <span class="addinputInfo">{{ formobj.purchaseBillAmount.freight }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">分摊方式</div>
|
||||||
|
<el-form-item> <span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.freightShareTypeValue }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">结算账户</div>
|
||||||
|
<el-form-item> <span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.settleAccount }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">其他费用</div>
|
||||||
|
<el-form-item> <span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.otherAmountName }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">分摊方式</div>
|
||||||
|
<el-form-item> <span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.otherShareTypeValue }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">预付金额</div>
|
||||||
|
<el-form-item> <span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.prepayment }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-show="activeIndex=='3'" style="margin-bottom: 50px;">
|
||||||
|
|
||||||
|
<span v-for="(item,index) in formobj.purchaseAppendixList" :key="index" class="addinputInfo"
|
||||||
|
style="margin-top: 10px;">
|
||||||
|
<el-popover placement="left" trigger="click" width="300">
|
||||||
|
<img :src="item.url" width="100%" />
|
||||||
|
<img slot="reference" :src="item.url" :alt="item.url"
|
||||||
|
style="max-height: 70px;max-width: 70px; padding: 5px" />
|
||||||
|
</el-popover>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- End 查询和其列表部分 -->
|
<!-- End 查询和其列表部分 -->
|
||||||
<!-- 新增修改部分组件 -->
|
<!-- 新增修改部分组件 -->
|
||||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||||
<divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList" />
|
<divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -93,6 +200,12 @@
|
|||||||
import pageye from '@/components/pagination/pageye'
|
import pageye from '@/components/pagination/pageye'
|
||||||
import divAdd from './purchaseOrderAdd.vue'
|
import divAdd from './purchaseOrderAdd.vue'
|
||||||
import divInfo from './purchaseOrderInfo.vue'
|
import divInfo from './purchaseOrderInfo.vue'
|
||||||
|
import {
|
||||||
|
getOrgSidByPath,
|
||||||
|
getTypeValueList,
|
||||||
|
choiceSupplierInfo,
|
||||||
|
getWarehouses
|
||||||
|
} from '@/api/Common/dictcommons'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
ButtonBar,
|
ButtonBar,
|
||||||
@@ -103,12 +216,20 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
activeIndex: '1',
|
||||||
btndisabled: false,
|
btndisabled: false,
|
||||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||||
isSearchShow: false,
|
isSearchShow: false,
|
||||||
searchxianshitit: '显示查询条件',
|
searchxianshitit: '显示查询条件',
|
||||||
tableLoading: false,
|
tableLoading: false,
|
||||||
dataList: [],
|
dataList: [],
|
||||||
|
formobj: {
|
||||||
|
purchaseBillAmount: {
|
||||||
|
freight: ""
|
||||||
|
},
|
||||||
|
purchaseAppendixList: [],
|
||||||
|
purchaseBillDetailList: {}
|
||||||
|
},
|
||||||
btnList: [{
|
btnList: [{
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
@@ -143,20 +264,124 @@
|
|||||||
size: 10,
|
size: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
params: {
|
params: {
|
||||||
name: ''
|
"supplierName": "",
|
||||||
|
"wareHouseName": "",
|
||||||
|
"receiveStateKey": "",
|
||||||
|
"logisticsNum": "",
|
||||||
|
"deliveryStateKey": "",
|
||||||
|
"billNo": "",
|
||||||
|
"purchaserName": "",
|
||||||
|
"remarks": "",
|
||||||
|
"createStartTime": "",
|
||||||
|
"createEndTime": "",
|
||||||
|
"orgLevelKey": "",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sids: [],
|
sids: [],
|
||||||
selectionList: []
|
selectionList: [],
|
||||||
|
receiveStateList: [],
|
||||||
|
deliveryStateList: [],
|
||||||
|
warehouseList: [],
|
||||||
|
supplierList: [],
|
||||||
|
createOrgSid: "",
|
||||||
|
rowItemData: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// this.loadList()
|
|
||||||
|
getOrgSidByPath({
|
||||||
|
orgPath: window.sessionStorage.getItem('defaultOrgPath')
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.createOrgSid = res.data
|
||||||
|
this.init()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.loadList()
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
init() {
|
||||||
|
|
||||||
|
getTypeValueList({
|
||||||
|
type: 'receiveState'
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.receiveStateList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
getTypeValueList({
|
||||||
|
type: 'deliveryState'
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.deliveryStateList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
choiceSupplierInfo({
|
||||||
|
createOrgSid: this.createOrgSid
|
||||||
|
}).then((resp) => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.supplierList = resp.data
|
||||||
|
console.log("aaaaaa", this.supplierNameList);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getWarehouses({
|
||||||
|
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.warehouseList = res.data
|
||||||
|
|
||||||
|
console.log("aaaaaa", this.warehouseList);
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
rowItemClick(row) {
|
||||||
|
console.log("row", row);
|
||||||
|
|
||||||
|
// this.rowItemData = [row];
|
||||||
|
|
||||||
|
req.fetchDetailsBySid(row.sid).then((resp) => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.formobj = resp.data
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "数据异常。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "数据异常。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
isRed({
|
||||||
|
row
|
||||||
|
}) {
|
||||||
|
// const checkIdList = this.rowItemData.map((item) => item.sid);
|
||||||
|
// if (checkIdList.includes(row.sid)) {
|
||||||
|
// return {
|
||||||
|
// backgroundColor: "#34A1DB",
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
|
||||||
|
handleSelect(val) {
|
||||||
|
console.log("val", val);
|
||||||
|
this.activeIndex = val
|
||||||
|
},
|
||||||
selectionLineChangeHandle(val) {
|
selectionLineChangeHandle(val) {
|
||||||
console.log("val", val);
|
console.log("val", val);
|
||||||
|
|
||||||
@@ -206,6 +431,25 @@
|
|||||||
const data = resp.data
|
const data = resp.data
|
||||||
this.queryParams.total = data.total
|
this.queryParams.total = data.total
|
||||||
this.dataList = data.records
|
this.dataList = data.records
|
||||||
|
|
||||||
|
req.fetchDetailsBySid(this.dataList[0].sid).then((resp) => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.formobj = resp.data
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "数据异常。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "数据异常。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 根据resp.code进行异常情况处理
|
// 根据resp.code进行异常情况处理
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
@@ -232,7 +476,17 @@
|
|||||||
size: 10,
|
size: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
params: {
|
params: {
|
||||||
name: ''
|
"supplierName": "",
|
||||||
|
"wareHouseName": "",
|
||||||
|
"receiveStateKey": "",
|
||||||
|
"logisticsNum": "",
|
||||||
|
"deliveryStateKey": "",
|
||||||
|
"billNo": "",
|
||||||
|
"purchaserName": "",
|
||||||
|
"remarks": "",
|
||||||
|
"createStartTime": "",
|
||||||
|
"createEndTime": "",
|
||||||
|
"orgLevelKey": "",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.loadList()
|
this.loadList()
|
||||||
@@ -261,8 +515,8 @@
|
|||||||
this.$router.go(-1)
|
this.$router.go(-1)
|
||||||
},
|
},
|
||||||
toRelevancy(row) {
|
toRelevancy(row) {
|
||||||
this.viewState = 3
|
this.viewState = 4
|
||||||
this.$refs['divadd'].showEdit(row)
|
this.$refs['divinfo'].showAdd(row)
|
||||||
},
|
},
|
||||||
doDel() {
|
doDel() {
|
||||||
|
|
||||||
@@ -310,4 +564,36 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
/deep/ .el-form-item__error {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.must {
|
||||||
|
color: #f00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.span-sty {
|
||||||
|
width: 130px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addinputInfo {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
width: calc(100% - 115px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.first_row {
|
||||||
|
border-top: 1px solid #E0E3EB;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titleOne {
|
||||||
|
padding: 7px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,8 +1,743 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div v-show="viewState == 1">
|
||||||
|
<div class="tab-header webtop">
|
||||||
|
<!-- 标题 -->
|
||||||
|
<div>{{title}}采购订单</div>
|
||||||
|
<!-- start 添加修改按钮 -->
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||||
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
<!-- end 添加修改按钮 -->
|
||||||
|
<!-- end 详情按钮 -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="listconadd">
|
||||||
|
|
||||||
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
||||||
|
<!-- <div class="title">
|
||||||
|
<div>基础信息</div>
|
||||||
|
</div> -->
|
||||||
|
<el-row class="first_row">
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">制单人</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">制单部门</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">制单日期</div>
|
||||||
|
<el-form-item>
|
||||||
|
<el-date-picker v-model="formobj.createTime" type="date" class="addinputw addinputInfo"
|
||||||
|
value-format="yyyy-MM-dd" placeholder="选择日期">
|
||||||
|
</el-date-picker></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 供应商</div>
|
||||||
|
<el-form-item prop="supplierName"> <el-select v-model="formobj.supplierName" filterable clearable
|
||||||
|
placeholder="请选择供应商" class="addinputw addinputInfo" @change="supplierNameSelect">
|
||||||
|
<el-option v-for="item in supplierList" :key="item.sid" :label="item.supplierName" :value="item.sid">
|
||||||
|
</el-option>
|
||||||
|
</el-select></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 收货仓库</div>
|
||||||
|
<el-form-item prop="wareHouseName">
|
||||||
|
<el-select v-model="formobj.wareHouseName" placeholder="请选择收货仓库" class="addinputw addinputInfo"
|
||||||
|
@change="selectWarehouseName">
|
||||||
|
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName"
|
||||||
|
:value="item.sid" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 业务员</div>
|
||||||
|
<el-form-item prop="purchaserName">
|
||||||
|
<el-select v-model="formobj.purchaserName" filterable clearable placeholder="请选择业务员"
|
||||||
|
class="addinputw addinputInfo" @change="allOrgperSelect">
|
||||||
|
<el-option v-for="item in allOrgperList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="16">
|
||||||
|
<div class="span-sty">银行账号</div>
|
||||||
|
<el-form-item prop="bankAccount"> <el-input class="addinputw addinputInfo"
|
||||||
|
v-model="formobj.purchaseBillAmount.bankAccount" clearable placeholder=""
|
||||||
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" /></el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">货币类别</div>
|
||||||
|
<el-form-item prop="currencyValue">
|
||||||
|
<el-select v-model="formobj.purchaseBillAmount.currencyValue" placeholder="请选择货币类别"
|
||||||
|
class="addinputw addinputInfo" @change="selectCurrency">
|
||||||
|
<el-option v-for="(item,i) in currencyTypeList" :key="item.dictKey" :label="item.dictValue"
|
||||||
|
:value="item.dictKey" />
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">采购运费</div>
|
||||||
|
<el-form-item prop="freight"> <el-input class="addinputw addinputInfo"
|
||||||
|
v-model="formobj.purchaseBillAmount.freight" clearable placeholder=""
|
||||||
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">运费分摊方式</div>
|
||||||
|
<el-form-item prop="freightShareTypeValue">
|
||||||
|
<el-select v-model="formobj.purchaseBillAmount.freightShareTypeValue" placeholder="请选择分摊方式"
|
||||||
|
class="addinputw addinputInfo" @change="selectFreightShareType">
|
||||||
|
<el-option v-for="item in shareTypeList" :key="item.dictKey" :label="item.dictValue"
|
||||||
|
:value="item.dictKey" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"> 结算账户</div>
|
||||||
|
<el-form-item prop="settleAccountValue">
|
||||||
|
<el-select v-model="formobj.purchaseBillAmount.settleAccountValue" filterable clearable
|
||||||
|
placeholder="请选择结算账户" class="addinputw addinputInfo" @change="selectSettleAccount">
|
||||||
|
<el-option v-for="item in settlementList" :key="item.dictKey" :label="item.dictValue"
|
||||||
|
:value="item.dictKey" />
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">其他费用</div>
|
||||||
|
<el-form-item prop="otherAmountName"> <el-input class="addinputw addinputInfo"
|
||||||
|
v-model="formobj.purchaseBillAmount.otherAmountName" clearable placeholder=""
|
||||||
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">其他费用分摊方式</div>
|
||||||
|
<el-form-item prop="otherShareTypeValue">
|
||||||
|
<el-select v-model="formobj.purchaseBillAmount.otherShareTypeValue" placeholder="请选择分摊方式"
|
||||||
|
class="addinputw addinputInfo" @change="selectOtherShareType">
|
||||||
|
<el-option v-for="item in shareTypeList" :key="item.dictKey" :label="item.dictValue"
|
||||||
|
:value="item.dictKey" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">预付金额</div>
|
||||||
|
<el-form-item prop="prepayment"> <el-input class="addinputw addinputInfo"
|
||||||
|
v-model="formobj.purchaseBillAmount.prepayment" clearable placeholder=""
|
||||||
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<div class="span-sty">附件</div>
|
||||||
|
<el-form-item prop="imgList">
|
||||||
|
<upload-img ref="uploadImg" class="addinputw" v-model="imgList" :limit="50" bucket="map"
|
||||||
|
:upload-data="{ type: '0001' }" @change="backData2" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div class="span-sty">备注</div>
|
||||||
|
<el-form-item> <el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo"
|
||||||
|
type="textarea" :rows="4" clearable /></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<div class="title titleOne">
|
||||||
|
<div>商品列表</div>
|
||||||
|
<el-button type="primary" size="mini" class="btntopblueline" @click="goodsAdd()">添加</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table v-loading="listLoading" :data="formobj.purchaseBillDetailList" border style="width: 100%;">
|
||||||
|
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
|
||||||
|
<el-table-column fixed width="80" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
|
<el-table-column fixed label="操作" wid align="center" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="primary" size="mini" @click="deleteGoods(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商品编码" prop="goodsSkuCode" width="150" align="center" />
|
||||||
|
<el-table-column label="商品名称" prop="goodsSpuName" width="150" align="center" />
|
||||||
|
<el-table-column label="商品规格" prop="goodsSkuOwnSpec" width="150" align="center" />
|
||||||
|
<el-table-column label="单位" prop="unit" width="120" align="center" />
|
||||||
|
<el-table-column label="采购数量" align="center" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.count" clearable placeholder=""
|
||||||
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" @input="calculation(scope.row)" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="单价" prop="cost" width="120" align="center" />
|
||||||
|
<el-table-column label="折扣率(%)" align="center" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.discountRate" clearable placeholder=""
|
||||||
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"
|
||||||
|
@input="calculation(scope.row)" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="discountPrice" label="折扣单价" width="150" align="center" />
|
||||||
|
<!-- <el-table-column prop="shareAmount" label="分摊金额" width="150" align="center" /> -->
|
||||||
|
<el-table-column prop="amount" label="总价" width="120" align="center" />
|
||||||
|
<el-table-column label="预计到货日期" align="center" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-date-picker v-model="scope.row.deliveryDate" type="date" value-format="yyyy-MM-dd"
|
||||||
|
placeholder="选择日期" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 选择商品 -->
|
||||||
|
<chooseproducts v-show="viewState == 2" ref="divSp" @backData="backData" @doback="resetState" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
</script>
|
import req from '@/api/purchase/purchaseOrder.js'
|
||||||
|
import chooseproducts from './relation/chooseproducts'
|
||||||
|
import {
|
||||||
|
getOrgSidByPath,
|
||||||
|
choiceSupplierInfo,
|
||||||
|
getWarehouses,
|
||||||
|
selAllByOrgSidPath,
|
||||||
|
typeValues
|
||||||
|
} from '@/api/Common/dictcommons'
|
||||||
|
import uploadImg from '@/components/uploadFile/uploadImg'
|
||||||
|
import {
|
||||||
|
getCurrentDate
|
||||||
|
} from '@/utils/index.js'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
chooseproducts,
|
||||||
|
uploadImg
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: "【新增】",
|
||||||
|
viewState: 1,
|
||||||
|
listLoading: false,
|
||||||
|
submitdisabled: false,
|
||||||
|
formobj: {
|
||||||
|
"sid": "",
|
||||||
|
"remarks": "",
|
||||||
|
"createTime": getCurrentDate(),
|
||||||
|
"createBySid": window.sessionStorage.getItem('userSid'),
|
||||||
|
"createByName": window.sessionStorage.getItem('userName'),
|
||||||
|
"sourceBillSid": "",
|
||||||
|
"sourceBillNo": "",
|
||||||
|
"billNo": "",
|
||||||
|
"purchaseTypeKey": "",
|
||||||
|
"purchaseTypeValue": "",
|
||||||
|
"purchaseReasonKey": "",
|
||||||
|
"purchaseReasonValue": "",
|
||||||
|
"payTypeKey": "",
|
||||||
|
"payTypeValue": "",
|
||||||
|
"supplierSid": "",
|
||||||
|
"supplierName": "",
|
||||||
|
"supplierPhone": "",
|
||||||
|
"purchaserSid": "",
|
||||||
|
"purchaserName": "",
|
||||||
|
"deliveryDate": "",
|
||||||
|
"wareHouseSid": "",
|
||||||
|
"wareHouseName": "",
|
||||||
|
"deptSid": window.sessionStorage.getItem('departmentSid'),
|
||||||
|
"deptName": window.sessionStorage.getItem('departmentName'),
|
||||||
|
"useOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||||
|
"createOrgSid": window.sessionStorage.getItem('orgSid'),
|
||||||
|
"orgPath": window.sessionStorage.getItem('orgSid'),
|
||||||
|
"purchaseBillAmount": {
|
||||||
|
"sid": "",
|
||||||
|
"billSid": "",
|
||||||
|
"errorAmount": "",
|
||||||
|
"discountAmount": "",
|
||||||
|
"payableAmount": "",
|
||||||
|
"freight": "",
|
||||||
|
"freightShareTypeKey": "",
|
||||||
|
"freightShareTypeValue": "",
|
||||||
|
"otherAmountName": "",
|
||||||
|
"otherShareTypeKey": "",
|
||||||
|
"otherShareTypeValue": "",
|
||||||
|
"settleAccountKey": "",
|
||||||
|
"settleAccountValue": "",
|
||||||
|
"prepayment": "",
|
||||||
|
"paymentTerm": "",
|
||||||
|
"bankName": "",
|
||||||
|
"bankAccountName": "",
|
||||||
|
"bankAccount": "",
|
||||||
|
"currencyKey": "",
|
||||||
|
"currencyValue": ""
|
||||||
|
},
|
||||||
|
"purchaseBillExtend": {
|
||||||
|
"sid": "",
|
||||||
|
"billSid": "",
|
||||||
|
"logisticsNum": "",
|
||||||
|
"productProgress": "",
|
||||||
|
"receiveStateKey": "",
|
||||||
|
"receiveStateValue": "",
|
||||||
|
"deliveryStateKey": "",
|
||||||
|
"deliveryStateValue": ""
|
||||||
|
},
|
||||||
|
"purchaseBillDetailList": [],
|
||||||
|
"purchaseAppendixList": [
|
||||||
|
|
||||||
<style>
|
]
|
||||||
|
},
|
||||||
|
supplierList: [],
|
||||||
|
warehouseList: [],
|
||||||
|
allOrgperList: [],
|
||||||
|
currencyTypeList: [],
|
||||||
|
settlementList: [],
|
||||||
|
shareTypeList: [],
|
||||||
|
rules: {
|
||||||
|
createTime: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择日期',
|
||||||
|
trigger: 'change'
|
||||||
|
}],
|
||||||
|
supplierName: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择供应商',
|
||||||
|
trigger: 'change'
|
||||||
|
}],
|
||||||
|
wareHouseName: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择收货仓库',
|
||||||
|
trigger: 'change'
|
||||||
|
}],
|
||||||
|
purchaserName: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择业务员',
|
||||||
|
trigger: 'change'
|
||||||
|
}],
|
||||||
|
|
||||||
|
},
|
||||||
|
imgList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
init() {
|
||||||
|
|
||||||
|
getOrgSidByPath({
|
||||||
|
orgPath: window.sessionStorage.getItem('defaultOrgPath')
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.formobj.createOrgSid = res.data
|
||||||
|
this.formobj.useOrgSid = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 供应商
|
||||||
|
choiceSupplierInfo({
|
||||||
|
deptSid: window.sessionStorage.getItem('departmentSid')
|
||||||
|
}).then((resp) => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.supplierList = resp.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 仓库
|
||||||
|
getWarehouses({
|
||||||
|
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.warehouseList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 业务员
|
||||||
|
selAllByOrgSidPath({
|
||||||
|
orgSidPath: window.sessionStorage.getItem('defaultOrgPath')
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.allOrgperList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 货币
|
||||||
|
typeValues({
|
||||||
|
type: 'wms_busType'
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.currencyTypeList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 结算账户
|
||||||
|
typeValues({
|
||||||
|
type: 'wms_busType'
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.settlementList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 分摊方式
|
||||||
|
typeValues({
|
||||||
|
type: 'wms_busType'
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.shareTypeList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
calculation(row) {
|
||||||
|
|
||||||
|
row.discountPrice = (Number(row.cost) * Number(row.discountRate) / 100).toFixed(2)
|
||||||
|
row.amount = (Number(row.count) * Number(row.discountPrice)).toFixed(2)
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
goodsAdd() {
|
||||||
|
this.viewState = 2
|
||||||
|
this.$refs['divSp'].showAdd(this.formobj.createOrgSid)
|
||||||
|
},
|
||||||
|
deleteGoods(row) {
|
||||||
|
console.log("deleteGoods》》》》", row)
|
||||||
|
|
||||||
|
this.$confirm("是否确定删除此商品?", '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
const index = this.formobj.purchaseBillDetailList.findIndex((item) => item === row)
|
||||||
|
console.log("index》》》》", index)
|
||||||
|
this.formobj.purchaseBillDetailList.splice(index, 1)
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
backData2(value) {
|
||||||
|
console.log('backData2》》》》', value)
|
||||||
|
console.log('imgList', this.imgList)
|
||||||
|
|
||||||
|
for (var i = 0; i < this.imgList.length; i++) {
|
||||||
|
this.formobj.purchaseAppendixList.push({
|
||||||
|
url: this.imgList[i].url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
backData(value) {
|
||||||
|
this.viewState = 1
|
||||||
|
console.log('>>>>>>>>>backData', value)
|
||||||
|
|
||||||
|
for (var i = 0; i < value.length; i++) {
|
||||||
|
|
||||||
|
this.formobj.purchaseBillDetailList.push(
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
"sid": "",
|
||||||
|
"remarks": "",
|
||||||
|
"billSid": "",
|
||||||
|
"goodsSpuSid": value[i].sid,
|
||||||
|
"goodsSpuName": value[i].goodsName,
|
||||||
|
"goodsSkuSid": "",
|
||||||
|
"goodsSkuTitle": "",
|
||||||
|
"goodsSkuCode": value[i].goodsSkuCode,
|
||||||
|
"goodsSN": "",
|
||||||
|
"goodsNum": "",
|
||||||
|
"goodsSkuOwnSpec": value[i].goodsSkuOwnSpec,
|
||||||
|
"unit": value[i].unit,
|
||||||
|
"cost": value[i].cost,
|
||||||
|
"count": "1",
|
||||||
|
"discountRate": value[i].discountRate,
|
||||||
|
"discountPrice": "0.00",
|
||||||
|
"shareAmount": "0.00",
|
||||||
|
"shareRate": "0.00",
|
||||||
|
"amount": "0.00",
|
||||||
|
"cycle": "",
|
||||||
|
"deliveryDate": "",
|
||||||
|
"taxAmount": "0.00",
|
||||||
|
"taxPrice": "0.00"
|
||||||
|
}
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
resetState() {
|
||||||
|
this.viewState = 1
|
||||||
|
},
|
||||||
|
|
||||||
|
indexMethod(index) {
|
||||||
|
return index + 1
|
||||||
|
},
|
||||||
|
saveOrUpdate() {
|
||||||
|
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||||
|
|
||||||
|
this.$refs['form_obj'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
|
||||||
|
if (this.formobj.purchaseBillDetailList.length == 0) {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
type: 'warning',
|
||||||
|
message: '请添加采购商品'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < this.formobj.purchaseBillDetailList.length; i++) {
|
||||||
|
var item = this.formobj.purchaseBillDetailList[i]
|
||||||
|
if (Number(item.count) == 0) {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
type: 'warning',
|
||||||
|
message: '商品采购数量不能为0或空'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Number(item.discountRate) == 0) {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
type: 'warning',
|
||||||
|
message: '商品折扣率不能为0或空'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.submitdisabled = true
|
||||||
|
req.save(this.formobj).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
type: 'success',
|
||||||
|
message: '保存成功'
|
||||||
|
})
|
||||||
|
this.handleReturn('true')
|
||||||
|
} else {
|
||||||
|
this.submitdisabled = false
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.submitdisabled = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
handleReturn(isreload) {
|
||||||
|
if (isreload === 'true') this.$emit('reloadlist')
|
||||||
|
this.submitdisabled = false
|
||||||
|
this.formobj = {
|
||||||
|
"sid": "",
|
||||||
|
"remarks": "",
|
||||||
|
"createTime": getCurrentDate(),
|
||||||
|
"createBySid": window.sessionStorage.getItem('userSid'),
|
||||||
|
"createByName": window.sessionStorage.getItem('userName'),
|
||||||
|
"sourceBillSid": "",
|
||||||
|
"sourceBillNo": "",
|
||||||
|
"billNo": "",
|
||||||
|
"purchaseTypeKey": "",
|
||||||
|
"purchaseTypeValue": "",
|
||||||
|
"purchaseReasonKey": "",
|
||||||
|
"purchaseReasonValue": "",
|
||||||
|
"payTypeKey": "",
|
||||||
|
"payTypeValue": "",
|
||||||
|
"supplierSid": "",
|
||||||
|
"supplierName": "",
|
||||||
|
"supplierPhone": "",
|
||||||
|
"purchaserSid": "",
|
||||||
|
"purchaserName": "",
|
||||||
|
"deliveryDate": "",
|
||||||
|
"wareHouseSid": "",
|
||||||
|
"wareHouseName": "",
|
||||||
|
"deptSid": window.sessionStorage.getItem('departmentSid'),
|
||||||
|
"deptName": window.sessionStorage.getItem('departmentName'),
|
||||||
|
"useOrgSid": '',
|
||||||
|
"createOrgSid": '',
|
||||||
|
"orgPath": '',
|
||||||
|
"purchaseBillAmount": {
|
||||||
|
"sid": "",
|
||||||
|
"billSid": "",
|
||||||
|
"errorAmount": "",
|
||||||
|
"discountAmount": "",
|
||||||
|
"payableAmount": "",
|
||||||
|
"freight": "",
|
||||||
|
"freightShareTypeKey": "",
|
||||||
|
"freightShareTypeValue": "",
|
||||||
|
"otherAmountName": "",
|
||||||
|
"otherShareTypeKey": "",
|
||||||
|
"otherShareTypeValue": "",
|
||||||
|
"settleAccountKey": "",
|
||||||
|
"settleAccountValue": "",
|
||||||
|
"prepayment": "",
|
||||||
|
"paymentTerm": "",
|
||||||
|
"bankName": "",
|
||||||
|
"bankAccountName": "",
|
||||||
|
"bankAccount": "",
|
||||||
|
"currencyKey": "",
|
||||||
|
"currencyValue": ""
|
||||||
|
},
|
||||||
|
"purchaseBillExtend": {
|
||||||
|
"sid": "",
|
||||||
|
"billSid": "",
|
||||||
|
"logisticsNum": "",
|
||||||
|
"productProgress": "",
|
||||||
|
"receiveStateKey": "",
|
||||||
|
"receiveStateValue": "",
|
||||||
|
"deliveryStateKey": "",
|
||||||
|
"deliveryStateValue": ""
|
||||||
|
},
|
||||||
|
"purchaseBillDetailList": [],
|
||||||
|
"purchaseAppendixList": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
|
this.$emit('doback')
|
||||||
|
},
|
||||||
|
|
||||||
|
showAdd() {
|
||||||
|
this.init()
|
||||||
|
|
||||||
|
this.title = '【新增】'
|
||||||
|
|
||||||
|
},
|
||||||
|
showEdit(row) {
|
||||||
|
|
||||||
|
this.init()
|
||||||
|
|
||||||
|
this.title = '【编辑】'
|
||||||
|
|
||||||
|
const loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: 'Loading',
|
||||||
|
spinner: 'el-icon-loading',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
|
})
|
||||||
|
|
||||||
|
req.fetchDetailsBySid(row.sid)
|
||||||
|
.then(resp => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.formobj = resp.data
|
||||||
|
loading.close()
|
||||||
|
this.imgList = []
|
||||||
|
for (var i = 0; i < resp.data.purchaseAppendixList.length; i++) {
|
||||||
|
this.imgList.push({
|
||||||
|
url: resp.data.purchaseAppendixList[i].url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
loading.close()
|
||||||
|
this.formobj = {}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
supplierNameSelect(val) {
|
||||||
|
console.log("supplierNameSelect", val);
|
||||||
|
const choose = this.supplierList.filter((item) => item.sid == val)
|
||||||
|
console.log('>>>>>>>>>supplierNameSelect', choose)
|
||||||
|
this.formobj.supplierName = choose[0].supplierName
|
||||||
|
this.formobj.supplierSid = choose[0].sid
|
||||||
|
|
||||||
|
},
|
||||||
|
selectWarehouseName(val) {
|
||||||
|
|
||||||
|
console.log("selectWarehouseName", val);
|
||||||
|
const choose = this.warehouseList.filter((item) => item.sid == val)
|
||||||
|
console.log('>>>>>>>>>selectWarehouseName', choose)
|
||||||
|
this.formobj.wareHouseName = choose[0].warehouseName
|
||||||
|
this.formobj.wareHouseSid = choose[0].sid
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
allOrgperSelect(val) {
|
||||||
|
console.log("allOrgperSelect", val);
|
||||||
|
|
||||||
|
const choose = this.allOrgperList.filter((item) => item.sid == val)
|
||||||
|
console.log('>>>>>>>>>allOrgperSelect', choose)
|
||||||
|
this.formobj.purchaserName = choose[0].name
|
||||||
|
this.formobj.purchaserSid = choose[0].sid
|
||||||
|
|
||||||
|
},
|
||||||
|
selectCurrency(val) {
|
||||||
|
|
||||||
|
},
|
||||||
|
selectFreightShareType(val) {
|
||||||
|
|
||||||
|
},
|
||||||
|
selectSettleAccount(val) {
|
||||||
|
|
||||||
|
},
|
||||||
|
selectOtherShareType(val) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
/deep/ .el-form-item__error {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.must {
|
||||||
|
color: #f00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.span-sty {
|
||||||
|
width: 130px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addinputInfo {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
width: calc(100% - 115px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.first_row {
|
||||||
|
border-top: 1px solid #E0E3EB;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titleOne {
|
||||||
|
padding: 7px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,8 +1,225 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div v-show="viewState == 1">
|
||||||
|
<div class="tab-header webtop">
|
||||||
|
<!-- 标题 -->
|
||||||
|
<div>采购订单详情</div>
|
||||||
|
<!-- start 添加修改按钮 -->
|
||||||
|
<div>
|
||||||
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
<!-- end 添加修改按钮 -->
|
||||||
|
<!-- end 详情按钮 -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="listconadd">
|
||||||
|
|
||||||
|
<el-form ref="form_obj" :model="formobj" class="formaddcopy02">
|
||||||
|
<!-- <div class="title">
|
||||||
|
<div>基础信息</div>
|
||||||
|
</div> -->
|
||||||
|
<el-row class="first_row">
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">制单人</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">制单部门</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty">制单日期</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
|
||||||
|
<div class="span-sty"><span class="must">*</span> 供应商</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.supplierName }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 收货仓库</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.wareHouseName }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 业务员</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.purchaserName }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="16">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 银行账号</div>
|
||||||
|
<el-form-item><span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.bankAccount }}</span></el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 货币类别</div>
|
||||||
|
<el-form-item><span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.currencyValue }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 采购运费</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.purchaseBillAmount.freight }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 运费分摊方式</div>
|
||||||
|
<el-form-item><span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.freightShareTypeValue }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 结算账户</div>
|
||||||
|
<el-form-item><span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.settleAccountValue }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 其他费用</div>
|
||||||
|
<el-form-item><span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.otherAmountName }}</span></el-form-item>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 其他费用分摊方式</div>
|
||||||
|
<el-form-item><span
|
||||||
|
class="addinputInfo">{{ formobj.purchaseBillAmount.otherShareTypeValue }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 预付金额</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.purchaseBillAmount.prepayment }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<div class="span-sty"><span class="must">*</span> 附件</div>
|
||||||
|
<el-form-item><el-image class="addinputInfo" style="width: 150px;height: 150px"
|
||||||
|
v-for="(item, index) in formobj.purchaseAppendixList" :key="index" :src="item.url"
|
||||||
|
:preview-src-list="formobj.purchaseAppendixList" /></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div class="span-sty">备注</div>
|
||||||
|
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<div class="title titleOne">
|
||||||
|
<div>商品列表</div>
|
||||||
|
</div>
|
||||||
|
<el-table v-loading="listLoading" :data="formobj.purchaseBillDetailList" border style="width: 100%;">
|
||||||
|
<el-table-column fixed width="80" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
|
<el-table-column prop="goodsSpuName" label="商品名称" align="center" />
|
||||||
|
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||||
|
<el-table-column prop="goodsSkuOwnSpec" label="规格型号" align="center" />
|
||||||
|
<el-table-column prop="unit" label="单位" align="center" />
|
||||||
|
<el-table-column prop="count" label="采购数量" align="center" />
|
||||||
|
<el-table-column prop="cost" label="单价" align="center" />
|
||||||
|
<el-table-column prop="discountRate" label="折扣率(%)" align="center" />
|
||||||
|
<el-table-column prop="discountPrice" label="折扣单价" align="center" />
|
||||||
|
<el-table-column prop="shareAmount" label="分摊金额" align="center" />
|
||||||
|
<el-table-column prop="amount" label="总价" align="center" />
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
</script>
|
import req from '@/api/purchase/purchaseOrder.js'
|
||||||
|
export default {
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
viewState: 1,
|
||||||
|
listLoading: false,
|
||||||
|
formobj: {
|
||||||
|
|
||||||
<style>
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
indexMethod(index) {
|
||||||
|
return index + 1
|
||||||
|
},
|
||||||
|
|
||||||
|
showAdd(row) {
|
||||||
|
req.fetchDetailsBySid(row.sid).then((resp) => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.formobj = resp.data
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "数据异常。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: "数据异常。",
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
handleReturn() {
|
||||||
|
this.$emit('doback')
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
/deep/ .el-form-item__error {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.must {
|
||||||
|
color: #f00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.span-sty {
|
||||||
|
width: 130px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addinputInfo {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
||||||
|
margin-left: 120px !important;
|
||||||
|
width: calc(100% - 115px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.first_row {
|
||||||
|
border-top: 1px solid #E0E3EB;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titleOne {
|
||||||
|
padding: 7px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
165
src/views/purchase/purchaseOrder/relation/chooseproducts.vue
Normal file
165
src/views/purchase/purchaseOrder/relation/chooseproducts.vue
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div>
|
||||||
|
<div class="tab-header webtop">
|
||||||
|
<div>选择商品</div>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" size="small" @click="AddUpdateReturn">确定</el-button>
|
||||||
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="">
|
||||||
|
<div class="searchcon">
|
||||||
|
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
|
||||||
|
<div v-show="isSearchShow" class="search">
|
||||||
|
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="120px" class="tab-header">
|
||||||
|
<el-form-item label="商品名称" class="searchlist">
|
||||||
|
<el-input v-model="listQuery.params.goodsName" placeholder="" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品编码" class="searchlist">
|
||||||
|
<el-input v-model="listQuery.params.goodsSkuCode" placeholder="" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="btn" style="text-align: center;">
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="handleFilter" size="small">查询</el-button>
|
||||||
|
<el-button type="primary" icon="el-icon-refresh" @click="handleReset" size="small">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="listtop">
|
||||||
|
<div class="tit">商品列表</div>
|
||||||
|
<!-- <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList"/>-->
|
||||||
|
</div>
|
||||||
|
<div class="">
|
||||||
|
<el-table :key="tableKey" ref="multipleTable" v-loading="listLoading" :data="list" border style="width: 100%"
|
||||||
|
@selection-change="handleSelectionChange">
|
||||||
|
<el-table-column width="50px" type="selection" align="center" />
|
||||||
|
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
|
<el-table-column prop="goodsName" label="商品名称" align="center" />
|
||||||
|
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
||||||
|
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" />
|
||||||
|
<el-table-column prop="unit" label="单位" align="center" />
|
||||||
|
<el-table-column prop="cost" label="单价" align="center" />
|
||||||
|
<el-table-column prop="discountRate" label="折扣率(%)" align="center" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div class="pages">
|
||||||
|
<div class="tit" />
|
||||||
|
<!-- 翻页 -->
|
||||||
|
<Pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
|
||||||
|
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Pagination from '@/components/pagination'
|
||||||
|
import req from '@/api/purchase/purchaseOrder.js'
|
||||||
|
export default {
|
||||||
|
name: 'SelectVehicle',
|
||||||
|
components: {
|
||||||
|
Pagination
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isSearchShow: false,
|
||||||
|
searchxianshitit: '隐藏查询条件',
|
||||||
|
tableKey: 0,
|
||||||
|
sids: [],
|
||||||
|
list: [],
|
||||||
|
listLoading: false,
|
||||||
|
listQuery: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
params: {
|
||||||
|
createOrgSid: '',
|
||||||
|
goodsName: '',
|
||||||
|
goodsSkuCode: '',
|
||||||
|
},
|
||||||
|
total: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 搜索条件效果
|
||||||
|
clicksearchShow() {
|
||||||
|
this.isSearchShow = !this.isSearchShow
|
||||||
|
if (this.isSearchShow) {
|
||||||
|
this.searchxianshitit = '隐藏查询条件'
|
||||||
|
} else {
|
||||||
|
this.searchxianshitit = '显示查询条件'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
indexMethod(index) {
|
||||||
|
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
||||||
|
var pageindex = index + 1 + pagestart
|
||||||
|
return pageindex
|
||||||
|
},
|
||||||
|
// 查询列表信息
|
||||||
|
getList() {
|
||||||
|
this.listLoading = true
|
||||||
|
req.chooseproducts(this.listQuery).then((response) => {
|
||||||
|
this.listLoading = false
|
||||||
|
if (response.success) {
|
||||||
|
this.listQuery.total = response.data.total
|
||||||
|
this.list = response.data.records
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 查询按钮
|
||||||
|
handleFilter() {
|
||||||
|
this.listQuery.current = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
// 重置按钮
|
||||||
|
handleReset() {
|
||||||
|
this.listQuery.current = 1
|
||||||
|
this.listQuery.size = 10
|
||||||
|
this.listQuery.total = 0
|
||||||
|
this.listQuery.params.goodsName = ''
|
||||||
|
this.listQuery.params.goodsSkuCode = ''
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
handleSelectionChange(row) {
|
||||||
|
this.sids = row
|
||||||
|
},
|
||||||
|
showAdd(createOrgSid) {
|
||||||
|
// const aa = []
|
||||||
|
// if (value.length > 0) {
|
||||||
|
// for (var i = 0; i < value.length; i++) {
|
||||||
|
// aa.push(value[i].saleVehSid)
|
||||||
|
// }
|
||||||
|
// this.listQuery.params.saleVehSids = aa
|
||||||
|
// } else {
|
||||||
|
// this.listQuery.params.saleVehSids = []
|
||||||
|
// }``
|
||||||
|
this.listQuery.params.createOrgSid = createOrgSid
|
||||||
|
this.listQuery.current = 1
|
||||||
|
this.listQuery.size = 5
|
||||||
|
this.listQuery.total = 0
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
// 添加修改返回
|
||||||
|
AddUpdateReturn() {
|
||||||
|
if (this.sids.length > 0) {
|
||||||
|
this.$emit('backData', this.sids)
|
||||||
|
} else {
|
||||||
|
this.$notify({
|
||||||
|
title: '提示',
|
||||||
|
message: '请至少选择一条记录进行操作',
|
||||||
|
type: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 返回
|
||||||
|
handleReturn() {
|
||||||
|
this.$emit('doback')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
</style>
|
||||||
@@ -38,7 +38,8 @@
|
|||||||
|
|
||||||
<div class="listconadd">
|
<div class="listconadd">
|
||||||
|
|
||||||
<el-table ref="multipleTable" :data="tableData" border style="width: 100%;margin-bottom: 100px;" row-key="sid"
|
<el-table v-loading="loading" ref="multipleTable" :data="tableData" border
|
||||||
|
style="width: 100%;margin-bottom: 100px;" row-key="sid"
|
||||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
||||||
<el-table-column prop="name" label="菜单名称" width="220" />
|
<el-table-column prop="name" label="菜单名称" width="220" />
|
||||||
<el-table-column label="操作" width="260" align="center">
|
<el-table-column label="操作" width="260" align="center">
|
||||||
@@ -61,11 +62,12 @@
|
|||||||
<el-input v-model="scope.row.sortNo" size="mini"/>
|
<el-input v-model="scope.row.sortNo" size="mini"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>-->
|
</el-table-column>-->
|
||||||
|
<el-table-column prop="pageUrl" width="120" label="类型" align="center" />
|
||||||
<el-table-column prop="pageUrl" label="链接地址" align="center" />
|
<el-table-column prop="pageUrl" label="链接地址" align="center" />
|
||||||
<el-table-column prop="isEnable" label="可见性" align="center">
|
<el-table-column prop="isShow" label="可见性" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch v-model="scope.row.isEnable" active-color="#13ce66" inactive-color="#ff4949" active-value="1"
|
<el-switch v-model="scope.row.isShow" active-color="#13ce66" inactive-color="#ff4949" active-value="1"
|
||||||
inactive-value="0" @change="enabledChange(scope.row.isEnable,scope.row)" />
|
inactive-value="0" @change="enabledChange(scope.row.isShow,scope.row)" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -117,12 +119,22 @@
|
|||||||
<el-input v-model="form.pageUrl" />
|
<el-input v-model="form.pageUrl" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>类型分类</td>
|
||||||
|
<td>
|
||||||
|
<el-radio-group v-model="editMenuType" @change="menuTypeChangeRadio">
|
||||||
|
<el-radio :label="'1'">目录</el-radio>
|
||||||
|
<el-radio :label="'2'">菜单</el-radio>
|
||||||
|
<el-radio :label="'3'">按钮</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>是否可见</td>
|
<td>是否可见</td>
|
||||||
<td>
|
<td>
|
||||||
<el-radio-group v-model="form.isShow">
|
<el-radio-group v-model="editShow" @change="changeRadio">
|
||||||
<el-radio :label="0">否</el-radio>
|
<el-radio :label="'0'">否</el-radio>
|
||||||
<el-radio :label="1">是</el-radio>
|
<el-radio :label="'1'">是</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -192,12 +204,22 @@
|
|||||||
<el-input v-model="form.pageUrl" style="width:300px" />
|
<el-input v-model="form.pageUrl" style="width:300px" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>类型分类</td>
|
||||||
|
<td>
|
||||||
|
<el-radio-group v-model="addMenuType" @change="menuTypeChangeRadio2">
|
||||||
|
<el-radio :label="'1'">目录</el-radio>
|
||||||
|
<el-radio :label="'2'">菜单</el-radio>
|
||||||
|
<el-radio :label="'3'">按钮</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>是否可见</td>
|
<td>是否可见</td>
|
||||||
<td>
|
<td>
|
||||||
<el-radio-group v-model="form.isShow">
|
<el-radio-group v-model="addShow" @change="changeRadio2">
|
||||||
<el-radio :label="0">否</el-radio>
|
<el-radio :label="'0'">否</el-radio>
|
||||||
<el-radio :label="1">是</el-radio>
|
<el-radio :label="'1'">是</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -235,6 +257,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
loading: false,
|
||||||
activeName: 'roleList',
|
activeName: 'roleList',
|
||||||
editDialog: false,
|
editDialog: false,
|
||||||
dialogTitle: '',
|
dialogTitle: '',
|
||||||
@@ -242,7 +265,7 @@
|
|||||||
form: {
|
form: {
|
||||||
pname: '顶级菜单',
|
pname: '顶级菜单',
|
||||||
iconUrl: '',
|
iconUrl: '',
|
||||||
isShow: 1,
|
isShow: '1',
|
||||||
menuName: '',
|
menuName: '',
|
||||||
menuUrl: '',
|
menuUrl: '',
|
||||||
pageAliasName: '',
|
pageAliasName: '',
|
||||||
@@ -252,8 +275,8 @@
|
|||||||
psid: '',
|
psid: '',
|
||||||
remarks: '',
|
remarks: '',
|
||||||
sortNo: 0,
|
sortNo: 0,
|
||||||
sourceName: 'oms',
|
sourceName: 'wms',
|
||||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44'
|
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa33'
|
||||||
},
|
},
|
||||||
formBackup: Object.assign({}, this.form),
|
formBackup: Object.assign({}, this.form),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
@@ -264,13 +287,17 @@
|
|||||||
params: {
|
params: {
|
||||||
name: '',
|
name: '',
|
||||||
psid: '',
|
psid: '',
|
||||||
sourceName: 'oms',
|
sourceName: 'wms',
|
||||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44'
|
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa33'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rank: '1',
|
rank: '1',
|
||||||
sourceNameData: [], // 资源
|
sourceNameData: [], // 资源
|
||||||
isadd: false
|
isadd: false,
|
||||||
|
editShow: '1',
|
||||||
|
addShow: '1',
|
||||||
|
addMenuType: '1',
|
||||||
|
editMenuType: '1',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -282,6 +309,22 @@
|
|||||||
// })
|
// })
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
menuTypeChangeRadio(val) {
|
||||||
|
console.log('menuTypeChangeRadio', val)
|
||||||
|
this.form.menuType = val
|
||||||
|
},
|
||||||
|
menuTypeChangeRadio2(val) {
|
||||||
|
console.log('menuTypeChangeRadio2', val)
|
||||||
|
this.form.menuType = val
|
||||||
|
},
|
||||||
|
changeRadio(val) {
|
||||||
|
console.log('changeRadio', val)
|
||||||
|
this.form.isShow = val
|
||||||
|
},
|
||||||
|
changeRadio2(val) {
|
||||||
|
console.log('changeRadio2', val)
|
||||||
|
this.form.isShow = val
|
||||||
|
},
|
||||||
pagination(val) { // 分页
|
pagination(val) { // 分页
|
||||||
this.page.current = val.pageNum
|
this.page.current = val.pageNum
|
||||||
this.page.size = val.pageSize
|
this.page.size = val.pageSize
|
||||||
@@ -291,7 +334,9 @@
|
|||||||
this.page.params = this.pageBackup
|
this.page.params = this.pageBackup
|
||||||
},
|
},
|
||||||
getPageList() { // 获取列表
|
getPageList() { // 获取列表
|
||||||
|
this.loading = true
|
||||||
pageList(this.page).then((res) => {
|
pageList(this.page).then((res) => {
|
||||||
|
this.loading = false
|
||||||
console.log('这里是条件查询', this.page)
|
console.log('这里是条件查询', this.page)
|
||||||
const treedata = res.data
|
const treedata = res.data
|
||||||
console.log('菜单列表', res)
|
console.log('菜单列表', res)
|
||||||
@@ -310,7 +355,14 @@
|
|||||||
handleClick(tab, event) {
|
handleClick(tab, event) {
|
||||||
if (tab.name == 'addrole') {
|
if (tab.name == 'addrole') {
|
||||||
this.dialogTitle = '新增'
|
this.dialogTitle = '新增'
|
||||||
this.roleForm = Object.assign({}, this.formBackup)
|
this.form = Object.assign({}, this.formBackup)
|
||||||
|
this.form.isShow = '1'
|
||||||
|
this.form.menuType = '1'
|
||||||
|
// this.form.psid = row.sid || 0
|
||||||
|
this.form.pname = '顶级菜单'
|
||||||
|
this.form.sourceName = 'wms'
|
||||||
|
this.form.sourceSid = 'd936f1ba-03c3-11ec-bf08-48452053aa33'
|
||||||
|
this.form.psid = 0
|
||||||
} else {
|
} else {
|
||||||
this.getPageList()
|
this.getPageList()
|
||||||
}
|
}
|
||||||
@@ -325,7 +377,8 @@
|
|||||||
// this.dialogTitle = '新增'
|
// this.dialogTitle = '新增'
|
||||||
// this.editDialog = true
|
// this.editDialog = true
|
||||||
this.form = Object.assign({}, this.formBackup)
|
this.form = Object.assign({}, this.formBackup)
|
||||||
this.form.isShow = 1
|
this.form.isShow = '1'
|
||||||
|
this.form.menuType = '1'
|
||||||
// this.form.psid = row.sid || 0
|
// this.form.psid = row.sid || 0
|
||||||
this.form.pname = row.name || '顶级菜单'
|
this.form.pname = row.name || '顶级菜单'
|
||||||
this.form.sourceName = row.sourceName
|
this.form.sourceName = row.sourceName
|
||||||
@@ -337,17 +390,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
editRow(row) {
|
editRow(row) {
|
||||||
|
console.log("editRow", row);
|
||||||
this.dialogTitle = '编辑'
|
this.dialogTitle = '编辑'
|
||||||
this.editDialog = true
|
this.editDialog = true
|
||||||
this.form = Object.assign({}, row)
|
this.form = Object.assign({}, row)
|
||||||
this.form.isShow = 1
|
|
||||||
|
this.editShow = this.form.isShow
|
||||||
|
this.editMenuType = this.form.menuType
|
||||||
|
|
||||||
|
// this.form.isShow = 1
|
||||||
this.form.pname = row.psid == '0' ? '顶级菜单' : row.pname
|
this.form.pname = row.psid == '0' ? '顶级菜单' : row.pname
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
if (this.form.sid) {
|
if (this.form.sid) {
|
||||||
putMenusInfo(this.form).then(res => {
|
putMenusInfo(this.form).then(res => {
|
||||||
this.editDialog = false
|
this.editDialog = false
|
||||||
this.getPageList(this.page)
|
this.getPageList()
|
||||||
this.$message({
|
this.$message({
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
type: 'success'
|
type: 'success'
|
||||||
@@ -379,17 +437,15 @@
|
|||||||
delMenus({
|
delMenus({
|
||||||
sid: row.sid
|
sid: row.sid
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|
||||||
loading.close()
|
loading.close()
|
||||||
if (resp.success) {
|
this.getPageList()
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: resp.msg,
|
message: resp.msg,
|
||||||
showClose: true
|
showClose: true
|
||||||
})
|
})
|
||||||
this.getPageList(this.page)
|
|
||||||
} else {
|
|
||||||
// 根据resp.code进行异常情况处理
|
|
||||||
}
|
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
loading.close()
|
loading.close()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container" style="display: flex;">
|
<div class="container" style="display: flex;">
|
||||||
<div class="org-tree">
|
<div class="org-tree">
|
||||||
<el-tree :data="treedata" node-key="sid" :props="props" :default-expanded-keys="['fd6435f2-0005-11ec-a033-48452053aa33']" @node-click="handleNodeClick">
|
<el-tree :data="treedata" node-key="sid" :props="props"
|
||||||
<span class="custom-tree-node" slot-scope="{ node, data }" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)" @click.stop.native>
|
:default-expanded-keys="['fd6435f2-0005-11ec-a033-48452053aa33']" @node-click="handleNodeClick">
|
||||||
<span>{{ node.label || $store.getters.userInfo.Orgname }}</span>
|
<span class="custom-tree-node" slot-scope="{ node, data }" @mouseenter="mouseenter(data)"
|
||||||
<span v-show="data.del" class="handle">
|
@mouseleave="mouseleave(data)">
|
||||||
<el-tooltip class="item" effect="dark" content="新增" placement="top-start">
|
<span>{{ node.label || $store.getters.userInfo.Orgname }}</span>
|
||||||
|
<span v-show="data.del" class="handle">
|
||||||
|
<el-tooltip class="item" effect="dark" content="新增" placement="top-start">
|
||||||
<el-button type="text" size="mini" @click.stop="() => append(data)" icon="el-icon-circle-plus-outline">
|
<el-button type="text" size="mini" @click.stop="() => append(data)" icon="el-icon-circle-plus-outline">
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@@ -17,8 +19,8 @@
|
|||||||
<!-- <el-button type="text" size="mini" @click.stop="() => remove(data)" icon="el-icon-delete">-->
|
<!-- <el-button type="text" size="mini" @click.stop="() => remove(data)" icon="el-icon-delete">-->
|
||||||
<!-- </el-button>-->
|
<!-- </el-button>-->
|
||||||
<!-- </el-tooltip>-->
|
<!-- </el-tooltip>-->
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog title="编辑节点" :visible.sync="dialogVisible" width="50%" class="edit">
|
<el-dialog title="编辑节点" :visible.sync="dialogVisible" width="50%" class="edit">
|
||||||
@@ -37,13 +39,13 @@
|
|||||||
<td>主管人员</td>
|
<td>主管人员</td>
|
||||||
<td>
|
<td>
|
||||||
<el-select v-model="form.zgStaffSid" style="width:300px" filterable clearable>
|
<el-select v-model="form.zgStaffSid" style="width:300px" filterable clearable>
|
||||||
<el-option v-for="item in staffdata" :key="item.sid" :label="item.name" :value="item.sid"/>
|
<el-option v-for="item in staffdata" :key="item.sid" :label="item.name" :value="item.sid" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
</td>
|
||||||
<td>分管人员</td>
|
<td>分管人员</td>
|
||||||
<td>
|
<td>
|
||||||
<el-select v-model="fgStaffSid" style="width:300px" filterable multiple>
|
<el-select v-model="fgStaffSid" style="width:300px" filterable multiple>
|
||||||
<el-option v-for="item in staffdata2" :key="item.sid" :label="item.name" :value="item.sid"/>
|
<el-option v-for="item in staffdata2" :key="item.sid" :label="item.name" :value="item.sid" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -56,8 +58,10 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>管理层级</td>
|
<td>管理层级</td>
|
||||||
<td>
|
<td>
|
||||||
<el-select v-model="form.orgLevelValue" style="width:300px" placeholder="请选择" filterable @change="changeOrgLevel">
|
<el-select v-model="form.orgLevelValue" style="width:300px" placeholder="请选择" filterable
|
||||||
<el-option v-for="item in orgLevel_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
|
@change="changeOrgLevel">
|
||||||
|
<el-option v-for="item in orgLevel_list" :key="item.dictKey" :label="item.dictValue"
|
||||||
|
:value="item.dictValue"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
</td>
|
||||||
<td>其他编码</td>
|
<td>其他编码</td>
|
||||||
@@ -73,7 +77,8 @@
|
|||||||
<td>组织属性</td>
|
<td>组织属性</td>
|
||||||
<td>
|
<td>
|
||||||
<el-select v-model="form.orgAttributeValue" placeholder="请选择" filterable @change="changeOrgAttribute">
|
<el-select v-model="form.orgAttributeValue" placeholder="请选择" filterable @change="changeOrgAttribute">
|
||||||
<el-option v-for="item in orgAttribute_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
|
<el-option v-for="item in orgAttribute_list" :key="item.dictKey" :label="item.dictValue"
|
||||||
|
:value="item.dictValue"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -105,6 +110,7 @@
|
|||||||
<el-button @click="dialogVisible = false">返 回</el-button>
|
<el-button @click="dialogVisible = false">返 回</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<div class="org-table" v-show="isshow == 'table'">
|
<div class="org-table" v-show="isshow == 'table'">
|
||||||
<div class="tab-header">
|
<div class="tab-header">
|
||||||
<el-form ref="form" :inline="true" :model="form" label-width="80px">
|
<el-form ref="form" :inline="true" :model="form" label-width="80px">
|
||||||
@@ -133,24 +139,24 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="name" label="组织名称" align="center"></el-table-column>
|
<el-table-column prop="name" label="组织名称" width="120" align="center"></el-table-column>
|
||||||
<el-table-column prop="orgCode" label="组织编码" align="center"></el-table-column>
|
<el-table-column prop="orgCode" label="组织编码" width="110" align="center"></el-table-column>
|
||||||
<!-- <el-table-column prop="zgNames" label="主管" align="center"></el-table-column>-->
|
<el-table-column prop="zgNames" label="主管" width="100" align="center"></el-table-column>
|
||||||
<el-table-column prop="fgNames" label="分管" align="center"></el-table-column>
|
<el-table-column prop="fgNames" label="分管" width="100" align="center"></el-table-column>
|
||||||
<!--<el-table-column prop="contactMan" label="联系人" align="center" width="100px"></el-table-column>-->
|
<el-table-column prop="linkPerson" label="联系人" align="center" width="100px"></el-table-column>
|
||||||
<el-table-column prop="linkPhone" label="联系人手机号" width="110" align="center">
|
<el-table-column prop="linkPhone" label="联系人手机号" width="130" align="center">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="addrs" label="地址" align="center">
|
<el-table-column prop="addrs" label="地址" align="center">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="sort" label="排序" align="center" width="50px">
|
<el-table-column prop="sort" label="排序" align="center" width="80px">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="qrText" label="二维码" align="center" width="80px">
|
<!-- <el-table-column prop="qrText" label="二维码" align="center" width="100px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button @click.native.prevent="lookRow(scope.row)" type="text" size="small">查看</el-button>
|
<el-button @click.native.prevent="lookRow(scope.row)" type="text" size="small">查看</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/>
|
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="org-table" v-show="isshow == 'ewm'">
|
<div class="org-table" v-show="isshow == 'ewm'">
|
||||||
@@ -211,13 +217,13 @@
|
|||||||
<td>主管人员</td>
|
<td>主管人员</td>
|
||||||
<td>
|
<td>
|
||||||
<el-select v-model="form.zgStaffSid" style="width:300px" filterable clearable>
|
<el-select v-model="form.zgStaffSid" style="width:300px" filterable clearable>
|
||||||
<el-option v-for="item in staffdata" :key="item.sid" :label="item.name" :value="item.sid"/>
|
<el-option v-for="item in staffdata" :key="item.sid" :label="item.name" :value="item.sid" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
</td>
|
||||||
<td>分管人员</td>
|
<td>分管人员</td>
|
||||||
<td>
|
<td>
|
||||||
<el-select v-model="fgStaffSid" style="width:300px" filterable multiple>
|
<el-select v-model="fgStaffSid" style="width:300px" filterable multiple>
|
||||||
<el-option v-for="item in staffdata2" :key="item.sid" :label="item.name" :value="item.sid"/>
|
<el-option v-for="item in staffdata2" :key="item.sid" :label="item.name" :value="item.sid" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -230,8 +236,10 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>管理层级</td>
|
<td>管理层级</td>
|
||||||
<td>
|
<td>
|
||||||
<el-select v-model="form.orgLevelValue" style="width:300px" placeholder="请选择" filterable @change="changeOrgLevel">
|
<el-select v-model="form.orgLevelValue" style="width:300px" placeholder="请选择" filterable
|
||||||
<el-option v-for="item in orgLevel_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
|
@change="changeOrgLevel">
|
||||||
|
<el-option v-for="item in orgLevel_list" :key="item.dictKey" :label="item.dictValue"
|
||||||
|
:value="item.dictValue"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
</td>
|
||||||
<td>其他编码</td>
|
<td>其他编码</td>
|
||||||
@@ -247,7 +255,8 @@
|
|||||||
<td>组织属性</td>
|
<td>组织属性</td>
|
||||||
<td>
|
<td>
|
||||||
<el-select v-model="form.orgAttributeValue" placeholder="请选择" filterable @change="changeOrgAttribute">
|
<el-select v-model="form.orgAttributeValue" placeholder="请选择" filterable @change="changeOrgAttribute">
|
||||||
<el-option v-for="item in orgAttribute_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
|
<el-option v-for="item in orgAttribute_list" :key="item.dictKey" :label="item.dictValue"
|
||||||
|
:value="item.dictValue"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -281,380 +290,406 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
addOrgTree,
|
addOrgTree,
|
||||||
delOrgtree,
|
delOrgtree,
|
||||||
getQrCode, getStaff,
|
getQrCode,
|
||||||
getStaffName,
|
getStaff,
|
||||||
orgList,
|
getStaffName,
|
||||||
pageList,
|
orgList,
|
||||||
postOrgtree,
|
pageList,
|
||||||
putOrgtree,
|
postOrgtree,
|
||||||
selectBySid
|
putOrgtree,
|
||||||
} from '@/api/system/departments/departments.js'
|
selectBySid
|
||||||
import { typeValues } from '@/api/system/roleAdminister/index'
|
} from '@/api/system/departments/departments.js'
|
||||||
import Position from '@/components/amap/amap.vue'
|
import {
|
||||||
|
typeValues
|
||||||
|
} from '@/api/system/roleAdminister/index'
|
||||||
|
import Position from '@/components/amap/amap.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { Position },
|
components: {
|
||||||
data() {
|
Position
|
||||||
return {
|
},
|
||||||
dialogVisible: false,
|
data() {
|
||||||
mapDialog: false,
|
return {
|
||||||
dialogTitle: '',
|
dialogVisible: false,
|
||||||
props: {
|
mapDialog: false,
|
||||||
label: 'name',
|
dialogTitle: '',
|
||||||
children: 'children'
|
props: {
|
||||||
},
|
label: 'name',
|
||||||
nodeForm: {
|
children: 'children'
|
||||||
sid: '',
|
},
|
||||||
name: '',
|
nodeForm: {
|
||||||
sortNo: ''
|
sid: '',
|
||||||
},
|
|
||||||
ewmForm: {
|
|
||||||
qrFilePath: '',
|
|
||||||
organizationName: '',
|
|
||||||
departmentName: '',
|
|
||||||
address: ''
|
|
||||||
},
|
|
||||||
orgAttribute_list: [],
|
|
||||||
orgLevel_list: [],
|
|
||||||
form: {
|
|
||||||
sid: '',
|
|
||||||
name: '',
|
|
||||||
orgCode: '',
|
|
||||||
/* jwd: '',*/
|
|
||||||
addrs: '',
|
|
||||||
zgStaffSid: '',
|
|
||||||
zgStaffName: '',
|
|
||||||
fgStaffSid: '',
|
|
||||||
fgStaffName: '',
|
|
||||||
linkPerson: '',
|
|
||||||
linkPhone: '',
|
|
||||||
sort: '',
|
|
||||||
isDept: '',
|
|
||||||
orgAbbre: '',
|
|
||||||
orgAttributeValue: '',
|
|
||||||
orgAttributeKey: '',
|
|
||||||
orgLevelValue: '',
|
|
||||||
orgLevelKey: '',
|
|
||||||
otherCode: ''
|
|
||||||
},
|
|
||||||
fgStaffSid: [],
|
|
||||||
formBackup: Object.assign({}, this.form),
|
|
||||||
isshow: 'table',
|
|
||||||
page: {
|
|
||||||
total: 0, // 默认数据总数
|
|
||||||
current: 1, // 默认开始页面
|
|
||||||
size: 10, // 每页的数据条数
|
|
||||||
params: {
|
|
||||||
name: '',
|
name: '',
|
||||||
organizationSid: '',
|
sortNo: ''
|
||||||
psid: ''
|
},
|
||||||
|
ewmForm: {
|
||||||
|
qrFilePath: '',
|
||||||
|
organizationName: '',
|
||||||
|
departmentName: '',
|
||||||
|
address: ''
|
||||||
|
},
|
||||||
|
orgAttribute_list: [],
|
||||||
|
orgLevel_list: [],
|
||||||
|
form: {
|
||||||
|
sid: '',
|
||||||
|
name: '',
|
||||||
|
orgCode: '',
|
||||||
|
/* jwd: '',*/
|
||||||
|
addrs: '',
|
||||||
|
zgStaffSid: '',
|
||||||
|
zgStaffName: '',
|
||||||
|
fgStaffSid: '',
|
||||||
|
fgStaffName: '',
|
||||||
|
linkPerson: '',
|
||||||
|
linkPhone: '',
|
||||||
|
sort: '',
|
||||||
|
isDept: '',
|
||||||
|
orgAbbre: '',
|
||||||
|
orgAttributeValue: '',
|
||||||
|
orgAttributeKey: '',
|
||||||
|
orgLevelValue: '',
|
||||||
|
orgLevelKey: '',
|
||||||
|
otherCode: ''
|
||||||
|
},
|
||||||
|
fgStaffSid: [],
|
||||||
|
formBackup: Object.assign({}, this.form),
|
||||||
|
isshow: 'table',
|
||||||
|
page: {
|
||||||
|
total: 0, // 默认数据总数
|
||||||
|
current: 1, // 默认开始页面
|
||||||
|
size: 10, // 每页的数据条数
|
||||||
|
params: {
|
||||||
|
name: '',
|
||||||
|
organizationSid: '',
|
||||||
|
psid: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableData: [],
|
||||||
|
treedata: [],
|
||||||
|
staffdata: [],
|
||||||
|
staffdata2: [],
|
||||||
|
rules: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getOrgTree()
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
typeValues({
|
||||||
|
type: 'orgAttribute'
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.orgAttribute_list = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
typeValues({
|
||||||
|
type: 'orgLevel'
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.orgLevel_list = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeOrgLevel(value) {
|
||||||
|
let bb = null
|
||||||
|
this.orgLevel_list.forEach((e) => {
|
||||||
|
if (e.dictValue === value) {
|
||||||
|
bb = {
|
||||||
|
value: e.dictValue,
|
||||||
|
key: e.dictKey
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.form.orgLevelValue = bb.value
|
||||||
|
this.form.orgLevelKey = bb.key
|
||||||
|
},
|
||||||
|
changeOrgAttribute(value) {
|
||||||
|
let bb = null
|
||||||
|
this.orgAttribute_list.forEach((e) => {
|
||||||
|
if (e.dictValue === value) {
|
||||||
|
bb = {
|
||||||
|
key: e.dictKey,
|
||||||
|
value: e.dictValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.form.orgAttributeKey = bb.key
|
||||||
|
},
|
||||||
|
pagination(val) { // 分页
|
||||||
|
this.page.current = val.pageNum
|
||||||
|
this.page.size = val.pageSize
|
||||||
|
this.getPageList(this.page)
|
||||||
|
},
|
||||||
|
handleNodeClick(data) {
|
||||||
|
this.isshow = 'table'
|
||||||
|
// this.page.params.organizationSid = this.$store.getters.userInfo.orgSid
|
||||||
|
this.page.params.organizationSid = window.sessionStorage.getItem('orgSid')
|
||||||
|
this.page.params.psid = data.sid || 0
|
||||||
|
|
||||||
|
this.getPageList(this.page)
|
||||||
|
},
|
||||||
|
getPageList(data) { // 获取树形列表
|
||||||
|
pageList(data).then(res => {
|
||||||
|
console.log('返回子级:', res)
|
||||||
|
this.tableData = res.data.records
|
||||||
|
this.page.total = res.data.total
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getOrgTree() { // 获取树形列表
|
||||||
|
orgList(window.sessionStorage.getItem('orgSid')).then(res => {
|
||||||
|
this.treedata = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
save() {
|
||||||
|
if (this.fgStaffSid.length > 0) {
|
||||||
|
this.form.fgStaffSid = this.fgStaffSid.join()
|
||||||
|
} else {
|
||||||
|
this.form.fgStaffName = ''
|
||||||
|
this.form.fgStaffSid = ''
|
||||||
|
}
|
||||||
|
// this.form.organizationSid = this.$store.getters.userInfo.orgSid
|
||||||
|
this.form.organizationSid = window.sessionStorage.getItem('orgSid')
|
||||||
|
// this.form.dlxx = typeof(this.form.dlxx) == 'string' ? this.form.dlxx : this.form.dlxx.join()
|
||||||
|
if (this.form.sid) {
|
||||||
|
// console.log(this.form)
|
||||||
|
putOrgtree(this.form).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.isshow = 'table'
|
||||||
|
this.getOrgTree()
|
||||||
|
this.handleNodeClick({
|
||||||
|
sid: this.form.psid
|
||||||
|
})
|
||||||
|
this.$message({
|
||||||
|
message: res.msg,
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addOrgTree(this.form).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.isshow = 'table'
|
||||||
|
this.getOrgTree()
|
||||||
|
this.handleNodeClick({
|
||||||
|
sid: this.form.psid
|
||||||
|
})
|
||||||
|
this.$message({
|
||||||
|
message: res.msg,
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tableData: [],
|
append(data) {
|
||||||
treedata: [],
|
console.log(123456789, data)
|
||||||
staffdata: [],
|
this.dialogTitle = '新增'
|
||||||
staffdata2: [],
|
this.isshow = 'edit'
|
||||||
rules: {}
|
this.fgStaffSid = []
|
||||||
}
|
this.form = Object.assign({}, this.formBackup)
|
||||||
},
|
this.form.psid = data.sid || 0
|
||||||
mounted() {
|
// this.form.organizationSid = this.$store.getters.userInfo.orgSid
|
||||||
this.getOrgTree()
|
this.form.organizationSid = window.sessionStorage.getItem('orgSid')
|
||||||
this.init()
|
this.form.address = data.orgAddress || data.address
|
||||||
},
|
this.form.dlxx = data.gisInfo || data.dlxx
|
||||||
methods: {
|
this.getStaff(data.sid)
|
||||||
init() {
|
this.getStaff2(data.sid)
|
||||||
typeValues({ type: 'orgAttribute' }).then((res) => {
|
},
|
||||||
if (res.success) {
|
editRow(row) {
|
||||||
this.orgAttribute_list = res.data
|
this.getStaff(row.sid)
|
||||||
}
|
this.getStaff2(row.sid)
|
||||||
})
|
this.dialogTitle = '编辑'
|
||||||
typeValues({ type: 'orgLevel' }).then((res) => {
|
this.isshow = 'edit'
|
||||||
if (res.success) {
|
this.fgStaffSid = []
|
||||||
this.orgLevel_list = res.data
|
selectBySid(row.sid).then((response) => {
|
||||||
}
|
if (response.success) {
|
||||||
})
|
this.form = response.data
|
||||||
},
|
this.form.fgStaffName = response.data.fgNames
|
||||||
changeOrgLevel(value) {
|
this.form.fgStaffSid = response.data.fgStaffSid
|
||||||
let bb = null
|
if (this.form.fgStaffSid) {
|
||||||
this.orgLevel_list.forEach((e) => {
|
this.fgStaffSid = response.data.fgStaffSid.split(',')
|
||||||
if (e.dictValue === value) {
|
}
|
||||||
bb = {
|
this.form.zgStaffName = response.data.zgNames
|
||||||
value: e.dictValue,
|
this.form.zgStaffSid = response.data.zgStaffSid
|
||||||
key: e.dictKey
|
console.log('编辑回显的数据', this.form)
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.form.orgLevelValue = bb.value
|
|
||||||
this.form.orgLevelKey = bb.key
|
|
||||||
},
|
|
||||||
changeOrgAttribute(value) {
|
|
||||||
let bb = null
|
|
||||||
this.orgAttribute_list.forEach((e) => {
|
|
||||||
if (e.dictValue === value) {
|
|
||||||
bb = {
|
|
||||||
key: e.dictKey,
|
|
||||||
value: e.dictValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.form.orgAttributeKey = bb.key
|
|
||||||
},
|
|
||||||
pagination(val) { // 分页
|
|
||||||
this.page.current = val.pageNum
|
|
||||||
this.page.size = val.pageSize
|
|
||||||
this.getPageList(this.page)
|
|
||||||
},
|
|
||||||
handleNodeClick(data) {
|
|
||||||
this.isshow = 'table'
|
|
||||||
this.page.params.organizationSid = this.$store.getters.userInfo.orgSid
|
|
||||||
this.page.params.psid = data.sid || 0
|
|
||||||
|
|
||||||
this.getPageList(this.page)
|
|
||||||
},
|
|
||||||
getPageList(data) { // 获取树形列表
|
|
||||||
pageList(data).then(res => {
|
|
||||||
console.log('返回子级:',res)
|
|
||||||
this.tableData = res.data.records
|
|
||||||
this.page.total = res.data.total
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getOrgTree() { // 获取树形列表
|
|
||||||
orgList({}).then(res => {
|
|
||||||
this.treedata = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
save() {
|
|
||||||
if (this.fgStaffSid.length > 0) {
|
|
||||||
this.form.fgStaffSid = this.fgStaffSid.join()
|
|
||||||
} else {
|
|
||||||
this.form.fgStaffName = ''
|
|
||||||
this.form.fgStaffSid = ''
|
|
||||||
}
|
|
||||||
this.form.organizationSid = this.$store.getters.userInfo.orgSid
|
|
||||||
// this.form.dlxx = typeof(this.form.dlxx) == 'string' ? this.form.dlxx : this.form.dlxx.join()
|
|
||||||
if (this.form.sid) {
|
|
||||||
// console.log(this.form)
|
|
||||||
putOrgtree(this.form).then(res => {
|
|
||||||
if (res.success) {
|
|
||||||
this.isshow = 'table'
|
|
||||||
this.getOrgTree()
|
|
||||||
this.handleNodeClick({ sid: this.form.psid })
|
|
||||||
this.$message({
|
|
||||||
message: res.msg,
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
},
|
||||||
addOrgTree(this.form).then(res => {
|
deit(data) { // 节点编辑保存
|
||||||
if (res.success) {
|
this.getStaff(data.sid)
|
||||||
this.isshow = 'table'
|
this.getStaff2(data.sid)
|
||||||
this.getOrgTree()
|
console.log(data, 8888)
|
||||||
this.handleNodeClick({ sid: this.form.psid })
|
this.dialogVisible = true
|
||||||
this.$message({
|
this.form.sid = data.sid
|
||||||
message: res.msg,
|
// this.form.psid = null
|
||||||
type: 'success'
|
this.form.name = data.name
|
||||||
})
|
this.form.orgCode = data.orgCode
|
||||||
}
|
/* this.form.jwd = data.jwd*/
|
||||||
})
|
this.form.addrs = data.addrs
|
||||||
}
|
this.form.linkPerson = data.linkPerson
|
||||||
},
|
this.form.linkPhone = data.linkPhone
|
||||||
append(data) {
|
this.form.sort = data.sort
|
||||||
console.log(123456789, data)
|
this.form.zgStaffSid = data.zgSids
|
||||||
this.dialogTitle = '新增'
|
this.form.fgStaffSid = data.fgSids.split(',')
|
||||||
this.isshow = 'edit'
|
},
|
||||||
this.fgStaffSid = []
|
nodeSave() { // 节点编辑保存
|
||||||
this.form = Object.assign({}, this.formBackup)
|
console.log('这是保存nodeSave(0')
|
||||||
this.form.psid = data.sid || 0
|
this.form.fgStaffSid = this.form.fgStaffSid.join()
|
||||||
this.form.organizationSid = this.$store.getters.userInfo.orgSid
|
postOrgtree(this.form).then(res => {
|
||||||
this.form.address = data.orgAddress || data.address
|
|
||||||
this.form.dlxx = data.gisInfo || data.dlxx
|
|
||||||
this.getStaff(data.sid)
|
|
||||||
this.getStaff2(data.sid)
|
|
||||||
},
|
|
||||||
editRow(row) {
|
|
||||||
this.getStaff(row.sid)
|
|
||||||
this.getStaff2(row.sid)
|
|
||||||
this.dialogTitle = '编辑'
|
|
||||||
this.isshow = 'edit'
|
|
||||||
this.fgStaffSid = []
|
|
||||||
selectBySid(row.sid).then((response) => {
|
|
||||||
if (response.success) {
|
|
||||||
this.form = response.data
|
|
||||||
this.form.fgStaffName = response.data.fgNames
|
|
||||||
this.form.fgStaffSid = response.data.fgStaffSid
|
|
||||||
if (this.form.fgStaffSid) {
|
|
||||||
this.fgStaffSid = response.data.fgStaffSid.split(',')
|
|
||||||
}
|
|
||||||
this.form.zgStaffName = response.data.zgNames
|
|
||||||
this.form.zgStaffSid = response.data.zgStaffSid
|
|
||||||
console.log('编辑回显的数据', this.form)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
deit(data) { // 节点编辑保存
|
|
||||||
this.getStaff(data.sid)
|
|
||||||
this.getStaff2(data.sid)
|
|
||||||
console.log(data, 8888)
|
|
||||||
this.dialogVisible = true
|
|
||||||
this.form.sid = data.sid
|
|
||||||
// this.form.psid = null
|
|
||||||
this.form.name = data.name
|
|
||||||
this.form.orgCode = data.orgCode
|
|
||||||
/* this.form.jwd = data.jwd*/
|
|
||||||
this.form.addrs = data.addrs
|
|
||||||
this.form.linkPerson = data.linkPerson
|
|
||||||
this.form.linkPhone = data.linkPhone
|
|
||||||
this.form.sort = data.sort
|
|
||||||
this.form.zgStaffSid = data.zgSids
|
|
||||||
this.form.fgStaffSid = data.fgSids.split(',')
|
|
||||||
},
|
|
||||||
nodeSave() { // 节点编辑保存
|
|
||||||
console.log('这是保存nodeSave(0')
|
|
||||||
this.form.fgStaffSid = this.form.fgStaffSid.join()
|
|
||||||
postOrgtree(this.form).then(res => {
|
|
||||||
this.getOrgTree()
|
|
||||||
this.dialogVisible = false
|
|
||||||
this.$message({
|
|
||||||
message: res.msg,
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
remove(data) {
|
|
||||||
this.$confirm('确定要删除该组织吗, 是否继续?', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
delOrgtree({ sid: data.sid }).then(res => {
|
|
||||||
this.getOrgTree()
|
this.getOrgTree()
|
||||||
this.handleNodeClick({ sid: data.psid })
|
this.dialogVisible = false
|
||||||
this.$message({
|
this.$message({
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
},
|
||||||
},
|
remove(data) {
|
||||||
lookRow(row) { // 查看二维码
|
this.$confirm('确定要删除该组织吗, 是否继续?', '提示', {
|
||||||
this.isshow = 'ewm'
|
confirmButtonText: '确定',
|
||||||
getQrCode({ sid: row.sid }).then(res => {
|
cancelButtonText: '取消',
|
||||||
this.ewmForm = res.data
|
type: 'warning'
|
||||||
})
|
}).then(() => {
|
||||||
},
|
delOrgtree({
|
||||||
Printewm() {
|
sid: data.sid
|
||||||
this.$print(this.$refs.print) // 使用
|
}).then(res => {
|
||||||
},
|
this.getOrgTree()
|
||||||
mouseenter(data) {
|
this.handleNodeClick({
|
||||||
this.$set(data, 'del', true)
|
sid: data.psid
|
||||||
},
|
})
|
||||||
mouseleave(data) {
|
this.$message({
|
||||||
this.$set(data, 'del', false)
|
message: res.msg,
|
||||||
},
|
type: 'success'
|
||||||
onSearch() {
|
})
|
||||||
this.getPageList(this.page)
|
})
|
||||||
},
|
})
|
||||||
resetSearch() {
|
},
|
||||||
this.page.params.name = ''
|
lookRow(row) { // 查看二维码
|
||||||
this.getPageList(this.page)
|
this.isshow = 'ewm'
|
||||||
},
|
getQrCode({
|
||||||
// 主管人员
|
sid: row.sid
|
||||||
getStaff(orgSid) {
|
}).then(res => {
|
||||||
getStaff({ deptSid: orgSid }).then((res) => {
|
this.ewmForm = res.data
|
||||||
if (res.success) {
|
})
|
||||||
this.staffdata = res.data
|
},
|
||||||
}
|
Printewm() {
|
||||||
})
|
this.$print(this.$refs.print) // 使用
|
||||||
},
|
},
|
||||||
// 分管人员
|
mouseenter(data) {
|
||||||
getStaff2(orgSid) {
|
this.$set(data, 'del', true)
|
||||||
getStaffName({ deptSid: orgSid }).then(res => {
|
},
|
||||||
this.staffdata2 = res.data
|
mouseleave(data) {
|
||||||
console.log('分管人员', this.staffdata2)
|
this.$set(data, 'del', false)
|
||||||
})
|
},
|
||||||
|
onSearch() {
|
||||||
|
this.getPageList(this.page)
|
||||||
|
},
|
||||||
|
resetSearch() {
|
||||||
|
this.page.params.name = ''
|
||||||
|
this.getPageList(this.page)
|
||||||
|
},
|
||||||
|
// 主管人员
|
||||||
|
getStaff(orgSid) {
|
||||||
|
getStaff({
|
||||||
|
deptSid: orgSid
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.staffdata = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 分管人员
|
||||||
|
getStaff2(orgSid) {
|
||||||
|
getStaffName({
|
||||||
|
deptSid: orgSid
|
||||||
|
}).then(res => {
|
||||||
|
this.staffdata2 = res.data
|
||||||
|
console.log('分管人员', this.staffdata2)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.el-icon-arrow-right:before {
|
.el-icon-arrow-right:before {
|
||||||
content: '\e6e0';
|
content: '\e6e0';
|
||||||
color: #727272;
|
color: #727272;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style scoped="scoped" lang="scss">
|
<style scoped="scoped" lang="scss">
|
||||||
.org-tree {
|
.org-tree {
|
||||||
width: 240px;
|
width: 240px;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
/*padding-right: 10px;*/
|
/*padding-right: 10px;*/
|
||||||
border: 1px solid #edf1f7;
|
border: 1px solid #edf1f7;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
}
|
|
||||||
|
|
||||||
.org-table {
|
|
||||||
flex: 1;
|
|
||||||
// padding-left: 10px;
|
|
||||||
margin: 0 10px;
|
|
||||||
border: 1px solid #edf1f7;
|
|
||||||
min-height: 100%;
|
|
||||||
overflow-y: scroll;
|
|
||||||
|
|
||||||
.ewm {
|
|
||||||
margin: 30px auto 0;
|
|
||||||
width: 560px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.ediut {
|
.org-table {
|
||||||
margin: 30px auto 0;
|
flex: 1;
|
||||||
/*width:750px;*/
|
// padding-left: 10px;
|
||||||
}
|
margin: 0 10px;
|
||||||
}
|
border: 1px solid #edf1f7;
|
||||||
|
min-height: 100%;
|
||||||
|
overflow-y: scroll;
|
||||||
|
|
||||||
.custom-tree-node {
|
.ewm {
|
||||||
position: relative;
|
margin: 30px auto 0;
|
||||||
overflow: hidden;
|
width: 560px;
|
||||||
width: 100%;
|
}
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
font-size: 14px;
|
|
||||||
padding-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.handle {
|
.ediut {
|
||||||
position: absolute;
|
margin: 30px auto 0;
|
||||||
right: 0;
|
/*width:750px;*/
|
||||||
|
}
|
||||||
.el-button--text {
|
|
||||||
font-size: 15px;
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.my-tabs {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.edit {
|
|
||||||
.el-form-item__label {
|
|
||||||
width: 100px !important;
|
|
||||||
display: inline-block !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-input {
|
.custom-tree-node {
|
||||||
width: 70%;
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 14px;
|
||||||
|
padding-right: 8px;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.td_left {
|
.handle {
|
||||||
border-left: 0 solid #e6e9f0;
|
position: absolute;
|
||||||
}
|
right: 0;
|
||||||
|
|
||||||
|
.el-button--text {
|
||||||
|
font-size: 15px;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-tabs {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100px !important;
|
||||||
|
display: inline-block !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-input {
|
||||||
|
width: 70%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.td_left {
|
||||||
|
border-left: 0 solid #e6e9f0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -42,18 +42,16 @@
|
|||||||
<el-table-column prop="postLevel" label="职级" align="center"></el-table-column>
|
<el-table-column prop="postLevel" label="职级" align="center"></el-table-column>
|
||||||
<!-- <el-table-column prop="orgName" label="所属部门" align="center"></el-table-column> -->
|
<!-- <el-table-column prop="orgName" label="所属部门" align="center"></el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/>
|
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination" />
|
||||||
|
|
||||||
<!-- 编辑岗位信息 -->
|
<!-- 编辑岗位信息 -->
|
||||||
<el-dialog :title="dialogTitle + '岗位信息'" :visible.sync="editDialog" width="40%">
|
<el-dialog :title="dialogTitle + '岗位信息'" :visible.sync="editDialog" width="40%">
|
||||||
<table class="e-table" cellspacing="0">
|
<table class="e-table" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td>上级岗位</td>
|
<td>上级岗位</td>
|
||||||
<td> <!-- @change="changeParentSid" -->
|
<td> <!-- @change="changeParentSid" -->
|
||||||
<el-select v-model="roleForm.parentSid" filterable clearable placeholder="请选择"
|
<el-select v-model="roleForm.parentSid" filterable clearable placeholder="请选择" style="width:300px">
|
||||||
style="width:300px">
|
<el-option v-for="item in parentSidList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||||
<el-option v-for="item in parentSidList" :key="item.sid" :label="item.name"
|
|
||||||
:value="item.sid">
|
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
</td>
|
||||||
@@ -67,14 +65,16 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>岗位职级</td>
|
<td>岗位职级</td>
|
||||||
<td>
|
<td>
|
||||||
<el-select v-model="roleForm.postLevel" @change="changeUPpostLevel" filterable placeholder="请选择" style="width:300px">
|
<el-select v-model="roleForm.postLevel" @change="changeUPpostLevel" filterable placeholder="请选择"
|
||||||
<el-option v-for="item in postLevelList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey">
|
style="width:300px">
|
||||||
</el-option>
|
<el-option v-for="item in postLevelList" :key="item.dictKey" :label="item.dictValue"
|
||||||
|
:value="item.dictKey">
|
||||||
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>岗位编码</td>
|
<td>岗位编码</td>
|
||||||
<td>
|
<td>
|
||||||
<el-input v-model="roleForm.postCode" style="width:300px"></el-input>
|
<el-input v-model="roleForm.postCode" style="width:300px"></el-input>
|
||||||
</td>
|
</td>
|
||||||
@@ -116,11 +116,9 @@
|
|||||||
<table class="e-table" cellspacing="0">
|
<table class="e-table" cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td>上级岗位</td>
|
<td>上级岗位</td>
|
||||||
<td> <!-- @change="changeParentSid" -->
|
<td> <!-- @change="changeParentSid" -->
|
||||||
<el-select v-model="roleForm.parentSid" filterable clearable placeholder="请选择"
|
<el-select v-model="roleForm.parentSid" filterable clearable placeholder="请选择" style="width:300px">
|
||||||
style="width:300px">
|
<el-option v-for="item in parentSidList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||||
<el-option v-for="item in parentSidList" :key="item.sid" :label="item.name"
|
|
||||||
:value="item.sid">
|
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
</td>
|
||||||
@@ -135,9 +133,9 @@
|
|||||||
<td>岗位职级</td>
|
<td>岗位职级</td>
|
||||||
<td>
|
<td>
|
||||||
<el-select v-model="roleForm.postLevel" @change="changePostLevel" filterable placeholder="请选择"
|
<el-select v-model="roleForm.postLevel" @change="changePostLevel" filterable placeholder="请选择"
|
||||||
style="width:300px">
|
style="width:300px">
|
||||||
<el-option v-for="item in postLevelList" :key="item.dictKey" :label="item.dictValue"
|
<el-option v-for="item in postLevelList" :key="item.dictKey" :label="item.dictValue"
|
||||||
:value="item.dictKey">
|
:value="item.dictKey">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
</td>
|
||||||
@@ -179,30 +177,38 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {delOrgroles, orgList, pageList, pullDown, putOrgroles, savePost,selectList} from '@/api/system/postManage/index.js'
|
import {
|
||||||
|
delOrgroles,
|
||||||
|
orgList,
|
||||||
|
pageList,
|
||||||
|
pullDown,
|
||||||
|
putOrgroles,
|
||||||
|
savePost,
|
||||||
|
selectList
|
||||||
|
} from '@/api/system/postManage/index.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogTitle: '',
|
dialogTitle: '',
|
||||||
activeName: 'roleList',
|
activeName: 'roleList',
|
||||||
roleForm: {
|
roleForm: {
|
||||||
remarks: "",
|
remarks: "",
|
||||||
roleName: "",
|
roleName: "",
|
||||||
postCode: '',
|
postCode: '',
|
||||||
orgSid: '',
|
orgSid: '',
|
||||||
postLevel: '',
|
postLevel: '',
|
||||||
postLevelKey: '',
|
postLevelKey: '',
|
||||||
parentSid:''
|
parentSid: ''
|
||||||
},
|
},
|
||||||
formBackup: {},
|
formBackup: {},
|
||||||
search: {
|
search: {
|
||||||
name: '',
|
name: '',
|
||||||
orgSid: ''
|
orgSid: window.sessionStorage.getItem('orgSid')
|
||||||
},
|
},
|
||||||
orgName: '',
|
orgName: '',
|
||||||
page: {
|
page: {
|
||||||
total: 0, // 默认数据总数
|
total: 0, // 默认数据总数
|
||||||
current: 1, // 默认开始页面
|
current: 1, // 默认开始页面
|
||||||
size: 10, // 每页的数据条数
|
size: 10, // 每页的数据条数
|
||||||
},
|
},
|
||||||
@@ -214,25 +220,25 @@ export default {
|
|||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name'
|
label: 'name'
|
||||||
},
|
},
|
||||||
// orgdata:[], // 部门
|
// orgdata:[], // 部门
|
||||||
checkedId: [],
|
checkedId: [],
|
||||||
checkedId1: [],
|
checkedId1: [],
|
||||||
checkedId2: [],
|
checkedId2: [],
|
||||||
treedata: [],
|
treedata: [],
|
||||||
treedata1: [],
|
treedata1: [],
|
||||||
treedata2: [],
|
treedata2: [],
|
||||||
postLevelList: [],
|
postLevelList: [],
|
||||||
parentSidList: [],
|
parentSidList: [],
|
||||||
// chace: [],
|
// chace: [],
|
||||||
// roleDialog: false,
|
// roleDialog: false,
|
||||||
// Thisrow: {},
|
// Thisrow: {},
|
||||||
// orgListAll:[]
|
// orgListAll:[]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.formBackup = Object.assign({}, this.roleForm),
|
this.formBackup = Object.assign({}, this.roleForm),
|
||||||
this.getList()
|
this.getList()
|
||||||
this.getOrgList()
|
// this.getOrgList()
|
||||||
this.postLevel()
|
this.postLevel()
|
||||||
this.getParent()
|
this.getParent()
|
||||||
},
|
},
|
||||||
@@ -254,21 +260,24 @@ export default {
|
|||||||
this.roleTable = res.data.records
|
this.roleTable = res.data.records
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
postLevel(){
|
postLevel() {
|
||||||
pullDown({ psid: 0, type: 'postLevel' }).then((res)=>{
|
pullDown({
|
||||||
if(res.code==='200'){
|
psid: 0,
|
||||||
this.postLevelList=res.data
|
type: 'postLevel'
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code === '200') {
|
||||||
|
this.postLevelList = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getParent(){
|
getParent() {
|
||||||
selectList().then((res)=>{
|
selectList().then((res) => {
|
||||||
if(res.code==='200'){
|
if (res.code === '200') {
|
||||||
this.parentSidList=res.data
|
this.parentSidList = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
changePostLevel(value){
|
changePostLevel(value) {
|
||||||
let bb = null
|
let bb = null
|
||||||
this.postLevelList.forEach((e) => {
|
this.postLevelList.forEach((e) => {
|
||||||
if (e.dictKey == value) {
|
if (e.dictKey == value) {
|
||||||
@@ -278,10 +287,10 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.roleForm.postLevel=bb.name
|
this.roleForm.postLevel = bb.name
|
||||||
this.roleForm.postLevelKey=bb.value
|
this.roleForm.postLevelKey = bb.value
|
||||||
},
|
},
|
||||||
changeUPpostLevel(value){
|
changeUPpostLevel(value) {
|
||||||
let bb = null
|
let bb = null
|
||||||
this.postLevelList.forEach((e) => {
|
this.postLevelList.forEach((e) => {
|
||||||
if (e.dictKey == value) {
|
if (e.dictKey == value) {
|
||||||
@@ -291,8 +300,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.roleForm.postLevel=bb.name
|
this.roleForm.postLevel = bb.name
|
||||||
this.roleForm.postLevelKey=bb.value
|
this.roleForm.postLevelKey = bb.value
|
||||||
},
|
},
|
||||||
handleClick(tab, event) {
|
handleClick(tab, event) {
|
||||||
if (tab.name == 'addrole') {
|
if (tab.name == 'addrole') {
|
||||||
@@ -359,6 +368,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.reset()
|
this.reset()
|
||||||
|
this.getParent()
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
this.roleForm = {
|
this.roleForm = {
|
||||||
@@ -376,76 +386,76 @@ export default {
|
|||||||
getOrgList(row) {
|
getOrgList(row) {
|
||||||
this.roleDialog = true
|
this.roleDialog = true
|
||||||
this.checkedId = []
|
this.checkedId = []
|
||||||
// this.roleForm.roleName = row.roleName
|
// this.roleForm.roleName = row.roleName
|
||||||
this.Thisrow = row
|
this.Thisrow = row
|
||||||
this.loading = true
|
this.loading = true
|
||||||
let params = {
|
let params = {
|
||||||
// roleSid: row.sid,
|
// roleSid: row.sid,
|
||||||
// userType: '2'
|
// userType: '2'
|
||||||
}
|
}
|
||||||
|
|
||||||
orgList(params).then(res => {
|
orgList(params).then(res => {
|
||||||
this.treedata = res.data
|
this.treedata = res.data
|
||||||
this.treedata1 = res.data
|
this.treedata1 = res.data
|
||||||
this.treedata2 = res.data
|
this.treedata2 = res.data
|
||||||
// this.getTreeParentNode(res.data, this.checkedId)
|
// this.getTreeParentNode(res.data, this.checkedId)
|
||||||
// this.getTreeParentid(res.data)
|
// this.getTreeParentid(res.data)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
// // 递归查询所有上级数据
|
// // 递归查询所有上级数据
|
||||||
// getTreeParentNode(menus, ids) {
|
// getTreeParentNode(menus, ids) {
|
||||||
// for (var i = 0; i < menus.length; i++) {
|
// for (var i = 0; i < menus.length; i++) {
|
||||||
// if (menus[i].children && menus[i].children.length != 0) {
|
// if (menus[i].children && menus[i].children.length != 0) {
|
||||||
// this.getTreeParentNode(menus[i].children, ids)
|
// this.getTreeParentNode(menus[i].children, ids)
|
||||||
// } else if (menus[i].isCheck) {
|
// } else if (menus[i].isCheck) {
|
||||||
// ids.push(menus[i].sid)
|
// ids.push(menus[i].sid)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
// // 所有一级菜单ID
|
// // 所有一级菜单ID
|
||||||
// getTreeParentid(menus) {
|
// getTreeParentid(menus) {
|
||||||
// for (var i = 0; i < menus.length; i++) {
|
// for (var i = 0; i < menus.length; i++) {
|
||||||
// this.chace.push(menus[i].sid)
|
// this.chace.push(menus[i].sid)
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
// getCheckedKeys() {
|
// getCheckedKeys() {
|
||||||
// let _this = this
|
// let _this = this
|
||||||
// let roleMenus = []
|
// let roleMenus = []
|
||||||
// this.$refs.Tree.getCheckedKeys().forEach(val => {
|
// this.$refs.Tree.getCheckedKeys().forEach(val => {
|
||||||
// roleMenus.push({
|
// roleMenus.push({
|
||||||
// menuSid: val,
|
// menuSid: val,
|
||||||
// orgSid: _this.$store.getters.userInfo.orgSid,
|
// orgSid: _this.$store.getters.userInfo.orgSid,
|
||||||
// roleSid: _this.Thisrow.sid
|
// roleSid: _this.Thisrow.sid
|
||||||
// })
|
// })
|
||||||
// })
|
// })
|
||||||
// let parentTrue = this.$refs.Tree.getHalfCheckedKeys()
|
// let parentTrue = this.$refs.Tree.getHalfCheckedKeys()
|
||||||
// for (let i = 0; i < parentTrue.length; i++) {
|
// for (let i = 0; i < parentTrue.length; i++) {
|
||||||
// for (let j = 0; j < this.chace.length; j++) {
|
// for (let j = 0; j < this.chace.length; j++) {
|
||||||
// if (parentTrue[i] == this.chace[j]) {
|
// if (parentTrue[i] == this.chace[j]) {
|
||||||
// parentTrue.splice(i, 1);
|
// parentTrue.splice(i, 1);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// parentTrue.forEach(val => {
|
// parentTrue.forEach(val => {
|
||||||
// roleMenus.push({
|
// roleMenus.push({
|
||||||
// menuSid: val,
|
// menuSid: val,
|
||||||
// orgSid: _this.$store.getters.userInfo.orgSid,
|
// orgSid: _this.$store.getters.userInfo.orgSid,
|
||||||
// roleSid: _this.Thisrow.sid
|
// roleSid: _this.Thisrow.sid
|
||||||
// })
|
// })
|
||||||
// })
|
// })
|
||||||
// saveorgrolemenus({
|
// saveorgrolemenus({
|
||||||
// roleSid: _this.Thisrow.sid,
|
// roleSid: _this.Thisrow.sid,
|
||||||
// roleMenus: roleMenus
|
// roleMenus: roleMenus
|
||||||
// }).then(res => {
|
// }).then(res => {
|
||||||
// this.roleDialog = false
|
// this.roleDialog = false
|
||||||
// this.$message({
|
// this.$message({
|
||||||
// message: res.msg,
|
// message: res.msg,
|
||||||
// type: 'success'
|
// type: 'success'
|
||||||
// })
|
// })
|
||||||
// })
|
// })
|
||||||
// },
|
// },
|
||||||
checkchange(data, checked, indeterminate) {
|
checkchange(data, checked, indeterminate) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
|
|
||||||
@@ -461,7 +471,7 @@ export default {
|
|||||||
checkchange1(data, checked, indeterminate) {
|
checkchange1(data, checked, indeterminate) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
this.roleForm.orgSid = data.sid
|
this.roleForm.orgSid = data.sid
|
||||||
// this.orgName = data.name
|
// this.orgName = data.name
|
||||||
let arr = []
|
let arr = []
|
||||||
arr = [data.sid];
|
arr = [data.sid];
|
||||||
this.$refs.Tree1.setCheckedKeys(arr);
|
this.$refs.Tree1.setCheckedKeys(arr);
|
||||||
@@ -471,7 +481,7 @@ export default {
|
|||||||
checkchange2(data, checked, indeterminate) {
|
checkchange2(data, checked, indeterminate) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
this.roleForm.orgSid = data.sid
|
this.roleForm.orgSid = data.sid
|
||||||
// this.orgName = data.name
|
// this.orgName = data.name
|
||||||
let arr = []
|
let arr = []
|
||||||
arr = [data.sid];
|
arr = [data.sid];
|
||||||
this.$refs.Tree2.setCheckedKeys(arr);
|
this.$refs.Tree2.setCheckedKeys(arr);
|
||||||
@@ -490,7 +500,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-select > .el-input {
|
.el-select>.el-input {
|
||||||
display: block;
|
display: block;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -4,9 +4,9 @@
|
|||||||
<el-tab-pane label="用户列表" name="roleList">
|
<el-tab-pane label="用户列表" name="roleList">
|
||||||
<user-manage-list :dataObj='dataObj' @status='isShow' @item='listObj'></user-manage-list>
|
<user-manage-list :dataObj='dataObj' @status='isShow' @item='listObj'></user-manage-list>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- <el-tab-pane label="新增用户" name="addrole">
|
<el-tab-pane label="新增用户" name="addrole">
|
||||||
<user-manage-add @status='isShow' :dataObj='childObj'></user-manage-add>
|
<user-manage-add @status='isShow' :dataObj='childObj'></user-manage-add>
|
||||||
</el-tab-pane>-->
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -37,9 +37,9 @@
|
|||||||
handleClick(tab, event) {
|
handleClick(tab, event) {
|
||||||
if (tab.name == 'addrole') {
|
if (tab.name == 'addrole') {
|
||||||
this.dialogTitle = '新增'
|
this.dialogTitle = '新增'
|
||||||
// this.roleForm = Object.assign({}, this.formBackup)
|
// this.roleForm = Object.assign({}, this.formBackup)
|
||||||
} else {
|
} else {
|
||||||
// this.getroleOrgList()
|
// this.getroleOrgList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isShow(val) {
|
isShow(val) {
|
||||||
|
|||||||
@@ -1,73 +1,56 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card" style="padding-left: 50px;">
|
||||||
<table class="e-table" cellspacing="0">
|
|
||||||
<tr>
|
<el-checkbox class="checkbox" v-model="accountType" @change="canLoginChange">允许登录</el-checkbox>
|
||||||
<td>姓名</td>
|
|
||||||
<td>
|
<div style="display: flex;flex-direction: row;width: 100%;margin-top: 10px;">
|
||||||
<el-input v-model="form.name" style="width:300px"></el-input>
|
<div style="display: flex;flex-direction: row;flex: 1 ; align-items: center;">
|
||||||
</td>
|
<span style="width: 80px;text-align: right;"><span class="must">*</span> 用户名:</span>
|
||||||
</tr>
|
<el-input style="margin-left: 10px;flex: 1 " v-model="form.userName"></el-input>
|
||||||
<tr>
|
</div>
|
||||||
<td>用户类型</td>
|
<div style="display: flex;flex-direction: row;flex: 1 ;align-items: center;margin-left: 20px;">
|
||||||
<td>
|
<span style="width: 80px;text-align: right;"><span class="must">*</span> 姓名:</span>
|
||||||
<el-select v-model="form.userType" @change="$forceUpdate()" style="width:300px">
|
<el-input style="margin-left: 10px; flex: 1" v-model="form.name"></el-input>
|
||||||
<el-option v-for="(item, i) in userTypeData" :key="i" :label="item.name" :value="item.value">
|
</div>
|
||||||
</el-option>
|
</div>
|
||||||
</el-select>
|
|
||||||
</td>
|
<div style="display: flex;flex-direction: row;width: 100%;margin-top: 10px;">
|
||||||
</tr>
|
<div style="display: flex;flex-direction: row;flex: 1 ; align-items: center;">
|
||||||
<tr>
|
<span style="width: 80px;text-align: right;"><span class="must">*</span> 部门:</span>
|
||||||
<td>部门</td>
|
<el-select v-model="form.sysStaffOrg.orgName" placeholder="请选择" style="margin-left: 10px; flex: 0.8;">
|
||||||
<td>
|
<el-option hidden :key="form.sysStaffOrg.orgSid" :label="form.sysStaffOrg.orgName"
|
||||||
<el-select v-model="form.deptSid" placeholder="请选择" style="width:300px">
|
:value="form.sysStaffOrg.orgName"></el-option>
|
||||||
<el-option hidden :key="form.deptSid" :label="orgName" :value="form.deptSid"></el-option>
|
<el-tree :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"
|
||||||
<el-tree :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"
|
:default-checked-keys="checkedId" :default-expand-all='true' :check-strictly='true' :props="defaultProps"
|
||||||
:default-checked-keys="checkedId" :default-expand-all='true' :check-strictly='true'
|
@check-change="checkchange">
|
||||||
:props="defaultProps" @check-change="checkchange">
|
</el-tree>
|
||||||
</el-tree>
|
</el-select>
|
||||||
</el-select>
|
<el-checkbox class="checkbox" style="margin-left: 15px;" v-model="manageType"
|
||||||
<!--<el-select v-model="form.deptSid" @change="$forceUpdate()">
|
@change="manageTypeChange">主管</el-checkbox>
|
||||||
<el-option
|
</div>
|
||||||
v-for="(item, i) in treedata"
|
<div style="display: flex;flex-direction: row;flex: 1 ;align-items: center;margin-left: 20px;">
|
||||||
:key="i"
|
<span style="width: 80px;text-align: right;"><span class="must">*</span> 角色:</span>
|
||||||
:label="item.name"
|
<el-select v-model="form.roleSid" placeholder="请选择" style="margin-left: 10px; flex: 1" filterable multiple
|
||||||
:value="item.sid">
|
@change="roleChange">
|
||||||
</el-option>
|
<el-option v-for="(item,i) in roleListAll" :key="i" :label="item.name" :value="item.sid"></el-option>
|
||||||
</el-select>-->
|
</el-select>
|
||||||
</td>
|
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
</div>
|
||||||
<td>岗位</td>
|
|
||||||
<td>
|
<div style="display: flex;flex-direction: row;width: 100%;margin-top: 10px;">
|
||||||
<el-select v-model="form.postSid" @change="$forceUpdate()" style="width:300px">
|
<div style="display: flex;flex-direction: row;flex: 1 ; align-items: center;">
|
||||||
<el-option v-for="(item, i) in postSidData" :key="i" :label="item.name" :value="item.sid">
|
<span style="width: 80px;text-align: right;">备注:</span>
|
||||||
</el-option>
|
<el-input style="margin-left: 10px; flex: 0.8" v-model="form.remarks"></el-input>
|
||||||
</el-select>
|
<el-checkbox class="checkbox" style="margin-left: 15px;" v-model="userType"
|
||||||
<!--<el-input v-model="form.postSid"></el-input>-->
|
@change="supplierChange">供应商账号</el-checkbox>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
|
||||||
<td>手机号码</td>
|
|
||||||
<td>
|
|
||||||
<el-input v-model="form.mobile" style="width:300px"></el-input>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>手机验证码</td>
|
|
||||||
<td>
|
|
||||||
<el-input v-model="form.verificationCode" placeholder="请输入验证码" style="width:300px">
|
|
||||||
<el-button v-show="showCode" slot="append" @click.native="getIdentifying">获取验证码</el-button>
|
|
||||||
<el-button v-show="!showCode" slot="append">{{phoneCodeCount}} s</el-button>
|
|
||||||
</el-input>
|
|
||||||
<!--<el-input v-model="form.verificationCode"></el-input>-->
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<div style="margin-top: 20px; text-align: center;">
|
<div style="margin-top: 20px; text-align: center;">
|
||||||
<el-button type="primary" @click="save()">保 存</el-button>
|
<el-button type="primary" @click="save()">保 存</el-button>
|
||||||
<!--<el-button type="warning" @click="cancel()">取 消</el-button>-->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -79,69 +62,107 @@
|
|||||||
userSingle,
|
userSingle,
|
||||||
orgList,
|
orgList,
|
||||||
postList,
|
postList,
|
||||||
getCode
|
getCode,
|
||||||
|
roleList,
|
||||||
} from '@/api/system/userManage/index.js'
|
} from '@/api/system/userManage/index.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
sid: '',
|
"userName": "",
|
||||||
name: '',
|
"name": "",
|
||||||
userType: '',
|
"sysStaffOrg": {
|
||||||
deptSid: '',
|
"orgSid": "",
|
||||||
postSid: '',
|
"orgName": "",
|
||||||
mobile: '',
|
"orgCode": "",
|
||||||
verificationCode: ''
|
"manageType": "3"
|
||||||
|
},
|
||||||
|
"sysUserRoles": [],
|
||||||
|
"remarks": "",
|
||||||
|
"userType": "1",
|
||||||
|
"accountType": "3",
|
||||||
|
"orgSid": window.sessionStorage.getItem('orgSid')
|
||||||
},
|
},
|
||||||
form1: {
|
accountType: false,
|
||||||
sid: '',
|
manageType: false,
|
||||||
},
|
userType: false,
|
||||||
userTypeData: [{
|
|
||||||
value: '1',
|
|
||||||
name: '员工'
|
|
||||||
}, {
|
|
||||||
value: '2',
|
|
||||||
name: '主管'
|
|
||||||
}, {
|
|
||||||
value: '3',
|
|
||||||
name: '经理'
|
|
||||||
}],
|
|
||||||
treedata: [],
|
treedata: [],
|
||||||
checkedId: [],
|
checkedId: [],
|
||||||
orgName: '',
|
// orgName: '',
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name'
|
label: 'name'
|
||||||
},
|
},
|
||||||
postSidData: [],
|
roleListAll: []
|
||||||
showCode: true,
|
|
||||||
phoneCodeCount: '',
|
|
||||||
timer: null,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ['dataObj'],
|
props: ['dataObj'],
|
||||||
watch: {
|
// watch: {
|
||||||
dataObj: {
|
// dataObj: {
|
||||||
handler(val) {
|
// handler(val) {
|
||||||
this.form1.sid = val.sid
|
// this.form1.sid = val.sid
|
||||||
this.getUserSingle()
|
// this.getUserSingle()
|
||||||
this.getOrgList()
|
// this.getOrgList()
|
||||||
},
|
// },
|
||||||
deep: true,
|
// deep: true,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getOrgList()
|
this.getOrgList()
|
||||||
|
this.getRoleList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getRoleList() {
|
||||||
|
var param = {}
|
||||||
|
roleList(param).then(res => {
|
||||||
|
if (res.code === '200') {
|
||||||
|
this.roleListAll = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
canLoginChange(val) {
|
||||||
|
console.log("canLoginChange", val);
|
||||||
|
|
||||||
|
this.accountType = val
|
||||||
|
|
||||||
|
this.form.accountType = val ? "2" : "3"
|
||||||
|
|
||||||
|
},
|
||||||
|
manageTypeChange(val) {
|
||||||
|
console.log("manageTypeChange", val);
|
||||||
|
|
||||||
|
this.manageType = val
|
||||||
|
|
||||||
|
this.form.sysStaffOrg.manageType = val ? "1" : "3"
|
||||||
|
},
|
||||||
|
supplierChange(val) {
|
||||||
|
console.log("supplierChange", val);
|
||||||
|
this.userType = val
|
||||||
|
|
||||||
|
this.form.userType = val ? "3" : "1"
|
||||||
|
},
|
||||||
|
|
||||||
|
roleChange(val) {
|
||||||
|
console.log("roleChange", val);
|
||||||
|
this.form.sysUserRoles = []
|
||||||
|
for (var i = 0; i < val.length; i++) {
|
||||||
|
|
||||||
|
this.form.sysUserRoles.push({
|
||||||
|
roleSid: val[i]
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
getUserSingle() {
|
getUserSingle() {
|
||||||
userSingle(this.form1).then(res => {
|
userSingle(this.form1).then(res => {
|
||||||
if (res.code == '200') {
|
if (res.code == '200') {
|
||||||
this.form.sid = res.data.sid
|
this.form.sid = res.data.sid
|
||||||
this.form.name = res.data.name
|
this.form.name = res.data.name
|
||||||
this.form.userType = res.data.userType
|
this.form.userType = res.data.userType
|
||||||
this.form.deptSid = res.data.deptSid
|
this.form.orgSid = res.data.orgSid
|
||||||
this.orgName = res.data.departmentName
|
this.orgName = res.data.departmentName
|
||||||
this.form.postSid = res.data.postSid
|
this.form.postSid = res.data.postSid
|
||||||
this.form.mobile = res.data.mobile
|
this.form.mobile = res.data.mobile
|
||||||
@@ -149,29 +170,42 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取部门树形
|
// 获取部门树形
|
||||||
getOrgList(row) {
|
getOrgList() {
|
||||||
// this.roleDialog = true
|
// this.roleDialog = true
|
||||||
this.checkedId = []
|
this.checkedId = []
|
||||||
this.Thisrow = row
|
|
||||||
this.loading = true
|
this.loading = true
|
||||||
let params = {}
|
let params = {}
|
||||||
orgList(params).then(res => {
|
orgList(window.sessionStorage.getItem('orgSid')).then(res => {
|
||||||
this.treedata = res.data
|
this.treedata = res.data
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
treeNodeClick() {
|
||||||
|
this.$refs.el_select.visible = false
|
||||||
|
},
|
||||||
checkchange(data, checked, indeterminate) {
|
checkchange(data, checked, indeterminate) {
|
||||||
if (checked) {
|
|
||||||
|
|
||||||
this.form.deptSid = data.sid
|
console.log("checkchange", data);
|
||||||
this.orgName = data.name
|
if (checked) {
|
||||||
|
this.form.sysStaffOrg.orgSid = data.sid
|
||||||
|
this.form.sysStaffOrg.orgName = data.name
|
||||||
|
this.form.sysStaffOrg.orgCode = data.orgCode
|
||||||
let arr = []
|
let arr = []
|
||||||
arr = [data.sid];
|
arr = [data.sid];
|
||||||
this.$refs.Tree.setCheckedKeys(arr);
|
this.$refs.Tree.setCheckedKeys(arr);
|
||||||
this.form.postSid = ''
|
|
||||||
this.getPost(data.sid)
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this.form.orgSid = data.sid
|
||||||
|
// this.orgName = data.name
|
||||||
|
// let arr = []
|
||||||
|
// arr = [data.sid];
|
||||||
|
// this.$refs.Tree.setCheckedKeys(arr);
|
||||||
|
// this.form.postSid = ''
|
||||||
|
// this.getPost(data.sid)
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
getPost(orgSid) {
|
getPost(orgSid) {
|
||||||
let params = {
|
let params = {
|
||||||
@@ -182,8 +216,44 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
|
|
||||||
|
console.log("save", this.form);
|
||||||
|
|
||||||
|
if (this.form.userName == '') {
|
||||||
|
this.$message({
|
||||||
|
message: '账号不能为空',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.form.name == '') {
|
||||||
|
this.$message({
|
||||||
|
message: '姓名不能为空',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.form.sysStaffOrg.orgSid == '' || this.form.sysStaffOrg.orgName == '') {
|
||||||
|
this.$message({
|
||||||
|
message: '部门不能为空',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.form.sysUserRoles.length == 0) {
|
||||||
|
this.$message({
|
||||||
|
message: '角色不能为空',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (this.form.sid) {
|
if (this.form.sid) {
|
||||||
userUpdata(this.form).then(res => {
|
userUpdatauserUpdata(this.form).then(res => {
|
||||||
if (res.code == '200') {
|
if (res.code == '200') {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
@@ -193,8 +263,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
let orgSid = this.$refs.Tree.getCheckedKeys()
|
|
||||||
this.form.deptSid = orgSid.toString()
|
|
||||||
userAdd(this.form).then(res => {
|
userAdd(this.form).then(res => {
|
||||||
if (res.code == '200') {
|
if (res.code == '200') {
|
||||||
this.$message({
|
this.$message({
|
||||||
@@ -210,14 +278,24 @@
|
|||||||
this.reset()
|
this.reset()
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
|
this.accountType = false
|
||||||
|
this.manageType = false
|
||||||
|
this.userType = false
|
||||||
|
|
||||||
this.form = {
|
this.form = {
|
||||||
sid: '',
|
"userName": "",
|
||||||
name: '',
|
"name": "",
|
||||||
userType: '',
|
"sysStaffOrg": {
|
||||||
deptSid: '',
|
"orgSid": "",
|
||||||
postSid: '',
|
"orgName": "",
|
||||||
mobile: '',
|
"orgCode": "",
|
||||||
verificationCode: ''
|
"manageType": "3"
|
||||||
|
},
|
||||||
|
"sysUserRoles": [],
|
||||||
|
"remarks": "",
|
||||||
|
"userType": "1",
|
||||||
|
"accountType": "3",
|
||||||
|
"orgSid": window.sessionStorage.getItem('orgSid')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取验证码
|
//获取验证码
|
||||||
@@ -261,4 +339,11 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.checkbox {
|
||||||
|
zoom: 130%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.must {
|
||||||
|
color: #f00;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -7,19 +7,19 @@
|
|||||||
<el-form-item label="用户名">
|
<el-form-item label="用户名">
|
||||||
<el-input v-model="page.params.userName" clearable></el-input>
|
<el-input v-model="page.params.userName" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="姓名">
|
<el-form-item label="姓名">
|
||||||
<el-input v-model="search.name" clearable></el-input>
|
<el-input v-model="page.params.name" clearable></el-input>
|
||||||
</el-form-item> -->
|
</el-form-item>
|
||||||
<el-form-item label="角色">
|
<el-form-item label="角色">
|
||||||
<el-select v-model="page.params.roleSid" filterable clearable placeholder="请选择">
|
<el-select v-model="page.params.roleSid" filterable clearable placeholder="请选择">
|
||||||
<el-option v-for="item in roleListAll" :key="item.sid" :label="item.name" :value="item.sid"></el-option>
|
<el-option v-for="item in roleListAll" :key="item.sid" :label="item.name" :value="item.sid"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="部门"> -->
|
<!-- <el-form-item label="部门"> -->
|
||||||
<!-- <el-input v-model="page.params.orgName" clearable></el-input> -->
|
<!-- <el-input v-model="page.params.orgName" clearable></el-input> -->
|
||||||
<!-- <el-select v-model="search.roleSid" clearable placeholder="请选择">-->
|
<!-- <el-select v-model="search.roleSid" clearable placeholder="请选择">-->
|
||||||
<!-- <el-option v-for="(item,i) in roleListAll" :key="i" :label="item.name" :value="item.sid"></el-option>-->
|
<!-- <el-option v-for="(item,i) in roleListAll" :key="i" :label="item.name" :value="item.sid"></el-option>-->
|
||||||
<!-- </el-select>-->
|
<!-- </el-select>-->
|
||||||
<!-- </el-form-item> -->
|
<!-- </el-form-item> -->
|
||||||
<el-button type="primary" icon="el-icon-search" size="small" @click="getOrgUserList(1)">查询</el-button>
|
<el-button type="primary" icon="el-icon-search" size="small" @click="getOrgUserList(1)">查询</el-button>
|
||||||
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
|
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<el-table :data="userTable" border style="width: 100%;">
|
<el-table :data="userTable" border style="width: 100%;">
|
||||||
<el-table-column label="序号" width="80px" type="index" align="center">
|
<el-table-column label="序号" width="80px" type="index" align="center">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="300px" align="center">
|
<el-table-column label="操作" width="350px" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button @click="setRole(scope.row)" type="primary" size="mini">
|
<el-button @click="setRole(scope.row)" type="primary" size="mini">
|
||||||
设置角色
|
设置角色
|
||||||
@@ -39,9 +39,12 @@
|
|||||||
<el-button @click="initPwd(scope.row)" type="danger" size="mini">
|
<el-button @click="initPwd(scope.row)" type="danger" size="mini">
|
||||||
初始化密码
|
初始化密码
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- <el-button @click="del(scope.row)" type="danger" size="mini">
|
<el-button @click="userinfoChange(scope.row)" type="primary" size="mini">
|
||||||
删除
|
编辑
|
||||||
</el-button>-->
|
</el-button>
|
||||||
|
<el-button @click="del(scope.row)" type="danger" size="mini">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="userName" label="用户名" align="center">
|
<el-table-column prop="userName" label="用户名" align="center">
|
||||||
@@ -50,10 +53,16 @@
|
|||||||
{{ scope.row.userName }}
|
{{ scope.row.userName }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="userType" label="用户类型" align="center"></el-table-column>
|
|
||||||
<el-table-column prop="name" label="姓名" align="center"></el-table-column>
|
<el-table-column prop="name" label="姓名" align="center"></el-table-column>
|
||||||
<!-- <el-table-column prop="departmentName" label="部门" align="center"></el-table-column> -->
|
<el-table-column prop="roleName" label="角色" align="center"></el-table-column>
|
||||||
<!-- <el-table-column prop="postName" label="岗位" align="center"></el-table-column> -->
|
<!-- <el-table-column label="角色名称" :formatter='sysRoleVosName'></el-table-column> -->
|
||||||
|
<!-- <el-table-column label="角色名称" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ sysRoleVosNames }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column prop="accountTypeValue" label="账户类型" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="userTypeValue" label="用户类型" align="center"></el-table-column>
|
||||||
<el-table-column prop="isEnable" label="是否可用" align="center">
|
<el-table-column prop="isEnable" label="是否可用" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch v-model="scope.row.isEnable" active-value='1' inactive-value='0' active-color="#13ce66"
|
<el-switch v-model="scope.row.isEnable" active-value='1' inactive-value='0' active-color="#13ce66"
|
||||||
@@ -61,6 +70,7 @@
|
|||||||
</el-switch>
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination" />
|
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination" />
|
||||||
<!-- 角色设置 -->
|
<!-- 角色设置 -->
|
||||||
@@ -89,7 +99,7 @@
|
|||||||
:value="item.departmentSid"
|
:value="item.departmentSid"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select> -->
|
</el-select> -->
|
||||||
<el-cascader v-model="bm_Form.departmentSid" :options="treedata" :props="props"></el-cascader>
|
<!-- <el-cascader v-model="bm_Form.departmentSid" :options="treedata" :props="props"></el-cascader> -->
|
||||||
<el-button type="primary" size='mini' @click="toNav('deptManage')" style="margin-left: 10px;" circle
|
<el-button type="primary" size='mini' @click="toNav('deptManage')" style="margin-left: 10px;" circle
|
||||||
icon="el-icon-plus"></el-button>
|
icon="el-icon-plus"></el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -100,59 +110,55 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 编辑信息 -->
|
<!-- 编辑信息 -->
|
||||||
<el-dialog title="编辑用户信息" :visible.sync="editDialog" width="40%">
|
<el-dialog title="编辑用户信息" :visible.sync="editDialog" width="60%">
|
||||||
<table class="e-table" cellspacing="0" style="margin-top: -30px;">
|
<el-form :model="form">
|
||||||
<tr>
|
|
||||||
<td>姓名</td>
|
<el-checkbox class="checkbox" v-model="accountType" @change="canLoginChange">允许登录</el-checkbox>
|
||||||
<td>
|
|
||||||
<el-input v-model="form.name" style="width:300px"></el-input>
|
<div style="display: flex;flex-direction: row;width: 100%;margin-top: 10px;">
|
||||||
</td>
|
<div style="display: flex;flex-direction: row;flex: 1 ; align-items: center;">
|
||||||
</tr>
|
<span style="width: 80px;text-align: right;"><span class="must">*</span> 用户名:</span>
|
||||||
<tr>
|
<el-input style="margin-left: 10px;flex: 1 " v-model="form.userName"></el-input>
|
||||||
<td>用户类型</td>
|
</div>
|
||||||
<td>
|
<div style="display: flex;flex-direction: row;flex: 1 ;align-items: center;margin-left: 20px;">
|
||||||
<el-select v-model="form.userTypeKey" @change="$forceUpdate()" style="width:300px">
|
<span style="width: 80px;text-align: right;"><span class="must">*</span> 姓名:</span>
|
||||||
<el-option v-for="(item, i) in userTypeData" :key="i" :label="item.name" :value="item.value">
|
<el-input style="margin-left: 10px; flex: 1" v-model="form.name"></el-input>
|
||||||
</el-option>
|
</div>
|
||||||
</el-select>
|
</div>
|
||||||
</td>
|
|
||||||
</tr>
|
<div style="display: flex;flex-direction: row;width: 100%;margin-top: 10px;">
|
||||||
<!-- <tr>
|
<div style="display: flex;flex-direction: row;flex: 1 ; align-items: center;">
|
||||||
<td>部门</td>
|
<span style="width: 80px;text-align: right;"><span class="must">*</span> 部门:</span>
|
||||||
<td>
|
<el-select v-model="form.sysStaffOrg.orgName" placeholder="请选择" style="margin-left: 10px; flex: 0.8;">
|
||||||
<el-select v-model="form.deptSid" placeholder="请选择" @change="$forceUpdate()" style="width:300px">
|
<el-option hidden :key="form.sysStaffOrg.orgSid" :label="form.sysStaffOrg.orgName"
|
||||||
<el-option hidden :key="form.deptSid" :label="orgName" :value="form.deptSid"></el-option>
|
:value="form.sysStaffOrg.orgName"></el-option>
|
||||||
<el-tree :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"
|
<el-tree :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"
|
||||||
:default-checked-keys="checkedId" :default-expand-all='true' :check-strictly='true'
|
:default-checked-keys="checkedId" :default-expand-all='true' :check-strictly='true'
|
||||||
:props="defaultProps" @check-change="checkchange">
|
:props="defaultProps" @check-change="checkchange">
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
<el-checkbox class="checkbox" style="margin-left: 15px;" v-model="manageType"
|
||||||
</tr> -->
|
@change="manageTypeChange">主管</el-checkbox>
|
||||||
<!-- <tr>
|
</div>
|
||||||
<td>岗位</td>
|
<div style="display: flex;flex-direction: row;flex: 1 ;align-items: center;margin-left: 20px;">
|
||||||
<td>
|
<span style="width:80px;text-align: right;"><span class="must">*</span> 角色:</span>
|
||||||
<el-select v-model="form.postSid" @change="$forceUpdate()" style="width:300px">
|
<el-select v-model="form.roleSid" placeholder="请选择" style="margin-left: 10px; flex: 1" filterable multiple
|
||||||
<el-option v-for="(item, i) in postSidData" :key="i" :label="item.name" :value="item.sid"></el-option>
|
@change="roleChange">
|
||||||
|
<el-option v-for="(item,i) in roleListAll" :key="i" :label="item.name" :value="item.sid"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</td>
|
|
||||||
</tr> -->
|
</div>
|
||||||
<tr>
|
</div>
|
||||||
<td>手机号码</td>
|
|
||||||
<td>
|
<div style="display: flex;flex-direction: row;width: 100%;margin-top: 10px;">
|
||||||
<el-input v-model="form.userName" style="width:300px"></el-input>
|
<div style="display: flex;flex-direction: row;flex: 1 ; align-items: center;">
|
||||||
</td>
|
<span style="width: 80px;text-align: right;">备注:</span>
|
||||||
</tr>
|
<el-input style="margin-left: 10px; flex: 0.8" v-model="form.remarks"></el-input>
|
||||||
<!-- <tr>
|
<el-checkbox class="checkbox" style="margin-left: 15px;" v-model="userType"
|
||||||
<td>手机验证码</td>
|
@change="supplierChange">供应商账号</el-checkbox>
|
||||||
<td>
|
</div>
|
||||||
<el-input v-model="form.verificationCode" placeholder="请输入验证码" style="width:300px">
|
</div>
|
||||||
<el-button v-show="showCode" slot="append" @click.native="getIdentifying">获取验证码</el-button>
|
</el-form>
|
||||||
<el-button v-show="!showCode" slot="append">{{ phoneCodeCount }} s</el-button>
|
|
||||||
</el-input>
|
|
||||||
</td>
|
|
||||||
</tr> -->
|
|
||||||
</table>
|
|
||||||
<div style="margin-top: 20px; text-align: center;">
|
<div style="margin-top: 20px; text-align: center;">
|
||||||
<el-button type="primary" @click="save()">保 存</el-button>
|
<el-button type="primary" @click="save()">保 存</el-button>
|
||||||
<el-button @click="editDialog = false">关 闭</el-button>
|
<el-button @click="editDialog = false">关 闭</el-button>
|
||||||
@@ -172,40 +178,23 @@
|
|||||||
saveOrgRole,
|
saveOrgRole,
|
||||||
roleList,
|
roleList,
|
||||||
setRoleEnable,
|
setRoleEnable,
|
||||||
userUpdata
|
userUpdata,
|
||||||
|
userAdd,
|
||||||
|
userSingle,
|
||||||
|
getCode,
|
||||||
|
initUserInfo
|
||||||
} from '@/api/system/userManage/index.js'
|
} from '@/api/system/userManage/index.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
editDialog: false,
|
editDialog: false,
|
||||||
form: {},
|
|
||||||
userTypeData: [{
|
|
||||||
value: '1',
|
|
||||||
name: '员工'
|
|
||||||
}, {
|
|
||||||
value: '2',
|
|
||||||
name: '主管'
|
|
||||||
}, {
|
|
||||||
value: '3',
|
|
||||||
name: '经理'
|
|
||||||
}],
|
|
||||||
checkedId: [],
|
checkedId: [],
|
||||||
orgName: '',
|
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name'
|
label: 'name'
|
||||||
},
|
},
|
||||||
showCode: true,
|
|
||||||
postSidData: [],
|
|
||||||
phoneCodeCount: '',
|
|
||||||
roleListAll: [],
|
roleListAll: [],
|
||||||
props: {
|
|
||||||
value: 'sid',
|
|
||||||
label: 'name',
|
|
||||||
children: 'orgDepartmentVoList'
|
|
||||||
},
|
|
||||||
treedata: null,
|
|
||||||
page: {
|
page: {
|
||||||
total: 0, // 默认数据总数
|
total: 0, // 默认数据总数
|
||||||
current: 1, // 默认开始页面
|
current: 1, // 默认开始页面
|
||||||
@@ -215,15 +204,16 @@
|
|||||||
userName: '',
|
userName: '',
|
||||||
roleSid: '',
|
roleSid: '',
|
||||||
orgSid: window.sessionStorage.getItem('orgSid'),
|
orgSid: window.sessionStorage.getItem('orgSid'),
|
||||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44'
|
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa33'
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
props: {
|
||||||
|
value: 'sid',
|
||||||
|
label: 'name',
|
||||||
|
children: 'orgDepartmentVoList'
|
||||||
|
},
|
||||||
userTable: [],
|
userTable: [],
|
||||||
// 设置角色
|
|
||||||
formLabelWidth: '100',
|
|
||||||
roleDialog: false,
|
|
||||||
roleList: [],
|
|
||||||
roleForm: {
|
roleForm: {
|
||||||
roleSid: '',
|
roleSid: '',
|
||||||
userSid: ''
|
userSid: ''
|
||||||
@@ -235,6 +225,10 @@
|
|||||||
departmentSid: ''
|
departmentSid: ''
|
||||||
},
|
},
|
||||||
bm_List: [],
|
bm_List: [],
|
||||||
|
// 设置角色
|
||||||
|
formLabelWidth: '100',
|
||||||
|
roleDialog: false,
|
||||||
|
roleList: [],
|
||||||
rules: {
|
rules: {
|
||||||
roleSid: [{
|
roleSid: [{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -246,7 +240,32 @@
|
|||||||
message: '请选择部门名称',
|
message: '请选择部门名称',
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}]
|
}]
|
||||||
}
|
},
|
||||||
|
form: {
|
||||||
|
"userName": "",
|
||||||
|
"name": "",
|
||||||
|
"sysStaffOrg": {
|
||||||
|
"orgSid": "",
|
||||||
|
"orgName": "",
|
||||||
|
"orgCode": "",
|
||||||
|
"manageType": ""
|
||||||
|
},
|
||||||
|
"sysUserRoles": [],
|
||||||
|
"remarks": "",
|
||||||
|
"userType": "",
|
||||||
|
"accountType": "",
|
||||||
|
"orgSid": window.sessionStorage.getItem('orgSid')
|
||||||
|
},
|
||||||
|
accountType: false,
|
||||||
|
manageType: false,
|
||||||
|
userType: false,
|
||||||
|
treedata: [],
|
||||||
|
checkedId: [],
|
||||||
|
// orgName: '',
|
||||||
|
defaultProps: {
|
||||||
|
children: 'children',
|
||||||
|
label: 'name'
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: ['dataObj'],
|
props: ['dataObj'],
|
||||||
@@ -258,13 +277,88 @@
|
|||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 计算角色名称
|
||||||
|
sysRoleVosNames(val, row) {
|
||||||
|
console.log("sysRoleVosNames", val);
|
||||||
|
console.log("sysRoleVosNames", row);
|
||||||
|
var names = ''
|
||||||
|
|
||||||
|
// row.sysRoleVos.forEach((e) => {
|
||||||
|
// names += e.name + ","
|
||||||
|
// })
|
||||||
|
|
||||||
|
// return names.substring(names.length, names.length - 1)
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getOrgUserList()
|
this.getOrgUserList()
|
||||||
this.getRoleList()
|
this.getRoleList()
|
||||||
this.getOrgTree()
|
this.getOrgTree()
|
||||||
this.getOrgList()
|
// this.getOrgList()
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// sysRoleVosName(row) {
|
||||||
|
// console.log("sysRoleVosNames", row);
|
||||||
|
// var names = ''
|
||||||
|
|
||||||
|
// row.sysRoleVos.forEach((e) => {
|
||||||
|
// names += e.name + ","
|
||||||
|
// })
|
||||||
|
|
||||||
|
// return names.substring(names.length, names.length - 1)
|
||||||
|
// },
|
||||||
|
canLoginChange(val) {
|
||||||
|
console.log("canLoginChange", val);
|
||||||
|
|
||||||
|
this.accountType = val
|
||||||
|
|
||||||
|
this.form.accountType = val ? "2" : "3"
|
||||||
|
|
||||||
|
},
|
||||||
|
manageTypeChange(val) {
|
||||||
|
console.log("manageTypeChange", val);
|
||||||
|
|
||||||
|
this.manageType = val
|
||||||
|
|
||||||
|
this.form.sysStaffOrg.manageType = val ? "1" : "3"
|
||||||
|
},
|
||||||
|
supplierChange(val) {
|
||||||
|
console.log("supplierChange", val);
|
||||||
|
this.userType = val
|
||||||
|
|
||||||
|
this.form.userType = val ? "3" : "1"
|
||||||
|
},
|
||||||
|
|
||||||
|
roleChange(val) {
|
||||||
|
console.log("roleChange", val);
|
||||||
|
this.$forceUpdate()
|
||||||
|
this.form.sysUserRoles = []
|
||||||
|
for (var i = 0; i < val.length; i++) {
|
||||||
|
|
||||||
|
this.form.sysUserRoles.push({
|
||||||
|
roleSid: val[i]
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
checkchange(data, checked, indeterminate) {
|
||||||
|
|
||||||
|
console.log("checkchange", data);
|
||||||
|
if (checked) {
|
||||||
|
this.form.sysStaffOrg.orgSid = data.sid
|
||||||
|
this.form.sysStaffOrg.orgName = data.name
|
||||||
|
this.form.sysStaffOrg.orgCode = data.orgCode
|
||||||
|
let arr = []
|
||||||
|
arr = [data.sid];
|
||||||
|
this.$refs.Tree.setCheckedKeys(arr);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 列表 + 初始化
|
// 列表 + 初始化
|
||||||
getOrgUserList() {
|
getOrgUserList() {
|
||||||
userList(this.page).then(res => {
|
userList(this.page).then(res => {
|
||||||
@@ -283,7 +377,7 @@
|
|||||||
userName: '',
|
userName: '',
|
||||||
roleSid: '',
|
roleSid: '',
|
||||||
orgSid: window.sessionStorage.getItem('orgSid'),
|
orgSid: window.sessionStorage.getItem('orgSid'),
|
||||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44'
|
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa33'
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -304,17 +398,29 @@
|
|||||||
this.getOrgUserList()
|
this.getOrgUserList()
|
||||||
},
|
},
|
||||||
getOrgTree() { // 获取部门树形列表
|
getOrgTree() { // 获取部门树形列表
|
||||||
function treeArr(data) {
|
|
||||||
if (data.length > 0) {
|
this.checkedId = []
|
||||||
for (var i = 0; i < data.length; i++) {
|
// this.Thisrow = row
|
||||||
if (data[i].orgDepartmentVoList.length > 0) {
|
this.loading = true
|
||||||
treeArr(data[i].orgDepartmentVoList)
|
let params = {}
|
||||||
} else {
|
orgList(window.sessionStorage.getItem('orgSid')).then(res => {
|
||||||
delete data[i].orgDepartmentVoList
|
|
||||||
}
|
console.log("getOrgTree", res.data);
|
||||||
}
|
|
||||||
}
|
this.treedata = res.data
|
||||||
}
|
})
|
||||||
|
|
||||||
|
// function treeArr(data) {
|
||||||
|
// if (data.length > 0) {
|
||||||
|
// for (var i = 0; i < data.length; i++) {
|
||||||
|
// if (data[i].orgDepartmentVoList.length > 0) {
|
||||||
|
// treeArr(data[i].orgDepartmentVoList)
|
||||||
|
// } else {
|
||||||
|
// delete data[i].orgDepartmentVoList
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
// getOrgTree({organizationSid: this.$store.getters.userInfo.orgSid}).then(res => {
|
// getOrgTree({organizationSid: this.$store.getters.userInfo.orgSid}).then(res => {
|
||||||
// let tree = res.data[0].orgDepartmentVoList
|
// let tree = res.data[0].orgDepartmentVoList
|
||||||
// treeArr(tree)
|
// treeArr(tree)
|
||||||
@@ -380,20 +486,16 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置部门 提交
|
save() {
|
||||||
save(formName) {
|
|
||||||
this.form.userType = this.form.userTypeKey;
|
|
||||||
userUpdata(this.form).then(res => {
|
userUpdata(this.form).then(res => {
|
||||||
if (res.code === '200') {
|
if (res.code == '200') {
|
||||||
this.getOrgUserList()
|
|
||||||
this.bm_Dialog = false
|
|
||||||
this.$message({
|
this.$message({
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
this.editDialog = false
|
this.editDialog = false
|
||||||
|
this.$emit('status', false)
|
||||||
}
|
}
|
||||||
this.reset()
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
initPwd(row) {
|
initPwd(row) {
|
||||||
@@ -414,10 +516,25 @@
|
|||||||
},
|
},
|
||||||
// 修改用户信息
|
// 修改用户信息
|
||||||
userinfoChange(row) {
|
userinfoChange(row) {
|
||||||
var postSid = row.postSid
|
initUserInfo(row).then(res => {
|
||||||
this.editDialog = true
|
if (res.code == '200') {
|
||||||
this.form = Object.assign({}, row)
|
this.editDialog = true
|
||||||
this.postSid = postSid
|
this.form = res.data
|
||||||
|
|
||||||
|
this.form.roleSid = []
|
||||||
|
for (let i = 0; i < res.data.sysUserRoles.length; i++) {
|
||||||
|
// if (res.data.sysUserRoles[i].checked === '0') {
|
||||||
|
this.form.roleSid.push(res.data.sysUserRoles[i].roleSid)
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.accountType = this.form.accountType != '3'
|
||||||
|
this.manageType = this.form.sysStaffOrg.manageType == '1'
|
||||||
|
this.userType = this.form.userType == '3'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
// this.$refs.Tree.setChecked(this.form.departmentSid, true, true)
|
// this.$refs.Tree.setChecked(this.form.departmentSid, true, true)
|
||||||
// })
|
// })
|
||||||
@@ -446,29 +563,29 @@
|
|||||||
this.$router.push('/' + src)
|
this.$router.push('/' + src)
|
||||||
},
|
},
|
||||||
// 获取部门树形
|
// 获取部门树形
|
||||||
getOrgList(row) {
|
// getOrgList(row) {
|
||||||
// this.roleDialog = true
|
// // this.roleDialog = true
|
||||||
this.checkedId = []
|
// this.checkedId = []
|
||||||
this.Thisrow = row
|
// this.Thisrow = row
|
||||||
this.loading = true
|
// this.loading = true
|
||||||
let params = {}
|
// let params = {}
|
||||||
orgList(params).then(res => {
|
// orgList(params).then(res => {
|
||||||
this.treedata = res.data
|
// this.treedata = res.data
|
||||||
})
|
// })
|
||||||
|
|
||||||
},
|
// },
|
||||||
checkchange(data, checked, indeterminate) {
|
// checkchange(data, checked, indeterminate) {
|
||||||
if (checked) {
|
// if (checked) {
|
||||||
this.form.deptSid = data.sid
|
// this.form.orgSid = data.sid
|
||||||
this.orgName = data.name
|
// this.orgName = data.name
|
||||||
let arr = []
|
// let arr = []
|
||||||
arr = [data.sid]
|
// arr = [data.sid]
|
||||||
this.$refs.Tree.setCheckedKeys(arr)
|
// this.$refs.Tree.setCheckedKeys(arr)
|
||||||
this.form.postSid = ''
|
// this.form.postSid = ''
|
||||||
this.getPost(data.sid)
|
// this.getPost(data.sid)
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
getPost(orgSid) {
|
getPost(orgSid) {
|
||||||
let params = {
|
let params = {
|
||||||
sid: orgSid
|
sid: orgSid
|
||||||
|
|||||||
Reference in New Issue
Block a user