提交预报废等页面

This commit is contained in:
BianLzhaoMin 2024-04-20 13:26:48 +08:00
parent 19edda855d
commit 1202dc7ae7
5 changed files with 200 additions and 83 deletions

View File

@ -1,11 +1,16 @@
import request from '@/utils/request'
/* 预报废列表 */
/* 预报废审核列表 */
export const getForecastWasteListApi = (data) => {
return request.post('/material/scrap/getScrapApplyList', data)
}
/* 预报废列表查询框内数据 */
/* 预报废审核页面 弹框数据查询 */
export const getDialogListApi = (data) => {
return request.get('/material/details/questList', data)
}
return request.get('/material/scrap/getScrapAuditList', { params: data })
}
/* 预报废审核接口 */
export const auditingScrapApi = (data) => {
return request.post('/material/scrap/audit', data)
}

View File

@ -131,11 +131,10 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
:disabled="!checkResultOne || multiple"
type="primary"
plain
size="mini"
@click="complete(1)"
@click="handleBatchReview()"
>提交审核</el-button
>
</el-col>
@ -159,100 +158,81 @@
v-loading="loading"
:data="typeList"
@selection-change="handleSelectionChange"
border
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="序号"
sortable
type="selection"
width="55"
align="center"
type="index"
:selectable="selectable"
/>
<el-table-column label="序号" align="center" type="index" />
<el-table-column
label="维修单号"
align="center"
prop="repairCode"
sortable
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
sortable
label="退料单位名称"
align="center"
prop="backUnit"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
sortable
label="退料工程名称"
align="center"
prop="backPro"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
sortable
label="维修机具类型"
align="center"
prop="type"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
sortable
label="任务创建人"
align="center"
prop="createName"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
sortable
label="任务创建时间"
align="center"
prop="createTime"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
sortable
label="退料单号"
align="center"
prop="backCode"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
sortable
label="维修状态"
align="center"
prop="repairStatus"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="250"
>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
type="text"
icon="el-icon-zoom-in"
@click="handleSee(scope.row, 'see')"
>查看</el-button
>
<el-button
size="mini"
type="warning"
icon="el-icon-edit"
:disabled="scope.row.repairStatusCode == '44'"
type="text"
icon="el-icon-setting"
v-if="scope.row.repairStatusCode == '43'"
@click="handleUpdate(scope.row, 'update')"
>维修</el-button
>
<!-- <el-button
size="mini"
type="info"
icon="el-icon-circle-close"
@click="handleReturn(scope.row)"
v-hasPermi="['store:labelType:edit']"
>退回退料</el-button
> -->
</template>
</el-table-column>
</el-table>
@ -360,8 +340,6 @@
<el-table
v-loading="loading"
:data="repairList"
height="1000px"
max-height="500px"
@selection-change="selectionChange"
>
<el-table-column type="selection" width="55" align="center" />
@ -461,7 +439,7 @@
size="mini"
type="info"
@click="broken(scope.row)"
>报废</el-button
>报废</el-button
>
<!-- <el-button size="mini" type="warning" @click="complete(scope.row)"
>完成维修</el-button
@ -962,6 +940,43 @@
domainChange() {
this.getDialogList()
},
/* 提交审核 */
handleAuditing(v) {
console.log(v, '审核')
},
selectable(row) {
//
return (
row.repairStatusCode === '44' ||
row.repairStatusCode === '43'
)
},
/* 批量审批 */
handleBatchReview() {
if (this.selectionList.length < 1) {
this.$message.info('请勾选需要审批的数据!')
return
}
this.$confirm('是否确定提交维修审核?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
const res = await addEndRepairTaskApi(
this.selectionList,
)
if (res.code === 200) {
this.$message({
type: 'success',
message: '审批已提交!',
})
this.getList()
}
})
.catch(() => {})
},
},
}
</script>

View File

