Commit b9d84879 authored by maple's avatar maple

[new]合同模块

parent 2bd7d5ab
......@@ -87,6 +87,7 @@ export default defineConfig({
{ path: './', component: './UserManagement/LIFEUserManagement/Users' },
{ path: './Add', component: './UserManagement/LIFEUserManagement/UsersAdd' },
{ path: './Detail', component: './UserManagement/LIFEUserManagement/UsersDetail' },
{ path: './Edit', component: './UserManagement/LIFEUserManagement/UsersDetail' },
]
},
{
......@@ -215,11 +216,11 @@ export default defineConfig({
name: 'facilitybookings',
routes: [
{ path: "./", component: './CommunityManagement/FacilityBookings/FacilityBookings' },
{ path: "./Adding", component: './CommunityManagement/FacilityBookings/FacilityManager' },
{ path: "./Booking", component: './CommunityManagement/FacilityBookings/Bookings' },
{ path: "./Detail", component: './CommunityManagement/FacilityBookings/Detail' },
{ path: "./FacilityEdit", component: './CommunityManagement/FacilityBookings/FacilityManager' },
{ path: "./FacilityDetail", component: './CommunityManagement/FacilityBookings/FacilityManager' },
{ path: "./Detail", component: './CommunityManagement/FacilityBookings/BookingDetail' },
{ path: "./Adding", component: './CommunityManagement/FacilityBookings/Facility' },
{ path: "./FacilityEdit", component: './CommunityManagement/FacilityBookings/Facility' },
{ path: "./FacilityDetail", component: './CommunityManagement/FacilityBookings/Facility' },
{ path: "./FacilityApply",component:'./CommunityManagement/FacilityBookings/Bookings'}
]
},
......
......@@ -16,7 +16,7 @@ const proSettings: DefaultSettings = {
menu: {
locale: true,
},
title: '这只是个测试',
title: 'TOS_v1.0.5',
pwa: false,
iconfontUrl: '',
};
......
......@@ -12,9 +12,13 @@ const BackButton = (props:any) => {
history.go(-1)
}
const goToReturnByParam = () => {
console.log("跳转页面"+url)
if (url == "none") {
props.backFunction()
} else {
console.log("跳转页面" + url)
history.push(url)
}
}
return (
<>
{
......
......@@ -70,8 +70,12 @@ const PictureOptions = (props:any) => {
}
const InputGet = (index: any, e: any) => {
var tmp = fileList
if ((e.target.value).length == 0) {
tmp[index].name = null
} else {
tmp[index].name = e.target.value
}
// console.log(tmp)
props.putSubmit(CheckParm(tmp))
}
return (
......
......@@ -7,7 +7,7 @@ class SearchOptions extends React.Component {
};
constructor(props) {
super(props);
const {list,defaultValue} = this.props;
const {list,defaultValue,disabled} = this.props;
// console.log("重要的")
this.state={
data: [],
......@@ -62,14 +62,18 @@ class SearchOptions extends React.Component {
value={this.state.value}
placeholder={"Community Name"}
optionFilterProp="children"
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
// style={this.props.style}
defaultActiveFirstOption={false}
// defaultActiveFirstOption={false}
showArrow={true}
filterOption={false}
// filterOption={false}
onSearch={this.handleSearch}
onChange={this.handleChange}
notFoundContent={<div><Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />Please enter the correct Community Name!</div>}
style={{ width: 200 }}
disabled={this.props.disabled}
>
{options}
</Select>
......@@ -96,3 +100,4 @@ filterOption={(input, option) =>
<Option value="lucy">Lucy</Option>
<Option value="tom">Tom</Option>
</Select>, */}
......@@ -5,7 +5,7 @@ import SearchOptions from './SearchOptions';
const SearchOptionsCommnity = (props: any) => {
const {dispatch, CommunityList,defaultValue,placeholder } = props;
const {dispatch, CommunityList,defaultValue,placeholder,disabled} = props;
const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})};
useEffect(() => {
......@@ -21,7 +21,7 @@ const SearchOptionsCommnity = (props: any) => {
}
return (
<>
<SearchOptions placeholder={placeholder} defaultValue={defaultValue} list={CommunityList} onSubmit={extendName} />
<SearchOptions disabled={disabled} placeholder={placeholder} defaultValue={defaultValue} list={CommunityList} onSubmit={extendName} />
</>
);
};
......
import React from 'react';
import React, { useEffect } from 'react';
import styles from './index.less';
import { Input, Menu, Table, Space } from 'antd';
import { Row, Col, Table, Space,Tabs, Button } from 'antd';
const { TabPane } = Tabs
import { objectColumns} from '@/utils/string';
import { size } from 'lodash';
import TitleBlack from '';
const TableShow = (props:any) => {
const { data } = props;
const dataRow = data.rows;
const goTo = (values:any,e:any) => {
console.log(values)
props.onSubmit(values)
}
const deleteUnit = (values: any, e: any) => {
props.onChange(values)
}
useEffect(() => {
console.log("组件入参")
console.log(dataRow)
},[])
//
// Contact Details
// Email
// cdk_code
// Account Type
// User Status
// ower_email: "535740436@qq.com"
// ower_name: "测试"
// ower_phone: "微微"
const key = [
["Service Community", "communityName"],
["User Name", "accountName"],
["Facility Bookings", "facilityTitle"],
["User Name", "ower_name"],
["Contact Details", "ower_phone"],
["Email", "ower_email"],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a onClick={goTo.bind(this,record)}>Detail</a></Space>)],
]
return (
<>
<Table dataSource={Data2.data} columns={columns2}></Table>
<Tabs defaultActiveKey="0" >
{
dataRow.map((item, index) => {
return(
<TabPane tab={item.name} key={index}>
<Row gutter={16}><Col>Address:</Col><Col>{((item.unit)[0].member)[0].address_and_postalCode}</Col></Row>
{
(item.unit).map((unit:any, uindex:any) => {
return (
<div key={unit.living}>
<Row gutter={32}>
<Col span={20}>
<Table title={() => {
return (<Row gutter={32}><Col>Unit No:</Col><Col>{unit.living}</Col><Col>
{props.deleteDisable ? <Button type="danger" onClick={deleteUnit.bind(this, unit.living)}>Delete</Button> : null}</Col></Row>)
}} footer={() => ''} rowKey={"ower_name"} dataSource={unit.member} columns={objectColumns(key)} pagination={false}></Table>
</Col>
<Col>
<Row>
<img width={80} src={unit.imgUrl} />
</Row>
<Row style={{marginTop:8}}><div style={{width:80,textAlign:"center"}}>{((item.unit)[0].member)[0].cdk_code}</div></Row>
</Col>
</Row>
</div>
)
})
}
</TabPane>
)})
}
</Tabs>
</>
);
};
export default TableShow;
// User Name
// Contact Details
// Email
// cdk_code
// Account Type
// User Status
// Actions
// address_and_postalCode: "广州石溪5463743"
// building_number: "01"
// cdk_code: 792239
// cdk_status: 1
// enable: 1
// floor_number: "5"
// ower_email: "535740436@qq.com"
// ower_name: "测试"
// ower_phone: "微微"
// room_number: "399"
{/* <div style={{ width: 80, height: 80, border: "1px solid #cccccc",padding:8,lineHeight:1,textAlign:"center",fontSize:12}}>
Activation Code Has Been Used/Is Inactive
</div> */}
\ No newline at end of file
......@@ -10,7 +10,10 @@ import { Color } from 'chalk';
import Item from 'antd/lib/list/Item';
const format = 'HH:mm';
import {timeToMoment} from '../../utils/time'
import { timeToMoment } from '../../utils/time'
const disabledHours =() => [0,1,2,3,4,5,6,7,8,21,22,23]
const TimeSelect = (props:any) => {
const { defaultValue } = props;
......@@ -18,7 +21,25 @@ const TimeSelect = (props:any) => {
const [times, setTimes] = useState([])
const [timesLen, setTimesLen] = useState(0)
const [curString,setCurString]=useState({ButtonNum:1,resultList:[]})
const showBtn = (type:number) => {
var buttonNum = curString
if (type ==0&&buttonNum.ButtonNum==1) {
buttonNum.ButtonNum-=1
} else if(type==1&&buttonNum.ButtonNum==0) {
buttonNum.ButtonNum+=1
}
console.log(buttonNum)
setCurString(buttonNum)
}
const saveResult = (values:any) => {
var tmp = curString
tmp.resultList = values
setCurString(tmp)
console.log("这里")
console.log(curString)
}
useEffect(() => {
console.log("时段选择器")
console.log(defaultValue)
......@@ -30,7 +51,10 @@ const TimeSelect = (props:any) => {
})
setTimes(result)
setTimesLen(result.length)
props.putSubmit( CheckParm(result))
var resultList= CheckParm(result)
saveResult(resultList)
console.log(resultList)
props.putSubmit(resultList)
}
}, [defaultValue]);
......@@ -43,18 +67,30 @@ const TimeSelect = (props:any) => {
const add =() => {
setTimesLen(timesLen + 1)
showBtn(0)
setTimes(times => ([...times, {index:timesLen + 1,time:null}]))
}
const Delete=(index:any) => {
const Delete=(index:any,e:any) => {
var tmp = times
// console.log(times)
// console.log(index)
tmp.splice(index, 1);
setTimes(times => ([...tmp]))
props.putSubmit( CheckParm(tmp))
var resultList = CheckParm(tmp)
if (resultList.length == 0) {
showBtn(1)
}
saveResult(resultList)
console.log(resultList)
props.putSubmit(resultList)
}
const timeForm = (values: any) => {
var result = new Array()
values.map((items, index) => {
result.push(moment(items).format('hh:mm'))
result.push(moment(items).format(format))
})
return result[0] + "-" + result[1]
}
......@@ -72,15 +108,20 @@ const TimeSelect = (props:any) => {
const timeChange = (index: any, values: any) => {
var tmp = times;
// console.log("Maple诊断"+index)
// console.log(values)
console.log("Maple诊断"+index)
console.log(values)
if (values != null) {
tmp[index].time =timeForm(values)
} else {
tmp[index].time =null
}
props.putSubmit(CheckParm(tmp))
var resultList= CheckParm(tmp)
saveResult(resultList)
if (resultList.length != 0) {
showBtn(1)
}
props.putSubmit(resultList)
}
return (
<>
......@@ -91,10 +132,14 @@ const TimeSelect = (props:any) => {
return (
<Row key={item.index} style={{marginBottom:16}}>
<Col>
<RangePicker disabled={props.disabled} defaultValue={timeToMoment(item.time)} minuteStep={5} format={format} onChange={timeChange.bind(this,index)}/>
<RangePicker disabledHours={disabledHours} showTime disabled={props.disabled} defaultValue={timeToMoment(item.time)} minuteStep={5} format={format} onChange={timeChange.bind(this,index)}/>
</Col>
{
props.disabled?null: <Col><DeleteOutlined style={{ cursor: "pointer", marginTop: 10, marginLeft: 8, color: "red" }} onClick={Delete}/> </Col>
props.disabled ? null : <Col>
{
<DeleteOutlined style={{ cursor: "pointer", marginTop: 5, marginLeft: 8, color: "red" }} onClick={Delete.bind(this, index)} />
}
</Col>
}
</Row>
......@@ -104,7 +149,10 @@ const TimeSelect = (props:any) => {
</Col>
{
props.disabled?null:<Col> <PlusCircleFilled style={{ fontSize: 20, cursor: "pointer", marginTop: 8,color:"rgba(24,144,255,1)"}} onClick={add} /></Col>
props.disabled ? null : <Col>
{
curString.ButtonNum==1?<PlusCircleFilled style={{ fontSize: 20, cursor: "pointer", marginTop: 3, color: "rgba(24,144,255,1)" }} onClick={add} />:null
}</Col>
}
......
......@@ -6,6 +6,9 @@ import TitleGet from '../TitleGet/TitleGet';
const TitleBack = (props:any) => {
const backData = (values:any) => {
props.titleBack(values)
}
return (
<>
<div className={styles.item0}><TitleGet title={props.title} /></div>
......@@ -20,7 +23,7 @@ const TitleBack = (props:any) => {
:
<></>
}
<div className={styles.item2}><BackButton url={props.url}/></div>
<div className={styles.item2}><BackButton backFunction={backData} url={props.url}/></div>
<div className={styles.clear0}></div>
</>
);
......
......@@ -26,7 +26,8 @@ const TitleSearch= (props:any) => {
const key = props.listkey
const name = props.list;
const single=props.single
const single = props.single
const checklist = props.checklist;
const status = props.status;
const time = props.time;
......@@ -106,7 +107,7 @@ const TitleSearch= (props:any) => {
<>
{
CommunityList != null ?
<SelectOptions single={single} list={CommunityList.sort()} show={selectOptions} onSubmit={printContent} />:
<SelectOptions checklist={checklist} single={single} list={CommunityList.sort()} show={selectOptions} onSubmit={printContent} />:
null
}
......
import * as service from '../../services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
export default {
namespace: 'Contract',
state: {
Data: { data: [], total: 0 },
curString:{},
Result: null,
DataSave:null
},
reducers: {
returnPage(state, { Data}) {
return { ...state, Data };
},
returnResult(state, { Result}) {
return { ...state, Result};
},
returnDataSave(state, { DataSave }) {
return {...state,DataSave}
}
},
effects: {
//预订设施查询
*RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload);
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 {
switch (playload.index) {
case 19:
{
let Data = resp.data;
yield put({ type: 'returnPage', Data});
} break;
case 18:
case 14:{
message.success("Success Operation!",3)
// window.location.href = '/CommunityManagement/FacilityBookings';
history.push("/UserManagement/LIFEUserManagement")
} break;
case 13: {
let DataSaveDetail = resp.data;
yield put({ type: 'DataSaveDetail', DataSaveDetail });
} break;
case 16: {
console.log("等待删除完成")
} break;
}
}
},
*ResultClear({ }, { put }) {
var tmp=null
yield put({type: 'returnResult', tmp} )
},
*SA({ playload }, { call, put }) {
var DataSave = playload
yield put({type: 'returnDataSave', DataSave} )
},
},
};
......@@ -8,16 +8,22 @@ export default {
namespace: 'FacilityBookings',
state: {
Data: {data:[],total:0},
DataPage:{totalRow:0},
Data2: {data:[],total:0},
Data3: null,
Data4:null,
Data3Error: null,
DataSave: null,
DataSaveDetail: null,
sourceData: null,
curString:{subscribeDate: null, status: null,curPage:1,curPage2:1}
curString: {
subscribeDate: null,
status: 0,
communityNameList: null,
tab:1,
curPage: 1,
curPage2: 1
},
Result:null,
},
reducers: {
......@@ -27,11 +33,8 @@ export default {
returnPage2(state, { Data2 }) {
return { ...state, Data2 };
},
returnPage3(state, { Data3,Data4 }) {
return { ...state, Data3,Data4 };
},
returnData3Error(state, { Data3Error }) {
return { ...state, Data3Error };
returnPage3(state, { Data3 }) {
return { ...state, Data3 };
},
returnDataSave(state, { DataSave }) {
return { ...state, DataSave};
......@@ -45,7 +48,9 @@ export default {
returnCurString(state, { curString }) {
return { ...state, curString };
},
returnResult(state, { Result }) {
return { ...state, Result };
}
},
......@@ -63,16 +68,16 @@ export default {
if (resp.error_code != "0000") {
console.log("请求错误码:"+"("+playload.index+")" + resp.error_code)
console.log(playload)
var Data3Error = null
var Result = null
switch (playload.index) {
case 1:
// message.error("Could't not found the facility!")
Data3Error ={index:playload.index,msg:"Could't not found the facility!"};
yield put({ type: 'returnData3Error', Data3Error });
Result ={index:playload.index,msg:"Could't not found the facility!"};
yield put({ type: 'returnResult', Result });
break;
case 11:
Data3Error ={index:playload.index,msg:"Information Wrong!"};
yield put({ type: 'returnData3Error', Data3Error });
Result ={index:playload.index,msg:"Information Wrong!"};
yield put({ type: 'returnResult', Result });
break;
}
}
......@@ -87,10 +92,8 @@ export default {
break;
case 1:
{
let Data3 = resp.data.categorieList;
var Data4 = { communityManagerFee: resp.data.communityManagerFee, communityMargin: resp.data.communityMargin };
console.log(Data4)
yield put({ type: 'returnPage3', Data3, Data4});
let Data3 = resp.data;
yield put({ type: 'returnPage3', Data3});
}break;
case 2:{
......@@ -100,11 +103,12 @@ export default {
case 3:
case 4:
case 5:
case 11:
case 6:
case 11:{
message.success("Success Operation!",3)
// window.location.href = '/CommunityManagement/FacilityBookings';
history.push("/CommunityManagement/FacilityBookings")
case 17:{
message.success("Success Operation!", 3)
var Result=resp
yield put({ type: 'returnResult', Result })
} break;
case 7: {
let tmp = resp.data;
......@@ -120,7 +124,8 @@ export default {
nomarginCancelReservationDay: tmp.nomarginCancelReservationDay,
periodType: tmp.periodType,
reservationQuantumTime: tmp.reservationQuantumTime,
facilitiesImageList:tmp.facilitiesImageList
facilitiesImageList: tmp.facilitiesImageList,
categoriesList:tmp.categoriesList,
}
// console.log(sourceData)
yield put({ type: 'returnSource', sourceData });
......@@ -138,10 +143,6 @@ export default {
var Data3 = null
yield put({ type: 'returnPage3', Data3 });
},
*IA2({ playload }, { call, put }) {
var Data3Error = null
yield put({ type: 'returnData3Error', Data3Error });
},
*SA({ playload }, { call, put }) {
var DataSave = playload
......@@ -157,6 +158,9 @@ export default {
var curString = playload
yield put({type: 'returnCurString', curString} )
},
*ResultClear({}, {put}) {
yield put({type: 'returnResult', null} )
},
},
......
......@@ -36,6 +36,9 @@ export default {
returnCurString(state, { curString }) {
return { ...state, curString };
},
returnResult(state, { Result }) {
return {...state,Result}
}
},
......@@ -54,11 +57,16 @@ export default {
console.log("请求错误码:"+"("+playload.index+")" + resp.error_code)
console.log(playload)
var Data3Error = null
var Result=null
switch (playload.index) {
case 11:
Data3Error ={msg:"Information Wrong!"};
case 11: {
Data3Error = { msg: "Information Wrong!" };
yield put({ type: 'returnData3Error', Data3Error });
break;
} break;
case 16:{
Result = resp;
yield put({ type: 'returnResult', Result });
} break;
}
}
else {
......@@ -68,7 +76,8 @@ export default {
{
let Data = resp.data;
yield put({ type: 'returnPage', Data});
}break;
} break;
case 18:
case 14:{
message.success("Success Operation!",3)
// window.location.href = '/CommunityManagement/FacilityBookings';
......@@ -76,8 +85,11 @@ export default {
} break;
case 13: {
let DataSaveDetail = resp.data;
yield put({ type: 'DataSaveDetail', DataSaveDetail});
}
yield put({ type: 'DataSaveDetail', DataSaveDetail });
} break;
case 16: {
console.log("等待删除完成")
} break;
}
}
......@@ -107,6 +119,10 @@ export default {
yield put({type: 'returnCurString', curString} )
},
*ResultClear({ }, { put }) {
var tmp=null
yield put({type: 'returnResult', tmp} )
},
},
};
import React, { useState, useEffect,useRef } from 'react';
import styles from './css/index.less';
import { Input ,Menu,Table,Space,Form,Radio, Modal,Row,Col, Button } from 'antd';
import { Input ,Menu,Table,Space,Form,Radio, Modal,Row,Col, Button, message } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
......@@ -12,7 +12,7 @@ import TextArea from 'antd/lib/input/TextArea';
import {getUrlLast} from '../../../utils/string';
const Detail = (props:any) => {
const BookingDetail = (props:any) => {
const { dispatch,location, DataSave,DataSaveDetail,token} = props;
const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) };
......@@ -23,7 +23,8 @@ const Detail = (props:any) => {
}, []);
const statusDes = ["全部", "已申请", "已预订", "已使用", "已取消", "已完成"]
// const statusDes = ["全部", "已申请", "已预订", "已使用", "已取消", "已完成"]
const statusDes = ["All", "Applied", "Reserved", "Used", "Cancelled", "Completed"]
const [modalVisible,setModalVisible]=useState(false)
const [modalItem,setModalIteme]=useState({title:"",tab:1})
......@@ -49,17 +50,21 @@ const Detail = (props:any) => {
const onFinish = (values: any) => {
var val = values
if (val.backMarginFeeReason== null) {
message.error("Back marginFee reason is empty!",3)
} else {
var RAVAL = {
accountCategoriesId: DataSave.id,
backMarginFee: curbackFee.toString(),
backMarginFeeReason: val.backMarginFeeReason==null?"":val.backMarginFeeReason,
accountName:DataSave.accountName,
backFeeStatus:curbackFee==DataSaveDetail.marginFee?"0":"1",
marginFee:(DataSaveDetail.marginFee).toString()
backMarginFeeReason: val.backMarginFeeReason,
accountName: DataSave.accountName,
backFeeStatus: curbackFee == DataSaveDetail.marginFee ? "0" : "1",
marginFee: (DataSaveDetail.marginFee).toString()
}
console.log(RAVAL)
RA(3,RAVAL)
RA(3, RAVAL)
}
};
const onFinishFailed = (errorInfo: any) => { console.log('Failed:', errorInfo) };
......@@ -98,7 +103,7 @@ const Detail = (props:any) => {
return (
<div className={styles.base}>
<TitleBack title={"View Facility Bookings"} url={getUrlLast(location.pathname)+'?type=Detail'}/>
<TitleBack title={"View Facility Bookings"} url={getUrlLast(location.pathname)+'?Facility=false'}/>
<Row gutter={8}>
<Col>预订状态</Col><Col span={2}>{statusDes[DataSave.status]}</Col>
......@@ -197,7 +202,7 @@ function mapStateToProps(state:any) {
};
}
export default connect(mapStateToProps)(Detail);
export default connect(mapStateToProps)(BookingDetail);
// accountId: ""
......
import React, { useState, useEffect,useRef } from 'react';
import styles from './css/Bookings.less';
import { Spin,Input ,DatePicker,Button,Form, Radio,TimePicker,Row, Col,message} from 'antd';
import { Spin,Input ,DatePicker,Button,Form, Radio,TimePicker,Row, Col,message, Result} from 'antd';
const { RangePicker } = TimePicker;
import {connect } from 'umi';
......@@ -11,14 +11,16 @@ import TitleBack from '../../../components/TitleBack/TitleBack';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { numberToString } from '../../../utils/string';
import { checkInput } from '@/utils/method';
const Bookings = (props:any) => {
const { dispatch, Data3,Data3Error,Data4,DataSave,token} = props;
const { dispatch, Data3,Result,DataSave,token} = props;
const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) };
const IA = () => { dispatch({ type: 'FacilityBookings/IA' }) };
const IA2 = () => { dispatch({ type: 'FacilityBookings/IA2' }) };
const ResultClear = () => { dispatch({ type: 'FacilityBookings/ResultClear' }) };
const [comminityValues, setComminityValues] = useState(null);
const [curString,setCurString]=useState({communityManagerFee:null,communityMargin:null})
const [loading, setLoading] = useState(false);
const formRef = useRef(null);
......@@ -27,24 +29,25 @@ const Bookings = (props:any) => {
console.log("页面进入参数")
console.log(DataSave)
setComminityValues(DataSave.communityName)
RA(1, { userToken: token, communityName: DataSave.communityName })
RA(1, { userToken: token, communityName: DataSave.communityName ,facilitieId:DataSave.id})
}
}, [DataSave]);
useEffect(() => {
IA()
}, []);
useEffect(() => {
if (Data3Error != null) {
console.log(Data3Error)
message.error(Data3Error.msg);
if (Data3Error.index == 1) {
if (Result != null) {
console.log(Result)
message.error(Result.msg);
if (Result.index == 1) {
IA()
}
setLoading(false)
IA2()
ResultClear()
}
}, [Data3Error]);
}, [Result]);
useEffect(() => {
setLoading(false)
......@@ -80,11 +83,11 @@ const Bookings = (props:any) => {
console.log("Success:")
var tmp = value
console.log(value)
tmp.categoriesId = null
tmp.facilitiesId = null
tmp.communityName = null
tmp.communityManagerFee = null
tmp.communityMargin=null
// tmp.categoriesId = null
// tmp.facilitiesId = null
// tmp.communityName = null
// tmp.communityManagerFee = null
// tmp.communityMargin=null
if (value.categoriesName != null) {
tmp.categoriesId = value.categoriesName.categoriesId
tmp.facilitiesId=value.categoriesName.facilitiesId
......@@ -99,23 +102,40 @@ const Bookings = (props:any) => {
if (comminityValues!=null) {
tmp.communityName=comminityValues
}
if (Data4 != null) {
if (curString != null) {
tmp.communityManagerFee = numberToString(Data4.communityManagerFee)
tmp.communityMargin= numberToString(Data4.communityMargin)
tmp.communityManagerFee = numberToString(curString.communityManagerFee)
tmp.communityMargin= numberToString(curString.communityMargin)
}
if (tmp.accountName.length<2) {
message.error("User Name Should be limit 2~30!", 3)
} else {
//还差检测
if (checkParam(tmp)) {
console.log(tmp)
RA(11, tmp)
} else {
message.error("Error,Please finish it,not empty!",3)
message.error("Error,Please finish it,not empty!", 3)
}
}
// console.log(checkParam(tmp))
// console.log(comminityValues)
// console.log(tmp)
}
const RadioChoose = (e:any) => {
Data3.map((item: any, index: any) => {
item.categorieList.map((thing:any, i:any) => {
if (thing.categoriesId == (e.target.value).categoriesId) {
setCurString({
communityManagerFee: item.communityManagerFee,
communityMargin:item.communityMargin
})
// console.log(item.communityManagerFee)
// console.log(item.communityMargin)
}
})
})
}
return (
<div className={styles.base}>
......@@ -138,11 +158,15 @@ const Bookings = (props:any) => {
<div className={styles.box2item1}>Facility Bookings</div>
<div className={styles.box2item2}>
<Form.Item name="categoriesName" >
<Radio.Group defaultValue={1}>
<Radio.Group defaultValue={1} onChange={RadioChoose}>
{
Data3.map((item:any, index:any) => {
Data3.map((item: any, index: any) => {
var tmp=new Array()
item.categorieList.map((thing: any, i: any) => {
tmp.push(<Radio key={thing.categoriesId} value={thing}>{thing.categoriesName}</Radio>)
})
return (
<Radio key={"Radio_" + index} value={item}>{item.categoriesName}</Radio>
tmp
)
})
}
......@@ -154,7 +178,7 @@ const Bookings = (props:any) => {
<div className={styles.box3}>
<div className={styles.box3item1}>User Name</div>
<div className={styles.box3item2}><Form.Item name="accountName" ><Input style={{ width: 200 }} /></Form.Item></div>
<div className={styles.box3item2}><Form.Item name="accountName" ><Input style={{ width: 200 }} onBlur={checkInput} maxLength={30} /></Form.Item></div>
<div className={styles.box3item3}>Contact Details</div>
<div className={styles.box3item4}><Form.Item name="accountPhone" ><Input style={{ width: 200 }} /></Form.Item></div>
</div>
......@@ -179,16 +203,21 @@ const Bookings = (props:any) => {
</Row>
</div>
</div>
{/* <div className={styles.box6}>
{
curString.communityManagerFee!=null?
<>
<div className={styles.box6}>
<div className={styles.box6item1}>Management fee required</div>
<div className={styles.box6item2}>${Data4.communityManagerFee}</div>
<div className={styles.box6item2}>${curString.communityManagerFee}</div>
</div>
<div className={styles.box6}>
<div className={styles.box6item1}>Deposit is required</div>
<div className={styles.box6item2}>${Data4.communityMargin}</div>
</div> */}
<div className={styles.box6item2}>${curString.communityMargin}</div>
</div>
</>:null
}
<div className={styles.line}></div><Button htmlType="submit" type="primary" style={{ width: 80, height: 32 }}>Submit</Button>
</Form>
......@@ -199,12 +228,11 @@ const Bookings = (props:any) => {
};
function mapStateToProps(state:any) {
const { Data3,Data4,Data3Error,DataSave } = state.FacilityBookings;
const { Data3,Result,DataSave } = state.FacilityBookings;
const { token } = state.login;
return {
Data3,
Data4,
Data3Error,
Result,
DataSave,
token,
};
......
import React, { useState, useEffect } from 'react';
import styles from './css/BookingsView.less';
import { Input ,Menu,Table,Space,Pagination,Tooltip, Button, Radio } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
import TextArea from 'antd/lib/input/TextArea';
import TitleBack from '../../../components/TitleBack/TitleBack';
const BookingsView = () => {
return (
<div className={styles.base}>
{/* 头部组件v1.2 */}
<TitleBack title="View Facilty Bookings" />
{/* 内容组件 */}
<div className={styles.box1}>
<div className={styles.box1item1}>Appointment Status</div>
<div className={styles.box1item2}>Reservation Successful</div>
<div className={styles.box1item3}>OrderTime</div>
<div className={styles.box1item4}>02-12 10:20</div>
<div className={styles.box1item5}><Button style={{width:152}}>取消</Button></div>
</div>
<div className={styles.line}></div>
<div className={styles.box2}>
<div className={styles.box2item1}>Service Community</div>
<div className={styles.box2item2}>Constant company</div>
<div className={styles.box2item3}>Faciity Bookings</div>
<div className={styles.box2item4}>Swimming pool A</div>
<div className={styles.box2item5}>Booking Schedule</div>
<div className={styles.box2item6}>02-22 10:30</div>
<div className={styles.box2item7}>——</div>
<div className={styles.box2item8}>02-22 10:30</div>
</div>
<div className={styles.box3}>
<div className={styles.box3item1}>User Name</div>
<div className={styles.box3item2}>Josephine</div>
<div className={styles.box3item3}>Contract Details</div>
<div className={styles.box3item4}>13466573211</div>
<div className={styles.box3item5}>Unit</div>
<div className={styles.box3item6}>03#15-2020</div>
</div>
<div className={styles.line}></div>
<div className={styles.box4}>
<div className={styles.box4item1}>Management fee required</div>
<div className={styles.box4item2}>$ 100.00</div>
</div>
<div className={styles.box4}>
<div className={styles.box4item1}>Deposit is Required</div>
<div className={styles.box4item2}>$ 100.00</div>
</div>
{/* <Button style={{ width: 80, marginTop: 28 }}>支付</Button> */}
<div style={{marginBottom:19}}><Radio>Full Refund of Deposit</Radio></div>
<div className={styles.box5}>
<div className={styles.box5item1}><Radio>Partial Refund Of Deposit </Radio></div>
<div className={styles.box5item2}>$ <Input style={{width:80}}/></div>
</div>
<div className={styles.box6}>
<div className={styles.box6item1}><TextArea autoSize={false} style={{ width: 300,height:80}}/></div>
</div>
<button className={styles.search}>Return The Deposit Money</button>
</div>
);
};
export default BookingsView;
......@@ -12,15 +12,21 @@ import { timestampToTime } from '../../../utils/time';
import TitleSearch from '../../../components/TitleSearch/TitleSearch';
const managerFeeStatusDes= ["未交", "已交", "已退"]
const marginFeeStatusDes = ["未交", "已交", "未退", "已退部分", "已退全部"]
const statusDes = ["全部", "已申请", "已预订", "已使用", "已取消", "已完成"]
// const managerFeeStatusDes= ["未交", "已交", "已退"]
// const marginFeeStatusDes = ["未交", "已交", "未退", "已退部分", "已退全部"]
// const statusDes = ["全部", "已申请", "已预订", "已使用", "已取消", "已完成"]
const managerFeeStatusDes= ["Not paid", "Paid", "Returned"]
const marginFeeStatusDes = ["Not paid", "Paid", "Not Returned", "Returned part", "Returned all"]
const statusDes = ["All", "Applied", "Reserved", "Used", "Cancelled", "Completed"]
import { getUrlLastParams } from '../../../utils/string';
const FacilityBookings = (props:any) => {
const { formatMessage } = useIntl();
const { dispatch, location, Data, Data2, token,DataSave,curString } = props;
const { dispatch, location, Data, Data2, token,DataSave,curString,Result } = props;
const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: {index:index, body:values } }) };
const SA = (values: any) => { dispatch({ type: 'FacilityBookings/SA', playload: values }) };
......@@ -29,25 +35,28 @@ const FacilityBookings = (props:any) => {
const CA = () => { dispatch({ type: 'FacilityBookings/CA', playload: null }) };
const [tab, setTab] = useState(location.query.Facility == "true" ? 2 : 1)
const [loading, setLoading] = useState(false)
const [columns, setColumns] = useState([])
const [columns2, setColumns2] = useState([])
const goToFunction = () => {
if(tab==2){CA()}
history.push(location.pathname + (tab==1?'/Booking':'/Adding'))
if(curString.tab==2){CA()}
history.push(location.pathname + (curString.tab==1?'/Booking':'/Adding'))
}
const goToDetail = (values:any) => {
SA(values)
console.log(values)
console.log("准备页面跳转")
console.log(curString)
history.push(location.pathname + '/Detail')
}
const makeOperator = (values: any,index:any, e: any) => {
const path = ['/FacilityDetail', '/FacilityEdit', '/FacilityApply']
SA(values)
console.log("准备页面跳转")
console.log(curString)
history.push(location.pathname + path[index])
}
......@@ -69,13 +78,13 @@ const FacilityBookings = (props:any) => {
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a onClick={goToDetail.bind(this,record)}>Detail</a></Space>)],
]
const key2 = [
["小区", "communityName"],
["设施", "facilityName"],
["开发时间", "categoriesOpenTime"],
["操作", null, (text: any, record: any) => (<Space size="middle">
<a onClick={makeOperator.bind(this,record,0)}>详情</a>
<a onClick={makeOperator.bind(this,record,1)}>编辑</a>
<a onClick={makeOperator.bind(this,record,2)}>预约</a>
["Community", "communityName"],
["Facilty", "facilityName"],
["Open Time", "categoriesOpenTime"],
["Action", null, (text: any, record: any) => (<Space size="middle">
<a onClick={makeOperator.bind(this,record,0)}>Detail</a>
<a onClick={makeOperator.bind(this,record,1)}>Edit</a>
<a onClick={makeOperator.bind(this,record,2)}>Booking</a>
</Space>)]
]
setColumns(objectColumns(key))
......@@ -83,8 +92,8 @@ const FacilityBookings = (props:any) => {
console.log("页面刷新")
console.log(DataSave)
console.log(curString)
if (tab == 1) {
RA(9, { userToken: token, pageNum: curString.curPage, subscribeDate: curString.subscribeDate, status: curString.status })
if (curString.tab == 1) {
RA(9, { userToken: token, pageNum: curString.curPage, subscribeDate: curString.subscribeDate, status: curString.status,communityNameList:curString.communityNameList })
} else {
RA(8,{ userToken: token, pageNum: curString.curPage2 })
}
......@@ -97,7 +106,7 @@ const FacilityBookings = (props:any) => {
const CallBackTitleSearch= (comment: any) => {
if (tab == 1) {
if (curString.tab == 1) {
if (comment.communityName != null || comment.key != null || comment.status != null) {
var tmp = curString
tmp.subscribeDate = comment.key
......@@ -106,14 +115,17 @@ const FacilityBookings = (props:any) => {
} else {
tmp.status = comment.status
}
tmp.communityNameList = comment.communityName
tmp.curPage=1
QA(tmp)
console.log(tmp)
//中断
RA(9, { userToken: token, pageNum: "1", subscribeDate: tmp.subscribeDate, status: tmp.status,communityNameList:comment.communityName })
}
} else {
if (comment.communityName != null || comment.facilityName != null) {
var tmp = curString
tmp.communityName = comment.communityName
tmp.communityNameList = comment.communityName
tmp.facilityName = comment.facilityName
tmp.curPage=1
QA(tmp)
......@@ -123,27 +135,33 @@ const FacilityBookings = (props:any) => {
}
}
function TabCallback(tab: any) {
setTab(tab)
setLoading(true)
var tmp = curString
tmp.tab = tab
QA(tmp)
if (tab == 1) {
RA(9, { userToken: token, pageNum: curString.curPage, subscribeDate: curString.subscribeDate, status: curString.status })
RA(9, { userToken: token, pageNum: curString.curPage, subscribeDate: curString.subscribeDate, status: curString.status,communityNameList:curString.communityNameList })
} else {
RA(8,{ userToken: token, pageNum: curString.curPage2 })
}
}
function Pagechange(current: any, pageSize: any) {
setLoading(true)
if (tab == 1) {
if (curString.tab == 1) {
var tmp = curString
tmp.curPage = current
QA(tmp)
RA(9, { userToken: token, pageNum: current, subscribeDate: curString.subscribeDate, status: curString.status })
RA(9, { userToken: token, pageNum: current, subscribeDate: curString.subscribeDate, status: curString.status,communityNameList:curString.communityNameList})
} else {
var tmp = curString
tmp.curPage2 = current
QA(tmp)
RA(8, { userToken: token, pageNum: current })
if (curString.communityNameList != null) {
RA(8, { userToken: token, pageNum: current, communityNameList: curString.communityNameList})
} else {
RA(8, { userToken: token, pageNum: current,})
}
}
}
......@@ -153,15 +171,16 @@ const FacilityBookings = (props:any) => {
<div className={styles.base}>
{/* 头部组件 */}
{
tab == 1 ?
curString.tab == 1 ?
<>
<TitleSearch
status={[{
name: ["status", "订单状态"],
data: [[0, "全部"], [1, "已申请"], [2, "已预订"], [3, "已使用"], [4, "已取消"]]
data: [[0, "All"], [1, "Applied"], [2, "Reserved"], [3, "Used"], [4, "Cancelled"]]
}]}
time={["key", "预订时间筛选"]}
community={"communityName"}
checklist={curString.communityNameList!=null?curString.communityNameList:null}
onSubmit={CallBackTitleSearch} />
</> :
<>
......@@ -174,10 +193,10 @@ const FacilityBookings = (props:any) => {
<div style={{position:"relative",height:40}}>
<Button type="primary" style={{ position: "absolute", right: 0 }} onClick={goToFunction}>{tab==1?"Booking":"Add Facility"}</Button>
<Button type="primary" style={{ position: "absolute", right: 0 }} onClick={goToFunction}>{curString.tab==1?"Booking":"Add Facility"}</Button>
</div>
<Tabs defaultActiveKey={tab.toString()} onChange={TabCallback}>
<Tabs defaultActiveKey={curString.tab.toString()} onChange={TabCallback}>
<TabPane tab="Facility Bookings" key="1">
<Table loading={loading} rowKey="id" style={{ marginTop: 16 }} dataSource={Data.data } columns={columns} pagination={{ current: curString.curPage, total: Data.total.totalRow, showSizeChanger: false, onChange:Pagechange }} />
</TabPane>
......@@ -192,14 +211,14 @@ const FacilityBookings = (props:any) => {
};
function mapStateToProps(state:any) {
const { Data, DataPage, Data2,DataSave,curString } = state.FacilityBookings;
const { Data, Data2,DataSave,curString,Result } = state.FacilityBookings;
const { token } = state.login;
return {
Data,
DataPage,
Data2,
DataSave,
curString,
Result,
token
};
}
......
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import { Input ,Menu,Table,Space} from 'antd';
import { Input ,Menu,Table,Space,Row} from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { RA } from '@/services/tos';
const dataSource = [
{
key: '1',
name: '胡彦斌',
age: 32,
address: '西湖区湖底公园1号',
},
];
const Contract = (props: { location: any; }) => {
const Contract = (props:any) => {
const { formatMessage } = useIntl();
const { location } = props;
const nameofowner = formatMessage({ id: 'R.charge.input.nameofowner' })
const inputProject = formatMessage({ id: 'R.charge.input.project' })
const username = formatMessage({ id: 'R.charge.username' })
const project = formatMessage({ id: 'R.charge.project' })
const unit = formatMessage({ id: 'R.charge.unit' })
const status = formatMessage({ id: 'R.charge.status' })
const submissionTime = formatMessage({ id: 'R.charge.submissionTime' })
const actions = formatMessage({ id: 'R.charge.actions' })
const search = formatMessage({ id: 'R.charge.search' })
const addaccount = formatMessage({ id: 'R.charge.addaccount' })
const paymentsetting = formatMessage({ id: 'R.charge.paymentsetting' })
const menuListNormal = ["A",'Accounting company']
const [display, setDisplay] = useState("A");//小组件:线框
const pagination={defaultCurrent:1,total: 16}
const goToDetail = () => {
history.push(location.pathname+'/Detail?id=123')
const { dispatch,Data,Result } = props;
const RA = (index: any, values: any) => { dispatch({ type: 'Contract/RA', playload: { index: index, body: values } }) };
const SA = (values: any) => { dispatch({ type: 'Contract/SA', playload: values }) };
useEffect(() => {
console.log("合同页面")
RA(19, {
pageNum:"1",
contractNumber:"",
contractTitle:"",
communityName:""
})
}, [])
useEffect(() => {
if (Data != null) {
console.log(Data)
}
},[Data])
const goToDetail = (record: any, e: any) => {
SA(record)
history.push(location.pathname+'/Detail')
}
const goToEdit = () => {
history.push(location.pathname+'/Edit')
}
const columns = [
{title: "Community Name",dataIndex: 'communityName'},
{ title: "Contract File", dataIndex: 'contractFileName' },
{ title: "Company",render: (text: any, record: any) => (<><div>{record.contractPartyA}</div><div>{record.contractPartyB}</div></>)},
{title: "Contract Number",dataIndex: 'contractNumber'},
{title: "Contract Title",dataIndex: 'contractTitle'},
{ title: "Valid End Date", dataIndex: 'contractValidEndDate'},
{title: "Valid Start Date",dataIndex: 'contractValidStartDate'},
{
title: username,
dataIndex: 'name',
key: 'name',
},
{
title: project,
dataIndex: 'age',
key: 'age',
},
{
title: unit,
dataIndex: 'address',
key: 'address',
},
{
title: status,
dataIndex: 'address',
key: 'address',
},
{
title: submissionTime,
dataIndex: 'address',
key: 'address',
},
{
title: actions,
key: 'action',
title: "Actions",
render: (text: any, record: any) => (
<Space size="middle">
<a onClick={goToDetail}>Detail</a>
<a onClick={goToDetail.bind(this,record)}>Detail</a>
</Space>
),
},
......@@ -83,9 +64,9 @@ const Contract = (props: { location: any; }) => {
<div className={styles.base}>
{/* 头部组件 */}
<div className={styles.box}>
<input className={styles.item1} placeholder={nameofowner} />
<input className={styles.item2} placeholder={inputProject} />
<button className={styles.item3}>{search}</button>
<input className={styles.item1} placeholder={"nameofowner"} />
<input className={styles.item2} placeholder={"inputProject"} />
<button className={styles.item3}>Search</button>
</div>
{/* 内容组件 */}
......@@ -95,12 +76,22 @@ const Contract = (props: { location: any; }) => {
</div>
{/* 列表组件 */}
<Table style={{ marginTop: 16 }} dataSource={dataSource} columns={columns} pagination={pagination} />
{
Data!=null?<Table rowKey={"id"} style={{ marginTop: 16 }} dataSource={Data.list} columns={columns} pagination={{ defaultCurrent: 1, total: 16 }} />:null
}
</div>
);
};
export default Contract;
function mapStateToProps(state:any) {
const { Data,curString,Result } = state.Contract;
return {
Data,
curString,
Result,
};
}
export default connect(mapStateToProps)(Contract);
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import { Input ,Menu,Table,Space} from 'antd';
import { Spin,Result,message,Upload ,Button,Table,Space} from 'antd';
import { UploadOutlined, LoadingOutlined } from '@ant-design/icons';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
......@@ -29,7 +30,55 @@ const Users = (props:any) => {
const addaccount = formatMessage({ id: 'R.charge.addaccount' })
const paymentsetting = formatMessage({ id: 'R.charge.paymentsetting' })
const [curString,setCurString]=useState({defaultCurrent:1,total: 0})
// const string2mean = [[0, "未注册"], [1, "注册"], [2, "注销"]]
const string2mean=[[0, "Unregistered"],[1,"registered"], [2,"deregistered"]]
const [curString, setCurString] = useState({ defaultCurrent: 1, total: 0 })
const [fileUpload, setFileUpload] = useState(false);
const [fileUploading,setFileUploading]=useState(false)
const [resultTime, setResultTime] = useState(3);
const propsUpload = {
name: 'file',
action: 'http://47.74.233.180:8651/tos/excel/upload?userId=369',
onChange(info) {
if (info.file.status == 'uploading') {
setFileUploading(true)
// console.log(info.file, info.fileList);
}
if (info.file.status === 'done') {
setFileUpload(true)
setFileUploading(false)
// message.success(`${info.file.name} file uploaded successfully`);
} else if (info.file.status === 'error') {
message.error(`${info.file.name} file upload failed.`);
setFileUploading(false)
}
},
showUploadList:false,
}
useEffect(() => {
if (fileUpload) {
var index=2
var timer = setInterval(() => {
setResultTime(index)
index--
if (index == -1) {
setFileUpload(false)
setResultTime(3)
clearInterval(timer)
}
}, 1000)
}
}, [fileUpload])
const backPage = () => {
setFileUpload(false)
setResultTime(3)
}
useEffect(() => {
// console.log(CommunityList )
if (CommunityList != null) {
......@@ -51,7 +100,8 @@ const Users = (props:any) => {
SA(values)
history.push(location.pathname+'/Detail')
}
const goToEdit = () => {
const goToEdit = (values: any, e: any) => {
SA(values)
history.push(location.pathname+'/Edit')
}
......@@ -63,11 +113,12 @@ const Users = (props:any) => {
{ title: username, dataIndex: 'owerName', },
{title: project,dataIndex: 'communityName',},
{title: unit,render:(text: any, record: any) => (<div>{record.buildingNumber+"#"+record.floorNumber+"—"+record.roomNumber}</div>)},
{title: status,dataIndex: 'enable'},
{ title: status, dataIndex: 'enable', render: (text: any, record: any) => (<div>{string2mean[text][1]}</div>)},
{title: submissionTime,render:(text: any, record: any) => (<div>{timestampToTime(record.createTime.time)}</div>)},
{title: actions,
render: (text: any, record: any) => (
<Space size="middle">
<a onClick={goToEdit.bind(this, record)}>Edit</a>
<a onClick={goToDetail.bind(this,record)}>Detail</a>
</Space>
),
......@@ -86,6 +137,8 @@ const Users = (props:any) => {
<div className={styles.base}>
{/* 头部组件 */}
{fileUpload!=true? <>
<TitleSearch
listkey={["OwnerName"]}
list={["Owner Name"]}
......@@ -95,17 +148,29 @@ const Users = (props:any) => {
{/* 内容组件 */}
<div className={styles.box2}>
<button className={styles.buttonAdd2} onClick={goToAdd}>Create New Owner</button>
<button className={styles.buttonAdd} >Batch Upload</button>
<div className={styles.buttonAdd} >
<Upload {...propsUpload}>
<Button icon={fileUploading?null:<UploadOutlined />}>{fileUploading?<><Spin indicator={<LoadingOutlined style={{ fontSize: 16 }} spin />} /> Uploading</>:"Batch Upload"}</Button>
</Upload>
</div>
</div>
{/* 列表组件 */}
{
Data != null ?
<Table rowKey={"id"} style={{ marginTop: 16 }} dataSource={Data.rows} columns={columns} pagination={curString} />
:null
: null
}
</> :
<Result
status="success"
title="Successfully submit the file!"
subTitle={<p>server has been handled it ,Wait for <strong>{resultTime}</strong> seconds to return automatically.</p>}
extra={[
<Button type="primary" key="ok" onClick={backPage}>Ok</Button>, <Button key="back" onClick={backPage}>Back</Button>
]}
/>
}
</div>
);
......@@ -124,3 +189,4 @@ function mapStateToProps(state:any) {
};
}
export default connect(mapStateToProps)(Users);
......@@ -22,7 +22,7 @@ const UsersAdd = (props:any) => {
if (postman.extend != null) {
values.communityName = postman.extend
} else {
values.communityName=null
values.communityName = null
}
var tmp = Object.keys(values);
console.log("添加业主提交的参数:" + tmp.length)
......@@ -42,7 +42,7 @@ const UsersAdd = (props:any) => {
const checkInput = (e: any) => {
console.log(e)
if (e.target.value.length == 1) {
message.error("Ower Name Should be limit 2~33!",3)
message.error("Ower Name Should be limit 2~30!",3)
}
}
return (
......@@ -53,7 +53,7 @@ const UsersAdd = (props:any) => {
<Form ref={formRef} name="basic" onFinish={onFinish}>
<div className={styles.box1}>
<div className={styles.box1item1}>Owner's Name</div>
<div className={styles.box1item2}><Form.Item name="owerName" ><Input placeholder="Ower Name" onBlur={checkInput} maxLength={33}/></Form.Item></div>
<div className={styles.box1item2}><Form.Item name="owerName" ><Input placeholder="Ower Name" onBlur={checkInput} maxLength={30}/></Form.Item></div>
</div>
<div className={styles.box4}>
......
......@@ -8,50 +8,77 @@ import Line from '../../../components/Line/Line';
import TitleBack from '../../../components/TitleBack/TitleBack';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { checkParam } from '../../../utils/method'
import { values } from 'lodash';
import TableShow from '@/components/TableShow/TableShow';
import { values, fromPairs } from 'lodash';
const UsersDetail = (props:any) => {
const { dispatch,DataSave,DataDetail} = props;
const { dispatch,DataSave,DataSaveDetail,Result} = props;
const RA = (index: any, values: any) => { dispatch({ type: 'User/RA', playload: { index: index, body: values } }) };
const [postman,setPostman]=useState({extend:null,tab:1})
const ResultClear = () => { dispatch({ type: 'User/ResultClear' }) };
const [postman, setPostman] = useState({ extend: null, tab: 1 })
const [memberDetail, setMemberDetail] = useState(false);
const [memberData, setMemberData] = useState(null);
const [editFlag,setEditFlag]=useState(false)
const formRef = useRef(null);
const onFinish=(values:any) => {
if (postman.extend != null) {
values.communityName = postman.extend
if (DataSave != null) {
values.id=DataSave.id
} else {
values.communityName=null
values.id=null
}
var tmp = Object.keys(values);
console.log("添加业主提交的参数:" + tmp.length)
console.log(values)
if (checkParam(values)) {
RA(14, values)
RA(18, values)
} else {
message.error("Error,Please finish it,not empty!",3)
}
}
useEffect(() => {
if (Result != null) {
console.log(Result)
if (Result.error_code == "0001") {
message.error(Result.error_msg, 3)
ResultClear()
}
}
},[Result])
useEffect(() => {
if (DataSave != null) {
console.log("页面数据")
console.log(DataSave)
var tmp = {
owerName: DataSave.owerName,
owerPhone: DataSave.owerPhone,
owerEmail:DataSave.owerEmail
}
formRef.current.setFieldsValue(tmp)
RA(13, {
ownerId:DataSave.id,
owerName:DataSave.owerName,
communityName:"A7"
})
}
}, [DataSave])
useEffect(() => {
if (DataDetail != null) {
console.log(DataDetail)
if (DataSaveDetail != null) {
console.log("页面数据副歌")
console.log(DataSaveDetail)
}
}, [DataSaveDetail])
useEffect(() => {
if ((location.pathname).indexOf("Edit") > -1) {
setEditFlag(true)
}
},[DataDetail])
}, [])
setEditFlag
const extendName = (values: any) => {
var tmp = postman
tmp.extend=values
......@@ -60,72 +87,89 @@ const UsersDetail = (props:any) => {
const checkInput = (e: any) => {
console.log(e)
if (e.target.value.length == 1) {
message.error("Ower Name Should be limit 2~33!",3)
message.error("Ower Name Should be limit 2~30!",3)
}
}
const TabCallback = (values: any) => {
const tableShowCallback = (values:any) => {
setMemberData(values)
setMemberDetail(true)
}
const titleBackCallBack = () => {
setMemberDetail(false)
}
const deleteUnit = (values:any) => {
console.log(values)
if (DataSave != null) {
//console.log(DataSave)
var tmp = {
owerName: DataSave.owerName,
communityName: DataSave.communityName,
unit: values
}
RA(16, tmp);
}
}
return (
<div className={styles.base}>
{/* 头部组件 */}
<TitleBack title={"Owner Detail"} />
{
memberDetail==false ? <>
<TitleBack title={editFlag?"Edit Owner Infomation":"Owner Detail"} />
<Form ref={formRef} name="basic" onFinish={onFinish}>
<div className={styles.box1}>
<div className={styles.box1item1}>Owner's Name</div>
<div className={styles.box1item2}><Form.Item name="owerName" ><Input placeholder="Ower Name" onBlur={checkInput} maxLength={33}/></Form.Item></div>
<div className={styles.box1item2}><Form.Item name="owerName" ><Input disabled={!editFlag} placeholder="Ower Name" onBlur={checkInput} maxLength={30} /></Form.Item></div>
</div>
<div className={styles.box4}>
<div className={styles.box4item0}>Contact Details</div>
<div className={styles.box4item1}><Form.Item name="owerPhone" ><Input placeholder="Phone Number" /></Form.Item></div>
<div className={styles.box4item2}><Form.Item name="owerEmail" ><Input placeholder="Email" /></Form.Item></div>
<div className={styles.box4item1}><Form.Item name="owerPhone" ><Input disabled={!editFlag} placeholder="Phone Number" /></Form.Item></div>
<div className={styles.box4item2}><Form.Item name="owerEmail" ><Input disabled={!editFlag} placeholder="Email" /></Form.Item></div>
</div>
<Line />
<Tabs defaultActiveKey={postman.tab.toString()} onChange={TabCallback}>
<TabPane tab="A1" key="1">
<div>Hello</div>
{/* <Table loading={false} rowKey="id" style={{ marginTop: 16 }} dataSource={Data.data } columns={columns} pagination={{ current: curString.curPage, total: Data.total.totalRow, showSizeChanger: false, onChange:Pagechange }} /> */}
</TabPane>
<TabPane tab="A7" key="2">
{/* <Table loading={loading} rowKey="id" style={{ marginTop: 16 }} dataSource={Data2.data} columns={columns2} pagination={{ current: curString.curPage2, total: Data2.total.totalRow, showSizeChanger: false, onChange: Pagechange }} /> */}
</TabPane>
</Tabs>
<div className={styles.box2}>
{/* <div className={styles.box2item1}>Contact Details</div> */}
<div className={styles.box2item2}><SearchOptionsCommnity onSubmit={extendName} /></div>
<div className={styles.box2item3}><Form.Item name="buildingNumber"><Input placeholder="Building" style={{width:94}}/></Form.Item></div>
<div className={styles.box2item4}>#</div>
<div className={styles.box2item5}><Form.Item name="floorNumber" ><Input placeholder="Floor" style={{width:80}} /></Form.Item></div>
<div className={styles.box2item6}>——</div>
<div className={styles.box2item7}><Form.Item name="roomNumber"><Input placeholder="Room" style={{width:112}}/></Form.Item></div>
</div>
<div className={styles.box3}>
<div className={styles.box3item1}>
<Form.Item name="addressAndpostalCode"><Input style={{width:680}} placeholder="Display the address and postcode automatically according to the"/></Form.Item>
</div>
</div>
{
DataSaveDetail != null ? <TableShow data={DataSaveDetail} onSubmit={tableShowCallback} onChange={deleteUnit} deleteDisable={!editFlag}/> : null
}
{
editFlag ? <>
<Line />
<Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</>:null
}
</Form>
</> :
<>
<div>
<TitleBack title={"Member Detail"} url="none" titleBack={titleBackCallBack}></TitleBack>
<Row>
<Col>Customer Type</Col>
<Col></Col>
</Row>
<Row gutter={16}>
<Col span={4}>User Name</Col>
<Col span={4}>{memberData.ower_name}</Col>
</Row>
<Row gutter={16}>
<Col span={4}>Contact Detail</Col>
<Col span={4}>{memberData.ower_phone}</Col>
<Col span={4}>{memberData.ower_email}</Col>
</Row>
</div>
</>
}
</div>
);
};
function mapStateToProps(state:any) {
const { DataSave,DataDetail} = state.User;
const { DataSave,DataSaveDetail,Result} = state.User;
return {
DataSave,
DataDetail,
DataSaveDetail,
Result
};
}
export default connect(mapStateToProps)(UsersDetail);
......@@ -138,6 +182,17 @@ export default connect(mapStateToProps)(UsersDetail);
// "roomNumber":"388",
// "addressAndpostalCode":"工业大道3689561"
// address_and_postalCode: "工业大道3689561"
// building_number: "01"
// cdk_code: 295863
// cdk_status: 0
// enable: 0
// floor_number: "05"
// ower_email: "sale@huahuico.com"
// ower_name: "小小莎"
// ower_phone: "18813787871"
// room_number: "388"
// "ownerId":"770da9de6b6c43f6b61bc3d671fa2e89",
// "owerName":"jack-小雄",
// "communityName":"A7"
\ No newline at end of file
......@@ -100,8 +100,23 @@
.fontgz();
}
.butttonAdd0{
border:1px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
border-radius:2px;
}
.buttonAdd{
// .butttonAdd0();
background:none;
outline: none;
cursor: pointer;
// width:170px;
// height:32px;
position: absolute;
right: 0;
}
.buttonAdd2{
background:none;
outline: none;
cursor: pointer;
......@@ -111,11 +126,6 @@
color:rgba(24,144,255,1);
border-radius:2px;
position: absolute;
right: 0;
}
.buttonAdd2{
.buttonAdd();
right: 180px;
}
......@@ -18,7 +18,6 @@ const Guard = (props:any) => {
tosCommunityget(null)
}, []);
const onFinish = (values:any) => {
console.log(values)
}
......@@ -32,11 +31,11 @@ const Guard = (props:any) => {
<TitleGet title={"Version 1.0.3"} />
<TitleGet title={"Version 1.0.5"} />
<p>
token:{token}
</p>
<TableShow />
{/* <TableShow /> */}
{/* <div>{token}</div>
<Line /> */}
......
......@@ -61,24 +61,28 @@ export function TosCommunityFacilitiesFuzzyQuery(values: any) {
}
const requestList = [
"/tos/community/facilities/categories/subscribe/list",//0 请求预订列表
"/tos/community/facilities/get",//1 设施品类获取
"/tos/community/facilities/categories/detail/get",//2缴费详情
"/tos/community/facilities/categories/fee/back",//3退还押金
"/tos/community/facilities/categories/fee/pay",//4缴费
"/tos/community/categories/subscribe/cancel",//5取消预约
"/tos/community/facilities/add",//6 新增小区设施
"/tos/bookingService/lookUp",//7 查看小区设施
"/tos/community/facilities/fuzzy/query",//8 查看设施管理模糊
"/tos/community/categories/subscribe/fuzzy/query",//9 预订列表模糊查询
"/tos/user/newCurrentUser", //10 后台用户信息,
"/tos/community/facilities/categories/subscribe",//11 预订
["/tos/community/facilities/categories/subscribe/list","0 请求预订列表"],
["/tos/community/facilities/get","1 设施品类获取"],
["/tos/community/facilities/categories/detail/get","2 缴费详情"],
["/tos/community/facilities/categories/fee/back","3 退还押金"],
["/tos/community/facilities/categories/fee/pay","4 缴费"],
["/tos/community/categories/subscribe/cancel","5 取消预约"],
["/tos/community/facilities/add","6 新增小区设施"],
["/tos/bookingService/lookUp","7 查看小区设施"],
["/tos/community/facilities/fuzzy/query","8 查看设施管理模糊"],
["/tos/community/categories/subscribe/fuzzy/query","9 预订列表模糊查询"],
["/tos/user/newCurrentUser", "10 后台用户信息"],
["/tos/community/facilities/categories/subscribe","11 预订"],
"/tos/tosOwner/getAll", //12 业主查询
"/tos/tosOwner/getDetail", //13 业主查询详细
"/tos/tosOwner/save",//14 业主添加
"/tos/life/community/qr/get",//二维码查询
"/tos/life/community/account/unit/del",//删除单元
["/tos/tosOwner/getAll", "12 业主查询"],
["/tos/tosOwner/getDetailAll", "13 业主查询详细"],
["/tos/tosOwner/save","14 业主添加"],
["/tos/life/community/qr/get","15 二维码查询"],
["/tos/life/community/account/unit/del","16 删除单元"],
["/tos/bookingService/edit", "17 编辑小区设施"],
["/tos/tosOwner/info/update", "18 编辑业主信息"],
["/tos/contract/list","19 获取合同列表"]
]
function requestAuto(url:string,values:any) {
return request(url, Body(values))
......@@ -87,8 +91,8 @@ export function RA(playload: any) {
// console.log(playload)
// console.log(playload.index)
// console.log(requestList[playload.index])
var url =requestList[playload.index]
console.log("发送请求"+url)
var url =(requestList[playload.index])[0]
console.log(playload.index+"》【发送请求】"+url+(requestList[playload.index])[1])
return requestAuto(url,playload.body)
}
import {message } from 'antd';
export const checkParam = (values: any) => {
var flag = true
for (var i in values) {
console.log(values[i]);
// console.log(values[i]);
if (values[i] == null) {
flag=false
} else {
......@@ -11,3 +13,12 @@ export const checkParam = (values: any) => {
}
return flag
}
// onBlur={checkInput} maxLength={33}
export const checkInput = (e: any) => {
// console.log(e)
if (e.target.value.length == 1) {
message.error("User Name Should be limit 2~30!", 3)
e.target.value=null
}
}
\ No newline at end of file
......@@ -20,7 +20,7 @@
"paths": {
"@/*": ["./src/*"],
"@@/*": ["./src/.umi/*"],
"@@@/*":["./src/components/*"],
"@C/*":["./src/*"],
}
},
"exclude": ["node_modules", "build", "dist", "scripts", "src/.umi/*", "webpack", "jest"]
......
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