Commit 73e04e68 authored by shen_yan_pu's avatar shen_yan_pu

Merge remote-tracking branch 'origin/zdTest' into zdTest

parents 78a3a205 c10db975
......@@ -46,7 +46,10 @@ export function addType(data) {
return request({
url: '/system/dict/type/add',
method: 'post',
data: data
data: data,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
}
......@@ -55,9 +58,12 @@ export function updateType(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/system/dict/type/update/',
url: '/system/dict/type/update/' + businessId,
method: 'put',
data: data
data: data,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
}
......@@ -88,12 +94,12 @@ export function exportType(query) {
}
// 获取字典选择框列表
export function optionselect() {
return request({
url: '/authority/system/dict/type/selectFather',
method: 'get'
})
}
// export function optionselect() {
// return request({
// url: '/authority/system/dict/type/selectFather',
// method: 'get'
// })
// }
// 获取字典选择框列表
export function selectDictType(dictType) {
return request({
......
import request from '@/utils/request'
import Qs from 'qs'
// 查询岗位列表
export function listPost(query) {
return request({
......@@ -19,19 +19,28 @@ export function getPost(postId) {
// 新增岗位
export function addPost(data) {
data = Qs.stringify(data)
return request({
url: '/system/post/add',
method: 'post',
data: data
data: data,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
}
// 修改岗位
export function updatePost(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/system/post/update/',
url: '/system/post/update/' + businessId,
method: 'put',
data: data
data: data,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
}
......
......@@ -58,11 +58,11 @@
<div class="mb12 font-small-bold">字典参数列表</div>
<el-table v-loading="loading" :data="dataList" border>
<el-table-column type="index" label="序号" width="50" />
<!-- <el-table-column :show-overflow-tooltip="true" label="参数编码" prop="dictCode">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.dictCode || '-' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column :show-overflow-tooltip="true" label="参数编码" prop="dictCode">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.dictCode || '-' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column :show-overflow-tooltip="true" label="参数标签" prop="dictLabel">
<template slot-scope="scope">
{{ scope.row.dictLabel || '-' }}
......@@ -138,7 +138,7 @@
<el-input v-model.trim="form.dictValue" show-word-limit maxlength="300" placeholder="请输入参数键值" />
</el-form-item>
<el-form-item label="参数排序" prop="dictSort">
<el-input-number style="width: 100%" v-model="form.dictSort" controls-position="right" :min="0" />
<el-input-number v-model="form.dictSort" style="width: 100%" controls-position="right" :min="0" />
</el-form-item>
<el-form-item label="参数状态" prop="status">
<el-radio-group v-model="form.status">
......@@ -164,6 +164,7 @@
<script>
import { listData, getData, delData, addData, updateData, exportData, checkDictLabelUnique } from '@/api/system/dict/data'
import { listType, getType } from '@/api/system/dict/type'
import dictCons from '@/utils/dictCons'
export default {
name: 'Data',
......@@ -261,9 +262,9 @@ export default {
const dictId = this.$route.query && this.$route.query.dictId
this.getType(dictId)
this.getTypeList()
// this.getDicts('sys_normal_disable').then(response => {
// this.statusOptions = response.data
// })
this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
this.statusOptions = response.data;
})
},
methods: {
// 状态
......@@ -415,16 +416,24 @@ export default {
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
exportData(queryParams).then(response => {
this.download(response.msg)
}).catch(function() {})
// this.$confirm('是否确认导出所有数据项?', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(function() {
// return exportData(queryParams)
// })
this.$confirm('是否确认导出所有数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportData(queryParams).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接
downloadElement.href = href
downloadElement.download = '字典数据信息' + '.xls' // 下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click()// 点击下载
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
// this.download(response.msg);
})
})
}
}
}
......
......@@ -55,39 +55,39 @@
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
</el-form-item>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
v-hasPermi="['system:dict:add']"
type="primary"
icon="el-icon-plus"
size="small"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:dict:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:dict:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
v-hasPermi="['system:dict:add']"
type="primary"
icon="el-icon-plus"
size="small"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:dict:edit']"
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:dict:remove']"
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['system:dict:export']"
type="success"
......@@ -95,16 +95,16 @@
size="small"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</el-col>
<right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
</el-row>
</el-form>
<div class="placeholder" />
<div style="min-height: 445px;padding:10px">
<h5 style="margin: 0 0 12px 0;font-size: 14px">字典管理列表</h5>
<el-table v-loading="loading" border :data="typeList">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="字典编号" align="center" prop="businessId"/>
<el-table v-loading="loading" border :data="typeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="字典编号" align="center" prop="businessId" />
<el-table-column label="字典名称" prop="dictName" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.dictName || '-' }}
......@@ -116,7 +116,7 @@
<router-link
v-if="scope.row.businessId"
:style="{ pointerEvents: $haveAuth('system:dictConfig:list') ? '' : 'none' }"
:to="'/dictData?businessId=' + scope.row.businessId"
:to="'/dict/type/data/' + scope.row.businessId"
class="link-type"
>
<span :style="{color: $haveAuth('system:dictConfig:list') ? '#20a0ff' : '#333333' }">{{ scope.row.dictType }}</span>
......@@ -124,7 +124,7 @@
<div v-else>-</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="flag" :formatter="statusFormat"/>
<el-table-column label="状态" align="center" prop="flag" :formatter="statusFormat" />
<el-table-column label="备注" prop="remark" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.remarks || '-' }}
......@@ -165,10 +165,10 @@
<el-dialog title="字典信息" :visible.sync="open" width="500px" append-to-body @close="reset">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="字典名称" prop="dictName">
<el-input v-model.trim="form.dictName" :maxlength="30" placeholder="请输入字典名称" />
<el-input v-model.trim="form.dictName" :maxlength="30" placeholder="请输入字典名称" />
</el-form-item>
<el-form-item label="字典类型" prop="dictType">
<el-input v-model.trim="form.dictType" :maxlength="30" placeholder="请输入字典类型" />
<el-input v-model.trim="form.dictType" :maxlength="30" placeholder="请输入字典类型" />
</el-form-item>
<el-form-item label="状态" prop="flag">
<el-radio-group v-model="form.flag">
......@@ -180,33 +180,33 @@
</el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="父字典名称">-->
<!-- <el-select v-model="form.parentId" style="width: 100%" clearable placeholder="请选择父字典类型" @change="getOptions">-->
<!-- <el-option-->
<!-- v-for="item in options"-->
<!-- :key="item.businessId"-->
<!-- :label="item.dictName"-->
<!-- :value="item.businessId"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-show="form.parentId">-->
<!-- <el-select v-model="form.dataId" style="width: 100%" clearable placeholder="请选择父字典类型" @visible-change="clearSelected">-->
<!-- <el-option-->
<!-- v-for="item in optionsDict"-->
<!-- :key="item.dictCode"-->
<!-- :label="item.dictLabel"-->
<!-- :disabled="item.status == 1"-->
<!-- :value="item.dictCode"-->
<!-- >-->
<!-- <el-form-item label="父字典名称">-->
<!-- <el-select v-model="form.parentId" style="width: 100%" clearable placeholder="请选择父字典类型" @change="getOptions">-->
<!-- <el-option-->
<!-- v-for="item in options"-->
<!-- :key="item.businessId"-->
<!-- :label="item.dictName"-->
<!-- :value="item.businessId"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-show="form.parentId">-->
<!-- <el-select v-model="form.dataId" style="width: 100%" clearable placeholder="请选择父字典类型" @visible-change="clearSelected">-->
<!-- <el-option-->
<!-- v-for="item in optionsDict"-->
<!-- :key="item.dictCode"-->
<!-- :label="item.dictLabel"-->
<!-- :disabled="item.status == 1"-->
<!-- :value="item.dictCode"-->
<!-- >-->
<!-- <span style="float: left">{{ item.dictLabel }}</span>-->
<!-- <span v-if="item.status === '1'" style="float: right; color: #8492a6; font-size: 12px;padding-left: 10px">{{ '已停用' }}</span>-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <span style="float: left">{{ item.dictLabel }}</span>-->
<!-- <span v-if="item.status === '1'" style="float: right; color: #8492a6; font-size: 12px;padding-left: 10px">{{ '已停用' }}</span>-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="备注" prop="remark">
<el-input v-model.trim="form.remark" maxlength="200" type="textarea" placeholder="请输入内容" />
<el-input v-model.trim="form.remark" maxlength="200" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -230,6 +230,7 @@ import { listType,
checkDictNameUnique,
selectDictType
} from '@/api/system/dict/type'
import dictCons from '@/utils/dictCons'
export default {
name: 'Dict',
......@@ -317,7 +318,8 @@ export default {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined
dictType: undefined,
flag: undefined
// status: undefined
},
// 表单参数
......@@ -343,7 +345,7 @@ export default {
},
created() {
this.getList()
this.getDicts('sys_normal_disable'.toUpperCase()).then(response => {
this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
this.statusOptions = response.data
})
optionselect().then(response => {
......@@ -374,7 +376,7 @@ export default {
if (this.form.dataId) {
// 如果找不到 下拉框选项中对应选中的选项 或者 下拉框选项中对应选中的选项 状态为1(停用)则将双向绑定的数据清空
if (!this.optionsDict.find(item => { return item.dictCode === this.form.dataId }) ||
this.optionsDict.find(item => { return item.dictCode === this.form.dataId }).status == 1) {
this.optionsDict.find(item => { return item.dictCode === this.form.dataId }).status === 1) {
this.form.dataId = ''
}
}
......@@ -399,7 +401,7 @@ export default {
},
// 字典状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status)
return this.selectDictLabel(this.statusOptions, row.flag)
},
// 取消按钮
cancel() {
......@@ -415,17 +417,19 @@ export default {
dictName: undefined,
dictType: undefined,
status: '0',
remark: undefined
remark: undefined,
flag: '1'
}
},
/** 查询按钮操作 */
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
// this.dateRange = []
this.dateRange = []
this.resetForm('queryForm')
this.handleQuery()
},
/** 新增按钮操作 */
......@@ -443,25 +447,34 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
this.form.dictName = row.dictName
this.form.dictType = row.dictType
this.form.remark = row.remark
this.form.dictNameOne = row.dictName
this.form.dictTypeOne = row.dictType
this.form.businessId = row.businessId
const parentId = row.parentId
if (parentId) {
this.form.parentId = parentId
selectDictType(this.options.find(item => { return item.businessId === parentId }).dictType).then(response => {
this.optionsDict = response.data
})
}
if (row.dataId) {
this.form.dataId = row.dataId
}
this.open = true
this.title = 'update'
const dictId = row.businessId || this.ids
getType(dictId).then(response => {
this.form = response.data
this.open = true
this.title = '修改字典类型'
})
},
// handleUpdate(row) {
// this.reset()
// this.form.dictName = row.dictName
// this.form.dictType = row.dictType
// this.form.remark = row.remark
// this.form.dictNameOne = row.dictName
// this.form.dictTypeOne = row.dictType
// this.form.businessId = row.businessId
// const parentId = row.parentId
// if (parentId) {
// this.form.parentId = parentId
// selectDictType(this.options.find(item => { return item.businessId === parentId }).dictType).then(response => {
// this.optionsDict = response.data
// })
// }
// if (row.dataId) {
// this.form.dataId = row.dataId
// }
// this.open = true
// this.title = 'update'
// },
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
......@@ -517,16 +530,24 @@ export default {
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
exportType(queryParams).then(response => {
this.download(response.msg)
}).catch(function() {})
// this.$confirm('是否确认导出所有类型数据项?', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(function() {
// return exportType(queryParams)
// })
this.$confirm('是否确认导出所有类型数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportType(queryParams).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接
downloadElement.href = href
downloadElement.download = '字典类型信息' + '.xls' // 下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click()// 点击下载
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
// this.download(response.msg);
})
})
},
/** 清理缓存按钮操作 */
handleClearCache() {
......
<template>
<div class="app-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true" v-show="showSearch" label-width="68px">
<el-form v-show="showSearch" ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true" label-width="68px">
<el-form-item label="岗位名称" prop="postName">
<el-input
v-model="queryParams.postName"
......@@ -76,13 +76,13 @@
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
</el-row>
</el-form>
<div class="placeholder" />
<div style="padding:10px">
<div class="mb12 font-small-bold">岗位管理列表</div>
<el-table :data="postList" border>
<el-table v-loading="loading" :data="postList" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column :show-overflow-tooltip="true" label="岗位编号" align="center" prop="businessId">
<template slot-scope="scope">
......@@ -104,10 +104,10 @@
{{ scope.row.postSort || '-' }}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="状态" align="center" prop="flag">
<template slot-scope="scope">
{{ scope.row.flag || '-' }}
</template>
<el-table-column label="状态" align="center" prop="flag" :formatter="statusFormat">
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.flag || '-' }}-->
<!-- </template>-->
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="创建时间" align="center" prop="createDate" width="180">
<template slot-scope="scope">
......@@ -192,8 +192,8 @@
:key="dict.dictValue"
:label="dict.dictValue"
>{{ dict.dictLabel }}
<!-- <el-radio label="0">正常</el-radio>-->
<!-- <el-radio label="1">停用</el-radio>-->
<!-- <el-radio label="0">正常</el-radio>-->
<!-- <el-radio label="1">停用</el-radio>-->
</el-radio>
</el-radio-group>
</el-form-item>
......@@ -316,8 +316,8 @@ export default {
rows: 10,
postCode: undefined,
postName: undefined,
flag: undefined,
status: ''
flag: undefined
// status: ''
},
// 表单参数
form: {
......@@ -436,7 +436,7 @@ export default {
deptId: undefined,
postSort: 0,
flag: '1',
status: '0',
// status: '0',
remark: undefined,
postNameAfter: undefined,
postNameBefore: undefined
......@@ -534,16 +534,24 @@ export default {
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
exportPost(queryParams).then(response => {
this.download(response.msg)
}).catch(function() {
this.$confirm('是否确认导出所有岗位数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportPost(queryParams).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接
downloadElement.href = href
downloadElement.download = '岗位信息' + '.xls' // 下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click()// 点击下载
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
// this.download(response.msg);
})
})
// this.$confirm('是否确认导出所有职务数据项?', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(function() {
// return
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment