2024-04-22 18:15:42 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<!-- 报废审核 -->
|
2024-04-26 14:45:18 +08:00
|
|
|
<TableModel :config="config" :sendApi="getScrapListApi" ref="tbRef">
|
2024-05-16 17:44:30 +08:00
|
|
|
<template slot="export" slot-scope="{ pageParams }">
|
2024-06-12 16:16:08 +08:00
|
|
|
<el-row class="mb8">
|
2024-04-22 18:15:42 +08:00
|
|
|
<el-button
|
|
|
|
|
plain
|
|
|
|
|
size="mini"
|
2024-09-20 14:24:39 +08:00
|
|
|
type="success"
|
|
|
|
|
icon="el-icon-download"
|
2024-05-16 17:44:30 +08:00
|
|
|
@click="handelExportData(pageParams)"
|
2024-04-22 18:15:42 +08:00
|
|
|
>导出数据</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-row>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-04-24 17:57:47 +08:00
|
|
|
<!-- 报废来源 -->
|
|
|
|
|
<template slot-scope="{ data }" slot="source">
|
2024-05-16 17:44:30 +08:00
|
|
|
<ScrapSource :data="data" />
|
2024-04-24 17:57:47 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- 状态 -->
|
|
|
|
|
<template slot-scope="{ data }" slot="type">
|
|
|
|
|
<el-tag size="mini" v-if="data.taskStatus == 124"
|
2024-07-05 09:34:08 +08:00
|
|
|
>待审核</el-tag
|
2024-04-24 17:57:47 +08:00
|
|
|
>
|
|
|
|
|
<el-tag size="mini" type="warning" v-if="data.taskStatus == 58"
|
|
|
|
|
>审核中</el-tag
|
|
|
|
|
>
|
|
|
|
|
<el-tag size="mini" type="danger" v-if="data.taskStatus == 61"
|
|
|
|
|
>已驳回</el-tag
|
|
|
|
|
>
|
|
|
|
|
<el-tag size="mini" type="success" v-if="data.taskStatus == 59"
|
|
|
|
|
>已通过</el-tag
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-04-22 18:15:42 +08:00
|
|
|
<!-- 列表操作栏 -->
|
2024-04-24 17:57:47 +08:00
|
|
|
<template slot="handle" slot-scope="{ data }">
|
2024-06-27 11:54:43 +08:00
|
|
|
<el-button
|
|
|
|
|
type="text"
|
2024-06-28 16:33:24 +08:00
|
|
|
icon="el-icon-zoom-in"
|
2024-09-20 14:24:39 +08:00
|
|
|
@click="handlePreview(data)"
|
2024-06-27 11:54:43 +08:00
|
|
|
>
|
2024-04-24 17:57:47 +08:00
|
|
|
查看
|
|
|
|
|
</el-button>
|
2024-04-22 18:15:42 +08:00
|
|
|
<el-button
|
|
|
|
|
type="text"
|
2024-09-20 14:24:39 +08:00
|
|
|
style="color: #e6a23c"
|
|
|
|
|
icon="el-icon-edit-outline"
|
2025-03-27 13:42:16 +08:00
|
|
|
v-show="auditingIsShow(data)"
|
2024-04-24 17:57:47 +08:00
|
|
|
v-hasPermi="['scrap:auditing']"
|
|
|
|
|
@click="handleAuditing(data)"
|
2024-04-22 18:15:42 +08:00
|
|
|
>
|
2024-06-13 14:08:59 +08:00
|
|
|
<!-- v-if="auditingIsShow(data)" -->
|
2024-04-24 17:57:47 +08:00
|
|
|
审核
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
2024-09-20 14:24:39 +08:00
|
|
|
style="color: #67c23a"
|
|
|
|
|
icon="el-icon-chat-line-square"
|
2024-04-24 17:57:47 +08:00
|
|
|
@click="handleAuditingDetails(data)"
|
|
|
|
|
>
|
|
|
|
|
审批详情
|
2024-04-22 18:15:42 +08:00
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</TableModel>
|
|
|
|
|
|
|
|
|
|
<!-- 弹框 -->
|
|
|
|
|
<DialogModel
|
|
|
|
|
:dialogConfig="dialogConfig"
|
|
|
|
|
@closeDialogOuter="closeDialogOuter"
|
|
|
|
|
@closeDialogInner="closeDialogInner"
|
|
|
|
|
>
|
|
|
|
|
<!-- 弹框外层内容 查看 审核 审核详情-->
|
|
|
|
|
<template slot="outerContent">
|
2024-04-26 15:45:36 +08:00
|
|
|
<!-- 查看内容 -->
|
|
|
|
|
<template v-if="dialogConfig.outerTitle === '查看'">
|
|
|
|
|
<TableModel
|
2024-09-20 14:24:39 +08:00
|
|
|
:config="dialogConfig"
|
2024-04-26 15:45:36 +08:00
|
|
|
:sendParams="sendParams"
|
|
|
|
|
:sendApi="getDialogListApi"
|
|
|
|
|
>
|
2024-06-13 14:08:59 +08:00
|
|
|
<!-- 损坏原因 -->
|
|
|
|
|
<template slot-scope="{ data }" slot="t_damage">
|
2024-06-18 15:12:54 +08:00
|
|
|
<!-- {{ data.scrapType == 1 ? '人为' : '自然' }} -->
|
|
|
|
|
<template v-if="data.scrapType == 1">人为</template>
|
|
|
|
|
<template v-if="data.scrapType == 0">自然</template>
|
2024-06-13 14:08:59 +08:00
|
|
|
</template>
|
|
|
|
|
<!-- 报废图片 -->
|
|
|
|
|
<template slot-scope="{ data }" slot="t_img">
|
|
|
|
|
<ScrapImg
|
|
|
|
|
v-if="data.fileUrl"
|
|
|
|
|
:scrapImgUrl="data.fileUrl"
|
2024-04-26 15:45:36 +08:00
|
|
|
/>
|
2024-06-13 14:08:59 +08:00
|
|
|
</template>
|
|
|
|
|
</TableModel>
|
|
|
|
|
</template>
|
2024-04-28 09:15:05 +08:00
|
|
|
<template v-if="dialogConfig.outerTitle === '审核'">
|
2024-04-22 18:15:42 +08:00
|
|
|
<TableModel
|
2024-09-20 14:24:39 +08:00
|
|
|
ref="dialogTbRef"
|
2024-04-22 18:15:42 +08:00
|
|
|
:config="dialogConfig"
|
2024-04-24 17:57:47 +08:00
|
|
|
:sendParams="sendParams"
|
|
|
|
|
:sendApi="getDialogListApi"
|
2024-04-22 18:15:42 +08:00
|
|
|
@getTableSelectionChange="getDialogTbChange"
|
2024-06-20 13:09:01 +08:00
|
|
|
>
|
|
|
|
|
<!-- 损坏原因 -->
|
|
|
|
|
<template slot-scope="{ data }" slot="t_damage">
|
|
|
|
|
<!-- {{ data.scrapType == 1 ? '人为' : '自然' }} -->
|
|
|
|
|
<template v-if="data.scrapType == 1">人为</template>
|
|
|
|
|
<template v-if="data.scrapType == 0">自然</template>
|
|
|
|
|
</template>
|
|
|
|
|
<!-- 报废图片 -->
|
|
|
|
|
<template slot-scope="{ data }" slot="t_img">
|
|
|
|
|
<ScrapImg
|
|
|
|
|
v-if="data.fileUrl"
|
|
|
|
|
:scrapImgUrl="data.fileUrl"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</TableModel>
|
2024-04-28 09:15:05 +08:00
|
|
|
<el-row class="dialog-common-btn">
|
2024-04-22 18:15:42 +08:00
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="success"
|
|
|
|
|
@click="handlePass"
|
|
|
|
|
>通过</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="danger"
|
|
|
|
|
@click="handleReject"
|
|
|
|
|
>驳回</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-row>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- 审核详情 -->
|
2024-04-28 09:15:05 +08:00
|
|
|
<template v-if="dialogConfig.outerTitle === '审批详情'">
|
2024-04-24 17:57:47 +08:00
|
|
|
<AuditingDetails :auditingList="auditingList" />
|
2024-04-22 18:15:42 +08:00
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- 弹框内层内容 -->
|
|
|
|
|
<template slot="innerContent">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="4">请输入驳回原因</el-col>
|
|
|
|
|
<el-col :span="20">
|
|
|
|
|
<el-input
|
|
|
|
|
:rows="6"
|
2024-09-20 14:24:39 +08:00
|
|
|
type="textarea"
|
|
|
|
|
maxlength="100"
|
2024-04-22 18:15:42 +08:00
|
|
|
ref="rejectReasonRef"
|
2024-09-20 14:24:39 +08:00
|
|
|
v-model="rejectReason"
|
2024-04-22 18:15:42 +08:00
|
|
|
/>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row class="dialog-common-btn">
|
|
|
|
|
<el-button size="mini" plain @click="handleCancelInner"
|
|
|
|
|
>取 消</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="warning"
|
|
|
|
|
@click="handleSubmitInner"
|
|
|
|
|
>保 存</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-row>
|
|
|
|
|
</template>
|
|
|
|
|
</DialogModel>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-06-03 09:35:35 +08:00
|
|
|
import TableModel from '@/components/TableModel'
|
|
|
|
|
import DialogModel from '@/components/DialogModel'
|
2024-09-20 14:24:39 +08:00
|
|
|
import ScrapImg from '../../component/scrapImg.vue'
|
2024-06-03 09:35:35 +08:00
|
|
|
import ScrapSource from '../../component/scrapSource.vue'
|
|
|
|
|
import AuditingDetails from '../../component/auditingDetails.vue'
|
|
|
|
|
import { config, dialogConfig, getSelList } from './config'
|
|
|
|
|
import {
|
|
|
|
|
getScrapListApi,
|
|
|
|
|
getDialogListApi,
|
|
|
|
|
auditingScrapApi,
|
|
|
|
|
} from '@/api/scrap/forecastWaste.js'
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
TableModel,
|
|
|
|
|
DialogModel,
|
2024-09-20 14:24:39 +08:00
|
|
|
ScrapImg,
|
2024-06-03 09:35:35 +08:00
|
|
|
ScrapSource,
|
|
|
|
|
AuditingDetails,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
config,
|
|
|
|
|
dialogConfig,
|
|
|
|
|
getScrapListApi,
|
|
|
|
|
getDialogListApi,
|
2024-07-09 17:51:47 +08:00
|
|
|
rejectReason: '', // 驳回原因
|
2024-09-20 14:24:39 +08:00
|
|
|
sendParams: {}, // 弹框内列表查看时参数
|
2024-07-09 17:51:47 +08:00
|
|
|
auditingList: [], // 审批详情的列表
|
2024-09-20 14:24:39 +08:00
|
|
|
selectionList: [], // 选中的列表数据
|
2024-06-03 09:35:35 +08:00
|
|
|
/* 审核参数 */
|
|
|
|
|
auditingParams: {
|
|
|
|
|
deptId: parseInt(sessionStorage.getItem('deptId')),
|
|
|
|
|
userId: sessionStorage.getItem('userId'),
|
|
|
|
|
taskId: '',
|
|
|
|
|
status: '',
|
|
|
|
|
reasonRejection: '',
|
|
|
|
|
},
|
2024-09-20 14:24:39 +08:00
|
|
|
deptId: sessionStorage.getItem('deptId'),
|
|
|
|
|
getSelList,
|
2024-06-03 09:35:35 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getSelList()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/* 按钮操作 */
|
|
|
|
|
handlePreview(row) {
|
|
|
|
|
this.sendParams.taskId = row.taskId
|
|
|
|
|
this.dialogConfig.outerTitle = '查看'
|
|
|
|
|
this.dialogConfig.outerWidth = '70%'
|
|
|
|
|
this.dialogConfig.outerVisible = true
|
|
|
|
|
},
|
|
|
|
|
handleAuditing(row) {
|
|
|
|
|
this.sendParams.taskId = this.auditingParams.taskId = row.taskId
|
|
|
|
|
this.dialogConfig.outerTitle = '审核'
|
|
|
|
|
this.dialogConfig.outerWidth = '70%'
|
|
|
|
|
this.dialogConfig.outerVisible = true
|
|
|
|
|
},
|
|
|
|
|
handleAuditingDetails(row) {
|
|
|
|
|
this.auditingList = row.scrapAuditorSetList
|
|
|
|
|
this.dialogConfig.outerTitle = '审批详情'
|
|
|
|
|
this.dialogConfig.outerWidth = '40%'
|
|
|
|
|
this.dialogConfig.outerVisible = true
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* 关闭外层弹框 */
|
|
|
|
|
closeDialogOuter(val) {
|
|
|
|
|
this.dialogConfig.outerVisible = val
|
|
|
|
|
},
|
|
|
|
|
/* 关闭内层弹框 */
|
|
|
|
|
closeDialogInner(val) {
|
|
|
|
|
this.dialogConfig.innerVisible = val
|
|
|
|
|
},
|
|
|
|
|
/* 获取弹框内表格选中数据 */
|
|
|
|
|
getDialogTbChange(list) {
|
|
|
|
|
this.selectionList = list
|
|
|
|
|
},
|
|
|
|
|
/* 审核通过 */
|
|
|
|
|
async handlePass() {
|
|
|
|
|
this.auditingParams.status = '1'
|
|
|
|
|
this.auditingParams.reasonRejection = '同意'
|
|
|
|
|
const res = await auditingScrapApi(this.auditingParams)
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.$message.success('审核通过')
|
|
|
|
|
this.dialogConfig.outerVisible = false
|
|
|
|
|
/* 刷新列表 */
|
|
|
|
|
this.$refs.tbRef.getList()
|
2024-04-22 18:15:42 +08:00
|
|
|
}
|
|
|
|
|
},
|
2024-06-03 09:35:35 +08:00
|
|
|
/* 审核驳回 */
|
|
|
|
|
handleReject() {
|
|
|
|
|
/* 先打开内测弹框 */
|
|
|
|
|
this.dialogConfig.innerTitle = '驳回原因'
|
|
|
|
|
this.dialogConfig.innerVisible = true
|
2024-05-16 14:16:49 +08:00
|
|
|
},
|
2024-04-24 17:57:47 +08:00
|
|
|
|
2024-06-03 09:35:35 +08:00
|
|
|
/* 驳回原因页面取消 */
|
|
|
|
|
handleCancelInner() {
|
|
|
|
|
this.rejectReason = ''
|
|
|
|
|
this.dialogConfig.innerVisible = false
|
|
|
|
|
},
|
|
|
|
|
/* 驳回原因页面保存 */
|
|
|
|
|
async handleSubmitInner() {
|
|
|
|
|
if (!this.rejectReason) {
|
|
|
|
|
this.$message.error('请输入驳回原因')
|
|
|
|
|
return
|
|
|
|
|
}
|
2024-04-22 18:15:42 +08:00
|
|
|
|
2024-06-03 09:35:35 +08:00
|
|
|
this.auditingParams.status = '2'
|
|
|
|
|
this.auditingParams.reasonRejection = this.rejectReason
|
|
|
|
|
const res = await auditingScrapApi(this.auditingParams)
|
2024-09-20 14:24:39 +08:00
|
|
|
if (res.code === 200) {
|
2024-06-03 09:35:35 +08:00
|
|
|
this.$message.success('已驳回')
|
2024-04-22 18:15:42 +08:00
|
|
|
this.dialogConfig.innerVisible = false
|
2024-06-03 09:35:35 +08:00
|
|
|
this.dialogConfig.outerVisible = false
|
|
|
|
|
this.rejectReason = ''
|
|
|
|
|
/* 刷新列表 */
|
|
|
|
|
this.$refs.tbRef.getList()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/* 审核按钮的显示条件 */
|
|
|
|
|
auditingIsShow(row) {
|
|
|
|
|
let temp = row.scrapAuditorSetList?.some((e) => {
|
|
|
|
|
return e.deptId == this.deptId && e.status == '0'
|
|
|
|
|
})
|
|
|
|
|
return temp
|
2024-04-22 18:15:42 +08:00
|
|
|
},
|
2024-06-03 09:35:35 +08:00
|
|
|
/* 导出数据 */
|
|
|
|
|
handelExportData(data) {
|
|
|
|
|
console.log(this.tableSelList, ' this.tableSelList')
|
|
|
|
|
this.download(
|
|
|
|
|
'material/scrap/exportScrapTaskReviewList',
|
|
|
|
|
{
|
|
|
|
|
...data,
|
2024-05-16 14:16:49 +08:00
|
|
|
},
|
2024-06-03 09:35:35 +08:00
|
|
|
`报废审核列表_${new Date().getTime()}.xlsx`,
|
|
|
|
|
)
|
|
|
|
|
console.log('数据导出', data)
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
$route: {
|
|
|
|
|
handler(to) {
|
|
|
|
|
if (to.query.keyWord) {
|
|
|
|
|
this.config.routerParams = to.query.keyWord
|
|
|
|
|
}
|
2024-05-16 14:16:49 +08:00
|
|
|
},
|
2024-06-03 09:35:35 +08:00
|
|
|
deep: true,
|
|
|
|
|
immediate: true,
|
2024-05-16 14:16:49 +08:00
|
|
|
},
|
2024-06-03 09:35:35 +08:00
|
|
|
},
|
|
|
|
|
}
|
2024-04-22 18:15:42 +08:00
|
|
|
</script>
|