Sanakey
6 天以前 cb165187ddcf5d9cfd8aad97a2868d0343b14bd9
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<template>
  <a-collapse :class="prefixCls" v-model:activeKey="activeKey" ghost>
    <a-collapse-panel key="1" header="商机">
      <a-row :gutter="[12,12]" class="pb-20px">
        <template v-for="item in cardList" :key="item.title">
          <a-col :span="8">
            <a-card :class="`${prefixCls}-card`">
              <div :class="`${prefixCls}-card-title`">
<!--                <BasicTitle  :helpMessage="item.tips"></BasicTitle>-->
                {{ item.title }}
                <span v-if="item?.tips?.length>0" ><BasicHelp :text="item.tips" placement="top" /></span>
              </div>
              <div :class="`${prefixCls}__card-detail font-bold`">
                {{ item.detail || '--' }}
              </div>
            </a-card>
          </a-col>
        </template>
      </a-row>
 
 
      <BasicTable
        @register="registerTable"
      >
        <template #bodyCell="{ column, record, index }">
          <template v-if="column.key === 'cluesName'">
            <div>
              <a class="ml-5px ">
                {{ record.cluesName }}
              </a>
            </div>
          </template>
          <template v-if="column.key === 'status'">
            <a-tag color="green">
              {{ record.status }}
            </a-tag>
          </template>
          <template v-if="column.key === 'endTime'">
            <span class="c-red">
              {{ record.endTime }}
            </span>
          </template>
        </template>
 
      </BasicTable>
      <template #extra >
        <PlusCircleOutlined @click="addBusinessForm" />
      </template>
    </a-collapse-panel>
  </a-collapse>
 
  <ScheduleDetailModal @register="registerScheduleModal"></ScheduleDetailModal>
 
</template>
<script lang="ts" setup>
import {projectList} from './data';
import {PlusSquareOutlined,FileImageFilled,PlusCircleOutlined} from '@ant-design/icons-vue';
import {BasicArrow} from "@/components/Basic";
import {ref} from 'vue';
import ScheduleDetailModal from './ScheduleDetail.vue';
 
import { BasicHelp } from '@/components/Basic';
import EventBus from '@/utils/eventBus';
import {BasicTable, ColumnChangeParam, TableAction, useTable} from "@/components/Table";
import {cluesListApi} from "@/api/clues/table";
import {getEditCellColumns, getFormConfig} from "@/views/clues/components/tableData";
import {useModal} from "@/components/Modal";
import {Row} from "ant-design-vue";
import {applicationList} from "@/views/demo/page/account/center/data";
import Business from "@/router/routes/modules/business";
import {cluesDynamicApi} from "@/api/clues/dynamic";
const [registerScheduleModal, {openModal, setModalProps}] = useModal();
const openScheduleModal = () => {
  Logger.log('点击openScheduleModal');
  EventBus.emit('openScheduleModal', {
    title: '新建任务',
    content: '新建任务内容'
  });
};
 
const activeKey = ref(['1']);
function addBusinessForm(event) {
  Logger.log('addBusinessForm', event);
  event.stopPropagation();
}
 
 
 
 
let cardList = ref([
  {
    title: '赢单商机金额(CNY)',
    detail: '0.00',
  },
  {
    title: '赢单商机均价(CNY)',
    detail: '0.00',
  },
  {
    title: '首次赢单日期',
    tips: '所有赢单商机中最早的结束日期',
    detail: '',
  },
  {
    title: '最近赢单日期',
    tips: '所有赢单商机中最近的结束日期',
    detail: '',
  },
  {
    title: '进行中的商机数',
    tips: '「进行中」是指除赢单&输单之外的商机阶段',
    detail: '10',
  },
  {
    title: '赢单商机数',
    detail: '0',
  },
  {
    title: '赢单率',
    detail: '0%',
  },
  {
    title: '平均销售周期',
    detail: '0小时',
  },
  {
    title: '已生效回款单数',
    detail: '0',
  },
  {
    title: '已生效回款金额',
    detail: '0',
  },
]);
// 商机总览列表数据
setTimeout(() => {
  // getCustomerCardData();
}, 50);
async function getCustomerCardData(){
  let params = {
    page: 1,
    pageSize: 10,
  };
  try {
    let res = await cluesDynamicApi(params)
    Logger.log('cluesDynamicApi...',res);
    cardList.value = res.items;
  } catch (e) {
    Logger.error(e);
  } finally {
  }
}
 
// const pagination = {
//   onChange: (page: number) => {
//     console.log(page);
//   },
//   pageSize: 3,
// };
 
 
const [
  registerTable,
  {
    // setLoading,
    // setProps,
    // getColumns,
    // getDataSource,
    // getRawDataSource,
    // reload,
    // getPaginationRef,
    // setPagination,
    // getSelectRows,
    // getSelectRowKeys,
    // setSelectedRowKeys,
    // clearSelectedRowKeys,
  },
] = useTable({
  canResize: true,
  api: cluesListApi,
  // beforeFetch: (params) => {
  //   console.log('beforeFetch', params);
  //   params.pageNo = params.page;
  //   // return Promise.resolve(params);
  // },
  showIndexColumn: false,
  columns: [
    {
      title: '商机编号',
      // defaultHidden: true,
      dataIndex: 'id',
      width: 70
    },
    {
      title: '商机名称',
      // defaultHidden: true,
      dataIndex: 'cluesName',
      width: 200
    },
    {
      title: '当前阶段',
      dataIndex: 'status',
      width: 120,
    },
    {
      title: '销售金额',
      dataIndex: 'formId',
      width: 80,
    },
    {
      title: '结束日期',
      dataIndex: 'endTime',
      width: 100,
    },
    {
      title: '已生效回款金额',
      dataIndex: 'formId',
      width: 80,
    },
    {
      title: '未回款金额',
      dataIndex: 'formId',
      width: 80,
    },
    {
      title: '负责人',
      dataIndex: 'name',
      width: 80,
    },
 
  ],
  // defSort: {
  //   pageNo: 1,
  //   pageSize: 20,
  //   field: 'name',
  //   order: 'ascend',
  // },
  rowKey: 'id',
  // showTableSetting: false,
  // showIndexColumn: false, // 是否显示序号列
  // useSearchForm: false, // 使用搜索表单
  // clickToRowSelect: false,
  pagination: {
    // pageSize: 20,
    pageSizeOptions: ['10', '20', '50', '100'],
    defaultPageSize: 20,
    // showSizeChanger: true,
  },
});
 
const prefixCls = 'customer-modal-business';
</script>
<style lang="less" scoped>
.customer-modal-business{
  .icon-color{
    color: #1890ff;
  }
  :deep(&-btn) .ant-space{
    display: none;
  }
  :deep(.ant-collapse-content-box), :deep(.onbus-basic-table){
    padding: 0;
  }
  :deep(&-card) .ant-card-body{
    padding: 10px;
    background-color: #f9f9f9;
  }
  :deep(&-card-title) .onbus-basic-title{
    padding: 0;
  }
}
 
 
</style>