|
@@ -5,7 +5,7 @@
|
|
|
import permissionQyDia from '../components/permissionQyDia.vue'
|
|
|
import {getContractSearchList,getServiceDetail} from '@/api/crm'
|
|
|
import {registerAdd,registerEdit,contractRegisterCheck} from '@/api/financialMana'
|
|
|
- import {intervalDataRequest} from '@/utils/common-methods'
|
|
|
+ // import {intervalDataRequest} from '@/utils/common-methods'
|
|
|
import financialCommon from '../composition/common'
|
|
|
|
|
|
const contractSourceArray=['非CRM合同导入','CRM合同导入']
|
|
@@ -148,10 +148,10 @@
|
|
|
const sellerListType=ref(3)
|
|
|
// 选中的销售数组
|
|
|
const cascaderSelectSeller=ref([])
|
|
|
- // 销售是否离职
|
|
|
- const isSellerLeave={ficc:false,qy:false}
|
|
|
- // 标识合规原本的销售是否已离职
|
|
|
- let isLeave=false
|
|
|
+ // // 销售是否离职
|
|
|
+ // const isSellerLeave={ficc:false,qy:false}
|
|
|
+ // // 标识合规原本的销售是否已离职
|
|
|
+ // let isLeave=false
|
|
|
|
|
|
// 查看套餐报价单 图片
|
|
|
const previewImage=ref('')
|
|
@@ -222,7 +222,13 @@
|
|
|
contractInfoForm.value && contractInfoForm.value.clearValidate()
|
|
|
},0)
|
|
|
}
|
|
|
-
|
|
|
+// ---------------------------------------计算
|
|
|
+ const onlyQYSellerData=computed(()=>{
|
|
|
+ return props.sellerData.all_list.filter(item => item.seller_id==5)[0].child
|
|
|
+ })
|
|
|
+ const onlyFICCSellerData=computed(()=>{
|
|
|
+ return props.sellerData.all_list.filter(item => item.seller_id==2)[0].child
|
|
|
+ })
|
|
|
// ------------------------------------------------监听
|
|
|
watch(()=>props.supplementaryInfo.supplement,(value)=>{
|
|
|
if(value){
|
|
@@ -267,7 +273,7 @@
|
|
|
const sellerChange=(value)=>{
|
|
|
let ficcSeller,qySeller
|
|
|
// 一旦发生修改,离职的提示就消失
|
|
|
- isSellerLeave.ficc=isSellerLeave.qy=false
|
|
|
+ // isSellerLeave.ficc=isSellerLeave.qy=false
|
|
|
|
|
|
if(value?.length>0){
|
|
|
for (let i = 0; i < value.length; i++) {
|
|
@@ -392,12 +398,12 @@
|
|
|
'contract_code','company_name','contract_type','seller_ids',
|
|
|
'start_date','contract_amount','relate_contract_code','actual_pay_companies'
|
|
|
])
|
|
|
- let sellerArray = sellerListType.value==1?props.sellerData.ficc_list:props.sellerData.rai_list
|
|
|
- if(sellerArray.findIndex(item => item.seller_id == selectItem.seller_id)==-1){
|
|
|
- // 为-1表示原本的销售已离职
|
|
|
- compliance.form.seller_id = selectItem.seller_name
|
|
|
- isLeave=true
|
|
|
- }
|
|
|
+ // let sellerArray = sellerListType.value==1?props.sellerData.ficc_list:props.sellerData.rai_list
|
|
|
+ // if(sellerArray.findIndex(item => item.seller_id == selectItem.seller_id)==-1){
|
|
|
+ // // 为-1表示原本的销售已离职
|
|
|
+ // compliance.form.seller_id = selectItem.seller_name
|
|
|
+ // isLeave=true
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
// 合规登记-提交
|
|
@@ -405,24 +411,24 @@
|
|
|
contractInfoForm.value.validate(valid=>{
|
|
|
if(valid){
|
|
|
// console.log(cascaderSelectSeller.value);
|
|
|
- if(isLeave){
|
|
|
- // 判断原本销售已离职
|
|
|
- if(sellerListType.value==3){
|
|
|
- if(isSellerLeave.ficc){
|
|
|
- ElMessage.error('选择的FICC销售不存在或已离职')
|
|
|
- return
|
|
|
- }
|
|
|
- if(isSellerLeave.qy){
|
|
|
- ElMessage.error('选择的权益销售不存在或已离职')
|
|
|
- return
|
|
|
- }
|
|
|
- }else{
|
|
|
- if(!Number(compliance.form.seller_id)){
|
|
|
- ElMessage.error('选择的销售不存在或已离职')
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ // if(isLeave){
|
|
|
+ // // 判断原本销售已离职
|
|
|
+ // if(sellerListType.value==3){
|
|
|
+ // if(isSellerLeave.ficc){
|
|
|
+ // ElMessage.error('选择的FICC销售不存在或已离职')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if(isSellerLeave.qy){
|
|
|
+ // ElMessage.error('选择的权益销售不存在或已离职')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // }else{
|
|
|
+ // if(!Number(compliance.form.seller_id)){
|
|
|
+ // ElMessage.error('选择的销售不存在或已离职')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
compliance.form.services=[]
|
|
|
compliance.form.service_amount=[]
|
|
|
if(serviceData.checkedServiceQy.length==0 && serviceData.checkedService.length==0){
|
|
@@ -656,40 +662,40 @@
|
|
|
}
|
|
|
|
|
|
// 对于销售的处理
|
|
|
- const sellerOperation=({seller_id,rai_seller_id,seller_ids,seller_name,rai_seller_name})=>{
|
|
|
- if(sellerListType.value==3){
|
|
|
- cascaderSelectSeller.value = seller_ids.split(',').map(item => +item)
|
|
|
- if(seller_id && props.sellerData.ficc_list.findIndex(item => item.seller_id == seller_id)==-1){
|
|
|
- props.sellerData.all_list.push({
|
|
|
- seller_id:seller_id,
|
|
|
- seller_name:seller_name+'-已离职',
|
|
|
- disabled:true,
|
|
|
- child:null
|
|
|
- })
|
|
|
- isLeave=true
|
|
|
- isSellerLeave.ficc=true
|
|
|
- }
|
|
|
- if(rai_seller_id && props.sellerData.rai_list.findIndex(item => item.seller_id == rai_seller_id)==-1){
|
|
|
- props.sellerData.all_list.push({
|
|
|
- seller_id:rai_seller_id,
|
|
|
- seller_name:rai_seller_name+'-已离职',
|
|
|
- disabled:true,
|
|
|
- child:null
|
|
|
- })
|
|
|
- isLeave=true
|
|
|
- isSellerLeave.qy=true
|
|
|
- }
|
|
|
- }else{
|
|
|
- if(rai_seller_id&&props.sellerData.rai_list.findIndex(item => item.seller_id == rai_seller_id)==-1){
|
|
|
- compliance.form.seller_id = rai_seller_name+'-已离职'
|
|
|
- isLeave=true
|
|
|
- }else if(seller_id && props.sellerData.ficc_list.findIndex(item => item.seller_id == seller_id)==-1){
|
|
|
- compliance.form.seller_id = seller_name+'-已离职'
|
|
|
- isLeave=true
|
|
|
- }
|
|
|
- }
|
|
|
+ // const sellerOperation=({seller_id,rai_seller_id,seller_ids,seller_name,rai_seller_name})=>{
|
|
|
+ // if(sellerListType.value==3){
|
|
|
+ // cascaderSelectSeller.value = seller_ids.split(',').map(item => +item)
|
|
|
+ // if(seller_id && props.sellerData.ficc_list.findIndex(item => item.seller_id == seller_id)==-1){
|
|
|
+ // props.sellerData.all_list.push({
|
|
|
+ // seller_id:seller_id,
|
|
|
+ // seller_name:seller_name+'-已离职',
|
|
|
+ // disabled:true,
|
|
|
+ // child:null
|
|
|
+ // })
|
|
|
+ // isLeave=true
|
|
|
+ // isSellerLeave.ficc=true
|
|
|
+ // }
|
|
|
+ // if(rai_seller_id && props.sellerData.rai_list.findIndex(item => item.seller_id == rai_seller_id)==-1){
|
|
|
+ // props.sellerData.all_list.push({
|
|
|
+ // seller_id:rai_seller_id,
|
|
|
+ // seller_name:rai_seller_name+'-已离职',
|
|
|
+ // disabled:true,
|
|
|
+ // child:null
|
|
|
+ // })
|
|
|
+ // isLeave=true
|
|
|
+ // isSellerLeave.qy=true
|
|
|
+ // }
|
|
|
+ // }else{
|
|
|
+ // if(rai_seller_id&&props.sellerData.rai_list.findIndex(item => item.seller_id == rai_seller_id)==-1){
|
|
|
+ // compliance.form.seller_id = rai_seller_name+'-已离职'
|
|
|
+ // isLeave=true
|
|
|
+ // }else if(seller_id && props.sellerData.ficc_list.findIndex(item => item.seller_id == seller_id)==-1){
|
|
|
+ // compliance.form.seller_id = seller_name+'-已离职'
|
|
|
+ // isLeave=true
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
- }
|
|
|
+ // }
|
|
|
|
|
|
// 选择品种 - ficc
|
|
|
const selectVariety=()=>{
|
|
@@ -781,18 +787,18 @@
|
|
|
// 合同类型回显
|
|
|
compliance.contractTypeCheck = [compliance.form.has_payment,compliance.form.contract_type]
|
|
|
// 销售
|
|
|
- let para={
|
|
|
- seller_id:props.detailInfo.seller_id,
|
|
|
- rai_seller_id:props.detailInfo.rai_seller_id,
|
|
|
- seller_ids:props.detailInfo.seller_ids,
|
|
|
- seller_name:props.detailInfo.seller_name,
|
|
|
- rai_seller_name:props.detailInfo.rai_seller_name
|
|
|
- }
|
|
|
+ // let para={
|
|
|
+ // seller_id:props.detailInfo.seller_id,
|
|
|
+ // rai_seller_id:props.detailInfo.rai_seller_id,
|
|
|
+ // seller_ids:props.detailInfo.seller_ids,
|
|
|
+ // seller_name:props.detailInfo.seller_name,
|
|
|
+ // rai_seller_name:props.detailInfo.rai_seller_name
|
|
|
+ // }
|
|
|
// 销售显示
|
|
|
sellerListType.value=props.detailInfo.sellerListType
|
|
|
|
|
|
// 拿到销售列表后才去做处理
|
|
|
- intervalDataRequest(()=> props.sellerData.all_list>0 ,sellerOperation(para),1)
|
|
|
+ // intervalDataRequest(()=> props.sellerData.all_list>0 ,sellerOperation(para),1)
|
|
|
|
|
|
compliance.hasQYSeller = props.detailInfo.rai_seller_id?true:false
|
|
|
|
|
@@ -889,19 +895,25 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="销售" prop="seller_ids">
|
|
|
<el-cascader v-if="sellerListType==3" filterable style="min-width: 320px;width: 15vw;"
|
|
|
- :options="sellerData.all_list" placeholder="请选择销售" @change="sellerChange"
|
|
|
- :show-all-levels="false" v-model="cascaderSelectSeller" :clearable="false"
|
|
|
- :props="{multiple:true,label:'seller_name',value:'seller_id',children:'child'}"
|
|
|
- key="seller" >
|
|
|
+ :options="sellerData.all_list" placeholder="请选择销售" @change="sellerChange"
|
|
|
+ :show-all-levels="false" v-model="cascaderSelectSeller"
|
|
|
+ :clearable="false" :props="{multiple:true,label:'seller_name',value:'seller_id',children:'child'}"
|
|
|
+ key="seller" >
|
|
|
</el-cascader>
|
|
|
<el-select v-else-if="!sellerListType" placeholder="请选择销售" filterable >
|
|
|
<el-option :label="item" :value="item" v-for="item in []" :key="item"></el-option>
|
|
|
</el-select>
|
|
|
- <el-select v-else v-model="compliance.form.seller_id" placeholder="请选择销售"
|
|
|
+ <el-cascader v-else filterable style="min-width: 320px;width: 15vw;"
|
|
|
+ :options="sellerListType==1?onlyFICCSellerData:onlyQYSellerData" @change="selectSeller"
|
|
|
+ placeholder="请选择销售" :show-all-levels="false" v-model="compliance.form.seller_id"
|
|
|
+ :clearable="false" :props="{multiple:false,label:'seller_name',value:'seller_id',children:'child'}"
|
|
|
+ key="seller-single" >
|
|
|
+ </el-cascader>
|
|
|
+ <!-- <el-select v-else v-model="compliance.form.seller_id" placeholder="请选择销售"
|
|
|
filterable @change="selectSeller" >
|
|
|
<el-option :label="item.seller_name" :value="item.seller_id"
|
|
|
- v-for="item in sellerListType==1?sellerData.ficc_list:sellerData.rai_list" :key="item.admin_id"></el-option>
|
|
|
- </el-select>
|
|
|
+ v-for="item in sellerListType==1?onlyFICCSellerData:onlyQYSellerData" :key="item.admin_id"></el-option>
|
|
|
+ </el-select> -->
|
|
|
</el-form-item>
|
|
|
<el-form-item label="合同金额" id="contractInfo-contractAmount"
|
|
|
prop="contract_amount">
|