站点配置
This commit is contained in:
parent
e710cbdac0
commit
dec4a044b8
|
|
@ -1,53 +1,57 @@
|
|||
<template>
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick" class="app-container">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick" class="app-container">
|
||||
<el-tab-pane label="物资配置" name="first">
|
||||
<div>
|
||||
<div class="section">
|
||||
<el-header>库管员配置</el-header>
|
||||
<el-main>
|
||||
<el-checkbox-group v-model="selectedValues" class="checkbox-group">
|
||||
<el-checkbox
|
||||
v-for="item in options"
|
||||
:key="item.roleId"
|
||||
:label="item.roleId"
|
||||
:value="item.roleId"
|
||||
:checked="item.check"
|
||||
class="checkbox-item">
|
||||
{{ item.roleKey }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>保存库管员配置</el-button>
|
||||
</el-main>
|
||||
</div>
|
||||
<!-- <div class="section">
|
||||
<el-header>维修员配置</el-header>
|
||||
<div class="section">
|
||||
<el-header>库管员配置</el-header>
|
||||
<el-main>
|
||||
<el-checkbox-group v-model="selectedValues" class="checkbox-group">
|
||||
<el-checkbox
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.id"
|
||||
:value="item.id"
|
||||
:checked="item.check"
|
||||
class="checkbox-item">
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
<el-checkbox
|
||||
v-for="item in options"
|
||||
:key="item.roleId"
|
||||
:label="item.roleId"
|
||||
:value="item.roleId"
|
||||
:checked="item.check"
|
||||
class="checkbox-item"
|
||||
>
|
||||
{{ item.roleKey }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>保存维修员配置</el-button
|
||||
type="success"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleSaveKeeper"
|
||||
>保存库管员配置</el-button
|
||||
>
|
||||
</el-main>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<el-header>维修员配置</el-header>
|
||||
<el-main>
|
||||
<el-checkbox-group
|
||||
v-model="selectedValuesRepair"
|
||||
class="checkbox-group"
|
||||
>
|
||||
<el-checkbox
|
||||
v-for="item in optionsRepair"
|
||||
:key="item.roleId"
|
||||
:label="item.roleId"
|
||||
:value="item.roleId"
|
||||
:checked="item.check"
|
||||
class="checkbox-item"
|
||||
>
|
||||
{{ item.roleKey }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleSaveRepair"
|
||||
>保存维修员配置</el-button
|
||||
>
|
||||
</el-main>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="新购配置" name="second" >
|
||||
<div>
|
||||
|
|
@ -98,73 +102,91 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listRole, } from "@/api/system/role";
|
||||
import {
|
||||
getKeeperIds
|
||||
} from "@/api/ma/typeConfigKeeper";
|
||||
import { listRole } from "@/api/system/role";
|
||||
import { getKeeperIds } from "@/api/ma/typeConfigKeeper";
|
||||
export default {
|
||||
name: 'siteConfig',
|
||||
name: "siteConfig",
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
roleIdsKeeper:[],
|
||||
roleIdsRepair:[],
|
||||
activeName: "first",
|
||||
roleIdsKeeper: [],
|
||||
roleIdsRepair: [],
|
||||
roleIdsRepair: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
},
|
||||
// 模拟后端返回的对象数组
|
||||
options: [],
|
||||
optionsRepair: [],
|
||||
// 记录选中的 id
|
||||
selectedValues: []
|
||||
selectedValues: [],
|
||||
selectedValuesRepair: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getListRepair();
|
||||
},
|
||||
watch: {
|
||||
// 监听选中的值变化,更新后端数据
|
||||
selectedValues(newValues) {
|
||||
// 你可以根据需要将 newValues 更新到后端
|
||||
console.log('选中的ID:', newValues);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 初始化选中的值,如果需要的话
|
||||
// this.selectedValues = this.options
|
||||
// .filter(item => item.check) // 过滤出 check 为 true 的选项
|
||||
// .map(item => (item.id));
|
||||
// console.log('this.selectedValues',this.selectedValues) // 提取选中的 id
|
||||
},
|
||||
// watch: {
|
||||
// // 监听选中的值变化,更新后端数据
|
||||
// selectedValues(newValues) {
|
||||
// // 你可以根据需要将 newValues 更新到后端
|
||||
// console.log("选中的ID:", newValues);
|
||||
// },
|
||||
// },
|
||||
methods: {
|
||||
async getList(){
|
||||
const itemName = 'ku_guan_role_ids'
|
||||
await getKeeperIds(itemName).then((response) =>{
|
||||
const roleIds = response.rows[0].itemValue.split(',').map(item => Number(item))
|
||||
this.roleIdsKeeper = roleIds
|
||||
})
|
||||
await listRole(this.queryParams).then(response=>{
|
||||
const list = response.rows
|
||||
console.log('this.roleIdsKeeper',this.roleIdsKeeper)
|
||||
console.log('this.list',list)
|
||||
this.options=list
|
||||
this.selectedValues = this.roleIdsKeeper
|
||||
console.log('this.options',this.options)
|
||||
})
|
||||
},
|
||||
handleQuery(){
|
||||
console.log(this.selectedValues)
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
if(tab.name == 'first'){
|
||||
// this.resetForm("queryFormOne");
|
||||
// this.getList();
|
||||
}else if(tab.name == 'second'){
|
||||
// this.resetForm("queryForm");
|
||||
// this.getboxList();
|
||||
}
|
||||
},
|
||||
}
|
||||
//库管员配置
|
||||
async getList() {
|
||||
const itemName = "ku_guan_role_ids";
|
||||
//获取已有绑定的库管员
|
||||
await getKeeperIds(itemName).then((response) => {
|
||||
const roleIds = response.rows[0].itemValue
|
||||
.split(",")
|
||||
.map((item) => Number(item));
|
||||
this.roleIdsKeeper = roleIds;
|
||||
});
|
||||
//获取所有的库管员
|
||||
await listRole(this.queryParams).then((response) => {
|
||||
const list = response.rows;
|
||||
this.options = list;
|
||||
this.selectedValues = this.roleIdsKeeper;
|
||||
});
|
||||
},
|
||||
|
||||
//维修员配置
|
||||
async getListRepair() {
|
||||
const itemName = "wei_xiu_role_ids";
|
||||
//获取已有绑定的维修员
|
||||
await getKeeperIds(itemName).then((response) => {
|
||||
const roleIds = response.rows[0].itemValue
|
||||
.split(",")
|
||||
.map((item) => Number(item));
|
||||
this.roleIdsRepair = roleIds;
|
||||
});
|
||||
//获取所有的维修员
|
||||
await listRole(this.queryParams).then((response) => {
|
||||
const list = response.rows;
|
||||
this.optionsRepair = list;
|
||||
this.selectedValuesRepair = this.roleIdsRepair;
|
||||
});
|
||||
},
|
||||
handleSaveKeeper() {
|
||||
console.log(this.selectedValues);
|
||||
},
|
||||
handleSaveRepair() {
|
||||
console.log(this.selectedValuesRepair);
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
if (tab.name == "first") {
|
||||
this.getList();
|
||||
this.getListRepair();
|
||||
} else if (tab.name == "second") {
|
||||
// this.resetForm("queryForm");
|
||||
// this.getboxList();
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
@ -173,7 +195,8 @@ export default {
|
|||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.el-header, .el-footer {
|
||||
.el-header,
|
||||
.el-footer {
|
||||
background-color: #f8f8f9;
|
||||
color: #333;
|
||||
text-align: left;
|
||||
|
|
@ -197,20 +220,20 @@ export default {
|
|||
}
|
||||
|
||||
::v-deep .el-checkbox {
|
||||
color: #606266;
|
||||
font-weight: 200;
|
||||
font-size: 2px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
margin-right: 30px;
|
||||
margin-bottom: 2px;
|
||||
margin-top: 2px;
|
||||
color: #606266;
|
||||
font-weight: 200;
|
||||
font-size: 2px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
margin-right: 30px;
|
||||
margin-bottom: 2px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
/* 调整checkbox的样式 */
|
||||
|
|
@ -225,10 +248,9 @@ export default {
|
|||
|
||||
::v-deep .checkbox-item {
|
||||
display: inline-block;
|
||||
width: calc(10% - 1px); /* 每个复选框的宽度,去除间距 */
|
||||
width: calc(13% - 1px); /* 每个复选框的宽度,去除间距 */
|
||||
vertical-align: top; /* 顶部对齐 */
|
||||
margin-bottom: 2px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
:inline="true"
|
||||
v-show="showSearch"
|
||||
>
|
||||
<el-form-item prop="dictLabel">
|
||||
<el-form-item prop="dictLabel">
|
||||
<el-input
|
||||
v-model="queryParams.dictLabel"
|
||||
placeholder="请输入单位类型名称"
|
||||
|
|
@ -21,17 +21,14 @@
|
|||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>查询</el-button
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button
|
||||
icon="el-icon-refresh"
|
||||
size="mini"
|
||||
@click="resetQuery"
|
||||
>重置</el-button
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
|
|
@ -40,7 +37,7 @@
|
|||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:role:add']"
|
||||
>新增</el-button
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
|
|
@ -50,14 +47,14 @@
|
|||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:role:export']"
|
||||
>导出数据</el-button
|
||||
>导出数据</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
|
|
@ -65,28 +62,46 @@
|
|||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
width="100"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位类型名称" align="center" prop="dictLabel" sortable/>
|
||||
<el-table-column label="字典键值" align="center" prop="dictValue" sortable/>
|
||||
<el-table-column label="字典排序" align="center" prop="dictSort" sortable/>
|
||||
<el-table-column label="状态" align="center" prop="status" sortable>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
||||
<el-table-column label="序号" type="index" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" sortable/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" sortable/>
|
||||
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="单位类型名称"
|
||||
align="center"
|
||||
prop="dictLabel"
|
||||
sortable
|
||||
/>
|
||||
<el-table-column
|
||||
label="字典键值"
|
||||
align="center"
|
||||
prop="dictValue"
|
||||
sortable
|
||||
/>
|
||||
<el-table-column
|
||||
label="字典排序"
|
||||
align="center"
|
||||
prop="dictSort"
|
||||
sortable
|
||||
/>
|
||||
<el-table-column label="状态" align="center" prop="status" sortable>
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.sys_normal_disable"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" sortable />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
sortable
|
||||
/>
|
||||
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
|
|
@ -96,7 +111,7 @@
|
|||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:role:edit']"
|
||||
>修改</el-button
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
|
|
@ -104,13 +119,11 @@
|
|||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:role:remove']"
|
||||
>删除</el-button
|
||||
>删除</el-button
|
||||
>
|
||||
<el-dropdown
|
||||
size="mini"
|
||||
@command="
|
||||
(command) => handleCommand(command, scope.row)
|
||||
"
|
||||
@command="(command) => handleCommand(command, scope.row)"
|
||||
v-hasPermi="['system:role:edit']"
|
||||
>
|
||||
</el-dropdown>
|
||||
|
|
@ -118,15 +131,15 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
<!-- <pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
/> -->
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="字典类型">
|
||||
|
|
@ -142,7 +155,11 @@
|
|||
<el-input v-model="form.cssClass" placeholder="请输入样式属性" />
|
||||
</el-form-item>
|
||||
<el-form-item label="显示排序" prop="dictSort">
|
||||
<el-input-number v-model="form.dictSort" controls-position="right" :min="0" />
|
||||
<el-input-number
|
||||
v-model="form.dictSort"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="回显样式" prop="listClass">
|
||||
<el-select v-model="form.listClass">
|
||||
|
|
@ -160,11 +177,16 @@
|
|||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
|
@ -173,7 +195,6 @@
|
|||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 分配角色数据权限对话框 -->
|
||||
<el-dialog
|
||||
:title="title"
|
||||
|
|
@ -190,9 +211,7 @@
|
|||
<el-input v-model="form.roleKey" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="权限范围">
|
||||
<el-select
|
||||
v-model="form.dataScope"
|
||||
>
|
||||
<el-select v-model="form.dataScope">
|
||||
<el-option
|
||||
v-for="item in dataScopeOptions"
|
||||
:key="item.value"
|
||||
|
|
@ -205,17 +224,17 @@
|
|||
<el-checkbox
|
||||
v-model="deptExpand"
|
||||
@change="handleCheckedTreeExpand($event, 'dept')"
|
||||
>展开/折叠</el-checkbox
|
||||
>展开/折叠</el-checkbox
|
||||
>
|
||||
<el-checkbox
|
||||
v-model="deptNodeAll"
|
||||
@change="handleCheckedTreeNodeAll($event, 'dept')"
|
||||
>全选/全不选</el-checkbox
|
||||
>全选/全不选</el-checkbox
|
||||
>
|
||||
<el-checkbox
|
||||
v-model="form.deptCheckStrictly"
|
||||
@change="handleCheckedTreeConnect($event, 'dept')"
|
||||
>父子联动</el-checkbox
|
||||
>父子联动</el-checkbox
|
||||
>
|
||||
<el-tree
|
||||
class="tree-border"
|
||||
|
|
@ -231,9 +250,7 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitDataScope"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button type="primary" @click="submitDataScope">确 定</el-button>
|
||||
<el-button @click="cancelDataScope">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -241,20 +258,23 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { unitTypeList, statusUnitType } from "@/api/basic/basic";
|
||||
import {
|
||||
unitTypeList,
|
||||
statusUnitType,
|
||||
} from '@/api/basic/basic'
|
||||
import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data";
|
||||
listData,
|
||||
getData,
|
||||
delData,
|
||||
addData,
|
||||
updateData,
|
||||
} from "@/api/system/dict/data";
|
||||
export default {
|
||||
name: 'unitType',
|
||||
dicts: ['sys_normal_disable'],
|
||||
name: "unitType",
|
||||
dicts: ["sys_normal_disable"],
|
||||
data() {
|
||||
return {
|
||||
deptExpand:undefined,
|
||||
deptNodeAll:undefined,
|
||||
deptOptions:[],
|
||||
defaultProps:undefined,
|
||||
deptExpand: undefined,
|
||||
deptNodeAll: undefined,
|
||||
deptOptions: [],
|
||||
defaultProps: undefined,
|
||||
isLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
|
|
@ -271,153 +291,154 @@ export default {
|
|||
// 字典表格数据
|
||||
typeList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
typeId:'',
|
||||
title: "",
|
||||
typeId: "",
|
||||
// 是否显示弹出层
|
||||
openDataScope:false,
|
||||
dataScopeOptions:[],
|
||||
openDataScope: false,
|
||||
dataScopeOptions: [],
|
||||
open: false,
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
dictType: 'bm_unit_type',
|
||||
dictLabel:undefined,
|
||||
pageSize: 1000,
|
||||
dictType: "bm_unit_type",
|
||||
dictLabel: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
pId: '1',
|
||||
pId: "1",
|
||||
typeName: undefined,
|
||||
typeId:undefined
|
||||
typeId: undefined,
|
||||
},
|
||||
// 表单校验
|
||||
// 表单校验
|
||||
rules: {
|
||||
dictLabel: [
|
||||
{ required: true, message: "数据标签不能为空", trigger: "blur" }
|
||||
{ required: true, message: "数据标签不能为空", trigger: "blur" },
|
||||
],
|
||||
dictValue: [
|
||||
{ required: true, message: "数据键值不能为空", trigger: "blur" }
|
||||
{ required: true, message: "数据键值不能为空", trigger: "blur" },
|
||||
],
|
||||
dictSort: [
|
||||
{ required: true, message: "数据顺序不能为空", trigger: "blur" }
|
||||
]
|
||||
{ required: true, message: "数据顺序不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
roleList:[],
|
||||
// 数据标签回显样式
|
||||
roleList: [],
|
||||
// 数据标签回显样式
|
||||
listClassOptions: [
|
||||
{
|
||||
value: "default",
|
||||
label: "默认"
|
||||
label: "默认",
|
||||
},
|
||||
{
|
||||
value: "primary",
|
||||
label: "主要"
|
||||
label: "主要",
|
||||
},
|
||||
{
|
||||
value: "success",
|
||||
label: "成功"
|
||||
label: "成功",
|
||||
},
|
||||
{
|
||||
value: "info",
|
||||
label: "信息"
|
||||
label: "信息",
|
||||
},
|
||||
{
|
||||
value: "warning",
|
||||
label: "警告"
|
||||
label: "警告",
|
||||
},
|
||||
{
|
||||
value: "danger",
|
||||
label: "危险"
|
||||
}
|
||||
label: "危险",
|
||||
},
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询字典类型列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
this.loading = true;
|
||||
unitTypeList(this.queryParams).then((response) => {
|
||||
this.roleList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
submitDataScope(){
|
||||
|
||||
},
|
||||
cancelDataScope(){
|
||||
|
||||
this.roleList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
submitDataScope() {},
|
||||
cancelDataScope() {},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
// pId: '1',
|
||||
status: '0',
|
||||
status: "0",
|
||||
// name: undefined,
|
||||
}
|
||||
this.resetForm('form')
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = []
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加单位类型";
|
||||
this.form.dictType = 'bm_unit_type';
|
||||
this.form.dictType = "bm_unit_type";
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id)
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const dictCode = row.dictCode || this.ids
|
||||
getData(dictCode).then(response => {
|
||||
const dictCode = row.dictCode || this.ids;
|
||||
getData(dictCode).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改单位类型";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.dictCode != undefined) {
|
||||
updateData(this.form).then(response => {
|
||||
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
|
||||
updateData(this.form).then((response) => {
|
||||
this.$store.dispatch(
|
||||
"dict/removeDict",
|
||||
this.queryParams.dictType
|
||||
);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addData(this.form).then(response => {
|
||||
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
|
||||
addData(this.form).then((response) => {
|
||||
this.$store.dispatch(
|
||||
"dict/removeDict",
|
||||
this.queryParams.dictType
|
||||
);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
|
|
@ -430,34 +451,38 @@ export default {
|
|||
let param = {
|
||||
id: row.id,
|
||||
status: row.status,
|
||||
}
|
||||
};
|
||||
statusUnitType(param).then((response) => {
|
||||
this.getList()
|
||||
})
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const dictCodes = row.dictCode || this.ids;
|
||||
this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() {
|
||||
return delData(dictCodes);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
|
||||
}).catch(() => {});
|
||||
this.$modal
|
||||
.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?')
|
||||
.then(function () {
|
||||
return delData(dictCodes);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.$store.dispatch("dict/removeDict", this.queryParams.dictType);
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
'/material/base/dic/export',
|
||||
"/material/base/dic/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
dataCondition: this.ids,
|
||||
},
|
||||
`单位类型_${new Date().getTime()}.xlsx`,
|
||||
)
|
||||
`单位类型_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue