yangfeng
2023-08-16 8191562f28c525373941af4638c30c8f8e74c245
bug修复
12个文件已修改
735 ■■■■■ 已修改文件
src/api/client/followupRecords.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/layout/components/appsidebar/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/client/index.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/contacts/AddContactsDialog.vue 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/followupRecords/AddFollowupRecordsDialog.vue 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/client/followupRecords/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/other/commonDialog/SelectChanceDialog.vue 123 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/other/commonDialog/SelectClientDialog.vue 137 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/other/commonDialog/SelectCommonDialog.vue 261 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/other/commonDialog/SelectContactDialog.vue 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/service/serviceContract/AddServiceContractDialog.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/service/serviceContract/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/client/followupRecords.js
@@ -32,3 +32,11 @@
    data
  })
}
// 联系方式列表
export function getContactInfoList() {
  return request({
    url: "/api/contactInformation/list",
    method: "get"
  })
}
src/components/layout/components/appsidebar/index.vue
@@ -36,7 +36,7 @@
          <el-menu-item index="/sales/salesReturn">销售退货单</el-menu-item>
          <el-menu-item index="/sales/refundForm">销售退款单</el-menu-item>
          <el-menu-item index="/sales/contractManage">合同管理</el-menu-item>
          <el-menu-item index="/sales/generatePlan">生成计划</el-menu-item>
          <!-- <el-menu-item index="/sales/generatePlan">生成计划</el-menu-item> -->
        </el-submenu>
        <el-submenu index="3">
          <template slot="title">
src/views/client/client/index.vue
@@ -171,15 +171,22 @@
                let contact_name = ""
                let contact_phone = ""
                let contact_id = 0
                let contact_wechat = ""
                let contact_email = ""
                let position = ""
                if (item.contacts.length !== 0) {
                  for (let i = 0; i < item.contacts.length; i++) {
                    if (item.contacts[i].is_first) {
                      contact_name = item.contacts[i].name
                      contact_phone = item.contacts[i].phone
                      contact_id = item.contacts[i].id
                      contact_wechat = item.contacts[i].wechat
                      contact_email = item.contacts[i].email
                      position = item.contacts[i].position
                    }
                  }
                }
                console.log(contact_wechat, contact_email)
                return {
                  ...item,
                  contact_name: contact_name,
@@ -187,7 +194,10 @@
                  client_level: item.client_level.name,
                  client_status: item.client_status.name,
                  contact_id: contact_id,
                  member_name: item.member.username
                  member_name: item.member.username,
                  contact_wechat: contact_wechat,
                  contact_email: contact_email,
                  position: position
                }
              })
              this.tableList.tableInfomation = list || []
@@ -232,18 +242,8 @@
      console.log(row)
      this.editConfig.visible = true
      this.editConfig.title = "编辑"
      let contactObj = {}
      if (row.contacts.length > 0) {
        row.contacts.forEach((ele) => {
          if (ele.is_first) {
            contactObj = { ...ele }
          }
        })
      }
      this.editConfig.infomation = {
        ...row,
        contact_wechat: contactObj.length > 0 ? contactObj.wechat : "",
        contact_email: contactObj.length > 0 ? contactObj.email : ""
        ...row
      }
    },
    // 删除
src/views/client/contacts/AddContactsDialog.vue
@@ -76,7 +76,13 @@
              </el-col>
              <el-col :span="12">
                <el-form-item v-if="isUnflod" label="首要联系人" prop="is_first">
                  <el-switch v-model="editConfig.infomation.is_first" active-color="#2E68DB" inactive-color="#AEB9CA">
                  <el-switch
                    v-model="editConfig.infomation.is_first"
                    active-color="#2E68DB"
                    inactive-color="#AEB9CA"
                    active-value="是"
                    inactive-value="否"
                  >
                  </el-switch>
                </el-form-item>
              </el-col>
