Browse Source

现货销售出库报表 修改已开发票

achao 3 years ago
parent
commit
ef15e0d9c6
1 changed files with 149 additions and 141 deletions
  1. 149 141
      src/views/statisticalReport/stockSaleOutReportList.vue

+ 149 - 141
src/views/statisticalReport/stockSaleOutReportList.vue

@@ -14,17 +14,18 @@
           </ws-button>
         </el-col>
         <el-col style="text-align: right; line-height: 60px;  width:400px" :span="8">
-        <el-date-picker style="margin: 0 10px 0 0" value-format='yyyy-MM-dd' v-model="value2" @change='datechange'
-          type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="起始时间"
-          end-placeholder="截止时间">
-        </el-date-picker></el-col>
+          <el-date-picker style="margin: 0 10px 0 0" value-format='yyyy-MM-dd' v-model="value2" @change='datechange'
+            type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="起始时间"
+            end-placeholder="截止时间">
+          </el-date-picker>
+        </el-col>
         <el-col style="text-align: right; line-height: 60px; padding-right: 10px" :span="8">
           <el-select v-model="contractNo" placeholder="请选择合同" clearable filterable @change="contractchange"
             maxlength="500" type="input" class="findValue">
-            <el-option  v-for="item in options" v-if="item.reportStatus" :key="item.constKey"
+            <el-option v-for="item in options" v-if="item.reportStatus" :key="item.constKey"
               :label="item.contractNo + '(' + item.reportStatus + ')'" :value="item.contractNo" />
-            <el-option  v-for="item in options" v-if="!item.reportStatus" :key="item.constKey"
-							:label="item.contractNo" :value="item.contractNo" />
+            <el-option v-for="item in options" v-if="!item.reportStatus" :key="item.constKey" :label="item.contractNo"
+              :value="item.contractNo" />
           </el-select>
         </el-col>
       </el-row>
@@ -46,7 +47,8 @@
             <span v-else>合同重量: 0 吨</span>
             <span v-if="outboundVolume">出库量: {{ outboundVolume.toFixed(3)}} 吨</span>
             <span v-else>出库量: 0 吨</span>
-            <span v-if="orderList.unitContractPrice&&this.tranType!='随行就市'">合同单价: {{ orderList.unitContractPrice.toFixed(3) }} 元/吨</span>
+            <span v-if="orderList.unitContractPrice&&this.tranType!='随行就市'">合同单价:
+              {{ orderList.unitContractPrice.toFixed(3) }} 元/吨</span>
             <span v-else>合同单价: 0 元/吨</span>
             <span v-if="amountReceivable">应收: {{ amountReceivable.toFixed(3)}} 元</span>
             <span v-else>应收: 0 元</span>
@@ -107,8 +109,8 @@
           v-if="this.tranType=='汽运'||this.tranType=='火运'"></el-table-column>
         <el-table-column v-else-if="this.tranType=='散船'||this.tranType=='箱船'" class="table_td" prop="unloadingWeight"
           label="卸船净重(吨)"></el-table-column>
-          <el-table-column width='120' class="table_td" prop="feedbackWeight" label="反馈重量(吨)">
-            <template slot-scope="scope">
+        <el-table-column width='120' class="table_td" prop="feedbackWeight" label="反馈重量(吨)">
+          <template slot-scope="scope">
             <div class="inputChenge">
               <el-input v-model="scope.row.feedbackWeight" v-if="scope.row.identification2 == 'true'">
               </el-input>
@@ -125,10 +127,10 @@
             <i class="el-icon-check" style="line-height: 29px; margin-left: 10px"
               v-if="scope.row.identification2 == 'true'" @click="weightsave(scope.row,4)"></i>
           </template>
-          </el-table-column>
+        </el-table-column>
         <el-table-column width='120' class="table_td" prop="settlementWeight" label="结算重量(吨)"></el-table-column>
         <el-table-column class="table_td" prop="settlementPrice" width='130' label="结算单价(元/吨)">
-        <template slot-scope="scope">
+          <template slot-scope="scope">
             <div class="inputChenge">
               <el-input v-model="scope.row.settlementPrice" v-if="scope.row.identification1 == 'true'">
               </el-input>
@@ -144,21 +146,21 @@
 
             <i class="el-icon-check" style="line-height: 29px; margin-left: 10px"
               v-if="scope.row.identification1 == 'true'" @click="weightClick(scope.row,2)"></i>
