shish 5 лет назад
Родитель
Сommit
0b5cbd983b
2 измененных файлов с 26 добавлено и 7 удалено
  1. 21 4
      ghsApp/src/admin/home/order.vue
  2. 5 3
      ghsApp/src/pagesOrder/detail.vue

+ 21 - 4
ghsApp/src/admin/home/order.vue

@@ -372,20 +372,37 @@ export default {
 
 		},
 		toConfrim(params,title){
+      let that = this
 			uni.showModal({
-				title: '完成订单提示',
+				title: '订单完成',
 				content: title,
 				success: function (res) {
 					if (res.confirm) {
-						self.toConfirmRequest(params)
+						that.toConfirmRequest(params)
 					}
 				}
 			});
 		},
 		toConfirmRequest(params){
+      let that = this
 			confirmFinish(params).then((res) => {
-				uni.showToast({title:res.msg,icon:'none'})
-				this.init();
+
+        uni.showToast({title:res.msg,icon:'none'})
+        if(res.code == 1){
+          //订单变成完成
+          that.list.data.forEach((item, index,array) => {
+            if(item.id == params.id){
+              array[index].status = '4'
+              array[index].buttonList.forEach((it,ind,arr)=>{
+                if(it.type == 'confirm'){
+                  arr[ind].disable = 1
+                }
+              })
+            }
+          });
+        }
+        
+
 			})
 		},
     selectSussess(val) {

+ 5 - 3
ghsApp/src/pagesOrder/detail.vue

@@ -396,20 +396,22 @@ export default {
 			}
 		},
 		toConfrim(params,title){
+			let that = this
 			uni.showModal({
-				title: '完成订单提示',
+				title: '订单完成',
 				content: title,
 				success: function (res) {
 					if (res.confirm) {
-						self.toConfirmRequest(params)
+						that.toConfirmRequest(params)
 					}
 				}
 			});
 		},
 		toConfirmRequest(params){
+			let self = this;
 			confirmFinish(params).then((res) => {
 				uni.showToast({title:res.msg,icon:'none'})
-				this.init();
+				self.init();
 			})
 		},
 		copy(val) {