Howie 3 éve
szülő
commit
0ae5bcef54

+ 1 - 1
src/views/supply/apply/components/design/print-data.js

@@ -109,7 +109,7 @@ function addPrint() {
       console.log('chenggong ');
     // this.$successMsg('提交成功');
     // this.$parent.getList()
- 
+
   })
 }
 

+ 3 - 3
src/views/supply/pickup/check.vue

@@ -569,9 +569,9 @@ export default {
     // 点击打印
     toPrint() {
     
-      // if (!this.isAllEqual(this.tableSelection)) {
-      //   return this.$errorMsg("只能选择同一个提货订单");
-      // }
+      if (!this.isAllEqual(this.tableSelection)) {
+        return this.$errorMsg("只能选择同一个提货订单");
+      }
 
       if (!this.tableSelection[0].printNum) {
         this.queryItem = this.tableSelection;

+ 6 - 7
src/views/supply/pickup/components/design/print-data.js

@@ -6,7 +6,7 @@ import { getCompanyList } from '@/api/user'
 let detailArr = []
 let detailData = []
 let company = ''
-let filterId = []
+let cNewIds = []
 // 获取详情
 getCompanyLists()
 function getDetails(ids, nickName) {
@@ -17,11 +17,13 @@ function getDetails(ids, nickName) {
   // detailData = ids 
   let newIds = []
   newIds = ids
-
+  let filterId = []
   filterId = newIds.map(k => {
     return k.id
   })
+
   filterId = [...new Set(filterId)]
+  cNewIds =JSON.parse(JSON.stringify(filterId)) 
   for (let i = 0; i < filterId.length; i++) {
     getDetail({ id: filterId[i] }).then(res => {
       const item = res.data
@@ -106,9 +108,7 @@ function getCompanyLists() {
 
 // 添加次数
 function addPrints() {
-  console.log(filterId);
-
-
+  console.log(detailData);
   // let ids = detailData.map(item => {
   //   console.log(item.invoicePickBeans);
   //   if (item.invoicePickBeans && item.invoicePickBeans.length) {
@@ -125,11 +125,10 @@ function addPrints() {
   // })
 
   // console.log(document.execCommand('print'),'4545');
-  addPrint({ ids: filterId.join(',') }).then(res => {
+  addPrint({ ids: cNewIds.join(',') }).then(res => {
     console.log('chenggong ');
     // this.$successMsg('提交成功');
     // this.$parent.getList()
-
   })
 }