Commit 891a05ed authored by hypsug0's avatar hypsug0
Browse files

feat: sighting form, prefill from last count detail item

parent 535d36fd
......@@ -1509,29 +1509,27 @@ const sigthingFormApp = (id_session, type_contact) => {
// const options = dict.map(x => {label: x.})
// },
addNewCountDetail(is) {
const newEmptyCountDetail = { ...this.newCountDetail }
const newCountDetail = { ...this.newCountDetail }
console.debug(
`<addNewCountDetail> ${this.data[is].countdetails.length} countdetails items`
)
// if (this.data[is].countdetails.length > 0) {
// console.debug('<addNewCountDetail> has countdetails items')
// const lastCountDetail = this.data[is].countdetails.splice(-1)[0]
// console.debug(
// 'newObject before',
// lastCountDetail,
// newEmptyCountDetail
// )
// newEmptyCountDetail.time = lastCountDetail.time
// newEmptyCountDetail.method = lastCountDetail.method
// newEmptyCountDetail.precision = lastCountDetail.precision
// newEmptyCountDetail.unit = lastCountDetail.unit
// console.log('newObject after', newEmptyCountDetail)
// console.log('countdetails', this.data[is].countdetails)
// this.data[is].countdetails.push(newEmptyCountDetail)
// } else {
console.debug('<addNewCountDetail> no countdetails items')
this.data[is].countdetails.push(newEmptyCountDetail)
// }
if (this.data[is].countdetails.length > 0) {
console.debug('<addNewCountDetail> has countdetails items')
const lastCountDetail = this.data[is].countdetails[this.data[is].countdetails.length-1]
console.debug(
'newObject before',
lastCountDetail,
newCountDetail
)
newCountDetail.time = lastCountDetail.time
newCountDetail.method = lastCountDetail.method
newCountDetail.precision = lastCountDetail.precision
newCountDetail.unit = lastCountDetail.unit
console.log('newObject after', newCountDetail)
console.log('countdetails', this.data[is].countdetails)
}
this.data[is].countdetails.push(newCountDetail)
},
delCountDetail(is, icd) {
this.data[is].countdetails.splice(icd, 1)
......
......@@ -68,6 +68,7 @@ Observations de la session {{object.name}}
class="fa fa-check"></i></span>
[[ s.codesp ? getSpecieValue(s.codesp,'common_name_fr'):'Choisissez une espèce']]
<i v-show="s.breed_colo" class="fas fa-baby fa-fw text-success"></i>
<span v-if='s.total_count'>: [[s.total_count]]</span>
</h4>
<div class="">
<div class="btn-group btn-sm pull-right">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment