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