diff --git a/src/api/account_center/sub_account.ts b/src/api/account_center/sub_account.ts index 8b4d9da..1f9e0a7 100644 --- a/src/api/account_center/sub_account.ts +++ b/src/api/account_center/sub_account.ts @@ -24,3 +24,7 @@ export function subAccountDetail(params: Record) { export function subAccountDelete(params: Record) { return request.post({ url: '/user/sonDel', params }) } +// 修改账号状态 +export function subAccountUpdateStatus(params: Record) { + return request.post({ url: '/user/changingAccountStatus', params }) +} diff --git a/src/assets/images/emptyStatus.png b/src/assets/images/emptyStatus.png new file mode 100644 index 0000000..b9dbd52 Binary files /dev/null and b/src/assets/images/emptyStatus.png differ diff --git a/src/assets/images/step-one.png b/src/assets/images/step-one.png new file mode 100644 index 0000000..502252a Binary files /dev/null and b/src/assets/images/step-one.png differ diff --git a/src/views/account_center/organization/edit.vue b/src/views/account_center/organization/edit.vue index 1ca7d61..59abdec 100644 --- a/src/views/account_center/organization/edit.vue +++ b/src/views/account_center/organization/edit.vue @@ -96,9 +96,13 @@ const setFormData = (data: Record) => { } const getDetail = async (row: Record) => { + console.log(row) + const data = await organzationDetail({ id: row.id }) + console.log(data, '==') + setFormData(data) } diff --git a/src/views/account_center/organization/index.vue b/src/views/account_center/organization/index.vue index bc4d2fd..a7274ee 100644 --- a/src/views/account_center/organization/index.vue +++ b/src/views/account_center/organization/index.vue @@ -113,8 +113,9 @@ const handleEdit = async (data: any) => { } const handleDelete = async (id: number) => { + const ids = [id] await feedback.confirm('确定要删除?') - await organzationDelete({ id }) + await organzationDelete({ ids }) feedback.msgSuccess('删除成功') getLists() } diff --git a/src/views/account_center/sub_account/components/account-list/empty-content.vue b/src/views/account_center/sub_account/components/account-list/empty-content.vue new file mode 100644 index 0000000..52edf21 --- /dev/null +++ b/src/views/account_center/sub_account/components/account-list/empty-content.vue @@ -0,0 +1,19 @@ + + + + diff --git a/src/views/account_center/sub_account/components/organization/message-box.vue b/src/views/account_center/sub_account/components/organization/message-box.vue index 56879a7..eefda44 100644 --- a/src/views/account_center/sub_account/components/organization/message-box.vue +++ b/src/views/account_center/sub_account/components/organization/message-box.vue @@ -2,9 +2,9 @@
- 此操作不可逆,确定删除该组织? + 此操作不可逆,确定删除【{{ name }}】组织?
- 此组织下的所有成员也会被删除。 +
@@ -15,6 +15,12 @@ export default defineComponent({ components: { WarningFilled }, + props: { + name: { + type: String, + default: '' + } + }, setup() { return { WalletFilled diff --git a/src/views/account_center/sub_account/components/organization/organization-tree.vue b/src/views/account_center/sub_account/components/organization/organization-tree.vue index 0ee1cbb..bac1493 100644 --- a/src/views/account_center/sub_account/components/organization/organization-tree.vue +++ b/src/views/account_center/sub_account/components/organization/organization-tree.vue @@ -46,6 +46,7 @@ export interface Tree { id: number label: string children?: Tree[] + name?: string } const props = defineProps({ data: { @@ -72,7 +73,7 @@ const treeRef = ref>() const primaryAccountId = computed(() => (props.data && props.data.length > 0 ? props.data[0]?.id : 0)) const filterNode = (value: string, data: Tree) => { if (!value) return true - return data.label.includes(value) + return data.name?.includes(value) } watch(filterText, val => { treeRef.value!.filter(val) diff --git a/src/views/account_center/sub_account/index.vue b/src/views/account_center/sub_account/index.vue index cddbf51..3ad42fe 100644 --- a/src/views/account_center/sub_account/index.vue +++ b/src/views/account_center/sub_account/index.vue @@ -2,8 +2,21 @@
- - + + + +
@@ -12,11 +25,14 @@ import accountNumber, { type IAccountInfo } from './modules/account-number.vue' import organization from './modules/organization.vue' import accountList from './modules/account-list.vue' +import accountEmpty from './modules/account-empty.vue' import type { Tree } from './components/organization/organization-tree.vue' import { subAccountNumber } from '@/api/account_center/sub_account' import { StatusEnum } from '@/enums' import feedback from '@/utils/feedback' +const organizationRef = ref>() +const organzationList = ref([]) const selectedNode = ref() const setSelectedNode = (data: Tree) => { selectedNode.value = data @@ -42,5 +58,13 @@ const fetchSubAccountNumber = async () => { } catch (error) {} } fetchSubAccountNumber() + +const getOrganizationList = (data: Tree[]) => { + organzationList.value = data +} +const fetchOrganizationList = async () => { + organizationRef.value?.fetchOrganizationList() + fetchTableList() +} diff --git a/src/views/account_center/sub_account/modules/account-empty.vue b/src/views/account_center/sub_account/modules/account-empty.vue new file mode 100644 index 0000000..162eeae --- /dev/null +++ b/src/views/account_center/sub_account/modules/account-empty.vue @@ -0,0 +1,26 @@ + + + + diff --git a/src/views/account_center/sub_account/modules/account-list.vue b/src/views/account_center/sub_account/modules/account-list.vue index 19851c6..5308bf9 100644 --- a/src/views/account_center/sub_account/modules/account-list.vue +++ b/src/views/account_center/sub_account/modules/account-list.vue @@ -1,61 +1,67 @@ diff --git a/src/views/workbench/components/conversion-process-chart.vue b/src/views/workbench/components/conversion-process-chart.vue index 96fc945..6abcb22 100644 --- a/src/views/workbench/components/conversion-process-chart.vue +++ b/src/views/workbench/components/conversion-process-chart.vue @@ -1,7 +1,7 @@ @@ -19,7 +19,7 @@ function createBarSeries(data, name, field) { } } -function createLineSeries(data, name) { +function createLineSeries(data, name, field) { return { name, type: 'line', @@ -28,7 +28,7 @@ function createLineSeries(data, name) { return value as number } }, - data: data.map(item => item.client), + data: data.map(item => item[field]), yAxisIndex: 1 } } @@ -36,48 +36,6 @@ const loading = ref(false) const data = ref([]) const xAxisData = ref([]) -const series = [ - createBarSeries(data.value, '线索数', 'clueNumber'), - createBarSeries(data.value, '线索转客户数', 'client'), - createLineSeries(data.value, '线索转客户率') -] - -const option = ref({ - color: ['#0E66FB', '#FAC858', '#96B2D9'], - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'cross', - crossStyle: { - color: '#999' - } - } - }, - toolbox: {}, - legend: {}, - xAxis: [ - { - type: 'category', - data: xAxisData.value - } - ], - yAxis: [ - { - type: 'value', - axisLabel: { - formatter: '{value}' - } - }, - { - type: 'value', - axisLabel: { - formatter: '{value}' - } - } - ], - series -}) - const chartRef = ref() const fetchData = async (payload: IForm) => { loading.value = true @@ -94,30 +52,71 @@ const fetchData = async (payload: IForm) => { } }) xAxisData.value = result.map((item: any) => item.organizationName) - if (series[2].data.length === 0) { - chartRef.value.setOption({ - title: { - text: '暂无数据', - x: 'center', - y: 'center' - }, - xAxis: [ - { - type: 'category', - data: [], - splitLine: { - show: false - }, - axisLine: { - show: false - } + chartRef.value.setOption({ + color: ['#0E66FB', '#FAC858', '#96B2D9'], + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + crossStyle: { + color: '#999' } - ], - legend: { - show: false } - }) - } + }, + toolbox: {}, + legend: {}, + title: { + text: '' + }, + xAxis: [ + { + type: 'category', + data: xAxisData.value + } + ], + yAxis: [ + { + type: 'value', + axisLabel: { + formatter: '{value}' + } + }, + { + type: 'value', + axisLabel: { + formatter: '{value}' + } + } + ], + series: [ + createBarSeries(data.value, '线索数', 'clueNumber'), + createBarSeries(data.value, '线索转客户数', 'client'), + createLineSeries(data.value, '线索转客户率', 'rate') + ] + }) + } else { + chartRef.value.setOption({ + legend: {}, + title: { + text: '暂无数据', + x: 'center', + y: 'center' + }, + xAxis: [ + { + type: 'category', + data: [], + splitLine: { + show: false + }, + axisLine: { + show: false + } + } + ], + yAxis: [], + series: [createBarSeries([], '', ''), createBarSeries([], '', ''), createLineSeries([], '', '')] + }) } } catch (error) {} loading.value = false diff --git a/src/views/workbench/components/converted-chart.vue b/src/views/workbench/components/converted-chart.vue index 49e5ecf..454f872 100644 --- a/src/views/workbench/components/converted-chart.vue +++ b/src/views/workbench/components/converted-chart.vue @@ -1,7 +1,7 @@ @@ -21,38 +21,6 @@ function createBarSeries(data, name, field) { const chartRef = ref() const data = ref([]) const xAxisData = ref([]) - -const series = [createBarSeries(data.value, '客户数', 'clientCount'), createBarSeries(data.value, '成交客户数', 'transactionClient')] - -const option = ref({ - color: ['#0E66FB', '#96B2D9'], - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'cross', - crossStyle: { - color: '#999' - } - } - }, - toolbox: {}, - legend: {}, - xAxis: [ - { - type: 'category', - data: xAxisData.value - } - ], - yAxis: [ - { - type: 'value', - axisLabel: { - formatter: '{value}' - } - } - ], - series -}) const loading = ref(false) const fetchData = async (payload: IForm) => { @@ -68,8 +36,7 @@ const fetchData = async (payload: IForm) => { } }) xAxisData.value = result.map((item: any) => item.organizationName) - const allZero = data.value.every(item => item.clientCount == 0 && item.transactionClient == 0) - if (allZero) { + if (!result.length) { chartRef.value.setOption({ title: { text: '暂无数据', @@ -90,7 +57,41 @@ const fetchData = async (payload: IForm) => { ], legend: { show: false - } + }, + series: [createBarSeries([], '', ''), createBarSeries([], '', '')] + }) + } else { + chartRef.value.setOption({ + color: ['#0E66FB', '#96B2D9'], + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + crossStyle: { + color: '#999' + } + } + }, + toolbox: {}, + legend: {}, + title: { + text: '' + }, + xAxis: [ + { + type: 'category', + data: xAxisData.value + } + ], + yAxis: [ + { + type: 'value', + axisLabel: { + formatter: '{value}' + } + } + ], + series: [createBarSeries(data.value, '客户数', 'clientCount'), createBarSeries(data.value, '成交客户数', 'transactionClient')] }) } } catch (error) {} diff --git a/src/views/workbench/components/data-overview.vue b/src/views/workbench/components/data-overview.vue index 528c933..83014a5 100644 --- a/src/views/workbench/components/data-overview.vue +++ b/src/views/workbench/components/data-overview.vue @@ -22,7 +22,8 @@ const loading = ref(false) const dataOverview = ref([]) const dataMap: Record = { followUpRecord: '新增跟进记录(个)', - newCustomer: '新增客户(个)', + unclaimedQuantity: '未领取(个)', + // newCustomer: '新增客户(个)', transactionClient: '成交客户(个)', convertingClient: '转化中客户(个)', exceptionPending: '异常待处理(个)', diff --git a/src/views/workbench/components/search-form.vue b/src/views/workbench/components/search-form.vue index f564487..c5d7b74 100644 --- a/src/views/workbench/components/search-form.vue +++ b/src/views/workbench/components/search-form.vue @@ -8,6 +8,7 @@ default-expand-all :data="organizationList" :render-after-expand="false" + check-strictly />