增加测试文档参数,解决空日期

release
Jimmy Liow 2 years ago
parent 53568b4d1f
commit c6206ebfe9

@ -30,7 +30,7 @@ class Reservation {
.then(json => { .then(json => {
if (json.errcode == 0) { if (json.errcode == 0) {
runInAction(() => { runInAction(() => {
this.reservationList = (json?.Result ?? []).map((data, index) => { this.reservationList = (json?.Result??[]).map((data, index) => {
return { return {
key: data.vas_gri_sn, key: data.vas_gri_sn,
reservationId: data.vas_gri_sn, reservationId: data.vas_gri_sn,
@ -42,7 +42,7 @@ class Reservation {
guide: data.Guide guide: data.Guide
} }
}); });
this.reservationPage.total = (json?.Result ?? [{RsTotal: 0}]).RsTotal; this.reservationPage.total = (json?.Result??[{RsTotal: 0}]).RsTotal;
}); });
} else { } else {
throw new Error(json.errmsg + ': ' + json.errcode); throw new Error(json.errmsg + ': ' + json.errcode);
@ -63,7 +63,7 @@ class Reservation {
this.reservationDetail = { this.reservationDetail = {
referenceNumber: json.PlanDetail[0].GRI_Name, tourGuide: json.PlanDetail[0].Guide, arrivalDate: json.PlanDetail[0].eoi_getdate referenceNumber: json.PlanDetail[0].GRI_Name, tourGuide: json.PlanDetail[0].Guide, arrivalDate: json.PlanDetail[0].eoi_getdate
}; };
this.confirmationList = (json?.PlanChange ?? []).map((data, index) => { this.confirmationList = (json?.PlanChange??[]).map((data, index) => {
return { return {
key: data.PCI_SN, key: data.PCI_SN,
PCI_Changetext: data.PCI_Changetext, PCI_Changetext: data.PCI_Changetext,
@ -91,7 +91,7 @@ class Reservation {
.then(json => { .then(json => {
runInAction(() => { runInAction(() => {
if (json.errcode == 0) { if (json.errcode == 0) {
this.cityList = (json?.Result ?? []).map((data, index) => { this.cityList = (json?.Result??[]).map((data, index) => {
return { return {
key: data.CII_SN, key: data.CII_SN,
cityId: data.CII_SN, cityId: data.CII_SN,
@ -117,7 +117,7 @@ class Reservation {
runInAction(() => { runInAction(() => {
if (json.errcode == 0) { if (json.errcode == 0) {
console.info(json.Result); console.info(json.Result);
this.guideList = (json?.Result ?? []).map((data, index) => { this.guideList = (json?.Result??[]).map((data, index) => {
return { return {
guideId: data.TGI_SN, guideId: data.TGI_SN,
guideName: data.TGI2_Name, guideName: data.TGI2_Name,

@ -57,9 +57,9 @@ function Detail() {
'https://view.officeapps.live.com/op/embed.aspx?wdPrint=1&wdHideGridlines=0&wdHideComments=1&wdEmbedCode=0&src='; 'https://view.officeapps.live.com/op/embed.aspx?wdPrint=1&wdHideGridlines=0&wdHideComments=1&wdEmbedCode=0&src=';
// https://www.chinahighlights.com/public/reservationW220420009.doc // https://www.chinahighlights.com/public/reservationW220420009.doc
const reservationUrl = const reservationUrl =
`https://p9axztuwd7x8a7.mycht.cn/service-fileServer/DownloadPlanDoc?GRI_SN=${reservationId}&VEI_SN=${login.travelAgencyId}&FileType=1`; `https://p9axztuwd7x8a7.mycht.cn/service-fileServer/DownloadPlanDoc?GRI_SN=${reservationId}&VEI_SN=${login.travelAgencyId}&FileType=1&Test=1`;
const nameCardUrl = const nameCardUrl =
`https://p9axztuwd7x8a7.mycht.cn/service-fileServer/DownloadPlanDoc?GRI_SN=${reservationId}&VEI_SN=${login.travelAgencyId}&FileType=2`; `https://p9axztuwd7x8a7.mycht.cn/service-fileServer/DownloadPlanDoc?GRI_SN=${reservationId}&VEI_SN=${login.travelAgencyId}&FileType=2&Test=1`;
const reservationPreviewUrl = officeWebViewerUrl + encodeURIComponent(reservationUrl); const reservationPreviewUrl = officeWebViewerUrl + encodeURIComponent(reservationUrl);
const nameCardPreviewUrl = officeWebViewerUrl + encodeURIComponent(nameCardUrl); const nameCardPreviewUrl = officeWebViewerUrl + encodeURIComponent(nameCardUrl);

@ -94,10 +94,6 @@ function Newest() {
const [isModalOpen, setIsModalOpen] = useState(false); const [isModalOpen, setIsModalOpen] = useState(false);
const [dataLoading, setDataLoading] = useState(false); const [dataLoading, setDataLoading] = useState(false);
const { notification } = App.useApp(); const { notification } = App.useApp();
const arrivalDateFrom = arrivalDateRange.length == 0 ? null : arrivalDateRange[0];
const arrivalDateThru = arrivalDateRange.length == 0 ? null : arrivalDateRange[1];
const guideSelectOptions = guideList.map((data, index) => { const guideSelectOptions = guideList.map((data, index) => {
return { return {
value: data.guideId, value: data.guideId,
@ -202,9 +198,11 @@ function Newest() {
allowClear={true} allowClear={true}
inputReadOnly={true} inputReadOnly={true}
presets={DATE_PRESETS} presets={DATE_PRESETS}
value={[arrivalDateFrom, arrivalDateThru]} defaultValue={toJS(arrivalDateRange)}
placeholder={['From', 'Thru']} placeholder={['From', 'Thru']}
onChange={(dateRange) => { reservationStore.updatePropertyValue('arrivalDateRange', dateRange)}} onChange={(dateRange) => {
reservationStore.updatePropertyValue('arrivalDateRange', dateRange == null ? [] : dateRange)
}}
/> />
<Button type='primary' onClick={() => onSearchClick()} loading={dataLoading}>Search</Button> <Button type='primary' onClick={() => onSearchClick()} loading={dataLoading}>Search</Button>
</Space> </Space>

Loading…
Cancel
Save