Browse Source

新需求

魏超 5 years ago
parent
commit
fffb1520df

+ 6
- 0
config/routes.js View File

@@ -684,6 +684,12 @@ export default [
684 684
                 name: '业务配置',
685 685
                 component: './eContract/businessConfig/list',
686 686
               },
687
+              {
688
+                path: '/eContract/businessConfig/detail',
689
+                name: '业务配置详情',
690
+                hideInMenu: true,
691
+                component: './eContract/businessConfig/detail',
692
+              },
687 693
               {
688 694
                 path: '/eContract/manage/list',
689 695
                 name: '合同管理',

+ 127
- 0
src/pages/eContract/businessConfig/components/SelectCompany.jsx View File

@@ -0,0 +1,127 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input,Row,Col } from 'antd';
3
+import { apis, fetch } from '../../../../utils/request';
4
+
5
+const { Column, ColumnGroup } = Table;
6
+const getH5List = fetch(apis.h5Activity.EffectiveList)
7
+const { Search } = Input;
8
+export default props => {
9
+  const {
10
+    value,
11
+    onChange,
12
+    ...rest
13
+  } = props;
14
+
15
+  const [list, setList] = useState([]);
16
+  const [visible, setVisible] = useState(false);
17
+  const [group, setGroup] = useState({ groupId: undefined, groupName: '合同标题' })
18
+  const getGroupTitle = val => {
19
+    return (list.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
20
+  }
21
+  const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
22
+
23
+  const buildingId = props.buildingId
24
+
25
+  useEffect(() => {
26
+    getH5List({
27
+      params: {
28
+        pageNum: 1,
29
+        pageSize: 999,
30
+        isMiniapp: 1,
31
+        status: 1,
32
+        buildingId,
33
+      },
34
+    }).then(data => {
35
+      setList(data.records || [])
36
+
37
+      updateGroup(buildingId ? undefined : value);
38
+    })
39
+  }, [buildingId]);
40
+  const searchH5 = (e) => {
41
+    getH5List({
42
+      params: {
43
+        pageNum: 1,
44
+        pageSize: 999,
45
+        isMiniapp: 1,
46
+        status: 1,
47
+        name: e
48
+      },
49
+    }).then(data => {
50
+      setList(data.records || [])
51
+
52
+      updateGroup(value ? undefined : value);
53
+    })
54
+  }
55
+
56
+  if (value !== group.groupId) {
57
+    updateGroup(value);
58
+  }
59
+
60
+  const handleChange = val => {
61
+    onChange(val)
62
+  }
63
+
64
+  const setData = val => {
65
+    updateGroup(val)
66
+    onChange(val)
67
+    setVisible(false)
68
+    props.onSuccess(val);
69
+  }
70
+
71
+  const clearVal = val => {
72
+    onChange(val)
73
+    setVisible(false)
74
+  }
75
+
76
+  const columns = [
77
+    {
78
+      title: '标题',
79
+      dataIndex: 'name',
80
+      key: 'drainageId',
81
+      align: 'center',
82
+      ellipsis: true,
83
+      render: text => <a>{text}</a>,
84
+    },
85
+    {
86
+      title: '操作',
87
+      align: 'center',
88
+      width: '20%',
89
+      render: (text, record) => (
90
+        <span>
91
+          <a onClick={() => setData(record.drainageId)} style={{ color: 'blue' }}>选择</a>
92
+        </span>
93
+      ),
94
+    },
95
+  ];
96
+
97
+  return (
98
+    <div>
99
+      <div>{group.groupName}<a style={{marginLeft:'30px', color: 'blue' }} onClick={() => setVisible(true)}>选择关联企业</a></div>
100
+      <Modal
101
+        title="请选择"
102
+        visible={visible}
103
+        onCancel={() => setVisible(false)}
104
+        footer={[]}
105
+      >
106
+        <Row>
107
+          <Col span={18}>
108
+            <Search
109
+              placeholder="请输入标题"
110
+              enterButton="搜索"
111
+              size="default"
112
+              allowClear="true"
113
+              onSearch={value => searchH5(value)}
114
+              style={{ marginBottom: '16px' }}
115
+            />
116
+          </Col>
117
+          <Col span={4} offset={1}>
118
+            <Button type="primary" onClick={()=>clearVal('')}>重置</Button>
119
+          </Col>
120
+        </Row>
121
+
122
+        <Table rowKey={list => list.drainageId} columns={columns} dataSource={list} />
123
+
124
+      </Modal>
125
+    </div>
126
+  )
127
+}

+ 127
- 0
src/pages/eContract/businessConfig/components/SelectContractTemp.jsx View File

@@ -0,0 +1,127 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input,Row,Col } from 'antd';
3
+import { apis, fetch } from '../../../../utils/request';
4
+
5
+const { Column, ColumnGroup } = Table;
6
+const getH5List = fetch(apis.h5Activity.EffectiveList)
7
+const { Search } = Input;
8
+export default props => {
9
+  const {
10
+    value,
11
+    onChange,
12
+    ...rest
13
+  } = props;
14
+
15
+  const [list, setList] = useState([]);
16
+  const [visible, setVisible] = useState(false);
17
+  const [group, setGroup] = useState({ groupId: undefined, groupName: '合同标题' })
18
+  const getGroupTitle = val => {
19
+    return (list.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
20
+  }
21
+  const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
22
+
23
+  const buildingId = props.buildingId
24
+
25
+  useEffect(() => {
26
+    getH5List({
27
+      params: {
28
+        pageNum: 1,
29
+        pageSize: 999,
30
+        isMiniapp: 1,
31
+        status: 1,
32
+        buildingId,
33
+      },
34
+    }).then(data => {
35
+      setList(data.records || [])
36
+
37
+      updateGroup(buildingId ? undefined : value);
38
+    })
39
+  }, [buildingId]);
40
+  const searchH5 = (e) => {
41
+    getH5List({
42
+      params: {
43
+        pageNum: 1,
44
+        pageSize: 999,
45
+        isMiniapp: 1,
46
+        status: 1,
47
+        name: e
48
+      },
49
+    }).then(data => {
50
+      setList(data.records || [])
51
+
52
+      updateGroup(value ? undefined : value);
53
+    })
54
+  }
55
+
56
+  if (value !== group.groupId) {
57
+    updateGroup(value);
58
+  }
59
+
60
+  const handleChange = val => {
61
+    onChange(val)
62
+  }
63
+
64
+  const setData = val => {
65
+    updateGroup(val)
66
+    onChange(val)
67
+    setVisible(false)
68
+    props.onSuccess(val);
69
+  }
70
+
71
+  const clearVal = val => {
72
+    onChange(val)
73
+    setVisible(false)
74
+  }
75
+
76
+  const columns = [
77
+    {
78
+      title: '标题',
79
+      dataIndex: 'name',
80
+      key: 'drainageId',
81
+      align: 'center',
82
+      ellipsis: true,
83
+      render: text => <a>{text}</a>,
84
+    },
85
+    {
86
+      title: '操作',
87
+      align: 'center',
88
+      width: '20%',
89
+      render: (text, record) => (
90
+        <span>
91
+          <a onClick={() => setData(record.drainageId)} style={{ color: 'blue' }}>选择</a>
92
+        </span>
93
+      ),
94
+    },
95
+  ];
96
+
97
+  return (
98
+    <div>
99
+      <div>{group.groupName}<a style={{marginLeft:'30px', color: 'blue' }} onClick={() => setVisible(true)}>选择合同模板</a></div>
100
+      <Modal
101
+        title="请选择"
102
+        visible={visible}
103
+        onCancel={() => setVisible(false)}
104
+        footer={[]}
105
+      >
106
+        <Row>
107
+          <Col span={18}>
108
+            <Search
109
+              placeholder="请输入标题"
110
+              enterButton="搜索"
111
+              size="default"
112
+              allowClear="true"
113
+              onSearch={value => searchH5(value)}
114
+              style={{ marginBottom: '16px' }}
115
+            />
116
+          </Col>
117
+          <Col span={4} offset={1}>
118
+            <Button type="primary" onClick={()=>clearVal('')}>重置</Button>
119
+          </Col>
120
+        </Row>
121
+
122
+        <Table rowKey={list => list.drainageId} columns={columns} dataSource={list} />
123
+
124
+      </Modal>
125
+    </div>
126
+  )
127
+}

+ 127
- 0
src/pages/eContract/businessConfig/components/SelectRaise.jsx View File

@@ -0,0 +1,127 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input,Row,Col } from 'antd';
3
+import { apis, fetch } from '../../../../utils/request';
4
+
5
+const { Column, ColumnGroup } = Table;
6
+const getH5List = fetch(apis.h5Activity.EffectiveList)
7
+const { Search } = Input;
8
+export default props => {
9
+  const {
10
+    value,
11
+    onChange,
12
+    ...rest
13
+  } = props;
14
+
15
+  const [list, setList] = useState([]);
16
+  const [visible, setVisible] = useState(false);
17
+  const [group, setGroup] = useState({ groupId: undefined, groupName: '合同标题' })
18
+  const getGroupTitle = val => {
19
+    return (list.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
20
+  }
21
+  const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
22
+
23
+  const buildingId = props.buildingId
24
+
25
+  useEffect(() => {
26
+    getH5List({
27
+      params: {
28
+        pageNum: 1,
29
+        pageSize: 999,
30
+        isMiniapp: 1,
31
+        status: 1,
32
+        buildingId,
33
+      },
34
+    }).then(data => {
35
+      setList(data.records || [])
36
+
37
+      updateGroup(buildingId ? undefined : value);
38
+    })
39
+  }, [buildingId]);
40
+  const searchH5 = (e) => {
41
+    getH5List({
42
+      params: {
43
+        pageNum: 1,
44
+        pageSize: 999,
45
+        isMiniapp: 1,
46
+        status: 1,
47
+        name: e
48
+      },
49
+    }).then(data => {
50
+      setList(data.records || [])
51
+
52
+      updateGroup(value ? undefined : value);
53
+    })
54
+  }
55
+
56
+  if (value !== group.groupId) {
57
+    updateGroup(value);
58
+  }
59
+
60
+  const handleChange = val => {
61
+    onChange(val)
62
+  }
63
+
64
+  const setData = val => {
65
+    updateGroup(val)
66
+    onChange(val)
67
+    setVisible(false)
68
+    props.onSuccess(val);
69
+  }
70
+
71
+  const clearVal = val => {
72
+    onChange(val)
73
+    setVisible(false)
74
+  }
75
+
76
+  const columns = [
77
+    {
78
+      title: '标题',
79
+      dataIndex: 'name',
80
+      key: 'drainageId',
81
+      align: 'center',
82
+      ellipsis: true,
83
+      render: text => <a>{text}</a>,
84
+    },
85
+    {
86
+      title: '操作',
87
+      align: 'center',
88
+      width: '20%',
89
+      render: (text, record) => (
90
+        <span>
91
+          <a onClick={() => setData(record.drainageId)} style={{ color: 'blue' }}>选择</a>
92
+        </span>
93
+      ),
94
+    },
95
+  ];
96
+
97
+  return (
98
+    <div>
99
+      <div>{group.groupName}<a style={{marginLeft:'30px', color: 'blue' }} onClick={() => setVisible(true)}>选择关联业务</a></div>
100
+      <Modal
101
+        title="请选择"
102
+        visible={visible}
103
+        onCancel={() => setVisible(false)}
104
+        footer={[]}
105
+      >
106
+        <Row>
107
+          <Col span={18}>
108
+            <Search
109
+              placeholder="请输入标题"
110
+              enterButton="搜索"
111
+              size="default"
112
+              allowClear="true"
113
+              onSearch={value => searchH5(value)}
114
+              style={{ marginBottom: '16px' }}
115
+            />
116
+          </Col>
117
+          <Col span={4} offset={1}>
118
+            <Button type="primary" onClick={()=>clearVal('')}>重置</Button>
119
+          </Col>
120
+        </Row>
121
+
122
+        <Table rowKey={list => list.drainageId} columns={columns} dataSource={list} />
123
+
124
+      </Modal>
125
+    </div>
126
+  )
127
+}

+ 127
- 0
src/pages/eContract/businessConfig/components/SelectSeal.jsx View File

@@ -0,0 +1,127 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Select, Modal, Button, Table, Divider, Tag, Input,Row,Col } from 'antd';
3
+import { apis, fetch } from '../../../../utils/request';
4
+
5
+const { Column, ColumnGroup } = Table;
6
+const getH5List = fetch(apis.h5Activity.EffectiveList)
7
+const { Search } = Input;
8
+export default props => {
9
+  const {
10
+    value,
11
+    onChange,
12
+    ...rest
13
+  } = props;
14
+
15
+  const [list, setList] = useState([]);
16
+  const [visible, setVisible] = useState(false);
17
+  const [group, setGroup] = useState({ groupId: undefined, groupName: '合同标题' })
18
+  const getGroupTitle = val => {
19
+    return (list.filter(x => x.drainageId == val)[0] || {}).name || '请选择'
20
+  }
21
+  const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
22
+
23
+  const buildingId = props.buildingId
24
+
25
+  useEffect(() => {
26
+    getH5List({
27
+      params: {
28
+        pageNum: 1,
29
+        pageSize: 999,
30
+        isMiniapp: 1,
31
+        status: 1,
32
+        buildingId,
33
+      },
34
+    }).then(data => {
35
+      setList(data.records || [])
36
+
37
+      updateGroup(buildingId ? undefined : value);
38
+    })
39
+  }, [buildingId]);
40
+  const searchH5 = (e) => {
41
+    getH5List({
42
+      params: {
43
+        pageNum: 1,
44
+        pageSize: 999,
45
+        isMiniapp: 1,
46
+        status: 1,
47
+        name: e
48
+      },
49
+    }).then(data => {
50
+      setList(data.records || [])
51
+
52
+      updateGroup(value ? undefined : value);
53
+    })
54
+  }
55
+
56
+  if (value !== group.groupId) {
57
+    updateGroup(value);
58
+  }
59
+
60
+  const handleChange = val => {
61
+    onChange(val)
62
+  }
63
+
64
+  const setData = val => {
65
+    updateGroup(val)
66
+    onChange(val)
67
+    setVisible(false)
68
+    props.onSuccess(val);
69
+  }
70
+
71
+  const clearVal = val => {
72
+    onChange(val)
73
+    setVisible(false)
74
+  }
75
+
76
+  const columns = [
77
+    {
78
+      title: '标题',
79
+      dataIndex: 'name',
80
+      key: 'drainageId',
81
+      align: 'center',
82
+      ellipsis: true,
83
+      render: text => <a>{text}</a>,
84
+    },
85
+    {
86
+      title: '操作',
87
+      align: 'center',
88
+      width: '20%',
89
+      render: (text, record) => (
90
+        <span>
91
+          <a onClick={() => setData(record.drainageId)} style={{ color: 'blue' }}>选择</a>
92
+        </span>
93
+      ),
94
+    },
95
+  ];
96
+
97
+  return (
98
+    <div>
99
+      <div>{group.groupName}<a style={{marginLeft:'30px', color: 'blue' }} onClick={() => setVisible(true)}>选择企业印章</a></div>
100
+      <Modal
101
+        title="请选择"
102
+        visible={visible}
103
+        onCancel={() => setVisible(false)}
104
+        footer={[]}
105
+      >
106
+        <Row>
107
+          <Col span={18}>
108
+            <Search
109
+              placeholder="请输入标题"
110
+              enterButton="搜索"
111
+              size="default"
112
+              allowClear="true"
113
+              onSearch={value => searchH5(value)}
114
+              style={{ marginBottom: '16px' }}
115
+            />
116
+          </Col>
117
+          <Col span={4} offset={1}>
118
+            <Button type="primary" onClick={()=>clearVal('')}>重置</Button>
119
+          </Col>
120
+        </Row>
121
+
122
+        <Table rowKey={list => list.drainageId} columns={columns} dataSource={list} />
123
+
124
+      </Modal>
125
+    </div>
126
+  )
127
+}