@@ -335,18 +341,11 @@
        this.editConfig.infomation.province_id === 0 ? "" : this.editConfig.infomation.province_id
      this.editConfig.infomation.city_id =
        this.editConfig.infomation.city_id === 0 ? "" : this.editConfig.infomation.city_id
      getAllData()
        .then((res) => {
          console.log(res)
          this.memberOptions = res.data.member
          // this.countryOptions = res.data.country
          this.provinceOptions = res.data.province
          // this.cityOptions = res.data.city
          // this.regionOptions = res.data.region
        })
        .catch((err) => {
          console.log(err)
        })
      getAllData().then((res) => {
        console.log(res)
        this.memberOptions = res.data.member
        this.provinceOptions = res.data.province
      })
    },
    handleClose() {
      this.editConfig.visible = false
src/views/client/followupRecords/AddFollowupRecordsDialog.vue
@@ -110,20 +110,15 @@
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="联系方式" prop="contactInfo">
                <el-form-item label="联系方式" prop="contact_information_id">
                  <!-- <el-input
                    v-model="editConfig.infomation.phoneNumber"
                    maxlength="11"
                    show-word-limit
                    oninput="value=value.replace(/[^\d]/g,'')"
                  ></el-input> -->
                  <el-select v-model="editConfig.infomation.contactInfo" placeholder="请选择" size="mini">
                    <el-option
                      v-for="item in contactInfoOptions"
                      :key="item.id"
                      :label="item.username"
                      :value="item.id"
                    >
                  <el-select v-model="editConfig.infomation.contact_information_id" placeholder="请选择" size="mini">
                    <el-option v-for="item in contactInfoOptions" :key="item.id" :label="item.name" :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
@@ -290,7 +285,7 @@
<script>
import { getAllData } from "@/api/client/client"
import { getAddFollowRecord, getUpdateFollowRecord } from "@/api/client/followupRecords"
import { getAddFollowRecord, getUpdateFollowRecord, getContactInfoList } from "@/api/client/followupRecords"
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog"
import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"
@@ -383,19 +378,23 @@
    this.$store.dispatch("geChance")
    this.$store.dispatch("geLead")
    this.getCommonData()
    this.getContactInfoList()
  },
  methods: {
    getCommonData() {
      getAllData()
        .then((res) => {
          console.log(res)
          this.clientStatusOptions = res.data.client_status
          this.memberOptions = res.data.member
          this.dataProcess()
        })
        .catch((err) => {
          console.log(err)
        })
      getAllData().then((res) => {
        console.log(res)
        this.clientStatusOptions = res.data.client_status
        this.memberOptions = res.data.member
        this.dataProcess()
      })
    },
    async getContactInfoList() {
      await getContactInfoList().then((res) => {
        if (res.code === 200) {
          this.contactInfoOptions = res.data.list
        }
      })
    },
    dataProcess() {
      this.saleChancelist.map((item) => {
@@ -426,17 +425,13 @@
              }
            })
          } else {
            getUpdateFollowRecord(params)
              .then((res) => {
                this.editConfig.visible = false
                if (res.code === 200) {
                  this.$message.success("编辑成功")
                  this.$parent.getData()
                }
              })
              .catch((err) => {
                console.log(err)
              })
            getUpdateFollowRecord(params).then((res) => {
              this.editConfig.visible = false
              if (res.code === 200) {
                this.$message.success("编辑成功")
                this.$parent.getData()
              }
            })
          }
        } else {
          console.log("error submit")
src/views/client/followupRecords/index.vue
@@ -146,7 +146,7 @@
          { label: "客户名称", prop: "client_name", min: 190, isClientClick: true }, // 客户名称
          { label: "联系人姓名", prop: "contact_name", min: 100, isContactClick: true }, // 联系人姓名
          { label: "客户状态", prop: "client_status", min: 100 }, // 客户状态
          { label: "联系方式", prop: "phone", min: 100 }, // 联系方式
          { label: "联系方式", prop: "contact_information_name", min: 100 }, // 联系方式
          { label: "联系人日期", prop: "follow_time", isTime: true, min: 130 }, // 联系人日期
          { label: "下次回访日期", prop: "next_follow_time", isTime: true, min: 130 }, // 下次回访日期
          { label: "负责人", prop: "member_name", min: 110 }, // 负责人
@@ -180,6 +180,7 @@
                  client_status: item.client_status.name,
                  phone: item.contact.phone,
                  member_name: item.member.username
                  // contact_information_name: item.contact_information.name
                }
              })
              this.tableList.tableInfomation = list || []
