hbchen 2 år sedan
förälder
incheckning
e54cbdefaf
1 ändrade filer med 56 tillägg och 24 borttagningar
  1. 56 24
      src/views/financialManagement/contractProgress.vue

+ 56 - 24
src/views/financialManagement/contractProgress.vue

@@ -105,8 +105,25 @@
       // 到款金额
       havePlacementMoney:'',
       waitPlacementMoney:'',
-      allPlacementMoney:''
+      allPlacementMoney:'',
+      // FICC开票金额
+      haveInvoiceMoneyFICC:'',
+      waitInvoiceMoneyFICC:'',
+      allInvoiceMoneyFICC:'',
+      // FICC到款金额
+      havePlacementMoneyFICC:'',
+      waitPlacementMoneyFICC:'',
+      allPlacementMoneyFICC:'', 
+      // 权益开票金额
+      haveInvoiceMoneyQY:'',
+      waitInvoiceMoneyQY:'',
+      allInvoiceMoneyQY:'',
+      // 权益到款金额
+      havePlacementMoneyQY:'',
+      waitPlacementMoneyQY:'',
+      allPlacementMoneyQY:'',
     },
+
     // 有效期
     contractValidityDate:[],
     // 合同编号----------------------列表
@@ -178,6 +195,8 @@
     // 开票时 权益的销售列表
     sellerInvoiceListQ:[]
   })
+  // 销售列表类型1-单Ficc 2-单权益 3-ficc和权益
+  const sellerListType=ref(3)
   // ---------------开票信息
   const invoiceForm=reactive({
     invoiceData:[
@@ -226,8 +245,6 @@
   //所有的销售列表包括ficc和权益
   let allSellerArray=[]
 
-  // 销售列表类型1-单Ficc 2-单权益 3-ficc和权益
-  const sellerListType=ref(3)
   // 销售列表
   const sellerArray=ref([])
   // 选中的销售数组
@@ -295,8 +312,6 @@
   const previewImageTitle=ref('')
   // 是否是新公司的复选框勾选判断
   let is_new_company=ref(false)
-  // 合同套餐 - 1-ficc 2-权益 3-ficc+权益
-  const contractServiceType=ref(3)
 
 
   // ------------------ 到款预登记
@@ -606,10 +621,13 @@
   // 添加行
   const addTableRow=(type)=>{
     if(type=='invoice'){
-      invoiceForm.invoiceData.push({service_product_id:'',origin_amount:'',amount:'',invoice_date:'',remark:'',
+      invoiceForm.invoiceData.push({
+        service_product_id:sellerListType.value == 3?'':sellerListType.value,origin_amount:'',amount:'',invoice_date:'',remark:'',
       seller_id:'',seller_name:'',amountDomType:'text',remarkDomType:'text'})
     }else{
-      placementForm.placementData.push({service_product_id:'',origin_amount:'',amount:'',invoice_date:'',remark:'',amountDomType:'text',remarkDomType:'text'})
+      placementForm.placementData.push({
+        service_product_id:sellerListType.value == 3?'':sellerListType.value,origin_amount:'',
+        amount:'',invoice_date:'',remark:'',amountDomType:'text',remarkDomType:'text'})
     }
   }
 
@@ -626,10 +644,12 @@
         return
       }
       invoiceForm.invoiceData.splice((index+1),0,
-      {service_product_id:'',origin_amount:'',amount:'',invoice_date:'',remark:'',seller_id:'',seller_name:'',amountDomType:'text',remarkDomType:'text'})
+      {service_product_id:sellerListType.value == 3?'':sellerListType.value,origin_amount:'',
+      amount:'',invoice_date:'',remark:'',seller_id:'',seller_name:'',amountDomType:'text',remarkDomType:'text'})
     }else{
       placementForm.placementData.splice((index+1),0,
-      {service_product_id:'',origin_amount:'',amount:'',invoice_date:'',remark:'',amountDomType:'text',remarkDomType:'text'})
+      {service_product_id:sellerListType.value == 3?'':sellerListType.value,origin_amount:'',
+      amount:'',invoice_date:'',remark:'',amountDomType:'text',remarkDomType:'text'})
     }
   }
   // 表格删除行
@@ -651,7 +671,7 @@
       tempArr=placementForm.placementData
       word='到款'
     }
