材料站-班组进出场查询,已出库删除
This commit is contained in:
parent
fe36a85935
commit
d1a2600574
|
|
@ -284,10 +284,11 @@ export function getPickListApi(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 领料申请-删除
|
// 领料申请-删除
|
||||||
export function applyRemove(ids) {
|
export function applyRemove(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/material/material_lease_apply_info/' + ids,
|
url: '/material/material_lease_apply_info/delete',
|
||||||
method: 'delete'
|
method: 'post',
|
||||||
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -700,4 +701,13 @@ export function getProTotalListApi(data) {
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: data
|
params: data
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 班组进出场查询
|
||||||
|
export function getTeamInOrOutInfoApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/material/material_maMachine/getTeamInOrOutInfo',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -447,7 +447,7 @@ export default {
|
||||||
this.$modal
|
this.$modal
|
||||||
.confirm('是否确认删除所选择的数据项?')
|
.confirm('是否确认删除所选择的数据项?')
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return applyRemove(ids)
|
return applyRemove({ id: row.id, type: row.taskStatus == 4 ? 1 : 2 })
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
|
|
||||||
|
|
@ -91,12 +91,7 @@
|
||||||
<el-button size="mini" type="warning" v-if="scope.row.taskStatus != 1" @click="handleLld(scope.row)">
|
<el-button size="mini" type="warning" v-if="scope.row.taskStatus != 1" @click="handleLld(scope.row)">
|
||||||
领料单
|
领料单
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button size="mini" type="danger" @click="handleDeletePurchase(scope.row)" v-if="handleShow(scope.row)">
|
||||||
size="mini"
|
|
||||||
type="danger"
|
|
||||||
@click="handleDeletePurchase(scope.row)"
|
|
||||||
v-if="scope.row.taskStatus == 1"
|
|
||||||
>
|
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -310,6 +305,14 @@ export default {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
format(date) {
|
||||||
const y = date.getFullYear()
|
const y = date.getFullYear()
|
||||||
const m = String(date.getMonth() + 1).padStart(2, '0')
|
const m = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
|
@ -436,7 +439,7 @@ export default {
|
||||||
this.$modal
|
this.$modal
|
||||||
.confirm('是否确认删除所选择的数据项?')
|
.confirm('是否确认删除所选择的数据项?')
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return applyRemove(ids)
|
return applyRemove({ id: row.id, type: row.taskStatus == 4 ? 1 : 2})
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue