deBug Tst Result & TEstType & Text DashBoard

This commit is contained in:
saeid
2019-07-21 15:12:10 +04:30
parent 5ed01f4013
commit 616bf5b54a
7 changed files with 421 additions and 439 deletions
+1 -5
View File
@@ -43,11 +43,7 @@
/******/ /******/
/******/ // script path function /******/ // script path function
/******/ function jsonpScriptSrc(chunkId) { /******/ function jsonpScriptSrc(chunkId) {
<<<<<<< HEAD /******/ return __webpack_require__.p + "js/vue/chunks/" + ({}[chunkId]||chunkId) + "." + {"0":"cee19c932dbc149a1cc9","1":"1a2ec2568db9e0d01036","2":"567342defd47adb4346e","3":"edff967a6e6d462943a1","4":"e565c025f6fe488409e8","5":"96bde56e75e96f96d773","6":"5a5158e2d37fea70c0ad","7":"b9cc1f0bbb86abca8821","8":"973b0649ccc38b9bdade","9":"1b12af34e8e809cd2cc5","10":"1a0d4926180438b7d7dd","11":"6a1dd0825a7b78dd66b2","12":"2fbc698c12dd792658de","13":"2a534d941dedd3e2828b","14":"21ee580c8e59c779a80a","15":"b930000cc9d8f16779ae","16":"642ab7c8fa65b0639c84","17":"0cd7d9cfdd466475ba79","18":"17734129a0e2e4afdd89","19":"cfb8b7752ecb0c044cf9","20":"75f4f9028bacfd88dbae","21":"4756b5a7dd1daa6f2bb9","22":"fb95807ca2e8a3eee080","23":"0bd0fd4380524b2abc6e","24":"c24930cf7b1ec90bcb23","25":"be75aab13d8369be063b","26":"e816ed8939bdeb632640","27":"54547f942de04358714d"}[chunkId] + ".js"
/******/ return __webpack_require__.p + "js/vue/chunks/" + ({}[chunkId]||chunkId) + "." + {"0":"cee19c932dbc149a1cc9","1":"1a2ec2568db9e0d01036","2":"567342defd47adb4346e","3":"edff967a6e6d462943a1","4":"e565c025f6fe488409e8","5":"96bde56e75e96f96d773","6":"5a5158e2d37fea70c0ad","7":"15e4bb6bc5da718a7edf","8":"c2a5317cf55cf4b30aae","9":"ec5534ce76a1d05e578f","10":"1a0d4926180438b7d7dd","11":"579917874d9306dc3854","12":"2fbc698c12dd792658de","13":"2a534d941dedd3e2828b","14":"21ee580c8e59c779a80a","15":"b930000cc9d8f16779ae","16":"adb713fe3707674161a5","17":"0cd7d9cfdd466475ba79","18":"17734129a0e2e4afdd89","19":"cfb8b7752ecb0c044cf9","20":"75f4f9028bacfd88dbae","21":"4756b5a7dd1daa6f2bb9","22":"fb95807ca2e8a3eee080","23":"0bd0fd4380524b2abc6e","24":"c24930cf7b1ec90bcb23","25":"ec97a6414b7a7daf18e2","26":"e816ed8939bdeb632640","27":"54547f942de04358714d"}[chunkId] + ".js"
=======
/******/ return __webpack_require__.p + "js/vue/chunks/" + ({}[chunkId]||chunkId) + "." + {"0":"cee19c932dbc149a1cc9","1":"5281a63adedfa1ab604f","2":"743b89b9bb2dabfa3ffe","3":"a050b1a548ee0857d2f7","4":"7c6e05813e662d286d09","5":"8d7463d42653e02550f1","6":"68a5b0bbe6eb4c67723e","7":"7b4c284293f5dd57a85d","8":"320bd23018e7d45c2399","9":"8ee8007e77852469f798","10":"9603d5be0ae5c93d2b34","11":"cf996f3dc28b604a3d3a","12":"febbfeb844354a0cdbff","13":"7441ce1b806f3f78bcbb","14":"8da587ed5e5037bb178c","15":"dc3f54190c64738d2bee","16":"b032a406fa78aefbf408","17":"aeda8d2fe82355b16c66","18":"4c39b4598f53fc5610c2","19":"44988f4163efeba55699","20":"08150bc9a6df0102406e","21":"bc068c1d2ec99a9965de","22":"9aa5bdc2ef1c37f1d6f4","23":"99044b1527f8753dde51","24":"8e2e76e3b7f37492e02f","25":"b7fe930c0eda2e6e82a5","26":"174e16952c4ab044e8bf","27":"bfdd4afc7d67ccd7ea27"}[chunkId] + ".js"
>>>>>>> eb83d7e2533274a2884a2efa593bfd66d8748f14
/******/ } /******/ }
/******/ /******/
/******/ // The require function /******/ // The require function
+6 -6
View File
@@ -84,18 +84,18 @@ export default {
data() { data() {
return { return {
AdminCards :[ AdminCards :[
{title:'Manage Users', text:'You can edit the medical center information',icon:'/img/Static/Dashboard/ipad.png',color:'WM-YellowPinkGradient-BG',route:{name: 'ManageUsers'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12', role: 'Admin|Supervisor'}, {title:'Manage Users', text:'You can Manage the users information',icon:'/img/Static/Dashboard/ipad.png',color:'WM-YellowPinkGradient-BG',route:{name: 'ManageUsers'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12', role: 'Admin|Supervisor'},
{title:'Manage Medical Center', text:'Managing users very fast by ...',icon:'/img/Static/Dashboard/Macbook.png',color:'WM-MuskGradient-BG',route:{name: 'ManageMedicalCenter'},aligntext:'text-md-left',alignimg:'text-md-right',column:'xs12 md7 sm7', role: 'Admin'}, {title:'Manage Medical Center', text:'You can edit the medical center information',icon:'/img/Static/Dashboard/Macbook.png',color:'WM-MuskGradient-BG',route:{name: 'ManageMedicalCenter'},aligntext:'text-md-left',alignimg:'text-md-right',column:'xs12 md7 sm7', role: 'Admin'},
{title:'List Test Type', text:'You can simply add your own test type',icon:'/img/Static/Dashboard/Book-and-Pen.png',color:'WM-GreyGradient-BG',route:{name: 'ListTestType'},aligntext:'text-md-left',alignimg:'text-md-right',column:'xs12 md5 sm5', role: 'Admin'} {title:'List Test Type', text:'You can simply add your test type',icon:'/img/Static/Dashboard/Book-and-Pen.png',color:'WM-GreyGradient-BG',route:{name: 'ListTestType'},aligntext:'text-md-left',alignimg:'text-md-right',column:'xs12 md5 sm5', role: 'Admin'}
], ],
SupervisorCards :[ SupervisorCards :[
{title:'Manage Users', text:'You can edit the medical center information',icon:'/img/Static/Dashboard/ipad.png',color:'WM-YellowPinkGradient-BG',route:{name: 'ManageUsers'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12', role: 'Admin|Supervisor'}, {title:'Manage Users', text:'You can Manage the users information',icon:'/img/Static/Dashboard/ipad.png',color:'WM-YellowPinkGradient-BG',route:{name: 'ManageUsers'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12', role: 'Admin|Supervisor'},
{title:'Test to Verify', text:'You can simply add your own test type in this section of website',icon:'/img/Static/Dashboard/notepad-colorful.png',color:'WM-PinkGradient-BG',route:{name: 'NotVerifyTestResult'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12', role: 'Admin|Supervisor'}, {title:'Test to Verify', text:'You can simply verify your own medical center test result in this section of website',icon:'/img/Static/Dashboard/notepad-colorful.png',color:'WM-PinkGradient-BG',route:{name: 'NotVerifyTestResult'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12', role: 'Admin|Supervisor'},
], ],
UsersCards :[ UsersCards :[
{title:'My Info', text:'You can easily edit your registration information',icon:'/img/Static/Dashboard/darkmug.png',color:'WM-OrangeGradient-BG',route:{name: 'MyInfo'},aligntext:'text-md-left',alignimg:'text-md-right', column:'xs12 md6 sm6'}, {title:'My Info', text:'You can easily edit your registration information',icon:'/img/Static/Dashboard/darkmug.png',color:'WM-OrangeGradient-BG',route:{name: 'MyInfo'},aligntext:'text-md-left',alignimg:'text-md-right', column:'xs12 md6 sm6'},
{title:'All Test Result', text:'You can see all user tests and own tests',icon:'/img/Static/Dashboard/pad.png',color:'WM-GreenGradient-BG',route:{name: 'AllResultTest'},aligntext:'text-md-left',alignimg:'text-md-right',column:'xs12 md6 sm6'}, {title:'All Test Result', text:'You can see all user tests and own tests',icon:'/img/Static/Dashboard/pad.png',color:'WM-GreenGradient-BG',route:{name: 'AllResultTest'},aligntext:'text-md-left',alignimg:'text-md-right',column:'xs12 md6 sm6'},
{title:'Add a Test Result', text:'You can edit the medical center information',icon:'/img/Static/Dashboard/ipad.png',color:'WM-YellowPinkGradient-BG',route:{name: 'SubmitTestResult'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12'}, {title:'Add a Test Result', text:'You can add the test result',icon:'/img/Static/Dashboard/ipad.png',color:'WM-YellowPinkGradient-BG',route:{name: 'SubmitTestResult'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12'},
], ],
} }
} }
+409 -409
View File
@@ -1,420 +1,420 @@
<template> <template>
<v-form ref="form"> <v-form ref="form">
<v-container grid-list-xs> <v-container grid-list-xs>
<material-card color="black" title="Submit Test Result"> <material-card color="black" title="Submit Test Result">
<v-layout <v-layout align-center justify-center wrap class="px-5 my-3" v-if="!$route.params.testResult">
align-center <v-flex xs12 sm4 md4>
justify-center <v-autocomplete
wrap :search-input.sync="searchInput"
class="px-5 my-3" :items="testTypeNames"
v-if="!$route.params.testResult" v-model="filter.name"
> label="Choose Test Type"
<v-flex xs12 sm4 md4> color="black"
<v-autocomplete class="pa-2"
:search-input.sync="searchInput" ></v-autocomplete>
:items="testTypeNames" </v-flex>
v-model="filter.name" <v-flex xs12 sm3 md3>
label="Choose Test Type" <v-text-field
color="black" name="testcode"
class="pa-2" v-model="filter.unique_code"
></v-autocomplete> label="Or Enter Test Unique Code"
</v-flex> color="black"
<v-flex xs12 sm3 md3> class="pa-2"
<v-text-field ></v-text-field>
name="testcode" </v-flex>
v-model="filter.unique_code" <v-flex xs12 md2 sm2 class="text-xs-center text-sm-center text-md-center">
label="Or Enter Test Unique Code" <v-btn
color="black" class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black"
class="pa-2" @click="selectTestType"
></v-text-field> style="padding:10px 60px;"
</v-flex> >
<v-flex xs12 md2 sm2 class="text-xs-center text-sm-center text-md-center"> <v-icon class="black--text mr-2 caption">fas fa-chevron-right</v-icon>
<v-btn <span class="black--text">Select Test Result</span>
class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black" </v-btn>
@click="selectTestType" </v-flex>
style="padding:10px 60px;" </v-layout>
> <v-layout row wrap class="px-5 my-3" v-if="!$route.params.testResult && form.length" >
<v-icon class="black--text mr-2 caption">fas fa-chevron-right</v-icon> <v-divider></v-divider>
<span class="black--text">GO</span> </v-layout>
</v-btn> <v-layout align-center justify-center wrap class="px-5 my-3" v-if="form.length">
</v-flex> <v-flex xs12 sm4 md4>
</v-layout> <v-text-field
<v-layout row wrap class="px-5 my-3" v-if="!$route.params.testResult"> name="autoclave"
<v-divider></v-divider> v-model="formData.device_id"
</v-layout> :label="formData.device_label"
<v-layout align-center justify-center wrap class="px-5 my-3"> color="black"
<v-flex xs12 sm4 md4> class="pa-2"
<v-text-field ></v-text-field>
name="autoclave" </v-flex>
v-model="formData.device_id" <v-flex xs12 sm4 md4>
:label="formData.device_label" <v-text-field v-model="formData.cycle_number" label="Cycle Number" color="black" class="pa-2"></v-text-field>
color="black" </v-flex>
class="pa-2" <v-flex xs12 sm4 md4>
></v-text-field> <v-switch v-model="result" :label="'Result: ' + formData.result"></v-switch>
</v-flex> </v-flex>
<v-flex xs12 sm4 md4> <v-flex xs12 sm12 md12>
<v-text-field <div>
v-model="formData.cycle_number" <input type="file" class="inputfile" @change="onFileChange" multiple />
label="Cycle Number" <label for="file">
color="black" <v-icon class="v-icon greylighten-3--text mr-2 caption IconHover">fas fa-chevron-right</v-icon>Choose a file
class="pa-2" </label>
></v-text-field> </div>
</v-flex> <v-layout>
<v-flex xs12 sm4 md4> <v-flex v-for="(img, key) in images" :key="key" xs12 sm6 md3>
<v-switch v-model="result" :label="'Result: ' + formData.result"></v-switch> <img :src="img" style="width:100%;" />
</v-flex> <v-btn class="black" @click.native.stop="removeImage(key)">Remove image</v-btn>
<v-flex xs12 sm12 md12> </v-flex>
<div> </v-layout>
<input type="file" class="inputfile" @change="onFileChange" multiple /> </v-flex>
<label for="file"> <v-flex :class="['pa-2', item.size]" v-for="(item, key) in form" :key="key">
<v-icon <v-text-field
class="v-icon greylighten-3--text mr-2 caption IconHover" v-if="item.type == 'Text'"
>fas fa-chevron-right</v-icon>Choose a file v-model="formData[item.name+'_'+item.id]"
</label> :label="item.name"
</div> color="black"
<v-layout> ></v-text-field>
<v-flex v-for="(img, key) in images" :key="key" xs12 sm6 md3> <v-text-field
<img :src="img" style="width:100%;" /> v-if="item.type == 'Temperature'"
<v-btn class="black" @click.native.stop="removeImage(key)">Remove image</v-btn> type="number"
</v-flex> v-model="formData[item.name+'_'+item.id]"
</v-layout> :label="item.name"
</v-flex> min="0"
<v-flex :class="['pa-2', item.size]" v-for="(item, key) in form" :key="key"> max="200"
<v-text-field color="black"
v-if="item.type == 'Text'" ></v-text-field>
v-model="formData[item.name+'_'+item.id]" <v-select
:label="item.name" multiple
color="black" v-if="item.type == 'Select'"
></v-text-field> :items="item.options"
<v-select v-model="formData[item.name+'_'+item.id]"
multiple :label="item.name"
v-if="item.type == 'Select'" color="black"
:items="item.options" item-text="title"
v-model="formData[item.name+'_'+item.id]" item-value="id"
:label="item.name" ></v-select>
color="black" <v-container fluid v-if="item.type == 'Checkbox'">
item-text="title" <p>{{ item.name }}</p>
item-value="id" <v-checkbox
></v-select> v-for="(optionValue, keyOption) in item.options"
<v-container fluid v-if="item.type == 'Checkbox'"> :key="keyOption"
<p>{{ item.name }}</p> :label="optionValue.title"
<v-checkbox v-model="formData[item.name+'_'+item.id]"
v-for="(optionValue, keyOption) in item.options" :value="optionValue.id"
:key="keyOption" ></v-checkbox>
:label="optionValue.title" </v-container>
v-model="formData[item.name+'_'+item.id]" <v-container fluid v-if="item.type == 'Radiobutton'">
:value="optionValue.id" <p>{{ item.name }}</p>
></v-checkbox> <v-radio-group v-model="formData[item.name+'_'+item.id]">
</v-container> <v-radio
<v-container fluid v-if="item.type == 'Radiobutton'"> v-for="(optionValue, keyOption) in item.options"
<p>{{ item.name }}</p> :key="keyOption"
<v-radio-group v-model="formData[item.name+'_'+item.id]"> :label="optionValue.title"
<v-radio :value="optionValue.id"
v-for="(optionValue, keyOption) in item.options" ></v-radio>
:key="keyOption" </v-radio-group>
:label="optionValue.title" </v-container>
:value="optionValue.id" <v-container fluid v-if="item.type == 'Switch'">
></v-radio> <v-switch
</v-radio-group> v-model="formData[item.name+'_'+item.id]"
</v-container> :label="item.name + ': ' + formData[item.name+'_'+item.id].toString()"
<v-container fluid v-if="item.type == 'Switch'"> ></v-switch>
<v-switch </v-container>
v-model="formData[item.name+'_'+item.id]" <v-container fluid v-if="item.type == 'Range'">
:label="item.name + ': ' + formData[item.name+'_'+item.id].toString()" <p>{{ item.name }}</p>
></v-switch> <v-flex xs12>
</v-container> <v-slider
<v-container fluid v-if="item.type == 'Range'"> v-model="formData[item.name+'_'+item.id]"
<p>{{ item.name }}</p> :min="item.options[0].title"
<v-flex xs12> :max="item.options[1].title"
<v-slider thumb-label="always"
v-model="formData[item.name+'_'+item.id]" ></v-slider>
:min="item.options[0].title" </v-flex>
:max="item.options[1].title" </v-container>
thumb-label="always" <v-container fluid v-if="item.type == 'Time'">
></v-slider> <v-flex xs12>
</v-flex> <v-time-picker v-model="formData[item.name+'_'+item.id]"></v-time-picker>
</v-container> </v-flex>
<v-container fluid v-if="item.type == 'Time'"> </v-container>
<v-flex xs12> <template v-if="item.type == 'Form'">
<v-time-picker v-model="formData[item.name+'_'+item.id]"></v-time-picker> <v-container row md-12 sm-12 xs-12>
</v-flex> <v-layout row wrap>
</v-container> <h3>{{ item.name }}</h3>
<template v-if="item.type == 'Form'"> </v-layout>
<v-container row md-12 sm-12 xs-12> <v-layout row wrap>
<v-layout row wrap> <v-flex
<h3>{{ item.name }}</h3> :class="['pa-2', children.size]"
</v-layout> v-for="(children, keyChildren) in item.children"
<v-layout row wrap> :key="keyChildren"
<v-flex >
:class="['pa-2', children.size]" <v-text-field
v-for="(children, keyChildren) in item.children" v-if="children.type == 'Text'"
:key="keyChildren" v-model="formData[children.name+'_'+children.id]"
> :label="children.name"
<v-text-field color="black"
v-if="children.type == 'Text'" ></v-text-field>
v-model="formData[children.name+'_'+children.id]" <v-text-field
:label="children.name" v-if="children.type == 'Temperature'"
color="black" v-model="formData[children.name+'_'+children.id]"
></v-text-field> :label="children.name"
<v-select type="number"
multiple min="0"
v-if="children.type == 'Select'" max="200"
:items="children.options" color="black"
v-model="formData[children.name+'_'+children.id]" ></v-text-field>
:label="children.name" <v-select
color="black" multiple
item-text="title" v-if="children.type == 'Select'"
item-value="id" :items="children.options"
></v-select> v-model="formData[children.name+'_'+children.id]"
<v-container fluid v-if="children.type == 'Checkbox'"> :label="children.name"
<p>{{ children.name }}</p> color="black"
<v-checkbox item-text="title"
v-for="(optionValue, keyOption) in children.options" item-value="id"
:key="keyOption" ></v-select>
:label="optionValue.title" <v-container fluid v-if="children.type == 'Checkbox'">
v-model="formData[children.name+'_'+children.id]" <p>{{ children.name }}</p>
:value="optionValue.id" <v-checkbox
></v-checkbox> v-for="(optionValue, keyOption) in children.options"
</v-container> :key="keyOption"
<v-container fluid v-if="children.type == 'Radiobutton'"> :label="optionValue.title"
<p>{{ children.name }}</p> v-model="formData[children.name+'_'+children.id]"
<v-radio-group :value="optionValue.id"
v-model="formData[children.name+'_'+children.id]" ></v-checkbox>
> </v-container>
<v-radio <v-container fluid v-if="children.type == 'Radiobutton'">
v-for="(optionValue, keyOption) in children.options" <p>{{ children.name }}</p>
:key="keyOption" <v-radio-group v-model="formData[children.name+'_'+children.id]">
:label="optionValue.title" <v-radio
:value="optionValue.id" v-for="(optionValue, keyOption) in children.options"
></v-radio> :key="keyOption"
</v-radio-group> :label="optionValue.title"
</v-container> :value="optionValue.id"
<v-container fluid v-if="children.type == 'Switch'"> ></v-radio>
<v-switch </v-radio-group>
v-model="formData[children.name+'_'+children.id]" </v-container>
:label="children.name + ': ' + formData[children.name+'_'+children.id].toString()" <v-container fluid v-if="children.type == 'Switch'">
></v-switch> <v-switch
</v-container> v-model="formData[children.name+'_'+children.id]"
<v-container fluid v-if="children.type == 'Range'"> :label="children.name + ': ' + formData[children.name+'_'+children.id].toString()"
<p>{{ item.name }}</p> ></v-switch>
<v-flex xs12> </v-container>
<v-slider <v-container fluid v-if="children.type == 'Range'">
v-model="formData[children.name+'_'+children.id]" <p>{{ item.name }}</p>
:min="children.options[0].title" <v-flex xs12>
:max="children.options[1].title" <v-slider
thumb-label="always" v-model="formData[children.name+'_'+children.id]"
></v-slider> :min="children.options[0].title"
</v-flex> :max="children.options[1].title"
</v-container> thumb-label="always"
<v-container fluid v-if="children.type == 'Time'"> ></v-slider>
<v-flex xs12> </v-flex>
<v-time-picker </v-container>
v-model="formData[children.name+'_'+children.id]" <v-container fluid v-if="children.type == 'Time'">
></v-time-picker> <v-flex xs12>
</v-flex> <v-time-picker v-model="formData[children.name+'_'+children.id]"></v-time-picker>
</v-container> </v-flex>
</v-flex> </v-container>
</v-layout> </v-flex>
</v-container> </v-layout>
</template> </v-container>
</v-flex> </template>
</v-layout> </v-flex>
<v-layout row wrap class="px-5 my-3"> </v-layout>
<v-divider></v-divider> <v-layout row wrap class="px-5 my-3">
</v-layout> <v-divider></v-divider>
<v-layout align-center justify-center wrap class="px-5 mt-2"> </v-layout>
<v-btn <v-layout align-center justify-center wrap class="px-5 mt-2">
class="WM-CyanBlueGradient-BG" <v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px" @click="submitForm">
style="padding:10px 60px" <v-icon class="white--text mr-2 caption">fas fa-check</v-icon>
@click="submitForm" <span class="white--text">SAVE</span>
> </v-btn>
<v-icon class="white--text mr-2 caption">fas fa-check</v-icon> <router-link :to="{name: 'Dashboard'}">
<span class="white--text">SAVE</span> <v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5">
</v-btn> <v-icon class="black--text mr-2 caption">fas fa-chevron-left</v-icon>
<router-link :to="{name: 'Dashboard'}"> <span class="black--text">Back</span>
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5"> </v-btn>
<v-icon class="black--text mr-2 caption">fas fa-chevron-left</v-icon> </router-link>
<span class="black--text">Back</span> </v-layout>
</v-btn> </material-card>
</router-link> </v-container>
</v-layout> </v-form>
</material-card>
</v-container>
</v-form>
</template> </template>
<script> <script>
import { ApiService } from "@/services"; import { ApiService } from "@/services";
import { urls } from "@/config/urls"; import { urls } from "@/config/urls";
export default { export default {
data: () => ({ data: () => ({
testTypeNames: [], testTypeNames: [],
searchInput: "", searchInput: "",
form: [], form: [],
filter: { filter: {
test_result_id: "", test_result_id: "",
name: "", name: "",
unique_code: "" unique_code: ""
}, },
result: false, result: false,
formData: { formData: {
device_id: 0, device_id: "",
device_label: "AutoClaveID or WasherID", device_label: "AutoClaveID or WasherID",
result: "Reject", result: "Reject",
cycle_number: "", cycle_number: "",
img: null, img: null,
test_type_id: "" test_type_id: ""
}, },
images: [] images: []
}), }),
created() { created() {
if (this.$route.params.testResult) { if (this.$route.params.testResult) {
this.filter.test_result_id = this.$route.params.testResult; this.filter.test_result_id = this.$route.params.testResult;
this.selectTestType(); this.selectTestType();
} }
this.load(); this.load();
}, },
methods: { methods: {
async load() { async load() {
const result = await ApiService.get(urls.listTestTypeName); const result = await ApiService.get(urls.listTestTypeName);
this.testTypeNames = result.data.data; this.testTypeNames = result.data.data;
}, },
async selectTestType() { async selectTestType() {
const result = await ApiService.post(urls.getInputs, this.filter); const result = await ApiService.post(urls.getInputs, this.filter);
if (result && result.status == 200) { if (result && result.status == 200) {
this.form = result.data.data.inputs; this.form = result.data.data.inputs;
this.formData.test_type_id = result.data.data.testType.id; this.formData.test_type_id = result.data.data.testType.id;
this.formData.device_label = result.data.data.testType.device_label; this.formData.device_label =
for (const key in result.data.data.inputs) { result.data.data.testType.device_label;
if (result.data.data.inputs.hasOwnProperty(key)) { for (const key in result.data.data.inputs) {
if (result.data.data.inputs[key].type == "Form") { if (result.data.data.inputs.hasOwnProperty(key)) {
for (const keyForm in result.data.data.inputs[key] if (result.data.data.inputs[key].type == "Form") {
.children) { for (const keyForm in result.data.data.inputs[key]
if ( .children) {
result.data.data.inputs[ if (
key result.data.data.inputs[
].children.hasOwnProperty(keyForm) key
) { ].children.hasOwnProperty(keyForm)
if ( ) {
result.data.data.inputs[key].children[ if (
keyForm result.data.data.inputs[key].children[
].type == "Checkbox" || keyForm
result.data.data.inputs[key].children[ ].type == "Checkbox" ||
keyForm result.data.data.inputs[key].children[
].type == "Select" keyForm
) { ].type == "Select"
this.formData[ ) {
result.data.data.inputs[key] this.formData[
.children[keyForm].name + result.data.data.inputs[key]
"_" + .children[keyForm].name +
result.data.data.inputs[key] "_" +
.children[keyForm].id result.data.data.inputs[key]
] = []; .children[keyForm].id
} else { ] = [];
this.formData[ } else {
result.data.data.inputs[key] this.formData[
.children[keyForm].name + result.data.data.inputs[key]
"_" + .children[keyForm].name +
result.data.data.inputs[key] "_" +
.children[keyForm].id result.data.data.inputs[key]
] = ""; .children[keyForm].id
} ] = "";
} }
} }
} else if ( }
result.data.data.inputs[key].type == "Checkbox" || } else if (
result.data.data.inputs[key].type == "Select" result.data.data.inputs[key].type == "Checkbox" ||
) { result.data.data.inputs[key].type == "Select"
this.formData[ ) {
result.data.data.inputs[key].name + this.formData[
"_" + result.data.data.inputs[key].name +
result.data.data.inputs[key].id "_" +
] = []; result.data.data.inputs[key].id
} else { ] = [];
this.formData[ } else {
result.data.data.inputs[key].name + this.formData[
"_" + result.data.data.inputs[key].name +
result.data.data.inputs[key].id "_" +
] = ""; result.data.data.inputs[key].id
} ] = "";
} }
} }
if (this.$route.params.testResult) { }
const result = await ApiService.get( if (this.$route.params.testResult) {
urls.editTestResult(this.$route.params.testResult) const result = await ApiService.get(
); urls.editTestResult(this.$route.params.testResult)
if (result && result.status == 200) { );
this.formData = result.data.data; if (result && result.status == 200) {
for (const key in result.data.data.imagesPath) { this.formData = result.data.data;
if (result.data.data.imagesPath.hasOwnProperty(key)) { for (const key in result.data.data.imagesPath) {
result.data.data.imagesPath[key] = '/' + result.data.data.imagesPath[key]; if (
result.data.data.imagesPath.hasOwnProperty(key)
) {
result.data.data.imagesPath[key] =
"/" + result.data.data.imagesPath[key];
}
}
this.images = result.data.data.imagesPath;
}
}
}
},
async submitForm() {
let result;
if (this.$route.params.testResult) {
result = await ApiService.put(
urls.updateTestResult(this.$route.params.testResult),
this.formData
);
} else {
result = await ApiService.post(
urls.storeTestResult,
this.formData
);
}
} if (result && result.status == 200) {
} this.$router.push({ name: "Dashboard" });
this.images = result.data.data.imagesPath; }
} },
} onFileChange(e) {
} var files = e.target.files || e.dataTransfer.files;
}, if (!files.length) return;
async submitForm() { for (const key in files) {
let result; if (files.hasOwnProperty(key)) {
if (this.$route.params.testResult) { this.createImage(files[key], key);
result = await ApiService.put( }
urls.updateTestResult(this.$route.params.testResult), }
this.formData },
); createImage(file, index) {
} else { var image = new Image();
result = await ApiService.post( var reader = new FileReader();
urls.storeTestResult, var vm = this;
this.formData
);
}
if (result && result.status == 200) { reader.onload = e => {
this.$router.push({ name: "Dashboard" }); vm.images.push(e.target.result);
} };
},
onFileChange(e) {
var files = e.target.files || e.dataTransfer.files;
if (!files.length) return;
for (const key in files) {
if (files.hasOwnProperty(key)) {
this.createImage(files[key], key);
}
}
},
createImage(file, index) {
var image = new Image();
var reader = new FileReader();
var vm = this;
reader.onload = e => { reader.readAsDataURL(file);
vm.images.push(e.target.result); },
}; removeImage(index) {
this.images.splice(index, 1);
reader.readAsDataURL(file); }
}, },
removeImage(index) { watch: {
this.images.splice(index, 1); images(img) {
} this.formData.imgs = img;
}, },
watch: { result(value) {
images(img) { if (value) {
this.formData.imgs = img; this.formData.result = "Accept";
}, } else {
result(value) { this.formData.result = "Reject";
if (value) { }
this.formData.result = "Accept"; },
} else { formData(value) {
this.formData.result = "Reject"; if (value.result == "Accept") {
} this.result = true;
}, } else {
formData(value) { this.result = false;
if (value.result == "Accept") { }
this.result = true; }
} else { }
this.result = false;
}
}
}
}; };
</script> </script>
+1 -1
View File
@@ -301,7 +301,7 @@ export default {
} }
}, },
async generateBarcode(id) { async generateBarcode(id) {
const result = await ApiService.post(urls.Barcode(`110${id}64`)); const result = await ApiService.post(urls.Barcode(`CSSD-${id}`));
if (result && result.status == 200) { if (result && result.status == 200) {
this.changeCurrentModal({ this.changeCurrentModal({
modal: "modal-barcode-barcode", modal: "modal-barcode-barcode",
+2 -1
View File
@@ -386,7 +386,8 @@ export default {
{ state: "Switch", abbr: "Switch" }, { state: "Switch", abbr: "Switch" },
{ state: "Range", abbr: "Range" }, { state: "Range", abbr: "Range" },
{ state: "Time", abbr: "Time" }, { state: "Time", abbr: "Time" },
{ state: "Form", abbr: "Form" } { state: "Temperature", abbr: "Temperature" },
{ state: "Form", abbr: "Form" },
], ],
size: [ size: [
{ state: "not Selected", abbr: "" }, { state: "not Selected", abbr: "" },
+1 -16
View File
@@ -44,7 +44,7 @@
<v-text-field <v-text-field
required required
slot="activator" slot="activator"
label="FromDate" label="UpToDate"
v-model="filter.upToPicker" v-model="filter.upToPicker"
></v-text-field> ></v-text-field>
<v-date-picker <v-date-picker
@@ -102,10 +102,6 @@
<span>Edit</span> <span>Edit</span>
</v-btn> </v-btn>
</router-link> </router-link>
<v-btn color="orange darken-1" @click="generateBarcode(item.unique_code)">
<v-icon class="white--text mr-1 caption">fas fa-barcode</v-icon>
<span>Generate Barcode</span>
</v-btn>
<v-btn color="black" class="mr-2" @click="remove(item.id)"> <v-btn color="black" class="mr-2" @click="remove(item.id)">
<v-icon class="white--text mr-1 caption">fas fa-folder</v-icon> <v-icon class="white--text mr-1 caption">fas fa-folder</v-icon>
<span>Archive</span> <span>Archive</span>
@@ -134,7 +130,6 @@
<script> <script>
import { ApiService } from "@/services"; import { ApiService } from "@/services";
import { urls } from "@/config/urls"; import { urls } from "@/config/urls";
import { mapMutations } from "vuex";
export default { export default {
data: () => ({ data: () => ({
headers: [ headers: [
@@ -182,7 +177,6 @@ export default {
this.load(); this.load();
}, },
methods: { methods: {
...mapMutations("modal", ["changeCurrentModal"]),
async load(page = 1) { async load(page = 1) {
let filter = "?"; let filter = "?";
for (const key in this.filter) { for (const key in this.filter) {
@@ -211,15 +205,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 }
});
}
}
}, },
watch: { watch: {
currentPage(page) { currentPage(page) {
+1 -1
View File
@@ -74,7 +74,7 @@
<v-text-field <v-text-field
required required
slot="activator" slot="activator"
label="FromDate" label="UpToDate"
v-model="filter.upToPicker" v-model="filter.upToPicker"
></v-text-field> ></v-text-field>
<v-date-picker <v-date-picker