yangfeng
2023-08-11 6291de84d5f68f1f1cd90031c18183a2c1489555
src/views/sales/salesDetails/index.vue
@@ -9,9 +9,11 @@
        ref="searchCommonView"
        :query-class-options="queryClassOptions"
        :search-options="searchOptions"
        @searchClick="searchClick"
        @resetClick="resetClick"
      />
      <div class="btn-pager">
        <PublicFunctionBtnView :submit-approval="true" :operates-list="operatesList" />
        <PublicFunctionBtnView :submit-approval="true" :operates-list="operatesList" @batchDelete="delClick" />
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div>
    </div>
@@ -22,12 +24,13 @@
      :select-box="!isDetail"
      @selClientClick="selClientClick"
      @selCommonClick="selCommonClick"
      @getSelectArray="getSelectArray"
    >
      <template slot="tableButton">
        <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="delClick(scope.row.id)" type="text" size="small">删除</el-button> -->
          </template>
        </el-table-column>
      </template>
@@ -113,7 +116,9 @@
      clientDeail: {
        visible: false,
        infomation: {}
      }
      },
      selValueList: [],
      search_map: {}
    }
  },
  created() {
@@ -152,7 +157,7 @@
    async getData() {
      this.loading = true
      await getSalesDetailsList({
        keyword: "",
        search_map: this.search_map,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
@@ -182,6 +187,18 @@
          this.loading = false
        })
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val.value]: content
      }
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true
@@ -196,27 +213,35 @@
      this.editConfig.infomation = { ...row, sale_chance_name: "" }
    },
    // 删除
    delClick(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function () {
          return getDelSalesDetails({ id: id })
    delClick() {
      if (this.selValueList && this.selValueList.length > 0) {
        this.$confirm("是否确认删除?", "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
        .then((response) => {
          if (response.code === 200) {
            this.$message.success("删除成功")
            this.getData()
          } else {
            this.$message.warning("删除失败")
          }
        })
        .catch(function () {})
          .then(() => {
            getDelSalesDetails({ ids: this.selValueList }).then((response) => {
              if (response.code === 200) {
                this.$message.success("删除成功")
                this.getData()
              } else {
                this.$message.warning("删除失败")
              }
            })
          })
          .catch(() => {})
      } else {
        this.$message.warning("请至少选择一条记录")
      }
    },
    getSelectArray(val) {
      console.log(val)
      this.selValueList = []
      const list = val.map((item) => {
        return item.id
      })
      this.selValueList = list
    },
    // 客户名称详情
    selClientClick(row) {