src/views/other/commonDialog/SelectChanceDialog.vue
@@ -10,49 +10,25 @@
    >
      <div class="bg-view">
        <div class="query-bg">
          <el-input placeholder="请输入内容" v-model="queryInput" size="mini" class="input-with-select">
            <el-select v-model="select" slot="prepend" placeholder="请选择">
              <el-option label="全部字段" value="1"></el-option>
              <el-option label="销售机会编号" value="2"></el-option>
              <el-option label="机会名称" value="3"></el-option>
              <el-option label="销售阶段" value="4"></el-option>
              <el-option label="销售负责人" value="5"></el-option>
              <el-option label="预计成交日期" value="6"></el-option>
            </el-select>
          </el-input>
          <SearchCommonView
            ref="searchCommonView"
            :search-options="searchOptions"
            @searchClick="searchClick"
            @resetClick="resetClick"
          />
          <div class="btn">
            <el-button type="primary" size="mini" disabled>设置字段</el-button>
            <el-button type="primary" size="mini" disabled>快速创建</el-button>
            <!-- <el-button type="primary" size="mini" disabled>设置字段</el-button>
            <el-button type="primary" size="mini" disabled>快速创建</el-button> -->
          </div>
        </div>
        <el-table
          :data="tableData"
          border
          size="mini"
        <TableCommonView
          ref="tableListRef"
          v-loading="loading"
          :header-cell-style="{ background: '#f7f7f7' }"
          :table-list="tableList"
          :select-box="false"
          @selCommonClick="selNameClick"
        >
          <el-table-column label="销售机会编号" prop="number"></el-table-column>
          <el-table-column label="机会名称" prop="name" show-overflow-tooltip>
            <template slot-scope="scope">
              <span class="sel-name" @click="selNameClick(scope.row)">{{ scope.row.name }}</span>
            </template>
          </el-table-column>
          <el-table-column label="销售阶段" prop="sale_stage_id"></el-table-column>
          <el-table-column label="销售负责人" prop="member_id"></el-table-column>
          <el-table-column label="预计成交日期" prop="expected_time" show-overflow-tooltip>
            <template slot-scope="scope">
              <span>{{
                dateFormat("YYYY-mm-dd HH:MM:SS", scope.row.expected_time) === "1900-01-01 08:00:00"
                  ? "--"
                  : dateFormat("YYYY-mm-dd HH:MM:SS", scope.row.expected_time)
              }}</span>
            </template>
          </el-table-column>
          <div slot="empty">
            <el-empty :image-size="100"></el-empty>
          </div>
        </el-table>
        </TableCommonView>
        <div slot="footer" class="dialog-footer">
          <div class="remark">说明:支持多字段模糊查询,仅显示符合条件的前5条数据</div>
        </div>
@@ -85,43 +61,69 @@
      editConfig: this.editCommonConfig,
      queryInput: "",
      select: "1",
      tableData: [],
      tableList: [],
      searchSelOptions: [],
      loading: false
      loading: false,
      search_map: {}
    }
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [],
        tableColumn: [
          { label: "销售机会编号", prop: "number" }, // 销售机会编号
          { label: "机会名称", prop: "name", isCommonClick: true }, // 机会名称
          { label: "销售阶段", prop: "sale_stage_name" }, // 销售阶段
          { label: "销售负责人", prop: "member_name" }, // 销售负责人
          { label: "预计成交日期", prop: "expected_time" } // 预计成交日期
        ]
      }
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    handleClose() {
      this.editConfig.editVisible = false
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getSaleChanceList()
      await getSaleChanceList({
        search_map: this.search_map,
        page: 0,
        pageSize: 0
      })
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
            if (res.data.list && res.data.list.length > 0) {
              const list = res.data.list.map((item) => {
                return {
                  ...item
                  ...item,
                  member_name: item.member.username,
                  sale_stage_name: item.sale_stage.name
                }
              })
              this.tableData = list.slice(0, 5) || []
              this.tableList.tableInfomation = list.slice(0, 5) || []
            } else {
              this.tableData = []
              this.tableList.tableInfomation = []
            }
          } else {
            this.tableData = []
            this.tableList.tableInfomation = []
          }
          this.loading = false
        })
        .catch((err) => {
          console.log(err)
          this.tableData = []
          this.tableList.tableInfomation = []
          this.loading = false
        })
    },
