Commit 796c5e14 authored by cellee's avatar cellee

bug 修复

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 0c4521f1
...@@ -16,7 +16,7 @@ export default { ...@@ -16,7 +16,7 @@ export default {
DataSave: null, DataSave: null,
detailData: {}, // 详情 detailData: {}, // 详情
imgUrl: null, // 预览地址 imgUrl: null, // 预览地址
village: {}, // 小区列表 village: null, // 小区列表
overCom: null, overCom: null,
}, },
......
...@@ -55,6 +55,11 @@ const Account = (props: any) => { ...@@ -55,6 +55,11 @@ const Account = (props: any) => {
RA(51, obj); RA(51, obj);
}; };
// 列表刷新加载
const Refresh2 = () => {
RA(51, term);
};
// 表头 // 表头
const columns = [ const columns = [
{ {
...@@ -181,6 +186,7 @@ const Account = (props: any) => { ...@@ -181,6 +186,7 @@ const Account = (props: any) => {
const onFinishContract = (value: any) => { const onFinishContract = (value: any) => {
if (value.tosUserName || value.creatorName) { if (value.tosUserName || value.creatorName) {
let t = { ...term, ...value }; let t = { ...term, ...value };
delete t.pageNum; // 搜索的时候 删除页码 delete t.pageNum; // 搜索的时候 删除页码
setTerm(t); setTerm(t);
RA(51, t); RA(51, t);
...@@ -273,7 +279,7 @@ const Account = (props: any) => { ...@@ -273,7 +279,7 @@ const Account = (props: any) => {
density: false, density: false,
fullScreen: false, fullScreen: false,
reload: () => { reload: () => {
Refresh(); Refresh2();
}, },
setting: false, setting: false,
}} }}
......
...@@ -276,7 +276,7 @@ const Account = (props: any) => { ...@@ -276,7 +276,7 @@ const Account = (props: any) => {
<Descriptions column={{ xs: 1, sm: 2, md: 3 }}> <Descriptions column={{ xs: 1, sm: 2, md: 3 }}>
<Descriptions.Item> <Descriptions.Item>
<Form.Item name="tosUserName" label="Account ID" rules={AccountTip[0]}> <Form.Item name="tosUserName" label="Account ID" rules={AccountTip[0]}>
<Input placeholder="Login Account" className="input" /> <Input placeholder="Login Account" className="input" disabled />
</Form.Item> </Form.Item>
</Descriptions.Item> </Descriptions.Item>
</Descriptions> </Descriptions>
......
...@@ -60,6 +60,8 @@ const CellLists = (props: any) => { ...@@ -60,6 +60,8 @@ const CellLists = (props: any) => {
const { dispatch, Data, loading, curString, village } = props; const { dispatch, Data, loading, curString, village } = props;
const [term, setTerm] = useState({} as any); // 拉取数据的条件存储
// 翻页数据 // 翻页数据
function pagesList(name: string, list: any, num: number) { function pagesList(name: string, list: any, num: number) {
let msg = { let msg = {
...@@ -70,23 +72,33 @@ const CellLists = (props: any) => { ...@@ -70,23 +72,33 @@ const CellLists = (props: any) => {
return msg; return msg;
} }
// 先请求一次 拿到所有小区列表 // 监听是否有小区列表
useEffect(() => { useEffect(() => {
if (Data != null) {
let obj = {
residentialManagerUserName: '',
communityNameList: Data.communityList,
pageNum: 1,
};
setTerm(obj); // 存进搜索条件
} else {
RA(24, { communityName: '' }, module, dispatch); RA(24, { communityName: '' }, module, dispatch);
}, [1]); }
}, [Data]);
// 监听data请求完毕再请求一次 // 监听是否有数据
useEffect(() => { useEffect(() => {
if (Data != null) { if (village == null) {
RA(48, pagesList('', Data.communityList, 1), module, dispatch); console.log(term);
RA(48, term, module, dispatch);
} }
}, [Data]); }, [village]);
const CallbackSearch = (values: any) => { const CallbackSearch = (values: any) => {
RA(24, { communityName: values }, module, dispatch); RA(24, { communityName: values }, module, dispatch);
}; };
const goToAdd = () => { const goToAdd = () => {
SA('', module, dispatch); // 清空之前传递的数据 SA(null, module, dispatch); // 清空之前传递的数据
history.push('/CommunityManagement/CellList/Add'); history.push('/CommunityManagement/CellList/Add');
}; };
const goToEdit = (values: any, e: any) => { const goToEdit = (values: any, e: any) => {
...@@ -105,7 +117,14 @@ const CellLists = (props: any) => { ...@@ -105,7 +117,14 @@ const CellLists = (props: any) => {
const CallBackTitleSearch = (comment: any) => { const CallBackTitleSearch = (comment: any) => {
console.log(comment); console.log(comment);
if (comment.communityName.length > 0 || typeof comment.label !== 'undefined') { if (comment.communityName.length > 0 || typeof comment.label !== 'undefined') {
RA(48, pagesList(comment.label, comment.communityName, 1), module, dispatch); let obj = {
residentialManagerUserName: comment.label,
communityNameList: comment.communityName,
pageNum: 1,
};
setTerm(obj); // 存进搜索条件
RA(48, obj, module, dispatch);
} else { } else {
message.error('Please Enter And Select A Content To Search!'); message.error('Please Enter And Select A Content To Search!');
} }
...@@ -113,12 +132,17 @@ const CellLists = (props: any) => { ...@@ -113,12 +132,17 @@ const CellLists = (props: any) => {
// 点击页面属性传参数 // 点击页面属性传参数
const paginationHandler = (page: number, pageSize?: number) => { const paginationHandler = (page: number, pageSize?: number) => {
RA(48, pagesList('', Data.communityList, page), module, dispatch); let p = {
pageNum: page,
};
let t = { ...term, ...p };
setTerm(t);
RA(48, t, module, dispatch);
}; };
// 刷新 // 刷新
const resetHandler = () => { const resetHandler = () => {
RA(48, pagesList('', Data.communityList, 1), module, dispatch); RA(48, term, module, dispatch);
}; };
return ( return (
...@@ -174,7 +198,7 @@ const CellLists = (props: any) => { ...@@ -174,7 +198,7 @@ const CellLists = (props: any) => {
)} )}
</> </>
) : ( ) : (
'暂无数据' ''
)} )}
</div> </div>
); );
......
...@@ -35,7 +35,7 @@ const Detail = (props: any) => { ...@@ -35,7 +35,7 @@ const Detail = (props: any) => {
// 返回列表 // 返回列表
RA(32, { id: DataSave.id }, module, dispatch); RA(32, { id: DataSave.id }, module, dispatch);
} else { } else {
console.log('这应该返回列表'); history.push('/CommunityManagement/CellList');
} }
}, [1]); }, [1]);
......
...@@ -108,6 +108,10 @@ const Add = (props: any) => { ...@@ -108,6 +108,10 @@ const Add = (props: any) => {
// 提交 // 提交
const onFinish = (values: any) => { const onFinish = (values: any) => {
if (values.community.value.length == 0) {
message.error('Please select community!');
return false;
}
var tmp = values; var tmp = values;
if (DataSave != null) { if (DataSave != null) {
tmp.id = DataSave.id; // 如果是修改传递的 修改ID tmp.id = DataSave.id; // 如果是修改传递的 修改ID
...@@ -121,7 +125,7 @@ const Add = (props: any) => { ...@@ -121,7 +125,7 @@ const Add = (props: any) => {
tmp.noticEndTime = values.noticEndTime ? values.noticEndTime.format('YYYY-MM-DD') : null; tmp.noticEndTime = values.noticEndTime ? values.noticEndTime.format('YYYY-MM-DD') : null;
delete tmp.community; delete tmp.community;
delete tmp.file; delete tmp.file;
RA(28, tmp, module, dispatch); // RA(28, tmp, module, dispatch);
}; };
// 设置之前时间不能选择 // 设置之前时间不能选择
......
...@@ -159,12 +159,12 @@ const BookingDetail = (props: any) => { ...@@ -159,12 +159,12 @@ const BookingDetail = (props: any) => {
{DataSave.facilityTitle} {DataSave.facilityTitle}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="Booking Time"> <Descriptions.Item label="Booking Time">
{DataSave.subscribeDate}-{DataSave.subscribeTime} {DataSave.subscribeDate} {DataSave.subscribeTime}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="User Name">{DataSave.accountName}</Descriptions.Item> <Descriptions.Item label="User Name">{DataSave.accountName}</Descriptions.Item>
<Descriptions.Item label="Contact Number">{DataSave.accountPhone}</Descriptions.Item> <Descriptions.Item label="Contact Number">{DataSave.accountPhone}</Descriptions.Item>
<Descriptions.Item label="Unit"> <Descriptions.Item label="Unit">
{DataSave.buildNumber} # {DataSave.floorNumber}-{DataSave.roomNumber} {DataSave.buildNumber} #{DataSave.floorNumber}-{DataSave.roomNumber}
</Descriptions.Item> </Descriptions.Item>
</Descriptions> </Descriptions>
......
...@@ -110,28 +110,40 @@ const Contract = (props: any) => { ...@@ -110,28 +110,40 @@ const Contract = (props: any) => {
// 页面切换 // 页面切换
const paginationHandler = (page: number, pageSize?: number) => { const paginationHandler = (page: number, pageSize?: number) => {
let obj = { let p = {
pageNum: page, pageNum: page,
}; };
RA(19, obj); let t = { ...term, ...p };
setTerm(t);
RA(19, t);
}; };
const [term, setTerm] = useState({} as any); // 拉取数据的条件存储
// 重置 // 重置
const onReset = () => { const onReset = () => {
form.resetFields(); form.resetFields();
let obj = { let obj = {
pageNum: 1, pageNum: 1,
}; };
setTerm(obj);
RA(19, obj); RA(19, obj);
}; };
// 刷新
const onReset2 = () => {
RA(19, term);
};
// 表单提交 // 表单提交
const onFinishContract = (value: any) => { const onFinishContract = (value: any) => {
if (!value.communityName && !value.contractNumber && !value.contractTitle) { if (!value.communityName && !value.contractNumber && !value.contractTitle) {
message.error('Please enter one of them!'); message.error('Please enter one of them!');
} else { } else {
value.pageNum = 1; value.pageNum = 1;
RA(19, value); let t = { ...term, ...value };
setTerm(t);
RA(19, t);
} }
}; };
...@@ -207,7 +219,7 @@ const Contract = (props: any) => { ...@@ -207,7 +219,7 @@ const Contract = (props: any) => {
density: false, density: false,
fullScreen: false, fullScreen: false,
reload: () => { reload: () => {
onReset(); onReset2();
}, },
setting: false, setting: false,
}} }}
......
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