import { commonDemandDetail, demandDetail, dictlist, listServerOrg, userdemandAssign, } from "../../utils/statisticsApi"; const config = require('../../utils/config') Component({ properties: { visible: { type: Boolean, value: false }, detail: { type: Object, value: () => { }, }, id: { type: String, value: '' } }, data: { agencyId: '', loading: true, form: { serviceType: "", serverId: "", }, serviceOptions: [], serviceIndex: -1, serviceOptiondIndex: -1, serviceOptiondList: [], }, ready: function () { dictlist({ dictType: "user_demand_service_type", }) .then((res) => { this.setData({ serviceOptions: res.data }) }) }, methods: { close() { this.triggerEvent('close') }, sure() { userdemandAssign({ ...this.data.form, demandRecId: this.data.detail.demandRecId }).then(res => { wx.showToast({ icon: 'success', title: '操作成功' }) this.close() }) }, serviceOptiondListChange(e) { this.setData({ serviceOptiondIndex: e.detail.value, "form.serverId": this.data.serviceOptiondList[e.detail.value].id }) }, getServiceuserList(e) { this.setData({ serviceIndex: e.detail.value, "form.serviceType": this.data.serviceOptions[e.detail.value].value }) let params = { serviceTypeId: this.data.detail.categoryCode[1],//上级ID serverOrgType: this.data.serviceOptions[e.detail.value].value,//选的类型 businessType: "resi_service", }; // serviceOptiondIndex listServerOrg(params).then((res) => { this.setData({ serviceOptiondList: res.data || [] }) }) }, } });