gjy 3 年之前
父节点
当前提交
2d15088034

+ 2 - 0
src/api/V2/statisticalReport/index.js

@@ -95,6 +95,8 @@ export const API_POST_SALEEDITSETTLEMENTWEIGHT = '/stockSaleReceiptReport/api/ed
 export const API_GET_STOCK_SALE_CONTRACTNO = '/stockSaleReceiptReport/selectContractNoList'
 //现货销售出库修改反馈重量或单独开发票
 export const API_POST_EDIT_SETTLEMENTWEIGHT = '/stockSaleReceiptReport/api/editSettlementWeight'
+//现货销售出库批量开发票
+export const API_POST_INVOICELIST = '/stockSaleReceiptReport/api/openInvoiceList'
 // 火运,船运合同编号下拉
 export const API_GET_YUNSHUXIALA = '/tranTaskInfo/selectTranTask'
 // 火运,船运运输编号下拉

+ 5 - 2
src/model/statisticalReport/index.js

@@ -47,7 +47,8 @@ import {
     API_GET_YUNSHUXIALA,
     API_GET_YUNSHUNUMBER,
     API_POST_YUNSHUSETPRICE,
-    API_POST_EDIT_SETTLEMENTWEIGHT
+    API_POST_EDIT_SETTLEMENTWEIGHT,
+    API_POST_INVOICELIST
 } from '@/api/V2/statisticalReport'
 //期货采购入库报表
 export const getpurchreceipt = appRx.get(API_GET_PURCHRECEIPT, errorCatcher, errorHandle, filter)
@@ -145,8 +146,10 @@ export const disOrRemarks = appRx.post(API_POST_DISORREMARKS, errorCatcher, erro
 export const saleEditSettlementWeight = appRx.post(API_POST_SALEEDITSETTLEMENTWEIGHT, errorCatcher, errorHandle, filter)
 //现货销售出库合同下拉
 export const getStockSaleContractNoList = appRx.get(API_GET_STOCK_SALE_CONTRACTNO, errorCatcher, errorHandle, filter)
-//反馈重量或开发票
+//反馈重量或开发票
 export const editSettlementWeightStock = appRx.post(API_POST_EDIT_SETTLEMENTWEIGHT, errorCatcher, errorHandle, filter)
+//批量开发票
+export const editinvoice = appRx.post(API_POST_INVOICELIST, errorCatcher, errorHandle, filter)
 
 // 火运,船运合同编号下拉
 export const getYunShuXiaLa = appRx.get(API_GET_YUNSHUXIALA, errorCatcher, errorHandle, filter)

+ 61 - 9
src/views/statisticalReport/stockSaleOutReportList.vue

@@ -10,7 +10,7 @@
           </ws-button>
           <ws-button type="primary" v-hasPermission="`report.goodsSaleOutReport.payment`" @click="handlecollect()">收款
           </ws-button>
-          <ws-button type="primary" v-hasPermission="`report.goodsSaleOutReport.payment`" @click="handleinvoice()">开发票
+          <ws-button type="primary" @click="handleinvoice()">开发票
           </ws-button>
         </el-col>
         <el-col style="text-align: right; line-height: 60px; padding-right: 10px" :span="8">
@@ -330,6 +330,15 @@
       @on-cancel="handleClose">
       <img width="100" height="100" :src="appendixIdss2" alt="">
     </WinseaContentModal>
+    <WinseaContentModal v-model="show" title="批量开发票"
+      @on-cancel="handleClose">
+      <div>本次合计发票金额{{invoicemoney}}元</div>
+       <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible1 = false">取 消</el-button>
+        <el-button  type="primary" @click="invoicesave()">提 交
+        </el-button>
+      </div>
+    </WinseaContentModal>
     <!-- 收款 -->
     <el-dialog width="25%" title="开发票" :visible.sync="dialogFormVisible3" :append-to-body="true">
       <el-form :model="form">
@@ -387,7 +396,8 @@
     stockSaleCollectMoney,
     disOrRemarks,
     saleEditSettlementWeight,
-    editSettlementWeightStock
+    editSettlementWeightStock,
+    editinvoice
   } from '@/model/statisticalReport/index'
   import Pagination from '@/components/Pagination'
   import WsUpload from '@/components/WsUpload'
@@ -423,6 +433,8 @@
         currentPage: 1,
         invoice:'',
         pageSize: 10,
+        invoicemoney:0,
+        show:false,
         allmoney1: 0,
         dialogFormVisible3:false,
         deptCircularPage: {},
@@ -506,6 +518,46 @@
       this.showType = this.isShow
     },
     methods: {
+      invoicesave(){
+        editinvoice({stockSaleReceiptReportList:this.modification}).toPromise()
+              .then((response) => {
+                this.$message({
+                  message: '提交成功',
+                  type: 'success',
+                })
+                this.show=false
+                this.getList(this.orderList.deliverType)
+              }).catch((response) => {
+                this.$message({
+                  message: '提交失败',
+                  type: 'warning',
+                })
+              })
+      },
+      handleinvoice(){
+        if(this.modification.length==0){
+          this.$message({
+            message: '请选择要开发票的条目',
+            type: 'warning',
+          })
+        }else{
+          var num=''
+          for (let i = 0; i < this.modification.length; i++) {
+            if(this.modification[i].status!='全部收款'&&this.modification[i].status!='部分收款'){
+              this.$message({
+                message: '请选择已付款的条目',
+                type: 'warning',
+              })
+              return
+              
+              
+            }
+            num=(Number(this.modification[i].amountEdReceivable)-Number(this.modification[i].alreadyInvoice))+Number(num)
+          }
+          this.invoicemoney=num
+          this.show=true
+        }
+      },
       invoiceedit(item){
         this.activeinvoice=item.amountEdReceivable-item.alreadyInvoice
         this.id=item.id
@@ -514,16 +566,16 @@
       Invoicing(){
         editSettlementWeightStock({flag:3,alreadyInvoice:invoice,id:item.id}).toPromise()
               .then((response) => {
-                  this.$notify.success({
-                  title: '成功',
+                this.$message({
                   message: '提交成功',
+                  type: 'success',
                 })
                 this.dialogFormVisible3=false
                 this.getList(this.orderList.deliverType)
               }).catch((response) => {
-                  this.$notify.warning({
-                  title: '失败',
+                this.$message({
                   message: '提交失败',
+                  type: 'warning',
                 })
               })
         
@@ -950,10 +1002,10 @@
           for (let i = 0; i < this.modification.length; i++) {
             this.uncollectedAmount1 += Number(this.modification[i].amountNotReceivable)
           }
-          this.uncollectedAmount1 = this.uncollectedAmount1.toFixed(3)
+          this.uncollectedAmount1 = this.uncollectedAmount1.toFixed(2)
           this.amountEdReceivable = this.saleList.records[0].amountEdReceivable
           this.amountNotReceivable = this.saleList.records[0].amountNotReceivable
-          this.stockSaleReceiptReportList = this.saleList.records
+          this.stockSaleReceiptReportList = this.modification
           this.dialogFormVisible1 = true
         } else {
           this.$message({
@@ -1379,7 +1431,7 @@
 
   .content {
     box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
-    background: #E8ECF6;
+    // background: #E8ECF6;
   }
 
   .content1 {