Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/H5/threeSide
| | |
| | | </swiper> |
| | | </view> |
| | | </view> |
| | | <view class="flex fs-27 font-bold a-center pt-38 pl-31"> |
| | | <!-- <view class="flex fs-27 font-bold a-center pt-38 pl-31"> |
| | | <image src="/static/home/社区@2x.png" mode="aspectFill" class="w-31 h-31 mr-12"></image> |
| | | 服务社区:文化社区 |
| | | </view> --> |
| | | <view class="flex j-between a-center pt-38 pl-31 pr-31"> |
| | | <view class="flex fs-27 font-bold a-center"> |
| | | <image src="/static/home/角色管理@2x.png" mode="aspectFill" class="w-31 h-31 mr-12"></image> |
| | | 当前角色:沙沟社区管理员 |
| | | </view> |
| | | <view class="fs-23 flex a-center border1 w-154 h-38 j-center br-29"> |
| | | <image src="/static/home/切换@2x.png" mode="aspectFill" class="w-19 h-19 mr-8"></image> |
| | | 切换角色 |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="pt-38 pl-31 pr-31 flex flex-column"> |
| | | <view class="flex j-between a-center"> |
| | | <text class="color1 fs-31 font-bold">工作台</text> |
| | | <text class="color2 fs-27" @click="showData =!showData">查看更多</text> |
| | | </view> |
| | | <view class="flex flex-wrap j-between"> |
| | | <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center" @click="onClick()"> |
| | | <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center relative" :class="true ? 'bg2' : 'bg1'" |
| | | @click="onClick()"> |
| | | <!-- <image src="/static/home/审核中@2x (1).png" mode="aspectFill" class="w-112 h-85 absolute" style="right: -12rpx;top: -23rpx;"></image> --> |
| | | <image class="w-94 h-77 ml-38" src="/static/home/img7.png" mode=""></image> |
| | | <text class="ml-37 font-bold">党员证件</text> |
| | | </view> |
| | |
| | | <image class="w-81 h-77 ml-38" src="/static/home/img8.png" mode=""></image> |
| | | <text class="ml-37 font-bold">统计分析</text> |
| | | </view> |
| | | |
| | | <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center" v-if="showData"> |
| | | <image class="w-81 h-77 ml-38" src="/static/home/Group 2@2x.png" mode=""></image> |
| | | <text class="ml-37 font-bold">党员审核</text> |
| | | </view> |
| | | </view> |
| | | <view class="flex j-between a-center mt-38"> |
| | | <text class="color1">消息通知</text> |
| | |
| | | isLoading: false, |
| | | noreadlist: [], |
| | | noreadlists: [], |
| | | changeRolePopup: true, |
| | | changeRolePopup: false, |
| | | activeRole: 1, |
| | | } |
| | | }, |
| | |
| | | background-color: rgba(255, 248, 230, 1); |
| | | } |
| | | |
| | | .bg2 { |
| | | background-color: #E5DFCF; |
| | | } |
| | | |
| | | .flex-wrap { |
| | | flex-wrap: wrap; |
| | | } |
| | |
| | | height: 1rpx; |
| | | background: #E5E5E5; |
| | | } |
| | | |
| | | .border1 { |
| | | border: 2rpx solid #FC8D55; |
| | | color: #FC8D55; |
| | | } |
| | | </style> |
| | |
| | | |
| | | <!-- 上级显示 --> |
| | | <view class="btnButtom" |
| | | v-if="[0, 1, 2, 6].includes(orderInfo.status) && !isParty && orderInfo.auditButtonStatus == 1"> |
| | | v-if="[0, 1, 2, 6].includes(orderInfo.status) && !isParty && orderInfo.listControlsButtonStatus == 0"> |
| | | <view class="btnDown" @click.stop="toUp" v-if="userInfo.accountLevel > 1" |
| | | :class="[2, 3].includes(userInfo.accountLevel) ? '' : 'partyUp'">问题上报</view> |
| | | <view class="btnDown" @click.stop="toDown" v-if="userInfo.accountLevel < 4" |
| | |
| | | </view> |
| | | <!-- 党员显示 --> |
| | | <!-- v-if="[3].includes(orderInfo.status)" --> |
| | | <view class="btnButtom" v-if="[3].includes(orderInfo.status)"> |
| | | <view class="btnButtom" v-if="[3].includes(orderInfo.status)&& orderInfo.evaluateButtonStatus == 0""> |
| | | <view class="btnAdd evaluate" @click.stop="toEvaluate">评价</view> |
| | | </view> |
| | | |
| | |
| | | import { Form, Input, Modal, Select, Upload, Space, Button, message, Row, Col, Divider } from 'antd'; |
| | | import { Form, Input, Modal, Image, Upload, Space, Cascader, message, Row, Col, Divider } from 'antd'; |
| | | import { sendRequest } from '@/utils/antdUtils'; |
| | | import { LoadingOutlined, PlusOutlined } from '@ant-design/icons'; |
| | | import { forwardRef, useEffect, useImperativeHandle, useState } from 'react'; |
| | | import { customRequest } from '@/utils/utils'; |
| | | import { add, Edit, getDetail } from '../service' |
| | | import { audit, getDetail,regionTree } from '../service' |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { span: 8 }, |
| | |
| | | const [fileList, setFileList] = useState([])//banner图片 |
| | | const [loading, setLoading] = useState(false); |
| | | const [editData, setEditData] = useState({}) |
| | | const [userInfo, setUserInfo] = useState({})//党员信息 |
| | | const [items, setItems] = useState([]); |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { span: 6 }, |
| | |
| | | useImperativeHandle(ref, () => { |
| | | return { |
| | | refreshData: (data) => { |
| | | |
| | | setEditData(data); |
| | | regionTree({}).then(res => { |
| | | setItems(() => res.data) |
| | | }) |
| | | if (data.id) { |
| | | // getDetail(data.id).then(res => { |
| | | // if (res.data.url) { |
| | | // let obj = [{ |
| | | // uid: 1, |
| | | // name: 'banner', |
| | | // url: res.data.url |
| | | // }] |
| | | // setFileList(obj) |
| | | // form.setFieldsValue({ image: obj }) |
| | | // } |
| | | // form.setFieldsValue({name: res.data.name}) |
| | | // }) |
| | | getDetail(data.id).then(res => { |
| | | res.data.community = [res.data.districtsCode, res.data.streetId, res.data.communityId.toString()] |
| | | setUserInfo(() => res.data) |
| | | form.setFieldsValue(res.data) |
| | | }) |
| | | } |
| | | }, |
| | | clean: () => { |
| | | form.resetFields(); |
| | | setUserInfo({}) |
| | | setFileList([]) |
| | | }, |
| | | }; |
| | |
| | | <Input disabled placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="name" |
| | | name="community" |
| | | label='所在社区' |
| | | required |
| | | > |
| | | <Input disabled placeholder='请输入'></Input> |
| | | <Cascader |
| | | disabled |
| | | options={items} |
| | | fieldNames={{ value: 'id', label: 'name' }} |
| | | placeholder="请选择" |
| | | // onChange={(value, label) => { |
| | | // console.log('value', value, '1', label) |
| | | // setCommunity(() => label) |
| | | // }} |
| | | // displayRender={(label) => label[label.length - 1]} |
| | | // changeOnSelect={true} |
| | | /> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="name" |
| | | name="avatar" |
| | | label='头像上传' |
| | | required |
| | | > |
| | | <Input disabled placeholder='请输入'></Input> |
| | | <Image src={userInfo.avatar} width={100} height={100} /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | <Form.Item |
| | | name="name" |
| | | name="phone" |
| | | label='联系电话' |
| | | required |
| | | > |
| | | <Input disabled placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="name" |
| | | name="serviceTarget" |
| | | label='服务对象' |
| | | required |
| | | > |
| | |
| | | </Form.Item></Col> |
| | | <Col span={8}> |
| | | <Form.Item |
| | | name="name" |
| | | name="idMumber" |
| | | label='身份证号' |
| | | required |
| | | > |
| | | <Input disabled placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="name" |
| | | name="partyOrganization" |
| | | label='所在党组织' |
| | | required |
| | | > |
| | |
| | | import { PageContainer, ProTable } from '@ant-design/pro-components'; |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm } from '@/utils/antdUtils'; |
| | | import { Button, message, Space,Cascader } from 'antd'; |
| | | import { useRef, useState } from 'react'; |
| | | import { useRef, useState, useEffect } from 'react'; |
| | | import { Access, history, useAccess } from 'umi'; |
| | | import AddAndEdit from './components/index'; |
| | | import { getList, updateStatus, deleteBanner, add, Edit } from './service' |
| | | import { getList, regionTree } from './service' |
| | | const Banner = () => { |
| | | |
| | | const actionRef = useRef(); |
| | |
| | | { |
| | | title: '性别', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | dataIndex: 'gender' |
| | | }, |
| | | { |
| | | title: '联系电话', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | dataIndex: 'phone' |
| | | }, |
| | | { |
| | | title: '身份证号', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | dataIndex: 'idNumber' |
| | | }, |
| | | { |
| | | title: '所在社区', |
| | | dataIndex: 'name', |
| | | dataIndex: 'community', |
| | | renderFormItem: () => { |
| | | return ( |
| | | <Cascader |
| | | options={items} |
| | | fieldNames={{ value: 'key', label: 'name' }} |
| | | fieldNames={{ value: 'id', label: 'name' }} |
| | | placeholder="请选择" |
| | | displayRender={(label) => label[label.length - 1]} |
| | | changeOnSelect={true} |
| | | /> |
| | | ); |
| | | }, |
| | | render: (text, record) => { |
| | | return record.community |
| | | } |
| | | }, |
| | | { |
| | | title: '服务对象', |
| | | dataIndex: 'name' |
| | | dataIndex: 'serviceTarget', |
| | | render: (text, record) => { |
| | | return record.serviceTarget |
| | | } |
| | | }, |
| | | { |
| | | title: '所在党组织', |
| | | dataIndex: 'name' |
| | | dataIndex: 'partyOrganization' |
| | | }, |
| | | { |
| | | title: '申请时间', |
| | | dataIndex: 'status', |
| | | dataIndex: 'createTime', |
| | | hideInSearch: true, |
| | | }, |
| | | { |
| | |
| | | render: (text, record) => { |
| | | return ( |
| | | <Space> |
| | | {record.auditStatus == 0 && ( |
| | | <> |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */} |
| | | <Button |
| | | type="link" |
| | |
| | | 拒绝 |
| | | </Button> |
| | | {/* </Access> */} |
| | | </> |
| | | )} |
| | | |
| | | </Space > |
| | | ); |
| | | }, |
| | | }, |
| | | ] |
| | | |
| | | useEffect(() => { |
| | | regionTree({}).then(res => { |
| | | setItems(() => res.data) |
| | | }) |
| | | }, []) |
| | | |
| | | return <div> |
| | | <PageContainer title='党员审核' header={{ |
| | |
| | | defaultPageSize: 10, |
| | | }} |
| | | request={(params) => { |
| | | params.auditStatus = 0 |
| | | params.communityId = params.community ? params.community[params.community.length - 1] : '' |
| | | return buildProTableDataSource(getList, params) |
| | | }} |
| | | toolBarRender={false} |
| | |
| | | // const success = await sendRequest(add, fileds); |
| | | // if (success) { |
| | | // handleModalVisible(false); |
| | | // addViewRef.current.clean() |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }} |
| | |
| | | // const success = await sendRequest(Edit, fileds); |
| | | // if (success) { |
| | | // handleModalVisible(false); |
| | | // addViewRef.current.clean() |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }} |
| | |
| | | |
| | | // 列表 |
| | | export const getList = async (data) => { |
| | | return request(`/api/huacheng-sangeshenbian/banner/list`, { |
| | | return request(`/api/huacheng-sangeshenbian/party-member/list`, { |
| | | method: 'POST', |
| | | data:data |
| | | }); |
| | | } |
| | | |
| | | export const regionTree = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/systemUser/regionTree', { |
| | | method: 'GET', |
| | | params:data |
| | | data, |
| | | }); |
| | | } |
| | | export const audit = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/party-member/audit`, { |
| | | method: 'POST', |
| | | data |
| | | }); |
| | | } |
| | | // 详情 |
| | |
| | | } |
| | | |
| | | |
| | | // 删除 |
| | | export const deleteBanner = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/banner/delete/${id}`, { |
| | | method: 'delete', |
| | | // params |
| | | }); |
| | | } |
| | | |
| | | // 添加 编辑 |
| | | export const add = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/banner/add', { |
| | | method: 'POST', |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | // 添加 编辑 |
| | | export const Edit = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/banner/edit', { |
| | | method: 'POST', |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | import { PageContainer, } from '@ant-design/pro-components'; |
| | | import { Button, Select, Row, Col, Input, Card, Space, Form, Upload, Spin, message, Cascader, InputNumber } from 'antd'; |
| | | import { useState, useEffect } from 'react'; |
| | | import { add, Edit, getDetail } from '../service'; |
| | | import { add, Edit, getDetail, regionTree, verifyPhone } from '../service'; |
| | | import { history, useLocation, useSearchParams } from 'umi'; |
| | | import { customRequest } from '@/utils/utils'; |
| | | const AddOrEditOrDetail = () => { |
| | |
| | | const [adminLevel, setAdminLevel] = useState(1) |
| | | |
| | | const [fileList, setFileList] = useState([]) |
| | | const [community, setCommunity] = useState([])//社区 |
| | | const [userInfo, setUserInfo] = useState({}) |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { span: 6 }, |
| | |
| | | name: 'file', |
| | | action: 'https://huacheng.psciio.com/api/huacheng-communitybackstage/communitypartybuilding/uploadimage', |
| | | headers: { |
| | | Authorization: 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTI0MjE4MjgwODU4Mzc4MjYsInR5cGUiOjEsImV4cCI6MTc0MTY1OTg5MywiY3JlYXRlZCI6MTc0MDM2Mzg5MzE2MH0.o3Gc0g1LAo_kkL3X3QrC6qKwztxsp6psoTcpTreDzQUXGqPzUXw89fNSR5YKz8gzhtSuSKI2d6TJJYPX1IQCgw', |
| | | Authorization: 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTI0MjE4MjgwODU4Mzc4MjYsInR5cGUiOjEsImV4cCI6MTc0MzQ3MDczOSwiY3JlYXRlZCI6MTc0MjE3NDczOTI2NX0.JaS9h1BVP97EjLjTjqfjeTdgOKbdkcTFBU8IhQC6xJLTrLmFECMRg1XVFC4sNfUZLfsOOMRVe4urOjHeJdQurg', |
| | | }, |
| | | }; |
| | | |
| | | useEffect(() => { |
| | | let adminInfo = JSON.parse(localStorage.getItem('userInfo')) |
| | | setAdminLevel(() => adminInfo.accountLevel)//角色权限1市级2区县3街道4社区5党员 |
| | | |
| | | regionTree({}).then(res => { |
| | | console.log('社区列表', res) |
| | | setItems(() => res.data) |
| | | }) |
| | | if (searchParams.get('id')) { |
| | | getDetail(searchParams.get('id')).then(res => { |
| | | console.log('党员详情', res) |
| | | setUserInfo(() => res.data) |
| | | res.data.community = [res.data.districtsCode, res.data.streetId, res.data.communityId.toString()] |
| | | setCommunity(() => res.data.community) |
| | | if (res.data.avatar) { |
| | | setFileList(() => [{ url: res.data.avatar, uid: '1' }]) |
| | | } |
| | | form.setFieldsValue(res.data) |
| | | }) |
| | | } |
| | | }, []) |
| | | // 上传前 |
| | | const beforeUpload = (file, type) => { |
| | |
| | | }; |
| | | const handleChange = ({ file: file, fileList: newFileList }, type) => { |
| | | console.log(file, 'newfilelist', newFileList, 'type', type) |
| | | if (file.status == 'error') { |
| | | if (file.status == 'error' || (file.status == 'done' && file.response.code != 200)) { |
| | | setLoading(false) |
| | | // setFileList([]) |
| | | message.error('上传失败') |
| | | return |
| | | } |
| | | if (file.status == 'done') { |
| | | if (file.status == 'done' && file.response.code == 200) { |
| | | setLoading(false) |
| | | message.success('上传成功') |
| | | } |
| | |
| | | return item.url |
| | | }); |
| | | console.log('newFileList', newFileList, 'list', list) |
| | | // if (type == 1) { |
| | | // setImageUrl1(newFileList) |
| | | // } else if (type == 2) { |
| | | // setImageUrl(newFileList) |
| | | // } |
| | | setFileList(() => newFileList) |
| | | }; |
| | | |
| | | const submit = () => { |
| | | form.validateFields().then(async (values) => { |
| | | console.log('values', values) |
| | | if (fileList.length == 0) { |
| | | message.warning('请上传头像') |
| | | return |
| | | } |
| | | let params = { ...values } |
| | | let adminInfo = JSON.parse(localStorage.getItem('userInfo')) |
| | | params.communityId = params.community.length > 0 ? params.community[params.community.length - 1] : '' |
| | | params.streetId = params.community.length > 1 ? params.community[params.community.length - 2] : adminInfo.streetId |
| | | params.districtsCode = params.community.length == 3 ? params.community[0] : adminInfo.districtsCode |
| | | delete params.community |
| | | params.avatar = fileList[0].url |
| | | console.log('params', params) |
| | | if (searchParams.get('id')) { |
| | | params.id = searchParams.get('id') |
| | | let res = await Edit(params) |
| | | if (res.code == 200) { |
| | | message.success('编辑成功') |
| | | history.back() |
| | | } |
| | | } else { |
| | | let res = await add(params) |
| | | if (res.code == 200) { |
| | | message.success('添加成功') |
| | | history.back() |
| | | } |
| | | } |
| | | |
| | | }) |
| | | } |
| | |
| | | return Promise.resolve(); |
| | | }; |
| | | const checkPhoneUse = (e) => { |
| | | console.log('eeeeeeeeee', e.target.value) |
| | | if (Object.keys(userInfo).length > 0 && userInfo.phone == e.target.value) { |
| | | return Promise.resolve() |
| | | } |
| | | verifyPhone({ phone: e.target.value }).then(res => { |
| | | if (res.code != 200) { |
| | | message.warning('该手机号已注册党员信息') |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | <Input disabled={searchParams.get('detail')} placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="name" |
| | | name="phone" |
| | | label='联系电话' rules={[{ required: true, message: '请输入党员联系电话' }, { validator: checkPhone }]} |
| | | > |
| | | <Input disabled={searchParams.get('detail')} placeholder='请输入' maxLength={11} onBlur={checkPhoneUse} ></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="idcard" |
| | | name="idNumber" |
| | | label='身份证号' rules={[{ required: true, message: '请输入党员身份证号' }, { validator: checkIdCard }]} |
| | | > |
| | | <Input disabled={searchParams.get('detail')} placeholder='请输入' maxLength={18}></Input> |
| | | </Form.Item> |
| | | |
| | | <Form.Item |
| | | name="name" |
| | | name="community" |
| | | label='所在社区' |
| | | rules={[{ required: true, message: '请选择所在社区' }]} |
| | | > |
| | | <Cascader |
| | | disabled={searchParams.get('detail') || adminLevel == 4} |
| | | options={items} |
| | | fieldNames={{ value: 'key', label: 'name' }} |
| | | fieldNames={{ value: 'id', label: 'name' }} |
| | | placeholder="请选择" |
| | | displayRender={(label) => label[label.length - 1]} |
| | | changeOnSelect={true} |
| | | onChange={(value, label) => { |
| | | console.log('value', value, '1', label) |
| | | setCommunity(() => label) |
| | | }} |
| | | // displayRender={(label) => label[label.length - 1]} |
| | | // changeOnSelect={true} |
| | | /> |
| | | </Form.Item> |
| | | |
| | | <Form.Item |
| | | name="name" |
| | | name="serviceTarget" |
| | | label='服务对象' |
| | | // rules={[ { required: true,message: '请输入服务对象'}]} |
| | | > |
| | | <Input disabled={searchParams.get('detail')} placeholder='请输入'></Input> |
| | | </Form.Item> |
| | | <Form.Item |
| | | name="name" |
| | | name="partyOrganization" |
| | | label='所在党组织' |
| | | // rules={[ { required: true,message: '请输入所在党组织'}]} |
| | | > |
| | |
| | | </Form.Item> |
| | | |
| | | <Form.Item |
| | | name="image" |
| | | name="avatar" |
| | | label="头像上传" |
| | | // extra={ |
| | | // <div> |
| | |
| | | onRemove={() => { |
| | | setFileList([]) |
| | | form.setFieldsValue({ |
| | | image: '' |
| | | avatar: null |
| | | }) |
| | | // 重新触发校验 |
| | | form.validateFields(['avatar']) |
| | | }} |
| | | showUploadList={{ |
| | | showPreviewIcon: false, |
| | |
| | | const [form] = Form.useForm(); |
| | | const [status, setStatus] = useState(true); |
| | | const okHandle = () => { |
| | | onSave() |
| | | // form.validateFields().then((values) => { |
| | | // onSave(values.file.file); |
| | | // }); |
| | | // onSave() |
| | | form.validateFields().then((values) => { |
| | | if(status){ |
| | | message.warning('请上传文件') |
| | | return |
| | | } |
| | | onSave(values.file.file); |
| | | }); |
| | | }; |
| | | |
| | | const downLod = () => { |
| | | // downLoad('/tCheck/import-template', '检查项导入模版'); |
| | | downLoad('/api/huacheng-sangeshenbian/party-member/download', '导入模版'); |
| | | }; |
| | | |
| | | const onChange = (e) => { |
| | |
| | | return { |
| | | refreshData: (data) => {}, |
| | | clean: () => { |
| | | setStatus(true) |
| | | form.resetFields(); |
| | | }, |
| | | }; |
| | |
| | | { |
| | | title: '联系电话', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | dataIndex: 'phone' |
| | | }, |
| | | { |
| | | title: '身份证号', |
| | | dataIndex: 'name' |
| | | dataIndex: 'idNumber' |
| | | }, |
| | | { |
| | | title: '所在社区', |
| | | dataIndex: 'name', |
| | | dataIndex: 'community', |
| | | }, |
| | | { |
| | | title: '服务对象', |
| | | dataIndex: 'name' |
| | | dataIndex: 'serviceTarget' |
| | | }, |
| | | { |
| | | title: '所在党组织', |
| | | dataIndex: 'name' |
| | | dataIndex: 'partyOrganization' |
| | | }, |
| | | { |
| | | title: '失败原因', |
| | | dataIndex: 'status', |
| | | dataIndex: 'failReason', |
| | | }, |
| | | ] |
| | | |
| | | useImperativeHandle(ref, () => { |
| | | return { |
| | | refreshData: (data) => { |
| | | |
| | | |
| | | setTableListData(()=>data) |
| | | }, |
| | | clean: () => { |
| | | |
| | | setTableListData(()=>[]) |
| | | }, |
| | | }; |
| | | }); |
| | | |
| | | |
| | | // 提交表单 |
| | | const submit = () => { |
| | | |
| | | } |
| | | |
| | | return ( |
| | | <Modal |
| | |
| | | import { PageContainer, ProTable } from '@ant-design/pro-components'; |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm } from '@/utils/antdUtils'; |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm, showDelConfirm1 } from '@/utils/antdUtils'; |
| | | import { Button, message, Space, Cascader } from 'antd'; |
| | | import { useRef, useState } from 'react'; |
| | | import { useRef, useState, useEffect } from 'react'; |
| | | import { Access, history, useAccess } from 'umi'; |
| | | import AddAndEdit from './components/index'; |
| | | import ImportExcell from './components/export'; |
| | | import { getList, updateStatus, deleteBanner, add, Edit } from './service' |
| | | import { getList, deleteBanner, freeze, regionTree, enterList } from './service' |
| | | import { exportExcell } from '@/utils/utils' |
| | | const Banner = () => { |
| | | |
| | | const actionRef = useRef(); |
| | | const access = useAccess(); |
| | | const addViewRef = useRef(); |
| | | const modalExportRef = useRef(); |
| | | const [modalVisible, handleModalVisible] = useState(false); |
| | | const [items, setItems] = useState([]); |
| | | const [excelParams, setExcelParams] = useState({}); |
| | |
| | | { |
| | | title: '性别', |
| | | hideInSearch: true, |
| | | dataIndex: 'name' |
| | | dataIndex: 'gender', |
| | | valueEnum: { |
| | | 1: { text: '男' }, |
| | | 0: { text: '女' }, |
| | | } |
| | | }, |
| | | { |
| | | title: '所在社区', |
| | | dataIndex: 'name', |
| | | dataIndex: 'community', |
| | | renderFormItem: () => { |
| | | return ( |
| | | <Cascader |
| | | options={items} |
| | | fieldNames={{ value: 'key', label: 'name' }} |
| | | fieldNames={{ value: 'id', label: 'name' }} |
| | | placeholder="请选择" |
| | | displayRender={(label) => label[label.length - 1]} |
| | | changeOnSelect={true} |
| | | // changeOnSelect={true} |
| | | /> |
| | | ); |
| | | }, |
| | | render: (text, record) => { |
| | | return record.community |
| | | } |
| | | }, |
| | | { |
| | | title: '服务对象', |
| | | dataIndex: 'name' |
| | | dataIndex: 'serviceTarget', |
| | | render: (text, record) => { |
| | | return record.serviceTarget |
| | | } |
| | | }, |
| | | { |
| | | title: '所在党组织', |
| | | dataIndex: 'name' |
| | | dataIndex: 'partyOrganization', |
| | | render: (text, record) => { |
| | | return record.partyOrganization |
| | | } |
| | | }, |
| | | { |
| | | title: '状态', |
| | | dataIndex: 'status', |
| | | dataIndex: 'freezeStatus', |
| | | valueEnum: { |
| | | 0: { text: '全部' }, |
| | | 1: { text: '正常中' }, |
| | | 2: { text: '已冻结' }, |
| | | // 'all': { text: '全部' }, |
| | | '1': { text: '已冻结' }, |
| | | '0': { text: '正常中' }, |
| | | } |
| | | }, |
| | | { |
| | |
| | | </Button> |
| | | {/* </Access> */} |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */} |
| | | {record.freezeStatus == 0 && ( |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | | showDelConfirm(async () => { |
| | | // let status = await sendRequest(deleteBanner, record.id) |
| | | // if (status) { |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }, '确认冻结该党员信息吗?'); |
| | | showDelConfirm1(async () => { |
| | | console.log('冻结') |
| | | let status = await sendRequest(freeze, { id: record.id }) |
| | | if (status) { |
| | | actionRef.current.reload(); |
| | | } |
| | | }, '确认冻结该党员信息吗?', '冻结', '', '确认冻结该党员信息吗?'); |
| | | }} |
| | | > |
| | | 冻结 |
| | | </Button> |
| | | )} |
| | | |
| | | {/* </Access> */} |
| | | {/* <Access accessible={access['/work_order_transaction_management/banner_management/del']}> */} |
| | | {record.freezeStatus == 1 && ( |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | | showDelConfirm(async () => { |
| | | // let status = await sendRequest(deleteBanner, record.id) |
| | | // if (status) { |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }, '确认解冻该党员信息吗?'); |
| | | showDelConfirm1(async () => { |
| | | let status = await sendRequest(freeze, { id: record.id }) |
| | | if (status) { |
| | | actionRef.current.reload(); |
| | | } |
| | | }, '确认解冻该党员信息吗?', '解冻', '', '确认解冻该党员信息吗?'); |
| | | }} |
| | | > |
| | | 解冻 |
| | | </Button> |
| | | )} |
| | | |
| | | {/* </Access> */} |
| | | </Space > |
| | | ); |
| | | }, |
| | | }, |
| | | ] |
| | | useEffect(() => { |
| | | regionTree({}).then(res => { |
| | | console.log('社区列表', res) |
| | | setItems(() => res.data) |
| | | }) |
| | | }, []) |
| | | |
| | | return <div> |
| | | <PageContainer title='党员管理' header={{ |
| | |
| | | defaultPageSize: 10, |
| | | }} |
| | | request={(params) => { |
| | | params.status = (params.status && params.status != 0) ? params.status : ''; |
| | | params.communityId = params.community ? params.community[params.community.length - 1] : '' |
| | | params.auditStatus = 1 |
| | | setExcelParams(() => params) |
| | | return buildProTableDataSource(getList, params) |
| | | }} |
| | |
| | | <Button |
| | | type="primary" |
| | | onClick={() => { |
| | | // exportExcell('党员列表', excelParams, '/promotion/mgt/coupon/receive-detail/export') |
| | | exportExcell('党员列表', excelParams, '/api/huacheng-sangeshenbian/party-member/export') |
| | | }} |
| | | > |
| | | 导出 |
| | |
| | | <Button |
| | | type="primary" |
| | | onClick={() => { |
| | | // history.push('/party/manage/add?type=add') |
| | | handleModalExport(true) |
| | | modalExportRef.current.clean() |
| | | }} |
| | | > |
| | | 导入 |
| | |
| | | </Space> |
| | | ]} |
| | | /> |
| | | {/* 导入失败弹窗 */} |
| | | <AddAndEdit |
| | | ref={addViewRef} |
| | | visible={modalVisible} |
| | | onCancel={() => handleModalVisible(false)} |
| | | onSave={async (fileds) => { |
| | | // const success = await sendRequest(add, fileds); |
| | | // if (success) { |
| | | handleModalVisible(false); |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }} |
| | | onUpdate={async (fileds) => { |
| | | // const success = await sendRequest(Edit, fileds); |
| | | // if (success) { |
| | | handleModalVisible(false); |
| | | // actionRef.current.reload(); |
| | | // } |
| | | }} |
| | | /> |
| | | |
| | | <ImportExcell |
| | | ref={modalExportRef} |
| | | visible={modalExport} |
| | | onSave={async (fileds) => { |
| | | console.log('上传文件数据', fileds); |
| | | enterList(fileds).then(res => { |
| | | if (res.code == 200) { |
| | | if (res.data.length > 0) { |
| | | message.error('导入失败') |
| | | handleModalExport(false); |
| | | handleModalVisible(true) |
| | | // const success = await sendRequest(enable, fileds); |
| | | // if (success) { |
| | | // handleModalExport(false); |
| | | |
| | | // // actionRef.current.reload(); |
| | | // // listCheck({ checkType: checktype, }).then(res => { |
| | | // // console.log('一键导入数据', res) |
| | | |
| | | // // }) |
| | | // } |
| | | actionRef.current.reload() |
| | | addViewRef.current.refreshData(res.data) |
| | | } else { |
| | | message.success('导入成功') |
| | | handleModalExport(false); |
| | | actionRef.current.reload() |
| | | } |
| | | } |
| | | }) |
| | | }} |
| | | onCancel={() => handleModalExport(false)} |
| | | /> |
| | |
| | | |
| | | // 列表 |
| | | export const getList = async (data) => { |
| | | return request(`/api/huacheng-sangeshenbian/banner/list`, { |
| | | method: 'GET', |
| | | params:data |
| | | return request(`/api/huacheng-sangeshenbian/party-member/list`, { |
| | | method: 'POST', |
| | | data:data |
| | | }); |
| | | } |
| | | // 详情 |
| | | export const getDetail = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/banner/getBannerInfo/${id}`, { |
| | | return request(`/api/huacheng-sangeshenbian/party-member/${id}`, { |
| | | method: 'GET', |
| | | // data |
| | | }); |
| | |
| | | |
| | | // 删除 |
| | | export const deleteBanner = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/banner/delete/${id}`, { |
| | | return request(`/api/huacheng-sangeshenbian/party-member/${id}`, { |
| | | method: 'delete', |
| | | // params |
| | | }); |
| | |
| | | |
| | | // 添加 编辑 |
| | | export const add = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/banner/add', { |
| | | return request('/api/huacheng-sangeshenbian/party-member/save', { |
| | | method: 'POST', |
| | | data, |
| | | }); |
| | |
| | | |
| | | // 添加 编辑 |
| | | export const Edit = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/banner/edit', { |
| | | return request('/api/huacheng-sangeshenbian/party-member/save', { |
| | | method: 'POST', |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | // 导出 |
| | | export const exportList = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/party-member/export', { |
| | | method: 'POST', |
| | | data, |
| | | }); |
| | | } |
| | | export const freeze = async (data) => { |
| | | console.log('冻结') |
| | | return request(`/api/huacheng-sangeshenbian/party-member/freeze/${data.id}`, { |
| | | method: 'GET', |
| | | // data, |
| | | }); |
| | | } |
| | | |
| | | // 导入 |
| | | export async function enable(data) { |
| | | const formData = new FormData() |
| | | formData.append('file',data.originFileObj) |
| | | return request(`/tCheck/importContract`, { |
| | | method: 'POST', |
| | | data: formData |
| | | }); |
| | | } |
| | | export const enterList = async (data) => { |
| | | const formData = new FormData() |
| | | formData.append('file',data.originFileObj) |
| | | return request('/api/huacheng-sangeshenbian/party-member/import', { |
| | | method: 'POST', |
| | | data: formData |
| | | }); |
| | | } |
| | | |
| | | // 获取社区 |
| | | export const regionTree = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/systemUser/regionTree', { |
| | | method: 'GET', |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | // 校验手机号是否存在 |
| | | export const verifyPhone = async (data) => { |
| | | return request(`/api/huacheng-sangeshenbian/party-member/verify/${data.phone}`, { |
| | | method: 'GET', |
| | | data, |
| | | }); |
| | | } |