|
@@ -4,7 +4,7 @@ import {useRouter} from 'vue-router'
|
|
|
import {getSellerList} from '@/api/crm'
|
|
|
import {getCurrencyList} from '@/api/common'
|
|
|
import {getServiceList,getPreRegistrationList,preRegistrationAdd,
|
|
|
- preRegistrationDetail,preRegistrationEdit,preRegistrationDelete} from '@/api/financialMana'
|
|
|
+ preRegistrationDetail,preRegistrationEdit,preRegistrationDelete,preRegistrationSave} from '@/api/financialMana'
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
@@ -53,7 +53,7 @@ const router = useRouter()
|
|
|
// 监听
|
|
|
|
|
|
watch(()=>dialog.validityDate,(newVal)=>{
|
|
|
- console.log(newVal);
|
|
|
+ // console.log(newVal);
|
|
|
if(!newVal){
|
|
|
dialog.registrationPreForm.start_date=''
|
|
|
dialog.registrationPreForm.end_date=''
|
|
@@ -138,7 +138,7 @@ const placementPreList=()=>{
|
|
|
getPreRegistrationList(placemenetPre.searchParams).then(res=>{
|
|
|
placemenetPre.tableData=res.data.list || []
|
|
|
placemenetPre.total=res.data.page?.total || 0
|
|
|
- console.log(res);
|
|
|
+ // console.log(res);
|
|
|
})
|
|
|
}
|
|
|
//新增预登记
|
|
@@ -187,6 +187,7 @@ const editRegistrationPre=(row)=>{
|
|
|
invoice_type:row.invoice_type}).then(res=>{
|
|
|
if(!res.data) return
|
|
|
dialog.registrationPreForm.contract_register_id = res.data.contract_register_id
|
|
|
+ dialog.registrationPreForm.pre_register_id = row.pre_register_id
|
|
|
dialog.registrationPreForm.company_name = res.data.company_name
|
|
|
dialog.registrationPreForm.invoice_type = row.invoice_type
|
|
|
dialog.registrationPreForm.IorPInfo=res.data.list
|
|
@@ -261,6 +262,7 @@ const submitForm=()=>{
|
|
|
}
|
|
|
let params={
|
|
|
contract_register_id:dialog.registrationPreForm.contract_register_id||0,
|
|
|
+ pre_register_id:dialog.registrationPreForm.pre_register_id||0,
|
|
|
company_name:dialog.registrationPreForm.company_name,
|
|
|
register_type:dialog.registrationType=='开票'?3:4,
|
|
|
start_date:dialog.registrationPreForm.start_date,
|
|
@@ -293,6 +295,7 @@ const preDialog=reactive({
|
|
|
show:false,
|
|
|
title:'',
|
|
|
preForm:{
|
|
|
+ company_name:'',
|
|
|
service_product_id:'',
|
|
|
start_date:'',
|
|
|
end_date:'',
|
|
@@ -301,7 +304,8 @@ const preDialog=reactive({
|
|
|
currency_unit:'CNY',
|
|
|
seller_id:'',
|
|
|
invoice_type:'',
|
|
|
- register_date:''
|
|
|
+ register_date:'',
|
|
|
+ remark:''
|
|
|
},
|
|
|
validityDate:[],
|
|
|
selectService:[],
|
|
@@ -336,40 +340,94 @@ watch(()=>preDialog.validityDate,(newVal)=>{
|
|
|
})
|
|
|
// 预开票/到款
|
|
|
const preIorP=(row)=>{
|
|
|
- preDialog.title=row.invoice_typ==3?'预到款':'预开票'
|
|
|
preRegistrationDetail({contract_register_id:row.contract_register_id,
|
|
|
- invoice_type:row.invoice_type}).then(res=>{
|
|
|
+ invoice_type:row.invoice_type==3?4:3}).then(res=>{
|
|
|
if(!res.data) return
|
|
|
preDialog.preForm.contract_register_id = res.data.contract_register_id
|
|
|
- // preDialog.preForm.invoice_type = row.invoice_type==3?4:3
|
|
|
- // dialog.registrationPreForm.IorPInfo=res.data.list
|
|
|
- // dialog.registrationPreForm.services=res.data.services || []
|
|
|
- // preDialog.validityDate=[res.data.start_date,res.data.end_date]
|
|
|
- // dialog.selectServices = [...res.data.services.map(item => item.service_template_id),...res.data.serviceTemplateIds]
|
|
|
- // dialog.registrationType=row.invoice_type==3?'开票':'到款'
|
|
|
- // dialog.title=`编辑${dialog.registrationType}预登记`
|
|
|
- // preDialog.show=true
|
|
|
- // nextTick(()=>{
|
|
|
- // servicesChange(dialog.selectServices,1)
|
|
|
- // })
|
|
|
+ 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
|
|
|
+ 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
|
|
|
+ preDialog.preForm.remark=res.data.list[0].remark
|
|
|
+ }
|
|
|
+ preDialog.preForm.services=res.data.services || []
|
|
|
+ preDialog.validityDate=[res.data.start_date,res.data.end_date]
|
|
|
+ preDialog.selectServices = [...res.data.services.map(item => item.service_template_id),...res.data.serviceTemplateIds]
|
|
|
+ preDialog.title=row.invoice_type==3?'预到款':'预开票'
|
|
|
+ preDialog.show=true
|
|
|
+ nextTick(()=>{
|
|
|
+ servicesChange(preDialog.selectServices,2)
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
|
|
|
const submitPreForm=()=>{
|
|
|
preFormRef.value.validate((valid)=>{
|
|
|
if(valid){
|
|
|
- console.log(preDialog.preForm);
|
|
|
- // dialog.registrationPreForm.amount = parseFloat(dialog.registrationPreForm.amount)
|
|
|
- // let prePlacementProp=prePlacementAdd
|
|
|
- // if(dialog.registrationPreForm.pre_pay_id){
|
|
|
- // // 编辑
|
|
|
- // prePlacementProp=prePlacementEdit
|
|
|
- // }
|
|
|
- // prePlacementProp(dialog.registrationPreForm).then(res=>{
|
|
|
+ // console.log(preDialog.preForm);
|
|
|
+ // 处理选中套餐的数据格式
|
|
|
+ let servicesParam=[]
|
|
|
+ let FICCSmallServiceIds=[]
|
|
|
+ selectServicesPreRef.value.getCheckedNodes().map(node=>{
|
|
|
+ let nodeData = node.data
|
|
|
+ if(!nodeData.service_template_id) return
|
|
|
+ if(nodeData.product_id==2){
|
|
|
+ // 权益
|
|
|
+ servicesParam.push({service_template_id:nodeData.service_template_id,title:nodeData.title})
|
|
|
+ }else{
|
|
|
+ // 90000往上都是FICC小套餐品种的Id,特殊处理
|
|
|
+ if(nodeData.service_template_id>=90000){
|
|
|
+ // 真正拿取的是chart_permission_id
|
|
|
+ if(FICCSmallServiceId.includes(nodeData.service_template_id)) FICCSmallServiceIds.push(nodeData.chart_permission_id)
|
|
|
+ }else{
|
|
|
+ if(nodeData.service_template_id==2){
|
|
|
+ // 小套餐
|
|
|
+ servicesParam.push({service_template_id:nodeData.service_template_id,
|
|
|
+ title:nodeData.title,value:nodeData.value,chart_permission_ids:''})
|
|
|
+ }else{
|
|
|
+ servicesParam.push({service_template_id:nodeData.service_template_id,title:nodeData.title,value:nodeData.value})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ for (let i = 0; i < servicesParam.length; i++) {
|
|
|
+ const element = servicesParam[i];
|
|
|
+ if(element.service_template_id==2){
|
|
|
+ element.chart_permission_ids=FICCSmallServiceIds.join(',')
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ preDialog.preForm.amount = parseFloat(preDialog.preForm.amount)
|
|
|
+ let params={
|
|
|
+ contract_register_id:preDialog.preForm.contract_register_id,
|
|
|
+ pre_register_id:preDialog.preForm.pre_register_id,
|
|
|
+ company_name:preDialog.preForm.company_name,
|
|
|
+ register_type:preDialog.preForm.invoice_type,
|
|
|
+ start_date:preDialog.preForm.start_date,
|
|
|
+ end_date:preDialog.preForm.end_date,
|
|
|
+ list:[{
|
|
|
+ contract_invoice_id:preDialog.preForm.contract_invoice_id,
|
|
|
+ amount:preDialog.preForm.amount,
|
|
|
+ currency_unit:preDialog.preForm.currency_unit,
|
|
|
+ remark:preDialog.preForm.remark,
|
|
|
+ register_date:preDialog.preForm.register_date,
|
|
|
+ seller_id:preDialog.preForm.seller_id||0,
|
|
|
+ service_product_id:preDialog.preForm.service_product_id,
|
|
|
+ }],
|
|
|
+ services:servicesParam||[]
|
|
|
+ }
|
|
|
+ preRegistrationSave(params).then(res=>{
|
|
|
preDialog.show=false
|
|
|
ElMessage.success(`${preDialog.title}成功`)
|
|
|
placementPreList()
|
|
|
- // })
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -412,6 +470,13 @@ const currencyValidator=(item,callback)=>{
|
|
|
callback()
|
|
|
}
|
|
|
}
|
|
|
+// 新增或编辑预登记 币种修改
|
|
|
+const currencyUnitChange=(value)=>{
|
|
|
+ dialog.registrationPreForm.IorPInfo.map(item =>{
|
|
|
+ item.currency_unit = value
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
let hasQyBigOne=false
|
|
|
let hasQyBigTwo=false
|
|
@@ -424,7 +489,7 @@ const FICCSmallServiceId=[90001,90016,90103,90138,90142,90109,90110,90114,90107,
|
|
|
|
|
|
// 套餐选择更改
|
|
|
const servicesChange=(value,type)=>{
|
|
|
- console.log(value,type);
|
|
|
+ // console.log(value,type);
|
|
|
// type---> 1-预登记弹窗 2-预开票/预到款弹窗
|
|
|
|
|
|
// 权益大套餐/45万
|
|
@@ -487,7 +552,7 @@ const servicesChange=(value,type)=>{
|
|
|
if(type==1){
|
|
|
dialog.registrationPreForm.services= dialog.selectServices= value
|
|
|
}else{
|
|
|
- preDialog.selectServices=value
|
|
|
+ preDialog.preForm.services=preDialog.selectServices=value
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -588,8 +653,7 @@ const searchPlacementPre=()=>{
|
|
|
const supplementaryContract=(row)=>{
|
|
|
// console.log(id);
|
|
|
router.push({path:'/financial/list/contractProgress',query:{
|
|
|
- supplementaryId:row.pre_register_id,
|
|
|
- contract_register_id:row.contract_register_id,
|
|
|
+ supplementaryId:row.contract_register_id,
|
|
|
invoice_type:row.invoice_type
|
|
|
}})
|
|
|
}
|
|
@@ -642,9 +706,11 @@ placementPreList()
|
|
|
style="width: 240px;" @input="searchPlacementPre" clearable />
|
|
|
</div>
|
|
|
<!-- 按钮区域 -->
|
|
|
- <div class="placemenetPre-top-option-zone" v-permission="'financial:placementPre:add'">
|
|
|
- <el-button type="primary" @click="addRegistrationPre('开票')" class="main-button-large" style="margin-left: 30px;">开票预登记</el-button>
|
|
|
- <el-button type="primary" @click="addRegistrationPre('到款')" class="main-button-large" style="margin-left: 30px;">到款预登记</el-button>
|
|
|
+ <div class="placemenetPre-top-option-zone">
|
|
|
+ <el-button type="primary" @click="addRegistrationPre('开票')" class="main-button-large"
|
|
|
+ style="margin-left: 30px;" v-permission="'financial:registrationPre:AandEInvoice'">开票预登记</el-button>
|
|
|
+ <el-button type="primary" @click="addRegistrationPre('到款')" class="main-button-large" style="margin-left: 30px;"
|
|
|
+ v-permission="'financial:registrationPre:AandEPayment'">到款预登记</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="placemenetPre-table-zone">
|
|
@@ -668,31 +734,30 @@ placementPreList()
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="套餐" prop="services" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column label="操作" fixed="right"
|
|
|
- v-permission="['financial:placementPre:supplementary','financial:placementPre:edit','financial:placementPre:delete']">
|
|
|
+ <el-table-column label="操作" fixed="right" >
|
|
|
<template #default="{row}">
|
|
|
<div class="table-options">
|
|
|
- <span class="table-option-buttons" v-permission="'financial:placementPre:supplementary'"
|
|
|
+ <span class="table-option-buttons" v-permission="'financial:registrationPre:supplementary'"
|
|
|
@click="supplementaryContract(row)">
|
|
|
补录合同
|
|
|
</span>
|
|
|
- <span class="table-option-buttons" v-permission="'financial:placementPre:supplementary'"
|
|
|
+ <span class="table-option-buttons" v-permission="'financial:registrationPre:preInvoice'"
|
|
|
@click="preIorP(row)" v-if="row.invoice_type==4">
|
|
|
预开票
|
|
|
</span>
|
|
|
- <span class="table-option-buttons" v-permission="'financial:placementPre:supplementary'"
|
|
|
+ <span class="table-option-buttons" v-permission="'financial:registrationPre:prePayment'"
|
|
|
@click="preIorP(row)" v-if="row.invoice_type==3">
|
|
|
预到款
|
|
|
</span>
|
|
|
- <span class="table-option-buttons" v-permission="'financial:placementPre:edit'"
|
|
|
- @click="editRegistrationPre(row)" v-if="row.invoice_type==3">
|
|
|
+ <span class="table-option-buttons" v-permission="'financial:registrationPre:AandEInvoice'"
|
|
|
+ @click="editRegistrationPre(row)" v-if="row.invoice_type==3" >
|
|
|
编辑
|
|
|
</span>
|
|
|
- <span class="table-option-buttons" v-permission="'financial:placementPre:edit'"
|
|
|
+ <span class="table-option-buttons" v-permission="'financial:registrationPre:AandEPayment'"
|
|
|
@click="editRegistrationPre(row)" v-if="row.invoice_type==4">
|
|
|
编辑
|
|
|
</span>
|
|
|
- <span class="table-option-buttons" v-permission="'financial:placementPre:delete'"
|
|
|
+ <span class="table-option-buttons" v-permission="'financial:registrationPre:delete'"
|
|
|
@click="delteRecord(row)" style="color:var(--dangerColor);" v-if="adminId==row.admin_id">
|
|
|
删除
|
|
|
</span>
|
|
@@ -760,8 +825,9 @@ placementPreList()
|
|
|
<el-form-item :label="dialog.registrationType+'金额'" :prop="`IorPInfo.${index}.amount`" label-width="90" style="margin-right: 20px;"
|
|
|
:rules="[{required:true,message:'金额不能为空',trigger:'blur'},
|
|
|
{validator:(rule,value,callback)=>currencyValidator(item,callback),trigger:'blur'}]">
|
|
|
- <el-input v-model.trim="item.amount" :placeholder="`请输入${dialog.registrationType}金额`" style="width: 131px;margin-right: 15px;" />
|
|
|
- <el-select v-model="item.currency_unit" placeholder="请选择货币类型" style="width: 91px;" >
|
|
|
+ <el-input v-model.trim="item.amount"
|
|
|
+ :placeholder="`请输入${dialog.registrationType}金额`" style="width: 131px;margin-right: 15px;" />
|
|
|
+ <el-select v-model="item.currency_unit" placeholder="请选择货币类型" style="width: 91px;" @change="currencyUnitChange">
|
|
|
<el-option v-for="currency in currencyList" :key="currency.code" :label="currency.name" :value="currency.code">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -827,7 +893,7 @@ placementPreList()
|
|
|
:clearable="false">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="套餐" prop="services" v-if="preDialog.title=='预开票'">
|
|
|
+ <el-form-item label="套餐" prop="services" v-show="preDialog.title=='预开票'">
|
|
|
<el-cascader filterable :options="servicesList" placeholder="请选择套餐" @change="(value)=>servicesChange(value,2)"
|
|
|
:show-all-levels="true" v-model="preDialog.selectServices" :clearable="false" ref="selectServicesPreRef"
|
|
|
:props="{multiple:true,label:'title',value:'service_template_id',emitPath:false}" collapse-tags collapse-tags-tooltip
|