diff --git a/app/Modules/Bitrix/Models/SendDeal.php b/app/Modules/Bitrix/Models/SendDeal.php index 2628b47..f3328cc 100644 --- a/app/Modules/Bitrix/Models/SendDeal.php +++ b/app/Modules/Bitrix/Models/SendDeal.php @@ -13,5 +13,8 @@ class SendDeal extends BitrixSender public function __construct(Deal $deal) { $this->addDataItem('complexName', $deal->complex->name); + if ($plan7Data = $deal->getPlan7Data()) { + $this->addDataItem('plan7', $plan7Data); + } } } diff --git a/app/Modules/ClientCreateForm/Http/Livewire/ClientCreateLivewire.php b/app/Modules/ClientCreateForm/Http/Livewire/ClientCreateLivewire.php index 5776345..a80aa5f 100644 --- a/app/Modules/ClientCreateForm/Http/Livewire/ClientCreateLivewire.php +++ b/app/Modules/ClientCreateForm/Http/Livewire/ClientCreateLivewire.php @@ -6,10 +6,13 @@ use Laravel\Prompts\FormStep; use Livewire\Component; use Livewire\Attributes\Validate; +use Livewire\Attributes\On; + use Modules\Main\Models\Deal\Deal; use Modules\Main\Models\Deal\Client; use Modules\Main\Models\Deal\DealClients; +use Modules\Plan7\Models\DealPlan7; class ClientCreateLivewire extends Component { @@ -23,6 +26,8 @@ class ClientCreateLivewire extends Component public $agentId; public $contacts; public $complexId; + public $plan7Room = false; + //////////////////// public $currentContactIndex; public $contactLabels; public $bitrixId; @@ -180,6 +185,10 @@ public function updated($propertyName) $this->status = FormStatus::IN_PROCESS; } } + #[On('plan7_selector_set_room')] + public function setPlan7Room($room) { + $this->plan7Room = $room; + } public function render() { return view( @@ -205,13 +214,17 @@ public function save() if ( !$deal = Deal::create([ 'agent_id' => $this->agentId, - 'complex_id' => $this->complexId + 'complex_id' => $this->complexId, ]) ) { $this->status = FormStatus::ERROR; return; } + + if ($this->plan7Room) { + $deal->setPlan7Data($this->plan7Room['id'], $this->plan7Room); + } foreach ($this->contacts as $contact) { diff --git a/app/Modules/ClientCreateForm/Views/livewire/form.blade.php b/app/Modules/ClientCreateForm/Views/livewire/form.blade.php index a2094d2..8416eeb 100644 --- a/app/Modules/ClientCreateForm/Views/livewire/form.blade.php +++ b/app/Modules/ClientCreateForm/Views/livewire/form.blade.php @@ -174,7 +174,6 @@ class="bi bi-plus-circle" viewBox="0 0 16 16"> @endif @if (count($availableAgents) > 1) -
+
@if($room) diff --git a/resources/fonts/TikTokSans.ttf b/resources/fonts/TikTokSans.ttf new file mode 100644 index 0000000..59a531a Binary files /dev/null and b/resources/fonts/TikTokSans.ttf differ diff --git a/resources/woff/bootstrap-icons.woff2 b/resources/woff/bootstrap-icons.woff2 new file mode 100644 index 0000000..92c4830 Binary files /dev/null and b/resources/woff/bootstrap-icons.woff2 differ diff --git a/vite.config.js b/vite.config.js index 5e0c33e..973012b 100644 --- a/vite.config.js +++ b/vite.config.js @@ -15,7 +15,9 @@ export default defineConfig({ 'resources/css/docs.css', 'resources/css/multiselect.css', 'resources/js/phone-format.js', - 'resources/js/trix.umd.min.js' + 'resources/js/trix.umd.min.js', + 'resources/fonts/TikTokSans.ttf', + 'resources/woff/bootstrap-icons.woff2', ], refresh: true, }),