2 Commits 2fbcff0231 ... 201da135cb

Auteur SHA1 Message Date
  xupeng 201da135cb Merge branch 'master' of http://183.56.220.107:50005/AnXinJia/HR_Font il y a 2 ans
  xupeng c922d0e297 合同签订增加发送合同按钮 il y a 2 ans
1 fichiers modifiés avec 34 ajouts et 0 suppressions
  1. 34 0
      src/hrcm/contractmgt/sign/main/container/index.js

+ 34 - 0
src/hrcm/contractmgt/sign/main/container/index.js

@@ -217,6 +217,7 @@ class CMSign extends Component {
             render(text, record, index) {
                 let billId = record.values.pk_psndoc_sub.value;
                 let billNo = record.values.contractnum.value;
+                console.log("=======================>",buttons)
                 return buttons && buttons.map((item, index) => {
                     if (item.key === 'edit') {
                         return (
@@ -248,6 +249,16 @@ class CMSign extends Component {
                                 </span>
                             </React.Fragment>
                         )
+                    } else if (item.key === 'toXyy') {
+                        return (
+                            <React.Fragment>
+                                <span style={{color: '#0073E1', cursor: 'pointer', marginLeft: '12px'}}
+                                      onClick={opt.sendContract.bind(opt, billId, record)}
+                                >
+                                    发起合同
+                                </span>
+                            </React.Fragment>
+                        )
                     }
                 })
             }
@@ -1032,6 +1043,24 @@ class CMSign extends Component {
         })
     }
 
+    sendContract(v, record) {
+        let pks = v
+        ajax({
+            url: '/nccloud/axj/hr/createAndSendContract.do',
+            data: {
+                billId: pks
+            },
+            success: res => {
+                console.log(res)
+                if (res.success && !!res.data) {
+                    toast({color: 'success', content: "合同发送成功!"});
+                } else {
+                    toast({color: 'warning', content: res.error.message});
+                }
+            }
+        })
+    }
+
     //合同文本
     contractText(v, record) {
         let pks = v;
@@ -1169,6 +1198,11 @@ class CMSign extends Component {
                 let pk_psndoc_sub = cardData.rows[0].values.pk_psndoc_sub.value;
                 this.contractText(pk_psndoc_sub);
                 break;
+            case 'toXyy':
+                let selectRows = this.props.editTable.getCheckedRows(tableid);
+                let pk_psndoc_sub1 = selectRows && selectRows.length && selectRows[0].data.values.pk_psndoc_sub.value;
+                pk_psndoc_sub1 ? this.sendContract(pk_psndoc_sub1) : toast({color: 'warning', content: "请选择一条需求发起的合同!"});;
+                break;                
             case 'refresh':
                 this.refreshTableData(true);
                 break;