This commit is contained in:
cun-nan 2024-01-12 13:55:40 +08:00
parent 101375930c
commit 4ed6ba6e8c
13 changed files with 153 additions and 86 deletions

View File

@ -20,11 +20,19 @@ export function selectTree(data) {
// 联级选择器 树形数据结构
export function cvsGoodsTree() {
return request({
url: '/business/cvsGoods/tree',
method: 'get',
})
}
return request({
url: '/business/cvsGoods/tree',
method: 'get',
})
}
// 联级选择器 树形数据结构
export function cvsGoodsAll() {
return request({
url: '/business/cvsGoods',
method: 'get',
})
}
// 查询一级分类
export function list(data) {

View File

@ -11,14 +11,6 @@
:options="cvsGoodOptions"
:props="{ checkStrictly: true }"
clearable></el-cascader>
<!-- <el-select-->
<!-- v-model="queryParams.cvsGoodId"-->
<!-- placeholder="全部"-->
<!-- clearable-->
<!-- style="width: 300px"-->
<!-- >-->
<!-- <el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>-->
<!-- </el-select>-->
</el-form-item>
<el-form-item label="供应商" prop="supplierId">
<el-select
@ -201,14 +193,18 @@
</el-col>
<el-col :span="12">
<el-form-item label="所属分类" prop="cvsGoodId">
<el-select
v-model="form.cvsGoodId"
placeholder="全部"
clearable
style="width: 300px"
>
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
<!-- <el-select-->
<!-- v-model="form.cvsGoodId"-->
<!-- placeholder="全部"-->
<!-- clearable-->
<!-- style="width: 300px"-->
<!-- >-->
<!-- <el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>-->
<!-- </el-select>-->
<el-cascader v-model="cvsGoodId"
:options="cvsGoodOptions"
:props="{ checkStrictly: true }"
clearable></el-cascader>
</el-form-item>
</el-col>
</el-row>
@ -331,7 +327,7 @@
<script>
import {cvsGoodsTree, selectTree} from "@/api/convenienceStore/goods";
import {cvsGoodsAll, cvsGoodsTree, selectTree} from "@/api/convenienceStore/goods";
import {addSupplier, listSupplier} from "@/api/convenienceStore/supplier";
import {
addLJGoods,
@ -357,7 +353,7 @@ export default {
//
supplier:"",
// id
cvsGoodId:"",
cvsGoodId:[],
cvsGoodOptions:[],
isAdd:false,
activeName: 'goods',
@ -567,8 +563,8 @@ export default {
},
//
getQueryList(){
selectTree().then(response => {
this.cvsGoodList = response.data.records
cvsGoodsAll().then(response => {
this.cvsGoodList = response.data
});
},
getSuppilers(val){
@ -656,6 +652,21 @@ export default {
const id = row.id || this.ids;
getLJGoods(id).then(response => {
this.form = response.data;
this.cvsGoodOptions.forEach(item => {
if (item.value == response.data.cvsGoodId){
this.cvsGoodId.push(item.value)
}else {
if (item.children.length>0){
item.children.forEach(i => {
if (i.value == response.data.cvsGoodId){
this.cvsGoodId.push(item.value)
this.cvsGoodId.push(i.value)
}
})
}
}
})
// this.cvsGoodId = response.data.cvsGoodId
this.open = true;
this.isAdd = true;
this.title = "编辑商品";
@ -674,6 +685,11 @@ export default {
},
//
submitForm: function() {
if (this.cvsGoodId.length==1){
this.form.cvsGoodId = this.cvsGoodId[0]
}else {
this.form.cvsGoodId = this.cvsGoodId[1]
}
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.stock==0){

View File

@ -54,6 +54,15 @@ public class CvsGoodsController extends BaseController {
return getSuccessResult(list);
}
/**
* 查询当前店铺所有分类信息
* @return
*/
@GetMapping
public ResponseObject selectAll(){
return getSuccessResult(cvsGoodsService.selectCvsGoods());
}
//查询一级菜单
@PostMapping("/list")
public ResponseObject list(CvsGoods goods)

View File

@ -36,6 +36,12 @@ public interface CvsGoodsService extends IService<CvsGoods> {
*/
List<CvsGoods> selectCvsGoodsList(CvsGoods goods);
/**
* 查询当前店铺所有分类信息
* @return
*/
List<CvsGoodsTree> selectCvsGoods();
/**
* 联级选择器 树形数据结构
* @return

View File

@ -126,6 +126,14 @@ public class CvsGoodsServiceImpl extends ServiceImpl<CvsGoodsMapper,CvsGoods> im
return baseMapper.selectList(queryWrapper);
}
@Override
public List<CvsGoodsTree> selectCvsGoods() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
return baseMapper.selectList(queryWrapper);
}
/**
* 联级选择器 树形数据结构
* @return

View File

@ -29,6 +29,14 @@ public class CreditUnit extends BaseEntity implements Serializable {
@ApiModelProperty("自增ID")
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
/**
* 店铺id
*/
private Integer storeId;
/**
* 连锁店id
*/
private Integer chainStoreId;
/**
* 单位名称
*/

View File

@ -45,9 +45,10 @@
</where>
</select>
<select id="selectHangBills" resultType="com.fuint.business.order.vo.HangBillVo" parameterType="int">
<include refid="selectHangBill"></include>
select hb.*,cu.unit_name,cu.person_credit,cu.contact_mobile,cu.credit_limit from hang_bill hb
left join credit_unit cu on hb.credit_unit_id = cu.id
<where>
hb.store_id = #{storeId}
hb.store_id = #{storeId} and hb.status!=1
</where>
</select>
</mapper>

View File

@ -5,16 +5,26 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.order.entity.CreditUnit;
import com.fuint.business.order.mapper.CreditUnitMapper;
import com.fuint.business.order.service.CreditUnitService;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CreditUnitServiceImpl extends ServiceImpl<CreditUnitMapper, CreditUnit> implements CreditUnitService {
@Autowired
private ILJStoreService storeService;
@Override
public List<CreditUnit> selectCreditUnitList() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status","qy");
queryWrapper.eq("chain_store_id",store.getChainStoreId());
List<CreditUnit> list = baseMapper.selectList(queryWrapper);
return list;
}
@ -27,6 +37,10 @@ public class CreditUnitServiceImpl extends ServiceImpl<CreditUnitMapper, CreditU
@Override
public int insertCreditUnit(CreditUnit creditUnit) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
creditUnit.setStoreId(store.getId());
creditUnit.setChainStoreId(store.getChainStoreId());
int row = baseMapper.insert(creditUnit);
return row;
}

View File

@ -306,6 +306,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setStatus(payStatus);
if (payType.equals("CASH")){
cashierOrder.setPayTime(new Date());
this.insertAllOrderInfo(orderNo,storeId,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid");
}
cashierOrder.setOrderNo(orderNo);
cashierOrder.setGoodsOrderAmount(goodsAmount);
@ -408,6 +409,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
orders.put("goodsOrder",goodsOrder1);
cashierOrder.setGoodsOrderId(goodsOrder1.getId());
}
orders.put("orderNo",orderNo);
cashierOrderService.insertCashierOrder(cashierOrder);
return orders;
}
@ -522,10 +524,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setOilOrderId(oilOrder.getId());
cashierOrderService.insertCashierOrder(cashierOrder);
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId);
// this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"applet");
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"PC","1","paid");
res.put("success","success");
} else {
String status = "unpaid";
if (ObjectUtil.isNotEmpty(refuelMoneys)){
for (Object refuelMoney : refuelMoneys) {
@ -542,7 +545,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
boolean flag = false;
for (int i = 0;i < oilOrders.size();i++) {
if (oilOrders.get(i).get("oilName").equals(oilName.getId().toString())){
if (refuelMoneyLiters>=Double.valueOf(oilOrders.get(i).get("liters").toString())){
if (refuelMoneyLiters>=Double.valueOf(oilOrders.get(i).get("liters").toString())) {
status = "paid";
flag = true;
Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
@ -570,7 +574,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
order.setPayUser(userVo1.getMobile());
order.setPayType(map.get("payType"));
order.setInvoicing("未开票");
order.setOrderStatus("paid");
order.setOrderStatus(status);
order.setPayTime(new Date());
this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId());
@ -582,15 +586,15 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setPayUser(userVo1.getMobile());
cashierOrder.setAmount(oilAmount);
cashierOrder.setPayAmount(oilAmount);
cashierOrder.setStatus("paid");
cashierOrder.setStatus(status);
cashierOrder.setPayTime(new Date());
cashierOrder.setOrderNo(orderNo);
cashierOrder.setOilOrderAmount(oilAmount);
// cashierOrder.setOilDiscountAmount(Double.valueOf(map.get("oilDiscount")));
cashierOrder.setTerminal(map.get("terminal"));
cashierOrder.setOilOrderId(oilOrder.getId());
this.updateGrowthValue1(0.0,userId, Integer.valueOf(oilOrder.getOils()),refuelMoneyLiters-Double.valueOf(oilOrders.get(i).get("liters").toString()),storeId);
this.updateGrowthValue1(0.0, userId, Integer.valueOf(oilOrder.getOils()), refuelMoneyLiters - Double.valueOf(oilOrders.get(i).get("liters").toString()), storeId);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, map.get("payType"), userId, "PC", "1", status);
}
}else {
res.put("error","囤油卡余额不足!");
@ -619,17 +623,21 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
/**
* 添加所有订单信息
*/
private void insertAllOrderInfo(String orderNo,Integer storeId,Double goodsMoney,String payType,Integer userId,String payChannel){
private void insertAllOrderInfo(String orderNo,Integer storeId,Double goodsMoney,String payType,Integer userId,String payChannel,String type,String status){
AllOrderInfo allOrderInfo = new AllOrderInfo();
allOrderInfo.setOrderNo(orderNo);
allOrderInfo.setType("1");
allOrderInfo.setType(type);
allOrderInfo.setStoreId(storeId);
allOrderInfo.setGoodsMoney(goodsMoney);
allOrderInfo.setPayType(payType);
allOrderInfo.setUserId(userId);
allOrderInfo.setPayChannel(payChannel);
allOrderInfo.setStatus("paid");
allOrderInfo.setContent("油品订单");
allOrderInfo.setStatus(status);
if (type.equals("1")){
allOrderInfo.setContent("油品订单");
}else {
allOrderInfo.setContent("收银台订单");
}
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
}
@ -880,6 +888,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
userId = cardValudChildrens.getUserId();
}
this.updateGrowthValue(oilOrder.getPayAmount(),userId, Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId());
this.addOilTracks(oilOrder,oilOrder.getStoreId());
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
if (ObjectUtil.isNotEmpty(cashierOrder)){
cashierOrder.setPayTime(new Date());

View File

@ -20,7 +20,7 @@ export function cashierOrder(id) {
// 根据订单号查询油品订单信息
export function cashierOrderByOrderNo(data) {
return request({
url: '/business/oilOrder/orderNo',
url: '/business/cashierOrder/orderNo',
method: 'post',
data: data
})

View File

@ -543,7 +543,10 @@
<el-dialog title="批量挂账归还" :visible.sync="open3" append-to-body>
<el-form ref="form3" :model="form3">
<el-form-item>
<el-input placeholder="请输入挂账单位、挂账人、挂账人手机号检索" v-model="unitName" class="input-with-select">
<el-input placeholder="请输入挂账单位、挂账人、挂账人手机号检索"
v-model="unitName"
@keyup.enter.native="getRepayList"
clearable class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="getRepayList">查询</el-button>
</el-input>
</el-form-item>
@ -556,37 +559,15 @@
height="300"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
label="单据号"
prop="orderNo"
width="120">
</el-table-column>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="单据号" prop="orderNo" width="120"></el-table-column>
<el-table-column label="挂账方详情">
<el-table-column
prop="unitName"
label="单位">
</el-table-column>
<el-table-column
prop="personCredit"
label="姓名">
</el-table-column>
<el-table-column
prop="contactMobile"
label="电话">
</el-table-column>
</el-table-column>
<el-table-column
prop="amount"
label="挂账金额">
</el-table-column>
<el-table-column
prop="outstandAmount"
label="未归还金额">
<el-table-column prop="unitName" label="单位"></el-table-column>
<el-table-column prop="personCredit" label="姓名"></el-table-column>
<el-table-column prop="contactMobile" label="电话"></el-table-column>
</el-table-column>
<el-table-column prop="amount" label="挂账金额"></el-table-column>
<el-table-column prop="outstandAmount" label="未归还金额"></el-table-column>
<el-table-column
prop="repaidAmount"
label="归还金额"
@ -607,7 +588,7 @@
:total="total1"
:page.sync="queryParam.page"
:limit.sync="queryParam.pageSize"
@current-change="getList">
@current-change="getLists">
</el-pagination>
</div>
<div style="display: flex;height: 36px">
@ -620,7 +601,7 @@
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="open3 = false"> </el-button>
<el-button type="primary" @click="batchSub"> </el-button>
<el-button :disabled="amount==0" type="primary" @click="batchSub"> </el-button>
</span>
</el-dialog>
@ -646,6 +627,7 @@
@input="changePayType">
<el-radio v-for="item in payList"
:key="item.dictValue"
v-if="item.dictValue!='APPLET_CODE'"
:value="item.dictValue"
:label="item.dictValue" border>{{ item.dictLabel }}</el-radio>
</el-radio-group>
@ -910,21 +892,22 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
getRepayList(){
let result = [];
this.form3.unitName = this.unitName;
let str = this.form3.unitName
let str = this.unitName
this.list.forEach(item => {
if (item.returnType==0){
if (item.unitName.includes(str)){
item.repaidAmount = item.outstandAmount
result.push(item)
}
if (item.personCredit.includes(str)){
item.repaidAmount = item.outstandAmount
result.push(item)
}
if (item.contactMobile.includes(str)){
item.repaidAmount = item.outstandAmount
result.push(item)
}
if (item.unitName.includes(str)){
item.repaidAmount = item.outstandAmount
result.push(item)
return;
}
if (item.personCredit.includes(str)){
item.repaidAmount = item.outstandAmount
result.push(item)
return;
}
if (item.contactMobile.includes(str)){
item.repaidAmount = item.outstandAmount
result.push(item)
return;
}
})
this.repayList = result
@ -932,6 +915,10 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
getLists(){
hangBills().then(response => {
this.list = response.data;
this.repayList = response.data;
for (let i = 0; i<response.data.length;i++){
this.repayList[i].repaidAmount = response.data[i].outstandAmount
}
})
},
handleChange(value) {

View File

@ -1933,7 +1933,7 @@
_this.preferentialData.oilPrice = item1.oilPrice;
_this.preferentialData.oilLiters = item1.liters;
_this.couponDiscount =[];
_this.couponIds = [],
_this.couponIds = [];
selectCoupon(_this.preferentialData).then(response => {
// console.log(response)
_this.couponAmount = 0;
@ -2668,6 +2668,7 @@
_this.goodsOrder = []
_this.amount = 0
};
this.userNo = ""
this.map = {
allAmount:0,
//

View File

@ -214,7 +214,7 @@
//
getMember(){
request({
url: "business/userManager/user/storeUser/" + this.storeId,
url: "business/userManager/user/storeUserInfo/" + this.storeId,
method: 'get',
}).then((res) => {
this.member = res.data