oil-station/fuintAdmin/src/views/oilConfig/oilPurchase/list.vue

336 lines
9.9 KiB
Vue
Raw Normal View History

2024-08-16 18:26:19 +08:00
<template>
<div class="app-container">
2024-10-25 17:51:00 +08:00
<div class="card-change">
2024-10-28 09:35:42 +08:00
<div class="box-gang">
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<div class="size-bole">0/0</div>
</el-tooltip>
<div class="size-hui">
<div class="dian" style="background: #0DC291"></div>
<div class="nei">采购吨数</div>
</div>
</div>
2024-08-16 18:26:19 +08:00
2024-10-28 09:35:42 +08:00
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<div class="size-bole" style="color: #00CAFF">0/0</div>
</el-tooltip>
<div class="size-hui">
<div class="dian" style="background: #00CAFF"></div>
<div class="nei">采购升数</div>
</div>
</div>
<div class="box">
<el-tooltip class="item" effect="dark" content="999999/999999999999" placement="top-start">
<div class="size-bole">0/0</div>
</el-tooltip>
<div class="size-hui">
<div class="dian" style="background: #0DC291"></div>
<div class="nei">采购总额</div>
</div>
</div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<div>
<el-form-item label="进货单号" prop="purchaseNo">
<el-input v-model="queryParams.purchaseNo" placeholder="请输入进货单号"/>
</el-form-item>
</div>
<div>
<el-form-item label="进货时间" prop="purchaseNo">
<el-date-picker
v-model="beginTime"
style="width: 200px"
type="date"
placeholder="开始日期">
</el-date-picker>
</el-form-item>
</div>
</el-form>
<div>
<el-button type="primary" >取消</el-button>
<el-button type="primary">保存</el-button>
<el-button type="primary">保存并审核</el-button>
</div>
2024-08-16 18:26:19 +08:00
2024-10-28 09:35:42 +08:00
</div>
<el-button
type="primary"
@click="purchaseAdd"
>新增采购
</el-button>
2024-08-16 18:26:19 +08:00
2024-10-28 09:35:42 +08:00
<div style="height: 70vh;overflow: auto;scrollbar-width: none">
2024-08-16 18:26:19 +08:00
2024-10-25 17:51:00 +08:00
<el-table ref="tables"
v-loading="loading"
: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"/>
<el-table-column label="入库油罐" align="center" prop="tanks"/>
<el-table-column label="单据金额" align="center" prop="theDocumentAmount"/>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<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>
<el-table-column label="制单人" align="center" prop="creatorName"/>
<el-table-column label="审核人" align="center" prop="reviewerName"/>
<el-table-column label="入库人" align="center" prop="reviewerName"/>
<el-table-column label="制单时间" align="center" prop="createdAt" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdAt) }}</span>
</template>
</el-table-column>
<el-table-column label="审核时间" align="center" prop="createdAt" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdAt) }}</span>
</template>
</el-table-column>
<el-table-column label="入库时间" align="center" prop="createdAt" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdAt) }}</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 == 'await'"
@click="dispose(scope.row)"
>油品入库
</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"-->
<!-- icon="el-icon-copy-document"-->
<!-- @click="handleDel(scope.row.id)"-->
<!-- >删除</el-button>-->
<!-- v-hasPermi="['']"-->
</template>
</el-table-column>
</el-table>
</div>
2024-08-16 18:26:19 +08:00
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</div>
</template>
<script>
import {getPurchaseApi, getPurchaseOrderApi} from "@/api/oilConfig/oilPurchase";
import {getSuppliersListApi2} from "@/api/oilConfig/oilSuppliers";
2024-10-25 17:51:00 +08:00
import {getName, parseTime} from "../../../utils/fuint";
2024-10-25 16:41:51 +08:00
import {getOilNameListApi} from "@/api/oilPrice";
2024-08-16 18:26:19 +08:00
export default {
name: "list",
dicts: ['oilPurchasedStatus'],
data() {
return {
purchaseList: [],
suppliersList: [],
// 弹出框标题
2024-10-25 17:51:00 +08:00
title: '',
2024-08-16 18:26:19 +08:00
// 显示搜索条件
showSearch: true,
disableInput: false, // 默认不禁用
// 是否显示弹出层
open: false,
// 总条数
total: 0,
dateRange: '',
// 查询参数
queryParams: {
supplierId: '',
tankName: '',
status: '',
2024-10-25 17:51:00 +08:00
page: null,
pageSize: null
2024-08-16 18:26:19 +08:00
},
2024-10-25 17:51:00 +08:00
selectOilTypeByPrice: [],
2024-10-25 16:41:51 +08:00
beginTime: "",
endTime: "",
2024-08-16 18:26:19 +08:00
// 遮罩层
loading: false,
// 默认排序
defaultSort: {prop: 'createTime', order: 'descending'},
// 表单校验
rules: {
supplierName: [
2024-10-25 17:51:00 +08:00
{required: true, message: "供应商名称不能为空", trigger: "blur"},
2024-08-16 18:26:19 +08:00
],
}
}
},
async created() {
await this.getList();
this.selectSuppliers();
2024-10-25 16:41:51 +08:00
this.getOilNameList();
2024-08-16 18:26:19 +08:00
},
methods: {
2024-10-25 16:41:51 +08:00
getOilNameList() {
var this_ = this
getOilNameListApi().then(response => {
var list = response.data
this_.selectOilTypeByPrice = list
});
},
2024-08-16 18:26:19 +08:00
// 获取列表
2024-10-25 17:51:00 +08:00
getList() {
2024-08-16 18:26:19 +08:00
this.loading = true;
2024-10-25 16:41:51 +08:00
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 => {
2024-08-16 18:26:19 +08:00
this.purchaseList = response.data.records;
2024-10-25 17:51:00 +08:00
console.log("this.tankList", this.purchaseList)
2024-08-16 18:26:19 +08:00
this.total = response.data.total;
})
this.loading = false;
},
// 添加采购
purchaseAdd() {
this.$router.push('/oilPurchase/purchaseOrder');
},
// 处理单据
dispose(data) {
this.$router.push({
path: '/oilPurchase/purchaseOrder',
query: {
purchaseId: data.id,
purchaseNo: data.purchaseNo,
purchaseDate: data.purchaseDate,
state: data.status
}
});
},
handleDel(data) {
},
// 查询所有供应商
selectSuppliers() {
getSuppliersListApi2().then(response => {
this.suppliersList = response.data;
});
},
// 搜索按钮操作
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
resetQuery() {
this.queryParams = {
supplierId: '',
tankName: '',
status: '',
2024-10-25 17:51:00 +08:00
page: null,
pageSize: null
2024-08-16 18:26:19 +08:00
};
2024-10-25 16:41:51 +08:00
this.beginTime = ''
this.endTime = ''
2024-08-16 18:26:19 +08:00
this.getList();
},
}
}
</script>
<style scoped lang="scss">
2024-10-25 17:51:00 +08:00
.app-container {
2024-08-16 18:26:19 +08:00
width: 100%;
height: 100%;
background: #f6f8f9;
}
2024-10-25 17:51:00 +08:00
2024-08-16 18:26:19 +08:00
.el-form--inline .el-form-item {
2024-10-28 09:35:42 +08:00
margin-right: 4px;
}
.box-gang{
width: 100%;
display: flex;
align-items: center;
}
.box{
padding: 5px;
padding-left: 20px;
width: 280px;
height: 60px;
background:#fff;
border-radius: 10px;
border: 1px solid #FF9655;
margin-right: 15px;
2024-08-16 18:26:19 +08:00
}
2024-10-28 09:35:42 +08:00
.size-hui{
display: flex;
align-items: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 13px;
color: #888888;
text-align: left;
font-style: normal;
text-transform: none;
2024-08-16 18:26:19 +08:00
2024-10-28 09:35:42 +08:00
.nei {
color: #333333;
width: 100%;
}
}
.dian{
width: 6px;
height: 6px;
border-radius: 50%;
margin-right: 5px;
}
.size-bole{
height: 31px;
font-size: 24px;
color: #0DC291;
font-weight: 600;
font-size: 24px;
text-align: left;
font-style: normal;
text-transform: none;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
2024-08-16 18:26:19 +08:00
</style>