@ -22,14 +22,27 @@
v-if="isSelShow"
/>
<el-table-column
:type="v === 0 ? 'index' : ''"
v-for="(item, v) in tableProps"
:key="v"
:label="item.t_label"
:prop="item.t_props"
:width="item.t_width"
align="center"
/>
show-overflow-tooltip
>
<template slot-scope="scope">
<template v-if="item.t_slot">
<slot :data="scope.row" :name="item.t_slot"></slot>
</template>
<template v-else>
{{
v === 0
? scope.$index + 1
: scope.row[item.t_props] || '-'
}}
</template>
</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
@ -39,6 +52,24 @@
<template slot-scope="{ row }">
<slot :data="row"></slot>
</template>
<template slot="header">
<el-popover
placement="bottom"
title="筛选列"
width="200"
trigger="click"
>
<span slot="reference">操作</span>
<div>
<el-checkbox>123</el-checkbox>
<el-checkbox>123</el-checkbox>
<el-checkbox>123</el-checkbox>
<el-checkbox>123</el-checkbox>
<el-checkbox>123</el-checkbox>
</div>
</el-popover>
</template>
</el-table-column>
</el-table>
<pagination
@ -108,35 +139,51 @@
return ''
},
},
/* 额外参数 */
sendParams: {
type: Object,
default: () => {
return {}
},
},
},
data() {
return {
total: 1,
tableList: [
{ demo: 555 },
{ demo: 555 },
{ demo: 555 },
{ demo: 555 },
{ demo: 555 },
],
total: 0,
tableList: [],
pageParams: {
pageNum: 1,
pageSize: 10,
},
}
},
created() {
this.getList()
},
methods: {
async queryList(val, reset) {
if (reset) {
this.pageParams.pageNum = 1
this.pageParams.pageSize = 10
}
var params = Object.assign(val, this.pageParams)
params.beginTime = params.time[0]
params.endTime = params.time[1]
const res = await this.sendApi(params)
console.log(res, '列表数据')
console.log('查询列表---', val)
this.pageParams = Object.assign(
val,
this.pageParams,
this.sendParams,
)
this.pageParams.beginTime = val.time ? val.time[0] : ''
this.pageParams.endTime = val.time ? val.time[1] : ''
this.getList()
},
async getList() {
this.pageParams = Object.assign(
this.pageParams,
this.sendParams,
)
const res = await this.sendApi(this.pageParams)
this.tableList = res.rows
this.total = res.total
},
/* 表格复选框 */

View File

@ -10,6 +10,27 @@
:isSelShow="true"
@getTableSelectionChange="getTableSelChangeOuter"
>
<!-- 报废来源 -->
<template slot-scope="{ data }" slot="source">
<template v-if="data.scrapSource === 1">退料</template>
<template v-if="data.scrapSource === 2">维修审核</template>
<template v-if="data.scrapSource === 3">盘点</template>
</template>
<!-- 单号 1退料单号 2维修单号 3盘点单号 -->
<template slot-scope="{ data }" slot="code">
<template v-if="data.scrapSource === 1">{{
data.repairCode
}}</template>
<template v-if="data.scrapSource === 2">{{
data.scrapNum
}}</template>
</template>
<!--审核状态 -->
<template slot-scope="{ data }" slot="type">
<el-tag v-if="data.taskStatus === 120" size="mini"
>待审核</el-tag
>
</template>
<template slot-scope="{ data }">
<el-button type="text" size="mini" @click="handlePreview(data)"
>查看</el-button
@ -34,12 +55,31 @@
<TableModel
:tableProps="config.previewTableProps"
:sendApi="getDialogListApi"
:sendParams="sendParams"
:handleColShow="false"
:formLabel="config.previewFormLabel"
:isSelShow="isSelShow"
ref="auditingTableRef"
@getTableSelectionChange="getTableSelChangeInner"
>
<!--审核状态 -->
<template slot-scope="{ data }" slot="t_type">
<el-tag v-if="data.status == 0" size="mini"
>待审核</el-tag
>
<el-tag
type="success"
v-if="data.status == 1"
size="mini"
>通过</el-tag
>
<el-tag
type="warning"
v-if="data.status == 2"
size="mini"
>驳回</el-tag
> </template
>s
</TableModel>
</template>
<template slot="handleBtn" v-if="handleBtn">
@ -94,6 +134,7 @@
import {
getForecastWasteListApi,
getDialogListApi,
auditingScrapApi,
} from '@/api/scrap/forecastWaste.js'
export default {
name: 'scrapAuditing',
@ -129,7 +170,11 @@
isSelShow: true,
/* 选中的审核数据 */
selAuditingList: [],
/* 请求参数 */
sendParams: {},
getSelList,
/* 审核参数 */
auditingParams: {},
}
},
created() {
@ -138,19 +183,21 @@
},
methods: {
/* 查看 */
handlePreview(val) {
console.log(val, '查看')
async handlePreview(val) {
this.sendParams.taskId = val.taskId
this.title = '查看'
this.isSelShow = false
this.dialogVisible = true
this.$refs.auditingTableRef.getList()
},
/* 审核 */
handleAuditing(val) {
this.sendParams.taskId = val.taskId
this.title = '审核'
this.isSelShow = true
this.handleBtn = true
console.log(val, '审核')
this.dialogVisible = true
this.$refs.auditingTableRef.getList()
},
/* 自定义事件关闭弹框 (外层) */
closeDialog(val) {
@ -161,12 +208,13 @@
this.innerDialogVisible = val
},
/* 审核通过 */
auditingPass() {
async auditingPass() {
if (this.selAuditingList.length < 1) {
this.$message.error('请勾选审核设备')
return
}
console.log('审核通过')
const res = await auditingScrapApi(this.auditingParams)
console.log(res, '审核结果')
this.dialogVisible = false
},
/* 审核驳回 */
@ -219,6 +267,7 @@
handler(newVal) {
if (!newVal) {
this.$refs.auditingTableRef.clearSelType()
this.handleBtn = false
}
},
},

View File

@ -12,15 +12,15 @@ const config = {
/* 预报废审核主页 列表参数 */
tableProps: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'demo', t_label: '预报废单号' },
{ t_width: '', t_props: '', t_label: '报废来源' },
{ t_width: '', t_props: '', t_label: '单号' },
{ t_width: '', t_props: '', t_label: '退料单位名称' },
{ t_width: '', t_props: '', t_label: '退料工程名称' },
{ t_width: '', t_props: '', t_label: '设备类型' },
{ t_width: '', t_props: '', t_label: '任务创建人' },
{ t_width: '', t_props: '', t_label: '任务创建时间' },
{ t_width: '', t_props: '', t_label: '审核状态' },
{ t_width: '', t_props: 'scrapNum', t_label: '预报废单号' },
{ t_width: '', t_props: '', t_label: '报废来源', t_slot: 'source' },
{ t_width: '', t_props: 'repairNum', t_label: '单号', t_slot: 'code' },
{ t_width: '', t_props: 'unitName', t_label: '退料单位名称' },
{ t_width: '', t_props: 'projectName', t_label: '退料工程名称' },
{ t_width: '', t_props: 'itemType', t_label: '设备类型' },
{ t_width: '', t_props: 'createBy', t_label: '任务创建人' },
{ t_width: '', t_props: 'createTime', t_label: '任务创建时间' },
{ t_width: '', t_props: 'taskStatus', t_label: '审核状态', t_slot: 'type' },
{ t_width: '', t_props: '', t_label: '不通过原因' },
],
/* 预报废审核主页表单 查询参数 */
@ -30,19 +30,20 @@ const config = {
{ f_label: '工程名称', f_model: 'backPro', f_type: 'sel', f_selList: [] },
{ f_label: '工机具类型', f_model: 'type', f_type: 'selCas', f_selList: [], optionProps: { value: 'id', } },
{ f_label: '报废来源', f_model: 'laiyuan', f_type: 'sel', f_selList: [] },
{ f_label: '审批状态', f_model: 'shentype', f_type: 'sel', f_selList: [] },
{ f_label: '审批状态', f_model: 'taskStatus', f_type: 'sel', f_selList: [] },
{ f_label: '创建时间', f_model: 'time', f_type: 'date' },
],
/* 预报废审核弹框内 列表参数 */
previewTableProps: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'demo', t_label: '设备类型' },
{ t_width: '', t_props: '', t_label: '设备编码' },
{ t_width: '', t_props: '', t_label: '设备数量' },
{ t_width: '', t_props: '', t_label: '审批状态' },
{ t_width: '', t_props: 'machineTypeName', t_label: '设备类型' },
{ t_width: '', t_props: 'specificationType', t_label: '规格型号' },
{ t_width: '', t_props: 'maCode', t_label: '设备编码' },
{ t_width: '', t_props: 'scrapNum', t_label: '设备数量' },
{ t_width: '', t_props: 'status', t_label: '审批状态', t_slot: 't_type' },
{ t_width: '', t_props: '', t_label: '报废原因' },
{ t_width: '', t_props: '', t_label: '报废图片' },
{ t_width: '', t_props: '', t_label: '备注' },
{ t_width: '', t_props: 'remark', t_label: '备注' },
],
/* 预报废审核弹框表单 查询参数 */
previewFormLabel: [
@ -75,7 +76,7 @@ const config = {
{ f_label: '报废类型', f_model: 'shentype', f_type: 'sel', f_selList: [] },
],
/* 预报废列表查看弹框内 列表参数 */
previewTableProps: [
listingPreviewTableProps: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_width: '', t_props: 'demo', t_label: '设备类型' },
{ t_width: '', t_props: '', t_label: '规格型号' },