Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
87147fbcf3
@ -20,6 +20,15 @@ export function insertPurchaseApi(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 处理全部
|
||||
export function unifiedProcessingApi(data) {
|
||||
return request({
|
||||
url: 'business/petrolStationManagement/oilPurchase/unifiedProcessing',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改有关信息
|
||||
export function updatePurchaseApi(data) {
|
||||
return request({
|
||||
@ -75,6 +84,15 @@ export function editPurchuseApi(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 批量处理数据
|
||||
export function disposeBatchApi(data) {
|
||||
return request({
|
||||
url: 'business/petrolStationManagement/oilPurchaseOrder/disposeBatch',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 审核
|
||||
export function auditApi(data) {
|
||||
|
@ -143,7 +143,7 @@
|
||||
</el-card>
|
||||
<!-- 添加或修改优惠券对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="优惠券名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入优惠券名称" />
|
||||
</el-form-item>
|
||||
|
@ -374,6 +374,8 @@ export default {
|
||||
const index = this.detailsList.indexOf(data); // 查找要删除的对象的索引
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
this.sumMethod(this.detailsList);
|
||||
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
@ -461,6 +463,21 @@ export default {
|
||||
}
|
||||
this_.open = false
|
||||
|
||||
this.multipleSelection = []
|
||||
this.commodityForm = {
|
||||
cvsGoodId: "",
|
||||
cvsGood: "",
|
||||
supplierId: "",
|
||||
supplier: "",
|
||||
detailed: "",
|
||||
remark: "",
|
||||
page: 1,
|
||||
pageSize: 1000,
|
||||
total: 0,
|
||||
isRecovery:0,
|
||||
}
|
||||
this.commodityList = []
|
||||
|
||||
this_.sumMethod(this_.detailsList);
|
||||
},
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" v-model="queryParams.approvalStatus" prop="status">
|
||||
<el-select v-model="queryParams.approvalStatus" placeholder="请选择状态" style="150px">
|
||||
<el-select v-model="queryParams.approvalStatus" placeholder="请选择状态" style="150px" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.oilPurchasedStatus"
|
||||
:key="dict.value"
|
||||
@ -67,7 +67,7 @@
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'await'" size="medium">待审核</el-tag>
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'qrts'" type="success" size="medium">已审核入库</el-tag>
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'qrts'" type="success" size="medium">已审核出库</el-tag>
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'yzf'" type="danger" size="medium">已作废</el-tag>
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'ysh'" type="danger" size="medium">已审核</el-tag>
|
||||
</div>
|
||||
|
@ -371,6 +371,8 @@ export default {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
}
|
||||
this.inventoryForm.productQuantity--;
|
||||
this.sumMethod(this.detailsList);
|
||||
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
@ -467,6 +469,23 @@ export default {
|
||||
this.$modal.msgError("同一货损单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
|
||||
}
|
||||
this_.open = false
|
||||
|
||||
this_.open = false
|
||||
this.multipleSelection = []
|
||||
this.commodityForm = {
|
||||
cvsGoodId: "",
|
||||
cvsGood: "",
|
||||
supplierId: "",
|
||||
supplier: "",
|
||||
detailed: "",
|
||||
remark: "",
|
||||
page: 1,
|
||||
pageSize: 1000,
|
||||
total: 0,
|
||||
isRecovery:0,
|
||||
}
|
||||
this.commodityList = []
|
||||
|
||||
this_.inventoryForm.inventoryQuantity = this_.inventoryForm.inventoryQuantity + this_.multipleSelection.length
|
||||
this_.sumMethod(this_.detailsList);
|
||||
},
|
||||
@ -543,7 +562,10 @@ export default {
|
||||
// roductQuantity:0, // 商品数量
|
||||
// inventoryQuantity: 0 // 盘点数量
|
||||
// },
|
||||
|
||||
if(this_.detailsList.length<=0) {
|
||||
this.$modal.msgError("盘点单不能为空");
|
||||
return -1;
|
||||
}
|
||||
await editInventoryApi(this.inventoryForm).then(res=>{
|
||||
// 批量保存订单
|
||||
batchProcessingApi(this_.detailsList).then(res=>{
|
||||
|
@ -6,7 +6,7 @@
|
||||
<el-input v-model="queryParams.orderNumber" placeholder="请输入盘点批次号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" v-model="queryParams.approvalStatus" prop="status">
|
||||
<el-select v-model="queryParams.approvalStatus" placeholder="请选择状态" style="150px">
|
||||
<el-select v-model="queryParams.approvalStatus" placeholder="请选择状态" style="150px" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.oilPurchasedStatus"
|
||||
:key="dict.value"
|
||||
@ -77,7 +77,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="制单人" align="center" prop="createByName">
|
||||
<el-table-column label="制单人" align="center" prop="createByName" width="230px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.createByName}}({{parseTime(scope.row.orderDate)}})</span>
|
||||
</template>
|
||||
|
@ -108,7 +108,7 @@
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.subtotalAmount" @change="change(scope.row,3)" :precision="2" controls-position="right" :min="0" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="!numberInput" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column v-if="state =='await'" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -391,6 +391,7 @@ export default {
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
}
|
||||
this.sumMethod(this.detailsList);
|
||||
|
||||
this.$message({
|
||||
type: 'success',
|
||||
@ -483,6 +484,20 @@ export default {
|
||||
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
|
||||
}
|
||||
this_.open = false
|
||||
this.multipleSelection = []
|
||||
this.commodityForm = {
|
||||
cvsGoodId: "",
|
||||
cvsGood: "",
|
||||
supplierId: "",
|
||||
supplier: "",
|
||||
detailed: "",
|
||||
remark: "",
|
||||
page: 1,
|
||||
pageSize: 1000,
|
||||
total: 0,
|
||||
isRecovery:0,
|
||||
}
|
||||
this.commodityList = []
|
||||
|
||||
this_.sumMethod(this_.detailsList);
|
||||
},
|
||||
|
@ -16,7 +16,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" v-model="queryParams.approvalStatus" prop="status">
|
||||
<el-select v-model="queryParams.approvalStatus" placeholder="请选择状态" style="150px">
|
||||
<el-select v-model="queryParams.approvalStatus" placeholder="请选择状态" style="150px" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.oilPurchasedStatus"
|
||||
:key="dict.value"
|
||||
@ -69,7 +69,7 @@
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'await'" size="medium">待审核</el-tag>
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'qrts'" type="success" size="medium">已审核入库</el-tag>
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'yzf'" type="danger" size="medium">已作废</el-tag>
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'ysh'" type="danger" size="medium">已审核</el-tag>
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'ysh'" type="success" size="medium">已审核</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -88,7 +88,9 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="dispose(scope.row)"
|
||||
>处理单据</el-button>
|
||||
>
|
||||
{{ scope.row.approvalStatus == 'qrts'?'查看单据':'处理单据' }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
@ -194,6 +196,7 @@ export default {
|
||||
// 重置
|
||||
resetQuery() {
|
||||
this.queryParams = {}
|
||||
this.getList()
|
||||
},
|
||||
// 删除
|
||||
handleDel(data) {
|
||||
|
@ -382,9 +382,13 @@ export default {
|
||||
})
|
||||
}
|
||||
const index = this.detailsList.indexOf(data); // 查找要删除的对象的索引
|
||||
|
||||
if (index !== -1) {
|
||||
this.detailsList.splice(index, 1); // 使用splice方法删除对象
|
||||
this.sumMethod(this.detailsList);
|
||||
|
||||
}
|
||||
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
@ -476,7 +480,20 @@ export default {
|
||||
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
|
||||
}
|
||||
this_.open = false
|
||||
|
||||
this.multipleSelection = []
|
||||
this.commodityForm = {
|
||||
cvsGoodId: "",
|
||||
cvsGood: "",
|
||||
supplierId: "",
|
||||
supplier: "",
|
||||
detailed: "",
|
||||
remark: "",
|
||||
page: 1,
|
||||
pageSize: 1000,
|
||||
total: 0,
|
||||
isRecovery:0,
|
||||
}
|
||||
this.commodityList = []
|
||||
this_.sumMethod(this_.detailsList);
|
||||
},
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<el-form-item label="礼品名称" prop="giftName">
|
||||
<el-input
|
||||
v-model="queryParams.giftName"
|
||||
placeholder="请输入供应商名称"
|
||||
placeholder="请输入礼品名称"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
@ -44,14 +44,14 @@
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column label="分类" align="center" prop="categoryName" width="50px">
|
||||
<el-table-column label="分类" align="center" prop="categoryName" width="90px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.categoryName==null? '不分类': scope.row.categoryName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="礼品信息" align="center">
|
||||
<el-table-column label="名称" align="center" prop="giftName"/>
|
||||
<el-table-column label="封面图" align="center" prop="coverImage">
|
||||
<el-table-column label="名称" align="center" prop="giftName" width="80px"/>
|
||||
<el-table-column label="封面图" align="center" prop="coverImage" width="80px">
|
||||
<template slot-scope="scope">
|
||||
<el-image
|
||||
style="width: 50px; height: 50px"
|
||||
@ -73,7 +73,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="兑换方式" align="center" prop="">
|
||||
<el-table-column label="兑换价格" align="center" prop="">
|
||||
<template slot-scope="scope">
|
||||
<span v-if ="scope.row.exchangeMethod == '积分'" effect="plain" size="medium">{{scope.row.exchangePoints}}积分</span>
|
||||
<span v-if ="scope.row.exchangeMethod == '金额'" effect="plain" type="success" size="medium">{{scope.row.exchangeAmount}}元</span>
|
||||
@ -83,8 +83,8 @@
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="配送类型" align="center">
|
||||
<el-table-column label="配送方式" align="center" prop="deliveryMethod">
|
||||
<el-table-column label="配送类型" align="center" >
|
||||
<el-table-column label="配送方式" align="center" prop="deliveryMethod" width="80px">
|
||||
<template slot-scope="scope">
|
||||
<span v-for="(row, index) in JSON.parse(scope.row.deliveryMethod)" :key="index">
|
||||
{{row}}<br>
|
||||
@ -93,29 +93,30 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="快递费用" align="center" prop="shippingFeeAmount">
|
||||
<template slot-scope="scope">
|
||||
<span v-if ="scope.row.exchangeMethod!= null && !scope.row.exchangeMethod.includes('物流配送')">--</span>
|
||||
<span v-if ="scope.row.expressShippingFee!= '统一运费' && !scope.row.deliveryMethod.includes('物流配送')">--</span>
|
||||
<span v-else-if="scope.row.expressShippingFee == '包邮' && scope.row.deliveryMethod.includes('物流配送')" effect="plain" type="warning" size="medium">包邮</span>
|
||||
<span v-else effect="plain" type="warning" size="medium">{{scope.row.shippingFeeAmount}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="礼品类型" align="center" prop="giftType" />
|
||||
<el-table-column label="礼品类型" align="center" prop="giftType" width="80px"/>
|
||||
<el-table-column label="礼品库存信息" align="center">
|
||||
<el-table-column label="总库存" align="center" prop="totalInventory" >
|
||||
<el-table-column label="总库存" align="center" prop="totalInventory" width="80px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="clickInventory(scope.row)">{{ scope.row.totalInventory===-1?'无限制': scope.row.totalInventory}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已用" align="center" prop="usedInventory">
|
||||
<el-table-column label="已用" align="center" prop="usedInventory" width="80px">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="可用" align="center" prop="remainingInventory">
|
||||
<el-table-column label="可用" align="center" prop="remainingInventory" width="80px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.totalInventory===-1?scope.row.totalInventory-scope.row.usedInventory+1: scope.row.totalInventory-scope.row.usedInventory}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<el-table-column label="排序" align="center" prop="sort" width="40px"/>
|
||||
<el-table-column label="状态" align="center" prop="status" width="80px">
|
||||
<template slot-scope="scope">
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag v-if ="scope.row.status == '启用'" size="medium">启用</el-tag>
|
||||
@ -126,7 +127,7 @@
|
||||
<el-table-column label="创建时间" align="center" prop="createTime">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width = 70px>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -346,7 +347,7 @@
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="配送方式" prop="deliveryMethod">
|
||||
<el-checkbox v-for="item in dict.type.shippingMethod" :key="item.value" :label="item.label" :checked="dataForm.deliveryMethod != null?dataForm.deliveryMethod.includes(item.label):''" @change="changeExpress(item.label,1)">{{ item.label }}</el-checkbox>
|
||||
<el-checkbox v-for="item in dict.type.shippingMethod" :key="item.value" :label="item.label" :checked="dataForm.deliveryMethod != null?dataForm.deliveryMethod.includes(item.label):null" @change="changeExpress(item.label,1)">{{ item.label }}</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@ -364,7 +365,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col v-if="showList.shippingFee" :span="7">
|
||||
<el-col v-if="showList.shippingFee && showList.express" :span="7">
|
||||
<el-form-item label="运费金额" prop="shippingFeeAmount">
|
||||
<el-input v-model="dataForm.shippingFeeAmount" placeholder="" maxlength="30" style="width: 202px;" >
|
||||
<template slot="append">元</template>
|
||||
@ -436,7 +437,7 @@
|
||||
placeholder="全部"
|
||||
clearable
|
||||
>
|
||||
<el-option v-for="item in giftCategoryList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -589,7 +590,8 @@ export default {
|
||||
expressShippingFee:'', // 快递运费
|
||||
shippingFeeAmount:'', // 运费金额
|
||||
exchangeamount:'', // 兑换金额
|
||||
deliveryMethod:['门店自提'], // 配送方式
|
||||
// deliveryMethod:['门店自提'], // 配送方式
|
||||
deliveryMethod:[], // 配送方式
|
||||
detailedDescription:'', // 图文详情
|
||||
categoryName: 1,
|
||||
sort: null,
|
||||
@ -676,6 +678,9 @@ export default {
|
||||
dialogVisible: false,
|
||||
rulesInventory: {},
|
||||
rules: {
|
||||
deliveryMethod: [
|
||||
{ type: 'array', required: true, message: '请至少选择一个配送方式', trigger: 'change' }
|
||||
],
|
||||
giftName: [
|
||||
{ required: true, message: "礼品名称不能为空", trigger: "blur" },
|
||||
],
|
||||
@ -729,7 +734,8 @@ export default {
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "请选择礼品状态", trigger: "change" },
|
||||
]
|
||||
],
|
||||
|
||||
},
|
||||
commodityList: [],
|
||||
|
||||
@ -741,7 +747,7 @@ export default {
|
||||
detailed: "",
|
||||
remark: "",
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 1000,
|
||||
isRecovery:0,
|
||||
},
|
||||
|
||||
@ -771,16 +777,24 @@ export default {
|
||||
|
||||
submitForm: function() {
|
||||
let this_ = this
|
||||
if (Array.isArray(this_.giftImages)) {
|
||||
this_.dataForm.giftImages = JSON.stringify(this_.giftImages);
|
||||
}
|
||||
if (this_.dataForm.deliveryMethod != null && Array.isArray(this_.dataForm.deliveryMethod)) {
|
||||
this_.dataForm.deliveryMethod = JSON.stringify(this.dataForm.deliveryMethod);
|
||||
}
|
||||
this_.dataForm.remainingInventory = this_.dataForm.totalInventory
|
||||
|
||||
|
||||
// if (this.dataForm.deliveryMethod.length === 0) {
|
||||
// this.$message.warning('请至少选择一个配送方式');
|
||||
// return;
|
||||
// }
|
||||
this_.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
|
||||
if (Array.isArray(this_.giftImages)) {
|
||||
this_.dataForm.giftImages = JSON.stringify(this_.giftImages);
|
||||
}
|
||||
if (this_.dataForm.deliveryMethod != null && Array.isArray(this_.dataForm.deliveryMethod)) {
|
||||
this_.dataForm.deliveryMethod = JSON.stringify(this.dataForm.deliveryMethod);
|
||||
}
|
||||
this_.dataForm.remainingInventory = this_.dataForm.totalInventory
|
||||
|
||||
if (this_.dataForm.id == null) {
|
||||
// 判断是否是新增还是修改
|
||||
insertGiftApi(this_.dataForm).then(res => {
|
||||
@ -835,7 +849,7 @@ export default {
|
||||
this.reset();
|
||||
this.open = true
|
||||
this.title = '添加礼品'
|
||||
|
||||
this.changeGiftType("优惠券")
|
||||
this.selectGiftCategory();
|
||||
this.cardFavorableApi();
|
||||
this.cardExchangeApi();
|
||||
@ -860,11 +874,11 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
// 修改按钮
|
||||
handleUpdate(data) {
|
||||
async handleUpdate(data) {
|
||||
|
||||
this.cardFavorableApi();
|
||||
this.cardExchangeApi();
|
||||
this.selectGiftCategory();
|
||||
await this.cardFavorableApi();
|
||||
await this.cardExchangeApi();
|
||||
await this.selectGiftCategory();
|
||||
|
||||
// 处理图片
|
||||
let fileList = JSON.parse(data.giftImages);
|
||||
@ -996,6 +1010,7 @@ export default {
|
||||
getGiftCategoryApi(queryParams).then(response => {
|
||||
this.giftCategoryList = response.data.records;
|
||||
})
|
||||
|
||||
},
|
||||
// 选择礼品类型
|
||||
changeGiftType(newVal) {
|
||||
@ -1186,6 +1201,9 @@ export default {
|
||||
this.$refs.tables.toggleRowSelection(row); // 选中当前点击的行
|
||||
// 处理选中的行数据
|
||||
console.log("row",row)
|
||||
// stock
|
||||
this.dataForm.totalInventory = row.stock
|
||||
this.dataForm.market = row.retailPrice
|
||||
this.dataForm.goodsName = row.name
|
||||
this.dataForm.goodsId = row.id
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<el-form-item label="分类名称" prop="categoryName">
|
||||
<el-input
|
||||
v-model="queryParams.categoryName"
|
||||
placeholder="请输入供应商名称"
|
||||
placeholder="请输入分类名称"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
@ -45,7 +45,12 @@
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column label="ID" align="center" prop="id" width="50px"/>
|
||||
<!-- <el-table-column label="ID" align="center" prop="id" width="50px"/> -->
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="分类名称" align="center" prop="categoryName"/>
|
||||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
@ -174,7 +179,8 @@ export default {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 默认排序
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
// defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
defaultSort: {prop: 'sort', order: 'ascending'},
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
@ -234,7 +240,8 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
resetQuery(){
|
||||
|
||||
this.queryParams = {}
|
||||
this.getList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,10 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.st-tab {
|
||||
padding: 0px;
|
||||
padding-bottom: 0px;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="app-container" style="height: 100%;">
|
||||
<div class="app-container">
|
||||
<el-card >
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
|
||||
<el-form-item label="交易单号" prop="giftName">
|
||||
@ -84,7 +84,7 @@
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top: 20px;height: 1000px;" >
|
||||
<el-card style="margin-top: 20px;" >
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
@ -211,6 +211,7 @@ export default {
|
||||
pageSize:10
|
||||
},
|
||||
this.dateRange = []
|
||||
this.getList();
|
||||
},
|
||||
handleDetail(data){
|
||||
this.openDetail = true
|
||||
|
@ -66,7 +66,7 @@
|
||||
|
||||
<el-row>
|
||||
<el-form-item label="场景规则" prop="refuelSceneRules" >
|
||||
<el-radio-group v-model="dataForm.refuelSceneRules">
|
||||
<el-radio-group v-model="dataForm.refuelSceneRules" @click="abc($event)">
|
||||
<el-radio :label='0'>通用规则</el-radio>
|
||||
<el-radio :label='1'>油品区分</el-radio>
|
||||
</el-radio-group>
|
||||
@ -392,6 +392,7 @@ export default {
|
||||
},
|
||||
submit() {
|
||||
let file = this.dataForm
|
||||
// console.log()
|
||||
file.pointsObtained = JSON.stringify(file.pointsObtained);
|
||||
file.refuelConsumptionAmount = JSON.stringify(file.refuelConsumptionAmount);
|
||||
this.dataForm = {}
|
||||
@ -413,6 +414,7 @@ export default {
|
||||
console.log(tab, event);
|
||||
}
|
||||
},
|
||||
|
||||
valiNumberPass(rule, value, callback, fieldName) {
|
||||
this.$nextTick(() => {
|
||||
// 在这里进行自定义验证逻辑,value 应该在这时候被正确设置
|
||||
|
@ -113,7 +113,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<span class="anniulan" v-show="show" @click="getCode" >获取验证码</span>
|
||||
<span v-show="!show" class="count">{{count}}s后重新获取</span>
|
||||
<span style="cursor: pointer;color: #00aaff " v-show="!show" class="count">{{count}}s后重新获取</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -453,4 +453,15 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.anniulan{
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
//border: 1px solid #00aaff;
|
||||
border-radius: 6px;
|
||||
color: #00aaff;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
@ -433,7 +433,7 @@
|
||||
<div style="display: flex">
|
||||
<div style="width: 7%;line-height: 40px">油品类型</div>
|
||||
<el-radio-group v-model="tabOilType" style="margin-bottom: 30px;">
|
||||
<el-radio-button v-for="item,index in oilTypeList" :label="item.oilType" @click.native="tabOilTypeClick(item.oilType)">{{ item.type }}{{item.oilType}}</el-radio-button>
|
||||
<el-radio-button v-for="item,index in oilTypeList" :label="item.oilType" @click.native="tabOilTypeClick(item.status)">{{ item.type }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -524,7 +524,7 @@
|
||||
|
||||
<div style="text-align: center;font-size: 15px;font-weight: bold">付款金额</div>
|
||||
<div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0">
|
||||
¥{{ rechargeBalance }}
|
||||
¥{{ realyPayBills }}
|
||||
<!-- <el-tag
|
||||
effect="dark">
|
||||
汽油
|
||||
@ -846,7 +846,8 @@ export default {
|
||||
paymentType:'', // 支付方式
|
||||
royaltyType: '',// 提成类型
|
||||
percentageCommissions:null,
|
||||
amountCommission:null
|
||||
amountCommission:null,
|
||||
rechargeType:'0'
|
||||
},
|
||||
|
||||
// 存油卡列表
|
||||
@ -870,7 +871,7 @@ export default {
|
||||
|
||||
timer: null,
|
||||
|
||||
rechargeBalance:0,
|
||||
realyPayBills:0,
|
||||
|
||||
|
||||
oilTypeList: {},
|
||||
@ -878,7 +879,6 @@ export default {
|
||||
isPay:true,
|
||||
isPaySuccess:false,
|
||||
isQuery:true,
|
||||
isPay:true,
|
||||
|
||||
|
||||
payList:[],
|
||||
@ -999,7 +999,6 @@ export default {
|
||||
this.openLevel = true;
|
||||
this.title = '固定等级(原专车认证)'
|
||||
},
|
||||
|
||||
// 储值卡查询
|
||||
async getCardValueList() {
|
||||
let quy = {
|
||||
@ -1010,8 +1009,13 @@ export default {
|
||||
await getCardValueListApi(quy).then(res=>{
|
||||
this.cardValueList = res.data.records;
|
||||
this.cardValueList.sort((a, b) => a.rechargeBalance - b.rechargeBalance);
|
||||
|
||||
})
|
||||
if (this.cardValueList.length > 0) {
|
||||
// 过滤
|
||||
this.cardValueList = this.cardValueList.filter(item => {
|
||||
return item.membershipLevel.includes(this.grade.name);
|
||||
});
|
||||
this.rechargeCard(0);
|
||||
}
|
||||
},
|
||||
@ -1020,14 +1024,16 @@ export default {
|
||||
|
||||
|
||||
this.cardValueForm.points = ''
|
||||
this.cardValueForm.bidBalance =''
|
||||
this.cardValueForm.giftBalance =''
|
||||
this.cardValueForm.growthValue = ''
|
||||
this.cardValueForm.rechargeBalance = ''
|
||||
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.royaltyType = ''
|
||||
this.cardValueForm.percentageCommissions = ''
|
||||
this.cardValueForm.amountCommission = ''
|
||||
|
||||
this.cardValueForm.rechargeBalance = data
|
||||
|
||||
@ -1044,8 +1050,8 @@ export default {
|
||||
this.cardValueForm.royaltyType = change.royaltyType
|
||||
this.cardValueForm.percentageCommissions = change.percentageCommissions
|
||||
this.cardValueForm.amountCommission = change.amountCommission
|
||||
// this.cardValueForm.rechargeBalance
|
||||
|
||||
|
||||
// 计算员工提成金额
|
||||
if (change.royaltyType === "3") {
|
||||
// 当按比例提成时 计算对应的金额
|
||||
@ -1063,7 +1069,7 @@ export default {
|
||||
console.log("this.cardValueForm",this.cardValueForm)
|
||||
},
|
||||
// 存油卡查询
|
||||
getCardFuelDieselList() {
|
||||
async getCardFuelDieselList() {
|
||||
let quy = {
|
||||
pageNo: 1,
|
||||
pageSize: 10000,
|
||||
@ -1071,24 +1077,32 @@ export default {
|
||||
status:1,
|
||||
activityProgress:1
|
||||
}
|
||||
getList(quy).then(res=> {
|
||||
await getList(quy).then(res=> {
|
||||
this.sourceCardFuelDieselList = res.data.records
|
||||
})
|
||||
},
|
||||
handleDataFromChild(data) {
|
||||
this.openStaff = false
|
||||
this.cardFuelDieselForm= {
|
||||
mtStaffId: data.mtStaffId,
|
||||
realName: data.realName,
|
||||
staffMobile: data.staffMobile,
|
||||
},
|
||||
// this.cardFuelDieselForm= {
|
||||
// mtStaffId: data.mtStaffId,
|
||||
// realName: data.realName,
|
||||
// staffMobile: data.staffMobile,
|
||||
// },
|
||||
|
||||
this.cardValueForm= {
|
||||
mtStaffId: data.mtStaffId,
|
||||
realName: data.realName,
|
||||
staffMobile: data.staffMobile,
|
||||
},
|
||||
console.log('Received data in parent:', data);
|
||||
// this.cardValueForm= {
|
||||
// mtStaffId: data.mtStaffId,
|
||||
// realName: data.realName,
|
||||
// staffMobile: data.staffMobile,
|
||||
// },
|
||||
// console.log('Received data in parent:', data);
|
||||
|
||||
this.cardFuelDieselForm.mtStaffId= data.mtStaffId,
|
||||
this.cardFuelDieselForm.realName= data.realName,
|
||||
this.cardFuelDieselForm.staffMobile= data.staffMobile,
|
||||
|
||||
this.cardValueForm.mtStaffId= data.mtStaffId,
|
||||
this.cardValueForm.realName= data.realName,
|
||||
this.cardValueForm.staffMobile= data.staffMobile
|
||||
|
||||
},
|
||||
// 查询参加存油卡油品
|
||||
@ -1098,12 +1112,15 @@ export default {
|
||||
if (this.oilTypeList.length > 0) {
|
||||
// 默认选中第一个
|
||||
this.tabOilType = this.oilTypeList[0].oilType
|
||||
this.selectOilType(this.oilTypeList[0].oilType);
|
||||
this.selectOilType(this.oilTypeList[0].status,this.oilTypeList[0].oilType);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据油品过滤查询存油卡
|
||||
tabOilTypeClick(data){
|
||||
async tabOilTypeClick(data){
|
||||
console.log("aaaaaaaaaaaaaa",data)
|
||||
await this.getCardFuelDieselList()
|
||||
|
||||
this.cardFuelDieselList = this.sourceCardFuelDieselList.filter(item => {
|
||||
return item.oilType === data;
|
||||
});
|
||||
@ -1111,9 +1128,9 @@ export default {
|
||||
this.recharge(0)
|
||||
}
|
||||
},
|
||||
selectOilType(oilType) {
|
||||
selectOilType(status,oilType) {
|
||||
this.tabOilType = oilType;
|
||||
this.tabOilTypeClick(oilType);
|
||||
this.tabOilTypeClick(status);
|
||||
},
|
||||
// 查询员工
|
||||
|
||||
@ -1133,18 +1150,27 @@ export default {
|
||||
// 确认充值
|
||||
confirm(flag){
|
||||
this.flag = flag
|
||||
|
||||
|
||||
if (flag ===1) {
|
||||
if (this.cardValueForm.paymentType == '') {
|
||||
this.$message.error('请选择支付方式');
|
||||
return
|
||||
}
|
||||
this.rechargeBalance = this.cardValueForm.rechargeBalance
|
||||
this.$message.error('请选择支付方式');
|
||||
return
|
||||
}
|
||||
if (this.cardValueForm.amount != null) {
|
||||
this.cardValueForm.rechargeType = 1
|
||||
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.rechargeBalance = this.cardFuelDieselForm.rechargeBalance
|
||||
|
||||
this.realyPayBills = this.cardFuelDieselForm.rechargeBalance
|
||||
}
|
||||
this.isPay = true
|
||||
this.openConfirm = true;
|
||||
@ -1194,7 +1220,9 @@ export default {
|
||||
// 选择余额充值金额
|
||||
rechargeCard(index,item){
|
||||
console.log("index",index)
|
||||
// 自定义输入
|
||||
this.cardValueForm.amount = null,
|
||||
this.cardValueForm.rechargeType = 0
|
||||
|
||||
this.activeKey = index;
|
||||
|
||||
if (item === -1) {
|
||||
@ -1210,7 +1238,7 @@ export default {
|
||||
// 拿到金额
|
||||
file = this.cardValueList[index]
|
||||
|
||||
this.rechargeBalance = file.rechargeBalance
|
||||
this.realyPayBills = file.rechargeBalance
|
||||
this.cardValueForm.rechargeBalance = file.rechargeBalance
|
||||
this.cardValueForm.bidBalance = file.bidBalance
|
||||
this.cardValueForm.points = file.points
|
||||
@ -1250,9 +1278,8 @@ export default {
|
||||
this.cardFuelDieselForm.chainStorId = file.chainStorId
|
||||
this.cardFuelDieselForm.incomeLitres = file.incomeLitres
|
||||
|
||||
this.rechargeBalance = file.rechargeBalance
|
||||
console.log("this.cardFuelDieselList[index]",this.cardFuelDieselList[index])
|
||||
console.log("this.cardFuelDieselForm[index]",this.cardFuelDieselForm)
|
||||
// this.realyPayBills = file.rechargeBalance
|
||||
|
||||
},
|
||||
|
||||
async collection(){
|
||||
@ -1266,6 +1293,8 @@ export default {
|
||||
this.cardValueForm.mobile = userForm.mobile
|
||||
// 支付码
|
||||
this.cardValueForm.authCode = this.authCode
|
||||
this.cardValueForm.realyPayBills = this.realyPayBills
|
||||
|
||||
|
||||
let id ;
|
||||
await getPrepaidCardTopUpApi(this.cardValueForm).then(response=> {
|
||||
@ -1440,7 +1469,7 @@ export default {
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
// console.log(tab, event);
|
||||
this.rechargeBalance = 0
|
||||
this.realyPayBills = 0
|
||||
},
|
||||
handleChange(value) {
|
||||
// console.log(value);
|
||||
|
@ -84,7 +84,7 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="dispose(scope.row)"
|
||||
>{{ scope.row.status == 'ysh'?'查看单据':'处理单据' }}
|
||||
>{{ scope.row.status == 'qrts'?'查看单据':'处理单据' }}
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
|
@ -437,10 +437,8 @@ export default {
|
||||
}
|
||||
|
||||
if (isDuplicate) {
|
||||
console.log("isDuplicate222")
|
||||
|
||||
this.$message({
|
||||
message: '有重复油罐油罐,请重新选择',
|
||||
message: '有重复油罐,请重新选择',
|
||||
type: 'warning'
|
||||
});
|
||||
this.multipleSelection = []
|
||||
@ -517,12 +515,6 @@ export default {
|
||||
},
|
||||
|
||||
edit() {
|
||||
// updatePurchaseOrderApi(this.orderForm).then(response => {
|
||||
// // this.$modal.msgSuccess("修改成功");
|
||||
// // this.open = false;
|
||||
// this.orderForm = {}
|
||||
// this.getList();
|
||||
// });
|
||||
},
|
||||
|
||||
// 选择油罐添加密度
|
||||
@ -567,7 +559,7 @@ export default {
|
||||
},
|
||||
|
||||
// 保存订单信息
|
||||
saveInventory(){
|
||||
async saveInventory(){
|
||||
let this_ = this
|
||||
if (this_.inventoryNo.inventoryNo == null){
|
||||
this.$modal.msgSuccess("请先填写盘点号");
|
||||
@ -596,7 +588,7 @@ export default {
|
||||
if (this_.inventoryId != null) {
|
||||
// 修改
|
||||
inventoryForm.id = this_.inventoryId
|
||||
updateInventoryApi(inventoryForm).then(response=>{
|
||||
await updateInventoryApi(inventoryForm).then(response=>{
|
||||
// 处理列表
|
||||
// disList.inventoryId= this_.inventoryId
|
||||
|
||||
|
@ -96,7 +96,7 @@
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="dispose(scope.row)"
|
||||
>处理单据</el-button>
|
||||
>{{ scope.row.status == 'qrts'?'查看单据':'处理单据' }}</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
|
@ -92,12 +92,13 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="小计金额(元)" align="center" prop="totalAmount">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number :disabled="numberInput" v-model="scope.row.totalAmount" @change="change(scope.row)" controls-position="right" :min="0" :step="1" style="max-width: 100%"></el-input-number>
|
||||
{{ scope.row.totalAmount }}
|
||||
<!-- <el-input-number :disabled="numberInput" v-model="scope.row.totalAmount" @change="change(scope.row)" controls-position="right" :min="0" :max="10000000" :step="1" style="max-width: 100%"></el-input-number> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购升数(L)" align="center" prop="purchaseVolume"/>
|
||||
<el-table-column label="折和单价(元/升)" align="center" prop="discountedPrice"/>
|
||||
<el-table-column v-if="state =='await' || state=='ysh'" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column v-if="state =='await'" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -203,17 +204,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getSuppliersListApi,
|
||||
getSuppliersListApi2,
|
||||
insertSuppliersApi,
|
||||
updateSuppliersApi
|
||||
} from "@/api/oilConfig/oilSuppliers";
|
||||
import { getSuppliersListApi2 } from "@/api/oilConfig/oilSuppliers";
|
||||
import {
|
||||
editPurchuseApi,
|
||||
getPurchaseOrderApi,
|
||||
getPurchaseOrderApi,unifiedProcessingApi,
|
||||
insertPurchaseApi,
|
||||
insertPurchaseOrderApi,
|
||||
disposeBatchApi,
|
||||
updatePurchaseOrderApi,
|
||||
updatePurchaseApi, auditApi, abolitionApi, storageApi, delPurchaseOrderApi
|
||||
} from "@/api/oilConfig/oilPurchase";
|
||||
@ -232,17 +229,13 @@ export default {
|
||||
purchaseId: null,
|
||||
numberId: null,
|
||||
tankId: null,
|
||||
tankName: null,
|
||||
supplierId: null,
|
||||
productDensity: null,
|
||||
purchaseWeight: null,
|
||||
purchasePrice: null,
|
||||
totalAmount: null,
|
||||
purchaseVolume: null,
|
||||
storeId: null,
|
||||
createTime: null,
|
||||
updateTime: null,
|
||||
createBy: null,
|
||||
updateBy: null,
|
||||
preInboundInventory: null,
|
||||
discountedPrice: null
|
||||
},
|
||||
@ -337,17 +330,14 @@ export default {
|
||||
},
|
||||
|
||||
async created() {
|
||||
|
||||
|
||||
|
||||
if (this.$route.query.purchaseId != null) {
|
||||
this.queryParams.purchaseId = this.$route.query.purchaseId;
|
||||
this.purchaseId = this.$route.query.purchaseId;
|
||||
}else if (this.$route.query.purchaseId == null && this.purchaseId>0) {
|
||||
|
||||
}else {
|
||||
this.queryParams.purchaseId = -parseInt(new Date().getTime())% 100000000;
|
||||
this.purchaseId = -parseInt(new Date().getTime()) % 100000000;
|
||||
// this.queryParams.purchaseId = -parseInt(new Date().getTime())% 100000000;
|
||||
// this.purchaseId = -parseInt(new Date().getTime()) % 100000000;
|
||||
}
|
||||
|
||||
this.state = this.$route.query.state;
|
||||
@ -408,37 +398,95 @@ export default {
|
||||
this.selectSuppliers()
|
||||
},
|
||||
orderDel(data) {
|
||||
delPurchaseOrderApi(data).then(response => {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.getList()
|
||||
})
|
||||
if (data.id != null) {
|
||||
delPurchaseOrderApi(data).then(res=>{
|
||||
})
|
||||
}
|
||||
const index = this.orderList.indexOf(data); // 查找要删除的对象的索引
|
||||
if (index !== -1) {
|
||||
this.orderList.splice(index, 1); // 使用splice方法删除对象
|
||||
}
|
||||
// this.numberOfTanks = this.numberOfTanks-1
|
||||
// delPurchaseOrderApi(data).then(response => {
|
||||
// this.$modal.msgSuccess("删除成功");
|
||||
// this.getList()
|
||||
// })
|
||||
},
|
||||
// 提交
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
// 密度计算
|
||||
this.orderForm.purchaseVolume = ((this.orderForm.purchaseWeight*(1000))/this.orderForm.productDensity).toFixed(2);
|
||||
this.orderForm.purchaseVolume = new BigNumber(this.orderForm.purchaseWeight).times(1000).dividedBy(this.orderForm.productDensity).toFixed(2);
|
||||
// 计算小计价格
|
||||
this.orderForm.totalAmount = this.orderForm.purchasePrice * this.orderForm.purchaseWeight
|
||||
this.orderForm.totalAmount = new BigNumber(this.orderForm.purchasePrice).times(this.orderForm.purchaseWeight);
|
||||
// 折合单价
|
||||
this.orderForm.discountedPrice = (this.orderForm.purchaseVolume / this.orderForm.totalAmount).toFixed(2);
|
||||
this.orderForm.discountedPrice = new BigNumber(this.orderForm.totalAmount).dividedBy(this.orderForm.purchaseVolume).toFixed(2);
|
||||
|
||||
// 复制id
|
||||
this.orderForm.purchaseId = this.purchaseId
|
||||
if (!this.orderForm.id) {
|
||||
insertPurchaseOrderApi(this.orderForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
// this.saveJudgment()
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
updatePurchaseOrderApi(this.orderForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
|
||||
|
||||
let numberName = this.numberList.find(item => item.numberId === this.orderForm.numberId);
|
||||
let tankName = this.tankList.find(item => item.id === this.orderForm.tankId);
|
||||
let supplierName = this.suppliersList.find(item => item.id === this.orderForm.supplierId);
|
||||
console.log("numberName",numberName)
|
||||
// 去重
|
||||
let isDuplicate = false
|
||||
if (this.orderList.length > 0) {
|
||||
isDuplicate = this.orderList.some(order => order.numberId === this.orderForm.numberId);
|
||||
}
|
||||
if (isDuplicate) {
|
||||
this.$message({
|
||||
message: '有重复油号,请重新选择',
|
||||
type: 'warning'
|
||||
});
|
||||
this.orderForm = {}
|
||||
return;
|
||||
}
|
||||
let addFrom = {
|
||||
"discountedPrice": this.orderForm.discountedPrice,
|
||||
// "id": 47,
|
||||
"numberId": this.orderForm.numberId,
|
||||
"numberName": numberName.oilType +' '+numberName.oilName,
|
||||
"oilName": numberName.oilName,
|
||||
"oilType": numberName.oilType,
|
||||
// "preInboundInventory": null,
|
||||
"productDensity": this.orderForm.productDensity,
|
||||
// "purchaseId": this.purchaseId,
|
||||
"purchasePrice": this.orderForm.purchasePrice,
|
||||
"purchaseVolume": this.orderForm.purchaseVolume,
|
||||
"purchaseWeight": this.orderForm.purchaseWeight,
|
||||
// "preInboundInventory": tankName.storedQuantity,
|
||||
"storedQuantity": tankName.storedQuantity,
|
||||
"supplierId": this.orderForm.supplierId,
|
||||
"supplierName": supplierName.supplierName,
|
||||
"tankId": this.orderForm.tankId,
|
||||
"tankName": tankName.tankName,
|
||||
"totalAmount": this.orderForm.totalAmount,
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.orderList.push(addFrom)
|
||||
this.open = false;
|
||||
this.sumMethod(this.orderList)
|
||||
console.log(" this.orderForm", this.orderForm)
|
||||
|
||||
// if (!this.orderForm.id) {
|
||||
// insertPurchaseOrderApi(this.orderForm).then(response => {
|
||||
// this.$modal.msgSuccess("新增成功");
|
||||
// this.open = false;
|
||||
// // this.saveJudgment()
|
||||
// this.getList();
|
||||
// });
|
||||
// } else {
|
||||
// updatePurchaseOrderApi(this.orderForm).then(response => {
|
||||
// this.$modal.msgSuccess("修改成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
// }
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -448,15 +496,21 @@ export default {
|
||||
},
|
||||
// 改变数字时
|
||||
change(data) {
|
||||
console.log()
|
||||
// 密度计算
|
||||
data.purchaseVolume = ((data.purchaseWeight*(1000))/data.productDensity).toFixed(2);
|
||||
data.purchaseVolume = new BigNumber(data.purchaseWeight).times(1000).dividedBy(data.productDensity).toFixed(2);
|
||||
// 计算小计价格
|
||||
data.totalAmount = data.purchasePrice * data.purchaseWeight
|
||||
data.totalAmount = new BigNumber(data.purchasePrice).times(data.purchaseWeight);
|
||||
// 折合单价
|
||||
data.discountedPrice = (data.purchaseVolume / data.totalAmount).toFixed(2);
|
||||
if (data.purchasePrice == 0 || data.purchaseWeight == 0) {
|
||||
data.discountedPrice = 0
|
||||
} else {
|
||||
data.discountedPrice = new BigNumber(data.totalAmount).dividedBy(data.purchaseVolume).toFixed(2);
|
||||
}
|
||||
this.sumMethod(this.orderList)
|
||||
// 进行保存
|
||||
this.orderForm = data
|
||||
this.edit()
|
||||
// this.orderForm = data
|
||||
// this.edit()
|
||||
},
|
||||
edit() {
|
||||
updatePurchaseOrderApi(this.orderForm).then(response => {
|
||||
@ -530,46 +584,101 @@ export default {
|
||||
this.$modal.msgWarning("请先选择进货时间");
|
||||
return -1;
|
||||
}
|
||||
if (this.orderList.length <= 0) {
|
||||
this.$modal.msgWarning("请选择至少一个油品");
|
||||
return -1;
|
||||
}
|
||||
|
||||
let from = {
|
||||
id:this.purchaseId,
|
||||
purchaseNo : this.purchaseForm.purchaseNo,
|
||||
purchaseDate : this.purchaseForm.purchaseDate,
|
||||
theDocumentAmount : this.totalAmountPurchased,
|
||||
}
|
||||
if (this.queryParams.purchaseId < 0) {
|
||||
insertPurchaseApi(from).then(response => {
|
||||
console.log("response",response)
|
||||
this.$modal.msgSuccess("添加成功");
|
||||
// 修改进货单的父id
|
||||
let oilPurchase = {
|
||||
purchaseId:response.data.id,
|
||||
id:this.queryParams.purchaseId
|
||||
}
|
||||
this.queryParams.purchaseId = response.data.id,
|
||||
this.purchaseId = response.data.id,
|
||||
this.purchaseNo = response.data.purchaseNo,
|
||||
this.state = response.data.status
|
||||
//todo 优化 将这些代码加到后台中完成并进行事务管理
|
||||
|
||||
await unifiedProcessingApi({oilPurchase:from,oilPurchaseOrders:this.orderList}).then(res=>{
|
||||
if (res.code === 200) {
|
||||
this.purchaseId = res.data.id
|
||||
|
||||
this.$router.push({ path: '/oilConfig/oilPurchase/list'});
|
||||
}else {
|
||||
return -1;
|
||||
}
|
||||
}).catch({
|
||||
})
|
||||
|
||||
editPurchuseApi(oilPurchase).then(response2 => {
|
||||
if (flag != -1) {
|
||||
// this.$router.push({ path: '/oilPurchase/purchaseOrder', query: {
|
||||
// purchaseId: oilPurchase.purchaseId,
|
||||
// purchaseNo: response.data.purchaseNo,
|
||||
// state: response.data.status
|
||||
// }});
|
||||
this.$router.push('/oilConfig/oilPurchase/list');
|
||||
// if(this.purchaseId != null) {
|
||||
// // 修改
|
||||
// from.id = this.purchaseId
|
||||
// updatePurchaseApi(from).then(res => {
|
||||
// // this.purchaseId = res.data.id
|
||||
// this.orderList.forEach(ord=>{
|
||||
// ord.purchaseId = res.data.id
|
||||
// })
|
||||
// // if (flag != -1) {
|
||||
// // // 处理列表
|
||||
|
||||
}
|
||||
})
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
from.id = this.queryParams.purchaseId
|
||||
updatePurchaseApi(from).then(response => {
|
||||
this.$modal.msgSuccess("添加成功");
|
||||
})
|
||||
}
|
||||
// // this.$router.push('/oilConfig/oilPurchase/list');
|
||||
// // }
|
||||
// disposeBatchApi(this.orderList).then(response=> {
|
||||
// // 保存成功
|
||||
// this.$modal.msgSuccess("保存成功");
|
||||
// // this.getList()
|
||||
// this.$router.push({ path: '/oilConfig/oilPurchase/list', query: {
|
||||
// } });
|
||||
// })
|
||||
// })
|
||||
// }else{
|
||||
// insertPurchaseApi(from).then(res => {
|
||||
// this.orderList.forEach(ord=>{
|
||||
// ord.purchaseId = res.data.id
|
||||
// })
|
||||
// disposeBatchApi(this.orderList).then(response=> {
|
||||
// // 保存成功
|
||||
// this.$modal.msgSuccess("保存成功");
|
||||
// // this.getList()
|
||||
// this.$router.push({ path: '/oilConfig/oilPurchase/list', query: {
|
||||
// } });
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
// 判断是新增还是修改
|
||||
// if (this.queryParams.purchaseId < 0) {
|
||||
// insertPurchaseApi(from).then(response => {
|
||||
// console.log("response",response)
|
||||
// this.$modal.msgSuccess("添加成功");
|
||||
// // 修改进货单的父id
|
||||
// let oilPurchase = {
|
||||
// purchaseId:response.data.id,
|
||||
// id:this.queryParams.purchaseId
|
||||
// }
|
||||
// this.queryParams.purchaseId = response.data.id,
|
||||
// this.purchaseId = response.data.id,
|
||||
// this.purchaseNo = response.data.purchaseNo,
|
||||
// this.state = response.data.status
|
||||
// //todo 优化 将这些代码加到后台中完成并进行事务管理
|
||||
|
||||
// editPurchuseApi(oilPurchase).then(response2 => {
|
||||
// if (flag != -1) {
|
||||
// // this.$router.push({ path: '/oilPurchase/purchaseOrder', query: {
|
||||
// // purchaseId: oilPurchase.purchaseId,
|
||||
// // purchaseNo: response.data.purchaseNo,
|
||||
// // state: response.data.status
|
||||
// // }});
|
||||
// this.$router.push('/oilConfig/oilPurchase/list');
|
||||
|
||||
// }
|
||||
// })
|
||||
// this.getList();
|
||||
// });
|
||||
// } else {
|
||||
// from.id = this.queryParams.purchaseId
|
||||
// updatePurchaseApi(from).then(response => {
|
||||
// this.$modal.msgSuccess("添加成功");
|
||||
// })
|
||||
// }
|
||||
},
|
||||
// 判断是否可以保存
|
||||
saveJudgment(){
|
||||
@ -582,12 +691,15 @@ export default {
|
||||
let judgmentPermissions1 = await this.judgmentPermissions("进油审核");
|
||||
if (judgmentPermissions1 > 0){
|
||||
this.auditFlag=false
|
||||
}else {
|
||||
this.auditFlag=true
|
||||
}
|
||||
let judgmentPermissions2 = await this.judgmentPermissions("进油入库");
|
||||
if (judgmentPermissions2 > 0){
|
||||
this.storageFlag = false
|
||||
}else {
|
||||
this.storageFlag=true
|
||||
}
|
||||
|
||||
let judgmentPermissions3 = await this.judgmentPermissions("进油废止");
|
||||
if (judgmentPermissions3 > 0){
|
||||
this.voidFlag=false
|
||||
@ -709,9 +821,6 @@ export default {
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
// 页面跳转
|
||||
goToAbout() {
|
||||
this.$router.push('/oilConfig/oilPurchase/list');
|
||||
|
@ -36,4 +36,16 @@ public class FyPayController {
|
||||
Map<String, String> map = payService.queryOrder(map1);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款 成功 result_msg 显示success
|
||||
* result_code显示000000
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping("/refund")
|
||||
public Map<String, String> refund(Map<String, String> map1) throws Exception {
|
||||
Map<String, String> map = payService.refund(map1);
|
||||
return map;
|
||||
}
|
||||
}
|
@ -52,7 +52,7 @@ public class Builder {
|
||||
}
|
||||
|
||||
/**
|
||||
* 条码支付下单查询
|
||||
* 条码支付下单 查询订单是否支付成功
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ -71,4 +71,34 @@ public class Builder {
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, String> buildFuiou24() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
|
||||
map.put("version", Const.version);
|
||||
map.put("ins_cd", Const.ins_cd);
|
||||
map.put("mchnt_cd", Const.mchnt_cd);
|
||||
map.put("term_id", Const.term_id);
|
||||
map.put("random_str", randomNumberGenerator.nextBytes().toHex());
|
||||
map.put("sign", "");
|
||||
map.put("order_type", Const.order_type);
|
||||
map.put("mchnt_order_no", "");
|
||||
// 商户退款单号
|
||||
map.put("refund_order_no", "");
|
||||
// 总金额
|
||||
map.put("total_amt", "");
|
||||
// 退款金额
|
||||
map.put("refund_amt", "");
|
||||
map.put("operator_id", "");
|
||||
map.put("reserved_fy_term_id", "");
|
||||
map.put("reserved_origi_dt", "");
|
||||
map.put("reserved_addn_inf", "");
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
@ -16,4 +16,11 @@ public interface FyPayService {
|
||||
* @throws Exception
|
||||
*/
|
||||
public Map<String, String> queryOrder(Map<String, String> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 退款
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Map<String, String> refund(Map<String, String> map) throws Exception;
|
||||
}
|
||||
|
@ -11,16 +11,12 @@ import com.fuint.api.fuyou.service.FyPayService;
|
||||
import com.fuint.api.fuyou.service.MerchantConfigService;
|
||||
import com.fuint.api.fuyou.util.Utils;
|
||||
import com.fuint.business.integral.service.IntegralOrdersService;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
|
||||
import com.fuint.business.marketingActivity.cardFule.service.CardFuelRecordService;
|
||||
import com.fuint.business.marketingActivity.cardValue.service.CardValueRecordService;
|
||||
import com.fuint.business.order.entity.CashierOrder;
|
||||
import com.fuint.business.order.entity.HangBill;
|
||||
import com.fuint.business.order.entity.LJOrder;
|
||||
import com.fuint.business.order.entity.OilOrder;
|
||||
import com.fuint.business.order.service.CashierOrderService;
|
||||
import com.fuint.business.order.service.HangBillService;
|
||||
import com.fuint.business.order.service.LJOrderService;
|
||||
import com.fuint.business.order.service.OilOrderService;
|
||||
import com.fuint.business.order.entity.*;
|
||||
import com.fuint.business.order.service.*;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import io.swagger.models.auth.In;
|
||||
@ -83,7 +79,6 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
|
||||
String str = resMap.get("sign");
|
||||
if (Utils.verifySign(resMap, str)){
|
||||
String resultCode = resMap.get("result_code");
|
||||
ThreadUtil.execAsync(() -> {
|
||||
Timer timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
@ -110,6 +105,10 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
private MerchantConfigService merchantConfigService;
|
||||
@Autowired
|
||||
private HangBillService hangBillService;
|
||||
@Autowired
|
||||
private ReturnRecordService returnRecordService;
|
||||
@Autowired
|
||||
private CardFavorableRecordService cardFavorableRecordService;
|
||||
|
||||
@Override
|
||||
public Map<String, String> queryOrder(Map<String, String> map1) throws Exception {
|
||||
@ -148,24 +147,43 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
LJOrder goodsOrder = goodsOrderService.selectGoodsOrder(orderNo);
|
||||
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIsUse("1");
|
||||
HangBill hangBill = hangBillService.selectHangBillByOrderNo(orderNo);
|
||||
List<ReturnRecord> returnRecords = returnRecordService.selectReturnRecordByOrderNo(orderNo);
|
||||
Date date = new Date();
|
||||
if (reqMap.get("trans_stat").equals("SUCCESS")){
|
||||
if (!ObjectUtil.isEmpty(oilOrder)){
|
||||
// 油品订单
|
||||
oilOrder.setOrderStatus("paid");
|
||||
oilOrder.setPayTime(date);
|
||||
// 修改优惠券使用状态
|
||||
CardFavorableRecord byId = cardFavorableRecordService.getById(oilOrder.getCouponId());
|
||||
if (!ObjectUtil.isEmpty(byId)){
|
||||
byId.setStatus("1");
|
||||
cardFavorableRecordService.updateById(byId);
|
||||
}
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(goodsOrder)){
|
||||
// 商品订单
|
||||
goodsOrder.setStatus("paid");
|
||||
goodsOrder.setPayTime(date);
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(cashierOrder)){
|
||||
// 收银台订单
|
||||
cashierOrder.setStatus("paid");
|
||||
cashierOrder.setPayTime(date);
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(hangBill)){
|
||||
hangBillService.updateHangBills(hangBill,allAmount,"paid");
|
||||
if (!ArrayUtil.isEmpty(returnRecords)){
|
||||
for (ReturnRecord returnRecord : returnRecords) {
|
||||
// 挂账归还信息
|
||||
returnRecord.setReturnType("1");
|
||||
returnRecord.setPayStatus("paid");
|
||||
returnRecord.setPayTime(date);
|
||||
hangBillService.updateHangBill(returnRecord.getHangBillId(), returnRecord.getAmount());
|
||||
returnRecordService.updateReturnRecord(returnRecord);
|
||||
}
|
||||
}
|
||||
if (ArrayUtil.isEmpty(list)){
|
||||
if (!ArrayUtil.isEmpty(list)){
|
||||
for (OilOrder order : list) {
|
||||
// 添加多个油品订单
|
||||
order.setOrderStatus("paid");
|
||||
order.setPayTime(date);
|
||||
oilOrderService.updateOilOrder(order);
|
||||
@ -200,9 +218,12 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
if (!ObjectUtil.isEmpty(cashierOrder)){
|
||||
cashierOrder.setStatus("payFail");
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(hangBill)){
|
||||
hangBill.setPayStatus("payFail");
|
||||
hangBillService.updateById(hangBill);
|
||||
if (!ArrayUtil.isEmpty(returnRecords)){
|
||||
for (ReturnRecord returnRecord : returnRecords) {
|
||||
returnRecord.setReturnType("0");
|
||||
returnRecord.setPayStatus("payFail");
|
||||
returnRecordService.updateReturnRecord(returnRecord);
|
||||
}
|
||||
}
|
||||
if (!ArrayUtil.isEmpty(list)){
|
||||
for (OilOrder order : list) {
|
||||
@ -254,4 +275,37 @@ public class FyPayServiceImpl implements FyPayService {
|
||||
return resMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> refund(Map<String, String> map1) throws Exception {
|
||||
String orderNo = map1.get("orderNo");
|
||||
String refundOrderNo = map1.get("refundOrderNo");
|
||||
String payType = map1.get("payType");
|
||||
String allAmount = map1.get("allAmount");
|
||||
String insCd = map1.get("insCd");
|
||||
String mchntCd = map1.get("mchntCd");
|
||||
Map<String, String> map = Builder.buildFuiou24();
|
||||
map.put("mchnt_order_no",orderNo);
|
||||
map.put("order_type",payType);
|
||||
map.put("total_amt", allAmount);
|
||||
map.put("refund_amt", allAmount);
|
||||
map.put("ins_cd", insCd);
|
||||
map.put("mchnt_cd", mchntCd);
|
||||
map.put("refund_order_no", refundOrderNo);
|
||||
|
||||
|
||||
// 请求报文
|
||||
String reqBody = Message.requestMsg(map);
|
||||
// 响应报文
|
||||
String rspXml = Message.responseMsg(reqBody,Const.fuiou_24_url);
|
||||
|
||||
//响应报文验签
|
||||
Map<String, String> resMap = Utils.xmlStr2Map(rspXml);
|
||||
|
||||
String str = resMap.get("sign");
|
||||
if (Utils.verifySign(resMap, str)){
|
||||
|
||||
}
|
||||
return resMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,15 +2,13 @@ package com.fuint.business.integral.controller;
|
||||
|
||||
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.integral.entity.IntegralGiftCategory;
|
||||
import com.fuint.business.integral.service.IntegralGiftCategoryService;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilGun;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -34,14 +32,14 @@ public class IntegralGiftCategoryController extends BaseController {
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralGiftCategory 筛选条件
|
||||
* @param pageRequest 分页对象
|
||||
* @param
|
||||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("queryByPage")
|
||||
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
public ResponseObject queryByPage(@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@Param("integralGiftCategory") IntegralGiftCategory integralGiftCategory) {
|
||||
com.baomidou.mybatisplus.extension.plugins.pagination.Page page = new com.baomidou.mybatisplus.extension.plugins.pagination.Page(pageNo, pageSize);
|
||||
Page page = new Page(pageNo, pageSize);
|
||||
IPage<IntegralGiftCategory> integralGiftCategoryIPage = this.integralGiftCategoryService.queryByPage(page, integralGiftCategory);
|
||||
return getSuccessResult(integralGiftCategoryIPage);
|
||||
}
|
||||
|
@ -28,6 +28,8 @@
|
||||
id, category_name, sort, status, store_id, create_time, update_time, create_by, update_by
|
||||
from integral_gift_category
|
||||
<where>
|
||||
store_id = #{integralGiftCategory.storeId}
|
||||
|
||||
<if test="integralGiftCategory.id != null">
|
||||
and id = #{integralGiftCategory.id}
|
||||
</if>
|
||||
@ -40,9 +42,6 @@
|
||||
<if test="integralGiftCategory.status != null and integralGiftCategory.status != ''">
|
||||
and status = #{integralGiftCategory.status}
|
||||
</if>
|
||||
<if test="integralGiftCategory.storeId != null">
|
||||
and store_id = #{integralGiftCategory.storeId}
|
||||
</if>
|
||||
<if test="integralGiftCategory.createTime != null">
|
||||
and create_time = #{integralGiftCategory.createTime}
|
||||
</if>
|
||||
|
@ -102,6 +102,10 @@
|
||||
<if test="integralGift.giftName != null and integralGift.giftName != ''">
|
||||
and ig.gift_name like CONCAT ('%',#{integralGift.giftName},'%')
|
||||
</if>
|
||||
<if test="integralGift.deliveryMethod != null and integralGift.deliveryMethod != ''">
|
||||
and ig.delivery_method like CONCAT ('%',#{integralGift.deliveryMethod},'%')
|
||||
</if>
|
||||
|
||||
<if test="integralGift.categoryId != null">
|
||||
and ig.category_id = #{integralGift.categoryId}
|
||||
</if>
|
||||
|
@ -38,13 +38,14 @@ public class IntegralGiftCategoryServiceImpl implements IntegralGiftCategoryServ
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralGiftCategory 筛选条件
|
||||
* @param pageRequest 分页对象
|
||||
* @param page 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public IPage<IntegralGiftCategory> queryByPage(@Param("page") Page page, @Param("integralGiftCategory") IntegralGiftCategory integralGiftCategory) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
integralGiftCategory.setStoreId(nowAccountInfo.getStoreId());
|
||||
page.setAsc("sort");
|
||||
return integralGiftCategoryDao.queryAllByLimit(page, integralGiftCategory);
|
||||
}
|
||||
|
||||
|
@ -76,13 +76,13 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
if (ObjectUtil.isEmpty(settings)) {
|
||||
// 查询店铺所有的存油
|
||||
List<OilNumber> oilName = oilNumberMapper.getOilName(nowAccountInfo.getStoreId());
|
||||
if (!CollUtil.isEmpty(oilName)) {
|
||||
if (!ObjectUtil.isEmpty(oilName)) {
|
||||
List<Map<String, Object>> refuelConsumptionAmountList = new ArrayList<>();
|
||||
for (OilNumber oilNumber : oilName) {
|
||||
Map<String, Object> refuelConsumptionAmountMap = new HashMap<>();
|
||||
refuelConsumptionAmountMap.put("oilName",oilNumber.getOilName()+oilNumber.getOilType());
|
||||
refuelConsumptionAmountMap.put("amount",0);
|
||||
refuelConsumptionAmountMap.put("integral",0);
|
||||
refuelConsumptionAmountMap.put("oilName", oilNumber.getOilName() + oilNumber.getOilType());
|
||||
refuelConsumptionAmountMap.put("amount", 0);
|
||||
refuelConsumptionAmountMap.put("integral", 0);
|
||||
refuelConsumptionAmountList.add(refuelConsumptionAmountMap);
|
||||
}
|
||||
String refuelConsumptionAmount = JSON.toJSONString(refuelConsumptionAmountList);
|
||||
@ -92,6 +92,24 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
insert(integralSettings);
|
||||
return integralSettings;
|
||||
|
||||
}else if (ObjectUtil.isEmpty(settings.getRefuelConsumptionAmount()) || settings.getRefuelConsumptionAmount().length()<6){
|
||||
// 查询店铺所有的存油
|
||||
List<OilNumber> oilName = oilNumberMapper.getOilName(nowAccountInfo.getStoreId());
|
||||
if (!ObjectUtil.isEmpty(oilName)) {
|
||||
List<Map<String, Object>> refuelConsumptionAmountList = new ArrayList<>();
|
||||
for (OilNumber oilNumber : oilName) {
|
||||
Map<String, Object> refuelConsumptionAmountMap = new HashMap<>();
|
||||
refuelConsumptionAmountMap.put("oilName", oilNumber.getOilName() + oilNumber.getOilType());
|
||||
refuelConsumptionAmountMap.put("amount", 0);
|
||||
refuelConsumptionAmountMap.put("integral", 0);
|
||||
refuelConsumptionAmountList.add(refuelConsumptionAmountMap);
|
||||
}
|
||||
String refuelConsumptionAmount = JSON.toJSONString(refuelConsumptionAmountList);
|
||||
settings.setRefuelConsumptionAmount(refuelConsumptionAmount);
|
||||
|
||||
}
|
||||
|
||||
update(settings);
|
||||
}
|
||||
|
||||
return settings;
|
||||
|
@ -153,12 +153,7 @@ public class CardFuelDieselController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/countOilType")
|
||||
public ResponseObject countOilType() {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
QueryWrapper<CardFuelDiesel> wrapper = Wrappers.query();
|
||||
wrapper.eq("store_id", nowAccountInfo.getStoreId());
|
||||
// wrapper.select("type", "oil_type", "COUNT(*) as count");
|
||||
wrapper.groupBy("type", "oil_type");
|
||||
return getSuccessResult(cardFuelDieselService.list(wrapper));
|
||||
return getSuccessResult(cardFuelDieselService.countOilType());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,8 @@ package com.fuint.business.marketingActivity.cardFule.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 柴油屯油卡(CardFuelDiesel)表数据库访问层
|
||||
*
|
||||
@ -11,5 +13,6 @@ import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
|
||||
*/
|
||||
public interface CardFuelDieselMapper extends BaseMapper<CardFuelDiesel> {
|
||||
|
||||
List<CardFuelDiesel> countOilType(Integer storeId);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.business.marketingActivity.cardFule.mapper.CardFuelDieselMapper">
|
||||
|
||||
|
||||
<select id="countOilType" resultType="com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel">
|
||||
select cf.oil_type oilType,
|
||||
concat(oo.oil_type,' ',oo.oil_name) type,
|
||||
oo.oil_name status
|
||||
from card_fuel_diesel cf
|
||||
left join oil_name oo ON oo.id = cf.oil_type
|
||||
where cf.store_id = #{storeId}
|
||||
group by cf.oil_type
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -3,6 +3,8 @@ package com.fuint.business.marketingActivity.cardFule.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 柴油屯油卡(CardFuelDiesel)表服务接口
|
||||
*
|
||||
@ -11,5 +13,7 @@ import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
|
||||
*/
|
||||
public interface CardFuelDieselService extends IService<CardFuelDiesel> {
|
||||
|
||||
List<CardFuelDiesel> countOilType();
|
||||
|
||||
}
|
||||
|
||||
|
@ -4,8 +4,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelDieselMapper;
|
||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
|
||||
import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 柴油屯油卡(CardFuelDiesel)表服务实现类
|
||||
*
|
||||
@ -15,5 +20,13 @@ import org.springframework.stereotype.Service;
|
||||
@Service("cardFuelDieselService")
|
||||
public class CardFuelDieselServiceImpl extends ServiceImpl<CardFuelDieselMapper, CardFuelDiesel> implements CardFuelDieselService {
|
||||
|
||||
@Resource
|
||||
CardFuelDieselMapper cardFuelDieselMapper;
|
||||
|
||||
@Override
|
||||
public List<CardFuelDiesel> countOilType() {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
return cardFuelDieselMapper.countOilType(nowAccountInfo.getStoreId());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,9 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
|
||||
// 支付
|
||||
if (flag) {
|
||||
// Integer allAmount = (int) (theAmountToBePaid*100);
|
||||
Integer allAmount1 = (int) (theAmountToBePaid*100);
|
||||
System.out.println("allAmount1:"+allAmount1);
|
||||
|
||||
Integer allAmount = (int) (0.01 * 100);
|
||||
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIsUse("1");
|
||||
@ -238,6 +240,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
Map<String, String> refuelMoney = new HashMap<>();
|
||||
// todo 目前没有用id
|
||||
// refuelMoney.put("oilNumberId",cardFuelRecord.getOilNumberId().toString());
|
||||
// refuelMoney.put("oilNameId",cardFuelRecord.getType());
|
||||
refuelMoney.put("type",cardFuelRecord.getType());
|
||||
refuelMoney.put("oilType",cardFuelRecord.getOilType());
|
||||
refuelMoney.put("refuelMoney",cardFuelRecord.getIncomeLitres().toString());
|
||||
@ -257,7 +260,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
// Double.valueOf(refuelMoney);
|
||||
|
||||
BigDecimal ref = new BigDecimal(refuelMoney);
|
||||
BigDecimal inconLitres = new BigDecimal(cardFuelRecord.getIncomeLitres());
|
||||
BigDecimal inconLitres = new BigDecimal(cardFuelRecord.getIncomeLitres().toString());
|
||||
BigDecimal add = ref.add(inconLitres);
|
||||
stringObjectMap.put("refuelMoney",add.toString());
|
||||
flag = false;
|
||||
|
@ -9,6 +9,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class CardValueRecordDTO extends CardValueRecord {
|
||||
private String authCode;
|
||||
private Double realyPayBills;
|
||||
|
||||
// /**
|
||||
// * 会员id
|
||||
|
@ -108,21 +108,16 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
Double theAmountToBePaid = 0.0;
|
||||
boolean flag = false;
|
||||
// 先判断是否为自定义金额
|
||||
// todo 需要修改该 统一使用getRechargeBalance recharge_type
|
||||
if (!ObjectUtil.isEmpty(cardValueRecordDTO.getAmount())
|
||||
&& cardValueRecordDTO.getAmount() > epsilon
|
||||
if (!ObjectUtil.isEmpty(cardValueRecordDTO.getRealyPayBills())
|
||||
&& cardValueRecordDTO.getRealyPayBills() > epsilon
|
||||
&& "unpaid".equals(cardValueRecordDTO.getPayStatus())){
|
||||
theAmountToBePaid = cardValueRecordDTO.getAmount();
|
||||
flag = true;
|
||||
} else if(!ObjectUtil.isEmpty(cardValueRecordDTO.getRechargeBalance())
|
||||
&& cardValueRecordDTO.getRechargeBalance() > epsilon
|
||||
&& "unpaid".equals(cardValueRecordDTO.getPayStatus())) {
|
||||
theAmountToBePaid = cardValueRecordDTO.getRechargeBalance();
|
||||
theAmountToBePaid = cardValueRecordDTO.getRealyPayBills();
|
||||
flag = true;
|
||||
}
|
||||
// todo
|
||||
if (flag) {
|
||||
// Integer allAmount = (int) (theAmountToBePaid*100);
|
||||
Integer allAmount1 = (int) (theAmountToBePaid*100);
|
||||
System.out.println("allAmount1:"+allAmount1);
|
||||
Integer allAmount = (int) (0.01*100);
|
||||
|
||||
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIsUse("1");
|
||||
|
@ -75,8 +75,7 @@ public class HangBillController extends BaseController {
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseObject edit(@Validated @RequestBody Map<String,String> map){
|
||||
HangBill hangBill = hangBillService.updateHangBill(map);
|
||||
return getSuccessResult(hangBill);
|
||||
return getSuccessResult(hangBillService.collection(map));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -86,8 +85,7 @@ public class HangBillController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/batch")
|
||||
public ResponseObject batchUpdate(@Validated @RequestBody Map<String,String> map){
|
||||
int row = hangBillService.batchUpdate(map);
|
||||
return getSuccessResult(row);
|
||||
return getSuccessResult(hangBillService.batchUpdate(map));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,60 @@
|
||||
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.service.ReturnRecordService;
|
||||
import com.fuint.business.order.vo.ReturnRecordVo;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 归还记录信息 controller层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/returnRecord")
|
||||
public class ReturnRecordController extends BaseController {
|
||||
@Autowired
|
||||
private ReturnRecordService returnRecordService;
|
||||
|
||||
/**
|
||||
* 根据挂账记录id查询归还记录信息
|
||||
* @param returnRecordVo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResponseObject list(ReturnRecordVo returnRecordVo,
|
||||
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
Page page =new Page(pageNo,pageSize);
|
||||
IPage<ReturnRecordVo> returnRecordVoIPage = returnRecordService.selectReturnRecordList(page, returnRecordVo);
|
||||
return getSuccessResult(returnRecordVoIPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询挂账归还信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ResponseObject info(@PathVariable Integer id){
|
||||
return getSuccessResult(returnRecordService.selectReturnRecordById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单号查询挂账归还信息
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/order")
|
||||
public ResponseObject infoByOrderNo(@Validated @RequestBody Map<String,String> map){
|
||||
String orderNo = map.get("orderNo");
|
||||
return getSuccessResult(returnRecordService.selectReturnRecordByOrderNo(orderNo));
|
||||
}
|
||||
}
|
@ -54,6 +54,10 @@ public class CashierOrder extends BaseEntity implements Serializable {
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 退款订单号
|
||||
*/
|
||||
private String refundOrderNo;
|
||||
/**
|
||||
* 油品订单金额
|
||||
*/
|
||||
|
@ -0,0 +1,82 @@
|
||||
package com.fuint.business.order.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuint.framework.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 归还记录表(ReturnRecord)实体类
|
||||
*/
|
||||
@Data
|
||||
@TableName("return_record")
|
||||
@ApiModel(value = "ReturnRecord对象", description = "归还记录表")
|
||||
public class ReturnRecord extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@ApiModelProperty("自增ID")
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 挂账记录id
|
||||
*/
|
||||
private Integer hangBillId;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Integer storeId;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 挂账单位id
|
||||
*/
|
||||
private Integer creditUnitId;
|
||||
/**
|
||||
* 订单状态:0未归还,1已归还
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 归还状态:0挂账,1归还
|
||||
*/
|
||||
private String returnType;
|
||||
/**
|
||||
* 挂账金额
|
||||
*/
|
||||
private Double amount;
|
||||
/**
|
||||
* 收款金额
|
||||
*/
|
||||
private Double collectAmount;
|
||||
/**
|
||||
* 找零金额
|
||||
*/
|
||||
private Double seekZero;
|
||||
/**
|
||||
* 操作员工id
|
||||
*/
|
||||
private Integer staffId;
|
||||
/**
|
||||
* 单据备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 支付状态:已支付,未支付,支付失败
|
||||
*/
|
||||
private String payStatus;
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private Date payTime;
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
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.ReturnRecord;
|
||||
import com.fuint.business.order.vo.ReturnRecordVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 挂账归还记录表 mapper层
|
||||
*/
|
||||
public interface ReturnRecordMapper extends BaseMapper<ReturnRecord> {
|
||||
/**
|
||||
* 根据挂账记录id查询归还信息
|
||||
* @param page
|
||||
* @param returnRecord
|
||||
* @return
|
||||
*/
|
||||
public IPage<ReturnRecordVo> selectReturnRecordList(Page page, @Param("returnRecord") ReturnRecordVo returnRecord);
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.business.order.mapper.ReturnRecordMapper">
|
||||
<sql id="selectReturnRecord">
|
||||
select rd.*,ms.real_name,ms.mobile,cu.unit_name,cu.person_credit,cu.contact_mobile,cu.credit_limit
|
||||
from return_record rd
|
||||
left join credit_unit cu on cu.id = rd.credit_unit_id
|
||||
left join mt_staff ms on rd.staff_id = ms.id
|
||||
</sql>
|
||||
|
||||
<select id="selectReturnRecordList" resultType="com.fuint.business.order.vo.ReturnRecordVo">
|
||||
<include refid="selectReturnRecord"></include>
|
||||
<where>
|
||||
rd.hang_bill_id = #{returnRecord.hangBillId}
|
||||
</where>
|
||||
</select>
|
||||
<!-- <select id="selectHangBillById" resultType="com.fuint.business.order.vo.HangBillVo" parameterType="int">-->
|
||||
<!-- <include refid="selectHangBill"></include>-->
|
||||
<!-- <where>-->
|
||||
<!-- hb.id = #{id}-->
|
||||
<!-- </where>-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="selectHangBills" resultType="com.fuint.business.order.vo.HangBillVo" parameterType="int">-->
|
||||
<!-- <include refid="selectHangBill"></include>-->
|
||||
<!-- <where>-->
|
||||
<!-- hb.store_id = #{storeId}-->
|
||||
<!-- </where>-->
|
||||
<!-- </select>-->
|
||||
</mapper>
|
@ -4,6 +4,7 @@ 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 java.util.List;
|
||||
@ -49,18 +50,26 @@ public interface HangBillService extends IService<HangBill> {
|
||||
public int insertHangBill(HangBillVo hangBill);
|
||||
|
||||
/**
|
||||
* 修改挂账记录 并收款
|
||||
* 修改挂账记录信息
|
||||
* @param id
|
||||
* @param amount
|
||||
* @return
|
||||
*/
|
||||
public int updateHangBill(int id,Double amount);
|
||||
|
||||
/**
|
||||
* 添加归还信息并收款
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
public HangBill updateHangBill(Map<String,String> map);
|
||||
public String collection(Map<String,String> map);
|
||||
|
||||
/**
|
||||
* 批量归还挂账金额
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
public int batchUpdate(Map<String,String> map);
|
||||
public String batchUpdate(Map<String,String> map);
|
||||
|
||||
/**
|
||||
* 修改挂账信息
|
||||
|
@ -0,0 +1,50 @@
|
||||
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.ReturnRecord;
|
||||
import com.fuint.business.order.vo.ReturnRecordVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 挂账归还记录表 业务层
|
||||
*/
|
||||
public interface ReturnRecordService extends IService<ReturnRecord> {
|
||||
/**
|
||||
* 根据挂账记录id查询归还信息
|
||||
* @param page
|
||||
* @param returnRecord
|
||||
* @return
|
||||
*/
|
||||
public IPage<ReturnRecordVo> selectReturnRecordList(Page page,ReturnRecordVo returnRecord);
|
||||
|
||||
/**
|
||||
* 根据id查询归还记录信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public ReturnRecord selectReturnRecordById(int id);
|
||||
|
||||
/**
|
||||
* 根据订单号查询归还记录信息
|
||||
* @param orderNo
|
||||
* @return
|
||||
*/
|
||||
public List<ReturnRecord> selectReturnRecordByOrderNo(String orderNo);
|
||||
|
||||
/**
|
||||
* 添加挂账归还信息 并返回订单号
|
||||
* @param returnRecord
|
||||
* @return
|
||||
*/
|
||||
public String insertReturnRecord(ReturnRecord returnRecord);
|
||||
|
||||
/**
|
||||
* 修改挂账归还信息
|
||||
* @param returnRecord
|
||||
* @return
|
||||
*/
|
||||
public int updateReturnRecord(ReturnRecord returnRecord);
|
||||
}
|
@ -13,9 +13,11 @@ import com.fuint.api.fuyou.service.MerchantConfigService;
|
||||
import com.fuint.api.fuyou.service.OilConfigService;
|
||||
import com.fuint.business.order.entity.CreditUnit;
|
||||
import com.fuint.business.order.entity.HangBill;
|
||||
import com.fuint.business.order.entity.ReturnRecord;
|
||||
import com.fuint.business.order.mapper.HangBillMapper;
|
||||
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.HangBillVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
@ -114,69 +116,109 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
|
||||
private OilConfigService oilConfigService;
|
||||
|
||||
@Override
|
||||
public HangBill updateHangBill(Map<String,String> map) {
|
||||
String payType = map.get("payType");
|
||||
// 调用支付接口
|
||||
this.pay(map);
|
||||
|
||||
// 根据id查询挂账信息
|
||||
HangBill hangBill = baseMapper.selectById(Integer.parseInt(map.get("id")));
|
||||
if (payType.equals("CASH")){
|
||||
public int updateHangBill(int id,Double amount) {
|
||||
HangBill hangBill = baseMapper.selectById(id);
|
||||
Double repaidAmount = hangBill.getRepaidAmount();
|
||||
Double outstandAmount = hangBill.getOutstandAmount();
|
||||
// 修改变化金额
|
||||
Double repaidAmountAfter = repaidAmount+amount;
|
||||
Double outstandAmountAfter = outstandAmount-amount;
|
||||
hangBill.setRepaidAmount(repaidAmountAfter);
|
||||
hangBill.setOutstandAmount(outstandAmountAfter);
|
||||
// 修改状态
|
||||
if (repaidAmountAfter.equals(hangBill.getAmount()) && outstandAmountAfter.equals(0.0)){
|
||||
hangBill.setStatus("1");
|
||||
hangBill.setReturnType("1");
|
||||
hangBill.setPayStatus("paid");
|
||||
}else {
|
||||
hangBill.setStatus("2");
|
||||
}
|
||||
|
||||
// 根据挂账单位id查询挂账单位信息
|
||||
// 根据挂账单位id查询挂账单位信息
|
||||
CreditUnit creditUnit = creditUnitService.selectCreditUnitListById(hangBill.getCreditUnitId());
|
||||
if (creditUnit.getCreditLimit()!=0){
|
||||
Double creditLimit = creditUnit.getCreditLimit();
|
||||
creditUnit.setCreditLimit(creditLimit+Double.valueOf(map.get("repaidAmount")));
|
||||
}
|
||||
|
||||
int row = 0;
|
||||
hangBill.setRemark(map.get("remark"));
|
||||
// 支付成功后修改挂账信息
|
||||
if (hangBill.getPayStatus().equals("paid")){
|
||||
Double repaidAmount1 = Double.valueOf(map.get("repaidAmount"));
|
||||
Double amount = hangBill.getAmount();
|
||||
Double repaidAmount = hangBill.getRepaidAmount();
|
||||
Double outstandAmount = hangBill.getOutstandAmount();
|
||||
Double repaidAmountAfter = repaidAmount+repaidAmount1;
|
||||
// 修改挂账信息
|
||||
hangBill.setRepaidAmount(repaidAmountAfter);
|
||||
hangBill.setOutstandAmount(amount-repaidAmountAfter);
|
||||
if (amount.equals(repaidAmountAfter)){
|
||||
hangBill.setStatus("1");
|
||||
hangBill.setReturnType("1");
|
||||
}else {
|
||||
hangBill.setStatus("2");
|
||||
}
|
||||
// 修改挂账单位余额信息
|
||||
// 挂账单位限额的数据添加
|
||||
Double creditLimit = creditUnit.getCreditLimit();
|
||||
if (creditLimit!=0) {
|
||||
creditUnit.setCreditLimit(creditLimit+amount);
|
||||
creditUnitService.updateCreditUnit(creditUnit);
|
||||
}
|
||||
row = baseMapper.updateById(hangBill);
|
||||
return baseMapper.selectById(Integer.parseInt(map.get("id")));
|
||||
int row = baseMapper.updateById(hangBill);
|
||||
return row;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ReturnRecordService returnRecordService;
|
||||
|
||||
@Override
|
||||
public String collection(Map<String, String> map) {
|
||||
// 添加归还账单信息
|
||||
ReturnRecord returnRecord = new ReturnRecord();
|
||||
returnRecord.setHangBillId(Integer.valueOf(map.get("id")));
|
||||
returnRecord.setStoreId(Integer.valueOf(map.get("storeId")));
|
||||
returnRecord.setCreditUnitId(Integer.valueOf(map.get("creditUnitId")));
|
||||
returnRecord.setStaffId(Integer.valueOf(map.get("staffId")));
|
||||
returnRecord.setStatus(map.get("payType"));
|
||||
returnRecord.setRemark(map.get("remark"));
|
||||
returnRecord.setAmount(Double.valueOf(map.get("repaidAmount")));
|
||||
if (map.get("payType").equals("CASH")){
|
||||
returnRecord.setCollectAmount(Double.valueOf(map.get("authCode")));
|
||||
returnRecord.setSeekZero(Double.valueOf(map.get("seekZero")));
|
||||
returnRecord.setPayStatus("paid");
|
||||
returnRecord.setReturnType("1");
|
||||
returnRecord.setPayTime(new Date());
|
||||
Double amount = Double.valueOf(map.get("authCode")) - Double.valueOf(map.get("seekZero"));
|
||||
this.updateHangBill(returnRecord.getHangBillId(), amount);
|
||||
}else {
|
||||
returnRecord.setCollectAmount(Double.valueOf(map.get("repaidAmount")));
|
||||
returnRecord.setReturnType("0");
|
||||
returnRecord.setPayStatus("unpaid");
|
||||
}
|
||||
String orderNo = returnRecordService.insertReturnRecord(returnRecord);
|
||||
|
||||
// 调用支付接口
|
||||
this.pay(map,orderNo);
|
||||
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchUpdate(Map<String, String> map) {
|
||||
this.pay(map);
|
||||
public String batchUpdate(Map<String, String> map) {
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(map.get("list"), JSONObject.class);
|
||||
int row = 0;
|
||||
// 根据日期生成归还订单号
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String timestamp = dateFormat.format(new Date());
|
||||
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
|
||||
String orderNo = "H"+timestamp+randomString;
|
||||
for (JSONObject jsonObject : jsonObjects) {
|
||||
// 现将需要修改的支付状态改为未支付
|
||||
HangBill hangBill1 = baseMapper.selectById((Integer) jsonObject.get("id"));
|
||||
|
||||
hangBill1.setPayStatus("unpaid");
|
||||
baseMapper.updateById(hangBill1);
|
||||
HangBill hangBill = baseMapper.selectById((Integer) jsonObject.get("id"));
|
||||
// 添加归还记录信息
|
||||
ReturnRecord returnRecord = new ReturnRecord();
|
||||
returnRecord.setOrderNo(orderNo);
|
||||
returnRecord.setHangBillId((Integer) jsonObject.get("id"));
|
||||
returnRecord.setStoreId((Integer) jsonObject.get("storeId"));
|
||||
returnRecord.setCreditUnitId((Integer) jsonObject.get("creditUnitId"));
|
||||
returnRecord.setStaffId((Integer) jsonObject.get("staffId"));
|
||||
returnRecord.setStatus(map.get("payType"));
|
||||
returnRecord.setRemark((String) jsonObject.get("remark"));
|
||||
returnRecord.setAmount(Double.valueOf(jsonObject.get("repaidAmount").toString()));
|
||||
if (map.get("payType").equals("CASH")){
|
||||
HangBill hangBill2 = this.updateStatus(hangBill, Double.valueOf(jsonObject.get("repaidAmount").toString()));
|
||||
hangBill2.setPayStatus("paid");
|
||||
hangBill2.setRemark(map.get("remark"));
|
||||
row = baseMapper.updateById(hangBill2);
|
||||
returnRecord.setCollectAmount(Double.valueOf(map.get("authCode")));
|
||||
returnRecord.setSeekZero(Double.valueOf(map.get("seekZero")));
|
||||
returnRecord.setPayStatus("paid");
|
||||
returnRecord.setReturnType("1");
|
||||
returnRecord.setPayTime(new Date());
|
||||
Double amount = Double.valueOf(jsonObject.get("repaidAmount").toString());
|
||||
this.updateHangBill(returnRecord.getHangBillId(), amount);
|
||||
}else {
|
||||
returnRecord.setCollectAmount(Double.valueOf(jsonObject.get("repaidAmount").toString()));
|
||||
returnRecord.setReturnType("0");
|
||||
returnRecord.setPayStatus("unpaid");
|
||||
}
|
||||
returnRecordService.insertReturnRecord(returnRecord);
|
||||
}
|
||||
return row;
|
||||
// 调用支付接口
|
||||
this.pay(map,orderNo);
|
||||
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -191,7 +233,8 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
|
||||
* 调用支付接口
|
||||
* @param map
|
||||
*/
|
||||
private void pay(Map<String,String> map){
|
||||
private void pay(Map<String,String> map,String orderNo){
|
||||
// 先将支付状态改为未支付
|
||||
String payType = map.get("payType");
|
||||
if (!map.get("repaidAmount").equals("0") && !payType.equals("CASH")){
|
||||
Integer allAmount = (int) (Double.valueOf(map.get("repaidAmount"))*100);
|
||||
@ -206,7 +249,7 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
|
||||
Map<String,String> map1 = new HashMap<>();
|
||||
map1.put("authCode",map.get("authCode"));
|
||||
map1.put("allAmount",allAmount.toString());
|
||||
map1.put("orderNo",map.get("orderNo"));
|
||||
map1.put("orderNo",orderNo);
|
||||
map1.put("payType",payType);
|
||||
map1.put("insCd",merchantConfig.getInsCd());
|
||||
map1.put("mchntCd",merchantConfig.getMchntCd());
|
||||
@ -214,7 +257,7 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
|
||||
map1.put("publicKey",merchantConfig.getPublicKey());
|
||||
map1.put("privateKey",merchantConfig.getPrivateKey());
|
||||
try {
|
||||
fyPayService.pay(map);
|
||||
fyPayService.pay(map1);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -0,0 +1,60 @@
|
||||
package com.fuint.business.order.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.ReturnRecord;
|
||||
import com.fuint.business.order.mapper.ReturnRecordMapper;
|
||||
import com.fuint.business.order.service.ReturnRecordService;
|
||||
import com.fuint.business.order.vo.ReturnRecordVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 挂账归还记录表 业务层
|
||||
*/
|
||||
@Service
|
||||
public class ReturnRecordServiceImpl extends ServiceImpl<ReturnRecordMapper, ReturnRecord> implements ReturnRecordService {
|
||||
@Override
|
||||
public IPage<ReturnRecordVo> selectReturnRecordList(Page page, ReturnRecordVo returnRecord) {
|
||||
return baseMapper.selectReturnRecordList(page,returnRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReturnRecord selectReturnRecordById(int id) {
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReturnRecord> selectReturnRecordByOrderNo(String orderNo) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("order_no",orderNo);
|
||||
List<ReturnRecord> list = baseMapper.selectList(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String insertReturnRecord(ReturnRecord returnRecord) {
|
||||
if (StrUtil.isEmpty(returnRecord.getOrderNo())){
|
||||
// 根据日期生成归还订单号
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String timestamp = dateFormat.format(new Date());
|
||||
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
|
||||
String orderNo = "H"+timestamp+randomString;
|
||||
returnRecord.setOrderNo(orderNo);
|
||||
}
|
||||
baseMapper.insert(returnRecord);
|
||||
return returnRecord.getOrderNo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateReturnRecord(ReturnRecord returnRecord) {
|
||||
return baseMapper.updateById(returnRecord);
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.fuint.business.order.vo;
|
||||
|
||||
import com.fuint.business.order.entity.ReturnRecord;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ReturnRecordVo extends ReturnRecord {
|
||||
// 操作人名称
|
||||
private String realName;
|
||||
// 操作人手机号
|
||||
private String mobile;
|
||||
// 单位名称
|
||||
private String unitName;
|
||||
// 挂账人
|
||||
private String personCredit;
|
||||
// 联系电话
|
||||
private String contactMobile;
|
||||
// 挂账额度
|
||||
private String creditLimit;
|
||||
}
|
@ -2,6 +2,7 @@ package com.fuint.business.petrolStationManagement.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.petrolStationManagement.dto.OilPurchase4OrdDTO;
|
||||
import com.fuint.business.petrolStationManagement.dto.OilPurchaseDTO;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilPurchase;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder;
|
||||
@ -105,6 +106,11 @@ public class OilPurchaseController extends BaseController {
|
||||
return getSuccessResult(this.oilPurchaseService.insert(oilPurchase));
|
||||
}
|
||||
|
||||
@PostMapping("unifiedProcessing")
|
||||
public ResponseObject unifiedProcessing(@RequestBody OilPurchase4OrdDTO oilPurchase) {
|
||||
return getSuccessResult(this.oilPurchaseService.unifiedProcessing(oilPurchase));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
|
@ -87,7 +87,7 @@ public class OilPurchaseOrderController extends BaseController {
|
||||
|
||||
/**
|
||||
* 批量处理数据
|
||||
* @param oilInventoryOrderList ,@Param("inventoryId") Integer inventoryId
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("disposeBatch")
|
||||
@ -127,11 +127,21 @@ public class OilPurchaseOrderController extends BaseController {
|
||||
return getSuccessResult(this.oilPurchaseOrderService.audit(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 进油废除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("abolition")
|
||||
public ResponseObject abolition(Integer id) {
|
||||
return getSuccessResult(this.oilPurchaseOrderService.abolition(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 进油入库
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("storage")
|
||||
public ResponseObject storage(Integer id) {
|
||||
return getSuccessResult(this.oilPurchaseOrderService.storage(id));
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.fuint.business.petrolStationManagement.dto;
|
||||
|
||||
import com.fuint.business.petrolStationManagement.entity.OilPurchase;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class OilPurchase4OrdDTO {
|
||||
private OilPurchase oilPurchase;
|
||||
private List<OilPurchaseOrder> oilPurchaseOrders;
|
||||
}
|
@ -108,6 +108,7 @@
|
||||
opo.total_amount totalAmount,
|
||||
opo.purchase_volume purchaseVolume,
|
||||
opo.discounted_price discountedPrice,
|
||||
opo.pre_inbound_inventory preInboundInventory,
|
||||
onn.oil_type oilType,
|
||||
onn.oil_name oilName,
|
||||
os.supplier_name supplierName,
|
||||
@ -163,10 +164,10 @@
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into oil_purchase_order(purchase_id, number_id, tank_id, supplier_id, product_density, purchase_weight, purchase_price, total_amount, purchase_volume)
|
||||
insert into oil_purchase_order(purchase_id, number_id, tank_id, supplier_id, product_density, purchase_weight, purchase_price, total_amount, purchase_volume,discounted_price)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.purchaseId}, #{entity.numberId}, #{entity.tankId}, #{entity.supplierId}, #{entity.productDensity}, #{entity.purchaseWeight}, #{entity.purchasePrice}, #{entity.totalAmount}, #{entity.purchaseVolume})
|
||||
(#{entity.purchaseId}, #{entity.numberId}, #{entity.tankId}, #{entity.supplierId}, #{entity.productDensity}, #{entity.purchaseWeight}, #{entity.purchasePrice}, #{entity.totalAmount}, #{entity.purchaseVolume}, #{entity.discountedPrice})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@ -228,37 +229,36 @@
|
||||
|
||||
<update id="updateBatch">
|
||||
<foreach collection="list" item="user" separator=";">
|
||||
|
||||
update oil_purchase_order
|
||||
<set>
|
||||
<if test="${user.purchaseId != null}">
|
||||
<if test="user.purchaseId != null">
|
||||
purchase_id = #{user.purchaseId},
|
||||
</if>
|
||||
<if test="${user.numberId != null}">
|
||||
<if test="user.numberId != null">
|
||||
number_id = #{user.numberId},
|
||||
</if>
|
||||
<if test="${user.tankId != null}">
|
||||
<if test="user.tankId != null">
|
||||
tank_id = #{user.tankId},
|
||||
</if>
|
||||
<if test="${user.supplierId != null}">
|
||||
<if test="user.supplierId != null">
|
||||
supplier_id = #{user.supplierId},
|
||||
</if>
|
||||
<if test="${user.productDensity != null}">
|
||||
<if test="user.productDensity != null">
|
||||
product_density = #{user.productDensity},
|
||||
</if>
|
||||
<if test="${user.purchaseWeight != null}">
|
||||
<if test="user.purchaseWeight != null">
|
||||
purchase_weight = #{user.purchaseWeight},
|
||||
</if>
|
||||
<if test="${user.purchasePrice != null}">
|
||||
<if test="user.purchasePrice != null">
|
||||
purchase_price = #{user.purchasePrice},
|
||||
</if>
|
||||
<if test="${user.totalAmount != null}">
|
||||
<if test="user.totalAmount != null">
|
||||
total_amount = #{user.totalAmount},
|
||||
</if>
|
||||
<if test="${user.purchaseVolume != null}">
|
||||
<if test="user.purchaseVolume != null">
|
||||
purchase_volume = #{user.purchaseVolume},
|
||||
</if>
|
||||
<if test="${user.discountedPrice != null}">
|
||||
<if test="user.discountedPrice != null">
|
||||
discounted_price = #{user.discountedPrice},
|
||||
</if>
|
||||
update_time = NOW()
|
||||
|
@ -50,7 +50,7 @@ public interface OilPurchaseOrderService {
|
||||
|
||||
/**
|
||||
* 批量处理数据
|
||||
* @param oilInventoryOrder
|
||||
* @param oilPurchaseOrders
|
||||
* @return
|
||||
*/
|
||||
int disposeBatch(List<OilPurchaseOrder> oilPurchaseOrders);
|
||||
|
@ -2,6 +2,7 @@ package com.fuint.business.petrolStationManagement.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.petrolStationManagement.dto.OilPurchase4OrdDTO;
|
||||
import com.fuint.business.petrolStationManagement.dto.OilPurchaseDTO;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilPurchase;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilTank;
|
||||
@ -46,6 +47,8 @@ public interface OilPurchaseService {
|
||||
*/
|
||||
OilPurchase insert(OilPurchase oilPurchase);
|
||||
|
||||
OilPurchase unifiedProcessing(OilPurchase4OrdDTO oilPurchase);
|
||||
|
||||
/**
|
||||
* 订单审核
|
||||
* @param oilPurchase
|
||||
|
@ -102,15 +102,15 @@ public class OilInventoryOrderServiceImpl implements OilInventoryOrderService {
|
||||
|
||||
// 计算当前均进价
|
||||
public Double calculateTheAveragePrice(Integer tankId) {
|
||||
BigDecimal bigSunPrice = new BigDecimal(0);
|
||||
BigDecimal bigSumL = new BigDecimal(0);
|
||||
BigDecimal bigSunPrice = new BigDecimal("0");
|
||||
BigDecimal bigSumL = new BigDecimal("0");
|
||||
|
||||
// 根据油罐id查询到所有的订单
|
||||
List<OilPurchaseOrder> oilPurchaseOrders = oilPurchaseOrderMapper.getlistByTankId(tankId);
|
||||
// 计算每个订单的平均进价并进行相加
|
||||
for (OilPurchaseOrder oilPurchaseOrder : oilPurchaseOrders) {
|
||||
bigSunPrice.add( new BigDecimal(oilPurchaseOrder.getTotalAmount()));
|
||||
bigSumL.add( new BigDecimal(oilPurchaseOrder.getPurchaseVolume()));
|
||||
bigSunPrice.add( new BigDecimal(oilPurchaseOrder.getTotalAmount().toString()));
|
||||
bigSumL.add( new BigDecimal(oilPurchaseOrder.getPurchaseVolume().toString()));
|
||||
}
|
||||
// 用总的钱数/总的量
|
||||
BigDecimal result = new BigDecimal(0);
|
||||
|
@ -21,6 +21,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -123,7 +125,7 @@ public class OilPurchaseOrderServiceImpl implements OilPurchaseOrderService {
|
||||
oilPurchaseOrderDao.insertBatch(insPurchase);
|
||||
}
|
||||
if (updatePurchase.size()>0) {
|
||||
int i = oilPurchaseOrderDao.updateBatch(updatePurchase);
|
||||
oilPurchaseOrderDao.updateBatch(updatePurchase);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -198,8 +200,6 @@ public class OilPurchaseOrderServiceImpl implements OilPurchaseOrderService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean storage(Integer id) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
|
||||
String oilIntake = "进油入库";
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
@ -212,7 +212,14 @@ public class OilPurchaseOrderServiceImpl implements OilPurchaseOrderService {
|
||||
oilTank.setId(oilPurchaseOrderVO.getTankId());
|
||||
oilTank.setStoredQuantity(oilPurchaseOrderVO.getPurchaseVolume());
|
||||
oilTank.setTotalPrice(oilPurchaseOrderVO.getTotalAmount());
|
||||
oilTank.setDiscountedPrice(oilPurchaseOrderVO.getPurchasePrice());
|
||||
// oilTank.setDiscountedPrice(oilPurchaseOrderVO.getDiscountedPrice());
|
||||
|
||||
// 单价计算
|
||||
OilTank oilTankSum = oilTankMapper.queryById(oilPurchaseOrderVO.getTankId());
|
||||
BigDecimal totalSum= new BigDecimal(oilPurchaseOrderVO.getTotalAmount().toString()).add(new BigDecimal(oilTankSum.getTotalPrice().toString()));
|
||||
BigDecimal volSum= new BigDecimal(oilPurchaseOrderVO.getPurchaseVolume().toString()).add(new BigDecimal(oilTankSum.getStoredQuantity().toString()));
|
||||
BigDecimal disPrice = totalSum.divide(volSum, 2, RoundingMode.HALF_UP);
|
||||
oilTank.setDiscountedPrice(disPrice.doubleValue());
|
||||
oilTankMapper.accumulate(oilTank);
|
||||
// 插入到库存跟踪
|
||||
OilTracking oilTracking = new OilTracking();
|
||||
@ -224,8 +231,6 @@ public class OilPurchaseOrderServiceImpl implements OilPurchaseOrderService {
|
||||
oilTracking.setOrderNumber(oilPurchaseOrderVO.getPurchaseNo());
|
||||
oilTrackingMapper.insert(oilTracking);
|
||||
}
|
||||
|
||||
// 2.将数据填充到油罐里面
|
||||
String status = "qrts";
|
||||
|
||||
boolean edit = edit(id);
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.fuint.business.petrolStationManagement.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.petrolStationManagement.dto.OilPurchase4OrdDTO;
|
||||
import com.fuint.business.petrolStationManagement.dto.OilPurchaseDTO;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilPurchase;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilPurchaseOrder;
|
||||
@ -18,8 +20,10 @@ import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -38,6 +42,10 @@ public class OilPurchaseServiceImpl implements OilPurchaseService {
|
||||
@Resource
|
||||
private OilPurchaseOrderMapper oilPurchaseOrderMapper;
|
||||
|
||||
@Resource
|
||||
private OilPurchaseOrderMapper oilPurchaseOrderDao;
|
||||
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
@ -117,20 +125,62 @@ public class OilPurchaseServiceImpl implements OilPurchaseService {
|
||||
oilPurchase.setCreator(nowAccountInfo.getStaffId().toString());
|
||||
|
||||
oilPurchase.setStatus("await");
|
||||
// 获取当前时间
|
||||
// Date currentDate = new Date();
|
||||
// oilPurchase.setCreatedAt(new Date());
|
||||
// // 创建一个SimpleDateFormat对象,指定想要的日期时间格式
|
||||
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
//
|
||||
// // 使用SimpleDateFormat格式化日期时间
|
||||
// String formattedDate = dateFormat.format(currentDate);
|
||||
|
||||
|
||||
this.oilPurchaseDao.insert(oilPurchase);
|
||||
return oilPurchase;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public OilPurchase unifiedProcessing(OilPurchase4OrdDTO oilPurchase) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
OilPurchase oilPurchase1 = oilPurchase.getOilPurchase();
|
||||
|
||||
if (!ObjectUtil.isEmpty(oilPurchase1.getId())) {
|
||||
// 修改
|
||||
oilPurchase1.setUpdateBy(nowAccountInfo.getStaffId().toString());
|
||||
this.oilPurchaseDao.update(oilPurchase1);
|
||||
}else {
|
||||
oilPurchase1.setStoreId(nowAccountInfo.getStoreId());
|
||||
oilPurchase1.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
oilPurchase1.setCreator(nowAccountInfo.getStaffId().toString());
|
||||
oilPurchase1.setStatus("await");
|
||||
this.oilPurchaseDao.insert(oilPurchase1);
|
||||
}
|
||||
|
||||
|
||||
List<OilPurchaseOrder> oilPurchaseOrders = oilPurchase.getOilPurchaseOrders();
|
||||
if (!ObjectUtil.isEmpty(oilPurchase1.getId())) {
|
||||
if (!ObjectUtil.isEmpty(oilPurchaseOrders)) {
|
||||
for (OilPurchaseOrder oilPurchaseOrder : oilPurchaseOrders) {
|
||||
oilPurchaseOrder.setPurchaseId(oilPurchase1.getId());
|
||||
}
|
||||
List<OilPurchaseOrder> insPurchase = new ArrayList<>();
|
||||
List<OilPurchaseOrder> updatePurchase = new ArrayList<>();
|
||||
if (oilPurchaseOrders.size()>0) {
|
||||
for (OilPurchaseOrder oilPurchaseOrder : oilPurchaseOrders) {
|
||||
if (oilPurchaseOrder.getId() != null) {
|
||||
updatePurchase.add(oilPurchaseOrder);
|
||||
}else {
|
||||
oilPurchaseOrder.setStoreId(nowAccountInfo.getStoreId());
|
||||
oilPurchaseOrder.setUpdateBy(nowAccountInfo.getStaffId().toString());
|
||||
insPurchase.add(oilPurchaseOrder);
|
||||
}
|
||||
}
|
||||
if (insPurchase.size()>0) {
|
||||
oilPurchaseOrderDao.insertBatch(insPurchase);
|
||||
}
|
||||
if (updatePurchase.size()>0) {
|
||||
oilPurchaseOrderDao.updateBatch(updatePurchase);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return oilPurchase1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 订单审核
|
||||
* @param oilPurchase
|
||||
|
74
fuintCashierWeb/src/api/cashier/cardSet.js
Normal file
74
fuintCashierWeb/src/api/cashier/cardSet.js
Normal file
@ -0,0 +1,74 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 分页查询列表
|
||||
export function getList(query) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardFuelDiesel',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 分页查询列表
|
||||
export function getCountOilTypeApi(query) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardFuelDiesel/countOilType',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询余额券
|
||||
export function getCardValueListApi(query) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardValue',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 余额支付
|
||||
export function getPrepaidCardTopUpApi(query) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardValueRecord/prepaidCardTopUp',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 余额插入订单
|
||||
export function getCheckTheStatusOfYourPaymentApi(query) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardValueRecord/checkTheStatusOfYourPayment?id='+query,
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 根据字典类型查询字典数据信息
|
||||
export function getDicts(dictType) {
|
||||
return request({
|
||||
url: '/system/dict/data/type/' + dictType,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 余额支付 油卡
|
||||
export function getPrepaidFuelTopUpApi(query) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardFuelRecord/prepaidFuelTopUp',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 余额插入订单 油卡
|
||||
export function getCheckTheStatusOfYourPaymentByFuelApi(query) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardFuelRecord/checkTheStatusOfYourPaymentByFuel?id='+query,
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
27
fuintCashierWeb/src/api/cashier/returnrecord.js
Normal file
27
fuintCashierWeb/src/api/cashier/returnrecord.js
Normal file
@ -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
|
||||
})
|
||||
}
|
10
fuintCashierWeb/src/api/staff/client.js
Normal file
10
fuintCashierWeb/src/api/staff/client.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询省市区详细
|
||||
export function getClient() {
|
||||
return request({
|
||||
url: '/province/region/tree',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
18
fuintCashierWeb/src/api/staff/duty.js
Normal file
18
fuintCashierWeb/src/api/staff/duty.js
Normal file
@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询角色列表
|
||||
export function listDuty(query) {
|
||||
return request({
|
||||
url: '/business/member/duty/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询角色详细
|
||||
export function getDuty(id) {
|
||||
return request({
|
||||
url: '/business/member/duty/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
52
fuintCashierWeb/src/api/staff/qrcode.js
Normal file
52
fuintCashierWeb/src/api/staff/qrcode.js
Normal file
@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询二维码列表
|
||||
export function listQRCode(query) {
|
||||
return request({
|
||||
url: '/business/storeInformation/qrCode/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询二维码详细
|
||||
export function qrCodeInfo() {
|
||||
return request({
|
||||
url: '/business/storeInformation/qrCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询二维码详细
|
||||
export function getQRCode(id) {
|
||||
return request({
|
||||
url: '/business/storeInformation/qrCode/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增二维码
|
||||
export function addQRCode(data) {
|
||||
return request({
|
||||
url: '/business/storeInformation/qrCode',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改二维码
|
||||
export function updateQRCode(data) {
|
||||
return request({
|
||||
url: '/business/storeInformation/qrCode',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除二维码
|
||||
export function delQRCode(id) {
|
||||
return request({
|
||||
url: '/business/storeInformation/qrCode/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
61
fuintCashierWeb/src/api/staff/staff.js
Normal file
61
fuintCashierWeb/src/api/staff/staff.js
Normal file
@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询员工列表
|
||||
export function listStaff(query) {
|
||||
return request({
|
||||
url: '/business/member/staff/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询所有员工
|
||||
export function queryStaffs() {
|
||||
return request({
|
||||
url: '/business/member/staff/query',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询员工详细
|
||||
export function getStaff(id) {
|
||||
return request({
|
||||
url: '/business/member/staff/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据手机号查询员工详情
|
||||
export function queryStaff(data) {
|
||||
return request({
|
||||
url: '/business/member/staff/mobile',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增员工
|
||||
export function addStaff(data) {
|
||||
return request({
|
||||
url: '/business/member/staff',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改员工
|
||||
export function updateStaff(data) {
|
||||
return request({
|
||||
url: '/business/member/staff',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除员工
|
||||
export function delStaff(id) {
|
||||
return request({
|
||||
url: '/business/member/staff/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
26
fuintCashierWeb/src/api/staff/store.js
Normal file
26
fuintCashierWeb/src/api/staff/store.js
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询店铺详细
|
||||
export function ljStoreInfo() {
|
||||
return request({
|
||||
url: '/business/storeInformation/store',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询店铺详细
|
||||
export function ljStoreList() {
|
||||
return request({
|
||||
url: '/business/storeInformation/store/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改店铺信息
|
||||
export function updateStore(data) {
|
||||
return request({
|
||||
url: '/business/storeInformation/store',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
61
fuintCashierWeb/src/api/staff/user/certifiedmember.js
Normal file
61
fuintCashierWeb/src/api/staff/user/certifiedmember.js
Normal file
@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询固定等级列表
|
||||
export function listCertifiedMember(query) {
|
||||
return request({
|
||||
url: '/business/userManager/certifiedMember/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询固定等级详细
|
||||
export function getCertifiedMember(id) {
|
||||
return request({
|
||||
url: '/business/userManager/certifiedMember/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据会员id查询固定等级详细
|
||||
export function getCertifiedMemberByUserId(userId) {
|
||||
return request({
|
||||
url: '/business/userManager/certifiedMember/userId/' + userId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增固定等级
|
||||
export function addCertifiedMember(data) {
|
||||
return request({
|
||||
url: '/business/userManager/certifiedMember',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 批量新增固定等级
|
||||
export function addCertifiedMembers(data) {
|
||||
return request({
|
||||
url: '/business/userManager/certifiedMember/members',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改固定等级
|
||||
export function updateCertifiedMember(data) {
|
||||
return request({
|
||||
url: '/business/userManager/certifiedMember',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除固定等级
|
||||
export function delCertifiedMember(id) {
|
||||
return request({
|
||||
url: '/business/userManager/certifiedMember/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
19
fuintCashierWeb/src/api/staff/user/chainstoreconfig.js
Normal file
19
fuintCashierWeb/src/api/staff/user/chainstoreconfig.js
Normal file
@ -0,0 +1,19 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询会员详细
|
||||
export function getChainStoreConfig() {
|
||||
return request({
|
||||
url: '/business/userManager/chainStoreConfig',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改会员
|
||||
export function updateChainStoreConfig(data) {
|
||||
return request({
|
||||
url: '/business/userManager/chainStoreConfig',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
53
fuintCashierWeb/src/api/staff/user/fixinglevel.js
Normal file
53
fuintCashierWeb/src/api/staff/user/fixinglevel.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询固定等级列表
|
||||
export function listFixingLevel(query) {
|
||||
return request({
|
||||
url: '/business/userManager/fixingLevel/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询固定等级详细
|
||||
export function getFixingLevel(id) {
|
||||
return request({
|
||||
url: '/business/userManager/fixingLevel/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据固定等级名称查询固定等级信息
|
||||
export function queryFixingLevel(data) {
|
||||
return request({
|
||||
url: '/business/userManager/fixingLevel/getName',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增固定等级
|
||||
export function addFixingLevel(data) {
|
||||
return request({
|
||||
url: '/business/userManager/fixingLevel',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改固定等级
|
||||
export function updateFixingLevel(data) {
|
||||
return request({
|
||||
url: '/business/userManager/fixingLevel',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除固定等级
|
||||
export function delFixingLevel(id) {
|
||||
return request({
|
||||
url: '/business/userManager/fixingLevel/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
9
fuintCashierWeb/src/api/staff/user/sysconfig.js
Normal file
9
fuintCashierWeb/src/api/staff/user/sysconfig.js
Normal file
@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询会员详细
|
||||
export function getSysConfig(key) {
|
||||
return request({
|
||||
url: '/sysConfig/getByKey/' + key,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
78
fuintCashierWeb/src/api/staff/user/user.js
Normal file
78
fuintCashierWeb/src/api/staff/user/user.js
Normal file
@ -0,0 +1,78 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询会员列表
|
||||
export function listUser(query) {
|
||||
return request({
|
||||
url: '/business/userManager/user/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询会员统计列表
|
||||
export function listUserStatistic(query) {
|
||||
return request({
|
||||
url: '/business/userManager/userStatistic/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询会员列表
|
||||
export function listStatistic(query) {
|
||||
return request({
|
||||
url: '/business/userManager/user/statistic',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询会员详细
|
||||
export function getUser(id) {
|
||||
return request({
|
||||
url: '/business/userManager/user/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 根据手机号查询会员详细
|
||||
export function getUserMobile(data) {
|
||||
return request({
|
||||
url: '/business/userManager/user/mobile' ,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增会员
|
||||
export function addUser(data) {
|
||||
return request({
|
||||
url: '/business/userManager/user',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改会员
|
||||
export function updateUser(data) {
|
||||
return request({
|
||||
url: '/business/userManager/user',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除会员
|
||||
export function delUser(id) {
|
||||
return request({
|
||||
url: '/business/userManager/user/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
//下载示例文件
|
||||
export function exportUsers() {
|
||||
return request({
|
||||
url: '/excel/export',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
53
fuintCashierWeb/src/api/staff/user/usergrade.js
Normal file
53
fuintCashierWeb/src/api/staff/user/usergrade.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询会员等级列表
|
||||
export function listUserGrade(query) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询会员等级详细
|
||||
export function getUserGrade(id) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据会员等级名称查询会员等级信息
|
||||
export function queryUserGrade(data) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade/getName',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增会员等级
|
||||
export function addUserGrade(data) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改会员等级
|
||||
export function updateUserGrade(data) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除会员等级
|
||||
export function delUserGrade(id) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
273
fuintCashierWeb/src/components/local/selectStaff.vue
Normal file
273
fuintCashierWeb/src/components/local/selectStaff.vue
Normal file
@ -0,0 +1,273 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card >
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.realName"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="mobile">
|
||||
<el-input
|
||||
v-model="queryParams.mobile"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="状态" prop="auditedStatus">-->
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="queryParams.status"-->
|
||||
<!-- placeholder="状态"-->
|
||||
<!-- clearable-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in dict.type.zhzt"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<!-- <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>-->
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top: 20px" >
|
||||
|
||||
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange"
|
||||
@row-click="handleRowClick"
|
||||
:default-sort="defaultSort" @sort-change="handleSortChange">
|
||||
<el-table-column label="ID" align="center" prop="id" width="80" />
|
||||
<el-table-column label="姓名" align="center" prop="realName" />
|
||||
<el-table-column label="手机号" align="center" prop="mobile" width="110"/>
|
||||
|
||||
|
||||
<el-table-column label="员工状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status=='qy'">启用</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.status=='jy'">禁用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getName} from "../../utils/fuint";
|
||||
import {addStaff, delStaff, getStaff, listStaff, queryStaff, updateStaff} from "@/api/staff/staff";
|
||||
import {getDuty, listDuty} from "@/api/staff/duty";
|
||||
|
||||
export default {
|
||||
name: "selectStaff",
|
||||
dicts: ['zhzt','transaction','time_frame','handover','handover_quit',
|
||||
'jbjl','official','notice','special_prem','role','shqx'],
|
||||
data() {
|
||||
return {
|
||||
// 角色列表
|
||||
roleList:[],
|
||||
drawer: false,
|
||||
// 标题
|
||||
title: "",
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
storeOptions: [],
|
||||
// role:[],
|
||||
posPrem:'',
|
||||
|
||||
props: { multiple: true },
|
||||
appletPrem:'',
|
||||
|
||||
writeOff:[],
|
||||
write:[],
|
||||
specialPrem:[],
|
||||
auditPrem:[],
|
||||
special:[],
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 表格数据
|
||||
list: [],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 默认排序
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
// 表单参数
|
||||
form: {
|
||||
id:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'',
|
||||
auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'jbtc', record:'qbjl',
|
||||
merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'advice_jy', oilGunId:'', timeFrame:'bx', refund:'yqx',
|
||||
transaction:'qbjy', writeOff:'',auditPrem:'',specialPrem:'', official:'', status:'qy',pos:'jy',roleId:''
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
realName: '',
|
||||
mobile: '',
|
||||
status: ''
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDuty();
|
||||
// this.getStoreList();
|
||||
},
|
||||
methods: {
|
||||
showDesc(){
|
||||
this.drawer = true;
|
||||
},
|
||||
handleNodeClick1(data) {
|
||||
this.form.posPrem = JSON.stringify(data);
|
||||
},
|
||||
handleNodeClick2(data) {
|
||||
this.form.appletPrem = JSON.stringify(data);
|
||||
},
|
||||
getCheckbox(){
|
||||
this.form.writeOff = this.writeOff.toString();
|
||||
this.form.specialPrem = this.specialPrem.toString();
|
||||
this.form.auditPrem = this.auditPrem.toString();
|
||||
},
|
||||
// 页面跳转
|
||||
toTarget(url) {
|
||||
this.$router.push( { path: url } );
|
||||
},
|
||||
getName,
|
||||
// 查询列表
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listStaff(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
// 查询角色列表
|
||||
getDuty(){
|
||||
listDuty().then(response => {
|
||||
this.roleList = response.data
|
||||
})
|
||||
},
|
||||
// 店铺列表
|
||||
getStoreList() {
|
||||
listStaff().then(response => {
|
||||
this.storeOptions = response.data.records;
|
||||
}
|
||||
);
|
||||
},
|
||||
// 搜索按钮操作
|
||||
handleQuery() {
|
||||
this.queryParams.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 重置按钮操作
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
|
||||
this.handleQuery();
|
||||
},
|
||||
// 状态修改
|
||||
handleStatusChange(row) {
|
||||
let text = row.auditedStatus == "A" ? "启用" : "禁用";
|
||||
this.$modal.confirm('确认要' + text + '"' + row.realName + '"吗?').then(function() {
|
||||
// return updateStaffStatus(row.id, row.auditedStatus);
|
||||
return updateStaff({id:row.id, auditedStatus:row.auditedStatus})
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess(text + "成功");
|
||||
}).catch(function() {
|
||||
row.auditedStatus = row.auditedStatus === "A" ? "A" : "N";
|
||||
});
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.operId)
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
// 排序触发事件
|
||||
handleSortChange(column, prop, order) {
|
||||
this.queryParams.orderByColumn = column.prop;
|
||||
this.queryParams.isAsc = column.order;
|
||||
this.getList();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.posPrem = '';
|
||||
this.appletPrem = '';
|
||||
this.writeOff = [];
|
||||
this.auditPrem = [];
|
||||
this.form = {
|
||||
id:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'A',
|
||||
auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'jbtc', record:'qbjl',
|
||||
merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'advice_jy', oilGunId:'', timeFrame:'bx', refund:'yqx',
|
||||
transaction:'qbjy', writeOff:'',auditPrem:'',specialPrem:'', official:'', status:'qy',pos:'jy',roleId:''
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
handleRowClick(row) {
|
||||
this.$refs.tables.clearSelection(); // 清除当前选中的行
|
||||
this.$refs.tables.toggleRowSelection(row); // 选中当前点击的行
|
||||
// 处理选中的行数据
|
||||
let file = {
|
||||
mtStaffId: row.id,
|
||||
realName: row.realName,
|
||||
staffMobile: row.mobile,
|
||||
}
|
||||
this.$emit('send-data', file);
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-container{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f8f9;
|
||||
}
|
||||
.pagin-box{
|
||||
background: white;
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
}
|
||||
.baoguo{
|
||||
background: white;
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
@ -141,7 +141,11 @@
|
||||
</div>
|
||||
<div class="title-goods">
|
||||
<el-tag type="danger" size="mini" effect="dark">{{item.exchangeMethod}}</el-tag>
|
||||
<span style="margin-left: 5px">{{item.giftName}}</span>
|
||||
<!-- <span style="margin-left: 5px">{{item.giftName}}</span>-->
|
||||
<el-tooltip class="item" effect="dark" :content="item.giftName" placement="top-start">
|
||||
|
||||
<span style="margin-left: 5px; display: inline-block; max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{{ item.giftName }}</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</el-badge>
|
||||
@ -403,6 +407,7 @@ import {
|
||||
queryParams: {
|
||||
categoryId:'',
|
||||
giftName:'',
|
||||
deliveryMethod:'门店自提',
|
||||
page: 1,
|
||||
pageSize: 10000,
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-center">
|
||||
|
||||
<!-- 查询-->
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>挂账</span>
|
||||
@ -89,7 +89,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 统计-->
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>统计</span>
|
||||
@ -102,6 +102,7 @@
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 挂账列表-->
|
||||
<el-card class="box-card">
|
||||
<div class="wgang">
|
||||
<div>列表</div>
|
||||
@ -138,65 +139,35 @@
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="orderNo"
|
||||
label="单据号"
|
||||
width="200">
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderNo" label="单据号" width="200"></el-table-column>
|
||||
<el-table-column label="挂账单位">
|
||||
<el-table-column
|
||||
prop="unitName"
|
||||
label="单位名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="personCredit"
|
||||
label="挂账人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="contactMobile"
|
||||
label="联系电话">
|
||||
</el-table-column>
|
||||
<el-table-column prop="unitName" label="单位名称"> </el-table-column>
|
||||
<el-table-column prop="personCredit" label="挂账人"> </el-table-column>
|
||||
<el-table-column prop="contactMobile" label="联系电话"> </el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="记录明细">
|
||||
<el-table-column
|
||||
prop="returnType"
|
||||
label="类型">
|
||||
<el-table-column prop="returnType" label="类型">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.returnType == 0">挂账</el-tag>
|
||||
<el-tag v-else type="success">归还</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="amount"
|
||||
label="金额">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="status"
|
||||
label="状态">
|
||||
<el-table-column prop="amount" label="金额"> </el-table-column>
|
||||
<el-table-column prop="status" label="状态">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.status == 0">未归还</span>
|
||||
<span v-else-if="scope.row.status == 1" type="success">已归还</span>
|
||||
<span v-else type="success">部分归还</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="outstandAmount" label="未归还金额"> </el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="realName"
|
||||
label="操作人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
width="220">
|
||||
<el-table-column prop="realName" label="操作人"> </el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" width="220">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column-->
|
||||
<!-- prop="zip"-->
|
||||
<!-- label="操作"-->
|
||||
<!-- width="220">-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button-->
|
||||
@ -204,17 +175,17 @@
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
:disabled="scope.row.status == 1"
|
||||
@click="repay(scope.row.id)"
|
||||
>归还</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="returnRecord(scope.row.id)"
|
||||
>归还详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -233,6 +204,90 @@
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 归还记录信息-->
|
||||
<el-drawer
|
||||
title="归还详情"
|
||||
:visible.sync="drawer"
|
||||
direction="rtl"
|
||||
size="55%"
|
||||
:before-close="handleClose">
|
||||
<div style="display: grid; place-items: center;">
|
||||
<el-card style="background-color: #f5f5f5;width: 90%">
|
||||
<div slot="header" class="clearfix">
|
||||
<div style="position: relative;">
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
|
||||
<h2>单据号:{{record.orderNo}}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<span>操作员工:</span>
|
||||
<span>{{ record.realName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div >
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<span>挂账单位</span>
|
||||
<span>{{record.unitName}}</span>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between;margin: 10px 0">
|
||||
<span>挂账人</span>
|
||||
<span>{{record.personCredit}}</span>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<span>联系电话</span>
|
||||
<span>{{record.contactMobile}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 15px;width: 90%">
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="returnRecordList">
|
||||
<el-table-column label="单据号" align="center" prop="orderNo" width="200"></el-table-column>
|
||||
<el-table-column label="类型" align="center" prop="returnType">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.returnType == 0">挂账</el-tag>
|
||||
<el-tag v-else type="success">归还</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="归还金额" align="center" prop="amount" />
|
||||
<el-table-column label="找零金额" align="center" prop="seekZero" />
|
||||
<el-table-column label="归还方式" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getPayMeth(payList,scope.row.status) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付状态" align="center" prop="payStatus">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.payStatus == 'unpaid'">未支付</el-tag>
|
||||
<el-tag type="success" v-else-if="scope.row.payStatus == 'paid'">已支付</el-tag>
|
||||
<el-tag type="danger" v-else>支付失败</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" align="center" prop="realName" />
|
||||
<el-table-column label="支付时间" align="center" prop="payTime" width="200">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.payTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination-box">
|
||||
<el-pagination
|
||||
background
|
||||
layout="prev, pager, next"
|
||||
v-show="total2>0"
|
||||
:total="total2"
|
||||
:page.sync="queryParams1.page"
|
||||
:limit.sync="queryParams1.pageSize"
|
||||
@current-change="getRecordList">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-drawer>
|
||||
|
||||
<!-- 新增挂账记录-->
|
||||
<el-dialog title="新增挂账记录" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
@ -387,12 +442,18 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="归还方式" prop="payType">
|
||||
<el-radio-group v-model="form2.payType">
|
||||
<el-radio v-for="item in payList"
|
||||
:key="item.dictValue"
|
||||
:value="item.dictValue"
|
||||
:label="item.dictValue" border>{{ item.dictLabel }}</el-radio>
|
||||
</el-radio-group>
|
||||
<!-- <el-radio-group v-model="form2.payType"-->
|
||||
<!-- @click="returnMethod">-->
|
||||
<!-- <el-radio v-for="item in payList"-->
|
||||
<!-- :key="item.dictValue"-->
|
||||
<!-- :value="item.dictValue"-->
|
||||
<!-- :label="item.dictValue" border>{{ item.dictLabel }}</el-radio>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<el-radio v-model="payType" v-for="item in payList"
|
||||
:key="item.dictValue" :value="item.dictValue"
|
||||
:label="item.dictValue"
|
||||
@input="returnMethod"
|
||||
border>{{ item.dictLabel }}</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -416,23 +477,39 @@
|
||||
¥{{ payAmount }}
|
||||
</div>
|
||||
<div style="text-align: center;color: grey;font-size: 14px;margin: 20px 0">请自行核实归还金额,提交完成后将自动处理</div>
|
||||
<div>
|
||||
<el-input v-model="authCode"
|
||||
autofocus="autofocus"
|
||||
@keydown.enter.native="collection"
|
||||
placeholder="扫描或输入付款码、支持微信、支付宝、云闪付">
|
||||
<i
|
||||
slot="suffix">
|
||||
<svg t="1697791915471" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1479" width="32" height="32"><path d="M149.333333 170.858667A21.546667 21.546667 0 0 1 170.858667 149.333333H384V106.666667H170.858667A64.213333 64.213333 0 0 0 106.666667 170.858667V384h42.666666V170.858667zM170.858667 874.666667A21.546667 21.546667 0 0 1 149.333333 853.141333V640H106.666667v213.141333A64.213333 64.213333 0 0 0 170.858667 917.333333H384v-42.666666H170.858667zM853.12 149.333333A21.546667 21.546667 0 0 1 874.666667 170.858667V384h42.666666V170.858667A64.213333 64.213333 0 0 0 853.141333 106.666667H640v42.666666h213.141333zM874.666667 853.141333A21.546667 21.546667 0 0 1 853.141333 874.666667H640v42.666666h213.141333A64.213333 64.213333 0 0 0 917.333333 853.141333V640h-42.666666v213.141333zM106.666667 490.666667h810.666666v42.666666H106.666667v-42.666666z" fill="#3D3D3D" p-id="1480"></path></svg>
|
||||
</i>
|
||||
</el-input>
|
||||
<div v-if="payType != 'CASH'">
|
||||
<div>
|
||||
<el-input v-model="authCode"
|
||||
autofocus="autofocus"
|
||||
@keydown.enter.native="collection"
|
||||
placeholder="扫描或输入付款码、支持微信、支付宝、云闪付">
|
||||
<i
|
||||
slot="suffix">
|
||||
<svg t="1697791915471" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1479" width="32" height="32"><path d="M149.333333 170.858667A21.546667 21.546667 0 0 1 170.858667 149.333333H384V106.666667H170.858667A64.213333 64.213333 0 0 0 106.666667 170.858667V384h42.666666V170.858667zM170.858667 874.666667A21.546667 21.546667 0 0 1 149.333333 853.141333V640H106.666667v213.141333A64.213333 64.213333 0 0 0 170.858667 917.333333H384v-42.666666H170.858667zM853.12 149.333333A21.546667 21.546667 0 0 1 874.666667 170.858667V384h42.666666V170.858667A64.213333 64.213333 0 0 0 853.141333 106.666667H640v42.666666h213.141333zM874.666667 853.141333A21.546667 21.546667 0 0 1 853.141333 874.666667H640v42.666666h213.141333A64.213333 64.213333 0 0 0 917.333333 853.141333V640h-42.666666v213.141333zM106.666667 490.666667h810.666666v42.666666H106.666667v-42.666666z" fill="#3D3D3D" p-id="1480"></path></svg>
|
||||
</i>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="demo-image">
|
||||
<div class="block" style="text-align: center">
|
||||
<el-image
|
||||
style="width: 200px; height: 200px"
|
||||
fit="cover"
|
||||
src="https://oil.wudb.cn/static/img/scan-demo.fcb8b1ab.png"></el-image>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="demo-image">
|
||||
<div class="block" style="text-align: center">
|
||||
<el-image
|
||||
style="width: 200px; height: 200px"
|
||||
fit="cover"
|
||||
src="https://oil.wudb.cn/static/img/scan-demo.fcb8b1ab.png"></el-image>
|
||||
<div v-else>
|
||||
<div>
|
||||
<el-input v-model="authCode"
|
||||
autofocus="autofocus"
|
||||
@input="changeSeekZero"
|
||||
@keydown.enter.native="collection"
|
||||
placeholder="请输入收款金额">
|
||||
</el-input>
|
||||
</div>
|
||||
<div style="text-align: right;margin: 10px 0">
|
||||
<span>应找零</span>
|
||||
<span style="color: red;font-size: 18px"> ¥{{ seekZero }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
@ -562,7 +639,8 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="归还方式" prop="payType">
|
||||
<el-radio-group v-model="form4.payType">
|
||||
<el-radio-group v-model="form4.payType"
|
||||
@input="changePayType">
|
||||
<el-radio v-for="item in payList"
|
||||
:key="item.dictValue"
|
||||
:value="item.dictValue"
|
||||
@ -592,6 +670,7 @@ import {
|
||||
} from "@/api/cashier/hangbill";
|
||||
import {addCreditUnit, listCreditUnit} from "@/api/cashier/creditunit";
|
||||
import {getDicts} from "@/api/dict/data";
|
||||
import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/cashier/returnrecord";
|
||||
|
||||
export default {
|
||||
name: "credit",
|
||||
@ -605,6 +684,8 @@ import {getDicts} from "@/api/dict/data";
|
||||
repaidAmount:0,
|
||||
// 付款金额
|
||||
payAmount:0,
|
||||
// 找零金额
|
||||
seekZero:0,
|
||||
authCode:"",
|
||||
list:[],
|
||||
// 选中表格数据
|
||||
@ -613,6 +694,7 @@ import {getDicts} from "@/api/dict/data";
|
||||
isPay:true,
|
||||
isPaySuccess:false,
|
||||
loading: false,
|
||||
drawer: false,
|
||||
// 弹出框标题
|
||||
title:'',
|
||||
// 支付方式列表
|
||||
@ -620,6 +702,8 @@ import {getDicts} from "@/api/dict/data";
|
||||
unit:'',
|
||||
// 挂账单位列表
|
||||
unitList:[],
|
||||
// 付款方式
|
||||
payType:"WECHAT",
|
||||
form:{},
|
||||
form1:{
|
||||
unitName:"",
|
||||
@ -632,6 +716,8 @@ import {getDicts} from "@/api/dict/data";
|
||||
form2:{payType:"WECHAT"},
|
||||
form3:{},
|
||||
form4:{payType:"WECHAT"},
|
||||
// 挂账信息
|
||||
record:{},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
page: 1,
|
||||
@ -641,13 +727,21 @@ import {getDicts} from "@/api/dict/data";
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
queryParams1: {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
hangBillId:"",
|
||||
},
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 挂账记录列表
|
||||
hangBillList:[],
|
||||
// 归还记录列表
|
||||
returnRecordList:[],
|
||||
// 总条数
|
||||
total: 0,
|
||||
total1: 0,
|
||||
total2: 0,
|
||||
// 是否开启提示框
|
||||
open:false,
|
||||
open1:false,
|
||||
@ -661,6 +755,7 @@ import {getDicts} from "@/api/dict/data";
|
||||
isBatch:false,
|
||||
timer:"",
|
||||
unitName:"",
|
||||
orderNo:"",
|
||||
// 表单校验
|
||||
rules: {
|
||||
unitName: [ { required: true, message: "请选择挂账单位", trigger: "blur" }, ],
|
||||
@ -737,15 +832,64 @@ import {getDicts} from "@/api/dict/data";
|
||||
this.getLists();
|
||||
},
|
||||
methods:{
|
||||
getPayMeth(list,val){
|
||||
let name = "";
|
||||
if (list!=null && list!=""){
|
||||
list.forEach(item => {
|
||||
if (item.dictValue == val){
|
||||
name = item.dictLabel
|
||||
}
|
||||
})
|
||||
}
|
||||
return name;
|
||||
},
|
||||
// 是否关闭弹框
|
||||
handleClose(done) {
|
||||
done();
|
||||
},
|
||||
// 归还记录详情弹框
|
||||
returnRecord(id){
|
||||
this.record = {}
|
||||
this.drawer = true
|
||||
hangBillInfo(id).then(response => {
|
||||
this.record = response.data
|
||||
})
|
||||
this.getRecordList(id,1);
|
||||
},
|
||||
getRecordList(id,val){
|
||||
if (val!=1){
|
||||
this.queryParams1.page = id
|
||||
this.queryParams1.hangBillId = this.record.id
|
||||
}else {
|
||||
this.queryParams1.hangBillId = id
|
||||
}
|
||||
listReturnRecord(this.queryParams1).then(response => {
|
||||
this.returnRecordList = response.data.records
|
||||
this.total2 = response.data.total
|
||||
})
|
||||
},
|
||||
changePayType(val){
|
||||
this.payType = val
|
||||
},
|
||||
// 归还方式
|
||||
returnMethod(val){
|
||||
this.form2.payType = val
|
||||
},
|
||||
// 计算找零金额
|
||||
changeSeekZero(){
|
||||
this.seekZero = (this.authCode - this.payAmount).toFixed(2)
|
||||
},
|
||||
batchSub(){
|
||||
this.form4.list = JSON.stringify(this.tableList);
|
||||
this.form4.repaidAmount = this.repaidAmount;
|
||||
this.form4.payType = "WECHAT"
|
||||
this.open4 = true;
|
||||
},
|
||||
batchReturn(){
|
||||
this.open3 = true
|
||||
this.repayList = [];
|
||||
this.unitName = ""
|
||||
this.getLists();
|
||||
},
|
||||
getRepayList(){
|
||||
let result = [];
|
||||
@ -811,34 +955,22 @@ import {getDicts} from "@/api/dict/data";
|
||||
this.getList();
|
||||
},
|
||||
// 收款
|
||||
collection(){
|
||||
collection(val){
|
||||
if (this.payType=="CASH"){
|
||||
if (this.authCode==undefined || this.authCode=="" || this.seekZero<0){
|
||||
this.$modal.msgError("请输入正确的金额变化");
|
||||
return;
|
||||
}
|
||||
}
|
||||
let _this = this;
|
||||
if (this.isBatch){
|
||||
// 批量归还
|
||||
_this.form4.repaidAmount = _this.payAmount;
|
||||
_this.form4.authCode = _this.authCode;
|
||||
_this.form4.orderNo = _this.tableList[0].orderNo;
|
||||
_this.form4.seekZero = _this.seekZero
|
||||
batchHangBill(_this.form4).then(response => {
|
||||
if (response.data!=0){
|
||||
_this.isPaySuccess = true;
|
||||
_this.isPay = false;
|
||||
this.getList();
|
||||
}
|
||||
})
|
||||
_this.loading = true;
|
||||
this.open3 = false;
|
||||
this.open4 = false;
|
||||
}else {
|
||||
_this.form2.repaidAmount = _this.payAmount;
|
||||
_this.form2.authCode = _this.authCode;
|
||||
editHangBill(this.form2).then(response => {
|
||||
if (response.data==null){
|
||||
|
||||
}else {
|
||||
if (response.data.payStatus == 'paid'){
|
||||
_this.isPaySuccess = true;
|
||||
_this.isPay = false;
|
||||
}
|
||||
}
|
||||
// 返回订单号信息
|
||||
_this.orderNo = response.data
|
||||
})
|
||||
_this.loading = true;
|
||||
_this.queryPayStatus();
|
||||
@ -848,7 +980,33 @@ import {getDicts} from "@/api/dict/data";
|
||||
_this.isPay = false;
|
||||
clearInterval(_this.timer);
|
||||
}
|
||||
},500)
|
||||
},1000)
|
||||
setTimeout(function (){
|
||||
_this.loading = false;
|
||||
clearInterval(timer);
|
||||
},30000)
|
||||
this.open3 = false;
|
||||
this.open4 = false;
|
||||
this.getLists();
|
||||
this.getList();
|
||||
}else {
|
||||
// 单个归还
|
||||
_this.form2.repaidAmount = _this.payAmount;
|
||||
_this.form2.authCode = _this.authCode;
|
||||
_this.form2.seekZero = _this.seekZero
|
||||
editHangBill(this.form2).then(response => {
|
||||
// 返回订单号信息
|
||||
_this.orderNo = response.data
|
||||
})
|
||||
_this.loading = true;
|
||||
_this.queryPayStatus();
|
||||
let timer = setInterval(function () {
|
||||
if (_this.isQuery == false) {
|
||||
_this.loading = false;
|
||||
_this.isPay = false;
|
||||
clearInterval(_this.timer);
|
||||
}
|
||||
},1000)
|
||||
setTimeout(function (){
|
||||
_this.loading = false;
|
||||
clearInterval(timer);
|
||||
@ -861,20 +1019,22 @@ import {getDicts} from "@/api/dict/data";
|
||||
queryPayStatus(){
|
||||
let _this = this;
|
||||
_this.timer = setInterval(function (){
|
||||
queryHangBill({orderNo:_this.form2.orderNo}).then(response => {
|
||||
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;
|
||||
}
|
||||
returnRecordByOrderNo({orderNo:_this.orderNo}).then(response => {
|
||||
response.data.forEach(item => {
|
||||
if (item.payStatus == "unpaid"){
|
||||
_this.isQuery = true;
|
||||
}
|
||||
if (item.payStatus == "paid"){
|
||||
_this.isPaySuccess = true;
|
||||
_this.isQuery = false;
|
||||
}
|
||||
if (item.payStatus == "payFail"){
|
||||
_this.isPaySuccess = false;
|
||||
_this.isQuery = false;
|
||||
}
|
||||
})
|
||||
})
|
||||
},1000)
|
||||
},1001)
|
||||
},
|
||||
submitReturn(){
|
||||
this.isPay = true;
|
||||
@ -891,8 +1051,10 @@ import {getDicts} from "@/api/dict/data";
|
||||
submitReturn1(){
|
||||
this.isPay = true;
|
||||
this.isBatch = true;
|
||||
this.loading = false;
|
||||
this.payAmount = this.form4.repaidAmount;
|
||||
this.authCode = this.form4.authCode;
|
||||
this.authCode = "";
|
||||
// this.authCode = this.form4.authCode;
|
||||
if (this.form4.payType!="CASH"){
|
||||
this.title = "扫码付款";
|
||||
}else {
|
||||
@ -908,6 +1070,7 @@ import {getDicts} from "@/api/dict/data";
|
||||
},
|
||||
// 归还
|
||||
repay(id){
|
||||
this.payType = "WECHAT"
|
||||
hangBillInfo(id).then( response => {
|
||||
this.open2 = true;
|
||||
this.form2 = response.data
|
||||
@ -1001,7 +1164,10 @@ import {getDicts} from "@/api/dict/data";
|
||||
})
|
||||
},
|
||||
// 获取列表信息
|
||||
getList(){
|
||||
getList(val){
|
||||
if (val!=undefined){
|
||||
this.queryParams.page = val
|
||||
}
|
||||
listHangBill(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
|
||||
this.hangBillList = response.data.records
|
||||
this.total = response.data.total;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -369,38 +369,52 @@
|
||||
<el-tabs v-model="activeRecharge" type="card" @tab-click="handleClick">
|
||||
<el-tab-pane label="储值卡" name="balance">
|
||||
<div>
|
||||
<el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="24">
|
||||
<div style="display: flex">
|
||||
<div style="width: 7%;line-height: 40px">油品类型</div>
|
||||
<el-radio-button>储值卡充值</el-radio-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div style="display: flex;margin: 20px 0">
|
||||
<div style="height: 50px;line-height: 50px">充值金额</div>
|
||||
<!--
|
||||
.conten-bottom{
|
||||
box-sizing: border-box;
|
||||
padding: 20px 20px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
} -->
|
||||
<el-col :span="1.5">
|
||||
<div style="height: 50px;line-height: 50px">充值金额</div>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="22">
|
||||
|
||||
<div v-if="cardValueList.length>0" style="display: flex;margin: 13px 5px;box-sizing: border-box;flex-wrap: wrap; ">
|
||||
<div class="mon"
|
||||
v-for="(item,index) in storeCard" :key="index"
|
||||
v-for="(item,index) in cardValueList" :key="index"
|
||||
:class="activeKey === index ? 'select' : ''"
|
||||
@click="recharge(index)">
|
||||
<div class="top1"><span class="amount1">{{ item.recharge }}</span>元</div>
|
||||
<div>赠送<span class="amount">{{ item.give }}</span>元</div>
|
||||
@click="rechargeCard(index)">
|
||||
<div class="top1"><span class="amount1">{{ item.rechargeBalance }}</span>元</div>
|
||||
<div>赠送<span class="amount">{{ item.giftBalance }}</span>元</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 30%;margin-left: 6%;"
|
||||
:class="activeKey === 4 ? 'select' : ''"
|
||||
@click="recharge(4)">
|
||||
|
||||
<div style="width: 30%;margin-left: 13px;margin-top: 8px;"
|
||||
:class="activeKey === cardValueList.length ? 'select' : ''"
|
||||
@click="rechargeCard(cardValueList.length,-1)">
|
||||
<el-input placeholder="请输入充值金额"
|
||||
size="medium"
|
||||
v-model="storeCardAmount.recharge">
|
||||
v-model.number="cardValueForm.amount"
|
||||
@input="valueAmoutChange(cardValueForm.amount)">
|
||||
<template slot="prepend">自定义</template>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div style="display: flex;justify-content: space-between;margin: 20px 0">
|
||||
@ -408,42 +422,45 @@
|
||||
<div class="zeng">赠送金额</div>
|
||||
<div>
|
||||
<el-input placeholder="0.00"
|
||||
v-model="storeCardAmount.give"
|
||||
v-model="cardValueForm.giftBalance"
|
||||
disabled>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<span class="bom">赠送金额 仅自定义金额模式下可手动输入赠送、活动充值赠送金额不可手动更改</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jine">
|
||||
<div class="zeng">赠加油金</div>
|
||||
<div>
|
||||
<el-input placeholder="0.00"
|
||||
v-model="storeCardAmount.refuelMoney"
|
||||
disabled>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<span class="bom">赠送加油金金额 仅自定义金额模式下可手动输入赠送、活动充值赠送金额不可手动更改</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="jine">
|
||||
<div class="zeng">赠送积分</div>
|
||||
<div>
|
||||
<el-input placeholder="0"
|
||||
v-model="storeCardAmount.point"
|
||||
v-model="cardValueForm.points"
|
||||
disabled>
|
||||
<template slot="append">积分</template>
|
||||
</el-input>
|
||||
<span class="bom">赠送积分 仅自定义金额模式下可手动输入,活动充值赠送积分不可手动更改[需开启积分活动有效]</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="jine">
|
||||
<div class="zeng" style="width: 100px;">赠成长值</div>
|
||||
<div>
|
||||
<el-input placeholder="0"
|
||||
v-model="cardValueForm.growthValue"
|
||||
disabled>
|
||||
<template slot="append">成长值</template>
|
||||
</el-input>
|
||||
<!-- <span class="bom">赠送加油金金额 仅自定义金额模式下可手动输入赠送、活动充值赠送金额不可手动更改</span> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="jine">
|
||||
<div class="zeng">提成员工</div>
|
||||
<div>
|
||||
<el-input placeholder="请选择提成员工">
|
||||
<template slot="append">选择员工</template>
|
||||
<el-input :readonly="true" placeholder="请选择提成员工" v-model="cardValueForm.realName">
|
||||
<el-button slot="append" @click="chooseStaff">选择员工</el-button>
|
||||
</el-input>
|
||||
<span class="bom">仅系统储值档次支持提成员工选择、自定义充值金额暂不支持选择提成员工</span>
|
||||
<span class="bom">仅系统储值档次支持提成员工选择、自定义充值金额匹配低一档次</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -456,7 +473,7 @@
|
||||
<el-input
|
||||
type="textarea"
|
||||
placeholder=""
|
||||
v-model="rechargeDesc"
|
||||
v-model="cardValueForm.remark"
|
||||
maxlength="255"
|
||||
show-word-limit
|
||||
>
|
||||
@ -469,44 +486,41 @@
|
||||
<div style="display: flex;margin: 20px 0">
|
||||
<div style="width: 7%">支付方式</div>
|
||||
<div>
|
||||
<el-radio v-model="payment" label="扫码支付" border>扫码支付</el-radio>
|
||||
<el-radio v-model="payment" label="现金支付" border>现金支付</el-radio>
|
||||
<el-radio v-model="payment" label="POS刷卡" border>POS刷卡</el-radio>
|
||||
<el-radio v-model="payment" label="随便付" border>随便付</el-radio>
|
||||
<el-radio v-model="payment" label="银行卡" border>银行卡</el-radio>
|
||||
<el-radio v-for="dict in payList" v-model="cardValueForm.paymentType" :key="dict.dictValue" :label="dict.dictValue" :value="dict.dictValue" border >{{ dict.dictLabel }}</el-radio>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin: 20px 0;text-align: center">
|
||||
<el-button type="primary" @click="confirm">确认充值</el-button>
|
||||
<el-button type="primary" @click="confirm(1)">确认充值</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="升数卡" name="literCard">
|
||||
<el-tab-pane label="存油卡" name="literCard">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div style="display: flex">
|
||||
<div style="width: 7%;line-height: 40px">油品类型</div>
|
||||
<el-radio-group v-model="tabOilType" style="margin-bottom: 30px;">
|
||||
<el-radio-button label="92">92#汽油</el-radio-button>
|
||||
<el-radio-button label="95">95#汽油</el-radio-button>
|
||||
<el-radio-group v-model="tabOilType" style="margin-bottom: 30px;">
|
||||
<el-radio-button v-for="(item,index) in oilTypeList" :label="item.oilType" @click.native="tabOilTypeClick(item.status)">{{ item.type }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div style="display: flex;margin: 20px 0">
|
||||
<div style="height: 50px;line-height: 50px;width: 8%">充值金额</div>
|
||||
<el-col :span="1.5">
|
||||
<div style="height: 50px;line-height: 50px;">充值金额</div>
|
||||
</el-col>
|
||||
<el-col :span="22">
|
||||
<div style="display: flex;margin: 20px 5px;box-sizing: border-box;flex-wrap: wrap;">
|
||||
<div class="mon2"
|
||||
v-for="(item,index) in literCard" :key="index"
|
||||
v-for="(item,index) in cardFuelDieselList" :key="index"
|
||||
:class="activeKey === index ? 'select' : ''"
|
||||
@click="recharge(index)">
|
||||
<div class="top1"><span class="amount1">{{ item.liter }}</span>L</div>
|
||||
<div>售价<span class="amount">{{ item.amount }}</span>元</div>
|
||||
<div>锁价<span class="amount">{{ item.lockPrice }}</span>/升</div>
|
||||
<div class="top1"><span class="amount1">{{ item.incomeLitres }}</span>L</div>
|
||||
<div>售价<span class="amount">{{ item.rechargeBalance }}</span>元</div>
|
||||
<div>锁价<span class="amount">{{ item.lockupPrice }}</span>/升</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -517,20 +531,20 @@
|
||||
<div class="jine">
|
||||
<div class="zeng">赠送积分</div>
|
||||
<div>
|
||||
<el-input placeholder="300" disabled>
|
||||
<el-input placeholder="0" disabled v-model="cardFuelDieselForm.points">
|
||||
<template slot="append">积分</template>
|
||||
</el-input>
|
||||
<span class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:flex;margin-left: 20px">
|
||||
<!-- <div style="display:flex;margin-left: 20px">
|
||||
<div style="line-height: 40px;width: 20%">提成员工</div>
|
||||
<div>
|
||||
<el-input placeholder="请选择提成员工">
|
||||
<el-button slot="append" @click="chooseStaff">选择员工</el-button>
|
||||
<el-input :readonly="true" placeholder="请选择提成员工" v-model="cardFuelDieselForm.realName">
|
||||
<el-button slot="append" @click="chooseStaff">选择员工</el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -554,58 +568,80 @@
|
||||
<div style="display: flex;margin: 20px 0">
|
||||
<div style="width: 7%">支付方式</div>
|
||||
<div>
|
||||
<el-radio v-model="payment" label="扫码支付" border>扫码支付</el-radio>
|
||||
<el-radio v-model="payment" label="现金" border>现金支付</el-radio>
|
||||
<el-radio v-model="payment" label="POS刷卡" border>POS刷卡</el-radio>
|
||||
<el-radio v-model="payment" label="随便付" border>随便付</el-radio>
|
||||
<el-radio v-model="payment" label="银行卡" border>银行卡</el-radio>
|
||||
<el-radio v-for="dict in payList" v-model="cardFuelDieselForm.paymentType" :key="dict.dictValue" :label="dict.dictValue" :value="dict.dictValue" border>{{ dict.dictLabel }}</el-radio>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin: 20px 0;text-align: center">
|
||||
<el-button type="primary" @click="confirm">确认充值</el-button>
|
||||
<el-button type="primary" @click="confirm(2)">确认充值</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 选择员工-->
|
||||
<el-dialog :close-on-click-modal="false" width="50%" height="50%" title="选择员工" :visible.sync="openStaff" append-to-body>
|
||||
<select-staff @send-data="handleDataFromChild">
|
||||
|
||||
</select-staff>
|
||||
</el-dialog>
|
||||
<!-- 确认充值-->
|
||||
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openConfirm" width="500px" append-to-body>
|
||||
<div style="text-align: center;font-size: 15px;font-weight: bold">付款金额</div>
|
||||
<div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0">
|
||||
¥300.00
|
||||
<el-tag
|
||||
effect="dark">
|
||||
汽油
|
||||
</el-tag>
|
||||
</div>
|
||||
<div style="text-align: center;margin-bottom: 10px">赠送金额</div>
|
||||
<div>
|
||||
<el-input placeholder="扫描或输入付款码、支持微信、支付宝、云闪付">
|
||||
<i
|
||||
slot="suffix">
|
||||
<svg t="1697791915471" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1479" width="32" height="32"><path d="M149.333333 170.858667A21.546667 21.546667 0 0 1 170.858667 149.333333H384V106.666667H170.858667A64.213333 64.213333 0 0 0 106.666667 170.858667V384h42.666666V170.858667zM170.858667 874.666667A21.546667 21.546667 0 0 1 149.333333 853.141333V640H106.666667v213.141333A64.213333 64.213333 0 0 0 170.858667 917.333333H384v-42.666666H170.858667zM853.12 149.333333A21.546667 21.546667 0 0 1 874.666667 170.858667V384h42.666666V170.858667A64.213333 64.213333 0 0 0 853.141333 106.666667H640v42.666666h213.141333zM874.666667 853.141333A21.546667 21.546667 0 0 1 853.141333 874.666667H640v42.666666h213.141333A64.213333 64.213333 0 0 0 917.333333 853.141333V640h-42.666666v213.141333zM106.666667 490.666667h810.666666v42.666666H106.666667v-42.666666z" fill="#3D3D3D" p-id="1480"></path></svg>
|
||||
</i>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="demo-image">
|
||||
<div class="block" style="text-align: center">
|
||||
<el-image
|
||||
style="width: 200px; height: 200px"
|
||||
fit="cover"
|
||||
src="https://oil.wudb.cn/static/img/scan-demo.fcb8b1ab.png"></el-image>
|
||||
<div v-if="isPay == true"
|
||||
v-loading="loading">
|
||||
|
||||
<div style="text-align: center;font-size: 15px;font-weight: bold">付款金额</div>
|
||||
<div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0">
|
||||
¥{{ realyPayBills }}
|
||||
<!-- <el-tag
|
||||
effect="dark">
|
||||
汽油
|
||||
</el-tag> -->
|
||||
</div>
|
||||
<!-- <div style="text-align: center;margin-bottom: 10px">赠送金额</div> -->
|
||||
<div>
|
||||
<el-input v-model="authCode" @keydown.enter.native="collection" placeholder="扫描或输入付款码、支持微信、支付宝、云闪付">
|
||||
<i
|
||||
slot="suffix">
|
||||
<svg t="1697791915471" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1479" width="32" height="32"><path d="M149.333333 170.858667A21.546667 21.546667 0 0 1 170.858667 149.333333H384V106.666667H170.858667A64.213333 64.213333 0 0 0 106.666667 170.858667V384h42.666666V170.858667zM170.858667 874.666667A21.546667 21.546667 0 0 1 149.333333 853.141333V640H106.666667v213.141333A64.213333 64.213333 0 0 0 170.858667 917.333333H384v-42.666666H170.858667zM853.12 149.333333A21.546667 21.546667 0 0 1 874.666667 170.858667V384h42.666666V170.858667A64.213333 64.213333 0 0 0 853.141333 106.666667H640v42.666666h213.141333zM874.666667 853.141333A21.546667 21.546667 0 0 1 853.141333 874.666667H640v42.666666h213.141333A64.213333 64.213333 0 0 0 917.333333 853.141333V640h-42.666666v213.141333zM106.666667 490.666667h810.666666v42.666666H106.666667v-42.666666z" fill="#3D3D3D" p-id="1480"></path></svg>
|
||||
</i>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="demo-image">
|
||||
<div class="block" style="text-align: center">
|
||||
<el-image
|
||||
style="width: 200px; height: 200px"
|
||||
fit="cover"
|
||||
src="https://oil.wudb.cn/static/img/scan-demo.fcb8b1ab.png"></el-image>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div style="display: flex;justify-content: space-around">
|
||||
<el-button @click="cancelCollection">取消收款</el-button>
|
||||
<el-button type="primary" @click="collection">确定收款</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div style="display: flex;justify-content: space-around">
|
||||
<el-button @click="cancelCollection">取消收款</el-button>
|
||||
<el-button type="primary">确定收款</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<div v-else>
|
||||
<div v-if="isPaySuccess">
|
||||
<el-result icon="success" title="收款成功">
|
||||
<template slot="extra">
|
||||
<el-button type="primary" @click="handClose">关 闭</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-result icon="error" title="支付失败,请重新支付">
|
||||
<template slot="extra">
|
||||
<el-button type="primary" @click="handClose">关 闭</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
<!-- 更换手机号对话框-->
|
||||
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openMobile" style="margin-top: 200px" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
@ -846,27 +882,76 @@ import {getUser, updateUser} from "@/api/cashier/user/user";
|
||||
import {getUserGrade} from "@/api/cashier/usergrade";
|
||||
import {ljStoreInfo} from "@/api/cashier/user/store";
|
||||
import {getDicts} from "@/api/dict/data";
|
||||
import {getList,getCountOilTypeApi,getCardValueListApi,getPrepaidCardTopUpApi,getCheckTheStatusOfYourPaymentApi,getPrepaidFuelTopUpApi,getCheckTheStatusOfYourPaymentByFuelApi} from "@/api/cashier/cardSet";
|
||||
import BigNumber from 'bignumber.js';
|
||||
import SelectStaff from "@/components/local/selectStaff";
|
||||
|
||||
export default {
|
||||
components: {SelectStaff},
|
||||
computed: {
|
||||
item() {
|
||||
return item
|
||||
}
|
||||
},
|
||||
dicts: ['zcrzdj'],
|
||||
// dicts: ['zcrzdj'],
|
||||
data(){
|
||||
return{
|
||||
// 变更认证列表
|
||||
zcrzdjList:[],
|
||||
// 储值卡
|
||||
storeCard:[
|
||||
{recharge:300,give:3,refuelMoney:0,point:0},
|
||||
{recharge:500,give:5},
|
||||
{recharge:1000,give:10},
|
||||
],
|
||||
storeCardAmount:{
|
||||
recharge:'',give:0,refuelMoney:0,point:0
|
||||
// 充值余额列表
|
||||
cardValueList:[],
|
||||
cardValueForm: {
|
||||
cardValueId:'', // 储值卡id
|
||||
mtStaffId: '', //
|
||||
realName: '',
|
||||
staffMobile: '',
|
||||
amount:'', // 自定义充值字段
|
||||
bidBalance:'', // 储值卡面值
|
||||
rechargeBalance:'', // 实际支付
|
||||
giftBalance:'',// 赠送金额
|
||||
points:'', //赠送积分
|
||||
growthValue:'', // 赠送成长值
|
||||
remark:'',
|
||||
paymentType:'', // 支付方式
|
||||
royaltyType: '',// 提成类型
|
||||
percentageCommissions:null,
|
||||
amountCommission:null,
|
||||
rechargeType:0
|
||||
},
|
||||
|
||||
// 存油卡列表
|
||||
cardFuelDieselList:[],
|
||||
sourceCardFuelDieselList:[],
|
||||
cardFuelDieselForm: {
|
||||
mtStaffId: '',
|
||||
realName: '',
|
||||
staffMobile: '',
|
||||
points:'',
|
||||
remark:'',
|
||||
rechargeBalance:'', //实际支付
|
||||
paymentType:'',
|
||||
oilType:'',
|
||||
type:'',
|
||||
chainStorId:'',
|
||||
incomeLitres:'',
|
||||
},
|
||||
|
||||
authCode:'', // 支付码
|
||||
|
||||
timer: null,
|
||||
|
||||
realyPayBills:0,
|
||||
|
||||
|
||||
oilTypeList: {},
|
||||
|
||||
isPay:true,
|
||||
isPaySuccess:false,
|
||||
isQuery:true,
|
||||
|
||||
|
||||
payList:[],
|
||||
// 升数卡
|
||||
literCard:[
|
||||
{liter:73.75,amount:500,lockPrice:6.78,point:50},
|
||||
@ -899,11 +984,13 @@ export default {
|
||||
openConfig:false,
|
||||
openLevel:false,
|
||||
openConfirm:false,
|
||||
openStaff:false,
|
||||
|
||||
growthValue:'whole',
|
||||
cardList:'notUse',
|
||||
tabPosition: 'giftCard',
|
||||
balanceRecord: 'first',
|
||||
tabOilType: '92',
|
||||
tabOilType: '',
|
||||
// 关于副卡信息
|
||||
aboutSecondCard:[],
|
||||
// 遮罩层
|
||||
@ -961,7 +1048,7 @@ export default {
|
||||
},
|
||||
// 选择员工
|
||||
chooseStaff(){
|
||||
|
||||
this.openStaff = true
|
||||
},
|
||||
// 更换手机号
|
||||
replaceMobile(){
|
||||
@ -995,14 +1082,388 @@ export default {
|
||||
},
|
||||
// 会员充值
|
||||
userRecharge(){
|
||||
this.getCardFuelDieselList()
|
||||
this.getCardValueList()
|
||||
this.getCountOilType()
|
||||
|
||||
this.getPayList();
|
||||
this.openRecharge = true;
|
||||
this.title = '会员充值'
|
||||
},
|
||||
// 确认充值
|
||||
confirm(){
|
||||
confirm(flag){
|
||||
this.flag = flag
|
||||
if (flag ===1) {
|
||||
if (this.cardValueForm.paymentType == '') {
|
||||
this.$message.error('请选择支付方式');
|
||||
return
|
||||
}
|
||||
if (this.cardValueForm.amount != null) {
|
||||
this.realyPayBills = this.cardValueForm.amount
|
||||
this.cardValueForm.rechargeType = 1
|
||||
} else {
|
||||
this.realyPayBills = this.cardValueForm.rechargeBalance
|
||||
this.cardValueForm.rechargeType = 0
|
||||
}
|
||||
}else if(flag === 2) {
|
||||
if (this.cardFuelDieselForm.paymentType == '') {
|
||||
this.$message.error('请选择支付方式');
|
||||
return
|
||||
}
|
||||
this.realyPayBills = this.cardFuelDieselForm.rechargeBalance
|
||||
}
|
||||
this.isPay = true
|
||||
this.openConfirm = true;
|
||||
this.title = this.payment
|
||||
},
|
||||
// 储值卡查询
|
||||
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);
|
||||
|
||||
})
|
||||
if (this.cardValueList.length > 0) {
|
||||
// 过滤
|
||||
this.cardValueList = this.cardValueList.filter(item => {
|
||||
return item.membershipLevel.includes(this.grade.name);
|
||||
});
|
||||
this.rechargeCard(0);
|
||||
}
|
||||
},
|
||||
|
||||
valueAmoutChange(data) {
|
||||
|
||||
|
||||
this.cardValueForm.points = ''
|
||||
this.cardValueForm.bidBalance =''
|
||||
this.cardValueForm.giftBalance =''
|
||||
this.cardValueForm.growthValue = ''
|
||||
this.cardValueForm.rechargeBalance = ''
|
||||
this.cardValueForm.rechargeType = 1
|
||||
|
||||
this.cardValueForm.royaltyType = ''
|
||||
this.cardValueForm.percentageCommissions = ''
|
||||
this.cardValueForm.amountCommission = ''
|
||||
|
||||
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
|
||||
|
||||
|
||||
// 计算员工提成金额
|
||||
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 getCardFuelDieselList() {
|
||||
let quy = {
|
||||
pageNo: 1,
|
||||
pageSize: 10000,
|
||||
activeStatus: 1,
|
||||
status:1,
|
||||
activityProgress:1
|
||||
}
|
||||
await getList(quy).then(res=> {
|
||||
this.sourceCardFuelDieselList = res.data.records
|
||||
})
|
||||
},
|
||||
handleDataFromChild(data) {
|
||||
this.openStaff = false
|
||||
// this.cardFuelDieselForm= {
|
||||
// mtStaffId: data.mtStaffId,
|
||||
// realName: data.realName,
|
||||
// staffMobile: data.staffMobile,
|
||||
// },
|
||||
// this.cardValueForm = {
|
||||
// mtStaffId: data.mtStaffId,
|
||||
// realName: data.realName,
|
||||
// staffMobile: data.staffMobile,
|
||||
// }
|
||||
|
||||
this.cardFuelDieselForm.mtStaffId= data.mtStaffId,
|
||||
this.cardFuelDieselForm.realName= data.realName,
|
||||
this.cardFuelDieselForm.staffMobile= data.staffMobile,
|
||||
|
||||
this.cardValueForm.mtStaffId= data.mtStaffId,
|
||||
this.cardValueForm.realName= data.realName,
|
||||
this.cardValueForm.staffMobile= data.staffMobile
|
||||
|
||||
},
|
||||
// 查询参加存油卡油品
|
||||
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);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据油品过滤查询存油卡
|
||||
async tabOilTypeClick(data){
|
||||
let this_ = this
|
||||
await this_.getCardFuelDieselList()
|
||||
// console.log("this_.sourceCardFuelDieselList",this_.sourceCardFuelDieselList)
|
||||
|
||||
this_.cardFuelDieselList = this_.sourceCardFuelDieselList.filter(item => {
|
||||
return item.oilType === data;
|
||||
});
|
||||
if (this.cardFuelDieselList.length > 0) {
|
||||
this.recharge(0)
|
||||
}
|
||||
},
|
||||
selectOilType(status,oilType) {
|
||||
console.log("status",status)
|
||||
console.log("oilType",oilType)
|
||||
this.tabOilType = oilType;
|
||||
this.tabOilTypeClick(status);
|
||||
},
|
||||
// 支付方式
|
||||
payMethod(payType,flag){
|
||||
if (falg === 1) {
|
||||
|
||||
}
|
||||
this.cardValueForm.paymentType = payType
|
||||
},
|
||||
|
||||
// 选择余额充值金额
|
||||
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 {
|
||||
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.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
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 选择充值金额
|
||||
recharge(index,item){
|
||||
this.activeKey = index;
|
||||
let file={}
|
||||
// 拿到金额
|
||||
file = this.cardFuelDieselList[index]
|
||||
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.realyPayBills = file.rechargeBalance
|
||||
console.log("this.cardFuelDieselList[index]",this.cardFuelDieselList[index])
|
||||
console.log("this.cardFuelDieselForm[index]",this.cardFuelDieselForm)
|
||||
console.log("file",file)
|
||||
},
|
||||
|
||||
async collection(){
|
||||
|
||||
let userForm = this.form
|
||||
|
||||
if (this.flag === 1) {
|
||||
// 会员id 会员名字会员手机号码
|
||||
this.cardValueForm.mtUserId = userForm.id
|
||||
this.cardValueForm.name = userForm.name
|
||||
this.cardValueForm.mobile = userForm.mobile
|
||||
// 支付码
|
||||
this.cardValueForm.authCode = this.authCode
|
||||
this.cardValueForm.realyPayBills = this.realyPayBills
|
||||
|
||||
let id ;
|
||||
await getPrepaidCardTopUpApi(this.cardValueForm).then(response=> {
|
||||
if (response.data!=null){
|
||||
this.loading = true;
|
||||
id = response.data.id
|
||||
// if (response.data.payStatus == "paid"){
|
||||
// this.isPaySuccess = true;
|
||||
// }
|
||||
}
|
||||
});
|
||||
let this_ = this
|
||||
|
||||
let timer = setInterval(async () => {
|
||||
getCheckTheStatusOfYourPaymentApi(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_.loading = false;
|
||||
this_.isPay = false;
|
||||
clearInterval(timer);
|
||||
}
|
||||
},500)
|
||||
|
||||
setTimeout(function (){
|
||||
clearInterval(timer2);
|
||||
clearInterval(timer);
|
||||
this_.loading = false;
|
||||
this_.isPay = false;
|
||||
this.isPaySuccess = false;
|
||||
|
||||
},30000)
|
||||
}else if (this.flag === 2){
|
||||
console.log("cardFuelDieselForm",this.cardFuelDieselForm)
|
||||
this.cardFuelDieselForm.mtUserId = userForm.id
|
||||
this.cardFuelDieselForm.name = userForm.name
|
||||
this.cardFuelDieselForm.mobile = userForm.mobile
|
||||
this.cardFuelDieselForm.authCode = this.authCode
|
||||
|
||||
|
||||
let id ;
|
||||
await getPrepaidFuelTopUpApi(this.cardFuelDieselForm).then(response=> {
|
||||
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_.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;
|
||||
|
||||
},30000)
|
||||
|
||||
let this_ = this
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
getPayList(){
|
||||
getDicts("payment_type").then( response => {
|
||||
this.payList = response.data;
|
||||
})
|
||||
},
|
||||
|
||||
// 关闭支付窗口
|
||||
handClose(){
|
||||
this.isPay = true;
|
||||
this.openConfirm = false
|
||||
this.openRecharge = false
|
||||
|
||||
this.isPaySuccess = false;
|
||||
this.authCode = null
|
||||
this.activeRecharge='balance',
|
||||
|
||||
this.cardValueForm = {}
|
||||
this.cardFuelDieselForm = {}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 获取副卡信息
|
||||
getInformation(){
|
||||
getSysConfig('second_card').then(response => {
|
||||
@ -1012,7 +1473,7 @@ export default {
|
||||
this.transaction = response.data
|
||||
});
|
||||
},
|
||||
getList(){
|
||||
this(){
|
||||
|
||||
},
|
||||
// 获取详情
|
||||
@ -1035,9 +1496,9 @@ export default {
|
||||
});
|
||||
},
|
||||
// 选择充值金额
|
||||
recharge(index){
|
||||
this.activeKey = index;
|
||||
},
|
||||
// recharge(index){
|
||||
// this.activeKey = index;
|
||||
// },
|
||||
// 提交按钮
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
@ -1076,6 +1537,9 @@ export default {
|
||||
},
|
||||
handleChange(value) {
|
||||
// console.log(value);
|
||||
},
|
||||
getList(){
|
||||
|
||||
},
|
||||
// 返回
|
||||
goBack() {
|
||||
|
@ -112,8 +112,8 @@
|
||||
</el-input>
|
||||
</div>
|
||||
<div>
|
||||
<span class="anniulan" v-show="show" @click="getCode" >获取验证码</span>
|
||||
<span v-show="!show" class="count">{{count}}s后重新获取</span>
|
||||
<span style="cursor: pointer;color: #00aaff " class="anniulan" v-show="show" @click="getCode" >获取验证码</span>
|
||||
<span style="cursor: pointer;color: #00aaff " v-show="!show" class="count">{{count}}s后重新获取</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user