mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 19:51:07 +03:30
saeid
This commit is contained in:
@@ -8,6 +8,10 @@ use App\Http\Requests\StoreTestResultRequest;
|
||||
use App\TestResult;
|
||||
use App\InputValue;
|
||||
use App\Input;
|
||||
use App\Gallery;
|
||||
use App\Uploadable;
|
||||
use Intervention\Image\ImageManagerStatic as Image;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class TestResultController extends Controller
|
||||
{
|
||||
@@ -53,7 +57,7 @@ class TestResultController extends Controller
|
||||
|
||||
$Inputs = Input::with('options','children','children.children')->whereNull('parent_id')->where('test_type_id',$request->test_type_id)->get();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////--2
|
||||
///////////////////////////////////////////////////////////////////////////Inputs
|
||||
foreach ($Inputs as $Input) {
|
||||
if ($Input['type'] != 'Form') {
|
||||
$Value = $TestResultInfo[$Input->name];
|
||||
@@ -61,21 +65,18 @@ class TestResultController extends Controller
|
||||
if ($Input['type'] == 'Checkbox' || $Input['type'] == 'Select' ) {
|
||||
|
||||
foreach ($Value as $Option) {
|
||||
// dd($Option);
|
||||
$InputValueObj = InputValue::create(['test_result_id' => $TestResultObj->id, 'input_id' => $Input->id, 'option_id' => $Option]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$InputValueObj = InputValue::create(['test_result_id' => $TestResultObj->id, 'input_id' => $Input->id, 'value' => $Value]);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
foreach ($Input->children as $InputChild) {
|
||||
$Value = $TestResultInfo[$InputChild->name];
|
||||
|
||||
if ($InputChild['type'] == 'Checkbox' || $InputChild['type'] == 'Select') {
|
||||
// dd($InputChild['type']);
|
||||
foreach ($Value as $Option) {
|
||||
$InputValueObj = InputValue::create(['test_result_id' => $TestResultObj->id, 'input_id' => $InputChild->id, 'option_id' => $Option]);
|
||||
}
|
||||
@@ -85,42 +86,27 @@ class TestResultController extends Controller
|
||||
}
|
||||
|
||||
}
|
||||
//-------------------------------------------------------
|
||||
// $this->CreateChildFormValue2($Input,$TestResultObj,$TestResultInfo);
|
||||
// foreach ($Input->children as $InputChild) {
|
||||
//
|
||||
// if ($InputChild['type'] != 'Form') {
|
||||
// $Value = $TestResultInfo[$Input->name][$InputChild->name];
|
||||
// $InputValueObj = InputValue::create(['test_result_id' => $TestResultObj->id , 'input_id' => $InputChild->id , 'value' => $Value]);
|
||||
// }
|
||||
// else {
|
||||
//
|
||||
// foreach ($InputChild->children as $InputChild2) {
|
||||
//
|
||||
// if ($InputChild2['type'] != 'Form') {
|
||||
// $Value = $TestResultInfo[$Input->name][$InputChild->name][$InputChild2->name];
|
||||
// $InputValueObj = InputValue::create(['test_result_id' => $TestResultObj->id , 'input_id' => $InputChild2->id , 'value' => $Value]);
|
||||
// }
|
||||
// else {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//---------------------------------------------------------
|
||||
|
||||
}
|
||||
}
|
||||
// if ($request->hasFile('image')) {
|
||||
// $image = $request->file('image');
|
||||
// $input['imagename'] = time().$image->getClientOriginalExtension();
|
||||
// $path = '/Uploads'.'/'.$TestResultObj->id;
|
||||
// Storage::disk('public')->makeDirectory($TestResultObj->id);
|
||||
// $image->move($path, $input['imagename']);
|
||||
// }
|
||||
///////////////////////////////////////////////////////////////////////////Inputs
|
||||
///////////////////////////////////////////////////////////////////////////Image
|
||||
if ($request->hasFile('img')) {
|
||||
|
||||
$Image = $request->file('img');
|
||||
$InterventionImage = Image::make($Image);
|
||||
$Mime = explode('/', $InterventionImage->mime());
|
||||
|
||||
$ImageName = time().'.'.$Mime[1];
|
||||
$Path = 'uploads'.'/TestResults'.'/'.$TestResultObj->id .'/'.$ImageName;
|
||||
|
||||
Storage::disk('public')->makeDirectory('TestResults'.'/'.$TestResultObj->id);
|
||||
$InterventionImage->save(public_path($Path));
|
||||
|
||||
$GalleryObj = Gallery::create(['user_id' => auth('api')->user()->id, 'path' => $Path]);
|
||||
$Uploadable = Uploadable::create(['uploadable_id' => $TestResultObj->id, 'uploadable_type' => 'App\TestResult', 'gallery_id' => $GalleryObj->id, 'image_role' => 'TitleImage']);
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////Image
|
||||
|
||||
});
|
||||
} catch (\Exception $e) {
|
||||
@@ -130,22 +116,59 @@ class TestResultController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function show(TestResult $TestResult)
|
||||
public function show($id)
|
||||
{
|
||||
$TestResult = TestResult::with('input_values', 'user')->select('result', 'verified', 'autoclave_id','user_id','id')->findOrFail($id);
|
||||
$options = [];
|
||||
foreach ($TestResult->input_values as $key => $value) {
|
||||
$input = $value->input;
|
||||
if ($input->type == 'Checkbox' || $input->type == 'Select') {
|
||||
$input_options = InputValue::where('test_result_id', $TestResult->id)->where('input_id', $input->id)->get()->pluck('option_id')->toArray();
|
||||
$TestResult[$input->name] = $input_options;
|
||||
|
||||
if ($input->parent_id != null && $input->parent['type'] == 'Form') {
|
||||
//----------------------------------------------------------------------FormType
|
||||
if ($input->type == 'Checkbox' || $input->type == 'Select') {
|
||||
$input_options = InputValue::with('option')->where('test_result_id', $TestResult->id)->where('input_id', $input->id)->get();
|
||||
$options = [];
|
||||
foreach ($input_options as $input_option) {
|
||||
$options[] = $input_option->option->title;
|
||||
$input_values[$input->name] = $options;
|
||||
}
|
||||
|
||||
$children[$input->parent->name] = $input_values;
|
||||
$TestResult['children'] = $children;
|
||||
}
|
||||
else {
|
||||
$input_values = [$input->name => $value->value];
|
||||
$children[$input->parent->name] = $input_values;
|
||||
$TestResult['children'] = $children;
|
||||
}
|
||||
//-----------------------------------------------------------------------FormType
|
||||
}
|
||||
else {
|
||||
$TestResult[$input->name] = $value->value;
|
||||
//-----------------------------------------------------------------------Anothertype
|
||||
if ($input->type == 'Checkbox' || $input->type == 'Select') {
|
||||
$input_options = InputValue::with('option')->where('test_result_id', $TestResult->id)->where('input_id', $input->id)->get();
|
||||
$options = [];
|
||||
foreach ($input_options as $input_option) {
|
||||
$options[] = $input_option->option->title;
|
||||
}
|
||||
|
||||
$values[$input->name] = $options;
|
||||
$TestResult['options'] = $values;
|
||||
}
|
||||
else {
|
||||
$inputs[$input->name] = $value->value;
|
||||
$TestResult['inputs'] = $inputs;
|
||||
}
|
||||
//-----------------------------------------------------------------------Anothertype
|
||||
}
|
||||
}
|
||||
|
||||
if (count($TestResult->TitleImage)) {
|
||||
$TestResult['imagePath'] = $TestResult->TitleImage[0]->path;
|
||||
}
|
||||
return \MessageResponse::data($TestResult);
|
||||
}
|
||||
|
||||
//Todo:: pass Inputs
|
||||
public function edit(TestResult $TestResult)
|
||||
{
|
||||
foreach ($TestResult->input_values as $key => $value) {
|
||||
@@ -161,6 +184,14 @@ class TestResultController extends Controller
|
||||
return \MessageResponse::data($TestResult);
|
||||
}
|
||||
|
||||
public static function storage_path($path)
|
||||
{
|
||||
if (starts_with($path, 'uploads/')) {
|
||||
$path = substr($path, 8);
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
|
||||
public function update(StoreTestResultRequest $request, TestResult $TestResult)
|
||||
{
|
||||
$TestResultData = [
|
||||
@@ -173,51 +204,94 @@ class TestResultController extends Controller
|
||||
$TestResult->update($TestResultData);
|
||||
$TestResultInfo = $request->all();
|
||||
|
||||
$Inputs = Input::with('options','children','children.children')->whereNull('parent_id')->where('test_type_id',$request->test_type_id)->get();
|
||||
$Inputs = Input::with('options', 'children', 'children.children')->whereNull('parent_id')->where('test_type_id',$request->test_type_id)->get();
|
||||
|
||||
foreach ($Inputs as $Input) {
|
||||
if ($Input['type'] != 'Form') {
|
||||
$Value = $TestResultInfo[$Input->name];
|
||||
|
||||
if ($Input['type'] == 'Checkbox' || $Input['type'] == 'Select' ) {
|
||||
|
||||
$InputOptions = InputValue::where('test_result_id', $TestResult->id)->where('input_id', $Input->id)->get()->each->delete();
|
||||
|
||||
foreach ($Value as $Option) {
|
||||
// $InputValueObj = InputValue::create(['test_result_id' => $TestResultObj->id, 'input_id' => $Input->id, 'option_id' => $Option]);
|
||||
$InputValueObj = InputValue::create(['test_result_id' => $TestResult->id, 'input_id' => $Input->id, 'option_id' => $Option]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$InputValueObj = InputValue::where('test_result_id',$TestResult->id)->where('input_id', $Input['id'])->update(['value' => $Value]);
|
||||
$InputValueObj = InputValue::where('test_result_id', $TestResult->id)->where('input_id', $Input['id'])->update(['value' => $Value]);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
foreach ($Input->children as $InputChild) {
|
||||
$Value = $TestResultInfo[$InputChild->name];
|
||||
|
||||
if ($InputChild['type'] == 'Checkbox' || $InputChild['type'] == 'Select') {
|
||||
$Value = json_encode($Value);
|
||||
$InputOptions = InputValue::where('test_result_id', $TestResult->id)->where('input_id', $InputChild->id)->get()->each->delete();
|
||||
|
||||
foreach ($Value as $Option) {
|
||||
$InputValueObj = InputValue::create(['test_result_id' => $TestResult->id, 'input_id' => $InputChild->id, 'option_id' => $Option]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$InputValueObj = InputValue::where('test_result_id',$TestResult->id)->where('input_id', $InputChild['id'])->update(['value' => $Value]);
|
||||
$InputValueObj = InputValue::where('test_result_id', $TestResult->id)->where('input_id', $InputChild['id'])->update(['value' => $Value]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return \MessageResponse::success(null,trans('messages.update'));
|
||||
//////////////////////////////////////////////////////////////////Image
|
||||
$image = '';
|
||||
if (count($TestResult->TitleImage))
|
||||
$image = $TestResult->TitleImage[0];
|
||||
|
||||
if ($request->hasFile('img')) {
|
||||
|
||||
$Image = $request->file('img');
|
||||
$InterventionImage = Image::make($Image);
|
||||
$Mime = explode('/', $InterventionImage->mime());
|
||||
|
||||
$ImageName = time().'.'.$Mime[1];
|
||||
$Path = 'uploads'.'/TestResults'.'/'.$TestResult->id .'/'.$ImageName;
|
||||
|
||||
Storage::disk('public')->makeDirectory('TestResults'.'/'.$TestResult->id);
|
||||
$InterventionImage->save(public_path($Path));
|
||||
|
||||
|
||||
if ($image !== ''){
|
||||
Storage::disk('public')->delete(static::storage_path($image->path));
|
||||
Uploadable::where('gallery_id', $image->id)->where('uploadable_id', $TestResult->id)->where('uploadable_type', get_class($TestResult))->delete();
|
||||
|
||||
//--------------------------------------------------------
|
||||
$GalleryObj = Gallery::where('id', $image->id)->update(['path' => $Path]);
|
||||
$Uploadable = Uploadable::create(['uploadable_id' => $TestResult->id, 'uploadable_type' => get_class($TestResult), 'gallery_id' => $image->id, 'image_role' => 'TitleImage']);
|
||||
//--------------------------------------------------------
|
||||
|
||||
}
|
||||
else {
|
||||
//--------------------------------------------------------
|
||||
$GalleryObj = Gallery::create(['user_id' => auth('api')->user()->id, 'path' => $Path]);
|
||||
$Uploadable = Uploadable::create(['uploadable_id' => $TestResult->id, 'uploadable_type' => 'App\TestResult', 'gallery_id' => $GalleryObj->id, 'image_role' => 'TitleImage']);
|
||||
//--------------------------------------------------------
|
||||
}
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////Image
|
||||
|
||||
return \MessageResponse::success(null,trans('messages.update'));
|
||||
}
|
||||
|
||||
public function destroy(TestResult $TestResult)
|
||||
{
|
||||
if (auth('api')->user()->can('delete', $TestResult)) {
|
||||
return \MessageResponse::error(trans('messages.failed'));
|
||||
if (!auth('api')->user()->can('delete', $TestResult)) {
|
||||
return \MessageResponse::error(trans('messages.access_denied'));
|
||||
}
|
||||
$TestResult->delete();
|
||||
return \MessageResponse::success(null, trans('messages.failed'));
|
||||
return \MessageResponse::success(null, trans('messages.success'));
|
||||
}
|
||||
|
||||
public function verifyTestResult(TestResult $TestResult)
|
||||
{
|
||||
if (auth('api')->user()->can('verifyTestResult', $TestResult)) {
|
||||
return \MessageResponse::error(trans('messages.failed'));
|
||||
if (!auth('api')->user()->can('verifyTestResult', $TestResult)) {
|
||||
return \MessageResponse::error(trans('messages.access_denied'));
|
||||
}
|
||||
if ($TestResult->verified == 'Verified') {
|
||||
$TestResult->verified = 'NotVerified';
|
||||
@@ -225,7 +299,7 @@ class TestResultController extends Controller
|
||||
$TestResult->verified = 'Verified';
|
||||
}
|
||||
$TestResult->save();
|
||||
return \MessageResponse::data($TestResult);
|
||||
return \MessageResponse::success(trans('messages.success'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -328,6 +328,9 @@ class TestTypeController extends Controller
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
public function getInputs(Request $request)
|
||||
{
|
||||
if (auth('api')->user()->can('getInputs')) {
|
||||
return \MessageResponse::error(trans('messages.failed'));
|
||||
}
|
||||
if($request->test_result_id !== '') {
|
||||
$testTypeId = TestResult::find($request->test_result_id);
|
||||
}
|
||||
@@ -363,11 +366,9 @@ class TestTypeController extends Controller
|
||||
|
||||
public function destroy(TestType $TestType)
|
||||
{
|
||||
// dd($TestType);
|
||||
if (auth('api')->user()->can('delete', $TestType)) {
|
||||
return \MessageResponse::error(trans('messages.failed'));
|
||||
if (!auth('api')->user()->can('delete', $TestType)) {
|
||||
return \MessageResponse::error(trans('messages.access_denied'));
|
||||
}
|
||||
// dd($TestType);
|
||||
$TestType->delete();
|
||||
return \MessageResponse::success(trans('messages.success'));
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class TestResultPolicy
|
||||
}␍
|
||||
public function verifyTestResult(User $User, TestResult $TestResult)␍
|
||||
{␍
|
||||
if($User->hasRole('Supervisor'))␍
|
||||
// if($User->hasRole('Supervisor'))␍
|
||||
return true;␍
|
||||
}␍
|
||||
}␍
|
||||
|
||||
@@ -26,4 +26,9 @@ class TestTypePolicy
|
||||
// if($User->hasRole('Admin'))␍
|
||||
return true;␍
|
||||
}␍
|
||||
public function getInputs(User $User)␍
|
||||
{␍
|
||||
// if($User->hasRole('Admin'))␍
|
||||
return true;␍
|
||||
}␍
|
||||
}␍
|
||||
|
||||
@@ -19,4 +19,8 @@ class TestResult extends Model
|
||||
{
|
||||
return $this->hasMany('App\InputValue');
|
||||
}
|
||||
public function TitleImage()
|
||||
{
|
||||
return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage');
|
||||
}
|
||||
}
|
||||
|
||||
+5
-2
@@ -3,12 +3,15 @@
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class TestType extends Model
|
||||
{
|
||||
public $fillable = ['name','unique_code','user_id'];
|
||||
protected $softDelete = true;
|
||||
use SoftDeletes;
|
||||
|
||||
public $fillable = ['name','unique_code','user_id'];
|
||||
// protected $softDelete = true;
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\User');
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Uploadable extends Model
|
||||
{
|
||||
|
||||
protected $fillable = ['uploadable_id', 'uploadable_type', 'gallery_id'];
|
||||
protected $fillable = ['uploadable_id', 'uploadable_type', 'gallery_id', 'image_role'];
|
||||
public $timestamps = false;
|
||||
|
||||
public function gallery()
|
||||
|
||||
Vendored
+103
-22
@@ -13,12 +13,17 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/services */ "./resources/js/vue/services/index.js");
|
||||
/* harmony import */ var _config_urls__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/config/urls */ "./resources/js/vue/config/urls.js");
|
||||
/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm.js");
|
||||
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
||||
|
||||
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
|
||||
|
||||
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; }
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -106,13 +111,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
|
||||
/* harmony default export */ __webpack_exports__["default"] = ({
|
||||
@@ -152,7 +151,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
||||
created: function created() {
|
||||
this.load();
|
||||
},
|
||||
methods: {
|
||||
methods: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_3__["mapMutations"])("modal", ["changeCurrentModal"]), {
|
||||
load: function () {
|
||||
var _load = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
@@ -191,21 +190,59 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
||||
|
||||
return load;
|
||||
}(),
|
||||
remove: function () {
|
||||
var _remove = _asyncToGenerator(
|
||||
show: function () {
|
||||
var _show = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(testResultId) {
|
||||
var result, key;
|
||||
var result;
|
||||
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
_context2.next = 2;
|
||||
return _services__WEBPACK_IMPORTED_MODULE_1__["ApiService"].delete(_config_urls__WEBPACK_IMPORTED_MODULE_2__["urls"].removeTestResult(testResultId));
|
||||
return _services__WEBPACK_IMPORTED_MODULE_1__["ApiService"].get(_config_urls__WEBPACK_IMPORTED_MODULE_2__["urls"].showTestResult(testResultId));
|
||||
|
||||
case 2:
|
||||
result = _context2.sent;
|
||||
|
||||
if (result && result.status == 200) {
|
||||
this.changeCurrentModal({
|
||||
modal: "modal-testresult-show",
|
||||
properties: {
|
||||
result: result
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
case 4:
|
||||
case "end":
|
||||
return _context2.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2, this);
|
||||
}));
|
||||
|
||||
function show(_x) {
|
||||
return _show.apply(this, arguments);
|
||||
}
|
||||
|
||||
return show;
|
||||
}(),
|
||||
remove: function () {
|
||||
var _remove = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(testResultId) {
|
||||
var result, key;
|
||||
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
switch (_context3.prev = _context3.next) {
|
||||
case 0:
|
||||
_context3.next = 2;
|
||||
return _services__WEBPACK_IMPORTED_MODULE_1__["ApiService"].delete(_config_urls__WEBPACK_IMPORTED_MODULE_2__["urls"].removeTestResult(testResultId));
|
||||
|
||||
case 2:
|
||||
result = _context3.sent;
|
||||
|
||||
if (result && result.status == 200) {
|
||||
for (key in this.items) {
|
||||
if (this.items.hasOwnProperty(key) && this.items[key].id == testResultId) {
|
||||
@@ -216,19 +253,19 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
||||
|
||||
case 4:
|
||||
case "end":
|
||||
return _context2.stop();
|
||||
return _context3.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2, this);
|
||||
}, _callee3, this);
|
||||
}));
|
||||
|
||||
function remove(_x) {
|
||||
function remove(_x2) {
|
||||
return _remove.apply(this, arguments);
|
||||
}
|
||||
|
||||
return remove;
|
||||
}()
|
||||
},
|
||||
}),
|
||||
watch: {
|
||||
currentPage: function currentPage(page) {
|
||||
this.load(page);
|
||||
@@ -333,6 +370,45 @@ var render = function() {
|
||||
)
|
||||
],
|
||||
1
|
||||
),
|
||||
_vm._v(" "),
|
||||
_c("v-spacer"),
|
||||
_vm._v(" "),
|
||||
_c(
|
||||
"v-flex",
|
||||
{
|
||||
staticClass: "text-xs-right",
|
||||
attrs: { xs12: "", md2: "", sm2: "" }
|
||||
},
|
||||
[
|
||||
_c(
|
||||
"router-link",
|
||||
{ attrs: { to: { name: "SubmitTestResult" } } },
|
||||
[
|
||||
_c(
|
||||
"v-btn",
|
||||
{
|
||||
staticClass:
|
||||
"WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black"
|
||||
},
|
||||
[
|
||||
_c(
|
||||
"v-icon",
|
||||
{ staticClass: "black--text mr-2 caption" },
|
||||
[_vm._v("fas fa-plus")]
|
||||
),
|
||||
_vm._v(" "),
|
||||
_c("span", { staticClass: "black--text" }, [
|
||||
_vm._v("Add")
|
||||
])
|
||||
],
|
||||
1
|
||||
)
|
||||
],
|
||||
1
|
||||
)
|
||||
],
|
||||
1
|
||||
)
|
||||
],
|
||||
1
|
||||
@@ -418,7 +494,12 @@ var render = function() {
|
||||
"v-btn",
|
||||
{
|
||||
staticClass: "mr-2",
|
||||
attrs: { color: "cyan" }
|
||||
attrs: { color: "cyan" },
|
||||
on: {
|
||||
click: function($event) {
|
||||
return _vm.show(item.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
[
|
||||
_c(
|
||||
@@ -473,8 +554,8 @@ var render = function() {
|
||||
_c(
|
||||
"v-btn",
|
||||
{
|
||||
staticClass: "mr-2",
|
||||
attrs: { color: "black" },
|
||||
staticClass: "WM-ActionButton",
|
||||
attrs: { color: "pink" },
|
||||
on: {
|
||||
click: function($event) {
|
||||
return _vm.remove(item.id)
|
||||
@@ -486,12 +567,12 @@ var render = function() {
|
||||
"v-icon",
|
||||
{
|
||||
staticClass:
|
||||
"white--text mr-1 caption"
|
||||
"white--text mr-2 caption"
|
||||
},
|
||||
[_vm._v("fas fa-folder")]
|
||||
[_vm._v("fas fa-times")]
|
||||
),
|
||||
_vm._v(" "),
|
||||
_c("span", [_vm._v("Archive")])
|
||||
_c("span", [_vm._v("Remove")])
|
||||
],
|
||||
1
|
||||
)
|
||||
|
||||
Vendored
+8
-6
@@ -95,6 +95,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
/* harmony default export */ __webpack_exports__["default"] = ({
|
||||
@@ -225,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] {\r\n padding: 8px 22px;\n}\r\n", ""]);
|
||||
|
||||
|
||||
|
||||
@@ -492,8 +494,8 @@ var render = function() {
|
||||
_c(
|
||||
"v-btn",
|
||||
{
|
||||
staticClass: "WM-ActionButton",
|
||||
attrs: { color: "pink" },
|
||||
staticClass: "mr-2",
|
||||
attrs: { color: "black" },
|
||||
on: {
|
||||
click: function($event) {
|
||||
return _vm.remove(item.id)
|
||||
@@ -504,12 +506,12 @@ var render = function() {
|
||||
_c(
|
||||
"v-icon",
|
||||
{
|
||||
staticClass: "white--text mr-2 caption"
|
||||
staticClass: "white--text mr-1 caption"
|
||||
},
|
||||
[_vm._v("fas fa-times")]
|
||||
[_vm._v("fas fa-folder")]
|
||||
),
|
||||
_vm._v(" "),
|
||||
_c("span", [_vm._v("Remove")])
|
||||
_c("span", [_vm._v("Archive")])
|
||||
],
|
||||
1
|
||||
)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"/vue/js/app.js": "/vue/js/app.js?id=753975375c400e12c93b"
|
||||
"/vue/js/app.js": "/vue/js/app.js?id=571c3030afcd24e8d145"
|
||||
}
|
||||
|
||||
Vendored
+210
@@ -3445,6 +3445,67 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/vue/components/modal/testresult/Show.vue?vue&type=script&lang=js&":
|
||||
/*!************************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/vue/components/modal/testresult/Show.vue?vue&type=script&lang=js& ***!
|
||||
\************************************************************************************************************************************************************************************/
|
||||
/*! exports provided: default */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm.js");
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
|
||||
|
||||
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; }
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// import { ApiService } from "@/services";
|
||||
// import { urls } from "@/config/urls";
|
||||
|
||||
/* harmony default export */ __webpack_exports__["default"] = ({
|
||||
data: function data() {
|
||||
return {
|
||||
data: {}
|
||||
};
|
||||
},
|
||||
methods: {// ...mapMutations("modal", ["closeModal", "setResultModal"]),
|
||||
// async changeRole() {
|
||||
// const result = await ApiService.post(
|
||||
// urls.changeRoleUser(this.getModalProperties.user.id),
|
||||
// this.data
|
||||
// );
|
||||
// if (result && result.status == 200) {
|
||||
// this.setResultModal(result.data.data);
|
||||
// this.closeModal();
|
||||
// }
|
||||
// }
|
||||
},
|
||||
created: function created() {
|
||||
this.data = this.getModalProperties.result.data.data;
|
||||
},
|
||||
computed: _objectSpread({}, Object(vuex__WEBPACK_IMPORTED_MODULE_0__["mapGetters"])("modal", ["getModalProperties"]))
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/vue/components/modal/user/Role.vue?vue&type=script&lang=js&":
|
||||
/*!******************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/vue/components/modal/user/Role.vue?vue&type=script&lang=js& ***!
|
||||
@@ -17299,6 +17360,82 @@ render._withStripped = true
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/vue/components/modal/testresult/Show.vue?vue&type=template&id=9160f06e&":
|
||||
/*!****************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/vue/components/modal/testresult/Show.vue?vue&type=template&id=9160f06e& ***!
|
||||
\****************************************************************************************************************************************************************************************************************************/
|
||||
/*! exports provided: render, staticRenderFns */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
|
||||
var render = function() {
|
||||
var _vm = this
|
||||
var _h = _vm.$createElement
|
||||
var _c = _vm._self._c || _h
|
||||
return _c(
|
||||
"div",
|
||||
[
|
||||
_c(
|
||||
"v-container",
|
||||
{ attrs: { fluid: "" } },
|
||||
[
|
||||
_c(
|
||||
"material-card",
|
||||
{ attrs: { color: "black", title: "Show Test Resualt", text: "" } },
|
||||
[
|
||||
_c(
|
||||
"v-layout",
|
||||
{
|
||||
staticClass: "my-3",
|
||||
attrs: { "align-center": "", wrap: "" }
|
||||
},
|
||||
[
|
||||
_c(
|
||||
"v-flex",
|
||||
{ attrs: { xs12: "", md2: "", sm2: "" } },
|
||||
[
|
||||
_c("v-text-field", {
|
||||
staticClass: "pa-2",
|
||||
attrs: { label: "Name", color: "black" }
|
||||
})
|
||||
],
|
||||
1
|
||||
)
|
||||
],
|
||||
1
|
||||
),
|
||||
_vm._v(" "),
|
||||
_c("v-divider"),
|
||||
_vm._v(" "),
|
||||
_c(
|
||||
"v-layout",
|
||||
{
|
||||
staticClass: "my-3",
|
||||
attrs: { "align-center": "", wrap: "" }
|
||||
},
|
||||
[_c("v-flex", { attrs: { md12: "" } })],
|
||||
1
|
||||
)
|
||||
],
|
||||
1
|
||||
)
|
||||
],
|
||||
1
|
||||
)
|
||||
],
|
||||
1
|
||||
)
|
||||
}
|
||||
var staticRenderFns = []
|
||||
render._withStripped = true
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/vue/components/modal/user/Role.vue?vue&type=template&id=f7c30ab4&":
|
||||
@@ -60764,6 +60901,7 @@ var map = {
|
||||
"./modal/Base.vue": "./resources/js/vue/components/modal/Base.vue",
|
||||
"./modal/auth/ChangePassword.vue": "./resources/js/vue/components/modal/auth/ChangePassword.vue",
|
||||
"./modal/auth/VerifyCode.vue": "./resources/js/vue/components/modal/auth/VerifyCode.vue",
|
||||
"./modal/testresult/Show.vue": "./resources/js/vue/components/modal/testresult/Show.vue",
|
||||
"./modal/user/Role.vue": "./resources/js/vue/components/modal/user/Role.vue"
|
||||
};
|
||||
|
||||
@@ -62050,6 +62188,75 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./resources/js/vue/components/modal/testresult/Show.vue":
|
||||
/*!***************************************************************!*\
|
||||
!*** ./resources/js/vue/components/modal/testresult/Show.vue ***!
|
||||
\***************************************************************/
|
||||
/*! exports provided: default */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _Show_vue_vue_type_template_id_9160f06e___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Show.vue?vue&type=template&id=9160f06e& */ "./resources/js/vue/components/modal/testresult/Show.vue?vue&type=template&id=9160f06e&");
|
||||
/* harmony import */ var _Show_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Show.vue?vue&type=script&lang=js& */ "./resources/js/vue/components/modal/testresult/Show.vue?vue&type=script&lang=js&");
|
||||
/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* normalize component */
|
||||
|
||||
var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
|
||||
_Show_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
|
||||
_Show_vue_vue_type_template_id_9160f06e___WEBPACK_IMPORTED_MODULE_0__["render"],
|
||||
_Show_vue_vue_type_template_id_9160f06e___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
|
||||
)
|
||||
|
||||
/* hot reload */
|
||||
if (false) { var api; }
|
||||
component.options.__file = "resources/js/vue/components/modal/testresult/Show.vue"
|
||||
/* harmony default export */ __webpack_exports__["default"] = (component.exports);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./resources/js/vue/components/modal/testresult/Show.vue?vue&type=script&lang=js&":
|
||||
/*!****************************************************************************************!*\
|
||||
!*** ./resources/js/vue/components/modal/testresult/Show.vue?vue&type=script&lang=js& ***!
|
||||
\****************************************************************************************/
|
||||
/*! exports provided: default */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Show_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../node_modules/babel-loader/lib??ref--4-0!../../../../../../node_modules/vue-loader/lib??vue-loader-options!./Show.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/vue/components/modal/testresult/Show.vue?vue&type=script&lang=js&");
|
||||
/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Show_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./resources/js/vue/components/modal/testresult/Show.vue?vue&type=template&id=9160f06e&":
|
||||
/*!**********************************************************************************************!*\
|
||||
!*** ./resources/js/vue/components/modal/testresult/Show.vue?vue&type=template&id=9160f06e& ***!
|
||||
\**********************************************************************************************/
|
||||
/*! exports provided: render, staticRenderFns */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Show_vue_vue_type_template_id_9160f06e___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../node_modules/vue-loader/lib??vue-loader-options!./Show.vue?vue&type=template&id=9160f06e& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/vue/components/modal/testresult/Show.vue?vue&type=template&id=9160f06e&");
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Show_vue_vue_type_template_id_9160f06e___WEBPACK_IMPORTED_MODULE_0__["render"]; });
|
||||
|
||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Show_vue_vue_type_template_id_9160f06e___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./resources/js/vue/components/modal/user/Role.vue":
|
||||
@@ -62165,6 +62372,9 @@ var urls = {
|
||||
updateTestResult: function updateTestResult(id) {
|
||||
return "/TestResults/".concat(id);
|
||||
},
|
||||
showTestResult: function showTestResult(id) {
|
||||
return "/TestResults/".concat(id);
|
||||
},
|
||||
removeTestResult: function removeTestResult(id) {
|
||||
return "/TestResults/".concat(id);
|
||||
},
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-container fluid>
|
||||
<material-card class color="black" title="Show Test Resualt" text>
|
||||
<v-layout align-center wrap class="my-3">
|
||||
<v-flex xs12 md2 sm2>
|
||||
<v-text-field class="pa-2" label="Name" color="black"></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout align-center wrap class="my-3">
|
||||
<v-flex md12>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-container>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters, mapMutations } from "vuex";
|
||||
// import { ApiService } from "@/services";
|
||||
// import { urls } from "@/config/urls";
|
||||
export default {
|
||||
data: () => ({
|
||||
data: {},
|
||||
}),
|
||||
methods: {
|
||||
// ...mapMutations("modal", ["closeModal", "setResultModal"]),
|
||||
// async changeRole() {
|
||||
// const result = await ApiService.post(
|
||||
// urls.changeRoleUser(this.getModalProperties.user.id),
|
||||
// this.data
|
||||
// );
|
||||
// if (result && result.status == 200) {
|
||||
// this.setResultModal(result.data.data);
|
||||
// this.closeModal();
|
||||
// }
|
||||
// }
|
||||
},
|
||||
created(){
|
||||
this.data = this.getModalProperties.result.data.data;
|
||||
},
|
||||
computed: {
|
||||
...mapGetters("modal", ["getModalProperties"])
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Vendored
+3
@@ -32,6 +32,9 @@ const urls = {
|
||||
updateTestResult : function(id) {
|
||||
return `/TestResults/${id}`;
|
||||
},
|
||||
showTestResult : function(id) {
|
||||
return `/TestResults/${id}`;
|
||||
},
|
||||
removeTestResult : function(id) {
|
||||
return `/TestResults/${id}`;
|
||||
},
|
||||
|
||||
@@ -1,167 +1,177 @@
|
||||
<template>
|
||||
<div class="">
|
||||
<v-container fluid>
|
||||
<material-card class=""
|
||||
color="black"
|
||||
title="All Test Resualt"
|
||||
text=""
|
||||
>
|
||||
<v-layout align-center wrap class="my-3">
|
||||
<v-flex xs12 md2 sm2>
|
||||
<v-text-field
|
||||
class="pa-2"
|
||||
label="Name"
|
||||
color="black"
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md2 sm2>
|
||||
<v-text-field
|
||||
class="pa-2"
|
||||
label="Date"
|
||||
color="black"
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md2 sm2>
|
||||
<v-text-field
|
||||
class="pa-2"
|
||||
label="Hospital"
|
||||
color="black"
|
||||
>
|
||||
</v-text-field>
|
||||
</v-flex>
|
||||
<v-flex class="" xs12 md2 sm2>
|
||||
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-search</v-icon>
|
||||
<span class="white--text">Filter</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout align-center wrap class="my-3">
|
||||
<v-flex md12>
|
||||
<v-data-table :headers="headers" :items="items" hide-actions>
|
||||
<template slot="headerCell" slot-scope="{ header }">
|
||||
<span
|
||||
class="subheading font-weight-light text-white text--darken-3"
|
||||
v-text="header.text"
|
||||
/>
|
||||
</template>
|
||||
<template slot="items" slot-scope="{ item }">
|
||||
<td class="headline font-weight-light">{{ item.autoclave_id }}</td>
|
||||
<td class="title font-weight-light">{{ item.user.medical_center.name }}</td>
|
||||
<td class="title font-weight-light">{{ item.user.name }}</td>
|
||||
<td class="title font-weight-light">{{ item.result }}</td>
|
||||
<td class="title font-weight-light">{{ item.created_at }}</td>
|
||||
<td class="text-xs-right">
|
||||
<v-btn color="cyan" class="mr-2" >
|
||||
<v-icon class="white--text mr-1 caption">fas fa-pen</v-icon>
|
||||
<span>Show</span>
|
||||
</v-btn>
|
||||
<router-link :to="{name: 'EditTestResult', params: {testResult: item.id}}">
|
||||
<v-btn color="orange" class="mr-2">
|
||||
<v-icon class="white--text mr-1 caption">fas fa-pen</v-icon>
|
||||
<span>Edit</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
<v-btn color="black" class="mr-2" @click="remove(item.id)" >
|
||||
<v-icon class="white--text mr-1 caption">fas fa-folder</v-icon>
|
||||
<span>Archive</span>
|
||||
</v-btn>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<div class="text-xs-center" v-if="lastPage > 1">
|
||||
<v-pagination v-model="currentPage" :length="lastPage" :total-visible="6"></v-pagination>
|
||||
</div>
|
||||
<v-layout row wrap align-center justify-center class="mt-3">
|
||||
<router-link to="/dashboard">
|
||||
<v-btn
|
||||
class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-chevron-left</v-icon>
|
||||
<span class="black--text">Back</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-container>
|
||||
</div>
|
||||
<div class>
|
||||
<v-container fluid>
|
||||
<material-card class color="black" title="All Test Resualt" text>
|
||||
<v-layout align-center wrap class="my-3">
|
||||
<v-flex xs12 md2 sm2>
|
||||
<v-text-field class="pa-2" label="Name" color="black"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md2 sm2>
|
||||
<v-text-field class="pa-2" label="Date" color="black"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md2 sm2>
|
||||
<v-text-field class="pa-2" label="Hospital" color="black"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex class xs12 md2 sm2>
|
||||
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-search</v-icon>
|
||||
<span class="white--text">Filter</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<v-spacer></v-spacer>
|
||||
<v-flex xs12 md2 sm2 class="text-xs-right">
|
||||
<router-link :to="{name: 'SubmitTestResult'}">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-plus</v-icon>
|
||||
<span class="black--text">Add</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<v-layout align-center wrap class="my-3">
|
||||
<v-flex md12>
|
||||
<v-data-table :headers="headers" :items="items" hide-actions>
|
||||
<template slot="headerCell" slot-scope="{ header }">
|
||||
<span
|
||||
class="subheading font-weight-light text-white text--darken-3"
|
||||
v-text="header.text"
|
||||
/>
|
||||
</template>
|
||||
<template slot="items" slot-scope="{ item }">
|
||||
<td class="headline font-weight-light">{{ item.autoclave_id }}</td>
|
||||
<td
|
||||
class="title font-weight-light"
|
||||
>{{ item.user.medical_center.name }}</td>
|
||||
<td class="title font-weight-light">{{ item.user.name }}</td>
|
||||
<td class="title font-weight-light">{{ item.result }}</td>
|
||||
<td class="title font-weight-light">{{ item.created_at }}</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-pen</v-icon>
|
||||
<span>Show</span>
|
||||
</v-btn>
|
||||
<router-link
|
||||
:to="{name: 'EditTestResult', params: {testResult: item.id}}"
|
||||
>
|
||||
<v-btn color="orange" class="mr-2">
|
||||
<v-icon class="white--text mr-1 caption">fas fa-pen</v-icon>
|
||||
<span>Edit</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
<v-btn color="pink" class="WM-ActionButton" @click="remove(item.id)" >
|
||||
<v-icon class="white--text mr-2 caption">fas fa-times</v-icon>
|
||||
<span>Remove</span>
|
||||
</v-btn>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<div class="text-xs-center" v-if="lastPage > 1">
|
||||
<v-pagination v-model="currentPage" :length="lastPage" :total-visible="6"></v-pagination>
|
||||
</div>
|
||||
<v-layout row wrap align-center justify-center class="mt-3">
|
||||
<router-link to="/dashboard">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-chevron-left</v-icon>
|
||||
<span class="black--text">Back</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ApiService } from "@/services";
|
||||
import { urls } from "@/config/urls";
|
||||
|
||||
import { mapMutations } from "vuex";
|
||||
export default {
|
||||
data: () => ({
|
||||
headers: [
|
||||
{
|
||||
sortable: false,
|
||||
text: "AutoClaveId",
|
||||
value: "name"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Hospital",
|
||||
value: "Hospital"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "User",
|
||||
value: "Users"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Result",
|
||||
value: "result"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Date",
|
||||
value: "date"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Action",
|
||||
value: "action",
|
||||
align: "right"
|
||||
}
|
||||
],
|
||||
items:[],
|
||||
currentPage:1,
|
||||
lastPage:1,
|
||||
}),
|
||||
data: () => ({
|
||||
headers: [
|
||||
{
|
||||
sortable: false,
|
||||
text: "AutoClaveId",
|
||||
value: "name"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Hospital",
|
||||
value: "Hospital"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "User",
|
||||
value: "Users"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Result",
|
||||
value: "result"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Date",
|
||||
value: "date"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Action",
|
||||
value: "action",
|
||||
align: "right"
|
||||
}
|
||||
],
|
||||
items: [],
|
||||
currentPage: 1,
|
||||
lastPage: 1
|
||||
}),
|
||||
created() {
|
||||
this.load();
|
||||
},
|
||||
methods: {
|
||||
async load(page = 1) {
|
||||
const result = await ApiService.get(urls.listTestResult(page));
|
||||
if (result && result.status == 200) {
|
||||
this.items = result.data.data.data;
|
||||
this.currentPage = result.data.data.current_page;
|
||||
this.lastPage = result.data.data.last_page;
|
||||
}
|
||||
this.load();
|
||||
},
|
||||
async remove(testResultId) {
|
||||
const result = await ApiService.delete(urls.removeTestResult(testResultId));
|
||||
if (result && result.status == 200) {
|
||||
for (const key in this.items) {
|
||||
if (this.items.hasOwnProperty(key) && this.items[key].id == testResultId) {
|
||||
this.items.splice(key, 1);
|
||||
}
|
||||
methods: {
|
||||
...mapMutations("modal", ["changeCurrentModal"]),
|
||||
async load(page = 1) {
|
||||
const result = await ApiService.get(urls.listTestResult(page));
|
||||
if (result && result.status == 200) {
|
||||
this.items = result.data.data.data;
|
||||
this.currentPage = result.data.data.current_page;
|
||||
this.lastPage = result.data.data.last_page;
|
||||
}
|
||||
},
|
||||
async show(testResultId) {
|
||||
const result = await ApiService.get(
|
||||
urls.showTestResult(testResultId)
|
||||
);
|
||||
if (result && result.status == 200) {
|
||||
this.changeCurrentModal({
|
||||
modal: "modal-testresult-show",
|
||||
properties: { result }
|
||||
});
|
||||
}
|
||||
},
|
||||
async remove(testResultId) {
|
||||
const result = await ApiService.delete(
|
||||
urls.removeTestResult(testResultId)
|
||||
);
|
||||
if (result && result.status == 200) {
|
||||
for (const key in this.items) {
|
||||
if (
|
||||
this.items.hasOwnProperty(key) &&
|
||||
this.items[key].id == testResultId
|
||||
) {
|
||||
this.items.splice(key, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
currentPage(page) {
|
||||
this.load(page);
|
||||
watch: {
|
||||
currentPage(page) {
|
||||
this.load(page);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1,149 +1,154 @@
|
||||
<template>
|
||||
<v-container fluid>
|
||||
<material-card class color="black" title="Medical Centers List" text>
|
||||
<v-layout wrap class="px-5 mb-3">
|
||||
<v-flex xs12 md3 sm3>
|
||||
<v-text-field label="Name" color="black"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md2 sm2 class="text-xs-right">
|
||||
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-search</v-icon>
|
||||
<span class="white--text">Filter</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<v-spacer></v-spacer>
|
||||
<v-flex xs12 md2 sm2 class="text-xs-right">
|
||||
<router-link :to="{name: 'AddTestType'}">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-plus</v-icon>
|
||||
<span class="black--text">Add</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout class="px-4 my-3">
|
||||
<v-divider></v-divider>
|
||||
</v-layout>
|
||||
<v-layout align-center justify-center wrap class="px-5 mt-3">
|
||||
<v-flex md12>
|
||||
<v-data-table :headers="headers" :items="items" hide-actions>
|
||||
<template slot="headerCell" slot-scope="{ header }">
|
||||
<span
|
||||
class="subheading font-weight-light text-white text--darken-3"
|
||||
v-text="header.text"
|
||||
/>
|
||||
</template>
|
||||
<template slot="items" slot-scope="{ item }">
|
||||
<td class="headline font-weight-light">{{ item.name }}</td>
|
||||
<td class="title font-weight-light">{{ item.unique_code }}</td>
|
||||
<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 :to="{name : 'EditTestType', params : {testType : item.id}}">
|
||||
<v-btn color="cyan" class="mr-2 WM-ActionButton">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-pen</v-icon>
|
||||
<span>Edit</span>
|
||||
</v-btn>
|
||||
<v-container fluid>
|
||||
<material-card class color="black" title="Medical Centers List" text>
|
||||
<v-layout wrap class="px-5 mb-3">
|
||||
<v-flex xs12 md3 sm3>
|
||||
<v-text-field label="Name" color="black"></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12 md2 sm2 class="text-xs-right">
|
||||
<v-btn class="WM-CyanBlueGradient-BG" style="padding:10px 60px">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-search</v-icon>
|
||||
<span class="white--text">Filter</span>
|
||||
</v-btn>
|
||||
</v-flex>
|
||||
<v-spacer></v-spacer>
|
||||
<v-flex xs12 md2 sm2 class="text-xs-right">
|
||||
<router-link :to="{name: 'AddTestType'}">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-plus</v-icon>
|
||||
<span class="black--text">Add</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout class="px-4 my-3">
|
||||
<v-divider></v-divider>
|
||||
</v-layout>
|
||||
<v-layout align-center justify-center wrap class="px-5 mt-3">
|
||||
<v-flex md12>
|
||||
<v-data-table :headers="headers" :items="items" hide-actions>
|
||||
<template slot="headerCell" slot-scope="{ header }">
|
||||
<span
|
||||
class="subheading font-weight-light text-white text--darken-3"
|
||||
v-text="header.text"
|
||||
/>
|
||||
</template>
|
||||
<template slot="items" slot-scope="{ item }">
|
||||
<td class="headline font-weight-light">{{ item.name }}</td>
|
||||
<td class="title font-weight-light">{{ item.unique_code }}</td>
|
||||
<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
|
||||
:to="{name : 'EditTestType', params : {testType : item.id}}"
|
||||
>
|
||||
<v-btn color="cyan" class="mr-2 WM-ActionButton">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-pen</v-icon>
|
||||
<span>Edit</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
<v-btn color="orange darken-1">
|
||||
<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-icon class="white--text mr-1 caption">fas fa-folder</v-icon>
|
||||
<span>Archive</span>
|
||||
</v-btn>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<div class="text-xs-center" v-if="lastPage > 1">
|
||||
<v-pagination v-model="currentPage" :length="lastPage" :total-visible="6"></v-pagination>
|
||||
</div>
|
||||
<v-layout row wrap align-center justify-center class="mt-3">
|
||||
<router-link to="/dashboard">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-chevron-left</v-icon>
|
||||
<span class="black--text">Back</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
<v-btn color="orange darken-1">
|
||||
<v-icon class="white--text mr-1 caption">fas fa-barcode</v-icon>
|
||||
<span>Generate Barcode</span>
|
||||
</v-btn>
|
||||
<v-btn color="pink" @click="remove(item.id)" class="WM-ActionButton">
|
||||
<v-icon class="white--text mr-2 caption">fas fa-times</v-icon>
|
||||
<span>Remove</span>
|
||||
</v-btn>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider></v-divider>
|
||||
<div class="text-xs-center" v-if="lastPage > 1">
|
||||
<v-pagination v-model="currentPage" :length="lastPage" :total-visible="6"></v-pagination>
|
||||
</div>
|
||||
<v-layout row wrap align-center justify-center class="mt-3">
|
||||
<router-link to="/dashboard">
|
||||
<v-btn class="WM-NoShadow WM-Outline-Btn WM-Border WM-Border-Black ml-5">
|
||||
<v-icon class="black--text mr-2 caption">fas fa-chevron-left</v-icon>
|
||||
<span class="black--text">Back</span>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-container>
|
||||
</v-layout>
|
||||
</material-card>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ApiService } from "@/services";
|
||||
import { urls } from "@/config/urls";
|
||||
export default {
|
||||
data: () => ({
|
||||
headers: [
|
||||
{
|
||||
sortable: false,
|
||||
text: "TestType Name",
|
||||
value: "name"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "TestType UniqueId",
|
||||
value: "uniqueId"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Register TestType",
|
||||
value: "users"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Date",
|
||||
value: "date"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Action",
|
||||
value: "action",
|
||||
align: "right"
|
||||
}
|
||||
],
|
||||
items: [],
|
||||
currentPage: 1,
|
||||
lastPage: 1
|
||||
}),
|
||||
created() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
async getData(page = 1) {
|
||||
const result = await ApiService.get(urls.listTestType(page));
|
||||
if (result && result.status == 200) {
|
||||
this.items = result.data.data.data;
|
||||
this.currentPage = result.data.data.current_page;
|
||||
this.lastPage = result.data.data.last_page;
|
||||
}
|
||||
data: () => ({
|
||||
headers: [
|
||||
{
|
||||
sortable: false,
|
||||
text: "TestType Name",
|
||||
value: "name"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "TestType UniqueId",
|
||||
value: "uniqueId"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Register TestType",
|
||||
value: "users"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Date",
|
||||
value: "date"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
text: "Action",
|
||||
value: "action",
|
||||
align: "right"
|
||||
}
|
||||
],
|
||||
items: [],
|
||||
currentPage: 1,
|
||||
lastPage: 1
|
||||
}),
|
||||
created() {
|
||||
this.getData();
|
||||
},
|
||||
async remove(id) {
|
||||
const result = await ApiService.delete(urls.deleteTestType(id));
|
||||
if (result.status == 200) {
|
||||
for (const key in this.items) {
|
||||
if (this.items.hasOwnProperty(key) && this.items[key].id == id) {
|
||||
this.items.splice(key, 1);
|
||||
}
|
||||
methods: {
|
||||
async getData(page = 1) {
|
||||
const result = await ApiService.get(urls.listTestType(page));
|
||||
if (result && result.status == 200) {
|
||||
this.items = result.data.data.data;
|
||||
this.currentPage = result.data.data.current_page;
|
||||
this.lastPage = result.data.data.last_page;
|
||||
}
|
||||
},
|
||||
async remove(id) {
|
||||
const result = await ApiService.delete(urls.deleteTestType(id));
|
||||
if (result.status == 200) {
|
||||
for (const key in this.items) {
|
||||
if (
|
||||
this.items.hasOwnProperty(key) &&
|
||||
this.items[key].id == id
|
||||
) {
|
||||
this.items.splice(key, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
currentPage(page) {
|
||||
this.getData(page);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
currentPage(page) {
|
||||
this.getData(page);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
.WM-ActionButton {
|
||||
padding: 8px 22px;
|
||||
padding: 8px 22px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user