Ver código fonte

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into dev

魏超 5 anos atrás
pai
commit
5b8aed1136

+ 6
- 0
config/routes.js Ver arquivo

@@ -695,6 +695,12 @@ export default [
695 695
                 name: '合同管理',
696 696
                 component: './eContract/manage/list',
697 697
               },
698
+              {
699
+                path: '/eContract/manage/edit',
700
+                name: '查看详情',
701
+                hideInMenu: true,
702
+                component: './eContract/manage/edit',
703
+              },
698 704
               {
699 705
                 path: '/eContract/template/add',
700 706
                 name: '新增合同模板',

+ 146
- 0
src/pages/eContract/manage/edit.jsx Ver arquivo

@@ -0,0 +1,146 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, Row, Col } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import Styles from './styles.less';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+
8
+import apis from '../../../services/apis';
9
+import request from '../../../utils/request';
10
+
11
+
12
+import AuthButton from '@/components/AuthButton';
13
+
14
+
15
+const header = props => {
16
+
17
+    const id = props.location.query.id
18
+
19
+    const [data, setData] = useState({})
20
+
21
+    useEffect(() => {
22
+
23
+        getList(id);
24
+
25
+
26
+    }, [])
27
+
28
+    const getList = (id) => {
29
+        // console.log(params);
30
+        console.log(id)
31
+        request({ ...apis.manage.detail, urlData: { id: id } }).then((data) => {
32
+
33
+            setData(data)
34
+
35
+        })
36
+    }
37
+
38
+    const onArchives = () => {
39
+        request({
40
+            ...apis.manage.archives,
41
+            urlData: { id: id },
42
+            data: { contractId: parseInt(id) , archives: true }
43
+        }).then((data) => {
44
+
45
+
46
+
47
+        })
48
+    }
49
+
50
+    const datas = [
51
+        {
52
+            name: "合同标题",
53
+            value: data.contractName
54
+        },
55
+        {
56
+            name: "关联业务类型",
57
+            value: data.targetType
58
+        },
59
+        {
60
+            name: "关联业务",
61
+            value: data.targetName
62
+
63
+        },
64
+        {
65
+            name: "关联单据类型",
66
+            value: data.invoiceTargetType
67
+        },
68
+        {
69
+            name: "关联单据编号",
70
+            value: data.invoiceTargetId
71
+        },
72
+        {
73
+            name: "甲方名称",
74
+            value: data.signatoryName,
75
+
76
+        },
77
+        {
78
+            name: "甲方签署时间",
79
+            value: data.signatoryTime,
80
+            render: <><span>{data.signatoryTime ? moment(data.signatoryTime).format('YYYY-MM-DD HH:mm:ss') : ''}</span></>
81
+        },
82
+        {
83
+            name: "乙方名称",
84
+            value: data.customerName
85
+        },
86
+        {
87
+            name: "乙方手机号",
88
+            value: data.customerTel
89
+        },
90
+        {
91
+            name: "乙方身份证号",
92
+            value: data.customerIdcard
93
+        },
94
+        {
95
+            name: "乙方签署时间",
96
+            value: data.customerTime,
97
+            render: <><span>{data.customerTime ? moment(data.customerTime).format('YYYY-MM-DD HH:mm:ss') : ''}</span></>
98
+        },
99
+        {
100
+            name: "已签署合同",
101
+            // value:data.,
102
+            render: (x, row) => <><a href={data.contractViewUrl} target = "_blank"><Button type="primary"  className={Styles.btn}>查看合同</Button></a> <a href={data.contractDownloadUrl} download="234.pdf" style={{ color: '#1D74D9',marginLeft:'30px' }}>下载合同</a> </>
103
+        },
104
+        {
105
+            name: "是否归档",
106
+            value: data.archives,
107
+            render: (x, row) => <><span>{data.archives ? '是' : '否'}</span>{!data.archives &&<a onClick={() => onArchives(data.contractId)} style={{ color: '#1D74D9',marginLeft:'30px' }}>归档</a>}  </>
108
+        },
109
+        {
110
+            name: "归档时间",
111
+            value: data.archivesTime,
112
+            render: <><span>{data.archivesTime ? moment(data.archivesTime).format('YYYY-MM-DD HH:mm:ss') : ''}</span></>
113
+        },
114
+    ]
115
+
116
+
117
+    return (
118
+
119
+        <>
120
+
121
+            {datas.map((x) => {
122
+                return <Row style={{ margin: '20px 0' }}>
123
+
124
+                    <Col span={5} className={Styles.title} align="right" >
125
+                        {x.name}
126
+                    </Col>
127
+                    <Col span={9} offset={2} className={Styles.text}>
128
+                        {
129
+                            x.render ? typeof x.render === 'function' ? x.render(props) : x.render : x.value
130
+                        }
131
+
132
+                    </Col>
133
+                    <Col span={2} offset={4}>
134
+
135
+                    </Col>
136
+
137
+                </Row>
138
+            })}
139
+            <div align="center"><Button className={Styles.rebtn} onClick={()=>router.go(-1)}>返回</Button></div>
140
+
141
+        </>
142
+    )
143
+}
144
+
145
+
146
+export default header

