mxx 3 年之前
父节点
当前提交
970ce4d240
共有 1 个文件被更改,包括 8 次插入45 次删除
  1. 8 45
      src/views/houseSelfCollect/paymentManagement.vue

+ 8 - 45
src/views/houseSelfCollect/paymentManagement.vue

@@ -61,7 +61,7 @@
         <ws-button type="primary" @click="reject">驳回</ws-button>
         <ws-button type="primary" @click="adopt">通过</ws-button>
         <ws-button type="primary" @click="invoicingClick"
-          v-hasPermission="`acquisitionManagement.acquisitionPay.finace`">开票</ws-button>
+          v-hasPermission="`acquisitionManagement.acquisitionPay.finace`" >开票</ws-button>
         <ws-button type="primary" @click="exportlist" v-hasPermission="`acquisitionManagement.acquisitionPay.print`">导出
         </ws-button>
         <!-- <ws-button type="primary" @click="handlepass" v-if="isShowAdopt">审核</ws-button> -->
@@ -482,10 +482,17 @@ import download from '../../components/WsDownload/download'
         //   .then(response => {
         //     console.log(response)
         //   })
+        
         let data = {
           paymentManagementList: this.modification
         }
         console.log('开票', data)
+        for(let i=0;i<this.modification.length;i++){
+          if(this.modification[i].status!='全部付款'&&this.modification[i].status!='部分付款') {
+            this.$message.error('开票只能选择全部付款或部分付款!');
+              return
+          }
+        }
         //开票
         invoicing(data)
           .toPromise()
@@ -496,53 +503,9 @@ import download from '../../components/WsDownload/download'
               var arr=[]
               for (let i = 0; i < response.length; i++) {
                 arr.push({fileUrl:response[i],renameFileName:'发票'+i+'.xml'})
-                //创建标签下载文件
-                // window.open(response[i],)
-                // let a = document.createElement('a');
-                // // a.href = response[i];
-                // a.setAttribute('target', 'blank');
-                // a.setAttribute('download', response[i]);
-                // a.setAttribute('href', response[i]);
-                // a.click();
-                // a.remove();
-                // let b = document.createElement('a');
-                // // b.href = response[i];
-                // b.setAttribute('target', 'blank');
-                // b.setAttribute('download', response[i]);
-                // b.setAttribute('href', response[i]);
-                // b.click();
-                // b.remove();
               }
               this.filesToRar(arr, '开票XML文件')
             }
-            //未完成,接口调通后替换假数据
-            // response = {
-
-            // }
-            // response.data.imgList = [{
-            //     name: 'xml1',
-            //     src: 'https://taohaoliang.oss-cn-beijing.aliyuncs.com/admin/75215bed1ad7408aa73d6474bfe82854.png'
-            //   },
-            //   {
-            //     name: 'xml2',
-            //     src: 'https://taohaoliang.oss-cn-beijing.aliyuncs.com/admin/75215bed1ad7408aa73d6474bfe82854.png'
-            //   }, {
-            //     name: 'xml3',
-            //     src: 'https://taohaoliang.oss-cn-beijing.aliyuncs.com/admin/75215bed1ad7408aa73d6474bfe82854.png'
-            //   }
-            // ]
-            // this.invoicingImgList = response.data.imgList
-            // if (response.data.imgList.length > 0) {
-            //   for (let i = 0; i < response.data.imgList.length; i++) {
-            //     //创建标签下载文件
-            //     let a = document.createElement('a');
-            //     a.href = response.data.imgList[i].src;
-            //     let urlArr = a.href.split('.');
-            //     a.setAttribute('download', response.data.imgList[i].name + '.xml');
-            //     a.click();
-            //     a.remove();
-            //   }
-            // }
           })
           .catch(() => {})
       },