yangfeng
2023-08-10 ed2f130164f4145560b4176da6629890c0806ded
服务管理模块联调
23个文件已修改
1160 ■■■■ 已修改文件
src/api/common/other.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/serviceManage/clientServiceOrder.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/serviceManage/serviceContract.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/serviceManage/serviceFollowup.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/SearchCommonView.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/getClientName.js 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/client/DetailClientManage.vue 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/client/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/contacts/DetailContacts.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/contacts/index.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/followupRecords/index.vue 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/salesLead/AdvanceDialog.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/salesLead/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/other/commonDialog/SelectCommonDialog.vue 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/service/clientServiceOrder/DetailClientServiceOrder.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/service/clientServiceOrder/index.vue 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/service/serviceContract/AddServiceContractDialog.vue 327 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/service/serviceContract/DetailServiceContract.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/service/serviceContract/index.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/service/serviceFollowup/AddServiceFollowupDialog.vue 221 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/service/serviceFollowup/DetailServiceFollowup.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/service/serviceFollowup/index.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/common/other.js
@@ -39,3 +39,11 @@
    method: "get"
  })
}
// 获取服务合同类型
export function getServiceContractTypeList() {
  return request({
    url: "/api/serviceContractType/list",
    method: "get"
  })
}
src/api/serviceManage/clientServiceOrder.js
@@ -1,10 +1,11 @@
import request from "@/common/untils/request.js"
// 服务单列表
export function getServiceOrderList() {
export function getServiceOrderList(data) {
  return request({
    url: "/api/serviceOrder/list",
    method: "get"
    method: "post",
    data
  })
}
// 添加服务单
@@ -18,8 +19,9 @@
// 删除服务单
export function getDelServiceOrder(data) {
  return request({
    url: "/api/serviceOrder/delete/" + data.id,
    method: "delete"
    url: "/api/serviceOrder/delete",
    method: "delete",
    data
  })
}
// 更新服务单
src/api/serviceManage/serviceContract.js
@@ -19,8 +19,9 @@
// 删除服务合同
export function getDelServiceContract(data) {
  return request({
    url: "/api/serviceContract/delete/" + data.id,
    method: "delete"
    url: "/api/serviceContract/delete",
    method: "delete",
    data
  })
}
// 更新服务合同
src/api/serviceManage/serviceFollowup.js
@@ -19,8 +19,9 @@
// 删除服务回访单
export function getDelServiceFollowup(data) {
  return request({
    url: "/api/serviceFollowup/delete/" + data.id,
    method: "delete"
    url: "/api/serviceFollowup/delete",
    method: "delete",
    data
  })
}
// 更新服务回访单
src/components/makepager/SearchCommonView.vue
@@ -14,8 +14,7 @@
      <div class="search">
        <el-input placeholder="请输入内容" v-model="searchInput" class="input-with-select" clearable>
          <el-select v-model="searchSelValue" slot="prepend" placeholder="请选择" class="search-sel">
            <el-option v-for="item in searchOptions" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
            <el-option v-for="item in searchOptions" :key="item.value" :label="item.label" :value="item"> </el-option>
          </el-select>
          <!-- <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="searchClick"></i> -->
        </el-input>
@@ -110,8 +109,13 @@
      default: () => []
    },
    searchSel: {
      type: String,
      default: "name"
      type: Object,
      default: () => {
        return {
          value: "name",
          label: ""
        }
      }
    },
    searchOptions: {
      type: Array,
src/store/modules/getClientName.js
@@ -6,6 +6,8 @@
import { getServiceContractList } from "@/api/serviceManage/serviceContract"
import { getContractList } from "@/api/sales/contractManage"
import { getSalesDetailsList } from "@/api/sales/salesDetails"
import { getQuotationList } from "@/api/sales/quotation"
import { getServiceOrderList } from "@/api/serviceManage/clientServiceOrder"
import { Message } from "element-ui"
export default {
@@ -17,7 +19,9 @@
    masterOrderList: [], // 销售总单
    serviceContractList: [], // 服务合同
    getContractList: [], // 合同订单
    salesDetailsList: [] // 销售明细单
    salesDetailsList: [], // 销售明细单
    quotationList: [], // 报价单
    serviceOrderList: [] // 客户服务单
  },
  mutations: {
    clientNameList(state, payload) {
@@ -43,6 +47,12 @@
    },
    salesDetailsList(state, payload) {
      state.salesDetailsList = payload
    },
    quotationList(state, payload) {
      state.quotationList = payload
    },
    serviceOrderList(state, payload) {
      state.serviceOrderList = payload
    }
  },
  actions: {
@@ -117,6 +127,24 @@
          Message.error(res.msg)
        }
      })
    },
    geQuotation(context) {
      getQuotationList().then((res) => {
        if (res.code == 200) {
          context.commit("quotationList", res.data.list)
        } else {
          Message.error(res.msg)
        }
      })
    },
    geServiceOrder(context) {
      getServiceOrderList().then((res) => {
        if (res.code == 200) {
          context.commit("serviceOrderList", res.data.data)
        } else {
          Message.error(res.msg)
        }
      })
    }
  }
}
src/views/client/client/DetailClientManage.vue
@@ -44,11 +44,11 @@
                <li v-for="(item, i) in basicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
@@ -66,11 +66,11 @@
                <li v-for="(item, i) in contactList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
@@ -88,11 +88,11 @@
                <li v-for="(item, i) in dynamicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
@@ -110,11 +110,11 @@
                <li v-for="(item, i) in businessInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
@@ -132,11 +132,11 @@
                <li v-for="(item, i) in addressInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
src/views/client/client/index.vue
@@ -213,7 +213,7 @@
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val]: content
        [val.value]: content
      }
      this.getData()
    },
src/views/client/contacts/DetailContacts.vue
@@ -39,11 +39,11 @@
                <li v-for="(item, i) in basicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
@@ -61,11 +61,11 @@
                <li v-for="(item, i) in addressInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
