浏览代码

【修改】bug

howie 3 年之前
父节点
当前提交
9f991f7694

+ 1 - 1
src/views/sales_policy/components/Examine.vue

@@ -88,7 +88,7 @@
               </div>
             </el-col>
             <el-col :span="24" class="item">
-              <div class="label">失日期</div>
+              <div class="label">失日期</div>
               <div class="value">
                 <el-date-picker
                   v-model="detail.endTime"

+ 14 - 13
src/views/supply/deliver/components/design/print-data.js

@@ -6,14 +6,14 @@ let detailArr = []
 let cids = []
 let company = ''
 // 获取详情
-getCompanyLists()
-function getDetail(ids,nickName) {
+
+async function getDetail(ids,nickName) {
 
   let  invoicePickBeans = []
   let  start = 0
   let  end = 5
     detailArr = []
-  // detailData = ids 
+  // detailData = ids
   let newIds = []
       newIds = ids
       cids = JSON.parse(JSON.stringify(ids))
@@ -21,15 +21,16 @@ function getDetail(ids,nickName) {
       filterId = newIds.map(k=>{
               return k.id
             })
-        filterId = [...new Set(filterId)]    
+        filterId = [...new Set(filterId)]
+      await  getCompanyLists()
   for (let i = 0; i < filterId.length; i++) {
-    getDeliverDetail({ id: filterId[i] }).then(res => {
+  await  getDeliverDetail({ id: filterId[i] }).then(res => {
       const item = res.data
       console.log(item,'887899');
       detailData.push(JSON.parse(JSON.stringify(item)))
- 
+
       invoicePickBeans = item.invoicePickBeans
-      let len =Math.ceil(invoicePickBeans.length / 5) 
+      let len =Math.ceil(invoicePickBeans.length / 5)
         console.log(len,'长度');
         for (let index = 0; index < len; index++) {
           const table = []
@@ -46,8 +47,8 @@ function getDetail(ids,nickName) {
                     refundableQty: e.refundableQty || 0,
                     // headerRemark:e.headerRemark,
                     pjxh1Text: e.pjxh1Text || ''
-                  }) 
-                
+                  })
+
             });
           }
           detailArr.push({
@@ -115,22 +116,22 @@ function addPrint() {
       for (let index = 0; index < item.invoicePickBeans.length; index++) {
         const element = item.invoicePickBeans[index];
             console.log(element.id ,'element.id ');
-        // return  element.id 
+        // return  element.id
         ids.push(element.id )
       }
     } else {
       // console.log(item.invoiceOrderId ,'item.invoiceOrderId ');
       return item.invoiceOrderId || item.id
     }
-  
+
   })
-  
+
   // console.log(document.execCommand('print'),'4545');
   addPrints({ ids: ids.join(',') }).then(res => {
       console.log('chenggong ');
     // this.$successMsg('提交成功');
     // this.$parent.getList()
- 
+
   })
 }
 

+ 1 - 1
src/views/supply/engin/components/home_form.vue

@@ -1141,7 +1141,7 @@ export default {
               this.$errorMsg('请选择现金钱包');
               return;
             }
-            if(type ==1){
+            if(type !=2){
               if(!this.goodsList[i].qty) {
               this.$errorMsg('金额不能为0');
               return;

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

@@ -350,7 +350,7 @@ export default {
         status: this.screenForm.status,
       };
     },
-    
+
     curPaperType() {
       let type = 'other'
       let types = this.paperTypes
@@ -440,7 +440,7 @@ export default {
         this.warehouseList = res.data.records;
       })
     },
-    
+
     // 获取短信验证码
     getCode() {
       getCode({ mobile: this.screenForm.phone }).then((res) => {
@@ -571,7 +571,7 @@ export default {
 
     // 点击打印
     toPrint() {
-    
+
       // if (!this.isAllEqual(this.tableSelection)) {
       //   return this.$errorMsg("只能选择同一个提货订单");
       // }
@@ -581,7 +581,7 @@ export default {
         console.log(this.tableSelection);
         getDetails(this.tableSelection)
         this.$refs.preView.show(this.hiprintTemplate, detailArr)
-      } else {    
+      } else {
         this.queryItem = this.tableSelection;
         this.dialogForm.createMan = JSON.parse(
           localStorage.getItem("supply_user")
@@ -590,7 +590,7 @@ export default {
         this.isShowDialog = true;
       }
     },
-   
+
     // 点击打印
     // toPrint(item) {
     //   if(!item.printNum) {

+ 2 - 2
src/views/supply/pickup/components/design/preview.vue

@@ -71,7 +71,7 @@ export default {
       }, 500)
     },
     print() {
-       
+
       this.hiprintTemplate.print(this.printData, {}, {
         callback: () => {
           addPrints()
@@ -139,7 +139,7 @@ export default {
 
 @media print {
 
-/*    
+/*
   td {
     border: none !important;
   } */

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

@@ -1,6 +1,5 @@
 
 import { getDetail, addPrint,getDtailPrintDis} from "@/api/supply/pickup";
-// import { addPrints } from '@/api/supply/pickup'
 import { getCompanyList } from '@/api/user'
 
 let detailArr = []
@@ -8,13 +7,13 @@ let detailData = []
 let company = ''
 let cNewIds = []
 // 获取详情
-getCompanyLists()
-function getDetails(ids, nickName) {
+
+ async function getDetails(ids, nickName) {
   let invoicePickBeans = []
   let start = 0
   let end = 5
   detailArr = []
-  // detailData = ids 
+  // detailData = ids
   let newIds = []
   newIds = ids
   let filterId = []
@@ -29,8 +28,9 @@ function getDetails(ids, nickName) {
     return k.id
   })
   filterId = [...new Set(filterId)]
-  cNewIds =JSON.parse(JSON.stringify(filterId)) 
-  getDtailPrintDis(obj).then(res=>{
+  cNewIds =JSON.parse(JSON.stringify(filterId))
+   await getCompanyLists()
+   await getDtailPrintDis(obj).then(res=>{
     const item = res.data
       item.forEach(k=>{
         detailData.push(JSON.parse(JSON.stringify(k)))
@@ -53,7 +53,7 @@ function getDetails(ids, nickName) {
                 // headerRemark:e.headerRemark,
                 pjxh1Text: e.pjxh1Text || ''
               })
-    
+
             });
           }
           detailArr.push({
@@ -169,34 +169,10 @@ function getCompanyLists() {
 
 // 添加次数
 function addPrints() {
-  console.log(detailData);
-  // let ids = detailData.map(item => {
-  //   console.log(item.invoicePickBeans);
-  //   if (item.invoicePickBeans && item.invoicePickBeans.length) {
-  //     for (let index = 0; index < item.invoicePickBeans.length; index++) {
-  //       const element = item.invoicePickBeans[index];
-  //       // console.log(element.id ,'element.id ');
-  //       return element.invoiceOrderId
-  //     }
-  //   } else {
-  //     // console.log(item.invoiceOrderId ,'item.invoiceOrderId ');
-  //     return item.invoiceOrderId || item.id
-  //   }
-
-  // })
-
-  // console.log(document.execCommand('print'),'4545');
   addPrint({ ids: cNewIds.join(',') }).then(res => {
-    console.log('chenggong ');
-    // this.$successMsg('提交成功');
-    // this.$parent.getList()
   })
 }
 
-
-
-
-
 export {
   getDetails, getCompanyLists,
   detailArr,