Commit a4904564 authored by maple's avatar maple Committed by MrShi

[fix]小区服务

(cherry picked from commit 82fc811c)
parent 9a7f6f7c
......@@ -79,7 +79,7 @@ const PictureOptionsRow = (props:any) => {
<div>
<Upload
accept=".png,.jpg,.jpeg"
action="/tos/image/upload"
action={props.action != null ? props.action : "/tos/image/upload"}
listType="picture-card"
data={props.data}
fileList={fileList}
......
import * as service from '../services/tos';
import * as service from '@/services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
import { timestampToTime } from '../utils/time';
import { timestampToTime } from '@/utils/time';
import { picFromate } from '@/utils/method';
export default {
namespace: 'CommunityService',
state: {
......@@ -52,12 +55,22 @@ export default {
}
},
*TosCommunityServiceGetDetail({ playload }, { call, put }) {
const resp = yield call(service.TosCommunityServiceGetDetail, playload);
//预订设施查询
*RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload);
console.log(resp)
if (resp.error_code !=0 ) {
window.location.href = '/500';
} else {
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)
}
else {
switch (playload.index) {
case 21:
{
var tmp = resp.data.rows[0].tosOwerModel;
var tmp2 = resp.data.rows[0];
console.log(tmp2.imgUrl)
......@@ -72,12 +85,53 @@ export default {
email: tmp.owerEmail,
content: resp.data.rows[0].serviceContent,
status: tmp2.handleStatus,
pictrues:picFromate(tmp2.imgUrl),
time:timestampToTime(tmp2.createTime.time)
};
console.log("查看值")
console.log(CurDataDetail)
yield put({ type: 'returnCurDataDetail', CurDataDetail, });
} break;
case 22: {
message.success("Success Operation!", 3)
// history.push("/CommercialService/CommunityMaintenance")
} break;
case 23: {
let Data = resp.data.rows;
yield put({ type: 'returnPage', Data, });
} break;
}
}
},
// *TosCommunityServiceGetDetail({ playload }, { call, put }) {
// 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, });
// }
// },
*setCurData({ playload }, { call, put }) {
var CurData = playload;
yield put({ type: 'returnCurData', CurData, });
......
......@@ -10,7 +10,8 @@ export default {
Data: { data: [], total: 0 },
curString:{},
Result: null,
DataSave:null
DataSave: null,
DataSaveDetail:null,
},
reducers: {
......@@ -22,7 +23,10 @@ export default {
},
returnDataSave(state, { DataSave }) {
return {...state,DataSave}
}
},
returnDataSaveDetail(state, { DataSaveDetail }) {
return {...state,DataSaveDetail}
},
},
effects: {
......@@ -48,6 +52,12 @@ export default {
let Data = resp.data;
yield put({ type: 'returnPage', Data});
} break;
case 20:
{
let DataSaveDetail = resp.data;
yield put({ type: 'returnDataSaveDetail', DataSaveDetail});
}break;
case 18:
case 14:{
message.success("Success Operation!",3)
......
......@@ -107,8 +107,9 @@ export default {
case 6:
case 17:{
message.success("Success Operation!", 3)
var Result=resp
yield put({ type: 'returnResult', Result })
// var Result=resp
// yield put({ type: 'returnResult', Result })
history.push("/CommunityManagement/FacilityBookings")
} break;
case 7: {
let tmp = resp.data;
......
......@@ -16,18 +16,26 @@ const Detail = (props:any) => {
const [editorFlag, setEditorFlag] = useState(true);
const { dispatch, location, CurData,CurDataDetail } = props;
const TosCommunityServiceGetDetail = (values: any) => { dispatch({ type: 'CommunityService/TosCommunityServiceGetDetail', playload: values }) };
const TosCommuntiyServiceReply = (values: any) => { dispatch({ type: 'CommunityService/TosCommuntiyServiceReply', playload: values }) };
const RA = (index:any,values: any) => { dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } }) };
const setCurDataDetail = () => { dispatch({ type: 'CommunityService/setCurDataDetail' }) };
const [headTitle, setHeadTitle] = useState("");
const headTitles = ["Reply To Community maintenance", "Reply", "Reply", "Reply", "Reply"]
const headTitles = [
"Reply To Community maintenance",
"Reply To Shelf life Service",
"Reply To Owner Complaints",
"Reply To Report Online",
"Reply To Problem Feedback"]
const [fileList, setfileList] = useState([]);
useEffect(() => {
setCurDataDetail()
if (CurData != null) {
TosCommunityServiceGetDetail({
RA(21,{
serviceType: CurData.service_type,
id: CurData.id
})
......@@ -46,12 +54,13 @@ const Detail = (props:any) => {
const onFinish = (values:any) => {
var val = values
val.type =CurData.service_type
val.type =""+CurData.service_type
val.id =CurData.id
val.userId = CurData.user_id
val.handleStatus = "1"
val.file=[]
val.file=fileList
console.log('Success:', val)
RA(22,val);
//TosCommuntiyServiceReply(val)
};
......@@ -61,6 +70,7 @@ const Detail = (props:any) => {
const PictureOptionsRowRef = (values:any) => {
console.log(values)
setfileList(values)
}
return (
<div className={styles.base}>
......@@ -83,14 +93,19 @@ const Detail = (props:any) => {
</Row>
<Row gutter={16} style={{marginTop:20}}>
<Col>Picture:</Col>
<Col><PictureOptionsRow
disabled={true} putSubmit={PictureOptionsRowRef} data={{
<Col>{
CurDataDetail!=null?
<PictureOptionsRow
action="/tos/communtiy/service/reply/img"
disabled={true} putSubmit={PictureOptionsRowRef}
data={{
userToken: "token",
imageType: 'tosCommunityImageReply',
extend: "",
}}
defultValue={[{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" }]}
/></Col>
defultValue={CurDataDetail.pictrues}
/>:null
}</Col>
</Row>
<Line />
......@@ -110,6 +125,7 @@ const Detail = (props:any) => {
<Col>Resolved Complaint:</Col>
<Col>
<PictureOptionsRow
action="/tos/communtiy/service/reply/img"
disabled={!editorFlag}
putSubmit={PictureOptionsRowRef} data={{
userToken: "token",
......
......@@ -12,6 +12,8 @@ const PropertyServices = (props: any) => {
const { dispatch, location, Data } = props;
const TosCommunityServiceGet = (values: any) => { dispatch({ type: 'CommunityService/TosCommunityServiceGet', playload: values }) };
const RA = (index: any, values: any) => { dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } }) };
const setCurData = (values: any) => { dispatch({ type: 'CommunityService/setCurData', playload: values }) };
const pagination = { defaultCurrent: 1, total: Data!=null?Data.length:0 }
......@@ -50,19 +52,48 @@ const PropertyServices = (props: any) => {
];
useEffect(() => {
var init="1"
if (location.pathname == "/CommercialService/CommunityMaintenance") { init = "1"}
else if(location.pathname == "/CommercialService/ShelfLifeService") {init = "2"}
else if (location.pathname == "/CommercialService/OwnerComplaints") { init = "3" }
else if (location.pathname == "/CommercialService/ReportOnline") { init = "4" }
else if(location.pathname == "/CommercialService/ProblemFeedback") {init = "5"}
setLoading(true)
var init = "1"
switch (location.pathname) {
case "/CommercialService/CommunityMaintenance": init = "1"
{
TosCommunityServiceGet({serviceType:init})
} break;
case "/CommercialService/ShelfLifeService": init = "2"
{
TosCommunityServiceGet({serviceType:init})
} break;
case "/CommercialService/OwnerComplaints": init = "3"
{
TosCommunityServiceGet({serviceType:init})
} break;
case "/CommercialService/ReportOnline": init = "4"
{
TosCommunityServiceGet({serviceType:init})
} break;
case "/CommercialService/ProblemFeedback":init = "5"
{
TosCommunityServiceGet({serviceType:init})
} break;
case "/CommercialService/RenovationApplication": init = "6"
{
RA(23, { serviceType: init ,id:""})
} break;
}
// if (location.pathname == "/CommercialService/CommunityMaintenance") { init = "1"}
// else if(location.pathname == "/CommercialService/ShelfLifeService") {init = "2" , TosCommunityServiceGet({serviceType:init})}
// else if (location.pathname == "/CommercialService/OwnerComplaints") { init = "3" , TosCommunityServiceGet({serviceType:init})}
// else if (location.pathname == "/CommercialService/ReportOnline") { init = "4" , TosCommunityServiceGet({serviceType:init})}
// else if (location.pathname == "/CommercialService/ProblemFeedback") { init = "5", TosCommunityServiceGet({serviceType:init}) }
// else if(location.pathname == "/CommercialService/RenovationApplication") {init = "6",RA(22,{serviceType:init})}
setLoading(true)
},[]);
useEffect(() => {
setLoading(false)
},[Data]);
}, [Data]);
const TitleSearchContent = (comment: any)=>{
console.log(comment)
}
......
......@@ -11,10 +11,7 @@ import { RA } from '@/services/tos';
const Contract = (props:any) => {
const { formatMessage } = useIntl();
const { location } = props;
const { dispatch,Data,Result } = props;
const { dispatch,location,Data,Result } = props;
const RA = (index: any, values: any) => { dispatch({ type: 'Contract/RA', playload: { index: index, body: values } }) };
const SA = (values: any) => { dispatch({ type: 'Contract/SA', playload: values }) };
......
......@@ -20,9 +20,11 @@ const uploadProps = {
},
};
const ContractContent = (props: { location: any; }) => {
const ContractContent = (props: any) => {
const { location } = props;
const {dispatch,location,DataSave,DataSaveDetail } = props;
const RA = (index: any, values: any) => { dispatch({ type: 'Contract/RA', playload: { index: index, body: values } }) };
const [ editFlag, setEditFlag ] = useState(false);
useEffect(() => {
......@@ -33,10 +35,40 @@ const ContractContent = (props: { location: any; }) => {
}
}, [location.pathname]);
useEffect(() => {
if (DataSave!=null) {
console.log(DataSave)
RA(20, {
contractId: DataSave.id
})
}
}, [DataSave])
useEffect(() => {
if (DataSaveDetail != null) {
console.log(DataSaveDetail)
}
}, [DataSaveDetail])
const goToReturn = () => {
history.back()
}
// communityName: "A7"
// contractFileName: "cleanFiles"
// contractNumber: "456"
// contractPartyA: "国企A"
// contractPartyB: "民企B"
// contractTitle: "清洁服务协议"
// contractValidEndDate: "2020-09-21"
// contractValidStartDate: "2020-08-28"
// count: 0
// createTime: "Aug 1, 2020 4:15:47 PM"
// deleted: 0
// extend: ""
// fileUrls: Array(1)
// 0: "http://acc-huahu
return (
<div className={styles.base}>
......@@ -48,27 +80,27 @@ const ContractContent = (props: { location: any; }) => {
<div className={styles.box1}>
<div className={styles.box1item1}>Contract Code</div>
<div className = { styles.box1item2 } > {editFlag?(<Input style={{width:200}} placeholder="ABC123456777" />):("ABC123456777")}</div>
<div className = { styles.box1item2 } > {editFlag?(<Input style={{width:200}} placeholder="Contract Code" />):(DataSaveDetail!=null?DataSaveDetail.contractNumber:null)}</div>
<div className={styles.box1item3}>Contract Party A</div>
<div className={styles.box1item4}>{editFlag?(<Input style={{width:200}} placeholder="Corporate Name" />):("Pearl Co., Ltd")}</div>
<div className={styles.box1item4}>{editFlag?(<Input style={{width:200}} placeholder="Corporate Name" />):(DataSaveDetail!=null?DataSaveDetail.contractPartyA:null)}</div>
<div className={styles.box1item5}>Contract Party B</div>
<div className={styles.box1item6}>{editFlag?(<Input style={{width:200}} placeholder="Corporate Name" />):("Pearl Co., Ltd")}</div>
<div className={styles.box1item6}>{editFlag?(<Input style={{width:200}} placeholder="Corporate Name" />):(DataSaveDetail!=null?DataSaveDetail.contractPartyB:null)}</div>
</div>
<div className={styles.box5}>
<div className={styles.box5item1}>Project</div>
<div className={styles.box5item2}>{editFlag?(<Input style={{width:200}} placeholder="Project Name" />):("Zhongda community")}</div>
<div className={styles.box5item2}>{editFlag?(<Input style={{width:200}} placeholder="Project Name" />):(DataSaveDetail!=null?DataSaveDetail.communityName:null)}</div>
</div>
<div className={styles.box4}>
<div className={styles.box4item1}>Contract Title</div>
<div className={styles.box4item2}>{editFlag?(<Input style={{width:200}} placeholder="XXXX Labor Contract" />):("Zhongda community")}</div>
<div className={styles.box4item2}>{editFlag?(<Input style={{width:200}} placeholder="XXXX Labor Contract" />):(DataSaveDetail!=null?DataSaveDetail.contractTitle:null)}</div>
</div>
<div className={styles.box6}>
<div className={styles.box6item1}>Effective Date</div>
<div className={styles.box6item2}>{editFlag ? (<DatePicker style={{width:140}}/>) : (<div className={styles.box6item2x1}>25-03-2020</div>)}</div>
<div className={styles.box6item3}>{editFlag ? (<DatePicker style={{width:140}}/>) : (<div className={styles.box6item2x1}>25-03-2021</div>)}</div>
<div className={styles.box6item2}>{editFlag ? (<DatePicker style={{width:140}}/>) : (<div className={styles.box6item2x1}>{DataSaveDetail!=null?DataSaveDetail.contractValidEndDate:null}</div>)}</div>
<div className={styles.box6item3}>{editFlag ? (<DatePicker style={{width:140}}/>) : (<div className={styles.box6item2x1}>{DataSaveDetail!=null?DataSaveDetail.contractValidStartDate:null}</div>)}</div>
</div>
{
editFlag ? (
......@@ -85,8 +117,8 @@ const ContractContent = (props: { location: any; }) => {
) : (
<div className={styles.box7}>
<div className={styles.box7item1}>Contract</div>
<div className={styles.box7item2}>2020 Contract.PDF</div>
<div className={styles.box7item3}><a>Preview</a></div>
<div className={styles.box7item2}>.PDF</div>
<div className={styles.box7item3}><a href={DataSaveDetail!=null?DataSaveDetail.fileUrls:null}>Preview</a></div>
</div>
)
}
......@@ -116,5 +148,11 @@ const ContractContent = (props: { location: any; }) => {
);
};
export default ContractContent;
function mapStateToProps(state:any) {
const { DataSave,Result,DataSaveDetail } = state.Contract;
return {
DataSave,
DataSaveDetail
};
}
export default connect(mapStateToProps)(ContractContent);
......@@ -43,9 +43,9 @@ export function TosTosServiceProviderSave(values: any) {
export function TosCommunityServiceGet(values: any) {
return request('/tos/community/service/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
}
export function TosCommunityServiceGetDetail(values: any) {
return request('/tos/community/service/get/detail',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
}
// export function TosCommunityServiceGetDetail(values: any) {
// return request('/tos/community/service/get/detail',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
// }
export function TosCommuntiyServiceReply(values: any) {
return request('/tos/communtiy/service/reply',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
}
......@@ -82,7 +82,11 @@ const requestList = [
["/tos/bookingService/edit", "17 编辑小区设施"],
["/tos/tosOwner/info/update", "18 编辑业主信息"],
["/tos/contract/list","19 获取合同列表"]
["/tos/contract/list", "19 获取合同列表"],
["/tos/contract/detail/query", "20 获取合同列表详情"],
["/tos/community/service/get/detail", "21 小区服务获取详情"],
["/tos/communtiy/service/reply", "22 小区回复"],
["/tos/property/decorate/record/get","23 装修列表获取"],
]
function requestAuto(url:string,values:any) {
return request(url, Body(values))
......
......@@ -22,3 +22,14 @@ export const checkInput = (e: any) => {
e.target.value=null
}
}
export const picFromate = (values: any) => {
var result=new Array()
if (values != null) {
values.map((item:any, index:any) => {
result.push({ url: item })
})
}
return result
}
\ No newline at end of file
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