Просмотр исходного кода

订单确定送达,订单配送进度

jf 5 лет назад
Родитель
Сommit
28271d4627

+ 6 - 0
ghsApp/src/api/order/index.js

@@ -82,6 +82,12 @@ export const hasPay = data => {
 export const sendExpressage = data => {
 	return https.get("/order/third-send", data);
 };
+/** *
+	* 确认送达 --姜枫 2021.03.21
+	*/
+export const sendReach = data => {
+	return https.get("/order/reach", data);
+};
 
 /** *
  * 未支付订单重选花材

+ 1 - 0
ghsApp/src/components/app-address-group.vue

@@ -130,6 +130,7 @@ export default {
 		},
 		// 省市联动
 		openAddres() {
+			return;
 			this.$refs.simpleAddress.open();
 		},
 		changeAreaFn(e) {

+ 1 - 1
ghsApp/src/components/app-send-time.vue

@@ -15,7 +15,7 @@
 <!--		</tui-list-cell>-->
 		<tui-list-cell class="line-cell" :hover="false" :arrow="true">
 			<div class="tui-title">{{ timeLabel }}</div>
-			<picker
+			<picker style="width: 100%"
 				mode="multiSelector"
 				:range="timeList"
 				:value="timeValue"

+ 49 - 58
ghsApp/src/pagesOrder/components/stepShip.vue

@@ -1,42 +1,26 @@
 <template>
     <view class="step-content_box">
-        <view 
-            v-if="!$util.isEmpty(orderComData)"
-            class="step-view_box">
-            <view 
-                v-for="(item,index) in orderComData"
-                :key="index"
-                class="step-li_box">
+        <view v-if="!$util.isEmpty(orderComData)" class="step-view_box">
+            <view v-for="(item,index) in orderComData" :key="index" class="step-li_box">
                 <view class="step-head_box">
-                    <view 
-                        v-if="index == 0"
-                        class="step-icon_num">
+                    <view v-if="index == 0" class="step-icon_num">
                        <view class="dot"></view>
                    </view>
-                    <view 
-                         v-else
-                        class="step-icon-def">
+                    <view v-else class="step-icon-def">
                         <view class="dot"></view>
                     </view>
                    <view v-if="stepList.length - 1  !== index " class="step-line"></view>
                 </view>
                 <view class="step-main_box">
-                    <view class="step-tit">
-                        {{item.actionName}}
-                    </view>
+                    <view class="step-tit">{{item.actionName}}</view>
                     <view class="step-content_box">
                         <!-- 送达 -->
                         <template v-if="item.actionSign === 'reach'">
                             <view class="reach-content_box">
-                                <button 
-                                    @click="affirmSend(item)"
-                                    v-if="item.status == 0"
-                                    class="admin-button-com blue big">
+                                <button @click="affirmSend(item)" v-if="item.status == 0" class="admin-button-com blue big">
                                     确认送达
                                 </button>
-                                <view 
-                                v-else
-                                class="reach-time_box">
+                                <view v-else class="reach-time_box">
                                     {{item.finishTime}}
                                 </view>
                             </view>
@@ -44,41 +28,32 @@
                         <!-- 发货 -->
                         <template v-else-if="item.actionSign === 'deliver'">
                             <!-- 没有选择发货方式0 -->
-                            <view 
-                                v-if="item.option == 0&&item.status == 0"
-                                class="deliver-opiton_0">
-                                <button 
-                                    @click="selfSend"
-                                    class="admin-button-com blue big">
+                            <view v-if="item.option == 0&&item.status == 0" class="deliver-opiton_0">
+                                <button @click="selfSend" class="admin-button-com blue big">
                                     本店送
                                 </button>
-                                <button 
-                                    @click="sendParcel"
-                                    class="admin-button-com blue big">
+                                <button @click="sendParcel" class="admin-button-com blue big">
                                     发快递
-                                </button>  
+                                </button>
                             </view>
-                            <view 
-                                v-else-if="item.option == 2"
-                                class="deliver-opiton_1">
+																												<view v-else-if="item.option == 1" class="deliver-opiton_1">
+																													<view class="shipments-status_box">
+																														<view class="reach-time_box">{{item.finishTime}}</view>
+																														<view>本店送</view>
+																														<button v-if="item.status!=1" @click="sendConfirm('本店送')" class="admin-button-com blue big">确定送达</button>
+																													</view>
+																												</view>
+                            <view v-else-if="item.option == 2" class="deliver-opiton_1">
                                 <view class="shipments-status_box">
+                                    <view>配送方: {{item.sendInfo.expressName}}</view>
+                                    <view>距离: {{item.sendInfo.distance}}km</view>
+                                    <view>运费: {{item.sendInfo.cost}}</view>
+                                    <view>小费: {{item.sendInfo.tip}}</view>
+																																				<!--1待接单 2已接单 3已完成 4已取消-->
                                     <view>
-                                        配送方: {{sendInfo.sendSide}}
-                                    </view>
-                                    <view>
-                                        距离: {{sendInfo.distance}}
-                                    </view>
-                                    <view>
-                                        消费: {{sendInfo.distance}}
-                                    </view>
-                                    <view>
-                                        小费: {{sendInfo.tip}}
-                                    </view>
-                                    <view
-                                        :class="[sendInfo.status=='待接单'?'colorRed':'colorBlue']"
-                                        >
-                                        状态: {{sendInfo.status}}
+                                        状态: <text :class="[item.sendInfo.status==1||item.sendInfo.status==4?'colorRed':'colorBlue']">{{item.sendInfo.status==1?'待接单':item.sendInfo.status==2?'已接单':item.sendInfo.status==3?'已完成':'已取消'}}	</text>
                                     </view>
+																																				<button v-if="item.status!=1" @click="sendConfirm('发快递')" class="admin-button-com blue big">确定送达</button>
                                 </view>
                             </view>
                             <!-- template -->
@@ -96,7 +71,7 @@
     </view>
 </template>
 
-<script> 
+<script>
     export default {
         name:'stepShip',
         comments:{
@@ -109,10 +84,23 @@
         },
         data(){
             return {
-                
+
             }
         },
         methods:{
+												// type 本店送-发快递
+												// 确认送达
+												sendConfirm(type){
+													let self = this;
+													uni.showModal({
+														title: '提示',content: type=='本店送'?'确认送到了?':'快递送到后会自动确认,需要自己确定?',
+														success: function (res) {
+															if (res.confirm) {
+																self.$emit('sendConfirm',type)
+															}
+														}
+													});
+												},
             // 发快递
             sendParcel(){
                 this.$emit('sendParcel')
@@ -161,7 +149,7 @@
                         top: 50%;
                         transform: translate(-50%,-50%);
                     }
-                    
+
                 }
                 & > .step-icon_num {
                     width: 40px;
@@ -192,7 +180,7 @@
                     top: 50%;
                     transform: translate(-50%, -50%);
                     z-index: 45;
-                    
+
                 }
             }
             & > .step-main_box {
@@ -236,10 +224,13 @@
                             font-size: 24px;
                             font-weight: 400;
                             line-height: 50px;
-                            &.colorRed {
+																												&.reach-time_box{
+																													font-weight: 600;
+																												}
+                            .colorRed {
                                 color: #F51608;
                             }
-                            & .colorBlue{
+                            .colorBlue{
                                 color: #049E2C;
                             }
                         }
@@ -255,4 +246,4 @@
             }
         }
     }
-</style>
+</style>

+ 28 - 79
ghsApp/src/pagesOrder/ship.vue

@@ -25,6 +25,7 @@
 		</view>
 		<view class="step-content_box">
 			<stepShip
+				@sendConfirm="sendConfirm"
 				@affirmSend="affirmSend"
 				@selfSend="selfSend"
 				@sendParcel="sendParcel"
@@ -32,75 +33,6 @@
 			</stepShip>
 		</view>
 		<!-- 快递送 -->
-        <modal-module
-			:show="shipModal"
-			:maskClosable="false"
-			@cancel="modalCancel"
-			@click="shipModalClick"
-			title="发快递"
-			padding="30rpx 30rpx"
-        >
-        <template v-slot:content>
-		  <view class="order-fa_box">
-			  <view class="order-fa_info">
-				  <view class="order-fa_top">
-					  <view>
-						  收
-					  </view>
-					  <view class="">
-						  {{orderInfo.receiveProvince + orderInfo.receiveCity}}
-					  </view>
-				  </view>
-				  <view>
-					  {{orderInfo.receiveAddress}}
-				  </view>
-				  <view>
-					  {{orderInfo.customName}}({{orderInfo.customMobile}})
-				  </view>
-			  </view>
-		  </view>
-          <view class="app-modal-input-wrap ship-modal">
-			<view class="inp-list-line">
-                <view class="line-label">配送方</view>
-                <view class="line-input">
-                <picker
-                    mode="selector"
-                    :range="deliveryList"
-                    @change="changeDeliveryFn"
-                    range-key="text"
-                    class="inp-select"
-                >
-                    <view v-if="form.sendSide">{{ sendSideText }}</view>
-                    <view class="tui-placeholder" v-else>请选择</view>
-                </picker>
-                </view>
-            </view>
-            <view class="inp-list-line">
-                <view class="line-label">送花时间</view>
-                <view class="line-input">
-					<picker
-						mode="multiSelector"
-						:range="timeList"
-						:value="timeValue"
-						@change="changeTimeFn"
-						class="inp-select"
-					>
-						<view v-if="form.sendTime">{{ form.sendTime }}</view>
-						<view class="tui-placeholder" v-else>默认10分钟后配送</view>
-					</picker>
-                </view>
-            </view>
-			<view class="inp-list-line">
-                <view class="line-label">运费</view>
-                <view class="line-input">
-					<view class="">
-						{{form.sendCost}}
-					</view>
-                </view>
-            </view>
-        	</view>
-        </template>
-        </modal-module>
 		<modal-module
 			:show="showSubmitModel"
 			@cancel="modalCancel"
@@ -116,13 +48,7 @@
 
 <script>
 import stepShip from './components/stepShip'
-import { getDetB,
- orderSendDet,
- freight,
- thirdSend,
- selfSend,
- reachOrder
- } from '@/api/order'
+import { getDetB, orderSendDet, freight, thirdSend, selfSend, reachOrder,sendReach } from '@/api/order'
 import ModalModule from "@/components/plugin/modal";
 export default {
 	name: 'admin-ship',
@@ -210,6 +136,12 @@ export default {
 			this._orderComDet()
 			this.freightCount()
 		},
+		sendConfirm(type){
+			console.log(type)
+			return sendReach({ id: this.option.id }).then(res => {
+				this.init();
+			})
+		},
 		_getDet() {
 			// this.option.id
 			return getDetB({ id: this.option.id }).then(res => {
@@ -257,9 +189,26 @@ export default {
 			this.showSubmitModel = false
 		}, // 自己送
 		selfSend(val){
-			this.currentTitType = val
-			this.titText = val.text;
-			this.showSubmitModel = true
+			let self = this;
+			uni.showModal({
+				title: '提示',
+				content: '确定自己送货?',
+				success: function (res) {
+					if (res.confirm) {
+						selfSend({
+							id:self.option.id
+						}).then(res=>{
+							self.modalCancel()
+							self.$msg('发货状态已更新')
+							self.init()
+						})
+					}
+				}
+			});
+			// // return;
+			// this.currentTitType = val
+			// this.titText = val.text;
+			// this.showSubmitModel = true
 		}, // 确认
 		affirmSend(val){
 			this.currentTitType = val

+ 21 - 8
ghsApp/src/pagesOrder/shipInfo.vue

@@ -8,15 +8,11 @@
 					<appFormSend :form.sync="form" :customId="customId" :orderid="orderid"> </appFormSend>
 				</view>
 			</form>
-		</view>
-		<view class="under-bar">
-			<view class="price-view">
-<!--				<text class="price-title">收款</text>-->
-<!--				<text class="price-number">-->
-<!--					¥ <text class="large">{{ allPrice }}</text>-->
-<!--				</text>-->
+			<view class="admin-button-com-box">
+				<navigator open-type="navigateBack" delta="1" class="admin-button-com blue middle active" >取消</navigator>
+				<button class="admin-button-com blue middle" @tap="formSubmit">确定</button>
 			</view>
-			<button class="admin-button-com blue middle" @click="formSubmit">发货</button>
+
 		</view>
 		<!-- 选择客户 -->
 		<AppCustomerSel :show.sync="showCustomer" @change="changeCustomerFn" />
@@ -310,6 +306,21 @@ export default {
 			// 	text-align: right;
 			// }
 		}
+
+		.admin-button-com-box{
+			display: flex;
+			justify-content: space-between;
+			.admin-button-com{
+				width: 30%;
+				display: block;
+				margin: 0 auto;
+				&.active{
+					background: #c4c4c5;
+					border: 1px solid #c4c4c5;
+				}
+			}
+		}
+
 	}
 	.under-bar {
 		display: flex;
@@ -338,6 +349,8 @@ export default {
 		}
 		.admin-button-com {
 			width: 200px;
+			display: block;
+			margin: 0 auto;
 		}
 	}
 }