|
@@ -1994,20 +1994,24 @@
|
|
|
}
|
|
|
// 删除表格数据
|
|
|
doDeleteTable(item : any) {
|
|
|
- this.$confirm('确定删除吗!', '注意', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- center: true
|
|
|
- }).then(() => {
|
|
|
- // console.log(this.tableList);
|
|
|
- (this as any).tableList.map((v : any) => {
|
|
|
- if (v.dataIndex === item.dataIndex) v.isDeleted = 1;
|
|
|
- })
|
|
|
- let filterList = this.tableList.filter((v : any) => v.isDeleted !== 1);
|
|
|
- (this as any).$refs.table.setValue(filterList); // 设置表格数据
|
|
|
- this.$message.success('删除成功');
|
|
|
- }).catch(() => this.$message.info('已取消删除'));
|
|
|
+ if((this as any).tableList.length>1){
|
|
|
+ this.$confirm('确定删除吗!', '注意', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ center: true
|
|
|
+ }).then(() => {
|
|
|
+ // console.log(this.tableList);
|
|
|
+ (this as any).tableList.map((v : any) => {
|
|
|
+ if (v.dataIndex === item.dataIndex) v.isDeleted = 1;
|
|
|
+ })
|
|
|
+ let filterList = this.tableList.filter((v : any) => v.isDeleted !== 1);
|
|
|
+ (this as any).$refs.table.setValue(filterList); // 设置表格数据
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ }).catch(() => this.$message.info('已取消删除'));
|
|
|
+ }else{
|
|
|
+ this.$message.warning('物料属性不能为空,无法删除!')
|
|
|
+ }
|
|
|
}
|
|
|
// 获取物料属性
|
|
|
getAttribute() {
|