lanan-system-vue/src/views/repair/tickets/Components/TicketsShow.vue

361 lines
12 KiB
Vue
Raw Normal View History

2024-09-22 21:38:20 +08:00
<template>
<div class="app-container">
<el-dialog title="单据详情" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>工单信息</span>
</div>
<!-- 卡片内容 -->
<div>
<el-descriptions class="margin-top" :column="4" :size="'medium'" border style="margin-bottom: 1rem">
<el-descriptions-item>
<template slot="label">
订单编号
</template>
{{ info.ticketNo }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
维修类别
</template>
<dict-tag :type="DICT_TYPE.REPAIR_TYPE" v-model="info.repairType"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
状态
</template>
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_WORK_STATUS" v-model="info.ticketsWorkStatus"/>
2024-09-22 21:38:20 +08:00
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
客户名称
</template>
{{ info.userName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
车牌号
</template>
{{ info.carNo }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
车系
</template>
{{ info.carBrandName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
手机号
</template>
{{ info.userMobile }}
</el-descriptions-item>
2024-12-05 11:27:05 +08:00
<el-descriptions-item>
<template slot="label">
经办人姓名
</template>
{{ info.handleName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
经办人电话
</template>
{{ info.handleMobile }}
</el-descriptions-item>
2024-09-22 21:38:20 +08:00
<el-descriptions-item>
<template slot="label">
创建时间
</template>
{{ parseTime(info.createTime, '{y}-{m}-{d}') }}
</el-descriptions-item>
2024-10-30 11:26:49 +08:00
<el-descriptions-item>
<template slot="label">
表显里程
2024-10-30 11:26:49 +08:00
</template>
{{ info.mileageTraveled }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
三包单位
</template>
{{ info.threePackUnits }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
保险名称
</template>
{{ info.insuranceName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
管理费
</template>
{{ info.managerMoney }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
救援费
</template>
{{ info.rescueMoney }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
三包费
</template>
{{ info.threePackMoney }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
定损费
</template>
{{ info.confirmFaultMoney }}
</el-descriptions-item>
2024-09-22 21:38:20 +08:00
<el-descriptions-item>
<template slot="label">
预计完工
</template>
{{ parseTime(info.outTime, '{y}-{m}-{d}') }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
合计金额
</template>
{{ info.totalPrice }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
2024-12-05 11:27:05 +08:00
最近保养日期
2024-09-22 21:38:20 +08:00
</template>
2024-12-05 11:27:05 +08:00
{{ parseTime(info.maintenanceDate, '{y}-{m}-{d}') }}
2024-09-22 21:38:20 +08:00
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
2024-12-05 11:27:05 +08:00
最近保养里程
2024-09-22 21:38:20 +08:00
</template>
2024-12-05 11:27:05 +08:00
{{ info.maintenanceMileage }}
2024-09-22 21:38:20 +08:00
</el-descriptions-item>
2025-08-20 09:26:25 +08:00
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 参考成本-->
<!-- </template>-->
<!-- {{ info.cost }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 参考毛利-->
<!-- </template>-->
<!-- {{ info.profit }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 领料状态-->
<!-- </template>-->
<!-- <dict-tag :type="DICT_TYPE.REPAIR_PART_STATUS" v-model="info.partStatus"/>-->
<!-- </el-descriptions-item>-->
2024-09-22 21:38:20 +08:00
<el-descriptions-item>
<template slot="label">
服务顾问
</template>
{{ info.adviserName }}
</el-descriptions-item>
2025-08-20 09:26:25 +08:00
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 所属门店-->
<!-- </template>-->
<!-- {{ info.corpId }}-->
<!-- </el-descriptions-item>-->
2024-09-22 21:38:20 +08:00
<el-descriptions-item>
<template slot="label">
工单状态
</template>
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="info.ticketsStatus"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
备注
</template>
{{ info.remark }}
</el-descriptions-item>
</el-descriptions>
</div>
</el-card>
<el-card class="box-card" v-if="projects && projects.length > 0">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>项目信息</span>
</div>
<!-- 卡片内容 -->
<div>
<TicketItemShow :list="projects" list-type="project"/>
</div>
</el-card>
<el-card class="box-card" v-if="wares && wares.length > 0">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>材料信息</span>
2024-10-18 22:02:51 +08:00
<el-switch v-if="userRole === 'service_advisor'" style="float: right; padding: 3px 0"
v-model="info.partShow"
active-text="客户可见"
inactive-text="客户不可见"
active-value="1"
inactive-value="0"
@change="changeShow"
2024-10-18 22:02:51 +08:00
>
</el-switch>
2024-09-22 21:38:20 +08:00
</div>
<!-- 卡片内容 -->
<div>
<TicketItemShow :list="wares" list-type="ware"/>
</div>
</el-card>
<el-card class="box-card" v-if="others && others.length > 0">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>附加信息</span>
</div>
<!-- 卡片内容 -->
<div>
<TicketItemShow :list="others" list-type="other"/>
</div>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>合计</span>
</div>
<div>
2025-08-20 09:26:25 +08:00
<el-descriptions class="margin-top" :column="3" :size="'medium'" border style="margin-bottom: 1rem">
<el-descriptions-item>
<template slot="label">
总数量
</template>
{{ totalCount }}
</el-descriptions-item>
2025-08-20 09:26:25 +08:00
<el-descriptions-item>
<template slot="label">
成本
</template>
{{ otherInfo.cost }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
总金额
</template>
2025-08-20 09:26:25 +08:00
{{ totalMoney }}
</el-descriptions-item>
</el-descriptions>
</div>
2025-08-15 14:57:14 +08:00
<div v-hasPermi="['repair:tick:profit']">
<el-descriptions class="margin-top" :column="2" :size="'medium'" border style="margin-bottom: 1rem">
<el-descriptions-item>
<template slot="label">
含工时项目毛利率
</template>
{{ otherInfo.profitRate * 100 }}%
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
不含工时项目的毛利率
</template>
2025-08-20 09:26:25 +08:00
{{ otherInfo.profitRateNo * 100 }}%
2025-08-15 14:57:14 +08:00
</el-descriptions-item>
</el-descriptions>
</div>
</el-card>
2025-08-20 09:26:25 +08:00
<el-card class="box-card" v-hasPermi="['repair:tick:profit']">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>工种</span>
</div>
<!-- 卡片内容 -->
<div>
<TicketsJobType :list="otherInfo.groupByJobType" list-type="other"/>
</div>
</el-card>
2024-09-22 21:38:20 +08:00
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import TicketItemShow from "@/views/repair/tickets/Components/TicketItemShow.vue";
2024-10-18 22:02:51 +08:00
import {getTicketsById, updateShow} from "@/api/repair/tickets/Tickets";
2025-08-20 09:26:25 +08:00
import TicketsJobType from "@/views/repair/tickets/Components/TicketsJobType.vue";
2024-09-22 21:38:20 +08:00
export default {
name: "TicketsShow",
props: {
2024-10-18 22:02:51 +08:00
userRole: String
},
2025-08-20 09:26:25 +08:00
components: {TicketsJobType, TicketItemShow},
2024-09-22 21:38:20 +08:00
data() {
return {
dialogVisible: false,
info: {},
projects: [],
wares: [],
others: [],
allList: [],
totalCount: 0,
2025-08-15 14:57:14 +08:00
totalMoney: 0,
2025-08-20 09:26:25 +08:00
otherInfo: {}
2024-09-22 21:38:20 +08:00
}
},
methods: {
async open(row) {
this.reset()
2024-09-22 21:38:20 +08:00
const res = await getTicketsById(row.id)
this.allList = res.data.items
this.computed()
this.projects = this.allList.filter(item => item.project)
this.wares = this.allList.filter(item => item.ware)
this.others = this.allList.filter(item => item.other)
2024-09-22 21:38:20 +08:00
this.info = row
2025-08-15 14:57:14 +08:00
this.otherInfo = res.data
2024-09-22 21:38:20 +08:00
this.dialogVisible = true
2024-10-18 22:02:51 +08:00
},
async changeShow() {
2024-10-18 22:02:51 +08:00
try {
await updateShow(this.info.id, this.info.partShow)
} catch {
}
},
reset() {
this.info = {}
this.projects = []
this.wares = []
this.others = []
this.allList = []
},
2025-08-20 09:26:25 +08:00
computed() {
this.totalCount = 0
this.totalMoney = 0
2025-08-20 09:26:25 +08:00
if (this.allList && this.allList.length > 0) {
this.totalCount = this.allList.reduce((acc, cur) => {
return acc + cur.itemCount
}, 0)
this.totalMoney = this.allList.reduce((acc, cur) => {
return acc + cur.itemMoney
}, 0)
}
2024-09-22 21:38:20 +08:00
}
}
}
</script>
<style scoped lang="scss">
.box-card {
margin-bottom: 10px;
}
</style>