This commit is contained in:
cun-nan 2024-10-29 15:40:39 +08:00
parent abdad63b26
commit 581cefa9b3
7 changed files with 179 additions and 178 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<!-- 搜索框-->
<div class="card-change" >
<div class="card-change">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="" prop="name">
<el-input
@ -36,113 +36,115 @@
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="" prop="supplierId">-->
<!-- <el-select-->
<!-- v-model="queryParams.supplierId"-->
<!-- placeholder="供应商"-->
<!-- clearable-->
<!-- style=""-->
<!-- >-->
<!-- <el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="" prop="pinyinCode">-->
<!-- <el-input-->
<!-- v-model="queryParams.pinyinCode"-->
<!-- placeholder="拼音码"-->
<!-- clearable-->
<!-- style=""-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="" prop="goodsNo">-->
<!-- <el-input-->
<!-- v-model="queryParams.goodsNo"-->
<!-- placeholder="条形码"-->
<!-- clearable-->
<!-- style=""-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="" prop="shelfNumber">-->
<!-- <el-input-->
<!-- v-model="queryParams.shelfNumber"-->
<!-- placeholder="货架号"-->
<!-- clearable-->
<!-- style=""-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="" prop="status">-->
<!-- <el-select-->
<!-- v-model="queryParams.status"-->
<!-- placeholder="上架状态"-->
<!-- clearable-->
<!-- style=""-->
<!-- >-->
<!-- <el-option label="上架" value="qy"/>-->
<!-- <el-option label="下架" value="jy"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="" prop="supplierId">-->
<!-- <el-select-->
<!-- v-model="queryParams.supplierId"-->
<!-- placeholder="供应商"-->
<!-- clearable-->
<!-- style=""-->
<!-- >-->
<!-- <el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="" prop="pinyinCode">-->
<!-- <el-input-->
<!-- v-model="queryParams.pinyinCode"-->
<!-- placeholder="拼音码"-->
<!-- clearable-->
<!-- style=""-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="" prop="goodsNo">-->
<!-- <el-input-->
<!-- v-model="queryParams.goodsNo"-->
<!-- placeholder="条形码"-->
<!-- clearable-->
<!-- style=""-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="" prop="shelfNumber">-->
<!-- <el-input-->
<!-- v-model="queryParams.shelfNumber"-->
<!-- placeholder="货架号"-->
<!-- clearable-->
<!-- style=""-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="" prop="status">-->
<!-- <el-select-->
<!-- v-model="queryParams.status"-->
<!-- placeholder="上架状态"-->
<!-- clearable-->
<!-- style=""-->
<!-- >-->
<!-- <el-option label="上架" value="qy"/>-->
<!-- <el-option label="下架" value="jy"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item style="float: right;">
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button type="primary" @click="dialogVisible = true"
v-hasPermi="['convenienceStore:stockStatistic:ex']"
>导出</el-button>
>导出
</el-button>
</el-form-item>
</el-form>
<div style="display: flex;justify-content: space-between">
</div>
<el-table ref="tables" v-loading="loading" :data="list"
@selection-change="handleSelectionChange" :default-sort="defaultSort"
@sort-change="handleSortChange">
<el-table-column type="index" width="80" align="center" label="序号"/>
<el-table-column label="商品名称" align="center" prop="name" width="160" />
<el-table-column label="品类名称" align="center" prop="cvsGoodId" width="160">
<template slot-scope="scope">
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
</template>
</el-table-column>
<el-table-column label="条形码" align="center" prop="goodsNo" width="160" />
<el-table-column label="供应商" align="center" prop="supplierId">
<template slot-scope="scope">
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template>
</el-table-column>
<el-table-column label="货架号" align="center" prop="shelfNumber" />
<el-table-column label="商品规格" align="center" prop="description" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="零售价" align="center" prop="retailPrice" />
<el-table-column label="当前库存" align="center" prop="stock" />
<el-table-column label="货损量" align="center" prop="stock" />
<el-table-column label="当前成本价" align="center" prop="buyingPrice" />
<el-table-column label="成本总金额" align="center" prop="costAmount" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<div v-if="scope.row.status=='qy'" style="color: #0DC291">已上架</div>
<div v-if="scope.row.status=='jy'" style="color: #F44522">已下架</div>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="updateTime" width="200"></el-table-column>
<el-table-column label="操作时间" align="center" prop="updateTime" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="trace(scope.row)"
>库存跟踪</el-button>
</template>
</el-table-column>
</el-table>
<div style="height: 71vh;overflow: auto">
<el-table ref="tables" v-loading="loading" :data="list" border
@selection-change="handleSelectionChange" :default-sort="defaultSort"
@sort-change="handleSortChange">
<el-table-column type="index" width="60" align="center" label="序号"/>
<el-table-column label="商品名称" align="center" prop="name"/>
<el-table-column label="品类名称" align="center" prop="cvsGoodId" >
<template slot-scope="scope">
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
</template>
</el-table-column>
<el-table-column label="条形码" align="center" prop="goodsNo" />
<el-table-column label="供应商" align="center" prop="supplierId">
<template slot-scope="scope">
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template>
</el-table-column>
<el-table-column label="货架号" align="center" prop="shelfNumber"/>
<el-table-column label="商品规格" align="center" prop="goodsSpecs"/>
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="零售价" align="center" prop="retailPrice"/>
<el-table-column label="当前库存" align="center" prop="stock"/>
<el-table-column label="当前成本价" align="center" prop="buyingPrice"/>
<el-table-column label="成本总金额" align="center" prop="costAmount"/>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<div v-if="scope.row.status=='qy'" style="color: #0DC291">已上架</div>
<div v-if="scope.row.status=='jy'" style="color: #F44522">已下架</div>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" prop="realName"></el-table-column>
<el-table-column label="操作时间" align="center" prop="updateTime" width="200">
<template slot-scope="scope">
<span>{{ scope.row.updateTime ? parseTime(scope.row.updateTime) : parseTime(scope.row.createTime)}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="trace(scope.row)"
>库存跟踪
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
@ -154,54 +156,32 @@
<el-drawer
title="库存跟踪"
title="库存跟踪记录"
:visible.sync="drawer"
direction="rtl"
size="50%"
:before-close="handleClose">
<div style="display: grid; place-items: center;">
<el-card class="box-card" style="background-color: #f5f5f5">
<div slot="header" class="clearfix">
<div style="position: relative;">
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
<h2>{{form.name}}</h2>
</div>
</div>
<br>
<div style="display: flex; justify-content: space-between;">
<span>拼音码</span>
<span>{{ form.pinyinCode }}</span>
</div>
</div>
<div >
<div style="margin-top:-5px;display: flex; justify-content: space-between;">
<h3>库存数量</h3>
<h3>{{form.stock}}{{form.unit}}</h3>
</div>
<div style="display: flex; justify-content: space-between;">
<span>更新时间</span>
<span>{{ form.updateTime }}</span>
</div>
</div>
</el-card>
<el-card class="box-card" style="margin-top: 15px">
<el-table ref="tables"
<div style="width: 96%;margin: 0 auto">
<div style="display: flex;">
<div>商品名称{{ form.name }}</div>
<div style="margin: 0 50px;">品类名称{{ getName(cvsGoodList, form.cvsGoodId) }}</div>
<div>当前库存{{ form.stock }}{{ form.unit }}</div>
<div style="margin: 0 50px;">更新时间{{ form.updateTime }}</div>
</div>
<div style="margin-top: 15px">
<el-table ref="tables" border
v-loading="loading"
:data="trackList"
:default-sort="defaultSort">
<el-table-column
lable="#"
type="index"
>
</el-table-column>
<el-table-column label="序号" align="center" type="index" > </el-table-column>
<el-table-column label="订单号" align="center" prop="oddNumber"/>
<el-table-column label="类型" align="center" prop="document"/>
<el-table-column label="变动数量" align="center" prop="changeNumber"/>
<el-table-column label="库存更新时间" align="center" prop="createTime" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="单据" align="center" prop="document" />
<el-table-column label="单号" align="center" prop="oddNumber" />
<el-table-column label="变动数量" align="center" prop="changeNumber" />
</el-table>
<pagination
v-show="total1>0"
@ -210,7 +190,7 @@
:limit.sync="queryParam.pageSize"
@pagination="getTrackList"
/>
</el-card>
</div>
</div>
</el-drawer>
@ -225,7 +205,7 @@
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="exportStock">
<!-- <a href="/dev-api/business/convenience/stockStatistic/export"> </a>-->
<!-- <a href="/dev-api/business/convenience/stockStatistic/export"> </a>-->
</el-button>
</span>
</el-dialog>
@ -245,8 +225,8 @@ export default {
data() {
return {
// id
cvsGoodId:"",
cvsGoodOptions:[],
cvsGoodId: "",
cvsGoodOptions: [],
dialogVisible: false,
//
showSearch: true,
@ -270,12 +250,12 @@ export default {
page: 1,
pageSize: 10,
id: '',
stockId:'',
stockId: '',
},
//
cvsGoodList:[],
cvsGoodList: [],
//
supplierList:[],
supplierList: [],
//
list: [],
trackList: [],
@ -288,7 +268,7 @@ export default {
defaultSort: {prop: 'createTime', order: 'descending'},
//
drawer: false,
form:{},
form: {},
}
},
created() {
@ -297,32 +277,32 @@ export default {
this.getTree();
},
methods: {
getName(list,id){
getName(list, id) {
let name = "--"
console.log(list)
list.forEach(item => {
if (item.id==id){
if (item.id == id) {
name = item.name;
}
})
return name;
},
//
getTree(){
getTree() {
cvsGoodsTree().then(response => {
this.cvsGoodOptions = response.data
})
},
//
exportStock(){
exportStock() {
exportStocks(this.queryParams).then(response => {
const blob = new Blob([response], { type: 'application/json' })
this.$download.saveAs(blob,'商品-库存统计.xlsx')
const blob = new Blob([response], {type: 'application/json'})
this.$download.saveAs(blob, '商品-库存统计.xlsx')
})
this.dialogVisible = false
},
//
getTrackList(){
getTrackList() {
this.loading = true;
listTrack(this.queryParam).then(response => {
this.trackList = response.data.records;
@ -332,7 +312,7 @@ export default {
},
//
trace(data) {
this.drawer=true
this.drawer = true
getStock(data.id).then(response => {
this.form = response.data
})
@ -364,7 +344,7 @@ export default {
this.getList();
},
//
getQueryList(){
getQueryList() {
list().then(response => {
this.cvsGoodList = response.data
});
@ -401,25 +381,28 @@ export default {
</script>
<style scoped lang="scss">
.app-container{
width: 100%;
height: 100%;
background: #f6f8f9;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
.app-container {
width: 100%;
height: 100%;
background: #f6f8f9;
}
.box-card {
width: 90%;
}
.el-form--inline .el-form-item {
margin-right: 44px;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
.box-card {
width: 90%;
}
.el-form--inline .el-form-item {
margin-right: 44px;
}
</style>

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.convenienceSore.mapper.SaleStatisticMapper">
<sql id="selectSale">
select sa.*,mg.name,mg.goods_no,mg.pinyin_code,mg.unit,mg.goods_specs,cg.name pinLeiName from sale_statistic sa
select sa.*,mg.name,mg.goods_no,mg.pinyin_code,mg.unit,mg.goods_specs,mg.cvs_good_id,cg.name pinLeiName from sale_statistic sa
left join mt_goods mg on sa.goods_id = mg.id
left join cvs_goods cg on mg.cvs_good_id = cg.id
</sql>
@ -20,6 +20,9 @@
<if test="sale.goodsNo != null and sale.goodsNo != ''">
and mg.goods_no like concat('%', #{sale.goodsNo}, '%')
</if>
<if test="sale.cvsGoodId != null and sale.cvsGoodId != ''">
and mg.cvs_good_id = #{sale.cvsGoodId}
</if>
</where>
</select>
<select id="selectSales" resultType="com.fuint.business.convenienceSore.vo.SaleStatisticVo"

View File

@ -4,8 +4,9 @@
<sql id="selectStock">
select st.id, mg.supplier_id, mg.cvs_good_id, st.goods_id, st.store_id, st.cost_amount, mg.status,
mg.name,mg.goods_no,mg.pinyin_code,mg.shelf_number,
mg.retail_price,mg.unit,mg.stock,mg.buying_price,mg.update_time
mg.retail_price,mg.unit,mg.stock,mg.buying_price,mg.update_time,mg.goods_specs,ta.real_name
from stock_statistic st left join mt_goods mg on st.goods_id = mg.id
left join t_account ta on st.update_by = ta.acct_id
</sql>
<select id="selectStockList" resultType="com.fuint.business.convenienceSore.vo.StockStatisticVo">

View File

@ -21,6 +21,8 @@ public class SaleStatisticVo extends BaseEntity {
private Integer storeId;
// 商品id
private Integer goodsId;
// 品类id
private Integer cvsGoodId;
// 商品名称
@ExcelProperty(value = "商品名称")
private String name;

View File

@ -27,6 +27,9 @@ public class StockStatisticVo extends BaseEntity {
// 拼音码
@ExcelProperty(value = "拼音码")
private String pinyinCode;
// 商品规格
@ExcelProperty(value = "商品规格")
private String goodsSpecs;
// 货架号
@ExcelProperty(value = "货架号")
private String shelfNumber;
@ -47,4 +50,6 @@ public class StockStatisticVo extends BaseEntity {
private Double costAmount;
// 状态
private String status;
// 操作人
private String realName;
}

View File

@ -2,6 +2,7 @@ package com.fuint.pay.util;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionRecord;
import com.fuint.business.marketingActivity.activePrice.entity.ActivePriceOil;
@ -249,13 +250,19 @@ public class CheckUtil {
**/
public Boolean checkTimeConsumption(String type, String timeSlots, String startTime, String endTime, Date nowDate) {
String timeSlotsStr = timeSlots;
if ("0".equals(type)) {
if ("0".equals(type) && ObjectUtil.isNotEmpty(timeSlots)) {
//周几汉字转数字
timeSlotsStr = changeWeekNumber(timeSlots);
}
List<String> timeSlotStrList = Arrays.asList(timeSlotsStr.split(StrUtil.COMMA));
List<String> timeSlotStrList = new ArrayList<>();
if (ObjectUtil.isNotEmpty(timeSlotsStr)){
timeSlotStrList = Arrays.asList(timeSlotsStr.split(StrUtil.COMMA));
}
//转换为int类型
List<Integer> timeSlotList = timeSlotStrList.stream().map(Integer::parseInt).collect(Collectors.toList());
List<Integer> timeSlotList = new ArrayList<>();
if (ObjectUtil.isNotEmpty(timeSlotStrList)) {
timeSlotList = timeSlotStrList.stream().map(Integer::parseInt).collect(Collectors.toList());
}
if (timeSlotStrList.isEmpty() && (StringUtils.isNotEmpty(startTime) || StringUtils.isNotEmpty(endTime))) {
//没有设置时间段但是生效时间又设置了代表每天的某个时间范围
return checkDayTime(nowDate, startTime, endTime);
@ -268,7 +275,7 @@ public class CheckUtil {
if (0 == nowWeek) {
nowWeek = 7;
}
if (timeSlotList.contains(nowWeek)) {
if (ObjectUtil.isNotEmpty(timeSlotList) && timeSlotList.contains(nowWeek)) {
//周几是符合的进而判断时间是否符合
return checkDayTime(nowDate, startTime, endTime);
} else {
@ -278,7 +285,7 @@ public class CheckUtil {
//活动设置的适用时间类型是每月
//结算时间是每月几号
int nowDay = DateUtil.dayOfMonth(nowDate);
if (timeSlotList.contains(nowDay)) {
if (ObjectUtil.isNotEmpty(timeSlotList) && timeSlotList.contains(nowDay)) {
//每月几号是符合的进而判断时间是否符合
return checkDayTime(nowDate, startTime, endTime);
} else {

View File

@ -22,7 +22,7 @@
</div>
<div v-if="chooseVipUser.fleetMember">
<div>
车队卡{{ chooseVipUser.fleetMember.secondaryCardLimit }}
车队卡{{ chooseVipUser.fleetMember.remainingCreditLimit }}
</div>
</div>
<img slot="reference" src="./imgs/kbao.png" style="width: 24px;height: 24px;margin-right: 10px">
@ -2097,7 +2097,7 @@ export default {
}
this.accountPending = true
}
if (value == 'car_card_value') {
if (value == 'card_value' || value == 'fule_card' || value == 'car_card_value') {
if (!this.userInfo) {
this.$message.error("请先选择会员")
return