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