商品信息回显第一版

dev
wxy 2024-05-14 16:15:20 +08:00
parent 5018955b90
commit e7dda3a38a
5 changed files with 641 additions and 2 deletions

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询1列表
export function listJutsus(query) {
return request({
url: '/product/Jutsus/list',
method: 'get',
params: query
})
}
// 查询1详细
export function getJutsus(jutsuId) {
return request({
url: '/product/Jutsus/' + jutsuId,
method: 'get'
})
}
// 新增1
export function addJutsus(data) {
return request({
url: '/product/Jutsus',
method: 'post',
data: data
})
}
// 修改1
export function updateJutsus(data) {
return request({
url: '/product/Jutsus',
method: 'put',
data: data
})
}
// 删除1
export function delJutsus(jutsuId) {
return request({
url: '/product/Jutsus/' + jutsuId,
method: 'delete'
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询111列表
export function listCharacters(query) {
return request({
url: '/product/naruto/list',
method: 'get',
params: query
})
}
// 查询111详细
export function getCharacters(characterId) {
return request({
url: '/product/naruto/' + characterId,
method: 'get'
})
}
// 新增111
export function addCharacters(data) {
return request({
url: '/product/naruto',
method: 'post',
data: data
})
}
// 修改111
export function updateCharacters(data) {
return request({
url: '/product/naruto',
method: 'put',
data: data
})
}
// 删除111
export function delCharacters(characterId) {
return request({
url: '/product/naruto/' + characterId,
method: 'delete'
})
}

View File

@ -421,6 +421,7 @@ export default {
},
updateInfoStatus(params) {
console.log(params)
const {id, status} = params
this.updateInfoById({id, status})
},
@ -643,7 +644,7 @@ export default {
this.active = Number(data.step);
let ruleId = data.ruleId;
this.changeRuleInfoListByRuleId(ruleId);
if(data.skuInfoList !=null && data.skuInfoList.size > 0){
if(data.skuInfoList !=null && data.skuInfoList.length > 0){
data.skuInfoList.forEach(item => {
if (item.sku !== null) {
let skuArray = item.sku.split(',');
@ -674,6 +675,7 @@ export default {
let type = this.form.type[this.form.type - 1];
this.form.typeIds = typeIds;
this.form.type = type;
this.form.step = this.active
this.form["skuInfoList"] = this.tableBodyTemplate;
if (this.form.id != null) {

View File

@ -0,0 +1,265 @@
<template>
<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="name">
<el-input
v-model="queryParams.name"
placeholder="请输入忍术名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属人物ID" prop="characterId">
<el-input
v-model="queryParams.characterId"
placeholder="请输入所属人物ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" 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-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['product:Jutsus:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['product:Jutsus:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['product:Jutsus:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['product:Jutsus:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="JutsusList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="忍术ID" align="center" prop="jutsuId" />
<el-table-column label="忍术名称" align="center" prop="name" />
<el-table-column label="忍术类型" align="center" prop="type" />
<el-table-column label="所属人物ID" align="center" prop="characterId" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['product:Jutsus:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['product:Jutsus:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改1对话框 -->
<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="忍术名称" prop="name">
<el-input v-model="form.name" placeholder="请输入忍术名称" />
</el-form-item>
<el-form-item label="所属人物ID" prop="characterId">
<el-input v-model="form.characterId" placeholder="请输入所属人物ID" />
</el-form-item>
</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>
<script>
import { listJutsus, getJutsus, delJutsus, addJutsus, updateJutsus } from "@/api/product/jutsus";
export default {
name: "Jutsus",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// 1
JutsusList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
type: null,
characterId: null
},
//
form: {},
//
rules: {
name: [
{ required: true, message: "忍术名称不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询1列表 */
getList() {
this.loading = true;
listJutsus(this.queryParams).then(response => {
this.JutsusList = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
jutsuId: null,
name: null,
type: null,
characterId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.jutsuId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加1";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const jutsuId = row.jutsuId || this.ids
getJutsus(jutsuId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改1";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.jutsuId != null) {
updateJutsus(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addJutsus(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const jutsuIds = row.jutsuId || this.ids;
this.$modal.confirm('是否确认删除1编号为"' + jutsuIds + '"的数据项?').then(function() {
return delJutsus(jutsuIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('product/Jutsus/export', {
...this.queryParams
}, `Jutsus_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,284 @@
<template>
<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="name">
<el-input
v-model="queryParams.name"
placeholder="姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="人物" prop="age">
<el-input
v-model="queryParams.age"
placeholder="请输入人物年龄"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属村庄" prop="villageId">
<el-input
v-model="queryParams.villageId"
placeholder="所属村庄ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" 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-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['product:naruto:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['product:naruto:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['product:naruto:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['product:naruto:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="CharactersList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="characterId" />
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="年龄" align="center" prop="age" />
<el-table-column label="村庄表" align="center" prop="villageId" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['product:naruto:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['product:naruto:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改111对话框 -->
<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="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入人物姓名,不能为空" />
</el-form-item>
<el-form-item label="年龄" prop="age">
<el-input v-model="form.age" placeholder="请输入人物年龄" />
</el-form-item>
<el-form-item label="村庄" prop="villageId">
<el-input v-model="form.villageId" placeholder="请输入所属村庄关联村庄表" />
</el-form-item>
</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>
<script>
import { listCharacters, getCharacters, delCharacters, addCharacters, updateCharacters } from "@/api/product/naruto";
export default {
name: "Characters",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// 111
CharactersList: [],
//
title: "",
//
open: false,
stepsMap: {
0: '木叶村',
1: '添加规格信息',
2: '添加描述信息',
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
age: null,
villageId: null
},
//
form: {},
//
rules: {
name: [
{ required: true, message: "人物姓名,不能为空不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询111列表 */
getList() {
this.loading = true;
listCharacters(this.queryParams).then(response => {
this.CharactersList = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
characterId: null,
name: null,
age: null,
villageId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.characterId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加111";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const characterId = row.characterId || this.ids
getCharacters(characterId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改111";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.characterId != null) {
updateCharacters(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCharacters(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const characterIds = row.characterId || this.ids;
this.$modal.confirm('是否确认删除111编号为"' + characterIds + '"的数据项?').then(function() {
return delCharacters(characterIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('naruto/Characters/export', {
...this.queryParams
}, `Characters_${new Date().getTime()}.xlsx`)
}
}
};
</script>