1
0
forked from test/crm

feat: allow manually create call logs

This commit is contained in:
Shariq Ansari 2025-01-22 18:11:53 +05:30
parent ae41e50a4c
commit edab3ed65d
3 changed files with 22 additions and 10 deletions

View File

@ -47,8 +47,7 @@
"fieldname": "status",
"fieldtype": "Select",
"label": "Status",
"options": "Initiated\nRinging\nIn Progress\nCompleted\nFailed\nBusy\nNo Answer\nQueued\nCanceled",
"read_only": 1
"options": "Initiated\nRinging\nIn Progress\nCompleted\nFailed\nBusy\nNo Answer\nQueued\nCanceled"
},
{
"fieldname": "start_time",
@ -83,8 +82,7 @@
"fieldname": "duration",
"fieldtype": "Duration",
"in_list_view": 1,
"label": "Duration",
"read_only": 1
"label": "Duration"
},
{
"fieldname": "recording_url",
@ -145,7 +143,8 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Telephony Medium",
"options": "\nManual\nTwilio\nExotel"
"options": "\nManual\nTwilio\nExotel",
"read_only": 1
},
{
"fieldname": "section_break_gyqe",
@ -154,7 +153,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-01-17 21:46:01.558377",
"modified": "2025-01-22 17:57:59.289548",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Call Log",

View File

@ -58,6 +58,7 @@ import FieldLayout from '@/components/FieldLayout/FieldLayout.vue'
import EditIcon from '@/components/Icons/EditIcon.vue'
import { usersStore } from '@/stores/users'
import { isMobileView } from '@/composables/settings'
import { getRandom } from '@/utils'
import { capture } from '@/telemetry'
import { FeatherIcon, createResource, ErrorMessage } from 'frappe-ui'
import { ref, nextTick, watch, computed } from 'vue'
@ -92,7 +93,7 @@ let _callLog = ref({
receiver: '',
status: '',
recording_url: '',
telephony_medium: '',
telephony_medium: 'Manual',
})
const dialogOptions = computed(() => {
@ -159,6 +160,8 @@ const createCallLog = createResource({
return {
doc: {
doctype: 'CRM Call Log',
id: getRandom(6),
telephony_medium: 'Manual',
..._callLog.value,
},
}

View File

@ -8,6 +8,9 @@
v-if="callLogsListView?.customListActions"
:actions="callLogsListView.customListActions"
/>
<Button variant="solid" :label="__('Create')" @click="createCallLog">
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
</Button>
</template>
</LayoutHeader>
<ViewControls
@ -55,7 +58,11 @@
v-model:callLogModal="showCallLogModal"
v-model:callLog="callLog"
/>
<CallLogModal v-model="showCallLogModal" v-model:callLog="callLog" />
<CallLogModal
v-model="showCallLogModal"
v-model:callLog="callLog"
:options="{ afterInsert: () => callLogs.reload() }"
/>
</template>
<script setup>
@ -97,11 +104,9 @@ const rows = computed(() => {
})
const showCallLogDetailModal = ref(false)
const selectedCallLog = ref(null)
const callLog = ref({})
function showCallLog(name) {
selectedCallLog.value = name
showCallLogDetailModal.value = true
callLog.value = createResource({
url: 'crm.fcrm.doctype.crm_call_log.crm_call_log.get_call_log',
@ -110,4 +115,9 @@ function showCallLog(name) {
auto: true,
})
}
function createCallLog() {
callLog.value = {}
showCallLogModal.value = true
}
</script>