新增商品列表
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VUE_APP_BASE_API = 'http://localhost:8000'
|
VUE_APP_BASE_API = 'http://192.168.2.128:8000'
|
||||||
VUE_APP_WS_API = 'ws://localhost:8000'
|
VUE_APP_WS_API = 'ws://192.168.2.128:8000'
|
||||||
|
|
||||||
# 是否启用 babel-plugin-dynamic-import-node插件
|
# 是否启用 babel-plugin-dynamic-import-node插件
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -16,17 +16,6 @@
|
|||||||
"dev_t": "set NODE_OPTIONS=\"--openssl-legacy-provider\" & npm run dev\n"
|
"dev_t": "set NODE_OPTIONS=\"--openssl-legacy-provider\" & npm run dev\n"
|
||||||
|
|
||||||
},
|
},
|
||||||
"husky": {
|
|
||||||
"hooks": {
|
|
||||||
"pre-commit": "lint-staged"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lint-staged": {
|
|
||||||
"src/**/*.{js,vue}": [
|
|
||||||
"eslint --fix",
|
|
||||||
"git add"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/elunez/eladmin-web.git"
|
"url": "https://github.com/elunez/eladmin-web.git"
|
||||||
|
|||||||
13
src/api/shop.js
Normal file
13
src/api/shop.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品列表
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function tbProduct(params) {
|
||||||
|
return request({
|
||||||
|
url: '/api/tbProduct',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -24,15 +24,10 @@ export function edit(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function addProduct(page,size){
|
export function addProduct(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/tbProductGroup/addProduct',
|
url: '/api/tbProductGroup/addProduct',
|
||||||
menthod:'post',
|
menthod: 'post',
|
||||||
data: {
|
data
|
||||||
page,
|
|
||||||
size
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del ,addProduct}
|
|
||||||
|
|||||||
@@ -23,20 +23,20 @@
|
|||||||
<el-input v-model="form.productIds" style="width: 370px;" />
|
<el-input v-model="form.productIds" style="width: 370px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-button type="primary" @click="addProductClick">+添加商品
|
<el-button type="primary" @click="addProduct">+添加商品
|
||||||
<el-dialog title="选择商品" :visible.sync="productClick">
|
<el-dialog title="选择商品" :visible.sync="productClick">
|
||||||
<el-table :data="productList.content" style="width: 100%;">
|
<el-table :data="productList.content" style="width: 100%;">
|
||||||
<el-table-column type="selection" width="55"></el-table-column>
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column property="name" label="商品信息" width="150"></el-table-column>
|
<el-table-column property="name" label="商品信息" width="150" />
|
||||||
<el-table-column property="lowPrice" label="售价" width="200"></el-table-column>
|
<el-table-column property="lowPrice" label="售价" width="200" />
|
||||||
<el-table-column property="address" label="地址"></el-table-column>
|
<el-table-column property="address" label="地址" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="addProduct">确 定</el-button>
|
<el-button type="primary" @click="addProduct">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<el-form-item label="创建时间">
|
<el-form-item label="创建时间">
|
||||||
@@ -79,7 +79,7 @@ import rrOperation from '@crud/RR.operation'
|
|||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
import udOperation from '@crud/UD.operation'
|
import udOperation from '@crud/UD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
import {addProduct} from '@/api/tbProductGroup'
|
import { addProduct } from '@/api/tbProductGroup'
|
||||||
|
|
||||||
const defaultForm = { id: null, name: null, merchantId: null, shopId: null, pic: null, isShow: null, detail: null, style: null, sort: null, productIds: null, createdAt: null, updatedAt: null }
|
const defaultForm = { id: null, name: null, merchantId: null, shopId: null, pic: null, isShow: null, detail: null, style: null, sort: null, productIds: null, createdAt: null, updatedAt: null }
|
||||||
export default {
|
export default {
|
||||||
@@ -103,9 +103,9 @@ export default {
|
|||||||
isShow: [
|
isShow: [
|
||||||
{ required: true, message: '是否显示:1显示 0不显示不能为空', trigger: 'blur' }
|
{ required: true, message: '是否显示:1显示 0不显示不能为空', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
productList:[],
|
productList: [],
|
||||||
productClick:false
|
productClick: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -113,10 +113,10 @@ export default {
|
|||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
addProductClick(data){
|
addProduct(data) {
|
||||||
this.productClick = true;
|
this.productClick = true
|
||||||
addProduct(data).then(res=>{
|
addProduct(data).then(res => {
|
||||||
this.productList=res;
|
this.productList = res
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,267 +1,147 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!--工具栏-->
|
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<div v-if="crud.props.searchToggle">
|
<el-row :gutter="20">
|
||||||
<!-- 搜索 -->
|
<el-col :span="3">
|
||||||
<label class="el-form-item-label">id</label>
|
<el-input
|
||||||
<el-input v-model="query.id" clearable placeholder="id" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
v-model="query.blurry"
|
||||||
<label class="el-form-item-label">店铺id</label>
|
size="small"
|
||||||
<el-input v-model="query.shopId" clearable placeholder="店铺id" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
clearable
|
||||||
<label class="el-form-item-label">商品名称</label>
|
placeholder="请输入商品名称"
|
||||||
<el-input v-model="query.name" clearable placeholder="商品名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
style="width: 100%;"
|
||||||
<label class="el-form-item-label">包装费</label>
|
class="filter-item"
|
||||||
<el-input v-model="query.packFee" clearable placeholder="包装费" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
@keyup.enter.native="toQuery"
|
||||||
<label class="el-form-item-label">商品最低价</label>
|
/>
|
||||||
<el-input v-model="query.lowPrice" clearable placeholder="商品最低价" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
</el-col>
|
||||||
<label class="el-form-item-label">单位Id</label>
|
<el-col :span="3">
|
||||||
<el-input v-model="query.unitId" clearable placeholder="单位Id" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
<el-select v-model="query.class" placeholder="请选择商品分类" style="width: 100%;">
|
||||||
<label class="el-form-item-label">商品封面图</label>
|
<el-option label="饮品" :value="1" />
|
||||||
<el-input v-model="query.coverImg" clearable placeholder="商品封面图" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
<el-option label="烤串" :value="2" />
|
||||||
<label class="el-form-item-label">商品规格</label>
|
</el-select>
|
||||||
<el-input v-model="query.specId" clearable placeholder="商品规格" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
</el-col>
|
||||||
<label class="el-form-item-label">品牌Id</label>
|
<el-col :span="3">
|
||||||
<el-input v-model="query.brandId" clearable placeholder="品牌Id" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
<el-select v-model="query.sku" placeholder="请选择商品规格" style="width: 100%;">
|
||||||
<label class="el-form-item-label">商品图片(第一张为缩略图,其他为详情)</label>
|
<el-option label="饮品" :value="1" />
|
||||||
<el-input v-model="query.images" clearable placeholder="商品图片(第一张为缩略图,其他为详情)" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
<el-option label="烤串" :value="2" />
|
||||||
<label class="el-form-item-label">视频封面图</label>
|
</el-select>
|
||||||
<el-input v-model="query.videoCoverImg" clearable placeholder="视频封面图" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
</el-col>
|
||||||
<label class="el-form-item-label">商品状态</label>
|
<el-col :span="6">
|
||||||
<el-input v-model="query.status" clearable placeholder="商品状态" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
<el-button type="primary" @click="toQuery">查询</el-button>
|
||||||
<label class="el-form-item-label">是否回收站 </label>
|
<el-button @click="resetHandle">重置</el-button>
|
||||||
<el-input v-model="query.isDel" clearable placeholder="是否回收站 " style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
</el-col>
|
||||||
<label class="el-form-item-label">是否免邮</label>
|
</el-row>
|
||||||
<el-input v-model="query.isFreeFreight" clearable placeholder="是否免邮" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
</div>
|
||||||
<label class="el-form-item-label">是否删除</label>
|
<div class="head-container">
|
||||||
<el-input v-model="query.isDelete" clearable placeholder="是否删除" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
<el-row>
|
||||||
<label class="el-form-item-label">基础出售数量</label>
|
<el-col>
|
||||||
<el-input v-model="query.baseSalesNumber" clearable placeholder="基础出售数量" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
<el-button type="primary" icon="el-icon-plus">添加商品</el-button>
|
||||||
<label class="el-form-item-label">实际销量</label>
|
</el-col>
|
||||||
<el-input v-model="query.realSalesNumber" clearable placeholder="实际销量" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
</el-row>
|
||||||
<label class="el-form-item-label">合计销量</label>
|
</div>
|
||||||
<el-input v-model="query.salesNumber" clearable placeholder="合计销量" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
<div class="head-container">
|
||||||
<label class="el-form-item-label">点赞次数</label>
|
<el-table :data="tableData.data">
|
||||||
<el-input v-model="query.thumbCount" clearable placeholder="点赞次数" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
<el-table-column label="商品信息">
|
||||||
<label class="el-form-item-label">收藏次数</label>
|
<template v-slot="scope">
|
||||||
<el-input v-model="query.storeCount" clearable placeholder="收藏次数" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
<div class="shop_info">
|
||||||
<label class="el-form-item-label">支持堂食</label>
|
<el-image
|
||||||
<el-input v-model="query.furnishMeal" clearable placeholder="支持堂食" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
:src="scope.row.coverImg"
|
||||||
<label class="el-form-item-label">支持配送</label>
|
style="width: 50px;height: 50px;border-radius: 4px;background-color: #efefef;"
|
||||||
<el-input v-model="query.furnishExpress" clearable placeholder="支持配送" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
/>
|
||||||
<rrOperation :crud="crud" />
|
<div class="info">
|
||||||
</div>
|
<span>{{ scope.row.name }}</span>
|
||||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
</div>
|
||||||
<crudOperation :permission="permission" />
|
</div>
|
||||||
<!--表单组件-->
|
|
||||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
|
||||||
<el-form-item label="id" prop="id">
|
|
||||||
<el-input v-model="form.id" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="店铺id">
|
|
||||||
<el-input v-model="form.shopId" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="商品名称">
|
|
||||||
<el-input v-model="form.name" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="包装费">
|
|
||||||
<el-input v-model="form.packFee" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="商品最低价" prop="lowPrice">
|
|
||||||
<el-input v-model="form.lowPrice" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="单位Id">
|
|
||||||
<el-input v-model="form.unitId" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="商品封面图">
|
|
||||||
<el-input v-model="form.coverImg" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="商品规格">
|
|
||||||
<el-input v-model="form.specId" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="品牌Id">
|
|
||||||
<el-input v-model="form.brandId" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="商品图片(第一张为缩略图,其他为详情)">
|
|
||||||
<el-input v-model="form.images" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="视频封面图">
|
|
||||||
<el-input v-model="form.videoCoverImg" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="商品状态" prop="status">
|
|
||||||
<el-input v-model="form.status" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否回收站" prop="isDel">
|
|
||||||
<el-input v-model="form.isDel" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否免邮" prop="isFreeFreight">
|
|
||||||
<el-input v-model="form.isFreeFreight" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否删除" prop="isDelete">
|
|
||||||
<el-input v-model="form.isDelete" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="基础出售数量">
|
|
||||||
<el-input v-model="form.baseSalesNumber" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="实际销量">
|
|
||||||
<el-input v-model="form.realSalesNumber" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="合计销量">
|
|
||||||
<el-input v-model="form.salesNumber" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="点赞次数">
|
|
||||||
<el-input v-model="form.thumbCount" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="收藏次数">
|
|
||||||
<el-input v-model="form.storeCount" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="支持堂食">
|
|
||||||
<el-input v-model="form.furnishMeal" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="支持配送">
|
|
||||||
<el-input v-model="form.furnishExpress" style="width: 370px;" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
|
||||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
<!--表格渲染-->
|
|
||||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
|
||||||
<el-table-column type="selection" width="55" />
|
|
||||||
<el-table-column prop="id" label="id" />
|
|
||||||
<el-table-column prop="shopId" label="店铺id" />
|
|
||||||
<el-table-column prop="name" label="商品名称" />
|
|
||||||
<el-table-column prop="packFee" label="包装费" />
|
|
||||||
<el-table-column prop="lowPrice" label="商品最低价" />
|
|
||||||
<el-table-column prop="unitId" label="单位Id" />
|
|
||||||
<el-table-column prop="coverImg" label="商品封面图" />
|
|
||||||
<el-table-column prop="specId" label="商品规格" />
|
|
||||||
<el-table-column prop="brandId" label="品牌Id" />
|
|
||||||
<el-table-column prop="images" label="商品图片(第一张为缩略图,其他为详情)" />
|
|
||||||
<el-table-column prop="videoCoverImg" label="视频封面图" />
|
|
||||||
<el-table-column prop="status" label="商品状态">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ dict.label.product_status[scope.row.status] }}
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="isDel" label="是否回收站">
|
<el-table-column label="售价">
|
||||||
<template slot-scope="scope">
|
<template v-slot="scope">
|
||||||
{{ dict.label.product_is_del[scope.row.isDel] }}
|
<span>¥{{ scope.row.lowPrice }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="isFreeFreight" label="是否免邮">
|
<el-table-column label="销量/库存">
|
||||||
<template slot-scope="scope">
|
<template v-slot="scope">
|
||||||
{{ dict.label.product_is_free_freight[scope.row.isFreeFreight] }}
|
<span>{{ scope.row.xl }}/{{ scope.row.kc }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="isDelete" label="是否删除">
|
<el-table-column label="上架区域" prop="area" />
|
||||||
<template slot-scope="scope">
|
<el-table-column label="排序" prop="sort" sortable />
|
||||||
{{ dict.label.product_is_delete[scope.row.isDelete] }}
|
<el-table-column label="更新时间" prop="update" />
|
||||||
</template>
|
<el-table-column label="操作" width="200">
|
||||||
</el-table-column>
|
<template v-slot="scope">
|
||||||
<el-table-column prop="baseSalesNumber" label="基础出售数量" />
|
<el-button type="primary" size="mini" round icon="el-icon-edit">编辑</el-button>
|
||||||
<el-table-column prop="realSalesNumber" label="实际销量" />
|
<el-button type="danger" size="mini" round icon="el-icon-delete">删除</el-button>
|
||||||
<el-table-column prop="salesNumber" label="合计销量" />
|
|
||||||
<el-table-column prop="thumbCount" label="点赞次数" />
|
|
||||||
<el-table-column prop="storeCount" label="收藏次数" />
|
|
||||||
<el-table-column prop="furnishMeal" label="支持堂食" />
|
|
||||||
<el-table-column prop="furnishExpress" label="支持配送" />
|
|
||||||
<el-table-column v-if="checkPer(['admin','tbProduct:edit','tbProduct:del'])" label="操作" width="150px" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<udOperation
|
|
||||||
:data="scope.row"
|
|
||||||
:permission="permission"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
|
||||||
<pagination />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import crudTbProduct from '@/api/tbProduct'
|
import { tbProduct } from '@/api/shop'
|
||||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
|
||||||
import rrOperation from '@crud/RR.operation'
|
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
|
||||||
import udOperation from '@crud/UD.operation'
|
|
||||||
import pagination from '@crud/Pagination'
|
|
||||||
|
|
||||||
const defaultForm = { id: null, sourcePath: null, merchantId: null, shopId: null, name: null, type: null, packFee: null, lowPrice: null, unitId: null, coverImg: null, categoryId: null, specId: null, brandId: null, shortTitle: null, lowMemberPrice: null, unitSnap: null, shareImg: null, images: null, video: null, videoCoverImg: null, sort: null, limitNumber: null, productScore: null, status: null, failMsg: null, isRecommend: null, isHot: null, isNew: null, isOnSale: null, isShow: null, typeEnum: null, isDistribute: null, isDel: null, isStock: null, isPauseSale: null, isFreeFreight: null, freightId: null, strategyType: null, strategyId: null, isVip: null, isDelete: null, notice: null, createdAt: null, updatedAt: null, baseSalesNumber: null, realSalesNumber: null, salesNumber: null, thumbCount: null, storeCount: null, furnishMeal: null, furnishExpress: null, furnishDraw: null, furnishVir: null, isCombo: null, groupSnap: null, isShowCash: null, isShowMall: null, isNeedExamine: null, showOnMallStatus: null, showOnMallTime: null, showOnMallErrorMsg: null, enableLabel: null, taxConfigId: null }
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TbProduct',
|
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
|
||||||
dicts: ['product_status', 'product_is_del', 'product_is_free_freight', 'product_is_delete'],
|
|
||||||
cruds() {
|
|
||||||
return CRUD({ title: '/product', url: 'api/tbProduct', idField: 'id', sort: 'id,desc', crudMethod: { ...crudTbProduct }})
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
permission: {
|
query: {
|
||||||
add: ['admin', 'tbProduct:add'],
|
blurry: '',
|
||||||
edit: ['admin', 'tbProduct:edit'],
|
class: '',
|
||||||
del: ['admin', 'tbProduct:del']
|
sku: ''
|
||||||
},
|
},
|
||||||
rules: {
|
tableData: {
|
||||||
id: [
|
data: [
|
||||||
{ required: true, message: 'id不能为空', trigger: 'blur' }
|
{
|
||||||
|
url: 'https://cash-register.oss-cn-beijing.aliyuncs.com/shop/f12c3cc097e147daa33ac4b55aca8ef3/2023-08-21/20230821-110556-2425668054.png?x-oss-process=image/resize,w_50,h_50,m_fill',
|
||||||
|
title: '套餐商品',
|
||||||
|
class: '烤串',
|
||||||
|
price: 2,
|
||||||
|
xl: 0,
|
||||||
|
kc: 0,
|
||||||
|
area: '收银端',
|
||||||
|
sort: 0,
|
||||||
|
update: '2023-11-20 16:08'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
lowPrice: [
|
page: 0,
|
||||||
{ required: true, message: '商品最低价不能为空', trigger: 'blur' }
|
size: 10,
|
||||||
],
|
loading: false
|
||||||
status: [
|
}
|
||||||
{ required: true, message: '商品状态', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
isDel: [
|
|
||||||
{ required: true, message: '是否回收站 0-否,1回收站不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
isFreeFreight: [
|
|
||||||
{ required: true, message: '是否免邮1-是 0-否不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
isDelete: [
|
|
||||||
{ required: true, message: '是否删除不能为空', trigger: 'blur' }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
queryTypeOptions: [
|
|
||||||
{ key: 'id', display_name: 'id' },
|
|
||||||
{ key: 'shopId', display_name: '店铺id' },
|
|
||||||
{ key: 'name', display_name: '商品名称' },
|
|
||||||
{ key: 'packFee', display_name: '包装费' },
|
|
||||||
{ key: 'lowPrice', display_name: '商品最低价' },
|
|
||||||
{ key: 'unitId', display_name: '单位Id' },
|
|
||||||
{ key: 'coverImg', display_name: '商品封面图' },
|
|
||||||
{ key: 'specId', display_name: '商品规格' },
|
|
||||||
{ key: 'brandId', display_name: '品牌Id' },
|
|
||||||
{ key: 'images', display_name: '商品图片(第一张为缩略图,其他为详情)' },
|
|
||||||
{ key: 'videoCoverImg', display_name: '视频封面图' },
|
|
||||||
{ key: 'status', display_name: '0--待审核 1审核通过 -1审核失败 -2违规下架' },
|
|
||||||
{ key: 'isDel', display_name: '是否回收站 0-否,1回收站' },
|
|
||||||
{ key: 'isFreeFreight', display_name: '是否免邮1-是 0-否' },
|
|
||||||
{ key: 'isDelete', display_name: '是否删除' },
|
|
||||||
{ key: 'baseSalesNumber', display_name: '基础出售数量' },
|
|
||||||
{ key: 'realSalesNumber', display_name: '实际销量' },
|
|
||||||
{ key: 'salesNumber', display_name: '合计销量' },
|
|
||||||
{ key: 'thumbCount', display_name: '点赞次数' },
|
|
||||||
{ key: 'storeCount', display_name: '收藏次数' },
|
|
||||||
{ key: 'furnishMeal', display_name: '支持堂食' },
|
|
||||||
{ key: 'furnishExpress', display_name: '支持配送' }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.tbProduct()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
// 查询
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
toQuery() {
|
||||||
return true
|
|
||||||
|
},
|
||||||
|
// 重置查询
|
||||||
|
resetHandle() {
|
||||||
|
this.query.blurry = ''
|
||||||
|
this.query.class = ''
|
||||||
|
this.query.sku = ''
|
||||||
|
},
|
||||||
|
// 获取商品列表
|
||||||
|
async tbProduct() {
|
||||||
|
try {
|
||||||
|
const res = await tbProduct({
|
||||||
|
page: this.tableData.page,
|
||||||
|
size: this.tableData.size
|
||||||
|
})
|
||||||
|
this.tableData.data = res.content
|
||||||
|
} catch (error) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="scss">
|
||||||
|
.shop_info {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.info {
|
||||||
|
flex: 1;
|
||||||
|
padding-left: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module.exports = {
|
|||||||
publicPath: '/',
|
publicPath: '/',
|
||||||
outputDir: 'dist',
|
outputDir: 'dist',
|
||||||
assetsDir: 'static',
|
assetsDir: 'static',
|
||||||
lintOnSave: process.env.NODE_ENV === 'production',
|
lintOnSave: false,
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
devServer: {
|
devServer: {
|
||||||
port: port,
|
port: port,
|
||||||
@@ -108,7 +108,7 @@ module.exports = {
|
|||||||
.plugin('ScriptExtHtmlWebpackPlugin')
|
.plugin('ScriptExtHtmlWebpackPlugin')
|
||||||
.after('html')
|
.after('html')
|
||||||
.use('script-ext-html-webpack-plugin', [{
|
.use('script-ext-html-webpack-plugin', [{
|
||||||
// `runtime` must same as runtimeChunk name. default is `runtime`
|
// `runtime` must same as runtimeChunk name. default is `runtime`
|
||||||
inline: /runtime\..*\.js$/
|
inline: /runtime\..*\.js$/
|
||||||
}])
|
}])
|
||||||
.end()
|
.end()
|
||||||
|
|||||||
Reference in New Issue
Block a user