Просмотр исходного кода

fix(付款计划管理): 添加先款后票计划的付款状态校验

liujt 4 месяцев назад
Родитель
Сommit
6d970ddea2

+ 15 - 0
src/views/financialManage/invoiceManage/components/collectionPlanDialog.vue

@@ -452,6 +452,21 @@
         let initiatorIds = this.selection.map((item) => item.initiatorId);
         let invoiceStatus = this.selection.map((item) => item.invoiceStatus);
         console.log(customerIds, initiatorIds);
+        let flag = false
+        if(this.type == 2) {
+          this.selection.forEach(item => {
+            if(item.transactionMode == 2 && item.paymentStatus == 0) {
+              console.log('selection', item);
+              flag = true
+            }
+          })
+        }
+        
+        console.log(customerIds, initiatorIds, flag);
+        if(flag) {
+          this.$message.warning('先款后票的计划需要付款后再开票!');
+          return
+        }
         if(invoiceStatus.includes(2)) {
           this.$message.warning('请选择未开票的计划!');
           return

+ 16 - 9
src/views/financialManage/invoiceManage/components/tableInfoNew.vue

@@ -196,6 +196,12 @@
             slot: 'invoiceAmount',
             align: 'center'
           },
+          {
+            minWidth: 150,
+            prop: 'invoicedAmount',
+            label: '已开票金额',
+            align: 'center'
+          },
           {
             minWidth: 150,
             prop: 'taxRate',
@@ -284,16 +290,17 @@
               key: '',
               amountTotalPrice: 0,
               details: [{
-                invoiceAmount: 0,
-                taxRate: 0,
-                noTaxSinglePrice: 0,
-                totalCount: 0,
+                invoicedAmount: '',
+                invoiceAmount: '',
+                taxRate: '',
+                noTaxSinglePrice: '',
+                totalCount: '',
                 quoteWay: '',
-                singlePrice: 0,
-                totalPrice: 0,
-                discountRatio: 0,
-                discountSinglePrice: 0,
-                discountAmount: 0,
+                singlePrice: '',
+                totalPrice: '',
+                discountRatio: 100,
+                discountSinglePrice: '',
+                discountAmount: '',
               }]
             }
           ],

+ 13 - 28
src/views/financialManage/paymentPlan/index.vue

@@ -99,30 +99,6 @@
               </template>
               <!-- 操作列 -->
               <template v-slot:action="{ row }">
-                <el-link
-                  type="primary"
-                  :underline="false"
-                  icon="el-icon-edit"
-                  v-if="
-                    (isNeed_process_is_close &&
-                      [0, 3].includes(row.orderStatus)) ||
-                    !isNeed_process_is_close
-                  "
-                  @click="openEdit('edit', row)"
-                >
-                  修改
-                </el-link>
-                <el-link
-                  type="primary"
-                  :underline="false"
-                  icon="el-icon-plus"
-                  @click="saleOrderSubmit(row)"
-                  v-if="
-                    isNeed_process_is_close && [0, 3].includes(row.orderStatus)
-                  "
-                >
-                  提交
-                </el-link>
                 <el-popconfirm
                   class="ele-action"
                   title="确定要删除此信息吗?"
@@ -148,7 +124,7 @@
                   type="primary"
                   :underline="false"
                   icon="el-icon-plus"
-                  v-if="row.invoiceStatus != 2"
+                  v-if="row.invoiceStatus != 2 && !(row.transactionMode == 2 && row.paymentStatus == 0)"
                   @click="openEdit('add', row)"
                 >
                   新增发票
@@ -575,8 +551,6 @@ export default {
     reload(where) {
       this.$refs.table.reload({ page: 1, where });
     },
-
-    //新增编辑
     //新增编辑
     openEdit(type, row) {
       const select = []
@@ -586,7 +560,18 @@ export default {
         let customerIds = this.selection.map((item) => item.customerId);
         let initiatorIds = this.selection.map((item) => item.initiatorId);
         let invoiceStatus = this.selection.map((item) => item.invoiceStatus);
-        console.log(customerIds, initiatorIds);
+        let flag = false
+        this.selection.forEach(item => {
+          if(item.transactionMode == 2 && item.paymentStatus == 0) {
+            console.log('selection', item);
+            flag = true
+          }
+        })
+        console.log(customerIds, initiatorIds, flag);
+        if(flag) {
+          this.$message.warning('先款后票的计划需要付款后再开票!');
+          return
+        }
         if(invoiceStatus.includes(2)) {
           this.$message.warning('请选择未开票的计划!');
           return