Commit 873b9222 authored by kzy's avatar kzy

Merge branch 'project1' of http://gitlab.91isoft.com:90/yangshuo/template_vue into project1

parents 9fd7a8fe b7553eed
...@@ -20,6 +20,13 @@ export function add(data) { ...@@ -20,6 +20,13 @@ export function add(data) {
}) })
} }
// 根据id查询基础信息接口
export function getDetailById(id) {
return request({
url: '/wbbaseinfo/detail/' + id,
method: 'get'
})
}
// 修改基础信息接口 // 修改基础信息接口
export function updataInfo(data) { export function updataInfo(data) {
return request({ return request({
......
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
</template> </template>
<script> <script>
import { add, listBasicInfo, updataInfo} from '@/api/equipment/basicInfo' import { add, listBasicInfo, updataInfo, getDetailById } from '@/api/equipment/basicInfo'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
export default { export default {
name: 'Role', name: 'Role',
...@@ -306,7 +306,7 @@ export default { ...@@ -306,7 +306,7 @@ export default {
getList() { getList() {
this.loading = true this.loading = true
listBasicInfo(this.queryParams).then(res => { listBasicInfo(this.queryParams).then(res => {
res.rows.createDate = parseTime(res.rows.createDate,'{y}-{m}-{d}') res.rows.createDate = parseTime(res.rows.createDate, '{y}-{m}-{d}')
this.total = res.total this.total = res.total
this.basicInfoList = res.rows this.basicInfoList = res.rows
this.loading = false this.loading = false
...@@ -435,19 +435,11 @@ export default { ...@@ -435,19 +435,11 @@ export default {
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset() this.title = '编辑基础信息表单'
const roleId = row.businessId || this.ids const id = row.businessId
const roleMenu = this.getRoleMenuTreeselect(roleId) getDetailById(id).then(res => {
getRole(roleId).then(response => { this.form = res.data
this.form = response.data
this.open = true this.open = true
this.getMenuTreeselect(roleId)
this.$nextTick(() => {
roleMenu.then(res => {
this.$refs.menu.setCheckedKeys(res.data.checkedKeys)
})
})
this.title = '修改角色'
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<el-form-item> <el-form-item>
<el-button <el-button
type="primary" type="primary"
style="padding: 8px 7px;"
size="small" size="small"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleAdd" @click="handleAdd"
......
...@@ -10,16 +10,16 @@ ...@@ -10,16 +10,16 @@
size="small" size="small"
/> />
</el-form-item> </el-form-item>
<el-form-item label="部门状态"> <!-- <el-form-item label="部门状态">-->
<el-select v-model="queryParams.flag" placeholder="请选择部门状态" clearable size="small"> <!-- <el-select v-model="queryParams.flag" placeholder="请选择部门状态" clearable size="small">-->
<el-option <!-- <el-option-->
v-for="dict in statusOptions" <!-- v-for="dict in statusOptions"-->
:key="dict.dictValue" <!-- :key="dict.dictValue"-->
:label="dict.dictLabel" <!-- :label="dict.dictLabel"-->
:value="dict.dictValue" <!-- :value="dict.dictValue"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-button <el-button
style="padding: 8px 7px;" style="padding: 8px 7px;"
...@@ -222,7 +222,7 @@ export default { ...@@ -222,7 +222,7 @@ export default {
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 状态数据字典 // 状态数据字典
statusOptions: [], // statusOptions: [],
// 查询参数 // 查询参数
queryParams: { queryParams: {
deptName: undefined, deptName: undefined,
...@@ -275,9 +275,9 @@ export default { ...@@ -275,9 +275,9 @@ export default {
this.queryParams = { ...param } this.queryParams = { ...param }
} }
this.getList() this.getList()
this.getDicts('sys_normal_disable'.toUpperCase()).then(response => { // this.getDicts('sys_normal_disable'.toUpperCase()).then(response => {
this.statusOptions = response.data // this.statusOptions = response.data
}) // })
}, },
methods: { methods: {
/** 查询部门列表 */ /** 查询部门列表 */
...@@ -317,9 +317,9 @@ export default { ...@@ -317,9 +317,9 @@ export default {
} }
}, },
// 字典状态字典翻译 // 字典状态字典翻译
statusFormat(row, column) { // statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.flag) // return this.selectDictLabel(this.statusOptions, row.flag)
}, // },
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false this.open = false
......
...@@ -23,22 +23,22 @@ ...@@ -23,22 +23,22 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="flag"> <!-- <el-form-item label="状态" prop="flag">-->
<el-select <!-- <el-select-->
v-model="queryParams.flag" <!-- v-model="queryParams.flag"-->
placeholder="字典状态" <!-- placeholder="字典状态"-->
clearable <!-- clearable-->
size="small" <!-- size="small"-->
style="width: 200px" <!-- style="width: 200px"-->
> <!-- >-->
<el-option <!-- <el-option-->
v-for="dict in statusOptions" <!-- v-for="dict in statusOptions"-->
:key="dict.dictValue" <!-- :key="dict.dictValue"-->
:label="dict.dictLabel" <!-- :label="dict.dictLabel"-->
:value="dict.dictValue" <!-- :value="dict.dictValue"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<el-date-picker <el-date-picker
v-model="dateRange" v-model="dateRange"
...@@ -52,12 +52,25 @@ ...@@ -52,12 +52,25 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button> <el-button
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> type="primary"
style="padding: 8px 7px;"
icon="el-icon-search"
size="small"
@click="handleQuery"
>搜索</el-button>
<el-button
style="padding: 8px 7px;"
icon="el-icon-refresh"
size="small"
@click="resetQuery"
>重置
</el-button>
</el-form-item> </el-form-item>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
style="padding: 8px 7px;"
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
size="small" size="small"
...@@ -66,9 +79,10 @@ ...@@ -66,9 +79,10 @@
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
style="padding: 8px 7px;"
type="success" type="success"
icon="el-icon-edit" icon="el-icon-edit"
size="mini" size="small"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
>修改 >修改
...@@ -76,9 +90,10 @@ ...@@ -76,9 +90,10 @@
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
style="padding: 8px 7px;"
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="small"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
>删除 >删除
...@@ -86,6 +101,7 @@ ...@@ -86,6 +101,7 @@
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
style="padding: 8px 7px;"
type="success" type="success"
icon="el-icon-download" icon="el-icon-download"
size="small" size="small"
...@@ -161,8 +177,8 @@ ...@@ -161,8 +177,8 @@
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.page"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.rows"
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改参数配置对话框 --> <!-- 添加或修改参数配置对话框 -->
...@@ -174,14 +190,21 @@ ...@@ -174,14 +190,21 @@
<el-form-item label="字典类型" prop="dictType"> <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>
<el-form-item label="状态" prop="flag"> <el-form-item label="状态" prop="flag">
<!-- <el-form-item label="状态" prop="flag">-->
<!-- <el-radio-group v-model="form.flag">-->
<!-- <el-radio-->
<!-- v-for="dict in statusOptions"-->
<!-- :key="dict.dictValue"-->
<!-- :label="dict.dictValue"-->
<!-- >{{ dict.dictLabel }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-radio-group v-model="form.flag"> <el-radio-group v-model="form.flag">
<el-radio <el-radio label="1">启用</el-radio>
v-for="dict in statusOptions" <el-radio label="0">停用</el-radio>
:key="dict.dictValue"
:label="dict.dictValue"
>{{ dict.dictLabel }}
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="父字典名称"> <el-form-item label="父字典名称">
...@@ -313,14 +336,14 @@ export default { ...@@ -313,14 +336,14 @@ export default {
title: '', title: '',
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
// 状态数据字典 // // 状态数据字典
statusOptions: [], // statusOptions: [],
// 日期范围 // 日期范围
dateRange: [], dateRange: [],
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, page: 1,
pageSize: 10, rows: 10,
dictName: undefined, dictName: undefined,
dictType: undefined, dictType: undefined,
flag: undefined flag: undefined
...@@ -364,9 +387,9 @@ export default { ...@@ -364,9 +387,9 @@ export default {
this.queryParams = { ...param } this.queryParams = { ...param }
} }
this.getList() this.getList()
this.getDicts(dictCons['NORMAL_DISABLE']).then(response => { // this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
this.statusOptions = response.data // this.statusOptions = response.data
}) // })
optionselect().then(response => { optionselect().then(response => {
this.options = response.data this.options = response.data
}) })
...@@ -419,9 +442,9 @@ export default { ...@@ -419,9 +442,9 @@ export default {
}) })
}, },
// 字典状态字典翻译 // 字典状态字典翻译
statusFormat(row, column) { // statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.flag) // return this.selectDictLabel(this.statusOptions, row.flag)
}, // },
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false this.open = false
...@@ -442,7 +465,7 @@ export default { ...@@ -442,7 +465,7 @@ export default {
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.page = 1
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
......
...@@ -22,24 +22,15 @@ ...@@ -22,24 +22,15 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="角色状态" prop="flag">
<el-select
v-model="queryParams.flag"
placeholder="请选择角色状态"
clearable
size="small"
style="width: 150px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button> <el-button
style="padding: 8px 7px;"
type="primary"
icon="el-icon-search"
size="small"
@click="handleQuery">
查询
</el-button>
</el-form-item> </el-form-item>
<div style="float: right"> <div style="float: right">
<el-form-item> <el-form-item>
...@@ -128,8 +119,8 @@ ...@@ -128,8 +119,8 @@
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.page"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.rows"
@pagination="getList" @pagination="getList"
/> />
...@@ -510,7 +501,7 @@ export default { ...@@ -510,7 +501,7 @@ export default {
}, },
/** 查询按钮操作 */ /** 查询按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.page = 1
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
......
...@@ -22,22 +22,6 @@ ...@@ -22,22 +22,6 @@
style="width: 150px" style="width: 150px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="flag">
<el-select
v-model="queryParams.flag"
placeholder="请选择用户状态"
clearable
size="small"
style="width: 150px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button> <el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
<el-button style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> <el-button style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
......
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