+ 309
- 0
src/pages/eContract/manage/list.jsx Ver arquivo

@@ -0,0 +1,309 @@
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
+
12
+
13
+import AuthButton from '@/components/AuthButton';
14
+
15
+const { Option } = Select;
16
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
+
18
+const header = props => {
19
+
20
+  const [data, setData] = useState({})
21
+
22
+
23
+  useEffect(() => {
24
+
25
+    getList({ pageNum: 1, pageSize: 10 });
26
+
27
+
28
+  }, [])
29
+
30
+  // 查询列表
31
+  const getList = (params) => {
32
+    // console.log(params);
33
+    request({ ...apis.manage.list, params: { ...params } }).then((data) => {
34
+      console.log(data)
35
+      setData(data)
36
+    })
37
+  }
38
+
39
+  // 跳转到编辑
40
+  const toDetail = id => () => {
41
+    if (id) {
42
+      router.push({
43
+        pathname: '/eContract/manage/edit',
44
+        query: {
45
+          id: id,
46
+        },
47
+      });
48
+      return
49
+    }
50
+  }
51
+
52
+  /**
53
+   *
54
+   *
55
+   * @param {*} props
56
+   * @returns
57
+   */
58
+
59
+  const columns = [
60
+    {
61
+      title: '合同标题',
62
+      dataIndex: 'contractName',
63
+      key: 'contractName',
64
+      align: 'center',
65
+    },
66
+    {
67
+      title: '甲方名称',
68
+      dataIndex: 'signatoryName',
69
+      key: 'signatoryName',
70
+      align: 'center',
71
+
72
+    },
73
+    {
74
+      title: '甲方是否签署',
75
+      dataIndex: 'signatoryStatus',
76
+      key: 'signatoryStatus',
77
+      align: 'center',
78
+      render: (x, row) => <><span>{row.signatoryStatus === 1 ? '是' :  row.signatoryStatus===0?'否':''}</span></>
79
+    },
80
+    {
81
+      title: '甲方签署时间',
82
+      dataIndex: 'signatoryTime',
83
+      key: 'signatoryTime',
84
+      align: 'center',
85
+      render: (x, row) => <><span>{row.signatoryTime ? `${moment(row.signatoryTime).format('YYYY-MM-DD HH:mm:ss')}` : ''}</span></>
86
+    },
87
+    {
88
+      title: '乙方名称',
89
+      dataIndex: 'customerName',
90
+      key: 'customerName',
91
+      align: 'center',
92
+
93
+    },
94
+    {
95
+      title: '乙方是否签署',
96
+      dataIndex: 'demandStatus',
97
+      key: 'demandStatus',
98
+      align: 'center',
99
+      render: (x, row) => <><span>{row.demandStatus === 1 ? '是' : row.demandStatus===0?'否':''}</span></>
100
+
101
+    },
102
+    {
103
+      title: '乙方签署时间',
104
+      dataIndex: 'customerTime',
105
+      key: 'customerTime',
106
+      align: 'center',
107
+      render: (x, row) => <><span>{row.customerTime ? `${moment(row.customerTime).format('YYYY-MM-DD HH:mm:ss')}` : ''}</span></>
108
+    },
109
+    {
110
+      title: '是否归档',
111
+      dataIndex: 'archives',
112
+      key: 'archives',
113
+      align: 'center',
114
+      render: (x, row) => <><span>{row.archives ? '是' : '否'}</span></>
115
+
116
+    },
117
+    {
118
+      title: '归档时间',
119
+      dataIndex: 'archivesTime',
120
+      key: 'archivesTime',
121
+      align: 'center',
122
+      render: (x, row) => <><span>{row.archivesTime ? `${moment(row.archivesTime).format('YYYY-MM-DD HH:mm:ss')}` : ''}</span></>
123
+    },
124
+    {
125
+      title: '操作',
126
+      dataIndex: 'handle',
127
+      key: 'handle',
128
+      align: 'center',
129
+      render: (text, row) => (
130
+        <AuthButton name="admin.h5Demand.detail.get" noRight={null}>
131
+          <a style={{ color: '#66B3FF' }} onClick={toDetail(row.contractId)} >查看详情</a>
132
+        </AuthButton>
133
+      ),
134
+    },
135
+  ];
136
+
137
+  const rowSelection = {
138
+    onChange: (selectedRowKeys, selectedRows) => {
139
+      console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
140
+      setDemandIds(selectedRows)
141
+    },
142
+  };
143
+
144
+  const changePageNum = pageNumber => {
145
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
146
+  }
147
+
148
+  // 提交事件
149
+  const handleSubmit = (e, props) => {
150
+    e.preventDefault();
151
+    props.form.validateFields((err, values) => {
152
+      if (!err) {
153
+        let {archivesDate, ...submitValue} = values
154
+        if(null != archivesDate && archivesDate.length > 0){
155
+          const [archivesStartDate, archivesEndDate] = archivesDate
156
+          submitValue.archivesStartDate = moment(archivesStartDate).format('YYYY-MM-DD');
157
+          submitValue.archivesEndDate = moment(archivesEndDate).format('YYYY-MM-DD');
158
+        }else{
159
+          submitValue.archivesStartDate = null
160
+          submitValue.archivesEndDate = null
161
+        }        
162
+        console.log(submitValue)
163
+        getList({ pageNum: 1, pageSize: 10, ...submitValue })
164
+      }
165
+    });
166
+    // props.form.validateFields((err, values) => {
167
+    //   if (!err) {
168
+
169
+    //     if (values.startCreateDate != null) {
170
+    //       values.archivesStartDate = moment(values.startCreateDate).format('YYYY-MM-DD HH:mm:ss')
171
+    //     }
172
+    //     if (values.endCreateDate != null) {
173
+    //       values.endCreateDate = moment(values.endCreateDate).format('YYYY-MM-DD HH:mm:ss')
174
+    //     }
175
+    //     getList({ pageNum: 1, pageSize: 10, ...values })
176
+    //   }
177
+    // });
178
+    // getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
179
+  }
180
+
181
+  //重置搜索
182
+  function handleReset() {
183
+    props.form.resetFields();
184
+    getList({ pageNum: 1, pageSize: 10 })
185
+  }
186
+
187
+  //   function showBatchDel(e){
188
+
189
+  //     if (demandIds.length <= 0){
190
+  //       message.info("请选择数据");
191
+  //       return;
192
+  //     }
193
+  //     setBatchDel(e);
194
+  //     if(!e.visable){
195
+  //       getList()
196
+  //     }
197
+  //   }
198
+
199
+
200
+
201
+  const { getFieldDecorator } = props.form
202
+  return (
203
+
204
+    <>
205
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
206
+        <Form.Item>
207
+          {getFieldDecorator('contractName', {
208
+            // initialValue: sampleName
209
+          })(
210
+            <Input
211
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
212
+              placeholder="合同标题"
213
+            />,
214
+          )}
215
+        </Form.Item>
216
+        <Form.Item>
217
+          {getFieldDecorator('signatoryName')(
218
+            <Input
219
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
220
+              placeholder="请输入甲方名称"
221
+            />,
222
+          )}
223
+        </Form.Item>
224
+        <Form.Item>
225
+          {getFieldDecorator('customerName')(
226
+            <Input
227
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
228
+              placeholder="请输入乙方名称"
229
+            />,
230
+          )}
231
+        </Form.Item>
232
+        <Form.Item>
233
+          {getFieldDecorator('customerStatus')(
234
+            <Select style={{ width: '180px' }} placeholder="甲方是否签署">
235
+              <option value="">全部</option>
236
+              <option value="1">是</option>
237
+              <option value="0">否</option>
238
+
239
+            </Select>
240
+          )}
241
+        </Form.Item>
242
+        <Form.Item>
243
+          {getFieldDecorator('demandStatus')(
244
+            <Select style={{ width: '180px' }} placeholder="乙方是否签署">
245
+              <option value="">全部</option>
246
+              <option value="1">是</option>
247
+              <option value="0">否</option>
248
+            </Select>
249
+          )}
250
+        </Form.Item>
251
+        <Form.Item>
252
+          {getFieldDecorator('archives')(
253
+            <Select style={{ width: '180px' }} placeholder="是否归档">
254
+              <option value="">全部</option>
255
+              <option value={true}>是</option>
256
+              <option value={false}>否</option>
257
+            </Select>
258
+          )}
259
+        </Form.Item>
260
+
261
+        <Form.Item>
262
+        
263
+          {getFieldDecorator('archivesDate')(
264
+            <RangePicker placeholder={['归档开始时间', '归档结束时间']} />
265
+          )}
266
+        </Form.Item>
267
+
268
+        {/* <Form.Item>
269
+          {getFieldDecorator('archivesStartDate')(
270
+            <DatePicker showTime={{ format: 'HH:mm:ss' }} placeholder="归档开始时间" />,
271
+          )}
272
+        </Form.Item>
273
+        <Form.Item>
274
+          {getFieldDecorator('archivesEndDate')(
275
+            <DatePicker showTime={{ format: 'HH:mm:ss' }} placeholder="归档结束时间" />,
276
+          )}
277
+        </Form.Item> */}
278
+
279
+        <Form.Item>
280
+          <AuthButton name="admin.taShareActivity.search" noRight={null}>
281
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
282
+              搜索
283
+                </Button>
284
+          </AuthButton>
285
+          <AuthButton name="admin.taShareActivity.search" noRight={null}>
286
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
287
+              重置
288
+                </Button>
289
+          </AuthButton>
290
+        </Form.Item>
291
+      </Form>
292
+      <AuthButton name="admin.h5Demand.add.post" noRight={null}>
293
+        {/* <Button type="danger" onClick={() => addDemandInfo({visable:true})} className={styles.addBtn}>新增</Button> */}
294
+      </AuthButton>
295
+      <AuthButton name="admin.h5Demand.del" noRight={null}>
296
+        {/* <Button type="primary" onClick={() => showBatchDel({visable:true, demandIds: demandIds})} className={styles.addBtn} style={{marginLeft:'30px'}}>删除</Button> */}
297
+      </AuthButton>
298
+      {/* <AddDemand visible={addDemand.visable} onCancel={() => addDemandInfo({visable:false})}></AddDemand> */}
299
+      {/* <BatchDel visible={batchDel.visable} demandIds={batchDel.demandIds} onCancel={() => showBatchDel({visable:false, demandIds: ''})} onSuccess={() => showBatchDel({visable:false, demandIds:'' })}/> */}
300
+      <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
301
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
302
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
303
+      </div>
304
+    </>
305
+  )
306
+}
307
+const WrappedHeader = Form.create({ name: 'header' })(header);
308
+
309
+export default WrappedHeader

+ 41
- 0
src/pages/eContract/manage/styles.less Ver arquivo

@@ -0,0 +1,41 @@
1
+.title {
2
+    height     : 45px;
3
+    font-size  : 20px;
4
+    font-family: PingFangSC-Regular, PingFang SC;
5
+    font-weight: 400;
6
+    color      : rgba(102, 102, 102, 1);
7
+    line-height: 45px;
8
+   
9
+}
10
+.text {
11
+    font-size  : 18px;
12
+    font-family: PingFangSC-Regular, PingFang SC;
13
+    font-weight: 400;
14
+    color      : rgba(51, 51, 51, 1);
15
+    line-height: 45px;
16
+}
17
+
18
+.btn {
19
+    width        : 140px;
20
+    height       : 45px;
21
+    background   : rgba(255, 126, 72, 1);
22
+    border-radius: 7px;
23
+    line-height  : 43px;
24
+    font-size    : 20px;
25
+    font-family  : PingFangSC-Regular, PingFang SC;
26
+    font-weight  : 400;
27
+    color        : rgba(255, 255, 255, 1);
28
+    
29
+}
30
+
31
+.rebtn {
32
+    width:140px;
33
+    height:45px;
34
+    background:rgba(255,255,255,1);
35
+    border-radius:7px;
36
+    border:1px solid rgba(156,156,156,1);
37
+    font-size:20px;
38
+font-weight:400;
39
+color:rgba(102,102,102,1);
40
+line-height:28px;
41
+}

