This commit is contained in:
PQZ 2024-11-13 09:49:20 +08:00
commit 6ece1abf94
6 changed files with 196 additions and 49 deletions

View File

@ -71,7 +71,7 @@
作废
</view>
<view v-if="(order.ticketsStatus == '04' || order.ticketsStatus == '05')&& (userInfo.roleCodes.includes('weixiu') || userInfo.roleCodes.includes('service_advisor') || userInfo.roleCodes.includes('general_inspection'))" @click="addProj(order)" class="btn pg">
添加项目
修改项目
</view>
<view @click="gotoDetail" class="btn pg">
<!-- 在什么都不能操作的情况下可以查看详情-->

View File

@ -111,6 +111,11 @@
<uni-popup-dialog type="success" cancelText="线下告知" confirmText="去签字" title="系统提示" content="客户是否在场进行签字确认?" @confirm="dialogConfirm"
@close="dialogClose"></uni-popup-dialog>
</uni-popup>
<!-- 提示窗示例 -->
<uni-popup ref="addProjDialog" type="dialog">
<uni-popup-dialog type="success" cancelText="修改已有项目" confirmText="新增项目" title="系统提示" content="是否需要新增项目?" @confirm="addProjDialogConfirm"
@close="cancelDialogClose"></uni-popup-dialog>
</uni-popup>
<!-- 输入框示例 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="线下告知" value=""
@ -393,12 +398,27 @@ export default {
this.$refs.inputDialog.open()
},
/**
* 添加项目
* 卡片的 修改项目 按钮点击
*/
addProj(order){
this.ticketId = order.id
this.$refs.addProjDialog.open()
},
/**
* 新增项目
*/
addProjDialogConfirm(){
this.$refs.proj.open()
},
/**
* 修改已有项目
*/
cancelDialogClose(){
this.$refs.addProjDialog.close()
uni.navigateTo({
url: `/pages-order/orderDetail/orderDetail?id=${this.ticketId}&isDetail=0`
});
},
/**
* 添加项目回调
*/

View File

@ -18,15 +18,15 @@
</view>
</view>
</view>
<view class="card" style="padding-bottom: 20rpx">
<view class="carTitle">单据类型</view>
<radio-group @change="handleChange" style="padding: 0 20rpx">
<label v-for="(option, index) in options" :key="index" class="radio-label">
<radio :value="option.value" :checked="option.value === ticketType"/>
<text>{{ option.label }}</text>
</label>
</radio-group>
</view>
<!-- <view class="card" style="padding-bottom: 20rpx">-->
<!-- <view class="carTitle">单据类型</view>-->
<!-- <radio-group @change="handleChange" style="padding: 0 20rpx">-->
<!-- <label v-for="(option, index) in options" :key="index" class="radio-label">-->
<!-- <radio :value="option.value" :checked="option.value === ticketType"/>-->
<!-- <text>{{ option.label }}</text>-->
<!-- </label>-->
<!-- </radio-group>-->
<!-- </view>-->
<view :class="{ 'none': !carList || carList.length === 0 }" class="card cardInfo carCard">
<template v-if="!carList || carList.length === 0">
<image class="cardNoneIcon" mode="widthFix" src="/pages-order/static/carNoneIcon.png"></image>

View File

