yangfeng
2023-10-16 61883fcf237024ceb7622daf5b23434e3eb1be74
src/views/client/contacts/index.vue
@@ -15,7 +15,7 @@
        >
          <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>
@@ -34,11 +34,11 @@
              @selTableCol="selTableCol"
          >
            <template slot="tableButton">
              <el-table-column label="操作" width="90" fixed="right">
              <el-table-column label="操作" width="120" fixed="right">
                <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="followupClick(scope.row)" type="text" size="small">跟进</el-button> -->
                  <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button>
                </template>
              </el-table-column>
            </template>
@@ -156,6 +156,7 @@
  methods: {
    setTable() {
      this.tableList = {
        selectIndex: true,
        tableInfomation: [],
        allcol: [],
        showcol: this.showCol,
@@ -238,15 +239,24 @@
      this.editConfig.infomation = { ...row }
    },
    // 删除
    delClick() {
      if (this.selValueList && this.selValueList.length > 0) {
    delClick(id) {
      if(!id){
        if (this.selValueList && this.selValueList.length == 0) {
          this.$message.warning("请至少选择一条记录")
          return true;
        }
      }
        this.$confirm("是否确认删除?", "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            getDeleteContact({ ids: this.selValueList }).then((response) => {
            let params={ids: this.selValueList }
            if(id){
              params={ids: [id]}
            }
            getDeleteContact(params).then((response) => {
              if (response.code === 200) {
                this.$message.success("删除成功")
                this.getData()
@@ -256,9 +266,6 @@
            })
          })
          .catch(() => {})
      } else {
        this.$message.warning("请至少选择一条记录")
      }
    },
    getSelectArray(val) {
      console.log(val)
@@ -289,13 +296,14 @@
    // 跟进
    followupClick(row) {
      console.log(row)
      this.editFollowupConfig.visible = true
      this.editFollowupConfig.title = "新建"
      this.editFollowupConfig.infomation = {
        ...row,
        client_name: row.Client.name,
        number: ""
        number: "",
        codeStandID:''
      }
      this.editFollowupConfig.visible = true
    }
  }
}