Commit 5a981862 authored by cellee's avatar cellee

修复设施、公告、合同bug ,重做权限管理页面

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 7ba2ef55
...@@ -2,7 +2,7 @@ import * as service from '../../services/tos'; ...@@ -2,7 +2,7 @@ import * as service from '../../services/tos';
import { message } from 'antd'; import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi'; import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router' import { routerRedux } from 'dva/router';
import { printf } from '@/utils/log'; import { printf } from '@/utils/log';
...@@ -12,63 +12,64 @@ export default { ...@@ -12,63 +12,64 @@ export default {
Data: null, Data: null,
Result: null, Result: null,
DataSave: null, DataSave: null,
DataSaveDetail:null, DataSaveDetail: null,
}, },
reducers: { reducers: {
returnPage(state, { Data}) { returnPage(state, { Data }) {
return { ...state, Data }; return { ...state, Data };
}, },
returnResult(state, { Result}) { returnResult(state, { Result }) {
return { ...state, Result}; return { ...state, Result };
}, },
returnDataSave(state, { DataSave }) { returnDataSave(state, { DataSave }) {
return {...state,DataSave} return { ...state, DataSave };
}, },
returnDataSaveDetail(state, { DataSaveDetail }) { returnDataSaveDetail(state, { DataSaveDetail }) {
return {...state,DataSaveDetail} return { ...state, DataSaveDetail };
}, },
}, },
effects: { effects: {
//标准请求 //标准请求
*RA({ playload }, { call, put }) { *RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload); const resp = yield call(service.RA, playload);
console.log(resp) console.log(resp);
if (resp.code == 500||resp.error_code!="0000") { if (resp.code == 500 || resp.error_code != '0000') {
} }
if (resp.error_code != "0000") { if (resp.error_code != '0000') {
printf(playload, resp) printf(playload, resp);
} } else {
else {
switch (playload.index) { switch (playload.index) {
case 41: { case 41:
// let Data = resp.data; {
// yield put({ type: 'returnPage', Data }); // let Data = resp.data;
} break; // yield put({ type: 'returnPage', Data });
case 42: { }
history.go(-1) break;
} break; case 42:
case 45: { {
let Data = resp; history.go(-1);
yield put({ type: 'returnPage', Data }); }
} break; break;
case 45:
{
let Data = resp.data;
yield put({ type: 'returnPage', Data });
}
break;
} }
} }
}, },
*ResultClear({ }, { put }) { *ResultClear({}, { put }) {
var tmp=null var tmp = null;
yield put({type: 'returnResult', tmp} ) yield put({ type: 'returnResult', tmp });
}, },
*SA({ playload }, { call, put }) { *SA({ playload }, { call, put }) {
var DataSave = playload var DataSave = playload;
yield put({type: 'returnDataSave', DataSave} ) yield put({ type: 'returnDataSave', DataSave });
}, },
}, },
}; };
This diff is collapsed.
.contop {
background: #fff;
padding: 20px;
border-right: 4px;
margin-bottom: 15px;
.pages {
text-align: right;
padding: 10px;
}
}
.contop2 {
padding: 0 10px 20px;
}
...@@ -16,8 +16,6 @@ const Contract = (props: any) => { ...@@ -16,8 +16,6 @@ const Contract = (props: any) => {
dispatch({ type: 'Contract/RA', playload: { index: index, body: values } }); dispatch({ type: 'Contract/RA', playload: { index: index, body: values } });
}; };
console.log(userListLoading);
// 把请求装在一个地方 // 把请求装在一个地方
function requst(payload: any) { function requst(payload: any) {
dispatch({ type: 'ContractModel/getList', payload: payload }); dispatch({ type: 'ContractModel/getList', payload: payload });
......
...@@ -18,6 +18,8 @@ import locale from 'antd/es/date-picker/locale/en_US'; ...@@ -18,6 +18,8 @@ import locale from 'antd/es/date-picker/locale/en_US';
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity';
import { tipList } from '@/utils/tip'; import { tipList } from '@/utils/tip';
import FileViewer from 'react-file-viewer';
const ContractContent = (props: any) => { const ContractContent = (props: any) => {
const { ContractModel, dispatch } = props; const { ContractModel, dispatch } = props;
const { RangePicker } = DatePicker; // 日期组件 const { RangePicker } = DatePicker; // 日期组件
...@@ -33,7 +35,9 @@ const ContractContent = (props: any) => { ...@@ -33,7 +35,9 @@ const ContractContent = (props: any) => {
const startTime = moment().format('YYYY-MM-DD'); // 开始默认事件 const startTime = moment().format('YYYY-MM-DD'); // 开始默认事件
const overTime = moment().add(1, 'month').format('YYYY-MM-DD'); // 结束默认事件 const overTime = moment().add(1, 'month').format('YYYY-MM-DD'); // 结束默认事件
const [fileList, setFileList] = useState([] as any); const [fileList, setFileList] = useState([] as any); // 图片列表
const [uploadUp, setUploadUp] = useState(true); // 禁止上传 直到选择了小区后
const [comtyName, setComtyName] = useState(null); // 小区名字
console.log(tipList); console.log(tipList);
...@@ -44,13 +48,17 @@ const ContractContent = (props: any) => { ...@@ -44,13 +48,17 @@ const ContractContent = (props: any) => {
} else if (ContractModel.record === 0) { } else if (ContractModel.record === 0) {
form.resetFields(); form.resetFields();
} else { } else {
// 发起请求
RA(47, ContractModel.record.contractFileName);
let arr = ContractModel.record.contractFileName.split(','); let arr = ContractModel.record.contractFileName.split(',');
let obj = new Array(); let obj = new Array();
for (var i in arr) { for (var i in arr) {
let a = { let a = {
uid: arr[i], uid: i,
name: arr[i], name: arr[i],
url: 'http://', status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
}; };
obj.push(a); obj.push(a);
} }
...@@ -99,7 +107,7 @@ const ContractContent = (props: any) => { ...@@ -99,7 +107,7 @@ const ContractContent = (props: any) => {
const uploadProps = { const uploadProps = {
accept: '.doc,.docx,.jpg,.png,.pdf', accept: '.doc,.docx,.jpg,.png,.pdf',
action: '/tos/image/upload', action: '/tos/image/upload',
data: { imageType: 'tosContract' }, data: { imageType: 'tosContract', extends: comtyName },
fileList: fileList, fileList: fileList,
onChange({ file, fileList }: { file: any; fileList: any }) { onChange({ file, fileList }: { file: any; fileList: any }) {
setFileList(fileList); setFileList(fileList);
...@@ -128,6 +136,13 @@ const ContractContent = (props: any) => { ...@@ -128,6 +136,13 @@ const ContractContent = (props: any) => {
}; };
// 选择小区名字并赋值 // 选择小区名字并赋值
const opname = (value: any) => { const opname = (value: any) => {
// 打开上传 如果选择了 小区就打开 否则 禁止上传
value ? setUploadUp(false) : setUploadUp(true);
// 如果切换了 清掉上传的图片
if (value != comtyName) {
setFileList([]);
}
setComtyName(value); // 赋值小区名字 给到上传
form.setFieldsValue({ form.setFieldsValue({
communityName: value, communityName: value,
}); });
...@@ -238,7 +253,7 @@ const ContractContent = (props: any) => { ...@@ -238,7 +253,7 @@ const ContractContent = (props: any) => {
label="Contract Annex" label="Contract Annex"
rules={[{ required: true, message: `${tipList[6]}` }]} rules={[{ required: true, message: `${tipList[6]}` }]}
> >
<Upload {...uploadProps} listType={'picture-card'}> <Upload {...uploadProps} listType={'picture-card'} disabled={uploadUp}>
{fileList.length >= 3 ? null : <PlusOutlined />} {fileList.length >= 3 ? null : <PlusOutlined />}
</Upload> </Upload>
</Form.Item> </Form.Item>
...@@ -259,7 +274,7 @@ const ContractContent = (props: any) => { ...@@ -259,7 +274,7 @@ const ContractContent = (props: any) => {
></TextArea> ></TextArea>
</Form.Item> </Form.Item>
</div> </div>
<div className={styles.box8item2x2}> <div className={styles.box8item2x2} style={{ marginLeft: 150 }}>
The system will send out reminders of contract expiration on 25 . The system will send out reminders of contract expiration on 25 .
{/* <span style={{color:'#f00'}}>&nbsp;{stateTime}</span> */} {/* <span style={{color:'#f00'}}>&nbsp;{stateTime}</span> */}
</div> </div>
...@@ -268,7 +283,7 @@ const ContractContent = (props: any) => { ...@@ -268,7 +283,7 @@ const ContractContent = (props: any) => {
<div> <div>
<LINE /> <LINE />
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
Conserve Submit
</Button> </Button>
</div> </div>
</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