hbchen 2 жил өмнө
parent
commit
7bb8eb7f9d

+ 6 - 6
src/views/financialManagement/contractProgress-component/InvoiceAndPayment.vue

@@ -132,15 +132,15 @@
   const addTableRow=()=>{
     amountForm.amountData.push({
       service_product_id:sellerListType.value == 3?'':sellerListType.value,origin_amount:'',amount:'',invoice_date:'',remark:'',
-    seller_id:0,seller_name:'',amountDomType:'text',remarkDomType:'text'})
+    seller_id:'',seller_name:'',amountDomType:'text',remarkDomType:'text'})
   }
 
   // 开票销售更改
   const invoiceSellerChange=(row,value)=>{
     if(row.service_product_id==1){
-      row.seller_name = contractInfo.sellerInvoiceListF.find(seller => seller.seller_id==value)?.seller_name
+      row.seller_name = props.sellerData.ficc_list.find(seller => seller.seller_id==value)?.seller_name
     }else{
-      row.seller_name = contractInfo.sellerInvoiceListQ.find(seller => seller.seller_id==value)?.seller_name
+      row.seller_name = props.sellerData.rai_list.find(seller => seller.seller_id==value)?.seller_name
     }
   }
   // 判断表格当前行的信息是否填写完整
@@ -160,7 +160,7 @@
     if(flag==1){
       amountForm.amountData.splice((index+1),0,
       {service_product_id:sellerListType.value == 3?'':sellerListType.value,origin_amount:'',
-      amount:'',invoice_date:'',remark:'',seller_id:0,seller_name:'',amountDomType:'text',remarkDomType:'text'})
+      amount:'',invoice_date:'',remark:'',seller_id:'',seller_name:'',amountDomType:'text',remarkDomType:'text'})
     }else{
       ElMessage.error(flag)
     }
@@ -525,13 +525,13 @@
                     <el-select v-model="row.seller_id" style="width: 124px;" :ref='`amountData-service_product_id${$index}`'
                     placeholder="请选择销售" filterable v-if="row.service_product_id==1" @change="(value)=> invoiceSellerChange(row,value)">
                       <el-option :label="item.seller_name" :value="item.seller_id" 
-                      v-for="item in sellerData?.ficc_list" :key="item.seller_id">
+                      v-for="item in sellerData.ficc_list" :key="item.seller_id">
                       </el-option>
                     </el-select>
                     <el-select v-model="row.seller_id" style="width: 124px;" :ref='`amountData-service_product_id${$index}`'
                     placeholder="请选择销售" filterable v-else-if="row.service_product_id==2" @change="(value)=> invoiceSellerChange(row,value)">
                       <el-option :label="item.seller_name" :value="item.seller_id" 
-                      v-for="item in sellerData?.rai_list" :key="item.seller_id">
+                      v-for="item in sellerData.rai_list" :key="item.seller_id">
                       </el-option>
                     </el-select>
                     <el-select v-model="row.seller_id" style="width: 124px;" :ref='`amountData-service_product_id${$index}`'

+ 18 - 13
src/views/financialManagement/registrationPre.vue

@@ -81,10 +81,10 @@ const getServicesListFun=()=>{
     let tempData = res.data||[]
     // 给最外成添加service_template_id,防止级联选择器乱跳
     servicesList.value=tempData.map((item,index) =>{
-      // if(item.service_template_id) 
+      if(item.service_template_id) 
+      return item
+      item.service_template_id=999999+index
       return item
-      // item.service_template_id=999999+index
-      // return item
     })
   })
 }
@@ -126,7 +126,7 @@ const serivcesDataHandler=(cascaderRef)=>{
 }
 
 // 套餐类型更改