src/views/client/contacts/index.vue
@@ -9,6 +9,8 @@
        ref="searchCommonView"
        :query-class-options="queryClassOptions"
        :search-options="searchOptions"
        @searchClick="searchClick"
        @resetClick="resetClick"
      />
      <div class="btn-pager">
        <PublicFunctionBtnView :operates-list="operatesList" :allocation="false" @batchDelete="delClick" />
@@ -105,7 +107,8 @@
        visible: false,
        title: "新建",
        infomation: {}
      }
      },
      search_map: {}
    }
  },
  created() {
@@ -137,7 +140,7 @@
    async getData() {
      this.loading = true
      await getContactList({
        keyword: "",
        search_map: this.search_map,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
@@ -168,6 +171,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
src/views/client/followupRecords/index.vue
@@ -9,6 +9,9 @@
        ref="searchCommonView"
        :query-class-options="queryClassOptions"
        :search-options="searchOptions"
        :search-sel="searchSel"
        @searchClick="searchClick"
        @resetClick="resetClick"
      />
      <div class="btn-pager">
        <PublicFunctionBtnView :statistics="true" :operates-list="operatesList" @batchDelete="delClick" />
@@ -103,7 +106,12 @@
        visible: false,
        infomation: {}
      },
      selValueList: []
      selValueList: [],
      searchSel: {
        value: "topic",
        label: ""
      },
      search_map: {}
    }
  },
  created() {
@@ -129,14 +137,15 @@
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getFollowRecordList({
        keyword: "",
        search_map: this.search_map,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
@@ -169,6 +178,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
src/views/client/salesLead/AdvanceDialog.vue
@@ -95,18 +95,18 @@
  },
  methods: {
    setData(status) {
      if (status === 1) {
        this.options = ["新建", "失败关闭", "升级到客户", "升级到客户和销售机会"]
        this.value = "失败关闭"
        this.value1 = "失败关闭"
      } else if (status === -1) {
        this.options = ["新建", "跟进中", "升级到客户", "升级到客户和销售机会"]
        this.value = "升级到客户"
        this.value1 = "升级到客户"
      } else {
      if (status === 0) {
        this.options = ["跟进中", "失败关闭", "升级到客户", "升级到客户和销售机会"]
        this.value = "跟进中"
        this.value1 = "跟进中"
      } else if (status === 1) {
        this.options = ["失败关闭", "升级到客户", "升级到客户和销售机会"]
        this.value = "失败关闭"
        this.value1 = "失败关闭"
      } else if (status === -1) {
        this.options = ["升级到客户", "升级到客户和销售机会"]
        this.value = "升级到客户"
        this.value1 = "升级到客户"
      }
    },
    handleClose() {
src/views/client/salesLead/index.vue
@@ -175,7 +175,7 @@
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val]: content
        [val.value]: content
      }
      this.getData()
    },
src/views/other/commonDialog/SelectCommonDialog.vue
@@ -97,6 +97,27 @@
            { label: "合计", prop: "tptal" } // 合计
          ]
        }
      } else if (this.editConfig.title === "报价单") {
        this.tableList = {
          tableInfomation: this.editConfig.tableInfomation,
          tableColumn: [
            { label: "报价单号", prop: "number", isClick: true }, // 报价单号
            { label: "销售负责人", prop: "memberId" } // 销售负责人
          ]
        }
      } else if (this.editConfig.title === "客户服务单") {
        this.tableList = {
          tableInfomation: this.editConfig.tableInfomation,
          tableColumn: [
            { label: "服务单编号", prop: "serviceNumber", isClick: true }, // 服务单编号
            { label: "主题", prop: "subject" }, // 主题
            { label: "服务方式", prop: "serviceType_name" }, // 服务方式
            { label: "服务人员", prop: "serviceManId" }, // 服务人员
            { label: "优先级别", prop: "priorityLevelId" }, // 优先级别
            { label: "处理状态", prop: "status" }, // 处理状态
            { label: "客户签名", prop: "qianming" } // 客户签名
          ]
        }
      }
      this.commonOptions = [{ id: 1, name: "全部字段" }]
@@ -116,6 +137,10 @@
        this.$emit("selClient", row, "serviceContract")
      } else if (this.editConfig.title === "销售明细单") {
        this.$emit("selClient", row, "contract")
      } else if (this.editConfig.title === "报价单") {
        this.$emit("selClient", row, "quotation")
      } else if (this.editConfig.title === "客户服务单") {
        this.$emit("selClient", row, "customService")
      }
    }
  }
src/views/service/clientServiceOrder/AddCientServiceOrderDialog.vue
@@ -81,6 +81,7 @@
                      class="common-select-sel"
                      size="mini"
                    >
                      <!-- @focus="getFaultTypeList" -->
                      <el-option v-for="item in faultTypeOptions" :key="item.id" :label="item.name" :value="item.id">
                      </el-option>
                    </el-select>
@@ -520,7 +521,7 @@
        :edit-common-config="editSelectClientConfig"
        @selClient="selClient"
      />
      <!-- 选择服务合同 -->
      <!-- 选择服务合同 合同订单 -->
      <SelectCommonDialog
        v-if="editSelCommonConfig.editVisible"
        :edit-common-config="editSelCommonConfig"
