This commit is contained in:
BianLzhaoMin 2024-04-26 15:45:36 +08:00
parent f1cfbef49b
commit df24cb9922
5 changed files with 112 additions and 29 deletions

View File

@ -7,6 +7,11 @@
:sendApi="getPreScrapListApi" :sendApi="getPreScrapListApi"
ref="listingTbRef" ref="listingTbRef"
@getTableSelectionChange="getTableSelectionChange" @getTableSelectionChange="getTableSelectionChange"
:selectable="
(row) => {
return row.taskStatus == 124
}
"
> >
<template slot="export"> <template slot="export">
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
@ -226,7 +231,11 @@
}, },
/* 表格复选框选中的数据 */ /* 表格复选框选中的数据 */
getTableSelectionChange(val) { getTableSelectionChange(val) {
this.tableSelList = []
this.tableSelList = val this.tableSelList = val
this.tableSelList.map((e) => {
this.submitScrapParams.taskIdList.push(e.taskId)
})
}, },
handleBack() { handleBack() {
this.temp = !this.temp this.temp = !this.temp

View File

@ -44,13 +44,12 @@ export const dialogConfig = {
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, { t_width: '55px', t_props: '', t_label: '序号' },
{ t_props: '', t_label: '设备类型' }, { t_width: '', t_props: 'machineTypeName', t_label: '设备类型' },
{ t_props: '', t_label: '规格型号' }, { t_width: '', t_props: 'specificationType', t_label: '规格型号' },
{ t_props: '', t_label: '设备编码' }, { t_width: '', t_props: 'maCode', t_label: '设备编码' },
{ t_props: '', t_label: '设备数量' }, { t_width: '', t_props: 'scrapNum', t_label: '设备数量' },
{ t_props: '', t_label: '报废原因' }, { t_width: '', t_props: 'remark', t_label: '报废原因' },
{ t_props: '', t_label: '报废图片' }, { t_width: '', t_props: 'fileUrl', t_label: '报废图片', t_slot: 'imgPreview' },
{ t_props: '', t_label: '备注' },
], ],
} }

View File

