审批编辑
parent
62aa3b0efa
commit
e613d864d9
|
|
@ -100,6 +100,11 @@ export const updateContract = async (data: ContractVO) => {
|
||||||
return await request.put({ url: `/crm/contract/update`, data })
|
return await request.put({ url: `/crm/contract/update`, data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 审批中修改 CRM 合同
|
||||||
|
export const updateApplyContract = async (data: ContractVO) => {
|
||||||
|
return await request.put({ url: `/crm/contract/bpm/update`, data })
|
||||||
|
}
|
||||||
|
|
||||||
// 删除 CRM 合同
|
// 删除 CRM 合同
|
||||||
export const deleteContract = async (id: number) => {
|
export const deleteContract = async (id: number) => {
|
||||||
return await request.delete({ url: `/crm/contract/delete?id=` + id })
|
return await request.delete({ url: `/crm/contract/delete?id=` + id })
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
<el-table ref="multipleTableRef" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :row-key="getRowKey" :stripe="true" :show-overflow-tooltip="true">
|
<el-table ref="multipleTableRef" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :row-key="getRowKey" :stripe="true" :show-overflow-tooltip="true">
|
||||||
<el-table-column label="序号" align="center" type="selection" :reserve-selection="true" />
|
<el-table-column label="序号" align="center" type="selection" :reserve-selection="true" />
|
||||||
<el-table-column label="联系人姓名" align="center" prop="name" />
|
<el-table-column label="联系人姓名" align="center" prop="name" />
|
||||||
<el-table-column align="center" label="电话" prop="telephone" width="130" />
|
<el-table-column align="center" label="电话" prop="mobile" width="130" />
|
||||||
<el-table-column align="center" label="职位" prop="post" width="120" />
|
<el-table-column align="center" label="职位" prop="post" width="120" />
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
|
||||||
|
|
@ -535,7 +535,7 @@ const router = useRouter() // 路由
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const userId = useUserStoreWithOut().getUser.id // 当前登录的编号
|
const userId = useUserStoreWithOut().getUser.id // 当前登录的编号
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success', 'updataData']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
processInstance: any // 流程实例信息
|
processInstance: any // 流程实例信息
|
||||||
|
|
@ -778,6 +778,7 @@ const handleAudit = async (pass: boolean, formRef: FormInstance | undefined) =>
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pass) {
|
if (pass) {
|
||||||
|
emit('updataData')
|
||||||
const nextAssigneesValid = validateNextAssignees()
|
const nextAssigneesValid = validateNextAssignees()
|
||||||
if (!nextAssigneesValid) return
|
if (!nextAssigneesValid) return
|
||||||
const variables = getUpdatedProcessInstanceVariables()
|
const variables = getUpdatedProcessInstanceVariables()
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- 情况二:业务表单 -->
|
<!-- 情况二:业务表单 -->
|
||||||
<div v-if="processDefinition?.formType === BpmModelFormType.CUSTOM">
|
<div v-if="processDefinition?.formType === BpmModelFormType.CUSTOM">
|
||||||
<BusinessFormComponent :id="processInstance.businessKey" />
|
<BusinessFormComponent ref="BusinessFormComponentRef" :id="processInstance.businessKey" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -120,6 +120,7 @@
|
||||||
:normal-form-api="fApi"
|
:normal-form-api="fApi"
|
||||||
:writable-fields="writableFields"
|
:writable-fields="writableFields"
|
||||||
@success="refresh"
|
@success="refresh"
|
||||||
|
@updataData="updataData"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
|
|
@ -184,6 +185,13 @@ const getDetail = () => {
|
||||||
getProcessModelView()
|
getProcessModelView()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const BusinessFormComponentRef = ref('')
|
||||||
|
|
||||||
|
const updataData = () => {
|
||||||
|
BusinessFormComponentRef.value.submitForm()
|
||||||
|
console.log('%csrc/views/bpm/processInstance/detail/index.vue:189 BusinessFormComponentRef', 'color: pink;', BusinessFormComponentRef);
|
||||||
|
}
|
||||||
|
|
||||||
/** 加载流程实例 */
|
/** 加载流程实例 */
|
||||||
const BusinessFormComponent = ref<any>(null) // 异步组件
|
const BusinessFormComponent = ref<any>(null) // 异步组件
|
||||||
/** 获取审批详情 */
|
/** 获取审批详情 */
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,11 @@
|
||||||
:formatter="erpPriceTableColumnFormatter"
|
:formatter="erpPriceTableColumnFormatter"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="客户名称" align="center" prop="customerName" />
|
<el-table-column label="客户名称" align="center" prop="customerName" />
|
||||||
<el-table-column label="商机组" align="center" prop="statusTypeName" />
|
<el-table-column label="销售阶段" align="center" prop="saleStage">
|
||||||
<el-table-column label="商机阶段" align="center" prop="statusName" />
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.SALE_STAGE" :value="scope.row.saleStage" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<Pagination
|
<Pagination
|
||||||
|
|
@ -64,6 +67,7 @@ import * as BusinessApi from '@/api/crm/business'
|
||||||
import * as ContactApi from '@/api/crm/contact'
|
import * as ContactApi from '@/api/crm/contact'
|
||||||
import BusinessForm from './BusinessListModal.vue'
|
import BusinessForm from './BusinessListModal.vue'
|
||||||
import { BizTypeEnum } from '@/api/crm/permission'
|
import { BizTypeEnum } from '@/api/crm/permission'
|
||||||
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { erpPriceTableColumnFormatter } from '@/utils'
|
import { erpPriceTableColumnFormatter } from '@/utils'
|
||||||
|
|
||||||
const message = useMessage() // 消息
|
const message = useMessage() // 消息
|
||||||
|
|
@ -189,4 +193,7 @@ watch(
|
||||||
},
|
},
|
||||||
{ immediate: true, deep: true }
|
{ immediate: true, deep: true }
|
||||||
)
|
)
|
||||||
|
onActivated(()=>{
|
||||||
|
getList()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -378,7 +378,6 @@
|
||||||
type="date"
|
type="date"
|
||||||
value-format="x"
|
value-format="x"
|
||||||
disabled
|
disabled
|
||||||
format="YYYY-MM-DD"
|
|
||||||
placeholder="选择合同结束时间"
|
placeholder="选择合同结束时间"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
|
|
@ -1003,8 +1002,11 @@ const changeTime = ()=> {
|
||||||
lastMonth = remainMonth - 12
|
lastMonth = remainMonth - 12
|
||||||
addYear = addYear + 1
|
addYear = addYear + 1
|
||||||
}
|
}
|
||||||
|
let newMonth = lastMonth <= 10 ? ("0" + lastMonth) :lastMonth
|
||||||
|
let newDay = day <= 10 ? ("0" + day) :day
|
||||||
let lastYear = addYear + year
|
let lastYear = addYear + year
|
||||||
formData.value.endTime = lastYear + '-' + lastMonth + '-' + day
|
let time = lastYear + '-' + newMonth + '-' + newDay
|
||||||
|
formData.value.endTime = new Date(time).getTime()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -158,4 +158,7 @@ const handleDelete = async (id: number) => {
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
|
onActivated(()=>{
|
||||||
|
getList()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -916,38 +916,34 @@ const validate = () => {
|
||||||
const getData = () => {
|
const getData = () => {
|
||||||
return formData.value
|
return formData.value
|
||||||
}
|
}
|
||||||
defineExpose({ open, validate, getData }) // 提供 open 方法,用于打开弹窗
|
|
||||||
|
|
||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef) return
|
if (!formRef) return
|
||||||
const valid = await formRef.value.validate()
|
const valid = await formRef.value.innerFormRef.validate()
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
// 提交请求
|
// 提交请求
|
||||||
if(contractAAuthorizedCompanyFormRef.value.getData().length) {
|
if(contractAAuthorizedCompanyFormRef.value.getData().length) {
|
||||||
const contractAAuthorizedCompanyValid = await contractAAuthorizedCompanyFormRef.value.validate()
|
|
||||||
if (!contractAAuthorizedCompanyValid) return message.warning('请完善合同甲方关联单位')
|
|
||||||
} else {
|
} else {
|
||||||
return message.warning('请完善合同甲方关联单位')
|
return message.warning('请完善合同甲方关联单位')
|
||||||
}
|
}
|
||||||
|
|
||||||
if(contractAAuthorizedPersonFormRef.value.getData().length) {
|
if(contractAAuthorizedPersonFormRef.value.getData().length) {
|
||||||
const contractAAuthorizedPerson = await contractAAuthorizedPersonFormRef.value.validate()
|
const contractAAuthorizedPerson = await contractAAuthorizedPersonFormRef.value.validate()
|
||||||
if (!contractAAuthorizedPerson) return message.warning('请完善合同甲方授权人信息')
|
if (!contractAAuthorizedPerson) return message.warning('请完善合同甲方授权人信息')
|
||||||
} else {
|
} else {
|
||||||
return message.warning('请完善合同甲方授权人信息')
|
return message.warning('请完善合同甲方授权人信息')
|
||||||
}
|
}
|
||||||
|
|
||||||
if(contractBAuthorizedPersonFormRef.value.getData().length) {
|
// if(contractBAuthorizedPersonFormRef.value.getData().length) {
|
||||||
const contractBAuthorizedPersonPerson = await contractBAuthorizedPersonFormRef.value.validate()
|
// const contractBAuthorizedPersonPerson = await contractBAuthorizedPersonFormRef.value.validate()
|
||||||
if (!contractBAuthorizedPersonPerson) return message.warning('请完善合同乙方授权人信息')
|
// if (!contractBAuthorizedPersonPerson) return message.warning('请完善合同乙方授权人信息')
|
||||||
} else {
|
// } else {
|
||||||
return message.warning('请完善合同乙方授权人信息')
|
// return message.warning('请完善合同乙方授权人信息')
|
||||||
}
|
// }
|
||||||
|
|
||||||
return
|
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -955,22 +951,17 @@ const submitForm = async () => {
|
||||||
// 拼接子表的数据
|
// 拼接子表的数据
|
||||||
data.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData()
|
data.contractAAuthorizedCompanys = contractAAuthorizedCompanyFormRef.value.getData()
|
||||||
data.contractAAuthorizedPersons = contractAAuthorizedPersonFormRef.value.getData()
|
data.contractAAuthorizedPersons = contractAAuthorizedPersonFormRef.value.getData()
|
||||||
data.contractBAuthorizedPersons = contractBAuthorizedPersonFormRef.value.getData()
|
// data.contractBAuthorizedPersons = contractBAuthorizedPersonFormRef.value.getData()
|
||||||
if (!formType.value ) {
|
await ContractApi.updateApplyContract(data)
|
||||||
await ContractApi.createContract(data)
|
message.success(t('common.updateSuccess'))
|
||||||
message.success(t('common.createSuccess'))
|
|
||||||
} else {
|
|
||||||
await ContractApi.updateContract(data)
|
|
||||||
message.success(t('common.updateSuccess'))
|
|
||||||
}
|
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
// 发送操作成功的事件
|
// 发送操作成功的事件
|
||||||
emit('success')
|
emit('success')
|
||||||
goBack()
|
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
defineExpose({ open, validate, getData, submitForm }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
const goBack = ()=> {
|
const goBack = ()=> {
|
||||||
proxy.$router.go(-1)
|
proxy.$router.go(-1)
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div style="display:flex">
|
<div style="display:flex">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.auditStatus === 0 || scope.row.auditStatus === 3"
|
v-if="scope.row.auditStatus === 0 || scope.row.auditStatus === 3 || scope.row.auditStatus === 4"
|
||||||
v-hasPermi="['crm:contract:update']"
|
v-hasPermi="['crm:contract:update']"
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
|
|
@ -237,7 +237,7 @@
|
||||||
详情
|
详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.auditStatus !== 0 && scope.row.auditStatus !== 3"
|
v-if="scope.row.auditStatus !== 0 && scope.row.auditStatus !== 3 && scope.row.auditStatus !== 4"
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleProcessDetail(scope.row)"
|
@click="handleProcessDetail(scope.row)"
|
||||||
|
|
@ -255,7 +255,7 @@
|
||||||
删除
|
删除
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
v-if="scope.row.auditStatus === 0 || scope.row.auditStatus === 2 || scope.row.auditStatus === 3"
|
v-if="scope.row.auditStatus === 0 || scope.row.auditStatus === 2 || scope.row.auditStatus === 3 || scope.row.auditStatus === 4"
|
||||||
@command="(command) => handleCommand(command, scope.row)"
|
@command="(command) => handleCommand(command, scope.row)"
|
||||||
v-hasPermi="[
|
v-hasPermi="[
|
||||||
'crm:contract:update',
|
'crm:contract:update',
|
||||||
|
|
@ -269,7 +269,7 @@
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
command="handleSubmit"
|
command="handleSubmit"
|
||||||
v-if="checkPermi(['crm:contract:update']) && (scope.row.auditStatus === 0 || scope.row.auditStatus === 3)"
|
v-if="checkPermi(['crm:contract:update']) && (scope.row.auditStatus === 0 || scope.row.auditStatus === 3 || scope.row.auditStatus === 4)"
|
||||||
>
|
>
|
||||||
提交审核
|
提交审核
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
|
@ -299,7 +299,7 @@
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
command="handleDelete"
|
command="handleDelete"
|
||||||
v-if="checkPermi(['crm:contract:delete']) && (scope.row.auditStatus === 0 || scope.row.auditStatus === 2 || scope.row.auditStatus == 3)"
|
v-if="checkPermi(['crm:contract:delete']) && (scope.row.auditStatus === 0 || scope.row.auditStatus === 2 || scope.row.auditStatus == 3 || scope.row.auditStatus === 4)"
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="单位名称" prop="customerName">
|
<el-form-item label="单位名称" prop="companyName">
|
||||||
<el-input v-model="formData.companyName" placeholder="请输入单位名称" />
|
<el-input v-model="formData.companyName" placeholder="请输入单位名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,15 @@
|
||||||
<template #businessId>
|
<template #businessId>
|
||||||
<el-col :span="8" v-if="!route.query.taskId">
|
<el-col :span="8" v-if="!route.query.taskId">
|
||||||
<el-form-item label="选择商机" prop="businessId">
|
<el-form-item label="选择商机" prop="businessId">
|
||||||
<el-select v-model="formData.businessId" disabled clearable @change="onBusinessChange">
|
<el-input v-model="formData.businessName" disabled placeholder="自动获取" />
|
||||||
|
<!-- <el-select v-model="formData.businessId" disabled clearable @change="onBusinessChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in businessList"
|
v-for="dict in businessList"
|
||||||
:key="dict.id"
|
:key="dict.id"
|
||||||
:label="dict.name"
|
:label="dict.name"
|
||||||
:value="dict.id"
|
:value="dict.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -287,10 +288,10 @@
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
<template #ownerUserId>
|
<!-- <template #requestorUserId>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="商机负责人" prop="ownerUserId">
|
<el-form-item label="商机负责人" prop="requestorUserId">
|
||||||
<el-select v-model="formData.ownerUserId" placeholder="" disabled>
|
<el-select v-model="formData.requestorUserId" placeholder="" disabled>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in userOptions"
|
v-for="dict in userOptions"
|
||||||
:key="dict.id"
|
:key="dict.id"
|
||||||
|
|
@ -299,7 +300,8 @@
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
|
<template #clueDeveloper>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="拓展人" prop="clueDeveloper">
|
<el-form-item label="拓展人" prop="clueDeveloper">
|
||||||
<el-select v-model="formData.clueDeveloper" placeholder="" disabled>
|
<el-select v-model="formData.clueDeveloper" placeholder="" disabled>
|
||||||
|
|
@ -514,7 +516,7 @@
|
||||||
<template #serviceFeeCollectionMethodId>
|
<template #serviceFeeCollectionMethodId>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="服务费收取方式" prop="serviceFeeCollectionMethodId">
|
<el-form-item label="服务费收取方式" prop="serviceFeeCollectionMethodId">
|
||||||
<el-select v-model="formData.serviceFeeCollectionMethodId" filterable :disabled="formFields.lastPayDate !== 2 || isTrue" placeholder="请选择服务费收取方式">
|
<el-select v-model="formData.serviceFeeCollectionMethodId" @change="changeQuotation" filterable :disabled="formFields.lastPayDate !== 2 || isTrue" placeholder="请选择服务费收取方式">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_COLLECTION_METHOD)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_SERVICE_FEE_COLLECTION_METHOD)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
|
@ -564,7 +566,8 @@
|
||||||
<ContentWrap style="border: none; font-weight: 700">报价产品关联</ContentWrap>
|
<ContentWrap style="border: none; font-weight: 700">报价产品关联</ContentWrap>
|
||||||
</el-col>
|
</el-col>
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<QuotationProductForm ref="quotationProductFormRef" :formFields="formFields" :products="formData.products" :quotation-id="formData.id" :business-id="formData.businessId" :billTemplateId="formData.invoiceTemplateId" />
|
<!-- <QuotationProductForm ref="quotationProductFormRef" :formFields="formFields" :products="formData.products" :quotation-id="formData.id" :business-id="formData.businessId" :billTemplateId="formData.invoiceTemplateId" @success="setSuccess" /> -->
|
||||||
|
<QuotationProductForm ref="quotationProductFormRef" :formFields="formFields" :handleType="handleType" :quotation-id="formData.id" :serviceFeeId ="formData.serviceFeeCollectionMethodId" :business-id="formData.businessId" :billTemplateId="formData.invoiceTemplateId" :products="formData.products" :QuotationTimes="formData.QuotationTimes" @success="setSuccess" />
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<!-- </el-tab-pane> -->
|
<!-- </el-tab-pane> -->
|
||||||
<!-- <el-tab-pane label="营收分析" name="RevenueAnalysis"> -->
|
<!-- <el-tab-pane label="营收分析" name="RevenueAnalysis"> -->
|
||||||
|
|
@ -582,7 +585,7 @@ import { getIntDictOptions, getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
import { QuotationApi, QuotationVO } from '@/api/crm/quotation'
|
import { QuotationApi, QuotationVO } from '@/api/crm/quotation'
|
||||||
import { defaultProps, handleTree } from '@/utils/tree'
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||||
import QuotationProductForm from './components/QuotationProductDetail.vue'
|
import QuotationProductForm from './components/QuotationProductForm.vue'
|
||||||
import * as ContractApi from '@/api/crm/contract'
|
import * as ContractApi from '@/api/crm/contract'
|
||||||
import * as CustomerApi from '@/api/crm/customer'
|
import * as CustomerApi from '@/api/crm/customer'
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
|
|
@ -630,11 +633,13 @@ const print=ref({
|
||||||
clickMounted() { console.log('点击v-print绑定的按钮了!') },
|
clickMounted() { console.log('点击v-print绑定的按钮了!') },
|
||||||
|
|
||||||
})
|
})
|
||||||
|
const handleType = ref('')
|
||||||
const serviceDesc = ref({
|
const serviceDesc = ref({
|
||||||
1:'按单项产品的订单量(机票/张,酒店/间夜,火车票/张、用车/单)分别收取服务费',
|
1:'按单项产品的订单量(机票/张,酒店/间夜,火车票/张、用车/单)分别收取服务费',
|
||||||
2: '按订单总金额乘以比例收取服务费用',
|
2: '按订单总金额乘以比例收取服务费用',
|
||||||
3: ''
|
3: ''
|
||||||
})
|
})
|
||||||
|
const statement = ref(new Array(31).fill(null))
|
||||||
const insuranceList = ref([])
|
const insuranceList = ref([])
|
||||||
const isTrue = ref(false)
|
const isTrue = ref(false)
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
|
@ -668,7 +673,7 @@ const formFields = ref({ //字段显示隐藏权限控制,字段顺序就是显
|
||||||
bankAccount: 1,
|
bankAccount: 1,
|
||||||
legalRepresentative: 1,
|
legalRepresentative: 1,
|
||||||
deptId: 1,
|
deptId: 1,
|
||||||
ownerUserId: 1,
|
requestorUserId: 1,
|
||||||
clueDeveloper: 1,
|
clueDeveloper: 1,
|
||||||
maintainer: 1,
|
maintainer: 1,
|
||||||
pricingUserId: 1,
|
pricingUserId: 1,
|
||||||
|
|
@ -717,7 +722,7 @@ const formData = ref({
|
||||||
invoiceTemplateId: undefined,
|
invoiceTemplateId: undefined,
|
||||||
processInstanceId: undefined,
|
processInstanceId: undefined,
|
||||||
auditStatus: undefined,
|
auditStatus: undefined,
|
||||||
ownerUserId: undefined,
|
requestorUserId: undefined,
|
||||||
expanderUserId: undefined,
|
expanderUserId: undefined,
|
||||||
pricingUserId: undefined,
|
pricingUserId: undefined,
|
||||||
signUserId: undefined,
|
signUserId: undefined,
|
||||||
|
|
@ -783,14 +788,44 @@ const formRef = ref() // 表单 Ref
|
||||||
const subTabsName = ref('quotationProduct')
|
const subTabsName = ref('quotationProduct')
|
||||||
const quotationProductFormRef = ref()
|
const quotationProductFormRef = ref()
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => formData.value.products,
|
||||||
|
(newProducts) => {
|
||||||
|
if (!Array.isArray(newProducts)) {
|
||||||
|
console.warn('formData.value.products is not an array');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let totalOnlinePrice = 0;
|
||||||
|
let totalOfflinePrice = 0;
|
||||||
|
|
||||||
|
for (const product of newProducts) {
|
||||||
|
if (typeof product.basicServiceFee) {
|
||||||
|
totalOnlinePrice += Number(product.basicServiceFee || null);
|
||||||
|
}
|
||||||
|
if (typeof product.totalServiceFee) {
|
||||||
|
totalOfflinePrice += Number(product.totalServiceFee || null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
formData.value.onlinePrice = totalOnlinePrice.toFixed(2) || ''
|
||||||
|
// formData.value.offlinePrice = (totalOfflinePrice + totalOnlinePrice).toFixed(2)
|
||||||
|
// let all = totalOnlinePrice + totalOfflinePrice + totalOnlinePrice
|
||||||
|
formData.value.totalPrice = totalOfflinePrice.toFixed(2) || ''
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
const onBusinessChange = async (businessId: string) => {
|
const onBusinessChange = async (businessId: string) => {
|
||||||
if (!businessId) return
|
if (!businessId) return
|
||||||
|
|
||||||
|
handleType.value = 1
|
||||||
|
|
||||||
try {
|
try {
|
||||||
formLoading.value = true;
|
formLoading.value = true;
|
||||||
const res = await BusinessApi.getBusiness(businessId);
|
const res = await BusinessApi.getBusiness(businessId);
|
||||||
formData.value.customerId = res.customerId;
|
formData.value.customerId = res.customerId;
|
||||||
formData.value.creditLimit = res.creditLimit; // 保存详情信息
|
formData.value.creditLimit = res.creditLimit; // 保存详情信息
|
||||||
formData.value.ownerUserId = res.ownerUserId; // 保存详情信息
|
formData.value.requestorUserId = res.requestorUserId; // 保存详情信息
|
||||||
formData.value.paymentTerm = res.paymentTerm;
|
formData.value.paymentTerm = res.paymentTerm;
|
||||||
formData.value.creditMethod = res.creditMethod;
|
formData.value.creditMethod = res.creditMethod;
|
||||||
formData.value.creditCalcCycle = res.creditCalcCycle;
|
formData.value.creditCalcCycle = res.creditCalcCycle;
|
||||||
|
|
@ -844,13 +879,52 @@ const changeInsuranceId = (val) => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// const changeQuotation = (val) => {
|
||||||
|
// if(serviceDesc.value[val]) {
|
||||||
|
// remark.value = '注:' + serviceDesc.value[val]
|
||||||
|
// } else {
|
||||||
|
// remark.value = ''
|
||||||
|
// }
|
||||||
|
// // formData.value.insuranceId = ''
|
||||||
|
// }
|
||||||
|
|
||||||
const changeQuotation = (val) => {
|
const changeQuotation = (val) => {
|
||||||
if(serviceDesc.value[val]) {
|
if(serviceDesc.value[val]) {
|
||||||
remark.value = '注:' + serviceDesc.value[val]
|
remark.value = '注:' + serviceDesc.value[val]
|
||||||
} else {
|
} else {
|
||||||
remark.value = ''
|
remark.value = ''
|
||||||
}
|
}
|
||||||
// formData.value.insuranceId = ''
|
formData.value.insuranceId = ''
|
||||||
|
changeQuotationTimes(val)
|
||||||
|
handleClick()
|
||||||
|
}
|
||||||
|
|
||||||
|
const changeQuotationTimes = async(val) => {
|
||||||
|
if(formData.value.serviceFeeCollectionMethodId && formData.value.businessId) {
|
||||||
|
newProducts.value = []
|
||||||
|
formData.value.products.forEach( item => {
|
||||||
|
newProducts.value.push({
|
||||||
|
id: item.productId,
|
||||||
|
productUnit: item.productUnit,
|
||||||
|
productName: item.productName,
|
||||||
|
detailType: item.detailType,
|
||||||
|
category: item.category
|
||||||
|
})
|
||||||
|
})
|
||||||
|
let data = {
|
||||||
|
businessId: formData.value.businessId,
|
||||||
|
creditMethod: formData.value.creditMethod,
|
||||||
|
serviceFeeCollectionMethodId: formData.value.serviceFeeCollectionMethodId,
|
||||||
|
paymentTerm: formData.value.paymentTerm,
|
||||||
|
quotationProducts: newProducts.value
|
||||||
|
}
|
||||||
|
|
||||||
|
let num = await QuotationApi.getServerFee(data)
|
||||||
|
num.quotationProducts.forEach( v => {
|
||||||
|
v.productUnit = v.serviceFeeVO.unit
|
||||||
|
})
|
||||||
|
formData.value.QuotationTimes = num.quotationProducts
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onPartnerChange = async (id: string) => {
|
const onPartnerChange = async (id: string) => {
|
||||||
|
|
@ -870,6 +944,10 @@ const onPartnerChange = async (id: string) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const setSuccess = (val) => {
|
||||||
|
formData.value.products = val
|
||||||
|
}
|
||||||
|
|
||||||
const changeNum = (val) => {
|
const changeNum = (val) => {
|
||||||
formData.value.creditLimit = (Number(val) + (formData.value.creditAmount || 0)).toFixed(2)
|
formData.value.creditLimit = (Number(val) + (formData.value.creditAmount || 0)).toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
@ -885,8 +963,8 @@ const handleClick = (val) => {
|
||||||
formData.value.products.forEach( item => {
|
formData.value.products.forEach( item => {
|
||||||
newProducts.value.push({
|
newProducts.value.push({
|
||||||
id: item.productId,
|
id: item.productId,
|
||||||
onlinePrice: item.onlinePrice,
|
// onlinePrice: item.onlinePrice,
|
||||||
offlinePrice: item.offlinePrice,
|
// offlinePrice: item.offlinePrice,
|
||||||
productUnit: item.productUnit,
|
productUnit: item.productUnit,
|
||||||
productName: item.productName,
|
productName: item.productName,
|
||||||
detailType: item.detailType,
|
detailType: item.detailType,
|
||||||
|
|
@ -919,14 +997,14 @@ const open = async (type: string) => {
|
||||||
if (typeof product.onlinePrice) {
|
if (typeof product.onlinePrice) {
|
||||||
totalOnlinePrice += Number(product.onlinePrice);
|
totalOnlinePrice += Number(product.onlinePrice);
|
||||||
}
|
}
|
||||||
if (typeof product.offlinePrice) {
|
// if (typeof product.offlinePrice) {
|
||||||
totalOfflinePrice += Number(product.offlinePrice);
|
// totalOfflinePrice += Number(product.offlinePrice);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
handleClick()
|
handleClick()
|
||||||
formData.value.serviceFeeCollectionMethodId = Number(formData.value.serviceFeeCollectionMethodId)
|
formData.value.serviceFeeCollectionMethodId = Number(formData.value.serviceFeeCollectionMethodId)
|
||||||
// formData.value.onlinePrice = totalOnlinePrice.toFixed(2)
|
// formData.value.onlinePrice = totalOnlinePrice.toFixed(2)
|
||||||
formData.value.offlinePrice = (totalOfflinePrice + totalOnlinePrice).toFixed(2)
|
// formData.value.offlinePrice = (totalOfflinePrice + totalOnlinePrice).toFixed(2)
|
||||||
// let all = totalOnlinePrice + totalOfflinePrice + totalOnlinePrice
|
// let all = totalOnlinePrice + totalOfflinePrice + totalOnlinePrice
|
||||||
// formData.value.totalPrice = all.toFixed(2)
|
// formData.value.totalPrice = all.toFixed(2)
|
||||||
if(formData.value.insuranceId) {
|
if(formData.value.insuranceId) {
|
||||||
|
|
@ -944,7 +1022,6 @@ const open = async (type: string) => {
|
||||||
// 获得用户列表
|
// 获得用户列表
|
||||||
invoiceTemplateList.value = await BillTemplateApi.getSimpleList()
|
invoiceTemplateList.value = await BillTemplateApi.getSimpleList()
|
||||||
}
|
}
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
||||||
|
|
||||||
const printContent = () => {
|
const printContent = () => {
|
||||||
// 使用 window.print() 来触发打印
|
// 使用 window.print() 来触发打印
|
||||||
|
|
@ -955,7 +1032,7 @@ const printContent = () => {
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
await formRef.value.validate()
|
await formRef.value.innerFormRef.validate()
|
||||||
// 校验子表单
|
// 校验子表单
|
||||||
try {
|
try {
|
||||||
await quotationProductFormRef.value.validate()
|
await quotationProductFormRef.value.validate()
|
||||||
|
|
@ -969,22 +1046,17 @@ const submitForm = async () => {
|
||||||
const data = formData.value as unknown as QuotationVO
|
const data = formData.value as unknown as QuotationVO
|
||||||
// 拼接子表的数据
|
// 拼接子表的数据
|
||||||
data.quotationProducts = quotationProductFormRef.value.getData()
|
data.quotationProducts = quotationProductFormRef.value.getData()
|
||||||
if (!formType.value) {
|
await QuotationApi.updateQuotation(data)
|
||||||
await QuotationApi.createQuotation(data)
|
message.success(t('common.updateSuccess'))
|
||||||
message.success(t('common.createSuccess'))
|
|
||||||
} else {
|
|
||||||
await QuotationApi.updateQuotation(data)
|
|
||||||
message.success(t('common.updateSuccess'))
|
|
||||||
}
|
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
// 发送操作成功的事件
|
// 发送操作成功的事件
|
||||||
emit('success')
|
emit('success')
|
||||||
goBack()
|
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
defineExpose({ open, submitForm }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
const goBack = ()=> {
|
const goBack = ()=> {
|
||||||
proxy.$router.go(-1)
|
proxy.$router.go(-1)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|
||||||
|
|
||||||
<el-col :span="8">
|
<el-col :span="8" v-if="!formType">
|
||||||
<el-form-item label="选择商机" prop="businessId">
|
<el-form-item label="选择商机" prop="businessId">
|
||||||
<el-select v-model="formData.businessId" filterable clearable placeholder="请选择商机" @change="onBusinessChange">
|
<el-select v-model="formData.businessId" filterable clearable placeholder="请选择商机" @change="onBusinessChange">
|
||||||
<el-option
|
<el-option
|
||||||
|
|
@ -22,6 +22,19 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="8" v-if="formType">
|
||||||
|
<el-form-item label="选择商机" prop="businessName">
|
||||||
|
<el-input v-model="formData.businessName" disabled placeholder="自动获取" />
|
||||||
|
<!-- <el-select v-model="formData.businessName" filterable clearable placeholder="请选择商机" @change="onBusinessChange">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in businessList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select> -->
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="8" v-if="formType">
|
<el-col :span="8" v-if="formType">
|
||||||
<el-form-item label="报价单编号" prop="">
|
<el-form-item label="报价单编号" prop="">
|
||||||
<el-input v-model="formData.no" disabled placeholder="自动获取" />
|
<el-input v-model="formData.no" disabled placeholder="自动获取" />
|
||||||
|
|
@ -238,7 +251,7 @@
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="8">
|
<!-- <el-col :span="8">
|
||||||
<el-form-item label="商机负责人" prop="requestorUserId">
|
<el-form-item label="商机负责人" prop="requestorUserId">
|
||||||
<el-select v-model="formData.requestorUserId" disabled placeholder="请选择商机负责人">
|
<el-select v-model="formData.requestorUserId" disabled placeholder="请选择商机负责人">
|
||||||
<el-option
|
<el-option
|
||||||
|
|
@ -249,7 +262,7 @@
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="拓展人" prop="clueDeveloper">
|
<el-form-item label="拓展人" prop="clueDeveloper">
|
||||||
<el-select v-model="formData.clueDeveloper" disabled placeholder="">
|
<el-select v-model="formData.clueDeveloper" disabled placeholder="">
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@
|
||||||
<el-tab-pane label="下属负责的" name="3" />
|
<el-tab-pane label="下属负责的" name="3" />
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
<el-table-column label="客户名称" align="center" prop="customerId" width="250">
|
<el-table-column label="客户名称" align="center" fixed="left" prop="customerId" width="250">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<!-- <el-link
|
<!-- <el-link
|
||||||
:underline="false"
|
:underline="false"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue