中航光电热表web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.7 KiB

1 month ago
<template>
3 weeks ago
<el-dialog title="新增" append-to-body :modelValue="openShow" width="70%" @close="closeDialog">
<div style="margin-bottom: 12px" v-if="moldAddMore">
<el-button type="primary" @click="addTable">插入一行</el-button>
1 month ago
3 weeks ago
<el-button type="danger" @click="delTable">删除行</el-button>
</div>
1 month ago
3 weeks ago
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="partName" label="月份" align="center">
<template #header>
<span><i style="color: red">*</i>月份</span>
1 month ago
</template>
3 weeks ago
<template #default="scope">
<span>{{ scope.row.partName }}</span>
</template>
</el-table-column>
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</template>
</el-dialog>
1 month ago
</template>
<script>
export default {
3 weeks ago
props: {
showDialog: {
type: Boolean,
default: false,
1 month ago
},
3 weeks ago
moldAddMore: {
type: Boolean,
default: false,
1 month ago
},
3 weeks ago
},
data() {
return {
openShow: false,
tableData: [],
};
},
mounted() {
this.openShow = this.showDialog;
},
methods: {
closeDialog() {
this.openShow = false;
this.$emit('closeDialog');
1 month ago
},
3 weeks ago
// 插入一行
addTable() {
this.tableData.push({
code: '3',
No: '3',
number: '3',
shuliang: '',
shuliang: 0,
memo: '',
});
},
// 删除一行
delTable(row, index) {
this.tableData.splice(index, 1);
},
},
};
1 month ago
</script>
3 weeks ago
<style lang="scss" scoped></style>