2024-08-16 18:26:19 +08:00
|
|
|
<template>
|
|
|
|
<div class="app-container">
|
2024-11-21 09:49:06 +08:00
|
|
|
<div class="card-change" style="height: 91.4vh;">
|
2024-10-28 13:51:30 +08:00
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
|
|
|
<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"
|
|
|
|
:label="option.supplierName"
|
|
|
|
:value="option.id"
|
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
2024-08-16 18:26:19 +08:00
|
|
|
|
2024-10-28 13:51:30 +08:00
|
|
|
<el-form-item label="" prop="numberId">
|
2024-11-01 11:15:04 +08:00
|
|
|
<el-select v-model="queryParams.numberId" placeholder="请选择油品-油号">
|
2024-10-28 13:51:30 +08:00
|
|
|
<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="请选择状态" clearable>
|
|
|
|
<el-option
|
|
|
|
v-for="dict in dict.type.oilPurchasedStatus"
|
|
|
|
:key="dict.value"
|
|
|
|
:label="dict.label"
|
|
|
|
:value="dict.value"
|
|
|
|
></el-option>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
2024-08-16 18:26:19 +08:00
|
|
|
|
2024-10-28 13:51:30 +08:00
|
|
|
<el-form-item label="">
|
|
|
|
<el-date-picker
|
|
|
|
v-model="beginTime"
|
|
|
|
style="width: 160px"
|
|
|
|
type="date"
|
|
|
|
placeholder="开始日期">
|
|
|
|
</el-date-picker>
|
2024-11-01 11:15:04 +08:00
|
|
|
~
|
2024-10-28 13:51:30 +08:00
|
|
|
<el-date-picker
|
|
|
|
v-model="endTime"
|
|
|
|
style="width: 160px"
|
|
|
|
type="date"
|
|
|
|
placeholder="结束日期">
|
|
|
|
</el-date-picker>
|
|
|
|
</el-form-item>
|
2024-10-31 09:22:25 +08:00
|
|
|
<el-form-item style="float: right;margin-right: 0px" >
|
2024-10-28 13:51:30 +08:00
|
|
|
<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"
|
|
|
|
@click="purchaseAdd"
|
|
|
|
v-hasPermi="['oilConfig:oilPurchase:list:add']"
|
|
|
|
>新增采购
|
|
|
|
</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
2024-11-21 09:49:06 +08:00
|
|
|
<div style="height: 75vh;overflow: auto;scrollbar-width: none">
|
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"/>
|
2024-11-01 11:15:04 +08:00
|
|
|
<el-table-column label="进货单号" align="center" width="150px" prop="purchaseNo"/>
|
2024-10-25 17:51:00 +08:00
|
|
|
<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>
|
2024-11-01 11:15:04 +08:00
|
|
|
<div style="color: #0DC291" v-if="scope.row.status == 'qrts'">已入库</div>
|
2024-10-25 17:51:00 +08:00
|
|
|
<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)"
|
2024-11-11 16:00:06 +08:00
|
|
|
>采购审核
|
2024-10-25 17:51:00 +08:00
|
|
|
</el-button>
|
|
|
|
<el-button
|
|
|
|
size="mini"
|
|
|
|
type="text"
|
|
|
|
v-else-if="scope.row.status == 'ysh'"
|
|
|
|
@click="dispose(scope.row)"
|
2024-11-11 16:00:06 +08:00
|
|
|
>油品入库
|
2024-10-25 17:51:00 +08:00
|
|
|
</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() {
|
2024-11-21 09:49:06 +08:00
|
|
|
this.query={}
|
2024-08-16 18:26:19 +08:00
|
|
|
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-31 09:22:25 +08:00
|
|
|
margin-right: 10px;
|
2024-08-16 18:26:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|