Browse Source

Merge branch 'dev' into 'test'

经销商盲票订单与用户提货订单页面新增快递单号自动识别

See merge request quanshu/mp-ui-pc!175
hunagwb 3 năm trước cách đây
mục cha
commit
e2bea6bfa5

+ 8 - 0
src/api/business/order.js

@@ -19,6 +19,14 @@ export function companyList(data) {
   })
 }
 
+//快递单号自动识别
+export function automaticRecognition(data) {
+  return request({
+    url:`/api/v1/mp/logistics/autonumber/auto/${ data }`,
+    method:'post',
+  })
+}
+
 // 经销商盲票组列表
 export function boxList(data) {
   return request({

+ 13 - 4
src/views/order/channel/components/ExpressEdit.vue

@@ -20,6 +20,7 @@
         <el-form-item v-if="shipForm.deliveryType == 1"  label="快递单号:" prop="deliveryFlowId">
           <el-input
             v-model="shipForm.deliveryFlowId"
+            @blur="InputBlur()"
             placeholder="输入快递单号"
             clearable
             size="small"
@@ -55,10 +56,7 @@
 </template>
 <script>
 import CustomFieldsMixin from "@/mixins/CustomFields";
-import {
-  companyList,
-  channelOrderShipUpdate,
-} from "@/api/business/order";
+import { companyList, channelOrderShipUpdate, automaticRecognition} from "@/api/business/order";
 export default {
   mixins: [CustomFieldsMixin],
   props: {
@@ -126,6 +124,17 @@ export default {
       });
     },
 
+    //快递单号失去焦点时
+    InputBlur(){
+      if (this.shipForm.deliveryFlowId){
+        automaticRecognition(this.shipForm.deliveryFlowId).then((res)=>{
+          if (res.code == 0 && res.data){
+            this.shipForm.deliveryId = res.data.deliveryId
+          }
+        })
+      }
+    },
+
     // 确认
     saveClick() {
       this.loading = true;

+ 13 - 5
src/views/order/channel/components/SendGoods.vue

@@ -29,6 +29,7 @@
         <el-form-item v-if="shipForm.deliveryType == 1" label="快递单号:" prop="deliveryFlowId">
           <el-input
             v-model="shipForm.deliveryFlowId"
+            @blur="InputBlur()"
             placeholder="输入快递单号"
             clearable
             size="small"
@@ -129,11 +130,7 @@
 </template>
 <script>
 import CustomFieldsMixin from "@/mixins/CustomFields";
-import {
-  companyList,
-  ticketPkgList,
-  channelOrderShip,
-} from "@/api/business/order";
+import { companyList, ticketPkgList, channelOrderShip, automaticRecognition} from "@/api/business/order";
 export default {
   mixins: [CustomFieldsMixin],
   props: {
@@ -213,6 +210,17 @@ export default {
       });
     },
 
+    //快递单号失去焦点时
+    InputBlur(){
+      if (this.shipForm.deliveryFlowId){
+        automaticRecognition(this.shipForm.deliveryFlowId).then((res)=>{
+          if (res.code == 0 && res.data){
+            this.shipForm.deliveryId = res.data.deliveryId
+          }
+        })
+      }
+    },
+
     // 查询盲票组序列号
     querySearch(queryString, cb) {
       ticketPkgList({

+ 13 - 5
src/views/order/deliver/components/ExpressEdit.vue

@@ -19,6 +19,7 @@
         <el-form-item v-if="shipForm.deliveryType == 1" label="快递单号:" prop="deliveryFlowId">
           <el-input
             v-model="shipForm.deliveryFlowId"
+            @blur="InputBlur()"
             placeholder="输入快递单号"
             clearable
             size="small"
@@ -54,10 +55,7 @@
 </template>
 <script>
 import CustomFieldsMixin from "@/mixins/CustomFields";
-import {
-  companyList,
-  deliverOrderShipUpdate,
-} from "@/api/business/order";
+import { companyList, deliverOrderShipUpdate, automaticRecognition} from "@/api/business/order";
 export default {
   mixins: [CustomFieldsMixin],
   props: {
@@ -123,7 +121,6 @@ export default {
       }
     },
 
-
     // 快递下拉列表
     getCompanyList() {
       companyList({}).then((res) => {
@@ -131,6 +128,17 @@ export default {
       });
     },
 
+    //快递单号失去焦点时
+    InputBlur(){
+      if (this.shipForm.deliveryFlowId){
+        automaticRecognition(this.shipForm.deliveryFlowId).then((res)=>{
+          if (res.code == 0 && res.data){
+            this.shipForm.deliveryId = res.data.deliveryId
+          }
+        })
+      }
+    },
+
     // 确认
     saveClick() {
       this.loading = true;

+ 12 - 6
src/views/order/deliver/components/SendGoods.vue

@@ -103,7 +103,7 @@
 </template>
 <script>
 import CustomFieldsMixin from "@/mixins/CustomFields";
-import { companyList, deliverOrderShip } from "@/api/business/order";
+import { companyList, deliverOrderShip, automaticRecognition} from "@/api/business/order";
 export default {
   mixins: [CustomFieldsMixin],
   props: {
@@ -163,11 +163,6 @@ export default {
       }
     },
 
-    //快递单号失去焦点时
-    InputBlur(){
-      //调用自动查询快递公司接口,渲染到页面上
-    },
-
     // 快递下拉列表
     getCompanyList() {
       companyList({}).then((res) => {
@@ -175,6 +170,17 @@ export default {
       });
     },
 
+    //快递单号失去焦点时
+    InputBlur(){
+      if (this.shipForm.deliveryFlowId){
+        automaticRecognition(this.shipForm.deliveryFlowId).then((res)=>{
+          if (res.code == 0 && res.data){
+            this.shipForm.deliveryId = res.data.deliveryId
+          }
+        })
+      }
+    },
+
     // 选中商品
     handleSelectionGoods(e) {
       this.goodsList = e