yangfeng
2023-07-11 7955d7693a5854add1f1718644f380e94a4f0573
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<template>
  <div class="custom-manage">
    <div class="tab-view">
      <el-tabs v-model="activeName" @tab-click="tabsClick">
        <el-tab-pane label="全部(含所有公海)" name="first"></el-tab-pane>
        <el-tab-pane label="全部(含公海)" name="second"></el-tab-pane>
        <el-tab-pane label="全部(不含公海)" name="third"></el-tab-pane>
        <el-tab-pane label="公海已分配" name="fourth"></el-tab-pane>
        <el-tab-pane label="公未分配" name="aaa"></el-tab-pane>
      </el-tabs>
      <div class="sel-gonghai">
        <el-select v-model="gonghaiValue" placeholder="请选择" class="query-class-sel" size="mini">
          <el-option v-for="item in gonghaiOptions" :key="item.value" :label="item.label" :value="item.value">
          </el-option>
        </el-select>
        <div class="query-class-btn">
          <i class="el-icon-setting"></i>
        </div>
      </div>
    </div>
    <SearchCommonView ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" />
    <div class="btn-pager">
      <PublicFunctionBtnView
        :duplicate-check="true"
        :list-button="true"
        :map-button="true"
        :statistics="true"
        :operates-list="operatesList"
      />
      <PagerView class="page" />
    </div>
    <TableCommonView ref="tableListRef" :table-list="tableList">
      <template slot="tableButton">
        <el-table-column label="操作" width="150" fixed="right">
          <template slot-scope="scope">
            <el-button type="text" size="small">变更公海</el-button>
            <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
            <el-button type="text" size="small">跟进</el-button>
          </template>
        </el-table-column>
      </template>
    </TableCommonView>
    <!-- 新建/编辑客户管理 -->
    <AddCustomManageDialog v-if="editConfig.visible" :edit-cuntom-manage-config="editConfig" />
  </div>
</template>
 
<script>
import AddCustomManageDialog from "@/views/custom/customManage/AddCustomManageDialog"
export default {
  name: "CustomManage",
  props: {},
  components: {
    AddCustomManageDialog
  },
  computed: {
    searchCommonHeight() {
      return this.$refs.searchCommonView.offsetHeight
    }
  },
  data() {
    return {
      tableList: {},
      activeName: "first",
      gonghaiValue: "",
      gonghaiOptions: [],
      queryClassOptions: [
        { value: "1", label: "全部" },
        { value: "2", label: "潜在客户" },
        { value: "3", label: "成交客户" },
        { value: "4", label: "今日待联系" },
        { value: "5", label: "本月需回访" },
        { value: "6", label: "超过15天未联系" }
      ],
      searchOptions: [],
      operatesList: [
        { id: "1", name: "共享" },
        { id: "2", name: "群发邮件" },
        { id: "3", name: "群发短信" },
        { id: "4", name: "批量编辑" },
        { id: "5", name: "变更公海" },
        { id: "6", name: "提交审批" },
        { id: "7", name: "导出" },
        { id: "8", name: "下载全部附件" }
      ],
      editConfig: {
        visible: false,
        title: "新建",
        infomation: {}
      }
    }
  },
  created() {
    this.setTable()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [
          {
            customName: "上海通用机械有限公司",
            saleLeadOwner: "BOSS",
            importantLevel: "C类客户",
            notContactDay: "20",
            contactName: "董奇伟",
            phoneNumber: "15988887777",
            nextFollowDate: "2023-07-26",
            detailAddress: "上海市静安区威海路115号",
            customStatus: "潜在客户"
          }
        ],
        tableColumn: [
          { label: "客户名称", prop: "customName", min: 100 }, // 客户名称
          { label: "销售负责人", prop: "saleLeadOwner" }, // 销售负责人
          { label: "重要级别", prop: "importantLevel" }, // 重要级别
          { label: "下次回访日期", prop: "notContactDay", min: 90 }, // 未联系人天数
          { label: "手机号码", prop: "nextFollowDate" }, // 下次回访日期
          { label: "详细地址", prop: "detailAddress", min: 200 }, // 详细地址
          { label: "客户状态", prop: "customStatus" }, // 客户状态
          { label: "联系人姓名", prop: "contactName" }, // 联系人姓名
          { label: "手机", prop: "phoneNumber" } // 手机号码
        ]
      }
      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 })
      }
    },
    tabsClick(tab, event) {
      console.log(tab, event)
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true
      this.editConfig.title = "新建"
      this.editConfig.infomation = {
        customName: "",
        customNumber: "AC6521",
        customStatus: "",
        salesHead: "5",
        customType: "",
        customSource: "",
        importantLevel: "",
        serviceAgent: "",
        nextFollowupDate: "",
        latestServiceDate: "",
        contactName: "",
        phoneNumber: "",
        duties: "",
        wechat: "1",
        contactsEmail: "",
        industry: "",
        legalPerson: "",
        registerTime: "",
        registerCapital: "",
        companyNature: "",
        customerSize: "",
        operateRange: "",
        position: "",
        map: "",
        country: "1",
        province: "1",
        city: "1",
        region: "1",
        notes: "",
        approvalWorkflow: "",
        approvalSteps: "",
        approvalPerson: "",
        approvalUrgent: "",
        approvalOpinion: ""
      }
    },
    // 编辑
    handleClick(row) {
      console.log(row)
      this.editConfig.visible = true
      this.editConfig.title = "编辑"
      this.editConfig.infomation = {
        customName: row.customName,
        customNumber: "AC6521",
        customStatus: "",
        salesHead: row.salesHead,
        customType: "",
        customSource: "",
        importantLevel: "",
        serviceAgent: "",
        nextFollowupDate: row.nextFollowupDate,
        latestServiceDate: "",
        contactName: row.contactName,
        phoneNumber: row.phoneNumber,
        duties: "",
        wechat: "1",
        contactsEmail: "",
        industry: "",
        legalPerson: "",
        registerTime: "",
        registerCapital: "",
        companyNature: "",
        customerSize: "",
        operateRange: "",
        position: "",
        map: "",
        country: "1",
        province: "1",
        city: "1",
        region: "1",
        notes: "",
        approvalWorkflow: "",
        approvalSteps: "",
        approvalPerson: "",
        approvalUrgent: "",
        approvalOpinion: ""
      }
    }
  }
}
</script>
 
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.custom-manage {
  .tab-view {
    position: relative;
    .sel-gonghai {
      display: flex;
      position: absolute;
      top: 5px;
      left: 660px;
      height: 35px;
      line-height: 35px;
      .query-class-sel {
        width: 165px;
        margin-left: 10px;
      }
      .query-class-btn {
        font-size: 16px;
        margin-left: 10px;
        color: #bebebe;
      }
    }
  }
  .btn-pager {
    display: flex;
    .page {
      margin-left: auto;
    }
  }
}
::v-deep {
  .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
    padding-left: 25px;
  }
  .el-tabs__item {
    padding: 0 25px;
    height: 45px;
  }
}
</style>