Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
许允枞 2024-11-04 11:35:53 +08:00
commit b96157f2c5
17 changed files with 767 additions and 186 deletions

View File

@ -28,6 +28,7 @@ VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab
# 大屏设计器服务
VUE_APP_BIG_SCREEN_SERVER = 'http://127.0.0.1:3000'
VUE_APP_IMAGE_URL = 'http://122.51.230.86:9000/'
#小程序推广码前缀
VUE_APP_REPAIR_PREX = 'https://www.lighting-it.cn/share?inviteId='

0
section.docx Normal file
View File

View File

@ -56,9 +56,10 @@ export function exportOrderInfoExcel(params) {
export function toPay(params) {
return request({
url: '/admin-api/pay/toPayCode',
// url: '/admin-api/pay/toPayCode',
url: '/repair/order-info/toPay?id=' + params.orderId,
method: 'get',
params
// params
})
}

View File

@ -158,3 +158,20 @@ export function addItems(data){
data
})
}
// 修改工单主表,只是主表
export function updateTicket(data){
return request({
url: preUrl + '/updateTicket',
method: 'post',
data
})
}
// 删除工单
export function removeTicketById(id){
return request({
url: preUrl + "/remove?id=" + id,
method: 'delete'
})
}

View File

@ -43,6 +43,18 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="开户行" prop="bankAccount">
<el-input v-model="formData.bankAccount" placeholder="请输入开户行" maxlength="50"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收款账户" prop="account">
<el-input v-model="formData.account" placeholder="请输入收款账户" maxlength="18"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="联系人" prop="contactName">
@ -128,7 +140,9 @@ export default {
loginAccount: undefined,
password: undefined,
serviceCodeArray: [],
serviceCodes:undefined
serviceCodes:undefined,
bankAccount: null,
account: null,
},
//
formRules: {
@ -232,7 +246,9 @@ export default {
loginAccount: undefined,
password: undefined,
serviceCodeArray: [],
serviceCodes:undefined
serviceCodes:undefined,
bankAccount: null,
account: null,
}
this.resetForm('formRef')
}

View File

@ -77,6 +77,8 @@
</template>
</el-table-column>
<el-table-column label="管理员登录账号" align="left" prop="loginAccount" width="180"/>
<el-table-column label="开户行" align="left" prop="bankAccount" width="180"/>
<el-table-column label="收款账户" align="left" prop="account" width="180"/>
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"

View File

@ -2,15 +2,15 @@
<div class="container_">
<div class="top-list">
<div class="list-box" v-for="(item, index) in serviceList" :key="item.id" :span="4">
<div @click="goRoute(item.id)">
<img :src="imgUrl + item.coverImg"
style="width: 300px; height: 300px;">
<div style="font-weight: bold;text-align: center;font-size: 28px">{{ item.name }}</div>
</div>
</div>
</div>
<!-- <div class="top-list">-->
<!-- <div class="list-box" v-for="(item, index) in serviceList" :key="item.id" :span="4">-->
<!-- <div @click="goRoute(item.id)">-->
<!-- <img :src="imgUrl + item.coverImg"-->
<!-- style="width: 300px; height: 300px;">-->
<!-- <div style="font-weight: bold;text-align: center;font-size: 28px">{{ item.name }}</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->

View File

