Commit 1596dbf3 authored by cellee's avatar cellee

Signed-off-by: cellee <893264950@qq.com>

parent eb1dda02
/*
* @Author: your name
* @Date: 2020-12-01 18:40:06
* @LastEditTime: 2021-04-26 17:35:57
* @LastEditTime: 2021-05-20 09:50:09
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\config\config.ts
......@@ -395,6 +395,7 @@ export default defineConfig({
name: 'service',
routes: [
{ path: './', component: './AccountManagement/Service/service' },
{ path: './add', component: './AccountManagement/Service/serviceAdds' },
{ path: './edit/:id', component: './AccountManagement/Service/serviceEdit' },
{
path: './detail/:id',
......
/*
* @Author: your name
* @Date: 2021-01-30 16:16:41
* @LastEditTime: 2021-04-23 18:50:35
* @LastEditTime: 2021-05-06 09:39:51
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\components\Form\ZipCode.tsx
......
/*
* @Author: your name
* @Date: 2020-12-02 09:42:49
* @LastEditTime: 2021-02-06 13:24:38
* @LastEditTime: 2021-05-20 14:22:39
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\components\SearchOptions\SearchOptionsTow.tsx
......
/*
* @Author: your name
* @Date: 2021-01-14 09:23:51
* @LastEditTime: 2021-03-11 14:36:23
* @LastEditTime: 2021-05-21 15:32:36
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\models\CommunityManagement\Bug.ts
......@@ -55,6 +55,7 @@ export default {
switch (playload.index) {
case 68: // 获取列表
{
// console.log(resp.data);
let Data = resp.data;
yield put({ type: 'returnPage', Data });
}
......@@ -65,26 +66,33 @@ export default {
yield put({ type: 'returnDataSave', DataSave });
}
break;
case 72: // 小区改变
case 72: // 改变
{
let Community = resp.data;
Community.communityName = playload.body.communityName;
yield put({ type: 'returnDataSaveCommunity', Community });
}
break;
case 70: // 小区编辑保存
case 71: // 小区回复保存
case 71: // 回复保存
{
let Data = null;
yield put({ type: 'returnPage', Data });
history.push('/AccountManagement/service');
}
break;
case 70: // 编辑保存
{
let Result = {
state: 2,
};
yield put({ type: 'returnResult', Result });
}
break;
case 73: // 删除报告
{
let Result = {
msg: 'Successfully deleted',
state: '0000',
state: 1,
};
yield put({ type: 'returnResult', Result });
// let Community = resp.data;
......@@ -92,6 +100,11 @@ export default {
// yield put({ type: 'returnDataSaveCommunity', Community });
}
break;
case 77: // 获取列表
{
history.push('/AccountManagement/service');
}
break;
}
}
},
......@@ -103,7 +116,7 @@ export default {
let DataSave = null;
yield put({ type: 'returnDataSave', DataSave });
},
*Result({ playload }, { call, put }) {
*Results({ playload }, { call, put }) {
let Result = null;
yield put({ type: 'returnResult', Result });
},
......
.contop {
position: relative;
padding: 20px;
.listBut {
position: absolute;
right: 20px;
bottom: 25px;
}
}
.pages {
padding: 20px;
......@@ -17,12 +23,26 @@
margin-bottom: 18px;
}
hr {
border: 0;
height: 1px;
background: #eee;
margin-bottom: 24px;
background: #eee;
border: 0;
}
.diys {
display: inline-block;
margin-left: 10%;
}
.psoBox {
position: relative;
.psoBtn {
// float: right;
margin-left: 30px;
}
}
.flex {
display: flex;
align-items: center;
justify-content: end;
}
import React, { useState, useEffect } from 'react';
import { Space, message, Pagination, Spin } from 'antd';
import { Space, message, Pagination, Button } from 'antd';
import { connect, history } from 'umi';
import { PlusOutlined } from '@ant-design/icons';
import ProTable from '@ant-design/pro-table';
......@@ -69,7 +70,7 @@ const service = (props: any) => {
const { Data, dispatch, loading, Init, location } = props;
const [locationkey, setlocationkey] = useState(null as any); // 是否从其他列表刷新来的
const [term, setTerm] = useState(null as any); // 拉取数据的条件存储
const [term, setTerm] = useState({} as any); // 拉取数据的条件存储
// 监听是否有数据
useEffect(() => {
......@@ -83,7 +84,7 @@ const service = (props: any) => {
setTerm({ ...obj });
RA(68, obj, module, dispatch);
}
}, [location, Init]);
}, [location, Init, Data]);
// 清除操作之前的数据
const emptys = (data: any, url: any) => {
......@@ -122,6 +123,10 @@ const service = (props: any) => {
// console.log(page)
};
const adds = () => {
history.push('/AccountManagement/service/Add');
};
return (
<div>
<>
......@@ -133,11 +138,14 @@ const service = (props: any) => {
checklist={Init ? Init.CommunityList : []}
onSubmit={CallBackTitleSearch}
/>
<Button className="listBut" type="primary" onClick={() => adds()} icon={<PlusOutlined />}>
Create Report
</Button>
</div>
<ProTable
pagination={false} // 隐藏默认分页
rowKey={'id'}
dataSource={Data ? Data.list : null}
rowKey={'id'}
columns={columns}
search={false}
loading={loading}
......
/*
* @Author: your name
* @Date: 2021-03-02 14:39:40
* @LastEditTime: 2021-05-20 16:32:22
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\pages\AccountManagement\Service\serviceEdit.tsx
*/
import React, { useState, useEffect } from 'react';
import { Button, Spin, Form, Input, message } from 'antd';
import { connect } from 'umi';
import { PlusOutlined } from '@ant-design/icons';
const { TextArea } = Input;
import { RA } from '@/utils/method';
const module = 'ServicePro';
import './service.less';
import TitleBack from '@/components/TitleBack/TitleBack';
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity';
import PictureOptionsRow from '@/components/PictureOptions/PictureOptionsRow';
const service = (props: any) => {
const { DataSave, dispatch, loading, match, user } = props;
const [term, setTerm] = useState(null as any); // 默认小区
const [ImageSrc, setImageSrc] = useState([] as any); // 图片地址
const [report, setreport] = useState([] as any); // 循环新增的报告
const [form] = Form.useForm();
// 监听是否有数据
useEffect(() => {
if (match.params.id) {
// RA(69, { id: match.params.id }, module, dispatch);
}
}, [match]);
useEffect(() => {
if (DataSave != null) {
}
}, [DataSave]);
//onFinish 提交
const onFinish = (values: any) => {
// 存储个数
let num = [];
// 先抽取所有的key
let obj = Object.keys(values);
// 再看有多少个 值
for (let i in obj) {
if (obj[i].indexOf('reportContent') != -1) {
num.push(obj[i]);
}
}
// 删除第一个
num.splice(num.indexOf('reportContent'), 1);
// 开始拼接
let tosReportRecordModels = [];
// 第一个是都有的
let requte = {
reporterId: user.currentUser.userModel.id,
communityName: values.communityName,
imagesList: values.imagesList,
reportContent: values.reportContent,
};
// 添加进去
tosReportRecordModels.push(requte);
// 如果存在其他的
if (num.length > 0) {
num.forEach((i, idx) => {
let img = 'imagesList' + idx;
let cont = 'reportContent' + idx;
let objs = {
reporterId: user.currentUser.userModel.id,
communityName: values.communityName,
imagesList: values[img],
reportContent: values[cont],
};
tosReportRecordModels.push(objs);
});
}
// 最后结果
let oves = {
tosReportRecordModels,
};
// 再发起请求
RA(77, oves, module, dispatch);
};
// 选择小区名字并赋值
const opname = (value: any) => {
// if (value) {
// RA(72, { communityName: value }, module, dispatch);
// }
// setTerm(value);
form.setFieldsValue({
communityName: value,
});
};
// 增加
const addItem = () => {
// 先检查表单内容填完了没
let objs = form.getFieldsValue();
// 存在没填写的就禁止增加
for (let i in objs) {
if (typeof objs[i] === 'undefined') {
message.warning('Please enter all information!');
return false;
}
}
// 再新增
let a = report;
a.push(report.length);
setreport([...a]);
};
return (
<Spin spinning={loading}>
<div className="edit">
{/* 标题 */}
<TitleBack title={'Add report'} />
{/* 信息 */}
<div className="form_s">
<Form
name="basic"
form={form}
initialValues={{ remember: true }}
labelCol={{ xs: 12, sm: 6, md: 6, lg: 4, xl: 4, xxl: 2 }}
wrapperCol={{ xs: 12, sm: 18, md: 18, lg: 20, xl: 20, xxl: 22 }}
onFinish={onFinish}
>
{/* 小区名 */}
<Form.Item label="Estate" name="communityName" rules={[{ required: true }]}>
<SearchOptionsCommnity
// ubmit={extendName}
opname={opname}
defaultName={term ? term.communityName : null}
// type={1} // 单选还是多选 单选就直接去掉
/>
</Form.Item>
{/* 报告描述 */}
<Form.Item label="Description" name="reportContent" rules={[{ required: true }]}>
<div className="psoBox flex">
<TextArea rows={4} style={{ maxWidth: 600, width: '100%' }} />
{report.length == 0 ? (
<div className="psoBtn">
<Button
shape="circle"
icon={<PlusOutlined />}
onClick={() => {
addItem();
}}
/>
</div>
) : (
''
)}
</div>
</Form.Item>
{/* 报告图片 */}
<Form.Item label="Picture" name="imagesList" rules={[{ required: true }]}>
<PictureOptionsRow
action="/tos/image/upload"
data={{
imageType: 'tosReportImage',
identification: '',
}}
limitNums={10}
imgs={ImageSrc}
over={loading}
/>
</Form.Item>
<hr></hr>
{/* --------------------------------------------------------------------------------------------- */}
{report.map((i: any, idx: any) => {
return (
<div key={idx}>
<Form.Item
label="Description"
name={'reportContent' + idx}
rules={[{ required: true }]}
>
<div className="psoBox flex">
<TextArea rows={4} style={{ maxWidth: 600, width: '100%' }} />
{idx == report.length - 1 ? (
<div className="psoBtn">
<Button
shape="circle"
icon={<PlusOutlined />}
onClick={() => {
addItem();
}}
/>
</div>
) : (
''
)}
</div>
</Form.Item>
<Form.Item label="Picture" name={'imagesList' + idx} rules={[{ required: true }]}>
<PictureOptionsRow
action="/tos/image/upload"
data={{
imageType: 'tosReportImage',
identification: '',
}}
limitNums={10}
imgs={ImageSrc}
over={loading}
/>
</Form.Item>
<hr></hr>
</div>
);
})}
{/* --------------------------------------------------------------------------------------------- */}
{/* 提交 */}
<Form.Item label=" " colon={false}>
<Button type="primary" loading={loading} htmlType="submit">
Submit
</Button>
</Form.Item>
</Form>
</div>
</div>
</Spin>
);
};
function map(state: any) {
const loading = state.loading.global;
const { Init, user } = state;
const { DataSave, curString, village } = state[module];
return { DataSave, loading, curString, village, Init, user };
}
export default connect(map)(service);
......@@ -97,8 +97,8 @@ const Renovation = (props: any) => {
},
{
title: 'Requestor',
dataIndex: 'name',
key: 'name',
dataIndex: 'applyName',
key: 'applyName',
render: (text: string, record: { exist: string }) => {
return (
<div>
......@@ -170,7 +170,8 @@ const Renovation = (props: any) => {
serviceType = index;
}
});
// console.log(WebUrl[serviceType]);
//
// applyName
// 搜索条件
let objs = {
......@@ -178,8 +179,15 @@ const Renovation = (props: any) => {
handleStatus:
location.query.handleStatus !== undefined ? parseInt(location.query.handleStatus) : null,
pageNum,
applyName: tmp.applyforName,
};
if (serviceType == 0) {
delete objs.applyName;
} else {
delete objs.applyforName;
}
// 请求
RA(serviceType == 0 ? 23 : 74, objs, module, dispatch);
}, [location]);
......
......@@ -364,11 +364,16 @@ const Adds = (props: any) => {
placeholder="Please enter phone"
maxLength={11}
onKeyUp={keyup_communityManagerFee}
autocomplete="off"
/>
</Form.Item>
{/* 小区邮箱 */}
<Form.Item name="residentialEmail" label="Email" rules={village[5] as any}>
<Input style={{ width: '240px' }} placeholder="Please enter email" />
<Input
style={{ width: '240px' }}
placeholder="Please enter email"
autocomplete="off"
/>
</Form.Item>
{/* 小区管理员 */}
<Form.Item
......@@ -376,7 +381,12 @@ const Adds = (props: any) => {
name="residentialManagerUserName"
rules={village[6] as any}
>
<Input style={{ width: '240px' }} placeholder="Please enter name" maxLength={30} />
<Input
style={{ width: '240px' }}
placeholder="Please enter name"
maxLength={30}
autocomplete="off"
/>
</Form.Item>
{/* 小区缴费方式 */}
<Form.Item label="Property Fee" name="propertyFee" style={{ marginBottom: '0' }}>
......
......@@ -2,41 +2,41 @@ li {
list-style: none;
}
.contop {
padding: 15px 15px 10px;
background: #fff;
margin-bottom: 15px;
padding: 20px;
background: #fff;
}
.listbox {
width: 100%;
background-color: #ffffff;
padding: 10px;
background-color: #ffffff;
}
// 添加
.form {
padding: 20px;
overflow: auto;
background: #fff;
border: 1px solid #efefef;
border-radius: 3px;
background: #fff;
box-shadow: 0 1px 1px #ccc;
overflow: auto;
h3 {
margin-bottom: 30px;
position: relative;
margin-bottom: 30px;
.back {
position: absolute;
right: 0;
top: 0;
right: 0;
margin-bottom: 20px;
background: #fff;
}
}
.li {
display: block;
min-width: 140px;
margin-top: 15px;
margin-left: 0;
display: block;
}
input {
width: 240px;
......@@ -54,19 +54,19 @@ li {
line-height: 34px;
}
hr {
border: 0;
height: 1px;
background: #eee;
margin-bottom: 20px;
background: #eee;
border: 0;
}
.tip {
padding: 10px 0 15px;
p {
display: none;
color: #67c23a;
&.show {
display: block;
}
color: #67c23a;
span {
margin-right: 5px;
}
......@@ -84,9 +84,9 @@ li {
.celBox {
position: relative;
.item {
margin-bottom: 15px;
font-size: 14px;
line-height: 35px;
margin-bottom: 15px;
label {
display: inline-block;
min-width: 160px;
......@@ -110,24 +110,24 @@ li {
}
.code {
position: absolute;
right: 5%;
top: 50%;
transform: translateY(-55%);
right: 5%;
width: 200px;
text-align: center;
transform: translateY(-55%);
li {
text-align: center;
line-height: 35px;
margin-bottom: 6px;
line-height: 35px;
text-align: center;
}
img {
border-radius: 3px;
margin-bottom: 5px;
border-radius: 3px;
}
.lis {
color: #67c23a;
font-size: 18px;
font-weight: 500;
font-size: 18px;
}
}
}
......@@ -136,8 +136,8 @@ li {
width: 100px;
}
.redFs {
font-size: 12px;
color: red;
font-size: 12px;
}
img {
......@@ -148,9 +148,9 @@ img {
text-transform: capitalize;
}
.pages {
background: #fff;
text-align: right;
padding: 10px;
text-align: right;
background: #fff;
}
// 必填
......@@ -175,7 +175,7 @@ img {
.acitves {
}
.pdfform {
background: #f4f4f4;
padding: 15px;
background: #f4f4f4;
}
}
......@@ -154,9 +154,9 @@ const Contract = (props: any) => {
opname={opname}
/>
</Form.Item>
<Form.Item name="contractNumber">
{/* <Form.Item name="contractNumber">
<Input allowClear placeholder="Contract Number" />
</Form.Item>
</Form.Item> */}
<Form.Item name="contractTitle">
<Input allowClear placeholder="Contract Title" />
</Form.Item>
......
/*
* @Author: your name
* @Date: 2020-11-19 20:34:18
* @LastEditTime: 2021-04-21 15:18:56
* @LastEditTime: 2021-05-20 11:00:23
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\params.ts
......@@ -64,14 +64,7 @@ export const requestList = [
['/tos/property/community/houseCard/query/detail', '36 获取住户卡详情', {}],
['/tos/property/decorate/record/get/detail', '37 获取装修记录详情', {}],
['/tos/users/save', '38 新建后台信息', {}],
[
'/tos/life/community/account/member/del',
'39 删除业主成员信息',
{
id: 'c06286cfe7b843cb96fdfcb987231123',
ownerId: '6b359755a36b49c28241a4620fa6539b',
},
],
['/tos/life/community/account/member/del', '39 删除业主成员信息', {}],
['/tos/community/service/get', '40 获取小区服务回复列表', {}],
['/tos/users/save', '41 添加后台账号', {}],
['/tos/account/permission/savePermission', '42 添加后台权限', {}],
......@@ -109,4 +102,5 @@ export const requestList = [
['/tos/community/moveOut/record/get', '74 迁出申请列表', {}],
['/tos/community/moveOut/record/get/detail', '75 迁出申请详情', {}],
['/tos/community/moveOut/record/reply', '76 迁出申请回复', {}],
['/tos/report/create', '77 报告新增', {}],
];
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