Selaa lähdekoodia

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-eom into dev

yusheng 1 päivä sitten
vanhempi
commit
85ab4e6a20
21 muutettua tiedostoa jossa 1396 lisäystä ja 157 poistoa
  1. 12 9
      src/BIZComponents/paymentCollectionPlan/Index.vue
  2. 8 1
      src/api/financialManage/payableManage/index.js
  3. 9 0
      src/api/financialManage/receivableManage/index.js
  4. 2 2
      src/api/saleManage/saleordersendrecord.js
  5. 1 1
      src/utils/util.js
  6. 50 41
      src/views/contractManage/contractBook/components/addDialog.vue
  7. 48 14
      src/views/financialManage/invoiceManage/components/addOrEditDialogNew.vue
  8. 39 34
      src/views/financialManage/invoiceManage/components/tableInfoNew.vue
  9. 541 0
      src/views/financialManage/paidManagement/index.vue
  10. 11 2
      src/views/financialManage/payableManage/components/infoTable.vue
  11. 9 2
      src/views/financialManage/payableManage/components/paymentDialog.vue
  12. 7 0
      src/views/financialManage/payableManage/index.vue
  13. 8 2
      src/views/financialManage/receivableManage/components/collectionDialog.vue
  14. 11 2
      src/views/financialManage/receivableManage/components/infoTable.vue
  15. 7 0
      src/views/financialManage/receivableManage/index.vue
  16. 561 0
      src/views/financialManage/receivedManaged/index.vue
  17. 25 20
      src/views/purchasingManage/purchaseOrder/components/addDialogNew.vue
  18. 31 24
      src/views/saleManage/saleOrder/components/addDialogNew.vue
  19. 4 3
      src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue
  20. 6 0
      src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue
  21. 6 0
      src/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue

+ 12 - 9
src/BIZComponents/paymentCollectionPlan/Index.vue

@@ -93,9 +93,7 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.ratio'"
           :rules="{
-            required: true,
-            pattern: numberReg,
-            message: '请输入正确的比例',
+            required: false,
             trigger: 'change'
           }"
         >
@@ -148,7 +146,7 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.price'"
           :rules="{
-            required: true,
+            required: false,
             pattern: numberReg,
             message: '请输入正确的金额',
             trigger: 'change'
@@ -289,7 +287,7 @@
             prop: 'issueNumber',
             label: '期数',
             slot: 'issueNumber',
-            headerSlot: 'headerIssueNumber',
+            // headerSlot: 'headerIssueNumber',
             align: 'center'
           },
           {
@@ -313,7 +311,7 @@
             prop: 'ratio',
             label: '比例',
             slot: 'ratio',
-            headerSlot: 'headerRatio',
+            // headerSlot: 'headerRatio',
             align: 'center'
           },
           {
@@ -322,7 +320,7 @@
             label: this.menu === 'purchase' ? '计划付款金额' : '计划收款金额',
             slot: 'price',
             align: 'center',
-            headerSlot: 'headerPrice',
+            // headerSlot: 'headerPrice',
           },
 
           {
@@ -588,8 +586,8 @@
               item.issueNumber = i + 1;
             } else {
               item.moneyName = '';
-              item.type = '';
-              item.typeName = '';
+              item.type = 2;
+              item.typeName = '交货款';
               item.ratio = '';
               item.key = i + 1;
               item.issueNumber = i + 1;
@@ -703,6 +701,9 @@
           item.deadLine = deadLine;
           // item.ratio = ratio;
 
+          item.type = 2;
+          item.typeName = '交货款';
+
           tempList.push(item);
           // totalRatio += ratio;
         }
@@ -732,6 +733,8 @@
         let item = JSON.parse(JSON.stringify(this.defaultForm));
         item.key = this.form.datasource.length + 1;
         item.issueNumber = this.form.datasource.length + 1;
+        item.type = 2;
+        item.typeName = '交货款';
         this.form.datasource.push(item);
         this.$emit('getIssueNumber', this.form.datasource.length);
       },

+ 8 - 1
src/api/financialManage/payableManage/index.js

