1
This commit is contained in:
parent
1c6a9c60b8
commit
1f1c515f4f
@ -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">
|
||||
<!-- 在什么都不能操作的情况下,可以查看详情-->
|
||||
|
@ -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`
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 添加项目回调
|
||||
*/
|
||||
|
@ -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>
|
||||
|
@ -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(() => {
|
||||
|
@ -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>
|
||||
@ -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: {
|
||||
@ -385,8 +385,21 @@ export default {
|
||||
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');
|
||||
@ -408,6 +421,16 @@ export default {
|
||||
this.waresByTicket()
|
||||
},
|
||||
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
|
||||
}
|
||||
})
|
||||
// setJSONData("projects",this.ticketInfo.projects)
|
||||
console.log(item,"item")
|
||||
},
|
||||
/**
|
||||
@ -489,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({
|
||||
@ -890,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
|
||||
//判断当前角色及工单状态显示操作按钮
|
||||
@ -1281,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;
|
||||
|
Loading…
Reference in New Issue
Block a user