add: 分公司系统管理(菜单角色权限)

pull/5/head
dearlin 2023-11-27 09:39:53 +08:00
parent 366023b394
commit 8fa17b32d1
39 changed files with 9199 additions and 0 deletions
src
layout/components
views
corpsystem
presystem
buttons
corptype
dictionary
online
permission
serviceNotice
templates
version
versionmanager
versionmanagerFirst
versionmanagerReg
versionmanagerZdgc

View File

@ -39,6 +39,10 @@
<svg-icon icon-class="example" />
<span>综合管理</span>
</div>
<div v-if="loginUser.ISMAIN == '1'" class="right-menu-item hover-effect" @click="setShowModel('presystem')">
<svg-icon icon-class="example" />
<span>企业系统管理</span>
</div>
<!-- <template v-if="device!=='mobile'">
<screenfull id="screenfull" class="right-menu-item hover-effect" />
@ -215,6 +219,7 @@ export default {
imgUrl: require('@/assets/images/user-logo.png'),
config: config,
fwebsocket: {},
loginUser: JSON.parse(sessionStorage.getItem('user')),
alarmSocket: {},
dialogFormEdit: false,
dialogMessageEdit: false,
@ -305,6 +310,8 @@ export default {
}
},
setShowModel(model) {
console.log('model')
console.log(model)
this.$store.dispatch('permission/setShowModel', model)
},
toggleSideBar() {

View File

@ -0,0 +1,407 @@
<template>
<div class="icons-container">
<el-container>
<el-aside width="300px" style="background-color:#fff">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
style="margin:10px 0"/>
<el-tree
v-loading="treeLoading"
ref="tree"
:data="treeData"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
@node-click="handleNodeClick"/>
</el-aside>
<el-main>
<div class="filter-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button v-show="MENU_ID != '0'" icon="el-icon-arrow-left" @click="getList(pd.PARENT_ID)"></el-button>
</div>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column type="index" prop="numb" label="序号" width="50" align="center" />
<el-table-column label="名称" >
<template slot-scope="{row}">
<div class="link-type" @click="getList(row.menu_ID)">
<svg-icon :icon-class="row.menu_ICON" class-name="disabled" /> {{ row.menu_NAME }} <i class="el-icon-arrow-right" />
</div>
</template>
</el-table-column>
<el-table-column label="资源路径">
<template slot-scope="{row}">
{{ row.menu_URL == '#' ? '&nbsp;&nbsp;&nbsp;&nbsp;(无)': row.menu_URL }}
</template>
</el-table-column>
<el-table-column label="权限标识">
<template slot-scope="{row}">
{{ '' == row.shiro_KEY || null == row.shiro_KEY ?'(无)': row.shiro_KEY }}
</template>
</el-table-column>
<el-table-column label="状态" width="100" >
<template slot-scope="{row}">
<template v-if="row.menu_STATE==1">
<el-tag size="mini">
显示
</el-tag>
</template>
<template v-else>
<el-tag size="mini" type="info">
隐藏
</el-tag>
</template>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="{row}">
<el-button v-show="MENU_ID == '0' && edit" type="success" icon="el-icon-picture-outline" size="mini" @click="handleEditIcon(row.menu_ID)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.menu_ID)"></el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.menu_ID, row.menu_NAME)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-main>
</el-container>
<el-dialog :visible.sync="dialogFormAdd" :title="dialogType==='edit'?'修改':'新增'" width="600px">
<el-tag class="mark_up" size="medium">上级菜单{{ MENU_ID == '0' ?'(无) 此项为顶级菜单':pds.MENU_NAME }}</el-tag>
<el-form ref="form" :model="form" :rules="rules" label-width="110px" style="width: 500px;">
<el-form-item label="菜单名称" prop="MENU_NAME">
<el-input v-model="form.MENU_NAME" placeholder="这里输入菜单名称..." />
</el-form-item>
<el-form-item label="菜单链接">
<el-input v-model="form.MENU_URL" placeholder="这里输入菜单链接..." />
</el-form-item>
<el-form-item label="组件路径">
<el-input v-model="form.COMPONENT" placeholder="这里输入组件路径..." />
</el-form-item>
<el-form-item label="权限标识" prop="SHIRO_KEY">
<el-input v-model="form.SHIRO_KEY" placeholder="这里输入权限标识..." />
</el-form-item>
<el-form-item v-show="MENU_ID == '0'" label="显示模式" prop="SHOW_MODEL">
<el-input v-model="form.SHOW_MODEL" placeholder="这里输入显示模式..." />
</el-form-item>
<el-form-item label="菜单序号" prop="MENU_ORDER">
<el-input v-model.number="form.MENU_ORDER" placeholder="这里输入菜单序号..." />
</el-form-item>
<el-form-item label="菜单状态">
<el-radio-group v-model="form.MENU_STATE">
<el-radio :label="1">显示</el-radio>
<el-radio :label="0">隐藏</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormAdd = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogEditIcon" title="编辑图标" width="960px">
<div class="grid">
<div v-for="item of svgIcons" :key="item">
<div class="icon-item" @click="confirmIcon(item)">
<svg-icon :icon-class="item" class-name="disabled" />
<span>{{ item }}</span>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogEditIcon = false"> </el-button>
<!-- <el-button type="primary" @click="confirm"> </el-button>-->
</div>
</el-dialog>
</div>
</template>
<script>
import svgIcons from './svg-icons'
import { requestFN } from '@/utils/request'
export default {
name: 'Icons',
data() {
return {
listLoading: false, //
treeLoading: false,
svgIcons,
radio: 1,
dialogFormAdd: false,
dialogEditIcon: false,
dialogType: 'add',
//
filterText: '',
treeData: [],
defaultProps: {
children: 'nodes',
label: 'name'
},
//
varList: [], // list
MENU_ID: '0', // ID
pd: [],
form: {
MENU_ID: '', // ID
MENU_TYPE: '1', //
MENU_STATE: 1, //
PARENT_ID: '', // ID
MENU_NAME: '', //
MENU_URL: '', //
COMPONENT: '', //
SHIRO_KEY: '(无)', //
SHOW_MODEL: '', //
MENU_ORDER: '' //
},
pds: [],
add: false,
del: false,
edit: false,
rules: {
MENU_NAME: [
{ required: true, message: '菜单名称不能为空', trigger: 'change' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
],
MENU_ORDER: [
{ required: true, message: '菜单序号不能为空', trigger: 'change' },
{ type: 'number', message: '菜单序号必须为数字' }
]
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getTreeList()
this.getList(this.MENU_ID)
},
methods: {
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleNodeClick(node, data, value) {
this.handleEdit(node.id)
},
handleAdd() {
this.dialogType = 'add'
this.resetForm()
requestFN(
'/corpMenu/toAdd',
{
MENU_ID: this.MENU_ID
}
).then((data) => {
this.form.PARENT_ID = this.MENU_ID
this.pds = data.pds || [] //
}).catch((e) => {
})
this.dialogFormAdd = true
},
handleEdit(MENU_ID) {
this.dialogType = 'edit'
requestFN(
'/corpMenu/toEdit',
{
MENU_ID: MENU_ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
this.form.MENU_ID = MENU_ID
this.form.PARENT_ID = data.pd.PARENT_ID
this.pds = data.pds || [] //
}).catch((e) => {
this.listLoading = false
})
this.dialogFormAdd = true
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/corpMenu/' + this.dialogType,
this.form
).then((data) => {
this.listLoading = false
this.dialogFormAdd = false
this.getTreeList()
this.getList(this.MENU_ID)
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id, name) {
this.$confirm('确定要删除[' + name + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/corpMenu/delete',
{
MENU_ID: id
}
).then(() => {
this.listLoading = false
this.getTreeList()
this.getList(this.MENU_ID)
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
handleEditIcon(MENU_ID) {
this.dialogEditIcon = true
this.form.MENU_ID = MENU_ID
},
confirmIcon(symbol) {
const MENU_ICON = symbol
this.listLoading = true
requestFN(
'/corpMenu/editicon',
{
MENU_ID: this.form.MENU_ID,
MENU_ICON: MENU_ICON
}
).then((data) => {
this.listLoading = false
this.dialogEditIcon = false
this.getList(this.MENU_ID)
}).catch((e) => {
this.listLoading = false
})
},
generateIconCode(symbol) {
return `<svg-icon icon-class="${symbol}" />`
},
getTreeList() {
this.treeLoading = true
requestFN(
'corpMenu/listAllMenu',
{
}
).then((data) => {
this.treeLoading = false
this.treeData = JSON.parse(data.zTreeNodes)
}).catch((e) => {
this.treeLoading = false
})
},
getList(MENU_ID) {
this.listLoading = true
this.varList = []
this.MENU_ID = MENU_ID
requestFN(
'corpMenu/list',
{
MENU_ID: this.MENU_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.menuList
this.pd = data.pd || []
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
resetForm() {
this.form = {
MENU_ID: '', // ID
MENU_TYPE: '1', //
MENU_STATE: 1, //
PARENT_ID: '', // ID
MENU_NAME: '', //
MENU_URL: '', //
COMPONENT: '', //
SHIRO_KEY: '(无)', //
SHOW_MODEL: '', //
MENU_ORDER: '' //
}
},
hasButton: function() {
var keys = 'menu:add,menu:del,menu:edit'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.menufhadminadd
this.del = data.menufhadmindel
this.edit = data.menufhadminedit
}).catch((e) => {
this.listLoading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.el-dialog__body{
padding: 0;
background: red;
}
.mark_up{
margin-bottom:20px;
margin-left: 110px;
}
.icons-container {
margin: 0;
overflow: hidden;
.grid {
position: relative;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.icon-item {
margin-bottom: 10px;
height: 70px;
text-align: center;
width: 100px;
float: left;
font-size: 24px;
color: #24292e;
cursor: pointer;
span {
display: block;
font-size: 14px;
margin-top: 10px;
}
}
.disabled {
pointer-events: none;
}
}
</style>

View File

@ -0,0 +1,10 @@
const req = require.context('../../../icons/svg', false, /\.svg$/)
const requireAll = requireContext => requireContext.keys()
const re = /\.\/(.*)\.svg/
const svgIcons = requireAll(req).map(i => {
return i.match(re)[1]
})
export default svgIcons

View File

@ -0,0 +1,120 @@
<template>
<div class="app-container">
<el-tabs v-model="activeTab" type="border-card" @tab-click="handleClick">
<el-tab-pane v-for="role in roleList" :name="role.role_ID" :key="role.role_ID" :label="role.role_NAME">
<el-table
v-loading="listLoading"
:data="roleList_z"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000',
'padding':'14px 0'
}"
:row-style="{'height':'54px'}"
border
fit
highlight-current-row>
<el-table-column type="index" label="序号" fixed width="50" align="center"/>
<el-table-column prop="role_NAME" label="角色" fixed width="200" show-overflow-tooltip/>
<el-table-column v-for="item in buttonlist" :key="item.FHBUTTON_ID" :label="item.NAME" :render-header="labelHead" align="center">
<template slot-scope="{row}">
<template v-for="(varRb,vsRb) in roleFhbuttonlist">
<template v-if="row.role_ID == varRb.ROLE_ID && item.FHBUTTON_ID == varRb.BUTTON_ID">
<span :key="vsRb" style="display: none;">{{ switchModel[row.role_ID + '_' + item.FHBUTTON_ID] = true }}</span>
</template>
</template>
<el-switch v-model="switchModel[row.role_ID + '_' + item.FHBUTTON_ID]" @change="upRb(row.role_ID,item.FHBUTTON_ID)"/>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { requestFN } from '@/utils/request'
export default {
data() {
return {
activeTab: '',
roleList: [], // list ()
roleList_z: [], // list
buttonlist: [], // list
roleFhbuttonlist: [], // list
pd: [], // map
ROLE_ID: '1', // ID
switchModel: {},
edit: false,
listLoading: false //
}
},
created() {
this.getList(this.ROLE_ID)
},
methods: {
labelHead(h, { column, index }) {
const l = column.label.length
const f = 34 //
column.minWidth = f * l
return h('div', { class: 'table-head', style: { width: '100%' }}, [column.label])
},
handleClick(tab) {
this.ROLE_ID = tab.name
this.roleList_z = []
this.getList(this.ROLE_ID)
},
getList(ROLE_ID) {
this.listLoading = true
this.ROLE_ID = ROLE_ID
requestFN(
'/buttonrights/list',
{
ROLE_ID: ROLE_ID
}
).then((data) => {
this.roleList = data.roleList
this.roleList_z = data.roleList_z
this.buttonlist = data.buttonlist
this.roleFhbuttonlist = data.roleFhbuttonlist
this.pd = data.pd
this.ROLE_ID = data.pd.ROLE_ID
this.activeTab = data.pd.ROLE_ID
this.hasButton()
this.listLoading = false
}).catch((e) => {
this.listLoading = false
})
},
hasButton: function() {
var keys = 'buttonrights:edit'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.edit = data.buttonrightsfhadminedit
}).catch((e) => {
this.listLoading = false
})
},
upRb: function(ROLE_ID, FHBUTTON_ID) {
requestFN(
'/buttonrights/upRb',
{
ROLE_ID: ROLE_ID,
BUTTON_ID: FHBUTTON_ID
}
).then((data) => {
this.switchModel = {}
this.roleFhbuttonlist = []
this.getList(this.activeTab)
}).catch((e) => {
})
}
}
}
</script>

View File

@ -0,0 +1,3 @@
<template>
<router-view />
</template>

View File

@ -0,0 +1,420 @@
<template>
<div class="app-container">
<!-- <div class="filter-container">-->
<!-- <el-button-group>-->
<!-- &lt;!&ndash; <el-button type="primary" icon="el-icon-document-add" @click="handleAdd(0)"></el-button>&ndash;&gt;-->
<!-- &lt;!&ndash; <el-button type="primary" icon="el-icon-edit" @click="handleEdit()"></el-button>&ndash;&gt;-->
<!-- &lt;!&ndash; <el-button v-if="ROLE_ID!=1" type="primary" icon="el-icon-delete" @click="handleDelete()"></el-button>&ndash;&gt;-->
<!-- <el-button type="primary" icon="el-icon-collection-tag" @click="handleTree('listAllMenuV2',activeTab)"></el-button>-->
<!-- </el-button-group>-->
<!-- </div>-->
<el-tabs v-model="activeTab" type="border-card" @tab-click="handleClick">
<el-tab-pane v-for="role in roleList" :name="role.role_ID" :key="role.role_ID" :label="role.role_NAME">
<el-table
v-loading="listLoading"
:data="roleList_z"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
border
fit
highlight-current-row>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="role_NAME" label="角色" width="180" />
<el-table-column prop="rnumber" label="编码" />
<el-table-column label="增" align="center" width="60">
<template slot-scope="{row}">
<el-button icon="el-icon-document-add" circle @click="handleTree('b4ButtonV2',row.role_ID,'add_qx')" />
</template>
</el-table-column>
<el-table-column label="删" align="center" width="60">
<template slot-scope="{row}">
<el-button icon="el-icon-delete" circle @click="handleTree('b4ButtonV2',row.role_ID,'del_qx')"/>
</template>
</el-table-column>
<el-table-column label="改" align="center" width="60">
<template slot-scope="{row}">
<el-button icon="el-icon-edit" circle @click="handleTree('b4ButtonV2',row.role_ID,'edit_qx')"/>
</template>
</el-table-column>
<el-table-column label="查" align="center" width="60">
<template slot-scope="{row}">
<el-button icon="el-icon-view" circle @click="handleTree('b4ButtonV2',row.role_ID,'cha_qx')"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="290">
<template slot-scope="scope">
<el-button type="success" icon="el-icon-collection-tag" size="mini" @click="handleTree('listAllMenuV2',scope.row.role_ID)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleUpdate(scope.row.role_ID, scope.row.role_NAME, scope.row.dept_TYPE, scope.row.primarynum, scope.row.level)">编辑</el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(scope.row.role_ID, scope.row.role_NAME)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<div class="page-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate(activeTab)"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getRoleList(ROLE_ID)" />
</div>
<el-dialog :visible.sync="dialogFormAdd" :title="dialogType==='edit'?'修改':'新增'" width="600px">
<el-form ref="roleForm" :model="form" :rules="formRules" label-width="120px" style="width: 500px;">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" autocomplete="off" placeholder="这里输入名称..." />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormAdd = false"> </el-button>
<el-button type="primary" @click="confirmRole"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible" :title="dialogType==='edit'?'修改':'新增'" width="600px">
<el-form ref="roleForm" :model="form" :rules="formRules" label-width="120px" style="width: 500px;">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" autocomplete="off" placeholder="这里输入名称..." />
</el-form-item>
<el-form-item label="单位类型" prop="dept_TYPE">
<el-select ref="refDeptType" v-model="form.dept_TYPE" placeholder="请选择" class="filter-item">
<el-option v-for="item in unitTypeList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />
</el-select>
</el-form-item>
<!-- <el-form-item label="是否为主账号" prop="primarynum">-->
<!-- <el-select v-model="form.primarynum" placeholder="请选择" class="filter-item">-->
<!-- <el-option v-for="item in statearr" :key="item.value" :label="item.label" :value="item.value" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="用户查看等级" prop="roleLevel">
<el-select v-model="form.roleLevel" placeholder="请选择" class="filter-item">
<el-option v-for="item in userRoleLevel" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="confirmRole"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormTree" title="授权'新增'权限" width="500px">
<el-tree
ref="tree"
:data="treeData"
:props="defaultProps"
show-checkbox
node-key="id"/>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormTree = false"> </el-button>
<el-button type="primary" @click="confirmTree"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
export default {
components: { Pagination },
data() {
return {
activeTab: '80ecf7dfc9ce49c3a4a7f75269826988',
listLoading: true,
listQuery: {
page: 1,
limit: 20
},
total: 0,
roleList: [], // list ()
roleList_z: [], // list
pd: [], // map
ROLE_ID: '', // ID
dialogFormVisible: false,
dialogFormGroup: false,
dialogType: 'add',
dialogFormTree: false,
dialogFormAdd: false,
form: {
id: '',
parent_id: '',
name: '',
dept_TYPE: '',
primarynum: '', // 01
LEVENL: '',
roleLevel: ''
},
formRules: {
name: [
{ required: true, message: '名不能为空', trigger: 'change' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
],
dept_TYPE: [
{ required: true, message: '请选择单位类型', trigger: 'blur' }
],
// primarynum: [
// { required: true, message: '', trigger: 'blur' }
// ],
roleLevel: [
{ required: true, message: '请选择用户等级', trigger: 'blur' }
]
},
treeData: [],
confirmTreeForm: {
url: '',
id: '',
msg: ''
},
statearr: [
{ value: '0', label: '是' },
{ value: '1', label: '否' }
],
userRoleLevel: [
{ value: '0', label: '公司领导' },
{ value: '1', label: '部门领导' },
{ value: '2', label: '普通员工' }
],
defaultProps: {
children: 'nodes',
label: 'name'
},
unitTypeList: []
}
},
created() {
this.getRoleList(this.ROLE_ID)
this.getDict('3f3a6ac41247438e91df2830765068ba', 'unitTypeList')//
},
methods: {
handleClick(tab) {
this.ROLE_ID = tab.name
this.roleList_z = []
this.listQuery.page = 1
this.form.parent_id = this.ROLE_ID
this.getRoleList(this.ROLE_ID)
},
getRoleList(ROLE_ID, dept_TYPE, primarynum) {
this.listLoading = true
this.ROLE_ID = ROLE_ID
requestFN(
'/corpRrole/list',
{
ROLE_ID: ROLE_ID
}
).then((data) => {
this.listLoading = false
this.ROLE_ID = data.pd.ROLE_ID
this.activeTab = data.pd.ROLE_ID
this.form.dept_TYPE = dept_TYPE
this.form.primarynum = primarynum
this.roleList = data.roleList
this.roleList_z = data.roleList_z.filter((item, index) => index < this.listQuery.limit * this.listQuery.page && index >= this.listQuery.limit * (this.listQuery.page - 1))
this.total = data.roleList_z.length
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd(parentId) {
this.dialogType = 'add'
this.form.name = ''
this.form.parent_id = parentId
this.dialogFormAdd = true
},
handleCreate(parentId) {
this.dialogType = 'add'
this.form.name = ''
this.form.parent_id = parentId
this.dialogFormVisible = true
},
handleEdit(roleId, roleName) {
this.dialogType = 'edit'
if (roleId) {
this.form.id = roleId
this.form.name = roleName
} else {
for (const role of this.roleList) {
if (role.role_ID === this.activeTab) {
this.form.id = role.role_ID
this.form.name = role.role_NAME
}
}
}
this.dialogFormAdd = true
},
handleUpdate(roleId, roleName, dept_TYPE, primarynum, level) {
this.dialogType = 'edit'
if (roleId) {
this.form.id = roleId
this.form.name = roleName
this.form.dept_TYPE = dept_TYPE
this.form.primarynum = primarynum
this.form.roleLevel = level
} else {
for (const role of this.roleList) {
if (role.role_ID === this.activeTab) {
this.form.id = role.role_ID
this.form.name = role.role_NAME
}
}
}
this.dialogFormVisible = true
},
handleDelete(roleId, roleName) {
if (roleId) {
this.form.id = roleId
this.form.name = roleName
} else {
for (const role of this.roleList) {
if (role.role_ID === this.activeTab) {
this.form.id = role.role_ID
this.form.name = role.role_NAME
}
}
}
this.$confirm('确定要删除[' + this.form.name + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/corpRrole/delete',
{
ROLE_ID: this.form.id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.roleList = []
this.roleList_z = []
this.listQuery.page = 1
this.getRoleList('1')
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
handleTree(url, roldId, msg) {
if (url === 'listAllMenuV2') {
this.confirmTreeForm.str = 'saveMenuqx'
} else {
this.confirmTreeForm.str = 'saveB4Button'
}
this.confirmTreeForm.id = roldId
this.confirmTreeForm.msg = msg || ''
this.listLoading = true
requestFN(
'/corpRrole/' + url,
{
ROLE_ID: roldId,
msg: msg
}
).then((data) => {
this.listLoading = false
this.treeData = JSON.parse(data.zTreeNodes)
this.dialogFormTree = true
this.$nextTick(() => {
var checkedMenuIds = []
this.getCheckNode(this.treeData, checkedMenuIds)
this.$refs.tree.setCheckedKeys(checkedMenuIds) //
})
}).catch((e) => {
this.listLoading = false
})
},
confirmRole() {
this.$refs.roleForm.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/corpRrole/' + this.dialogType,
{
ROLE_ID: this.form.id,
ROLE_NAME: this.form.name,
PARENT_ID: this.form.parent_id,
DEPT_TYPE: this.form.dept_TYPE,
PRIMARYNUM: this.form.primarynum,
LEVEL: this.form.roleLevel
}
).then((data) => {
this.listLoading = false
this.dialogFormVisible = false
this.dialogFormAdd = false
this.roleList = []
this.roleList_z = []
this.listQuery.page = 1
if (this.form.parent_id == '') {
this.getRoleList('1')
} else {
this.getRoleList(this.form.parent_id)
}
// if (data.pd.PARENT_ID === '0') {
//
// } else {
// this.getRoleList(this.form.parent_id)
// }
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
confirmTree() {
this.listLoading = true
const ids = this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys())
requestFN(
'/corpRrole/' + this.confirmTreeForm.str,
{
ROLE_ID: this.confirmTreeForm.id,
menuIds: ids.join(','),
msg: this.confirmTreeForm.msg
}
).then((data) => {
this.listLoading = false
this.dialogFormTree = false
}).catch((e) => {
this.listLoading = false
})
},
getCheckNode(menuList, checkedMenuIds) {
if (menuList != null && menuList.length > 0) {
for (let i = 0; i < menuList.length; i++) {
const menu = menuList[i]
if ((menu.nodes == null || menu.nodes.length === 0) && menu.checked.toString() === 'true') {
checkedMenuIds.push(menu.id)
}
if (menu.nodes != null && menu.nodes.length > 0) {
this.getCheckNode(menu.nodes, checkedMenuIds)
}
}
}
},
//
getDict(dicID, listName) {
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: dicID }
).then((data) => {
this[listName] = data.list
}).catch((e) => {
this.listLoading = false
})
}
},
handleGroup(parentId) {
this.dialogType = 'add'
this.form.name = ''
this.form.parent_id = '0'
this.dialogFormGroup = true
}
}
</script>

View File

@ -0,0 +1,258 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="KEYWORDS" placeholder="搜索" class="filter-item" style="width: 200px;"/>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="NAME" label="名称" />
<el-table-column prop="SHIRO_KEY" label="权限标识" />
<el-table-column prop="BZ" label="备注" />
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.FHBUTTON_ID, row.NAME)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" plain @click="batchDel"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<el-dialog :visible.sync="dialogFormEdit" :title="dialogType==='edit'?'修改':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="pd" label-width="110px" style="width: 500px;">
<el-form-item label="按钮名称" prop="NAME">
<el-input v-model="pd.NAME" placeholder="这里输入按钮名称..." />
</el-form-item>
<el-form-item label="权限标识" prop="SHIRO_KEY">
<el-input v-model="pd.SHIRO_KEY" placeholder="这里输入权限标识..." />
</el-form-item>
<el-form-item label="备注说明">
<el-input v-model="pd.BZ" placeholder="这里输入备注说明..." />
</el-form-item>
<el-form-item label="标签代码">
<el-input v-model="code" :autosize="{ minRows: 4}" type="textarea" disabled/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
varList: [],
pd: [],
multipleSelectionAll: [], //
multipleSelection: [], //
dialogFormEdit: false,
dialogType: 'add',
rules: {
NAME: [{ required: true, message: '按钮名称不能为空', trigger: 'blur' }],
SHIRO_KEY: [{ required: true, message: '权限标识不能为空', trigger: 'blur' }]
}
}
},
computed: {
code: {
get() {
if (this.pd.SHIRO_KEY) {
return '<a v-show="' + this.pd.SHIRO_KEY + '" class="btn btn-light btn-sm">按钮</a>'
} else {
return ''
}
},
set(val) {
}
}
},
created() {
this.getList(this.ROLE_ID)
this.hasButton()
},
methods: {
getRowKey(row) {
return row.FHBUTTON_ID
},
handleAdd() {
this.dialogType = 'add'
this.pd = {}
this.code = ''
this.dialogFormEdit = true
},
handleEdit(row) {
this.dialogType = 'edit'
this.pd = Object.assign({}, row)
this.dialogFormEdit = true
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
getList() {
this.listLoading = true
requestFN(
'/fhbutton/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/fhbutton/' + this.dialogType,
{
FHBUTTON_ID: this.pd.FHBUTTON_ID,
NAME: this.pd.NAME,
SHIRO_KEY: this.pd.SHIRO_KEY,
BZ: this.pd.BZ
}
).then((data) => {
this.listLoading = false
this.dialogFormEdit = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id, name) {
this.$confirm('确定要删除[' + name + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/fhbutton/delete',
{
FHBUTTON_ID: id
}
).then(() => {
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.FHBUTTON_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/fhbutton/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
//
hasButton: function() {
var keys = 'fhbutton:add,fhbutton:del,fhbutton:edit'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.fhbuttonfhadminadd
this.del = data.fhbuttonfhadmindel
this.edit = data.fhbuttonfhadminedit
}).catch((e) => {
this.listLoading = false
})
}
}
}
</script>

View File

@ -0,0 +1,384 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="KEYWORDS" placeholder="搜索" class="filter-item" style="width: 200px;"/>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column label="类型名称" >
<template slot-scope="{row}">
<div class="link-type" @click="getList(row.CORPTYPE_ID)">
{{ row.NAME }}
</div>
</template>
</el-table-column>
<el-table-column prop="DESCR" label="备注" />
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.CORPTYPE_ID)"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.CORPTYPE_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button v-show="CORPTYPE_ID != '0'" icon="el-icon-arrow-left" @click="getList(pd.PARENT_ID)"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" plain @click="batchDel"></el-button>
</div>
</div>
<el-dialog :visible.sync="dialogFormEdit" :title="dialogType==='edit'?'修改':'新增'" width="600px">
<el-tag class="mark_up" size="medium">上级类型{{ CORPTYPE_ID == '0' ?'(无) 此项为顶级类型':pd.NAME }}</el-tag>
<el-form ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="类型名称" prop="NAME">
<el-input id="NAME" ref="NAME" v-model="form.NAME" maxlength="255" placeholder="这里输入类型名称..." title="类型名称"/>
</el-form-item>
<el-form-item v-for="(item) in cityDeptList" :key="item.BIANMA" :label="item.NAME">
<el-select v-model="cityMap[item.BIANMA]" placeholder="请选择" @change="$forceUpdate()">
<el-option v-for="dept in item.varList" :key="dept.DEPARTMENT_ID" :label="dept.NAME" :value="dept.DEPARTMENT_ID" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="DESCR">
<el-input id="DESCR" ref="DESCR" v-model="form.DESCR" maxlength="255" placeholder="这里输入备注..." title="备注"/>
</el-form-item>
<el-form-item label="序号" prop="CORPTYPE_ORDER">
<el-input v-model.number="form.CORPTYPE_ORDER" placeholder="这里输入序号..." />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listLoading: true,
add: false,
del: false,
edit: false,
CITY_CODE: '',
KEYWORDS: '',
varList: [],
CORPTYPE_ID: '0', // ID
pd: [],
form: {
CORPTYPE_ID: '',
NAME: '', //
PARENT_ID: '', //
DESCR: '', //
CORPTYPE_ORDER: ''
},
cityMap: {},
cityDeptList: [],
multipleSelectionAll: [], //
multipleSelection: [], //
dialogFormEdit: false,
dialogType: 'add',
rules: {
NAME: [{ required: true, message: '类型名称不能为空', trigger: 'blur' }],
CORPTYPE_ORDER: [
{ required: true, message: '序号不能为空', trigger: 'change' },
{ type: 'number', message: '序号必须为数字' }
]
}
}
},
async created() {
await this.getList(this.CORPTYPE_ID)
},
methods: {
getRowKey(row) {
return row.CORPTYPE_ID
},
//
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList(this.CORPTYPE_ID)
},
//
getList(CORPTYPE_ID) {
return new Promise((resolve) => {
this.listLoading = true
requestFN(
'/corptype/list',
{
KEYWORDS: this.KEYWORDS,
PARENT_ID: CORPTYPE_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.pd = data.pd
this.CORPTYPE_ID = CORPTYPE_ID
this.CITY_CODE = data.CITY_CODE
this.hasButton()
this.pd = data.pd
resolve()
}).catch((e) => {
this.listLoading = false
})
})
},
//
async handleAdd() {
this.dialogType = 'add'
this.resetForm()
this.cityMap = {}
this.form.PARENT_ID = this.CORPTYPE_ID
this.cityDeptList = []
await this.getCity()
this.dialogFormEdit = true
},
//
async handleEdit(ID) {
this.cityMap = {}
this.cityDeptList = []
this.getCity()
this.dialogType = 'edit'
requestFN(
'/corptype/goEdit',
{
CORPTYPE_ID: ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
data.ctodList.map((e) => {
this.cityMap[e.BIANMA.toString()] = e.DEPARTMENT_ID
})
this.dialogFormEdit = true
}).catch((e) => {
this.listLoading = false
})
},
async getCity() {
const data = await this.getDictionarieData(this.CITY_CODE)
const deptMap = {}
deptMap.NAME = data.pd.NAME
deptMap.BIANMA = data.pd.BIANMA
deptMap.varList = await this.getCityDept(deptMap.BIANMA)
this.cityDeptList.push(deptMap)
const countryList = await this.getCountryList(data.pd.DICTIONARIES_ID)
for (let i = 0; i < countryList.length; i++) {
const countryData = await this.getDictionarieData(countryList[i].DICTIONARIES_ID)
const countryDeptMap = {}
countryDeptMap.NAME = countryData.pd.NAME
countryDeptMap.BIANMA = countryData.pd.BIANMA
countryDeptMap.varList = await this.getCountryDept(countryDeptMap.BIANMA)
this.cityDeptList.push(countryDeptMap)
}
},
getCountryList(CITY) {
return new Promise((resolve) => {
requestFN(
'/dictionaries/getLevels',
{
DICTIONARIES_ID: CITY
}
).then((data) => {
resolve(data.list)
}).catch((e) => {
})
})
},
getCityDept(CITY) {
return new Promise((resolve) => {
requestFN(
'/department/listAll',
{
LEVEL: 1,
CATEGORY: 1,
TYPE: 2,
CITY: CITY
}
).then((data) => {
resolve(data.varList)
}).catch((e) => {
})
})
},
getCountryDept(COUNTRY) {
return new Promise((resolve) => {
requestFN(
'/department/listAll',
{
LEVEL: 2,
CATEGORY: 1,
TYPE: 2,
COUNTRY: COUNTRY
}
).then((data) => {
resolve(data.varList)
}).catch((e) => {
})
})
},
getDictionarieData(DICTIONARIES_ID) {
return new Promise((resolve) => {
requestFN(
'/dictionaries/goEdit',
{
DICTIONARIES_ID: DICTIONARIES_ID
}
).then((data) => {
resolve(data)
}).catch((e) => {
})
})
},
//
confirm() {
this.form.cityMap = JSON.stringify(this.cityMap)
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/corptype/' + this.dialogType,
this.form
).then((data) => {
this.listLoading = false
this.dialogFormEdit = false
this.getList(this.CORPTYPE_ID)
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/corptype/delete',
{
CORPTYPE_ID: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList(this.CORPTYPE_ID)
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.CORPTYPE_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/corptype/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList(this.CORPTYPE_ID)
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
//
hasButton: function() {
var keys = 'corptype:add,corptype:del,corptype:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.corptypefhadminadd //
this.del = data.corptypefhadmindel //
this.edit = data.corptypefhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
resetForm() {
this.form = {
CORPTYPE_ID: '',
NAME: '', //
PARENT_ID: '', //
DESCR: '', //
CORPTYPE_ORDER: ''
}
}
}
}
</script>
<style lang="scss" scoped>
.mark_up{
margin-bottom:20px;
margin-left: 110px;
}
</style>

View File

@ -0,0 +1,448 @@
<template>
<div class="icons-container">
<el-container>
<el-aside width="300px" style="background-color:#fff">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
style="margin:10px 0"/>
<el-tree
v-loading="treeLoading"
ref="tree"
:data="treeData"
:props="defaultProps"
:filter-node-method="filterNode"
:load="getTreeChildren"
class="filter-tree"
accordion
lazy
@node-click="handleNodeClick"/>
</el-aside>
<el-main>
<div class="filter-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button v-show="DICTIONARIES_ID != '0'" icon="el-icon-arrow-left" @click="getList(PARENT_ID,1)"></el-button>
</div>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column label="名称">
<template slot-scope="{row}">
<div class="link-type" @click="getList(row.DICTIONARIES_ID,1)">
<svg-icon :icon-class="row.NAME" class-name="disabled" /> {{ row.NAME }} <i class="el-icon-arrow-right" />
</div>
</template>
</el-table-column>
<el-table-column prop="NAME_EN" label="英文" />
<el-table-column prop="BIANMA" label="编码"/>
<el-table-column prop="DICTIONARIES_ID" label="ID"/>
<el-table-column prop="ORDER_BY" label="排序" width="50" align="center"/>
<el-table-column v-if="DICTIONARIES_ID == '0'" prop="VISIBLE" label="企业是否可见" width="70" align="center">
<template slot-scope="{row}">
{{ row.VISIBLE==='1'?'可见':'不可见' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.DICTIONARIES_ID, row.NAME)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
</el-main>
</el-container>
<el-dialog :visible.sync="dialogFormAdd" :title="msg==='edit'?'修改':'新增'" width="580px">
<el-tag class="mark_up" size="medium">上级菜单{{ PARENT_NAME == '0' ?'(无) 此项为顶级菜单':PARENT_NAME }}</el-tag>
<el-form ref="form" :model="form" :rules="rules" label-width="100px" style="width: 500px;">
<el-form-item label="名称" prop="NAME">
<el-input v-model="form.NAME" placeholder="这里输入名称..." />
</el-form-item>
<el-form-item label="英文" prop="NAME_EN">
<el-input v-model="form.NAME_EN" placeholder="这里输入英文名称..." />
</el-form-item>
<el-form-item label="编码" prop="BIANMA">
<el-input v-model="form.BIANMA" :disabled="msg == 'edit'" placeholder="这里输入编码(不重复,禁止修改)" />
</el-form-item>
<el-form-item label="排序" prop="ORDER_BY">
<el-input v-model.number="form.ORDER_BY" placeholder="这里输入排序..." />
</el-form-item>
<el-form-item label="排查表" prop="TBSNAME">
<el-input v-model="form.TBSNAME" placeholder="这里输入表名,多个用逗号分隔(非必录)" />
</el-form-item>
<el-form-item label="关联字段" prop="TBFIELD">
<el-input v-model="form.TBFIELD" placeholder="这里输入关联字段默认BIANMA非必录" />
</el-form-item>
<el-form-item v-if="DICTIONARIES_ID == '0'" label="企业是否可见" prop="VISIBLE">
<el-select v-model="form.VISIBLE" placeholder="请选择">
<el-option
key="1"
label="可见"
value="1"/>
<el-option
key="2"
label="不可见"
value="2"/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="BZ">
<el-input v-model="form.BZ" :autosize="{ minRows: 1}" type="textarea" placeholder="这里输入备注..." />
</el-form-item>
<el-form-item label="禁止删除">
<el-radio-group v-model="form.YNDEL">
<el-radio label="yes"></el-radio>
<el-radio label="no"></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormAdd = false"> </el-button>
<el-button type="primary" @click="confirm()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
export default {
components: { Pagination },
data() {
return {
treeLoading: false,
radio: 3,
form: {
NAME: '',
NAME_EN: '',
BIANMA: '',
ORDER_BY: '',
TBSNAME: '',
TBFIELD: '',
BZ: '',
YNDEL: '',
PARENT_ID: '',
ISDELETE: '',
VISIBLE: '0'
},
rules: {
NAME: [
{ required: true, message: '字典名称不能为空', trigger: 'change' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
],
NAME_EN: [
{ required: true, message: '字典英文名称不能为空', trigger: 'change' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
],
BIANMA: [
{ required: true, message: '字典编码名称不能为空', trigger: 'change' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
],
ORDER_BY: [
{ required: true, message: '字典序号名称不能为空', trigger: 'change' },
{ type: 'number', message: '字典序号必须为数字' }
]
},
filterText: '',
defaultProps: {
children: 'nodes',
label: 'NAME'
},
treeData: [],
dialogFormAdd: false,
dialogEditIcon: false,
varList: [],
listQuery: {
page: 1,
limit: 20
},
total: 0,
DICTIONARIES_ID: '0',
ALL_ID: '0',
PARENT_ID: '0',
PARENT_NAME: '0',
TYPE: 1,
msg: 'add',
add: false,
del: false,
edit: false,
resMsg: ''
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
//
this.dialogFormEdit = false
this.listQuery.page = 1
// this.getMenuList()
this.getList(this.DICTIONARIES_ID, 1)
this.hasButton()
},
methods: {
getRowKey(row) {
return row.FHBUTTON_ID
},
async getTreeChildren(node, resolve) {
if (node.level === 0) {
requestFN(
'/dictionaries/getLevels',
{
DICTIONARIES_ID: 0
}
).then((data) => {
return resolve(data.list)
}).catch((e) => {
})
} else {
requestFN(
'/dictionaries/getLevels',
{
DICTIONARIES_ID: node.data.DICTIONARIES_ID
}
).then((data) => {
resolve(data.list)
}).catch((e) => {
})
}
},
filterNode(value, data) {
if (!value) return true
return data.NAME.indexOf(value) !== -1
},
handleAdd() {
this.dialogFormAdd = true
this.resetForm()
this.form.YNDEL = 'no'
if (this.$refsform !== undefined) {
this.$refs.form.resetFields()
}
this.msg = 'add'
},
//
getMenuList() {
this.listLoading = true
requestFN(
'/dictionaries/listAllDictMent',
{
}
).then((data) => {
this.listLoading = false
this.treeData = JSON.parse(data.zTreeNodes)
})
.catch((e) => {
this.listLoading = false
})
},
getList(DICTIONARIES_ID, TYPE) {
this.listLoading = true
this.TYPE = TYPE
if (TYPE == 1) {
this.DICTIONARIES_ID = DICTIONARIES_ID
} else if (this.ALL_ID == '') {
this.DICTIONARIES_ID = ''
}
requestFN(
'/dictionaries/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
DICTIONARIES_ID: this.DICTIONARIES_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
if (TYPE == 1 || this.ALL_ID != '') {
this.PARENT_ID = data.PARENT_ID
if (data.PARENT_NAME) {
this.PARENT_NAME = data.PARENT_NAME
}
this.ALL_ID = this.DICTIONARIES_ID
} else {
this.DICTIONARIES_ID = '0'
this.PARENT_ID = '0'
}
})
.catch((e) => {
this.listLoading = false
})
},
handleNodeClick(node, data, value) {
this.getList(node.DICTIONARIES_ID, 1)
},
resetForm() {
this.form = {
NAME: '',
NAME_EN: '',
BIANMA: '',
ORDER_BY: '',
TBSNAME: '',
TBFIELD: '',
BZ: '',
YNDEL: '',
PARENT_ID: '',
DICTIONARIES_ID: '',
ISDELETE: '',
VISIBLE: '0'
}
},
confirm() {
this.form.PARENT_ID = this.DICTIONARIES_ID
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/dictionaries/' + this.msg,
this.form
).then((data) => {
if (data.result == 'fail') {
this.$message({
message: data.resMsg,
type: 'error'
})
this.erroMsg = Math.random()
this.$nextTick(() => { this.erroMsg = '' })
return false
}
this.listLoading = false
this.dialogFormAdd = false
// this.getMenuList()
this.getList(this.DICTIONARIES_ID, 1)
this.msg = 'add'
}).catch((e) => {
this.resMsg = e.resMsg
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id, name) {
this.$confirm('确定要删除[' + name + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/dictionaries/delete',
{
DICTIONARIES_ID: id
}
).then((data) => {
if (data.result == 'success') {
this.listLoading = false
// this.getMenuList()
this.getList(this.DICTIONARIES_ID, 1)
}
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
handleEdit(data) {
this.form = {
NAME: data.NAME,
NAME_EN: data.NAME_EN,
BIANMA: data.BIANMA,
ORDER_BY: data.ORDER_BY,
TBSNAME: data.TBSNAME,
TBFIELD: data.TBFIELD,
BZ: data.BZ,
YNDEL: data.YNDEL,
PARENT_ID: data.PARENT_ID,
DICTIONARIES_ID: data.DICTIONARIES_ID,
ISDELETE: data.ISDELETE,
VISIBLE: data.VISIBLE
}
this.dialogFormAdd = true
this.msg = 'edit'
},
hasButton: function() {
var keys = 'dictionaries:add,dictionaries:del,dictionaries:edit'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.dictionariesfhadminadd
this.del = data.dictionariesfhadmindel
this.edit = data.dictionariesfhadminedit
}).catch((e) => {
this.listLoading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.el-dialog__body{
padding: 0;
background: red;
}
.mark_up{
margin-bottom:20px;
margin-left: 90px;
}
.icons-container {
margin: 0;
overflow: hidden;
.grid {
position: relative;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.icon-item {
margin-bottom: 10px;
height: 70px;
text-align: center;
width: 100px;
float: left;
font-size: 24px;
color: #24292e;
cursor: pointer;
span {
display: block;
font-size: 14px;
margin-top: 10px;
}
}
.disabled {
pointer-events: none;
}
}
</style>

View File

@ -0,0 +1,456 @@
<template>
<div class="icons-container">
<el-container>
<el-aside width="300px" style="background-color:#fff">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
style="margin:10px 0"/>
<el-tree
v-loading="treeLoading"
ref="tree"
:data="treeData"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
@node-click="handleNodeClick"/>
</el-aside>
<el-main>
<div class="filter-container">
<div class="filter-lable w80">部门名称</div>
<el-input v-model="keydeptName" clearable placeholder="搜索用户名" class="filter-item" style="width: 200px;"/>
<div class="filter-lable w80">部门级别</div>
<el-select ref="refDeptLevel" v-model="keyDeptLevel" clearable placeholder="请选择部门级别" class="filter-item">
<el-option v-for="item in levelList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />
</el-select>
<div class="filter-lable w80">单位类型</div>
<el-select ref="refDeptType" v-model="keyDeptType" clearable placeholder="请选择单位类型" class="filter-item">
<el-option v-for="item in DEPT_TYPEList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />
</el-select>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</div>
<div class="filter-btn-group">
<div>
<el-button v-show="DEPARTMENT_ID != '0'" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button v-show="DEPARTMENT_ID != '0'" icon="el-icon-arrow-left" @click="getList(form.PARENT_ID)"></el-button>
</div>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column type="index" prop="numb" label="序号" width="50" align="center" />
<el-table-column label="名称" >
<template slot-scope="{row}">
<div class="link-type" @click="getList(row.DEPARTMENT_ID)">{{ row.NAME }}</div>
</template>
</el-table-column>
<el-table-column prop="deptLevelName" label="部门级别"/>
<el-table-column prop="chargeName" label="负责人"/>
<el-table-column prop="leaderName" label="分管领导"/>
<el-table-column prop="DEP_ORDER" label="排序" width="100" />
<el-table-column label="操作" align="center" width="300">
<template slot-scope="{row}">
<el-button v-show="edit && DEPARTMENT_ID != '0'" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.DEPARTMENT_ID)"></el-button>
<el-button v-show="del && DEPARTMENT_ID != '0'" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.DEPARTMENT_ID, row.NAME)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList(DEPARTMENT_ID)" />
</div>
</el-main>
</el-container>
<el-dialog :visible.sync="dialogFormAdd" :title="dialogType==='edit'?'修改':'新增'" width="600px">
<el-tag class="mark_up" size="medium">上级部门{{ DEPARTMENT_ID == '0' ?'(无) 此项为顶级部门':pds.NAME }}</el-tag>
<el-form ref="form" :model="form" :rules="rules" label-width="110px" style="width: 500px;">
<el-form-item label="部门名称" prop="NAME">
<el-input v-model="form.NAME" placeholder="这里输入部门名称..." />
</el-form-item>
<el-form-item label="部门级别" prop="LEVEL">
<el-select v-model="form.LEVEL" placeholder="请选择" class="filter-item">
<el-option v-for="item in levelList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />
</el-select>
</el-form-item>
<el-form-item label="单位类型" prop="DEPT_TYPE">
<el-select v-model="form.DEPT_TYPE" placeholder="请选择" class="filter-item">
<el-option v-for="item in DEPT_TYPEList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />
</el-select>
</el-form-item>
<el-form-item label="部门排序" prop="DEP_ORDER">
<el-input v-model.number="form.DEP_ORDER" placeholder="这里输入部门排序..." />
</el-form-item>
<el-form-item label="部门负责人" prop="HEADMAN">
<el-select v-model="form.IN_CHARGE" placeholder="请选择部门负责人" class="filter-item">
<el-option v-for="item in userAllList" :key="item.USER_ID" :label="item.NAME" :value="item.USER_ID" />
</el-select>
</el-form-item>
<el-form-item label="分管领导" prop="HEADMAN">
<el-select v-model="form.IN_LEADER" placeholder="请选择分管领导" class="filter-item">
<el-option v-for="item in userAllList" :key="item.USER_ID" :label="item.NAME" :value="item.USER_ID" />
</el-select>
</el-form-item>
<el-form-item label="安全管理部门" prop="STATE">
<el-select v-model="form.STATE" placeholder="请选择" class="filter-item">
<el-option v-for="item in options" :key="item.label" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="备注">
<el-input :rows="3" v-model="form.BZ" type="textarea" placeholder="这里输入备注..." />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormAdd = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
name: 'Icons',
components: { Pagination },
directives: { waves },
data() {
return {
listLoading: false, //
treeLoading: false,
dialogFormAdd: false,
dialogEditIcon: false,
dialogType: 'add',
//
filterText: '',
treeData: [],
defaultProps: {
children: 'nodes',
label: 'name'
},
//
varList: [], // list
listQuery: {
page: 1,
limit: 20
},
total: 0,
keydeptName: '',
keyDeptLevel: '',
keyDeptType: '',
DEPARTMENT_ID: '0', // ID
PARENT_ID: '0', // ID
pd: [],
options: [{
value: '0',
label: '安监部门'
}, {
value: '2',
label: '消防部门'
}],
form: {
STATE: '',
DEPARTMENT_ID: '', // ID
PARENT_ID: '',
NAME: '',
LEVEL: '',
DEP_ORDER: '', //
HEADMAN: '', //
TEL: '', //
FUNCTIONS: '', //
DEPT_TYPE: '', //
IN_CHARGE: '', //
IN_LEADER: '', //
BZ: '' //
},
pds: [],
levelList: [],
DEPT_TYPEList: [],
add: false,
del: false,
edit: false,
rules: {
NAME: [
{ required: true, message: '部门名称不能为空', trigger: 'change' }
],
LEVEL: [
{ required: true, message: '部门级别不能为空', trigger: 'change' }
],
DEPT_TYPE: [
{ required: true, message: '单位类型不能为空', trigger: 'change' }
],
DEP_ORDER: [
{ required: true, message: '部门序号不能为空', trigger: 'change' },
{ type: 'number', message: '部门序号必须为数字' }
]
},
userAllList: []
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getTreeList()
this.getList(this.DEPARTMENT_ID)
this.getDict()
this.varList = []
},
methods: {
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleNodeClick(node, data, value) {
this.form.PARENT_ID = node.id
this.getList(node.id)
},
handleAdd() {
this.userAllList = []
this.dialogType = 'add'
this.resetForm()
requestFN(
'/department/goAdd',
{
DEPARTMENT_ID: this.DEPARTMENT_ID
}
).then((data) => {
this.form.PARENT_ID = this.DEPARTMENT_ID
this.pds = data.pds || [] //
}).catch((e) => {
})
this.dialogFormAdd = true
},
handleEdit(DEPARTMENT_ID) {
this.dialogType = 'edit'
requestFN(
'/department/goEdit',
{
DEPARTMENT_ID: DEPARTMENT_ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
this.getUserAllList(data.pd.DEPARTMENT_ID)
this.pds = data.pds || [] //
}).catch((e) => {
this.listLoading = false
})
this.dialogFormAdd = true
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/department/' + this.dialogType,
this.form
).then((data) => {
this.listLoading = false
this.dialogFormAdd = false
this.getTreeList()
this.getList(this.DEPARTMENT_ID)
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id, name) {
this.$confirm('确定要删除[' + name + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/department/delete',
{
DEPARTMENT_ID: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.getTreeList()
this.getList(this.DEPARTMENT_ID)
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
getTreeList() {
this.treeLoading = true
requestFN(
'/department/listTree',
{}
).then((data) => {
this.treeLoading = false
this.treeData = JSON.parse(data.zTreeNodes)
}).catch((e) => {
this.treeLoading = false
})
},
getList(DEPARTMENT_ID) {
this.listLoading = true
this.varList = []
this.DEPARTMENT_ID = DEPARTMENT_ID
requestFN(
'/department/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
DEPARTMENT_ID: this.DEPARTMENT_ID,
keydeptName: this.keydeptName,
keyDeptLevel: this.keyDeptLevel,
keyDeptType: this.keyDeptType
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.form.PARENT_ID = data.PARENT_ID
this.total = data.page.totalResult
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
resetForm() {
this.form = {
DEPARTMENT_ID: '', // ID
PARENT_ID: '',
NAME: '',
LEVEL: '',
DEP_ORDER: '', //
HEADMAN: '', //
TEL: '', //
FUNCTIONS: '', //
BZ: '' //
}
},
//
getDict() {
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: '3e057d284c294a48af32948d58e92e3d' }
).then((data) => {
this.levelList = data.list
}).catch((e) => {
this.listLoading = false
})
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: '3f3a6ac41247438e91df2830765068ba' }
).then((data) => {
this.DEPT_TYPEList = data.list
}).catch((e) => {
this.listLoading = false
})
},
hasButton: function() {
var keys = 'department:add,department:del,department:edit'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.departmentfhadminadd
this.del = data.departmentfhadmindel
this.edit = data.departmentfhadminedit
}).catch((e) => {
this.listLoading = false
})
},
getUserAllList(DEPARTMENT_ID) {
requestFN(
'user/listAll',
{ DEPARTMENT_ID: this.form.DEPARTMENT_ID || '0' }
).then((data) => {
this.userAllList = data.userList
}).catch((e) => {
this.listLoading = false
})
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
goKeyReset() {
this.keydeptName = ''
this.keyDeptLevel = ''
this.keyDeptType = ''
// if (this.$refs.refDeptLevel) {
// this.$refs.refDeptLevel.clearHandle()
// }
// if (this.$refs.refDeptType) {
// this.$refs.refDeptType.clearHandle()
// }
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.el-dialog__body{
padding: 0;
background: red;
}
.mark_up{
margin-bottom:20px;
margin-left: 110px;
}
.icons-container {
margin: 0;
overflow: hidden;
.grid {
position: relative;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.icon-item {
margin-bottom: 10px;
height: 70px;
text-align: center;
width: 100px;
float: left;
font-size: 24px;
color: #24292e;
cursor: pointer;
span {
display: block;
font-size: 14px;
margin-top: 10px;
}
}
.disabled {
pointer-events: none;
}
}
</style>

View File

@ -0,0 +1,3 @@
<template>
<router-view />
</template>

View File

@ -0,0 +1,777 @@
<template>
<div class="app-container">
<el-container>
<el-aside width="300px" style="background-color:#fff">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
style="margin:10px 0"/>
<el-tree
v-loading="treeLoading"
ref="tree"
:data="treeData"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
@node-click="handleNodeClick"/>
</el-aside>
<el-main>
<div class="filter-container">
<div class="filter-lable w80">用户名称</div>
<el-input v-model="keyUserName" clearable placeholder="搜索用户名" class="filter-item" style="width: 200px;"/>
<div class="filter-lable w80">职务级别</div>
<el-select ref="refDeptLeven" v-model="keyJobLeven" clearable placeholder="请选择部门级别" class="filter-item" style="width: 200px;" >
<el-option v-for="item in deptTypeLevenAllList" :key="item.BIANMA" :label="item.NAME" :value="item.DICTIONARIES_ID" />
</el-select>
<!-- <div class="filter-lable w80">行政区域</div>-->
<!-- <el-cascader ref="shudi" v-model="keyShudi" :props="areaprops" clearable placeholder="请选择行政区域" style="width: 200px" />-->
<!-- <div class="filter-lable w80">单位类型</div>-->
<!-- <el-select ref="refDeptType" v-model="keyDeptType" clearable placeholder="请选择单位类型" class="filter-item">-->
<!-- <el-option v-for="item in unitTypeList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />-->
<!-- </el-select>-->
<div class="filter-lable w80">部门名称</div>
<el-input v-model="keyDepeName" clearable placeholder="搜索部门名称" class="filter-item" style="width: 200px;"/>
<!-- <div class="filter-lable w80">职务级别</div>-->
<!-- <el-select ref="refJobLeven" v-model="keyJobLeven" clearable placeholder="请选择" class="filter-item">-->
<!-- <el-option v-for="item in jobTypeAllList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />-->
<!-- </el-select>-->
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
<el-button v-waves v-if="LOGIN_USER === '1'" class="filter-item" type="warning" icon="el-icon-warning" size="mini" plain @click="resetPassword">
一键密码重置
</el-button>
</div>
<el-table
ref="multipleTable"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="USERNAME" label="用户名" />
<el-table-column prop="NAME" label="姓名" />
<el-table-column prop="SEX" label="性别">
<template slot-scope="{row}">
<span v-if="row.SEX =='0'"></span>
<span v-if="row.SEX =='1'"></span>
</template>
</el-table-column>
<el-table-column prop="DEPARTMENT_NAME" label="部门" />
<el-table-column prop="jobLevenName" label="职务级别" />
<el-table-column prop="STATUS" label="状态" >
<template slot-scope="{row}">
<span v-if="row.STATUS =='0'"></span>
<span v-if="row.STATUS =='1'"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="400">
<template slot-scope="{row}">
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row)"></el-button>
<el-button v-show="edit" type="success" icon="el-icon-view" size="mini" @click="resetPwd(row.USER_ID)"></el-button>
<el-button v-show="edit && row.STATUS === '99'" type="warning" icon="el-icon-unlock" size="mini" @click="unLockUser(row.USER_ID, row.NAME)"></el-button>
<el-button v-show="row.STATUS== 0" type="primary" icon="el-icon-edit" size="mini" @click="handleEditStatus(row,'1', row.USER_ID)"></el-button>
<el-button v-show="row.STATUS== 1" type="primary" icon="el-icon-edit" size="mini" @click="handleEditStatus(row,'0', row.USER_ID)"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.USER_ID,row.USERNAME)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<template >
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" plain @click="makeAll('0')"></el-button>
</template>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
</el-main>
</el-container>
<el-dialog v-loading="editloading" :visible.sync="dialogFormEdit" :title="dialogType==='editUser'?'修改':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="pd" label-width="110px" style="width: 500px;">
<el-form-item label="角色" prop="ROLE_ID">
<el-select v-model="pd.ROLE_ID" multiple placeholder="请选择角色">
<el-option v-for="item in roleList" :key="item.role_ID" :label="item.role_NAME" :value="item.role_ID" />
</el-select>
</el-form-item>
<el-form-item label="用户名" prop="USERNAME">
<el-input v-model="pd.USERNAME" :disabled="dialogType == 'editUser'" placeholder="这里输入用户名..." />
</el-form-item>
<el-form-item label="姓名" prop="NAME">
<el-input v-model="pd.NAME" placeholder="这里输入姓名..." />
</el-form-item>
<el-form-item v-if="dialogType != 'editUser'" label="密码" prop="PASSWORD">
<el-input v-model="pd.userPASSWORD" show-password placeholder="这里输入密码..." />
</el-form-item>
<el-form-item label="性别" prop="SEX">
<el-radio v-model="pd.SEX" :label="'0'"></el-radio>
<el-radio v-model="pd.SEX" :label="'1'"></el-radio>
</el-form-item>
<el-form-item label="手机号" prop="PHONE">
<el-input v-model="pd.PHONE" placeholder="这里输入手机号..." />
</el-form-item>
<!-- <el-form-item label="部门级别" prop="deptTypeID"> &lt;!&ndash;目的是选择部门到这个级别 &ndash;&gt;-->
<!-- <el-select v-model="pd.deptTypeID" placeholder="请选择" class="filter-item" >-->
<!-- <el-option v-for="item in deptTypeLevenAllList" :key="item.BIANMA" :label="item.NAME" :value="item.DICTIONARIES_ID" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="单位部门" prop="DEPARTMENT_ID">
<SelectTree
v-if="dialogFormEdit"
ref="deptTree"
:clearable="false"
:options="deptTreeData"
:props="deptDefaultProps"
v-model="pd.DEPARTMENT_ID"
placeholder="请选择部门"
/>
</el-form-item>
<el-form-item label="行政区域" prop="shudi"> <!--河北省的就可以 -->
<el-cascader v-if="dialogFormEdit" id="shudi" ref="shudi" v-model="pd.shudi" :props="areaprops" placeholder="请选择省市县" style="width: 100%" />
</el-form-item>
<el-form-item label="职务级别" prop="JOB_LEVEL">
<el-select ref="refJobLevel" v-model="pd.JOB_LEVEL" placeholder="请选择" class="filter-item">
<el-option v-for="item in deptTypeLevenAllList" :key="item.BIANMA" :label="item.NAME" :value="item.DICTIONARIES_ID" />
</el-select>
</el-form-item>
<!-- 相关方的业务需求,是否为审核人员.如果为是的情况,就是可以在入场培训中选择 -->
<el-form-item label="是否审核人员" prop="ISASSESS">
<el-radio v-model="pd.ISASSESS" :label="'1'"></el-radio>
<el-radio v-model="pd.ISASSESS" :label="'0'"></el-radio>
</el-form-item>
<el-form-item label="职务" prop="JOB">
<el-input v-model="pd.JOB" placeholder="这里输入职务..." />
</el-form-item>
<el-form-item label="邮箱" prop="EMAIL">
<el-input v-model="pd.EMAIL" placeholder="这里输入邮箱..." />
</el-form-item>
<el-form-item label="排序" prop="SORT">
<el-input v-model.number="pd.SORT" placeholder="这里输入排序..." />
</el-form-item>
<el-form-item label="备注">
<el-input v-model="pd.BZ" type="textarea" placeholder="这里输入备注说明..." />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
var hasUser = (rule, value, callback) => {
if (this.dialogType != 'editUser') {
requestFN(
'/user/hasUser',
{
USERNAME: value,
tm: new Date().getTime()
}
).then((data) => {
if (data.result == 'success') {
callback()
} else {
callback(new Error('用户名重复'))
}
}).catch((e) => {
})
} else {
callback()
}
}
var hasEmail = (rule, value, callback) => {
if (value) {
requestFN(
'/user/hasEmail',
{
EMAIL: value,
USERNAME: this.pd.USERNAME
}
).then((data) => {
if (data.result == 'success') {
callback()
} else {
callback(new Error('邮箱重复'))
}
}).catch((e) => {
})
} else {
callback()
}
}
return {
LOGIN_USER: JSON.parse(sessionStorage.getItem('user')).USER_ID,
treeLoading: false,
treeData: [],
defaultProps: {
children: 'nodes',
label: 'name'
},
listQuery: {
page: 1,
limit: 20
},
total: 0,
varList: [],
filterText: '',
keyUserName: '',
keyDeptLeven: '',
keyShudi: '',
keyDeptType: '',
keyDepeName: '',
keyJobLeven: '',
dialogFormEdit: false,
editloading: false,
dialogType: 'add',
rules: {
EMAIL: [
{ required: false, message: '请输入邮箱', trigger: 'blur' },
{
pattern: /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/,
message: '请输入正确的邮箱'
},
{ validator: hasEmail, trigger: 'blur' }
],
ROLE_ID: [
{ required: true, message: '角色不能为空', trigger: 'blur' }
],
USERNAME: [
{ required: true, message: '用户名不能为空', trigger: 'blur' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' },
{ validator: hasUser, trigger: 'blur' }
],
NAME: [
{ required: true, message: '姓名不能为空', trigger: 'blur' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
],
SEX: [
{ required: true, message: '请选择性别', trigger: 'blur' }
],
PHONE: [
{ required: true, message: '手机号不能为空', trigger: 'blur' },
{ min: 11, max: 11, message: '请输入11位手机号码', trigger: 'blur' },
{
pattern: /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/,
message: '请输入正确的手机号码'
}
],
deptTypeID: [
{ required: true, message: '请选择部门级别', trigger: 'blur' }
],
shudi: [
{ required: true, message: '请选择属地', trigger: 'blur' }
],
JOB_LEVEL: [
{ required: true, message: '请选择职务级别', trigger: 'blur' }
],
DEPARTMENT_ID: [
{ required: true, message: '请选择单位部门', trigger: 'blur' }
],
ISASSESS: [
{ required: true, message: '请选择是否审核人员', trigger: 'blur' }
]
},
pd: {
ROLE_ID: [], // ID
USERNAME: '', //
NAME: '', //
userPASSWORD: 'Aa@123456789', //
SEX: '', // 01
PHONE: '', //
deptTypeID: '', //
DEPARTMENT_ID: '', //
shudi: '',
BZ: '', //
EMAIL: '', //
SORT: '', //
PROVINCE: '', //
CITY: '', //
COUNTRY: '', //
VILLAGE: '', //
JOB_LEVEL: '', //
ISASSESS: '',
JOB: ''//
},
roleList: [],
multipleSelectionAll: [], //
multipleSelection: [], //
fromExcel: false, // excel
toExcel: false, // excel
add: false, //
del: false, //
edit: false, //
hasUserRet: false,
deptTypeLevenAllList: [], //
jobTypeAllList: [], //
deptTreeData: [], // ,
deptDefaultProps: {
value: 'id',
children: 'nodes',
label: 'name'
},
unitTypeList: [],
areaprops: {
lazy: true,
lazyLoad(node, resolve) {
setTimeout(() => {
const areaLeven = node.level
var areaParID = ''
if (areaLeven == '0') {
areaParID = 'e725d2a91b8248f4b8f49889038df7de'
} else {
areaParID = node.data.id
}
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: areaParID }
).then((data) => {
const nodes = data.list.map(item => ({
value: item.DICTIONARIES_ID,
label: item.NAME.toString(),
id: item.DICTIONARIES_ID.toString(),
leaf: areaLeven > 2
}))
resolve(nodes) // resolve
}).catch((e) => {
this.editloading = false
this.listLoading = false
})
}, 500)
}
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getList()
this.hasButton()
this.getDict('3e057d284c294a48af32948d58e92e3d', 'deptTypeLevenAllList')
this.getDict('3f3a6ac41247438e91df2830765068ba', 'unitTypeList')
this.getDepartTreeList()
this.getDict('f1fbdf9a286342ae98e6a56bf823f221', 'jobTypeAllList')
this.goAddUser()
this.getTreeList()
},
methods: {
getList() {
this.listLoading = true
requestFN(
'/user/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
keyUserName: this.keyUserName,
keyDeptLeven: this.keyDeptLeven,
keyShudi: this.keyShudi,
keyDeptType: this.keyDeptType,
keyDepeName: this.keyDepeName,
keyJobLeven: this.keyJobLeven,
DEPARTMENT_ID: this.DEPARTMENT_ID,
PROVINCE: this.keyShudi[0] || '',
CITY: this.keyShudi[1] || '',
COUNTRY: this.keyShudi[2] || '',
VILLAGE: this.keyShudi[3] || ''
}
).then((data) => {
this.listLoading = false
this.varList = data.userList
this.total = data.page.totalResult
})
.catch((e) => {
this.listLoading = false
})
},
goKeyReset() {
this.keyUserName = ''
this.keyDeptLeven = ''
this.keyShudi = ''
this.keyDeptType = ''
this.keyDepeName = ''
this.keyJobLeven = ''
this.getList()
if (this.$refs.refDeptLeven) {
this.$refs.refDeptLeven.clearHandle()
}
if (this.$refs.shudi) {
this.$refs.shudi.clearHandle()
}
if (this.$refs.refDeptType) {
this.$refs.refDeptType.clearHandle()
}
if (this.$refs.refJobLeven) {
this.$refs.refJobLeven.clearHandle()
}
},
goAddUser() { //
requestFN(
'/user/goAddUser',
{
}
).then((data) => {
this.roleList = data.roleList
})
.catch((e) => {
})
},
unLockUser(id, name) {
this.$confirm('确定要解锁 [ 帐号:' + name + ' ] 吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/unLockUser',
{
USER_ID: id
}
).then(() => {
this.$message({
message: '解锁成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
handleAdd() {
this.dialogFormEdit = true
this.pd = {}
this.dialogType = 'saveUser'
this.pd.PASSWORD = 'Aa@123456789'
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
if (this.pd.ROLE_ID) {
var roleIDs = ''
this.pd.ROLE_ID.forEach((item) => {
roleIDs += item + ';'
})
this.pd.roleIDs = roleIDs
}
if (this.pd.shudi) {
this.pd.PROVINCE = this.pd.shudi[0]
this.pd.CITY = this.pd.shudi[1]
this.pd.COUNTRY = this.pd.shudi[2] || ''
this.pd.VILLAGE = this.pd.shudi[3] || ''
}
requestFN(
'/user/' + this.dialogType,
this.pd
).then((data) => {
this.listLoading = false
this.dialogFormEdit = false
this.varList = []
this.$refs.deptTree.clearHandle()
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id, name) {
this.$confirm('确定要删除[' + name + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/deleteUser',
{
USER_ID: id
}
).then((data) => {
if (data.result == 'success') {
this.listLoading = false
this.getList()
}
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
makeAll(msg) {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.USER_ID
}).join(',')
var tishi = ''
if (msg == '0') {
tishi = '确定要删除选中的数据吗?'
} else if (msg == '1') {
tishi = '确定要给选中的用户发送站内信吗?'
} else {
this.$message({
message: '请选择操作类型...',
type: 'error'
})
return false
}
this.$confirm(tishi, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (msg == '0') {
this.listLoading = true
requestFN(
'/user/deleteAllUser',
{
USER_IDS: ids
}
).then(() => {
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}
}).catch(() => {
})
},
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
async handleEdit(row) {
console.log(row)
this.dialogType = 'editUser'
this.pd = JSON.parse(JSON.stringify(row))
const areaRefID = []
if (this.pd.PROVINCE) {
areaRefID.push(this.pd.PROVINCE)
}
if (this.pd.CITY) {
areaRefID.push(this.pd.CITY)
}
if (this.pd.COUNTRY) {
areaRefID.push(this.pd.COUNTRY)
}
if (this.pd.VILLAGE) {
areaRefID.push(this.pd.VILLAGE)
}
this.$set(this.pd, 'shudi', areaRefID)
const refDeptLevelVal = {}
refDeptLevelVal.id = this.pd.deptLevenlID
const deptRefsValue = {}
deptRefsValue.id = this.pd.DEPARTMENT_ID
var arrString = []
if (this.pd.ROLE_ID != null && this.pd.ROLE_ID != '') {
arrString.push(this.pd.ROLE_ID)
}
if (this.pd.ROLE_IDS != null && this.pd.ROLE_IDS != '' && this.pd.ROLE_IDS != undefined && this.pd.ROLE_IDS != 'undefined') {
//
this.pd.ROLE_IDS = this.pd.ROLE_IDS.substring(0, this.pd.ROLE_IDS.length - 1)
var arrList = this.pd.ROLE_IDS && this.pd.ROLE_IDS != '' ? this.pd.ROLE_IDS.split(';') : ''
// eslint-disable-next-line no-unused-vars
for (const item1 of arrList) { // ID
arrString.push(item1)
}
}
this.pd.ROLE_ID = arrString
this.dialogFormEdit = true
await this.$nextTick()
},
handleEditStatus(row, type) {
const typeName = type == '1' ? '禁用' : '启用'
this.$confirm('确定要' + typeName + '[' + row.USERNAME + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/updateUserStatus',
{
USER_ID: row.USER_ID,
status: type
}
).then((data) => {
if (data.result == 'success') {
this.listLoading = false
this.getList()
}
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
hasButton: function() {
var keys = 'user:add,user:del,user:edit,fhSms,email,fromExcel,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys, tm: new Date().getTime()
}
).then((data) => {
if (data.result == 'success') {
this.add = data.userfhadminadd //
this.del = data.userfhadmindel //
this.edit = data.userfhadminedit //
this.fromExcel = data.fromExcel // excel
this.toExcel = data.toExcel // excel
} else if (data.result == 'exception') {
// showException('', data.exception)//
}
})
.catch((e) => {
this.listLoading = false
})
},
//
getDict(dicID, listName) {
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: dicID }
).then((data) => {
this[listName] = data.list
}).catch((e) => {
this.listLoading = false
})
},
getDepartTreeList() {
this.pd.DEPARTMENT_ID = ''
if (this.$refs.deptTree) {
this.$refs.deptTree.clearHandle()
}
return new Promise((resolve) => {
requestFN(
'/department/listTreeByType'
).then((data) => {
this.deptTreeData = JSON.parse(data.zTreeNodes)
resolve()
}).catch((e) => {
})
})
},
resetPwd(id, name) {
this.$confirm('是否重置密码为Aa@123456789?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/resetPwd',
{
USER_ID: id
}
).then(() => {
this.$message({
message: '重置成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleNodeClick(node, data, value) {
this.DEPARTMENT_ID = node.id
this.getList()
},
resetPassword() {
this.$confirm('一键重置密码,会将所有未修改过密码的用户进行密码重置重置,是否继续?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/user/resetPwdAll',
{}
).then(() => {
this.$message({
message: '重置成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
getTreeList() {
this.treeLoading = true
requestFN(
'/department/listTree',
{}
).then((data) => {
this.treeLoading = false
this.treeData = JSON.parse(data.zTreeNodes)
}).catch((e) => {
this.treeLoading = false
})
}
}
}
</script>

View File

@ -0,0 +1,248 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-position="right" label-width="160px" style="padding:10px 40px">
<el-row>
<el-col :span="24">
<el-form-item label="上传图片">
<el-upload
ref="upload"
:on-preview="handlePictureCardPreview"
:on-change="beforeFileUpload"
:auto-upload="false"
class="avatar-uploader"
action="#"
accept=".jpg,.jpeg,.png"
list-type="picture-card">
<i class="el-icon-plus" />
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img :src="dialogImageUrl" width="100%" alt="">
</el-dialog>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="heightt"/>
<div class="subdy-foot">
<el-row style="text-align: center">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</el-row>
</div>
<!-- <el-dialog :visible.sync="dialogFormEdit" title="请选择位置" width="600px">-->
<!-- <label>坐标<input v-model="lng" disabled><input v-model="lat" disabled></label>-->
<!-- <label><el-input v-model="addressKeyword" placeholder="请输入关键字" style="width: 200px;"/></label>-->
<!-- <baidu-map v-loading="loadingMap" :zoom="zoom" :scroll-wheel-zoom="true" style="height: 400px;width: 100%" @ready="handler" @click="getPoint">-->
<!-- <bm-view style="width: 100%; height:100%; flex: 1"/>-->
<!-- <bm-local-search :keyword="addressKeyword" :auto-viewport="true" style="display: none"/>-->
<!-- </baidu-map>-->
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button @click="dialogFormEdit = false"> </el-button>-->
<!-- <el-button type="primary" @click="setPoint"> </el-button>-->
<!-- </div>-->
<!-- </el-dialog>-->
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import { upload } from '@/utils/upload'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
config: config,
dialogVisible: false,
dialogImageUrl: '',
certificate_files: [],
hImgs: [],
form: {
shudi: [],
CORP_NAME: '',
POSTAL_CODE: '',
CODE: '',
PROVINCE: '',
CITY: '',
COUNTRY: '',
INDUSTRY: '',
ECO_TYPE: '',
ADDRESS_BUSINESS: '',
CORP_STATE: '',
LATITUDE: '',
LONGITUDE: '',
jinweidu: '',
CONTACTS: '',
CONTACTS_PHONE: '',
LR_NAME: '',
LR_MOBILE: '',
AREA_COVERED: '',
EMPLOYEES: '',
CREATE_DATE: '',
REGCAPITAL: '',
TOTALASSETS: '',
SUBORDINATION: '',
SCALE: '',
SCALE_TYPE: ''
},
rules: {
CORP_NAME: [{ required: true, message: '分公司名称不能为空', trigger: 'blur' }],
shudi: [{ required: true, message: '属地不能为空', trigger: 'blur' }],
POSTAL_CODE: [{ required: true, message: '邮政编码不能为空', trigger: 'blur' }],
CODE: [{ required: true, message: '统一社会信用代码不能为空', trigger: 'blur' }],
INDUSTRY: [{ required: true, message: '所属行业不能为空', trigger: 'blur' }],
ECO_TYPE: [{ required: true, message: '经济类型不能为空', trigger: 'blur' }],
ADDRESS_BUSINESS: [{ required: true, message: '企事业单位经营地址不能为空', trigger: 'blur' }],
CORP_STATE: [{ required: true, message: '分公司状态不能为空', trigger: 'blur' }],
jinweidu: [{ required: true, message: '精纬度不能为空', trigger: 'blur' }],
CONTACTS: [{ required: true, message: '主要负责人不能为空', trigger: 'blur' }],
CONTACTS_PHONE: [{ required: true, message: '主要负责人手机号不能为空', trigger: 'blur' }],
LR_NAME: [{ required: true, message: '法定代表人不能为空', trigger: 'blur' }],
LR_MOBILE: [{ required: true, message: '法人手机号不能为空', trigger: 'blur' }],
AREA_COVERED: [{ required: true, message: '占地面积不能为空', trigger: 'blur' }],
EMPLOYEES: [{ required: true, message: '职工人数不能为空', trigger: 'blur' }],
CREATE_DATE: [{ required: true, message: '成立时间不能为空', trigger: 'blur' }],
REGCAPITAL: [{ required: true, message: '注册资金不能为空', trigger: 'blur' }],
TOTALASSETS: [{ required: true, message: '资产总额不能为空', trigger: 'blur' }],
SUBORDINATION: [{ required: true, message: '隶属关系不能为空', trigger: 'blur' }],
SCALE: [{ required: true, message: '规模不能为空', trigger: 'blur' }],
SCALE_TYPE: [{ required: true, message: '是否规模以上不能为空', trigger: 'blur' }]
},
props: { value: 'value', label: 'label', children: 'children', checkStrictly: true },
propsCorpType: { value: 'value', label: 'label', children: 'children', checkStrictly: true },
propsCorpFoType: { value: 'id', id: 'id', label: 'label', children: 'children' },
propsEcoType: { value: 'value', label: 'label', children: 'children', checkStrictly: true },
loadingMap: true,
BMap: '',
map: '',
showMap: false,
addressKeyword: '',
pointLngLat: '',
zoom: 16,
location: '',
lng: '',
lat: '',
dialogFormEdit: false,
qyztList: [],
industryList: [],
economicsList: [],
scaleList: [],
areaprops: {
lazy: true,
lazyLoad(node, resolve) {
setTimeout(() => {
const areaLeven = node.level
var areaParID = ''
if (areaLeven == '0') {
areaParID = 'e725d2a91b8248f4b8f49889038df7de'
} else {
areaParID = node.data.id
}
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: areaParID }
).then((data) => {
const nodes = data.list.map(item => ({
value: item.BIANMA,
label: item.NAME.toString(),
id: item.DICTIONARIES_ID.toString(),
leaf: areaLeven > 1
}))
resolve(nodes) // resolve
}).catch((e) => {})
}, 500)
}
}
}
},
created() {
this.$parent.indexVal && this.getData()
},
methods: {
//
confirm() {
this.uploadImg()
},
beforeFileUpload(file, fileList) {
const types = ['image/jpeg', 'image/jpg', 'image/png']
const isImage = types.includes(file.raw.type)
if (!isImage) {
this.$message.error('上传图片只能是 JPG、JPEG、PNG 格式!')
fileList.pop()
} else {
this.certificate_files.push(file.raw)
}
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
uploadImg() {
const formData = new FormData()
for (var i = 0; i < this.certificate_files.length; i++) {
if (this.certificate_files[i]) {
formData.append('FFILE', this.certificate_files[i])
}
}
console.log(formData.get('FFILE'))
upload(
'/homepage/add',
formData
).then((data) => {
this.goBack()
}).catch((e) => {
this.listLoading = false
})
},
deleteCertificate(index) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/homepage/delete',
{
IMGFILES_ID: index
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.hImgs.splice(index, 1)
}).catch((e) => {
})
}).catch(() => {
})
},
//
goBack() {
this.$parent.activeName = 'IndexList'
},
setPoint() {
this.form.LATITUDE = this.lat
this.form.LONGITUDE = this.lng
this.dialogFormEdit = false
this.form.jinweidu = this.lat + '-' + this.lng
}
}
}
</script>
<style scoped>
.el-divider__text{
color: #2a90d2;
font-size: 15px;
}
.el-radio-group{
margin-left: 20px;
}
</style>

View File

@ -0,0 +1,320 @@
<template>
<div class="app-container">
<div class="hidden-container">
<div class="hidden-right">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-plus" @click="handleAdd">
新增首页图片
</el-button>
</div>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="imgPatn" label="照片" >
<template slot-scope="{row}">
<!-- <viewer>-->
<!-- <img :src="imgurl(row.FILEPATH)" width="100" height="100">-->
<!-- </viewer>-->
<el-image
:src="imgurl(row.FILEPATH)"
:preview-src-list="[imgurl(row.FILEPATH)]"
style="width: 100px; height: 100px"/>
</template>
</el-table-column>
<el-table-column label="操作" align="left" width="150">
<template slot-scope="{row}">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="deleteCertificate(row.IMGFILES_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listLoading: true,
add: true,
del: true,
edit: true,
listQuery: {
page: 1,
limit: 20
},
searchForm: {
CORP_NAME: '',
PROVINCE: '',
CITY: '',
CORP_STATE: '',
CREATTIME: ''
},
total: 0,
varList: [],
qyztList: [],
industryList: [],
countryList: [],
villageList: [],
CITY_CODE: '',
COUNTRY: '',
VILLAGE: '',
config: config,
dialogFormEdit: false,
rules: {
CORP_NAME: [{ required: true, message: '分公司名称不能为空', trigger: 'blur' }],
NEWCORP_NAME: [{ required: true, message: '新分公司名称不能为空', trigger: 'blur' }],
PASSWORD: [{ required: true, message: '分公司密码不能为空', trigger: 'blur' }]
},
updateBranchNameForm: {
CORPINFO_ID: '',
CORP_NAME: '',
NEWCORP_NAME: '',
PASSWORD: ''
}
}
},
created() {
this.getList()
this.getDicList('qyztList', '07c2674470c1498ba1ebd74906b3b518')
this.getDicList('industryList', 'f2598ba72e864eadabf0ca4b664d26b9')
},
methods: {
getRowKey(row) {
return row.CORPINFO_ID
},
//
getQuery() {
this.getList()
},
imgurl(img) {
return config.fileUrl + img
// eslint-disable-next-line no-unreachable
console.log(config.fileUrl + img)
},
//
getList() {
this.listLoading = true
requestFN(
'/homepage/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ ...this.searchForm }
).then((data) => {
this.listLoading = false
this.varList = data.hImgs
this.total = data.page.totalResult
}).catch((e) => {
this.listLoading = false
})
},
getCountryList() {
requestFN(
'/dictionaries/getLevels',
{
DICTIONARIES_ID: this.CITY_CODE
}
).then((data) => {
this.countryList = data.list
}).catch((e) => {
})
},
getVillageList(value, id) {
this.COUNTRY = value
requestFN(
'/dictionaries/getLevels',
{
DICTIONARIES_ID: id
}
).then((data) => {
this.villageList = data.list
}).catch((e) => {
})
},
changeVillage(village) {
this.VILLAGE = village
},
//
handleAdd() {
this.$parent.activeName = 'IndexAdd'
this.$parent.indexVal = ''
},
//
handleEdit(ID) {
this.$parent.activeName = 'IndexAdd'
this.$parent.indexVal = ID
},
enableORDisable(ISUSE, CORPINFO_ID) {
this.$confirm(ISUSE === '0' ? '确定要启用该账户吗?' : '确定要禁用该账户吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/corpinfo/editisuse',
{
CORPINFO_ID,
ISUSE
}
).then(() => {
this.$message({
message: ISUSE === '0' ? '启用成功' : '禁用成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {})
},
//
hasButton: function() {
var keys = 'corpinfo:add,corpinfo:del,corpinfo:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.corpinfofhadminadd //
this.del = data.corpinfofhadmindel //
this.edit = data.corpinfofhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
goKeyReset() {
this.searchForm = {
CORP_NAME: '',
PROVINCE: '',
CITY: '',
CORP_STATE: '',
CREATTIME: ''
}
this.getList()
},
resetPwd(id) {
this.$confirm('确定要重置选中的密码吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/corpinfo/resetPwd',
{
CORPINFO_ID: id
}
).then(() => {
this.$message({
message: '重置成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
//
getDicList(list, DICTIONARIES_ID) {
requestFN(
'/dictionaries/getLevels',
{
DICTIONARIES_ID
}
).then((data) => {
this[list] = data.list
}).catch((e) => {
})
},
translate(list, id) {
for (let i = 0; i < list.length; i++) {
if (list[i].BIANMA === id || list[i].DICTIONARIES_ID === id) {
return list[i].NAME
}
}
},
deleteCertificate(index) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/homepage/delete',
{
IMGFILES_ID: index
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.getList()
this.hImgs.splice(index, 1)
}).catch((e) => {
})
}).catch(() => {
})
},
showBranchName(CORPINFO_ID, CORP_NAME) {
this.$refs.form && this.$refs.form.resetFields()
this.dialogFormEdit = true
this.updateBranchNameForm.CORPINFO_ID = CORPINFO_ID
this.updateBranchNameForm.CORP_NAME = CORP_NAME
},
updateBranchName() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/corpinfo/editname',
{
...this.updateBranchNameForm
}
).then((data) => {
this.$message.success('修改成功')
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => { this.listLoading = false })
} else {
return false
}
})
}
}
}
</script>

View File

@ -0,0 +1,444 @@
<template>
<div>
<el-form label-position="right" label-width="160px" style="padding:10px 40px">
<el-divider content-position="left">基本信息</el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="企业名称" prop="CORP_NAME">
<el-input id="CORP_NAME" ref="CORP_NAME" :disabled="true" v-model="pd.CORP_NAME" maxlength="2000" placeholder="这里输入企业名称..." title="企业名称"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="登录账号">
<el-input id="LOGIN_USER_ID" :disabled="true" v-model="pd.logingUserName" maxlength="255" placeholder="这里输入登录账号..." title="登录账号"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="属地" prop="shudi">
<el-input id="shudiVal" ref="shudiVal" :disabled="true" v-model="pd.shudiVal" maxlength="255" placeholder="请选择省市县..." title="请选择省市县"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="企事业单位注册地址" prop="ADDRESS">
<el-input id="ADDRESS" ref="ADDRESS" :disabled="true" v-model="pd.ADDRESS" maxlength="255" placeholder="企事业单位注册地址..." title="企事业单位注册地址"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="企事业单位经营地址" prop="ADDRESS_BUSINESS">
<el-input id="ADDRESS_BUSINESS" ref="ADDRESS_BUSINESS" :disabled="true" v-model="pd.ADDRESS_BUSINESS" maxlength="255" placeholder="这里输入企事业单位经营地址..." title="企事业单位经营地址"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="企事业单位办公地址" prop="ADDRESS_OFFICE">
<el-input id="ADDRESS_OFFICE" ref="ADDRESS_OFFICE" :disabled="true" v-model="pd.ADDRESS_OFFICE" maxlength="255" placeholder="这里输入企事业单位办公地址..." title="企事业单位办公地址"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="统一社会信用代码" prop="CODE">
<el-input id="code" ref="CODE" :disabled="true" v-model="pd.CODE" maxlength="255" placeholder="这里输入统一社会信用代码..." title="统一社会信用代码"/>
</el-form-item>
</el-col><el-col :span="12">
<el-form-item label="企业状态" prop="CORP_STATE">
<el-input :disabled="true" v-model="pd.CORP_STATE_VAL" maxlength="255" placeholder="这里输入企业状态.." title="企业状态"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="国民经济行业分类" prop="CORP_TYPE">
<el-input :disabled="true" v-model="pd.corpTypeVal" maxlength="255" placeholder="国民经济行业分类.." title="国民经济行业分类"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="成立日期" prop="CREATE_DATE">
<el-date-picker id="CREATE_DATE" ref="CREATE_DATE" :disabled="true" v-model="pd.CREATE_DATE" style="width: 100%" type="date" placeholder="选择成立日期"/></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="注册资金" prop="REGCAPITAL">
<el-input id="REGCAPITAL" ref="REGCAPITAL" :disabled="true" v-model="pd.REGCAPITAL" maxlength="255" placeholder="这里输入注册资金..." title="注册资金"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="固定资产" prop="FIXED_ASSETS">
<el-input id="FIXED_ASSETS" ref="FIXED_ASSETS" :disabled="true" v-model="pd.FIXED_ASSETS" maxlength="255" placeholder="这里输入固定资产..." title="固定资产"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="年利润(万元)" prop="ANNUALPROFIT">
<el-input id="ANNUALPROFIT" ref="ANNUALPROFIT" :disabled="true" v-model="pd.ANNUALPROFIT" maxlength="255" placeholder="这里输入年利润(万元)..." title="年利润(万元)"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="年产值" prop="YEAR_OUTPUT_VALUE">
<el-input id="YEAR_OUTPUT_VALUE" ref="YEAR_OUTPUT_VALUE" :disabled="true" v-model="pd.YEAR_OUTPUT_VALUE" maxlength="255" placeholder="这里输入年产值..." title="年产值" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="企业经济类型" prop="ECO_TYPE">
<el-input :disabled="true" v-model="pd.ECO_TYPE_VAL" maxlength="255" placeholder="这里输入企业经济类型..." title="企业经济类型" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="隶属关系" prop="SUBORDINATION">
<el-input :disabled="true" v-model="pd.SUBORDINATION_VAL" maxlength="255" placeholder="这里输入隶属关系..." title="隶属关系" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="企业类型" prop="CORP_OF_TYPE">
<el-input :disabled="true" v-model="pd.CORP_OF_TYPE_VAL" maxlength="255" placeholder="这里输入企业类型..." title="企业类型" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="行业监管部门" prop="INDUSTRY_DEPARTMENT">
<el-input :disabled="true" v-model="pd.INDUSTRY_DEPARTMENT" maxlength="255" placeholder="这里输入行业监管部门..." title="行业监管部门" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="企业规模" prop="SCALE">
<el-input :disabled="true" v-model="pd.SCALE_VAL" maxlength="255" placeholder="这里输入企业规模..." title="企业规模" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否规模以上" prop="SCALE_TYPE">
<el-radio-group id="SCALE_TYPE" ref="SCALE_TYPE" :disabled="true" v-model="pd.SCALE_TYPE">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="经度/纬度" prop="LONGITUDE">
<el-input id="LONGITUDE" ref="LONGITUDE" :disabled="true" v-model="pd.jinweidu" maxlength="255" placeholder="这里输入纬度..." title="经度/纬度" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="纬度" prop="LATITUDE">
<el-input id="LATITUDE" ref="LATITUDE" :disabled="true" v-model="pd.LATITUDE" maxlength="255" placeholder="这里输入纬度..." title="纬度" />
</el-form-item>
</el-col> -->
</el-row>
<el-divider content-position="left">法定代表人信息</el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="姓名" prop="LR_NAME">
<el-input id="LR_NAME" ref="LR_NAME" :disabled="true" v-model="pd.LR_NAME" maxlength="255" placeholder="这里输入法定代表人姓名..." title="法定代表人姓名"/>
</el-form-item>
</el-col><el-col :span="12">
<el-form-item label="手机号码" prop="LR_PHONE">
<el-input id="LR_PHONE" ref="LR_PHONE" :disabled="true" v-model="pd.LR_PHONE" maxlength="255" placeholder="这里输入法定代表人手机号..." title="法定代表人手机号"/>
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="left">主要负责人信息</el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="姓名" prop="CONTACTS">
<el-input id="CONTACTS" ref="CONTACTS" :disabled="true" v-model="pd.CONTACTS" maxlength="255" placeholder="这里输入主要负责人姓名..." title="主要负责人姓名"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机号码" prop="CONTACTS_PHONE">
<el-input id="CONTACTS_PHONE" ref="CONTACTS_PHONE" :disabled="true" v-model="pd.CONTACTS_PHONE" maxlength="255" placeholder="这里输入主要负责人手机号..." title="主要负责人手机号"/>
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="left">安全负责人信息</el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="姓名" prop="SAFETY_NAME">
<el-input id="SAFETY_NAME" ref="SAFETY_NAME" :disabled="true" v-model="pd.SAFETY_NAME" maxlength="255" placeholder="这里输入安全负责人信息..." title="安全负责人信息"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职务" prop="SAFETY_POST">
<el-input id="SAFETY_POST" ref="SAFETY_POST" :disabled="true" v-model="pd.SAFETY_POST" maxlength="255" placeholder="这里输入安全负责人职务..." title="安全负责人职务"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="单位电话" prop="SAFETY_NUMBER">
<el-input id="SAFETY_NUMBER" ref="SAFETY_NUMBER" :disabled="true" v-model="pd.SAFETY_NUMBER" maxlength="255" placeholder="这里输入安全负责人单位电话..." title="安全负责人单位电话"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机号码" prop="SAFETY_PHONE">
<el-input id="SAFETY_PHONE" ref="SAFETY_PHONE" :disabled="true" v-model="pd.SAFETY_PHONE" maxlength="255" placeholder="这里输入安全负责人手机号码..." title="安全负责人手机号码"/>
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="left">安全标准化</el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="安全标准化等级" prop="AQ_BZ_LEVEL">
<el-select id="AQ_BZ_LEVEL" ref="AQ_BZ_LEVEL" :disabled="true" v-model="pd.AQ_BZ_LEVEL" style="width:100%" clearable placeholder="请选择安全标准化等级">
<el-input id="AQ_BZ_LEVEL" ref="AQ_BZ_LEVEL_VAL" :disabled="true" v-model="pd.AQ_BZ_NO" maxlength="255" placeholder="这里输入安全标准化等级..." title="安全标准化等级"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="安全标准化证书编号" prop="AQ_BZ_NO">
<el-input id="AQ_BZ_NO" ref="AQ_BZ_NO" :disabled="true" v-model="pd.AQ_BZ_NO" maxlength="255" placeholder="这里输入安全标准化证书编号..." title="安全标准化证书编号"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="安全标准化发证单位" prop="AQ_BZ_UNIT">
<el-input id="AQ_BZ_UNIT" ref="AQ_BZ_UNIT" :disabled="true" v-model="pd.AQ_BZ_UNIT" maxlength="255" placeholder="这里输入安全标准化发证单位..." title="安全标准化发证单位"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="安全标准化有效期" prop="AQ_BZ_TIME">
<el-input id="AQ_BZ_TIME" ref="AQ_BZ_TIME" :disabled="true" v-model="pd.AQ_BZ_TIME" maxlength="255" placeholder="这里输入安全标准化有效期..." title="安全标准化有效期"/>
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="left">企业相关属性</el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="有无职业卫生信息" prop="WHETHER_HYGIENE">
<el-radio-group id="WHETHER_HYGIENE" ref="WHETHER_HYGIENE" :disabled="true" v-model="pd.WHETHER_HYGIENE">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有无重大危险源" prop="WHETHER_HAZARDS">
<el-radio-group id="WHETHER_HAZARDS" ref="WHETHER_HAZARDS" :disabled="true" v-model="pd.WHETHER_HAZARDS">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否有稀缺大型应急物资或设施" prop="WHETHER_SCARCE">
<el-radio-group id="WHETHER_SCARCE" ref="WHETHER_SCARCE" :disabled="true" v-model="pd.WHETHER_SCARCE">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否涉及危化品" prop="WHETHER_CHEMICALS">
<el-radio-group id="WHETHER_CHEMICALS" ref="WHETHER_CHEMICALS" :disabled="true" v-model="pd.WHETHER_CHEMICALS">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="有无特种设备" prop="WHETHER_SPECIALEQUIPMENT">
<el-radio-group id="WHETHER_SPECIALEQUIPMENT" ref="WHETHER_SPECIALEQUIPMENT" :disabled="true" v-model="pd.WHETHER_SPECIALEQUIPMENT">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有无特存种作业人员" prop="WHETHER_SPECIALPEOPLE">
<el-radio-group id="WHETHER_SPECIALPEOPLE" ref="WHETHER_SPECIALPEOPLE" :disabled="true" v-model="pd.WHETHER_SPECIALPEOPLE">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否涉及煤气" prop="WHETHER_COALGAS">
<el-radio-group id="WHETHER_COALGAS" ref="WHETHER_COALGAS" :disabled="true" v-model="pd.WHETHER_COALGAS">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否属于消防重点单位" prop="WHETHER_FIRE">
<el-radio-group id="WHETHER_FIRE" ref="WHETHER_FIRE" :disabled="true" v-model="pd.WHETHER_FIRE">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否在有限空间作业" prop="WHETHER_CONFINED">
<el-radio-group id="WHETHER_CONFINED" ref="WHETHER_CONFINED" :disabled="true" v-model="pd.WHETHER_CONFINED">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否存在涉爆粉尘作业" prop="WHETHER_POWDER">
<el-radio-group id="WHETHER_POWDER" ref="WHETHER_POWDER" :disabled="true" v-model="pd.WHETHER_POWDER">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否涉及防雷防静电" prop="WHETHER_LIGHTNING">
<el-radio-group id="WHETHER_LIGHTNING" ref="WHETHER_LIGHTNING" :disabled="true" v-model="pd.WHETHER_LIGHTNING">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否持有放射源" prop="WHETHER_ACTINOGEN">
<el-radio-group id="WHETHER_ACTINOGEN" ref="WHETHER_ACTINOGEN" :disabled="true" v-model="pd.WHETHER_ACTINOGEN">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否涉及液氨制冷" prop="WHETHER_LIQUIDAMMONIA">
<el-radio-group id="WHETHER_LIQUIDAMMONIA" ref="WHETHER_LIQUIDAMMONIA" :disabled="true" v-model="pd.WHETHER_LIQUIDAMMONIA">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否涉及危化品管道" prop="WHETHER_PIPELINE">
<el-radio-group id="WHETHER_PIPELINE" ref="WHETHER_PIPELINE" :disabled="true" v-model="pd.WHETHER_PIPELINE">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="heightt"/>
<div class="subdy-foot">
<el-row type="flex" justify="space-around" style="width:700px; margin:0 auto">
<el-button @click="goBack"> </el-button>
</el-row>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listLoading: true,
pd: {},
corpInfoId: ''
}
},
created() {
this.corpInfoId = this.$parent.indexVal
if (this.corpInfoId) {
this.getCorpInfo(this.$parent.indexVal)
}
},
methods: {
//
getCorpInfo(corpId) {
this.listLoading = true
requestFN(
'/corpinfo/goEdit',
{ tm: new Date().getTime(),
CORPINFO_ID: corpId,
KEYWORDS: this.KEYWORDS
}
).then((data) => {
this.listLoading = false
this.pd = data.pd
if (data.pd.PROVINCE_VAL) {
this.pd.shudiVal = data.pd.PROVINCE_VAL
}
if (data.pd.CITY_VAL) {
this.pd.shudiVal += '/' + data.pd.CITY_VAL
}
if (data.pd.COUNTRY_VAL) {
this.pd.shudiVal += '/' + data.pd.COUNTRY_VAL
}
if (data.pd.VILLAGE_VAL) {
this.pd.shudiVal += '/' + data.pd.VILLAGE_VAL
}
if (data.pd.CORP_TYPE_VAL) {
this.pd.corpTypeVal = data.pd.CORP_TYPE_VAL
}
if (data.pd.CORP_TYPE2_VAL) {
this.pd.corpTypeVal += '/' + data.pd.CORP_TYPE2_VAL
}
if (data.pd.CORP_TYPE3_VAL) {
this.pd.corpTypeVal += '/' + data.pd.CORP_TYPE3_VAL
}
if (data.pd.CORP_TYPE4_VAL) {
this.pd.corpTypeVal += '/' + data.pd.CORP_TYPE4_VAL
}
this.pd.jinweidu = data.pd.LONGITUDE || '0'
this.pd.jinweidu += '-' + data.pd.LATITUDE || '0'
}).catch((e) => {
this.listLoading = false
})
},
//
goBack() {
this.$parent.activeName = 'IndexList'
this.$parent.indexVal = ''
this.corpInfoId = ''
if (this.$refs.form !== undefined) {
this.$refs.form.resetFields()
this.resetForm()
}
}
}
}
</script>
<style scoped>
.el-divider__text{
color: #2a90d2;
font-size: 15px;
}
.el-radio-group{
margin-left: 20px;
}
</style>

View File

@ -0,0 +1,25 @@
<template>
<div class="">
<transition name="fade" mode="out-in">
<component :is="activeName"/>
</transition>
</div>
</template>
<script>
import IndexList from './components/indexList'
import IndexAdd from './components/indexAdd'
import IndexView from './components/index_view'
export default {
components: { IndexList, IndexAdd, IndexView },
data() {
return { // src/views/corpInfo/examine/index.vue
activeName: 'IndexList'
}
},
methods: {
}
}
</script>

View File

@ -0,0 +1,150 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="KEYWORDS" placeholder="搜索" class="filter-item" style="width: 200px;"/>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
</div>
<el-table
ref="multipleTable"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="USERNAME" label="用户名" />
<el-table-column prop="CONTENT" label="事件" />
<el-table-column prop="CZTIME" label="操作时间"/>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.FHLOG_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<template >
<el-button type="danger" icon="el-icon-delete" plain @click="batchDel"></el-button>
</template>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listQuery: {
page: 1,
limit: 20
},
total: 0,
varList: [],
KEYWORDS: ''
}
},
created() {
this.getList()
},
methods: {
getList() {
this.listLoading = true
requestFN(
'/fhlog/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.pd = data.pd
})
.catch((e) => {
this.listLoading = false
})
},
handleDelete(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/fhlog/delete',
{
FHLOG_ID: id
}
).then((data) => {
if (data.result == 'success') {
this.listLoading = false
this.getList()
}
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
getQuery() {
this.getList()
this.$refs.multipleTable.clearSelection()
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.FHLOG_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/fhlog/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
}
}
}
</script>

View File

View File

@ -0,0 +1,407 @@
<template>
<div class="icons-container">
<el-container>
<el-aside width="300px" style="background-color:#fff">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
style="margin:10px 0"/>
<el-tree
v-loading="treeLoading"
ref="tree"
:data="treeData"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
@node-click="handleNodeClick"/>
</el-aside>
<el-main>
<div class="filter-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button v-show="MENU_ID != '0'" icon="el-icon-arrow-left" @click="getList(pd.PARENT_ID)"></el-button>
</div>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column type="index" prop="numb" label="序号" width="50" align="center" />
<el-table-column label="名称" >
<template slot-scope="{row}">
<div class="link-type" @click="getList(row.menu_ID)">
<svg-icon :icon-class="row.menu_ICON" class-name="disabled" /> {{ row.menu_NAME }} <i class="el-icon-arrow-right" />
</div>
</template>
</el-table-column>
<el-table-column label="资源路径">
<template slot-scope="{row}">
{{ row.menu_URL == '#' ? '&nbsp;&nbsp;&nbsp;&nbsp;(无)': row.menu_URL }}
</template>
</el-table-column>
<el-table-column label="权限标识">
<template slot-scope="{row}">
{{ '' == row.shiro_KEY || null == row.shiro_KEY ?'(无)': row.shiro_KEY }}
</template>
</el-table-column>
<el-table-column label="状态" width="100" >
<template slot-scope="{row}">
<template v-if="row.menu_STATE==1">
<el-tag size="mini">
显示
</el-tag>
</template>
<template v-else>
<el-tag size="mini" type="info">
隐藏
</el-tag>
</template>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="{row}">
<el-button v-show="MENU_ID == '0' && edit" type="success" icon="el-icon-picture-outline" size="mini" @click="handleEditIcon(row.menu_ID)"></el-button>
<el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.menu_ID)"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.menu_ID, row.menu_NAME)"></el-button>
</template>
</el-table-column>
</el-table>
</el-main>
</el-container>
<el-dialog :visible.sync="dialogFormAdd" :title="dialogType==='edit'?'修改':'新增'" width="600px">
<el-tag class="mark_up" size="medium">上级菜单{{ MENU_ID == '0' ?'(无) 此项为顶级菜单':pds.MENU_NAME }}</el-tag>
<el-form ref="form" :model="form" :rules="rules" label-width="110px" style="width: 500px;">
<el-form-item label="菜单名称" prop="MENU_NAME">
<el-input v-model="form.MENU_NAME" placeholder="这里输入菜单名称..." />
</el-form-item>
<el-form-item label="菜单链接">
<el-input v-model="form.MENU_URL" placeholder="这里输入菜单链接..." />
</el-form-item>
<el-form-item label="组件路径">
<el-input v-model="form.COMPONENT" placeholder="这里输入组件路径..." />
</el-form-item>
<el-form-item label="权限标识" prop="SHIRO_KEY">
<el-input v-model="form.SHIRO_KEY" placeholder="这里输入权限标识..." />
</el-form-item>
<el-form-item v-show="MENU_ID == '0'" label="显示模式" prop="SHOW_MODEL">
<el-input v-model="form.SHOW_MODEL" placeholder="这里输入显示模式..." />
</el-form-item>
<el-form-item label="菜单序号" prop="MENU_ORDER">
<el-input v-model.number="form.MENU_ORDER" placeholder="这里输入菜单序号..." />
</el-form-item>
<el-form-item label="菜单状态">
<el-radio-group v-model="form.MENU_STATE">
<el-radio :label="1">显示</el-radio>
<el-radio :label="0">隐藏</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormAdd = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogEditIcon" title="编辑图标" width="960px">
<div class="grid">
<div v-for="item of svgIcons" :key="item">
<div class="icon-item" @click="confirmIcon(item)">
<svg-icon :icon-class="item" class-name="disabled" />
<span>{{ item }}</span>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogEditIcon = false"> </el-button>
<!-- <el-button type="primary" @click="confirm"> </el-button>-->
</div>
</el-dialog>
</div>
</template>
<script>
import svgIcons from './svg-icons'
import { requestFN } from '@/utils/request'
export default {
name: 'Icons',
data() {
return {
listLoading: false, //
treeLoading: false,
svgIcons,
radio: 1,
dialogFormAdd: false,
dialogEditIcon: false,
dialogType: 'add',
//
filterText: '',
treeData: [],
defaultProps: {
children: 'nodes',
label: 'name'
},
//
varList: [], // list
MENU_ID: '0', // ID
pd: [],
form: {
MENU_ID: '', // ID
MENU_TYPE: '1', //
MENU_STATE: 1, //
PARENT_ID: '', // ID
MENU_NAME: '', //
MENU_URL: '', //
COMPONENT: '', //
SHIRO_KEY: '(无)', //
SHOW_MODEL: '', //
MENU_ORDER: '' //
},
pds: [],
add: false,
del: false,
edit: false,
rules: {
MENU_NAME: [
{ required: true, message: '菜单名称不能为空', trigger: 'change' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
],
MENU_ORDER: [
{ required: true, message: '菜单序号不能为空', trigger: 'change' },
{ type: 'number', message: '菜单序号必须为数字' }
]
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getTreeList()
this.getList(this.MENU_ID)
},
methods: {
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleNodeClick(node, data, value) {
this.handleEdit(node.id)
},
handleAdd() {
this.dialogType = 'add'
this.resetForm()
requestFN(
'/menu/toAdd',
{
MENU_ID: this.MENU_ID
}
).then((data) => {
this.form.PARENT_ID = this.MENU_ID
this.pds = data.pds || [] //
}).catch((e) => {
})
this.dialogFormAdd = true
},
handleEdit(MENU_ID) {
this.dialogType = 'edit'
requestFN(
'/menu/toEdit',
{
MENU_ID: MENU_ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
this.form.MENU_ID = MENU_ID
this.form.PARENT_ID = data.pd.PARENT_ID
this.pds = data.pds || [] //
}).catch((e) => {
this.listLoading = false
})
this.dialogFormAdd = true
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/menu/' + this.dialogType,
this.form
).then((data) => {
this.listLoading = false
this.dialogFormAdd = false
this.getTreeList()
this.getList(this.MENU_ID)
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id, name) {
this.$confirm('确定要删除[' + name + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/menu/delete',
{
MENU_ID: id
}
).then(() => {
this.listLoading = false
this.getTreeList()
this.getList(this.MENU_ID)
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
handleEditIcon(MENU_ID) {
this.dialogEditIcon = true
this.form.MENU_ID = MENU_ID
},
confirmIcon(symbol) {
const MENU_ICON = symbol
this.listLoading = true
requestFN(
'/menu/editicon',
{
MENU_ID: this.form.MENU_ID,
MENU_ICON: MENU_ICON
}
).then((data) => {
this.listLoading = false
this.dialogEditIcon = false
this.getList(this.MENU_ID)
}).catch((e) => {
this.listLoading = false
})
},
generateIconCode(symbol) {
return `<svg-icon icon-class="${symbol}" />`
},
getTreeList() {
this.treeLoading = true
requestFN(
'/menu/listAllMenu',
{
}
).then((data) => {
this.treeLoading = false
this.treeData = JSON.parse(data.zTreeNodes)
}).catch((e) => {
this.treeLoading = false
})
},
getList(MENU_ID) {
this.listLoading = true
this.varList = []
this.MENU_ID = MENU_ID
requestFN(
'/menu/list',
{
MENU_ID: this.MENU_ID
}
).then((data) => {
this.listLoading = false
this.varList = data.menuList
this.pd = data.pd || []
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
resetForm() {
this.form = {
MENU_ID: '', // ID
MENU_TYPE: '1', //
MENU_STATE: 1, //
PARENT_ID: '', // ID
MENU_NAME: '', //
MENU_URL: '', //
COMPONENT: '', //
SHIRO_KEY: '(无)', //
SHOW_MODEL: '', //
MENU_ORDER: '' //
}
},
hasButton: function() {
var keys = 'menu:add,menu:del,menu:edit'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.menufhadminadd
this.del = data.menufhadmindel
this.edit = data.menufhadminedit
}).catch((e) => {
this.listLoading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.el-dialog__body{
padding: 0;
background: red;
}
.mark_up{
margin-bottom:20px;
margin-left: 110px;
}
.icons-container {
margin: 0;
overflow: hidden;
.grid {
position: relative;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.icon-item {
margin-bottom: 10px;
height: 70px;
text-align: center;
width: 100px;
float: left;
font-size: 24px;
color: #24292e;
cursor: pointer;
span {
display: block;
font-size: 14px;
margin-top: 10px;
}
}
.disabled {
pointer-events: none;
}
}
</style>

View File

@ -0,0 +1,10 @@
const req = require.context('../../../icons/svg', false, /\.svg$/)
const requireAll = requireContext => requireContext.keys()
const re = /\.\/(.*)\.svg/
const svgIcons = requireAll(req).map(i => {
return i.match(re)[1]
})
export default svgIcons

View File

@ -0,0 +1,162 @@
<template>
<div>
<el-form ref="form" :rules="rules" :model="form" label-position="right" label-width="160px" style="padding:10px 40px">
<el-row>
<el-col :span="12">
<el-form-item label="名称" prop="NAME">
<el-input v-model="form.NAME" type="text" placeholder="这里输入名称"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编码" prop="BIANMA">
<el-input v-model="form.BIANMA" placeholder="这里输入编码"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="REPRESENT">
<el-input v-model="form.REPRESENT" type="text" placeholder="描述信息"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="内容" prop="CONTENT">
<el-input v-model="form.CONTENT" type="text" placeholder="这里输入内容"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="heightt"/>
<div class="subdy-foot">
<el-row style="text-align: center">
<el-button @click="goBack"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</el-row>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
// import { upload } from '@/utils/upload'
import waves from '@/directive/waves' // waves directive
import SelectTree from '@/components/SelectTree'
export default {
components: { Pagination, SelectTree },
directives: { waves },
data() {
return {
config: config,
dialogVisible: false,
dialogImageUrl: '',
certificate_files: [],
hImgs: [],
form: {
NAME: '',
BIANMA: '',
REPRESENT: '',
CONTENT: ''
},
rules: {
NAME: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
BIANMA: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
CONTENT: [{ required: true, message: '内容不能为空', trigger: 'blur' }]
},
loadingMap: true,
BMap: '',
map: '',
showMap: false,
addressKeyword: '',
pointLngLat: '',
zoom: 16,
location: '',
lng: '',
lat: '',
dialogFormEdit: false,
qyztList: [],
industryList: [],
economicsList: [],
scaleList: [],
areaprops: {
lazy: true,
lazyLoad(node, resolve) {
setTimeout(() => {
const areaLeven = node.level
var areaParID = ''
if (areaLeven == '0') {
areaParID = 'e725d2a91b8248f4b8f49889038df7de'
} else {
areaParID = node.data.id
}
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: areaParID }
).then((data) => {
const nodes = data.list.map(item => ({
value: item.BIANMA,
label: item.NAME.toString(),
id: item.DICTIONARIES_ID.toString(),
leaf: areaLeven > 1
}))
resolve(nodes) // resolve
}).catch((e) => {})
}, 500)
}
}
}
},
created() {
this.$parent.indexVal && this.getData()
},
methods: {
//
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
requestFN(
this.$parent.indexVal ? '/noticetemplate/edit' : '/noticetemplate/add',
{
...this.form
}
).then((data) => {
this.$message.success('新建成功')
this.goBack()
}).catch((e) => { })
} else {
return false
}
})
},
getData() {
requestFN(
'/noticetemplate/goEdit',
{
NOTICETEMPLATE_ID: this.$parent.indexVal
}
).then((data) => {
this.form = data.pd
}).catch((e) => { })
},
//
goBack() {
this.$parent.activeName = 'IndexList'
},
setPoint() {
this.form.LATITUDE = this.lat
this.form.LONGITUDE = this.lng
this.dialogFormEdit = false
this.form.jinweidu = this.lat + '-' + this.lng
}
}
}
</script>
<style scoped>
.el-divider__text{
color: #2a90d2;
font-size: 15px;
}
.el-radio-group{
margin-left: 20px;
}
</style>

View File

@ -0,0 +1,261 @@
<template>
<div class="app-container">
<div class="hidden-container">
<div class="hidden-right">
<el-button v-waves class="filter-item" type="primary" icon="el-icon-plus" @click="handleAdd">
新建模板
</el-button>
</div>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="NAME" label="模板名称" />
<el-table-column prop="BIANMA" label="编码" />
<el-table-column prop="REPRESENT" label="描述" />
<el-table-column prop="CONTENT" label="内容" />
<el-table-column label="操作" align="left" width="250">
<template slot-scope="{row}">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.NOTICETEMPLATE_ID)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="deleteCertificate(row.NOTICETEMPLATE_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listLoading: true,
add: true,
del: true,
edit: true,
listQuery: {
page: 1,
limit: 20
},
searchForm: {
CORP_NAME: '',
PROVINCE: '',
CITY: '',
CORP_STATE: '',
CREATTIME: ''
},
total: 0,
varList: [],
qyztList: [],
industryList: [],
countryList: [],
villageList: [],
CITY_CODE: '',
COUNTRY: '',
VILLAGE: '',
config: config,
dialogFormEdit: false,
rules: {
CORP_NAME: [{ required: true, message: '分公司名称不能为空', trigger: 'blur' }],
NEWCORP_NAME: [{ required: true, message: '新分公司名称不能为空', trigger: 'blur' }],
PASSWORD: [{ required: true, message: '分公司密码不能为空', trigger: 'blur' }]
},
updateBranchNameForm: {
CORPINFO_ID: '',
CORP_NAME: '',
NEWCORP_NAME: '',
PASSWORD: ''
}
}
},
created() {
this.getList()
this.getDicList('qyztList', '07c2674470c1498ba1ebd74906b3b518')
this.getDicList('industryList', 'f2598ba72e864eadabf0ca4b664d26b9')
},
methods: {
getRowKey(row) {
return row.CORPINFO_ID
},
//
getQuery() {
this.getList()
},
imgurl(img) {
return config.fileUrl + img
// eslint-disable-next-line no-unreachable
console.log(config.fileUrl + img)
},
//
getList() {
this.varList = []
this.listLoading = true
requestFN(
'/noticetemplate/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{ ...this.form }
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
}).catch((e) => {
this.listLoading = false
})
},
//
handleAdd() {
this.$parent.activeName = 'IndexAdd'
this.$parent.indexVal = ''
},
//
handleEdit(ID) {
this.$parent.activeName = 'IndexAdd'
this.$parent.indexVal = ID
},
//
hasButton: function() {
var keys = 'corpinfo:add,corpinfo:del,corpinfo:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.corpinfofhadminadd //
this.del = data.corpinfofhadmindel //
this.edit = data.corpinfofhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
goKeyReset() {
this.searchForm = {
CORP_NAME: '',
PROVINCE: '',
CITY: '',
CORP_STATE: '',
CREATTIME: ''
}
this.getList()
},
resetPwd(id) {
this.$confirm('确定要重置选中的密码吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/corpinfo/resetPwd',
{
CORPINFO_ID: id
}
).then(() => {
this.$message({
message: '重置成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
//
getDicList(list, DICTIONARIES_ID) {
requestFN(
'/dictionaries/getLevels',
{
DICTIONARIES_ID
}
).then((data) => {
this[list] = data.list
}).catch((e) => {
})
},
translate(list, id) {
for (let i = 0; i < list.length; i++) {
if (list[i].BIANMA === id || list[i].DICTIONARIES_ID === id) {
return list[i].NAME
}
}
},
deleteCertificate(index) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/noticetemplate/delete',
{
NOTICETEMPLATE_ID: index
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.getList()
}).catch((e) => {
})
}).catch(() => {
})
},
showBranchName(CORPINFO_ID, CORP_NAME) {
this.$refs.form && this.$refs.form.resetFields()
this.dialogFormEdit = true
this.updateBranchNameForm.CORPINFO_ID = CORPINFO_ID
this.updateBranchNameForm.CORP_NAME = CORP_NAME
},
updateBranchName() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/corpinfo/editname',
{
...this.updateBranchNameForm
}
).then((data) => {
this.$message.success('修改成功')
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => { this.listLoading = false })
} else {
return false
}
})
}
}
}
</script>

View File

@ -0,0 +1,444 @@
<template>
<div>
<el-form label-position="right" label-width="160px" style="padding:10px 40px">
<el-divider content-position="left">基本信息</el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="企业名称" prop="CORP_NAME">
<el-input id="CORP_NAME" ref="CORP_NAME" :disabled="true" v-model="pd.CORP_NAME" maxlength="2000" placeholder="这里输入企业名称..." title="企业名称"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="登录账号">
<el-input id="LOGIN_USER_ID" :disabled="true" v-model="pd.logingUserName" maxlength="255" placeholder="这里输入登录账号..." title="登录账号"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="属地" prop="shudi">
<el-input id="shudiVal" ref="shudiVal" :disabled="true" v-model="pd.shudiVal" maxlength="255" placeholder="请选择省市县..." title="请选择省市县"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="企事业单位注册地址" prop="ADDRESS">
<el-input id="ADDRESS" ref="ADDRESS" :disabled="true" v-model="pd.ADDRESS" maxlength="255" placeholder="企事业单位注册地址..." title="企事业单位注册地址"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="企事业单位经营地址" prop="ADDRESS_BUSINESS">
<el-input id="ADDRESS_BUSINESS" ref="ADDRESS_BUSINESS" :disabled="true" v-model="pd.ADDRESS_BUSINESS" maxlength="255" placeholder="这里输入企事业单位经营地址..." title="企事业单位经营地址"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="企事业单位办公地址" prop="ADDRESS_OFFICE">
<el-input id="ADDRESS_OFFICE" ref="ADDRESS_OFFICE" :disabled="true" v-model="pd.ADDRESS_OFFICE" maxlength="255" placeholder="这里输入企事业单位办公地址..." title="企事业单位办公地址"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="统一社会信用代码" prop="CODE">
<el-input id="code" ref="CODE" :disabled="true" v-model="pd.CODE" maxlength="255" placeholder="这里输入统一社会信用代码..." title="统一社会信用代码"/>
</el-form-item>
</el-col><el-col :span="12">
<el-form-item label="企业状态" prop="CORP_STATE">
<el-input :disabled="true" v-model="pd.CORP_STATE_VAL" maxlength="255" placeholder="这里输入企业状态.." title="企业状态"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="国民经济行业分类" prop="CORP_TYPE">
<el-input :disabled="true" v-model="pd.corpTypeVal" maxlength="255" placeholder="国民经济行业分类.." title="国民经济行业分类"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="成立日期" prop="CREATE_DATE">
<el-date-picker id="CREATE_DATE" ref="CREATE_DATE" :disabled="true" v-model="pd.CREATE_DATE" style="width: 100%" type="date" placeholder="选择成立日期"/></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="注册资金" prop="REGCAPITAL">
<el-input id="REGCAPITAL" ref="REGCAPITAL" :disabled="true" v-model="pd.REGCAPITAL" maxlength="255" placeholder="这里输入注册资金..." title="注册资金"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="固定资产" prop="FIXED_ASSETS">
<el-input id="FIXED_ASSETS" ref="FIXED_ASSETS" :disabled="true" v-model="pd.FIXED_ASSETS" maxlength="255" placeholder="这里输入固定资产..." title="固定资产"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="年利润(万元)" prop="ANNUALPROFIT">
<el-input id="ANNUALPROFIT" ref="ANNUALPROFIT" :disabled="true" v-model="pd.ANNUALPROFIT" maxlength="255" placeholder="这里输入年利润(万元)..." title="年利润(万元)"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="年产值" prop="YEAR_OUTPUT_VALUE">
<el-input id="YEAR_OUTPUT_VALUE" ref="YEAR_OUTPUT_VALUE" :disabled="true" v-model="pd.YEAR_OUTPUT_VALUE" maxlength="255" placeholder="这里输入年产值..." title="年产值" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="企业经济类型" prop="ECO_TYPE">
<el-input :disabled="true" v-model="pd.ECO_TYPE_VAL" maxlength="255" placeholder="这里输入企业经济类型..." title="企业经济类型" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="隶属关系" prop="SUBORDINATION">
<el-input :disabled="true" v-model="pd.SUBORDINATION_VAL" maxlength="255" placeholder="这里输入隶属关系..." title="隶属关系" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="企业类型" prop="CORP_OF_TYPE">
<el-input :disabled="true" v-model="pd.CORP_OF_TYPE_VAL" maxlength="255" placeholder="这里输入企业类型..." title="企业类型" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="行业监管部门" prop="INDUSTRY_DEPARTMENT">
<el-input :disabled="true" v-model="pd.INDUSTRY_DEPARTMENT" maxlength="255" placeholder="这里输入行业监管部门..." title="行业监管部门" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="企业规模" prop="SCALE">
<el-input :disabled="true" v-model="pd.SCALE_VAL" maxlength="255" placeholder="这里输入企业规模..." title="企业规模" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否规模以上" prop="SCALE_TYPE">
<el-radio-group id="SCALE_TYPE" ref="SCALE_TYPE" :disabled="true" v-model="pd.SCALE_TYPE">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="经度/纬度" prop="LONGITUDE">
<el-input id="LONGITUDE" ref="LONGITUDE" :disabled="true" v-model="pd.jinweidu" maxlength="255" placeholder="这里输入纬度..." title="经度/纬度" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="纬度" prop="LATITUDE">
<el-input id="LATITUDE" ref="LATITUDE" :disabled="true" v-model="pd.LATITUDE" maxlength="255" placeholder="这里输入纬度..." title="纬度" />
</el-form-item>
</el-col> -->
</el-row>
<el-divider content-position="left">法定代表人信息</el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="姓名" prop="LR_NAME">
<el-input id="LR_NAME" ref="LR_NAME" :disabled="true" v-model="pd.LR_NAME" maxlength="255" placeholder="这里输入法定代表人姓名..." title="法定代表人姓名"/>
</el-form-item>
</el-col><el-col :span="12">
<el-form-item label="手机号码" prop="LR_PHONE">
<el-input id="LR_PHONE" ref="LR_PHONE" :disabled="true" v-model="pd.LR_PHONE" maxlength="255" placeholder="这里输入法定代表人手机号..." title="法定代表人手机号"/>
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="left">主要负责人信息</el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="姓名" prop="CONTACTS">
<el-input id="CONTACTS" ref="CONTACTS" :disabled="true" v-model="pd.CONTACTS" maxlength="255" placeholder="这里输入主要负责人姓名..." title="主要负责人姓名"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机号码" prop="CONTACTS_PHONE">
<el-input id="CONTACTS_PHONE" ref="CONTACTS_PHONE" :disabled="true" v-model="pd.CONTACTS_PHONE" maxlength="255" placeholder="这里输入主要负责人手机号..." title="主要负责人手机号"/>
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="left">安全负责人信息</el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="姓名" prop="SAFETY_NAME">
<el-input id="SAFETY_NAME" ref="SAFETY_NAME" :disabled="true" v-model="pd.SAFETY_NAME" maxlength="255" placeholder="这里输入安全负责人信息..." title="安全负责人信息"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职务" prop="SAFETY_POST">
<el-input id="SAFETY_POST" ref="SAFETY_POST" :disabled="true" v-model="pd.SAFETY_POST" maxlength="255" placeholder="这里输入安全负责人职务..." title="安全负责人职务"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="单位电话" prop="SAFETY_NUMBER">
<el-input id="SAFETY_NUMBER" ref="SAFETY_NUMBER" :disabled="true" v-model="pd.SAFETY_NUMBER" maxlength="255" placeholder="这里输入安全负责人单位电话..." title="安全负责人单位电话"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机号码" prop="SAFETY_PHONE">
<el-input id="SAFETY_PHONE" ref="SAFETY_PHONE" :disabled="true" v-model="pd.SAFETY_PHONE" maxlength="255" placeholder="这里输入安全负责人手机号码..." title="安全负责人手机号码"/>
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="left">安全标准化</el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="安全标准化等级" prop="AQ_BZ_LEVEL">
<el-select id="AQ_BZ_LEVEL" ref="AQ_BZ_LEVEL" :disabled="true" v-model="pd.AQ_BZ_LEVEL" style="width:100%" clearable placeholder="请选择安全标准化等级">
<el-input id="AQ_BZ_LEVEL" ref="AQ_BZ_LEVEL_VAL" :disabled="true" v-model="pd.AQ_BZ_NO" maxlength="255" placeholder="这里输入安全标准化等级..." title="安全标准化等级"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="安全标准化证书编号" prop="AQ_BZ_NO">
<el-input id="AQ_BZ_NO" ref="AQ_BZ_NO" :disabled="true" v-model="pd.AQ_BZ_NO" maxlength="255" placeholder="这里输入安全标准化证书编号..." title="安全标准化证书编号"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="安全标准化发证单位" prop="AQ_BZ_UNIT">
<el-input id="AQ_BZ_UNIT" ref="AQ_BZ_UNIT" :disabled="true" v-model="pd.AQ_BZ_UNIT" maxlength="255" placeholder="这里输入安全标准化发证单位..." title="安全标准化发证单位"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="安全标准化有效期" prop="AQ_BZ_TIME">
<el-input id="AQ_BZ_TIME" ref="AQ_BZ_TIME" :disabled="true" v-model="pd.AQ_BZ_TIME" maxlength="255" placeholder="这里输入安全标准化有效期..." title="安全标准化有效期"/>
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="left">企业相关属性</el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="有无职业卫生信息" prop="WHETHER_HYGIENE">
<el-radio-group id="WHETHER_HYGIENE" ref="WHETHER_HYGIENE" :disabled="true" v-model="pd.WHETHER_HYGIENE">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有无重大危险源" prop="WHETHER_HAZARDS">
<el-radio-group id="WHETHER_HAZARDS" ref="WHETHER_HAZARDS" :disabled="true" v-model="pd.WHETHER_HAZARDS">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否有稀缺大型应急物资或设施" prop="WHETHER_SCARCE">
<el-radio-group id="WHETHER_SCARCE" ref="WHETHER_SCARCE" :disabled="true" v-model="pd.WHETHER_SCARCE">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否涉及危化品" prop="WHETHER_CHEMICALS">
<el-radio-group id="WHETHER_CHEMICALS" ref="WHETHER_CHEMICALS" :disabled="true" v-model="pd.WHETHER_CHEMICALS">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="有无特种设备" prop="WHETHER_SPECIALEQUIPMENT">
<el-radio-group id="WHETHER_SPECIALEQUIPMENT" ref="WHETHER_SPECIALEQUIPMENT" :disabled="true" v-model="pd.WHETHER_SPECIALEQUIPMENT">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有无特存种作业人员" prop="WHETHER_SPECIALPEOPLE">
<el-radio-group id="WHETHER_SPECIALPEOPLE" ref="WHETHER_SPECIALPEOPLE" :disabled="true" v-model="pd.WHETHER_SPECIALPEOPLE">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否涉及煤气" prop="WHETHER_COALGAS">
<el-radio-group id="WHETHER_COALGAS" ref="WHETHER_COALGAS" :disabled="true" v-model="pd.WHETHER_COALGAS">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否属于消防重点单位" prop="WHETHER_FIRE">
<el-radio-group id="WHETHER_FIRE" ref="WHETHER_FIRE" :disabled="true" v-model="pd.WHETHER_FIRE">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否在有限空间作业" prop="WHETHER_CONFINED">
<el-radio-group id="WHETHER_CONFINED" ref="WHETHER_CONFINED" :disabled="true" v-model="pd.WHETHER_CONFINED">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否存在涉爆粉尘作业" prop="WHETHER_POWDER">
<el-radio-group id="WHETHER_POWDER" ref="WHETHER_POWDER" :disabled="true" v-model="pd.WHETHER_POWDER">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否涉及防雷防静电" prop="WHETHER_LIGHTNING">
<el-radio-group id="WHETHER_LIGHTNING" ref="WHETHER_LIGHTNING" :disabled="true" v-model="pd.WHETHER_LIGHTNING">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否持有放射源" prop="WHETHER_ACTINOGEN">
<el-radio-group id="WHETHER_ACTINOGEN" ref="WHETHER_ACTINOGEN" :disabled="true" v-model="pd.WHETHER_ACTINOGEN">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否涉及液氨制冷" prop="WHETHER_LIQUIDAMMONIA">
<el-radio-group id="WHETHER_LIQUIDAMMONIA" ref="WHETHER_LIQUIDAMMONIA" :disabled="true" v-model="pd.WHETHER_LIQUIDAMMONIA">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否涉及危化品管道" prop="WHETHER_PIPELINE">
<el-radio-group id="WHETHER_PIPELINE" ref="WHETHER_PIPELINE" :disabled="true" v-model="pd.WHETHER_PIPELINE">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="heightt"/>
<div class="subdy-foot">
<el-row type="flex" justify="space-around" style="width:700px; margin:0 auto">
<el-button @click="goBack"> </el-button>
</el-row>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listLoading: true,
pd: {},
corpInfoId: ''
}
},
created() {
this.corpInfoId = this.$parent.indexVal
if (this.corpInfoId) {
this.getCorpInfo(this.$parent.indexVal)
}
},
methods: {
//
getCorpInfo(corpId) {
this.listLoading = true
requestFN(
'/corpinfo/goEdit',
{ tm: new Date().getTime(),
CORPINFO_ID: corpId,
KEYWORDS: this.KEYWORDS
}
).then((data) => {
this.listLoading = false
this.pd = data.pd
if (data.pd.PROVINCE_VAL) {
this.pd.shudiVal = data.pd.PROVINCE_VAL
}
if (data.pd.CITY_VAL) {
this.pd.shudiVal += '/' + data.pd.CITY_VAL
}
if (data.pd.COUNTRY_VAL) {
this.pd.shudiVal += '/' + data.pd.COUNTRY_VAL
}
if (data.pd.VILLAGE_VAL) {
this.pd.shudiVal += '/' + data.pd.VILLAGE_VAL
}
if (data.pd.CORP_TYPE_VAL) {
this.pd.corpTypeVal = data.pd.CORP_TYPE_VAL
}
if (data.pd.CORP_TYPE2_VAL) {
this.pd.corpTypeVal += '/' + data.pd.CORP_TYPE2_VAL
}
if (data.pd.CORP_TYPE3_VAL) {
this.pd.corpTypeVal += '/' + data.pd.CORP_TYPE3_VAL
}
if (data.pd.CORP_TYPE4_VAL) {
this.pd.corpTypeVal += '/' + data.pd.CORP_TYPE4_VAL
}
this.pd.jinweidu = data.pd.LONGITUDE || '0'
this.pd.jinweidu += '-' + data.pd.LATITUDE || '0'
}).catch((e) => {
this.listLoading = false
})
},
//
goBack() {
this.$parent.activeName = 'IndexList'
this.$parent.indexVal = ''
this.corpInfoId = ''
if (this.$refs.form !== undefined) {
this.$refs.form.resetFields()
this.resetForm()
}
}
}
}
</script>
<style scoped>
.el-divider__text{
color: #2a90d2;
font-size: 15px;
}
.el-radio-group{
margin-left: 20px;
}
</style>

View File

@ -0,0 +1,36 @@
<template>
<div class="">
<!-- <transition name="fade" mode="out-in">-->
<!-- <component :is="activeName"/>-->
<!-- </transition>-->
<div>
<IndexList v-show="activeName=='IndexList'" ref="list" />
<IndexAdd v-if="activeName=='IndexAdd'" />
<IndexView v-if="activeName=='IndexView'" />
</div>
</div>
</template>
<script>
import IndexList from './components/indexList'
import IndexAdd from './components/indexAdd'
import IndexView from './components/index_view'
export default {
components: { IndexList, IndexAdd, IndexView },
data() {
return { // src/views/corpInfo/examine/index.vue
activeName: 'IndexList'
}
},
watch: {
activeName(val) {
if (val == 'IndexList') {
this.$refs.list.getList()
}
}
},
methods: {
}
}
</script>

View File

@ -0,0 +1,129 @@
<template>
<div class="app-container">
<template >
在线人数: {{ userCount }}
</template>
<el-table
ref="multipleTable"
:data="userList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="username" label="用户名" />
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="goOutTUser(row.username)" >强制下线</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button type="danger" icon="el-icon-delete" plain >强制下线</el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" />
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import waves from '@/directive/waves' // waves directive
export default {
components: { Pagination, global },
directives: { waves },
data() {
return {
tableData: [
{
numb: '1',
username: ' 15203255716'
}, {
numb: '1',
username: ' 15203255716'
}
],
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
userList: [],
userCount: 0,
onlineAdress: '',
websocketonline: ''
}
},
created() {
this.onlineAdress = sessionStorage.getItem('onlineAdress')
this.getList()
},
methods: {
getList() {
var _this = this
var onlineAdress = this.onlineAdress
this.listLoading = true
if (window.WebSocket) {
this.loading = true
_this.websocketonline = new WebSocket(encodeURI('ws://' + onlineAdress)) // onlineAdressindex.js
_this.websocketonline.onopen = function() {
_this.websocketonline.send('[QQ313596790]fhadmin')//
}
_this.websocketonline.onerror = function() {
//
}
_this.websocketonline.onclose = function() {
//
}
//
_this.websocketonline.onmessage = function(message) {
var messageData = JSON.parse(message.data)
if (messageData.type == 'count') {
// userCount = message.msg
} else if (messageData.type == 'userlist') {
for (let i = 0; i < messageData.list.length; ++i) {
var data1 = { username: messageData.list[i] }
_this.userList.push(data1)
}
_this.userCount = messageData.list.length
} else if (messageData.type == 'addUser') {
var addUserData = { username: messageData.user }
_this.userList.push(addUserData)
_this.userList = _this.userList.reverse()
_this.userCount = _this.userList.length
}
}
}
},
// 线
goOutTUser: function(theuser) {
var _this = this
theuser = theuser.replace('mobile-', '')
if (theuser == 'admin') {
// return
}
this.$confirm('确定要强制[' + theuser + ']下线吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
_this.websocketonline.send('[goOut]' + theuser)
})
}
}
}
</script>

View File

@ -0,0 +1,118 @@
<template>
<div class="app-container">
<el-tabs v-model="activeTab" type="border-card" @tab-click="handleClick">
<el-tab-pane v-for="role in roleList" :name="role.role_ID" :key="role.role_ID" :label="role.role_NAME">
<el-table
v-loading="listLoading"
:data="roleList_z"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000',
'padding':'14px 0'
}"
:row-style="{'height':'54px'}"
border
fit
highlight-current-row>
<el-table-column type="index" label="序号" fixed width="50" align="center"/>
<el-table-column prop="role_NAME" label="角色" fixed width="200" show-overflow-tooltip/>
<el-table-column v-for="item in buttonlist" :key="item.FHBUTTON_ID" :label="item.NAME" :render-header="labelHead" align="center">
<template slot-scope="{row}">
<template v-for="(varRb,vsRb) in roleFhbuttonlist">
<template v-if="row.role_ID == varRb.ROLE_ID && item.FHBUTTON_ID == varRb.BUTTON_ID">
<span :key="vsRb" style="display: none;">{{ switchModel[row.role_ID + '_' + item.FHBUTTON_ID] = true }}</span>
</template>
</template>
<el-switch v-model="switchModel[row.role_ID + '_' + item.FHBUTTON_ID]" @change="upRb(row.role_ID,item.FHBUTTON_ID)"/>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { requestFN } from '@/utils/request'
export default {
data() {
return {
activeTab: '1',
roleList: [], // list ()
roleList_z: [], // list
buttonlist: [], // list
roleFhbuttonlist: [], // list
pd: [], // map
ROLE_ID: '1', // ID
switchModel: {},
edit: false,
listLoading: false //
}
},
created() {
this.getList(this.ROLE_ID)
},
methods: {
labelHead(h, { column, index }) {
const l = column.label.length
const f = 34 //
column.minWidth = f * l
return h('div', { class: 'table-head', style: { width: '100%' }}, [column.label])
},
handleClick(tab) {
this.ROLE_ID = tab.name
this.roleList_z = []
this.getList(this.ROLE_ID)
},
getList(ROLE_ID) {
this.listLoading = true
this.ROLE_ID = ROLE_ID
requestFN(
'/buttonrights/list',
{
ROLE_ID: ROLE_ID
}
).then((data) => {
this.roleList = data.roleList
this.roleList_z = data.roleList_z
this.buttonlist = data.buttonlist
this.roleFhbuttonlist = data.roleFhbuttonlist
this.pd = data.pd
this.hasButton()
this.listLoading = false
}).catch((e) => {
this.listLoading = false
})
},
hasButton: function() {
var keys = 'buttonrights:edit'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.edit = data.buttonrightsfhadminedit
}).catch((e) => {
this.listLoading = false
})
},
upRb: function(ROLE_ID, FHBUTTON_ID) {
requestFN(
'/buttonrights/upRb',
{
ROLE_ID: ROLE_ID,
BUTTON_ID: FHBUTTON_ID
}
).then((data) => {
this.switchModel = {}
this.roleFhbuttonlist = []
this.getList(this.activeTab)
}).catch((e) => {
})
}
}
}
</script>

View File

@ -0,0 +1,3 @@
<template>
<router-view />
</template>

View File

@ -0,0 +1,409 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-button-group>
<!-- <el-button type="primary" icon="el-icon-document-add" @click="handleAdd(0)"></el-button>-->
<el-button type="primary" icon="el-icon-edit" @click="handleEdit()"></el-button>
<!-- <el-button v-if="ROLE_ID!=1" type="primary" icon="el-icon-delete" @click="handleDelete()"></el-button>-->
<el-button type="primary" icon="el-icon-collection-tag" @click="handleTree('listAllMenuV2',activeTab)"></el-button>
</el-button-group>
</div>
<el-tabs v-model="activeTab" type="border-card" @tab-click="handleClick">
<el-tab-pane v-for="role in roleList" :name="role.role_ID" :key="role.role_ID" :label="role.role_NAME">
<el-table
v-loading="listLoading"
:data="roleList_z"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
border
fit
highlight-current-row>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="role_NAME" label="角色" width="180" />
<el-table-column prop="rnumber" label="编码" />
<el-table-column label="增" align="center" width="60">
<template slot-scope="{row}">
<el-button icon="el-icon-document-add" circle @click="handleTree('b4ButtonV2',row.role_ID,'add_qx')" />
</template>
</el-table-column>
<el-table-column label="删" align="center" width="60">
<template slot-scope="{row}">
<el-button icon="el-icon-delete" circle @click="handleTree('b4ButtonV2',row.role_ID,'del_qx')"/>
</template>
</el-table-column>
<el-table-column label="改" align="center" width="60">
<template slot-scope="{row}">
<el-button icon="el-icon-edit" circle @click="handleTree('b4ButtonV2',row.role_ID,'edit_qx')"/>
</template>
</el-table-column>
<el-table-column label="查" align="center" width="60">
<template slot-scope="{row}">
<el-button icon="el-icon-view" circle @click="handleTree('b4ButtonV2',row.role_ID,'cha_qx')"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="290">
<template slot-scope="scope">
<el-button type="success" icon="el-icon-collection-tag" size="mini" @click="handleTree('listAllMenuV2',scope.row.role_ID)"></el-button>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleUpdate(scope.row.role_ID, scope.row.role_NAME, scope.row.dept_TYPE, scope.row.primarynum,scope.row.level)">编辑</el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(scope.row.role_ID, scope.row.role_NAME)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<div class="page-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleCreate(activeTab)"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getRoleList(ROLE_ID)" />
</div>
<el-dialog :visible.sync="dialogFormAdd" :title="dialogType==='edit'?'修改':'新增'" width="600px">
<el-form ref="roleForm" :model="form" :rules="formRules" label-width="120px" style="width: 500px;">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" autocomplete="off" placeholder="这里输入名称..." />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormAdd = false"> </el-button>
<el-button type="primary" @click="confirmRole"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormVisible" :title="dialogType==='edit'?'修改':'新增'" width="600px">
<el-form ref="roleForm" :model="form" :rules="formRules" label-width="120px" style="width: 500px;">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" autocomplete="off" placeholder="这里输入名称..." />
</el-form-item>
<el-form-item label="单位类型" prop="dept_TYPE">
<el-select ref="refDeptType" v-model="form.dept_TYPE" placeholder="请选择" class="filter-item">
<el-option v-for="item in unitTypeList" :key="item.DICTIONARIES_ID" :label="item.NAME" :value="item.DICTIONARIES_ID" />
</el-select>
</el-form-item>
<el-form-item label="是否为主账号" prop="primarynum">
<el-select v-model="form.primarynum" placeholder="请选择" class="filter-item">
<el-option v-for="item in statearr" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="用户查看等级" prop="roleLevel">
<el-select v-model="form.roleLevel" placeholder="请选择" class="filter-item">
<el-option v-for="item in userRoleLevel" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="confirmRole"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormTree" title="授权'新增'权限" width="500px">
<el-tree
ref="tree"
:data="treeData"
:props="defaultProps"
show-checkbox
node-key="id"/>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormTree = false"> </el-button>
<el-button type="primary" @click="confirmTree"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
export default {
components: { Pagination },
data() {
return {
activeTab: '1',
listLoading: true,
listQuery: {
page: 1,
limit: 20
},
total: 0,
roleList: [], // list ()
roleList_z: [], // list
pd: [], // map
ROLE_ID: '1', // ID
dialogFormVisible: false,
dialogFormAdd: false,
dialogType: 'add',
dialogFormTree: false,
form: {
id: '',
parent_id: '',
name: '',
dept_TYPE: '',
primarynum: '', // 01
roleLevel: ''
},
formRules: {
name: [
{ required: true, message: '名不能为空', trigger: 'change' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
],
dept_TYPE: [
{ required: true, message: '请选择单位类型', trigger: 'blur' }
],
primarynum: [
{ required: true, message: '请选择是否为主账号', trigger: 'blur' }
],
roleLevel: [
{ required: true, message: '请选择用户等级', trigger: 'blur' }
]
},
treeData: [],
confirmTreeForm: {
url: '',
id: '',
msg: ''
},
defaultProps: {
children: 'nodes',
label: 'name'
},
statearr: [
{ value: '0', label: '是' },
{ value: '1', label: '否' }
],
userRoleLevel: [
{ value: '0', label: '公司领导' },
{ value: '1', label: '部门领导' },
{ value: '2', label: '普通员工' }
],
unitTypeList: []
}
},
created() {
this.getRoleList(this.ROLE_ID)
this.getDict('3f3a6ac41247438e91df2830765068ba', 'unitTypeList')//
},
methods: {
handleClick(tab) {
this.ROLE_ID = tab.name
this.roleList = []
this.roleList_z = []
this.listQuery.page = 1
this.form.parent_id = this.ROLE_ID
this.getRoleList(this.ROLE_ID)
},
getRoleList(ROLE_ID, dept_TYPE, primarynum) {
this.listLoading = true
this.ROLE_ID = ROLE_ID
requestFN(
'/role/list',
{
ROLE_ID: ROLE_ID
}
).then((data) => {
this.listLoading = false
this.activeTab = ROLE_ID
this.form.dept_TYPE = dept_TYPE
this.form.primarynum = primarynum
this.roleList = data.roleList
this.roleList_z = data.roleList_z.filter((item, index) => index < this.listQuery.limit * this.listQuery.page && index >= this.listQuery.limit * (this.listQuery.page - 1))
this.total = data.roleList_z.length
this.total = data.page.totalResult
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
handleAdd(parentId) {
this.dialogType = 'add'
this.form.name = ''
this.form.parent_id = parentId
this.dialogFormAdd = true
},
handleCreate(parentId) {
this.dialogType = 'add'
this.form.name = ''
this.form.parent_id = parentId
this.dialogFormVisible = true
},
handleEdit(roleId, roleName) {
this.dialogType = 'edit'
if (roleId) {
this.form.id = roleId
this.form.name = roleName
} else {
for (const role of this.roleList) {
if (role.role_ID === this.activeTab) {
this.form.id = role.role_ID
this.form.name = role.role_NAME
}
}
}
this.dialogFormAdd = true
},
handleUpdate(roleId, roleName, dept_TYPE, primarynum, level) {
this.dialogType = 'edit'
if (roleId) {
this.form.id = roleId
this.form.name = roleName
this.form.dept_TYPE = dept_TYPE
this.form.primarynum = primarynum
this.form.roleLevel = level
} else {
for (const role of this.roleList) {
if (role.role_ID === this.activeTab) {
this.form.id = role.role_ID
this.form.name = role.role_NAME
}
}
}
this.dialogFormVisible = true
},
handleDelete(roleId, roleName) {
if (roleId) {
this.form.id = roleId
this.form.name = roleName
} else {
for (const role of this.roleList) {
if (role.role_ID === this.activeTab) {
this.form.id = role.role_ID
this.form.name = role.role_NAME
}
}
}
this.$confirm('确定要删除[' + this.form.name + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/role/delete',
{
ROLE_ID: this.form.id
}
).then(() => {
this.listLoading = false
this.roleList = []
this.roleList_z = []
this.listQuery.page = 1
this.getRoleList('1')
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
handleTree(url, roldId, msg) {
if (url === 'listAllMenuV2') {
this.confirmTreeForm.str = 'saveMenuqx'
} else {
this.confirmTreeForm.str = 'saveB4Button'
}
this.confirmTreeForm.id = roldId
this.confirmTreeForm.msg = msg || ''
this.listLoading = true
requestFN(
'/role/' + url,
{
ROLE_ID: roldId,
msg: msg
}
).then((data) => {
this.listLoading = false
this.treeData = JSON.parse(data.zTreeNodes)
this.dialogFormTree = true
this.$nextTick(() => {
var checkedMenuIds = []
this.getCheckNode(this.treeData, checkedMenuIds)
this.$refs.tree.setCheckedKeys(checkedMenuIds) //
})
}).catch((e) => {
this.listLoading = false
})
},
confirmRole() {
this.$refs.roleForm.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/role/' + this.dialogType,
{
ROLE_ID: this.form.id,
ROLE_NAME: this.form.name,
PARENT_ID: this.form.parent_id,
DEPT_TYPE: this.form.dept_TYPE,
PRIMARYNUM: this.form.primarynum,
LEVEL: this.form.roleLevel
}
).then((data) => {
this.listLoading = false
this.dialogFormVisible = false
this.dialogFormAdd = false
this.roleList = []
this.roleList_z = []
this.listQuery.page = 1
this.getRoleList(this.form.parent_id)
// if (data.pd.PARENT_ID === '0') {
//
// } else {
// this.getRoleList(this.form.parent_id)
// }
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
confirmTree() {
this.listLoading = true
const ids = this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys())
requestFN(
'/role/' + this.confirmTreeForm.str,
{
ROLE_ID: this.confirmTreeForm.id,
menuIds: ids.join(','),
msg: this.confirmTreeForm.msg
}
).then((data) => {
this.listLoading = false
this.dialogFormTree = false
}).catch((e) => {
this.listLoading = false
})
},
getCheckNode(menuList, checkedMenuIds) {
if (menuList != null && menuList.length > 0) {
for (let i = 0; i < menuList.length; i++) {
const menu = menuList[i]
if ((menu.nodes == null || menu.nodes.length === 0) && menu.checked.toString() === 'true') {
checkedMenuIds.push(menu.id)
}
if (menu.nodes != null && menu.nodes.length > 0) {
this.getCheckNode(menu.nodes, checkedMenuIds)
}
}
}
},
//
getDict(dicID, listName) {
requestFN(
'dictionaries/getLevels',
{ DICTIONARIES_ID: dicID }
).then((data) => {
this[listName] = data.list
}).catch((e) => {
this.listLoading = false
})
}
}
}
</script>

View File

@ -0,0 +1,544 @@
<template>
<div class="app-container">
<el-form label-width="80px">
<el-row>
<el-col :span="4">
<el-form-item label="公告简介">
<el-input v-model="KEYWORDS" placeholder="公告简介"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label-width="10px">
<el-button v-waves type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves type="success" icon="el-icon-refresh" @click="goKeyReset">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table v-loading="listLoading" ref="multipleTable" :data="varList" :row-key="getRowKey" :header-cell-style="{'font-weight': 'bold','color': '#000'}" tooltip-effect="dark" border fit highlight-current-row>
<el-table-column :reserve-selection="true" type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="CREATOR" label="发布人" />
<el-table-column prop="CREATTIME" label="发布时间" />
<el-table-column prop="CREATOR" label="公告简介">
<template slot-scope="{row}">
<div class="link-type" @click="handleShow(row)">{{ (row.SYNOPSIS).substring(0,13) }}...</div>
</template>
</el-table-column>
<el-table-column prop="CREATOR" label="启用状态">
<template slot-scope="{row}">
<el-switch v-model="row.STATUS" active-value="1" inactive-value="0" @change="changeStatus(row.NOTICE_ID)" />
</template>
</el-table-column>
<el-table-column prop="NAME" label="查看状态">
<template slot-scope="{row}">
<div class="link-type" @click="handleRead(row.NOTICE_ID,row.ISALL)">{{ row.countCk }} / {{ row.countAll }}</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<el-button v-show="edit && row.ISTOP==0" type="success" size="mini" @click="zhiding(row.NOTICE_ID,1,'置顶')"></el-button>
<el-button v-show="edit && row.ISTOP==1" type="success" size="mini" @click="zhiding(row.NOTICE_ID,0,'取消置顶')"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.NOTICE_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button v-show="del" type="danger" icon="el-icon-delete" plain @click="batchDel"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<el-dialog :visible.sync="dialogFormEdit" :title="dialogType==='edit'?'修改':'新增'" width="800px">
<el-form ref="form" :rules="rules" :model="form" label-width="110px" style="padding:0 40px 0 20px">
<el-form-item label="公告简介" prop="SYNOPSIS">
<el-input id="SYNOPSIS" ref="SYNOPSIS" v-model="form.SYNOPSIS" maxlength="255" placeholder="这里输入公告简介..." title="公告简介" />
</el-form-item>
<el-form-item label="是否全部通知" prop="ISALL">
<el-radio-group id="ISALL" ref="ISALL" v-model="form.ISALL">
<el-radio :label="'yes'">全部通知</el-radio>
<el-radio :label="'no'">部分通知</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.ISALL=='no'" label="选择通知人" prop="ISALL">
<div class="uo-flex">
<el-input v-model="form.corpinfoNames" placeholder="请选择通知人..." disabled />
<el-button type="primary" style="margin-left:10px" icon="el-icon-arrow-down" @click="handleCorp"></el-button>
</div>
</el-form-item>
<el-form-item label="内容" prop="CONTENT">
<!-- <tinymce v-model="form.CONTENT" :height="300" />-->
<quill-editor
ref="myQuillEditor"
v-model="form.CONTENT"
:options="editorOption"
style="min-height: 300px"
/>
</el-form-item>
<!-- <el-form-item label="附件路径">-->
<!-- <div class="uo-flex">-->
<!-- <el-input v-model="form.fileName" :disabled="true" title="请上传附件" />-->
<!-- <el-upload :before-upload="beforeFileUpload" class="avatar-uploader" action="#">-->
<!-- <el-button type="primary" icon="el-icon-upload" style="margin-left:10px; ">上传附件</el-button>-->
<!-- </el-upload>-->
<!-- </div>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormShow" title="查看" width="800px">
<table class="table-ui">
<tr>
<td class="tbg">发布人</td>
<td>{{ pd.CREATOR }}</td>
</tr>
<tr>
<td class="tbg">发布时间</td>
<td>{{ pd.CREATTIME }}</td>
</tr>
<tr>
<td class="tbg">内容</td>
<td>
<div v-html="pd.CONTENT" />
</td>
</tr>
<!-- <tr v-if="pd.FILEPATH">-->
<!-- <td class="tbg">附件</td>-->
<!-- <td><a @click="download(pd.FILEPATH)"></a></td>-->
<!-- </tr>-->
</table>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormShow = false"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormRead" title="查看" width="800px">
<el-table v-loading="readListLoading" ref="multipleTable_read" :data="readVarList" :header-cell-style="{'font-weight': 'bold','color': '#000'}" tooltip-effect="dark" border fit highlight-current-row>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="CORP_NAME" label="企业名称" />
<el-table-column prop="CREATTIME" label="阅读状态">
<template slot-scope="{row}">
<span v-if="row.TYPE=='1'"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column prop="CREATOR" label="阅读时间" />
<el-table-column prop="CONTENT" label="回复内容" />
</el-table>
<div class="page-btn-group">
<div>
<el-button @click="dialogFormRead = false"> </el-button>
</div>
<pagination :total="readTotal" :page.sync="readListQuery.page" :limit.sync="readListQuery.limit" @pagination="getReadList" />
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormUser" title="查看" width="800px">
<div class="filter-container">
<el-input v-model="KEYWORDS_CORP" placeholder="搜索" class="filter-item" style="width: 200px;" />
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getCorpList">
搜索
</el-button>
</div>
<el-table v-loading="corpListLoading" ref="multipleTable_corp" :row-key="getCorpRowKey" :data="corpVarList" :header-cell-style="{'font-weight': 'bold','color': '#000'}" tooltip-effect="dark" border fit highlight-current-row>
<el-table-column :reserve-selection="true" type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="CORP_NAME" label="企业名称" />
<el-table-column prop="COMPANY_AREA" label="所属区域" />
<el-table-column prop="ADDRESS" label="注册地址" />
<el-table-column prop="LR_NAME" label="法定代表人" />
</el-table>
<div class="page-btn-group">
<div>
<el-button type="primary" @click="confirmUser"> </el-button>
<el-button @click="dialogFormUser = false"> </el-button>
</div>
<pagination :total="corpTotal" :page.sync="corpListQuery.page" :limit.sync="corpListQuery.limit" @pagination="getCorpList" />
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import { quillEditor } from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
// import Tinymce from '@/components/Tinymce'
export default {
components: { Pagination, quillEditor },
directives: { waves },
data() {
return {
listLoading: true,
readListLoading: true,
corpListLoading: true,
add: false,
del: false,
edit: false,
editorOption: {},
serverurl: config.fileUrl,
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
varList: [],
pd: [],
NOTICE_ID: '',
isAll: '',
readListQuery: {
page: 1,
limit: 20
},
readTotal: 0,
readVarList: [],
KEYWORDS_CORP: '',
corpListQuery: {
page: 1,
limit: 20
},
corpTotal: 0,
corpVarList: [],
form: {
SYNOPSIS: '',
ISALL: 'yes',
CONTENT: '',
corpinfoIds: '',
corpinfoNames: '',
file: '',
fileName: ''
},
multipleSelectionAll: [], //
multipleSelection: [], //
dialogFormEdit: false,
dialogFormShow: false,
dialogFormRead: false,
dialogFormUser: false,
dialogType: 'add',
rules: {
SYNOPSIS: [{ required: true, message: '公告简介不能为空', trigger: 'blur' }],
CONTENT: [{ required: true, message: '内容不能为空', trigger: 'blur' }]
}
}
},
created() {
this.getList()
},
methods: {
getRowKey(row) {
return row.NOTICECORP_ID
},
//
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
goKeyReset() {
this.KEYWORDS = ''
this.getQuery()
},
//
getList() {
this.listLoading = true
requestFN(
'/service/notice/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
tm: new Date().getTime()
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
var countNotList = data.countNotList
for (var i = 0; i < data.varList.length; i++) {
var notMap = data.varList[i]
var notId = notMap.NOTICE_ID
var countCk = 0
var countWCK = 0
for (var j = 0; j < countNotList.length; j++) {
var countNotId = countNotList[j].NOTICE_ID
if (notId == countNotId) {
if (countNotList[j].type == '1') {
countCk = countNotList[j].count
}
if (countNotList[j].type == '0') {
countWCK = countNotList[j].count
}
}
}
if (notMap.ISALL == 'no') {
notMap.countAll = countCk + countWCK
} else if (notMap.ISALL == 'yes') {
notMap.countAll = data.corpInfoCount
}
notMap.countCk = countCk
}
this.total = data.page.totalResult
this.hasButton(data.varList)
}).catch((e) => {
this.listLoading = false
})
},
handleShow(row) {
this.dialogFormShow = true
this.pd = Object.assign({}, row)
},
handleRead(id, isAll) {
this.NOTICE_ID = id
this.isAll = isAll
this.dialogFormRead = true
this.getReadList()
},
getReadList() {
this.readListLoading = true
requestFN(
'/service/notice/listCorpRead?showCount=' + this.readListQuery.limit + '&currentPage=' + this.readListQuery.page,
{
NOTICE_ID: this.NOTICE_ID,
isAll: this.isAll,
tm: new Date().getTime()
}
).then((data) => {
this.readListLoading = false
this.readVarList = data.varList
this.readTotal = data.page.totalResult
}).catch((e) => {
this.readListLoading = false
})
},
handleCorp() {
this.dialogFormUser = true
this.getCorpList()
},
getCorpRowKey(row) {
return row.CORPINFO_ID
},
getCorpList() {
this.corpListLoading = true
requestFN(
'/corpinfo/list?showCount=' + this.corpListQuery.limit + '&currentPage=' + this.corpListQuery.page,
{
KEYWORDS: this.KEYWORDS_CORP,
tm: new Date().getTime()
}
).then((data) => {
this.corpListLoading = false
this.corpVarList = data.varList
this.corpTotal = data.page.totalResult
}).catch((e) => {
this.corpListLoading = false
})
},
confirmUser() {
const _selectData = this.$refs.multipleTable_corp.selection
const ids = _selectData.map((item, index) => {
return item.CORPINFO_ID
}).join(',')
const names = _selectData.map((item, index) => {
return item.CORP_NAME
}).join(',')
this.form.corpinfoIds = ids
this.form.corpinfoNames = names
this.dialogFormUser = false
},
//
handleAdd() {
this.dialogType = 'add'
this.resetForm()
this.dialogFormEdit = true
},
//
confirm() {
this.$refs.form.validate(valid => {
requestFN(
'/service/notice/add',
{
NOTICE_ID: this.NOTICE_ID,
SYNOPSIS: this.form.SYNOPSIS,
CONTENT: this.form.CONTENT,
ISALL: this.form.ISALL,
corpInfoIds: this.form.corpinfoIds,
tm: new Date().getTime()
}
).then((data) => {
this.dialogFormEdit = false
this.getList()
}).catch((e) => {
})
})
},
beforeFileUpload(file) {
this.form.file = file
this.form.fileName = file.name
this.$forceUpdate()
return false
},
//
changeStatus(NOTICE_ID) {
requestFN(
'/service/notice/changeStatus',
{
NOTICE_ID: NOTICE_ID
}
).then(() => {
this.$message({
message: '状态修改成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
},
zhiding(id, ISTOP, str) {
this.$confirm('确定要' + str + '吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/service/notice/changeIsTop',
{
NOTICE_ID: id,
ISTOP: ISTOP
}
).then(() => {
this.$message({
message: '操作成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
handleDelete(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/service/notice/delete',
{
NOTICE_ID: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.TIMINGBACKUP_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/noticecorp/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
//
hasButton() {
var keys = 'serviceNotice:add,serviceNotice:del,serviceNotice:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.serviceNoticefhadminadd //
this.del = data.serviceNoticefhadmindel //
this.edit = data.serviceNoticefhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
//
getDict() {
},
download(filePah) {
window.location.href = config.fileUrl + filePah
},
resetForm() {
this.form = {
SYNOPSIS: '',
ISALL: 'yes',
CONTENT: '',
corpinfoIds: '',
corpinfoNames: '',
file: '',
fileName: ''
}
}
}
}
</script>
<style lang="sass" scoped>
.uo-flex
display: flex
</style>

View File

@ -0,0 +1,322 @@
<template>
<div class="icons-container">
<el-table
ref="multipleTable"
:data="varList"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<!-- <el-table-column prop="TEMPLATES_ID" label="模板id" />-->
<el-table-column prop="ENCODE" label="编码" width="150px"/>
<el-table-column prop="SYNOPSIS" label="简介" width="250px"/>
<el-table-column prop="CONTENT" label="模板内容" />
<el-table-column prop="URL" label="跳转地址" />
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.TEMPLATES_ID)"></el-button>
<el-button type="primary" icon="el-icon-delete" size="mini" @click="handleEdit(row.TEMPLATES_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button type="primary" icon="el-icon-plus" @click="handleAdd(activeTab)"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<el-dialog :visible.sync="dialogFormAdd" :title="dialogType==='edit'?'修改':'新增'" width="600px">
<el-form ref="roleForm" :model="form" :rules="formRules" label-width="120px" style="width: 500px;">
<el-form-item label="模板id" prop="TEMPLATES_ID">
<el-input v-model="form.TEMPLATES_ID" autocomplete="off" placeholder="这里输入模板id..." />
</el-form-item>
<el-form-item label="模板名称" prop="NAME">
<el-input v-model="form.NAME" autocomplete="off" placeholder="这里输入模板名称..." />
</el-form-item>
<el-form-item label="模板内容" prop="CONTENT" >
<el-input v-model="form.CONTENT" type="textarea" autocomplete="off" placeholder="这里输入模板内容..." />
</el-form-item>
<el-form-item label="跳转地址" prop="URL">
<el-input v-model="form.URL" type="textarea" autocomplete="off" placeholder="这里输入跳转地址..." />
</el-form-item>
<el-form-item label="简介" prop="SYNOPSIS">
<el-input v-model="form.SYNOPSIS" type="textarea" autocomplete="off" placeholder="这里输入简介..." />
</el-form-item>
<el-form-item label="编码" prop="ENCODE">
<el-input v-model="form.ENCODE" autocomplete="off" placeholder="这里输入编码..." />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormAdd = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
export default {
name: 'Icons',
components: { Pagination },
data() {
return {
listQuery: {
page: 1,
limit: 20
},
total: 0,
listLoading: false, //
treeLoading: false,
radio: 1,
dialogFormAdd: false,
dialogEditIcon: false,
dialogType: 'add',
//
varList: [], // list
TEMPLATES_ID: '0', // ID
pd: [],
form: {
TEMPLATES_ID: '', // id
NAME: '1', //
CONTENT: 1, //
URL: '', //
PID: '', // ID
PARAMETER1: '', // 1
PARAMETER2: '', // 2
PARAMETER3: '(无)', // 3
SYNOPSIS: '', //
ENCODE: '', //
WEIGHT: '', //
CREATE_TIME: '' //
},
pds: [],
add: false,
del: false,
edit: false,
rules: {
MENU_NAME: [
{ required: true, message: '菜单名称不能为空', trigger: 'change' },
{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }
],
MENU_ORDER: [
{ required: true, message: '菜单序号不能为空', trigger: 'change' },
{ type: 'number', message: '菜单序号必须为数字' }
]
}
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getList(this.TEMPLATES_ID)
},
methods: {
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleNodeClick(node, data, value) {
this.handleEdit(node.id)
},
handleAdd() {
this.dialogType = 'add'
this.resetForm()
requestFN(
'/message/toAdd',
{
TEMPLATES_ID: this.TEMPLATES_ID
}
).then((data) => {
this.form.PARENT_ID = this.TEMPLATES_ID
this.pds = data.pds || [] //
}).catch((e) => {
})
this.dialogFormAdd = true
},
handleEdit(TEMPLATES_ID) {
this.dialogType = 'edit'
requestFN(
'/message/toEdit',
{
TEMPLATES_ID: TEMPLATES_ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
this.form.TEMPLATES_ID = TEMPLATES_ID
this.form.PARENT_ID = data.pd.PARENT_ID
this.pds = data.pds || [] //
}).catch((e) => {
this.listLoading = false
})
this.dialogFormAdd = true
},
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
requestFN(
'/message/' + this.dialogType,
this.form
).then((data) => {
this.listLoading = false
this.dialogFormAdd = false
this.getList(this.TEMPLATES_ID)
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id, name) {
this.$confirm('确定要删除[' + name + ']吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/message/delete',
{
TEMPLATES_ID: id
}
).then(() => {
this.listLoading = false
this.getList(this.TEMPLATES_ID)
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
handleEditIcon(TEMPLATES_ID) {
this.dialogEditIcon = true
this.form.TEMPLATES_ID = TEMPLATES_ID
},
confirmIcon(symbol) {
const MENU_ICON = symbol
this.listLoading = true
requestFN(
'/message/editicon',
{
TEMPLATES_ID: this.form.TEMPLATES_ID,
MENU_ICON: MENU_ICON
}
).then((data) => {
this.listLoading = false
this.dialogEditIcon = false
this.getList(this.TEMPLATES_ID)
}).catch((e) => {
this.listLoading = false
})
},
getList(TEMPLATES_ID) {
this.listLoading = true
this.varList = []
this.TEMPLATES_ID = TEMPLATES_ID
requestFN(
'/message/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
TEMPLATES_ID: this.TEMPLATES_ID
}
).then((data) => {
console.log(data)
this.listLoading = false
this.varList = data.templates
this.total = data.page.totalResult
this.pd = data.pd || []
this.hasButton()
}).catch((e) => {
this.listLoading = false
})
},
resetForm() {
this.form = {
TEMPLATES_ID: '', // ID
MENU_TYPE: '1', //
MENU_STATE: 1, //
PARENT_ID: '', // ID
MENU_NAME: '', //
MENU_URL: '', //
COMPONENT: '', //
SHIRO_KEY: '(无)', //
SHOW_MODEL: '', //
MENU_ORDER: '' //
}
},
hasButton: function() {
var keys = 'menu:add,menu:del,menu:edit'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.menufhadminadd
this.del = data.menufhadmindel
this.edit = data.menufhadminedit
}).catch((e) => {
this.listLoading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.el-dialog__body{
padding: 0;
background: red;
}
.mark_up{
margin-bottom:20px;
margin-left: 110px;
}
.icons-container {
margin: 0;
overflow: hidden;
.grid {
position: relative;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.icon-item {
margin-bottom: 10px;
height: 70px;
text-align: center;
width: 100px;
float: left;
font-size: 24px;
color: #24292e;
cursor: pointer;
span {
display: block;
font-size: 14px;
margin-top: 10px;
}
}
.disabled {
pointer-events: none;
}
}
</style>

View File

@ -0,0 +1,27 @@
<template>
<div id="vue">
Hello Vue{{ this.$parent.val1 }}
<el-button class="filter-item" type="primary" @click="getQuery">
搜索
</el-button>
</div>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
getQuery() {
this.$parent.indexVal = '2333'
this.$parent.activeName = 'Index2'
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,27 @@
<template>
<div id="vue">
Hello Vue{{ this.$parent.indexVal }}
<el-button class="filter-item" type="primary" @click="getQuery">
返回
</el-button>
</div>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
getQuery() {
this.$parent.activeName = 'Index'
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,29 @@
<template>
<div class="app-container">
<transition name="fade" mode="out-in">
<component :is="activeName"/>
</transition>
</div>
</template>
<script>
import Index from './components/index'
import Index2 from './components/index2'
export default {
components: { Index, Index2 },
data() {
return {
val1: '3',
activeName: 'Index',
val: '1',
indexVal: ''
}
},
methods: {
getQuery() {
this.activeName = 'Index2'
}
}
}
</script>

View File

@ -0,0 +1,15 @@
<template>
<div id="vue">
Hello Vue2
</div>
</template>
<script>
export default {
name: 'Index'
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,3 @@
<template>
<router-view />
</template>

View File

@ -0,0 +1,433 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="KEYWORDS" placeholder="搜索" class="filter-item" style="width: 200px;"/>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="getReset">
重置
</el-button>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号 " width="50" align="center" />
<el-table-column prop="VERSION" label="版本" />
<el-table-column prop="FILEURL" label="文件地址">
<template slot-scope="{row}">
<span v-if="row.FILEURL" @click="download(row.FILEURL)">[]</span>
</template>
</el-table-column>
<el-table-column prop="FILETYPE" label="文件类型" />
<el-table-column prop="OPUSER" label="操作人" />
<el-table-column prop="OPTIME" label="操作日期" />
<el-table-column prop="ISEFFECTIVE" label="是否有效">
<template slot-scope="{row}">
<span v-if="row.ISEFFECTIVE =='1'"></span>
<span v-if="row.ISEFFECTIVE =='2'"></span>
</template>
</el-table-column>
<el-table-column prop="ISUPDATE" label="是否强制更新">
<template slot-scope="{row}">
<span v-if="row.ISUPDATE =='1'"></span>
<span v-if="row.ISUPDATE =='2'"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<!-- <el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.VERSIONMANAGER_ID)"></el-button>-->
<el-button v-show="edit" type="success" icon="el-icon-view" size="mini" @click="handleShow(row.VERSIONMANAGER_ID)"></el-button>
<!-- <el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.VERSIONMANAGER_ID)"></el-button>-->
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<!-- <el-button v-show="del" type="danger" icon="el-icon-delete" plain @click="batchDel"></el-button>-->
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<el-dialog :visible.sync="dialogFormShow" :title="dialogType==='edit'?'查看':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="版本" prop="VERSION">
<el-input ref="VERSION" v-model="form.VERSION" maxlength="255" placeholder="这里输入版本..." title="版本"/>
</el-form-item>
<el-form-item label="文件地址" prop="FILEURL">
<el-row v-if="form.FILEURL && form.FILEURL.length >0" style="width: 100%">
<el-col :span="12">
<a v-if="form.FILEURL" @click="download(form.FILEURL)"></a>
</el-col>
</el-row>
<el-row v-else style="width: 100%">
<div style="display: flex;">
<el-input v-model="form.FILEURLName" :disabled="true" title="文件名称"/>
<el-upload
:before-upload="beforeListingFileUpload"
class="avatar-uploader"
action="#">
<el-button type="primary" icon="el-icon-upload" style="margin-left:10px; " plain>上传附件</el-button>
</el-upload>
</div>
</el-row>
</el-form-item>
<el-form-item label="文件类型" prop="FILETYPE">
<el-input ref="FILETYPE" v-model="form.FILETYPE" maxlength="255" placeholder="这里输入文件类型..." title="文件类型"/>
</el-form-item>
<el-form-item label="是否有效" prop="ISEFFECTIVE">
<el-radio v-model="form.ISEFFECTIVE" label="1"></el-radio>
<el-radio v-model="form.ISEFFECTIVE" label="2"></el-radio>
</el-form-item>
<el-form-item label="是否强制更新" prop="ISUPDATE">
<el-radio v-model="form.ISUPDATE" label="1"></el-radio>
<el-radio v-model="form.ISUPDATE" label="2"></el-radio>
</el-form-item>
</el-form>
</el-dialog>
<el-dialog :visible.sync="dialogFormEdit" :title="dialogType==='edit'?'查看':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="版本" prop="VERSION">
<el-input id="VERSION" ref="VERSION" v-model="form.VERSION" maxlength="255" placeholder="这里输入版本..." title="版本"/>
</el-form-item>
<el-form-item label="文件地址" prop="FILEURL">
<el-row v-if="form.FILEURL && form.FILEURL.length >0" style="width: 100%">
<el-col :span="12">
<a v-if="form.FILEURL" @click="download(form.FILEURL)"></a>
</el-col>
<el-col :span="12">
<el-button @click="chongzhiFujian('FILEURL')"></el-button>
</el-col>
</el-row>
<el-row v-else style="width: 100%">
<div style="display: flex;">
<el-input v-model="form.FILEURLName" :disabled="true" title="文件名称"/>
<el-upload
:before-upload="beforeListingFileUpload"
class="avatar-uploader"
accept=".apk"
action="#">
<el-button type="primary" icon="el-icon-upload" style="margin-left:10px; " plain>上传附件</el-button>
</el-upload>
</div>
</el-row>
</el-form-item>
<el-form-item label="文件类型" prop="FILETYPE">
<el-input id="FILETYPE" ref="FILETYPE" v-model="form.FILETYPE" maxlength="255" disabled placeholder="这里输入文件类型..." title="文件类型"/>
</el-form-item>
<!-- <el-form-item label="是否有效" prop="ISEFFECTIVE">-->
<!-- <el-input id="ISEFFECTIVE" ref="ISEFFECTIVE" v-model="form.ISEFFECTIVE" maxlength="255" placeholder="这里输入是否有效..." title="是否有效"/>-->
<!-- </el-form-item>-->
<el-form-item label="是否有效" prop="ISEFFECTIVE">
<!-- <el-input ref="ISEFFECTIVE" v-model="form.ISEFFECTIVE" maxlength="255" placeholder="这里输入是否有效..." title="是否有效"/>-->
<el-radio v-model="form.ISEFFECTIVE" label="1"></el-radio>
<el-radio v-model="form.ISEFFECTIVE" label="2"></el-radio>
</el-form-item>
<el-form-item label="是否强制更新" prop="ISUPDATE">
<el-radio v-model="form.ISUPDATE" label="1"></el-radio>
<el-radio v-model="form.ISUPDATE" label="2"></el-radio>
<!-- <el-input id="ISUPDATE" ref="ISUPDATE" v-model="form.ISUPDATE" maxlength="255" placeholder="这里输入是否更新 1强制更新2不强制更新..." title="是否更新 1强制更新2不强制更新"/>-->
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import { upload } from '@/utils/upload'
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
varList: [],
pd: [],
form: {
VERSIONMANAGER_ID: '', // 1
VERSION: '', //
FILEURL: '', //
FILEURLName: '',
FILETYPE: '', //
OPUSER: '', //
OPTIME: '', //
ISEFFECTIVE: '', //
ISUPDATE: ''// 12
},
multipleSelectionAll: [], //
multipleSelection: [], //
dialogFormEdit: false,
dialogFormShow: false,
dialogType: 'add',
rules: {
VERSIONMANAGER_ID: [{ required: true, message: '备注1不能为空', trigger: 'blur' }],
VERSION: [{ required: true, message: '版本不能为空', trigger: 'blur' }],
FILEURL: [{ required: true, message: '文件地址不能为空', trigger: 'blur' }],
FILETYPE: [{ required: true, message: '文件类型不能为空', trigger: 'blur' }],
OPUSER: [{ required: true, message: '操作人不能为空', trigger: 'blur' }],
OPTIME: [{ required: true, message: '操作日期不能为空', trigger: 'blur' }],
ISEFFECTIVE: [{ required: true, message: '是否有效不能为空', trigger: 'blur' }],
ISUPDATE: [{ required: true, message: '是否更新 1强制更新2不强制更新不能为空', trigger: 'blur' }]
},
config: config
}
},
created() {
this.getList(this.ROLE_ID)
},
methods: {
getRowKey(row) {
return row.VERSIONMANAGER_ID
},
//
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
getReset() {
this.KEYWORDS = null
this.getList()
},
//
getList() {
this.listLoading = true
requestFN(
'/versionmanager/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
ISUPDATE: this.ISUPDATE
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
//
handleAdd() {
this.dialogType = 'add'
this.resetForm()
this.getDict()
this.dialogFormEdit = true
},
//
handleShow(ID) {
this.getDict()
this.dialogType = 'edit'
requestFN(
'/versionmanager/goEdit',
{
VERSIONMANAGER_ID: ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
}).catch((e) => {
this.listLoading = false
})
this.dialogFormShow = true
},
//
handleEdit(ID) {
this.getDict()
this.dialogType = 'edit'
requestFN(
'/versionmanager/goEdit',
{
VERSIONMANAGER_ID: ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
}).catch((e) => {
this.listLoading = false
})
this.dialogFormEdit = true
},
//
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
const formData = new FormData()
Object.keys(this.form).map(key => {
formData.append(key, this.form[key])
})
upload(
'/versionmanager/' + this.dialogType,
formData
).then((data) => {
this.listLoading = false
this.dialogFormEdit = false
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/versionmanager/delete',
{
VERSIONMANAGER_ID: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.VERSIONMANAGER_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/versionmanager/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
//
hasButton: function() {
var keys = 'versionmanager:add,versionmanager:del,versionmanager:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.versionmanagerfhadminadd //
this.del = data.versionmanagerfhadmindel //
this.edit = data.versionmanagerfhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
//
getDict: function() {
},
resetForm() {
this.form = {
VERSIONMANAGER_ID: '', // 1
VERSION: '', //
FILEURL: '', //
FILETYPE: 1, //
OPUSER: '', //
OPTIME: '', //
ISEFFECTIVE: '', //
ISDELETE: 0,
ISUPDATE: ''// 12
}
},
beforeListingFileUpload(file) {
const suffix = file.name.substring(file.name.lastIndexOf('.'), file.name.length)
if (suffix === '.apk') {
this.form.FILEURL = file
this.form.FILEURLName = file.name
this.$forceUpdate()
return false
} else {
this.$message.warning('请上传apk文件')
}
return false
},
// beforeListingFileUpload(file) {
// this.form.FILEURL = file
// this.form.FILEURLName = file.name
// this.$forceUpdate()
// return false
// },
chongzhiFujian(key) {
this.form[key] = ''
},
download(filePah) {
window.open(this.config.fileUrl + filePah, '_blank')
}
}
}
</script>

View File

@ -0,0 +1,474 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="KEYWORDS" placeholder="搜索" class="filter-item" style="width: 200px;"/>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="getReset">
重置
</el-button>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号 " width="50" align="center" />
<el-table-column prop="VERSION" label="版本" />
<el-table-column prop="FILEURL" label="文件地址">
<template slot-scope="{row}">
<span v-if="row.FILEURL" @click="download(row.FILEURL)">[]</span>
</template>
</el-table-column>
<el-table-column prop="FILETYPE" label="文件类型" />
<el-table-column prop="OPUSER" label="操作人" />
<el-table-column prop="OPTIME" label="操作日期" />
<el-table-column prop="ISEFFECTIVE" label="是否有效">
<template slot-scope="{row}">
<span v-if="row.ISEFFECTIVE =='1'"></span>
<span v-if="row.ISEFFECTIVE =='2'"></span>
</template>
</el-table-column>
<el-table-column prop="ISUPDATE" label="是否强制更新">
<template slot-scope="{row}">
<span v-if="row.ISUPDATE =='1'"></span>
<span v-if="row.ISUPDATE =='2'"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<!-- <el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.VERSIONMANAGER_ID)"></el-button>-->
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleShow(row.VERSIONMANAGER_ID)"></el-button>
<!-- <el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.VERSIONMANAGER_ID)"></el-button>-->
<el-button type="success" icon="el-icon-edit" size="mini" @click="handleCover(row.VERSIONMANAGER_ID)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<el-button v-show="del" type="danger" plain @click="goqrcode"></el-button>
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<el-dialog :visible.sync="dialogFormShow" :title="dialogType==='edit'?'':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="版本" prop="VERSION">
<el-input ref="VERSION" v-model="form.VERSION" maxlength="255" placeholder="这里输入版本..." title="版本"/>
</el-form-item>
<el-form-item label="文件地址" prop="FILEURL">
<el-row v-if="form.FILEURL && form.FILEURL.length >0" style="width: 100%">
<el-col :span="12">
<a v-if="form.FILEURL" @click="download(form.FILEURL)"></a>
</el-col>
</el-row>
<el-row v-else style="width: 100%">
<div style="display: flex;">
<el-input v-model="form.FILEURLName" :disabled="true" title="文件名称"/>
<el-upload
:before-upload="beforeListingFileUpload"
accept=".apk"
class="avatar-uploader"
action="#">
<el-button type="primary" icon="el-icon-upload" style="margin-left:10px; " plain>上传附件</el-button>
</el-upload>
</div>
</el-row>
</el-form-item>
<el-form-item label="文件类型" prop="FILETYPE">
<el-input ref="FILETYPE" v-model="form.FILETYPE" maxlength="255" placeholder="这里输入文件类型..." title="文件类型"/>
</el-form-item>
<el-form-item label="是否有效" prop="ISEFFECTIVE">
<el-radio v-model="form.ISEFFECTIVE" label="1"></el-radio>
<el-radio v-model="form.ISEFFECTIVE" label="2"></el-radio>
</el-form-item>
<el-form-item label="是否强制更新" prop="ISUPDATE">
<el-radio v-model="form.ISUPDATE" label="1"></el-radio>
<el-radio v-model="form.ISUPDATE" label="2"></el-radio>
</el-form-item>
</el-form>
</el-dialog>
<el-dialog :visible.sync="dialogFormEdit" :title="dialogType==='edit'?'查看':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="版本" prop="VERSION">
<el-input id="VERSION" ref="VERSION" v-model="form.VERSION" maxlength="255" placeholder="这里输入版本..." title="版本"/>
</el-form-item>
<el-form-item label="文件地址" prop="FILEURL">
<el-row v-if="form.FILEURL && form.FILEURL.length >0" style="width: 100%">
<el-col :span="12">
<a v-if="form.FILEURL" @click="download(form.FILEURL)"></a>
</el-col>
<el-col :span="12">
<el-button @click="chongzhiFujian('FILEURL')"></el-button>
</el-col>
</el-row>
<el-row v-else style="width: 100%">
<div style="display: flex;">
<el-input v-model="form.FILEURLName" :disabled="true" title="文件名称"/>
<el-upload
:before-upload="beforeListingFileUpload"
accept=".apk"
class="avatar-uploader"
action="#">
<el-button type="primary" icon="el-icon-upload" style="margin-left:10px; " plain>上传附件</el-button>
</el-upload>
</div>
</el-row>
</el-form-item>
<el-form-item label="文件类型" prop="FILETYPE">
<el-input id="FILETYPE" ref="FILETYPE" v-model="form.FILETYPE" maxlength="255" disabled placeholder="这里输入文件类型..." title="文件类型"/>
</el-form-item>
<!-- <el-form-item label="是否有效" prop="ISEFFECTIVE">-->
<!-- <el-input id="ISEFFECTIVE" ref="ISEFFECTIVE" v-model="form.ISEFFECTIVE" maxlength="255" placeholder="这里输入是否有效..." title="是否有效"/>-->
<!-- </el-form-item>-->
<el-form-item label="是否有效" prop="ISEFFECTIVE">
<!-- <el-input ref="ISEFFECTIVE" v-model="form.ISEFFECTIVE" maxlength="255" placeholder="这里输入是否有效..." title="是否有效"/>-->
<el-radio v-model="form.ISEFFECTIVE" label="1"></el-radio>
<el-radio v-model="form.ISEFFECTIVE" label="2"></el-radio>
</el-form-item>
<el-form-item label="是否强制更新" prop="ISUPDATE">
<el-radio v-model="form.ISUPDATE" label="1"></el-radio>
<el-radio v-model="form.ISUPDATE" label="2"></el-radio>
<!-- <el-input id="ISUPDATE" ref="ISUPDATE" v-model="form.ISUPDATE" maxlength="255" placeholder="这里输入是否更新 1强制更新2不强制更新..." title="是否更新 1强制更新2不强制更新"/>-->
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogFormQrcode" title="港股一公司APP下载" width="340px">
<el-form ref="form" label-width="110px" style="width: 300px;">
<vue-qr :text="qrcodeStr" :margin="0" :size="300" color-dark="#000000" color-light="#fff"/>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormQrcode = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import { upload } from '@/utils/upload'
import vueQr from 'vue-qr'
export default {
components: { Pagination, vueQr },
directives: { waves },
data() {
return {
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
varList: [],
pd: [],
form: {
VERSIONMANAGER_ID: '', // 1
VERSION: '', //
FILEURL: '', //
FILEURLName: '',
FILETYPE: '', //
OPUSER: '', //
OPTIME: '', //
ISEFFECTIVE: '', //
ISUPDATE: ''// 12
},
multipleSelectionAll: [], //
multipleSelection: [], //
dialogFormEdit: false,
dialogFormShow: false,
dialogType: 'add',
rules: {
VERSIONMANAGER_ID: [{ required: true, message: '备注1不能为空', trigger: 'blur' }],
VERSION: [{ required: true, message: '版本不能为空', trigger: 'blur' }],
FILEURL: [{ required: true, message: '文件地址不能为空', trigger: 'blur' }],
FILETYPE: [{ required: true, message: '文件类型不能为空', trigger: 'blur' }],
OPUSER: [{ required: true, message: '操作人不能为空', trigger: 'blur' }],
OPTIME: [{ required: true, message: '操作日期不能为空', trigger: 'blur' }],
ISEFFECTIVE: [{ required: true, message: '是否有效不能为空', trigger: 'blur' }],
ISUPDATE: [{ required: true, message: '是否更新 1强制更新2不强制更新不能为空', trigger: 'blur' }]
},
qrcodeStr: '',
dialogFormQrcode: false,
config: config
}
},
created() {
this.getList(this.ROLE_ID)
},
methods: {
getRowKey(row) {
return row.VERSIONMANAGER_ID
},
//
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
getReset() {
this.KEYWORDS = null
this.getList()
},
//
getList() {
this.listLoading = true
requestFN(
'/versionmanagerFirst/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
ISUPDATE: this.ISUPDATE
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
//
handleAdd() {
this.dialogType = 'add'
this.resetForm()
this.getDict()
this.dialogFormEdit = true
},
//
handleShow(ID) {
this.getDict()
this.dialogType = 'edit'
requestFN(
'/versionmanagerFirst/goEdit',
{
VERSIONMANAGER_ID: ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
}).catch((e) => {
this.listLoading = false
})
this.dialogFormShow = true
},
//
handleEdit(ID) {
this.getDict()
this.dialogType = 'edit'
requestFN(
'/versionmanagerFirst/goEdit',
{
VERSIONMANAGER_ID: ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
}).catch((e) => {
this.listLoading = false
})
this.dialogFormEdit = true
},
handleCover(ID) {
this.$confirm('确定要覆盖现有的扫码版本吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/versionmanagerFirst/cover',
{
VERSIONMANAGER_ID: ID
}
).then((data) => {
this.$message({
message: data.result === 'success' ? 'App版本' + data.pd.VERSION + '覆盖成功' : 'App版本' + data.pd.VERSION + '覆盖异常',
type: data.result
})
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
//
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
const formData = new FormData()
Object.keys(this.form).map(key => {
formData.append(key, this.form[key])
})
upload(
'/versionmanagerFirst/' + this.dialogType,
formData
).then((data) => {
this.listLoading = false
this.dialogFormEdit = false
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/versionmanagerFirst/delete',
{
VERSIONMANAGER_ID: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.VERSIONMANAGER_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/versionmanagerFirst/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
//
hasButton: function() {
var keys = 'versionmanager:add,versionmanager:del,versionmanager:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.versionmanagerfhadminadd //
this.del = data.versionmanagerfhadmindel //
this.edit = data.versionmanagerfhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
//
getDict: function() {
},
resetForm() {
this.form = {
VERSIONMANAGER_ID: '', // 1
VERSION: '', //
FILEURL: '', //
FILETYPE: 1, //
OPUSER: '', //
OPTIME: '', //
ISEFFECTIVE: '', //
ISDELETE: 0,
ISUPDATE: ''// 12
}
},
// beforeListingFileUpload(file) {
// this.form.FILEURL = file
// this.form.FILEURLName = file.name
// this.$forceUpdate()
// return false
// },
beforeListingFileUpload(file) {
const suffix = file.name.substring(file.name.lastIndexOf('.'), file.name.length)
if (suffix === '.apk') {
this.form.FILEURL = file
this.form.FILEURLName = file.name
this.$forceUpdate()
return false
} else {
this.$message.warning('请上传apk文件')
}
return false
},
chongzhiFujian(key) {
this.form[key] = ''
},
//
goqrcode() {
this.qrcodeStr = config.fileUrl + 'uploadFiles/app/first.apk'
this.dialogFormQrcode = true
},
download(filePah) {
window.open(this.config.fileUrl + filePah, '_blank')
}
}
}
</script>

View File

@ -0,0 +1,433 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="KEYWORDS" placeholder="搜索" class="filter-item" style="width: 200px;"/>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="getReset">
重置
</el-button>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号 " width="50" align="center" />
<el-table-column prop="VERSION" label="版本" />
<el-table-column prop="FILEURL" label="文件地址">
<template slot-scope="{row}">
<span v-if="row.FILEURL" @click="download(row.FILEURL)">[]</span>
</template>
</el-table-column>
<el-table-column prop="FILETYPE" label="文件类型" />
<el-table-column prop="OPUSER" label="操作人" />
<el-table-column prop="OPTIME" label="操作日期" />
<el-table-column prop="ISEFFECTIVE" label="是否有效">
<template slot-scope="{row}">
<span v-if="row.ISEFFECTIVE =='1'"></span>
<span v-if="row.ISEFFECTIVE =='2'"></span>
</template>
</el-table-column>
<el-table-column prop="ISUPDATE" label="是否强制更新">
<template slot-scope="{row}">
<span v-if="row.ISUPDATE =='1'"></span>
<span v-if="row.ISUPDATE =='2'"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<!-- <el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.VERSIONMANAGER_ID)"></el-button>-->
<el-button v-show="edit" type="success" icon="el-icon-view" size="mini" @click="handleShow(row.VERSIONMANAGER_ID)"></el-button>
<!-- <el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.VERSIONMANAGER_ID)"></el-button>-->
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<!-- <el-button v-show="del" type="danger" icon="el-icon-delete" plain @click="batchDel"></el-button>-->
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<el-dialog :visible.sync="dialogFormShow" :title="dialogType==='edit'?'查看':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="版本" prop="VERSION">
<el-input ref="VERSION" v-model="form.VERSION" maxlength="255" placeholder="这里输入版本..." title="版本"/>
</el-form-item>
<el-form-item label="文件地址" prop="FILEURL">
<el-row v-if="form.FILEURL && form.FILEURL.length >0" style="width: 100%">
<el-col :span="12">
<a v-if="form.FILEURL" @click="download(form.FILEURL)"></a>
</el-col>
</el-row>
<el-row v-else style="width: 100%">
<div style="display: flex;">
<el-input v-model="form.FILEURLName" :disabled="true" title="文件名称"/>
<el-upload
:before-upload="beforeListingFileUpload"
class="avatar-uploader"
action="#">
<el-button type="primary" icon="el-icon-upload" style="margin-left:10px; " plain>上传附件</el-button>
</el-upload>
</div>
</el-row>
</el-form-item>
<el-form-item label="文件类型" prop="FILETYPE">
<el-input ref="FILETYPE" v-model="form.FILETYPE" maxlength="255" placeholder="这里输入文件类型..." title="文件类型"/>
</el-form-item>
<el-form-item label="是否有效" prop="ISEFFECTIVE">
<el-radio v-model="form.ISEFFECTIVE" label="1"></el-radio>
<el-radio v-model="form.ISEFFECTIVE" label="2"></el-radio>
</el-form-item>
<el-form-item label="是否强制更新" prop="ISUPDATE">
<el-radio v-model="form.ISUPDATE" label="1"></el-radio>
<el-radio v-model="form.ISUPDATE" label="2"></el-radio>
</el-form-item>
</el-form>
</el-dialog>
<el-dialog :visible.sync="dialogFormEdit" :title="dialogType==='edit'?'查看':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="版本" prop="VERSION">
<el-input id="VERSION" ref="VERSION" v-model="form.VERSION" maxlength="255" placeholder="这里输入版本..." title="版本"/>
</el-form-item>
<el-form-item label="文件地址" prop="FILEURL">
<el-row v-if="form.FILEURL && form.FILEURL.length >0" style="width: 100%">
<el-col :span="12">
<a v-if="form.FILEURL" @click="download(form.FILEURL)"></a>
</el-col>
<el-col :span="12">
<el-button @click="chongzhiFujian('FILEURL')"></el-button>
</el-col>
</el-row>
<el-row v-else style="width: 100%">
<div style="display: flex;">
<el-input v-model="form.FILEURLName" :disabled="true" title="文件名称"/>
<el-upload
:before-upload="beforeListingFileUpload"
accept=".apk"
class="avatar-uploader"
action="#">
<el-button type="primary" icon="el-icon-upload" style="margin-left:10px; " plain>上传附件</el-button>
</el-upload>
</div>
</el-row>
</el-form-item>
<el-form-item label="文件类型" prop="FILETYPE">
<el-input id="FILETYPE" ref="FILETYPE" v-model="form.FILETYPE" maxlength="255" disabled placeholder="这里输入文件类型..." title="文件类型"/>
</el-form-item>
<!-- <el-form-item label="是否有效" prop="ISEFFECTIVE">-->
<!-- <el-input id="ISEFFECTIVE" ref="ISEFFECTIVE" v-model="form.ISEFFECTIVE" maxlength="255" placeholder="这里输入是否有效..." title="是否有效"/>-->
<!-- </el-form-item>-->
<el-form-item label="是否有效" prop="ISEFFECTIVE">
<!-- <el-input ref="ISEFFECTIVE" v-model="form.ISEFFECTIVE" maxlength="255" placeholder="这里输入是否有效..." title="是否有效"/>-->
<el-radio v-model="form.ISEFFECTIVE" label="1"></el-radio>
<el-radio v-model="form.ISEFFECTIVE" label="2"></el-radio>
</el-form-item>
<el-form-item label="是否强制更新" prop="ISUPDATE">
<el-radio v-model="form.ISUPDATE" label="1"></el-radio>
<el-radio v-model="form.ISUPDATE" label="2"></el-radio>
<!-- <el-input id="ISUPDATE" ref="ISUPDATE" v-model="form.ISUPDATE" maxlength="255" placeholder="这里输入是否更新 1强制更新2不强制更新..." title="是否更新 1强制更新2不强制更新"/>-->
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import { upload } from '@/utils/upload'
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
varList: [],
pd: [],
form: {
VERSIONMANAGER_ID: '', // 1
VERSION: '', //
FILEURL: '', //
FILEURLName: '',
FILETYPE: '', //
OPUSER: '', //
OPTIME: '', //
ISEFFECTIVE: '', //
ISUPDATE: ''// 12
},
multipleSelectionAll: [], //
multipleSelection: [], //
dialogFormEdit: false,
dialogFormShow: false,
dialogType: 'add',
rules: {
VERSIONMANAGER_ID: [{ required: true, message: '备注1不能为空', trigger: 'blur' }],
VERSION: [{ required: true, message: '版本不能为空', trigger: 'blur' }],
FILEURL: [{ required: true, message: '文件地址不能为空', trigger: 'blur' }],
FILETYPE: [{ required: true, message: '文件类型不能为空', trigger: 'blur' }],
OPUSER: [{ required: true, message: '操作人不能为空', trigger: 'blur' }],
OPTIME: [{ required: true, message: '操作日期不能为空', trigger: 'blur' }],
ISEFFECTIVE: [{ required: true, message: '是否有效不能为空', trigger: 'blur' }],
ISUPDATE: [{ required: true, message: '是否更新 1强制更新2不强制更新不能为空', trigger: 'blur' }]
},
config: config
}
},
created() {
this.getList(this.ROLE_ID)
},
methods: {
getRowKey(row) {
return row.VERSIONMANAGER_ID
},
//
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
getReset() {
this.KEYWORDS = null
this.getList()
},
//
getList() {
this.listLoading = true
requestFN(
'/versionmanagerReg/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
ISUPDATE: this.ISUPDATE
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
//
handleAdd() {
this.dialogType = 'add'
this.resetForm()
this.getDict()
this.dialogFormEdit = true
},
//
handleShow(ID) {
this.getDict()
this.dialogType = 'edit'
requestFN(
'/versionmanagerReg/goEdit',
{
VERSIONMANAGER_ID: ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
}).catch((e) => {
this.listLoading = false
})
this.dialogFormShow = true
},
//
handleEdit(ID) {
this.getDict()
this.dialogType = 'edit'
requestFN(
'/versionmanagerReg/goEdit',
{
VERSIONMANAGER_ID: ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
}).catch((e) => {
this.listLoading = false
})
this.dialogFormEdit = true
},
//
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
const formData = new FormData()
Object.keys(this.form).map(key => {
formData.append(key, this.form[key])
})
upload(
'/versionmanagerReg/' + this.dialogType,
formData
).then((data) => {
this.listLoading = false
this.dialogFormEdit = false
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/versionmanagerReg/delete',
{
VERSIONMANAGER_ID: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.VERSIONMANAGER_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/versionmanagerReg/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
//
hasButton: function() {
var keys = 'versionmanager:add,versionmanager:del,versionmanager:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.versionmanagerfhadminadd //
this.del = data.versionmanagerfhadmindel //
this.edit = data.versionmanagerfhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
//
getDict: function() {
},
resetForm() {
this.form = {
VERSIONMANAGER_ID: '', // 1
VERSION: '', //
FILEURL: '', //
FILETYPE: 1, //
OPUSER: '', //
OPTIME: '', //
ISEFFECTIVE: '', //
ISDELETE: 0,
ISUPDATE: ''// 12
}
},
beforeListingFileUpload(file) {
const suffix = file.name.substring(file.name.lastIndexOf('.'), file.name.length)
if (suffix === '.apk') {
this.form.FILEURL = file
this.form.FILEURLName = file.name
this.$forceUpdate()
return false
} else {
this.$message.warning('请上传apk文件')
}
return false
},
// beforeListingFileUpload(file) {
// this.form.FILEURL = file
// this.form.FILEURLName = file.name
// this.$forceUpdate()
// return false
// },
chongzhiFujian(key) {
this.form[key] = ''
},
download(filePah) {
window.open(this.config.fileUrl + filePah, '_blank')
}
}
}
</script>

View File

@ -0,0 +1,433 @@
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="KEYWORDS" placeholder="搜索" class="filter-item" style="width: 200px;"/>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="getQuery">
搜索
</el-button>
<el-button v-waves class="filter-item" type="success" icon="el-icon-refresh" @click="getReset">
重置
</el-button>
</div>
<el-table
v-loading="listLoading"
ref="multipleTable"
:data="varList"
:row-key="getRowKey"
:header-cell-style="{
'font-weight': 'bold',
'color': '#000'
}"
tooltip-effect="dark"
border
fit
highlight-current-row
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55"
align="center"/>
<el-table-column type="index" label="序号 " width="50" align="center" />
<el-table-column prop="VERSION" label="版本" />
<el-table-column prop="FILEURL" label="文件地址">
<template slot-scope="{row}">
<span v-if="row.FILEURL" @click="download(row.FILEURL)">[]</span>
</template>
</el-table-column>
<el-table-column prop="FILETYPE" label="文件类型" />
<el-table-column prop="OPUSER" label="操作人" />
<el-table-column prop="OPTIME" label="操作日期" />
<el-table-column prop="ISEFFECTIVE" label="是否有效">
<template slot-scope="{row}">
<span v-if="row.ISEFFECTIVE =='1'"></span>
<span v-if="row.ISEFFECTIVE =='2'"></span>
</template>
</el-table-column>
<el-table-column prop="ISUPDATE" label="是否强制更新">
<template slot-scope="{row}">
<span v-if="row.ISUPDATE =='1'"></span>
<span v-if="row.ISUPDATE =='2'"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="{row}">
<!-- <el-button v-show="edit" type="primary" icon="el-icon-edit" size="mini" @click="handleEdit(row.VERSIONMANAGER_ID)"></el-button>-->
<el-button v-show="edit" type="success" icon="el-icon-view" size="mini" @click="handleShow(row.VERSIONMANAGER_ID)"></el-button>
<!-- <el-button v-show="del" type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row.VERSIONMANAGER_ID)"></el-button>-->
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div>
<el-button v-show="add" type="primary" icon="el-icon-plus" @click="handleAdd"></el-button>
<!-- <el-button v-show="del" type="danger" icon="el-icon-delete" plain @click="batchDel"></el-button>-->
</div>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
<el-dialog :visible.sync="dialogFormShow" :title="dialogType==='edit'?'查看':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="版本" prop="VERSION">
<el-input ref="VERSION" v-model="form.VERSION" maxlength="255" placeholder="这里输入版本..." title="版本"/>
</el-form-item>
<el-form-item label="文件地址" prop="FILEURL">
<el-row v-if="form.FILEURL && form.FILEURL.length >0" style="width: 100%">
<el-col :span="12">
<a v-if="form.FILEURL" @click="download(form.FILEURL)"></a>
</el-col>
</el-row>
<el-row v-else style="width: 100%">
<div style="display: flex;">
<el-input v-model="form.FILEURLName" :disabled="true" title="文件名称"/>
<el-upload
:before-upload="beforeListingFileUpload"
class="avatar-uploader"
action="#">
<el-button type="primary" icon="el-icon-upload" style="margin-left:10px; " plain>上传附件</el-button>
</el-upload>
</div>
</el-row>
</el-form-item>
<el-form-item label="文件类型" prop="FILETYPE">
<el-input ref="FILETYPE" v-model="form.FILETYPE" maxlength="255" placeholder="这里输入文件类型..." title="文件类型"/>
</el-form-item>
<el-form-item label="是否有效" prop="ISEFFECTIVE">
<el-radio v-model="form.ISEFFECTIVE" label="1"></el-radio>
<el-radio v-model="form.ISEFFECTIVE" label="2"></el-radio>
</el-form-item>
<el-form-item label="是否强制更新" prop="ISUPDATE">
<el-radio v-model="form.ISUPDATE" label="1"></el-radio>
<el-radio v-model="form.ISUPDATE" label="2"></el-radio>
</el-form-item>
</el-form>
</el-dialog>
<el-dialog :visible.sync="dialogFormEdit" :title="dialogType==='edit'?'查看':'新增'" width="600px">
<el-form ref="form" :rules="rules" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="版本" prop="VERSION">
<el-input id="VERSION" ref="VERSION" v-model="form.VERSION" maxlength="255" placeholder="这里输入版本..." title="版本"/>
</el-form-item>
<el-form-item label="文件地址" prop="FILEURL">
<el-row v-if="form.FILEURL && form.FILEURL.length >0" style="width: 100%">
<el-col :span="12">
<a v-if="form.FILEURL" @click="download(form.FILEURL)"></a>
</el-col>
<el-col :span="12">
<el-button @click="chongzhiFujian('FILEURL')"></el-button>
</el-col>
</el-row>
<el-row v-else style="width: 100%">
<div style="display: flex;">
<el-input v-model="form.FILEURLName" :disabled="true" title="文件名称"/>
<el-upload
:before-upload="beforeListingFileUpload"
class="avatar-uploader"
accept=".apk"
action="#">
<el-button type="primary" icon="el-icon-upload" style="margin-left:10px; " plain>上传附件</el-button>
</el-upload>
</div>
</el-row>
</el-form-item>
<el-form-item label="文件类型" prop="FILETYPE">
<el-input id="FILETYPE" ref="FILETYPE" v-model="form.FILETYPE" maxlength="255" disabled placeholder="这里输入文件类型..." title="文件类型"/>
</el-form-item>
<!-- <el-form-item label="是否有效" prop="ISEFFECTIVE">-->
<!-- <el-input id="ISEFFECTIVE" ref="ISEFFECTIVE" v-model="form.ISEFFECTIVE" maxlength="255" placeholder="这里输入是否有效..." title="是否有效"/>-->
<!-- </el-form-item>-->
<el-form-item label="是否有效" prop="ISEFFECTIVE">
<!-- <el-input ref="ISEFFECTIVE" v-model="form.ISEFFECTIVE" maxlength="255" placeholder="这里输入是否有效..." title="是否有效"/>-->
<el-radio v-model="form.ISEFFECTIVE" label="1"></el-radio>
<el-radio v-model="form.ISEFFECTIVE" label="2"></el-radio>
</el-form-item>
<el-form-item label="是否强制更新" prop="ISUPDATE">
<el-radio v-model="form.ISUPDATE" label="1"></el-radio>
<el-radio v-model="form.ISUPDATE" label="2"></el-radio>
<!-- <el-input id="ISUPDATE" ref="ISUPDATE" v-model="form.ISUPDATE" maxlength="255" placeholder="这里输入是否更新 1强制更新2不强制更新..." title="是否更新 1强制更新2不强制更新"/>-->
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormEdit = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import { upload } from '@/utils/upload'
export default {
components: { Pagination },
directives: { waves },
data() {
return {
listLoading: true,
add: false,
del: false,
edit: false,
listQuery: {
page: 1,
limit: 20
},
total: 0,
KEYWORDS: '',
varList: [],
pd: [],
form: {
VERSIONMANAGER_ID: '', // 1
VERSION: '', //
FILEURL: '', //
FILEURLName: '',
FILETYPE: '', //
OPUSER: '', //
OPTIME: '', //
ISEFFECTIVE: '', //
ISUPDATE: ''// 12
},
multipleSelectionAll: [], //
multipleSelection: [], //
dialogFormEdit: false,
dialogFormShow: false,
dialogType: 'add',
rules: {
VERSIONMANAGER_ID: [{ required: true, message: '备注1不能为空', trigger: 'blur' }],
VERSION: [{ required: true, message: '版本不能为空', trigger: 'blur' }],
FILEURL: [{ required: true, message: '文件地址不能为空', trigger: 'blur' }],
FILETYPE: [{ required: true, message: '文件类型不能为空', trigger: 'blur' }],
OPUSER: [{ required: true, message: '操作人不能为空', trigger: 'blur' }],
OPTIME: [{ required: true, message: '操作日期不能为空', trigger: 'blur' }],
ISEFFECTIVE: [{ required: true, message: '是否有效不能为空', trigger: 'blur' }],
ISUPDATE: [{ required: true, message: '是否更新 1强制更新2不强制更新不能为空', trigger: 'blur' }]
},
config: config
}
},
created() {
this.getList(this.ROLE_ID)
},
methods: {
getRowKey(row) {
return row.VERSIONMANAGER_ID
},
//
getQuery() {
this.$refs.multipleTable.clearSelection()
this.getList()
},
getReset() {
this.KEYWORDS = null
this.getList()
},
//
getList() {
this.listLoading = true
requestFN(
'/versionmanagerXgf/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
KEYWORDS: this.KEYWORDS,
ISUPDATE: this.ISUPDATE
}
).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd
}).catch((e) => {
this.listLoading = false
})
},
//
handleAdd() {
this.dialogType = 'add'
this.resetForm()
this.getDict()
this.dialogFormEdit = true
},
//
handleShow(ID) {
this.getDict()
this.dialogType = 'edit'
requestFN(
'/versionmanagerXgf/goEdit',
{
VERSIONMANAGER_ID: ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
}).catch((e) => {
this.listLoading = false
})
this.dialogFormShow = true
},
//
handleEdit(ID) {
this.getDict()
this.dialogType = 'edit'
requestFN(
'/versionmanagerXgf/goEdit',
{
VERSIONMANAGER_ID: ID
}
).then((data) => {
this.form = Object.assign({}, data.pd) // copy obj
}).catch((e) => {
this.listLoading = false
})
this.dialogFormEdit = true
},
//
confirm() {
this.$refs.form.validate(valid => {
if (valid) {
this.listLoading = true
const formData = new FormData()
Object.keys(this.form).map(key => {
formData.append(key, this.form[key])
})
upload(
'/versionmanagerXgf/' + this.dialogType,
formData
).then((data) => {
this.listLoading = false
this.dialogFormEdit = false
this.getList()
}).catch((e) => {
this.listLoading = false
})
} else {
return false
}
})
},
handleDelete(id) {
this.$confirm('确定要删除吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/versionmanagerXgf/delete',
{
VERSIONMANAGER_ID: id
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
batchDel() {
const _selectData = this.$refs.multipleTable.selection
if (_selectData == null || _selectData.length == 0) {
this.$message({
message: '请选中要删除的项...',
type: 'error'
})
return false
}
const ids = _selectData.map((item, index) => {
return item.VERSIONMANAGER_ID
}).join(',')
this.$confirm('确定要删除选中的数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.listLoading = true
requestFN(
'/versionmanagerXgf/deleteAll',
{
DATA_IDS: ids
}
).then(() => {
this.$message({
message: '删除成功',
type: 'success'
})
this.listLoading = false
this.varList = []
this.listQuery.page = 1
this.$refs.multipleTable.clearSelection()
this.getList()
}).catch((e) => {
this.listLoading = false
})
}).catch(() => {
})
},
//
hasButton: function() {
var keys = 'versionmanager:add,versionmanager:del,versionmanager:edit,toExcel'
requestFN(
'/head/hasButton',
{
keys: keys
}
).then((data) => {
this.add = data.versionmanagerfhadminadd //
this.del = data.versionmanagerfhadmindel //
this.edit = data.versionmanagerfhadminedit //
}).catch((e) => {
this.listLoading = false
})
},
//
getDict: function() {
},
resetForm() {
this.form = {
VERSIONMANAGER_ID: '', // 1
VERSION: '', //
FILEURL: '', //
FILETYPE: 1, //
OPUSER: '', //
OPTIME: '', //
ISEFFECTIVE: '', //
ISDELETE: 0,
ISUPDATE: ''// 12
}
},
beforeListingFileUpload(file) {
const suffix = file.name.substring(file.name.lastIndexOf('.'), file.name.length)
if (suffix === '.apk') {
this.form.FILEURL = file
this.form.FILEURLName = file.name
this.$forceUpdate()
return false
} else {
this.$message.warning('请上传apk文件')
}
return false
},
// beforeListingFileUpload(file) {
// this.form.FILEURL = file
// this.form.FILEURLName = file.name
// this.$forceUpdate()
// return false
// },
chongzhiFujian(key) {
this.form[key] = ''
},
download(filePah) {
window.open(this.config.fileUrl + filePah, '_blank')
}
}
}
</script>