Browse Source

feat(inspection): 优化验货申请列表界面并新增我的验货清单查询功能

- 将审核链接从el-link替换为自定义class的a标签以统一样式
- 更新已审核状态显示逻辑,直接展示当前状态值
- 新增getMyInspectionList API接口用于查询我的验货清单
- 在检验申请单表格配置中添加计划验货日期列设置
- 移除登录页面的公司logo图片展示
- 优化表格列配置的数据结构和排序逻辑
master
qiankanghui 5 months ago
parent
commit
4efb966091
  1. 3
      src/api/inspection/inspectionRequestHeader.js
  2. 3
      src/views/common/login.vue
  3. 7
      src/views/modules/inspection/inspectionRequestAudit.vue
  4. 37
      src/views/modules/inspection/inspectionRequestList.vue
  5. 161
      src/views/modules/inspection/myInspectionList.vue

3
src/api/inspection/inspectionRequestHeader.js

@ -51,3 +51,6 @@ export const getScheduleView = (qcOperator) => createAPI(`/inspection/scheduleVi
// 修改验货申请(仅允许修改建议验货日期、验货地址和联系人)
export const updateInspectionRequest = (data) => createAPI(`/inspection/update`, 'post', data)
// 查询我的验货清单
export const getMyInspectionList = (data) => createAPI(`/inspection/getMyInspectionList`, 'post', data)

3
src/views/common/login.vue

@ -4,9 +4,6 @@
<div class="login-bg"></div>
<div style="width: 35%">
<div style="height: 27vh;">
<div style="text-align: right;padding: 0px 20px">
<img width="60%" height="72" style="object-fit: contain" src="~@/assets/img/xj.png">
</div>
</div>
<div style="padding: 30px 130px">
<h3 class="login-title">用户登录</h3>

7
src/views/modules/inspection/inspectionRequestAudit.vue

@ -72,11 +72,10 @@
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-link v-if="scope.row.status === '已确认' || scope.row.statusDb === 'Confirmed'"
style="cursor: pointer; color: #409EFF; margin-right: 10px;"
@click="auditInspection(scope.row)">审核</el-link>
<a v-if="scope.row.status === '已确认' || scope.row.statusDb === 'Confirmed'"
class="customer-a" @click="auditInspection(scope.row)">审核 </a>
<span v-if="scope.row.status === '已审核' || scope.row.statusDb === 'Audited'"
style="color: #909399;">已审核</span>
style="color: #909399;">{{ scope.row.status }}</span>
</template>
</el-table-column>
</el-table>

37
src/views/modules/inspection/inspectionRequestList.vue

@ -463,6 +463,24 @@ export default {
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: 'InspectionTable1PlanStartDate',
tableId: 'InspectionTable1',
tableName: '检验申请单',
columnProp: 'planStartDate',
headerAlign: 'center',
align: 'center',
columnLabel: '计划验货日期',
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
@ -607,24 +625,7 @@ export default {
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: 'InspectionTable1PlanStartDate',
tableId: 'InspectionTable1',
tableName: '检验申请单',
columnProp: 'planStartDate',
headerAlign: 'center',
align: 'center',
columnLabel: '计划验货日期',
columnWidth: '120',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,

161
src/views/modules/inspection/myInspectionList.vue

@ -0,0 +1,161 @@
<template>
<div class="customer-css">
<!-- 列表 -->
<el-table
:data="dataList"
:height="height"
border
highlight-current-row
v-loading="loading"
style="width: 100%">
<el-table-column prop="requestNo" label="申请单号" header-align="center" align="left" min-width="150" show-overflow-tooltip/>
<el-table-column prop="orderRef1" label="PO号" header-align="center" align="left" min-width="150" show-overflow-tooltip/>
<el-table-column prop="supplierNo" label="供应商编码" header-align="center" align="left" min-width="120" show-overflow-tooltip/>
<el-table-column prop="supplierName" label="供应商名称" header-align="center" align="left" min-width="200" show-overflow-tooltip/>
<el-table-column prop="partNo" label="产品编码" header-align="center" align="left" min-width="150" show-overflow-tooltip/>
<el-table-column prop="partDesc" label="产品名称" header-align="center" align="left" min-width="150" show-overflow-tooltip/>
<el-table-column prop="qty" label="验货数量" header-align="center" align="right" width="120"/>
<el-table-column prop="status" label="状态" header-align="center" align="center" width="100">
<template slot-scope="scope">
{{ getStatusText(scope.row.statusDb) }}
</template>
</el-table-column>
<el-table-column prop="needInspectDate" label="建议验货日期" header-align="center" align="center" width="120"/>
<el-table-column prop="planStartDate" label="计划开始日期" header-align="center" align="center" width="120"/>
<el-table-column prop="planEndDate" label="计划结束日期" header-align="center" align="center" width="120"/>
<el-table-column prop="qcOperator" label="QC人员" header-align="center" align="center" width="100"/>
<el-table-column prop="inspectAddress" label="验货地址" header-align="center" align="left" min-width="150" show-overflow-tooltip/>
<el-table-column prop="inspectContract" label="联系人" header-align="center" align="center" width="100"/>
<el-table-column fixed="right" header-align="center" align="center" width="120" label="操作">
<template slot-scope="scope">
<a class="customer-a" @click="startInspection(scope.row)">开始验货</a>
</template>
</el-table-column>
</el-table>
<!-- 分页插件 -->
<el-pagination
style="margin-top: 10px"
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</div>
</template>
<script>
import { getMyInspectionList } from '@/api/inspection/inspectionRequestHeader.js'
export default {
components: {
},
name: 'MyInspectionList',
data () {
return {
height: 400,
loading: false,
dataList: [],
pageIndex: 1,
pageSize: 50,
totalPage: 0,
searchData: {
page: 1,
limit: 50
}
}
},
mounted () {
this.calcHeight()
window.addEventListener('resize', this.calcHeight)
this.getList()
},
beforeDestroy () {
window.removeEventListener('resize', this.calcHeight)
},
methods: {
// 计算表格高度
calcHeight () {
this.$nextTick(() => {
this.height = window.innerHeight - 120
})
},
// 获取列表数据
getList () {
this.loading = true
this.searchData.page = this.pageIndex
this.searchData.limit = this.pageSize
getMyInspectionList(this.searchData).then(({ data }) => {
if (data.code === 0) {
this.dataList = data.page.list || []
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
} else {
this.$message.error((data && data.msg) || '获取列表失败')
}
this.loading = false
}).catch(() => {
this.loading = false
})
},
// 每页条数变化
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getList()
},
// 当前页变化
currentChangeHandle (val) {
this.pageIndex = val
this.getList()
},
// 状态转换
getStatusText (statusDb) {
const statusMap = {
'Draft': '草稿',
'Confirmed': '已确认',
'Scheduled': '已排程',
'Audited': '已审核',
'Inspected': '已验货',
'Completed': '已完成',
'Cancelled': '已取消'
}
return statusMap[statusDb] || statusDb || '-'
},
// 开始验货
startInspection (row) {
// TODO: 实现开始验货逻辑
console.log('开始验货:', row)
}
}
}
</script>
<style scoped lang="scss">
.customer-css {
padding: 5px;
height: calc(100vh - 60px);
display: flex;
flex-direction: column;
}
::v-deep .el-table {
flex: 1;
}
::v-deep .el-pagination {
margin-top: 5px;
flex-shrink: 0;
}
</style>
Loading…
Cancel
Save