Commit 8bf95522 authored by maple's avatar maple Committed by MrShi

[new]合同模块

(cherry picked from commit b9d84879)
parent 2bdfc4cc
...@@ -87,6 +87,7 @@ export default defineConfig({ ...@@ -87,6 +87,7 @@ export default defineConfig({
{ path: './', component: './UserManagement/LIFEUserManagement/Users' }, { path: './', component: './UserManagement/LIFEUserManagement/Users' },
{ path: './Add', component: './UserManagement/LIFEUserManagement/UsersAdd' }, { path: './Add', component: './UserManagement/LIFEUserManagement/UsersAdd' },
{ path: './Detail', component: './UserManagement/LIFEUserManagement/UsersDetail' }, { path: './Detail', component: './UserManagement/LIFEUserManagement/UsersDetail' },
{ path: './Edit', component: './UserManagement/LIFEUserManagement/UsersDetail' },
] ]
},*/ },*/
{ {
...@@ -259,11 +260,11 @@ export default defineConfig({ ...@@ -259,11 +260,11 @@ export default defineConfig({
name: 'facilitybookings', name: 'facilitybookings',
routes: [ routes: [
{ path: "./", component: './CommunityManagement/FacilityBookings/FacilityBookings' }, { path: "./", component: './CommunityManagement/FacilityBookings/FacilityBookings' },
{ path: "./Adding", component: './CommunityManagement/FacilityBookings/FacilityManager' },
{ path: "./Booking", component: './CommunityManagement/FacilityBookings/Bookings' }, { path: "./Booking", component: './CommunityManagement/FacilityBookings/Bookings' },
{ path: "./Detail", component: './CommunityManagement/FacilityBookings/Detail' }, { path: "./Detail", component: './CommunityManagement/FacilityBookings/BookingDetail' },
{ path: "./FacilityEdit", component: './CommunityManagement/FacilityBookings/FacilityManager' }, { path: "./Adding", component: './CommunityManagement/FacilityBookings/Facility' },
{ path: "./FacilityDetail", component: './CommunityManagement/FacilityBookings/FacilityManager' }, { path: "./FacilityEdit", component: './CommunityManagement/FacilityBookings/Facility' },
{ path: "./FacilityDetail", component: './CommunityManagement/FacilityBookings/Facility' },
{ path: "./FacilityApply",component:'./CommunityManagement/FacilityBookings/Bookings'} { path: "./FacilityApply",component:'./CommunityManagement/FacilityBookings/Bookings'}
] ]
}, },
......
...@@ -16,7 +16,7 @@ const proSettings: DefaultSettings = { ...@@ -16,7 +16,7 @@ const proSettings: DefaultSettings = {
menu: { menu: {
locale: true, locale: true,
}, },
title: '这只是个测试', title: 'TOS_v1.0.5',
pwa: false, pwa: false,
iconfontUrl: '', iconfontUrl: '',
}; };
......
...@@ -12,9 +12,13 @@ const BackButton = (props:any) => { ...@@ -12,9 +12,13 @@ const BackButton = (props:any) => {
history.go(-1) history.go(-1)
} }
const goToReturnByParam = () => { const goToReturnByParam = () => {
console.log("跳转页面"+url) if (url == "none") {
props.backFunction()
} else {
console.log("跳转页面" + url)
history.push(url) history.push(url)
} }
}
return ( return (
<> <>
{ {
......
...@@ -70,8 +70,12 @@ const PictureOptions = (props:any) => { ...@@ -70,8 +70,12 @@ const PictureOptions = (props:any) => {
} }
const InputGet = (index: any, e: any) => { const InputGet = (index: any, e: any) => {
var tmp = fileList var tmp = fileList
if ((e.target.value).length == 0) {
tmp[index].name = null
} else {
tmp[index].name = e.target.value tmp[index].name = e.target.value
}
// console.log(tmp)
props.putSubmit(CheckParm(tmp)) props.putSubmit(CheckParm(tmp))
} }
return ( return (
......
...@@ -7,7 +7,7 @@ class SearchOptions extends React.Component { ...@@ -7,7 +7,7 @@ class SearchOptions extends React.Component {
}; };
constructor(props) { constructor(props) {
super(props); super(props);
const {list,defaultValue} = this.props; const {list,defaultValue,disabled} = this.props;
// console.log("重要的") // console.log("重要的")
this.state={ this.state={
data: [], data: [],
...@@ -62,14 +62,18 @@ class SearchOptions extends React.Component { ...@@ -62,14 +62,18 @@ class SearchOptions extends React.Component {
value={this.state.value} value={this.state.value}
placeholder={"Community Name"} placeholder={"Community Name"}
optionFilterProp="children" optionFilterProp="children"
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
// style={this.props.style} // style={this.props.style}
defaultActiveFirstOption={false} // defaultActiveFirstOption={false}
showArrow={true} showArrow={true}
filterOption={false} // filterOption={false}
onSearch={this.handleSearch} onSearch={this.handleSearch}
onChange={this.handleChange} onChange={this.handleChange}
notFoundContent={<div><Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />Please enter the correct Community Name!</div>} notFoundContent={<div><Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />Please enter the correct Community Name!</div>}
style={{ width: 200 }} style={{ width: 200 }}
disabled={this.props.disabled}
> >
{options} {options}
</Select> </Select>
...@@ -96,3 +100,4 @@ filterOption={(input, option) => ...@@ -96,3 +100,4 @@ filterOption={(input, option) =>
<Option value="lucy">Lucy</Option> <Option value="lucy">Lucy</Option>
<Option value="tom">Tom</Option> <Option value="tom">Tom</Option>
</Select>, */} </Select>, */}
...@@ -5,7 +5,7 @@ import SearchOptions from './SearchOptions'; ...@@ -5,7 +5,7 @@ import SearchOptions from './SearchOptions';
const SearchOptionsCommnity = (props: any) => { 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})}; const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})};
useEffect(() => { useEffect(() => {
...@@ -21,7 +21,7 @@ const SearchOptionsCommnity = (props: any) => { ...@@ -21,7 +21,7 @@ const SearchOptionsCommnity = (props: any) => {
} }
return ( 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 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 TableShow = (props:any) => {
const { data } = props;
const dataRow = data.rows;
const goTo = (values:any,e:any) => { const goTo = (values:any,e:any) => {
console.log(values) 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 = [ const key = [
["Service Community", "communityName"], ["User Name", "ower_name"],
["User Name", "accountName"], ["Contact Details", "ower_phone"],
["Facility Bookings", "facilityTitle"], ["Email", "ower_email"],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a onClick={goTo.bind(this,record)}>Detail</a></Space>)], ["Actions",null, (text: any, record: any) => (<Space size="middle"> <a onClick={goTo.bind(this,record)}>Detail</a></Space>)],
] ]
return ( 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; 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'; ...@@ -10,7 +10,10 @@ import { Color } from 'chalk';
import Item from 'antd/lib/list/Item'; import Item from 'antd/lib/list/Item';
const format = 'HH:mm'; 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 TimeSelect = (props:any) => {
const { defaultValue } = props; const { defaultValue } = props;
...@@ -18,7 +21,25 @@ const TimeSelect = (props:any) => { ...@@ -18,7 +21,25 @@ const TimeSelect = (props:any) => {
const [times, setTimes] = useState([]) const [times, setTimes] = useState([])
const [timesLen, setTimesLen] = useState(0) 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(() => { useEffect(() => {
console.log("时段选择器") console.log("时段选择器")
console.log(defaultValue) console.log(defaultValue)
...@@ -30,7 +51,10 @@ const TimeSelect = (props:any) => { ...@@ -30,7 +51,10 @@ const TimeSelect = (props:any) => {
}) })
setTimes(result) setTimes(result)
setTimesLen(result.length) setTimesLen(result.length)
props.putSubmit( CheckParm(result)) var resultList= CheckParm(result)
saveResult(resultList)
console.log(resultList)
props.putSubmit(resultList)
} }
}, [defaultValue]); }, [defaultValue]);
...@@ -43,18 +67,30 @@ const TimeSelect = (props:any) => { ...@@ -43,18 +67,30 @@ const TimeSelect = (props:any) => {
const add =() => { const add =() => {
setTimesLen(timesLen + 1) setTimesLen(timesLen + 1)
showBtn(0)
setTimes(times => ([...times, {index:timesLen + 1,time:null}])) setTimes(times => ([...times, {index:timesLen + 1,time:null}]))
} }
const Delete=(index:any) => {
const Delete=(index:any,e:any) => {
var tmp = times var tmp = times
// console.log(times)
// console.log(index)
tmp.splice(index, 1); tmp.splice(index, 1);
setTimes(times => ([...tmp])) 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) => { const timeForm = (values: any) => {
var result = new Array() var result = new Array()
values.map((items, index) => { values.map((items, index) => {
result.push(moment(items).format('hh:mm')) result.push(moment(items).format(format))
}) })
return result[0] + "-" + result[1] return result[0] + "-" + result[1]
} }
...@@ -72,15 +108,20 @@ const TimeSelect = (props:any) => { ...@@ -72,15 +108,20 @@ const TimeSelect = (props:any) => {
const timeChange = (index: any, values: any) => { const timeChange = (index: any, values: any) => {
var tmp = times; var tmp = times;
// console.log("Maple诊断"+index) console.log("Maple诊断"+index)
// console.log(values) console.log(values)
if (values != null) { if (values != null) {
tmp[index].time =timeForm(values) tmp[index].time =timeForm(values)
} else { } else {
tmp[index].time =null tmp[index].time =null
} }
props.putSubmit(CheckParm(tmp)) var resultList= CheckParm(tmp)
saveResult(resultList)
if (resultList.length != 0) {
showBtn(1)
}
props.putSubmit(resultList)
} }
return ( return (
<> <>
...@@ -91,10 +132,14 @@ const TimeSelect = (props:any) => { ...@@ -91,10 +132,14 @@ const TimeSelect = (props:any) => {
return ( return (
<Row key={item.index} style={{marginBottom:16}}> <Row key={item.index} style={{marginBottom:16}}>
<Col> <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> </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> </Row>
...@@ -104,7 +149,10 @@ const TimeSelect = (props:any) => { ...@@ -104,7 +149,10 @@ const TimeSelect = (props:any) => {
</Col> </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'; ...@@ -6,6 +6,9 @@ import TitleGet from '../TitleGet/TitleGet';
const TitleBack = (props:any) => { const TitleBack = (props:any) => {
const backData = (values:any) => {
props.titleBack(values)
}
return ( return (
<> <>
<div className={styles.item0}><TitleGet title={props.title} /></div> <div className={styles.item0}><TitleGet title={props.title} /></div>
...@@ -20,7 +23,7 @@ const TitleBack = (props:any) => { ...@@ -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> <div className={styles.clear0}></div>
</> </>
); );
......
...@@ -26,7 +26,8 @@ const TitleSearch= (props:any) => { ...@@ -26,7 +26,8 @@ const TitleSearch= (props:any) => {
const key = props.listkey const key = props.listkey
const name = props.list; const name = props.list;
const single=props.single const single = props.single
const checklist = props.checklist;
const status = props.status; const status = props.status;
const time = props.time; const time = props.time;
...@@ -106,7 +107,7 @@ const TitleSearch= (props:any) => { ...@@ -106,7 +107,7 @@ const TitleSearch= (props:any) => {
<> <>
{ {
CommunityList != null ? 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 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 { ...@@ -8,16 +8,22 @@ export default {
namespace: 'FacilityBookings', namespace: 'FacilityBookings',
state: { state: {
Data: {data:[],total:0}, Data: {data:[],total:0},
DataPage:{totalRow:0},
Data2: {data:[],total:0}, Data2: {data:[],total:0},
Data3: null, Data3: null,
Data4:null,
Data3Error: null,
DataSave: null, DataSave: null,
DataSaveDetail: null, DataSaveDetail: null,
sourceData: 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: { reducers: {
...@@ -27,11 +33,8 @@ export default { ...@@ -27,11 +33,8 @@ export default {
returnPage2(state, { Data2 }) { returnPage2(state, { Data2 }) {
return { ...state, Data2 }; return { ...state, Data2 };
}, },
returnPage3(state, { Data3,Data4 }) { returnPage3(state, { Data3 }) {
return { ...state, Data3,Data4 }; return { ...state, Data3 };
},
returnData3Error(state, { Data3Error }) {
return { ...state, Data3Error };
}, },
returnDataSave(state, { DataSave }) { returnDataSave(state, { DataSave }) {
return { ...state, DataSave}; return { ...state, DataSave};
...@@ -45,7 +48,9 @@ export default { ...@@ -45,7 +48,9 @@ export default {
returnCurString(state, { curString }) { returnCurString(state, { curString }) {
return { ...state, curString }; return { ...state, curString };
}, },
returnResult(state, { Result }) {
return { ...state, Result };
}
}, },
...@@ -63,16 +68,16 @@ export default { ...@@ -63,16 +68,16 @@ export default {
if (resp.error_code != "0000") { if (resp.error_code != "0000") {
console.log("请求错误码:"+"("+playload.index+")" + resp.error_code) console.log("请求错误码:"+"("+playload.index+")" + resp.error_code)
console.log(playload) console.log(playload)
var Data3Error = null var Result = null
switch (playload.index) { switch (playload.index) {
case 1: case 1:
// message.error("Could't not found the facility!") // message.error("Could't not found the facility!")
Data3Error ={index:playload.index,msg:"Could't not found the facility!"}; Result ={index:playload.index,msg:"Could't not found the facility!"};
yield put({ type: 'returnData3Error', Data3Error }); yield put({ type: 'returnResult', Result });
break; break;
case 11: case 11:
Data3Error ={index:playload.index,msg:"Information Wrong!"}; Result ={index:playload.index,msg:"Information Wrong!"};
yield put({ type: 'returnData3Error', Data3Error }); yield put({ type: 'returnResult', Result });
break; break;
} }
} }
...@@ -87,10 +92,8 @@ export default { ...@@ -87,10 +92,8 @@ export default {
break; break;
case 1: case 1:
{ {
let Data3 = resp.data.categorieList; let Data3 = resp.data;
var Data4 = { communityManagerFee: resp.data.communityManagerFee, communityMargin: resp.data.communityMargin }; yield put({ type: 'returnPage3', Data3});
console.log(Data4)
yield put({ type: 'returnPage3', Data3, Data4});
}break; }break;
case 2:{ case 2:{
...@@ -100,11 +103,12 @@ export default { ...@@ -100,11 +103,12 @@ export default {
case 3: case 3:
case 4: case 4:
case 5: case 5:
case 11:
case 6: case 6:
case 11:{ case 17:{
message.success("Success Operation!",3) message.success("Success Operation!", 3)
// window.location.href = '/CommunityManagement/FacilityBookings'; var Result=resp
history.push("/CommunityManagement/FacilityBookings") yield put({ type: 'returnResult', Result })
} break; } break;
case 7: { case 7: {
let tmp = resp.data; let tmp = resp.data;
...@@ -120,7 +124,8 @@ export default { ...@@ -120,7 +124,8 @@ export default {
nomarginCancelReservationDay: tmp.nomarginCancelReservationDay, nomarginCancelReservationDay: tmp.nomarginCancelReservationDay,
periodType: tmp.periodType, periodType: tmp.periodType,
reservationQuantumTime: tmp.reservationQuantumTime, reservationQuantumTime: tmp.reservationQuantumTime,
facilitiesImageList:tmp.facilitiesImageList facilitiesImageList: tmp.facilitiesImageList,
categoriesList:tmp.categoriesList,
} }
// console.log(sourceData) // console.log(sourceData)
yield put({ type: 'returnSource', sourceData }); yield put({ type: 'returnSource', sourceData });
...@@ -138,10 +143,6 @@ export default { ...@@ -138,10 +143,6 @@ export default {
var Data3 = null var Data3 = null
yield put({ type: 'returnPage3', Data3 }); yield put({ type: 'returnPage3', Data3 });
}, },
*IA2({ playload }, { call, put }) {
var Data3Error = null
yield put({ type: 'returnData3Error', Data3Error });
},
*SA({ playload }, { call, put }) { *SA({ playload }, { call, put }) {
var DataSave = playload var DataSave = playload
...@@ -157,6 +158,9 @@ export default { ...@@ -157,6 +158,9 @@ export default {
var curString = playload var curString = playload
yield put({type: 'returnCurString', curString} ) yield put({type: 'returnCurString', curString} )
}, },
*ResultClear({}, {put}) {
yield put({type: 'returnResult', null} )
},
}, },
......
...@@ -36,6 +36,9 @@ export default { ...@@ -36,6 +36,9 @@ export default {
returnCurString(state, { curString }) { returnCurString(state, { curString }) {
return { ...state, curString }; return { ...state, curString };
}, },
returnResult(state, { Result }) {
return {...state,Result}
}
}, },
...@@ -54,11 +57,16 @@ export default { ...@@ -54,11 +57,16 @@ export default {
console.log("请求错误码:"+"("+playload.index+")" + resp.error_code) console.log("请求错误码:"+"("+playload.index+")" + resp.error_code)
console.log(playload) console.log(playload)
var Data3Error = null var Data3Error = null
var Result=null
switch (playload.index) { switch (playload.index) {
case 11: case 11: {
Data3Error ={msg:"Information Wrong!"}; Data3Error = { msg: "Information Wrong!" };
yield put({ type: 'returnData3Error', Data3Error }); yield put({ type: 'returnData3Error', Data3Error });
break; } break;
case 16:{
Result = resp;
yield put({ type: 'returnResult', Result });
} break;
} }
} }
else { else {
...@@ -68,7 +76,8 @@ export default { ...@@ -68,7 +76,8 @@ export default {
{ {
let Data = resp.data; let Data = resp.data;
yield put({ type: 'returnPage', Data}); yield put({ type: 'returnPage', Data});
}break; } break;
case 18:
case 14:{ case 14:{
message.success("Success Operation!",3) message.success("Success Operation!",3)
// window.location.href = '/CommunityManagement/FacilityBookings'; // window.location.href = '/CommunityManagement/FacilityBookings';
...@@ -76,8 +85,11 @@ export default { ...@@ -76,8 +85,11 @@ export default {
} break; } break;
case 13: { case 13: {
let DataSaveDetail = resp.data; 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 { ...@@ -107,6 +119,10 @@ export default {
yield put({type: 'returnCurString', curString} ) yield put({type: 'returnCurString', curString} )
}, },
*ResultClear({ }, { put }) {
var tmp=null
yield put({type: 'returnResult', tmp} )
},
}, },
}; };
import React, { useState, useEffect,useRef } from 'react'; import React, { useState, useEffect,useRef } from 'react';
import styles from './css/index.less'; 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'; import { Link, useIntl, connect, Dispatch } from 'umi';
...@@ -12,7 +12,7 @@ import TextArea from 'antd/lib/input/TextArea'; ...@@ -12,7 +12,7 @@ import TextArea from 'antd/lib/input/TextArea';
import {getUrlLast} from '../../../utils/string'; import {getUrlLast} from '../../../utils/string';
const Detail = (props:any) => { const BookingDetail = (props:any) => {
const { dispatch,location, DataSave,DataSaveDetail,token} = props; const { dispatch,location, DataSave,DataSaveDetail,token} = props;
const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) }; const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) };
...@@ -23,7 +23,8 @@ const Detail = (props:any) => { ...@@ -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 [modalVisible,setModalVisible]=useState(false)
const [modalItem,setModalIteme]=useState({title:"",tab:1}) const [modalItem,setModalIteme]=useState({title:"",tab:1})
...@@ -49,17 +50,21 @@ const Detail = (props:any) => { ...@@ -49,17 +50,21 @@ const Detail = (props:any) => {
const onFinish = (values: any) => { const onFinish = (values: any) => {
var val = values var val = values
if (val.backMarginFeeReason== null) {
message.error("Back marginFee reason is empty!",3)
} else {
var RAVAL = { var RAVAL = {
accountCategoriesId: DataSave.id, accountCategoriesId: DataSave.id,
backMarginFee: curbackFee.toString(), backMarginFee: curbackFee.toString(),
backMarginFeeReason: val.backMarginFeeReason==null?"":val.backMarginFeeReason, backMarginFeeReason: val.backMarginFeeReason,
accountName:DataSave.accountName, accountName: DataSave.accountName,
backFeeStatus:curbackFee==DataSaveDetail.marginFee?"0":"1", backFeeStatus: curbackFee == DataSaveDetail.marginFee ? "0" : "1",
marginFee:(DataSaveDetail.marginFee).toString() marginFee: (DataSaveDetail.marginFee).toString()
} }
console.log(RAVAL) console.log(RAVAL)
RA(3,RAVAL) RA(3, RAVAL)
}
}; };
const onFinishFailed = (errorInfo: any) => { console.log('Failed:', errorInfo) }; const onFinishFailed = (errorInfo: any) => { console.log('Failed:', errorInfo) };
...@@ -98,7 +103,7 @@ const Detail = (props:any) => { ...@@ -98,7 +103,7 @@ const Detail = (props:any) => {
return ( return (
<div className={styles.base}> <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}> <Row gutter={8}>
<Col>预订状态</Col><Col span={2}>{statusDes[DataSave.status]}</Col> <Col>预订状态</Col><Col span={2}>{statusDes[DataSave.status]}</Col>
...@@ -197,7 +202,7 @@ function mapStateToProps(state:any) { ...@@ -197,7 +202,7 @@ function mapStateToProps(state:any) {
}; };
} }
export default connect(mapStateToProps)(Detail); export default connect(mapStateToProps)(BookingDetail);
// accountId: "" // accountId: ""
......
import React, { useState, useEffect,useRef } from 'react'; import React, { useState, useEffect,useRef } from 'react';
import styles from './css/Bookings.less'; 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; const { RangePicker } = TimePicker;
import {connect } from 'umi'; import {connect } from 'umi';
...@@ -11,14 +11,16 @@ import TitleBack from '../../../components/TitleBack/TitleBack'; ...@@ -11,14 +11,16 @@ import TitleBack from '../../../components/TitleBack/TitleBack';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { numberToString } from '../../../utils/string'; import { numberToString } from '../../../utils/string';
import { checkInput } from '@/utils/method';
const Bookings = (props:any) => { 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 RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) };
const IA = () => { dispatch({ type: 'FacilityBookings/IA' }) }; const IA = () => { dispatch({ type: 'FacilityBookings/IA' }) };
const IA2 = () => { dispatch({ type: 'FacilityBookings/IA2' }) }; const ResultClear = () => { dispatch({ type: 'FacilityBookings/ResultClear' }) };
const [comminityValues, setComminityValues] = useState(null); const [comminityValues, setComminityValues] = useState(null);
const [curString,setCurString]=useState({communityManagerFee:null,communityMargin:null})
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const formRef = useRef(null); const formRef = useRef(null);
...@@ -27,24 +29,25 @@ const Bookings = (props:any) => { ...@@ -27,24 +29,25 @@ const Bookings = (props:any) => {
console.log("页面进入参数") console.log("页面进入参数")
console.log(DataSave) console.log(DataSave)
setComminityValues(DataSave.communityName) setComminityValues(DataSave.communityName)
RA(1, { userToken: token, communityName: DataSave.communityName }) RA(1, { userToken: token, communityName: DataSave.communityName ,facilitieId:DataSave.id})
} }
}, [DataSave]); }, [DataSave]);
useEffect(() => { useEffect(() => {
IA() IA()
}, []); }, []);
useEffect(() => { useEffect(() => {
if (Data3Error != null) { if (Result != null) {
console.log(Data3Error) console.log(Result)
message.error(Data3Error.msg); message.error(Result.msg);
if (Data3Error.index == 1) { if (Result.index == 1) {
IA() IA()
} }
setLoading(false) setLoading(false)
IA2() ResultClear()
} }
}, [Data3Error]); }, [Result]);
useEffect(() => { useEffect(() => {
setLoading(false) setLoading(false)
...@@ -80,11 +83,11 @@ const Bookings = (props:any) => { ...@@ -80,11 +83,11 @@ const Bookings = (props:any) => {
console.log("Success:") console.log("Success:")
var tmp = value var tmp = value
console.log(value) console.log(value)
tmp.categoriesId = null // tmp.categoriesId = null
tmp.facilitiesId = null // tmp.facilitiesId = null
tmp.communityName = null // tmp.communityName = null
tmp.communityManagerFee = null // tmp.communityManagerFee = null
tmp.communityMargin=null // tmp.communityMargin=null
if (value.categoriesName != null) { if (value.categoriesName != null) {
tmp.categoriesId = value.categoriesName.categoriesId tmp.categoriesId = value.categoriesName.categoriesId
tmp.facilitiesId=value.categoriesName.facilitiesId tmp.facilitiesId=value.categoriesName.facilitiesId
...@@ -99,23 +102,40 @@ const Bookings = (props:any) => { ...@@ -99,23 +102,40 @@ const Bookings = (props:any) => {
if (comminityValues!=null) { if (comminityValues!=null) {
tmp.communityName=comminityValues tmp.communityName=comminityValues
} }
if (Data4 != null) { if (curString != null) {
tmp.communityManagerFee = numberToString(Data4.communityManagerFee) tmp.communityManagerFee = numberToString(curString.communityManagerFee)
tmp.communityMargin= numberToString(Data4.communityMargin) tmp.communityMargin= numberToString(curString.communityMargin)
} }
if (tmp.accountName.length<2) {
message.error("User Name Should be limit 2~30!", 3)
} else {
//还差检测 //还差检测
if (checkParam(tmp)) { if (checkParam(tmp)) {
console.log(tmp) console.log(tmp)
RA(11, tmp) RA(11, tmp)
} else { } 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(checkParam(tmp))
// console.log(comminityValues) // console.log(comminityValues)
// console.log(tmp) // 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 ( return (
<div className={styles.base}> <div className={styles.base}>
...@@ -138,11 +158,15 @@ const Bookings = (props:any) => { ...@@ -138,11 +158,15 @@ const Bookings = (props:any) => {
<div className={styles.box2item1}>Facility Bookings</div> <div className={styles.box2item1}>Facility Bookings</div>
<div className={styles.box2item2}> <div className={styles.box2item2}>
<Form.Item name="categoriesName" > <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 ( return (
<Radio key={"Radio_" + index} value={item}>{item.categoriesName}</Radio> tmp
) )
}) })
} }
...@@ -154,7 +178,7 @@ const Bookings = (props:any) => { ...@@ -154,7 +178,7 @@ const Bookings = (props:any) => {
<div className={styles.box3}> <div className={styles.box3}>
<div className={styles.box3item1}>User Name</div> <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.box3item3}>Contact Details</div>
<div className={styles.box3item4}><Form.Item name="accountPhone" ><Input style={{ width: 200 }} /></Form.Item></div> <div className={styles.box3item4}><Form.Item name="accountPhone" ><Input style={{ width: 200 }} /></Form.Item></div>
</div> </div>
...@@ -179,16 +203,21 @@ const Bookings = (props:any) => { ...@@ -179,16 +203,21 @@ const Bookings = (props:any) => {
</Row> </Row>
</div> </div>
</div> </div>
{
{/* <div className={styles.box6}> curString.communityManagerFee!=null?
<>
<div className={styles.box6}>
<div className={styles.box6item1}>Management fee required</div> <div className={styles.box6item1}>Management fee required</div>
<div className={styles.box6item2}>${Data4.communityManagerFee}</div> <div className={styles.box6item2}>${curString.communityManagerFee}</div>
</div> </div>
<div className={styles.box6}> <div className={styles.box6}>
<div className={styles.box6item1}>Deposit is required</div> <div className={styles.box6item1}>Deposit is required</div>
<div className={styles.box6item2}>${Data4.communityMargin}</div> <div className={styles.box6item2}>${curString.communityMargin}</div>
</div> */} </div>
</>:null
}
<div className={styles.line}></div><Button htmlType="submit" type="primary" style={{ width: 80, height: 32 }}>Submit</Button> <div className={styles.line}></div><Button htmlType="submit" type="primary" style={{ width: 80, height: 32 }}>Submit</Button>
</Form> </Form>
...@@ -199,12 +228,11 @@ const Bookings = (props:any) => { ...@@ -199,12 +228,11 @@ const Bookings = (props:any) => {
}; };
function mapStateToProps(state:any) { function mapStateToProps(state:any) {
const { Data3,Data4,Data3Error,DataSave } = state.FacilityBookings; const { Data3,Result,DataSave } = state.FacilityBookings;
const { token } = state.login; const { token } = state.login;
return { return {
Data3, Data3,
Data4, Result,
Data3Error,
DataSave, DataSave,
token, 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;
...@@ -22,19 +22,19 @@ import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptio ...@@ -22,19 +22,19 @@ import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptio
import { getUrlLast,numberToString } from '../../../utils/string' import { getUrlLast,numberToString } from '../../../utils/string'
const FacilityManager = (props:any) => { const Facility = (props:any) => {
const { dispatch, location, token,sourceData,DataSave} = props; const { dispatch, location, token,sourceData,DataSave,Result} = props;
const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) }; const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) };
const ResultClear = () => { dispatch({ type: 'FacilityBookings/ResultClear' })}
const [Ref1, setRef1] = useState([]) const [Ref1, setRef1] = useState([])
const [Ref2, setRef2] = useState([]) const [Ref2, setRef2] = useState([])
const [Ref3, setRef3] = useState([]) const [Ref3, setRef3] = useState([])
const [extend, setExtend] = useState(null) const [extend, setExtend] = useState(null)
const [timeExtend, setTimeExtend] = useState(null) const [timeExtend, setTimeExtend] = useState(null)
const [pictrueExtend,setPictrueExtend]=useState({pic:null,pics:null}) const [pictrueExtend,setPictrueExtend]=useState({pic:null,pics:null,tab:3})
const [facilityDetail, setFacilityDetail] = useState(false) const [facilityDetail, setFacilityDetail] = useState(false)
const [PATHNAME, setPATHNAME] = useState("") const [PATHNAME, setPATHNAME] = useState("")
...@@ -44,13 +44,33 @@ const FacilityManager = (props:any) => { ...@@ -44,13 +44,33 @@ const FacilityManager = (props:any) => {
var result=new Array() var result=new Array()
if (values != null) { if (values != null) {
values.map((item, index) => { values.map((item:any, index:any) => {
result.push({ url: item }) result.push({ url: item })
}) })
} }
return result
}
const picFromate2 = (values: any) => {
var result=new Array()
if (values != null) {
values.map((item:any, index:any) => {
result.push({ url: item.categoriesImageUrl,name:item.categoriesName })
})
}
console.log(result) console.log(result)
return result return result
} }
useEffect(() => {
if (Result != null) {
console.log("页面请求")
console.log(Result)
ResultClear()
history.push("/CommunityManagement/FacilityBookings")
}
}, [Result])
const RA_S = () => { const RA_S = () => {
if (DataSave != null) { if (DataSave != null) {
console.log("请求的设施ID为:"+ DataSave.id) console.log("请求的设施ID为:"+ DataSave.id)
...@@ -70,9 +90,9 @@ const FacilityManager = (props:any) => { ...@@ -70,9 +90,9 @@ const FacilityManager = (props:any) => {
setExtend(sourceData.communityName) setExtend(sourceData.communityName)
setTimeExtend(sourceData.reservationQuantumTime) setTimeExtend(sourceData.reservationQuantumTime)
// 中断 // 中断
// var data=sourceData.facilitiesImageList var data = sourceData.facilitiesImageList
var data=["https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"] var data2=sourceData.categoriesList
setPictrueExtend({tab:null,pic:null,pics:picFromate()}) setPictrueExtend({tab:null,pic:picFromate2(data2),pics:picFromate(data)})
formRef.current.setFieldsValue(sourceData) formRef.current.setFieldsValue(sourceData)
} }
}, [sourceData]) }, [sourceData])
...@@ -98,7 +118,7 @@ const FacilityManager = (props:any) => { ...@@ -98,7 +118,7 @@ const FacilityManager = (props:any) => {
} }
},[]) },[])
const PictureOptionsRef = (values:any) => { const PictureOptionsRef = (values:any) => {
// console.log(values) console.log(values)
setRef1(values) setRef1(values)
} }
const TimeSelectRef = (values:any) => { const TimeSelectRef = (values:any) => {
...@@ -113,7 +133,7 @@ const FacilityManager = (props:any) => { ...@@ -113,7 +133,7 @@ const FacilityManager = (props:any) => {
var flag = true var flag = true
for (var i in values) { for (var i in values) {
console.log(values[i]); // console.log(values[i]);
if (values[i] == null) { if (values[i] == null) {
flag=false flag=false
} else { } else {
...@@ -126,8 +146,13 @@ const FacilityManager = (props:any) => { ...@@ -126,8 +146,13 @@ const FacilityManager = (props:any) => {
var result = values var result = values
result.communityName=extend result.communityName=extend
result.categoriesName= Ref1 result.categoriesName= Ref1
result.categoriesDetailsImageName= Ref2 result.categoriesDetailsImageName = Ref2
if (Ref3.length!=0) {
result.reservationQuantumTime = Ref3 result.reservationQuantumTime = Ref3
} else {
result.reservationQuantumTime = ["09:00-20:00"]
}
result.categoriesOpenTime = "09:00-20:00" result.categoriesOpenTime = "09:00-20:00"
if (result.communityManagerFee == null) { if (result.communityManagerFee == null) {
result.communityManagerFee=numberToString(0) result.communityManagerFee=numberToString(0)
...@@ -139,11 +164,29 @@ const FacilityManager = (props:any) => { ...@@ -139,11 +164,29 @@ const FacilityManager = (props:any) => {
} else { } else {
result.communityMargin=numberToString(result.communityMargin) result.communityMargin=numberToString(result.communityMargin)
} }
if (result.canReservationDay <= result.cancelReservationDay || result.canReservationDay <= result.nomarginCancelReservationDay) {
message.error("can Reservation Day is invaild!", 3)
result.canReservationDay=null
}
console.log('Should be check:', result); console.log('Should be check:', result);
if (checkParam(result)) { if (checkParam(result)) {
console.log('Success:', result); console.log('Success:', result);
//中断 //中断
RA(6, values); if (pictrueExtend.tab == 3) {
console.log("提交")
if (Result == null) {
RA(6, result);
}
} else {
result.id = DataSave.id
console.log("编辑")
console.log(result)
if (Result == null) {
RA(17, result);
}
}
}else{message.error("Error,Please finish it,not empty!",3)} }else{message.error("Error,Please finish it,not empty!",3)}
}; };
...@@ -159,9 +202,6 @@ const FacilityManager = (props:any) => { ...@@ -159,9 +202,6 @@ const FacilityManager = (props:any) => {
const keyup_tool=(value: any)=>{ const keyup_tool=(value: any)=>{
return getNumber(value.replace(/[^\d^\.]+/g, '') ) return getNumber(value.replace(/[^\d^\.]+/g, '') )
} }
const keyup_tool2=(value: any)=>{
return value.replace(/[^\d^\.]+/g, '')
}
const keyup_communityManagerFee = (e: any) => { const keyup_communityManagerFee = (e: any) => {
e.target.value =keyup_tool(e.target.value) e.target.value =keyup_tool(e.target.value)
formRef.current.setFieldsValue({communityManagerFee:e.target.value}) formRef.current.setFieldsValue({communityManagerFee:e.target.value})
...@@ -170,21 +210,12 @@ const FacilityManager = (props:any) => { ...@@ -170,21 +210,12 @@ const FacilityManager = (props:any) => {
e.target.value =keyup_tool(e.target.value) e.target.value =keyup_tool(e.target.value)
formRef.current.setFieldsValue({communityMargin:e.target.value}) formRef.current.setFieldsValue({communityMargin:e.target.value})
} }
const keyup_cancelReservationDay = (e: any) => {
e.target.value =keyup_tool2(e.target.value) const keyup = (keyname:any,e: any) => {
formRef.current.setFieldsValue({cancelReservationDay:e.target.value}) e.target.value = (e.target.value).replace(/[^\d^\.]+/g, '')
} var tmp = {}
const keyup_nomarginCancelReservationDay = (e: any) => { tmp[keyname]=e.target.value
e.target.value =keyup_tool2(e.target.value) formRef.current.setFieldsValue(tmp)
formRef.current.setFieldsValue({nomarginCancelReservationDay:e.target.value})
}
const keyup_canReservationDay = (e: any) => {
e.target.value =keyup_tool2(e.target.value)
formRef.current.setFieldsValue({canReservationDay:e.target.value})
}
const keyup_canReservationNum = (e: any) => {
e.target.value =keyup_tool2(e.target.value)
formRef.current.setFieldsValue({canReservationNum:e.target.value})
} }
return ( return (
...@@ -196,7 +227,7 @@ const FacilityManager = (props:any) => { ...@@ -196,7 +227,7 @@ const FacilityManager = (props:any) => {
<Row gutter={32}> <Row gutter={32}>
<Col>所属小区</Col> <Col>所属小区</Col>
<Col><SearchOptionsCommnity defaultValue={extend} onSubmit={extendName} /></Col> <Col><SearchOptionsCommnity defaultValue={extend} onSubmit={extendName} disabled={pictrueExtend.tab!=3?true:false} /></Col>
</Row> </Row>
<Row gutter={32} style={{marginTop:28}}> <Row gutter={32} style={{marginTop:28}}>
<Col>设施名称</Col> <Col>设施名称</Col>
...@@ -211,12 +242,32 @@ const FacilityManager = (props:any) => { ...@@ -211,12 +242,32 @@ const FacilityManager = (props:any) => {
{ {
extend != null ? extend != null ?
<><Col>设施品类</Col> <><Col>设施品类</Col>
<Col><PictureOptions disabled={facilityDetail} defultValue={[]} putSubmit={PictureOptionsRef} <Col>
{
pictrueExtend.pic!=null
?
<PictureOptions disabled={facilityDetail} defultValue={[]} putSubmit={PictureOptionsRef}
data={{
userToken: token,
imageType: 'categoriesImageName',
extends: extend,
}}
defultValue={pictrueExtend.pic}
/>
:null
}
{
pictrueExtend.tab == 3 ? <>
<PictureOptions disabled={facilityDetail} defultValue={[]} putSubmit={PictureOptionsRef}
data={{ data={{
userToken: token, userToken: token,
imageType: 'categoriesImageName', imageType: 'categoriesImageName',
extends: extend, extends: extend,
}} /> }} />
</>
:null
}
</Col> </Col>
</> : null </> : null
} }
...@@ -235,7 +286,7 @@ const FacilityManager = (props:any) => { ...@@ -235,7 +286,7 @@ const FacilityManager = (props:any) => {
? ?
<PictureOptionsRow disabled={facilityDetail} putSubmit={PictureOptionsRowRef} data={{ <PictureOptionsRow disabled={facilityDetail} putSubmit={PictureOptionsRowRef} data={{
userToken: token, userToken: token,
imageType: 'categoriesImageName', imageType: 'categoriesDetailsImageName',
extends: extend, extends: extend,
}} }}
defultValue={pictrueExtend.pics} /> defultValue={pictrueExtend.pics} />
...@@ -247,7 +298,7 @@ const FacilityManager = (props:any) => { ...@@ -247,7 +298,7 @@ const FacilityManager = (props:any) => {
extend != null ? extend != null ?
<PictureOptionsRow disabled={facilityDetail} putSubmit={PictureOptionsRowRef} data={{ <PictureOptionsRow disabled={facilityDetail} putSubmit={PictureOptionsRowRef} data={{
userToken: token, userToken: token,
imageType: 'categoriesImageName', imageType: 'categoriesDetailsImageName',
extends: extend, extends: extend,
}}/> }}/>
:null :null
...@@ -267,10 +318,10 @@ const FacilityManager = (props:any) => { ...@@ -267,10 +318,10 @@ const FacilityManager = (props:any) => {
<Row gutter={32} style={{marginTop:28}}> <Row gutter={32} style={{marginTop:28}}>
<Col>预约设置</Col> <Col>预约设置</Col>
<Col> <Col>
<Row gutter={100}> <Row gutter={20}>
<Col><Form.Item name="cancelReservationDay" label="提前取消预订"><Input onKeyUp={keyup_cancelReservationDay} placeholder="取消预订" style={{width:160}} disabled={facilityDetail} suffix="Day"/></Form.Item></Col> <Col><Form.Item name="cancelReservationDay" label="提前取消预订"><Input onKeyUp={keyup.bind(this,"cancelReservationDay")} placeholder="取消预订" style={{width:160}} disabled={facilityDetail} suffix="Day"/></Form.Item></Col>
<Col><Form.Item name="nomarginCancelReservationDay" label="不交押金,自动取消预订"><Input onKeyUp={keyup_nomarginCancelReservationDay} placeholder="不交押金,取消预订" style={{width:160}} disabled={facilityDetail} suffix="Day"/></Form.Item></Col> <Col><Form.Item name="nomarginCancelReservationDay" label="不交押金,自动取消预订"><Input onKeyUp={keyup.bind(this,"omarginCancelReservationDay")} placeholder="不交押金,取消预订" style={{ width: 160 }} disabled={facilityDetail} suffix="Day" /></Form.Item></Col>
<Col><Form.Item name="canReservationDay" label="可提前预订"><Input onKeyUp={keyup_canReservationDay} placeholder="可预订" style={{width:160}} disabled={facilityDetail} suffix="Day"/></Form.Item></Col> <Col><Form.Item name="canReservationDay" label="可提前预订"><Input onKeyUp={keyup.bind(this,"canReservationDay")} placeholder="可预订" style={{width:160}} disabled={facilityDetail} suffix="Day"/></Form.Item></Col>
</Row> </Row>
<Row gutter={8}> <Row gutter={8}>
<Col> <Col>
...@@ -282,7 +333,7 @@ const FacilityManager = (props:any) => { ...@@ -282,7 +333,7 @@ const FacilityManager = (props:any) => {
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
<Col><Form.Item name="canReservationNum" ><Input onKeyUp={keyup_canReservationNum} placeholder="times" style={{width:120}} disabled={facilityDetail} suffix="Times"/></Form.Item></Col> <Col><Form.Item name="canReservationNum" ><Input onKeyUp={keyup.bind(this,"canReservationNum")} placeholder="times" style={{width:120}} disabled={facilityDetail} suffix="Times"/></Form.Item></Col>
</Row> </Row>
</Col> </Col>
</Row> </Row>
...@@ -302,15 +353,16 @@ const FacilityManager = (props:any) => { ...@@ -302,15 +353,16 @@ const FacilityManager = (props:any) => {
}; };
function mapStateToProps(state:any) { function mapStateToProps(state:any) {
const { sourceData, DataSave } = state.FacilityBookings; const { sourceData, DataSave ,Result} = state.FacilityBookings;
const { token } = state.login; const { token } = state.login;
return { return {
DataSave, DataSave,
sourceData, sourceData,
token token,
Result
}; };
} }
export default connect(mapStateToProps)(FacilityManager); export default connect(mapStateToProps)(Facility);
// ["10:00-12:00","13:00-14:00"] // ["10:00-12:00","13:00-14:00"]
// defultValue={[{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", name: "篮球场A"},{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", name: "篮球场B" }]} // defultValue={[{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", name: "篮球场A"},{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", name: "篮球场B" }]}
......
...@@ -12,15 +12,21 @@ import { timestampToTime } from '../../../utils/time'; ...@@ -12,15 +12,21 @@ import { timestampToTime } from '../../../utils/time';
import TitleSearch from '../../../components/TitleSearch/TitleSearch'; import TitleSearch from '../../../components/TitleSearch/TitleSearch';
const managerFeeStatusDes= ["未交", "已交", "已退"] // const managerFeeStatusDes= ["未交", "已交", "已退"]
const marginFeeStatusDes = ["未交", "已交", "未退", "已退部分", "已退全部"] // const marginFeeStatusDes = ["未交", "已交", "未退", "已退部分", "已退全部"]
const statusDes = ["全部", "已申请", "已预订", "已使用", "已取消", "已完成"] // 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'; import { getUrlLastParams } from '../../../utils/string';
const FacilityBookings = (props:any) => { const FacilityBookings = (props:any) => {
const { formatMessage } = useIntl(); 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 RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: {index:index, body:values } }) };
const SA = (values: any) => { dispatch({ type: 'FacilityBookings/SA', playload: values }) }; const SA = (values: any) => { dispatch({ type: 'FacilityBookings/SA', playload: values }) };
...@@ -29,25 +35,28 @@ const FacilityBookings = (props:any) => { ...@@ -29,25 +35,28 @@ const FacilityBookings = (props:any) => {
const CA = () => { dispatch({ type: 'FacilityBookings/CA', playload: null }) }; const CA = () => { dispatch({ type: 'FacilityBookings/CA', playload: null }) };
const [tab, setTab] = useState(location.query.Facility == "true" ? 2 : 1)
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const [columns, setColumns] = useState([]) const [columns, setColumns] = useState([])
const [columns2, setColumns2] = useState([]) const [columns2, setColumns2] = useState([])
const goToFunction = () => { const goToFunction = () => {
if(tab==2){CA()} if(curString.tab==2){CA()}
history.push(location.pathname + (tab==1?'/Booking':'/Adding')) history.push(location.pathname + (curString.tab==1?'/Booking':'/Adding'))
} }
const goToDetail = (values:any) => { const goToDetail = (values:any) => {
SA(values) SA(values)
console.log(values) console.log("准备页面跳转")
console.log(curString)
history.push(location.pathname + '/Detail') history.push(location.pathname + '/Detail')
} }
const makeOperator = (values: any,index:any, e: any) => { const makeOperator = (values: any,index:any, e: any) => {
const path = ['/FacilityDetail', '/FacilityEdit', '/FacilityApply'] const path = ['/FacilityDetail', '/FacilityEdit', '/FacilityApply']
SA(values) SA(values)
console.log("准备页面跳转")
console.log(curString)
history.push(location.pathname + path[index]) history.push(location.pathname + path[index])
} }
...@@ -69,13 +78,13 @@ const FacilityBookings = (props:any) => { ...@@ -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>)], ["Actions",null, (text: any, record: any) => (<Space size="middle"> <a onClick={goToDetail.bind(this,record)}>Detail</a></Space>)],
] ]
const key2 = [ const key2 = [
["小区", "communityName"], ["Community", "communityName"],
["设施", "facilityName"], ["Facilty", "facilityName"],
["开发时间", "categoriesOpenTime"], ["Open Time", "categoriesOpenTime"],
["操作", null, (text: any, record: any) => (<Space size="middle"> ["Action", null, (text: any, record: any) => (<Space size="middle">
<a onClick={makeOperator.bind(this,record,0)}>详情</a> <a onClick={makeOperator.bind(this,record,0)}>Detail</a>
<a onClick={makeOperator.bind(this,record,1)}>编辑</a> <a onClick={makeOperator.bind(this,record,1)}>Edit</a>
<a onClick={makeOperator.bind(this,record,2)}>预约</a> <a onClick={makeOperator.bind(this,record,2)}>Booking</a>
</Space>)] </Space>)]
] ]
setColumns(objectColumns(key)) setColumns(objectColumns(key))
...@@ -83,8 +92,8 @@ const FacilityBookings = (props:any) => { ...@@ -83,8 +92,8 @@ const FacilityBookings = (props:any) => {
console.log("页面刷新") console.log("页面刷新")
console.log(DataSave) console.log(DataSave)
console.log(curString) console.log(curString)
if (tab == 1) { if (curString.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 { } else {
RA(8,{ userToken: token, pageNum: curString.curPage2 }) RA(8,{ userToken: token, pageNum: curString.curPage2 })
} }
...@@ -97,7 +106,7 @@ const FacilityBookings = (props:any) => { ...@@ -97,7 +106,7 @@ const FacilityBookings = (props:any) => {
const CallBackTitleSearch= (comment: any) => { const CallBackTitleSearch= (comment: any) => {
if (tab == 1) { if (curString.tab == 1) {
if (comment.communityName != null || comment.key != null || comment.status != null) { if (comment.communityName != null || comment.key != null || comment.status != null) {
var tmp = curString var tmp = curString
tmp.subscribeDate = comment.key tmp.subscribeDate = comment.key
...@@ -106,14 +115,17 @@ const FacilityBookings = (props:any) => { ...@@ -106,14 +115,17 @@ const FacilityBookings = (props:any) => {
} else { } else {
tmp.status = comment.status tmp.status = comment.status
} }
tmp.communityNameList = comment.communityName
tmp.curPage=1 tmp.curPage=1
QA(tmp) QA(tmp)
console.log(tmp)
//中断
RA(9, { userToken: token, pageNum: "1", subscribeDate: tmp.subscribeDate, status: tmp.status,communityNameList:comment.communityName }) RA(9, { userToken: token, pageNum: "1", subscribeDate: tmp.subscribeDate, status: tmp.status,communityNameList:comment.communityName })
} }
} else { } else {
if (comment.communityName != null || comment.facilityName != null) { if (comment.communityName != null || comment.facilityName != null) {
var tmp = curString var tmp = curString
tmp.communityName = comment.communityName tmp.communityNameList = comment.communityName
tmp.facilityName = comment.facilityName tmp.facilityName = comment.facilityName
tmp.curPage=1 tmp.curPage=1
QA(tmp) QA(tmp)
...@@ -123,27 +135,33 @@ const FacilityBookings = (props:any) => { ...@@ -123,27 +135,33 @@ const FacilityBookings = (props:any) => {
} }
} }
function TabCallback(tab: any) { function TabCallback(tab: any) {
setTab(tab)
setLoading(true) setLoading(true)
var tmp = curString
tmp.tab = tab
QA(tmp)
if (tab == 1) { 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 { } else {
RA(8,{ userToken: token, pageNum: curString.curPage2 }) RA(8,{ userToken: token, pageNum: curString.curPage2 })
} }
} }
function Pagechange(current: any, pageSize: any) { function Pagechange(current: any, pageSize: any) {
setLoading(true) setLoading(true)
if (tab == 1) { if (curString.tab == 1) {
var tmp = curString var tmp = curString
tmp.curPage = current tmp.curPage = current
QA(tmp) 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 { } else {
var tmp = curString var tmp = curString
tmp.curPage2 = current tmp.curPage2 = current
QA(tmp) 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) => { ...@@ -153,15 +171,16 @@ const FacilityBookings = (props:any) => {
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件 */} {/* 头部组件 */}
{ {
tab == 1 ? curString.tab == 1 ?
<> <>
<TitleSearch <TitleSearch
status={[{ status={[{
name: ["status", "订单状态"], name: ["status", "订单状态"],
data: [[0, "全部"], [1, "已申请"], [2, "已预订"], [3, "已使用"], [4, "已取消"]] data: [[0, "All"], [1, "Applied"], [2, "Reserved"], [3, "Used"], [4, "Cancelled"]]
}]} }]}
time={["key", "预订时间筛选"]} time={["key", "预订时间筛选"]}
community={"communityName"} community={"communityName"}
checklist={curString.communityNameList!=null?curString.communityNameList:null}
onSubmit={CallBackTitleSearch} /> onSubmit={CallBackTitleSearch} />
</> : </> :
<> <>
...@@ -174,10 +193,10 @@ const FacilityBookings = (props:any) => { ...@@ -174,10 +193,10 @@ const FacilityBookings = (props:any) => {
<div style={{position:"relative",height:40}}> <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> </div>
<Tabs defaultActiveKey={tab.toString()} onChange={TabCallback}> <Tabs defaultActiveKey={curString.tab.toString()} onChange={TabCallback}>
<TabPane tab="Facility Bookings" key="1"> <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 }} /> <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> </TabPane>
...@@ -192,14 +211,14 @@ const FacilityBookings = (props:any) => { ...@@ -192,14 +211,14 @@ const FacilityBookings = (props:any) => {
}; };
function mapStateToProps(state: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; const { token } = state.login;
return { return {
Data, Data,
DataPage,
Data2, Data2,
DataSave, DataSave,
curString, curString,
Result,
token token
}; };
} }
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './index.less'; 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 { 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 { formatMessage } = useIntl();
const { location } = props; const { location } = props;
const nameofowner = formatMessage({ id: 'R.charge.input.nameofowner' })
const inputProject = formatMessage({ id: 'R.charge.input.project' }) const { dispatch,Data,Result } = props;
const username = formatMessage({ id: 'R.charge.username' }) const RA = (index: any, values: any) => { dispatch({ type: 'Contract/RA', playload: { index: index, body: values } }) };
const project = formatMessage({ id: 'R.charge.project' }) const SA = (values: any) => { dispatch({ type: 'Contract/SA', playload: values }) };
const unit = formatMessage({ id: 'R.charge.unit' })
const status = formatMessage({ id: 'R.charge.status' }) useEffect(() => {
const submissionTime = formatMessage({ id: 'R.charge.submissionTime' }) console.log("合同页面")
const actions = formatMessage({ id: 'R.charge.actions' }) RA(19, {
const search = formatMessage({ id: 'R.charge.search' }) pageNum:"1",
const addaccount = formatMessage({ id: 'R.charge.addaccount' }) contractNumber:"",
const paymentsetting = formatMessage({ id: 'R.charge.paymentsetting' }) contractTitle:"",
communityName:""
const menuListNormal = ["A",'Accounting company'] })
const [display, setDisplay] = useState("A");//小组件:线框 }, [])
const pagination={defaultCurrent:1,total: 16} useEffect(() => {
if (Data != null) {
const goToDetail = () => { console.log(Data)
history.push(location.pathname+'/Detail?id=123') }
},[Data])
const goToDetail = (record: any, e: any) => {
SA(record)
history.push(location.pathname+'/Detail')
} }
const goToEdit = () => { const goToEdit = () => {
history.push(location.pathname+'/Edit') history.push(location.pathname+'/Edit')
} }
const columns = [ 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, title: "Actions",
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',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space size="middle"> <Space size="middle">
<a onClick={goToDetail}>Detail</a> <a onClick={goToDetail.bind(this,record)}>Detail</a>
</Space> </Space>
), ),
}, },
...@@ -83,9 +64,9 @@ const Contract = (props: { location: any; }) => { ...@@ -83,9 +64,9 @@ const Contract = (props: { location: any; }) => {
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件 */} {/* 头部组件 */}
<div className={styles.box}> <div className={styles.box}>
<input className={styles.item1} placeholder={nameofowner} /> <input className={styles.item1} placeholder={"nameofowner"} />
<input className={styles.item2} placeholder={inputProject} /> <input className={styles.item2} placeholder={"inputProject"} />
<button className={styles.item3}>{search}</button> <button className={styles.item3}>Search</button>
</div> </div>
{/* 内容组件 */} {/* 内容组件 */}
...@@ -95,12 +76,22 @@ const Contract = (props: { location: any; }) => { ...@@ -95,12 +76,22 @@ const Contract = (props: { location: any; }) => {
</div> </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> </div>
); );
}; };
function mapStateToProps(state:any) {
export default Contract; const { Data,curString,Result } = state.Contract;
return {
Data,
curString,
Result,
};
}
export default connect(mapStateToProps)(Contract);
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './index.less'; 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'; import { Link, useIntl, connect, Dispatch, history } from 'umi';
...@@ -29,7 +30,55 @@ const Users = (props:any) => { ...@@ -29,7 +30,55 @@ const Users = (props:any) => {
const addaccount = formatMessage({ id: 'R.charge.addaccount' }) const addaccount = formatMessage({ id: 'R.charge.addaccount' })
const paymentsetting = formatMessage({ id: 'R.charge.paymentsetting' }) 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(() => { useEffect(() => {
// console.log(CommunityList ) // console.log(CommunityList )
if (CommunityList != null) { if (CommunityList != null) {
...@@ -51,7 +100,8 @@ const Users = (props:any) => { ...@@ -51,7 +100,8 @@ const Users = (props:any) => {
SA(values) SA(values)
history.push(location.pathname+'/Detail') history.push(location.pathname+'/Detail')
} }
const goToEdit = () => { const goToEdit = (values: any, e: any) => {
SA(values)
history.push(location.pathname+'/Edit') history.push(location.pathname+'/Edit')
} }
...@@ -63,11 +113,12 @@ const Users = (props:any) => { ...@@ -63,11 +113,12 @@ const Users = (props:any) => {
{ title: username, dataIndex: 'owerName', }, { title: username, dataIndex: 'owerName', },
{title: project,dataIndex: 'communityName',}, {title: project,dataIndex: 'communityName',},
{title: unit,render:(text: any, record: any) => (<div>{record.buildingNumber+"#"+record.floorNumber+"—"+record.roomNumber}</div>)}, {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: submissionTime,render:(text: any, record: any) => (<div>{timestampToTime(record.createTime.time)}</div>)},
{title: actions, {title: actions,
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space size="middle"> <Space size="middle">
<a onClick={goToEdit.bind(this, record)}>Edit</a>
<a onClick={goToDetail.bind(this,record)}>Detail</a> <a onClick={goToDetail.bind(this,record)}>Detail</a>
</Space> </Space>
), ),
...@@ -86,6 +137,8 @@ const Users = (props:any) => { ...@@ -86,6 +137,8 @@ const Users = (props:any) => {
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件 */} {/* 头部组件 */}
{fileUpload!=true? <>
<TitleSearch <TitleSearch
listkey={["OwnerName"]} listkey={["OwnerName"]}
list={["Owner Name"]} list={["Owner Name"]}
...@@ -95,17 +148,29 @@ const Users = (props:any) => { ...@@ -95,17 +148,29 @@ const Users = (props:any) => {
{/* 内容组件 */} {/* 内容组件 */}
<div className={styles.box2}> <div className={styles.box2}>
<button className={styles.buttonAdd2} onClick={goToAdd}>Create New Owner</button> <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> </div>
{/* 列表组件 */} {/* 列表组件 */}
{ {
Data != null ? Data != null ?
<Table rowKey={"id"} style={{ marginTop: 16 }} dataSource={Data.rows} columns={columns} pagination={curString} /> <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> </div>
); );
...@@ -124,3 +189,4 @@ function mapStateToProps(state:any) { ...@@ -124,3 +189,4 @@ function mapStateToProps(state:any) {
}; };
} }
export default connect(mapStateToProps)(Users); export default connect(mapStateToProps)(Users);
...@@ -22,7 +22,7 @@ const UsersAdd = (props:any) => { ...@@ -22,7 +22,7 @@ const UsersAdd = (props:any) => {
if (postman.extend != null) { if (postman.extend != null) {
values.communityName = postman.extend values.communityName = postman.extend
} else { } else {
values.communityName=null values.communityName = null
} }
var tmp = Object.keys(values); var tmp = Object.keys(values);
console.log("添加业主提交的参数:" + tmp.length) console.log("添加业主提交的参数:" + tmp.length)
...@@ -42,7 +42,7 @@ const UsersAdd = (props:any) => { ...@@ -42,7 +42,7 @@ const UsersAdd = (props:any) => {
const checkInput = (e: any) => { const checkInput = (e: any) => {
console.log(e) console.log(e)
if (e.target.value.length == 1) { 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 ( return (
...@@ -53,7 +53,7 @@ const UsersAdd = (props:any) => { ...@@ -53,7 +53,7 @@ const UsersAdd = (props:any) => {
<Form ref={formRef} name="basic" onFinish={onFinish}> <Form ref={formRef} name="basic" onFinish={onFinish}>
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Owner's Name</div> <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>
<div className={styles.box4}> <div className={styles.box4}>
......
...@@ -8,50 +8,77 @@ import Line from '../../../components/Line/Line'; ...@@ -8,50 +8,77 @@ import Line from '../../../components/Line/Line';
import TitleBack from '../../../components/TitleBack/TitleBack'; import TitleBack from '../../../components/TitleBack/TitleBack';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { checkParam } from '../../../utils/method' 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 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 RA = (index: any, values: any) => { dispatch({ type: 'User/RA', playload: { index: index, body: values } }) };
const ResultClear = () => { dispatch({ type: 'User/ResultClear' }) };
const [postman,setPostman]=useState({extend:null,tab:1}) 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 formRef = useRef(null);
const onFinish=(values:any) => { const onFinish=(values:any) => {
if (DataSave != null) {
if (postman.extend != null) { values.id=DataSave.id
values.communityName = postman.extend
} else { } else {
values.communityName=null values.id=null
} }
var tmp = Object.keys(values); var tmp = Object.keys(values);
console.log("添加业主提交的参数:" + tmp.length) console.log("添加业主提交的参数:" + tmp.length)
console.log(values) console.log(values)
if (checkParam(values)) { if (checkParam(values)) {
RA(14, values) RA(18, values)
} else { } else {
message.error("Error,Please finish it,not empty!",3) 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(() => { useEffect(() => {
if (DataSave != null) { if (DataSave != null) {
console.log("页面数据") console.log("页面数据")
console.log(DataSave) console.log(DataSave)
var tmp = {
owerName: DataSave.owerName,
owerPhone: DataSave.owerPhone,
owerEmail:DataSave.owerEmail
}
formRef.current.setFieldsValue(tmp)
RA(13, { RA(13, {
ownerId:DataSave.id, ownerId:DataSave.id,
owerName:DataSave.owerName, owerName:DataSave.owerName,
communityName:"A7"
}) })
} }
}, [DataSave]) }, [DataSave])
useEffect(() => { useEffect(() => {
if (DataDetail != null) { if (DataSaveDetail != null) {
console.log(DataDetail) console.log("页面数据副歌")
console.log(DataSaveDetail)
}
}, [DataSaveDetail])
useEffect(() => {
if ((location.pathname).indexOf("Edit") > -1) {
setEditFlag(true)
} }
},[DataDetail]) }, [])
setEditFlag
const extendName = (values: any) => { const extendName = (values: any) => {
var tmp = postman var tmp = postman
tmp.extend=values tmp.extend=values
...@@ -60,72 +87,89 @@ const UsersDetail = (props:any) => { ...@@ -60,72 +87,89 @@ const UsersDetail = (props:any) => {
const checkInput = (e: any) => { const checkInput = (e: any) => {
console.log(e) console.log(e)
if (e.target.value.length == 1) { 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 ( return (
<div className={styles.base}> <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}> <Form ref={formRef} name="basic" onFinish={onFinish}>
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Owner's Name</div> <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>
<div className={styles.box4}> <div className={styles.box4}>
<div className={styles.box4item0}>Contact Details</div> <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.box4item1}><Form.Item name="owerPhone" ><Input disabled={!editFlag} placeholder="Phone Number" /></Form.Item></div>
<div className={styles.box4item2}><Form.Item name="owerEmail" ><Input placeholder="Email" /></Form.Item></div> <div className={styles.box4item2}><Form.Item name="owerEmail" ><Input disabled={!editFlag} placeholder="Email" /></Form.Item></div>
</div> </div>
<Line /> <Line />
{
<Tabs defaultActiveKey={postman.tab.toString()} onChange={TabCallback}> DataSaveDetail != null ? <TableShow data={DataSaveDetail} onSubmit={tableShowCallback} onChange={deleteUnit} deleteDisable={!editFlag}/> : null
<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 }} /> */} editFlag ? <>
</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>
<Line /> <Line />
<Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item> <Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</>:null
}
</Form> </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> </div>
); );
}; };
function mapStateToProps(state:any) { function mapStateToProps(state:any) {
const { DataSave,DataDetail} = state.User; const { DataSave,DataSaveDetail,Result} = state.User;
return { return {
DataSave, DataSave,
DataDetail, DataSaveDetail,
Result
}; };
} }
export default connect(mapStateToProps)(UsersDetail); export default connect(mapStateToProps)(UsersDetail);
...@@ -138,6 +182,17 @@ export default connect(mapStateToProps)(UsersDetail); ...@@ -138,6 +182,17 @@ export default connect(mapStateToProps)(UsersDetail);
// "roomNumber":"388", // "roomNumber":"388",
// "addressAndpostalCode":"工业大道3689561" // "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", // "ownerId":"770da9de6b6c43f6b61bc3d671fa2e89",
// "owerName":"jack-小雄", // "owerName":"jack-小雄",
// "communityName":"A7" // "communityName":"A7"
\ No newline at end of file
...@@ -100,8 +100,23 @@ ...@@ -100,8 +100,23 @@
.fontgz(); .fontgz();
} }
.butttonAdd0{
border:1px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
border-radius:2px;
}
.buttonAdd{ .buttonAdd{
// .butttonAdd0();
background:none;
outline: none;
cursor: pointer;
// width:170px;
// height:32px;
position: absolute;
right: 0;
}
.buttonAdd2{
background:none; background:none;
outline: none; outline: none;
cursor: pointer; cursor: pointer;
...@@ -111,11 +126,6 @@ ...@@ -111,11 +126,6 @@
color:rgba(24,144,255,1); color:rgba(24,144,255,1);
border-radius:2px; border-radius:2px;
position: absolute; position: absolute;
right: 0;
}
.buttonAdd2{
.buttonAdd();
right: 180px; right: 180px;
} }
...@@ -18,7 +18,6 @@ const Guard = (props:any) => { ...@@ -18,7 +18,6 @@ const Guard = (props:any) => {
tosCommunityget(null) tosCommunityget(null)
}, []); }, []);
const onFinish = (values:any) => { const onFinish = (values:any) => {
console.log(values) console.log(values)
} }
...@@ -32,11 +31,11 @@ const Guard = (props:any) => { ...@@ -32,11 +31,11 @@ const Guard = (props:any) => {
<TitleGet title={"Version 1.0.3"} /> <TitleGet title={"Version 1.0.5"} />
<p> <p>
token:{token} token:{token}
</p> </p>
<TableShow /> {/* <TableShow /> */}
{/* <div>{token}</div> {/* <div>{token}</div>
<Line /> */} <Line /> */}
......
...@@ -61,24 +61,28 @@ export function TosCommunityFacilitiesFuzzyQuery(values: any) { ...@@ -61,24 +61,28 @@ export function TosCommunityFacilitiesFuzzyQuery(values: any) {
} }
const requestList = [ const requestList = [
"/tos/community/facilities/categories/subscribe/list",//0 请求预订列表 ["/tos/community/facilities/categories/subscribe/list","0 请求预订列表"],
"/tos/community/facilities/get",//1 设施品类获取 ["/tos/community/facilities/get","1 设施品类获取"],
"/tos/community/facilities/categories/detail/get",//2缴费详情 ["/tos/community/facilities/categories/detail/get","2 缴费详情"],
"/tos/community/facilities/categories/fee/back",//3退还押金 ["/tos/community/facilities/categories/fee/back","3 退还押金"],
"/tos/community/facilities/categories/fee/pay",//4缴费 ["/tos/community/facilities/categories/fee/pay","4 缴费"],
"/tos/community/categories/subscribe/cancel",//5取消预约 ["/tos/community/categories/subscribe/cancel","5 取消预约"],
"/tos/community/facilities/add",//6 新增小区设施 ["/tos/community/facilities/add","6 新增小区设施"],
"/tos/bookingService/lookUp",//7 查看小区设施 ["/tos/bookingService/lookUp","7 查看小区设施"],
"/tos/community/facilities/fuzzy/query",//8 查看设施管理模糊 ["/tos/community/facilities/fuzzy/query","8 查看设施管理模糊"],
"/tos/community/categories/subscribe/fuzzy/query",//9 预订列表模糊查询 ["/tos/community/categories/subscribe/fuzzy/query","9 预订列表模糊查询"],
"/tos/user/newCurrentUser", //10 后台用户信息, ["/tos/user/newCurrentUser", "10 后台用户信息"],
"/tos/community/facilities/categories/subscribe",//11 预订 ["/tos/community/facilities/categories/subscribe","11 预订"],
"/tos/tosOwner/getAll", //12 业主查询 ["/tos/tosOwner/getAll", "12 业主查询"],
"/tos/tosOwner/getDetail", //13 业主查询详细 ["/tos/tosOwner/getDetailAll", "13 业主查询详细"],
"/tos/tosOwner/save",//14 业主添加 ["/tos/tosOwner/save","14 业主添加"],
"/tos/life/community/qr/get",//二维码查询 ["/tos/life/community/qr/get","15 二维码查询"],
"/tos/life/community/account/unit/del",//删除单元 ["/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) { function requestAuto(url:string,values:any) {
return request(url, Body(values)) return request(url, Body(values))
...@@ -87,8 +91,8 @@ export function RA(playload: any) { ...@@ -87,8 +91,8 @@ export function RA(playload: any) {
// console.log(playload) // console.log(playload)
// console.log(playload.index) // console.log(playload.index)
// console.log(requestList[playload.index]) // console.log(requestList[playload.index])
var url =requestList[playload.index] var url =(requestList[playload.index])[0]
console.log("发送请求"+url) console.log(playload.index+"》【发送请求】"+url+(requestList[playload.index])[1])
return requestAuto(url,playload.body) return requestAuto(url,playload.body)
} }
import {message } from 'antd';
export const checkParam = (values: any) => { export const checkParam = (values: any) => {
var flag = true var flag = true
for (var i in values) { for (var i in values) {
console.log(values[i]); // console.log(values[i]);
if (values[i] == null) { if (values[i] == null) {
flag=false flag=false
} else { } else {
...@@ -11,3 +13,12 @@ export const checkParam = (values: any) => { ...@@ -11,3 +13,12 @@ export const checkParam = (values: any) => {
} }
return flag 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 @@ ...@@ -20,7 +20,7 @@
"paths": { "paths": {
"@/*": ["./src/*"], "@/*": ["./src/*"],
"@@/*": ["./src/.umi/*"], "@@/*": ["./src/.umi/*"],
"@@@/*":["./src/components/*"], "@C/*":["./src/*"],
} }
}, },
"exclude": ["node_modules", "build", "dist", "scripts", "src/.umi/*", "webpack", "jest"] "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