Explorar el Código

5-11人事管理

mentoswzq hace 4 años
padre
commit
4d7ceabf05
Se han modificado 1 ficheros con 81 adiciones y 10 borrados
  1. 81 10
      js/component/manageCenter/statistics/personnel/personnelAll.jsx

+ 81 - 10
js/component/manageCenter/statistics/personnel/personnelAll.jsx

@@ -567,6 +567,58 @@ const PersonnelAll = React.createClass({
     this.loadData();
     this.departmentList();
   },
+  export() {
+    const data = {
+      pageSize: 9999,
+      name: this.state.nameSearch ? this.state.nameSearch : undefined,
+      status: this.state.statusSearch ? this.state.statusSearch : undefined,
+      company: this.state.departmenttList
+        ? this.state.departmenttList
+        : undefined,
+      sex: this.state.sexSearch ? this.state.sexSearch : undefined,
+      marriage: this.state.marriageSearch
+        ? this.state.marriageSearch
+        : undefined,
+      politicalOutlook: this.state.politicalOutlookSearch
+        ? this.state.politicalOutlookSearch
+        : undefined,
+      birthdayMonth: this.state.birthdayMonthSearch
+        ? this.state.birthdayMonthSearch
+        : undefined,
+      promotionStart: this.state.promotionTime[0]
+        ? this.state.promotionTime[0]
+        : undefined,
+      promotionEnd: this.state.promotionTime[1]
+        ? this.state.promotionTime[1]
+        : undefined,
+      entryStart: this.state.entryTime[0] ? this.state.entryTime[0] : undefined,
+      entryStart: this.state.entryTime[1] ? this.state.entryTime[1] : undefined,
+      quitStart: this.state.quitTime[0] ? this.state.quitTime[0] : undefined,
+      quitEnd: this.state.quitTime[1] ? this.state.quitTime[1] : undefined,
+      system: this.state.systemSearch ? this.state.systemSearch : undefined,
+      workingYears: this.state.workingYearsSearch
+        ? this.state.workingYearsSearch
+        : undefined,
+      education: this.state.educationSearch
+        ? this.state.educationSearch
+        : undefined,
+      contractStart: this.state.contractTime[0]
+        ? this.state.contractTime[0]
+        : undefined,
+      contractEnd: this.state.contractTime[1]
+        ? this.state.contractTime[1]
+        : undefined,
+    };
+    for(let key in data) {
+      if(!data.key) {
+        delete data[key]
+      }
+    }
+    window.location.href =
+      globalConfig.context +
+      "/api/admin/personnel/exportPersonnelList?" +
+      $.param(data);
+  },
   departmentList() {
     $.ajax({
       method: "get",
@@ -763,6 +815,33 @@ const PersonnelAll = React.createClass({
       marriage: undefined,
     });
   },
+  verifyDoor() {
+    this.setState({
+      loading: true,
+    });
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/personnel/checkDoorId",
+      data: {
+        doorId: this.state.doorId,
+      },
+      success: function (data) {
+        if (data.error && data.error.length) {
+          message.warning(data.error[0].message);
+        } else {
+          message.success("此编号未被占用");
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          loading: false,
+        });
+      }.bind(this)
+    );
+  },
   addOk() {
     this.setState({
       loading: true,
@@ -2039,19 +2118,10 @@ const PersonnelAll = React.createClass({
             </Button>
           </TabPane>
           <TabPane tab="导出Excel" key="4">
-            <Button type="primary" style={{ margin: "11px 0px 10px 10px" }}>
+            <Button type="primary" onClick={this.export} style={{ margin: "11px 0px 10px 10px" }}>
               导出当前列表
             </Button>
           </TabPane>
-          <TabPane tab="查看" key="5">
-            <Button
-              type="primary"
-              style={{ margin: "11px 0px 10px 10px" }}
-              onClick={() => {}}
-            >
-              详情收款流水
-            </Button>
-          </TabPane>
         </Tabs>
         <div className="patent-table" style={{ marginTop: 10 }}>
           <Spin spinning={this.state.loading}>
@@ -2124,6 +2194,7 @@ const PersonnelAll = React.createClass({
                     });
                   }}
                 />
+                <Button disabled={this.state.doorId ? false : true} style={{position: "absolute" }} type={"primary"} onClick={this.verifyDoor}>验证重复</Button>
               </FormItem>
             </div>
             <div className="clearfix">