-const productIdChange=(value,item)=>{
+const productIdChange=(item)=>{
   item.seller_id=''
 }
 // 级联选择器套餐改变
@@ -146,10 +146,14 @@ const servicesChange=(value,type)=>{
 watch(serviceType,(newVal)=>{
   if(newVal==1 || newVal==2){
     dialog.registrationPreForm.IorPInfo.map(item =>{
+      if(item.service_product_id!=newVal){
+        productIdChange(item)
+      }
       item.service_product_id=newVal
     })
   }else{
     dialog.registrationPreForm.IorPInfo.map(item =>{
+      productIdChange(item)
       item.service_product_id=''
     })
   }
@@ -157,8 +161,12 @@ watch(serviceType,(newVal)=>{
 
 watch(serviceTypePre,(newVal)=>{
   if(newVal==1 || newVal==2){
+    if(item.service_product_id!=newVal){
+      productIdChange(preDialog.preForm)
+    }
     preDialog.preForm.service_product_id=newVal
   }else{
+    productIdChange(preDialog.preForm)
     preDialog.preForm.service_product_id=''
   }
 })
@@ -251,10 +259,8 @@ const editRegistrationPre=(row)=>{
     dialog.validityDate=[res.data.start_date,res.data.end_date]
     dialog.selectServices = [...res.data.services.map(item => item.service_template_id),...res.data.serviceTemplateIds]
     dialog.registrationPreForm.IorPInfo.forEach(item =>{
-      if(item.service_product_id==0){
-        // 不能为零,否则回显
-        item.service_product_id=''
-      }
+      // 不能为零,为零会回显
+      item.service_product_id=item.service_product_id==0?'':item.service_product_id
     })
     dialog.registrationType=row.invoice_type==3?'开票':'到款'
     dialog.title=`编辑${dialog.registrationType}预登记`
@@ -380,11 +386,11 @@ const preIorP=(row)=>{
     preDialog.preForm.pre_register_id = row.pre_register_id
     preDialog.preForm.company_name = res.data.company_name
     preDialog.preForm.invoice_type = row.invoice_type==3?4:3
+    preDialog.preForm.service_product_id=row.service_product_id==0?'':row.service_product_id
     if(res.data.list.length>0){
       preDialog.preForm.contract_invoice_id = res.data.list[0].contract_invoice_id
       preDialog.preForm.amount=res.data.list[0].amount
       preDialog.preForm.currency_unit=res.data.list[0].currency_unit
-      preDialog.preForm.service_product_id=res.data.list[0].service_product_id
       preDialog.preForm.seller_id=res.data.list[0].seller_id
       preDialog.preForm.invoice_type=res.data.list[0].invoice_type
       preDialog.preForm.register_date=res.data.list[0].register_date
@@ -407,7 +413,6 @@ const preIorP=(row)=>{
         // 套餐类型
         let hasFICCService = checkedNodes.some(Node => Node.data.product_id == 1)
         let hasQYService = checkedNodes.some(Node => Node.data.product_id == 2)
-
         if(hasFICCService&&hasQYService || !(hasFICCService||hasQYService)){
           serviceTypePre.value=3
         }else if(hasFICCService){
@@ -600,7 +605,7 @@ placementPreList()
         </el-table-column>
         <el-table-column label="约定有效期" width="210" prop="start_date">
           <template #default="{row}">
-            {{row.start_date?(row.start_date+' 至 '+row.end_date):''}}
+            {{row.start_date&&row.start_date!='0001-01-01'?(row.start_date+' 至 '+row.end_date):''}}
           </template>
         </el-table-column>
         <el-table-column label="套餐" prop="services" show-overflow-tooltip></el-table-column>
@@ -686,7 +691,7 @@ placementPreList()
             <el-form-item label="套餐类型" :prop="`IorPInfo.${index}.service_product_id`" v-if="serviceType==3"
             label-width="90" style="margin-right: 20px;"
             :rules="dialog.registrationType=='开票'?{required:true,message:'套餐类型不能为空',trigger:'change'}:{required:false}">
-              <el-select v-model="item.service_product_id" style="width: 176px;" @change="value=> productIdChange(value,item)"
+              <el-select v-model="item.service_product_id" style="width: 176px;" @change="productIdChange(item)"
               placeholder="请选择套餐">
                 <el-option label="FICC套餐" :value="1"></el-option>
                 <el-option label="权益套餐" :value="2"></el-option>
@@ -774,7 +779,7 @@ placementPreList()
         <el-form-item label="套餐类型" prop="service_product_id" v-if="serviceTypePre==3" 
         :rules="preDialog.title=='预开票'?{required:true,message:'套餐类型不能为空',trigger:'change'}:{required:false}">
           <el-select v-model="preDialog.preForm.service_product_id"
-          style="width: 286px;" @change="value=> productIdChange(value,preDialog.preForm)"
+          style="width: 286px;" @change="productIdChange(preDialog.preForm)"
           placeholder="请选择套餐">
             <el-option label="FICC套餐" :value="1"></el-option>
             <el-option label="权益套餐" :value="2"></el-option>