|
@@ -104,7 +104,7 @@
|
|
|
添加
|
|
添加
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
|
|
|
- <el-button
|
|
|
|
|
|
|
+ <!-- <el-button
|
|
|
size="small"
|
|
size="small"
|
|
|
type="danger"
|
|
type="danger"
|
|
|
icon="el-icon-delete"
|
|
icon="el-icon-delete"
|
|
@@ -112,10 +112,10 @@
|
|
|
@click="removeArr"
|
|
@click="removeArr"
|
|
|
>
|
|
>
|
|
|
删除
|
|
删除
|
|
|
- </el-button>
|
|
|
|
|
|
|
+ </el-button> -->
|
|
|
</div>
|
|
</div>
|
|
|
<el-table
|
|
<el-table
|
|
|
- :data="form.dictStaticSubmitPOList"
|
|
|
|
|
|
|
+ :data="tableData"
|
|
|
border
|
|
border
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
@selection-change="handleSelectionChange"
|
|
@selection-change="handleSelectionChange"
|
|
@@ -149,6 +149,21 @@
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column align="center" label="操作">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-popconfirm
|
|
|
|
|
+ class="ele-action"
|
|
|
|
|
+ title="确定要删除此字典项吗?"
|
|
|
|
|
+ @confirm="removeArr(scope)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template v-slot:reference>
|
|
|
|
|
+ <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </el-link>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-popconfirm>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
<template v-slot:footer>
|
|
<template v-slot:footer>
|
|
@@ -173,7 +188,7 @@
|
|
|
// 弹窗是否打开
|
|
// 弹窗是否打开
|
|
|
visible: Boolean,
|
|
visible: Boolean,
|
|
|
// 修改回显的数据
|
|
// 修改回显的数据
|
|
|
- id: String
|
|
|
|
|
|
|
+ id: String | Number
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
const defaultForm = {
|
|
const defaultForm = {
|
|
@@ -298,12 +313,12 @@
|
|
|
showOverflowTooltip: true
|
|
showOverflowTooltip: true
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
|
|
+ tableData: [],
|
|
|
// 表格选中数据
|
|
// 表格选中数据
|
|
|
selection: [],
|
|
selection: [],
|
|
|
datasource: {
|
|
datasource: {
|
|
|
list: []
|
|
list: []
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
// 提交状态
|
|
// 提交状态
|
|
|
loading: false,
|
|
loading: false,
|
|
|
// 是否是修改
|
|
// 是否是修改
|
|
@@ -311,9 +326,28 @@
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {},
|
|
created() {},
|
|
|
|
|
+
|
|
|
methods: {
|
|
methods: {
|
|
|
- pushArr() {},
|
|
|
|
|
- removeArr() {},
|
|
|
|
|
|
|
+ pushArr() {
|
|
|
|
|
+ this.form.dictStaticSubmitPOList.push({
|
|
|
|
|
+ code: '',
|
|
|
|
|
+ enable: 1,
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ sort: ''
|
|
|
|
|
+ });
|
|
|
|
|
+ this.filterArr();
|
|
|
|
|
+ },
|
|
|
|
|
+ removeArr(row) {
|
|
|
|
|
+ console.log(row);
|
|
|
|
|
+ let falg = this.form.dictStaticSubmitPOList[row.$index].deleted === 0;
|
|
|
|
|
+ if (falg) {
|
|
|
|
|
+ this.form.dictStaticSubmitPOList[row.$index].deleted = 1;
|
|
|
|
|
+ this.filterArr();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.form.dictStaticSubmitPOList.splice(row.$index, 1);
|
|
|
|
|
+ this.filterArr();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
handleSelectionChange() {},
|
|
handleSelectionChange() {},
|
|
|
/* 保存编辑 */
|
|
/* 保存编辑 */
|
|
|
save() {
|
|
save() {
|
|
@@ -336,6 +370,11 @@
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ filterArr() {
|
|
|
|
|
+ this.tableData = this.form.dictStaticSubmitPOList.filter(
|
|
|
|
|
+ (item) => item.deleted !== 1
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
/* 更新visible */
|
|
/* 更新visible */
|
|
|
updateVisible(value) {
|
|
updateVisible(value) {
|
|
|
this.$emit('update:visible', value);
|
|
this.$emit('update:visible', value);
|
|
@@ -346,7 +385,11 @@
|
|
|
this.form = res.data.dictInfoVO;
|
|
this.form = res.data.dictInfoVO;
|
|
|
|
|
|
|
|
this.form.dictStaticSubmitPOList = res.data.dictStaticVOList;
|
|
this.form.dictStaticSubmitPOList = res.data.dictStaticVOList;
|
|
|
- // this.datasource.list = this.from.dictStaticSubmitPOList;
|
|
|
|
|
|
|
+ if (this.form.dictStaticSubmitPOList.length > 0) {
|
|
|
|
|
+ this.filterArr();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.tableTata = [];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|