Sfoglia il codice sorgente

新加删除限制

Qukatie 1 settimana fa
parent
commit
1b5463bb86
1 ha cambiato i file con 7 aggiunte e 6 eliminazioni
  1. 7 6
      src/views/iosBasicData/advancePayment/index.vue

+ 7 - 6
src/views/iosBasicData/advancePayment/index.vue

@@ -31,12 +31,8 @@
       </template>
       <template slot-scope="{ row, index }" slot="menu">
         <el-button type="text" icon="el-icon-view" size="small" @click.stop="rowView(row, index)">查看 </el-button>
-        <el-button type="text" icon="el-icon-edit" size="small" @click.stop="rowEdit(row, index)" :disabled="row.usedAmount != 0"
-          >编辑
-        </el-button>
-        <el-button type="text" icon="el-icon-delete" size="small" @click.stop="rowDel(row,index)" :disabled="row.usedAmount != 0"
-          >删除
-        </el-button>
+        <el-button type="text" icon="el-icon-edit" size="small" @click.stop="rowEdit(row, index)" :disabled="row.usedAmount != 0">编辑 </el-button>
+        <el-button type="text" icon="el-icon-delete" size="small" @click.stop="rowDel(row, index)" :disabled="row.usedAmount != 0">删除 </el-button>
       </template>
       <template slot-scope="{ type, disabled }" slot="corpNameForm">
         <dic-select
@@ -448,6 +444,11 @@ export default {
         this.$message.warning("请选择至少一条数据");
         return;
       }
+      for (let item of this.selectionList) {
+        if (item.usedAmount != 0) {
+          return this.$message.error("使用金额大于0的不允许删除");
+        }
+      }
       let ids = [];
       this.selectionList.forEach((ele) => {
         ids.push(ele.id);