diff --git a/src/config.js b/src/config.js index 1d6deef..6e0a1d8 100644 --- a/src/config.js +++ b/src/config.js @@ -1,7 +1,7 @@ import React from "react"; import dayjs from "dayjs"; -export const HT_HOST = process.env.NODE_ENV == "production" ? "https://p9axztuwd7x8a7.mycht.cn" : "http://202.103.68.100:890"; +export const HT_HOST = process.env.NODE_ENV == "production" ? "https://p9axztuwd7x8a7.mycht.cn" : "http://202.103.68.144:890"; export const DATE_FORMAT = "YYYY-MM-DD"; export const DATE_PRESETS = [ { @@ -36,4 +36,4 @@ export const DATE_PRESETS = [ // 今年: [dayjs().startOf("year"), moment().endOf("year")], // 去年: [dayjs().subtract(1, "year").startOf("year"), moment().subtract(1, "year").endOf("year")], ]; -export const arrManager = ["testzp","testzac","testycc","testlyj","testqqs","testjjh","testhn"];//特定账号加修改所属供应商的菜单 zp \ No newline at end of file +export const arrManager = ["testzp","testzac","testycc","testlyj","testqqs","testjjh","testhn"];//特定账号加修改所属供应商的菜单 zp diff --git a/src/stores/Feedback.js b/src/stores/Feedback.js index 38b561d..c9b7703 100644 --- a/src/stores/Feedback.js +++ b/src/stores/Feedback.js @@ -37,8 +37,14 @@ class Feedback { url += `?PageSize=2000&PageIndex=1&PageTotal=0&veisn=${veisn}&GruopNo=${EOI_Group_Name}&TimeStart=${TimeStart}&TimeEnd=${TimeEnd}`; url += `&token=${this.root.authStore.login.token}`; return fetchJSON(config.HT_HOST + url).then(json => { + // 反馈表, 有新版就用新版 + const allGroup = groupBy(json.Result, "EOI_GRI_SN"); + const filterV = Object.keys(allGroup).reduce((r, gsn) => { + const v2 = allGroup[gsn].filter(v => v.EOI_CII_SN); + return r.concat(v2.length > 0 ? v2 : allGroup[gsn]); + }, []) runInAction(() => { - this.feedbackList = json.Result; + this.feedbackList = filterV; this.loading = false; }); if (json.errcode !== 0) { @@ -78,20 +84,21 @@ class Feedback { */ getCustomerFeedbackDetail(VEI_SN, GRI_SN, CII_SN) { let url = `/service-CooperateSOA/get_feedback_service_item`; - url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}&city_sn=${CII_SN}&lgc=1`; - url += `&token=${this.root.authStore.login.token}`; - fetch(config.HT_HOST + url) - .then(response => response.json()) - .then(json => { - const itemGroup = groupBy(json.feedbackItemList, ele => ele.type); + url += `?GRI_SN=${GRI_SN}&VEI_SN=${VEI_SN}&city_sn=${CII_SN}&lgc=1`; + url += `&token=${this.root.authStore.login.token}`; + fetch(config.HT_HOST + url) + .then((response) => response.json()) + .then((json) => { + const itemGroup = groupBy(json.feedbackItemList, 'type'); const serviceItem = { HWO_Guide: itemGroup?.W || [], HWO_Driver: itemGroup?.Y || [], HWO_Activity: [ - ...(itemGroup['7'] || []), - ...(itemGroup.G || []), - ...(itemGroup.C || []), - ...(itemGroup.A || []).map(ele => ({ ...ele, Describe: 'Hotel ' + ele.name })),], + ...(itemGroup['7'] || []), + ...(itemGroup.G || []), + ...(itemGroup.C || []), + ...(itemGroup.A || []).map((ele) => ({ ...ele, Describe: ele.name })), + ], }; const OtherThoughts = json.feedbackEvaluation[0]?.otherComments || ''; const PhotoPermission = json.feedbackEvaluation[0]?.usePhotos || ''; @@ -99,12 +106,12 @@ class Feedback { const cityName = json.group[0]?.cityName || ''; runInAction(() => { - this.feedbackServiceRate = {...serviceItem, OtherThoughts, PhotoPermission, signatureData, cityName }; - }); - }) - .catch(error => { - console.log("fetch data failed", error); - }); + this.feedbackServiceRate = { ...serviceItem, OtherThoughts, PhotoPermission, signatureData, cityName }; + }); + }) + .catch((error) => { + console.log('fetch data failed', error); + }); } //获取供应商提交的图片 diff --git a/src/views/feedback/CustomerDetail.jsx b/src/views/feedback/CustomerDetail.jsx index dc39bc7..235141c 100644 --- a/src/views/feedback/CustomerDetail.jsx +++ b/src/views/feedback/CustomerDetail.jsx @@ -132,7 +132,7 @@ function Detail() { Other thoughts you want to share with us: {OtherThoughts} Signature: - customer signature + {signatureData ? customer signature : null}