mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 23:41:06 +03:30
saeid
This commit is contained in:
@@ -116,6 +116,11 @@ export default {
|
||||
icon: 'done',
|
||||
text: 'Submit Test Result'
|
||||
},
|
||||
{
|
||||
to: {name: 'Statistics'},
|
||||
icon: 'fas fa-chart-bar',
|
||||
text: 'Statistics'
|
||||
},
|
||||
],
|
||||
responsive: false
|
||||
}),
|
||||
|
||||
@@ -1,61 +1,77 @@
|
||||
<template>
|
||||
<v-form >
|
||||
<v-container grid-list-xs>
|
||||
<v-layout row wrap class="justify-center">
|
||||
<v-flex xs12 md3 sm3 class="WM-WidthScreen-SM WM-WidthScreen-XS">
|
||||
<material-card
|
||||
color="black"
|
||||
title="Change Password">
|
||||
<v-layout row wrap class="px-3">
|
||||
<v-flex xs12 md12 sm12>
|
||||
<v-text-field
|
||||
v-model="form.password"
|
||||
label="Password"
|
||||
color="black"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md12 sm12>
|
||||
<v-text-field
|
||||
v-model="form.password_confirmation"
|
||||
label="Confirm Password"
|
||||
color="black"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-form ref="form">
|
||||
<v-container grid-list-xs>
|
||||
<v-layout row wrap class="justify-center">
|
||||
<v-flex xs12 md3 sm3 class="WM-WidthScreen-SM WM-WidthScreen-XS">
|
||||
<material-card color="black" title="Change Password">
|
||||
<v-layout row wrap class="px-3">
|
||||
<v-flex xs12 md12 sm12>
|
||||
<v-text-field
|
||||
v-model="form.password"
|
||||
label="Password"
|
||||
:type="show1 ? 'text' : 'password'"
|
||||
:append-icon="show1 ? 'visibility' : 'visibility_off'"
|
||||
@click:append="show1 = !show1"
|
||||
:rules="[rules.required, rules.passCounter]"
|
||||
color="black"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md12 sm12>
|
||||
<v-text-field
|
||||
v-model="form.password_confirmation"
|
||||
label="Confirm Password"
|
||||
color="black"
|
||||
:type="show2 ? 'text' : 'password'"
|
||||
:append-icon="show2 ? 'visibility' : 'visibility_off'"
|
||||
@click:append="show2 = !show2"
|
||||
:rules="[rules.required, rules.passCounter, rules.confirm]"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row wrap class="px-3">
|
||||
<v-flex xs12 md6 sm6 class="text-md-left text-sm-center text-xs-center">
|
||||
<v-btn
|
||||
class="WM-CyanBlueGradient-BG"
|
||||
style="padding:10px 60px"
|
||||
@click="submitChangePassword"
|
||||
>
|
||||
<v-icon class="white--text mr-2 caption">fas fa-sign-in-alt</v-icon>
|
||||
<span class="white--text">Submit</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row wrap class="px-3">
|
||||
<v-flex xs12 md6 sm6 class="text-md-left text-sm-center text-xs-center">
|
||||
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px" @click="submitChangePassword">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-sign-in-alt</v-icon>
|
||||
<span class="white--text">Submit</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-form>
|
||||
</v-container>
|
||||
</v-form>
|
||||
</template>
|
||||
<script>
|
||||
import { mapActions } from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
password: "",
|
||||
password_confirmation: "",
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
...mapActions('auth', [
|
||||
'changePassword'
|
||||
]),
|
||||
submitChangePassword() {
|
||||
if (this.form.code != '') {
|
||||
this.changePassword({form: this.form});
|
||||
}
|
||||
}
|
||||
}
|
||||
data() {
|
||||
return {
|
||||
show1: false,
|
||||
show2: false,
|
||||
rules: {
|
||||
required: value => !!value || "Required.",
|
||||
confirm: value => this.form.password_confirmation == this.form.password || "Your Passwords do not match.",
|
||||
passCounter: value =>
|
||||
(value && value.length >= 8) || "Min 8 characters"
|
||||
},
|
||||
form: {
|
||||
password: "",
|
||||
password_confirmation: ""
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
...mapActions("auth", ["changePassword"]),
|
||||
submitChangePassword() {
|
||||
if (this.$refs.form.validate()) {
|
||||
this.changePassword({ form: this.form });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Vendored
+2
-1
@@ -5,6 +5,8 @@ const urls = {
|
||||
logout : "/logout",
|
||||
storeMedicalCenter : "/MedicalCenters",
|
||||
storeTestResult : "/TestResults",
|
||||
listFilterItemsTestResult : `/TestResults/ListFilterItems`,
|
||||
statistics : `/TestResults/chart`,
|
||||
storeTestType : "/TestTypes",
|
||||
listTestTypeName : "/TestTypes/ListNames",
|
||||
getInputs : `/GetInputs`,
|
||||
@@ -32,7 +34,6 @@ const urls = {
|
||||
}
|
||||
return "/TestResults?page=" + page;
|
||||
},
|
||||
listFilterItemsTestResult : `/TestResults/ListFilterItems`,
|
||||
verifyTestResult : function(id) {
|
||||
return `/TestResults/Verify/${id}`;
|
||||
},
|
||||
|
||||
@@ -60,7 +60,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
...mapActions("auth", ["forgotPassword"]),
|
||||
// ...mapMutations("modal", ["changeCurrentModal"]),
|
||||
async handleSubmit() {
|
||||
if (this.$refs.form.validate()) {
|
||||
this.forgotPassword({form : this.form});
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
<material-card color="black" title="Search Result">
|
||||
<v-layout align-center justify-center wrap class="px-5 my-3">
|
||||
<v-flex xs12 sm4 md4>
|
||||
<v-autocomplete :items="medicalCenters" item-text="name" item-value="id" v-model="form.medicalCenter" @change="fillUsers" label="Hospital" color="black" class="pa-2"></v-autocomplete>
|
||||
<v-autocomplete :items="medicalCenters" item-text="name" item-value="id" v-model="form.medicalCenterId" @change="fillUsers" label="Hospital" color="black" class="pa-2"></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm4 md4>
|
||||
<v-autocomplete :items="users" item-text="name" item-value="id" v-model="form.user" label="User" color="black" class="pa-2"></v-autocomplete>
|
||||
<v-autocomplete :items="users" item-text="name" item-value="id" v-model="form.userId" label="User" color="black" class="pa-2"></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm4 md4>
|
||||
<v-autocomplete :items="testTypes" item-text="name" item-value="id" v-model="form.testType" label="TestType" color="black" class="pa-2"></v-autocomplete>
|
||||
<v-autocomplete :items="testTypes" item-text="name" item-value="id" v-model="form.testTypeId" label="TestType" color="black" class="pa-2"></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm4 md4>
|
||||
<v-autocomplete :items="result" v-model="form.result" label="Result" color="black" class="pa-2"></v-autocomplete>
|
||||
@@ -103,9 +103,9 @@ export default {
|
||||
medicalCenters: [],
|
||||
testTypes: [],
|
||||
form: {
|
||||
medicalCenter: null,
|
||||
user: null,
|
||||
testType: null,
|
||||
medicalCenterId: null,
|
||||
userId: null,
|
||||
testTypeId: null,
|
||||
result: null,
|
||||
verify: null,
|
||||
type: 'PieChart',
|
||||
@@ -141,7 +141,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async fillUsers() {
|
||||
const result = await ApiService.get(urls.listOpertorMedicalCenter(this.form.medicalCenter));
|
||||
const result = await ApiService.get(urls.listOpertorMedicalCenter(this.form.medicalCenterId));
|
||||
if (result && result.status == 200) {
|
||||
this.users = result.data.data.users;
|
||||
}
|
||||
@@ -149,7 +149,7 @@ export default {
|
||||
async submitForm() {
|
||||
const result = await ApiService.post(urls.statistics, this.form);
|
||||
if (result && result.status == 200) {
|
||||
this.fillData(result.data.data)
|
||||
this.fillData(result.data.data);
|
||||
this.chart = true;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<v-divider></v-divider>
|
||||
</v-layout>
|
||||
<v-layout align-center justify-center wrap class="px-5 my-3">
|
||||
<v-flex xs12 sm4 md3>
|
||||
<v-flex xs12 sm4 md4>
|
||||
<v-text-field
|
||||
name="autoclave"
|
||||
v-model="formData.autoclave_id"
|
||||
@@ -52,7 +52,7 @@
|
||||
class="pa-2"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm4 md3>
|
||||
<v-flex xs12 sm4 md4>
|
||||
<v-select
|
||||
:items="result"
|
||||
v-model="formData.result"
|
||||
@@ -61,7 +61,7 @@
|
||||
class="pa-2"
|
||||
></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm4 md3>
|
||||
<v-flex xs12 sm4 md4>
|
||||
<div v-if="!image">
|
||||
<input type="file" class="inputfile" @change="onFileChange">
|
||||
<label for="file"><v-icon class="v-icon greylighten-3--text mr-2 caption IconHover">fas fa-chevron-right</v-icon>Choose a file</label>
|
||||
@@ -74,7 +74,7 @@
|
||||
<v-flex :class="['pa-2', item.size]" v-for="(item, key) in form" :key="key">
|
||||
<v-text-field
|
||||
v-if="item.type == 'Text'"
|
||||
v-model="formData[item.id]"
|
||||
v-model="formData[item.name+'_'+item.id]"
|
||||
:label="item.name"
|
||||
color="black"
|
||||
></v-text-field>
|
||||
@@ -82,7 +82,7 @@
|
||||
multiple
|
||||
v-if="item.type == 'Select'"
|
||||
:items="item.options"
|
||||
v-model="formData[item.id]"
|
||||
v-model="formData[item.name+'_'+item.id]"
|
||||
:label="item.name"
|
||||
color="black"
|
||||
item-text="title"
|
||||
@@ -94,7 +94,7 @@
|
||||
v-for="(optionValue, keyOption) in item.options"
|
||||
:key="keyOption"
|
||||
:label="optionValue.title"
|
||||
v-model="formData[item.id]"
|
||||
v-model="formData[item.name+'_'+item.id]"
|
||||
:value="optionValue.id"
|
||||
></v-checkbox>
|
||||
</v-container>
|
||||
@@ -110,7 +110,7 @@
|
||||
>
|
||||
<v-text-field
|
||||
v-if="children.type == 'Text'"
|
||||
v-model="formData[children.id]"
|
||||
v-model="formData[children.name+'_'+children.id]"
|
||||
:label="children.name"
|
||||
color="black"
|
||||
></v-text-field>
|
||||
@@ -118,7 +118,7 @@
|
||||
multiple
|
||||
v-if="children.type == 'Select'"
|
||||
:items="children.options"
|
||||
v-model="formData[children.id]"
|
||||
v-model="formData[children.name+'_'+children.id]"
|
||||
:label="children.name"
|
||||
color="black"
|
||||
item-text="title"
|
||||
@@ -130,7 +130,7 @@
|
||||
v-for="(optionValue, keyOption) in children.options"
|
||||
:key="keyOption"
|
||||
:label="optionValue.title"
|
||||
v-model="formData[children.id]"
|
||||
v-model="formData[children.name+'_'+children.id]"
|
||||
:value="optionValue.id"
|
||||
></v-checkbox>
|
||||
</v-container>
|
||||
@@ -204,16 +204,16 @@ export default {
|
||||
for (const keyForm in result.data.data.inputs[key].children) {
|
||||
if (result.data.data.inputs[key].children.hasOwnProperty(keyForm)) {
|
||||
if (result.data.data.inputs[key].children[keyForm].type == 'Checkbox' || result.data.data.inputs[key].children[keyForm].type == 'Select' ) {
|
||||
this.formData[result.data.data.inputs[key].children[keyForm].id] = [];
|
||||
this.formData[result.data.data.inputs[key].children[keyForm].name +'_'+ result.data.data.inputs[key].children[keyForm].id] = [];
|
||||
} else {
|
||||
this.formData[result.data.data.inputs[key].children[keyForm].id] = '';
|
||||
this.formData[result.data.data.inputs[key].children[keyForm].name +'_'+ result.data.data.inputs[key].children[keyForm].id] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(result.data.data.inputs[key].type == 'Checkbox' || result.data.data.inputs[key].type == 'Select') {
|
||||
this.formData[result.data.data.inputs[key].id] = [];
|
||||
this.formData[result.data.data.inputs[key].name +'_'+ result.data.data.inputs[key].id] = [];
|
||||
} else {
|
||||
this.formData[result.data.data.inputs[key].id] = '';
|
||||
this.formData[result.data.data.inputs[key].name +'_'+ result.data.data.inputs[key].id] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<td class="title font-weight-light">{{ item.user.name }}</td>
|
||||
<td class="title font-weight-light">{{ item.created_at }}</td>
|
||||
<td class="text-xs-right">
|
||||
<router-link
|
||||
<router-link v-if="item.test_results_count == 0"
|
||||
:to="{name : 'EditTestType', params : {testType : item.id}}"
|
||||
>
|
||||
<v-btn color="cyan" class="mr-2 WM-ActionButton">
|
||||
|
||||
@@ -71,7 +71,13 @@
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<v-flex xs12 md2 sm2 class="text-md-center text-sm-center text-xs-center">
|
||||
<router-link to="/">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black" @click="changePassword">
|
||||
<v-icon class="black--text">fas fa-refresh</v-icon>
|
||||
<span class="black--text"> Change Password </span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<v-flex xs12 md2 sm2 class="text-md-center text-sm-center text-xs-center">
|
||||
<router-link :to="{name: 'Dashboard'}">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black">
|
||||
<v-icon class="black--text">keyboard_arrow_left</v-icon>
|
||||
<span class="black--text">Back</span>
|
||||
@@ -87,6 +93,7 @@
|
||||
<script>
|
||||
import { ApiService } from "@/services";
|
||||
import { urls } from "@/config/urls";
|
||||
import { mapMutations } from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -125,6 +132,10 @@ export default {
|
||||
this.$router.push({ name: `Dashboard` });
|
||||
}
|
||||
}
|
||||
},
|
||||
...mapMutations('modal',['changeCurrentModal']),
|
||||
changePassword() {
|
||||
this.changeCurrentModal({ modal: "modal-auth-change-password" });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user