This commit is contained in:
PQZ 2024-08-04 15:35:15 +08:00
parent 4f613a4853
commit 11c177fab4
6 changed files with 267 additions and 261 deletions

View File

@ -100,6 +100,8 @@ export const DICT_TYPE = {
DICT_CAR_NATURE : 'car_nature', DICT_CAR_NATURE : 'car_nature',
//车辆类别 //车辆类别
DICT_CAR_CATEGORY : 'car_category', DICT_CAR_CATEGORY : 'car_category',
//标签样式
DICT_BASE_LABEL_TYPE : 'base_label_type',
} }
/** /**

View File

@ -245,7 +245,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
async handleDelete(row) { async handleDelete(row) {
const id = row.id; const id = row.id;
await this.$modal.confirm('是否确认删除客户管理编号为"' + id + '"的数据项?') await this.$modal.confirm('是否确认删除客户"' + row.cusName)
try { try {
await CustomerMainApi.deleteCustomerMain(id); await CustomerMainApi.deleteCustomerMain(id);
await this.getList(); await this.getList();

View File

@ -228,7 +228,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
async handleDelete(row) { async handleDelete(row) {
const id = row.id; const id = row.id;
await this.$modal.confirm('是否确认删除客户名称为"' + row.cusName + '"的数据项?') await this.$modal.confirm('是否确认删除客户"' + row.cusName )
try { try {
await CustomerMainApi.deleteCustomerMain(id); await CustomerMainApi.deleteCustomerMain(id);
await this.getList(); await this.getList();

View File

@ -209,7 +209,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
async handleDelete(row) { async handleDelete(row) {
const id = row.id; const id = row.id;
await this.$modal.confirm('是否确认删除客户管理编号为"' + id + '"的数据项?') await this.$modal.confirm('是否确认删除客户"' + row.cusName)
try { try {
await CustomerMainApi.deleteCustomerMain(id); await CustomerMainApi.deleteCustomerMain(id);
await this.getList(); await this.getList();

View File

@ -3,14 +3,18 @@
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body> <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px"> <el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
<el-form-item label="标签名称" prop="lableName"> <el-form-item label="标签名称" prop="labelName">
<el-input v-model="formData.lableName" placeholder="请输入标签名称" /> <el-input v-model="formData.labelName" placeholder="请输入标签名称"/>
</el-form-item> </el-form-item>
<el-form-item label="标签描述" prop="lableDesc"> <el-form-item label="标签样式" prop="labelType">
<el-input v-model="formData.lableDesc" placeholder="请输入标签描述" /> <el-select v-model="formData.labelType" placeholder="请选择标签样式">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.DICT_BASE_LABEL_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
实例<el-tag :type="formData.labelType">{{ formData.labelName }}</el-tag>
</el-form-item> </el-form-item>
<el-form-item label="系统标识" prop="systemCode"> <el-form-item label="标签描述" prop="labelDesc">
<el-input v-model="formData.systemCode" placeholder="请输入系统标识" /> <el-input v-model="formData.labelDesc" placeholder="请输入标签描述"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -22,11 +26,11 @@
</template> </template>
<script> <script>
import * as LabelApi from '@/api/base/label'; import * as LabelApi from '@/api/base/label';
export default {
export default {
name: "LabelForm", name: "LabelForm",
components: { components: {},
},
data() { data() {
return { return {
// //
@ -38,12 +42,18 @@
// //
formData: { formData: {
id: undefined, id: undefined,
lableName: undefined, labelName: undefined,
lableDesc: undefined, labelDesc: undefined,
systemCode: undefined, labelType: undefined
}, },
// //
formRules: { formRules: {
labelName: [
{required: true, message: '请输入标签名称', trigger: 'blur'},
],
labelType: [
{required: true, message: '请选择标签样式', trigger: 'blur'},
],
}, },
}; };
}, },
@ -93,12 +103,12 @@
reset() { reset() {
this.formData = { this.formData = {
id: undefined, id: undefined,
lableName: undefined, labelName: undefined,
lableDesc: undefined, labelDesc: undefined,
systemCode: undefined, systemCode: undefined,
}; };
this.resetForm("formRef"); this.resetForm("formRef");
} }
} }
}; };
</script> </script>

View File

@ -2,18 +2,8 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="标签名称" prop="lableName"> <el-form-item label="标签名称" prop="labelName">
<el-input v-model="queryParams.lableName" placeholder="请输入标签名称" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.labelName" placeholder="请输入标签名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="标签描述" prop="lableDesc">
<el-input v-model="queryParams.lableDesc" placeholder="请输入标签描述" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="系统标识" prop="systemCode">
<el-input v-model="queryParams.systemCode" placeholder="请输入系统标识" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
@ -25,20 +15,20 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)" <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
v-hasPermi="['base:label:create']">新增</el-button> v-hasPermi="['base:label:create']">新增
</el-col> </el-button>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:label:export']">导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="主键标识" align="center" prop="id" /> <el-table-column label="标签名称" align="center" prop="labelName"/>
<el-table-column label="标签名称" align="center" prop="lableName" /> <el-table-column label="标签样式" align="center" prop="labelType">
<el-table-column label="标签描述" align="center" prop="lableDesc" /> <template v-slot="scope">
<el-table-column label="系统标识" align="center" prop="systemCode" /> <dict-tag :type="DICT_TYPE.DICT_BASE_LABEL_TYPE" :value="scope.row.labelType" />
</template>
</el-table-column>
<el-table-column label="标签描述" align="center" prop="labelDesc"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope"> <template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
@ -47,9 +37,11 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope"> <template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)" <el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
v-hasPermi="['base:label:update']">修改</el-button> v-hasPermi="['base:label:update']">修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:label:delete']">删除</el-button> v-hasPermi="['base:label:delete']">删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -57,13 +49,14 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/> @pagination="getList"/>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<LabelForm ref="formRef" @success="getList" /> <LabelForm ref="formRef" @success="getList"/>
</div> </div>
</template> </template>
<script> <script>
import * as LabelApi from '@/api/base/label'; import * as LabelApi from '@/api/base/label';
import LabelForm from './LabelForm.vue'; import LabelForm from './LabelForm.vue';
export default { export default {
name: "Label", name: "Label",
components: { components: {
@ -91,8 +84,8 @@ export default {
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
lableName: null, labelName: null,
lableDesc: null, labelDesc: null,
systemCode: null, systemCode: null,
createTime: [], createTime: [],
}, },
@ -107,7 +100,7 @@ export default {
try { try {
this.loading = true; this.loading = true;
const res = await LabelApi.getLabelPage(this.queryParams); const res = await LabelApi.getLabelPage(this.queryParams);
this.list = res.data.list; this.list = res.data.records;
this.total = res.data.total; this.total = res.data.total;
} finally { } finally {
this.loading = false; this.loading = false;
@ -135,7 +128,8 @@ export default {
await LabelApi.deleteLabel(id); await LabelApi.deleteLabel(id);
await this.getList(); await this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
} catch {} } catch {
}
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
async handleExport() { async handleExport() {