Browse Source

诉求类型修改为pc共性需求中类型

jw-featrue-zhanlibiao
mk 2 years ago
parent
commit
7c94f54160
  1. 36
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js
  2. 2
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml
  3. 9
      utils/api.js

36
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js

@ -59,7 +59,7 @@ Page({
hasPlay: false,
playUrl: "",
// defaultFieldNames: { label: 'agencyName', value: 'agencyId', children: 'subAgencyList' },
defaultFieldNames: { label: 'name', value: 'id',children:"children"},
angencyVisible: false,
measureList:[],
@ -122,10 +122,10 @@ Page({
},
getDemandoption(){
api.getDemandoption().then(res=>{
console.log(res);
this.setData({
measureList:res.data
measureList:res.data,
})
}).catch(err=>{
console.log(err);
})
@ -1227,6 +1227,12 @@ Page({
this.setData({
measureVisible:true
})
let e = {
detail:{
value:[this.data.measureList[0].id]
}
}
this.handleChangeMeasureValue(e)
},
showReportTypePicker(){
this.setData({
@ -1250,4 +1256,28 @@ Page({
second = second >= 10 ? second : '0' + second
return min + ':' + second
},
getDemandoption2: async function(id){
const {data,code,msg} = await api.getDemandoption2(id)
if(code == 0){
console.log(data);
return data
}else{
console.log(msg);
}
},
handleChangeMeasureValue: async function (e){
console.log(e);
let id = e.detail.value.join('');
let childrenData = await this.getDemandoption2(id);
let list = this.data.measureList.map(item => {
if(item.id == id){
return {...item, children:childrenData};
} else {
return item;
}
});
this.setData({
measureList: list
});
}
})

2
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.wxml

@ -241,10 +241,12 @@
options="{{ measureList }}"
value="{{ measureValue }}"
visible="{{measureVisible}}"
defaultFieldNames="{{defaultFieldNames}}"
cols="2"
controlled
cascade
bind:cancel="hidePickerMeasure"
bind:confirm="onConfirmMeasure"
bind:valueChange="handleChangeMeasureValue"
>
</wux-picker>

9
utils/api.js

@ -44,7 +44,8 @@ module.exports = {
clockRecords,
clearOneMessage,
getPubKey,
changePassword
changePassword,
getDemandoption2
}
// 获取公钥
@ -213,8 +214,12 @@ function getResidentBaseInfoPage (parm) {
}
// 获取需求分类树
function getDemandoption (parm) {
return fly.post(`governance/icresidemanddict/demandoption`,parm)
return fly.get(`governance/commonServiceType/selectList/0`,parm)
}
function getDemandoption2 (id) {
return fly.get(`governance/commonServiceType/selectList/${id}`)
}
// 上报诉求
function addMeasure(parm) {
return fly.post(`governance/userdemand/add`,parm)

Loading…
Cancel
Save