|
@@ -3,7 +3,7 @@
|
|
|
import scrollableSelect from '@/components/scrollable-select/index.vue'
|
|
|
import permissionDia from '../components/permissionDia.vue'
|
|
|
import permissionQyDia from '../components/permissionQyDia.vue'
|
|
|
- import {getContractSearchList,getServiceDetail} from '@/api/crm'
|
|
|
+ import {getContractSearchList,getServiceDetail,getContractSearchDetail,getContractSealList} from '@/api/crm'
|
|
|
import {registerAdd,registerEdit,contractRegisterCheck} from '@/api/financialMana'
|
|
|
import financialCommon from '../composition/common'
|
|
|
|
|
@@ -191,10 +191,11 @@
|
|
|
compliance.form.services_Qy_amount='',
|
|
|
compliance.form.service_remark='',
|
|
|
compliance.form.remark=""
|
|
|
-
|
|
|
+ contractNoInfo.contractNoArray = []
|
|
|
+ contractNoInfo.contractNoTotal = 0
|
|
|
+
|
|
|
compliance.hasQYSeller=''
|
|
|
cascaderSelectSeller.value=[]
|
|
|
-
|
|
|
serviceData.checkedService=[]
|
|
|
serviceData.checkedServiceQy=[]
|
|
|
serviceData.checkedPermission=[]
|
|
@@ -281,7 +282,7 @@
|
|
|
}
|
|
|
}
|
|
|
// 合同编号选中
|
|
|
- const selectContractNo=(value)=>{
|
|
|
+ const selectContractNo= async (value)=>{
|
|
|
let selectItem=contractNoInfo.contractNoArray.find(item=>item.contract_code == value)
|
|
|
if(selectItem.contract_business_type_int==2){
|
|
|
// 代付合同
|
|
@@ -298,70 +299,73 @@
|
|
|
compliance.form.relate_contract_code=''
|
|
|
compliance.form.actual_pay_companies=''
|
|
|
}
|
|
|
+
|
|
|
// 获取套餐详情
|
|
|
- getServiceDetail({contract_id:selectItem.contract_id}).then(res=>{
|
|
|
- if(!res.data) return
|
|
|
+ const res = compliance.form.contract_source == 0 ? await getContractSearchDetail({ contract_id: selectItem.contract_id }) : await getServiceDetail({ contract_id: selectItem.contract_id });
|
|
|
+
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (!res.data) return;
|
|
|
//非标代付合同
|
|
|
- if(res.data.RelationContractDetailList && res.data.RelationContractDetailList.length>0 && selectItem.contract_business_type_int==1){
|
|
|
- compliance.form.has_payment=1
|
|
|
- compliance.form.has_invoice=0
|
|
|
- compliance.form.relate_contract_code = res.data.RelationContractDetailList.map(it => it.ContractCode).join(',')
|
|
|
- compliance.form.company_name=selectItem.company_name
|
|
|
- compliance.form.actual_pay_companies=res.data.RelationContractDetailList.map(it => it.CompanyName).join(',')
|
|
|
+ if (res.data.RelationContractDetailList && res.data.RelationContractDetailList.length > 0 && selectItem.contract_business_type_int == 1) {
|
|
|
+ compliance.form.has_payment = 1;
|
|
|
+ compliance.form.has_invoice = 0;
|
|
|
+ compliance.form.relate_contract_code = res.data.RelationContractDetailList.map((it) => it.ContractCode).join(",");
|
|
|
+ compliance.form.company_name = selectItem.company_name;
|
|
|
+ compliance.form.actual_pay_companies = res.data.RelationContractDetailList.map((it) => it.CompanyName).join(",");
|
|
|
}
|
|
|
- compliance.contractTypeCheck = [compliance.form.has_payment,compliance.form.contract_type]
|
|
|
- let servivesTemp
|
|
|
- if(selectItem.contract_type_key==3){
|
|
|
+ compliance.contractTypeCheck = [compliance.form.has_payment, compliance.form.contract_type];
|
|
|
+ let servivesTemp;
|
|
|
+ if (selectItem.contract_type_key == 3) {
|
|
|
// 代付合同 套餐取 关联合同的套餐
|
|
|
- servivesTemp=res.data.RelationContractDetailList[0]?res.data.RelationContractDetailList[0].Service||[]:[]
|
|
|
- }else{
|
|
|
- servivesTemp=res.data.Service || []
|
|
|
+ servivesTemp = res.data.RelationContractDetailList[0] ? res.data.RelationContractDetailList[0].Service || [] : [];
|
|
|
+ } else {
|
|
|
+ servivesTemp = res.data.Service || [];
|
|
|
}
|
|
|
- if(selectItem.product_id==1){
|
|
|
+ if (selectItem.product_id == 1) {
|
|
|
// 清空权益套餐
|
|
|
- serviceData.serviceVarietyShowQy = false
|
|
|
- serviceData.serviceTypeQy = 0
|
|
|
- serviceData.checkedServiceQy=[]
|
|
|
- compliance.form.services_Qy_amount = ''
|
|
|
+ serviceData.serviceVarietyShowQy = false;
|
|
|
+ serviceData.serviceTypeQy = 0;
|
|
|
+ serviceData.checkedServiceQy = [];
|
|
|
+ compliance.form.services_Qy_amount = "";
|
|
|
// FICC套餐
|
|
|
// 小套餐
|
|
|
- let smallService = servivesTemp.find(item => item.ServiceTemplateId==2)
|
|
|
+ let smallService = servivesTemp.find((item) => item.ServiceTemplateId == 2);
|
|
|
// 是否有大套餐
|
|
|
- let hasBigService = servivesTemp.some(item => item.ServiceTemplateId==1)
|
|
|
- serviceData.serviceVarietyShow=!!smallService
|
|
|
- serviceData.serviceType = !!smallService?2:hasBigService?1:0
|
|
|
- serviceData.checkedService=servivesTemp.map(item => item.ServiceTemplateId)
|
|
|
- serviceData.checkedPermission=smallService?smallService.ChartPermissionIds||[]:[]
|
|
|
- compliance.form.services_amount = res.data.Price
|
|
|
- }else{
|
|
|
+ let hasBigService = servivesTemp.some((item) => item.ServiceTemplateId == 1);
|
|
|
+ serviceData.serviceVarietyShow = !!smallService;
|
|
|
+ serviceData.serviceType = !!smallService ? 2 : hasBigService ? 1 : 0;
|
|
|
+ serviceData.checkedService = servivesTemp.map((item) => item.ServiceTemplateId);
|
|
|
+ serviceData.checkedPermission = smallService ? smallService.ChartPermissionIds || [] : [];
|
|
|
+ compliance.form.services_amount = res.data.Price;
|
|
|
+ } else {
|
|
|
// 清空FICC套餐
|
|
|
- serviceData.serviceVarietyShow = false
|
|
|
- serviceData.serviceType = 0
|
|
|
- serviceData.checkedService=[]
|
|
|
- compliance.form.services_amount = ''
|
|
|
+ serviceData.serviceVarietyShow = false;
|
|
|
+ serviceData.serviceType = 0;
|
|
|
+ serviceData.checkedService = [];
|
|
|
+ compliance.form.services_amount = "";
|
|
|
//权益
|
|
|
// 权益大套餐
|
|
|
- let bigServiceQY = servivesTemp.find(item => item.FMSServiceTemplateId==11 || item.FMSServiceTemplateId==12)
|
|
|
+ let bigServiceQY = servivesTemp.find((item) => item.FMSServiceTemplateId == 11 || item.FMSServiceTemplateId == 12);
|
|
|
// 行业套餐 - 医药/消费/科技/智造/策略
|
|
|
- let smallServiceQY = servivesTemp.filter(item => [14,15,16,17,18].includes(item.FMSServiceTemplatePId))
|
|
|
+ let smallServiceQY = servivesTemp.filter((item) => [14, 15, 16, 17, 18].includes(item.FMSServiceTemplatePId));
|
|
|
|
|
|
- serviceData.serviceVarietyShowQy = (!!bigServiceQY) || (!!smallServiceQY)
|
|
|
- serviceData.serviceTypeQy = serviceData.qYDiaType = !!bigServiceQY?1:!!smallServiceQY?2:0
|
|
|
- serviceData.checkedServiceQy=[!!bigServiceQY?10:13]
|
|
|
+ serviceData.serviceVarietyShowQy = !!bigServiceQY || !!smallServiceQY;
|
|
|
+ serviceData.serviceTypeQy = serviceData.qYDiaType = !!bigServiceQY ? 1 : !!smallServiceQY ? 2 : 0;
|
|
|
+ serviceData.checkedServiceQy = [!!bigServiceQY ? 10 : 13];
|
|
|
|
|
|
- compliance.form.services_Qy_amount = res.data.Price
|
|
|
- if(!!bigServiceQY){
|
|
|
+ compliance.form.services_Qy_amount = res.data.Price || ''
|
|
|
+ if (!!bigServiceQY) {
|
|
|
//权益大套餐
|
|
|
- serviceData.checkedPermissionQyBig = [bigServiceQY.FMSServiceTemplateId]
|
|
|
- serviceData.checkedPermissionQySmall = []
|
|
|
- }else{
|
|
|
+ serviceData.checkedPermissionQyBig = [bigServiceQY.FMSServiceTemplateId];
|
|
|
+ serviceData.checkedPermissionQySmall = [];
|
|
|
+ } else {
|
|
|
//行业套餐
|
|
|
- serviceData.checkedPermissionQyBig = []
|
|
|
- serviceData.checkedPermissionQySmall = smallServiceQY.map(item => item.FMSServiceTemplateId)
|
|
|
+ serviceData.checkedPermissionQyBig = [];
|
|
|
+ serviceData.checkedPermissionQySmall = smallServiceQY.map((item) => item.FMSServiceTemplateId);
|
|
|
}
|
|
|
}
|
|
|
- serviceData.varietyDiaType='edit'
|
|
|
- })
|
|
|
+ serviceData.varietyDiaType = "edit";
|
|
|
+ }
|
|
|
// compliance.form.product_ids = selectItem.product_id.toString()
|
|
|
sellerListType.value = selectItem.product_id
|
|
|
|
|
@@ -371,7 +375,7 @@
|
|
|
compliance.form.start_date=selectItem.start_date
|
|
|
compliance.form.end_date=selectItem.end_date
|
|
|
compliance.contractValidityDate=[selectItem.start_date,selectItem.end_date]
|
|
|
- compliance.form.contract_amount=selectItem.price
|
|
|
+ compliance.form.contract_amount=selectItem.price || ''
|
|
|
compliance.form.seller_id=selectItem.seller_id
|
|
|
compliance.form.seller_ids=selectItem.seller_id+''
|
|
|
// selectItem.contract_type_int 1-新签 2-续约 3-补充
|
|
@@ -598,27 +602,33 @@
|
|
|
}
|
|
|
// 合同编号远程搜索
|
|
|
const contractNoSearch=(value)=>{
|
|
|
- if(!value.trim()) return
|
|
|
- contractNoQuery.keyword=value
|
|
|
- contractNoQuery.current=1
|
|
|
- contractNoInfo.contractNoArray=[]
|
|
|
- getContractSearchListFun()
|
|
|
+ const regex = /^HZEQ\d{11}$/;
|
|
|
+ if((regex.test(value) && compliance.form.contract_source==0) || (compliance.form.contract_source!=0 && value.trim())){
|
|
|
+ contractNoQuery.keyword=value
|
|
|
+ contractNoQuery.current=1
|
|
|
+ contractNoInfo.contractNoArray=[]
|
|
|
+ getContractSearchListFun()
|
|
|
+ }
|
|
|
}
|
|
|
const loadContractNoMore=()=>{
|
|
|
if(contractNoInfo.contractNoArray.length >=contractNoInfo.contractNoTotal) return
|
|
|
contractNoQuery.current++
|
|
|
getContractSearchListFun()
|
|
|
}
|
|
|
- const getContractSearchListFun=()=>{
|
|
|
- contractNoInfo.contractNoLoading=true
|
|
|
- getContractSearchList(contractNoQuery).then(res=>{
|
|
|
- contractNoInfo.contractNoArray=contractNoInfo.contractNoArray.concat(res.data.list || [])
|
|
|
- contractNoInfo.contractNoTotal=res.data.page.total
|
|
|
- }).finally(()=>{
|
|
|
- contractNoInfo.contractNoLoading=false
|
|
|
- })
|
|
|
- }
|
|
|
|
|
|
+ // 获取合同编号列表
|
|
|
+ const getContractSearchListFun = async () => {
|
|
|
+ contractNoInfo.contractNoLoading = true;
|
|
|
+ const res =
|
|
|
+ compliance.form.contract_source == 0
|
|
|
+ ? await getContractSealList(contractNoQuery)
|
|
|
+ : await getContractSearchList(contractNoQuery);
|
|
|
+ if (res.code === 200) {
|
|
|
+ contractNoInfo.contractNoArray = contractNoInfo.contractNoArray.concat(res.data.list || []);
|
|
|
+ contractNoInfo.contractNoTotal = res.data.page.total;
|
|
|
+ }
|
|
|
+ contractNoInfo.contractNoLoading = false;
|
|
|
+ }
|
|
|
|
|
|
// 销售选中
|
|
|
const selectSeller=(value)=>{
|
|
@@ -794,13 +804,13 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="合同编号" prop="contract_code" id="selectContract">
|
|
|
- <el-input v-model="compliance.form.contract_code" placeholder="请输入合同编号"
|
|
|
+ <!-- <el-input v-model="compliance.form.contract_code" placeholder="请输入合同编号"
|
|
|
v-if="compliance.form.contract_source==0" >
|
|
|
<template #prefix v-if="compliance.form.has_payment==1">
|
|
|
<span>{{ compliance.form.has_invoice==1?'代付方':'实际使用方' }}</span>
|
|
|
</template>
|
|
|
- </el-input>
|
|
|
- <scrollableSelect :loadMoreMethod="loadContractNoMore" v-model="compliance.form.contract_code" placeholder="请搜索合同编号" v-else
|
|
|
+ </el-input> -->
|
|
|
+ <scrollableSelect :loadMoreMethod="loadContractNoMore" v-model="compliance.form.contract_code" placeholder="请搜索合同编号"
|
|
|
:searchMethod="contractNoSearch" @change="selectContractNo" useLoading :isLoading="contractNoInfo.contractNoLoading"
|
|
|
>
|
|
|
<template #prefix v-if="compliance.form.has_payment==1">
|