This commit is contained in:
cun-nan 2024-10-25 16:41:51 +08:00
parent 3937a4d0f2
commit 42b9df78a8
5 changed files with 87 additions and 28 deletions

View File

@ -2,9 +2,11 @@
<div class="app-container">
<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="supplierName">
<el-select v-model="queryParams.supplierId" placeholder="供应商名称" style="width:100%" clearable
>
<el-form-item label="" prop="purchaseNo">
<el-input v-model="queryParams.purchaseNo" placeholder="请输入进货单号" />
</el-form-item>
<el-form-item label="" prop="supplierId">
<el-select v-model="queryParams.supplierId" placeholder="请选择供应商" clearable>
<el-option
v-for="option in suppliersList"
:key="option.id"
@ -14,14 +16,18 @@
</el-select>
</el-form-item>
<el-form-item label="" prop="tankName">
<el-input v-model="queryParams.tankName" placeholder="油罐名称" />
<el-form-item label="" prop="numberId">
<el-select v-model="queryParams.numberId" placeholder="请选择油品油号" >
<el-option
v-for="option in selectOilTypeByPrice"
:key="option.numberId"
:label="option.oilType +' '+option.oilName"
:value="option.numberId"
></el-option>
</el-select>
</el-form-item>
<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="请选择状态" clearable>
<el-option
v-for="dict in dict.type.oilPurchasedStatus"
:key="dict.value"
@ -30,26 +36,31 @@
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="日期选择" prop="status">-->
<!-- <el-date-picker-->
<!-- v-model="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;margin-right: 0px">
<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="purchaseAdd"
v-hasPermi="['oilConfig:oilPurchase:list:add']"
>添加采购</el-button>
>新增采购</el-button>
</el-form-item>
</el-form>
@ -58,6 +69,7 @@
:data="purchaseList"
border
:default-sort="defaultSort">
<el-table-column label="序号" align="center" type="index"/>
<el-table-column label="进货单号" align="center" prop="purchaseNo"/>
<el-table-column label="供应商" align="center" prop="supplierss"/>
<el-table-column label="油品-油号" align="center" prop="oils"/>
@ -66,10 +78,10 @@
<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 style="color: #FF770F" v-if="scope.row.status == 'await'">待审核</div>
<div style="color: #0DC291" v-if="scope.row.status == 'qrts'">已审核入库</div>
<div style="color: #F44522" v-if="scope.row.status == 'yzf'">已作废</div>
<div style="color: #00CAFF" v-if="scope.row.status == 'ysh'">已审核</div>
</div>
</template>
</el-table-column>
@ -96,9 +108,21 @@
<el-button
size="mini"
type="text"
icon="el-icon-edit"
v-if="scope.row.status == 'await'"
@click="dispose(scope.row)"
>{{ scope.row.status == 'qrts'?'查看单据':'处理单据' }}</el-button>
>油品入库</el-button>
<el-button
size="mini"
type="text"
v-else-if="scope.row.status == 'ysh'"
@click="dispose(scope.row)"
>采购审核</el-button>
<el-button
size="mini"
type="text"
v-else
@click="dispose(scope.row)"
>查看详情</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
@ -127,6 +151,7 @@
import {getPurchaseApi, getPurchaseOrderApi} from "@/api/oilConfig/oilPurchase";
import {getSuppliersListApi2} from "@/api/oilConfig/oilSuppliers";
import {getName,parseTime} from "../../../utils/fuint";
import {getOilNameListApi} from "@/api/oilPrice";
export default {
@ -156,6 +181,9 @@ export default {
page:null,
pageSize:null
},
selectOilTypeByPrice:[],
beginTime: "",
endTime: "",
//
loading: false,
//
@ -172,12 +200,25 @@ export default {
async created() {
await this.getList();
this.selectSuppliers();
this.getOilNameList();
},
methods: {
getOilNameList() {
var this_ = this
getOilNameListApi().then(response => {
var list = response.data
this_.selectOilTypeByPrice = list
});
},
//
getList(){
this.loading = true;
getPurchaseApi(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())
}
getPurchaseApi(this.addDateRange(this.queryParams, dateRange)).then(response => {
this.purchaseList = response.data.records;
console.log("this.tankList",this.purchaseList)
this.total = response.data.total;
@ -221,6 +262,8 @@ export default {
page:null,
pageSize:null
};
this.beginTime = ''
this.endTime = ''
this.getList();
},
}

View File

@ -45,6 +45,8 @@ public class OilNumber extends BaseEntity {
public String amplitudeOfChange; //涨幅
@TableField(exist = false)
public String oilNames;
@TableField(exist = false)
public String oilNameId;
/**
* 创建人
*/

View File

@ -126,7 +126,8 @@
</delete>
<select id="getOilName" resultType="com.fuint.business.petrolStationManagement.entity.OilNumber">
select name.id id, onm.number_id numberId,name.oil_name oilName, name.oil_type oilType,onm.oil_price oilPrice ,onm.gb_price gbPrice, name.oil_density oilDensity,onm.unit unit
select name.id id, onm.number_id numberId,name.oil_name oilName, name.oil_type oilType,onm.oil_price oilPrice ,onm.gb_price gbPrice,
name.oil_density oilDensity,onm.unit unit,name.id oilNameId
from oil_number onm
left join oil_name name on onm.oil_name = name.id
<where>

View File

@ -183,9 +183,21 @@
<if test="oilPurchase.supplierId != null and oilPurchase.supplierId != ''">
and opo.supplier_id = #{oilPurchase.supplierId}
</if>
<if test="oilPurchase.numberId != null and oilPurchase.numberId != ''">
and opo.number_id = #{oilPurchase.numberId}
</if>
<if test="oilPurchase.purchaseNo != null and oilPurchase.purchaseNo != ''">
and op.purchase_no LIKE CONCAT('%', #{oilPurchase.purchaseNo}, '%')
</if>
<if test="oilPurchase.tankName != null and oilPurchase.tankName != ''">
and ot.tank_name LIKE CONCAT('%', #{oilPurchase.tankName}, '%')
</if>
<if test="oilPurchase.params.beginTime != null and oilPurchase.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(op.created_at,'%y%m%d') &gt;= date_format(#{oilPurchase.params.beginTime},'%y%m%d')
</if>
<if test="oilPurchase.params.endTime != null and oilPurchase.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(op.created_at,'%y%m%d') &lt;= date_format(#{oilPurchase.params.endTime},'%y%m%d')
</if>
</where>
group by op.id
order by op.create_time desc

View File

@ -10,4 +10,5 @@ public class OilPurchaseVO extends OilPurchase {
private String tanks;
private String creatorName;
private String reviewerName;
private String numberId;
}