@ -1,6 +1,6 @@
<template>
<el-select v-model="userSelected" clearable filterable >
<el-option v-for="user in userList" :key="user.id" :label="user.cusName + ' ' + user.phoneNumber" :value="user.id" />
<el-select v-model="userSelected" clearable filterable :filter-method="handleQuery">
<el-option v-for="user in userList" :key="user.id" :label="user.cusName + ' ' + user.phoneNumber" :value="user.id"/>
</el-select>
</template>
@ -10,11 +10,11 @@ import {getCustomerMainPage} from "@/api/base/customer";
export default {
name: "UserChoose",
props:{
value:{
props: {
value: {
type: Object,
},
inList:{
inList: {
type: Object,
default: null,
required: false
@ -24,28 +24,30 @@ export default {
return {
userList: [],
userSelected: undefined,
queryParams:{
queryParams: {
pageNo: 1,
pageSize: 10
pageSize: 10,
cusName: null,
phoneNumber: null,
},
total: 0
}
},
watch:{
userSelected(val){
if (val){
watch: {
userSelected(val) {
if (val) {
const user = this.userList.find(item => item.id === val)
this.$emit("input", user)
}
},
value(val){
value(val) {
this.userSelected = val ? val.id : null
},
inList(val){
if (val){
inList(val) {
if (val) {
//
const flag = this.userList.findIndex(item => item.id === val.id)
if (flag > 0){
if (flag > 0) {
this.userList.splice(flag, 1)
}
this.userList.unshift(val)
@ -57,10 +59,18 @@ export default {
this.listCustomer()
},
methods: {
async listCustomer(){
async listCustomer() {
const res = await getCustomerMainPage(this.queryParams)
this.userList = res.data.records
this.total = res.data.total
},
handleQuery(data) {
if (/^\d+$/.test(data)) {
this.queryParams.phoneNumber = data
} else {
this.queryParams.cusName = data
}
this.listCustomer()
}
}
}

View File

@ -3,12 +3,12 @@
<div class="top_">
<div>车辆维修数据分析</div>
</div>
<!-- -->
<!-- -->
<div class="content_">
<div class="c_left">
<div class="six_box">
<div class="s_title">
客户来源
客户来源分析
</div>
<div class="echaets_box">
<div id="khly" style="width: 400px; height: 267px;"></div>
@ -16,36 +16,71 @@
</div>
<div class="six_box">
<div class="s_title">
月工单数据来源
月工单数量走势
</div>
<div class="echaets_box">
<div id="gdslzs" style="width: 400px; height: 267px;"></div>
</div>
<div class="echaets_box"></div>
</div>
<div class="six_box">
<div class="s_title">
支付渠道统计
</div>
<div class="echaets_box"></div>
<div class="echaets_box">
<div id="zfqdtj" style="width: 400px; height: 267px;"></div>
</div>
</div>
</div>
<div class="c_cont">
<div class="tab_">
<div class="tab_buttom tab_acvit" >数量</div>
<div class="tab_buttom">金额</div>
<div @click="countOrAmount()" class="tab_buttom tab_acvit">数量</div>
<div @click="countOrAmount()" class="tab_buttom">金额</div>
</div>
<div class="tab_bt">
<div v-if="isCount" class="tab_bt">
<div class="yb_">
<div class="yb_title">工单总数</div>
<div class="numlist">
<div class="num_box" v-for="(item,index) in 6" :key="index">
{{index}}
<!-- <div class="num_box" v-for="(item,index) in 6" :key="index">-->
<!-- {{index}}-->
<!-- </div>-->
<div class="num_box">
{{ statistics.totalCount }}
</div>
</div>
</div>
<div class="yb_">
<div class="yb_title">今日工单</div>
<div class="numlist">
<div class="num_box" v-for="(item,index) in 6" :key="index">
{{index}}
<!-- <div class="num_box" v-for="(item,index) in 6" :key="index">-->
<!-- {{index}}-->
<!-- </div>-->
<div class="num_box">
{{ statistics.todayCount }}
</div>
</div>
</div>
</div>
<div v-else class="tab_bt">
<div class="yb_">
<div class="yb_title">工单总金额</div>
<div class="numlist">
<!-- <div class="num_box" v-for="(item,index) in 6" :key="index">-->
<!-- {{index}}-->
<!-- </div>-->
<div class="num_box">
{{ statistics.totalAmount }}
</div>
</div>
</div>
<div class="yb_">
<div class="yb_title">今日工单金额</div>
<div class="numlist">
<!-- <div class="num_box" v-for="(item,index) in 6" :key="index">-->
<!-- {{index}}-->
<!-- </div>-->
<div class="num_box">
{{ statistics.todayAmount }}
</div>
</div>
</div>
@ -56,8 +91,8 @@
<img src="./imgs/1.png" style="width: 60px;height: 60px">
</div>
<div>
<div class="f_size">未派工</div>
<div class="f_num">2082</div>
<div class="f_size">{{ statusTickets[3].name }}</div>
<div class="f_num">{{ statusTickets[3].value }}</div>
</div>
</div>
<div class="f_box">
@ -65,8 +100,8 @@
<img src="./imgs/2.png" style="width: 60px;height: 60px">
</div>
<div>
<div class="f_size">施工中</div>
<div class="f_num">2082</div>
<div class="f_size">{{ statusTickets[4].name }}</div>
<div class="f_num">{{ statusTickets[4].value }}</div>
</div>
</div>
<div class="f_box">
@ -74,8 +109,8 @@
<img src="./imgs/3.png" style="width: 60px;height: 60px">
</div>
<div>
<div class="f_size">未结账</div>
<div class="f_num">2082</div>
<div class="f_size">{{ statusTickets[0].name }}</div>
<div class="f_num">{{ statusTickets[0].value }}</div>
</div>
</div>
<div class="f_box">
@ -83,8 +118,8 @@
<img src="./imgs/4.png" style="width: 60px;height: 60px">
</div>
<div>
<div class="f_size">已结账</div>
<div class="f_num">2082</div>
<div class="f_size">{{ statusTickets[1].name }}</div>
<div class="f_num">{{ statusTickets[1].value }}</div>
</div>
</div>
<div class="f_box">
@ -92,13 +127,13 @@
<img src="./imgs/5.png" style="width: 60px;height: 60px">
</div>
<div>
<div class="f_size">挂账</div>
<div class="f_num">2082</div>
<div class="f_size">{{ statusTickets[5].name }}</div>
<div class="f_num">{{ statusTickets[5].value }}</div>
</div>
</div>
</div>
<div class="co_title">
最新工单
今日工单
</div>
<div class="list_long">
<div class="long_title">
@ -108,14 +143,13 @@
<div class="l_four">创建时间</div>
</div>
<div class="ot_vox">
<div class="long_box" v-for="(item,index) in 16" :key="index">
<div class="l_one">1209840149750105501</div>
<div class="l_two">张三</div>
<div class="l_three">李向东</div>
<div class="l_four">2024-10-20 12:00</div>
<div class="long_box" v-for="(item,index) in todayTickets" :key="index">
<div class="l_one">{{ item.ticketNo }}</div>
<div class="l_two">{{ item.userName }}</div>
<div class="l_three">{{ item.adviserName }}</div>
<div class="l_four">{{ parseTime(item.createTime) }}</div>
</div>
</div>
</div>
</div>
<div class="c_right">
@ -123,19 +157,36 @@
<div class="s_title">
维修类型统计
</div>
<div class="echaets_box"></div>
<div class="echaets_box">
<div id="wxlxtj" style="width: 400px; height: 267px;"></div>
</div>
</div>
<div class="six_box">
<div class="s_title">
月工单金额走势
</div>
<div class="echaets_box"></div>
<div class="echaets_box">
<div id="gdjezs" style="width: 400px; height: 267px;"></div>
</div>
</div>
<div class="six_box">
<div class="s_title">
维修工人排行
</div>
<div class="echaets_box"></div>
<div class="echaets_box">
<div class="list_long">
<div class="long_title">
<div class="l_one">姓名</div>
<div class="l_two">服务工单数</div>
</div>
<div class="ot_vox">
<div class="long_box" v-for="(item,index) in workers" :key="index">
<div class="l_one">{{ item.name }}</div>
<div class="l_two">{{ item.value }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@ -145,38 +196,71 @@
<script>
import * as echarts from 'echarts';
import * as RepairBigScreenApi from '@/views/repair/screen/api/repairBigScreen';
export default {
name: 'Index',
components: {
},
components: {},
data() {
return {
//
statistics: {},
//
statusTickets: [],
//
isCount: true,
//
todayTickets: [],
//
workers: []
}
},
created() {
//
this.ticketStatistics()
//
this.ticketStatusCount()
//
this.listTicketToday()
//
this.listWorks()
},
mounted() {
this.echaerCar();
//
this.customerSource();
//
this.ticketMainCount()
//
this.ticketMainAmount()
//
this.ticketMainPayWay()
//
this.repairTypeStatistics()
},
methods: {
echaerCar(){
countOrAmount() {
this.isCount = !this.isCount
},
/**
* 客户来源分析饼图
*/
async customerSource() {
const res = await RepairBigScreenApi.customerSource();
var chartDom = document.getElementById('khly');
var myChart = echarts.init(chartDom);
var option;
option = {
// legend: {
// top: 'bottom'
// },
toolbox: {
show: true,
},
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
series: [
{
name: 'Nightingale Chart',
name: '客户来源分析',
type: 'pie',
radius: [20, 100],
center: ['50%', '50%'],
@ -184,31 +268,195 @@ export default {
itemStyle: {
borderRadius: 2
},
data: [
{ value: 40, name: '救援' },
{ value: 38, name: '线下' },
{ value: 32, name: '小程序预约' },
]
data: res.data,
}
]
};
option && myChart.setOption(option);
},
/**
* 月工单数量走势
*/
async ticketMainCount() {
const res = await RepairBigScreenApi.ticketMainCount();
var chartDom = document.getElementById('gdslzs');
var myChart = echarts.init(chartDom, 'dark');
var option;
option = {
tooltip: {
trigger: 'axis'
},
xAxis: {
type: 'category',
data: res.data.xData
},
yAxis: {
type: 'value'
},
series: [
{
data: res.data.data,
type: 'line',
smooth: true
}
]
};
option && myChart.setOption(option);
},
/**
* 月工单金额走势
*/
async ticketMainAmount() {
const res = await RepairBigScreenApi.ticketMainAmount();
var chartDom = document.getElementById('gdjezs');
var myChart = echarts.init(chartDom, 'dark');
var option;
option = {
tooltip: {
trigger: 'axis'
},
xAxis: {
type: 'category',
data: res.data.xData
},
yAxis: {
type: 'value'
},
series: [
{
data: res.data.data,
type: 'line',
smooth: true
}
]
};
option && myChart.setOption(option);
},
/**
* 支付渠道统计
*/
async ticketMainPayWay() {
const res = await RepairBigScreenApi.ticketMainPayWay();
var chartDom = document.getElementById('zfqdtj');
var myChart = echarts.init(chartDom, 'dark');
var option;
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
data: res.data.xData
},
yAxis: {
type: 'value'
},
series: [
{
data: res.data.data,
type: 'bar'
}
]
};
option && myChart.setOption(option);
},
/**
* 维修类型相关统计分析饼图
*/
async repairTypeStatistics() {
const res = await RepairBigScreenApi.repairTypeStatistics();
var chartDom = document.getElementById('wxlxtj');
var myChart = echarts.init(chartDom, 'dark');
var option;
option = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: '维修类型统计',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
padAngle: 5,
itemStyle: {
borderRadius: 10
},
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: res.data
}
]
};
option && myChart.setOption(option);
},
/**
* 单总数今日工单工单总金额今日工单金额
*/
async ticketStatistics() {
const res = await RepairBigScreenApi.ticketStatistics();
this.statistics = res.data
},
/**
* 工单状态数量统计
*/
async ticketStatusCount() {
const res = await RepairBigScreenApi.ticketStatusCount();
this.statusTickets = res.data
},
/**
* 今日工单
*/
async listTicketToday() {
const res = await RepairBigScreenApi.listTicketToday();
this.todayTickets = res.data
},
/**
* 维修工人排行
*/
async listWorks() {
const res = await RepairBigScreenApi.listWorks();
this.workers = res.data
}
}
}
</script>
<style lang="scss" scoped>
.cont{
.cont {
background: #020F32;
//background: url("./imgs/back.png") no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100vh;
}
.top_{
.top_ {
width: 100%;
height: 86px;
background: url("./imgs/top.png") no-repeat;
@ -221,19 +469,23 @@ export default {
font-weight: bold;
margin-bottom: 15px;
}
.content_{
.content_ {
width: 100%;
display: flex;
//align-items: center;
justify-content: space-between;
}
.c_left{
.c_left {
width: 25%;
}
.c_cont{
.c_cont {
width: 50%;
}
.tab_{
.tab_ {
display: flex;
align-items: center;
justify-content: center;
@ -242,13 +494,15 @@ export default {
color: #FFFFFF;
margin: 15px auto;
}
.yb_title{
.yb_title {
text-align: center;
font-size: 18px;
color: #FFFFFF;
margin: 15px auto;
}
.tab_bt{
.tab_bt {
display: flex;
align-items: center;
justify-content: center;
@ -257,7 +511,8 @@ export default {
box-sizing: border-box;
padding-bottom: 20px;
}
.tab_buttom{
.tab_buttom {
width: 120px;
height: 32px;
@ -266,18 +521,21 @@ export default {
align-items: center;
justify-content: center;
}
yb_title{
yb_title {
font-size: 16px;
color: #FFFFFF;
text-align: center;
width: 100%;
}
.numlist{
.numlist {
display: flex;
align-items: center;
justify-content: center;
}
.num_box{
.num_box {
width: 38px;
height: 50px;
border-radius: 0px 0px 0px 0px;
@ -291,37 +549,45 @@ yb_title{
color: #FFFFFF;
margin: 0px 10px;
}
.yb_{
.yb_ {
width: 50%;
}
.tab_acvit{
.tab_acvit {
background: #0174F6 !important;
}
.five_box{
.five_box {
display: flex;
align-items: center;
justify-content: space-around;
margin: 30px auto;
}
.f_size{
.f_size {
font-size: 14px;
color: #FFFFFF;
}
.f_num{
.f_num {
font-weight: bold;
font-size: 24px;
color: #FFFFFF;
}
.img_left{
.img_left {
width: 60px;
height: 60px;
margin-right: 10px;
}
.f_box{
.f_box {
display: flex;
align-items: center;
}
.co_title{
.co_title {
width: 100%;
height: 32px;
background: url("./imgs/c_title.png") no-repeat;
@ -332,7 +598,8 @@ yb_title{
box-sizing: border-box;
padding-left: 40px;
}
.s_title{
.s_title {
width: 90%;
height: 32px;
background: url("./imgs/title.png") no-repeat;
@ -344,53 +611,60 @@ yb_title{
padding-left: 40px;
margin: 0px auto;
}
.echaets_box{
.echaets_box {
width: 90%;
height: 267px;
margin: 0px auto;
border-bottom: 1px solid #0174F6;
}
.list_long{
.list_long {
width: 100%;
height: 563px;
}
.l_one{
.l_one {
width: 30%;
text-align: left;
font-size: 18px;
color: rgba(255,255,255,0.7);
color: rgba(255, 255, 255, 0.7);
overflow: hidden;
box-sizing: border-box;
padding-left: 35px;
}
.l_two{
.l_two {
width: 20%;
text-align: center;
font-size: 18px;
color: rgba(255,255,255,0.7);
color: rgba(255, 255, 255, 0.7);
overflow: hidden;
}
.l_three{
.l_three {
width: 20%;
text-align: center;
font-size: 18px;
color: rgba(255,255,255,0.7);
color: rgba(255, 255, 255, 0.7);
overflow: hidden;
}
.l_four{
.l_four {
width: 30%;
text-align: right;
font-size: 18px;
color: rgba(255,255,255,0.7);
color: rgba(255, 255, 255, 0.7);
overflow: hidden;
box-sizing: border-box;
padding-right: 35px;
}
.long_title{
.long_title {
width: 100%;
height: 58px;
background: rgba(1,116,246,0.1);
background: rgba(1, 116, 246, 0.1);
background: url("./imgs/c_list.png") no-repeat;
background-size: 100% 100%;
display: flex;
@ -398,25 +672,29 @@ yb_title{
justify-content: space-between;
margin: 10px auto;
}
.ot_vox{
.ot_vox {
width: 100%;
height: 500px;
overflow: auto;
scrollbar-width: none;
}
.long_box{
.long_box {
width: 100%;
height: 58px;
background: rgba(1,116,246,0.1);
background: rgba(1, 116, 246, 0.1);
display: flex;
align-items: center;
justify-content: space-between;
margin: 10px auto;
}
.six_box{
.six_box {
margin-bottom: 15px;
}
.c_right{
.c_right {
width: 25%;
}

View File

@ -419,6 +419,12 @@ export default {
//
async handleSubmit() {
try {
const isNull = this.validateNull();
if (!isNull) return;
const names = this.validateZero()
if (names){
await this.$modal.confirm("确认配件:" + names + "的采购价格为0吗")
}
await this.createInit()
await createRepairSo(this.formData)
this.inStockDialog = false
@ -457,6 +463,35 @@ export default {
}
})]
},
validateNull(){
const flag = this.partList.map(item => {
const price = item.newPrice
if (price === null || price === ""){
this.$modal.msgError("配件:" + item.name + "采购价格为空")
return false
}else {
return true
}
})
let count = 0
flag.forEach(item => {
if (!item){
count++
}
})
return count === 0
},
validateZero(){
const flag = this.partList.map(item => {
const price = parseFloat(item.newPrice)
if (price === 0){
return item.name
}else {
return ""
}
})
return flag.filter(item => item !== "").join(",")
}
}
}
</script>

View File

@ -44,6 +44,12 @@
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
>查看
</el-button>
<el-button v-hasPermi="['repair:tkm:edit']" size="mini" type="text" icon="el-icon-setting" @click="handleEditTicket(scope.row)">
编辑工单
</el-button>
<el-button v-hasPermi="['repair:tkm:remove']" size="mini" type="text" icon="el-icon-remove" @click="handleRemove(scope.row)">
删除
</el-button>
<el-button v-if="userRole === 'service_advisor' && isFinish" size="mini" type="text" icon="el-icon-refresh" @click="handleEditRecord(scope.row)">
维修记录设置
</el-button>
@ -77,6 +83,9 @@
v-if="(userRole === 'repair_staff' ? (leader ? !isFinish : false) : false) && !(scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff' && !isFinish)">
重新指派
</el-button>
<el-button v-if="userRole === 'repair_staff' && !isFinish && scope.row.ticketsWorkStatus === '01' && !(nowUser.id === scope.row.nowRepairId)" @click="handleGet(scope.row)" size="mini" type="text" icon="el-icon-document-add">
申请配件
</el-button>
<el-dropdown
v-if="(scope.row.ticketsWorkStatus !== '01' && ((userRole === 'service_advisor' || userRole === 'general_inspection') && !isFinish)) || (userRole === 'repair_staff' && !isFinish && scope.row.ticketsWorkStatus !== '01')"
@command="(command) => handleCommand(command, scope.$index, scope.row)">
@ -148,11 +157,12 @@
</el-dialog>
<RecordSetting ref="recordSet" />
<EditTickets ref="editTickets" @success="listTickets"/>
</div>
</template>
<script>
import {getPageType, updateTake, getTicketsById} from "@/api/repair/tickets/Tickets";
import {getPageType, updateTake, getTicketsById, removeTicketById} from "@/api/repair/tickets/Tickets";
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";
@ -162,10 +172,11 @@ import {getIfLeader} from "@/api/repair/repairworker";
import UpdateRecord from "@/views/repair/tickets/form/UpdateRecord.vue";
import {getUserProfile} from "@/api/system/user";
import RecordSetting from "@/views/repair/tickets/form/RecordSetting.vue";
import EditTickets from "@/views/repair/tickets/form/EditTickets.vue";
export default {
name: "TicketManagerItem",
components: {RecordSetting, UpdateRecord, TWOperate, UpdateRepair, TicketsShow},
components: {EditTickets, RecordSetting, UpdateRecord, TWOperate, UpdateRepair, TicketsShow},
props: {
isFinish: {
type: Boolean,
@ -398,6 +409,20 @@ export default {
handleEditRecord(row){
this.$refs.recordSet.open(row.id)
},
handleEditTicket(row){
this.$refs.editTickets.open(row)
},
async handleRemove(row){
try {
const id = row.id
if (id){
await this.$modal.confirm("确认删除工单" + row.ticketNo + "吗?")
await removeTicketById(id)
await this.listTickets()
this.$modal.msgSuccess("删除成功")
}
}catch{}
}
}
}
</script>

View File

@ -104,7 +104,7 @@
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
>查看
</el-button>
<el-button v-if="TicketType === 'tu' && isWXCW && scope.row.isFinish === '1'" size="mini" type="text" icon="el-icon-finished"
<el-button v-if="scope.row.isFinish === '1'" v-hasPermi="['repair:tk:paid']" size="mini" type="text" icon="el-icon-finished"
@click="handlePaid(scope.row)"
>结算
</el-button>
@ -117,11 +117,14 @@
</el-button>
<el-button size="mini" type="text" icon="el-icon-printer"
@click="handlePrint(scope.row)"
>打印
>下载打印
</el-button>
<el-button size="mini" type="text" icon="el-icon-setting" @click="handleEditTicket(scope.row)">
<el-button size="mini" v-hasPermi="['repair:tk:edit']" type="text" icon="el-icon-setting" @click="handleEditTicket(scope.row)">
编辑工单
</el-button>
<el-button size="mini" v-hasPermi="['repair:tk:remove']" type="text" icon="el-icon-remove" @click="handleRemove(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
@ -178,7 +181,7 @@
</template>
<script>
import {setTicketsVoid, setTicketsPaid, setTicketsPrint} from '@/api/repair/tickets/Tickets'
import {setTicketsVoid, setTicketsPaid, setTicketsPrint, removeTicketById} from '@/api/repair/tickets/Tickets'
import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
import {getByNameAndMobile} from "@/api/base/customer";
import EditTickets from "@/views/repair/tickets/form/EditTickets.vue";
@ -206,7 +209,7 @@ export default {
formData: {
id: null,
ticketsStatus: null,
remark: null,
billingRemark: null,
payType: null
},
formRules:{
@ -226,7 +229,7 @@ export default {
cancelButtonText: '取消',
}).then(({value}) => {
this.formData.id = row.id
this.formData.remark = value
this.formData['remark'] = value
this.formData.ticketsStatus = "03"
this.doVoid()
}).catch(() => {
@ -260,7 +263,7 @@ export default {
this.formData = {
id: null,
ticketsStatus: null,
remark: null,
billingRemark: null,
payType: null
}
this.formData['id'] = row.id
@ -297,6 +300,17 @@ export default {
},
returnSuccess(){
this.$emit("success")
},
async handleRemove(row){
try {
const id = row.id
if (id){
await this.$modal.confirm("确认删除工单" + row.ticketNo + "吗?")
await removeTicketById(id)
await this.listTickets()
this.$modal.msgSuccess("删除成功")
}
}catch{}
}
}
}

View File

@ -123,13 +123,16 @@
</div>
<!-- 卡片内容 -->
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="90px">
<el-form-item label="关键字" prop="query">
<el-input style="width: 20rem" type="text" placeholder="工单号、车牌号、联系电话" v-model="queryParams.query"/>
<el-input style="width: 20rem" type="text" placeholder="工单号、车牌号、联系电话"
v-model="queryParams.query"/>
</el-form-item>
<el-form-item label="状态" prop="waresStatus">
<el-select v-model="queryParams.waresStatus">
<el-option v-for="item in this.getDictDatas(DICT_TYPE.TW_ITEM_STATUS)" :key="item.value" :label="item.label" :value="item.value" />
<el-option v-for="item in this.getDictDatas(DICT_TYPE.TW_ITEM_STATUS)" :key="item.value"
:label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
<el-form-item>
@ -151,42 +154,53 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<!-- <el-table-column align="center" label="客户可见" prop="isShow" v-if="userRole === 'service_advisor' && type" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <el-switch-->
<!-- v-model="scope.row.isShow"-->
<!-- active-text="是"-->
<!-- inactive-text="否"-->
<!-- active-value="1"-->
<!-- inactive-value="0"-->
<!-- @change="changeIsShow(scope.row)"-->
<!-- >-->
<!-- </el-switch>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="客户可见" prop="isShow" v-if="userRole === 'service_advisor' && type" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <el-switch-->
<!-- v-model="scope.row.isShow"-->
<!-- active-text="是"-->
<!-- inactive-text="否"-->
<!-- active-value="1"-->
<!-- inactive-value="0"-->
<!-- @change="changeIsShow(scope.row)"-->
<!-- >-->
<!-- </el-switch>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true"/>
<el-table-column label="规格" align="center" prop="wares.model" width="180"/>
<el-table-column label="数量" align="center" prop="waresCount" width="180"/>
<el-table-column v-if="userRole === 'service_advisor' && type" label="折扣" align="center" prop="itemDiscount" width="180">
<!-- <div v-if="formData.status === '01'" class="item" slot-scope="scope">-->
<!--&lt;!&ndash; <el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount"/>&ndash;&gt;-->
<!-- <DiscountInput @input-blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount" />-->
<!-- <span class="item__txt">{{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}</span>-->
<!-- </div>-->
<el-table-column v-if="userRole === 'service_advisor' && type" label="销售价格" align="center" prop="wares.price" width="180">
<div v-if="formData.status === '01'" class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.price"/>
<span class="item__txt">{{ scope.row.wares.price }}</span>
</div>
<div v-else slot-scope="scope">
<span>{{ scope.row.wares.price }}</span>
</div>
</el-table-column>
<el-table-column v-if="userRole === 'service_advisor' && type" label="折扣" align="center"
prop="itemDiscount" width="180">
<!-- <div v-if="formData.status === '01'" class="item" slot-scope="scope">-->
<!--&lt;!&ndash; <el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount"/>&ndash;&gt;-->
<!-- <DiscountInput @input-blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount" />-->
<!-- <span class="item__txt">{{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}</span>-->
<!-- </div>-->
<div slot-scope="scope">
<span>{{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}</span>
</div>
</el-table-column>
<el-table-column label="状态" align="center" prop="waresStatus" width="180">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.TW_ITEM_STATUS" :value="scope.row.waresStatus" />
<dict-tag :type="DICT_TYPE.TW_ITEM_STATUS" :value="scope.row.waresStatus"/>
</template>
</el-table-column>
<el-table-column align="center" label="备注" prop="remark" width="180" :show-overflow-tooltip="true"/>
</el-table>
</div>
</el-card>
<div slot="footer" class="dialog-footer" v-if="info.status === '01' && (userRole === 'service_advisor' || userRole === 'general_inspection')">
<div slot="footer" class="dialog-footer"
v-if="info.status === '01' && (userRole === 'service_advisor' || userRole === 'general_inspection')">
<el-button type="primary" @click="handleAudit(true)"> </el-button>
<el-button @click="handleAudit(false)"> </el-button>
</div>
@ -199,18 +213,19 @@ import {getTicketsById} from "@/api/repair/tickets/Tickets";
import {auditTicketWares} from "@/api/repair/tickets/TicketWares";
import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem";
import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.vue";
import item from "@/layout/components/Sidebar/Item.vue";
export default {
name: "TicketWaresShow",
components: {DiscountInput},
props:{
props: {
userRole: String,
type: Boolean
},
data(){
return{
info:{},
items:[],
data() {
return {
info: {},
items: [],
dialogVisible: false,
queryParams: {
twId: null,
@ -221,12 +236,12 @@ export default {
loading: false,
formData: {},
clickCellMap: {},
editProp: [],
editProp: ['wares.price'],
}
},
methods:{
async open(row){
if (row){
methods: {
async open(row) {
if (row) {
this.formData = row
const res = await getTicketsById(row.ticketId)
this.info = res.data
@ -236,7 +251,7 @@ export default {
}
this.dialogVisible = true
},
async getTwItem(){
async getTwItem() {
try {
this.loading = true
const res = await listTwItem(this.queryParams)
@ -247,29 +262,35 @@ export default {
itemDiscount: 1,
}
})]
}finally {
} finally {
this.loading = false
}
},
handleQuery(){
handleQuery() {
this.getTwItem()
},
resetQuery(){
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
async changeIsShow(row){
async changeIsShow(row) {
try {
this.loading = true
await updateIsShow({id: row.id, isShow: row.isShow})
await this.getTwItem()
}finally {
} finally {
this.loading = false
}
},
//
async handleAudit(flag){
async handleAudit(flag) {
try {
const isNull = this.validateNull();
if (!isNull) return;
const names = this.validateZero()
if (names){
await this.$modal.confirm("确认配件:" + names + "的销售价格为0吗")
}
this.formData['status'] = flag ? "02" : '05'
//
this.formData.wares = [...this.items.map(item => {
@ -292,7 +313,7 @@ export default {
this.dialogVisible = false
this.$modal.msgSuccess("审核成功")
this.$emit('success')
}catch {
} catch {
}
@ -342,7 +363,7 @@ export default {
},
/** 保存数据 */
save(row) {
if (row.itemDiscount <= 0 || row.itemDiscount > 10){
if (row.itemDiscount <= 0 || row.itemDiscount > 10) {
row.itemDiscount = 10
this.$modal.msgError("折扣只能是1-10")
}
@ -353,6 +374,35 @@ export default {
})
this.clickCellMap[id] = []
},
validateNull(){
const flag = this.items.map(item => {
const price = item.wares.price
if (price === null || price === ""){
this.$modal.msgError("配件:" + item.waresName + "销售价格为空")
return false
}else {
return true
}
})
let count = 0
flag.forEach(item => {
if (!item){
count++
}
})
return count === 0
},
validateZero(){
const flag = this.items.map(item => {
const price = parseFloat(item.wares.price)
if (price === 0){
return item.waresName
}else {
return ""
}
})
return flag.filter(item => item !== "").join(",")
}
}
}
</script>
@ -361,6 +411,7 @@ export default {
.box-card {
margin-bottom: 10px;
}
.item {
.item__input {
display: none;

View File

@ -58,6 +58,48 @@
</template>
{{ parseTime(info.createTime, '{y}-{m}-{d}') }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
已行里程
</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>
<el-descriptions-item>
<template slot="label">
预计完工

View File

@ -393,10 +393,10 @@ export default {
mileageTraveled: null,
threePackUnits: null,
insuranceName: null,
managerMoney: null,
rescueMoney: null,
threePackMoney: null,
confirmFaultMoney: null,
managerMoney: 0,
rescueMoney: 0,
threePackMoney: 0,
confirmFaultMoney: 0,
},
selectUser: {},
selectCar: {},
@ -535,10 +535,10 @@ export default {
mileageTraveled: null,
threePackUnits: null,
insuranceName: null,
managerMoney: null,
rescueMoney: null,
threePackMoney: null,
confirmFaultMoney: null,
managerMoney: 0,
rescueMoney: 0,
threePackMoney: 0,
confirmFaultMoney: 0,
}
this.selectUser = {}
this.selectCar = {}

View File

@ -234,11 +234,63 @@
<el-button @click="addDialog = false"> </el-button>
</div>
</el-dialog>
<el-dialog title="信息修改" :visible.sync="infoDialog" width="60%" v-dialogDrag append-to-body ref="infoDialog">
<el-form :model="infoFormData" :inline="true" ref="infoForm" label-width="10rem">
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="已行里程" prop="mileageTraveled">
<el-input v-model="infoFormData.mileageTraveled" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="三包单位" prop="threePackUnits">
<el-input v-model="infoFormData.threePackUnits" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="保险名称" prop="insuranceName">
<el-input v-model="infoFormData.insuranceName" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="管理费" prop="managerMoney">
<el-input v-model="infoFormData.managerMoney" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="救援费" prop="rescueMoney">
<el-input v-model="infoFormData.rescueMoney" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="三包费" prop="threePackMoney">
<el-input v-model="infoFormData.threePackMoney" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="定损费" prop="confirmFaultMoney">
<el-input v-model="infoFormData.confirmFaultMoney" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleUpdate"> </el-button>
<el-button @click="infoDialog = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {getTicketsById, updateShow, addItems} from "@/api/repair/tickets/Tickets";
import {getTicketsById, updateShow, addItems, updateTicket} from "@/api/repair/tickets/Tickets";
import {removeItemById} from "@/api/repair/tickets/TicketsItem";
import TicketItemShow from "@/views/repair/tickets/Components/TicketItemShow.vue";
import other from "@/views/repair/other/index.vue";
@ -270,6 +322,17 @@ export default {
projectList: [],
waresList: [],
otherList: [],
infoDialog: false,
infoFormData: {
id: null,
mileageTraveled: null,
threePackUnits: null,
insuranceName: null,
managerMoney: 0,
rescueMoney: 0,
threePackMoney: 0,
confirmFaultMoney: 0,
},
}
},
methods: {
@ -395,7 +458,28 @@ export default {
this.dialogVisible = false
},
handleEditInfo(){
// todo
this.infoFormData = {
id: this.info.id,
mileageTraveled: this.info.mileageTraveled,
threePackUnits: this.info.threePackUnits,
insuranceName: this.info.insuranceName,
managerMoney: this.info.managerMoney | 0,
rescueMoney: this.info.rescueMoney | 0,
threePackMoney: this.info.threePackMoney | 0,
confirmFaultMoney: this.info.confirmFaultMoney | 0,
}
this.infoDialog = true
},
async handleUpdate(){
try{
this.loadingInstance.$loading({
target: this.$refs.infoDialog.$el
})
await updateTicket(this.infoFormData)
this.infoDialog = false
this.$modal.msgSuccess("修改成功")
await this.open(this.infoFormData.id)
}catch{}
}
}
}

View File

@ -308,7 +308,10 @@ export default {
formRules: {
'userInfo.cusName':[{required: true, message: "客户名称不能为空", trigger: 'blur'}],
'userInfo.phoneNumber': [{required: true, message: "联系方式不能为空", trigger: 'blur'}],
'carInfo.licenseNumber': [{required: true, message: "车牌号不能为空", trigger: 'blur'}]
'carInfo.licenseNumber': [{required: true, message: "车牌号不能为空", trigger: 'blur'}],
'carInfo.brandAndModel': [{required: true, message: "品牌型号不能为空", trigger: 'blur'}],
'carInfo.carCategory': [{required: true, message: '车辆类别不能为空', trigger: 'blur'}],
'carInfo.carNature': [{required: true, message: '车辆性质不能为空', trigger: 'blur'}]
},
formLoading: false,
//
@ -369,9 +372,11 @@ export default {
await updateCustomerAndCar(this.formData)
this.$modal.msgSuccess(this.formData?.userInfo?.id ? "修改成功" : "新增成功")
this.$emit("success", this.formData)
}finally {
this.formLoading = false
this.dialogVisible = false
}catch {}
finally {
this.formLoading = false
}
},
reset(){