has been executed to the yellow part, res ["data"] .itemMaterialType = 3,
this.itemMaterialType= res [" data"] .itemMaterialType; this sentence has been executed, why this.itemMaterialType has always been the theoretical this.itemMaterialType=3 of undefined;.
the following is the encapsulation method,
async searchData() {
this.itemMaterialType = "4";
await this.api.Dispatch.queryProcessDetailByProcessId({
processId: this.processId
})
.then(res => {
this.data = res["data"];
this.isFeedMaterial = res["data"].isFeedMaterial.toString();
this.itemMaterialType = res["data"].itemMaterialType;
});
}
queryProcessDetailByProcessId: async (option) => await this.http.getByPromise("/api/ScheduleProcess/GetProcessDetail", option),
async getByPromise(url: string, params: {}) {
return await this.http.get(this.domain + url, { observe: "body", params: params })
.toPromise();
}