diff --git a/components/orderCard.vue b/components/orderCard.vue
index 9667edb..8517283 100644
--- a/components/orderCard.vue
+++ b/components/orderCard.vue
@@ -71,7 +71,7 @@
作废
- 添加项目
+ 修改项目
diff --git a/pages-home/home/home.vue b/pages-home/home/home.vue
index 1886d41..695a4c8 100644
--- a/pages-home/home/home.vue
+++ b/pages-home/home/home.vue
@@ -111,6 +111,11 @@
+
+
+
+
-
- 单据类型
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/pages-order/choosePeople/choosePeople.vue b/pages-order/choosePeople/choosePeople.vue
index cc74230..9c92769 100644
--- a/pages-order/choosePeople/choosePeople.vue
+++ b/pages-order/choosePeople/choosePeople.vue
@@ -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(() => {
diff --git a/pages-order/orderDetail/orderDetail.vue b/pages-order/orderDetail/orderDetail.vue
index f64147b..19371da 100644
--- a/pages-order/orderDetail/orderDetail.vue
+++ b/pages-order/orderDetail/orderDetail.vue
@@ -28,7 +28,7 @@
@@ -119,8 +119,8 @@
维修项目
-
-
+
+
{{ item.itemName }}
¥{{ item.itemMoney }}
@@ -146,7 +146,7 @@
- 销售人员
+ 服务顾问
{{item.saleName || ""}}
@@ -156,7 +156,7 @@
-
+
@@ -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;