src/views/sales/salesOpportunity/index.vue
@@ -10,13 +10,12 @@
            :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>
@@ -28,6 +27,7 @@
          <TableCommonView
              ref="tableListRef"
              :table-list="tableList"
              :select-box="false"
              @selClientClick="selClientClick"
              @selContactsClick="selContactsClick"
              @selCommonClick="selCommonClick"
@@ -35,11 +35,11 @@
              @selTableCol="selTableCol"
          >
            <template slot="tableButton">
              <el-table-column label="操作" width="100">
              <el-table-column label="操作" width="120">
                <template slot-scope="scope">
                  <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
                  <el-button @click="followupClick(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>
@@ -167,7 +167,7 @@
      this.search_map = {}
    } else {
      this.search_map = {
        [this.addConfig.id_name]: this.addConfig.client_name
        [this.addConfig.id_name]: this.addConfig.id
      }
    }
    this.getData(this.search_map)
@@ -175,6 +175,7 @@
  methods: {
    setTable() {
      this.tableList = {
        selectIndex:true,
        tableInfomation: [],
        allcol: [],
        showcol: this.showCol,
@@ -248,7 +249,7 @@
    addBtnClick() {
      this.editConfig.visible = true
      this.editConfig.title = "新建"
      this.editConfig.infomation = { city_id: 0, ...this.addConfig }
      this.editConfig.infomation = { city_id: 0, ...this.addConfig,currency:1,}
    },
    // 编辑
    handleClick(row) {
@@ -257,7 +258,7 @@
      this.editConfig.title = "编辑"
      this.editConfig.infomation = { ...row }
    },
    // 删除
    // 批量删除
    delClick() {
      if (this.selValueList && this.selValueList.length > 0) {
        this.$confirm("是否确认删除?", "警告", {
@@ -280,6 +281,33 @@
      } else {
        this.$message.warning("请至少选择一条记录")
      }
    },
    /**
     * 单个删除
     * @param id 销售机会id
     */
    deleteItem(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
          .then(() => {
            getDelSaleChance({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)
@@ -321,14 +349,16 @@
    // 跟进
    followupClick(row) {
      console.log(row)
      this.editFollowupConfig.visible = true
      this.editFollowupConfig.title = "新建"
      this.editFollowupConfig.infomation = {
        ...row,
        currency:1,
        number: "",
        sale_chance_name: row.name,
        sale_chance_id: row.id
      }
      this.editFollowupConfig.infomation.codeStandID=''
      this.editFollowupConfig.visible = true
    }
  }
}