-
-
{{ item.itemName }}
-
({{ item.projectNumber }}次)
+
+
+
+
+ {{ item.itemName }}
+ ({{ item.projectNumber }}次)
+
+
无
-
无
-
-
-
-
-
-
-
{{ teacher.teacherName }}
-
业绩: ¥{{ teacher.performance }}
+
+
+
+
+ {{ teacher.teacherName }}
+ 业绩: ¥{{ teacher.performance }}
+
+
无
-
无
-
-
-
-
- ¥{{ formatMoney(scope.row.paidAmount) }}
-
-
-
-
- ¥{{ formatMoney(scope.row.debtAmount) }}
-
-
-
-
- ¥{{ formatMoney(scope.row.totalAmount) }}
-
-
-
-
-
- {{ scope.row.remark || '无' }}
-
-
-
-
- {{ formatTime(scope.row.createTime) }}
+
+
+ ¥{{ formatMoney(scope.row.paidAmount) }}
+
+
+
+ ¥{{ formatMoney(scope.row.debtAmount) }}
+
+
+
+ ¥{{ formatMoney(scope.row.totalAmount) }}
+
+
+
+ {{ scope.row.remark || '无' }}
+
+
+
+ {{ formatTime(scope.row.createTime) }}
+
+
+
+ {{ scope.row[col.prop] !== null && scope.row[col.prop] !== undefined ? scope.row[col.prop] : '无' }}
+
-
+
+
+
+
+
+
+
+
+
+ 全选
+ 清空
+
+
+
+ {{ col.label }}
+
+
+
+
+
@@ -265,41 +281,47 @@ export default {
summaryData: null,
records: [],
listLoading: false,
- startTimePickerOptions: {
- disabledDate: (time) => {
- const timeMs = time.getTime()
- const nowMs = Date.now()
- const ninetyDaysMs = 90 * 24 * 60 * 60 * 1000
- // 不能选择未来日期
- if (timeMs > nowMs) return true
- // 若已选择结束时间:开始时间需在 [end-90天, end] 区间内
- if (this.query.endTime) {
- const minStart = this.query.endTime - ninetyDaysMs
- return timeMs < minStart || timeMs > this.query.endTime
- }
- return false
- }
+ showColumnDialog: false,
+ selectedColumns: [],
+ sortInfo: {
+ prop: '',
+ order: ''
},
- endTimePickerOptions: {
- disabledDate: (time) => {
- const timeMs = time.getTime()
- const nowMs = Date.now()
- const ninetyDaysMs = 90 * 24 * 60 * 60 * 1000
- // 不能选择未来日期
- if (timeMs > nowMs) return true
- // 若已选择开始时间:结束时间需在 [start, start+90天] 区间内
- if (this.query.startTime) {
- const maxEnd = this.query.startTime + ninetyDaysMs
- return timeMs < this.query.startTime || timeMs > maxEnd
- }
- return false
- }
- }
+ // 所有列配置
+ columnOptions: [
+ { prop: 'date', label: '开单日期', width: 120, sortable: false, align: 'left' },
+ { prop: 'customerName', label: '客户姓名', width: 100, sortable: false, align: 'left' },
+ { prop: 'customerPhone', label: '客户电话', width: 120, sortable: false, align: 'left' },
+ { prop: 'goldTriangle', label: '金三角', width: 100, sortable: false, align: 'left' },
+ { prop: 'customerType', label: '客户类型', width: 100, sortable: false, align: 'left' },
+ { prop: 'purchasedItems', label: '购买项目', minWidth: 200, sortable: false, align: 'left' },
+ { prop: 'giftedItems', label: '赠送项目', minWidth: 200, sortable: false, align: 'left' },
+ { prop: 'experienceItems', label: '体验项目', minWidth: 200, sortable: false, align: 'left' },
+ { prop: 'healthTeachers', label: '健康师', minWidth: 150, sortable: false, align: 'left' },
+ { prop: 'paidAmount', label: '已付金额', width: 100, sortable: true, align: 'left' },
+ { prop: 'debtAmount', label: '欠款金额', width: 100, sortable: true, align: 'left' },
+ { prop: 'totalAmount', label: '总金额', width: 100, sortable: true, align: 'left' },
+ { prop: 'paymentMethod', label: '支付方式', width: 100, sortable: false, align: 'left' },
+ { prop: 'remark', label: '备注', minWidth: 150, sortable: false, align: 'left' },
+ { prop: 'createTime', label: '开单时间', width: 150, sortable: true, align: 'left' }
+ ]
+ }
+ },
+ computed: {
+ // 可见的列
+ visibleColumns() {
+ return this.columnOptions.filter(col => this.selectedColumns.includes(col.prop))
+ },
+ // 计算表格高度
+ tableHeight() {
+ // 根据视口高度动态计算,减去筛选条件、统计卡片等的高度
+ return 'calc(100vh - 400px)'
}
},
created() {
this.initStoreOptions()
this.setDefaultTimeRange()
+ this.initColumnSettings()
},
methods: {
// 初始化门店选项
@@ -382,31 +404,6 @@ export default {
this.setDefaultTimeRange()
},
- // 导出数据
- exportData() {
- if (!this.query.storeId) {
- this.$message({
- type: 'warning',
- message: '请先选择门店并查询数据',
- duration: 1500
- })
- return
- }
-
- const params = {
- storeId: this.query.storeId,
- startTime: this.query.startTime,
- endTime: this.query.endTime
- }
-
- // 这里可以调用导出接口
- this.$message({
- type: 'info',
- message: '导出功能开发中...',
- duration: 1500
- })
- },
-
// 格式化金额
formatMoney(amount) {
if (!amount && amount !== 0) return '0.00'
@@ -444,6 +441,96 @@ export default {
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
+ },
+
+ // 初始化列设置
+ initColumnSettings() {
+ // 默认显示所有列
+ this.selectedColumns = this.columnOptions.map(col => col.prop)
+ // 尝试从本地存储读取
+ const savedColumns = localStorage.getItem('form1_column_settings')
+ if (savedColumns) {
+ try {
+ const columns = JSON.parse(savedColumns)
+ if (Array.isArray(columns) && columns.length > 0) {
+ this.selectedColumns = columns
+ }
+ } catch (e) {
+ console.error('读取列设置失败:', e)
+ }
+ }
+ },
+
+ // 全选列
+ selectAllColumns() {
+ this.selectedColumns = this.columnOptions.map(col => col.prop)
+ },
+
+ // 清空列
+ clearAllColumns() {
+ this.selectedColumns = []
+ },
+
+ // 保存列设置
+ saveColumnSettings() {
+ if (this.selectedColumns.length === 0) {
+ this.$message({
+ type: 'warning',
+ message: '至少需要显示一列',
+ duration: 1500
+ })
+ return
+ }
+ // 保存到本地存储
+ localStorage.setItem('form1_column_settings', JSON.stringify(this.selectedColumns))
+ this.showColumnDialog = false
+ this.$message({
+ type: 'success',
+ message: '字段设置已保存',
+ duration: 1500
+ })
+ },
+
+ // 排序变化
+ handleSortChange({ column, prop, order }) {
+ this.sortInfo = {
+ prop: prop || '',
+ order: order || ''
+ }
+ this.sortList()
+ },
+
+ // 排序列表
+ sortList() {
+ if (!this.sortInfo.prop || !this.sortInfo.order) {
+ return
+ }
+
+ const prop = this.sortInfo.prop
+ const order = this.sortInfo.order
+ const isAsc = order === 'ascending'
+
+ this.records.sort((a, b) => {
+ let aVal = a[prop]
+ let bVal = b[prop]
+
+ // 处理空值
+ if (aVal === null || aVal === undefined) aVal = 0
+ if (bVal === null || bVal === undefined) bVal = 0
+
+ // 转换为数字进行比较
+ aVal = Number(aVal)
+ bVal = Number(bVal)
+
+ if (isNaN(aVal)) aVal = 0
+ if (isNaN(bVal)) bVal = 0
+
+ if (isAsc) {
+ return aVal - bVal
+ } else {
+ return bVal - aVal
+ }
+ })
}
}
}
@@ -541,6 +628,34 @@ export default {
font-weight: 500;
}
+.table-wrapper {
+ height: 100%;
+ overflow: hidden;
+
+ ::v-deep .el-table {
+ width: 100%;
+ }
+
+ ::v-deep .el-table__body-wrapper {
+ overflow-y: auto;
+ overflow-x: auto;
+ }
+
+ ::v-deep .el-table__header-wrapper {
+ overflow-x: auto;
+ overflow-y: hidden;
+ // 隐藏滚动条但保持滚动功能
+ scrollbar-width: none; // Firefox
+ -ms-overflow-style: none; // IE 和 Edge
+
+ &::-webkit-scrollbar {
+ display: none; // Chrome, Safari, Opera
+ width: 0;
+ height: 0;
+ }
+ }
+}
+
// 响应式设计
@media (max-width: 768px) {
.statistics-cards {
diff --git a/antis-ncc-admin/src/views/statisticsList/form12.vue b/antis-ncc-admin/src/views/statisticsList/form12.vue
index b3532b8..c39d6cc 100644
--- a/antis-ncc-admin/src/views/statisticsList/form12.vue
+++ b/antis-ncc-admin/src/views/statisticsList/form12.vue
@@ -115,6 +115,23 @@
+
+
+
+
+
+
+
+
查询
重置
@@ -126,6 +143,7 @@
{
+ if (res.code == 200 && res.data) {
+ this.memberTypeOptions = res.data.map(item => ({
+ fullName: item.Name,
+ id: item.Value + '',
+ value: item.Value + '',
+ label: item.Name,
+ }))
+ } else {
+ this.memberTypeOptions = []
+ }
+ }).catch((err) => {
+ console.error('获取客户类型失败:', err)
+ this.memberTypeOptions = []
+ })
+ },
+
// 查询数据
search() {
this.listLoading = true
@@ -523,7 +566,8 @@ export default {
BillingUserId: undefined,
PurchaseItemId: undefined,
GiftItemId: undefined,
- ExperienceItemId: undefined
+ ExperienceItemId: undefined,
+ memberType: undefined
}
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
diff --git a/antis-ncc-admin/src/views/statisticsList/form13.vue b/antis-ncc-admin/src/views/statisticsList/form13.vue
index 1e05078..aef02ab 100644
--- a/antis-ncc-admin/src/views/statisticsList/form13.vue
+++ b/antis-ncc-admin/src/views/statisticsList/form13.vue
@@ -477,6 +477,7 @@ export default {
this.listQuery.pageSize = 20
this.list = []
this.total = 0
+ this.search()
},
// 获取品项类型的标签类型
diff --git a/antis-ncc-admin/src/views/statisticsList/form14.vue b/antis-ncc-admin/src/views/statisticsList/form14.vue
new file mode 100644
index 0000000..04f7674
--- /dev/null
+++ b/antis-ncc-admin/src/views/statisticsList/form14.vue
@@ -0,0 +1,498 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+
+
+
+
+
+ {{ formatDateTime(scope.row.consumeTime) || '无' }}
+
+
+
+
+
+ {{ scope.row.memberName || '无' }}
+
+
+
+
+
+ {{ scope.row.memberPhone || '无' }}
+
+
+
+
+
+ {{ scope.row.storeName || '无' }}
+
+
+
+
+
+ {{ scope.row.itemName || '无' }}
+
+
+
+
+
+ {{ scope.row.itemType || '无' }}
+
+
+
+
+
+
+ ¥{{ formatMoney(scope.row.itemPrice) }}
+
+
+
+
+
+ {{ scope.row.projectNumber || 0 }}
+
+
+
+
+
+ {{ scope.row.originalProjectNumber || 0 }}
+
+
+
+
+
+ ¥{{ formatMoney(scope.row.totalPrice) }}
+
+
+
+
+
+ {{ scope.row.sourceType || '无' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/antis-ncc-admin/src/views/statisticsList/form4.vue b/antis-ncc-admin/src/views/statisticsList/form4.vue
index efd912e..460af80 100644
--- a/antis-ncc-admin/src/views/statisticsList/form4.vue
+++ b/antis-ncc-admin/src/views/statisticsList/form4.vue
@@ -54,6 +54,7 @@
查询
重置
+ 字段设置
@@ -110,63 +111,61 @@
-
-
-
-
+
+
+
-
+
{{ scope.row.ItemName || '无' }}
+
+ ¥{{ formatMoney(scope.row.BillingAmount) }}
+
+
+ {{ formatPercent(scope.row.BillingAmountRatio) }}%
+
+
+ {{ formatPercent(scope.row.ItemRatio) }}%
+
+
+ {{ formatPercent(scope.row.RepeatBuyRate) }}%
+
+
+ ¥{{ formatMoney(scope.row.ConsumeAmount) }}
+
+
+ {{ formatPercent(scope.row.ConsumeAmountRatio) }}%
+
+
+ ¥{{ formatMoney(scope.row.RefundAmount) }}
+
+
+ {{ scope.row.RefundCount || 0 }}
+
+
+ {{ scope.row[col.prop] !== null && scope.row[col.prop] !== undefined ? scope.row[col.prop] : '无' }}
+
-
-
- ¥{{ formatMoney(scope.row.BillingAmount) }}
-
-
-
-
- {{ formatPercent(scope.row.BillingAmountRatio) }}%
-
-
-
-
-
- {{ formatPercent(scope.row.ItemRatio) }}%
-
-
-
-
-
- {{ formatPercent(scope.row.RepeatBuyRate) }}%
-
-
-
-
- ¥{{ formatMoney(scope.row.ConsumeAmount) }}
-
-
-
-
- {{ formatPercent(scope.row.ConsumeAmountRatio) }}%
-
-
-
-
-
-
-
- ¥{{ formatMoney(scope.row.RefundAmount) }}
-
-
-
-
- {{ scope.row.RefundCount || 0 }}
-
-
-
+
+
+
+
@@ -178,6 +177,29 @@
:end-time="query.endTime"
@close="dialogVisible = false"
/>
+
+
+
+
+
+ 全选
+ 清空
+
+
+
+ {{ col.label }}
+
+
+
+
+