|
@@ -1,22 +1,13 @@
|
|
|
<?php
|
|
|
-/** @var \App\Models\Pro $sectionPro */
|
|
|
-/** @var \App\Models\Pro $pro */
|
|
|
-/** @var \App\Models\Note $note */
|
|
|
|
|
|
-if(!@$sectionPro) {
|
|
|
- if(@$note) {
|
|
|
- $sectionPro = $note->hcpPro;
|
|
|
- }
|
|
|
- else {
|
|
|
- $sectionPro = $pro; // should never get here
|
|
|
- }
|
|
|
-}
|
|
|
+// $contentData is already pro-scoped by this point!
|
|
|
|
|
|
if(!$contentData) $contentData = [];
|
|
|
-if( !isset($contentData[$sectionPro->uid]) ||
|
|
|
- !isset($contentData[$sectionPro->uid]['current_cch']) ||
|
|
|
- !count($contentData[$sectionPro->uid]['current_cch']['list'])) {
|
|
|
- $contentData[$sectionPro->uid] = [
|
|
|
+if( !isset($contentData) ||
|
|
|
+ !isset($contentData['current_cch']) ||
|
|
|
+ !isset($contentData['current_cch']['list']) ||
|
|
|
+ !count($contentData['current_cch']['list'])) {
|
|
|
+ $contentData = [
|
|
|
"current_cch" => [
|
|
|
"list" => [
|
|
|
[
|
|
@@ -62,11 +53,11 @@ $formID = rand(0, 100000);
|
|
|
<th class="px-2 text-secondary border-bottom-0">Title</th>
|
|
|
<th class="px-2 text-secondary border-bottom-0">ICD</th>
|
|
|
<th class="px-2 text-secondary border-bottom-0 w-35">Memo</th>
|
|
|
- <th v-if="data['{{$sectionPro->uid}}']['current_cch']['list'].length > 1" class="px-2 text-secondary border-bottom-0"></th>
|
|
|
+ <th v-if="data['current_cch']['list'].length > 1" class="px-2 text-secondary border-bottom-0"></th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
- <tr v-for="(item, index) in data['{{$sectionPro->uid}}']['current_cch']['list']">
|
|
|
+ <tr v-for="(item, index) in data['current_cch']['list']">
|
|
|
<td class="px-2 pt-2 text-center text-sm font-weight-bold">@{{ index + 1 }}</td>
|
|
|
<td>
|
|
|
<select class="form-control form-control-sm" v-model="item.category" required>
|
|
@@ -91,7 +82,7 @@ $formID = rand(0, 100000);
|
|
|
class="form-control form-control-sm"
|
|
|
v-model="item.memo">
|
|
|
</td>
|
|
|
- <td v-if="data['{{$sectionPro->uid}}']['current_cch']['list'].length > 1" class="px-2 text-nowrap">
|
|
|
+ <td v-if="data['current_cch']['list'].length > 1" class="px-2 text-nowrap">
|
|
|
<a href="#" v-on:click.prevent="removeItem(index)"
|
|
|
class="on-hover-opaque text-danger mt-1 d-inline-block">
|
|
|
<i class="fa fa-trash-alt"></i>
|
|
@@ -111,7 +102,7 @@ $formID = rand(0, 100000);
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
- <tr v-for="(item, index) in data['{{$sectionPro->uid}}']['current_cch']['list']">
|
|
|
+ <tr v-for="(item, index) in data['current_cch']['list']">
|
|
|
<td class="align-middle px-2">
|
|
|
@{{ item.category }}@{{ item.name ? ' / ' + item.name : '' }}@{{ item.icd ? ' / ' + item.icd : '' }}
|
|
|
</td>
|
|
@@ -147,7 +138,7 @@ $formID = rand(0, 100000);
|
|
|
},
|
|
|
methods: {
|
|
|
addItem: function() {
|
|
|
- this.data['{{$sectionPro->uid}}']['current_cch']['list'].push({
|
|
|
+ this.data['current_cch']['list'].push({
|
|
|
"category": '',
|
|
|
"name": '',
|
|
|
"icd": '',
|
|
@@ -158,7 +149,7 @@ $formID = rand(0, 100000);
|
|
|
});
|
|
|
},
|
|
|
removeItem: function(_index) {
|
|
|
- this.data['{{$sectionPro->uid}}']['current_cch']['list'].splice(_index, 1);
|
|
|
+ this.data['current_cch']['list'].splice(_index, 1);
|
|
|
},
|
|
|
cleanArray: function(_source) {
|
|
|
let plItems = [], plObject = {};
|