10.28
This commit is contained in:
parent
d9a0ff3125
commit
45757fd59d
@ -1,13 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<div class="card-change" >
|
<div class="card-change">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="" prop="tankName">
|
<el-form-item label="" prop="tankName">
|
||||||
<el-input v-model="queryParams.inventoryNumber" placeholder="业务单号" />
|
<el-input v-model="queryParams.inventoryNumber" placeholder="请输入盘点单号"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="" v-model="queryParams.tankId" prop="status">
|
||||||
|
<el-select v-model="queryParams.tankId" placeholder="请选择盘点油罐" style="width:100%" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="(item,index) in tankList"
|
||||||
|
:key="index"
|
||||||
|
:label="item.tankName"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="" v-model="queryParams.status" prop="status">
|
<el-form-item label="" v-model="queryParams.status" prop="status">
|
||||||
<el-select v-model="queryParams.status" placeholder="状态" style="width:100%" clearable
|
<el-select v-model="queryParams.status" placeholder="请选择状态" style="width:100%" clearable>
|
||||||
>
|
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.oilPurchasedStatus"
|
v-for="dict in dict.type.oilPurchasedStatus"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -17,91 +26,101 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="beginTime"
|
v-model="beginTime"
|
||||||
style="width: 160px"
|
style="width: 160px"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="开始日期">
|
placeholder="开始日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
至
|
至
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="endTime"
|
v-model="endTime"
|
||||||
style="width: 160px"
|
style="width: 160px"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="结束日期">
|
placeholder="结束日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="float: right; margin-right: 0px">
|
<el-form-item style="float: right; margin-right: 0px">
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
|
||||||
@click="purchaseAdd"
|
@click="purchaseAdd"
|
||||||
v-hasPermi="['oilConfig:oilInventory:list']"
|
v-hasPermi="['oilConfig:oilInventory:list']"
|
||||||
|
|
||||||
>添加盘点</el-button>
|
>添加盘点
|
||||||
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table ref="tables"
|
|
||||||
v-loading="loading"
|
|
||||||
:data="inventoryList"
|
|
||||||
border
|
|
||||||
:default-sort="defaultSort">
|
|
||||||
<el-table-column align="center" type="index" label="序号"></el-table-column>
|
|
||||||
<el-table-column label="业务单号" align="center" prop="inventoryNumber"/>
|
|
||||||
<el-table-column label="盘点油罐" align="center" prop="tanks"/>
|
|
||||||
<el-table-column label="盘点升数" align="center" prop="inventoryVolume"/>
|
|
||||||
<el-table-column label="库存差异升数" align="center" prop="stockDifference"/>
|
|
||||||
<el-table-column label="盈亏金额(元)" align="center" prop="profitLossAmount" width="100"/>
|
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div slot="reference" class="name-wrapper">
|
|
||||||
<el-tag v-if ="scope.row.status == 'await'" size="medium">待审核</el-tag>
|
|
||||||
<el-tag v-if ="scope.row.status == 'qrts'" type="success" size="medium">已审核入库</el-tag>
|
|
||||||
<el-tag v-if ="scope.row.status == 'yzf'" type="danger" size="medium">已作废</el-tag>
|
|
||||||
<el-tag v-if ="scope.row.status == 'ysh'" type="success" size="medium">已审核</el-tag>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="制单人" align="center" width="60" prop="creatorName"/>
|
|
||||||
<el-table-column label="审核人" align="center" width="60" prop="reviewerName"/>
|
|
||||||
<el-table-column label="入库人" align="center" width="60" prop="reviewerName"/>
|
|
||||||
|
|
||||||
<el-table-column label="制单时间" align="center" prop="orderTime" width="160">
|
<div style="height: 76vh;overflow: auto">
|
||||||
<template slot-scope="scope">
|
<el-table ref="tables"
|
||||||
<span>{{ parseTime(scope.row.orderTime) }}</span>
|
v-loading="loading"
|
||||||
</template>
|
:data="inventoryList"
|
||||||
</el-table-column>
|
border
|
||||||
<el-table-column label="审核时间" align="center" prop="orderTime" width="160">
|
:default-sort="defaultSort">
|
||||||
<template slot-scope="scope">
|
<el-table-column align="center" type="index" label="序号"></el-table-column>
|
||||||
<span>{{ parseTime(scope.row.orderTime) }}</span>
|
<el-table-column label="盘点单号" align="center" prop="inventoryNumber"/>
|
||||||
</template>
|
<el-table-column label="盘点油罐" align="center" prop="tanks"/>
|
||||||
</el-table-column>
|
<el-table-column label="盘点升数" align="center" prop="inventoryVolume"/>
|
||||||
<el-table-column label="入库时间" align="center" prop="orderTime" width="160">
|
<el-table-column label="库存差异升数" align="center" prop="stockDifference"/>
|
||||||
<template slot-scope="scope">
|
<el-table-column label="盈亏金额(元)" align="center" prop="profitLossAmount" width="100"/>
|
||||||
<span>{{ parseTime(scope.row.orderTime) }}</span>
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
</template>
|
<template slot-scope="scope">
|
||||||
</el-table-column>
|
<div slot="reference" class="name-wrapper">
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<div style="color: #00CAFF" v-if="scope.row.status == 'await'">待审核</div>
|
||||||
<template slot-scope="scope">
|
<div style="color: #0DC291" v-if="scope.row.status == 'qrts'">已审核入库</div>
|
||||||
<el-button
|
<div style="color: #F44522" v-if="scope.row.status == 'yzf'">已作废</div>
|
||||||
size="mini"
|
<div style="color: #FF770F" v-if="scope.row.status == 'ysh'">已审核</div>
|
||||||
type="text"
|
</div>
|
||||||
icon="el-icon-edit"
|
</template>
|
||||||
@click="dispose(scope.row)"
|
</el-table-column>
|
||||||
>{{ scope.row.status == 'qrts'?'查看单据':'处理单据' }}
|
<el-table-column label="制单人" align="center" width="60" prop="creatorName"/>
|
||||||
</el-button>
|
<el-table-column label="审核人" align="center" width="60" prop="reviewerName"/>
|
||||||
<!-- <el-button-->
|
<el-table-column label="入库人" align="center" width="60" prop="reviewerName"/>
|
||||||
<!-- size="mini"-->
|
|
||||||
<!-- type="text"-->
|
<el-table-column label="制单时间" align="center" prop="orderTime" width="160">
|
||||||
<!-- icon="el-icon-copy-document"-->
|
<template slot-scope="scope">
|
||||||
<!-- @click="handleDel(scope.row.id)"-->
|
<span>{{ parseTime(scope.row.orderTime) }}</span>
|
||||||
<!-- >删除</el-button>-->
|
</template>
|
||||||
<!-- v-hasPermi="['']"-->
|
</el-table-column>
|
||||||
</template>
|
<el-table-column label="审核时间" align="center" prop="orderTime" width="160">
|
||||||
</el-table-column>
|
<template slot-scope="scope">
|
||||||
</el-table>
|
<span>{{ parseTime(scope.row.orderTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="入库时间" align="center" prop="orderTime" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.orderTime) }}</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.status == 'ysh'"
|
||||||
|
@click="dispose(scope.row)"
|
||||||
|
>盘点入库
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
v-else-if="scope.row.status == 'await'"
|
||||||
|
@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>
|
||||||
|
</div>
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
@ -116,8 +135,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import {getPurchaseApi, getPurchaseOrderApi} from "@/api/oilConfig/oilPurchase";
|
import {getPurchaseApi, getPurchaseOrderApi} from "@/api/oilConfig/oilPurchase";
|
||||||
import {getSuppliersListApi2} from "@/api/oilConfig/oilSuppliers";
|
import {getSuppliersListApi2} from "@/api/oilConfig/oilSuppliers";
|
||||||
import {delInventoryApi, getInventoryApi} from "@/api/oilConfig/oilInventory";
|
import {delInventoryApi, getInventoryApi, selectList2Api} from "@/api/oilConfig/oilInventory";
|
||||||
import {getName,parseTime} from "../../../utils/fuint";
|
import {getName, parseTime} from "../../../utils/fuint";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "list",
|
name: "list",
|
||||||
@ -131,7 +150,7 @@ export default {
|
|||||||
|
|
||||||
suppliersList: [],
|
suppliersList: [],
|
||||||
// 弹出框标题
|
// 弹出框标题
|
||||||
title:'',
|
title: '',
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
disableInput: false, // 默认不禁用
|
disableInput: false, // 默认不禁用
|
||||||
@ -139,18 +158,18 @@ export default {
|
|||||||
open: false,
|
open: false,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
|
tankList: [],
|
||||||
// dateRange: '',
|
// dateRange: '',
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
inventoryNumber:'',
|
inventoryNumber: '',
|
||||||
status: '',
|
status: '',
|
||||||
page:null,
|
page: null,
|
||||||
pageSize:null
|
pageSize: null
|
||||||
},
|
},
|
||||||
dateRange:[],
|
dateRange: [],
|
||||||
beginTime:"",
|
beginTime: "",
|
||||||
endTime:"",
|
endTime: "",
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: false,
|
loading: false,
|
||||||
// 默认排序
|
// 默认排序
|
||||||
@ -158,7 +177,7 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
supplierName: [
|
supplierName: [
|
||||||
{ required: true, message: "供应商名称不能为空", trigger: "blur" },
|
{required: true, message: "供应商名称不能为空", trigger: "blur"},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,11 +185,18 @@ export default {
|
|||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
await this.getList();
|
await this.getList();
|
||||||
|
this.getTankList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
// 油罐列表
|
||||||
|
getTankList() {
|
||||||
|
selectList2Api().then(response => {
|
||||||
|
this.tankList = response.data
|
||||||
|
})
|
||||||
|
},
|
||||||
// 获取列表
|
// 获取列表
|
||||||
getList(){
|
getList() {
|
||||||
let dateRange = []
|
let dateRange = []
|
||||||
if (this.beginTime && this.endTime) {
|
if (this.beginTime && this.endTime) {
|
||||||
dateRange.push(this.beginTime.toLocaleDateString())
|
dateRange.push(this.beginTime.toLocaleDateString())
|
||||||
@ -180,7 +206,7 @@ export default {
|
|||||||
this.loading = true;
|
this.loading = true;
|
||||||
getInventoryApi(this.addDateRange(this.queryParams, dateRange)).then(response => {
|
getInventoryApi(this.addDateRange(this.queryParams, dateRange)).then(response => {
|
||||||
this.inventoryList = response.data.records;
|
this.inventoryList = response.data.records;
|
||||||
console.log("this.inventoryList",this.inventoryList)
|
console.log("this.inventoryList", this.inventoryList)
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
})
|
})
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -216,10 +242,10 @@ export default {
|
|||||||
},
|
},
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.queryParams = {
|
this.queryParams = {
|
||||||
inventoryNumber:'',
|
inventoryNumber: '',
|
||||||
status: '',
|
status: '',
|
||||||
page:null,
|
page: null,
|
||||||
pageSize:null
|
pageSize: null
|
||||||
};
|
};
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
@ -228,11 +254,12 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.app-container{
|
.app-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: #f6f8f9;
|
background: #f6f8f9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form--inline .el-form-item {
|
.el-form--inline .el-form-item {
|
||||||
margin-right: 44px;
|
margin-right: 44px;
|
||||||
}
|
}
|
||||||
|
@ -885,11 +885,10 @@ export default {
|
|||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
.box {
|
.box {
|
||||||
height: 100%;
|
height: 80%;
|
||||||
width: 212px;
|
width: 212px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 10px 10px 10px 10px;
|
|
||||||
border: 1px solid #EEEEEE;
|
border: 1px solid #EEEEEE;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -1,39 +1,42 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container" style="padding-top: 1px" >
|
<div class="app-container" style="padding-top: 1px">
|
||||||
|
|
||||||
<div class="card-change-1-search">
|
<div class="card-change-1-search">
|
||||||
<div class="" style="height: 90px; display: flex; justify-content: space-between;">
|
<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%; display: flex; justify-content: space-between;">
|
||||||
<div style="height: 100%; width: 70%; display: flex; justify-content: space-between;align-items: center">
|
<div style="height: 100%; width: 70%; display: flex; justify-content: space-between;align-items: center">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<span style="font-size: 24px;color: #0DC291;font-weight: bold" >{{purchasedTonnage}}</span>
|
<span style="font-size: 24px;color: #0DC291;font-weight: bold">{{ purchasedTonnage }}</span>
|
||||||
<span style="display: flex;font-size: 14px;font-weight: bold">
|
<span style="display: flex;font-size: 14px;font-weight: bold">
|
||||||
<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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<span style="font-size: 26px;color: #00CAFF;font-weight: bold" >{{purchaseLiters}}</span>
|
<span style="font-size: 26px;color: #00CAFF;font-weight: bold">{{ purchaseLiters }}</span>
|
||||||
<span style="display: flex;font-size: 14px;font-weight: bold">
|
<span style="display: flex;font-size: 14px;font-weight: bold">
|
||||||
<div style="background-color: #00CAFF;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>
|
采购升数</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<span style="font-size: 26px;color: #F44522;font-weight: bold">{{totalAmountPurchased}}</span>
|
<span style="font-size: 26px;color: #F44522;font-weight: bold">{{ totalAmountPurchased }}</span>
|
||||||
<span style="display: flex;font-size: 14px;font-weight: bold">
|
<span style="display: flex;font-size: 14px;font-weight: bold">
|
||||||
<div style="background-color: #F44522;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>
|
采购总额</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 100%; width: 40%; display: flex; flex-direction: column; justify-content: space-between;">
|
<div style="height: 100%; width: 40%; display: flex; flex-direction: column; justify-content: space-between;">
|
||||||
<el-form ref="myForm" label-width="100px">
|
<el-form ref="myForm" label-width="100px">
|
||||||
<el-form-item label="进货单号">
|
<el-form-item label="进货单号">
|
||||||
<el-input v-model="purchaseForm.purchaseNo" @change="saveJudgment" :disabled="numberInput"
|
<el-input v-model="purchaseForm.purchaseNo" @change="saveJudgment" :disabled="numberInput"
|
||||||
style="width: 220Px">
|
style="width: 220Px">
|
||||||
<el-button slot="append" @click="refresh()" icon="el-icon-refresh"></el-button>
|
<el-button slot="append" @click="refresh()" icon="el-icon-refresh"></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="进货时间" >
|
<el-form-item label="进货时间">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
style="width: 220Px"
|
style="width: 220Px"
|
||||||
v-model="purchaseForm.purchaseDate"
|
v-model="purchaseForm.purchaseDate"
|
||||||
@ -47,12 +50,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 100%; width: 30%; display: flex; align-items: center; justify-content: flex-end;">
|
<div style="height: 100%; width: 30%; display: flex; align-items: center; justify-content: flex-end;">
|
||||||
<el-button @click="cancelPurchase">取消</el-button>
|
<el-button type="primary" @click="cancelPurchase" v-if="state=='qrts'">关闭</el-button>
|
||||||
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="savePurchase()">保存</el-button>
|
<el-button @click="cancelPurchase" v-else>取消</el-button>
|
||||||
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit">保存并审核</el-button>
|
<el-button type="success" v-if="state=='await'" :disabled="saveFlag" @click="savePurchase()">保存</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="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="primary" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">收货并入库</el-button>
|
||||||
<!-- state=='yzf'-->
|
<!-- state=='yzf'-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -61,63 +65,72 @@
|
|||||||
|
|
||||||
<div class="card-change-1-1">
|
<div class="card-change-1-1">
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5" style="text-align: right; float: right">
|
<el-col :span="1.5" style="text-align: right; float: right">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="state =='await'"
|
v-if="state =='await'"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="orderAdd"
|
@click="orderAdd"
|
||||||
>添加采购油品</el-button>
|
>添加采购油品
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table ref="tables"
|
<div style="height: 60vh;overflow: auto">
|
||||||
v-loading="loading"
|
|
||||||
:data="orderList"
|
|
||||||
border
|
|
||||||
:default-sort="defaultSort">
|
|
||||||
<el-table-column label="油品油号" align="center" prop="numberName"/>
|
|
||||||
<el-table-column label="入库油罐" align="center" prop="tankName"/>
|
|
||||||
<el-table-column label="供应商" align="center" prop="supplierName" />
|
|
||||||
<el-table-column label="当前库存" align="center" prop="storedQuantity"/>
|
|
||||||
<!-- <el-table-column label="入库前库存" align="center" prop="preInboundInventory"/>-->
|
|
||||||
<el-table-column label="油品密度(g/ml)" align="center" prop="productDensity">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-input-number :disabled="numberInput" v-model="scope.row.productDensity" @change="change(scope.row)" controls-position="right" :min="0" :max="10000000" :step="1" style="max-width: 100%"></el-input-number>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="采购吨数(t)" align="center" prop="purchaseWeight">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-input-number :disabled="numberInput" v-model="scope.row.purchaseWeight" @change="change(scope.row)" controls-position="right" :min="0" :step="0.01" style="max-width: 100%"></el-input-number>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :disabled="numberInput" label="采购单价(元/吨)" align="center" prop="purchasePrice">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-input-number :disabled="numberInput" v-model="scope.row.purchasePrice" @change="change(scope.row)" controls-position="right" :min="0" :step="1" style="max-width: 100%"></el-input-number>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="小计金额(元)" align="center" prop="totalAmount">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.totalAmount }}
|
|
||||||
<!-- <el-input-number :disabled="numberInput" v-model="scope.row.totalAmount" @change="change(scope.row)" controls-position="right" :min="0" :max="10000000" :step="1" style="max-width: 100%"></el-input-number> -->
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="采购升数(L)" align="center" prop="purchaseVolume"/>
|
|
||||||
<el-table-column label="成本价(元/升)" align="center" prop="discountedPrice"/>
|
|
||||||
<el-table-column v-if="state =='await'" label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="orderDel(scope.row)"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
<!-- v-hasPermi="['']"-->
|
|
||||||
|
|
||||||
</el-table-column>
|
<el-table ref="tables"
|
||||||
</el-table>
|
v-loading="loading"
|
||||||
|
:data="orderList"
|
||||||
|
border
|
||||||
|
:default-sort="defaultSort">
|
||||||
|
<el-table-column label="油品油号" align="center" prop="numberName"/>
|
||||||
|
<el-table-column label="入库油罐" align="center" prop="tankName"/>
|
||||||
|
<el-table-column label="供应商" align="center" prop="supplierName"/>
|
||||||
|
<el-table-column label="当前库存" align="center" prop="storedQuantity"/>
|
||||||
|
<!-- <el-table-column label="入库前库存" align="center" prop="preInboundInventory"/>-->
|
||||||
|
<el-table-column label="油品密度(g/ml)" align="center" prop="productDensity">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input-number :disabled="numberInput" v-model="scope.row.productDensity" @change="change(scope.row)"
|
||||||
|
controls-position="right" :min="0" :max="10000000" :step="1"
|
||||||
|
style="max-width: 100%"></el-input-number>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="采购吨数(t)" align="center" prop="purchaseWeight">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input-number :disabled="numberInput" v-model="scope.row.purchaseWeight" @change="change(scope.row)"
|
||||||
|
controls-position="right" :min="0" :step="0.01"
|
||||||
|
style="max-width: 100%"></el-input-number>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :disabled="numberInput" label="采购单价(元/吨)" align="center" prop="purchasePrice">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input-number :disabled="numberInput" v-model="scope.row.purchasePrice" @change="change(scope.row)"
|
||||||
|
controls-position="right" :min="0" :step="1" style="max-width: 100%"></el-input-number>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="小计金额(元)" align="center" prop="totalAmount">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.totalAmount }}
|
||||||
|
<!-- <el-input-number :disabled="numberInput" v-model="scope.row.totalAmount" @change="change(scope.row)" controls-position="right" :min="0" :max="10000000" :step="1" style="max-width: 100%"></el-input-number> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="采购升数(L)" align="center" prop="purchaseVolume"/>
|
||||||
|
<el-table-column label="成本价(元/升)" align="center" prop="discountedPrice"/>
|
||||||
|
<el-table-column v-if="state =='await'" label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="orderDel(scope.row)"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
<!-- v-hasPermi="['']"-->
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</div>
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
@ -127,13 +140,14 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 添加采购油品-->
|
<!-- 添加采购油品-->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
|
||||||
<el-form ref="form" :model="orderForm" :rules="rules" label-width="120px">
|
<el-form ref="form" :model="orderForm" :rules="rules" label-width="120px">
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="22">
|
<el-col :span="22">
|
||||||
<el-form-item label="采购油品号" prop="numberId">
|
<el-form-item label="采购油品号" prop="numberId">
|
||||||
<el-select v-model="orderForm.numberId" placeholder="请选择油品" style="width:100%" @change="chooseOilNumber($event)">
|
<el-select v-model="orderForm.numberId" placeholder="请选择油品" style="width:100%"
|
||||||
|
@change="chooseOilNumber($event)">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="option in numberList"
|
v-for="option in numberList"
|
||||||
:key="option.numberId"
|
:key="option.numberId"
|
||||||
@ -147,7 +161,8 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="22">
|
<el-col :span="22">
|
||||||
<el-form-item label="入库油罐" prop="tankId">
|
<el-form-item label="入库油罐" prop="tankId">
|
||||||
<el-select v-model="orderForm.tankId" placeholder="请选择油罐" style="width:100%" @change="chooseTank($event),getSecondName()">
|
<el-select v-model="orderForm.tankId" placeholder="请选择油罐" style="width:100%"
|
||||||
|
@change="chooseTank($event),getSecondName()">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="option in tankList"
|
v-for="option in tankList"
|
||||||
:key="option.id"
|
:key="option.id"
|
||||||
@ -178,7 +193,7 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="22">
|
<el-col :span="22">
|
||||||
<el-form-item label="油品密度" prop="productDensity">
|
<el-form-item label="油品密度" prop="productDensity">
|
||||||
<el-input v-model="orderForm.productDensity" @input="aaa()" placeholder="请输入油品密度" >
|
<el-input v-model="orderForm.productDensity" @input="aaa()" placeholder="请输入油品密度">
|
||||||
<template slot="append">g/ml</template>
|
<template slot="append">g/ml</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-alert
|
<el-alert
|
||||||
@ -203,7 +218,7 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="22">
|
<el-col :span="22">
|
||||||
<el-form-item label="采购单价" prop="purchasePrice">
|
<el-form-item label="采购单价" prop="purchasePrice">
|
||||||
<el-input v-model="orderForm.purchasePrice" placeholder="请输入采购单价" >
|
<el-input v-model="orderForm.purchasePrice" placeholder="请输入采购单价">
|
||||||
<template slot="append">元/吨</template>
|
<template slot="append">元/吨</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -220,10 +235,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getSuppliersListApi2 } from "@/api/oilConfig/oilSuppliers";
|
import {getSuppliersListApi2} from "@/api/oilConfig/oilSuppliers";
|
||||||
import {
|
import {
|
||||||
editPurchuseApi,
|
editPurchuseApi,
|
||||||
getPurchaseOrderApi,unifiedProcessingApi,
|
getPurchaseOrderApi, unifiedProcessingApi,
|
||||||
insertPurchaseApi,
|
insertPurchaseApi,
|
||||||
insertPurchaseOrderApi,
|
insertPurchaseOrderApi,
|
||||||
disposeBatchApi,
|
disposeBatchApi,
|
||||||
@ -250,8 +265,8 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
orderList:[],
|
orderList: [],
|
||||||
orderForm:{
|
orderForm: {
|
||||||
id: null,
|
id: null,
|
||||||
purchaseId: null,
|
purchaseId: null,
|
||||||
numberId: null,
|
numberId: null,
|
||||||
@ -272,7 +287,7 @@ export default {
|
|||||||
nowVolume: 0, // 现有升数
|
nowVolume: 0, // 现有升数
|
||||||
canUseVolume: 0,// 可用升数
|
canUseVolume: 0,// 可用升数
|
||||||
canUseT: 0,//吨数计算
|
canUseT: 0,//吨数计算
|
||||||
unit:'L',//单位
|
unit: 'L',//单位
|
||||||
// tTitle:'',
|
// tTitle:'',
|
||||||
|
|
||||||
|
|
||||||
@ -285,18 +300,18 @@ export default {
|
|||||||
purchasedTonnage: 0, //采购吨数
|
purchasedTonnage: 0, //采购吨数
|
||||||
purchaseLiters: 0, //采购升数
|
purchaseLiters: 0, //采购升数
|
||||||
totalAmountPurchased: 0, //采购总额
|
totalAmountPurchased: 0, //采购总额
|
||||||
numberList:[],
|
numberList: [],
|
||||||
tankList:[],
|
tankList: [],
|
||||||
suppliersList:[],
|
suppliersList: [],
|
||||||
|
|
||||||
saveFlag:false,
|
saveFlag: false,
|
||||||
auditFlag:true,
|
auditFlag: true,
|
||||||
voidFlag:false,
|
voidFlag: false,
|
||||||
storageFlag:true,
|
storageFlag: true,
|
||||||
state:'',
|
state: '',
|
||||||
|
|
||||||
// 弹出框标题
|
// 弹出框标题
|
||||||
title:'',
|
title: '',
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
disableInput: false, // 默认不禁用
|
disableInput: false, // 默认不禁用
|
||||||
@ -308,8 +323,8 @@ export default {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
supplierId: '',
|
supplierId: '',
|
||||||
purchaseId: null,
|
purchaseId: null,
|
||||||
page:null,
|
page: null,
|
||||||
pageSize:null
|
pageSize: null
|
||||||
},
|
},
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: false,
|
loading: false,
|
||||||
@ -325,20 +340,20 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
productDensity: [
|
productDensity: [
|
||||||
{ required: true, validator:valiNumberPass, trigger: "blur" }
|
{required: true, validator: valiNumberPass, trigger: "blur"}
|
||||||
],
|
],
|
||||||
purchaseWeight: [
|
purchaseWeight: [
|
||||||
{ required: true, validator:valiNumberPass, trigger: "blur" },
|
{required: true, validator: valiNumberPass, trigger: "blur"},
|
||||||
],
|
],
|
||||||
purchasePrice: [
|
purchasePrice: [
|
||||||
{ required: true, validator:valiNumberPass, trigger: "blur" }
|
{required: true, validator: valiNumberPass, trigger: "blur"}
|
||||||
],
|
],
|
||||||
numberId: [
|
numberId: [
|
||||||
{required: true, message: "请选择采购油品", trigger: "blur"}
|
{required: true, message: "请选择采购油品", trigger: "blur"}
|
||||||
],
|
],
|
||||||
tankId: [
|
tankId: [
|
||||||
{required: true, message: "请选择油罐", trigger: "blur"}
|
{required: true, message: "请选择油罐", trigger: "blur"}
|
||||||
] ,
|
],
|
||||||
supplierId: [
|
supplierId: [
|
||||||
{required: true, message: "请选择供应商", trigger: "blur"}
|
{required: true, message: "请选择供应商", trigger: "blur"}
|
||||||
]
|
]
|
||||||
@ -366,26 +381,26 @@ export default {
|
|||||||
if (this.$route.query.purchaseId != null) {
|
if (this.$route.query.purchaseId != null) {
|
||||||
this.queryParams.purchaseId = this.$route.query.purchaseId;
|
this.queryParams.purchaseId = this.$route.query.purchaseId;
|
||||||
this.purchaseId = this.$route.query.purchaseId;
|
this.purchaseId = this.$route.query.purchaseId;
|
||||||
}else if (this.$route.query.purchaseId == null && this.purchaseId>0) {
|
} else if (this.$route.query.purchaseId == null && this.purchaseId > 0) {
|
||||||
|
|
||||||
}else {
|
} else {
|
||||||
// this.queryParams.purchaseId = -parseInt(new Date().getTime())% 100000000;
|
// this.queryParams.purchaseId = -parseInt(new Date().getTime())% 100000000;
|
||||||
// this.purchaseId = -parseInt(new Date().getTime()) % 100000000;
|
// this.purchaseId = -parseInt(new Date().getTime()) % 100000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.state = this.$route.query.state;
|
this.state = this.$route.query.state;
|
||||||
|
|
||||||
if ( this.state == null) {
|
if (this.state == null) {
|
||||||
this.state = 'await'
|
this.state = 'await'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state=='await') {
|
if (this.state == 'await') {
|
||||||
this.numberInput = false
|
this.numberInput = false
|
||||||
}else {
|
} else {
|
||||||
this.numberInput = true
|
this.numberInput = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(this.state, 388)
|
||||||
|
|
||||||
// this.purchaseForm.purchaseDate = localDate;
|
// this.purchaseForm.purchaseDate = localDate;
|
||||||
// console.log("this.purchaseForm.purchaseDate:", this.purchaseForm.purchaseDate);
|
// console.log("this.purchaseForm.purchaseDate:", this.purchaseForm.purchaseDate);
|
||||||
@ -393,7 +408,7 @@ export default {
|
|||||||
this.purchaseForm.purchaseDate = new Date(parseInt(this.$route.query.purchaseDate))
|
this.purchaseForm.purchaseDate = new Date(parseInt(this.$route.query.purchaseDate))
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("this.purchaseForm.purchaseDate",this.purchaseForm.purchaseDate)
|
console.log("this.purchaseForm.purchaseDate", this.purchaseForm.purchaseDate)
|
||||||
if (this.purchaseForm.purchaseDate == null) {
|
if (this.purchaseForm.purchaseDate == null) {
|
||||||
this.purchaseForm.purchaseDate = new Date()
|
this.purchaseForm.purchaseDate = new Date()
|
||||||
}
|
}
|
||||||
@ -411,21 +426,21 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
tTitle() {
|
tTitle() {
|
||||||
return "油罐总容量"+this.tankVolume+' '+this.unit+",当前密度下可用约"+this.canUseT+"吨"
|
return "油罐总容量" + this.tankVolume + ' ' + this.unit + ",当前密度下可用约" + this.canUseT + "吨"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 返回页面
|
// 返回页面
|
||||||
cancelPurchase(){
|
cancelPurchase() {
|
||||||
this.$router.back()
|
this.$router.back()
|
||||||
},
|
},
|
||||||
aaa() {
|
aaa() {
|
||||||
this.densityCalculations()
|
this.densityCalculations()
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
console.log(" orderForm.productDensity()\n",this.orderForm.productDensity)
|
console.log(" orderForm.productDensity()\n", this.orderForm.productDensity)
|
||||||
|
|
||||||
},
|
},
|
||||||
getList(){
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getPurchaseOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
getPurchaseOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
this.orderList = response.data.records;
|
this.orderList = response.data.records;
|
||||||
@ -450,21 +465,21 @@ export default {
|
|||||||
},
|
},
|
||||||
orderDel(data) {
|
orderDel(data) {
|
||||||
if (data.id != null) {
|
if (data.id != null) {
|
||||||
delPurchaseOrderApi(data).then(res=>{
|
delPurchaseOrderApi(data).then(res => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const index = this.orderList.indexOf(data); // 查找要删除的对象的索引
|
const index = this.orderList.indexOf(data); // 查找要删除的对象的索引
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
this.orderList.splice(index, 1); // 使用splice方法删除对象
|
this.orderList.splice(index, 1); // 使用splice方法删除对象
|
||||||
}
|
}
|
||||||
// this.numberOfTanks = this.numberOfTanks-1
|
// this.numberOfTanks = this.numberOfTanks-1
|
||||||
// delPurchaseOrderApi(data).then(response => {
|
// delPurchaseOrderApi(data).then(response => {
|
||||||
// this.$modal.msgSuccess("删除成功");
|
// this.$modal.msgSuccess("删除成功");
|
||||||
// this.getList()
|
// this.getList()
|
||||||
// })
|
// })
|
||||||
},
|
},
|
||||||
// 提交
|
// 提交
|
||||||
submitForm: function() {
|
submitForm: function () {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
// 密度计算
|
// 密度计算
|
||||||
@ -481,9 +496,9 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
let numberName = this.numberList.find(item => item.numberId === this.orderForm.numberId);
|
let numberName = this.numberList.find(item => item.numberId === this.orderForm.numberId);
|
||||||
let tankName = this.tankList.find(item => item.id === this.orderForm.tankId);
|
let tankName = this.tankList.find(item => item.id === this.orderForm.tankId);
|
||||||
let supplierName = this.suppliersList.find(item => item.id === this.orderForm.supplierId);
|
let supplierName = this.suppliersList.find(item => item.id === this.orderForm.supplierId);
|
||||||
console.log("numberName",numberName)
|
console.log("numberName", numberName)
|
||||||
// 去重
|
// 去重
|
||||||
let isDuplicate = false
|
let isDuplicate = false
|
||||||
if (this.orderList.length > 0) {
|
if (this.orderList.length > 0) {
|
||||||
@ -501,7 +516,7 @@ export default {
|
|||||||
"discountedPrice": this.orderForm.discountedPrice,
|
"discountedPrice": this.orderForm.discountedPrice,
|
||||||
// "id": 47,
|
// "id": 47,
|
||||||
"numberId": this.orderForm.numberId,
|
"numberId": this.orderForm.numberId,
|
||||||
"numberName": numberName.oilType +' '+numberName.oilName,
|
"numberName": numberName.oilType + ' ' + numberName.oilName,
|
||||||
"oilName": numberName.oilName,
|
"oilName": numberName.oilName,
|
||||||
"oilType": numberName.oilType,
|
"oilType": numberName.oilType,
|
||||||
// "preInboundInventory": null,
|
// "preInboundInventory": null,
|
||||||
@ -522,7 +537,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.orderList.push(addFrom)
|
this.orderList.push(addFrom)
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.sumMethod(this.orderList)
|
this.sumMethod(this.orderList)
|
||||||
@ -570,7 +584,6 @@ export default {
|
|||||||
this.sumMethod(this.orderList)
|
this.sumMethod(this.orderList)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 进行保存
|
// 进行保存
|
||||||
// this.orderForm = data
|
// this.orderForm = data
|
||||||
// this.edit()
|
// this.edit()
|
||||||
@ -586,15 +599,15 @@ export default {
|
|||||||
// 选择油品号之后
|
// 选择油品号之后
|
||||||
chooseOilNumber(data) {
|
chooseOilNumber(data) {
|
||||||
this.orderForm.tankId = '',
|
this.orderForm.tankId = '',
|
||||||
this.selectTankByNumber(this.orderForm.numberId);
|
this.selectTankByNumber(this.orderForm.numberId);
|
||||||
},
|
},
|
||||||
// 选择油罐添加密度
|
// 选择油罐添加密度
|
||||||
chooseTank(data){
|
chooseTank(data) {
|
||||||
// 根据id找密度
|
// 根据id找密度
|
||||||
this.tankList.forEach(su=>{
|
this.tankList.forEach(su => {
|
||||||
if (data == su.id) {
|
if (data == su.id) {
|
||||||
this.orderForm.productDensity = su.oilDensity
|
this.orderForm.productDensity = su.oilDensity
|
||||||
console.log("su",su)
|
console.log("su", su)
|
||||||
this.tankVolume = su.tankVolume
|
this.tankVolume = su.tankVolume
|
||||||
this.nowVolume = su.storedQuantity
|
this.nowVolume = su.storedQuantity
|
||||||
this.unit = su.unit
|
this.unit = su.unit
|
||||||
@ -607,7 +620,7 @@ export default {
|
|||||||
this.canUseVolume = this.tankVolume - this.nowVolume
|
this.canUseVolume = this.tankVolume - this.nowVolume
|
||||||
// 定义油的体积和密度
|
// 定义油的体积和密度
|
||||||
const volumeLiters = new BigNumber(this.canUseVolume); // 体积,单位:升
|
const volumeLiters = new BigNumber(this.canUseVolume); // 体积,单位:升
|
||||||
const densityGramsPerML = new BigNumber(this.orderForm.productDensity?this.orderForm.productDensity:0); // 密度,单位:克/毫升
|
const densityGramsPerML = new BigNumber(this.orderForm.productDensity ? this.orderForm.productDensity : 0); // 密度,单位:克/毫升
|
||||||
|
|
||||||
|
|
||||||
// 计算油的质量(吨)
|
// 计算油的质量(吨)
|
||||||
@ -615,7 +628,7 @@ export default {
|
|||||||
const massTons = Math.floor(volumeLiters.times(densityGramsPerML).times(1e-3) * 100) / 100;
|
const massTons = Math.floor(volumeLiters.times(densityGramsPerML).times(1e-3) * 100) / 100;
|
||||||
|
|
||||||
this.canUseT = massTons; // 将结果转换为数字类型并赋值给属性
|
this.canUseT = massTons; // 将结果转换为数字类型并赋值给属性
|
||||||
console.log("canUseT",this.canUseT)
|
console.log("canUseT", this.canUseT)
|
||||||
|
|
||||||
},
|
},
|
||||||
inputPurchaseWeight() {
|
inputPurchaseWeight() {
|
||||||
@ -631,20 +644,20 @@ export default {
|
|||||||
|
|
||||||
const purchaseWeight = parseFloat(this.orderForm.purchaseWeight);
|
const purchaseWeight = parseFloat(this.orderForm.purchaseWeight);
|
||||||
const canUseT = parseFloat(this.canUseT);
|
const canUseT = parseFloat(this.canUseT);
|
||||||
console.log("purchaseWeight",purchaseWeight)
|
console.log("purchaseWeight", purchaseWeight)
|
||||||
console.log("canUseT",canUseT)
|
console.log("canUseT", canUseT)
|
||||||
if (canUseT<=0) {
|
if (canUseT <= 0) {
|
||||||
this.$message('已无可用吨数!');
|
this.$message('已无可用吨数!');
|
||||||
this.orderForm.purchaseWeight = ''
|
this.orderForm.purchaseWeight = ''
|
||||||
return
|
return
|
||||||
}else if (purchaseWeight>canUseT) {
|
} else if (purchaseWeight > canUseT) {
|
||||||
this.orderForm.purchaseWeight = canUseT
|
this.orderForm.purchaseWeight = canUseT
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 查询所有的油品
|
// 查询所有的油品
|
||||||
getOilNameList() {
|
getOilNameList() {
|
||||||
let this_=this
|
let this_ = this
|
||||||
getOilNameListApi().then( response => {
|
getOilNameListApi().then(response => {
|
||||||
let list = response.data
|
let list = response.data
|
||||||
this_.numberList = list
|
this_.numberList = list
|
||||||
});
|
});
|
||||||
@ -669,25 +682,25 @@ export default {
|
|||||||
var max = 999; // 最大的四位数是 9999
|
var max = 999; // 最大的四位数是 9999
|
||||||
var randomFourDigitNumber = Math.floor(Math.random() * (max - min + 1)) + min;
|
var randomFourDigitNumber = Math.floor(Math.random() * (max - min + 1)) + min;
|
||||||
// this.purchaseOrderNumber = timestamp+randomFourDigitNumber.toString();
|
// this.purchaseOrderNumber = timestamp+randomFourDigitNumber.toString();
|
||||||
this.purchaseForm.purchaseNo = timestamp+randomFourDigitNumber.toString();
|
this.purchaseForm.purchaseNo = timestamp + randomFourDigitNumber.toString();
|
||||||
},
|
},
|
||||||
// 总数计算
|
// 总数计算
|
||||||
sumMethod(data) {
|
sumMethod(data) {
|
||||||
this.purchasedTonnage= new BigNumber(0),
|
this.purchasedTonnage = new BigNumber(0),
|
||||||
this.purchaseLiters= new BigNumber(0),
|
this.purchaseLiters = new BigNumber(0),
|
||||||
this.totalAmountPurchased= new BigNumber(0),
|
this.totalAmountPurchased = new BigNumber(0),
|
||||||
data.forEach(da => {
|
data.forEach(da => {
|
||||||
this.purchasedTonnage = this.purchasedTonnage.plus(da.purchaseWeight);
|
this.purchasedTonnage = this.purchasedTonnage.plus(da.purchaseWeight);
|
||||||
this.purchaseLiters = this.purchaseLiters.plus(da.purchaseVolume);
|
this.purchaseLiters = this.purchaseLiters.plus(da.purchaseVolume);
|
||||||
this.totalAmountPurchased = this.totalAmountPurchased.plus(da.totalAmount);
|
this.totalAmountPurchased = this.totalAmountPurchased.plus(da.totalAmount);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 保存订单信息
|
// 保存订单信息
|
||||||
async savePurchase(flag){
|
async savePurchase(flag) {
|
||||||
if (this.purchaseForm.purchaseNo == null) {
|
if (this.purchaseForm.purchaseNo == null) {
|
||||||
this.$modal.msgWarning("请先选择进货单号");
|
this.$modal.msgWarning("请先选择进货单号");
|
||||||
return -1;
|
return -1;
|
||||||
}else if (this.purchaseForm.purchaseDate==null) {
|
} else if (this.purchaseForm.purchaseDate == null) {
|
||||||
this.$modal.msgWarning("请先选择进货时间");
|
this.$modal.msgWarning("请先选择进货时间");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -697,22 +710,21 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let from = {
|
let from = {
|
||||||
id:this.purchaseId,
|
id: this.purchaseId,
|
||||||
purchaseNo : this.purchaseForm.purchaseNo,
|
purchaseNo: this.purchaseForm.purchaseNo,
|
||||||
purchaseDate : this.purchaseForm.purchaseDate,
|
purchaseDate: this.purchaseForm.purchaseDate,
|
||||||
theDocumentAmount : this.totalAmountPurchased,
|
theDocumentAmount: this.totalAmountPurchased,
|
||||||
}
|
}
|
||||||
|
|
||||||
await unifiedProcessingApi({oilPurchase:from,oilPurchaseOrders:this.orderList}).then(res=>{
|
await unifiedProcessingApi({oilPurchase: from, oilPurchaseOrders: this.orderList}).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.purchaseId = res.data.id
|
this.purchaseId = res.data.id
|
||||||
|
|
||||||
this.$router.push({ path: '/oilConfig/oilPurchase/list'});
|
this.$router.push({path: '/oilConfig/oilPurchase/list'});
|
||||||
}else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}).catch({
|
}).catch({})
|
||||||
})
|
|
||||||
|
|
||||||
// if(this.purchaseId != null) {
|
// if(this.purchaseId != null) {
|
||||||
// // 修改
|
// // 修改
|
||||||
@ -788,59 +800,59 @@ export default {
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
// 判断是否可以保存
|
// 判断是否可以保存
|
||||||
saveJudgment(){
|
saveJudgment() {
|
||||||
// if (this.purchaseForm.purchaseNo != null && this.purchaseForm.purchaseDate != null && this.orderList.length > 0) {
|
// if (this.purchaseForm.purchaseNo != null && this.purchaseForm.purchaseDate != null && this.orderList.length > 0) {
|
||||||
// this.saveFlag = false;
|
// this.saveFlag = false;
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
// 判断按钮是否可用
|
// 判断按钮是否可用
|
||||||
async JudgmentButton(){
|
async JudgmentButton() {
|
||||||
let judgmentPermissions1 = await this.judgmentPermissions("进油审核");
|
let judgmentPermissions1 = await this.judgmentPermissions("进油审核");
|
||||||
if (judgmentPermissions1 > 0){
|
if (judgmentPermissions1 > 0) {
|
||||||
this.auditFlag=false
|
this.auditFlag = false
|
||||||
}else {
|
} else {
|
||||||
this.auditFlag=true
|
this.auditFlag = true
|
||||||
}
|
}
|
||||||
let judgmentPermissions2 = await this.judgmentPermissions("进油入库");
|
let judgmentPermissions2 = await this.judgmentPermissions("进油入库");
|
||||||
if (judgmentPermissions2 > 0){
|
if (judgmentPermissions2 > 0) {
|
||||||
this.storageFlag = false
|
this.storageFlag = false
|
||||||
}else {
|
} else {
|
||||||
this.storageFlag=true
|
this.storageFlag = true
|
||||||
}
|
}
|
||||||
let judgmentPermissions3 = await this.judgmentPermissions("进油废止");
|
let judgmentPermissions3 = await this.judgmentPermissions("进油废止");
|
||||||
if (judgmentPermissions3 > 0){
|
if (judgmentPermissions3 > 0) {
|
||||||
this.voidFlag=false
|
this.voidFlag = false
|
||||||
}else {
|
} else {
|
||||||
this.voidFlag=true
|
this.voidFlag = true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 判断权限
|
// 判断权限
|
||||||
async judgmentPermissions(data) {
|
async judgmentPermissions(data) {
|
||||||
let fil ={
|
let fil = {
|
||||||
auditPrem:data
|
auditPrem: data
|
||||||
}
|
}
|
||||||
return await getAuditPremApi(fil).then(res => {
|
return await getAuditPremApi(fil).then(res => {
|
||||||
return res.data
|
return res.data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 保存并审核
|
// 保存并审核
|
||||||
async audit(){
|
async audit() {
|
||||||
// 保存
|
// 保存
|
||||||
let number = await this.savePurchase(-1);
|
let number = await this.savePurchase(-1);
|
||||||
|
|
||||||
if (number != -1) {
|
if (number != -1) {
|
||||||
// 审核
|
// 审核
|
||||||
let fil ={
|
let fil = {
|
||||||
id: this.purchaseId
|
id: this.purchaseId
|
||||||
}
|
}
|
||||||
console.log(" id: this.purchaseId",fil)
|
console.log(" id: this.purchaseId", fil)
|
||||||
await auditApi(fil).then(res => {
|
await auditApi(fil).then(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.state = 'ysh'
|
this.state = 'ysh'
|
||||||
this.numberInput= true
|
this.numberInput = true
|
||||||
this.$modal.msgWarning("审核成功");
|
this.$modal.msgWarning("审核成功");
|
||||||
this.$router.push('/oilConfig/oilPurchase/list');
|
this.$router.push('/oilConfig/oilPurchase/list');
|
||||||
}else {
|
} else {
|
||||||
this.$modal.msgWarning("暂无审核权限");
|
this.$modal.msgWarning("暂无审核权限");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -853,7 +865,7 @@ export default {
|
|||||||
if (this.purchaseForm.purchaseNo == null) {
|
if (this.purchaseForm.purchaseNo == null) {
|
||||||
this.$modal.msgWarning("请先选择进货单号");
|
this.$modal.msgWarning("请先选择进货单号");
|
||||||
return;
|
return;
|
||||||
}else if (this.purchaseForm.purchaseDate==null) {
|
} else if (this.purchaseForm.purchaseDate == null) {
|
||||||
this.$modal.msgWarning("请先选择进货时间");
|
this.$modal.msgWarning("请先选择进货时间");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -863,14 +875,14 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
// 审核
|
// 审核
|
||||||
let fil ={
|
let fil = {
|
||||||
id: this.purchaseId
|
id: this.purchaseId
|
||||||
}
|
}
|
||||||
storageApi(fil).then(res => {
|
storageApi(fil).then(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.state = 'qrts'
|
this.state = 'qrts'
|
||||||
this.$modal.msgWarning("入库成功");
|
this.$modal.msgWarning("入库成功");
|
||||||
this.numberInput= true
|
this.numberInput = true
|
||||||
|
|
||||||
this.$router.push('/oilConfig/oilPurchase/list');
|
this.$router.push('/oilConfig/oilPurchase/list');
|
||||||
|
|
||||||
@ -887,11 +899,9 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 作废
|
// 作废
|
||||||
abolition(){
|
abolition() {
|
||||||
if (this.purchaseId < 0) {
|
if (this.purchaseId < 0) {
|
||||||
this.$modal.msgWarning("数据未保存,不可废弃");
|
this.$modal.msgWarning("数据未保存,不可废弃");
|
||||||
return;
|
return;
|
||||||
@ -903,16 +913,16 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
// 审核
|
// 审核
|
||||||
let fil ={
|
let fil = {
|
||||||
id: this.purchaseId
|
id: this.purchaseId
|
||||||
}
|
}
|
||||||
abolitionApi(fil).then(res => {
|
abolitionApi(fil).then(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.state = 'yzf'
|
this.state = 'yzf'
|
||||||
this.$modal.msgWarning("审核废弃");
|
this.$modal.msgWarning("审核废弃");
|
||||||
this.numberInput= true
|
this.numberInput = true
|
||||||
this.$router.push('/oilConfig/oilPurchase/list');
|
this.$router.push('/oilConfig/oilPurchase/list');
|
||||||
}else {
|
} else {
|
||||||
this.$modal.msgWarning("暂无废弃权限");
|
this.$modal.msgWarning("暂无废弃权限");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -935,7 +945,7 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
|
|
||||||
getSecondName(){
|
getSecondName() {
|
||||||
this.$forceUpdate();
|
this.$forceUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -943,26 +953,27 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.app-container{
|
.app-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: #f6f8f9;
|
background: #f6f8f9;
|
||||||
margin: 0px 0px 0px 0px;
|
margin: 0px 0px 0px 0px;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
.box {
|
|
||||||
height: 80%;
|
.box {
|
||||||
width: 212px;
|
height: 80%;
|
||||||
margin-right: 10px;
|
width: 212px;
|
||||||
background: #FFFFFF;
|
margin-right: 10px;
|
||||||
border: 1px solid #FF9655;
|
background: #FFFFFF;
|
||||||
border-radius: 10px;
|
border: 1px solid #FF9655;
|
||||||
display: flex;
|
border-radius: 10px;
|
||||||
flex-direction: column;
|
display: flex;
|
||||||
justify-content: center;
|
flex-direction: column;
|
||||||
align-items: start;
|
justify-content: center;
|
||||||
padding-left: 20px;
|
align-items: start;
|
||||||
}
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -444,7 +444,7 @@ public class FyPayServiceImpl implements FyPayService {
|
|||||||
merchantConfigRecordService.insertMerchantConfigRecord(merchantConfigRecord);
|
merchantConfigRecordService.insertMerchantConfigRecord(merchantConfigRecord);
|
||||||
}
|
}
|
||||||
//推荐会员充值有礼
|
//推荐会员充值有礼
|
||||||
activeRecommendRecordsService.recommendMembersRechargePolite(allOrderInfo.getStoreId(), allOrderInfo.getUserId(), allOrderInfo.getPayType());
|
if (ObjectUtil.isNotEmpty(allOrderInfo.getUserId())) activeRecommendRecordsService.recommendMembersRechargePolite(allOrderInfo.getStoreId(), allOrderInfo.getUserId(), allOrderInfo.getPayType());
|
||||||
}else {
|
}else {
|
||||||
//查询总订单
|
//查询总订单
|
||||||
AllOrderInfo allOrderInfo = allOrderInfoService.selectAllOrderInfoByOrderNo(orderNo);
|
AllOrderInfo allOrderInfo = allOrderInfoService.selectAllOrderInfoByOrderNo(orderNo);
|
||||||
|
@ -120,7 +120,7 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
|
|||||||
queryWrapper.eq("rule_config_id",ruleConfigId);
|
queryWrapper.eq("rule_config_id",ruleConfigId);
|
||||||
List<OilConfig> list = baseMapper.selectList(queryWrapper);
|
List<OilConfig> list = baseMapper.selectList(queryWrapper);
|
||||||
for (OilConfig oilConfig : list) {
|
for (OilConfig oilConfig : list) {
|
||||||
if (oilConfig.getTransactionType().contains(transactionType)){
|
if (ObjectUtil.isNotEmpty(oilConfig.getTransactionType()) && ObjectUtil.isNotEmpty(transactionType) && oilConfig.getTransactionType().contains(transactionType)){
|
||||||
if (transactionType.equals("4")){
|
if (transactionType.equals("4")){
|
||||||
String[] split = oilConfig.getOilGunId().split(",");
|
String[] split = oilConfig.getOilGunId().split(",");
|
||||||
for (String id : split) {
|
for (String id : split) {
|
||||||
|
@ -59,6 +59,10 @@ public class AllOrderInfo extends BaseEntity implements Serializable {
|
|||||||
* 优惠金额
|
* 优惠金额
|
||||||
*/
|
*/
|
||||||
private Double discountAmount;
|
private Double discountAmount;
|
||||||
|
/**
|
||||||
|
* 找零金额
|
||||||
|
*/
|
||||||
|
private Double seekZero;
|
||||||
/**
|
/**
|
||||||
* 支付时间
|
* 支付时间
|
||||||
*/
|
*/
|
||||||
|
@ -727,7 +727,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Double payAmount = map.get("payType").equals("CASH") ? Double.valueOf(map.get("authCode")) : Double.valueOf(map.get("allAmount"));
|
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");
|
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);
|
||||||
@ -1123,7 +1123,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
cashierOrder.setSeekZero(0.0);
|
cashierOrder.setSeekZero(0.0);
|
||||||
cashierOrder.setPayType(map.get("payType"));
|
cashierOrder.setPayType(map.get("payType"));
|
||||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||||
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", status);
|
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", status,0.0);
|
||||||
if (ObjectUtil.isNotEmpty(map.get("staffId")))
|
if (ObjectUtil.isNotEmpty(map.get("staffId")))
|
||||||
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")), storeId, oilAmount, oilAmount, "1", orderNo);
|
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")), storeId, oilAmount, oilAmount, "1", orderNo);
|
||||||
res.put("success", "success");
|
res.put("success", "success");
|
||||||
@ -1194,7 +1194,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
cashierOrder.setPayType(map.get("payType"));
|
cashierOrder.setPayType(map.get("payType"));
|
||||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||||
this.updateGrowthValue1(oilAmount, oilAmount, userId, Integer.valueOf(oilOrder.getOils()), 0.0, storeId, orderNo);
|
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");
|
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", "paid",0.0);
|
||||||
if (ObjectUtil.isNotEmpty(map.get("staffId")))
|
if (ObjectUtil.isNotEmpty(map.get("staffId")))
|
||||||
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")), storeId, oilAmount, oilAmount, "1", orderNo);
|
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")), storeId, oilAmount, oilAmount, "1", orderNo);
|
||||||
res.put("success", "success");
|
res.put("success", "success");
|
||||||
@ -1309,7 +1309,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
cashierOrder.setSeekZero(0.0);
|
cashierOrder.setSeekZero(0.0);
|
||||||
cashierOrder.setPayType(map.get("payType"));
|
cashierOrder.setPayType(map.get("payType"));
|
||||||
cashierOrderService.insertCashierOrder(cashierOrder);
|
cashierOrderService.insertCashierOrder(cashierOrder);
|
||||||
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, 0.0, map.get("payType"), userId, "PC", "1", "paid");
|
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);
|
staffCommissionService.countStaffCommission(accountInfo.getStaffId(), storeId, oilAmount, oilAmount, "1", orderNo);
|
||||||
res.put("success", "success");
|
res.put("success", "success");
|
||||||
|
|
||||||
@ -1377,7 +1377,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
baseMapper.insert(oilOrders);
|
baseMapper.insert(oilOrders);
|
||||||
|
|
||||||
this.updateGrowthValue1(oilAmount, 0.0, userId, Integer.valueOf(oilOrders.getOils()), 0.0, storeId, orderNo);
|
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);
|
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);
|
staffCommissionService.countStaffCommission(accountInfo.getStaffId(), storeId, oilAmount, oilAmount, "1", orderNo);
|
||||||
res.put("success", "success");
|
res.put("success", "success");
|
||||||
} else {
|
} else {
|
||||||
@ -1385,7 +1385,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
oilOrders.setOrderStatus(status);
|
oilOrders.setOrderStatus(status);
|
||||||
|
|
||||||
baseMapper.insert(oilOrders);
|
baseMapper.insert(oilOrders);
|
||||||
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, oilOrders.getPayType(), userId, "POS", "1", "payFail");
|
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, oilOrders.getPayType(), userId, "POS", "1", "payFail",0.0);
|
||||||
res.put("error", "储值卡余额不足!");
|
res.put("error", "储值卡余额不足!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1401,13 +1401,13 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
OilOrder oilOrder = this.selectOilOrderByOrderNo(orderNo);
|
OilOrder oilOrder = this.selectOilOrderByOrderNo(orderNo);
|
||||||
|
|
||||||
this.updateGrowthValue1(oilAmount, oilAmount, userId, Integer.valueOf(oilOrder.getOils()), 0.0, storeId, 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");
|
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);
|
staffCommissionService.countStaffCommission(accountInfo.getStaffId(), storeId, oilAmount, oilAmount, "1", orderNo);
|
||||||
res.put("success", "success");
|
res.put("success", "success");
|
||||||
} else {
|
} else {
|
||||||
oilOrders.setOrderStatus("payFail");
|
oilOrders.setOrderStatus("payFail");
|
||||||
baseMapper.insert(oilOrders);
|
baseMapper.insert(oilOrders);
|
||||||
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, oilOrders.getPayType(), userId, "POS", "1", "payFail");
|
this.insertAllOrderInfo(orderNo, accountInfo.getStoreId(), oilAmount, oilAmount, 0.0, oilOrders.getPayType(), userId, "POS", "1", "payFail",0.0);
|
||||||
res.put("error", "储值卡余额不足!");
|
res.put("error", "储值卡余额不足!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1419,7 +1419,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) {
|
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 allOrderInfo = new AllOrderInfo();
|
||||||
allOrderInfo.setOrderNo(orderNo);
|
allOrderInfo.setOrderNo(orderNo);
|
||||||
allOrderInfo.setType(type);
|
allOrderInfo.setType(type);
|
||||||
@ -1578,7 +1578,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
userId = userVo.getId();
|
userId = userVo.getId();
|
||||||
if (!isUseChild.equals("yes")) {
|
if (!isUseChild.equals("yes")) {
|
||||||
applet.put("error", "不可使用子卡消费!");
|
applet.put("error", "不可使用子卡消费!");
|
||||||
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail");
|
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail",0.0);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1589,7 +1589,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
if (balanceAmount.equals("0") && map.get("payAmount").equals("0")) {
|
if (balanceAmount.equals("0") && map.get("payAmount").equals("0")) {
|
||||||
if (Double.compare(oilCardLiters, oilOrder.getOilNum()) != 0) {
|
if (Double.compare(oilCardLiters, oilOrder.getOilNum()) != 0) {
|
||||||
applet.put("error", "囤油卡消费升数不对!");
|
applet.put("error", "囤油卡消费升数不对!");
|
||||||
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail");
|
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail",0.0);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1597,7 +1597,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
Double residueAmount = useLiters * oilNumber.getOilPrice();
|
Double residueAmount = useLiters * oilNumber.getOilPrice();
|
||||||
if ((Double.valueOf(map.get("payAmount")) + Double.valueOf(balanceAmount) - residueAmount) >= 0.05) {
|
if ((Double.valueOf(map.get("payAmount")) + Double.valueOf(balanceAmount) - residueAmount) >= 0.05) {
|
||||||
applet.put("error", "消费总金额不对!");
|
applet.put("error", "消费总金额不对!");
|
||||||
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail");
|
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail",0.0);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1607,7 +1607,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
Double realAmount = Double.valueOf(map.get("payAmount")) + Double.valueOf(balanceAmount) + Double.valueOf(map.get("discountAmount"));
|
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) {
|
if (-0.03 >= (realAmount - oilOrder.getOrderAmount()) && (realAmount - oilOrder.getOrderAmount()) >= 0.03) {
|
||||||
applet.put("error", "消费总金额不对!");
|
applet.put("error", "消费总金额不对!");
|
||||||
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail");
|
this.insertAllOrderInfo(orderNo, oilOrder.getStoreId(), oilOrder.getOrderAmount(), 0.0, oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId, oilOrder.getPayType(), "1", "payFail",0.0);
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1658,7 +1658,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
this.updateGrowthValue(oilOrder.getOrderAmount(), payAmount, userId, Integer.valueOf(oilOrder.getOils()), oilOrder.getStoreId(), orderNo);
|
this.updateGrowthValue(oilOrder.getOrderAmount(), payAmount, userId, Integer.valueOf(oilOrder.getOils()), oilOrder.getStoreId(), orderNo);
|
||||||
this.addOilTracks(oilOrder, oilOrder.getStoreId());
|
this.addOilTracks(oilOrder, oilOrder.getStoreId());
|
||||||
this.insertCardOrder(oilOrder.getUserId(), oilOrder.getStoreId(), orderNo, oilOrder.getOrderAmount(), "paid", Double.valueOf(balanceAmount), payAmount);
|
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");
|
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.insertCardBalance(Double.valueOf(balanceAmount), userId, oilOrder.getStoreId(), orderNo);
|
||||||
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId()))
|
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId()))
|
||||||
staffCommissionService.countStaffCommission(oilOrder.getStaffId(), oilOrder.getStoreId(), oilOrder.getOrderAmount(), oilOrder.getOrderAmount(), "1", orderNo);
|
staffCommissionService.countStaffCommission(oilOrder.getStaffId(), oilOrder.getStoreId(), oilOrder.getOrderAmount(), oilOrder.getOrderAmount(), "1", orderNo);
|
||||||
@ -2259,7 +2259,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
staffCommissionService.countStaffCommission(nowAccountInfo.getStaffId(), nowAccountInfo.getStoreId(), oilOrderVo.getOrderAmount(), oilOrderVo.getPayAmount(), "1", orderNo);
|
staffCommissionService.countStaffCommission(nowAccountInfo.getStaffId(), nowAccountInfo.getStoreId(), oilOrderVo.getOrderAmount(), oilOrderVo.getPayAmount(), "1", orderNo);
|
||||||
this.addOilTracks(oilOrderVo, nowAccountInfo.getStoreId());
|
this.addOilTracks(oilOrderVo, nowAccountInfo.getStoreId());
|
||||||
this.updateCardAndActiveById(nowAccountInfo.getStoreId(), oilOrderVo.getUserId(), oilOrderVo.getId());
|
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");
|
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());
|
this.insertFavorable(oilOrderVo, oilOrderVo.getOilCardAmount1());
|
||||||
if (ObjectUtil.isNotEmpty(oilOrderVo.getUserId())) integralSettingsService.refuelPoints(oilOrderVo);
|
if (ObjectUtil.isNotEmpty(oilOrderVo.getUserId())) integralSettingsService.refuelPoints(oilOrderVo);
|
||||||
//修改优惠券使用状态
|
//修改优惠券使用状态
|
||||||
|
@ -53,7 +53,7 @@ public class OilInventoryController extends BaseController {
|
|||||||
@GetMapping("getListPage")
|
@GetMapping("getListPage")
|
||||||
public ResponseObject getListPage(@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
public ResponseObject getListPage(@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||||
@Param("oilInventory") OilInventory oilInventory) {
|
@Param("oilInventory") OilInventoryVO oilInventory) {
|
||||||
Page page =new Page(pageNo,pageSize);
|
Page page =new Page(pageNo,pageSize);
|
||||||
IPage<OilInventoryVO> oilInventoryIPage = this.oilInventoryService.getListPage(page, oilInventory);
|
IPage<OilInventoryVO> oilInventoryIPage = this.oilInventoryService.getListPage(page, oilInventory);
|
||||||
return getSuccessResult(oilInventoryIPage);
|
return getSuccessResult(oilInventoryIPage);
|
||||||
|
@ -34,7 +34,7 @@ public interface OilInventoryMapper {
|
|||||||
*/
|
*/
|
||||||
IPage<OilInventory> queryAllByLimit(@Param("page") Page page, @Param("oilInventory") OilInventory oilInventory);
|
IPage<OilInventory> queryAllByLimit(@Param("page") Page page, @Param("oilInventory") OilInventory oilInventory);
|
||||||
|
|
||||||
IPage<OilInventoryVO> getListPage(@Param("page") Page page, @Param("oilInventory") OilInventory oilInventory);
|
IPage<OilInventoryVO> getListPage(@Param("page") Page page, @Param("oilInventory") OilInventoryVO oilInventory);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计总行数
|
* 统计总行数
|
||||||
|
@ -164,6 +164,9 @@
|
|||||||
<if test="oilInventory.inventoryNumber != null and oilInventory.inventoryNumber != ''">
|
<if test="oilInventory.inventoryNumber != null and oilInventory.inventoryNumber != ''">
|
||||||
and op.inventory_number LIKE CONCAT('%', #{oilInventory.inventoryNumber}, '%')
|
and op.inventory_number LIKE CONCAT('%', #{oilInventory.inventoryNumber}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="oilInventory.tankId != null and oilInventory.tankId != ''">
|
||||||
|
and opo.tank_id LIKE CONCAT('%', #{oilInventory.tankId}, '%')
|
||||||
|
</if>
|
||||||
<if test="oilInventory.params.beginTime != null and oilInventory.params.beginTime != ''"><!-- 开始时间检索 -->
|
<if test="oilInventory.params.beginTime != null and oilInventory.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||||
and date_format(op.create_time,'%y%m%d') >= date_format(#{oilInventory.params.beginTime},'%y%m%d')
|
and date_format(op.create_time,'%y%m%d') >= date_format(#{oilInventory.params.beginTime},'%y%m%d')
|
||||||
</if>
|
</if>
|
||||||
|
@ -32,7 +32,7 @@ public interface OilInventoryService {
|
|||||||
*/
|
*/
|
||||||
IPage<OilInventory> queryByPage(@Param("page") Page page, @Param("oilInventory") OilInventory oilInventory);
|
IPage<OilInventory> queryByPage(@Param("page") Page page, @Param("oilInventory") OilInventory oilInventory);
|
||||||
|
|
||||||
IPage<OilInventoryVO> getListPage(@Param("page") Page page, @Param("oilInventory") OilInventory oilInventory);
|
IPage<OilInventoryVO> getListPage(@Param("page") Page page, @Param("oilInventory") OilInventoryVO oilInventory);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增数据
|
* 新增数据
|
||||||
|
@ -62,7 +62,7 @@ public class OilInventoryServiceImpl implements OilInventoryService {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<OilInventoryVO> getListPage(@Param("page") Page page, @Param("oilInventory") OilInventory oilInventory) {
|
public IPage<OilInventoryVO> getListPage(@Param("page") Page page, @Param("oilInventory") OilInventoryVO oilInventory) {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
oilInventory.setStoreId(nowAccountInfo.getStoreId());
|
oilInventory.setStoreId(nowAccountInfo.getStoreId());
|
||||||
|
|
||||||
|
@ -1377,14 +1377,14 @@ export default {
|
|||||||
this.$modal.msgError("请输入正确的金额");
|
this.$modal.msgError("请输入正确的金额");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//找零金额
|
||||||
|
this.payForm.seekZero = this.getChangeShould
|
||||||
}
|
}
|
||||||
if (!this.payForm.authCode && ((+this.oilActualPay) + (+this.goodsActualPay)) > 0) {
|
if (!this.payForm.authCode && ((+this.oilActualPay) + (+this.goodsActualPay)) > 0) {
|
||||||
this.$modal.msgError("请先扫码");
|
this.$modal.msgError("请先扫码");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//找零金额
|
|
||||||
this.payForm.seekZero = this.getChangeShould
|
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let _this = this;
|
let _this = this;
|
||||||
|
Loading…
Reference in New Issue
Block a user