客户联系人与公海增加发短信 发邮件

This commit is contained in:
hupeng 2024-11-18 10:24:31 +08:00
parent ab046829b2
commit 2634610ac7
2 changed files with 79 additions and 8 deletions

View File

@ -74,21 +74,30 @@
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <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> <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<!-- <el-button <el-button
type="primary" type="warning"
plain plain
@click="openForm('create')" @click="openSms"
v-hasPermi="['crm:customer-contacts:create']" :disabled = "isDisabled"
> >
<Icon icon="ep:delete" class="mr-5px" /> 回收站 <Icon icon="ep:notification" class="mr-5px" /> 发短信
</el-button> --> </el-button>
<el-button
type="danger"
plain
@click="openMail"
:disabled = "isDisabled"
>
<Icon icon="ep:message" class="mr-5px" /> 发邮件
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<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" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="40" />
<el-table-column label="客户名称" align="center" prop="customerName" width="150" /> <el-table-column label="客户名称" align="center" prop="customerName" width="150" />
<el-table-column label="姓名" align="center" prop="name" width="150" /> <el-table-column label="姓名" align="center" prop="name" width="150" />
<el-table-column label="手机" align="center" prop="mobile" width="120" /> <el-table-column label="手机" align="center" prop="mobile" width="120" />
@ -160,6 +169,8 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<CustomerContactsForm ref="formRef" @success="getList" /> <CustomerContactsForm ref="formRef" @success="getList" />
<SmsTemplateSendForm ref="smsTemplateSendFormRef" />
<MailTemplateSendForm ref="mailTemplateSendFormRef" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -167,6 +178,8 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import { CustomerContactsApi, CustomerContactsVO } from '@/api/crm/crmcustomercontacts' import { CustomerContactsApi, CustomerContactsVO } from '@/api/crm/crmcustomercontacts'
import CustomerContactsForm from './CustomerContactsForm.vue' import CustomerContactsForm from './CustomerContactsForm.vue'
import SmsTemplateSendForm from '@/views/components/sms/SmsTemplateSendForm.vue'
import MailTemplateSendForm from '@/views/components/email/MailTemplateSendForm.vue'
/** 联系人 列表 */ /** 联系人 列表 */
defineOptions({ name: 'CrmCustomerContacts' }) defineOptions({ name: 'CrmCustomerContacts' })
@ -194,6 +207,8 @@ const queryParams = reactive({
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // const exportLoading = ref(false) //
const activeIndex = ref('my') const activeIndex = ref('my')
const selectCustomers = ref([])
const isDisabled = ref(true)
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
@ -207,6 +222,13 @@ const getList = async () => {
} }
} }
const handleSelectionChange = (val) => {
if(val.length > 0) {
isDisabled.value = false
}
selectCustomers.value = val
}
const handleSelect = (key) => { const handleSelect = (key) => {
queryParams.relation = key queryParams.relation = key
getList() getList()
@ -258,6 +280,17 @@ const handleExport = async () => {
} }
} }
const smsTemplateSendFormRef = ref()
const openSms = () => {
smsTemplateSendFormRef.value.open(selectCustomers.value,false)
}
const mailTemplateSendFormRef = ref()
const openMail = () => {
mailTemplateSendFormRef.value.open(selectCustomers.value,false)
}
/** 初始化 **/ /** 初始化 **/
onMounted(() => { onMounted(() => {
getList() getList()

View File

@ -98,13 +98,28 @@
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <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> <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
plain
@click="openSms"
:disabled = "isDisabled"
>
<Icon icon="ep:notification" class="mr-5px" /> 发短信
</el-button>
<el-button
plain
@click="openMail"
:disabled = "isDisabled"
>
<Icon icon="ep:message" class="mr-5px" /> 发邮件
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<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" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="40" />
<el-table-column label="ID" align="center" prop="id" /> <el-table-column label="ID" align="center" prop="id" />
<el-table-column label="客户名称" align="center" prop="name" width="200" /> <el-table-column label="客户名称" align="center" prop="name" width="200" />
<el-table-column label="手机" align="center" prop="mobile" width="120" /> <el-table-column label="手机" align="center" prop="mobile" width="120" />
@ -183,6 +198,9 @@
/> />
</ContentWrap> </ContentWrap>
<SmsTemplateSendForm ref="smsTemplateSendFormRef" />
<MailTemplateSendForm ref="mailTemplateSendFormRef" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -190,6 +208,8 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import { CustomerApi, CustomerVO } from '@/api/crm/crmcustomer' import { CustomerApi, CustomerVO } from '@/api/crm/crmcustomer'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import SmsTemplateSendForm from '@/views/components/sms/SmsTemplateSendForm.vue'
import MailTemplateSendForm from '@/views/components/email/MailTemplateSendForm.vue'
/** 客户 列表 */ /** 客户 列表 */
@ -220,6 +240,8 @@ const queryParams = reactive({
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // const exportLoading = ref(false) //
const selectCustomers = ref([])
const isDisabled = ref(true)
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
@ -250,6 +272,22 @@ const resetQuery = () => {
handleQuery() handleQuery()
} }
const handleSelectionChange = (val) => {
if(val.length > 0) {
isDisabled.value = false
}
selectCustomers.value = val
}
const smsTemplateSendFormRef = ref()
const openSms = () => {
smsTemplateSendFormRef.value.open(selectCustomers.value,true)
}
const mailTemplateSendFormRef = ref()
const openMail = () => {
mailTemplateSendFormRef.value.open(selectCustomers.value,true)
}
const handleReceive = async (id: number) => { const handleReceive = async (id: number) => {