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 });
},
},
};
This diff is collapsed.
......@@ -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