Commit 3ec57629 authored by lei's avatar lei

权重修改

parent b495d97a
...@@ -2,13 +2,9 @@ ...@@ -2,13 +2,9 @@
<template> <template>
<div class="datamanage-wrapper"> <div class="datamanage-wrapper">
<div class="search-wrapper"> <div class="search-wrapper">
<el-button <el-button size="mini" type="primary" icon="el-icon-circle-plus" class="addbtn" @click="addDialogData()"
size="mini" >新增</el-button
type="primary" >
icon="el-icon-circle-plus"
class="addbtn"
@click="addDialogData()"
>新增</el-button>
</div> </div>
<div class="table-wrapper"> <div class="table-wrapper">
<div class="infoline">信息分类列表</div> <div class="infoline">信息分类列表</div>
...@@ -26,24 +22,13 @@ ...@@ -26,24 +22,13 @@
<el-table-column type="index" label="序号" style="width: 100px" /> <el-table-column type="index" label="序号" style="width: 100px" />
<el-table-column label="操作" fixed="right"> <el-table-column label="操作" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="primary" icon="el-icon-edit" @click="typeEdit($event, scope.$index, scope.row)"
size="mini" >编辑</el-button
type="primary" >
icon="el-icon-edit" <el-button size="mini" type="danger" icon="el-icon-delete" @click="typeDelete(scope.row)">删除</el-button>
@click="typeEdit($event, scope.$index, scope.row)" <el-button size="mini" type="primary" icon="el-icon-zoom-in" @click="lookClassButton(scope.row)"
>编辑</el-button> >查看</el-button
<el-button >
size="mini"
type="danger"
icon="el-icon-delete"
@click="typeDelete(scope.row)"
>删除</el-button>
<el-button
size="mini"
type="primary"
icon="el-icon-zoom-in"
@click="lookClassButton(scope.row)"
>查看</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -51,26 +36,11 @@ ...@@ -51,26 +36,11 @@
<el-dialog title="新增分类名称" :visible.sync="typeManage.addDialog"> <el-dialog title="新增分类名称" :visible.sync="typeManage.addDialog">
<el-form ref="addDataForm" :model="typeManage.from" :rules="formrules"> <el-form ref="addDataForm" :model="typeManage.from" :rules="formrules">
<el-form-item prop="addname" label="分类名称:" :label-width="'120px'"> <el-form-item prop="addname" label="分类名称:" :label-width="'120px'">
<el-input <el-input v-model="typeManage.from.addname" clearable style="width: 220px" placeholder="请输入类别" />
v-model="typeManage.from.addname"
clearable
style="width: 220px"
placeholder="请输入类别"
/>
</el-form-item> </el-form-item>
<el-form-item prop="test" label="推送信息:" :label-width="'120px'"> <el-form-item prop="test" label="推送信息:" :label-width="'120px'">
<el-select <el-select v-model="typeManage.from.test" multiple placeholder="请选择" style="width: 220px">
v-model="typeManage.from.test" <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
multiple
placeholder="请选择"
style="width: 220px"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="id" label="添加到:" :label-width="'120px'"> <el-form-item prop="id" label="添加到:" :label-width="'120px'">
...@@ -84,11 +54,7 @@ ...@@ -84,11 +54,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button <el-button type="primary" :loading="typeManage.flag === 0" @click="determine">确定</el-button>
type="primary"
:loading="typeManage.flag === 0"
@click="determine"
>确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="编辑分类名称" :visible.sync="typeManage.editDialog"> <el-dialog title="编辑分类名称" :visible.sync="typeManage.editDialog">
...@@ -109,12 +75,7 @@ ...@@ -109,12 +75,7 @@
style="width: 220px; margin-left: 20px" style="width: 220px; margin-left: 20px"
@change="selectChange" @change="selectChange"
> >
<el-option <el-option v-for="item in newoptions" :key="item.value" :label="item.label" :value="item.value" />
v-for="item in newoptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="pid" label="添加到:" :label-width="'120px'"> <el-form-item prop="pid" label="添加到:" :label-width="'120px'">
...@@ -128,37 +89,17 @@ ...@@ -128,37 +89,17 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button <el-button type="primary" icon="el-icon-success" :loading="editFormInfo.flag === 0" @click="uploadAddForm"
type="primary" >确定</el-button
icon="el-icon-success" >
:loading="editFormInfo.flag === 0"
@click="uploadAddForm"
>确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog title="查看信息分类人员信息" :visible.sync="lookClassData.dialogOff">
title="查看信息分类人员信息"
:visible.sync="lookClassData.dialogOff"
>
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" :data="lookClassData.tableData" style="width: 100%"> <el-table ref="table" :data="lookClassData.tableData" style="width: 100%">
<el-table-column <el-table-column :show-overflow-tooltip="true" prop="username" label="用户名" />
:show-overflow-tooltip="true" <el-table-column :show-overflow-tooltip="true" prop="phone" width="100" label="电话" />
prop="username" <el-table-column :show-overflow-tooltip="true" width="135" prop="email" label="邮箱" />
label="用户名"
/>
<el-table-column
:show-overflow-tooltip="true"
prop="phone"
width="100"
label="电话"
/>
<el-table-column
:show-overflow-tooltip="true"
width="135"
prop="email"
label="邮箱"
/>
<el-table-column :show-overflow-tooltip="true" prop="name" label="部门"> <el-table-column :show-overflow-tooltip="true" prop="name" label="部门">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.name }}</div> <div>{{ scope.row.name }}</div>
...@@ -194,12 +135,17 @@ ...@@ -194,12 +135,17 @@
> >
信息权重 信息权重
</el-button> --> </el-button> -->
信息权重
<el-input-number <el-input-number
v-model="scope.row.value" v-model="scope.row.value"
small small
step-strictly step-strictly
:disabled=" controls-position="right"
:min="1"
:max="3"
@change="lookClassDataInputChange(scope.row)"
/>
</template>
<!-- :disabled="
scope.row.name != '销售三中心' && scope.row.name != '销售三中心' &&
scope.row.name != '销售五中心' && scope.row.name != '销售五中心' &&
scope.row.name != '销售一中心' && scope.row.name != '销售一中心' &&
...@@ -210,13 +156,7 @@ ...@@ -210,13 +156,7 @@
scope.row.name != '销售二部' && scope.row.name != '销售二部' &&
scope.row.name != '外贸部' && scope.row.name != '外贸部' &&
scope.row.name != '副总经理' scope.row.name != '副总经理'
" " -->
controls-position="right"
:min="1"
:max="3"
@change="lookClassDataInputChange(scope.row)"
/>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination
...@@ -231,7 +171,8 @@ ...@@ -231,7 +171,8 @@
icon="el-icon-success" icon="el-icon-success"
:loading="editFormInfo.flag === 0" :loading="editFormInfo.flag === 0"
@click="lookClassData.dialogOff = !lookClassData.dialogOff" @click="lookClassData.dialogOff = !lookClassData.dialogOff"
>确定</el-button> >确定</el-button
>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
...@@ -327,15 +268,11 @@ export default { ...@@ -327,15 +268,11 @@ export default {
// 验证 // 验证
formrules: { formrules: {
addname: [{ required: true, message: '请输入类别', trigger: 'blur' }], addname: [{ required: true, message: '请输入类别', trigger: 'blur' }],
test: [ test: [{ required: true, message: '请选择推送信息', trigger: 'change' }]
{ required: true, message: '请选择推送信息', trigger: 'change' }
]
}, },
rules: { rules: {
type: [{ required: true, message: '请输入类别', trigger: 'blur' }], type: [{ required: true, message: '请输入类别', trigger: 'blur' }],
choose: [ choose: [{ required: true, message: '请选择推送信息', trigger: 'change' }]
{ required: true, message: '请选择推送信息', trigger: 'change' }
]
}, },
infoTree: { infoTree: {
menus: [{ id: 0, label: '信息分类', children: null, pid: -1 }] menus: [{ id: 0, label: '信息分类', children: null, pid: -1 }]
...@@ -361,14 +298,12 @@ export default { ...@@ -361,14 +298,12 @@ export default {
}, },
methods: { methods: {
// 构建 Tree列表 // 构建 Tree列表
reqBuildTreeList: function() { reqBuildTreeList: function () {
var that = this var that = this
reqAllInfoTreeList().then(function(res) { reqAllInfoTreeList().then(function (res) {
if (res.code === 200) { if (res.code === 200) {
var list = res.object.records || [] var list = res.object.records || []
that.infoTree.menus = [ that.infoTree.menus = [{ id: 0, label: '信息分类', children: null, pid: -1 }]
{ id: 0, label: '信息分类', children: null, pid: -1 }
]
list.push(that.infoTree.menus[0]) list.push(that.infoTree.menus[0])
qf.Utils.treeListBuild(list) qf.Utils.treeListBuild(list)
} }
...@@ -455,7 +390,7 @@ export default { ...@@ -455,7 +390,7 @@ export default {
(res) => { (res) => {
this.typeManage.addDialog = false this.typeManage.addDialog = false
this.classification() this.classification()
setTimeout(function() { setTimeout(function () {
self.typeManage.flag = 1 self.typeManage.flag = 1
}, 300) }, 300)
self.$message({ self.$message({
...@@ -505,7 +440,7 @@ export default { ...@@ -505,7 +440,7 @@ export default {
this.CacheItem.label = params.name this.CacheItem.label = params.name
this.CacheItem.pushnew = params.pushNew this.CacheItem.pushnew = params.pushNew
setTimeout(function() { setTimeout(function () {
self.editFormInfo.flag = 1 self.editFormInfo.flag = 1
}, 300) }, 300)
// 重新构建列表 // 重新构建列表
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
clearable clearable
size="small" size="small"
placeholder="输入名称或者邮箱搜索" placeholder="输入名称或者邮箱搜索"
style="width: 200px;" style="width: 200px"
class="filter-item" class="filter-item"
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
...@@ -60,7 +60,14 @@ ...@@ -60,7 +60,14 @@
<crudOperation show="" :permission="permission" /> <crudOperation show="" :permission="permission" />
</div> </div>
<!--表单渲染--> <!--表单渲染-->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="570px"> <el-dialog
append-to-body
:close-on-click-modal="false"
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0"
:title="crud.status.title"
width="570px"
>
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="66px"> <el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="66px">
<el-form-item label="用户名" prop="username"> <el-form-item label="用户名" prop="username">
<el-input v-model="form.username" @keydown.native="keydown($event)" /> <el-input v-model="form.username" @keydown.native="keydown($event)" />
...@@ -92,12 +99,7 @@ ...@@ -92,12 +99,7 @@
@remove-tag="deleteTag" @remove-tag="deleteTag"
@change="changeJob" @change="changeJob"
> >
<el-option <el-option v-for="item in jobs" :key="item.name" :label="item.name" :value="item.id" />
v-for="item in jobs"
:key="item.name"
:label="item.name"
:value="item.id"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="性别"> <el-form-item label="性别">
...@@ -108,14 +110,12 @@ ...@@ -108,14 +110,12 @@
</el-form-item> </el-form-item>
<el-form-item label="状态"> <el-form-item label="状态">
<el-radio-group v-model="form.enabled" :disabled="form.id === user.id"> <el-radio-group v-model="form.enabled" :disabled="form.id === user.id">
<el-radio <el-radio v-for="item in dict.user_status" :key="item.id" :label="item.value">{{
v-for="item in dict.user_status" item.label
:key="item.id" }}</el-radio>
:label="item.value"
>{{ item.label }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item style="margin-bottom: 0;" label="角色" prop="roles"> <el-form-item style="margin-bottom: 0" label="角色" prop="roles">
<el-select <el-select
v-model="roleDatas" v-model="roleDatas"
style="width: 437px" style="width: 437px"
...@@ -140,8 +140,13 @@ ...@@ -140,8 +140,13 @@
</div> </div>
</el-dialog> </el-dialog>
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" <el-table
@selection-change="crud.selectionChangeHandler"> ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column :selectable="checkboxT" type="selection" width="55" /> <el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column :show-overflow-tooltip="true" prop="username" label="用户名" /> <el-table-column :show-overflow-tooltip="true" prop="username" label="用户名" />
<el-table-column :show-overflow-tooltip="true" prop="nickName" label="昵称" /> <el-table-column :show-overflow-tooltip="true" prop="nickName" label="昵称" />
...@@ -150,7 +155,7 @@ ...@@ -150,7 +155,7 @@
<el-table-column :show-overflow-tooltip="true" width="135" prop="email" label="邮箱" /> <el-table-column :show-overflow-tooltip="true" width="135" prop="email" label="邮箱" />
<el-table-column :show-overflow-tooltip="true" prop="dept" label="部门"> <el-table-column :show-overflow-tooltip="true" prop="dept" label="部门">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{scope.row.dept.name }}</div> <div>{{ scope.row.dept.name }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="enabled"> <el-table-column label="状态" align="center" prop="enabled">
...@@ -166,74 +171,54 @@ ...@@ -166,74 +171,54 @@
</el-table-column> </el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="createTime" width="135" label="创建日期" /> <el-table-column :show-overflow-tooltip="true" prop="createTime" width="135" label="创建日期" />
<el-table-column <el-table-column
v-if="checkPer(['admin','user:edit','user:del'])" v-if="checkPer(['admin', 'user:edit', 'user:del'])"
label="操作" label="操作"
width="300" width="300"
align="center" align="center"
fixed="right" fixed="right"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <!-- :disabled="scope.row.dept.name !='销售三中心'
@click="addDialogData('edit',scope.row.id,scope.row)"
:disabled="scope.row.dept.name !='销售三中心'
&&scope.row.dept.name !='销售五中心'&&scope.row.dept.name !='销售一中心' &&scope.row.dept.name !='销售五中心'&&scope.row.dept.name !='销售一中心'
&&scope.row.dept.name !='销售二中心'&&scope.row.dept.name !='销售六中心'&& &&scope.row.dept.name !='销售二中心'&&scope.row.dept.name !='销售六中心'&&
scope.row.dept.name !='销售一部'&&scope.row.dept.name !='销售三部'&& scope.row.dept.name !='销售一部'&&scope.row.dept.name !='销售三部'&&
scope.row.dept.name !='销售二部'&&scope.row.dept.name !='外贸部'&&scope.row.dept.name !='副总经理'" scope.row.dept.name !='销售二部'&&scope.row.dept.name !='外贸部'&&scope.row.dept.name !='副总经理'"
size="mini" -->
type="primary" <el-button @click="addDialogData('edit', scope.row.id, scope.row)" size="mini" type="primary">
> 信息权重
信息权重 </el-button>
</el-button> </template>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination /> <pagination />
</el-col> </el-col>
</el-row> </el-row>
<!-- 权重弹窗 --> <!-- 权重弹窗 -->
<el-dialog title="设置信息权重" :visible.sync="addFormInfo.addDialog"> <el-dialog title="设置信息权重" :visible.sync="addFormInfo.addDialog">
<div v-for="(item,i) in typeList"> <div v-for="(item, i) in typeList">
<el-form <el-form ref="addDataForm" :model="typeList[i]" :rules="fromrules">
ref="addDataForm" <el-form-item prop="infoClass" label="信息分类" :label-width="'120px'">
:model="typeList[i]" <el-select clearable v-model="typeList[i].infoClass" placeholder="请选择类别" filterable allow-create>
:rules="fromrules" <el-option v-for="(item, index) in listType" :key="index" :label="item.type" :value="item.typeId" />
> </el-select>
<el-form-item prop="infoClass" label="信息分类" :label-width="'120px'"> </el-form-item>
<el-select <el-form-item prop="value" label="权重值:" :label-width="'120px'">
clearable <el-input-number v-model="typeList[i].value" :min="1" :max="5" label="描述文字"></el-input-number>
v-model="typeList[i].infoClass" </el-form-item>
placeholder="请选择类别" <el-button circle icon="el-icon-plus" @click="addList()"></el-button>
filterable <el-button circle icon="el-icon-minus" @click="subList(i)" v-if="i > 0"></el-button>
allow-create </el-form>
> </div>
<el-option <div slot="footer">
v-for="(item,index) in listType" <el-button type="primary" @click="determine">确定</el-button>
:key="index" </div>
:label="item.type" </el-dialog>
:value="item.typeId"
/>
</el-select>
</el-form-item>
<el-form-item prop="value" label="权重值:" :label-width="'120px'" >
<el-input-number v-model="typeList[i].value"
:min="1" :max="5" label="描述文字"></el-input-number>
</el-form-item>
<el-button circle icon="el-icon-plus" @click="addList()"></el-button>
<el-button circle icon="el-icon-minus" @click="subList(i)" v-if="i>0"></el-button>
</el-form>
</div>
<div slot="footer">
<el-button type="primary" @click="determine">确定</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {getAllCategory,addAssignWeight,showAssignWeight} from "@/api/user.js"; import { getAllCategory, addAssignWeight, showAssignWeight } from '@/api/user.js'
import crudUser from '@/api/system/user' import crudUser from '@/api/system/user'
import { isvalidPhone } from '@/utils/validate' import { isvalidPhone } from '@/utils/validate'
import { getDepts, getDeptSuperior } from '@/api/system/dept' import { getDepts, getDeptSuperior } from '@/api/system/dept'
...@@ -251,12 +236,23 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css' ...@@ -251,12 +236,23 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect' import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
let userRoles = [] let userRoles = []
let userJobs = [] let userJobs = []
const defaultForm = { id: null, username: null, nickName: null, gender: '', email: null, enabled: 'false', roles: [], jobs: [], dept: { id: null }, phone: null } const defaultForm = {
id: null,
username: null,
nickName: null,
gender: '',
email: null,
enabled: 'false',
roles: [],
jobs: [],
dept: { id: null },
phone: null
}
export default { export default {
name: 'User', name: 'User',
components: { Treeselect, crudOperation, rrOperation, udOperation, pagination, DateRangePicker }, components: { Treeselect, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
cruds() { cruds() {
return CRUD({ title: '用户', url: 'api/users', crudMethod: { ...crudUser }}) return CRUD({ title: '用户', url: 'api/users', crudMethod: { ...crudUser } })
}, },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
// 数据字典 // 数据字典
...@@ -273,10 +269,15 @@ export default { ...@@ -273,10 +269,15 @@ export default {
} }
} }
return { return {
height: document.documentElement.clientHeight - 180 + 'px;', height: document.documentElement.clientHeight - 180 + 'px;',
deptName: '', depts: [], deptDatas: [], jobs: [], level: 3, roles: [], deptName: '',
jobDatas: [], roleDatas: [], // 多选时使用 depts: [],
deptDatas: [],
jobs: [],
level: 3,
roles: [],
jobDatas: [],
roleDatas: [], // 多选时使用
defaultProps: { children: 'children', label: 'name', isLeaf: 'leaf' }, defaultProps: { children: 'children', label: 'name', isLeaf: 'leaf' },
permission: { permission: {
add: ['admin', 'user:add'], add: ['admin', 'user:add'],
...@@ -300,134 +301,124 @@ export default { ...@@ -300,134 +301,124 @@ export default {
{ required: true, message: '请输入邮箱地址', trigger: 'blur' }, { required: true, message: '请输入邮箱地址', trigger: 'blur' },
{ type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' } { type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' }
], ],
phone: [ phone: [{ required: true, trigger: 'blur', validator: validPhone }]
{ required: true, trigger: 'blur', validator: validPhone } },
] fromrules: {
informationClassNumber: [{ required: true, message: '请选择类别', trigger: 'blur' }],
weightValue: [{ required: true, message: '请选择权重值', trigger: 'change' }]
}, },
fromrules: { handoverSalemanrules: {},
informationClassNumber : [{ required: true, message: "请选择类别", trigger: "blur"}], // 信息权重
weightValue:[{ required: true, message: "请选择权重值", trigger: "change"}] totalTypeNumber: Number,
}, listType: [],
handoverSalemanrules:{ typeList: [{ infoClass: '', value: '' }],
//
}, newManage: {
// 信息权重 page: 1,
totalTypeNumber:Number, size: 10,
listType:[], total: 0
typeList: [ },
{infoClass: '', value: ''} // 获取信息分类数据
], addFormInfo: {
// addDialog: false,
newManage:{ userID: '',
page:1, from: [
size:10, {
total:0, infoClass: '',
}, value: ''
// 获取信息分类数据 }
addFormInfo:{ ],
addDialog:false, type: 'edit'
userID:'', }
from:[
{
infoClass:'',
value:'',
},
],
type:'edit'
},
} }
}, },
computed: { computed: {
...mapGetters([ ...mapGetters(['user'])
'user'
])
}, },
created() { created() {
this.crud.msg.add = '新增成功,默认密码:123456' this.crud.msg.add = '新增成功,默认密码:123456'
}, },
mounted: function() { mounted: function () {
const that = this const that = this
window.onresize = function temp() { window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 180 + 'px;' that.height = document.documentElement.clientHeight - 180 + 'px;'
} }
this.classification() this.classification()
}, },
methods: { methods: {
//加号 //加号
addList() { addList() {
console.log(this.typeList.length) console.log(this.typeList.length)
console.log(this.totalTypeNumber) console.log(this.totalTypeNumber)
if(this.typeList.length<=this.totalTypeNumber){ if (this.typeList.length <= this.totalTypeNumber) {
this.typeList.push({infoClass: '', value: ''}) this.typeList.push({ infoClass: '', value: '' })
}else{ } else {
this.$message.error("已超过权重总数"); this.$message.error('已超过权重总数')
return return
} }
}, },
//减号 //减号
subList(index) { subList(index) {
console.log(index) console.log(index)
this.typeList.splice(index, 1) this.typeList.splice(index, 1)
}, },
// 获取信息分类 // 获取信息分类
classification(params){ classification(params) {
this.listType=[] this.listType = []
var params = { var params = {
page:this.newManage.page, page: this.newManage.page,
pageSize:this.newManage.size, pageSize: this.newManage.size
}; }
getAllCategory(params).then((res) => { getAllCategory(params).then((res) => {
var newlist = res.object.records || []; var newlist = res.object.records || []
this.totalTypeNumber=newlist.length; this.totalTypeNumber = newlist.length
console.log( this.totalTypeNumber,'this.totalTypeNumber') console.log(this.totalTypeNumber, 'this.totalTypeNumber')
for(var i=0;i<newlist.length;i++){ for (var i = 0; i < newlist.length; i++) {
this.listType.push({type:newlist[i].name,typeId:newlist[i].id}) this.listType.push({ type: newlist[i].name, typeId: newlist[i].id })
console.log(this.listType,"this.listType") console.log(this.listType, 'this.listType')
} }
}); })
},
}, handleChange(value) {},
handleChange(value) { // 权重弹窗
}, addDialogData(type, id) {
// 权重弹窗 this.addFormInfo.addDialog = true
addDialogData(type,id){ this.partyId = id
this.addFormInfo.addDialog = true; console.log(this.partyId, 'this.partyId_____________')
this.partyId=id if (type === 'edit') {
console.log(this.partyId,'this.partyId_____________') var params = {
if(type==="edit"){ userId: id
var params = { }
userId:id, var self = this
}; showAssignWeight(params).then((res) => {
var self = this; if (res.code == 200) {
showAssignWeight(params).then((res) => { this.typeList = res.object || []
if(res.code==200){ } else {
this.typeList=res.object|| [] this.typeList = [{ infoClass: '', value: '' }]
}else{ }
this.typeList=[{infoClass: '', value: ''}]; })
} }
}, },
); determine() {
} var params = {
}, userId: this.partyId,
determine(){ weightInfoList: this.typeList
var params = { }
userId: this.partyId, var self = this
weightInfoList:this.typeList addAssignWeight(params).then(
}; (res) => {
var self = this; console.log(res)
addAssignWeight(params).then((res) => { this.addFormInfo.addDialog = false
console.log(res) self.$message({
this.addFormInfo.addDialog = false; type: 'success',
self.$message({ message: '设置权重信息成功'
type: "success", })
message: "设置权重信息成功", },
}); () => {
}, self.$message.error('设置权重信息失败')
() => { }
self.$message.error("设置权重信息失败"); )
} },
);
},
// 禁止输入空格 // 禁止输入空格
keydown(e) { keydown(e) {
if (e.keyCode === 32) { if (e.keyCode === 32) {
...@@ -436,20 +427,20 @@ export default { ...@@ -436,20 +427,20 @@ export default {
}, },
changeRole(value) { changeRole(value) {
userRoles = [] userRoles = []
value.forEach(function(data, index) { value.forEach(function (data, index) {
const role = { id: data } const role = { id: data }
userRoles.push(role) userRoles.push(role)
}) })
}, },
changeJob(value) { changeJob(value) {
userJobs = [] userJobs = []
value.forEach(function(data, index) { value.forEach(function (data, index) {
const job = { id: data } const job = { id: data }
userJobs.push(job) userJobs.push(job)
}) })
}, },
deleteTag(value) { deleteTag(value) {
userRoles.forEach(function(data, index) { userRoles.forEach(function (data, index) {
if (data.id === value) { if (data.id === value) {
userRoles.splice(index, value) userRoles.splice(index, value)
} }
...@@ -480,12 +471,12 @@ export default { ...@@ -480,12 +471,12 @@ export default {
userRoles = [] userRoles = []
userJobs = [] userJobs = []
const _this = this const _this = this
form.roles.forEach(function(role, index) { form.roles.forEach(function (role, index) {
_this.roleDatas.push(role.id) _this.roleDatas.push(role.id)
const rol = { id: role.id } const rol = { id: role.id }
userRoles.push(rol) userRoles.push(rol)
}) })
form.jobs.forEach(function(job, index) { form.jobs.forEach(function (job, index) {
_this.jobDatas.push(job.id) _this.jobDatas.push(job.id)
const data = { id: job.id } const data = { id: job.id }
userJobs.push(data) userJobs.push(data)
...@@ -528,7 +519,7 @@ export default { ...@@ -528,7 +519,7 @@ export default {
params['pid'] = node.data.id params['pid'] = node.data.id
} }
setTimeout(() => { setTimeout(() => {
getDepts(params).then(res => { getDepts(params).then((res) => {
if (resolve) { if (resolve) {
resolve(res.content) resolve(res.content)
} else { } else {
...@@ -538,8 +529,8 @@ export default { ...@@ -538,8 +529,8 @@ export default {
}, 100) }, 100)
}, },
getDepts() { getDepts() {
getDepts({ enabled: true }).then(res => { getDepts({ enabled: true }).then((res) => {
this.depts = res.content.map(function(obj) { this.depts = res.content.map(function (obj) {
if (obj.hasChildren) { if (obj.hasChildren) {
obj.children = null obj.children = null
} }
...@@ -548,14 +539,14 @@ export default { ...@@ -548,14 +539,14 @@ export default {
}) })
}, },
getSupDepts(deptId) { getSupDepts(deptId) {
getDeptSuperior(deptId).then(res => { getDeptSuperior(deptId).then((res) => {
const date = res.content const date = res.content
this.buildDepts(date) this.buildDepts(date)
this.depts = date this.depts = date
}) })
}, },
buildDepts(depts) { buildDepts(depts) {
depts.forEach(data => { depts.forEach((data) => {
if (data.children) { if (data.children) {
this.buildDepts(data.children) this.buildDepts(data.children)
} }
...@@ -567,8 +558,8 @@ export default { ...@@ -567,8 +558,8 @@ export default {
// 获取弹窗内部门数据 // 获取弹窗内部门数据
loadDepts({ action, parentNode, callback }) { loadDepts({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) { if (action === LOAD_CHILDREN_OPTIONS) {
getDepts({ enabled: true, pid: parentNode.id }).then(res => { getDepts({ enabled: true, pid: parentNode.id }).then((res) => {
parentNode.children = res.content.map(function(obj) { parentNode.children = res.content.map(function (obj) {
if (obj.hasChildren) { if (obj.hasChildren) {
obj.children = null obj.children = null
} }
...@@ -595,33 +586,44 @@ export default { ...@@ -595,33 +586,44 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { })
crudUser.edit(data).then(res => { .then(() => {
this.crud.notify(this.dict.label.user_status[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS) crudUser
}).catch(() => { .edit(data)
.then((res) => {
this.crud.notify(this.dict.label.user_status[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
.catch(() => {
data.enabled = !data.enabled
})
})
.catch(() => {
data.enabled = !data.enabled data.enabled = !data.enabled
}) })
}).catch(() => {
data.enabled = !data.enabled
})
}, },
// 获取弹窗内角色数据 // 获取弹窗内角色数据
getRoles() { getRoles() {
getAll().then(res => { getAll()
this.roles = res .then((res) => {
}).catch(() => { }) this.roles = res
})
.catch(() => {})
}, },
// 获取弹窗内岗位数据 // 获取弹窗内岗位数据
getJobs() { getJobs() {
getAllJob().then(res => { getAllJob()
this.jobs = res.content .then((res) => {
}).catch(() => { }) this.jobs = res.content
})
.catch(() => {})
}, },
// 获取权限级别 // 获取权限级别
getRoleLevel() { getRoleLevel() {
getLevel().then(res => { getLevel()
this.level = res.level .then((res) => {
}).catch(() => { }) this.level = res.level
})
.catch(() => {})
}, },
checkboxT(row, rowIndex) { checkboxT(row, rowIndex) {
return row.id !== this.user.id return row.id !== this.user.id
...@@ -631,8 +633,10 @@ export default { ...@@ -631,8 +633,10 @@ export default {
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .vue-treeselect__control,::v-deep .vue-treeselect__placeholder,::v-deep .vue-treeselect__single-value { ::v-deep .vue-treeselect__control,
height: 30px; ::v-deep .vue-treeselect__placeholder,
line-height: 30px; ::v-deep .vue-treeselect__single-value {
} height: 30px;
line-height: 30px;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment