Commit f208c44a authored by cellee's avatar cellee

新增小区搜索也一并新增,预定设施功能完善,预订列表提示等内容完善

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 8ca7af94
......@@ -53,14 +53,12 @@ function getDotText(arr) {
}
}
class SelectOptions extends React.Component {
class SelectOptions extends React.PureComponent {
state = {};
constructor(props) {
super(props);
const { list, dispatch, checklist } = this.props;
console.log(list);
if (list == null) {
//console.error("组件错误:没有数据导入")
}
......@@ -102,7 +100,8 @@ class SelectOptions extends React.Component {
}
console.log(this.state.componetVisible);
}
// console.log(this.props.list);
if (this.props.list.length > this.state.checkedList.length) {
}
// console.log(prevProps.list);
// if (this.props.list.length > prevProps.list.length) {
// console.log(this.props.list);
......@@ -229,7 +228,7 @@ class SelectOptions extends React.Component {
};
// 索引 -- 全部点击
itemSelectAll = (e) => {
console.log(this.props.list);
// console.log(this.props.list);
this.setState({
checkedListOptions: this.props.list,
checkedList: this.state.resultList,
......
......@@ -64,8 +64,10 @@ export default {
switch (playload.index) {
case 24:
{
let CommunityList = null;
yield put({ type: 'Init/returnCommunityList', CommunityList });
let Data = resp.data;
let CommunityList = resp.data.communityList;
CommunityList = resp.data.communityList;
yield put({ type: 'returnPage', Data });
yield put({ type: 'Init/returnCommunityList', CommunityList });
}
......
......@@ -2,100 +2,97 @@ import * as service from '../../services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
import { routerRedux } from 'dva/router';
export default {
namespace: 'Contract',
state: {
Data: { data: [], total: 0 },
curString:{},
curString: {},
Result: null,
DataSave: null,
DataSaveDetail:null,
playload:{}
DataSaveDetail: null,
playload: {},
},
reducers: {
returnPage(state, { Data}) {
returnPage(state, { Data }) {
return { ...state, Data };
},
returnResult(state, { Result}) {
return { ...state, Result};
returnResult(state, { Result }) {
return { ...state, Result };
},
returnDataSave(state, { DataSave }) {
return {...state,DataSave}
return { ...state, DataSave };
},
returnDataSaveDetail(state, { DataSaveDetail }) {
return {...state,DataSaveDetail}
return { ...state, DataSaveDetail };
},
returnPath(state, { playload}) {
returnPath(state, { playload }) {
return { ...state, playload };
},
},
effects: {
//预订设施查询
*RA({ playload }, { call, put }) {
console.log("开始请求")
console.log('开始请求');
const resp = yield call(service.RA, playload);
console.log(resp)
if (resp.code == 500||resp.error_code!="0000") {
console.log(resp);
if (resp.code == 500 || resp.error_code != '0000') {
// window.location.href = '/500';
}
if (resp.error_code != "0000") {
console.log("请求错误码:"+"("+playload.index+")" + resp.error_code)
console.log(playload)
}
else {
if (resp.error_code != '0000') {
console.log('请求错误码:' + '(' + playload.index + ')' + resp.error_code);
console.log(playload);
} else {
switch (playload.index) {
case 19:
{
let Data = resp.data;
yield put({ type: 'returnPage', Data});
} break;
yield put({ type: 'returnPage', Data });
}
break;
case 20:
{
let DataSaveDetail = resp.data;
yield put({ type: 'returnDataSaveDetail', DataSaveDetail});
}break;
case 27: {
yield put({ type: 'returnDataSaveDetail', DataSaveDetail });
}
break;
case 27:
{
message.success('save success !');
var tmp=resp
yield put({ type: 'returnResult', tmp })
setTimeout(function(){
history.goBack()
},1000)
} break;
var tmp = resp;
yield put({ type: 'returnResult', tmp });
setTimeout(function () {
history.goBack();
}, 1000);
}
break;
}
}
},
// url 带参数
*RA2({ playload }, { call, put }){
console.log("开始请求")
const resp = yield call(service.RA2, playload);
console.log(resp)
},
*ResultClear({ }, { put }) {
var tmp=null
yield put({type: 'returnResult', tmp} )
// *RA2({ playload }, { call, put }){
// console.log("开始请求")
// const resp = yield call(service.RA2, playload);
// console.log(resp)
// },
*ResultClear({}, { put }) {
var tmp = null;
yield put({ type: 'returnResult', tmp });
},
*SA({ playload }, { call, put }) {
var DataSave = playload
yield put({type: 'returnDataSave', DataSave} )
var DataSave = playload;
yield put({ type: 'returnDataSave', DataSave });
},
*Paths({ playload }, { put }){
yield put({type: 'returnPath', playload} )
}
*Paths({ playload }, { put }) {
yield put({ type: 'returnPath', playload });
},
},
subscriptions: {
......@@ -103,16 +100,15 @@ export default {
// 监听 路由
return history.listen(({ pathname }) => {
let path = {
path : pathname
}
path: pathname,
};
dispatch({
type: 'Paths', // 选择返回值
playload:{
path
playload: {
path,
},
})
});
}
}
});
},
},
};
......@@ -132,7 +132,13 @@ export default {
case 1:
{
let Data3 = resp.data;
if (JSON.stringify(Data3) == "{}") {
Data3 = false
// 提示小区没有设施
message.error('There Are No Facilities In The Community !');
}
yield put({ type: 'returnPage3', Data3});
}break;
case 2:{
......@@ -154,6 +160,11 @@ export default {
let tmp = resp.data;
const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
const reg2 = [["url", null]]
//let sourceData = tmp;
// sourceData.categoriesOpenTime= timeToMoment(tmp.categoriesOpenTime);
// sourceData.categoriesName = Fromate(tmp.categoriesList, reg),
// sourceData.categoriesDetailsImageName = Fromate(tmp.facilitiesImageList, reg2)
let sourceData = {
canReservationDay: tmp.canReservationDay,
canReservationNum: tmp.canReservationNum,
......
......@@ -66,17 +66,14 @@ const Facility = (props: any) => {
const formRef = useRef(null);
// 进来先清空上传图片列表
useEffect(() => {
dispatch({ type: module + '/overAllImgList' });
}, [1]);
// 再监听列表
const [extImgList, setextImgList] = useState(imgList);
useEffect(() => {
console.log('变化');
console.log(imgList);
if (imgList != null) {
setextImgList(imgList);
}
}, [imgList]);
useEffect(() => {
......@@ -144,12 +141,12 @@ const Facility = (props: any) => {
var result = values;
// 过滤表单;
let imgs = extImgList.filter((item: any) => (Object.keys(item).length == 0 ? false : true));
console.log(imgs.length);
// 开放时间判断
if (imgs.length < 1) {
message.error('请至少上传一个设施');
if (imgs.length == 0) {
message.error('Please upload at least one facility!');
} else if (!result.endTime && !result.startTime) {
message.error('请选择开放时间');
message.error('Please select the opening time!');
} else {
// 先处理设施和时间
let categoriesName: any = [];
......@@ -161,13 +158,16 @@ const Facility = (props: any) => {
if (imgs[i].name && imgs[i].pic) {
categoriesName[i] = `${imgs[i].name}&${imgs[i].pic}`;
} else {
message.error('请填写设备名称');
message.error('Please fill in the name of the facility!');
return;
}
}
result.categoriesName = categoriesName;
result.reservationQuantumTime = reservationQuantumTime;
result.categoriesName = categoriesName; // 设施内容
result.reservationQuantumTime = reservationQuantumTime; // 开放时间段
result.categoriesOpenTime = `${result.startTime}-${result.endTime}`; // 预约时间段 二开需要
delete result.startTime;
delete result.periodType;
delete result.picList;
console.log(reservationQuantumTime);
console.log(result);
RA(6, result);
......
......@@ -21,7 +21,9 @@ import { getUrlLastParams } from '../../../utils/string';
import './css/index.less';
import ProTable from '@ant-design/pro-table';
import { PlusOutlined, SearchOutlined, ClearOutlined } from '@ant-design/icons';
import { PlusOutlined, ClockCircleOutlined, ClearOutlined } from '@ant-design/icons';
import moment from 'moment';
const FacilityBookings = (props: any) => {
const { formatMessage } = useIntl();
......@@ -53,6 +55,8 @@ const FacilityBookings = (props: any) => {
const goToFunction = () => {
if (curString.tab == 2) {
CA();
// 先清空上传图片列表
dispatch({ type: 'FacilityBookings/overAllImgList' });
}
history.push(location.pathname + (curString.tab == 1 ? '/Booking' : '/Adding'));
};
......@@ -78,10 +82,25 @@ const FacilityBookings = (props: any) => {
[
'Order Time',
null,
(text: any, record: any) => <div>{timestampToTime(record.createTime.time)}</div>,
(text: any, record: any) => (
<div>
<ClockCircleOutlined style={{ color: '#666' }} />
&nbsp;
{moment(record.createTime.time).format('YYYY-MM-DD')}
</div>
),
],
['Booking Schedule', 'subscribeDate'],
[
'Booking Schedule',
'subscribeDate',
(text: any) => (
<div>
<ClockCircleOutlined style={{ color: '#666' }} />
&nbsp;{text}
</div>
),
],
['Fee', 'managerFeeStatus', (text: any) => <div>{managerFeeStatusDes[text]}</div>],
['Deposit', 'marginFeeStatus', (text: any) => <div>{marginFeeStatusDes[text]}</div>],
['Status', 'status', (text: any) => <div>{statusDes[text]}</div>],
......@@ -268,7 +287,7 @@ const FacilityBookings = (props: any) => {
<Tabs defaultActiveKey={curString.tab.toString()} onChange={TabCallback}>
<TabPane tab="Facility Bookings" key="1">
<Table
<ProTable
loading={loading}
rowKey="id"
style={{ marginTop: 16 }}
......@@ -280,6 +299,22 @@ const FacilityBookings = (props: any) => {
showSizeChanger: false,
onChange: Pagechange,
}}
search={false}
toolBarRender={() => [
<Button key="3" type="primary" onClick={goToFunction}>
<PlusOutlined />
添加预约
</Button>,
]}
options={{
density: true,
fullScreen: true,
reload: () => {
// onReset();
},
setting: false,
}}
headerTitle="预约列表"
/>
</TabPane>
......@@ -299,14 +334,7 @@ const FacilityBookings = (props: any) => {
// pagination={false} // 隐藏默认分页
search={false}
toolBarRender={() => [
<Button
key="3"
type="primary"
onClick={() => {
// goToAdd(0, {});
goToFunction();
}}
>
<Button key="3" type="primary" onClick={goToFunction}>
<PlusOutlined />
添加设施
</Button>,
......
......@@ -4,165 +4,187 @@
.base {
width: 100%;
background-color: #ffffff;
padding: 34px;
min-width: 1020px;
padding: 20px;
}
//头部组件
.box{
.box {
width: 100%;
height: 64px;
position: relative;
}
.item1{
.item1 {
position: absolute;
width: 180px;
text-align: center;
border-left: 5px solid rgba(24,144,255,1);
font-family:'Source Han Sans CN';
border-left: 5px solid rgba(24, 144, 255, 1);
font-family: 'Source Han Sans CN';
font-size: 18px;
font-weight: 600;
color: #000000;
}
.item2{
width:300px;
.item2 {
width: 300px;
position: absolute;
left: (300px);
line-height: 30px;
}
.item4{
.item4 {
position: absolute;
left: (500px);
line-height: 30px;
}
.item3{
width:80px;
.item3 {
width: 80px;
height: 32px;
position: absolute;
right: 0;
outline: none;
background:none;
background: none;
cursor: pointer;
border:1px solid rgba(217,217,217,1);
border-radius:2px;
border: 1px solid rgba(217, 217, 217, 1);
border-radius: 2px;
}
.box1{
.box1 {
width: 100%;
height: 34px;
position: relative;
margin-bottom: 26px;
}
.box1item1{
.box1item1 {
position: absolute;
line-height: 32px;
}
.box1item2{
.box1item2 {
position: absolute;
left: 161px;
left: 135px;
}
.box2{
.box2 {
width: 100%;
position: relative;
}
.box2item1{
.box2item1 {
position: absolute;
line-height: 32px;
}
.box2item2{
.box2item2 {
width: 336px;
padding-left: 161px;
padding-left: 135px;
}
// 线栏
.line{
.line {
width: 100%;
height: 1px;
border-top: 1px solid rgba(217,217,217,1);
border-top: 1px solid rgba(217, 217, 217, 1);
margin-top: 28px;
margin-bottom: 28px;
}
.box3{
.box3 {
width: 100%;
height: 32px;
position: relative;
margin-bottom: 28px;
}
.box3item1{
.box3item1 {
position: absolute;
line-height: 32px;
}
.box3item2{
.box3item2 {
position: absolute;
left: 161px;
left: 135px;
}
.box3item3{
.box3item3 {
position: absolute;
left: 467px;
line-height: 32px;
}
.box3item4{
.box3item4 {
position: absolute;
left: 592px;
}
.box4{
.box4 {
width: 100%;
height: 32px;
min-height: 32px;
position: relative;
&::after {
content: '';
display: block;
width: 100%;
clear: both;
}
}
.box4item1{
.box4item1 {
position: absolute;
line-height: 32px;
}
.box4item2{
.box4item2 {
position: absolute;
left: 161px;
left: 135px;
}
.box4item3{
.box4item3 {
position: absolute;
left: 257px;
}
.box4item4{
.box4item4 {
position: absolute;
left: 281px;
}
.box4item5{
.box4item5 {
position: absolute;
left: 365px;
}
.box4item6{
.box4item6 {
position: absolute;
left: 380px;
}
.box5{
.box5 {
width: 100%;
height: 32px;
position: relative;
margin-bottom: 28px;
}
.box5item1{
.box5item1 {
position: absolute;
line-height: 32px;
}
.box5item2{
.box5item2 {
position: absolute;
left: 161px;
left: 135px;
}
.box6{
.box6 {
width: 100%;
height: 32px;
position: relative;
margin-bottom: 20px;
}
.box6item1{
.box6item1 {
position: absolute;
}
.box6item2{
.box6item2 {
position: absolute;
left: 216px;
}
.divbox4 {
position: absolute;
left: 135px;
.ant-form-item {
display: inline-block;
}
.jio,
.heng {
display: inline-block;
line-height: 32px;
margin: 0 20px;
}
}
......@@ -40,3 +40,13 @@ export const NewFaci = [
[{ required: false, message: 'Required' }],
[{ required: false, message: 'Required' }],
];
// 设施预订
export const BookingsTip = [
[{ required: false, message: 'Please select community' }],
[{ required: false, message: 'Please input Facility Name' }],
[{ required: false, message: 'Please Set management fee' }],
[{ required: false, message: 'Please Set Setting deposit' }],
[{ required: false, message: 'Please Upload facility photos' }],
[{ required: false, message: 'Required' }],
];
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