@@ -130,26 +132,17 @@
      console.log(row)
      this.$emit("selClient", row, "chance")
    },
    // 时间显示
    dateFormat(fmt, date) {
      let ret = ""
      date = new Date(date)
      const opt = {
        "Y+": date.getFullYear().toString(), // 年
        "m+": (date.getMonth() + 1).toString(), // 月
        "d+": date.getDate().toString(), // 日
        "H+": date.getHours().toString(), // 时
        "M+": date.getMinutes().toString(), // 分
        "S+": date.getSeconds().toString() // 秒
        // 有其他格式化字符需求可以继续添加,必须转化成字符串
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val.value]: content
      }
      for (let k in opt) {
        ret = new RegExp("(" + k + ")").exec(fmt)
        if (ret) {
          fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"))
        }
      }
      return fmt
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    }
  }
}
src/views/other/commonDialog/SelectClientDialog.vue
@@ -10,59 +10,25 @@
    >
      <div class="bg-view">
        <div class="query-bg">
          <el-input placeholder="请输入内容" v-model="queryInput" size="mini" class="input-with-select">
            <el-select v-model="select" slot="prepend" placeholder="请选择">
              <el-option label="全部字段" value="1"></el-option>
              <el-option label="客户编号" value="2"></el-option>
              <el-option label="客户状态" value="3"></el-option>
              <el-option label="销售负责人" value="4"></el-option>
              <el-option label="法定代表人" value="5"></el-option>
              <el-option label="注册时间" value="6"></el-option>
              <el-option label="经营范围" value="7"></el-option>
              <el-option label="详细地址" value="8"></el-option>
              <el-option label="备注" value="9"></el-option>
            </el-select>
          </el-input>
          <SearchCommonView
            ref="searchCommonView"
            :search-options="searchOptions"
            @searchClick="searchClick"
            @resetClick="resetClick"
          />
          <div class="btn">
            <el-button type="primary" size="mini" disabled>设置字段</el-button>
            <el-button type="primary" size="mini" disabled>快速创建</el-button>
            <!-- <el-button type="primary" size="mini" disabled>设置字段</el-button>
            <el-button type="primary" size="mini" disabled>快速创建</el-button> -->
          </div>
        </div>
        <el-table
          :data="tableData"
          border
          size="mini"
        <TableCommonView
          ref="tableListRef"
          v-loading="loading"
          :header-cell-style="{ background: '#f7f7f7' }"
          :table-list="tableList"
          :select-box="false"
          @selClientClick="selNameClick"
        >
          <el-table-column label="客户名称" prop="name" show-overflow-tooltip>
            <template slot-scope="scope">
              <!-- <div style="margin-right: 10px"> -->
              <span class="sel-name" @click="selNameClick(scope.row)">{{ scope.row.name }}</span>
              <!-- </div> -->
            </template>
          </el-table-column>
          <el-table-column label="客户编号" prop="number"></el-table-column>
          <el-table-column label="客户状态" prop="client_status"></el-table-column>
          <el-table-column label="销售负责人" prop="member_id"></el-table-column>
          <!-- <el-table-column label="线索升级状态" prop="setDefault"></el-table-column> -->
          <el-table-column label="法定代表人" prop="representative"></el-table-column>
          <el-table-column label="注册时间" prop="registration_time" show-overflow-tooltip>
            <template slot-scope="scope">
              <span>{{
                dateFormat("YYYY-mm-dd HH:MM:SS", scope.row.registration_time) === "1900-01-01 08:00:00"
                  ? "--"
                  : dateFormat("YYYY-mm-dd HH:MM:SS", scope.row.registration_time)
              }}</span>
            </template>
          </el-table-column>
          <el-table-column label="经营范围" prop="business_scope"></el-table-column>
          <el-table-column label="详细地址" prop="detail_address"></el-table-column>
          <el-table-column label="备注" prop="remark"></el-table-column>
          <div slot="empty">
            <el-empty :image-size="100"></el-empty>
          </div>
        </el-table>
        </TableCommonView>
        <div slot="footer" class="dialog-footer">
          <div class="remark">说明:支持多字段模糊查询,仅显示符合条件的前5条数据</div>
        </div>
