fix: add default lead/deal status on lead/deal modal
This commit is contained in:
parent
2d5a59826c
commit
551a95140a
@ -207,7 +207,7 @@ const sections = computed(() => {
|
|||||||
label: 'Status',
|
label: 'Status',
|
||||||
name: 'status',
|
name: 'status',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: statusOptions('deal'),
|
options: dealStatuses.value,
|
||||||
prefix: getDealStatus(deal.status).iconColorClass,
|
prefix: getDealStatus(deal.status).iconColorClass,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -222,6 +222,14 @@ const sections = computed(() => {
|
|||||||
return fields
|
return fields
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const dealStatuses = computed(() => {
|
||||||
|
let statuses = statusOptions('deal')
|
||||||
|
if (!deal.status) {
|
||||||
|
deal.status = statuses[0].value
|
||||||
|
}
|
||||||
|
return statuses
|
||||||
|
})
|
||||||
|
|
||||||
function createDeal() {
|
function createDeal() {
|
||||||
createResource({
|
createResource({
|
||||||
url: 'crm.fcrm.doctype.crm_deal.crm_deal.create_deal',
|
url: 'crm.fcrm.doctype.crm_deal.crm_deal.create_deal',
|
||||||
|
|||||||
@ -158,7 +158,7 @@ const sections = computed(() => {
|
|||||||
label: 'Status',
|
label: 'Status',
|
||||||
name: 'status',
|
name: 'status',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: statusOptions('lead'),
|
options: leadStatuses.value,
|
||||||
prefix: getLeadStatus(lead.status).iconColorClass,
|
prefix: getLeadStatus(lead.status).iconColorClass,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -185,6 +185,14 @@ const createLead = createResource({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const leadStatuses = computed(() => {
|
||||||
|
let statuses = statusOptions('lead')
|
||||||
|
if (!lead.status) {
|
||||||
|
lead.status = statuses[0].value
|
||||||
|
}
|
||||||
|
return statuses
|
||||||
|
})
|
||||||
|
|
||||||
function createNewLead() {
|
function createNewLead() {
|
||||||
createLead.submit(lead, {
|
createLead.submit(lead, {
|
||||||
validate() {
|
validate() {
|
||||||
|
|||||||
@ -97,6 +97,7 @@ export const statusesStore = defineStore('crm-statuses', () => {
|
|||||||
for (const status in statusesByName) {
|
for (const status in statusesByName) {
|
||||||
options.push({
|
options.push({
|
||||||
label: statusesByName[status].name,
|
label: statusesByName[status].name,
|
||||||
|
value: statusesByName[status].name,
|
||||||
icon: () =>
|
icon: () =>
|
||||||
h(IndicatorIcon, {
|
h(IndicatorIcon, {
|
||||||
class: statusesByName[status].iconColorClass,
|
class: statusesByName[status].iconColorClass,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user