Commit b005129a authored by Sixiang_Zzb's avatar Sixiang_Zzb

装修申请bug处理

parent c6a71c27
...@@ -5,26 +5,24 @@ import SearchOptionsTow from './SearchOptionsTow'; ...@@ -5,26 +5,24 @@ import SearchOptionsTow from './SearchOptionsTow';
const SearchOptionsCommnity = (props: any) => { const SearchOptionsCommnity = (props: any) => {
const { dispatch, CommunityList, opname, defaultName } = props;
const {dispatch, CommunityList, opname ,defaultName} = props; const tosCommunityget = (values: any) => { dispatch({ type: 'Init/tosCommunityget', playload: values }) };
const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})};
useEffect(() => { useEffect(() => {
if (CommunityList == null) { if (CommunityList == null) {
tosCommunityget(null) tosCommunityget(null)
} }
}, []); }, []);
const extendName = (values: any) => { const extendName = (values: any) => {
// console.log(values) // console.log(values)
opname(values) opname(values)
} }
return ( return (
<>{CommunityList!=null? <>{CommunityList != null ?
// <SearchOptions // <SearchOptions
// titleSearch={titleSearch} // titleSearch={titleSearch}
// disabled={disabled} // disabled={disabled}
...@@ -33,14 +31,14 @@ const SearchOptionsCommnity = (props: any) => { ...@@ -33,14 +31,14 @@ const SearchOptionsCommnity = (props: any) => {
// list={CommunityList} // list={CommunityList}
// onSubmit={extendName} /> // onSubmit={extendName} />
<SearchOptionsTow list={CommunityList} extendName={extendName} def = {defaultName}></SearchOptionsTow> <SearchOptionsTow list={CommunityList} extendName={extendName} def={defaultName}></SearchOptionsTow>
:null : null
} }
</> </>
); );
}; };
function mapStateToProps(state:any) { function mapStateToProps(state: any) {
const { CommunityList } = state.Init; const { CommunityList } = state.Init;
return { return {
CommunityList, CommunityList,
}; };
......
...@@ -2,16 +2,15 @@ import React from 'react' ...@@ -2,16 +2,15 @@ import React from 'react'
import { Select } from 'antd'; import { Select } from 'antd';
const { Option } = Select; const { Option } = Select;
const SearchOptionsTow = (porps:any) => { const SearchOptionsTow = (porps: any) => {
const {list,extendName,def} = porps; const { list, extendName, def } = porps;
const options = list.map((d:any,index:number) => <Option value={d} key={index}>{d}</Option>); const options = list.map((d: any, index: number) => <Option value={d} key={index}>{d}</Option>);
function onChange(value:any) { function onChange(value: any) {
// console.log(`selected ${value}`); // console.log(`selected ${value}`);
extendName(value) extendName(value)
} }
return ( return (
<div> <div>
<Select <Select
......
...@@ -12,9 +12,9 @@ const { Option } = Select; ...@@ -12,9 +12,9 @@ const { Option } = Select;
import SelectOptions from '../../components/SelectOptions/index'; import SelectOptions from '../../components/SelectOptions/index';
import { gray } from 'chalk'; import { gray } from 'chalk';
import SearchOptionsCommnity from '../SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '../SearchOptions/SearchOptionsCommnity';
import { values } from 'lodash';
const TitleSearch = (props: any) => { const TitleSearch = (props: any) => {
console.log("===================================", props)
const { dispatch, CommunityList } = props; const { dispatch, CommunityList } = props;
...@@ -36,27 +36,8 @@ const TitleSearch = (props: any) => { ...@@ -36,27 +36,8 @@ const TitleSearch = (props: any) => {
const formRef = useRef(null) const formRef = useRef(null)
const tosCommunityget = (values: any) => { dispatch({ type: 'Init/tosCommunityget', playload: values }) }; const tosCommunityget = (values: any) => { dispatch({ type: 'Init/tosCommunityget', playload: values }) };
useEffect(() => {
// console.log("标题搜寻组件初始化") OK
if (CommunityList == null) {
// console.log("小区数量初始化") OK
tosCommunityget(null)
}
if (defaultValue != null) {
formRef.current.setFieldsValue(defaultValue)
}
}, []);
useEffect(() => { useEffect(() => {
if (defaultValue != null) {
formRef.current.setFieldsValue(defaultValue)
}
}, [defaultValue])
useEffect(() => {
console.log(CommunityList)
if (CommunityList != null) { if (CommunityList != null) {
// console.log("小区数量初始化完毕") OK // console.log("小区数量初始化完毕") OK
var tmp = {} var tmp = {}
...@@ -75,7 +56,7 @@ const TitleSearch = (props: any) => { ...@@ -75,7 +56,7 @@ const TitleSearch = (props: any) => {
if (community) { if (community) {
values[community] = communitys values[community] = communitys
} }
console.log('Success:', values); // console.log('Success:', values);
props.onSubmit(values) props.onSubmit(values)
}; };
...@@ -84,6 +65,7 @@ const TitleSearch = (props: any) => { ...@@ -84,6 +65,7 @@ const TitleSearch = (props: any) => {
}; };
const onChange = (date: any, dateString: string) => { const onChange = (date: any, dateString: string) => {
console.log(dateString)
setDate(dateString) setDate(dateString)
} }
...@@ -91,14 +73,37 @@ const TitleSearch = (props: any) => { ...@@ -91,14 +73,37 @@ const TitleSearch = (props: any) => {
setCommunitys(comment) setCommunitys(comment)
} }
// 表单标识
const [form] = Form.useForm()
// 选择小区名字并赋值
const opname = (value: any) => {
form.setFieldsValue({
'communityName': value
})
}
useEffect(() => {
// console.log("标题搜寻组件初始化") OK
if (CommunityList == null) {
// console.log("小区数量初始化") OK
tosCommunityget(null)
}
if (defaultValue != null) {
console.log(defaultValue)
form.setFieldsValue(defaultValue)
}
}, [defaultValue]);
return ( return (
<> <>
<Form ref={formRef} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed}> <Form form={form} name="basic" initialValues={form} onFinish={onFinish} onFinishFailed={onFinishFailed}>
<Row gutter={32}> <Row gutter={32}>
{ {
communitySelect != null ? communitySelect != null ?
<Col key={"communitySelect_"} ><Form.Item name={"communityName"}><SearchOptionsCommnity titleSearch={true} /></Form.Item></Col> <Col key={"communitySelect_"} ><Form.Item name={"communityName"}><SearchOptionsCommnity titleSearch={true} opname={opname} defaultName={defaultValue ? defaultValue.communityName : null} /></Form.Item></Col>
: null : null
} }
{ {
...@@ -165,7 +170,6 @@ const TitleSearch = (props: any) => { ...@@ -165,7 +170,6 @@ const TitleSearch = (props: any) => {
); );
}; };
function mapStateToProps(state: any) { function mapStateToProps(state: any) {
// console.log("state参数",state)
const { CommunityList } = state.Init; const { CommunityList } = state.Init;
return { return {
CommunityList, CommunityList,
......
This diff is collapsed.
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './css/index.less'; import styles from './css/index.less';
import { Input ,Menu,Table,Space,Upload,message,Pagination, Button } from 'antd'; import { Input, Menu, Table, Space, Upload, message, Pagination, Button } from 'antd';
import { Link, useIntl, connect, Dispatch,history } from 'umi'; import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { timestampToTime3 } from '../../utils/time'; import { timestampToTime3 } from '../../utils/time';
...@@ -11,10 +11,10 @@ import { RA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method'; ...@@ -11,10 +11,10 @@ import { RA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
const pathname = ["CommunityMaintenance", "ShelfLifeService", "OwnerComplaints", "ReportOnline", "ProblemFeedback"] const pathname = ["CommunityMaintenance", "ShelfLifeService", "OwnerComplaints", "ReportOnline", "ProblemFeedback"]
const handle_Status = [[0,"Pending"], [1,"Processed"]]//["未处理","处理","拒绝"] , [2,"Rejected"] const handle_Status = [[0, "Pending"], [1, "Processed"]]//["未处理","处理","拒绝"] , [2,"Rejected"]
const goToName = ["Reply", "Detail"]; const goToName = ["Reply", "Detail"];
const module="CommunityService" const module = "CommunityService"
const PropertyServices = (props: any) => { const PropertyServices = (props: any) => {
const { dispatch, location, Data } = props; const { dispatch, location, Data } = props;
...@@ -22,15 +22,15 @@ const PropertyServices = (props: any) => { ...@@ -22,15 +22,15 @@ const PropertyServices = (props: any) => {
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const [pageNum, setPageNum] = useState(1) const [pageNum, setPageNum] = useState(1)
const [serviceTypeGobal, setServiceType] = useState("") const [serviceTypeGobal, setServiceType] = useState("")
const [readyData,setReadyData]=useState(null) const [readyData, setReadyData] = useState(null)
const columns = [ const columns = [
{ title: "Community Name",dataIndex: 'community_name',}, { title: "Community Name", dataIndex: 'community_name', },
{ title: "Ower Name",dataIndex: 'ower_name',}, { title: "Ower Name", dataIndex: 'ower_name', },
{ title: "Reply",dataIndex: 'handle_name',render: (text: any) => (<Space size="middle">{text!=null?text:"--"}</Space>)}, { title: "service Content", dataIndex: 'service_content', ellipsis: true, width: 500, 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: "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][1]}</Space>)}, { title: "Handle status", dataIndex: 'handle_status', render: (text: any, record: any) => (<Space size="middle">{handle_Status[text][1]}</Space>) },
{ title: "Actions",dataIndex: 'handle_status',render: (text: any, record: any) => (<Space size="middle"><a onClick={goToDetail.bind(this,text,record)}>{goToName[text]}</a></Space>)}, { title: "Actions", dataIndex: 'handle_status', render: (text: any, record: any) => (<Space size="middle"><a onClick={goToDetail.bind(this, text, record)}>{goToName[text]}</a></Space>) },
]; ];
const goToDetail = (value: any, record: any, e: any) => { const goToDetail = (value: any, record: any, e: any) => {
...@@ -39,38 +39,40 @@ const PropertyServices = (props: any) => { ...@@ -39,38 +39,40 @@ const PropertyServices = (props: any) => {
console.log(record); console.log(record);
//页面递进 //页面递进
history.push( history.push(
location.pathname+(value==0?"/Edit":"/Detail")+urlEncode( location.pathname + (value == 0 ? "/Edit" : "/Detail") + urlEncode(
{ {
serviceType: serviceTypeGobal, serviceType: serviceTypeGobal,
id: record.id, id: record.id,
user_id:record.user_id, user_id: record.user_id,
community_id:record.community_id community_id: record.community_id
} }
) )
) )
} }
useEffect(() => { useEffect(() => {
if (Data != null) {setLoading(false)} if (Data != null) { setLoading(false) }
}, [Data]); }, [Data]);
const ClickTitleSearch = (comment: any) => { const ClickTitleSearch = (comment: any) => {
//页面搜索 //页面搜索
comment.serviceType = serviceTypeGobal comment.serviceType = serviceTypeGobal
comment.current = 1 comment.current = 1
history.push(location.pathname+urlEncode(filterObj(comment))) history.push(location.pathname + urlEncode(filterObj(comment)))
} }
const PageChange = (values: any) => { //.current const PageChange = (values: any) => { //.current
//页面跳转参数 //页面跳转参数
var tmp = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName"]) var tmp = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName"])
tmp["current"]=values.current tmp["current"] = values.current
history.push(location.pathname + urlEncode(tmp)) history.push(location.pathname + urlEncode(tmp))
} }
useEffect(()=>{ useEffect(() => {
if (location != null) { if (location != null) {
//细分类:页面指令 //细分类:页面指令
var serviceType ="" var serviceType = ""
pathname.map((item, index) => { pathname.map((item, index) => {
if ((location.pathname).indexOf(item) > -1) { if ((location.pathname).indexOf(item) > -1) {
serviceType = "" + (index + 1) serviceType = "" + (index + 1)
...@@ -78,7 +80,7 @@ const PropertyServices = (props: any) => { ...@@ -78,7 +80,7 @@ const PropertyServices = (props: any) => {
} }
}) })
//分页设置 //分页设置
if (location.query.current!=null) { if (location.query.current != null) {
setPageNum(parseInt(location.query.current)) setPageNum(parseInt(location.query.current))
} else { } else {
setPageNum(1) setPageNum(1)
...@@ -117,20 +119,20 @@ const PropertyServices = (props: any) => { ...@@ -117,20 +119,20 @@ const PropertyServices = (props: any) => {
defaultValue={readyData} defaultValue={readyData}
onSubmit={ClickTitleSearch} onSubmit={ClickTitleSearch}
/> />
<Table <Table
rowKey={"id"} rowKey={"id"}
style={{ marginTop: 16 }} style={{ marginTop: 16 }}
loading={loading} loading={loading}
columns={columns} columns={columns}
dataSource={ Data != null ?Data.data.rows:[]} dataSource={Data != null ? Data.data.rows : []}
pagination={Data != null ? { current: pageNum, total: Data.data.rows.length } : {}} pagination={Data != null ? { current: pageNum, total: Data.data.rows.length } : {}}
onChange={PageChange} onChange={PageChange}
/> />
</div> </div>
); );
}; };
function mapStateToProps(state:any) { function mapStateToProps(state: any) {
const { Data } = state.CommunityService; const { Data } = state.CommunityService;
return { return {
Data Data
......
import React, { useState, useEffect,useRef} 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,history} from 'umi'; import { connect, history } from 'umi';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
import { RA, SA } from '@/utils/method';
import { objectColumns, stringTab } from '@/utils/string'; import { objectColumns, stringTab } from '@/utils/string';
import { timestampToTime } from '@/utils/time'; import { timestampToTime } from '@/utils/time';
const module="CommunityService" const module = "CommunityService"
const Renovation = (props:any) => { const Renovation = (props: any) => {
// const decoration_status = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]] // const decoration_status = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]]
const decoration_status = [[0, "Pending"], [1, "Approved"], [2, "Rejected"]] const decoration_status = [[0, "Pending"], [1, "Approved"], [2, "Rejected"]]
const pathname = ["CommunityMaintenance", "ShelfLifeService", "OwnerComplaints", "ReportOnline", "ProblemFeedback"]
const [loading, setLoading] = useState(false)
const [serviceTypeGobal, setServiceType] = useState("")
const [pageNum, setPageNum] = useState(1)
const [readyData, setReadyData] = useState(null)
const columns = objectColumns([ const columns = objectColumns([
["Community", "community_name"], ["Community", "community_name"],
["Applicant", "applyfor_name"], ["Applicant", "applyfor_name"],
["Unit", null, (text: any, record: any) => (<div>{record.community_build_decorate}#{record.community_floor_decorate}-{record.community_room_decoate}</div>)], ["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>)], ["Request Time", "create_time", (text: any) => (<div>{timestampToTime(text.time)}</div>)],
["status", "decoration_status",(text: any) => (<div>{decoration_status[parseInt(text)][1]}</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>)], ["Actions", null, (text: any, record: any) => (<Space size="middle"> <a onClick={goToDetail.bind(this, record)}>Detail</a></Space>)],
]) ])
const { dispatch, Data8 } = props; const { dispatch, Data8, location } = props;
const formRef = useRef(null)
useEffect(() => {
useEffect(()=>{ if (Data8 != null) { setLoading(false) }
RA(23, { serviceType: "6", id: "" }, module, dispatch) }, [Data8]);
// applyfor_name: "jack-小白白" useEffect(() => {
// communityId: "7e5c6fd2f4ba497a90e64535df6e9088"
// community_build_decorate: "01" if (location != null) {
// community_floor_decorate: "00" //前置数据
// community_name: "A4" console.log("前置数据");
// community_room_decoate: "767" let tmp: any = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName", "current"])
// contact_name: "15626274096" tmp.handleStatus = decoration_status[parseInt(tmp.handleStatus)] //特殊处理
// contact_phone: "jack-小白白"
// create_time: {date: 10, day: 4, hours: 19, minutes: 39, month: 8, …} setReadyData(tmp)
// decorationBegin_time: {date: 10, day: 4, hours: 0, minutes: 0, month: 8, …} //获取数据
// decorationEnd_time: {date: 10, day: 4, hours: 0, minutes: 0, month: 8, …} setLoading(true)
// decoration_content: "滚滚滚" RA(23, { serviceType: "6", id: "" }, module, dispatch)
// decoration_status: 0 }
// deleted: 0
// id: "977591272158003200" }, [location])
// ownerId: "c4da40676d044487b37e7a1bdc6dd045"
// update_time: { //页面搜索
// date: 10, day: 4, hours: 19, minutes: const ClickTitleSearch = (comment: any) => {
let tmp = filterObjbyTg(comment, ["handleStatus", "ownerName", "communityName"])
}, []) tmp["current"] = 1
console.log(tmp)
history.push(location.pathname + urlEncode(tmp))
}
const goToDetail = (values: any, e: any) => { const goToDetail = (values: any, e: any) => {
SA(values,module,dispatch) SA(values, module, dispatch)
history.push('./RenovationApplication/Detail') history.push('./RenovationApplication/Detail')
} }
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
{ {
Data8 != null ? Data8 != null ?
<> <>
<Table loading={false} rowKey="id" style={{ marginTop: 16 }} <TitleSearch
dataSource={Data8.data.rows} communitySelect={true}
columns={columns} listkey={['ownerName']}
pagination={{ defaultCurrent: 1, total: Data8.total }} /> list={['Owner Name']}
</> status={[{ name: ["handleStatus", "Status"], data: decoration_status }]}
defaultValue={readyData}
onSubmit={ClickTitleSearch}
/>
<Table
loading={loading}
rowKey="id"
style={{ marginTop: 16 }}
dataSource={Data8.data.rows}
columns={columns}
pagination={{ defaultCurrent: 1, total: Data8.total }}
/>
</>
: null : null
} }
</div> </div>
); );
}; };
function map(state:any) { function map(state: any) {
const { Data8} = state[module] const { Data8 } = state[module]
return { Data8} return { Data8 }
} }
export default connect(map)(Renovation); export default connect(map)(Renovation);
...@@ -4,12 +4,7 @@ import { Form, Button, Modal, Space, Pagination, Tooltip, Checkbox } from 'antd' ...@@ -4,12 +4,7 @@ import { Form, Button, Modal, Space, Pagination, Tooltip, Checkbox } from 'antd'
import { Link, useIntl, connect, Dispatch } from 'umi'; import { Link, useIntl, connect, Dispatch } from 'umi';
import { PlusCircleOutlined } from '@ant-design/icons';
import Line from '../../../components/Line/Line'; 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 TagSelect from '../../../components/TagSelect/index';
import { RA } from '@/utils/method'; import { RA } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack'; import TitleBack from '@/components/TitleBack/TitleBack';
......
...@@ -146,7 +146,7 @@ export const filterObjbyTg = (obj: any, tg: any) => { ...@@ -146,7 +146,7 @@ export const filterObjbyTg = (obj: any, tg: any) => {
var tmp = {}; var tmp = {};
for (var item in obj) { for (var item in obj) {
if (tg.indexOf(item) > -1) { if (tg.indexOf(item) > -1) {
if (obj[item] != null) { if ((obj[item] === 0 || obj[item]) && obj[item] != null) {
tmp[item] = obj[item]; tmp[item] = obj[item];
} }
} }
......
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