Commit 65e49186 authored by maple's avatar maple Committed by MrShi

[fixed]小区保养

(cherry picked from commit 05fda811)
parent 2b0d6743
......@@ -27,7 +27,8 @@ const PictureOptionsRow = (props: any) => {
const {value, onChange} = props;
const [fileList, setFileList] = useState([])
const [previewVisible, setPreviewVisible] = useState(false)
const [previewImage,setPreviewImage]=useState('')
const [previewImage, setPreviewImage] = useState('')
const [limitNum,setLimitNum]=useState(5)
const handleCancel = () => setPreviewVisible(false);
useEffect(() => {
......@@ -88,7 +89,7 @@ const PictureOptionsRow = (props: any) => {
disabled={props.disabled}
beforeUpload={beforeUpload}
>
{fileList.length >= 8 ? null : (props.disabled?null:uploadButton)}
{fileList.length >= limitNum ? null : (props.disabled?null:uploadButton)}
</Upload>
<Modal
visible={previewVisible}
......
......@@ -36,9 +36,15 @@ const TableShow = (props:any) => {
// ower_name: "测试"
// ower_phone: "微微"
const user_status = [[1, "家属"], [2, "租户"]]
const user_type_status = ["Registered", "Unregistered","Cancellation"]
const user_code=["Used","Not Used"]
// Owner/Family Member/Tenant
// const user_status = [[1, "家属"], [2, "租户"]]
const user_status = [[1, "Family Member"], [2, "Tenant"]]
// const user_type_status = ["Registered", "Unregistered", "Cancellation"]
const user_type_status = ["Normal", "Normal", "Cancellation"]
const user_code=["Not Used","Used"]
const key = objectColumns([
["User Name", "ower_name"],
["Contact Details", "ower_phone"],
......@@ -56,7 +62,7 @@ const TableShow = (props:any) => {
dataRow.map((item, index) => {
return(
<TabPane tab={item.name} key={index}>
<Row gutter={16}><Col>Address:</Col><Col>{((item).owner).address_and_postalCode}</Col></Row>
<Row gutter={16}><Col>Address:</Col><Col>{((item).owner).addressAndpostalCode}</Col></Row>
{
(item.unit).map((unit:any, uindex:any) => {
return (
......
......@@ -11,6 +11,7 @@ const { Option } = Select;
import SelectOptions from '../../components/SelectOptions/index';
import { gray } from 'chalk';
import SearchOptionsCommnity from '../SearchOptions/SearchOptionsCommnity';
const TitleSearch= (props:any) => {
......@@ -21,11 +22,13 @@ const TitleSearch= (props:any) => {
const single = props.single
const checklist = props.checklist;
const status = props.status;
const communitySelect=props.communitySelect
const time = props.time;
const community = props.community;
const [selectOptions, setSelectOptions] = useState(true)
const [communitys, setCommunitys] = useState(CommunityList)
const [communitySingle, setCommunitySingle] = useState(null)
const [datePicker, setDate] = useState(null)
const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})};
......@@ -57,6 +60,9 @@ const TitleSearch= (props:any) => {
if (community) {
values[community]=communitys
}
if (communitySingle) {
values["communityName"]=communitySingle
}
console.log('Success:', values);
props.onSubmit(values)
};
......@@ -72,16 +78,24 @@ const TitleSearch= (props:any) => {
const printContent = (comment: any)=>{
setCommunitys(comment)
}
const extendName = (values: any) => {
setCommunitySingle(values)
}
return (
<>
<Form name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed}>
<Row gutter={32}>
<Row gutter={32}>
{
communitySelect != null ?
<Col key={"communitySelect_"} ><SearchOptionsCommnity alone={true} onSubmit={extendName} /></Col>
: null
}
{
key!=null?
key.map((item, index) => {
return (
<Col key={"KeyCol_"+ index}><Form.Item name={item}><Input placeholder={name[index]} /></Form.Item></Col>
<Col key={"KeyCol_"+ index}><Form.Item name={item}><Input placeholder={name[index]} allowClear /></Form.Item></Col>
)
})
:null
......
......@@ -4,7 +4,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
import { timestampToTime } from '@/utils/time';
import { timestampToTime, timestampToTime4 } from '@/utils/time';
import { picFromate } from '@/utils/method';
export default {
......@@ -13,7 +13,7 @@ export default {
Data: null,
DataSave:null,
CurData: null,
CurDataDetail: {},
CurDataDetail: null,
Data7: null,
Data8: null,
Result: null,
......@@ -50,72 +50,49 @@ export default {
effects: {
// 获取社区服务
*TosCommunityServiceGet({ playload }, { call, put }) {
const resp = yield call(service.TosCommunityServiceGet, playload);
console.log(resp)
if (resp.error_code != 0) {
window.location.href = '/500';
}
console.log(resp.error_code)
if (resp.error_code == "0000") {
let Data = resp.data.rows;
yield put({ type: 'returnPage', Data, });
} else {
let Data = null;
yield put({ type: 'returnPage', Data, });
}
},
*TosCommuntiyServiceReply({ playload }, { call, put }) {
const resp = yield call(service.TosCommuntiyServiceReply, playload);
console.log(resp)
if (resp.error_code != 0) {
window.location.href = '/500';
} else {
//window.location.href = '/CommercialService/OwnerComplaints';
}
},
//预订设施查询
*RA({ playload }, { call, put }) {
*RA({ playload }, { call, put }) {
// switch (playload.index) {
// case 21: {
// var CurDataDetail=null
// yield put({ type: 'returnCurDataDetail', CurDataDetail});
// } break;
// }
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)
}
console.log("请求错误码:" + "(" + playload.index + ")" + resp.error_code)
console.log(playload)
} else {
switch (playload.index) {
case 21:
{
var tmp = resp.data.rows[0].tosOwerModel;
var tmp = resp.data.rows[0].tosOwerModel;
var tmp2 = resp.data.rows[0];
console.log(tmp2.imgUrl)
// TODO:还差图片
var CurDataDetail = {
community: tmp.communityName,
address: tmp.addressAndpostalCode,
home: tmp.buildingNumber+"#"+tmp.floorNumber+"-"+tmp.roomNumber,
home: tmp.buildingNumber + "#" + tmp.floorNumber + "-" + tmp.roomNumber,
name: tmp.owerName,
phone: tmp.owerPhone,
email: tmp.owerEmail,
content: resp.data.rows[0].serviceContent,
status: tmp2.handleStatus,
pictrues:picFromate(tmp2.imgUrl),
time:timestampToTime(tmp2.createTime.time)
pictrues: picFromate(tmp2.imgUrl),
time: timestampToTime4(tmp2.createTime.time)
};
console.log("查看值")
console.log(CurDataDetail)
yield put({ type: 'returnCurDataDetail', CurDataDetail, });
} break;
case 33:
case 22: {
message.success("Success Operation!", 3)
history.go(-1)
// history.push("/CommercialService/CommunityMaintenance")
} break;
case 23: {
......@@ -135,7 +112,12 @@ export default {
let DataSaveDetail = resp;
yield put({ type: 'returnDataSaveDetail', DataSaveDetail, });
} break;
case 40: {
let Data = resp.data.rows;
yield put({ type: 'returnPage', Data, });
} break;
}
}
},
......@@ -176,7 +158,7 @@ export default {
},
*setCurDataDetail({ playload }, { call, put }) {
var CurDataDetail={community:'',address:'',home:'',name:'',phone:'',email:'',content:''}
var CurDataDetail=null
yield put({ type: 'returnCurDataDetail', CurDataDetail, });
},
......
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import { Input ,Button,Table,Space,Pagination,Tooltip } from 'antd';
import { Link, useIntl, connect, Dispatch,history } from 'umi';
import TextArea from 'antd/lib/input/TextArea';
const Request = () => {
const goToReturn = () => {
history.push('/CommercialService/AccessCardApplication')
}
return (
<div className={styles.base}>
{/* 头部组件 */}
<div className={styles.box}>
<div className={styles.item1}>Payment Settings</div>
<button className={styles.item3} onClick={goToReturn}>返回</button>
</div>
<div className={styles.box1}>
<div className={styles.box1item1}>Contract Details</div>
<div className={styles.box1item2}><Input.Search style={{width:200}} /></div>
<div className={styles.box1item3}><Input style={{width:94}}/></div>
<div className={styles.box1item4}>#</div>
<div className={styles.box1item5}><Input style={{width:80}}/></div>
<div className={styles.box1item6}></div>
<div className={styles.box1item7}><Input style={{width:112}}/></div>
</div>
<div className={styles.box2}>
<div className={styles.box2item1}><Input style={{width:680}}/></div>
</div>
<div className={styles.box3}>
<div className={styles.box3item1}>Owner</div>
<div className={styles.box3item2}><Input style={{ width: 200 }} /></div>
<div className={styles.box3item3}>Contract Details</div>
<div className={styles.box3item4}><Input style={{ width: 200 }} /></div>
<div className={styles.box3item5}><Input style={{width:200}}/></div>
</div>
<div className={styles.line}></div>
<div className={styles.box3}>
<div className={styles.box3item1}>Applicant</div>
<div className={styles.box3item2}><Input style={{ width: 200 }} /></div>
<div className={styles.box3item3}>Contract Details</div>
<div className={styles.box3item4}><Input style={{ width: 200 }} /></div>
<div className={styles.box3item5}><Input style={{width:200}}/></div>
</div>
<div className={styles.box4}>
<div className={styles.box4item1}>Relationship With The Owner</div>
<div className={styles.box4item2}><Input style={{ width: 120 }} /></div>
</div>
<div className={styles.box5}>
<div className={styles.box5item1}>Relationship With The Owner</div>
<div className={styles.box5item2}><TextArea autoSize={false} style={{ width: 520,height: 120}} /></div>
</div>
<div><div className={styles.line}></div><Button type="primary" size="large">summit</Button></div>
</div>
);
};
export default Request;
@import '~antd/lib/style/themes/default.less';
//基石
.base {
width: 100%;
background-color: #ffffff;
padding: 34px;
min-width: 1020px;
}
//头部组件
.box{
width: 100%;
height: 64px;
position: relative;
}
.item1{
position: absolute;
width: 180px;
text-align: center;
border-left: 5px solid rgba(24,144,255,1);
font-family:'Source Han Sans CN';
font-size: 18px;
font-weight: 600;
color: #000000;
}
.item2{
width:300px;
position: absolute;
left: (300px);
line-height: 30px;
}
.item4{
position: absolute;
left: (500px);
line-height: 30px;
}
.item3{
width:80px;
height: 32px;
position: absolute;
right: 0;
outline: none;
background:none;
cursor: pointer;
border:1px solid rgba(217,217,217,1);
border-radius:2px;
}
.box1{
width: 100%;
height: 32px;
line-height: 32px;
position: relative;
margin-bottom: 16px;
}
.box1item1{
position: absolute;
}
.box1item2{
position: absolute;
left: 146px;
}
.box1item3{
position: absolute;
left: 362px;
}
.box1item4{
position: absolute;
left: 461px;
}
.box1item5{
position: absolute;
left: 475px
}
.box1item6{
position: absolute;
left: 561px;
}
.box1item7{
position: absolute;
left: 583px;
}
.box2{
width: 100%;
height: 32px;
position: relative;
padding-left: 146px;
margin-bottom: 27px;
}
.box2item1{
position: absolute;
}
.box3{
width: 100%;
height: 32px;
position: relative;
}
.box3item1{
position: absolute;
}
.box3item2{
position: absolute;
left:146px;
}
.box3item3{
position: absolute;
left:462px;
}
.box3item4{
position: absolute;
left:590px;
}
.box3item5{
position: absolute;
left:818px;
}
// 线栏
.line{
width: 100%;
height: 1px;
border-top: 1px solid rgba(217,217,217,1);
margin-top: 28px;
margin-bottom: 28px;
}
.box4{
width: 100%;
height: 32px;
margin-top: 28px;
margin-bottom: 28px;
position: relative;
}
.box4item1{
position: absolute;
}
.box4item2{
position: absolute;
left: 252px;
}
.box5{
width: 100%;
height: 120px;
position: relative;
}
.box5item1{
position: absolute;
}
.box5item2{
position: absolute;
left: 252px;
}
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import styles from './Detail.less';
import { Input ,Form,Row,Col,Upload,Modal, Button,Descriptions} from 'antd';
import styles from './css/Detail.less';
import { Input ,Form,Row,Col,Upload,Spin, Button,Descriptions} from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
import TextArea from 'antd/lib/input/TextArea';
......@@ -11,9 +11,14 @@ import Line from '../../components/Line/Line';
import TitleBack from '../../components/TitleBack/TitleBack';
import PictureOptionsRow from '../../components/PictureOptions/PictureOptionsRow';
import { getCookie } from '@/utils/method';
import { timestampToTime } from '@/utils/time';
import { validateMessages } from '@/utils/params';
const treatStatus=["Untreated","Processed"]
const Detail = (props:any) => {
const [editorFlag, setEditorFlag] = useState(true);
const { dispatch, location, CurData,CurDataDetail } = props;
......@@ -22,6 +27,9 @@ const Detail = (props:any) => {
const setCurDataDetail = () => { dispatch({ type: 'CommunityService/setCurDataDetail' }) };
const [curString, setCurString] = useState({ readyState: false})
const [loading, setLoading] = useState(false)
const [headTitle, setHeadTitle] = useState("");
const headTitles = [
......@@ -33,17 +41,18 @@ const Detail = (props:any) => {
const [fileList, setfileList] = useState([]);
useEffect(() => {
setCurDataDetail()
if (CurData != null) {
RA(21,{
serviceType: CurData.service_type,
id: CurData.id
})
setHeadTitle(headTitles[CurData.service_type - 1])
}
}, []);
// useEffect(() => {
// // setCurDataDetail()
// // if (CurData != null) {
// // RA(21,{
// // serviceType: CurData.service_type,
// // id: CurData.id
// // })
// // setHeadTitle(headTitles[CurData.service_type - 1])
// // }
// }, []);
useEffect(() => {
if ((location.pathname).indexOf("/Edit")>-1) {
......@@ -51,7 +60,28 @@ const Detail = (props:any) => {
} else {
setEditorFlag(false)
}
console.log("跳转后的URL参数值")
console.log(location)
RA(21,{
serviceType: location.query.serviceType,
id: location.query.id
})
setHeadTitle(headTitles[parseInt(location.query.serviceType)- 1])
setLoading({ data: true })
},[location.pathname]);
useEffect(() => {
if (CurDataDetail != null&& curString.readyState==true) {
console.log(CurDataDetail)
setLoading({ data: false })
}
}, [CurDataDetail])
useEffect(()=>{
setCurString({ readyState: true })
console.log("页面准备好了")
},[])
const onFinish = (values:any) => {
var val = values
......@@ -64,7 +94,6 @@ const Detail = (props:any) => {
val.file=fileList
console.log('Success:', val)
RA(22,val);
//TosCommuntiyServiceReply(val)
};
const onFinishFailed = (errorInfo:any) => {
......@@ -75,13 +104,21 @@ const Detail = (props:any) => {
console.log(values)
setfileList(values)
}
return (
<div className={styles.base}>
{/* 头部组件v1.2 */}
<TitleBack sublist={['Handle Status : '+CurDataDetail.status,'Create Time : '+CurDataDetail.time]} title={headTitle} />
{/* 内容组件 */}
const titleProps = {
sublist: CurDataDetail != null?['Handle Status : ' + treatStatus[CurDataDetail.status], 'Create Time : ' + CurDataDetail.time]:null,
title: headTitle
}
return (
<div>
{CurDataDetail != null ?
<>
<Spin spinning={loading.data}>
<div className={styles.base}>
<TitleBack {...titleProps} />
<Descriptions>
<Descriptions.Item >{CurDataDetail.community}</Descriptions.Item>
<Descriptions.Item span={2}>{CurDataDetail.home}</Descriptions.Item>
......@@ -91,7 +128,7 @@ const Detail = (props:any) => {
<Descriptions.Item >{CurDataDetail.email}</Descriptions.Item>
</Descriptions>
<Row gutter={16}>
<Col>Details:</Col>
<Col span={3}>Details:</Col>
<Col><TextArea style={{ width: 394, height: 80,padding:8 }} autoSize={false} disabled value={CurDataDetail.content}/></Col>
</Row>
<Row gutter={16} style={{marginTop:20}}>
......@@ -113,20 +150,22 @@ const Detail = (props:any) => {
<Line />
<Form name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed}>
{/* <Row gutter={16}>
<Col>Response:</Col>
<Col><Form.Item name="handleName" ><Input style={{ width: 200 }} placeholder="Please enter a Name" disabled={!editorFlag} /></Form.Item></Col>
<Col>Contract Detail:</Col>
<Col><Form.Item name="handleContacts" ><Input style={{ width: 300 }} placeholder="Please enter contrat number" disabled={!editorFlag} /></Form.Item></Col>
</Row> */}
<Form name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed} validateMessages={validateMessages}>
{!editorFlag ?
<Row gutter={16}>
<Col>Response:</Col>
<Col>{getCookie("name")}</Col>
<Col>Contract Detail:</Col>
<Col>{getCookie("phone")}</Col>
</Row>
: null}
<Row gutter={16} style={{ marginTop: 20 }}>
<Col>Resolved Complaint:</Col>
<Col><Form.Item name="replyContent" ><TextArea style={{ width: 394, height: 80 }} autoSize={false} disabled={!editorFlag} /></Form.Item></Col>
<Col span={3.5}>Resolved Complaint:</Col>
<Col ><Form.Item name="replyContent" rules={[{required:true,max:300}]} ><TextArea style={{ width: 394, height: 80 }} autoSize={false} disabled={!editorFlag} /></Form.Item></Col>
</Row>
<Row gutter={16} style={{ marginTop: 20 }}>
<Col>Resolved Complaint:</Col>
<Col>
<Row gutter={16} style={{ marginTop: 20 }}>
<Col span={3}></Col>
<Col >
<PictureOptionsRow
action="/tos/communtiy/service/reply/img"
disabled={!editorFlag}
......@@ -141,11 +180,14 @@ const Detail = (props:any) => {
</Row>
{
editorFlag ?
<><Line /><Form.Item><Button type="primary" htmlType="submit">summit</Button></Form.Item></>:null
<><Line /><Row><Col span={3}></Col><Col><Form.Item><Button type="primary" htmlType="submit">summit</Button></Form.Item></Col></Row></>:null
}
</Form>
</div>
</Form>
</div>
</Spin>
</>
: null}
</div>
);
};
......
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import styles from './css/index.less';
import { Input ,Menu,Table,Space,Upload,message,Button } from 'antd';
import { Link, useIntl, connect, Dispatch,history } from 'umi';
......@@ -7,112 +7,84 @@ import { Link, useIntl, connect, Dispatch,history } from 'umi';
import { timestampToTime3 } from '../../utils/time';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, urlEncode } from '@/utils/method';
const pathname = ["CommunityMaintenance", "ShelfLifeService", "OwnerComplaints", "ReportOnline", "ProblemFeedback"]
// const handle_status=["未处理","处理","拒绝"]
const handle_Status = ["Untreated", "Processed", "Rejected"]
const module="CommunityService"
const PropertyServices = (props: any) => {
const { dispatch, location, Data } = props;
const TosCommunityServiceGet = (values: any) => { dispatch({ type: 'CommunityService/TosCommunityServiceGet', playload: values }) };
const RA = (index: any, values: any) => { dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } }) };
const setCurData = (values: any) => { dispatch({ type: 'CommunityService/setCurData', playload: values }) };
const pagination = { defaultCurrent: 1, total: Data!=null?Data.length:0 }
const [loading,setLoading]=useState(false)
const goToFunction = (value, record, e) => {
setCurData(record)
history.push(location.pathname+(value==0?"/Edit":"/Detail"))
}
const goToRequest = () => {
history.push("./AccessCardApplication/Request")
const [loading, setLoading] = useState(false)
const [pageNum,setPageNum]=useState(1)
const [curString, setCurString] = useState({ serviceType: null })
const changeValue = (key:any,value: any) => {
var tmp = curString;tmp[key] = value;setCurString(tmp)
}
const pagination = { defaultCurrent: pageNum, total: Data != null ? Data.length : 0 }
const columns = [
{ title: "community_name",dataIndex: 'community_name',},
{ title: "ower_name",dataIndex: 'ower_name',},
{ title: "service_content",dataIndex: 'service_content',},
{ title: "create_time",dataIndex: "create_time",
render: (text: any, record: any) => (
<Space size="middle">{timestampToTime3(text.time)}</Space>
),
},
{
title: "handle_status", dataIndex: 'handle_status',
render: (text: any, record: any) => (
<Space size="middle">{text==0?"Untreated":"Processed"}</Space>
),
},
{ title: "Community Name",dataIndex: 'community_name',},
{ title: "Ower Name",dataIndex: 'ower_name',},
{ title: "Reply",dataIndex: 'handle_name',render: (text: any) => (<Space size="middle">{text!=null?text:"--"}</Space>)},
{ title: "Create Time",dataIndex: "create_time",render: (text: any, record: any) => (<Space size="middle">{timestampToTime3(text.time)}</Space>)},
{ title: "Handle status", dataIndex: 'handle_status',render: (text: any, record: any) => (<Space size="middle">{handle_Status[text]}</Space>)},
{ title: "Actions",dataIndex: 'handle_status',
render: (text: any, record: any) => (
<Space size="middle"> <a onClick={goToFunction.bind(this,text,record)}>{text==0?"Reply":"Detail"}</a></Space>
<Space size="middle"> <a onClick={goToDetail.bind(this,text,record)}>{text==0?"Reply":"Detail"}</a></Space>
),
},
];
useEffect(() => {
var init = "1"
switch (location.pathname) {
case "/CommercialService/CommunityMaintenance": init = "1"
{
TosCommunityServiceGet({serviceType:init})
} break;
case "/CommercialService/ShelfLifeService": init = "2"
{
TosCommunityServiceGet({serviceType:init})
} break;
case "/CommercialService/OwnerComplaints": init = "3"
{
TosCommunityServiceGet({serviceType:init})
} break;
case "/CommercialService/ReportOnline": init = "4"
{
TosCommunityServiceGet({serviceType:init})
} break;
case "/CommercialService/ProblemFeedback":init = "5"
{
TosCommunityServiceGet({serviceType:init})
} break;
case "/CommercialService/RenovationApplication": init = "6"
{
RA(23, { serviceType: init ,id:""})
} break;
}
// if (location.pathname == "/CommercialService/CommunityMaintenance") { init = "1"}
// else if(location.pathname == "/CommercialService/ShelfLifeService") {init = "2" , TosCommunityServiceGet({serviceType:init})}
// else if (location.pathname == "/CommercialService/OwnerComplaints") { init = "3" , TosCommunityServiceGet({serviceType:init})}
// else if (location.pathname == "/CommercialService/ReportOnline") { init = "4" , TosCommunityServiceGet({serviceType:init})}
// else if (location.pathname == "/CommercialService/ProblemFeedback") { init = "5", TosCommunityServiceGet({serviceType:init}) }
// else if(location.pathname == "/CommercialService/RenovationApplication") {init = "6",RA(22,{serviceType:init})}
setLoading(true)
},[]);
const goToDetail = (value, record, e) => {
history.push(location.pathname+(value==0?"/Edit":"/Detail")+urlEncode({serviceType: curString.serviceType,id: record.id,user_id:record.user_id}))
}
useEffect(() => {
setLoading(false)
}, [Data]);
}, [Data]);
const TitleSearchContent = (comment: any)=>{
comment.serviceType = curString.serviceType
console.log(comment)
history.push(location.pathname+urlEncode(comment))
}
useEffect(()=>{
if (location != null) {
var serviceType =""
pathname.map((item, index) => {
if ((location.pathname).indexOf(item) > -1) {
serviceType = "" + (index + 1)
changeValue("serviceType",serviceType)
}
})
if (location.query.current) {
console.log("翻页")
setPageNum(location.query.current)
} else {
var tm=1
setPageNum(tm)
}
RA(40, {
serviceType: serviceType,
handleStatus: location.query.handleStatus != null ? parseInt(location.query.handleStatus) : null,
}, module, dispatch)
setLoading(true)
}
}, [location.query])
const PageChange = (values: any) => {
history.push(location.pathname+urlEncode(values))
console.log(values)
}
return (
<div className={styles.base}>
<TitleSearch listkey={['A', 'C']} list={['Hello', 'world']} status={[{ name: ["status","status"], data: [[0,"处理"], [1,"未处理"]]}]} onSubmit={TitleSearchContent}/>
{/* <div style={{position:"relative", width: "100%", height: 40 }}>
<div style={{ position: "absolute", right: 0 }}>
{
location.pathname == "/CommercialService/AccessCardApplication"?(<Button type="primary" size="large" onClick={goToRequest}>Apply For Access Card</Button>):(<div/>)
}
</div>
</div> */}
{/* 列表组件 */}
<Table loading={loading} rowKey={"id"} style={{ marginTop: 16 }} dataSource={Data} columns={columns} pagination={pagination} />
<div>{pageNum}</div>
<TitleSearch communitySelect={true} listkey={['ownerName']} list={['Owner Name']} status={[{ name: ["handleStatus","Status"], data: [[0,"Processed"], [1,"Untreated"],[2,"Rejected"]]}]} onSubmit={TitleSearchContent}/>
<Table loading={loading} rowKey={"id"} style={{ marginTop: 16 }} dataSource={Data} columns={columns} pagination={{ defaultCurrent: pageNum, total: Data != null ? Data.length : 0}} onChange={PageChange}/>
</div>
);
};
......
......@@ -8,6 +8,7 @@ import {connect,history} from 'umi';
import { RA, SA } from '@/utils/method';
import { objectColumns, stringTab } from '@/utils/string';
import { timestampToTime } from '@/utils/time';
const module="CommunityService"
const Renovation = (props:any) => {
......@@ -18,7 +19,8 @@ const Renovation = (props:any) => {
["Community", "community_name"],
["Apply Name", "applyfor_name"],
["Unit", null, (text: any, record: any) => (<div>{record.community_build_decorate}#{record.community_floor_decorate}-{record.community_room_decoate}</div>)],
["Content", "decoration_content",(text: any) => (<div>{stringTab(text)}</div>)],
["Content", "decoration_content", (text: any) => (<div>{stringTab(text)}</div>)],
["Request Time", "create_time",(text: any) => (<div>{timestampToTime(text.time)}</div>)],
["status", "decoration_status",(text: any) => (<div>{decoration_status[parseInt(text)][1]}</div>)],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a onClick={goToDetail.bind(this,record)}>Detail</a></Space>)],
])
......
......@@ -4,6 +4,7 @@ const { TabPane,} = Tabs;
import {connect,history} from 'umi';
const decoration_status = [[0, "Pending"], [1, "Approved"], [2, "Rejected"]]
import { RA, getCookie } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
......@@ -11,6 +12,7 @@ import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea';
import { timestampToTime } from '@/utils/time';
import { values } from 'lodash';
const module="CommunityService"
const RenovationDetail = (props:any) => {
......@@ -19,6 +21,8 @@ const RenovationDetail = (props:any) => {
useEffect(()=>{
if (DataSaveDetail != null) {
console.log("给予的请求页面");
console.log(DataSaveDetail)
}
},[DataSaveDetail])
......@@ -65,18 +69,18 @@ const RenovationDetail = (props:any) => {
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
{
DataSave!=null?<>
<TitleBack sublist={['Status : ' + "1", 'Time : ' + '12']} title={"Renovation Detail"}></TitleBack>
<TitleBack sublist={['Status : ' + decoration_status[DataSave.decoration_status][1], 'Time : ' + timestampToTime(DataSave.create_time.time)]} title={"Renovation Detail"}></TitleBack>
<Row gutter={8}>
<Col>Community:</Col>
<Col span={1}>{DataSave.community_name}</Col>
<Col span={3}>{DataSave.community_name}</Col>
<Col>unit:</Col>
<Col>{DataSave.community_build_decorate}#{DataSave.community_floor_decorate}-{DataSave.community_room_decoate}</Col>
</Row>
<Row gutter={8} style={{marginTop:16}}>
<Col>Address:</Col>
<Col></Col>
<Col>{DataSaveDetail!=null?DataSaveDetail.data.rows.communityDetail.residentialAddress+" "+DataSaveDetail.data.rows.communityDetail.residentialZipCode:null}</Col>
</Row>
<Row gutter={8} style={{marginTop:16}}>
......@@ -107,7 +111,7 @@ const RenovationDetail = (props:any) => {
<Row gutter={8} style={{marginTop:16}}>
<Col span={3}>Examine:</Col>
<Col span={4}><Form.Item name="decorationStatus"><Radio.Group ><Radio.Button value={"1"}>Agree</Radio.Button > <Radio.Button style={{marginLeft:20}} value={"2"}>Refuse</Radio.Button ></Radio.Group></Form.Item></Col>
<Col ><Form.Item name="decorationStatus"><Radio.Group ><Radio.Button value={"1"}>Agree</Radio.Button > <Radio.Button style={{marginLeft:10}} value={"2"}>Refuse</Radio.Button ></Radio.Group></Form.Item></Col>
</Row>
<Row gutter={8} style={{marginTop:16}}>
......
......@@ -44,8 +44,10 @@ const Users = (props:any) => {
const columns = [
{ title: username, dataIndex: 'owerName', },
{title: project,dataIndex: 'communityName',},
{ title: username, dataIndex: 'owerName', },
{ title: project, dataIndex: 'communityName', },
// { title: project, dataIndex: 'unit', },
// { title: unit, dataIndex: 'living', },
{title: unit,render:(text: any, record: any) => (<div>{record.buildingNumber+"#"+record.floorNumber+"—"+record.roomNumber}</div>)},
{ 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>)},
......@@ -87,19 +89,19 @@ const Users = (props:any) => {
}
// useEffect(() => {
// if (CommunityList != null) {
// console.log("小组件开始请求")
// if (pageData != null) {
// console.log(pageData)
// }
// RA(12, {
// ownerName: pageData != null?pageData.search.name:null,
// communityArray: pageData != null?pageData.search.cell:CommunityList
// }, module, dispatch);
// }
// }, [CommunityList])
useEffect(() => {
if (CommunityList != null) {
// console.log("小组件开始请求")
// if (pageData != null) {
// console.log(pageData)
// }
RA(12, {
ownerName: pageData != null?pageData.search.name:null,
communityArray: pageData != null?pageData.search.cell:CommunityList
}, module, dispatch);
}
}, [CommunityList])
......@@ -162,8 +164,6 @@ const Users = (props:any) => {
history.push(location.pathname+'/Add')
}
const CallBackTitleSearch = (comment: any)=>{
console.log(comment)
RA(12, {
......
......@@ -33,7 +33,7 @@ const Guard = (props:any) => {
return (
<div className={styles.base}>
<TitleGet title={"Version 1.1.4"} />
<TitleGet title={"Version 1.1.7"} />
<p>
token:{page.token}
name:{getCookie("name")}
......
......@@ -39,17 +39,6 @@ export function TosTosServiceProviderSave(values: any) {
return request('/tos/tosServiceProvider/save',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
}
//小区服务
export function TosCommunityServiceGet(values: any) {
return request('/tos/community/service/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
}
// export function TosCommunityServiceGetDetail(values: any) {
// return request('/tos/community/service/get/detail',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
// }
export function TosCommuntiyServiceReply(values: any) {
return request('/tos/communtiy/service/reply',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
}
//小区管理
const headers = { 'Content-Type': 'application/json'}
function Body(values:any) { return {method: 'POST',body: JSON.stringify(values),headers:headers}}
......@@ -102,16 +91,22 @@ const requestList = [
["/tos/property/community/houseCard/query/detail", "36 获取住户卡详情"],
["/tos/property/decorate/record/get/detail", "37 获取装修记录详情"],
["/tos/users/save", "38 新建后台信息"],
["/tos/life/community/account/member/del","39 删除业主成员信息"],// {"id":"c06286cfe7b843cb96fdfcb987231123","ownerId":"6b359755a36b49c28241a4620fa6539b"}
["/tos/life/community/account/member/del", "39 删除业主成员信息"],// {"id":"c06286cfe7b843cb96fdfcb987231123","ownerId":"6b359755a36b49c28241a4620fa6539b"}
["/tos/community/service/get","40 获取小区服务回复列表"],
]
const params = [
{ "communityName": "" },
{ "communityNum": "", "noticTitlel": "" },
{ "inviterAddress": "", "visitorCommunity": "" },
{
"serviceType":"1",
"ownerName":"阿涛暗暗",
"handleStatus":"1",
"communityName":"TANGDE2"
}
]
function requestAuto(url:string,values:any) {
return request(url, Body(values))
......
......@@ -103,4 +103,17 @@ export const getObjectInfo = (test: any) => {
console.log(array)
console.log(array.length)
return array
}
//对象转URL
export const urlEncode = (obj:any) => {
var url = "?"
var i = 0
for (var item in obj) {
if (i > 0) {
url += "&"
}
url += item + "=" + obj[item]
i += 1
}
return url
}
\ No newline at end of file
......@@ -32,7 +32,12 @@ export const getStringToTime = (time:any) => {
var result = addTZero(MonthTurnNum(date[0])) + "-" + addZero(parseInt(date[1].slice(0, date[1].length - 1))) + " " + date[2]
return result
}
//03-08-2020 13:26
export const timestampToTime4 = (timestamp: any) => {
var date = new Date(timestamp);//*1000//getHours getMinutes getSeconds
return addZero(date.getDate()) + '-'+ (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'+date.getFullYear()+ ' '+addZero(date.getHours())+ ':'+addZero(date.getMinutes())
}
// 03-06 13:26
export const timestampToTime3=(timestamp:any)=>{
var date = new Date(timestamp);//*1000//getHours getMinutes getSeconds
......
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