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>
<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 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>
<view @click="gotoDetail" class="btn pg"> <view @click="gotoDetail" class="btn pg">
<!-- 在什么都不能操作的情况下可以查看详情--> <!-- 在什么都不能操作的情况下可以查看详情-->

View File

@ -111,6 +111,11 @@
<uni-popup-dialog type="success" cancelText="线下告知" confirmText="去签字" title="系统提示" content="客户是否在场进行签字确认?" @confirm="dialogConfirm" <uni-popup-dialog type="success" cancelText="线下告知" confirmText="去签字" title="系统提示" content="客户是否在场进行签字确认?" @confirm="dialogConfirm"
@close="dialogClose"></uni-popup-dialog> @close="dialogClose"></uni-popup-dialog>
</uni-popup> </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 ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="线下告知" value="" <uni-popup-dialog ref="inputClose" mode="input" title="线下告知" value=""
@ -393,12 +398,27 @@ export default {
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
}, },
/** /**
* 添加项目 * 卡片的 修改项目 按钮点击
*/ */
addProj(order){ addProj(order){
this.ticketId = order.id this.ticketId = order.id
this.$refs.addProjDialog.open()
},
/**
* 新增项目
*/
addProjDialogConfirm(){
this.$refs.proj.open() 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>
</view> </view>
<view class="card" style="padding-bottom: 20rpx"> <!-- <view class="card" style="padding-bottom: 20rpx">-->
<view class="carTitle">单据类型</view> <!-- <view class="carTitle">单据类型</view>-->
<radio-group @change="handleChange" style="padding: 0 20rpx"> <!-- <radio-group @change="handleChange" style="padding: 0 20rpx">-->
<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>-->
</view> <!-- </view>-->
<view :class="{ 'none': !carList || carList.length === 0 }" class="card cardInfo carCard"> <view :class="{ 'none': !carList || carList.length === 0 }" class="card cardInfo carCard">
<template v-if="!carList || carList.length === 0"> <template v-if="!carList || carList.length === 0">
<image class="cardNoneIcon" mode="widthFix" src="/pages-order/static/carNoneIcon.png"></image> <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') { }else if (this.type == 'xs') {
if (this.checkedUserId == '' && this.checkedUserName == '') { if (this.checkedUserId == '' && this.checkedUserName == '') {
uni.showToast({ uni.showToast({
title: '请选择销售人员', title: '请选择服务顾问',
icon: 'none' icon: 'none'
}) })
} else { } else {
@ -302,7 +302,7 @@ export default {
data: param data: param
}).then((res) => { }).then((res) => {
uni.showToast({ uni.showToast({
title: '选择销售人员成功!', title: '选择服务顾问成功!',
icon: 'none' icon: 'none'
}) })
setTimeout(() => { setTimeout(() => {

View File

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

View File

@ -4,10 +4,27 @@
<view :class="[direction==='column'?'uni-steps__column-text-container':'uni-steps__row-text-container']"> <view :class="[direction==='column'?'uni-steps__column-text-container':'uni-steps__row-text-container']">
<view v-for="(item,index) in options" :key="index" <view v-for="(item,index) in options" :key="index"
:class="[direction==='column'?'uni-steps__column-text':'uni-steps__row-text']"> :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> :class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.title}}</text>
<text v-if="item.desc" :style="{color: deactiveColor}" <text v-if="item.desc" :style="{color: deactiveColor}"
:class="[direction==='column'?'uni-steps__column-desc':'uni-steps__row-desc']">{{item.desc}}</text> :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> </view>
<view :class="[direction==='column'?'uni-steps__column-container':'uni-steps__row-container']"> <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']" :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}"> :style="{backgroundColor:index<=active&&index!==0?activeColor:index===0?'transparent':deactiveColor}">
</view> </view>
<view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']" <!-- <view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']"-->
v-if="index === active"> <!-- v-if="index === active">-->
<uni-icons :color="activeColor" :type="activeIcon" size="20" /> <!-- <uni-icons :color="activeColor" :type="activeIcon" size="20" />-->
</view> <!-- </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']" <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 <view
:class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--after':'uni-steps__row-line--after']" :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}" /> :style="{backgroundColor:index<active&&index!==options.length-1?activeColor:index===options.length-1?'transparent':deactiveColor}" />
@ -44,7 +67,7 @@
* @property {String} activeColor 选中状态的颜色 * @property {String} activeColor 选中状态的颜色
* @property {Array} options 数据源格式为[{title:'xxx',desc:'xxx'},{title:'xxx',desc:'xxx'}] * @property {Array} options 数据源格式为[{title:'xxx',desc:'xxx'},{title:'xxx',desc:'xxx'}]
*/ */
import config from '@/config'
export default { export default {
name: 'UniSteps', name: 'UniSteps',
props: { props: {
@ -53,6 +76,11 @@
type: String, type: String,
default: 'row' default: 'row'
}, },
canOpenCus: {
//
type: Boolean,
default: false
},
activeColor: { activeColor: {
// //
type: String, type: String,
@ -63,10 +91,20 @@
type: String, type: String,
default: '#B7BDC6' default: '#B7BDC6'
}, },
doingColor: {
//
type: String,
default: '#E8A321'
},
active: { active: {
// //
type: Number, type: Number,
default: 0 default: -1
},
doingActive: {
//
type: Number,
default: -1
}, },
activeIcon: { activeIcon: {
// //
@ -83,6 +121,7 @@
data() { data() {
return { return {
heightArr: [], heightArr: [],
imgUrlPrex:config.baseImageUrl,
} }
}, },
mounted() { mounted() {
@ -95,6 +134,14 @@
}).exec() }).exec()
} }
}, },
methods:{
prviewImage(itemList,index){
this.$emit("prviewImage",itemList,index)
},
sendCusImgManage(itemList){
this.$emit("sendCusImgManage",itemList)
},
}
} }
</script> </script>
@ -164,15 +211,15 @@
} }
.uni-steps__row-title { .uni-steps__row-title {
font-size: 14px; font-size: 28rpx;
line-height: 16px; line-height: 32rpx;
text-align: center; text-align: center;
} }
.uni-steps__column-title { .uni-steps__column-title {
font-size: 18px; font-size: 28rpx;
text-align: left; text-align: left;
line-height: 24px; line-height: 32rpx;
} }
.uni-steps__row-desc { .uni-steps__row-desc {
@ -182,9 +229,9 @@
} }
.uni-steps__column-desc { .uni-steps__column-desc {
font-size: 16px; font-size: 25rpx;
text-align: left; text-align: left;
line-height: 20px; line-height: 32rpx;
} }
.uni-steps__row-container { .uni-steps__row-container {
@ -253,16 +300,17 @@
} }
.uni-steps__row-circle { .uni-steps__row-circle {
width: 15px; width: 20px;
height: 15px; height: 20px;
border-radius: 50%; border-radius: 50%;
background-color: #B7BDC6; background-color: #B7BDC6;
margin: 0px 3px; margin: 0px 3px;
} }
.uni-steps__column-circle { .uni-steps__column-circle {
width: 15px; width: 20px;
height: 15px; height: 20px;
text-align: center;
border-radius: 50%; border-radius: 50%;
background-color: #B7BDC6; background-color: #B7BDC6;
margin: 4px 0px 5px 0px; margin: 4px 0px 5px 0px;
@ -277,4 +325,31 @@
line-height: 14px; line-height: 14px;
margin: 2px 0px; 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> </style>