shish 2 лет назад
Родитель
Сommit
c2029cef59

+ 22 - 49
ghsApp/src/admin/home/components/OrderItem.vue

@@ -2,21 +2,19 @@
     <view  @click="pageTo({url:'/pagesOrder/detail',query: {id: item.id}})">
         <view class="order-top_box" style="position:relative;">
 
-        <text v-if="item.fhStatus == 1" style="position:absolute;top:110upx;right:27upx;color:#4d5f2e;">已发货</text>
-
-        <image style="width:105upx;position:absolute;top:80upx;right:12upx;" v-if="item.status == 1"
+        <image style="width:105upx;position:absolute;top:80upx;right:12upx;" v-if="currentStatus == 1"
         @click.stop="pageTo({url:'/admin/billing/toPay',query: {orderId:item.id,orderSn:item.orderSn,actPrice:item.actPrice}})"
          mode="widthFix" :src="`${constant.imgUrl}/icon/codePay8.png`"></image>
 
         <image style="width: 38upx;height:38upx;border-radius:38upx;" mode="aspectFit" :src="item.customAvatarUrl"></image>
           <view class="tit"> {{ item.customName || "" }}</view>
-
           <view class="other-refund" v-if="item.refund==2">有退款</view>
           <view class="other-status" v-if="item.debt == 1">赊账</view>
           <text class="other-book" v-if="item.book == 1" >预订单</text>
           <text class="other-presell" v-if="item.presell == 1" >预售单</text>
-          <view :class="['status',item.status == '4' ? 'buleColor' : item.status == '1' ? 'defColor' : '']">{{ statusFormat(item.status) }}</view>
-
+          <view :class="['status',currentStatus == '4' ? 'buleColor' :currentStatus == '3' ? 'buleColor' : currentStatus == '1' ? 'defColor' : '']">
+            {{currentStatus==1?'待付款':currentStatus==2?'待发货':currentStatus==3?'已发货':currentStatus==4?'已完成':'已取消'}}
+          </view>
         </view>
         <view class="order-list_info">
         <view class="order-info_box">
@@ -66,17 +64,20 @@
         </view>
         <div class="list-bottom">
             <div class="list-button">
-
-<block v-if="canFh">
-<view><button @click.stop="directFh(item)" class="admin-button-com bule">一键发货</button> </view>
-<view><button @click.stop="fillNoFh(item)" class="admin-button-com bule">填单发货</button> </view>
-</block>
-<block v-else>
-<view><button disabled="true" class="admin-button-com bule active">一键发货</button> </view>
-<view><button disabled="true" class="admin-button-com bule active">填单发货</button> </view>
-</block>
-                <view v-if="item.status == 1 || item.status == 5"><button disabled="true" class="admin-button-com bule active">打印(${item.printNum})</button> </view>
-                <view v-else><button @click.stop="printOrder(item)" class="admin-button-com bule">打印<text v-if="Number(item.printNum)>0">({{item.printNum}})</text></button> </view>
+                <block v-if="currentStatus == 2">
+                <view><button @click.stop="directFh(item)" class="admin-button-com bule">一键发货</button> </view>
+                <view><button @click.stop="fillNoFh(item)" class="admin-button-com bule">填单发货</button> </view>
+                </block>
+                <block v-else>
+                <view><button disabled="true" class="admin-button-com bule active">一键发货</button> </view>
+                <view><button disabled="true" class="admin-button-com bule active">填单发货</button> </view>
+                </block>
+                <view v-if="currentStatus == 1">
+                  <button disabled="true" class="admin-button-com bule active">打印(${item.printNum})</button>
+                </view>
+                <view v-else>
+                  <button @click.stop="printOrder(item)" class="admin-button-com bule">打印<text v-if="Number(item.printNum)>0">({{item.printNum}})</text></button>
+                </view>
             </div>
         </div>
     </view>
