Browse Source

修改bug

Qukatie 1 year ago
parent
commit
ed427899c0

+ 10 - 0
src/api/financialManagement/paymentRequest.js

@@ -111,6 +111,16 @@ export const paymentApply = (data) => {
   })
 }
 
+// 销售订单到账单明细
+export const generateBills = (data) => {
+  return request({
+    url: '/api/blade-purchase-sales/order/generateBills',
+    method: 'get',
+    params: data
+  })
+}
+
+
 // 查询客户银行list
 export const getlistBankBy = (corpsId) => {
   return request({

+ 16 - 1
src/components/fee-info/config/feeInfo.json

@@ -102,9 +102,24 @@
         "width": 150
     },
     {
+        "label": "是否生成账单",
+        "prop": "whetherGenerateBills",
+        "type": "select",
+        "index": 12,
+        "overHidden": true,
+        "dicData": [{
+            "label": "否",
+            "value": 0
+          }, {
+            "label": "是",
+            "value": 1
+          }],
+        "width": 150
+    },
+    {
         "label": "备注",
         "prop": "remarks",
-        "index": 12,
+        "index": 13,
         "cell": true,
         "overHidden": true,
         "width": 150

+ 38 - 12
src/components/fee-info/main.vue

@@ -12,9 +12,8 @@
           </el-tabs>
           <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="rowAdd" :loading="buttonLoading"
             :disabled="disabled">录入明细</el-button>
-          <!--<el-button type="warning" size="small" @click.stop="billingDetails('收费')" :loading="buttonLoading" :disabled="-->
-          <!--  (financeDisabled && disabled) || selectionList.length == 0-->
-          <!--" v-if="selectTab === 1&&billingShow">生成账单</el-button>-->
+          <el-button type="warning" size="small" @click.stop="billingDetails('收费')" :loading="buttonLoading" :disabled="(financeDisabled && disabled) || selectionList.length == 0
+            " v-if="selectTab === 1 && billingShow">生成账单</el-button>
           <el-button type="warning" size="small" @click.stop="billingDetails('申请')" :loading="buttonLoading" :disabled="(financeDisabled && disabled) || selectionList.length == 0
             " v-if="selectTab === 2 && billingShow">申请付费</el-button>
         </template>
@@ -50,24 +49,29 @@
         </template>
         <template slot="price" slot-scope="{ row,index }">
           <el-input-number v-if="row.$cellEdit" v-model="row.price" placeholder="请输入" size="small" :controls="false"
-            :precision="2" @input="countChange(row)" style="width: 100%" :min="paramValue==0?0:'-Infinity'"></el-input-number>
+            :precision="2" @input="countChange(row)" style="width: 100%"
+            :min="paramValue == 0 ? 0 : '-Infinity'"></el-input-number>
           <span v-else>{{ row.price | micrometerFormat2 }}</span>
         </template>
         <template slot="quantity" slot-scope="{ row }">
           <el-input-number v-if="row.$cellEdit && !isDecimal" v-model="row.quantity" size="small" placeholder="请输入"
-            :controls="false" :precision="0" @input="countChange(row)" style="width: 100%" :min="paramValue==0?0:'-Infinity'"></el-input-number>
+            :controls="false" :precision="0" @input="countChange(row)" style="width: 100%"
+            :min="paramValue == 0 ? 0 : '-Infinity'"></el-input-number>
           <el-input-number v-if="row.$cellEdit && isDecimal" v-model="row.quantity" size="small" placeholder="请输入"
-            :controls="false" :precision="6" @input="countChange(row)" style="width: 100%" :min="paramValue==0?0:'-Infinity'"></el-input-number>
+            :controls="false" :precision="6" @input="countChange(row)" style="width: 100%"
+            :min="paramValue == 0 ? 0 : '-Infinity'"></el-input-number>
           <span v-else>{{ row.quantity | decimalFormat2 }}</span>
         </template>
         <template slot="amount" slot-scope="{ row }">
-          <el-input-number v-if="row.$cellEdit" v-model="row.amount" size="small" placeholder="请输入"
-            :controls="false" :precision="2" @input="countChange(row)" style="width: 100%" :min="paramValue==0?0:'-Infinity'"></el-input-number>
+          <el-input-number v-if="row.$cellEdit" v-model="row.amount" size="small" placeholder="请输入" :controls="false"
+            :precision="2" @input="countChange(row)" style="width: 100%"
+            :min="paramValue == 0 ? 0 : '-Infinity'"></el-input-number>
           <span v-else>{{ row.amount | micrometerFormat2 }}</span>
         </template>
         <template slot="exchangeRate" slot-scope="{ row }">
           <el-input-number v-if="row.$cellEdit" v-model="row.exchangeRate" size="small" :controls="false" :precision="6"
-            @change="rateChange(row)" style="width: 100%" placeholder="请输入" :min="paramValue==0?0:'-Infinity'"></el-input-number>
+            @change="rateChange(row)" style="width: 100%" placeholder="请输入"
+            :min="paramValue == 0 ? 0 : '-Infinity'"></el-input-number>
           <span v-else>{{ row.exchangeRate }}</span>
         </template>
         <template slot="currency" slot-scope="{ row }">
@@ -137,7 +141,7 @@ import _ from "lodash";
 import ApplyPayment from "../finance/applyPayment";
 import {
   applyLoan,
-  paymentApply
+  generateBills
 } from "@/api/financialManagement/paymentRequest";
 import { contrastList } from "@/util/contrastData";
 import { allCropList, paramserviceDetail } from "@/api/basicData/customerInformation";
@@ -822,12 +826,34 @@ export default {
               cancelButtonText: "取消",
               type: "warning"
             }).then(() => {
+              let obj = {}
+              let id = null
+              let itemIds = []
+              for(let i=0;i<this.selectionList.length;i++){
+                // if()
+                if(i==0){
+                  id = this.selectionList[i].pid
+                }
+                itemIds.push(this.selectionList[i].id)
+              }
+              // this.selectionList.forEach(e => {
+              //   id = e.pid
+              //   itemIds.push(e.id)
+              // })
+              if (!id) {
+                return this.$message.error("请保存费用明细在操作");
+              }
+              obj = {
+                billId: id,
+                ids: itemIds.join(',')
+              }
+              
               this.buttonLoading = true;
-              paymentApply(data)
-                .then(res => {
+              generateBills(obj).then(res => {
                   if (res.data.success) {
                     this.$message.success("操作成功!");
                     this.$emit("afterFinance");
+                    this.$emit('retrieve')
                   }
                 })
                 .finally(() => {

+ 1 - 1
src/util/calculate.js

@@ -98,7 +98,7 @@ export function sellingCal(num, num2,num3) {
   const product = Number(num ? num : 0)
   //汇率
   const exchangeRate = Number(Number(num2) ? num2 : 1)
-  const val3 = Number(num3 ? num3 : 2)
+  const val3 = Number(num3 ? num3 : 3)
   const sum = _.divide(product, exchangeRate)
   return Number(sum).toFixed(val3)
 }

+ 51 - 50
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -303,7 +303,7 @@
       </trade-card> -->
       <fee-info ref="feeInfo" :tabShow="1" :orderFeesList="orderFeesList" :disabled="detailData.status == 1"
         feeUrl="/blade-purchase-sales/orderfees/update" optionType="CK" itemType="报价" @beforeFinance="beforeFinance"
-        :inCropId="true" @oceanUSD="oceanUSD"/>
+        @retrieve="retrieve" :inCropId="true" @oceanUSD="oceanUSD" />
       <containerTitle title="合同附件">
 
       </containerTitle>
@@ -520,27 +520,27 @@ export default {
             ]
           },
           {
-          label: "采购员",
-          prop: "buyerId",
-          span: 6,
-          overHidden: true,
-          filterable: true,
-          remote: true,
-          type: "select",
-          dicUrl: "/api/blade-user/page?size=20&current=1&realName={{key}}",
-          props: {
-            label: "realName",
-            value: "id",
-            res: 'data.records'
+            label: "采购员",
+            prop: "buyerId",
+            span: 6,
+            overHidden: true,
+            filterable: true,
+            remote: true,
+            type: "select",
+            dicUrl: "/api/blade-user/page?size=20&current=1&realName={{key}}",
+            props: {
+              label: "realName",
+              value: "id",
+              res: 'data.records'
+            },
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ]
           },
-          rules: [
-            {
-              required: true,
-              message: "",
-              trigger: "blur"
-            }
-          ]
-        },
           {
             label: "起运港",
             prop: "portOfLoad",
@@ -1048,10 +1048,10 @@ export default {
     formGoodstoFees(rows, type) {
       this.$refs.feeInfo.imporData(rows, type)
     },
-    retrieve(){
-      this.getDetail(this.detailData.id);
+    retrieve() {
+      this.getDetail(this.form.id);
     },
-    oceanUSD(){
+    oceanUSD() {
       console.log(1111)
     },
     khEdit(staus) {
@@ -1180,25 +1180,25 @@ export default {
           //   this.form.exchangeRate
           // );
           e.price = addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount)
-            e.amount = amountCal(
-                addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount),
-                e.orderQuantity,
-                e.freight,
-                e.insurance,
-                e.discount
-            );
-            e.itemMargin = grossProfitCal(
-                e.purchaseAmount,
-                e.partsPrice,
-                e.outFactoryPrice,
-                this.form.exchangeRate
-            );
-            e.goodsGrossProfit = goodsGrossProfitCal(
-                e.purchaseAmount,
-                e.partsPrice,
-                e.outFactoryPrice,
-                this.form.exchangeRate
-            );
+          e.amount = amountCal(
+            addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount),
+            e.orderQuantity,
+            e.freight,
+            e.insurance,
+            e.discount
+          );
+          e.itemMargin = grossProfitCal(
+            e.purchaseAmount,
+            e.partsPrice,
+            e.outFactoryPrice,
+            this.form.exchangeRate
+          );
+          e.goodsGrossProfit = goodsGrossProfitCal(
+            e.purchaseAmount,
+            e.partsPrice,
+            e.outFactoryPrice,
+            this.form.exchangeRate
+          );
         });
       }
     },
@@ -1909,7 +1909,7 @@ export default {
       }
       this.data.push({ $cellEdit: true });
     },
-    oceanUSD(){
+    oceanUSD() {
       this.$refs.feeInfo.oceanUSD()
     },
     getDetail(id) {
@@ -2031,6 +2031,7 @@ export default {
                   numCal(this.data[i].exchangeRate)
                 )
               );
+
               costSum = _.add(
                 costSum,
                 _.multiply(
@@ -2078,12 +2079,12 @@ export default {
               );
             }
           }
-          this.form.singleTicketMargin = STGPCal(
-            amountSum,
-            reSum,
-            costSum,
-            paySum
-          );
+          // this.form.singleTicketMargin = STGPCal(
+          //   amountSum,
+          //   reSum,
+          //   costSum,
+          //   paySum
+          // );
           this.form.totalValue = 0
           this.data.forEach((e, index) => {
             e.sort = Number(index) + 1

+ 1 - 1
src/views/exportTrade/salesContract/detailsPage.vue

@@ -1391,7 +1391,7 @@ export default {
   },
   methods: {
     retrieve(){
-      this.getDetail(this.detailData.id);
+      this.getDetail(this.form.id);
     },
     // 获取运输方式数据
     getDictionaryfun() {

+ 5 - 5
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -540,11 +540,11 @@ export default {
                     },
                     dicUrl: "/api/blade-user/salerList",
                     filterable: true,
-                    rules: [{
-                        required: true,
-                        message: " ",
-                        trigger: "blur"
-                    }]
+                    // rules: [{
+                    //     required: true,
+                    //     message: " ",
+                    //     trigger: "blur"
+                    // }]
                 }, {
                     label: '仓库',
                     prop: "storageId",