Commit 2c745ab4 authored by maple's avatar maple

[last]最新提交v1.2.4

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