优化页面字段
This commit is contained in:
parent
54077911c4
commit
d35f8799ae
|
|
@ -1,311 +1,436 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container" id="safeTools">
|
<div class="app-container" id="safeTools">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
<el-form
|
||||||
<el-form-item label="供应商名称" prop="dictName">
|
:model="queryParams"
|
||||||
<el-input
|
ref="queryForm"
|
||||||
v-model="queryParams.dictName"
|
size="small"
|
||||||
placeholder="请输入供应商名称"
|
:inline="true"
|
||||||
clearable maxlength="50"
|
v-show="showSearch"
|
||||||
style="width: 240px"
|
label-width="80px"
|
||||||
@keyup.enter.native="handleQuery"
|
>
|
||||||
/>
|
<el-form-item label="供应商名称" prop="dictName">
|
||||||
</el-form-item>
|
<el-input
|
||||||
|
v-model="queryParams.dictName"
|
||||||
|
placeholder="请输入供应商名称"
|
||||||
|
clearable
|
||||||
|
maxlength="50"
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
type="primary"
|
||||||
</el-form-item>
|
icon="el-icon-search"
|
||||||
</el-form>
|
size="mini"
|
||||||
|
@click="handleQuery"
|
||||||
|
>搜索</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-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
</el-col>
|
>
|
||||||
<!-- <el-col :span="1.5">-->
|
</el-col>
|
||||||
<!-- <el-button-->
|
<!-- <el-col :span="1.5">-->
|
||||||
<!-- type="success"-->
|
<!-- <el-button-->
|
||||||
<!-- plain-->
|
<!-- type="success"-->
|
||||||
<!-- icon="el-icon-edit"-->
|
<!-- plain-->
|
||||||
<!-- size="mini"-->
|
<!-- icon="el-icon-edit"-->
|
||||||
<!-- :disabled="single"-->
|
<!-- size="mini"-->
|
||||||
<!-- @click="handleUpdate"-->
|
<!-- :disabled="single"-->
|
||||||
<!-- v-hasPermi="['store:labelType:edit']"-->
|
<!-- @click="handleUpdate"-->
|
||||||
<!-- >修改</el-button>-->
|
<!-- v-hasPermi="['store:labelType:edit']"-->
|
||||||
<!-- </el-col>-->
|
<!-- >修改</el-button>-->
|
||||||
<!-- <el-col :span="1.5">-->
|
<!-- </el-col>-->
|
||||||
<!-- <el-button-->
|
<!-- <el-col :span="1.5">-->
|
||||||
<!-- type="danger"-->
|
<!-- <el-button-->
|
||||||
<!-- plain-->
|
<!-- type="danger"-->
|
||||||
<!-- icon="el-icon-delete"-->
|
<!-- plain-->
|
||||||
<!-- size="mini"-->
|
<!-- icon="el-icon-delete"-->
|
||||||
<!-- :disabled="multiple"-->
|
<!-- size="mini"-->
|
||||||
<!-- @click="handleDelete"-->
|
<!-- :disabled="multiple"-->
|
||||||
<!-- v-hasPermi="['store:labelType:remove']"-->
|
<!-- @click="handleDelete"-->
|
||||||
<!-- >删除</el-button>-->
|
<!-- v-hasPermi="['store:labelType:remove']"-->
|
||||||
<!-- </el-col>-->
|
<!-- >删除</el-button>-->
|
||||||
<el-col :span="1.5">
|
<!-- </el-col>-->
|
||||||
<el-button
|
<el-col :span="1.5">
|
||||||
type="warning"
|
<el-button
|
||||||
plain
|
type="warning"
|
||||||
icon="el-icon-download"
|
plain
|
||||||
size="mini"
|
icon="el-icon-download"
|
||||||
@click="handleExport"
|
size="mini"
|
||||||
>导出</el-button>
|
@click="handleExport"
|
||||||
</el-col>
|
>导出</el-button
|
||||||
<el-col :span="1.5">
|
>
|
||||||
<el-button
|
</el-col>
|
||||||
type="danger"
|
<el-col :span="1.5">
|
||||||
plain
|
<el-button
|
||||||
icon="el-icon-refresh"
|
type="danger"
|
||||||
size="mini"
|
plain
|
||||||
@click="handleRefreshCache"
|
icon="el-icon-refresh"
|
||||||
>刷新缓存</el-button>
|
size="mini"
|
||||||
</el-col>
|
@click="handleRefreshCache"
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
>刷新缓存</el-button
|
||||||
</el-row>
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
v-loading="loading"
|
||||||
<el-table-column label="序号" align="center" width="80" type="index" :index="indexContinuation(queryParams.pageNum, queryParams.pageSize)">
|
:data="typeList"
|
||||||
<!-- <template scope="scope">
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column
|
||||||
|
label="序号"
|
||||||
|
align="center"
|
||||||
|
width="80"
|
||||||
|
type="index"
|
||||||
|
:index="
|
||||||
|
indexContinuation(queryParams.pageNum, queryParams.pageSize)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<!-- <template scope="scope">
|
||||||
<span>{{ (queryParams.pageNum - 1) * 10 + scope.$index + 1 }}</span>
|
<span>{{ (queryParams.pageNum - 1) * 10 + scope.$index + 1 }}</span>
|
||||||
</template> -->
|
</template> -->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="工器具类型" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
<el-table-column
|
||||||
<el-table-column label="规格型号" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
label="工器具类型"
|
||||||
<el-table-column label="设备编号" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
align="center"
|
||||||
<el-table-column label="设备状态" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
prop="dictName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="规格型号"
|
||||||
|
align="center"
|
||||||
|
prop="dictName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="设备编号"
|
||||||
|
align="center"
|
||||||
|
prop="dictName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="设备状态"
|
||||||
|
align="center"
|
||||||
|
prop="dictName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
|
||||||
<el-table-column label="固定资产编号" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
<el-table-column
|
||||||
<el-table-column label="设备原编号" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
label="固定资产编号"
|
||||||
<el-table-column label="购置批次" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
align="center"
|
||||||
<el-table-column label="绑定标签" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
prop="dictName"
|
||||||
<el-table-column label="所在仓库" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label=""
|
||||||
|
align="center"
|
||||||
|
prop="dictName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="购置批次"
|
||||||
|
align="center"
|
||||||
|
prop="dictName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="绑定标签"
|
||||||
|
align="center"
|
||||||
|
prop="dictName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="所在仓库"
|
||||||
|
align="center"
|
||||||
|
prop="dictName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>编辑</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<pagination
|
||||||
<template slot-scope="scope">
|
v-show="total > 0"
|
||||||
<el-button
|
:total="total"
|
||||||
size="mini"
|
:page.sync="queryParams.pageNum"
|
||||||
type="primary"
|
:limit.sync="queryParams.pageSize"
|
||||||
icon="el-icon-edit"
|
@pagination="getList"
|
||||||
@click="handleUpdate(scope.row)"
|
/>
|
||||||
>编辑</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
<!-- 添加或修改参数配置对话框 -->
|
||||||
v-show="total>0"
|
<el-dialog
|
||||||
:total="total"
|
:title="title"
|
||||||
:page.sync="queryParams.pageNum"
|
:visible.sync="open"
|
||||||
:limit.sync="queryParams.pageSize"
|
width="600px"
|
||||||
@pagination="getList"
|
append-to-body
|
||||||
/>
|
>
|
||||||
|
<el-form
|
||||||
<!-- 添加或修改参数配置对话框 -->
|
ref="form"
|
||||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
:model="form"
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
:rules="rules"
|
||||||
<el-form-item label="单位类型名称" prop="dictName">
|
label-width="120px"
|
||||||
<el-input v-model="form.dictName" placeholder="请输入单位类型名称" maxlength="50"/>
|
>
|
||||||
</el-form-item>
|
<el-form-item label="单位类型名称" prop="dictName">
|
||||||
<!-- <el-form-item label="字典类型" prop="dictType">-->
|
<el-input
|
||||||
<!-- <el-input v-model="form.dictType" placeholder="请输入字典类型" />-->
|
v-model="form.dictName"
|
||||||
<!-- </el-form-item>-->
|
placeholder="请输入单位类型名称"
|
||||||
<!-- <el-form-item label="状态" prop="status">-->
|
maxlength="50"
|
||||||
<!-- <el-radio-group v-model="form.status">-->
|
/>
|
||||||
<!-- <el-radio-->
|
</el-form-item>
|
||||||
<!-- v-for="dict in dict.type.sys_normal_disable"-->
|
<!-- <el-form-item label="字典类型" prop="dictType">-->
|
||||||
<!-- :key="dict.value"-->
|
<!-- <el-input v-model="form.dictType" placeholder="请输入字典类型" />-->
|
||||||
<!-- :label="dict.value"-->
|
<!-- </el-form-item>-->
|
||||||
<!-- >{{dict.label}}</el-radio>-->
|
<!-- <el-form-item label="状态" prop="status">-->
|
||||||
<!-- </el-radio-group>-->
|
<!-- <el-radio-group v-model="form.status">-->
|
||||||
<!-- </el-form-item>-->
|
<!-- <el-radio-->
|
||||||
<!-- <el-form-item label="备注" prop="remark">-->
|
<!-- v-for="dict in dict.type.sys_normal_disable"-->
|
||||||
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>-->
|
<!-- :key="dict.value"-->
|
||||||
<!-- </el-form-item>-->
|
<!-- :label="dict.value"-->
|
||||||
</el-form>
|
<!-- >{{dict.label}}</el-radio>-->
|
||||||
<div slot="footer" class="dialog-footer">
|
<!-- </el-radio-group>-->
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<!-- </el-form-item>-->
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<!-- <el-form-item label="备注" prop="remark">-->
|
||||||
</div>
|
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>-->
|
||||||
</el-dialog>
|
<!-- </el-form-item>-->
|
||||||
</div>
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
|
import {
|
||||||
|
listType,
|
||||||
|
getType,
|
||||||
|
delType,
|
||||||
|
addType,
|
||||||
|
updateType,
|
||||||
|
refreshCache,
|
||||||
|
} from '@/api/system/dict/type'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "SafeTools",
|
name: 'SafeTools',
|
||||||
dicts: ['sys_normal_disable'],
|
dicts: ['sys_normal_disable'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
ids: [],
|
||||||
// 非单个禁用
|
// 非单个禁用
|
||||||
single: true,
|
single: true,
|
||||||
// 非多个禁用
|
// 非多个禁用
|
||||||
multiple: true,
|
multiple: true,
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
// 字典表格数据
|
// 字典表格数据
|
||||||
typeList: [],
|
typeList: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: '',
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 日期范围
|
// 日期范围
|
||||||
dateRange: [],
|
dateRange: [],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
dictName: undefined,
|
dictName: undefined,
|
||||||
dictType: undefined,
|
dictType: undefined,
|
||||||
status: undefined
|
status: undefined,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
dictName: [
|
dictName: [
|
||||||
{ required: true, message: "字典名称不能为空", trigger: "blur" }
|
{
|
||||||
],
|
required: true,
|
||||||
dictType: [
|
message: '字典名称不能为空',
|
||||||
{ required: true, message: "字典类型不能为空", trigger: "blur" }
|
trigger: 'blur',
|
||||||
]
|
},
|
||||||
}
|
],
|
||||||
};
|
dictType: [
|
||||||
},
|
{
|
||||||
created() {
|
required: true,
|
||||||
this.getList();
|
message: '字典类型不能为空',
|
||||||
},
|
trigger: 'blur',
|
||||||
methods: {
|
},
|
||||||
/** 查询字典类型列表 */
|
],
|
||||||
getList() {
|
},
|
||||||
this.loading = true;
|
|
||||||
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
||||||
this.typeList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
dictId: undefined,
|
|
||||||
dictName: undefined,
|
|
||||||
dictType: undefined,
|
|
||||||
status: "0",
|
|
||||||
remark: undefined
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.dateRange = [];
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加字典类型";
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.dictId)
|
|
||||||
this.single = selection.length!=1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const dictId = row.dictId || this.ids
|
|
||||||
getType(dictId).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改字典类型";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm: function() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.dictId != undefined) {
|
|
||||||
updateType(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addType(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
created() {
|
||||||
handleDelete(row) {
|
this.getList()
|
||||||
const dictIds = row.dictId || this.ids;
|
|
||||||
this.$modal.confirm('是否确认删除所选择的数据项?').then(function() {
|
|
||||||
return delType(dictIds);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
methods: {
|
||||||
handleExport() {
|
/** 查询字典类型列表 */
|
||||||
this.download('system/dict/type/export', {
|
getList() {
|
||||||
...this.queryParams
|
this.loading = true
|
||||||
}, `type_${new Date().getTime()}.xlsx`)
|
listType(this.addDateRange(this.queryParams, this.dateRange)).then(
|
||||||
|
(response) => {
|
||||||
|
this.typeList = response.rows
|
||||||
|
this.total = response.total
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
)
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false
|
||||||
|
this.reset()
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
dictId: undefined,
|
||||||
|
dictName: undefined,
|
||||||
|
dictType: undefined,
|
||||||
|
status: '0',
|
||||||
|
remark: undefined,
|
||||||
|
}
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.dateRange = []
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset()
|
||||||
|
this.open = true
|
||||||
|
this.title = '添加字典类型'
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map((item) => item.dictId)
|
||||||
|
this.single = selection.length != 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
const dictId = row.dictId || this.ids
|
||||||
|
getType(dictId).then((response) => {
|
||||||
|
this.form = response.data
|
||||||
|
this.open = true
|
||||||
|
this.title = '修改字典类型'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm: function () {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.dictId != undefined) {
|
||||||
|
updateType(this.form).then((response) => {
|
||||||
|
this.$modal.msgSuccess('修改成功')
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
addType(this.form).then((response) => {
|
||||||
|
this.$modal.msgSuccess('新增成功')
|
||||||
|
this.open = false
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const dictIds = row.dictId || this.ids
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认删除所选择的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delType(dictIds)
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList()
|
||||||
|
this.$modal.msgSuccess('删除成功')
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download(
|
||||||
|
'system/dict/type/export',
|
||||||
|
{
|
||||||
|
...this.queryParams,
|
||||||
|
},
|
||||||
|
`type_${new Date().getTime()}.xlsx`,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
/** 刷新缓存按钮操作 */
|
||||||
|
handleRefreshCache() {
|
||||||
|
refreshCache().then(() => {
|
||||||
|
this.$modal.msgSuccess('刷新成功')
|
||||||
|
this.$store.dispatch('dict/cleanDict')
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
/** 刷新缓存按钮操作 */
|
}
|
||||||
handleRefreshCache() {
|
|
||||||
refreshCache().then(() => {
|
|
||||||
this.$modal.msgSuccess("刷新成功");
|
|
||||||
this.$store.dispatch('dict/cleanDict');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
::v-deep.el-table .fixed-width .el-button--mini {
|
::v-deep.el-table .fixed-width .el-button--mini {
|
||||||
width: 60px !important;
|
width: 60px !important;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -220,10 +220,15 @@
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
label="IOT设备"
|
label="IOT设备"
|
||||||
align="center"
|
align="center"
|
||||||
prop="ownHouseName"
|
prop="ownHouseName"
|
||||||
|
/> -->
|
||||||
|
<el-table-column
|
||||||
|
label="所在仓库"
|
||||||
|
align="center"
|
||||||
|
prop="ownHouseName"
|
||||||
/>
|
/>
|
||||||
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">-->
|
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">-->
|
||||||
<!-- <template slot-scope="scope">-->
|
<!-- <template slot-scope="scope">-->
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue