mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 07:11:07 +03:30
add require scanner checkbox
This commit is contained in:
@@ -86,6 +86,9 @@ class TestTypeController extends Controller
|
|||||||
'test_type_id' => $TestType->id,
|
'test_type_id' => $TestType->id,
|
||||||
'parent_id' => $ParentID
|
'parent_id' => $ParentID
|
||||||
];
|
];
|
||||||
|
if ($Input['type'] == 'Text') {
|
||||||
|
$InputData['require_scanner'] = $Input['require_scanner'];
|
||||||
|
}
|
||||||
$InputObj = Input::create($InputData);
|
$InputObj = Input::create($InputData);
|
||||||
//---------------------------------------------Input
|
//---------------------------------------------Input
|
||||||
//---------------------------------------------Option
|
//---------------------------------------------Option
|
||||||
@@ -112,6 +115,7 @@ class TestTypeController extends Controller
|
|||||||
|
|
||||||
public function store(StoreTestTypeRequest $request)
|
public function store(StoreTestTypeRequest $request)
|
||||||
{
|
{
|
||||||
|
// dd($request->all());
|
||||||
try {
|
try {
|
||||||
$return_value = \DB::transaction(function () use ($request) {
|
$return_value = \DB::transaction(function () use ($request) {
|
||||||
|
|
||||||
@@ -160,6 +164,7 @@ class TestTypeController extends Controller
|
|||||||
'name' => $Input->name,
|
'name' => $Input->name,
|
||||||
'type' => $Input->type,
|
'type' => $Input->type,
|
||||||
'size' => $Input->size ,
|
'size' => $Input->size ,
|
||||||
|
'require_scanner' => $Input->require_scanner ,
|
||||||
'parent_id' => $Input->parent_id,
|
'parent_id' => $Input->parent_id,
|
||||||
'options' => [],
|
'options' => [],
|
||||||
'children' => []
|
'children' => []
|
||||||
@@ -242,6 +247,9 @@ class TestTypeController extends Controller
|
|||||||
'test_type_id' => $TestType->id,
|
'test_type_id' => $TestType->id,
|
||||||
'parent_id' => $ParentID
|
'parent_id' => $ParentID
|
||||||
];
|
];
|
||||||
|
if ($Input['type'] == 'Text') {
|
||||||
|
$InputData['require_scanner'] = $Input['require_scanner'];
|
||||||
|
}
|
||||||
Input::where('id',$Input['id'])->update($InputData);
|
Input::where('id',$Input['id'])->update($InputData);
|
||||||
$InputObj = Input::findOrFail($Input['id']);
|
$InputObj = Input::findOrFail($Input['id']);
|
||||||
//---------------------------------------------Input
|
//---------------------------------------------Input
|
||||||
@@ -395,12 +403,12 @@ class TestTypeController extends Controller
|
|||||||
}
|
}
|
||||||
if (isset($testType) && $testType) {
|
if (isset($testType) && $testType) {
|
||||||
|
|
||||||
$inputs = Input::select('id', 'name', 'type', 'size', 'parent_id')->with(
|
$inputs = Input::select('id', 'name', 'type', 'size', 'parent_id', 'require_scanner')->with(
|
||||||
['options' => function ($query) {
|
['options' => function ($query) {
|
||||||
$query->select('id', 'title','input_id');
|
$query->select('id', 'title','input_id');
|
||||||
},
|
},
|
||||||
'children' => function ($query) {
|
'children' => function ($query) {
|
||||||
$query->select('id', 'name', 'type', 'size', 'parent_id', 'test_type_id');
|
$query->select('id', 'name', 'type', 'size', 'parent_id', 'test_type_id', 'require_scanner');
|
||||||
},
|
},
|
||||||
'children.options' => function ($query) {
|
'children.options' => function ($query) {
|
||||||
$query->select('id', 'title', 'input_id');
|
$query->select('id', 'title', 'input_id');
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class Input extends Model
|
class Input extends Model
|
||||||
{
|
{
|
||||||
public $fillable = ['name','type','size','test_type_id','parent_id'];
|
public $fillable = ['name','type','size','test_type_id','parent_id','require_scanner'];
|
||||||
public function test_type()
|
public function test_type()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\TestType');
|
return $this->belongsTo('App\TestType');
|
||||||
|
|||||||
@@ -88,6 +88,18 @@
|
|||||||
prepend-icon="fa fa-sort-numeric-asc"
|
prepend-icon="fa fa-sort-numeric-asc"
|
||||||
></v-select>
|
></v-select>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
|
<v-flex xs12 md3 sm3 v-if="info.type == 'Text'">
|
||||||
|
<v-layout row wrap>
|
||||||
|
<v-flex xs12 class="WM-FlexWrap ml-3">
|
||||||
|
<v-checkbox
|
||||||
|
label="require barcode scanner"
|
||||||
|
v-model="info.require_scanner"
|
||||||
|
></v-checkbox>
|
||||||
|
</v-flex>
|
||||||
|
</v-layout>
|
||||||
|
</v-flex>
|
||||||
|
|
||||||
|
|
||||||
</v-layout>
|
</v-layout>
|
||||||
<!-- SelectBox Section -->
|
<!-- SelectBox Section -->
|
||||||
<v-layout
|
<v-layout
|
||||||
@@ -244,6 +256,16 @@
|
|||||||
prepend-icon="fa fa-sort-numeric-asc"
|
prepend-icon="fa fa-sort-numeric-asc"
|
||||||
></v-select>
|
></v-select>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
|
<v-flex xs12 md3 sm3 v-if="children.type == 'Text'">
|
||||||
|
<v-layout row wrap>
|
||||||
|
<v-flex xs12 class="WM-FlexWrap ml-3">
|
||||||
|
<v-checkbox
|
||||||
|
label="require barcode scanner"
|
||||||
|
v-model="children.require_scanner"
|
||||||
|
></v-checkbox>
|
||||||
|
</v-flex>
|
||||||
|
</v-layout>
|
||||||
|
</v-flex>
|
||||||
<!-- Inner Form Selectbox Section -->
|
<!-- Inner Form Selectbox Section -->
|
||||||
<v-layout
|
<v-layout
|
||||||
row
|
row
|
||||||
@@ -389,7 +411,8 @@ export default {
|
|||||||
id: 0,
|
id: 0,
|
||||||
name: "",
|
name: "",
|
||||||
type: "",
|
type: "",
|
||||||
size: ""
|
size: "",
|
||||||
|
require_scanner: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -441,6 +464,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeType(infoIndex, selectedboxType) {
|
changeType(infoIndex, selectedboxType) {
|
||||||
|
// if (selectedboxType == "Text"){
|
||||||
|
// //--add checkbox
|
||||||
|
// }
|
||||||
if (selectedboxType == "Select" || selectedboxType == "Checkbox" || selectedboxType == "Radiobutton") {
|
if (selectedboxType == "Select" || selectedboxType == "Checkbox" || selectedboxType == "Radiobutton") {
|
||||||
this.form.info[infoIndex]["options"] = [{ id: 0, title: "" }];
|
this.form.info[infoIndex]["options"] = [{ id: 0, title: "" }];
|
||||||
} else if(selectedboxType == "Range") {
|
} else if(selectedboxType == "Range") {
|
||||||
@@ -547,9 +573,9 @@ export default {
|
|||||||
this.form
|
this.form
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (result && result.status == 200) {
|
// if (result && result.status == 200) {
|
||||||
this.$router.push({ name: `ListTestType` });
|
// this.$router.push({ name: `ListTestType` });
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async load(id) {
|
async load(id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user