haoxuan
2023-08-30 e1466bb804d07246357002f736f03e65c82455ef
列表 添加的组件增加 删除按钮和逻辑
2个文件已修改
13 ■■■■ 已修改文件
src/components/makepager/CommonFormTableView.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/components/AddPurchase.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonFormTableView.vue
@@ -6,7 +6,7 @@
      :show-summary="showSummary.show"
      :summary-method="getSummaries"
      :span-method="arraySpanMethod">
        <el-table-column type="index" label="编号" width="50" align="center"></el-table-column>
        <el-table-column type="index" v-if="tableList.tableColumn.length>0" label="编号" width="50" align="center"></el-table-column>
        <el-table-column
          v-for="(item, i) in tableList.tableColumn"
          :key="i"
@@ -47,6 +47,7 @@
                  v-model="scope.row[item.prop]"
                  :fetch-suggestions="querySearchAsync"
                  value-key="name"
                  style='width:calc(100% - 70px)'
                  size="mini"
                  @select="
                    (val) => {
@@ -60,7 +61,7 @@
                <div class="common-select-btn" @click="clearupClient(scope.row,scope)">
                  <i class="el-icon-remove-outline" title="清除"></i>
                </div>
                <div class="common-select-btn" @click="deleteClient(scope.row,scope)">
                <div class="common-select-btn" v-if="scope.$index!=0" @click="deleteClient(scope.row,scope)">
                  <i class="el-icon-delete" title="删除"></i>
                </div>
              </div>
@@ -462,6 +463,10 @@
      this.$emit("clearupProduct", this.tableList.tableData)
    },
    deleteClient(row,scope){
      if(this.tableList.tableData.length==1){
        this.$message.error('至少保留一条,不能刪除了!')
        return true;
      }
      this.tableList.tableData.splice(scope.$index,1)
    },
    
@@ -472,6 +477,7 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.page-view {
  min-width:100px;
  .el-form-item {
    margin-bottom: 0;
    .custom-name {
src/views/purchaseManage/purchase/components/AddPurchase.vue
@@ -27,7 +27,8 @@
                <el-form-item
                  label="采购类型"
                  prop="purchaseTypeId"
                  class="form-item float_left"
                  class="float_left"
                  style="width:100%;"
                >
                  <el-select
                    placeholder="请选择采购类型"