优化报废等页面数据回显,操作事件等

This commit is contained in:
BianLzhaoMin 2024-06-13 14:08:59 +08:00
parent b19296dbe4
commit bd89662085
5 changed files with 45 additions and 33 deletions

View File

@ -80,7 +80,6 @@ export const dialogConfig = {
{ t_width: '', t_props: 'specificationType', t_label: '规格型号' }, { t_width: '', t_props: 'specificationType', t_label: '规格型号' },
{ t_width: '', t_props: 'maCode', t_label: '设备编码' }, { t_width: '', t_props: 'maCode', t_label: '设备编码' },
{ t_width: '', t_props: 'scrapNum', t_label: '设备数量' }, { t_width: '', t_props: 'scrapNum', t_label: '设备数量' },
{ t_width: '', t_props: 'auditRemark', t_label: '报废原因' },
{ t_width: '', t_props: '', t_label: '损坏原因', t_slot: 't_damage' }, { t_width: '', t_props: '', t_label: '损坏原因', t_slot: 't_damage' },
{ t_width: '', t_props: 'fileUrl', t_label: '报废图片', t_slot: 'imgPreview' }, { t_width: '', t_props: 'fileUrl', t_label: '报废图片', t_slot: 'imgPreview' },
], ],

View File

@ -64,8 +64,8 @@ export const dialogConfig = {
{ t_width: '', t_props: 'specificationType', t_label: '规格型号' }, { t_width: '', t_props: 'specificationType', t_label: '规格型号' },
{ t_width: '', t_props: 'maCode', t_label: '设备编码' }, { t_width: '', t_props: 'maCode', t_label: '设备编码' },
{ t_width: '', t_props: 'scrapNum', t_label: '设备数量' }, { t_width: '', t_props: 'scrapNum', t_label: '设备数量' },
{ t_width: '', t_props: 'remark', t_label: '报废原因' }, { t_width: '', t_props: '', t_label: '损坏原因', t_slot: 't_damage' },
{ t_width: '', t_props: 'fileUrl', t_label: '报废图片', t_slot: 'imgPreview' }, { t_width: '', t_props: '', t_label: '报废图片', t_slot: 't_img' },
], ],
} }

View File

