From 2fdc3dc444a2f8199866780205c0fa4b5ac40522 Mon Sep 17 00:00:00 2001
From: liuwh <hugeinfo123>
Date: Fri, 29 May 2020 10:38:46 +0800
Subject: [PATCH] 指纹登记与对比
---
SunshineIns/src/page/CriminalExecution.jsx | 229 +++++++++++++++++++++++++++++++++-----------------------
1 files changed, 134 insertions(+), 95 deletions(-)
diff --git a/SunshineIns/src/page/CriminalExecution.jsx b/SunshineIns/src/page/CriminalExecution.jsx
index 31d038d..2a4dced 100644
--- a/SunshineIns/src/page/CriminalExecution.jsx
+++ b/SunshineIns/src/page/CriminalExecution.jsx
@@ -3,92 +3,72 @@
import HeadView from '../view/HeadView';
import TableBtnView from '../view/TableBtnView';
import CommonSearchForm from '../view/CommonSearchForm';
-import { Input, Button, DatePicker, Divider, message, Popconfirm, Select, Badge, Modal } from 'antd';
+import { Input, Button, DatePicker, Divider, message, Popconfirm, Select, Tooltip, Modal, Row, Col } from 'antd';
import moment from 'moment';
import Fetch from '../fetch';
import TableView from '../view/TableView';
const Option = Select.Option;
-function typeOfName(type) {
- switch (type) {
- case 1:
- return "跟踪帮教";
- case 2:
- return "合适成年人";
- case 3:
- return "社会调查";
- case 4:
- return "心理疏导";
- case 5:
- return "法律援助";
- }
-}
-
-const taskNodeIds = {
- 1: '跟踪帮教',
- 2: '合适成年人',
- 3: '社会调查',
- 4: '心理疏导',
- 5: '法律援助',
-}
-
-const activityTypeList = [
- 1,
- 2,
- 3,
- 4,
- 5
-]
-const activityStatusIds = {
- 0: '未开始',
- 1: '进行中',
- 2: '已结束',
- 99: '暂停',
-}
-
-const activityStatusList = [
- 0,
- 1,
- 2
-]
-
export default class CareList extends React.Component {
constructor(props) {
super(props);
this.state = {
- data: [],
- formData: {
+ list: [],
+ formdata: {
__key: Date.now(),
page: 1,
size: 10,
},
resetKey: Date.now(),
loading: false,
- savedate:{}
+ zIndex: '-1',
+ savedate: {},
+ display: 'none',
+ fingerCode: ''
};
}
componentDidMount() {
- document.title = '社会观护管理';
+ document.title = '刑执监督管理';
+ let _this = this;
window.addEventListener('message', function (e) {
-
+ console.log('反馈', e)
+ if (e.data) {
+ _this.setState({
+ ...e.data
+ })
+ }
}, false);
- console.log('this', this);
- // this.iframeAddEventListener();
+ _this.iframeAddEventListener();
+ _this.getData();
+ }
+
+ getData = () => {
+ const { formdata } = this.state;
+ this.setState({ loading: true })
+ console.log('formdata', formdata)
+ Fetch.criminalQuery({ ...formdata })
+ .then(res => {
+ console.log("res", res)
+ this.setState({
+ list: res.data.content,
+ loading: false
+ });
+ });
}
setFormData = data => {
console.log('form', data);
this.setState({
- formData: data,
+ formdata: data,
});
}
deleteItems = (e) => {
console.log(e);
this.setState({ loading: true })
- Fetch.socialDelete(e).then(res => {
+ Fetch.criminalDelete(e).then(res => {
if (res.code == 0) {
console.log(res)
this.setState({ loading: false })
@@ -105,11 +85,17 @@
showModal = (id) => {
this.setState({
visible: true,
+ zIndex: 1000,
+ iframeKey: id,
+ display: 'none',
+ loading: true,
});
- // Fetch.socialCompanyDetail(id)
- // .then(res => {
- // this.setState({ savedate: res })
- // })
+ this.sendMsg();
+ Fetch.criminalFind(id)
+ .then(res => {
+ console.log(res)
+ this.setState({ savedate: res.data, fingerCode: res.data.fingerCode || '', loading: false })
+ })
}
saveInputChange = ({ target: { value, name } }) => {
@@ -126,7 +112,7 @@
title: '编号',
dataIndex: 'index',
key: 'index',
- render: (text, item, index) => <span>{index}</span>
+ render: (text, item, index) => <span>{index + 1}</span>
}, {
title: ' 姓名',
dataIndex: 'name',
@@ -137,8 +123,9 @@
key: 'number',
}, {
title: '指纹唯一识别',
- dataIndex: 'shibie',
- key: 'shibie',
+ dataIndex: 'fingerCode',
+ key: 'fingerCode',
+ render: text => <div className="nowrap">{text}</div>
}, {
title: '录入时间',
dataIndex: 'createTime',
@@ -151,7 +138,15 @@
<span>
<label onClick={() => this.showModal(record.id)} className='theme-color' style={{ cursor: 'pointer' }}>编辑</label>
<Divider type="vertical" />
- <label onClick={() => this.deleteItems(record.id)} className='theme-color' style={{ cursor: 'pointer' }}>删除</label>
+ <Popconfirm
+ title="确认删除吗?"
+ id={record.id}
+ onConfirm={e => this.deleteItems(record.id)}
+ okText="确定"
+ cancelText="取消"
+ >
+ <label className='theme-color' style={{ cursor: 'pointer' }}>删除</label>
+ </Popconfirm>
</span>
),
}]
@@ -159,19 +154,63 @@
iframeAddEventListener = () => {
let _this = this;
- this.iframeWin = this.refs.iframe.contentWindow;
+ this.iframeWin = this.refs.iframe && this.refs.iframe.contentWindow;
this.refs.iframe && this.refs.iframe.addEventListener("load", function () {
//代码能执行到这里说明已经载入成功完毕了
//这里是回调函数
- console.log('menu', window.localStorage.getItem('menu'));
_this.iframeWin.postMessage({
fgData: false
}, '*');
}, false);
}
+ sendMsg = () => {
+ this.iframeWin = this.refs.iframe && this.refs.iframe.contentWindow;
+ this.iframeWin.postMessage({
+ fgData: false
+ }, '*');
+ }
+
+ //确认提交按钮
+ handleOk = () => {
+ const { savedate, fingerCode } = this.state;
+ if (!savedate.name) {
+ return message.warning("姓名不能为空");
+ }
+ if (!savedate.number) {
+ return message.warning("牢房号不能为空");
+ }
+ if (!fingerCode) {
+ return message.warning("请录入指纹");
+ }
+ this.setState({ btloading: true })
+ Fetch.criminalSave({ ...savedate, fingerCode })
+ .then(res => {
+ if (res.code === 0) {
+ this.setState({
+ zIndex: '-1',
+ fingerCode: "",
+ btloading: false,
+ closeKey: Date.now()
+ }, this.getData);
+ message.success("提交成功!")
+ }
+ });
+ this.setState({
+
+ })
+ }
+
+ //取消按钮
+ handleCancel = () => {
+ this.setState({
+ fingerCode: "",
+ zIndex: '-1',
+ });
+ }
+
render() {
- const { data, resetKey, visible, loading, savedate, closeKey, formData } = this.state;
+ const { list, resetKey, visible, loading, btloading, savedate, closeKey, formdata, zIndex, display, fingerCode, iframeKey } = this.state;
return (
<div className="app-page">
<HeadView history={this.props.history} />
@@ -179,9 +218,9 @@
<Button type="primary" size='large' onClick={() => this.showModal('new')}>新增</Button>
</div>
<div style={{ background: '#fff', margin: 20 }}>
- <CommonSearchForm
+ {/* <CommonSearchForm
{...this.props}
- formData={formData}
+ formData={formdata}
setFormData={this.setFormData}
searchonClick={this.searchonClick}
pathName={this.props.location.pathname}
@@ -195,44 +234,44 @@
{
type: 'input', name: '联系电话', label: '联系电话', key: 'companyTel'
},
- ]} />
- <TableView columns={this.renderColumns()} data={data} pageSize='10' size='default' loading={loading} />
+ ]} /> */}
+ <TableView columns={this.renderColumns()} data={list} pageSize='10' size='default' loading={loading} />
</div>
- {/* <div style={{ display: 'block' }}> */}
- {/* <iframe
- style={{ width: '100%', height: '100%' }}
- onLoad={() => { }}
- ref="iframe"
- src='./fingerprint/指纹登记.html'
- width="100%"
- scrolling="no"
- frameBorder="0"
- /> */}
<Modal
+ zIndex={zIndex}
key={closeKey}
- confirmLoading={loading}
- visible={visible}
- title="录入信息"
- onCancel={() => { this.setState({ visible: false }) }}
+ confirmLoading={btloading}
+ visible={true}
+ title="指纹录入"
+ onOk={this.handleOk}
+ onCancel={this.handleCancel}
bodyStyle={{ lineHeight: 4 }}
// footer={null}
width={'60%'}
- bodyStyle={{ height: '800px',lineHeight: 4 }}
+ bodyStyle={{ lineHeight: 4 }}
>
<Input addonBefore="姓名" name='name' onChange={this.saveInputChange} value={savedate.name || ''} />
- <Input addonBefore="牢房号" name='lnumber' onChange={this.saveInputChange} value={savedate.lnumber || ''} />
- <Input addonBefore="指纹唯一标识" name='bianshi' onChange={this.saveInputChange} value={savedate.bianshi || ''} />
- <Divider />
- <iframe
- style={{ width: '100%', height: '100%' }}
- onLoad={() => { }}
- ref="iframe"
- src='./fingerprint/指纹登记.html'
- width="100%"
- scrolling="no"
- frameBorder="0"
- />
+ <Input addonBefore="牢房号" name='number' onChange={this.saveInputChange} value={savedate.number || ''} />
+ <Input addonBefore="指纹唯一标识" name='fingerCode' value={fingerCode || ''} disabled addonAfter={<Row type="flex" style={{ flexWrap: 'nowrap' }}>
+ <Col style={{ cursor: 'pointer' }} onClick={() => this.setState({ display: 'block' })}>
+ 录入指纹
+ </Col>
+ </Row>} />
+ <div style={{ display: display }}>
+ <Divider style={{ margin: '2px 0' }} />
+ <iframe
+ key={iframeKey}
+ style={{ width: '100%', height: '550px' }}
+ onLoad={() => { }}
+ ref="iframe"
+ src='./fingerprint/dengji.html'
+ width="100%"
+ scrolling="no"
+ frameBorder="0"
+ />
+ </div>
</Modal>
+
{/* </div> */}
</div>
)
--
Gitblit v1.8.0