提交预报废等页面

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' import request from '@/utils/request'
/* 预报废列表 */ /* 预报废审核列表 */
export const getForecastWasteListApi = (data) => { export const getForecastWasteListApi = (data) => {
return request.post('/material/scrap/getScrapApplyList', data) return request.post('/material/scrap/getScrapApplyList', data)
} }
/* 预报废列表查询框内数据 */ /* 预报废审核页面 弹框数据查询 */
export const getDialogListApi = (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-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
:disabled="!checkResultOne || multiple"
type="primary" type="primary"
plain plain
size="mini" size="mini"
@click="complete(1)" @click="handleBatchReview()"
>提交审核</el-button >提交审核</el-button
> >
</el-col> </el-col>
@ -159,100 +158,81 @@
v-loading="loading" v-loading="loading"
:data="typeList" :data="typeList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
border
> >
<el-table-column type="selection" width="55" align="center" />
<el-table-column <el-table-column
label="序号" type="selection"
sortable width="55"
align="center" align="center"
type="index" :selectable="selectable"
/> />
<el-table-column label="序号" align="center" type="index" />
<el-table-column <el-table-column
label="维修单号" label="维修单号"
align="center" align="center"
prop="repairCode" prop="repairCode"
sortable show-overflow-tooltip
:show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column
sortable
label="退料单位名称" label="退料单位名称"
align="center" align="center"
prop="backUnit" prop="backUnit"
:show-overflow-tooltip="true" show-overflow-tooltip
/> />
<el-table-column <el-table-column
sortable
label="退料工程名称" label="退料工程名称"
align="center" align="center"
prop="backPro" prop="backPro"
:show-overflow-tooltip="true" show-overflow-tooltip
/> />
<el-table-column <el-table-column
sortable
label="维修机具类型" label="维修机具类型"
align="center" align="center"
prop="type" prop="type"
:show-overflow-tooltip="true" show-overflow-tooltip
/> />
<el-table-column <el-table-column
sortable
label="任务创建人" label="任务创建人"
align="center" align="center"
prop="createName" prop="createName"
:show-overflow-tooltip="true" show-overflow-tooltip
/> />
<el-table-column <el-table-column
sortable sortable
label="任务创建时间" label="任务创建时间"
align="center" align="center"
prop="createTime" prop="createTime"
:show-overflow-tooltip="true" show-overflow-tooltip
/> />
<el-table-column <el-table-column
sortable
label="退料单号" label="退料单号"
align="center" align="center"
prop="backCode" prop="backCode"
:show-overflow-tooltip="true" show-overflow-tooltip
/> />
<el-table-column <el-table-column
sortable
label="维修状态" label="维修状态"
align="center" align="center"
prop="repairStatus" prop="repairStatus"
:show-overflow-tooltip="true" show-overflow-tooltip
/> />
<el-table-column <el-table-column label="操作" align="center">
label="操作"
align="center"
class-name="small-padding fixed-width"
width="250"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
type="primary" type="text"
icon="el-icon-zoom-in" icon="el-icon-zoom-in"
@click="handleSee(scope.row, 'see')" @click="handleSee(scope.row, 'see')"
>查看</el-button >查看</el-button
> >
<el-button <el-button
size="mini" size="mini"
type="warning" type="text"
icon="el-icon-edit" icon="el-icon-setting"
:disabled="scope.row.repairStatusCode == '44'" v-if="scope.row.repairStatusCode == '43'"
@click="handleUpdate(scope.row, 'update')" @click="handleUpdate(scope.row, 'update')"
>维修</el-button >维修</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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -360,8 +340,6 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="repairList" :data="repairList"
height="1000px"
max-height="500px"
@selection-change="selectionChange" @selection-change="selectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
@ -461,7 +439,7 @@
size="mini" size="mini"
type="info" type="info"
@click="broken(scope.row)" @click="broken(scope.row)"
>报废</el-button >报废</el-button
> >
<!-- <el-button size="mini" type="warning" @click="complete(scope.row)" <!-- <el-button size="mini" type="warning" @click="complete(scope.row)"
>完成维修</el-button >完成维修</el-button
@ -962,6 +940,43 @@
domainChange() { domainChange() {
this.getDialogList() 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> </script>

View File

@ -22,14 +22,27 @@
v-if="isSelShow" v-if="isSelShow"
/> />
<el-table-column <el-table-column
:type="v === 0 ? 'index' : ''"
v-for="(item, v) in tableProps" v-for="(item, v) in tableProps"
:key="v" :key="v"
:label="item.t_label" :label="item.t_label"
:prop="item.t_props" :prop="item.t_props"
:width="item.t_width" :width="item.t_width"
align="center" 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 <el-table-column
align="center" align="center"
label="操作" label="操作"
@ -39,6 +52,24 @@
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<slot :data="row"></slot> <slot :data="row"></slot>
</template> </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-column>
</el-table> </el-table>
<pagination <pagination
@ -108,35 +139,51 @@
return '' return ''
}, },
}, },
/* 额外参数 */
sendParams: {
type: Object,
default: () => {
return {}
},
},
}, },
data() { data() {
return { return {
total: 1, total: 0,
tableList: [ tableList: [],
{ demo: 555 },
{ demo: 555 },
{ demo: 555 },
{ demo: 555 },
{ demo: 555 },
],
pageParams: { pageParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}, },
} }
}, },
created() {
this.getList()
},
methods: { methods: {
async queryList(val, reset) { async queryList(val, reset) {
if (reset) { if (reset) {
this.pageParams.pageNum = 1 this.pageParams.pageNum = 1
this.pageParams.pageSize = 10 this.pageParams.pageSize = 10
} }
var params = Object.assign(val, this.pageParams) this.pageParams = Object.assign(
params.beginTime = params.time[0] val,
params.endTime = params.time[1] this.pageParams,
const res = await this.sendApi(params) this.sendParams,
console.log(res, '列表数据') )
console.log('查询列表---', val) 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" :isSelShow="true"
@getTableSelectionChange="getTableSelChangeOuter" @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 }"> <template slot-scope="{ data }">
<el-button type="text" size="mini" @click="handlePreview(data)" <el-button type="text" size="mini" @click="handlePreview(data)"
>查看</el-button >查看</el-button
@ -34,12 +55,31 @@
<TableModel <TableModel
:tableProps="config.previewTableProps" :tableProps="config.previewTableProps"
:sendApi="getDialogListApi" :sendApi="getDialogListApi"
:sendParams="sendParams"
:handleColShow="false" :handleColShow="false"
:formLabel="config.previewFormLabel" :formLabel="config.previewFormLabel"
:isSelShow="isSelShow" :isSelShow="isSelShow"
ref="auditingTableRef" ref="auditingTableRef"
@getTableSelectionChange="getTableSelChangeInner" @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> </TableModel>
</template> </template>
<template slot="handleBtn" v-if="handleBtn"> <template slot="handleBtn" v-if="handleBtn">
@ -94,6 +134,7 @@
import { import {
getForecastWasteListApi, getForecastWasteListApi,
getDialogListApi, getDialogListApi,
auditingScrapApi,
} from '@/api/scrap/forecastWaste.js' } from '@/api/scrap/forecastWaste.js'
export default { export default {
name: 'scrapAuditing', name: 'scrapAuditing',
@ -129,7 +170,11 @@
isSelShow: true, isSelShow: true,
/* 选中的审核数据 */ /* 选中的审核数据 */
selAuditingList: [], selAuditingList: [],
/* 请求参数 */
sendParams: {},
getSelList, getSelList,
/* 审核参数 */
auditingParams: {},
} }
}, },
created() { created() {
@ -138,19 +183,21 @@
}, },
methods: { methods: {
/* 查看 */ /* 查看 */
handlePreview(val) { async handlePreview(val) {
console.log(val, '查看') this.sendParams.taskId = val.taskId
this.title = '查看' this.title = '查看'
this.isSelShow = false this.isSelShow = false
this.dialogVisible = true this.dialogVisible = true
this.$refs.auditingTableRef.getList()
}, },
/* 审核 */ /* 审核 */
handleAuditing(val) { handleAuditing(val) {
this.sendParams.taskId = val.taskId
this.title = '审核' this.title = '审核'
this.isSelShow = true this.isSelShow = true
this.handleBtn = true this.handleBtn = true
console.log(val, '审核')
this.dialogVisible = true this.dialogVisible = true
this.$refs.auditingTableRef.getList()
}, },
/* 自定义事件关闭弹框 (外层) */ /* 自定义事件关闭弹框 (外层) */
closeDialog(val) { closeDialog(val) {
@ -161,12 +208,13 @@
this.innerDialogVisible = val this.innerDialogVisible = val
}, },
/* 审核通过 */ /* 审核通过 */
auditingPass() { async auditingPass() {
if (this.selAuditingList.length < 1) { if (this.selAuditingList.length < 1) {
this.$message.error('请勾选审核设备') this.$message.error('请勾选审核设备')
return return
} }
console.log('审核通过') const res = await auditingScrapApi(this.auditingParams)
console.log(res, '审核结果')
this.dialogVisible = false this.dialogVisible = false
}, },
/* 审核驳回 */ /* 审核驳回 */
@ -219,6 +267,7 @@
handler(newVal) { handler(newVal) {
if (!newVal) { if (!newVal) {
this.$refs.auditingTableRef.clearSelType() this.$refs.auditingTableRef.clearSelType()
this.handleBtn = false
} }
}, },
}, },

View File

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