@@ -97,20 +63,50 @@
      select: "1",
      tableData: [],
      searchSelOptions: [],
      loading: false
      loading: false,
      searchOptions: [],
      tableList: {},
      search_map: {}
    }
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [],
        tableColumn: [
          { label: "客户名称", prop: "name", min: 100, isClientClick: true },
          { label: "客户编号", prop: "number" },
          { label: "客户状态", prop: "client_status" },
          { label: "销售负责人", prop: "member_name" },
          { label: "法定代表人", prop: "representative" },
          { label: "注册时间", prop: "registration_time" },
          { label: "经营范围", prop: "business_scope" },
          { label: "详细地址", prop: "detail_address" },
          { label: "备注", prop: "remark" }
        ]
      }
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    handleClose() {
      this.editConfig.editVisible = false
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getClientList()
      await getClientList({
        search_map: this.search_map,
        page: 0,
        pageSize: 0
      })
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
@@ -118,21 +114,22 @@
              const list = res.data.list.map((item) => {
                return {
                  ...item,
                  client_status: item.client_status.name
                  client_status: item.client_status.name,
                  member_name: item.member.username
                }
              })
              this.tableData = list.slice(0, 5) || []
              this.tableList.tableInfomation = list.slice(0, 5) || []
            } else {
              this.tableData = []
              this.tableList.tableInfomation = []
            }
          } else {
            this.tableData = []
            this.tableList.tableInfomation = []
          }
          this.loading = false
        })
        .catch((err) => {
          console.log(err)
          this.tableData = []
          this.this.tableList.tableInfomation = []
          this.loading = false
        })
    },
