Commit 57f2abfe authored by maple's avatar maple

[new]订单详情

parent 97d1d9ff
...@@ -206,14 +206,15 @@ export default defineConfig({ ...@@ -206,14 +206,15 @@ export default defineConfig({
name: 'celllist', name: 'celllist',
routes:[ routes:[
{ path: './', component: './CommunityManagement/CellList/CellList' }, { path: './', component: './CommunityManagement/CellList/CellList' },
{path:'./add',component:'./CommunityManagement/CellList/Add'}, {path:'./Add',component:'./CommunityManagement/CellList/Add'},
] ]
}, },
{ {
path: './CommunityAnnouncement', path: './CommunityAnnouncement',
name: 'communityannouncement', name: 'communityannouncement',
routes: [ routes: [
{path:"./",component:'./CommunityManagement/CommunityAnnouncement/CommunityAnnouncement'} { path: "./", component: './CommunityManagement/CommunityAnnouncement/CommunityAnnouncement' },
{path:"./Add",component:'./CommunityManagement/CommunityAnnouncement/Add'},
] ]
}, },
{ {
......
import React, { useState,useEffect} from 'react';
import SelectOptions from '../SelectOptions';
import { connect } from 'umi'
const index = (props:any) => {
const {dispatch, CommunityList,value,onChange } = props;
const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})};
useEffect(() => {
if (CommunityList == null) {
tosCommunityget(null)
}
}, []);
useEffect(() => {
if (CommunityList != null) {
onChange({ index:1,value: CommunityList})
}
}, [CommunityList]);
const printContent = (values:any) => {
onChange({ index:CommunityList.length==values.length?1:0,value: values})
}
return (
<>
{
CommunityList != null ?
<SelectOptions list={CommunityList.sort()} show={true} onSubmit={printContent} />:
null
}
</>
);
};
function mapStateToProps(state:any) {
const { CommunityList } = state.Init;
return {
CommunityList,
};
}
export default connect(mapStateToProps)(index);
...@@ -216,11 +216,9 @@ class SelectOptions extends React.Component { ...@@ -216,11 +216,9 @@ class SelectOptions extends React.Component {
tempAarry.push(list[i]); tempAarry.push(list[i]);
} }
} }
this.setState({ this.setState({
checkedListOptions:tempAarry, checkedListOptions:tempAarry,
}) })
} }
render() { render() {
......
...@@ -34,13 +34,14 @@ const TableShow = (props:any) => { ...@@ -34,13 +34,14 @@ const TableShow = (props:any) => {
// ower_email: "535740436@qq.com" // ower_email: "535740436@qq.com"
// ower_name: "测试" // ower_name: "测试"
// ower_phone: "微微" // ower_phone: "微微"
const user_status=[[ 1,"家属" ],[2,"租户"]]
const key = [ const key = objectColumns([
["User Name", "ower_name"], ["User Name", "ower_name"],
["Contact Details", "ower_phone"], ["Contact Details", "ower_phone"],
["Email", "ower_email"], ["Email", "ower_email"],
["RelationShip", null, (text: any, record: any) => (<Space size="middle">{record.owner_relationship!=null?user_status[(record.owner_relationship)-1][1]:null}</Space>)],
["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 (
...@@ -60,7 +61,7 @@ const TableShow = (props:any) => { ...@@ -60,7 +61,7 @@ const TableShow = (props:any) => {
<Table title={() => { <Table title={() => {
return (<Row gutter={32}><Col>Unit No:</Col><Col>{unit.living}</Col><Col> 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>) {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> }} footer={() => ''} rowKey={"ower_name"} dataSource={unit.member} columns={key} pagination={false}></Table>
</Col> </Col>
<Col> <Col>
<Row> <Row>
......
import React, { useEffect, useState } from 'react';
import { DatePicker } from 'antd';
import { MomentToTime, TimeToMoment2 } from '@/utils/time';
import moment from 'moment';
const TimeComfirm = (props:any) => {
const { value, onChange } = props
const [val, setVal] = useState(null);
useEffect(() => {
if (value != null) {
setVal(TimeToMoment2(value))
}
},[value])
const onsubmit = (values: any) => {
onChange(MomentToTime(values))
}
return (
<>
{
val != null ?
<><DatePicker showTime defaultValue={val} onOk={onsubmit} /></> :
<DatePicker showTime onOk={onsubmit} />
}
</>
);
};
export default TimeComfirm;
// 线栏
.font{
border-left: 5px solid rgba(24,144,255,1);
font-family:'Source Han Sans CN';
font-size: 18px;
font-weight: 600;
color: #000000;
}
.item{
.font();
text-indent: 15px;
}
\ No newline at end of file
import React from 'react'; import React from 'react';
import styles from './index.less'; const index = (props:any) => {
const TitleGet = (props:any) => {
return ( return (
<> <>
...@@ -10,4 +8,4 @@ const TitleGet = (props:any) => { ...@@ -10,4 +8,4 @@ const TitleGet = (props:any) => {
); );
}; };
export default TitleGet; export default index;
...@@ -5,6 +5,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi'; ...@@ -5,6 +5,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router' import { routerRedux } from 'dva/router'
import { printf } from '@/utils/log'; import { printf } from '@/utils/log';
import { getObjectInfo } from '@/utils/method';
export default { export default {
namespace: 'CellList', namespace: 'CellList',
...@@ -35,25 +36,26 @@ export default { ...@@ -35,25 +36,26 @@ export default {
//标准请求 //标准请求
*RA({ playload }, { call, put }) { *RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload); const resp = yield call(service.RA, playload);
console.log(resp) console.log(resp)
if (resp.code == 500||resp.error_code!="0000") { // if (resp.code == 500||resp.error_code!="0000") {
} // }
if (resp.error_code != "0000") { if (resp.error_code != "0000") {
printf(playload, resp) getObjectInfo(playload.body)
} printf(playload, resp)
else { }
switch (playload.index) { switch (playload.index) {
case 24: { case 24: {
let Data = resp.data;
let Data = resp.data; yield put({ type: 'returnPage', Data });
yield put({ type: 'returnPage', Data }); } break;
case 29: {
} break; let Result = resp;
yield put({ type: 'returnResult', Result });
} } break;
} }
}, },
*ResultClear({ }, { put }) { *ResultClear({ }, { put }) {
......
...@@ -37,22 +37,25 @@ export default { ...@@ -37,22 +37,25 @@ export default {
const resp = yield call(service.RA, playload); const resp = yield call(service.RA, playload);
console.log(resp) console.log(resp)
if (resp.code == 500||resp.error_code!="0000") {
}
if (resp.error_code != "0000") { if (resp.error_code != "0000") {
printf(playload, resp) printf(playload, resp)
} }
else {
switch (playload.index) { switch (playload.index) {
case 25: { case 25: {
let Data = resp.data;
yield put({ type: 'returnPage', Data });
} break;
case 28: {
let Data = resp.data; let Result = resp;
yield put({ type: 'returnPage', Data }); yield put({ type: 'returnResult', Result });
} break; } break;
} }
}
}, },
*ResultClear({ }, { put }) { *ResultClear({ }, { put }) {
......
import * as service from '../../services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
import { printf } from '@/utils/log';
export default {
namespace: 'OrderManagement',
state: {
Data: null,
Result: null,
DataSave: null,
DataSaveDetail:null,
},
reducers: {
returnPage(state, { Data}) {
return { ...state, Data };
},
returnResult(state, { Result}) {
return { ...state, Result};
},
returnDataSave(state, { DataSave }) {
return {...state,DataSave}
},
returnDataSaveDetail(state, { DataSaveDetail }) {
return {...state,DataSaveDetail}
},
},
effects: {
//标准请求
*RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload);
console.log(resp)
if (resp.code == 500||resp.error_code!="0000") {
}
if (resp.error_code != "0000") {
printf(playload, resp)
}
else {
switch (playload.index) {
case 30: {
let Data = resp;
yield put({ type: 'returnPage', Data });
} break;
}
}
},
*ResultClear({ }, { put }) {
var tmp=null
yield put({type: 'returnResult', tmp} )
},
*SA({ playload }, { call, put }) {
var DataSave = playload
yield put({type: 'returnDataSave', DataSave} )
},
},
};
import React, { useState, useEffect,useRef} from 'react';
import { Input ,Tabs,Table,Space, Button} from 'antd';
const { TabPane } = Tabs;
import {connect,history} from 'umi';
import { RA } from '@/utils/method';
const module="XXX"
const XXX = (props:any) => {
const { dispatch, Data } = props;
const formRef = useRef(null)
return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
</div>
);
};
function map(state:any) {
const { Data} = state[module]
return { Data}
}
export default connect(map)(XXX);
\ No newline at end of file
...@@ -101,7 +101,7 @@ const Detail = (props:any) => { ...@@ -101,7 +101,7 @@ const Detail = (props:any) => {
data={{ data={{
userToken: "token", userToken: "token",
imageType: 'tosCommunityImageReply', imageType: 'tosCommunityImageReply',
extend: "", extends: "",
}} }}
defultValue={CurDataDetail.pictrues} defultValue={CurDataDetail.pictrues}
/>:null />:null
...@@ -130,7 +130,7 @@ const Detail = (props:any) => { ...@@ -130,7 +130,7 @@ const Detail = (props:any) => {
putSubmit={PictureOptionsRowRef} data={{ putSubmit={PictureOptionsRowRef} data={{
userToken: "token", userToken: "token",
imageType: 'tosCommunityImageReply', imageType: 'tosCommunityImageReply',
extend: "", extends: "",
}} }}
defultValue={[]} defultValue={[]}
/> />
......
import React, { useState, useEffect,useRef } from 'react'; import React, { useState, useEffect,useRef } from 'react';
import { Input ,Tabs,Form,InputNumber,Col,Button, Row} from 'antd'; import { Input ,Tabs,Form,InputNumber,Col,Button, Row, message} from 'antd';
const { TabPane } = Tabs; const { TabPane } = Tabs;
import {connect} from 'umi'; import {connect} from 'umi';
...@@ -14,57 +14,55 @@ import { RA } from '@/utils/method'; ...@@ -14,57 +14,55 @@ import { RA } from '@/utils/method';
const module = "CellList" const module = "CellList"
// const params=[
// ["residentialName":"A8",]
// ["residentialAddress":"TianHe Road No.28"]
// ["residentialHotline":"hotline"]
// ["residentialPhone":"200-8888888"]
// ["residentialEmail":"sales@huahuico.com"]
// ["residentialManagerUserName":"Mr Chen"]
// ["residentialHotlineName":"200-22122221"]
// [ "balouscheduleFile":["A.pdf"],]
// [ "serviceGuideFile":["B.pdf"],]
// ["lifeServiceFile": ["C.pdf"]]
// ]
// 小区名
// #工作时间
// 小区联系方式
// 小区管理员
// 楼巴时刻表
// 物业办事指南
// 保质期服务
// 帮助中心
import FileUpload from '@/components/FileUpload/FileUpload' import FileUpload from '@/components/FileUpload/FileUpload'
import TitleBack from '@/components/TitleBack/TitleBack' import TitleBack from '@/components/TitleBack/TitleBack'
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity'
import Line from '@/components/Line/Line'; import Line from '@/components/Line/Line';
import { validateMessages } from '@/utils/params';
const Add = (props:any) => { const Add = (props:any) => {
const { dispatch, Data } = props; const { dispatch, Result } = props;
const formRef =useRef(null) const formRef =useRef(null)
const onFinish = (values:any) => { const onFinish = (values:any) => {
console.log(values); console.log(values);
RA(29,values, module, dispatch); RA(29,values, module, dispatch);
} }
const [extend,setExtend]=useState("")
useEffect(() => { useEffect(() => {
var obj = {
"zipcode":"510000",
"residentialName":"T1",
"residentialAddress":"广州市黄埔区开创大道",
"residentialPhone":"020-83645790",
"residentialEmail":"T1community@163.com",
"residentialManagerUserName":"刘庆华",
"residentialHotlineName": "T1服务",
"residentialHotline":"020-83645790",
"balouscheduleFile":["导图1.pdf"],
"serviceGuideFile":["导图1.pdf"],
"lifeServiceFile":["导图1.pdf"]
}
// formRef.current.setFieldsValue(obj)
}, [])
},[]) useEffect(() => {
const validateMessages ={ if (Result != null) {
required: '${label} is required!', console.log("页面结果")
types: { console.log(Result)
email: '${label} is not validate email!', if (Result.error_code == undefined) {
number: '${label} is not a validate number!', console.log("服务器有问题")
string:'${label} is not a validate number!' message.error("服务器有问题,请求失败",5)
}, }
string: { }
range: '${label} must be between ${min} and ${max}', }, [Result])
},
number: { const onBillChange = (values: any, allValues: any) => {
range: '${label} must be between ${min} and ${max}', if (values["residentialName"] != null) {
}, var tmp= values["residentialName"]
console.log(tmp.length)
setExtend(tmp)
}
} }
return ( return (
...@@ -72,16 +70,16 @@ const Add = (props:any) => { ...@@ -72,16 +70,16 @@ const Add = (props:any) => {
<TitleBack title="Add Commnunity Infomation" ></TitleBack> <TitleBack title="Add Commnunity Infomation" ></TitleBack>
<Form ref={formRef} {...layout} name="nest-messages" onFinish={onFinish} validateMessages={validateMessages}> <Form ref={formRef} {...layout} name="nest-messages" onFinish={onFinish} validateMessages={validateMessages} onValuesChange={onBillChange}>
<Form.Item name={"name"} label="小区名" rules={[{required:true}]}><SearchOptionsCommnity /></Form.Item> <Form.Item name={"residentialName"} label="小区名" rules={[{required:true}]}><Input style={{width:200}} /></Form.Item>
<Form.Item name={"zipcode"} label="邮编" rules={[]}><Input style={{width: 200 }} /></Form.Item> <Form.Item name={"zipcode"} label="邮编" rules={[]}><Input style={{width: 200 }} /></Form.Item>
<Form.Item name={"residentialAddress"} label="地址" rules={[]}><Input style={{width: 300}} /></Form.Item> <Form.Item name={"residentialAddress"} label="地址" rules={[]}><Input style={{width: 300}} /></Form.Item>
<Form.Item label="小区联系方式" style={{marginBottom:0}}> <Form.Item label="小区联系方式" style={{marginBottom:0}}>
<Form.Item style={{ display: 'inline-block', width: '200' }} name={"residentialPhone"} rules={[]}><Input placeholder="小区联系电话" /></Form.Item> <Form.Item style={{ display: 'inline-block', width: '200' }} name={"residentialPhone"} rules={[]}><Input placeholder="小区联系电话" /></Form.Item>
<Form.Item style={{ display: 'inline-block', width: '200', marginLeft:20 }} name={"residentialEmail"} rules={[]}><Input placeholder="小区联系邮箱"/></Form.Item> <Form.Item style={{ display: 'inline-block', width: '200', marginLeft:20 }} name={"residentialEmail"} rules={[]}><Input placeholder="小区联系邮箱"/></Form.Item>
</Form.Item> </Form.Item>
<Form.Item name={"residentialManagerUserName"} label="小区管理人员" rules={[]}><Input style={{width:200}} /></Form.Item> <Form.Item name={"residentialManagerUserName"} label="小区管理人员" rules={[]}><Input style={{width:200}} /></Form.Item>
...@@ -91,12 +89,16 @@ const Add = (props:any) => { ...@@ -91,12 +89,16 @@ const Add = (props:any) => {
<Form.Item style={{ display: 'inline-block', width: '200', marginLeft:20 }} name={"residentialHotline"} rules={[]}><Input placeholder="热线电话"/></Form.Item> <Form.Item style={{ display: 'inline-block', width: '200', marginLeft:20 }} name={"residentialHotline"} rules={[]}><Input placeholder="热线电话"/></Form.Item>
</Form.Item> </Form.Item>
<Line /> <Line />
{
<Form.Item wrapperCol={{ ...layout.wrapperCol, offset: 2 }} style={{marginBottom:0}}> extend.length>0 ?
<Form.Item style={{ display: 'inline-block', width: '200' }} name={"balouscheduleFile"} ><FileUpload title="choose" url={"/tos/image/upload"} data={{ imageType: "tosCreateCommunity", extends: "A9" }} reg="name" /></Form.Item> <>
<Form.Item style={{ display: 'inline-block', width: '200', marginLeft:100 }} name={"serviceGuideFile"}><FileUpload title="choose" url={"/tos/image/upload"} data={{ imageType: "tosCreateCommunity", extends: "A9" }} reg="name" /></Form.Item> <Form.Item wrapperCol={{ ...layout.wrapperCol, offset: 2 }} style={{marginBottom:0}}>
<Form.Item style={{ display: 'inline-block', width: '200', marginLeft:100 }} name={"lifeServiceFile"}><FileUpload title="choose" url={"/tos/image/upload"} data={{ imageType: "tosCreateCommunity", extends: "A9" }} reg="name" /></Form.Item> <Form.Item style={{ display: 'inline-block', width: '200' }} name={"balouscheduleFile"} ><FileUpload title="楼巴时刻表" url={"/tos/image/upload"} data={{ imageType: "tosCreateCommunity", extends: extend }} reg="name" /></Form.Item>
</Form.Item> <Form.Item style={{ display: 'inline-block', width: '200', marginLeft:100 }} name={"serviceGuideFile"}><FileUpload title="物业办事指南" url={"/tos/image/upload"} data={{ imageType: "tosCreateCommunity", extends: extend }} reg="name" /></Form.Item>
<Form.Item style={{ display: 'inline-block', width: '200', marginLeft:100 }} name={"lifeServiceFile"}><FileUpload title="保质期服务" url={"/tos/image/upload"} data={{ imageType: "tosCreateCommunity", extends:extend }} reg="name" /></Form.Item>
</Form.Item>
</> : null
}
<Form.Item wrapperCol={{ ...layout.wrapperCol, offset: 2 }}><Button type="primary" htmlType="submit">Submit</Button></Form.Item> <Form.Item wrapperCol={{ ...layout.wrapperCol, offset: 2 }}><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
...@@ -108,19 +110,7 @@ const Add = (props:any) => { ...@@ -108,19 +110,7 @@ const Add = (props:any) => {
}; };
function map(state:any) { function map(state:any) {
const { Data} = state[module] const { Result} = state[module]
return { Data} return { Result}
} }
export default connect(map)(Add); export default connect(map)(Add);
\ No newline at end of file
{/* "zipcode":"510000"
"residentialName":"A8",
"residentialAddress":"TianHe Road No.28",
"residentialHotline":"hotline",
"residentialPhone":"200-8888888",
"residentialEmail":"sales@huahuico.com",
"residentialManagerUserName":"Mr Chen",
"residentialHotlineName":"200-22122221",
"balouscheduleFile":["A.pdf"],
"serviceGuideFile":["B.pdf"],
"lifeServiceFile":["C.pdf"] */}
\ No newline at end of file
...@@ -5,14 +5,14 @@ const { TabPane } = Tabs; ...@@ -5,14 +5,14 @@ const { TabPane } = Tabs;
import {connect,history} from 'umi'; import {connect,history} from 'umi';
const columns = [ const columns = objectColumns([
["Community", "residentialName"], ["Community", "residentialName"],
["Administrator", "residentialManagerUserName"], ["Administrator", "residentialManagerUserName"],
["Operation Hours", null, (text: any, record: any) => (<div></div>)], ["Operation Hours", null, (text: any, record: any) => (<div></div>)],
["Office Tel", "residentialPhone"], ["Office Tel", "residentialPhone"],
["Address", "residentialAddress"], ["Address", "residentialAddress"],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)], ["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)],
] ])
import TitleSearch from '@/components/TitleSearch/TitleSearch' import TitleSearch from '@/components/TitleSearch/TitleSearch'
...@@ -24,17 +24,12 @@ const module="CellList" ...@@ -24,17 +24,12 @@ const module="CellList"
const CellList = (props:any) => { const CellList = (props:any) => {
const { dispatch, Data } = props; const { dispatch, Data } = props;
const Pagechange = () => { const Pagechange = () => {
} }
const [columnsVal,setColumnsVal]=useState([])
useEffect(() => { useEffect(() => {
var tmp = objectColumns(columns)
console.log(tmp)
setColumnsVal(tmp)
RA(24, {communityName: "" }, module, dispatch); RA(24, {communityName: "" }, module, dispatch);
}, []) }, [])
useEffect(() => { useEffect(() => {
...@@ -46,7 +41,7 @@ const CellList = (props:any) => { ...@@ -46,7 +41,7 @@ const CellList = (props:any) => {
RA(24, {communityName: values }, module, dispatch); RA(24, {communityName: values }, module, dispatch);
} }
const goToAdd = () => { const goToAdd = () => {
history.push("./CellList/add"); history.push("./CellList/Add");
} }
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
...@@ -61,7 +56,7 @@ const CellList = (props:any) => { ...@@ -61,7 +56,7 @@ const CellList = (props:any) => {
</div> </div>
<Table loading={false} rowKey="id" style={{ marginTop: 16 }} <Table loading={false} rowKey="id" style={{ marginTop: 16 }}
dataSource={Data.rows} dataSource={Data.rows}
columns={columnsVal} columns={columns}
pagination={{ current: 1, total: Data.total}} /> pagination={{ current: 1, total: Data.total}} />
</> : null </> : null
......
import React, { useState, useEffect,useRef } from 'react';
import { Input ,Tabs,message,Form, Button} from 'antd';
const { TabPane } = Tabs;
import {connect} from 'umi';
const layout = {
labelCol: { span: 2},
// wrapperCol: { span: 8 },
};
import { RA } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
import FileUpload from '@/components/FileUpload/FileUpload';
import { validateMessages } from '@/utils/params';
import PictureOptionsRow from '@/components/PictureOptions/PictureOptionsRow';
import TextArea from 'antd/lib/input/TextArea';
import SelectOptions from '@/components/SelectOptions';
import TitleSearch from '@/components/TitleSearch/TitleSearch';
import SelectCommunity from '@/components/SelectCommunity';
import Line from '@/components/Line/Line';
import TimeComfirm from '@/components/TimeComfirm/TimeComfirm';
const module="CommunityAnnouncement"
const Add = (props:any) => {
const { dispatch, Result } = props;
const formRef = useRef(null)
useEffect(() => {
var obj = {
"noticTitle":"Garden公告",
// "communityNum":"珠江丽景小区",
"noticText":"今晚晚上停水4小时",
"noticScope":"1",
"noticStartTime":"2020-07-01 12:30:00",
"noticEndTime":"2020-08-01 9:30:00",
"file":["A.jpg"]
}
formRef.current.setFieldsValue(obj)
}, [])
useEffect(() => {
if (Result != null) {
console.log("页面结果")
console.log(Result)
if (Result.error_code == undefined) {
console.log("服务器有问题")
message.error("服务器有问题,请求失败",5)
}
}
}, [Result])
const onFinish = ((values: any) => {
console.log(values)
RA(28,values, module, dispatch);
})
return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
<TitleBack title="Add Announcement" ></TitleBack>
<Form ref={formRef} {...layout} name="nest-messages" onFinish={onFinish} validateMessages={validateMessages}>
<Form.Item name={"community"} label="服务小区" rules={[]}><SelectCommunity /></Form.Item>
<Form.Item name={"noticTitle"} label="公告标题" rules={[]}><Input style={{width: 200}} /></Form.Item>
<Form.Item name={"noticText"} label="公告内容" rules={[]}><TextArea style={{width: 400,height:100}} /></Form.Item>
<Form.Item style={{ display: 'inline-block', width: '200', marginLeft: 100 }} name={"file"}>
<PictureOptionsRow
action="/tos/image/upload"
data={{
imageType: 'tosNotice',
}}
/>
</Form.Item>
<Form.Item name={"noticStartTime"} label="生效日期" rules={[]}><TimeComfirm /></Form.Item>
<Form.Item name={"noticEndTime"} label="结束日期" rules={[]}><TimeComfirm /></Form.Item>
<Line></Line>
<Form.Item wrapperCol={{ ...layout.wrapperCol, offset: 2 }}><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</Form>
</div>
);
};
function map(state:any) {
const { Result} = state[module]
return { Result}
}
export default connect(map)(Add);
\ No newline at end of file
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import {connect,history} from 'umi';
import { Input ,Tabs,Table,Space, Button} from 'antd'; import { Input ,Tabs,Table,Space, Button} from 'antd';
const { TabPane } = Tabs; const { TabPane } = Tabs;
import {connect} from 'umi';
import { objectColumns } from '@/utils/string'; import { objectColumns } from '@/utils/string';
import {timestampToTime3} from '@/utils/time' import {timestampToTime3} from '@/utils/time'
// communityNum: "A7" // communityNum: "A7"
...@@ -27,6 +27,10 @@ const columns = objectColumns( [ ...@@ -27,6 +27,10 @@ const columns = objectColumns( [
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)], ["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)],
]) ])
import { RA } from '@/utils/method'; import { RA } from '@/utils/method';
const goToAdd = () => {
history.push("./CommunityAnnouncement/Add");
}
const module="CommunityAnnouncement" const module="CommunityAnnouncement"
const CommunityAnnouncement = (props:any) => { const CommunityAnnouncement = (props:any) => {
...@@ -36,6 +40,11 @@ const CommunityAnnouncement = (props:any) => { ...@@ -36,6 +40,11 @@ const CommunityAnnouncement = (props:any) => {
},[]) },[])
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
<div style={{height:80,position:"relative"}}>
<div style={{ position: "absolute", right: 0 }}><Button type="primary" onClick={goToAdd}>Create new Announcement</Button></div>
</div>
{Data!=null? {Data!=null?
<Table <Table
loading={false} loading={false}
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect,useRef} from 'react';
import { Input ,Tabs,Table,Space, Button} from 'antd';
const { TabPane } = Tabs;
import styles from './index.less'; import { connect, history } from 'umi';
import { Input ,Menu,Table,Space} from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi'; const orderStatus=[[0,"已发单"],[1,"待上门"],[2,"进行中"],[3,"已完成"],[4,"已取消"]]
const columns = objectColumns([
["OrderNumber", "orderNumber"],
["Community", "communityName"],
["Owner Name", "ownerName"],
["type", null, (text: any, record: any) => (<div>{orderStatus[record.orderStatus][1]}</div>)],
["Content", "serviceContent"],
["Order Time", null, (text: any, record: any) => (<div>{(record.order_send_time)}</div>)],
["Booking Time", null, (text: any, record: any) => (<div>{(record.order_reserve_time)}</div>)],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)],
])
const dataSource = [ import { RA } from '@/utils/method';
{ import { objectColumns } from '@/utils/string';
key: '1', import TitleSearch from '@/components/TitleSearch/TitleSearch';
name: '胡彦斌', import { timestampToTime } from '@/utils/time';
age: 32,
address: '西湖区湖底公园1号',
},
];
const Order = (props: { location: any; }) => {
const { formatMessage } = useIntl();
const { location } = props; const module="OrderManagement"
const Order = (props:any) => {
const nameofowner = formatMessage({ id: 'R.charge.input.nameofowner' })
const inputProject = formatMessage({ id: 'R.charge.input.project' })
const username = formatMessage({ id: 'R.charge.username' })
const project = formatMessage({ id: 'R.charge.project' })
const unit = formatMessage({ id: 'R.charge.unit' })
const status = formatMessage({ id: 'R.charge.status' })
const submissionTime = formatMessage({ id: 'R.charge.submissionTime' })
const actions = formatMessage({ id: 'R.charge.actions' })
const search = formatMessage({ id: 'R.charge.search' })
const addaccount = formatMessage({ id: 'R.charge.addaccount' })
const paymentsetting = formatMessage({ id: 'R.charge.paymentsetting' })
const menuListNormal = ["A",'Accounting company']
const [display, setDisplay] = useState("A");//小组件:线框
const pagination={defaultCurrent:1,total: 16}
const goToDetail = () => {
history.push(location.pathname+'/Detail?id=123')
}
const goToEdit = () => {
history.push(location.pathname+'/Edit')
}
const columns = [
{
title: username,
dataIndex: 'name',
key: 'name',
},
{
title: project,
dataIndex: 'age',
key: 'age',
},
{
title: unit,
dataIndex: 'address',
key: 'address',
},
{
title: status,
dataIndex: 'address',
key: 'address',
},
{
title: submissionTime,
dataIndex: 'address',
key: 'address',
},
{
title: actions,
key: 'action',
render: (text: any, record: any) => (
<Space size="middle">
<a onClick={goToDetail}>Detail</a>
</Space>
),
},
];
const { dispatch, Data } = props;
const formRef = useRef(null)
useEffect(() => {
RA(30, {orderNumber:"",serviceType:"0"}, module, dispatch)
},[])
return ( return (
<div className={styles.base}> <div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
{/* 头部组件 */}
<div className={styles.box}> {
<input className={styles.item1} placeholder={nameofowner} /> Data != null ? <>
<input className={styles.item2} placeholder={inputProject} /> <TitleSearch
<input className={styles.item4} placeholder={inputProject} /> status={[{
<button className={styles.item3}>{search}</button> name: ["status", "订单状态"],
</div> data: orderStatus
}]}
listkey={['A', 'C']}
list={['Hello', 'world']}
></TitleSearch>
{/* 内容组件 */} <Table loading={false} rowKey="id" style={{ marginTop: 16 }}
<div className={styles.box2}> dataSource={Data.data.rows}
</div> columns={columns}
pagination={{ current: 1, total: Data.total }} />
{/* 列表组件 */}
<Table style={{ marginTop: 16 }} dataSource={dataSource} columns={columns} pagination={pagination} /> </>:null
}
</div> </div>
); );
}; };
function map(state:any) {
const { Data} = state[module]
return { Data}
}
export default connect(map)(Order);
// 订单管理模块的order_status int(11) NULL
// /tos/tosOrder/get
// {
// "orderNumber":"123",
// "serviceType":"0"
// }
// 返回的数据
// communityAddress: "TianHeStreet"
// communityId: "0166bd9a1e6f4efca1b867699a649e1d"
// communityName: "A Garden"
// count: 0
// deleted: 0
// extend: ""
// id: "0166bd9a1e6f4efca1b867699a649e1d"
// orderAcceptTime: "Jul 2, 2020 12:00:00 AM"
// orderFinishTime: "Jul 3, 2020 12:00:00 AM"
// orderNumber: "123"
// orderReserveTime: "Jul 3, 2020 12:00:00 AM"
// orderSendTime: "Jul 1, 2020 12:00:00 AM"
// orderStatus: "0"
// ownerId: "0166bd9a1e6f4efca1b867699a649e1d"
// ownerName: "张三"
// ownerPhone: "18817676732"
// serviceContent: "家具维修"
// serviceType: "0"
export default Order; // order_send_time 发单时间
// order_accept_time 接单时间
// order_reserve_time 预约时间
\ No newline at end of file
@import '~antd/lib/style/themes/default.less';
//基石
.base {
width: 100%;
background-color: #ffffff;
padding: 34px;
}
//边栏1
//头部组件
.box{
width: 100%;
height: 34px;
position: relative;
margin-bottom: 56px;
}
.input{
width:200px;
height:32px;
background:none;
outline: none;
border:1px solid rgba(217,217,217,1);
border-radius:2px;
font-size:14px;
font-weight:400;
line-height:30px;
text-indent: 19px;
}
.item1{
.input();
}
.item2{
.input();
margin-left: 20px;
}
.item4{
.input();
margin-left: 20px;
}
.item3{
width:80px;
height:32px;
border:1px solid rgba(24,144,255,1);
border-radius:2px;
background-color:#e7f4ff;
outline: none;
font-size:14px;
font-weight:400;
color:rgba(24,144,255,1);
line-height:30px;
cursor: pointer;
margin-left: 20px;
}
.item3:active{
background-color:#ffffff;
}
//边栏2
.box2{
width: 100%;
height: 40px;
margin-top: 0px;
position: relative;
}
//小组件1
.buttonLine{
width:240px;
height:32px;
border:none;
background:none;
outline: none;
font-size:14px;
font-weight:400;
line-height:30px;
cursor: pointer;
}
.fontgz(){
font-size:16px;
font-family:'Source Han Sans CN;';
font-weight:800;
}
.buttonWait{
.buttonLine();
border-bottom:2px solid#dedede;
color:#454545;
.fontgz();
}
.buttonWait:hover{
border-bottom:3px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
.fontgz();
}
.buttonChoose{
.buttonLine();
border-bottom:3px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
.fontgz();
}
.buttonAdd{
background:none;
outline: none;
cursor: pointer;
width:148px;
height:32px;
border:1px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
border-radius:2px;
position: absolute;
right: 0;
}
.buttonAdd2{
.buttonAdd();
right: 168px;
}
...@@ -20,7 +20,10 @@ const UsersDetail = (props:any) => { ...@@ -20,7 +20,10 @@ const UsersDetail = (props:any) => {
const [postman, setPostman] = useState({ extend: null, tab: 1 }) const [postman, setPostman] = useState({ extend: null, tab: 1 })
const [memberDetail, setMemberDetail] = useState(false); const [memberDetail, setMemberDetail] = useState(false);
const [memberData, setMemberData] = useState(null); const [memberData, setMemberData] = useState(null);
const [editFlag,setEditFlag]=useState(false) const [editFlag, setEditFlag] = useState(false)
const user_status = [[1, "家属"], [2, "租户"]]
const formRef = useRef(null); const formRef = useRef(null);
const onFinish=(values:any) => { const onFinish=(values:any) => {
if (DataSave != null) { if (DataSave != null) {
...@@ -78,7 +81,6 @@ const UsersDetail = (props:any) => { ...@@ -78,7 +81,6 @@ const UsersDetail = (props:any) => {
} }
}, []) }, [])
setEditFlag
const extendName = (values: any) => { const extendName = (values: any) => {
var tmp = postman var tmp = postman
tmp.extend=values tmp.extend=values
...@@ -91,7 +93,9 @@ const UsersDetail = (props:any) => { ...@@ -91,7 +93,9 @@ const UsersDetail = (props:any) => {
} }
} }
const tableShowCallback = (values:any) => { const tableShowCallback = (values: any) => {
console.log("成员信息")
console.log(values)
setMemberData(values) setMemberData(values)
setMemberDetail(true) setMemberDetail(true)
} }
...@@ -109,6 +113,9 @@ const UsersDetail = (props:any) => { ...@@ -109,6 +113,9 @@ const UsersDetail = (props:any) => {
} }
RA(16, tmp); RA(16, tmp);
} }
}
const DeleteMember = () => {
} }
return ( return (
<div className={styles.base}> <div className={styles.base}>
...@@ -144,8 +151,8 @@ const UsersDetail = (props:any) => { ...@@ -144,8 +151,8 @@ const UsersDetail = (props:any) => {
<div> <div>
<TitleBack title={"Member Detail"} url="none" titleBack={titleBackCallBack}></TitleBack> <TitleBack title={"Member Detail"} url="none" titleBack={titleBackCallBack}></TitleBack>
<Row> <Row>
<Col>Customer Type</Col> <Col span={4}>Customer Type</Col>
<Col></Col> <Col span={4}>{memberData.owner_relationship!=null?user_status[(memberData.owner_relationship)-1][1]:null}</Col>
</Row> </Row>
<Row gutter={16}> <Row gutter={16}>
<Col span={4}>User Name</Col> <Col span={4}>User Name</Col>
...@@ -155,7 +162,9 @@ const UsersDetail = (props:any) => { ...@@ -155,7 +162,9 @@ const UsersDetail = (props:any) => {
<Col span={4}>Contact Detail</Col> <Col span={4}>Contact Detail</Col>
<Col span={4}>{memberData.ower_phone}</Col> <Col span={4}>{memberData.ower_phone}</Col>
<Col span={4}>{memberData.ower_email}</Col> <Col span={4}>{memberData.ower_email}</Col>
</Row> </Row>
<Line></Line>
<Button type="danger" onClick={DeleteMember}>Delete</Button>
</div> </div>
</> </>
} }
...@@ -195,4 +204,10 @@ export default connect(mapStateToProps)(UsersDetail); ...@@ -195,4 +204,10 @@ export default connect(mapStateToProps)(UsersDetail);
// "ownerId":"770da9de6b6c43f6b61bc3d671fa2e89", // "ownerId":"770da9de6b6c43f6b61bc3d671fa2e89",
// "owerName":"jack-小雄", // "owerName":"jack-小雄",
// "communityName":"A7" // "communityName":"A7"
\ No newline at end of file
// http://47.74.233.180:8651/tos/life/community/account/member/del
// {
// "id":"c06286cfe7b843cb96fdfcb987231123",
// "ownerId":"6b359755a36b49c28241a4620fa6539b"
// }
\ No newline at end of file
...@@ -92,7 +92,8 @@ const requestList = [ ...@@ -92,7 +92,8 @@ const requestList = [
["/tos/tosVisitorRecord/get", "26 获取访客记录列表"], ["/tos/tosVisitorRecord/get", "26 获取访客记录列表"],
["/tos/contract/add", "27 合同新增和编辑"], ["/tos/contract/add", "27 合同新增和编辑"],
["/tos/tosCommunityNotic/add", "28 新增小区公告接口"], ["/tos/tosCommunityNotic/add", "28 新增小区公告接口"],
["/tos/tosManageCommunity/save","29 新建一个小区"] ["/tos/tosManageCommunity/save", "29 新建一个小区"],
["/tos/tosOrder/get","30 获取订单详情"],
] ]
const params = [ const params = [
...@@ -112,6 +113,8 @@ export function RA(playload: any) { ...@@ -112,6 +113,8 @@ export function RA(playload: any) {
console.log(playload.body) console.log(playload.body)
return requestAuto(url,playload.body) return requestAuto(url,playload.body)
} }
// console.log(playload) // console.log(playload)
// console.log(playload.index) // console.log(playload.index)
// console.log(requestList[playload.index]) // console.log(requestList[playload.index])
...@@ -131,24 +134,3 @@ export function RA(playload: any) { ...@@ -131,24 +134,3 @@ export function RA(playload: any) {
//新增小区公告接口文件上传 http://47.74.233.180:8651/tos/image/upload imageType 参数值为 tosNotice //新增小区公告接口文件上传 http://47.74.233.180:8651/tos/image/upload imageType 参数值为 tosNotice
// 48、新建一个小区
// http://47.74.233.180:8651/tos/tosManageCommunity/save
// {
// "residentialName":"A8",
// "residentialAddress":"TianHe Road No.28",
// "residentialHotline":"hotline",
// "residentialPhone":"200-8888888",
// "residentialEmail":"sales@huahuico.com",
// "residentialManagerUserName":"Mr Chen",
// "residentialHotlineName":"200-22122221",
// "balouscheduleFile":["A.pdf"],
// "serviceGuideFile":["B.pdf"],
// "lifeServiceFile":["C.pdf"]
// }
// 49、新建一个小区-上传楼巴办事指南
// http://localhost:8651/tos/image/upload
// imageType 值为 tosCreateCommunity
// extends 值为 对应小区名 如 A9
...@@ -84,4 +84,18 @@ export const Fromate2 = (values:any, reg:string) => { ...@@ -84,4 +84,18 @@ export const Fromate2 = (values:any, reg:string) => {
result.push(item[reg]); result.push(item[reg]);
}) })
return result return result
}
// 获取对象信息
export const getObjectInfo = (test: any) => {
console.log(JSON.stringify(test,null, '\t'))
var array = new Array()
for (let item in test) {
array.push([item, typeof test[item]])
}
console.log(array)
console.log(array.length)
return array
} }
\ No newline at end of file
export const validateMessages ={
required: '${label} is required!',
types: {
email: '${label} is not validate email!',
number: '${label} is not a validate number!',
string:'${label} is not a validate number!'
},
string: {
range: '${label} must be between ${min} and ${max}',
},
number: {
range: '${label} must be between ${min} and ${max}',
},
}
\ No newline at end of file
...@@ -43,4 +43,15 @@ export const timeToMoment = (tmp: any) => { ...@@ -43,4 +43,15 @@ export const timeToMoment = (tmp: any) => {
// return result; // return result;
var piece = tmp.split('-') var piece = tmp.split('-')
return [moment(piece[0], format), moment(piece[1], format)] return [moment(piece[0], format), moment(piece[1], format)]
} }
\ No newline at end of file
export const MomentToTime= (tmp: any) => {
if (tmp == null) return null
return (tmp.format("YYYY-MM-DD HH:mm:ss"))
}
export const TimeToMoment2= (tmp: any) => {
if (tmp == null) return null
return moment(tmp, "YYYY-MM-DD HH:mm:ss")
}
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect,useRef} from 'react';
import { Input ,Tabs,Table,Space, Button} from 'antd'; import { Input ,Tabs,Table,Space, Button} from 'antd';
const { TabPane } = Tabs; const { TabPane } = Tabs;
import {connect} from 'umi'; import {connect,history} from 'umi';
import { RA } from '@/utils/method'; import { RA } from '@/utils/method';
...@@ -10,6 +10,7 @@ const module="XXX" ...@@ -10,6 +10,7 @@ const module="XXX"
const XXX = (props:any) => { const XXX = (props:any) => {
const { dispatch, Data } = props; const { dispatch, Data } = props;
const formRef = useRef(null)
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
......
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