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

View File

@ -44,13 +44,12 @@ export const dialogConfig = {
],
columnsList: [
{ t_width: '55px', t_props: '', t_label: '序号' },
{ t_props: '', t_label: '设备类型' },
{ t_props: '', t_label: '规格型号' },
{ t_props: '', t_label: '设备编码' },
{ t_props: '', t_label: '设备数量' },
{ t_props: '', t_label: '报废原因' },
{ t_props: '', t_label: '报废图片' },
{ 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: 'remark', t_label: '报废原因' },
{ t_width: '', t_props: 'fileUrl', t_label: '报废图片', t_slot: 'imgPreview' },
],
}

View File

@ -4,6 +4,12 @@
<TableModel
:config="config"
:sendApi="getDispositionListApi"
:selectable="
(row) => {
return row.disposition == 0
}
"
@getTableSelectionChange="getSelectionList"
ref="tbRef"
>
<template slot="export">
@ -63,7 +69,7 @@
size="mini"
type="text"
@click="handleDisposition(data)"
v-if="data.disposition === 0"
v-if="data.disposition == 0"
>
处置
</el-button>
@ -77,9 +83,21 @@
>
<!-- 弹框内容 查看 处置-->
<template slot="outerContent">
<!-- 查看内容 -->
<template v-if="dialogConfig.outerTitle === '查看'">
<TableModel :config="dialogConfig"></TableModel>
</template>
<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-else-if="dialogConfig.outerTitle === '附件信息'">
<el-table :data="fileList" border>
@ -90,7 +108,11 @@
/>
<el-table-column label="操作" align="center">
<template slot-scope="{ row }">
<a :href="row.fileUrl" target="_blank">查看</a>
<a
:href="filePreviewUrl + row.fileUrl"
target="_blank"
>查看</a
>
</template>
</el-table-column>
</el-table>
@ -128,6 +150,7 @@
import {
getDispositionListApi,
submitDispositionApi,
getDialogListApi,
} from '@/api/scrap/forecastWaste.js'
import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel'
@ -142,27 +165,35 @@
config,
dialogConfig,
getDispositionListApi,
getDialogListApi,
/* 选中的列表数据 */
selectionList: [],
/* 驳回原因 */
rejectReason: '',
fileType: ['png', 'jpg', 'jpeg', 'pdf', 'doc', 'xls', 'docx'],
uploadFileList: [],
sendParams: {},
fileList: [],
tbSelectList: [],
/* 处置提交参数 */
dispositionParams: {
taskId: '',
fileUrl: '', // url
fileName: '', //
disposition: 1, // 0 1
},
dispositionParams: [],
// dispositionParams: {
// taskId: '',
// fileUrl: '', // url
// fileName: '', //
// disposition: 1, // 0 1
// },
/* 附件预览地址 */
filePreviewUrl: process.env.VUE_APP_BASE_API + '/system',
}
},
created() {},
methods: {
/* 按钮操作 */
handlePreview(row) {
this.dispositionParams.taskId = row.taskId
this.dispositionParams.taskId = this.sendParams.taskId =
row.taskId
this.dialogConfig.outerTitle = '查看'
this.dialogConfig.outerWidth = '70%'
this.dialogConfig.outerVisible = true
@ -175,7 +206,7 @@
/* 查看附件 */
handlePreviewFile(data) {
dialogConfig.outerTitle = '附件信息'
this.fileList = []
data.dispositionFileName.split(',').map((e) => {
let fileObj = {
fileName: e,
@ -188,6 +219,7 @@
data.dispositionFileUrl.split(',').map((e, index) => {
this.fileList[index].fileUrl = e
})
this.dialogConfig.outerTitle = '附件信息'
this.dialogConfig.outerWidth = '40%'
this.dialogConfig.outerVisible = true
},
@ -223,9 +255,11 @@
',',
)
const { data: res } = await submitDispositionApi([
this.dispositionParams,
])
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('处置成功!')
@ -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>

View File

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

View File

@ -69,6 +69,21 @@
>
<!-- 弹框外层内容 查看 审核 审核详情-->
<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 != '审批详情'">
<TableModel
:config="dialogConfig"