@@ -140,26 +137,17 @@
      this.editConfig.editVisible = false
      this.$emit("selClient", row, "client")
    },
    // 时间显示
    dateFormat(fmt, date) {
      let ret = ""
      date = new Date(date)
      const opt = {
        "Y+": date.getFullYear().toString(), // 年
        "m+": (date.getMonth() + 1).toString(), // 月
        "d+": date.getDate().toString(), // 日
        "H+": date.getHours().toString(), // 时
        "M+": date.getMinutes().toString(), // 分
        "S+": date.getSeconds().toString() // 秒
        // 有其他格式化字符需求可以继续添加,必须转化成字符串
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val.value]: content
      }
      for (let k in opt) {
        ret = new RegExp("(" + k + ")").exec(fmt)
        if (ret) {
          fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"))
        }
      }
      return fmt
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    }
  }
}
@@ -170,6 +158,7 @@
.bg-view {
  margin: 10px;
  .query-bg {
    margin-left: -20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
src/views/other/commonDialog/SelectCommonDialog.vue
@@ -10,15 +10,22 @@
    >
      <div class="bg-view">
        <div class="query-bg">
          <el-input placeholder="请输入内容" v-model="queryInput" size="mini" class="input-with-select">
          <!-- <el-input placeholder="请输入内容" v-model="queryInput" size="mini" class="input-with-select">
            <el-select v-model="select" slot="prepend" placeholder="请选择">
              <el-option v-for="item in commonOptions" :key="item.id" :label="item.name" :value="item.name">
              </el-option>
            </el-select>
          </el-input>
          </el-input> -->
          <SearchCommonView
            ref="searchCommonView"
            :search-options="searchOptions"
            @searchClick="searchClick"
            @resetClick="resetClick"
            :search-sel="searchSel"
          />
          <div class="btn">
            <el-button type="primary" size="mini" disabled>设置字段</el-button>
            <el-button type="primary" size="mini" disabled>快速创建</el-button>
            <!-- <el-button type="primary" size="mini" disabled>设置字段</el-button>
            <el-button type="primary" size="mini" disabled>快速创建</el-button> -->
          </div>
        </div>
        <TableCommonView ref="tableListRef" :table-list="tableList" :select-box="false" @selCommonClick="selNameClick">
@@ -32,6 +39,12 @@
</template>
<script>
import { getMasterOrderList } from "@/api/sales/masterOrder"
import { getQuotationList } from "@/api/sales/quotation"
import { getSalesDetailsList } from "@/api/sales/salesDetails"
import { getServiceContractList } from "@/api/serviceManage/serviceContract"
import { getServiceOrderList } from "@/api/serviceManage/clientServiceOrder"
import { getProductList } from "@/api/common/other"
export default {
  name: "EditSelCommonDialog",
  props: {
@@ -58,56 +71,65 @@
      searchSelOptions: [],
      loading: false,
      tableList: {},
      commonOptions: []
      searchOptions: [],
      search_map: {},
      searchSel: {},
      keyword: "",
      keywordType: ""
    }
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      if (this.editConfig.title === "销售总单") {
        this.tableList = {
          tableInfomation: this.editConfig.tableInfomation,
          tableInfomation: [],
          tableColumn: [
            { label: "单据编号", prop: "number", isClick: true }, // 单据编号
            { label: "负责人", prop: "member_id" } // 负责人
            { label: "负责人", prop: "member_name" } // 负责人
          ]
        }
        this.searchSel = { value: "number", label: "单据编号" }
      } else if (this.editConfig.title === "服务合同") {
        this.tableList = {
          tableInfomation: this.editConfig.tableInfomation,
          tableInfomation: [],
          tableColumn: [
            { label: "客户名称", prop: "clientId" }, // 客户名称
            { label: "客户名称", prop: "client_name" }, // 客户名称
            { label: "服务合同编号", prop: "number", isClick: true }, // 服务合同编号
            { label: "负责人", prop: "memberId" }, // 负责人
            { label: "负责人", prop: "member_name" }, // 负责人
            { label: "合计", prop: "total" }, // 合计
            { label: "签约日期", prop: "signTime", isTime: true }, // 签约日期
            { label: "合同状态", prop: "serviceContractStatusId" } // 合同状态
            { label: "合同状态", prop: "serviceContractStatus" } // 合同状态
          ]
        }
        this.searchSel = { value: "number", label: "服务合同编号" }
      } else if (this.editConfig.title === "销售明细单") {
        this.tableList = {
          tableInfomation: this.editConfig.tableInfomation,
          tableInfomation: [],
          tableColumn: [
            { label: "客户名称", prop: "clientId" }, // 客户名称
            { label: "客户名称", prop: "client_name" }, // 客户名称
            { label: "订单编号", prop: "number", isClick: true }, // 订单编号
            { label: "签约日期", prop: "signTime" }, // 签约日期
            { label: "销售负责人", prop: "memberId" }, // 销售负责人
            { label: "销售负责人", prop: "member_name" }, // 销售负责人
            { label: "合计", prop: "tptal" } // 合计
          ]
        }
        this.searchSel = { value: "number", label: "订单编号" }
      } else if (this.editConfig.title === "报价单") {
        this.tableList = {
          tableInfomation: this.editConfig.tableInfomation,
          tableInfomation: [],
          tableColumn: [
            { label: "报价单号", prop: "number", isClick: true }, // 报价单号
            { label: "销售负责人", prop: "memberId" } // 销售负责人
            { label: "销售负责人", prop: "member_name" } // 销售负责人
          ]
        }
        this.searchSel = { value: "number", label: "报价单号" }
      } else if (this.editConfig.title === "客户服务单") {
        this.tableList = {
          tableInfomation: this.editConfig.tableInfomation,
          tableInfomation: [],
          tableColumn: [
            { label: "服务单编号", prop: "serviceNumber", isClick: true }, // 服务单编号
            { label: "主题", prop: "subject" }, // 主题
@@ -118,13 +140,192 @@
            { label: "客户签名", prop: "qianming" } // 客户签名
          ]
        }
        this.searchSel = { value: "serviceNumber", label: "服务单编号" }
      } else if (this.editConfig.title === "产品名称") {
        this.tableList = {
          tableInfomation: [],
          tableColumn: [
            { label: "产品名称", prop: "Name", isClick: true },
            { label: "产品编号", prop: "Number" },
            { label: "规格型号", prop: "MaterialMode" }
          ]
        }
        this.searchSel = { value: "Name", label: "产品名称" }
      }
      this.commonOptions = [{ id: 1, name: "全部字段" }]
      for (let i = 1; i < this.tableList.tableColumn.length; i++) {
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        this.commonOptions.push({ id: (i + 1).toString(), name: label })
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    // 请求数据
    async getData() {
      this.loading = true
      if (this.editConfig.title === "销售总单") {
        this.getMasterOrderList()
      } else if (this.editConfig.title === "服务合同") {
        this.getServiceContractList()
      } else if (this.editConfig.title === "销售明细单") {
        this.getSalesDetailsList()
      } else if (this.editConfig.title === "报价单") {
        this.getQuotationList()
      } else if (this.editConfig.title === "客户服务单") {
        this.getServiceOrderList()
      } else if (this.editConfig.title === "产品名称") {
        this.getProductList()
      }
    },
    // 销售总单
    async getMasterOrderList() {
      await getMasterOrderList({
        search_map: this.search_map,
        page: 0,
        pageSize: 0
      }).then((res) => {
        if (res.code === 200) {
          if (res.data.list && res.data.list.length > 0) {
            const list = res.data.list.map((item) => {
              return {
                ...item,
                member_name: item.member.username
              }
            })
            this.tableList.tableInfomation = list.slice(0, 5) || []
          } else {
            this.tableList.tableInfomation = []
          }
        }
        this.loading = false
      })
    },
    // 服务合同
    async getServiceContractList() {
      await getServiceContractList({
        keyword: this.keyword,
        keywordType: this.keywordType,
        page: 0,
        pageSize: 0
      }).then((res) => {
        if (res.code === 200) {
          if (res.data.list && res.data.list.length > 0) {
            const list = res.data.list.map((item) => {
              return {
                ...item,
                client_name: item.client.name,
                member_name: item.member.username,
                serviceContractStatus: item.serviceContractStatus.name
              }
            })
            this.tableList.tableInfomation = list.slice(0, 5) || []
          } else {
            this.tableList.tableInfomation = []
          }
        }
        this.loading = false
      })
    },
    // 报价单
    async getQuotationList() {
      await getQuotationList({
        search_map: this.search_map,
        page: 0,
        pageSize: 0
      }).then((res) => {
        if (res.code === 200) {
          if (res.data.list && res.data.list.length > 0) {
            const list = res.data.list.map((item) => {
              return {
                ...item,
                member_name: item.member.username
              }
            })
            this.tableList.tableInfomation = list.slice(0, 5) || []
          } else {
            this.tableList.tableInfomation = []
          }
        }
        this.loading = false
      })
    },
    // 销售明细单
    async getSalesDetailsList() {
      await getSalesDetailsList({
        keyword: this.keyword,
        keywordType: this.keywordType,
        page: 0,
        pageSize: 0
      }).then((res) => {
        if (res.code === 200) {
          if (res.data.list && res.data.list.length > 0) {
            const list = res.data.list.map((item) => {
              return {
                ...item,
                client_name: item.client.name,
                member_name: item.Member.username
              }
            })
            this.tableList.tableInfomation = list.slice(0, 5) || []
          } else {
            this.tableList.tableInfomation = []
          }
        }
        this.loading = false
      })
    },
    // 客户服务单
    async getServiceOrderList() {
      await getServiceOrderList({
        keyword: this.keyword,
        keywordType: this.keywordType,
        page: 0,
        pageSize: 0
      }).then((res) => {
        if (res.code === 200) {
          if (res.data.list && res.data.list.length > 0) {
            const list = res.data.list.map((item) => {
              return {
                ...item,
                client_name: item.Client.name,
                serviceType_name: item.ServiceType.name,
                faultType_name: item.FaultType.name,
                serviceContract_Number: item.ServiceContract.number
              }
            })
            this.tableList.tableInfomation = list.slice(0, 5) || []
          } else {
            this.tableList.tableInfomation = []
          }
        }
        this.loading = false
      })
    },
    // 产品名称
    async getProductList() {
      await getProductList({
        productName: "",
        productNumber: "",
        page: 0,
        pageSize: 0
      }).then((res) => {
        if (res.code === 200) {
          if (res.data.list && res.data.list.length > 0) {
            const list = res.data.list.map((item) => {
              return {
                ...item,
                client_name: item.Client.name,
                serviceType_name: item.ServiceType.name,
                faultType_name: item.FaultType.name,
                serviceContract_Number: item.ServiceContract.number
              }
            })
            this.tableList.tableInfomation = list.slice(0, 5) || []
          } else {
            this.tableList.tableInfomation = []
          }
        }
        this.loading = false
      })
    },
    handleClose() {
      this.editConfig.editVisible = false
@@ -141,7 +342,25 @@
        this.$emit("selClient", row, "quotation")
      } else if (this.editConfig.title === "客户服务单") {
        this.$emit("selClient", row, "customService")
      } else if (this.editConfig.title === "产品名称") {
        this.$emit("selClient", row, "productName")
      }
    },
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val.value]: content
      }
      this.keyword = content
      this.keywordType = val.label
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.keyword = ""
      this.keywordType = ""
      this.getData()
    }
  }
}
src/views/other/commonDialog/SelectContactDialog.vue
@@ -10,7 +10,7 @@
    >
      <div class="bg-view">
        <div class="query-bg">
          <el-input placeholder="请输入内容" v-model="queryInput" size="mini" class="input-with-select">
          <!-- <el-input placeholder="请输入内容" v-model="queryInput" size="mini" class="input-with-select">
            <el-select v-model="select" slot="prepend" placeholder="请选择" disabled>
              <el-option label="全部字段" value="1"></el-option>
              <el-option label="联系人姓名" value="2"></el-option>
