shish 4 سال پیش
والد
کامیت
843f10769a
3فایلهای تغییر یافته به همراه18 افزوده شده و 31 حذف شده
  1. 0 18
      hdPad/src/pages/home/components/workInfo.vue
  2. 10 10
      hdPad/src/pages/home/modify.vue
  3. 8 3
      hdPad/src/pages/home/work.vue

+ 0 - 18
hdPad/src/pages/home/components/workInfo.vue

@@ -137,24 +137,6 @@ export default {
       workItemId:0
     }
   },
-  props: {
-    selectOrderId: {
-      type: Number,
-      default: 0
-    }
-  },
-  computed:{
-  },
-  watch:{
-      selectOrderId:{
-          handler(newId){
-            if(Number(newId)>0){
-              this.getOrderDetail(newId)
-            }
-          },
-          immediate:true
-      }
-  },
   methods:{
     confirmGetPrint(){
       // #ifdef APP-PLUS

+ 10 - 10
hdPad/src/pages/home/modify.vue

@@ -12,26 +12,21 @@
             </view>
             <!-- 按钮操作 -->
             <view class="open-box">
-
 				<view class="button-area">
-					<view class="active" @click="clearItemFn">清空</view>
 					<view class="active" @click="cancel">取消</view>
 					<view class="active" @click="confirmModify">确认</view>
+					<view class="active" @click="clearItemFn">清空</view>
 				</view>
-
             </view>
-
 			<!-- 清空 -->
 			<uni-popup ref="clearItemRef" type="dialog">
 				<uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认清空?" @confirm="confirmClearItem"></uni-popup-dialog>
 			</uni-popup>
-
-
         </view>
     </view>
 </template>
 <script>
-import { mapGetters } from "vuex";
+import { mapGetters } from "vuex"
 import rightItem from './components/rightItem.vue'
 import leftArea from './components/leftArea.vue'
 import productMins from "@/mixins/product"
@@ -77,13 +72,18 @@ export default {
 			const product = this.selectList.map(e => { 
 				return { productId: e.id, unitType:e.unitType,num:e.currentNum}
 			})
-			uni.showLoading({mask:true})
 			modifyItem({product:JSON.stringify(product),id:this.option.id}).then(res=>{
-				uni.hideLoading()
 				if(res.code == 1){
 					this.$msg('修改成功')
+
+					//返回上一页带参数
+					let pages = getCurrentPages();
+					let prevPage = pages[ pages.length - 2 ];
+					//修改上一页data里面的modifyInfo
+					prevPage.$vm.modifyInfo = {hasModify:1}
+
 					setTimeout(function(){
-						uni.navigateBack({delta: 1})
+						uni.navigateBack()
 					},1500)
 				}
 			})

+ 8 - 3
hdPad/src/pages/home/work.vue

@@ -9,7 +9,7 @@
                 <workList @getOrder="getOrder"></workList>
             </view>
             <view class="work-order-info">
-                <workInfo :selectOrderId.sync="selectOrderId"></workInfo>
+                <workInfo ref="workInfoRef"></workInfo>
             </view>
         </view>
     </view>
@@ -27,17 +27,22 @@ export default {
 	mixins: [productMins],
 	data() {
 		return {
-			selectOrderId:0
+			selectOrderId:0,
+			modifyInfo:{hasModify:0}
 		}
 	},
 	computed: {
 		...mapGetters(["getLoginInfo"])
 	},
-	onLoad() {
+	onShow() {
+		if(this.modifyInfo.hasModify && this.modifyInfo.hasModify == 1){
+			this.$refs.workInfoRef.getOrderDetail(this.selectOrderId)
+		}
 	},
 	methods: {
 		getOrder(item){
 			this.selectOrderId = Number(item.id)
+			this.$refs.workInfoRef.getOrderDetail(this.selectOrderId)
 		}
 	}
 };