+ 243
- 0
src/pages/eContract/businessConfig/detail.jsx View File

@@ -0,0 +1,243 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, Radio, Upload, InputNumber } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import SelectCity from '../../../components/SelectButton/CitySelect'
7
+import BuildSelect2 from '../../../components/SelectButton/BuildSelect2'
8
+import LivePlatSelect from '../../../components/SelectButton/LivePlatSelect'
9
+import CitySelect3 from '../../../components/SelectButton/CitySelect3'
10
+import ImageUpload from '../../../components/XForm/ImageUpload'
11
+import Wangedit from '../../../components/Wangedit/Wangedit'
12
+import apis from '../../../services/apis';
13
+import request from '../../../utils/request';
14
+import AuthButton from '@/components/AuthButton';
15
+import SelectContractTemp from './components/SelectContractTemp';
16
+import SelectRaise from './components/SelectRaise';
17
+import SelectCompany from './components/SelectCompany';
18
+import SelectSeal from './components/SelectSeal';
19
+
20
+const { Option } = Select;
21
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22
+
23
+let cityId = ''
24
+
25
+const header = props => {
26
+  const { salesBatchId } = props.location.query
27
+  console.log(salesBatchId)
28
+  const [ saleBatchData, setSaleBatchData ] = useState({})
29
+  const [showHelp, setShowHelp] = useState(false)
30
+
31
+  const cancelPage = () =>{
32
+    router.push({
33
+      pathname: '/activity/liveActivity/list',
34
+    });
35
+  }
36
+
37
+   //打开新页面
38
+   const openIndexImg = () => {
39
+    const newWin=window.open('about:blank');
40
+    newWin.location.href="http://njcj.oss-cn-shanghai.aliyuncs.com/%E6%95%99%E7%A8%8B.png"
41
+  }
42
+
43
+  function highlightsTypeChange(e) {
44
+    setTypeState(e.target.value)
45
+  }
46
+
47
+  function disabledDate(current) {
48
+    // Can not select days before today and today
49
+    return current && current < moment().endOf('day');
50
+  }
51
+
52
+  function onSuccess(e){
53
+    console.log(e)
54
+  }
55
+
56
+  function handleSubmit (e) {
57
+    e.preventDefault();
58
+    props.form.validateFields((err, values) => {
59
+      if (!err){
60
+        let {liveTime, ...submitValue} = values
61
+        submitValue.liveStartDate = moment(submitValue.liveStartDate._d).format('YYYY-MM-DD HH:mm:ss')
62
+        submitValue.liveEndDate = moment(submitValue.liveEndDate._d).format('YYYY-MM-DD HH:mm:ss')
63
+        
64
+        if (values.liveStartDate > values.liveEndDate){
65
+          message.info("直播结束时间大于开始时间")
66
+          return;
67
+        }
68
+
69
+        request({ ...apis.taliveActivity.addTaLiveActivity, data: { ...submitValue },}).then((data) => {
70
+          message.info("保存成功")
71
+          router.push({
72
+            pathname: '/activity/liveActivity/list/index',
73
+          });
74
+        }).catch((err) => {
75
+          message.info(err.msg || err.message)
76
+        })
77
+      }
78
+    });
79
+  }
80
+
81
+  const { getFieldDecorator } = props.form;
82
+
83
+  return (
84
+    <>
85
+      <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
86
+        <Form.Item label="合同标题">
87
+          {getFieldDecorator('contractName', {
88
+            rules: [{ required: true, message: ' 请选择合同模板' }],
89
+          })(<SelectContractTemp buildingId={'91073c66168459ca0121697c20c54b82'} onSuccess={e => onSuccess(e)}/>)}
90
+        </Form.Item>
91
+        <Form.Item label="合同文件">
92
+          {getFieldDecorator('contractTemplateId', {
93
+            rules: [{ required: true, message: '' }],
94
+          })}<Button type="danger" style={{marginRight:'20px'}} onClick={openIndexImg}>查看文件</Button>
95
+        </Form.Item>
96
+        <Form.Item label="关联业务类型"> 
97
+          {getFieldDecorator('targetType', {
98
+              rules: [{ required: true, message: '请选择发布状态' }],
99
+            })(<Select placeholder="关联业务类型" style={{ width: '400px' }}>
100
+            <Option value="raise">房源认筹</Option>
101
+          </Select>)}
102
+        </Form.Item>
103
+        <Form.Item label="关联业务">
104
+          {getFieldDecorator('targetId', {
105
+            rules: [{ required: true, message: ' 请选择关联业务' }],
106
+          })(<SelectRaise onSuccess={e => onSuccess(e)}/>)}
107
+        </Form.Item>
108
+        <Form.Item label="甲方" help="系统会在业务需要时自动签所选企业印章,比如用户在签署认筹合同前系统会自动签署企业印章。">
109
+          {getFieldDecorator('companyId', {
110
+            rules: [{ required: true, message: ' 请选择关联企业' }],
111
+          })(<SelectCompany onSuccess={e => onSuccess(e)}/>)}
112
+        </Form.Item>
113
+        <Form.Item label="甲方印章" >
114
+          {getFieldDecorator('sealId', {
115
+            rules: [{ required: true, message: ' 请选择企业印章' }],
116
+          })(<SelectSeal onSuccess={e => onSuccess(e)}/>)}
117
+        </Form.Item>
118
+        <Form.Item label="甲方签章定位关键字" help="关键字为合同文件中的文字内容(能被ctrl+f 查找功能检索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均可能会盖上指定用户的电子章,建议关键字在合同中保持唯一。">
119
+          {getFieldDecorator('signatoryKeywords', {
120
+            rules: [{ required: true, message: '请输入甲方签章定位关键字' }],
121
+          })(<Input maxLength={20} style={{width:'400px'}}/>)}
122
+        </Form.Item>
123
+        <Form.Item label="甲方关键字签章策略"> 
124
+          {getFieldDecorator('signatoryStrategy', {
125
+              rules: [{ required: true, message: '请选择甲方关键字签章策略' }],
126
+            })(<Select placeholder="甲方关键字签章策略" style={{ width: '400px' }}>
127
+            <Option value="last">最后一个关键字签章</Option>
128
+            <Option value="all">所有关键字签章</Option>
129
+            <Option value="first">第一给关键字签章</Option>
130
+          </Select>)}
131
+        </Form.Item>
132
+        <Form.Item label="乙方签章定位关键字" help="关键字为合同文件中的文字内容(能被ctrl+f 查找功能检索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均可能会盖上指定用户的电子章,建议关键字在合同中保持唯一。">
133
+          {getFieldDecorator('customerKeywords', {
134
+            rules: [{ required: true, message: '请输入乙方签章定位关键字' }],
135
+          })(<Input maxLength={20} style={{width:'400px'}}/>)}
136
+        </Form.Item>
137
+        <Form.Item label="乙方关键字签章策略"> 
138
+          {getFieldDecorator('customerStrategy', {
139
+              rules: [{ required: true, message: '请选择乙方关键字签章策略' }],
140
+            })(<Select placeholder="乙方关键字签章策略" style={{ width: '400px' }}>
141
+            <Option value="last">最后一个关键字签章</Option>
142
+            <Option value="all">所有关键字签章</Option>
143
+            <Option value="first">第一给关键字签章</Option>
144
+          </Select>)}
145
+        </Form.Item>
146
+        <Form.Item label="发布状态"> 
147
+          {getFieldDecorator('status', {
148
+              rules: [{ required: true, message: '请选择发布状态' }],
149
+            })(<Select placeholder="发布状态" style={{ width: '400px' }}>
150
+            <Option value="0">否</Option>
151
+            <Option value="1">是</Option>
152
+          </Select>)}
153
+        </Form.Item>
154
+        {/* <Form.Item label="所属楼盘">
155
+          {getFieldDecorator('buildingId')(<BuildSelect2 cityId={props.form.getFieldValue('cityId')}/>)}
156
+        </Form.Item>
157
+         <Form.Item label="直播活动标题">
158
+          {getFieldDecorator('liveActivityTitle', {
159
+            rules: [{ required: true, message: '请输入直播活动标题' }],
160
+          })(<Input maxLength={20} placeholder="给直播活动起个名字" />)}
161
+        </Form.Item>
162
+        <Form.Item label="直播开始时间">
163
+          {getFieldDecorator('liveStartDate', {
164
+                rules: [
165
+                  {
166
+                    required: true,
167
+                    message: '请选择直播开始时间',
168
+                  },
169
+                ],
170
+              })(<DatePicker placeholder="预计开始时间"style={{ width: '500px' }}format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
171
+        </Form.Item>
172
+        <Form.Item label="直播结束时间">
173
+          {getFieldDecorator('liveEndDate', {
174
+                rules: [
175
+                  {
176
+                    required: true,
177
+                    message: '请选择直播结束时间',
178
+                  },
179
+                ],
180
+              })(<DatePicker placeholder="预计结束时间" disabledDate={disabledDate} style={{ width: '500px' }}format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
181
+        </Form.Item>
182
+        <Form.Item label="直播小程序">
183
+          {getFieldDecorator('liveApp', {
184
+              rules: [{ required: true, message: '请选择直播小程序' }],
185
+            })((<LivePlatSelect />))}
186
+        </Form.Item>
187
+        <Form.Item label="房间参数">
188
+          {getFieldDecorator('liveRoomParam', {
189
+            rules: [{ required: true, message: '请输入房间参数' }],
190
+          })(<Input maxLength={1000} placeholder="点击右侧按钮查看如何获取房间参数" style={{width:'680px'}}/>)}<a onClick={openIndexImg} style={{ color: 'blue' }}> 不知道怎么填?查看说明</a>
191
+        </Form.Item>
192
+        <Form.Item label="封面图1" help="建议尺寸:750px*420px,比例16:9,格式:jpg,用于:活动列表">
193
+              {getFieldDecorator('listImg', {
194
+                  rules: [{ required: true, message: '请上传封面图1' }],
195
+              })(
196
+                <ImageUpload />,
197
+              )}
198
+        </Form.Item>  
199
+        <Form.Item label="封面图2" help="建议尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页">
200
+              {getFieldDecorator('detailImg', {
201
+                  rules: [{ required: true, message: '请上传封面图2' }],
202
+              })(
203
+                <ImageUpload />,
204
+              )}
205
+        </Form.Item>  
206
+        <Form.Item label="详情图" help="格式:jpg,用于:直播活动详情页,点击可跳转到直播间">
207
+              {getFieldDecorator('detailTypeImg', {
208
+                  rules: [{ required: true, message: '请上传详情图' }],
209
+              })(
210
+                <ImageUpload />,
211
+              )}
212
+        </Form.Item>      
213
+        <Form.Item label="权重">
214
+              {getFieldDecorator('weight', {
215
+                  rules: [{ required: true, message: '请设置权重' }],
216
+              })(
217
+                <InputNumber placeholder="权重越大越靠前" style={{width:'150px'}}/>
218
+              )}
219
+        </Form.Item>
220
+        <Form.Item label="发布状态"> 
221
+          {getFieldDecorator('status', {
222
+              rules: [{ required: true, message: '请选择发布状态' }],
223
+            })(<Select placeholder="发布状态" style={{ width: '300px' }}>
224
+            <Option value="0">否</Option>
225
+            <Option value="1">是</Option>
226
+          </Select>)}
227
+        </Form.Item>*/}
228
+        <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
229
+          <Button type="primary" htmlType="submit"style={{marginRight:'20px'}}>
230
+            确定
231
+          </Button>
232
+          <Button onClick={() => router.go(-1)}>
233
+            取消
234
+          </Button>
235
+        </Form.Item>
236
+      </Form>
237
+    </>
238
+  )
239
+}
240
+
241
+const WrappedHeader = Form.create({ name: 'header' })(header);
242
+
243
+export default WrappedHeader