-          </template></el-table-column>
+          </template>
+        </el-table-column>
         <el-table-column width='120' class="table_td" prop="amountIngReceivable" label="应收金额(元)"></el-table-column>
         <el-table-column width='120' class="table_td" prop="amountEdReceivable" label="已收金额(元)">
         </el-table-column>
-        <el-table-column  width='120' class="table_td" prop="alreadyInvoice" label=" 已开发票(元)">
-           <template slot-scope="scope">
+        <el-table-column width='120' class="table_td" prop="alreadyInvoice" label=" 已开发票(元)">
+          <template slot-scope="scope">
             <div class="inputChenge">
               <div class="inputs">
                 <span>{{scope.row.alreadyInvoice}}</span>
               </div>
             </div>
             <div style='display:inline-block;'>
-              <img  width="17" height="18"
-                style="vertical-align: text-top; position: relative; top: -1px" src="../../../public/img/edit.png"
-                @click="invoiceedit(scope.row)" alt="" />
+              <img width="17" height="18" style="vertical-align: text-top; position: relative; top: -1px"
+                src="../../../public/img/edit.png" @click="invoiceedit(scope.row)" alt="" />
             </div>
           </template>
         </el-table-column>
@@ -221,9 +223,8 @@
               </div>
             </div>
             <div style='display:inline-block;' v-if="scope.row.identification2 == 'false'">
-              <img  width="17" height="18"
-                style="vertical-align: text-top; position: relative; top: -1px" src="../../../public/img/edit.png"
-                @click="weightedit(scope.row)" alt="" />
+              <img width="17" height="18" style="vertical-align: text-top; position: relative; top: -1px"
+                src="../../../public/img/edit.png" @click="weightedit(scope.row)" alt="" />
             </div>
 
             <i class="el-icon-check" style="line-height: 29px; margin-left: 10px"
@@ -231,7 +232,7 @@
           </template>
         </el-table-column>
         <el-table-column class="table_td" prop="settlementPrice" width='130' label="结算单价(元/吨)">
-        <template slot-scope="scope">
+          <template slot-scope="scope">
             <div class="inputChenge">
               <el-input v-model="scope.row.settlementPrice" v-if="scope.row.identification1 == 'true'">
               </el-input>
@@ -247,7 +248,8 @@
 
             <i class="el-icon-check" style="line-height: 29px; margin-left: 10px"
               v-if="scope.row.identification1 == 'true'" @click="weightClick(scope.row,2)"></i>
-          </template></el-table-column>
+          </template>
+        </el-table-column>
         <el-table-column class="table_td" prop="amountIngReceivable" label="应收金额(元)">
           <template slot-scope="scope">
             <span v-if="scope.row.returnFlag == null">{{scope.row.amountIngReceivable.toFixed(2) }}</span>
@@ -263,17 +265,16 @@
             <span v-if="scope.row.returnFlag == null">{{scope.row.amountNotReceivable.toFixed(2) }}</span>
           </template>
         </el-table-column>
-        <el-table-column  width='120' class="table_td" prop="alreadyInvoice" label=" 已开发票(元)">
-           <template slot-scope="scope">
+        <el-table-column width='120' class="table_td" prop="alreadyInvoice" label=" 已开发票(元)">
+          <template slot-scope="scope">
             <div class="inputChenge">
               <div class="inputs">
                 <span>{{scope.row.alreadyInvoice}}</span>
               </div>
             </div>
             <div style='display:inline-block;'>
-              <img  width="17" height="18"
-                style="vertical-align: text-top; position: relative; top: -1px" src="../../../public/img/edit.png"
-                @click="invoiceedit(scope.row)" alt="" />
+              <img width="17" height="18" style="vertical-align: text-top; position: relative; top: -1px"
+                src="../../../public/img/edit.png" @click="invoiceedit(scope.row)" alt="" />
             </div>
           </template>
         </el-table-column>
@@ -335,12 +336,11 @@
       @on-cancel="handleClose">
       <img width="100" height="100" :src="appendixIdss2" alt="">
     </WinseaContentModal>
-    <WinseaContentModal v-model="show" title="批量开发票"
-      @on-cancel="handleClose">
+    <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()">提 交
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="show = false">取 消</el-button>
+        <el-button type="primary" @click="invoicesave()">提 交
         </el-button>
       </div>
     </WinseaContentModal>
