next Edit

This commit is contained in:
saeid
2019-04-28 14:52:05 +04:30
parent 5ccfe1b7d7
commit f9600be080
13 changed files with 1394 additions and 1214 deletions
+57 -26
View File
@@ -1,9 +1,7 @@
<template>
<v-form ref="form">
<v-container grid-list-xs>
<material-card
color="black"
title="Submit Test Result">
<material-card color="black" title="Submit Test Result">
<v-layout align-center justify-center wrap class="px-5 my-3">
<v-flex xs12 sm4 md4>
<v-autocomplete
@@ -25,7 +23,11 @@
></v-text-field>
</v-flex>
<v-flex xs12 md2 sm2 class="text-xs-center text-sm-center text-md-center">
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black" @click="selectTestType" style="padding:10px 60px;">
<v-btn
class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black"
@click="selectTestType"
style="padding:10px 60px;"
>
<v-icon class="black--text mr-2 caption">fas fa-chevron-right</v-icon>
<span class="black--text">GO</span>
</v-btn>
@@ -70,15 +72,49 @@
class="pa-2"
item-text="title"
></v-select>
<template v-if="item.type == 'CheckBox'">
<v-container fluid v-if="item.type == 'Checkbox'">
<p>{{ item.name }}</p>
<v-container fluid v-for="(optionValue, keyOption) in item.options" :key="keyOption">
<v-checkbox :label="option.title" v-model="form.data[key][item.name]" :value="optionValue"></v-checkbox>
</v-container>
<v-checkbox
v-for="(optionValue, keyOption) in item.options"
:key="keyOption"
:label="optionValue.title"
v-model="item[item.name]"
:value="optionValue.title"
></v-checkbox>
</v-container>
<template v-if="item.type == 'Form'">
<v-layout row wrap>
<h3>{{ item.name }}</h3>
<v-flex v-for="(children, keyChildren) in item.children" :key="keyChildren">
<v-text-field
v-if="children.type == 'Text'"
v-model="children[children.name]"
:label="children.name"
color="black"
class="pa-2"
></v-text-field>
<v-select
v-if="children.type == 'Select'"
:items="children.options"
v-model="children[children.name]"
:label="children.name"
color="black"
class="pa-2"
item-text="title"
></v-select>
<v-container fluid v-if="children.type == 'Checkbox'">
<p>{{ children.name }}</p>
<v-checkbox
v-for="(optionValue, keyOption) in children.options"
:key="keyOption"
:label="optionValue.title"
v-model="children[children.name]"
:value="optionValue.title"
></v-checkbox>
</v-container>
</v-flex>
</v-layout>
</template>
<!-- <template v-if="item.type == 'Form'">
</template> -->
</v-flex>
</v-layout>
<v-layout row wrap class="px-5 my-3">
@@ -96,7 +132,7 @@
</v-btn>
</router-link>
</v-layout>
</material-card>
</material-card>
</v-container>
</v-form>
</template>
@@ -105,28 +141,23 @@ import { ApiService } from "@/services";
import { urls } from "@/config/urls";
export default {
data: () => ({
result: [
'Accept',
'Reject',
],
result: ["Accept", "Reject"],
testTypeNames: [],
searchInput: '',
searchInput: "",
form: {
autoclave_id: '',
result: '',
data: [
]
autoclave_id: "",
result: "",
data: []
},
filter: {
name:'',
unique_code:''
name: "",
unique_code: ""
}
}),
created() {
this.load();
},
methods:{
methods: {
async load() {
const result = await ApiService.get(urls.listTestTypeName);
this.testTypeNames = result.data.data;
@@ -138,5 +169,5 @@ export default {
}
}
}
}
};
</script>