소스 검색

优化组件

lichao 3 년 전
부모
커밋
ec33cc7a22

+ 13 - 0
src/api/basicData/configuration.js

@@ -1,4 +1,5 @@
 import request from '@/router/axios';
+import {getMarketDetailsList} from "../importTrade/purchase";
 
 //客户资料列表查询
 export function customerList(data) {
@@ -129,3 +130,15 @@ export function corpstypeTree() {
         method: 'get'
     })
 }
+
+//生成采购单
+export function saveSell(data) {
+  return request({
+    url: '/api/blade-purchase-sales/order/createMarket',
+    method: 'post',
+    data: {
+      id: data
+    }
+  })
+}
+

+ 13 - 0
src/api/basicData/purchaseOrder.js

@@ -138,3 +138,16 @@ export function generateShipment(data) {
     data:data
   })
 }
+
+// 获取销售订单明细
+export function getGNMarketDetailsList(current,size,params) {
+  return request({
+    url: '/api/blade-purchase-sales/order/orderItemsList',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}

+ 13 - 1
src/api/exportTrade/purchaseContract.js

@@ -95,4 +95,16 @@ export function getSpecification(query) {
     method: 'get',
     params: query
   })
-}
+}
+// 获取销售订单明细详情
+export function getCKMarketDetailsList(current,size,params) {
+  return request({
+    url: '/api/blade-purchase-sales/exportOrder/orderItemsList',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}

+ 46 - 12
src/components/procurement/market.vue

@@ -11,9 +11,9 @@
                :page.sync="page"
                @on-load="onLoad">
     </avue-crud>
-    <div style="margin-left: 90%">
-       <span slot="footer" class="dialog-footer" >
-           <el-button @click="closeFun()">取 消</el-button>
+    <div class="botoom">
+       <span slot="footer" class="dialog-footer">
+           <el-button @click="closeDialog">取 消</el-button>
            <el-button type="primary" @click="importMarket" :disabled="selectMarketList.length == 0">导入</el-button>
        </span>
     </div>
@@ -23,6 +23,8 @@
 <script>
   import option from './config/market.json'
   import {getMarketDetailsList} from "@/api/importTrade/purchase";
+  import {getGNMarketDetailsList} from "@/api/basicData/purchaseOrder";
+  import {getCKMarketDetailsList} from "@/api/exportTrade/purchaseContract";
 
   export default {
     name: "index",
@@ -32,7 +34,11 @@
       },
       closeFun: {
         type: Function
-      }
+      },
+      // 系统来源
+      systemType: {
+        type: String
+      },
     },
     data(){
       return {
@@ -68,17 +74,36 @@
           params.orderEndDate = params.marketDate[1] + " " + "23:59:59";
           this.$delete(params,'marketDate')
         }
-        getMarketDetailsList(page.currentPage, page.pageSize,params).then(res=>{
-          this.data = res.data.data.records
-          this.page.total = res.data.data.total
-        })
-          .finally(()=>{
-          this.loading = false;
-        })
+        if (this.systemType == 'JK') {
+          getMarketDetailsList(page.currentPage, page.pageSize,params).then(res=>{
+            this.data = res.data.data.records
+            this.page.total = res.data.data.total
+          })
+            .finally(()=>{
+              this.loading = false;
+            })
+        } else if (this.systemType == 'CK') {
+          getCKMarketDetailsList(page.currentPage, page.pageSize,params).then(res=>{
+            this.data = res.data.data.records
+            this.page.total = res.data.data.total
+          }).finally(()=>{
+            this.loading = false;
+          })
+        } else if (this.systemType == 'GN') {
+          getGNMarketDetailsList(page.currentPage, page.pageSize,params).then(res=>{
+            this.data = res.data.data.records
+            this.page.total = res.data.data.total
+          }).finally(()=>{
+            this.loading = false;
+          })
+        }
       },
       importMarket(){
         this.$emit('importMarket',this.selectMarketList);
       },
+      closeDialog() {
+        this.$emit('close')
+      },
       //列保存触发
       async saveColumn() {
         const inSave = await this.saveColumnData(
@@ -95,5 +120,14 @@
   }
 </script>
 <style scoped>
-
+.botoom:after {
+  content: '';
+  display: block;
+  height: 0;
+  clear: both;
+}
+.dialog-footer {
+  display: flex;
+  float: right;
+}
 </style>

+ 13 - 2
src/components/selectComponent/customerSelect.vue

@@ -234,7 +234,7 @@ export default {
     },
     // 远程模糊查找
     remoteMethod(query) {
-      if (query !== '') {
+      if (query) {
         this.loading = true;
         this.queryParams = {
           size: 10,
@@ -252,11 +252,22 @@ export default {
           current: 1
         }
         customerList(this.queryParams).then(res => {
-          this.dicData = res.data.data.records
+          this.dicData = []
+          this.configuration.dicData = this.configuration.dicData.concat(res.data.data.records)
+          // this.configuration.dicData = res.data.data.records
+          this.removeRepeat()
           this.loading = false;
         });
       }
     },
+    // 去重
+    removeRepeat() {
+      let obj = []
+      this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
+        obj[next.id] ? '': obj[next.id] = true && current.push(next)
+        return current
+      }, [])
+    },
   }
 };
 </script>

+ 13 - 2
src/components/warehouseSelect/index.vue

@@ -235,7 +235,7 @@ export default {
     },
     // 远程模糊查找
     remoteMethod(query) {
-      if (query !== '') {
+      if (!query) {
         this.loading = true;
         this.queryParams = {
           size: 10,
@@ -253,11 +253,22 @@ export default {
           current: 1
         }
         customerList(this.queryParams).then(res => {
-          this.dicData = res.data.data.records
+          this.dicData = []
+          this.configuration.dicData = this.configuration.dicData.concat(res.data.data.records)
+          // this.configuration.dicData = res.data.data.records
+          this.removeRepeat()
           this.loading = false;
         });
       }
     },
+    // 去重
+    removeRepeat() {
+      let obj = []
+      this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
+        obj[next.id] ? '': obj[next.id] = true && current.push(next)
+        return current
+      }, [])
+    },
   }
 };
 </script>

+ 6 - 0
src/views/importTrade/invoice/detailsPageEdit.vue

@@ -245,6 +245,8 @@
       <market-detail
         @closeFun="!marketDialog"
         @importMarket="importMarket"
+        @close="closeMarkeDialog"
+        systemType="CK"
       >
       </market-detail>
     </el-dialog>
@@ -501,6 +503,10 @@ export default {
     }
   },
   methods: {
+    // 关闭导入销售弹窗
+    closeMarkeDialog() {
+      this.marketDialog = false
+    },
     //选择仓库  带出库存
     warehouseChange(){
       this.contactsData.forEach(item =>{