@@ -680,15 +681,12 @@
      }
    },
    getCommonData() {
      getAllData()
        .then((res) => {
          this.memberOptions = res.data.member
          this.serviceManOptions = res.data.member
          this.reportSourceOptions = res.data.reportSource
        })
        .catch((err) => {
          console.log(err)
        })
      getAllData().then((res) => {
        this.memberOptions = res.data.member
        this.serviceManOptions = res.data.member
        this.reportSourceOptions = res.data.reportSource
      })
      this.getServiceTypeList()
    },
    // 保存
    saveClick(formName) {
@@ -899,17 +897,11 @@
      }
    },
    // 故障类别
    async getFaultTypeList(e) {
      if (e) {
        await getFaultTypeList()
          .then((res) => {
            console.log(res)
            this.faultTypeOptions = res.data.data
          })
          .catch((err) => {
            console.log(err)
          })
      }
    async getFaultTypeList() {
      await getFaultTypeList().then((res) => {
        console.log(res)
        this.faultTypeOptions = res.data.data
      })
    },
    // 服务方式
    async getServiceTypeList() {
src/views/service/clientServiceOrder/DetailClientServiceOrder.vue
@@ -40,7 +40,7 @@
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
@@ -62,7 +62,7 @@
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
@@ -84,7 +84,7 @@
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
src/views/service/clientServiceOrder/index.vue
@@ -9,9 +9,17 @@
        ref="searchCommonView"
        :query-class-options="queryClassOptions"
        :search-options="searchOptions"
        :search-sel="searchSel"
        @searchClick="searchClick"
        @resetClick="resetClick"
      />
      <div class="btn-pager">
        <PublicFunctionBtnView :receive="true" :submit-approval="true" :operates-list="operatesList" />
        <PublicFunctionBtnView
          :receive="true"
          :submit-approval="true"
          :operates-list="operatesList"
          @batchDelete="delClick"
        />
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div>
    </div>
@@ -21,12 +29,13 @@
      :select-box="!isDetail"
      @selClientClick="selClientClick"
      @selCommonClick="selCommonClick"
      @getSelectArray="getSelectArray"
    >
      <template slot="tableButton">
        <el-table-column label="操作" width="90">
        <el-table-column label="操作" width="60">
          <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>
@@ -93,7 +102,12 @@
      clientDeail: {
        visible: false,
        infomation: {}
      }
      },
      searchSel: {
        value: "serviceNumber",
        label: "服务单编号"
      },
      selValueList: []
    }
  },
  created() {
@@ -118,13 +132,19 @@
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    // 请求数据
    async getData() {
    async getData(keyword, keywordType) {
      this.loading = true
      await getServiceOrderList()
      await getServiceOrderList({
        keyword: keyword,
        keywordType: keywordType,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
@@ -157,6 +177,15 @@
    tabsClick(tab, event) {
      console.log(tab, event)
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.getData(content, val.label)
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true
@@ -171,33 +200,46 @@
      this.editConfig.infomation = { ...row }
    },
    // 删除
    delClick(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function () {
          return getDelServiceOrder({ 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(() => {
            getDelServiceOrder({ 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) {
      console.log(row)
      this.clientDeail.visible = true
      this.clientDeail.infomation = { ...row, client_name: row.name }
      this.clientDeail.infomation = {
        ...row.Client,
        client_name: row.Client.name,
        client_level: row.Client.client_level.name,
        client_status: row.Client.client_status.name
      }
    },
    // 客户服务单详情
    selCommonClick(row) {
src/views/service/serviceContract/AddServiceContractDialog.vue
@@ -28,14 +28,18 @@
                  <div class="custom-name">
                    <el-autocomplete
                      v-model="editConfig.infomation.client_name"
                      :fetch-suggestions="querySearchAsync"
                      :fetch-suggestions="
                        (queryString, callback) => {
                          querySearchAsync(queryString, callback, 'client')
                        }
                      "
                      value-key="name"
                      @select="handleSelectClient"
                      @select="handleSelectClient('client', $event)"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick">
                    <div class="common-select-btn" @click="selClientClick('client')">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient">
                    <div class="common-select-btn" @click="clearupClient('client')">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    </div>
                  </div>
@@ -62,36 +66,88 @@
              <el-col :span="12">
                <el-form-item label="联系人姓名" prop="contactId">
                  <div class="custom-name">
                    <el-input v-model="editConfig.infomation.contactId"></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.contact_name"
                      :fetch-suggestions="
                        (queryString, callback) => {
                          querySearchAsync(queryString, callback, 'contact')
                        }
                      "
                      value-key="name"
                      @select="handleSelectClient('contact', $event)"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('contact')">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient('contact')">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="销售机会" prop="saleChanceId">
                  <div class="custom-name">
                    <el-input v-model="editConfig.infomation.saleChanceId"></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.sale_chance_name"
                      :fetch-suggestions="
                        (queryString, callback) => {
                          querySearchAsync(queryString, callback, 'chance')
                        }
                      "
                      value-key="name"
                      @select="handleSelectClient('chance', $event)"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('chance')">
                      <i class="el-icon-circle-plus-outline"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient('chance')">
                      <i class="el-icon-edit-outline"></i>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="合同订单" prop="contractId">
                  <div class="custom-name">
                    <el-input v-model="editConfig.infomation.contractId"></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.contract_number"
                      :fetch-suggestions="
                        (queryString, callback) => {
                          querySearchAsync(queryString, callback, 'contract')
                        }
                      "
                      value-key="number"
                      @select="handleSelectClient('contract', $event)"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('contract')">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient('contract')">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="报价单" prop="quotationId">
                  <div class="custom-name">
                    <el-input v-model="editConfig.infomation.quotationId"></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.quotation_number"
                      :fetch-suggestions="
                        (queryString, callback) => {
                          querySearchAsync(queryString, callback, 'quotation')
                        }
                      "
                      value-key="number"
                      @select="handleSelectClient('quotation', $event)"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('quotation')">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient('quotation')">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
@@ -113,19 +169,34 @@
              </el-col>
              <el-col :span="12">
                <el-form-item label="签约日期" prop="signTime">
                  <el-date-picker v-model="editConfig.infomation.signTime" type="date" placeholder="选择日期">
                  <el-date-picker
                    v-model="editConfig.infomation.signTime"
                    value-format="yyyy-MM-dd"
                    type="date"
                    placeholder="选择日期"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="服务开始日期" prop="startTime">
                  <el-date-picker v-model="editConfig.infomation.startTime" type="date" placeholder="选择日期">
                  <el-date-picker
                    v-model="editConfig.infomation.startTime"
                    value-format="yyyy-MM-dd"
                    type="date"
                    placeholder="选择日期"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="服务到期日" prop="endTime">
                  <el-date-picker v-model="editConfig.infomation.endTime" type="date" placeholder="选择日期">
                  <el-date-picker
                    v-model="editConfig.infomation.endTime"
                    value-format="yyyy-MM-dd"
                    type="date"
                    placeholder="选择日期"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
@@ -290,6 +361,24 @@
        :edit-common-config="editSelectClientConfig"
        @selClient="selClient"
      />
      <!-- 选择联系人 -->
      <SelectContactDialog
        v-if="editSelectContactConfig.editVisible"
        :edit-common-config="editSelectContactConfig"
        @selClient="selClient"
      />
      <!-- 选择销售机会 -->
      <SelectChanceDialog
        v-if="editSelectChanceConfig.editVisible"
        :edit-common-config="editSelectChanceConfig"
        @selClient="selClient"
      />
      <!-- 合同订单 -->
      <SelectCommonDialog
        v-if="editSelCommonConfig.editVisible"
        :edit-common-config="editSelCommonConfig"
        @selClient="selClient"
      />
    </el-dialog>
  </div>
</template>
@@ -299,6 +388,9 @@
import { getAllData } from "@/api/client/client"
import { getAddServiceContract, getUpdateServiceContract } from "@/api/serviceManage/serviceContract"
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog"
import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"
import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
export default {
  name: "AddServiceContractDialog",
  props: {
@@ -313,13 +405,25 @@
      }
    }
  },
  components: { CommonFormTableView, SelectClientDialog },
  components: { CommonFormTableView, SelectClientDialog, SelectContactDialog, SelectChanceDialog, SelectCommonDialog },
  computed: {
    searchCommonHeight() {
      return this.$refs.searchCommonView.offsetHeight
    },
    clientList() {
      return this.$store.state.getClientName.clientList
    },
    contactNamelist() {
      return this.$store.state.getClientName.contactNamelist
    },
    saleChancelist() {
      return this.$store.state.getClientName.saleChancelist
    },
    salesDetailsList() {
      return this.$store.state.getClientName.salesDetailsList
    },
    quotationList() {
      return this.$store.state.getClientName.quotationList
    }
  },
  data() {
@@ -351,11 +455,35 @@
        editVisible: false,
        title: "",
        infomation: {}
      }
      },
      editSelectContactConfig: {
        editVisible: false,
        title: "",
        infomation: {}
      },
      editSelectChanceConfig: {
        editVisible: false,
        title: "",
        infomation: {}
      },
      editSelCommonConfig: {
        editVisible: false,
        title: "",
        infomation: {}
      },
      clientId: this.editCommonConfig.infomation.clientId,
      contactId: this.editCommonConfig.infomation.contactId,
      saleChanceId: this.editCommonConfig.infomation.saleChanceId,
      contractId: this.editCommonConfig.infomation.salesDetailsId,
      quotationId: this.editCommonConfig.infomation.quotationId
    }
  },
  created() {
    this.$store.dispatch("geClient")
    this.$store.dispatch("geContact")
    this.$store.dispatch("geChance")
    this.$store.dispatch("geSalesDetails")
    this.$store.dispatch("geQuotation")
    this.setTableForm()
    this.getCommonData()
  },
@@ -382,37 +510,23 @@
          const params = this.saveParams()
          console.log(params)
          if (this.editConfig.title === "新建") {
            getAddServiceContract(params)
              .then((res) => {
                console.log(res)
                this.editConfig.visible = false
                if (res.code === 200) {
                  this.$message({
                    message: "添加成功",
                    type: "success"
                  })
                  this.$parent.getData()
                }
              })
              .catch((err) => {
                console.log(err)
              })
            getAddServiceContract(params).then((res) => {
              console.log(res)
              this.editConfig.visible = false
              if (res.code === 200) {
                this.$message.success("添加成功")
                this.$parent.getData()
              }
            })
          } else {
            getUpdateServiceContract(params)
              .then((res) => {
                console.log(res)
                this.editConfig.visible = false
                if (res.code === 200) {
                  this.$message({
                    message: "编辑成功",
                    type: "success"
                  })
                  this.$parent.getData()
                }
              })
              .catch((err) => {
                console.log(err)
              })
            getUpdateServiceContract(params).then((res) => {
              console.log(res)
              this.editConfig.visible = false
              if (res.code === 200) {
                this.$message.success("编辑成功")
                this.$parent.getData()
              }
            })
          }
        } else {
          console.log("error submit")
@@ -424,9 +538,8 @@
      let data = this.editConfig.infomation
      let params = {
        id: this.editConfig.title === "新建" ? 0 : data.id,
        clientId: parseInt(data.clientId) || 0,
        contactId: data.contactId || 0,
        contractId: data.contractId || 0,
        clientId: this.clientId || 0,
        contactId: this.contactId || 0,
        endTime: data.endTime || "",
        memberId: data.memberId || 0,
        number: data.number || "",
@@ -441,9 +554,10 @@
            total: 0
          }
        ],
        quotationId: data.quotationId || 0,
        quotationId: this.quotationId || 0,
        remark: data.remark || "",
        saleChanceId: data.saleChanceId || 0,
        saleChanceId: this.saleChanceId || 0,
        salesDetailsId: this.contractId || 0,
        serviceTimes: data.serviceTimes || 0,
        signTime: data.signTime || "",
        startTime: data.startTime || "",
@@ -453,36 +567,103 @@
      }
      return params
    },
    handleClose() {
      this.editConfig.visible = false
    },
    // 选择客户相关方法
    querySearchAsync(queryString, cb) {
      var restaurants = this.clientList
      var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants
    querySearchAsync(queryString, cb, value) {
      var restaurants = []
      if (value === "client") {
        restaurants = this.clientList
      } else if (value === "contact") {
        restaurants = this.contactNamelist
      } else if (value === "chance") {
        restaurants = this.saleChancelist
      } else if (value === "contract") {
        restaurants = this.salesDetailsList
      } else if (value === "quotation") {
        restaurants = this.quotationList
      }
      var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants
      cb(results)
    },
    createStateFilter(queryString) {
    createStateFilter(queryString, value) {
      return (state) => {
        return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
        if (value === "contract" || value === "quotation") {
          return state.number.toLowerCase().indexOf(queryString.toLowerCase()) === 0
        } else {
          return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
        }
      }
    },
    handleSelectClient(item) {
      this.editConfig.infomation.client_id = item.id
    handleSelectClient(value, item) {
      console.log(value)
      if (value === "client") {
        this.clientId = item.id
      } else if (value === "contact") {
        this.contactId = item.id
      } else if (value === "chance") {
        this.saleChanceId = item.id
      } else if (value === "contract") {
        this.contractId = item.id
      } else if (value === "quotation") {
        this.quotationId = item.id
      }
    },
    selClientClick() {
      this.editSelectClientConfig.editVisible = true
    selClientClick(value) {
      if (value === "client") {
        this.editSelectClientConfig.editVisible = true
      } else if (value === "contact") {
        this.editSelectContactConfig.editVisible = true
      } else if (value === "chance") {
        this.editSelectChanceConfig.editVisible = true
      } else if (value === "contract") {
        this.editSelCommonConfig.title = "销售明细单"
        this.editSelCommonConfig.editVisible = true
        this.editSelCommonConfig.tableInfomation = [...this.salesDetailsList]
      } else if (value === "quotation") {
        this.editSelCommonConfig.title = "报价单"
        this.editSelCommonConfig.editVisible = true
        this.editSelCommonConfig.tableInfomation = [...this.quotationList]
      }
    },
    selClient(row) {
      console.log(row)
      this.editConfig.infomation.client_name = row.name
      this.editConfig.infomation.client_id = row.id
    selClient(row, value) {
      console.log(value)
      if (value === "contact") {
        this.editConfig.infomation.contact_name = row.name
        this.contactId = row.id
      } else if (value === "client") {
        this.editConfig.infomation.client_name = row.name
        this.clientId = row.id
      } else if (value === "chance") {
        this.editConfig.infomation.sale_chance_name = row.name
        this.saleChanceId = row.id
      } else if (value === "contract") {
        this.editConfig.infomation.contract_number = row.number
        this.contractId = row.id
      } else if (value === "quotation") {
        this.editConfig.infomation.quotation_number = row.number
        this.quotationId = row.id
      }
    },
    // 清除已选择用户
    clearupClient() {
      this.editConfig.infomation.client_name = ""
      this.editConfig.infomation.client_id = 0
    clearupClient(value) {
      if (value === "client") {
        this.editConfig.infomation.client_name = ""
        this.clientId = 0
      } else if (value === "contact") {
        this.editConfig.infomation.contact_name = ""
        this.contactId = 0
      } else if (value === "chance") {
        this.editConfig.infomation.sale_chance_name = ""
        this.saleChanceId = 0
      } else if (value === "contract") {
        this.editConfig.infomation.contract_number = ""
        this.contractId = 0
      } else if (value === "quotation") {
        this.editConfig.infomation.quotation_number = ""
        this.quotationId = 0
      }
    },
    // 添加附件
    addAnnexClick() {},
src/views/service/serviceContract/DetailServiceContract.vue
@@ -25,7 +25,6 @@
            <el-tab-pane label="收款单" name="receipt"></el-tab-pane>
            <el-tab-pane label="客户服务单" name="clientService"> </el-tab-pane>
            <el-tab-pane label="销售发票" name="invoice"></el-tab-pane>
            <el-tab-pane label="销售子单" name="sub"></el-tab-pane>
          </el-tabs>
        </div>
        <div v-if="activeName === 'first'" class="detail">
@@ -41,11 +40,11 @@
                <li v-for="(item, i) in basicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
@@ -63,11 +62,11 @@
                <li v-for="(item, i) in dynamicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
@@ -103,7 +102,7 @@
                <li>
                  <div class="left remark">
                    <div class="content-title">{{ "备注:" }}</div>
                    <div class="content-data">{{ "" }}</div>
                    <div class="content-data">{{ detailConfig.infomation.remark }}</div>
                  </div>
                </li>
              </ul>
@@ -156,9 +155,6 @@
        <div v-if="activeName === 'invoice'" class="second">
          <!-- <FollowupRecords :isDetail="true" /> -->
        </div>
        <div v-if="activeName === 'sub'" class="second">
          <SubOrder :isDetail="true" />
        </div>
      </div>
    </el-drawer>
  </div>
@@ -166,7 +162,6 @@
<script>
import ClientServiceOrder from "@/views/service/clientServiceOrder"
import SubOrder from "@/views/sales/subOrder"
import Status from "@/common/const/salesFixedStatus"
import CommonFormTableView from "@/components/makepager/CommonFormTableView"
export default {
@@ -182,7 +177,7 @@
      }
    }
  },
  components: { ClientServiceOrder, SubOrder, CommonFormTableView },
  components: { ClientServiceOrder, CommonFormTableView },
  computed: {},
  data() {
    return {
@@ -208,36 +203,36 @@
    }
  },
  created() {
    this.setData()
    this.setData(this.detailConfig.infomation)
    this.setTableForm()
  },
  mounted() {},
  methods: {
    setData() {
    setData(item) {
      this.basicInfoList = [
        {
          leftStr: "客户名称",
          leftValue: "",
          leftValue: item.client_name,
          rightStr: "服务合同编号",
          rightValue: ""
          rightValue: item.number
        },
        {
          leftStr: "负责人",
          leftValue: "",
          leftValue: item.memberId,
          rightStr: "联系人姓名",
          rightValue: ""
          rightValue: item.contactId
        },
        {
          leftStr: "销售机会",
          leftValue: "",
          leftValue: item.SaleChance.name,
          rightStr: "合同订单",
          rightValue: ""
          rightValue: item.salesDetails.number
        },
        {
          leftStr: "报价单",
          leftValue: "",
          leftValue: item.quotation.number,
          rightStr: "合同类型",
          rightValue: ""
          rightValue: item.serviceContractType
        },
        {
          leftStr: "合同发起人",
@@ -247,15 +242,15 @@
        },
        {
          leftStr: "签约日期",
          leftValue: "",
          leftValue: item.signTime,
          rightStr: "服务开始日期",
          rightValue: ""
          rightValue: item.startTime
        },
        {
          leftStr: "创建人",
          leftValue: "",
          rightStr: "服务到期日",
          rightValue: ""
          rightValue: item.endTime
        },
        {
          leftStr: "创建时间",
@@ -269,25 +264,25 @@
          leftStr: "审批状态",
          leftValue: "",
          rightStr: "合同状态",
          rightValue: ""
          rightValue: item.serviceContractStatus
        },
        {
          leftStr: "已服务次数",
          leftValue: "",
          leftValue: item.serviceTimes,
          rightStr: "应服务次数",
          rightValue: ""
        },
        {
          leftStr: "已收总额",
          leftValue: "",
          leftValue: item.amountReceived,
          rightStr: "应收余额",
          rightValue: ""
          rightValue: item.amountReceivable
        },
        {
          leftStr: "已开票金额",
          leftValue: "",
          leftValue: item.amountInvoiced,
          rightStr: "未开票金额",
          rightValue: ""
          rightValue: item.amountUnInvoiced
        }
      ]
    },
src/views/service/serviceContract/index.vue
@@ -9,9 +9,12 @@
        ref="searchCommonView"
        :query-class-options="queryClassOptions"
        :search-options="searchOptions"
        :search-sel="searchSel"
        @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>
@@ -21,12 +24,13 @@
      :select-box="!isDetail"
      @selClientClick="selClientClick"
      @selCommonClick="selCommonClick"
      @getSelectArray="getSelectArray"
    >
      <template slot="tableButton">
        <el-table-column label="操作" width="90">
        <el-table-column label="操作" width="60">
          <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>
@@ -99,7 +103,12 @@
      clientDeail: {
        visible: false,
        infomation: {}
      }
      },
      searchSel: {
        value: "number",
        label: "服务合同编号"
      },
      selValueList: []
    }
  },
  created() {
@@ -112,10 +121,10 @@
        tableInfomation: [],
        tableColumn: [
          { label: "服务合同编号", prop: "number", min: 100, isCommonClick: true }, // 服务合同编号
          { label: "客户名称", prop: "clientId", min: 120, isClientClick: true }, // 客户名称
          { label: "客户名称", prop: "client_name", min: 120, isClientClick: true }, // 客户名称
          { label: "签约日期", prop: "signTime" }, // 签约日期
          { label: "合同类型", prop: "typeId" }, // 合同类型
          { label: "合同状态", prop: "serviceContractStatusId" }, // 合同状态
          { label: "合同类型", prop: "serviceContractType" }, // 合同类型
          { label: "合同状态", prop: "serviceContractStatus" }, // 合同状态
          { label: "负责人", prop: "memberId" }, // 负责人
          { label: "产品名称", prop: "productName" }, // 产品名称
          { label: "服务开始日", prop: "startTime" }, // 服务开始日
@@ -126,14 +135,16 @@
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    // 请求数据
    async getData() {
    async getData(keyword, keywordType) {
      this.loading = true
      await getServiceContractList({
        keyword: "",
        keyword: keyword,
        keywordType: keywordType,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
@@ -143,7 +154,10 @@
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
                return {
                  ...item
                  ...item,
                  client_name: item.client.name,
                  serviceContractStatus: item.serviceContractStatus.name,
                  serviceContractType: item.serviceContractType.name
                }
              })
              this.tableList.tableInfomation = list || []
@@ -162,6 +176,15 @@
          this.loading = false
        })
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.getData(content, val.label)
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true
@@ -176,33 +199,46 @@
      this.editConfig.infomation = { ...row }
    },
    // 删除
    delClick(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function () {
          return getDelServiceContract({ 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(() => {
            getDelServiceContract({ 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) {
      console.log(row)
      this.clientDeail.visible = true
      this.clientDeail.infomation = { ...row, client_name: row.name }
      this.clientDeail.infomation = {
        ...row.client,
        client_name: row.client.name,
        client_level: row.client.client_level.name,
        client_status: row.client.client_status.name
      }
    },
    // 服务合同详情
    selCommonClick(row) {
src/views/service/serviceFollowup/AddServiceFollowupDialog.vue
@@ -28,14 +28,18 @@
                  <div class="custom-name">
                    <el-autocomplete
                      v-model="editConfig.infomation.client_name"
                      :fetch-suggestions="querySearchAsync"
                      :fetch-suggestions="
                        (queryString, callback) => {
                          querySearchAsync(queryString, callback, 'client')
                        }
                      "
                      value-key="name"
                      @select="handleSelectClient"
                      @select="handleSelectClient('client', $event)"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick">
                    <div class="common-select-btn" @click="selClientClick('client')">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient">
                    <div class="common-select-btn" @click="clearupClient('client')">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    </div>
                  </div>
@@ -49,18 +53,44 @@
              <el-col :span="12">
                <el-form-item label="联系人姓名" prop="contactId">
                  <div class="custom-name">
                    <el-input v-model="editConfig.infomation.contactId"></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.contact_name"
                      :fetch-suggestions="
                        (queryString, callback) => {
                          querySearchAsync(queryString, callback, 'contact')
                        }
                      "
                      value-key="name"
                      @select="handleSelectClient('contact', $event)"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('contact')">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient('contact')">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="客户服务单" prop="customServiceForm">
                <el-form-item label="客户服务单" prop="service_number">
                  <div class="custom-name">
                    <el-input v-model="editConfig.infomation.customServiceForm"></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.service_number"
                      :fetch-suggestions="
                        (queryString, callback) => {
                          querySearchAsync(queryString, callback, 'customService')
                        }
                      "
                      value-key="serviceNumber"
                      @select="handleSelectClient('customService', $event)"
                    ></el-autocomplete>
                    <div class="common-select-btn" @click="selClientClick('customService')">
                      <i class="el-icon-circle-plus-outline" title="选择"></i>
                    </div>
                    <div class="common-select-btn" @click="clearupClient('customService')">
                      <i class="el-icon-edit-outline" title="清除"></i>
                    </div>
                  </div>
                </el-form-item>
              </el-col>
@@ -210,6 +240,18 @@
        :edit-common-config="editSelectClientConfig"
        @selClient="selClient"
      />
      <!-- 选择联系人 -->
      <SelectContactDialog
        v-if="editSelectContactConfig.editVisible"
        :edit-common-config="editSelectContactConfig"
        @selClient="selClient"
      />
      <!-- 客户服务订单 -->
      <SelectCommonDialog
        v-if="editSelCommonConfig.editVisible"
        :edit-common-config="editSelCommonConfig"
        @selClient="selClient"
      />
    </el-dialog>
  </div>
</template>
@@ -218,6 +260,8 @@
import { getAllData } from "@/api/client/client"
import { getAddServiceFollowup, getUpdateServiceFollowup } from "@/api/serviceManage/serviceFollowup"
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog"
import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
export default {
  name: "AddServiceFollowupDialog",
  props: {
@@ -232,13 +276,16 @@
      }
    }
  },
  components: { SelectClientDialog },
  components: { SelectClientDialog, SelectContactDialog, SelectCommonDialog },
  computed: {
    searchCommonHeight() {
      return this.$refs.searchCommonView.offsetHeight
    },
    clientList() {
      return this.$store.state.getClientName.clientList
    },
    contactNamelist() {
      return this.$store.state.getClientName.contactNamelist
    },
    serviceOrderList() {
      return this.$store.state.getClientName.serviceOrderList
    }
  },
  data() {
@@ -259,11 +306,26 @@
        editVisible: false,
        title: "",
        infomation: {}
      }
      },
      editSelectContactConfig: {
        editVisible: false,
        title: "",
        infomation: {}
      },
      editSelCommonConfig: {
        editVisible: false,
        title: "",
        infomation: {}
      },
      clientId: this.editCommonConfig.infomation.clientId,
      contactId: this.editCommonConfig.infomation.contactId,
      serviceId: this.editCommonConfig.infomation.serviceId
    }
  },
  created() {
    this.$store.dispatch("geClient")
    this.$store.dispatch("geContact")
    this.$store.dispatch("geServiceOrder")
    this.getCommonData()
  },
  methods: {
@@ -289,37 +351,23 @@
          const params = this.saveParams()
          console.log(params)
          if (this.editConfig.title === "新建") {
            getAddServiceFollowup(params)
              .then((res) => {
                console.log(res)
                this.editConfig.visible = false
                if (res.code === 200) {
                  this.$message({
                    message: "添加成功",
                    type: "success"
                  })
                  this.$parent.getData()
                }
              })
              .catch((err) => {
                console.log(err)
              })
            getAddServiceFollowup(params).then((res) => {
              console.log(res)
              this.editConfig.visible = false
              if (res.code === 200) {
                this.$message.success("添加成功")
                this.$parent.getData()
              }
            })
          } else {
            getUpdateServiceFollowup(params)
              .then((res) => {
                console.log(res)
                this.editConfig.visible = false
                if (res.code === 200) {
                  this.$message({
                    message: "编辑成功",
                    type: "success"
                  })
                  this.$parent.getData()
                }
              })
              .catch((err) => {
                console.log(err)
              })
            getUpdateServiceFollowup(params).then((res) => {
              console.log(res)
              this.editConfig.visible = false
              if (res.code === 200) {
                this.$message.success("编辑成功")
                this.$parent.getData()
              }
            })
          }
        } else {
          console.log("error submit")
@@ -331,8 +379,8 @@
      let data = this.editConfig.infomation
      let params = {
        id: this.editConfig.title === "新建" ? 0 : data.id,
        clientId: data.clientId || 0,
        contactId: data.contactId || 0,
        clientId: this.clientId || 0,
        contactId: this.contactId || 0,
        file: data.file || "",
        isVisit: data.isVisit || 0,
        memberId: data.memberId || 0,
@@ -341,7 +389,7 @@
        planId: data.planId || 0,
        remark: data.remark || "",
        satisfaction: data.satisfaction || 0,
        serviceId: data.serviceId || 0,
        serviceId: this.serviceId || 0,
        solveRate: data.solveRate || 0,
        timelyRate: data.timelyRate || 0
      }
@@ -351,31 +399,74 @@
      this.editConfig.visible = false
    },
    // 选择客户相关方法
    querySearchAsync(queryString, cb) {
      var restaurants = this.clientList
      var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants
    querySearchAsync(queryString, cb, value) {
      var restaurants = []
      if (value === "client") {
        restaurants = this.clientList
      } else if (value === "contact") {
        restaurants = this.contactNamelist
      } else if (value === "customService") {
        console.log(this.serviceOrderList)
        restaurants = this.serviceOrderList
      }
      var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants
      cb(results)
    },
    createStateFilter(queryString) {
    createStateFilter(queryString, value) {
      return (state) => {
        return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
        if (value === "customService") {
          return state.serviceNumber.toLowerCase().indexOf(queryString.toLowerCase()) === 0
        } else {
          return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
        }
      }
    },
    handleSelectClient(item) {
      this.editConfig.infomation.client_id = item.id
    handleSelectClient(value, item) {
      console.log(value)
      if (value === "client") {
        this.clientId = item.id
      } else if (value === "contact") {
        this.contactId = item.id
      } else if (value === "customService") {
        this.serviceId = item.id
      }
    },
    selClientClick() {
      this.editSelectClientConfig.editVisible = true
    selClientClick(value) {
      if (value === "client") {
        this.editSelectClientConfig.editVisible = true
      } else if (value === "contact") {
        this.editSelectContactConfig.editVisible = true
      } else if (value === "customService") {
        this.editSelCommonConfig.title = "客户服务单"
        this.editSelCommonConfig.editVisible = true
        this.editSelCommonConfig.tableInfomation = [...this.serviceOrderList]
      }
    },
    selClient(row) {
      console.log(row)
      this.editConfig.infomation.client_name = row.name
      this.editConfig.infomation.client_id = row.id
    selClient(row, value) {
      console.log(value)
      if (value === "contact") {
        this.editConfig.infomation.contact_name = row.name
        this.contactId = row.id
      } else if (value === "client") {
        this.editConfig.infomation.client_name = row.name
        this.clientId = row.id
      } else if (value === "customService") {
        this.editConfig.infomation.service_number = row.serviceNumber
        this.serviceId = row.id
      }
    },
    // 清除已选择用户
    clearupClient() {
      this.editConfig.infomation.client_name = ""
      this.editConfig.infomation.client_id = 0
    clearupClient(value) {
      if (value === "client") {
        this.editConfig.infomation.client_name = ""
        this.clientId = 0
      } else if (value === "contact") {
        this.editConfig.infomation.contact_name = ""
        this.contactId = 0
      } else if (value === "customService") {
        this.editConfig.infomation.service_number = ""
        this.serviceId = 0
      }
    },
    // 添加附件
    addAnnexClick() {},
src/views/service/serviceFollowup/DetailServiceFollowup.vue
@@ -37,11 +37,11 @@
                <li v-for="(item, i) in basicInfoList" :key="i">
                  <div class="left">
                    <div class="content-title">{{ item.leftStr + ":" }}</div>
                    <div class="content-data">{{ item.leftValue }}</div>
                    <div class="content-data">{{ item.leftValue ? item.leftValue : "--" }}</div>
                  </div>
                  <div class="right">
                  <div v-if="item.rightStr" class="right">
                    <div class="content-title">{{ item.rightStr }}</div>
                    <div class="content-data">{{ item.rightValue }}</div>
                    <div class="content-data">{{ item.rightValue ? item.rightValue : "--" }}</div>
                  </div>
                </li>
              </ul>
@@ -119,35 +119,35 @@
    }
  },
  created() {
    this.setData()
    this.setData(this.detailConfig.infomation)
  },
  mounted() {},
  methods: {
    setData() {
    setData(item) {
      this.basicInfoList = [
        {
          leftStr: "客户名称",
          leftValue: "",
          leftValue: item.client_name,
          rightStr: "回访单编号",
          rightValue: ""
          rightValue: item.number
        },
        {
          leftStr: "联系人姓名",
          leftValue: "",
          leftValue: item.contact_name,
          rightStr: "客户服务单",
          rightValue: ""
          rightValue: item.ServiceOrder.serviceNumber
        },
        {
          leftStr: "回访人",
          leftValue: "",
          leftValue: item.isVisit,
          rightStr: "项目计划",
          rightValue: ""
        },
        {
          leftStr: "满意度",
          leftValue: "",
          leftValue: item.satisfaction,
          rightStr: "及时率",
          rightValue: ""
          rightValue: item.timelyRate
        },
        {
          leftStr: "解决率",
src/views/service/serviceFollowup/index.vue
@@ -9,9 +9,12 @@
        ref="searchCommonView"
        :query-class-options="queryClassOptions"
        :search-options="searchOptions"
        :search-sel="searchSel"
        @searchClick="searchClick"
        @resetClick="resetClick"
      />
      <div class="btn-pager">
        <PublicFunctionBtnView :import-button="false" :operates-list="operatesList" />
        <PublicFunctionBtnView :import-button="false" :operates-list="operatesList" @batchDelete="delClick" />
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div>
    </div>
@@ -23,12 +26,13 @@
      @selCommonClick="selCommonClick"
      @selContactsClick="selContactsClick"
      @selServiceOrderClick="selServiceOrderClick"
      @getSelectArray="getSelectArray"
    >
      <template slot="tableButton">
        <el-table-column label="操作" width="90">
        <el-table-column label="操作" width="60">
          <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>
@@ -108,7 +112,12 @@
      clientServiceDetail: {
        visible: false,
        infomation: {}
      }
      },
      searchSel: {
        value: "number",
        label: "回访单编号"
      },
      selValueList: []
    }
  },
  created() {
@@ -121,9 +130,9 @@
        tableInfomation: [],
        tableColumn: [
          { label: "回访单编号", prop: "number", min: 80, isCommonClick: true }, // 回访单编号
          { label: "客户名称", prop: "clientId", min: 130, isClientClick: true }, // 客户名称
          { label: "联系人姓名", prop: "contactId", isContactClick: true }, // 联系人姓名
          { label: "客户服务单", prop: "serviceId", isServiceOrder: true }, // 客户服务单
          { label: "客户名称", prop: "client_name", min: 130, isClientClick: true }, // 客户名称
          { label: "联系人姓名", prop: "contact_name", isContactClick: true }, // 联系人姓名
          { label: "客户服务单", prop: "client_service_order", isServiceOrder: true }, // 客户服务单
          { label: "回访人", prop: "isVisit" }, // 回访人
          { label: "满意度", prop: "satisfaction" } // 满意度
          // { label: "修改时间", prop: "modifyTime" } // 修改时间
@@ -132,14 +141,16 @@
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    // 请求数据
    async getData() {
    async getData(keyword, keywordType) {
      this.loading = true
      await getServiceFollowupList({
        keyword: "",
        keyword: keyword,
        keywordType: keywordType,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      })
@@ -149,7 +160,10 @@
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
                return {
                  ...item
                  ...item,
                  client_service_order: item.ServiceOrder.serviceNumber,
                  client_name: item.client.name,
                  contact_name: item.contact.name
                }
              })
              this.tableList.tableInfomation = list || []
@@ -168,6 +182,15 @@
          this.loading = false
        })
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.getData(content, val.label)
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true
@@ -182,39 +205,52 @@
      this.editConfig.infomation = { ...row }
    },
    // 删除
    delClick(id) {
      this.$confirm("是否确认删除?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(function () {
          return getDelServiceFollowup({ 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(() => {
            getDelServiceFollowup({ 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) {
      console.log(row)
      this.clientDeail.visible = true
      this.clientDeail.infomation = { ...row, client_name: row.name }
      this.clientDeail.infomation = {
        ...row.client,
        client_name: row.client.name,
        client_level: row.client.client_level.name,
        client_status: row.client.client_status.name
      }
    },
    // 联系人详情
    selContactsClick(row) {
      console.log(row)
      this.contactsDeail.visible = true
      this.contactsDeail.infomation = { ...row }
      this.contactsDeail.infomation = { ...row.contact, Client: row.client }
    },
    // 服务回访单详情
    selCommonClick(row) {
@@ -225,7 +261,7 @@
    selServiceOrderClick(row) {
      console.log(row)
      this.clientServiceDetail.visible = true
      this.clientServiceDetail.infomation = { ...row }
      this.clientServiceDetail.infomation = { ...row.ServiceOrder }
    }
  }
}