Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b9dceb5426
@ -1,6 +1,6 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询油罐列表
|
||||
// 查询积分分类
|
||||
export function getGiftCategoryApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralGiftCategory/queryByPage',
|
||||
|
@ -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
|
||||
})
|
||||
|
@ -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>'
|
||||
})
|
@ -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>
|
||||
|
@ -134,7 +134,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
purchaseList: [],
|
||||
|
||||
suppliersList: [],
|
||||
// 弹出框标题
|
||||
title:'',
|
||||
|
@ -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 {
|
||||
/**
|
||||
* 服务对象
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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">
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IntegralGiftVO extends IntegralGift {
|
||||
// 分类名称
|
||||
private String categoryName;
|
||||
// 商品
|
||||
// 优惠卷
|
||||
}
|
||||
|
@ -37,6 +37,12 @@ public class OilNameController extends BaseController {
|
||||
public ResponseObject selectAll (OilName oilName) {
|
||||
return getSuccessResult(oilNameService.oilNameListByType(oilName));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ResponseObject oilNameInfo(@PathVariable Integer id){
|
||||
return getSuccessResult(oilNameService.selectOilNameById(id));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 分页查询所有数据
|
||||
// */
|
||||
@ -113,5 +119,15 @@ public class OilNameController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分组查询所有的油类名称
|
||||
*/
|
||||
|
||||
@GetMapping("/queryOilName")
|
||||
public ResponseObject getAllOilNameGroup() {
|
||||
return getSuccessResult(oilNameService.getAllOilNameGroup());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.fuint.business.petrolStationManagement.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilName;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilNumber;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -13,4 +14,7 @@ public interface OilNameMapper extends BaseMapper<OilName> {
|
||||
|
||||
public List<OilName> getAllOilName();
|
||||
|
||||
public List<OilName> getAllOilNameGroup();
|
||||
|
||||
public OilName selectOilNameById(@Param("id") int id);
|
||||
}
|
||||
|
@ -18,7 +18,14 @@
|
||||
FROM
|
||||
oil_name NA
|
||||
</select>
|
||||
<!-- SELECT-->
|
||||
<select id="selectOilNameById" resultType="com.fuint.business.petrolStationManagement.entity.OilName"
|
||||
parameterType="int">
|
||||
select id, oil_type, oil_name from oil_name where id = #{id}
|
||||
</select>
|
||||
<select id="getAllOilNameGroup" resultType="com.fuint.business.petrolStationManagement.entity.OilName">
|
||||
select id, oil_type, oil_name from oil_name group by oil_name
|
||||
</select>
|
||||
<!-- SELECT-->
|
||||
<!-- NA.id AS id,-->
|
||||
<!-- NA.oil_name AS oilName,-->
|
||||
<!-- dict.dict_label AS oilType-->
|
||||
|
@ -23,6 +23,14 @@ public interface OilNameService extends IService<OilName> {
|
||||
|
||||
public List<OilName> getAllOilName();
|
||||
|
||||
public List<OilName> getAllOilNameGroup();
|
||||
|
||||
/**
|
||||
* 根据id查询油号信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public OilName selectOilNameById(int id);
|
||||
|
||||
// /**
|
||||
// * 根据条件分页查询员工信息
|
||||
|
@ -33,6 +33,17 @@ public class OilNameServiceImpl extends ServiceImpl<OilNameMapper, OilName> impl
|
||||
return baseMapper.getAllOilName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OilName> getAllOilNameGroup() {
|
||||
return baseMapper.getAllOilNameGroup();
|
||||
}
|
||||
|
||||
@Override
|
||||
public OilName selectOilNameById(int id) {
|
||||
OilName oilName = baseMapper.selectOilNameById(id);
|
||||
return oilName;
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public IPage<OilNumber> selectOilNumberList(Page page, OilNumber oilNumber) {
|
||||
|
@ -75,6 +75,18 @@ public class LJUserController extends BaseController {
|
||||
return getSuccessResult(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机号查询会员信息
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getMobile")
|
||||
public ResponseObject userVoByMobile(@Validated @RequestBody Map<String ,String > map){
|
||||
String mobile = map.get("mobile");
|
||||
LJUserVo userVo = userService.queryUserByMobile(mobile);
|
||||
return getSuccessResult(userVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员信息
|
||||
* @return
|
||||
|
@ -19,5 +19,18 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
|
||||
*/
|
||||
public IPage<LJUserVo> selectUserList(Page page, @Param("user") LJUserVo user);
|
||||
|
||||
/**
|
||||
* 根据手机号查询用户信息
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
public LJUserVo selectUserByMobile(@Param("mobile") String mobile);
|
||||
|
||||
/**
|
||||
* 统计信息
|
||||
* @param storeId
|
||||
* @param sumValue
|
||||
* @return
|
||||
*/
|
||||
public Double selectSumByStore(@Param("storeId") int storeId,@Param("sumValue") String sumValue);
|
||||
}
|
||||
|
@ -39,7 +39,16 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<!-- 查询会员统计信息-->
|
||||
<select id="selectSumByStore" resultType="java.lang.Double" parameterType="int">
|
||||
select sum(${sumValue}) from mt_user_balance where store_id = #{storeId}
|
||||
</select>
|
||||
<!-- 根据手机号查询会员信息-->
|
||||
<select id="selectUserByMobile" resultType="com.fuint.business.userManager.vo.LJUserVo"
|
||||
parameterType="java.lang.String">
|
||||
<include refid="selectUser"></include>
|
||||
<where>
|
||||
mu.mobile = #{mobile}
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -40,6 +40,13 @@ public interface LJUserService extends IService<LJUser> {
|
||||
*/
|
||||
public LJUser selectUserByMobile(String mobile);
|
||||
|
||||
/**
|
||||
* 根据手机号查询会员信息
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
public LJUserVo queryUserByMobile(String mobile);
|
||||
|
||||
/**
|
||||
* 根据id删除会员信息
|
||||
* @param id
|
||||
|
@ -98,6 +98,17 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机号查询会员信息
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LJUserVo queryUserByMobile(String mobile) {
|
||||
LJUserVo userVo = baseMapper.selectUserByMobile(mobile);
|
||||
return userVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除会员信息
|
||||
* @param id
|
||||
|
@ -1,18 +1,14 @@
|
||||
package com.fuint.api.cashier.coltroller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.fuint.api.cashier.entity.OilNumGunConfig;
|
||||
import com.fuint.api.cashier.service.OilNumGunConfigService;
|
||||
import com.fuint.api.cashier.vo.OilNumGunConfigVo;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 油号油枪对应信息 controller层
|
||||
@ -29,18 +25,30 @@ public class OilNumGunConfigController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResponseObject list(){
|
||||
List<OilNumGunConfig> list = configService.selectList();
|
||||
List<OilNumGunConfigVo> list = configService.selectList();
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据油号查询油号油枪对应信息
|
||||
* @param oilNum
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{oilNum}")
|
||||
public ResponseObject getOilGun(@PathVariable String oilNum){
|
||||
List<OilNumGunConfig> list = configService.selectListByOilNum(oilNum);
|
||||
@PostMapping("/oilNum")
|
||||
public ResponseObject getOilGun(@RequestBody Map<String,String> map){
|
||||
String oilNum = map.get("oilNum");
|
||||
List<OilNumGunConfigVo> list = configService.selectListByOilNum(oilNum);
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询油号油枪配置信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ResponseObject oilNumGunInfo(@PathVariable Integer id){
|
||||
OilNumGunConfigVo oilNumGunConfigVo = configService.selectOilNumGunById(id);
|
||||
return getSuccessResult(oilNumGunConfigVo);
|
||||
}
|
||||
}
|
||||
|
@ -26,14 +26,14 @@ public class OilNumGunConfig extends BaseEntity implements Serializable {
|
||||
@ApiModelProperty("自增ID")
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 油号
|
||||
*/
|
||||
private String oilNum;
|
||||
/**
|
||||
* 油枪号
|
||||
*/
|
||||
private String oilGunNum;
|
||||
/**
|
||||
* 油号id
|
||||
*/
|
||||
private Integer numberId;
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,29 @@ package com.fuint.api.cashier.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fuint.api.cashier.entity.OilNumGunConfig;
|
||||
import com.fuint.api.cashier.vo.OilNumGunConfigVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface OilNumGunConfigMapper extends BaseMapper<OilNumGunConfig> {
|
||||
/**
|
||||
* 查询油号油枪信息
|
||||
* @return
|
||||
*/
|
||||
public List<OilNumGunConfigVo> selectOilNumGunList();
|
||||
|
||||
/**
|
||||
* 根据油号查询油枪信息
|
||||
* @param numberId
|
||||
* @return
|
||||
*/
|
||||
public List<OilNumGunConfigVo> selectListByOilNum(@Param("numberId") String numberId);
|
||||
|
||||
/**
|
||||
* 根据id查询油号油枪配置信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public OilNumGunConfigVo selectOilNumGunById(@Param("id") int id);
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.api.cashier.mapper.OilNumGunConfigMapper">
|
||||
<sql id="selectOilNumGun">
|
||||
select ong.*,onm.oil_name,onm.oil_price from oil_num_gun_config ong
|
||||
inner join oil_number onm on ong.number_id = onm.number_id
|
||||
</sql>
|
||||
<select id="selectOilNumGunList" resultType="com.fuint.api.cashier.vo.OilNumGunConfigVo">
|
||||
<include refid="selectOilNumGun"></include>
|
||||
group by ong.number_id
|
||||
</select>
|
||||
|
||||
<select id="selectListByOilNum" resultType="com.fuint.api.cashier.vo.OilNumGunConfigVo"
|
||||
parameterType="java.lang.String">
|
||||
<include refid="selectOilNumGun"></include>
|
||||
<where>
|
||||
ong.number_id = #{numberId}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectOilNumGunById" resultType="com.fuint.api.cashier.vo.OilNumGunConfigVo"
|
||||
parameterType="int">
|
||||
<include refid="selectOilNumGun"></include>
|
||||
<where>
|
||||
ong.id = #{id}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -2,6 +2,7 @@ package com.fuint.api.cashier.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.api.cashier.entity.OilNumGunConfig;
|
||||
import com.fuint.api.cashier.vo.OilNumGunConfigVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -13,12 +14,19 @@ public interface OilNumGunConfigService extends IService<OilNumGunConfig> {
|
||||
* 查询所有油号油枪配置信息
|
||||
* @return
|
||||
*/
|
||||
public List<OilNumGunConfig> selectList();
|
||||
public List<OilNumGunConfigVo> selectList();
|
||||
|
||||
/**
|
||||
* 根据油号查询油枪信息
|
||||
* @param oilNum
|
||||
* @return
|
||||
*/
|
||||
public List<OilNumGunConfig> selectListByOilNum(String oilNum);
|
||||
public List<OilNumGunConfigVo> selectListByOilNum(String oilNum);
|
||||
|
||||
/**
|
||||
* 根据id查询油号油枪配置信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public OilNumGunConfigVo selectOilNumGunById(int id);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.api.cashier.entity.OilNumGunConfig;
|
||||
import com.fuint.api.cashier.mapper.OilNumGunConfigMapper;
|
||||
import com.fuint.api.cashier.service.OilNumGunConfigService;
|
||||
import com.fuint.api.cashier.vo.OilNumGunConfigVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@ -16,20 +17,25 @@ import java.util.List;
|
||||
@Service
|
||||
public class OilNumGunConfigServiceImpl extends ServiceImpl<OilNumGunConfigMapper, OilNumGunConfig> implements OilNumGunConfigService {
|
||||
@Override
|
||||
public List<OilNumGunConfig> selectList() {
|
||||
LambdaQueryWrapper<OilNumGunConfig> queryWrapper = new LambdaQueryWrapper<OilNumGunConfig>();
|
||||
queryWrapper.groupBy(OilNumGunConfig::getOilNum);
|
||||
List list = baseMapper.selectMaps(queryWrapper);
|
||||
public List<OilNumGunConfigVo> selectList() {
|
||||
List<OilNumGunConfigVo> list = baseMapper.selectOilNumGunList();
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OilNumGunConfig> selectListByOilNum(String oilNum) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
if (!oilNum.equals("1")){
|
||||
queryWrapper.eq("oil_num",oilNum);
|
||||
public List<OilNumGunConfigVo> selectListByOilNum(String oilNum) {
|
||||
List<OilNumGunConfigVo> list = null;
|
||||
if (oilNum.equals("全部")){
|
||||
list = baseMapper.selectOilNumGunList();
|
||||
}else {
|
||||
list = baseMapper.selectListByOilNum(oilNum);
|
||||
}
|
||||
List list = baseMapper.selectList(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OilNumGunConfigVo selectOilNumGunById(int id) {
|
||||
OilNumGunConfigVo oilNumGunConfigVo = baseMapper.selectOilNumGunById(id);
|
||||
return oilNumGunConfigVo;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
package com.fuint.api.cashier.vo;
|
||||
|
||||
import com.fuint.api.cashier.entity.OilNumGunConfig;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OilNumGunConfigVo extends OilNumGunConfig {
|
||||
// 油品号
|
||||
private String oilName;
|
||||
// 油品单价
|
||||
private Double oilPrice;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.fuint.api.fuyou.entity;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.fuint.api.fuyou.util.Utils;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
public class Message {
|
||||
public static String requestMsg(Map<String, String> map) throws Exception {
|
||||
Map<String, String> reqs = new HashMap<>();
|
||||
reqs.putAll(map);
|
||||
String sign = Utils.getSign(reqs);
|
||||
reqs.put("sign", sign);
|
||||
Document doc = DocumentHelper.createDocument();
|
||||
Element root = doc.addElement("xml");
|
||||
Iterator it = reqs.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
String key = it.next().toString();
|
||||
String value = reqs.get(key);
|
||||
root.addElement(key).addText(value);
|
||||
}
|
||||
String reqBody = "<?xml version=\"1.0\" encoding=\"GBK\" standalone=\"yes\"?>" + doc.getRootElement().asXML();
|
||||
reqBody = URLEncoder.encode(reqBody, Const.charset);
|
||||
return reqBody;
|
||||
}
|
||||
|
||||
public static String responseMsg(String reqBody,String url) throws Exception {
|
||||
Map<String, Object> reqParam = new HashMap<>();
|
||||
reqParam.put("req",reqBody);
|
||||
String resMsg = HttpUtil.post(url, reqParam);
|
||||
String rspXml = URLDecoder.decode(resMsg, Const.charset);
|
||||
return rspXml;
|
||||
}
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
package com.fuint.api.fuyou.service.impl;
|
||||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.fuint.api.fuyou.entity.Builder;
|
||||
import com.fuint.api.fuyou.entity.Const;
|
||||
import com.fuint.api.fuyou.entity.Message;
|
||||
import com.fuint.api.fuyou.service.FyPayService;
|
||||
import com.fuint.api.fuyou.util.Utils;
|
||||
import org.dom4j.Document;
|
||||
@ -30,29 +32,38 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
Map<String, String> map = Builder.buildFuiou22();
|
||||
map.put("auth_code",authCode);
|
||||
map.put("mchnt_order_no",orderNo);
|
||||
Map<String, String> reqs = new HashMap<>();
|
||||
reqs.putAll(map);
|
||||
String sign = Utils.getSign(reqs);
|
||||
reqs.put("sign", sign);
|
||||
Document doc = DocumentHelper.createDocument();
|
||||
Element root = doc.addElement("xml");
|
||||
Iterator it = reqs.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
String key = it.next().toString();
|
||||
String value = reqs.get(key);
|
||||
root.addElement(key).addText(value);
|
||||
}
|
||||
String reqBody = "<?xml version=\"1.0\" encoding=\"GBK\" standalone=\"yes\"?>" + doc.getRootElement().asXML();
|
||||
reqBody = URLEncoder.encode(reqBody, Const.charset);
|
||||
|
||||
Map<String, Object> reqParam = new HashMap<>();
|
||||
reqParam.put("req",reqBody);
|
||||
String resMsg = HttpUtil.post(Const.fuiou_22_url, reqParam);
|
||||
String rspXml = URLDecoder.decode(resMsg, Const.charset);
|
||||
// 请求报文
|
||||
String reqBody = Message.requestMsg(map);
|
||||
// 响应报文
|
||||
String rspXml = Message.responseMsg(reqBody,Const.fuiou_22_url);
|
||||
|
||||
//响应报文验签
|
||||
Map<String, String> resMap = Utils.xmlStr2Map(rspXml);
|
||||
String str = resMap.get("sign");
|
||||
if (Utils.verifySign(resMap, str)){
|
||||
String resultCode = resMap.get("result_code");
|
||||
if (resultCode.equals("000000")){
|
||||
return resMap;
|
||||
}else {
|
||||
ThreadUtil.execAsync(() -> {
|
||||
try {
|
||||
long startTime = System.currentTimeMillis();
|
||||
long endTime = startTime + 5000;
|
||||
while (System.currentTimeMillis() < endTime){
|
||||
Map<String, String> queryOrder = this.queryOrder(map1);
|
||||
String resultCode1 = queryOrder.get("result_code");
|
||||
if (resultCode1.equals("000000")){
|
||||
// 修改已支付
|
||||
}else {
|
||||
// 支付失败
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
return resMap;
|
||||
}
|
||||
return null;
|
||||
@ -63,25 +74,12 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
String orderNo = map1.get("orderNo");
|
||||
Map<String, String> map = Builder.buildFuiou30();
|
||||
map.put("mchnt_order_no",orderNo);
|
||||
Map<String, String> reqs = new HashMap<>();
|
||||
reqs.putAll(map);
|
||||
String sign = Utils.getSign(reqs);
|
||||
reqs.put("sign", sign);
|
||||
Document doc = DocumentHelper.createDocument();
|
||||
Element root = doc.addElement("xml");
|
||||
Iterator it = reqs.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
String key = it.next().toString();
|
||||
String value = reqs.get(key);
|
||||
root.addElement(key).addText(value);
|
||||
}
|
||||
String reqBody = "<?xml version=\"1.0\" encoding=\"GBK\" standalone=\"yes\"?>" + doc.getRootElement().asXML();
|
||||
reqBody = URLEncoder.encode(reqBody, Const.charset);
|
||||
|
||||
Map<String, Object> reqParam = new HashMap<>();
|
||||
reqParam.put("req",reqBody);
|
||||
String resMsg = HttpUtil.post(Const.fuiou_30_url, reqParam);
|
||||
String rspXml = URLDecoder.decode(resMsg, Const.charset);
|
||||
// 请求报文
|
||||
String reqBody = Message.requestMsg(map);
|
||||
// 响应报文
|
||||
String rspXml = Message.responseMsg(reqBody,Const.fuiou_30_url);
|
||||
|
||||
//响应报文验签
|
||||
Map<String, String> resMap = Utils.xmlStr2Map(rspXml);
|
||||
String str = resMap.get("sign");
|
||||
|
70
fuintCashierWeb/src/api/cashier/ljgoods.js
Normal file
70
fuintCashierWeb/src/api/cashier/ljgoods.js
Normal file
@ -0,0 +1,70 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询商品列表
|
||||
export function listLJGoods(query) {
|
||||
return request({
|
||||
url: '/business/convenience/goods/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询商品详细
|
||||
export function getLJGoods(id) {
|
||||
return request({
|
||||
url: '/business/convenience/goods/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据商品条码查询商品详细
|
||||
export function queryLJGoods(data) {
|
||||
return request({
|
||||
url: '/business/convenience/goods/getGoods',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 生成13位二维码
|
||||
export function createGoodsNo() {
|
||||
return request({
|
||||
url: '/business/convenience/goods/createGoodsNo',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 对接扫码枪
|
||||
export function scanCode(goodsNo) {
|
||||
return request({
|
||||
url: '/business/convenience/goods/scanCode/'+goodsNo,
|
||||
method: 'get',
|
||||
// data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增商品
|
||||
export function addLJGoods(data) {
|
||||
return request({
|
||||
url: '/business/convenience/goods',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改商品
|
||||
export function updateLJGoods(data) {
|
||||
return request({
|
||||
url: '/business/convenience/goods',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除商品
|
||||
export function delLJGoods(id) {
|
||||
return request({
|
||||
url: '/business/convenience/goods/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询字典类型列表
|
||||
// 查询油号油枪列表
|
||||
export function listOilNumGun() {
|
||||
return request({
|
||||
url: '/api/cashier/list',
|
||||
@ -8,10 +8,38 @@ export function listOilNumGun() {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典类型列表
|
||||
export function getOilNumGun(oilNum) {
|
||||
// 查询油号油枪列表
|
||||
export function getOilNumGun(data) {
|
||||
return request({
|
||||
url: '/api/cashier/' + oilNum,
|
||||
method: 'get',
|
||||
url: '/api/cashier/oilNum' ,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 根据id查询油号油枪列表
|
||||
export function getOilNumGunById(id) {
|
||||
return request({
|
||||
url: '/api/cashier/' +id ,
|
||||
method: 'get',
|
||||
// data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 根据id油品名称
|
||||
export function getOilNameById(id) {
|
||||
return request({
|
||||
url: '/business/petrolStationManagement/oilName/' +id ,
|
||||
method: 'get',
|
||||
// data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 根据id油品名称
|
||||
export function getOilNameList() {
|
||||
return request({
|
||||
url: '/business/petrolStationManagement/oilName/queryOilName' ,
|
||||
method: 'get',
|
||||
// data: data
|
||||
})
|
||||
}
|
||||
|
61
fuintCashierWeb/src/api/cashier/staff.js
Normal file
61
fuintCashierWeb/src/api/cashier/staff.js
Normal file
@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询员工列表
|
||||
export function listStaff(query) {
|
||||
return request({
|
||||
url: '/business/member/staff/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询所有员工
|
||||
export function queryStaffs() {
|
||||
return request({
|
||||
url: '/business/member/staff/query',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询员工详细
|
||||
export function getStaff(id) {
|
||||
return request({
|
||||
url: '/business/member/staff/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据手机号查询员工详情
|
||||
export function queryStaff(data) {
|
||||
return request({
|
||||
url: '/business/member/staff/mobile',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增员工
|
||||
export function addStaff(data) {
|
||||
return request({
|
||||
url: '/business/member/staff',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改员工
|
||||
export function updateStaff(data) {
|
||||
return request({
|
||||
url: '/business/member/staff',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除员工
|
||||
export function delStaff(id) {
|
||||
return request({
|
||||
url: '/business/member/staff/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
39
fuintCashierWeb/src/api/cashier/user.js
Normal file
39
fuintCashierWeb/src/api/cashier/user.js
Normal file
@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询会员列表
|
||||
export function listUser(query) {
|
||||
return request({
|
||||
url: '/business/userManager/user/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询会员列表
|
||||
export function listStatistic(query) {
|
||||
return request({
|
||||
url: '/business/userManager/user/statistic',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 根据手机号查询会员详细
|
||||
export function getUserMobile(data) {
|
||||
return request({
|
||||
url: '/business/userManager/user/mobile' ,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 根据手机号查询会员详细
|
||||
export function getUserVoMobile(data) {
|
||||
return request({
|
||||
url: '/business/userManager/user/getMobile',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -49,13 +49,14 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="center-right">
|
||||
<div class="center-top">
|
||||
<div class="center-top-tab">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="全部" name="1"></el-tab-pane>
|
||||
<el-tab-pane v-for="item in oilNumList" :key="item.id"
|
||||
:label="item.oil_num" :name="item.oil_num"></el-tab-pane>
|
||||
<el-tab-pane v-for="item in oilNameList" :key="item.id"
|
||||
:label="item.oilName" :name="item.id+''"></el-tab-pane>
|
||||
<!-- <el-tab-pane label="95#" name="third"></el-tab-pane>-->
|
||||
<!-- <el-tab-pane label="98#" name="fourth"></el-tab-pane>-->
|
||||
<!-- <el-tab-pane label="0#" name="one"></el-tab-pane>-->
|
||||
@ -67,12 +68,23 @@
|
||||
</div>
|
||||
|
||||
<div class="center-top-data">
|
||||
<div class="center-top-of" >
|
||||
<div class="center-top-of">
|
||||
<div class="wrap-wrap">
|
||||
<div class="of-box" v-for="(item,index) in 17" :key="index" :style="{'background-color': colorList[index%5].color}">
|
||||
<div>92#</div>
|
||||
<!-- <div class="of-box" v-for="(item,index) in 17" :key="index"
|
||||
:style="{'background-color': colorList[index%5].color}">-->
|
||||
<!-- <div>92#</div>-->
|
||||
|
||||
<div class="of-title" >{{index+1}}号枪</div>
|
||||
<!-- <div class="of-title" >{{index+1}}号枪</div>-->
|
||||
<!-- <div>-->
|
||||
<!-- <img src="../../../assets/images/jya.png" style="width: 18px;height: 18px;">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="of-box" v-for="(item,index) in oilNumGunList" :key="index"
|
||||
:style="{'background-color': colorList[index%5].color}"
|
||||
@click="refuel(item.id)">
|
||||
<div>{{ getName(oilNameList,item.oilName) }}</div>
|
||||
|
||||
<div class="of-title" >{{item.oilGunNum}}号枪</div>
|
||||
<div>
|
||||
<img src="../../../assets/images/jya.png" style="width: 18px;height: 18px;">
|
||||
</div>
|
||||
@ -92,12 +104,21 @@
|
||||
<div class="bottom-qk">解锁</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="center-app">
|
||||
<div class="center-top">
|
||||
<div class="center-top-title">非油商品</div>
|
||||
<div class="center-top-input">
|
||||
<input type="text" placeholder="请输入商品名称,条码,商品关键词">
|
||||
<input v-model="goods" type="text"
|
||||
@input="queryGoods"
|
||||
placeholder="请输入商品名称,条码,商品关键词">
|
||||
</div>
|
||||
<el-autocomplete
|
||||
v-model="goods"
|
||||
:fetch-suggestions="querySearchAsync"
|
||||
placeholder="请输入内容"
|
||||
@select="handleSelect"
|
||||
></el-autocomplete>
|
||||
<div class="center-top-data">
|
||||
<div class="data-top">
|
||||
<div class="data-top-title">商品</div>
|
||||
@ -130,24 +151,30 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 加油员姓名-->
|
||||
<el-dialog
|
||||
title="提示"
|
||||
title="选择加油员"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
:before-close="handleClose">
|
||||
<div class="wrap-wrap">
|
||||
<div class="of-box" v-for="(item,index) in 7" :key="index" :style="{'background-color': item.color}">
|
||||
<div>92#</div>
|
||||
<div class="of-title" >加油员姓名</div>
|
||||
<div>
|
||||
<img src="../../../assets/images/jya.png" style="width: 18px;height: 18px;">
|
||||
</div>
|
||||
:close-on-click-modal="false">
|
||||
<div class="wrap-wrap">
|
||||
<div class="of-box" v-for="(item,index) in staffList" :key="index"
|
||||
:style="{'background-color': item.color}">
|
||||
<div>{{ item.name }}</div>
|
||||
<div class="of-title" >{{ item.mobile }}</div>
|
||||
</div>
|
||||
<!-- <div class="of-box" v-for="(item,index) in 7" :key="index" :style="{'background-color': item.color}">-->
|
||||
<!-- <div>92#</div>-->
|
||||
<!-- <div class="of-title" >加油员姓名</div>-->
|
||||
<!-- <div>-->
|
||||
<!-- <img src="../../../assets/images/jya.png" style="width: 18px;height: 18px;">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||
<!-- <el-button type="primary" @click="dialogVisible = false">确 定</el-button>-->
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 立即结算-->
|
||||
@ -155,7 +182,7 @@
|
||||
title="提示"
|
||||
:visible.sync="dialogVisiblej"
|
||||
width="30%"
|
||||
:before-close="handleClose">
|
||||
:close-on-click-modal="false">
|
||||
<div style="text-align: center;font-size: 15px;font-weight: bold">付款金额</div>
|
||||
<div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0">
|
||||
¥300.00
|
||||
@ -167,6 +194,7 @@
|
||||
<div style="text-align: center;margin-bottom: 10px">赠送金额</div>
|
||||
<div>
|
||||
<el-input v-model="authCode"
|
||||
autofocus="autofocus"
|
||||
@keydown.enter.native="collection"
|
||||
placeholder="扫描或输入付款码、支持微信、支付宝、云闪付">
|
||||
<i
|
||||
@ -185,19 +213,46 @@
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<span slot="footer" class="dialog-footer" style="display: flex;justify-content: space-around">
|
||||
<el-button @click="dialogVisiblej = false">取 消</el-button>
|
||||
<el-button type="primary" @click="collection">确 定 收 款</el-button>
|
||||
<el-button @click="dialogVisiblej = false" class="but">取 消</el-button>
|
||||
<el-button type="primary" class="but" @click="collection">确 定 收 款</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 会员登录-->
|
||||
<el-dialog
|
||||
title="提示"
|
||||
title="会员信息"
|
||||
:visible.sync="dialogVisiblevip"
|
||||
width="30%"
|
||||
:before-close="handleClose">
|
||||
:close-on-click-modal="false">
|
||||
<div >
|
||||
会员登录
|
||||
<el-input placeholder="会员手机号、用户昵称、实体卡号" v-model="userNo"
|
||||
class="input-with-select" style="text-align: center;">
|
||||
<el-select v-model="select1" slot="prepend" placeholder="请选择" style="width: 120px">
|
||||
<el-option label="会员手机号" value="会员手机号"></el-option>
|
||||
<el-option label="用户昵称" value="用户昵称"></el-option>
|
||||
</el-select>
|
||||
<el-button slot="append" @click="getUser">查询</el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-descriptions title="会员信息" :column="2">
|
||||
<el-descriptions-item label="手机号">{{member.mobile ? member.mobile : "--"}}</el-descriptions-item>
|
||||
<el-descriptions-item label="会员昵称">{{member.name ? member.name : "--"}}</el-descriptions-item>
|
||||
<el-descriptions-item label="积分">{{member.points ? member.points : "--"}}</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="加油金余额">0</el-descriptions-item>-->
|
||||
<el-descriptions-item label="车牌号">{{member.carNo ? member.carNo : "--"}}</el-descriptions-item>
|
||||
<el-descriptions-item label="会员备注">{{member.remark ? member.remark : "--"}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions title="会员等级">
|
||||
<el-descriptions-item label="等级名称">{{member.gradeId ? member.gradeId : "--"}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions title="储值余额">
|
||||
<template slot="extra">
|
||||
<sapn style="color: red;margin-right: 20px">余额充值</sapn>
|
||||
<sapn style="font-weight: bold">¥{{member.cardBalance ? member.cardBalance : "--"}}</sapn>
|
||||
</template>
|
||||
<el-descriptions-item v-if="member.cardBalance!=0" label="账户余额">{{member.cardBalance ? member.cardBalance : "--"}}元</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisiblevip = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogVisiblevip = false">确 定</el-button>
|
||||
@ -205,7 +260,43 @@
|
||||
</el-dialog>
|
||||
<!-- 油号选择-->
|
||||
|
||||
|
||||
<!-- 加油枪加油金额-->
|
||||
<el-dialog
|
||||
title="加油金额"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisibleamount"
|
||||
width="30%">
|
||||
<div class="amount">
|
||||
<span>已选油品</span>
|
||||
<span class="amountBlue">{{ getName(oilNameList,form.oilName) }}</span>
|
||||
</div>
|
||||
<div class="amount">
|
||||
<span>已选油枪</span>
|
||||
<span class="amountBlue">{{ form.oilGunNum }}号枪</span>
|
||||
</div>
|
||||
<div class="amount">
|
||||
<span>油品单价</span>
|
||||
<span class="amountBlue">{{ form.oilPrice }}元/L</span>
|
||||
</div>
|
||||
<div >
|
||||
<el-input v-model="form.amount" placeholder="请输入加油金额" autofocus="autofocus"
|
||||
style="font-weight: 700;text-align: center;font-size: 20px;">
|
||||
<el-select v-model="select" style="width: 70px" @change="changeSelect" slot="append" placeholder="请选择">
|
||||
<el-option label="元" value="元"></el-option>
|
||||
<el-option label="L" value="L"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6" v-for="(item,index) in rise" :key="index">
|
||||
<el-button class="grid-content bg-purple" @click="changeAmount(item.value)">{{ item.value }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer" style="display: flex;justify-content: space-around">
|
||||
<el-button @click="dialogVisibleamount = false" class="but">取 消</el-button>
|
||||
<el-button type="primary" @click="getOilOrder" class="but">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
@ -213,16 +304,44 @@
|
||||
|
||||
<script>
|
||||
import {getDicts} from "@/api/dict/data";
|
||||
import {getOilNumGun, listOilNumGun} from "@/api/cashier/oilnumgun";
|
||||
import {getOilNameList, getOilNumGun, getOilNumGunById, listOilNumGun} from "@/api/cashier/oilnumgun";
|
||||
import {fyPay} from "@/api/cashier/pay";
|
||||
import {listLJGoods} from "@/api/cashier/ljgoods";
|
||||
import {getUserVoMobile} from "@/api/cashier/user";
|
||||
import {queryStaffs} from "@/api/cashier/staff";
|
||||
|
||||
export default {
|
||||
name: "homeindex",
|
||||
data(){
|
||||
return{
|
||||
// 油品订单
|
||||
oilOrder:[],
|
||||
// 油品订单数
|
||||
oilTotal:0,
|
||||
// 加油金额
|
||||
rise:[
|
||||
{value:"¥100"},
|
||||
{value:"¥150"},
|
||||
{value:"¥200"},
|
||||
{value:"¥300"},
|
||||
],
|
||||
// 会员信息
|
||||
member:{},
|
||||
select1:'会员手机号',
|
||||
// 会员信息
|
||||
userNo:"",
|
||||
// 查询的商品信息
|
||||
goods:"",
|
||||
select:"元",
|
||||
form:{
|
||||
amount : ""
|
||||
},
|
||||
oilNumGunList:[],
|
||||
authCode:'',
|
||||
// 油号列表
|
||||
oilNumList:[],
|
||||
// 商品列表
|
||||
goodsList:[],
|
||||
// 油枪列表
|
||||
oilGunList:[],
|
||||
// 支付方式列表
|
||||
@ -230,7 +349,8 @@
|
||||
dialogVisible: false,
|
||||
dialogVisiblej: false,
|
||||
dialogVisiblevip:false,
|
||||
activeName: 'second',
|
||||
dialogVisibleamount:false,
|
||||
activeName: '1',
|
||||
tabarr:[
|
||||
{name:'收银台',icon:'el-icon-s-platform'},
|
||||
{name:'充值',icon: 'el-icon-s-finance'},
|
||||
@ -252,25 +372,137 @@
|
||||
{color:'#fafafa'}
|
||||
],
|
||||
num: 1,
|
||||
// 油号名称
|
||||
oilNameList:'',
|
||||
// 员工列表
|
||||
staffList:[],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getPayList();
|
||||
this.queryGoods();
|
||||
this.getOilName();
|
||||
},
|
||||
methods:{
|
||||
getStaffList(){
|
||||
queryStaffs().then( response => {
|
||||
this.staffList = response.data
|
||||
})
|
||||
},
|
||||
// 订单信息
|
||||
getOilOrder(){
|
||||
this.dialogVisibleamount = false
|
||||
this.oilOrder.push(this.form)
|
||||
this.oilTotal += 1;
|
||||
},
|
||||
// 选择“元”或“L”
|
||||
changeSelect(){
|
||||
if(this.select == "元"){
|
||||
this.rise = [
|
||||
{value:"¥100"},
|
||||
{value:"¥150"},
|
||||
{value:"¥200"},
|
||||
{value:"¥300"},
|
||||
];
|
||||
}else {
|
||||
this.rise = [
|
||||
{value:"100L"},
|
||||
{value:"150L"},
|
||||
{value:"200L"},
|
||||
{value:"300L"},
|
||||
];
|
||||
}
|
||||
},
|
||||
// 改变加油金额
|
||||
changeAmount(amount){
|
||||
if (this.select == "元"){
|
||||
this.form.amount = amount.slice(1)
|
||||
}else {
|
||||
this.form.amount = amount.slice(0,3)
|
||||
}
|
||||
},
|
||||
// 获取油号名称
|
||||
getName(oilNameList,id){
|
||||
let name = ""
|
||||
if(oilNameList!=null && oilNameList!=""){
|
||||
oilNameList.forEach(item => {
|
||||
if (item.id == id){
|
||||
name = item.oilName
|
||||
}
|
||||
})
|
||||
}
|
||||
return name;
|
||||
},
|
||||
// 获取油号信息
|
||||
getOilName(){
|
||||
getOilNameList().then( response => {
|
||||
this.oilNameList = response.data;
|
||||
})
|
||||
},
|
||||
getUser(){
|
||||
getUserVoMobile({mobile:this.userNo}).then( response => {
|
||||
this.member = response.data
|
||||
// console.log(this.member)
|
||||
})
|
||||
},
|
||||
querySearchAsync(queryString, cb) {
|
||||
var restaurants = this.goodsList;
|
||||
// console.log(queryString)
|
||||
this.goodsList.forEach(item => {
|
||||
item.indexOf(queryString)
|
||||
})
|
||||
},
|
||||
handleSelect(item) {
|
||||
// console.log(item);
|
||||
},
|
||||
// 查询商品信息
|
||||
queryGoods(val){
|
||||
// console.log(this.goods)
|
||||
let map = {
|
||||
page:1,
|
||||
pageSize:40,
|
||||
name:this.goods,
|
||||
isRecovery:0,
|
||||
}
|
||||
let map1 = {
|
||||
page:1,
|
||||
pageSize:40,
|
||||
goodsNo:this.goods,
|
||||
isRecovery:0,
|
||||
}
|
||||
listLJGoods(map).then( response => {
|
||||
if(response.data.records!=null){
|
||||
this.goodsList = response.data.records
|
||||
}
|
||||
})
|
||||
listLJGoods(map1).then( response => {
|
||||
if(response.data.records!=null){
|
||||
this.goodsList = response.data.records
|
||||
}
|
||||
})
|
||||
// console.log(this.goodsList)
|
||||
},
|
||||
// 加油金额
|
||||
refuel(id){
|
||||
this.form.amount = ""
|
||||
this.dialogVisibleamount = true;
|
||||
getOilNumGunById(id).then( response => {
|
||||
this.form = response.data;
|
||||
})
|
||||
},
|
||||
// 确定收款
|
||||
collection(){
|
||||
let map = {
|
||||
authCode : this.authCode,
|
||||
orderNo : "0000055"
|
||||
}
|
||||
console.log(map)
|
||||
// console.log(map)
|
||||
fyPay(map).then( response => {
|
||||
console.log(response)
|
||||
// console.log(response)
|
||||
})
|
||||
},
|
||||
payMethod(payType){
|
||||
console.log(payType)
|
||||
// console.log(payType)
|
||||
},
|
||||
// 获取支付方式
|
||||
getPayList(){
|
||||
@ -281,6 +513,10 @@
|
||||
listOilNumGun().then( response => {
|
||||
this.oilNumList = response.data
|
||||
})
|
||||
// 获取油号油枪对应信息
|
||||
getOilNumGun({oilNum : "全部"}).then( response => {
|
||||
this.oilNumGunList = response.data
|
||||
})
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
@ -293,9 +529,17 @@
|
||||
// console.log(value);
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
console.log(tab.label)
|
||||
getOilNumGun(tab.label).then( response => {
|
||||
console.log(response)
|
||||
let oilNum = ""
|
||||
this.oilNumList.forEach(item => {
|
||||
if (item.oilName == tab.name){
|
||||
oilNum = item.numberId
|
||||
}
|
||||
})
|
||||
if (tab.label == "全部"){
|
||||
oilNum = "全部"
|
||||
}
|
||||
getOilNumGun({oilNum : oilNum}).then( response => {
|
||||
this.oilNumGunList = response.data
|
||||
})
|
||||
},
|
||||
gocomponents(index){
|
||||
@ -307,6 +551,28 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.but{
|
||||
width: 150px;
|
||||
height: 50px;
|
||||
border-radius: 50px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.amountBlue{
|
||||
color: #00afff;
|
||||
font-weight: bold;
|
||||
}
|
||||
.amount{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 16px;
|
||||
width: 100%;
|
||||
padding: 0 10px;
|
||||
margin: 10px auto;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
background-color: #f6f6f6;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.app-center{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
@ -612,5 +878,38 @@
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
.el-col {
|
||||
border-radius: 2px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
}
|
||||
.bg-purple-dark {
|
||||
background: #eeeeee;
|
||||
}
|
||||
.bg-purple {
|
||||
background: #d3dce6;
|
||||
}
|
||||
.bg-purple-light {
|
||||
background: #e5e9f2;
|
||||
}
|
||||
.grid-content {
|
||||
height: 50px;
|
||||
font-size: 20px;
|
||||
width: 120px;
|
||||
border-radius: 4px;
|
||||
min-height: 36px;
|
||||
}
|
||||
.row-bg {
|
||||
padding: 10px 0;
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user