报价-关联单位
parent
97e3647a49
commit
147131089b
|
|
@ -0,0 +1,157 @@
|
|||
<template>
|
||||
<Dialog title="添加商品" v-model="dialogVisible" width="50%">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="单位名称" prop="companyName">
|
||||
<el-input
|
||||
v-model="queryParams.companyName"
|
||||
placeholder="请输入单位名称"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">
|
||||
<Icon class="mr-5px" icon="ep:search" />
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="resetQuery">
|
||||
<Icon class="mr-5px" icon="ep:refresh" />
|
||||
重置
|
||||
</el-button>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<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" prop="companyName" />
|
||||
<el-table-column label="统一社会信用代码" align="center" prop="unifiedCreditCode" />
|
||||
<el-table-column label="开票电话" align="center" prop="invoicingTelephone" />
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import * as ProductApi from '@/api/crm/product'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { BillTemplateApi, BillTemplateVO } from '@/api/crm/billtemplate'
|
||||
import CustomerCompanyForm from './CustomerCompanyForm.vue'
|
||||
|
||||
/** 票据模版 列表 */
|
||||
defineOptions({ name: 'BillTemplate' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<BillTemplateVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const multipleSelection = ref([])
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const multipleTableRef = ref()
|
||||
const selectedRowKeys = ref<number[]>([]);
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
customerId: undefined
|
||||
})
|
||||
const bizId = ref('')
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
/** 打开弹窗 */
|
||||
const open = async (data: [], id?: number) => {
|
||||
dialogVisible.value = true
|
||||
multipleSelection.value = data
|
||||
bizId.value = id ? id : ''
|
||||
await getList()
|
||||
await setSelections()
|
||||
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
// 跨页唯一id
|
||||
const getRowKey = (row) => {
|
||||
return row.id
|
||||
}
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
queryParams.customerId = bizId.value
|
||||
const data = await CustomerCompanyApi.getCustomerCompanyPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
const handleSelectionChange = (val: []) => {
|
||||
multipleSelection.value = val
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
multipleTableRef.value.clearSelection()
|
||||
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 提交请求
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success', multipleSelection.value)
|
||||
}
|
||||
const setSelections = async () => {
|
||||
const selections = multipleSelection.value.map(item => {
|
||||
return {
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
|
||||
if (selections && selections.length > 0) {
|
||||
list.value.forEach((row: any) => {
|
||||
if (selections.some(item => item.id === row.id)) {
|
||||
multipleTableRef.value.toggleRowSelection(row, true); // 设置选择状态。
|
||||
}
|
||||
});
|
||||
} else {
|
||||
multipleTableRef.value.clearSelection(); // 如果没有保存的选择,则清空当前页的选择。
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -532,7 +532,7 @@ console.log('%csrc/views/crm/business/BusinessForm.vue:516 getIntDictOptions(DIC
|
|||
const customerId = route.query.customerId;
|
||||
formData.value.customerId = Number(route.query.bizId) || ''
|
||||
formData.value.clueDeveloper = Number(route.query.clueDeveloper) || ''
|
||||
formData.value.maintainer = Number(route.query.maintainer) || ''
|
||||
route.query.maintainer ? formData.value.maintainer = Number(route.query.maintainer) : ''
|
||||
formData.value.requestorUserId = customerId ? '' : useUserStore().getUser.id;
|
||||
formType.value = route.query.id || route.params.id;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ const submitForm = async () => {
|
|||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as OrganizationsVO
|
||||
data.customerId = formType.value
|
||||
data.id = formType.value
|
||||
await ContractApi.contractUpload(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
dialogVisible.value = false
|
||||
|
|
|
|||
|
|
@ -1,233 +1,106 @@
|
|||
<template>
|
||||
<!-- 操作栏 -->
|
||||
<!-- 操作栏 -->
|
||||
<el-row justify="end">
|
||||
<el-button @click="handleAdd" type="primary">
|
||||
<el-button @click="openForm('create')" type="primary">
|
||||
<Icon class="mr-5px" icon="system-uicons:contacts" />
|
||||
创建授权人
|
||||
创建关联单位
|
||||
</el-button>
|
||||
</el-row>
|
||||
<ContentWrap class="mt-10px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
v-loading="formLoading"
|
||||
label-width="0px"
|
||||
:inline-message="true"
|
||||
>
|
||||
<ContentWrap class="mt-10px">
|
||||
<el-table v-loading="loading" :data="formData" class="-mt-10px">
|
||||
<el-table-column label="序号" type="index" width="100" />
|
||||
<el-table-column label="授权人姓名" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.customerName`" :rules="formRules.customerName" class="mb-0px!" v-if="!type">
|
||||
<el-input v-model="row.customerName" placeholder="请输入授权人姓名" />
|
||||
</el-form-item>
|
||||
<div v-else>
|
||||
{{row.customerName}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="姓名" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.customerName`" :rules="formRules.customerName" class="mb-0px!">
|
||||
<el-input v-model="row.customerName" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="授权人类型" min-width="150" prop="authPersonType">
|
||||
<template #default="{ row }">
|
||||
<!-- <el-form-item :prop="`${$index}.authPersonType`" :rules="formRules.authPersonType" class="mb-0px!" v-if="!type">
|
||||
<el-select v-model="row.authPersonType" placeholder="请选择授权人类型">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions('auth_person_type')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select> -->
|
||||
<!-- </el-form-item> -->
|
||||
<!-- <div v-else>
|
||||
</div> -->
|
||||
{{getName(getIntDictOptions(DICT_TYPE.CRM_CONTACT_ROLE_TYPE), row.authPersonType)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="授权人手机号" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.phoneNumber`" :rules="formRules.phoneNumber" class="mb-0px!" v-if="!type">
|
||||
<el-input v-model="row.phoneNumber" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
<div v-else>
|
||||
{{row.phoneNumber}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="微信号" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.wechat`" :rules="formRules.wechat" class="mb-0px!" v-if="!type">
|
||||
<el-input v-model="row.wechat" placeholder="请输入微信号" />
|
||||
</el-form-item>
|
||||
<div v-else>
|
||||
{{row.wechat}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="身份证号" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.idNumber`" :rules="formRules.idNumber" class="mb-0px!" v-if="!type">
|
||||
<el-input v-model="row.idNumber" placeholder="请输入身份证号" />
|
||||
</el-form-item>
|
||||
<div v-else>
|
||||
{{row.idNumber}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电子邮箱" min-width="150">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.email`" :rules="formRules.email" class="mb-0px!" v-if="!type">
|
||||
<el-input v-model="row.email" placeholder="请输入电子邮箱" />
|
||||
</el-form-item>
|
||||
<div v-else>
|
||||
{{row.email}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="60" v-if="!type">
|
||||
<template #default="{ $index }">
|
||||
<el-button @click="handleDelete($index)" link>—</el-button>
|
||||
<el-table-column label="单位名称" min-width="150" prop="customerName" />
|
||||
<el-table-column label="统一社会信用代码" min-width="150" prop="unifiedCreditCode" />
|
||||
<el-table-column label="开票地址" min-width="150" prop="invoicingAddress" />
|
||||
<el-table-column label="开票电话" min-width="150" prop="invoicingTelephone" />
|
||||
<el-table-column label="开户行" min-width="150" prop="companyBank" />
|
||||
<el-table-column label="开户账号" min-width="150" prop="companyAccount" />
|
||||
<el-table-column label="通讯地址" min-width="150" prop="companyAddress" />
|
||||
<el-table-column align="center" fixed="right" label="操作" width="120" v-if="!type">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['crm:customer-company:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['crm:customer-company:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<!-- <el-row justify="center" class="mt-3" v-if="!type">
|
||||
<el-button @click="handleAdd" round>+ 添加</el-button>
|
||||
</el-row> -->
|
||||
</ContentWrap>
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ContactForm ref="contactRef" @success="getList" />
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<CustomerCompanyForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as ContractApi from '@/api/crm/contract'
|
||||
import { getIntDictOptions, getStrDictOptions, DICT_TYPE, getBoolDictOptions } from '@/utils/dict'
|
||||
import ContactForm from '@/components/contact/index.vue'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import CustomerCompanyForm from '@/views/crm/customercompany/CustomerCompanyForm.vue'
|
||||
import { CustomerCompanyApi, CustomerCompanyVO } from '@/api/crm/customercompany'
|
||||
|
||||
const props = defineProps<{
|
||||
contractId: undefined, // 合同ID(主表的关联字段)
|
||||
type: undefined,
|
||||
customerId: undefined,
|
||||
formFields: {}
|
||||
}>()
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
const total = ref(0) // 列表的总页数
|
||||
const loading = ref(false) // 表单的加载中
|
||||
const formData = ref([])
|
||||
const formRules = reactive({
|
||||
contractId: [{ required: true, message: '合同ID不能为空', trigger: 'blur' }],
|
||||
authPersonType: [{ required: true, message: '授权人类型不能为空', trigger: 'blur' }],
|
||||
customerName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
|
||||
phoneNumber: [{ required: true, message: '手机号不能为空', trigger: 'blur' } ,
|
||||
{pattern: /^(1[3-9][0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/, message: '请输入正确手机号'}
|
||||
],
|
||||
idNumber: [{ required: true, message: '身份证号不能为空', trigger: 'blur' } ,
|
||||
{
|
||||
pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
|
||||
message: "身份证号格式不正确",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
email: [{ required: true, message: '电子邮箱不能为空', trigger: 'blur' } ,
|
||||
{
|
||||
pattern:
|
||||
/^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})$/,
|
||||
message: "请输入正确的电子邮箱",
|
||||
}
|
||||
]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 监听主表的关联字段的变化,加载对应的子表数据 */
|
||||
watch(
|
||||
() => props.contractId,
|
||||
async (val) => {
|
||||
// 1. 重置表单
|
||||
formData.value = []
|
||||
// 2. val 非空,则加载数据
|
||||
if (!val) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
formLoading.value = true
|
||||
formData.value = await ContractApi.getContractAAuthorizedPersonListByContractId(val)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
customerId: undefined,
|
||||
companyName: undefined,
|
||||
})
|
||||
const props = defineProps<{
|
||||
bizId: number // 业务编号
|
||||
}>()
|
||||
const contactRef = ref() // 表单 Ref
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
queryParams.customerId = props.bizId
|
||||
const data = await CustomerCompanyApi.getCustomerCompanyPage(queryParams)
|
||||
formData.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
defineExpose({ getList })
|
||||
|
||||
/** 新增按钮操作 */
|
||||
// const handleAdd = () => {
|
||||
// const row = {
|
||||
// id: undefined,
|
||||
// contractId: undefined,
|
||||
// customerContactId: undefined,
|
||||
// customerName: undefined,
|
||||
// authPersonType: undefined,
|
||||
// phoneNumber: undefined,
|
||||
// wechat: undefined,
|
||||
// idNumber: undefined,
|
||||
// email: undefined,
|
||||
// deletedFlag: undefined
|
||||
// }
|
||||
// row.contractId = props.contractId
|
||||
// formData.value.push(row)
|
||||
// }
|
||||
const message = useMessage() // 消息弹窗
|
||||
const contactRef = ref() // 表单 Ref
|
||||
const handleAdd = () => {
|
||||
contactRef.value.open(formData.value, props.customerId)
|
||||
}
|
||||
|
||||
const getList = (val: []) => {
|
||||
console.log('%csrc/views/crm/contract/components/ContractAAuthorizedPersonForm.vue:182 val', 'color: #007acc;', val);
|
||||
for(let i = val.length - 1; i >= 0; i--) {
|
||||
let obj = val[i]
|
||||
if(formData.value.some(v => v.customerContactId === obj.id)) val.splice(i, 1)
|
||||
}
|
||||
val.forEach(item => {
|
||||
if(!formData.value.some(v => v.customerContactId === item.id)) {
|
||||
val.forEach(item => {
|
||||
formData.value.push({
|
||||
"customerContactId": item.id,
|
||||
"authPersonType": item.contactRoleType,
|
||||
"customerName": item.name,
|
||||
"phoneNumber": item.mobile,
|
||||
"wechat":item. wechat,
|
||||
"email":item. email,
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const openForm = (type: string, id?: number, bizId?: number) => {
|
||||
formRef.value.open(type, id, props.bizId)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = (index) => {
|
||||
formData.value.splice(index, 1)
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await CustomerCompanyApi.deleteCustomerCompany(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 表单校验 */
|
||||
const validate = () => {
|
||||
return formRef.value.validate()
|
||||
}
|
||||
|
||||
/** 表单值 */
|
||||
const getData = () => {
|
||||
return formData.value
|
||||
}
|
||||
|
||||
defineExpose({ validate, getData })
|
||||
|
||||
const getName = (opt, val) => {
|
||||
const arr = opt.filter(v => v.value == val)
|
||||
return arr.length ? arr[0]['label'] : ''
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@
|
|||
<el-tab-pane label="合同" lazy name="ContractListRef">
|
||||
<ContractList ref="ContractListRef" :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="授权人" lazy name="AuthorizedPersonFormRef">
|
||||
<el-tab-pane label="关联单位" lazy name="AuthorizedPersonFormRef">
|
||||
<AuthorizedPersonForm ref="AuthorizedPersonFormRef" :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="回访" lazy>
|
||||
|
|
@ -236,6 +236,7 @@ const BusinessListRef = ref('')
|
|||
const QuotationListRef = ref('')
|
||||
const ContractListRef = ref('')
|
||||
const ComplaintsSuggestionRef = ref('')
|
||||
const AuthorizedPersonFormRef = ref('')
|
||||
|
||||
const handleClick = async (val) => {
|
||||
let name = val.props.name
|
||||
|
|
@ -250,7 +251,8 @@ const handleClick = async (val) => {
|
|||
BusinessListRef: BusinessListRef.value,
|
||||
QuotationListRef: QuotationListRef.value,
|
||||
ContractListRef: ContractListRef.value,
|
||||
ComplaintsSuggestionRef: ComplaintsSuggestionRef.value
|
||||
ComplaintsSuggestionRef: ComplaintsSuggestionRef.value,
|
||||
AuthorizedPersonFormRef: AuthorizedPersonFormRef.value
|
||||
}
|
||||
objRef[name].getList()
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,36 +1,61 @@
|
|||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="50%">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
label-width="150px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="客户ID" prop="customerId">
|
||||
<el-input v-model="formData.customerId" placeholder="请输入客户ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单位名称" prop="companyName">
|
||||
<el-input v-model="formData.companyName" placeholder="请输入单位名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="统一社会信用代码" prop="unifiedCreditCode">
|
||||
<el-input v-model="formData.unifiedCreditCode" placeholder="请输入统一社会信用代码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开票地址" prop="invoicingAddress">
|
||||
<el-input v-model="formData.invoicingAddress" placeholder="请输入开票地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开票电话" prop="invoicingTelephone">
|
||||
<el-input v-model="formData.invoicingTelephone" placeholder="请输入开票电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开户行" prop="companyBank">
|
||||
<el-input v-model="formData.companyBank" placeholder="请输入开户行" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开户账号" prop="companyAccount">
|
||||
<el-input v-model="formData.companyAccount" placeholder="请输入开户账号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通讯地址" prop="companyAddress">
|
||||
<el-input v-model="formData.companyAddress" placeholder="请输入通讯地址" />
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户ID" prop="customerId">
|
||||
<SelectComponent :customerList="customerList" :disabled="!!isbizId" v-model="formData.customerId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位名称" prop="companyName">
|
||||
<el-input v-model="formData.companyName" placeholder="请输入单位名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="统一社会信用代码" prop="unifiedCreditCode">
|
||||
<el-input v-model="formData.unifiedCreditCode" placeholder="请输入统一社会信用代码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开票地址" prop="invoicingAddress">
|
||||
<el-input v-model="formData.invoicingAddress" placeholder="请输入开票地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开票电话" prop="invoicingTelephone">
|
||||
<el-input v-model="formData.invoicingTelephone" oninput = "value=value.replace(/[^\d]/g,'')" placeholder="请输入开票电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开户行" prop="companyBank">
|
||||
<el-input v-model="formData.companyBank" placeholder="请输入开户行" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开户账号" prop="companyAccount">
|
||||
<el-input v-model="formData.companyAccount" placeholder="请输入开户账号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="通讯地址" prop="companyAddress">
|
||||
<el-input v-model="formData.companyAddress" placeholder="请输入通讯地址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
|
|
@ -40,6 +65,7 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { CustomerCompanyApi, CustomerCompanyVO } from '@/api/crm/customercompany'
|
||||
import * as CustomerApi from '@/api/crm/customer'
|
||||
|
||||
/** 客户关联单位 表单 */
|
||||
defineOptions({ name: 'CustomerCompanyForm' })
|
||||
|
|
@ -47,6 +73,7 @@ defineOptions({ name: 'CustomerCompanyForm' })
|
|||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const customerList = ref([]) // 客户列表的数据
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
|
|
@ -67,15 +94,21 @@ const formRules = reactive({
|
|||
companyName: [{ required: true, message: '单位名称不能为空', trigger: 'blur' }],
|
||||
unifiedCreditCode: [{ required: true, message: '统一社会信用代码不能为空', trigger: 'blur' }],
|
||||
invoicingAddress: [{ required: true, message: '开票地址不能为空', trigger: 'blur' }],
|
||||
invoicingTelephone: [{ required: true, message: '开票电话不能为空', trigger: 'blur' }],
|
||||
companyBank: [{ required: true, message: '开户行不能为空', trigger: 'blur' }],
|
||||
companyAccount: [{ required: true, message: '开户账号不能为空', trigger: 'blur' }],
|
||||
companyAddress: [{ required: true, message: '通讯地址不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const isbizId = ref('')
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
const open = async (type: string, id?: number, bizId?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
isbizId.value = bizId
|
||||
resetForm()
|
||||
formData.value.customerId = bizId ? bizId : ''
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
|
|
@ -85,6 +118,8 @@ const open = async (type: string, id?: number) => {
|
|||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
// 获得客户列表
|
||||
customerList.value = await CustomerApi.getCustomerSimpleList()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
|
|
|
|||
|
|
@ -8,15 +8,7 @@
|
|||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="客户ID" prop="customerId">
|
||||
<el-input
|
||||
v-model="queryParams.customerId"
|
||||
placeholder="请输入客户ID"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="单位名称" prop="companyName">
|
||||
<el-input
|
||||
v-model="queryParams.companyName"
|
||||
|
|
@ -26,7 +18,7 @@
|
|||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="统一社会信用代码" prop="unifiedCreditCode">
|
||||
<!-- <el-form-item label="统一社会信用代码" prop="unifiedCreditCode">
|
||||
<el-input
|
||||
v-model="queryParams.unifiedCreditCode"
|
||||
placeholder="请输入统一社会信用代码"
|
||||
|
|
@ -79,8 +71,8 @@
|
|||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
|
|
@ -90,7 +82,7 @@
|
|||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
|
|
@ -102,7 +94,7 @@
|
|||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
|
|
@ -110,7 +102,7 @@
|
|||
v-hasPermi="['crm:customer-company:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
|
@ -118,7 +110,6 @@
|
|||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="客户ID" align="center" prop="customerId" />
|
||||
<el-table-column label="单位名称" align="center" prop="companyName" />
|
||||
<el-table-column label="统一社会信用代码" align="center" prop="unifiedCreditCode" />
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
v-hasPermi="['crm:file-template:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
|
|
|||
|
|
@ -70,10 +70,22 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品编号" align="center" prop="projectCode" width="120"/>
|
||||
<el-table-column label="产品类型" align="center" prop="projectCode" width="120"/>
|
||||
<el-table-column label="明细类型" align="center" prop="projectCode" width="120"/>
|
||||
<el-table-column label="产品类型" align="center" prop="category" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_CATEGORY" :value="scope.row.category" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="明细类型" align="center" prop="detailType" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_DETAIL_TYPE" :value="scope.row.detailType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客单价" align="center" prop="customerPrice" width="120"/>
|
||||
<el-table-column label="单位" align="center" prop="projectCode" width="120"/>
|
||||
<el-table-column label="单位" align="center" prop="unit" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="scope.row.unit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购成本" align="center" prop="purchaseCost" width="120"/>
|
||||
<el-table-column label="代理费前返比例/金额" align="center" prop="agentFeePreReturn" width="180"/>
|
||||
<el-table-column label="代理费后返比例/金额" align="center" prop="agentFeePostReturn" width="180"/>
|
||||
|
|
@ -133,6 +145,7 @@ import download from '@/utils/download'
|
|||
import { ProductProcurementCostApi, ProductProcurementCostVO } from '@/api/crm/productprocurementcost'
|
||||
import ProductProcurementCostForm from './ProductProcurementCostForm.vue'
|
||||
import * as ProductApi from '@/api/crm/product'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
|
||||
const productList = ref<ProductApi.ProductVO[]>([]) // 产品列表
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
:model="formData"
|
||||
:rules="formRules"
|
||||
:fields="formFields"
|
||||
label-width="110px"
|
||||
label-width="120px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<template #businessId>
|
||||
|
|
@ -99,13 +99,13 @@
|
|||
</el-form-item>
|
||||
</el-col> -->
|
||||
</template>
|
||||
<template #financingInfo>
|
||||
<!-- <template #financingInfo>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="融资信息" prop="financingInfo">
|
||||
<el-input v-model="formData.financingInfo" disabled clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</template> -->
|
||||
<template #actualCapital>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实缴资金" prop="actualCapital">
|
||||
|
|
@ -209,7 +209,7 @@
|
|||
<el-form-item label="合作类型" prop="partnerType">
|
||||
<el-select v-model="formData.partnerType" clearable disabled placeholder="请选择合作类型">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PARTNER_TYPE)"
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.CRM_PARTNER_TYPE1)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
@ -300,9 +300,9 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="拓展人" prop="expanderUserId">
|
||||
<el-select v-model="formData.expanderUserId" placeholder="" disabled>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="拓展人" prop="clueDeveloper">
|
||||
<el-select v-model="formData.clueDeveloper" placeholder="" disabled>
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
|
|
@ -311,7 +311,7 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-col>
|
||||
</template>
|
||||
<template #pricingUserId>
|
||||
<el-col :span="8">
|
||||
|
|
@ -385,18 +385,19 @@
|
|||
<template #creditCalcCycle>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信计算周期" prop="creditCalcCycle">
|
||||
<el-select v-model="formData.creditCalcCycle" placeholder="" disabled >
|
||||
<el-input v-model="formData.creditCalcCycle" disabled placeholder="" />
|
||||
<!-- <el-select v-model="formData.creditCalcCycle" placeholder="" disabled >
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions('credit_calc_cycle')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<template #invoiceTemplateId>
|
||||
<!-- <template #invoiceTemplateId>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="票据模板" prop="invoiceTemplateId">
|
||||
<el-select v-model="formData.invoiceTemplateId" placeholder="" disabled >
|
||||
|
|
@ -409,7 +410,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</template> -->
|
||||
<template #quotationTimes>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="第几次报价" prop="quotationTimes">
|
||||
|
|
@ -417,15 +418,15 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<template #creditLimit1>
|
||||
<!-- <template #creditLimit1>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="授信额度" prop="creditLimit">
|
||||
<el-input v-model="formData.creditLimit" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</template>
|
||||
<template #serviceFeeCollectionMethodId>
|
||||
</template> -->
|
||||
<!-- <template #serviceFeeCollectionMethodId>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="服务费收取方式" prop="serviceFeeCollectionMethodId">
|
||||
<el-select v-model="formData.serviceFeeCollectionMethodId" disabled placeholder="">
|
||||
|
|
@ -438,7 +439,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</template> -->
|
||||
<template #onlinePrice>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="基础服务费合计" prop="onlinePrice">
|
||||
|
|
@ -459,7 +460,7 @@
|
|||
</el-form-item>
|
||||
</el-col> -->
|
||||
</template>
|
||||
<template #totalPrice>
|
||||
<!-- <template #totalPrice>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="服务费收入合计" prop="totalPrice">
|
||||
<el-input
|
||||
|
|
@ -469,7 +470,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</template> -->
|
||||
</processForm>
|
||||
<!-- 子表的表单 -->
|
||||
<!-- <template #other> -->
|
||||
|
|
|
|||
|
|
@ -250,9 +250,9 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="拓展人" prop="expanderUserId">
|
||||
<el-select v-model="formData.expanderUserId" placeholder="请选择拓展人">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="拓展人" prop="clueDeveloper">
|
||||
<el-select v-model="formData.clueDeveloper" disabled placeholder="请选择拓展人">
|
||||
<el-option
|
||||
v-for="dict in userOptions"
|
||||
:key="dict.id"
|
||||
|
|
@ -261,7 +261,7 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="方案报价人" prop="pricingUserId">
|
||||
<el-select v-model="formData.pricingUserId" disabled placeholder="请选择方案报价人">
|
||||
|
|
@ -551,7 +551,7 @@ const formData = ref({
|
|||
auditStatus: undefined,
|
||||
serviceFeeCollectionMethodId: undefined,
|
||||
requestorUserId: undefined,
|
||||
expanderUserId: undefined,
|
||||
clueDeveloper: undefined,
|
||||
pricingUserId: undefined,
|
||||
signUserId: undefined,
|
||||
signPhoneNumber: undefined,
|
||||
|
|
@ -741,8 +741,9 @@ const onBusinessChange = async (businessId: string) => {
|
|||
formData.value.paymentTerm = res.paymentTerm;
|
||||
formData.value.creditMethod = res.creditMethod;
|
||||
formData.value.creditCalcCycle = res.creditCalcCycle;
|
||||
formData.value.deptId = res.deptId;
|
||||
// formData.value.deptId = res.deptId;
|
||||
formData.value.offlinePrice = res.offlinePrice;
|
||||
formData.value.clueDeveloper = res.clueDeveloper
|
||||
// formData.value.onlinePrice = res.onlinePrice || '';
|
||||
// formData.value.totalPrice = res.totalPrice || '';
|
||||
formData.value.creditAmount = res.creditAmount;
|
||||
|
|
@ -897,7 +898,7 @@ const resetForm = () => {
|
|||
processInstanceId: undefined,
|
||||
auditStatus: undefined,
|
||||
requestorUserId: undefined,
|
||||
expanderUserId: undefined,
|
||||
clueDeveloper: undefined,
|
||||
pricingUserId: undefined,
|
||||
signUserId: undefined,
|
||||
signPhoneNumber: undefined,
|
||||
|
|
@ -919,7 +920,6 @@ const resetForm = () => {
|
|||
}
|
||||
|
||||
const changePartnerType = async (val) => {
|
||||
formData.value.partnerCompanyId = ''
|
||||
formData.value.creditCode = ''
|
||||
formData.value.bankName = ''
|
||||
formData.value.bankAccount = ''
|
||||
|
|
@ -930,6 +930,12 @@ const changePartnerType = async (val) => {
|
|||
partnerType: val
|
||||
})
|
||||
orgList.value = org.list
|
||||
|
||||
if (orgList.value.length) {
|
||||
formData.value.partnerCompanyId = orgList.value[0]['id']
|
||||
onPartnerChange(formData.value.partnerCompanyId)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
|
|
|
|||
Loading…
Reference in New Issue