2024-04-22 18:15:42 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<!-- 报废审核 -->
|
|
|
|
|
<TableModel
|
|
|
|
|
:config="config"
|
2024-04-26 14:45:18 +08:00
|
|
|
:sendApi="getDispositionListApi"
|
2024-04-26 15:45:36 +08:00
|
|
|
:selectable="
|
|
|
|
|
(row) => {
|
|
|
|
|
return row.disposition == 0
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
@getTableSelectionChange="getSelectionList"
|
2024-04-26 14:45:18 +08:00
|
|
|
ref="tbRef"
|
2024-04-22 18:15:42 +08:00
|
|
|
>
|
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-26 14:45:18 +08:00
|
|
|
<el-button
|
|
|
|
|
plain
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleBatchDisposition()"
|
2024-05-17 14:27:43 +08:00
|
|
|
v-hasPermi="['scrap:batch:disposition']"
|
2024-04-22 18:15:42 +08:00
|
|
|
>批量处置</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
size="mini"
|
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-26 14:45:18 +08:00
|
|
|
<!-- 报废来源 -->
|
|
|
|
|
<template slot-scope="{ data }" slot="source">
|
2024-05-16 17:44:30 +08:00
|
|
|
<ScrapSource :data="data" />
|
2024-04-26 14:45:18 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- 状态 -->
|
|
|
|
|
<template slot-scope="{ data }" slot="type">
|
|
|
|
|
<el-tag size="mini" v-if="data.disposition == 0">未处置</el-tag>
|
|
|
|
|
<el-tag size="mini" type="success" v-if="data.disposition == 1"
|
|
|
|
|
>已处置</el-tag
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- 附件信息 -->
|
|
|
|
|
<template slot-scope="{ data }" slot="file">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
@click="handlePreviewFile(data)"
|
|
|
|
|
style="color: #67c23a"
|
|
|
|
|
v-if="data.dispositionFileUrl"
|
|
|
|
|
>
|
|
|
|
|
查看附件
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
<template v-else>-</template>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-04-22 18:15:42 +08:00
|
|
|
<!-- 列表操作栏 -->
|
2024-04-26 14:45:18 +08:00
|
|
|
<template slot="handle" slot-scope="{ data }">
|
|
|
|
|
<el-button size="mini" type="text" @click="handlePreview(data)">
|
|
|
|
|
查看
|
|
|
|
|
</el-button>
|
2024-04-22 18:15:42 +08:00
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
2024-04-26 14:45:18 +08:00
|
|
|
@click="handleDisposition(data)"
|
2024-04-26 15:45:36 +08:00
|
|
|
v-if="data.disposition == 0"
|
2024-05-17 14:27:43 +08:00
|
|
|
v-hasPermi="['scrap:disposition']"
|
2024-04-22 18:15:42 +08:00
|
|
|
>
|
2024-04-26 14:45:18 +08:00
|
|
|
处置
|
2024-04-22 18:15:42 +08:00
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</TableModel>
|
|
|
|
|
|
|
|
|
|
<!-- 弹框 -->
|
|
|
|
|
<DialogModel
|
|
|
|
|
:dialogConfig="dialogConfig"
|
|
|
|
|
@closeDialogOuter="closeDialogOuter"
|
|
|
|
|
>
|
|
|
|
|
<!-- 弹框内容 查看 处置-->
|
|
|
|
|
<template slot="outerContent">
|
2024-04-26 15:45:36 +08:00
|
|
|
<!-- 查看内容 -->
|
2024-04-22 18:15:42 +08:00
|
|
|
<template v-if="dialogConfig.outerTitle === '查看'">
|
2024-04-26 15:45:36 +08:00
|
|
|
<TableModel
|
|
|
|
|
:sendParams="sendParams"
|
|
|
|
|
:sendApi="getDialogListApi"
|
|
|
|
|
:config="dialogConfig"
|
|
|
|
|
>
|
2024-06-13 14:08:59 +08:00
|
|
|
<!-- 损坏原因 -->
|
|
|
|
|
<template slot-scope="{ data }" slot="t_damage">
|
|
|
|
|
{{ data.scrapType == 1 ? '人为' : '自然' }}
|
|
|
|
|
</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-26 14:45:18 +08:00
|
|
|
|
|
|
|
|
<template v-else-if="dialogConfig.outerTitle === '附件信息'">
|
|
|
|
|
<el-table :data="fileList" border>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="文件名称"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="fileName"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column label="操作" align="center">
|
|
|
|
|
<template slot-scope="{ row }">
|
2024-04-26 15:45:36 +08:00
|
|
|
<a
|
|
|
|
|
:href="filePreviewUrl + row.fileUrl"
|
|
|
|
|
target="_blank"
|
|
|
|
|
>查看</a
|
|
|
|
|
>
|
2024-04-26 14:45:18 +08:00
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
2024-04-22 18:15:42 +08:00
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
2024-04-24 17:57:47 +08:00
|
|
|
<el-row type="flex" justify="space-around">
|
2024-04-26 14:45:18 +08:00
|
|
|
<el-col :span="4">请上传处置文件</el-col>
|
2024-04-24 17:57:47 +08:00
|
|
|
<el-col>
|
2024-04-26 14:45:18 +08:00
|
|
|
<ImageUpload
|
|
|
|
|
:limit="3"
|
|
|
|
|
:fileSize="5"
|
|
|
|
|
:fileType="fileType"
|
|
|
|
|
@input="getFileList"
|
|
|
|
|
/>
|
2024-04-24 17:57:47 +08:00
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
2024-04-26 14:45:18 +08:00
|
|
|
<el-row class="dialog-common-btn">
|
|
|
|
|
<el-button size="mini" plain @click="handleCancelInner"
|
|
|
|
|
>取 消</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleSubmitInner"
|
|
|
|
|
>确 定</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-row>
|
2024-04-22 18:15:42 +08:00
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</DialogModel>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-06-12 16:16:08 +08:00
|
|
|
import {
|
|
|
|
|
getDispositionListApi,
|
|
|
|
|
submitDispositionApi,
|
|
|
|
|
getDialogListApi,
|
|
|
|
|
} from '@/api/scrap/forecastWaste.js'
|
|
|
|
|
import TableModel from '@/components/TableModel'
|
|
|
|
|
import DialogModel from '@/components/DialogModel'
|
|
|
|
|
import ScrapSource from '../../component/scrapSource.vue'
|
2024-06-13 14:08:59 +08:00
|
|
|
import ScrapImg from '../../component/scrapImg.vue'
|
2024-06-12 16:16:08 +08:00
|
|
|
import { config, dialogConfig, getSelList } from './config.js'
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
TableModel,
|
|
|
|
|
DialogModel,
|
|
|
|
|
ScrapSource,
|
2024-06-13 14:08:59 +08:00
|
|
|
ScrapImg,
|
2024-06-12 16:16:08 +08:00
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
config,
|
|
|
|
|
dialogConfig,
|
|
|
|
|
getDispositionListApi,
|
|
|
|
|
getDialogListApi,
|
|
|
|
|
/* 选中的列表数据 */
|
|
|
|
|
selectionList: [],
|
|
|
|
|
/* 驳回原因 */
|
|
|
|
|
rejectReason: '',
|
|
|
|
|
fileType: ['png', 'jpg', 'jpeg', 'pdf', 'doc', 'xls', 'docx'],
|
|
|
|
|
uploadFileList: [],
|
|
|
|
|
sendParams: {},
|
|
|
|
|
fileList: [],
|
|
|
|
|
tbSelectList: [],
|
|
|
|
|
/* 处置提交参数 */
|
2024-04-26 15:45:36 +08:00
|
|
|
|
2024-06-12 16:16:08 +08:00
|
|
|
dispositionParams: [],
|
|
|
|
|
// dispositionParams: {
|
|
|
|
|
// taskId: '',
|
|
|
|
|
// fileUrl: '', // 附件url
|
|
|
|
|
// fileName: '', // 附件名称
|
|
|
|
|
// disposition: 1, // 处置状态 0、未通过 1、通过
|
|
|
|
|
// },
|
|
|
|
|
/* 附件预览地址 */
|
|
|
|
|
filePreviewUrl: process.env.VUE_APP_BASE_API + '/system',
|
|
|
|
|
getSelList,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getSelList()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/* 按钮操作 */
|
|
|
|
|
handlePreview(row) {
|
|
|
|
|
this.dispositionParams.taskId = this.sendParams.taskId = row.taskId
|
|
|
|
|
this.dialogConfig.outerTitle = '查看'
|
|
|
|
|
this.dialogConfig.outerWidth = '70%'
|
|
|
|
|
this.dialogConfig.outerVisible = true
|
2024-04-22 18:15:42 +08:00
|
|
|
},
|
2024-06-13 14:08:59 +08:00
|
|
|
handleDisposition(row) {
|
|
|
|
|
this.dispositionParams = []
|
|
|
|
|
this.dispositionParams.push({
|
|
|
|
|
taskId: row.taskId,
|
|
|
|
|
fileUrl: '', // 附件url
|
|
|
|
|
fileName: '', // 附件名称
|
|
|
|
|
disposition: 1, // 处置状态 0、未处置 1、已处置
|
|
|
|
|
})
|
2024-06-12 16:16:08 +08:00
|
|
|
this.dialogConfig.outerTitle = '处置'
|
|
|
|
|
this.dialogConfig.outerWidth = '60%'
|
|
|
|
|
this.dialogConfig.outerVisible = true
|
2024-05-16 14:16:49 +08:00
|
|
|
},
|
2024-04-26 14:45:18 +08:00
|
|
|
|
2024-06-12 16:16:08 +08:00
|
|
|
/* 查看附件 */
|
|
|
|
|
handlePreviewFile(data) {
|
|
|
|
|
this.fileList = []
|
|
|
|
|
data.dispositionFileName.split(',').map((e) => {
|
|
|
|
|
let fileObj = {
|
|
|
|
|
fileName: e,
|
|
|
|
|
fileUrl: '',
|
|
|
|
|
}
|
2024-04-26 14:45:18 +08:00
|
|
|
|
2024-06-12 16:16:08 +08:00
|
|
|
this.fileList.push(fileObj)
|
|
|
|
|
})
|
2024-04-22 18:15:42 +08:00
|
|
|
|
2024-06-12 16:16:08 +08:00
|
|
|
data.dispositionFileUrl.split(',').map((e, index) => {
|
|
|
|
|
this.fileList[index].fileUrl = e
|
|
|
|
|
})
|
2024-06-13 14:08:59 +08:00
|
|
|
this.fileList.splice(this.fileList.length - 1, 1)
|
2024-06-12 16:16:08 +08:00
|
|
|
this.dialogConfig.outerTitle = '附件信息'
|
|
|
|
|
this.dialogConfig.outerWidth = '40%'
|
|
|
|
|
this.dialogConfig.outerVisible = true
|
|
|
|
|
},
|
2024-04-26 14:45:18 +08:00
|
|
|
|
2024-06-12 16:16:08 +08:00
|
|
|
/* 关闭外层弹框 */
|
|
|
|
|
closeDialogOuter(val) {
|
|
|
|
|
this.dialogConfig.outerVisible = val
|
|
|
|
|
},
|
2024-04-26 14:45:18 +08:00
|
|
|
|
2024-06-12 16:16:08 +08:00
|
|
|
/* 取消 */
|
|
|
|
|
handleCancelInner() {
|
|
|
|
|
this.dialogConfig.outerVisible = false
|
|
|
|
|
},
|
|
|
|
|
/* 确定 */
|
|
|
|
|
async handleSubmitInner() {
|
|
|
|
|
if (this.uploadFileList.length < 1) {
|
2024-06-13 14:08:59 +08:00
|
|
|
this.$message.error('请先上传文件')
|
2024-06-12 16:16:08 +08:00
|
|
|
return
|
|
|
|
|
}
|
2024-04-26 14:45:18 +08:00
|
|
|
|
2024-06-12 16:16:08 +08:00
|
|
|
let fileUrl = ''
|
|
|
|
|
let fileName = ''
|
|
|
|
|
this.uploadFileList.map((e) => {
|
|
|
|
|
fileUrl += e.fileUrl + ','
|
|
|
|
|
fileName += e.fileName + ','
|
|
|
|
|
})
|
|
|
|
|
this.dispositionParams.map((e) => {
|
|
|
|
|
e.fileUrl = fileUrl.substring(fileUrl.length - 1, ',')
|
|
|
|
|
e.fileName = fileName.substring(fileUrl.length - 1, ',')
|
|
|
|
|
})
|
|
|
|
|
const res = await submitDispositionApi(this.dispositionParams)
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.$message.success('处置成功!')
|
|
|
|
|
this.dialogConfig.outerVisible = false
|
2024-06-13 14:08:59 +08:00
|
|
|
this.$refs.tbRef.getList()
|
2024-06-12 16:16:08 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/* 获取上传后的图片信息 */
|
|
|
|
|
getFileList(val) {
|
|
|
|
|
this.uploadFileList = val
|
|
|
|
|
},
|
2024-04-26 14:45:18 +08:00
|
|
|
|
2024-06-12 16:16:08 +08:00
|
|
|
/* 批量处置 */
|
|
|
|
|
handleBatchDisposition() {
|
|
|
|
|
this.dispositionParams = []
|
|
|
|
|
if (this.tbSelectList.length < 1) {
|
|
|
|
|
this.$message.error('请选择需处置的数据')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.tbSelectList.map((e) => {
|
|
|
|
|
let prams = {
|
|
|
|
|
taskId: e.taskId,
|
|
|
|
|
fileUrl: '', // 附件url
|
|
|
|
|
fileName: '', // 附件名称
|
2024-06-13 14:08:59 +08:00
|
|
|
disposition: 1, // 处置状 0、未处置 1、已处置
|
2024-04-26 15:45:36 +08:00
|
|
|
}
|
|
|
|
|
|
2024-06-12 16:16:08 +08:00
|
|
|
this.dispositionParams.push(prams)
|
|
|
|
|
})
|
2024-04-26 15:45:36 +08:00
|
|
|
|
2024-06-12 16:16:08 +08:00
|
|
|
this.dialogConfig.outerTitle = '处置'
|
|
|
|
|
this.dialogConfig.outerWidth = '60%'
|
|
|
|
|
this.dialogConfig.outerVisible = true
|
|
|
|
|
},
|
2024-04-26 15:45:36 +08:00
|
|
|
|
2024-06-12 16:16:08 +08:00
|
|
|
/* 获取列表下拉勾选数据 */
|
|
|
|
|
getSelectionList(selList) {
|
|
|
|
|
console.log(selList, '选择的数据')
|
|
|
|
|
this.tbSelectList = selList
|
|
|
|
|
},
|
|
|
|
|
/* 导出数据 */
|
|
|
|
|
handelExportData(data) {
|
|
|
|
|
console.log(this.tableSelList, ' this.tableSelList')
|
|
|
|
|
this.download(
|
|
|
|
|
'material/scrap/exportObtainDisposalList',
|
|
|
|
|
{
|
|
|
|
|
...data,
|
|
|
|
|
},
|
|
|
|
|
`报废处置列表_${new Date().getTime()}.xlsx`,
|
|
|
|
|
)
|
|
|
|
|
console.log('数据导出', data)
|
2024-04-22 18:15:42 +08:00
|
|
|
},
|
2024-06-12 16:16:08 +08:00
|
|
|
},
|
|
|
|
|
}
|
2024-04-22 18:15:42 +08:00
|
|
|
</script>
|