devolucion y prestamo
This commit is contained in:
@@ -10,20 +10,19 @@
|
||||
table.table
|
||||
thead
|
||||
tr
|
||||
th(width="10%")
|
||||
th(width="20%") No Semanas
|
||||
th(width="10%")
|
||||
th(width="20%") No Semanas
|
||||
th(width="70%") Descripción
|
||||
tbody
|
||||
tr(v-for="m in multa")
|
||||
td
|
||||
.control
|
||||
.control
|
||||
label.radio
|
||||
input(type='radio' name="multa" v-bind:value="m.id" v-model="multar.idMulta")
|
||||
td {{m.semanas}}
|
||||
td {{m.nombre}}
|
||||
|
||||
footer.modal-card-foot
|
||||
button.button.is-success(v-on:click="SaveMultar()") Guardar
|
||||
button.button.is-success(v-on:click="SaveMultar()") Guardar
|
||||
button.button(v-on:click="toggleModal()") Cancelar
|
||||
p.has-text-centered
|
||||
span.is-size-6.space(v-for="s in status") {{` ${s.equipo.toUpperCase()} : ${s.prestadas} / ${s.total}`}}
|
||||
@@ -41,14 +40,14 @@
|
||||
th Multar
|
||||
th Regresar
|
||||
tbody
|
||||
tr(v-bind:class="{'warn-time':timeWarn(p.fh_in)}" v-for="p in prestamo")
|
||||
td {{p.detalles[0].equipo.carrito.nombre}}
|
||||
td {{p.detalles[0].equipo.equipo_carrito}}
|
||||
td {{p.equipo}}
|
||||
td {{p.detalles[0].equipo.no_inventario}}
|
||||
td {{p.idUsuario}}
|
||||
td {{fecha(p.fh_in)}}
|
||||
td {{maxFecha(p.fh_in)}}
|
||||
tr(v-bind:class="{'warn-time':timeWarn(p.fechaInicio)}" v-for="p in prestamo")
|
||||
td {{p.Equipo.Carrito.alias}}
|
||||
td {{p.Equipo.equipo_carrito}}
|
||||
td {{p.Equipo.Tipo.nombre}}
|
||||
td {{p.Equipo.no_inventario}}
|
||||
td {{p.idUsuario}}
|
||||
td {{fecha(p.fechaInicio)}}
|
||||
td {{maxFecha(p.fechaInicio)}}
|
||||
td
|
||||
a.button.is-danger.is-outlined(v-on:click="upMultar(p.idUsuario,p.detalles[0].equipo.id)")
|
||||
span.icon.is-small
|
||||
@@ -92,7 +91,7 @@ export default {
|
||||
url: api.url + '/multar',
|
||||
data: this.multar,
|
||||
headers: {
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
'token': this.$store.getters.token
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
@@ -140,14 +139,14 @@ export default {
|
||||
id: pre
|
||||
},
|
||||
headers: {
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
'token': this.$store.getters.token
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
swal('Exito', 'Peticion exitosa ', 'success')
|
||||
axios.get(api.url + '/prestamo', {
|
||||
headers: {
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
'token': this.$store.getters.token
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
@@ -166,12 +165,12 @@ export default {
|
||||
mounted () {
|
||||
axios.get(api.url + '/prestamo', {
|
||||
headers: {
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
'token': this.$store.getters.token
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response.data.data)
|
||||
this.prestamo = response.data.data.equipos
|
||||
console.log(response.data)
|
||||
this.prestamo = response.data
|
||||
this.status = response.data.data.status
|
||||
})
|
||||
.catch(error => {
|
||||
@@ -179,7 +178,7 @@ export default {
|
||||
})
|
||||
axios.get(api.url + '/multa', {
|
||||
headers: {
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
'token': this.$store.getters.token
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
|
||||
@@ -22,15 +22,13 @@
|
||||
th Carrito
|
||||
th Equipo
|
||||
th No inventario
|
||||
th Préstamo
|
||||
th Entrega
|
||||
tbody
|
||||
tr
|
||||
td {{prestamoData.carrito}}
|
||||
td {{prestamoData.id}}
|
||||
td {{prestamoData.alias_carrito}}
|
||||
td {{prestamoData.alias_equipo}}
|
||||
td {{prestamoData.no_inventario}}
|
||||
td {{prestamoData.prestamo}}
|
||||
td {{prestamoData.entrega}}
|
||||
td {{prestamoData.fechaFin}}
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -56,16 +54,17 @@ export default {
|
||||
method: 'post',
|
||||
url: api.url + '/prestamo',
|
||||
data: {
|
||||
equipo: this.tipo,
|
||||
idUsuario: this.usuario,
|
||||
idKiosko: window.sessionStorage.pcpumaK
|
||||
idTipo: 1,
|
||||
idOperadorPrestamo: 1,
|
||||
kiosko: 1
|
||||
},
|
||||
headers: {
|
||||
token: window.sessionStorage.pcpumaT
|
||||
token: this.$store.getters.token
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
this.prestamoData = response.data.data.equipo
|
||||
this.prestamoData = response.data
|
||||
console.log(this.prestamoData)
|
||||
swal('Exito', 'Peticion exitosa ', 'success')
|
||||
})
|
||||
|
||||
+18
-28
@@ -39,12 +39,12 @@
|
||||
th Editar
|
||||
tbody
|
||||
tr(v-for="dt in data")
|
||||
td {{dt["nombre"]}}
|
||||
td {{dt["equipo"]}}
|
||||
td
|
||||
span.tag.is-success(v-if="dt['baja'] == '0'")
|
||||
td {{dt.alias}}
|
||||
td {{dt.tipo}}
|
||||
td
|
||||
span.tag.is-success(v-if="dt.baja == '0'")
|
||||
b Activo
|
||||
span.tag.is-warning(v-else)
|
||||
span.tag.is-warning(v-else)
|
||||
b Inactivo
|
||||
td
|
||||
a.button.is-link.is-outlined(v-on:click="setUpdate(dt)")
|
||||
@@ -64,26 +64,21 @@ export default {
|
||||
UmFooter,
|
||||
UmHeader
|
||||
},
|
||||
name: 'equipo',
|
||||
data () {
|
||||
return {
|
||||
data: [],
|
||||
carrito: {
|
||||
nota: '',
|
||||
baja: '',
|
||||
id: ''
|
||||
}
|
||||
carrito: {}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
axios.get(api.url + '/carritos/' + window.sessionStorage.pcpumaK, {
|
||||
axios.get(api.url + '/carrito?kiosko=1', {
|
||||
headers: {
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
'token': this.$store.getters.token
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response)
|
||||
this.data = response.data.data
|
||||
this.data = response.data
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error)
|
||||
@@ -91,40 +86,35 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
update: function () {
|
||||
console.log(this.carrito)
|
||||
this.toggleModal()
|
||||
axios({
|
||||
method: 'put',
|
||||
url: api.url + '/carrito',
|
||||
data: this.carrito,
|
||||
headers: {
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
'token': this.$store.getters.token
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
swal('Exito', 'Se actualizo', 'success')
|
||||
axios.get(api.url + '/carritos/' + window.sessionStorage.pcpumaK, {
|
||||
return axios.get(api.url + '/carrito?kiosko=1', {
|
||||
headers: {
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
'token': this.$store.getters.token
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
// console.log(response)
|
||||
this.data = response.data.data
|
||||
swal('Exito', 'Se cargarón los datos', 'success')
|
||||
})
|
||||
.catch(error => {
|
||||
swal('Error', error.response.data.err, 'error')
|
||||
})
|
||||
})
|
||||
.then(response => {
|
||||
this.data = response.data
|
||||
swal('Exito', 'Se cargarón los datos', 'success')
|
||||
})
|
||||
.catch(error => {
|
||||
swal('Error', error.response.data.err, 'error')
|
||||
})
|
||||
},
|
||||
setUpdate: function (dt) {
|
||||
this.toggleModal()
|
||||
this.carrito.nota = dt.nota
|
||||
this.carrito.id = dt.id
|
||||
this.carrito.baja = dt.baja
|
||||
this.carrito=dt
|
||||
},
|
||||
toggleModal: function () {
|
||||
let modal = document.getElementById('modal')
|
||||
|
||||
+38
-115
@@ -100,20 +100,20 @@
|
||||
th Editar
|
||||
tbody
|
||||
tr(v-for="dt in filteredEquipo")
|
||||
td {{dt["carritos.nombre"]}}
|
||||
td {{dt["carritos.equipos.equipo_carrito"]}}
|
||||
td {{dt["carritos.equipos.no_serie"]}}
|
||||
td {{dt["carritos.equipos.no_inventario"]}}
|
||||
td {{dt["carritos.equipos.equipo"]}}
|
||||
td
|
||||
span.tag.is-success(v-if="dt['carritos.equipos.bateria'] == '0'")
|
||||
td {{dt.Carrito.alias}}
|
||||
td {{dt.equipo_carrito}}
|
||||
td {{dt.no_serie}}
|
||||
td {{dt.no_inventario}}
|
||||
td {{dt.Tipo.nombre}}
|
||||
td
|
||||
span.tag.is-success(v-if="dt.bateria == '0'")
|
||||
b Cargada
|
||||
span.tag.is-warning(v-else)
|
||||
span.tag.is-warning(v-else)
|
||||
b Descargada
|
||||
td
|
||||
span.tag.is-success(v-if="dt['carritos.equipos.baja'] == '0'")
|
||||
td
|
||||
span.tag.is-success(v-if="dt.baja == '0'")
|
||||
b Activo
|
||||
span.tag.is-warning(v-else)
|
||||
span.tag.is-warning(v-else)
|
||||
b Inactivo
|
||||
td
|
||||
a.button.is-u-blue.is-outlined(v-on:click="setUpdate(dt)")
|
||||
@@ -133,7 +133,6 @@ export default {
|
||||
UmFooter,
|
||||
UmHeader
|
||||
},
|
||||
name: 'equipo',
|
||||
data () {
|
||||
return {
|
||||
search: '',
|
||||
@@ -142,26 +141,34 @@ export default {
|
||||
carrito: [],
|
||||
tipo: '',
|
||||
car: '',
|
||||
file: '',
|
||||
equipo: {
|
||||
no_serie: '',
|
||||
no_inventario: '',
|
||||
baja: '',
|
||||
id: '',
|
||||
bateria: '',
|
||||
nota: ''
|
||||
}
|
||||
equipo: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
filteredEquipo: function () {
|
||||
return this.data.filter(dat => {
|
||||
if (this.car !== '') {
|
||||
if (parseInt(this.car) !== dat.carrito) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
let reg = new RegExp(this.search)
|
||||
if (reg.test(dat.no_serie) || reg.test(dat.no_inventario) || reg.test(dat.id)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
axios.get(api.url + '/equipo/?kiosko=' + window.sessionStorage.pcpumaK, {
|
||||
axios.get(api.url + '/equipo?kiosko=1', {
|
||||
headers: {
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
'token': this.$store.getters.token
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response)
|
||||
this.data = response.data.data
|
||||
console.log(response.data)
|
||||
this.data = response.data
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error)
|
||||
@@ -175,20 +182,20 @@ export default {
|
||||
url: api.url + '/equipo',
|
||||
data: this.equipo,
|
||||
headers: {
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
'token': this.$store.getters.token
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
swal('Exito', 'Se actualizo', 'success')
|
||||
axios.get(api.url + '/equipo/?kiosko=' + window.sessionStorage.pcpumaK, {
|
||||
axios.get(api.url + '/equipo', {
|
||||
headers: {
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
'token': this.$store.getters.token
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
// console.log(response)
|
||||
this.data = response.data.data
|
||||
swal('Exito', 'Se cargarón los datos', 'success')
|
||||
swal('Exito', 'Se actualizarón los datos', 'success')
|
||||
})
|
||||
.catch(error => {
|
||||
swal('Error', error.response.data.err, 'error')
|
||||
@@ -201,12 +208,7 @@ export default {
|
||||
setUpdate: function (dt) {
|
||||
console.log(dt)
|
||||
this.toggleModal()
|
||||
this.equipo.no_serie = dt['carritos.equipos.no_serie']
|
||||
this.equipo.no_inventario = dt['carritos.equipos.no_inventario']
|
||||
this.equipo.baja = dt['carritos.equipos.baja']
|
||||
this.equipo.bateria = dt['carritos.equipos.bateria']
|
||||
this.equipo.nota = dt['carritos.equipos.nota']
|
||||
this.equipo.id = dt['carritos.equipos.id']
|
||||
this.equipo = dt
|
||||
},
|
||||
toggleModal: function () {
|
||||
let modal = document.getElementById('modal')
|
||||
@@ -218,88 +220,9 @@ export default {
|
||||
},
|
||||
count: function (arr) {
|
||||
return `${arr.length}`
|
||||
},
|
||||
changeFile: function () {
|
||||
this.file = event.target.files[0]
|
||||
console.log(this.file)
|
||||
},
|
||||
upload: function () {
|
||||
// Add a request interceptor
|
||||
const fue = axios.interceptors.request.use(function (config) {
|
||||
// Do something before request is sent
|
||||
document.getElementById('pageloader').classList.add('is-active')
|
||||
console.log('sefue')
|
||||
return config
|
||||
}, function (error) {
|
||||
// Do something with request error
|
||||
return Promise.reject(error)
|
||||
})
|
||||
// Add a response interceptor
|
||||
const regreso = axios.interceptors.response.use(function (response) {
|
||||
// Do something with response data
|
||||
document.getElementById('pageloader').classList.remove('is-active')
|
||||
console.log('regreso')
|
||||
return response
|
||||
}, function (error) {
|
||||
// Do something with response error
|
||||
return Promise.reject(error)
|
||||
})
|
||||
let data = new FormData()
|
||||
data.append('archivo', this.file)
|
||||
axios({
|
||||
method: 'post',
|
||||
url: api.url + '/carrito-upload',
|
||||
data,
|
||||
headers: {
|
||||
admin: '123',
|
||||
'Content-Type': 'multipart/form-data',
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response.data)
|
||||
axios.interceptors.request.eject(fue)
|
||||
axios.interceptors.request.eject(regreso)
|
||||
axios.get(api.url + '/equipo/?kiosko=' + window.sessionStorage.pcpumaK, {
|
||||
headers: {
|
||||
'token': window.sessionStorage.pcpumaT
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
// console.log(response)
|
||||
this.data = response.data.data
|
||||
swal('Exito', 'Se cargarón los datos', 'success')
|
||||
})
|
||||
.catch(error => {
|
||||
swal('Error', error.response.data.err, 'error')
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error.response.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
filteredEquipo: function () {
|
||||
return this.data.filter(dat => {
|
||||
if (this.tipo !== '') {
|
||||
if (this.tipo !== dat['carritos.equipos.equipo']) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (this.car !== '') {
|
||||
if (parseInt(this.car) !== dat.carrito) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
let reg = new RegExp(this.search)
|
||||
if (reg.test(dat['carritos.equipos.no_serie']) || reg.test(dat['carritos.equipos.no_inventario']) || reg.test(dat.id)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user