This commit is contained in:
BianLzhaoMin 2024-04-22 13:47:05 +08:00
parent 0eabae89df
commit e49086d824
3 changed files with 93 additions and 26 deletions

View File

@ -7,7 +7,6 @@
> >
<template> <template>
<slot name="submitScrap" /> <slot name="submitScrap" />
<slot name="finish" />
</template> </template>
</FormModel> </FormModel>
<el-table <el-table
@ -62,12 +61,13 @@
width="200" width="200"
trigger="click" trigger="click"
> >
<span slot="reference">操作</span> <span slot="reference" class="handel-text">操作</span>
<div> <div>
<el-checkbox <el-checkbox
v-for="(check, index) in tableColumCheck" v-for="(check, index) in columCheckList"
v-show="check.t_label != '序号'"
:key="index" :key="index"
v-model="check.checked"
>{{ check.t_label }}</el-checkbox >{{ check.t_label }}</el-checkbox
> >
</div> </div>
@ -160,7 +160,13 @@
data() { data() {
return { return {
total: 0, total: 0,
tableList: [], tableList: [
{ demo: '123' },
{ demo: '123' },
{ demo: '123' },
{ demo: '123' },
{ demo: '123' },
],
pageParams: { pageParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
@ -170,14 +176,17 @@
}, },
created() { created() {
this.getList() this.getList()
console.log(this.tableColumCheck, '获取的', this.tableProps) this.columCheckList = this.tableProps
this.columCheckList = this.columCheckList.map((e) => {
this.$set(e, 'checked', true)
return e
})
}, },
computed: { computed: {
tableColumCheck() {
return this.tableProps
},
tableColumCheckProps() { tableColumCheckProps() {
return this.tableColumCheck.filter((e) => (e.checked = true)) return this.columCheckList.filter((e) => {
return e.checked != false
})
}, },
}, },
methods: { methods: {
@ -227,4 +236,12 @@
margin-bottom: 5px; margin-bottom: 5px;
cursor: pointer; cursor: pointer;
} }
.handel-text {
cursor: pointer;
}
.handel-text:hover {
text-decoration: underline;
color: #409eff;
}
</style> </style>

View File

@ -10,18 +10,30 @@
:handleWidth="`180px`" :handleWidth="`180px`"
@getTableSelectionChange="getTableSelectionChange" @getTableSelectionChange="getTableSelectionChange"
> >
<template slot="finish"> <template slot="submitScrap">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="warning" plain size="mini"
type="warning"
plain
size="mini"
@click="submitScrap"
>完成退料</el-button >完成退料</el-button
> >
</el-col> </el-col>
</template> </template>
<template slot-scope="{ data }">
<el-button
v-for="btn in handleBtn"
:key="btn.id"
type="text"
size="mini"
@click="handleBtnEvent(data, btn.id)"
>{{ btn.btn_title }}</el-button
>
</template>
</TableModel> </TableModel>
<DialogModel
:title="title"
:dialogVisible="dialogVisible"
:width="dialogWidth"
@closeDialog="closeDialog"
></DialogModel>
</div> </div>
</template> </template>
@ -40,10 +52,35 @@
data() { data() {
return { return {
config, config,
title: '',
dialogVisible: false,
handleBtn: [
{ btn_title: '查看', id: 1 },
{ btn_title: '编辑退料', id: 2 },
{ btn_title: '撤回', id: 3 },
],
} }
}, },
methods: { methods: {
/* 按钮操作 */
handleBtnEvent(data, id) {
switch (id) {
case 1:
this.title = '查看'
this.dialogWidth = '70%'
break
case 2:
this.title = '编辑退料'
this.dialogWidth = '70%'
break
}
this.dialogVisible = true
},
getTableSelectionChange() {}, getTableSelectionChange() {},
closeDialog(val) {
this.dialogVisible = val
},
}, },
} }
</script> </script>

View File

@ -1,13 +1,5 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-button
@click="
() => {
this.temp = !this.temp
}
"
>测试</el-button
>
<!-- 预报废列表 --> <!-- 预报废列表 -->
<template v-if="!temp"> <template v-if="!temp">
<TableModel <TableModel
@ -16,7 +8,7 @@
:exportShow="true" :exportShow="true"
:pageShow="true" :pageShow="true"
:isSelShow="true" :isSelShow="true"
:handleWidth="`180px`" :handleWidth="`260px`"
@getTableSelectionChange="getTableSelectionChange" @getTableSelectionChange="getTableSelectionChange"
> >
<template slot="submitScrap"> <template slot="submitScrap">
@ -85,6 +77,10 @@
</template> </template>
<template v-if="temp"> <template v-if="temp">
<el-row type="flex" justify="space-between" class="back-text">
<span>驳回退料</span>
<el-button type="text" @click="handleBack">返回</el-button>
</el-row>
<AuditingReturn /> <AuditingReturn />
</template> </template>
</div> </div>
@ -123,6 +119,7 @@
{ btn_title: '查看', id: 1 }, { btn_title: '查看', id: 1 },
{ btn_title: '提交报废', id: 2 }, { btn_title: '提交报废', id: 2 },
{ btn_title: '审批详情', id: 3 }, { btn_title: '审批详情', id: 3 },
{ btn_title: '驳回退料', id: 4 },
], ],
temp: false, temp: false,
} }
@ -137,7 +134,7 @@
this.previewDetails = true this.previewDetails = true
break break
case 2: case 2:
this.title = '选择审批部门' this.title = '提交报废'
this.dialogWidth = '50%' this.dialogWidth = '50%'
this.selDepart = true this.selDepart = true
break break
@ -146,6 +143,9 @@
this.dialogWidth = '50%' this.dialogWidth = '50%'
this.auditingShow = true this.auditingShow = true
break break
case 4:
this.temp = !this.temp
break
} }
this.dialogVisible = true this.dialogVisible = true
@ -178,6 +178,10 @@
getTableSelectionChange(val) { getTableSelectionChange(val) {
this.tableSelList = val this.tableSelList = val
}, },
handleBack() {
this.temp = !this.temp
this.dialogVisible = false
},
}, },
} }
</script> </script>
@ -186,4 +190,13 @@
::v-deep .el-page-header__left { ::v-deep .el-page-header__left {
display: none; display: none;
} }
.back-text {
margin-bottom: 8px;
padding: 0 5px;
box-shadow: 1px 1px #ccc;
span {
font-weight: bold;
}
}
</style> </style>