@@ -47,4 +47,11 @@ export async function purchasePayableBill(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
+// 更新付款金额
+export async function finPayableUpdateAmountAPI(id, data) {
+  const res = await request.put(`/eom/finpayable/updateAmount/${id}`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 9 - 0
src/api/financialManage/receivableManage/index.js

@@ -49,3 +49,12 @@ export async function finReceivableRemoveAPI(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 更新应收金额
+export async function finReceivableUpdateAmountAPI(id, data) {
+  const res = await request.put(`/eom/finreceivable/updateAmount/${id}`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 2 - 2
src/api/saleManage/saleordersendrecord.js

@@ -31,9 +31,9 @@ export async function getSendSaleOrderrecordDetail(id) {
 /**
  * 获取信息详情
  */
-export async function getSendSaleOrderrecordDetailSplit(id) {
+export async function getSendSaleOrderrecordDetailSplit(id, isEdit=0) {
   const res = await request.get(
-    `/eom/saleordersendrecord/getByIdSplit/${id}`,
+    `/eom/saleordersendrecord/getByIdSplit/${id}?isEdit=${isEdit}`,
     {}
   );
   if (res.data.code == 0) {

+ 1 - 1
src/utils/util.js

@@ -58,7 +58,7 @@ export function getSummaries(param, key, unit) {
 
     if (key.includes(column.property)) {
       const values = data.map((item) => Number(item[column.property]));
-      console.log(values);
+      // console.log(values);
 
       if (!values.every((value) => isNaN(value))) {
         sums[index] = values.reduce((prev, curr) => {

+ 50 - 41
src/views/contractManage/contractBook/components/addDialog.vue

@@ -1628,7 +1628,9 @@
         if (!obj.id) {
           return;
         }
-        const { base, other } = await contactDetail(obj.id);
+        const { base, other, bankList } = await contactDetail(obj.id);
+
+        console.log('base', base, other);
         this.form = Object.assign({}, this.form, {
           partaId: base.id,
           partaName: base.name,
@@ -1637,6 +1639,8 @@
             : base.addressName + other.address,
           partaLinkId: '',
           partaLinkName: '',
+          partaBank: bankList?.[0]?.accountNo || '',
+          partaBankAccount: bankList?.[0]?.bankName || '',
           // partaEmail: '',
           partaTel: '',
           customerMark: base.serialNo,
@@ -2021,49 +2025,54 @@
             (acc, cur) => acc + +cur.ratio,
             0
           );
-          if (+ratioSum != 100) {
-            this.$message.error('比例合计必须为100%');
-            return;
-          }
+          // if (+ratioSum != 100) {
+          //   this.$message.error('比例合计必须为100%');
+          //   return;
+          // }
 
-          // 使用分进行计算,避免浮点数精度问题
-          let receiptPaymentListSum =
-            commitData.receiptPaymentList.reduce(
-              (acc, cur) => acc + Math.round(+cur.price * 100),
-              0
-            ) / 100;
-          const payAmount = +commitData.payAmount;
-
-          if (+ratioSum == 100) {
-            // 使用分进行计算,避免浮点数精度问题
-            const difference =
-              Math.round((payAmount - receiptPaymentListSum) * 100) / 100;
-            if (
-              Math.abs(difference) >= 0.01 &&
-              commitData.receiptPaymentList.length > 0
-            ) {
-              const lastIndex = commitData.receiptPaymentList.length - 1;
-              // 使用分进行计算,避免浮点数精度问题
-              const newPrice =
-                Math.round(
-                  (+commitData.receiptPaymentList[lastIndex].price +
-                    difference) *
-                    100
-                ) / 100;
-              commitData.receiptPaymentList[lastIndex].price =
-                newPrice.toFixed(2);
-              receiptPaymentListSum =
-                commitData.receiptPaymentList.reduce(
-                  (acc, cur) => acc + Math.round(+cur.price * 100),
-                  0
-                ) / 100;
+          if(+ratioSum > 100){
+              this.$message.error('比例合计不能超过100%');
+              return;
             }
-          }
 
-          if (Math.abs(+receiptPaymentListSum - payAmount) > 0.01) {
-            this.$message.error('计划收款金额合计与优惠后金额不一致');
-            return;
-          }
+          // 使用分进行计算,避免浮点数精度问题
+          // let receiptPaymentListSum =
+          //   commitData.receiptPaymentList.reduce(
+          //     (acc, cur) => acc + Math.round(+cur.price * 100),
+          //     0
+          //   ) / 100;
+          // const payAmount = +commitData.payAmount;
+
+          // if (+ratioSum == 100) {
+          //   // 使用分进行计算,避免浮点数精度问题
+          //   const difference =
+          //     Math.round((payAmount - receiptPaymentListSum) * 100) / 100;
+          //   if (
+          //     Math.abs(difference) >= 0.01 &&
+          //     commitData.receiptPaymentList.length > 0
+          //   ) {
+          //     const lastIndex = commitData.receiptPaymentList.length - 1;
+          //     // 使用分进行计算,避免浮点数精度问题
+          //     const newPrice =
+          //       Math.round(
+          //         (+commitData.receiptPaymentList[lastIndex].price +
+          //           difference) *
+          //           100
+          //       ) / 100;
+          //     commitData.receiptPaymentList[lastIndex].price =
+          //       newPrice.toFixed(2);
+          //     receiptPaymentListSum =
+          //       commitData.receiptPaymentList.reduce(
+          //         (acc, cur) => acc + Math.round(+cur.price * 100),
+          //         0
+          //       ) / 100;
+          //   }
+          // }
+
+          // if (Math.abs(+receiptPaymentListSum - payAmount) > 0.01) {
+          //   this.$message.error('计划收款金额合计与优惠后金额不一致');
+          //   return;
+          // }
 
           // commitData.productList.forEach((item) => {
           //   if (!item.productCode) {

+ 48 - 14
src/views/financialManage/invoiceManage/components/addOrEditDialogNew.vue

@@ -275,7 +275,7 @@
         </el-col>
       </el-row>
     
-      <div style="margin-top: 20px;">
+      <div class="payinfo" style="margin-top: 20px;">
         <headerTitle :title="form.type == 2 ? '付款计划信息' : '收款计划信息'"></headerTitle>
         <!-- <el-form ref="form" :model="tableForm"> -->
           <ele-pro-table
@@ -289,7 +289,23 @@
             <template v-slot:toolbar>
               <!-- <span>已开票金额:{{ totalInvoiceAmount }}</span> -->
             </template>
-            
+            <template v-slot:planPaymentAmount="scope">
+              <el-form-item
+                style="width: 100%;"
+                label-width="0"
+                :prop="'receiptPayments.' + scope.$index + '.planPaymentAmount'"
+                :rules="[
+                  {
+                    required: false,
+                    message: '请输入计划金额',
+                    trigger: 'blur'
+                  }
+                ]"
+              > 
+                <span v-if="dialogType === 'view'">{{ scope.row.planPaymentAmount }}</span>
+                <el-input v-else v-model="scope.row.planPaymentAmount" type="number" @input="updatePlanPaymentAmount(scope.row)"></el-input>
+              </el-form-item>
+            </template>
             <template v-slot:invoiceAmount="scope">
               <el-form-item
                 style="width: 100%;"
@@ -610,6 +626,7 @@
             prop: 'planPaymentAmount',
             label: this.form.type == 1 ? '计划收款金额' : '计划付款金额',
             align: 'center',
+            slot: 'planPaymentAmount'
           },
           {
             width: 150,
@@ -1073,23 +1090,19 @@
         const sameKeyItems = this.form.receiptPayments.filter((d) => d.relatedOrderNo === item.key)
         console.log('sameKeyItems~~~', sameKeyItems);
         
-        // 计算 sum 值(使用 item 的 defaultAmountTotalPrice 或其他适当的字段)
-        // const sum = parseFloat(item.defaultAmountTotalPrice) || 0;
         let remainingTotal = sum;
+        const lastIndex = sameKeyItems.length - 1;
 
-        let totalInvoiceAmount = sum ? JSON.parse(JSON.stringify(sum)) : 0;
-        
-        // 从上到下分配 sum 给相同订单号的数据
-        sameKeyItems.forEach(paymentItem => {
+        // 从上到下分配 sum 给相同订单号的数据,多余数量放在最后一个
+        sameKeyItems.forEach((paymentItem, index) => {
           if (remainingTotal <= 0) {
             paymentItem.invoiceAmount = 0;
+          } else if (index === lastIndex) {
+            // 最后一个分配所有剩余
+            paymentItem.invoiceAmount = remainingTotal.toFixed(2);
           } else {
-            // const unInvoiceAmount = parseFloat(paymentItem.unInvoiceAmount) || 0;
-            // const allocateAmount = Math.min(remainingTotal, unInvoiceAmount);
-            // paymentItem.invoiceAmount = allocateAmount.toFixed(2);
-            // remainingTotal -= allocateAmount;
-            // const unInvoiceAmount = parseFloat(paymentItem.unInvoiceAmount) || 0;
-            const allocateAmount = Math.min(remainingTotal, totalInvoiceAmount);
+            const unInvoiceAmount = parseFloat(paymentItem.unInvoiceAmount) || 0;
+            const allocateAmount = Math.min(remainingTotal, unInvoiceAmount);
             paymentItem.invoiceAmount = allocateAmount.toFixed(2);
             remainingTotal -= allocateAmount;
           }
@@ -1098,6 +1111,24 @@
         console.log('分配完成后的 sameKeyItems:', sameKeyItems);
       },
 
+      updatePlanPaymentAmount(item) {
+        console.log('item~~~', item);
+        item.unInvoiceAmount = item.planPaymentAmount - item.invoicedAmount;
+        // 更新关联物品清单中的 defaultAmountTotalPrice
+        const tableInfoRef = this.$refs.tableInfoRef;
+        if (tableInfoRef && item.relatedOrderNo) {
+          const key = item.relatedOrderNo;
+          const newTotal = this.form.receiptPayments
+            .filter((d) => d.relatedOrderNo === key)
+            .reduce((sum, d) => sum + (parseFloat(d.unInvoiceAmount) || 0), 0);
+          tableInfoRef.tableForm.detailList.forEach((detail) => {
+            if (detail.key === key) {
+              this.$set(detail, 'defaultAmountTotalPrice', newTotal.toFixed(2));
+            }
+          });
+        }
+      },
+
       getValidate() {
         console.log(this.form);
         let arr = [
@@ -1265,4 +1296,7 @@
 .el-form-box .el-table .el-table__row .el-table__cell {
   padding: 10px 0;
 }
+.payinfo .el-form-item {
+  margin-bottom: 0!important;
+}
 </style>

+ 39 - 34
src/views/financialManage/invoiceManage/components/tableInfoNew.vue

@@ -11,39 +11,39 @@
       >
         <template v-slot:toolbar>
           <span>本次开票合计:{{ totalAmountTotalPrice }}</span>
+          <span>订单总额:{{ totalPrice }}</span>
         </template>
         
         <template v-slot:invoiceAmount="scope">
-        <el-form-item
-          style="width: 100%;"
-          :prop="'detailList.' + scope.$index + '.invoiceAmount'"
-          
-        > 
-          <span v-if="dialogType === 'view'"> {{ scope.row.invoiceAmount }}</span>
-          <el-input v-else v-model="scope.row.invoiceAmount" type="number" @input="(val) => invoiceAmountChange(val, scope.row, scope.$index)"></el-input>
-        </el-form-item>
-      </template>
+          <el-form-item
+            style="width: 100%;"
+            :prop="'detailList.' + scope.$index + '.invoiceAmount'"
+          > 
+            <span v-if="dialogType === 'view'"> {{ scope.row.invoiceAmount }}</span>
+            <el-input v-else v-model="scope.row.invoiceAmount" type="number" @input="(val) => invoiceAmountChange(val, scope.row, scope.$index)"></el-input>
+          </el-form-item>
+        </template>
 
-      <!-- :rules="[
-            {
-              required: false,
-              message: '请输入开票金额',
-              trigger: 'blur'
-            },
-            {
-              required: false,
-              validator: (rule, value, callback) => {
-                if (value === undefined || value === null || value === '') {
-                  callback('请输入开票金额');
-                } else if (parseFloat(value) < 0 || parseFloat(value) > scope.row.defaultAmountTotalPrice) {
-                  callback('开票金额不能小于0且小于等于本次开票合计');  
-                } else {
-                  callback();
-                }
+        <!-- :rules="[
+              {
+                required: false,
+                message: '请输入开票金额',
+                trigger: 'blur'
               },
-              trigger: 'blur'
-            }
-          ]" -->
+              {
+                required: false,
+                validator: (rule, value, callback) => {
+                  if (value === undefined || value === null || value === '') {
+                    callback('请输入开票金额');
+                  } else if (parseFloat(value) < 0 || parseFloat(value) > scope.row.defaultAmountTotalPrice) {
+                    callback('开票金额不能小于0且小于等于本次开票合计');  
+                  } else {
+                    callback();
+                  }
+                },
+                trigger: 'blur'
+              }
+            ]" -->
 
       <template v-slot:taxRate="scope">
         <el-form-item
@@ -334,6 +334,11 @@
           return total + (parseFloat(item.invoiceAmount) || 0);
         }, 0);
         return tempTotal.toFixed(2);
+      },
+      totalPrice() {
+        return this.tableForm.detailList.reduce((total, item) => {
+          return total + (parseFloat(item.discountAmount) || 0);
+        }, 0);
       }
     },
     mounted() {
@@ -404,13 +409,13 @@
           // if (val && +val > +item.unInvoiceAmount) {
           //   this.$message.warning('物品开票金额不能大于未开票金额');
           //   this.$set(item, 'invoiceAmount', '');
-          //   return;
-          // }
-          // if (sum > item.defaultAmountTotalPrice) {
-          //   this.$message.warning('物品开票金额不能大于本次开票合计');
-          //   this.$set(item, 'invoiceAmount', '');
-          //   return;
+          //   // return;
           // }
+          if (sum > item.defaultAmountTotalPrice) {
+            this.$message.warning('物品开票金额不能大于本次开票合计');
+            // this.$set(item, 'invoiceAmount', '');
+            // return;
+          }
           this.$set(item, 'invoiceAmount', val);
           const amountTotalPrice = this.fromPrecision(sum);
           const targetItems = this.tableForm.detailList.filter(d => d.key === key);

+ 541 - 0
src/views/financialManage/paidManagement/index.vue

@@ -0,0 +1,541 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <search-table @search="reload"></search-table>
+      <!-- 数据表格 -->
+      <div>
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 375px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :selection.sync="selection"
+          :page-size="20"
+          @columns-change="handleColumnChange"
+          :cache-key="cacheKeyUrl"
+          show-summary
+          :summary-method="getSummaries"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <!-- <el-button
+              v-if="$hasPermission('eom:finpayable:push')"
+              size="small"
+              type="primary"
+              class="ele-btn-icon"
+              @click="allPushBtn"
+              :disabled="selection?.length === 0"
+            >
+              批量推送
+            </el-button> -->
+          </template>
+          <!-- 操作 -->
+          <template v-slot:action="{ row }">
+            <el-link
+              type="primary"
+              v-if="canAddInvoice(row)"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="openEdit(row)"
+            >
+              新增发票
+            </el-link>
+            <el-link
+              type="primary"
+              v-if="[2].includes(row.approvalStatus)"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="handleCollection(row, 'update')"
+            >
+              付款
+            </el-link>
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="sub(row)"
+              v-if="[0, 3].includes(row.approvalStatus)"
+            >
+              提交
+            </el-link>
+          </template>
+          <!-- 收款信息 -->
+          <template v-slot:code="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="handleDetail(row, 'view')"
+            >
+              {{ row.code }}
+            </el-link>
+          </template>
+          <!-- 开票信息 -->
+          <template v-slot:invoiceCode="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="handleInvoiceDetail(row, 'view')"
+            >
+              {{ row.invoiceCode }}
+            </el-link>
+          </template>
+        </ele-pro-table>
+      </div>
+    </el-card>
+    <!--    付款信息-->
+    <payment-dialog
+      ref="collectionDialogRef"
+      v-if="paymentDialogFlag"
+      :payment-dialog-flag.sync="paymentDialogFlag"
+      @reload="reload"
+    ></payment-dialog>
+    <detail-dialog
+      ref="detailDialogRef"
+      v-if="detailDialogFlag"
+      :detail-dialog-flag.sync="detailDialogFlag"
+    ></detail-dialog>
+    <!--开票详情-->
+    <invoice-detail-dialog
+      ref="invoiceDetailDialogRef"
+      v-if="invoiceDetailDialogFlag"
+      :detailDialogFlag.sync="invoiceDetailDialogFlag"
+    ></invoice-detail-dialog>
+    <process-submit-dialog
+      api-fun-name="fininvoiceapplyStatusAPI"
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      isCloseRefresh="false"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="reload"
+    ></process-submit-dialog>
+
+    <!-- 开票 -->
+    <!-- <addOrEditDialogNew
+      ref="addOrEditDialogNewRef"
+      :add-or-edit-dialog-flag.sync="addOrEditDialogNewFlag"
+      v-if="addOrEditDialogNewFlag"
+      :isEditType="false"
+      @reload="reload"
+    /> -->
+  </div>
+</template>
+
+<script>
+  import { getSummaries } from '@/utils/util.js';
+  import { reviewStatus } from '@/enum/dict';
+  import dictMixins from '@/mixins/dictMixins';
+  import { finPayablePageListAPI, purchasePayableBill } from '@/api/financialManage/payableManage';
+  import paymentDialog from '@/views/financialManage/payableManage/components/paymentDialog.vue';
+  import searchTable from '@/views/financialManage/payableManage/searchTable.vue';
+  import detailDialog from '@/views/financialManage/payableManage/components/detailDialog.vue';
+  import invoiceDetailDialog from '@/views/financialManage/invoiceManage/components/detailDialog.vue';
+  import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import { shippingModeOp, transactionMethodsOp, paymentTypeOp, paymentType, invoiceStatusOp } from '@/enum/dict.js';
+//   import addOrEditDialogNew from '@/views/financialManage/invoiceManage/components/addOrEditDialogNew.vue'
+
+  export default {
+    mixins: [dictMixins, tabMixins],
+    components: {
+      searchTable,
+      paymentDialog,
+      detailDialog,
+      invoiceDetailDialog,
+      processSubmitDialog,
+    //   addOrEditDialogNew
+    },
+    data() {
+      return {
+        // 加载状态
+        loading: false,
+        paymentDialogFlag: false,
+        detailDialogFlag: false,
+        invoiceDetailDialogFlag: false,
+        processSubmitDialogFlag: false,
+        shippingModeOp, 
+        invoiceStatusOp,
+        transactionMethodsOp, 
+        paymentTypeOp,
+        selection: [],
+        addOrEditDialogNewFlag: false,
+        paymentType,
+        statusList: [
+          {
+            label: '未付款',
+            value: 0
+          },
+          {
+            label: '部分付款',
+            value: 1
+          },
+          {
+            label: '已付全款',
+            value: 2
+          }
+        ],
+        cacheKeyUrl: 'eos-7a7a5e23-payableManage',
+        columnsVersion: 1
+      };
+    },
+    computed: {
+      canAddInvoice() {
+        return function(row) {
+          if (!row) return false;
+          return [2].includes(row.approvalStatus) && row.transactionMode == 2 && row.invoiceStatus != 2 && row.unInvoiceAmount && +row.unInvoiceAmount > 0;
+        };
+      },
+      columns() {
+        // 当columnsVersion变化时会重新计算,用作更新列配置
+        const version = this.columnsVersion;
+        return [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
+          {
+            width: 60,
+            label: '序号',
+            type: 'index',
+            columnKey: 'index',
+            align: 'center'
+          },
+          {
+            minWidth: 150,
+            prop: 'code',
+            label: '应付编码',
+            align: 'center',
+            slot: 'code',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 160,
+            prop: 'receiptPlanOrderNo',
+            label: '付款计划编码',
+            align: 'center',
+            slot: 'receiptPlanOrderNo',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 160,
+            prop: 'saleOrderNo',
+            label: '订单编码',
+            align: 'center',
+            slot: 'saleOrderNo',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'contractCode',
+            label: '合同编码',
+            align: 'center',
+            slot: 'contractCode',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'contractNo',
+            label: '合同编号',
+            align: 'center',
+            slot: 'contractNo',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'contractName',
+            label: '合同名称',
+            align: 'center',
+            slot: 'contractName',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'invoiceCode',
+            label: '关联发票编码',
+            slot: 'invoiceCode',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'invoiceNos',
+            label: '发票号',
+            align: 'center',
+            slot: 'invoiceNos',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'customerNo',
+            label: '客户编码',
+            align: 'center',
+            slot: 'customerNo',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'contactName',
+            label: '客户名称',
+            align: 'center',
+            slot: 'contactName',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 130,
+            prop: 'paymentTypeName',
+            label: '款项类型',
+            align: 'center',
+            slot: 'paymentTypeName',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'payableTotalPrice',
+            label: '应付金额',
+            align: 'center',
+            slot: 'payableTotalPrice',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'paidTotalPrice',
+            label: '已付金额',
+            align: 'center',
+            slot: 'paidTotalPrice',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'unpaidTotalPrice',
+            label: '未付金额',
+            align: 'center',
+            slot: 'unpaidTotalPrice',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'invoiceAmount',
+            label: '已开票金额',
+            align: 'center',
+            slot: 'invoiceAmount',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'unInvoiceAmount',
+            label: '未开票金额',
+            align: 'center',
+            slot: 'unInvoiceAmount',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 140,
+            prop: 'payableDate',
+            label: '实际付款日期',
+            slot: 'payableDate',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          
+        {
+          minWidth: 120,
+          prop: 'createUserName',
+          label: '创建人',
+          align: 'center',
+          slot: 'createUserName',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 120,
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          slot: 'createTime',
+          showOverflowTooltip: true
+        },
+        {
+            minWidth: 120,
+            prop: 'accountingSubjectName',
+            label: '会计科目',
+            align: 'center',
+            slot: 'accountingSubjectName',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'transactionMode',
+            label: '交易方式',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (row) => {
+              return this.transactionMethodsOp.find(item => item.value == row.transactionMode)?.label || '';
+            }
+          },
+          {
+            prop: 'invoiceStatus',
+            label: '开票状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return this.invoiceStatusOp.find(item => item.value == cellValue)?.label || '';
+            }
+          },
+          {
+            minWidth: 100,
+            prop: 'status',
+            label: '付款状态',
+            align: 'center',
+            slot: 'status',
+            showOverflowTooltip: true,
+            formatter: (_row, _column, cellValue) => {
+              return this.paymentType.find((item) => item.value == cellValue)
+                .label;
+            }
+          },
+          {
+            minWidth: 130,
+            prop: 'remark',
+            label: '来源备注',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+        {
+          prop: 'externalId',
+          label: '是否推送',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120,
+          formatter: (_row, _column, cellValue) => {
+            return _row.externalId? '已推送' : '未推送';
+          }
+        },
+          {
+            minWidth: 100,
+            prop: 'approvalStatus',
+            label: '审核状态',
+            align: 'center',
+            slot: 'approvalStatus',
+            formatter: (_row, _column, cellValue) => {
+              return reviewStatus[_row.approvalStatus];
+            }
+          },
+          
+        //   {
+        //     columnKey: 'action',
+        //     label: '操作',
+        //     width: 150,
+        //     align: 'center',
+        //     resizable: false,
+        //     slot: 'action',
+        //     showOverflowTooltip: true,
+        //     fixed: 'right'
+        //   }
+        ];
+      }
+    },
+    created() {},
+    methods: {
+      getSummaries(param) {
+        return getSummaries(
+          param,
+          ['payableTotalPrice', 'paidTotalPrice', 'unpaidTotalPrice', 'invoiceAmount', 'unInvoiceAmount'],
+          ' '
+        );
+      },
+      //新增发票
+      openEdit(row) {
+
+        this.addOrEditDialogNewFlag = true;
+        this.$nextTick(() => {
+          this.$refs.addOrEditDialogNewRef.createInvoice1([row], '2', 4);
+        });
+        // this.$refs.addOrEditDialogNewRef.$refs.form &&
+        //   this.$refs.addOrEditDialogNewRef.$refs.form.clearValidate();
+      },
+      allPushBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        purchasePayableBill(dataId).then((res) => {
+          this.$message.success('推送成功!');
+          this.reload();
+        });
+      },
+      handleCollection(row = {}, type) {
+        this.paymentDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.collectionDialogRef.init(row, type);
+        });
+      },
+      handleDetail(row = {}, type) {
+        this.detailDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.detailDialogRef.init(row.id);
+        });
+      },
+      handleInvoiceDetail(row = {}, type) {
+        this.invoiceDetailDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            id: row.invoiceId
+          };
+          this.$refs.invoiceDetailDialogRef.init(params, type);
+        });
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return finPayablePageListAPI({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+      },
+      sub(res) {
+        this.processSubmitDialogFlag = true;
+        let params = {
+          businessId: res.id,
+          businessKey: 'fin_payable_approve',
+          formCreateUserId: res.createUserId,
+          variables: {
+            businessCode: res.code,
+            businessName: res.contactName,
+            businessType: '应付'
+          }
+        };
+        this.$nextTick(() => {
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.$refs.table.reload({ page: 1, where });
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  :deep(.el-link--inner) {
+    margin-left: 0px !important;
+  }
+
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+</style>

+ 11 - 2
src/views/financialManage/payableManage/components/infoTable.vue

@@ -4,7 +4,9 @@
       <div>
         <el-divider direction="vertical"></el-divider>
         <span>应付金额:</span>
-        <span>{{ form.payableTotalPrice }}</span>
+        <span>
+          <el-input style="width: 200px;" v-model="form.payableTotalPrice" type="number" placeholder="请输入应付金额" :min="0" @change="updatePayableTotalPrice" />
+        </span>
         <el-divider direction="vertical"></el-divider>
         <span>已付金额:</span>
         <span>{{ paidTotalPrice }}</span>
@@ -281,6 +283,10 @@
       this.init();
     },
     methods: {
+      updatePayableTotalPrice(val) {
+        console.log('val~~~', val);
+       this.unpaidTotalPrice = val - (Number(this.paidTotalPrice) || 0);
+      },
       init() {
         this.dialogForm = deepClone(this.form);
         this.unpaidTotalPrice = Number(this.dialogForm.unpaidTotalPrice);
@@ -342,6 +348,9 @@
             },
             0
           );
+          if(this.paidTotalPrice > this.form.payableTotalPrice) {
+            this.form.payableTotalPrice = this.paidTotalPrice
+          }
           this.unpaidTotalPrice =
             this.form.payableTotalPrice - this.paidTotalPrice;
         });
@@ -363,7 +372,7 @@
           this.$refs.form.validate((valid) => {
             if (!valid) return this.$message.warning('请填写完整信息');
             console.log(this.dialogForm.detailList);
-            resolve(this.dialogForm.detailList);
+            resolve([this.dialogForm.detailList, this.form.payableTotalPrice]);
           });
         });
       }

+ 9 - 2
src/views/financialManage/payableManage/components/paymentDialog.vue

@@ -21,7 +21,7 @@
 </template>
 <script>
 import infoTable from "./infoTable.vue";
-import {finPayableSaveAPI, getFinPayableInfoAPI} from "@/api/financialManage/payableManage";
+import {finPayableSaveAPI, getFinPayableInfoAPI, finPayableUpdateAmountAPI} from "@/api/financialManage/payableManage";
 
 export default {
   name: "collectionDialog",
@@ -63,7 +63,14 @@ export default {
     },
     //
     async handleSave() {
-      let detailList = await this.$refs.feeRelatedInfoTable.getTableValidate()
+      
+      let data = await this.$refs.feeRelatedInfoTable.getTableValidate()
+      console.log('data~~~', data)
+      let detailList = data[0]
+      let payableTotalPrice = data[1]
+      await finPayableUpdateAmountAPI(this.form.id, {
+        payableTotalPrice: payableTotalPrice
+      })
      await finPayableSaveAPI(detailList)
       this.$message.success('操作成功')
       this.done()

+ 7 - 0
src/views/financialManage/payableManage/index.vue

@@ -291,6 +291,13 @@
             slot: 'paymentTypeName',
             showOverflowTooltip: true
           },
+          {
+            minWidth: 100,
+            prop: 'orderAmount',
+            label: '订单总额',
+            align: 'center',
+            showOverflowTooltip: true
+          },
           {
             minWidth: 100,
             prop: 'payableTotalPrice',

+ 8 - 2
src/views/financialManage/receivableManage/components/collectionDialog.vue

@@ -21,7 +21,7 @@
 </template>
 <script>
 import infoTable from "./infoTable.vue";
-import {finReceivableSaveAPI, getFinReceivableInfoAPI} from "@/api/financialManage/receivableManage";
+import {finReceivableSaveAPI, getFinReceivableInfoAPI, finReceivableUpdateAmountAPI} from "@/api/financialManage/receivableManage";
 
 export default {
   name: "collectionDialog",
@@ -63,7 +63,13 @@ export default {
     },
     //
     async handleSave() {
-      let detailList = await this.$refs.feeRelatedInfoTable.getTableValidate()
+      let data = await this.$refs.feeRelatedInfoTable.getTableValidate()
+      console.log('data~~~', data)
+      let detailList = data[0]
+      let receivableTotalPrice = data[1]
+      await finReceivableUpdateAmountAPI(this.form.id, {
+        receivableTotalPrice: receivableTotalPrice
+      })
      await finReceivableSaveAPI(detailList)
       this.$message.success('操作成功')
       this.done()

+ 11 - 2
src/views/financialManage/receivableManage/components/infoTable.vue

@@ -4,7 +4,9 @@
       <div>
         <el-divider direction="vertical"></el-divider>
         <span>应收金额:</span>
-        <span>{{ form.receivableTotalPrice }}</span>
+        <span>
+          <el-input style="width: 200px;" v-model="form.receivableTotalPrice" type="number" placeholder="请输入应收金额" :min="0" @change="updateReceivableTotalPrice" />
+        </span>
         <el-divider direction="vertical"></el-divider>
         <span>已收金额:</span>
         <span>{{ receivedTotalPrice }}</span>
@@ -288,6 +290,10 @@
       this.init();
     },
     methods: {
+      updateReceivableTotalPrice(val) {
+        console.log('val~~~', val);
+       this.unreceiveTotalPrice = val - (Number(this.receivedTotalPrice) || 0);
+      },
       init() {
         this.dialogForm = deepClone(this.form);
         this.unreceiveTotalPrice = Number(this.dialogForm.unreceiveTotalPrice);
@@ -349,6 +355,9 @@
             },
             0
           );
+          if(this.receivedTotalPrice > this.form.receivableTotalPrice) {
+            this.form.receivableTotalPrice = this.receivedTotalPrice
+          }
           this.unreceiveTotalPrice =
             Number((this.form.receivableTotalPrice - this.receivedTotalPrice).toFixed(2));
         });
@@ -372,7 +381,7 @@
           this.$refs.form.validate((valid) => {
             if (!valid) return this.$message.warning('请填写完整信息');
             console.log(this.dialogForm.detailList);
-            resolve(this.dialogForm.detailList);
+            resolve([this.dialogForm.detailList, this.form.receivableTotalPrice]);
           });
         });
       }

+ 7 - 0
src/views/financialManage/receivableManage/index.vue

@@ -298,6 +298,13 @@
             slot: 'paymentTypeName',
             showOverflowTooltip: true
           },
+          {
+            minWidth: 100,
+            prop: 'orderAmount',
+            label: '订单总额',
+            align: 'center',
+            showOverflowTooltip: true
+          },
           {
             minWidth: 100,
             prop: 'receivableTotalPrice',

+ 561 - 0
src/views/financialManage/receivedManaged/index.vue

@@ -0,0 +1,561 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading" style="width: 100%">
+      <search-table @search="reload"></search-table>
+      <div>
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          height="calc(100vh - 375px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          :selection.sync="selection"
+          :page-size="20"
+          @columns-change="handleColumnChange"
+          :cache-key="cacheKeyUrl"
+          show-summary
+          :summary-method="getSummaries"
+        > 
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <!-- <el-button
+              v-if="$hasPermission('eom:finreceivable:push')"
+              size="small"
+              type="primary"
+              class="ele-btn-icon"
+              @click="allPushBtn"
+              :disabled="selection?.length === 0"
+            >
+              批量推送
+            </el-button> -->
+          </template>
+          <!-- 操作 -->
+          <template v-slot:action="{ row }">
+            <!-- <el-link
+              type="primary"
+              v-if="[2].includes(row.approvalStatus)"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="handleCollection(row, 'update')"
+            >
+              收款
+            </el-link> -->
+            <!-- <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="sub(row)"
+              v-if="[0, 3].includes(row.approvalStatus)"
+            >
+              提交
+            </el-link> -->
+            <!-- <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-plus"
+              @click="openEdit(row)"
+              v-if="canAddInvoice(row)"
+            >
+              新增发票
+            </el-link> -->
+          </template>
+          <!-- 收款信息 -->
+          <template v-slot:code="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="handleDetail(row, 'view')"
+            >
+              {{ row.code }}
+            </el-link>
+          </template>
+          <!-- 开票信息 -->
+          <template v-slot:invoiceCode="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="handleInvoiceDetail(row, 'view')"
+            >
+              {{ row.invoiceCode }}
+            </el-link>
+          </template>
+        </ele-pro-table>
+      </div>
+    </el-card>
+    <!--    收款信息-->
+    <collection-dialog
+      ref="collectionDialogRef"
+      v-if="collectionDialogFlag"
+      :collection-dialog-flag.sync="collectionDialogFlag"
+      @reload="reload"
+    ></collection-dialog>
+    <detail-dialog
+      ref="detailDialogRef"
+      v-if="detailDialogFlag"
+      :detail-dialog-flag.sync="detailDialogFlag"
+    ></detail-dialog>
+    <!--开票详情-->
+    <invoice-detail-dialog
+      ref="invoiceDetailDialogRef"
+      v-if="invoiceDetailDialogFlag"
+      :detailDialogFlag.sync="invoiceDetailDialogFlag"
+    ></invoice-detail-dialog>
+    <process-submit-dialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      isCloseRefresh="false"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="reload"
+    ></process-submit-dialog>
+    <!-- 开票 -->
+    <!-- <addOrEditDialogNew
+      ref="addOrEditDialogNewRef"
+      :add-or-edit-dialog-flag.sync="addOrEditDialogNewFlag"
+      v-if="addOrEditDialogNewFlag"
+      :isEditType="false"
+      @reload="reload"
+    /> -->
+  </div>
+</template>
+
+<script>
+  import { getSummaries } from '@/utils/util.js';
+  import { reviewStatus } from '@/enum/dict';
+  import dictMixins from '@/mixins/dictMixins';
+  import { finReceivablePageListAPI, receivableBill } from '@/api/financialManage/receivableManage';
+  import collectionDialog from '@/views/financialManage/receivableManage/components/collectionDialog.vue';
+  import searchTable from '@/views/financialManage/receivableManage/searchTable.vue';
+  import detailDialog from '@/views/financialManage/receivableManage/components/detailDialog.vue';
+  import invoiceDetailDialog from '../invoiceManage/components/detailDialog.vue';
+  import processSubmitDialog from "@/BIZComponents/processSubmitDialog/processSubmitDialog.vue";
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import { shippingModeOp, transactionMethodsOp, paymentTypeOp, paymentStatus, invoiceStatusOp } from '@/enum/dict.js';
+//   import addOrEditDialogNew from '@/views/financialManage/invoiceManage/components/addOrEditDialogNew.vue'
+
+  export default {
+    mixins: [dictMixins,tabMixins],
+    components: {
+      searchTable,
+      collectionDialog,
+      detailDialog,
+      invoiceDetailDialog,
+      processSubmitDialog,
+    //   addOrEditDialogNew
+    },
+    //客户管理数据
+    props: {
+      contactData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      saleOrderData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      }
+    },
+    data() {
+      return {
+        // 加载状态
+        loading: false,
+        collectionDialogFlag: false,
+        detailDialogFlag: false,
+        invoiceDetailDialogFlag: false,
+        processSubmitDialogFlag: false,
+        shippingModeOp, 
+        transactionMethodsOp, 
+        invoiceStatusOp,
+        paymentTypeOp,
+        paymentStatus,
+        selection: [],
+        addOrEditDialogNewFlag: false,
+        statusList: [
+          {
+            label: '未收款',
+            value: 0
+          },
+          {
+            label: '部分收款',
+            value: 1
+          },
+          {
+            label: '已收全款',
+            value: 2
+          }
+        ],
+        cacheKeyUrl:'eos-03850924-receivableManage',
+        columnsVersion:1,
+      };
+    },
+    computed: {
+      columns() {
+        // 当columnsVersion变化时会重新计算,用作更新列配置
+        const version = this.columnsVersion;
+        return [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
+          {
+            width: 60,
+            label: '序号',
+            type: 'index',
+            columnKey: 'index',
+            align: 'center'
+          },
+          {
+            minWidth: 150,
+            prop: 'code',
+            label: '应收编码',
+            align: 'center',
+            slot: 'code',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 160,
+            prop: 'receiptPlanOrderNo',
+            label: '收款计划编码',
+            align: 'center',
+            slot: 'receiptPlanOrderNo',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 160,
+            prop: 'saleOrderNo',
+            label: '订单编码',
+            align: 'center',
+            slot: 'saleOrderNo',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'contractCode',
+            label: '合同编码',
+            align: 'center',
+            slot: 'contractCode',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'contractNo',
+            label: '合同编号',
+            align: 'center',
+            slot: 'contractNo',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'contractName',
+            label: '合同名称',
+            align: 'center',
+            slot: 'contractName',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'invoiceCode',
+            label: '关联发票编码',
+            slot: 'invoiceCode',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'invoiceNos',
+            label: '发票号',
+            align: 'center',
+            slot: 'invoiceNos',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'customerNo',
+            label: '客户编码',
+            align: 'center',
+            slot: 'customerNo',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'contactName',
+            label: '客户名称',
+            align: 'center',
+            slot: 'contactName',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 130,
+            prop: 'paymentTypeName',
+            label: '款项类型',
+            align: 'center',
+            slot: 'paymentTypeName',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'receivableTotalPrice',
+            label: '应收金额',
+            align: 'center',
+            slot: 'receivableTotalPrice',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'receivedTotalPrice',
+            label: '已收金额',
+            align: 'center',
+            slot: 'receivedTotalPrice',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'unreceiveTotalPrice',
+            label: '未收金额',
+            align: 'center',
+            slot: 'unreceiveTotalPrice',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'invoiceAmount',
+            label: '已开票金额',
+            align: 'center',
+            slot: 'invoiceAmount',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'unInvoiceAmount',
+            label: '未开票金额',
+            align: 'center',
+            slot: 'unInvoiceAmount',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 140,
+            prop: 'receivableDate',
+            label: '实际收款日期',
+            slot: 'receivableDate',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          
+        {
+          minWidth: 120,
+          prop: 'createUserName',
+          label: '创建人',
+          align: 'center',
+          slot: 'createUserName',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 120,
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          slot: 'createTime',
+          showOverflowTooltip: true
+        },
+        {
+            minWidth: 120,
+            prop: 'accountingSubjectName',
+            label: '会计科目',
+            align: 'center',
+            slot: 'accountingSubjectName',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'transactionMode',
+            label: '交易方式',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (row) => {
+              return this.transactionMethodsOp.find(item => item.value == row.transactionMode)?.label || '';
+            }
+          },
+          {
+            prop: 'invoiceStatus',
+            label: '开票状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return this.invoiceStatusOp.find(item => item.value == cellValue)?.label || '';
+            }
+          },
+          {
+            minWidth: 100,
+            prop: 'status',
+            label: '收款状态',
+            align: 'center',
+            slot: 'status',
+            showOverflowTooltip: true,
+            formatter: (_row, _column, cellValue) => {
+              return this.paymentStatus.find((item) => item.value == cellValue)
+                .label;
+            }
+          },
+          {
+            minWidth: 130,
+            prop: 'remark',
+            label: '来源备注',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+        {
+          prop: 'externalId',
+          label: '是否推送',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120,
+          formatter: (_row, _column, cellValue) => {
+            return _row.externalId? '已推送' : '未推送';
+          }
+        },
+          {
+            minWidth: 100,
+            prop: 'approvalStatus',
+            label: '审核状态',
+            align: 'center',
+            slot: 'approvalStatus',
+            formatter: (_row, _column, cellValue) => {
+              return reviewStatus[_row.approvalStatus];
+            }
+          },
+          
+        //   {
+        //     columnKey: 'action',
+        //     label: '操作',
+        //     width: 150,
+        //     align: 'center',
+        //     resizable: false,
+        //     slot: 'action',
+        //     showOverflowTooltip: true,
+        //     fixed: 'right'
+        //   }
+        ];
+      },
+      canAddInvoice() {
+        return function(row) {
+          if (!row) return false;
+          return [2].includes(row.approvalStatus) && row.transactionMode == 2 && row.invoiceStatus != 2 && row.unInvoiceAmount && +row.unInvoiceAmount > 0;
+        };
+      }
+    },
+    created() {},
+    methods: {
+      getSummaries(param) {
+        return getSummaries(
+          param,
+          ['receivableTotalPrice', 'receivedTotalPrice', 'unreceiveTotalPrice', 'invoiceAmount', 'unInvoiceAmount'],
+          ' '
+        );
+      },
+      allPushBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        receivableBill(dataId).then((res) => {
+          this.$message.success('推送成功!');
+          this.reload();
+        });
+      },
+      //新增发票
+      openEdit(row) {
+
+        this.addOrEditDialogNewFlag = true;
+        this.$nextTick(() => {
+          this.$refs.addOrEditDialogNewRef.createInvoice1([row], '1', 5);
+        });
+        // this.$refs.addOrEditDialogNewRef.$refs.form &&
+        //   this.$refs.addOrEditDialogNewRef.$refs.form.clearValidate();
+      },
+      handleCollection(row = {}, type) {
+        this.collectionDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.collectionDialogRef.init(row, type);
+        });
+      },
+      handleDetail(row = {}, type) {
+        this.detailDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.detailDialogRef.init(row.id);
+        });
+      },
+      handleInvoiceDetail(row = {}, type) {
+        this.invoiceDetailDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            id: row.invoiceId
+          };
+          this.$refs.invoiceDetailDialogRef.init(params, type);
+        });
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        console.log(this.saleOrderData, 'this.saleOrderData');
+        if (this.contactData.id) {
+          where['contactId'] = this.contactData.id;
+        }
+        if (this.saleOrderData.id) {
+          where['saleOrderCode'] = this.saleOrderData.orderNo;
+        }
+        return finReceivablePageListAPI({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+      },
+      sub(res) {
+        this.processSubmitDialogFlag = true;
+        let params = {
+          businessId: res.id,
+          businessKey: 'fin_receivable_approve',
+          formCreateUserId: res.createUserId,
+          variables: {
+            businessCode: res.code,
+            businessName: res.contactName,
+            businessType: '应收'
+          }
+        };
+        this.$nextTick(() => {
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.$refs.table.reload({ page: 1, where });
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  :deep(.el-link--inner) {
+    margin-left: 0px !important;
+  }
+
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+</style>

+ 25 - 20
src/views/purchasingManage/purchaseOrder/components/addDialogNew.vue

@@ -2216,33 +2216,38 @@
           });
 
           const ratioSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + +cur.ratio, 0);
-          if(+ratioSum != 100){
-            this.$message.error('比例合计必须为100%');
-            return;
-          }
+          // if(+ratioSum != 100){
+          //   this.$message.error('比例合计必须为100%');
+          //   return;
+          // }
+
+          if(+ratioSum > 100){
+              this.$message.error('比例合计不能超过100%');
+              return;
+            }
 
           // 使用万分之一进行计算,避免浮点数精度问题(对应4位小数)
           let receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + Math.round(+cur.price * 10000), 0) / 10000;
           const payAmount = +commitData.payAmount;
           
-          if(+ratioSum == 100) {
-            // 使用万分之一进行计算,避免浮点数精度问题
-            const difference = Math.round((payAmount - receiptPaymentListSum) * 10000) / 10000;
-            if (Math.abs(difference) >= 0.0001 && commitData.receiptPaymentList.length > 0) {
-              const lastIndex = commitData.receiptPaymentList.length - 1;
-              // 使用万分之一进行计算,避免浮点数精度问题
-              const newPrice = Math.round((+commitData.receiptPaymentList[lastIndex].price + difference) * 10000) / 10000;
-              commitData.receiptPaymentList[lastIndex].price = formatPrice(newPrice);
-              receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + Math.round(+cur.price * 10000), 0) / 10000;
-            }
-          }
+          // if(+ratioSum == 100) {
+          //   // 使用万分之一进行计算,避免浮点数精度问题
+          //   const difference = Math.round((payAmount - receiptPaymentListSum) * 10000) / 10000;
+          //   if (Math.abs(difference) >= 0.0001 && commitData.receiptPaymentList.length > 0) {
+          //     const lastIndex = commitData.receiptPaymentList.length - 1;
+          //     // 使用万分之一进行计算,避免浮点数精度问题
+          //     const newPrice = Math.round((+commitData.receiptPaymentList[lastIndex].price + difference) * 10000) / 10000;
+          //     commitData.receiptPaymentList[lastIndex].price = formatPrice(newPrice);
+          //     receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + Math.round(+cur.price * 10000), 0) / 10000;
+          //   }
+          // }
 
-          if(Math.abs(+receiptPaymentListSum - payAmount) > 0.0001){
-            this.$message.error('计划收款金额合计与优惠后金额不一致');
-            return;
-          }
+          // if(Math.abs(+receiptPaymentListSum - payAmount) > 0.0001){
+          //   this.$message.error('计划收款金额合计与优惠后金额不一致');
+          //   return;
+          // }
 
-          console.log('提交数据', commitData);  
+          // console.log('提交数据', commitData);  
 
           if (this.isUpdate) {
             UpdateInformation(commitData)

+ 31 - 24
src/views/saleManage/saleOrder/components/addDialogNew.vue

@@ -1035,7 +1035,8 @@
           payAmount: [{ required: true, message: '请输入', trigger: 'blur' }],
           salesmanId: [{ required: this.isDeptAndPerson == 1 ? true : false, message: '请选择业务员', trigger: 'change' }],
           salesDeptId: [{ required: this.isDeptAndPerson == 1 ? true : false, message: '请选择销售部门', trigger: 'change' }],
-          settlementDate: [{ required: true, message: '请选择结算日期', trigger: 'change' }]
+          settlementDate: [{ required: true, message: '请选择结算日期', trigger: 'change' }],
+          receiptDate: [{ required: true, message: '请选择收款日期', trigger: 'change' }]
         };
       }
     },
@@ -1965,34 +1966,40 @@
 
           if(commitData.needProduce != 2 && commitData.needProduce != 4) {
             const ratioSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + +cur.ratio, 0);
-            if(+ratioSum != 100){
-              this.$message.error('比例合计必须为100%');
+
+             if(+ratioSum > 100){
+              this.$message.error('比例合计不能超过100%');
               return;
             }
 
+            // if(+ratioSum != 100){
+            //   this.$message.error('比例合计必须为100%');
+            //   return;
+            // }
+
             // 使用万分之一进行计算,避免浮点数精度问题(对应4位小数)
-            let receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + Math.round(+cur.price * 10000), 0) / 10000;
-            const payAmount = +commitData.payAmount;
+            // let receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + Math.round(+cur.price * 10000), 0) / 10000;
+            // const payAmount = +commitData.payAmount;
             
-            if(+ratioSum == 100) {
-              // 使用万分之一进行计算,避免浮点数精度问题
-              const difference = Math.round((payAmount - receiptPaymentListSum) * 10000) / 10000;
-              console.log('difference~~~', difference);
-              if (Math.abs(difference) >= 0.0001 && commitData.receiptPaymentList.length > 0) {
-                const lastIndex = commitData.receiptPaymentList.length - 1;
-                // 使用万分之一进行计算,避免浮点数精度问题
-                const newPrice = Math.round((+commitData.receiptPaymentList[lastIndex].price + difference) * 10000) / 10000;
-                commitData.receiptPaymentList[lastIndex].price = formatPrice(newPrice);
-                receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + Math.round(+cur.price * 10000), 0) / 10000;
-              }
-            }
-
-            console.log('receiptPaymentListSum~~~', +receiptPaymentListSum, payAmount);
-
-            if(Math.abs(+receiptPaymentListSum - payAmount) > 0.0001){
-              this.$message.error('计划收款金额合计与优惠后金额不一致');
-              return;
-            }
+            // if(+ratioSum == 100) {
+            //   // 使用万分之一进行计算,避免浮点数精度问题
+            //   const difference = Math.round((payAmount - receiptPaymentListSum) * 10000) / 10000;
+            //   console.log('difference~~~', difference);
+            //   if (Math.abs(difference) >= 0.0001 && commitData.receiptPaymentList.length > 0) {
+            //     const lastIndex = commitData.receiptPaymentList.length - 1;
+            //     // 使用万分之一进行计算,避免浮点数精度问题
+            //     const newPrice = Math.round((+commitData.receiptPaymentList[lastIndex].price + difference) * 10000) / 10000;
+            //     commitData.receiptPaymentList[lastIndex].price = formatPrice(newPrice);
+            //     receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + Math.round(+cur.price * 10000), 0) / 10000;
+            //   }
+            // }
+
+            // console.log('receiptPaymentListSum~~~', +receiptPaymentListSum, payAmount);
+
+            // if(Math.abs(+receiptPaymentListSum - payAmount) > 0.0001){
+            //   this.$message.error('计划收款金额合计与优惠后金额不一致');
+            //   return;
+            // }
           }
           
           if (isTemporary.length > 0) {

+ 4 - 3
src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue

@@ -216,11 +216,12 @@
     </el-tabs>
 
     <div slot="footer" class="footer">
-      <el-button type="primary" @click="save" v-click-once>保存</el-button>
+      <el-button type="primary" @click="save" :loading="loading" v-click-once>保存</el-button>
       <el-button
         type="primary"
         v-if="isNeed_process_is_close"
         @click="save('sub')"
+         :loading="loading"
         v-click-once
         >提交</el-button
       >
@@ -633,7 +634,7 @@
         this.businessId = id;
 
         this.loading = true;
-        const data = await getSendSaleOrderrecordDetailSplit(id);
+        const data = await getSendSaleOrderrecordDetailSplit(id, 1);
         // this.partbAddress = data.saleOrder[0].partbAddress;
         // this.saleOrderValue = data.saleOrder;
         if (data.saleOrderList) {
@@ -1052,7 +1053,7 @@
                 this.$emit('done');
               })
               .catch((e) => {
-                //this.loading = false;
+                // this.loading = false;
               });
           }
         } catch (error) {

+ 6 - 0
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -770,6 +770,12 @@
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
+          {
+            width: 150,
+            prop: 'waitSendCount',
+            label: '待发数量',
+            align: 'center'
+          },
           {
             width: 100,
             prop: 'notSendTotalCount',

+ 6 - 0
src/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue

@@ -222,6 +222,12 @@
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
+          {
+            width: 150,
+            prop: 'waitSendCount',
+            label: '待发数量',
+            align: 'center'
+          },
           {
             width: 100,
             prop: 'notSendTotalCount',