소스 검색

根据提单号查客户

lichao 3 년 전
부모
커밋
5de2a2d920
2개의 변경된 파일27개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 0
      src/api/singleTicket/index.js
  2. 19 1
      src/views/reportManagement/singleTicket/index.vue

+ 8 - 0
src/api/singleTicket/index.js

@@ -24,3 +24,11 @@ export function exportTwo(query) {
     params: query
   })
 }
+// 根据提单号查找货主
+export function getCorps(query) {
+  return request({
+    url: '/warehouseBusiness/whgenleg/getCorpsByfMblno',
+    method: 'get',
+    params: query
+  })
+}

+ 19 - 1
src/views/reportManagement/singleTicket/index.vue

@@ -11,6 +11,7 @@
           <el-select
             v-model="query.fCorpid"
             filterable
+            clearable
             remote
             style="width: 80%"
             :remote-method="corpsRemoteMethod"
@@ -30,6 +31,7 @@
             placeholder="请输入提单号"
             clearable
             size="small"
+            @change="fMblnoChange"
           />
         </el-form-item>
         <el-form-item label="日期" prop="bsdateList">
@@ -171,8 +173,9 @@
 </template>
 
 <script>
-import { listpayable , exportOne , exportTwo} from '@/api/singleTicket'
+import { listpayable , exportOne , exportTwo, getCorps} from '@/api/singleTicket'
 import {listCorps} from "@/api/basicdata/corps";
+
 export default {
   name: "index",
   data(){
@@ -301,6 +304,7 @@ export default {
       });
     },
     corpsRemoteMethod(name) {
+      if (this.query.fMblno) return
       if (name == null || name === "") {
         return false;
       }
@@ -310,6 +314,20 @@ export default {
       });
     },
     resetQuery(){},
+    // 提单号变化触发
+    fMblnoChange() {
+      this.$set(this.query, 'fCorpid', '')
+      if (this.query.fMblno) {
+        getCorps({fMblno: this.query.fMblno}).then(res => {
+          this.fMblnoOptions = res.data;
+          if (this.fMblnoOptions.length > 0) this.query.fCorpid = this.fMblnoOptions[0].fId
+        })
+      } else {
+        listCorps({type: 1}).then((response) => {
+          this.fMblnoOptions = response.rows;
+        });
+      }
+    },
   }
 }
 </script>