sunChengjie 11 hónapja
szülő
commit
0f68e29826

+ 1 - 0
src/App.vue

@@ -6,6 +6,7 @@
 
 <script>
 import { getWxConfig } from './api/index'
+import wx from "weixin-jsapi";
 export default {
 	name: 'App',
 	provide() { //父组件中通过provide来提供变量,在子组件中通过inject来注入变量。                                             

+ 25 - 29
src/pages/components/HomePage.vue

@@ -290,47 +290,43 @@ export default {
 
 		async wxScanCodeA(result) {
 			const res = await appFindYourShipment({ expressNo: result }, { emulateJSON: true })
-			if (res.data !== '') {
-				if (res.msg == 'success') {
-					this.$store.state.shipment = res
-					this.$router.push('ScannerResult')
-				} else {
-					Toast('找不到此单号')
-				}
+			if (res.msg == 'success' && res.data) {
+				this.$store.state.shipment = res
+				this.$router.push('ScannerResult')
 			} else {
-				Toast('没查到此订单号')
+				Toast('找不到此单号')
 			}
+		}
 
-			console.log(res, '+++++++++==')
-		},
+	},
 
 
-		//单号搜索
-		onSearch(val) {
-			this.$router.push({
-				path: '/Sysearch',
-				query: {
-					expressNo: val,
-					searchType: "1" //1.搜索全部 2.搜索快件 3.搜索寄件
-				}
-			})
-		},
+	//单号搜索
+	onSearch(val) {
+		this.$router.push({
+			path: '/Sysearch',
+			query: {
+				expressNo: val,
+				searchType: "1" //1.搜索全部 2.搜索快件 3.搜索寄件
+			}
+		})
+	},
 
-		echart1(obj) {
-			console.log("图表数据:" + JSON.stringify(obj))
+	echart1(obj) {
+		console.log("图表数据:" + JSON.stringify(obj))
 
-		},
+	},
 
-		async getUser() {
-			const res = await getSysUserInfoByUserIdAPI({ userId: localStorage.getItem("userId") })
-			this.$store.state.user = res.sysUserInfo
-			console.log(this.$store.state.user, 'this.$state.state.user')
-		}
+	async getUser() {
+		const res = await getSysUserInfoByUserIdAPI({ userId: localStorage.getItem("userId") })
+		this.$store.state.user = res.sysUserInfo
+		console.log(this.$store.state.user, 'this.$state.state.user')
+	}
 
 
-	}
 }
 
+
 </script>
 
 <style scoped lang="less">

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

@@ -1,6 +1,6 @@
 <template>
     <div>
-        <back :title="titlename"></back>
+
         <div class="container">
             <div>批次号生成</div>
             <div class="number">{{ BatDispatchBatchNo }}</div>
@@ -20,11 +20,10 @@
 <script>
 export default {
     name: 'batched',
-    props: ['isRemoval', 'BatDispatchBatchNo'],
+    props: ['isRemoval', 'BatDispatchBatchNo', 'codesList'],
     data() {
         return {
-            titlename: '快件出库',
-            list: ['11111', '2222222222', '55555555555', '6666666666'],
+            list: this.codesList,
         };
     },
     mounted() {

+ 4 - 1
src/pages/new/removal.vue

@@ -17,7 +17,8 @@
                 <van-button @click="onBatch" class="build" type="info">生成批次</van-button>
             </div>
         </div>
-        <Batched :BatDispatchBatchNo="BatDispatchBatchNo" :isRemoval="isRemoval" @isRemoval="iemoval" v-else></Batched>
+        <Batched :codesList="codesList" :BatDispatchBatchNo="BatDispatchBatchNo" :isRemoval="isRemoval"
+            @isRemoval="iemoval" v-else></Batched>
     </div>
 </template>
 
@@ -44,6 +45,7 @@ export default {
             keyWorld: "",
             isRemoval: true,
             BatDispatchBatchNo: '',//传过去的生成的快递单号
+            codesList: [],
         };
     },
     methods: {
@@ -82,6 +84,7 @@ export default {
             if (res.msg == 'success') {
                 this.isRemoval = false
                 this.BatDispatchBatchNo = data.dispatchBatchNo
+                this.codesList = this.codes
                 console.log(data.dispatchBatchNo, 'data.dispatchBatchNo')
             } else {
                 this.$toast('生成批次错误')

+ 1 - 1
src/pages/new/scannerResult.vue

@@ -33,7 +33,7 @@ export default {
         };
     },
     created() {
-        this.list = this.$store.state.shipment.data
+        this.list = this.$store.state.shipment.data || {}
         console.log('this.list', this.list)
     },
     methods: {

+ 4 - 0
src/pages/new/sign.vue

@@ -33,6 +33,7 @@ export default {
     },
     methods: {
         onImg() {
+
             wx.scanQRCode({
                 needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
                 scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
@@ -57,6 +58,9 @@ export default {
                 return
             }
             const Shipment = await appFindYourShipment({ expressNo: this.value }, { emulateJSON: true })
+            if (Shipment.data == null) {
+                Toast('没有数据')
+            }
 
             const res = await appFindYourShipmentList({ userId: Shipment.data.user_id }, { emulateJSON: true })
             if (res.code == '0') {