Commit 13c6e474 authored by cellee's avatar cellee

设施限制

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 489fc3c6
......@@ -72,19 +72,6 @@ const Facilitys = (props: any) => {
// 存储到mode里面去
dispatch({ type: module + '/genxin', list });
// 当前页面也要刷新
// let list = fileList;
// setFileList(list); // 注意 不能直接赋值 因为使用完全绑定需要全部更新
// setFileList(list);
// let list: any = [...fileList, ...info.fileList];
// setFileList(list);
// 将图片信息提交给state
// let data = { val: info.file.name, key: keys };
// dispatch({ type: module + '/retImgsList', data });
// 结束
} else if (info.file.status === 'error') {
message.error(`${info.file.name} file upload failed.`);
}
......@@ -130,6 +117,17 @@ const Facilitys = (props: any) => {
dispatch({ type: module + '/genxin', list });
};
// 删除图片
const deleteImgs = (key: any, id: any) => {
let list = FacilitysList;
list[key].name = '';
list[key].fileList = [];
// 存储到mode里面去
dispatch({ type: module + '/genxin', list });
};
// 新增按钮
const uploadButton = (
<div>
......@@ -162,7 +160,7 @@ const Facilitys = (props: any) => {
disabled={disabled} // 禁止
onPreview={handlePreview} // 预览
onRemove={() => {
deleteImg(index, item.id);
deleteImgs(index, item.id);
}} //移除
>
{FacilitysList[index].fileList.length > 0 ? null : uploadButton}
......@@ -180,7 +178,7 @@ const Facilitys = (props: any) => {
id={index}
onChange={(e: any) => monitor(e, index)}
value={FacilitysList[index].name}
disabled={FacilitysList[index].disabled}
disabled={FacilitysList[index].disabled || disabled}
/>
</Form.Item>
<div className={'over'}>
......
......@@ -37,7 +37,6 @@ const SearchOptionsTow = (porps: any) => {
) : (
<Select
showSearch
allowClear
style={{ width: 200 }}
placeholder="Community Name"
optionFilterProp="children"
......
......@@ -10,9 +10,8 @@ import { connect } from 'umi';
import TitleBack from '../../../components/TitleBack/TitleBack';
import TextArea from 'antd/lib/input/TextArea';
import { getUrlLast } from '../../../utils/string';
const BookingDetail = (props: any) => {
const { dispatch, location, DataSave, history, DataSaveDetail, token, load } = props;
const { dispatch, DataSave, history, DataSaveDetail, token, load } = props;
const RA = (index: any, values: any) => {
dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } });
......@@ -22,8 +21,6 @@ const BookingDetail = (props: any) => {
if (DataSave != null) {
// 已预约时间段
let arr = DataSave.subscribeTime.split(',');
console.log(arr[0]);
console.log(arr[arr.length - 1]);
setExtractTime(`${arr[0]} To ${arr[arr.length - 1]}`);
if (DataSave.managerFeeStatus != 0) {
RA(2, { accountCategoriesId: DataSave.id });
......@@ -165,11 +162,12 @@ const BookingDetail = (props: any) => {
<hr />
{/* 已交押金且未产生退费且不是免费的 */}
{DataSave &&
{(DataSave &&
DataSaveDetail &&
DataSave.managerFeeStatus == 1 &&
DataSaveDetail.backMarginFee == 0 &&
DataSaveDetail.managerFee > 0 ? (
DataSaveDetail.managerFee > 0) ||
(DataSave.managerFee == 0 && DataSave.marginFee > 0 && DataSave.status != 3) ? (
<>
<Form
ref={formRef}
......@@ -190,6 +188,10 @@ const BookingDetail = (props: any) => {
<Radio value={1} style={radioStyle}>
Full Refund
</Radio>
{DataSave.status == '2' || DataSave.status == '4' ? (
''
) : (
<Radio value={2} style={radioStyle}>
Partial Refund
{backFeeFlag ? (
......@@ -212,6 +214,7 @@ const BookingDetail = (props: any) => {
</>
) : null}
</Radio>
)}
</Radio.Group>
{backFeeFlag ? (
......
......@@ -21,8 +21,6 @@ import { validateMessages } from '@/utils/params';
const module = 'FacilityBookings';
import moment from 'moment';
import OnTime from '@/components/OnTime/OnTime';
const Facility = (props: any) => {
const { dispatch, location, token, sourceData, DataSave, Result, load, FacilitysList } = props;
......@@ -479,10 +477,7 @@ const Facility = (props: any) => {
</Input.Group>
<hr></hr>
{/* <Row gutter={32} style={{ marginTop: 28 }}>
<Col>Appointment Period</Col>
<Col><TimeSelect putSubmit={TimeSelectRef} defaultValue={timeExtend} disabled={facilityDetail}/></Col>
</Row> */}
{facilityDetail ? (
<>
{imgOpen ? (
......
import React, { useState, useEffect } from 'react';
import { Input, Tabs, Pagination, Space, Button, message } from 'antd';
import { Tabs, Pagination, Space, Button, message } from 'antd';
const { TabPane } = Tabs;
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { useIntl, connect, history } from 'umi';
import { objectColumns } from '../../../utils/string';
import { timestampToTime } from '../../../utils/time';
import TitleSearch from '../../../components/TitleSearch/TitleSearch';
// const managerFeeStatusDes= ["未交", "已交", "已退"]
......@@ -27,8 +26,6 @@ import { PlusOutlined } from '@ant-design/icons';
import moment from 'moment';
const FacilityBookings = (props: any) => {
const { formatMessage } = useIntl();
const {
dispatch,
location,
......@@ -316,7 +313,7 @@ const FacilityBookings = (props: any) => {
<TitleSearch
status={[
{
name: ['status', 'Order status'],
name: ['status', 'Booking status'],
data: [
[0, 'All'],
[1, 'Applied'],
......
......@@ -70,11 +70,13 @@ const FacilityTow = (props: any) => {
// 点击设施获取到的设施列表
useEffect(() => {
if (DataSaveDetail) {
if (DataSaveDetail !== null) {
let { categories, facilities } = DataSaveDetail;
console.log(categories);
// 设施A、设施B小图
let list: any = categories.map((item: any, index: any) => {
let list: any = categories
? categories.map((item: any, index: any) => {
let sam = {
id: index,
name: item.categoriesName,
......@@ -92,11 +94,14 @@ const FacilityTow = (props: any) => {
['shebei_' + index]: item.categoriesName,
});
return sam;
});
})
: [];
dispatch({ type: module + '/genxin', list });
// 设施总图片
let fileListImg: any = [];
if (facilities) {
facilities.facilitiesImageList.map((item: any, index: any) => {
let sam = {
uid: index,
......@@ -107,8 +112,6 @@ const FacilityTow = (props: any) => {
fileListImg.push(sam);
});
setFileList([...fileListImg]);
// 设置表单默认值
formRef.current.setFieldsValue(facilities);
// 周期
......@@ -119,6 +122,9 @@ const FacilityTow = (props: any) => {
Time: [moment(time[0], 'HH:mm'), moment(time[1], 'HH:mm')],
});
}
setFileList([...fileListImg]);
}
}, [DataSaveDetail]);
// tab 切换
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment