This commit is contained in:
Vinjor 2024-11-12 19:14:21 +08:00
parent 1c6a9c60b8
commit 1f1c515f4f
5 changed files with 87 additions and 21 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>
@ -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: {
@ -385,8 +385,21 @@ export default {
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');
@ -408,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)
})
},
/** /**
* 监听输入框 * 监听输入框
*/ */
@ -426,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")
}, },
/** /**
@ -489,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({
@ -890,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
// //
@ -1281,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;