update list item and labelcontroller

This commit is contained in:
Fayyazi
2019-11-03 11:51:36 +03:30
parent 6ece7b720d
commit 2306aca310
2 changed files with 17 additions and 4 deletions
+4 -4
View File
@@ -94,10 +94,10 @@ class LabelController extends Controller
if (auth('api')->user()->cant('delete', $Label)) {
return \MessageResponse::error(trans('messages.access_denied'));
}
if(count($Label->packages))
{
$Label->packages()->detach();
}
// if(count($Label->packages))
// {
// $Label->packages()->detach();
// }
if(count($Label->cycles))
{
$Label->cycles()->detach();
+13
View File
@@ -74,6 +74,10 @@
<v-icon class="white--text mr-2 caption">fas fa-times</v-icon>
<span>Remove</span>
</v-btn>
<v-btn color="orange darken-1" @click="generateBarcode(item.id)">
<v-icon class="white--text mr-1 caption">fas fa-barcode</v-icon>
<span>Generate Barcode</span>
</v-btn>
</td>
</template>
</v-data-table>
@@ -155,6 +159,15 @@ export default {
this.lastPage = result.data.data.last_page;
}
},
async generateBarcode(code) {
const result = await ApiService.post(urls.Barcode(code));
if (result && result.status == 200) {
this.changeCurrentModal({
modal: "modal-barcode-barcode",
properties: { result }
});
}
},
async show(testResultId) {
const result = await ApiService.get(
urls.showItem(testResultId)