Commit 01e4a8da authored by Sixiang_Zzb's avatar Sixiang_Zzb

小区服务 图片显示处理 新增服务商错误提示修改

parent 9cd8bfa2
......@@ -173,24 +173,24 @@ export default {
yield put({ type: 'returnCurDataDetail', CurDataDetail });
},
*ResultClear({}, { put }: any) {
*ResultClear({ }, { put }: any) {
var Result = null;
console.log('清除');
yield put({ type: 'returnResult', Result });
},
*DataSaveDetailClear({}, { put }: any) {
*DataSaveDetailClear({ }, { put }: any) {
console.log('清楚数据');
let DataSaveDetail = null;
yield put({ type: 'returnDataSaveDetail', DataSaveDetail });
},
*DataSaveClear({}, { put }: any) {
*DataSaveClear({ }, { put }: any) {
let DataSave = null;
yield put({ type: 'returnDataSave', DataSave });
},
*Data7Clear({}, { put }: any) {
*Data7Clear({ }, { put }: any) {
let Data7 = null;
yield put({ type: 'returnPage7', Data7 });
},
......
import * as service from '../services/tos';
import { message } from 'antd';
import { message, Modal } from 'antd';
export default {
namespace: 'ServiceProvider',
......@@ -27,6 +27,7 @@ export default {
return { ...state, SaveChooseData };
},
returnCurData(state: object, { CurData }: any) {
console.log(CurData)
return { ...state, CurData };
},
returnResult(state: object, { Result }: any) {
......@@ -56,17 +57,46 @@ export default {
console.log(playload);
const resp = yield call(service.TosTosServiceProviderSave, playload);
console.log(resp);
if (resp.code == 500) {
let CurData = false;
yield put({ type: 'returnCurData' }, CurData);
// 服务范围选择错误
if (resp.error_code === "0002") {
let CurData: Boolean = false;
yield put({ type: "returnCurData", CurData });
// message.error("Service scope selection error!!!")
Modal.error({
title: 'Service scope selection error',
content: 'Accounting service / security service provider is a single option!!!',
});
return;
}
// 小区选择错误
if (resp.error_code === "0003") {
let CurData: Boolean = false;
yield put({ type: "returnCurData", CurData });
Modal.error({
title: 'Community selection error',
content: 'You cannot select a community that already has a scope of service!!!',
});
return;
}
// 提交失败
if (resp.error_code === "0001") {
let CurData: Boolean = false;
yield put({ type: 'returnCurData', CurData });
message.error('Creation failed. Please try again!');
// window.location.href = '/500';
} else {
let CurData = true;
yield put({ type: 'returnCurData' }, CurData);
return;
}
// 创建成功
if (resp.error_code === "0000") {
message.success('Operator Success!', 1.5, () => {
window.location.href = '/UserManagement/ServiceProviderManagement';
});
let CurData: Boolean = true;
yield put({ type: 'returnCurData', CurData });
return;
}
},
......
......@@ -112,8 +112,8 @@ const Detail = (props: any) => {
<Descriptions.Item label="Address" span={3}>
{CurDataDetail.address}{' '}
</Descriptions.Item>
<Descriptions.Item label="User Name">{CurDataDetail.name}</Descriptions.Item>
<Descriptions.Item label="Contact Details">{CurDataDetail.phone}</Descriptions.Item>
<Descriptions.Item label="User Name" span={3}>{CurDataDetail.name}</Descriptions.Item>
<Descriptions.Item label="Contact Details" >{CurDataDetail.phone}</Descriptions.Item>
<Descriptions.Item>{CurDataDetail.email}</Descriptions.Item>
</Descriptions>
<Row gutter={16}>
......@@ -131,17 +131,19 @@ const Detail = (props: any) => {
<Col span={3}>Picture:</Col>
<Col>
{CurDataDetail != null ? (
<PictureOptionsRow
action="/tos/communtiy/service/reply/img"
disabled={true}
defaultValue={CurDataDetail.pictrues}
// defaultValue={v.url}
value={CurDataDetail.pictrues}
data={{
userToken: 'token',
imageType: 'tosCommunityImageReply',
extends: '',
}}
//
/>
) : null}
</Col>
</Row>
......
......@@ -49,19 +49,19 @@ const PropertyServices = (props: any) => {
// const [readyData, setReadyData] = useState(null);
const columns = [
{ title: 'Community Name', dataIndex: 'community_name' },
{ title: 'Owner Name', dataIndex: 'owner_name' },
{ title: 'Community', dataIndex: 'community_name' },
{ title: 'Requestor', dataIndex: 'owner_name' },
{
title: parseInt(serviceTypeGobal) - 1 === 0 ? 'Replier' : 'Content',
title: parseInt(serviceTypeGobal) - 1 === 0 ? 'Attended By' : 'Content',
dataIndex: parseInt(serviceTypeGobal) - 1 === 0 ? 'handle_name' : 'service_content',
ellipsis: true,
width: 400,
render: (text: any) => <Space size="middle">{text != null ? text : '--'}</Space>,
// width: 400,
render: (text: any) => <Space size="middle">{text != null ? text : ''}</Space>,
},
{
title: 'Create Time',
title: 'Submission Time',
dataIndex: 'create_time',
render: (text: any, record: any) => (
<Space size="middle">{timestampToTime3(text.time)}</Space>
......
import React, { useState, useEffect, useRef } from 'react';
import styles from './Edit.less';
import { Input, Button, Form, Spin, Radio, message } from 'antd';
import { Input, Button, Form, Spin, Radio, message, Checkbox } from 'antd';
import { connect, history } from 'umi';
......@@ -48,6 +48,11 @@ const Edit = (props: any) => {
optionsList = [...DataServices.data.rows];
}
return () => {
}
}, [DataServices]);
// 判断是否有小区列表数据返回
......@@ -88,7 +93,7 @@ const Edit = (props: any) => {
val.serviceCommunityList = CList;
val.creator = 'admin';
val.updater = 'admin';
val.serviceScopeList = [val.serviceScopeList];
// val.serviceScopeList = val.serviceScopeList;
if (SaveChooseData) {
val.id = SaveChooseData.id;
}
......@@ -157,8 +162,8 @@ const Edit = (props: any) => {
},
]}
>
{/* <Checkbox.Group options={options as any} /> */}
<Radio.Group options={options as any} />
<Checkbox.Group options={options as any} />
{/* <Radio.Group options={options as any} /> */}
</Form.Item>
</div>
</div>
......@@ -233,6 +238,7 @@ function mapStateToProps(state: any) {
const { CurData, SaveChooseData } = state.ServiceProvider;
const { DataServices } = state.User;
const { CommunityList } = state.Init;
console.log(CurData)
return {
CurData,
SaveChooseData,
......
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