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

View File

@ -10,18 +10,30 @@
:handleWidth="`180px`"
@getTableSelectionChange="getTableSelectionChange"
>
<template slot="finish">
<template slot="submitScrap">
<el-col :span="1.5">
<el-button
type="warning"
plain
size="mini"
@click="submitScrap"
<el-button type="warning" plain size="mini"
>完成退料</el-button
>
</el-col>
</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>
<DialogModel
:title="title"
:dialogVisible="dialogVisible"
:width="dialogWidth"
@closeDialog="closeDialog"
></DialogModel>
</div>
</template>
@ -40,10 +52,35 @@
data() {
return {
config,
title: '',
dialogVisible: false,
handleBtn: [
{ btn_title: '查看', id: 1 },
{ btn_title: '编辑退料', id: 2 },
{ btn_title: '撤回', id: 3 },
],
}
},
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() {},
closeDialog(val) {
this.dialogVisible = val
},
},
}
</script>

View File

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