便利店
This commit is contained in:
parent
2eae3a90aa
commit
9ca2e2e609
@ -1,6 +1,6 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 查询供应商列表
|
// 查询商品列表
|
||||||
export function listLJGoods(query) {
|
export function listLJGoods(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/convenience/goods/list',
|
url: '/business/convenience/goods/list',
|
||||||
@ -9,7 +9,7 @@ export function listLJGoods(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询供应商详细
|
// 查询商品详细
|
||||||
export function getLJGoods(id) {
|
export function getLJGoods(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/convenience/goods/' + id,
|
url: '/business/convenience/goods/' + id,
|
||||||
@ -17,7 +17,7 @@ export function getLJGoods(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增供应商
|
// 新增商品
|
||||||
export function addLJGoods(data) {
|
export function addLJGoods(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/convenience/goods',
|
url: '/business/convenience/goods',
|
||||||
@ -26,7 +26,7 @@ export function addLJGoods(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改供应商
|
// 修改商品
|
||||||
export function updateLJGoods(data) {
|
export function updateLJGoods(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/convenience/goods',
|
url: '/business/convenience/goods',
|
||||||
@ -35,7 +35,7 @@ export function updateLJGoods(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除供应商
|
// 删除商品
|
||||||
export function delLJGoods(id) {
|
export function delLJGoods(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/convenience/goods/' + id,
|
url: '/business/convenience/goods/' + id,
|
||||||
|
466
fuintAdmin/src/views/convenienceStore/goodsFile.vue
Normal file
466
fuintAdmin/src/views/convenienceStore/goodsFile.vue
Normal file
@ -0,0 +1,466 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card >
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="商品分类" prop="cvsGoodId">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.cvsGoodId"
|
||||||
|
placeholder="全部"
|
||||||
|
clearable
|
||||||
|
style="width: 300px"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="供应商" prop="supplierId">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.supplierId"
|
||||||
|
placeholder="全部"
|
||||||
|
clearable
|
||||||
|
style="width: 300px"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入商品名称"
|
||||||
|
clearable
|
||||||
|
style="width: 240px;"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="拼音码" prop="pinyinCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.pinyinCode"
|
||||||
|
placeholder="请输入拼音码"
|
||||||
|
clearable
|
||||||
|
style="width: 240px;"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="条形码" prop="goodsNo">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.goodsNo"
|
||||||
|
placeholder="请输入商品条形码"
|
||||||
|
clearable
|
||||||
|
style="width: 240px;"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="货架号" prop="shelfNumber">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.shelfNumber"
|
||||||
|
placeholder="请输入商品所在货架号"
|
||||||
|
clearable
|
||||||
|
style="width: 240px;"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="等级状态" prop="status">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.status"
|
||||||
|
placeholder="全部"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.zhzt"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card style="margin-top: 20px">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['member:add']"
|
||||||
|
>新增商品</el-button>
|
||||||
|
<el-table ref="tables" v-loading="loading" :data="list"
|
||||||
|
@selection-change="handleSelectionChange" :default-sort="defaultSort"
|
||||||
|
@sort-change="handleSortChange">
|
||||||
|
<el-table-column label="ID" prop="id" align="center" width="60"/>
|
||||||
|
<el-table-column label="分类名称" prop="cvsGoodId" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商品名称" prop="name" align="center" width="160"/>
|
||||||
|
<el-table-column label="供应商" prop="supplierId" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="条码" prop="goodsNo" align="center" width="160"/>
|
||||||
|
<el-table-column label="拼音码" prop="pinyinCode" align="center"/>
|
||||||
|
<el-table-column label="货架号" prop="shelfNumber" align="center"/>
|
||||||
|
<el-table-column label="库存" prop="stock" align="center"/>
|
||||||
|
<el-table-column label="单位" prop="unit" align="center"/>
|
||||||
|
<el-table-column label="进货价" prop="buyingPrice" align="center"/>
|
||||||
|
<el-table-column label="零售价" prop="retailPrice" align="center"/>
|
||||||
|
<el-table-column label="会员价" prop="memberPrice" align="center"/>
|
||||||
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="更新时间" align="center" width="160" prop="updateTime">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="120" fixed='right'>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
v-hasPermi="['member:add']"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
v-hasPermi="['member:add']"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.page"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 添加或修改对话框 -->
|
||||||
|
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="商品条码" prop="goodsNo">
|
||||||
|
<el-input v-model="form.goodsNo" placeholder="商品的条码信息">
|
||||||
|
<el-button slot="append">查询</el-button>
|
||||||
|
</el-input>
|
||||||
|
<div style="text-align: right;color: grey;font-size: 12px">
|
||||||
|
商品无条码?您可以<span style="color: #00afff">生成条码</span>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="商品名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入商品名称"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="所属分类" prop="cvsGoodId">
|
||||||
|
<el-select
|
||||||
|
v-model="form.cvsGoodId"
|
||||||
|
placeholder="全部"
|
||||||
|
clearable
|
||||||
|
style="width: 300px"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="进货单价" prop="buyingPrice">
|
||||||
|
<el-input v-model="form.buyingPrice">
|
||||||
|
<template slot="append">元</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="零售价" prop="retailPrice">
|
||||||
|
<el-input v-model="form.retailPrice">
|
||||||
|
<template slot="append">元</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="会员价" prop="memberPrice">
|
||||||
|
<el-input v-model="form.memberPrice">
|
||||||
|
<template slot="append">元</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="拼音码" prop="pinyinCode">
|
||||||
|
<el-input v-model="form.pinyinCode" placeholder="输入商品名称自动回填"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="单位" prop="unit">
|
||||||
|
<el-input v-model="form.unit" placeholder="如:个、瓶、包"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="货架号" prop="shelfNumber">
|
||||||
|
<el-input v-model="form.shelfNumber" placeholder="如:1-2-2"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="是否使用积分抵扣" prop="canUsePoint" label-width="110">
|
||||||
|
<el-radio-group v-model="form.canUsePoint">
|
||||||
|
<el-radio v-for="dict in dict.type.yes_or_no" :label="dict.value">{{ dict.label }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="16">
|
||||||
|
<el-form-item label="初始库存" prop="stock">
|
||||||
|
<el-input v-model="form.stock" placeholder="0"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="供应商" prop="supplierId">
|
||||||
|
<el-select
|
||||||
|
v-model="form.supplierId"
|
||||||
|
placeholder="全部"
|
||||||
|
clearable
|
||||||
|
style="width: 300px"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="排序" prop="sort">
|
||||||
|
<el-input-number v-model="form.sort" @change="handleChange" :min="0" label="0"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="状态" prop="mobile">
|
||||||
|
<el-radio-group v-model="form.status">
|
||||||
|
<el-radio v-for="dict in dict.type.zhzt" :label="dict.value">{{ dict.label }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<el-alert
|
||||||
|
type="error"
|
||||||
|
style="margin-top: 15px"
|
||||||
|
:closable="false">
|
||||||
|
<p v-for="(item,index) in stockType" :id="index">
|
||||||
|
{{item}}
|
||||||
|
</p>
|
||||||
|
</el-alert>
|
||||||
|
<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 {selectParentById, selectTree} from "@/api/convenienceStore/goods";
|
||||||
|
import {listSupplier} from "@/api/convenienceStore/supplier";
|
||||||
|
import {addLJGoods, delLJGoods, getLJGoods, listLJGoods, updateLJGoods} from "@/api/convenienceStore/ljgoods";
|
||||||
|
import {getSysConfig} from "@/api/staff/user/sysconfig";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
dicts: ['zhzt','yes_or_no'],
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
// 关联库存类型
|
||||||
|
stockType:'',
|
||||||
|
cvsGoodName:'',
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 标题
|
||||||
|
title: "",
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 表格数据
|
||||||
|
list: [],
|
||||||
|
// 是否显示修改对话框
|
||||||
|
open: false,
|
||||||
|
// 默认排序
|
||||||
|
defaultSort: {prop: 'updateTime', order: 'descending'},
|
||||||
|
// 商品分类列表
|
||||||
|
cvsGoodList:[],
|
||||||
|
// 供应商列表
|
||||||
|
supplierList:[],
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
page: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
id: '',
|
||||||
|
cvsGoodId: '',
|
||||||
|
supplierId: '',
|
||||||
|
name: '',
|
||||||
|
pinyinCode: '',
|
||||||
|
goodsNo: '',
|
||||||
|
shelfNumber: '',
|
||||||
|
status: '',
|
||||||
|
isRecovery:0,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
name: [
|
||||||
|
{ required: true, message: "供应商名称不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.getQueryList();
|
||||||
|
this.getType();
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
// 排序计步器
|
||||||
|
handleChange(value) {
|
||||||
|
console.log(value);
|
||||||
|
},
|
||||||
|
// 获取分类名称
|
||||||
|
getType(){
|
||||||
|
getSysConfig('stock_type').then(response => {
|
||||||
|
this.stockType = response.data.split(";")
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 查询搜索列表信息
|
||||||
|
getQueryList(){
|
||||||
|
selectTree().then(response => {
|
||||||
|
this.cvsGoodList = response.data.records
|
||||||
|
});
|
||||||
|
listSupplier().then(response => {
|
||||||
|
this.supplierList = response.data.records
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 查询列表
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listLJGoods(this.queryParams).then(response => {
|
||||||
|
this.list = response.data.records;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 搜索按钮操作
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
// 重置按钮操作
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.resetForm("form");
|
||||||
|
this.form= {}
|
||||||
|
},
|
||||||
|
// 新增按钮操作
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "新增商品";
|
||||||
|
},
|
||||||
|
// 修改按钮操作
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids;
|
||||||
|
getLJGoods(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "编辑商品";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 删除按钮操作
|
||||||
|
handleDelete(row) {
|
||||||
|
const name = row.name
|
||||||
|
this.$modal.confirm('确定删除"' + name + '"的商品信息?').then(function() {
|
||||||
|
return delLJGoods(row.id);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
// 提交按钮
|
||||||
|
submitForm: function() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id) {
|
||||||
|
updateLJGoods(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("商品信息更新成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addLJGoods(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("商品信息新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
// 排序触发事件
|
||||||
|
handleSortChange(column, prop, order) {
|
||||||
|
this.queryParams.orderByColumn = column.prop;
|
||||||
|
this.queryParams.isAsc = column.order;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-container{
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
background: #f6f8f9;
|
||||||
|
}
|
||||||
|
</style>
|
@ -3,8 +3,8 @@
|
|||||||
<el-card style="margin-top: 20px;">
|
<el-card style="margin-top: 20px;">
|
||||||
<!-- 查询类别 -->
|
<!-- 查询类别 -->
|
||||||
<el-form :inline="true" :model="queryParams">
|
<el-form :inline="true" :model="queryParams">
|
||||||
<el-form-item label="分类名称" prop="categoryName">
|
<el-form-item label="分类名称" prop="name">
|
||||||
<el-input v-model="queryParams.categoryName" placeholder="请输入分类名称" clearable @keyup.enter.native="handleQuery"></el-input>
|
<el-input v-model="queryParams.name" placeholder="请输入分类名称" clearable @keyup.enter.native="handleQuery"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<el-select v-model="queryParams.status" placeholder="请选择商品状态" clearable >
|
<el-select v-model="queryParams.status" placeholder="请选择商品状态" clearable >
|
||||||
@ -42,7 +42,7 @@
|
|||||||
@selection-change="handleSelectionChange" :default-sort="defaultSort"
|
@selection-change="handleSelectionChange" :default-sort="defaultSort"
|
||||||
@sort-change="handleSortChange">
|
@sort-change="handleSortChange">
|
||||||
<el-table-column label="ID" prop="id" align="center" width="60"/>
|
<el-table-column label="ID" prop="id" align="center" width="60"/>
|
||||||
<el-table-column label="分类名称" align="center" prop="categoryName"/>
|
<el-table-column label="分类名称" align="center" prop="name"/>
|
||||||
<el-table-column label="商品编号" align="center" prop="code"/>
|
<el-table-column label="商品编号" align="center" prop="code"/>
|
||||||
<el-table-column label="排序" align="center" prop="sorted" />
|
<el-table-column label="排序" align="center" prop="sorted" />
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
@ -125,13 +125,13 @@
|
|||||||
<el-select v-model="form.pid" placeholder="请选择上级分类">
|
<el-select v-model="form.pid" placeholder="请选择上级分类">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in goodsOptions"
|
v-for="item in goodsOptions"
|
||||||
:label="item.categoryName"
|
:label="item.name"
|
||||||
:value="item.id">
|
:value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="分类名称" prop="categoryName" style="margin-left: -8px;">
|
<el-form-item label="分类名称" prop="name" style="margin-left: -8px;">
|
||||||
<el-input v-model="form.categoryName" style="width: 300px;"></el-input>
|
<el-input v-model="form.name" style="width: 300px;"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="排序规则">
|
<el-form-item label="排序规则">
|
||||||
<el-input-number v-model="form.sorted" @change="handleChange" :min="0" :max="10" style="width: 300px;"></el-input-number>
|
<el-input-number v-model="form.sorted" @change="handleChange" :min="0" :max="10" style="width: 300px;"></el-input-number>
|
||||||
@ -215,7 +215,7 @@ export default {
|
|||||||
//编辑表单
|
//编辑表单
|
||||||
editForm:{
|
editForm:{
|
||||||
pid:'',
|
pid:'',
|
||||||
categoryName:'',
|
name:'',
|
||||||
status:'qy',
|
status:'qy',
|
||||||
sorted:0,
|
sorted:0,
|
||||||
},
|
},
|
||||||
@ -223,7 +223,7 @@ export default {
|
|||||||
goodsOptions:[],
|
goodsOptions:[],
|
||||||
//查询表单
|
//查询表单
|
||||||
goodsQueryForm: {
|
goodsQueryForm: {
|
||||||
categoryName: '',
|
name: '',
|
||||||
status: '',
|
status: '',
|
||||||
pid:"",
|
pid:"",
|
||||||
pageNum:'1',
|
pageNum:'1',
|
||||||
@ -236,14 +236,14 @@ export default {
|
|||||||
//对话框表单
|
//对话框表单
|
||||||
form:{
|
form:{
|
||||||
pid:'',
|
pid:'',
|
||||||
categoryName:'',
|
name:'',
|
||||||
status:'qy',
|
status:'qy',
|
||||||
sorted:0,
|
sorted:0,
|
||||||
},
|
},
|
||||||
tableData: [{
|
tableData: [{
|
||||||
id: '',
|
id: '',
|
||||||
pid:'',
|
pid:'',
|
||||||
categoryName: '',
|
name: '',
|
||||||
sorted: '',
|
sorted: '',
|
||||||
status:'',
|
status:'',
|
||||||
createdTime:'',
|
createdTime:'',
|
||||||
@ -253,13 +253,13 @@ export default {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
categoryName:'',
|
name:'',
|
||||||
status: '',
|
status: '',
|
||||||
},
|
},
|
||||||
aa:[],
|
aa:[],
|
||||||
//校验规则
|
//校验规则
|
||||||
rules: {
|
rules: {
|
||||||
categoryName: [
|
name: [
|
||||||
{ required: true, message: '请输入分类名称', trigger: 'blur' },
|
{ required: true, message: '请输入分类名称', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -276,7 +276,7 @@ export default {
|
|||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
pid:'',
|
pid:'',
|
||||||
categoryName:'',
|
name:'',
|
||||||
status:'qy',
|
status:'qy',
|
||||||
sorted:0,
|
sorted:0,
|
||||||
}
|
}
|
||||||
@ -325,7 +325,7 @@ export default {
|
|||||||
//新增商品类别
|
//新增商品类别
|
||||||
insertGoods(){
|
insertGoods(){
|
||||||
this.resetForm('form')
|
this.resetForm('form')
|
||||||
this.form.categoryName = ''
|
this.form.name = ''
|
||||||
this.form.pid = ''
|
this.form.pid = ''
|
||||||
this.form.status = 'qy'
|
this.form.status = 'qy'
|
||||||
this.form.sorted = 0
|
this.form.sorted = 0
|
||||||
@ -394,7 +394,7 @@ export default {
|
|||||||
// 取消提交
|
// 取消提交
|
||||||
cancelSubmit(){
|
cancelSubmit(){
|
||||||
this.$refs.form.resetFields();//清空
|
this.$refs.form.resetFields();//清空
|
||||||
this.form.categoryName = ''
|
this.form.name = ''
|
||||||
this.form.pid = ''
|
this.form.pid = ''
|
||||||
this.form.status = ''
|
this.form.status = ''
|
||||||
this.form.sorted = 0
|
this.form.sorted = 0
|
||||||
@ -411,7 +411,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 取消查询
|
// 取消查询
|
||||||
resetForm(){
|
resetForm(){
|
||||||
this.goodsQueryForm.categoryName = ''
|
this.goodsQueryForm.name = ''
|
||||||
this.goodsQueryForm.status = ''
|
this.goodsQueryForm.status = ''
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
@ -453,7 +453,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 删除按钮操作
|
// 删除按钮操作
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const name = row.categoryName
|
const name = row.name
|
||||||
this.$modal.confirm('确定删除"' + name + '"的分类信息?').then(function() {
|
this.$modal.confirm('确定删除"' + name + '"的分类信息?').then(function() {
|
||||||
// return deleteMember(row.id);
|
// return deleteMember(row.id);
|
||||||
return deleteBYId(row.id);
|
return deleteBYId(row.id);
|
||||||
|
@ -40,7 +40,7 @@ public class CvsGoods extends BaseEntity implements Serializable {
|
|||||||
|
|
||||||
//商品分类
|
//商品分类
|
||||||
@ApiModelProperty("商品分类")
|
@ApiModelProperty("商品分类")
|
||||||
private String categoryName;
|
private String name;
|
||||||
|
|
||||||
//商品排序
|
//商品排序
|
||||||
@ApiModelProperty("商品排序")
|
@ApiModelProperty("商品排序")
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<mapper namespace="com.fuint.business.convenienceSore.mapper.CvsGoodsMapper">
|
<mapper namespace="com.fuint.business.convenienceSore.mapper.CvsGoodsMapper">
|
||||||
|
|
||||||
<sql id="selectCvsGoods">
|
<sql id="selectCvsGoods">
|
||||||
select id,pid,category_name,code,sorted, status, create_time, create_by, update_time, update_by from cvs_goods
|
select id,pid,name,code,sorted, status, create_time, create_by, update_time, update_by from cvs_goods
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="selectCvsGood">
|
<sql id="selectCvsGood">
|
||||||
@ -17,8 +17,8 @@
|
|||||||
<if test="pid != null">
|
<if test="pid != null">
|
||||||
and pid = #{pid}
|
and pid = #{pid}
|
||||||
</if>
|
</if>
|
||||||
<if test="categoryName != null and categoryName != ''">
|
<if test="name != null and name != ''">
|
||||||
and category_name = #{categoryName}
|
and name = #{name}
|
||||||
</if>
|
</if>
|
||||||
<if test="sorted != null and sorted != ''">
|
<if test="sorted != null and sorted != ''">
|
||||||
and sorted = #{sorted}
|
and sorted = #{sorted}
|
||||||
@ -33,7 +33,7 @@
|
|||||||
DISTINCT
|
DISTINCT
|
||||||
pTable.id,
|
pTable.id,
|
||||||
pTable.pid,
|
pTable.pid,
|
||||||
pTable.category_name,
|
pTable.name,
|
||||||
pTable.`code`,
|
pTable.`code`,
|
||||||
pTable.sorted,
|
pTable.sorted,
|
||||||
pTable.`STATUS`,
|
pTable.`STATUS`,
|
||||||
@ -50,9 +50,9 @@
|
|||||||
<if test="goods.status != null and goods.status != ''">
|
<if test="goods.status != null and goods.status != ''">
|
||||||
and pTable.status = #{goods.status}
|
and pTable.status = #{goods.status}
|
||||||
</if>
|
</if>
|
||||||
<if test="goods.categoryName != null and goods.categoryName!= ''">
|
<if test="goods.name != null and goods.name!= ''">
|
||||||
and pTable.category_name like concat('%',#{goods.categoryName},'%')
|
and pTable.name like concat('%',#{goods.name},'%')
|
||||||
or cTable.category_name like concat('%',#{goods.categoryName},'%')
|
or cTable.name like concat('%',#{goods.name},'%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
group by pTable.id
|
group by pTable.id
|
||||||
@ -61,8 +61,8 @@
|
|||||||
<!-- <include refid="selectCvsGood"></include>-->
|
<!-- <include refid="selectCvsGood"></include>-->
|
||||||
<!-- <where>-->
|
<!-- <where>-->
|
||||||
<!-- store_id = #{goods.storeId}-->
|
<!-- store_id = #{goods.storeId}-->
|
||||||
<!-- <if test="goods.categoryName != null and goods.categoryName != ''">-->
|
<!-- <if test="goods.name != null and goods.name != ''">-->
|
||||||
<!-- and category_name like concat('%', #{goods.categoryName}, '%')-->
|
<!-- and name like concat('%', #{goods.name}, '%')-->
|
||||||
<!-- </if>-->
|
<!-- </if>-->
|
||||||
<!-- <if test="goods.status != null and goods.status != ''">-->
|
<!-- <if test="goods.status != null and goods.status != ''">-->
|
||||||
<!-- and status = #{goods.status}-->
|
<!-- and status = #{goods.status}-->
|
||||||
@ -76,7 +76,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
id,
|
id,
|
||||||
pid,
|
pid,
|
||||||
category_name,
|
name,
|
||||||
`CODE`,
|
`CODE`,
|
||||||
sorted,
|
sorted,
|
||||||
`STATUS`,
|
`STATUS`,
|
||||||
@ -90,8 +90,8 @@
|
|||||||
<if test="pid != null ">
|
<if test="pid != null ">
|
||||||
and pid = #{pid}
|
and pid = #{pid}
|
||||||
</if>
|
</if>
|
||||||
<if test="categoryName != null and categoryName != ''">
|
<if test="name != null and name != ''">
|
||||||
and category_name like CONCAT('%',#{categoryName},'%')
|
and name like CONCAT('%',#{name},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="status != null and status != ''">
|
<if test="status != null and status != ''">
|
||||||
and status = #{status}
|
and status = #{status}
|
||||||
@ -104,8 +104,8 @@
|
|||||||
<include refid="selectCvsGood"></include>
|
<include refid="selectCvsGood"></include>
|
||||||
<where>
|
<where>
|
||||||
store_id = #{goods.storeId} and pid = 0
|
store_id = #{goods.storeId} and pid = 0
|
||||||
<if test="goods.categoryName != null and goods.categoryName != ''">
|
<if test="goods.name != null and goods.name != ''">
|
||||||
and category_name like concat('%', #{goods.categoryName}, '%')
|
and name like concat('%', #{goods.name}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="goods.status != null and goods.status != ''">
|
<if test="goods.status != null and goods.status != ''">
|
||||||
and status = #{goods.status}
|
and status = #{goods.status}
|
||||||
|
@ -66,7 +66,7 @@ public class CvsGoodsServiceImpl extends ServiceImpl<CvsGoodsMapper,CvsGoods> im
|
|||||||
List<CvsGoodsVo> CvsGoodsVoList = resList.stream().map(goods -> {
|
List<CvsGoodsVo> CvsGoodsVoList = resList.stream().map(goods -> {
|
||||||
CvsGoodsVo cvsGoodsVo = new CvsGoodsVo();
|
CvsGoodsVo cvsGoodsVo = new CvsGoodsVo();
|
||||||
cvsGoodsVo.setId(goods.getId());
|
cvsGoodsVo.setId(goods.getId());
|
||||||
cvsGoodsVo.setCategoryName(goods.getCategoryName());
|
cvsGoodsVo.setName(goods.getName());
|
||||||
cvsGoodsVo.setPid(goods.getPid());
|
cvsGoodsVo.setPid(goods.getPid());
|
||||||
cvsGoodsVo.setStatus(goods.getStatus());
|
cvsGoodsVo.setStatus(goods.getStatus());
|
||||||
cvsGoodsVo.setCode(goods.getCode());
|
cvsGoodsVo.setCode(goods.getCode());
|
||||||
|
@ -30,7 +30,7 @@ public class CvsGoodsVo extends BaseEntity {
|
|||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
//商品分类
|
//商品分类
|
||||||
private String categoryName;
|
private String name;
|
||||||
|
|
||||||
//商品排序
|
//商品排序
|
||||||
private Integer sorted;
|
private Integer sorted;
|
||||||
|
Loading…
Reference in New Issue
Block a user