Merge remote-tracking branch 'origin/main'

# Conflicts:
#	fuintAdmin/src/views/EventMarketing/SaveBlock/index.vue
#	fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue
This commit is contained in:
齐天大圣 2024-10-31 08:46:31 +08:00
commit 1d407ffa3f
35 changed files with 1127 additions and 867 deletions

View File

@ -2,6 +2,7 @@
#app {
.main-container {
background: #f6f8f9 !important;
min-height: 100%;
transition: margin-left .28s;
//margin-left: $base-sidebar-width;

View File

@ -112,10 +112,7 @@
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
>
end-placeholder="结束日期">
</el-date-picker>
</div>
<el-button type="primary" icon="el-icon-search" @click="RecordList()" >搜索</el-button>
@ -131,7 +128,7 @@
>
</el-table-column>
<el-table-column
prop="paymentNo"
prop="orderNo"
label="订单号"
>
</el-table-column>
@ -162,7 +159,7 @@
label="订单状态">
</el-table-column>
<el-table-column
prop="updateTime"
prop="payTime"
label="订单完成时间">
</el-table-column>
</el-table>
@ -183,7 +180,7 @@
ref="drawer"
>
<div class="demo-drawer__content">
<el-form :model="form" ref="ruleForm" :rules="rules" :inline="true" :label-position="labelPosition" label-width="100px" >
<el-form :model="form" :rules="rules" :inline="true" :label-position="labelPosition" label-width="100px" >
<el-form-item label="活动名称" prop="activeName">
<el-input style="width: 300px" v-model="form.activeName"></el-input>
@ -421,7 +418,7 @@
</el-dialog>
<!-- 规则-->
<el-dialog title="编辑储值卡规则" :visible.sync="Crule">
<el-form :model="ruleForm" ref="ruleForm1" :rules="rules" label-width="100px" class="demo-ruleForm" :label-position="labelPosition">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :label-position="labelPosition">
<el-form-item label="名称" prop="name">
<el-input disabled v-model="ruleForm.name"></el-input>
</el-form-item>
@ -473,7 +470,7 @@
<el-form-item>
<el-button type="primary" @click="submitForms('ruleForm1')">保存</el-button>
<el-button type="primary" @click="submitForms('ruleForm')">保存</el-button>
<el-button @click="resetForm('ruleForm')">取消</el-button>
</el-form-item>
</el-form>
@ -494,7 +491,6 @@ import {
cardValueRule,
saveOrUpdate,
cardValueRecordList,
cardValueRecordLists,
updateStatus
} from "@/api/EventMarketing/SaveBlock";
import {oilNumberList1} from "@/api/order/oilnumgun";
@ -527,8 +523,7 @@ import {delLJGoods, listLJGoods} from "@/api/convenienceStore/ljgoods";
ordertype:'',
cardValueId:'',
pageNo:1,
pageSize:10,
storeId:''
pageSize:10
},
dataRange:[],
orderData: [{
@ -565,9 +560,6 @@ import {delLJGoods, listLJGoods} from "@/api/convenienceStore/ljgoods";
isonline: '0',
dialog: false,
rules: {
name: [
{ required: true, message: '不能为空', trigger: 'blur' },
],
startTime: [
{ required: true, message: '不能为空', trigger: 'blur' },
],
@ -693,8 +685,8 @@ import {delLJGoods, listLJGoods} from "@/api/convenienceStore/ljgoods";
this.oilnumList = res.data.records
})
},
submitForms(ruleForm1 ) {
this.$refs[ruleForm1].validate((valid) => {
submitForms(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.ruleForm.oilNumber = this.ruleForm.oilNumber.join(',')
saveOrUpdate(this.ruleForm).then(res=>{
@ -844,13 +836,9 @@ import {delLJGoods, listLJGoods} from "@/api/convenienceStore/ljgoods";
this.RecordList()
},
RecordList(){
console.log(this.dataRange)
cardValueRecordLists({
cardValueId: this.order.cardValueId,
dataRange: this.dataRange,
orderNo:this.order.orderNo
}).then(res=>{
this.orderData = res.data
cardValueRecordList(this.addDateRange(this.order,this.dataRange)).then(res=>{
this.orderData = res.data.records
this.order.total = res.data.total
})
},
@ -1006,46 +994,39 @@ import {delLJGoods, listLJGoods} from "@/api/convenienceStore/ljgoods";
// this.form.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '1')
// this.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '2')
submitForm(ruleForm){
this.$refs[ruleForm].validate((valid) => {
if (valid) {
this.form.cardValueChildList = this.youhuiquanlist.concat(this.duihuanquanlist);
submitForm(){
this.form.cardValueChildList = this.youhuiquanlist.concat(this.duihuanquanlist);
if (this.form.id) {
eitList(this.form).then(res => {
if (res.code == 200) {
this.$message({
message: '修改成功',
type: 'success'
});
this.getlist()
} else {
this.$message.error('修改失败');
}
})
} else {
addList(this.form).then(res => {
if (res.code == 200) {
this.$message({
message: '新增成功',
type: 'success'
});
this.getlist()
} else {
this.$message.error('新增失败');
}
})
}
this.dialog = false
this.chongzhi()
if(this.form.id){
eitList(this.form).then(res=>{
if (res.code == 200){
this.$message({
message: '修改成功',
type: 'success'
});
this.getlist()
}else {
console.log('error submit!!');
return false;
this.$message.error('修改失败');
}
});
})
}else{
addList(this.form).then(res=>{
if (res.code == 200){
this.$message({
message: '新增成功',
type: 'success'
});
this.getlist()
}else {
this.$message.error('新增失败');
}
})
}
this.dialog = false
this.chongzhi()
},

View File

@ -240,6 +240,7 @@
<el-dialog
title="上传礼品卡数据"
:visible.sync="uploadingShow"
:close-on-click-modal="false"
width="40%"
@close="handleClose2"
>
@ -297,6 +298,7 @@
<el-dialog
title="新增/修改礼品卡活动"
:visible.sync="centerDialogVisible"
:close-on-click-modal="false"
width="40%"
@close="handleClose1"
>
@ -350,6 +352,7 @@
<el-dialog
title="密码加密"
:visible.sync="Encryption"
:close-on-click-modal="false"
width="30%"
>
<div class="d-b">

View File

@ -220,6 +220,7 @@
</div>
<el-dialog
:title="titles"
:close-on-click-modal="false"
:visible.sync="centerDialogVisible"
width="40%">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
@ -314,6 +315,7 @@
</el-dialog>
<el-dialog
:title="titles1"
:close-on-click-modal="false"
:visible.sync="showDialogVisible"
width="60%">
<el-form :model="ruleForm1" :rules="rules" ref="ruleForm1" label-width="120px" class="demo-ruleForm">

View File

@ -221,6 +221,7 @@
<el-dialog
:title="titles"
:visible.sync="centerDialogVisible"
:close-on-click-modal="false"
center
width="35%">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
@ -273,9 +274,10 @@
>
<template slot-scope="scope">
<el-form-item
label-width="0px"
:prop="'oilList.' + scope.$index + '.price'"
:rules="rules['oilList.*.price']"
class="custom-form-itemMy100989"
style="margin-left: 0px"
>
<el-input
v-model="scope.row.price"
@ -315,6 +317,7 @@
:title="titles1"
center
:visible.sync="showDialogVisible"
:close-on-click-modal="false"
width="60%">
<el-form :model="ruleForm1" :rules="rules" ref="ruleForm1" label-width="120px" class="demo-ruleForm">
<div style="display: flex;width: 100%; margin-bottom: 20px">

View File

@ -187,7 +187,7 @@
</div>
</el-drawer>
<!-- 规则-->
<el-dialog title="编辑囤油卡规则" width="30%" :visible.sync="Crule">
<el-dialog :close-on-click-modal="false" title="编辑囤油卡规则" width="30%" :visible.sync="Crule">
<el-form :model="oilForm" :rules="ruleInfo" ref="oilForm" label-width="70px" class="demo-ruleForm" >
<el-form-item label="名称" prop="name">
<el-input disabled v-model="oilForm.name"></el-input>
@ -210,6 +210,7 @@
title="囤油卡操作"
:visible.sync="centerDialogVisible"
width="30%"
:close-on-click-modal="false"
center>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" class="demo-ruleForm">

View File

@ -8,29 +8,29 @@
</div>
<div class="" style="height: 110px; display: flex; justify-content: space-between;">
<div style="height: 100%; display: flex; justify-content: space-between;">
<div style="height: 100%; width: 70%; display: flex; justify-content: space-between;font-family: YouSheBiaoTiHei">
<div style="height: 100%; width: 70%; display: flex; justify-content: space-between;">
<div class="box">
<span style="font-size: 26px;color: #3B6ADE;font-weight: bold" >{{inventoryForm.productQuantity}}</span>
<span style="font-size: 26px;color: #0DC291;font-weight: bold" >{{inventoryForm.productQuantity}}</span>
<span style="display: flex">
<div style="background-color: #0DC291;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
商品数量</span>
</div>
<div class="box">
<span style="font-size: 26px;color: #FF4347;font-weight: bold">{{inventoryForm.inventoryQuantity}}</span>
<span style="font-size: 26px;color: #00CAFF;font-weight: bold">{{inventoryForm.inventoryQuantity}}</span>
<span style="display: flex">
<div style="background-color: #3b7cde;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
<div style="background-color: #00CAFF;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
盘点数量</span>
</div>
<div class="box">
<span style="font-size: 26px;color: #3B6ADE;font-weight: bold" >{{inventoryForm.inventoryDiscrepancy}}</span>
<span style="font-size: 26px;color: #F44522;font-weight: bold" >{{inventoryForm.inventoryDiscrepancy}}</span>
<span style="display: flex">
<div style="background-color: #3B6ADE;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
<div style="background-color: #F44522;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
库存差异</span>
</div>
<div class="box">
<span style="font-size: 26px;color: #FF4347;font-weight: bold">{{inventoryForm.profitLossAmount}}</span>
<span style="font-size: 26px;color: #FA6400;font-weight: bold">{{inventoryForm.profitLossAmount}}</span>
<span style="display: flex">
<div style="background-color: #FF4347;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
<div style="background-color: #FA6400;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
盈亏总额
</span>
</div>
@ -822,8 +822,7 @@ export default {
width: 212px;
margin-right: 10px;
background: #FFFFFF;
border-radius: 10px 10px 10px 10px;
border: 1px solid #EEEEEE;
border: 1px solid #FF9655;
border-radius: 10px;
display: flex;
flex-direction: column;

View File

@ -1,12 +1,12 @@
<template>
<div class="app-container">
<el-card >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<div class="card-change">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="60px">
<el-form-item label="" prop="orderNumber">
<el-input v-model="queryParams.orderNumber" placeholder="盘点批次号" />
<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="" clearable>
<el-select v-model="queryParams.approvalStatus" placeholder="请选择状态" style="" clearable>
<el-option
v-for="dict in dict.type.oilPurchasedStatus"
:key="dict.value"
@ -15,104 +15,127 @@
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="日期选择" prop="status">
<el-date-picker
v-model="queryParams.dateRange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item> -->
<el-form-item label="">
<el-date-picker
v-model="beginTime"
style="width: 160px"
type="date"
placeholder="开始日期">
</el-date-picker>
<el-date-picker
v-model="endTime"
style="width: 160px"
type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item style="float: right">
<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-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="detailsAdd"
v-hasPermi="['convenienceStore:inventory:index']"
>新增库存盘点
</el-button>
</el-form-item>
</el-form>
>新增盘点批次</el-button>
</el-col>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row>
<div style="height: 74vh;overflow: auto">
<el-table ref="tables" border
v-loading="loading"
:data="inventoryList"
:default-sort="defaultSort">
<el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
<el-table-column label="盘点单号" align="center" prop="orderNumber"></el-table-column>
<el-table-column label="盘点数量" align="center" prop="inventoryQuantity">
<template slot-scope="scope">
<span>{{ scope.row.inventoryQuantity == null ? "-" : scope.row.inventoryQuantity }}</span>
</template>
</el-table-column>
<el-table-column label="库存差异" align="center" prop="inventoryDiscrepancy">
<template slot-scope="scope">
<span>{{ scope.row.inventoryDiscrepancy == null ? "-" : scope.row.inventoryDiscrepancy }}</span>
</template>
</el-table-column>
<el-table-column label="盈亏金额(元)" align="center" prop="profitLossAmount">
<template slot-scope="scope">
<span>{{ scope.row.profitLossAmount == null ? "-" : scope.row.profitLossAmount }}</span>
</template>
</el-table-column>
<el-table ref="tables"
v-loading="loading"
:data="inventoryList"
:default-sort="defaultSort">
<el-table-column label="盘点批次" align="center" prop="orderNumber">
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<div style="color: #FF9655" v-if="scope.row.approvalStatus == 'await'">待审核</div>
<div style="color: #0DC291" v-if="scope.row.approvalStatus == 'qrts'" >已审核入库</div>
<div style="color: #F44522" v-if="scope.row.approvalStatus == 'yzf'">已作废</div>
<div style="color: #409EFF" v-if="scope.row.approvalStatus == 'ysh'" >已审核</div>
</div>
</template>
</el-table-column>
<el-table-column label="制单人" align="center" prop="createByName" width="230px">
<template slot-scope="scope">
<span>{{ scope.row.createByName }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="盘点数量" align="center" prop="inventoryQuantity">
<template slot-scope="scope">
<span>{{scope.row.inventoryQuantity==null?"-":scope.row.inventoryQuantity}}</span>
</template>
</el-table-column>
<el-table-column label="库存差异" align="center" prop="inventoryDiscrepancy">
<template slot-scope="scope">
<span>{{scope.row.inventoryDiscrepancy==null?"-":scope.row.inventoryDiscrepancy}}</span>
</template>
</el-table-column>
<el-table-column label="盈亏金额" align="center" prop="profitLossAmount">
<template slot-scope="scope">
<span>{{scope.row.profitLossAmount==null?"-":scope.row.profitLossAmount}}</span>
</template>
</el-table-column>
<el-table-column label="审核人" align="center" prop="approverName">
<template slot-scope="scope">
<span>{{ scope.row.approverName == null ? "-" : scope.row.approverName }}</span>
</template>
</el-table-column>
<el-table-column label="入库人" align="center" prop="confirmerName">
<template slot-scope="scope">
<span>{{ scope.row.confirmerName == null ? "-" : scope.row.confirmerName }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<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 == 'yzf'" 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>
<el-table-column label="制单人" align="center" prop="createByName" width="230px">
<template slot-scope="scope">
<span>{{scope.row.createByName}}({{parseTime(scope.row.orderDate)}})</span>
</template>
</el-table-column>
<el-table-column label="制单时间" align="center" prop="orderDate" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.orderDate) }}</span>
</template>
</el-table-column>
<el-table-column label="审核时间" align="center" prop="examineTime" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.examineTime) }}</span>
</template>
</el-table-column>
<el-table-column label="入库时间" align="center" prop="storageTime" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.storageTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
v-if="scope.row.approvalStatus == 'await'"
@click="dispose(scope.row)"
>盘点审核
</el-button>
<el-button
size="mini"
type="text"
v-else-if="scope.row.approvalStatus == 'ysh'"
@click="dispose(scope.row)"
>盘点入库
</el-button>
<el-button
size="mini"
type="text"
v-else
@click="dispose(scope.row)"
>查看详情
</el-button>
</template>
<!-- <el-table-column label="制单日期" align="center" prop="orderDate" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.orderDate) }}</span>
</template>
</el-table-column> -->
<el-table-column label="审核人" align="center" prop="approverName">
<template slot-scope="scope">
<span>{{scope.row.approverName==null?"-":scope.row.approverName}}</span>
</template>
</el-table-column>
<el-table-column label="确认人" align="center" prop="confirmerName">
<template slot-scope="scope">
<span>{{scope.row.confirmerName==null?"-":scope.row.confirmerName}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="dispose(scope.row)"
>处理单据</el-button>
</template>
</el-table-column>
</el-table>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
@ -121,13 +144,13 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
</div>
</div>
</template>
<script>
import {getInventoryPageApi,delInventoryApi,addInventoryApi} from "@/api/convenienceStore/inventory";
import {getInventoryPageApi, delInventoryApi, addInventoryApi} from "@/api/convenienceStore/inventory";
import {listSupplier} from "@/api/convenienceStore/supplier";
export default {
@ -136,11 +159,11 @@ export default {
data() {
return {
inventoryList:[],
inventoryList: [],
//
supplierList:[],
supplierList: [],
//
title:'',
title: '',
//
showSearch: true,
disableInput: false, //
@ -159,12 +182,14 @@ export default {
pageNo: null,
pageSize: null,
},
beginTime: "",
endTime: "",
//
inventoryForm: {
orderNumber: null,
approvalStatus: "",
orderDate: new Date(),
} ,
},
//
loading: false,
//
@ -180,16 +205,21 @@ export default {
methods: {
//
getList(){
getList() {
this.loading = true;
getInventoryPageApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getInventoryPageApi(this.addDateRange(this.queryParams, dateRange)).then(response => {
this.inventoryList = response.data.records;
this.total = response.data.total;
})
this.loading = false;
},
//
getQueryList(){
getQueryList() {
listSupplier().then(response => {
this.supplierList = response.data.records
})
@ -205,11 +235,13 @@ export default {
this.inventoryForm.approvalStatus = 'await';
this.refresh();
this.inventoryForm.orderDate = this.parseTime(new Date())
const res = await addInventoryApi(this.inventoryForm);
if (res) {
this.$modal.msgSuccess("新建批次成功");
this.getList();
this.dispose(res.data)
} else {
this.$modal.msgError("新建批次失败");
}
@ -227,7 +259,7 @@ export default {
let min = 100; // 1000
let max = 999; // 9999
let randomFourDigitNumber = Math.floor(Math.random() * (max - min + 1)) + min;
this.inventoryForm.orderNumber = timestamp+randomFourDigitNumber.toString();
this.inventoryForm.orderNumber = timestamp + randomFourDigitNumber.toString();
},
//
@ -270,7 +302,7 @@ export default {
</script>
<style scoped lang="scss">
.app-container{
.app-container {
width: 100%;
height: 100%;
background: #f6f8f9;

View File

@ -1,33 +1,35 @@
<template>
<div class="app-container">
<el-card >
<div slot="header" class="clearfix" style="display: flex; justify-content: space-between;">
<div>
<i class="el-icon-back" @click="goToAbout">返回 | </i>
<!-- <el-link icon="el-icon-edit" :underline="false" @click="goToAbout">编辑</el-link>-->
<span> 进货详情</span>
</div>
</div>
<div class="card-change-1-search">
<!-- <div slot="header" class="clearfix" style="display: flex; justify-content: space-between;">-->
<!-- <div>-->
<!-- <i class="el-icon-back" @click="goToAbout">返回 | </i>-->
<!-- <span> 进货详情</span>-->
<!-- </div>-->
<!-- </div>-->
<div class="" style="height: 90px; display: flex; justify-content: space-between;">
<div style="height: 100%; display: flex; justify-content: space-between;">
<div style="height: 100%; width: 70%; display: flex; justify-content: space-between;font-family: YouSheBiaoTiHei">
<div style="height: 100%; width: 70%; display: flex; justify-content: space-between;align-items: center">
<div class="box">
<span style="font-size: 26px;color: #3B6ADE;font-weight: bold" >{{purchaseForm.totalAmount}}</span>
<span style="font-size: 26px;color: #0DC291;font-weight: bold">{{ purchaseForm.totalAmount }}</span>
<span style="display: flex">
<div style="background-color: #0DC291;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
总金额</span>
<div
style="background-color: #0DC291;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
总金额
</span>
</div>
<div class="box">
<span style="font-size: 26px;color: #3B6ADE;font-weight: bold" >{{purchaseForm.productQuantity}}</span>
<span style="font-size: 26px;color: #00CAFF;font-weight: bold">{{ purchaseForm.productQuantity }}</span>
<span style="display: flex">
<div style="background-color: #3B6ADE;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
<div
style="background-color: #00CAFF;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
商品数量</span>
</div>
<div class="box">
<span style="font-size: 26px;color: #FF4347;font-weight: bold">{{purchaseForm.quantityPurchased}}</span>
<span style="font-size: 26px;color: #F44522;font-weight: bold">{{ purchaseForm.quantityPurchased }}</span>
<span style="display: flex">
<div style="background-color: #FF4347;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
<div
style="background-color: #F44522;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
进货数量</span>
</div>
</div>
@ -35,14 +37,14 @@
<el-form ref="myForm" label-width="100px">
<el-form-item label="进货单号">
<el-input v-model="purchaseForm.orderNumber"
style="width: 220Px" :disabled="numberInput">
<el-input v-model="purchaseForm.orderNumber"
style="width: 220Px" :disabled="numberInput">
<el-button v-if="!numberInput" slot="append" @click="refresh()" icon="el-icon-refresh"></el-button>
</el-input>
</el-form-item>
<el-form-item label="进货时间" >
<el-form-item label="进货时间">
<el-date-picker
:disabled="numberInput"
:disabled="numberInput"
style="width: 220Px"
v-model="purchaseForm.orderDate"
type="date"
@ -53,81 +55,94 @@
</div>
</div>
<div style="height: 100%; width: 30%; display: flex; align-items: center; justify-content: flex-end;">
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit">保存并审核</el-button>
<el-button type="success" v-if="state=='ysh'" :disabled=" storageFlag" @click="storage()">进货并入库</el-button>
<el-button type="warning" v-if="state =='!await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>
<el-button type="primary" @click="cancelPurchase" v-if="state=='qrts'">关闭</el-button>
<el-button @click="cancelPurchase" v-else>取消</el-button>
<el-button type="success" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
<el-button type="primary" v-if="state=='await'" :disabled="auditFlag" @click="audit">保存并审核</el-button>
<el-button type="danger" v-if="state=='ysh'" :disabled="voidFlag" @click="abolition()">
作废
</el-button>
<el-button type="primary" v-if="state=='ysh'" :disabled=" storageFlag" @click="storage()">进货并入库
</el-button>
<!-- <el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>-->
</div>
</div>
</el-card>
</div>
<el-card style="margin-top: 20px" >
<div class="card-change-1-1">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5" style="text-align: right; float: right">
<el-button
v-if="!numberInput"
v-if="!numberInput"
type="primary"
icon="el-icon-plus"
@click="commodityAdd"
>添加进货</el-button>
>添加采购商品
</el-button>
</el-col>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row>
<el-table ref="tables"
v-loading="loading"
:data="detailsList"
:default-sort="defaultSort">
<div style="height: 68vh;overflow: auto">
<el-table ref="tables" border
v-loading="loading"
:data="detailsList"
:default-sort="defaultSort">
<el-table-column label="商品名称" align="center" prop="commodityName"/>
<el-table-column label="分类名称" prop="cvsGoodId" align="center">
<template slot-scope="scope">
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
</template>
</el-table-column>
<el-table-column label="商品名称" align="center" prop="commodityName"/>
<el-table-column label="分类名称" prop="cvsGoodId" align="center">
<template slot-scope="scope">
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
</template>
</el-table-column>
<el-table-column label="供应商" prop="supplierId" align="center">
<template slot-scope="scope">
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit">
<template slot-scope="scope">
<span>{{ scope.row.unit == null?"-":scope.row.unit}}</span>
</template>
</el-table-column>
<el-table-column label="当前库存" align="center" prop="stock"/>
<el-table-column label="进货数量" align="center" prop="quantityPurchased">
<template slot-scope="scope">
<el-input-number :disabled="numberInput" v-model="scope.row.quantityPurchased" @change="change(scope.row,1)" :precision="0" controls-position="right" :min="1" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
</template>
</el-table-column>
<el-table-column label="进货单价" align="center" prop="unitPrice">
<template slot-scope="scope">
<el-input-number :disabled="numberInput" v-model="scope.row.unitPrice" @change="change(scope.row,2)" :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 label="小计金额" align="center" prop="subtotalAmount">
<template slot-scope="scope">
<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="state =='await'" label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="commodityDel(scope.row)"
>删除</el-button>
</template>
<!-- v-hasPermi="['']"-->
</el-table-column>
</el-table>
<el-table-column label="供应商" prop="supplierId" align="center">
<template slot-scope="scope">
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit">
<template slot-scope="scope">
<span>{{ scope.row.unit == null ? "-" : scope.row.unit }}</span>
</template>
</el-table-column>
<el-table-column label="当前库存" align="center" prop="stock"/>
<el-table-column label="进货数量" align="center" prop="quantityPurchased">
<template slot-scope="scope">
<el-input-number :disabled="numberInput" v-model="scope.row.quantityPurchased"
@change="change(scope.row,1)"
:precision="0" controls-position="right" :min="1" :max="100000000" :step="1"
style="max-width: 100%"></el-input-number>
</template>
</el-table-column>
<el-table-column label="进货单价" align="center" prop="unitPrice">
<template slot-scope="scope">
<el-input-number :disabled="numberInput" v-model="scope.row.unitPrice" @change="change(scope.row,2)"
: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 label="小计金额" align="center" prop="subtotalAmount">
<template slot-scope="scope">
<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="state =='await'" label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="commodityDel(scope.row)"
>删除
</el-button>
</template>
<!-- v-hasPermi="['']"-->
</el-table-column>
</el-table>
</div>
<!-- <pagination-->
<!-- v-show="total>0"-->
<!-- :total="total"-->
@ -135,45 +150,37 @@
<!-- :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"-->
<!-- />-->
</el-card>
</div>
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
<el-container>
<el-header style="">
<el-form ref="tankForm" :model="commodityForm" label-width="80px">
<el-row :gutter="24">
<el-col :span="6">
<el-form-item label="商品分类">
<el-select
v-model="commodityForm.cvsGoodId"
placeholder="全部"
clearable
>
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="供应商" prop="supplierId">
<el-select
v-model="commodityForm.supplierId"
placeholder="全部"
clearable
>
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="详细信息">
<el-input v-model="commodityForm.remark" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-button type="primary" @click="inquire()">查询</el-button>
</el-col>
</el-row>
<el-form ref="tankForm" :model="commodityForm" label-width="20px" :inline="true">
<el-form-item label="">
<el-select
v-model="commodityForm.cvsGoodId"
placeholder="请选择商品分类"
clearable
>
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item label="" prop="supplierId">
<el-select
v-model="commodityForm.supplierId"
placeholder="请选择供应商名称"
clearable
>
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item label="">
<el-input v-model="commodityForm.remark" placeholder="请输入商品名称,拼音码,条形码等"></el-input>
</el-form-item>
<el-form-item style="float: right;margin-right: 0px">
<el-button type="primary" icon="el-icon-search" @click="inquire()">搜索</el-button>
</el-form-item>
</el-form>
</el-header>
<el-main>
@ -183,14 +190,10 @@
@selection-change="handleSelectionChange"
border
:default-sort="defaultSort">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column type="selection" align="center" width="55"></el-table-column>
<el-table-column label="商品名称" align="center" prop="name"/>
<el-table-column label="商品编码" align="center" prop="goodsNo"/>
<el-table-column label="类名称" prop="cvsGoodId" align="center">
<!-- <el-table-column label="商品编码" align="center" prop="goodsNo"/>-->
<el-table-column label="品类名称" prop="cvsGoodId" align="center">
<template slot-scope="scope">
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
</template>
@ -201,21 +204,26 @@
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="商品规格" align="center" prop="goodsSpecs">
<template slot-scope="scope">
<div>{{scope.row.goodsSpecs || '-'}}</div>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="当前库存" align="center" prop="stock"/>
</el-table>
<!-- <pagination
v-show="commodityForm.total>0"
:total="commodityForm.total"
:page.sync="commodityForm.page"
:limit.sync="commodityForm.pageSize"
@pagination="getCommodityList"
/> -->
<!-- <pagination
v-show="commodityForm.total>0"
:total="commodityForm.total"
:page.sync="commodityForm.page"
:limit.sync="commodityForm.pageSize"
@pagination="getCommodityList"
/> -->
</el-main>
</el-container>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addCommodity"> </el-button>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="addCommodity"> </el-button>
</div>
</el-dialog>
@ -228,7 +236,7 @@ import {getAuditPremApi} from "@/api/oilConfig/staff";
import {BigNumber} from "bignumber.js";
import {listLJGoods} from "@/api/convenienceStore/ljgoods";
import {getName,parseTime} from "../../../utils/fuint";
import {getName, parseTime} from "../../../utils/fuint";
import {selectParentById, selectTree} from "@/api/convenienceStore/goods";
import {listSupplier} from "@/api/convenienceStore/supplier";
import {
@ -246,7 +254,7 @@ import {
export default {
name: "details",
props:[
props: [
'PpurchaseId',
'PorderNumber',
'PorderDate',
@ -256,8 +264,8 @@ export default {
return {
detailsList: [],
commodityList: [],
purchaseId:null,
commodityForm:{
purchaseId: null,
commodityForm: {
cvsGoodId: "",
cvsGood: "",
supplierId: "",
@ -267,7 +275,7 @@ export default {
page: 1,
pageSize: 1000,
total: 0,
isRecovery:0,
isRecovery: 0,
},
purchaseForm: {
orderNumber: null,
@ -276,24 +284,24 @@ export default {
totalAmount: 0, //
productQuantity: 0, //
quantityPurchased: 0 //
} ,
},
//
cvsGoodList:[],
cvsGoodList: [],
//
supplierList:[],
supplierList: [],
numberInput: false,
state: 'await',
state:'await',
saveFlag:false,
auditFlag:false,
voidFlag:false,
storageFlag:false,
multipleSelection:[], //
saveFlag: false,
auditFlag: false,
voidFlag: false,
storageFlag: false,
multipleSelection: [], //
//
title:'选择商品',
title: '添加采购商品',
//
showSearch: true,
disableInput: false, //
@ -306,8 +314,8 @@ export default {
queryParams: {
// supplierId: '',
purchaseId: null,
page:1,
pageSize:10000
page: 1,
pageSize: 10000
},
//
loading: false,
@ -316,7 +324,7 @@ export default {
//
rules: {
supplierName: [
{ required: true, message: "供应商名称不能为空", trigger: "blur" },
{required: true, message: "供应商名称不能为空", trigger: "blur"},
],
},
}
@ -331,24 +339,24 @@ export default {
this.purchaseForm.approvalStatus = this.$props.PapprovalStatus
this.state = this.$props.PapprovalStatus
console.log("this.purchaseForm",this.purchaseForm)
console.log("this.purchaseForm", this.purchaseForm)
if ( this.state == null) {
if (this.state == null) {
this.state = 'await'
}
if (this.state=='await') {
if (this.state == 'await') {
this.numberInput = false
}else {
} else {
this.numberInput = true
}
console.log(this.state, 357)
if (this.purchaseForm.orderNumber == null) {
this.refresh();
}
if (this.purchaseForm.orderDate == null) {
this.purchaseForm.orderDate =new Date()
this.purchaseForm.orderDate = new Date()
}
this.getDetailsList();
@ -357,9 +365,13 @@ export default {
},
methods: {
//
cancelPurchase() {
this.$router.back()
},
getDetailsList() {
let this_ = this
getPurchaseDetailsPageApi(this.queryParams).then(res=>{
getPurchaseDetailsPageApi(this.queryParams).then(res => {
this_.detailsList = res.data.records;
this.total = res.data.total;
this.sumMethod(res.data.records);
@ -367,7 +379,7 @@ export default {
},
getCommodityList() {
let this_ = this
listLJGoods(this_.commodityForm).then(res=>{
listLJGoods(this_.commodityForm).then(res => {
this_.commodityList = res.data.records;
this.commodityForm.total = res.data.total;
// this_.sumMethod(res.data.records);
@ -384,32 +396,31 @@ export default {
this.$confirm('确定删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (data.id != null) {
delDetailsApi(data).then(res=>{
})
}
const index = this.detailsList.indexOf(data); //
if (index !== -1) {
this.detailsList.splice(index, 1); // 使splice
}
this.sumMethod(this.detailsList);
if (data.id != null) {
delDetailsApi(data).then(res => {
})
}
const index = this.detailsList.indexOf(data); //
if (index !== -1) {
this.detailsList.splice(index, 1); // 使splice
}
this.sumMethod(this.detailsList);
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
@ -419,10 +430,10 @@ export default {
},
//
change(data,flag) {
change(data, flag) {
let quantityPurchased = new BigNumber( data.quantityPurchased);
let unitPrice = new BigNumber( data.unitPrice);
let quantityPurchased = new BigNumber(data.quantityPurchased);
let unitPrice = new BigNumber(data.unitPrice);
let subtotalAmount = new BigNumber(data.subtotalAmount);
if (flag == 1) {
@ -438,7 +449,7 @@ export default {
}
this.sumMethod(this.detailsList);
console.log("this.detailsList",this.detailsList)
console.log("this.detailsList", this.detailsList)
//
// this.detailsList = data
// this.edit()
@ -450,50 +461,50 @@ export default {
this_.purchaseForm.totalAmount = data.length
this_.purchaseForm.productQuantity = data.length,
this_.purchaseForm.totalAmount = new BigNumber(0),
this_.purchaseForm.quantityPurchased = new BigNumber(0),
this_.purchaseForm.productQuantity = data.length,
this_.purchaseForm.totalAmount = new BigNumber(0),
this_.purchaseForm.quantityPurchased = new BigNumber(0),
data.forEach(da => {
if (da.unitPrice != null) {
this_.purchaseForm.quantityPurchased= this_.purchaseForm.quantityPurchased.plus(da.quantityPurchased)
}
if (da.subtotalAmount != null) {
this_.purchaseForm.totalAmount= this_.purchaseForm.totalAmount.plus(da.subtotalAmount)
}
})
data.forEach(da => {
if (da.unitPrice != null) {
this_.purchaseForm.quantityPurchased = this_.purchaseForm.quantityPurchased.plus(da.quantityPurchased)
}
if (da.subtotalAmount != null) {
this_.purchaseForm.totalAmount = this_.purchaseForm.totalAmount.plus(da.subtotalAmount)
}
})
},
addCommodity () {
addCommodity() {
let this_ = this
let sum = 0;
this.multipleSelection.forEach(mul=>{
this.multipleSelection.forEach(mul => {
let flag = true;
this_.detailsList.forEach(det=>{
this_.detailsList.forEach(det => {
if (mul.id == det.goodsId) {
flag = false
sum++
}
})
if(flag) {
if (flag) {
let now = {
goodsId: mul.id,
commodityName: mul.name,
supplierId: mul.supplierId,
cvsGoodId: mul.cvsGoodId,
unit:mul.unit,
stock:mul.stock,
quantityPurchased: 1,
unitPrice: 0,
subtotalAmount: 0
}
this_.detailsList.push(now)
goodsId: mul.id,
commodityName: mul.name,
supplierId: mul.supplierId,
cvsGoodId: mul.cvsGoodId,
unit: mul.unit,
stock: mul.stock,
quantityPurchased: 1,
unitPrice: 0,
subtotalAmount: 0
}
this_.detailsList.push(now)
}
})
if(sum>0) {
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
if (sum > 0) {
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了" + sum + "件相同的商品,已为您剔除");
}
this_.open = false
this.multipleSelection = []
@ -507,7 +518,7 @@ export default {
page: 1,
pageSize: 1000,
total: 0,
isRecovery:0,
isRecovery: 0,
}
this.commodityList = []
@ -515,7 +526,7 @@ export default {
},
//
getQueryList(){
getQueryList() {
selectTree().then(response => {
this.cvsGoodList = response.data.records
});
@ -536,41 +547,40 @@ export default {
let min = 100; // 100
let max = 999; // 999
let randomFourDigitNumber = Math.floor(Math.random() * (max - min + 1)) + min;
this.purchaseForm.orderNumber = timestamp+randomFourDigitNumber.toString();
this.purchaseForm.orderNumber = timestamp + randomFourDigitNumber.toString();
},
//
async JudgmentButton(){
async JudgmentButton() {
let judgmentPermissions1 = await this.judgmentPermissions("进货审核");
if (judgmentPermissions1 > 0){
this.auditFlag=false
if (judgmentPermissions1 > 0) {
this.auditFlag = false
// this.voidFlag=false
} else {
this.auditFlag=true
this.auditFlag = true
}
let judgmentPermissions2 = await this.judgmentPermissions("进货入库");
console.log("judgmentPermissions2",judgmentPermissions2)
if (judgmentPermissions2 > 0){
console.log("judgmentPermissions2", judgmentPermissions2)
if (judgmentPermissions2 > 0) {
this.storageFlag = false
}else {
} else {
this.storageFlag = true
}
let judgmentPermissions3 = await this.judgmentPermissions("进货废止");
if (judgmentPermissions3 > 0){
this.voidFlag=false
}else {
this.voidFlag=true
if (judgmentPermissions3 > 0) {
this.voidFlag = false
} else {
this.voidFlag = true
}
},
//
async judgmentPermissions(data) {
let fil ={
auditPrem:data
let fil = {
auditPrem: data
}
return await getAuditPremApi(fil).then(res => {
return res.data
@ -578,86 +588,83 @@ export default {
},
async save(flag){
async save(flag) {
let this_ = this
let con = true
//
if (this_.purchaseForm.orderNumber == null) {
this.$modal.msgError("进货单号不能为空");
return -1;
}else if (this_.purchaseForm.orderDate == null) {
} else if (this_.purchaseForm.orderDate == null) {
this.$modal.msgError("进货时间不能为空");
return -1;
}else if(this_.detailsList.length<=0) {
} else if (this_.detailsList.length <= 0) {
this.$modal.msgError("进货单不能为空");
return -1;
}
if (this_.purchaseId == null) {
//
await addPurchaseApi(this_.purchaseForm).then(res=>{
await addPurchaseApi(this_.purchaseForm).then(res => {
if (res.code === 200) {
this_.purchaseId = res.data.id
this.queryParams.purchaseId = res.data.id
}else {
} else {
this.$modal.msgError("保存失败");
con=false
con = false
return -1;
}
}).catch(res=>{
}).catch(res => {
this.$modal.msgError("保存失败");
con=false
con = false
return -1;
})
}else {
} else {
//
this_.purchaseForm.id = this_.purchaseId
this.queryParams.purchaseId = this_.purchaseId
await editPurchaseApi(this_.purchaseForm).then(res=> {
if (res.code !== 200){
await editPurchaseApi(this_.purchaseForm).then(res => {
if (res.code !== 200) {
this.$modal.msgError("保存失败");
con=false
con = false
return -1;
}
}).catch(res=>{
}).catch(res => {
this.$modal.msgError("保存失败");
con=false
con = false
return -1;
})
}
if (con) {
//
this_.detailsList.forEach(data=>{
this_.detailsList.forEach(data => {
data.purchaseId = this_.purchaseId
})
await batchProcessingApi(this_.detailsList).then(res=>{
await batchProcessingApi(this_.detailsList).then(res => {
this.$modal.msgSuccess("保存成功");
if (flag == -1) {
this.goToAbout();
}
}).catch(res=>{
}).catch(res => {
// this.$modal.msgError("");
})
}
},
//
async audit(){
async audit() {
//
let number = await this.save(-1);
if (number != -1) {
//
let fil ={
let fil = {
id: this.purchaseId
}
console.log(" id: this.purchaseId1",fil)
console.log(" id: this.purchaseId1", fil)
await auditPurchaseApi(fil).then(res => {
if (res.data) {
@ -679,10 +686,10 @@ export default {
if (this_.purchaseForm.orderNumber == null) {
this.$modal.msgError("进货单号不能为空");
return -1;
}else if (this_.purchaseForm.orderDate == null) {
} else if (this_.purchaseForm.orderDate == null) {
this.$modal.msgError("进货时间不能为空");
return -1;
}else if(this_.detailsList.length<=0) {
} else if (this_.detailsList.length <= 0) {
this.$modal.msgError("进货单不能为空");
return -1;
}
@ -693,10 +700,10 @@ export default {
type: 'warning'
}).then(() => {
//
let fil ={
let fil = {
id: this.purchaseId
}
console.log("fil",fil)
console.log("fil", fil)
storagePurchaseApi(fil).then(res => {
this.state = 'qrts'
this.$modal.msgWarning("入库成功");
@ -710,7 +717,7 @@ export default {
});
},
//
abolition(){
abolition() {
if (this.PurchaseId < 0) {
this.$modal.msgWarning("数据未保存,不可废弃");
return;
@ -720,7 +727,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let fil ={
let fil = {
id: this.purchaseId
}
abolitionPurchaseApi(fil).then(res => {
@ -740,19 +747,19 @@ export default {
})
},
//
//
async exportExcel() {
let fil ={
purchaseId: this.purchaseId
}
let fil = {
purchaseId: this.purchaseId
}
exportExcelApi(fil).then(res=>{
console.log("res",res)
exportExcelApi(fil).then(res => {
console.log("res", res)
// this.downloadFile(res);
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
const blob = new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
this.$download.saveAs(blob,'库存统计.xLsx')
this.$download.saveAs(blob, '库存统计.xLsx')
})
},
@ -775,19 +782,18 @@ export default {
</script>
<style scoped lang="scss">
.app-container{
.app-container {
width: 100%;
height: 100%;
background: #f6f8f9;
}
.box {
height: 100%;
height: 80%;
width: 212px;
margin-right: 10px;
background: #FFFFFF;
border-radius: 10px 10px 10px 10px;
border: 1px solid #EEEEEE;
border: 1px solid #FF9655;
border-radius: 10px;
display: flex;
flex-direction: column;

View File

@ -1,30 +1,32 @@
<template>
<div class="app-container">
<el-card >
<div slot="header" class="clearfix">
<i class="el-icon-back" @click="goToAbout">返回 | </i>
<!-- <el-link icon="el-icon-edit" :underline="false" @click="goToAbout">编辑</el-link>-->
<span> 退货详情</span>
</div>
<div class="card-change-1-search">
<!-- <div slot="header" class="clearfix">-->
<!-- <i class="el-icon-back" @click="goToAbout">返回 | </i>-->
<!-- <span> 退货详情</span>-->
<!-- </div>-->
<div class="" style="height: 90px; display: flex; justify-content: space-between;">
<div style="height: 100%; display: flex; justify-content: space-between;">
<div style="height: 100%; width: 70%; display: flex; justify-content: space-between;font-family: YouSheBiaoTiHei">
<div style="height: 100%; width: 70%; display: flex; justify-content: space-between;align-items: center">
<div class="box">
<span style="font-size: 26px;color: #3B6ADE;font-weight: bold" >{{returnsForm.totalAmount}}</span>
<span style="font-size: 26px;color: #0DC291;font-weight: bold">{{ returnsForm.totalAmount }}</span>
<span style="display: flex">
<div style="background-color: #0DC291;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
<div
style="background-color: #0DC291;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
总金额</span>
</div>
<div class="box">
<span style="font-size: 26px;color: #3B6ADE;font-weight: bold" >{{returnsForm.productQuantity}}</span>
<span style="font-size: 26px;color: #00CAFF;font-weight: bold">{{ returnsForm.productQuantity }}</span>
<span style="display: flex">
<div style="background-color: #3B6ADE;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
<div
style="background-color: #00CAFF;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
商品数量</span>
</div>
<div class="box">
<span style="font-size: 26px;color: #FF4347;font-weight: bold">{{returnsForm.returnQuantity}}</span>
<span style="font-size: 26px;color: #F44522;font-weight: bold">{{ returnsForm.returnQuantity }}</span>
<span style="display: flex">
<div style="background-color: #FF4347;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
<div
style="background-color: #F44522;width: 10px;height: 10px;border-radius: 50%;margin-top: 6px;margin-right: 10px"></div>
退货数量</span>
</div>
</div>
@ -32,15 +34,15 @@
<el-form ref="myForm" label-width="100px">
<el-form-item label="退货单号">
<el-input v-model="returnsForm.orderNumber"
:disabled="numberInput"
style="width: 220Px">
<el-input v-model="returnsForm.orderNumber"
:disabled="numberInput"
style="width: 220Px">
<el-button v-if="!numberInput" slot="append" @click="refresh()" icon="el-icon-refresh"></el-button>
</el-input>
</el-form-item>
<el-form-item label="退货时间" >
<el-form-item label="退货时间">
<el-date-picker
:disabled="numberInput"
:disabled="numberInput"
style="width: 220Px"
v-model="returnsForm.orderDate"
type="date"
@ -51,82 +53,96 @@
</div>
</div>
<div style="height: 100%; width: 30%; display: flex; align-items: center; justify-content: flex-end;">
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit()">保存并审核</el-button>
<el-button type="success" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存</el-button>
<el-button type="warning" v-if="state =='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>
<el-button type="primary" @click="cancelPurchase" v-if="state=='qrts'">关闭</el-button>
<el-button @click="cancelPurchase" v-else>取消</el-button>
<el-button type="success" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
<el-button type="primary" v-if="state=='await'" :disabled="auditFlag" @click="audit()">保存并审核</el-button>
<el-button type="danger" v-if="state=='ysh'" :disabled="voidFlag" @click="abolition()">
作废
</el-button>
<el-button type="primary" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存
</el-button>
<!-- <el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>-->
</div>
</div>
</el-card>
</div>
<el-card style="margin-top: 20px" >
<div class="card-change-1-1">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5" style="text-align: right; float: right">
<el-button
v-if="!numberInput"
v-if="!numberInput"
type="primary"
icon="el-icon-plus"
@click="commodityAdd"
>添加退货</el-button>
>添加退货商品
</el-button>
</el-col>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row>
<el-table ref="tables"
v-loading="loading"
:data="detailsList"
:default-sort="defaultSort">
<div style="height: 68vh;overflow: auto">
<el-table ref="tables" border
v-loading="loading"
:data="detailsList"
:default-sort="defaultSort">
<el-table-column label="商品名称" align="center" prop="commodityName"/>
<el-table-column label="分类名称" prop="cvsGoodId" align="center">
<template slot-scope="scope">
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
</template>
</el-table-column>
<el-table-column label="商品名称" align="center" prop="commodityName"/>
<el-table-column label="分类名称" prop="cvsGoodId" align="center">
<template slot-scope="scope">
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
</template>
</el-table-column>
<el-table-column label="供应商" prop="supplierId" align="center">
<template slot-scope="scope">
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit">
<template slot-scope="scope">
<span>{{ scope.row.unit == null?"-":scope.row.unit}}</span>
</template>
</el-table-column>
<el-table-column label="入库前库存" align="center" prop="preInboundInventory"/>
<el-table-column label="退货数量" align="center" prop="returnQuantity">
<template slot-scope="scope">
<el-input-number :disabled="numberInput" v-model="scope.row.returnQuantity" @change="change(scope.row,1)" :precision="0" controls-position="right" :min="1" :max="100000000" :step="1" style="max-width: 100%"></el-input-number>
</template>
</el-table-column>
<el-table-column label="退货单价" align="center" prop="returnPrice">
<template slot-scope="scope">
<el-input-number :disabled="numberInput" v-model="scope.row.returnPrice" @change="change(scope.row,2)" :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 label="小计金额" align="center" prop="subtotalAmount">
<template slot-scope="scope">
<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">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="commodityDel(scope.row)"
>删除</el-button>
</template>
<!-- v-hasPermi="['']"-->
<el-table-column label="供应商" prop="supplierId" align="center">
<template slot-scope="scope">
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit">
<template slot-scope="scope">
<span>{{ scope.row.unit == null ? "-" : scope.row.unit }}</span>
</template>
</el-table-column>
<el-table-column label="入库前库存" align="center" prop="preInboundInventory"/>
<el-table-column label="退货数量" align="center" prop="returnQuantity">
<template slot-scope="scope">
<el-input-number :disabled="numberInput" v-model="scope.row.returnQuantity" @change="change(scope.row,1)"
:precision="0" controls-position="right" :min="1" :max="100000000" :step="1"
style="max-width: 100%"></el-input-number>
</template>
</el-table-column>
<el-table-column label="退货单价" align="center" prop="returnPrice">
<template slot-scope="scope">
<el-input-number :disabled="numberInput" v-model="scope.row.returnPrice" @change="change(scope.row,2)"
: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 label="小计金额" align="center" prop="subtotalAmount">
<template slot-scope="scope">
<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">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="commodityDel(scope.row)"
>删除
</el-button>
</template>
<!-- v-hasPermi="['']"-->
</el-table-column>
</el-table>
</el-table-column>
</el-table>
</div>
<!-- <pagination-->
<!-- v-show="total>0"-->
@ -135,45 +151,37 @@
<!-- :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"-->
<!-- />-->
</el-card>
</div>
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false">
<el-container>
<el-header style="">
<el-form ref="tankForm" :model="commodityForm" label-width="80px">
<el-row :gutter="24">
<el-col :span="6">
<el-form-item label="商品分类">
<el-select
v-model="commodityForm.cvsGoodId"
placeholder="全部"
clearable
>
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="供应商" prop="supplierId">
<el-select
v-model="commodityForm.supplierId"
placeholder="全部"
clearable
>
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="详细信息">
<el-input v-model="commodityForm.remark" placeholder="商品名称,拼音码,条形码等信息" ></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-button type="primary" @click="inquire()">查询</el-button>
</el-col>
</el-row>
<el-form ref="tankForm" :model="commodityForm" label-width="20px" :inline="true">
<el-form-item label="">
<el-select
v-model="commodityForm.cvsGoodId"
placeholder="请选择商品分类"
clearable
>
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item label="" prop="supplierId">
<el-select
v-model="commodityForm.supplierId"
placeholder="请选择供应商名称"
clearable
>
<el-option v-for="item in supplierList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item label="">
<el-input v-model="commodityForm.remark" placeholder="请输入商品名称,拼音码,条形码等信息"></el-input>
</el-form-item>
<el-form-item label="" style="float: right;margin-right: 0px">
<el-button type="primary" icon="el-icon-search" @click="inquire()">搜索</el-button>
</el-form-item>
</el-form>
</el-header>
<el-main>
@ -183,14 +191,11 @@
@selection-change="handleSelectionChange"
border
:default-sort="defaultSort">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column align="center" type="selection" width="55"></el-table-column>
<el-table-column label="商品名称" align="center" prop="name"/>
<el-table-column label="商品编码" align="center" prop="goodsNo"/>
<el-table-column label="类名称" prop="cvsGoodId" align="center">
<!-- <el-table-column label="商品编码" align="center" prop="goodsNo"/>-->
<el-table-column label="类名称" prop="cvsGoodId" align="center">
<template slot-scope="scope">
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
</template>
@ -201,14 +206,19 @@
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="商品规格" align="center" prop="goodsSpecs">
<template slot-scope="scope">
<div>{{ scope.row.goodsSpecs || '-' }}</div>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="unit"/>
<el-table-column label="当前库存" align="center" prop="stock"/>
</el-table>
</el-main>
</el-container>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addCommodity"> </el-button>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="addCommodity"> </el-button>
</div>
</el-dialog>
@ -219,7 +229,7 @@
import {getAuditPremApi} from "@/api/oilConfig/staff";
import {BigNumber} from "bignumber.js";
import {listLJGoods} from "@/api/convenienceStore/ljgoods";
import {getName,parseTime} from "../../../utils/fuint";
import {getName, parseTime} from "../../../utils/fuint";
import {selectParentById, selectTree} from "@/api/convenienceStore/goods";
import {listSupplier} from "@/api/convenienceStore/supplier";
import {
@ -237,7 +247,7 @@ import {
export default {
name: "details",
props:[
props: [
'PreturnsId',
'PorderNumber',
'PorderDate',
@ -247,8 +257,8 @@ export default {
return {
detailsList: [],
commodityList: [],
ReturnsId:null,
commodityForm:{
ReturnsId: null,
commodityForm: {
cvsGoodId: "",
cvsGood: "",
supplierId: "",
@ -257,8 +267,8 @@ export default {
remark: "",
page: 1,
pageSize: 1000,
isRecovery:0,
total:0,
isRecovery: 0,
total: 0,
},
returnsForm: {
orderNumber: null,
@ -267,23 +277,23 @@ export default {
totalAmount: 0, //
productQuantity: 0, //
returnQuantity: 0 //
} ,
},
//
cvsGoodList:[],
cvsGoodList: [],
//
supplierList:[],
supplierList: [],
state:'await',
state: 'await',
saveFlag:false,
auditFlag:true,
voidFlag:true,
storageFlag:true,
multipleSelection:[], //
saveFlag: false,
auditFlag: true,
voidFlag: true,
storageFlag: true,
multipleSelection: [], //
//
title:'选择商品',
title: '选择商品',
//
showSearch: true,
disableInput: false, //
@ -296,9 +306,10 @@ export default {
queryParams: {
// supplierId: '',
returnsId: null,
page:null,
pageSize:null
page: null,
pageSize: null
},
numberInput: false,
//
loading: false,
//
@ -306,7 +317,7 @@ export default {
//
rules: {
supplierName: [
{ required: true, message: "供应商名称不能为空", trigger: "blur" },
{required: true, message: "供应商名称不能为空", trigger: "blur"},
],
},
}
@ -322,23 +333,23 @@ export default {
this.returnsForm.approvalStatus = this.$props.PapprovalStatus
this.state = this.$props.PapprovalStatus
if ( this.state == null) {
if (this.state == null) {
this.state = 'await'
}
if (this.state=='await') {
if (this.state == 'await') {
this.numberInput = false
}else {
} else {
this.numberInput = true
}
console.log("this.returnsForm",this.returnsForm)
console.log("this.returnsForm", this.returnsForm)
if (this.returnsForm.orderNumber == null) {
this.refresh();
}
if (this.returnsForm.orderDate == null) {
this.returnsForm.orderDate =new Date()
this.returnsForm.orderDate = new Date()
}
this.getDetailsList();
@ -346,9 +357,13 @@ export default {
this.JudgmentButton();
},
methods: {
//
cancelPurchase() {
this.$router.back()
},
getDetailsList() {
let this_ = this
getReturnsDetailsPageApi(this.queryParams).then(res=>{
getReturnsDetailsPageApi(this.queryParams).then(res => {
this_.detailsList = res.data.records;
this.total = res.data.total;
this.sumMethod(res.data.records);
@ -356,7 +371,7 @@ export default {
},
getCommodityList() {
let this_ = this
listLJGoods(this_.commodityForm).then(res=>{
listLJGoods(this_.commodityForm).then(res => {
this_.commodityList = res.data.records;
this.commodityForm.total = response.data.total;
// this_.sumMethod(res.data.records);
@ -364,37 +379,35 @@ export default {
},
//
goToAbout() {
this.$router.push('/convenienceStore/returns/index');
this.$router.push('/convenienceStore/purchase/index');
},
commodityAdd() {
this.open = true;
},
commodityDel(data) {
this.$confirm('确定删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (data.id != null) {
delDetailsApi(data).then(res=>{
})
}
const index = this.detailsList.indexOf(data); //
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (data.id != null) {
delDetailsApi(data).then(res => {
})
}
const index = this.detailsList.indexOf(data); //
if (index !== -1) {
this.detailsList.splice(index, 1); // 使splice
this.sumMethod(this.detailsList);
if (index !== -1) {
this.detailsList.splice(index, 1); // 使splice
this.sumMethod(this.detailsList);
}
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
@ -404,10 +417,10 @@ export default {
},
//
change(data,flag) {
change(data, flag) {
let returnQuantity = new BigNumber( data.returnQuantity);
let returnPrice = new BigNumber( data.returnPrice);
let returnQuantity = new BigNumber(data.returnQuantity);
let returnPrice = new BigNumber(data.returnPrice);
let subtotalAmount = new BigNumber(data.subtotalAmount);
if (flag == 1) {
@ -423,7 +436,7 @@ export default {
}
this.sumMethod(this.detailsList);
console.log("this.detailsList",this.detailsList)
console.log("this.detailsList", this.detailsList)
//
// this.detailsList = data
// this.edit()
@ -433,45 +446,45 @@ export default {
sumMethod(data) {
let this_ = this
if (data.length>0) {
if (data.length > 0) {
this_.returnsForm.totalAmount = data.length
} else {
this_.returnsForm.totalAmount = 0
}
this_.returnsForm.productQuantity = data.length,
this_.returnsForm.totalAmount = new BigNumber(0),
this_.returnsForm.returnQuantity = new BigNumber(0),
this_.returnsForm.productQuantity = data.length,
this_.returnsForm.totalAmount = new BigNumber(0),
this_.returnsForm.returnQuantity = new BigNumber(0),
data.forEach(da => {
if (da.returnPrice != null) {
this_.returnsForm.returnQuantity= this_.returnsForm.returnQuantity.plus(da.returnQuantity)
}
if (da.subtotalAmount != null) {
this_.returnsForm.totalAmount= this_.returnsForm.totalAmount.plus(da.subtotalAmount)
}
})
data.forEach(da => {
if (da.returnPrice != null) {
this_.returnsForm.returnQuantity = this_.returnsForm.returnQuantity.plus(da.returnQuantity)
}
if (da.subtotalAmount != null) {
this_.returnsForm.totalAmount = this_.returnsForm.totalAmount.plus(da.subtotalAmount)
}
})
},
addCommodity () {
addCommodity() {
let this_ = this
let sum = 0;
this.multipleSelection.forEach(mul=>{
this.multipleSelection.forEach(mul => {
let flag = true;
this_.detailsList.forEach(det=>{
this_.detailsList.forEach(det => {
if (mul.id == det.goodsId) {
flag = false
sum++
}
})
if(flag) {
if (flag) {
let now = {
goodsId: mul.id,
commodityName: mul.name,
supplierId: mul.supplierId,
cvsGoodId: mul.cvsGoodId,
unit:mul.unit,
preInboundInventory:mul.stock,
unit: mul.unit,
preInboundInventory: mul.stock,
returnQuantity: 0,
returnPrice: 0,
subtotalAmount: 0
@ -480,8 +493,8 @@ export default {
}
})
if(sum>0) {
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了"+sum+"件相同的商品,已为您剔除");
if (sum > 0) {
this.$modal.msgError("同一退货单不能有两件相同的商品,您选择了" + sum + "件相同的商品,已为您剔除");
}
this_.open = false
this.multipleSelection = []
@ -495,14 +508,14 @@ export default {
page: 1,
pageSize: 1000,
total: 0,
isRecovery:0,
isRecovery: 0,
}
this.commodityList = []
this_.sumMethod(this_.detailsList);
},
//
getQueryList(){
getQueryList() {
selectTree().then(response => {
this.cvsGoodList = response.data.records
});
@ -523,53 +536,52 @@ export default {
let min = 100; // 1000
let max = 999; // 9999
let randomFourDigitNumber = Math.floor(Math.random() * (max - min + 1)) + min;
this.returnsForm.orderNumber = timestamp+randomFourDigitNumber.toString();
this.returnsForm.orderNumber = timestamp + randomFourDigitNumber.toString();
},
//
async JudgmentButton(){
async JudgmentButton() {
let judgmentPermissions1 = await this.judgmentPermissions("退货审核");
if (judgmentPermissions1 > 0){
this.auditFlag=false,
this.voidFlag=false
if (judgmentPermissions1 > 0) {
this.auditFlag = false,
this.voidFlag = false
}
let judgmentPermissions2 = await this.judgmentPermissions("退货出库");
if (judgmentPermissions2 > 0){
if (judgmentPermissions2 > 0) {
this.storageFlag = false
}
let judgmentPermissions3 = await this.judgmentPermissions("退货废止");
if (judgmentPermissions3 > 0){
this.voidFlag=false
}else {
this.voidFlag=true
if (judgmentPermissions3 > 0) {
this.voidFlag = false
} else {
this.voidFlag = true
}
},
//
async judgmentPermissions(data) {
let fil ={
auditPrem:data
let fil = {
auditPrem: data
}
return await getAuditPremApi(fil).then(res => {
return res.data
});
},
async save(flag){
async save(flag) {
let this_ = this
let con = true
//
if (this_.returnsForm.orderNumber == null) {
this.$modal.msgError("退货单号不能为空");
return -1;
}else if (this_.returnsForm.orderDate == null) {
} else if (this_.returnsForm.orderDate == null) {
this.$modal.msgError("退货时间不能为空");
return -1;
}else if(this_.detailsList.length<=0) {
} else if (this_.detailsList.length <= 0) {
this.$modal.msgError("退货单不能为空");
return -1;
}
@ -577,21 +589,21 @@ export default {
if (this_.returnsId == null) {
//
this_.returnsForm.approvalStatus = 'await'
await addReturnsApi(this_.returnsForm).then(res=>{
await addReturnsApi(this_.returnsForm).then(res => {
this_.returnsId = res.data.id
this.queryParams.returnsId = res.data.id
}).catch(res=>{
}).catch(res => {
this.$modal.msgError("保存失败");
con = false
return;
})
}else {
} else {
//
this_.returnsForm.id = this_.returnsId
this.queryParams.returnsId = this_.returnsId
await editReturnsApi(this_.returnsForm).then(res=> {
}).catch(res=>{
await editReturnsApi(this_.returnsForm).then(res => {
}).catch(res => {
this.$modal.msgError("保存失败");
con = false
@ -600,16 +612,16 @@ export default {
}
//
if (con) {
this_.detailsList.forEach(data=>{
this_.detailsList.forEach(data => {
data.returnsId = this_.returnsId
})
await batchProcessingApi(this_.detailsList).then(res=>{
await batchProcessingApi(this_.detailsList).then(res => {
this.$modal.msgSuccess("保存成功");
if (flag != -1) {
this.goToAbout();
}
}).catch(res=>{
}).catch(res => {
this.$modal.msgError("保存失败");
})
}
@ -617,20 +629,20 @@ export default {
},
//
async audit(){
async audit() {
//
let number = await this.save(-1);
if (number != -1) {
//
let fil ={
let fil = {
id: this.returnsId
}
console.log(" id: this.ReturnsId",fil)
console.log(" id: this.ReturnsId", fil)
await auditReturnsApi(fil).then(res => {
if (res.data) {
this.state = 'ysh'
this.$modal.msgWarning("审核成功");
}else {
} else {
this.$modal.msgWarning("暂无审核权限");
}
this.goToAbout()
@ -641,14 +653,14 @@ export default {
//
storage() {
let this_ = this;
//
if (this_.returnsForm.orderNumber == null) {
//
if (this_.returnsForm.orderNumber == null) {
this.$modal.msgError("退货单号不能为空");
return -1;
}else if (this_.returnsForm.orderDate == null) {
} else if (this_.returnsForm.orderDate == null) {
this.$modal.msgError("退货时间不能为空");
return -1;
}else if(this_.detailsList.length<=0) {
} else if (this_.detailsList.length <= 0) {
this.$modal.msgError("退货单不能为空");
return -1;
}
@ -659,7 +671,7 @@ export default {
type: 'warning'
}).then(() => {
//
let fil ={
let fil = {
id: this.returnsId
}
storageReturnsApi(fil).then(res => {
@ -676,7 +688,7 @@ export default {
//
abolition(){
abolition() {
if (this.returnsId < 0) {
this.$modal.msgWarning("数据未保存,不可废弃");
return;
@ -686,7 +698,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let fil ={
let fil = {
id: this.returnsId
}
abolitionReturnsApi(fil).then(res => {
@ -706,19 +718,19 @@ export default {
})
},
//
//
async exportExcel() {
let fil ={
let fil = {
returnsId: this.returnsId
}
exportExcelApi(fil).then(res=>{
console.log("res",res)
exportExcelApi(fil).then(res => {
console.log("res", res)
// this.downloadFile(res);
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
const blob = new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
this.$download.saveAs(blob,this.returnsForm.orderNumber+'.xLsx')
this.$download.saveAs(blob, this.returnsForm.orderNumber + '.xLsx')
})
},
}
@ -726,19 +738,18 @@ export default {
</script>
<style scoped lang="scss">
.app-container{
.app-container {
width: 100%;
height: 100%;
background: #f6f8f9;
}
.box {
height: 100%;
height: 80%;
width: 212px;
margin-right: 10px;
background: #FFFFFF;
border-radius: 10px 10px 10px 10px;
border: 1px solid #EEEEEE;
border: 1px solid #FF9655;
border-radius: 10px;
display: flex;
flex-direction: column;

View File

@ -1,14 +1,14 @@
<template>
<div class="app-container">
<el-card >
<div class="card-change">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="" prop="orderNumber">
<el-input v-model="queryParams.orderNumber" placeholder="业务单号" />
<el-input v-model="queryParams.orderNumber" placeholder="请输入退货单号"/>
</el-form-item>
<el-form-item label="" v-model="queryParams.supplierId" prop="status">
<el-select
v-model="queryParams.supplierId"
placeholder="供应商"
placeholder="请选择供应商"
clearable
style="width: 230px"
>
@ -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="">
<el-select v-model="queryParams.approvalStatus" placeholder="请选择状态" style="">
<el-option
v-for="dict in dict.type.oilPurchasedStatus"
:key="dict.value"
@ -25,75 +25,102 @@
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="日期选择" prop="status">
<el-date-picker
v-model="queryParams.dateRange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item> -->
<el-form-item label="">
<el-date-picker
v-model="beginTime"
style="width: 160px"
type="date"
placeholder="开始日期">
</el-date-picker>
<el-date-picker
v-model="endTime"
style="width: 160px"
type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item style="float: right">
<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-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="detailsAdd"
v-hasPermi="['convenienceStore:returns:index']"
>新增退货订单</el-button>
</el-col>
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row>
>新增退货订单
</el-button>
</el-form-item>
</el-form>
<el-table ref="tables"
v-loading="loading"
:data="returnsList"
:default-sort="defaultSort">
<el-table-column label="业务单号" align="center" prop="orderNumber"/>
<el-table-column label="供应商" align="center" prop="supplierName"/>
<el-table-column label="退货数量" align="center" prop="returnQuantity"/>
<el-table-column label="单据金额" align="center" prop="totalAmount"/>
<div style="height: 71vh;overflow: auto">
<el-table ref="tables" border
v-loading="loading"
:data="returnsList"
:default-sort="defaultSort">
<el-table-column label="序号" align="center" type="index" width="60"/>
<el-table-column label="退货单号" align="center" prop="orderNumber"/>
<el-table-column label="供应商" align="center" prop="supplierName"/>
<el-table-column label="退货数量" align="center" prop="returnQuantity"/>
<el-table-column label="单据金额" align="center" prop="totalAmount"/>
<el-table-column label="状态" align="center" prop="status">
<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 == 'yzf'" type="danger" size="medium">已作废</el-tag>
<el-tag v-if ="scope.row.approvalStatus == 'ysh'" type="danger" size="medium">已审核</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="制单人" align="center" prop="createByName"/>
<el-table-column label="制单日期" align="center" prop="orderDate" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.orderDate) }}</span>
</template>
</el-table-column>
<el-table-column label="审核人" align="center" prop="approverName"/>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<div style="color: #FF9655" v-if="scope.row.approvalStatus == 'await'">待审核</div>
<div style="color: #0DC291" v-if="scope.row.approvalStatus == 'qrts'" >已审核入库</div>
<div style="color: #F44522" v-if="scope.row.approvalStatus == 'yzf'" >已作废</div>
<div style="color: #409EFF" v-if="scope.row.approvalStatus == 'ysh'" >已审核</div>
</div>
</template>
</el-table-column>
<el-table-column label="制单人" align="center" prop="createByName"/>
<el-table-column label="审核人" align="center" prop="approverName"/>
<el-table-column label="入库人" align="center" prop="storageName"/>
<el-table-column label="制单时间" align="center" prop="orderDate" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.orderDate) }}</span>
</template>
</el-table-column>
<el-table-column label="审核时间" align="center" prop="orderDate" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.examineTime) }}</span>
</template>
</el-table-column>
<el-table-column label="入库时间" align="center" prop="orderDate" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.storageTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="dispose(scope.row)"
>处理单据</el-button>
</template>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
v-if="scope.row.approvalStatus == 'await'"
@click="dispose(scope.row)"
>退货审核
</el-button>
<el-button
size="mini"
type="text"
v-else-if="scope.row.approvalStatus == 'ysh'"
@click="dispose(scope.row)"
>退货入库
</el-button>
<el-button
size="mini"
type="text"
v-else
@click="dispose(scope.row)"
>查看详情
</el-button>
</template>
</el-table-column>
</el-table>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
@ -102,7 +129,7 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
</div>
</div>
</template>
@ -118,11 +145,11 @@ export default {
data() {
return {
returnsList:[],
returnsList: [],
//
supplierList:[],
supplierList: [],
//
title:'',
title: '',
//
showSearch: true,
disableInput: false, //
@ -141,6 +168,8 @@ export default {
page: null,
pageSize: null,
},
beginTime: "",
endTime: "",
//
loading: false,
//
@ -156,16 +185,21 @@ export default {
methods: {
//
getList(){
getList() {
this.loading = true;
getReturnsPageApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
getReturnsPageApi(this.addDateRange(this.queryParams, dateRange)).then(response => {
this.returnsList = response.data.records;
this.total = response.data.total;
})
this.loading = false;
},
//
getQueryList(){
getQueryList() {
listSupplier().then(response => {
this.supplierList = response.data.records
})
@ -194,6 +228,8 @@ export default {
//
resetQuery() {
this.queryParams = {}
this.beginTime = ''
this.endTime = ''
this.handleQuery()
},
//
@ -215,7 +251,7 @@ export default {
</script>
<style scoped lang="scss">
.app-container{
.app-container {
width: 100%;
height: 100%;
background: #f6f8f9;

View File

@ -637,7 +637,7 @@
</el-dialog>
<!-- 批量录入会员信息-->
<el-dialog :title="title" width="500px" :visible.sync="openUpload" append-to-body>
<el-dialog :title="title" :close-on-click-modal="false" width="500px" :visible.sync="openUpload" append-to-body>
<el-form ref="form1" :model="form1" :rules="rules1" label-width="90px">
<el-row>
<el-col :span="24">

View File

@ -369,7 +369,7 @@
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="55%" append-to-body>
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="55%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<div class="flax_box">
<el-form-item label="分组名称" prop="groupName">
@ -509,7 +509,7 @@
</el-dialog>
<!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open1" width="35%" append-to-body>
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open1" width="35%" append-to-body>
<el-form ref="form1" :model="form1" :rules="rules" label-width="80px">
<el-form-item label="活动名称" prop="name">

View File

@ -1,14 +1,14 @@
<template>
<div class="app-container">
<div class="app-cont">
<!-- 搜索框-->
<el-card>
<div class="card_box">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="" prop="tankName">
<el-input
v-model="queryParams.tankName"
placeholder="请输入油罐名称"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@ -46,7 +46,7 @@
</el-form-item>
</el-form>
<div style="height: 76vh;overflow: auto">
<div style="height: 77vh;overflow: auto">
<el-table key="2" ref="tables"
v-loading="loading"
:data="statisticsList"
@ -61,12 +61,6 @@
<el-table-column label="当前成本价(元/L" align="center" prop="discountedPrice"/>
<el-table-column label="成本金额(元)" align="center" prop="totalPrice"/>
<el-table-column label="状态" align="center" prop="inventoryStatistics">
<!-- <template slot-scope="scope">-->
<!-- <div slot="reference" class="name-wrapper">-->
<!-- <el-tag v-if="scope.row.inventoryStatistics == '启用'" size="success">启用</el-tag>-->
<!-- <el-tag v-if="scope.row.inventoryStatistics == '禁用'" type="danger" size="medium">禁用</el-tag>-->
<!-- </div>-->
<!-- </template>-->
<template slot-scope="scope">
<el-switch
disabled
@ -105,7 +99,7 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
</div>
<el-drawer
@ -117,7 +111,7 @@
<div style="display: grid; place-items: center;">
<div class="box-card" style="">
<div style="display: flex; justify-content: space-between;margin-bottom: 10px">
<div style="display: flex; justify-content: space-between;margin-bottom: 10px;font-size: 14px;color: #808285">
<span>油罐名称{{ statisticsForm.tankName }}</span>
<span>油品油号{{ statisticsForm.oilNumber }}</span>
<span>库存数量L{{ statisticsForm.storedQuantity }}{{ statisticsForm.unit }}</span>
@ -287,11 +281,6 @@ export default {
handleClose(done) {
done();
// this.$confirm('')
// .then(_ => {
// done();
// })
// .catch(_ => {});
},
//
@ -314,9 +303,10 @@ export default {
</script>
<style scoped lang="scss">
.app-container {
.app-cont {
width: 100%;
height: 100vh;
box-sizing: border-box;
padding: 10px;
background: #f6f8f9;
}
@ -345,5 +335,10 @@ export default {
.el-form--inline .el-form-item {
margin-right: 44px;
}
.card_box{
border-radius: 8px;
background: #fff;
box-sizing: border-box;
padding: 15px;
}
</style>

View File

@ -20,6 +20,13 @@ export function getNumDayTime(dayNum) {
return formattedDate;
}
// 格式化日期为YYYY-MM-DD
export function formatDate(date) {
let year = date.getFullYear();
let month = String(date.getMonth() + 1).padStart(2, '0');
let day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
// 日期格式化
export function parseTime(time, pattern) {

View File

@ -51,6 +51,9 @@ export default {
},
methods: {
goback(){
this.$router.go(-1)
},
//
getMenuTreeselect() {
// merchantId deptType
@ -311,7 +314,11 @@ export default {
</script>
<template>
<div class="container">
<div>
<div class="top-box">
<span style="cursor: pointer; text-indent: 20px;" @click="goback()">当前位置机构管理 / 角色信息 / 新增角色</span>
</div>
<div class="container">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="110px">
<div class="top-box">
<!-- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">-->
@ -410,6 +417,8 @@ export default {
</div>
</el-form>
</div>
</div>
</template>
<style scoped lang="scss">
@ -420,15 +429,17 @@ export default {
background: #f4f5f9;
}
.top-box {
.top-box{
width: 100%;
background: #fff;
box-sizing: border-box;
padding: 20px;
display: flex;
align-items: center;
background: #FFFFFF;
box-shadow: 0px 3px 6px 1px rgba(255, 255, 255, 0.4), inset 0px 3px 6px 1px rgba(255, 255, 255, 0.5);
border-radius: 10px 10px 10px 10px;
font-weight: 400;
font-size: 14px;
color: #999;
padding-left: 25px;
}
.demo-ruleForm {

View File

@ -625,7 +625,24 @@
<!-- 添加或修改用户配置对话框 class="common-dialog" -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :close-on-click-modal="false" >
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="24">
<el-form-item label="所属机构" prop="deptId">
<el-select v-model="form.deptId" placeholder="请选择所属机构" style="width: 100%">
<el-option
v-for="item in deptListSelect"
:key="item.deptId"
:label="item.deptName"
:value="item.deptId"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="用户姓名" prop="realName">
@ -679,7 +696,7 @@
<el-row>
<el-col :span="24">
<el-form-item label="角色状态">
<el-form-item label="角色状态" prop="accountStatus">
<el-radio-group v-model="form.accountStatus" @change="$forceUpdate()">
<el-radio :key=1 :label=1 :value=1>启用</el-radio>
<el-radio :key=0 :label=0 :value=0>禁用</el-radio>
@ -689,9 +706,9 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<div slot="footer" class="dialog-footer" style="text-align: center;">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submitForm"> </el-button>
</div>
</el-dialog>
@ -997,7 +1014,10 @@ export default {
]
},
rules: {
leaderName: [
deptId: [
{ required: true, message: '所属机构不能为空', trigger: 'blur' },
],
realName: [
{ required: true, message: '姓名不能为空', trigger: 'blur' },
],
accountName: [
@ -1025,6 +1045,10 @@ export default {
roleIds: [
{ required: true, message: '请选择角色信息', trigger: 'blur' },
],
accountStatus: [
{ required: true, message: '请选择角色状态', trigger: 'blur' },
],
region: [
{ required: true, message: '请选择活动区域', trigger: 'change' }

View File

@ -80,37 +80,37 @@
<div class="k-box">
<div class="d-s" style="font-size: 12px;color: #999999;">
<div class="sian"></div>
<div>活跃油站数</div>
<div style="color: #000;margin-bottom: 6px;"> 活跃油站数</div>
</div>
<div class="num-size">{{ storeAmount.storeTotal || 0 }}</div>
</div>
<div class="k-box">
<div class="d-s" style="font-size: 12px;color: #999999;">
<div class="sian"></div>
<div>交易金额(万元)/交易笔数</div>
<div style="color: #000;margin-bottom: 6px;">交易金额(万元)/交易笔数</div>
</div>
<div class="num-size">{{ storeAmount.tradeAmount || 0 }}/{{ storeAmount.tradeTotal || 0 }}</div>
<div class="num-size">{{ storeAmount.tradeAmount || 0 }} / {{ storeAmount.tradeTotal || 0 }}</div>
</div>
<div class="k-box">
<div class="d-s" style="font-size: 12px;color: #999999;">
<div class="sian"></div>
<div>退款金额()/退款笔数</div>
<div style="color: #000;margin-bottom: 6px;">退款金额()/退款笔数</div>
</div>
<div class="num-size">{{ storeAmount.refundAmount || 0 }}/{{ storeAmount.refundTotal || 0 }}</div>
<div class="num-size">{{ storeAmount.refundAmount || 0 }} / {{ storeAmount.refundTotal || 0 }}</div>
</div>
<div class="k-box">
<div class="d-s" style="font-size: 12px;color: #999999;">
<div class="sian"></div>
<div>笔均单价()</div>
<div style="color: #000;margin-bottom: 6px;">笔均单价()</div>
</div>
<div class="num-size">{{ storeAmount.averagePrice || 0 }}</div>
</div>
<div class="k-box">
<div class="d-s" style="font-size: 12px;color: #999999;">
<div class="sian"></div>
<div>日均交易额(万元)/日均交易笔数</div>
<div style="color: #000;margin-bottom: 6px;">日均交易额(万元)/日均交易笔数</div>
</div>
<div class="num-size">{{ storeAmount.dayTradeAmount || 0 }}/{{ storeAmount.dayTradeTotal || 0 }}</div>
<div class="num-size">{{ storeAmount.dayTradeAmount || 0 }} / {{ storeAmount.dayTradeTotal || 0 }}</div>
</div>
</div>
<div class="hui-hang"></div>
@ -182,7 +182,7 @@
import echarts from "echarts";
import {getStoreAmountByTime, storeAmountIndex1, storeTotalIndex} from "@/api/indexBanner";
import {selectChildByDeptId} from "@/api/system/Site/site";
import {parseTime} from "@/utils/fuint";
import {parseTime,formatDate} from "@/utils/fuint";
import {getBannerListApi} from "@/api/sys/banner";
import {getListApi} from "@/api/setting/hardware";
import {getNotificationlogList} from "@/api/sys/sysNotificationlog";
@ -236,7 +236,7 @@ export default {
created() {
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
this.value1 = [parseTime(oneWeekAgo),parseTime(nowDate)]
this.value1 = [formatDate(oneWeekAgo),formatDate(nowDate)]
this.getStoreTotal()
this.selectChildByDeptIdApi()
// this.getStoreAmount()
@ -284,7 +284,7 @@ export default {
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
this.value2 = [start,new Date()];
this.value2 = [parseTime(start),parseTime(new Date())];
} else if (this.timeList[index]=='近一周'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)

View File

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<div class="card-change" >
<div class="card-change" style="min-height: 500px; margin-left: 20px; margin-top: 20px; margin-right: 20px;" shadow="never">
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="90px">
<el-form-item label="" prop="name">
<el-input
@ -374,5 +374,10 @@ export default {
width: 98px;
height: 98px;
}
</style>

View File

@ -98,12 +98,12 @@
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="32%" append-to-body>
<el-form :model="form" ref="form" :rules="rules" label-width="120px">
<!-- 通知名称 -->
<el-form-item label="通知名称" prop="notificationName">
<el-form-item label="通知名称" prop="notificationName" style="margin-left: -30px;">
<el-input v-model="form.notificationName" placeholder="请输入通知名称" style="width: 100%" ></el-input>
</el-form-item>
<!-- 通知类型 -->
<el-form-item label="通知类型" prop="notificationType">
<el-form-item label="通知类型" prop="notificationType" style="margin-left: -30px;">
<el-select v-model="form.notificationType" placeholder="请选择通知类型" style="width: 100%">
<el-option label="到期提醒" value="到期提醒"></el-option>
<el-option label="系统升级" value="系统升级"></el-option>
@ -112,7 +112,7 @@
</el-form-item>
<!-- 通知模板 -->
<el-form-item label="通知模板" prop="templateContent">
<el-form-item label="通知模板" prop="templateContent" style="margin-left: -30px;">
<el-input type="textarea" v-model="form.templateContent" :rows="3" placeholder="请输入通知内容" :maxlength="200" show-word-limit
style="width: 100%"></el-input>
<div>
@ -124,19 +124,19 @@
</el-form-item>
<!-- 接收角色 -->
<el-form-item label="接收角色" prop="recipientRoles">
<el-form-item label="接收角色" prop="recipientRoles" style="margin-left: -30px;">
<el-select v-model="form.recipientRoles" multiple placeholder="请选择角色" style="width: 100%">
<el-option v-for="item in dutyList1" :label="item.dutyName" :value="item.dutyId" ></el-option>
</el-select>
</el-form-item>
<!-- 模板状态 -->
<el-form-item label="模板状态" prop="templateStatus">
<el-form-item label="模板状态" prop="templateStatus" style="margin-left: -30px;">
<el-switch v-model="form.templateStatus" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
</el-form-item>
<!-- 发送条件 -->
<el-form-item label="发送条件" style="margin-bottom: 10px" prop="conditions">
<el-form-item label="发送条件" style="margin-bottom: 10px; margin-left: -30px;" prop="conditions">
<div v-for="(condition, index) in form.conditions" :key="index" class="condition-group" style="margin-bottom: 10px">
<el-select v-model="condition.field" placeholder="请选择条件" style="width: 45%;margin-right: 10px" @change="changeField(index)">
<el-option label="系统到期日期" value="系统到期日期"></el-option>
@ -165,8 +165,8 @@
<!-- </el-form-item>-->
</el-form>
<div style="display: flex; justify-content: center; align-items: center;margin-top: 30px">
<el-button type="primary" @click="handleSubmit('form')">保存</el-button>
<el-button @click="handleReset">取消</el-button>
<el-button @click="handleReset"> </el-button>
<el-button style="margin-left: 30px;" type="primary" @click="handleSubmit('form')"> </el-button>
</div>
</el-dialog>

View File

@ -61,6 +61,16 @@ public class MtInventory extends BaseEntity {
* 店铺ID
*/
private Integer storeId;
/**
* 审核时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date examineTime;
/**
* 入库时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date storageTime;
}

View File

@ -37,6 +37,10 @@ public class MtReturns extends BaseEntity {
* 审核人
*/
private String approver;
/**
* 入库人
*/
private String storage;
/**
* 总金额
*/
@ -53,7 +57,16 @@ public class MtReturns extends BaseEntity {
* 店铺ID
*/
private Integer storeId;
/**
* 审核时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date examineTime;
/**
* 入库时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
private Date storageTime;
}

View File

@ -141,6 +141,8 @@
mp.store_id AS storeId,
mp.create_time AS createTime,
mp.update_time AS updateTime,
mp.examine_time AS examineTime,
mp.storage_time AS storageTime,
mp.create_by createBy,
ms1.real_name createByName,
ms2.real_name approverName,

View File

@ -129,8 +129,11 @@
mp.return_quantity returnQuantity,
mp.approval_status approvalStatus,
mp.order_date orderDate,
mp.examine_time examineTime,
mp.storage_time storageTime,
ms1.real_name createByName,
ms2.real_name approverName,
ms3.real_name storageName,
mp.create_time createTime
FROM
mt_returns mp
@ -138,6 +141,7 @@
left join mt_goods mg ON mg.id = mpd.goods_id
LEFT JOIN mt_staff ms1 ON mp.create_by = ms1.id
LEFT JOIN mt_staff ms2 ON mp.approver = ms2.id
LEFT JOIN mt_staff ms3 ON mp.storage = ms3.id
<where>
mp.store_id = #{mtReturns.storeId}
@ -150,6 +154,12 @@
<if test="mtReturns.supplierId != null">
and mg.supplier_id = #{mtReturns.supplierId}
</if>
<if test="mtReturns.params.beginTime != null and mtReturns.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(mp.order_date,'%y%m%d') &gt;= date_format(#{mtReturns.params.beginTime},'%y%m%d')
</if>
<if test="mtReturns.params.endTime != null and mtPurchase.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(mp.order_date,'%y%m%d') &lt;= date_format(#{mtReturns.params.endTime},'%y%m%d')
</if>
</where>
GROUP BY
mp.id
@ -208,6 +218,9 @@
<if test="approver != null and approver != ''">
approver = #{approver},
</if>
<if test="storage != null and storage != ''">
storage = #{storage},
</if>
<if test="totalAmount != null">
total_amount = #{totalAmount},
</if>
@ -220,6 +233,12 @@
<if test="storeId != null">
store_id = #{storeId},
</if>
<if test="examineTime != null">
examine_time = #{examineTime},
</if>
<if test="storageTime != null">
storage_time = #{storageTime},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>

View File

@ -24,6 +24,7 @@ import org.springframework.data.domain.PageRequest;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
@ -93,6 +94,9 @@ public class MtInventoryServiceImpl implements MtInventoryService {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
mtInventory.setCreateBy(nowAccountInfo.getStaffId().toString());
mtInventory.setStoreId(nowAccountInfo.getStoreId());
if (ObjectUtil.isEmpty(mtInventory.getOrderDate())){
mtInventory.setOrderDate(new Date());
}
this.mtInventoryDao.insert(mtInventory);
return mtInventory;
}
@ -205,6 +209,7 @@ public class MtInventoryServiceImpl implements MtInventoryService {
MtInventory mtReturns = new MtInventory();
mtReturns.setApprover(nowAccountInfo.getStaffId().toString());
mtReturns.setExamineTime(new Date());
mtReturns.setId(id);
int update = mtInventoryDao.update(mtReturns);
return update>0;
@ -216,6 +221,7 @@ public class MtInventoryServiceImpl implements MtInventoryService {
MtInventory mtReturns = new MtInventory();
mtReturns.setConfirmer(nowAccountInfo.getStaffId().toString());
mtReturns.setStorageTime(new Date());
mtReturns.setId(id);
int update = mtInventoryDao.update(mtReturns);
return update>0;

View File

@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
/**
@ -201,7 +202,7 @@ public class MtReturnsServiceImpl implements MtReturnsService {
}
String status = "qrts";
boolean edit = edit(id);
boolean edit = edit1(id);
int i = mtReturnsDao.editStateById(id, status);
return true;
}
@ -215,6 +216,18 @@ public class MtReturnsServiceImpl implements MtReturnsService {
MtReturns mtReturns = new MtReturns();
mtReturns.setApprover(nowAccountInfo.getStaffId().toString());
mtReturns.setExamineTime(new Date());
mtReturns.setId(id);
int update = mtReturnsDao.update(mtReturns);
return update>0;
}
// 修改入库人
public boolean edit1(Integer id){
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
MtReturns mtReturns = new MtReturns();
mtReturns.setStorage(nowAccountInfo.getStaffId().toString());
mtReturns.setStorageTime(new Date());
mtReturns.setId(id);
int update = mtReturnsDao.update(mtReturns);
return update>0;

View File

@ -7,6 +7,7 @@ import lombok.Data;
public class MtReturnsVO extends MtReturns {
private String createByName;
private String approverName;
private String storageName;
private String supplierName;
private Integer detailsId;
private Integer supplierId;

View File

@ -432,7 +432,8 @@ public class FleetInfoServiceImpl extends ServiceImpl<FleetInfoMapper, FleetInfo
//查找车队成员
FleetMember fleetMember = fleetMemberMapper.selectOne(new LambdaQueryWrapper<FleetMember>()
.eq(FleetMember::getUserId, allOrderInfo.getUserId())
.orderBy(true, true, FleetMember::getCreateTime)
.eq(FleetMember::getIfLogOff,"0")
.orderByDesc(true, FleetMember::getCreateTime)
.last("limit 1"));
// 获取当前车队卡
FleetInfo fleetInfo = baseMapper.selectOne(new LambdaQueryWrapper<FleetInfo>()

View File

@ -87,7 +87,7 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
FleetMember fleetMember1 = baseMapper.selectOne(new LambdaQueryWrapper<FleetMember>()
.eq(FleetMember::getFleetId, fleetMember.getFleetId())
.eq(FleetMember::getUserId, nowAccountInfo.getId()));
.eq(FleetMember::getUserId, nowAccountInfo.getId()));
if (ObjectUtil.isEmpty(fleetMember1)) {
throw new RuntimeException("未绑定该车队,无法查看当前车队成员信息");
}
@ -132,6 +132,7 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
//判断用户是否加入车队
FleetMember fleetMember2 = baseMapper.selectOne(new LambdaQueryWrapper<FleetMember>()
.eq(FleetMember::getMobile, fleetMember.getMobile())
.eq(FleetMember::getIfLogOff, "0")
.last("limit 1"));
if (ObjectUtil.isNotEmpty(fleetMember2)) {
throw new RuntimeException("该用户已绑定车队");
@ -144,7 +145,7 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
MtUser mtUser = mtUserMapper.selectOne(new LambdaQueryWrapper<MtUser>()
.eq(MtUser::getMobile, fleetMember.getMobile())
.last("limit 1"));
if (ObjectUtil.isEmpty(mtUser)){
if (ObjectUtil.isEmpty(mtUser)) {
throw new RuntimeException("该手机号在会员列表中不存在");
}
if (ObjectUtil.isEmpty(mtUser)) {
@ -207,6 +208,13 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
createVaseInfo(mtUser, nowAccountInfo.getStoreId().toString(), null, null);
}
// 如果不限额的话将成员的余额信息改为车队的余额信息
FleetInfo fleetInfo = fleetInfoService.queryById(fleetMember.getFleetId());
if (fleetMember.getSecondaryCardType() == 1) {
fleetMember.setSecondaryCardLimit(fleetInfo.getTotalBalance());
fleetMember.setRemainingCreditLimit(fleetInfo.getTotalBalance() - fleetMember.getUsedCreditLimit());
}
fleetMember.setUserId(mtUser.getId());
fleetMember.setCarNum(mtUser.getCarNo());
fleetMember.setStoreId(nowAccountInfo.getStoreId());
@ -253,14 +261,14 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
MtUser mtUser = mtUserMapper.selectOne(new LambdaQueryWrapper<MtUser>()
.eq(MtUser::getMobile, fleetMember.getMobile())
.last("limit 1"));
if (ObjectUtil.isEmpty(mtUser)){
if (ObjectUtil.isEmpty(mtUser)) {
throw new RuntimeException("该手机号在会员列表中不存在");
}
// 如果不限额的话将成员的余额信息改为车队的余额信息
FleetInfo fleetInfo = fleetInfoService.queryById(fleetMember.getFleetId());
if (fleetMember.getSecondaryCardType()==1){
if (fleetMember.getSecondaryCardType() == 1) {
fleetMember.setSecondaryCardLimit(fleetInfo.getTotalBalance());
fleetMember.setRemainingCreditLimit(fleetInfo.getTotalBalance()-fleetMember.getUsedCreditLimit());
fleetMember.setRemainingCreditLimit(fleetInfo.getTotalBalance() - fleetMember.getUsedCreditLimit());
}
return baseMapper.updateById(fleetMember);
}
@ -403,7 +411,8 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper, Fleet
public FleetMember selectByUserId(Integer userId) {
return baseMapper.selectOne(new LambdaQueryWrapper<FleetMember>()
.eq(FleetMember::getUserId, userId)
.orderBy(true, true, FleetMember::getCreateTime)
.eq(FleetMember::getIfLogOff, "0")
.orderByDesc(true,FleetMember::getCreateTime)
.last("limit 1"));
}

View File

@ -561,7 +561,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
HashMap<String, Object> m1 = new HashMap<>();
// 根据油号 店铺id 用户id 锁定唯一囤油卡
m1.put("mt_user_id",ljUserVo.getId());
m1.put("store_id",ljUserVo.getStoreId());
m1.put("store_id",fuelDiesel.getStoreId());
m1.put("oil_name",fuelDiesel.getOilNumberId());
List<MtUserFuel> userFuels = mtUserFuelMapper.selectByMap(m1);
// 没有油卡则新建 有则追加囤油升数

View File

@ -568,11 +568,8 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
map.putAll(getMerchantConfig(allOrder));
Map<String, String> refund = fyPayService.refund(map);
} else {
throw new RuntimeException("其它类型支付正在维护中!");
}
allOrder.setRefMoney(allOrder.getGoodsMoney());
allOrder.setRefBy(String.valueOf(now.getId()));
allOrder.setStatus("refund");
@ -583,10 +580,29 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
cashierOrderService.updateById(cashierOrder);
// 2.根据 用户优惠券id 把优惠券还原状态
String cardCouponUserId = map.get("cardCouponUserId");
if (ObjectUtil.isNotEmpty(cardCouponUserId)) {
CardCouponUser cardCouponUser = cardCouponUserMapper.selectById(cardCouponUserId);
cardCouponUser.setStatus("0");
cardCouponUserMapper.updateById(cardCouponUser);
}
// 4.如果是 囤油卡 车队卡 储值卡 则按照 减少记录 还原
if (orderNo.equals("fule_card")) {
// 4.如果是 囤油卡 车队卡 储值卡 则进行另外处理
}
if (orderNo.equals("car_card_value")) {
}
if (orderNo.equals("card_value")) {
}
// 5.如果是 小程序码付款 则按照 油品表的 囤油卡金额 储值卡金额 还原
if (orderNo.equals("APPLET_CODE")) {
}
// 6. 如果是现金无需任何特殊操作
return 1;
}
@ -1574,7 +1590,7 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper, All
}
Double averagePrice = tradeAmount / tradeTotal;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
Double dayTradeAmount = 0.0;
Integer dayTradeTotal = 0;

View File

@ -518,13 +518,13 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 查看车队卡余额是否足够付款
FleetMember fleetMember = null;
if (payType.equals("car_card_value")){
if (payType.equals("car_card_value")) {
if (ObjectUtil.isEmpty(userId)) {
orders.put("error", "请先选择会员信息");
return orders;
}
fleetMember = fleetMemberService.selectByUserId(userId);
if (fleetMember.getRemainingCreditLimit()<oilActualPay){
if (fleetMember.getRemainingCreditLimit() < oilActualPay) {
orders.put("error", "余额不足,请分开支付");
return orders;
}
@ -651,13 +651,20 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (ObjectUtil.isNotEmpty(jsonObject.get("activeType"))) {
order.setActiveType(jsonObject.get("activeType").toString());
}
if (payType.equals("CASH") || payType.equals("after_pay") || payType.equals("card_value") || payType.equals("car_card_value")) {
if (payType.equals("CASH") || payType.equals("after_pay") || payType.equals("card_value") || payType.equals("car_card_value") || payType.equals("fule_card")) {
order.setPayTime(new Date());
order.setOrderStatus("paid");
if (ObjectUtil.isNotEmpty(userId)) this.insertCardBalance(consumeAmount, userId, storeId, orderNo);
this.addOilTracks(order, storeId);
if (ObjectUtil.isNotEmpty(userId)) {
this.updateGrowthValue(oilAmount, oilActualPay, userId, Integer.valueOf(jsonObject.get("oils").toString()), storeId, orderNo);
if (payType.equals("card_value")) {
// 修改用户储值卡余额
this.insertCardBalance(consumeAmount, userId, storeId, orderNo);
}
if (payType.equals("fule_card")) {
// 修改用户囤油卡余额
userFuelService.changeBalance(userId, Integer.valueOf(jsonObject.get("oils").toString()), storeId, nowAccountInfo.getChainStoreId(), Double.valueOf(oilCardAmount), orderNo);
}
}
}
if (map.get("allAmount").equals("0")) {
@ -727,10 +734,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
} else {
Double payAmount = map.get("payType").equals("CASH") ? Double.valueOf(map.get("authCode")) : Double.valueOf(map.get("allAmount"));
this.insertAllOrderInfo(orderNo, storeId, oilAmount + goodsAmount, payAmount, oilDiscount, payType, userId, "PC", "6", "paid",seekZero);
this.insertAllOrderInfo(orderNo, storeId, oilAmount + goodsAmount, payAmount, oilDiscount, payType, userId, "PC", "6", "paid", seekZero);
// 添加车队卡订单信息
if (payType.equals("car_card_value") && ObjectUtil.isNotEmpty(fleetMember)) this.addFleetOrder(orderNo,fleetMember);
if (payType.equals("car_card_value") && ObjectUtil.isNotEmpty(fleetMember))
this.addFleetOrder(orderNo, fleetMember);
// 计算提成
if (ObjectUtil.isNotEmpty(staffId))
@ -760,23 +768,24 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrderService.insertCashierOrder(cashierOrder);
// 下单完成需要更新一下优惠券的状态 当订单退款以后也要调用这样的代码修改优惠券的状态
if(StringUtils.isNotEmpty(map.get("couponId"))){
CardCouponUser cardCouponUser = cardCouponUserMapper.selectById(map.get("couponId"));
cardCouponUser.setStatus("1");
// 查询订单号并赋值
AllOrderInfoVo allOrderInfoVo = allOrderInfoMapper.selectByOrderNo(orderNo);
cardCouponUser.setOrderId(allOrderInfoVo.getId());
cardCouponUserMapper.updateById(cardCouponUser);
if (StringUtils.isNotEmpty(map.get("couponId"))) {
CardCouponUser cardCouponUser = cardCouponUserMapper.selectById(map.get("couponId"));
cardCouponUser.setStatus("1");
// 查询订单号并赋值
AllOrderInfoVo allOrderInfoVo = allOrderInfoMapper.selectByOrderNo(orderNo);
cardCouponUser.setOrderId(allOrderInfoVo.getId());
cardCouponUserMapper.updateById(cardCouponUser);
}
return orders;
}
/**
* 添加车队卡订单信息
* @param orderNo 订单号
*
* @param orderNo 订单号
* @param fleetMember 车队成员信息
*/
private void addFleetOrder(String orderNo,FleetMember fleetMember) {
private void addFleetOrder(String orderNo, FleetMember fleetMember) {
AllOrderInfoUniVo allOrderInfoUniVo = allOrderInfoService.queryByOrderNo(orderNo);
FleetConsumeRecord fleetConsumeRecord = new FleetConsumeRecord();
fleetConsumeRecord.setOrderNo(orderNo);
@ -793,7 +802,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
fleetConsumeRecord.setChangeType("0");
fleetConsumeRecord.setFromType("油品");
fleetConsumeRecordService.insert(fleetConsumeRecord);
fleetInfoService.payFleet(allOrderInfoUniVo.getId().toString(),allOrderInfoUniVo.getPayMoney());
fleetInfoService.payFleet(allOrderInfoUniVo.getId().toString(), allOrderInfoUniVo.getPayMoney());
}
// 添加优惠记录
@ -1123,7 +1132,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setSeekZero(BigDecimal.valueOf(0.0));
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", status,0.0);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", status, 0.0);
if (ObjectUtil.isNotEmpty(map.get("staffId")))
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")), storeId, oilAmount, oilAmount, "1", orderNo);
res.put("success", "success");
@ -1194,7 +1203,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
this.updateGrowthValue1(oilAmount, oilAmount, userId, Integer.valueOf(oilOrder.getOils()), 0.0, storeId, orderNo);
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", "paid",0.0);
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", "paid", 0.0);
if (ObjectUtil.isNotEmpty(map.get("staffId")))
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")), storeId, oilAmount, oilAmount, "1", orderNo);
res.put("success", "success");
@ -1253,7 +1262,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
res.put("error", "余额不足,请分开支付");
return res;
}
if (fuelAmount < oilCardAmount && cardBalance >= oilActualPay){
if (fuelAmount < oilCardAmount && cardBalance >= oilActualPay) {
if (!flag) {
res.put("error", "此油品不支持储值卡支付");
return res;
@ -1309,7 +1318,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setSeekZero(BigDecimal.valueOf(0.0));
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", "paid",0.0);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", "paid", 0.0);
staffCommissionService.countStaffCommission(accountInfo.getStaffId(), storeId, oilAmount, oilAmount, "1", orderNo);
res.put("success", "success");
@ -1377,7 +1386,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
baseMapper.insert(oilOrders);
this.updateGrowthValue1(oilAmount, 0.0, userId, Integer.valueOf(oilOrders.getOils()), 0.0, storeId, orderNo);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, oilAmount - lockupAmount, oilOrders.getPayType(), userId, "POS", "1", status,0.0);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, oilAmount - lockupAmount, oilOrders.getPayType(), userId, "POS", "1", status, 0.0);
staffCommissionService.countStaffCommission(accountInfo.getStaffId(), storeId, oilAmount, oilAmount, "1", orderNo);
res.put("success", "success");
} else {
@ -1385,7 +1394,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
oilOrders.setOrderStatus(status);
baseMapper.insert(oilOrders);
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, oilOrders.getPayType(), userId, "POS", "1", "payFail",0.0);
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, oilOrders.getPayType(), userId, "POS", "1", "payFail", 0.0);
res.put("error", "储值卡余额不足!");
}
@ -1401,13 +1410,13 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
OilOrder oilOrder = this.selectOilOrderByOrderNo(orderNo);
this.updateGrowthValue1(oilAmount, oilAmount, userId, Integer.valueOf(oilOrder.getOils()), 0.0, storeId, orderNo);
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, oilOrders.getPayType(), userId, "POS", "1", "paid",0.0);
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, oilOrders.getPayType(), userId, "POS", "1", "paid", 0.0);
staffCommissionService.countStaffCommission(accountInfo.getStaffId(), storeId, oilAmount, oilAmount, "1", orderNo);
res.put("success", "success");
} else {
oilOrders.setOrderStatus("payFail");
baseMapper.insert(oilOrders);
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, oilOrders.getPayType(), userId, "POS", "1", "payFail",0.0);
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, oilOrders.getPayType(), userId, "POS", "1", "payFail", 0.0);
res.put("error", "储值卡余额不足!");
}
}
@ -1419,7 +1428,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
/**
* 添加所有订单信息
*/
private void insertAllOrderInfo(String orderNo, Integer storeId, Double goodsMoney, Double payAmount, Double discountAmount, String payType, Integer userId, String payChannel, String type, String status,Double seekZero) {
private void insertAllOrderInfo(String orderNo, Integer storeId, Double goodsMoney, Double payAmount, Double discountAmount, String payType, Integer userId, String payChannel, String type, String status, Double seekZero) {
AllOrderInfo allOrderInfo = new AllOrderInfo();
allOrderInfo.setOrderNo(orderNo);
allOrderInfo.setType(type);
@ -1551,6 +1560,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
OilOrder oilOrder = this.selectOilOrderByOrderNo(orderNo);
// 获取油品信息
OilNumber oilNumber = oilNumberService.selectOilNumberByOilName(oilOrder.getOils(), oilOrder.getStoreId());
// 获取店铺信息
LJStore ljStore = storeService.selectStoreByStoreId(oilOrder.getStoreId());
if (ObjectUtils.isNotEmpty(cardFavorableId)) {
Integer userId = nowAccountInfo.getId();
@ -1578,7 +1589,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
userId = userVo.getId();
if (!isUseChild.equals("yes")) {
applet.put("error", "不可使用子卡消费!");
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail",0.0);
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail", 0.0);
result = true;
}
}
@ -1589,7 +1600,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (balanceAmount.equals("0") && map.get("payAmount").equals("0")) {
if (Double.compare(oilCardLiters, oilOrder.getOilNum()) != 0) {
applet.put("error", "囤油卡消费升数不对!");
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail",0.0);
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail", 0.0);
result = true;
}
} else {
@ -1597,7 +1608,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Double residueAmount = useLiters * oilNumber.getOilPrice();
if ((Double.valueOf(map.get("payAmount")) + Double.valueOf(balanceAmount) - residueAmount) >= 0.05) {
applet.put("error", "消费总金额不对!");
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail",0.0);
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail", 0.0);
result = true;
}
}
@ -1607,7 +1618,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Double realAmount = Double.valueOf(map.get("payAmount")) + Double.valueOf(balanceAmount) + Double.valueOf(map.get("discountAmount"));
if (-0.03 >= (realAmount - oilOrder.getOrderAmount()) && (realAmount - oilOrder.getOrderAmount()) >= 0.03) {
applet.put("error", "消费总金额不对!");
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail",0.0);
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail", 0.0);
result = true;
}
}
@ -1658,8 +1669,15 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
this.updateGrowthValue(oilOrder.getOrderAmount(), payAmount, userId, Integer.valueOf(oilOrder.getOils()), oilOrder.getStoreId(), orderNo);
this.addOilTracks(oilOrder, oilOrder.getStoreId());
this.insertCardOrder(oilOrder.getUserId(), oilOrder.getStoreId(), orderNo, oilOrder.getOrderAmount(), "paid", Double.valueOf(balanceAmount), payAmount);
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), payAmount, Double.valueOf(discountAmount), oilOrder.getPayType(), oilOrder.getUserId(), "applet", "1", "paid",0.0);
this.insertCardBalance(Double.valueOf(balanceAmount), userId, oilOrder.getStoreId(), orderNo);
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), payAmount, Double.valueOf(discountAmount), oilOrder.getPayType(), oilOrder.getUserId(), "applet", "1", "paid", 0.0);
if (oilOrder.getPayType().equals("card_value")) {
this.insertCardBalance(Double.valueOf(balanceAmount), userId, oilOrder.getStoreId(), orderNo);
}
if (oilOrder.getPayType().equals("fule_card")) {
// 修改用户囤油卡余额
userFuelService.changeBalance(userId, Integer.valueOf(oilOrder.getOils()), oilOrder.getStoreId(), ljStore.getChainStoreId(), Double.valueOf(oilCardAmount), orderNo);
}
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId()))
staffCommissionService.countStaffCommission(oilOrder.getStaffId(), oilOrder.getStoreId(), oilOrder.getOrderAmount(), oilOrder.getOrderAmount(), "1", orderNo);
oilOrder.setPayAmount(payAmount);
@ -1796,8 +1814,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
this.updateGrowthValue(oilOrder.getOrderAmount(), oilOrder.getPayAmount(), userId, Integer.valueOf(oilOrder.getOils()), oilOrder.getStoreId(), orderNo);
this.addOilTracks(oilOrder, oilOrder.getStoreId());
this.updateCardAndActiveById(oilOrder.getStoreId(), oilOrder.getUserId(), oilOrder.getId());
if (ObjectUtil.isNotEmpty(userId))
this.insertCardBalance(oilOrder.getOrderAmount() - oilOrder.getDiscountAmount() - oilOrder.getPayAmount(), userId, oilOrder.getStoreId(), orderNo);
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId())) {
staffCommissionService.countStaffCommission(oilOrder.getStaffId(), oilOrder.getStoreId(), oilOrder.getOrderAmount(), oilOrder.getPayAmount(), "1", orderNo);
}
@ -1891,6 +1907,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (oilName.getOilType().equals("天然气")) {
userBalanceService.growthValue(userid, store.getChainStoreId(), storeId, "3", oilAmount, "油品订单消费", orderNo);
}
}
}
@ -2259,7 +2276,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
staffCommissionService.countStaffCommission(nowAccountInfo.getStaffId(), nowAccountInfo.getStoreId(), oilOrderVo.getOrderAmount(), oilOrderVo.getPayAmount(), "1", orderNo);
this.addOilTracks(oilOrderVo, nowAccountInfo.getStoreId());
this.updateCardAndActiveById(nowAccountInfo.getStoreId(), oilOrderVo.getUserId(), oilOrderVo.getId());
this.insertAllOrderInfo(orderNo, nowAccountInfo.getStoreId(), oilOrderVo.getOrderAmount(), oilOrderVo.getPayAmount(), oilOrderVo.getDiscountAmount(), oilOrderVo.getPayType(), oilOrderVo.getUserId(), "POS", "1", "paid",0.0);
this.insertAllOrderInfo(orderNo, nowAccountInfo.getStoreId(), oilOrderVo.getOrderAmount(), oilOrderVo.getPayAmount(), oilOrderVo.getDiscountAmount(), oilOrderVo.getPayType(), oilOrderVo.getUserId(), "POS", "1", "paid", 0.0);
this.insertFavorable(oilOrderVo, oilOrderVo.getOilCardAmount1());
if (ObjectUtil.isNotEmpty(oilOrderVo.getUserId())) integralSettingsService.refuelPoints(oilOrderVo);
//修改优惠券使用状态

View File

@ -19,4 +19,13 @@ public interface IMtUserFuelService extends IService<MtUserFuel> {
* @return
*/
Double selectByUserIdAndOilId(Integer userId, Integer oilId, Integer storeId);
/**
* 根据用户id和油号id修改油量信息并添加消耗记录囤油卡支付
* @param userId
* @param oilId
* @param storeId
* @param balance
*/
void changeBalance(Integer userId, Integer oilId, Integer storeId, Integer chainStoreId, Double balance,String orderNo);
}

View File

@ -2,10 +2,15 @@ package com.fuint.business.userManager.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelChange;
import com.fuint.business.marketingActivity.cardFule.service.CardFuelChangeService;
import com.fuint.business.petrolStationManagement.entity.OilName;
import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.userManager.entity.MtUserFuel;
import com.fuint.business.userManager.mapper.MtUserFuelMapper;
import com.fuint.business.userManager.service.IMtUserFuelService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
@ -18,6 +23,10 @@ import org.springframework.stereotype.Service;
*/
@Service
public class MtUserFuelServiceImpl extends ServiceImpl<MtUserFuelMapper, MtUserFuel> implements IMtUserFuelService {
@Autowired
private CardFuelChangeService cardFuelChangeService;
@Autowired
private OilNameService oilNameService;
@Override
public Double selectByUserIdAndOilId(Integer userId, Integer oilId, Integer storeId) {
@ -30,4 +39,29 @@ public class MtUserFuelServiceImpl extends ServiceImpl<MtUserFuelMapper, MtUserF
if (ObjectUtil.isNotEmpty(mtUserFuel) && ObjectUtil.isNotEmpty(mtUserFuel.getFuelAmount())) fuelAmount = mtUserFuel.getFuelAmount();
return fuelAmount;
}
@Override
public void changeBalance(Integer userId, Integer oilId, Integer storeId, Integer chainStoreId, Double balance,String orderNo) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("mt_user_id", userId);
queryWrapper.eq("oil_name", oilId);
queryWrapper.eq("store_id", storeId);
MtUserFuel mtUserFuel = baseMapper.selectOne(queryWrapper);
Double fuelAmount = mtUserFuel.getFuelAmount();
mtUserFuel.setFuelAmount(fuelAmount - balance);
baseMapper.updateById(mtUserFuel);
OilName oilName = oilNameService.selectOilNameById(oilId);
CardFuelChange cardFuelChange = new CardFuelChange();
cardFuelChange.setUserId(userId);
cardFuelChange.setChainStoreId(chainStoreId);
cardFuelChange.setStoreId(storeId);
cardFuelChange.setChangeType("0");
cardFuelChange.setFromType("油卡消费");
cardFuelChange.setBalance(balance);
cardFuelChange.setOilType(String.valueOf(oilId));
cardFuelChange.setType(oilName.getOilType() + " " + oilName.getOilName());
cardFuelChange.setOrderNo(orderNo);
cardFuelChange.setAfterTheChange(mtUserFuel.getFuelAmount());
cardFuelChangeService.insert(cardFuelChange);
}
}

View File

@ -698,11 +698,7 @@ export default {
flag: 1,
jishuqi: 0,
continuePolling: true, //
sendCouponList: [],
oilOrder: {
orderNo: null,
payUser: null
},
sendCouponList: []
}
},
watch: {
@ -1057,8 +1053,6 @@ export default {
await getCheckTheStatusOfYourPaymentApi(id).then(async response => {
if (response.data != null) {
const payStatus = response.data.payStatus
this.oilOrder.orderNo=response.data.paymentNo
this.oilOrder.payUser=response.data.mobile
if (payStatus === "unpaid") {
this_.isQuery = true;
} else if (payStatus === "paid") {
@ -1192,6 +1186,7 @@ export default {
let payTypeText = payTypeMap[this.payType] || '小程序码';
let f = {
oilOrder: oilOrderR,
goodsOrder: goodsOrderR,
payType: payTypeText,
unitName: "", //
@ -1232,10 +1227,8 @@ export default {
console.log(1226)
let payTypeText = payTypeMap[this.payForm.paymentType]
let actualPay = this.payForm.paymentType == 'CASH' ? this.payForm.authCode:this.payForm.realyPayBills
let oilOrderR = []
oilOrderR.push(this.oilOrder)
let a = {
oilOrder: oilOrderR,
//
realyPayBills:this.payForm.realyPayBills,
//