材料站-班组进出场查询,已出库删除

This commit is contained in:
bb_pan 2025-09-12 18:27:07 +08:00
parent fe36a85935
commit d1a2600574
4 changed files with 226 additions and 11 deletions

View File

@ -284,10 +284,11 @@ export function getPickListApi(data) {
}
// 领料申请-删除
export function applyRemove(ids) {
export function applyRemove(data) {
return request({
url: '/material/material_lease_apply_info/' + ids,
method: 'delete'
url: '/material/material_lease_apply_info/delete',
method: 'post',
data
})
}
@ -700,4 +701,13 @@ export function getProTotalListApi(data) {
method: 'get',
params: data
})
}
// 班组进出场查询
export function getTeamInOrOutInfoApi(data) {
return request({
url: '/material/material_maMachine/getTeamInOrOutInfo',
method: 'get',
params: data
})
}

View File

@ -0,0 +1,202 @@
<template>
<!-- 基础页面 -->
<div class="app-container">
<el-form v-show="showSearch" :model="queryParams" ref="queryForm" size="small" inline @submit.native.prevent>
<el-form-item label="工程名称" prop="proId">
<el-select
v-model="queryParams.proId"
placeholder="请选择工程名称"
filterable
style="width: 240px"
@change="changePro"
>
<el-option v-for="(item, index) in projectList" :key="index" :label="item.proName" :value="item.proId" />
</el-select>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
@keyup.enter.native="handleQuery"
style="width: 240px"
/>
</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-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出数据</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
</el-row>
<el-table :data="tableList" fit highlight-current-row style="width: 100%" v-loading="isLoading" :max-height="650">
<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="!column.unShowTooltip"
:width="column.width"
:key="index"
:label="column.label"
:prop="column.prop"
align="center"
>
<!-- 插槽 -->
<template v-slot="{ row }" v-if="column.prop == 'teamStatus'">
<el-tag v-if="row.teamStatus == 1" type="info">空闲</el-tag>
<el-tag v-else-if="row.teamStatus == 2" type="success">申报</el-tag>
<el-tag v-else-if="row.teamStatus == 3">进场</el-tag>
</template>
<template v-slot="{ row }" v-else-if="column.prop == 'isDismiss'">
<el-tag v-if="row.isDismiss == 0"></el-tag>
<el-tag v-else type="danger"></el-tag>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { getTeamInOrOutInfoApi, getListProject } from '@/api/materialsStation'
export default {
data() {
return {
isLoading: false,
showSearch: true,
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord: '', //
proId: '',
startTime: '', //
endTime: '', //
},
total: 0, //
//
tableColumns: [
{ label: '工程名称', prop: 'projectName', unShowTooltip: true },
{ label: '班组分包名称', prop: 'subcontractor', unShowTooltip: true },
{ label: '班组名称', prop: 'teamName' },
{ label: '班组状态', prop: 'teamStatus', width: 120 },
{ label: '是否解散', prop: 'isDismiss', width: 120 },
{ label: '实际进场时间', prop: 'actualProcessTime', width: 150 },
{ label: '实际出场时间', prop: 'actualExitTime', width: 150 }
],
//
tableList: [],
projectList: []
}
},
created() {
this.projectInfoList()
},
methods: {
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${y}-${m}-${day}`
},
//
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
//
handleReset() {
this.queryParams.keyWord = ''
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.tableList = []
this.getList()
},
changePro() {
this.getList()
},
/** 工程-下拉选 */
async projectInfoList() {
try {
const res = await getListProject({ unitId: null, isApp: true })
if (res.data.length === 0) return
this.projectList = res.data
this.queryParams.proId = res.data[0].proId
console.log('🚀 ~ projectInfoList ~ this.queryParams.proId:', this.queryParams.proId)
this.getList()
} catch (error) {
console.log('🚀 ~ projectInfoList ~ error:', error)
}
},
//
async getList() {
console.log('列表-查询', this.queryParams)
this.isLoading = true
try {
const params = {
...this.queryParams,
startTime: this.queryParams.timeRange ? this.queryParams.timeRange[0] : '',
endTime: this.queryParams.timeRange ? this.queryParams.timeRange[1] : ''
}
delete params.timeRange
console.log('🚀 ~ getList ~ params:', params)
const res = await getTeamInOrOutInfoApi(params)
console.log('🚀 ~ 获取列表 ~ res:', res)
this.tableList = res.data.rows || []
this.total = res.data.total || 0
} catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error)
this.tableList = []
this.total = 0
} finally {
this.isLoading = false
}
},
//
formatTime(date) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}${month}${day}_${hours}${minutes}${seconds}`
},
//
handleExport() {
try {
let fileName = `班组进出场查询_${this.formatTime(new Date())}.xLsx`
let url = '/material/material_maMachine/exportTeamInOrOutInfo'
const params = { ...this.queryParams }
console.log('🚀 ~ 导出 ~ params:', params)
this.download(url, params, fileName)
} catch (error) {
console.log('导出数据失败', error)
}
}
}
}
</script>
<style lang="scss" scoped></style>

View File

@ -447,7 +447,7 @@ export default {
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return applyRemove(ids)
return applyRemove({ id: row.id, type: row.taskStatus == 4 ? 1 : 2 })
})
.then(() => {
this.getList()

View File

@ -91,12 +91,7 @@
<el-button size="mini" type="warning" v-if="scope.row.taskStatus != 1" @click="handleLld(scope.row)">
领料单
</el-button>
<el-button
size="mini"
type="danger"
@click="handleDeletePurchase(scope.row)"
v-if="scope.row.taskStatus == 1"
>
<el-button size="mini" type="danger" @click="handleDeletePurchase(scope.row)" v-if="handleShow(scope.row)">
删除
</el-button>
</template>
@ -310,6 +305,14 @@ export default {
this.getList()
},
methods: {
handleShow(row) {
// createTime 3
if (new Date().getTime() - new Date(row.createTime).getTime() < 3 * 24 * 60 * 60 * 1000) {
return true
} else {
return false
}
},
format(date) {
const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0')
@ -436,7 +439,7 @@ export default {
this.$modal
.confirm('是否确认删除所选择的数据项?')
.then(function () {
return applyRemove(ids)
return applyRemove({ id: row.id, type: row.taskStatus == 4 ? 1 : 2})
})
.then(() => {
this.getList()