-    if(tempArr[index].origin_amount=='' && tempArr[index].amount=='' && tempArr[index].service_product_id==''
+    if(tempArr[index].origin_amount=='' && tempArr[index].amount=='' && (tempArr[index].service_product_id=='' || sellerListType.value != 3)
     && tempArr[index].invoice_date=='' && !haveSalesman){
       // 没有内容 直接删除
       tempArr.splice(index,1)
@@ -1089,17 +1109,18 @@
         contract_source:res.data.contract_source,
       }
       // 销售
-      if(res.data.contract_source == 0){
-        cascaderSelectSeller.value = res.data.seller_ids.split(',').map(item => +item)
+      if(res.data.seller_id && res.data.rai_seller_id){
         contractInfo.showServiceFicc = contractInfo.showServiceQy=true
+      }else if(!res.data.seller_id){
+        sellerArray.value=allSellerArray.rai_list
+        contractInfo.showServiceQy=true
       }else{
-        if(res.data.rai_seller_name){
-          sellerArray.value=allSellerArray.rai_list
-          contractInfo.showServiceQy=true
-        }else{
-          sellerArray.value=allSellerArray.ficc_list
-          contractInfo.showServiceFicc=true
-        }
+        sellerArray.value=allSellerArray.ficc_list
+        contractInfo.showServiceFicc=true
+      }
+      if(res.data.contract_source == 0){
+        sellerArray.value = allSellerArray.all_list
+        cascaderSelectSeller.value = res.data.seller_ids.split(',').map(item => +item) 
       }
 
       rmbRate.value=res.data.rmb_rate
@@ -1120,7 +1141,7 @@
       contractInfo.form.services_amount = res.data.service_amount_list.find(it => it.product_id==1)?
       res.data.service_amount_list.find(it => it.product_id==1).service_amount:0
       contractInfo.form.services_Qy_amount = res.data.service_amount_list.find(it => it.product_id==2)?
-      res.data.service_amount_list.find(it => it.product_id==1).service_amount:0
+      res.data.service_amount_list.find(it => it.product_id==2).service_amount:0
       res.data.service_list.map(item =>{
         if(item.service_template_id==2){
           // ficc小套餐
@@ -1162,6 +1183,17 @@
         }
       }).filter(Boolean)
       contractInfo.contractValidityDate=[res.data.start_date,res.data.end_date]
+      
+      if(res.data.seller_id && res.data.rai_seller_id){
+        sellerListType.value = 3
+      }else if(!res.data.seller_id){
+        sellerListType.value = 2
+      }else{
+        sellerListType.value = 1
+      }
+      
+      invoiceForm.invoiceData[0].service_product_id = 
+      placementForm.placementData[0].service_product_id=sellerListType.value == 3?'':sellerListType.value
 
       // 开票
       contractInfo.moneyData.allInvoiceMoney = contractInfo.moneyData.allPlacementMoney=res.data.contract_amount
@@ -1184,7 +1216,7 @@
         // 添加一行空的
         if(contractInfo.operationtype=='invoice'){
           invoiceForm.invoiceData.push({
-            service_product_id:'',              
+            service_product_id:sellerListType.value == 3?'':sellerListType.value,              
             origin_amount:'',
             amount:'',
             invoice_date:'',
@@ -1213,7 +1245,7 @@
         // 添加一行空的
         if(contractInfo.operationtype=='placement'){
           placementForm.placementData.push({
-            service_product_id:'',
+            service_product_id:sellerListType.value == 3?'':sellerListType.value,
             origin_amount:'',
             amount:'',
             invoice_date:'',
@@ -1525,7 +1557,7 @@
                             {{$index+1}}
                           </template>
                         </el-table-column>
-                        <el-table-column label="套餐类型" width="160" align="center" prop="service_product_id" v-if="contractServiceType==3">
+                        <el-table-column label="套餐类型" width="160" align="center" prop="service_product_id" v-if="sellerListType==3">
                           <template #header>
                             <span style="color: var(--dangerColor);">*</span>套餐类型
                           </template>
@@ -1719,7 +1751,7 @@
                             {{$index+1}}
                           </template>
                         </el-table-column>
-                        <el-table-column label="套餐类型" width="160" align="center" prop="service_product_id" v-if="contractServiceType==3">
+                        <el-table-column label="套餐类型" width="160" align="center" prop="service_product_id" v-if="sellerListType==3">
                           <template #header>
                             <span style="color: var(--dangerColor);">*</span>套餐类型
                           </template>