@ -91,14 +91,19 @@
:sendApi="getDialogListApi" :sendApi="getDialogListApi"
:config="dialogConfig" :config="dialogConfig"
> >
<template slot="imgPreview"> <!-- 损坏原因 -->
<ImagePreview <template slot-scope="{ data }" slot="t_damage">
:src="``" {{ data.scrapType == 1 ? '人为' : '自然' }}
:width="`30px`" </template>
:height="`30px`" <!-- 报废图片 -->
<template slot-scope="{ data }" slot="t_img">
<ScrapImg
v-if="data.fileUrl"
:scrapImgUrl="data.fileUrl"
/> />
</template> </TableModel </template>
></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>
@ -156,12 +161,14 @@ import {
import TableModel from '@/components/TableModel' import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel' import DialogModel from '@/components/DialogModel'
import ScrapSource from '../../component/scrapSource.vue' import ScrapSource from '../../component/scrapSource.vue'
import ScrapImg from '../../component/scrapImg.vue'
import { config, dialogConfig, getSelList } from './config.js' import { config, dialogConfig, getSelList } from './config.js'
export default { export default {
components: { components: {
TableModel, TableModel,
DialogModel, DialogModel,
ScrapSource, ScrapSource,
ScrapImg,
}, },
data() { data() {
return { return {
@ -203,7 +210,14 @@ export default {
this.dialogConfig.outerWidth = '70%' this.dialogConfig.outerWidth = '70%'
this.dialogConfig.outerVisible = true this.dialogConfig.outerVisible = true
}, },
handleDisposition() { handleDisposition(row) {
this.dispositionParams = []
this.dispositionParams.push({
taskId: row.taskId,
fileUrl: '', // url
fileName: '', //
disposition: 1, // 0 1
})
this.dialogConfig.outerTitle = '处置' this.dialogConfig.outerTitle = '处置'
this.dialogConfig.outerWidth = '60%' this.dialogConfig.outerWidth = '60%'
this.dialogConfig.outerVisible = true this.dialogConfig.outerVisible = true
@ -224,6 +238,7 @@ export default {
data.dispositionFileUrl.split(',').map((e, index) => { data.dispositionFileUrl.split(',').map((e, index) => {
this.fileList[index].fileUrl = e this.fileList[index].fileUrl = e
}) })
this.fileList.splice(this.fileList.length - 1, 1)
this.dialogConfig.outerTitle = '附件信息' this.dialogConfig.outerTitle = '附件信息'
this.dialogConfig.outerWidth = '40%' this.dialogConfig.outerWidth = '40%'
this.dialogConfig.outerVisible = true this.dialogConfig.outerVisible = true
@ -241,7 +256,7 @@ export default {
/* 确定 */ /* 确定 */
async handleSubmitInner() { async handleSubmitInner() {
if (this.uploadFileList.length < 1) { if (this.uploadFileList.length < 1) {
this.$message.error('请先上传图片') this.$message.error('请先上传文件')
return return
} }
@ -251,25 +266,15 @@ export default {
fileUrl += e.fileUrl + ',' fileUrl += e.fileUrl + ','
fileName += e.fileName + ',' fileName += e.fileName + ','
}) })
this.dispositionParams.fileUrl = fileUrl.substring(
fileUrl.length - 1,
',',
)
this.dispositionParams.fileName = fileName.substring(
fileName.length - 1,
',',
)
this.dispositionParams.map((e) => { this.dispositionParams.map((e) => {
e.fileUrl = fileUrl.substring(fileUrl.length - 1, ',') e.fileUrl = fileUrl.substring(fileUrl.length - 1, ',')
e.fileName = fileName.substring(fileUrl.length - 1, ',') e.fileName = fileName.substring(fileUrl.length - 1, ',')
}) })
const res = await submitDispositionApi(this.dispositionParams) const res = await submitDispositionApi(this.dispositionParams)
if (res.code == 200) { if (res.code == 200) {
this.$message.success('处置成功!') this.$message.success('处置成功!')
this.dialogConfig.outerVisible = false this.dialogConfig.outerVisible = false
this.$refs.tbRef() this.$refs.tbRef.getList()
} }
}, },
/* 获取上传后的图片信息 */ /* 获取上传后的图片信息 */
@ -289,7 +294,7 @@ export default {
taskId: e.taskId, taskId: e.taskId,
fileUrl: '', // url fileUrl: '', // url
fileName: '', // fileName: '', //
disposition: 1, // 0 1 disposition: 1, // 0 1
} }
this.dispositionParams.push(prams) this.dispositionParams.push(prams)

View File

@ -72,8 +72,8 @@ export const dialogConfig = {
{ t_width: '', t_props: 'specificationType', t_label: '规格型号' }, { t_width: '', t_props: 'specificationType', t_label: '规格型号' },
{ t_width: '', t_props: 'maCode', t_label: '设备编码' }, { t_width: '', t_props: 'maCode', t_label: '设备编码' },
{ t_width: '', t_props: 'scrapNum', t_label: '设备数量' }, { t_width: '', t_props: 'scrapNum', t_label: '设备数量' },
{ t_width: '', t_props: 'remark', t_label: '报废原因' }, { t_width: '', t_props: '', t_label: '损坏原因', t_slot: 't_damage' },
{ t_width: '', t_props: 'fileUrl', t_label: '报废图片', t_slot: 'imgPreview' }, { t_width: '', t_props: '', t_label: '报废图片', t_slot: 't_img' },
], ],
} }

View File

@ -48,6 +48,7 @@
v-hasPermi="['scrap:auditing']" v-hasPermi="['scrap:auditing']"
@click="handleAuditing(data)" @click="handleAuditing(data)"
> >
<!-- v-if="auditingIsShow(data)" -->
审核 审核
</el-button> </el-button>
<el-button <el-button
@ -75,14 +76,19 @@
:sendApi="getDialogListApi" :sendApi="getDialogListApi"
:config="dialogConfig" :config="dialogConfig"
> >
<template slot="imgPreview" slot-scope="{ data }"> <!-- 损坏原因 -->
<ImagePreview <template slot-scope="{ data }" slot="t_damage">
:src="``" {{ data.scrapType == 1 ? '人为' : '自然' }}
:width="`30px`" </template>
:height="`30px`" <!-- 报废图片 -->
<template slot-scope="{ data }" slot="t_img">
<ScrapImg
v-if="data.fileUrl"
:scrapImgUrl="data.fileUrl"
/> />
</template> </TableModel </template>
></template> </TableModel>
</template>
<template v-if="dialogConfig.outerTitle === '审核'"> <template v-if="dialogConfig.outerTitle === '审核'">
<TableModel <TableModel
:config="dialogConfig" :config="dialogConfig"
@ -149,6 +155,7 @@ import TableModel from '@/components/TableModel'
import DialogModel from '@/components/DialogModel' import DialogModel from '@/components/DialogModel'
import ScrapSource from '../../component/scrapSource.vue' import ScrapSource from '../../component/scrapSource.vue'
import AuditingDetails from '../../component/auditingDetails.vue' import AuditingDetails from '../../component/auditingDetails.vue'
import ScrapImg from '../../component/scrapImg.vue'
import { config, dialogConfig, getSelList } from './config' import { config, dialogConfig, getSelList } from './config'
import { import {
getScrapListApi, getScrapListApi,
@ -161,6 +168,7 @@ export default {
DialogModel, DialogModel,
ScrapSource, ScrapSource,
AuditingDetails, AuditingDetails,
ScrapImg,
}, },
data() { data() {
return { return {