+ 0
- 0
src/pages/eContract/template/pdfDetail.jsx Ver arquivo


+ 3
- 3
src/pages/h5SampleManager/h5Sample/list.jsx Ver arquivo

@@ -48,7 +48,7 @@ function CartBody(props) {
48 48
     <Card
49 49
       hoverable
50 50
       onClick={() => toEdi(data)}
51
-      style={{ minWidth: '330px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}
51
+      style={{ minWidth: '330px', borderRadius: '12px', margin: '10px 20px 10px 0', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}
52 52
     // cover={}
53 53
     // bodyStyle={{ padding: '10px 20px' }}
54 54
     >
@@ -61,7 +61,7 @@ function CartBody(props) {
61 61
 
62 62
       }
63 63
       <img className={Styles.cover} style={{ backgroundImage: `url('` + data.coverImg + `')` }}   ></img>
64
-      <p className={Styles.cardText} style={{ padding: '0.05rem 0.096rem' }}>
64
+      <p className={Styles.cardText} style={{ padding: '0.1rem 0.096rem',marginBottom:'0px' }}>
65 65
         {/* <span className={Styles.title}>样例名</span> */}
66 66
         <span style={{ textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' }}>{data.sampleName}</span>
67 67
       </p>
@@ -177,7 +177,7 @@ function body(props) {
177 177
       </Form>
178 178
 
179 179
       {/* 卡片内容,显示楼盘项目  */}
180
-      <Row style={{ padding: ' 0 10px' }}>
180
+      <Row style={{ paddingTop: ' 16px' }}>
181 181
         {
182 182
           dataSource.records.map((item, _) => (
183 183
             <Col span={8}>

+ 18
- 0
src/services/apis.js Ver arquivo

@@ -1547,5 +1547,23 @@ export default {
1547 1547
       url: `${prefix}/taContractTemplate/:id`,
1548 1548
       action: 'admin.getContractTemplate.get',
1549 1549
     },
1550
+   
1551
+  },
1552
+  manage: {
1553
+    list: {
1554
+      method: 'GET',
1555
+      url: `${prefix}/contract/list`,
1556
+      action: 'admin.contract.list.get',
1557
+    },
1558
+    detail: {
1559
+      method: 'GET',
1560
+      url: `${prefix}/contract/:id`,
1561
+      action: 'admin.contract.id.get',
1562
+    },
1563
+    archives: {
1564
+      method: 'PUT',
1565
+      url: `${prefix}/contract/:id`,
1566
+      action: 'admin.contract.id.put',
1567
+    },
1550 1568
   },
1551 1569
 }