Commit 2c745ab4 authored by maple's avatar maple

[last]最新提交v1.2.4

parent 2fbb5d5b
...@@ -5,17 +5,25 @@ import styles from './index.less'; ...@@ -5,17 +5,25 @@ import styles from './index.less';
class TagSelect extends React.Component { class TagSelect extends React.Component {
state = { state = {
tags: ['Unremovable', 'Tag 2', 'Tag 3'], value: this.props.value!=null?this.props.value:[],
inputVisible: false, inputVisible: false,
inputValue: '', inputValue: '',
editInputIndex: -1, editInputIndex: -1,
editInputValue: '', editInputValue: '',
}; };
// componentDidUpdate(){
// console.log("--组件更新--")
// console.log(this.props.value)
// }
// componentDidMount(){
// console.log("--组件加载完成--")
// console.log(this.state.value)
// }
handleClose = removedTag => { handleClose = removedTag => {
const tags = this.state.tags.filter(tag => tag !== removedTag); const value = this.state.value.filter(tag => tag !== removedTag);
console.log(tags); console.log(value);
this.setState({ tags }); this.setState({ value });
this.props.onChange(value)
}; };
showInput = () => { showInput = () => {
...@@ -23,18 +31,22 @@ class TagSelect extends React.Component { ...@@ -23,18 +31,22 @@ class TagSelect extends React.Component {
}; };
handleInputChange = e => { handleInputChange = e => {
this.setState({ inputValue: e.target.value }); this.setState({ inputValue: e.target.value });
}; };
handleInputConfirm = () => { handleInputConfirm = () => {
const { inputValue } = this.state; const { inputValue } = this.state;
let { tags } = this.state; let { value } = this.state;
if (inputValue && tags.indexOf(inputValue) === -1) {
tags = [...tags, inputValue]; if (inputValue && value.indexOf(inputValue) === -1) {
this.props.onAdd(inputValue);
value = [...value, inputValue];
} }
console.log(tags); console.log(value);
this.props.onChange(value)
this.setState({ this.setState({
tags, value,
inputVisible: false, inputVisible: false,
inputValue: '', inputValue: '',
}); });
...@@ -45,12 +57,12 @@ class TagSelect extends React.Component { ...@@ -45,12 +57,12 @@ class TagSelect extends React.Component {
}; };
handleEditInputConfirm = () => { handleEditInputConfirm = () => {
this.setState(({ tags, editInputIndex, editInputValue }) => { this.setState(({ value, editInputIndex, editInputValue }) => {
const newTags = [...tags]; const newTags = [...value];
newTags[editInputIndex] = editInputValue; newTags[editInputIndex] = editInputValue;
this.props.onChange(newTags)
return { return {
tags: newTags, value: newTags,
editInputIndex: -1, editInputIndex: -1,
editInputValue: '', editInputValue: '',
}; };
...@@ -66,10 +78,10 @@ class TagSelect extends React.Component { ...@@ -66,10 +78,10 @@ class TagSelect extends React.Component {
}; };
render() { render() {
const { tags, inputVisible, inputValue, editInputIndex, editInputValue } = this.state; const { value, inputVisible, inputValue, editInputIndex, editInputValue } = this.state;
return ( return (
<> <>
{tags.map((tag, index) => { {value.map((tag, index) => {
if (editInputIndex === index) { if (editInputIndex === index) {
return ( return (
<Input <Input
...@@ -91,17 +103,17 @@ class TagSelect extends React.Component { ...@@ -91,17 +103,17 @@ class TagSelect extends React.Component {
<Tag <Tag
className="editTag" className="editTag"
key={tag} key={tag}
closable={index !== 0} closable={index !== -1}
onClose={() => this.handleClose(tag)} onClose={() => this.handleClose(tag)}
> >
<span <span
onDoubleClick={e => { onDoubleClick={e => {
if (index !== 0) {
this.setState({ editInputIndex: index, editInputValue: tag }, () => { this.setState({ editInputIndex: index, editInputValue: tag }, () => {
this.editInput.focus(); this.editInput.focus();
}); });
e.preventDefault(); e.preventDefault();
}
}} }}
> >
{isLongTag ? `${tag.slice(0, 20)}...` : tag} {isLongTag ? `${tag.slice(0, 20)}...` : tag}
......
...@@ -76,14 +76,14 @@ export default { ...@@ -76,14 +76,14 @@ export default {
var tmp = resp.data.rows[0].tosOwerModel; var tmp = resp.data.rows[0].tosOwerModel;
var tmp2 = resp.data.rows[0]; var tmp2 = resp.data.rows[0];
console.error(resp.data.rows[0].replyImgUrl) console.log(resp.data.rows[0].replyImgUrl)
console.error(Fromate(resp.data.rows[0].replyImgUrl,[["url",null]])) console.log(Fromate(resp.data.rows[0].replyImgUrl,[["url",null]]))
var CurDataDetail = { var CurDataDetail = {
community: tmp.communityName, community: tmp.communityName,
address: tmp.addressAndpostalCode, address: tmp.addressAndpostalCode,
home: tmp.buildingNumber + "#" + tmp.floorNumber + "-" + tmp.roomNumber, home: tmp.buildingNumber + "#" + tmp.floorNumber + "-" + tmp.roomNumber,
name: tmp.owerName, name: tmp.owerName,
phone: tmp.owerPhone, phone: tmp.accountLogin!=null?tmp.accountLogin:tmp.owerPhone,
email: tmp.owerEmail, email: tmp.owerEmail,
content: resp.data.rows[0].serviceContent, content: resp.data.rows[0].serviceContent,
replyContent: resp.data.rows[0].replyContent, replyContent: resp.data.rows[0].replyContent,
......
...@@ -20,7 +20,9 @@ export default { ...@@ -20,7 +20,9 @@ export default {
pageDate: null, pageDate: null,
returnValue: null, returnValue: null,
memberResult:null, memberResult: null,
DataServices:null,
}, },
reducers: { reducers: {
...@@ -56,6 +58,9 @@ export default { ...@@ -56,6 +58,9 @@ export default {
}, },
returnMemberResult(state, { memberResult }) { returnMemberResult(state, { memberResult }) {
return{...state,memberResult} return{...state,memberResult}
},
returnDataServices(state, { DataServices }) {
return{...state,DataServices}
} }
}, },
...@@ -74,6 +79,10 @@ export default { ...@@ -74,6 +79,10 @@ export default {
let returnValue = null; let returnValue = null;
yield put({ type: 'DataSaveDetail', DataSaveDetail,returnValue }); yield put({ type: 'DataSaveDetail', DataSaveDetail,returnValue });
} break; } break;
case 43: {
let DataServices = null;
yield put({ type: 'returnDataServices', DataServices });
} break;
} }
const resp = yield call(service.RA, playload); const resp = yield call(service.RA, playload);
...@@ -134,6 +143,11 @@ export default { ...@@ -134,6 +143,11 @@ export default {
let memberResult = resp; let memberResult = resp;
yield put({ type: 'returnMemberResult', memberResult }); yield put({ type: 'returnMemberResult', memberResult });
} break; } break;
case 43: {
let DataServices = resp;
yield put({ type: 'returnDataServices', DataServices });
} break;
} }
} }
......
...@@ -106,42 +106,42 @@ const BookingDetail = (props:any) => { ...@@ -106,42 +106,42 @@ const BookingDetail = (props:any) => {
<TitleBack title={"View Facility Bookings"} url={getUrlLast(location.pathname)+'?Facility=false'}/> <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>Booking Status</Col><Col span={2}>{statusDes[DataSave.status]}</Col>
<Col>下单时间</Col><Col span={2}>{timestampToTime3(DataSave.createTime.time)}</Col> <Col>Order Time</Col><Col span={2}>{timestampToTime3(DataSave.createTime.time)}</Col>
</Row> </Row>
<Line /> <Line />
<Row gutter={8}> <Row gutter={8}>
<Col>服务小区</Col><Col span={3}>{DataSave.communityName}</Col> <Col>Service Community</Col><Col span={3}>{DataSave.communityName}</Col>
<Col>预订设施</Col><Col span={3}>{DataSave.facilityTitle}</Col> <Col>Booking Facilities</Col><Col span={3}>{DataSave.facilityTitle}</Col>
<Col>预订时间</Col><Col span={3}>{DataSave.subscribeDate}</Col> <Col>Booking Time</Col><Col span={3}>{DataSave.subscribeDate}</Col>
<Col span={3}>{DataSave.subscribeTime}</Col> <Col span={3}>{DataSave.subscribeTime}</Col>
</Row> </Row>
<Row gutter={8} style={{marginTop:16}}> <Row gutter={8} style={{marginTop:16}}>
<Col>用户姓名</Col><Col span={3}>{DataSave.accountName}</Col> <Col>User Name</Col><Col span={3}>{DataSave.accountName}</Col>
<Col>联系电话</Col><Col span={3}>{DataSave.accountPhone}</Col> <Col>Contact Number</Col><Col span={3}>{DataSave.accountPhone}</Col>
<Col>单元</Col> <Col>Unit</Col>
<Col span={3}>{DataSave.buildNumber}# {DataSave.floorNumber}-{DataSave.roomNumber}</Col> <Col span={3}>{DataSave.buildNumber}# {DataSave.floorNumber}-{DataSave.roomNumber}</Col>
</Row> </Row>
<Line /> <Line />
{ {
(DataSaveDetail != null && DataSave.status==1)? (DataSaveDetail != null && DataSave.status==1 &&DataSaveDetail.managerFee>0)?
<> <>
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col>需要管理费</Col><Col span={2}>{DataSaveDetail.managerFee}</Col> <Col>Management Fee Required</Col><Col span={2}>{DataSaveDetail.managerFee}</Col>
</Row> </Row>
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col>需要押金</Col><Col span={2}>{DataSaveDetail.marginFee}</Col> <Col>Deposit Required</Col><Col span={2}>{DataSaveDetail.marginFee}</Col>
</Row> </Row>
<div style={{marginTop:16}}> <div style={{marginTop:16}}>
<Button type="primary" onClick={makeFee}>缴费</Button> <Button type="primary" onClick={makeFee}>Pay</Button>
</div> </div>
<Line /> <Line />
</>:null </>:null
} }
{ {
(DataSaveDetail != null&&DataSave.marginFeeStatus == 1) ? (DataSaveDetail != null&&DataSave.marginFeeStatus == 1&&DataSaveDetail.managerFee>0) ?
<> <>
<Form ref={formRef} name="basic2" onFinish={onFinish} onFinishFailed={onFinishFailed} > <Form ref={formRef} name="basic2" onFinish={onFinish} onFinishFailed={onFinishFailed} >
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
...@@ -154,8 +154,6 @@ const BookingDetail = (props:any) => { ...@@ -154,8 +154,6 @@ const BookingDetail = (props:any) => {
<Radio value={1} style={radioStyle}>全额退还</Radio> <Radio value={1} style={radioStyle}>全额退还</Radio>
<Radio value={2} style={radioStyle}>部分退还 {backFeeFlag ?<><Input onChange={getBackMarginFee} style={{ width: 80 }} /> $</>:null}</Radio> <Radio value={2} style={radioStyle}>部分退还 {backFeeFlag ?<><Input onChange={getBackMarginFee} style={{ width: 80 }} /> $</>:null}</Radio>
</Radio.Group> </Radio.Group>
</div> </div>
{ {
......
...@@ -188,11 +188,11 @@ const Bookings = (props:any) => { ...@@ -188,11 +188,11 @@ const Bookings = (props:any) => {
<div className={styles.box4}> <div className={styles.box4}>
<div className={styles.box4item1}>Unit</div> <div className={styles.box4item1}>Unit</div>
<div className={styles.box4item2}><Form.Item name="buildNumber" rules={[{required:true}]}><Input placeholder="building" style={{ width: 80 }} /></Form.Item></div> <div className={styles.box4item2}><Form.Item name="buildNumber" rules={[{required:true},{validator: checkData, trigger: 'blur'}]}><Input placeholder="building" style={{ width: 80 }} /></Form.Item></div>
<div className={styles.box4item3}>#</div> <div className={styles.box4item3}>#</div>
<div className={styles.box4item4}><Form.Item name="floorNumber" rules={[{required:true}]}><Input placeholder="floor" style={{ width: 80 }} /></Form.Item></div> <div className={styles.box4item4}><Form.Item name="floorNumber" rules={[{required:true},{validator: checkData, trigger: 'blur'}]}><Input placeholder="floor" style={{ width: 80 }} /></Form.Item></div>
<div className={styles.box4item5}>——</div> <div className={styles.box4item5}>——</div>
<div className={styles.box4item6}><Form.Item name="roomNumber" rules={[{required:true}]}><Input placeholder="room" style={{ width: 80 }} /></Form.Item></div> <div className={styles.box4item6}><Form.Item name="roomNumber" rules={[{required:true},{validator: checkData, trigger: 'blur'}]}><Input placeholder="room" style={{ width: 80 }} /></Form.Item></div>
</div> </div>
<div className={styles.line}></div> <div className={styles.line}></div>
......
...@@ -6,10 +6,12 @@ import { Link, useIntl, connect } from 'umi'; ...@@ -6,10 +6,12 @@ import { Link, useIntl, connect } from 'umi';
import SelectOptions from '../../../components/SelectOptions/index'; import SelectOptions from '../../../components/SelectOptions/index';
import TitleBack from '../../../components/TitleBack/TitleBack'; import TitleBack from '../../../components/TitleBack/TitleBack';
import { RA } from '@/utils/method';
const module="User"
const Edit= (props:any) => { const Edit= (props:any) => {
const { dispatch,CurData,SaveChooseData,location,CommunityList} = props; const { dispatch,CurData,SaveChooseData,location,CommunityList,DataServices} = props;
const TosTosServiceProviderSave = (values: any) => { dispatch({ type: 'ServiceProvider/TosTosServiceProviderSave', playload: values }) }; const TosTosServiceProviderSave = (values: any) => { dispatch({ type: 'ServiceProvider/TosTosServiceProviderSave', playload: values }) };
const [CList, setCList] = useState(CommunityList); const [CList, setCList] = useState(CommunityList);
...@@ -20,15 +22,21 @@ const Edit= (props:any) => { ...@@ -20,15 +22,21 @@ const Edit= (props:any) => {
useEffect(() => { useEffect(() => {
console.log(SaveChooseData) console.log(SaveChooseData)
RA(43,{serviceName:""},module,dispatch)
}, []);
useEffect(()=>{
if (DataServices != null) {
var tmp=DataServices.data.serviceScopeList
if (SaveChooseData != null) { if (SaveChooseData != null) {
formRef.current.setFieldsValue(SaveChooseData) formRef.current.setFieldsValue(SaveChooseData)
} }
}, []); }
},[DataServices])
const onFinish = (values: any) => { const onFinish = (values: any) => {
var val = values var val = values
val.serviceCommunityList = CList val.serviceCommunityList = CList
val.serviceScopeList = SList // val.serviceScopeList = SList
val.creator = "admin"; val.creator = "admin";
val.updater = "admin"; val.updater = "admin";
...@@ -56,7 +64,7 @@ const Edit= (props:any) => { ...@@ -56,7 +64,7 @@ const Edit= (props:any) => {
<div className={styles.box2}> <div className={styles.box2}>
<div className={styles.box2item1}>Services Available</div> <div className={styles.box2item1}>Services Available</div>
<div className={styles.box2item2}><Checkbox.Group options={ ["Cleaning", "Security Guard", "Maintenance",]} /></div> <div className={styles.box2item2}><Form.Item name="serviceScopeList"><Checkbox.Group options={ DataServices!=null?DataServices.data.serviceScopeList:null} /></Form.Item></div>
</div> </div>
<div className={styles.box3}> <div className={styles.box3}>
...@@ -82,12 +90,14 @@ const Edit= (props:any) => { ...@@ -82,12 +90,14 @@ const Edit= (props:any) => {
}; };
function mapStateToProps(state:any) { function mapStateToProps(state:any) {
const { CurData,SaveChooseData } = state.ServiceProvider; const { CurData, SaveChooseData } = state.ServiceProvider;
const { DataServices, } = state.User;
const { CommunityList } = state.Init; const { CommunityList } = state.Init;
return { return {
CurData, CurData,
SaveChooseData, SaveChooseData,
CommunityList CommunityList,
DataServices
}; };
} }
......
...@@ -75,6 +75,7 @@ const ServiceProviderManagement = (props: any) => { ...@@ -75,6 +75,7 @@ const ServiceProviderManagement = (props: any) => {
const CallBackTitleSearch = (comment: any)=>{ const CallBackTitleSearch = (comment: any)=>{
console.log(comment) console.log(comment)
RA()
} }
return ( return (
...@@ -106,9 +107,11 @@ const ServiceProviderManagement = (props: any) => { ...@@ -106,9 +107,11 @@ const ServiceProviderManagement = (props: any) => {
function mapStateToProps(state:any) { function mapStateToProps(state:any) {
const { Data } = state.ServiceProvider; const { Data } = state.ServiceProvider;
const { DataProvider } = state.User;
const { CommunityList } = state.Init; const { CommunityList } = state.Init;
return { return {
Data, Data,
DataProvider,
CommunityList CommunityList
}; };
} }
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import styles from './Services.less'; import styles from './Services.less';
import { Input ,Button,Modal,Space,Pagination,Tooltip, Checkbox } from 'antd'; import { Form ,Button,Modal,Space,Pagination,Tooltip, Checkbox } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi'; import { Link, useIntl, connect, Dispatch } from 'umi';
...@@ -11,30 +11,67 @@ import Line from '../../../components/Line/Line'; ...@@ -11,30 +11,67 @@ import Line from '../../../components/Line/Line';
import BackButton from '../../../components/BackButton/BackButton'; import BackButton from '../../../components/BackButton/BackButton';
import TitleGet from '../../../components/TitleGet/TitleGet'; import TitleGet from '../../../components/TitleGet/TitleGet';
import TagSelect from '../../../components/TagSelect/index'; import TagSelect from '../../../components/TagSelect/index';
import { RA } from '@/utils/method';
const Services = () => { import TitleBack from '@/components/TitleBack/TitleBack';
const module="User"
const Services = (props:any) => {
const { dispatch,DataServices} = props
const formRef = useRef(null)
useEffect(()=>{
RA(43,{serviceName:""},module,dispatch)
}, [location])
useEffect(()=>{
if (DataServices != null) {
var tmp=DataServices.data.serviceScopeList
console.log(tmp)
formRef.current.setFieldsValue({services:tmp })
}
}, [DataServices])
const onFinish = (values:any) => {
console.log(values)
RA(44, {
id:"5",
serviceName:"律政"
},module,dispatch)
}
const Add = (values:any) => {
console.log(values)
}
const Remove = (values: any) => {
}
return ( return (
<div className={styles.base}> <div className={styles.base}>
<div className={styles.item0}><TitleGet title={"Services Available Management"}/></div> <TitleBack title={"Services Available Management"}></TitleBack>
<div className={styles.item2}><BackButton/></div>
<div className={styles.clear0}></div>
<div className={styles.item1}>Available Services</div>
<div className={styles.item1_1} ><TagSelect /></div>
<div className={styles.clear1}></div>
<Form ref={formRef} name="basic" onFinish={onFinish}>
{DataServices != null?
<Form.Item label="Available Services" name="services"><TagSelect onAdd={Add} onRemove={Remove}/></Form.Item>
:null
}
<Line /> <Line />
{/* <Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item> */}
</Form>
<Button type="primary" >Submit</Button>
</div> </div>
); );
}; };
function mapStateToProps(state:any) {
const{DataServices} = state.User
return {
DataServices
}
}
export default connect(mapStateToProps)(Services)
export default Services;
......
...@@ -34,7 +34,7 @@ const Guard = (props:any) => { ...@@ -34,7 +34,7 @@ const Guard = (props:any) => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleGet title={"Version 1.2.2"} /> <TitleGet title={"Version 1.2.4"} />
<p> <p>
token:{page.token} token:{page.token}
name:{getCookie("name")} name:{getCookie("name")}
......
...@@ -172,7 +172,7 @@ export const checkData = (rule:any, value:any, callback:any) => { ...@@ -172,7 +172,7 @@ export const checkData = (rule:any, value:any, callback:any) => {
if (/^[a-zA-Z0-9]+$/g.test(value)) { if (/^[a-zA-Z0-9]+$/g.test(value)) {
callback(); callback();
} else { } else {
callback(new Error('Only numbers and letters can be entered!')); callback(new Error('*Numbers and letters'));
} }
} }
callback(); callback();
......
...@@ -99,7 +99,8 @@ export const requestList = [ ...@@ -99,7 +99,8 @@ export const requestList = [
"name": "", "name": "",
"leaderID": "1", "leaderID": "1",
"userPhone": "" "userPhone": ""
}] }],
["/tos/tosServiceProvider/get","46 获取服务商",{}],
] ]
const params = [ const params = [
......
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