This commit is contained in:
cun-nan 2024-03-02 16:41:18 +08:00
parent 8db3256bb5
commit 9d869e404f
15 changed files with 345 additions and 154 deletions

View File

@ -215,21 +215,30 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="供应商" prop="supplierId"> <el-form-item label="供应商" prop="supplierId">
<el-autocomplete <el-select
popper-class="my-autocomplete" v-model="form1.supplierId"
style="width: 94%" filterable
v-model="supplier" placeholder="请选择供应商"
:fetch-suggestions="querySearch" clearable
placeholder="供应商名称,如果是未添加的供应商,输完名称点回车即可自动添加" style="width: 80%">
@change="addSupplier" <el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
@select="selectSupplier"> </el-select>
<template slot-scope="{ item }"> <el-button type="info" plain @click="handleAdd1">添加供应商</el-button>
<div style="display: flex;justify-content: space-between"> <!-- <el-autocomplete-->
<span class="name">{{ item.name }}</span> <!-- popper-class="my-autocomplete"-->
<!-- <span class="addr">{{ item.memberPrice }}</span>--> <!-- style="width: 94%"-->
</div> <!-- v-model="supplier"-->
</template> <!-- :fetch-suggestions="querySearch"-->
</el-autocomplete> <!-- placeholder="供应商名称,如果是未添加的供应商,输完名称点回车即可自动添加"-->
<!-- @change="addSupplier"-->
<!-- @select="selectSupplier">-->
<!-- <template slot-scope="{ item }">-->
<!-- <div style="display: flex;justify-content: space-between">-->
<!-- <span class="name">{{ item.name }}</span>-->
<!-- &lt;!&ndash; <span class="addr">{{ item.memberPrice }}</span>&ndash;&gt;-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-autocomplete>-->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -264,6 +273,44 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :close-on-click-modal="false" :title="title" width="600px" style="margin-top: 5%" :visible.sync="open2" append-to-body>
<el-form ref="form2" :model="form2" :rules="rules2" label-width="90px">
<el-row>
<el-col :span="24">
<el-form-item label="供应商" prop="name" style="width: 420px">
<el-input v-model="form2.name" placeholder="请输入供应商名称" maxlength="30" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="联系人" prop="contacts">
<el-input v-model="form2.contacts" placeholder="供应商联系人" maxlength="30"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="mobile">
<el-input v-model="form2.mobile" placeholder="供应商联系电话" maxlength="30"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="联系地址" prop="address">
<el-input v-model="form2.address" placeholder="供应商联系地址" maxlength="30" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark">
<el-input v-model="form2.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm2"> </el-button>
<el-button @click="open2 = false"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -280,7 +327,7 @@ import {getAccount} from "@/api/system/account";
import {addLJGoods, createGoodsNo, queryGoodsVoList, queryLJGoods, scanCode} from "@/api/convenienceStore/ljgoods"; import {addLJGoods, createGoodsNo, queryGoodsVoList, queryLJGoods, scanCode} from "@/api/convenienceStore/ljgoods";
import pinyin from "js-pinyin"; import pinyin from "js-pinyin";
import {getSysConfig} from "@/api/staff/user/sysconfig"; import {getSysConfig} from "@/api/staff/user/sysconfig";
import {addSupplier, listSuppliers} from "@/api/convenienceStore/supplier"; import {addSupplier, listSuppliers, updateSupplier} from "@/api/convenienceStore/supplier";
export default { export default {
dicts:['zhzt','yes_or_no'], dicts:['zhzt','yes_or_no'],
data() { data() {
@ -290,6 +337,7 @@ export default {
title: "", title: "",
// //
open: false, open: false,
open2: false,
openGoods: false, openGoods: false,
// //
loading: true, loading: true,
@ -340,6 +388,7 @@ export default {
sort:0, sort:0,
buyingPrice:0,retailPrice:0,memberPrice:0 buyingPrice:0,retailPrice:0,memberPrice:0
}, },
form2:{},
tableData: [{ tableData: [{
id: '', id: '',
pid:'', pid:'',
@ -385,13 +434,19 @@ export default {
{ required: true, message: "请选择是否能使用积分抵扣", trigger: "blur" }, { required: true, message: "请选择是否能使用积分抵扣", trigger: "blur" },
], ],
supplierId: [ supplierId: [
{ required: true, message: "请选择供应商", trigger: "blur" }, { required: true, message: "请选择供应商", trigger: "change" },
], ],
status: [ status: [
{ required: true, message: "请选择商品状态", trigger: "blur" }, { required: true, message: "请选择商品状态", trigger: "blur" },
], ],
}, },
//
rules2: {
name: [
{ required: true, message: "供应商名称不能为空", trigger: "blur" },
],
}
}; };
}, },
@ -402,6 +457,35 @@ export default {
this.getSuppilers(); this.getSuppilers();
}, },
methods: { methods: {
//
submitForm2: function() {
this.$refs["form2"].validate(valid => {
if (valid) {
if (!this.form2.id) {
addSupplier(this.form2).then(response => {
if (response.data==1){
this.$modal.msgSuccess("供应商新增成功");
this.open2 = false;
this.getSuppilers();
}else {
this.$modal.msgError("供应商名称已存在");
}
});
}
}
});
},
//
handleAdd1() {
this.reset2();
this.open2 = true;
this.title = "新增供应商";
},
//
reset2() {
this.resetForm("form2");
this.form2= {}
},
getSuppilers(val){ getSuppilers(val){
listSuppliers({ifDelete:'0'}).then(response => { listSuppliers({ifDelete:'0'}).then(response => {
this.supplierList = response.data this.supplierList = response.data

View File

@ -419,7 +419,13 @@ export default {
let unitPrice = new BigNumber( data.unitPrice); let unitPrice = new BigNumber( data.unitPrice);
let subtotalAmount = new BigNumber(data.subtotalAmount); let subtotalAmount = new BigNumber(data.subtotalAmount);
if (flag == 1) {
data.subtotalAmount = quantityPurchased.times(unitPrice) data.subtotalAmount = quantityPurchased.times(unitPrice)
}
if (flag == 2) {
data.subtotalAmount = quantityPurchased.times(unitPrice)
}
if (flag == 3) { if (flag == 3) {
data.unitPrice = subtotalAmount.dividedBy(quantityPurchased); data.unitPrice = subtotalAmount.dividedBy(quantityPurchased);

View File

@ -412,7 +412,13 @@ export default {
let returnPrice = new BigNumber( data.returnPrice); let returnPrice = new BigNumber( data.returnPrice);
let subtotalAmount = new BigNumber(data.subtotalAmount); let subtotalAmount = new BigNumber(data.subtotalAmount);
if (flag == 1) {
data.subtotalAmount = returnQuantity.times(returnPrice) data.subtotalAmount = returnQuantity.times(returnPrice)
}
if (flag == 2) {
data.subtotalAmount = returnQuantity.times(returnPrice)
}
if (flag == 3) { if (flag == 3) {
data.returnPrice = subtotalAmount.dividedBy(returnQuantity); data.returnPrice = subtotalAmount.dividedBy(returnQuantity);

View File

@ -207,6 +207,7 @@ export default {
methods: { methods: {
// //
exportSale(){ exportSale(){
this.dateRange = []
if (this.beginTime && this.endTime) { if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString()) this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString()) this.dateRange.push(this.endTime.toLocaleDateString())
@ -221,6 +222,7 @@ export default {
detail(data){ detail(data){
this.table = true; this.table = true;
this.queryParam.saleId = data.id; this.queryParam.saleId = data.id;
this.dateRange = []
if (this.beginTime && this.endTime) { if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString()) this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString()) this.dateRange.push(this.endTime.toLocaleDateString())
@ -234,6 +236,7 @@ export default {
// //
getList(){ getList(){
this.loading = true; this.loading = true;
this.dateRange = []
if (this.beginTime && this.endTime) { if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString()) this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString()) this.dateRange.push(this.endTime.toLocaleDateString())

View File

@ -28,17 +28,30 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="时间"> <el-form-item label="时间">
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- style="width: 240px"-->
<!-- size="medium"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="daterange"-->
<!-- range-separator="-"-->
<!-- clearable-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<el-date-picker <el-date-picker
v-model="dateRange" v-model="beginTime"
style="width: 240px" style="width: 160px"
size="medium" type="date"
value-format="yyyy-MM-dd" placeholder="开始日期">
type="daterange" </el-date-picker>
range-separator="-"
clearable <el-date-picker
start-placeholder="开始日期" v-model="endTime"
end-placeholder="结束日期" style="width: 160px"
></el-date-picker> type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -166,6 +179,8 @@ export default {
}, },
loading: false, loading: false,
dateRange: [], dateRange: [],
beginTime:new Date(),
endTime:new Date(),
defaultSort: {prop: 'createTime', order: 'descending'}, defaultSort: {prop: 'createTime', order: 'descending'},
total: 0, total: 0,
@ -187,6 +202,11 @@ export default {
}, },
methods: { methods: {
async getList(){ async getList(){
this.dateRange = []
if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString())
}
await getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{ await getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
this.dataList = res.data.records this.dataList = res.data.records
this.total = res.data.total this.total = res.data.total
@ -197,6 +217,11 @@ export default {
this.$forceUpdate() this.$forceUpdate()
}, },
getStatistics() { getStatistics() {
this.dateRange = []
if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString())
}
getStatisticsApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{ getStatisticsApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
this.statisticsForm = res.data this.statisticsForm = res.data
}) })
@ -218,6 +243,8 @@ export default {
pageSize:10 pageSize:10
}, },
this.dateRange = [] this.dateRange = []
this.beginTime = ""
this.endTime = ""
this.getList() this.getList()
this.getStatistics(); this.getStatistics();

View File

@ -34,17 +34,30 @@
</el-form-item> </el-form-item>
<el-form-item label="注册时间"> <el-form-item label="注册时间">
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- style="width: 240px"-->
<!-- size="medium"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="daterange"-->
<!-- range-separator="-"-->
<!-- clearable-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<el-date-picker <el-date-picker
v-model="dateRange" v-model="beginTime"
style="width: 240px" style="width: 160px"
size="medium" type="date"
value-format="yyyy-MM-dd" placeholder="开始日期">
type="daterange" </el-date-picker>
range-separator="-"
clearable <el-date-picker
start-placeholder="开始日期" v-model="endTime"
end-placeholder="结束日期" style="width: 160px"
></el-date-picker> type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -214,6 +227,8 @@ export default {
openOutcome: false, // openOutcome: false, //
// //
dateRange: [], dateRange: [],
beginTime:"",
endTime:"",
defaultSort: {prop: 'createTime', order: 'descending'}, defaultSort: {prop: 'createTime', order: 'descending'},
statisticsForm: { statisticsForm: {
@ -240,6 +255,11 @@ export default {
}, },
methods: { methods: {
async getList(){ async getList(){
this.dateRange = []
if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString())
}
await getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{ await getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
this.dataList = res.data.records this.dataList = res.data.records
this.total = res.data.total this.total = res.data.total
@ -282,6 +302,8 @@ export default {
pageSize:10 pageSize:10
}, },
this.dateRange = [] this.dateRange = []
this.beginTime = ""
this.endTime = ""
this.getList() this.getList()
}, },

View File

@ -340,31 +340,31 @@
<el-form-item label="订单号"> <el-form-item label="订单号">
<el-input v-model="queryParams2.orderNo" placeholder="请输入订单号"></el-input> <el-input v-model="queryParams2.orderNo" placeholder="请输入订单号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <!-- <el-form-item label="创建时间">-->
<!--&lt;!&ndash; <el-date-picker&ndash;&gt;-->
<!--&lt;!&ndash; v-model="dateRange"&ndash;&gt;-->
<!--&lt;!&ndash; style="width: 240px"&ndash;&gt;-->
<!--&lt;!&ndash; size="medium"&ndash;&gt;-->
<!--&lt;!&ndash; value-format="yyyy-MM-dd"&ndash;&gt;-->
<!--&lt;!&ndash; type="daterange"&ndash;&gt;-->
<!--&lt;!&ndash; range-separator="-"&ndash;&gt;-->
<!--&lt;!&ndash; start-placeholder="开始日期"&ndash;&gt;-->
<!--&lt;!&ndash; end-placeholder="结束日期"&ndash;&gt;-->
<!--&lt;!&ndash; ></el-date-picker>&ndash;&gt;-->
<!-- <el-date-picker--> <!-- <el-date-picker-->
<!-- v-model="dateRange"--> <!-- v-model="beginTime"-->
<!-- style="width: 240px"--> <!-- style="width: 160px"-->
<!-- size="medium"--> <!-- type="date"-->
<!-- value-format="yyyy-MM-dd"--> <!-- placeholder="开始日期">-->
<!-- type="daterange"--> <!-- </el-date-picker>-->
<!-- range-separator="-"--> <!-- -->
<!-- start-placeholder="开始日期"--> <!-- <el-date-picker-->
<!-- end-placeholder="结束日期"--> <!-- v-model="endTime"-->
<!-- ></el-date-picker>--> <!-- style="width: 160px"-->
<el-date-picker <!-- type="date"-->
v-model="beginTime" <!-- placeholder="结束日期">-->
style="width: 160px" <!-- </el-date-picker>-->
type="date" <!-- </el-form-item>-->
placeholder="开始日期">
</el-date-picker>
<el-date-picker
v-model="endTime"
style="width: 160px"
type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery1">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery1">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery1">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery1">重置</el-button>
@ -526,6 +526,7 @@ export default {
methods:{ methods:{
getStaffCommissionList(){ getStaffCommissionList(){
this.loading = true this.loading = true
this.dateRange = []
if (this.beginTime && this.endTime) { if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString()) this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString()) this.dateRange.push(this.endTime.toLocaleDateString())
@ -618,6 +619,7 @@ export default {
// //
getCommissionList(){ getCommissionList(){
this.loading = true; this.loading = true;
this.dateRange = []
if (this.beginTime && this.endTime) { if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString()) this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString()) this.dateRange.push(this.endTime.toLocaleDateString())

View File

@ -439,6 +439,11 @@ public class FyPayServiceImpl implements FyPayService {
try { try {
// 查询商户配置信息 // 查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId()); MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId());
if (ObjectUtil.isEmpty(merchantConfig)){
res.put("code","error");
res.put("msg","暂未配置商户信息");
return res;
}
// MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(16); // MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(16);
// 查询用户信息 // 查询用户信息
LJUserVo userVo = userService.selectUserById(receiveParameter.getUserId(), receiveParameter.getStoreId()); LJUserVo userVo = userService.selectUserById(receiveParameter.getUserId(), receiveParameter.getStoreId());

View File

@ -28,6 +28,7 @@ import com.fuint.business.marketingActivity.activeFullminus.vo.ActiveFullminusVO
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO; import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelChange;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord; import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord;
import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelRecordMapper; import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelRecordMapper;
import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord; import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord;
@ -335,7 +336,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 根据店铺id查询商户配置信息 // 根据店铺id查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId); MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId);
if (ObjectUtil.isEmpty(merchantConfig)){ if (ObjectUtil.isEmpty(merchantConfig) && !payType.equals("CASH") && !payType.equals("credit") &&
!map.get("allAmount").equals("0")){
orders.put("error","请先配置支付通道"); orders.put("error","请先配置支付通道");
return orders; return orders;
} }
@ -493,7 +495,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setAfterDiscountAmount(oilAmount+goodsAmount-oilDiscount-goodsDiscount); cashierOrder.setAfterDiscountAmount(oilAmount+goodsAmount-oilDiscount-goodsDiscount);
// 如果金额不等于0调用第三方支付接口 // 如果金额不等于0调用第三方支付接口
if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH") || !payType.equals("credit")){ if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH") && !payType.equals("credit")){
Integer allAmount = (int) (Double.valueOf(map.get("allAmount"))*100); Integer allAmount = (int) (Double.valueOf(map.get("allAmount"))*100);
// 判断是否开启支付规则 // 判断是否开启支付规则
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId); List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId);
@ -1392,31 +1394,44 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
LJStore store = storeService.selectStoreByStoreId(storeId); LJStore store = storeService.selectStoreByStoreId(storeId);
UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId()); UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId());
int growth = balance.getGrowthValue(); int growth = balance.getGrowthValue();
if (refuelMoney==null){ // if (refuelMoney==null){
// String refuelMoney1 = balance.getRefuelMoney();
// if (ObjectUtil.isNotEmpty(refuelMoney1) && ObjectUtil.isNotEmpty(refuelMoney)){
// JSONArray objects = JSONArray.parseArray(refuelMoney);
// JSONArray objects1 = JSONArray.parseArray(refuelMoney1);
// List<RefuelMoney> list = new ArrayList<>();
// for (int i = 0;i<objects.size();i++){
// if (((JSONObject)objects.get(i)).get("oilType").toString().equals(oilId)){
// RefuelMoney refuelMoney2 = new RefuelMoney();
// refuelMoney2.setType(((JSONObject) objects.get(i)).get("type").toString());
// refuelMoney2.setOilType(((JSONObject) objects.get(i)).get("oilType").toString());
// refuelMoney2.setRefuelMoney(((JSONObject) objects.get(i)).get("refuelMoney").toString());
// list.add(refuelMoney2);
// Double oilBalance = 0.0;
// Double afterOilBalance = 0.0;
// if (!refuelMoney1.equals(refuelMoney)){
// oilBalance = Double.valueOf(((JSONObject) objects1.get(i)).get("refuelMoney").toString()) - Double.valueOf(((JSONObject) objects.get(i)).get("refuelMoney").toString());
// afterOilBalance = Double.valueOf(((JSONObject) objects.get(i)).get("refuelMoney").toString());
// this.insertOilBalance(userid,storeId,oilName.getId().toString(),oilName.getOilType(),oilBalance,afterOilBalance,orderNo);
// }
// }
// }
// balance.setRefuelMoney(JSONObject.toJSONString(list));
// }
// }else {
// balance.setRefuelMoney(refuelMoney);
// }
if (ObjectUtil.isNotEmpty(refuelMoney)){
String refuelMoney1 = balance.getRefuelMoney(); String refuelMoney1 = balance.getRefuelMoney();
if (StringUtils.isNotEmpty(refuelMoney1) && !"null".equals(refuelMoney1) && StringUtils.isNotEmpty(refuelMoney)){
JSONArray objects = JSONArray.parseArray(refuelMoney); JSONArray objects = JSONArray.parseArray(refuelMoney);
JSONArray objects1 = JSONArray.parseArray(refuelMoney1); JSONArray objects1 = JSONArray.parseArray(refuelMoney1);
List<RefuelMoney> list = new ArrayList<>(); for (int i = 0;i<objects1.size();i++){
for (int i = 0;i<objects.size();i++){ if (!((JSONObject)objects1.get(i)).get("refuelMoney").toString().equals(((JSONObject)objects.get(i)).get("refuelMoney").toString())){
if (((JSONObject)objects.get(i)).get("oilType").toString().equals(oilId)){ Double oilBalance = Double.valueOf(((JSONObject) objects1.get(i)).get("refuelMoney").toString()) - Double.valueOf(((JSONObject) objects.get(i)).get("refuelMoney").toString());
RefuelMoney refuelMoney2 = new RefuelMoney(); Double afterOilBalance = Double.valueOf(((JSONObject) objects.get(i)).get("refuelMoney").toString());
refuelMoney2.setType(((JSONObject) objects.get(i)).get("type").toString());
refuelMoney2.setOilType(((JSONObject) objects.get(i)).get("oilType").toString());
refuelMoney2.setRefuelMoney(((JSONObject) objects.get(i)).get("refuelMoney").toString());
list.add(refuelMoney2);
Double oilBalance = 0.0;
Double afterOilBalance = 0.0;
if (!refuelMoney1.equals(refuelMoney)){
oilBalance = Double.valueOf(((JSONObject) objects1.get(i)).get("refuelMoney").toString()) - Double.valueOf(((JSONObject) objects.get(i)).get("refuelMoney").toString());
afterOilBalance = Double.valueOf(((JSONObject) objects.get(i)).get("refuelMoney").toString());
this.insertOilBalance(userid,storeId,oilName.getId().toString(),oilName.getOilType(),oilBalance,afterOilBalance,orderNo); this.insertOilBalance(userid,storeId,oilName.getId().toString(),oilName.getOilType(),oilBalance,afterOilBalance,orderNo);
} }
} }
}
balance.setRefuelMoney(JSONObject.toJSONString(list));
}
}else {
balance.setRefuelMoney(refuelMoney); balance.setRefuelMoney(refuelMoney);
} }
// 查询会员等级列表信息 // 查询会员等级列表信息

View File

@ -91,8 +91,8 @@ public class ChainStoreInfoServiceImpl extends ServiceImpl<ChainStoreInfoMapper,
public boolean theJudgmentIsTheSame(Integer chainStoreId) { public boolean theJudgmentIsTheSame(Integer chainStoreId) {
if (ObjectUtil.isEmpty(chainStoreId)) return false; if (ObjectUtil.isEmpty(chainStoreId)) return false;
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
if (ObjectUtil.isEmpty(nowAccountInfo)) return true; if (ObjectUtil.isEmpty(nowAccountInfo)) return false;
if (ObjectUtil.isEmpty(nowAccountInfo.getChainStoreId())) return true; if (ObjectUtil.isEmpty(nowAccountInfo.getChainStoreId())) return false;
System.out.println("nowAccount"+nowAccountInfo.toString()); System.out.println("nowAccount"+nowAccountInfo.toString());
if (nowAccountInfo.getChainStoreId().equals(chainStoreId)) { if (nowAccountInfo.getChainStoreId().equals(chainStoreId)) {

View File

@ -30,17 +30,30 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="交班时间"> <el-form-item label="交班时间">
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- style="width: 240px"-->
<!-- size="medium"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="daterange"-->
<!-- range-separator="-"-->
<!-- clearable-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<el-date-picker <el-date-picker
v-model="dateRange" v-model="beginTime"
style="width: 240px" style="width: 160px"
size="medium" type="date"
value-format="yyyy-MM-dd" placeholder="开始日期">
type="daterange" </el-date-picker>
range-separator="-"
clearable <el-date-picker
start-placeholder="开始日期" v-model="endTime"
end-placeholder="结束日期" style="width: 160px"
></el-date-picker> type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -133,6 +146,8 @@ export default {
}, },
loading: false, loading: false,
dateRange: [new Date(),new Date()], dateRange: [new Date(),new Date()],
beginTime:new Date(),
endTime:new Date(),
defaultSort: {prop: 'createTime', order: 'descending'}, defaultSort: {prop: 'createTime', order: 'descending'},
total: 0, total: 0,
@ -153,6 +168,11 @@ export default {
}, },
methods: { methods: {
getList(){ getList(){
this.dateRange = []
if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString())
}
getHandoverListApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{ getHandoverListApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
this.dataList = res.data.records this.dataList = res.data.records
this.total = res.data.total this.total = res.data.total
@ -201,6 +221,8 @@ export default {
pageSize:10 pageSize:10
}, },
this.dateRange = [] this.dateRange = []
this.beginTime = ""
this.endTime = ""
this.getList(); this.getList();
}, },
printLocally(data) { printLocally(data) {

View File

@ -247,7 +247,7 @@
@click="refuel(item)"> @click="refuel(item)">
<div>{{ getName(oilNameList,getOilNames(oilNumberList,item.numberId)) }}</div> <div>{{ getName(oilNameList,getOilNames(oilNumberList,item.numberId)) }}</div>
<!-- <div>{{ getOilNames(oilNumberList,item.numberId) }}</div>--> <!-- <div>{{ getOilNames(oilNumberList,item.numberId) }}</div>-->
<!-- <div>{{ item.oilNumber }}</div>--> <!-- <div>{{ item.oilNumber }</div>-->
<div class="of-title" >{{item.gunName}}</div> <div class="of-title" >{{item.gunName}}</div>
<div style="display: flex;justify-content: space-between"> <div style="display: flex;justify-content: space-between">
@ -2873,12 +2873,12 @@
this.oilPreferentialData = [] this.oilPreferentialData = []
}, },
// //
getGrade(userId,gradeId){ async getGrade(userId,gradeId){
this.isFixingLevel = false this.isFixingLevel = false
let _this = this; let _this = this;
this.oilDiscount = 0; this.oilDiscount = 0;
this.gradeDiscount = []; this.gradeDiscount = [];
userGradeInfo({userId:userId,gradeId:gradeId,storeId:""}).then(response => { await userGradeInfo({userId:userId,gradeId:gradeId,storeId:""}).then(response => {
let gasolineDiscount = 0; let gasolineDiscount = 0;
let dieselDiscount = 0; let dieselDiscount = 0;
let naturalGasDiscount = 0; let naturalGasDiscount = 0;
@ -3086,22 +3086,12 @@
this.map.payUser = data.mobile; this.map.payUser = data.mobile;
this.map.userId = data.id; this.map.userId = data.id;
this.balance = this.member.cardBalance; this.balance = this.member.cardBalance;
await this.getGrade(this.member.id,this.member.gradeId)
if (data.refuelMoney){ if (data.refuelMoney){
// 使 // 使
this.refuelMoney = JSON.parse(data.refuelMoney) this.refuelMoney = JSON.parse(data.refuelMoney)
await this.changeRefuelMoney(); await this.changeRefuelMoney();
} }
// await this.getGrade(data.id,data.gradeId)
// if (!this.isFixingLevel){
// this.preferentialData.storeId = this.storeId;
// this.preferentialData.userId = data.id;
// this.preferentialData.gradeId = data.gradeId;
// if (this.oilOrder.length>0){
// this.preferential();
// this.getCoupon();
// }
// }
await this.getGrade(this.member.id,this.member.gradeId)
if (this.balance>0 && this.oilAmount>0 && !this.isOilStorageCard){ if (this.balance>0 && this.oilAmount>0 && !this.isOilStorageCard){
this.checkAll4 = true this.checkAll4 = true
if (this.goodsOrder.length==0){ if (this.goodsOrder.length==0){
@ -3302,7 +3292,7 @@
this.checkAll4 = true this.checkAll4 = true
if (this.balance!=0 && this.balance >= this.hoardAmount){ if (this.balance!=0 && this.balance >= this.hoardAmount){
this.oilActualPay = 0 this.oilActualPay = 0
this.consumeAmount = this.hoardAmount this.consumeAmount = 0
}else { }else {
this.oilActualPay = (this.hoardAmount - this.balance).toFixed(2) this.oilActualPay = (this.hoardAmount - this.balance).toFixed(2)
this.consumeAmount = this.balance this.consumeAmount = this.balance
@ -3311,6 +3301,7 @@
this.oilActualPay = 0 this.oilActualPay = 0
this.consumeAmount = 0 this.consumeAmount = 0
} }
console.log("使用囤油卡",this.hoardAmount)
}, },
// 使 // 使
countAmountFull(){ countAmountFull(){
@ -3649,13 +3640,8 @@
this.oilTotal = this.oilOrder.length; this.oilTotal = this.oilOrder.length;
this.select = "元"; this.select = "元";
if (this.isMember){ if (this.isMember){
// this.getGrade(this.member.id,this.member.gradeId)
// this.changeRefuelMoney();
// if (this.oilOrder.length>0){
// this.preferential();
// this.getCoupon();
// }
await this.getGrade(this.member.id,this.member.gradeId)
if (this.refuelMoney){ if (this.refuelMoney){
// 使 // 使
await this.changeRefuelMoney(); await this.changeRefuelMoney();
@ -3667,7 +3653,6 @@
} }
this.countAmountFull() this.countAmountFull()
} }
await this.getGrade(this.member.id,this.member.gradeId)
if (!this.isFixingLevel && !this.isOilStorageCard){ if (!this.isFixingLevel && !this.isOilStorageCard){
await this.getOilCoupon() await this.getOilCoupon()
} }
@ -3686,10 +3671,10 @@
_this.hoardAmount = 0; _this.hoardAmount = 0;
_this.oilAmount = 0; _this.oilAmount = 0;
_this.refuelMoney1 = [] _this.refuelMoney1 = []
let hoardAmount1 = 0;
_this.oilOrder.forEach(item => { _this.oilOrder.forEach(item => {
let conRefMon = 0; let conRefMon = 0;
let hoardAmount = 0; let hoardAmount = 0;
let hoardAmount1 = 0;
let amount = 0; let amount = 0;
let amount1 = 0; let amount1 = 0;
let id = "" let id = ""
@ -3714,9 +3699,10 @@
} }
} }
_this.consumeRefuelMoney += +conRefMon _this.consumeRefuelMoney += +conRefMon
console.log(hoardAmount,1254)
hoardAmount1 += +hoardAmount hoardAmount1 += +hoardAmount
amount1 += +amount amount1 += +amount
_this.hoardAmount = hoardAmount1 + amount1 _this.hoardAmount = hoardAmount1
_this.oilAmount += +item.amount _this.oilAmount += +item.amount
// _this.changeBalance(_this.hoardAmount,id) // _this.changeBalance(_this.hoardAmount,id)
// if (_this.consumeRefuelMoney!=0){ // if (_this.consumeRefuelMoney!=0){
@ -3724,8 +3710,8 @@
// _this.checkAll3 = true; // _this.checkAll3 = true;
// _this.consumeAmount = 0; // _this.consumeAmount = 0;
// } // }
_this.isDefaultUseCard();
}) })
_this.isDefaultUseCard();
}, },
changeBalance(hoardAmount,id){ changeBalance(hoardAmount,id){
if (this.balance>0 && id != ""){ if (this.balance>0 && id != ""){

View File

@ -547,17 +547,17 @@
// if (!this.AppToken) { // if (!this.AppToken) {
// return; // return;
// } // }
// await request({ await request({
// url: 'chainStoreInfo/theJudgmentIsTheSame', url: 'chainStoreInfo/theJudgmentIsTheSame',
// method: 'get', method: 'get',
// data: { data: {
// "chainStoreId": uni.getStorageSync("chainStoreId") "chainStoreId": uni.getStorageSync("chainStoreId")
// } }
// }).then(res => { }).then(res => {
// if (!res.data) { if (!res.data) {
// uni.removeStorageSync("App-Token"); uni.removeStorageSync("App-Token");
// } }
// }) })
if (uni.getStorageSync("appltType")== "WECHAT") { if (uni.getStorageSync("appltType")== "WECHAT") {
// code // code

View File

@ -55,14 +55,14 @@
}, },
// userid // userid
getUserLogin(e) { getUserLogin(e) {
// if (this.qindex == false) { if (this.qindex == false) {
// uni.showToast({ uni.showToast({
// icon: "none", icon: "none",
// title: "", title: "请先阅读并勾选用户协议",
// duration: 2000 duration: 2000
// }) })
// return; return;
// } }
console.log(e) console.log(e)
let _this = this; let _this = this;
@ -124,14 +124,14 @@
wxlogin() {}, wxlogin() {},
getPhone(e) { getPhone(e) {
let that = this let that = this
// if (this.privacyPolicyChecked == false) { if (this.privacyPolicyChecked == false) {
// uni.showToast({ uni.showToast({
// icon: "none", icon: "none",
// title: "", title: "请先阅读并勾选用户协议",
// duration: 2000 duration: 2000
// }) })
// return; return;
// } }
console.log(e) console.log(e)
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',

View File

@ -345,6 +345,19 @@
// _this.goBack() // _this.goBack()
return; return;
} }
if(res.data.code=="error"){
request({
url: "/business/allOrderInfo/orderStatus",
method: 'post',
data: {"orderNo":_this.orderNo,"status":"payFail"},
}).then((ress)=>{})
uni.showToast({
title:res.data.msg,
icon:"none"
})
// _this.goBack()
return;
}
if(res.data.success == "ok"){ if(res.data.success == "ok"){
// _this.preferentialData.storeId = _this.oilOrder.storeId // _this.preferentialData.storeId = _this.oilOrder.storeId
// _this.preferentialData.orderAmount = _this.oilOrder.orderAmount // _this.preferentialData.orderAmount = _this.oilOrder.orderAmount