修复缺陷

This commit is contained in:
duxp 2023-10-09 10:57:16 +08:00
parent b556f340e9
commit 81f4313ee2
2 changed files with 16 additions and 12 deletions

View File

@ -44,7 +44,7 @@ Page({
handleSubmitFile(e){ handleSubmitFile(e){
let _data = e.currentTarget.dataset.item; let _data = e.currentTarget.dataset.item;
wx.navigateTo({ wx.navigateTo({
url:'../workReport/workReport?type='+_data.type+'&isRadio=true'+'&data='+JSON.stringify(_data) url:'../workReport/workReport?type='+_data.type+'&isRadio=true'+'&id='+_data.id
}) })
}, },

View File

@ -34,15 +34,19 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log(options,'option');
if(options && JSON.stringify(options) !== '{}'){ if(options && JSON.stringify(options) !== '{}'){
this.setData({ this.setData({
"searchForm.type":options.type, "searchForm.type":options.type,
isRadio:options.isRadio?options.isRadio:false isRadio:options.isRadio?options.isRadio:false
}) })
if(this.data.isRadio){ if(this.data.isRadio){
this.setData({ this.loadDetailData({
detailData:JSON.parse(options.data) pageNum:1,
}) pageSize:10,
type:options.type,
id:options.id
});
}else{ }else{
this.loadTargetData({type:options.type}); this.loadTargetData({type:options.type});
} }
@ -110,7 +114,12 @@ Page({
activeId:e.detail.id, activeId:e.detail.id,
targetShow:false, targetShow:false,
}) })
this.loadDetailData(); this.loadDetailData({
pageNum:1,
pageSize:10,
type:this.data.searchForm.type,
id:this.data.searchForm.targetId
});
}, },
//上传之前 //上传之前
@ -330,14 +339,9 @@ Page({
}, },
//加载详情数据 //加载详情数据
loadDetailData(){ loadDetailData(param){
let _this = this; let _this = this;
$api.queryList({ $api.queryList(param).then(res => {
pageNum:1,
pageSize:10,
type:_this.data.searchForm.type,
id:_this.data.searchForm.targetId
}).then(res => {
if(res.code === 0){ if(res.code === 0){
let _data = null; let _data = null;
if(res.rows.length>0){ if(res.rows.length>0){