pack && packages && items && cycle

This commit is contained in:
Saeid
2019-09-08 19:15:12 +04:30
parent e278b4e957
commit a665911d15
13 changed files with 617 additions and 468 deletions
+35 -46
View File
@@ -12,22 +12,38 @@
></v-text-field>
</v-flex>
<v-flex xs12 md3 sm3>
<v-autocomplete
<v-text-field
class="pa-2"
v-model="filter.result"
label="Result"
v-model="filter.sterilizer_id"
label="Sterilizer ID"
color="black"
:items="result"
></v-autocomplete>
></v-text-field>
</v-flex>
<v-flex xs12 md3 sm3>
<v-text-field
class="pa-2"
v-model="filter.unique_id"
label="uniqueID"
v-model="filter.cycle_number"
label="Cycle Number"
color="black"
></v-text-field>
</v-flex>
<v-flex xs12 sm6 md3>
<v-menu
lazy
:close-on-content-click="true"
transition="v-scale-transition"
offset-y
v-model="Menu"
>
<v-text-field required slot="activator" label="Date" v-model="filter.date"></v-text-field>
<v-date-picker
color="pink"
no-title
v-model="filter.date"
:date-format="date => new Date(date).toDateString()"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex class xs12 md2 sm3>
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px" @click="load()">
<v-icon class="white--text mr-2 caption">fas fa-search</v-icon>
@@ -55,10 +71,10 @@
/>
</template>
<template slot="items" slot-scope="{ item }">
<td class="headline font-weight-light">{{ item.unique_id }}</td>
<td class="title font-weight-light">{{ item.name }}</td>
<td class="title font-weight-light">{{ item.result }}</td>
<td class="title font-weight-light">{{ item.created_at }}</td>
<td class="headline font-weight-light">{{ item.name }}</td>
<td class="title font-weight-light">{{ item.sterilizer_id }}</td>
<td class="title font-weight-light">{{ item.cycle_number }}</td>
<td class="title font-weight-light">{{ item.date }}</td>
<td class="text-xs-right">
<v-btn color="cyan" class="mr-2" @click="show(item.id)">
<v-icon class="white--text mr-1 caption">fas fa-eye</v-icon>
@@ -82,10 +98,6 @@
<v-icon class="white--text mr-2 caption">fas fa-times</v-icon>
<span>Remove</span>
</v-btn>
<v-btn color="orange darken-1" @click="generateBarcode(item.unique_id)">
<v-icon class="white--text mr-1 caption">fas fa-barcode</v-icon>
<span>Generate Barcode</span>
</v-btn>
</td>
</template>
</v-data-table>
@@ -117,18 +129,18 @@ export default {
headers: [
{
sortable: true,
text: "Unique ID",
value: "Unique ID"
text: "Name",
value: "Name"
},
{
sortable: true,
text: "Name",
value: "name"
text: "Sterilizer ID",
value: "Sterilizer ID"
},
{
sortable: false,
text: "Result",
value: "result"
text: "Cycle Number",
value: "Cycle Number"
},
{
sortable: false,
@@ -142,12 +154,8 @@ export default {
align: "right"
}
],
filter: {
unique_id: '',
name: '',
result: '',
},
result: ['Pass', 'Fail'],
filter: {},
Menu: false,
packages: [],
currentPage: 1,
lastPage: 1,
@@ -200,15 +208,6 @@ export default {
}
}
},
async generateBarcode(code) {
const result = await ApiService.post(urls.Barcode(code));
if (result && result.status == 200) {
this.changeCurrentModal({
modal: "modal-barcode-barcode",
properties: { result }
});
}
}
},
computed: {
...mapGetters("modal", ["getModalResult"])
@@ -216,16 +215,6 @@ export default {
watch: {
currentPage(page) {
this.load(page);
},
getModalResult(testResult) {
for (const key in this.packages) {
if (
this.packages.hasOwnProperty(key) &&
this.packages[key].id == testResult.id
) {
this.packages[key] = testResult;
}
}
}
}
};