|
|
@ -18,10 +18,8 @@ Page({ |
|
|
|
*/ |
|
|
|
data: { |
|
|
|
orderDate:"", |
|
|
|
inspectIf:false, |
|
|
|
selectedEnterpriseNames:[], |
|
|
|
EnterpriseName:[], |
|
|
|
index: 0, |
|
|
|
companyList:[], |
|
|
|
showtime:false, |
|
|
|
checkboxOptions:[], |
|
|
@ -75,8 +73,8 @@ Page({ |
|
|
|
currentDate: new Date().getTime(), |
|
|
|
minDate: new Date(2020, 0, 1).getTime(), |
|
|
|
maxDate: new Date(2030, 11, 31).getTime(), |
|
|
|
checkboxValue:[], |
|
|
|
searchKeyword:"" |
|
|
|
searchKeyword:"", |
|
|
|
showscroll:false |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
@ -99,7 +97,9 @@ Page({ |
|
|
|
}, |
|
|
|
inputChange(val){ |
|
|
|
console.log(val.detail.value); |
|
|
|
this.data.searchKeyword = val.detail.value.trim(); |
|
|
|
this.setData({ |
|
|
|
searchKeyword: val.detail.value // 更新搜索关键词
|
|
|
|
}); |
|
|
|
let parm = { |
|
|
|
name: this.data.searchKeyword, |
|
|
|
pageSize:this.data.pageSize, |
|
|
@ -109,15 +109,12 @@ Page({ |
|
|
|
console.log(res.data.list); |
|
|
|
this.setData({ |
|
|
|
companyList:res.data.list, |
|
|
|
showqiye:true |
|
|
|
// showqiye:true
|
|
|
|
}) |
|
|
|
console.log( this.data.companyList); |
|
|
|
let names = [] |
|
|
|
res.data.list.forEach(item=>{ |
|
|
|
names.push(item.name) |
|
|
|
}) |
|
|
|
console.log(names); |
|
|
|
this.data.EnterpriseName=names |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
// clearTimeout(this.data.timer);
|
|
|
|
// this.data.timer = setTimeout(() => {
|
|
|
@ -135,14 +132,15 @@ Page({ |
|
|
|
}); |
|
|
|
console.log(this.data.addHiddenDangeList); |
|
|
|
}, |
|
|
|
showRecordData() { |
|
|
|
async showRecordData() { |
|
|
|
console.log(this.data.checkboxOptions); |
|
|
|
this.setData({ |
|
|
|
checkboxOptions:[] |
|
|
|
}) |
|
|
|
let parm = { |
|
|
|
id: this.data.companyId |
|
|
|
} |
|
|
|
showRecord(parm).then(res => { |
|
|
|
await showRecord(parm).then(res => { |
|
|
|
if(res.data[0].hiddenDangeList){ |
|
|
|
let checkboxOptions = res.data[0].hiddenDangeList.filter(item=>item.hazardStatus === 0).map(item=>({hazardDesc:item.hazardDesc,hazardStatus:0})); |
|
|
|
this.setData({ |
|
|
@ -150,6 +148,7 @@ Page({ |
|
|
|
beforeFlag: res.data[0].checkResultFlag |
|
|
|
}) |
|
|
|
console.log(this.data.beforeFlag); |
|
|
|
console.log(this.data.checkboxOptions); |
|
|
|
}else{ |
|
|
|
this.setData({ |
|
|
|
beforeFlag: res.data[0].checkResultFlag |
|
|
@ -157,6 +156,7 @@ Page({ |
|
|
|
console.log(this.data.beforeFlag) |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(this.data.checkboxOptions); |
|
|
|
}, |
|
|
|
getCurrentDateTime() { |
|
|
|
const now = new Date(); |
|
|
@ -205,18 +205,18 @@ Page({ |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
if (this.data.checkboxOptions) { |
|
|
|
console.log(this.data.checkboxOptions) |
|
|
|
this.data.checkboxOptions.forEach(item => { |
|
|
|
console.log(item) |
|
|
|
console.log(this.data.checkboxValue) |
|
|
|
if(this.data.checkboxValue.findIndex(itemC=>itemC === item.value) == -1){ |
|
|
|
item.hazardStatus = '1'; |
|
|
|
}else{ |
|
|
|
item.hazardStatus = '0'; |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// if (this.data.checkboxOptions) {
|
|
|
|
// console.log(this.data.checkboxOptions)
|
|
|
|
// this.data.checkboxOptions.forEach(item => {
|
|
|
|
// console.log(item)
|
|
|
|
// console.log(this.data.checkboxValue)
|
|
|
|
// if(this.data.checkboxValue.findIndex(itemC=>itemC === item.value) == -1){
|
|
|
|
// item.hazardStatus = '1';
|
|
|
|
// }else{
|
|
|
|
// item.hazardStatus = '0';
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
if (this.data.newContent) { |
|
|
@ -344,10 +344,22 @@ Page({ |
|
|
|
onShareAppMessage() {}, |
|
|
|
onChange(event) { |
|
|
|
console.log(event); |
|
|
|
console.log(event.detail); |
|
|
|
console.log(this.data.checkboxOptions); |
|
|
|
this.data.checkboxOptions.forEach((item,index)=>{ |
|
|
|
if(event.detail.findIndex(item=>item==index) != -1){ |
|
|
|
console.log(item,"还是0"); |
|
|
|
item.hazardStatus = 0 |
|
|
|
}else{ |
|
|
|
console.log(item,"皆苦额了"); |
|
|
|
item.hazardStatus = 1 |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(this.data.checkboxOptions); |
|
|
|
this.setData({ |
|
|
|
checkboxValue: event.detail |
|
|
|
}); |
|
|
|
console.log(this.data.checkboxValue); |
|
|
|
checkboxValue:event.detail, |
|
|
|
}) |
|
|
|
console.log(this.data.checkboxOptions); |
|
|
|
}, |
|
|
|
afterRead(event) { |
|
|
|
const { |
|
|
@ -410,36 +422,65 @@ Page({ |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
onChange2(event) { |
|
|
|
console.log(event); |
|
|
|
handleBlur(){ |
|
|
|
this.setData({ |
|
|
|
selectedEnterpriseNames: event.detail, |
|
|
|
searchKeyword:event.detail[0] |
|
|
|
}); |
|
|
|
console.log(event.detail); |
|
|
|
console.log(this.data.companyList); |
|
|
|
this.data.companyList.forEach(item=>{ |
|
|
|
if(this.data.searchKeyword==item.name){ |
|
|
|
this.data.companyId=item.companyId |
|
|
|
this.data.orderDate=item.orderDate |
|
|
|
showscroll:false, |
|
|
|
companyList:[] |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleFocus(){ |
|
|
|
console.log(this.data.showscroll); |
|
|
|
this.setData({ |
|
|
|
showscroll:true |
|
|
|
}) |
|
|
|
let parm = { |
|
|
|
name: this.data.searchKeyword, |
|
|
|
pageSize:this.data.pageSize, |
|
|
|
pageNo:this.data.pageNo |
|
|
|
} |
|
|
|
|
|
|
|
Enterpriseambiguity(parm).then(res => { |
|
|
|
console.log(res.data.list); |
|
|
|
this.setData({ |
|
|
|
companyList:res.data.list, |
|
|
|
// showqiye:true
|
|
|
|
}) |
|
|
|
console.log( this.data.companyList); |
|
|
|
this.data.companyList.forEach(item=>{ |
|
|
|
this.data.orderDate=item.orderDate; |
|
|
|
const currentDate = new Date(); |
|
|
|
const currentMonth = currentDate.getMonth() + 1; |
|
|
|
const targetMonth = parseInt(this.data.orderDate.substring(5, 7), 10); |
|
|
|
console.log(this.data.companyId,); |
|
|
|
const targetMonth = parseInt(item.orderDate.substring(5, 7), 10); |
|
|
|
console.log(currentMonth,targetMonth); |
|
|
|
if (targetMonth === currentMonth) { |
|
|
|
this.setData({ |
|
|
|
inspectIf:true |
|
|
|
}) |
|
|
|
console.log( this.data.inspectIf); |
|
|
|
console.log("turedv"); |
|
|
|
item.inspectIf=true |
|
|
|
} else { |
|
|
|
this.setData({ |
|
|
|
inspectIf:false |
|
|
|
}) |
|
|
|
item.inspectIf=false |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
console.log(this.data.companyList); |
|
|
|
// let names = []
|
|
|
|
// res.data.list.forEach(item=>{
|
|
|
|
// names.push(item.name)
|
|
|
|
// })
|
|
|
|
// console.log(names);
|
|
|
|
// this.data.EnterpriseName=names
|
|
|
|
}) |
|
|
|
// this.onChange2()
|
|
|
|
}, |
|
|
|
onChange2(event) { |
|
|
|
|
|
|
|
let item = event.currentTarget.dataset.item; |
|
|
|
console.log(item); |
|
|
|
this.setData({ |
|
|
|
searchKeyword:item.name, |
|
|
|
companyList:item, |
|
|
|
companyId:item.companyId, |
|
|
|
showscroll:false, |
|
|
|
companyList:[] |
|
|
|
}); |
|
|
|
|
|
|
|
this.showRecordData() |
|
|
|
}, |
|
|
|
confirmSelection() { |
|
|
@ -498,15 +539,15 @@ Page({ |
|
|
|
console.log(this.data.getData) |
|
|
|
// 在这里可以根据选择的值进行相应的逻辑处理
|
|
|
|
}, |
|
|
|
pickerChange2: function (e) { |
|
|
|
// 更新当前选中的索引
|
|
|
|
this.setData({ |
|
|
|
gridNName: this.data.companyList[e.detail.value].name, |
|
|
|
companyId:this.data.companyList[e.detail.value].id, |
|
|
|
checkboxValue:[] |
|
|
|
}); |
|
|
|
this.showRecordData() |
|
|
|
}, |
|
|
|
// pickerChange2: function (e) {
|
|
|
|
// // 更新当前选中的索引
|
|
|
|
// this.setData({
|
|
|
|
// gridNName: this.data.companyList[e.detail.value].name,
|
|
|
|
// companyId:this.data.companyList[e.detail.value].id,
|
|
|
|
// checkboxValue:[]
|
|
|
|
// });
|
|
|
|
// this.showRecordData()
|
|
|
|
// },
|
|
|
|
bindRemarkInput(e) { |
|
|
|
this.setData({ |
|
|
|
remarks: e.detail.value |
|
|
@ -800,5 +841,8 @@ Page({ |
|
|
|
|
|
|
|
onCancel() { |
|
|
|
this.setData({ showtime: false }); |
|
|
|
}, |
|
|
|
input122(event){ |
|
|
|
console.log(event); |
|
|
|
} |
|
|
|
}) |