@@ -42,7 +42,26 @@
          <div slot="empty">
            <el-empty :image-size="100"></el-empty>
          </div>
        </el-table>
        </el-table> -->
          <SearchCommonView
            ref="searchCommonView"
            :search-options="searchOptions"
            @searchClick="searchClick"
            @resetClick="resetClick"
          />
          <div class="btn">
            <!-- <el-button type="primary" size="mini" disabled>设置字段</el-button>
            <el-button type="primary" size="mini" disabled>快速创建</el-button> -->
          </div>
        </div>
        <TableCommonView
          ref="tableListRef"
          v-loading="loading"
          :table-list="tableList"
          :select-box="false"
          @selContactsClick="selNameClick"
        >
        </TableCommonView>
        <div slot="footer" class="dialog-footer">
          <div class="remark">说明:支持多字段模糊查询,仅显示符合条件的前5条数据</div>
        </div>
@@ -75,22 +94,45 @@
      editConfig: this.editCommonConfig,
      queryInput: "",
      select: "1",
      tableData: [],
      tableList: [],
      searchSelOptions: [],
      loading: false
      loading: false,
      search_map: {}
    }
  },
  created() {
    this.setTable()
    this.getData()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [],
        tableColumn: [
          { label: "联系人姓名", prop: "name", isContactClick: true }, // 联系人姓名
          { label: "联系人编号", prop: "number" }, // 联系人编号
          { label: "客户名称", prop: "client_name" }, // 客户名称
          { label: "手机", prop: "phone" } // 手机号码
        ]
      }
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    handleClose() {
      this.editConfig.editVisible = false
    },
    // 请求数据
    async getData() {
      this.loading = true
      await getContactList()
      await getContactList({
        search_map: this.search_map,
        page: 0,
        pageSize: 0
      })
        .then((res) => {
          console.log(res)
          if (res.code === 200) {
@@ -101,18 +143,18 @@
                  client_name: item.Client.name
                }
              })
              this.tableData = list.slice(0, 5) || []
              this.tableList.tableInfomation = list.slice(0, 5) || []
            } else {
              this.tableData = []
              this.tableList.tableInfomation = []
            }
          } else {
            this.tableData = []
            this.tableList.tableInfomation = []
          }
          this.loading = false
        })
        .catch((err) => {
          console.log(err)
          this.tableData = []
          this.tableList.tableInfomation = []
          this.loading = false
        })
    },
@@ -120,26 +162,17 @@
      this.editConfig.editVisible = false
      this.$emit("selClient", row, "contact")
    },
    // 时间显示
    dateFormat(fmt, date) {
      let ret = ""
      date = new Date(date)
      const opt = {
        "Y+": date.getFullYear().toString(), // 年
        "m+": (date.getMonth() + 1).toString(), // 月
        "d+": date.getDate().toString(), // 日
        "H+": date.getHours().toString(), // 时
        "M+": date.getMinutes().toString(), // 分
        "S+": date.getSeconds().toString() // 秒
        // 有其他格式化字符需求可以继续添加,必须转化成字符串
    // 搜索
    searchClick(val, content) {
      console.log(val, content)
      this.search_map = {
        [val.value]: content
      }
      for (let k in opt) {
        ret = new RegExp("(" + k + ")").exec(fmt)
        if (ret) {
          fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"))
        }
      }
      return fmt
      this.getData()
    },
    resetClick() {
      this.search_map = {}
      this.getData()
    }
  }
}
src/views/service/serviceContract/AddServiceContractDialog.vue
@@ -620,11 +620,9 @@
      } 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, value) {
src/views/service/serviceContract/index.vue
@@ -197,7 +197,11 @@
      console.log(row)
      this.editConfig.visible = true
      this.editConfig.title = "编辑"
      this.editConfig.infomation = { ...row }
      this.editConfig.infomation = {
        ...row,
        contract_number: row.salesDetails.number,
        quotation_number: row.quotation.number
      }
    },
    // 删除
    delClick() {