This commit is contained in:
xuyuncong 2025-10-17 09:38:29 +08:00
parent 8d0b878eec
commit 6ec6c1cf61
6 changed files with 438 additions and 14 deletions

View File

@ -20,6 +20,15 @@ export function getRepairSoPage(params){
})
}
// 统计
export function purchase(params){
return request({
url: preUrl + "/purchase-amount",
method: "get",
params
})
}
// 作废
export function voidSo(data){
return request({

View File

@ -167,13 +167,13 @@
</el-table>
<!-- 分页 -->
<pagination
<!-- <pagination
v-show="total>0"
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList"
/>
/> -->
</el-card>
<!-- 业务渠道对话框 -->

View File

@ -24,6 +24,111 @@
<!-- 根据不同ID显示不同内容 -->
<div class="content-area" v-else>
<!-- 打印按钮 -->
<div style="margin-bottom: 20px; text-align: right;">
<print-button :print-title="dialogTitle" button-text="打印">
<template #printContent>
<div class="print-dialog-content">
<h1>{{ dialogTitle }}</h1>
<div class="print-date">时间范围{{ currentRange[0] }} {{ currentRange[1] }}</div>
<!-- 客户来源统计 -->
<div v-if="(id == 1 || id == 5)" class="customer-source">
<table class="print-table">
<thead>
<tr>
<th>客户来源</th>
<th>数量</th>
<th>公示金额</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in datas" :key="index">
<td>{{ item.name }}</td>
<td>{{ item.theNum }}</td>
<td>{{ item.theAmount }}</td>
</tr>
</tbody>
</table>
</div>
<!-- 检测车型统计 -->
<div v-if="id == 2" class="car-model-stats">
<table class="print-table">
<thead>
<tr>
<th>车型</th>
<th>数量</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in datas" :key="index">
<td>{{ item.goodsTitle }}</td>
<td>{{ item.theNum }}</td>
</tr>
</tbody>
</table>
</div>
<!-- 待收款统计 -->
<div v-if="id == 3 || id == 7" class="pending-payment">
<table class="print-table">
<thead>
<tr>
<th>渠道</th>
<th>台次</th>
<th>金额</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in datas" :key="index">
<td>{{ item.sourceName }}</td>
<td>{{ item.pendingCount }}</td>
<td>{{ item.pendingAmountYuan }}</td>
</tr>
</tbody>
</table>
</div>
<!-- 检测类型统计 -->
<div v-if="id == 4" class="inspection-type">
<table class="print-table">
<thead>
<tr>
<th>检测类型</th>
<th>订单数量</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in datas" :key="index">
<td>{{ item.skuName }}</td>
<td>{{ item.orderCount }}</td>
</tr>
</tbody>
</table>
</div>
<!-- 资料统计 -->
<div v-if="id == 6" class="document-stats">
<table class="print-table">
<thead>
<tr>
<th>文件名称</th>
<th>上传时间</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in datas" :key="index">
<td>{{ item.fileName }}</td>
<td>{{ item.createTime }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
</print-button>
</div>
<!-- 客户来源统计 -->
<div v-if="(id == 1 || id == 5)" class="customer-source">
<el-table :data="datas" style="width: 100%">
@ -98,12 +203,14 @@
import * as statisticsApi from './api/statistics'
import CommonTimeSelect from '@/components/CommonTimeSelect'
import WorkOrderList from '@/views/partner/components/WorkOrderList.vue'
import PrintButton from '@/components/PrintButton'
export default {
name: 'StatisticsDialog',
components: {
CommonTimeSelect,
WorkOrderList
WorkOrderList,
PrintButton
},
props: {
visible: {

View File

@ -7,7 +7,43 @@
<div class="container">
<!-- 检测数量统计 -->
<el-card class="stat-card">
<div class="title-header">
<div class="title_">检测数量统计</div>
<print-button print-title="打印检测数量统计" button-text="打印">
<template #printContent>
<div class="print-card">
<h1>检测数量统计</h1>
<div class="print-date">时间范围{{ ranges[0] }} {{ ranges[1] }}</div>
<div class="stats-grid">
<div class="stat-item">
<div class="text_">订单数量</div>
<div class="value">{{ data2.allNum || 0 }}</div>
</div>
<div class="stat-item">
<div class="text_">完成数量</div>
<div class="value">{{ data2.ywcNum || 0 }}</div>
</div>
<div class="stat-item">
<div class="text_">检测中数量</div>
<div class="value">{{ data2.jxzNum || 0 }}</div>
</div>
<div class="stat-item">
<div class="text_">重检数量</div>
<div class="value">{{ data2.reinspectNum || 0 }}</div>
</div>
<div class="stat-item">
<div class="text_">复检数量</div>
<div class="value">{{ data2.recheckNum || 0 }}</div>
</div>
<div class="stat-item">
<div class="text_">退办理数量</div>
<div class="value">{{ data2.tblNum || 0 }}</div>
</div>
</div>
</div>
</template>
</print-button>
</div>
<div class="card-content">
<common-time-select v-model="ranges" @change="slectRangeInspectionCount"></common-time-select>
<div class="stats-grid">
@ -41,7 +77,35 @@
<!-- 营业额统计 -->
<el-card class="stat-card">
<div class="title-header">
<div class="title_">营业额统计</div>
<print-button print-title="打印营业额统计" button-text="打印">
<template #printContent>
<div class="print-card">
<h1>营业额统计</h1>
<div class="print-date">时间范围{{ rangeYYE[0] }} {{ rangeYYE[1] }}</div>
<div class="stats-grid">
<div class="stat-item">
<div class="text_">公示价格</div>
<div class="value">{{ data1.gsAmount || 0 }}</div>
</div>
<div class="stat-item">
<div class="text_">应收款</div>
<div class="value">{{ data1.yskAmount || 0 }}</div>
</div>
<div class="stat-item">
<div class="text_">已收款</div>
<div class="value">{{ data1.yjsAmount || 0 }}</div>
</div>
<div class="stat-item">
<div class="text_">待收款</div>
<div class="value">{{ data1.dsAmount || 0 }}</div>
</div>
</div>
</div>
</template>
</print-button>
</div>
<div class="card-content">
<common-time-select v-model="rangeYYE" @change="slectRangeYYECount"></common-time-select>
<div class="stats-grid">
@ -67,7 +131,36 @@
<!-- 业务渠道统计 -->
<el-card class="stat-card">
<div class="title-header">
<div class="title_">业务渠道统计</div>
<print-button print-title="打印业务渠道统计" button-text="打印">
<template #printContent>
<div class="print-card">
<h1>业务渠道统计</h1>
<div class="print-date">时间范围{{ rangeBusiness[0] }} {{ rangeBusiness[1] }}</div>
<div v-if="data3.length > 0" class="print-table-container">
<table class="print-table">
<thead>
<tr>
<th>业务渠道</th>
<th>数量</th>
<th>公示金额</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in data3" :key="index">
<td>{{ item.name }}</td>
<td>{{ item.theNum }}</td>
<td>{{ item.theAmount }}</td>
</tr>
</tbody>
</table>
</div>
<div v-else class="no-data">暂无数据</div>
</div>
</template>
</print-button>
</div>
<div class="card-content">
<common-time-select v-model="rangeBusiness" @change="slectRangeBusinessCount"></common-time-select>
<div v-if="data3.length > 0" class="channel-table">
@ -97,7 +190,27 @@
<!-- 资料统计 -->
<el-card class="stat-card">
<div class="title-header">
<div class="title_">资料统计</div>
<print-button print-title="打印资料统计" button-text="打印">
<template #printContent>
<div class="print-card">
<h1>资料统计</h1>
<div class="print-date">时间范围{{ rangeZL[0] }} {{ rangeZL[1] }}</div>
<div class="stats-grid">
<div class="stat-item">
<div class="text_">新增</div>
<div class="value">{{ fileRes.addCount || 0 }}</div>
</div>
<div class="stat-item">
<div class="text_">修改</div>
<div class="value">{{ fileRes.updateCount || 0 }}</div>
</div>
</div>
</div>
</template>
</print-button>
</div>
<div class="card-content">
<common-time-select v-model="rangeZL" @change="slectRangeZLCount"></common-time-select>
<div class="stats-grid">
@ -117,8 +230,35 @@
<el-card class="stat-card">
<div class="title-header">
<div class="title_">检测车型统计</div>
<div class="header-actions">
<print-button print-title="打印检测车型统计" button-text="打印">
<template #printContent>
<div class="print-card">
<h1>检测车型统计</h1>
<div class="print-date">时间范围{{ rangeGoods[0] }} {{ rangeGoods[1] }}</div>
<div v-if="data4.length > 0" class="print-table-container">
<table class="print-table">
<thead>
<tr>
<th>车型</th>
<th>数量</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in data4" :key="index">
<td>{{ item.goodsTitle || '' }}</td>
<td>{{ item.theNum || '' }}</td>
</tr>
</tbody>
</table>
</div>
<div v-else class="no-data">暂无数据</div>
</div>
</template>
</print-button>
<el-button type="text" @click="showDetailDialog(2)">更多 ></el-button>
</div>
</div>
<div class="card-content">
<common-time-select v-model="rangeGoods" @change="slectRangeGoodsCount"></common-time-select>
<div v-if="data4.length > 0" class="stats-grid">
@ -135,8 +275,35 @@
<el-card class="stat-card">
<div class="title-header">
<div class="title_">检测类型统计</div>
<div class="header-actions">
<print-button print-title="打印检测类型统计" button-text="打印">
<template #printContent>
<div class="print-card">
<h1>检测类型统计</h1>
<div class="print-date">时间范围{{ rangeSku[0] }} {{ rangeSku[1] }}</div>
<div v-if="skuList.length > 0" class="print-table-container">
<table class="print-table">
<thead>
<tr>
<th>检测类型</th>
<th>订单数量</th>
</tr>
</thead>
<tbody>
<tr v-for="(skuData, index) in skuList" :key="index">
<td>{{ skuData.skuName }}</td>
<td>{{ skuData.orderCount || 0 }}</td>
</tr>
</tbody>
</table>
</div>
<div v-else class="no-data">暂无数据</div>
</div>
</template>
</print-button>
<el-button type="text" @click="showDetailDialog(4)">更多 ></el-button>
</div>
</div>
<div class="card-content">
<common-time-select v-model="rangeSku" @change="slectRangeSkuCount"></common-time-select>
<div v-if="skuList.length > 0" class="stats-grid">
@ -153,6 +320,33 @@
<el-card class="stat-card">
<div class="title-header">
<div class="title_">待收款</div>
<print-button print-title="打印待收款统计" button-text="打印">
<template #printContent>
<div class="print-card">
<h1>待收款统计</h1>
<div class="print-date">时间范围{{ rangeDsk[0] }} {{ rangeDsk[1] }}</div>
<div v-if="data5.length === 0" class="no-data">暂无数据</div>
<div v-else class="print-table-container">
<table class="print-table">
<thead>
<tr>
<th>渠道</th>
<th>金额</th>
<th>台次</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in data5" :key="index">
<td>{{ item.channel || '' }}</td>
<td>{{ item.theAmount || '' }}</td>
<td>{{ item.order_count || '' }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
</print-button>
</div>
<div class="card-content">
<common-time-select v-model="rangeDsk" @change="slectRangeDskCount"></common-time-select>
@ -191,6 +385,16 @@
append-to-body
v-if="workOrderListVisible"
>
<div style="margin-bottom: 15px; text-align: right;">
<print-button print-title="打印工单详情" button-text="打印">
<template #printContent>
<div class="print-workorder-content">
<h1>工单详情</h1>
<div>工单详情内容将在打印时显示</div>
</div>
</template>
</print-button>
</div>
<WorkOrderList
:show-search="true"
:show-summary="true"
@ -210,13 +414,15 @@
import CommonTimeSelect from '@/components/CommonTimeSelect'
import StatisticsDialog from './StatisticsDialog'
import WorkOrderList from '@/views/partner/components/WorkOrderList.vue'
import PrintButton from '@/components/PrintButton'
export default {
name: 'BusinessStatistics',
components: {
CommonTimeSelect,
StatisticsDialog,
WorkOrderList
WorkOrderList,
PrintButton
},
data() {
return {
@ -499,6 +705,43 @@
align-items: center;
margin-bottom: 15px;
}
.header-actions {
display: flex;
align-items: center;
gap: 10px;
}
/* 打印样式 */
.print-card .stats-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20px;
margin-top: 20px;
}
.print-card .stat-item {
background: #f8f9fa;
padding: 15px;
text-align: center;
border-radius: 4px;
}
.print-card .print-date {
text-align: center;
color: #666;
margin-bottom: 20px;
}
.print-table-container {
margin-top: 20px;
}
.print-card .no-data {
text-align: center;
color: #999;
padding: 40px 0;
}
}
.card-content {

View File

@ -76,7 +76,13 @@
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- 采购金额展示 -->
<el-card class="amount-card" v-if="soByType && !goodsYes">
<div class="amount-info">
<span class="amount-label">采购总金额</span>
<span class="amount-value">¥{{ purchaseAmount.toFixed(2) }}</span>
</div>
</el-card>
<!-- 采购/领料 -->
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="序号" align="center">
@ -277,7 +283,7 @@ import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
import {DICT_TYPE} from "@/utils/dict";
import {getRepairSoPage, voidSo, getRepairSoById, inWare, exportData} from "@/api/repair/stockOperate/stockOperate";
import {getRepairSoPage, voidSo, getRepairSoById, inWare, exportData, purchase} from "@/api/repair/stockOperate/stockOperate";
import SoShow from "@/views/repair/stockOperate/Components/SoSow.vue";
import {getRepairSoiByIds, getMapBySoIdAndQuery} from "@/api/repair/stockOperate/stockOperateItem";
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
@ -356,6 +362,7 @@ export default {
list: [],
loading: false,
total: 0,
purchaseAmount: 0,
dialogVisible: false,
inItems: [],
inItemsQuery: null,
@ -523,6 +530,8 @@ export default {
const res = await getRepairSoPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
const purchaseRes = await purchase(this.queryParams)
this.purchaseAmount = purchaseRes.data
} finally {
this.loading = false
}
@ -784,4 +793,22 @@ export default {
cursor: text;
}
}
.amount-card {
margin-bottom: 20px;
.amount-info {
display: flex;
align-items: center;
.amount-label {
font-size: 14px;
color: #606266;
margin-right: 8px;
}
.amount-value {
font-size: 18px;
font-weight: bold;
color: #f56c6c;
}
}
}
</style>

View File

@ -209,6 +209,31 @@
prop="handleMobile"
width="180"
/>
<el-table-column
label="维修费用"
align="center"
prop="totalPrice"
width="180"
/>
<el-table-column
label="参考成本"
align="center"
prop="accessoriesMoney"
width="180"
/>
<el-table-column
label="进厂时间"
align="center"
prop="inTime"
width="180"
>
<template slot-scope="scope">
{{ formatDateValue(scope.row.inTime) }}
</template>
</el-table-column>
<el-table-column
label="工单状态"
align="center"
@ -531,8 +556,7 @@
</template>
<script>
import {
getPageType,
import { getPageType,
updateTake,
getTicketsById,
removeTicketById,
@ -544,6 +568,7 @@ import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
import UpdateRepair from "@/views/repair/tickets/form/UpdateRepair.vue";
import TWOperate from "@/views/repair/tickets/form/TWOperate.vue";
import { createUniqueCodeByHead } from "@/utils/createUniqueCode";
import { formatDate } from "@/utils/dateUtils";
import { updateTicketWares } from "@/api/repair/tickets/TicketWares";
import { getIfLeader } from "@/api/repair/repairworker";
import UpdateRecord from "@/views/repair/tickets/form/UpdateRecord.vue";
@ -668,6 +693,19 @@ export default {
this.queryBusiAndCus();
},
methods: {
formatDate,
formatDateValue(value) {
if (!value) return '-';
try {
// Ensure the value is a number or can be converted to a number
const timestamp = typeof value === 'number' ? value : Number(value);
if (isNaN(timestamp)) return '-';
// Create a new Date object from the timestamp
return formatDate(new Date(timestamp), 'yyyy-MM-dd');
} catch (error) {
return '-';
}
},
async getNowUser() {
const res = await getUserProfile();
this.nowUser = res.data;