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_CATEGORY : 'car_category',
//标签样式
DICT_BASE_LABEL_TYPE : 'base_label_type',
}
/**

View File

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

View File

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

View File

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

View File

@ -3,14 +3,18 @@
<!-- 对话框(添加 / 修改) -->
<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-item label="标签名称" prop="lableName">
<el-input v-model="formData.lableName" placeholder="请输入标签名称" />
<el-form-item label="标签名称" prop="labelName">
<el-input v-model="formData.labelName" placeholder="请输入标签名称"/>
</el-form-item>
<el-form-item label="标签描述" prop="lableDesc">
<el-input v-model="formData.lableDesc" placeholder="请输入标签描述" />
<el-form-item label="标签样式" prop="labelType">
<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 label="系统标识" prop="systemCode">
<el-input v-model="formData.systemCode" placeholder="请输入系统标识" />
<el-form-item label="标签描述" prop="labelDesc">
<el-input v-model="formData.labelDesc" placeholder="请输入标签描述"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -22,11 +26,11 @@
</template>
<script>
import * as LabelApi from '@/api/base/label';
export default {
import * as LabelApi from '@/api/base/label';
export default {
name: "LabelForm",
components: {
},
components: {},
data() {
return {
//
@ -38,12 +42,18 @@
//
formData: {
id: undefined,
lableName: undefined,
lableDesc: undefined,
systemCode: undefined,
labelName: undefined,
labelDesc: undefined,
labelType: undefined
},
//
formRules: {
labelName: [
{required: true, message: '请输入标签名称', trigger: 'blur'},
],
labelType: [
{required: true, message: '请选择标签样式', trigger: 'blur'},
],
},
};
},
@ -93,12 +103,12 @@
reset() {
this.formData = {
id: undefined,
lableName: undefined,
lableDesc: undefined,
labelName: undefined,
labelDesc: undefined,
systemCode: undefined,
};
this.resetForm("formRef");
}
}
};
};
</script>

View File

@ -2,18 +2,8 @@
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="标签名称" prop="lableName">
<el-input v-model="queryParams.lableName" 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 label="标签名称" prop="labelName">
<el-input v-model="queryParams.labelName" placeholder="请输入标签名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
@ -25,20 +15,20 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
v-hasPermi="['base:label:create']">新增</el-button>
</el-col>
<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>
v-hasPermi="['base:label:create']">新增
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<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="lableName" />
<el-table-column label="标签描述" align="center" prop="lableDesc" />
<el-table-column label="系统标识" align="center" prop="systemCode" />
<el-table-column label="标签名称" align="center" prop="labelName"/>
<el-table-column label="标签样式" align="center" prop="labelType">
<template v-slot="scope">
<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">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@ -47,9 +37,11 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<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)"
v-hasPermi="['base:label:delete']">删除</el-button>
v-hasPermi="['base:label:delete']">删除
</el-button>
</template>
</el-table-column>
</el-table>
@ -57,13 +49,14 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<LabelForm ref="formRef" @success="getList" />
<LabelForm ref="formRef" @success="getList"/>
</div>
</template>
<script>
import * as LabelApi from '@/api/base/label';
import LabelForm from './LabelForm.vue';
export default {
name: "Label",
components: {
@ -91,8 +84,8 @@ export default {
queryParams: {
pageNo: 1,
pageSize: 10,
lableName: null,
lableDesc: null,
labelName: null,
labelDesc: null,
systemCode: null,
createTime: [],
},
@ -107,7 +100,7 @@ export default {
try {
this.loading = true;
const res = await LabelApi.getLabelPage(this.queryParams);
this.list = res.data.list;
this.list = res.data.records;
this.total = res.data.total;
} finally {
this.loading = false;
@ -135,7 +128,8 @@ export default {
await LabelApi.deleteLabel(id);
await this.getList();
this.$modal.msgSuccess("删除成功");
} catch {}
} catch {
}
},
/** 导出按钮操作 */
async handleExport() {