@ -285,7 +285,7 @@ export default {
}else if (this.type == 'xs') {
if (this.checkedUserId == '' && this.checkedUserName == '') {
uni.showToast({
title: '请选择销售人员',
title: '请选择服务顾问',
icon: 'none'
})
} else {
@ -302,7 +302,7 @@ export default {
data: param
}).then((res) => {
uni.showToast({
title: '选择销售人员成功!',
title: '选择服务顾问成功!',
icon: 'none'
})
setTimeout(() => {

View File

@ -28,7 +28,7 @@
<image v-show="ticketInfo.carInfo.logoImg" :src="imgUrlPrex + ticketInfo.carInfo.logoImg" class="carImage" mode="aspectFill"></image>
<view class="carHeaderRight">
<text class="carNumber">{{ ticketInfo.carNo }}</text>
<text class="carType">{{ ticketInfo.carBrandName }}</text>
<text class="carType">{{ ticketInfo.carBrandName+" " }} <text v-if="ticketInfo.carInfo && ticketInfo.carInfo.carModel"> - {{ticketInfo.carInfo.carModel}}</text></text>
</view>
</view>
<view class="carBody">
@ -119,8 +119,8 @@
<view class="projTitle">维修项目</view>
<view class="projList">
<template>
<view v-for="item in ticketInfo.projects" :key="item.id" class="projEditItem">
<view v-for="(item,index) in ticketInfo.projects" :key="item.id" class="projEditItem">
<view class="del-proj-box" @click="delProj(item.id,index)"><uni-icons type="trash" size="25" style="color: #0174F6"></uni-icons></view>
<view class="projEditLine1">
<text>{{ item.itemName }}</text>
<text v-if="canSeeMoney" class="projAmount">{{ item.itemMoney }}</text>
@ -146,7 +146,7 @@
<template>
<view class="editPeople">
<view class="editForm">
<text class="label">销售人员</text>
<text class="label">服务顾问</text>
<text >{{item.saleName || ""}}
</text>
</view>
@ -156,7 +156,7 @@
</template>
<template v-if="isDetail == '0'">
<image @click="editPeople('xs', item)"src="/pages-order/static/addIcon.png" style="width: 28rpx;height: 28rpx"></image>
<!-- <text class="addText" @click="editPeople('xs', item)">添加销售人员</text>-->
<!-- <text class="addText" @click="editPeople('xs', item)">添加服务顾问</text>-->
</template>
</view>
<view class="line"></view>
@ -206,12 +206,12 @@
<view v-if="isDetail == '1'" class="card cardInfo projCard">
<view class="projTitle">维修进度记录表</view>
<view class="projList">
<!-- <view class="tushi-box">-->
<!-- <view class="tushi-item">- 待维修 </view>-->
<!-- <view class="tushi-item" style="color: #E8A321"> 维修中 </view>-->
<!-- <view class="tushi-item" style="color: #17DBB1;"> 已完成</view>-->
<!-- </view>-->
<uni-steps :options="list2" active-color="#007AFF" :active="active" direction="column" />
<view class="tushi-box">
<view class="tushi-item" style="color: #B7BDC6">待维修 </view>
<view class="tushi-item" style="color: #E8A321">维修中 </view>
<view class="tushi-item" style="color: #2979FF;">已完成</view>
</view>
<uni-steps :canOpenCus="canOpenCus" :options="list2" active-color="#007AFF" :active="active" :doingActive="doingActive" direction="column" @prviewImage="prviewImage" @sendCusImgManage="sendCusImgManage"/>
<!-- <uni-table ref="table" :loading="false" border stripe emptyText="暂无数据">-->
<!-- <uni-tr>-->
<!-- <uni-th width="50" align="center">序号</uni-th>-->
@ -321,7 +321,7 @@ import {bus} from "@/utils/eventBus";
import request from '@/utils/request';
import upload from '@/utils/upload'
import {getOrderStatusText,formatDate,formatTimestamp,getDictTextByCodeAndValue,saveTicketsRecords} from "@/utils/utils";
import {getUserInfo,setJSONData,setStorageWithExpiry,getStorageWithExpiry} from '@/utils/auth'
import {getUserInfo,setJSONData,getJSONData,setStorageWithExpiry,getStorageWithExpiry} from '@/utils/auth'
import config from '@/config'
export default {
components: {
@ -375,16 +375,31 @@ export default {
//
ifCallCus:false,
//
tableData:[],
active: 1,
// tableData:[],
active: -1,
doingActive: -1,
//
list2: [],
//
callServiceInfo:{
name:"",
tel:""
},
//id
delProjId:[],
};
},
watch: {
// demo
ticketInfo: {
handler(newVal, oldVal) {
console.log(newVal, "有变化");
setJSONData("projects",newVal.projects)
},
//
deep: true
}
},
onLoad(data) {
this.loginUser = getUserInfo()
this.canSeeMoney = !this.loginUser.roleCodes.includes('repair_staff');
@ -406,6 +421,16 @@ export default {
this.waresByTicket()
},
methods: {
/**
* 删除项目
*/
delProj(id,index){
this.delProjId.push(id)
//
this.$nextTick(()=>{
this.ticketInfo.projects.splice(index,1)
})
},
/**
* 监听输入框
*/
@ -424,6 +449,7 @@ export default {
item.itemMoney = item.itemPrice*item.itemCount*item.itemDiscount
}
})
// setJSONData("projects",this.ticketInfo.projects)
console.log(item,"item")
},
/**
@ -487,7 +513,7 @@ export default {
request({
url: '/admin-api/repair/titem/updateRepairItem',
method: 'PUT',
data:this.ticketInfo.projects
data:{"itemList":this.ticketInfo.projects,"delProjIdList":this.delProjId,"ticketId":this.ticketId}
}).then((res) => {
if(res.code==200){
uni.showToast({
@ -832,9 +858,12 @@ export default {
let thisObj = res.data[i]
thisObj.title = thisObj.itemName
if(thisObj.itemStatus=='03'){
//,
//,
endIndex = i
thisObj.desc = formatTimestamp(thisObj.updateTime)
}else if(thisObj.itemStatus=='02'){
//
this.doingActive = i
}
this.list2.push(thisObj)
}
@ -885,6 +914,23 @@ export default {
item.createTime = formatTimestamp(item.createTime)
})
}
//
let projects = getJSONData("projects")
let projectMap = new Map();
if(projects){
//key value
projects.map((item)=>{
projectMap.set(item.id,item)
})
resultObj.projects = resultObj.projects.map((item)=>{
if(projectMap.has(item.id)){
console.log(projectMap.get(item.id))
return projectMap.get(item.id)
}else{
return item
}
})
}
this.$nextTick(()=>{
this.ticketInfo = resultObj
//
@ -1193,6 +1239,7 @@ export default {
gap: 20rpx;
.tushi-box{
font-size: 16px;
display: flex;
align-items: center;
justify-content: center;
@ -1275,7 +1322,12 @@ export default {
padding: 0 20rpx;
background: #F2F2F7;
border-radius: 4rpx 4rpx 4rpx 4rpx;
position: relative;
.del-proj-box{
position: absolute;
top: -10px;
right: -10px;
}
.projEditLine1 {
display: flex;
align-items: center;

View File

@ -4,10 +4,27 @@
<view :class="[direction==='column'?'uni-steps__column-text-container':'uni-steps__row-text-container']">
<view v-for="(item,index) in options" :key="index"
:class="[direction==='column'?'uni-steps__column-text':'uni-steps__row-text']">
<text :style="{color:index === active?activeColor:deactiveColor}"
<text v-if="doingActive==index" :style="{color:doingColor}"
:class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.title}}</text>
<text v-else :style="{color:index <= active?activeColor:deactiveColor}"
:class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.title}}</text>
<text v-if="item.desc" :style="{color: deactiveColor}"
:class="[direction==='column'?'uni-steps__column-desc':'uni-steps__row-desc']">{{item.desc}}</text>
<template >
<view class="projImg" v-if="item.recordsItemList.length>0">
<image v-for="(img, imgIndex) in item.recordsItemList" @click="prviewImage(item.recordsItemList,imgIndex)" :key="imgIndex" :src="imgUrlPrex + img.image"
class="projImgItem"></image>
</view>
<view class="projSend" v-if="item.recordsItemList.length>0 && canOpenCus">
<template >
<uni-icons v-if="doingActive==index" type="cloud-upload" size="18" :style="{color:doingColor}"></uni-icons>
<uni-icons v-else type="cloud-upload" size="18" :style="{color:index <= active?activeColor:deactiveColor}"></uni-icons>
<!-- <image mode="aspectFit" src="@/static/icons/send.png" class="projIcon" :style="{color:index <= active?activeColor:deactiveColor}"></image>-->
<text v-if="doingActive==index" :style="{color: doingColor}" @click="sendCusImgManage(item.recordsItemList)">发送给客户</text>
<text v-else :style="{color:index <= active?activeColor:deactiveColor}" @click="sendCusImgManage(item.recordsItemList)">发送给客户</text>
</template>
</view>
</template>
</view>
</view>
<view :class="[direction==='column'?'uni-steps__column-container':'uni-steps__row-container']">
@ -17,12 +34,18 @@
:class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--before':'uni-steps__row-line--before']"
:style="{backgroundColor:index<=active&&index!==0?activeColor:index===0?'transparent':deactiveColor}">
</view>
<view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']"
v-if="index === active">
<uni-icons :color="activeColor" :type="activeIcon" size="20" />
<!-- <view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']"-->
<!-- v-if="index === active">-->
<!-- <uni-icons :color="activeColor" :type="activeIcon" size="20" />-->
<!-- </view>-->
<view v-if="doingActive==index" :class="[direction==='column'?'uni-steps__column-circle':'uni-steps__row-circle']"
:style="{backgroundColor:doingColor}" >
<text style="font-size: 16px;color: white">{{index+1}}</text>
</view>
<view v-else :class="[direction==='column'?'uni-steps__column-circle':'uni-steps__row-circle']"
:style="{backgroundColor:index<active?activeColor:deactiveColor}" />
:style="{backgroundColor:index<=active?activeColor:deactiveColor}" >
<text style="font-size: 16px;color: white">{{index+1}}</text>
</view>
<view
:class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--after':'uni-steps__row-line--after']"
:style="{backgroundColor:index<active&&index!==options.length-1?activeColor:index===options.length-1?'transparent':deactiveColor}" />
@ -44,7 +67,7 @@
* @property {String} activeColor 选中状态的颜色
* @property {Array} options 数据源格式为[{title:'xxx',desc:'xxx'},{title:'xxx',desc:'xxx'}]
*/
import config from '@/config'
export default {
name: 'UniSteps',
props: {
@ -53,6 +76,11 @@
type: String,
default: 'row'
},
canOpenCus: {
//
type: Boolean,
default: false
},
activeColor: {
//
type: String,
@ -63,10 +91,20 @@
type: String,
default: '#B7BDC6'
},
doingColor: {
//
type: String,
default: '#E8A321'
},
active: {
//
//
type: Number,
default: 0
default: -1
},
doingActive: {
//
type: Number,
default: -1
},
activeIcon: {
//
@ -83,6 +121,7 @@
data() {
return {
heightArr: [],
imgUrlPrex:config.baseImageUrl,
}
},
mounted() {
@ -95,6 +134,14 @@
}).exec()
}
},
methods:{
prviewImage(itemList,index){
this.$emit("prviewImage",itemList,index)
},
sendCusImgManage(itemList){
this.$emit("sendCusImgManage",itemList)
},
}
}
</script>
@ -164,15 +211,15 @@
}
.uni-steps__row-title {
font-size: 14px;
line-height: 16px;
font-size: 28rpx;
line-height: 32rpx;
text-align: center;
}
.uni-steps__column-title {
font-size: 18px;
font-size: 28rpx;
text-align: left;
line-height: 24px;
line-height: 32rpx;
}
.uni-steps__row-desc {
@ -182,9 +229,9 @@
}
.uni-steps__column-desc {
font-size: 16px;
font-size: 25rpx;
text-align: left;
line-height: 20px;
line-height: 32rpx;
}
.uni-steps__row-container {
@ -253,16 +300,17 @@
}
.uni-steps__row-circle {
width: 15px;
height: 15px;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: #B7BDC6;
margin: 0px 3px;
}
.uni-steps__column-circle {
width: 15px;
height: 15px;
width: 20px;
height: 20px;
text-align: center;
border-radius: 50%;
background-color: #B7BDC6;
margin: 4px 0px 5px 0px;
@ -277,4 +325,31 @@
line-height: 14px;
margin: 2px 0px;
}
.projImg {
width: 100%;
display: grid;
grid-template-columns: repeat(auto-fill, 120rpx);
justify-content: space-between;
gap: 20rpx;
padding: 20rpx 0;
.projImgItem {
width: 120rpx;
height: 120rpx;
background-color: #efefef;
}
}
.projSend {
display: flex;
align-items: center;
font-weight: 500;
font-size: 28rpx;
column-gap: 8rpx;
}
.projIcon{
width: 28rpx;
height: 28rpx;
}
</style>