fix: items & style

This commit is contained in:
zeinab.ashrafi
2025-03-29 14:52:44 +03:30
parent c872feb468
commit 0fcb9a3b2f
6 changed files with 160 additions and 204 deletions
+107 -126
View File
@@ -3,114 +3,90 @@
<v-container grid-list-xs fluid>
<material-card color="black" title="Add Cycle">
<v-layout wrap class="px-5 my-3">
<v-flex xs12 sm6 md4 class="WM-FlexCenter pl-3">
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"></v-icon>
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"/>
<v-text-field
name="sterilizer_id"
label="Sterilizer ID"
color="black"
v-model="formData.sterilizer_id"
class="py-3 pr-3"
></v-text-field>
name="sterilizer_id"
label="Sterilizer ID"
color="black"
v-model="formData.sterilizer_id"
class="py-3 pr-3"/>
</v-flex>
<v-flex xs12 sm6 md4 class="WM-FlexCenter pl-3">
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"></v-icon>
<v-icon class="fas fa-sort-numeric-up mr-2 WM-Margin-B-8"/>
<v-text-field
name="cycle_number"
label="Cycle Number"
color="black"
v-model="formData.cycle_number"
class="py-3 pr-3"
></v-text-field>
name="cycle_number"
label="Cycle Number"
color="black"
v-model="formData.cycle_number"
class="py-3 pr-3"/>
</v-flex>
<v-flex xs12 sm6 md4 class="WM-FlexCenter">
<v-icon class="far fa-calendar-alt mr-2"></v-icon>
<v-menu
lazy
:close-on-content-click="true"
transition="v-scale-transition"
offset-y
v-model="fromMenuDate"
>
<v-text-field
required
slot="activator"
label="Date"
color="black"
class="pr-3"
v-model="formData.date">
</v-text-field>
<v-date-picker
color="pink"
no-title
v-model="formData.date"
:date-format="date => new Date(date).toDateString()"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs12></v-flex>
<v-flex xs12 sm6 md4 class="WM-FlexCenter WM-DuplicateInput" style="position: relative" v-for="(label, key) in formData.labels" :key="key">
<div class="Inner">
<v-icon class="fa fa-check mr-2 WM-Margin-B-8"></v-icon>
<v-autocomplete
color="black"
:items="labels"
item-text="id"
item-value="id"
v-model="label.id"
label="Select Label For Cycle"
></v-autocomplete>
<!-- <v-text-field
name="labels"
label="Label ID"
color="black"
v-model="label.id"
class="py-3 pr-3"
></v-text-field> -->
<v-btn
absolute
small
right
bottom
color="cyan"
@click="duplicateForm(key)"
>
<v-icon class="white--text mr-2 caption">fas fa-plus</v-icon>ADD
</v-btn>
<v-btn v-if="key > 0"
absolute
small
right
top
color="pink"
@click="removeForm(key)"
>
<v-icon class="white--text mr-2 caption">fas fa-remove</v-icon>REMOVE
</v-btn>
</div>
<v-icon class="far fa-calendar-alt mr-2"/>
<v-menu
lazy
:close-on-content-click="true"
transition="v-scale-transition"
offset-y
v-model="fromMenuDate">
<v-text-field required
slot="activator"
label="Date"
color="black"
class="pr-3"
v-model="formData.date"/>
<v-date-picker
color="pink"
no-title
v-model="formData.date"
:date-format="date => new Date(date).toDateString()"/>
</v-menu>
</v-flex>
<v-spacer></v-spacer>
<v-flex xs12></v-flex>
<v-flex xs12 sm6 md4 class="WM-FlexCenter WM-DuplicateInput" style="position: relative"
v-for="(label, key) in formData.labels" :key="key">
<div class="Inner">
<v-icon class="fa fa-check mr-2 WM-Margin-B-8"></v-icon>
<v-autocomplete
color="black"
:items="labels"
item-text="id"
item-value="id"
v-model="label.id"
label="Select Label For Cycle"/>
<!-- <v-text-field
name="labels"
label="Label ID"
color="black"
v-model="label.id"
class="py-3 pr-3" />-->
<v-btn absolute small right bottom color="cyan" @click="duplicateForm(key)">
<v-icon class="white--text mr-2 caption">fas fa-plus</v-icon>
ADD
</v-btn>
<v-btn v-if="key > 0" absolute small right top color="pink" @click="removeForm(key)">
<v-icon class="white--text mr-2 caption">fas fa-remove</v-icon>
REMOVE
</v-btn>
</div>
</v-flex>
<v-spacer/>
<v-flex xs12>
<hr class="v-divider theme--light" style="margin:30px 0 0 0 !important">
</v-flex>
<v-flex xs12 sm12 md12 class="WM-FlexCenter">
<!-- <v-icon class="fa fa-sort-amount-desc mr-2"></v-icon> -->
<v-textarea color="black" v-model="formData.note" class="py-3 pr-3" name="address">
<template v-slot:label>
<div>Description</div>
</template>
</v-textarea>
</v-flex>
<!-- <v-icon class="fa fa-sort-amount-desc mr-2"></v-icon> -->
<v-textarea color="black" v-model="formData.note" class="py-3 pr-3" name="address">
<template v-slot:label>
<div>Description</div>
</template>
</v-textarea>
</v-flex>
</v-layout>
<v-layout row wrap justify-center align-center>
<v-flex xs12 md2 sm2 class="text-md-center text-xs-center">
<v-btn
class="WM-CyanBlueGradient-BG"
style="padding:10px 60px"
@click="submitForm()"
>
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px" @click="submitForm()">
<v-icon class="white--text mr-2 caption">fas fa-check</v-icon>
<span class="white--text">SAVE</span>
</v-btn>
@@ -130,9 +106,10 @@
</template>
<script>
import { ApiService } from "@/services";
import { urls } from "@/config/urls";
import { mapMutations } from "vuex";
import {ApiService} from "@/services";
import {urls} from "@/config/urls";
import {mapMutations} from "vuex";
export default {
data() {
return {
@@ -140,19 +117,19 @@ export default {
formData: {
note: "",
labels: [
{
name:''
}
]
{
name: ''
}
]
},
labels: [],
rules: {
required: value => !!value || "Required.",
counter: value =>
!value ||
value.length == 0 ||
value.length >= 5 ||
"Min 5 characters"
!value ||
value.length == 0 ||
value.length >= 5 ||
"Min 5 characters"
}
};
},
@@ -165,13 +142,13 @@ export default {
methods: {
async load(id) {
const result = await ApiService.get(urls.editCycle(id));
if (result.status == 200) {
if (result && result.status == 200) {
this.formData = result.data.data;
}
},
async loadLabels() {
const result = await ApiService.get(urls.listAllLabel());
if (result.status == 200) {
if (result && result.status == 200) {
this.labels = result.data.data;
}
},
@@ -179,49 +156,53 @@ export default {
let result;
if (this.$route.params.cycle) {
result = await ApiService.put(
urls.updateCycle(this.$route.params.cycle),
this.formData
urls.updateCycle(this.$route.params.cycle),
this.formData
);
} else {
result = await ApiService.post(
urls.storeCycle,
this.formData
urls.storeCycle,
this.formData
);
}
if (result && result.status == 200) {
this.$router.push({ name: "AllCycle" });
this.$router.push({name: "AllCycle"});
}
},
duplicateForm(infoIndex) {
this.formData.labels.push({
name: "",
});
this.formData.labels.push({
name: "",
});
},
removeForm(infoIndex) {
this.formData.labels.splice(infoIndex, 1);
},
},
removeForm(infoIndex) {
this.formData.labels.splice(infoIndex, 1);
},
}
};
</script>
<style>
.v-btn--floating {
padding: 0!important;
padding: 0 !important;
}
.theme--light.v-btn.v-btn--flat {
color: rgba(0,0,0,.87)!important;
color: rgba(0, 0, 0, .87) !important;
}
.v-btn--floating, .v-btn--icon:before {
border-radius: 50%!important;
border-radius: 50% !important;
}
.WM-DuplicateInput {
margin: 15px 0;
margin: 15px 0;
}
.WM-DuplicateInput .Inner {
padding: 15px 20px !important;
margin: 0 10px 0 0;
width: 100%;
border: 1px solid rgba(0,0,0,.2);
padding: 15px 20px !important;
margin: 0 10px 0 0;
width: 100%;
border: 1px solid rgba(0, 0, 0, .2);
}
</style>
+9 -7
View File
@@ -13,7 +13,6 @@
</router-link>
</v-flex>
</template>
</v-layout>
</material-card>
@@ -31,7 +30,6 @@
</router-link>
</v-flex>
</template>
</v-layout>
</material-card>
@@ -47,7 +45,6 @@
</router-link>
</v-flex>
</template>
</v-layout>
</material-card>
@@ -144,6 +141,7 @@ export default {
{
title: `<span>Add A </span><br/><span>Test Result</span>`,
icon: 'fas fa-plus',
// image:'https://cdn.willaspace.com/cssd/static/image/svg/Plus-white.svg',
color: 'black text-white',
route: {name: 'SubmitTestResult'},
aligntext: 'text-md-left',
@@ -176,7 +174,8 @@ export default {
{
title: `<span>Add new </span><br/><span>item</span>`,
icon: 'fas fa-plus',
color: 'blue text-white',
// image:'https://cdn.willaspace.com/cssd/static/image/svg/Plus-white.svg',
color: 'WM-CyanGradient-BG text-white',
route: {name: 'AddItem'},
aligntext: 'text-md-left',
alignimg: 'text-md-left',
@@ -208,7 +207,8 @@ export default {
{
title: `<span>Add new </span><br/><span>Package</span>`,
icon: 'fas fa-plus',
color: 'cyan text-white',
// image:'https://cdn.willaspace.com/cssd/static/image/svg/Plus-white.svg',
color: 'WM-DeepBlueGradient-BG text-white',
route: {name: 'AddPackage'},
aligntext: 'text-md-left',
alignimg: 'text-md-left',
@@ -230,7 +230,8 @@ export default {
{
title: `<span>Add new </span><br/><span> label</span>`,
icon: 'fas fa-plus',
color: 'purple text-white',
// image:'https://cdn.willaspace.com/cssd/static/image/svg/Plus-white.svg',
color: 'WM-PurpleGradient-BG text-white',
route: {name: 'AddLabel'},
aligntext: 'text-md-left',
alignimg: 'text-md-left',
@@ -252,7 +253,8 @@ export default {
{
title: `<span>Add new </span><br/><span>cycle</span>`,
icon: 'fas fa-plus',
color: 'red text-white',
// image:'https://cdn.willaspace.com/cssd/static/image/svg/Plus-white.svg',
color: 'WM-RedGradient-BG text-white',
route: {name: 'AddCycle'},
aligntext: 'text-md-left',
alignimg: 'text-md-left',
+9 -47
View File
@@ -155,52 +155,15 @@ import toast from "@/services/global/toast.service";
export default {
data: () => ({
headers: [
// {
// sortable: true,
// text: "ID",
// value: "id"
// },
{
sortable: true,
text: "Item ID",
value: "id"
},
{
sortable: false,
text: "Name",
value: "name"
},
{
sortable: true,
text: "Owner",
value: "User"
},
{
sortable: true,
text: "Hospital",
value: "Hospital"
},
{
sortable: false,
text: "UDI",
value: "udi"
},
{
sortable: false,
text: "Size",
value: "size"
},
{
sortable: false,
text: "Status",
value: "status"
},
{
sortable: false,
text: "Action",
value: "action",
align: "left"
}
// {sortable: true,text: "ID",value: "id"},
{sortable: false, text: "Item ID", value: "id"},
{sortable: false, text: "Name", value: "name"},
{sortable: false, text: "Owner", value: "User"},
{sortable: false, text: "Hospital", value: "Hospital"},
{sortable: false, text: "UDI", value: "udi"},
{sortable: false, text: "Size", value: "size"},
{sortable: false, text: "Status", value: "status"},
{sortable: false, text: "Action", value: "action", align: "left"}
],
filter: {
name: '',
@@ -296,7 +259,6 @@ export default {
}
}
},
async loadMedicalCenters() {
const result = await ApiService.get(urls.listFilterItemsTestResult);
if (result && result.status == 200) {
+4 -10
View File
@@ -129,13 +129,13 @@ export default {
},
async load(id) {
const result = await ApiService.get(urls.editLabel(id));
if (result.status == 200) {
if (result && result.status == 200) {
this.formData = result.data.data;
}
},
async loadItems() {
const result = await ApiService.get(urls.listAllPackage());
if (result.status == 200) {
if (result && result.status == 200) {
this.items = result.data.data;
}
},
@@ -143,15 +143,9 @@ export default {
let result;
this.formData['lot_number'] = this.lotNumber;
if (this.$route.params.label) {
result = await ApiService.put(
urls.updateLabel(this.$route.params.label),
this.formData
);
result = await ApiService.put(urls.updateLabel(this.$route.params.label), this.formData);
} else {
result = await ApiService.post(
urls.storeLabel,
this.formData
);
result = await ApiService.post(urls.storeLabel, this.formData);
}
if (result && result.status == 200) {