积分商品

This commit is contained in:
DESKTOP-369JRHT\12997 2023-11-06 17:52:12 +08:00
parent c44c43d9bb
commit 092ce688cc
10 changed files with 606 additions and 446 deletions

View File

@ -1,6 +1,6 @@
import request from "@/utils/request";
// 查询油罐列表
// 查询积分分类
export function getGiftCategoryApi(data) {
return request({
url: 'business/integral/integralGiftCategory/queryByPage',

View File

@ -1,25 +1,25 @@
import request from "@/utils/request";
// 查询油罐列表
export function getGiftCategoryApi(data) {
export function getGiftApi(data) {
return request({
url: 'business/integral/integralGiftCategory/queryByPage',
url: 'business/integral/integralGift/queryByPage',
method: 'get',
params: data
})
}
// 新增有关信息
export function insertGiftCategoryApi(data) {
export function insertGiftApi(data) {
return request({
url: 'business/integral/integralGiftCategory',
url: 'business/integral/integralGift',
method: 'post',
data: data
})
}
// 修改有关信息
export function updateGiftCategoryApi(data) {
export function updateGiftApi(data) {
return request({
url: 'business/integral/integralGiftCategory',
url: 'business/integral/integralGift',
method: 'put',
data: data
})

View File

@ -1,8 +0,0 @@
Vue.component('button-counter', {
data: function () {
return {
count: 0
}
},
template: '<button v-on:click="count++">You clicked me {{ count }} times.</button>'
})

View File

@ -1,10 +1,10 @@
<template>
<div class="app-container">
<el-card >
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="分类名称" prop="categoryName">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="礼品名称" prop="giftName">
<el-input
v-model="queryParams.categoryName"
v-model="queryParams.giftName"
placeholder="请输入供应商名称"
clearable
style="width: 240px;"
@ -26,7 +26,7 @@
<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-form>
</el-card>
<el-card style="margin-top: 20px" >
@ -44,24 +44,63 @@
v-loading="loading"
:data="dataList"
:default-sort="defaultSort">
<el-table-column label="分类" align="center" prop="categoryId" width="50px"/>
<el-table-column label="分类" align="center" prop="categoryName" width="50px"/>
<el-table-column label="礼品信息" align="center">
<el-table-column label="名称" align="center" prop="giftName"/>
<el-table-column label="封面图" align="center" prop="coverImage"/>
<el-table-column label="封面图" align="center" prop="coverImage">
<template slot-scope="scope">
<el-image
style="width: 50px; height: 50px"
:src="imagePath+scope.row.coverImage"
:preview-src-list="[imagePath + scope.row.coverImage]"
fit="cover">
</el-image>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="兑换信息" align="center">
<el-table-column label="兑换方式" align="center" prop="sort65"/>
<el-table-column label="兑换方式" align="center" prop="sort67"/>
<el-table-column label="兑换方式" align="center" prop="exchangeMethod">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<el-tag v-if ="scope.row.exchangeMethod == '积分'" effect="plain" size="medium">积分</el-tag>
<el-tag v-if ="scope.row.exchangeMethod == '金额'" effect="plain" type="success" size="medium">金额</el-tag>
<el-tag v-if ="scope.row.exchangeMethod == '积分+金额'" effect="plain" type="danger" size="medium">积分+金额</el-tag>
<el-tag v-if ="scope.row.exchangeMethod == '积分+加钱购'" effect="plain" type="warning" size="medium">积分+加钱购</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="兑换方式" align="center" prop="">
<template slot-scope="scope">
<span v-if ="scope.row.exchangeMethod == '积分'" effect="plain" size="medium">{{scope.row.exchangePoints}}积分</span>
<span v-if ="scope.row.exchangeMethod == '金额'" effect="plain" type="success" size="medium">{{scope.row.exchangeAmount}}</span>
<span v-if ="scope.row.exchangeMethod == '积分+金额'" effect="plain" type="danger" size="medium">{{scope.row.exchangePoints}}积分+{{scope.row.exchangeAmount}}</span>
<span v-if ="scope.row.exchangeMethod == '积分+加钱购'" effect="plain" type="warning" size="medium">{{scope.row.exchangePoints}}积分+加钱购比例{{ moneyRatio }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="配送类型" align="center">
<el-table-column label="配送方式" align="center" prop="sort56"/>
<el-table-column label="快递费用" align="center" prop="sort55"/>
<el-table-column label="配送方式" align="center" prop="deliveryMethod"/>
<el-table-column label="快递费用" align="center" prop="shippingFeeAmount">
<template slot-scope="scope">
<span v-if ="scope.row.exchangeMethod!= null && !scope.row.exchangeMethod.includes('物流配送')">--</span>
<span v-else effect="plain" type="warning" size="medium">{{scope.row.shippingFeeAmount}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="礼品类型" align="center" prop="giftType" />
<el-table-column label="礼品库存信息" align="center">
<el-table-column label="总库存" align="center" prop="sort23"/>
<el-table-column label="已用" align="center" prop="sort12"/>
<el-table-column label="可用" align="center" prop="categoryName2"/>
<el-table-column label="总库存" align="center" prop="totalInventory" >
<template slot-scope="scope">
<el-button type="text" @click="clickInventory(scope.row)">{{ scope.row.totalInventory }}</el-button>
</template>
</el-table-column>
<el-table-column label="已用" align="center" prop="">
<template slot-scope="scope">
<span>{{ scope.row.totalInventory-scope.row.remainingInventory }}</span>
</template>
</el-table-column>
<el-table-column label="可用" align="center" prop="remainingInventory"/>
</el-table-column>
<el-table-column label="排序" align="center" prop="sort" />
<el-table-column label="状态" align="center" prop="status">
@ -72,7 +111,9 @@
</div>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime"/>
<el-table-column label="创建时间" align="center" prop="createTime">
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -116,7 +157,7 @@
</el-row>
<el-row :gutter="24">
<el-col :span="6">
<el-form-item label="封面图" >
<el-form-item label="封面图" prop="coverImage">
<el-upload
:action="uploadAction"
list-type="picture-card"
@ -140,7 +181,7 @@
<el-upload
:action="uploadAction"
list-type="picture-card"
:file-list="dataForm.giftImages"
:file-list="giftImages"
:headers="uploadHeader"
:auto-upload="true"
:on-preview="handlePictureCardPreview"
@ -176,7 +217,7 @@
<el-col>
<el-col :span="20">
<el-form-item label="礼品类型" prop="giftType">
<el-radio-group v-model="dataForm.giftType" @change="changeGiftType">
<el-radio-group v-model="dataForm.giftType" @change="changeGiftType($event)">
<el-radio
v-for="dict in dict.type.lplx"
:key="dict.value"
@ -192,13 +233,13 @@
<el-row :gutter="24">
<el-col :span="8">
<el-form-item v-if="showList.coupon" label="优惠" prop="couponId">
<el-form-item v-if="showList.coupon" label="优惠" prop="couponId">
<el-select v-model="dataForm.couponId" placeholder="请选择" style="width: 202px;">
<el-option
v-for="dict in dict.type.lplx"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="option in giftCategoryList"
:key="option.id"
:label="option.categoryName"
:value="option.id"
></el-option>
</el-select>
</el-form-item>
@ -206,24 +247,29 @@
<el-form-item v-if="showList.voucher" label="兑换券" prop="voucherId">
<el-select v-model="dataForm.voucherId" placeholder="请选择" style="width: 202px;">
<el-option
v-for="dict in dict.type.lplx"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="option in giftCategoryList"
:key="option.id"
:label="option.categoryName"
:value="option.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="showList.goods" label="关联商品" prop="goodsId">
<el-input v-model="dataForm.goodsName" placeholder="" maxlength="30" style="width: 202px;" @focus="getCommodity"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="礼品数量" prop="supplierName" style="width: 202px;">
<el-form-item label="礼品数量" prop="giftQuantity" style="width: 202px;">
<el-input-number v-model="dataForm.giftQuantity" controls-position="right" :min="1" :max="10" label=""></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="市场价格" prop="supplierName">
<el-input v-model="dataForm.sort" placeholder="请输入市场价格" maxlength="30" style="width: 202px;">
<el-form-item label="市场价格" prop="market">
<el-input v-model="dataForm.market" placeholder="请输入市场价格" maxlength="30" style="width: 202px;">
<template slot="append"></template></el-input>
</el-form-item>
</el-col>
@ -237,8 +283,8 @@
<el-row>
<el-col>
<el-col :span="20">
<el-form-item label="兑换方式" prop="status">
<el-radio-group v-model="dataForm.exchangeMethod">
<el-form-item label="兑换方式" prop="exchangeMethod">
<el-radio-group v-model="dataForm.exchangeMethod" @change="changeExchange($event)">
<el-radio
v-for="dict in dict.type.redemptionMethod"
:key="dict.value"
@ -252,16 +298,23 @@
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="兑换积分" prop="exchangePoints">
<el-input v-model="dataForm.exchangePoints" placeholder="分类名称" maxlength="30" style="width: 202px;">
<el-col v-if="showList.jf" :span="8">
<el-form-item v-show="showList.jf" label="兑换积分" prop="exchangePoints">
<el-input v-model="dataForm.exchangePoints" placeholder="" maxlength="30" style="width: 202px;">
<template slot="append">积分</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="7">
<el-col v-if="showList.je" :span="8">
<el-form-item label="兑换金额" prop="exchangeAmount">
<el-input v-model="dataForm.exchangeAmount" placeholder="" maxlength="30" style="width: 202px;">
<template slot="append">积分</template>
</el-input>
</el-form-item>
</el-col>
<el-col v-if="showList.jfjq" :span="7">
<el-form-item label="加钱比例" prop="moneyRatio" >
<el-input v-model="dataForm.moneyRatio" placeholder="分类名称" maxlength="30" style="width: 202px;">
<el-input v-model="dataForm.moneyRatio" placeholder="" maxlength="30" style="width: 202px;">
<template slot="prepend">1积分=</template>
<template slot="append"></template>
</el-input>
@ -271,16 +324,22 @@
<el-row :gutter="24">
<el-row :gutter="24" v-if="showList.delivery">
<!-- <el-col :span="8">
<el-form-item label="配送方式" prop="deliveryMethod">
<el-checkbox v-for="item in dict.type.shippingMethod" :key="item.value" v-model="dataForm.deliveryMethod" :label="item.id">{{ item.label }}</el-checkbox>
</el-form-item>
</el-col> -->
<el-col :span="8">
<el-form-item label="配送方式" prop="exchangeTimes">
<el-checkbox v-for="item in dict.type.shippingMethod" :key="item.value" v-model="moneyRatio" :label="item.id">{{ item.label }}</el-checkbox>
<el-form-item label="配送方式" prop="deliveryMethod">
<el-checkbox v-for="item in dict.type.shippingMethod" :key="item.value" :label="item.label" :checked="dataForm.deliveryMethod != null?dataForm.deliveryMethod.includes(item.label):''" @change="changeExpress(item.label,1)">{{ item.label }}</el-checkbox>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="快递运费" prop="status">
<el-radio-group v-model="dataForm.expressShippingFee">
<el-col v-if="showList.express" :span="7">
<el-form-item label="快递运费" prop="expressShippingFee">
<el-radio-group v-model="dataForm.expressShippingFee" @change="changeExpress($event,2)">
<el-radio
v-for="dict in dict.type.expressShippingCosts"
:key="dict.value"
@ -291,9 +350,9 @@
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="运费金额" prop="status">
<el-input v-model="dataForm.exchangePoints" placeholder="分类名称" maxlength="30" style="width: 202px;">
<el-col v-if="showList.shippingFee" :span="7">
<el-form-item label="运费金额" prop="shippingFeeAmount">
<el-input v-model="dataForm.shippingFeeAmount" placeholder="" maxlength="30" style="width: 202px;" >
<template slot="append"></template>
</el-input>
</el-form-item>
@ -304,7 +363,7 @@
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="兑换次数" prop="exchangeTimes">
<el-input v-model="dataForm.exchangeTimes" placeholder="分类名称" maxlength="30" style="width: 202px;">
<el-input v-model="dataForm.exchangeTimes" placeholder="" maxlength="30" style="width: 202px;">
<template slot="append"></template>
</el-input>
</el-form-item>
@ -339,8 +398,7 @@
<el-row :gutter="24">
<el-col :span="23">
<el-form-item label="图文详情" prop="detailedDescription">
<!-- <element-tiptap v-model="content" :extensions="extensions" :editor="editor" /> -->
<editor></editor>
<editor @input="handleChildValue" :value.default="dataForm.detailedDescription" :height.default="150"></editor>
</el-form-item>
</el-col>
</el-row>
@ -350,15 +408,97 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
<!-- 打开商品界面 -->
<el-dialog title="选择商品" :visible.sync="openCommodity" width="1000px" append-to-body :close-on-click-modal="false">
<el-container>
<el-header style="">
<el-form ref="tankForm" :model="commodityForm" label-width="80px">
<el-row :gutter="24">
<el-col :span="6">
<el-form-item label="商品分类">
<el-select
v-model="commodityForm.cvsGoodId"
placeholder="全部"
clearable
>
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="供应商" prop="supplierId">
<el-select
v-model="commodityForm.supplierId"
placeholder="全部"
clearable
>
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="详细信息">
<el-input v-model="commodityForm.remark" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-button type="primary" @click="inquire()">查询</el-button>
</el-col>
</el-row>
</el-form>
</el-header>
<el-main>
<el-table
ref="tables"
v-loading="loading"
:data="commodityList"
@row-click="handleRowClick"
border
:default-sort="defaultSort"
>
<el-table-column type="index" label="序号"></el-table-column>
<!-- <el-table-column type="selection" width="55"></el-table-column> -->
<el-table-column label="商品名称" align="center" prop="name"/>
<el-table-column label="商品编码" align="center" prop="goodsNo"/>
<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="supplierId" align="center">
<template slot-scope="scope">
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="当前库存" align="center" prop="stock"/>
</el-table>
</el-main>
</el-container>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addCommodity"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog title="库存变更" :visible.sync="openInventory" width="1000px" append-to-body :close-on-click-modal="false">
</el-dialog>
</div>
</template>
<script>
import {getGiftCategoryApi} from "@/api/integral/category";
import {getGiftApi,insertGiftApi,updateGiftApi } from "@/api/integral/gift";
import { editor } from '@/components/Editor/index'
import { getToken } from '@/utils/auth'
import {listLJGoods} from "@/api/convenienceStore/ljgoods";
export default {
@ -373,9 +513,12 @@ export default {
id: null,
giftName: '', //
categoryId:'', // id
goodsId:'', // Id
goodsName:'', // Id
voucherId:'', // id
coverImage:'', //
giftImages: [], //
giftType:"优惠卷", //
giftType:"优惠", //
couponId:'',//
giftQuantity:'', //
totalInventory:'', //
@ -383,21 +526,33 @@ export default {
exchangePoints:'', //
exchangeTimes:'', //
moneyRatio:'', //
deliveryMethod:'', //
expressShippingFee:'', //
shippingFeeAmount:'', //
exchangeamount:'', //
deliveryMethod:['门店自提'], //
detailedDescription:'', //
categoryName: 1,
sort: null,
status: '启用'
status: '启用',
market:null
},
showList: {
//
coupon: 'true',
voucher: 'false',
goods: 'false',
coupon: true,
voucher: false,
goods: false,
//
jf:true,
je:false,
jfje:false,
jfjq:false,
//
delivery:false,
express: false,
shippingFee: false
},
getGiftTypeShow: '',
//
title:'',
@ -405,12 +560,13 @@ export default {
showSearch: true,
disableInput: false, //
//
open: false,
//
open: false,
openCommodity: false,
total: 0,
//
queryParams: {
categoryName: 1,
giftName: '',
status: '',
page:null,
pageSize:null
@ -420,13 +576,13 @@ export default {
loading: false,
//
defaultSort: {prop: 'createTime', order: 'descending'},
rules: {},
/**
* 表单
*/
giftCategoryList: [], //
//
giftImages: [],
//
uploadAction: process.env.VUE_APP_SERVER_URL + 'backendApi/file/upload',
uploadHeader: { 'Access-Token' : getToken() },
@ -440,10 +596,86 @@ export default {
//
imagePath: process.env.VUE_APP_SERVER_URL,
dialogImageUrl: "",
dialogVisible: false
dialogVisible: false,
rules: {
giftName: [
{ required: true, message: "礼品名称不能为空", trigger: "blur" },
],
coverImage: [
{ required: true, message: "封面不能为空", trigger: "blur" },
],
giftType: [
{ required: true, message: "礼品类型不能为空", trigger: "change" },
],
couponId: [
{ required: true, message: "请选择优惠券", trigger: "blur" },
],
voucherId: [
{ required: true, message: "请选择兑换券", trigger: "blur" },
],
goodsId: [
{ required: true, message: "请选择关联商品", trigger: "blur" },
],
giftQuantity: [
{ required: true, message: "礼品数量不能为空", trigger: "blur" },
],
totalInventory: [
{ required: true, message: "礼品库存不能为空", trigger: "blur" },
],
exchangeMethod: [
{ required: true, message: "兑换方式不能为空", trigger: "blur" },
],
exchangePoints: [
{ required: true, message: "兑换积分不能为空", trigger: "blur" },
],
exchangeAmount: [
{ required: true, message: "兑换金额不能为空", trigger: "blur" },
],
moneyRatio: [
{ required: true, message: "加钱比例不能为空", trigger: "blur" },
],
expressShippingFee: [
{ required: true, message: "快递运费不能为空", trigger: "change" },
],
shippingFeeAmount: [
{ required: true, message: "运费金额不能为空", trigger: "blur" },
],
exchangeTimes: [
{ required: true, message: "兑换次数不能为空", trigger: "change" },
],
sort: [
{ required: true, message: "礼品排序不能为空", trigger: "blur" },
],
status: [
{ required: true, message: "请选择礼品状态", trigger: "change" },
]
},
commodityList: [],
commodityForm:{
cvsGoodId: "",
cvsGood: "",
supplierId: "",
supplier: "",
detailed: "",
remark: "",
page: 1,
pageSize: 10,
isRecovery:0,
},
//
cvsGoodList:[],
//
supplierList:[],
}
},
watch: {
getGiftTypeShow: function(newVal) {
}
},
@ -452,25 +684,38 @@ export default {
},
methods: {
getList() {
getGiftApi(this.queryParams).then(res=>{
this.dataList = res.data.records
})
},
submitForm: function() {
console.log("dataForm",this.dataForm)
console.log("dialogImageUrl",this.dialogImageUrl)
this.$refs["form"].validate(valid => {
console.log("dialogImageUrl",this.giftImages)
let this_ = this
if (Array.isArray(this_.giftImages)) {
this_.dataForm.giftImages = JSON.stringify(this_.giftImages);
}
if (this_.dataForm.deliveryMethod != null && Array.isArray(this_.dataForm.deliveryMethod)) {
this_.dataForm.deliveryMethod = JSON.stringify(thithis_s.dataForm.deliveryMethod);
}
this_.dataForm.remainingInventory = this_.dataForm.totalInventory
this_.$refs["form"].validate(valid => {
if (valid) {
if (this.dataForm.id == null) {
if (this_.dataForm.id == null) {
//
// insertGiftCategoryApi(this.dataForm).then(res => {
// this.getList()
// this.open = false
// })
insertGiftApi(this_.dataForm).then(res => {
this_.getList(),
this_.open = false
})
} else {
// //
// updateGiftCategoryApi(this.dataForm).then(res => {
// this.getList()
// this.open = false
// })
//
updateGiftApi(this_.dataForm).then(res => {
this_.getList()
this_.open = false
})
}
}})
},
@ -478,12 +723,12 @@ export default {
//
giftAdd() {
// this.dataForm = {}
this.dataForm.status = '启用'
this.reset();
this.open = true
this.title = '添加分类'
this.title = '添加礼品'
this.selectGiftCategory();
},
//
cancel() {
@ -497,17 +742,71 @@ export default {
},
//
handleUpdate(data) {
this.dataForm = data
this.open = true
console.log("1111111111111")
let fileList = JSON.parse(data.giftImages);
this.giftImages = [],
this.giftImages = fileList;
console.log("22222222222222")
console.log( this.giftImages);
this.giftImages.forEach(image=>{
let sp = image.url.split('//')
image.url = this.imagePath + '/'+sp[2]
})
data.deliveryMethod = JSON.parse(data.deliveryMethod);
this.dataForm = data;
this.open = true;
this.getList();
},
resetQuery() {
resetQuery() {
this.queryParams= {
giftName: '',
status: '',
page:null,
pageSize:null
},
this.getList()
},
reset(){
this.dataForm={
id: null,
giftName: '', //
categoryId:'', // id
goodsId:'', // Id
voucherId:'', // id
coverImage:'', //
giftImages: [], //
giftType:"优惠券", //
couponId:'',//
giftQuantity:'', //
totalInventory:'', //
exchangeMethod:'积分', //
exchangePoints:'', //
exchangeTimes:'', //
moneyRatio:'', //
expressShippingFee:'', //
shippingFeeAmount:'', //
exchangeamount:'', //
deliveryMethod:['门店自提'], //
detailedDescription:'', //
categoryName: 1,
sort: null,
status: '启用',
market:null
}
},
clickInventory(data) {
alert("hello world")
},
/**
@ -539,9 +838,80 @@ export default {
})
},
//
changeGiftType() {
//
changeGiftType(newVal) {
let this_ = this
if (newVal == '优惠券') {
this_.showList.coupon = true
this_.showList.voucher = false
this_.showList.goods = false
this_.showList.delivery = false
} else if (newVal == '兑换券') {
this_.showList.coupon = false
this_.showList.voucher = true
this_.showList.goods = false
this_.showList.delivery = true
} else if(newVal == '实物商品') {
this_.showList.coupon = false
this_.showList.voucher = false
this_.showList.goods = true
this_.showList.delivery = true
}
},
//
changeExchange(newVal){
let this_ = this
if (newVal == '积分') {
this_.showList.jf = true
this_.showList.je = false
this_.showList.jfjq = false
} else if (newVal == '金额') {
this_.showList.jf = false
this_.showList.je = true
this_.showList.jfjq = false
} else if (newVal == '积分+金额') {
this_.showList.jf = true
this_.showList.je = true
this_.showList.jfjq = false
} else if (newVal == '积分+加钱购') {
this_.showList.jf = true
this_.showList.je = false
this_.showList.jfjq = true
}
},
//
changeExpress(data,flag){
let this_ = this
// express: false,
console.log("data",data)
// shippingFee: false
if(flag === 1) {
if (!this.dataForm.deliveryMethod) {
this.dataForm.deliveryMethod = [];
this.showList.express= false
}
const index = this.dataForm.deliveryMethod.indexOf(data);
if (index === -1) {
this.dataForm.deliveryMethod.push(data);
if(data == '物流配送') {
this.showList.express= true
}
} else {
this.dataForm.deliveryMethod.splice(index, 1);
if(data == '物流配送') {
this.showList.express= false
}
}
console.log("data",this.dataForm.deliveryMethod)
} else {
if (data == '包邮') {
this.showList.shippingFee= false
} else if (data == '统一运费') {
this.showList.shippingFee= true
}
}
},
//
handleIsopenSelect() {
// this.$forceUpdate()
@ -559,21 +929,21 @@ export default {
url: process.env.VUE_APP_SERVER_URL + file.data.fileName,
type: file.data.type
};
console.log("giftImages",this.dataForm.giftImages)
if (this.dataForm.giftImages == undefined) {
this.dataForm.giftImages = [];
console.log("giftImages",this.giftImages)
if (this.giftImages == undefined) {
this.giftImages = [];
}
this.dataForm.giftImages.push(newImage);
this.giftImages.push(newImage);
},
handleRemove(file, fileList) {
console.log("file.response.data.fileName",file);
this.dataForm.giftImages.forEach((image, index) => {
this.giftImages.forEach((image, index) => {
if (file.url === image.url) {
this.dataForm.giftImages.splice(index, 1);
this.giftImages.splice(index, 1);
}
});
console.log(file, fileList);
@ -584,6 +954,60 @@ export default {
this.dialogVisible = true;
},
handleChildValue(value) {
console.log("value",value)
this.dataForm.detailedDescription = value
},
//
getCommodityList() {
let this_ = this
listLJGoods(this_.commodityForm).then(res=>{
this_.commodityList = res.data.records;
// this_.sumMethod(res.data.records);
// this.total = response.data.total;
})
},
//
inquire() {
this.getCommodityList();
},
//
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleRowClick(row) {
this.openCommodity = false
this.$refs.tables.clearSelection(); //
this.$refs.tables.toggleRowSelection(row); //
//
console.log("row",row)
console.log()
this.dataForm.goodsName = row.name
this.dataForm.goodsId = row.id
},
getCommodity() {
this.openCommodity = true
},
//
getQueryList(){
selectTree().then(response => {
this.cvsGoodList = response.data.records
});
listSupplier().then(response => {
this.supplierList = response.data.records
})
},
addCommodity () {
}
}
}
</script>

View File

@ -134,7 +134,6 @@ export default {
data() {
return {
purchaseList: [],
suppliersList: [],
//
title:'',

View File

@ -19,7 +19,7 @@ import javax.annotation.Resource;
* @since 2023-11-02 14:18:52
*/
@RestController
@RequestMapping("integralGift")
@RequestMapping("business/integral/integralGift")
public class IntegralGiftController extends BaseController {
/**
* 服务对象

View File

@ -1,5 +1,8 @@
package com.fuint.business.integral.entity;
import com.fuint.repository.model.base.BaseEntity;
import lombok.Data;
import java.util.Date;
import java.io.Serializable;
@ -9,7 +12,8 @@ import java.io.Serializable;
* @author makejava
* @since 2023-11-02 14:18:52
*/
public class IntegralGift implements Serializable {
@Data
public class IntegralGift extends BaseEntity {
private static final long serialVersionUID = -94300211865653814L;
/**
* 礼品ID
@ -115,263 +119,6 @@ public class IntegralGift implements Serializable {
* 店铺ID
*/
private Integer storeId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 创建人
*/
private Integer createBy;
/**
* 更新人
*/
private Integer updateBy;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getGiftName() {
return giftName;
}
public void setGiftName(String giftName) {
this.giftName = giftName;
}
public Integer getCategoryId() {
return categoryId;
}
public void setCategoryId(Integer categoryId) {
this.categoryId = categoryId;
}
public String getCoverImage() {
return coverImage;
}
public void setCoverImage(String coverImage) {
this.coverImage = coverImage;
}
public String getGiftImages() {
return giftImages;
}
public void setGiftImages(String giftImages) {
this.giftImages = giftImages;
}
public String getGiftType() {
return giftType;
}
public void setGiftType(String giftType) {
this.giftType = giftType;
}
public Integer getCouponId() {
return couponId;
}
public void setCouponId(Integer couponId) {
this.couponId = couponId;
}
public Integer getVoucherId() {
return voucherId;
}
public void setVoucherId(Integer voucherId) {
this.voucherId = voucherId;
}
public Integer getGoodsId() {
return goodsId;
}
public void setGoodsId(Integer goodsId) {
this.goodsId = goodsId;
}
public Integer getGiftQuantity() {
return giftQuantity;
}
public void setGiftQuantity(Integer giftQuantity) {
this.giftQuantity = giftQuantity;
}
public Integer getTotalInventory() {
return totalInventory;
}
public void setTotalInventory(Integer totalInventory) {
this.totalInventory = totalInventory;
}
public Integer getRemainingInventory() {
return remainingInventory;
}
public void setRemainingInventory(Integer remainingInventory) {
this.remainingInventory = remainingInventory;
}
public Integer getMerchantCouponId() {
return merchantCouponId;
}
public void setMerchantCouponId(Integer merchantCouponId) {
this.merchantCouponId = merchantCouponId;
}
public String getExchangeMethod() {
return exchangeMethod;
}
public void setExchangeMethod(String exchangeMethod) {
this.exchangeMethod = exchangeMethod;
}
public Integer getExchangePoints() {
return exchangePoints;
}
public void setExchangePoints(Integer exchangePoints) {
this.exchangePoints = exchangePoints;
}
public Double getMoneyRatio() {
return moneyRatio;
}
public void setMoneyRatio(Double moneyRatio) {
this.moneyRatio = moneyRatio;
}
public Double getExchangeAmount() {
return exchangeAmount;
}
public void setExchangeAmount(Double exchangeAmount) {
this.exchangeAmount = exchangeAmount;
}
public Double getExchangeFuelAmount() {
return exchangeFuelAmount;
}
public void setExchangeFuelAmount(Double exchangeFuelAmount) {
this.exchangeFuelAmount = exchangeFuelAmount;
}
public String getDeliveryMethod() {
return deliveryMethod;
}
public void setDeliveryMethod(String deliveryMethod) {
this.deliveryMethod = deliveryMethod;
}
public Double getExpressShippingFee() {
return expressShippingFee;
}
public void setExpressShippingFee(Double expressShippingFee) {
this.expressShippingFee = expressShippingFee;
}
public Double getShippingFeeAmount() {
return shippingFeeAmount;
}
public void setShippingFeeAmount(Double shippingFeeAmount) {
this.shippingFeeAmount = shippingFeeAmount;
}
public Integer getExchangeTimes() {
return exchangeTimes;
}
public void setExchangeTimes(Integer exchangeTimes) {
this.exchangeTimes = exchangeTimes;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDetailedDescription() {
return detailedDescription;
}
public void setDetailedDescription(String detailedDescription) {
this.detailedDescription = detailedDescription;
}
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
}

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.integral.mapper.IntegralGiftMapper">
<resultMap type="com.fuint.business.integral.entity.IntegralGift" id="IntegralGiftMap">
<resultMap type="com.fuint.business.integral.vo.IntegralGiftVO" id="IntegralGiftMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="giftName" column="gift_name" jdbcType="VARCHAR"/>
<result property="categoryId" column="category_id" jdbcType="INTEGER"/>
@ -33,6 +33,10 @@
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
<!-- outher-->
<result property="categoryName" column="category_name" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="IntegralGiftMapVO" type="com.fuint.business.integral.vo.IntegralGiftVO" >
@ -50,98 +54,87 @@
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="IntegralGiftMap">
select
id, gift_name, category_id, cover_image, gift_images, gift_type, coupon_id, voucher_id, goods_id, gift_quantity, total_inventory, remaining_inventory, merchant_coupon_id, exchange_method, exchange_points, money_ratio, exchange_amount, exchange_fuel_amount, delivery_method, express_shipping_fee, shipping_fee_amount, exchange_times, sort, status, detailed_description, store_id, create_time, update_time, create_by, update_by
from integral_gift
ig.id,
ig.gift_name,
ig.category_id,
ig.cover_image,
ig.gift_images,
ig.gift_type,
ig.coupon_id,
ig.voucher_id,
ig.goods_id,
ig.gift_quantity,
ig.total_inventory,
ig.remaining_inventory,
ig.merchant_coupon_id,
ig.exchange_method,
ig.exchange_points,
ig.money_ratio,
ig.exchange_amount,
ig.exchange_fuel_amount,
ig.delivery_method,
ig.express_shipping_fee,
ig.shipping_fee_amount,
ig.exchange_times,
ig.sort,
ig.status,
ig.detailed_description,
ig.store_id,
ig.create_time,
ig.update_time,
ig.create_by,
ig.update_by,
igc.category_name
from integral_gift ig
left join integral_gift_category igc ON ig.category_id = igc.id
<where>
<if test="id != null">
and id = #{id}
ig.store_id = #{integralGift.storeId}
<if test="integralGift.id != null">
and ig.id = #{integralGift.id}
</if>
<if test="giftName != null and giftName != ''">
and gift_name = #{giftName}
<if test="integralGift.giftName != null and integralGift.giftName != ''">
and ig.gift_name like CONCAT ('%',#{integralGift.giftName},'%')
</if>
<if test="categoryId != null">
and category_id = #{categoryId}
<if test="integralGift.categoryId != null">
and ig.category_id = #{integralGift.categoryId}
</if>
<if test="coverImage != null and coverImage != ''">
and cover_image = #{coverImage}
<if test="integralGift.coverImage != null and integralGift.coverImage != ''">
and ig.cover_image = #{integralGift.coverImage}
</if>
<if test="giftImages != null and giftImages != ''">
and gift_images = #{giftImages}
<if test="integralGift.giftImages != null and integralGift.giftImages != ''">
and ig.gift_images = #{integralGift.giftImages}
</if>
<if test="giftType != null and giftType != ''">
and gift_type = #{giftType}
<if test="integralGift.giftType != null and integralGift.giftType != ''">
and ig.gift_type = #{integralGift.giftType}
</if>
<if test="couponId != null">
and coupon_id = #{couponId}
<if test="integralGift.couponId != null">
and ig.coupon_id = #{integralGift.couponId}
</if>
<if test="voucherId != null">
and voucher_id = #{voucherId}
<if test="integralGift.voucherId != null">
and ig.voucher_id = #{integralGift.voucherId}
</if>
<if test="goodsId != null">
and goods_id = #{goodsId}
<if test="integralGift.goodsId != null">
and ig.goods_id = #{integralGift.goodsId}
</if>
<if test="giftQuantity != null">
and gift_quantity = #{giftQuantity}
<if test="integralGift.giftQuantity != null">
and ig.gift_quantity = #{integralGift.giftQuantity}
</if>
<if test="totalInventory != null">
and total_inventory = #{totalInventory}
<if test="integralGift.totalInventory != null">
and ig.total_inventory = #{integralGift.totalInventory}
</if>
<if test="remainingInventory != null">
and remaining_inventory = #{remainingInventory}
<if test="integralGift.remainingInventory != null">
and ig.remaining_inventory = #{integralGift.remainingInventory}
</if>
<if test="merchantCouponId != null">
and merchant_coupon_id = #{merchantCouponId}
<if test="integralGift.merchantCouponId != null">
and ig.merchant_coupon_id = #{integralGift.merchantCouponId}
</if>
<if test="exchangeMethod != null and exchangeMethod != ''">
and exchange_method = #{exchangeMethod}
<if test="integralGift.exchangeMethod != null and integralGift.exchangeMethod != ''">
and ig.exchange_method = #{integralGift.exchangeMethod}
</if>
<if test="exchangePoints != null">
and exchange_points = #{exchangePoints}
</if>
<if test="moneyRatio != null">
and money_ratio = #{moneyRatio}
</if>
<if test="exchangeAmount != null">
and exchange_amount = #{exchangeAmount}
</if>
<if test="exchangeFuelAmount != null">
and exchange_fuel_amount = #{exchangeFuelAmount}
</if>
<if test="deliveryMethod != null and deliveryMethod != ''">
and delivery_method = #{deliveryMethod}
</if>
<if test="expressShippingFee != null">
and express_shipping_fee = #{expressShippingFee}
</if>
<if test="shippingFeeAmount != null">
and shipping_fee_amount = #{shippingFeeAmount}
</if>
<if test="exchangeTimes != null">
and exchange_times = #{exchangeTimes}
</if>
<if test="sort != null">
and sort = #{sort}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="detailedDescription != null and detailedDescription != ''">
and detailed_description = #{detailedDescription}
</if>
<if test="storeId != null">
and store_id = #{storeId}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="createBy != null">
and create_by = #{createBy}
</if>
<if test="updateBy != null">
and update_by = #{updateBy}
<if test="integralGift.status != null and integralGift.status != ''">
and ig.status = #{integralGift.status}
</if>
</where>
</select>
@ -247,7 +240,7 @@
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into integral_gift(gift_name, category_id, cover_image, gift_images, gift_type, coupon_id, voucher_id, goods_id, gift_quantity, total_inventory, remaining_inventory, merchant_coupon_id, exchange_method, exchange_points, money_ratio, exchange_amount, exchange_fuel_amount, delivery_method, express_shipping_fee, shipping_fee_amount, exchange_times, sort, status, detailed_description, store_id, create_time, update_time, create_by, update_by)
values (#{giftName}, #{categoryId}, #{coverImage}, #{giftImages}, #{giftType}, #{couponId}, #{voucherId}, #{goodsId}, #{giftQuantity}, #{totalInventory}, #{remainingInventory}, #{merchantCouponId}, #{exchangeMethod}, #{exchangePoints}, #{moneyRatio}, #{exchangeAmount}, #{exchangeFuelAmount}, #{deliveryMethod}, #{expressShippingFee}, #{shippingFeeAmount}, #{exchangeTimes}, #{sort}, #{status}, #{detailedDescription}, #{storeId}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy})
values (#{giftName}, #{categoryId}, #{coverImage}, #{giftImages}, #{giftType}, #{couponId}, #{voucherId}, #{goodsId}, #{giftQuantity}, #{totalInventory}, #{remainingInventory}, #{merchantCouponId}, #{exchangeMethod}, #{exchangePoints}, #{moneyRatio}, #{exchangeAmount}, #{exchangeFuelAmount}, #{deliveryMethod}, #{expressShippingFee}, #{shippingFeeAmount}, #{exchangeTimes}, #{sort}, #{status}, #{detailedDescription}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">

View File

@ -60,6 +60,9 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
*/
@Override
public IntegralGift insert(IntegralGift integralGift) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
integralGift.setStoreId(nowAccountInfo.getStoreId());
integralGift.setCreateBy(nowAccountInfo.getStaffId().toString());
this.integralGiftDao.insert(integralGift);
return integralGift;
}

View File

@ -5,6 +5,8 @@ import lombok.Data;
@Data
public class IntegralGiftVO extends IntegralGift {
// 分类名称
private String categoryName;
// 商品
// 优惠卷
}