+ 236
- 0
src/pages/eContract/businessConfig/list.jsx View File

@@ -0,0 +1,236 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../../style/GoodsList.less';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+import SelectCity from '../../../components/SelectButton/CitySelect'
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
9
+import apis from '../../../services/apis';
10
+import request from '../../../utils/request';
11
+import AuthButton from '@/components/AuthButton';
12
+
13
+const { Option } = Select;
14
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15
+
16
+const header = props => {
17
+  const sampleId  = props.location.query.id;
18
+  const sampleName = props.location.query.sampleName;
19
+  const [data, setData] = useState({})
20
+  const [demend, setDemend] = useState({})
21
+  const [demandIds, setDemandIds] = useState([])
22
+  const [batchDel, setBatchDel] = useState({visable:false,demandIds:''})
23
+  const [addDemand, setAddDemand] = useState({visable:false})
24
+
25
+  useEffect(() => {
26
+    if(sampleId){
27
+      getList({ pageNum: 1, pageSize: 10, sampleId: sampleId });
28
+    }else{
29
+      getList({ pageNum: 1, pageSize: 10});
30
+    }
31
+    
32
+  }, [])
33
+
34
+  // 查询列表
35
+  const getList = (params) => {
36
+    console.log(params);
37
+    request({ ...apis.taH5SampleManager.taH5Demand, params: { ...params } }).then((data) => {
38
+      console.log(data)
39
+      setData(data)
40
+    })
41
+  }
42
+
43
+  // 跳转到编辑
44
+  const toDetail = rowData => () => {
45
+    if(rowData) {
46
+      router.push({
47
+      pathname: '/eContract/businessConfig/detail',
48
+      query: {
49
+        id: rowData.demandId,
50
+      },
51
+    });
52
+      return
53
+    }
54
+  }
55
+
56
+  /**
57
+   *
58
+   *
59
+   * @param {*} props
60
+   * @returns
61
+   */
62
+
63
+  const columns = [
64
+    {
65
+      title: '样例名',
66
+      dataIndex: 'sampleName',
67
+      key: 'sampleName',
68
+      align: 'center',
69
+    },
70
+    {
71
+      title: '下单人',
72
+      dataIndex: 'orderer',
73
+      key: 'orderer',
74
+      align: 'center',
75
+      
76
+    },
77
+    {
78
+      title: '联系方式',
79
+      dataIndex: 'phone',
80
+      key: 'phone',
81
+      align: 'center',
82
+    },
83
+    {
84
+      title: '下单时间',
85
+      dataIndex: 'createDate',
86
+      key: 'createDate',
87
+      align: 'center',
88
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>
89
+    },
90
+    {
91
+      title: '需求单状态',
92
+      dataIndex: 'demandStatus',
93
+      key: 'demandStatus',
94
+      align: 'center',
95
+      render: (text, records) => {
96
+        if (records.demandStatus === 1) { return '已提交' }
97
+        if (records.demandStatus === 2) { return '处理中' }
98
+        if (records.demandStatus === 3) { return '已交付' }
99
+        if (records.demandStatus === 4) { return '作废' }
100
+      },
101
+    },
102
+    {
103
+      title: '操作',
104
+      dataIndex: 'handle',
105
+      key: 'handle',
106
+      align: 'center',
107
+      render: (text, record) => (
108
+        <AuthButton name="admin.h5Demand.detail.get" noRight={null}>
109
+          <a style={{ color: '#66B3FF' }} onClick={toDetail(record)} >查看详情</a>
110
+        </AuthButton>
111
+      ),
112
+    },
113
+  ];
114
+  
115
+  const rowSelection = {
116
+    onChange: (selectedRowKeys, selectedRows) => {
117
+      console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
118
+      setDemandIds(selectedRows)
119
+    },
120
+  };
121
+
122
+  const changePageNum = pageNumber => {
123
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
124
+  }
125
+
126
+  // 提交事件
127
+  const handleSubmit = (e, props) => {
128
+    e.preventDefault();
129
+    props.form.validateFields((err, values) => {
130
+      if (!err) {
131
+        
132
+        if (values.startCreateDate != null){
133
+          values.startCreateDate = moment(values.startCreateDate).format('YYYY-MM-DD HH:mm:ss')
134
+        }
135
+        if (values.endCreateDate != null){
136
+          values.endCreateDate = moment(values.endCreateDate).format('YYYY-MM-DD HH:mm:ss')
137
+        }
138
+        getList({ pageNum: 1, pageSize: 10, ...values })
139
+      }
140
+    });
141
+  }
142
+
143
+  //重置搜索
144
+  function handleReset () {
145
+    props.form.resetFields();
146
+    getList({ pageNum: 1, pageSize: 10 })
147
+  }
148
+
149
+  function showBatchDel(e){
150
+  
151
+    if (demandIds.length <= 0){
152
+      message.info("请选择数据");
153
+      return;
154
+    }
155
+    setBatchDel(e);
156
+    if(!e.visable){
157
+      getList()
158
+    }
159
+  }
160
+
161
+  function addDemandInfo(e){
162
+    setAddDemand(e);
163
+  }
164
+
165
+  const { getFieldDecorator } = props.form
166
+  return (
167
+
168
+    <>
169
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
170
+        <Form.Item>
171
+          {getFieldDecorator('orderer')(
172
+            <Input
173
+            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
174
+            placeholder="下单人"
175
+          />,
176
+          )}
177
+        </Form.Item>
178
+        <Form.Item>
179
+          {getFieldDecorator('phone')(
180
+            <Input
181
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
182
+              placeholder="联系方式"
183
+            />,
184
+          )}
185
+        </Form.Item>
186
+        <Form.Item>
187
+          {getFieldDecorator('startCreateDate')(
188
+            <DatePicker showTime={{ format: 'HH:mm:ss' }} placeholder="下单时间开始时间"/>,
189
+          )}
190
+        </Form.Item>
191
+        <Form.Item>
192
+          {getFieldDecorator('endCreateDate')(
193
+            <DatePicker showTime={{ format: 'HH:mm:ss' }} placeholder="下单时间结束时间"/>,
194
+          )}
195
+        </Form.Item>  
196
+        <Form.Item>
197
+          {getFieldDecorator('demandStatus')(
198
+            <Select style={{ width: '180px' }} placeholder="需求单状态">
199
+                <option value="">全部</option>
200
+                <option value="1">已提交</option>
201
+                <option value="2">处理中</option>
202
+                <option value="3">已交付</option>
203
+                <option value="4">作废</option>
204
+            </Select>
205
+          )}
206
+        </Form.Item>
207
+        <Form.Item>
208
+            <AuthButton name="admin.taShareActivity.search" noRight={null}>
209
+                <Button type="primary" htmlType="submit" className={styles.searchBtn}>
210
+                    搜索
211
+                </Button>
212
+            </AuthButton>
213
+            <AuthButton name="admin.taShareActivity.search" noRight={null}>
214
+                <Button style={{ marginLeft: 8 }} onClick={handleReset}>
215
+                        重置
216
+                </Button>
217
+            </AuthButton>
218
+        </Form.Item>
219
+      </Form>
220
+      <AuthButton name="admin.h5Demand.add.post" noRight={null}>
221
+        <Button type="danger" onClick={() => addDemandInfo({visable:true})} className={styles.addBtn}>新增</Button>
222
+      </AuthButton>
223
+      <AuthButton name="admin.h5Demand.del" noRight={null}>
224
+        <Button type="primary" onClick={() => showBatchDel({visable:true, demandIds: demandIds})} className={styles.addBtn} style={{marginLeft:'30px'}}>删除</Button>
225
+      </AuthButton>
226
+      <Table rowSelection={rowSelection}
227
+        style={{marginTop:'30px'}} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
228
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
229
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
230
+      </div>
231
+    </>
232
+  )
233
+}
234
+const WrappedHeader = Form.create({ name: 'header' })(header);
235
+
236
+export default WrappedHeader