mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 20:31:05 +03:30
fix : add logs
This commit is contained in:
Vendored
+1
-1
@@ -4,7 +4,7 @@ const urls = {
|
||||
},
|
||||
showItem: function(id) {
|
||||
// return `/ShowItem/${id}`;
|
||||
return `/show-item/${id}`;
|
||||
return `/api/show-item/${id}`;
|
||||
|
||||
},
|
||||
showPackage: function(id) {
|
||||
|
||||
Vendored
+38
-33
@@ -5,37 +5,42 @@
|
||||
*/
|
||||
export default [
|
||||
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
view: 'Home/Intro',
|
||||
// meta : {
|
||||
// onlyWhenLoggedOut : true
|
||||
// }
|
||||
},
|
||||
{
|
||||
path: '/Show/Item/:item',
|
||||
name: 'ShowItem',
|
||||
view: 'Item/ShowItem'
|
||||
},
|
||||
{
|
||||
path: '/Show/Package/:package',
|
||||
name: 'ShowPackage',
|
||||
view: 'Package/ShowPackage'
|
||||
},
|
||||
{
|
||||
path: '/Show/Label/:label',
|
||||
name: 'ShowLabel',
|
||||
view: 'Label/ShowLabel'
|
||||
},
|
||||
{
|
||||
path: '/Show/Cycle/:cycle',
|
||||
name: 'ShowCycle',
|
||||
view: 'Cycle/ShowCycle'
|
||||
},
|
||||
{
|
||||
path: '/Show/TestResult/:id',
|
||||
name: 'ShowTestResult',
|
||||
view: 'TestResult/ShowTestResult'
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
view: 'Home/Intro',
|
||||
// meta : {
|
||||
// onlyWhenLoggedOut : true
|
||||
// }
|
||||
},
|
||||
{
|
||||
path: '/Show/Item/:item',
|
||||
name: 'ShowItem',
|
||||
view: 'Item/ShowItem',
|
||||
meta: {public: true}
|
||||
},
|
||||
{
|
||||
path: '/Show/Package/:package',
|
||||
name: 'ShowPackage',
|
||||
view: 'Package/ShowPackage',
|
||||
meta: { public: true }
|
||||
},
|
||||
{
|
||||
path: '/Show/Label/:label',
|
||||
name: 'ShowLabel',
|
||||
view: 'Label/ShowLabel',
|
||||
meta: { public: true }
|
||||
},
|
||||
{
|
||||
path: '/Show/Cycle/:cycle',
|
||||
name: 'ShowCycle',
|
||||
view: 'Cycle/ShowCycle',
|
||||
meta: { public: true }
|
||||
},
|
||||
{
|
||||
path: '/Show/TestResult/:id',
|
||||
name: 'ShowTestResult',
|
||||
view: 'TestResult/ShowTestResult',
|
||||
meta: { public: true }
|
||||
},
|
||||
]
|
||||
|
||||
@@ -112,9 +112,12 @@ export default {
|
||||
try {
|
||||
const result = await axios.get(urls.showItem(id));
|
||||
if (result.status == 200) {
|
||||
this.data = result.data.data;
|
||||
this.generateBarcode(this.data.id);
|
||||
this.MedicalCenter = this.data.user.medical_center.name;
|
||||
this.data = result.data.data|{};
|
||||
console.log(result,'result')
|
||||
if(this.data){
|
||||
this.generateBarcode(this.data.id);
|
||||
this.MedicalCenter = this.data.user.medical_center.name;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error loading data:", error);
|
||||
|
||||
@@ -227,8 +227,8 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log(this.$route.params.label,'this.$route.params');
|
||||
if (this.$route.params.label) {
|
||||
console.log(this.$route.params);
|
||||
this.load(this.$route.params.label);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<v-container grid-list-xs>
|
||||
<material-card color="black" title="Show Package">
|
||||
<material-card color="black" title="Show Package">
|
||||
<v-layout id="printMe" align-left justify-left wrap class="px-5 my-3">
|
||||
<h3 class="ml-3 CSSD-font">Package - {{ MedicalCenter }}</h3>
|
||||
<v-flex xs12>
|
||||
@@ -10,25 +10,32 @@
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="WM-d-flex">
|
||||
<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>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="WM-d-flex">
|
||||
<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>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="WM-d-flex">
|
||||
<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>
|
||||
</v-flex>
|
||||
<v-flex xs12 md6 sm6>
|
||||
<div class="WM-d-flex">
|
||||
<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>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
@@ -39,8 +46,8 @@
|
||||
</v-flex>
|
||||
<v-layout row wrap class="ml-4">
|
||||
<v-flex xs12 md6 sm6 v-if="barcodeimg">
|
||||
<img :src="barcodeimg" class="WM-Width-350"><br />
|
||||
<span class="CSSD-font">Package ID : {{data.id}}</span>
|
||||
<img :src="barcodeimg" class="WM-Width-350"><br/>
|
||||
<span class="CSSD-font">Package ID : {{ data.id }}</span>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row wrap class="ml-4">
|
||||
@@ -58,29 +65,29 @@
|
||||
</v-flex>
|
||||
<v-layout row wrap class="ml-4">
|
||||
<template>
|
||||
<v-expansion-panel class="WM-Panel">
|
||||
<v-expansion-panel-content
|
||||
v-for="(item, key) in data.items" :key="key"
|
||||
>
|
||||
<template v-slot:header>
|
||||
<div>{{ key+1 + ": " + item.name }} ({{ item.pivot.count }})</div>
|
||||
</template>
|
||||
<v-card>
|
||||
<v-card-text>note : {{ item.note }}</v-card-text>
|
||||
</v-card>
|
||||
</v-expansion-panel-content>
|
||||
</v-expansion-panel>
|
||||
<v-expansion-panel class="WM-Panel">
|
||||
<v-expansion-panel-content
|
||||
v-for="(item, key) in data.items" :key="key"
|
||||
>
|
||||
<template v-slot:header>
|
||||
<div>{{ key + 1 + ": " + item.name }} ({{ item.pivot.count }})</div>
|
||||
</template>
|
||||
<v-card>
|
||||
<v-card-text>note : {{ item.note }}</v-card-text>
|
||||
</v-card>
|
||||
</v-expansion-panel-content>
|
||||
</v-expansion-panel>
|
||||
</template>
|
||||
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
<v-layout row wrap align-center justify-center style="text-align:center">
|
||||
<v-flex class xs12 md12 sm12 >
|
||||
<v-flex class xs12 md12 sm12>
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black" @click="addPackage()">
|
||||
<v-icon class="black--text">keyboard_arrow_left</v-icon>
|
||||
<span class="black--text">Back</span>
|
||||
</v-btn>
|
||||
<v-btn class="WM-CyanBlueGradient-BG" @click="print" style="padding:10px 60px">
|
||||
<v-btn class="WM-CyanBlueGradient-BG" @click="print" style="padding:10px 60px">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-print</v-icon>
|
||||
<span class="white--text">Print</span>
|
||||
</v-btn>
|
||||
@@ -96,36 +103,40 @@
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import { urls } from "@show/config/urls";
|
||||
import {urls} from "@show/config/urls";
|
||||
|
||||
export default {
|
||||
data: () => ({
|
||||
data : {},
|
||||
barcodeimg : '',
|
||||
QRCodeimg : '',
|
||||
MedicalCenter : ''
|
||||
data: {},
|
||||
barcodeimg: '',
|
||||
QRCodeimg: '',
|
||||
MedicalCenter: ''
|
||||
}),
|
||||
methods: {
|
||||
async load(id) {
|
||||
const result = await axios.get(urls.showPackage(id));
|
||||
const result = await axios.get(urls.showPackage(id));
|
||||
|
||||
if (result.status == 200) {
|
||||
this.data = result.data.data;
|
||||
this.generateBarcode(this.data.id);
|
||||
this.MedicalCenter = this.data.user.medical_center.name;
|
||||
}
|
||||
},
|
||||
if (result.status == 200) {
|
||||
this.data = result.data.data;
|
||||
console.log(result,'result')
|
||||
if (this.data) {
|
||||
this.generateBarcode(this.data.id);
|
||||
this.MedicalCenter = this.data.user.medical_center.name;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
async generateBarcode(packageId) {
|
||||
const result = await axios.post(urls.Barcode(packageId, 'Package'));
|
||||
if (result && result.status == 200) {
|
||||
this.QRCodeimg = result.data.data.QRCode ? result.data.data.QRCode : null;
|
||||
this.barcodeimg = result.data.data.Barcode ? result.data.data.Barcode : null;
|
||||
this.QRCodeimg = result.data.data.QRCode ? result.data.data.QRCode : null;
|
||||
this.barcodeimg = result.data.data.Barcode ? result.data.data.Barcode : null;
|
||||
}
|
||||
},
|
||||
editPackage(packageId){
|
||||
window.location.href = '/packages/'+packageId+'/edit';
|
||||
editPackage(packageId) {
|
||||
window.location.href = '/packages/' + packageId + '/edit';
|
||||
},
|
||||
addPackage(){
|
||||
addPackage() {
|
||||
window.location.href = '/add-package';
|
||||
},
|
||||
print() {
|
||||
@@ -163,10 +174,9 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log('------------------',this.$route.params,'------------------')
|
||||
if (this.$route.params.package) {
|
||||
this.load(this.$route.params.package);
|
||||
}
|
||||
this.load(this.$route.params.package);
|
||||
}
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user