|
|
@@ -12,8 +12,8 @@
|
|
|
class="flex a-c f-wrap" :size="fromSize">
|
|
|
<ElCol :md="24" :lg="18">
|
|
|
<el-form-item label="协议" :prop="addMethod == 'list' ? 'ptlAgreementId' : ''">
|
|
|
- <el-select v-if="addMethod == 'list'" v-model="ruleFeeinfo.ptlAgreementId" placeholder="选择协议" @change="ptlAgreementIdChange"
|
|
|
- :disabled="props.title != '添加'">
|
|
|
+ <el-select v-if="addMethod == 'list'" v-model="ruleFeeinfo.ptlAgreementId" placeholder="选择协议"
|
|
|
+ @change="ptlAgreementIdChange" :disabled="props.title != '添加'">
|
|
|
<el-option v-for="item in agreementselect" :key="item.id" :label="item.agreementTitle"
|
|
|
:value="item.id" />
|
|
|
</el-select>
|
|
|
@@ -26,8 +26,8 @@
|
|
|
<ElCol :md="24" :lg="18">
|
|
|
<el-form-item label="快速配置"
|
|
|
v-if="agreementActiveId || ruleFeeinfo.ptlAgreementId || props.agreementInfo?.id">
|
|
|
- <el-select v-model="contactPersonListid" placeholder="选择对接人" @visible-change="contactvisiblechange" clearable
|
|
|
- :disabled="props.title != '添加'" @change="contactPersonChange">
|
|
|
+ <el-select v-model="contactPersonListid" placeholder="选择对接人" @visible-change="contactvisiblechange"
|
|
|
+ clearable :disabled="props.title != '添加'" @change="contactPersonChange">
|
|
|
<el-option v-for="item in contactPersonList" :key="item.contactMobile" :label="item.contactPerson"
|
|
|
:value="item.contactMobile" />
|
|
|
</el-select>
|
|
|
@@ -84,11 +84,11 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</ElCol>
|
|
|
- <ElCol :md="24" :lg="12">
|
|
|
- <el-form-item label="优先级" prop="priorityLevel">
|
|
|
- <el-input-number style="width: 100%" v-model="item.priorityLevel" placeholder="请填写优先级" />
|
|
|
- </el-form-item>
|
|
|
- </ElCol>
|
|
|
+ <ElCol :md="24" :lg="12">
|
|
|
+ <el-form-item label="优先级" prop="priorityLevel">
|
|
|
+ <el-input-number style="width: 100%" v-model="item.priorityLevel" placeholder="请填写优先级" />
|
|
|
+ </el-form-item>
|
|
|
+ </ElCol>
|
|
|
<ElCol :md="24" :lg="24">
|
|
|
<el-form-item label="费用描述" prop="costDescribe">
|
|
|
<el-input v-model="item.costDescribe" maxlength="500" placeholder="请输入费用描述" show-word-limit
|
|
|
@@ -107,23 +107,23 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<el-table-column prop="costType" label="类型"></el-table-column>
|
|
|
- <el-table-column prop="inlet" label="入口比例" width="180" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-input-number v-model="scope.row.inlet" :precision="2" controls-position="right"
|
|
|
- style="width: 100%;" :min="0" :max="100" @change="handelRK(scope)">
|
|
|
- <template #suffix>%</template>
|
|
|
- </el-input-number>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="export" label="出口比例" width="180" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-input-number v-model="scope.row.export" :precision="2" controls-position="right"
|
|
|
- style="width: 100%;" :min="0" :max="100" @change="handelCK(scope)">
|
|
|
- <template #suffix>%</template>
|
|
|
- </el-input-number>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column prop="commission" label="手续费比例" width="180" align="center">
|
|
|
+ <el-table-column prop="inlet" label="入口比例" width="180" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input-number v-model="scope.row.inlet" :precision="2" controls-position="right"
|
|
|
+ style="width: 100%;" :min="0" :max="100" @change="handelRK(scope)">
|
|
|
+ <template #suffix>%</template>
|
|
|
+ </el-input-number>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="export" label="出口比例" width="180" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input-number v-model="scope.row.export" :precision="2" controls-position="right"
|
|
|
+ style="width: 100%;" :min="0" :max="100" @change="handelCK(scope)">
|
|
|
+ <template #suffix>%</template>
|
|
|
+ </el-input-number>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column prop="commission" label="手续费比例" width="180" align="center">
|
|
|
<template #default="scope">
|
|
|
<el-input-number v-model="scope.row.commission" :precision="2" controls-position="right"
|
|
|
style="width: 100%;" :min="0" :max="100">
|
|
|
@@ -131,22 +131,22 @@
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>-->
|
|
|
- <el-table-column prop="addThrow" label="加投比例" width="180" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-input-number v-model="scope.row.addThrow" :precision="2" controls-position="right"
|
|
|
- style="width: 100%;" :min="0" :max="100" @change="handelJT(scope)">
|
|
|
- <template #suffix>%</template>
|
|
|
- </el-input-number>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="keepPointRatio" label="留点比例" width="180" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-input-number v-model="scope.row.keepPointRatio" :precision="2" controls-position="right"
|
|
|
- style="width: 100%;" :min="0" :max="100" @change="handelLD(scope)">
|
|
|
- <template #suffix>%</template>
|
|
|
- </el-input-number>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column prop="addThrow" label="加投比例" width="180" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input-number v-model="scope.row.addThrow" :precision="2" controls-position="right"
|
|
|
+ style="width: 100%;" :min="0" :max="100" @change="handelJT(scope)">
|
|
|
+ <template #suffix>%</template>
|
|
|
+ </el-input-number>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="keepPointRatio" label="留点比例" width="180" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input-number v-model="scope.row.keepPointRatio" :precision="2" controls-position="right"
|
|
|
+ style="width: 100%;" :min="0" :max="100" @change="handelLD(scope)">
|
|
|
+ <template #suffix>%</template>
|
|
|
+ </el-input-number>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
@@ -182,7 +182,7 @@ const props = defineProps<{
|
|
|
interface ruleFeeinfo {
|
|
|
ptlAgreementId: string,
|
|
|
contactPerson: string,
|
|
|
- agreementTitle:string,
|
|
|
+ agreementTitle: string,
|
|
|
contactMobile: string,
|
|
|
ptlAgreementCostExternalAddList: any[],
|
|
|
}
|
|
|
@@ -190,7 +190,7 @@ interface ruleFeeinfo {
|
|
|
const emits = defineEmits(["cancel", 'save']);
|
|
|
const ruleFeeinfo = reactive<ruleFeeinfo>({
|
|
|
ptlAgreementId: "",//协议id
|
|
|
- agreementTitle:"",
|
|
|
+ agreementTitle: "",
|
|
|
contactPerson: "",//对接人
|
|
|
contactMobile: "",//手机号
|
|
|
ptlAgreementCostExternalAddList: [],//费用集合
|
|
|
@@ -222,17 +222,17 @@ const feerules = ref<FormRules>({
|
|
|
isInquiry: [
|
|
|
{ required: true, trigger: 'change', message: '请选择是否线询' },
|
|
|
],
|
|
|
- priorityLevel: [
|
|
|
- { required: true, trigger: 'blur', message: '请填写优先级' },
|
|
|
- ]
|
|
|
+ priorityLevel: [
|
|
|
+ { required: true, trigger: 'blur', message: '请填写优先级' },
|
|
|
+ ]
|
|
|
})
|
|
|
watch(props, () => {
|
|
|
if (props.contactPersonEditInfo && props.contactPersonEditInfo.contactPerson) {
|
|
|
Object.assign(ruleFeeinfo, props.contactPersonEditInfo);
|
|
|
activeName.value = ruleFeeinfo.ptlAgreementCostExternalAddList[0].productName;
|
|
|
}
|
|
|
- if(props.agreementInfo){
|
|
|
- agreementActiveId.value=props.agreementInfo.id;
|
|
|
+ if (props.agreementInfo) {
|
|
|
+ agreementActiveId.value = props.agreementInfo.id;
|
|
|
|
|
|
}
|
|
|
})
|
|
|
@@ -255,9 +255,9 @@ onMounted(async () => {
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
-const ptlAgreementIdChange=(value:any)=>{
|
|
|
-let info=agreementselect.value.find((val:any)=>val.id==value);
|
|
|
-ruleFeeinfo.agreementTitle= info.agreementTitle;
|
|
|
+const ptlAgreementIdChange = (value: any) => {
|
|
|
+ let info = agreementselect.value.find((val: any) => val.id == value);
|
|
|
+ ruleFeeinfo.agreementTitle = info.agreementTitle;
|
|
|
}
|
|
|
// 协议列表
|
|
|
const agreementList = () => {
|
|
|
@@ -334,28 +334,29 @@ const validateContactPerson = () => {
|
|
|
}
|
|
|
};
|
|
|
const save = async (formEl: FormInstance | undefined | any) => {
|
|
|
+ console.log('formEl', formEl)
|
|
|
validateContactPerson();
|
|
|
if (!formEl) return
|
|
|
|
|
|
const validationPromises = ruleFeeinfo.ptlAgreementCostExternalAddList.map((formRef: any, index: any) => {
|
|
|
// 轮询验证所有表单校验
|
|
|
- console.log('index', index, typeof index, typeof activeName.value)
|
|
|
+ // console.log('index', index, typeof index, activeName.value, formRef)
|
|
|
+ // console.log('insuranceTypeIndex', insuranceTypeIndex.value)
|
|
|
return new Promise((resolve, reject) => {
|
|
|
if (formRef) {
|
|
|
- formEl[insuranceTypeIndex.value].validate((valid: boolean) => {
|
|
|
+ formEl[index].validate((valid: boolean) => {
|
|
|
if (valid) {
|
|
|
|
|
|
resolve(true);
|
|
|
} else {
|
|
|
- reject(insuranceTypeIndex.value);
|
|
|
+ reject(index);
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- reject(insuranceTypeIndex.value);
|
|
|
+ reject(index);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
try {
|
|
|
await Promise.all(validationPromises);
|
|
|
// 所有表单验证通过后执行提交逻辑
|
|
|
@@ -447,48 +448,48 @@ const draweropen = () => {
|
|
|
|
|
|
|
|
|
const handelRK = (scope) => {
|
|
|
- if(scope.row.export&&scope.row.addThrow || scope.row.export&&scope.row.addThrow === 0) {
|
|
|
- scope.row.keepPointRatio = scope.row.inlet + scope.row.addThrow - scope.row.export
|
|
|
- }
|
|
|
- if(scope.row.export&&scope.row.keepPointRatio) {
|
|
|
- scope.row.addThrow = scope.row.export + scope.row.keepPointRatio - scope.row.inlet
|
|
|
- }
|
|
|
- if(scope.row.keepPointRatio&&scope.row.addThrow || scope.row.keepPointRatio&&scope.row.addThrow === 0) {
|
|
|
- scope.row.export = scope.row.inlet + scope.row.addThrow - scope.row.keepPointRatio
|
|
|
- }
|
|
|
+ if (scope.row.export && scope.row.addThrow || scope.row.export && scope.row.addThrow === 0) {
|
|
|
+ scope.row.keepPointRatio = scope.row.inlet + scope.row.addThrow - scope.row.export
|
|
|
+ }
|
|
|
+ if (scope.row.export && scope.row.keepPointRatio) {
|
|
|
+ scope.row.addThrow = scope.row.export + scope.row.keepPointRatio - scope.row.inlet
|
|
|
+ }
|
|
|
+ if (scope.row.keepPointRatio && scope.row.addThrow || scope.row.keepPointRatio && scope.row.addThrow === 0) {
|
|
|
+ scope.row.export = scope.row.inlet + scope.row.addThrow - scope.row.keepPointRatio
|
|
|
+ }
|
|
|
}
|
|
|
const handelCK = (scope) => {
|
|
|
- if(scope.row.inlet&&scope.row.addThrow || scope.row.inlet&&scope.row.addThrow === 0) {
|
|
|
- scope.row.keepPointRatio = scope.row.inlet + scope.row.addThrow - scope.row.export
|
|
|
- }
|
|
|
- if(scope.row.inlet&&scope.row.keepPointRatio) {
|
|
|
- scope.row.addThrow = scope.row.export + scope.row.keepPointRatio - scope.row.inlet
|
|
|
- }
|
|
|
- if(scope.row.keepPointRatio&&scope.row.addThrow || scope.row.keepPointRatio&&scope.row.addThrow === 0) {
|
|
|
- scope.row.inlet = scope.row.export + scope.row.keepPointRatio - scope.row.addThrow
|
|
|
- }
|
|
|
+ if (scope.row.inlet && scope.row.addThrow || scope.row.inlet && scope.row.addThrow === 0) {
|
|
|
+ scope.row.keepPointRatio = scope.row.inlet + scope.row.addThrow - scope.row.export
|
|
|
+ }
|
|
|
+ if (scope.row.inlet && scope.row.keepPointRatio) {
|
|
|
+ scope.row.addThrow = scope.row.export + scope.row.keepPointRatio - scope.row.inlet
|
|
|
+ }
|
|
|
+ if (scope.row.keepPointRatio && scope.row.addThrow || scope.row.keepPointRatio && scope.row.addThrow === 0) {
|
|
|
+ scope.row.inlet = scope.row.export + scope.row.keepPointRatio - scope.row.addThrow
|
|
|
+ }
|
|
|
}
|
|
|
const handelJT = (scope) => {
|
|
|
- if(scope.row.inlet&&scope.row.export) {
|
|
|
- scope.row.keepPointRatio = scope.row.inlet + scope.row.addThrow - scope.row.export
|
|
|
- }
|
|
|
- if(scope.row.inlet&&scope.row.keepPointRatio) {
|
|
|
- scope.row.export = scope.row.addThrow + scope.row.inlet - scope.row.keepPointRatio
|
|
|
- }
|
|
|
- if(scope.row.keepPointRatio&&scope.row.export) {
|
|
|
- scope.row.inlet = scope.row.export + scope.row.keepPointRatio - scope.row.addThrow
|
|
|
- }
|
|
|
+ if (scope.row.inlet && scope.row.export) {
|
|
|
+ scope.row.keepPointRatio = scope.row.inlet + scope.row.addThrow - scope.row.export
|
|
|
+ }
|
|
|
+ if (scope.row.inlet && scope.row.keepPointRatio) {
|
|
|
+ scope.row.export = scope.row.addThrow + scope.row.inlet - scope.row.keepPointRatio
|
|
|
+ }
|
|
|
+ if (scope.row.keepPointRatio && scope.row.export) {
|
|
|
+ scope.row.inlet = scope.row.export + scope.row.keepPointRatio - scope.row.addThrow
|
|
|
+ }
|
|
|
}
|
|
|
const handelLD = (scope) => {
|
|
|
- if(scope.row.inlet&&scope.row.export) {
|
|
|
- scope.row.addThrow = scope.row.export + scope.row.keepPointRatio - scope.row.inlet
|
|
|
- }
|
|
|
- if(scope.row.inlet&&scope.row.addThrow || scope.row.inlet&&scope.row.addThrow === 0) {
|
|
|
- scope.row.export = scope.row.addThrow + scope.row.inlet - scope.row.keepPointRatio
|
|
|
- }
|
|
|
- if(scope.row.addThrow&&scope.row.export || scope.row.addThrow === 0&&scope.row.export) {
|
|
|
- scope.row.inlet = scope.row.export + scope.row.keepPointRatio - scope.row.addThrow
|
|
|
- }
|
|
|
+ if (scope.row.inlet && scope.row.export) {
|
|
|
+ scope.row.addThrow = scope.row.export + scope.row.keepPointRatio - scope.row.inlet
|
|
|
+ }
|
|
|
+ if (scope.row.inlet && scope.row.addThrow || scope.row.inlet && scope.row.addThrow === 0) {
|
|
|
+ scope.row.export = scope.row.addThrow + scope.row.inlet - scope.row.keepPointRatio
|
|
|
+ }
|
|
|
+ if (scope.row.addThrow && scope.row.export || scope.row.addThrow === 0 && scope.row.export) {
|
|
|
+ scope.row.inlet = scope.row.export + scope.row.keepPointRatio - scope.row.addThrow
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
<!-- 样式区域 -->
|