bug修改
This commit is contained in:
parent
5963655f43
commit
d68f87b29b
@ -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);
|
||||
},
|
||||
|
||||
|
@ -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);
|
||||
},
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 应该在这时候被正确设置
|
||||
|
@ -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 = {
|
||||
@ -1025,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
|
||||
|
||||
@ -1049,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") {
|
||||
// 当按比例提成时 计算对应的金额
|
||||
@ -1068,7 +1069,7 @@ export default {
|
||||
console.log("this.cardValueForm",this.cardValueForm)
|
||||
},
|
||||
// 存油卡查询
|
||||
getCardFuelDieselList() {
|
||||
async getCardFuelDieselList() {
|
||||
let quy = {
|
||||
pageNo: 1,
|
||||
pageSize: 10000,
|
||||
@ -1076,7 +1077,7 @@ export default {
|
||||
status:1,
|
||||
activityProgress:1
|
||||
}
|
||||
getList(quy).then(res=> {
|
||||
await getList(quy).then(res=> {
|
||||
this.sourceCardFuelDieselList = res.data.records
|
||||
})
|
||||
},
|
||||
@ -1108,8 +1109,9 @@ export default {
|
||||
})
|
||||
},
|
||||
// 根据油品过滤查询存油卡
|
||||
tabOilTypeClick(data){
|
||||
console.log("aaaaaaaaaaaaaa",this.grade.name)
|
||||
async tabOilTypeClick(data){
|
||||
console.log("aaaaaaaaaaaaaa",data)
|
||||
await this.getCardFuelDieselList()
|
||||
|
||||
this.cardFuelDieselList = this.sourceCardFuelDieselList.filter(item => {
|
||||
return item.oilType === data;
|
||||
@ -1140,18 +1142,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;
|
||||
@ -1201,7 +1212,9 @@ export default {
|
||||
// 选择余额充值金额
|
||||
rechargeCard(index,item){
|
||||
console.log("index",index)
|
||||
// 自定义输入
|
||||
this.cardValueForm.amount = null,
|
||||
this.cardValueForm.rechargeType = 0
|
||||
|
||||
this.activeKey = index;
|
||||
|
||||
if (item === -1) {
|
||||
@ -1217,7 +1230,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
|
||||
@ -1257,9 +1270,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(){
|
||||
@ -1273,6 +1285,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=> {
|
||||
@ -1447,7 +1461,7 @@ export default {
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
// console.log(tab, event);
|
||||
this.rechargeBalance = 0
|
||||
this.realyPayBills = 0
|
||||
},
|
||||
handleChange(value) {
|
||||
// console.log(value);
|
||||
|
@ -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;
|
||||
|
@ -9,6 +9,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class CardValueRecordDTO extends CardValueRecord {
|
||||
private String authCode;
|
||||
private Double realyPayBills;
|
||||
|
||||
// /**
|
||||
// * 会员id
|
||||
|
@ -108,16 +108,10 @@ 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
|
||||
|
@ -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);
|
||||
|
@ -216,8 +216,8 @@ public class OilPurchaseOrderServiceImpl implements OilPurchaseOrderService {
|
||||
|
||||
// 单价计算
|
||||
OilTank oilTankSum = oilTankMapper.queryById(oilPurchaseOrderVO.getTankId());
|
||||
BigDecimal totalSum= new BigDecimal(oilPurchaseOrderVO.getTotalAmount()).add(new BigDecimal(oilTankSum.getTotalPrice()));
|
||||
BigDecimal volSum= new BigDecimal(oilPurchaseOrderVO.getPurchaseVolume()).add(new BigDecimal(oilTankSum.getStoredQuantity()));
|
||||
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);
|
||||
|
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
|
||||
// })
|
||||
// }
|
@ -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,
|
||||
},
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user