diff --git a/app/Http/Controllers/TestResultController.php b/app/Http/Controllers/TestResultController.php index 53602a8b..423f28c7 100644 --- a/app/Http/Controllers/TestResultController.php +++ b/app/Http/Controllers/TestResultController.php @@ -15,9 +15,13 @@ use Illuminate\Support\Facades\Storage; class TestResultController extends Controller { - public function index() + public function index(Request $request) { - $TestResult = TestResult::with('test_type', 'user', 'user.medical_center')->paginate(10); + $TestResult = TestResult::with('test_type', 'user', 'user.medical_center') + ->when($request->has('verified'), function ($query) use ($request) + { + return $query->where('verified', $request->verified); + })->paginate(10); return \MessageResponse::data($TestResult); } diff --git a/config/filesystems.php b/config/filesystems.php index 77fa5ded..ceca83f2 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -50,8 +50,8 @@ return [ 'public' => [ 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'root' => public_path('uploads'), + 'url' => env('APP_URL') . '/storage', 'visibility' => 'public', ], diff --git a/config/image.php b/config/image.php new file mode 100644 index 00000000..2b1d2c3e --- /dev/null +++ b/config/image.php @@ -0,0 +1,20 @@ + 'gd' + +]; diff --git a/package-lock.json b/package-lock.json index ece4621e..73a36b76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14903,6 +14903,11 @@ "integrity": "sha512-S4f0wXEbQNHnP4IUtSSIRmzU/fjyPtTN5fC80JlHdTcF78VLT1/xsTqXgNtSW5712UJtrLPpF6b0LfOTJrCCBg==", "dev": true }, + "vuetify-upload-component": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/vuetify-upload-component/-/vuetify-upload-component-1.0.6.tgz", + "integrity": "sha512-7g4VjnacxPDAiaKWu+GikqmcLXqlFk6G+SirgajXQHnBgkOP0U0RLqPLU/sdtmcQCfj0l5RjiXTT5RZPDWRpNg==" + }, "vuex": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.1.0.tgz", diff --git a/package.json b/package.json index 521f9c8a..9aa76241 100644 --- a/package.json +++ b/package.json @@ -60,5 +60,8 @@ "vuetify": "^1.2.5", "vuex": "^3.0.1", "vuex-router-sync": "^5.0.0" + }, + "dependencies": { + "vuetify-upload-component": "^1.0.6" } } diff --git a/public/0.js b/public/0.js index 4bc3f51e..698b2af7 100644 --- a/public/0.js +++ b/public/0.js @@ -219,7 +219,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar exports = module.exports = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false); // Module -exports.push([module.i, "\n.WM-ActionButton[data-v-1346f0a2] {\r\n padding: 8px 22px;\n}\r\n", ""]); +exports.push([module.i, "\n.WM-ActionButton[data-v-1346f0a2] {\n padding: 8px 22px;\n}\n", ""]); diff --git a/public/1.js b/public/1.js index 0c130f6e..e08f9336 100644 --- a/public/1.js +++ b/public/1.js @@ -210,7 +210,7 @@ __webpack_require__.r(__webpack_exports__); exports = module.exports = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false); // Module -exports.push([module.i, "\n.WM-Border[data-v-7eb32e4a] {\r\n border: 1px solid;\n}\n.WM-Border-Black[data-v-7eb32e4a] {\r\n border-color: #2f353b !important;\n}\n.WM-Border-Gray[data-v-7eb32e4a] {\r\n border-color: #aaa !important;\n}\n.WM-Color-LightGrey[data-v-7eb32e4a] {\r\n background-color : #F5F5F5;\n}\n.WM-Relative[data-v-7eb32e4a] {\r\n position: relative;\n}\n.v-btn--top.v-btn--absolute.v-btn--small[data-v-7eb32e4a] {\r\n top: -25px !important;\n}\r\n", ""]); +exports.push([module.i, "\n.WM-Border[data-v-7eb32e4a] {\n border: 1px solid;\n}\n.WM-Border-Black[data-v-7eb32e4a] {\n border-color: #2f353b !important;\n}\n.WM-Border-Gray[data-v-7eb32e4a] {\n border-color: #aaa !important;\n}\n.WM-Color-LightGrey[data-v-7eb32e4a] {\n background-color : #F5F5F5;\n}\n.WM-Relative[data-v-7eb32e4a] {\n position: relative;\n}\n.v-btn--top.v-btn--absolute.v-btn--small[data-v-7eb32e4a] {\n top: -25px !important;\n}\n", ""]); diff --git a/public/16.js b/public/16.js index 732bcebe..f72cc96b 100644 --- a/public/16.js +++ b/public/16.js @@ -157,6 +157,27 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar // // // +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// /* harmony default export */ __webpack_exports__["default"] = ({ @@ -174,8 +195,10 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar formData: { autoclave_id: "", result: "", + img: null, test_type_id: "" - } + }, + image: null }; }, created: function created() { @@ -248,7 +271,6 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar 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].name] = []; - console.log(this.formData[result.data.data.inputs[key].children[keyForm].name]); } else { this.formData[result.data.data.inputs[key].children[keyForm].name] = ''; } @@ -340,7 +362,31 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar } return submitForm; - }() + }(), + onFileChange: function onFileChange(e) { + var files = e.target.files || e.dataTransfer.files; + if (!files.length) return; + this.createImage(files[0]); + }, + createImage: function createImage(file) { + var image = new Image(); + var reader = new FileReader(); + var vm = this; + + reader.onload = function (e) { + vm.image = e.target.result; + }; + + reader.readAsDataURL(file); + }, + removeImage: function removeImage(e) { + this.image = null; + } + }, + watch: { + image: function image(img) { + this.formData.img = img; + } } }); @@ -539,6 +585,26 @@ var render = function() { 1 ), _vm._v(" "), + _c("v-flex", { attrs: { xs12: "", sm4: "", md3: "" } }, [ + !_vm.image + ? _c("div", [ + _c("input", { + attrs: { type: "file" }, + on: { change: _vm.onFileChange } + }) + ]) + : _c("div", [ + _c("img", { + staticStyle: { width: "100%" }, + attrs: { src: _vm.image } + }), + _vm._v(" "), + _c("button", { on: { click: _vm.removeImage } }, [ + _vm._v("Remove image") + ]) + ]) + ]), + _vm._v(" "), _vm._l(_vm.form, function(item, key) { return _c( "v-flex", @@ -610,123 +676,117 @@ var render = function() { _vm._v(" "), item.type == "Form" ? [ + _c("v-layout", { attrs: { row: "", wrap: "" } }, [ + _c("h3", [_vm._v(_vm._s(item.name))]) + ]), + _vm._v(" "), _c( "v-layout", { attrs: { row: "", wrap: "" } }, - [ - _c("h3", [_vm._v(_vm._s(item.name))]), - _vm._v(" "), - _vm._l(item.children, function( - children, - keyChildren - ) { - return _c( - "v-flex", - { - key: keyChildren, - class: ["pa-2", children.size] - }, - [ - children.type == "Text" - ? _c("v-text-field", { - attrs: { - label: children.name, - color: "black" - }, - model: { - value: - _vm.formData[children.name], - callback: function($$v) { - _vm.$set( - _vm.formData, - children.name, - $$v - ) - }, - expression: - "formData[children.name]" - } - }) - : _vm._e(), - _vm._v(" "), - children.type == "Select" - ? _c("v-select", { - attrs: { - multiple: "", - items: children.options, - label: children.name, - color: "black", - "item-text": "title", - "item-value": "id" - }, - model: { - value: - _vm.formData[children.name], - callback: function($$v) { - _vm.$set( - _vm.formData, - children.name, - $$v - ) - }, - expression: - "formData[children.name]" - } - }) - : _vm._e(), - _vm._v(" "), - children.type == "Checkbox" - ? _c( - "v-container", - { attrs: { fluid: "" } }, - [ - _c("p", [ - _vm._v(_vm._s(children.name)) - ]), - _vm._v(" "), - _vm._l( - children.options, - function( - optionValue, - keyOption - ) { - return _c("v-checkbox", { - key: keyOption, - attrs: { - label: - optionValue.title, - value: optionValue.id - }, - model: { - value: - _vm.formData[ - children.name - ], - callback: function( - $$v - ) { - _vm.$set( - _vm.formData, - children.name, - $$v - ) - }, - expression: - "formData[children.name]" - } - }) - } + _vm._l(item.children, function( + children, + keyChildren + ) { + return _c( + "v-flex", + { + key: keyChildren, + class: ["pa-2", children.size] + }, + [ + children.type == "Text" + ? _c("v-text-field", { + attrs: { + label: children.name, + color: "black" + }, + model: { + value: + _vm.formData[children.name], + callback: function($$v) { + _vm.$set( + _vm.formData, + children.name, + $$v ) - ], - 2 - ) - : _vm._e() - ], - 1 - ) - }) - ], - 2 + }, + expression: + "formData[children.name]" + } + }) + : _vm._e(), + _vm._v(" "), + children.type == "Select" + ? _c("v-select", { + attrs: { + multiple: "", + items: children.options, + label: children.name, + color: "black", + "item-text": "title", + "item-value": "id" + }, + model: { + value: + _vm.formData[children.name], + callback: function($$v) { + _vm.$set( + _vm.formData, + children.name, + $$v + ) + }, + expression: + "formData[children.name]" + } + }) + : _vm._e(), + _vm._v(" "), + children.type == "Checkbox" + ? _c( + "v-container", + { attrs: { fluid: "" } }, + [ + _c("p", [ + _vm._v(_vm._s(children.name)) + ]), + _vm._v(" "), + _vm._l(children.options, function( + optionValue, + keyOption + ) { + return _c("v-checkbox", { + key: keyOption, + attrs: { + label: optionValue.title, + value: optionValue.id + }, + model: { + value: + _vm.formData[ + children.name + ], + callback: function($$v) { + _vm.$set( + _vm.formData, + children.name, + $$v + ) + }, + expression: + "formData[children.name]" + } + }) + }) + ], + 2 + ) + : _vm._e() + ], + 1 + ) + }), + 1 ) ] : _vm._e() diff --git a/public/17.js b/public/17.js index 431aabe6..e82bb0a9 100644 --- a/public/17.js +++ b/public/17.js @@ -149,7 +149,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope }; }, created: function created() { - this.load(); + if (this.$route.name == 'NotVerifyTestResult') { + this.load(1, 'NotVerified'); + } else { + this.load(); + } }, methods: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_3__["mapMutations"])("modal", ["changeCurrentModal"]), { load: function () { @@ -157,6 +161,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope /*#__PURE__*/ _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() { var page, + verified, result, _args = arguments; return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) { @@ -164,10 +169,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope switch (_context.prev = _context.next) { case 0: page = _args.length > 0 && _args[0] !== undefined ? _args[0] : 1; - _context.next = 3; - return _services__WEBPACK_IMPORTED_MODULE_1__["ApiService"].get(_config_urls__WEBPACK_IMPORTED_MODULE_2__["urls"].listTestResult(page)); + verified = _args.length > 1 && _args[1] !== undefined ? _args[1] : null; + _context.next = 4; + return _services__WEBPACK_IMPORTED_MODULE_1__["ApiService"].get(_config_urls__WEBPACK_IMPORTED_MODULE_2__["urls"].listTestResult(page, verified)); - case 3: + case 4: result = _context.sent; if (result && result.status == 200) { @@ -176,7 +182,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope this.lastPage = result.data.data.last_page; } - case 5: + case 6: case "end": return _context.stop(); } diff --git a/public/3.js b/public/3.js index 0f2a1828..3fd96b88 100644 --- a/public/3.js +++ b/public/3.js @@ -562,7 +562,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar exports = module.exports = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false); // Module -exports.push([module.i, "\n.WM-Border-Gray[data-v-5cc5a650] {\r\n border-color: #aaa !important;\n}\n.WM-Color-LightGrey[data-v-5cc5a650] {\r\n background-color: #f5f5f5;\n}\n.v-btn--top.v-btn--absolute.v-btn--small[data-v-5cc5a650] {\r\n top: -25px !important;\n}\n.v-btn--bottom.v-btn--absolute.v-btn--small[data-v-5cc5a650] {\r\n bottom: -24px !important;\n}\r\n", ""]); +exports.push([module.i, "\n.WM-Border-Gray[data-v-5cc5a650] {\n border-color: #aaa !important;\n}\n.WM-Color-LightGrey[data-v-5cc5a650] {\n background-color: #f5f5f5;\n}\n.v-btn--top.v-btn--absolute.v-btn--small[data-v-5cc5a650] {\n top: -25px !important;\n}\n.v-btn--bottom.v-btn--absolute.v-btn--small[data-v-5cc5a650] {\n bottom: -24px !important;\n}\n", ""]); diff --git a/public/4.js b/public/4.js index dec5feab..ad5c04d4 100644 --- a/public/4.js +++ b/public/4.js @@ -227,7 +227,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar exports = module.exports = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false); // Module -exports.push([module.i, "\n.WM-ActionButton[data-v-b1f1b72e] {\r\n padding: 8px 22px;\n}\r\n", ""]); +exports.push([module.i, "\n.WM-ActionButton[data-v-b1f1b72e] {\n padding: 8px 22px;\n}\n", ""]); diff --git a/public/9.js b/public/9.js index 97462752..0cd7a678 100644 --- a/public/9.js +++ b/public/9.js @@ -98,7 +98,7 @@ __webpack_require__.r(__webpack_exports__); icon: '/img/Static/Dashboard/notepad-colorful.png', color: 'WM-PinkGradient-BG', route: { - name: 'SubmitTestResult' + name: 'NotVerifyTestResult' }, aligntext: 'text-md-center', alignimg: 'text-md-left', diff --git a/public/mix-manifest.json b/public/mix-manifest.json index f3cfd725..74ee5ee1 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,3 +1,3 @@ { - "/vue/js/app.js": "/vue/js/app.js?id=571c3030afcd24e8d145" + "/vue/js/app.js": "/vue/js/app.js?id=b1ffa939001e67dfabbc" } diff --git a/public/vue/js/app.js b/public/vue/js/app.js index 9f61b2aa..08dbe231 100644 --- a/public/vue/js/app.js +++ b/public/vue/js/app.js @@ -3459,6 +3459,36 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// // // // @@ -8401,7 +8431,7 @@ exports.push([module.i, "/*!\n* Vuetify v1.5.11\n* Forged by John Leider\n* Rele exports = module.exports = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false); // Module -exports.push([module.i, "\n#core-footer {\r\n z-index: 0;\n}\r\n", ""]); +exports.push([module.i, "\n#core-footer {\n z-index: 0;\n}\n", ""]); @@ -17395,19 +17425,120 @@ var render = function() { attrs: { "align-center": "", wrap: "" } }, [ - _c( - "v-flex", - { attrs: { xs12: "", md2: "", sm2: "" } }, - [ - _c("v-text-field", { - staticClass: "pa-2", - attrs: { label: "Name", color: "black" } + _c("v-flex", { attrs: { xs12: "", md12: "", sm12: "" } }, [ + _c("div", [ + _vm._v("Auto Clave Id : " + _vm._s(_vm.data.autoclave_id)) + ]) + ]), + _vm._v(" "), + _c("v-flex", { attrs: { xs12: "", md12: "", sm12: "" } }, [ + _c("div", [_vm._v("Result : " + _vm._s(_vm.data.result))]) + ]), + _vm._v(" "), + _c("v-flex", { attrs: { xs12: "", md12: "", sm12: "" } }, [ + _c("div", [_vm._v("verify : " + _vm._s(_vm.data.verified))]) + ]), + _vm._v(" "), + _c("v-flex", { attrs: { xs12: "", md12: "", sm12: "" } }, [ + _c("div", [ + _vm._v("Register User : " + _vm._s(_vm.data.user.name)) + ]) + ]), + _vm._v(" "), + _vm.data.inputs + ? _vm._l(_vm.data.inputs, function(inputData, keyInputs) { + return _c( + "v-flex", + { + key: keyInputs, + attrs: { xs12: "", md12: "", sm12: "" } + }, + [ + _c("div", [ + _vm._v( + _vm._s(keyInputs) + " : " + _vm._s(inputData) + ) + ]) + ] + ) }) - ], - 1 - ) + : _vm._e(), + _vm._v(" "), + _vm.data.options + ? _vm._l(_vm.data.options, function( + optionData, + keyOptions + ) { + return _c( + "v-flex", + { + key: keyOptions, + attrs: { xs12: "", md12: "", sm12: "" } + }, + [ + _c( + "div", + [ + _vm._v(_vm._s(keyOptions) + " : "), + _vm._l(optionData, function(data, dataKey) { + return _c("span", { key: dataKey }, [ + _vm._v(_vm._s(data) + ", ") + ]) + }) + ], + 2 + ) + ] + ) + }) + : _vm._e(), + _vm._v(" "), + _vm.data.children + ? _vm._l(_vm.data.children, function(formData, keyForm) { + return _c( + "v-flex", + { + key: keyForm, + attrs: { xs12: "", md12: "", sm12: "" } + }, + [ + _c("h1", [_vm._v(_vm._s(keyForm))]), + _vm._v(" "), + _vm._l(formData, function(childData, keyChild) { + return _c("div", { key: keyChild }, [ + _c( + "div", + [ + _vm._v( + _vm._s(keyChild) + + " : \n " + ), + Array.isArray(childData) + ? _vm._l(childData, function( + data, + dataKey + ) { + return _c("span", { key: dataKey }, [ + _vm._v(_vm._s(data) + ", ") + ]) + }) + : [ + _c("span", [ + _vm._v(_vm._s(childData)) + ]) + ] + ], + 2 + ) + ]) + }) + ], + 2 + ) + }) + : _vm._e() ], - 1 + 2 ), _vm._v(" "), _c("v-divider"), @@ -62364,6 +62495,12 @@ var urls = { return "/TestTypes/".concat(id); }, listTestResult: function listTestResult(page) { + var verified = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (verified) { + return "/TestResults/?verified=".concat(verified, "&page=").concat(page); + } + return "/TestResults?page=" + page; }, editTestResult: function editTestResult(id) { @@ -63006,6 +63143,10 @@ __webpack_require__.r(__webpack_exports__); path: '/test-result/:testResult/edit', name: 'EditTestResult', view: 'TestResult/AddEdit' +}, { + path: '/test-result/NotVerified', + name: 'NotVerifyTestResult', + view: 'TestResult/List' }]); /***/ }), @@ -63217,7 +63358,7 @@ var UserService = { }, auth: { username: "2", - password: "vAhCu2Y4mxfjlr8uTSxpBmjn2rWPIEolnr73ETAE" + password: "r46iu0QJFTrC30H0fEoBbxTGmbJQjjOlSQYFYS7w" } }; _context.prev = 1; @@ -63277,7 +63418,7 @@ var UserService = { }, auth: { username: "2", - password: "vAhCu2Y4mxfjlr8uTSxpBmjn2rWPIEolnr73ETAE" + password: "r46iu0QJFTrC30H0fEoBbxTGmbJQjjOlSQYFYS7w" } }; _context2.prev = 2; @@ -64525,7 +64666,7 @@ module.exports = webpackAsyncContext; /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(/*! D:\Atom\Git\CSSD\resources\js\vue\main.js */"./resources/js/vue/main.js"); +module.exports = __webpack_require__(/*! /home/saeid/Projects/Git/CSSD/resources/js/vue/main.js */"./resources/js/vue/main.js"); /***/ }) diff --git a/resources/js/vue/components/modal/testresult/Show.vue b/resources/js/vue/components/modal/testresult/Show.vue index 179945a4..74d9a449 100644 --- a/resources/js/vue/components/modal/testresult/Show.vue +++ b/resources/js/vue/components/modal/testresult/Show.vue @@ -3,9 +3,39 @@ - - + +
Auto Clave Id : {{ data.autoclave_id }}
+ +
Result : {{ data.result }}
+
+ +
verify : {{ data.verified }}
+
+ +
Register User : {{ data.user.name }}
+
+ + +
@@ -41,7 +71,7 @@ export default { this.data = this.getModalProperties.result.data.data; }, computed: { - ...mapGetters("modal", ["getModalProperties"]) + ...mapGetters("modal", ["getModalProperties"]), } }; \ No newline at end of file diff --git a/resources/js/vue/config/urls.js b/resources/js/vue/config/urls.js index 47869e3e..4a5476fa 100644 --- a/resources/js/vue/config/urls.js +++ b/resources/js/vue/config/urls.js @@ -23,7 +23,10 @@ const urls = { updateTestType : function(id) { return `/TestTypes/${id}`; }, - listTestResult : function(page) { + listTestResult : function(page, verified = null) { + if (verified) { + return `/TestResults/?verified=${verified}&page=${page}`; + } return "/TestResults?page=" + page; }, editTestResult : function(id) { diff --git a/resources/js/vue/router/paths.js b/resources/js/vue/router/paths.js index b8b05cca..387d83d9 100644 --- a/resources/js/vue/router/paths.js +++ b/resources/js/vue/router/paths.js @@ -101,4 +101,9 @@ export default [ name: 'EditTestResult', view: 'TestResult/AddEdit' }, + { + path: '/test-result/NotVerified', + name: 'NotVerifyTestResult', + view: 'TestResult/List' + }, ] diff --git a/resources/js/vue/views/Dashboard.vue b/resources/js/vue/views/Dashboard.vue index 6d99bbd4..034c5e23 100644 --- a/resources/js/vue/views/Dashboard.vue +++ b/resources/js/vue/views/Dashboard.vue @@ -33,7 +33,7 @@ export default { {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'}, {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'}, {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'}, - {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: 'SubmitTestResult'},aligntext:'text-md-center',alignimg:'text-md-left',column:'xs12 md12 sm12'}, + {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'}, {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'}, ] } diff --git a/resources/js/vue/views/TestResult/AddEdit.vue b/resources/js/vue/views/TestResult/AddEdit.vue index e0a75082..0eea0946 100644 --- a/resources/js/vue/views/TestResult/AddEdit.vue +++ b/resources/js/vue/views/TestResult/AddEdit.vue @@ -2,7 +2,13 @@ - + + +
+ +
+
+ + +
+
- +

{{ item.name }}

{{ item.name }}

- +
+ + { + vm.image = e.target.result; + }; + + reader.readAsDataURL(file); + }, + removeImage: function (e) { + this.image = null; + }, + }, + watch:{ + image(img) { + this.formData.img = img; + } } }; \ No newline at end of file diff --git a/resources/js/vue/views/TestResult/List.vue b/resources/js/vue/views/TestResult/List.vue index c6e6009d..687fe4c8 100644 --- a/resources/js/vue/views/TestResult/List.vue +++ b/resources/js/vue/views/TestResult/List.vue @@ -129,12 +129,17 @@ export default { lastPage: 1 }), created() { - this.load(); + if(this.$route.name == 'NotVerifyTestResult') { + this.load(1, 'NotVerified'); + } else { + this.load(); + } + }, methods: { ...mapMutations("modal", ["changeCurrentModal"]), - async load(page = 1) { - const result = await ApiService.get(urls.listTestResult(page)); + async load(page = 1, verified = null) { + const result = await ApiService.get(urls.listTestResult(page, verified)); if (result && result.status == 200) { this.items = result.data.data.data; this.currentPage = result.data.data.current_page; diff --git a/routes/api.php b/routes/api.php index 74019a0b..897a0b58 100644 --- a/routes/api.php +++ b/routes/api.php @@ -16,22 +16,24 @@ Route::group(['namespace' => 'Api'],function () { Route::post('/login', 'Auth\LoginController@login')->name('login'); Route::post('/logout', 'Auth\LoginController@logout')->name('logout')->middleware('auth:api'); Route::post('/register', 'Auth\RegisterController@register')->name('register'); - Route::post('/password/phone', 'Auth\ForgotPasswordController@sendDisposablePassword'); + Route::post('/password/phone', 'Auth\ForgotPasswordController@sendDisposablePassword')->name('password.email'); Route::post('/password/verifyCode', 'Auth\ForgotPasswordController@checkDisposablePassword'); - Route::post('/password/reset', 'Auth\ResetPasswordController@reset')->name('password.reset')->middleware('auth:api'); + Route::post('/password/reset', 'Auth\ResetPasswordController@reset')->name('password.reset'); }); -Route::get('TestTypes/ListNames', 'TestTypeController@listNames'); -Route::resource('TestTypes', 'TestTypeController'); -Route::resource('TestResults', 'TestResultController'); -Route::resource('MedicalCenters', 'MedicalCenterController'); -Route::post('/GetInputs', 'TestTypeController@getInputs'); +Route::middleware('auth:api')->group(function () { + Route::post('/TestResults/Verify/{TestResult}', 'TestResultController@verifyTestResult'); + Route::get('TestTypes/ListNames', 'TestTypeController@listNames'); + Route::resource('TestTypes', 'TestTypeController'); + Route::resource('TestResults', 'TestResultController'); + Route::resource('MedicalCenters', 'MedicalCenterController'); + Route::post('/GetInputs', 'TestTypeController@getInputs'); -Route::get('/GetInfo', 'UserController@getInfo')->middleware('auth:api'); -Route::get('Users/MedicalCenter/{MedicalCenter}', 'UserController@getByMedicalCenter')->middleware('auth:api'); -Route::post('Users/ChangeStatus/{User}', 'UserController@changeStatus')->middleware('auth:api'); -Route::post('Users/ChangeRole/{User}', 'UserController@changeRole')->middleware('auth:api'); -Route::post('UpdateInfo', 'UserController@updateInfo')->middleware('auth:api'); -Route::resource('Users', 'UserController'); -Route::post('/TestResults/Verify/{TestResult}', 'TestResultController@verifyTestResult'); + Route::get('/GetInfo', 'UserController@getInfo'); + Route::get('Users/MedicalCenter/{MedicalCenter}', 'UserController@getByMedicalCenter'); + Route::post('Users/ChangeStatus/{User}', 'UserController@changeStatus'); + Route::post('Users/ChangeRole/{User}', 'UserController@changeRole'); + Route::post('UpdateInfo', 'UserController@updateInfo'); + Route::resource('Users', 'UserController'); +});