完善系统管理及采购订单管理
This commit is contained in:
@@ -1,13 +1,67 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
let tokens = window.sessionStorage.getItem('token');
|
||||
export default {
|
||||
|
||||
// 查询分页列表
|
||||
listPage: function(params) {
|
||||
return request({
|
||||
url: '/wms/apiadmin/warehouserack/listPage',
|
||||
url: '/oms/apiadmin/pmspurchasebill/listPage',
|
||||
method: 'post',
|
||||
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) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysorganization/list',
|
||||
url: '/oms/apiadmin/sysorganization/list/' + data,
|
||||
method: 'get',
|
||||
data: data,
|
||||
headers: {
|
||||
@@ -67,7 +67,7 @@ export function addOrgTree(data) {
|
||||
// 回显
|
||||
export function selectBySid(data) {
|
||||
return request({
|
||||
url: 'portal/v1/sysorganization/fetchBySid/' + data,
|
||||
url: '/oms/apiadmin/sysorganization/fetchBySid/' + data,
|
||||
method: 'get',
|
||||
data: data,
|
||||
headers: {
|
||||
|
||||
@@ -3,23 +3,26 @@ import qs from 'qs'
|
||||
//let tokens = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTm8iOiI2IiwiaXNzIjoiV0JLIiwiZXhwIjoxNjI5OTQxNjI1fQ.aOFOz0h7c8YQs-ti2GLpqeWu4AE9mifx_043hLJQf8g'
|
||||
let tokens = window.sessionStorage.getItem('token');
|
||||
// 业务角色 列表
|
||||
export function roleOrgList(data){
|
||||
export function roleOrgList(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysrole/listPage',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function postList(data){
|
||||
export function postList(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/syspost/list',
|
||||
method: 'get',
|
||||
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',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -72,8 +76,9 @@ export function putOrgroles(data) {
|
||||
url: `/oms/apiadmin/sysrole/update/${data.sid}`,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -87,8 +92,9 @@ export function delOrgroles(data) {
|
||||
url: `/oms/apiadmin/sysrole/delBySids/${data.sid}`,
|
||||
method: 'get',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -97,7 +103,9 @@ export function getRoleMenuList(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysmobilemenurole/getRoleMenuList',
|
||||
method: 'post',
|
||||
params: { roleSid: data }
|
||||
params: {
|
||||
roleSid: data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -107,8 +115,9 @@ export function saveRoleMenuList(data) {
|
||||
url: `/oms/apiadmin/sysmobilemenurole/saveRoleMenuList`,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -119,8 +128,9 @@ export function roleMenuTree(data) {
|
||||
url: `/oms/apiadmin/sysmenu/listAllByRoleSid`,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -128,11 +138,12 @@ export function roleMenuTree(data) {
|
||||
// 菜单授权保存
|
||||
export function saveorgrolemenus(data) {
|
||||
return request({
|
||||
url: `/oms/apiadmin/sysrikeauthorize/updateRoleAndMenu`,
|
||||
url: `/oms/apiadmin/sysroleauthorize/updateRoleAndMenu`,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -142,8 +153,9 @@ export function sourceMenuTree(data) {
|
||||
url: `/oms/apiadmin/syssource/listAllByRoleSid`,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -153,8 +165,9 @@ export function saveSource(data) {
|
||||
url: `/oms/apiadmin/syssourcerole/updateRoleAndSource`,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -171,8 +184,9 @@ export function savefunMenu(data) {
|
||||
url: `/oms/apiadmin/sysrolefunction/updateRoleAndFunction`,
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -183,7 +197,10 @@ export function selMenuByRole(data) {
|
||||
url: `/oms/apiadmin/sysmenurole/selMenuByRole`,
|
||||
method: 'post',
|
||||
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`,
|
||||
method: 'POST',
|
||||
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 = window.sessionStorage.getItem('token');
|
||||
export function userList(data){
|
||||
export function userList(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysuser/listPage',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
// 新增
|
||||
export function userAdd(data){
|
||||
export function userAdd(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysuser/save',
|
||||
url: '/oms/apiadmin/sysstaffinfo/save',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
// 更新
|
||||
export function userUpdata(data){
|
||||
|
||||
// 初始化 用户
|
||||
export function initUserInfo(data) {
|
||||
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',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function delUser(data){
|
||||
export function delUser(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysuser/delBySid/' +data.sid,
|
||||
url: '/oms/apiadmin/sysuser/delBySid/' + data.sid,
|
||||
method: 'get',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
// 初始化密码
|
||||
export function initPwd(data){
|
||||
export function initPwd(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysuser/initPwd/' +data.sid,
|
||||
url: '/oms/apiadmin/sysuser/initPwd/' + data.sid,
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
// 根据sid查询一条信息
|
||||
export function userSingle(data){
|
||||
export function userSingle(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysuser/fetchBySid/' +data.sid,
|
||||
url: '/oms/apiadmin/sysuser/fetchBySid/' + data.sid,
|
||||
method: 'get',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
// 单条用户的角色列表
|
||||
export function setRole(data){
|
||||
export function setRole(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysrole/listAllByUserSid/' +data.sid,
|
||||
url: '/oms/apiadmin/sysrole/listAllByUserSid/' + data.sid,
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
// 角色列表
|
||||
export function saveOrgRole(data){
|
||||
export function saveOrgRole(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysuserrole/update',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询角色列表
|
||||
export function roleList(data){
|
||||
export function roleList(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysrole/listAll',
|
||||
method: 'post',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询部门列表
|
||||
export function orgList(data){
|
||||
export function orgList(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysorganization/list',
|
||||
method: 'get',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询岗位列表
|
||||
export function postList(data){
|
||||
export function postList(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/syspost/fetchByOrgSid/'+data.sid,
|
||||
url: '/oms/apiadmin/syspost/fetchByOrgSid/' + data.sid,
|
||||
method: 'get',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 获取验证码
|
||||
export function getCode(data){
|
||||
export function getCode(data) {
|
||||
return request({
|
||||
url: '/oms/apiadmin/sysuser/sendMessageCode/'+data.phone,
|
||||
url: '/oms/apiadmin/sysuser/sendMessageCode/' + data.phone,
|
||||
method: 'get',
|
||||
data: data,
|
||||
headers: {'Content-Type': 'application/json',
|
||||
'token':tokens
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'token': tokens
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -42,11 +42,12 @@
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
window.sessionStorage.clear()
|
||||
this.$router.push({
|
||||
path: '/login'
|
||||
})
|
||||
location.reload()
|
||||
window.sessionStorage.clear()
|
||||
|
||||
this.$router.push({
|
||||
path: '/login'
|
||||
})
|
||||
location.reload()
|
||||
// this.$store.commit('user/SET_UESRINFO', '')
|
||||
|
||||
})
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
params: {
|
||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44', // oms 资源sid
|
||||
orgSid: window.sessionStorage.getItem('orgSid'),
|
||||
userSid: window.sessionStorage.getItem('sid')
|
||||
userSid: window.sessionStorage.getItem('userSid')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -9,29 +9,52 @@
|
||||
</el-button>
|
||||
<div v-show="isSearchShow" class="search">
|
||||
<el-form :inline="true" class="tab-header">
|
||||
<el-form-item label="制单人">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
<el-form-item label="单据编号">
|
||||
<el-input v-model="queryParams.params.billNo" placeholder="" clearable />
|
||||
</el-form-item>
|
||||
<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 label="单据编号">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
<el-form-item label="制单人">
|
||||
<el-input v-model="queryParams.params.createByName" 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 label="单据状态">
|
||||
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||
<el-form-item label="采购员">
|
||||
<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-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>
|
||||
@@ -44,30 +67,36 @@
|
||||
<!-- Start 项目列表头部 -->
|
||||
<div class="listtop">
|
||||
<div class="tit">采购订单列表</div>
|
||||
|
||||
</div>
|
||||
<!-- End 项目列表头部 -->
|
||||
<!-- Start 项目列表 -->
|
||||
<div class="">
|
||||
<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="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">
|
||||
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="brandName" label="单据日期" align="center" />
|
||||
<el-table-column prop="brandCode" label="单据编号" align="center" />
|
||||
<el-table-column prop="letter" label="供应商" align="center" />
|
||||
<el-table-column prop="remarks" label="收货仓库" align="center" />
|
||||
<el-table-column prop="remarks" label="物流单号" align="center" />
|
||||
<el-table-column prop="remarks" label="业务员" align="center" />
|
||||
<el-table-column prop="remarks" label="制单人" align="center" />
|
||||
<el-table-column prop="remarks" label="采购运费" align="center" />
|
||||
<el-table-column prop="remarks" label="其他费用" align="center" />
|
||||
<el-table-column prop="remarks" label="商品总额" align="center" />
|
||||
<el-table-column prop="remarks" label="总采购数量" align="center" />
|
||||
<el-table-column prop="createTime" label="单据日期" width="120" align="center" />
|
||||
<el-table-column prop="billNo" label="单据编号" align="center" />
|
||||
<el-table-column prop="supplierName" label="供应商" align="center" />
|
||||
<el-table-column prop="purchaserName" label="业务员" align="center" />
|
||||
<el-table-column prop="wareHouseName" label="收货仓库" align="center" />
|
||||
<el-table-column prop="amountTotal" label="商品总额" align="center" />
|
||||
<el-table-column prop="freight" label="采购运费" align="center" />
|
||||
<el-table-column prop="otherAmount" label="其他费用" align="center" />
|
||||
<el-table-column prop="prepayment" label="预付金额" align="center" />
|
||||
<el-table-column prop="logisticsNum" 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>
|
||||
</div>
|
||||
<!-- End 项目列表 -->
|
||||
@@ -77,12 +106,90 @@
|
||||
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||
</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>
|
||||
<!-- End 查询和其列表部分 -->
|
||||
<!-- 新增修改部分组件 -->
|
||||
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||
<divInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" @reloadlist="loadList" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -93,6 +200,12 @@
|
||||
import pageye from '@/components/pagination/pageye'
|
||||
import divAdd from './purchaseOrderAdd.vue'
|
||||
import divInfo from './purchaseOrderInfo.vue'
|
||||
import {
|
||||
getOrgSidByPath,
|
||||
getTypeValueList,
|
||||
choiceSupplierInfo,
|
||||
getWarehouses
|
||||
} from '@/api/Common/dictcommons'
|
||||
export default {
|
||||
components: {
|
||||
ButtonBar,
|
||||
@@ -103,12 +216,20 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeIndex: '1',
|
||||
btndisabled: false,
|
||||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||
isSearchShow: false,
|
||||
searchxianshitit: '显示查询条件',
|
||||
tableLoading: false,
|
||||
dataList: [],
|
||||
formobj: {
|
||||
purchaseBillAmount: {
|
||||
freight: ""
|
||||
},
|
||||
purchaseAppendixList: [],
|
||||
purchaseBillDetailList: {}
|
||||
},
|
||||
btnList: [{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
@@ -143,20 +264,124 @@
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
"supplierName": "",
|
||||
"wareHouseName": "",
|
||||
"receiveStateKey": "",
|
||||
"logisticsNum": "",
|
||||
"deliveryStateKey": "",
|
||||
"billNo": "",
|
||||
"purchaserName": "",
|
||||
"remarks": "",
|
||||
"createStartTime": "",
|
||||
"createEndTime": "",
|
||||
"orgLevelKey": "",
|
||||
}
|
||||
},
|
||||
sids: [],
|
||||
selectionList: []
|
||||
selectionList: [],
|
||||
receiveStateList: [],
|
||||
deliveryStateList: [],
|
||||
warehouseList: [],
|
||||
supplierList: [],
|
||||
createOrgSid: "",
|
||||
rowItemData: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||
},
|
||||
created() {
|
||||
// this.loadList()
|
||||
|
||||
getOrgSidByPath({
|
||||
orgPath: window.sessionStorage.getItem('defaultOrgPath')
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.createOrgSid = res.data
|
||||
this.init()
|
||||
}
|
||||
})
|
||||
this.loadList()
|
||||
|
||||
},
|
||||
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) {
|
||||
console.log("val", val);
|
||||
|
||||
@@ -206,6 +431,25 @@
|
||||
const data = resp.data
|
||||
this.queryParams.total = data.total
|
||||
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 {
|
||||
// 根据resp.code进行异常情况处理
|
||||
this.dataList = []
|
||||
@@ -232,7 +476,17 @@
|
||||
size: 10,
|
||||
total: 0,
|
||||
params: {
|
||||
name: ''
|
||||
"supplierName": "",
|
||||
"wareHouseName": "",
|
||||
"receiveStateKey": "",
|
||||
"logisticsNum": "",
|
||||
"deliveryStateKey": "",
|
||||
"billNo": "",
|
||||
"purchaserName": "",
|
||||
"remarks": "",
|
||||
"createStartTime": "",
|
||||
"createEndTime": "",
|
||||
"orgLevelKey": "",
|
||||
}
|
||||
}
|
||||
this.loadList()
|
||||
@@ -261,8 +515,8 @@
|
||||
this.$router.go(-1)
|
||||
},
|
||||
toRelevancy(row) {
|
||||
this.viewState = 3
|
||||
this.$refs['divadd'].showEdit(row)
|
||||
this.viewState = 4
|
||||
this.$refs['divinfo'].showAdd(row)
|
||||
},
|
||||
doDel() {
|
||||
|
||||
@@ -310,4 +564,36 @@
|
||||
}
|
||||
</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>
|
||||
|
||||
@@ -1,8 +1,743 @@
|
||||
<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>
|
||||
|
||||
<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>
|
||||
</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>
|
||||
|
||||
@@ -1,8 +1,225 @@
|
||||
<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>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
import req from '@/api/purchase/purchaseOrder.js'
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
viewState: 1,
|
||||
listLoading: false,
|
||||
formobj: {
|
||||
|
||||
<style>
|
||||
</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>
|
||||
|
||||
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">
|
||||
|
||||
<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'}">
|
||||
<el-table-column prop="name" label="菜单名称" width="220" />
|
||||
<el-table-column label="操作" width="260" align="center">
|
||||
@@ -61,11 +62,12 @@
|
||||
<el-input v-model="scope.row.sortNo" size="mini"/>
|
||||
</template>
|
||||
</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="isEnable" label="可见性" align="center">
|
||||
<el-table-column prop="isShow" label="可见性" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-color="#13ce66" inactive-color="#ff4949" active-value="1"
|
||||
inactive-value="0" @change="enabledChange(scope.row.isEnable,scope.row)" />
|
||||
<el-switch v-model="scope.row.isShow" active-color="#13ce66" inactive-color="#ff4949" active-value="1"
|
||||
inactive-value="0" @change="enabledChange(scope.row.isShow,scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -117,12 +119,22 @@
|
||||
<el-input v-model="form.pageUrl" />
|
||||
</td>
|
||||
</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>
|
||||
<td>是否可见</td>
|
||||
<td>
|
||||
<el-radio-group v-model="form.isShow">
|
||||
<el-radio :label="0">否</el-radio>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio-group v-model="editShow" @change="changeRadio">
|
||||
<el-radio :label="'0'">否</el-radio>
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
</el-radio-group>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -192,12 +204,22 @@
|
||||
<el-input v-model="form.pageUrl" style="width:300px" />
|
||||
</td>
|
||||
</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>
|
||||
<td>是否可见</td>
|
||||
<td>
|
||||
<el-radio-group v-model="form.isShow">
|
||||
<el-radio :label="0">否</el-radio>
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio-group v-model="addShow" @change="changeRadio2">
|
||||
<el-radio :label="'0'">否</el-radio>
|
||||
<el-radio :label="'1'">是</el-radio>
|
||||
</el-radio-group>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -235,6 +257,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
activeName: 'roleList',
|
||||
editDialog: false,
|
||||
dialogTitle: '',
|
||||
@@ -242,7 +265,7 @@
|
||||
form: {
|
||||
pname: '顶级菜单',
|
||||
iconUrl: '',
|
||||
isShow: 1,
|
||||
isShow: '1',
|
||||
menuName: '',
|
||||
menuUrl: '',
|
||||
pageAliasName: '',
|
||||
@@ -252,8 +275,8 @@
|
||||
psid: '',
|
||||
remarks: '',
|
||||
sortNo: 0,
|
||||
sourceName: 'oms',
|
||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44'
|
||||
sourceName: 'wms',
|
||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa33'
|
||||
},
|
||||
formBackup: Object.assign({}, this.form),
|
||||
tableData: [],
|
||||
@@ -264,13 +287,17 @@
|
||||
params: {
|
||||
name: '',
|
||||
psid: '',
|
||||
sourceName: 'oms',
|
||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44'
|
||||
sourceName: 'wms',
|
||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa33'
|
||||
}
|
||||
},
|
||||
rank: '1',
|
||||
sourceNameData: [], // 资源
|
||||
isadd: false
|
||||
isadd: false,
|
||||
editShow: '1',
|
||||
addShow: '1',
|
||||
addMenuType: '1',
|
||||
editMenuType: '1',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -282,6 +309,22 @@
|
||||
// })
|
||||
},
|
||||
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) { // 分页
|
||||
this.page.current = val.pageNum
|
||||
this.page.size = val.pageSize
|
||||
@@ -291,7 +334,9 @@
|
||||
this.page.params = this.pageBackup
|
||||
},
|
||||
getPageList() { // 获取列表
|
||||
this.loading = true
|
||||
pageList(this.page).then((res) => {
|
||||
this.loading = false
|
||||
console.log('这里是条件查询', this.page)
|
||||
const treedata = res.data
|
||||
console.log('菜单列表', res)
|
||||
@@ -310,7 +355,14 @@
|
||||
handleClick(tab, event) {
|
||||
if (tab.name == 'addrole') {
|
||||
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 {
|
||||
this.getPageList()
|
||||
}
|
||||
@@ -325,7 +377,8 @@
|
||||
// this.dialogTitle = '新增'
|
||||
// this.editDialog = true
|
||||
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.pname = row.name || '顶级菜单'
|
||||
this.form.sourceName = row.sourceName
|
||||
@@ -337,17 +390,22 @@
|
||||
}
|
||||
},
|
||||
editRow(row) {
|
||||
console.log("editRow", row);
|
||||
this.dialogTitle = '编辑'
|
||||
this.editDialog = true
|
||||
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
|
||||
},
|
||||
save() {
|
||||
if (this.form.sid) {
|
||||
putMenusInfo(this.form).then(res => {
|
||||
this.editDialog = false
|
||||
this.getPageList(this.page)
|
||||
this.getPageList()
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
@@ -379,17 +437,15 @@
|
||||
delMenus({
|
||||
sid: row.sid
|
||||
}).then(res => {
|
||||
|
||||
loading.close()
|
||||
if (resp.success) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
this.getPageList(this.page)
|
||||
} else {
|
||||
// 根据resp.code进行异常情况处理
|
||||
}
|
||||
this.getPageList()
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: resp.msg,
|
||||
showClose: true
|
||||
})
|
||||
|
||||
}).catch(e => {
|
||||
loading.close()
|
||||
})
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<template>
|
||||
<div class="container" style="display: flex;">
|
||||
<div class="org-tree">
|
||||
<el-tree :data="treedata" node-key="sid" :props="props" :default-expanded-keys="['fd6435f2-0005-11ec-a033-48452053aa33']" @node-click="handleNodeClick">
|
||||
<span class="custom-tree-node" slot-scope="{ node, data }" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)" @click.stop.native>
|
||||
<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-tree :data="treedata" node-key="sid" :props="props"
|
||||
:default-expanded-keys="['fd6435f2-0005-11ec-a033-48452053aa33']" @node-click="handleNodeClick">
|
||||
<span class="custom-tree-node" slot-scope="{ node, data }" @mouseenter="mouseenter(data)"
|
||||
@mouseleave="mouseleave(data)">
|
||||
<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>
|
||||
</el-tooltip>
|
||||
@@ -17,8 +19,8 @@
|
||||
<!-- <el-button type="text" size="mini" @click.stop="() => remove(data)" icon="el-icon-delete">-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-tooltip>-->
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
<el-dialog title="编辑节点" :visible.sync="dialogVisible" width="50%" class="edit">
|
||||
@@ -37,13 +39,13 @@
|
||||
<td>主管人员</td>
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
<td>分管人员</td>
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -56,8 +58,10 @@
|
||||
<tr>
|
||||
<td>管理层级</td>
|
||||
<td>
|
||||
<el-select v-model="form.orgLevelValue" style="width:300px" placeholder="请选择" filterable @change="changeOrgLevel">
|
||||
<el-option v-for="item in orgLevel_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
|
||||
<el-select v-model="form.orgLevelValue" style="width:300px" placeholder="请选择" filterable
|
||||
@change="changeOrgLevel">
|
||||
<el-option v-for="item in orgLevel_list" :key="item.dictKey" :label="item.dictValue"
|
||||
:value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
<td>其他编码</td>
|
||||
@@ -73,7 +77,8 @@
|
||||
<td>组织属性</td>
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -105,6 +110,7 @@
|
||||
<el-button @click="dialogVisible = false">返 回</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<div class="org-table" v-show="isshow == 'table'">
|
||||
<div class="tab-header">
|
||||
<el-form ref="form" :inline="true" :model="form" label-width="80px">
|
||||
@@ -133,24 +139,24 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="组织名称" align="center"></el-table-column>
|
||||
<el-table-column prop="orgCode" label="组织编码" align="center"></el-table-column>
|
||||
<!-- <el-table-column prop="zgNames" label="主管" align="center"></el-table-column>-->
|
||||
<el-table-column prop="fgNames" label="分管" align="center"></el-table-column>
|
||||
<!--<el-table-column prop="contactMan" label="联系人" align="center" width="100px"></el-table-column>-->
|
||||
<el-table-column prop="linkPhone" label="联系人手机号" width="110" align="center">
|
||||
<el-table-column prop="name" label="组织名称" width="120" align="center"></el-table-column>
|
||||
<el-table-column prop="orgCode" label="组织编码" width="110" align="center"></el-table-column>
|
||||
<el-table-column prop="zgNames" label="主管" width="100" align="center"></el-table-column>
|
||||
<el-table-column prop="fgNames" label="分管" width="100" align="center"></el-table-column>
|
||||
<el-table-column prop="linkPerson" label="联系人" align="center" width="100px"></el-table-column>
|
||||
<el-table-column prop="linkPhone" label="联系人手机号" width="130" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="addrs" label="地址" align="center">
|
||||
</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 prop="qrText" label="二维码" align="center" width="80px">
|
||||
<!-- <el-table-column prop="qrText" label="二维码" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click.native.prevent="lookRow(scope.row)" type="text" size="small">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
</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 class="org-table" v-show="isshow == 'ewm'">
|
||||
@@ -211,13 +217,13 @@
|
||||
<td>主管人员</td>
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
<td>分管人员</td>
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -230,8 +236,10 @@
|
||||
<tr>
|
||||
<td>管理层级</td>
|
||||
<td>
|
||||
<el-select v-model="form.orgLevelValue" style="width:300px" placeholder="请选择" filterable @change="changeOrgLevel">
|
||||
<el-option v-for="item in orgLevel_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
|
||||
<el-select v-model="form.orgLevelValue" style="width:300px" placeholder="请选择" filterable
|
||||
@change="changeOrgLevel">
|
||||
<el-option v-for="item in orgLevel_list" :key="item.dictKey" :label="item.dictValue"
|
||||
:value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
<td>其他编码</td>
|
||||
@@ -247,7 +255,8 @@
|
||||
<td>组织属性</td>
|
||||
<td>
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -281,380 +290,406 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addOrgTree,
|
||||
delOrgtree,
|
||||
getQrCode, getStaff,
|
||||
getStaffName,
|
||||
orgList,
|
||||
pageList,
|
||||
postOrgtree,
|
||||
putOrgtree,
|
||||
selectBySid
|
||||
} from '@/api/system/departments/departments.js'
|
||||
import { typeValues } from '@/api/system/roleAdminister/index'
|
||||
import Position from '@/components/amap/amap.vue'
|
||||
import {
|
||||
addOrgTree,
|
||||
delOrgtree,
|
||||
getQrCode,
|
||||
getStaff,
|
||||
getStaffName,
|
||||
orgList,
|
||||
pageList,
|
||||
postOrgtree,
|
||||
putOrgtree,
|
||||
selectBySid
|
||||
} from '@/api/system/departments/departments.js'
|
||||
import {
|
||||
typeValues
|
||||
} from '@/api/system/roleAdminister/index'
|
||||
import Position from '@/components/amap/amap.vue'
|
||||
|
||||
export default {
|
||||
components: { Position },
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
mapDialog: false,
|
||||
dialogTitle: '',
|
||||
props: {
|
||||
label: 'name',
|
||||
children: 'children'
|
||||
},
|
||||
nodeForm: {
|
||||
sid: '',
|
||||
name: '',
|
||||
sortNo: ''
|
||||
},
|
||||
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: {
|
||||
export default {
|
||||
components: {
|
||||
Position
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
mapDialog: false,
|
||||
dialogTitle: '',
|
||||
props: {
|
||||
label: 'name',
|
||||
children: 'children'
|
||||
},
|
||||
nodeForm: {
|
||||
sid: '',
|
||||
name: '',
|
||||
organizationSid: '',
|
||||
psid: ''
|
||||
sortNo: ''
|
||||
},
|
||||
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: [],
|
||||
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.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'
|
||||
})
|
||||
append(data) {
|
||||
console.log(123456789, data)
|
||||
this.dialogTitle = '新增'
|
||||
this.isshow = 'edit'
|
||||
this.fgStaffSid = []
|
||||
this.form = Object.assign({}, this.formBackup)
|
||||
this.form.psid = data.sid || 0
|
||||
// this.form.organizationSid = this.$store.getters.userInfo.orgSid
|
||||
this.form.organizationSid = window.sessionStorage.getItem('orgSid')
|
||||
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)
|
||||
}
|
||||
})
|
||||
} 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'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
append(data) {
|
||||
console.log(123456789, data)
|
||||
this.dialogTitle = '新增'
|
||||
this.isshow = 'edit'
|
||||
this.fgStaffSid = []
|
||||
this.form = Object.assign({}, this.formBackup)
|
||||
this.form.psid = data.sid || 0
|
||||
this.form.organizationSid = this.$store.getters.userInfo.orgSid
|
||||
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 => {
|
||||
},
|
||||
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.handleNodeClick({ sid: data.psid })
|
||||
this.dialogVisible = false
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
lookRow(row) { // 查看二维码
|
||||
this.isshow = 'ewm'
|
||||
getQrCode({ sid: row.sid }).then(res => {
|
||||
this.ewmForm = res.data
|
||||
})
|
||||
},
|
||||
Printewm() {
|
||||
this.$print(this.$refs.print) // 使用
|
||||
},
|
||||
mouseenter(data) {
|
||||
this.$set(data, 'del', true)
|
||||
},
|
||||
mouseleave(data) {
|
||||
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)
|
||||
})
|
||||
},
|
||||
remove(data) {
|
||||
this.$confirm('确定要删除该组织吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delOrgtree({
|
||||
sid: data.sid
|
||||
}).then(res => {
|
||||
this.getOrgTree()
|
||||
this.handleNodeClick({
|
||||
sid: data.psid
|
||||
})
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
lookRow(row) { // 查看二维码
|
||||
this.isshow = 'ewm'
|
||||
getQrCode({
|
||||
sid: row.sid
|
||||
}).then(res => {
|
||||
this.ewmForm = res.data
|
||||
})
|
||||
},
|
||||
Printewm() {
|
||||
this.$print(this.$refs.print) // 使用
|
||||
},
|
||||
mouseenter(data) {
|
||||
this.$set(data, 'del', true)
|
||||
},
|
||||
mouseleave(data) {
|
||||
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>
|
||||
|
||||
<style>
|
||||
.el-icon-arrow-right:before {
|
||||
content: '\e6e0';
|
||||
color: #727272;
|
||||
}
|
||||
.el-icon-arrow-right:before {
|
||||
content: '\e6e0';
|
||||
color: #727272;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped="scoped" lang="scss">
|
||||
.org-tree {
|
||||
width: 240px;
|
||||
min-height: 100%;
|
||||
box-sizing: border-box;
|
||||
/*padding-right: 10px;*/
|
||||
border: 1px solid #edf1f7;
|
||||
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;
|
||||
.org-tree {
|
||||
width: 240px;
|
||||
min-height: 100%;
|
||||
box-sizing: border-box;
|
||||
/*padding-right: 10px;*/
|
||||
border: 1px solid #edf1f7;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.ediut {
|
||||
margin: 30px auto 0;
|
||||
/*width:750px;*/
|
||||
}
|
||||
}
|
||||
.org-table {
|
||||
flex: 1;
|
||||
// padding-left: 10px;
|
||||
margin: 0 10px;
|
||||
border: 1px solid #edf1f7;
|
||||
min-height: 100%;
|
||||
overflow-y: scroll;
|
||||
|
||||
.custom-tree-node {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
.ewm {
|
||||
margin: 30px auto 0;
|
||||
width: 560px;
|
||||
}
|
||||
|
||||
.handle {
|
||||
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;
|
||||
.ediut {
|
||||
margin: 30px auto 0;
|
||||
/*width:750px;*/
|
||||
}
|
||||
}
|
||||
|
||||
.el-input {
|
||||
width: 70%;
|
||||
.custom-tree-node {
|
||||
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 {
|
||||
border-left: 0 solid #e6e9f0;
|
||||
}
|
||||
.handle {
|
||||
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>
|
||||
|
||||
@@ -42,18 +42,16 @@
|
||||
<el-table-column prop="postLevel" label="职级" align="center"></el-table-column>
|
||||
<!-- <el-table-column prop="orgName" label="所属部门" align="center"></el-table-column> -->
|
||||
</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%">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>上级岗位</td>
|
||||
<td> <!-- @change="changeParentSid" -->
|
||||
<el-select v-model="roleForm.parentSid" filterable clearable placeholder="请选择"
|
||||
style="width:300px">
|
||||
<el-option v-for="item in parentSidList" :key="item.sid" :label="item.name"
|
||||
:value="item.sid">
|
||||
<td> <!-- @change="changeParentSid" -->
|
||||
<el-select v-model="roleForm.parentSid" filterable clearable placeholder="请选择" style="width:300px">
|
||||
<el-option v-for="item in parentSidList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
@@ -67,14 +65,16 @@
|
||||
<tr>
|
||||
<td>岗位职级</td>
|
||||
<td>
|
||||
<el-select v-model="roleForm.postLevel" @change="changeUPpostLevel" filterable placeholder="请选择" style="width:300px">
|
||||
<el-option v-for="item in postLevelList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey">
|
||||
</el-option>
|
||||
<el-select v-model="roleForm.postLevel" @change="changeUPpostLevel" filterable placeholder="请选择"
|
||||
style="width:300px">
|
||||
<el-option v-for="item in postLevelList" :key="item.dictKey" :label="item.dictValue"
|
||||
:value="item.dictKey">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>岗位编码</td>
|
||||
<td>岗位编码</td>
|
||||
<td>
|
||||
<el-input v-model="roleForm.postCode" style="width:300px"></el-input>
|
||||
</td>
|
||||
@@ -116,11 +116,9 @@
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>上级岗位</td>
|
||||
<td> <!-- @change="changeParentSid" -->
|
||||
<el-select v-model="roleForm.parentSid" filterable clearable placeholder="请选择"
|
||||
style="width:300px">
|
||||
<el-option v-for="item in parentSidList" :key="item.sid" :label="item.name"
|
||||
:value="item.sid">
|
||||
<td> <!-- @change="changeParentSid" -->
|
||||
<el-select v-model="roleForm.parentSid" filterable clearable placeholder="请选择" style="width:300px">
|
||||
<el-option v-for="item in parentSidList" :key="item.sid" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
@@ -135,9 +133,9 @@
|
||||
<td>岗位职级</td>
|
||||
<td>
|
||||
<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"
|
||||
:value="item.dictKey">
|
||||
:value="item.dictKey">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
@@ -179,30 +177,38 @@
|
||||
</template>
|
||||
|
||||
<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 {
|
||||
data() {
|
||||
return {
|
||||
dialogTitle: '',
|
||||
activeName: 'roleList',
|
||||
roleForm: {
|
||||
remarks: "",
|
||||
roleName: "",
|
||||
postCode: '',
|
||||
orgSid: '',
|
||||
postLevel: '',
|
||||
postLevelKey: '',
|
||||
parentSid:''
|
||||
},
|
||||
formBackup: {},
|
||||
search: {
|
||||
name: '',
|
||||
orgSid: ''
|
||||
},
|
||||
orgName: '',
|
||||
page: {
|
||||
total: 0, // 默认数据总数
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogTitle: '',
|
||||
activeName: 'roleList',
|
||||
roleForm: {
|
||||
remarks: "",
|
||||
roleName: "",
|
||||
postCode: '',
|
||||
orgSid: '',
|
||||
postLevel: '',
|
||||
postLevelKey: '',
|
||||
parentSid: ''
|
||||
},
|
||||
formBackup: {},
|
||||
search: {
|
||||
name: '',
|
||||
orgSid: window.sessionStorage.getItem('orgSid')
|
||||
},
|
||||
orgName: '',
|
||||
page: {
|
||||
total: 0, // 默认数据总数
|
||||
current: 1, // 默认开始页面
|
||||
size: 10, // 每页的数据条数
|
||||
},
|
||||
@@ -214,25 +220,25 @@ export default {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
// orgdata:[], // 部门
|
||||
checkedId: [],
|
||||
checkedId1: [],
|
||||
checkedId2: [],
|
||||
treedata: [],
|
||||
treedata1: [],
|
||||
treedata2: [],
|
||||
postLevelList: [],
|
||||
parentSidList: [],
|
||||
// chace: [],
|
||||
// roleDialog: false,
|
||||
// Thisrow: {},
|
||||
// orgListAll:[]
|
||||
};
|
||||
// orgdata:[], // 部门
|
||||
checkedId: [],
|
||||
checkedId1: [],
|
||||
checkedId2: [],
|
||||
treedata: [],
|
||||
treedata1: [],
|
||||
treedata2: [],
|
||||
postLevelList: [],
|
||||
parentSidList: [],
|
||||
// chace: [],
|
||||
// roleDialog: false,
|
||||
// Thisrow: {},
|
||||
// orgListAll:[]
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.formBackup = Object.assign({}, this.roleForm),
|
||||
this.getList()
|
||||
this.getOrgList()
|
||||
this.getList()
|
||||
// this.getOrgList()
|
||||
this.postLevel()
|
||||
this.getParent()
|
||||
},
|
||||
@@ -254,21 +260,24 @@ export default {
|
||||
this.roleTable = res.data.records
|
||||
})
|
||||
},
|
||||
postLevel(){
|
||||
pullDown({ psid: 0, type: 'postLevel' }).then((res)=>{
|
||||
if(res.code==='200'){
|
||||
this.postLevelList=res.data
|
||||
postLevel() {
|
||||
pullDown({
|
||||
psid: 0,
|
||||
type: 'postLevel'
|
||||
}).then((res) => {
|
||||
if (res.code === '200') {
|
||||
this.postLevelList = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getParent(){
|
||||
selectList().then((res)=>{
|
||||
if(res.code==='200'){
|
||||
this.parentSidList=res.data
|
||||
getParent() {
|
||||
selectList().then((res) => {
|
||||
if (res.code === '200') {
|
||||
this.parentSidList = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
changePostLevel(value){
|
||||
changePostLevel(value) {
|
||||
let bb = null
|
||||
this.postLevelList.forEach((e) => {
|
||||
if (e.dictKey == value) {
|
||||
@@ -278,10 +287,10 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
this.roleForm.postLevel=bb.name
|
||||
this.roleForm.postLevelKey=bb.value
|
||||
this.roleForm.postLevel = bb.name
|
||||
this.roleForm.postLevelKey = bb.value
|
||||
},
|
||||
changeUPpostLevel(value){
|
||||
changeUPpostLevel(value) {
|
||||
let bb = null
|
||||
this.postLevelList.forEach((e) => {
|
||||
if (e.dictKey == value) {
|
||||
@@ -291,8 +300,8 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
this.roleForm.postLevel=bb.name
|
||||
this.roleForm.postLevelKey=bb.value
|
||||
this.roleForm.postLevel = bb.name
|
||||
this.roleForm.postLevelKey = bb.value
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
if (tab.name == 'addrole') {
|
||||
@@ -359,6 +368,7 @@ export default {
|
||||
})
|
||||
}
|
||||
this.reset()
|
||||
this.getParent()
|
||||
},
|
||||
reset() {
|
||||
this.roleForm = {
|
||||
@@ -376,76 +386,76 @@ export default {
|
||||
getOrgList(row) {
|
||||
this.roleDialog = true
|
||||
this.checkedId = []
|
||||
// this.roleForm.roleName = row.roleName
|
||||
// this.roleForm.roleName = row.roleName
|
||||
this.Thisrow = row
|
||||
this.loading = true
|
||||
let params = {
|
||||
// roleSid: row.sid,
|
||||
// userType: '2'
|
||||
// roleSid: row.sid,
|
||||
// userType: '2'
|
||||
}
|
||||
|
||||
orgList(params).then(res => {
|
||||
this.treedata = res.data
|
||||
this.treedata1 = res.data
|
||||
this.treedata2 = res.data
|
||||
// this.getTreeParentNode(res.data, this.checkedId)
|
||||
// this.getTreeParentid(res.data)
|
||||
// this.getTreeParentNode(res.data, this.checkedId)
|
||||
// this.getTreeParentid(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
|
||||
},
|
||||
// // 递归查询所有上级数据
|
||||
// getTreeParentNode(menus, ids) {
|
||||
// for (var i = 0; i < menus.length; i++) {
|
||||
// if (menus[i].children && menus[i].children.length != 0) {
|
||||
// this.getTreeParentNode(menus[i].children, ids)
|
||||
// } else if (menus[i].isCheck) {
|
||||
// ids.push(menus[i].sid)
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// // 所有一级菜单ID
|
||||
// getTreeParentid(menus) {
|
||||
// for (var i = 0; i < menus.length; i++) {
|
||||
// this.chace.push(menus[i].sid)
|
||||
// }
|
||||
// },
|
||||
// getCheckedKeys() {
|
||||
// let _this = this
|
||||
// let roleMenus = []
|
||||
// this.$refs.Tree.getCheckedKeys().forEach(val => {
|
||||
// roleMenus.push({
|
||||
// menuSid: val,
|
||||
// orgSid: _this.$store.getters.userInfo.orgSid,
|
||||
// roleSid: _this.Thisrow.sid
|
||||
// })
|
||||
// })
|
||||
// let parentTrue = this.$refs.Tree.getHalfCheckedKeys()
|
||||
// for (let i = 0; i < parentTrue.length; i++) {
|
||||
// for (let j = 0; j < this.chace.length; j++) {
|
||||
// if (parentTrue[i] == this.chace[j]) {
|
||||
// parentTrue.splice(i, 1);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// parentTrue.forEach(val => {
|
||||
// roleMenus.push({
|
||||
// menuSid: val,
|
||||
// orgSid: _this.$store.getters.userInfo.orgSid,
|
||||
// roleSid: _this.Thisrow.sid
|
||||
// })
|
||||
// })
|
||||
// saveorgrolemenus({
|
||||
// roleSid: _this.Thisrow.sid,
|
||||
// roleMenus: roleMenus
|
||||
// }).then(res => {
|
||||
// this.roleDialog = false
|
||||
// this.$message({
|
||||
// message: res.msg,
|
||||
// type: 'success'
|
||||
// })
|
||||
// })
|
||||
// },
|
||||
// // 递归查询所有上级数据
|
||||
// getTreeParentNode(menus, ids) {
|
||||
// for (var i = 0; i < menus.length; i++) {
|
||||
// if (menus[i].children && menus[i].children.length != 0) {
|
||||
// this.getTreeParentNode(menus[i].children, ids)
|
||||
// } else if (menus[i].isCheck) {
|
||||
// ids.push(menus[i].sid)
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// // 所有一级菜单ID
|
||||
// getTreeParentid(menus) {
|
||||
// for (var i = 0; i < menus.length; i++) {
|
||||
// this.chace.push(menus[i].sid)
|
||||
// }
|
||||
// },
|
||||
// getCheckedKeys() {
|
||||
// let _this = this
|
||||
// let roleMenus = []
|
||||
// this.$refs.Tree.getCheckedKeys().forEach(val => {
|
||||
// roleMenus.push({
|
||||
// menuSid: val,
|
||||
// orgSid: _this.$store.getters.userInfo.orgSid,
|
||||
// roleSid: _this.Thisrow.sid
|
||||
// })
|
||||
// })
|
||||
// let parentTrue = this.$refs.Tree.getHalfCheckedKeys()
|
||||
// for (let i = 0; i < parentTrue.length; i++) {
|
||||
// for (let j = 0; j < this.chace.length; j++) {
|
||||
// if (parentTrue[i] == this.chace[j]) {
|
||||
// parentTrue.splice(i, 1);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// parentTrue.forEach(val => {
|
||||
// roleMenus.push({
|
||||
// menuSid: val,
|
||||
// orgSid: _this.$store.getters.userInfo.orgSid,
|
||||
// roleSid: _this.Thisrow.sid
|
||||
// })
|
||||
// })
|
||||
// saveorgrolemenus({
|
||||
// roleSid: _this.Thisrow.sid,
|
||||
// roleMenus: roleMenus
|
||||
// }).then(res => {
|
||||
// this.roleDialog = false
|
||||
// this.$message({
|
||||
// message: res.msg,
|
||||
// type: 'success'
|
||||
// })
|
||||
// })
|
||||
// },
|
||||
checkchange(data, checked, indeterminate) {
|
||||
if (checked) {
|
||||
|
||||
@@ -461,7 +471,7 @@ export default {
|
||||
checkchange1(data, checked, indeterminate) {
|
||||
if (checked) {
|
||||
this.roleForm.orgSid = data.sid
|
||||
// this.orgName = data.name
|
||||
// this.orgName = data.name
|
||||
let arr = []
|
||||
arr = [data.sid];
|
||||
this.$refs.Tree1.setCheckedKeys(arr);
|
||||
@@ -471,7 +481,7 @@ export default {
|
||||
checkchange2(data, checked, indeterminate) {
|
||||
if (checked) {
|
||||
this.roleForm.orgSid = data.sid
|
||||
// this.orgName = data.name
|
||||
// this.orgName = data.name
|
||||
let arr = []
|
||||
arr = [data.sid];
|
||||
this.$refs.Tree2.setCheckedKeys(arr);
|
||||
@@ -490,7 +500,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-select > .el-input {
|
||||
.el-select>.el-input {
|
||||
display: block;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,9 +4,9 @@
|
||||
<el-tab-pane label="用户列表" name="roleList">
|
||||
<user-manage-list :dataObj='dataObj' @status='isShow' @item='listObj'></user-manage-list>
|
||||
</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>
|
||||
</el-tab-pane>-->
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
@@ -37,9 +37,9 @@
|
||||
handleClick(tab, event) {
|
||||
if (tab.name == 'addrole') {
|
||||
this.dialogTitle = '新增'
|
||||
// this.roleForm = Object.assign({}, this.formBackup)
|
||||
// this.roleForm = Object.assign({}, this.formBackup)
|
||||
} else {
|
||||
// this.getroleOrgList()
|
||||
// this.getroleOrgList()
|
||||
}
|
||||
},
|
||||
isShow(val) {
|
||||
|
||||
@@ -1,73 +1,56 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="box-card">
|
||||
<table class="e-table" cellspacing="0">
|
||||
<tr>
|
||||
<td>姓名</td>
|
||||
<td>
|
||||
<el-input v-model="form.name" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>用户类型</td>
|
||||
<td>
|
||||
<el-select v-model="form.userType" @change="$forceUpdate()" style="width:300px">
|
||||
<el-option v-for="(item, i) in userTypeData" :key="i" :label="item.name" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>部门</td>
|
||||
<td>
|
||||
<el-select v-model="form.deptSid" placeholder="请选择" style="width:300px">
|
||||
<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"
|
||||
:default-checked-keys="checkedId" :default-expand-all='true' :check-strictly='true'
|
||||
:props="defaultProps" @check-change="checkchange">
|
||||
</el-tree>
|
||||
</el-select>
|
||||
<!--<el-select v-model="form.deptSid" @change="$forceUpdate()">
|
||||
<el-option
|
||||
v-for="(item, i) in treedata"
|
||||
:key="i"
|
||||
:label="item.name"
|
||||
:value="item.sid">
|
||||
</el-option>
|
||||
</el-select>-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>岗位</td>
|
||||
<td>
|
||||
<el-select v-model="form.postSid" @change="$forceUpdate()" style="width:300px">
|
||||
<el-option v-for="(item, i) in postSidData" :key="i" :label="item.name" :value="item.sid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!--<el-input v-model="form.postSid"></el-input>-->
|
||||
</td>
|
||||
</tr>
|
||||
<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>
|
||||
<el-card class="box-card" style="padding-left: 50px;">
|
||||
|
||||
<el-checkbox class="checkbox" v-model="accountType" @change="canLoginChange">允许登录</el-checkbox>
|
||||
|
||||
<div style="display: flex;flex-direction: row;width: 100%;margin-top: 10px;">
|
||||
<div style="display: flex;flex-direction: row;flex: 1 ; align-items: center;">
|
||||
<span style="width: 80px;text-align: right;"><span class="must">*</span> 用户名:</span>
|
||||
<el-input style="margin-left: 10px;flex: 1 " v-model="form.userName"></el-input>
|
||||
</div>
|
||||
<div style="display: flex;flex-direction: row;flex: 1 ;align-items: center;margin-left: 20px;">
|
||||
<span style="width: 80px;text-align: right;"><span class="must">*</span> 姓名:</span>
|
||||
<el-input style="margin-left: 10px; flex: 1" v-model="form.name"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex;flex-direction: row;width: 100%;margin-top: 10px;">
|
||||
<div style="display: flex;flex-direction: row;flex: 1 ; align-items: center;">
|
||||
<span style="width: 80px;text-align: right;"><span class="must">*</span> 部门:</span>
|
||||
<el-select v-model="form.sysStaffOrg.orgName" placeholder="请选择" style="margin-left: 10px; flex: 0.8;">
|
||||
<el-option hidden :key="form.sysStaffOrg.orgSid" :label="form.sysStaffOrg.orgName"
|
||||
:value="form.sysStaffOrg.orgName"></el-option>
|
||||
<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"
|
||||
@check-change="checkchange">
|
||||
</el-tree>
|
||||
</el-select>
|
||||
<el-checkbox class="checkbox" style="margin-left: 15px;" v-model="manageType"
|
||||
@change="manageTypeChange">主管</el-checkbox>
|
||||
</div>
|
||||
<div style="display: flex;flex-direction: row;flex: 1 ;align-items: center;margin-left: 20px;">
|
||||
<span style="width: 80px;text-align: right;"><span class="must">*</span> 角色:</span>
|
||||
<el-select v-model="form.roleSid" placeholder="请选择" style="margin-left: 10px; flex: 1" filterable multiple
|
||||
@change="roleChange">
|
||||
<el-option v-for="(item,i) in roleListAll" :key="i" :label="item.name" :value="item.sid"></el-option>
|
||||
</el-select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex;flex-direction: row;width: 100%;margin-top: 10px;">
|
||||
<div style="display: flex;flex-direction: row;flex: 1 ; align-items: center;">
|
||||
<span style="width: 80px;text-align: right;">备注:</span>
|
||||
<el-input style="margin-left: 10px; flex: 0.8" v-model="form.remarks"></el-input>
|
||||
<el-checkbox class="checkbox" style="margin-left: 15px;" v-model="userType"
|
||||
@change="supplierChange">供应商账号</el-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<el-button type="primary" @click="save()">保 存</el-button>
|
||||
<!--<el-button type="warning" @click="cancel()">取 消</el-button>-->
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -79,69 +62,107 @@
|
||||
userSingle,
|
||||
orgList,
|
||||
postList,
|
||||
getCode
|
||||
getCode,
|
||||
roleList,
|
||||
} from '@/api/system/userManage/index.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
sid: '',
|
||||
name: '',
|
||||
userType: '',
|
||||
deptSid: '',
|
||||
postSid: '',
|
||||
mobile: '',
|
||||
verificationCode: ''
|
||||
"userName": "",
|
||||
"name": "",
|
||||
"sysStaffOrg": {
|
||||
"orgSid": "",
|
||||
"orgName": "",
|
||||
"orgCode": "",
|
||||
"manageType": "3"
|
||||
},
|
||||
"sysUserRoles": [],
|
||||
"remarks": "",
|
||||
"userType": "1",
|
||||
"accountType": "3",
|
||||
"orgSid": window.sessionStorage.getItem('orgSid')
|
||||
},
|
||||
form1: {
|
||||
sid: '',
|
||||
},
|
||||
userTypeData: [{
|
||||
value: '1',
|
||||
name: '员工'
|
||||
}, {
|
||||
value: '2',
|
||||
name: '主管'
|
||||
}, {
|
||||
value: '3',
|
||||
name: '经理'
|
||||
}],
|
||||
accountType: false,
|
||||
manageType: false,
|
||||
userType: false,
|
||||
treedata: [],
|
||||
checkedId: [],
|
||||
orgName: '',
|
||||
// orgName: '',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
postSidData: [],
|
||||
showCode: true,
|
||||
phoneCodeCount: '',
|
||||
timer: null,
|
||||
roleListAll: []
|
||||
};
|
||||
},
|
||||
props: ['dataObj'],
|
||||
watch: {
|
||||
dataObj: {
|
||||
handler(val) {
|
||||
this.form1.sid = val.sid
|
||||
this.getUserSingle()
|
||||
this.getOrgList()
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
// watch: {
|
||||
// dataObj: {
|
||||
// handler(val) {
|
||||
// this.form1.sid = val.sid
|
||||
// this.getUserSingle()
|
||||
// this.getOrgList()
|
||||
// },
|
||||
// deep: true,
|
||||
// },
|
||||
// },
|
||||
mounted() {
|
||||
this.getOrgList()
|
||||
this.getRoleList()
|
||||
},
|
||||
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() {
|
||||
userSingle(this.form1).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.form.sid = res.data.sid
|
||||
this.form.name = res.data.name
|
||||
this.form.userType = res.data.userType
|
||||
this.form.deptSid = res.data.deptSid
|
||||
this.form.orgSid = res.data.orgSid
|
||||
this.orgName = res.data.departmentName
|
||||
this.form.postSid = res.data.postSid
|
||||
this.form.mobile = res.data.mobile
|
||||
@@ -149,29 +170,42 @@
|
||||
})
|
||||
},
|
||||
// 获取部门树形
|
||||
getOrgList(row) {
|
||||
getOrgList() {
|
||||
// this.roleDialog = true
|
||||
this.checkedId = []
|
||||
this.Thisrow = row
|
||||
this.loading = true
|
||||
let params = {}
|
||||
orgList(params).then(res => {
|
||||
orgList(window.sessionStorage.getItem('orgSid')).then(res => {
|
||||
this.treedata = res.data
|
||||
})
|
||||
|
||||
},
|
||||
treeNodeClick() {
|
||||
this.$refs.el_select.visible = false
|
||||
},
|
||||
checkchange(data, checked, indeterminate) {
|
||||
if (checked) {
|
||||
|
||||
this.form.deptSid = data.sid
|
||||
this.orgName = data.name
|
||||
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);
|
||||
this.form.postSid = ''
|
||||
this.getPost(data.sid)
|
||||
|
||||
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) {
|
||||
let params = {
|
||||
@@ -182,8 +216,44 @@
|
||||
})
|
||||
},
|
||||
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) {
|
||||
userUpdata(this.form).then(res => {
|
||||
userUpdatauserUpdata(this.form).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
@@ -193,8 +263,6 @@
|
||||
}
|
||||
})
|
||||
} else {
|
||||
let orgSid = this.$refs.Tree.getCheckedKeys()
|
||||
this.form.deptSid = orgSid.toString()
|
||||
userAdd(this.form).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.$message({
|
||||
@@ -210,14 +278,24 @@
|
||||
this.reset()
|
||||
},
|
||||
reset() {
|
||||
this.accountType = false
|
||||
this.manageType = false
|
||||
this.userType = false
|
||||
|
||||
this.form = {
|
||||
sid: '',
|
||||
name: '',
|
||||
userType: '',
|
||||
deptSid: '',
|
||||
postSid: '',
|
||||
mobile: '',
|
||||
verificationCode: ''
|
||||
"userName": "",
|
||||
"name": "",
|
||||
"sysStaffOrg": {
|
||||
"orgSid": "",
|
||||
"orgName": "",
|
||||
"orgCode": "",
|
||||
"manageType": "3"
|
||||
},
|
||||
"sysUserRoles": [],
|
||||
"remarks": "",
|
||||
"userType": "1",
|
||||
"accountType": "3",
|
||||
"orgSid": window.sessionStorage.getItem('orgSid')
|
||||
}
|
||||
},
|
||||
//获取验证码
|
||||
@@ -261,4 +339,11 @@
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.checkbox {
|
||||
zoom: 130%;
|
||||
}
|
||||
|
||||
.must {
|
||||
color: #f00;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
<el-form-item label="用户名">
|
||||
<el-input v-model="page.params.userName" clearable></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="姓名">
|
||||
<el-input v-model="search.name" clearable></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="page.params.name" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色">
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="部门"> -->
|
||||
<!-- <el-input v-model="page.params.orgName" clearable></el-input> -->
|
||||
<!-- <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-select>-->
|
||||
<!-- <el-input v-model="page.params.orgName" clearable></el-input> -->
|
||||
<!-- <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-select>-->
|
||||
<!-- </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-refresh" size="small" @click="handleReset">重置</el-button>
|
||||
@@ -31,7 +31,7 @@
|
||||
<el-table :data="userTable" border style="width: 100%;">
|
||||
<el-table-column label="序号" width="80px" type="index" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300px" align="center">
|
||||
<el-table-column label="操作" width="350px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<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>
|
||||
<!-- <el-button @click="del(scope.row)" type="danger" size="mini">
|
||||
删除
|
||||
</el-button>-->
|
||||
<el-button @click="userinfoChange(scope.row)" type="primary" size="mini">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="del(scope.row)" type="danger" size="mini">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userName" label="用户名" align="center">
|
||||
@@ -50,10 +53,16 @@
|
||||
{{ scope.row.userName }}
|
||||
</template>
|
||||
</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="departmentName" label="部门" align="center"></el-table-column> -->
|
||||
<!-- <el-table-column prop="postName" label="岗位" align="center"></el-table-column> -->
|
||||
<el-table-column prop="roleName" 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">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEnable" active-value='1' inactive-value='0' active-color="#13ce66"
|
||||
@@ -61,6 +70,7 @@
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination" />
|
||||
<!-- 角色设置 -->
|
||||
@@ -89,7 +99,7 @@
|
||||
:value="item.departmentSid"
|
||||
></el-option>
|
||||
</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
|
||||
icon="el-icon-plus"></el-button>
|
||||
</el-form-item>
|
||||
@@ -100,59 +110,55 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 编辑信息 -->
|
||||
<el-dialog title="编辑用户信息" :visible.sync="editDialog" width="40%">
|
||||
<table class="e-table" cellspacing="0" style="margin-top: -30px;">
|
||||
<tr>
|
||||
<td>姓名</td>
|
||||
<td>
|
||||
<el-input v-model="form.name" style="width:300px"></el-input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>用户类型</td>
|
||||
<td>
|
||||
<el-select v-model="form.userTypeKey" @change="$forceUpdate()" style="width:300px">
|
||||
<el-option v-for="(item, i) in userTypeData" :key="i" :label="item.name" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td>部门</td>
|
||||
<td>
|
||||
<el-select v-model="form.deptSid" placeholder="请选择" @change="$forceUpdate()" style="width:300px">
|
||||
<el-option hidden :key="form.deptSid" :label="orgName" :value="form.deptSid"></el-option>
|
||||
<el-dialog title="编辑用户信息" :visible.sync="editDialog" width="60%">
|
||||
<el-form :model="form">
|
||||
|
||||
<el-checkbox class="checkbox" v-model="accountType" @change="canLoginChange">允许登录</el-checkbox>
|
||||
|
||||
<div style="display: flex;flex-direction: row;width: 100%;margin-top: 10px;">
|
||||
<div style="display: flex;flex-direction: row;flex: 1 ; align-items: center;">
|
||||
<span style="width: 80px;text-align: right;"><span class="must">*</span> 用户名:</span>
|
||||
<el-input style="margin-left: 10px;flex: 1 " v-model="form.userName"></el-input>
|
||||
</div>
|
||||
<div style="display: flex;flex-direction: row;flex: 1 ;align-items: center;margin-left: 20px;">
|
||||
<span style="width: 80px;text-align: right;"><span class="must">*</span> 姓名:</span>
|
||||
<el-input style="margin-left: 10px; flex: 1" v-model="form.name"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex;flex-direction: row;width: 100%;margin-top: 10px;">
|
||||
<div style="display: flex;flex-direction: row;flex: 1 ; align-items: center;">
|
||||
<span style="width: 80px;text-align: right;"><span class="must">*</span> 部门:</span>
|
||||
<el-select v-model="form.sysStaffOrg.orgName" placeholder="请选择" style="margin-left: 10px; flex: 0.8;">
|
||||
<el-option hidden :key="form.sysStaffOrg.orgSid" :label="form.sysStaffOrg.orgName"
|
||||
:value="form.sysStaffOrg.orgName"></el-option>
|
||||
<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" @check-change="checkchange">
|
||||
</el-tree>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr> -->
|
||||
<!-- <tr>
|
||||
<td>岗位</td>
|
||||
<td>
|
||||
<el-select v-model="form.postSid" @change="$forceUpdate()" style="width:300px">
|
||||
<el-option v-for="(item, i) in postSidData" :key="i" :label="item.name" :value="item.sid"></el-option>
|
||||
<el-checkbox class="checkbox" style="margin-left: 15px;" v-model="manageType"
|
||||
@change="manageTypeChange">主管</el-checkbox>
|
||||
</div>
|
||||
<div style="display: flex;flex-direction: row;flex: 1 ;align-items: center;margin-left: 20px;">
|
||||
<span style="width:80px;text-align: right;"><span class="must">*</span> 角色:</span>
|
||||
<el-select v-model="form.roleSid" placeholder="请选择" style="margin-left: 10px; flex: 1" filterable multiple
|
||||
@change="roleChange">
|
||||
<el-option v-for="(item,i) in roleListAll" :key="i" :label="item.name" :value="item.sid"></el-option>
|
||||
</el-select>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<td>手机号码</td>
|
||||
<td>
|
||||
<el-input v-model="form.userName" 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>
|
||||
</td>
|
||||
</tr> -->
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex;flex-direction: row;width: 100%;margin-top: 10px;">
|
||||
<div style="display: flex;flex-direction: row;flex: 1 ; align-items: center;">
|
||||
<span style="width: 80px;text-align: right;">备注:</span>
|
||||
<el-input style="margin-left: 10px; flex: 0.8" v-model="form.remarks"></el-input>
|
||||
<el-checkbox class="checkbox" style="margin-left: 15px;" v-model="userType"
|
||||
@change="supplierChange">供应商账号</el-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<el-button type="primary" @click="save()">保 存</el-button>
|
||||
<el-button @click="editDialog = false">关 闭</el-button>
|
||||
@@ -172,40 +178,23 @@
|
||||
saveOrgRole,
|
||||
roleList,
|
||||
setRoleEnable,
|
||||
userUpdata
|
||||
userUpdata,
|
||||
userAdd,
|
||||
userSingle,
|
||||
getCode,
|
||||
initUserInfo
|
||||
} from '@/api/system/userManage/index.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
editDialog: false,
|
||||
form: {},
|
||||
userTypeData: [{
|
||||
value: '1',
|
||||
name: '员工'
|
||||
}, {
|
||||
value: '2',
|
||||
name: '主管'
|
||||
}, {
|
||||
value: '3',
|
||||
name: '经理'
|
||||
}],
|
||||
checkedId: [],
|
||||
orgName: '',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
showCode: true,
|
||||
postSidData: [],
|
||||
phoneCodeCount: '',
|
||||
roleListAll: [],
|
||||
props: {
|
||||
value: 'sid',
|
||||
label: 'name',
|
||||
children: 'orgDepartmentVoList'
|
||||
},
|
||||
treedata: null,
|
||||
page: {
|
||||
total: 0, // 默认数据总数
|
||||
current: 1, // 默认开始页面
|
||||
@@ -215,15 +204,16 @@
|
||||
userName: '',
|
||||
roleSid: '',
|
||||
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: [],
|
||||
// 设置角色
|
||||
formLabelWidth: '100',
|
||||
roleDialog: false,
|
||||
roleList: [],
|
||||
roleForm: {
|
||||
roleSid: '',
|
||||
userSid: ''
|
||||
@@ -235,6 +225,10 @@
|
||||
departmentSid: ''
|
||||
},
|
||||
bm_List: [],
|
||||
// 设置角色
|
||||
formLabelWidth: '100',
|
||||
roleDialog: false,
|
||||
roleList: [],
|
||||
rules: {
|
||||
roleSid: [{
|
||||
required: true,
|
||||
@@ -246,7 +240,32 @@
|
||||
message: '请选择部门名称',
|
||||
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'],
|
||||
@@ -258,13 +277,88 @@
|
||||
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() {
|
||||
this.getOrgUserList()
|
||||
this.getRoleList()
|
||||
this.getOrgTree()
|
||||
this.getOrgList()
|
||||
// this.getOrgList()
|
||||
|
||||
},
|
||||
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() {
|
||||
userList(this.page).then(res => {
|
||||
@@ -283,7 +377,7 @@
|
||||
userName: '',
|
||||
roleSid: '',
|
||||
orgSid: window.sessionStorage.getItem('orgSid'),
|
||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa44'
|
||||
sourceSid: 'd936f1ba-03c3-11ec-bf08-48452053aa33'
|
||||
|
||||
},
|
||||
}
|
||||
@@ -304,17 +398,29 @@
|
||||
this.getOrgUserList()
|
||||
},
|
||||
getOrgTree() { // 获取部门树形列表
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.checkedId = []
|
||||
// this.Thisrow = row
|
||||
this.loading = true
|
||||
let params = {}
|
||||
orgList(window.sessionStorage.getItem('orgSid')).then(res => {
|
||||
|
||||
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 => {
|
||||
// let tree = res.data[0].orgDepartmentVoList
|
||||
// treeArr(tree)
|
||||
@@ -380,20 +486,16 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置部门 提交
|
||||
save(formName) {
|
||||
this.form.userType = this.form.userTypeKey;
|
||||
save() {
|
||||
userUpdata(this.form).then(res => {
|
||||
if (res.code === '200') {
|
||||
this.getOrgUserList()
|
||||
this.bm_Dialog = false
|
||||
if (res.code == '200') {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success'
|
||||
})
|
||||
this.editDialog = false
|
||||
this.$emit('status', false)
|
||||
}
|
||||
this.reset()
|
||||
})
|
||||
},
|
||||
initPwd(row) {
|
||||
@@ -414,10 +516,25 @@
|
||||
},
|
||||
// 修改用户信息
|
||||
userinfoChange(row) {
|
||||
var postSid = row.postSid
|
||||
this.editDialog = true
|
||||
this.form = Object.assign({}, row)
|
||||
this.postSid = postSid
|
||||
initUserInfo(row).then(res => {
|
||||
if (res.code == '200') {
|
||||
this.editDialog = true
|
||||
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.$refs.Tree.setChecked(this.form.departmentSid, true, true)
|
||||
// })
|
||||
@@ -446,29 +563,29 @@
|
||||
this.$router.push('/' + src)
|
||||
},
|
||||
// 获取部门树形
|
||||
getOrgList(row) {
|
||||
// this.roleDialog = true
|
||||
this.checkedId = []
|
||||
this.Thisrow = row
|
||||
this.loading = true
|
||||
let params = {}
|
||||
orgList(params).then(res => {
|
||||
this.treedata = res.data
|
||||
})
|
||||
// getOrgList(row) {
|
||||
// // this.roleDialog = true
|
||||
// this.checkedId = []
|
||||
// this.Thisrow = row
|
||||
// this.loading = true
|
||||
// let params = {}
|
||||
// orgList(params).then(res => {
|
||||
// this.treedata = res.data
|
||||
// })
|
||||
|
||||
},
|
||||
checkchange(data, checked, indeterminate) {
|
||||
if (checked) {
|
||||
this.form.deptSid = data.sid
|
||||
this.orgName = data.name
|
||||
let arr = []
|
||||
arr = [data.sid]
|
||||
this.$refs.Tree.setCheckedKeys(arr)
|
||||
this.form.postSid = ''
|
||||
this.getPost(data.sid)
|
||||
return
|
||||
}
|
||||
},
|
||||
// },
|
||||
// checkchange(data, checked, indeterminate) {
|
||||
// if (checked) {
|
||||
// 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) {
|
||||
let params = {
|
||||
sid: orgSid
|
||||
|
||||
Reference in New Issue
Block a user