Commit 62fee18b authored by cellee's avatar cellee

Merge branch 'final' of http://120.77.240.215:9701/Maple/tostumi.git into final

parents 9a619db7 e332d6f6
...@@ -26,7 +26,7 @@ const TitleSearch = (props: any) => { ...@@ -26,7 +26,7 @@ const TitleSearch = (props: any) => {
// const communitySelect = props.communitySelect // const communitySelect = props.communitySelect
// const defaultValue = props.defaultValue; // const defaultValue = props.defaultValue;
const {single,checklist,status,communitySelect,defaultValue} = props; const { single, checklist, status, communitySelect, defaultValue } = props;
const time = props.time; const time = props.time;
...@@ -36,7 +36,7 @@ const TitleSearch = (props: any) => { ...@@ -36,7 +36,7 @@ const TitleSearch = (props: any) => {
const [communitySingle, setCommunitySingle] = useState(null) const [communitySingle, setCommunitySingle] = useState(null)
const [datePicker, setDate] = useState(null) const [datePicker, setDate] = useState(null)
const formRef = useRef(null) const [form] = Form.useForm()
const tosCommunityget = (values: any) => { dispatch({ type: 'Init/tosCommunityget', playload: values }) }; const tosCommunityget = (values: any) => { dispatch({ type: 'Init/tosCommunityget', playload: values }) };
useEffect(() => { useEffect(() => {
...@@ -46,14 +46,14 @@ const TitleSearch = (props: any) => { ...@@ -46,14 +46,14 @@ const TitleSearch = (props: any) => {
tosCommunityget(null) tosCommunityget(null)
} }
if (defaultValue != null) { if (defaultValue != null) {
formRef.current.setFieldsValue(defaultValue) form.setFieldsValue(defaultValue)
} }
}, []); }, []);
useEffect(() => { useEffect(() => {
if (defaultValue != null) { if (defaultValue != null) {
formRef.current.setFieldsValue(defaultValue) form.setFieldsValue(defaultValue)
} }
}, [defaultValue]) }, [defaultValue])
useEffect(() => { useEffect(() => {
...@@ -94,14 +94,21 @@ const TitleSearch = (props: any) => { ...@@ -94,14 +94,21 @@ const TitleSearch = (props: any) => {
setCommunitys(comment) setCommunitys(comment)
} }
// 选择小区名字并赋值
const opname = (value: any) => {
form.setFieldsValue({
'communityName': value
})
}
return ( return (
<> <>
<Form ref={formRef} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed}> <Form form={form} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed}>
<Row gutter={32}> <Row gutter={32}>
{ {
communitySelect != null ? communitySelect != null ?
<Col key={"communitySelect_"} ><Form.Item name={"communityName"}><SearchOptionsCommnity titleSearch={true} /></Form.Item></Col> <Col key={"communitySelect_"} ><Form.Item name={"communityName"}><SearchOptionsCommnity titleSearch={true} opname={opname} /></Form.Item></Col>
: null : null
} }
{ {
......
import React, { useState, useEffect,useRef} from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Input ,Tabs,Table,Space, Button} from 'antd'; import { Input, Tabs, Table, Space, Button } from 'antd';
const { TabPane } = Tabs; const { TabPane } = Tabs;
import {connect,history} from 'umi'; import { connect, history } from 'umi';
// apply_name: "我的人生就"
// apply_reason_content: "H4sIAAAAAAAAACXJOwqDQBQF0N5VjyLRRsI0xs+AIjFoEMXC8e9q3n2Zzi0opDnNgapoEmYYf4nL↵Lw0Rsy9pbYz3xdjTnNGWWFAVWk3L49xs2nOOOpqCvwgVN8VdKHc8OxYKUlj4OEgPvOsLeuxP/F8A↵AAA="
// apply_relation_owner: 0
// apply_status: 0
// build_number: "01"
// communityId: "12ffe9ed60054af9a67c036af92e03f9"
// community_name: "A4"
// community_owner: "jack-小雄"
// community_owner_phone: "13143391751"
// create_time: {date: 10, day: 4, hours: 16, minutes: 27, month: 8, …}
// deleted: 0
// floor_number: "05"
// id: "977494600245575680"
// ownerId: "770da9de6b6c43f6b61bc3d671fa2e89"
// room_number: "569"
// update_time:
import { RA, SA } from '@/utils/method';
import { objectColumns } from '@/utils/string'; import { objectColumns } from '@/utils/string';
import { timestampToTime } from '@/utils/time'; import { timestampToTime } from '@/utils/time';
import Login from '../user/login/components/Login'; import Login from '../user/login/components/Login';
const module="CommunityService"
const Card = (props:any) => { import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
const module = "CommunityService"
const Card = (props: any) => {
const { dispatch, Data7 } = props; const { dispatch, Data7 } = props;
const formRef = useRef(null)
const [readyData, setReadyData] = useState(null)
const [loading, setLoading] = useState(false)
// const apply_status = [[0, "审核中"], [1, "批准"], [2, "拒绝"], [3, "领取"]] // const apply_status = [[0, "审核中"], [1, "批准"], [2, "拒绝"], [3, "领取"]]
const apply_status = [[0, "Under review"], [1, "Approval"], [2, "Reject"], [3, "Claim"]] const apply_status = [[0, "Under review"], [1, "Approval"], [2, "Reject"], [3, "Claim"]]
const columns = objectColumns([ const columns = objectColumns([
["所在小区", "community_name"], ["所在小区", "community_name"],
["所在单元", null, (text: any, record: any) => (<Space size="middle">{record.build_number+"#"+record.floor_number+"-"+record.room_number}</Space>)], ["所在单元", null, (text: any, record: any) => (<Space size="middle">{record.build_number + "#" + record.floor_number + "-" + record.room_number}</Space>)],
["用户名", "community_owner"], ["用户名", "community_owner"],
["申请时间", null, (text: any, record: any) => (<Space size="middle">{timestampToTime(record.create_time.time)}</Space>)], ["申请时间", null, (text: any, record: any) => (<Space size="middle">{timestampToTime(record.create_time.time)}</Space>)],
["申请状态", "apply_status", (text: any, record: any) => (<Space size="middle">{apply_status[parseInt(text)][1]}</Space>)], ["申请状态", "apply_status", (text: any, record: any) => (<Space size="middle">{apply_status[parseInt(text)][1]}</Space>)],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a onClick={goToDetail.bind(this,record)}>Detail</a></Space>)], ["Actions", null, (text: any, record: any) => (<Space size="middle"> <a onClick={goToDetail.bind(this, record)}>Detail</a></Space>)],
]) ])
useEffect(() => { useEffect(() => {
RA(31, { serviceType: "7", id: "" }, module, dispatch) if (Data7 != null) { setLoading(false) }
}, [Data7]);
useEffect(() => {
//前置数据
console.log("前置数据");
let tmp: any = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName", "current"])
tmp.handleStatus = apply_status[parseInt(tmp.handleStatus)] //特殊处理
setReadyData(tmp)
//获取数据
setLoading(true)
RA(31, { serviceType: "7", id: "" }, module, dispatch)
}, []) }, [])
useEffect(() => { useEffect(() => {
...@@ -56,39 +55,58 @@ const Card = (props:any) => { ...@@ -56,39 +55,58 @@ const Card = (props:any) => {
}, [Data7]) }, [Data7])
const goToDetail = (values: any, e: any) => { const goToDetail = (values: any, e: any) => {
SA(values,module,dispatch) SA(values, module, dispatch)
history.push('./AccessCardApplication/Detail') history.push('./AccessCardApplication/Detail')
} }
const goToAdd = (values:any,e:any)=>{ const goToAdd = (values: any, e: any) => {
history.push('./AccessCardApplication/Add') history.push('./AccessCardApplication/Add')
} }
//页面搜索
const ClickTitleSearch = (comment: any) => {
let tmp = filterObjbyTg(comment, ["handleStatus", "ownerName", "communityName"])
tmp["current"] = 1
console.log(tmp)
history.push(location.pathname + urlEncode(tmp))
}
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
{ {
Data7 != null ? Data7 != null ?
<> <>
<TitleSearch
communitySelect={true}
listkey={['ownerName']}
list={['Owner Name']}
status={[{ name: ["handleStatus", "Status"], data: apply_status }]}
defaultValue={readyData}
onSubmit={ClickTitleSearch}
/>
<div style={{ height: 80, position: "relative" }}> <div style={{ height: 80, position: "relative" }}>
<div style={{ position: "absolute", right: 0 }}> <div style={{ position: "absolute", right: 0 }}>
<Button type="primary" onClick={goToAdd}>Apply Card</Button> <Button type="primary" onClick={goToAdd}>Apply Card</Button>
</div> </div>
</div> </div>
<Table loading={false} rowKey="id" style={{ marginTop: 16 }} <Table loading={loading} rowKey="id" style={{ marginTop: 16 }}
dataSource={Data7.data.rows} dataSource={Data7.data.rows}
columns={columns} columns={columns}
pagination={{ defaultCurrent: 1, total: Data7.total }} /> pagination={{ defaultCurrent: 1, total: Data7.total }} />
</> </>
:null : null
} }
</div> </div>
); );
}; };
function map(state:any) { function map(state: any) {
const { Data7} = state[module] const { Data7 } = state[module]
return { Data7} return { Data7 }
} }
export default connect(map)(Card); export default connect(map)(Card);
import React, { useState, useEffect,useRef} from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Input ,Tabs,Table,Space, Button,Form,Row,Col, Layout, message} from 'antd'; import { Input, Tabs, Table, Space, Button, Form, Row, Col, Layout, message, Spin } from 'antd';
const { TabPane } = Tabs; const { TabPane } = Tabs;
import {connect,history} from 'umi'; import { connect, history } from 'umi';
import { RA, ResultClear } from '@/utils/method'; import { RA, ResultClear } from '@/utils/method';
...@@ -11,19 +11,23 @@ import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommn ...@@ -11,19 +11,23 @@ import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommn
import Line from '@/components/Line/Line'; import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea'; import TextArea from 'antd/lib/input/TextArea';
import Relationship from '@/components/Relationship/Relationship'; import Relationship from '@/components/Relationship/Relationship';
const module="CommunityService" import { useForm } from 'antd/es/form/util';
const CardAdd = (props:any) => { const module = "CommunityService"
const CardAdd = (props: any) => {
const { dispatch, Result } = props; const { dispatch, Result } = props;
const formRef = useRef(null) // const formRef = useRef(null)
const [form] = Form.useForm();
const [loading, setLoading] = useState(false)
useEffect(() => { useEffect(() => {
console.log(Result)
if (Result != null) { if (Result != null) {
console.log("初始化页面参数") console.log("初始化页面参数")
console.log(Result) console.log(Result)
if (Result.error_code = "0000") { if (Result.error_code = "0000") {
message.success("Operation Success!") message.success("Operation Success!")
setLoading(false)
ResultClear(module, dispatch) ResultClear(module, dispatch)
} else { } else {
message.error("Operation Fail!") message.error("Operation Fail!")
...@@ -33,79 +37,91 @@ const CardAdd = (props:any) => { ...@@ -33,79 +37,91 @@ const CardAdd = (props:any) => {
} }
}, [Result]) }, [Result])
useEffect(()=>{ useEffect(() => {
var param= var param =
{ {
"communityName":"A4", "communityName": "A4",
"buildNumber":"01", "buildNumber": "01",
"floorNumber":"02", "floorNumber": "02",
"roomNumber":"369", "roomNumber": "369",
"zipCode":"510000", "zipCode": "510000",
"communityOwner":"jack-小雄", "communityOwner": "jack-小雄",
"communityOwnerPhone":"18813757878", "communityOwnerPhone": "18813757878",
"communityOwnerEmail":"sale2huahuico.com", "communityOwnerEmail": "sale2huahuico.com",
"applyName":"小李子", "applyName": "小李子",
"applyNamePhone":"13436989568", "applyNamePhone": "13436989568",
"applyNameEmail":"xiaoli@huahuico.com", "applyNameEmail": "xiaoli@huahuico.com",
"applyRelationOwner":"2", "applyRelationOwner": "2",
"applyReasonContent":"租房", "applyReasonContent": "租房",
"description":"test" "description": "test"
} }
formRef.current.setFieldsValue(param) form.setFieldsValue(param)
}, []) }, [])
const onFinish = (values:any)=>{ const onFinish = (values: any) => {
console.log(values) console.log(values)
setLoading(true)
RA(35, values, module, dispatch); RA(35, values, module, dispatch);
} }
// 选择小区名字并赋值
const opname = (value: any) => {
form.setFieldsValue({
'communityName': value
})
}
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
<TitleBack title={"Apply Card"}></TitleBack> <TitleBack title={"Apply Card"}></TitleBack>
<Form ref={formRef} name="basic" onFinish={onFinish}> <Form form={form} name="basic" onFinish={onFinish}>
<Spin spinning={loading}>
<Form.Item labelCol={{ span: 3 }} label="Community" style={{ marginBottom: 0 }}>
<Form.Item labelCol={{span:3}} label="Community" style={{marginBottom:0}}>
<Input.Group compact> <Input.Group compact>
<Form.Item name="communityName" style={{marginRight:20}} ><SearchOptionsCommnity /></Form.Item> <Form.Item name="communityName" style={{ marginRight: 20 }} ><SearchOptionsCommnity opname={opname} /></Form.Item>
<Form.Item name="buildNumber" style={{marginRight:16}} ><Input style={{ width: 80 }} placeholder={"Building"} /></Form.Item> <Form.Item name="buildNumber" style={{ marginRight: 16 }} ><Input style={{ width: 80 }} placeholder={"Building"} /></Form.Item>
<div style={{ lineHeight: 2,marginRight:16}}>#</div> <div style={{ lineHeight: 2, marginRight: 16 }}>#</div>
<Form.Item name="floorNumber" style={{marginRight:16}} ><Input style={{ width: 80 }} placeholder={"Floor"} /></Form.Item> <Form.Item name="floorNumber" style={{ marginRight: 16 }} ><Input style={{ width: 80 }} placeholder={"Floor"} /></Form.Item>
<div style={{lineHeight:2,marginRight:16}}>-</div> <div style={{ lineHeight: 2, marginRight: 16 }}>-</div>
<Form.Item name="roomNumber" ><Input style={{width:120}} placeholder={"Room"} /></Form.Item> <Form.Item name="roomNumber" ><Input style={{ width: 120 }} placeholder={"Room"} /></Form.Item>
</Input.Group> </Input.Group>
</Form.Item> </Form.Item>
<Form.Item name="zipCode" wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}><Input style={{ width: 400 }}></Input></Form.Item> <Form.Item name="zipCode" wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}><Input style={{ width: 400 }}></Input></Form.Item>
<Form.Item labelCol={{span:3}} label="Owner Name" style={{marginBottom:-40}}> <Form.Item labelCol={{ span: 3 }} label="Owner Name" style={{ marginBottom: -40 }}>
<Input.Group compact> <Input.Group compact>
<Form.Item name="communityOwner" style={{marginRight:20}} ><Input placeholder={"Name"} /></Form.Item> <Form.Item name="communityOwner" style={{ marginRight: 20 }} ><Input placeholder={"Name"} /></Form.Item>
<Form.Item style={{marginRight:20}} label={"Contact Information"} ><Input hidden={true} /></Form.Item> <Form.Item style={{ marginRight: 20 }} label={"Contact Information"} ><Input hidden={true} /></Form.Item>
<Form.Item name="communityOwnerPhone" style={{marginRight:20}}><Input placeholder={"Phone number"} /></Form.Item> <Form.Item name="communityOwnerPhone" style={{ marginRight: 20 }}><Input placeholder={"Phone number"} /></Form.Item>
<Form.Item name="communityOwnerEmail" ><Input placeholder={"Email"} /></Form.Item> <Form.Item name="communityOwnerEmail" ><Input placeholder={"Email"} /></Form.Item>
</Input.Group> </Input.Group>
</Form.Item> </Form.Item>
<Line></Line> <Line></Line>
<Form.Item labelCol={{span:3}} label="Applicant" style={{marginBottom:-40}}> <Form.Item labelCol={{ span: 3 }} label="Applicant" style={{ marginBottom: -40 }}>
<Input.Group compact> <Input.Group compact>
<Form.Item name="applyName" style={{marginRight:20}} ><Input placeholder={"Name"} /></Form.Item> <Form.Item name="applyName" style={{ marginRight: 20 }} ><Input placeholder={"Name"} /></Form.Item>
<Form.Item style={{marginRight:20}} label={"Contact Information"} ><Input placeholder={"Phone number"} hidden={true} /></Form.Item> <Form.Item style={{ marginRight: 20 }} label={"Contact Information"} ><Input placeholder={"Phone number"} hidden={true} /></Form.Item>
<Form.Item name="applyNamePhone" style={{marginRight:20}}><Input placeholder={"Phone number"} /></Form.Item> <Form.Item name="applyNamePhone" style={{ marginRight: 20 }}><Input placeholder={"Phone number"} /></Form.Item>
<Form.Item name="applyNameEmail" ><Input placeholder={"Email"} /></Form.Item> <Form.Item name="applyNameEmail" ><Input placeholder={"Email"} /></Form.Item>
</Input.Group> </Input.Group>
</Form.Item> </Form.Item>
{/* label={"Contact Information"} */} {/* label={"Contact Information"} */}
<Form.Item labelCol={{span:3}} name="applyRelationOwner" label={"Relationship"} ><Relationship /></Form.Item> <Form.Item labelCol={{ span: 3 }} name="applyRelationOwner" label={"Relationship"} ><Relationship /></Form.Item>
<Form.Item labelCol={{span:3}} name="applyReasonContent" label={"Reason"}><TextArea style={{width:400}}></TextArea></Form.Item> <Form.Item labelCol={{ span: 3 }} name="applyReasonContent" label={"Reason"}><TextArea style={{ width: 400 }}></TextArea></Form.Item>
<Line></Line> <Line></Line>
<Form.Item wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}><Button type="primary" htmlType="submit">Submit</Button></Form.Item> <Form.Item wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</Spin>
</Form> </Form>
...@@ -113,8 +129,8 @@ const CardAdd = (props:any) => { ...@@ -113,8 +129,8 @@ const CardAdd = (props:any) => {
); );
}; };
function map(state:any) { function map(state: any) {
const { Result} = state[module] const { Result } = state[module]
return { Result} return { Result }
} }
export default connect(map)(CardAdd); export default connect(map)(CardAdd);
\ No newline at end of file
...@@ -101,6 +101,7 @@ const PropertyServices = (props: any) => { ...@@ -101,6 +101,7 @@ const PropertyServices = (props: any) => {
handleStatus: location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null, handleStatus: location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null,
ownerName: location.query.ownerName != undefined ? (location.query.ownerName) : null, ownerName: location.query.ownerName != undefined ? (location.query.ownerName) : null,
communityName: location.query.communityName != undefined ? (location.query.communityName) : null, communityName: location.query.communityName != undefined ? (location.query.communityName) : null,
pageNum,
}, module, dispatch) }, module, dispatch)
} }
......
...@@ -29,7 +29,7 @@ const Renovation = (props: any) => { ...@@ -29,7 +29,7 @@ const Renovation = (props: any) => {
["Content", "decoration_content", (text: any) => (<div>{stringTab(text)}</div>)], ["Content", "decoration_content", (text: any) => (<div>{stringTab(text)}</div>)],
["Request Time", "create_time", (text: any) => (<div>{timestampToTime(text.time)}</div>)], ["Request Time", "create_time", (text: any) => (<div>{timestampToTime(text.time)}</div>)],
["status", "decoration_status", (text: any) => (<div>{decoration_status[parseInt(text)][1]}</div>)], ["status", "decoration_status", (text: any) => (<div>{decoration_status[parseInt(text)][1]}</div>)],
["Actions", null, (text: any, record: any) => (<Space size="middle"> <a onClick={goToDetail.bind(this, record)}>Detail</a></Space>)], ["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; const { dispatch, Data8, location } = props;
...@@ -58,7 +58,6 @@ const Renovation = (props: any) => { ...@@ -58,7 +58,6 @@ const Renovation = (props: any) => {
const ClickTitleSearch = (comment: any) => { const ClickTitleSearch = (comment: any) => {
let tmp = filterObjbyTg(comment, ["handleStatus", "ownerName", "communityName"]) let tmp = filterObjbyTg(comment, ["handleStatus", "ownerName", "communityName"])
tmp["current"] = 1 tmp["current"] = 1
console.log(tmp)
history.push(location.pathname + urlEncode(tmp)) history.push(location.pathname + urlEncode(tmp))
} }
......
import React, { useState, useEffect,useRef} from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Input ,Tabs,Row,Col, Button,Form,Radio ,message} from 'antd'; import { Input, Tabs, Row, Col, Button, Form, Radio, message } from 'antd';
const { TabPane,} = Tabs; const { TabPane, } = Tabs;
import {connect,history} from 'umi'; import { connect, history } from 'umi';
const decoration_status = [[0, "Pending"], [1, "Approved"], [2, "Rejected"]] const decoration_status = [[0, "Pending"], [1, "Approved"], [2, "Rejected"]]
...@@ -13,66 +13,56 @@ import TextArea from 'antd/lib/input/TextArea'; ...@@ -13,66 +13,56 @@ import TextArea from 'antd/lib/input/TextArea';
import { timestampToTime } from '@/utils/time'; import { timestampToTime } from '@/utils/time';
import { values } from 'lodash'; import { values } from 'lodash';
const module="CommunityService" const module = "CommunityService"
const RenovationDetail = (props:any) => { const RenovationDetail = (props: any) => {
const { dispatch, DataSave,DataSaveDetail} = props; const { dispatch, DataSave, DataSaveDetail } = props;
const formRef = useRef(null) const formRef = useRef(null)
useEffect(()=>{ useEffect(() => {
if (DataSaveDetail != null) { if (DataSaveDetail != null) {
console.log("给予的请求页面"); console.log("给予的请求页面");
console.log(DataSaveDetail) console.log(DataSaveDetail)
} }
},[DataSaveDetail]) }, [DataSaveDetail])
useEffect(()=>{
useEffect(() => {
if (DataSave != null) { if (DataSave != null) {
console.log("初始化页面参数") console.log("初始化页面参数")
console.log(DataSave); console.log(DataSave);
RA(37,{id:DataSave.id},module,dispatch) RA(37, { id: DataSave.id }, module, dispatch)
// applyfor_name: "jack-小白白"
// communityId: "7e5c6fd2f4ba497a90e64535df6e9088"
// community_build_decorate: "01"
// community_floor_decorate: "00"
// community_name: "A4"
// community_room_decoate: "767"
// contact_name: "15626274096"
// contact_phone: "jack-小白白"
// create_time: {date: 10, day: 4, hours: 19, minutes: 39, month: 8, …}
// decorationBegin_time: {date: 10, day: 4, hours: 0, minutes: 0, month: 8, …}
// decorationEnd_time: {date: 10, day: 4, hours: 0, minutes: 0, month: 8, …}
// decoration_content: "滚滚滚"
// decoration_status: 0
// deleted: 0
// id: "977591272158003200"
// ownerId: "c4da40676d044487b37e7a1bdc6dd045"
// update_time:
} }
}, [DataSave]) }, [DataSave])
const onFinish = (values:any) => { const onFinish = (values: any) => {
console.log(values)
var tmp={ if (values.decorationStatus === "2" && (values.replyView == undefined || values.replyView.trim() === "")) {
communityId : DataSave.communityId, message.warning('Replies must be entered!');
id:DataSave.id, return;
ownerId:DataSave.ownerId, }
decorationStatus:values.decorationStatus,
replyName:getCookie("name"), var tmp = {
replyPhone:getCookie("phone"), communityId: DataSave.communityId,
replyView:values.replyView, id: DataSave.id,
type:"6" ownerId: DataSave.ownerId,
decorationStatus: values.decorationStatus,
replyName: getCookie("name"),
replyPhone: getCookie("phone"),
replyView: values.replyView,
type: "6"
} }
console.log(tmp) // console.log(tmp)
RA(33,tmp,module,dispatch); RA(33, tmp, module, dispatch);
message.success('Success Operation!'); message.success('Success Operation!');
history.push('/CommercialService/RenovationApplication') history.push('/CommercialService/RenovationApplication')
} }
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
{ {
DataSave!=null?<> DataSave != null ? <>
<TitleBack sublist={['Status : ' + decoration_status[DataSave.decoration_status][1], 'Time : ' + timestampToTime(DataSave.create_time.time)]} title={"Renovation Detail"}></TitleBack> <TitleBack sublist={['Status : ' + decoration_status[DataSave.decoration_status][1], 'Time : ' + timestampToTime(DataSave.create_time.time)]} title={"Renovation Detail"}></TitleBack>
<Row gutter={8}> <Row gutter={8}>
...@@ -82,57 +72,56 @@ const RenovationDetail = (props:any) => { ...@@ -82,57 +72,56 @@ const RenovationDetail = (props:any) => {
<Col>{DataSave.community_build_decorate}#{DataSave.community_floor_decorate}-{DataSave.community_room_decoate}</Col> <Col>{DataSave.community_build_decorate}#{DataSave.community_floor_decorate}-{DataSave.community_room_decoate}</Col>
</Row> </Row>
<Row gutter={8} style={{marginTop:16}}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col>Address:</Col> <Col>Address:</Col>
<Col>{DataSaveDetail!=null?DataSaveDetail.data.rows.communityDetail.residentialAddress+" "+DataSaveDetail.data.rows.communityDetail.residentialZipCode:null}</Col> <Col>{DataSaveDetail != null ? DataSaveDetail.data.rows.communityDetail.residentialAddress + " " + DataSaveDetail.data.rows.communityDetail.residentialZipCode : null}</Col>
</Row> </Row>
<Row gutter={8} style={{marginTop:16}}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col>Owner Name:</Col> <Col>Owner Name:</Col>
<Col span={3}>{DataSave.applyfor_name}</Col> <Col span={3}>{DataSave.applyfor_name}</Col>
<Col>Phone:</Col> <Col>Phone:</Col>
<Col>13169646231</Col> <Col>13169646231</Col>
</Row> </Row>
<Line></Line> <Line></Line>
<Row gutter={8} style={{marginTop:16}}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Contract Name:</Col> <Col span={3}>Contract Name:</Col>
<Col span={3}>{DataSave.contact_name}</Col> <Col span={3}>{DataSave.contact_name}</Col>
<Col>Phone:</Col> <Col>Phone:</Col>
<Col>{DataSave.contact_phone}</Col> <Col>{DataSave.contact_phone}</Col>
</Row> </Row>
<Row gutter={8} style={{marginTop:16}}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Time:</Col> <Col span={3}>Time:</Col>
<Col span={3}>{timestampToTime(DataSave.decorationBegin_time.time)}</Col> <Col span={3}>{timestampToTime(DataSave.decorationBegin_time.time)}</Col>
<Col>{timestampToTime(DataSave.decorationEnd_time.time)}</Col> <Col>{timestampToTime(DataSave.decorationEnd_time.time)}</Col>
</Row> </Row>
<Row gutter={8} style={{marginTop:16}}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reason:</Col> <Col span={3}>Reason:</Col>
<Col><TextArea disabled value={DataSave.decoration_content} style={{width:300,height:100,padding:8}}></TextArea></Col> <Col><TextArea disabled value={DataSave.decoration_content} style={{ width: 300, height: 100, padding: 8 }}></TextArea></Col>
</Row> </Row>
<Line></Line> <Line></Line>
<Form ref={formRef} name="basic" onFinish={onFinish}> <Form ref={formRef} name="basic" onFinish={onFinish}>
<Row gutter={8} style={{marginTop:16}}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Approval For Application:</Col> <Col span={3}>Approval For Application:</Col>
<Col ><Form.Item name="decorationStatus"><Radio.Group ><Radio.Button value={"1"}>Agree</Radio.Button > <Radio.Button style={{marginLeft:10}} value={"2"}>Reject</Radio.Button ></Radio.Group></Form.Item></Col> <Col ><Form.Item name="decorationStatus" rules={[{ required: true, message: 'You have to choose an outcome!' }]}><Radio.Group><Radio.Button value={"1"}>Agree</Radio.Button > <Radio.Button style={{ marginLeft: 10 }} value={"2"}>Reject</Radio.Button ></Radio.Group></Form.Item></Col>
</Row> </Row>
<Row gutter={8} style={{marginTop:16}}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reply:</Col> <Col span={3}>Reply:</Col>
<Col><Form.Item name="replyView"><TextArea style={{width:300,height:100,padding:8}}></TextArea></Form.Item></Col> <Col><Form.Item name="replyView"><TextArea style={{ width: 300, height: 100, padding: 8 }}></TextArea></Form.Item></Col>
</Row> </Row>
<Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item> <Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</Form> </Form>
</> : null}
</>:null}
</div> </div>
); );
}; };
function map(state:any) { function map(state: any) {
const { DataSave,DataSaveDetail} = state[module] const { DataSave, DataSaveDetail } = state[module]
return { DataSave,DataSaveDetail} return { DataSave, DataSaveDetail }
} }
export default connect(map)(RenovationDetail); export default connect(map)(RenovationDetail);
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import styles from './Edit.less'; import styles from './Edit.less';
import { Input, Button, Form, Result, Pagination, Tooltip, Checkbox } from 'antd'; import { Input, Button, Form, Result, Pagination, Tooltip, Checkbox, Spin } from 'antd';
import { Link, useIntl, connect } from 'umi'; import { Link, useIntl, connect } from 'umi';
...@@ -16,6 +16,9 @@ const Edit = (props: any) => { ...@@ -16,6 +16,9 @@ const Edit = (props: any) => {
const [CList, setCList] = useState(CommunityList); const [CList, setCList] = useState(CommunityList);
const [SList, setSList] = useState(["1"]) const [SList, setSList] = useState(["1"])
const [load, setload] = useState(false)
const printContent = (List: any) => { setCList(List) } const printContent = (List: any) => { setCList(List) }
const formRef = useRef(null); const formRef = useRef(null);
...@@ -44,7 +47,7 @@ const Edit = (props: any) => { ...@@ -44,7 +47,7 @@ const Edit = (props: any) => {
// val.serviceScopeList = SList // val.serviceScopeList = SList
val.creator = "admin"; val.creator = "admin";
val.updater = "admin"; val.updater = "admin";
setload(true)
TosTosServiceProviderSave(val) TosTosServiceProviderSave(val)
}; };
const onFinishFailed = (errorInfo: any) => { const onFinishFailed = (errorInfo: any) => {
...@@ -57,7 +60,8 @@ const Edit = (props: any) => { ...@@ -57,7 +60,8 @@ const Edit = (props: any) => {
{/* 头部组件v1.2 */} {/* 头部组件v1.2 */}
<TitleBack title="Edit Service Provider" /> <TitleBack title="Edit Service Provider" />
<Form ref={formRef} name="basic" initialValues={{}} onFinish={onFinish} onFinishFailed={onFinishFailed}> <Form ref={formRef} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed}>
<Spin spinning={load} tip="In the submission,Please Wait...">
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Company Name</div> <div className={styles.box1item1}>Company Name</div>
<div className={styles.box1item2}> <div className={styles.box1item2}>
...@@ -140,6 +144,7 @@ const Edit = (props: any) => { ...@@ -140,6 +144,7 @@ const Edit = (props: any) => {
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit">Submit</Button> <Button type="primary" htmlType="submit">Submit</Button>
</Form.Item> </Form.Item>
</Spin>
</Form> </Form>
</div> </div>
......
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