@@ -97,16 +98,12 @@ export default {
 	},
 	data() {
 		return {
-      canFh:true
+      currentStatus:1
 		};
 	},
 	mounted(){
-		if(this.item){
-      if(this.item.status != 1 && this.item.status != 5 && this.item.fhStatus == 0){
-        this.canFh = true
-      }else{
-        this.canFh = false
-      }
+		if(this.item.status){
+      this.currentStatus = this.item.status
 		}
 	},
 	methods: {
@@ -125,31 +122,7 @@ export default {
       }else{
         that.$emit('printOrder', item)
       }
-		},
-    statusFormat(status) {
-        switch (status) {
-            case "1":
-            return "待付款";
-            break;
-            case "2":
-            return "待发货";
-            break;
-            case "3":
-            return "已发货";
-            break;
-            case "4":
-            return "已完成";
-            break;
-            case "5":
-            return "已取消";
-            break;
-            case "6":
-            return "已退款";
-            break;
-            default:
-            return "";
-        }
-    }
+		}
 	}
 };
 </script>

+ 2 - 2
ghsApp/src/admin/home/order.vue

@@ -180,7 +180,7 @@ export default {
       that.$util.confirmModal({content:'确认发货?'},() => {
           orderFh({id:info.id,fhType:0}).then(res=>{
             if(res.code == 1){
-              that.$refs[`orderRef${info.id}`][0].canFh = false
+              that.$refs[`orderRef${info.id}`][0].currentStatus = 3
               that.$msg('发货成功')
             }
           })
@@ -216,7 +216,7 @@ export default {
       that.$util.confirmModal({content:'确认发货?'},() => {
           orderFh({id:id,fhType:1,fhWl:that.fhWl,fhWlNo:that.fhWlNo}).then(res=>{
             if(res.code == 1){
-              that.$refs[`orderRef${id}`][0].canFh = false
+              that.$refs[`orderRef${id}`][0].currentStatus = 3
               that.fhLabelShow = false
               that.fhWlFocus = false
               that.fhWlNo = ''

+ 8 - 17
ghsApp/src/pagesOrder/detail.vue

@@ -20,23 +20,6 @@
 				</view>
 			</view>
 
-			<view class="flex-space title" v-if="detailInfo.fhStatus == 1">
-				发货信息
-			</view>
-			<view class="bills-info_box content-box" v-if="detailInfo.fhStatus == 1">
-				<view class="order-info_box">
-					<view>发货状态:</view>
-					<view style="color:green;font-weight:bold;font-size:30upx;">本单已发货</view>
-				</view>
-				<view class="order-info_box" v-if="detailInfo.fhType == 1">
-					<view>物流单号:</view>
-					<view>{{ detailInfo.fhWl }} {{detailInfo.fhWlNo}}</view>
-					<view class="price">
-						<button @click="copyWl(detailInfo.fhWlNo)" class="admin-button-com default">复制单号</button>
-					</view>
-				</view>
-			</view>
-
 			<view class="flex-space title">
 				单据信息
 				<view class="flex" style="color: #3385ff;font-weight: 400">
@@ -143,6 +126,14 @@
 					<view>订单状态:</view>
 					<view>{{ detailInfo.status==1?'待付款':detailInfo.status==2?'待发货':detailInfo.status==3?'已发货':detailInfo.status==4?'已完成':detailInfo.status==5?'已取消':'已退款' }}</view>
 				</view>
+				<view class="order-info_box" v-if="detailInfo.fhType == 1">
+					<view>物流单号:</view>
+					<view>{{ detailInfo.fhWl }} {{detailInfo.fhWlNo}}</view>
+					<view class="price">
+						<button @click="copyWl(detailInfo.fhWlNo)" class="admin-button-com default">复制单号</button>
+					</view>
+				</view>
+
 				<view v-if="detailInfo.status==1" class="order-info_box">
 					<view>过期时间:</view>
 					<view>{{detailInfo.deadline?detailInfo.deadline.substr(5,11):''}}</view>