<template>
|
<div class="app-container">
|
<div class="search_form">
|
<el-form :model="searchForm"
|
:inline="true">
|
<el-form-item label="退料单号:">
|
<el-input v-model="searchForm.no"
|
placeholder="请输入"
|
clearable
|
prefix-icon="Search"
|
@change="handleQuery" />
|
</el-form-item>
|
|
<el-form-item>
|
<el-button type="primary"
|
@click="handleQuery"> 搜索 </el-button>
|
</el-form-item>
|
</el-form>
|
|
<div>
|
<el-button type="primary" @click="isShowNewModal = true">新增</el-button>
|
</div>
|
</div>
|
|
<div class="table_list">
|
<el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange" :row-key="row => row.id" style="width: 100%" height="calc(100vh - 18.5em)">
|
<el-table-column align="center" type="selection" width="55" />
|
<el-table-column align="center" label="序号" type="index" width="60" />
|
<el-table-column label="退料单号" prop="no" show-overflow-tooltip />
|
<el-table-column label="退货方式" prop="returnType" show-overflow-tooltip />
|
<el-table-column label="供应商名称" prop="supplierName" show-overflow-tooltip />
|
<el-table-column label="关联单号" prop="purchaseContractNumber" show-overflow-tooltip />
|
<el-table-column label="退料人" prop="returnUserName" show-overflow-tooltip />
|
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
<el-table-column label="创建人" prop="createUserName" show-overflow-tooltip />
|
<el-table-column label="创建时间" prop="createTime" show-overflow-tooltip />
|
<el-table-column label="最近更新时间" prop="updateTime" show-overflow-tooltip />
|
<el-table-column fixed="right" label="操作" min-width="60" align="center">
|
<template #default="scope">
|
<el-button link type="primary" size="small">详情</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper"
|
:page="page.current" :limit="page.size" @pagination="paginationChange" />
|
</div>
|
<new v-if="isShowNewModal"
|
v-model:visible="isShowNewModal"
|
@completed="handleQuery" />
|
</div>
|
</template>
|
|
<script setup>
|
import pagination from '@/components/PIMTable/Pagination.vue'
|
import { ref, reactive, toRefs, onMounted } from 'vue'
|
import {findPurchaseReturnOrderListPage} from "@/api/procurementManagement/purchase_return_order.js";
|
const New = defineAsyncComponent(() => import("@/views/procurementManagement/purchaseReturnOrder/New.vue"));
|
const tableData = ref([])
|
const selectedRows = ref([])
|
const tableLoading = ref(false)
|
const page = reactive({
|
current: 1,
|
size: 100,
|
})
|
const total = ref(0)
|
// 是否显示新增弹框
|
const isShowNewModal = ref(false)
|
const data = reactive({
|
searchForm: {
|
no: '',
|
}
|
})
|
const { searchForm } = toRefs(data)
|
|
// 查询列表
|
/** 搜索按钮操作 */
|
const handleQuery = () => {
|
page.current = 1
|
getList()
|
}
|
|
const paginationChange = (obj) => {
|
page.current = obj.page;
|
page.size = obj.limit;
|
getList()
|
}
|
|
const getList = () => {
|
tableLoading.value = true
|
findPurchaseReturnOrderListPage({ ...searchForm.value, ...page }).then(res => {
|
tableLoading.value = false
|
tableData.value = res.data.records
|
total.value = res.data.total
|
}).catch(() => {
|
tableLoading.value = false
|
})
|
}
|
|
// 表格选择数据
|
const handleSelectionChange = (selection) => {
|
// 过滤掉子数据
|
selectedRows.value = selection.filter(item => item.id);
|
}
|
|
onMounted(() => {
|
getList()
|
})
|
</script>
|