diff --git a/fuintAdmin/src/api/order/hangbill.js b/fuintAdmin/src/api/order/hangbill.js new file mode 100644 index 000000000..de5533365 --- /dev/null +++ b/fuintAdmin/src/api/order/hangbill.js @@ -0,0 +1,98 @@ +import request from '@/utils/request' + +// 查询挂账信息列表 +export function listHangBill(query) { + return request({ + url: '/business/hangBill/list', + method: 'get', + params: query + }) +} + +// 查询挂账信息列表 +export function hangBillInfo(id) { + return request({ + url: '/business/hangBill/'+id, + method: 'get', + }) +} + +// 查询所有挂账信息列表 +export function hangBills() { + return request({ + url: '/business/hangBill/hangBills', + method: 'get', + }) +} + +// 新增挂账记录 +export function addHangBill(data) { + return request({ + url: '/business/hangBill', + method: 'post', + data: data + }) +} + +// 批量归还挂账信息 +export function batchHangBill(data) { + return request({ + url: '/business/hangBill/batch', + method: 'post', + data: data + }) +} + +// 根据订单号查询挂账记录信息 +export function queryHangBill(data) { + return request({ + url: '/business/hangBill/orderNo', + method: 'post', + data: data + }) +} + +// 修改挂账记录及收款 +export function editHangBill(data) { + return request({ + url: '/business/hangBill', + method: 'put', + data: data + }) +} + +// 当前店铺归还账单的数量 +export function hangBillReturnTotal(query) { + return request({ + url: '/business/hangBill/returnTotal', + method: 'get', + params: query + }) +} + +// 当前店铺归还账单的数量 +export function hangBillAllAmount(query) { + return request({ + url: '/business/hangBill/allAmount', + method: 'get', + params: query + }) +} + +// 当前店铺归还账单的数量 +export function hangBillAllReturnAmount(query) { + return request({ + url: '/business/hangBill/allReturnAmount', + method: 'get', + params: query + }) +} + +// 当前店铺归还账单的数量 +export function hangBillAllNoReturnAmount(query) { + return request({ + url: '/business/hangBill/allNoReturnAmount', + method: 'get', + params: query + }) +} diff --git a/fuintAdmin/src/api/order/returnrecord.js b/fuintAdmin/src/api/order/returnrecord.js new file mode 100644 index 000000000..ab20be3ad --- /dev/null +++ b/fuintAdmin/src/api/order/returnrecord.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +// 根据挂账记录id查询归还记录信息 +export function listReturnRecord(query) { + return request({ + url: '/business/returnRecord/list', + method: 'get', + params: query + }) +} + +// 根据id查询挂账归还信息 +export function returnRecordInfo(id) { + return request({ + url: '/business/returnRecord/' + id, + method: 'get', + }) +} + +// 根据订单号查询挂账归还信息 +export function returnRecordByOrderNo(data) { + return request({ + url: '/business/returnRecord/order', + method: 'post', + data: data + }) +} diff --git a/fuintAdmin/src/api/staff/user/creditunit.js b/fuintAdmin/src/api/staff/user/creditunit.js new file mode 100644 index 000000000..cbe8a1d5e --- /dev/null +++ b/fuintAdmin/src/api/staff/user/creditunit.js @@ -0,0 +1,55 @@ +import request from '@/utils/request' + +// 查询挂账信息列表 +export function listCreditUnit(query) { + return request({ + url: '/business/creditUnit/list', + method: 'get', + params: query + }) +} + +// 查询挂账信息列表 +export function listsCreditUnit(query) { + return request({ + url: '/business/creditUnit/queryList', + method: 'get', + params: query + }) +} + +// 新增挂账记录 +export function addCreditUnit(data) { + return request({ + url: '/business/creditUnit', + method: 'post', + data: data + }) +} + +// 修改挂账记录 +export function editCreditUnit(data) { + return request({ + url: '/business/creditUnit', + method: 'put', + data: data + }) +} + + +// 根据id查询挂账记录 +export function creditUnitInfo(id) { + return request({ + url: '/business/creditUnit/' + id, + method: 'get', + }) +} + + +// 根据id删除挂账记录 +export function deleteCreditUnit(id) { + return request({ + url: '/business/creditUnit/' + id, + method: 'delete', + }) +} diff --git a/fuintAdmin/src/views/convenienceStore/goodsFile.vue b/fuintAdmin/src/views/convenienceStore/goodsFile.vue index 2b53dbbf7..2eceb4425 100644 --- a/fuintAdmin/src/views/convenienceStore/goodsFile.vue +++ b/fuintAdmin/src/views/convenienceStore/goodsFile.vue @@ -8,7 +8,7 @@ - + + + + + + + + @@ -263,7 +265,15 @@ - + + + + 是 + 否 + + + + @@ -403,7 +413,7 @@ export default { // 表单参数 form: { id:'',goodsNo:'',name:'',cvsGoodId:"",buyingPrice:'',retailPrice:"",memberPrice:'',pinyinCode:"", - unit:'',shelfNumber:'',canUsePoint:'no',stock:0,supplierId:'',sort:0,status:'qy' + unit:'',shelfNumber:'',canUsePoint:'no',canUseExchange:'1',stock:0,supplierId:'',sort:0,status:'qy' }, // 显示搜索条件 showSearch: true, @@ -603,11 +613,11 @@ export default { // 搜索按钮操作 handleQuery() { this.queryParams.page = 1; - if (this.cvsGoodId.length==1){ - this.queryParams.cvsGoodId = this.cvsGoodId[0] - }else { - this.queryParams.cvsGoodId = this.cvsGoodId[1] - } + // if (this.cvsGoodId.length==1){ + // this.queryParams.cvsGoodId = this.cvsGoodId[0] + // }else { + // this.queryParams.cvsGoodId = this.cvsGoodId[1] + // } this.getList(); }, // 重置按钮操作 @@ -622,7 +632,7 @@ export default { this.resetForm("form"); this.form= { id:'',goodsNo:'',name:'',cvsGoodId:"",buyingPrice:'',retailPrice:"",memberPrice:'',pinyinCode:"", - unit:'',shelfNumber:'',canUsePoint:'no',stock:0,supplierId:'',sort:0,status:'qy' + unit:'',shelfNumber:'',canUsePoint:'no',canUseExchange:'1',stock:0,supplierId:'',sort:0,status:'qy' } }, // 是否移至回收站 @@ -632,6 +642,7 @@ export default { if (recovery==1){ name = "确定要将此商品移至回收站吗?移出后将无法售卖当前商品!" prompt = "商品已移至回收站,收银台商品信息页面刷新后实时生效!" + form.status = 'jy' }else { name = "确定要将此商品从回收站移至商品档案里吗?移出后将可售卖当前商品!" prompt = "商品已移至商品档案,收银台商品信息页面刷新后实时生效!" @@ -664,20 +675,20 @@ export default { const id = row.id; 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.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.supplierList.forEach(item => { if (item.id == response.data.supplierId){ this.supplier = item.name @@ -709,10 +720,10 @@ export default { } this.$refs["form"].validate(valid => { if (valid) { - if (this.form.stock==0){ - this.$modal.msgError("库存不可为0"); - return; - } + // if (this.form.stock==0){ + // this.$modal.msgError("库存不可为0"); + // return; + // } if (this.form.id) { updateLJGoods(this.form).then(response => { this.$modal.msgSuccess("商品信息更新成功"); diff --git a/fuintAdmin/src/views/convenienceStore/index.vue b/fuintAdmin/src/views/convenienceStore/index.vue index 0a6fe9343..718e82989 100644 --- a/fuintAdmin/src/views/convenienceStore/index.vue +++ b/fuintAdmin/src/views/convenienceStore/index.vue @@ -203,15 +203,15 @@ - - - - - {{ dict.label }} - - - - + + + + + + + + + diff --git a/fuintAdmin/src/views/convenienceStore/stockStatistic.vue b/fuintAdmin/src/views/convenienceStore/stockStatistic.vue index 6547274dd..ca64a0bcc 100644 --- a/fuintAdmin/src/views/convenienceStore/stockStatistic.vue +++ b/fuintAdmin/src/views/convenienceStore/stockStatistic.vue @@ -101,7 +101,7 @@ {{ getName(supplierList, scope.row.supplierId) }} - + {{ getName(cvsGoodList, scope.row.cvsGoodId) }} @@ -116,8 +116,8 @@ - 启用 - 禁用 + 上架 + 下架 @@ -288,6 +288,15 @@ export default { this.getTree(); }, methods: { + getName(list,id){ + let name = "" + list.forEach(item => { + if (item.id==id){ + name = item.name; + } + }) + return name; + }, // 获取分类菜单 getTree(){ cvsGoodsTree().then(response => { diff --git a/fuintAdmin/src/views/member/creditIndex.vue b/fuintAdmin/src/views/member/creditIndex.vue new file mode 100644 index 000000000..2f4842fa2 --- /dev/null +++ b/fuintAdmin/src/views/member/creditIndex.vue @@ -0,0 +1,324 @@ + + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + + 新增挂账单位 + + + + + + + + + + + + + + 启用 + 禁用 + + + + + + {{ parseTime(scope.row.createTime) }} + + + + + 修改 + 删除 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 元 + + + 额度为当前单位最大可挂账金额,如已挂账金额归还,额度将也同步返还 + + + + + + + + + 元 + + + 额度为当前单位最大可挂账金额,如已挂账金额归还,额度将也同步返还 + + + + + + + + + 元 + + + 额度为当前单位最大可挂账金额,如已挂账金额归还,额度将也同步返还 + + + + + + + + + + + + 启用 + 禁用 + + + + + + + 取 消 + 确 定 + + + + + + + + + diff --git a/fuintAdmin/src/views/order/order_Added.vue b/fuintAdmin/src/views/order/order_Added.vue new file mode 100644 index 000000000..c27578aed --- /dev/null +++ b/fuintAdmin/src/views/order/order_Added.vue @@ -0,0 +1,490 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 查询 + 重置 + + + + + + + 统计 + + + + 挂账笔数 + {{ total }} + + + 挂账总额 + {{ allAmount }} + + + 归还笔数 + {{ returnTotal }} + + + 归还总额 + {{ returnAllAmount }} + + + 未还金额 + {{ noReturnAllAmount }} + + + + + + + 挂账订单列表 + + + 导出订单 + + + + + + + + + {{ props.row.mobile }} + + + {{ props.row.updateTime ? props.row.updateTime:"--" }} + + + {{ props.row.remark ? props.row.remark:"--" }} + + + {{ props.row.amount ? props.row.amount:"0" }} + + + {{ props.row.repaidAmount ? props.row.repaidAmount:"0" }} + + + {{ props.row.outstandAmount ? props.row.outstandAmount:"0" }} + + + + + + + + + + + + + + 挂账 + 归还 + + + + + + 未归还 + 已归还 + 部分归还 + + + + + + + + + {{ parseTime(scope.row.createTime) }} + + + + + + 归还详情 + + + + + + + + + + + + + + + + + + + + 单据号:{{record.orderNo}} + + + + + 操作员工: + {{ record.realName }} + + + + + 挂账单位 + {{record.unitName}} + + + 挂账人 + {{record.personCredit}} + + + 联系电话 + {{record.contactMobile}} + + + + + + + + + 挂账 + 归还 + + + + + + + {{ getPayMeth(payList,scope.row.status) }} + + + + + 未支付 + 已支付 + 支付失败 + + + + + + {{ parseTime(scope.row.payTime) }} + + + + + + + + + + + + + + + + + diff --git a/fuintAdmin/src/views/order/order_Cashier.vue b/fuintAdmin/src/views/order/order_Cashier.vue index 8e954ecd2..0d131b3d8 100644 --- a/fuintAdmin/src/views/order/order_Cashier.vue +++ b/fuintAdmin/src/views/order/order_Cashier.vue @@ -83,37 +83,50 @@ - - - - - {{ getRealName(staffList,props.row.staffId) }} - - - {{ getMobile(staffList,props.row.staffId) }} - - - - - - - - - - + + + + + + + + + + + + + + + + + + + {{scope.row.oilOrderAmount ? scope.row.oilOrderAmount : '0'}} - + + + {{scope.row.goodsOrderAmount ? scope.row.goodsOrderAmount : '0'}} + + + + + + + {{scope.row.oilOrderAmount ? scope.row.oilOrderAmount : '0'}} + + + {{scope.row.goodsOrderAmount ? scope.row.goodsOrderAmount : '0'}} - - + + 未支付 已支付 @@ -126,6 +139,11 @@ {{ scope.row.payTime ? parseTime(scope.row.payTime):"--" }} + + + {{ getRealName(staffList,scope.row.staffId) }} + + - - - - - {{ props.row.userId ? queryUser(userList,props.row.userId):"--" }} - - - {{ queryStaf(staffList,props.row.staffId) }} - - - {{ getVal(terminalList,props.row.terminal) }} - - - {{ props.row.remark ? props.row.remark:"--" }} - - - - + + + + + - - - + + + + + + + + + + + + + + + + + {{ getVal(terminalList,props.row.terminal) }} - + - + {{ getName(oilNameList,props.row.oils) }}/{{ getName1(oilGunList,props.row.oilGunNum) }} - - + + - - - - {{ (props.row.orderAmount - props.row.discountAmount - props.row.payAmount).toFixed(2) || 0 }} - 0 - - - - + + + + + {{getType(payList,scope.row.payType)}} @@ -203,6 +200,11 @@ + + + {{scope.row.remark || "--"}} + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java index ed90ecf64..96ffdcdac 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/api/fuyou/service/impl/FyPayServiceImpl.java @@ -262,14 +262,6 @@ public class FyPayServiceImpl implements FyPayService { for (JSONObject jsonObject : jsonObjects) { oilOrderService.addOilTrack(jsonObject,oilOrder.getStoreId()); } -// 修改优惠券使用状态 - if (oilOrder.getCouponId()!=null) { - CardFavorableRecord byId = cardFavorableRecordService.getById(oilOrder.getCouponId()); - if (!ObjectUtil.isEmpty(byId)) { - byId.setStatus("1"); - cardFavorableRecordService.updateById(byId); - } - } } } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/LJGoods.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/LJGoods.java index 827ab6901..9f0d5e230 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/LJGoods.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/LJGoods.java @@ -114,6 +114,10 @@ public class LJGoods extends BaseEntity implements Serializable { * 是否删除:0未删除,1已删除 */ private String ifDelete; + /** + * 可否使用兑换券兑换;0可以,1不可以 + */ + private String canUseExchange; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/LJGoodsMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/LJGoodsMapper.xml index b752fae61..b98818c5e 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/LJGoodsMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/xml/LJGoodsMapper.xml @@ -32,6 +32,9 @@ and mg.status = #{goods.status} + + and mg.can_use_exchange = #{goods.canUseExchange} + and( mg.name like concat('%', #{goods.remark}, '%') diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/CreditUnitController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/CreditUnitController.java index 90ec94daa..c0b6dd8dc 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/CreditUnitController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/CreditUnitController.java @@ -1,5 +1,6 @@ package com.fuint.business.order.controller; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.order.entity.CreditUnit; import com.fuint.business.order.service.CreditUnitService; import com.fuint.framework.web.BaseController; @@ -14,6 +15,30 @@ public class CreditUnitController extends BaseController { @Autowired private CreditUnitService creditUnitService; + /** + * 查询所有挂账单位信息 + * @return + */ + @GetMapping("/queryList") + private ResponseObject queryList(CreditUnit creditUnit, + @RequestParam(value = "page",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){ + Page page =new Page(pageNo,pageSize); + return getSuccessResult(creditUnitService.selectCreditUnitList(page,creditUnit)); + } + + /** + * 查询所有挂账单位信息 + * @return + */ + @GetMapping("/selectList") + private ResponseObject selectList(CreditUnit creditUnit, + @RequestParam(value = "page",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){ + Page page =new Page(pageNo,pageSize); + return getSuccessResult(creditUnitService.selectCreditUnitOrderList(page,creditUnit)); + } + /** * 查询所有挂账单位信息 * @return @@ -32,4 +57,34 @@ public class CreditUnitController extends BaseController { private ResponseObject add(@Validated @RequestBody CreditUnit creditUnit){ return getSuccessResult(creditUnitService.insertCreditUnit(creditUnit)); } + + /** + * 修改挂账单位信息 + * @param creditUnit + * @return + */ + @PutMapping + private ResponseObject edit(@Validated @RequestBody CreditUnit creditUnit){ + return getSuccessResult(creditUnitService.updateCreditUnit(creditUnit)); + } + + /** + * 修改挂账单位信息 + * @param id + * @return + */ + @GetMapping("{id}") + private ResponseObject creditUnitInfo(@PathVariable Integer id){ + return getSuccessResult(creditUnitService.selectCreditUnitById(id)); + } + + /** + * 修改挂账单位信息 + * @param id + * @return + */ + @DeleteMapping("{id}") + private ResponseObject delete(@PathVariable Integer id){ + return getSuccessResult(creditUnitService.deleteCreditUnitById(id)); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/HangBillController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/HangBillController.java index b5d14b75a..9b3a2ed36 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/HangBillController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/controller/HangBillController.java @@ -2,6 +2,7 @@ package com.fuint.business.order.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fuint.business.order.entity.CashierOrder; import com.fuint.business.order.entity.HangBill; import com.fuint.business.order.service.HangBillService; import com.fuint.business.order.vo.HangBillVo; @@ -11,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.Map; /** @@ -135,4 +137,13 @@ public class HangBillController extends BaseController { public ResponseObject returnTotal(){ return getSuccessResult(hangBillService.selectCountReturn()); } + + /** + * 导出订单 + * @param response + */ + @PostMapping("exportExcel") + public void exportExcel(HttpServletResponse response, @RequestBody HangBillVo hangBillVo) { + hangBillService.export(response, hangBillVo); + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/CreditUnit.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/CreditUnit.java index 07d612346..019d20f66 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/CreditUnit.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/entity/CreditUnit.java @@ -1,8 +1,10 @@ package com.fuint.business.order.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fuint.business.order.vo.HangBillVo; import com.fuint.framework.entity.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -10,6 +12,7 @@ import lombok.Data; import java.util.Date; import java.io.Serializable; +import java.util.List; /** * 挂账单位信息表(CreditUnit)实体类 @@ -50,9 +53,17 @@ public class CreditUnit extends BaseEntity implements Serializable { */ private String contactMobile; /** - * 挂账额度 + * 预设挂账额度 */ private Double creditLimit; + /** + * 可使用挂账额度 + */ + private Double usedCreditLimit; + /** + * 剩余挂账额度 + */ + private Double residueCreditLimit; /** * 单据备注 */ @@ -61,6 +72,10 @@ public class CreditUnit extends BaseEntity implements Serializable { * 单位状态:启用禁用 */ private String status; - + /** + * 挂账订单列表 + */ + @TableField(exist = false) + private List hangBillVos; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/CreditUnitMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/CreditUnitMapper.java index 1d39b3b01..135dc366f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/CreditUnitMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/CreditUnitMapper.java @@ -1,10 +1,20 @@ package com.fuint.business.order.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fuint.business.order.entity.CreditUnit; +import org.apache.ibatis.annotations.Param; /** * 挂账单位信息 mapper层 */ public interface CreditUnitMapper extends BaseMapper { + /** + * 根据条件分页查询挂账单位信息 + * @param page + * @param creditUnit + * @return + */ + public IPage selectCreditUnitList(Page page,@Param("creditUnit") CreditUnit creditUnit); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/HangBillMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/HangBillMapper.java index d857d4924..fa3bc5b47 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/HangBillMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/HangBillMapper.java @@ -21,6 +21,12 @@ public interface HangBillMapper extends BaseMapper { */ public IPage selectHangBillList(Page page,@Param("hangBill") HangBillVo hangBill); + /** + * 查询所有挂账记录信息 + * @return + */ + public List selectHangBillsByCreditUnit(@Param("hangBill") HangBillVo hangBill); + /** * 查询所有挂账信息 * @param storeId diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CreditUnitMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CreditUnitMapper.xml new file mode 100644 index 000000000..e9a64d4de --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/CreditUnitMapper.xml @@ -0,0 +1,25 @@ + + + + + + select * from credit_unit + + + and store_id = #{creditUnit.storeId} + + + and status = #{creditUnit.status} + + + and unit_name like concat('%', #{creditUnit.unitName}, '%') + + + and person_credit like concat('%', #{creditUnit.personCredit}, '%') + + + and contact_mobile like concat('%', #{creditUnit.contactMobile}, '%') + + + + \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/HangBillMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/HangBillMapper.xml index b30b80191..d42603c71 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/HangBillMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/mapper/xml/HangBillMapper.xml @@ -36,8 +36,8 @@ and date_format(hb.create_time,'%y%m%d') <= date_format(#{hangBill.params.endTime},'%y%m%d') - order by create_time desc + order by create_time desc @@ -62,4 +62,39 @@ select sum(outstand_amount) from hang_bill where store_id = #{storeId} + + + + hb.store_id = #{hangBill.storeId} + + and hb.status = #{hangBill.status} + + + and hb.return_type = #{hangBill.returnType} + + + and hb.credit_unit_id like concat('%', #{hangBill.creditUnitId}, '%') + + + and cu.unit_name like concat('%', #{hangBill.unitName}, '%') + + + and cu.person_credit like concat('%', #{hangBill.personCredit}, '%') + + + and cu.contact_mobile like concat('%', #{hangBill.contactMobile}, '%') + + + and ms.mobile like concat('%', #{hangBill.mobile}, '%') + + + and date_format(hb.create_time,'%y%m%d') >= date_format(#{hangBill.params.beginTime},'%y%m%d') + + + and date_format(hb.create_time,'%y%m%d') <= date_format(#{hangBill.params.endTime},'%y%m%d') + + + order by create_time desc + \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/CreditUnitService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/CreditUnitService.java index 9a9857417..22af11589 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/CreditUnitService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/CreditUnitService.java @@ -1,5 +1,7 @@ package com.fuint.business.order.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.business.order.entity.CreditUnit; import org.springframework.transaction.annotation.Transactional; @@ -11,12 +13,40 @@ import java.util.List; */ @Transactional public interface CreditUnitService extends IService { + /** + * 根据条件分页查询挂账单位信息 + * @param page + * @param creditUnit + * @return + */ + public IPage selectCreditUnitList(Page page, CreditUnit creditUnit); + + /** + * 根据条件分页查询挂账单位信息和挂账单位下的订单信息 + * @param page + * @param creditUnit + * @return + */ + public IPage selectCreditUnitOrderList(Page page, CreditUnit creditUnit); + /** * 查询所有挂账单位信息 * @return */ public List selectCreditUnitList(); + /** + * 根据id查询挂账单位信息 + * @return + */ + public CreditUnit selectCreditUnitById(Integer id); + + /** + * 根据id删除挂账单位信息 + * @return + */ + public int deleteCreditUnitById(Integer id); + /** * 根据id查询挂账单位信息 * @return diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/HangBillService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/HangBillService.java index bc738c913..e114384b4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/HangBillService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/HangBillService.java @@ -4,10 +4,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.business.order.entity.HangBill; -import com.fuint.business.order.entity.ReturnRecord; import com.fuint.business.order.vo.HangBillVo; import org.springframework.transaction.annotation.Transactional; +import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; @@ -24,6 +24,12 @@ public interface HangBillService extends IService { */ public IPage selectHangBillList(Page page, HangBillVo hangBill); + /** + * 查询所有挂账记录信息 + * @return + */ + public List selectHangBillsByCreditUnit(HangBillVo hangBill); + /** * 查询所有挂账记录信息 * @return @@ -104,4 +110,6 @@ public interface HangBillService extends IService { * @return */ Double selectNoReturnAmount(); + + void export(HttpServletResponse response, HangBillVo hangBill); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/CreditUnitServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/CreditUnitServiceImpl.java index 0c2f4b187..65f76e168 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/CreditUnitServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/CreditUnitServiceImpl.java @@ -1,15 +1,21 @@ package com.fuint.business.order.service.impl; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.order.service.HangBillService; +import com.fuint.business.order.vo.HangBillVo; 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.context.annotation.Lazy; import org.springframework.stereotype.Service; import java.util.List; @@ -18,17 +24,51 @@ import java.util.List; public class CreditUnitServiceImpl extends ServiceImpl implements CreditUnitService { @Autowired private ILJStoreService storeService; + @Autowired + @Lazy + private HangBillService hangBillService; + + @Override + public IPage selectCreditUnitList(Page page, CreditUnit creditUnit) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + creditUnit.setStoreId(nowAccountInfo.getStoreId()); + return baseMapper.selectCreditUnitList(page,creditUnit); + } + + @Override + public IPage selectCreditUnitOrderList(Page page, CreditUnit creditUnit) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + creditUnit.setStoreId(nowAccountInfo.getStoreId()); + IPage creditUnitIPage = baseMapper.selectCreditUnitList(page, creditUnit); + for (CreditUnit record : creditUnitIPage.getRecords()) { + HangBillVo hangBillVo = new HangBillVo(); + hangBillVo.setCreditUnitId(record.getId()); + List hangBillVos = hangBillService.selectHangBillsByCreditUnit(hangBillVo); + record.setHangBillVos(hangBillVos); + } + return creditUnitIPage; + } + @Override public List 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()); + queryWrapper.eq("store_id",nowAccountInfo.getStoreId()); List list = baseMapper.selectList(queryWrapper); return list; } + @Override + public CreditUnit selectCreditUnitById(Integer id) { + return baseMapper.selectById(id); + } + + @Override + public int deleteCreditUnitById(Integer id) { + return baseMapper.deleteById(id); + } + @Override public CreditUnit selectCreditUnitListById(int id) { CreditUnit creditUnit = baseMapper.selectById(id); @@ -41,7 +81,15 @@ public class CreditUnitServiceImpl extends ServiceImpl(); + queryWrapper.eq("unit_name",creditUnit.getUnitName()); + queryWrapper.eq("store_id",store.getId()); + CreditUnit creditUnit1 = baseMapper.selectOne(queryWrapper); + int row = 0; + if (ObjectUtil.isEmpty(creditUnit1)){ + row = baseMapper.insert(creditUnit); + } return row; } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HangBillServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HangBillServiceImpl.java index d5e5b5827..34f73d0fe 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HangBillServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/HangBillServiceImpl.java @@ -1,6 +1,7 @@ package com.fuint.business.order.service.impl; import cn.hutool.core.util.ObjectUtil; +import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -20,12 +21,14 @@ import com.fuint.business.order.service.AllOrderInfoService; import com.fuint.business.order.service.CreditUnitService; import com.fuint.business.order.service.HangBillService; import com.fuint.business.order.service.ReturnRecordService; +import com.fuint.business.order.vo.Excel.CashierOrderExcel; import com.fuint.business.order.vo.HangBillVo; 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 javax.servlet.http.HttpServletResponse; import java.text.SimpleDateFormat; import java.util.*; @@ -46,6 +49,14 @@ public class HangBillServiceImpl extends ServiceImpl i return hangBillVoIPage; } + @Override + public List selectHangBillsByCreditUnit(HangBillVo hangBill) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + Integer storeId = nowAccountInfo.getStoreId(); + hangBill.setStoreId(storeId); + return baseMapper.selectHangBillsByCreditUnit(hangBill); + } + @Override public List selectHangBills() { AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); @@ -280,6 +291,31 @@ public class HangBillServiceImpl extends ServiceImpl i return baseMapper.selectNoReturnAmount(nowAccountInfo.getStoreId()); } + @Override + public void export(HttpServletResponse response, HangBillVo hangBill) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + Integer storeId = nowAccountInfo.getStoreId(); + hangBill.setStoreId(storeId); +// List cashierOrderExcels = baseMapper.selectCashierOrderListExport(hangBill); + + // 设置文件名字 + String fileName = "订单"+System.currentTimeMillis() + ".xlsx"; + + // 设置响应头信息 + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + response.setHeader("Content-disposition", "attachment;filename=demo.xlsx"); + + + try{ + // 写入文件数据 +// EasyExcel.write(response.getOutputStream(), CashierOrderExcel.class).sheet("download").doWrite(cashierOrderExcels); + }catch(Exception e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + /** * 调用支付接口 * @param map diff --git a/fuintCashierWeb/src/api/cashier/creditunit.js b/fuintCashierWeb/src/api/cashier/creditunit.js index f4c8a1dd7..74052fc73 100644 --- a/fuintCashierWeb/src/api/cashier/creditunit.js +++ b/fuintCashierWeb/src/api/cashier/creditunit.js @@ -8,6 +8,14 @@ export function listCreditUnit(query) { params: query }) } +// 查询挂账信息列表 +export function creditUnits(query) { + return request({ + url: '/business/creditUnit/selectList', + method: 'get', + params: query + }) +} // 新增挂账记录 export function addCreditUnit(data) { @@ -17,3 +25,31 @@ export function addCreditUnit(data) { data: data }) } + +// 修改挂账记录 +export function editCreditUnit(data) { + return request({ + url: '/business/creditUnit', + method: 'put', + data: data + }) +} + + +// 根据id查询挂账记录 +export function creditUnitInfo(id) { + return request({ + url: '/business/creditUnit/' + id, + method: 'get', + }) +} + + +// 根据id删除挂账记录 +export function deleteCreditUnit(id) { + return request({ + url: '/business/creditUnit/' + id, + method: 'delete', + }) +} + diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/Order.vue b/fuintCashierWeb/src/views/cashier/NewComponents/Order.vue index c92e418ce..9fc1273ba 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/Order.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/Order.vue @@ -7,10 +7,10 @@ - - - - + + + + @@ -18,10 +18,10 @@ - - - - + + + + diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/credit.vue b/fuintCashierWeb/src/views/cashier/NewComponents/credit.vue index ad02e5344..ebeb2db0b 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/credit.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/credit.vue @@ -5,18 +5,6 @@ 挂账 - - - - - - - - - - - - 列表 - 新增挂账记录 + 新增挂账单位 批量挂账归还 - + - - - {{ props.row.mobile }} - - - {{ props.row.updateTime ? props.row.updateTime:"--" }} - - - {{ props.row.remark ? props.row.remark:"--" }} - - - {{ props.row.amount ? props.row.amount:"0" }} - - - {{ props.row.repaidAmount ? props.row.repaidAmount:"0" }} - - - {{ props.row.outstandAmount ? props.row.outstandAmount:"0" }} - - + + + + + + 挂账 + 归还 + + + + + + 未归还 + 已归还 + 部分归还 + + + + + + + + {{ parseTime(scope.row.createTime) }} + + + + + + 归还 + 归还详情 + + + - - - - - + + + + + + + + + + 启用 + 禁用 + + - - - - 挂账 - 归还 - - - - - - 未归还 - 已归还 - 部分归还 - - - - - - + {{ parseTime(scope.row.createTime) }} - + - - - - - 归还 + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + >修改 归还详情 + icon="el-icon-delete" + @click="handleDelete(scope.row)" + >删除 @@ -218,6 +214,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + 元 - 0为不限额,额度为当前单位最大可挂账金额,如已挂账金额归还,额度将也同步返还 + 额度为当前单位最大可挂账金额,如已挂账金额归还,额度将也同步返还 + + + + + + + + + 元 + + + 额度为当前单位最大可挂账金额,如已挂账金额归还,额度将也同步返还 + + + + + + + + + 元 + + + 额度为当前单位最大可挂账金额,如已挂账金额归还,额度将也同步返还 @@ -683,7 +804,14 @@ import { listHangBill, queryHangBill } from "@/api/cashier/hangbill"; -import {addCreditUnit, listCreditUnit} from "@/api/cashier/creditunit"; +import { + addCreditUnit, + creditUnitInfo, + creditUnits, + deleteCreditUnit, + editCreditUnit, + listCreditUnit +} from "@/api/cashier/creditunit"; import {getDicts} from "@/api/dict/data"; import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/cashier/returnrecord"; @@ -761,6 +889,8 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c hangBillList:[], // 归还记录列表 returnRecordList:[], + // 挂账单位列表 + creditUnitList:[], // 总条数 total: 0, total1: 0, @@ -796,11 +926,11 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c } }, created() { - this.getList(); - this.getUnitList(); + // this.getList(); + // this.getUnitList(); this.getPayList(); this.getLists(); - // this.getStatistic(); + this.getCreditUnits(); }, directives: { // 注册一个局部的自定义指令 v-focus @@ -816,6 +946,34 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c }, }, methods:{ + handleUpdate(data){ + creditUnitInfo(data.id).then(res => { + this.form1 = res.data + this.title = "修改挂账单位" + this.open1 = true + }) + }, + handleDelete(row){ + const name = row.unitName + this.$modal.confirm('确定删除"' + name + '"的挂账单位信息?').then(function() { + // return deleteMember(row.id); + return deleteCreditUnit(row.id); + }).then(() => { + this.queryParams.page = 1 + this.getList(); + this.$modal.msgSuccess("删除成功"); + }).catch(() => {}); + }, + getCreditUnits(val){ + if (val!=undefined){ + this.queryParams.page = val + } + creditUnits().then(res => { + this.creditUnitList = res.data.records + this.total = res.data.total; + }) + + }, // 获取挂账统计信息 getStatistic(){ hangBillReturnTotal(this.addDateRange(this.queryParams, this.dateRange)).then(res => { @@ -1138,11 +1296,31 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c addCredit(){ this.$refs["formName"].validate((valid) => { if (valid) { - addCreditUnit(this.form1).then( response => { - this.$modal.msgSuccess("挂账单位信息创建成功"); - this.open1 = false; - this.getUnitList(); - }) + if (this.form1.id){ + if (this.form1.creditLimit < this.form1.residueCreditLimit){ + this.$modal.msgError("请确保预设挂账额度大于剩余挂账额度"); + return ; + } + editCreditUnit(this.form1).then(res => { + if (res.data==1) { + this.$modal.msgSuccess("挂账单位信息修改成功"); + this.open1 = false; + this.getCreditUnits(); + }else { + this.$modal.msgError("挂账单位信息修改失败"); + } + }) + }else { + addCreditUnit(this.form1).then( response => { + if (response.data==1) { + this.$modal.msgSuccess("挂账单位信息创建成功"); + this.open1 = false; + this.getCreditUnits(); + }else { + this.$modal.msgError("挂账单位信息创建失败,挂站单位名称不可重复"); + } + }) + } }else { return false; } diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue index bc17ee3b1..bcf3d91cb 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue @@ -555,8 +555,8 @@ - - ¥{{member.cardBalance ? member.cardBalance : "--"}} + 余额充值 + ¥{{member.cardBalance ? member.cardBalance : "0"}} {{member.cardBalance ? member.cardBalance : "--"}}元 @@ -567,6 +567,344 @@ + + + + + + + + + + 充值金额 + + + + + {{ item.rechargeBalance }}元 + 赠送{{ item.giftBalance }}元 + + + + + + 自定义 + 元 + + + + + + + + + 赠送金额 + + + 元 + + 赠送金额 仅自定义金额模式下可手动输入赠送、活动充值赠送金额不可手动更改 + + + + + 赠送积分 + + + 积分 + + 赠送积分 仅自定义金额模式下可手动输入,活动充值赠送积分不可手动更改[需开启积分活动有效] + + + + + 赠成长值 + + + 成长值 + + + + + + + 提成员工 + + + 选择员工 + + 仅系统储值档次支持提成员工选择、自定义充值金额匹配低一档次 + + + + + + + + + 充值备注 + + + + + + + + + 支付方式 + + + {{ dict.dictLabel }} + + + + + + + 确认充值 + 取 消 + + + + + + + + 油品类型 + + + {{ item.type }} + + + + + + + + 充值金额 + + + + + {{ item.incomeLitres }}L + 售价{{ item.rechargeBalance }}元 + 锁价{{ item.lockupPrice }}/升 + + + + + + + + + 赠送积分 + + + 积分 + + 升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效] + + + + 提成员工 + + + 选择员工 + + + + + + + + + + 充值备注 + + + + + + + + + 支付方式 + + {{ dict.dictLabel }} + + + + + + + 确认充值 + 取 消 + + + + + + + + + + + + + + + + + + + + + 确认充值 + 取 消 + + + + + + + + + + + + 付款金额 + + ¥{{ realyPayBills }} + + + + + + + + + + + + + + + + + + + + + + + + + + 应找零 + ¥{{ seekZero }} + + + + + 取消收款 + 确定收款 + + + + + + + + 关 闭 + + + + + + + 关 闭 + + + + + + + 关 闭 + + + + + + + + + + + + + + + { + this.sourceCardFuelDieselList = res.data.records + }) + }, + // 储值卡查询 + async getCardValueList() { + let quy = { + pageNo: 1, + pageSize: 10000, + isonline: 0 + } + await getCardValueListApi(quy).then(res => { + this.cardValueList = res.data.records; + this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance); + // console.log("this.grade.name",this.grade) + }) + // console.log("this.cardValueList", this.grade) + + if (this.cardValueList.length > 0) { + // 过滤 + if (this.grade && this.grade.name) { + this.cardValueList = this.cardValueList.filter(item => { + return item.groupOriented === "1" || item.membershipLevel.includes(this.grade.id); + }); + this.rechargeCard(0); + } else { + this.cardValueList = this.cardValueList.filter(item => { + return item.groupOriented === "1"; + }); + if (this.cardValueList.length > 0) { + this.rechargeCard(0); + } + } + } + this.$forceUpdate(); + }, + // 查询参加存油卡油品 + getCountOilType() { + getCountOilTypeApi().then(res => { + this.oilTypeList = res.data + if (this.oilTypeList.length > 0) { + // 默认选中第一个 + this.tabOilType = this.oilTypeList[0].oilType + this.selectOilType(this.oilTypeList[0].status, this.oilTypeList[0].oilType); + } + }) + }, + selectOilType(status, oilType) { + this.tabOilType = oilType; + // console.log("453",oilType) + this.tabOilTypeClick(oilType); + }, + // 会员充值 + async userRecharge() { + if (this.isSure){ + this.$message.error("请先选择会员") + return; + } + + await this.getCardFuelDieselList() + await this.getCardValueList() + await this.getCountOilType() + + await this.getPayList(); + this.openRecharge = true; + + // 存油卡列表 + }, + valueAmoutChange(data) { + // this.cardValueForm.amount = null + this.$set(this.cardValueForm, 'amount', data); + + // console.log("data17.16", this.cardValueForm.amount) + if (!data) { + this.cardValueForm.amount = '' + + } else { + this.cardValueForm.amount = data + } + + + this.cardValueForm.points = '' + this.cardValueForm.bidBalance = '' + this.cardValueForm.giftBalance = '' + this.cardValueForm.growthValue = '' + this.cardValueForm.rechargeBalance = '' + + this.cardValueForm.royaltyType = '' + this.cardValueForm.percentageCommissions = '' + this.cardValueForm.amountCommission = '' + this.cardValueForm.rechargeType = 1 + + + this.cardValueForm.rechargeBalance = data + + if (this.cardValueList.length > 0) { + // const changeList = this.cardValueList + this.cardValueList.forEach(change => { + if (data >= change.rechargeBalance) { + this.cardValueForm.points = change.points + this.cardValueForm.bidBalance = change.bidBalance + this.cardValueForm.giftBalance = change.giftBalance + this.cardValueForm.growthValue = change.growthValue + this.cardValueForm.rechargeBalance = change.rechargeBalance + + this.cardValueForm.royaltyType = change.royaltyType + this.cardValueForm.percentageCommissions = change.percentageCommissions + this.cardValueForm.amountCommission = change.amountCommission + this.cardValueForm.cardValueId = change.id + // this.cardValueForm.rechargeBalance + + // 计算员工提成金额 + if (change.royaltyType === "3") { + // 当按比例提成时 计算对应的金额 + const percentageCommissions = new BigNumber(change.percentageCommissions); + const totalAmount = new BigNumber(data); + + const commissionAmount = totalAmount.multipliedBy(percentageCommissions).dividedBy(100).decimalPlaces(2); + this.cardValueForm.amountCommission = commissionAmount + } + + } + }) + } + }, + async collection1() { + let actualPayment = 0 + let makeChange = 0 + + let userForm = this.member + + if (this.flag === 1) { + if (!this.authCode && this.cardValueForm.paymentType !== "CASH") { + this.$message.error('请先扫码'); + return + }else { + if (this.authCode { + if (response.data != null) { + this.loading = true; + id = response.data.id + } + }); + let this_ = this + // + let timer = setInterval(async () => { + await getCheckTheStatusOfYourPaymentApi(id).then(response => { + if (response.data != null) { + const payStatus = response.data.payStatus + if (payStatus === "unpaid") { + this_.isQuery = true; + }else if (payStatus === "paid") { + // 当支付成功时 + this_.isPaySuccess = true; + this_.isQuery = false; + }else if (payStatus === "payFail") { + this_.isPaySuccess = false; + this_.isQuery = false; + } + } + }) + }, 1000); + + let timer2 = setInterval(function () { + if (!this_.isQuery || !this_.openConfirm) { + this_.loading = false; + this_.isPay = false; + clearInterval(timer); + clearTimeout(timer3); + + } + }, 500) + + var timer3 = setTimeout(function () { + clearInterval(timer2); + clearInterval(timer); + this_.loading = false; + this_.isPay = false; + this_.isPaySuccess = false; + this_.isAwait = true; + console.log("t3") + }, 15000) + + } else if (this.flag === 2) { + if (!this.authCode && this.cardFuelDieselForm.paymentType !== "CASH") { + this.$message.error('请先扫码'); + return + }else { + if (this.authCode { + if (response.data != null) { + this.loading = true; + id = response.data.id + } + }); + + + let timer = setInterval(async () => { + getCheckTheStatusOfYourPaymentByFuelApi(id).then(response => { + if (response.data != null) { + if (response.data.payStatus == "unpaid") { + this_.isQuery = true; + } + if (response.data.payStatus == "paid") { + this_.isPaySuccess = true; + this_.isQuery = false; + } + if (response.data.payStatus == "payFail") { + this_.isPaySuccess = false; + this_.isQuery = false; + } + } + }) + }, 500); + + let timer2 = setInterval(function () { + if (this_.isQuery == false || !this_.openConfirm) { + this_.loading = false; + this_.isPay = false; + clearInterval(timer); + clearInterval(timer2); + } + }, 500) + + setTimeout(function () { + clearInterval(timer2); + clearInterval(timer); + this_.loading = false; + this_.isPay = false; + this_.isPaySuccess = false; + this_.isAwait = true; + + }, 15000) + + let this_ = this + } + this.$forceUpdate(); + + }, + cancelCollection() { + this.openConfirm = false; + }, + // 选择余额充值金额 + rechargeCard(index, item) { + // console.log("index", index) + // this.cardValueForm.amount = null, + this.cardValueForm.rechargeType = 0 + + this.activeKey = index; + + if (item === -1) { + this.cardValueForm.points = 0 + this.cardValueForm.giftBalance = 0 + this.cardValueForm.growthValue = 0 + this.cardValueForm.bidBalance = 0 + + // this.cardValueForm.bidBalance = 1 + // this.cardValueForm.amount = 0 + + } else { + if (this.cardValueList <= 0) return + let file = {} + // 拿到金额 + file = this.cardValueList[index] + + this.realyPayBills = file.rechargeBalance + this.cardValueForm.rechargeBalance = file.rechargeBalance + this.cardValueForm.bidBalance = file.bidBalance + this.cardValueForm.points = file.points + this.cardValueForm.giftBalance = file.giftBalance + this.cardValueForm.growthValue = file.growthValue + this.cardValueForm.cardValueId = file.id + this.cardValueForm.amount = null + + this.cardValueForm.royaltyType = file.royaltyType + this.cardValueForm.percentageCommissions = file.percentageCommissions + this.cardValueForm.amountCommission = file.amountCommission + + // console.log("file.royaltyType ", file.royaltyType ) + + // 计算员工提成金额 + if (file.royaltyType === "3") { + + // 当按比例提成时 计算对应的金额 + const percentageCommissions = new BigNumber(file.percentageCommissions); + const totalAmount = new BigNumber(file.rechargeBalance); + + const commissionAmount = totalAmount.multipliedBy(percentageCommissions).dividedBy(100).decimalPlaces(2); + this.cardValueForm.amountCommission = commissionAmount + } + } + }, + // 根据油品过滤查询存油卡 + async tabOilTypeClick(data) { + // console.log("aaaaaaaaaaaaaa",data) + await this.getCardFuelDieselList() + + this.cardFuelDieselList = this.sourceCardFuelDieselList.filter(item => { + return item.oilType === data; + }); + if (this.cardFuelDieselList.length > 0) { + this.recharge(0) + } + }, + confirm1(){ + this.$refs["form"].validate(valid => { + if (valid) { + giftCardExchange(this.form2).then(res => { + if (res.data.id == '' || res.data.id == null) { + this.$message.error('兑换失败!'); + } else { + this.$message.success('兑换成功!'); + this.openRecharge = false + this.form2.number = '' + this.form2.cardPassword = '' + } + }) + } + }) + }, + // 取消按钮 + cancel1() { + this.openRecharge = false; + + this.isPay = true; + this.openConfirm = false + this.openRecharge = false + + this.isPaySuccess = false; + this.authCode = null + this.activeRecharge = 'balance' + this.cardValueForm = {} + this.cardFuelDieselForm = {} + + this.iniz() + }, + iniz() { + this.cardValueForm = { + cardValueId: '', // 储值卡id + mtStaffId: '', // + realName: '', + staffMobile: '', + amount: '', // 自定义充值字段 + bidBalance: '', // 储值卡面值 + rechargeBalance: '', // 实际支付 + giftBalance: '',// 赠送金额 + points: '', //赠送积分 + growthValue: '', // 赠送成长值 + remark: '', + paymentType: 'WECHAT', // 支付方式 + royaltyType: '',// 提成类型 + percentageCommissions: null, + amountCommission: null, + rechargeType: '0' + } + }, + // 选择充值金额 + recharge(index, item) { + this.activeKey = index; + let file = {} + // 拿到金额 + file = this.cardFuelDieselList[index] + // console.log("file",file) + this.cardFuelDieselForm.points = file.points + this.cardFuelDieselForm.rechargeBalance = file.rechargeBalance + this.cardFuelDieselForm.oilType = file.oilType + this.cardFuelDieselForm.type = file.type + this.cardFuelDieselForm.chainStorId = file.chainStorId + this.cardFuelDieselForm.incomeLitres = file.incomeLitres + this.cardFuelDieselForm.lockupPrice = file.lockupPrice + this.cardFuelDieselForm.cardFuelId = file.id + + // this.realyPayBills = file.rechargeBalance + + }, + // 确认充值 + confirm(flag) { + this.flag = flag + + if (flag === 1) { + if (this.cardValueForm.paymentType === '') { + this.$message.error('请选择支付方式'); + return + } + if (this.cardValueForm.amount != null) { + this.cardValueForm.rechargeType = 1 + if (!this.cardValueForm.amount || this.cardValueForm.amount < 0) { + this.$message.error('请选择输入自定义金额'); + return + } + this.realyPayBills = this.cardValueForm.amount + } else { + this.cardValueForm.rechargeType = 0 + this.realyPayBills = this.cardValueForm.rechargeBalance + } + } else if (flag === 2) { + if (this.cardFuelDieselForm.paymentType === '') { + this.$message.error('请选择支付方式'); + return + } + + this.realyPayBills = this.cardFuelDieselForm.rechargeBalance + } + this.openConfirm = true; + this.isPay = true + + }, async printLocally() { //初始化打印函数 let LODOP = getLodop(); // 初始化打印 @@ -3157,6 +4044,9 @@ background-color: white; + } + .top1 { + font-size: 16px; } .center-left-top{ width: 100%; @@ -3339,6 +4229,9 @@ color: white; cursor: pointer; } + .amount { + color: #00afff; + } .el-row { margin-top: 20px; margin-bottom: 20px; @@ -3382,4 +4275,92 @@ color: grey; font-size: 12px; } + .mon { + width: 20%; + height: 50px; + border: 0.5px #dadfe6 solid; + line-height: 25px; + border-radius: 5px; + text-align: center; + margin: 0 10px; + margin-bottom: 10px; + } + .amount1 { + color: #00afff; + font-size: 20px; + } + .select { + position: relative; + background-color: #fff; + box-shadow: 0px 2px 7px 0px rgba(85, 110, 97, 0.35); + border-radius: 5px; + border: 1px solid #00aaff; + } + + .select:before { + content: ''; + position: absolute; + right: 0; + bottom: 0; + border: 10px solid #00aaff; + border-top-color: transparent; + border-left-color: transparent; + } + .select:after { + content: ''; + width: 4px; + height: 6px; + position: absolute; + right: 4px; + bottom: 3px; + border: 2px solid #fff; + border-top-color: transparent; + border-left-color: transparent; + transform: rotate(45deg); + } + .jine { + width: 24%; + display: flex; + } + + .bom { + font-size: 12px; + color: grey; + height: 60px !important; + line-height: 12px !important; + } + + .zeng { + width: 255px; + line-height: 40px; + font-size: 14px; + } + .mon2 { + width: 20%; + height: 75px; + border: 0.5px #dadfe6 solid; + line-height: 25px; + border-radius: 5px; + text-align: center; + margin: 0 10px; + margin-bottom: 20px; + } + .box{ + width: 200px; + box-sizing: border-box; + padding: 10px; + background: #f9f9f9; + height: 86px; + margin-right: 10px; + } + .size-hui{ + font-size: 14px; + margin-bottom: 10px; + margin-top: 10px; + color: grey; + } + .size-bole{ + font-weight: 400; + font-size: 20px; + } diff --git a/fuintCashierWeb/src/views/cashier/index.vue b/fuintCashierWeb/src/views/cashier/index.vue index da62b9949..33dc18236 100644 --- a/fuintCashierWeb/src/views/cashier/index.vue +++ b/fuintCashierWeb/src/views/cashier/index.vue @@ -263,11 +263,11 @@ export default { activeName: 'second', tabarr:[ {name:'收银台',icon:'el-icon-s-platform',path:'/homeindex'}, - {name:'充值',icon: 'el-icon-s-finance',path:'/Recharge'}, + // {name:'充值',icon: 'el-icon-s-finance',path:'/Recharge'}, {name:'订单',icon: 'el-icon-s-order',path:'/Order'}, {name:'会员',icon: 'el-icon-s-custom',path:'/Vip'}, {name:'核销',icon: 'el-icon-s-check',path:'/WriteOff'}, - {name:'挂账',icon:'el-icon-s-claim',path:'/credit'}, + {name:'挂账管理',icon:'el-icon-s-claim',path:'/credit'}, {name:'积分',icon:'el-icon-s-data',path:'/Integral'}, {name:'交班',icon: 'el-icon-s-flag',path:'/Handover'}, ], diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Added.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Added.vue index 2d77cd51f..f207e6b7a 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Added.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Added.vue @@ -1,116 +1,174 @@ + - - - - - - - - - - 搜索 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 查询 + 重置 + + + - 增值交易统计 + 统计 - - 订单总数 - 55 + + 挂账笔数 + {{ total }} + + + 挂账总额 + {{ allAmount }} + + + 归还笔数 + {{ returnTotal }} + + + 归还总额 + {{ returnAllAmount }} + + + 未还金额 + {{ noReturnAllAmount }} - + - 增值交易列表 + 挂账订单列表 - 新增会员 + 导出订单 - - - {{ props.row.name }} + + + {{ props.row.mobile }} + + + {{ props.row.updateTime ? props.row.updateTime:"--" }} + + + {{ props.row.remark ? props.row.remark:"--" }} + + + {{ props.row.amount ? props.row.amount:"0" }} + + + {{ props.row.repaidAmount ? props.row.repaidAmount:"0" }} + + + {{ props.row.outstandAmount ? props.row.outstandAmount:"0" }} - + + + + + - - + + + + 挂账 + 归还 + - + + + + 未归还 + 已归还 + 部分归还 + - + + - - - - - - - - - - - - - - - - - - - - - + + + + {{ parseTime(scope.row.createTime) }} + @@ -118,87 +176,253 @@ 更多操作 - + @click="returnRecord(scope.row.id)" + >归还详情 - + :total="total" + :page.sync="queryParams.page" + :limit.sync="queryParams.pageSize" + @current-change="getList"> + + + + + + + + + 单据号:{{record.orderNo}} + + + + + 操作员工: + {{ record.realName }} + + + + + 挂账单位 + {{record.unitName}} + + + 挂账人 + {{record.personCredit}} + + + 联系电话 + {{record.contactMobile}} + + + + + + + + + 挂账 + 归还 + + + + + + + {{ getPayMeth(payList,scope.row.status) }} + + + + + 未支付 + 已支付 + 支付失败 + + + + + + {{ parseTime(scope.row.payTime) }} + + + + + + + + + + + diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue index 5630a3b3e..4a3fb4c93 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Cashier.vue @@ -19,27 +19,27 @@ + - - - - - - - - - - - - 至 - - + + + + + + + + + + 搜索 @@ -94,18 +94,19 @@ - - - - - {{ getRealName(staffList,props.row.staffId) }} - - - {{ getMobile(staffList,props.row.staffId) }} - - - - + + + + + + + + + + + + + @@ -123,19 +124,19 @@ - + {{scope.row.oilOrderAmount ? scope.row.oilOrderAmount : '0'}} - + {{scope.row.goodsOrderAmount ? scope.row.goodsOrderAmount : '0'}} - + 未支付 @@ -154,7 +155,7 @@ {{ getRealName(staffList,scope.row.staffId) }} - + { const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }); this.$download.saveAs(blob,'收银台订单统计.xLsx') @@ -449,8 +452,8 @@ import {formatDate} from "@/utils"; // 获取订单统计信息 getOrderStatistics() { - this.dateRange.push(this.beginTime) - this.dateRange.push(this.endTime) + // this.dateRange.push(this.beginTime) + // this.dateRange.push(this.endTime) orderStatisticsApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{ this.orderStatistics = res.data }) @@ -681,6 +684,16 @@ import {formatDate} from "@/utils"; this.goodsInfo = response.data; }) }, + parseTime1(dateTime) { + let date = new Date(dateTime); + let y = date.getFullYear() + "-"; + let mon = ((date.getMonth() + 1 < 10) ? ('0' + date.getMonth()) : date.getMonth()) + "-"; + let d = ((date.getDate() < 10) ? ('0' + date.getDate()) : date.getDate()) + " "; + let h = ((date.getHours() < 10) ? ('0' + date.getHours()) : date.getHours()) + ":"; + let m = ((date.getMinutes() < 10) ? ('0' + date.getMinutes()) : date.getMinutes()) + ":"; + let s = ((date.getSeconds() < 10) ? ('0' + date.getSeconds()) : date.getSeconds()); + return new Date(y , mon , d , h , m , s); + }, // 获取列表信息 getList(val){ if (val!=undefined){ @@ -690,17 +703,17 @@ import {formatDate} from "@/utils"; let time1 = "" let time2 = "" if (this.beginTime && this.endTime){ - let beginTime = this.beginTime.getTime() - let endTime = this.endTime.getTime() - // time1 = formatDate(beginTime, 'yyyy-MM-dd') - // time2 = formatDate(endTime, 'yyyy-MM-dd') - time1 = new Date(beginTime) - time2 = new Date(endTime) - this.$modal.msgError(time1) + // let beginTime = this.beginTime.getTime() + // let endTime = this.endTime.getTime() + time1 = this.parseTime1(this.beginTime) + time2 = this.parseTime1(this.endTime) } + let dateRange = [] // this.$modal.msgError() - this.dateRange.push(time1) - this.dateRange.push(time2) + // dateRange.push(time1.toString()) + // dateRange.push(time2.toString()) + // this.$modal.msgError(this.dateRange.toString()) + // this.dateRange = dateRange.toString() listCashierOrder(this.addDateRange(this.queryParams, this.dateRange)).then( response => { this.orderList = response.data.records; this.total = response.data.total; @@ -711,8 +724,8 @@ import {formatDate} from "@/utils"; if (val!=undefined){ this.queryParams.page = val } - this.dateRange.push(this.beginTime) - this.dateRange.push(this.endTime) + // this.dateRange.push(this.beginTime) + // this.dateRange.push(this.endTime) cashierOrderSeekZeroAmount(this.addDateRange(this.queryParams, this.dateRange)).then( response => { if (response.data) { this.seekZeroAmount = response.data diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue index 3f508b3ba..d96908255 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue @@ -53,7 +53,7 @@ size="medium" value-format="yyyy-MM-dd" type="daterange" - range-separator="-" + range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" > diff --git a/fuintCashierWeb/src/views/cashier/orderComponents/order_Oil.vue b/fuintCashierWeb/src/views/cashier/orderComponents/order_Oil.vue index a49998111..46aed4334 100644 --- a/fuintCashierWeb/src/views/cashier/orderComponents/order_Oil.vue +++ b/fuintCashierWeb/src/views/cashier/orderComponents/order_Oil.vue @@ -73,7 +73,7 @@ size="medium" value-format="yyyy-MM-dd" type="daterange" - range-separator="-" + range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" > @@ -142,54 +142,51 @@ v-loading="loading" :data="oilOrderList" style="width: 100%"> - - - - - {{ props.row.userId ? queryUser(userList,props.row.userId):"--" }} - - - {{ queryStaf(staffList,props.row.staffId) }} - - - {{ getVal(terminalList,props.row.terminal) }} - - - {{ props.row.remark ? props.row.remark:"--" }} - - - - + + + + + - - - + + + + + + + + + + + + + + + + + {{ getVal(terminalList,props.row.terminal) }} - + - + {{ getName(oilNameList,props.row.oils) }}/{{ getName1(oilGunList,props.row.oilGunNum) }} - - + + - - - - {{ (props.row.orderAmount - props.row.discountAmount - props.row.payAmount).toFixed(2) || 0 }} - 0 - - - - + + + + + {{getType(payList,scope.row.payType)}} @@ -204,6 +201,11 @@ + + + {{scope.row.remark || "--"}} + + diff --git a/gasStation-uni/pagesRefuel/orderDetail/index.vue b/gasStation-uni/pagesRefuel/orderDetail/index.vue index 08f56135a..30b545ea7 100644 --- a/gasStation-uni/pagesRefuel/orderDetail/index.vue +++ b/gasStation-uni/pagesRefuel/orderDetail/index.vue @@ -311,7 +311,7 @@ activeId:this.preferentialData.activeId, cardFavorableId:this.preferentialData.cardFavorableId, type:this.preferentialData.type, - balanceAmount:this.balanceRedece, + balanceAmountSale:this.balanceRedece, oilCardAmountSale:this.oilCardRedece, }; let _this = this;