|
|
|
|
@ -31,52 +31,38 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- TODO @puhui999:不搞富文本哈;然后加个附件、图片两个 form-item 哈 -->
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="跟进内容" prop="content">
|
|
|
|
|
<Editor v-model="formData.content" height="300px" />
|
|
|
|
|
<el-input v-model="formData.content" :rows="3" type="textarea" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="图片" prop="content">
|
|
|
|
|
<UploadImgs v-model="formData.picUrls" class="min-w-80px" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="附件" prop="content">
|
|
|
|
|
<UploadFile v-model="formData.fileUrls" class="min-w-80px" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- TODO @puhui999:因为不考虑编辑的情况,是不是关联要是个弹窗选择哈? -->
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="关联联系人" prop="contactIds">
|
|
|
|
|
<el-select v-model="formData.contactIds" multiple placeholder="请选择">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in allContactList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-button @click="handleAddContact">
|
|
|
|
|
<Icon class="mr-5px" icon="ep:plus" />
|
|
|
|
|
添加联系人
|
|
|
|
|
</el-button>
|
|
|
|
|
<contact-list v-model:contactIds="formData.contactIds" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="关联联系人" prop="contactIds">-->
|
|
|
|
|
<!-- <el-button @click="handleAddContact">-->
|
|
|
|
|
<!-- <Icon class="mr-5px" icon="ep:plus" />-->
|
|
|
|
|
<!-- 选择添加联系人-->
|
|
|
|
|
<!-- </el-button>-->
|
|
|
|
|
<!-- <contact-list v-model:contactIds="formData.contactIds" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="关联商机" prop="businessIds">
|
|
|
|
|
<el-select v-model="formData.businessIds" multiple placeholder="请选择">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in allBusinessList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-button @click="handleAddBusiness">
|
|
|
|
|
<Icon class="mr-5px" icon="ep:plus" />
|
|
|
|
|
添加商机
|
|
|
|
|
</el-button>
|
|
|
|
|
<business-list v-model:businessIds="formData.businessIds" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="关联商机" prop="businessIds">-->
|
|
|
|
|
<!-- <el-button @click="handleAddBusiness">-->
|
|
|
|
|
<!-- <Icon class="mr-5px" icon="ep:plus" />-->
|
|
|
|
|
<!-- 选择添加商机-->
|
|
|
|
|
<!-- </el-button>-->
|
|
|
|
|
<!-- <business-list v-model:businessIds="formData.businessIds" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
@ -85,13 +71,13 @@
|
|
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</Dialog>
|
|
|
|
|
<ContactTableSelect ref="contactTableSelectRef" v-model="formData.contactIds" />
|
|
|
|
|
<BusinessTableSelect ref="businessTableSelectRef" v-model="formData.businessIds" />
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
|
|
|
import { FollowUpRecordApi, FollowUpRecordVO } from '@/api/crm/followup'
|
|
|
|
|
import { BusinessList, ContactList } from './components'
|
|
|
|
|
import * as ContactApi from '@/api/crm/contact'
|
|
|
|
|
import * as BusinessApi from '@/api/crm/business'
|
|
|
|
|
import { BusinessList, BusinessTableSelect, ContactList, ContactTableSelect } from './components'
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'FollowUpRecordForm' })
|
|
|
|
|
|
|
|
|
|
@ -110,8 +96,6 @@ const formRules = reactive({
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
|
const allContactList = ref<ContactApi.ContactVO[]>([]) // 所有联系人列表
|
|
|
|
|
const allBusinessList = ref<BusinessApi.BusinessVO[]>([]) // 所有商家列表
|
|
|
|
|
|
|
|
|
|
/** 打开弹窗 */
|
|
|
|
|
const open = async (bizType: number, bizId: number, type: string, id?: number) => {
|
|
|
|
|
@ -121,8 +105,6 @@ const open = async (bizType: number, bizId: number, type: string, id?: number) =
|
|
|
|
|
resetForm()
|
|
|
|
|
formData.value.bizType = bizType
|
|
|
|
|
formData.value.bizId = bizId
|
|
|
|
|
allContactList.value = await ContactApi.getSimpleContactList()
|
|
|
|
|
allBusinessList.value = await BusinessApi.getSimpleBusinessList()
|
|
|
|
|
// 修改时,设置数据
|
|
|
|
|
if (id) {
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
@ -159,6 +141,18 @@ const submitForm = async () => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 关联联系人 */
|
|
|
|
|
const contactTableSelectRef = ref<InstanceType<typeof ContactTableSelect>>()
|
|
|
|
|
const handleAddContact = () => {
|
|
|
|
|
contactTableSelectRef.value?.open()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 关联商机 */
|
|
|
|
|
const businessTableSelectRef = ref<InstanceType<typeof BusinessTableSelect>>()
|
|
|
|
|
const handleAddBusiness = () => {
|
|
|
|
|
businessTableSelectRef.value?.open()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 重置表单 */
|
|
|
|
|
const resetForm = () => {
|
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
|
|