维修app创建工单时的bug修复
This commit is contained in:
parent
1d401a0581
commit
f9fcc0f7ec
270
components/bookingOrderCard.vue
Normal file
270
components/bookingOrderCard.vue
Normal file
@ -0,0 +1,270 @@
|
|||||||
|
<template>
|
||||||
|
<view class="orderCard">
|
||||||
|
<!-- <view class="order-top">-->
|
||||||
|
<!--<!– <view class="orderNo">–>-->
|
||||||
|
<!--<!– 工单编号:{{ order.orderNo }}–>-->
|
||||||
|
<!--<!– </view>–>-->
|
||||||
|
<!-- <view :style="{ color: getFlagColor(order.flag) }" class="flag">-->
|
||||||
|
<!-- {{ order.flagStr }}-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<view class="order-body">
|
||||||
|
<view class="carNum">
|
||||||
|
{{ order.carNo }}
|
||||||
|
</view>
|
||||||
|
<view class="carModel">
|
||||||
|
{{ order.carModel }}
|
||||||
|
</view>
|
||||||
|
<!-- <view class="project">-->
|
||||||
|
<!-- <view class="project-left">-->
|
||||||
|
<!-- <view class="title">-->
|
||||||
|
<!-- <image class="titleIcon" mode="aspectFit" src="/static/icons/order-icon1.png"></image>-->
|
||||||
|
<!-- 维修项目-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- <view class="desc">-->
|
||||||
|
<!-- {{ projectName }}-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- <view v-if="order.ticketsStatus == '05'" class="project-right">-->
|
||||||
|
<!-- <image class="rightIcon" mode="aspectFit" src="/static/icons/success.png"></image>-->
|
||||||
|
<!-- <text class="rightText">已派工</text>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<view class="baseInfo">
|
||||||
|
<view>
|
||||||
|
客户信息:{{ order.userName }} {{ order.userPhone }}
|
||||||
|
</view>
|
||||||
|
<view v-if="order.appointDate">
|
||||||
|
预约时间:{{ order.appointDate }}
|
||||||
|
</view>
|
||||||
|
<view v-if="order.counselorName">
|
||||||
|
服务顾问:{{ order.counselorName }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="footer">-->
|
||||||
|
<!-- <view @click="projectDis" v-if="order.ticketsStatus == '04' && roleCanPg" class="btn pg">-->
|
||||||
|
<!-- 项目派工-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- <view @click="projectDis" v-if="order.ticketsStatus == '05' && roleCanPg" class="btn pg">-->
|
||||||
|
<!-- 重新派工-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- <view @click="receiveOrder(order.id)" v-if="order.ticketsStatus == '05' && order.ticketsWorkStatus=='01' && roleCanJd" class="btn qc">-->
|
||||||
|
<!-- 接单-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!--<!– <view @click="doOrder(order.id)" v-if="order.ticketsStatus == '05' && order.ticketsWorkStatus=='04' && roleCanSg" class="btn qc">–>-->
|
||||||
|
<!--<!– 开始施工–>-->
|
||||||
|
<!--<!– </view>–>-->
|
||||||
|
<!-- <view v-if="order.ticketsStatus == '06' && roleCanQc" class="btn qc">-->
|
||||||
|
<!-- 告知取车-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- <view @click="gotoDetail" class="btn pg">-->
|
||||||
|
<!--<!– 在什么都不能操作的情况下,可以查看详情–>-->
|
||||||
|
<!-- 查看详情-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getUserInfo,
|
||||||
|
getStrData
|
||||||
|
} from '@/utils/auth';
|
||||||
|
import request from '@/utils/request';
|
||||||
|
export default {
|
||||||
|
name: "bookingOrderCard",
|
||||||
|
props: {
|
||||||
|
order: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
projectName() {
|
||||||
|
if (this.order && this.order.projectList && this.order.projectList.length > 0) {
|
||||||
|
return this.order.projectList.map(m => m.name).join(',')
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
//当前角色是否可以派工
|
||||||
|
roleCanPg:false,
|
||||||
|
//当前角色是否可以告知取车
|
||||||
|
roleCanQc:false,
|
||||||
|
//当前角色是否可以接单
|
||||||
|
roleCanJd:false,
|
||||||
|
//当前用户是否可以进行施工、施工过程、结束施工操作---
|
||||||
|
roleCanSg:false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
let userInfo = getUserInfo()
|
||||||
|
if(userInfo.roleCodes.includes("service_advisor") || userInfo.roleCodes.includes("general_inspection") || (userInfo.roleCodes.includes("repair_staff") && getStrData("ifLeader"))){
|
||||||
|
//服务顾问、总检、维修班组长可以派工
|
||||||
|
this.roleCanPg = true
|
||||||
|
}
|
||||||
|
if(userInfo.roleCodes.includes("service_advisor")){
|
||||||
|
//服务顾问可以告知取车
|
||||||
|
this.roleCanQc = true
|
||||||
|
}
|
||||||
|
if(userInfo.roleCodes.includes("repair_staff") && this.order.nowRepairId==userInfo.id){
|
||||||
|
//维修工角色,并且指派处理的人就是当前用户可以接单
|
||||||
|
this.roleCanJd = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(){
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getFlagColor(flag) {
|
||||||
|
if (flag == 1) {
|
||||||
|
return '#E8A321'
|
||||||
|
} else if (flag === 2) {
|
||||||
|
return '#999'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.orderCard {
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||||
|
border-left: 4rpx solid #FFB323;
|
||||||
|
padding: 5rpx 30rpx;
|
||||||
|
margin: 15rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-top {
|
||||||
|
padding: 20rpx 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-bottom: 1px solid #F3F5F7;
|
||||||
|
|
||||||
|
.orderNo {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #858BA0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flag {
|
||||||
|
font-family: PingFang SC, PingFang SC;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-body {
|
||||||
|
.carNum {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.carModel {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #858BA0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project {
|
||||||
|
padding: 20rpx 10rpx;
|
||||||
|
background: #F2F2F7;
|
||||||
|
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.project-left {
|
||||||
|
flex: 1;
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-right {
|
||||||
|
padding: 0 16rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
border-left: 1rpx solid #DDDDDD;
|
||||||
|
|
||||||
|
.rightIcon {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rightText {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #17DBB1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #0174F6;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
column-gap: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titleIcon {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333333;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.baseInfo {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #858BA0;
|
||||||
|
|
||||||
|
& > view {
|
||||||
|
margin: 30rpx 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
column-gap: 10rpx;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: 172rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
||||||
|
border: 2rpx solid #0174F6;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #0174F6;
|
||||||
|
|
||||||
|
&.qc {
|
||||||
|
background: #0174F6;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -20,9 +20,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-if="typeList && typeList.length > 0" class="projPicker" style="display: flex">
|
<view v-if="typeList && typeList.length > 0" class="projPicker" style="display: flex">
|
||||||
<view class="type">
|
<view class="type">
|
||||||
<view v-for="item in typeList" :key="item.typeId" :class="{'active': typeId === item.typeId}" class="typeItem"
|
<view v-for="item in typeList" :key="item.id" :class="{'active': typeId === item.id}" class="typeItem"
|
||||||
@click="chooseType(item)">
|
@click="chooseType(item)">
|
||||||
{{ item.typeName }}
|
{{ item.name }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
@ -39,6 +39,9 @@
|
|||||||
<image v-if="selectedProj && selectedProj.find(f => f.id === item.id)" class="projChooseIcon"
|
<image v-if="selectedProj && selectedProj.find(f => f.id === item.id)" class="projChooseIcon"
|
||||||
mode="aspectFit" src="/static/icons/duihao.png"></image>
|
mode="aspectFit" src="/static/icons/duihao.png"></image>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="projItem" @click="addProject()">
|
||||||
|
<text class="projName">新增维修项目</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -68,6 +71,10 @@ export default {
|
|||||||
console.log("执行onload")
|
console.log("执行onload")
|
||||||
this.$refs.popup.open()
|
this.$refs.popup.open()
|
||||||
this.getProjeectList()
|
this.getProjeectList()
|
||||||
|
if (this.typeList && this.typeList.length > 0) {
|
||||||
|
this.typeId = this.typeList[0].id
|
||||||
|
this.getProject()
|
||||||
|
}
|
||||||
// this.selectedProj = JSON.parse(JSON.stringify(selectedProj))
|
// this.selectedProj = JSON.parse(JSON.stringify(selectedProj))
|
||||||
},
|
},
|
||||||
removeProj(index) {
|
removeProj(index) {
|
||||||
@ -82,46 +89,44 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
chooseType(type) {
|
chooseType(type) {
|
||||||
this.groupList = type.groupList
|
this.typeId = type.id
|
||||||
this.typeId = type.typeId
|
this.getProject()
|
||||||
|
console.log("this.groupList",this.groupList)
|
||||||
|
// this.typeId = type.typeId
|
||||||
|
},
|
||||||
|
addProject() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/project/project?typeId=${this.typeId}`
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getProjeectList() {
|
getProjeectList() {
|
||||||
const categoryList = []
|
|
||||||
console.log("执行")
|
|
||||||
const params = {
|
const params = {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10000,
|
pageSize: 10000,
|
||||||
type: '03'
|
type: '03'
|
||||||
}
|
}
|
||||||
request({
|
request({
|
||||||
url: '/admin-api/repair/project/getRepairProjectAndCateGory',
|
// url: '/admin-api/repair/project/getRepairProjectAndCateGory',
|
||||||
|
url: '/admin-api/conf/baseType/list',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: params
|
params: params
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log("分类",res);
|
console.log("分类",res);
|
||||||
this.typeList = res.data
|
this.typeList = res.data
|
||||||
// categoryList.push(...res.data)
|
|
||||||
// console.log("categoryList",categoryList)
|
|
||||||
//
|
|
||||||
// categoryList.forEach(item => {
|
|
||||||
// let a = {
|
|
||||||
// name: item.name,
|
|
||||||
// id: item.id,
|
|
||||||
// groupList: [
|
|
||||||
//
|
|
||||||
// ]
|
|
||||||
// }
|
|
||||||
// this.typeList.push(a)
|
|
||||||
// })
|
|
||||||
// console.log("typeList",this.typeList)
|
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
getProject() {
|
||||||
request({
|
request({
|
||||||
url: '/admin-api/repair/project/page',
|
url: '/admin-api/repair/project/page',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: params
|
params: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10000,
|
||||||
|
type: this.typeId
|
||||||
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log("项目",res);
|
console.log("项目",res);
|
||||||
this.projectList = res.data.records
|
this.groupList = res.data.records
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<radio-group @change="handleChange">
|
<radio-group @change="handleChange">
|
||||||
<label v-for="(option, index) in options" :key="index" class="radio-label">
|
<label v-for="(option, index) in options" :key="index" class="radio-label">
|
||||||
<radio :value="option.value" :checked="option.value === ticketType" />
|
<radio :value="option.value" :checked="option.value === ticketType"/>
|
||||||
<text>{{ option.label }}</text>
|
<text>{{ option.label }}</text>
|
||||||
</label>
|
</label>
|
||||||
</radio-group>
|
</radio-group>
|
||||||
@ -37,16 +37,21 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view class="carTitle">车辆信息</view>
|
<view class="carTitle">车辆信息</view>
|
||||||
|
<scroll-view scroll-x="true">
|
||||||
<view class="carListTab">
|
<view class="carListTab">
|
||||||
<view v-for="(item, index) in carList" :key="index" :class="{'active': activeCarIndex === index}"
|
<view v-for="(item, index) in carList" :key="index" :class="{'active': activeCarIndex === index}"
|
||||||
class="carTabItem" @click="() => activeCarIndex = index">
|
class="carTabItem" @click="() => activeCarIndex = index">
|
||||||
<image :src="item.carLicenseImg" class="carImage" mode="aspectFit"></image>
|
<image :src="imgUrlPrex + item.logoImg" class="carImage" mode="aspectFit"></image>
|
||||||
<text>{{ item.licenseNumber }}</text>
|
<text>{{ item.licenseNumber }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="carTabItemNew" @click="editCarInfo()">
|
||||||
|
<text>+</text>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
<view class="carDetail">
|
<view class="carDetail">
|
||||||
<view class="carHeader">
|
<view class="carHeader">
|
||||||
<image :src="carList[activeCarIndex].carLicenseImg" class="carImage" mode="aspectFill"></image>
|
<image :src="imgUrlPrex + carList[activeCarIndex].logoImg" class="carImage" mode="aspectFill"></image>
|
||||||
<view class="carHeaderRight">
|
<view class="carHeaderRight">
|
||||||
<text class="carNumber">{{ carList[activeCarIndex].licenseNumber }}</text>
|
<text class="carNumber">{{ carList[activeCarIndex].licenseNumber }}</text>
|
||||||
<text class="carType">{{
|
<text class="carType">{{
|
||||||
@ -69,11 +74,11 @@
|
|||||||
<view style="display: flex;align-items: center">
|
<view style="display: flex;align-items: center">
|
||||||
<view class="infoItem" style="flex: 1">
|
<view class="infoItem" style="flex: 1">
|
||||||
<view class="label">年检时间</view>
|
<view class="label">年检时间</view>
|
||||||
<view class="value">{{ carList[activeCarIndex].nextInspectionDate }}</view>
|
<view class="value">{{ carList[activeCarIndex].inspectionDate }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="infoItem" style="flex: 1">
|
<view class="infoItem" style="flex: 1">
|
||||||
<view class="label">保险时间</view>
|
<view class="label">保险时间</view>
|
||||||
<view class="value">{{ carList[activeCarIndex].insuranceExpiryDate }}</view>
|
<view class="value">{{ carList[activeCarIndex].insuranceDate }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="infoItem">
|
<view class="infoItem">
|
||||||
@ -170,7 +175,9 @@ import VNavigationBar from '@/components/VNavigationBar.vue'
|
|||||||
import ProjectPicker from "@/components/projectPicker.vue";
|
import ProjectPicker from "@/components/projectPicker.vue";
|
||||||
import {bus} from "@/utils/eventBus";
|
import {bus} from "@/utils/eventBus";
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
import {getToken,setUserInfo,getUserInfo} from '@/utils/auth.js'
|
import {getToken, setUserInfo, getUserInfo} from '@/utils/auth.js'
|
||||||
|
import config from "@/config";
|
||||||
|
import {formatTimestamp, formatTimestampCustom} from "@/utils/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -184,25 +191,42 @@ export default {
|
|||||||
activeCarIndex: 0,
|
activeCarIndex: 0,
|
||||||
userInfo: null,
|
userInfo: null,
|
||||||
selectedProj: [],
|
selectedProj: [],
|
||||||
typeList:[],
|
typeList: [],
|
||||||
ticketType: '01',
|
ticketType: '01',
|
||||||
options: [
|
options: [
|
||||||
{ label: 'A单', value: '01' },
|
{label: 'A单', value: '01'},
|
||||||
{ label: 'B单', value: '02' }
|
{label: 'B单', value: '02'}
|
||||||
],
|
],
|
||||||
|
imgUrlPrex: config.baseImageUrl,
|
||||||
|
ticketNo: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(data) {
|
onLoad(data) {
|
||||||
|
this.ticketNo = this.createUniqueCodeByHead('GD')
|
||||||
|
if (data.phone) {
|
||||||
|
this.phone = data.phone
|
||||||
|
this.listUserInfo()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
if (this.phone != '') {
|
||||||
|
this.listUserInfo()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
createUniqueCodeByHead(head = '') {
|
||||||
|
const min = 100; // 最小值
|
||||||
|
const max = 999; // 最大值
|
||||||
|
return head.toString() + Date.now().toString() + Math.floor(Math.random() * (max - min + 1)) + min;
|
||||||
|
},
|
||||||
//新增工单
|
//新增工单
|
||||||
submit() {
|
submit() {
|
||||||
console.log('userInfo',this.userInfo)
|
console.log('userInfo', this.userInfo)
|
||||||
console.log(this.carList[this.activeCarIndex])
|
console.log(this.carList[this.activeCarIndex])
|
||||||
console.log('selectedProj',this.selectedProj)
|
console.log('selectedProj', this.selectedProj)
|
||||||
console.log("ticketType",this.ticketType)
|
console.log("ticketType", this.ticketType)
|
||||||
console.log('登陆人信息',getUserInfo())
|
console.log('登陆人信息', getUserInfo())
|
||||||
if (this.userInfo === null || this.carList.length === 0 || this.selectedProj.length === 0){
|
if (this.userInfo === null || this.carList.length === 0 || this.selectedProj.length === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请完善信息',
|
title: '请完善信息',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@ -214,6 +238,7 @@ export default {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
userId: this.userInfo.id,
|
userId: this.userInfo.id,
|
||||||
|
ticketNo: this.ticketNo,
|
||||||
userName: this.userInfo.cusName,
|
userName: this.userInfo.cusName,
|
||||||
userMobile: this.userInfo.phoneNumber,
|
userMobile: this.userInfo.phoneNumber,
|
||||||
carId: this.carList[this.activeCarIndex].id,
|
carId: this.carList[this.activeCarIndex].id,
|
||||||
@ -242,6 +267,7 @@ export default {
|
|||||||
this.carList = []
|
this.carList = []
|
||||||
this.userInfo = null
|
this.userInfo = null
|
||||||
console.log("获取用户信息")
|
console.log("获取用户信息")
|
||||||
|
if (this.phone != '') {
|
||||||
const params = {
|
const params = {
|
||||||
phoneNumber: this.phone
|
phoneNumber: this.phone
|
||||||
}
|
}
|
||||||
@ -256,6 +282,12 @@ export default {
|
|||||||
this.getCarList()
|
this.getCarList()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入手机号',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 子表信息预处理
|
// 子表信息预处理
|
||||||
formatItem(list) {
|
formatItem(list) {
|
||||||
@ -295,6 +327,12 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.carList = res.data.records
|
this.carList = res.data.records
|
||||||
|
//将时间戳转换
|
||||||
|
this.carList.forEach(item => {
|
||||||
|
item.inspectionDate = formatTimestampCustom(item.inspectionDate)
|
||||||
|
item.insuranceDate = formatTimestampCustom(item.insuranceDate)
|
||||||
|
item.carRegisterDate = formatTimestampCustom(item.carRegisterDate)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
editCarInfo(index) {
|
editCarInfo(index) {
|
||||||
@ -482,6 +520,26 @@ export default {
|
|||||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.carTabItemNew {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
row-gap: 10rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333333;
|
||||||
|
border: 2rpx solid #0174F6; /* 默认边框颜色为透明 */
|
||||||
|
justify-content: center; /* 垂直居中 */
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
padding: 10rpx; /* 可以根据需要调整内边距 */
|
||||||
|
width: 128rpx; /* 与 .carImage 宽度一致 */
|
||||||
|
height: 80rpx; /* 与 .carImage 高度一致 */
|
||||||
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||||
|
margin-top: -37rpx;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.carDetail {
|
.carDetail {
|
||||||
@ -617,6 +675,7 @@ export default {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.radio-label {
|
.radio-label {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<view class="searchBox">
|
<view class="searchBox">
|
||||||
<input v-model="phone" placeholder="请输入手机号码" type="tel">
|
<input v-model="phone" placeholder="请输入手机号码" type="tel">
|
||||||
</view>
|
</view>
|
||||||
<view class="btn">
|
<view class="btn" @click="listUserInfo">
|
||||||
<image class="btnIcon" mode="aspectFit" src="/pages-order/static/search.png"></image>
|
<image class="btnIcon" mode="aspectFit" src="/pages-order/static/search.png"></image>
|
||||||
确认查找
|
确认查找
|
||||||
</view>
|
</view>
|
||||||
@ -20,8 +20,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="orderList">
|
<view class="orderList">
|
||||||
<view v-for="item in orderList" :key="item.id" class="orderItem">
|
<view v-for="item in orderList" :key="item.id" class="orderItem" @click="addOrder">
|
||||||
<order-card :order="item"></order-card>
|
<booking-order-card :order="item"></booking-order-card>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -32,49 +32,101 @@
|
|||||||
<script>
|
<script>
|
||||||
import VNavigationBar from '@/components/VNavigationBar.vue'
|
import VNavigationBar from '@/components/VNavigationBar.vue'
|
||||||
import OrderCard from "@/components/orderCard.vue";
|
import OrderCard from "@/components/orderCard.vue";
|
||||||
|
import request from "@/utils/request";
|
||||||
|
import BookingOrderCard from "@/components/bookingOrderCard.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
OrderCard,
|
OrderCard,
|
||||||
|
BookingOrderCard,
|
||||||
VNavigationBar,
|
VNavigationBar,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
phone: '',
|
||||||
|
userInfo: null,
|
||||||
|
carList: [],
|
||||||
orderList: [
|
orderList: [
|
||||||
{
|
// {
|
||||||
orderNo: '1209840149750105501',
|
// orderNo: '1209840149750105501',
|
||||||
flag: 1, flagStr: '待处理', carNum: '川A 184AO1',
|
// flag: 1, flagStr: '待处理', carNum: '川A 184AO1',
|
||||||
carModel: '一汽奥迪 2024款 A6L',
|
// carModel: '一汽奥迪 2024款 A6L',
|
||||||
projectList: [
|
// projectList: [
|
||||||
{ name: '清洗内饰', id: 1 },
|
// {name: '清洗内饰', id: 1},
|
||||||
{ name: '内饰精洗除臭', id: 2 },
|
// {name: '内饰精洗除臭', id: 2},
|
||||||
{ name: '烘干底板胶及脚垫', id: 3 }
|
// {name: '烘干底板胶及脚垫', id: 3}
|
||||||
],
|
// ],
|
||||||
userName: '张三',
|
// userName: '张三',
|
||||||
userPhone: '157****6879',
|
// userPhone: '157****6879',
|
||||||
appointDate: '2024-10-20 12:00',
|
// appointDate: '2024-10-20 12:00',
|
||||||
counselorName: '李相东'
|
// counselorName: '李相东'
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
orderNo: '1209840149750105501',
|
// orderNo: '1209840149750105501',
|
||||||
flag: 1, flagStr: '待处理', carNum: '川A 184AO1',
|
// flag: 1, flagStr: '待处理', carNum: '川A 184AO1',
|
||||||
carModel: '一汽奥迪 2024款 A6L',
|
// carModel: '一汽奥迪 2024款 A6L',
|
||||||
projectList: [
|
// projectList: [
|
||||||
{ name: '清洗内饰', id: 1 },
|
// {name: '清洗内饰', id: 1},
|
||||||
{ name: '内饰精洗除臭', id: 2 },
|
// {name: '内饰精洗除臭', id: 2},
|
||||||
{ name: '烘干底板胶及脚垫', id: 3 }
|
// {name: '烘干底板胶及脚垫', id: 3}
|
||||||
],
|
// ],
|
||||||
userName: '张三',
|
// userName: '张三',
|
||||||
userPhone: '157****6879',
|
// userPhone: '157****6879',
|
||||||
appointDate: '2024-10-20 12:00',
|
// appointDate: '2024-10-20 12:00',
|
||||||
counselorName: '李相东'
|
// counselorName: '李相东'
|
||||||
}
|
// }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(data) {
|
onLoad(data) {
|
||||||
},
|
},
|
||||||
methods: {}
|
methods: {
|
||||||
|
listUserInfo() {
|
||||||
|
this.carList = []
|
||||||
|
this.userInfo = null
|
||||||
|
console.log("获取用户信息")
|
||||||
|
if (this.phone != '') {
|
||||||
|
const params = {
|
||||||
|
phoneNumber: this.phone
|
||||||
|
}
|
||||||
|
request({
|
||||||
|
url: '/admin-api/base/custom/page',
|
||||||
|
method: 'GET',
|
||||||
|
params: params
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data.records.length > 0) {
|
||||||
|
const params = {
|
||||||
|
userId: res.data.records[0].userId
|
||||||
|
}
|
||||||
|
request({
|
||||||
|
url: '/admin-api/repair/booking/list',
|
||||||
|
method: 'GET',
|
||||||
|
params: params
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
this.orderList = res.data
|
||||||
|
this.orderList.map((item) => {
|
||||||
|
item.userPhone = item.userMobile
|
||||||
|
item.appointDate = item.bookingTime
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '请输入手机号',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addOrder(){
|
||||||
|
console.log('执行')
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages-order/addOrder/addOrder?phone=${this.phone}`
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isDetail == '0'" class="foot">
|
<view v-if="isDetail == '0'" class="foot">
|
||||||
<view class="submit">保存工单</view>
|
<view class="submit" @click="submit">保存工单</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 悬浮操作-->
|
<!-- 悬浮操作-->
|
||||||
@ -383,6 +383,11 @@ export default {
|
|||||||
current: index
|
current: index
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
submit (){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages-home/home/home'
|
||||||
|
})
|
||||||
|
},
|
||||||
afterRead(file) {
|
afterRead(file) {
|
||||||
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
||||||
upload({
|
upload({
|
||||||
|
@ -63,6 +63,13 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": ""
|
"navigationBarTitleText": ""
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/project/project",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "新增维修项目",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [
|
||||||
|
@ -177,6 +177,7 @@ export default {
|
|||||||
if (options.car) {
|
if (options.car) {
|
||||||
// 有数据为编辑 或 删除
|
// 有数据为编辑 或 删除
|
||||||
this.car = JSON.parse(decodeURIComponent(options.car));
|
this.car = JSON.parse(decodeURIComponent(options.car));
|
||||||
|
this.brandId = this.car.carBrand
|
||||||
console.log('初始化页面数据', this.car)
|
console.log('初始化页面数据', this.car)
|
||||||
this.bo1 = true;
|
this.bo1 = true;
|
||||||
this.bo2 = false;
|
this.bo2 = false;
|
||||||
@ -199,6 +200,7 @@ export default {
|
|||||||
brandSelect(e) {
|
brandSelect(e) {
|
||||||
console.log('e', e)
|
console.log('e', e)
|
||||||
this.brandId = e.value
|
this.brandId = e.value
|
||||||
|
this.car.brandStr = e.name
|
||||||
// this.getCarModule()
|
// this.getCarModule()
|
||||||
},
|
},
|
||||||
getBrandList() {
|
getBrandList() {
|
||||||
@ -238,8 +240,24 @@ export default {
|
|||||||
this.datePickerShow = true
|
this.datePickerShow = true
|
||||||
},
|
},
|
||||||
datePickerConfirm({value}, field, picker) {
|
datePickerConfirm({value}, field, picker) {
|
||||||
const date = new Date(value)
|
let date;
|
||||||
|
|
||||||
|
// 检查 value 是否为时间戳
|
||||||
|
if (typeof value === 'number') {
|
||||||
|
// 如果是时间戳,确保是毫秒单位
|
||||||
|
date = new Date(value);
|
||||||
|
} else if (typeof value === 'string') {
|
||||||
|
// 如果是日期字符串,尝试解析
|
||||||
|
date = new Date(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查日期是否有效
|
||||||
|
if (isNaN(date.getTime())) {
|
||||||
|
console.error('Invalid date:', value);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.car[this.pickerConfirmField] = date.getFullYear() + '-' + (Number(date.getMonth()) + 1 + '').padStart(2, '0') + '-' + (date.getDate() + '').padStart(2, '0')
|
this.car[this.pickerConfirmField] = date.getFullYear() + '-' + (Number(date.getMonth()) + 1 + '').padStart(2, '0') + '-' + (date.getDate() + '').padStart(2, '0')
|
||||||
|
console.log("this.car[this.pickerConfirmField]",this.car[this.pickerConfirmField])
|
||||||
this.datePickerCancel(picker)
|
this.datePickerCancel(picker)
|
||||||
},
|
},
|
||||||
datePickerCancel(picker) {
|
datePickerCancel(picker) {
|
||||||
@ -264,11 +282,17 @@ export default {
|
|||||||
// bus.$emit('updateCarInfo', this.car)
|
// bus.$emit('updateCarInfo', this.car)
|
||||||
this.car.brandAndModel = [this.brandId, this.car.carModel]
|
this.car.brandAndModel = [this.brandId, this.car.carModel]
|
||||||
console.log("car",this.car)
|
console.log("car",this.car)
|
||||||
|
//将日期转为时间戳
|
||||||
|
this.car.inspectionDate = new Date(this.car.inspectionDate).getTime()
|
||||||
|
this.car.insuranceDate = new Date(this.car.insuranceDate).getTime()
|
||||||
|
this.car.carRegisterDate = new Date(this.car.carRegisterDate).getTime()
|
||||||
if (this.car.id != null) {
|
if (this.car.id != null) {
|
||||||
request({
|
request({
|
||||||
url: '/admin-api/base/carMain/update',
|
url: '/admin-api/base/carMain/update',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
data: this.car,
|
data: this.car,
|
||||||
|
}).then(res => {
|
||||||
|
uni.navigateBack();
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
request({
|
request({
|
||||||
|
89
pages/project/project.vue
Normal file
89
pages/project/project.vue
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<VNavigationBar :title="pageTitle" background-color="#fff" title-color="#333"></VNavigationBar>
|
||||||
|
<view class="body">
|
||||||
|
<u-form labelPosition="top">
|
||||||
|
<view class="card">
|
||||||
|
<u-form-item borderBottom label="名称" labelWidth="200">
|
||||||
|
<u-input v-model="project.vin" border="none" placeholder="请输入名称"></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item borderBottom label="编码" labelWidth="200">
|
||||||
|
<u-input v-model="project.engineNumber" border="none" placeholder="请输入编码"></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item borderBottom label="规格" labelWidth="200">
|
||||||
|
<u-input v-model="project.engineNumber" border="none" placeholder="请输入规格"></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item borderBottom label="工时" labelWidth="200">
|
||||||
|
<u-input v-model="project.engineNumber" border="none" placeholder="请输入规格"></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
</view>
|
||||||
|
</u-form>
|
||||||
|
</view>
|
||||||
|
<view class="footer">
|
||||||
|
<view class="btnItem edit" @click="submit">
|
||||||
|
确定
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import VNavigationBar from "@/components/VNavigationBar.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {VNavigationBar},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pageTitle: '新增维修项目',
|
||||||
|
project:{},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
console.log("options",options)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.container {
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #f3f5f7;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.body {
|
||||||
|
flex: 1;
|
||||||
|
height: 0;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
.card {
|
||||||
|
margin: 20rpx 30rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
background: #ffffff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
padding: 30rpx 0;
|
||||||
|
|
||||||
|
.btnItem {
|
||||||
|
width: 510rpx;
|
||||||
|
height: 76rpx;
|
||||||
|
background: #0174F6;
|
||||||
|
border-radius: 38rpx 38rpx 38rpx 38rpx;
|
||||||
|
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
|
||||||
|
line-height: 76rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -170,6 +170,34 @@ export function formatTimestamp(timestamp) {
|
|||||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将时间戳转换为指定格式的日期字符串
|
||||||
|
* @param {number} timestamp - 时间戳(毫秒)
|
||||||
|
* @param {string} [format='YYYY-MM-DD'] - 日期格式,默认为 'YYYY-MM-DD'
|
||||||
|
* @returns {string} - 格式化的日期字符串
|
||||||
|
*/
|
||||||
|
export function formatTimestampCustom(timestamp, format = 'YYYY-MM-DD') {
|
||||||
|
const date = new Date(timestamp);
|
||||||
|
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||||
|
const day = date.getDate().toString().padStart(2, '0');
|
||||||
|
const hour = date.getHours().toString().padStart(2, '0');
|
||||||
|
const minute = date.getMinutes().toString().padStart(2, '0');
|
||||||
|
const second = date.getSeconds().toString().padStart(2, '0');
|
||||||
|
|
||||||
|
const replaceMap = {
|
||||||
|
'YYYY': year,
|
||||||
|
'MM': month,
|
||||||
|
'DD': day,
|
||||||
|
'HH': hour,
|
||||||
|
'mm': minute,
|
||||||
|
'ss': second
|
||||||
|
};
|
||||||
|
|
||||||
|
return format.replace(/YYYY|MM|DD|HH|mm|ss/g, match => replaceMap[match]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组装订单对象
|
* 组装订单对象
|
||||||
* @param order
|
* @param order
|
||||||
|
Loading…
Reference in New Issue
Block a user