Commit c66f055c authored by Sixiang_Zzb's avatar Sixiang_Zzb

小区保养列表显示 bug处理

parent 0837b343
......@@ -13,7 +13,6 @@ const SearchOptionsTow = (porps: any) => {
// console.log(`selected ${value}`);
extendName(value);
}
console.log(def);
return (
<div>
<Select
......
......@@ -2,7 +2,7 @@ import * as service from '@/services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
import { routerRedux } from 'dva/router';
import { timestampToTime, timestampToTime4 } from '@/utils/time';
import { picFromate, Fromate } from '@/utils/method';
......@@ -11,13 +11,13 @@ export default {
namespace: 'CommunityService',
state: {
Data: null,
DataSave:null,
DataSave: null,
CurData: null,
CurDataDetail: null,
Data7: null,
Data8: null,
Result: null,
DataSaveDetail:null,
DataSaveDetail: null,
},
reducers: {
......@@ -25,7 +25,7 @@ export default {
return { ...state, Data };
},
returnDataSave(state, { DataSave }) {
return { ...state, DataSave }
return { ...state, DataSave };
},
returnCurData(state, { CurData }) {
return { ...state, CurData };
......@@ -45,86 +45,94 @@ export default {
returnDataSaveDetail(state, { DataSaveDetail }) {
return { ...state, DataSaveDetail };
},
},
effects: {
//预订设施查询
*RA({ playload }, { call, put }) {
switch (playload.index) {
case 40: {
var Data = null
yield put({ type: 'returnPage', Data});
} break;
case 40:
{
var Data = null;
yield put({ type: 'returnPage', Data });
}
break;
}
const resp = yield call(service.RA, playload);
console.log(resp)
if (resp.code == 500||resp.error_code!="0000") {
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)
if (resp.error_code != '0000') {
console.log('请求错误码:' + '(' + playload.index + ')' + resp.error_code);
console.log(playload);
} else {
switch (playload.index) {
case 21:
{
var tmp = resp.data.rows[0].tosOwerModel;
var tmp2 = resp.data.rows[0];
console.log(resp.data.rows[0].replyImgUrl)
console.log(Fromate(resp.data.rows[0].replyImgUrl,[["url",null]]))
console.log(resp.data.rows[0].replyImgUrl);
console.log(Fromate(resp.data.rows[0].replyImgUrl, [['url', null]]));
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.accountLogin!=null?tmp.accountLogin:tmp.owerPhone,
phone: tmp.accountLogin != null ? tmp.accountLogin : tmp.owerPhone,
email: tmp.owerEmail,
content: resp.data.rows[0].serviceContent,
replyContent: resp.data.rows[0].replyContent,
replyImgUrl: Fromate(resp.data.rows[0].replyImgUrl,[["url",null]]),
replyImgUrl: Fromate(resp.data.rows[0].replyImgUrl, [['url', null]]),
status: tmp2.handleStatus,
pictrues: picFromate(tmp2.imgUrl),
time: timestampToTime4(tmp2.createTime.time)
time: timestampToTime4(tmp2.createTime.time),
};
yield put({ type: 'returnCurDataDetail', CurDataDetail, });
} break;
yield put({ type: 'returnCurDataDetail', CurDataDetail });
}
break;
case 33:
case 22: {
message.success("Success Operation!", 3)
history.go(-1)
case 22:
{
message.success('Success Operation!', 3);
history.go(-1);
// history.push("/CommercialService/CommunityMaintenance")
} break;
case 23: {
}
break;
case 23:
{
let Data8 = resp;
yield put({ type: 'returnPage8', Data8, });
} break;
case 31: {
yield put({ type: 'returnPage8', Data8 });
}
break;
case 31:
{
let Data7 = resp;
yield put({ type: 'returnPage7', Data7 })
} break;
case 35: {
yield put({ type: 'returnPage7', Data7 });
}
break;
case 35:
{
let Result = resp;
yield put({ type: 'returnResult', Result })
} break;
yield put({ type: 'returnResult', Result });
}
break;
case 37:
case 36: {
case 36:
{
let DataSaveDetail = resp;
yield put({ type: 'returnDataSaveDetail', DataSaveDetail, });
} break;
case 40: {
yield put({ type: 'returnDataSaveDetail', DataSaveDetail });
}
break;
case 40:
{
let Data = resp;
yield put({ type: 'returnPage', Data, });
} break;
yield put({ type: 'returnPage', Data });
}
break;
}
}
},
// *TosCommunityServiceGetDetail({ playload }, { call, put }) {
......@@ -154,25 +162,23 @@ export default {
// },
*SA({ playload }, { call, put }) {
var DataSave = playload;
yield put({ type: 'returnDataSave', DataSave, });
yield put({ type: 'returnDataSave', DataSave });
},
*setCurData({ playload }, { call, put }) {
var CurData = playload;
yield put({ type: 'returnCurData', CurData, });
yield put({ type: 'returnCurData', CurData });
},
*setCurDataDetail({ playload }, { call, put }) {
var CurDataDetail=null
yield put({ type: 'returnCurDataDetail', CurDataDetail, });
var CurDataDetail = null;
yield put({ type: 'returnCurDataDetail', CurDataDetail });
},
*ResultClear({ }, { put }) {
var Result = null
console.log("清除")
yield put({type: 'returnResult', Result} )
*ResultClear({}, { put }) {
var Result = null;
console.log('清除');
yield put({ type: 'returnResult', Result });
},
},
};
......@@ -14,180 +14,215 @@ import { getCookie } from '@/utils/method';
import { timestampToTime } from '@/utils/time';
import { validateMessages } from '@/utils/params';
const treatStatus = ["Pending", "Processed"]
const treatStatus = ['Pending', 'Processed'];
const Detail = (props: any) => {
const [editorFlag, setEditorFlag] = useState(true);
const { dispatch, location, CurDataDetail } = props;
const fromRef = useRef(null)
const RA = (index: any, values: any) => { dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } }) };
const fromRef = useRef(null);
const RA = (index: any, values: any) => {
dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } });
};
const [curString, setCurString] = useState({ readyState: false })
const [loading, setLoading] = useState(false)
const [curString, setCurString] = useState({ readyState: false });
const [loading, setLoading] = useState(false);
const [headTitle, setHeadTitle] = useState("");
const [headTitle, setHeadTitle] = useState('');
const headTitles = [
"Reply To Community maintenance",
"Reply To Shelf life Service",
"Reply To Owner Complaints",
"Reply To Report Online",
"Reply To Problem Feedback"]
'Reply To Community maintenance',
'Reply To Shelf life Service',
'Reply To Owner Complaints',
'Reply To Report Online',
'Reply To Problem Feedback',
];
useEffect(() => {
if ((location.pathname).indexOf("/Edit") > -1) {
setEditorFlag(true)
if (location.pathname.indexOf('/Edit') > -1) {
setEditorFlag(true);
} else {
setEditorFlag(false)
setEditorFlag(false);
}
RA(21, {
serviceType: location.query.serviceType,
id: location.query.id
})
setHeadTitle(headTitles[parseInt(location.query.serviceType) - 1])
setLoading(true)
id: location.query.id,
});
setHeadTitle(headTitles[parseInt(location.query.serviceType) - 1]);
setLoading(true);
}, [location.pathname]);
useEffect(() => {
setCurString({ readyState: true });
console.log('页面准备好了');
}, []);
useEffect(() => {
console.log(CurDataDetail);
if (CurDataDetail != null && curString.readyState == true) {
console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
console.log(CurDataDetail)
console.log('@@@@@@@@@@@@@@@@@@@@@@@@@@@@');
console.log(CurDataDetail);
if (!editorFlag) {
var tmp = { replyContent: CurDataDetail.replyContent, file: CurDataDetail.replyImgUrl }
fromRef.current.setFieldsValue(tmp)
var tmp = { replyContent: CurDataDetail.replyContent, file: CurDataDetail.replyImgUrl };
fromRef.current.setFieldsValue(tmp);
}
setLoading(false)
setLoading(false);
}
}, [CurDataDetail])
useEffect(() => {
setCurString({ readyState: true })
console.log("页面准备好了")
}, [])
}, [CurDataDetail]);
const onFinish = (values: any) => {
console.log(values)
console.log(values);
var val = values;
val.handleName = getCookie("name")
val.handleContacts = getCookie("phone")
val.type = "" + location.query.serviceType
val.id = location.query.id
val.userId = location.query.user_id
val.communityId = location.query.community_id
val.handleStatus = "1"
val.handleName = getCookie('name');
val.handleContacts = getCookie('phone');
val.type = '' + location.query.serviceType;
val.id = location.query.id;
val.userId = location.query.user_id;
val.communityId = location.query.community_id;
val.handleStatus = '1';
// val.file=fileList
console.log('Success:', val)
console.log('Success:', val);
RA(22, val);
setLoading(true)
setLoading(true);
};
const titleProps = {
sublist: CurDataDetail != null ? ['Status : ' + treatStatus[CurDataDetail.status], 'Create Time : ' + CurDataDetail.time] : null,
title: headTitle
}
sublist:
CurDataDetail != null
? ['Status : ' + treatStatus[CurDataDetail.status], 'Create Time : ' + CurDataDetail.time]
: null,
title: headTitle,
};
return (
<div>
{CurDataDetail != null ?
{CurDataDetail != null ? (
<>
<Spin spinning={loading}>
<div className={styles.base}>
<TitleBack {...titleProps} />
<Descriptions>
<Descriptions.Item >{CurDataDetail.community}</Descriptions.Item>
<Descriptions.Item>{CurDataDetail.community}</Descriptions.Item>
<Descriptions.Item span={2}>{CurDataDetail.home}</Descriptions.Item>
<Descriptions.Item label="Address" span={3}>{CurDataDetail.address} </Descriptions.Item>
<Descriptions.Item label="Address" span={3}>
{CurDataDetail.address}{' '}
</Descriptions.Item>
<Descriptions.Item label="User Name">{CurDataDetail.name}</Descriptions.Item>
<Descriptions.Item label="Contact Details">{CurDataDetail.phone} </Descriptions.Item>
<Descriptions.Item >{CurDataDetail.email}</Descriptions.Item>
<Descriptions.Item label="Contact Details">
{CurDataDetail.phone}{' '}
</Descriptions.Item>
<Descriptions.Item>{CurDataDetail.email}</Descriptions.Item>
</Descriptions>
<Row gutter={16}>
<Col span={3}>Description:</Col>
<Col><TextArea style={{ width: 394, height: 80, padding: 8 }} autoSize={false} disabled value={CurDataDetail.content} /></Col>
<Col>
<TextArea
style={{ width: 394, height: 80, padding: 8 }}
autoSize={false}
disabled
value={CurDataDetail.content}
/>
</Col>
</Row>
<Row gutter={16} style={{ marginTop: 20 }}>
<Col span={3}>Picture:</Col>
<Col>{
CurDataDetail != null ?
<Col>
{CurDataDetail != null ? (
<PictureOptionsRow
action="/tos/communtiy/service/reply/img"
disabled={true}
defaultValue={CurDataDetail.pictrues}
data={{
userToken: "token",
userToken: 'token',
imageType: 'tosCommunityImageReply',
extends: "",
extends: '',
}}
//
/> : null
}</Col>
/>
) : null}
</Col>
</Row>
<Line />
<Form ref={fromRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}>
{!editorFlag ?
<Form
ref={fromRef}
name="basic"
onFinish={onFinish}
validateMessages={validateMessages}
>
{!editorFlag ? (
<Row gutter={16}>
<Col>Response:</Col>
<Col span={6}>{getCookie("name")}</Col>
<Col span={6}>{getCookie('name')}</Col>
<Col>Contract Detail:</Col>
<Col>{getCookie("phone")}</Col>
<Col>{getCookie('phone')}</Col>
</Row>
: null}
) : null}
<Row gutter={16} style={{ marginTop: 20 }}>
<Col span={3}>Solution & Conclusion:</Col>
<Col ><Form.Item name="replyContent" rules={[{ required: true, max: 300 }]} ><TextArea style={{ padding: 8, width: 394, height: 80 }} autoSize={false} disabled={!editorFlag} /></Form.Item></Col>
<Col>
<Form.Item name="replyContent" rules={[{ required: true, max: 300 }]}>
<TextArea
style={{ padding: 8, width: 394, height: 80 }}
autoSize={false}
disabled={!editorFlag}
/>
</Form.Item>
</Col>
</Row>
<Row gutter={16}>
<Col span={3}></Col>
<Col >
<Col>
{/* putSubmit={PictureOptionsRowRef} */}
{
CurDataDetail.replyImgUrl != null ? <>
{CurDataDetail.replyImgUrl != null ? (
<>
<Form.Item name="file">
<PictureOptionsRow
action="/tos/communtiy/service/reply/img"
disabled={!editorFlag}
data={{
userToken: "token",
userToken: 'token',
imageType: 'tosCommunityImageReply',
extends: "",
}} />
extends: '',
}}
/>
</Form.Item>
</> : null
}
</>
) : null}
</Col>
</Row>
{
editorFlag ?
<><Line /><Row><Col span={3}></Col><Col><Form.Item><Button type="primary" htmlType="submit">Submit</Button></Form.Item></Col></Row></> : null
}
{editorFlag ? (
<>
<Line />
<Row>
<Col span={3}></Col>
<Col>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Col>
</Row>
</>
) : null}
</Form>
</div>
</Spin>
</>
: null}
) : null}
</div>
);
};
function mapStateToProps(state: any) {
const { CurDataDetail } = state.CommunityService;
console.log(CurDataDetail);
return {
CurDataDetail
CurDataDetail,
};
}
export default connect(mapStateToProps)(Detail);
......@@ -10,12 +10,13 @@ import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
const pathname = [
'CommunityMaintenance',
'ShelfLifeService',
'OwnerComplaints',
'ReportOnline',
'ProblemFeedback',
'CommunityMaintenance', // 小区保养
'ShelfLifeService', // 保质期服务
'OwnerComplaints', // 业主投诉
'ReportOnline', // 在线报事
'ProblemFeedback', // 问题反馈
];
const handle_Status = [
[0, 'Pending'],
[1, 'Processed'],
......@@ -25,7 +26,7 @@ const goToName = ['Reply', 'Detail'];
const module = 'CommunityService';
// 页码
let pageNum = 1;
let pageNum: number = 1;
const PropertyServices = (props: any) => {
const { dispatch, location, Data } = props;
......@@ -38,13 +39,15 @@ const PropertyServices = (props: any) => {
const columns = [
{ title: 'Community Name', dataIndex: 'community_name' },
{ title: 'Ower Name', dataIndex: 'ower_name' },
{
title: 'service Content',
dataIndex: 'service_content',
title: parseInt(serviceTypeGobal) - 1 === 0 ? 'Replier' : 'Content',
dataIndex: parseInt(serviceTypeGobal) - 1 === 0 ? 'handle_name' : 'service_content',
ellipsis: true,
width: 500,
width: 400,
render: (text: any) => <Space size="middle">{text != null ? text : '--'}</Space>,
},
{
title: 'Create Time',
dataIndex: 'create_time',
......@@ -109,7 +112,6 @@ const PropertyServices = (props: any) => {
var tmp: any = filterObjbyTg(location.query, ['handleStatus', 'ownerName', 'communityName']);
tmp.handleStatus = handle_Status[parseInt(tmp.handleStatus)]; //特殊处理
setReadyData(tmp);
console.log(tmp);
//获取数据
setLoading(true);
RA(
......@@ -138,7 +140,7 @@ const PropertyServices = (props: any) => {
const ClickTitleSearch = (comment: any) => {
//页面搜索
comment.serviceType = serviceTypeGobal;
// comment.serviceType = serviceTypeGobal;
comment.pageNum = 1;
history.push(location.pathname + urlEncode(filterObj(comment)));
};
......
......@@ -10,72 +10,107 @@ import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
import { objectColumns, stringTab } from '@/utils/string';
import { timestampToTime } from '@/utils/time';
const module = "CommunityService"
const module = 'CommunityService';
const Renovation = (props: any) => {
// const decoration_status = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]]
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 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([
["Community", "community_name"],
["Applicant", "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>)],
["Request Time", "create_time", (text: any) => (<div>{timestampToTime(text.time)}</div>)],
["status", "decoration_status", (text: any) => (<div>{decoration_status[parseInt(text)][1]}</div>)],
["Actions", "decoration_status", (text: any, record: any) => (<Space size="middle"> <a onClick={goToDetail.bind(this, record)}> {text === 0 ? "Reply" : "Detail"} </a></Space>)],
])
['Community', 'community_name'],
['Applicant', '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>],
['Request Time', 'create_time', (text: any) => <div>{timestampToTime(text.time)}</div>],
[
'status',
'decoration_status',
(text: any) => <div>{decoration_status[parseInt(text)][1]}</div>,
],
[
'Actions',
'decoration_status',
(text: any, record: any) => (
<Space size="middle">
{' '}
<a onClick={goToDetail.bind(this, record)}> {text === 0 ? 'Reply' : 'Detail'} </a>
</Space>
),
],
]);
const { dispatch, Data8, location } = props;
useEffect(() => {
if (Data8 != null) { setLoading(false) }
}, [Data8]);
useEffect(() => {
if (location != null) {
//前置数据
console.log("前置数据");
let tmp: any = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName", "current"])
tmp.handleStatus = decoration_status[parseInt(tmp.handleStatus)] //特殊处理
setReadyData(tmp)
console.log('前置数据');
let tmp: any = filterObjbyTg(location.query, [
'handleStatus',
'ownerName',
'communityName',
'current',
]);
tmp.handleStatus = decoration_status[parseInt(tmp.handleStatus)]; //特殊处理
setReadyData(tmp);
//获取数据
setLoading(true)
setLoading(true);
RA(23, { serviceType: "6", id: "" }, module, dispatch)
RA(23, { serviceType: '6', id: '' }, module, dispatch);
}
}, [location]);
}, [location])
useEffect(() => {
if (Data8 != null) {
setLoading(false);
}
}, [Data8]);
//页面搜索
const ClickTitleSearch = (comment: any) => {
let tmp = filterObjbyTg(comment, ["handleStatus", "ownerName", "communityName"])
tmp["current"] = 1
history.push(location.pathname + urlEncode(tmp))
}
let tmp = filterObjbyTg(comment, ['handleStatus', 'ownerName', 'communityName']);
tmp['current'] = 1;
history.push(location.pathname + urlEncode(tmp));
};
const goToDetail = (values: any, e: any) => {
SA(values, module, dispatch)
history.push('./RenovationApplication/Detail')
}
SA(values, module, dispatch);
history.push('./RenovationApplication/Detail');
};
return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
{
Data8 != null ?
<div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
{Data8 != null ? (
<>
<TitleSearch
communitySelect={true}
listkey={['ownerName']}
list={['Owner Name']}
status={[{ name: ["handleStatus", "Status"], data: decoration_status }]}
status={[{ name: ['handleStatus', 'Status'], data: decoration_status }]}
defaultValue={readyData}
onSubmit={ClickTitleSearch}
/>
......@@ -88,14 +123,13 @@ const Renovation = (props: any) => {
pagination={{ defaultCurrent: 1, total: Data8.total }}
/>
</>
: null
}
) : null}
</div>
);
};
function map(state: any) {
const { Data8 } = state[module]
return { Data8 }
const { Data8 } = state[module];
return { Data8 };
}
export default connect(map)(Renovation);
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