代码提交

This commit is contained in:
jiang 2025-11-15 21:56:50 +08:00
parent 1e045e262d
commit 2a7b932a72
1 changed files with 188 additions and 6 deletions

View File

@ -1,11 +1,193 @@
<script setup>
</script>
<template>
<!-- 基础页面 -->
<div class="app-container">
<el-card v-show="showSearch" style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" size="small" inline @submit.native.prevent>
<el-form-item label="工程名称" prop="proName">
<el-input
v-model="queryParams.proName"
placeholder="请输入工程名称"
clearable
@keyup.enter.native="handleQuery"
style="width: 240px"
/>
</el-form-item>
<!-- 日期范围 -->
<el-form-item label="申请日期">
<el-date-picker
v-model="timeRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable
unlink-panels
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="任务状态" prop="taskStatus">
<el-select
v-model="queryParams.taskStatus"
placeholder="请选择任务状态"
clearable
filterable
style="width: 240px"
>
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
<!-- 表单按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card>
<el-table
v-loading="isLoading"
:data="tableList"
highlight-current-row
border
stripe
:max-height="650"
style="width: 100%"
>
<el-table-column
type="index"
width="55"
label="序号"
align="center"
:index="(index) => (queryParams.pageNum - 1) * queryParams.pageSize + index + 1"
/>
<el-table-column
v-for="(column, index) in tableColumns"
show-overflow-tooltip
:key="index"
:label="column.label"
:prop="column.prop"
align="center"
>
<!-- 插槽 -->
<template v-slot="{ row }" v-if="column.prop == 'taskStatus'">
<el-tag v-if="row.taskStatus == '1'" type="warning">待出库</el-tag>
<el-tag v-if="row.taskStatus == '2'" type="warning">出库中</el-tag>
<el-tag v-if="row.taskStatus == '3'" type="success">完成出库</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="{ row }">
<el-button size="mini" type="text" @click="handleApprove(row)"
>查看
</el-button
>
<el-button v-if="row.taskStatus != '3'" size="mini" type="text" @click="handleView(row)">出库</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
</div>
</template>
<style scoped lang="scss">
<script>
import { getOutboundList } from '@/api/business/outbound'
</style>
export default {
name: 'ApproveList',
data() {
return {
isLoading: false,
showSearch: true,
timeRange: [],
queryParams: {
pageNum: 1,
pageSize: 10,
status: null,
proName: null,
startTime: null,
endTime: null
},
statusList: [
{ label: '待出库', value: '1' },
{ label: '出库中', value: '2' },
{ label: '完成出库', value: '3' }
],
total: 0, //
//
tableColumns: [
{ label: '申请单号', prop: 'code' },
{ label: '项目名称', prop: 'proName' },
{ label: '申请装备数', prop: 'devNum' },
{ label: '申请工具数', prop: 'toolNum' },
{ label: '任务状态', prop: 'taskStatus' },
{ label: '申请人', prop: 'createBy' },
{ label: '申请时间', prop: 'createTime' }
],
//
tableList: []
}
},
created() {
this.getList()
},
methods: {
//
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
//
handleReset() {
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.queryParams.parentId = '0'
this.queryParams.level = '1'
this.timeRange = []
this.$refs.queryForm.resetFields()
this.getList()
},
//
async getList() {
console.log('列表-查询', this.queryParams)
this.isLoading = true
this.queryParams.startTime = this.timeRange && this.timeRange[0] ? this.timeRange[0] : null
this.queryParams.endTime = this.timeRange && this.timeRange[1] ? this.timeRange[1] : null
try {
const params = { ...this.queryParams }
const res = await getOutboundList(params)
this.tableList = res.rows || []
this.total = res.total || 0
} catch (error) {
this.tableList = []
this.total = 0
} finally {
this.isLoading = false
}
},
//
handleView(row) {
this.$router.push({ path: '/business/outbound/details', query: { id: row.id, isView: true } })
},
//
handleApprove(row) {
this.$router.push({ path: '/business/outbound/details', query: { id: row.id } })
}
}
}
</script>
<style lang="scss" scoped></style>