mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-13 03:33:17 +03:30
fix: items & style
This commit is contained in:
+107
-126
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user