fix : add logs

This commit is contained in:
zeinab.ashrafi
2025-04-09 09:52:44 +03:30
parent 4f25abbf36
commit 24aa9fb7f2
5 changed files with 97 additions and 79 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ const urls = {
}, },
showItem: function(id) { showItem: function(id) {
// return `/ShowItem/${id}`; // return `/ShowItem/${id}`;
return `/show-item/${id}`; return `/api/show-item/${id}`;
}, },
showPackage: function(id) { showPackage: function(id) {
+10 -5
View File
@@ -16,26 +16,31 @@ export default [
{ {
path: '/Show/Item/:item', path: '/Show/Item/:item',
name: 'ShowItem', name: 'ShowItem',
view: 'Item/ShowItem' view: 'Item/ShowItem',
meta: {public: true}
}, },
{ {
path: '/Show/Package/:package', path: '/Show/Package/:package',
name: 'ShowPackage', name: 'ShowPackage',
view: 'Package/ShowPackage' view: 'Package/ShowPackage',
meta: { public: true }
}, },
{ {
path: '/Show/Label/:label', path: '/Show/Label/:label',
name: 'ShowLabel', name: 'ShowLabel',
view: 'Label/ShowLabel' view: 'Label/ShowLabel',
meta: { public: true }
}, },
{ {
path: '/Show/Cycle/:cycle', path: '/Show/Cycle/:cycle',
name: 'ShowCycle', name: 'ShowCycle',
view: 'Cycle/ShowCycle' view: 'Cycle/ShowCycle',
meta: { public: true }
}, },
{ {
path: '/Show/TestResult/:id', path: '/Show/TestResult/:id',
name: 'ShowTestResult', name: 'ShowTestResult',
view: 'TestResult/ShowTestResult' view: 'TestResult/ShowTestResult',
meta: { public: true }
}, },
] ]
+4 -1
View File
@@ -112,10 +112,13 @@ export default {
try { try {
const result = await axios.get(urls.showItem(id)); const result = await axios.get(urls.showItem(id));
if (result.status == 200) { if (result.status == 200) {
this.data = result.data.data; this.data = result.data.data|{};
console.log(result,'result')
if(this.data){
this.generateBarcode(this.data.id); this.generateBarcode(this.data.id);
this.MedicalCenter = this.data.user.medical_center.name; this.MedicalCenter = this.data.user.medical_center.name;
} }
}
} catch (error) { } catch (error) {
console.error("Error loading data:", error); console.error("Error loading data:", error);
} }
+1 -1
View File
@@ -227,8 +227,8 @@ export default {
} }
}, },
created() { created() {
console.log(this.$route.params.label,'this.$route.params');
if (this.$route.params.label) { if (this.$route.params.label) {
console.log(this.$route.params);
this.load(this.$route.params.label); this.load(this.$route.params.label);
} }
}, },
@@ -10,25 +10,32 @@
<v-flex xs12 md6 sm6> <v-flex xs12 md6 sm6>
<div class="WM-d-flex"> <div class="WM-d-flex">
<v-icon class="WMi-info"></v-icon> <v-icon class="WMi-info"></v-icon>
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">{{ data.name }}</span> <span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">{{
data.name
}}</span>
</div> </div>
</v-flex> </v-flex>
<v-flex xs12 md6 sm6> <v-flex xs12 md6 sm6>
<div class="WM-d-flex"> <div class="WM-d-flex">
<v-icon class="WMi-Industry"></v-icon> <v-icon class="WMi-Industry"></v-icon>
<span class="headline ml-2 CSSD-font" style="letter-spacing:0 !important">{{ data.created_at }}</span> <span class="headline ml-2 CSSD-font" style="letter-spacing:0 !important">{{
data.created_at
}}</span>
</div> </div>
</v-flex> </v-flex>
<v-flex xs12 md6 sm6> <v-flex xs12 md6 sm6>
<div class="WM-d-flex"> <div class="WM-d-flex">
<v-icon class="WMi-user"></v-icon> <v-icon class="WMi-user"></v-icon>
<span class="headline ml-2 CSSD-font" style="letter-spacing:0 !important">{{ data.user ? data.user.name : '' }}</span> <span class="headline ml-2 CSSD-font"
style="letter-spacing:0 !important">{{ data.user ? data.user.name : '' }}</span>
</div> </div>
</v-flex> </v-flex>
<v-flex xs12 md6 sm6> <v-flex xs12 md6 sm6>
<div class="WM-d-flex"> <div class="WM-d-flex">
<v-icon class="WMi-pencil"></v-icon> <v-icon class="WMi-pencil"></v-icon>
<span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">{{ data.note }}</span> <span class="headline ml-1 CSSD-font" style="letter-spacing:0 !important">{{
data.note
}}</span>
</div> </div>
</v-flex> </v-flex>
</v-layout> </v-layout>
@@ -97,6 +104,7 @@
<script> <script>
import axios from "axios"; import axios from "axios";
import {urls} from "@show/config/urls"; import {urls} from "@show/config/urls";
export default { export default {
data: () => ({ data: () => ({
data: {}, data: {},
@@ -110,9 +118,12 @@ export default {
if (result.status == 200) { if (result.status == 200) {
this.data = result.data.data; this.data = result.data.data;
console.log(result,'result')
if (this.data) {
this.generateBarcode(this.data.id); this.generateBarcode(this.data.id);
this.MedicalCenter = this.data.user.medical_center.name; this.MedicalCenter = this.data.user.medical_center.name;
} }
}
}, },
async generateBarcode(packageId) { async generateBarcode(packageId) {
@@ -163,7 +174,6 @@ export default {
} }
}, },
created() { created() {
console.log('------------------',this.$route.params,'------------------')
if (this.$route.params.package) { if (this.$route.params.package) {
this.load(this.$route.params.package); this.load(this.$route.params.package);
} }