@@ -356,7 +356,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="dialogFormVisible3 = false">取 消</el-button>
-        <el-button  type="primary" @click="Invoicing()">提 交
+        <el-button type="primary" @click="Invoicing()">提 交
         </el-button>
       </div>
     </el-dialog>
@@ -436,14 +436,14 @@
         deptBudgetList: {},
         //分页
         currentPage: 1,
-        invoice:'',
+        invoice: '',
         pageSize: 10,
-        invoicemoney:0,
-        show:false,
+        invoicemoney: 0,
+        show: false,
         allmoney1: 0,
-        dialogFormVisible3:false,
+        dialogFormVisible3: false,
         deptCircularPage: {},
-        identification2:false,
+        identification2: false,
         deptBudgetTotal: 0,
         uncollectedAmount1: 0,
         stockSaleReceiptReportList: [],
@@ -465,7 +465,7 @@
         contractNo: '',
         dialogVisible: false,
         form: {},
-        id:0,
+        id: 0,
         compId: localStorage.getItem('ws-pf_compId'),
         collectForm: false,
         collectForm1: false,
@@ -504,7 +504,7 @@
         modification: [],
         accessoryTFs: false,
         appendixIdss: [],
-        activeinvoice:0,
+        activeinvoice: 0,
         accessoryTFs1: false,
         appendixIdss1: [],
         appendixIdss2: '',
@@ -526,93 +526,101 @@
       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',
