Commit 392890c9 authored by 祁正's avatar 祁正

国内品牌管理

parent 763e7903
......@@ -4,27 +4,30 @@
<div style="width: 100%;display: flex;align-items: center;justify-content: flex-end">
<el-button
type="primary"
plain
icon="Plus"
class="btn-C"
@click="handleAdd"
style=""
></el-button>
></el-button>
</div>
<el-table v-loading="loading" :data="brandDataList" @selection-change="handleSelectionChange">
<el-table style="margin-top: 15px" border v-loading="loading" :data="brandDataList" @selection-change="handleSelectionChange">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="类型" align="center" prop="type" />
<el-table-column label="品牌" align="center" prop="brand" />
<el-table-column label="更新人" align="center" prop="updateBy" />
<el-table-column label="更新人" align="center" prop="updateUserName" />
<el-table-column label="更新时间" align="center" prop="updateTime">
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="备注" align="center" prop="remark" >
<template #default="scope">
{{scope.row.remark || '--'}}
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['brandData:brandData:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['brandData:brandData:remove']">删除</el-button>
<el-button link type="primary" @click="handleUpdate(scope.row)" >编辑</el-button>
<el-button link type="danger" @click="handleDelete(scope.row)" >删除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -38,13 +41,17 @@
/>
<!-- 添加或修改国内品牌数据对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="brandDataRef" :model="form" :rules="rules" label-width="80px">
<el-dialog top="30" :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="brandDataRef" label-position="top" :model="form" :rules="rules" label-width="80px">
<el-form-item label="类型" prop="type">
<el-input v-model="form.type" disabled placeholder="请输入类型" />
</el-form-item>
<el-form-item label="品牌" prop="brand">
<el-input v-model="form.brand" placeholder="请输入品牌" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
<el-input v-model="form.remark" placeholder="请输入内容" />
</el-form-item>
</el-form>
<template #footer>
......@@ -57,7 +64,7 @@
</div>
</template>
<script setup name="BrandData">
<script setup >
import { listBrandData, getBrandData, delBrandData, addBrandData, updateBrandData } from "@/api/brandData/brandData";
const { proxy } = getCurrentInstance();
......@@ -72,20 +79,27 @@ const multiple = ref(true);
const total = ref(0);
const title = ref("");
const form = ref({
type:'国内'
})
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
},
rules: {
createTime: [
{ required: true, message: "创建时间不能为空", trigger: "blur" }
type: [
{ required: true, message: "类型不能为空", trigger: "blur" }
],
brand: [
{ required: true, message: "品牌不能为空", trigger: "blur" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
const { queryParams, rules } = toRefs(data);
/** 查询国内品牌数据列表 */
function getList() {
......@@ -106,16 +120,10 @@ function cancel() {
// 表单重置
function reset() {
form.value = {
id: null,
type: null,
brand: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
remark: null,
type:"国内"
};
proxy.resetForm("brandDataRef");
}
/** 搜索按钮操作 */
......@@ -141,7 +149,7 @@ function handleSelectionChange(selection) {
function handleAdd() {
reset();
open.value = true;
title.value = "添加国内品牌数据";
title.value = "新增";
}
/** 修改按钮操作 */
......@@ -151,7 +159,7 @@ function handleUpdate(row) {
getBrandData(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改国内品牌数据";
title.value = "编辑";
});
}
......@@ -179,7 +187,7 @@ function submitForm() {
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除国内品牌数据编号为"' + _ids + '"的数据项?').then(function() {
proxy.$modal.confirm('是否确认删除数据项?').then(function() {
return delBrandData(_ids);
}).then(() => {
getList();
......@@ -206,4 +214,5 @@ getList();
:deep(.el-pagination.is-background .el-pager li.is-active){
background-color: #0154FB;
}
</style>
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