haoxuan
2023-10-24 01cea4bc73210e43f748d82a02a432cce615be2d
src/views/sales/subOrder/index.vue
@@ -8,15 +8,13 @@
      <div class="filter-card">
        <CommonSearch
            :show-add="false"
            :show-download="false"
            :amount-view="false"
            :show-action-btn="false"
            placeholder="请输入单据编号"
            @searchClick="onFilterSearch"
        >
          <template slot="leftButton">
            <el-button size="small" type="primary"  @click="addBtnClick">新建</el-button>
            <el-button size="small"  @click="delClick">删除</el-button>
<!--            <el-button size="small"  @click="delClick">删除</el-button>-->
          </template>
        </CommonSearch>
      </div>
@@ -29,7 +27,6 @@
              ref="tableListRef"
              :table-list="tableList"
              :show-summary="showSummary"
              :select-box="!isDetail"
              @selClientClick="selClientClick"
              @selMasterClick="selMasterClick"
              @selCommonClick="selCommonClick"
@@ -40,7 +37,7 @@
              <el-table-column label="操作" width="90">
                <template slot-scope="scope">
                  <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
                  <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> -->
                   <el-button @click="deleteItem(scope.row.id)" type="text" size="small">删除</el-button>
                </template>
              </el-table-column>
            </template>
@@ -122,7 +119,7 @@
        infomation: {}
      },
      showSummary: {
        show: true,
        show: false,
        sumProp: ["productAmount"],
        mergeNumber: 6
      },
@@ -170,6 +167,7 @@
  methods: {
    setTable() {
      this.tableList = {
        selectIndex:true,
        tableInfomation: [],
        allcol: [],
        showcol: this.showCol,
@@ -284,6 +282,33 @@
        this.$message.warning("请至少选择一条记录")
      }
    },
    /**
     * 单个删除
     * @param id 销售子单id
     */
    deleteItem(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
          .then(() => {
            getDelSubOrder({ids: [id]}).then((response) => {
              if (response.code === 200) {
                this.$message.success("删除成功")
                this.getData()
              } else {
                this.$message.warning("删除失败")
              }
            })
          })
          .catch((err) => {
            if (err !== 'cancel') {
              console.error(err)
              this.$message.warning("删除失败")
            }
          })
    },
    getSelectArray(val) {
      console.log(val)
      this.selValueList = []