Quellcode durchsuchen

feat: 更新收款/付款计划管理功能

liujt vor 6 Monaten
Ursprung
Commit
663057a90a

+ 4 - 0
.env

@@ -1,2 +1,6 @@
 VUE_APP_NAME=企业运营管理系统
 VUE_APP_API_BASE_URL=/api
+
+# 环境变量
+# clientEnvironmentId 
+# 4 宝悦  5 嘉实  6 润天智科

+ 103 - 59
src/BIZComponents/paymentCollectionPlan/Detail.vue

@@ -5,7 +5,6 @@
       :needPage="false"
       :columns="columns"
       :datasource="form.datasource"
-      :toolkit="[]"
       class="time-form"
     >
       <!-- 表头工具栏 -->
@@ -199,7 +198,11 @@
       discountTotalPrice: {
         type: [Number, String],
         default: 0
-      }
+      },
+      menu: {
+        type: String,
+        default: 'sale'
+      },
     },
     data() {
       const defaultForm = {
@@ -241,146 +244,187 @@
           },
           {
             width: 120,
-            prop: 'type',
-            label: '收款计划编码',
+            prop: 'detailNo',
+            label: this.menu === 'purchase' ? '付款计划编码' : '收款计划编码',
             align: 'center'
           },
           {
             width: 120,
-            prop: 'type',
+            prop: 'invoiceOrderNo',
             label: '发票号',
             align: 'center'
           },
           {
             width: 120,
-            prop: 'type',
-            label: '关联应收编码',
+            prop: 'relatedReceivableOrderNo',
+            label: this.menu === 'purchase' ? '关联应付编码' : '关联应收编码',
             align: 'center'
           },
           {
-            prop: 'period',
+            prop: 'issueNumber',
             label: '期数',
-            slot: 'period',
-            headerSlot: 'headerPeriod',
+            // slot: 'period',
+            // headerSlot: 'headerPeriod',
             align: 'center'
           },
           {
             width: 120,
-            prop: 'type',
+            prop: 'paymentType',
             label: '款项类型',
-            slot: 'type',
-            headerSlot: 'headerMoneyName',
+            // slot: 'paymentType',
+            // headerSlot: 'headerPaymentType',
             align: 'center'
           },
           {
             prop: 'moneyName',
             label: '款项名称',
-            slot: 'moneyName',
-            headerSlot: 'headerMoneyName',
+            // slot: 'moneyName',
+            // headerSlot: 'headerMoneyName',
             align: 'center',
             width: 170
           },
           {
             width: 150,
-            prop: 'ratio',
+            prop: 'paymentRatio',
             label: '比例',
-            slot: 'ratio',
-            headerSlot: 'headerRatio',
+            // slot: 'paymentRatio',
+            // headerSlot: 'headerRatio',
             align: 'center'
           },
           {
             width: 170,
-            prop: 'price',
-            label: '计划收款金额',
-            slot: 'price',
+            prop: 'planPaymentAmount',
+            label: this.menu === 'purchase' ? '计划付款金额' : '计划收款金额',
+            // slot: 'planPaymentAmount',
             align: 'center',
-            headerSlot: 'headerPrice',
+            // headerSlot: 'headerPrice',
           },
 
           {
             width: 160,
-            prop: 'deadLine',
-            label: '计划收款日期',
-            slot: 'deadLine',
-            headerSlot: 'headerDeadLine',
+            prop: 'planPaymentDate',
+            label: this.menu === 'purchase' ? '计划付款日期' : '计划收款日期',
+            // slot: 'planPaymentDate',
+            // headerSlot: 'headerDeadLine',
             align: 'center'
           },
           {
             width: 120,
-            prop: 'type',
+            prop: 'isInvoice',
             label: '是否已开票',
-            align: 'center'
+            align: 'center',
+            formatter: (row) => {
+              return row.isInvoice ? '是' : '否';
+            }
           },
           {
             width: 120,
-            prop: 'type',
+            prop: 'invoiceAmount',
             label: '已开票金额',
             align: 'center'
           },
           {
             width: 120,
-            prop: 'type',
+            prop: 'invoiceDate',
             label: '开票日期',
             align: 'center'
           },
           {
             width: 120,
-            prop: 'type',
-            label: '是否生成应收款项',
-            align: 'center'
+            prop: 'isGenerateReceivablePayment',
+            label: this.menu === 'purchase' ? '是否生成应付款项' : '是否生成应收款项',
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              return cellValue == 1 ? '是' : '否';
+            }
           },
           {
             width: 120,
-            prop: 'type',
-            label: '应收金额',
+            prop: 'receivableAmount',
+            label: this.menu === 'purchase' ? '应付金额' : '应收金额',
             align: 'center'
           },
           {
             width: 120,
-            prop: 'type',
-            label: '已收款金额',
+            prop: 'receivedAmount',
+            label: this.menu === 'purchase' ? '已付款金额' : '已收款金额',
             align: 'center'
           },
           {
             width: 120,
-            prop: 'type',
-            label: '实际收款日期',
+            prop: 'actualReceivablePaymentDate',
+            label: this.menu === 'purchase' ? '实际付款日期' : '实际收款日期',
             align: 'center'
           },
           {
             width: 120,
-            prop: 'type',
-            label: '发货状态',
-            align: 'center'
+            prop: 'deliveryStatus',
+            label: this.menu === 'purchase' ? '收货货状态' : '发货状态',
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              let options = this.menu === 'purchase' ? [
+                { value: 0, label: '待收货' },
+                { value: 1, label: '部分收货' },
+                { value: 2, label: '全部收货' }
+              ] : [
+                { value: 0, label: '待发货' },
+                { value: 1, label: '部分发货' },
+                { value: 2, label: '全部发货' }
+              ];
+              return options.find(item => item.value == cellValue)?.label || '';
+            },
           },
           {
             width: 120,
-            prop: 'type',
+            prop: 'reconciliationStatus',
             label: '对账状态',
-            align: 'center'
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              let options = [
+                { value: 0, label: '未对账' },
+                { value: 1, label: '部分对账' },
+                { value: 2, label: '全部对账' }
+              ];
+              return options.find(item => item.value == cellValue)?.label || '';
+            }
           },
           {
             width: 220,
-            prop: 'remark',
-            label: '收款状态',
-            slot: 'remark',
-            align: 'center'
+            prop: 'paymentStatus',
+            label: this.menu === 'purchase' ? '付款状态' : '收款状态',
+            slot: 'paymentStatus',
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              let options = this.menu === 'purchase' ? [
+                { value: 0, label: '未付款' },
+                { value: 1, label: '部分付款' },
+                { value: 2, label: '全部付款' }
+              ] : [
+                { value: 0, label: '未收款' },
+                { value: 1, label: '部分收款' },
+                { value: 2, label: '全部收款' }
+              ];
+              return options.find(item => item.value == cellValue)?.label || '';
+            }
           },
           {
             width: 120,
-            prop: 'type',
+            prop: 'overdueStatus',
             label: '逾期状态',
-            align: 'center'
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
             align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true,
-            show: this.type != 'view'
-          }
+            formatter: (_row, _column, cellValue) => {
+              return _row.overdueStatus == 1 ? '逾期中' : '未逾期';
+            }
+          },
+          // {
+          //   columnKey: 'action',
+          //   label: '操作',
+          //   align: 'center',
+          //   resizable: false,
+          //   slot: 'action',
+          //   showOverflowTooltip: true,
+          //   show: this.type != 'view'
+          // }
         ];
       },
       allRatio() {

+ 1 - 0
src/BIZComponents/paymentCollectionPlan/Index.vue

@@ -410,6 +410,7 @@
         });
       },
       refreshprice() {
+        console.log(this.form, '666666');
         let newData = this.form.datasource;
         newData.forEach(async (r, index) => {
           if (r.ratio) {

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

@@ -7,4 +7,13 @@ export async function receiptPaymentPlanPage(params) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
+} 
+
+// 详情
+export async function receiptPaymentPlanById(id) {
+  const res = await request.get(`/eom/receipt_payment_plan/order/v1/get/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }

+ 59 - 21
src/views/contractManage/contractBook/components/addDialogNew.vue

@@ -908,7 +908,7 @@
         partbLinkName: '',
         partbName: '',
         partbTel: '',
-        settlementModeName: '结算方式',
+        settlementModeName: '分期付款',
         settlementMode: '4',
         pricingWay: 1,
         customerMark: '',
@@ -939,7 +939,6 @@
       return {
         shippingModeOp,
         transactionMethodsOp,
-        // settlementDate: [],
         fullscreen: false,
         requirementSourceType,
         cacheKeyUrl: 'eos-contractManage-contractBook-inventoryTabl',
@@ -1148,7 +1147,8 @@
       setDiscountTotalPrice(val) {
         this.form.discountTotalPrice = val;
         this.$nextTick(() => {
-          this.$refs.paymentListTable.setDiscountAmount(val);
+          // this.$refs.paymentListTable.setDiscountAmount(val);
+          this.$refs.paymentCollectionPlanRef.setDiscountAmount(val);
         });
       },
       // 获取公司数据
@@ -1270,6 +1270,7 @@
         this.loading = true;
         const data = await getDetail(id);
         let { contractVO } = data;
+        contractVO.settlementDate = contractVO.startSettlementDate ? [contractVO.startSettlementDate, contractVO.endSettlementDate] : [];
         this.form = contractVO;
 
         this.loading = false;
@@ -1295,10 +1296,10 @@
             //   this.$refs.paymentListTable.setDiscountAmount(
             //     contractVO.discountTotalPrice
             //   );
-            this.form.settlementDate = data.contractVO.startSettlementDate ? [data.contractVO.startSettlementDate, data.contractVO.endSettlementDate] : [];
+            
             const receiptData = {
               receiptPaymentList: data.receiptPaymentList,
-              payAmount: data.contractVO.discountTotalPrice
+              payAmount: contractVO.discountTotalPrice
             }
             this.$refs.paymentCollectionPlanRef && this.$refs.paymentCollectionPlanRef.putTableValue(receiptData);
             this.$refs.rawDetailListRef &&
@@ -1382,6 +1383,13 @@
           businessDeptName: this.form.type == 2 ? this.companyInfo.name : '',
           businessUserId: this.form.type == 2 ? this.$store.state.user.info?.id : '',
           businessUserName: this.form.type == 2 ? this.$store.state.user.info?.name : '',
+          transactionMode: 1,
+          settlementDate: [],
+          issueNumber: 1,
+          deliveryMode: 1,
+          receiptDate: 1,
+          endSettlementDate: '',
+          startSettlementDate: ''
         });
         this.getBusinessUser(this.form.businessDeptId)
         console.log('form~~~', this.form);
@@ -1474,6 +1482,7 @@
       // 结算方式改变
       settlementModeChange(v) {
         console.log('v~~~', v.dictCode);
+        this.form.settlementModeName = v.dictValue;
         // this.$set(this.form, 'issueNumber', 1);
         this.$set(this.form, 'settlementDate', []);
         this.$set(this.form, 'receiptDate', 1);
@@ -1715,7 +1724,14 @@
             contractVO.contractStartDate || this.form.contractStartDate,
           contractEndDate:
             contractVO.contractEndDate || this.form.contractEndDate,
-          pricingWay: 1
+          pricingWay: 1,
+          transactionMode: contractVO.transactionMode || this.form.transactionMode,
+          settlementDate: contractVO.settlementDate || this.form.settlementDate,
+          issueNumber: contractVO.issueNumber || this.form.issueNumber,
+          deliveryMode: contractVO.deliveryMode || this.form.deliveryMode,
+          receiptDate: contractVO.receiptDate || this.form.receiptDate,
+          endSettlementDate: contractVO.endSettlementDate || this.form.endSettlementDate,
+          startSettlementDate: contractVO.startSettlementDate || this.form.startSettlementDate
         };
 
         row.productList = row.productList.map((item) => {
@@ -1736,12 +1752,17 @@
 
         this.form = contractVO;
         this.form.HJQD = this.form.partbName;
+        this.issueNumberChange(this.form.issueNumber)
         this.$refs.inventoryTable &&
           this.$refs.inventoryTable.putTableValue(row);
-        this.$refs.paymentListTable &&
-          this.$refs.paymentListTable.putTableValue(row.receiptPaymentList);
-        this.$refs.paymentListTable &&
-          this.$refs.paymentListTable.setDiscountAmount(
+        // const receiptData = {
+        //     receiptPaymentList: row.receiptPaymentList,
+        //     payAmount: contractVO.discountTotalPrice
+        //   }
+        // this.$refs.paymentCollectionPlanRef &&
+        //   this.$refs.paymentCollectionPlanRef.putTableValue(receiptData);
+        this.$refs.paymentCollectionPlanRef &&
+          this.$refs.paymentCollectionPlanRef.setDiscountAmount(
             contractVO.discountTotalPrice
           );
         this.getEnterprise();
@@ -1844,15 +1865,15 @@
               }
             });
           }),
-          new Promise((resolve, reject) => {
-            this.$refs.paymentListTable.validateForm((valid) => {
-              if (!valid) {
-                reject(false);
-              } else {
-                resolve(true);
-              }
-            });
-          }),
+          // new Promise((resolve, reject) => {
+          //   this.$refs.paymentListTable.validateForm((valid) => {
+          //     if (!valid) {
+          //       reject(false);
+          //     } else {
+          //       resolve(true);
+          //     }
+          //   });
+          // }),
           new Promise((resolve, reject) => {
             this.$refs.paymentCollectionPlanRef.validateForm((valid) => {
               if (!valid) {
@@ -1907,16 +1928,33 @@
           let commitData = Object.assign(
             {},
             {
-              contract: this.form,
+              contract: {
+                ...this.form,
+                endSettlementDate: this.form.settlementDate.length ?this.form.settlementDate[1] : '',
+                startSettlementDate: this.form.settlementDate.length ? this.form.settlementDate[0] : ''
+              },
               productList: [
                 ...this.$refs.inventoryTable.getTableValue(),
                 ...rawDetailList,
                 ...outputDetailList
               ],
-              receiptPaymentList: this.$refs.paymentListTable.getTableValue()
+              receiptPaymentList: this.$refs.paymentCollectionPlanRef.getTableValue()
             }
           );
 
+          const receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + +cur.price, 0);
+          console.log('receiptPaymentListSum~~~', receiptPaymentListSum, commitData.contract.discountTotalPrice)
+          if(+receiptPaymentListSum != +commitData.contract.discountTotalPrice){
+            this.$message.error('计划收款金额合计与优惠后金额不一致');
+            return;
+          }
+
+          const ratioSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + cur.ratio, 0);
+          if(+ratioSum != 100){
+            this.$message.error('比例合计必须为100%');
+            return;
+          }
+
           // commitData.productList.forEach((item) => {
           //   if (!item.productCode) {
           //     isTemporary.push(item.productName);

+ 2 - 2
src/views/contractManage/contractBook/components/inquiryList.vue

@@ -25,11 +25,11 @@
     </el-card>
 
     <div slot="footer" class="dialog-footer">
-      <el-button type="primary" size="small" @click="selected"
+      <el-button type="primary" size="small" @click="selected" v-click-once
       >生成合同
       </el-button
       >
-      <el-button size="small" @click="handleClose">关闭</el-button>
+      <el-button size="small" v-click-once @click="handleClose">关闭</el-button>
     </div>
 
 

+ 2 - 2
src/views/contractManage/contractBook/index.vue

@@ -255,8 +255,8 @@
   import AssetTree from '@/components/AssetTree';
   import { reviewStatus } from '@/enum/dict';
   import { contactTypeTree } from '@/api/saleManage/contact';
-  import saleOrderAddDialog from '@/views/saleManage/saleOrder/components/addDialog.vue';
-  import supplierAddDialog from '@/views/purchasingManage/purchaseOrder/components/addDialog.vue';
+  import saleOrderAddDialog from '@/views/saleManage/saleOrder/components/addDialogNew.vue';
+  import supplierAddDialog from '@/views/purchasingManage/purchaseOrder/components/addDialogNew.vue';
   import { submit as saleOrderSubmitAPI } from '@/api/saleManage/saleorder';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import {

+ 57 - 47
src/views/financialManage/collectionPlan/components/detailDialog.vue

@@ -31,56 +31,57 @@
         <headerTitle title="基本信息"></headerTitle>
         <el-row>
           <el-col :span="8">
-            <el-form-item label="收款计划编码:" prop="type">
-              <el-input v-model="form.categoryName" disabled></el-input>
+            <el-form-item :label="menu === 'purchase' ? '付款计划编码:' : '收款计划编码:'" prop="orderNo">
+              <el-input v-model="form.orderNo" disabled></el-input>
             </el-form-item>
-            <el-form-item label="合同编码:" prop="type">
-              <el-input v-model="form.categoryName" disabled></el-input>
+            <el-form-item label="合同编码:" prop="contractNo">
+              <el-input v-model="form.contractNo" disabled></el-input>
             </el-form-item>
-            <el-form-item label="客户编码:" prop="type">
-              <el-input v-model="form.categoryName" disabled></el-input>
+            <el-form-item label="客户编码:" prop="customerCode">
+              <el-input v-model="form.customerCode" disabled></el-input>
             </el-form-item>
-            <el-form-item label="交易方式:" prop="type">
-              <el-input v-model="form.categoryName" disabled></el-input>
+            <el-form-item label="交易方式:" prop="transactionMode">
+              <el-input v-model="form.transactionMode" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="订单编码:" prop="HJQD" v-if="form.sourceType == 2">
-              <el-input v-model="form.HJQD" disabled></el-input>
+            <el-form-item label="订单编码:" prop="sourceOrderNo">
+              <el-input v-model="form.sourceOrderNo" disabled></el-input>
             </el-form-item>
-            <el-form-item label="合同编号:" prop="contractStartDate">
-              <el-input v-model="form.contractStartDate" disabled></el-input>
+            <el-form-item label="合同编号:" prop="contractCode">
+              <el-input v-model="form.contractCode" disabled></el-input>
             </el-form-item>
 
-            <el-form-item label="客户名称:" prop="contractEndDate">
-              <el-input v-model="form.contractEndDate" disabled></el-input>
+            <el-form-item label="客户名称:" prop="customerName">
+              <el-input v-model="form.customerName" disabled></el-input>
             </el-form-item>
-            <el-form-item label="发货模式:" prop="contractName">
-              <el-input v-model="form.contractName" disabled></el-input>
+            <el-form-item label="发货模式:" prop="deliveryMode">
+              <el-input v-model="form.deliveryMode" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item prop="productionRequirements" label="订单类型:">
-              <el-input v-model="form.productionRequirements" disabled></el-input>
+            <el-form-item prop="sourceOrderType" label="订单类型:">
+              <el-input v-model="form.sourceOrderType" disabled></el-input>
             </el-form-item>
-            <el-form-item prop="productionRequirements" label="合同名称:">
-              <el-input v-model="form.productionRequirements" disabled></el-input>
+            <el-form-item prop="contractName" label="合同名称:">
+              <el-input v-model="form.contractName" disabled></el-input>
             </el-form-item>
-            <el-form-item label="结算方式:" prop="payWay">
-              <el-input v-model="form.settlementModeName" disabled></el-input>
+            <el-form-item label="结算方式:" prop="settlementMode">
+              <el-input v-model="form.settlementMode" disabled></el-input>
             </el-form-item>
-            <el-form-item prop="contractFile" label="附件:">
-              <fileMain v-model="form.fileId" type="view"></fileMain>
+            <el-form-item prop="attachments" label="附件:">
+              <fileMain v-model="form.attachments" type="view"></fileMain>
             </el-form-item>
           </el-col>
         </el-row>
       </el-form>
       <headerTitle
-        :title="form.type == '2' ? '付款计划' : '收款计划'"
+        :title="menu === 'purchase' ? '付款计划' : '收款计划'"
         style="margin-top: 30px"
       ></headerTitle>
       <paymentCollectionPlanDetail
         ref="paymentCollectionPlanDetailRef"
+        :menu="menu"
         type="view"
       ></paymentCollectionPlanDetail>
     </div>
@@ -102,9 +103,16 @@
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
   import inventoryTabledetail from '@/BIZComponents/inventoryTableDetails.vue';
   import paymentCollectionPlanDetail from '@/BIZComponents/paymentCollectionPlan/Detail.vue';
+  import { receiptPaymentPlanById } from '@/api/financialManage/payAndCollectPlan';
 
   export default {
     mixins: [dictMixins],
+    props: {
+      menu: {
+        type: String,
+        default: 'sale'
+      }
+    },
     components: {
       inventoryTabledetail,
       bpmDetail,
@@ -113,11 +121,11 @@
     data() {
       return {
         fullscreen: false,
-        cacheKeyUrl: 'eos-contractManage-contractBook-inventoryTableDetails',
+        cacheKeyUrl: 'eos-financialManage-collectionPlan-detailDialog',
         activeName: '1',
         activeComp: 'main',
         tabOptions: [
-          { key: 'main', name: '合同详情' },
+          { key: 'main', name: '收款计划详情' },
           { key: 'bpm', name: '流程详情' },
         ],
         visible: false,
@@ -178,7 +186,7 @@
         this.activeComp = 'main';
         this.visible = true;
         this.activeName = '1';
-        this.getDetailData(row.id);
+        this.getDetailData(row.orderId);
         this.detailId = row.id;
       },
       changeK(key) {
@@ -219,28 +227,30 @@
       },
       async getDetailData(id) {
         this.loading = true;
-        const data = await getDetail(id);
+        const data = await receiptPaymentPlanById(id);
+        console.log('收款计划详情', data);
         this.loading = false;
         if (data) {
-          data.productList.forEach((item) => {
-            item['pricingWay'] = item.pricingWay || data.contractVO?.pricingWay;
-          });
-          this.detailData = data;
-          this.form = data.contractVO;
-          this.$refs.paymentListTable &&
-            this.$refs.paymentListTable.putTableValue(data.receiptPaymentList);
+          // data.productList.forEach((item) => {
+          //   item['pricingWay'] = item.pricingWay || data.contractVO?.pricingWay;
+          // });
+          // this.detailData = data;
+          this.form = data;
+          
           this.$nextTick(() => {
-            this.$refs.inventoryTabledetailRef &&
-              this.$refs.inventoryTabledetailRef.putTableValue({
-                ...data,
-                ...data.contractVO
-              });
-            this.$refs.rawDetailListRef &&
-              this.$refs.rawDetailListRef.putTableValueNew(this.form.rawList); //原料
-            this.$refs.outputDetailListRef &&
-              this.$refs.outputDetailListRef.putTableValueNew(
-                this.form.outputList
-              );
+            this.$refs.paymentCollectionPlanDetailRef &&
+            this.$refs.paymentCollectionPlanDetailRef.putTableValue(data.details);
+            // this.$refs.inventoryTabledetailRef &&
+            //   this.$refs.inventoryTabledetailRef.putTableValue({
+            //     ...data,
+            //     ...data.contractVO
+            //   });
+            // this.$refs.rawDetailListRef &&
+            //   this.$refs.rawDetailListRef.putTableValueNew(this.form.rawList); //原料
+            // this.$refs.outputDetailListRef &&
+            //   this.$refs.outputDetailListRef.putTableValueNew(
+            //     this.form.outputList
+            //   );
           });
         }
       }

+ 3 - 12
src/views/financialManage/collectionPlan/components/searchTable.vue

@@ -11,19 +11,11 @@ export default {
       paymentTypeOp,
       overdueOptions: [{
         label: '未逾期',
-        value: 1
+        value: 0
       },
       {
         label: '逾期中',
-        value: 0
-      }],
-      collectionTypeOp: [{
-        label: '收款计划',
         value: 1
-      },
-      {
-        label: '收款单',
-        value: 0
       }],
     };
   },
@@ -46,7 +38,7 @@ export default {
         },
         {
           label: '逾期状态:',
-          value: 'orderStatus',
+          value: 'overdueStatus',
           type: 'select',
           planList: this.overdueOptions,
           width: 380,
@@ -56,10 +48,9 @@ export default {
           label: '查询日期:',
           value: 'createTime',
           type: 'date',
-          dateType: 'datetimerange',
           placeholder: '',
           width: 380,
-          valueAr: ['createTimeStart', 'createTimeEnd']
+          valueAr: ['startDate', 'endDate']
         }
       ];
     }

+ 83 - 72
src/views/financialManage/collectionPlan/index.vue

@@ -51,13 +51,13 @@
               </template>
 
               <!-- 查看详情列 -->
-              <template v-slot:relationName="{ row }">
+              <template v-slot:detailNo="{ row }">
                 <el-link
                   type="primary"
                   :underline="false"
                   @click="openDetail(row)"
                 >
-                  {{ row.relationName }}
+                  {{ row.detailNo }}
                 </el-link>
               </template>
               <template v-slot:orderNo="{ row }">
@@ -131,7 +131,7 @@
         </div>
       </div>
     </el-card>
-    <detailDialog ref="detailDialogRef"></detailDialog>
+    <detailDialog ref="detailDialogRef" menu="sale"></detailDialog>
     <contractr-detail ref="contractDetailRef"></contractr-detail>
     <purchasingDetail ref="purchasingDetailRef"></purchasingDetail>
     <purchasePlanDetail ref="purchasePlanDetailRef"></purchasePlanDetail>
@@ -200,6 +200,7 @@ import printPurchaseOrder from '@/views/purchasingManage/purchaseOrder/invoice/c
 import { enterprisePage } from '@/api/contractManage/contractBook';
 import addOrEditDialogNew from '@/views/financialManage/invoiceManage/components/addOrEditDialogNew.vue'
 import { receiptPaymentPlanPage } from '@/api/financialManage/payAndCollectPlan';
+import { shippingModeOp, transactionMethodsOp } from '@/enum/dict.js';
 
 export default {
   mixins: [dictMixins, tabMixins],
@@ -221,6 +222,8 @@ export default {
   data() {
     return {
       activeComp: 'collectionPlan',
+      shippingModeOp, 
+      transactionMethodsOp,
       tabOptions: [
         { key: 'collectionPlan', name: '收款计划管理', reminder: 'purchaseOrderNum' },
       ],
@@ -252,33 +255,36 @@ export default {
           fixed: 'left'
         },
         {
-          prop: 'collectionPlanCode',
+          prop: 'detailNo',
           label: '收款计划编码',
           align: 'center',
           sortable: true,
-          slot: 'collectionPlanCode',
+          slot: 'detailNo',
           showOverflowTooltip: true,
           minWidth: 200,
         },
         {
-          prop: 'orderNo',
+          prop: 'sourceOrderNo',
           label: '订单编码',
           align: 'center',
           sortable: true,
-          slot: 'orderNo',
+          slot: 'sourceOrderNo',
           showOverflowTooltip: true,
           minWidth: 200,
         },
         {
-          prop: 'orderType',
+          prop: 'sourceOrderType',
           label: '订单类型',
           align: 'center',
           sortable: true,
           showOverflowTooltip: true,
           minWidth: 200,
+          formatter: (row) => {
+            return row.sourceOrderType == 2 ? '采购订单' : '销售订单';
+          }
         },
         {
-          prop: 'contractCode',
+          prop: 'contractNo',
           label: '合同编码',
           align: 'center',
           sortable: true,
@@ -286,7 +292,7 @@ export default {
           minWidth: 200,
         },
         {
-          prop: 'contractNo',
+          prop: 'contractCode',
           label: '合同编号',
           align: 'center',
           sortable: true,
@@ -302,7 +308,7 @@ export default {
           minWidth: 200,
         },
         {
-          prop: 'invoiceNo',
+          prop: 'invoiceOrderNo',
           label: '发票号',
           align: 'center',
           sortable: true,
@@ -310,97 +316,95 @@ export default {
           minWidth: 200,
         },
         {
-          prop: 'relationType',
+          prop: 'relatedReceivableOrderNo',
           label: '关联应收编码',
           align: 'center',
           showOverflowTooltip: true,
-          minWidth: 150,
-          formatter: (_row, _column, cellValue) => {
-            return _row.relationType == 1
-              ? '采购需求单'
-              : _row.relationType == 2
-              ? '采购计划单'
-              : _row.relationType == 3
-              ? '采购核价单'
-              : _row.relationType == 4
-              ? '采购合同'
-              : '';
-          }
+          minWidth: 150
         },
         {
-          prop: 'relationName',
+          prop: 'customerCode',
           label: '客户编号',
           align: 'center',
-          slot: 'relationName',
+          slot: 'customerCode',
           showOverflowTooltip: true,
           minWidth: 250
         },
         {
-          prop: 'deliveryDate',
+          prop: 'customerName',
           label: '客户名称',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 200
         },
         {
-          prop: 'purchaseTypeName',
+          prop: 'settlementMode',
           label: '结算方式',
           align: 'center',
           showOverflowTooltip: true,
-          minWidth: 140
+          minWidth: 140,
+          formatter: (row) => {
+            return this.getDictValue('结算方式', row.settlementMode);
+          }
         },
         {
-          prop: 'partaName',
+          prop: 'transactionMode',
           label: '交易方式',
           align: 'center',
           showOverflowTooltip: true,
-          minWidth: 200
+          minWidth: 200,
+          formatter: (row) => {
+            return this.transactionMethodsOp.find(item => item.value == row.transactionMode)?.label || '';
+          }
         },
         {
-          prop: 'partaLinkName',
+          prop: 'deliveryMode',
           label: '发货模式',
           align: 'center',
           showOverflowTooltip: true,
-          minWidth: 130
+          minWidth: 130,
+          formatter: (row) => {
+            return this.shippingModeOp.find(item => item.value == row.deliveryMode)?.label || '';
+          }
         },
 
         {
-          prop: 'partaTel',
+          prop: 'issueNumber',
           label: '期数',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 130
         },
         {
-          prop: 'productNames',
+          prop: 'paymentType',
           label: '款项类型',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 200
         },
         {
-          prop: 'productCodes',
+          prop: 'moneyName',
           label: '款项名称',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 140
         },
         {
-          prop: 'batchNos',
+          prop: 'paymentRatio',
           label: '比例',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 140
         },
         {
-          prop: 'productCount',
+          prop: 'planPaymentAmount',
           label: '计划收款金额',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 140
         },
         {
-          prop: 'inboundCount',
+          prop: 'planPaymentDate',
           label: '计划收款日期',
           align: 'center',
           showOverflowTooltip: true,
@@ -408,28 +412,31 @@ export default {
         },
 
         {
-          prop: 'partbName',
+          prop: 'isInvoice',
           label: '是否已开票',
           align: 'center',
           showOverflowTooltip: true,
-          minWidth: 250
+          minWidth: 150,
+          formatter: (_row, _column, cellValue) => {
+            return cellValue ? '是' : '否';
+          }
         },
         {
-          prop: 'partbLinkName',
+          prop: 'invoiceAmount',
           label: '已开票金额',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 120
         },
         {
-          prop: 'partbTel',
+          prop: 'invoiceDate',
           label: '开票日期',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 130
         },
         {
-          prop: 'isInspection',
+          prop: 'isGenerateReceivablePayment',
           label: '是否生成应收款项',
           align: 'center',
           showOverflowTooltip: true,
@@ -439,82 +446,85 @@ export default {
           }
         },
         {
-          prop: 'payAmount',
+          prop: 'receivableAmount',
           label: '应收金额',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 140
         },
         {
-          prop: 'createUserName',
+          prop: 'receivedAmount',
           label: '已收款金额',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 170
         },
         {
-          prop: 'createTime',
+          prop: 'actualReceivablePaymentDate',
           label: '实际收款日期',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 170
         },
         {
-          prop: 'progress',
+          prop: 'deliveryStatus',
           label: '发货状态',
           align: 'center',
           showOverflowTooltip: true,
           formatter: (_row, _column, cellValue) => {
-            return purchaseOrderProgressStatusEnum.find(
-              (val) => val.value == _row.progress
-            )?.label;
+            let options = [
+              { value: 0, label: '待发货' },
+              { value: 1, label: '部分发货' },
+              { value: 2, label: '全部发货' }
+            ];
+            return options.find(item => item.value == cellValue)?.label || '';
           },
           minWidth: 120
         },
         {
-          prop: 'collectionPlanStatus',
-          label: '审核状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100,
-          formatter: (_row, _column, cellValue) => {
-            return reviewStatus[_row.orderStatus];
-          }
-        },
-        {
-          prop: 'orderStatus',
+          prop: 'reconciliationStatus',
           label: '对账状态',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 100,
           formatter: (_row, _column, cellValue) => {
-            return reviewStatus[_row.orderStatus];
+            let options = [
+              { value: 0, label: '未对账' },
+              { value: 1, label: '部分对账' },
+              { value: 2, label: '全部对账' }
+            ];
+            return options.find(item => item.value == cellValue)?.label || '';
           }
         },
         {
-          prop: 'orderStatus2',
+          prop: 'paymentStatus',
           label: '收款状态',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 100,
           formatter: (_row, _column, cellValue) => {
-            return reviewStatus[_row.orderStatus];
+            let options = [
+              { value: 0, label: '未收款' },
+              { value: 1, label: '部分收款' },
+              { value: 2, label: '全部收款' }
+            ];
+            return options.find(item => item.value == cellValue)?.label || '';
           }
         },
         {
-          prop: 'orderStatus1',
+          prop: 'overdueStatus',
           label: '逾期状态',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 100,
           formatter: (_row, _column, cellValue) => {
-            return reviewStatus[_row.orderStatus];
+            return _row.overdueStatus == 1 ? '逾期中' : '未逾期';
           }
         },
         {
           columnKey: 'action',
           label: '操作',
-          width: 260,
+          width: 180,
           align: 'center',
           resizable: false,
           slot: 'action',
@@ -530,6 +540,7 @@ export default {
   },
   computed: {},
   created() {
+    this.requestDict('结算方式');
     this.requestDict('客户状态');
     parameterGetByCode({
       code: 'order_person_info'
@@ -601,10 +612,10 @@ export default {
     //新增编辑
     openEdit(row, type) {
       let partaIds = this.selection.map((item) => item.partaId);
-      if(this.selection.length == 0 || new Set(partaIds).size != 1) {
-        this.$message.warning('请选择相同客户的计划!');
-        return
-      }
+      // if(this.selection.length == 0 || new Set(partaIds).size != 1) {
+      //   this.$message.warning('请选择相同客户的计划!');
+      //   return
+      // }
       this.addOrEditDialogNewFlag = true;
       this.$nextTick(() => {
         this.$refs.addOrEditDialogNewRef.createInvoice1(row, 1, 1);

+ 266 - 34
src/views/financialManage/invoiceManage/components/collectionPlanDialog.vue

@@ -19,6 +19,8 @@
         row-key="id"
         height="calc(100vh - 500px)"
         class="dict-table"
+        :selection.sync="selection"
+        @columns-change="handleColumnChange"
       >
         <!-- 表头工具栏 -->
         <template v-slot:action="{ row }">
@@ -43,11 +45,15 @@
 </template>
 
 <script>
+  import dictMixins from '@/mixins/dictMixins';
+  import tabMixins from '@/mixins/tableColumnsMixin';
   import search from '@/views/financialManage/collectionPlan/components/searchTable.vue';
   import { getAccountstatementList } from '@/api/saleManage/accountstatement';
   import accountInfoDialog from './accountInfoDialog.vue';
+  import { shippingModeOp, transactionMethodsOp } from '@/enum/dict.js';
 
   export default {
+    mixins: [dictMixins, tabMixins],
     components: {
       search,
       accountInfoDialog
@@ -74,11 +80,16 @@
         }
       }
     },
-    data() {
-      return {
-        currentIndex: null,
-        accountInfoDialogFlag: false,
-        columns: [
+    computed: {
+      columns() {
+        return [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            fixed: 'left'
+          },
           {
             columnKey: 'index',
             label: '序号',
@@ -89,77 +100,298 @@
             fixed: 'left'
           },
           {
-            action: 'action',
-            slot: 'action',
+            prop: 'detailNo',
+            label: '收款计划编码',
             align: 'center',
-            label: '选择',
-            fixed: 'left'
+            sortable: true,
+            slot: 'detailNo',
+            showOverflowTooltip: true,
+            minWidth: 200,
           },
           {
-            prop: 'statementNo',
-            label: '对账单编码',
+            prop: 'sourceOrderNo',
+            label: '单编码',
             align: 'center',
-            slot: 'statementNo',
+            sortable: true,
+            slot: 'sourceOrderNo',
             showOverflowTooltip: true,
-            minWidth: 200
+            minWidth: 200,
           },
           {
-            prop: 'contactName',
-            label: '客户名称',
+            prop: 'sourceOrderType',
+            label: '订单类型',
+            align: 'center',
+            sortable: true,
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (row) => {
+              return row.sourceOrderType == 2 ? '采购订单' : '销售订单';
+            }
+          },
+          {
+            prop: 'contractNo',
+            label: '合同编码',
+            align: 'center',
+            sortable: true,
+            showOverflowTooltip: true,
+            minWidth: 200,
+          },
+          {
+            prop: 'contractCode',
+            label: '合同编号',
             align: 'center',
+            sortable: true,
             showOverflowTooltip: true,
-            minWidth: 180
+            minWidth: 200,
           },
           {
-            prop: 'startDate',
-            label: '对账开始日期',
+            prop: 'contractName',
+            label: '合同名称',
+            align: 'center',
+            sortable: true,
+            showOverflowTooltip: true,
+            minWidth: 200,
+          },
+          {
+            prop: 'invoiceOrderNo',
+            label: '发票号',
+            align: 'center',
+            sortable: true,
+            showOverflowTooltip: true,
+            minWidth: 200,
+          },
+          {
+            prop: 'relatedReceivableOrderNo',
+            label: '关联应收编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
+          {
+            prop: 'customerCode',
+            label: '客户编号',
+            align: 'center',
+            slot: 'customerCode',
+            showOverflowTooltip: true,
+            minWidth: 250
+          },
+          {
+            prop: 'customerName',
+            label: '客户名称',
             align: 'center',
-            slot: 'startDate',
             showOverflowTooltip: true,
             minWidth: 200
           },
           {
-            prop: 'endDate',
-            label: '对账结束日期',
+            prop: 'settlementMode',
+            label: '结算方式',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140,
+            formatter: (row) => {
+              return this.getDictValue('结算方式', row.settlementMode);
+            }
+          },
+          {
+            prop: 'transactionMode',
+            label: '交易方式',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (row) => {
+              return this.transactionMethodsOp.find(item => item.value == row.transactionMode)?.label || '';
+            }
+          },
+          {
+            prop: 'deliveryMode',
+            label: '发货模式',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            formatter: (row) => {
+              return this.shippingModeOp.find(item => item.value == row.deliveryMode)?.label || '';
+            }
+          },
+
+          {
+            prop: 'issueNumber',
+            label: '期数',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130
+          },
+          {
+            prop: 'paymentType',
+            label: '款项类型',
             align: 'center',
-            slot: 'endDate',
             showOverflowTooltip: true,
             minWidth: 200
           },
           {
-            prop: 'amountTotalPrice',
-            label: '总金额',
+            prop: 'moneyName',
+            label: '款项名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'paymentRatio',
+            label: '比例',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'planPaymentAmount',
+            label: '计划收款金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'planPaymentDate',
+            label: '计划收款日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+
+          {
+            prop: 'isInvoice',
+            label: '是否已开票',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue ? '是' : '否';
+            }
+          },
+          {
+            prop: 'invoiceAmount',
+            label: '已开票金额',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'invoiceDate',
+            label: '开票日期',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 130
           },
           {
-            prop: 'amountReceivablePrice',
+            prop: 'isGenerateReceivablePayment',
+            label: '是否生成应收款项',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue == 1 ? '是' : '否';
+            }
+          },
+          {
+            prop: 'receivableAmount',
             label: '应收金额',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130
+            minWidth: 140
           },
           {
-            prop: 'amountPayablePrice',
-            label: '应付金额',
+            prop: 'receivedAmount',
+            label: '已收款金额',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 130
+            minWidth: 170
           },
           {
-            prop: 'createTime',
-            label: '创建时间',
+            prop: 'actualReceivablePaymentDate',
+            label: '实际收款日期',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 170
+          },
+          {
+            prop: 'deliveryStatus',
+            label: '发货状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (_row, _column, cellValue) => {
+              let options = [
+                { value: 0, label: '待发货' },
+                { value: 1, label: '部分发货' },
+                { value: 2, label: '全部发货' }
+              ];
+              return options.find(item => item.value == cellValue)?.label || '';
+            },
+            minWidth: 120
+          },
+          {
+            prop: 'reconciliationStatus',
+            label: '对账状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              let options = [
+                { value: 0, label: '未对账' },
+                { value: 1, label: '部分对账' },
+                { value: 2, label: '全部对账' }
+              ];
+              return options.find(item => item.value == cellValue)?.label || '';
+            }
+          },
+          {
+            prop: 'paymentStatus',
+            label: '收款状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              let options = [
+                { value: 0, label: '未收款' },
+                { value: 1, label: '部分收款' },
+                { value: 2, label: '全部收款' }
+              ];
+              return options.find(item => item.value == cellValue)?.label || '';
+            }
+          },
+          {
+            prop: 'overdueStatus',
+            label: '逾期状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return _row.overdueStatus == 1 ? '逾期中' : '未逾期';
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 180,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right'
           }
-        ],
+        ]
+      }
+    },
+    data() {
+      return {
+        currentIndex: null,
+        accountInfoDialogFlag: false,
         currentRow: {},
-        radio: null
+        radio: null,
+        shippingModeOp,
+        transactionMethodsOp
       };
     },
-
+    created() {
+      this.requestDict('结算方式');
+    },
     methods: {
       init(item = {}, currentIndex = '') {
         this.currentIndex = currentIndex;

+ 5 - 14
src/views/financialManage/paymentPlan/components/searchTable.vue

@@ -11,19 +11,11 @@ export default {
       paymentTypeOp,
       overdueOptions: [{
         label: '未逾期',
-        value: 1
+        value: 0
       },
       {
         label: '逾期中',
-        value: 0
-      }],
-      collectionTypeOp: [{
-        label: '收款计划',
         value: 1
-      },
-      {
-        label: '收款单',
-        value: 0
       }],
     };
   },
@@ -33,20 +25,20 @@ export default {
       return [
         {
           label: '关键字:',
-          value: 'searchName',
+          value: 'keyWord',
           type: 'input',
           placeholder: '收款计划编码/来源单据编码/客户名称'
         },
         {
           label: '款项类型:',
-          value: 'collectionType',
+          value: 'paymentTypeId',
           type: 'select',
           planList: this.paymentTypeOp,
           placeholder: '请选择'
         },
         {
           label: '逾期状态:',
-          value: 'orderStatus',
+          value: 'overdueStatus',
           type: 'select',
           planList: this.overdueOptions,
           width: 380,
@@ -56,10 +48,9 @@ export default {
           label: '查询日期:',
           value: 'createTime',
           type: 'date',
-          dateType: 'datetimerange',
           placeholder: '',
           width: 380,
-          valueAr: ['createTimeStart', 'createTimeEnd']
+          valueAr: ['startDate', 'endDate']
         }
       ];
     }

+ 86 - 73
src/views/financialManage/paymentPlan/index.vue

@@ -19,7 +19,7 @@
         </div>
       </div>
       <div class="main" style="padding: 0 10px">
-        <div v-if="activeComp == 'collectionPlan'">
+        <div v-if="activeComp == 'paymentPlan'">
           <div class="ele-border-lighter form-content" v-loading="loading">
             <search-table @search="reload"></search-table>
 
@@ -51,13 +51,13 @@
               </template>
 
               <!-- 查看详情列 -->
-              <template v-slot:relationName="{ row }">
+              <template v-slot:detailNo="{ row }">
                 <el-link
                   type="primary"
                   :underline="false"
                   @click="openDetail(row)"
                 >
-                  {{ row.relationName }}
+                  {{ row.detailNo }}
                 </el-link>
               </template>
               <template v-slot:orderNo="{ row }">
@@ -131,7 +131,7 @@
         </div>
       </div>
     </el-card>
-    <detailDialog ref="detailDialogRef"></detailDialog>
+    <detailDialog ref="detailDialogRef" menu="purchase"></detailDialog>
     <contractr-detail ref="contractDetailRef"></contractr-detail>
     <purchasingDetail ref="purchasingDetailRef"></purchasingDetail>
     <purchasePlanDetail ref="purchasePlanDetailRef"></purchasePlanDetail>
@@ -191,6 +191,8 @@ import exceptionList from '@/views/saleManage/saleOrder/exceptionManagement/exce
 import { getToDoReminder } from '@/api/common/index';
 import printPurchaseOrder from '@/views/purchasingManage/purchaseOrder/invoice/components/print-PurchaseOrder.vue';
   import { enterprisePage } from '@/api/contractManage/contractBook';
+  import { receiptPaymentPlanPage } from '@/api/financialManage/payAndCollectPlan';
+  import { shippingModeOp, transactionMethodsOp } from '@/enum/dict.js';
 
 export default {
   mixins: [dictMixins, tabMixins],
@@ -210,9 +212,11 @@ export default {
   },
   data() {
     return {
-      activeComp: 'collectionPlan',
+      activeComp: 'paymentPlan',
+      shippingModeOp,
+      transactionMethodsOp,
       tabOptions: [
-        { key: 'collectionPlan', name: '收款计划管理', reminder: 'purchaseOrderNum' },
+        { key: 'paymentPlan', name: '付款计划管理', reminder: 'purchaseOrderNum' },
       ],
 
       selection: [], //单选中集合
@@ -242,33 +246,36 @@ export default {
           fixed: 'left'
         },
         {
-          prop: 'orderNo',
+          prop: 'detailNo',
           label: '付款计划编码',
           align: 'center',
           sortable: true,
-          slot: 'orderNo',
+          slot: 'detailNo',
           showOverflowTooltip: true,
           minWidth: 200,
         },
         {
-          prop: 'orderNo',
+          prop: 'sourceOrderNo',
           label: '订单编码',
           align: 'center',
           sortable: true,
-          slot: 'orderNo',
+          slot: 'sourceOrderNo',
           showOverflowTooltip: true,
           minWidth: 200,
         },
         {
-          prop: 'sourceTypeName',
+          prop: 'sourceOrderType',
           label: '订单类型',
           align: 'center',
           sortable: true,
           showOverflowTooltip: true,
           minWidth: 200,
+          formatter: (row) => {
+            return row.sourceOrderType == 2 ? '采购订单' : '销售订单';
+          }
         },
         {
-          prop: 'sourceTypeName',
+          prop: 'contractNo',
           label: '合同编码',
           align: 'center',
           sortable: true,
@@ -276,7 +283,7 @@ export default {
           minWidth: 200,
         },
         {
-          prop: 'sourceTypeName',
+          prop: 'contractCode',
           label: '合同编号',
           align: 'center',
           sortable: true,
@@ -284,7 +291,7 @@ export default {
           minWidth: 200,
         },
         {
-          prop: 'sourceTypeName',
+          prop: 'contractName',
           label: '合同名称',
           align: 'center',
           sortable: true,
@@ -292,7 +299,7 @@ export default {
           minWidth: 200,
         },
         {
-          prop: 'sourceTypeName',
+          prop: 'invoiceOrderNo',
           label: '发票号',
           align: 'center',
           sortable: true,
@@ -300,97 +307,95 @@ export default {
           minWidth: 200,
         },
         {
-          prop: 'relationType',
+          prop: 'relatedReceivableOrderNo',
           label: '关联应付编码',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 150,
-          formatter: (_row, _column, cellValue) => {
-            return _row.relationType == 1
-              ? '采购需求单'
-              : _row.relationType == 2
-              ? '采购计划单'
-              : _row.relationType == 3
-              ? '采购核价单'
-              : _row.relationType == 4
-              ? '采购合同'
-              : '';
-          }
         },
         {
-          prop: 'relationName',
+          prop: 'customerCode',
           label: '客户编码',
           align: 'center',
-          slot: 'relationName',
+          slot: 'customerCode',
           showOverflowTooltip: true,
           minWidth: 250
         },
         {
-          prop: 'deliveryDate',
+          prop: 'customerName',
           label: '客户名称',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 200
         },
         {
-          prop: 'purchaseTypeName',
+          prop: 'settlementMode',
           label: '结算方式',
           align: 'center',
           showOverflowTooltip: true,
-          minWidth: 140
+          minWidth: 140,
+          formatter: (row) => {
+            return this.getDictValue('结算方式', row.settlementMode);
+          }
         },
         {
-          prop: 'partaName',
+          prop: 'transactionMode',
           label: '交易方式',
           align: 'center',
           showOverflowTooltip: true,
-          minWidth: 200
+          minWidth: 200,
+          formatter: (row) => {
+            return this.transactionMethodsOp.find(item => item.value == row.transactionMode)?.label || '';
+          }
         },
         {
-          prop: 'partaLinkName',
+          prop: 'deliveryMode',
           label: '发货模式',
           align: 'center',
           showOverflowTooltip: true,
-          minWidth: 130
+          minWidth: 130,
+          formatter: (row) => {
+            return this.shippingModeOp.find(item => item.value == row.deliveryMode)?.label || '';
+          }
         },
 
         {
-          prop: 'partaTel',
+          prop: 'issueNumber',
           label: '期数',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 130
         },
         {
-          prop: 'productNames',
+          prop: 'paymentType',
           label: '款项类型',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 200
         },
         {
-          prop: 'productCodes',
+          prop: 'moneyName',
           label: '款项名称',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 140
         },
         {
-          prop: 'batchNos',
+          prop: 'paymentRatio',
           label: '比例',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 140
         },
         {
-          prop: 'productCount',
+          prop: 'planPaymentAmount',
           label: '计划收款金额',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 140
         },
         {
-          prop: 'inboundCount',
+          prop: 'planPaymentDate',
           label: '计划收款日期',
           align: 'center',
           showOverflowTooltip: true,
@@ -398,28 +403,31 @@ export default {
         },
 
         {
-          prop: 'partbName',
+          prop: 'isInvoice',
           label: '是否已开票',
           align: 'center',
           showOverflowTooltip: true,
-          minWidth: 250
+          minWidth: 150,
+          formatter: (_row, _column, cellValue) => {
+            return cellValue ? '是' : '否';
+          }
         },
         {
-          prop: 'partbLinkName',
+          prop: 'invoiceAmount',
           label: '已开票金额',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 120
         },
         {
-          prop: 'partbTel',
+          prop: 'invoiceDate',
           label: '开票日期',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 130
         },
         {
-          prop: 'isInspection',
+          prop: 'isGenerateReceivablePayment',
           label: '是否生成应付款项',
           align: 'center',
           showOverflowTooltip: true,
@@ -429,76 +437,79 @@ export default {
           }
         },
         {
-          prop: 'payAmount',
+          prop: 'receivableAmount',
           label: '应付金额',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 140
         },
         {
-          prop: 'createUserName',
+          prop: 'receivedAmount',
           label: '已付款金额',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 170
         },
         {
-          prop: 'createTime',
+          prop: 'actualReceivablePaymentDate',
           label: '实际付款日期',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 170
         },
         {
-          prop: 'progress',
+          prop: 'deliveryStatus',
           label: '收货状态',
           align: 'center',
           showOverflowTooltip: true,
           formatter: (_row, _column, cellValue) => {
-            return purchaseOrderProgressStatusEnum.find(
-              (val) => val.value == _row.progress
-            )?.label;
+            let options = [
+              { value: 0, label: '待发货' },
+              { value: 1, label: '部分发货' },
+              { value: 2, label: '全部发货' }
+            ];
+            return options.find(item => item.value == cellValue)?.label || '';
           },
           minWidth: 120
         },
         {
-          prop: 'orderStatus',
-          label: '审核状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100,
-          formatter: (_row, _column, cellValue) => {
-            return reviewStatus[_row.orderStatus];
-          }
-        },
-        {
-          prop: 'orderStatus',
+          prop: 'reconciliationStatus',
           label: '对账状态',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 100,
           formatter: (_row, _column, cellValue) => {
-            return reviewStatus[_row.orderStatus];
+            let options = [
+              { value: 0, label: '未对账' },
+              { value: 1, label: '部分对账' },
+              { value: 2, label: '全部对账' }
+            ];
+            return options.find(item => item.value == cellValue)?.label || '';
           }
         },
         {
-          prop: 'orderStatus',
+          prop: 'paymentStatus',
           label: '付款状态',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 100,
           formatter: (_row, _column, cellValue) => {
-            return reviewStatus[_row.orderStatus];
+            let options = [
+              { value: 0, label: '未收款' },
+              { value: 1, label: '部分收款' },
+              { value: 2, label: '全部收款' }
+            ];
+            return options.find(item => item.value == cellValue)?.label || '';
           }
         },
         {
-          prop: 'orderStatus',
+          prop: 'overdueStatus',
           label: '逾期状态',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 100,
           formatter: (_row, _column, cellValue) => {
-            return reviewStatus[_row.orderStatus];
+            return _row.overdueStatus == 1 ? '逾期中' : '未逾期';
           }
         },
         {
@@ -512,7 +523,7 @@ export default {
           fixed: 'right'
         }
       ],
-      cacheKeyUrl: 'eos-5f2ac512-purchaseOrder-collectionPlan',
+      cacheKeyUrl: 'eos-5f2ac512-purchaseOrder-paymentPlan',
       isRequired: true,
       timeR: null,
       toDoReminder: {}
@@ -520,6 +531,7 @@ export default {
   },
   computed: {},
   created() {
+    this.requestDict('结算方式');
     this.requestDict('客户状态');
     parameterGetByCode({
       code: 'order_person_info'
@@ -572,14 +584,15 @@ export default {
       // this.curNodeData = data;
       this.reload({ categoryId: data.id });
     },
-    /* 表格数据源 */
+    /* 表格数据源 1:销售订单、2:采购订单 */
     datasource({ page, limit, where, order }) {
       this.params = {
         pageNum: page,
         size: limit,
+        sourceType: 2,
         ...where
       };
-      return getTableList(this.params);
+      return receiptPaymentPlanPage(this.params);
     },
 
     /* 刷新表格 */

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

@@ -891,7 +891,6 @@
         winnerSuppleIds: '',
         shippingModeOp,
         transactionMethodsOp,
-        // settlementDate: [],
       };
     },
     computed: {
@@ -1508,6 +1507,7 @@
       orderDiscountAmount(val = 0) {
         console.log('orderDiscountAmount~~~~', val);
         this.form.payAmount = val;
+        this.$refs.paymentCollectionPlanRef.setDiscountAmount(val);
         //this.form.payAmount = undefined
       },
 
@@ -1585,6 +1585,12 @@
               businessDeptName,
               businessUserId,
               businessUserName,
+              transactionMode,
+              startSettlementDate,
+              receiptDate,
+              issueNumber,
+              endSettlementDate,
+              deliveryMode,
             } = contractVO;
             this.form = Object.assign({}, this.form, {
               partaAddress,
@@ -1619,7 +1625,14 @@
               purchaseDeptId: businessDeptId,
               purchaseDeptName: businessDeptName,
               purchaseUserId: businessUserId,
-              purchaseUserName: businessUserName
+              purchaseUserName: businessUserName,
+              transactionMode,
+              startSettlementDate,
+              receiptDate,
+              issueNumber,
+              endSettlementDate,
+              deliveryMode,
+              settlementDate: startSettlementDate ? [startSettlementDate, endSettlementDate] : [],
             });
             this.getLinkInfo(partaId);
             // info.productList = info.productList.map((item) => {
@@ -1640,6 +1653,13 @@
               });
             }
 
+            const receiptData = {
+              receiptPaymentList: data.receiptPaymentList,
+              payAmount: discountTotalPrice
+            }
+            this.$refs.paymentCollectionPlanRef &&
+              this.$refs.paymentCollectionPlanRef.putTableValue(receiptData);
+
             this.$refs.rawDetailListRef &&
               this.$refs.rawDetailListRef.putTableValue(contractVO.rawList); //原料
             this.$refs.outputDetailListRef &&
@@ -1665,6 +1685,7 @@
         this.loading = true;
         const data = await getpurchaseorderDetail(id);
         this.loading = false;
+        data.settlementDate = data.startSettlementDate ? [data.startSettlementDate, data.endSettlementDate] : [];
         this.form = data;
         console.log('data~~~~~~~', data);
         if (data) {
@@ -1677,7 +1698,7 @@
             this.$refs.outputDetailListRef &&
               this.$refs.outputDetailListRef.putTableValue(data.outputList); //产成品
             this.getLinkInfo(data.partaId);
-            this.form.settlementDate = data.startSettlementDate ? [data.startSettlementDate, data.endSettlementDate] : [];
+            
             this.$refs.paymentCollectionPlanRef && this.$refs.paymentCollectionPlanRef.putTableValue(data);
             this.getrequireUser(this.form.requireDeptId);
             if(data.purchaseDeptId) {
@@ -1991,6 +2012,7 @@
       // 结算方式改变
       settlementModeChange(v) {
         console.log('v~~~', v.dictCode);
+        this.form.settlementModeName = v.dictValue;
         // this.$set(this.form, 'issueNumber', 1);
         this.$set(this.form, 'settlementDate', []);
         this.$set(this.form, 'receiptDate', '');

+ 2 - 2
src/views/purchasingManage/purchaseOrder/components/detailDialog.vue

@@ -159,7 +159,7 @@
             <el-form-item v-if="form.settlementMode == 1" label="结算日期范围" prop="settlementDate">
               <el-date-picker
                 style="width: 100%"
-                v-model="settlementDate"
+                v-model="form.settlementDate"
                 type="daterange"
                 value-format="yyyy-MM-dd"
                 range-separator="至"
@@ -172,7 +172,7 @@
   
             <el-form-item v-if="form.settlementMode == 2" label="结算月份范围" prop="settlementDate">
               <el-date-picker
-                v-model="settlementDate"
+                v-model="form.settlementDate"
                 type="monthrange"
                 range-separator="至"
                 start-placeholder="开始月份"

+ 36 - 12
src/views/saleManage/saleOrder/components/addDialogNew.vue

@@ -1320,6 +1320,12 @@
               businessDeptName,
               businessUserId,
               businessUserName,
+              transactionMode,
+              startSettlementDate,
+              receiptDate,
+              issueNumber,
+              endSettlementDate,
+              deliveryMode,
             } = contractVO;
             if(businessDeptId){
               this.getSalesmanUser(businessDeptId);
@@ -1361,6 +1367,13 @@
                 salesDeptName: businessDeptName,
                 salesmanId: businessUserId,
                 salesmanName: businessUserName,
+                transactionMode,
+                startSettlementDate,
+                receiptDate,
+                issueNumber,
+                endSettlementDate,
+                deliveryMode,
+                settlementDate: startSettlementDate ? [startSettlementDate, endSettlementDate] : [],
               },
               !row
                 ? {
@@ -1377,9 +1390,18 @@
               return item;
             });
 
+            const receiptData = {
+              receiptPaymentList: data.receiptPaymentList,
+              payAmount: discountTotalPrice
+            }
+            this.$refs.paymentCollectionPlanRef &&
+              this.$refs.paymentCollectionPlanRef.putTableValue(receiptData);
+
             this.getLinkInfo(partaId);
             this.$refs.inventoryTable &&
               this.$refs.inventoryTable.putTableValue(data);
+            
+            
           });
         }
       },
@@ -1390,6 +1412,7 @@
         this.loading = true;
         const data = await getSaleOrderDetail(id);
         this.loading = false;
+        data.settlementDate = data.startSettlementDate ? [data.startSettlementDate, data.endSettlementDate] : [];
         this.form = data;
         if (data.partaId) {
           await this.changeParent({ id: data.partaId }, true);
@@ -1408,7 +1431,7 @@
             
             this.getLinkInfo(data.partaId);
             console.log('paymentCollectionPlanRef~~~~', data);
-            this.form.settlementDate = data.startSettlementDate ? [data.startSettlementDate, data.endSettlementDate] : [];
+            
             this.$refs.paymentCollectionPlanRef && this.$refs.paymentCollectionPlanRef.putTableValue(data);
             // this.$refs.paymentCollectionPlanRef.setDiscountAmount(data.payAmount);
             this.$store.commit('order/setContractId', data.partaId);
@@ -1779,6 +1802,7 @@
       // 结算方式改变
       settlementModeChange(v) {
         console.log('v~~~', v.dictCode);
+        this.form.settlementModeName = v.dictValue;
         // this.$set(this.form, 'issueNumber', 1);
         this.$set(this.form, 'settlementDate', []);
         this.$set(this.form, 'receiptDate', '');
@@ -1879,17 +1903,17 @@
             return;
           }
 
-          // const receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + cur.price, 0);
-          // if(+receiptPaymentListSum != +commitData.payAmount){
-          //   this.$message.error('计划收款金额合计与优惠后金额不一致');
-          //   return;
-          // }
-
-          // const ratioSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + cur.ratio, 0);
-          // if(+ratioSum != 100){
-          //   this.$message.error('比例合计必须为100%');
-          //   return;
-          // }
+          const receiptPaymentListSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + +cur.price, 0);
+          if(+receiptPaymentListSum != +commitData.payAmount){
+            this.$message.error('计划收款金额合计与优惠后金额不一致');
+            return;
+          }
+
+          const ratioSum = commitData.receiptPaymentList.reduce((acc, cur) => acc + cur.ratio, 0);
+          if(+ratioSum != 100){
+            this.$message.error('比例合计必须为100%');
+            return;
+          }
           
           if (isTemporary.length > 0) {
             this.$message.error(

+ 2 - 2
src/views/saleManage/saleOrder/components/darwerComponents/saleOrderInfo.vue

@@ -27,7 +27,7 @@
           <el-form-item v-if="form.settlementMode == 1" label="结算日期范围" prop="settlementDate">
             <el-date-picker
               style="width: 100%"
-              v-model="settlementDate"
+              v-model="form.settlementDate"
               type="daterange"
               value-format="yyyy-MM-dd"
               range-separator="至"
@@ -40,7 +40,7 @@
 
           <el-form-item v-if="form.settlementMode == 2" label="结算月份范围" prop="settlementDate">
             <el-date-picker
-              v-model="settlementDate"
+              v-model="form.settlementDate"
               type="monthrange"
               range-separator="至"
               start-placeholder="开始月份"

+ 2 - 2
src/views/saleManage/saleOrder/index.vue

@@ -54,7 +54,7 @@
                   type="primary"
                   icon="el-icon-plus"
                   class="ele-btn-icon"
-                  @click="openEditNew('add', {})"
+                  @click="openEdit('add', {})"
                   v-if="$hasPermission('eom:saleorder:save')"
                 >
                   新建
@@ -150,7 +150,7 @@
                   type="primary"
                   :underline="false"
                   icon="el-icon-edit"
-                  @click="openEditNew('edit', row)"
+                  @click="openEdit('edit', row)"
                   v-if="
                     $hasPermission('eom:saleorder:update') &&
                     [0, 3].includes(row.orderStatus)

+ 2 - 2
vue.config.js

@@ -36,9 +36,9 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        target: 'http://192.168.1.25:18086', //开发
+        target: 'http://192.168.1.251:18086', //开发
         // target: 'http://192.168.1.251:18186', //测试
-        // target: 'http://192.168.1.23:18086',//罗
+        // target: 'http://192.168.1.25:18086',//罗
         // target: 'http://192.168.1.144:18086',//付
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域