Browse Source

同步sys-ui代码

master
陈裕财 4 years ago
parent
commit
24718d9e1b
  1. 2
      config/dev.env.js
  2. 6
      config/index.js
  3. 6
      config/prod.env.js
  4. 6
      config/sit.env.js
  5. 7
      src/api/branch.js
  6. 3
      src/api/login.js
  7. 3
      src/api/mdp/arc/imageCategory.js
  8. 208
      src/api/mdp/sys/branch.js
  9. 4
      src/api/mdp/sys/order.js
  10. 4
      src/api/mdp/sys/post/deptPost.js
  11. 3
      src/api/mdp/sys/post/deptPostUser.js
  12. 3
      src/api/mdp/sys/role.js
  13. 25
      src/api/mdp/sys/user.js
  14. 11
      src/common/config.js
  15. 8
      src/common/js/util.js
  16. 1
      src/components/Image/ShearSelectUpload.vue
  17. 20
      src/components/ModulesMenu/allMenus.vue
  18. 89
      src/components/ModulesMenu/modulesOfRouter.js
  19. 15
      src/components/NoticeMsgBar/index.vue
  20. 2
      src/components/Tinymce/index.vue
  21. 5
      src/components/TopModules/index.vue
  22. 9
      src/lang/index.js
  23. 2
      src/mock/index.js
  24. 2
      src/permission.js
  25. 43
      src/router/index.js
  26. 58
      src/router/routes_order.js
  27. 3
      src/router/routes_workflow.js
  28. 3
      src/store/getters.js
  29. 2
      src/store/index.js
  30. 4
      src/store/modules/user.js
  31. 1
      src/styles/sidebar.scss
  32. 9
      src/styles/variables.scss
  33. 2
      src/views/example/table/treeTable/customTreeTable.vue
  34. 4
      src/views/layout/components/Navbar.vue
  35. 33
      src/views/layout/components/Sidebar/SidebarItem.vue
  36. 49
      src/views/layout/components/UserInfo.vue
  37. 20
      src/views/login/components/login.vue
  38. 54
      src/views/login/components/register.vue
  39. 20
      src/views/login/resetPassword.vue
  40. 10
      src/views/mdp/arc/archiveAttachment/AttachmentUpload.vue
  41. 14
      src/views/mdp/arc/category/CategoryTree.vue
  42. 8
      src/views/mdp/form/formData/FormDataMng.vue
  43. 8
      src/views/mdp/form/formDef/FormDefMng.vue
  44. 359
      src/views/mdp/meta/item/ItemAdd.vue
  45. 447
      src/views/mdp/meta/item/ItemEdit.vue
  46. 227
      src/views/mdp/meta/item/ItemMng.vue
  47. 11
      src/views/mdp/meta/itemOption/ItemOptionAdd.vue
  48. 8
      src/views/mdp/meta/itemOption/ItemOptionEdit.vue
  49. 68
      src/views/mdp/meta/itemOption/ItemOptionMng.vue
  50. 249
      src/views/mdp/meta/sysParam/SysParamMng.vue
  51. 6
      src/views/mdp/sys/branch/BranchSelect.vue
  52. 140
      src/views/mdp/sys/dept/DeptTree.vue
  53. 32
      src/views/mdp/sys/post/PostSelectCommon.vue
  54. 340
      src/views/mdp/sys/user/UsersSelect.vue
  55. 94
      src/views/mdp/sys/userDept/UserDeptEdit.vue
  56. 8
      src/views/mdp/workflow/hi/procinst/ProcinstMng.vue
  57. 8
      src/views/mdp/workflow/re/procdef/ProcdefListForParames.vue
  58. 2
      src/views/mdp/workflow/re/procdef/ProcdefListForSimpleStart.vue
  59. 8
      src/views/mdp/workflow/re/procdef/ProcdefListForStart.vue
  60. 8
      src/views/mdp/workflow/re/procdef/ProcdefMng.vue
  61. 8
      src/views/mdp/workflow/re/procdef/ProcdefSuspend.vue
  62. 6
      src/views/mdp/workflow/re/procdefParames/ProcdefParamesSet.vue
  63. 8
      src/views/mdp/workflow/ru/execution/ExecutionMng.vue
  64. 8
      src/views/mdp/workflow/ru/execution/ExecutionMngForFormData.vue
  65. 6
      src/views/mdp/workflow/ru/procinstParames/ProcinstNodeInfoSet.vue
  66. 22
      src/views/mdp/workflow/ru/procinstParames/ProcinstParamesExecutionSet.vue
  67. 6
      src/views/mdp/workflow/ru/procinstParames/ProcinstParamesStartSet.vue
  68. 8
      src/views/mdp/workflow/ru/task/TaskMng.vue
  69. 24
      src/views/mdp/workflow/ru/task/candidate/TaskCandidateSet.vue
  70. 1
      src/views/myWork/message/index.scss
  71. 61
      src/views/myWork/message/index.vue
  72. 2
      src/views/myWork/my/components/moduleSet.vue
  73. 32
      src/views/myWork/my/index.vue
  74. 6
      src/views/myWork/set/ChangeEmailStepOne.vue
  75. 2
      src/views/myWork/set/ChangeEmailStepTwo.vue
  76. 47
      src/views/myWork/set/index.vue
  77. 42
      src/views/order/createOrder.vue
  78. 70
      src/views/order/enterprise.vue
  79. 2
      src/views/order/flagShip.vue
  80. 48
      src/views/order/index.scss
  81. 29
      src/views/order/index.vue

2
config/dev.env.js

@ -2,6 +2,6 @@ module.exports = {
NODE_ENV: '"development"',
ENV_CONFIG: '"dev"',//环境版本号 如npm run build:${ENV_CONFIG},建议与spring.profiles.active=${ENV_CONFIG}一一对应
VERSION: '"m1"',//产品版本号,nginx中通过此版本号导航到不同的静态资源目录,请求路径中用法如下:静态页面url=${DOMAIN}/${CONTEXT}/${VERSION}/#/{router.path}?${queryString}
CONTEXT:'"xm"',//对应spring中的server.context-path
CONTEXT:'"sys"',//对应spring中的server.context-path
BASE_API: '"api"'//api访问的统一入口,最后形成的apiUrl=${BASE_API}/${VERSION}/${spring.application.name}/${CONTEXT}/${ctrlUrl}
}

6
config/index.js

@ -18,7 +18,7 @@ module.exports = {
'^/api/m1/xm': '/xm'
}
},
**/
'/api/m1/sys': {
target: 'http://localhost:7015',
changeOrigin: true,
@ -26,7 +26,7 @@ module.exports = {
'^/api/m1/sys': '/sys'
}
},
**/
// '/api/m1/pay': {
// target: 'http://localhost:7125',
// changeOrigin: true,
@ -55,7 +55,7 @@ module.exports = {
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8067, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
port: 8015, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true,
errorOverlay: true,
notifyOnErrors: false,

6
config/prod.env.js

@ -1,5 +1,7 @@
module.exports = {
NODE_ENV: '"production"',
ENV_CONFIG: '"prod"',
BASE_API: '"https://www.qingqinkj.com/api"'
ENV_CONFIG: '"prod"',//环境版本号 如npm run build:${ENV_CONFIG},建议与spring.profiles.active=${ENV_CONFIG}一一对应
VERSION: '"m1"',//产品版本号,nginx中通过此版本号导航到不同的静态资源目录,请求路径中用法如下:静态页面url=${DOMAIN}/${CONTEXT}/${VERSION}/#/{router.path}?${queryString}
CONTEXT:'"xm"',//对应spring中的server.context-path
BASE_API: '"api"'//api访问的统一入口,最后形成的apiUrl=${BASE_API}/${VERSION}/${spring.application.name}/${CONTEXT}/${ctrlUrl}
}

6
config/sit.env.js

@ -1,5 +1,7 @@
module.exports = {
NODE_ENV: '"production"',
ENV_CONFIG: '"sit"',
BASE_API: '"https://api-sit"'
ENV_CONFIG: '"sit"',//环境版本号 如npm run build:${ENV_CONFIG},建议与spring.profiles.active=${ENV_CONFIG}一一对应
VERSION: '"m1"',//产品版本号,nginx中通过此版本号导航到不同的静态资源目录,请求路径中用法如下:静态页面url=${DOMAIN}/${CONTEXT}/${VERSION}/#/{router.path}?${queryString}
CONTEXT:'"xm"',//对应spring中的server.context-path
BASE_API: '"api"'//api访问的统一入口,最后形成的apiUrl=${BASE_API}/${VERSION}/${spring.application.name}/${CONTEXT}/${ctrlUrl}
}

7
src/api/branch.js

@ -29,10 +29,11 @@ export const editBranch = params => { return axios.post(`${base}/mdp/sys/branch/
export const addBranchNoAuth = params => { return axios.post(`${base}/mdp/sys/branch/addBranchNoAuth`, params); };
//新增一条管理端机构表(机构下面若干部门)
export const calcBranchUsers = params => { return axios.get(`${base}/mdp/sys/branch/calcBranchUsers`, params); };
//统计机构用户数据
export const getBranchInterestsDetail = params => { return axios.get(`${base}/mdp/sys/branchInterests/detail`, params); };
//新增一条企业入驻审核流程
export const addUserJoinBranchRequire = params => { return axios.post(`${base}/mdp/sys/userJoinBranchRequire/add`, params); };

3
src/api/login.js

@ -87,7 +87,8 @@ export function doRegister( userInfo ) {
password:userInfo.password,
phoneno:userInfo.phoneno,
smsCode:userInfo.smsCode,
deptid:userInfo.deptid
deptid:userInfo.deptid,
branchId:userInfo.branchId
}
return axios({
url: base+'/user/register',

3
src/api/mdp/arc/imageCategory.js

@ -27,3 +27,6 @@ export const editImageCategory = params => { return axios.post(`${base}/mdp/arc/
//新增一条图片分类
export const addImageCategory = params => { return axios.post(`${base}/mdp/arc/imageCategory/add`, params); };
//查分类树
export const getImageCategoryTrees = params => { return axios.get(`${base}/mdp/arc/imageCategory/list/trees`, { params: params }); };

208
src/api/mdp/sys/branch.js

@ -43,3 +43,211 @@ export const initDicts = (that) => {
});
}
};
export const initUserCountPieChart=(that)=>{
var chartDom = document.getElementById('userCountPieChart');
var myChart = that.$echarts.init(chartDom);
var option;
var branchInterestsDetail = that.branchInterestsDetail;
if(!branchInterestsDetail){
branchInterestsDetail={
currUsers:1,
maxUsers:10
}
}
var currUsers= parseInt(branchInterestsDetail.currUsers)
var maxUsers=parseInt(branchInterestsDetail.maxUsers);
var syUsers=maxUsers-currUsers;
if(syUsers<0){
syUsers=0
}
option = {
title: {
text: currUsers+"/"+ maxUsers,
left: "center",
top: "50%",
textStyle: {
textAlign: "center",
fill: "#333",
fontSize: 14,
fontWeight: 200,
}
},
graphic: {
type: "text",
left: "center",
top: "40%",
style: {
text: "剩余"+syUsers,
textAlign: "center",
fill: "#333",
fontSize: 10,
}
},
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: '账户数量',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: false,
fontSize: '40',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: currUsers , name: '已使用' },
{ value: syUsers , name: '未使用' },
]
}
]
};
option && myChart.setOption(option);
};
export const initProductCountPieChart=(that)=>{
var chartDom = document.getElementById('productCountPieChart');
var myChart = that.$echarts.init(chartDom);
var option;
var calcBranchModule=that.calcBranchModule
var allModules=calcBranchModule.allModules
var freeModules=calcBranchModule.freeModules
var hadModules=calcBranchModule.hadModules
var yktModules=hadModules+freeModules
var syModules=allModules-freeModules-hadModules
option = {
title: {
text: yktModules + " / "+allModules,
left: "center",
top: "50%",
textStyle: {
textAlign: "center",
fill: "#333",
fontSize: 18,
fontWeight: 200,
}
},
graphic: {
type: "text",
left: "center",
top: "40%",
style: {
text: "未开通"+syModules,
textAlign: "center",
fill: "#333",
fontSize: 10,
}
},
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: '产品数量',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: false,
fontSize: '40',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: freeModules, name: '已免费开通' },
{ value: hadModules, name: '已付费开通' },
{ value: syModules, name: '未开通' },
]
}
]
};
option && myChart.setOption(option);
};
export const initEndTimePieChart=(that)=>{
var chartDom = document.getElementById('endTimePieChart');
var myChart = that.$echarts.init(chartDom);
var option;
var branchInterestsDetail=that.branchInterestsDetail;
option = {
title: {
text: branchInterestsDetail.maxRtime||"永久有效",
left: "center",
top: "45%",
textStyle: {
textAlign: "center",
fill: "#ee6666",
fontSize: 14,
fontWeight: 200,
}
},
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: '有效期',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: false,
fontSize: '40',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 0, name: '有效期' },
]
}
]
};
option && myChart.setOption(option);
};

4
src/api/mdp/sys/order.js

@ -4,6 +4,10 @@ let base = config.getSysBasePath();
export const createOrder = params => { return axios.post(`${base}/mdp/mo/moOrder/create`, params) };
export const calcOrder = params => { return axios.get(`${base}/mdp/mo/moOrder/calcOrder`, { params: params })};
export const createAddUsersOrder = params => { return axios.post(`${base}/mdp/mo/moOrder/addUsers/create`, params) };
export const calcAddUsersOrder = params => { return axios.get(`${base}/mdp/mo/moOrder/addUsers/calcOrder`, { params: params })};
export const createRenewOrder = params => { return axios.post(`${base}/mdp/mo/moOrder/renew/create`, params) };
export const calcRenewOrder = params => { return axios.get(`${base}/mdp/mo/moOrder/renew/calcOrder`, { params: params })};
export const createFlagShipOrder = params => { return axios.post(`${base}/mdp/mo/moOrderFligship/add`, params) };

4
src/api/mdp/sys/post/deptPost.js

