魏超 5 年前
父节点
当前提交
c64fadb0c3

+ 4
- 1
src/pages/eContract/seal/components/AddSeal.jsx 查看文件

@@ -7,7 +7,9 @@ import request from '../../../../utils/request';
7 7
 
8 8
 const AddSeal = props => {
9 9
   const companyId = props.companyId
10
+  
10 11
   function close(e){
12
+    props.form.resetFields();
11 13
     props.onCancel(e)
12 14
   }
13 15
 
@@ -18,6 +20,7 @@ const AddSeal = props => {
18 20
         request({ ...apis.seal.addSeal, data: { ...values, companyId: companyId },}).then((data) => {
19 21
           message.info("保存成功")
20 22
           props.onSuccess({visable:false, companyId: companyId});
23
+          props.form.resetFields();
21 24
         }).catch((err) => {
22 25
           message.info(err.msg || err.message)
23 26
         })
@@ -77,7 +80,7 @@ const AddSeal = props => {
77 80
                 message: '请填写印章名称',
78 81
                 },
79 82
             ],
80
-            })(<Input maxLength={10}/>)}
83
+            })(<Input maxLength={10} placeholder="如公章、法人章、发票章、财务章、合同章等"/>)}
81 84
         </Form.Item>
82 85
         <Form.Item label="印章图" help="166*166 像素,PNG格式透明底 ">
83 86
             {getFieldDecorator('sealImg', {

+ 12
- 1
src/pages/eContract/seal/components/SealList.jsx 查看文件

@@ -50,8 +50,12 @@ const header = props => {
50 50
      // 重置搜索
51 51
      function handleReset () {
52 52
       props.form.resetFields();
53
+      getCompanyData({companyId: companyId});
53 54
     }
54 55
 
56
+    function back(){
57
+      router.go(-1)
58
+    }
55 59
     function addSealInfo(){
56 60
       setSealInfo({visable: true, companyId: companyId})
57 61
     }
@@ -70,6 +74,12 @@ const header = props => {
70 74
       getCompanyData(e)
71 75
     }
72 76
 
77
+    function updateOnCancel(e) {
78
+      console.log(e, 'cancel')
79
+      setUpdateSeal(e);
80
+      getCompanyData({companyId: e.companyId})
81
+    }
82
+
73 83
     const delSealInfo = (row) => {
74 84
       Modal.confirm({
75 85
           title: '删除后无法再使用这些章继续签章,不会影响已签署的合同',
@@ -150,9 +160,10 @@ const header = props => {
150 160
       </Form>
151 161
         <div style={{marginTop:'20px', marginBottom:'20px'}}>
152 162
           <Button type="danger" onClick={() => addSealInfo({visable:true})} >新增</Button>
163
+          <Button style={{marginLeft:'20px'}} onClick={() => back()} >返回</Button>
153 164
         </div>
154 165
         <AddSeal visible={sealInfo.visable} companyId={sealInfo.companyId} onCancel={e => setSealInfo(e)} onSuccess={e => getList(e)}/>  
155
-        <UpdateSeal visible={updateSeal.visable} sealId={updateSeal.sealId} companyId={updateSeal.companyId} onCancel={e => setUpdateSeal(e)} onSuccess={e => updateOnSuccess(e)}/>  
166
+        <UpdateSeal visible={updateSeal.visable} sealId={updateSeal.sealId} companyId={updateSeal.companyId} onCancel={e => updateOnCancel(e)} onSuccess={e => updateOnSuccess(e)}/>  
156 167
       <Table dataSource={data.records} columns={columns} pagination={false} rowKey="carouseFigureList"/>
157 168
       </>
158 169
     )

+ 7
- 4
src/pages/eContract/seal/components/UpdateSeal.jsx 查看文件

@@ -23,16 +23,19 @@ const UpdateSeal = props => {
23 23
   }  
24 24
 
25 25
   function close(e){
26
-    props.onSuccess(e)
26
+    props.onCancel(e)
27 27
   }
28 28
 
29
+  function success(e){
30
+    props.onSuccess(e)
31
+  }
29 32
   function handleSubmit (e) {
30 33
     e.preventDefault();
31 34
     props.form.validateFields((err, values) => {
32 35
       if (!err){
33 36
         request({ ...apis.seal.updateSealById, urlData:{id: sealId}, data: { ...values, id: sealId, companyId: companyId },}).then((data) => {
34 37
           message.info("保存成功")
35
-          close({visable:false, sealId:'', companyId: companyId})
38
+          success({visable:false, sealId:'', companyId: companyId})
36 39
         }).catch((err) => {
37 40
           message.info(err.msg || err.message)
38 41
         })
@@ -82,7 +85,7 @@ const UpdateSeal = props => {
82 85
   const { getFieldDecorator } = props.form
83 86
 
84 87
   return (
85
-    <Modal footer={null} title="修改印章" visible={props.visible} onCancel={() => close({visable:false, sealId:''})} width={800}>
88
+    <Modal footer={null} title="修改印章" visible={props.visible} onCancel={() => close({visable:false, companyId:companyId, sealId:''})} width={800}>
86 89
       <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
87 90
         <Form.Item label="印章名称">
88 91
             {getFieldDecorator('sealName',{initialValue:sealData.sealName,
@@ -104,7 +107,7 @@ const UpdateSeal = props => {
104 107
         <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
105 108
             <Button type="primary" htmlType="submit">确定</Button>
106 109
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
107
-            <Button onClick={() => close({visable:false, sealId:''})}>取消</Button>
110
+            <Button onClick={() => close({visable:false, companyId: companyId, sealId:''})}>取消</Button>
108 111
          </Form.Item>
109 112
       </Form>
110 113
     </Modal>