@ -4,6 +4,12 @@
<TableModel <TableModel
:config="config" :config="config"
:sendApi="getDispositionListApi" :sendApi="getDispositionListApi"
:selectable="
(row) => {
return row.disposition == 0
}
"
@getTableSelectionChange="getSelectionList"
ref="tbRef" ref="tbRef"
> >
<template slot="export"> <template slot="export">
@ -63,7 +69,7 @@
size="mini" size="mini"
type="text" type="text"
@click="handleDisposition(data)" @click="handleDisposition(data)"
v-if="data.disposition === 0" v-if="data.disposition == 0"
> >
处置 处置
</el-button> </el-button>
@ -77,9 +83,21 @@
> >
<!-- 弹框内容 查看 处置--> <!-- 弹框内容 查看 处置-->
<template slot="outerContent"> <template slot="outerContent">
<!-- 查看内容 -->
<template v-if="dialogConfig.outerTitle === '查看'"> <template v-if="dialogConfig.outerTitle === '查看'">
<TableModel :config="dialogConfig"></TableModel> <TableModel
</template> :sendParams="sendParams"
:sendApi="getDialogListApi"
:config="dialogConfig"
>
<template slot="imgPreview" slot-scope="{ data }">
<ImagePreview
:src="`https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg`"
:width="`60px`"
:height="`60px`"
/>
</template> </TableModel
></template>
<template v-else-if="dialogConfig.outerTitle === '附件信息'"> <template v-else-if="dialogConfig.outerTitle === '附件信息'">
<el-table :data="fileList" border> <el-table :data="fileList" border>
@ -90,7 +108,11 @@
/> />
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<a :href="row.fileUrl" target="_blank">查看</a> <a
:href="filePreviewUrl + row.fileUrl"
target="_blank"
>查看</a
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -128,6 +150,7 @@
import { import {
getDispositionListApi, getDispositionListApi,
submitDispositionApi, submitDispositionApi,
getDialogListApi,
} from '@/api/scrap/forecastWaste.js' } from '@/api/scrap/forecastWaste.js'
import TableModel from '@/components/TableModel' import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel' import DialogModel from '@/components/DialogModel'
@ -142,27 +165,35 @@
config, config,
dialogConfig, dialogConfig,
getDispositionListApi, getDispositionListApi,
getDialogListApi,
/* 选中的列表数据 */ /* 选中的列表数据 */
selectionList: [], selectionList: [],
/* 驳回原因 */ /* 驳回原因 */
rejectReason: '', rejectReason: '',
fileType: ['png', 'jpg', 'jpeg', 'pdf', 'doc', 'xls', 'docx'], fileType: ['png', 'jpg', 'jpeg', 'pdf', 'doc', 'xls', 'docx'],
uploadFileList: [], uploadFileList: [],
sendParams: {},
fileList: [], fileList: [],
tbSelectList: [],
/* 处置提交参数 */ /* 处置提交参数 */
dispositionParams: {
taskId: '', dispositionParams: [],
fileUrl: '', // url // dispositionParams: {
fileName: '', // // taskId: '',
disposition: 1, // 0 1 // fileUrl: '', // url
}, // fileName: '', //
// disposition: 1, // 0 1
// },
/* 附件预览地址 */
filePreviewUrl: process.env.VUE_APP_BASE_API + '/system',
} }
}, },
created() {}, created() {},
methods: { methods: {
/* 按钮操作 */ /* 按钮操作 */
handlePreview(row) { handlePreview(row) {
this.dispositionParams.taskId = row.taskId this.dispositionParams.taskId = this.sendParams.taskId =
row.taskId
this.dialogConfig.outerTitle = '查看' this.dialogConfig.outerTitle = '查看'
this.dialogConfig.outerWidth = '70%' this.dialogConfig.outerWidth = '70%'
this.dialogConfig.outerVisible = true this.dialogConfig.outerVisible = true
@ -175,7 +206,7 @@
/* 查看附件 */ /* 查看附件 */
handlePreviewFile(data) { handlePreviewFile(data) {
dialogConfig.outerTitle = '附件信息' this.fileList = []
data.dispositionFileName.split(',').map((e) => { data.dispositionFileName.split(',').map((e) => {
let fileObj = { let fileObj = {
fileName: e, fileName: e,
@ -188,6 +219,7 @@
data.dispositionFileUrl.split(',').map((e, index) => { data.dispositionFileUrl.split(',').map((e, index) => {
this.fileList[index].fileUrl = e this.fileList[index].fileUrl = e
}) })
this.dialogConfig.outerTitle = '附件信息'
this.dialogConfig.outerWidth = '40%' this.dialogConfig.outerWidth = '40%'
this.dialogConfig.outerVisible = true this.dialogConfig.outerVisible = true
}, },
@ -223,9 +255,11 @@
',', ',',
) )
const { data: res } = await submitDispositionApi([ this.dispositionParams.map((e) => {
this.dispositionParams, e.fileUrl = fileUrl.substring(fileUrl.length - 1, ',')
]) e.fileName = fileName.substring(fileUrl.length - 1, ',')
})
const res = await submitDispositionApi(this.dispositionParams)
if (res.code == 200) { if (res.code == 200) {
this.$message.success('处置成功!') this.$message.success('处置成功!')
@ -239,7 +273,33 @@
}, },
/* 批量处置 */ /* 批量处置 */
handleBatchDisposition() {}, handleBatchDisposition() {
this.dispositionParams = []
if (this.tbSelectList.length < 1) {
this.$message.error('请选择需处置的数据')
return
}
this.tbSelectList.map((e) => {
let prams = {
taskId: e.taskId,
fileUrl: '', // url
fileName: '', //
disposition: 1, // 0 1
}
this.dispositionParams.push(prams)
})
this.dialogConfig.outerTitle = '处置'
this.dialogConfig.outerWidth = '60%'
this.dialogConfig.outerVisible = true
},
/* 获取列表下拉勾选数据 */
getSelectionList(selList) {
console.log(selList, '选择的数据')
this.tbSelectList = selList
},
}, },
} }
</script> </script>

View File

@ -44,12 +44,12 @@ export const dialogConfig = {
], ],
columnsList: [ columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' }, { t_width: '55px', t_props: '', t_label: '序号' },
{ t_props: 'machineTypeName', t_label: '设备类型' }, { t_width: '', t_props: 'machineTypeName', t_label: '设备类型' },
{ t_props: 'specificationType', t_label: '规格型号' }, { t_width: '', t_props: 'specificationType', t_label: '规格型号' },
{ t_props: 'maCode', t_label: '设备编码' }, { t_width: '', t_props: 'maCode', t_label: '设备编码' },
{ t_props: 'scrapNum', t_label: '设备数量' }, { t_width: '', t_props: 'scrapNum', t_label: '设备数量' },
{ t_props: 'remark', t_label: '报废原因' }, { t_width: '', t_props: 'remark', t_label: '报废原因' },
{ t_props: 'fileUrl', t_label: '报废图片' }, { t_width: '', t_props: 'fileUrl', t_label: '报废图片', t_slot: 'imgPreview' },
], ],
} }

View File

@ -69,6 +69,21 @@
> >
<!-- 弹框外层内容 查看 审核 审核详情--> <!-- 弹框外层内容 查看 审核 审核详情-->
<template slot="outerContent"> <template slot="outerContent">
<!-- 查看内容 -->
<template v-if="dialogConfig.outerTitle === '查看'">
<TableModel
:sendParams="sendParams"
:sendApi="getDialogListApi"
:config="dialogConfig"
>
<template slot="imgPreview" slot-scope="{ data }">
<ImagePreview
:src="`https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg`"
:width="`60px`"
:height="`60px`"
/>
</template> </TableModel
></template>
<template v-if="dialogConfig.outerTitle != '审批详情'"> <template v-if="dialogConfig.outerTitle != '审批详情'">
<TableModel <TableModel
:config="dialogConfig" :config="dialogConfig"