ajuste no cbo, pesquisa e validação do home_visit_screen.dart
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:line_icons/line_icons.dart';
|
||||
import 'package:rkm/screens/home_screen.dart';
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
import '../../config/color_palette.dart';
|
||||
import '../../config/const_variable.dart';
|
||||
import '../../models/check_model.dart';
|
||||
@@ -124,14 +125,25 @@ class _HomeVisitScreenState extends State<HomeVisitScreen> {
|
||||
CNES_UNIDADE.text = value[1];
|
||||
}
|
||||
});
|
||||
await DBQuerys().buscaCBOProfissional(idUsuario).then((list){
|
||||
if(list.length!=0){
|
||||
for(int i = 0; list.length>i;i++){
|
||||
listCBO.add(list[i]['CODIGO_CBO'].toString());
|
||||
}
|
||||
Database dbcbo = await DbSqliteLoad().intialDB();
|
||||
var query = 'SELECT * FROM PROFISSIONAIS_CBOS WHERE ID_PROFISSIONAL = $idUsuario';
|
||||
List listcbo = await dbcbo.rawQuery(query);
|
||||
|
||||
if(listcbo.length!=0){
|
||||
for(int i = 0; listcbo.length>i;i++){
|
||||
await DBQuerys().buscaCBOSProfissional(listcbo[i]['CODIGO_CBO']).then((cbo)async{
|
||||
if(cbo.length!=0){
|
||||
listCBO.add(cbo[0]['DESCRICAO_CBO']+' - '+listcbo[i]['CODIGO_CBO'].toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
var querycbo = 'SELECT * FROM CBOS WHERE CODIGO_CBO = 223208';
|
||||
// var query = 'SELECT * FROM PROFISSIONAIS_CBOS';
|
||||
List listcbocompleta = await dbcbo.rawQuery(querycbo);
|
||||
print(listcbocompleta);
|
||||
|
||||
List list = await DBQuerys().buscaDadosProfissional(idUnidade,idUsuario);
|
||||
for(int i=0; list.length > i;i++){
|
||||
INE_RESP_CADASTRO = 'INE: ${list[i]['INE']} / Área: ${list[i]['AREA']} - Microárea : ${list[i]['MICROAREA']}';
|
||||
@@ -150,7 +162,7 @@ class _HomeVisitScreenState extends State<HomeVisitScreen> {
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
loadLists() {
|
||||
loadLists()async {
|
||||
for (int i = 0; ConstVariable().typeTurnService.length > i; i++) {
|
||||
typeTurnService.add(ConstVariable().typeTurnService[i].title);
|
||||
}
|
||||
@@ -181,7 +193,7 @@ class _HomeVisitScreenState extends State<HomeVisitScreen> {
|
||||
// adicionar depois e usar um usuário real
|
||||
// CBO_RESP_CADASTRO
|
||||
//ok
|
||||
if(date.isEmpty || dateDB.isEmpty || TIPO_IMOVEL_COD==0 || DESFECHO_COD ==0 || TURNO_COD == 0
|
||||
if(date.isEmpty || dateDB.isEmpty || TIPO_IMOVEL_COD==0 || DESFECHO_COD ==0 || TURNO_COD == 0 || CBO_PROFISSIONAL == null
|
||||
){
|
||||
print('erro');
|
||||
setState(() {
|
||||
@@ -818,23 +830,27 @@ class _HomeVisitScreenState extends State<HomeVisitScreen> {
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Container(
|
||||
width: width*0.7,
|
||||
child: Row(
|
||||
children: [
|
||||
TextDefault(text: 'Procedimento',color: Colors.black,),
|
||||
Spacer(),
|
||||
IconButton(
|
||||
icon: Icon(Icons.add_circle,color: ColorPalette.blackButton),
|
||||
onPressed: (){
|
||||
AlertDialogDefault().otherProc(context, 'Outros Procedimentos', 'Adicionar Procedimento', CBO_PROFISSIONAL, CBO_PROFISSIONAL, 'add',PROCEDIMENTOS_SIGTAP,listProc);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
GestureDetector(
|
||||
onTap: ()=>AlertDialogDefault().otherProc(context, 'Outros Procedimentos', 'Adicionar Procedimento', CBO_PROFISSIONAL, CBO_PROFISSIONAL, 'add',PROCEDIMENTOS_SIGTAP,listProc),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Container(
|
||||
height: 200,
|
||||
width: width*0.7,
|
||||
child: Row(
|
||||
children: [
|
||||
TextDefault(text: 'Procedimento',color: Colors.black,),
|
||||
Spacer(),
|
||||
IconButton(
|
||||
icon: Icon(Icons.add_circle,color: ColorPalette.blackButton),
|
||||
onPressed: (){
|
||||
AlertDialogDefault().otherProc(context, 'Outros Procedimentos', 'Adicionar Procedimento', CBO_PROFISSIONAL, CBO_PROFISSIONAL, 'add',PROCEDIMENTOS_SIGTAP,listProc);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user