yangfeng
2023-08-09 acdff03246ce648082192dfb069c3a006a7fbee6
src/views/service/serviceFollowup/AddServiceFollowupDialog.vue
@@ -5,6 +5,8 @@
      :visible.sync="editConfig.visible"
      :width="dialogWidth"
      :before-close="handleClose"
      append-to-body
      custom-class="iframe-dialog"
    >
      <el-form
        ref="form"
@@ -22,11 +24,20 @@
          <div class="basic-info-view">
            <el-row>
              <el-col :span="12">
                <el-form-item label="客户名称" prop="clientId">
                <el-form-item label="客户名称" prop="client_name">
                  <div class="custom-name">
                    <el-input v-model="editConfig.infomation.clientId"></el-input>
                    <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="选择"></i></div>
                    <div class="common-select-btn"><i class="el-icon-edit" title="编辑"></i></div>
                    <el-autocomplete
                      v-model="editConfig.infomation.client_name"
                      :fetch-suggestions="querySearchAsync"
                      value-key="name"
                      @select="handleSelectClient"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
@@ -189,11 +200,16 @@
          </div>
        </div>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="saveClick('form')">保存</el-button>
        <el-button size="small" @click="editConfig.visible = false">取消</el-button>
      </div>
      <!-- 选择客户 -->
      <SelectClientDialog
        v-if="editSelectClientConfig.editVisible"
        :edit-common-config="editSelectClientConfig"
        @selClient="selClient"
      />
    </el-dialog>
  </div>
</template>
@@ -201,6 +217,7 @@
<script>
import { getAllData } from "@/api/client/client"
import { getAddServiceFollowup, getUpdateServiceFollowup } from "@/api/serviceManage/serviceFollowup"
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
export default {
  name: "AddServiceFollowupDialog",
  props: {
@@ -215,10 +232,13 @@
      }
    }
  },
  components: {},
  components: { SelectClientDialog },
  computed: {
    searchCommonHeight() {
      return this.$refs.searchCommonView.offsetHeight
    },
    clientList() {
      return this.$store.state.getClientName.clientList
    }
  },
  data() {
@@ -234,10 +254,16 @@
      solveRateOptions: [], // 解决率
      oldMemberOptions: [], // 原服务人员
      isVisitOptions: [], // 服务人员是否来过
      memberOptions: []
      memberOptions: [],
      editSelectClientConfig: {
        editVisible: false,
        title: "",
        infomation: {}
      }
    }
  },
  created() {
    this.$store.dispatch("geClient")
    this.getCommonData()
  },
  methods: {
@@ -245,6 +271,11 @@
      getAllData()
        .then((res) => {
          this.memberOptions = res.data.member
          this.satisfactionOptions = res.data.satisfaction // 满意度
          this.timelyRateOptions = res.data.timely_rate // 及时率
          this.solveRateOptions = res.data.solve_rate // 解决率
          this.oldMemberOptions = res.data.member // 原服务人员
          this.isVisitOptions = res.data.isVisit // 服务人员是否来过
        })
        .catch((err) => {
          console.log(err)
@@ -319,6 +350,33 @@
    handleClose() {
      this.editConfig.visible = false
    },
    // 选择客户相关方法
    querySearchAsync(queryString, cb) {
      var restaurants = this.clientList
      var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants
      cb(results)
    },
    createStateFilter(queryString) {
      return (state) => {
        return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
      }
    },
    handleSelectClient(item) {
      this.editConfig.infomation.client_id = item.id
    },
    selClientClick() {
      this.editSelectClientConfig.editVisible = true
    },
    selClient(row) {
      console.log(row)
      this.editConfig.infomation.client_name = row.name
      this.editConfig.infomation.client_id = row.id
    },
    // 清除已选择用户
    clearupClient() {
      this.editConfig.infomation.client_name = ""
      this.editConfig.infomation.client_id = 0
    },
    // 添加附件
    addAnnexClick() {},
    // 设置允许上传文件格式
@@ -329,58 +387,54 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.service-followup {
  .basic-info {
    .basic-info-title {
      background-color: #f4f8fe;
      padding-left: 10px;
      font-size: 15px;
      font-weight: bold;
      color: #666;
      height: 42px;
      line-height: 42px;
    }
    .basic-info-view {
      margin-top: 10px;
      padding-right: 40px;
      .custom-name {
        display: flex;
        .common-select-btn {
          margin-left: 5px;
          font-size: 18px;
::v-deep {
  .iframe-dialog .el-dialog__body {
    .basic-info {
      .basic-info-title {
        background-color: #f4f8fe;
        padding-left: 10px;
        font-size: 15px;
        font-weight: bold;
        color: #666;
        height: 42px;
        line-height: 42px;
      }
      .basic-info-view {
        margin-top: 10px;
        padding-right: 40px;
        .custom-name,
        .common-select {
          display: flex;
          .common-select-sel {
            width: 270px;
          }
          .common-select-btn {
            margin-left: 5px;
            font-size: 16px;
            cursor: pointer;
          }
        }
      }
      .common-select {
      .annex-view {
        display: flex;
        .common-select-sel {
          width: 270px;
        }
        .common-select-btn {
          margin-left: 5px;
          font-size: 16px;
          cursor: pointer;
        color: #6166d3;
        .setFormat {
          margin-left: 10px;
        }
      }
    }
    .annex-view {
    .unflod-collapse {
      display: flex;
      height: 30px;
      justify-content: center;
      align-items: center;
      color: #6166d3;
      .setFormat {
        margin-left: 10px;
      }
    }
  }
  .unflod-collapse {
    display: flex;
    height: 30px;
    justify-content: center;
    align-items: center;
    color: #6166d3;
  }
  .dialog-footer {
    background-color: #f5f5f5;
    height: 55px;
    line-height: 55px;
    .dialog-footer {
      background-color: #f5f5f5;
      height: 55px;
      line-height: 55px;
    }
  }
}
</style>