-                })
-              })
+      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',
+            })
+          })
       },
       datechange() {
-        if(this.value2){
-        this.startDate = this.value2[0]
-        this.endDate = this.value2[1]
-        }
-        else{
+        if (this.value2) {
+          this.startDate = this.value2[0]
+          this.endDate = this.value2[1]
+        } else {
           this.startDate = ''
           this.endDate = ''
         }
         this.getList()
       },
 
-      handleinvoice(){
-        if(this.modification.length==0){
+      handleinvoice() {
+        if (this.modification.length == 0) {
           this.$message({
             message: '请选择要开发票的条目',
             type: 'warning',
           })
-        }else{
-          var num=''
+        } else {
+          var num = ''
           for (let i = 0; i < this.modification.length; i++) {
-            if(this.modification[i].status!='全部收款'&&this.modification[i].status!='部分收款'){
+            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)
+            num = (Number(this.modification[i].amountEdReceivable) - Number(this.modification[i].alreadyInvoice)) +
+              Number(num)
           }
-          this.invoicemoney=num
-          this.show=true
+          this.invoicemoney = num
+          this.show = true
         }
       },
-      invoiceedit(item){
-        this.activeinvoice=item.amountEdReceivable-item.alreadyInvoice
-        this.id=item.id
-        this.dialogFormVisible3=true
+      invoiceedit(item) {
+        this.activeinvoice = item.amountEdReceivable - item.alreadyInvoice
+        this.id = item.id
+        this.dialogFormVisible3 = true
       },
-      Invoicing(){
-        editSettlementWeightStock({flag:3,alreadyInvoice:invoice,id:item.id}).toPromise()
-              .then((response) => {
-                this.$message({
-                  message: '提交成功',
-                  type: 'success',
-                })
-                this.dialogFormVisible3=false
-                this.getList(this.orderList.deliverType)
-              }).catch((response) => {
-                this.$message({
-                  message: '提交失败',
-                  type: 'warning',
-                })
-              })
+      Invoicing() {
+        editSettlementWeightStock({
+            flag: 3,
+            alreadyInvoice: this.invoice,
+            id: this.id
+          }).toPromise()
+          .then((response) => {
+            this.$message({
+              message: '提交成功',
+              type: 'success',
+            })
+            this.dialogFormVisible3 = false
+            this.getList(this.orderList.deliverType)
+          }).catch((response) => {
+            this.$message({
+              message: '提交失败',
+              type: 'warning',
+            })
+          })
 
       },
-      weightedit(item){
-        item.identification2='true'
+      weightedit(item) {
+        item.identification2 = 'true'
       },
-      weightsave(item,flag){
-        editSettlementWeightStock({flag:flag,feedbackWeight:item.feedbackWeight,id:item.id}).toPromise()
-              .then((response) => {
-                  this.$notify.success({
-                  title: '成功',
-                  message: '修改重量修改成功',
-                })
-                item.identification2=false
-                this.getList(this.orderList.deliverType)
-              })
+      weightsave(item, flag) {
+        editSettlementWeightStock({
+            flag: flag,
+            feedbackWeight: item.feedbackWeight,
+            id: item.id
+          }).toPromise()
+          .then((response) => {
+            this.$notify.success({
+              title: '成功',
+              message: '修改重量修改成功',
+            })
+            item.identification2 = false
+            this.getList(this.orderList.deliverType)
+          })
       },
       tableRowClassName({
         row,
@@ -651,19 +659,19 @@
         for (var i = 0; i < this.contractNoList.length; i++) {
           if (this.contractNoList[i].contractNo == e) {
             this.orderList = this.contractNoList[i]
-            if(this.orderList.tranTaskInfoList){
+            if (this.orderList.tranTaskInfoList) {
               for (let i = 0; i < this.orderList.tranTaskInfoList.length; i++) {
-              if (this.orderList.tranTaskInfoList[i].tranProcessInfo) {
-                this.tranProcessInfo.push({
-                  label: this.orderList.tranTaskInfoList[i].taskNo + '(' + this.orderList.tranTaskInfoList[i]
-                    .tranProcessInfo.tranType + ')',
-                  name: this.orderList.tranTaskInfoList[i].tranProcessInfo.processNo,
-                  tranType: this.orderList.tranTaskInfoList[i].tranProcessInfo.tranType
-                })
+                if (this.orderList.tranTaskInfoList[i].tranProcessInfo) {
+                  this.tranProcessInfo.push({
+                    label: this.orderList.tranTaskInfoList[i].taskNo + '(' + this.orderList.tranTaskInfoList[i]
+                      .tranProcessInfo.tranType + ')',
+                    name: this.orderList.tranTaskInfoList[i].tranProcessInfo.processNo,
+                    tranType: this.orderList.tranTaskInfoList[i].tranProcessInfo.tranType
+                  })
+                }
               }
-            }
-            this.activeName = this.tranProcessInfo[0].name
-            this.tranType = this.tranProcessInfo[0].tranType
+              this.activeName = this.tranProcessInfo[0].name
+              this.tranType = this.tranProcessInfo[0].tranType
             }
 
 
@@ -697,15 +705,15 @@
         }
       },
       //修改结算重量
-      whether(row,flag) {
-        if(flag==1){
+      whether(row, flag) {
+        if (flag == 1) {
           row.identification = 'true'
-        }else{
+        } else {
           row.identification1 = 'true'
         }
 
       },
-      weightClick(row,flag) {
+      weightClick(row, flag) {
         if (
           row.settlementWeight > 200 ||
           row.settlementWeight < 1 ||
@@ -725,22 +733,22 @@
           })
           return
         }
-        var title=''
-        var data={}
-        if(flag==1){
-          title='确定要修改结算重量?'
-          data={
-                settlementWeight: row.settlementWeight,
-                id: row.id,
-                flag:flag
-              }
-        }else{
-          title='确定要修改结算单价?'
-          data={
-                settlementPrice: row.settlementPrice,
-                id: row.id,
-                flag:flag
-              }
+        var title = ''
+        var data = {}
+        if (flag == 1) {
+          title = '确定要修改结算重量?'
+          data = {
+            settlementWeight: row.settlementWeight,
+            id: row.id,
+            flag: flag
+          }
+        } else {
+          title = '确定要修改结算单价?'
+          data = {
+            settlementPrice: row.settlementPrice,
+            id: row.id,
+            flag: flag
+          }
         }
         this.$confirm(title, {
             confirmButtonText: '确定',
@@ -751,16 +759,16 @@
             saleEditSettlementWeight(data)
               .toPromise()
               .then((response) => {
-                if(flag==1){
+                if (flag == 1) {
                   this.$notify.success({
-                  title: '成功',
-                  message: '结算重量修改成功',
-                })
-                }else{
+                    title: '成功',
+                    message: '结算重量修改成功',
+                  })
+                } else {
                   this.$notify.success({
-                  title: '成功',
-                  message: '结算单价修改成功',
-                })
+                    title: '成功',
+                    message: '结算单价修改成功',
+                  })
                 }
 
                 this.getList(this.orderList.deliverType)