@ -31,3 +31,7 @@ export const editDeptPost = params => { return axios.post(`${base}/mdp/sys/post/
//新增一条部门岗位关系表
export const addDeptPost = params => { return axios.post(`${base}/mdp/sys/post/deptPost/add`, params); };
export const batchSetPostsToDept = params => { return axios.post(`${base}/mdp/sys/post/deptPost/batchSetPostsToDept`, params); };
export const batchSetDeptsToPost = params => { return axios.post(`${base}/mdp/sys/post/deptPost/batchSetDeptsToPost`, params); };

3
src/api/mdp/sys/post/deptPostUser.js

@ -38,3 +38,6 @@ export const editDeptPostUser = params => { return axios.post(`${base}/mdp/sys/p
//新增一条部门岗位用户关系表(根据部门岗位关系,岗位用户关系自动冗余)
export const addDeptPostUser = params => { return axios.post(`${base}/mdp/sys/post/deptPostUser/add`, params); };
export const setPostMaster = params => { return axios.post(`${base}/mdp/sys/post/deptPostUser/setPostMaster`, params); };

3
src/api/mdp/sys/role.js

@ -13,6 +13,9 @@ let base=config.getSysBasePath();
//普通查询 条件之间and关系
export const listRole = params => { return axios.get(`${base}/mdp/sys/role/list`, { params: params }); };
//普通查询 条件之间and关系
export const listRoleNotInPostId = params => { return axios.get(`${base}/mdp/sys/role/list/notInPostId`, { params: params }); };
//模糊查询角色管理 条件之间or关系
//export const listRoleKey = params => { return axios.get(`${base}/mdp/sys/role/listKey`, { params: params }); };

25
src/api/mdp/sys/user.js

@ -30,4 +30,27 @@ export const batchDelUser = params => { return axios.post(`${base}/mdp/sys/user/
export const editUser = params => { return axios.post(`${base}/mdp/sys/user/edit`, params); };
//重置管理人员帮别人重置密码
export const resetPasswordByAdmin = params => { return axios.post(`${base}/safe/user/password/reset/byAdmin`, params); };
export const resetPasswordByAdmin = params => { return axios.post(`${base}/sys/user/resetPassword`, params); };
//修改自己的密码
export const changePassword = params => { return axios.post(`${base}/sys/user/changePassword`, params); };
//邀请别人加入团队-邮箱方式邀请
export const inviteUsersByEmails = params => { return axios.post(`${base}/sys/user/inviteUsersByEmails`, params); };
//邀请别人加入团队-手机号码方式邀请
export const inviteUsersByPhonenos = params => { return axios.post(`${base}/sys/user/inviteUsersByPhonenos`, params); };
//设置用户为机构管理员
export const setUsersToBranchAdm = params => { return axios.post(`${base}/sys/user/setUsersToBranchAdm`, params); };
//取消用户的机构管理员资格
export const setUsersUnBranchAdm = params => { return axios.post(`${base}/sys/user/setUsersUnBranchAdm`, params); };
//更新当前登录着的头像
export const editHeadimgurl = params => { return axios.post(`${base}/sys/user/editHeadimgurl`, params); };

11
src/common/config.js

@ -5,7 +5,7 @@
* api的调用一般是 /${BASE_API}/${applicationName}/${contextPath}/${具体的后端服务路径}
*/
var sysName = 'oa协同办公系统'// 系统名称,用于展示
var sysName="系统管理";//系统名称,用于展示
export default {
getOauth2LoginBasePath:function(){
@ -13,7 +13,8 @@ export default {
},
getBaseDomainUrl:function(){
return "https://www.qingqinkj.com"
var curlDomain=window.location.protocol+"//"+window.location.host; // 返回https://mp.csdn.net
return curlDomain
},
getSysName: function() {
@ -43,9 +44,6 @@ export default {
getArcIndexPath: function() {
return '/arc/arc/index.html'
},
getBaseDomainUrl: function() {
return window.location.protocol + '//' + window.location.host + '/api/' + process.env.VERSION
},
// 图片展示或下载路径
getArcFileUploadBasePath: function() {
return window.location.protocol + '//' + window.location.host + '/api/' + process.env.VERSION + '/arc/arc'
@ -90,6 +88,9 @@ export default {
},
getPayBasePath:function() {
return '/tpa/pay'
},
getMoBasePath(){
return '/sys/sys/mo/'
}

8
src/common/js/util.js

@ -38,7 +38,13 @@ export default {
/**
* 通过字典值获取其名称返回根值相同的字典,并自动计算其对应显示样式
* 界面上可以类似使用
* <el-tag v-for="(item,index) in formatDictsWithClass(dicts,'xxxx',scope.row.xxxx)" :key="index" :type="item.className">{{item.name}}</el-tag>
* 显示
<el-tag v-for="(item,index) in formatDictsWithClass(dicts,'xxxx',scope.row.xxxx)" :key="index" :type="item.className">{{item.name}}</el-tag>
* 下拉框
<el-select v-model="editForm.xxxx" @change="editSomeFields(editForm,'xxxx',$event)">
<el-option v-for="(item,index) in dicts['xxxx']" :key="index" :value="item.id" :label="item.name"></el-option>
</el-select>
*
* @param {*} dicts
* @param {*} itemCode

1
src/components/Image/ShearSelectUpload.vue

@ -93,7 +93,6 @@ export default {
},
data: function () {
return {
//base64UploadAction:"http://www.qingqinkj.com/arc"+"/arc/archiveAttachment/upload/base64",
model: false,
modelSrc: '',
crap: false,

20
src/components/ModulesMenu/allMenus.vue

@ -46,11 +46,14 @@
</template>
<script>
import config from '../../common/config.js';
import { mapGetters } from 'vuex';
import {getAllMenuModule, getBuyMenuModule} from '@/api/mdp/sys/modules'
import {modulesOfIcon} from "./modulesOfIcon.js";
import {modulesOfRouter} from "./modulesOfRouter.js";
import NProgress from 'nprogress' // progress bar
export default {
props: ['value'],
computed: {
@ -121,20 +124,23 @@ export default {
selectItem(item) {
if(item.isBuy||item.billMode=='0') {
var context="";
//
let name = "";
let path = "";
modulesOfRouter.forEach(e => {
if(e.id == item.id) {
name = e.path;
item.type = e.type;
path = e.path;
context=e.context
}
})
if(name != "") {
if(item.type == "link") {
window.open(name);
if(path != "") {
if(context != process.env.CONTEXT) {
var fullpath=config.getBaseDomainUrl()+"/"+context+"/"+process.env.VERSION+"/#"+path
window.open(fullpath);
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
}else {
this.$router.push({path: name})
this.$router.push({path: path})
}
}
this.visible = false;

89
src/components/ModulesMenu/modulesOfRouter.js

@ -1,119 +1,128 @@
export const modulesOfRouter = [
{
id: 'mall',
path: 'https://www.qingqinkj.com/mallm/m1/#/dashboard',
type: 'link'
path: '/dashboard',
context:'mallm',
},
{
id: 'mall-marketing',
path: 'https://www.qingqinkj.com/mk/m1/#/dashboard',
type: 'link'
path: '/dashboard',
context:'mallm',
},
{
id: 'mdp-arc',
path: 'https://www.qingqinkj.com/arc/m1/#/dashboard',
type: 'link'
path: '/dashboard',
context: 'arc'
},
{
id: 'mdp-sys',
path: 'https://www.qingqinkj.com/sys/m1/#/mdp/sys/dept/DeptMng',
type: 'link'
path: '/mdp/sys/dept/DeptMng',
context: 'sys'
},
{
id: 'oa-asset',
path: 'https://www.qingqinkj.com/oa/m1/#/oa/erp/ass/assetDetail/AssetDetailMng',
type: 'link'
path: '/oa/erp/ass/assetDetail/AssetDetailMng',
context: 'oa'
},
{
id: 'oa-attendance',
path: 'https://www.qingqinkj.com/oa/m1/#/oa/kq/attendance/AttendanceMonth',
type: 'link'
path: '/oa/kq/attendance/AttendanceMonth',
context: 'oa'
},
{
id: 'oa-car',
path: 'https://www.qingqinkj.com/oa/m1/#/oa/car/components/watch',
type: 'link'
path: '/oa/car/components/watch',
context: 'oa'
},
{
id: 'oa-contract',
path: 'https://www.qingqinkj.com/oa/m1/#/oa/ht/contractCard/ContractCardMng',
type: 'link'
path: '/oa/ht/contractCard/ContractCardMng',
context: 'oa'
},
{
id: 'oa-customer',
path: 'https://www.qingqinkj.com/oa/m1/#/oa/crm/customer/CustomerIndex',
type: 'link'
path: '/oa/crm/customer/CustomerIndex',
context: 'oa'
},
{
id: 'oa-file',
path: 'https://www.qingqinkj.com/oa/m1/#/oa/hr/user/employeeInfo',
type: 'link'
path: '/oa/hr/user/employeeInfo',
context: 'oa'
},
{
id: 'oa-finance',
path: 'https://www.qingqinkj.com/ac/m1/#/dashboard',
type: 'link'
path: '/dashboard',
context: 'ac'
},
{
id: 'oa-meeting',
path: 'https://www.qingqinkj.com/oa/m1/#/oa/meet/meetMeeting/MeetMeetingMng',
type: 'link'
path: '/oa/meet/meetMeeting/MeetMeetingMng',
context: 'oa'
},
{
id: 'oa-office',
path: 'https://www.qingqinkj.com/oa/m1/#/oa/om/omAppliance/OmApplianceMng',
type: 'link'
path: '/oa/om/omAppliance/OmApplianceMng',
context: 'oa'
},
{
id: 'oa-performance',
path: 'https://www.qingqinkj.com/oa/m1/#/oa/jx/AssesssSatistical',
type: 'link'
path: '/oa/jx/AssesssSatistical',
context: 'oa'
},
{
id: 'oa-schedule',
path: 'https://www.qingqinkj.com/oa/m1/#/oa/rc/rcSchedule/RcScheduleMng',
type: 'link'
path: '/oa/rc/rcSchedule/RcScheduleMng',
context: 'oa'
},
{
id: 'oa-seal',
path: 'https://www.qingqinkj.com/oa/m1/#/oa/sig/sigSignet/SigSignetMng',
type: 'link'
path: '/oa/sig/sigSignet/SigSignetMng',
context: 'oa'
},
{
id: 'oa-supervision',
path: 'https://www.qingqinkj.com/oa/m1/#/oa/duban/dubanItem/DutyDubanItem',
type: 'link'
path: '/oa/duban/dubanItem/DutyDubanItem',
context: 'oa'
},
{
id: 'xm-analysis',
path: 'xm/rpt/reportIndex',
path: '/xm/rpt/reportIndex',
context: 'xm'
},
{
id: 'xm-development',
path: ''
path: '',
context: 'xm'
},
{
id: 'xm-pipeline',
path: ''
path: '',
context: 'xm'
},
{
id: 'xm-product',
path: '/xm/core/xmProduct/XmProductAllMng'
path: '/xm/core/xmProduct/XmProductAllMng',
context: 'xm'
},
{
id: 'xm-project',
path: '/xm/core/xmProject/XmProjectAllMng'
path: '/xm/core/xmProject/XmProjectAllMng',
context: 'xm'
},
{
id: 'xm-test',
path: '/xm/core/xmQuestion/XmQuestionAdd'
path: '/xm/core/xmQuestion/XmQuestionAdd',
context: 'xm'
},
{
id: 'xm-workload',
path: '/xm/core/xmTaskWorkload/XmTaskWorkloadInfoMy',
context: 'xm'
},
{
id: 'xm-crowd',
path: '/xm/core/crowd/XmTaskCrowdMng',
context: 'xm'
}
]

15
src/components/NoticeMsgBar/index.vue

@ -1,22 +1,24 @@
<template v-loadding="load.list">
<el-dropdown trigger="hover" class="avatar-container" @command="handleNoticeMsgClick">
<div class="avatar-wrapper">
<div class="avatar-wrapper" @click="goToMsgCenter">
<i class="el-icon-bell"></i>
<span>未读消息{{noticeMsg.totalNum}}</span>
<span>消息中心</span>
<!-- <el-badge :value="noticeMsg.totalNum" class="item">
<img class="user-avatar" src="../../assets/image/platform/module-notice.png">
</el-badge> -->
</div>
<!--
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="toPay" >待付款订单(<font color=red>{{noticeMsg.toPayNum || 0}}</font>)</el-dropdown-item>
<el-dropdown-item command="toSend" >待发货订单(<font color=red>{{noticeMsg.toSendNum || 0}}</font>)</el-dropdown-item>
<el-dropdown-item command="toRece" >待收货订单(<font color=red>{{noticeMsg.hadSendNum || 0}}</font>)</el-dropdown-item>
<!--<el-dropdown-item command="hadFinish" >已完成订单(<font color=red>{{noticeMsg.hadFinishNum}}</font>)</el-dropdown-item>-->
<!-- <el-dropdown-item command="hadCancel" >已取消订单(<font color=red>{{noticeMsg.hadCancelNum}}</font>)</el-dropdown-item>-->
<el-dropdown-item command="hadFinish" >已完成订单(<font color=red>{{noticeMsg.hadFinishNum}}</font>)</el-dropdown-item>
<el-dropdown-item command="hadCancel" >已取消订单(<font color=red>{{noticeMsg.hadCancelNum}}</font>)</el-dropdown-item>
<el-dropdown-item command="toApprova" >待审核订单(<font color=red>{{noticeMsg.toApprovaNum || 0}}</font>)</el-dropdown-item>
<!-- <el-dropdown-item command="hadApprova" >已审核订单(<font color=red>{{noticeMsg.hadApprovaNum}}</font>)</el-dropdown-item> -->
<el-dropdown-item command="hadApprova" >已审核订单(<font color=red>{{noticeMsg.hadApprovaNum}}</font>)</el-dropdown-item>
<el-dropdown-item command="doGetNoticeMsg" >刷新 </el-dropdown-item>
</el-dropdown-menu>
-->
</el-dropdown>
</template>
@ -46,6 +48,9 @@ export default {
}
},
methods: {
goToMsgCenter(){
this.$router.push("/my/work/message");
},
doGetNoticeMsg(){
this.load.list=true;
getNoticeMsg({}).then(res=>{

2
src/components/Tinymce/index.vue

@ -134,7 +134,7 @@ export default {
code_dialog_width: 1000,
advlist_bullet_styles: "square",
advlist_number_styles: "default",
imagetools_cors_hosts: ["www.qingqinkj.com", "codepen.io"],
imagetools_cors_hosts: ["www.qingqinkj.com", "codepen.io","www.maimengcloud.com"],
default_link_target: "_blank",
link_title: false,
convert_urls: false,

5
src/components/TopModules/index.vue

@ -15,7 +15,7 @@
</div>
<div class="module-item">
<div class="module-text">
<div class="module-text" @click="goToMyWork" >
<div class="box-info">我的工作台</div>
</div>
</div>
@ -82,6 +82,9 @@ export default {
}
},
methods: {
goToMyWork(){
this.$router.push("/my/work/index")
},
//
gotolink(module) {
this.drawer = false

9
src/lang/index.js

@ -5,13 +5,16 @@ import elementEnLocale from 'element-ui/lib/locale/lang/en' // element-ui lang
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'// element-ui lang
import enLocale from './en'
import zhLocale from './zh'
import zhSysLocale from './zh_sys'
import zhWorkflowLocale from './zh_workflow'
import zhFormLocale from './zh_form'
Vue.use(VueI18n)
let allZhLocale= Object.assign({},zhLocale,zhWorkflowLocale);
allZhLocale.route=Object.assign(allZhLocale.route,zhFormLocale.route)
let allZhLocale= Object.assign({},zhLocale,zhSysLocale);
allZhLocale.route=Object.assign(allZhLocale.route,zhWorkflowLocale.route,zhFormLocale.route)
const messages = {
en: {
@ -20,7 +23,7 @@ const messages = {
},
zh: {
...elementZhLocale,
...allZhLocale,
...allZhLocale
}
}

2
src/mock/index.js

@ -9,7 +9,7 @@ import transactionAPI from './transaction'
// })
// 登录相关
//Mock.mock(/\/login\/login/, 'post', loginAPI.loginByUserloginid)
//Mock.mock(/\/login\/login/, 'post', loginAPI.loginByUsername)
//Mock.mock(/\/login\/logout/, 'post', loginAPI.logout)
//Mock.mock(/\/user\/info\.*/, 'get', loginAPI.getUserInfo)

2
src/permission.js

@ -14,7 +14,7 @@ function hasPermission(roles, permissionRoles) {
return roles.some(role => permissionRoles.indexOf(role) >= 0)
}
const whiteList = ['/login', '/authredirect']// no redirect whitelist
const whiteList = ['/login', '/authredirect','/changeEmailStepOne','/changeEmailStepTwo']// no redirect whitelist
router.beforeEach((to, from, next) => {
NProgress.start() // start progress bar

43
src/router/index.js

@ -8,15 +8,9 @@ Vue.use(Router)
/* Layout */
import Layout from '../views/layout/Layout'
import routesWorkflow from './routes_workflow'
import routesForm from './routes_form'
import routesXm from './routes_xm'
import routesDatavXm from './routes_datav_xm'
import routesArc from './routes_arc'
import routesIm from './routes_im'
import routesSys from './routes_sys'
import routesMyWork from './routes_my_work'
import routesOrder from './routes_order'
export {Layout}
/** note: submenu only apppear when children.length>=1
@ -41,31 +35,21 @@ export const constantRouterMap = [
{ path: '/login', component: _import('login/index'), hidden: true },
{ path: '/404', component: _import('errorPage/404'), hidden: true },
{ path: '/401', component: _import('errorPage/401'), hidden: true },
{ path: '/changeEmailStepOne', component: _import('mdp/sys/user/ChangeEmailStepOne'), hidden: true },
{ path: '/changeEmailStepTwo', component: _import('mdp/sys/user/ChangeEmailStepTwo'), hidden: true },
{
path: '',
component: Layout,
redirect: 'dashboard',
name:"首页",
meta:{title:'首页',icon: 'home-page'},
children: [
{
children: [{
path: 'dashboard',
component: _import('xm/XmOverview'),
component: _import('myWork/my/index'),
name: '首页',
meta: { title: '首页', icon: 'home-page', noCache: true }
},
// {
// path: 'updateUserInfo',
// component: _import('mdp/sys/user/UpdateUserInfo'),
// name: '账户设置',
// meta: {
// title: '修改个人信息',
// icon: 'component'
// }
// }
],
hidden: false
},
meta: { title: '首页', icon: 'dashboard', noCache: true }
}]
}
]
export default new Router({
@ -74,13 +58,10 @@ export default new Router({
routes: constantRouterMap
})
let allRoutes=[]
allRoutes=allRoutes.concat(routesMyWork.routes);
allRoutes=allRoutes.concat(routesXm.routes);
allRoutes=allRoutes.concat(routesDatavXm.routes);
allRoutes=allRoutes.concat(routesWorkflow.routes).concat(routesForm.routes)
allRoutes=allRoutes.concat(routesArc.routes);
allRoutes=allRoutes.concat(routesIm.routes);
allRoutes=allRoutes.concat(routesSys.routes);
allRoutes=allRoutes.concat(routesOrder.routes);
export const asyncRouterMap = allRoutes

58
src/router/routes_order.js

@ -9,17 +9,40 @@ export default {
component: Layout,
name: '订单',
meta: {
title: '订单',
icon: 'task'
title: '订单管理',
icon: 'business'
},
children: [
{ path: 'branchModuleList', component: _import('mdp/menu/menuModuleBranch/MenuModuleBranchMng'), name: 'MenuModuleBranchMng', meta: { title: '已购模块(平台)',icon: 'component',menu:true }},
{
path: 'list',
component: _import('mdp/mo/moOrder/MoOrderMng'),
name: '订单列表(平台)',
meta: {
title: '订单列表(平台)',
icon: 'component',
menu:true
}
},
{
path: 'myList',
component: _import('mdp/mo/moOrder/MyMoOrderMng'),
name: '我的订单',
meta: {
title: '我的订单',
icon: 'component',
menu:false
}
},
{
path: 'index',
component: _import('order/index'),
name: '我的',
name: '购买产品',
meta: {
title: '我的',
icon: 'component'
title: '购买产品',
icon: 'component',
menu:false
}
},
{
@ -28,9 +51,29 @@ export default {
name: '创建订单',
meta: {
title: '创建订单',
icon: 'component'
icon: 'component',
menu:false
},
hidden:true,
},
{
path: 'addUsers',
component: _import('order/addUsersIndex'),
name: '增购人数',
meta: {
title: '增购人数',
icon: 'component',
}
},
{
path: 'renew',
component: _import('order/renewIndex'),
name: '续费',
meta: {
title: '续费',
icon: 'component',
},
},
{
path: 'paySuccess',
component: _import('order/paySuccess'),
@ -38,7 +81,8 @@ export default {
meta: {
title: '支付成功',
icon: 'component'
}
},
hidden:true,
}
]
},

3
src/router/routes_workflow.js

@ -1,7 +1,6 @@
/* Layout */
import Layout from '../views/layout/Layout'
const _import = require('./_import_' + process.env.NODE_ENV)
export default {
routes: [
{
@ -79,7 +78,7 @@ export default {
icon: 'model'
},
children: [
{ path: 'editor/Index', component: _import("mdp/workflow/editor/Index"), name: '在线模型编辑器', meta: { title: 'workflowEditorIndex', openTab: true, outUrl: 'https://www.qingqinkj.com/workflow/m1/modeler-ui/' } },
{ path: 'editor/Index', component: _import("mdp/workflow/editor/Index"), name: '在线模型编辑器', meta: { title: 'workflowEditorIndex', openTab: true, outUrl: '${curlDomain}/workflow/'+process.env.VERSION+'/modeler-ui/' } },
{ path: 'de/ModelMng', component: _import("mdp/workflow/de/model/ModelMng"), name: 'ModelMng', meta: { title: 'ModelMng' } },
{ path: 're/DeploymentMng', component: _import("mdp/workflow/re/deployment/DeploymentMng"), name: 'DeploymentMng', meta: { title: 'DeploymentMng' } },
{ path: 're/procdef/ProcdefSuspend', component: _import("mdp/workflow/re/procdef/ProcdefSuspend"), name: 'ProcdefSuspend', meta: { title: 'ProcdefSuspend' } },

3
src/store/getters.js

@ -5,7 +5,6 @@ const getters = {
cachedViews: state => state.tagsView.cachedViews,
token: state => state.user.token,
userInfo: state => state.user.userInfo,
workShop:state=>state.user.workShop,
introduction: state => state.user.introduction,
status: state => state.user.status,
roles: state => state.user.roles,
@ -21,6 +20,6 @@ const getters = {
errorLogs: state => state.errorLog.logs,
added: state => state.permission.added,
isLoadOk:state=>state.user.isLoadOk,
noticeMsg:state=>state.noticeMsg.noticeMsg
noticeMsg:state=>state.noticeMsg.noticeMsg,
}
export default getters

2
src/store/index.js

@ -19,7 +19,7 @@ const store = new Vuex.Store({
tagsView,
user,
noticeMsg,
menuFavorite
menuFavorite,
},
getters
})

4
src/store/modules/user.js

@ -58,9 +58,6 @@ const user = {
SET_USER_INFO: (state, userInfo) => {
state.userInfo = userInfo
},
SET_WORK_SHOP:(state,workShop)=>{
state.workShop = workShop
},
SET_ROLES: (state, roles) => {
state.roles = roles
},
@ -210,7 +207,6 @@ const user = {
commit('SET_USER_INFO',userInfo);
commit('SET_ROLES', roles)
commit('SET_QXS', qxs)
commit('SET_WORK_SHOP',userInfo);
commit('SET_IS_LOAD_OK', true)
resolve(res);
}else{

1
src/styles/sidebar.scss

@ -4,6 +4,7 @@
min-height: 100%;
transition: margin-left .28s;
margin-left: 180px;
background-color: $bgCor;
}
// 侧边栏
.sidebar-container {

9
src/styles/variables.scss

@ -8,11 +8,14 @@ $yellow:#FEC171;
$panGreen: #30B08F;
//sidebar
$menuBg: #F4F5F8;
$menuBg: #1f2d3d;
$subMenuBg:#1f2d3d;
$menuHover:#001528;
//MyWork
$bgCor: #F4F5F8
//main bgcor
$bgCor: #F4F5F8;
//功能页面背景颜色
$pageBgCor: #eef2fa;

2
src/views/example/table/treeTable/customTreeTable.vue

@ -129,7 +129,7 @@ export default {
},
methods: {
message(row) {
this.$message.info(row.event)
this.$notify.info(row.event)
}
}
}

4
src/views/layout/components/Navbar.vue

@ -20,7 +20,7 @@
-->
<error-log v-if="false" class="errLog-container right-menu-item hidden-sm-and-down"></error-log>
<screenfull v-if="false" class="screenfull right-menu-item"></screenfull>
<screen-full v-if="false" class="screenfull right-menu-item"></screen-full>
<lang-select v-if="false" class="international right-menu-item hidden-sm-and-down"></lang-select>
<el-tooltip v-if="false" class="hidden-sm-and-down" effect="dark" :content="$t('navbar.theme')" placement="bottom">
@ -28,7 +28,7 @@
</el-tooltip>
<UserInfo />
<user-info />
<!-- <el-dropdown class="avatar-container right-menu-item hidden-sm-and-down" trigger="hover" @command="handleCommand">
<div class="avatar-wrapper">

33
src/views/layout/components/Sidebar/SidebarItem.vue

@ -1,31 +1,37 @@
<template>
<div class="menu-wrapper">
<template v-for="item in routes" v-if="!item.hidden&&item.children">
<router-link v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow" :to="item.path+'/'+item.children[0].path"
:key="item.children[0].name">
<template>
<div v-for="(item,index) in routes" :key="index">
<div v-if="!item.hidden&&item.children">
<router-link v-if="hasOneShowingChildren(item.children)" :to="item.path+'/'+item.children[0].path">
<el-menu-item :index="item.path+'/'+item.children[0].path" :class="{'submenu-title-noDropdown':!isNest}">
<svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon"></svg-icon>
<span v-if="item.children[0].meta&&item.children[0].meta.title" slot="title">{{generateTitle(item.children[0].meta.title)}}</span>
</el-menu-item>
</router-link>
<el-submenu v-else :index="item.name||item.path" :key="item.name">
<el-submenu v-else :index="item.name||item.path">
<template slot="title">
<svg-icon v-if="item.meta&&item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
<span v-if="item.meta&&item.meta.title" slot="title">{{generateTitle(item.meta.title)}}</span>
</template>
<template v-for="child in item.children" v-if="!child.hidden">
<sidebar-item :is-nest="true" class="nest-menu" v-if="child.children&&child.children.length>0" :routes="[child]" :key="child.path"></sidebar-item>
<router-link v-else :to="{path:item.path+'/'+child.path,query:child.query}" :key="child.name">
<template>
<div v-for="(child,idx) in item.children" :key="idx">
<div v-if="!child.hidden">
<sidebar-item :is-nest="true" class="nest-menu" v-if="child.children&&child.children.length>0" :routes="[child]"></sidebar-item>
<router-link v-else :to="{path:item.path+'/'+child.path,query:child.query}">
<el-menu-item :index="item.path+'/'+child.path">
<svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
<span v-if="child.meta&&child.meta.title" slot="title">{{generateTitle(child.meta.title)}}</span>
</el-menu-item>
</router-link>
</div>
</div>
</template>
</el-submenu>
</div>
</div>
</template>
</div>
</template>
@ -49,6 +55,11 @@ export default {
return !this.$store.state.app.sidebar.opened;
}
},
data(){
return {
isFirstMenuItem:false,
}
},
methods: {
hasOneShowingChildren(children) {
if(!children){
@ -58,7 +69,11 @@ export default {
return !item.hidden
})
if (showingChildren.length === 1) {
return true
if(showingChildren[0].children && showingChildren[0].children.length>0){
return false;
}else{
return true;
}
}
return false
},

49
src/views/layout/components/UserInfo.vue

@ -1,6 +1,6 @@
<template>
<div>
<el-dropdown class="avatar-container right-menu-item hidden-sm-and-down" trigger="click" @command="handleCommand">
<el-dropdown class="avatar-container right-menu-item hidden-sm-and-down" trigger="click" @command="handleCommand" @click.native="onDropdownClick">
<div class="avatar-wrapper">
<img v-if="userInfo && userInfo.headimgurl" class="user-avatar" :src="userInfo.headimgurl">
<img v-else class="user-avatar" src="../../../assets/image/user_img.gif">
@ -11,7 +11,7 @@
<div class="dropdown">
<div class="topBox">
<div class="topBox_logo" v-if="userInfo.memType!=='0'">
<img v-if="!branchUsersCount || branchUsersCount.default || !branchUsersCount.imgUrl" src="../../../assets/image/qqlogo_yuan.png" alt="">
<img v-if="!branchUsersCount || !branchUsersCount.imgUrl" src="../../../assets/image/image_not_found_small.jpg" alt="">
<img v-else :src="branchUsersCount.imgUrl" alt="">
</div>
@ -34,7 +34,7 @@
</span>
</div>
<div class="topBox_num">
<span @click="calcBranchUsers">账号数量 {{branchUsersCount.currUsers }} / {{branchUsersCount.maxUsers}} <i class="el-icon-refresh-right"></i></span>
<span @click="getBranchInterestsDetail">账号数量 <span v-if="branchUsersCount && branchUsersCount.branchId">( {{branchUsersCount.currUsers }} / {{branchUsersCount.maxUsers}} )个</span> <i class="el-icon-refresh-right"></i></span>
</div>
</div>
</div>
@ -75,7 +75,7 @@
<!--<p class="el-icon-menu" @click="handleCommand('myWork')">我的工作台</p> -->
<p class="el-icon-user" @click="switchUser">切换账户</p>
<p class="el-icon-edit" @click="handleCommand('updateUserInfo')">账户明细</p>
<p class="el-icon-user-solid">团队管理</p>
<p class="el-icon-user-solid" @click="handleCommand('branchSet')">团队管理</p>
<p @click="logout" class="el-icon-switch-button">退出登录</p>
</div>
@ -124,12 +124,15 @@
</template>
<script>
import NProgress from 'nprogress' // progress bar
import config from '../../../common/config';
import { mapGetters } from 'vuex'
import dayjs from 'dayjs'
import { queryMyUsers,switchUser } from '@/api/login';
import { calcBranchUsers } from '@/api/branch';
import { getBranchInterestsDetail } from '@/api/branch';
import BranchAdd from "@/views/mdp/sys/branch/BranchEdit";
export default {
@ -139,6 +142,7 @@ export default {
phonenoUsers:[],
phonenoUsersVisible:false,
branchUsersCount:{
branchId:'',
currUsers:1,
maxUsers:100,
imgUrl:'',
@ -167,8 +171,13 @@ export default {
},
methods: {
calcBranchUsers(){
calcBranchUsers().then(res=>this.branchUsersCount=res.data.data||this.branchUsersCount)
onDropdownClick(){
if( this.branchUsersCount.defalut){
this.getBranchInterestsDetail();
}
},
getBranchInterestsDetail(){
getBranchInterestsDetail().then(res=>this.branchUsersCount=res.data.data||this.branchUsersCount)
},
getMyRoleNames(){
if(this.roles && this.roles.length>0){
@ -181,22 +190,41 @@ export default {
if(res0.data.tips.isOk){
this.phonenoUsers=res0.data.data;
if(res0.data.data.length<=1){
this.$message.warning("当前没有关联的账户,无须切换");
this.$notify.warning("当前没有关联的账户,无须切换");
}else{
this.phonenoUsersVisible=true;
}
}else{
this.$message.error(res0.data.tips.msg);
this.$notify.error(res0.data.tips.msg);
}
})
},
handleCommand(command){
if(process.env.CONTEXT=='sys'){
if(command=='updateUserInfo'){
this.$router.push({path:'/my/work/updateUserInfo'})
}
if(command=='myWork'){
this.$router.push({path:'/my/work/index'})
}
if(command=='branchSet'){
this.$router.push({path:'/mdp/sys/branch/branchSet'})
}
}else{
var prefixUrl=config.getBaseDomainUrl()+'/sys/'+process.env.VERSION+'/#/'
if(command=='updateUserInfo'){
window.open(prefixUrl+'my/work/updateUserInfo')
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
}
if(command=='myWork'){
this.$router.push({path:'/my/work/index'})
}
if(command=='branchSet'){
window.open(prefixUrl+'mdp/sys/branch/branchSet')
NProgress.done()
}
}
},
upgradeToBranchAccount(){
//
@ -229,7 +257,7 @@ export default {
});
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch((e) => {
@ -249,7 +277,6 @@ export default {
BranchAdd
},
mounted() {
//this.calcBranchUsers();
}
}
</script>

20
src/views/login/components/login.vue

@ -199,7 +199,7 @@ export default {
}
sendSmsCode(params).then(res=>{
if(res.data.tips.isOk){
this.$message.success("发送成功");
this.$notify.success("发送成功");
if (this.setTimeNum > 0) {
this.abledBut = true
this.timeWrap = setInterval(() => {
@ -207,7 +207,7 @@ export default {
}, 1000)
}
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
},
@ -224,10 +224,10 @@ export default {
resetPasswordByPhoneno(params).then(res=>{
this.loading = false
if(res.data.tips.isOk){
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
this.isRestPwd = false;
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
} else {
@ -278,7 +278,7 @@ export default {
this.userDeptid=res2.data.userInfo.deptid
this.rolesChecked();
}else{
this.$message.error(res2.data.tips.msg);
this.$notify.error(res2.data.tips.msg);
}
}).catch(err=>{
@ -286,7 +286,7 @@ export default {
this.loading = false
});
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch((e) => {
this.loading = false
@ -298,7 +298,7 @@ export default {
},
deptChecked() {
if( !this.userDeptid){
this.$message.error("请选择登陆的部门")
this.$notify.error("请选择登陆的部门")
return
}
if(this.$store.state.user.userInfo.deptid!=this.userDeptid){
@ -314,13 +314,13 @@ export default {
rolesChecked(){
if(this.userInfo.isSuperAdmin){
this.$router.push({ path: '/' });
this.$message.info("欢迎登陆,超级管理员");
this.$notify.info("欢迎登陆,超级管理员");
}else if(this.userInfo.isPlatformAdmin){
this.$router.push({ path: '/' });
this.$message.info("欢迎登陆,平台管理员");
this.$notify.info("欢迎登陆,平台管理员");
}else{
this.$router.push({ path: '/' });
this.$message.info("欢迎登陆");
this.$notify.info("欢迎登陆");
}
},

54
src/views/login/components/register.vue

@ -149,11 +149,11 @@ export default {
},
sendPhonenoSmsCode(){
if(!this.loginForm.phoneno){
this.$message.error("手机号码不能为空");
this.$notify.error("手机号码不能为空");
return;
}
if(this.loginForm.phoneno.length !=11 ){
this.$message.error("手机号码必须为11位");
this.$notify.error("手机号码必须为11位");
return;
}
var params={
@ -165,32 +165,54 @@ export default {
this.phonenoUsers=res0.data.data;
sendSmsCode(params).then(res=>{
if(res.data.tips.isOk){
this.$message.success("发送成功");
this.$notify.success("发送成功");
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
}else{
this.$message.error(res0.data.tips.msg);
this.$notify.error(res0.data.tips.msg);
}
})
},
checkDisplayUserid(){
if(!this.loginForm.displayUserid){
this.$message.error("账号不能为空");
this.$notify.error("账号不能为空");
return;
}
checkDisplayUserid(this.loginForm.displayUserid).then(res0=>{
if(res0.data.tips.isOk){
this.$message.success("该账户可以注册");
this.$notify.success("该账户可以注册");
}else{
this.$message.error("该账户已存在,不允许再注册!");
this.$notify.error("该账户已存在,不允许再注册!");
}
})
},
getQueryVariable(variable,url){
var query =url;
if(url==null || url==undefined || url==''){
query=window.location.href;
}
//alert(query);
var query2=query.split("?");
if(query2.length>1){
query=query2[1];
}else{
query=""
return null;
}
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return null;
},
handleRegister() {
this.loading = true
this.$refs.loginForm.validate(valid => {
@ -203,12 +225,16 @@ export default {
smsCode:this.loginForm.smsCode,
username:this.loginForm.username,
}
var branchId=this.getQueryVariable("branchId")
if(branchId){
params.branchId=branchId
}
doRegister(params).then(res=>{
this.loading = false
if(res.data.tips.isOk){
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
} else {
@ -219,7 +245,7 @@ export default {
},
deptChecked() {
if( !this.userDeptid){
this.$message.error("请选择登陆的部门")
this.$notify.error("请选择登陆的部门")
return
}
@ -236,13 +262,13 @@ export default {
rolesChecked(){
if(this.userInfo.isSuperAdmin){
this.$router.push({ path: '/' });
this.$message.info("欢迎登陆,超级管理员");
this.$notify.info("欢迎登陆,超级管理员");
}else if(this.userInfo.isPlatformAdmin){
this.$router.push({ path: '/' });
this.$message.info("欢迎登陆,平台管理员");
this.$notify.info("欢迎登陆,平台管理员");
}else{
this.$router.push({ path: '/' });
this.$message.info("欢迎登陆");
this.$notify.info("欢迎登陆");
}
},

20
src/views/login/resetPassword.vue

@ -155,11 +155,11 @@ export default {
},
sendPhonenoSmsCode(){
if(!this.loginForm.phoneno){
this.$message.error("手机号码不能为空");
this.$notify.error("手机号码不能为空");
return;
}
if(this.loginForm.phoneno.length !=11 ){
this.$message.error("手机号码必须为11位");
this.$notify.error("手机号码必须为11位");
return;
}
var params={
@ -171,9 +171,9 @@ export default {
this.phonenoUsers=res0.data.data;
sendSmsCode(params).then(res=>{
if(res.data.tips.isOk){
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
}
@ -208,9 +208,9 @@ export default {
resetPasswordByPhoneno(params).then(res=>{
this.loading = false
if(res.data.tips.isOk){
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
} else {
@ -221,7 +221,7 @@ export default {
},
deptChecked() {
if( !this.userDeptid){
this.$message.error("请选择登陆的部门")
this.$notify.error("请选择登陆的部门")
return
}
@ -238,13 +238,13 @@ export default {
rolesChecked(){
if(this.userInfo.isSuperAdmin){
this.$router.push({ path: '/' });
this.$message.info("欢迎登陆,超级管理员");
this.$notify.info("欢迎登陆,超级管理员");
}else if(this.userInfo.isPlatformAdmin){
this.$router.push({ path: '/' });
this.$message.info("欢迎登陆,平台管理员");
this.$notify.info("欢迎登陆,平台管理员");
}else{
this.$router.push({ path: '/' });
this.$message.info("欢迎登陆");
this.$notify.info("欢迎登陆");
}
},

10
src/views/mdp/arc/archiveAttachment/AttachmentUpload.vue

@ -163,7 +163,7 @@ export default {
this.$emit('getCarInnerImageUrl',res.data.url)
this.$emit('uploadSuccess',file)
} else {
this.$message.warning(res.tips.msg);
this.$notify.warning(res.tips.msg);
return false;
}
},
@ -186,11 +186,11 @@ export default {
}
this.$emit("on-remove", file, this.fileList);
} else {
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
.catch(() => {
this.$message.warning("删除失败");
this.$notify.warning("删除失败");
});
},
handlePreview(file) {
@ -211,7 +211,7 @@ export default {
window.open(attachmentPreviewUrl, "_blank");
},
handleExceed(files, fileList) {
this.$message.warning(
this.$notify.warning(
"当前限制选择" +
this.limit +
" 个文件,本次选择了" +
@ -233,7 +233,7 @@ export default {
}
});
if (canDel == false && file.id && file.id != null && file.id != "") {
this.$message.warning(file.name + "设置了不允许删除");
this.$notify.warning(file.name + "设置了不允许删除");
return false;
} else if (
canDel == true &&

14
src/views/mdp/arc/category/CategoryTree.vue

@ -192,10 +192,10 @@
//console.log("res--"+JSON.stringify(res));
if(res.data.tips.isOk){
this.addLoading=false;
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
this.getTreeData(true);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(e=>this.addLoading = false );
@ -215,10 +215,10 @@
this.editLoading = false;
if(res.data.tips.isOk){
this.editVisible=false;
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
this.getTreeData(true);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(e=>this.editLoading = false );
@ -242,7 +242,7 @@
deleteNode(data, node, comp) {
console.log("deleteNode__"+JSON.stringify(data));
if(data.children){
this.$message.error("请先删除子元素");
this.$notify.error("请先删除子元素");
return;
}
let params={
@ -258,10 +258,10 @@
if(res.data.tips.isOk){
this.editVisible=false;
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
this.getTreeData(true);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
});
})

8
src/views/mdp/form/formData/FormDataMng.vue

@ -874,7 +874,7 @@
if(this.isBatchSetTags==true){
//TOD
if(!tags || tags.length==0){
this.$message.error("最少选中一个标签");
this.$notify.error("最少选中一个标签");
this.isBatchSetTags=false;
return;
}
@ -898,9 +898,9 @@
row.tagIds=tagIds
row.tagNames=tagNames
})
this.$message.success("打标签成功");
this.$notify.success("打标签成功");
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(e=>this.isBatchSetTags=false);
}else{
@ -926,7 +926,7 @@
showTagSelect:function(isBatchSetTags){
if(isBatchSetTags==true){
if(this.sels.length==0){
this.$message.error("请选中流程任务");
this.$notify.error("请选中流程任务");
return false;
}
this.tagSelectVisible=true;

8
src/views/mdp/form/formDef/FormDefMng.vue

@ -375,7 +375,7 @@
if(this.isBatchSetTags==true){
//TOD
if(!tags || tags.length==0){
this.$message.error("最少选中一个标签");
this.$notify.error("最少选中一个标签");
this.isBatchSetTags=false;
return;
}
@ -399,9 +399,9 @@
row.tagIds=tagIds
row.tagNames=tagNames
})
this.$message.success("打标签成功");
this.$notify.success("打标签成功");
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(e=>this.isBatchSetTags=false);
}else{
@ -426,7 +426,7 @@
showTagSelect:function(isBatchSetTags){
if(isBatchSetTags==true){
if(this.sels.length==0){
this.$message.error("请选中流程任务");
this.$notify.error("请选中流程任务");
return false;
}
this.tagSelectVisible=true;

359
src/views/mdp/meta/item/ItemAdd.vue

@ -1,127 +1,394 @@
<template>
<section>
<el-row class="page-container border padding">
<section class="page-container padding">
<el-row class="page-header">
</el-row>
<el-row class="page-main">
<!--新增界面 Item 数据项定义-->
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
<el-form-item label="编号" prop="id">
<el-input v-model="addForm.id" auto-complete="off"></el-input><el-tag>为空则后台自动生成</el-tag>
<el-row>
<el-col :span="12" v-if="!simple">
<el-form-item label="字典代码" prop="itemCode" :rules="[{required:true,message:'请输入字典代码'}]">
<el-input v-model="addForm.itemCode" placeholder="小写,下横线分割" ></el-input>
<font color="blue">小写,下横线分割例子: user_address</font>
</el-form-item>
<el-form-item label="代码" prop="itemCode">
<el-input v-model="addForm.itemCode" auto-complete="off"></el-input>
</el-col>
<el-col :span="12">
<el-form-item label="字典名称" prop="itemName" :rules="[{required:true,message:'请输入字典名称'}]">
<el-input v-if="!simple" v-model="addForm.itemName" placeholder="名称" ></el-input>
<div>{{addForm.itemName}}</div>
</el-form-item>
<el-form-item label="名称" prop="itemName">
<el-input v-model="addForm.itemName" auto-complete="off"></el-input>
</el-col>
</el-row>
<el-row v-if="!simple">
<el-col :span="12">
<el-form-item label="分类" prop="categoryId" :rules="[{required:true,message:'请选择分类'}]">
<el-select v-model="addForm.categoryId" placeholder="请选择分类">
<el-option
v-for="item in categorys"
:key="item.id"
:label="item.categoryName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="addForm.remark" auto-complete="off"></el-input>
</el-col>
<el-col :span="12">
<el-form-item label="类型" prop="itemType" :rules="[{required:true,message:'请选择类型'}]">
<el-select v-model="addForm.itemType" placeholder="请选择">
<el-option
v-for="item in itemTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="长度" prop="itemSize">
<el-input v-model="addForm.itemSize" auto-complete="off"></el-input>
</el-col>
</el-row>
<el-form-item v-if="addForm.itemType=='4'||addForm.itemType=='5'" label="选项列表" prop="optionList">
<el-input type="textarea" rows=8 v-model="optionNames" placeholder="选项列表" ></el-input>
<font color="blue">请输入列表一行代表一个,如要指定编号,请用|线分割比如 <br>
1|<br>
2|<br>
</font>
</el-form-item>
<el-form-item label="类型" prop="itemType">
<el-radio v-model="addForm.itemType" label="text">文本</el-radio>
<el-radio v-model="addForm.itemType" label="number">数字</el-radio>
<el-radio v-model="addForm.itemType" label="date">日期</el-radio>
<el-radio v-model="addForm.itemType" label="image">图片</el-radio>
<el-radio v-model="addForm.itemType" label="video">视频</el-radio>
<el-radio v-model="addForm.itemType" label="clog">图文</el-radio>
<el-radio v-model="addForm.itemType" label="blog">二进制</el-radio>
<el-form-item v-else-if="addForm.itemType=='7'" label="文件列表" prop="optionList">
<el-input type="textarea" rows=8 v-model="optionNames" placeholder="文件列表" ></el-input>
<font color="blue">请输入文件列表一行代表一个,比如 <br>
文件链接地址1|文件描述或者名称1<br>
文件链接地址2|文件描述或者名称2<br>
</font>
</el-form-item>
<el-form-item>
<el-col :span="4" :offset="16">
<el-button @click.native="handleCancel">取消</el-button>
</el-col>
<el-col :span="4">
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" >提交</el-button>
</el-col>
<el-form-item v-else-if="addForm.itemType=='10'" label="图文列表" prop="optionList">
<el-input type="textarea" rows=8 v-model="optionNames" placeholder="文件列表" ></el-input>
<font color="blue">请输入图文列表一行代表一个,比如 <br>
图片地址1|图片描述1<br>
图片地址2|图片描述2<br>
</font>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='12'" label="视频列表" prop="optionList">
<el-input type="textarea" rows=8 v-model="optionNames" placeholder="文件列表" ></el-input>
<font color="blue">请输入视频列表一行代表一个,比如 <br>
视频地址1|视频描述1<br>
视频地址2|视频描述2<br>
</font>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='13'" label="单选框" prop="optionList">
<el-input type="textarea" rows=8 v-model="optionNames" placeholder="选项列表" ></el-input>
<font color="blue">请输入选项列表一行代表一个,比如 <br>
值1|描述1<br>
值2|描述2<br>
</font>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='14'" label="多选框" prop="optionList">
<el-input type="textarea" rows=8 v-model="optionNames" placeholder="选项列表" ></el-input>
<font color="blue">请输入选项列表一行代表一个,比如 <br>
值1|描述1<br>
值2|描述2<br>
</font>
</el-form-item>
<el-form-item v-if="addForm.itemType=='2'" label="默认值" prop="dvalues">
<el-input type="number" v-model="addForm.dvalues" placeholder="请输入默认值" ></el-input>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='3'" label="默认日期" prop="dvalues">
<el-date-picker type="date" v-model="addForm.dvalues" placeholder="请输入默认日期值" ></el-date-picker>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='4'" label="默认值" prop="dvalues">
<el-select v-model="addForm.dvalues" placeholder="请选择">
<el-option
v-for="item in optionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='5'" label="默认选项" prop="dvalues">
<el-select v-model="multipleDvalues" placeholder="请选择默认选项" multiple>
<el-option
v-for="item in optionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='6'" label="默认文件链接" prop="dvalues">
<el-input v-model="addForm.dvalues" style="width:40%;" placeholder="文件链接地址" ></el-input>
<el-input v-model="addForm.dnames" style="width:40%;" placeholder="文件名称或描述" ></el-input>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='7'" label="默认文件列表" prop="dvalues">
<el-select v-model="multipleDvalues" placeholder="请选择" multiple>
<el-option
v-for="item in optionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='8'" label="文本内容" prop="dvalues">
<el-input type="textarea" rows=8 v-model="addForm.dvalues" placeholder="文本内容" ></el-input>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='9'" label="默认图片链接" prop="dvalues">
<el-input v-model="addForm.dvalues" style="width:40%;" placeholder="图片链接地址" ></el-input>
<el-input v-model="addForm.dnames" style="width:40%;" placeholder="图片名称或描述" ></el-input>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='10'" label="默认图片" prop="dvalues">
<el-select v-model="multipleDvalues" placeholder="请选择" multiple>
<el-option
v-for="item in optionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='12'" label="默认视频" prop="dvalues">
<el-select v-model="multipleDvalues" placeholder="请选择默认视频" multiple>
<el-option
v-for="item in optionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='13'" label="默认选中" prop="dvalues">
<el-radio-group v-model="multipleDvalues" placeholder="默认选中" multiple>
<el-radio
v-for="item in optionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-else-if="addForm.itemType=='14'" label="默认选中" prop="dvalues">
<el-checkbox-group v-model="multipleDvalues" placeholder="默认选中">
<el-checkbox
v-for="(op,opidx) in optionList"
:key="opidx"
:label="op.id">
{{op.name}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item v-else label="值" prop="dvalues">
<el-input v-model="addForm.dvalues" style="width:40%;" placeholder="值" ></el-input>
<el-input v-model="addForm.dnames" style="width:40%;" placeholder="值名称" ></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark" v-if="!simple">
<el-input v-model="addForm.remark" placeholder="备注" ></el-input>
</el-form-item>
<el-form-item v-else label="备注" prop="remark">
<font>{{addForm.remark}}</font>
</el-form-item>
<el-form-item label="" prop="required" v-if="!simple">
排序:&nbsp;&nbsp;<el-input type="number" style="width:10%;" v-model="addForm.seq" :min="0" :max="999"></el-input>
&nbsp;&nbsp;<el-checkbox v-model="addForm.required" true-label="1" false-label="0">必输项</el-checkbox>
&nbsp;&nbsp;<el-checkbox v-model="addForm.isShow" true-label="1" false-label="0">显示</el-checkbox>
&nbsp;&nbsp;长度 <el-input type="number" style="width:10%;" v-model="addForm.itemSize" :min="0" :max="200"></el-input>
&nbsp;&nbsp;输入提示<el-input style="width:30%;" v-model="addForm.inputFormat" placeholder="输入提示" ></el-input>
</el-form-item>
</el-form>
</el-row>
<el-row class="page-bottom bottom-fixed">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { getDicts } from '@/api/mdp/meta/item';//
import { addItem } from '@/api/mdp/meta/item';
import { mapGetters } from 'vuex'
import { listCategory } from '@/api/mdp/meta/category';
export default {
computed: {
...mapGetters([
'userInfo'
])
},
props:['item','visible'],
props:['item','visible','simple'],
watch: {
'item':function( item ) {
this.addForm = item;
this.optionNames=""
this.initOptionNamesByaddForm()
},
'visible':function(visible) {
if(visible==true){
//
this.addForm = this.item;
this.optionNames=""
this.initOptionNamesByaddForm()
}
},
optionNames(val){
if(!this.optionNames){
this.optionList=[]
this.addForm.optionList=""
return;
}
var optionsJsonObj=this.optionNames.split("\n").map(i=>{
var id="";
var name="";
if(i.indexOf("|")>0){
var is=i.split("|")
id=is[0]
name=is[1]
return {id:id,name:name}
}else{
var obj=this.optionList.find(obj=>obj.name==i)
if(obj){
return obj;
}else{
return {id:'',name:i}
}
}
})
optionsJsonObj.forEach((i,index)=>{
if(!i.id){
var id=1;
while(optionsJsonObj.some(k=>k.id==id+"")){
id=id+1;
}
i.id=id+""
}
})
this.optionList=optionsJsonObj;
this.addForm.optionList=JSON.stringify(optionsJsonObj);
}
},
data() {
return {
options:{},//
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
addFormRules: {
itemName: [
{ required: true, message: '名称不能为空', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '代码不能为空', trigger: 'blur' }
id: [
//{ required: true, message: '', trigger: 'blur' }
]
},
categorys:[],
//
addForm: {
id:'',itemCode:'',itemName:'',remark:'',categoryId:'',itemSize:'',itemType:'',branchId:'',deptid:''
}
id:'',itemCode:'',itemName:'',remark:'',categoryId:'',itemSize:'50',itemType:'',branchId:'',deptid:'',cmenu:'',dvalues:'',dnames:'',options:'',inputFormat:'',required:'',seq:'999',table:'',isShow:'',qx:''
},
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
//1-2-3-4-5-6-7-8-
itemTypeList:[
{id:"1",name:"普通文本"},
{id:"2",name:"数字"},
{id:"3",name:"日期"},
{id:"4",name:"单选列表"},
{id:"5",name:"多选列表"},
{id:"6",name:"单文件"},
{id:"7",name:"多文件夹"},
{id:"8",name:"富文本"},
{id:"9",name:"单图文"},
{id:"10",name:"多图文"},
{id:"11",name:"单视频"},
{id:"12",name:"多视频"},
{id:"13",name:"单选radio"},
{id:"14",name:"多选checkbox"}
],
optionList:[],
optionNames:"",
multipleDvalues:[],//
multipleItemTypeIds:['5','7','10','12','14'],
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="addFormVisible=false"
handleCancel:function(){
this.$refs['addForm'].resetFields();
this.$emit('cancel');
},
//Item @submit="afterAddSubmit"
//Item @submit="afteraddSubmit"
addSubmit: function () {
this.$refs.addForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.add=true
let params = Object.assign({}, this.addForm);
if(this.multipleItemTypeIds.some(i=>i==params.itemType)){
if(this.multipleDvalues!=null && this.multipleDvalues.length>0){
params.dvalues=this.multipleDvalues.join(",")
}else{
params.dvalues=""
}
}
addItem(params).then((res) => {
this.load.add=false
var tips=res.data.tips;
if(tips.isOk){
this.$refs['addForm'].resetFields();
this.$emit('submit');// @submit="afterAddSubmit"
this.$emit('submit');// @submit="afteraddSubmit"
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch(() => {
this.load.add=false
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.add=false);
});
}
});
},
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
getCategorys() {
let params = {
};
this.load.list = true;
listCategory(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.categorys = res.data.data;
}else{
this.$notify({ message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch(() => {
this.load.list = false;
});
},
initOptionNamesByaddForm(){
if(this.addForm.optionList){
this.optionList=JSON.parse(this.addForm.optionList)
}
this.optionNames=this.optionList.map(i=>i.id+"|"+i.name).join("\n")
if(this.multipleItemTypeIds.some(i=>i==this.addForm.itemType)){
if(this.addForm.dvalues){
this.multipleDvalues=this.addForm.dvalues.split(",")
}else{
this.multipleDvalues=[];
}
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
}
},
/**end 在上面加自定义方法**/
},//end method
components: {
// 'item-edit':ItemEdit
// 'item-add':Itemadd
},
mounted() {
this.getCategorys();
this.addForm=Object.assign(this.addForm, this.item);
this.optionNames=""
this.initOptionNamesByaddForm()
/**在下面写其它函数***/
}//end mounted

447
src/views/mdp/meta/item/ItemEdit.vue

@ -1,84 +1,365 @@
<template>
<section>
<el-row class="page-container border padding">
<section class="page-container padding">
<el-row class="page-header">
</el-row>
<el-row class="page-main">
<!--新增界面 Item 数据项定义-->
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
<el-form-item label="编号" prop="id">
<el-tag>{{editForm.id}}</el-tag>
<el-row>
<el-col :span="12" v-if="!simple">
<el-form-item label="字典代码" prop="itemCode" :rules="[{required:true,message:'请输入字典代码'}]">
<el-input readonly v-model="editForm.itemCode" placeholder="小写,下横线分割" ></el-input>
<font color="blue">小写,下横线分割例子: user_address</font>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="字典名称" prop="itemName" :rules="[{required:true,message:'请输入字典名称'}]">
<el-input v-if="!simple" v-model="editForm.itemName" placeholder="名称" ></el-input>
<div>{{editForm.itemName}}</div>
</el-form-item>
<el-form-item label="代码" prop="itemCode">
<el-input v-model="editForm.itemCode" auto-complete="off"></el-input>
</el-col>
</el-row>
<el-row v-if="!simple">
<el-col :span="12">
<el-form-item label="分类" prop="categoryId" :rules="[{required:true,message:'请选择分类'}]">
<el-select :disabled="!!item.categoryId" v-model="editForm.categoryId" placeholder="请选择分类">
<el-option
v-for="item in categorys"
:key="item.id"
:label="item.categoryName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="名称" prop="itemName">
<el-input v-model="editForm.itemName" auto-complete="off"></el-input>
</el-col>
<el-col :span="12">
<el-form-item label="输入类型" prop="itemType" :rules="[{required:true,message:'请选择类型'}]">
<el-select v-model="editForm.itemType" placeholder="请选择">
<el-option
v-for="item in itemTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="editForm.remark" auto-complete="off"></el-input>
</el-col>
</el-row>
<el-form-item v-if="editForm.itemType=='4'||editForm.itemType=='5'" label="选项列表" prop="optionList">
<el-input type="textarea" rows=8 v-model="optionNames" placeholder="选项列表" ></el-input>
<font color="blue">请输入列表一行代表一个,如要指定编号,请用|线分割比如 <br>
1|<br>
2|<br>
</font>
</el-form-item>
<el-form-item label="长度" prop="itemSize">
<el-input v-model="editForm.itemSize" auto-complete="off"></el-input>
<el-form-item v-else-if="editForm.itemType=='7'" label="文件列表" prop="optionList">
<el-input type="textarea" rows=8 v-model="optionNames" placeholder="文件列表" ></el-input>
<font color="blue">请输入文件列表一行代表一个,比如 <br>
文件链接地址1|文件描述或者名称1<br>
文件链接地址2|文件描述或者名称2<br>
</font>
</el-form-item>
<el-form-item label="类型" prop="itemType">
<el-radio v-model="editForm.itemType" label="text">文本</el-radio>
<el-radio v-model="editForm.itemType" label="number">数字</el-radio>
<el-radio v-model="editForm.itemType" label="date">日期</el-radio>
<el-radio v-model="editForm.itemType" label="image">图片</el-radio>
<el-radio v-model="editForm.itemType" label="video">视频</el-radio>
<el-radio v-model="editForm.itemType" label="clog">图文</el-radio>
<el-radio v-model="editForm.itemType" label="blog">二进制</el-radio>
<el-form-item v-else-if="editForm.itemType=='10'" label="图文列表" prop="optionList">
<el-input type="textarea" rows=8 v-model="optionNames" placeholder="文件列表" ></el-input>
<font color="blue">请输入图文列表一行代表一个,比如 <br>
图片地址1|图片描述1<br>
图片地址2|图片描述2<br>
</font>
</el-form-item>
<el-form-item>
<el-col :span="4" :offset="16">
<el-button @click.native="handleCancel">取消</el-button>
</el-col>
<el-col :span="4">
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" >提交</el-button>
</el-col>
<el-form-item v-else-if="editForm.itemType=='12'" label="视频列表" prop="optionList">
<el-input type="textarea" rows=8 v-model="optionNames" placeholder="文件列表" ></el-input>
<font color="blue">请输入视频列表一行代表一个,比如 <br>
视频地址1|视频描述1<br>
视频地址2|视频描述2<br>
</font>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='13'" label="单选框" prop="optionList">
<el-input type="textarea" rows=8 v-model="optionNames" placeholder="选项列表" ></el-input>
<font color="blue">请输入选项列表一行代表一个,比如 <br>
值1|描述1<br>
值2|描述2<br>
</font>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='14'" label="多选框" prop="optionList">
<el-input type="textarea" rows=8 v-model="optionNames" placeholder="选项列表" ></el-input>
<font color="blue">请输入选项列表一行代表一个,比如 <br>
值1|描述1<br>
值2|描述2<br>
</font>
</el-form-item>
<el-form-item v-if="editForm.itemType=='2'" label="默认值" prop="dvalues">
<el-input type="number" v-model="editForm.dvalues" placeholder="请输入默认值" ></el-input>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='3'" label="默认日期" prop="dvalues">
<el-date-picker type="date" v-model="editForm.dvalues" placeholder="请输入默认日期值" ></el-date-picker>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='4'" label="默认值" prop="dvalues">
<el-select v-model="editForm.dvalues" placeholder="请选择">
<el-option
v-for="item in optionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='5'" label="默认选项" prop="dvalues">
<el-select v-model="multipleDvalues" placeholder="请选择默认选项" multiple>
<el-option
v-for="item in optionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='6'" label="默认文件链接" prop="dvalues">
<el-input v-model="editForm.dvalues" style="width:40%;" placeholder="文件链接地址" ></el-input>
<el-input v-model="editForm.dnames" style="width:40%;" placeholder="文件名称或描述" ></el-input>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='7'" label="默认文件列表" prop="dvalues">
<el-select v-model="multipleDvalues" placeholder="请选择" multiple>
<el-option
v-for="item in optionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='8'" label="文本内容" prop="dvalues">
<el-input type="textarea" rows=8 v-model="editForm.dvalues" placeholder="文本内容" ></el-input>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='9'" label="默认图片链接" prop="dvalues">
<el-input v-model="editForm.dvalues" style="width:40%;" placeholder="图片链接地址" ></el-input>
<el-input v-model="editForm.dnames" style="width:40%;" placeholder="图片名称或描述" ></el-input>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='10'" label="默认图片" prop="dvalues">
<el-select v-model="multipleDvalues" placeholder="请选择" multiple>
<el-option
v-for="item in optionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='12'" label="默认视频" prop="dvalues">
<el-select v-model="multipleDvalues" placeholder="请选择默认视频" multiple>
<el-option
v-for="item in optionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='13'" label="默认选中" prop="dvalues">
<el-radio-group v-model="multipleDvalues" placeholder="默认选中" multiple>
<el-radio
v-for="item in optionList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-else-if="editForm.itemType=='14'" label="默认选中" prop="dvalues">
<el-checkbox-group v-model="multipleDvalues" placeholder="默认选中">
<el-checkbox
v-for="(op,opidx) in optionList"
:key="opidx"
:label="op.id">
{{op.name}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item v-else label="值" prop="dvalues">
<el-input v-model="editForm.dvalues" style="width:40%;" placeholder="值" ></el-input>
<el-input v-model="editForm.dnames" style="width:40%;" placeholder="值名称" ></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark" v-if="!simple">
<el-input v-model="editForm.remark" placeholder="备注" ></el-input>
</el-form-item>
<el-form-item v-else label="备注" prop="remark">
<font>{{editForm.remark}}</font>
</el-form-item>
<el-form-item label="" prop="required" v-if="!simple">
排序:&nbsp;&nbsp;<el-input type="number" style="width:10%;" v-model="editForm.seq" :min="0" :max="999"></el-input>
&nbsp;&nbsp;<el-checkbox v-model="editForm.required" true-label="1" false-label="0">必输项</el-checkbox>
&nbsp;&nbsp;<el-checkbox v-model="editForm.isShow" true-label="1" false-label="0">显示</el-checkbox>
&nbsp;&nbsp;长度 <el-input type="number" style="width:10%;" v-model="editForm.itemSize" :min="0" :max="200"></el-input>
&nbsp;&nbsp;输入提示<el-input style="width:30%;" v-model="editForm.inputFormat" placeholder="输入提示" ></el-input>
</el-form-item>
</el-form>
</el-row>
<el-row class="page-bottom bottom-fixed">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button>
<el-button v-if="!simple" v-loading="load.edit" type="primary" @click.native="categorySelectVisible=true" :disabled="load.edit==true">复制到新的分类下</el-button>
<el-button v-if="!simple" v-loading="load.edit" type="primary" @click.native="metaPushTargetAppsVisible=true" :disabled="load.edit==true">发布</el-button>
</el-row>
<el-dialog append-to-body
title="请选中目标分类"
:visible.sync="categorySelectVisible"
width="30%" >
<el-select v-model="checkCategoryId" placeholder="请选择分类">
<el-option
v-for="item in categorys"
:key="item.id"
:label="item.categoryName"
:value="item.id">
</el-option>
</el-select>
<span slot="footer" class="dialog-footer">
<el-button @click="categorySelectVisible = false"> </el-button>
<el-button type="primary" @click="doCopyToNewCategory"> </el-button>
</span>
</el-dialog>
<el-dialog append-to-body
title="请选中目标应用"
:visible.sync="metaPushTargetAppsVisible"
width="30%" >
<el-select v-model="checkMetaPushTargetApps" placeholder="请选择目标应用" multiple>
<el-option
v-for="item in dicts['meta_push_target']"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<span slot="footer" class="dialog-footer">
<el-button @click="metaPushTargetAppsVisible = false"> </el-button>
<el-button type="primary" @click="doPushToTargetApps"> </el-button>
</span>
</el-dialog>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { editItem } from '@/api/mdp/meta/item';
import { getDicts,initSimpleDicts,initComplexDicts } from '@/api/mdp/meta/item';//
import { editItem,copyToNewCategory } from '@/api/mdp/meta/item';
import { listPushLink,pushToTargetApps } from '@/api/mdp/meta/pushLink';
import { mapGetters } from 'vuex'
import { listCategory } from '@/api/mdp/meta/category';
export default {
export default {
computed: {
...mapGetters([
'userInfo'
])
},
props:['item','visible'],
props:['item','visible','simple'],
watch: {
'item':function( item ) {
this.editForm = item;
this.optionNames=""
this.initOptionNamesByeditForm()
},
'visible':function(visible) {
if(visible==true){
//
}
},
metaPushTargetAppsVisible(val){
if(val==true){
listPushLink({itemId:this.editForm.id}).then(res=>{
this.checkMetaPushTargetApps=res.data.data.map(k=>k.targetId)
})
}
},
optionNames(val){
if(!this.optionNames){
this.optionList=[]
this.editForm.optionList=""
return;
}
var optionsJsonObj=this.optionNames.split("\n").map(i=>{
var id="";
var name="";
if(i.indexOf("|")>0){
var is=i.split("|")
id=is[0]
name=is[1]
return {id:id,name:name}
}else{
var obj=this.optionList.find(obj=>obj.name==i)
if(obj){
return obj;
}else{
return {id:'',name:i}
}
}
})
optionsJsonObj.forEach((i,index)=>{
if(!i.id){
var id=1;
while(optionsJsonObj.some(k=>k.id==id+"")){
id=id+1;
}
i.id=id+""
}
})
this.optionList=optionsJsonObj;
this.editForm.optionList=JSON.stringify(optionsJsonObj);
}
},
data() {
return {
options:{},//
load:{ list: false, add: false, del: false, edit: false },//...
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
dicts:{meta_push_target:{}},//meta_push_target
editFormRules: {
itemName: [
{ required: true, message: '名称不能为空', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '代码不能为空', trigger: 'blur' }
id: [
//{ required: true, message: '', trigger: 'blur' }
]
},
categorys:[],
//
editForm: {
id:'',itemCode:'',itemName:'',remark:'',categoryId:'',itemSize:'',itemType:'',branchId:'',deptid:''
}
id:'',itemCode:'',itemName:'',remark:'',categoryId:'',itemSize:'50',itemType:'',branchId:'',deptid:'',cmenu:'',dvalues:'',dnames:'',options:'',inputFormat:'',required:'',seq:'999',table:'',isShow:'',qx:''
},
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
//1-2-3-4-5-6-7-8-
itemTypeList:[
{id:"1",name:"普通文本"},
{id:"2",name:"数字"},
{id:"3",name:"日期"},
{id:"4",name:"单选列表"},
{id:"5",name:"多选列表"},
{id:"6",name:"单文件"},
{id:"7",name:"多文件夹"},
{id:"8",name:"富文本"},
{id:"9",name:"单图文"},
{id:"10",name:"多图文"},
{id:"11",name:"单视频"},
{id:"12",name:"多视频"},
{id:"13",name:"单选radio"},
{id:"14",name:"多选checkbox"}
],
optionList:[],
optionNames:"",
multipleDvalues:[],//
multipleItemTypeIds:['5','7','10','12','14'],
categorySelectVisible:false,
checkCategoryId:'',
metaPushTargetAppsVisible:false,
checkMetaPushTargetApps:[],
metaPushTargetApps:[],
/**end 在上面加自定义属性**/
}//end return
@ -86,34 +367,103 @@
methods: {
// @cancel="editFormVisible=false"
handleCancel:function(){
this.$refs['editForm'].resetFields();
this.$emit('cancel');
},
//Item @submit="afterEditSubmit"
//Item @submit="aftereditSubmit"
editSubmit: function () {
this.$refs.editForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.editForm);
if(this.multipleItemTypeIds.some(i=>i==params.itemType)){
if(this.multipleDvalues!=null && this.multipleDvalues.length>0){
params.dvalues=this.multipleDvalues.join(",")
}else{
params.dvalues=""
}
}
editItem(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.$refs['editForm'].resetFields();
this.$emit('submit');// @submit="afterEditSubmit"
this.$emit('submit');// @submit="aftereditSubmit"
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch(() => {
this.load.edit=false
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.edit=false);
});
}
});
},
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
getCategorys() {
let params = {
};
this.load.list = true;
listCategory(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.categorys = res.data.data;
}else{
this.$notify({ message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch(() => {
this.load.list = false;
});
},
initOptionNamesByeditForm(){
if(this.editForm.optionList){
this.optionList=JSON.parse(this.editForm.optionList)
}
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
this.optionNames=this.optionList.map(i=>i.id+"|"+i.name).join("\n")
if(this.multipleItemTypeIds.some(i=>i==this.editForm.itemType)){
if(this.editForm.dvalues){
this.multipleDvalues=this.editForm.dvalues.split(",")
}else{
this.multipleDvalues=[];
}
}
},
doCopyToNewCategory(){
if(!this.checkCategoryId){
this.$notify({ message: "请选中目标分类", type: 'error' });
return;
}
var params={
id:this.editForm.id,
categoryId:this.checkCategoryId
}
this.load.edit=true
copyToNewCategory(params).then(res=>{
this.categorySelectVisible=false;
this.load.edit=false;
var tips = res.data.tips;
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch(e=>this.load.edit=false)
},
doPushToTargetApps(){
var params={
itemId:this.editForm.id,
targetIds:this.checkMetaPushTargetApps
}
this.load.edit=true
pushToTargetApps(params).then(res=>{
this.metaPushTargetAppsVisible=false;
this.load.edit=false;
var tips = res.data.tips;
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch(e=>this.load.edit=false)
},
/**end 在上面加自定义方法**/
},//end method
@ -121,7 +471,12 @@
// 'item-edit':ItemEdit
},
mounted() {
initSimpleDicts('all',['meta_push_target']).then(res=>this.dicts=res.data.data);
this.getCategorys();
this.editForm=Object.assign(this.editForm, this.item);
this.optionNames=""
this.initOptionNamesByeditForm()
/**在下面写其它函数***/
}//end mounted

227
src/views/mdp/meta/item/ItemMng.vue

@ -1,7 +1,7 @@
<template>
<section>
<sticky :className="'sub-navbar draft'">
<el-select style="width:40%;" v-model="filters.categoryId" v-loading="load.list" placeholder="请选择分类" clearable>
<section class="page-container border padding">
<el-row>
<el-select :disabled="categoryId" v-model="filters.categoryId" placeholder="请选择分类" clearable>
<el-option
v-for="item in categorys"
:key="item.id"
@ -9,97 +9,143 @@
:value="item.id">
</el-option>
</el-select>
<el-button type="text" @click="showAdd" :disabled="readOnly==true">+字段</el-button>
<el-button type="text" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || readOnly==true">删除</el-button>
</sticky>
<el-row class="page-container border">
<el-select v-model="filters.targetId" placeholder="请选择发布平台" clearable>
<el-option
v-for="(item ,index) in dicts['meta_push_target']"
:key="index"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input>
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchItems" icon="el-icon-search">查询</el-button>
<el-button type="primary" @click="showAdd" icon="el-icon-plus" circle> </el-button>
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete" circle></el-button><font color="blue">系统缓存5-10分钟后起效</font>
</el-row>
<el-row class="padding-top">
<!--列表 Item 数据项定义-->
<el-table :data="items" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column type="selection" min-width="55"></el-table-column>
<el-table-column prop="itemCode" label="代码" min-width="80" ></el-table-column>
<el-table-column prop="itemName" label="名称" min-width="150" ></el-table-column>
<el-table-column label="操作" min-width="80" fixed="right" >
<el-table ref="item" :data="items" :height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column sortable type="index" width="40"></el-table-column>
<el-table-column prop="itemName" label="字典名称" min-width="100" >
</el-table-column><el-table-column prop="itemCode" label="" min-width="100" ></el-table-column>
<el-table-column prop="categoryName" label="分类" min-width="80" ></el-table-column>
<el-table-column prop="itemType" label="输入类型" min-width="80" >
<template slot-scope="scope">
<el-button v-if="readOnly!=true" type="text" @click="showEdit( scope.row,scope.$index)"></el-button>
<el-button v-if="readOnly==true" type="text" @click="checkedItem( scope.row,scope.$index)">选择</el-button>
<div v-for=" (it,idxx) in itemTypeList" :key="idxx">
<div v-if="scope.row.itemType==it.id">{{it.name}}</div>
</div>
</template>
</el-table-column>
<el-table-column prop="dvalues" label="值" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="optionList" label="列表" min-width="80" show-overflow-tooltip :formatter="formatteroptionList"></el-table-column>
<!--
<el-table-column prop="dnames" label="默认值" min-width="80" ></el-table-column>
<el-table-column prop="required" label="必须" min-width="80" ></el-table-column>
<el-table-column prop="seq" label="顺序" min-width="80" ></el-table-column>
<el-table-column prop="show" label="显示" min-width="80" ></el-table-column>
<el-table-column prop="qx" label="权限" min-width="80" ></el-table-column>
-->
<el-table-column prop="remark" label="备注" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template slot="header">
<el-button @click="showAdd" icon="el-icon-plus" circle> </el-button>
</template>
<template scope="scope">
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" circle></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" circle></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
<!--编辑 Item 数据项定义界面-->
<el-dialog title="编辑数据项定义" :visible.sync="editFormVisible" width="50%" :close-on-click-modal="false">
<el-drawer title="编辑数据项定义" :visible.sync="editFormVisible" size="60%" append-to-body :close-on-click-modal="false">
<item-edit :item="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></item-edit>
</el-dialog>
</el-drawer>
<!--新增 Item 数据项定义界面-->
<el-dialog title="新增数据项定义" :visible.sync="addFormVisible" width="50%" :close-on-click-modal="false">
<el-drawer title="新增数据项定义" :visible.sync="addFormVisible" size="60%" append-to-body :close-on-click-modal="false">
<item-add :item="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></item-add>
</el-dialog>
</el-drawer>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import Sticky from '@/components/Sticky' // header
import { listItem, delItem, batchDelItem } from '@/api/mdp/meta/item';
import { listCategory } from '@/api/mdp/meta/category';
import config from '@/common/config';//
import { listItem, delItem, batchDelItem,initSimpleDicts } from '@/api/mdp/meta/item';
import ItemAdd from './ItemAdd';//
import ItemEdit from './ItemEdit';//
import { mapGetters } from 'vuex'
import { listCategory } from '@/api/mdp/meta/category';
export default {
props:['readOnly'],
props:['categoryId'],
computed: {
...mapGetters([
'userInfo'
])
},
watch:{
'filters.categoryId':function(val){
this.searchItems();
}
},
data() {
return {
filters: {
key: '',
categoryId:''
categoryId:'all',
targetId:'',
},
categorys:[],
items: [],//
pageInfo:{//
total:0,//0>0
pageSize:10,//
pageSize:50,//
count:false,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
options:{},// options.sex,options.project
dicts:{
meta_push_target:{options:[]}
//sex:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
addFormVisible: false,//item
//item
addForm: {
id:'',itemCode:'',itemName:'',remark:'',categoryId:'',itemSize:'10',itemType:'text',branchId:'',deptid:''
id:'',itemCode:'',itemName:'',remark:'',categoryId:'',itemSize:'50',itemType:'',branchId:'',deptid:'',cmenu:'',dvalues:'',dnames:'',optionList:'',inputFormat:'请输入',required:'0',seq:'999',tableName:'',isShow:'1',qx:''
},
editFormVisible: false,//
//item
editForm: {
id:'',itemCode:'',itemName:'',remark:'',categoryId:'',itemSize:'',itemType:'',branchId:'',deptid:''
id:'',itemCode:'',itemName:'',remark:'',categoryId:'',itemSize:'',itemType:'',branchId:'',deptid:'',cmenu:'',dvalues:'',dnames:'',optionList:'',inputFormat:'',required:'',seq:'',tableName:'',isShow:'',qx:''
},
/**begin 自定义属性请在下面加 请加备注**/
categorys:[],
/**end 自定义属性请在上面加 请加备注**/
maxTableHeight:300,
itemTypeList:[
{id:"1",name:"普通文本"},
{id:"2",name:"数字"},
{id:"3",name:"日期"},
{id:"4",name:"单选列表"},
{id:"5",name:"多选列表"},
{id:"6",name:"单文件"},
{id:"7",name:"多文件夹"},
{id:"8",name:"富文本"},
{id:"9",name:"单图文"},
{id:"10",name:"多图文"},
{id:"11",name:"单视频"},
{id:"12",name:"多视频"},
{id:"13",name:"单选radio"},
{id:"14",name:"多选checkbox"}
]
}
},//end data
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.pageInfo.count=true;
this.getItems();
},
handleCurrentChange(pageNum) {
@ -108,20 +154,23 @@
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange( obj ){
if(obj.order==null){
this.pageInfo.orderFields=[];
this.pageInfo.orderDirs=[];
}else{
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
}else{
dir='desc';
}
if(obj.prop=='xxx'){
this.pageInfo.orderFields=['xxx'];
this.pageInfo.orderFields=[util.toLine(obj.prop)];
this.pageInfo.orderDirs=[dir];
}
this.getItems();
},
searchItems(){
this.pageInfo.count=true;
this.getItems();
},
@ -130,7 +179,8 @@
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,count:this.pageInfo.count
total: this.pageInfo.total,
count:this.pageInfo.count
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
@ -139,26 +189,27 @@
}
params.orderBy= orderBys.join(",")
}
if(this.filters.key!==""){
//params.xxx=this.filters.key
}else{
//params.xxx=xxxxx
if(this.filters.key){
params.key= this.filters.key
}
if(this.filters.categoryId){
params.categoryId=this.filters.categoryId
}
if(this.filters.targetId){
params.targetId=this.filters.targetId
}
this.load.list = true;
listItem(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.data.total;this.pageInfo.count=false;
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.items = res.data.data;
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
this.$notify({ message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch(() => {
this.load.list = false;
//this.$notify({position:'bottom-left',showClose:true,message: '', type: 'error' });
});
}).catch( err => this.load.list = false );
},
// Item
@ -168,12 +219,8 @@
},
// Item
showAdd: function () {
if(this.filters.categoryId==''){
this.$message.error("请先选择分类");
return
}
this.addForm.categoryId=this.filters.categoryId;
this.addFormVisible = true;
this.addForm.categoryId=this.filters.categoryId
//this.addForm=Object.assign({}, this.editForm);
},
afterAddSubmit(){
@ -190,12 +237,11 @@
},
//item
handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
let params = row;
let params = { id: row.id };
delItem(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
@ -203,10 +249,8 @@
this.pageInfo.count=true;
this.getItems();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
});
}).catch(() => {
this.load.del=false;
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
});
},
//item
@ -223,42 +267,60 @@
this.pageInfo.count=true;
this.getItems();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
});
}).catch(() => {
this.load.del=false;
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false );
});
},
rowClick: function(row, event, column){
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
checkedItem: function(row, event, column){
this.$emit('checked-item',row, event, column);// @checked-item="checkedItem"
}
/**begin 自定义函数请在下面加**/
// Category
getCategorys() {
let params = {
};
this.load.list = true;
listCategory(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.categorys = res.data.data;
}else{
this.$notify({ message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch(() => {
this.load.list = false;
});
},
formatteroptionList(row,colum,cellValue,index){
if(cellValue){
var arr=JSON.parse(cellValue)
return arr.map(i=>i.name).join(",")
}else{
return ""
}
}
/**end 自定义函数请在上面加**/
},//end methods
components: {
'item-add':ItemAdd,
'item-edit':ItemEdit,
'sticky': Sticky
//
},
mounted() {
initSimpleDicts('all','meta_push_target').then(res=>this.dicts=res.data.data)
if(this.categoryId){
this.filters.categoryId=this.categoryId
this.addForm.categoryId=this.categoryId
}
this.getCategorys();
this.$nextTick(() => {
this.getItems();
this.load.list=true
listCategory({branchId:''}).then(res=>{
this.load.list=false
if(res.data.tips.isOk){
this.categorys=res.data.data
}else{
this.$messaage.error(res.data.tips.msg);
}
}).catch(()=>this.load.list=false);
var clientRect=this.$refs.item.$el.getBoundingClientRect();
var subHeight=70/1000 * window.innerHeight;
this.maxTableHeight = window.innerHeight -clientRect.y - this.$refs.item.$el.offsetTop-subHeight;
});
}
}
@ -266,5 +328,4 @@
</script>
<style scoped>
</style>

11
src/views/mdp/meta/itemOption/ItemOptionAdd.vue

@ -1,6 +1,7 @@
<template>
<section>
<el-row class="page-container border padding">
<el-row>
<!--新增界面 ItemOption 数据项取值列表-->
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
<el-form-item label="选项值" prop="optionValue">
<el-input v-model="addForm.optionValue" auto-complete="off"></el-input>
@ -8,8 +9,8 @@
<el-form-item label="选项名称" prop="optionName">
<el-input v-model="addForm.optionName" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="快捷键" prop="keys">
<el-input v-model="addForm.keys" auto-complete="off"></el-input>
<el-form-item label="快捷键" prop="Keyes">
<el-input v-model="addForm.Keyes" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="" prop="isShow">
<el-col :span=8>
@ -89,7 +90,7 @@
},
//
addForm: {
itemId:'',id:'',optionValue:'',optionName:'',keys:'',isShow:'',seqOrder:'',fp:'',tp:'',sp:'',isDefault:'',cdate:'',branchId:'',deptid:''
itemId:'',id:'',optionValue:'',optionName:'',Keyes:'',isShow:'',seqOrder:'',fp:'',tp:'',sp:'',isDefault:'',cdate:'',branchId:'',deptid:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
@ -117,7 +118,7 @@
this.$refs['addForm'].resetFields();
this.$emit('submit');// @submit="afterAddSubmit"
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch(() => {
this.load.add=false
});

8
src/views/mdp/meta/itemOption/ItemOptionEdit.vue

@ -9,8 +9,8 @@
<el-form-item label="选项名称" prop="optionName">
<el-input v-model="editForm.optionName" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="快捷键" prop="keys">
<el-input v-model="editForm.keys" auto-complete="off"></el-input>
<el-form-item label="快捷键" prop="Keyes">
<el-input v-model="editForm.Keyes" auto-complete="off"></el-input>
</el-form-item>
<el-form-item label="顺序" prop="seqOrder">
@ -94,7 +94,7 @@
},
// ItemOption
editForm: {
itemId:'',id:'',optionValue:'',optionName:'',keys:'',isShow:'',seqOrder:'',fp:'',tp:'',sp:'',isDefault:'',cdate:'',branchId:'',deptid:''
itemId:'',id:'',optionValue:'',optionName:'',Keyes:'',isShow:'',seqOrder:'',fp:'',tp:'',sp:'',isDefault:'',cdate:'',branchId:'',deptid:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
@ -121,7 +121,7 @@
this.$refs['editForm'].resetFields();
this.$emit('submit');// @submit="afterEditSubmit"
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch(() => {
this.load.edit=false
});

68
src/views/mdp/meta/itemOption/ItemOptionMng.vue

@ -2,34 +2,34 @@
<section>
<el-row>
<el-col :span="6">
<item-mng :read-only="readOnly" @row-click="itemRowClick" @checked-item="checkedItem"></item-mng>
<item-mng @row-click="itemRowClick"></item-mng>
</el-col>
<el-col :span="18">
<sticky :className="'sub-navbar draft'">
<el-row class="app-container">
<el-input v-model="addForm.optionName" @keyup.enter.native="addSubmit" style="width: 40%;" placeholder="输入名称按回车快速添加字段值"></el-input>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input>
<el-button type="primary" v-loading="load.list" v-on:click="searchItemOptions">查询</el-button>
<el-button type="text" @click="showAdd" :disabled="readOnly==true">+字段值</el-button>
<el-button type="text" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || readOnly==true">删除</el-button>
</sticky>
<el-row class="page-container border">
<el-button type="primary" v-loading="load.list" v-on:click="searchItemOptions" icon="el-icon-search"></el-button>
<el-button type="text" @click="showAdd" icon="el-icon-plus">字段值</el-button>
<el-button type="text" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0">删除</el-button>
</el-row>
<el-row class="app-container">
<!--列表 ItemOption 数据项取值列表-->
<el-table :data="itemOptions" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="seqOrder" label="顺序" min-width="80" ></el-table-column>
<el-table-column prop="optionValue" label="选项值" min-width="80" ></el-table-column>
<el-table-column prop="optionName" label="选项名称" min-width="80" ></el-table-column>
<el-table-column prop="isShow" label="是否显示" min-width="80" >
<el-table :max-height="tableHeight" :data="itemOptions" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column sortable type="selection" width="40"></el-table-column>
<el-table-column sortable prop="seqOrder" label="顺序" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column sortable prop="optionValue" label="选项值" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column sortable prop="optionName" label="选项名称" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column sortable prop="isShow" label="是否显示" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag v-if="scope.row.isShow=='1'"></el-tag>
<el-tag v-else>×</el-tag>
</template>
</el-table-column>
<el-table-column prop="fp" label="扩展字段" min-width="80" ></el-table-column>
<el-table-column v-if="readOnly!=true" label="操作" width="150" fixed="right" >
<el-table-column sortable prop="fp" label="扩展字段" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column sortable label="操作" width="150" fixed="right" show-overflow-tooltip>
<template slot-scope="scope">
<el-button @click="showEdit( scope.row,scope.$index)" ></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)"></el-button>
<el-button @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit"></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete"></el-button>
</template>
</el-table-column>
</el-table>
@ -51,7 +51,7 @@
<script>
import util from '@/common/js/util';//
import Sticky from '@/components/Sticky' // header
//import Sticky from '@/components/Sticky' // header
import { listItemOption, delItemOption, batchDelItemOption, addItemOption,listOption } from '@/api/mdp/meta/itemOption';
import ItemOptionAdd from './ItemOptionAdd';//
import ItemOptionEdit from './ItemOptionEdit';//
@ -59,7 +59,8 @@
import { mapGetters } from 'vuex'
export default {
props:['readOnly'],
name:'ItemOptionMng',
computed: {
...mapGetters([
'userInfo'
@ -85,16 +86,17 @@
addFormVisible: false,//itemOption
//itemOption
addForm: {
itemId:'',id:'',optionValue:'',optionName:'',keys:'',isShow:'1',seqOrder:'',fp:'',tp:'',sp:'',isDefault:'',cdate:'',branchId:'',deptid:''
itemId:'',id:'',optionValue:'',optionName:'',Keyes:'',isShow:'1',seqOrder:'',fp:'',tp:'',sp:'',isDefault:'',cdate:'',branchId:'',deptid:''
},
editFormVisible: false,//
//itemOption
editForm: {
itemId:'',id:'',optionValue:'',optionName:'',keys:'',isShow:'1',seqOrder:'',fp:'',tp:'',sp:'',isDefault:'',cdate:'',branchId:'',deptid:''
itemId:'',id:'',optionValue:'',optionName:'',Keyes:'',isShow:'1',seqOrder:'',fp:'',tp:'',sp:'',isDefault:'',cdate:'',branchId:'',deptid:''
},
/**begin 自定义属性请在下面加 请加备注**/
item:{},
tableHeight:500,
/**end 自定义属性请在上面加 请加备注**/
}
},//end data
@ -143,7 +145,7 @@
params.orderBy= orderBys.join(",")
}
if(this.filters.key!==""){
//params.xxx=this.filters.key
params.key="%"+this.filters.key+"%"
}else{
//params.xxx=xxxxx
}
@ -154,15 +156,15 @@
listItemOption(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.data.total;this.pageInfo.count=false;
this.pageInfo.total = res.data.total;this.pageInfo.count=false;
this.itemOptions = res.data.data;
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
this.$notify({ message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch(() => {
this.load.list = false;
//this.$notify({position:'bottom-left',showClose:true,message: '', type: 'error' });
//this.$notify({ message: '', type: 'error' });
});
},
@ -204,7 +206,7 @@
this.pageInfo.count=true;
this.getItemOptions();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
});
}).catch(() => {
this.load.del=false;
@ -224,7 +226,7 @@
this.pageInfo.count=true;
this.getItemOptions();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error'});
});
}).catch(() => {
this.load.del=false;
@ -237,16 +239,11 @@
this.item=row
this.searchItemOptions();
},
checkedItem: function(row, event, column){
this.item=row
this.searchItemOptions();
this.$emit('checked-item',row, event, column);
},
/**begin 自定义函数请在下面加**/
//ItemOption @submit="afterAddSubmit"
addSubmit: function () {
if(this.item==null || this.item.id == '' ){
this.$message.error("请先选择字段")
this.$notify.error("请先选择字段")
}
this.load.add=true
@ -259,7 +256,7 @@
if(tips.isOk){
this.itemOptions.push(res.data.data);
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch(() => {
this.load.add=false
});
@ -271,12 +268,13 @@
components: {
'item-option-add':ItemOptionAdd,
'item-option-edit':ItemOptionEdit,
'sticky': Sticky,
'item-mng':ItemMng
//
},
mounted() {
this.$nextTick(() => {
this.tableHeight = window.innerHeight - 250;
this.getItemOptions();
listOption([{categoryId:'gk8nischm',itemCode:'sex'}]).then(res=>{
this.options=res.data.data;

249
src/views/mdp/meta/sysParam/SysParamMng.vue

@ -1,60 +1,16 @@
<template>
<section>
<el-row>
<sticky :className="'sub-navbar draft'">
<el-input v-model="addForm.id" v-loading="load.add" @keyup.enter.native="addSubmit" style="width: 40%;" placeholder="输入参数代码(英文)按回车快速添加参数"></el-input>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input>
<el-button type="primary" v-loading="load.list" v-on:click="searchItemOptions">查询</el-button>
<el-button type="primary" @click="showAdd">+参数</el-button>
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0">批量删除</el-button>
</sticky>
<el-row class="page-container border">
<!--列表 ItemOption 数据项取值列表-->
<el-table :data="itemOptions" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="seqOrder" label="顺序" min-width="80" ></el-table-column>
<el-table-column prop="id" label="参数代码" min-width="80" ></el-table-column>
<el-table-column prop="optionValue" label="参数值" min-width="80" ></el-table-column>
<el-table-column prop="optionName" label="参数名称" min-width="80" ></el-table-column>
<el-table-column prop="isShow" label="是否有效" width="80" >
<template slot-scope="scope">
<el-tag v-if="scope.row.isShow=='1'"></el-tag>
<el-tag v-else>×</el-tag>
</template>
</el-table-column>
<el-table-column prop="fp" label="扩展字段" min-width="80" ></el-table-column>
<el-table-column label="操作" width="150" fixed="right">
<template slot-scope="scope">
<el-button @click="showEdit( scope.row,scope.$index)"></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)"></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
</el-row>
<!--编辑 ItemOption 数据项取值列表界面-->
<el-dialog title="编辑参数" :visible.sync="editFormVisible" width="50%" :close-on-click-modal="false">
<item-option-edit :item-option="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></item-option-edit>
</el-dialog>
<!--新增 ItemOption 数据项取值列表界面-->
<el-dialog title="新增参数" :visible.sync="addFormVisible" width="50%" :close-on-click-modal="false">
<item-option-add :item-option="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></item-option-add>
</el-dialog>
</el-row>
<item-mng :category-id="'sysParam'">
</item-mng>
</section>
</template>
<script>
import util from '@/common/js/util';//
import Sticky from '@/components/Sticky' // header
import { listItemOption, delItemOption, batchDelItemOption, addItemOption,listItemOptionByItemCode } from '@/api/mdp/meta/itemOption';
import ItemOptionAdd from './ItemOptionAdd';//
import ItemOptionEdit from './ItemOptionEdit';//
import config from '@/common/config';//
import { mapGetters } from 'vuex'
import ItemMng from '../item/ItemMng.vue';
export default {
computed: {
...mapGetters([
'userInfo'
@ -62,216 +18,21 @@
},
data() {
return {
filters: {
key: ''
},
itemOptions: [],//
pageInfo:{//
total:0,//0>0
pageSize:10,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
options:{},// options.sex,options.project
addFormVisible: false,//itemOption
//itemOption
addForm: {
itemId:'',id:'',optionValue:'',optionName:'',keys:'',isShow:'1',seqOrder:'',fp:'',tp:'',sp:'',isDefault:'',cdate:'',branchId:'',deptid:''
},
editFormVisible: false,//
//itemOption
editForm: {
itemId:'',id:'',optionValue:'',optionName:'',keys:'',isShow:'1',seqOrder:'',fp:'',tp:'',sp:'',isDefault:'',cdate:'',branchId:'',deptid:''
},
/**begin 自定义属性请在下面加 请加备注**/
item:{id:'sysParamList',itemName:'系统参数'},
/**end 自定义属性请在上面加 请加备注**/
}
},//end data
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.pageInfo.count=true;
this.getItemOptions();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getItemOptions();
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange( obj ){
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
}else{
dir='desc';
}
if(obj.prop=='xxx'){
this.pageInfo.orderFields=['xxx'];
this.pageInfo.orderDirs=[dir];
}
this.getItemOptions();
},
searchItemOptions(){
this.pageInfo.count=true;
this.getItemOptions();
},
// ItemOption
getItemOptions() {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,count:this.pageInfo.count
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
params.orderBy= orderBys.join(",")
}
if(this.filters.key!==""){
//params.xxx=this.filters.key
}else{
//params.xxx=xxxxx
}
if(this.item!=null && this.item.id!=''){
params.itemId=this.item.id
}
this.load.list = true;
listItemOption(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.data.total;this.pageInfo.count=false;
this.itemOptions = res.data.data;
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch(() => {
this.load.list = false;
//this.$notify({position:'bottom-left',showClose:true,message: '', type: 'error' });
});
},
// ItemOption
showEdit: function ( row,index ) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
// ItemOption
showAdd: function () {
this.addForm.itemId=this.item.id;
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
afterAddSubmit(){
this.addFormVisible=false;
this.pageInfo.count=true;
this.getItemOptions();
},
afterEditSubmit(){
this.editFormVisible=false;
},
//itemOption
selsChange: function (sels) {
this.sels = sels;
},
//itemOption
handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
let params =row;
delItemOption(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.count=true;
this.getItemOptions();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
});
}).catch(() => {
this.load.del=false;
});
},
//itemOption
batchDel: function () {
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
batchDelItemOption(this.sels).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if( tips.isOk ){
this.pageInfo.count=true;
this.getItemOptions();
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'});
});
}).catch(() => {
this.load.del=false;
});
},
rowClick: function(row, event, column){
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
itemRowClick: function(row, event, column){
this.item=row
this.searchItemOptions();
},
/**begin 自定义函数请在下面加**/
//ItemOption @submit="afterAddSubmit"
addSubmit: function () {
if(this.item==null || this.item.id == '' ){
this.$message.error("请先选择分类")
}
this.load.add=true
let params = Object.assign({}, this.addForm);
params.itemId=this.item.id
addItemOption(params).then((res) => {
this.load.add=false
var tips=res.data.tips;
if(tips.isOk){
this.itemOptions.push(res.data.data);
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
}).catch(() => {
this.load.add=false
});
}
/**end 自定义函数请在上面加**/
},//end methods
components: {
'item-option-add':ItemOptionAdd,
'item-option-edit':ItemOptionEdit,
'sticky': Sticky
//
ItemMng,
},
mounted() {
this.$nextTick(() => {
this.getItemOptions();
});
}
}
</script>
<style scoped>
</style>

6
src/views/mdp/sys/branch/BranchSelect.vue

@ -1,9 +1,9 @@
<template>
<section>
<sticky :className="'sub-navbar draft'">
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input>
<el-row :className="'sub-navbar draft'">
<el-input v-model="filters.key" style="width: 40%;" placeholder="模糊查询"></el-input>
<el-button type="primary" v-loading="load.list" v-on:click="searchBranchs">查询</el-button>
</sticky>
</el-row>
<el-row class="page-container border">
<!--列表 Branch 管理端机构表机构下面若干部门-->
<el-table :data="branchs" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">

140
src/views/mdp/sys/dept/DeptTree.vue

@ -1,18 +1,29 @@
<template>
<section>
<el-row>
<el-col :span="24">
<el-input :class="workShop.isSuperAdmin==true||workShop.isPlatformAdmin==true?'filter-input-admin':'filter-input-common'" v-model="deptFilterText" v-if=" showFilter!=false " placeholder="编号、名称过滤" auto-complete="off"></el-input>
<el-button type="warning" icon="el-icon-star-off" v-if="workShop.isSuperAdmin==true||workShop.isPlatformAdmin==true" @click.native="showBranchSelect">机构</el-button>
<el-col :span="24" style="display:inline-block;" >
<el-input style="width:70%;" v-model="deptFilterText" v-if=" showFilter!=false " placeholder="编号、名称过滤" auto-complete="off"></el-input>
<el-button v-if="showConfirm" type="warning" @click.native="confirm">确认</el-button>
<el-popover v-if="!showConfirm && (userInfo.isSuperAdmin==true||userInfo.isPlatformAdmin==true)"
placement="top-start"
title="更多操作"
width="200"
trigger="hover" >
<p>
<el-button type="primary" style="margin-left:10px;margin-top:10px;" icon="el-icon-star-off" v-if="userInfo.isSuperAdmin==true||userInfo.isPlatformAdmin==true" @click.native="showBranchSelect">切换机构</el-button>
<el-button type="warning" style="margin-left:10px;margin-top:10px;" @click.native="goDeptMng" icon="el-icon-setting" title="创建部门、修改部门、设置岗位等">部门管理</el-button>
</p>
<el-button type="warning" icon="el-icon-setting" slot="reference"></el-button>
</el-popover>
<el-button type="warning" v-else @click.native="goDeptMng" icon="el-icon-setting" title="创建部门、修改部门、设置岗位等"></el-button>
</el-col>
<el-col :span="24">
<el-tree v-loading="listLoading"
class="filter-tree"
:data="treeData"
:props="defaultDeptTreeProps"
:filter-node-method="filterDeptNode"
:show-checkbox="showCheckbox"
:default-expand-all="defaultExpandAll"
:expand-on-click-node="expandOnClickNode"
:indent="indent"
:node-key="'deptid'"
@ -26,6 +37,8 @@
:check-on-click-node="true"
check-strictly
:render-content="renderContent"
lazy
:load="loadNode"
ref="deptTree">
</el-tree>
</el-col>
@ -72,7 +85,7 @@
},
computed:{
defaultExpandedKeys(){
return this.defaultCheckedKeys;
return this.expandRowKeys
},
defaultCheckedKeys(){
if(this.value){
@ -81,13 +94,13 @@
return this.checkedKeys;
},
...mapGetters([
'workShop'
'userInfo'
]),
treeData(){
return this.translateDataToTree(this.depts)
}
},
props: ['value','branchId','visible', 'showCount','showRoot','countTips','showFilter', 'multiple','checkedKeys','refresh','defaultExpandAll','expandOnClickNode','showCheckbox','indent'],
props: ['value','branchId','visible', 'showCount','showRoot','countTips','showFilter', 'multiple','checkedKeys','refresh','defaultExpandAll','expandOnClickNode','showCheckbox','indent','showConfirm'],
data() {
return {
deptFilterText: '',
@ -96,15 +109,20 @@
id:'deptid',
label:'deptName',
children: 'children'
children: 'children',
isLeaf:'leaf'
},
listLoading: false,
deptid:'',
branchVisible: false,
branch:null
branch:null,
expandRowKeys:[],
}
},
methods: {
goDeptMng(){
this.$router.push("/mdp/sys/dept/DeptMng")
},
handleCheckChange(data, checked, indeterminate) {
let checkedKeys=this.$refs.deptTree.getCheckedKeys();
@ -148,6 +166,11 @@
return [];
}
let parents = data.filter(value =>{
if(value.childrenNum>0){
value.leaf=false
}else{
value.leaf=true
}
//
if(value.pdeptid == 'undefined' || value.pdeptid == null || value.pdeptid == '' || value.pdeptid == 'A0'){
return true;
@ -190,19 +213,20 @@
getDeptTreeData(refresh) {
let params = {
};
params.branchId=this.branchId
if(this.workShop.isSuperAdmin==true || this.workShop.isPlatformAdmin==true){
if(this.userInfo.isSuperAdmin==true || this.userInfo.isPlatformAdmin==true){
if(this.branch!=null){
params.branchId=this.branch.id
}else if(params.branchId==null || params.branchId==''){
params.branchId=this.workShop.branchId
params.branchId=this.userInfo.branchId
}
}else{
if(params.branchId==null || params.branchId==''){
params.branchId=this.workShop.branchId
params.branchId=this.userInfo.branchId
}
params.autoDetectParentDeptid="1"
// params.autoDetectParentDeptid="1"
}
this.listLoading = true;
listTreeDept(params).then((res) => {
@ -218,8 +242,8 @@
res.data.data.deptName=this.branch.branchName+'(机构)'
res.data.data.isBranch=true
}else {
res.data.data.branchId=this.workShop.branchId
res.data.data.deptName=this.workShop.branchName+'(机构)'
res.data.data.branchId=this.userInfo.branchId
res.data.data.deptName=this.userInfo.branchName+'(机构)'
res.data.data.isBranch=true
}
this.depts=data
@ -231,15 +255,15 @@
res.data.data.deptName=this.branch.branchName+'(机构)'
res.data.data.isBranch=true
}else {
res.data.data.branchId=this.workShop.branchId
res.data.data.deptName=this.workShop.branchName+'(机构)'
res.data.data.branchId=this.userInfo.branchId
res.data.data.deptName=this.userInfo.branchName+'(机构)'
res.data.data.isBranch=true
}
this.depts=data;
}
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error'});
this.$notify({ message: tips.msg, type: 'error'});
}
this.listLoading = false;
}).catch(() => {
@ -265,19 +289,91 @@
if(this.showCount==true || this.showCount=='true'){
return h('span',node.label) ;
return h('span',node.label+'('+data.childrenNum+')') ;
}else{
return h('span',node.label) ;
return h('span',node.label+'('+data.childrenNum+')') ;
}
},
showBranchSelect: function(){
this.branchVisible=true
},
confirm(){
var nodes= this.$refs.deptTree.getCheckedNodes(false,false)
this.$emit('confirm',nodes)
},
loadNode(node, resolve) {
if (node.level === 0) {
let params = {
levelTypes:['L1']
};
params.branchId=this.branchId
if(this.userInfo.isSuperAdmin==true || this.userInfo.isPlatformAdmin==true){
if(this.branch!=null){
params.branchId=this.branch.id
}else if(params.branchId==null || params.branchId==''){
params.branchId=this.userInfo.branchId
}
}else{
if(params.branchId==null || params.branchId==''){
params.branchId=this.userInfo.branchId
}
// params.autoDetectParentDeptid="1"
}
this.listLoading = true;
listTreeDept(params).then((res) => {
var tips=res.data.tips;
var data=res.data.data;
this.listLoading = false;
var tempData=this.translateDataToTree(data);
this.expandRowKeys=tempData.map(i=>i.deptid)
return resolve(tempData )
}).catch(() => {
this.listLoading = false;
});
}else {
if(node.data.childrenNum>0 && (!node.data.children||node.data.children.length==0)){
setTimeout(() => {
let params = {
pdeptid:node.data.deptid
};
params.branchId=this.branchId
if(this.userInfo.isSuperAdmin==true || this.userInfo.isPlatformAdmin==true){
if(this.branch!=null){
params.branchId=this.branch.id
}else if(params.branchId==null || params.branchId==''){
params.branchId=this.userInfo.branchId
}
}else{
if(params.branchId==null || params.branchId==''){
params.branchId=this.userInfo.branchId
}
// params.autoDetectParentDeptid="1"
}
this.listLoading = true;
listTreeDept(params).then((res) => {
var tips=res.data.tips;
var data=res.data.data;
this.listLoading = false;
resolve(this.translateDataToTree(data))
}).catch(() => {
this.listLoading = false;
});
}, 500);
}else if(node.data.childrenNum>0 && (node.data.children&&node.data.children.length>0)){
return resolve(node.data.children)
}else {
return resolve([])
}
}
}
},
mounted() {
this.deptid=this.value;
this.getDeptTreeData();
//this.getDeptTreeData();
}
}

32
src/views/mdp/sys/post/PostSelectCommon.vue

@ -1,22 +1,22 @@
<template>
<section>
<el-row class="page-container border">
<el-row class="app-container">
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input>
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchPosts">查询</el-button>
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchPosts" icon="el-icon-search"></el-button>
<el-button type="primary" @click="confirmPostSelect" v-loading="load.add==true">确定</el-button>
<el-tooltip class="item" effect="light" content="如果没有查询到岗位,有可能是所有岗位已经加入该部门,可在岗位管理中定义新的岗位,再到此将岗位加入部门" placement="top-start">
<i class="el-icon-question"></i>
</el-tooltip>
</el-row>
<el-row class="page-container border">
<el-row class="app-container">
<!--列表 Post sys_post-->
<el-table :data="posts" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column type="selection" width="55"></el-table-column>
<el-table :max-height="tableHeight" :data="posts" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column type="selection" width="40"></el-table-column>
<el-table-column type="index" width="60"></el-table-column>
<el-table-column prop="postName" label="岗位名称" min-width="80" ></el-table-column>
<el-table-column prop="remark" label="备注" min-width="80" ></el-table-column>
<el-table-column prop="cdate" label="创建日期" min-width="80" ></el-table-column>
<el-table-column prop="postName" label="岗位名称" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="remark" label="备注" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column prop="cdate" label="创建日期" min-width="80" show-overflow-tooltip></el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
@ -26,7 +26,7 @@
<script>
import util from '@/common/js/util';//
import Sticky from '@/components/Sticky' // header
//import Sticky from '@/components/Sticky' // header
//import { listOption } from '@/api/mdp/meta/itemOption';//
import { listPost, delPost, batchDelPost,listPostNotInDeptid } from '@/api/mdp/sys/post/post';
import { mapGetters } from 'vuex'
@ -43,7 +43,7 @@
},
computed: {
...mapGetters([
'workShop'
'userInfo'
])
},
data() {
@ -74,7 +74,8 @@
//post
editForm: {
id:'',postName:'',remark:'',branchId:'',cdate:''
}
},
tableHeight:500,
/**begin 自定义属性请在下面加 请加备注**/
/**end 自定义属性请在上面加 请加备注**/
@ -138,7 +139,7 @@
this.pageInfo.count=false;
this.posts = res.data.data;
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
this.$notify({ message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
@ -179,7 +180,7 @@
confirmPostSelect(){
if(this.sels.length<=0){
this.$notify({position:'bottom-left',showClose:true,message:'请选择角色', type: 'error'});
this.$notify({ message:'请选择角色', type: 'error'});
return;
}
this.load.add=true;
@ -191,10 +192,13 @@
},//end methods
components: {
'sticky': Sticky
//
},
mounted() {
this.$nextTick(() => {
this.tableHeight = window.innerHeight - 250;
});
this.$nextTick(() => {
this.getPosts();
});

340
src/views/mdp/sys/user/UsersSelect.vue

@ -1,59 +1,38 @@
<template>
<section>
<el-row>
<el-input v-model="filters.key" style="width: 20%;" placeholder="名称 编号 手机号码 模糊查询"></el-input>
<el-checkbox v-model="filters.isQueryByDept" :disabled="isSelectByDept" >按部门-{{this.deptTree.deptNodeSelected.deptName}}</el-checkbox>
<el-button type="primary" v-loading="load.list" v-on:click="searchUsers">查询</el-button>
<el-button type="primary" v-on:click="confirmUsers">确定</el-button>
<el-tabs v-model="activeTabPane">
<el-tab-pane name="1" label="常用">
<el-row style="height:30px;">
<el-button type="primary" v-if="sels.length>0" v-on:click="confirmUsers">确定</el-button>
</el-row>
<el-row class="selected-tag">已选择
<el-tag
v-for="sel in sels"
:key="sel.userid"
closable @close="unselectUser(sel)">
{{sel.username}}
</el-tag>
</el-row>
<el-row class="page-container border">
<el-col :span="6" style=" overflow-x:auto; height:600px;">
<dept-tree show-root default-expand-all show-checkbox :expand-on-click-node="false" @node-click="handleLeftDeptNodeClick" @branch-row-click="branchRowClick"></dept-tree>
</el-col>
<el-col :span="18">
<!--列表 User sys_user-->
<el-table :row-key="'userid'" :data="users" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" style="width: 100%;" ref="userTable">
<el-table :row-key="'userid'" :data="users" :height="maxTableHeight" highlight-current-row v-loading="load.list" border @selection-change="selsChange" style="width: 100%;" ref="userTable" @row-click="rowClick">
<el-table-column :reserve-selection="true" type="selection" width="65"></el-table-column>
<el-table-column type="index" width="65"></el-table-column>
<el-table-column prop="username" sortable label="用户名称" min-width="120" ></el-table-column>
<el-table-column prop="displayUserid" label="登录账号" min-width="150" ></el-table-column>
<el-table-column prop="sex" label="性别" width="80">
<template slot-scope="scope">
<el-tag v-if="scope.row.sex=='0'"></el-tag>
<el-tag v-if="scope.row.sex=='1'"></el-tag>
<el-tag v-if="scope.row.sex=='2'">其它</el-tag>
</template>
</el-table-column>
<el-table-column prop="locked" label="状态" width="80" >
<el-table-column prop="username" sortable label="用户名称" min-width="120" >
<template slot-scope="scope">
<el-tag v-if="scope.row.locked=='0'"></el-tag>
<el-tag v-else>×</el-tag>
<div class="avatar-container">
<div class="avatar-wrapper">
<img v-if=" scope.row.headimgurl " class="user-avatar" :src="scope.row.headimgurl">
<img v-else class="user-avatar" src="../../../../assets/image/user_img.gif">
<span class="username"><i v-if="scope.row.sex=='0'" class="el-icon-female"></i><i v-else class="el-icon-male"></i> {{scope.row.username}}</span>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="displayUserid" label="登录账号" min-width="150" ></el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane name="2" label="部门用户">
<users-select-only :isSingleUser='isSingleUser' :selectUserids='selectUserids' :isSelectByDept='isSelectByDept' @confirm="onConfirmUsers"></users-select-only>
</el-tab-pane>
</el-tabs>
</section>
</template>
<script>
import util from '@/common/js/util';//
import Sticky from '@/components/Sticky' // header
import { listUser } from '@/api/mdp/sys/user';
import DeptTree from '@/views/mdp/sys/dept/DeptTree.vue';
import { mapGetters } from 'vuex'
import md5 from 'js-md5';
import UsersSelectOnly from './UsersSelectOnly.vue';
export default {
props:['isSingleUser','selectUserids','isSelectByDept'],
computed: {
@ -62,36 +41,13 @@
])
},
watch:{
'selectUserids':function(selectUserids){
if((selectUserids==null || selectUserids.length==0 ) && this.sels.length==0){
return;
}else if((selectUserids==null || selectUserids.length==0 ) && this.sels.length>0){
this.$refs.userTable.clearSelection();
return;
}
var needSearch=false;
if(selectUserids.length!=this.sels.length){
needSearch=true
}else{
var selecteds=selectUserids.filter(i=> this.sels.some(k=>k.userid==i) );
if(selecteds.length!=selectUserids.length){
needSearch=true
}
}
if(needSearch==true){
this.$refs.userTable.clearSelection();
this.needSetTableUserChecked=true;
this.searchUsers()
}
}
},
data() {
return {
filters: {
key: '',
isQueryByDept: true
},
sels:[],
users: [],//
pageInfo:{//
total:0,//0>0
@ -101,172 +57,40 @@
orderDirs:[]// asc,desc ['asc','desc']
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
allSels:[],//
options:{sex:[],locked:[]},// options.sex,options.project
addFormVisible: false,//user
//user
addForm: {
unionid:'',displayUserid:'',userid:'',locked:'',startdate:'',nickname:'',username:'',phoneno:'',password:'',salt:'',fingerpassword1:'',fingerpassword2:'',fingerpassword3:'',fingerpassword4:'',pwdtype:'',headimgurl:'',country:'',city:'',province:'',address:'',sex:'',enddate:'',districtId:'',userId:'',userAccount:'',userPwd:'',userName:'',userDesc:''
},
editFormVisible: false,//
//user
editForm: {
unionid:'',displayUserid:'',userid:'',locked:'',startdate:'',nickname:'',username:'',phoneno:'',password:'',salt:'',fingerpassword1:'',fingerpassword2:'',fingerpassword3:'',fingerpassword4:'',pwdtype:'',headimgurl:'',country:'',city:'',province:'',address:'',sex:'',enddate:'',districtId:'',userId:'',userAccount:'',userPwd:'',userName:'',userDesc:''
},
/**begin 自定义属性请在下面加 请加备注**/
deptTree:{//
deptNodeSelected:{},//
},
editUserRoleFormVisible:false,//
editUserDeptFormVisible:false,//
branch: {},//
needSetTableUserChecked:false,
/**end 自定义属性请在上面加 请加备注**/
//
currentSelectDeptData: {},
activeTabPane:'1',
maxTableHeight:500,
}
},//end data
methods: {
// getCodeName(options.sex,'1');
getCodeName(options,codeValue){
if(!options)return codeValue;
let code=options.filter(i=>i.codeValue==codeValue);
if(code.length>0){
return code[0].codeName
}else{
return codeValue
}
},
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.pageInfo.count=true;
this.getUsers();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getUsers();
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange( obj ){
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
}else{
dir='desc';
}
if(obj.prop=='xxx'){
this.pageInfo.orderFields=['xxx'];
this.pageInfo.orderDirs=[dir];
}
this.getUsers();
},
searchUsers(){
//
if(this.isSelectByDept && Object.keys(this.deptTree.deptNodeSelected).length === 0) {
this.$notify({position:'bottom-left',showClose:true,message: "必须先选择一个部门", type: 'error' });
return;
}
this.pageInfo.count=true;
this.getUsers();
},
// User sys_user
getUsers() {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,count:this.pageInfo.count
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
params.orderBy= orderBys.join(",")
}
if(this.filters.key!==""){
params.key="%"+this.filters.key+"%";
}
if(this.filters.isQueryByDept==true && this.deptTree.deptNodeSelected.deptid && this.deptTree.deptNodeSelected.isBranch!=true){
params.deptid=this.deptTree.deptNodeSelected.deptid;
}
if(this.filters.isQueryByDept==true){
params.branchId=this.branch.id;
}
if( !this.userInfo.isSuperAdmin && !this.userInfo.isPlatformAdmin){
params.branchId=this.userInfo.branchId;
if(params.deptid==null || params.deptid==""){
//params.deptid=this.userInfo.deptid;
}
}
if(this.needSetTableUserChecked==true){
params.userids=this.selectUserids;
}
console.log("kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk")
console.log(params)
this.load.list = true;
listUser(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;this.pageInfo.count=false;
this.users = res.data.data;
}else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
}
if(this.needSetTableUserChecked==true){
this.setTableUserChecked();
this.needSetTableUserChecked=false;
}
this.load.list = false;
}).catch(() => {
this.load.list = false;
//this.$notify({position:'bottom-left',showClose:true,message: '', type: 'error' });
});
},
// User sys_user
showEdit: function (index, row) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
// User sys_user
showAdd: function () {
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
afterAddSubmit(){
this.addFormVisible=false;
this.pageInfo.count=true;
this.getUsers();
},
afterEditSubmit(){
this.editFormVisible=false;
},
//user
selsChange: function (sels) {
this.sels=sels
},
setTableUserChecked(){
if(this.selectUserids.length<=0){
return;
}
this.selectUserids.forEach(u=>{
var selected=this.sels.find(i=>i.userid==u);
var user=this.users.find(i=>i.userid==u);
if(selected){
}else if(user){
this.$refs.userTable.toggleRowSelection(user,true);
rowClick: function(row, event, column){
this.$refs.userTable.toggleRowSelection(row);
},
unselectUser:function(user){
this.$refs.userTable.toggleRowSelection(user,false);
},
onConfirmUsers(users){
var notHad=false;
users.forEach(u=>{
if(!this.users.some(k=>k.userid==u.userid)){
notHad=true;
this.users.unshift(u)
}
})
if(notHad){
var us=JSON.stringify(this.users)
localStorage.setItem("mdp-his-users",us)
}
this.$emit('confirm',users);
},
confirmUsers: function(){
if(this.sels.length<1){
@ -279,65 +103,59 @@
return;
}
}
// console.log(this.deptTree.deptNodeSelected)
// deptid
let returnData = this.sels.map(i=>{return {'userid':i.userid,'username':i.username,'sex':i.sex,'headimgurl':i.headimgurl,'email':i.email}});
if(this.isSelectByDept) returnData.deptData = this.currentSelectDeptData;
this.$emit('confirm',returnData);
},
branchRowClick: function(row, event, column){
if(this.branch==null || row.id!=this.branch.id){
this.branch=row
this.deptTree.deptNodeSelected={}
this.searchUsers();
}
this.$emit('confirm',this.sels);
},
unselectUser:function(user){
this.$refs.userTable.toggleRowSelection(user,false);
},
/**begin 自定义函数请在下面加**/
handleLeftDeptNodeClick(data, node,comp) {
if( node.level==1 ){
this.branch={id:data.branchId,branchName:data.deptName}
}
this.deptTree.deptNodeSelected=data;
//
this.currentSelectDeptData = data;
if(this.filters.isQueryByDept==true){
this.searchUsers();
}
},
/**end 自定义函数请在上面加**/
},//end methods
components: {
'dept-tree': DeptTree,
UsersSelectOnly,
//
},
mounted() {
if(this.selectUserids && this.selectUserids.length>0){
this.needSetTableUserChecked=true;
var us=localStorage.getItem("mdp-his-users")
this.users=us?JSON.parse(us):[]
if(this.users.length==0){
this.activeTabPane="2"
}else{
if(this.users.length>20){
this.users.splice(10)
}
this.branch={id:this.userInfo.branchId,branchName:this.userInfo.branchName}
/**在下面写其它函数***/
if(this.isSelectByDept) {
return;
}
this.getUsers();
this.$nextTick(()=>{
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.userTable.$el)-20
})
}
}
</script>
<style scoped>
<style lang="scss" scoped>
.selected-tag {
margin-top: 14px;
margin-left:14px;
}
.avatar-container {
height: 50px;
display: flex;
align-items: center;
.avatar-wrapper {
cursor: pointer;
display: flex;
flex-direction: row;
align-items: center;
.user-avatar {
height: 34px;
width: 34px;
border-radius: 50%;
margin-right: 12px;
}
.username{
color: #7D7D7D;
font-size: 14px;
}
.el-icon-caret-bottom {
font-size: 22px;
}
}
}
</style>

94
src/views/mdp/sys/userDept/UserDeptEdit.vue

@ -1,32 +1,51 @@
<template>
<section>
<el-row>
<section class="border padding">
<el-row :gutter="20">
<!--编辑界面 UserDept 用户部门关系表-->
<el-col :span="6" style=" overflow-x:auto; height:550px;">
<dept-tree v-loading="load.list" :branch-id="branch.id" :checked-keys="defaultChecked" default-expand-all show-checkbox multiple :expand-on-click-node="false" ref="nodeTree" @check-change="deptTreeCheckChange" @branch-row-click="branchChange"></dept-tree>
</el-col>
<el-col :span="18">
<el-form :model="editForm" label-width="160px" label-position="left" v-loading="load.list" :rules="editFormRules" ref="editForm">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span><font style="color:blue;">{{user.username}}</font> - 加入的部门及拥有的岗位如下 </span>
<h3>{{user.username}}加入的部门及拥有的岗位如下
<el-tooltip class="item" effect="dark" content="如果选中的部门没有岗位,请先到【部门管理 -> 岗位设置 】将岗位与部门关联" placement="top">
<i class="el-icon-question"></i>
</el-tooltip>
</h3>
<el-row class="padding-top">
<el-card class="box-card" v-for="(item,index) in allDeptDeptPosts" :key="index" :body-style="{background: 'rgba(244, 245, 248, 1)'}">
<div slot="header" class="card-header">
<span>部门 {{item.deptName}} </span>
</div>
<el-form-item v-for="item in allDeptDeptPosts" :label=" item.deptName " style="border-bottom:1px dashed #00F;margin-left:10px;" prop="deptid" :key="item.deptid">
<el-checkbox v-for="deptPost in item.deptPosts" v-model="deptPost.checked" :true-label="'1'" :false-label="'0'" :key="deptPost.postId" :disabled="deptPost.disabled">{{deptPost.postName}}</el-checkbox>
</el-form-item>
<el-row :gutter="50">
<el-col :span="10">
<span v-if=" !item.deptPosts || item.deptPosts.filter(i=>i.checked==='1').length<=0">
请选择岗位
</span>
<span v-else>
<el-checkbox v-for="deptPost in item.deptPosts.filter(i=>i.checked==='1')" v-model="deptPost.checked" :true-label="'1'" :false-label="'0'" :key="deptPost.postId" :disabled="deptPost.disabled">{{deptPost.postName}}</el-checkbox>
</span>
</el-col>
<el-col :span="14" class="" v-if="item.deptPosts && item.deptPosts.filter(i=>i.checked!=='1').length>0">
<div class="bg-right border padding">
<el-checkbox v-for="deptPost in item.deptPosts.filter(i=>i.checked!=='1')" v-model="deptPost.checked" :true-label="'1'" :false-label="'0'" :key="deptPost.postId" :disabled="deptPost.disabled">{{deptPost.postName}}</el-checkbox>
</div>
</el-col>
<span v-if="!item.deptPosts || item.deptPosts.length<=0">
该部门还没有设立岗位
</span>
</el-row>
</el-card>
<h5></h5>
</el-row>
<el-form-item>
<el-col :span="4" :offset="8">
<el-row class="padding">
<el-col :span="4" :offset="6">
<el-button @click.native="handleCancel">取消</el-button>
</el-col>
<el-col :span="4">
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit">提交</el-button>
</el-col>
</el-row>
</el-form-item>
</el-form>
</el-col>
@ -48,7 +67,7 @@
computed: {
...mapGetters([
'workShop'
'userInfo'
]),
noQxDeptids(){
return [];
@ -62,7 +81,8 @@
'visible':function(visible) {
if(visible==true){
this.allDeptDeptPosts=[]
this.userDeptids=[];
this.userDepts=[];
this.treeCheckDeptids=[];
if(this.$refs.nodeTree.branch!=null){
this.getUserDepts(this.$refs.nodeTree.branch);
}else{
@ -71,6 +91,12 @@
//this.load.list=false;
}
},
treeCheckDeptids(val){
if(val==null || val.length==0){
return;
}
this.getDeptPostUserWithDeptPosts(val)
}
},
data() {
@ -88,9 +114,8 @@
},
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
userDepts:[],
treeCheckDeptids:[],
allDeptDeptPosts: [],//[{deptid:'',deptName:'',deptPosts:[{deptid:'',postId:'',postName:'',checked:''}]}]
deptTreeDatas:[],//
checkedDeptTreeNode:[],//
/**end 在上面加自定义属性**/
}//end return
@ -108,7 +133,7 @@
//UserDept @submit="afterEditSubmit"
editSubmit: function () {
if(this.user.userid==''){
this.$message.error('用户不能为空');
this.$notify.error('用户不能为空');
return;
}
this.load.edit=true
@ -116,7 +141,7 @@
this.$confirm(msg, '提示', {}).then(() => {
console.log("xxxxxxxxxxxxxx");
let delDeptids=[];
let deptids=this.$refs.nodeTree.$refs.deptTree.getCheckedKeys();
let deptids=this.treeCheckDeptids;
this.userDepts.forEach(ud=>{
if(!this.noQxDeptids.some(d=>d==ud.deptid)){
if(!deptids.some(deptid=>deptid==ud.deptid)){
@ -147,7 +172,7 @@
this.$refs['editForm'].resetFields();
this.$emit('submit');// @submit="afterEditSubmit"
}
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' });
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch((e) => {
console.log(e)
this.load.edit=false
@ -167,18 +192,19 @@
this.load.list=false
let uds=res.data.data
this.userDepts=uds;
let userDeptids=uds.map(i=>i.deptid);
this.getDeptPostUserWithDeptPosts(userDeptids);
this.treeCheckDeptids=this.userDepts.map(i=>i.deptid)
}).catch(()=>this.load.list=false);
},
deptTreeCheckChange: function(data,checked,indeterminate){
console.log(data)
let deptids=this.$refs.nodeTree.$refs.deptTree.getCheckedKeys();
this.deptTreeDatas=this.$refs.nodeTree.depts;
this.checkedDeptTreeNode=this.$refs.nodeTree.$refs.deptTree.getCheckedNodes(false)
console.log("deptNodes"+this.deptNodes);
this.getDeptPostUserWithDeptPosts(deptids);
if(checked==false){
this.treeCheckDeptids=this.treeCheckDeptids.filter(i=>i!=data.deptid)
}else{
if(!this.treeCheckDeptids.some(i=>i==data.deptid)){
this.treeCheckDeptids.push(data.deptid)
}
}
},
getDeptPostUserWithDeptPosts: function(deptids){
this.load.list=true
@ -188,7 +214,13 @@
this.load.list=false
let allDeptDeptPosts=[];
let deptPosts=res.data.deptPosts
if(!deptPosts){
deptPosts=[]
}
let deptPostUsers=res.data.deptPostUsers
if(!deptPostUsers){
deptPostUsers=[]
}
deptPosts.forEach(i=>{
i.id='';
i.checked='0'
@ -239,5 +271,13 @@
</script>
<style scoped>
.bg-right{
background: rgba(255, 255, 255, 1);
}
.card-body{
background: rgba(244, 245, 248, 1);
}
.card-header{
background: rgba(242, 242, 242, 0)
}
</style>

8
src/views/mdp/workflow/hi/procinst/ProcinstMng.vue

@ -714,7 +714,7 @@
if (this.isBatchSetProcTags == true) {
//TOD
if (!tags || tags.length == 0) {
this.$message.error("最少选中一个标签");
this.$notify.error("最少选中一个标签");
this.isBatchSetProcTags = false;
return;
}
@ -746,9 +746,9 @@
row.tagIds = tagIds;
row.tagNames = tagNames;
});
this.$message.success("打标签成功");
this.$notify.success("打标签成功");
} else {
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
.catch(e => (this.isBatchSetProcTags = false));
@ -773,7 +773,7 @@
showTagSelect: function(isBatchSetProcTags) {
if (isBatchSetProcTags == true) {
if (this.sels.length == 0) {
this.$message.error("请选中流程任务");
this.$notify.error("请选中流程任务");
return false;
}
this.tagSelectVisible = true;

8
src/views/mdp/workflow/re/procdef/ProcdefListForParames.vue

@ -278,7 +278,7 @@ export default {
if (this.isBatchSetProcTags == true) {
//TOD
if (!tags || tags.length == 0) {
this.$message.error("最少选中一个标签");
this.$notify.error("最少选中一个标签");
this.isBatchSetProcTags = false;
return;
}
@ -306,9 +306,9 @@ export default {
row.tagIds = tagIds;
row.tagNames = tagNames;
});
this.$message.success("打标签成功");
this.$notify.success("打标签成功");
} else {
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
.catch(e => (this.isBatchSetProcTags = false));
@ -333,7 +333,7 @@ export default {
showTagSelect: function(isBatchSetProcTags) {
if (isBatchSetProcTags == true) {
if (this.sels.length == 0) {
this.$message.error("请选中流程任务");
this.$notify.error("请选中流程任务");
return false;
}
this.tagSelectVisible = true;

2
src/views/mdp/workflow/re/procdef/ProcdefListForSimpleStart.vue

@ -271,7 +271,7 @@
this.flowStartVisible = true;
} else if (res.data.data.length > 1) {
this.flowStartVisible = false;
this.$message.success("请选中一个流程")
this.$notify.success("请选中一个流程")
}
} else {

8
src/views/mdp/workflow/re/procdef/ProcdefListForStart.vue

@ -260,7 +260,7 @@
if (this.isBatchSetProcTags == true) {
//TOD
if (!tags || tags.length == 0) {
this.$message.error("最少选中一个标签");
this.$notify.error("最少选中一个标签");
this.isBatchSetProcTags = false;
return;
}
@ -292,9 +292,9 @@
row.tagIds = tagIds;
row.tagNames = tagNames;
});
this.$message.success("打标签成功");
this.$notify.success("打标签成功");
} else {
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
.catch(e => (this.isBatchSetProcTags = false));
@ -319,7 +319,7 @@
showTagSelect: function(isBatchSetProcTags) {
if (isBatchSetProcTags == true) {
if (this.sels.length == 0) {
this.$message.error("请选中流程任务");
this.$notify.error("请选中流程任务");
return false;
}
this.tagSelectVisible = true;

8
src/views/mdp/workflow/re/procdef/ProcdefMng.vue

@ -178,7 +178,7 @@
if(this.isBatchSetProcTags==true){
//TOD
if(!tags || tags.length==0){
this.$message.error("最少选中一个标签");
this.$notify.error("最少选中一个标签");
this.isBatchSetProcTags=false;
return;
}
@ -205,9 +205,9 @@
row.tagIds=tagIds
row.tagNames=tagNames
})
this.$message.success("打标签成功");
this.$notify.success("打标签成功");
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(e=>this.isBatchSetProcTags=false);
}else{
@ -232,7 +232,7 @@
showTagSelect:function(isBatchSetProcTags){
if(isBatchSetProcTags==true){
if(this.sels.length==0){
this.$message.error("请选中流程任务");
this.$notify.error("请选中流程任务");
return false;
}
this.tagSelectVisible=true;

8
src/views/mdp/workflow/re/procdef/ProcdefSuspend.vue

@ -254,7 +254,7 @@ export default {
if (this.isBatchSetProcTags == true) {
//TOD
if (!tags || tags.length == 0) {
this.$message.error("最少选中一个标签");
this.$notify.error("最少选中一个标签");
this.isBatchSetProcTags = false;
return;
}
@ -283,9 +283,9 @@ export default {
row.tagIds = tagIds;
row.tagNames = tagNames;
});
this.$message.success("打标签成功");
this.$notify.success("打标签成功");
} else {
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
.catch(e => (this.isBatchSetProcTags = false));
@ -310,7 +310,7 @@ export default {
showTagSelect: function(isBatchSetProcTags) {
if (isBatchSetProcTags == true) {
if (this.sels.length == 0) {
this.$message.error("请选中流程任务");
this.$notify.error("请选中流程任务");
return false;
}
this.tagSelectVisible = true;

6
src/views/mdp/workflow/re/procdefParames/ProcdefParamesSet.vue

@ -556,7 +556,7 @@
return tips.join(",");
},
showDiagram(){
this.diagramUrl=config.getBaseDomainUrl()+config.getWorkflowBasePath()+"/mdp/workflow/re/procdef/diagram/"+this.procdef.id;
this.diagramUrl=config.getBaseDomainUrl()+"/"+process.env.VERSION+config.getWorkflowBasePath()+"/mdp/workflow/re/procdef/diagram/"+this.procdef.id;
this.displayDiagram=true;
},
getFormDefs() {
@ -679,7 +679,7 @@
this.addForm.formId=template.formId
this.templateVisible=false;
}else{
this.$message.error("请选一个模板进行导入");
this.$notify.error("请选一个模板进行导入");
}
},
onFormDefForFlowNodeSubmit:function(formDefAndFields){
@ -696,7 +696,7 @@
},
setAssigneeAsStartUser(nodeInfo){
if(nodeInfo.allowOverUser=='0'){
this.$message.error("该节点不允许改变执行人")
this.$notify.error("该节点不允许改变执行人")
return ;
}
this.actSelected=nodeInfo

8
src/views/mdp/workflow/ru/execution/ExecutionMng.vue

@ -768,7 +768,7 @@
if (this.isBatchSetProcTags == true) {
//TOD
if (!tags || tags.length == 0) {
this.$message.error("最少选中一个标签");
this.$notify.error("最少选中一个标签");
this.isBatchSetProcTags = false;
return;
}
@ -800,9 +800,9 @@
row.tagIds = tagIds
row.tagNames = tagNames
})
this.$message.success("打标签成功");
this.$notify.success("打标签成功");
} else {
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(e => this.isBatchSetProcTags = false);
} else {
@ -827,7 +827,7 @@
showTagSelect: function(isBatchSetProcTags) {
if (isBatchSetProcTags == true) {
if (this.sels.length == 0) {
this.$message.error("请选中流程任务");
this.$notify.error("请选中流程任务");
return false;
}
this.tagSelectVisible = true;

8
src/views/mdp/workflow/ru/execution/ExecutionMngForFormData.vue

@ -393,7 +393,7 @@
if(this.isBatchSetProcTags==true){
//TOD
if(!tags || tags.length==0){
this.$message.error("最少选中一个标签");
this.$notify.error("最少选中一个标签");
this.isBatchSetProcTags=false;
return;
}
@ -420,9 +420,9 @@
row.tagIds=tagIds
row.tagNames=tagNames
})
this.$message.success("打标签成功");
this.$notify.success("打标签成功");
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(e=>this.isBatchSetProcTags=false);
}else{
@ -438,7 +438,7 @@
showTagSelect:function(isBatchSetProcTags){
if(isBatchSetProcTags==true){
if(this.sels.length==0){
this.$message.error("请选中流程任务");
this.$notify.error("请选中流程任务");
return false;
}
this.tagSelectVisible=true;

6
src/views/mdp/workflow/ru/procinstParames/ProcinstNodeInfoSet.vue

@ -148,7 +148,7 @@
showUserSelectDialog:function(nodeInfoSeleced,index){
if(nodeInfoSeleced.allowOverUser=='0'){
this.$message.error("当前节点不允许变更执行人")
this.$notify.error("当前节点不允许变更执行人")
return;
}
this.userSelectVisible=true;
@ -156,7 +156,7 @@
},
showCandidateSelectDialog:function(nodeInfoSeleced,index){
if(nodeInfoSeleced.allowOverUser=='0'){
this.$message.error("当前节点不允许变更执行人")
this.$notify.error("当前节点不允许变更执行人")
return;
}
this.candidateSelectVisible=true;
@ -239,7 +239,7 @@
},
setAssigneeAsStartUser(nodeInfoSeleced){
if(nodeInfoSeleced.allowOverUser=='0'){
this.$message.error("当前节点不允许变更执行人")
this.$notify.error("当前节点不允许变更执行人")
return;
}
this.nodeInfoSeleced=nodeInfoSeleced

22
src/views/mdp/workflow/ru/procinstParames/ProcinstParamesExecutionSet.vue

@ -467,7 +467,7 @@
if(this.taskInfo.planFinishTime!=value){
if(!this.sponsors.some(i=>i.userid==this.userInfo.userid)){
//this.addForm.planFinishTime=this.taskInfo.planFinishTime
//this.$message.error("");
//this.$notify.error("");
// return;
}
}
@ -826,7 +826,7 @@
},
showDiagram(){
this.diagramUrl=config.getBaseDomainUrl()+config.getWorkflowBasePath()+'/mdp/workflow/ru/diagram/'+this.procDefId+'/'+this.procInstId
this.diagramUrl=config.getBaseDomainUrl()+"/"+process.env.VERSION+config.getWorkflowBasePath()+'/mdp/workflow/ru/diagram/'+this.procDefId+'/'+this.procInstId
this.displayDiagram=true;
},
initBaseUserList(sponsorsAndMonitorsVisible){
@ -901,7 +901,7 @@
this.tagSelectVisible=false;
//TOD
if(!tags || tags.length==0){
this.$message.error("最少选中一个标签");
this.$notify.error("最少选中一个标签");
return;
}
this.tagSetLoading=true;
@ -922,9 +922,9 @@
var tagNames=tags.map(i=>i.tagName).join(",");
this.addForm.tagIds=tags.map(t=>t.tagId).join(",");
this.addForm.tagNames=tags.map(t=>t.tagName).join(",");
this.$message.success("打标签成功");
this.$notify.success("打标签成功");
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(e=>this.tagSetLoading=false);
@ -949,7 +949,7 @@
if(res.data.tips.isOk){
this.fileList.push(res.data.data);
}else{
this.$message.warning(res.data.tips.msg);
this.$notify.warning(res.data.tips.msg);
return false;
}
});
@ -979,9 +979,9 @@
}
addWorkflowArchive(archive).then(res=>{
if(res.data.tips.isOk){
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
});
});
@ -1023,7 +1023,7 @@
},
updateFlowPlanFinishTime:function(){
if(this.addForm.planFinishTime==null || this.addForm.planFinishTime==''){
this.$message.error("计划完成时间不能为空");
this.$notify.error("计划完成时间不能为空");
returnn;
}
this.addLoading=true;
@ -1041,9 +1041,9 @@
this.addLoading=false
if(res.data.tips.isOk){
this.refreshCommentList=true;
this.$message.success("更新成功");
this.$notify.success("更新成功");
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
},

6
src/views/mdp/workflow/ru/procinstParames/ProcinstParamesStartSet.vue

@ -502,19 +502,19 @@
},
showDiagram(){
this.diagramUrl=config.getBaseDomainUrl()+config.getWorkflowBasePath()+"/mdp/workflow/re/procdef/diagram/"+this.procdef.id;
this.diagramUrl=config.getBaseDomainUrl()+"/"+process.env.VERSION+config.getWorkflowBasePath()+"/mdp/workflow/re/procdef/diagram/"+this.procdef.id;
this.displayDiagram=true;
},
startHandle(){
var date=new Date();
if(!this.monitors || this.monitors.length==0){
this.$message.error("监控人不能为空");
this.$notify.error("监控人不能为空");
return;
}
if(!this.sponsors || this.sponsors.length==0){
this.$message.error("主办人不能为空");
this.$notify.error("主办人不能为空");
return;
}
this.formDataSubmitEvent=date.getTime();

8
src/views/mdp/workflow/ru/task/TaskMng.vue

@ -580,7 +580,7 @@
if (this.isBatchSetProcTags == true) {
// TOD
if (!tags || tags.length == 0) {
this.$message.error("最少选中一个标签");
this.$notify.error("最少选中一个标签");
this.isBatchSetProcTags = false;
return;
}
@ -612,9 +612,9 @@
row.tagIds = tagIds;
row.tagNames = tagNames;
});
this.$message.success("打标签成功");
this.$notify.success("打标签成功");
} else {
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
})
.catch(e => (this.isBatchSetProcTags = false));
@ -639,7 +639,7 @@
showTagSelect: function(isBatchSetProcTags) {
if (isBatchSetProcTags == true) {
if (this.sels.length == 0) {
this.$message.error("请选中流程任务");
this.$notify.error("请选中流程任务");
return false;
}
this.tagSelectVisible = true;

24
src/views/mdp/workflow/ru/task/candidate/TaskCandidateSet.vue

@ -198,10 +198,10 @@
this.addUsersLoading=false;
if(res.data.tips.isOk){
this.getCandidateUsersData();
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(e=>{
this.addUsersLoading=false;
@ -223,10 +223,10 @@
this.addPostsLoading=false;
if(res.data.tips.isOk){
this.getCandidatePostsData();
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(e=>{
this.addPostsLoading=false;
@ -250,10 +250,10 @@
this.addDeptsLoading=false;
if(res.data.tips.isOk){
this.getCandidateDeptsData();
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(e=>{
this.addDeptsLoading=false;
@ -272,9 +272,9 @@
delCandidate(params).then(res=>{
if(res.data.tips.isOk){
this.getCandidateUsersData();
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
});
this.selectCandidateUsersVisible=false;
@ -291,9 +291,9 @@
delCandidate(params).then(res=>{
if(res.data.tips.isOk){
this.getCandidatePostsData();
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
});
this.selectCandidatePostsVisible=false;
@ -310,9 +310,9 @@
delCandidate(params).then(res=>{
if(res.data.tips.isOk){
this.getCandidateDeptsData();
this.$message.success(res.data.tips.msg);
this.$notify.success(res.data.tips.msg);
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
});

1
src/views/myWork/message/index.scss

@ -29,7 +29,6 @@
.message_content {
margin-top: 20px;
background: #fff;
height: calc(100vh - 172px);
overflow: auto;
cursor: pointer;
padding: 20px;

61
src/views/myWork/message/index.vue

@ -2,24 +2,50 @@
<div class="m_container">
<div class="m_content">
<div class="message_card">
<span :class="{'message_type_active' : currentType == 1}" class="message_type" @click="currentType = 1">全部消息</span>
<span :class="{'message_type_active' : currentType == 2}" class="message_type " @click="currentType = 2">审批消息</span>
<span :class="{'message_type_active' : currentType == 1}" class="message_type" @click="currentType = 1">聊天消息</span>
<span :class="{'message_type_active' : currentType == 2}" class="message_type" @click="currentType = 2">客服消息</span>
<span :class="{'message_type_active' : currentType == 3}" class="message_type " @click="currentType = 3">审批流消息</span>
<span :class="{'message_type_active' : currentType == 4}" class="message_type " @click="currentType = 4">任务消息</span>
<span :class="{'message_type_active' : currentType == 5}" class="message_type " @click="currentType = 5">内部公告</span>
<span :class="{'message_type_active' : currentType == 6}" class="message_type " @click="currentType = 6">平台公告</span>
</div>
<div class="message_content">
<div class="message_content_box" v-for="(item, index) in messageData" :key="index">
<p class="title">{{item.type}}</p>
<p class="date">{{item.time}}</p>
<span class="text">{{item.text}}</span>
<div class="line"></div>
<div class="message_content" v-if="currentType == 1">
<prichat-im :msg-class="'0'" :key="0"></prichat-im>
</div>
<div class="message_content" v-if="currentType == 2">
<group-im :msg-class="'CSS'" key="css"></group-im>
</div>
<div class="message_content" v-if="currentType == 3">
<prichat-im :msg-class="'4'" :key="4"></prichat-im>
</div>
<div class="message_content" v-if="currentType == 4">
<prichat-im :msg-class="'5'" :key="5"></prichat-im>
</div>
<div class="message_content" v-if="currentType == 5">
<archive :archiveType="'2'" :key="2"></archive>
</div>
<div class="message_content" v-if="currentType == 6">
<archive :archiveType="'3'" :key="3"></archive>
</div>
</div>
</div>
</template>
<script>
import {listArchive} from '@/api/mdp/arc/archive'
import archive from "./archive"
import prichatIm from "./prichatIm"
import groupIm from "./groupIm"
export default {
components:{
archive,prichatIm,groupIm
},
data() {
return {
currentType: 1,
@ -57,16 +83,25 @@ export default {
],
arcArchives:[],
}
},
methods() {
methods:{
searcArchives(){
var params={archiveType:'3'}
listArchive({}).then(res=>{
this.arcArchives=res.data.data;
})
},
goToArchive(item){
var curlDomain=window.location.protocol+"//"+window.location.host; // https://mp.csdn.net
window.open(curlDomain+"/api/"+process.env.VERSION+"/arc/arc/archive/showArchive?id="+item.id)
}
},
mounted: {
mounted() {
this.searcArchives();
}
}

2
src/views/myWork/my/components/moduleSet.vue

@ -156,7 +156,7 @@ export default {
})
this.$store.dispatch('saveUserFavoriteMenu', {data: saveModules, userid: this.userInfo.displayUserid}).then(() => {
this.visible = false
this.$message.success("设置成功");
this.$notify.success("设置成功");
})
}

32
src/views/myWork/my/index.vue

@ -2,12 +2,13 @@
<div class="m_container">
<div class="m_content">
<div class="m_top">
<el-avatar class="m_avatar" :src="userInfo.headimgurl"></el-avatar>
<el-avatar class="m_avatar" :src="userInfo.headimgurl">
<img src="../../../assets/image/user_img.gif"/>
</el-avatar>
<div class="m_msg">
<p>{{getDate}}</p>
<p>{{getTimeStatus}}{{userInfo.username}}今天也要元气满满哦</p>
</div>
<el-button class="m_btn" type="primary" @click="moduleSetVisible = true">模块编辑</el-button>
</div>
<div class="m_middle">
@ -21,39 +22,39 @@
</div>
</div>
<div class="m_right">
<div class="m_right_menu" @click="gotolink('/xm/core/xmProduct/XmProductMng')">
<div class="m_right_menu" @click="gotolink('xm','xm/core/xmProduct/XmProductMng')">
<img src="../img/cp.png" alt="">
<span>产品管理</span>
</div>
<div class="m_right_menu" @click="gotolink('/xm/core/xmMenu/XmMenuMng')">
<div class="m_right_menu" @click="gotolink('xm','xm/core/xmMenu/XmMenuMng')">
<img src="../img/xqgl.png" alt="">
<span>需求管理</span>
</div>
<div class="m_right_menu" @click="gotolink('/xm/core/xmProject/XmProjectAllMng')">
<div class="m_right_menu" @click="gotolink('xm','xm/core/xmProject/XmProjectAllMng')">
<img src="../img/xmgl.png" alt="">
<span>项目管理</span>
</div>
<div class="m_right_menu" @click="gotolink('/xm/core/xmGroup/XmGroupAllMng')">
<div class="m_right_menu" @click="gotolink('xm','xm/core/xmGroup/XmGroupAllMng')">
<img src="../img/tdgl.png" alt="">
<span>团队管理</span>
</div>
<div class="m_right_menu" @click="gotolink('/xm/core/xmTask/XmTaskCenter')">
<div class="m_right_menu" @click="gotolink('xm','xm/core/xmTask/XmTaskCenter')">
<img src="../img/kfrw.png" alt="">
<span>开发任务</span>
</div>
<div class="m_right_menu" @click="gotolink('/xm/core/xmQuestion/XmQuestionMng')">
<div class="m_right_menu" @click="gotolink('xm','xm/core/xmQuestion/XmQuestionMng')">
<img src="../img/qx.png" alt="">
<span>缺陷管理</span>
</div>
</div>
</div>
<box-card />
</div>
<module-set v-model="moduleSetVisible" />
</div>
</template>
<script>
import NProgress from 'nprogress' // progress bar
import moduleSet from './components/moduleSet'
import boxCard from './components/boxCard'
import { mapGetters } from 'vuex'
@ -91,8 +92,15 @@ export default {
methods: {
gotolink(url) {
this.$router.replace(url);
gotolink(context,path) {
if(context==process.env.CONTEXT){
this.$router.replace(path);
}else{
var prefixUrl=window.location.protocol+"//"+window.location.host+"/"+context+"/"+process.env.VERSION+"/#/"; // https://mp.csdn.net
window.open(prefixUrl+path)
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
}
},
},

6
src/views/myWork/set/ChangeEmailStepOne.vue

@ -128,9 +128,9 @@
sendEmail({codeScene:'3',codeEmail:this.editForm.email,userType:'staff',callbackUri:curlDomain+'/#/changeEmailStepTwo'}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.$message({ message: "邮件已发送,请到收件箱收取邮件,并点击其链接进行验证新邮箱。", type: 'success' });
this.$notify({ message: "邮件已发送,请到收件箱收取邮件,并点击其链接进行验证新邮箱。", type: 'success' });
}else{
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' });
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}
})
}
@ -138,7 +138,7 @@
validEmailCode(){
validEmailCode({valiCode:this.valiCode,userType:'staff'}).then(res=>{
var tips = res.data.tips;
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' });
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
})
},
doLogin(){

2
src/views/myWork/set/ChangeEmailStepTwo.vue

@ -84,7 +84,7 @@
validEmailCode(){
validEmailCode({valiCode:this.valiCode,userType:'staff'}).then(res=>{
var tips = res.data.tips;
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' });
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
})
},
doLogin(){

47
src/views/myWork/set/index.vue

@ -2,7 +2,8 @@
<div class="set_container">
<div class="set_content">
<div class="m_msgcard">
<el-avatar class="m_avater" :src="editForm.headimgurl || defaultImg">
<el-avatar class="m_avater" :src="editForm.headimgurl" @click.native="showUploadHeadimg">
<img src="../../../assets/image/user_img.gif"/>
</el-avatar>
<div class="m_msg">
<span class="m_name">{{userInfo.username}}
@ -10,12 +11,10 @@
<el-tag v-if="editForm.memType==='0'" type="primary">个人账户</el-tag>
<el-tag type="warning" v-else-if="editForm.memType=='1'">企业管理员账户</el-tag>
<el-tag type="warning" v-else-if="editForm.memType=='2'">企业员工账户</el-tag>
<el-button v-if="editForm.memType!=='0'" type="text">{{editForm.branchName}}</el-button>
<el-button v-if="editForm.memType==='0'" type="text" icon="el-icon-top" @click="upgradeToBranchAccount">升级为企业账户</el-button>
<el-button type="warning" @click="switchUser">切换账户</el-button>
</span>
<span class="m_dept">所属机构{{userInfo.branchName}}</span>
<span class="m_dept">所在部门{{userInfo.deptName}}</span>
<el-button @click="showUploadHeadimg" class="m_btn">修改头像</el-button>
</div>
</div>
<div class="m_opercard">
@ -56,7 +55,7 @@
<vue-qr
ref="qrcode"
:logoSrc="logoSrc"
:text="' https://www.qingqinkj.com/miniapp?page=bindMainAccount&userid='+editForm.userid"
:text=" currDomainUrl+'/miniapp?page=bindMainAccount&userid='+editForm.userid"
:size="200"
:loadMake="true"/>
<br>
@ -90,7 +89,7 @@
:img-width="100"
:img-height="100"
:show-title="true"
v-model="editForm.headimgurl"
v-model="headimgurl"
:branch-id="userInfo.branchId"
:deptid="userInfo.deptid"
:remark="userInfo.username"
@ -139,7 +138,8 @@
</template>
<script>
import { editUser,changePassword } from '@/api/mdp/sys/user';
import config from '../../../common/config';
import { editUser,changePassword,editHeadimgurl } from '@/api/mdp/sys/user';
import { mapGetters } from 'vuex'
import { sendEmail,validEmailCode,queryMyUsers,switchUser } from '@/api/login';
import SingleShearUpload from "@/components/Image/Single/Index";
@ -159,6 +159,17 @@ import md5 from "js-md5";
watch: {
'user':function(data) {
this.editForm=data;
},
'headimgurl':function(val){
editHeadimgurl({userid:this.userInfo.userid,headimgurl:val}).then(res=>{
var tips = res.data.tips
if(tips.isOk){
this.$notify({ message: "修改头像成功,重新登录起效", type: 'success'});
this.editForm.headimgurl=val
}else{
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}
})
}
},
data() {
@ -220,7 +231,6 @@ import md5 from "js-md5";
options:{},//
editLoading: false,
setLoading: false,
defaultImg: 'https://www.qingqinkj.com/api/m1/arc/arc/image/qqkj_001/IM1632611467940176/IM1633550409547158.png',
editFormRules: {
displayUserid: [
{ required: true, message: '账号必填', trigger: 'blur' }
@ -245,6 +255,8 @@ import md5 from "js-md5";
showPanel:'',//bindMainAccount
phonenoUsers:[],
phonenoUsersVisible:false,
headimgurl:'',
currDomainUrl:'',
}
},
methods: {
@ -288,7 +300,9 @@ import md5 from "js-md5";
}
})
},
registerPhoneno(){
},
showUploadHeadimg(){
this.$refs.uploadImg.showAdd();
},
@ -305,9 +319,9 @@ import md5 from "js-md5";
sendEmail({codeScene:'1',codeEmail:this.editForm.email,userType:'staff',callbackUri:curlDomain+'/#/updateUserInfo'}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.$message({ message: "邮件已发送,请到收件箱收取邮件,并点击其链接进行自动验证。", type: 'success' });
this.$notify({ message: "邮件已发送,请到收件箱收取邮件,并点击其链接进行自动验证。", type: 'success' });
}else{
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' });
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}
})
@ -320,9 +334,9 @@ import md5 from "js-md5";
sendEmail({codeScene:'2',codeEmail:this.editForm.email,userType:'staff',callbackUri:curlDomain+'/#/changeEmailStepOne'}).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.$message({ message: "邮件已发送,请到收件箱收取邮件,并点击其链接进行验证原邮箱。", type: 'success' });
this.$notify({ message: "邮件已发送,请到收件箱收取邮件,并点击其链接进行验证原邮箱。", type: 'success' });
}else{
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' });
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}
})
}
@ -330,7 +344,7 @@ import md5 from "js-md5";
validEmailCode(){
validEmailCode({valiCode:this.valiCode,userType:'staff'}).then(res=>{
var tips = res.data.tips;
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' });
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
})
},
switchUser(){
@ -338,12 +352,12 @@ import md5 from "js-md5";
if(res0.data.tips.isOk){
this.phonenoUsers=res0.data.data;
if(res0.data.data.length<=1){
this.$message.warning("当前没有关联的账户,无须切换");
this.$notify.warning("当前没有关联的账户,无须切换");
}else{
this.phonenoUsersVisible=true;
}
}else{
this.$message.error(res0.data.tips.msg);
this.$notify.error(res0.data.tips.msg);
}
})
},
@ -370,7 +384,7 @@ import md5 from "js-md5";
});
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch((e) => {
@ -389,6 +403,7 @@ import md5 from "js-md5";
mounted() {
this.editForm=Object.assign(this.editForm, this.userInfo);
var valiCode=this.$route.query.valiCode;
this.currDomainUrl=config.getBaseDomainUrl()
//var valiCode=util.getQueryStringByName('valiCode');
if(valiCode){
this.valiCode=valiCode;

42
src/views/order/createOrder.vue

@ -13,9 +13,9 @@
<div class="desc">
<el-descriptions size="larget" :column="3">
<el-descriptions-item label="购买版本">企业版 ( {{data.ousers}} )</el-descriptions-item>
<el-descriptions-item label="企业">{{data.order.obranchName?data.order.obranchName:data.order.obranchId}}</el-descriptions-item>
<el-descriptions-item label="企业">{{data.order && data.order.obranchName?data.order.obranchName: ''}}</el-descriptions-item>
<!-- <el-descriptions-item label="手机号码">18826103122</el-descriptions-item> -->
<el-descriptions-item label="支付方式">{{data.payway == 'aliPay' ? '支付宝' : '微信'}}</el-descriptions-item>
<el-descriptions-item label="支付方式">{{data.payType == '2' ? '支付宝' : '微信'}}</el-descriptions-item>
</el-descriptions>
</div>
<div class="table">
@ -41,9 +41,14 @@
label="产品名称" min-width="150"
>
</el-table-column>
<el-table-column
prop="ousers"
label="可用人数"
min-width="120">
</el-table-column>
<el-table-column
prop="musers"
label="账号数量"
label="计价人数"
min-width="120">
</el-table-column>
<el-table-column
@ -68,10 +73,10 @@
<div class="bottom">
<span class="allAmount">
总金额: <b>{{data.order.ofinalFee}}</b>
总金额: <b>{{data.order?data.order.ofinalFee:''}}</b>
</span>
<el-button size="larget" @click="returnPage">上一步</el-button>
<el-button size="larget" type="primary" :loading="createOrderLonding" @click="createOrder">确认支付</el-button>
<el-button size="larget" type="primary" :loading="load.add" @click="createOrder">确认支付</el-button>
</div>
</div>
</div>
@ -111,7 +116,7 @@ export default {
data() {
return {
data: {},
createOrderLonding: false,
load:{add:false,},
weixinPayVisible: false,
codeUrl: ""
}
@ -129,24 +134,28 @@ export default {
//
this.data.remark = "";
this.data.name = "模块开通订单"
this.createOrderLonding = true;
createOrder(this.data).then(res => {
this.load.add = true;
var params={...this.data}
params.order=null
params.modules=null
createOrder(params).then(res => {
if(res.data.tips.isOk){
//
let orderId = res.data.data.id;
if(this.data.payway == 'aliPay') {
if(this.data.payType == '2') {
this.toAliPay(orderId);
return;
}
if(this.data.payway == 'weixinPay') {
if(this.data.payType == '1') {
this.toWeixinPay(orderId);
return;
}
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(err => {
this.$message.error(err.msg);
this.$notify.error(err.msg);
}).finally(() => {
})
},
@ -164,11 +173,11 @@ export default {
document.body.appendChild(div);
document.forms[0].submit();
}else {
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).finally(() => {
setTimeout(() => {
this.createOrderLonding = false;
this.load.add = false;
}, 2000);
})
},
@ -187,11 +196,11 @@ export default {
this.queryOrderStatus(orderId)
}, 3000)
}else {
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).finally(() => {
setTimeout(() => {
this.createOrderLonding = false;
this.load.add = false;
}, 2000);
})
},
@ -243,7 +252,6 @@ export default {
border-bottom: 2px solid #F4F5F8;
}
.middle {
padding: 20px;
.desc {
display: flex;
flex-direction: row;

70
src/views/order/enterprise.vue

@ -17,14 +17,35 @@
</div>
<div class="sys_modules" v-if="this.modules != null">
<div class="module" v-for="(item, index) in modules[active]" :key="index" >
<div v-for="(item, index) in modules[active]" :key="index">
<div v-if="ooper==='2' && item.billMode!=='0' && item.isBuy" class="module">
<div class="head" :class="{active: item.isChecked == true}" @click="selectItem(item, index)">
<div class="module_top">
<img :src="item.logoUrl" alt="">
<span>{{item.name}}</span>
</div>
<div v-if="item.isChecked == true || item.billMode==='0'" :class="{module_bottom_active: item.isChecked == true|| item.billMode==='0'}" class="module_bottom">
<i class="selected el-icon-check"></i><span v-if="item.billMode==='0'">&nbsp;&nbsp;<font color="red">免费</font></span>
<div v-if="item.isBuy" class="module_bottom">
<i v-if="item.isChecked" class="selected el-icon-success"></i>
<span> <font color="red"> 待续费 </font> <font title="到期" style="font-size:10px;"> {{formatDate(item.endTime)}} </font></span>
</div>
</div>
</div>
<div v-else-if="ooper!=='2' && item.billMode!=='0' " class="module">
<div class="head" :class="{active: item.isChecked == true}" @click="selectItem(item, index)">
<div class="module_top">
<img :src="item.logoUrl" alt="">
<span>{{item.name}}</span>
</div>
<div v-if=" item.billMode==='0'" class="module_bottom">
<span> <font color="red">免费 </font> <font color="blue">已开通</font></span>
</div>
<div v-else-if="item.isBuy" class="module_bottom">
<span> <font color="blue">已开通</font></span>
</div>
<div v-else class="module_bottom" >
<i v-if="item.isChecked" class="selected el-icon-success"></i>
<span> <font color="red">待开通</font></span>
</div>
</div>
</div>
</div>
@ -81,6 +102,7 @@
</template>
<script>
import { mapGetters } from 'vuex';
import {getAllMenuModule, getBuyMenuModule} from '@/api/mdp/sys/modules'
import {calcOrder} from '@/api/mdp/sys/order'
@ -90,10 +112,10 @@ import weixinPay from '@/assets/image/module/weixin.png'
import Decimal from "decimal.js" //
import getDecimal from '@/utils/decimalUtil.js'
import { calcBranchUsers } from '@/api/branch';
import { getBranchInterestsDetail } from '@/api/branch';
export default {
props: ['modules'],
props: ['modules', 'ooper'],
data() {
return {
menuLoading: false,
@ -101,13 +123,13 @@ export default {
payWayOptions: [
{
label: '支付宝',
val: 'aliPay',
val: '2',
icon: aliPay,
isChecked: true
},
{
label: '微信',
val: 'weixinPay',
val: '1',
icon: weixinPay,
isChecked: false
}
@ -137,14 +159,14 @@ export default {
],
form: {
moduleIds:[],
payway: 'aliPay',
payType: '1',
odays: '360',
label:'1年',
ousers:10,
phone: '',
checked: false,
},
orders:{order:null,modules:[]},
orders:{order:{ofinalFee:0},modules:[]},
branchUsersCpd:{istatus:'1',maxUsers:50,ilvlId:'2',ilvlName:'黄金会员'}
}
},
@ -163,6 +185,13 @@ export default {
},
methods: {
formatDate(dateStr){
if(dateStr){
return dateStr.substring(0,10)
}else{
return '';
}
},
formOusersChange(val){
if(this.branchUsersCpd && this.branchUsersCpd.istatus=='1'){
if(val<=this.branchUsersCpd.maxUsers){
@ -177,20 +206,28 @@ export default {
calcOrder:function() {
if(!this.form.moduleIds || this.form.moduleIds.length==0){
if(this.orders && this.orders.order){
this.orders={}
this.orders={order:{ofinalFee:0},moduleIds:[]}
}
return;
}
this.form.ooper=this.ooper;
calcOrder(this.form).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
this.orders.order=res.data.data
this.orders.modules=res.data.modules
this.odaysOptions.forEach(i=>{
i.price=parseInt(this.orders.order.ofinalFee/this.form.ousers/this.form.odays )
})
}else{
this.$notify({position:"bottom-left",message:tips.msg,type:"error"})
}
})
},
selectItem(item) {
if(item.isBuy){
if(this.ooper!='2' && item.isBuy){
this.$notify({position:"bottom-left",message:"【"+item.name+"】已购买,如需调整,请进入【我的订单->加购】 处理",type:"warning"})
return;
}
@ -209,7 +246,7 @@ export default {
},
selectPayWay(item) {
this.form.payway = item.val;
this.form.payType = item.val;
this.payWayOptions.forEach(element => {
element.isChecked = false;
if(item.val == element.val) {
@ -232,10 +269,11 @@ export default {
},
getForm() {
getData() {
let obj = {
...this.orders,
...this.form
...this.form,
opper:this.ooper,
}
return obj;
},
@ -243,8 +281,8 @@ export default {
mounted() {
this.form.phone = this.userInfo.phoneno;
calcBranchUsers().then(res=>{
// Object.assign(this.branchUsersCpd,res.data.data);
getBranchInterestsDetail().then(res=>{
Object.assign(this.branchUsersCpd,res.data.data);
if(this.branchUsersCpd.branchId && this.branchUsersCpd.istatus=='1'){
this.form.ousers=this.branchUsersCpd.maxUsers
//this.calcOrder();

2
src/views/order/flagShip.vue

@ -116,7 +116,7 @@ export default {
},
methods: {
getForm() {
getData() {
//
return new Promise((resolve, reject) => {
this.$refs['form'].validate((valid) => {

48
src/views/order/index.scss

@ -133,12 +133,12 @@ h2 {
flex-direction: column;
background: #FFFFFF;
margin-right: 30px;
margin-top:30px;
.head {
width: 180px;
height: 200px;
border: 1px solid #E3E4E6;
border-radius: 8px;
margin-bottom: 20px;
position: relative;
cursor: pointer;
.module_top {
@ -147,6 +147,7 @@ h2 {
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
img {
width: 90px;
height: 90px;
@ -159,13 +160,19 @@ h2 {
}
}
.module_bottom {
height: 30px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
.selected {
color: #fff;
font-size: 30px;
position: absolute;
right: 10px;
top:5px;
color: #409EFF;
}
span{
font-size: 14px;
position: absolute;
left: 10px;
top: 5px;
color: #409EFF;
}
}
@ -331,3 +338,30 @@ h2 {
}
}
}
.avatar-container {
height: 50px;
display: flex;
align-items: center;
.avatar-wrapper {
cursor: pointer;
display: flex;
flex-direction: row;
align-items: center;
.user-avatar {
height: 34px;
width: 34px;
border-radius: 50%;
margin-right: 12px;
}
.username{
color: #7D7D7D;
font-size: 18px;
margin-right: 2px;
}
.el-icon-caret-bottom {
font-size: 22px;
}
}
}

29
src/views/order/index.vue

@ -11,7 +11,7 @@
<div class="content" v-else>
<div class="top_desc">
<h2>购买订单</h2>
<p>团队名: 擎勤科技</p>
<p>团队名: {{userInfo.branchName?userInfo.branchName:userInfo.branchId}}</p>
</div>
<div class="version">
@ -30,7 +30,7 @@
<div class="version_all">
<flag-ship ref="flagship" v-if="currentSelectVersion == '旗舰版'"></flag-ship>
<enterprise ref="enterprise" :modules="modules" v-if="currentSelectVersion == '企业版'"></enterprise>
<enterprise ref="enterprise" :modules="modules" v-if="currentSelectVersion == '企业版'" :ooper="'1'"></enterprise>
</div>
<el-button :loading="submitLoading" @click="submitOrder" size="larget" class="submit" type="primary">
@ -54,8 +54,15 @@ import {getAllMenuModule, getBuyMenuModule} from '@/api/mdp/sys/modules'
import {modulesOfIcon} from "@/components/ModulesMenu/modulesOfIcon";
import {createFlagShipOrder} from '@/api/mdp/sys/order';
import { mapGetters } from 'vuex'
export default {
components: {FlagShip, Enterprise, orderSkeleton},
computed: {
...mapGetters([ 'userInfo' ]),
},
data() {
return {
version: [
@ -93,10 +100,10 @@ export default {
submitOrder() {
//
if(this.currentSelectVersion == "企业版") {
let data = this.$refs.enterprise.getForm();
let data = this.$refs.enterprise.getData();
//
if(data.phone == "" || data.phone == null || data.phone == undefined) {
this.$message({
this.$notify({
message: '请输入手机号',
type: 'warning'
});
@ -105,7 +112,7 @@ export default {
//
if(!data.checked) {
this.$message({
this.$notify({
message: '请先同意服务协议',
type: 'warning'
});
@ -114,7 +121,7 @@ export default {
//
if(data.moduleIds.length <= 0) {
this.$message({
this.$notify({
message: '请选择要购买的模块',
type: 'warning'
});
@ -124,20 +131,20 @@ export default {
window.localStorage.setItem("BUY_MODULES", JSON.stringify(data))
this.$router.push('/my/order/create')
}else {
let flagData = this.$refs.flagship.getForm();
let flagData = this.$refs.flagship.getData();
flagData.then((res) => {
//
res.needs = JSON.stringify(res.needs);
this.submitLoading = true;
createFlagShipOrder(res).then(res => {
if(res.data.tips.isOk){
this.$message.success("信息已提交,稍后我们将会联系您");
this.$notify.success("信息已提交,稍后我们将会联系您");
this.$refs.flagship.clearForm();
}else{
this.$message.error(res.data.tips.msg);
this.$notify.error(res.data.tips.msg);
}
}).catch(err => {
this.$message.error(err.msg);
this.$notify.error(err.msg);
}).finally(() => {
this.submitLoading = false;
})
@ -157,6 +164,7 @@ export default {
i.isChecked=false
i.musers=10
i.isBuy=false
i.endTime=''
})
getBuyMenuModule({}).then(res2 => {
let branchModules = res2.data.data;
@ -165,6 +173,7 @@ export default {
if(k.id == element.moduleId && element.status=='1') {
k.isBuy = true;
k.musers=element.musers
k.endTime=element.endTime
}
});
modulesOfIcon.forEach(element => {

Loading…
Cancel
Save