|
@@ -1,6 +1,6 @@
|
|
|
import React from 'react';
|
|
|
import { BirdGrid } from 'components/Grid';
|
|
|
-import { config,request} from 'utils';
|
|
|
+import { config,request,hashToArray} from 'utils';
|
|
|
import { Layout,Form, Radio,Tabs,Table,Button, Modal,Input, Row,Col, Tag, Tooltip, Icon} from 'antd';
|
|
|
import Panel from 'components/Panel';
|
|
|
//import reqwest from 'reqwest';
|
|
@@ -53,7 +53,7 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
odersproduct:[],
|
|
|
data: [],
|
|
|
loading: false,
|
|
|
- orderinfo:[],
|
|
|
+ orderinfo:[]
|
|
|
}
|
|
|
}
|
|
|
//第一次渲染后事件
|
|
@@ -241,6 +241,7 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
//onokText="Create"
|
|
|
onCancel={onCancel}
|
|
|
onOk={onCreate}
|
|
|
+ width={800}
|
|
|
>
|
|
|
<Form layout="horizontal">
|
|
|
<Form.Item label="购买人">
|
|
@@ -272,27 +273,76 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
|
|
//Tag组件
|
|
|
class EditableTagGroup extends React.Component {
|
|
|
- state = {
|
|
|
- tags: ['Unremovable', 'Tag 2', 'Tag 3'],
|
|
|
+ constructor(props) {
|
|
|
+ super(props)
|
|
|
+ let tags = this.props.tags;
|
|
|
+ this.state = {
|
|
|
+ tags: tags?tags:[],
|
|
|
inputVisible: false,
|
|
|
inputValue: '',
|
|
|
visibleTag: false,
|
|
|
+ taslist:[],
|
|
|
+ phone:""
|
|
|
};
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// componentDidMount() {
|
|
|
+// let self= this;
|
|
|
+// let tags = this.props.tags;
|
|
|
+// self.setState({
|
|
|
+// tags:tags
|
|
|
+// });
|
|
|
+// }
|
|
|
|
|
|
+//props数据修改事件
|
|
|
+componentWillReceiveProps(nextProps){
|
|
|
+ let self= this;
|
|
|
+ let tags = nextProps.tags;
|
|
|
+ self.setState({
|
|
|
+ tags:tags
|
|
|
+ });
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+ //添加标签——弹出框关闭点击事件
|
|
|
+ handleCancelTag = () => {
|
|
|
+ this.setState({ visibleTag: false });
|
|
|
+ };
|
|
|
+ //添加标签——确定点击事件
|
|
|
+ handleCreateTag = () => {
|
|
|
+ const form = this.formRefTag.props.form;
|
|
|
+ form.validateFields((err, values) => {
|
|
|
+ if (err) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ console.log('Received values of form: ', values);
|
|
|
+ form.resetFields();
|
|
|
+ this.setState({ visibleTag: false });
|
|
|
+ });
|
|
|
+ };
|
|
|
+ //添加标签——
|
|
|
+ saveFormRefTag = formRefTag => {
|
|
|
+ this.formRefTag = formRefTag;
|
|
|
+ };
|
|
|
showModalTag = () => {
|
|
|
this.setState({ visibleTag: true });
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
+ //tags-删除事件
|
|
|
handleClose = removedTag => {
|
|
|
const tags = this.state.tags.filter(tag => tag !== removedTag);
|
|
|
console.log(tags);
|
|
|
this.setState({ tags });
|
|
|
};
|
|
|
|
|
|
+ //显示tags
|
|
|
showInput = () => {
|
|
|
this.setState({ inputVisible: true }, () => this.input.focus());
|
|
|
};
|
|
|
|
|
|
+ //tags
|
|
|
handleInputChange = e => {
|
|
|
this.setState({ inputValue: e.target.value });
|
|
|
};
|
|
@@ -374,6 +424,12 @@ const TagCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
loading: false,
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+//chechbox选中事件
|
|
|
+// checkclick(datalist,checkkey){
|
|
|
+// var aa=datalist;
|
|
|
+// var bb=checkkey;
|
|
|
+// };
|
|
|
render() {
|
|
|
const { visibleTag, onCancelTag, onCreateTag, form } = this.props;
|
|
|
//const { getFieldDecorator } = form;
|
|
@@ -383,6 +439,21 @@ const TagCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
read: "/web/mem_tag/AllTagList"
|
|
|
},
|
|
|
checkable: true,
|
|
|
+ afterCheck:function checkclick(datalist,checkkey){
|
|
|
+ var aa=datalist;
|
|
|
+ var bb=checkkey;
|
|
|
+ var memberphone="13145738791";
|
|
|
+ var query={memberphone:memberphone,checkkey:checkkey};
|
|
|
+ request({
|
|
|
+ url: APIV3+"/web/mem_tag/EditMemberTag",
|
|
|
+ method: "post",
|
|
|
+ data:query,
|
|
|
+ }).then(function (result) {
|
|
|
+ if (result.success){
|
|
|
+ console.log(result)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
primaryKey:"_id",
|
|
|
columns: [
|
|
|
{ title: "标签ID", data: "_id", type: "text", editor: {}, isRequired: true },
|
|
@@ -392,10 +463,10 @@ const TagCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
title: "操作选项", type: "command", actions: []
|
|
|
}
|
|
|
],
|
|
|
- actions:[{ name: '保存', onClick: function () {
|
|
|
+ // actions:[{ name: '保存', onClick: function () {
|
|
|
|
|
|
- }
|
|
|
- }]
|
|
|
+ // }
|
|
|
+ // }]
|
|
|
};
|
|
|
|
|
|
return (
|
|
@@ -418,7 +489,7 @@ const TagCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
},
|
|
|
);
|
|
|
|
|
|
-//用户个人管理组件
|
|
|
+//个人用户管理组件
|
|
|
class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
constructor(props) {
|
|
|
super(props)
|
|
@@ -428,20 +499,41 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
hidegrid2:true,//收货历史radio参数
|
|
|
hidegrid3:true,//平台列表radio参数
|
|
|
users:[], //健康档案实体
|
|
|
- members:[],//实名信息实体
|
|
|
+ members:[],//基本信息实体
|
|
|
+ memberexts:[],//实名信息实体
|
|
|
visible: false,
|
|
|
visibleTag: false,
|
|
|
orderinfo:[],
|
|
|
- odersproduct:[]
|
|
|
+ odersproduct:[],
|
|
|
+ tags:[],
|
|
|
+ phone:"",
|
|
|
+ tagpanes:[]
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//第一次渲染后事件
|
|
|
componentDidMount() {
|
|
|
let self= this;
|
|
|
-
|
|
|
//实名信息请求
|
|
|
- var membersql={"query":"select * from mem_memberbase_p where MemUsualPhone = '13761709889'"};
|
|
|
+ var MemUsualPhone = "13761709889";
|
|
|
+ var membersql={query:MemUsualPhone};
|
|
|
+ request({
|
|
|
+ url: APIV3+"/web/mem_memberexts_temp/MemberextsByPhone",
|
|
|
+ method: "post",
|
|
|
+ data:membersql,
|
|
|
+ }).then(function (result) {
|
|
|
+ if (result.success){
|
|
|
+ console.log(result)
|
|
|
+ self.setState({
|
|
|
+ memberexts:result.items
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //基本信息请求
|
|
|
+ var MemUsualPhone = "13761709889";
|
|
|
+ var membersql={query:MemUsualPhone};
|
|
|
+ //var membersql={"query":"select * from mem_memberbase_p where MemUsualPhone = '13761709889'"};
|
|
|
request({
|
|
|
url: APIV3+"/web/Mem_memberinformation/index",
|
|
|
method: "post",
|
|
@@ -470,7 +562,48 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ //第一次加载用户标签请求
|
|
|
+ var memberphone="13145738791";
|
|
|
+ var membersql={query: memberphone};
|
|
|
+ request({
|
|
|
+ url: APIV3+"/web/mem_tag/TagByMemberPhone",
|
|
|
+ method: "post",
|
|
|
+ data:membersql,
|
|
|
+ }).then(function (result) {
|
|
|
+ if (result.success){
|
|
|
+ console.log(result)
|
|
|
+ var ss=[];
|
|
|
+ var panelname=[];
|
|
|
+ var data = hashToArray(result.items);
|
|
|
+ data.map((item,i)=> {
|
|
|
+ let tagcouple = [];
|
|
|
+ if((i+1)%2 == 0){
|
|
|
+ var item11 = [];
|
|
|
+ var item22 = [];
|
|
|
+ var items = [];
|
|
|
+ data[i].map((item1,index1)=>{
|
|
|
+ items.push(item1.TagName)
|
|
|
+ })
|
|
|
+ item11.push(data[i][0].TagTypeName);
|
|
|
+ item11.push(items);
|
|
|
+ var items2 = [];
|
|
|
+ data[i-1].map((item1,index1)=>{
|
|
|
+ items2.push(item1.TagName)
|
|
|
+ })
|
|
|
+ item22.push(data[i-1][0].TagTypeName);
|
|
|
+ item22.push(items2);
|
|
|
+ tagcouple.push(item11);
|
|
|
+ tagcouple.push(item22);
|
|
|
+ ss.push(tagcouple);
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ self.setState({
|
|
|
+ tags:ss
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
//订单详情——弹出表单Modal
|
|
@@ -514,10 +647,12 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
//修改显示属性
|
|
|
this.setState({ visible: true});
|
|
|
};
|
|
|
+
|
|
|
//订单详情——弹出框关闭点击事件
|
|
|
handleCancel = () => {
|
|
|
this.setState({ visible: false });
|
|
|
};
|
|
|
+
|
|
|
//订单详情——确定点击事件
|
|
|
handleCreate = () => {
|
|
|
const form = this.formRef.props.form;
|
|
@@ -530,20 +665,22 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
this.setState({ visible: false });
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
//订单详情——
|
|
|
saveFormRef = formRef => {
|
|
|
this.formRef = formRef;
|
|
|
};
|
|
|
|
|
|
-
|
|
|
//添加标签——弹出表单Modal
|
|
|
showModalTag = () => {
|
|
|
this.setState({ visibleTag: true });
|
|
|
};
|
|
|
+
|
|
|
//添加标签——弹出框关闭点击事件
|
|
|
handleCancelTag = () => {
|
|
|
this.setState({ visibleTag: false });
|
|
|
};
|
|
|
+
|
|
|
//添加标签——确定点击事件
|
|
|
handleCreateTag = () => {
|
|
|
const form = this.formRefTag.props.form;
|
|
@@ -556,12 +693,13 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
this.setState({ visibleTag: false });
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
//添加标签——
|
|
|
saveFormRefTag = formRefTag => {
|
|
|
this.formRefTag = formRefTag;
|
|
|
};
|
|
|
|
|
|
-
|
|
|
+
|
|
|
//处方列表radio点击事件
|
|
|
prescriptionohandleChange = function(e){
|
|
|
let self=this;
|
|
@@ -623,12 +761,13 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
};
|
|
|
|
|
|
render() {
|
|
|
+
|
|
|
//实名信息数据源
|
|
|
let self = this;
|
|
|
- var MemberNickName="";
|
|
|
+ var realname="";
|
|
|
var OriginType="";
|
|
|
- this.state.members.map((user,i)=>{
|
|
|
- MemberNickName=user.MemberNickName
|
|
|
+ this.state.memberexts.map((user,i)=>{
|
|
|
+ realname=user.MemName
|
|
|
OriginType=user.OriginType
|
|
|
})
|
|
|
//实名信息table表格
|
|
@@ -650,7 +789,7 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
{
|
|
|
key: '1',
|
|
|
one: '姓名',
|
|
|
- two: MemberNickName,
|
|
|
+ two: realname,
|
|
|
three: '身份证号码',
|
|
|
four: '无',
|
|
|
},
|
|
@@ -677,8 +816,7 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
},
|
|
|
];
|
|
|
|
|
|
-
|
|
|
- //健康档案数据源
|
|
|
+ //实名档案数据源
|
|
|
var MemberName="";
|
|
|
var MemberAge="";
|
|
|
this.state.users.forEach(x=>{
|
|
@@ -839,7 +977,7 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
|
|
|
//好友列表
|
|
|
let gridOptions5 = {
|
|
|
- title: "商品列表",
|
|
|
+ title: "好友列表",
|
|
|
url: {
|
|
|
//read: "/web/Mem_PurchaseHistory/DrugsList"
|
|
|
read: "/web/ES_MemFriends/MemberFriends"
|
|
@@ -848,9 +986,11 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
primaryKey:"id",
|
|
|
columns: [
|
|
|
{ title: "id", data: "_id", type: "text", editor: {}, isRequired: true },
|
|
|
- { title: "MemberId", data: "MemberId", type: "text", editor: {}, isRequired: true },
|
|
|
- { title: "MemberFriendsPhone", data: "MemberFriendsPhone", type: "text", editor: {}, isRequired: true },
|
|
|
- { title: "MemberPhone", data: "MemberPhone", type: "text", editor: {}, isRequired: true },
|
|
|
+ { title: "好友昵称", data: "MemberNickName", type: "text", editor: {}, isRequired: true },
|
|
|
+ { title: "好友姓名", data: "MemberNickName", type: "text", editor: {}, isRequired: true },
|
|
|
+ { title: "手机号", data: "_id", type: "text", editor: {}, isRequired: true },
|
|
|
+ { title: "关系", data: "_id", type: "text", editor: {}, isRequired: true },
|
|
|
+ { title: "来源", data: "_id", type: "text", editor: {}, isRequired: true },
|
|
|
{
|
|
|
title: "操作选项", type: "command", actions: []
|
|
|
}
|
|
@@ -874,7 +1014,85 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
}
|
|
|
]
|
|
|
};
|
|
|
- //基本信息
|
|
|
+
|
|
|
+ //基本信息数据源
|
|
|
+ var MemberNickName="";
|
|
|
+ var OriginType="";
|
|
|
+ this.state.members.map((user,i)=>{
|
|
|
+ MemberNickName=user.MemberNickName
|
|
|
+ OriginType=user.OriginType
|
|
|
+ })
|
|
|
+ //基本信息table表格
|
|
|
+ const columns6 = [
|
|
|
+ {
|
|
|
+ dataIndex: 'one',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'two',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'three',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dataIndex: 'four',
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ const data6 =[
|
|
|
+ {
|
|
|
+ key: '1',
|
|
|
+ one: '姓名',
|
|
|
+ two: MemberNickName,
|
|
|
+ three: '身份证号码',
|
|
|
+ four: '无',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '2',
|
|
|
+ one: '民族',
|
|
|
+ two: '无',
|
|
|
+ three: '性别',
|
|
|
+ four:'无',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '3',
|
|
|
+ one: '签发机关',
|
|
|
+ two: '无',
|
|
|
+ three: '出生日期',
|
|
|
+ four: '无',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: '4',
|
|
|
+ one: '开始有效期',
|
|
|
+ two: '无',
|
|
|
+ three: '截止有效期',
|
|
|
+ four: '无',
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
+ var list = (index) => {
|
|
|
+ var res = [];
|
|
|
+ //for(var index1 in self.state.tags[index]) {
|
|
|
+ res.push(<Row>
|
|
|
+ <Col span={12}>
|
|
|
+ <Panel title={self.state.tags[index][0][0]} >
|
|
|
+ <EditableTagGroup
|
|
|
+ tags={self.state.tags[index][0][1]}
|
|
|
+ ></EditableTagGroup>
|
|
|
+ </Panel>
|
|
|
+ </Col>
|
|
|
+ <Col span={12}>
|
|
|
+ <Panel title={self.state.tags[index][1][0]} >
|
|
|
+ <EditableTagGroup
|
|
|
+ tags={self.state.tags[index][1][1]}
|
|
|
+ ></EditableTagGroup>
|
|
|
+ </Panel>
|
|
|
+ </Col>
|
|
|
+ </Row>)
|
|
|
+ //}
|
|
|
+ return res
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //个人用户信息
|
|
|
return (
|
|
|
<Tabs defaultActiveKey="用户标签" style={{background:'#fff'}} >
|
|
|
<TabPane tab="实名信息" key="实名信息">
|
|
@@ -928,17 +1146,11 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
onCreateTag={this.handleCreateTag}
|
|
|
/>
|
|
|
</div>
|
|
|
- <Row gutter={16}>
|
|
|
- <Col span={12}>
|
|
|
- <Panel title="基础标签" >
|
|
|
- <EditableTagGroup></EditableTagGroup>
|
|
|
- </Panel>
|
|
|
- </Col>
|
|
|
- <Col span={12}>
|
|
|
- <Panel title="工作标签" >
|
|
|
- </Panel>
|
|
|
- </Col>
|
|
|
- </Row>
|
|
|
+ {
|
|
|
+ self.state.tags.map(function (col, index) {
|
|
|
+ return list(index)
|
|
|
+ })
|
|
|
+ }
|
|
|
</TabPane>
|
|
|
<TabPane tab="好友列表" key="好友列表">
|
|
|
<BirdGrid gridOption={gridOptions5}/>
|
|
@@ -954,7 +1166,7 @@ class BirdGridmem_prescriptionPage extends React.Component {
|
|
|
</div>
|
|
|
</TabPane>
|
|
|
<TabPane tab="基本信息" key="基本信息">
|
|
|
- <Table columns={columns} dataSource={data} bordered pagination={ false }/>
|
|
|
+ <Table columns={columns6} dataSource={data6} bordered pagination={ false }/>
|
|
|
</TabPane>
|
|
|
<CollectionCreateForm
|
|
|
wrappedComponentRef={this.saveFormRef}
|