-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfalla_resuelta.js
64 lines (54 loc) · 1.79 KB
/
falla_resuelta.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var Excel = require('exceljs'); // Modulo para escribir en excel
var workbook = new Excel.Workbook(); // realizar una instancia
falla_resuelta();
function falla_resuelta() {
var a;
workbook.xlsx.readFile('track_mantenimiento.xlsx').then(function() {
console.log("entra");
var worksheet = workbook.getWorksheet("track_mantenimiento");
var i = 0;
var valores = [];
worksheet.eachRow(function(row, index, arreglo) {
console.log(index);
//console.log(row.values);
valores[index] = row.values;
i=index;
});
console.log(valores[2]);
console.log(valores[1][1]);
console.log(valores[6][5]);
if(valores[i][5]==undefined){
console.log("Se registro Fecha");
a=true;
}else{
console.log("Debe ingresar un problema primeramente");
b=false;
}
});
}
/* con callback
var escribir_falla= function(callback){
workbook.xlsx.readFile('track_mantenimiento.xlsx').then(function() {
var worksheet = workbook.getWorksheet("track_mantenimiento");
var i = 0;
var valores = [];
worksheet.eachRow(function(row, index, arreglo) {
console.log(index);
//console.log(row.values);
valores[index] = row.values;
i=index;
});
console.log(valores[2]);
console.log(valores[1][1]);
console.log(valores[6][5]);
if(valores[i][5]==undefined){
console.log("Se registro Fecha");
callback(true);
}else{
console.log("Debe ingresar un problema primeramente");
}
});
}
escribir_falla(function(obteniendo){
console.log(obteniendo);
})*/