sunChengjie vor 1 Jahr
Ursprung
Commit
b8d8793b03

+ 10 - 0
src/api/index.js

@@ -115,6 +115,7 @@ export function appOutboundInquiry(data, config) {
     })
 }
 
+
 //派件查询-详情
 export function appGetTheDetails(data, config) {
     return request({
@@ -125,6 +126,15 @@ export function appGetTheDetails(data, config) {
     })
 }
 
+//数据图表
+export function appStatistics(data) {
+    return request({
+        url: '/tianzong/express/appStatistics',
+        method: 'post',
+        data: data,
+        emulateJSON: true
+    })
+}
 
 
 

+ 53 - 9
src/pages/components/HomePage.vue

@@ -50,7 +50,7 @@
 </template>
 
 <script>
-import { appFindYourShipment } from '../../api/index'
+import { appFindYourShipment, appStatistics } from '../../api/index'
 import {
 	Toast,
 	Dialog
@@ -61,6 +61,8 @@ export default {
 	data() {
 		return {
 			active: 0,
+			deliveryList: [],//派件
+			collectList: [],//揽收
 			value: "",
 			index: 1,
 			total: 0,
@@ -85,7 +87,37 @@ export default {
 		this.getData()
 
 	},
-	mounted() {
+	async mounted() {
+		// 数据图表
+		const resValue = await appStatistics({ deliveryPeopleId: localStorage.getItem('courierId') })
+		const { dispatchStatistics = [], pickupStatistics = [] } = resValue.data
+		let signSuccessfully = 0; // 签收成功
+		let outOfDelivery = 0; // 派送中
+		let deliveryFailure = 0; // 派送失败
+		dispatchStatistics.forEach(({ expressStatus, number }) => {
+			if (expressStatus == "1") {
+				outOfDelivery = number
+			} else if (expressStatus == "2") {
+				signSuccessfully = number
+			} else if (expressStatus == "4") {
+				deliveryFailure = number
+			}
+
+		})
+		let waiteCollecte = 0 //待揽收
+		let noCollecte = 0 //未揽收
+		let collecteSuccess = 0 //揽收成功
+		pickupStatistics.forEach(({ express_status, number }) => {
+			if (express_status == "1") {
+				waiteCollecte = number
+				noCollecte = number
+			} else if (express_status == "2") {
+				collecteSuccess = number
+			}
+		})
+
+		console.log(resValue, 'resValue')
+
 		// 页面加载完成唤醒微信扫一扫
 		//本地 注释  服务器 放开
 		this.wxScanCode();
@@ -93,6 +125,7 @@ export default {
 			let myChart = this.$echarts.init(document.getElementById('myChart1'))
 			var option = {
 				tooltip: {
+					show: false,
 					trigger: 'item'
 				},
 				legend: {
@@ -117,7 +150,7 @@ export default {
 							show: true,
 							position: 'center',
 							color: '#4c4a4a',
-							formatter: '{active|' + '今日累计收件' + '}' + '\n\r' + '{total|' + this.total +
+							formatter: '{active|' + '今日累计收件' + '}' + '\n\r' + '{total|' + signSuccessfully +
 								'}',
 							rich: {
 								total: {
@@ -140,7 +173,18 @@ export default {
 					labelLine: {
 						show: false
 					},
-					data: this.data
+					data: [{
+						value: signSuccessfully,
+						name: '签收成功'
+					},
+					{
+						value: outOfDelivery,
+						name: '派送中'
+					},
+					{
+						value: deliveryFailure,
+						name: '派送失败'
+					},]
 				}]
 			}
 			myChart.setOption(option)
@@ -172,7 +216,7 @@ export default {
 							show: true,
 							position: 'center',
 							color: '#4c4a4a',
-							formatter: '{active|' + '今日累计下单' + '}' + '\n\r' + '{total|' + this.total +
+							formatter: '{active|' + '今日累计下单' + '}' + '\n\r' + '{total|' + collecteSuccess +
 								'}',
 							rich: {
 								total: {
@@ -195,17 +239,17 @@ export default {
 					labelLine: {
 						show: false
 					},
-					data: this.data = [{
-						value: this.mailMap.succesLsNum,
+					data: [{
+						value: collecteSuccess,
 						name: '揽收成功'
 					},
 					{
-						value: this.mailMap.waitLsNum,
+						value: waiteCollecte,
 						name: '待揽收'
 					},
 
 					{
-						value: this.mailMap.problemLsNum,
+						value: noCollecte,
 						name: '未揽收'
 					},
 					]

+ 9 - 16
src/pages/components/Waitsent.vue

@@ -16,7 +16,7 @@
                     <!-- 各个运单 -->
                     <div class="batchss"
                         :style="{ overflow: item.openCard ? 'auto' : 'hidden', height: item.openCard ? 'auto' : '130px', }">
-                        <div class="batch-middel" v-for="unfold in item.list" :key="unfold.id">
+                        <div class="batch-middel" v-for="(unfold, index) in item.list" :key="index">
                             <div class="batch-middel-text">
                                 <div class="batch-middel-text-style">[{{ unfold.expressCompany }}]运单号:{{
                 unfold.expressNo }}</div>
@@ -31,10 +31,10 @@
                             </div>
                             <div style="display: flex; justify-content:space-around; padding-top: 5px;">
                                 <van-button style="width: 100px; border-radius: 6px;" size="small" plain type="info"
-                                    @click="onReceiving(unfold, type = 2)">签收
+                                    @click="onReceiving(unfold)">签收
                                 </van-button>
                                 <van-button style="width: 100px; border-radius: 6px;" size="small" plain type="danger"
-                                    @click="onSureRetention(unfold, type = 2)">设为滞留</van-button>
+                                    @click="onSureRetention(unfold)">设为滞留</van-button>
                             </div>
                         </div>
                     </div>
@@ -173,15 +173,11 @@ export default {
         }
         ,
         // 签收控制显示
-        onReceiving(value, type) {
-            if (type == 1) {
-                this.onReceivingVlaue = value.list
-            } else {
-                this.onSureRetentionVlaue = value
-            }
+        onReceiving(value) {
+
+            this.onReceivingVlaue = value
             this.receiving = true;
             this.selectedOption = this.options[0];
-            console.log(this.onReceivingVlaue, 'this.onReceivingVlaue')
         },
         // 签收选择确认弹框
         onConfirm(value) {
@@ -190,12 +186,9 @@ export default {
             this.wer = value
         },
         // 滞留控制显示
-        onSureRetention(value, type) {
-            if (type == 1) {
-                this.onSureRetentionVlaue = value.list
-            } else {
-                this.onSureRetentionVlaue = value
-            }
+        onSureRetention(value) {
+
+            this.onSureRetentionVlaue = value
             this.retention = true;
             console.log(this.onSureRetentionVlaue, type, 'this.onSureRetentionVlaue')
         },

+ 4 - 3
src/pages/new/batched.vue

@@ -3,7 +3,7 @@
         <back :title="titlename"></back>
         <div class="container">
             <div>批次号生成</div>
-            <div class="number">xxxxxxxxx</div>
+            <div class="number">{{ BatDispatchBatchNo }}</div>
             <div class="wenzi">批次内包含以下快件:</div>
             <div class="middle-box">
                 <van-cell v-for="(item, index) in list" :key="index" :value="item" />
@@ -20,7 +20,7 @@
 <script>
 export default {
     name: 'batched',
-    props: ['isRemoval'],
+    props: ['isRemoval', 'BatDispatchBatchNo'],
     data() {
         return {
             titlename: '快件出库',
@@ -29,6 +29,7 @@ export default {
     },
     mounted() {
         console.log(this.isRemoval, '456')
+        console.log(this.BatDispatchBatchNo)
     },
     methods: {
         // 返回
@@ -66,7 +67,7 @@ export default {
     }
 
     .wenzi {
-        margin-top: 50px;
+        margin-top: 30px;
     }
 
     .middle-box {

+ 8 - 3
src/pages/new/removal.vue

@@ -2,7 +2,7 @@
     <div>
         <div class="container" v-if="isRemoval">
             <back :title="titlename"></back>
-            <van-search v-model="keyWorld" placeholder="请输入手机单号" />
+            <van-search v-model="keyWorld" placeholder="请输入快递单号" />
             <img @click="onImg" src="@/assets/user/u4.png" alt="">
             <div style="padding: 12px;" v-if="show">
                 <div style="margin-bottom: 10px;">已添加快件:</div>
@@ -18,7 +18,7 @@
                 <van-button @click="onBatch" class="build" type="info">生成批次</van-button>
             </div>
         </div>
-        <Batched :isRemoval="isRemoval" @isRemoval="iemoval" v-else></Batched>
+        <Batched :BatDispatchBatchNo="BatDispatchBatchNo" :isRemoval="isRemoval" @isRemoval="iemoval" v-else></Batched>
     </div>
 </template>
 
@@ -41,7 +41,8 @@ export default {
             titlename: "快件出库",
             codes: ['SF676444932923', 'SF23123123123', 'SF202303221917'],
             keyWorld: "",
-            isRemoval: true
+            isRemoval: true,
+            BatDispatchBatchNo: '',//传过去的生成的快递单号
         };
     },
     methods: {
@@ -66,6 +67,10 @@ export default {
             const res = await appDeliveryPersonDeliveries({ ...data }, { emulateJSON: true })
             if (res.msg == 'success') {
                 this.isRemoval = false
+                this.BatDispatchBatchNo = data.dispatchBatchNo
+                console.log(data.dispatchBatchNo, 'data.dispatchBatchNo')
+            } else {
+                this.$toast('生成批次错误')
             }
             console.log(res, 'res')
         },

+ 5 - 1
src/pages/new/sign.vue

@@ -37,7 +37,11 @@ export default {
         },
         // 查询
         async check() {
-            const Shipment = await appFindYourShipment({ expressNo: 'SF202303221917' }, { emulateJSON: true })
+            if (this.value == '') {
+                this.$toast('请输入快件单号或手机单号')
+                return
+            }
+            const Shipment = await appFindYourShipment({ expressNo: this.value }, { emulateJSON: true })
 
             const res = await appFindYourShipmentList({ userId: Shipment.data.user_id }, { emulateJSON: true })
             if (res.code == '0') {

+ 4 - 4
src/pages/new/storage.vue

@@ -19,7 +19,7 @@
                 </van-popup>
 
                 <van-field :value="onGroupObject.phones" @focus="onFocus" name="phone" label="收件人手机号"
-                    placeholder="后四位" />
+                    placeholder="请输入手机号" :rules="[{ required: true }]" />
 
                 <van-field :value="onGroupObject.NAME" readonly name="NAME" label="收件人姓名" placeholder="占位" />
 
@@ -43,7 +43,7 @@
                 <van-field value="1" name="expressQuantity" placeholder="请输入快递数量" label="快递数量" readonly />
 
                 <van-field readonly clickable name="shelfInformation" label="货架信息" :value="value4" placeholder="请选择货架"
-                    @click="shelf = true" />
+                    @click="shelf = true" :rules="[{ required: true }]" />
                 <van-popup v-model="shelf" position="bottom">
                     <van-picker show-toolbar :columns="shelfs" @confirm="onShelf" @cancel="shelf = false" />
                 </van-popup>
@@ -59,9 +59,9 @@
                 </div>
 
                 <van-field v-model="object.remark" label="快递备注" name="remark" placeholder="请输入快递备注"
-                    :rules="[{ required: true, message: '' }]" />
+                    :rules="[{ required: true }]" />
 
-                <div style=" display: flex; justify-content: space-between; background-color: #fff;  padding: 10px 0;">
+                <div style=" display: flex; justify-content: space-around; background-color: #fff;  padding: 10px 0;">
                     <van-button size="small" style="border-radius: 5px; width: 190px;" block type="info"
                         native-type="submit">保存/打印小标签并添加下一个</van-button>
                     <van-button size="small" style="width: 130px; border-radius: 5px;" block type="info"

+ 8 - 2
src/pages/new/sureCombine.vue

@@ -13,7 +13,7 @@
                 </template>
             </van-field>
 
-            <van-field name="uploader" label="上传照片">
+            <van-field name="uploader" label="上传照片" :rules="[{ required: true, message: '请上传图片' }]">
                 <template #input>
                     <van-uploader v-model="uploader" :after-read="afterRead" :before-read="beforeRead" :max-count="1" />
                 </template>
@@ -72,7 +72,13 @@ export default {
                 deliveryPeopleId: localStorage.getItem('courierId'),// 派件员id
             }
             const res = await appDelivery({ ...params }, { emulateJSON: true })
-            // this.$router.push('/')
+            if (res.code == 0) {
+                this.$toast('签收成功')
+                this.$router.push('/')
+            } else {
+                this.$toast('签收失败')
+            }
+
         },
         back() {
             this.$emit('isCombine', true)