Commit 1d108a9c authored by Sixiang_Zzb's avatar Sixiang_Zzb

装修申请模块bug处理

parent c66f055c
...@@ -23,7 +23,7 @@ const SearchOptionsCommnity = (props: any) => { ...@@ -23,7 +23,7 @@ const SearchOptionsCommnity = (props: any) => {
<> <>
{CommunityList != null ? ( {CommunityList != null ? (
// <SearchOptions // <SearchOptions
// titleSearch={titleSearch} // titleSearch={titleSearch}s
// disabled={disabled} // disabled={disabled}
// placeholder={placeholder} // placeholder={placeholder}
// defaultValue={props.defaultValue!=null?props.defaultValue:value} // defaultValue={props.defaultValue!=null?props.defaultValue:value}
......
...@@ -21,35 +21,35 @@ export default { ...@@ -21,35 +21,35 @@ export default {
}, },
reducers: { reducers: {
returnPage(state, { Data }) { returnPage(state: object, { Data }: any) {
return { ...state, Data }; return { ...state, Data };
}, },
returnDataSave(state, { DataSave }) { returnDataSave(state: object, { DataSave }: any) {
return { ...state, DataSave }; return { ...state, DataSave };
}, },
returnCurData(state, { CurData }) { returnCurData(state: object, { CurData }: any) {
return { ...state, CurData }; return { ...state, CurData };
}, },
returnCurDataDetail(state, { CurDataDetail }) { returnCurDataDetail(state: object, { CurDataDetail }: any) {
return { ...state, CurDataDetail }; return { ...state, CurDataDetail };
}, },
returnPage7(state, { Data7 }) { returnPage7(state: object, { Data7 }: any) {
return { ...state, Data7 }; return { ...state, Data7 };
}, },
returnPage8(state, { Data8 }) { returnPage8(state: object, { Data8 }: any) {
return { ...state, Data8 }; return { ...state, Data8 };
}, },
returnResult(state, { Result }) { returnResult(state: object, { Result }: any) {
return { ...state, Result }; return { ...state, Result };
}, },
returnDataSaveDetail(state, { DataSaveDetail }) { returnDataSaveDetail(state: object, { DataSaveDetail }: any) {
return { ...state, DataSaveDetail }; return { ...state, DataSaveDetail };
}, },
}, },
effects: { effects: {
//预订设施查询 //预订设施查询
*RA({ playload }, { call, put }) { *RA({ playload }: any, { call, put }: any) {
switch (playload.index) { switch (playload.index) {
case 40: case 40:
{ {
...@@ -119,6 +119,11 @@ export default { ...@@ -119,6 +119,11 @@ export default {
} }
break; break;
case 37: case 37:
{
let DataSaveDetail = resp;
yield put({ type: 'returnDataSaveDetail', DataSaveDetail });
}
break;
case 36: case 36:
{ {
let DataSaveDetail = resp; let DataSaveDetail = resp;
...@@ -135,50 +140,35 @@ export default { ...@@ -135,50 +140,35 @@ export default {
} }
}, },
// *TosCommunityServiceGetDetail({ playload }, { call, put }) { *SA({ playload }: any, { call, put }: any) {
// const resp = yield call(service.TosCommunityServiceGetDetail, playload);
// console.log(resp)
// if (resp.error_code !=0 ) {
// window.location.href = '/500';
// } else {
// 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,
// name: tmp.owerName,
// phone: tmp.owerPhone,
// email: tmp.owerEmail,
// content: resp.data.rows[0].serviceContent,
// status: tmp2.handleStatus,
// time:timestampToTime(tmp2.createTime.time)
// };
// yield put({ type: 'returnCurDataDetail', CurDataDetail, });
// }
// },
*SA({ playload }, { call, put }) {
var DataSave = playload; var DataSave = playload;
yield put({ type: 'returnDataSave', DataSave }); yield put({ type: 'returnDataSave', DataSave });
}, },
*setCurData({ playload }, { call, put }) { *setCurData({ playload }: any, { call, put }: any) {
var CurData = playload; var CurData = playload;
yield put({ type: 'returnCurData', CurData }); yield put({ type: 'returnCurData', CurData });
}, },
*setCurDataDetail({ playload }, { call, put }) { *setCurDataDetail({ playload }: any, { call, put }: any) {
var CurDataDetail = null; var CurDataDetail = null;
yield put({ type: 'returnCurDataDetail', CurDataDetail }); yield put({ type: 'returnCurDataDetail', CurDataDetail });
}, },
*ResultClear({}, { put }) { *ResultClear({}, { put }: any) {
var Result = null; var Result = null;
console.log('清除'); console.log('清除');
yield put({ type: 'returnResult', Result }); yield put({ type: 'returnResult', Result });
}, },
async DataSaveDetailClear({}, { put }: any) {
let DataSaveDetail = null;
await put({ type: 'returnDataSaveDetail', DataSaveDetail });
},
async DataSaveClear({}, { put }: any) {
let DataSave = null;
await put({ type: 'returnDataSave', DataSave });
},
}, },
}; };
...@@ -12,101 +12,137 @@ import TitleSearch from '../../components/TitleSearch/TitleSearch'; ...@@ -12,101 +12,137 @@ import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method'; import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
const module = 'CommunityService';
const module = "CommunityService"
const Card = (props: any) => { const Card = (props: any) => {
const { dispatch, Data7 } = props; const { dispatch, Data7 } = props;
const [readyData, setReadyData] = useState(null) const [readyData, setReadyData] = useState(null);
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false);
// const apply_status = [[0, "审核中"], [1, "批准"], [2, "拒绝"], [3, "领取"]] // const apply_status = [[0, "审核中"], [1, "批准"], [2, "拒绝"], [3, "领取"]]
const apply_status = [[0, "Under review"], [1, "Approval"], [2, "Reject"], [3, "Claim"]] const apply_status = [
[0, 'Under review'],
[1, 'Approval'],
[2, 'Reject'],
[3, 'Claim'],
];
const columns = objectColumns([ const columns = objectColumns([
["所在小区", "community_name"], ['Community Name', 'community_name'],
["所在单元", null, (text: any, record: any) => (<Space size="middle">{record.build_number + "#" + record.floor_number + "-" + record.room_number}</Space>)], [
["用户名", "community_owner"], 'Unit',
["申请时间", null, (text: any, record: any) => (<Space size="middle">{timestampToTime(record.create_time.time)}</Space>)], null,
["申请状态", "apply_status", (text: any, record: any) => (<Space size="middle">{apply_status[parseInt(text)][1]}</Space>)], (text: any, record: any) => (
["Actions", null, (text: any, record: any) => (<Space size="middle"> <a onClick={goToDetail.bind(this, record)}>Detail</a></Space>)], <Space size="middle">
]) {record.build_number + '#' + record.floor_number + '-' + record.room_number}
</Space>
),
],
['Community Owner', 'community_owner'],
[
'Apply Time',
null,
(text: any, record: any) => (
<Space size="middle">{timestampToTime(record.create_time.time)}</Space>
),
],
[
'Apply Status',
'apply_status',
(text: any, record: any) => <Space size="middle">{apply_status[parseInt(text)][1]}</Space>,
],
[
'Actions',
null,
(text: any, record: any) => (
<Space size="middle">
{' '}
<a onClick={goToDetail.bind(this, record)}>Detail</a>
</Space>
),
],
]);
useEffect(() => { useEffect(() => {
if (Data7 != null) { setLoading(false) } if (Data7 != null) {
setLoading(false);
}
}, [Data7]); }, [Data7]);
useEffect(() => { useEffect(() => {
//前置数据 //前置数据
console.log("前置数据"); console.log('前置数据');
let tmp: any = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName", "current"]) let tmp: any = filterObjbyTg(location.query, [
tmp.handleStatus = apply_status[parseInt(tmp.handleStatus)] //特殊处理 'handleStatus',
setReadyData(tmp) 'ownerName',
'communityName',
'current',
]);
tmp.handleStatus = apply_status[parseInt(tmp.handleStatus)]; //特殊处理
setReadyData(tmp);
//获取数据 //获取数据
setLoading(true) setLoading(true);
RA(31, { serviceType: "7", id: "" }, module, dispatch) RA(31, { serviceType: '7', id: '' }, module, dispatch);
}, []) }, []);
useEffect(() => { useEffect(() => {
if (Data7 != null) { if (Data7 != null) {
console.log("首页信息") console.log('首页信息');
console.log(Data7) console.log(Data7);
} }
}, [Data7]) }, [Data7]);
const goToDetail = (values: any, e: any) => { const goToDetail = (values: any, e: any) => {
SA(values, module, dispatch) SA(values, module, dispatch);
history.push('./AccessCardApplication/Detail') history.push('./AccessCardApplication/Detail');
} };
const goToAdd = (values: any, e: any) => { const goToAdd = (values: any, e: any) => {
history.push('./AccessCardApplication/Add') history.push('./AccessCardApplication/Add');
} };
//页面搜索 //页面搜索
const ClickTitleSearch = (comment: any) => { const ClickTitleSearch = (comment: any) => {
let tmp = filterObjbyTg(comment, ["handleStatus", "ownerName", "communityName"]) let tmp = filterObjbyTg(comment, ['handleStatus', 'ownerName', 'communityName']);
tmp["current"] = 1 tmp['current'] = 1;
console.log(tmp) console.log(tmp);
history.push(location.pathname + urlEncode(tmp)) history.push(location.pathname + urlEncode(tmp));
} };
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
{Data7 != null ? (
{ <>
Data7 != null ? <TitleSearch
<> communitySelect={true}
<TitleSearch listkey={['ownerName']}
communitySelect={true} list={['Owner Name']}
listkey={['ownerName']} status={[{ name: ['handleStatus', 'Status'], data: apply_status }]}
list={['Owner Name']} defaultValue={readyData}
status={[{ name: ["handleStatus", "Status"], data: apply_status }]} onSubmit={ClickTitleSearch}
defaultValue={readyData} />
onSubmit={ClickTitleSearch}
/> <div style={{ height: 80, position: 'relative' }}>
<div style={{ position: 'absolute', right: 0 }}>
<div style={{ height: 80, position: "relative" }}> <Button type="primary" onClick={goToAdd}>
<div style={{ position: "absolute", right: 0 }}> Apply Card
<Button type="primary" onClick={goToAdd}>Apply Card</Button> </Button>
</div>
</div> </div>
</div>
<Table loading={loading} rowKey="id" style={{ marginTop: 16 }}
dataSource={Data7.data.rows} <Table
columns={columns} loading={loading}
pagination={{ defaultCurrent: 1, total: Data7.total }} /> rowKey="id"
</> style={{ marginTop: 16 }}
: null dataSource={Data7.data.rows}
} columns={columns}
pagination={{ defaultCurrent: 1, total: Data7.total }}
/>
</>
) : null}
</div> </div>
); );
}; };
function map(state: any) { function map(state: any) {
const { Data7 } = state[module] const { Data7 } = state[module];
return { Data7 } return { Data7 };
} }
export default connect(map)(Card); export default connect(map)(Card);
This diff is collapsed.
...@@ -118,11 +118,9 @@ const PropertyServices = (props: any) => { ...@@ -118,11 +118,9 @@ const PropertyServices = (props: any) => {
40, 40,
{ {
serviceType: serviceType, serviceType: serviceType,
...tmp,
handleStatus: handleStatus:
location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null, location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null,
ownerName: location.query.ownerName != undefined ? location.query.ownerName : null,
communityName:
location.query.communityName != undefined ? location.query.communityName : null,
pageNum, pageNum,
}, },
module, module,
......
...@@ -11,6 +11,9 @@ import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method'; ...@@ -11,6 +11,9 @@ import { RA, SA, urlEncode, filterObj, filterObjbyTg } 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';
let pageNum: number = 1;
const Renovation = (props: any) => { const Renovation = (props: any) => {
// const decoration_status = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]] // const decoration_status = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]]
const decoration_status = [ const decoration_status = [
...@@ -18,17 +21,8 @@ const Renovation = (props: any) => { ...@@ -18,17 +21,8 @@ const Renovation = (props: any) => {
[1, 'Approved'], [1, 'Approved'],
[2, 'Rejected'], [2, 'Rejected'],
]; ];
const pathname = [
'CommunityMaintenance',
'ShelfLifeService',
'OwnerComplaints',
'ReportOnline',
'ProblemFeedback',
];
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [serviceTypeGobal, setServiceType] = useState('');
const [pageNum, setPageNum] = useState(1);
const [readyData, setReadyData] = useState(null); const [readyData, setReadyData] = useState(null);
const columns = objectColumns([ const columns = objectColumns([
...@@ -64,25 +58,34 @@ const Renovation = (props: any) => { ...@@ -64,25 +58,34 @@ const Renovation = (props: any) => {
]); ]);
const { dispatch, Data8, location } = props; const { dispatch, Data8, location } = props;
console.log(Data8);
useEffect(() => { useEffect(() => {
if (location != null) { //分页设置
//前置数据 if (location.query.pageNum != null) {
console.log('前置数据'); pageNum = parseInt(location.query.pageNum);
let tmp: any = filterObjbyTg(location.query, [ } else {
'handleStatus', pageNum = 1;
'ownerName',
'communityName',
'current',
]);
tmp.handleStatus = decoration_status[parseInt(tmp.handleStatus)]; //特殊处理
setReadyData(tmp);
//获取数据
setLoading(true);
RA(23, { serviceType: '6', id: '' }, module, dispatch);
} }
//前置数据
console.log('前置数据');
let tmp: any = filterObjbyTg(location.query, ['handleStatus', 'applyforName', 'communityName']);
tmp.handleStatus = decoration_status[parseInt(tmp.handleStatus)]; //特殊处理
setReadyData(tmp);
//获取数据
setLoading(true);
RA(
23,
{
...tmp,
handleStatus:
location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null,
pageNum,
},
module,
dispatch,
);
}, [location]); }, [location]);
useEffect(() => { useEffect(() => {
...@@ -93,14 +96,21 @@ const Renovation = (props: any) => { ...@@ -93,14 +96,21 @@ const Renovation = (props: any) => {
//页面搜索 //页面搜索
const ClickTitleSearch = (comment: any) => { const ClickTitleSearch = (comment: any) => {
let tmp = filterObjbyTg(comment, ['handleStatus', 'ownerName', 'communityName']); let tmp = filterObjbyTg(comment, ['handleStatus', 'applyforName', 'communityName']);
tmp['current'] = 1; pageNum = 1;
history.push(location.pathname + urlEncode(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?id=' + values.id);
};
const PageChange = (values: any) => {
//页面跳转参数
var tmp = filterObjbyTg(location.query, ['handleStatus', 'ownerName', 'communityName']);
tmp['pageNum'] = values.current;
history.push(location.pathname + urlEncode(tmp));
}; };
return ( return (
<div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}> <div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
...@@ -108,7 +118,7 @@ const Renovation = (props: any) => { ...@@ -108,7 +118,7 @@ const Renovation = (props: any) => {
<> <>
<TitleSearch <TitleSearch
communitySelect={true} communitySelect={true}
listkey={['ownerName']} listkey={['applyforName']}
list={['Owner Name']} list={['Owner Name']}
status={[{ name: ['handleStatus', 'Status'], data: decoration_status }]} status={[{ name: ['handleStatus', 'Status'], data: decoration_status }]}
defaultValue={readyData} defaultValue={readyData}
...@@ -120,7 +130,13 @@ const Renovation = (props: any) => { ...@@ -120,7 +130,13 @@ const Renovation = (props: any) => {
style={{ marginTop: 16 }} style={{ marginTop: 16 }}
dataSource={Data8.data.rows} dataSource={Data8.data.rows}
columns={columns} columns={columns}
pagination={{ defaultCurrent: 1, total: Data8.total }} onChange={PageChange}
pagination={{
current: pageNum,
defaultPageSize: 15,
total: Data8.data.page.totalRow,
showSizeChanger: false,
}}
/> />
</> </>
) : null} ) : null}
......
...@@ -2,133 +2,140 @@ ...@@ -2,133 +2,140 @@
//基石 //基石
.base { .base {
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
padding: 34px; padding: 34px;
min-width: 1020px; min-width: 1020px;
overflow-x:auto overflow-x: auto;
} }
//边栏1 //边栏1
.box{ .box {
width: 100%; width: 100%;
height: 64px; height: 64px;
position: relative; position: relative;
} }
.item1{ .item1 {
position: absolute; position: absolute;
width: 180px; width: 180px;
text-align: center; text-align: center;
border-left: 5px solid rgba(24,144,255,1); border-left: 5px solid rgba(24, 144, 255, 1);
font-family:'Source Han Sans CN'; font-family: 'Source Han Sans CN';
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #000000; color: #000000;
}
.item2 {
width: 300px;
position: absolute;
left: (180px+36px);
line-height: 30px;
}
.item3 {
width: 80px;
height: 32px;
position: absolute;
right: 0;
} outline: none;
.item2{ background: none;
width:300px; cursor: pointer;
position: absolute;
left: (180px+36px);
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: 1px solid rgba(217, 217, 217, 1);
border-radius:2px; border-radius: 2px;
} }
.box2{ .box2 {
width: 100%; width: 100%;
height: 80px; height: 130px;
text-align: center; text-align: center;
position: relative; position: relative;
} }
.item21{ .item21 {
line-height: 32px; line-height: 32px;
width: 200px; width: 200px;
position: absolute; position: absolute;
} }
.item22{ .item22 {
line-height: 32px; line-height: 32px;
position: absolute; position: absolute;
left: 200px; left: 200px;
width: 200px; width: 200px;
height: 32px; height: 32px;
border:1px solid rgba(217,217,217,1); border: 1px solid rgba(217, 217, 217, 1);
border-radius:2px; border-radius: 2px;
}
} .item23 {
.item23{ line-height: 32px;
line-height: 32px; position: absolute;
position: absolute; left: 416px;
left: 416px; border: 1px solid rgba(217, 217, 217, 1);
border:1px solid rgba(217,217,217,1); border-radius: 2px;
border-radius:2px; width: 140px;
width: 94px; height: 32px;
height: 32px; }
} .item234 {
.item234{ line-height: 32px;
line-height: 32px; height: 32px;
height: 32px; position: absolute;
position: absolute; left: 665px;
left: 514px; }
.item24 {
} line-height: 32px;
.item24{ border: 1px solid rgba(217, 217, 217, 1);
line-height: 32px; border-radius: 2px;
border:1px solid rgba(217,217,217,1); position: absolute;
border-radius:2px; left: 580px;
position: absolute; width: 80px;
left: 529px; height: 32px;
width: 80px; }
height: 32px; .item245 {
} line-height: 32px;
.item245{ position: absolute;
line-height: 32px; left: 766px;
position: absolute; }
left: 609px; .item25 {
} line-height: 32px;
.item25{ width: 80px;
line-height: 32px; height: 32px;
width: 112px; border: 1px solid rgba(217, 217, 217, 1);
height: 32px; border-radius: 2px;
border:1px solid rgba(217,217,217,1); position: absolute;
border-radius:2px; left: 680px;
position: absolute; }
left: 640px; .item26 {
} width: 80px;
.item26{ height: 32px;
width: 200px; line-height: 32px;
height: 32px; border: 1px solid rgba(217, 217, 217, 1);
line-height: 32px; border-radius: 2px;
border:1px solid rgba(217,217,217,1); position: absolute;
border-radius:2px; left: 800px;
position: absolute; }
left: 780px; .item27 {
width: 200px;
height: 32px;
line-height: 32px;
border: 1px solid rgba(217, 217, 217, 1);
border-radius: 2px;
position: absolute;
left: 200px;
top: 55px;
} }
.box3out{ .box3out {
padding-left: 200px; padding-left: 200px;
} }
.box3{ .box3 {
width: 780px; width: 780px;
border:1px solid rgba(217,217,217,1); border: 1px solid rgba(217, 217, 217, 1);
background-color: rgba(244,244,244,1); background-color: rgba(244, 244, 244, 1);
cursor: pointer; cursor: pointer;
overflow: auto; overflow: auto;
} }
.box3of{ .box3of {
cursor: pointer; cursor: pointer;
} }
.box4{ .box4 {
padding-left: 200px; padding-left: 200px;
} }
...@@ -38,10 +38,11 @@ const ChargeDetail = (props: any) => { ...@@ -38,10 +38,11 @@ const ChargeDetail = (props: any) => {
const pageChange = (curpage: any) => { const pageChange = (curpage: any) => {
setCurpage(curpage); setCurpage(curpage);
}; };
const goToReturn = () => {
if (!CurData) {
history.back(); history.back();
}; }
console.log(CurData);
return ( return (
<div className={styles.base}> <div className={styles.base}>
{CurData ? ( {CurData ? (
...@@ -53,18 +54,19 @@ const ChargeDetail = (props: any) => { ...@@ -53,18 +54,19 @@ const ChargeDetail = (props: any) => {
<div className={styles.box2}> <div className={styles.box2}>
<div className={styles.item21}>Project (community)</div> <div className={styles.item21}>Project (community)</div>
<div className={styles.item22}>{CurData.billName}</div> <div className={styles.item22}>{CurData.communityName}</div>
<div className={styles.item23}>{CurData.communityName}</div> <div className={styles.item23}>Street name</div>
<div className={styles.item24}>{CurData.floorNumber}</div> <div className={styles.item24}>{CurData.buildingNumber}</div>
<div className={styles.item234}>#</div> <div className={styles.item234}>#</div>
<div className={styles.item25}>{CurData.roomNumber}</div> <div className={styles.item25}>{CurData.floorNumber}</div>
<div className={styles.item245}>——</div> <div className={styles.item245}>——</div>
<div className={styles.item26}>{CurData.tosOwnerName}</div> <div className={styles.item26}>{CurData.roomNumber}</div>
<div className={styles.item27}>业主姓名</div>
</div> </div>
<>{stringSplit(CurData.billFileUrl, 'm/cash')}</> {/* <>{stringSplit(CurData.billFileUrl, 'm/cash')}</> */}
<div className={styles.box4}> {/* <div className={styles.box4}>
<Pagination simple defaultCurrent={curpage} total={pages * 10} onChange={pageChange} /> <Pagination simple defaultCurrent={curpage} total={pages * 10} onChange={pageChange} />
</div> </div> */}
<> <>
<Tooltip title={scale == 1.3 ? '点击放大查看' : '还原视图'}> <Tooltip title={scale == 1.3 ? '点击放大查看' : '还原视图'}>
<div className={scale == 1.3 ? styles.box3out : null}> <div className={scale == 1.3 ? styles.box3out : null}>
......
...@@ -5,7 +5,6 @@ import { Input, Menu, Table, Space } from 'antd'; ...@@ -5,7 +5,6 @@ import { Input, Menu, Table, Space } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi'; import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { timestampToTime } from '../../utils/time'; import { timestampToTime } from '../../utils/time';
import { values } from 'lodash'; import { values } from 'lodash';
...@@ -14,48 +13,51 @@ const ChargeManager = (props: any) => { ...@@ -14,48 +13,51 @@ const ChargeManager = (props: any) => {
const { formatMessage } = useIntl(); const { formatMessage } = useIntl();
const { dispatch, location, Data } = props; const { dispatch, location, Data } = props;
const get = (values: any) => { dispatch({ type: 'PropertyManagement/get', playload: values }) }; const get = (values: any) => {
const getById = (values: any) => { dispatch({ type: 'PropertyManagement/getById', playload: values }) }; dispatch({ type: 'PropertyManagement/get', playload: values });
};
const getById = (values: any) => {
dispatch({ type: 'PropertyManagement/getById', playload: values });
};
useEffect(() => { useEffect(() => {
get(null) get(null);
}, []); }, []);
const nameofowner = formatMessage({ id: 'R.charge.input.nameofowner' });
const nameofowner = formatMessage({ id: 'R.charge.input.nameofowner' }) const inputProject = formatMessage({ id: 'R.charge.input.project' });
const inputProject = formatMessage({ id: 'R.charge.input.project' }) const username = formatMessage({ id: 'R.charge.username' });
const username = formatMessage({ id: 'R.charge.username' }) const project = formatMessage({ id: 'R.charge.project' });
const project = formatMessage({ id: 'R.charge.project' }) const unit = formatMessage({ id: 'R.charge.unit' });
const unit = formatMessage({ id: 'R.charge.unit' }) const status = formatMessage({ id: 'R.charge.status' });
const status = formatMessage({ id: 'R.charge.status' }) const submissionTime = formatMessage({ id: 'R.charge.submissionTime' });
const submissionTime = formatMessage({ id: 'R.charge.submissionTime' }) const actions = formatMessage({ id: 'R.charge.actions' });
const actions = formatMessage({ id: 'R.charge.actions' }) const search = formatMessage({ id: 'R.charge.search' });
const search = formatMessage({ id: 'R.charge.search' }) const addaccount = formatMessage({ id: 'R.charge.addaccount' });
const addaccount = formatMessage({ id: 'R.charge.addaccount' }) const paymentsetting = formatMessage({ id: 'R.charge.paymentsetting' });
const paymentsetting = formatMessage({ id: 'R.charge.paymentsetting' })
const menuListNormal = ['A', 'Accounting company'];
const menuListNormal = ["A", 'Accounting company'] const [display, setDisplay] = useState('A'); //小组件:线框
const [display, setDisplay] = useState("A");//小组件:线框
const pagination = {
const pagination = { defaultCurrent: 1, total: 16 } defaultCurrent: 15,
total: 16,
};
const goToDetail = (values: any) => { const goToDetail = (values: any) => {
getById(values) getById(values);
history.push('/PropertyManagementDetail') history.push('/PropertyManagementDetail');
} };
const goToAddAccout = () => { const goToAddAccout = () => {
history.push(location.pathname + '/AccoutingDetail') history.push(location.pathname + '/AccoutingDetail');
} };
const columns = [ const columns = [
{ title: username, dataIndex: 'tosOwnerName' }, { title: username, dataIndex: 'tosOwnerName' },
{ title: project, dataIndex: 'communityName' }, { title: project, dataIndex: 'communityName' },
{ title: unit, dataIndex: 'buildingNumber' }, { title: unit, dataIndex: 'buildingNumber' },
{ title: status, dataIndex: 'enable' },
{ {
title: submissionTime, title: submissionTime,
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space size="middle"> <Space size="middle">{timestampToTime(record.createTime.time)}</Space>
{timestampToTime(record.createTime.time)}
</Space>
), ),
}, },
{ {
...@@ -68,28 +70,45 @@ const ChargeManager = (props: any) => { ...@@ -68,28 +70,45 @@ const ChargeManager = (props: any) => {
}, },
]; ];
const TitleSearchContent = (comment: any) => { const TitleSearchContent = (comment: any) => {
console.log(comment) console.log(comment);
} };
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleSearch
<TitleSearch listkey={['tosOwnerName', 'communityName']} list={['tosOwnerName', 'communityName']} onSubmit={TitleSearchContent} /> listkey={['tosOwnerName', 'communityName']}
list={['tosOwnerName', 'communityName']}
onSubmit={TitleSearchContent}
/>
{/* 内容组件 */} {/* 内容组件 */}
<div className={styles.box2}> <div className={styles.box2}>
{ {menuListNormal.map((item, index) => {
menuListNormal.map((item, index) => { return (
return (<button key={"bt" + index} className={display == item ? styles.buttonChoose : styles.buttonWait} onClick={() => { setDisplay(item) }}>{item}</button>) <button
}) key={'bt' + index}
} className={display == item ? styles.buttonChoose : styles.buttonWait}
<button className={styles.buttonAdd2} onClick={goToAddAccout}>+ {addaccount} </button> onClick={() => {
<button className={styles.buttonAdd} >{paymentsetting}</button> setDisplay(item);
}}
>
{item}
</button>
);
})}
<button className={styles.buttonAdd2} onClick={goToAddAccout}>
+ {addaccount}{' '}
</button>
<button className={styles.buttonAdd}>{paymentsetting}</button>
</div> </div>
{/* 列表组件 */} {/* 列表组件 */}
<Table style={{ marginTop: 16 }} rowKey={"id"} dataSource={Data} columns={columns} pagination={pagination} /> <Table
style={{ marginTop: 16 }}
rowKey={'id'}
dataSource={Data}
columns={columns}
pagination={pagination}
/>
</div> </div>
); );
}; };
...@@ -97,7 +116,7 @@ const ChargeManager = (props: any) => { ...@@ -97,7 +116,7 @@ const ChargeManager = (props: any) => {
function mapStateToProps(state: any) { function mapStateToProps(state: any) {
const { Data } = state.PropertyManagement; const { Data } = state.PropertyManagement;
return { return {
Data Data,
}; };
} }
export default connect(mapStateToProps)(ChargeManager); export default connect(mapStateToProps)(ChargeManager);
...@@ -7,58 +7,61 @@ import { Link, useIntl, connect, Dispatch } from 'umi'; ...@@ -7,58 +7,61 @@ import { Link, useIntl, connect, Dispatch } from 'umi';
import Line from '../../../components/Line/Line'; import Line from '../../../components/Line/Line';
import TitleBack from '../../../components/TitleBack/TitleBack'; import TitleBack from '../../../components/TitleBack/TitleBack';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { checkParam, RA } from '../../../utils/method' import { checkParam, RA } from '../../../utils/method';
import { validateMessages } from '@/utils/params'; import { validateMessages } from '@/utils/params';
// import "./UsersAddInput.less" // import "./UsersAddInput.less"
const module = 'User';
const module = "User"
const UsersAdd = (props: any) => { const UsersAdd = (props: any) => {
const { dispatch, communityInfo } = props; const { dispatch, communityInfo } = props;
const [postman, setPostman] = useState({ extend: null }) const [postman, setPostman] = useState({ extend: null });
const formRef = useRef(null as any); const formRef = useRef(null as any);
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false);
const onFinish = (values: any) => { const onFinish = (values: any) => {
console.log(values) console.log(values);
if (postman.extend != null) { if (postman.extend != null) {
values.communityName = postman.extend values.communityName = postman.extend;
} else { } else {
values.communityName = null values.communityName = null;
} }
// var tmp = Object.keys(values); // var tmp = Object.keys(values);
if (checkParam(values)) { if (checkParam(values)) {
values.owerPhone = null values.owerPhone = null;
values.owerEmail = null values.owerEmail = null;
RA(14, values, module, dispatch) RA(14, values, module, dispatch);
setLoading(true) setLoading(true);
} else { } else {
setLoading(false) setLoading(false);
message.error("Error,Please finish it,not empty!", 3) message.error('Error,Please finish it,not empty!', 3);
} }
};
}
const extendName = (values: any) => { const extendName = (values: any) => {
var tmp = postman var tmp = postman;
tmp.extend = values tmp.extend = values;
RA(32, { communityName: values }, module, dispatch); RA(32, { communityName: values }, module, dispatch);
setPostman(tmp) setPostman(tmp);
} };
useEffect(() => { useEffect(() => {
console.log(communityInfo);
if (communityInfo != null) { if (communityInfo != null) {
console.log(communityInfo) console.log(communityInfo);
if (postman.extend != null) { if (postman.extend != null) {
formRef.current.setFieldsValue({ addressAndpostalCode: communityInfo.data.rows[0].residentialAddress + " SINGAPORE" + communityInfo.data.rows[0].residentialZipCode }) formRef.current.setFieldsValue({
addressAndpostalCode:
communityInfo.data.rows[0].residentialAddress +
' SINGAPORE' +
communityInfo.data.rows[0].residentialZipCode,
});
} }
} }
}, [communityInfo]) }, [communityInfo]);
const checkData = (rule: any, value: any, callback: any) => { const checkData = (rule: any, value: any, callback: any) => {
console.log(rule, value) console.log(rule, value);
if (value) { if (value) {
if (/^[a-zA-Z0-9]+$/g.test(value)) { if (/^[a-zA-Z0-9]+$/g.test(value)) {
callback(); callback();
...@@ -70,14 +73,17 @@ const UsersAdd = (props: any) => { ...@@ -70,14 +73,17 @@ const UsersAdd = (props: any) => {
}; };
return ( return (
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件 */} {/* 头部组件 */}
<TitleBack title={"Create New Owner"} /> <TitleBack title={'Create New Owner'} />
<Spin spinning={loading}> <Spin spinning={loading}>
<Form ref={formRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}> <Form ref={formRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}>
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Owner's Name</div> <div className={styles.box1item1}>Owner's Name</div>
<div className={styles.box1item2}><Form.Item name="owerName" rules={[{ required: true, min: 2, max: 30 }]} ><Input placeholder="Ower Name" /></Form.Item></div> <div className={styles.box1item2}>
<Form.Item name="owerName" rules={[{ required: true, min: 2, max: 30 }]}>
<Input placeholder="Ower Name" />
</Form.Item>
</div>
</div> </div>
{/* <div className={styles.box4}> {/* <div className={styles.box4}>
...@@ -88,24 +94,47 @@ const UsersAdd = (props: any) => { ...@@ -88,24 +94,47 @@ const UsersAdd = (props: any) => {
<div className={styles.box2}> <div className={styles.box2}>
<div className={styles.box2item1}>Contact Details</div> <div className={styles.box2item1}>Contact Details</div>
<div className={styles.box2item2}><SearchOptionsCommnity alone={true} onSubmit={extendName} /></div> <div className={styles.box2item2}>
<div className={styles.box2item3}><Form.Item name="buildingNumber" rules={[{ validator: checkData }]}><Input placeholder="Building" style={{ width: 94 }} /></Form.Item></div> <SearchOptionsCommnity alone={true} opname={extendName} />
</div>
<div className={styles.box2item3}>
<Form.Item name="buildingNumber" rules={[{ validator: checkData }]}>
<Input placeholder="Building" style={{ width: 94 }} />
</Form.Item>
</div>
<div className={styles.box2item4}>#</div> <div className={styles.box2item4}>#</div>
<div className={styles.box2item5}><Form.Item name="floorNumber" rules={[{ validator: checkData }]}><Input placeholder="Floor" style={{ width: 80 }} /></Form.Item></div> <div className={styles.box2item5}>
<Form.Item name="floorNumber" rules={[{ validator: checkData }]}>
<Input placeholder="Floor" style={{ width: 80 }} />
</Form.Item>
</div>
<div className={styles.box2item6}>——</div> <div className={styles.box2item6}>——</div>
<div className={styles.box2item7}><Form.Item name="roomNumber" rules={[{ validator: checkData }]}><Input placeholder="Room" style={{ width: 112 }} /></Form.Item></div> <div className={styles.box2item7}>
<Form.Item name="roomNumber" rules={[{ validator: checkData }]}>
<Input placeholder="Room" style={{ width: 112 }} />
</Form.Item>
</div>
</div> </div>
<div className={styles.box3}> <div className={styles.box3}>
<div className={styles.box3item1}> <div className={styles.box3item1}>
<Form.Item name="addressAndpostalCode"><Input style={{ width: 680 }} disabled placeholder="Display the address and postcode automatically according to the" /></Form.Item> <Form.Item name="addressAndpostalCode">
<Input
style={{ width: 680 }}
disabled
placeholder="Display the address and postcode automatically according to the"
/>
</Form.Item>
</div> </div>
</div> </div>
<Line /> <Line />
<Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item> <Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Form> </Form>
</Spin> </Spin>
</div> </div>
); );
}; };
...@@ -126,4 +155,4 @@ export default connect(mapStateToProps)(UsersAdd); ...@@ -126,4 +155,4 @@ export default connect(mapStateToProps)(UsersAdd);
// "buildingNumber":"A1", // "buildingNumber":"A1",
// "floorNumber":"11", // "floorNumber":"11",
// "roomNumber":"388", // "roomNumber":"388",
// "addressAndpostalCode":"工业大道3689561" // "addressAndpostalCode":"工业大道3689561"
\ No newline at end of file
...@@ -79,6 +79,12 @@ export const DataClear = (module: string, dispatch: any) => { ...@@ -79,6 +79,12 @@ export const DataClear = (module: string, dispatch: any) => {
export const ResultClear = (module: any, dispatch: any) => { export const ResultClear = (module: any, dispatch: any) => {
dispatch({ type: module + '/ResultClear' }); dispatch({ type: module + '/ResultClear' });
}; };
export const DataSaveDetailClear = (module: any, dispatch: any) => {
dispatch({ type: module + '/DataSaveDetailClear' });
};
export const DataSaveClear = (module: any, dispatch: any) => {
dispatch({ type: module + '/DataSaveClear' });
};
// const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]] // const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
// const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }] // const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }]
export const Fromate = (values: any, reg: any) => { export const Fromate = (values: any, reg: any) => {
......
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