haoxuan
2023-10-10 b169e0fe3ecad3713880626bd6152c58d8ed4222
src/views/service/serviceFollowup/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>
@@ -26,7 +26,6 @@
          <TableCommonView
            ref="tableListRef"
            :table-list="tableList"
            :select-box="!isDetail"
            @selClientClick="selClientClick"
            @selCommonClick="selCommonClick"
            @selContactsClick="selContactsClick"
@@ -35,10 +34,10 @@
            @selTableCol="selTableCol"
          >
            <template slot="tableButton">
              <el-table-column label="操作" width="60">
              <el-table-column label="操作" width="100">
                <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>
@@ -163,12 +162,13 @@
  methods: {
    setTable() {
      this.tableList = {
        selectIndex: true,
        tableInfomation: [],
        allcol: [],
        showcol: this.showCol,
        tableColumn:this.setColumnVisible(this.showCol)
      }
      this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
      this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
@@ -177,7 +177,7 @@
      }
    },
    setColumnVisible(showCol){
      return  this.tableColumn.map(ele=>{
      return this.tableColumn.map((ele) => {
        return {
          ...ele,
          isShowColumn:showCol.includes(ele.label)
@@ -185,8 +185,8 @@
      })
    },
    selTableCol(val) {
      this.showcol = val;
      this.tableList.tableColumn = this.setColumnVisible(val);
      this.showcol = val
      this.tableList.tableColumn = this.setColumnVisible(val)
    },
    // 请求数据
    async getData() {
@@ -230,7 +230,7 @@
    // 搜索
    onFilterSearch(searchText){
      this.keyword = searchText ?? ""
      this.keywordType =searchText ? "回访单编号" : ''
      this.keywordType = searchText ? "回访单编号" : ""
      this.pagerOptions.currPage = 1
      this.getData()
    },
@@ -238,7 +238,7 @@
    addBtnClick() {
      this.editConfig.visible = true
      this.editConfig.title = "新建"
      this.editConfig.infomation = { ...this.addConfig }
      this.editConfig.infomation = { ...this.addConfig, client_name: "", contact_name: "", service_number: "" }
    },
    // 编辑
    handleClick(row) {
@@ -248,15 +248,15 @@
      this.editConfig.infomation = { ...row, service_number: row.ServiceOrder.serviceNumber }
    },
    // 删除
    delClick() {
      if (this.selValueList && this.selValueList.length > 0) {
    delClick(id) {
      // if (this.selValueList && this.selValueList.length > 0) {
        this.$confirm("是否确认删除?", "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            getDelServiceFollowup({ ids: this.selValueList }).then((response) => {
          getDelServiceFollowup({ ids: [id] }).then((response) => {
              if (response.code === 200) {
                this.$message.success("删除成功")
                this.getData()
@@ -266,9 +266,9 @@
            })
          })
          .catch(() => {})
      } else {
        this.$message.warning("请至少选择一条记录")
      }
      // } else {
      //   this.$message.warning("请至少选择一条记录")
      // }
    },
    getSelectArray(val) {
      console.log(val)