Browse Source

源码hrcm模块

chenzhfa 2 years ago
parent
commit
7d31816005
100 changed files with 8236 additions and 0 deletions
  1. 81 0
      src/hrcm/.gitignore
  2. 48 0
      src/hrcm/README.md
  3. 12 0
      src/hrcm/basicsetting/defdoc/main/index.js
  4. 40 0
      src/hrcm/basicsetting/templet/main/index.js
  5. 63 0
      src/hrcm/basicsetting/templet_base/main/components/Header/components/customheader/index.js
  6. 3 0
      src/hrcm/basicsetting/templet_base/main/components/Header/components/customheader/index.less
  7. 28 0
      src/hrcm/basicsetting/templet_base/main/components/Header/functions/BeforeDoValidate.js
  8. 29 0
      src/hrcm/basicsetting/templet_base/main/components/Header/functions/BrowseTempletAction.js
  9. 30 0
      src/hrcm/basicsetting/templet_base/main/components/Header/functions/DelLineAction.js
  10. 28 0
      src/hrcm/basicsetting/templet_base/main/components/Header/functions/ExportTempletcAction.js
  11. 16 0
      src/hrcm/basicsetting/templet_base/main/components/Header/functions/QryModeltypeItemsAction.js
  12. 30 0
      src/hrcm/basicsetting/templet_base/main/components/Header/functions/SaveTempletAction.js
  13. 27 0
      src/hrcm/basicsetting/templet_base/main/components/Header/functions/SetTempletAction.js
  14. 26 0
      src/hrcm/basicsetting/templet_base/main/components/Header/functions/wpsDesignInitData.js
  15. 17 0
      src/hrcm/basicsetting/templet_base/main/components/Header/functions/wpsPreStatus.js
  16. 78 0
      src/hrcm/basicsetting/templet_base/main/components/Header/functions/wpsinvode.js
  17. 626 0
      src/hrcm/basicsetting/templet_base/main/components/Header/index.js
  18. 22 0
      src/hrcm/basicsetting/templet_base/main/components/Header/index.less
  19. 356 0
      src/hrcm/basicsetting/templet_base/main/components/SettingModal/components/InfoSetting/index.js
  20. 113 0
      src/hrcm/basicsetting/templet_base/main/components/SettingModal/components/InfoSetting/index.less
  21. 432 0
      src/hrcm/basicsetting/templet_base/main/components/SettingModal/index.js
  22. 14 0
      src/hrcm/basicsetting/templet_base/main/components/SettingModal/index.less
  23. 26 0
      src/hrcm/basicsetting/templet_base/main/components/TableInfo/functions/EditAndDelBefore.js
  24. 28 0
      src/hrcm/basicsetting/templet_base/main/components/TableInfo/functions/QueryGridAction.js
  25. 168 0
      src/hrcm/basicsetting/templet_base/main/components/TableInfo/index.js
  26. 8 0
      src/hrcm/basicsetting/templet_base/main/components/TableInfo/index.less
  27. 167 0
      src/hrcm/basicsetting/templet_base/main/components/wpsinitModal/index.js
  28. 4 0
      src/hrcm/basicsetting/templet_base/main/components/wpsinitModal/index.less
  29. 23 0
      src/hrcm/basicsetting/templet_base/main/container/functions/updateButtonStatus.js
  30. 348 0
      src/hrcm/basicsetting/templet_base/main/container/index.js
  31. 31 0
      src/hrcm/basicsetting/templet_base/main/container/index.less
  32. 41 0
      src/hrcm/basicsetting/templet_glb/main/index.js
  33. 38 0
      src/hrcm/basicsetting/templet_grp/main/index.js
  34. 55 0
      src/hrcm/contractmgt/account/main/components/AgreeSearchModal/index.js
  35. 17 0
      src/hrcm/contractmgt/account/main/components/AgreeSearchModal/index.less
  36. 303 0
      src/hrcm/contractmgt/account/main/components/AgreementDetail/handleAfter.js
  37. 102 0
      src/hrcm/contractmgt/account/main/components/AgreementDetail/index.js
  38. 0 0
      src/hrcm/contractmgt/account/main/components/AgreementDetail/index.less
  39. 107 0
      src/hrcm/contractmgt/account/main/components/AgreementTable/index.js
  40. 12 0
      src/hrcm/contractmgt/account/main/components/AgreementTable/index.less
  41. 117 0
      src/hrcm/contractmgt/account/main/components/AlertModal/index.js
  42. 0 0
      src/hrcm/contractmgt/account/main/components/AlertModal/index.less
  43. 299 0
      src/hrcm/contractmgt/account/main/components/ContractDetail/handleAfter.js
  44. 93 0
      src/hrcm/contractmgt/account/main/components/ContractDetail/index.js
  45. 0 0
      src/hrcm/contractmgt/account/main/components/ContractDetail/index.less
  46. 105 0
      src/hrcm/contractmgt/account/main/components/ContractTable/index.js
  47. 6 0
      src/hrcm/contractmgt/account/main/components/ContractTable/index.less
  48. 185 0
      src/hrcm/contractmgt/account/main/components/Header/index.js
  49. 16 0
      src/hrcm/contractmgt/account/main/components/Header/index.less
  50. 54 0
      src/hrcm/contractmgt/account/main/components/SearchModal/index.js
  51. 14 0
      src/hrcm/contractmgt/account/main/components/SearchModal/index.less
  52. 191 0
      src/hrcm/contractmgt/account/main/components/SearchTop/index.js
  53. 82 0
      src/hrcm/contractmgt/account/main/components/SearchTop/index.less
  54. 68 0
      src/hrcm/contractmgt/account/main/components/Uploader/index.js
  55. 0 0
      src/hrcm/contractmgt/account/main/components/Uploader/index.less
  56. 37 0
      src/hrcm/contractmgt/account/main/container/functions/agreeTextViewAction.js
  57. 31 0
      src/hrcm/contractmgt/account/main/container/functions/cancelEdit.js
  58. 16 0
      src/hrcm/contractmgt/account/main/container/functions/checkBtnPermission.js
  59. 221 0
      src/hrcm/contractmgt/account/main/container/functions/configData.js
  60. 37 0
      src/hrcm/contractmgt/account/main/container/functions/contractTextViewAction.js
  61. 141 0
      src/hrcm/contractmgt/account/main/container/functions/editAgree.js
  62. 120 0
      src/hrcm/contractmgt/account/main/container/functions/editContract.js
  63. 55 0
      src/hrcm/contractmgt/account/main/container/functions/editData.js
  64. 69 0
      src/hrcm/contractmgt/account/main/container/functions/getAgreeTableData.js
  65. 12 0
      src/hrcm/contractmgt/account/main/container/functions/getAgreeTypes.js
  66. 71 0
      src/hrcm/contractmgt/account/main/container/functions/getConTableData.js
  67. 35 0
      src/hrcm/contractmgt/account/main/container/functions/handleAllpks.js
  68. 75 0
      src/hrcm/contractmgt/account/main/container/functions/initFormMeta.js
  69. 142 0
      src/hrcm/contractmgt/account/main/container/functions/processTemplateData.js
  70. 22 0
      src/hrcm/contractmgt/account/main/container/functions/resetAllpks.js
  71. 102 0
      src/hrcm/contractmgt/account/main/container/functions/saveData.js
  72. 65 0
      src/hrcm/contractmgt/account/main/container/functions/setQueryMeta.js
  73. 47 0
      src/hrcm/contractmgt/account/main/container/functions/tempPrint.js
  74. 11 0
      src/hrcm/contractmgt/account/main/container/functions/toggleModalVisible.js
  75. 45 0
      src/hrcm/contractmgt/account/main/container/functions/updateButtonStatus.js
  76. 136 0
      src/hrcm/contractmgt/account/main/container/functions/viewAgree.js
  77. 111 0
      src/hrcm/contractmgt/account/main/container/functions/viewContract.js
  78. 410 0
      src/hrcm/contractmgt/account/main/container/index.js
  79. 55 0
      src/hrcm/contractmgt/account/main/container/index.less
  80. 3 0
      src/hrcm/contractmgt/account/main/container/pageIns.js
  81. 98 0
      src/hrcm/contractmgt/account/main/index.js
  82. 30 0
      src/hrcm/contractmgt/center/components/Header/functions/ChangeCenterAction.js
  83. 28 0
      src/hrcm/contractmgt/center/components/Header/functions/ContractSign.js
  84. 28 0
      src/hrcm/contractmgt/center/components/Header/functions/ContractTextViewAction.js
  85. 30 0
      src/hrcm/contractmgt/center/components/Header/functions/ExtendCenterAction.js
  86. 30 0
      src/hrcm/contractmgt/center/components/Header/functions/FinishCenterAction.js
  87. 38 0
      src/hrcm/contractmgt/center/components/Header/functions/MakeCenterAction.js
  88. 30 0
      src/hrcm/contractmgt/center/components/Header/functions/OpinionRemCenterAction.js
  89. 30 0
      src/hrcm/contractmgt/center/components/Header/functions/ReleaseCenterAction.js
  90. 21 0
      src/hrcm/contractmgt/center/components/Header/functions/updateButtonStatus.js
  91. 496 0
      src/hrcm/contractmgt/center/components/Header/index.js
  92. 15 0
      src/hrcm/contractmgt/center/components/Header/index.less
  93. 28 0
      src/hrcm/contractmgt/center/components/LeftTree/functions/CenterTree.js
  94. 26 0
      src/hrcm/contractmgt/center/components/LeftTree/functions/CenterTreeFirstChildAction.js
  95. 157 0
      src/hrcm/contractmgt/center/components/LeftTree/index.js
  96. 5 0
      src/hrcm/contractmgt/center/components/LeftTree/index.less
  97. 28 0
      src/hrcm/contractmgt/center/components/NextOperation/functions/CenterDeleteContAction.js
  98. 28 0
      src/hrcm/contractmgt/center/components/NextOperation/functions/CenterEffectContAction.js
  99. 194 0
      src/hrcm/contractmgt/center/components/NextOperation/index.js
  100. 0 0
      src/hrcm/contractmgt/center/components/NextOperation/index.less

+ 81 - 0
src/hrcm/.gitignore

@@ -0,0 +1,81 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (http://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules/
+jspm_packages/
+
+# Typescript v1 declaration files
+typings/
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variables file
+.env
+
+dist
+
+package-lock.json
+
+yarn.lock
+
+.DS_Store
+.idea/workspace.xml
+.idea
+# config.json
+/.idea/workspace.xml
+/.idea/misc.xml
+/.idea/modules.xml
+/.idea/vcs.xml
+
+# ./src/HR_HRPUB_FROUNT
+# ./src/HR_HRHI_FRONT
+# ./src/HR_HRWA_FRONT
+# ./src/HR_HRJF_FRONT
+src/
+!./src/platform/*
+dev-build/p-server/

+ 48 - 0
src/hrcm/README.md

@@ -0,0 +1,48 @@
+- basicsetting
+  - 基础档案 (全局) defdoc
+  - 合同模板 (全局)  templet_glb
+  - 合同模板 (集团)  templet_grp
+  - 合同模板 (组织)  templet
+- contractmgt
+  - 合同处理中心 center
+  - 合同签订 sign
+  - 合同变更 change
+  - 合同续签 extend
+  - 合同解除 terminate
+  - 合同终止 end
+  - 续签意见征询 contopinion
+
+- protocolmgt
+  - 协议签订 sign
+  - 协议变更 change
+  - 协议解除 release
+  - 协议终止 finish
+
+- contractreport
+  - 合同台账 account
+  - 劳动争议 disputed
+  - 常用查询分析-集团 reportquery_grp
+  - 常用查询分析-组织 reportquery
+  
+
+ 业务模块名称      | URL 
+ ----------------|------
+ 基础档案         | http://localhost:3006/hrcm/basicsetting/defdoc/main
+ 合同模板 (组织)   | http://localhost:3006/hrcm/basicsetting/templet/main
+ 合同模板 (全局)   | http://localhost:3006/hrcm/basicsetting/templet_glb/main
+ 合同模板 (集团)   | http://localhost:3006/hrcm/basicsetting/templet_grp/main
+ 合同处理中心      | http://localhost:3006/hrcm/contractmgt/center/main
+ 合同签订         | http://localhost:3006/hrcm/contractmgt/sign/main
+ 合同变更         | http://localhost:3006/hrcm/contractmgt/change/main
+ 合同续签         | http://localhost:3006/hrcm/contractmgt/extend/main
+ 合同解除         | http://localhost:3006/hrcm/contractmgt/release/main
+ 合同终止         | http://localhost:3006/hrcm/contractmgt/finish/main
+ 续签意见征询      | http://localhost:3006/hrcm/contractmgt/contopinion/main
+ 协议签订         | http://localhost:3006/hrcm/protocolmgt/sign/main
+ 协议变更         | http://localhost:3006/hrcm/protocolmgt/change/main
+ 协议解除         | http://localhost:3006/hrcm/protocolmgt/release/main
+ 协议终止         | http://localhost:3006/hrcm/protocolmgt/finish/main
+ 合同台账         | http://localhost:3006/hrcm/contractreport/account/main
+ 劳动争议         | http://localhost:3006/hrcm/contractreport/disputed/main
+ 常用查询分析-集团 | http://localhost:3006/hrcm/contractreport/reportquery_grp/main
+ 常用查询分析-组织 | http://localhost:3006/hrcm/contractreport/reportquery/main

+ 12 - 0
src/hrcm/basicsetting/defdoc/main/index.js

@@ -0,0 +1,12 @@
+import ReactDOM from 'react-dom';
+import {createPage, base, ajax, toast} from 'nc-lightapp-front';
+import ChildDef from 'src/hrpub/defdoc/defdoc_glb/main/'
+let param = {
+    defdocCond : "nccloud.web.hrcm.defdoc.sqlbuilder.HRCMDefdocSQLBuilder",
+    jsonConfig :{
+        moduleId :"cm6011",
+        domainName :"hrcm",
+        code: 'cm6011-000090'
+    }
+};
+ReactDOM.render(<ChildDef params={param}/>, document.querySelector('#app'));

+ 40 - 0
src/hrcm/basicsetting/templet/main/index.js

@@ -0,0 +1,40 @@
+/**
+ * 合同模板——组织
+ */
+import React, {Component} from 'react';
+import ReactDOM from 'react-dom';
+import {createPage, getBusinessInfo} from 'nc-lightapp-front';
+
+import HomePage from '../../templet_base/main/container';
+import {getAppPageConfig} from 'src/hrpub/common/utils/utils';
+
+let appConfig = getAppPageConfig();
+if (new RegExp(/(localhost|127\.0\.0\.1):3006/g).test(window.location.href)) {
+    appConfig = {
+        pagecode: '60110133',
+        appcode: '60110133'
+    }
+}
+let businessInfo = getBusinessInfo();
+const props = {
+    isGlb: true,
+    pk_org:'GLOBLE00000000000000',
+    nodeName: "ORG",
+    ...appConfig,
+    ...businessInfo
+};
+
+const PeriodModal = createPage({
+    billinfo:[
+        {
+            billtype: 'grid',
+            pagecode: props.pagecode,
+            bodycode: 'template'
+        }
+    ]
+})(HomePage);
+
+ReactDOM.render(<PeriodModal
+{...props}
+/>,
+document.querySelector('#app'));

+ 63 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/components/customheader/index.js

@@ -0,0 +1,63 @@
+import React, {Component} from 'react';
+import wpsPreStatus from '../../functions/wpsPreStatus';
+import './index.less';
+
+import {
+    base,
+} from 'nc-lightapp-front';
+
+const {
+    NCCheckbox
+} = base;
+
+class Header extends Component {
+    constructor(props) {
+        super(props);
+        this.onChangeHandle = this.onChangeHandle.bind(this);
+    }
+
+
+    onChangeHandle(value) {
+        console.log('点击控制配置前须知',value)
+        this.props.updateState({
+            isNeedWpsInterview: value
+        });
+        console.log(this.props)
+        wpsPreStatus({readstatus:value,url:this.props.originUrl})
+            .then((res) => {
+                if(res.success){
+                    console.log('以改变后台')
+                }
+               
+            });
+        
+    }
+
+    render() {
+        const {
+            
+            json,
+            isNeedWpsInterview,
+        } = this.props;
+
+
+        return (
+            <div className='multiple-header'>
+                {
+                    <div className="header-checkbox">
+                        <NCCheckbox
+                            className="wps-checkbox"
+                            color="primary"
+                            onChange={this.onChangeHandle}
+                            checked={isNeedWpsInterview}
+                        >
+                            {json['cm6011-000175'] || '不再弹出设计前配置说明'}{/* 国际化处理: 不再弹出设计前配置说明 json['hi6007-000354'] || */}
+                        </NCCheckbox>
+                    </div>
+                }
+            </div>
+        );
+    }
+}
+
+export default Header;

+ 3 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/components/customheader/index.less

@@ -0,0 +1,3 @@
+.multiple-header{
+    margin-left: 10px;
+}

+ 28 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/functions/BeforeDoValidate.js

@@ -0,0 +1,28 @@
+import proFetch from "../../../../../../public/functions/project-fetch";
+
+/**
+ * 是否可编辑
+ * @param pk_conmodel
+ * @param pk_org
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function BeforeDoValidate(pk_org,pk_conmodel) {
+    const postData = {
+        pk_org,
+        pk_conmodel
+    };
+
+    return new Promise( ((resolve, reject) => {
+        proFetch({
+            url: '/nccloud/hrcm/templet/BeforeDoValidate.do',
+            body: postData,
+        })
+            .then((res) => {
+                if (res.success) {
+                    resolve(res)
+                }
+            });
+        })
+    );
+}

+ 29 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/functions/BrowseTempletAction.js

@@ -0,0 +1,29 @@
+import proFetch from "../../../../../../public/functions/project-fetch";
+
+/**
+ * 模板浏览  用于   合同模板 /合同处理中心
+ * @param pk_conmodel
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function BrowseTempletAction(pk_org, pk_conmodel) {
+    const postData = {
+        pk_org,
+        pk_conmodel
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: '/nccloud/hrcm/templet/BrowseTempletAction.do',
+                body: postData,
+            })
+                .then((res) => {
+                    if (!res.success) return;
+                    resolve(res);
+                    if (!res.data) return;
+                    let location = window.location;
+                    location.port ? window.open("uclient://start/http://" + location.hostname + ":" + location.port + res.data) : window.open("uclient://start/http://" + location.hostname + res.data)
+                });
+        })
+    );
+}

+ 30 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/functions/DelLineAction.js

@@ -0,0 +1,30 @@
+import proFetch from "../../../../../../public/functions/project-fetch";
+
+/**
+ * 删除
+ * @param pk_org
+ * @param pk_group
+ * @param pk_conmodel
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function DelLineAction(pk_org,pk_group,pk_conmodel) {
+    const postData = {
+        pk_org,
+        pk_group,
+        pk_conmodel
+    };
+
+    return new Promise( ((resolve, reject) => {
+        proFetch({
+            url: '/nccloud/hrcm/templet/DelLineAction.do',
+            body: postData,
+        })
+            .then((res) => {
+                if (res.success) {
+                    resolve(res)
+                }
+            });
+        })
+    );
+}

+ 28 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/functions/ExportTempletcAction.js

@@ -0,0 +1,28 @@
+import proFetch from "../../../../../../public/functions/project-fetch";
+
+/**
+ *  导出
+ * @param pk_conmodel
+ * @param outfilename
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function ExportTempletcAction(pk_conmodel, outfilename) {
+    const postData = {
+        pk_conmodel,
+        outfilename
+    };
+
+    return new Promise( ((resolve, reject) => {
+        proFetch({
+            url: '/nccloud/hrcm/templet/ExportTempletcAction.do',
+            body: postData,
+        })
+            .then((res) => {
+                if (res.success) {
+                    resolve(res)
+                }
+            });
+        })
+    );
+}

+ 16 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/functions/QryModeltypeItemsAction.js

@@ -0,0 +1,16 @@
+import proFetch from "../../../../../../public/functions/project-fetch";
+
+/**
+ * 合同模板-查询模版类型下拉项接
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function QryModeltypeItemsAction() {
+    const postData = {
+    };
+
+    return proFetch({
+        url: '/nccloud/hrcm/templet/QryModeltypeItemsAction.do',
+        body: postData,
+    });
+}

+ 30 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/functions/SaveTempletAction.js

@@ -0,0 +1,30 @@
+import proFetch from "../../../../../../public/functions/project-fetch";
+
+/**
+ * 保存
+ * @param pk_org
+ * @param pk_group
+ * @param template
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function SaveTempletAction(pk_org,pk_group,template) {
+    const postData = {
+        pk_org,
+        pk_group,
+        template
+    };
+
+    return new Promise( ((resolve, reject) => {
+        proFetch({
+            url: '/nccloud/hrcm/templet/SaveTempletAction.do',
+            body: postData,
+        })
+            .then((res) => {
+                if (res.success) {
+                    resolve(res)
+                }
+            });
+        })
+    );
+}

+ 27 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/functions/SetTempletAction.js

@@ -0,0 +1,27 @@
+import proFetch from "../../../../../../public/functions/project-fetch";
+
+/**
+ * 模板设置
+ * @param pk_conmodel
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function SetTempletAction(pk_org,pk_conmodel) {
+    const postData = {
+        pk_org,
+        pk_conmodel
+    };
+
+    return new Promise( ((resolve, reject) => {
+        proFetch({
+            url: '/nccloud/hrcm/templet/SetTempletAction.do',
+            body: postData,
+        })
+            .then((res) => {
+                if (res.success) {
+                    resolve(res)
+                }
+            });
+        })
+    );
+}

+ 26 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/functions/wpsDesignInitData.js

@@ -0,0 +1,26 @@
+import proFetch from "../../../../../../public/functions/project-fetch";
+
+/**
+ * 模板设置
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function wpsInitDesign(pk_conmodel, pk_org) {
+    let postData = {
+        pk_conmodel,
+        pk_org
+    }
+    
+    return new Promise( ((resolve, reject) => {
+        proFetch({
+            url: '/nccloud/hrpub/rptdef/DesignAction.do',
+            body: postData,
+        })
+            .then((res) => {
+                if (res.success) {
+                    resolve(res)
+                }
+            });
+        })
+    );
+}

+ 17 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/functions/wpsPreStatus.js

@@ -0,0 +1,17 @@
+import proFetch from "../../../../../../public/functions/project-fetch";
+
+
+export default function wpsPreStatus(payload) {
+    return new Promise( ((resolve, reject) => {
+        proFetch({
+            url: '/nccloud/hrpub/rptdef/PreAction.do',
+            body: payload,
+        })
+            .then((res) => {
+                if (res.success) {
+                    resolve(res)
+                }
+            });
+        })
+    );
+}

+ 78 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/functions/wpsinvode.js

@@ -0,0 +1,78 @@
+/**
+ * 此方法是根据wps_sdk.js做的调用方法封装
+ * 可参照此定义
+ * @param {*} funcs     这是在WPS加载项内部定义的方法,采用JSON格式(先方法名,再参数)
+ */
+import {toast} from 'nc-lightapp-front';
+var bUseHttps = false;
+var _wps = {}
+function _WpsInvoke(funcs, front, jsPluginsXml,isSilent) {
+    var info = {};
+    info.funcs = funcs;
+    // 判断当前环境是http还是https
+    // bUseHttps = 'https:' == document.location.protocol ? true: false;
+    var func = bUseHttps ? WpsInvoke.InvokeAsHttps : WpsInvoke.InvokeAsHttp
+    func(WpsInvoke.ClientType.wps, // 组件类型
+        "WpsOAAssist", // 插件名,与wps客户端加载的加载的插件名对应
+        "dispatcher", // 插件方法入口,与wps客户端加载的加载的插件代码对应,详细见插件代码
+        info, // 传递给插件的数据
+        function (result) { // 调用回调,status为0为成功,其他是错误
+            if (result.status) {
+                if (bUseHttps && result.status == 100) {
+                    WpsInvoke.AuthHttpesCert('请在稍后打开的网页中,点击"高级" => "继续前往",完成授权。')
+                    return;
+                }
+                toast({
+                    color: 'info',
+                    content: result.message
+                })
+                // alert(result.message)
+
+            } else {
+                console.log(result.response)
+                // showresult(result.response)
+            }
+        },front,
+        jsPluginsXml,
+        isSilent)
+}
+// WpsInvoke.RegWebNotify(WpsInvoke.ClientType.wps, "WpsOAAssist", function (messageText) {
+//     var span = window.parent.document.getElementById("webnotifyspan")
+//     span.innerHTML = messageText
+// })
+function openRevision(allData) {
+    // var filePath = "C:\\Users\\Administrator\\Desktop\\wps备份\\样章.docx"
+    
+    var filePath = "http://127.0.0.1:8921/nccloud/hr/login/InternalAction.do"
+    var uploadPath = "D://test/"
+    var jsPluginsXml = location.origin + '/nccloud/resources/hrhi/public/wpsconfig/jsplugins.xml'
+    _WpsInvoke([{
+        "OpenDoc": {
+            "uploadPath": uploadPath, // 保存文档上传路径
+            "fileName": filePath,
+            "RptName":allData.Contmodelname,
+            "appcode":allData.appcode,
+            "key":allData.key,
+            "pk_rpt_def":allData.pk_rpt_def,
+            "pk_conmodel":allData.pk_conmodel,
+            "userName": allData.UserName, //用户名
+            "revisionCtrl": {
+                "bOpenRevision": true,
+                "bShowRevision": true
+            }
+        }
+    },{
+        "custormerData":{
+            "allData":allData
+        }
+    }
+
+], true, jsPluginsXml)
+}
+
+_wps['openRevision'] = {
+    action: openRevision,
+}
+export {
+    openRevision
+}

+ 626 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/index.js

@@ -0,0 +1,626 @@
+import React, {Component} from 'react';
+import './index.less';
+import {
+    toast,
+    promptBox,
+    cardCache
+} from 'nc-lightapp-front';
+
+import ReferSearch from 'src/hrpub/common/components/referSearch/org';
+import DelLineAction from "./functions/DelLineAction";
+import SaveTempletAction from "./functions/SaveTempletAction";
+// import SetTempletAction from "./functions/SetTempletAction";
+import WpsInitDesign from "./functions/wpsDesignInitData";
+import {openRevision} from "./functions/wpsinvode";
+//import formDownload from 'src/hrpub/common/utils/download/download';
+import { formDownload } from 'nc-lightapp-front';
+import BrowseTempletAction from "./functions/BrowseTempletAction";
+import do_print from 'src/hrpub/common/utils/print';
+import Export from 'src/hrpub/common/utils/exportHtml';
+import deepCopy from 'src/hrpub/common/utils/deep-copy';
+import isMac from "../../../../../public/functions/isMac";
+import HRBack from 'src/hrpub/common/components/hr-back/index';
+import QryModeltypeItemsAction from "./functions/QryModeltypeItemsAction";
+// import CustomHeader from './components/customheader';
+let {getDefData, setDefData} = cardCache;
+const tableId = 'template';
+
+class Header extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            json: props.json,
+            isBtnFirst: true  //是否是按钮的第一次触发
+        };
+        this.onBtnOperation = this.onBtnOperation.bind(this);
+    }
+
+    componentWillReceiveProps(nextprops) {
+        let nextjson = JSON.stringify(nextprops.json);
+        let thisjson = JSON.stringify(this.props.json);
+        if (nextjson !== thisjson) {
+            this.setState({
+                json: nextprops.json,
+                hrorgobj: {} //人力资源组织
+            })
+        }
+        if (nextprops.pk_conmodel !== this.props.pk_conmodel) {
+            this.props.updateButtonStatus();
+        }
+    }
+
+    onBtnOperation(props, btncode, areacode, record, index) {
+        if (areacode === 'list') {
+            switch (btncode) {
+                case 'add':
+                    this.add();
+                    break;
+                case 'modify':
+                    this.modify();
+                    break;
+                case 'setting':
+                    if (!this.props.selectedRow) {
+                        toast({
+                            color: 'warning',
+                            content: this.state.json["cm6011-000168"] || '请选择一条数据!' // "请选择一条数据!"
+                        })
+                        return false;
+                    }
+                    this.props.updateState({
+                        preSettingVisible: true
+                    })
+                    break;
+                case 'refresh':
+                    this.refresh(res => {
+                        toast({
+                            color: 'success',
+                            content: this.state.json['cm6011-000006']
+                        });//刷新成功!
+                    });
+                    break;
+                case 'print':
+                    const el = document.querySelector('.table-info').cloneNode(true);
+                    // const table = el.querySelector('.templetBaseTable');
+                    // table.removeChild(table.lastElementChild);
+                    // const tHeader = el.querySelector('.wui-table-header');
+                    // const tr = tHeader.querySelector('tr');
+                    // tr.removeChild(tr.firstElementChild);
+                    // tr.removeChild(tr.firstElementChild);
+                    const tableTmp = deepCopy(this.props.meta.getMeta()[tableId]);
+                    let data = deepCopy(this.props.editTable.getAllRows(tableId));
+                    this.changeData(data);
+                    do_print(
+                        el,
+                        {
+                            title: this.state.json['cm6011-000147'] /* 国际化处理: 合同模板数据*/,
+                            maker: this.state.json['cm6011-000033'] /* 国际化处理: 打印人*/,
+                            date: this.state.json['cm6011-000034'] /* 国际化处理: 打印日期*/,
+                            maxColLen: this.getTableTmp(tableTmp).length, // 可以显示的长度
+                            beforeAppend: (tableDataList) => {
+                                tableDataList[0][0] = this.getTableTmp(tableTmp);
+                                return [tableDataList[0]]
+                            }
+                        },
+                        {
+                            tableTmp: tableTmp,
+                            data: data
+                        }
+                    );
+                    break;
+                case 'output':
+                    let dataRows = deepCopy(this.props.editTable.getAllData(tableId).rows);
+                    let meta = deepCopy(this.props.meta.getMeta()[tableId]);
+                    // 输出 将是否默认值修改为 汉字
+                    this.changeData(dataRows);
+                    this.changeMeta(meta);
+                    //输出
+                    Export(document.querySelector('.base-table-next'),
+                        {
+                            title: this.state.json['cm6011-000147'] /* 国际化处理: 合同模板数据*/,
+                            fileName: this.state.json['cm6011-000147'] /* 国际化处理: 合同模板数据*/,
+                            maker: this.state.json['cm6011-000100'] /* 国际化处理: 制单人*/,
+                            date: this.state.json['cm6011-000101'] /* 国际化处理: 制表日期*/
+                        }, {
+                            data: dataRows,
+                            meta: meta,
+                            showIndex: false
+                        });
+                    break;
+                default:
+                    break;
+            }
+        } else if (areacode === 'edit') {
+            switch (btncode) {
+                case 'save':
+                    this.save();
+                    break;
+                case 'cancel':
+                    this.cancel();
+                    break;
+                default:
+                    break;
+            }
+        } else if (areacode === 'body') {
+            switch (btncode) {
+                case 'add_body':
+                    this.add(index);
+                    break;
+                case 'delete':
+                    promptBox(
+                        {
+                            color: "warning",
+                            title: this.props.json['cm6011-000041'], /* 国际化处理: 确认删除*/
+                            content: this.props.json['cm6011-000042'], /* 国际化处理: 您确定要删除所选数据吗*/
+                            beSureBtnClick: () => {
+                                this.deleteAction(record);
+                            }
+                        });
+                    break;
+                case 'browse':
+                    if (!isMac(this.props.json['cm6011-000148'])) {
+                        this.browseTemplete(record);
+                    }
+                    break;
+                case 'copy':
+                    this.copy(record, index);
+                    break;
+                case 'templateSetting':
+                    if (!isMac(this.props.json['cm6011-000148'])) {
+                        this.templateSetting(record, index);
+                    }
+                    break;
+                case 'file':
+                    this.props.updateState({
+                        showUploader: true
+                    });
+                    break;
+                case 'export':
+                    this.export(record);
+                    break;
+                default:
+                    break;
+            }
+        }
+    }
+
+    /**
+     * 修改 操作列 不打印/输出
+     * @param meta
+     */
+    changeMeta(meta) {
+        meta.items.map(item => {
+            if (item.attrcode === 'file' || item.attrcode === 'opr') {
+                item.visible = false
+            }
+        });
+    }
+
+    changeData(dataRows) {
+        dataRows.map(item => {
+            let val = item.values.isdefault.value;
+            if (val) {
+                item.values.isdefault.display = this.state.json['cm6011-000057']
+            } else {
+                item.values.isdefault.display = this.state.json['cm6011-000058']
+            }
+        });
+    }
+
+    /**
+     * 获取表头
+     * @param tmp
+     * @returns {Array}
+     */
+    getTableTmp(tmp) {
+        let tableTmp = [];
+        let visibleCol = [];
+        tmp.items.forEach((item) => {
+            if (item.visible && item.attrcode !== 'opr' && item.attrcode !== 'file') {
+                visibleCol.push(item);
+            }
+        });
+        visibleCol.forEach((col) => {
+            tableTmp.push(col.label);
+        });
+        return tableTmp
+    }
+
+    /**
+     * 查询主组织 节点信息
+     */
+    searchChange(val) {
+        // 合同模板——组织  当返回全局时退出
+        if (typeof val === 'object' && val.hasOwnProperty('refpk') && val.refpk === "GLOBLE00000000000000") {
+            this.setState({
+                hrorgobj: {}
+            });
+            return
+        }
+        this.setState({
+            hrorgobj: val
+        });
+        this.props.updateState({
+            pkOrg: {
+                display: val.refname,
+                value: val.refpk,
+            }
+        }, () => {
+            this.refresh()
+        });
+    }
+
+    /**
+     * 新增
+     */
+    add = async (index) => {
+        if (!this.hasOrg()) return;
+        await this.setTableEdit(true);
+        // 隐藏操作咧
+        this.hideTableCol();
+
+        let rows = this.props.editTable.getAllRows(tableId);
+        let values = {
+            pk_org: this.props.pkOrg,
+            pk_group: {
+                display: this.props.groupName,
+                value: this.props.groupId
+            },
+            vmodeltype: {
+                display: this.state.json['cm6011-000063'],
+                value: '1002Z710000000017GUF'
+            }
+        };
+        let AddIndex = isNaN(index) ? rows.length : (index + 1);
+        this.props.editTable.addRow(tableId, AddIndex, true, values);
+        this.props.editTable.setEditableRowKeyByIndex(tableId, AddIndex, 'vmodeltype', true);
+    };
+
+    modify = async () => {
+        if (!this.hasOrg()) return;
+        await this.setTableEdit();
+        // 隐藏操作咧
+        this.hideTableCol();
+    }
+
+    hasOrg = () => {
+        let pk_org = this.props.pkOrg.value;
+        if (this.props.nodeName === 'ORG' && !pk_org) {
+            toast({
+                color: 'warning',
+                content: this.state.json['cm6011-000008'] // "请先选择组织!"
+            });
+            return false;
+        }
+        return true
+    };
+
+    /**
+     * 设置表格编辑态
+     */
+    setTableEdit = async (isAdd = false) => {
+        if (isAdd) {
+            await this.qryModeltypeItems();
+        }
+        this.props.updateState({
+            editting: true
+        });
+        this.props.editTable.setStatus(tableId, 'edit');
+    };
+
+    /**
+     * 设置浏览态
+     */
+    setTableBrowse() {
+        this.props.editTable.setStatus(tableId, 'browse');
+    }
+
+    /**
+     * 删除
+     */
+    deleteAction(record) {
+        if (this.props.editting) {
+            this.props.editTable.deleteTableRowsByRowId(tableId, record.rowid);
+            return;
+        }
+        if (!record) {
+            toast({
+                color: 'warning',
+                content: this.state.json['cm6011-000009'] // 请先选则数据
+            });
+            return
+        }
+        let pk_conmodel = record.values.pk_conmodel.value;
+        DelLineAction(this.props.pkOrg.value, this.props.pk_group, pk_conmodel).then(res => {
+            toast({
+                color: 'success',
+                content: this.state.json['cm6011-000004']
+            });//删除成功!
+            //刷新
+            this.refresh();
+        })
+    }
+
+    /**
+     * 复制
+     */
+    copy = async (record, index) => {
+        if (!this.hasOrg()) return;
+        await this.setTableEdit();
+        // 隐藏操作咧
+        this.hideTableCol();
+        this.props.editTable.focusRowByIndex(tableId, index);
+        setDefData('hrcm', 'basicsetting.templete', record);
+        this.props.updateState({
+            selectedRow: { ...record, index: index}
+        })
+        let values = {
+            pk_org: this.props.pkOrg,
+            vmodeltype: record.values.vmodeltype,
+            pk_group: {
+                display: this.props.groupName,
+                value: this.props.groupId
+            },
+            model_xml: record.values.pk_conmodel
+        };
+        this.props.editTable.addRow(tableId, void 0, true, values);
+    };
+
+    /**
+     *  刷新
+     */
+    refresh(callback) {
+        this.props.refresh(callback);
+    }
+
+    /**
+     * 模板设置
+     */
+    templateSetting(record, index) {
+        if (!record) {
+            toast({
+                color: 'warning',
+                content: this.state.json['cm6011-000009'] // 请先选则数据
+            });
+            return
+        }
+        let isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") || (navigator.platform == "Macintosh") || (navigator.platform == "MacIntel");
+        if (isMac) {
+            toast({
+                color: 'warning',
+                content: '暂不支持MAC'
+            })
+            return false
+        }
+        this.props.editTable.focusRowByIndex(tableId, index);
+        setDefData('hrcm', 'basicsetting.templete', record);
+        // if (!this.props.isNeedWpsInterview) {
+        //     this.props.updateState({
+        //         wpsvisible: true,
+        //         selectedRow: { ...record, index: index}
+        //     })
+        // } else {
+            let pk_conmodel = record.values.pk_conmodel.value;
+            let pk_org = this.props.pkOrg.value;
+            WpsInitDesign(pk_conmodel, pk_org).then(res => {
+                if (res.success && res.data) {
+                    console.log("模板设置返回的数据",res.data)
+                    let result = deepCopy(res.data)
+                    result.pk_rpt_def =  pk_conmodel;
+                    result.pk_conmodel = pk_conmodel;
+                    openRevision(result)
+                    // console.log("当前行数据",record.values)
+                    // this.props.closeWpsModal()
+                }
+            })
+        // }
+    }
+
+    /**
+     * 浏览模板
+     */
+    browseTemplete(record) {
+        if (!record) {
+            toast({
+                color: 'warning',
+                content: this.state.json['cm6011-000009'] // 请先选则数据
+            });
+            return
+        }
+        let pk_conmodel = record.values.pk_conmodel.value;
+        BrowseTempletAction(this.props.pkOrg.value, pk_conmodel).then(res => {
+
+        })
+    }
+
+    /**
+     * 导出
+     */
+    export(record) {
+        // let record = getDefData('hrcm', 'basicsetting.templete');
+        if (!record) {
+            toast({
+                color: 'warning',
+                content: this.state.json['cm6011-000009'] // 请先选则数据
+            });
+            return
+        }
+        let pk_conmodel, outfilename;
+        pk_conmodel = record.values.pk_conmodel.value;
+        outfilename = record.values.vmodelname.value + '-' + record.values.vmodeltype.display;
+        let postData = {
+            pk_org: this.props.pkOrg.value,
+            func_type: 2,
+            queryMode: '0',
+            show_on_job_psn: true,
+            psnjobPks: '',
+            pk_conmodel,
+            outfilename,
+            infosetPKs: ''
+        };
+        formDownload({
+            params: postData,
+            url: '/nccloud/hrcm/templet/ExportTempletcAction.do',
+            enctype: 2,
+            onResult: (body) => {
+                let res = JSON.parse(body.innerText);
+
+                if (!res || res.success) {
+                    toast({
+                        color: 'success',
+                        content: 'hi6007-000185' // 导出成功
+                    });
+                } else {
+                    toast({
+                        color: 'danger',
+                        content: res.error.message // 导出失败
+                    });
+                }
+            }
+        });
+
+        // ExportTemplet(pk_conmodel, outfilename).then(res=>{
+        //     console.log('导出')
+        // })
+    }
+
+    /**
+     * 保存
+     */
+    save() {
+        let rows = this.props.editTable.getAllRows(tableId);
+        // 检测 必需项
+        if (!this.props.editTable.checkRequired(tableId, rows)) return;
+        let template = this.props.editTable.getAllData(tableId);
+        SaveTempletAction(this.props.pkOrg.value, this.props.pk_group, template).then(res => {
+            toast({
+                color: 'success',
+                content: this.state.json['cm6011-000005']
+            });//保存成功!
+            this.refresh();
+            this.props.updateState({
+                editting: false
+            }, () => {
+                this.setTableBrowse();
+                // 显示操作列
+                this.showTableCol();
+            });
+        });
+    }
+
+    /**
+     * 隐藏table 操作列
+     */
+    hideTableCol = () => {
+        this.props.button.setButtonVisible({
+            copy: false,
+            templateSetting: false,
+            more: false,
+            add_body: true,
+            export: false
+        });
+        this.props.editTable.hideColByKey(tableId, 'file');
+    };
+
+    /**
+     * 展示table 操作列
+     */
+    showTableCol = () => {
+        this.props.button.setButtonVisible({
+            copy: true,
+            templateSetting: true,
+            more: true,
+            export: true,
+            add_body: false
+        });
+        this.props.editTable.showColByKey(tableId, 'file');
+    };
+
+    /**
+     * 取消
+     */
+    cancel = () => {
+        promptBox(
+            {
+                color: "warning",
+                title: this.props.json['cm6011-000000'], /* 国际化处理: 确认取消*/
+                content: this.props.json['cm6011-000001'], /* 国际化处理: 是否确认要取消*/
+                beSureBtnClick: () => {
+                    this.props.updateState({
+                        editting: false
+                    }, () => {
+                        // 显示操作列
+                        this.showTableCol();
+                    });
+
+                    // 表格浏览态
+                    this.props.editTable.cancelEdit(tableId);
+                    // 清空 record
+                    // setDefData('hrcm', 'basicsetting.templete', null);
+                    // this.props.updateState({
+                    //     pk_conmodel: null
+                    // });
+                    this.refresh()
+                }
+            });
+    }
+
+    qryModeltypeItems = async () => {
+        await new Promise(resolve => {
+            QryModeltypeItemsAction().then(res => {
+                if (!res.data) {
+                    return;
+                }
+                res.data.map(item => {
+                    item.display = item.name;
+                    delete item.name
+                });
+                let template = this.props.meta.getMeta();
+                let tableitems = template[[tableId]].items;
+                tableitems.map((item) => {
+                    if (item.attrcode === 'vmodeltype') {
+                        item.options = res.data;
+                    }
+                });
+                this.props.meta.setMeta(template, resolve)
+            })
+        });
+
+    };
+
+    render() {
+        const {button, editting} = this.props;
+        return (
+            <div className="page-header header">
+                {editting ? <div className={'left'}>
+                    <HRBack onClick={this.cancel} title={this.state.json["cm6011-000060"]}/>
+                </div> : this.props.nodeName === 'ORG' ? <div className={'left'}>
+                    <ReferSearch
+                        orgVal={this.state.hrorgobj}
+                        getOrgData={this.searchChange.bind(this)}
+                    />
+                    {/* <div style={{lineHeight: '30px'}}>  */}
+                    {/* <CustomHeader {...this.props} updateState={this.props.updateState}/></div> */}
+                </div> : <div className={'left'}></div>//{/* <div> <CustomHeader {...this.props} updateState={this.props.updateState}/></div> */}
+                }
+                {editting ? <div className={'right'}>
+                    {button.createButtonApp({
+                        area: 'edit',
+                        onButtonClick: (props, btncode) => {
+                            this.onBtnOperation(props, btncode, 'edit', this);
+                        }
+                    })}
+                </div> : <div className={'right'}>
+                    {button.createButtonApp({
+                        area: 'list',
+                        onButtonClick: (props, btncode) => {
+                            this.onBtnOperation(props, btncode, 'list', this);
+                        }
+                    })}
+                </div>}
+
+            </div>
+        );
+    }
+}
+
+export default Header;

+ 22 - 0
src/hrcm/basicsetting/templet_base/main/components/Header/index.less

@@ -0,0 +1,22 @@
+.page-header {
+  width: 100%;
+  padding: 6px 20px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  .header-checkbox-group {
+    float: left;
+    padding-left: 10px;
+
+    .header-checkbox {
+      margin-right: 30px;
+    }
+    .header-checkbox:last-child {
+      margin-right: 0;
+    }
+  }
+}
+.left{
+  display: flex;
+}

+ 356 - 0
src/hrcm/basicsetting/templet_base/main/components/SettingModal/components/InfoSetting/index.js

@@ -0,0 +1,356 @@
+import React, { Component } from 'react';
+
+import './index.less';
+import { base, promptBox, toast } from 'nc-lightapp-front';
+import { hrAjax as proFetch } from 'src/hrpub/common/utils/utils';
+import { getQueryCondition } from 'src/hrpub/common/utils/utils';
+const searchId = 'ConditionQuery';
+const {
+    NCModal,
+    NCButton,
+    NCSelect, NCFormControl, NCTable
+} = base;
+
+const { NCOption } = NCSelect;
+const {
+    Header: NCHeader,
+    Body: NCBody,
+    Footer: NCFooter
+} = NCModal;
+
+
+class InfoSetting extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {}
+    }
+
+    settingInfo = (item) => {
+        if (this.props.editStatus) {
+            return;
+        }
+        this.props.update({currentInfoItem: item})
+        this.getFormData(item.nodeData.nodeValue.hashValue.m_data_id)
+    }
+    getFormData = async (meta_id) => {
+        const { form } = this.props;
+        /*清空表单所有数据*/
+        form.EmptyAllFormValue('conditionCard');
+        await this.props.update({
+            datecontrol: false,
+            dateFormat: '', // 选择得日期格式
+            prefixValue: '',  // 前缀
+            suffixValue: '', // 后缀
+            searchData: {}
+        })
+        return proFetch({
+            url: '/nccloud/hrpub/rptdef/QueryAction.do',
+            body: {
+                meta_data_id: meta_id// '1002Z7100000000046GP',
+            }
+        })
+            .then((res) => {
+                if (res.data) {
+                    if (res.data.form) {
+                        let formData = res.data.form.conditionCard
+                        form.setAllFormValue({
+                            'conditionCard': formData
+                        });
+                        // form.setFormStatus('conditionCard', 'edit')
+                        this.props.update({
+                            datecontrol: res.data.datecontrol,
+                            settingDisabled: false
+                          }) 
+                    } else {
+                        this.props.update({
+                        settingDisabled: !res.data.editable
+                       }) 
+                    }
+                   
+                }
+            })
+    }
+    selectDateFormat = (v) => {
+        this.props.update({ dateFormat: v })
+    }
+    onChange = (e) => {
+        this.props.update({ value: e });
+    }
+    onChangePrefix = (val) => {
+        this.props.update({ prefixValue: val })
+    }
+    onChangeSuffix = (val) => {
+        this.props.update({ suffixValue: val })
+    }
+    // 弹出配置框
+    getItemSetting = () => {
+        const { meta, search, currentInfoItem } = this.props;
+        return proFetch({
+            url: '/nccloud/hrpub/rptdef/QueryTemplateInitAction.do',
+            body: {
+                pk_infoset: currentInfoItem.pid// '1002Z7100000000046GP',
+            }
+        })
+            .then(async(res) => {
+                let template = meta.getMeta();
+                let currentInfoSetCode = currentInfoItem.code.split('.')[0];
+                template['ConditionQuery'].items = res.data[currentInfoSetCode].items;
+                // template['ConditionQuery'].items.forEach((item) => item.visible = true)
+                await meta.setMeta(template, () => { 
+                    // 写在这里,第一次弹出后点击确认按钮事件不触发
+                    // search.openAdvSearch('ConditionQuery', true) 
+                })
+                search.openAdvSearch(searchId, true)
+            })
+    }
+
+    goSearch = (props, data) => {
+        let searchData = {
+            queryAreaCode: "ConditionQuery", 
+            oid: "1001Z710000000003DX7", 
+            querytype: "tree",
+            querycondition: data
+        }
+        this.getSettingInfo(searchData)
+    }
+    getSettingInfo = (searchData) => {
+        const { form, selectedRow, search } = this.props;
+        this.props.update({ searchData: searchData })
+        // formData,meta_data_id,prefix,suffix,dataFormat
+        return proFetch({
+            url: '/nccloud/hrpub/rptdef/FilterAction.do',
+            body: {
+                queryFlag: true,
+                querycondition: {
+                    logic: 'and',
+                    conditions: []
+                },
+                pk_conmodel: selectedRow.values['pk_conmodel'].value,
+                ...searchData,
+                queryAreaCode: searchId,
+                pk_infoset: this.props.currentInfoItem.pid,
+                oid: '1001Z710000000003DX7',
+            }
+        })
+            .then( (res) => {
+                if (res.success) {
+                    if (res.data) {
+                        form.setFormItemsValue('conditionCard', { 'wheresql': { display: res.data.Wheresql, value: res.data.Wheresql } })
+                        form.setFormItemsValue('conditionCard', { 'sqldscrpt': { display: res.data.Sqldscrpt, value: res.data.Sqldscrpt } })
+                    }
+                }
+            })
+    }
+    onClose = () => {
+        // this.props.onClose();
+        this.props.update({
+            infoSettingVisible: false
+        })
+        this.props.getSetTableData()
+        this.props.update({
+            dateFormat: '',
+            prefixValue: '',
+            suffixValue: '',
+            // 表单数据清除
+        })
+        this.props.form.EmptyAllFormValue('conditionCard')
+    }
+
+    submitItemSet = () => {
+        const { form, prefixValue, suffixValue, dateFormat, editStatus, currentInfoItem, json, selectedRow } = this.props;
+        const allFormValue = form.getAllFormValue('conditionCard');
+        // formData,meta_data_id,prefix,suffix,dataFormat
+        let meta_data_id = currentInfoItem.nodeData ? currentInfoItem.nodeData.nodeValue.hashValue.m_data_id : currentInfoItem.key;
+        return proFetch({
+            url: '/nccloud/hrpub/rptdef/FilterAction.do',
+            body: {
+                formData: { 'model': allFormValue },
+                meta_data_id: meta_data_id,
+                pk_conmodel: selectedRow.values['pk_conmodel'].value,
+                prefix: prefixValue,
+                suffix: suffixValue,
+                dataFormat: dateFormat,
+                updateFlag: editStatus, // 修改为true, 新增为false
+                // queryFlag: true,
+                querycondition: {
+                    logic: 'and',
+                    conditions: []
+                },
+                ...this.props.searchData,
+                queryAreaCode: searchId,
+                oid: '1001Z710000000003DX7',
+            }
+        })
+            .then(async (res) => {
+                if (res.success) {
+                    toast({
+                        color: 'success',
+                        content: json["cm6011-000005"] || '保存成功'//
+                    });
+                    this.onClose()
+                }
+            })
+    }
+    render() {
+        const {
+            visible,
+            form,
+            json,
+            syncTree, 
+            onTreeSelect, 
+            search,
+        } = this.props;
+
+        const { infoSetItemData,
+            dateFormatData, 
+            datecontrol, 
+            editStatus, 
+            currentInfoItem,
+            prefixValue,
+            suffixValue, 
+            selectedInfoSet,
+            settingDisabled,
+            dateFormat } = this.props
+        const disable = editStatus? 'disabled': '';
+
+        return (
+            <div>
+                <NCModal
+                    show={visible}
+                    onHide={() => this.onClose()}
+                    backdrop={'static'}
+                    size="lg"
+                    width="1000"
+                    height="600"
+                    className="info-wui-modal-height"
+                >
+                    <NCHeader
+                        closeButton={true}
+                    >
+                        {json["cm6011-000161"] || '新增条件预置'}
+                    </NCHeader>
+                    <NCBody className='infoset-content'>
+                        <div className='info-set-left'>
+                            {/* 左树 */}
+                            <div className='info-setting'>
+                                {syncTree.createSyncTree({
+                                    treeId: 'infoset',
+                                    needSearch: false,
+                                    needEdit: false,
+                                    onSelectEve: onTreeSelect
+                                })}
+                            </div>
+                            <div className='info-set-item'>
+                                <div className='info-set-title'>{selectedInfoSet}</div>
+                                <ul>
+                                    {
+                                        infoSetItemData.length > 0 && infoSetItemData.map((item, index) => {
+                                            return (
+                                                <li className={`${currentInfoItem.key === item.key ? 'active' : ''} ${disable}`} onClick={() => { this.settingInfo(item) }}>{item.name}</li>
+                                            )
+                                        })
+                                    }
+                                </ul>
+                            </div>
+                        </div>
+
+                        <div className='info-set-right'>
+                            <div className='info-set-right-form'>
+                                {
+                                    form.createForm('conditionCard', {
+                                        // onBeforeEvent: this.onFormBeforeEvent,
+                                        // onAfterEvent: this.onFormAfterEvent
+                                    })
+                                }
+
+                            </div>
+                            <div className='info-set-right-buttons'>
+                                <span className='line-wrap'>
+                                    <span className={`line`}></span>
+                                </span>
+                                <NCButton disabled={settingDisabled} onClick={() => this.getItemSetting()}>{json["cm6011-000162"] || '子集取数条件'}</NCButton>
+                            </div>
+                            <div className='info-set-right-other'>
+                                <div className='info-set-right-date'>
+                                    <span style={{marginBottom: '5px', fontWeight: '700'}}>{json["cm6011-000163"] || '日期'}</span>
+                                    <div>
+                                        <span>{json["cm6011-000164"] || '日期格式'}</span>
+                                        <NCSelect
+                                            className="header-select"
+                                            value={dateFormat}
+                                            disabled={!datecontrol}
+                                            onChange={v => this.selectDateFormat(v)}
+                                            // onSelect = {v => this.selectDateFormat(v)}
+                                        >
+                                            {dateFormatData && dateFormatData.map((item) => {
+                                                return (
+                                                    <NCOption
+                                                        key={item.value}
+                                                    >
+                                                        {item.display}
+                                                    </NCOption>
+                                                )
+                                            })}
+                                        </NCSelect>
+                                    </div>
+                                </div>
+                                <span className='line-wrap'>
+                                    <span className={`line`}></span>
+                                </span>
+                                <div className='info-set-right-text'>
+                                    <div style={{marginBottom: '5px', fontWeight: '700'}}>{json["cm6011-000165"] || '扩充文本'}</div>
+                                    <div>
+                                        <span>{json["cm6011-000166"] || "前缀"}</span>
+                                        <NCFormControl
+                                            className="demo-input"
+                                            value={prefixValue}
+                                            onChange={this.onChangePrefix}
+                                            size="sm"
+                                        />
+                                        <span style={{ marginLeft: '20px' }}>{json["cm6011-000167"] ||'后缀'}</span>
+                                        <NCFormControl
+                                            className="demo-input"
+                                            value={suffixValue}
+                                            onChange={this.onChangeSuffix}
+                                            size="sm"
+                                        />
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </NCBody>
+                    <NCFooter>
+                        <NCButton
+                            colors="primary"
+                            onClick={this.submitItemSet}
+                        >
+                            {json['cm6011-000028']/** 确定*/}
+                        </NCButton>
+                        <NCButton
+                            onClick={() => this.onClose()}
+                        >
+                            {json['cm6011-000054']/** 取消*/}
+                        </NCButton>
+                    </NCFooter>
+                </NCModal>
+
+                <div style={{
+                    display: 'none'
+                }}>
+                    {search.NCCreateSearch(searchId, {
+                        searchBtnName: json['cm6011-000028'] || '确定',
+                        onlyShowAdvArea: false,
+                        // saveSearchPlan: true,
+                        onlyShowSuperBtn: true,
+                        hideSearchPlan:true,
+                        showAdvSearchPlanBtn:false,
+                        syncAdvCondition: false,
+                        clickSearchBtn: this.goSearch
+                    })}
+                </div>
+            </div>
+        );
+    }
+}
+
+export default InfoSetting;

+ 113 - 0
src/hrcm/basicsetting/templet_base/main/components/SettingModal/components/InfoSetting/index.less

@@ -0,0 +1,113 @@
+.infoset-content{
+    height: 100%;
+    display: flex;
+    .info-set-left{
+        width: 50%;
+        display: flex;
+        flex: 2;
+        border-top: 1px solid #ccc;
+        border-right: 1px solid #ccc;
+        .info-setting{
+            width: 50%;
+            height: 100%;
+            overflow: auto;
+            // border: 1px solid #ccc;
+            border-right: 1px solid #ccc;
+        }
+        .info-set-item{
+            flex: 1;
+            .info-set-title{
+                height: 30px;
+                font-weight: 700;
+                line-height: 30px;
+                padding-left: 5px;
+                margin: 2px 0 0 0;
+                list-style: none;
+                white-space: nowrap;
+                outline: 0;
+                // background-color: #e4e4e4;
+                color: #e14c46;
+                border-bottom: 1px solid #ccc;
+            }
+            ul{
+                height: 95%;
+                overflow: auto;
+                padding-bottom: 10px;
+            }
+            li{
+                height: 30px;
+                line-height: 30px;
+                padding-left: 5px;
+                margin: 2px 0;
+                list-style: none;
+                white-space: nowrap;
+                outline: 0;
+                cursor: pointer;
+            }
+            ul li:nth-child(1){
+                margin-top: 0 !important;
+               }
+            // ul li:last-child{
+            // margin-bottom: 0 !important;
+            // }
+        }
+    }
+
+    .active{
+        background-color: #e4e4e4;
+        color: #e14c46;
+    }
+
+    .info-set-right{
+        flex: 3;
+        margin-left: 5px;
+        .info-set-right-form{
+            height: calc(~"100% - 170px");
+            overflow: auto;
+        }
+        .info-set-right-other{
+            margin-top: 5px;
+            margin-bottom: 5px;
+            margin-left: 20px;
+            // display: flex;
+            .info-set-right-date{
+                // flex: 1;
+                margin-bottom: 10px;
+            }
+            .info-set-right-text{
+                // flex: 2;
+                margin-top: 10px;
+            }
+        }
+        .info-set-right-buttons{
+          display: flex;
+        }
+    }
+    .base-form-control-wrapper{
+        margin-left: 10px;
+        width: 100px !important;
+    }
+
+
+    .line-wrap {
+        -webkit-box-flex: 1;
+        -ms-flex: 1 1 auto;
+        flex: 1 1 auto;
+        margin-top: 15px;
+        // height: 7px;
+        .line {
+            // margin-top: 5px;
+            border-bottom: 1px dashed #d9d9d9;
+            display: -webkit-box;
+            display: -ms-flexbox;
+            display: flex;
+            // width: 100%;
+        }
+    }
+}
+
+.disabled{
+    color: #909090;
+    // pointer-events:none;
+    cursor: not-allowed !important; 
+    }

+ 432 - 0
src/hrcm/basicsetting/templet_base/main/components/SettingModal/index.js

@@ -0,0 +1,432 @@
+import React, { Component } from 'react';
+import './index.less';
+import { base, promptBox, toast } from 'nc-lightapp-front';
+import InfoSetting from './components/InfoSetting/index';
+import { hrAjax as proFetch } from 'src/hrpub/common/utils/utils';
+
+const {
+    NCModal,
+    NCButton,
+    NCSelect
+} = base;
+const { NCOption } = NCSelect;
+const {
+    Header: NCHeader,
+    Body: NCBody,
+    Footer: NCFooter
+} = NCModal;
+let initTemp = false;
+class SettingModal extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            // preSettingVisible: false,
+            infoSettingVisible: false,
+            preSettingTableDate: [],
+            currentInfoSet: '', // 当前信息集
+            dateFormatData: [], // 日期格式
+            infoSetItemData: [], // 信息项
+            getInfoNames: {},
+            selectedInfoSet: '', // 选择的当前信息项
+            editStatus: false,  // 是否为从修改进入的
+            currentInfoItem: {},
+            datecontrol: false, // 是否可以选择日期格式
+            dateFormat: '', // 选择得日期格式
+            prefixValue: '',  // 前缀
+            suffixValue: '', // 后缀
+            searchData: {},
+            settingDisabled: true
+        }
+    }
+    init = () => {
+        if (!initTemp) {
+            this.processTemplate()
+            initTemp = true
+        }
+        this.getSetTableData()
+    }
+    processTemplate = () => {
+        const { meta, json } = this.props;
+        let template = meta.getMeta();
+        let that = this;
+        template['conditionList'].items.push({
+            attrcode: 'opr',  // 
+            itemtype: 'customer',
+            hyperlinkflag: false,
+            label: json["cm6011-000064"] || '操作',
+            textAlign: 'center',
+            visible: true,
+            fixed: 'right',
+            render(index, record) {
+                return (
+                    <div>
+                        <span style={{ marginRight: '5px' }} onClick={() => that.editRow(index, record)} style={{ cursor: 'pointer', marginRight: '5px', color: '#0073E1' }}>{json["hi6007-000030"] || '修改'}</span>
+                        <span onClick={() => that.deleteRow(index, record)} style={{ cursor: 'pointer', color: '#0073E1' }}>{json["hi6007-000031"] || '删除'}</span>
+                    </div>
+                )
+            }
+        });
+        meta.setMeta(template);
+    }
+
+    // 新增
+    addNew = async () => {
+        this.setState({
+            editStatus: false,
+        }, () => {
+            this.getTreeData()
+        })
+    }
+
+    // 获取信息集和信息项
+    getTreeData = (record) => {
+        return proFetch({
+            url: '/nccloud/hrpub/rptdef/AddInitAction.do',
+            body: {
+                pk_infoset: this.props.selectedRow.values['vmodeltype'].value, // 
+            }
+        })
+            .then(async (res) => {
+                if (res.success) {
+                    if (res.data) {
+                        this.setTreeData(res.data, record);
+                    }
+                }
+            })
+    };
+
+    // 设置信息集和信息项
+    setTreeData = async (data = {}, record = {}) => {
+        // const {props, action} = this.comp;
+        const { syncTree, json } = this.props;
+        const { infoset = [], dateFormat } = data;
+
+        const { treeData, getInfoNames, tableMap } = await this.formatTree(infoset);
+        const children = treeData;
+        let root = [{
+            children,
+            code: json["cm6011-000157"] || '信息集',
+            id: null,
+            isOrgStruSort: false,
+            innercode: null,
+            isleaf: false,
+            key: 'root',
+            name: json["cm6011-000157"] || '信息集',
+            nodeData: {
+                nodeValue: {}
+            },
+            pid: null,
+            refname: json["cm6011-000157"] || '信息集',
+            refpk: 'root',
+            title: json["cm6011-000157"] || '信息集'
+        }];
+        this.setState({
+            infoSettingVisible: true,
+        })
+        syncTree.setSyncTreeData('infoset', root);
+        let selectKey, currentInfoItem = {}, editStatus = false;
+        if (Object.keys(record).length === 0) {
+            selectKey = children[0].refpk;
+            editStatus = false;
+        } else {
+            // 修改
+            selectKey = record.values.pk_infoset.value;
+            currentInfoItem = { 
+                key: record.values.pk_info_item.value, 
+                name: record.values.fieldname.value.split('.')[1], 
+                code: record.values.fieldcode.value,
+                pid: record.values.pk_infoset.value 
+            };
+            syncTree.setNodeDisable('infoset', true);
+            editStatus = true;
+        }
+        syncTree.setNodeSelected('infoset', selectKey);
+        syncTree.openNodeByPk('infoset', 'root');
+        // console.log(selectedInfoSet, getInfoNames[selectKey])
+        this.setState({
+            selectKey,
+            // handleItem: children[0].nodeData.nodeValue
+            dateFormatData: dateFormat,
+            currentInfoItem,
+            editStatus,
+            selectedInfoSet: getInfoNames[selectKey],
+            infoSetItemData: tableMap[selectKey],
+        });
+    };
+    // 设置信息集和信息项格式
+    formatTree = async (InfoSet = []) => {
+        let tableMap = {}
+        let getInfoNames = {}
+        let treeData = InfoSet.filter((item, index) => {
+            if (!getInfoNames[item.key] && item.refcode !== 'bd_psndoc') {
+                getInfoNames[item.key] = item.name
+            }
+            if (item.children && item.children.length > 0 && item.refcode !== 'bd_psndoc') {
+                if (!tableMap[item.key]) {
+                    tableMap[item.key] = item.children
+
+                }
+                item.children = [];
+                return item
+            }
+        })
+
+        // let firstKey = treeData[0].key
+        this.setState({
+            allTree: InfoSet,
+            treeData: treeData, //信息集树的数据
+            tableMap: tableMap, //信息集表格的映射数据
+            getInfoNames: getInfoNames,
+        })
+        return { treeData, getInfoNames, tableMap }
+    };
+    // 选择信息集
+    onTreeSelect = (key) => {
+        console.log(key)
+        const { form } = this.props;
+        if (key === 'root') return;
+        let infoSetItemData = this.state.tableMap[key]
+        let selectedInfoSet = this.state.getInfoNames[key]
+        /*清空表单所有数据*/
+        /*exceptArr array,不需要清空的字段数据 */
+        form.EmptyAllFormValue('conditionCard');
+        // form.setFormStatus('conditionCard', "browse");
+        this.setState({
+            infoSetItemData: infoSetItemData,
+            selectKey: key,
+            selectedInfoSet: selectedInfoSet,
+            datecontrol: false,
+            dateFormat: '', // 选择得日期格式
+            prefixValue: '',  // 前缀
+            suffixValue: '', // 后缀
+            searchData: {},
+            settingDisabled: true
+        })
+    }
+
+    // 获取已经设置过得表格数据
+    getSetTableData = () => {
+        const {
+            form,
+            editTable,
+            button,
+            selectedRow
+        } = this.props;
+
+        return proFetch({
+            url: '/nccloud/hrpub/rptdef/ListAction.do',
+            body: {
+                pk_infoset: selectedRow.values['vmodeltype'].value,// '1001Z710000000002YZJ',
+                pk_conmodel: selectedRow.values['pk_conmodel'].value
+            }
+        })
+            .then(async (res) => {
+                if (res.success) {
+                    if (res.data) {
+                        editTable.setTableData('conditionList', { rows: res.data.data['conditionList'].rows });
+                    } else {
+                        editTable.setTableData('conditionList', { rows: [] });
+                    }
+                }
+            }, (err) => {
+                console.log(err.message)
+            })
+
+    }
+    // 删除
+    deleteRow = (index, record) => {
+        const { json } = this.props;
+        promptBox({
+            color: 'warning',
+            title: json["cm6011-000041"] || '确认删除', // 确认删除
+            content: json["cm6011-000158"] || '是否确认要删除', // 是否确认要删除,
+            beSureBtnClick: () => {
+                return proFetch({
+                    url: '/nccloud/hrpub/rptdef/DeleteAction.do',
+                    body: {
+                        id: record.values.id.value,
+                    }
+                })
+                    .then(async (res) => {
+                        if (res.success) {
+                            toast({
+                                color: 'success',
+                                content: json["cm6011-000004"] || '删除成功'//
+                            });
+                            this.getSetTableData()
+                        }
+                    })
+            }
+        });
+    }
+
+    // 修改
+    editRow = async (index, record) => {
+        this.setState({
+            editStatus: true,
+            settingDisabled: false
+        })
+        await this.getTreeData(record)
+        await this.toEditPage(record)
+    }
+    // 去编辑
+    toEditPage = (record) => {
+        const { form, selectedRow } = this.props;
+        return proFetch({
+            url: '/nccloud/hrpub/rptdef/QueryAction.do',
+            body: {
+                id: record.values.id.value,
+                pk_conmodel: selectedRow.values['pk_conmodel'].value,
+            }
+        })
+            .then(async (res) => {
+                if (res.success) {
+                    if (res.data) {
+                        let formData = res.data.form.conditionCard
+                        form.setAllFormValue({
+                            'conditionCard': formData
+                        });
+                        /*设置表单编辑性*/
+                        /*values Object,格式为{'attrcode': true/false}*/
+                        // form.setFormItemsDisabled(formId, values)
+                        // form.setFormStatus('conditionCard','edit')
+                        this.setState({
+                            datecontrol: res.data.datecontrol, // 是否可以选择日期格式
+                            dateFormat: res.data.dataFormat || '', // 选择得日期格式
+                            prefixValue: res.data.prefix,  // 前缀
+                            suffixValue: res.data.suffix // 后缀
+                        })
+                    }
+                }
+            })
+    }
+
+    update = (payload) => {
+        this.setState(payload)
+    }
+
+    onClose = () => {
+        const {
+            onClose,
+            form,
+            json
+        } = this.props;
+
+        promptBox({
+            color: 'warning',
+            title: json['cm6011-000000'], // 确认取消
+            content: json['cm6011-000123'], // 是否确认要取消,
+            beSureBtnClick: () => {
+                form.EmptyAllFormValue('folder');
+                onClose && onClose();
+            }
+        });
+    }
+    rtClose = () => {
+        const {
+            onClose,
+            form
+        } = this.props;
+        form.EmptyAllFormValue('folder');
+        onClose && onClose();
+    }
+
+    onChange = (v) => {
+        console.log(v)
+
+    }
+    showButton = () => {
+        const {
+            json
+        } = this.props;
+        // let a = [{name: '合同1', key: '1'}, {name: '合同2', key: '2'}]
+        return (
+            <div className='button-add'>
+                {/* <div style={{
+                    float: 'left',
+                    marginBottom: '5px'
+                }}>
+                    <NCSelect
+                    value={'1'}
+                    onChange={(v) => onChange(v)}
+                    >
+                        {
+                            a.map((item) => {
+                                return <NCOption key={item.key}>{item.name}</NCOption>
+                            })
+                        }
+                    </NCSelect>
+                </div> */}
+                <div style={{
+                    float: 'right',
+                    marginBottom: '5px'
+                }}>
+                    <NCButton colors="primary" size="sm" onClick={this.addNew}>{json["cm6011-000159"] || '新增'}</NCButton>
+                </div>
+            </div>
+        )
+    }
+
+    shouldComponentUpdate(nextProps, nextState) {
+        if (!this.props.visible && !nextProps.visible) {
+            return false
+        }
+
+        return true;
+    }
+    render() {
+        const {
+            visible,
+            json,
+            editTable,
+            tableId
+        } = this.props;
+
+        return (
+            <div>
+                <NCModal
+                   visible={visible}
+                   onCancel={this.rtClose}
+                   mask={'static'}
+                   size="lg"
+                   className={'setting-modal'}
+                   height= {500}
+                   width={1000}
+                   onShow={this.init}
+                >
+                    <NCHeader
+                        closeButton={true}
+                    >
+                        {json["cm6011-000160"] || '条件预置'}
+                    </NCHeader>
+                    <NCBody>
+                        {this.showButton()}
+                        {/* table */}
+                        <div className='flex-container' style={{height: 'calc(100% - 32px)'}}>
+                        {
+                            editTable.createEditTable('conditionList', {
+                                // cancelCustomRightMenu: true,
+                                showIndex: true,        //显示序列号
+                                // showCheck: true,        //显示复选框
+                                height: 340
+                            })
+                        }
+                        </div>
+                    </NCBody>
+                </NCModal>
+                <InfoSetting
+                    {...this.props}
+                    {...this.state}
+                    selectedRow={this.props.selectedRow}
+                    json={json}
+                    visible={this.state.infoSettingVisible}
+                    update={this.update}
+                    getSetTableData={this.getSetTableData}
+                    onTreeSelect={this.onTreeSelect}
+                />
+            </div>
+        );
+    }
+}
+
+export default SettingModal;

+ 14 - 0
src/hrcm/basicsetting/templet_base/main/components/SettingModal/index.less

@@ -0,0 +1,14 @@
+// .nc-button-wrapper{
+// 	white-space:nowrap!important;
+// }
+// .button-add{
+// 	height: 32px;
+// }
+.setting-modal{
+	.nc-button-wrapper{
+		white-space:nowrap!important;
+	}
+	.button-add{
+		height: 32px;
+	}
+}

+ 26 - 0
src/hrcm/basicsetting/templet_base/main/components/TableInfo/functions/EditAndDelBefore.js

@@ -0,0 +1,26 @@
+import proFetch from "../../../../../../public/functions/project-fetch";
+
+/**
+ * 管控模式判断哪几行不能被修改 不可编辑接口
+ * @param pk_org
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function EditAndDelBefore(pk_org) {
+    const postData = {
+        pk_org
+    };
+
+    return new Promise( ((resolve, reject) => {
+        proFetch({
+            url: '/nccloud/hrcm/templet/EditAndDelBefore.do',
+            body: postData,
+        })
+            .then((res) => {
+                if (res.success) {
+                    resolve(res)
+                }
+            });
+        })
+    );
+}

+ 28 - 0
src/hrcm/basicsetting/templet_base/main/components/TableInfo/functions/QueryGridAction.js

@@ -0,0 +1,28 @@
+import proFetch from "../../../../../../public/functions/project-fetch";
+
+/**
+ * 列表查询
+ * @param pk_org
+ * @param pk_group
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function QueryGridAction(pk_org,pk_group) {
+    const postData = {
+        pk_org,
+        pk_group
+    };
+
+    return new Promise( ((resolve, reject) => {
+        proFetch({
+            url: '/nccloud/hrcm/templet/QueryGridAction.do',
+            body: postData,
+        })
+            .then((res) => {
+                if (res.success) {
+                    resolve(res)
+                }
+            });
+        })
+    );
+}

+ 168 - 0
src/hrcm/basicsetting/templet_base/main/components/TableInfo/index.js

@@ -0,0 +1,168 @@
+import React, {Component} from 'react';
+import './index.less';
+import {
+    getBusinessInfo,
+    promptBox,
+    toast,
+    cacheTools,
+    cardCache
+} from 'nc-lightapp-front';
+import QueryGridAction from "./functions/QueryGridAction";
+
+const tableId = 'template';
+let {setDefData} = cardCache;
+
+class TableInfo extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            json: this.props.json,
+            tableHeight: ''
+        };
+    }
+
+    componentWillReceiveProps(nextProps) {
+        let thisjson = JSON.stringify(this.props.json);
+        let nextjson = JSON.stringify(nextProps.json);
+        if (thisjson !== nextjson) {
+            this.setState({
+                json: nextProps.json
+            })
+        }
+    }
+
+    componentDidMount() {
+        this.onWindowResize();
+    }
+
+    /**
+     * 检测屏幕高度变化,修改table高度
+     */
+    onWindowResize = () => {
+        let tableHeight = (window.innerHeight - 96) + 'px';
+        this.updateState({
+            tableHeight
+        })
+    };
+
+    updateState(data, callback = () => {
+    }) {
+        this.setState(data, callback)
+    }
+
+    onRowClick = (props, tableid, record, index) => {
+        // 保存 record 新增用
+        setDefData('hrcm', 'basicsetting.templete', record);
+        let pk_conmodel = record.values.pk_conmodel.value;
+        this.props.updateState({
+            pk_conmodel,
+            selectedRow: { 
+                ...record,
+                index: index
+            }
+        }, () => {
+            // 修改按钮状态
+            this.props.updateButtonStatus();
+        });
+    };
+
+    /**
+     * 获取列表
+     */
+    getTableInfo(callback) {
+        // 清空 record
+        setDefData('hrcm', 'basicsetting.templete', null);
+        this.props.updateState({
+            pk_conmodel: null
+        });
+        QueryGridAction(this.props.pkOrg.value, this.props.pk_group).then(res => {
+            // 清空表格
+            this.emptyTable();
+
+            // 如果存在callback 则调用callback (刷新用)
+            if (callback && typeof callback === 'function') {
+                callback(res);
+            }
+
+            if (res.data && res.data.grid.template) {
+                let template = res.data.grid.template;
+                this.setDisableTable(template.rows, res.data.isedit);
+                this.props.editTable.setTableData(tableId, template);
+                this.setButtonDisabled(template.rows.length < 1);
+                if(template.rows.length > 0) {
+                    this.props.editTable.focusRowByIndex(tableId, 0);
+                    this.onRowClick(this.props, tableId, template.rows[0], 0)
+                } 
+            } else {
+                this.setButtonDisabled(true);
+            }
+        })
+    }
+
+    setButtonDisabled(disabled) {
+        // 设置按钮
+        this.props.button.setButtonDisabled({
+            modify: disabled,
+            print: disabled,
+            output: disabled
+        });
+    }
+
+    /**
+     * 设置不可被编辑的table数据
+     */
+    setDisableTable(rows, disableKey) {
+        rows.forEach((item) => {
+            if (item.values) {
+                let pk_conmodel = item.values.pk_conmodel.value;
+                if (disableKey.hasOwnProperty(pk_conmodel) && disableKey[pk_conmodel] === 'N') {
+                    for (let key in item.values) {
+                        item.values[key].disabled = true;
+                    }
+                }
+            }
+        });
+    }
+
+    /**
+     * 清空表格
+     */
+    emptyTable() {
+        this.props.editTable.setTableData(tableId, {rows: []})
+    }
+
+    /**
+     * 设置表格 为浏览态
+     */
+    setTableBrowse(pageScope, moduleId, record) {
+        this.props.editTable.setStatus(tableId, 'browse');
+    }
+
+    render() {
+        let {editTable} = this.props;
+        let {createEditTable} = editTable;
+        return (
+            <div className="table-info">
+                <div className="flex-container" style={{height: this.state.tableHeight}}>
+                {
+                    createEditTable(tableId, {
+                        showPagination: false, //是否展示分页
+                        // height: this.state.tableHeight,
+                        showCheck: false,
+                        showIndex: true,
+                        adaptionHeight:true,
+                        className: 'templetBaseTable',
+                        onRowClick: this.onRowClick.bind(this),
+                        onCloseModel: () => {
+                            this.props.editTable.cancelEdit(tableId);
+                        },
+                        tableModelConfirm: this.setTableBrowse.bind(this)
+                    })
+                }
+                </div>
+            </div>
+        );
+    }
+}
+
+export default TableInfo;

+ 8 - 0
src/hrcm/basicsetting/templet_base/main/components/TableInfo/index.less

@@ -0,0 +1,8 @@
+.table-info {
+  width: 100%;
+  height: 100%;
+  display: inline-block;
+  .table-box{
+    height: calc(~'100% - 48px');
+  }
+}

+ 167 - 0
src/hrcm/basicsetting/templet_base/main/components/wpsinitModal/index.js

@@ -0,0 +1,167 @@
+import React, {Component} from 'react';
+import './index.less';
+import wpsPreStatus from '../../components/Header/functions/wpsPreStatus';
+import {base, promptBox} from 'nc-lightapp-front';
+import {CopyToClipboard} from 'react-copy-to-clipboard';
+const {
+    NCModal,
+    NCButton,
+    NCIcon,
+    NCCheckbox
+} = base;
+
+const {
+    Header: ModalHeader,
+    Body: ModalBody,
+    Footer: ModalFooter
+} = NCModal;
+
+
+
+class WpsInitModal extends Component {
+    constructor(props) {
+        super(props);
+        this.closeModal = this.closeModal.bind(this);
+        this.initModal = this.initModal.bind(this);
+        this.onChangeHandle = this.onChangeHandle.bind(this);
+        this.rtClose = this.rtClose.bind(this);
+        this.baseUrl = window.location.origin;
+    }
+
+    closeModal() {
+        const {
+            onClose,
+            json
+        } = this.props;
+
+        promptBox({
+            color: 'warning',
+            title: json['cm6011-000000'], // 确认取消
+            content: json['cm6011-000001'], // 是否确认要取消
+            beSureBtnClick: () => {
+                onClose && onClose();
+            }
+        });   
+    }
+
+    rtClose() {
+        const {
+            onClose,
+        } = this.props;
+        onClose && onClose();
+    }
+    initModal() {
+        this.forceUpdate();
+    }
+    onChangeHandle(value) {
+        console.log('点击控制配置前须知',value)
+        this.props.updateState({
+            isNeedWpsInterview: value
+        })   
+        wpsPreStatus({readstatus:value,url:this.props.originUrl})
+            .then((res) => {
+                if(res.success){
+                    console.log('以改变后台')
+                }
+               
+            });
+        
+    }
+    shouldComponentUpdate(nextProps, nextState) {
+        if(!this.props.visible && !nextProps.visible) {
+            return false
+        }
+
+        return true;
+    }
+
+    render() {
+        let {
+            visible,
+            json,
+            isNeedWpsInterview
+        } = this.props;
+    
+        return (
+            <NCModal
+                show={visible}
+                onHide={this.rtClose}
+                onEntered={this.initModal}
+                className="design-report-modal"
+                // size="lg"
+            >
+                <ModalHeader
+                    closeButton={true}
+                >
+                    {json['cm6011-000169'] || "wps设计前须知"} {/* wps设计前须知 */}
+                </ModalHeader>
+                <ModalBody>
+                    <div className="wps-body">
+                        <pre><p className="explainWords">
+{
+`\n\
+${json['cm6011-000170']}\n\
+    ${json['cm6011-000171']}\n\
+    ${json['cm6011-000172']}\n\
+    ${json['cm6011-000173']}\n\
+    ${json['cm6011-000178']}\n\
+    \n\
+${json['cm6011-000174']}\n\
+    [Support]\n\
+    JsApiPlugin=true\n\
+    JsApiShowWebDebugger=false\n\
+    \n\
+    [Server]\n\
+    JSPluginsServer=${this.baseUrl}/nccloud/resources/hrhi/public/wpsconfig/jsplugins.xml\n\
+    \n\
+    `
+}
+                       </p></pre>
+                        
+                    </div>
+                    <NCCheckbox
+                            className="wps-checkbox"
+                            color="primary"
+                            onChange={this.onChangeHandle}
+                            checked={isNeedWpsInterview}
+                        >
+                            {json['cm6011-000175'] || '不再弹出设计前配置说明'}{/* 国际化处理: 不再弹出设计前配置说明*/}
+                    </NCCheckbox>
+                </ModalBody>
+                <ModalFooter>
+                    <CopyToClipboard text={
+                    `
+[Support]
+JsApiPlugin=true
+JsApiShowWebDebugger=false
+        
+[Server]
+JSPluginsServer=${this.baseUrl}/nccloud/resources/hrhi/public/wpsconfig/jsplugins.xml
+                    `
+                    }
+                        onCopy={() => this.props.copySure()}>
+                        <NCButton
+                            colors='primary'
+                        >
+                            {json['cm6011-000176'] || "复制全部配置"} {/*复制全部配置*/}
+                        </NCButton>
+                    </CopyToClipboard>
+                    
+                    <NCButton
+                        colors='primary'
+                        onClick={this.props.confirm}
+                    >
+                        {json['cm6011-000177'] || "我已完成上述操作"} {/*我已完成上述操作*/}
+                    </NCButton>
+                    <NCButton
+                        onClick={this.closeModal}
+                    >
+                        {json['cm6011-000054']}{/*取消*/}
+                    </NCButton>
+                </ModalFooter>
+            </NCModal>
+        );
+    }
+}
+
+export default WpsInitModal;

+ 4 - 0
src/hrcm/basicsetting/templet_base/main/components/wpsinitModal/index.less

@@ -0,0 +1,4 @@
+.wps-body{
+    line-height: 21px;
+    color: #111;
+}

+ 23 - 0
src/hrcm/basicsetting/templet_base/main/container/functions/updateButtonStatus.js

@@ -0,0 +1,23 @@
+// 初始化按钮状态
+
+export default function updateButtonStatus() {
+    const {pk_conmodel,editting} = this.state;
+
+    this.props.button.setButtonDisabled({
+        add: false,
+        edit: !pk_conmodel,
+        delete: false,
+        copy: false,
+        refresh: false,
+        templateSetting: false,
+        file: false,
+        export: false,
+        print: false
+    });
+    this.props.button.setButtonVisible({
+        copy: !editting,
+        templateSetting: !editting,
+        more: !editting,
+        add_body: editting
+    });
+}

+ 348 - 0
src/hrcm/basicsetting/templet_base/main/container/index.js

@@ -0,0 +1,348 @@
+import React, {Component} from 'react';
+import './index.less';
+import {base, high, toast, cardCache} from 'nc-lightapp-front';
+import Header from "../components/Header";
+import updateButtonStatus from "./functions/updateButtonStatus";
+import TableInfo from "../components/TableInfo";
+import {getLangCode} from "../../../../public/functions/unit";
+import {THEME} from "../../../../public/theme/theme";
+import NCUploader from 'uap/common/components/NCUploader';
+import SettingModal from '../components/SettingModal';
+// import WpsinitModal from '../components/wpsinitModal';
+import wpsPreStatus from '../components/Header/functions/wpsPreStatus';
+import WpsInitDesign from '../components/Header/functions/wpsDesignInitData';
+import deepCopy from 'src/hrpub/common/utils/deep-copy';
+import {openRevision} from "../components/Header/functions/wpsinvode";
+let {getDefData, setDefData} = cardCache;
+class BasicArchiveBase extends Component {
+    constructor(props) {
+        super(props);
+        props.use.editTable('template', 'conditionList')
+        props.use.form('conditionCard', 'folder')
+        this.config = {
+            pagecode: props.pagecode,
+            appcode: props.appcode
+        };
+        this.state = {
+            json: {},
+            pkOrg: {}, // 新增合同模板时  table 创建组织对象
+            showUploader: false, // 文件管理
+
+            pk_conmodel: null, // 合同主键
+
+            editting: false, //编辑态
+            selectedRow: null,
+            preSettingVisible: false,
+            isNeedWpsInterview: false, // 是否弹出wps配置须知
+            originUrl: '',
+            wpsvisible: false
+        };
+
+    }
+    initWpsConfig(url){
+        wpsPreStatus({
+            checkstatus:true,
+            url:url
+        }).then((res) => {
+                if(res.success){
+                    this.setState({
+                        originUrl: url,
+                        isNeedWpsInterview: res.data.readstatus
+                    });
+                }
+               
+            });
+    }
+    /**
+     * 页面初始化
+     */
+    pageInit() {
+        this.initUIDom();
+    }
+
+    initUIDom() {
+        this.props.createUIDom(this.config, (data) => {
+            let pkOrg = {};
+            if (this.props.nodeName === 'GLOBAL') {
+                pkOrg = {
+                    display: this.state.json['cm6011-000007'], // 全局
+                    value: 'GLOBLE00000000000000',
+                }
+            } else if (this.props.nodeName === 'GROUP') {
+                pkOrg = {
+                    display: this.props.groupName,
+                    value: this.props.groupId,
+                }
+            } else if (this.props.nodeName === 'ORG') {
+                pkOrg = {
+                    display: this.state.pkOrg.display || null,
+                    value: this.state.pkOrg.value || null,
+                }
+            }
+            this.setState({
+                queryOid: data.template.pageid,
+                buttons: data.button || [],
+                context: data.context || {},
+                pkOrg
+            });
+            this.tableAddOpr(data.template["template"]);
+            this.props.meta.setMeta(data && data.template ? data.template : {});
+            this.props.button.setButtons(data && data.button ? data.button : {});
+            const url = window.location.origin
+            this.initWpsConfig(url)
+            // 初始化按钮
+            this.updateButtonStatus();
+            // 加载table列表
+            this.getTableInfo();
+        });
+    }
+
+    /**
+     * 表格添加操作列
+     */
+    tableAddOpr(tabledata) {
+        let _this = this;
+        let lang = getLangCode();
+        let eventWidth = lang === 'english' ? 350 : 300;
+        let oprWidth = lang === 'english' ? 120 : 110; 
+        //添加表格操作列
+        let event = {
+            label: this.state.json["cm6011-000064"],
+            attrcode: 'opr',
+            itemtype: 'customer',
+            //className: "table-opr",
+            fixed: 'right',
+            width: eventWidth + 'px',
+            visible: true,
+            render(text, record, index) {
+                return (
+                    <div className="currency-opr-col">
+                        {_this.props.button.createOprationButton( 
+                            ['add_body', 'templateSetting', 'copy', 'delete', 'export'],
+                            {  
+                                area: 'body',
+                                onButtonClick: (props, id, e) => {
+                                    setDefData('hrcm', 'basicsetting.templete', record);
+                                    _this.headerNode.onBtnOperation(props, id, 'body', record, index)
+                                },
+                                popContainer: document.querySelector('.header2')
+                            }
+                        )}
+                    </div>
+                );
+            }
+        };
+
+        // 附件管理
+        let fileCol = {
+            attrcode: 'file',
+            itemtype: 'customer',
+            hyperlinkflag: false,
+            label: this.state.json['cm6011-000146'], /* 国际化处理: 附件管理*/
+            width: oprWidth + 'px',
+            textAlign: 'center',
+            visible: true,
+            fixed: 'right',
+            render(text, record, index) {
+                let billId = record.values.pk_conmodel.value;
+                return (
+                    <a style={{cursor: 'pointer'}}>
+                        <i className="icon iconfont icon-fujianshenpi" onClick={(eve) => {
+                            _this.setState({
+                                showUploader: true,
+                                pk_conmodel: billId
+                            })
+                        }}/>
+                    </a>
+                )
+            }
+        };
+        tabledata.items.push(fileCol);
+        tabledata.items.push(event);
+    }
+
+    componentWillMount() {
+        let callback = (json, status, inlt) => {
+            if (status) {
+                this.setState({json, inlt}) // 保存json和inlt到页面state中并刷新页面
+            }
+        };
+        this.props.MultiInit.getMultiLang({moduleId: 'cm6011', domainName: 'hrcm', callback})
+    }
+
+    componentDidMount() {
+        if (window.location.href.match(/(localhost|127\.0\.0\.1):3006/)) window.location.hash = `ifr?page=2019`;
+        if (!('remove' in Element.prototype)) {
+            Element.prototype.remove = function () {
+                if (this.parentNode) {
+                    this.parentNode.removeChild(this);
+                }
+            };
+        }
+        this.pageInit();
+    }
+
+    updateState = (data, callback = () => {
+    }) => {
+        this.setState(data, callback)
+    };
+
+    updateButtonStatus = () => {
+        updateButtonStatus.call(this);
+    };
+
+    // 附件的关闭点击
+    onHideUploader = () => {
+        this.setState({
+            showUploader: false,
+            groupLists: []
+        })
+    };
+
+    //获取当前附件列表
+    getGroupList = (list) => {
+        //要在state里面顶一个变量,用来存储列表数组
+        this.setState({
+            groupLists: list
+        })
+    };
+
+    beforeUpload(billId, fullPath, file, fileList) {
+        // 参数:单据id,当前选中分组path、当前上传文件对象,当前文件列表
+
+        // const isJPG = file.type === 'image/jpeg';
+        //
+        // const isLt2M = file.size / 1024 / 1024 < 2;
+        // if (!isLt2M) {
+        //     /* 国际化处理: 上传大小小于2M*/
+        // }
+        // return isJPG && isLt2M;
+        return true
+        // 备注: return false 不执行上传  return true 执行上传
+    }
+
+    /**
+     * 获取table数据
+     */
+    getTableInfo = (callback) => {
+        this.tableInfo.getTableInfo(callback);
+    };
+
+    refresh = (callback) => {
+        //获取 table数据
+        this.getTableInfo(callback);
+    };
+
+    onClose = () => {
+        this.setState({preSettingVisible: false})
+    }
+    closeWpsModal = () => {
+        this.setState({wpsvisible: false})
+    }
+    //当wps配置完成时打开wps
+    confirmOpenWps = () => {
+        const {selectedRow} = this.state;
+        let pk_conmodel = selectedRow.values.pk_conmodel.value;
+        let pk_org = this.state.pkOrg.value;
+        WpsInitDesign(pk_conmodel, pk_org).then(res => {
+            if (res.success && res.data) {
+                console.log("模板设置返回的数据",res.data)
+                let result = deepCopy(res.data)
+                result.pk_rpt_def =  pk_conmodel;
+                result.pk_conmodel = pk_conmodel;
+                openRevision(result)
+                // console.log("当前行数据",record.values)
+                this.closeWpsModal()
+            }
+        })
+    }
+    copySure = () => {
+        const {
+            json
+        } = this.state;
+        toast({
+            color: 'success',
+            content: '复制成功' // '复制成功'
+        });
+    }
+    render() {
+        const {
+            showUploader,
+            json,
+            editting,
+            pkOrg,
+            pk_conmodel,
+            preSettingVisible,
+            selectedRow,
+            isNeedWpsInterview,
+            originUrl,
+            wpsvisible
+        } = this.state;
+        const componentProps = {
+            ...this.props,
+            json,
+            editting,
+            pkOrg,
+            pk_conmodel,
+            isNeedWpsInterview,
+            originUrl,
+            updateState: this.updateState,
+            refresh: this.refresh,
+            updateButtonStatus: this.updateButtonStatus,
+        };
+        return (
+
+            <div className={`postseq-base ${THEME.bgCommon}`}>
+
+                {/* file */}
+                <div className="nc-faith-demo-div2">
+                    {/* 这里是附件上传组件的使用,需要传入三个参数 */}
+                    {showUploader && <NCUploader
+                        disableDownload={false}
+                        billId={this.state.pk_conmodel}
+                        // billNo={'true'} // 可选  此字段决定了左侧是否显示billNo
+                        // target={target}
+                        customize={{uploadTrpe: '0'}}
+                        placement={'bottom'}
+                        getGroupList={this.getGroupList}
+                        uploadTitle={this.state.json['cm6011-000062']}/* 国际化处理: 附件管理*/
+                        onHide={this.onHideUploader} // 关闭功能
+                        beforeUpload={this.beforeUpload}/>
+                    }
+                </div>
+
+                <Header
+                    {...componentProps}
+                    selectedRow={selectedRow}
+                    // closeWpsModal={this.closeWpsModal}
+                    ref={node => {
+                        this.headerNode = node;
+                    }}
+                />
+                <div className='postseq-content'>
+                    <TableInfo
+                        {...componentProps}
+                        ref={node => {
+                            this.tableInfo = node;
+                        }}
+                    />
+                </div>
+                {/* <WpsinitModal 
+                    {...componentProps}
+                    visible={wpsvisible}
+                    onClose={this.closeWpsModal}
+                    confirm={this.confirmOpenWps}
+                    copySure={this.copySure}
+                /> */}
+                <SettingModal
+                    {...componentProps}
+                    selectedRow={selectedRow}
+                    visible={preSettingVisible}
+                    onClose={this.onClose}
+                />
+            </div>
+        );
+    }
+}
+
+export default BasicArchiveBase;

+ 31 - 0
src/hrcm/basicsetting/templet_base/main/container/index.less

@@ -0,0 +1,31 @@
+.postseq-base {
+    background: #fff;
+
+    .postseq-content {
+        height: calc(~'100% - 54px');
+        position: relative;
+        padding-bottom: 20px;
+        background: #fff;
+    }
+
+    .currency-opr-col {
+        .row-edit-option {
+            border: none !important;
+            background: transparent !important;
+            min-width: 0 !important;
+            box-shadow: none !important;
+            color: #007ace;
+            min-height: 16px;
+            height: auto;
+            margin-left: 0;
+            padding-left: 0;
+
+            .arrow {
+                color: #007ace;
+            }
+        }
+    }
+    .icon-fujianshenpi{
+        color: #007ace;
+    }
+}

+ 41 - 0
src/hrcm/basicsetting/templet_glb/main/index.js

@@ -0,0 +1,41 @@
+/**
+ * 合同模板——全局
+ */
+import React, {Component} from 'react';
+import ReactDOM from 'react-dom';
+import {createPage, getBusinessInfo,appUrlUtils} from 'nc-lightapp-front';
+
+import HomePage from '../../templet_base/main/container';
+import {getAppPageConfig} from 'src/hrpub/common/utils/utils';
+const {setAppUrl} = appUrlUtils;
+let appConfig = getAppPageConfig();
+if (new RegExp(/(localhost|127\.0\.0\.1):3006/g).test(window.location.href)) {
+    appConfig = {
+        pagecode: '60110131p',
+        appcode: '60110131'
+    }
+    setAppUrl('2019', 'c=60110131&p=60110131p');
+}
+let businessInfo = getBusinessInfo() || {groupId: '0001AB10000000000N6U'};
+const props = {
+    isGlb: true,
+    pk_org:'GLOBLE00000000000000',
+    nodeName: "GLOBAL",
+    ...appConfig,
+    ...businessInfo
+};
+
+const PeriodModal = createPage({
+    billinfo:[
+        {
+            billtype: 'grid',
+            pagecode: props.pagecode,
+            bodycode: 'template'
+        }
+    ]
+})(HomePage);
+
+ReactDOM.render(<PeriodModal
+        {...props}
+    />,
+    document.querySelector('#app'));

+ 38 - 0
src/hrcm/basicsetting/templet_grp/main/index.js

@@ -0,0 +1,38 @@
+/**
+ * 合同模板——集团
+ */
+import React, {Component} from 'react';
+import ReactDOM from 'react-dom';
+import {createPage, getBusinessInfo} from 'nc-lightapp-front';
+
+import HomePage from '../../templet_base/main/container';
+import {getAppPageConfig} from 'src/hrpub/common/utils/utils';
+
+let appConfig = getAppPageConfig();
+if (new RegExp(/(localhost|127\.0\.0\.1):3006/g).test(window.location.href)) {
+    appConfig = {
+        pagecode: '60110132p',
+        appcode: '60110132'
+    }
+}
+let businessInfo = getBusinessInfo() || {groupId: '0001AB10000000000N6U'};
+const props = {
+    isGlb: true,
+    pk_org:'GLOBLE00000000000000',
+    nodeName: "GROUP",
+    ...appConfig,
+    ...businessInfo
+};
+const PeriodModal = createPage({
+    billinfo:[
+        {
+            billtype: 'grid',
+            pagecode: props.pagecode,
+            bodycode: 'template'
+        }
+    ]
+})(HomePage);
+ReactDOM.render(<PeriodModal
+        {...props}
+    />,
+    document.querySelector('#app'));

+ 55 - 0
src/hrcm/contractmgt/account/main/components/AgreeSearchModal/index.js

@@ -0,0 +1,55 @@
+import React, {Component} from 'react';
+import './index.less';
+import {base} from 'nc-lightapp-front';
+import SearchTop from "../SearchTop";
+import {getQueryCondition} from "src/hrpub/common/utils/utils";
+
+class SearchModal extends Component {
+    constructor(props) {
+        super(props);
+        this.goSearch = this.goSearch.bind(this);
+    }
+
+    goSearch() {
+        const {updateState, getAgreeTableData, queryOid, search, pageInfo} = this.props;
+        const data = getQueryCondition(this.props, 'agreementquery');
+        const topData = this.searchTopNode.getData();
+        updateState({
+            agreementPageInfo: {
+                ...pageInfo,
+                pageIndex: 1
+            },
+            agreeSearchModalValue: {...data, ...topData, oid: queryOid}
+        }, () => {
+            getAgreeTableData(true);
+            search.openAdvSearch('agreementquery', false)
+        });
+    }
+
+    render() {
+        return (
+            <div style={{display: 'none'}}>
+                {this.props.search.NCCreateSearch('agreementquery', {
+                    clickSearchBtn: this.goSearch,
+                    onlyShowAdvArea: false,
+                    showAdvSearchPlanBtn: true,
+                    saveSearchPlan: true,
+                    oid: this.props.queryOid,
+                    onlyShowSuperBtn: true,
+                    advSearchClearEve: () => {
+                        this.searchTopNode.clearData()
+                    },
+                    addAdvBody: () => {
+                        return <SearchTop
+                            ref={node => this.searchTopNode = node}
+                            isAgree={true}
+                            json={this.props.json}
+                        />
+                    }
+                })}
+            </div>
+        );
+    }
+}
+
+export default SearchModal;

+ 17 - 0
src/hrcm/contractmgt/account/main/components/AgreeSearchModal/index.less

@@ -0,0 +1,17 @@
+.search-modal-wrapper {
+
+    .condition-contant {
+        margin-bottom: 10px;
+    }
+
+    .search-page-footer {
+        text-align: right;
+    }
+
+    .wui-modal-header {
+        padding-bottom: 0;
+    }
+    .wui-modal-body {
+        padding-top: 0;
+    }
+}

+ 303 - 0
src/hrcm/contractmgt/account/main/components/AgreementDetail/handleAfter.js

@@ -0,0 +1,303 @@
+import moment from 'moment';
+
+export default function handleAfter(moduleId, key, value) {
+    switch (key) {
+        case 'termtype':
+            termTypeChange.call(this, moduleId, value);
+            break;
+        case 'termmonth':
+            termMonthChange.call(this);
+            break;
+        case 'agreement_unit':
+            countUnitChange.call(this);
+            break;
+        case 'begindate':
+            beginDateChange.call(this);
+            break;
+        case 'enddate':
+            endDateChange.call(this);
+            break;
+        case 'ifprop':
+            ifproChange.call(this, moduleId, value);
+            break;
+        case 'probmonth':
+            termMonthChange.call(this, true);
+            break;
+        case 'prop_unit':
+            countUnitChange.call(this, true);
+            break;
+        case 'probegindate':
+            beginDateChange.call(this, true);
+            break;
+        case 'probenddate':
+            endDateChange.call(this);
+            break;
+        default:
+            break;
+    }
+}
+
+function ifproChange(moduleId, value) {
+    let template = this.props.meta.getMeta(), area = moduleId;
+    if (template.formrelation && template.formrelation[moduleId]) {
+        area = template.formrelation[moduleId][template.formrelation[moduleId].length - 1];
+    }
+    const probmonth = template[area].items.find(item => item.attrcode === 'probmonth');
+    const prop_unit = template[area].items.find(item => item.attrcode === 'prop_unit');
+    const probegindate = template[area].items.find(item => item.attrcode === 'probegindate');
+    const probenddate = template[area].items.find(item => item.attrcode === 'probenddate');
+    if (value.value === false || value.value === 'N') {
+        probmonth.required = false;
+        prop_unit.required = false;
+        probegindate.required = false;
+        probenddate.required = false;
+        this.props.meta.setMeta(template);
+        this.props.form.setFormItemsValue(moduleId, {
+            'probmonth': {
+                value: '',
+                display: null
+            },
+            'prop_unit': {
+                value: '',
+                display: null
+            },
+            'probegindate': {
+                value: '',
+                display: null
+            },
+            'probenddate': {
+                value: '',
+                display: null
+            }
+        });
+        this.props.form.setFormItemsDisabled(moduleId, {
+            'probmonth': true,
+            'prop_unit': true,
+            'probegindate': true,
+            'probenddate': true
+        });
+    } else {
+        const record = this.props.form.getAllFormValue(this.props.areaCode).rows[0].values;
+        probmonth.required = true;
+        prop_unit.required = true;
+        probegindate.required = true;
+        probenddate.required = true;
+        this.props.meta.setMeta(template);
+        this.props.form.setFormItemsValue(moduleId, {
+            'probmonth': {
+                value: '',
+                display: null
+            },
+            'prop_unit': prop_unit.options.find(option => option.value === '2'),
+            'probegindate': {
+                value: record['begindate'].value,
+                display: null
+            },
+            'probenddate': {
+                value: '',
+                display: null
+            }
+        });
+        this.props.form.setFormItemsDisabled(moduleId, {
+            'probmonth': false,
+            'prop_unit': false,
+            'probegindate': false,
+            'probenddate': false
+        });
+    }
+}
+
+function termTypeChange(moduleId, value) {
+    if (value.value === 'CM02') {
+        let template = this.props.meta.getMeta(), area = moduleId;
+        if (template.formrelation && template.formrelation[moduleId]) {
+            area = template.formrelation[moduleId][template.formrelation[moduleId].length - 1];
+        }
+        const termmonth = template[area].items.find(item => item.attrcode === 'termmonth');
+        const enddate = template[area].items.find(item => item.attrcode === 'enddate');
+        termmonth.required = false;
+        enddate.required = false;
+        this.props.meta.setMeta(template);
+        this.props.form.setFormItemsValue(moduleId, {
+            'termmonth': {
+                value: '',
+                display: null
+            },
+            'enddate': {
+                value: '',
+                display: null
+            }
+        });
+        this.props.form.setFormItemsDisabled(moduleId, {
+            'termmonth': true,
+            'enddate': true
+        });
+    } else {
+        let template = this.props.meta.getMeta(), area = moduleId;
+        if (template.formrelation && template.formrelation[moduleId]) {
+            area = template.formrelation[moduleId][template.formrelation[moduleId].length - 1];
+        }
+        const termmonth = template[area].items.find(item => item.attrcode === 'termmonth');
+        const enddate = template[area].items.find(item => item.attrcode === 'enddate');
+        termmonth.required = true;
+        enddate.required = true;
+        this.props.meta.setMeta(template);
+        this.props.form.setFormItemsDisabled(moduleId, {
+            'termmonth': false,
+            'enddate': false
+        });
+    }
+}
+
+function termMonthChange(isPro) {
+    const {form, areaCode} = this.props;
+    const record = form.getAllFormValue(areaCode).rows[0].values;
+    if (record[isPro ? 'probmonth' : 'termmonth'].value == null ||
+        (!record[isPro ? 'probegindate' : 'begindate'].value && !record[isPro ? 'probenddate' : 'enddate'].value))
+        return;
+    if (record[isPro ? 'probegindate' : 'begindate'].value) {
+        const endDate = getEndDate(
+            record[isPro ? 'probmonth' : 'termmonth'].value,
+            record[isPro ? 'probegindate' : 'begindate'].value,
+            record[isPro ? 'prop_unit' : 'agreement_unit'].value
+        );
+        form.setFormItemsValue(areaCode, {
+            [isPro ? 'probenddate' : 'enddate']: {
+                value: endDate,
+                display: null
+            }
+        })
+    } else {
+        const beginDate = getBeginDate(
+            record[isPro ? 'probmonth' : 'termmonth'].value,
+            record[isPro ? 'probenddate' : 'enddate'].value,
+            record[isPro ? 'prop_unit' : 'agreement_unit'].value
+        );
+        form.setFormItemsValue(areaCode, {
+            [isPro ? 'probegindate' : 'begindate']: {
+                value: beginDate,
+                display: null
+            }
+        })
+    }
+}
+
+function countUnitChange(isPro) {
+    const {form, areaCode} = this.props;
+    const record = form.getAllFormValue(areaCode).rows[0].values;
+    if (record[isPro ? 'probmonth' : 'termmonth'].value == null ||
+        (!record[isPro ? 'probegindate' : 'begindate'].value && !record[isPro ? 'probenddate' : 'enddate'].value))
+        return;
+    if (record[isPro ? 'probegindate' : 'begindate'].value) {
+        const endDate = getEndDate(
+            record[isPro ? 'probmonth' : 'termmonth'].value,
+            record[isPro ? 'probegindate' : 'begindate'].value,
+            record[isPro ? 'prop_unit' : 'agreement_unit'].value
+        );
+        form.setFormItemsValue(areaCode, {
+            [isPro ? 'probenddate' : 'enddate']: {
+                value: endDate,
+                display: null
+            }
+        })
+    } else {
+        const beginDate = getBeginDate(
+            record[isPro ? 'probmonth' : 'termmonth'].value,
+            record[isPro ? 'probenddate' : 'enddate'].value,
+            record[isPro ? 'prop_unit' : 'agreement_unit'].value
+        );
+        form.setFormItemsValue(areaCode, {
+            [isPro ? 'probegindate' : 'begindate']: {
+                value: beginDate,
+                display: null
+            }
+        })
+    }
+}
+
+function beginDateChange(isPro) {
+    const {form, areaCode} = this.props;
+    const record = form.getAllFormValue(areaCode).rows[0].values;
+    if (record[isPro ? 'probmonth' : 'termmonth'].value == null) return;
+    if (record[isPro ? 'probegindate' : 'begindate'].value) {
+        const endDate = getEndDate(
+            record[isPro ? 'probmonth' : 'termmonth'].value,
+            record[isPro ? 'probegindate' : 'begindate'].value,
+            record[isPro ? 'prop_unit' : 'agreement_unit'].value
+        );
+        form.setFormItemsValue(areaCode, {
+            [isPro ? 'probenddate' : 'enddate']: {
+                value: endDate,
+                display: null
+            }
+        })
+    }
+}
+
+
+
+function endDateChange(isPro) {
+    const {form, areaCode} = this.props;
+    const record = form.getAllFormValue(areaCode).rows[0].values;
+    if (record[isPro ? 'probegindate' : 'begindate'].value == null) return;
+    if (record[isPro ? 'probenddate' : 'enddate'].value) {
+        const termmonth = getGapDate(
+            record[isPro ? 'probegindate' : 'begindate'].value,
+            record[isPro ? 'probenddate' : 'enddate'].value,
+            record[isPro ? 'prop_unit' : 'agreement_unit'].value
+        );
+        form.setFormItemsValue(areaCode, {
+            [isPro ? 'probmonth' : 'termmonth']: {
+                value: termmonth,
+                display: null
+            }
+        })
+    }
+}
+
+function getEndDate(itermmonth = 0, startdate, unit) {
+    //"1":"年" "2":"月" "3": "天"
+    if (itermmonth === 0) return startdate;
+    let nextDate = '';
+    if (unit === '1') {
+        nextDate = moment(startdate).add(Number(itermmonth), 'y').subtract(Number(1), 'd');
+    }
+    if (unit === '2') {
+        nextDate = moment(startdate).add(Number(itermmonth), 'M').subtract(Number(1), 'd');
+    }
+    if (unit === '3') {
+        nextDate = moment(startdate).add(Number(itermmonth), 'd');
+    }
+    return nextDate.format('YYYY-MM-DD');
+}
+
+function getBeginDate(itermmonth = 0, enddate, unit) {
+    //"1":"年" "2":"月" "3": "天"
+    if (itermmonth === 0) return enddate;
+    let nextDate = '';
+    if (unit === '1') {
+        nextDate = moment(enddate).subtract(Number(itermmonth), 'y').add(Number(1), 'd');
+    }
+    if (unit === '2') {
+        nextDate = moment(enddate).subtract(Number(itermmonth), 'M').add(Number(1), 'd');
+    }
+    if (unit === '3') {
+        nextDate = moment(enddate).subtract(Number(itermmonth), 'd');
+    }
+    return nextDate.format('YYYY-MM-DD');
+}
+
+function getGapDate(begindate, enddate, unit) {
+    //"1":"年" "2":"月" "3": "天"
+    let beginDate = new Date(begindate).getTime(), endDate = new Date(enddate).getTime(), gap = 0;
+    if (unit === '1') {
+        gap = (endDate - beginDate) / (1000 * 60 * 60 * 24 * 365);
+    }
+    if (unit === '2') {
+        gap = (endDate - beginDate) / (1000 * 60 * 60 * 24 * 30);
+    }
+    if (unit === '3') {
+        gap = (endDate - beginDate) / (1000 * 60 * 60 * 24);
+    }
+    return Math.round(gap);
+}

+ 102 - 0
src/hrcm/contractmgt/account/main/components/AgreementDetail/index.js

@@ -0,0 +1,102 @@
+import React, {Component} from 'react';
+import './index.less';
+import {base} from 'nc-lightapp-front';
+import NCBackBtn from "src/hrpub/common/components/hr-back";
+import {chectFormAction} from "../../../../../public/functions/checkFormAction";
+
+const {NCAffix} = base;
+
+class AgreementDetail extends Component {
+    constructor(props) {
+        super(props);
+        this.pageQueryClick = this.pageQueryClick.bind(this);
+        this.goBack = this.goBack.bind(this);
+        this.onAfterAddFormEvent = this.onAfterAddFormEvent.bind(this);
+        this.beforeEventHandle = this.beforeEventHandle.bind(this);
+    }
+
+    componentDidMount() {
+        if (this.props.data) {
+            /*this.props.cardPagination.getNextCardPaginationId({
+                id: this.props.data.rows[0].values.pk_psndoc_sub.value,
+                status: 1
+            });*/
+            this.props.cardPagination.setCardPaginationId({
+                id: this.props.data.rows[0].values.pk_agreement.value,
+                status: 1
+            });
+        }
+    }
+
+    pageQueryClick(props, key) {
+        const record = props.table.getAllTableData('agreementList').rows.find(row => row.values.pk_agreement.value === key);
+        this.props.view('', record.values)
+    }
+
+    goBack() {
+        const {pageInfo, updateState, updateButton, getAgreeTableData, isQueryTemplate} = this.props;
+        updateState({
+            agreementPageInfo: {...pageInfo, pageIndex: 1},
+            agreementPage: 'main'
+        }, () => {
+            updateButton();
+            getAgreeTableData(isQueryTemplate);
+        })
+    }
+
+    beforeEventHandle(props, moduleId, key, item, index, value, record) {
+        // 过滤协议模板信息
+        let {areaCode, orgVal} = this.props;
+        if (key === 'pk_conttext') {
+            let meta = props.meta.getMeta();
+            let editArea = areaCode;
+            const formrelation = meta.formrelation && meta.formrelation[areaCode];
+            if (formrelation) {
+                editArea = formrelation[formrelation.length - 1];
+            }
+            const agreementtype = props.form.getAllFormValue(areaCode).rows[0].values.agreementtype.value;
+            meta[editArea].items.find(item => item.attrcode === key).queryCondition = function () {
+                return {
+                    "pk_org": orgVal.refpk,
+                    "GridRefActionExt": "nccloud.web.hrcm.make.sqlbuilder.ContModelGridSqlBuilder",
+                    "agreementType": agreementtype
+                }
+            };
+            props.meta.setMeta(meta);
+        }
+        return true;
+    }
+
+    onAfterAddFormEvent(props, moduleId, key, value) {
+        //handleAfter.call(this, moduleId, key, value);
+        const {areaCode, appCode} = this.props;
+        let editArea = areaCode;
+        const meta = this.props.meta.getMeta();
+        const formrelation = meta.formrelation && meta.formrelation[areaCode];
+        if (formrelation) {
+            editArea = formrelation[formrelation.length - 1];
+        }
+        chectFormAction(key, areaCode, props, [editArea], appCode)
+    }
+
+    render() {
+        const {form, cardPagination, page, areaCode} = this.props;
+        const {createCardPagination} = cardPagination;
+        return (
+            <div>
+                {/*<NCAffix>*/}
+                <div className="header" style={{display: page === 'view' ? '' : 'none'}}>
+                    <NCBackBtn onClick={this.goBack}/>
+                    {createCardPagination({handlePageInfoChange: this.pageQueryClick})}
+                </div>
+                {/* </NCAffix>*/}
+                {areaCode ? form.createForm(areaCode, {
+                    onBeforeEvent: this.beforeEventHandle,
+                    onAfterEvent: this.onAfterAddFormEvent
+                }) : null}
+            </div>
+        );
+    }
+}
+
+export default AgreementDetail;

+ 0 - 0
src/hrcm/contractmgt/account/main/components/AgreementDetail/index.less


+ 107 - 0
src/hrcm/contractmgt/account/main/components/AgreementTable/index.js

@@ -0,0 +1,107 @@
+import React, {Component} from 'react';
+import './index.less';
+import {base} from 'nc-lightapp-front';
+import Pagination from "src/hrpub/common/components/Pagination";
+import {debounce} from "src/hrpub/common/utils/utils";
+
+class AgreementTable extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            tableHeight: ''
+        };
+        this.changePage = this.changePage.bind(this);
+        this.pageSizeChange = this.pageSizeChange.bind(this);
+        this.rowDoubleClickHandle = this.rowDoubleClickHandle.bind(this);
+        this.setTableHeight = this.setTableHeight.bind(this);
+    }
+
+    componentDidMount() {
+        this.setTableHeight();
+        window.addEventListener("resize", debounce(this.setTableHeight));
+    }
+
+    changePage(pageIndex) {
+        const {
+            updateState,
+            getAgreeTableData,
+            pageInfo,
+            isQueryTemplate
+        } = this.props;
+
+        updateState({
+            agreementPageInfo: {
+                ...pageInfo,
+                pageIndex: pageIndex
+            }
+        }, () => {
+            getAgreeTableData(isQueryTemplate);
+        });
+    }
+
+    rowDoubleClickHandle(record, index, props, e) {
+        this.props.view('', record, index);
+    }
+
+    pageSizeChange(pageSize) {
+        const {
+            updateState,
+            getAgreeTableData,
+            pageInfo,
+            isQueryTemplate
+        } = this.props;
+
+        updateState({
+            agreementPageInfo: {
+                ...pageInfo,
+                pageSize,
+                pageIndex: 1
+            }
+        }, () => {
+            getAgreeTableData(isQueryTemplate);
+        });
+    }
+
+    setTableHeight() {
+        const content = document.getElementsByClassName('entry-staff-query-content');
+        if (content[0]) {
+            this.setState({
+                tableHeight: content[0].clientHeight - 88
+            })
+        }
+    }
+
+    render() {
+        const {table, pageInfo} = this.props;
+
+        return (
+            <div className='agree-table flex-container'>
+                <div className='flex-container' style={{height:  this.state.tableHeight}}>
+                    {this.state.tableHeight && table.createSimpleTable('agreementList', {
+                        cancelCustomRightMenu: true,
+                        adaptionHeight:true,
+                        showCheck: true,
+                        showIndex: true,
+                        height: this.state.tableHeight,
+                        onRowDoubleClick: this.rowDoubleClickHandle
+                    })}
+                </div>
+               
+                {
+                    pageInfo.total > 0 &&
+                    <Pagination
+                        current={parseInt(pageInfo.pageIndex)}
+                        pageSize={parseInt(pageInfo.pageSize)}
+                        pageSizeOptions={[5, 10, 20, 50, 100]}
+                        showSizeChanger={true}
+                        total={pageInfo.total}
+                        onShowSizeChange={this.pageSizeChange}
+                        onChange={this.changePage}
+                    />
+                }
+            </div>
+        );
+    }
+}
+
+export default AgreementTable;

+ 12 - 0
src/hrcm/contractmgt/account/main/components/AgreementTable/index.less

@@ -0,0 +1,12 @@
+.main-table {
+    position: relative;
+    height: 100%;
+    .pagination-wrapper {
+        height: 45px;
+    }
+}
+.agree-table {
+    .ncc-hr-pagination-wrapper{
+        margin-top: 10px;
+    }
+}

+ 117 - 0
src/hrcm/contractmgt/account/main/components/AlertModal/index.js

@@ -0,0 +1,117 @@
+import React, {Component} from 'react';
+import './index.less';
+import {base} from 'nc-lightapp-front';
+
+const {NCModal, NCButton} = base;
+const {Header: NCModalHeader, Body: NCModalBody, Footer: NCModalFooter} = NCModal;
+
+class AlertModal extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            visible: false,
+            message: 'confirm'
+        };
+        this.show = this.show.bind(this);
+        this.handleNext = this.handleNext.bind(this);
+        this.beSure = this.beSure.bind(this);
+        this.beDeny = this.beDeny.bind(this);
+    }
+
+    show(confirmMsg, warningMsg, callback, denyCallback) {
+        if ((!confirmMsg && !warningMsg) || (!confirmMsg.length && !warningMsg.length)) {
+            callback && callback();
+            return;
+        }
+        this.confirmMsg = confirmMsg;
+        this.warningMsg = warningMsg;
+        this.message = '';
+        this.callback = callback;
+        this.denyCallback = denyCallback;
+        this.setState(
+            {
+                type: 'confirm'
+            },
+            this.handleNext
+        );
+    }
+
+    handleNext() {
+        const {type} = this.state;
+        if (type === 'confirm') {
+            if (!this.confirmMsg || !this.confirmMsg[0]) {
+                if (!this.warningMsg || !this.warningMsg[0]) {
+                    this.setState({
+                        visible: false
+                    });
+                    this.callback && this.callback();
+                } else {
+                    this.message = this.warningMsg.splice(0, 1);
+                    this.setState({
+                        type: 'warning',
+                        visible: true
+                    });
+                }
+            } else {
+                this.message = this.confirmMsg.splice(0, 1);
+                this.setState({
+                    visible: true
+                });
+            }
+        } else {
+            if (!this.warningMsg || !this.warningMsg[0]) {
+                this.setState({
+                    visible: false
+                });
+                this.callback && this.callback();
+            } else {
+                this.message = this.warningMsg.splice(0, 1);
+                this.setState({
+                    visible: true
+                });
+            }
+        }
+    }
+
+    beSure() {
+        this.handleNext();
+    }
+
+    beDeny() {
+        this.setState({
+            visible: false
+        });
+        this.denyCallback && this.denyCallback();
+    }
+
+    render() {
+        const {visible, type} = this.state;
+        const {json} = this.props;
+        return (
+            <NCModal show={visible} size="sm" backdrop={'static'}>
+                <NCModalHeader>
+                    {type === 'confirm' ? json['cm6011-000056'] : json['cm6011-000066']}{/* 国际化处理: 确认,警告,确认*/}
+                </NCModalHeader>
+                <NCModalBody>
+                    <div
+                        dangerouslySetInnerHTML={{
+                            __html: this.message
+                        }}
+                    />
+                </NCModalBody>
+                <NCModalFooter>
+                    <NCButton colors="primary" onClick={this.beSure}>
+                        {type === 'confirm' ? json['cm6011-000057'] : json['cm6011-000056']}{/* 国际化处理: 是,确认,是,确认*/}
+                    </NCButton>
+                    {type === 'confirm' ? (
+                        <NCButton shape="border" onClick={this.beDeny}>
+                            {json['cm6011-000058']}{/* 国际化处理: 否*/}
+                        </NCButton>
+                    ) : null}
+                </NCModalFooter>
+            </NCModal>
+        );
+    }
+}
+
+export default AlertModal;

+ 0 - 0
src/hrcm/contractmgt/account/main/components/AlertModal/index.less


+ 299 - 0
src/hrcm/contractmgt/account/main/components/ContractDetail/handleAfter.js

@@ -0,0 +1,299 @@
+import moment from 'moment';
+
+export default function handleAfter(moduleId, key, value) {
+    switch (key) {
+        case 'termtype':
+            termTypeChange.call(this, moduleId, value);
+            break;
+        case 'termmonth':
+            termMonthChange.call(this);
+            break;
+        case 'cont_unit':
+            countUnitChange.call(this);
+            break;
+        case 'begindate':
+            beginDateChange.call(this);
+            break;
+        case 'enddate':
+            endDateChange.call(this);
+            break;
+        case 'ifprop':
+            ifproChange.call(this, moduleId, value);
+            break;
+        case 'promonth':
+            termMonthChange.call(this, true);
+            break;
+        case 'prop_unit':
+            countUnitChange.call(this, true);
+            break;
+        case 'probegindate':
+            beginDateChange.call(this, true);
+            break;
+        case 'probenddate':
+            endDateChange.call(this);
+            break;
+        default:
+            break;
+    }
+}
+
+function ifproChange(moduleId, value) {
+    let template = this.props.meta.getMeta(), area = moduleId;
+    if (template.formrelation && template.formrelation[moduleId]) {
+        area = template.formrelation[moduleId][template.formrelation[moduleId].length - 1];
+    }
+    const promonth = template[area].items.find(item => item.attrcode === 'promonth');
+    const prop_unit = template[area].items.find(item => item.attrcode === 'prop_unit');
+    const probegindate = template[area].items.find(item => item.attrcode === 'probegindate');
+    const probenddate = template[area].items.find(item => item.attrcode === 'probenddate');
+    if (value.value === false || value.value === 'N') {
+        promonth.required = false;
+        prop_unit.required = false;
+        probegindate.required = false;
+        probenddate.required = false;
+        this.props.meta.setMeta(template);
+        this.props.form.setFormItemsValue(moduleId, {
+            'promonth': {
+                value: '',
+                display: null
+            },
+            'prop_unit': {
+                value: '',
+                display: null
+            },
+            'probegindate': {
+                value: '',
+                display: null
+            },
+            'probenddate': {
+                value: '',
+                display: null
+            }
+        });
+        this.props.form.setFormItemsDisabled(moduleId, {
+            'promonth': true,
+            'prop_unit': true,
+            'probegindate': true,
+            'probenddate': true
+        });
+    } else {
+        const record = this.props.form.getAllFormValue(this.props.areaCode).rows[0].values;
+        promonth.required = true;
+        prop_unit.required = true;
+        probegindate.required = true;
+        probenddate.required = true;
+        this.props.meta.setMeta(template);
+        this.props.form.setFormItemsValue(moduleId, {
+            'promonth': {
+                value: '',
+                display: null
+            },
+            'prop_unit': prop_unit.options.find(option => option.value === '2'),
+            'probegindate': {
+                value: record['begindate'].value,
+                display: null
+            },
+            'probenddate': {
+                value: '',
+                display: null
+            }
+        });
+        this.props.form.setFormItemsDisabled(moduleId, {
+            'promonth': false,
+            'prop_unit': false,
+            'probegindate': false,
+            'probenddate': false
+        });
+    }
+}
+
+function termTypeChange(moduleId, value) {
+    if (value.value === 'CM02') {
+        let template = this.props.meta.getMeta(), area = moduleId;
+        if (template.formrelation && template.formrelation[moduleId]) {
+            area = template.formrelation[moduleId][template.formrelation[moduleId].length - 1];
+        }
+        const termmonth = template[area].items.find(item => item.attrcode === 'termmonth');
+        const enddate = template[area].items.find(item => item.attrcode === 'enddate');
+        termmonth.required = false;
+        enddate.required = false;
+        this.props.meta.setMeta(template);
+        this.props.form.setFormItemsValue(moduleId, {
+            'termmonth': {
+                value: '',
+                display: null
+            },
+            'enddate': {
+                value: '',
+                display: null
+            }
+        });
+        this.props.form.setFormItemsDisabled(moduleId, {
+            'termmonth': true,
+            'enddate': true
+        });
+    } else {
+        let template = this.props.meta.getMeta(), area = moduleId;
+        if (template.formrelation && template.formrelation[moduleId]) {
+            area = template.formrelation[moduleId][template.formrelation[moduleId].length - 1];
+        }
+        const termmonth = template[area].items.find(item => item.attrcode === 'termmonth');
+        const enddate = template[area].items.find(item => item.attrcode === 'enddate');
+        termmonth.required = true;
+        enddate.required = true;
+        this.props.meta.setMeta(template);
+        this.props.form.setFormItemsDisabled(moduleId, {
+            'termmonth': false,
+            'enddate': false
+        });
+    }
+}
+
+function termMonthChange(isPro) {
+    const {form, areaCode} = this.props;
+    const record = form.getAllFormValue(areaCode).rows[0].values;
+    if (record[isPro ? 'promonth' : 'termmonth'].value == null ||
+        (!record[isPro ? 'probegindate' : 'begindate'].value && !record[isPro ? 'probenddate' : 'enddate'].value))
+        return;
+    if (record[isPro ? 'probegindate' : 'begindate'].value) {
+        const endDate = getEndDate(
+            record[isPro ? 'promonth' : 'termmonth'].value,
+            record[isPro ? 'probegindate' : 'begindate'].value,
+            record[isPro ? 'prop_unit' : 'cont_unit'].value
+        );
+        form.setFormItemsValue(areaCode, {
+            [isPro ? 'probenddate' : 'enddate']: {
+                value: endDate,
+                display: null
+            }
+        })
+    } else {
+        const beginDate = getBeginDate(
+            record[isPro ? 'promonth' : 'termmonth'].value,
+            record[isPro ? 'probenddate' : 'enddate'].value,
+            record[isPro ? 'prop_unit' : 'cont_unit'].value
+        );
+        form.setFormItemsValue(areaCode, {
+            [isPro ? 'probegindate' : 'begindate']: {
+                value: beginDate,
+                display: null
+            }
+        })
+    }
+}
+
+function countUnitChange(isPro) {
+    const {form, areaCode} = this.props;
+    const record = form.getAllFormValue(areaCode).rows[0].values;
+    if (record[isPro ? 'promonth' : 'termmonth'].value == null ||
+        (!record[isPro ? 'probegindate' : 'begindate'].value && !record[isPro ? 'probenddate' : 'enddate'].value))
+        return;
+    if (record[isPro ? 'probegindate' : 'begindate'].value) {
+        const endDate = getEndDate(
+            record[isPro ? 'promonth' : 'termmonth'].value,
+            record[isPro ? 'probegindate' : 'begindate'].value,
+            record[isPro ? 'prop_unit' : 'cont_unit'].value
+        );
+        form.setFormItemsValue(areaCode, {
+            [isPro ? 'probenddate' : 'enddate']: {
+                value: endDate,
+                display: null
+            }
+        })
+    } else {
+        const beginDate = getBeginDate(
+            record[isPro ? 'promonth' : 'termmonth'].value,
+            record[isPro ? 'probenddate' : 'enddate'].value,
+            record[isPro ? 'prop_unit' : 'cont_unit'].value
+        );
+        form.setFormItemsValue(areaCode, {
+            [isPro ? 'probegindate' : 'begindate']: {
+                value: beginDate,
+                display: null
+            }
+        })
+    }
+}
+
+function beginDateChange(isPro) {
+    const {form, areaCode} = this.props;
+    const record = form.getAllFormValue(areaCode).rows[0].values;
+    if (record[isPro ? 'promonth' : 'termmonth'].value == null) return;
+    if (record[isPro ? 'probegindate' : 'begindate'].value) {
+        const endDate = getEndDate(
+            record[isPro ? 'promonth' : 'termmonth'].value,
+            record[isPro ? 'probegindate' : 'begindate'].value,
+            record[isPro ? 'prop_unit' : 'cont_unit'].value
+        );
+        form.setFormItemsValue(areaCode, {
+            [isPro ? 'probenddate' : 'enddate']: {
+                value: endDate,
+                display: null
+            }
+        })
+    }
+}
+
+function endDateChange(isPro) {
+    const {form, areaCode} = this.props;
+    const record = form.getAllFormValue(areaCode).rows[0].values;
+    if (record[isPro ? 'probegindate' : 'begindate'].value == null) return;
+    if (record[isPro ? 'probenddate' : 'enddate'].value) {
+        const termmonth = getGapDate(
+            record[isPro ? 'probegindate' : 'begindate'].value,
+            record[isPro ? 'probenddate' : 'enddate'].value,
+            record[isPro ? 'prop_unit' : 'cont_unit'].value
+        );
+        form.setFormItemsValue(areaCode, {
+            [isPro ? 'promonth' : 'termmonth']: {
+                value: termmonth,
+                display: null
+            }
+        })
+    }
+}
+
+function getEndDate(itermmonth = 0, startdate, unit) {
+    //"1":"年" "2":"月" "3": "天"
+    let nextDate = '';
+    if (unit === '1') {
+        nextDate = moment(startdate).add(Number(itermmonth), 'y').subtract(Number(1), 'd');
+    }
+    if (unit === '2') {
+        nextDate = moment(startdate).add(Number(itermmonth), 'M').subtract(Number(1), 'd');
+    }
+    if (unit === '3') {
+        nextDate = moment(startdate).add(Number(itermmonth), 'd');
+    }
+    return nextDate.format('YYYY-MM-DD');
+}
+
+function getBeginDate(itermmonth = 0, enddate, unit) {
+    //"1":"年" "2":"月" "3": "天"
+    let nextDate = '';
+    if (unit === '1') {
+        nextDate = moment(enddate).subtract(Number(itermmonth), 'y').add(Number(1), 'd');
+    }
+    if (unit === '2') {
+        nextDate = moment(enddate).subtract(Number(itermmonth), 'M').add(Number(1), 'd');
+    }
+    if (unit === '3') {
+        nextDate = moment(enddate).subtract(Number(itermmonth), 'd');
+    }
+    return nextDate.format('YYYY-MM-DD');
+}
+
+function getGapDate(begindate, enddate, unit) {
+    //"1":"年" "2":"月" "3": "天"
+    let beginDate = new Date(begindate).getTime(), endDate = new Date(enddate).getTime(), gap = 0;
+    if (unit === '1') {
+        gap = (endDate - beginDate) / (1000 * 60 * 60 * 24 * 365);
+    }
+    if (unit === '2') {
+        gap = (endDate - beginDate) / (1000 * 60 * 60 * 24 * 30);
+    }
+    if (unit === '3') {
+        gap = (endDate - beginDate) / (1000 * 60 * 60 * 24);
+    }
+    return Math.round(gap);
+}

+ 93 - 0
src/hrcm/contractmgt/account/main/components/ContractDetail/index.js

@@ -0,0 +1,93 @@
+import React, {Component} from 'react';
+import './index.less';
+import {base} from 'nc-lightapp-front';
+import NCBackBtn from "src/hrpub/common/components/hr-back";
+import {chectFormAction} from "../../../../../public/functions/checkFormAction";
+
+class ContractDetail extends Component {
+    constructor(props) {
+        super(props);
+        this.pageQueryClick = this.pageQueryClick.bind(this);
+        this.goBack = this.goBack.bind(this);
+        this.onAfterAddFormEvent = this.onAfterAddFormEvent.bind(this);
+        this.handleEditBefore = this.handleEditBefore.bind(this);
+    }
+
+    componentDidMount() {
+        if (this.props.data) {
+            /*this.props.cardPagination.getNextCardPaginationId({
+                id: this.props.data.rows[0].values.pk_psndoc_sub.value,
+                status: 1
+            });*/
+            this.props.cardPagination.setCardPaginationId({
+                id: this.props.data.rows[0].values.pk_psndoc_sub.value,
+                status: 1
+            });
+        }
+    }
+
+    pageQueryClick(props, key) {
+        const record = props.table.getAllTableData('contractList').rows.find(row => row.values.pk_psndoc_sub.value === key);
+        this.props.view('', record.values)
+    }
+
+    goBack() {
+        this.props.updateState({
+            contractPage: 'main'
+        }, () => {
+            this.props.updateButton();
+        })
+    }
+
+    handleEditBefore(props, moduleId, key, value, data) {
+        let {areaCode, orgVal} = this.props;
+        if (key === 'pk_conttext') {
+            let meta = props.meta.getMeta();
+            let editArea = areaCode;
+            const formrelation = meta.formrelation && meta.formrelation[areaCode];
+            if (formrelation) {
+                editArea = formrelation[formrelation.length - 1];
+            }
+            meta[editArea].items.find(item => item.attrcode === key).queryCondition = function () {
+                return {
+                    "pk_org": orgVal.refpk,
+                    "GridRefActionExt": "nccloud.web.hrcm.make.sqlbuilder.ContModelGridSqlBuilder"
+                }
+            };
+            props.meta.setMeta(meta);
+        }
+        return true;
+    }
+
+    onAfterAddFormEvent(props, moduleId, key, value) {
+        //handleAfter.call(this, moduleId, key, value);
+        const {areaCode, appCode} = this.props;
+        let editArea = areaCode;
+        const formrelation = this.props.meta.getMeta().formrelation && this.props.meta.getMeta().formrelation[areaCode];
+        if (formrelation) {
+            editArea = formrelation[formrelation.length - 1];
+        }
+        chectFormAction(key, areaCode, props, [editArea], appCode)
+    }
+
+    render() {
+        const {form, cardPagination, page, areaCode} = this.props;
+        const {createCardPagination} = cardPagination;
+        return (
+            <div>
+                {/*<NCAffix>*/}
+                <div className="header" style={{display: page === 'view' ? '' : 'none'}}>
+                    <NCBackBtn onClick={this.goBack}/>
+                    {createCardPagination({handlePageInfoChange: this.pageQueryClick})}
+                </div>
+                {/*</NCAffix>*/}
+                {areaCode ? form.createForm(areaCode, {
+                    onAfterEvent: this.onAfterAddFormEvent,
+                    onBeforeEvent: this.handleEditBefore
+                }) : null}
+            </div>
+        );
+    }
+}
+
+export default ContractDetail;

+ 0 - 0
src/hrcm/contractmgt/account/main/components/ContractDetail/index.less


+ 105 - 0
src/hrcm/contractmgt/account/main/components/ContractTable/index.js

@@ -0,0 +1,105 @@
+import React, {Component} from 'react';
+import './index.less';
+import {base} from 'nc-lightapp-front';
+import Pagination from "src/hrpub/common/components/Pagination";
+import {debounce} from "src/hrpub/common/utils/utils";
+
+class ContractTable extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            tableHeight: ''
+        };
+        this.changePage = this.changePage.bind(this);
+        this.pageSizeChange = this.pageSizeChange.bind(this);
+        this.rowDoubleClickHandle = this.rowDoubleClickHandle.bind(this);
+        this.setTableHeight = this.setTableHeight.bind(this);
+    }
+
+    componentDidMount() {
+        this.setTableHeight();
+        window.addEventListener("resize", debounce(this.setTableHeight));
+    }
+
+    changePage(pageIndex) {
+        const {
+            updateState,
+            getConTableData,
+            pageInfo
+        } = this.props;
+
+        updateState({
+            contractPageInfo: {
+                ...pageInfo,
+                pageIndex: pageIndex
+            }
+        }, () => {
+            getConTableData();
+        });
+    }
+
+    rowDoubleClickHandle(record, index, props, e) {
+        this.props.view('', record, index);
+    }
+
+    pageSizeChange(pageSize) {
+        const {
+            updateState,
+            getConTableData,
+            pageInfo
+        } = this.props;
+
+        updateState({
+            contractPageInfo: {
+                ...pageInfo,
+                pageSize,
+                pageIndex: 1
+            }
+        }, () => {
+            getConTableData();
+        });
+    }
+
+    setTableHeight() {
+        const content = document.getElementsByClassName('entry-staff-query-content');
+        if (content[0]) {
+            this.setState({
+                tableHeight: content[0].clientHeight - 88
+            })
+        }
+    }
+
+    render() {
+        const {table, pageInfo} = this.props;
+
+        return (
+            <div className='contract-table flex-container'>
+                <div className='flex-container' style={{height:  this.state.tableHeight}}>
+                    {this.state.tableHeight && table.createSimpleTable('contractList', {
+                        cancelCustomRightMenu: true,
+                        height: this.state.tableHeight,
+                        adaptionHeight:true,
+                        showCheck: true,
+                        showIndex: true,
+                        onRowDoubleClick: this.rowDoubleClickHandle
+                    })}
+                </div>
+               
+                {
+                    pageInfo.total > 0 &&
+                    <Pagination
+                        current={parseInt(pageInfo.pageIndex)}
+                        pageSize={parseInt(pageInfo.pageSize)}
+                        pageSizeOptions={[5, 10, 20, 50, 100]}
+                        showSizeChanger={true}
+                        total={pageInfo.total}
+                        onShowSizeChange={this.pageSizeChange}
+                        onChange={this.changePage}
+                    />
+                }
+            </div>
+        );
+    }
+}
+
+export default ContractTable;

+ 6 - 0
src/hrcm/contractmgt/account/main/components/ContractTable/index.less

@@ -0,0 +1,6 @@
+
+.contract-table{
+  .ncc-hr-pagination-wrapper{
+    margin-top: 10px;
+  }
+}

+ 185 - 0
src/hrcm/contractmgt/account/main/components/Header/index.js

@@ -0,0 +1,185 @@
+import React, {Component} from 'react';
+import './index.less';
+import {high, promptBox} from 'nc-lightapp-front';
+import ReferSearch from 'src/hrpub/common/components/referSearch/org';
+import do_print from "src/hrpub/common/utils/print";
+import ExportHtml from "src/hrpub/common/utils/exportHtml";
+import setQueryMeta from '../../container/functions/setQueryMeta';
+import isMac from "../../../../../public/functions/isMac";
+import checkBtnPermission from "../../container/functions/checkBtnPermission";
+
+class Header extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {printData: {}};
+        this.updateOrgValue = this.updateOrgValue.bind(this);
+        this.onBtnOperation = this.onBtnOperation.bind(this);
+    }
+
+    updateOrgValue(value) {
+        this.props.updateOrgValue(value);
+    }
+
+    onBtnOperation(props, btncode, areacode, opt) {
+        switch (btncode) {
+            case 'query':
+                setQueryMeta.call(this);
+                if (this.props.tabKey === 'contract') {
+                    this.props.search.openAdvSearch('contractquery', true);
+                } else {
+                    this.props.search.openAdvSearch('agreementquery', true);
+                }
+                break;
+            case 'refresh':
+                this.props.refresh();
+                break;
+            case 'save':
+                this.props.save();
+                break;
+            case 'cancel':
+                promptBox({
+                    color: 'warning',
+                    title: this.props.json['cm6011-000000'],/* 国际化处理: 确认取消,确认取消*/
+                    content: this.props.json['cm6011-000001'],/* 国际化处理: 是否确认要取消?,是否确认要取消*/
+                    beSureBtnClick: () => {
+                        this.props.cancel();
+                    }
+                });
+                break;
+            case 'edit':
+                this.props.edit();
+                break;
+            case 'file':
+                this.props.checkFileManage();
+                /*this.props.updateState({
+                    showUploader: true
+                });*/
+                break;
+            case 'print':
+                if (this.props.tabKey === 'contract') {
+                    const el = document.querySelector('.contract-table').cloneNode(true);
+                    // const table = el.querySelector('.wui-table-content');
+                    // table.removeChild(table.lastElementChild);
+                    // table.removeChild(table.lastElementChild);
+                    // const tHeader = el.querySelector('.wui-table-header');
+                    // const tr = tHeader.querySelector('tr');
+                    // tr.removeChild(tr.firstElementChild);
+                    // tr.removeChild(tr.firstElementChild);
+                    // tr.removeChild(tr.lastElementChild);
+                    // tr.removeChild(tr.lastElementChild);
+                    const meta = JSON.parse(JSON.stringify(this.props.meta.getMeta()['contractList']));
+                    meta.items.pop();
+                    meta.items.pop();
+                    do_print(
+                        el,
+                        {
+                            title: this.props.json['cm6011-000068'] /* 国际化处理: 续签意见征询*/,
+                            maker: this.props.json['cm6011-000033'] /* 国际化处理: 打印人*/,
+                            date: this.props.json['cm6011-000034'] /* 国际化处理: 打印日期*/
+                        },
+                        {
+                            tableTmp: meta,
+                            data: this.props.table.getAllTableData('contractList').rows
+                        }
+                    );
+                } else {
+                    const el = document.querySelector('.agree-table').cloneNode(true);
+                    // const table = el.querySelector('.wui-table-content');
+                    // table.removeChild(table.lastElementChild);
+                    // table.removeChild(table.lastElementChild);
+                    // const tHeader = el.querySelector('.wui-table-header');
+                    // const tr = tHeader.querySelector('tr');
+                    // tr.removeChild(tr.firstElementChild);
+                    // tr.removeChild(tr.firstElementChild);
+                    // tr.removeChild(tr.lastElementChild);
+                    // tr.removeChild(tr.lastElementChild);
+                    const meta = JSON.parse(JSON.stringify(this.props.meta.getMeta()['agreementList']));
+                    meta.items.pop();
+                    meta.items.pop();
+                    do_print(
+                        el,
+                        {
+                            title: this.props.json['cm6011-000069'] /* 国际化处理: 续签意见征询*/,
+                            maker: this.props.json['cm6011-000033'] /* 国际化处理: 打印人*/,
+                            date: this.props.json['cm6011-000034'] /* 国际化处理: 打印日期*/
+                        },
+                        {
+                            tableTmp: meta,
+                            data: this.props.table.getAllTableData('agreementList').rows
+                        }
+                    );
+                }
+                break;
+            case 'export':
+                if (this.props.tabKey === 'contract') {
+                    ExportHtml(document.querySelector('.contract-table'), {
+                        title: this.props.json['cm6011-000068'],
+                        fileName: this.props.json['cm6011-000068']
+                    }, {
+                        meta: this.props.meta.getMeta()['contractList'],
+                        data: this.props.table.getAllTableData('contractList').rows,
+                        showIndex: true
+                    })
+                } else {
+                    ExportHtml(document.querySelector('.agree-table'), {
+                        title: this.props.json['cm6011-000069'],
+                        fileName: this.props.json['cm6011-000069']
+                    }, {
+                        meta: this.props.meta.getMeta()['agreementList'],
+                        data: this.props.table.getAllTableData('agreementList').rows,
+                        showIndex: true
+                    })
+                }
+                break;
+            case 'viewbooklet':
+                if (!isMac(this.props.json['cm6011-000148'])) {
+                    this.props.viewbooklet();
+                }
+                break;
+            case 'viewAgree':
+                if (!isMac(this.props.json['cm6011-000148'])) {
+                    this.props.viewAgreeText();
+                }
+                break;
+            case 'browse':
+                if (!isMac(this.props.json['cm6011-000148'])) {
+                    if (this.props.tabKey === 'contract') {
+                        this.props.viewbooklet();
+                    } else {
+                        this.props.viewAgreeText();
+                    }
+                }
+                break;
+            case 'tempPrint':
+                this.props.tempPrint();
+                break;
+            default:
+                break;
+        }
+    }
+
+    render() {
+        const {button, orgVal, isEdit} = this.props;
+        return (
+            <div>
+                <div className="header">
+                    <div className="header-refer">
+                        <ReferSearch disabled={isEdit} orgVal={orgVal} getOrgData={this.updateOrgValue}/>
+                    </div>
+                    <div className="btn-group">
+                        <div className="definition-icons">
+                            {button.createButtonApp({
+                                area: 'head',
+                                onButtonClick: (props, btncode) => {
+                                    this.onBtnOperation(props, btncode, 'head', this);
+                                }
+                            })}
+                        </div>
+                    </div>
+                </div>
+            </div>
+        );
+    }
+}
+
+export default Header;

+ 16 - 0
src/hrcm/contractmgt/account/main/components/Header/index.less

@@ -0,0 +1,16 @@
+.header {
+  .header-checkbox-group {
+    float: left;
+    padding-left: 10px;
+
+    .header-checkbox {
+      margin-right: 30px;
+    }
+    .header-checkbox:last-child {
+      margin-right: 0;
+    }
+  }
+  .header-tabs {
+
+  }
+}

+ 54 - 0
src/hrcm/contractmgt/account/main/components/SearchModal/index.js

@@ -0,0 +1,54 @@
+import React, {Component} from 'react';
+import './index.less';
+import {base} from 'nc-lightapp-front';
+import SearchTop from "../SearchTop";
+import {getQueryCondition} from 'src/hrpub/common/utils/utils';
+
+class SearchModal extends Component {
+    constructor(props) {
+        super(props);
+        this.goSearch = this.goSearch.bind(this);
+    }
+
+    goSearch() {
+        const {updateState, getConTableData, queryOid, search, pageInfo} = this.props;
+        const data = getQueryCondition(this.props, 'contractquery');
+        const topData = this.searchTopNode.getData();
+        updateState({
+            contractPageInfo: {
+                ...pageInfo,
+                pageIndex: 1
+            },
+            searchModalValue: {...data, ...topData, oid: queryOid}
+        }, () => {
+            getConTableData();
+            search.openAdvSearch('contractquery', false)
+        });
+    }
+
+    render() {
+        return (
+            <div style={{display: 'none'}}>
+                {this.props.search.NCCreateSearch('contractquery', {
+                    clickSearchBtn: this.goSearch,
+                    onlyShowAdvArea: false,
+                    showAdvSearchPlanBtn: true,
+                    saveSearchPlan: true,
+                    oid: this.props.queryOid,
+                    onlyShowSuperBtn: true,
+                    advSearchClearEve: () => {
+                        this.searchTopNode.clearData()
+                    },
+                    addAdvBody: () => {
+                        return <SearchTop
+                            ref={node => this.searchTopNode = node}
+                            json={this.props.json}
+                        />
+                    }
+                })}
+            </div>
+        );
+    }
+}
+
+export default SearchModal;

+ 14 - 0
src/hrcm/contractmgt/account/main/components/SearchModal/index.less

@@ -0,0 +1,14 @@
+.search-modal-wrapper {
+    .condition-contant {
+        margin-bottom: 10px;
+    }
+    .search-page-footer {
+        text-align: right;
+    }
+    .wui-modal-header {
+        padding-bottom: 0;
+    }
+    .wui-modal-body {
+        padding-top: 0;
+    }
+}

+ 191 - 0
src/hrcm/contractmgt/account/main/components/SearchTop/index.js

@@ -0,0 +1,191 @@
+import React, {Component} from 'react';
+import './index.less';
+import {base, cacheTools} from 'nc-lightapp-front';
+
+const {NCCheckbox, NCSelect, NCInput} = base;
+
+class SearchTop extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            querylast: false,
+            termOperator: '1',
+            termFromStr: '',
+            termToStr: '',
+            contTermStr: '',
+            termUint: '2',
+            propOperator: '1',
+            propFromStr: '',
+            propToStr: '',
+            contPropStr: '',
+            propUint: '2'
+        };
+        this.getData = this.getData.bind(this);
+    }
+
+    onchange = (key, val) => {
+        // debugger
+        let keysArr = ['termFromStr', 'contTermStr', 'termToStr', 'propFromStr', 'contPropStr', 'propToStr'];
+        if (keysArr.includes(key) && (isNaN(val) || val > 9999)) {
+            return false
+        }
+        this.setState({
+            [key]: val
+        })
+    };
+
+    getData() {
+        return this.state;
+    }
+
+    clearData() {
+        this.setState({
+            querylast: false,
+            termFromStr: '',
+            termToStr: '',
+            contTermStr: '',
+            propFromStr: '',
+            propToStr: '',
+            contPropStr: ''
+        })
+    }
+
+    render() {
+        const {json, isAgree} = this.props;
+        const {
+            querylast, termOperator, termFromStr, termToStr, contTermStr, termUint,
+            propOperator, propFromStr, propToStr, contPropStr, propUint
+        } = this.state;
+        const selectData = [
+            {
+                key: json["cm6011-000075"],
+                value: '1'
+            },
+            {
+                key: json["cm6011-000076"],
+                value: '2'
+            },
+            {
+                key: json["cm6011-000077"],
+                value: '3'
+            },
+            {
+                key: json["cm6011-000078"],
+                value: '4'
+            },
+            {
+                key: json["cm6011-000079"],
+                value: '5'
+            },
+            {
+                key: json["cm6011-000080"],
+                value: '6'
+            }
+        ];
+        const selectUnitData = [
+            {
+                key: json["cm6011-000081"],
+                value: '1'
+            },
+            {
+                key: json["cm6011-000082"],
+                value: '2'
+            },
+            {
+                key: json["cm6011-000083"],
+                value: '3'
+            }
+        ];
+        return (
+            <div className="search-top-area">
+                <div>
+                    <div className={'checkbox'}>
+                        <NCCheckbox checked={querylast} onChange={val => {
+                            this.onchange('querylast', val)
+                        }}>{json['cm6011-000086']}</NCCheckbox>{/* 国际化处理: 仅查最新纪录*/}
+                    </div>
+                    <div className={'contract-term'}>
+                        <div className={'contract-term-item'}>
+                            <div className={'contract-unit'}>
+                                <span>{isAgree ? json['cm6011-000103'] : json['cm6011-000085']}</span>
+                                <NCSelect
+                                    className={'select-box'}
+                                    onChange={(val) => {
+                                        this.onchange('termOperator', val);
+                                    }}
+                                    value={termOperator}
+                                    data={selectData}
+                                />
+                            </div>
+                            <div className={'contract-time'}>
+                                {termOperator === '1' ? <div>
+                                    <NCInput type="text" value={termFromStr} onChange={val => {
+                                        this.onchange('termFromStr', val)
+                                    }}/>
+                                    <NCInput type="text" value={termToStr} onChange={val => {
+                                        this.onchange('termToStr', val)
+                                    }}/>
+                                </div> : <div>
+                                    <NCInput type="text" value={contTermStr} onChange={val => {
+                                        this.onchange('contTermStr', val)
+                                    }}/>
+                                </div>}
+                            </div>
+                            <div className={'contract-unit'}>
+                                <span>{json['cm6011-000087']}</span>
+                                <NCSelect
+                                    className={'select-box'}
+                                    onChange={(val) => {
+                                        this.onchange('termUint', val);
+                                    }}
+                                    value={termUint}
+                                    data={selectUnitData}
+                                />
+                            </div>
+                        </div>
+                        <div className={'contract-term-item'}>
+                            <div className={'contract-unit'}>
+                                <span>{json['cm6011-000088']}</span>
+                                <NCSelect
+                                    className={'select-box'}
+                                    onChange={(val) => {
+                                        this.onchange('propOperator', val);
+                                    }}
+                                    value={propOperator}
+                                    data={selectData}
+                                />
+                            </div>
+                            <div className={'contract-time'}>
+                                {propOperator === '1' ? <div>
+                                    <NCInput type="text" value={propFromStr} onChange={val => {
+                                        this.onchange('propFromStr', val)
+                                    }}/>
+                                    <NCInput type="text" value={propToStr} onChange={val => {
+                                        this.onchange('propToStr', val)
+                                    }}/>
+                                </div> : <div>
+                                    <NCInput type="text" value={contPropStr} onChange={val => {
+                                        this.onchange('contPropStr', val)
+                                    }}/>
+                                </div>}
+                            </div>
+                            <div className={'contract-unit'}>
+                                <span>{json['cm6011-000087']}</span>
+                                <NCSelect
+                                    className={'select-box'}
+                                    onChange={(val) => {
+                                        this.onchange('propUint', val);
+                                    }}
+                                    value={propUint}
+                                    data={selectUnitData}
+                                />
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        );
+    }
+}
+
+export default SearchTop;

+ 82 - 0
src/hrcm/contractmgt/account/main/components/SearchTop/index.less

@@ -0,0 +1,82 @@
+.search-top-area {
+    padding-left: 10px;
+    padding-top: 10px;
+    box-sizing: border-box;
+    color: #666666;
+    height: auto;
+    .checkbox {
+        display: flex;
+        flex-flow: column;
+    }
+
+    .contract-term {
+        margin-top: 10px;
+
+        & > div.contract-term-item:nth-of-type(1) {
+            padding-bottom: 8px;
+        }
+
+        .contract-term-item {
+            display: flex;
+            align-items: center;
+            justify-content: flex-start;
+
+            .contract-time {
+                width: 200px;
+                margin: 0 10px;
+
+                & > div {
+                    display: flex;
+
+                    & > div.base-form-control-wrapper:nth-of-type(2) {
+                        margin-left: 10px;
+                    }
+                }
+            }
+
+            .contract-unit {
+                .select-box {
+                    width: 120px;
+                }
+
+                & > div {
+                    margin-left: 10px;
+                }
+            }
+        }
+    }
+}
+
+// 查询弹窗
+.NC_searchAdvModalBox{
+    .rightArea{
+        .wui-tabs.wui-tabs-top.wui-tabs-simple.lightapp-component-tabs{
+            .wui-tabs-content{
+                height: calc(~'100% - 40px')!important;
+                &>div{
+                    height: 100%;
+                    &>div{
+                        height: 100%;
+                        .normalArea,.superArea{
+                            position: relative;
+                            // height: calc(~'100% - 270px');
+                            height: 234px;
+                            // overflow: hidden;
+                            overflow-y: auto;
+                            .NC_searchAdvComBox{
+                                height: 100%;
+                                overflow-y: auto;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+.nc-lightapp-front-black {
+    .search-top-area {
+        height: auto !important;
+    }
+}

+ 68 - 0
src/hrcm/contractmgt/account/main/components/Uploader/index.js

@@ -0,0 +1,68 @@
+import React, {Component} from 'react';
+import './index.less';
+import NCUploader from 'uap/common/components/NCUploader';
+import {toast} from 'nc-lightapp-front';
+class Uploader extends Component {
+    constructor(props) {
+        super(props);
+        this.beforeUpload = this.beforeUpload.bind(this);
+        this.getGroupList = this.getGroupList.bind(this);
+        this.onHideUploader = this.onHideUploader.bind(this);
+        this.getBillId = this.getBillId.bind(this);
+    }
+
+    getBillId() {
+        const {
+            psndoc, tabKey, contractPage, contractData, agreeData, agreementPage
+        } = this.props;
+        let value;
+        if (tabKey === 'contract') {
+            if (contractPage === 'main') {
+                value = psndoc;
+            } else {
+                value = contractData.rows[0].values.pk_psndoc_sub.value;
+            }
+        } else {
+            if (agreementPage === 'main') {
+                value = psndoc;
+            } else {
+                value = agreeData.rows[0].values.pk_agreement.value;
+            }
+        }
+        return value;
+    }
+
+    onHideUploader() {
+        this.props.onClose && this.props.onClose();
+    }
+
+    //获取当前附件列表
+    getGroupList(list) {
+    }
+
+    beforeUpload(billId, fullPath, file, fileList) {
+        // 参数:单据id,当前选中分组path、当前上传文件对象,当前文件列表
+        const isLt2M = file.size / 1024 / 1024 < 10;
+        if (!isLt2M) {
+            toast({color: "info", content: this.props.json['hi6007-000098']}) /* 国际化处理: 上传大小小于2M*/
+        }
+        return isLt2M;
+        // 备注: return false 不执行上传  return true 执行上传
+    }
+
+    render() {
+        return (
+            <div className='uploader'>
+                <NCUploader
+                    uploadTitle={this.props.json["cm6011-000062"] /*多语: 附件管理*/}
+                    billId={this.getBillId()}
+                    //getGroupList={this.getGroupList}
+                    onHide={this.onHideUploader} // 关闭功能
+                    //beforeUpload={this.beforeUpload}
+                />
+            </div>
+        );
+    }
+}
+
+export default Uploader;

+ 0 - 0
src/hrcm/contractmgt/account/main/components/Uploader/index.less


+ 37 - 0
src/hrcm/contractmgt/account/main/container/functions/agreeTextViewAction.js

@@ -0,0 +1,37 @@
+import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';
+import nodeRefs from '../pageIns';
+export default function AgreeTextViewAction() {
+    const {orgVal, agreementPage, agreeData, agreeArea} = this.state;
+    console.log(agreeArea)
+    let pk_agreement = '';
+    if (agreementPage === 'main') {
+        const clickRow = this.props.table.getClickRowIndex('agreementList');
+        pk_agreement = clickRow.record.values.pk_agreement.value;
+    } else {
+        pk_agreement = agreeData.rows[0].values.pk_agreement.value;
+    }
+    const postData = {
+        pk_org: orgVal.refpk,
+        pk_agreement
+    };
+
+    proFetch({
+        url: '/nccloud/hrcm/templet/AgreementTextViewAction.do',
+        body: postData,
+    })
+        .then((res) => {
+            if (res.success) {
+                if (!res['data']) return;
+                if (agreementPage === 'main') {
+                    const clickRow = this.props.table.getClickRowIndex('agreementList');
+                    nodeRefs.wpsview.openView([{data: clickRow.record}], 'ag')
+                } else {
+                      /*获取表单所有数据*/
+                      let formData = this.props.form.getAllFormValue(agreeArea).rows;
+                      nodeRefs.wpsview.openView(formData, 'ag')
+                }
+                // let location = window.location;
+                // location.port ? window.open("uclient://start/http://" + location.hostname + ":" + location.port + res.data) : window.open("uclient://start/http://" + location.hostname + res.data)
+            }
+        });
+}

+ 31 - 0
src/hrcm/contractmgt/account/main/container/functions/cancelEdit.js

@@ -0,0 +1,31 @@
+export default function cancelEdit() {
+    const {
+        lastAgreementPage, lastContractPage, tabKey, contractArea,
+        agreeArea, isQueryTemplate, agreementPageInfo
+    } = this.state;
+    if (tabKey === 'contract') {
+        this.props.form.cancel(contractArea);
+        this.setState({
+            contractPage: lastContractPage
+        }, () => {
+            this.updateButtonStatus();
+        })
+    } else {
+        if (lastAgreementPage === 'main') {
+            this.setState({
+                agreementPageInfo: {...agreementPageInfo, pageIndex: 1},
+                agreementPage: lastAgreementPage
+            }, () => {
+                this.updateButtonStatus();
+                this.getAgreeTableData(isQueryTemplate)
+            })
+        } else {
+            this.props.form.cancel(agreeArea);
+            this.setState({
+                agreementPage: lastAgreementPage
+            }, () => {
+                this.updateButtonStatus();
+            })
+        }
+    }
+}

+ 16 - 0
src/hrcm/contractmgt/account/main/container/functions/checkBtnPermission.js

@@ -0,0 +1,16 @@
+import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';
+
+export default function checkBtnPermission(billPk, opFlag, nodeKey, callback) {
+    proFetch({
+        url: '/nccloud/hrcm/agreement/CheckDataPermissionAction.do',
+        body: {
+            billPks: [billPk],
+            opFlag,
+            nodeKey
+        },
+    }).then((res) => {
+        if (res.success) {
+            callback && callback()
+        }
+    })
+}

+ 221 - 0
src/hrcm/contractmgt/account/main/container/functions/configData.js

@@ -0,0 +1,221 @@
+// templateArr/业务处理 传formid
+export const transactionFormId = {
+    contSign: 'cont_sign',
+    contChange: 'cont_change',
+    contExtend: 'cont_extend',
+    contRelease: 'cont_release',
+    contFinish: 'cont_finish',
+    agreeSign: 'agree_sign',
+    agreeChange: 'agree_change',
+    agreeRelease: 'agree_release',
+    agreeFinish: 'agree_finish'
+};
+
+export const contFormTypeMap = {
+    '1': {mainArea: 'cont_sign_dataCard', areas: ['dataCard']},
+    '2': {
+        mainArea: 'cont_extend_dataBase',
+        areas: ['dataBase', 'dataBefore', 'dataAfter']
+    },
+    '3': {
+        mainArea: 'cont_change_dataBase',
+        areas: ['dataBase', 'dataBefore', 'dataAfter']
+    },
+    '4': {mainArea: 'cont_release_card', areas: ['dataCard']},
+    '5': {mainArea: 'cont_finish_card', areas: ['dataCard']},
+};
+
+/**"签订":"1" "变更":"3" "解除":"4" "终止":"5"
+ * "岗位协议":"postcont" "保密协议":"secrerycont" "培训协议":"traincont"
+ */
+export const agreeFormTypeMap = {
+    '1': {
+        'postcont': {mainArea: 'agree_sign_postcont', areas: ['postcontCard']},
+        'secrerycont': {mainArea: 'agree_sign_secrerycont', areas: ['secrerycontCard']},
+        'traincont': {
+            mainArea: 'agree_sign_traincont',
+            areas: ['traincontCard', 'traincontAgreeInfo', 'traincontTrainInfo', 'traincontBusinessInfo']
+        }
+    },
+    '3': {
+        'postcont': {
+            mainArea: 'agree_change_postcont',
+            areas: ['agreementCard', 'postcontCardBefore', 'postcontCardAfter']
+        },
+        'secrerycont': {
+            mainArea: 'agree_change_secrerycont',
+            areas: ['agreementCard', 'secrerycontCardBefore', 'secrerycontCardAfter']
+        },
+        'traincont': {
+            mainArea: 'agree_change_traincont',
+            areas: ['agreementCard', 'traincontCardBefore', 'traincontCardAfter']
+        }
+    },
+    '4': {
+        'postcont': {mainArea: 'agree_release_postcont', areas: ['postcontCard']},
+        'secrerycont': {mainArea: 'agree_release_secrerycont', areas: ['secrerycontCard']},
+        'traincont': {mainArea: 'agree_release_traincont', areas: ['traincontCard']}
+    },
+    '5': {
+        'postcont': {mainArea: 'agree_finish_postcont', areas: ['postcontCard']},
+        'secrerycont': {mainArea: 'agree_finish_secrerycont', areas: ['secrerycontCard']},
+        'traincont': {mainArea: 'agree_finish_traincont', areas: ['traincontCard']}
+    },
+};
+
+/**"签订":"1" "变更":"3" "解除":"4" "终止":"5" */
+export const custFormToServer = {
+    '1': {
+        pageCode: '60110501p',
+        appCode: '60110501'
+    },
+    '3': {
+        pageCode: '60110503p',
+        appCode: '60110503'
+    },
+    '4': {
+        pageCode: '60110505p',
+        appCode: '60110505'
+    },
+    '5': {
+        pageCode: '60110507p',
+        appCode: '60110507'
+    }
+};
+
+export const formToServer = {
+    cont_sign_dataCard: {
+        pageCode: '60110303p',
+        appCode: '60110303',
+        areaCode: 'dataCard'
+    },
+    cont_change_dataBase: {
+        pageCode: '60110305p',
+        appCode: '60110305',
+        areaCode: 'dataBase,dataBefore,dataAfter'
+    },
+    cont_extend_dataBase: {
+        pageCode: '60110307p',
+        appCode: '60110307',
+        areaCode: 'dataBase,dataBefore,dataAfter'
+    },
+    cont_release_card: {
+        pageCode: '60110309p',
+        appCode: '60110309',
+        areaCode: 'dataCard'
+    },
+    cont_finish_card: {
+        pageCode: '60110311p',
+        appCode: '60110311',
+        areaCode: 'dataCard'
+    },
+    agree_sign_postcont: {
+        pageCode: '60110501p',
+        appCode: '60110501',
+        areaCode: 'postcontCard'
+    },
+    agree_sign_secrerycont: {
+        pageCode: '60110501p',
+        appCode: '60110501',
+        areaCode: 'secrerycontCard'
+    },
+    agree_sign_traincont: {
+        pageCode: '60110501p',
+        appCode: '60110501',
+        areaCode: 'traincontCard'
+    },
+    agree_change_postcont: {
+        pageCode: '60110503p',
+        appCode: '60110503',
+        areaCode: 'agreementCard,postcontCardBefore,postcontCardAfter'
+    },
+    agree_change_secrerycont: {
+        pageCode: '60110503p',
+        appCode: '60110503',
+        areaCode: 'agreementCard,secrerycontCardBefore,secrerycontCardAfter'
+    },
+    agree_change_traincont: {
+        pageCode: '60110503p',
+        appCode: '60110503',
+        areaCode: 'agreementCard,traincontCardBefore,traincontCardAfter'
+    },
+    agree_release_postcont: {
+        pageCode: '60110505p',
+        appCode: '60110505',
+        areaCode: 'postcontCard'
+    },
+    agree_release_secrerycont: {
+        pageCode: '60110505p',
+        appCode: '60110505',
+        areaCode: 'secrerycontCard'
+    },
+    agree_release_traincont: {
+        pageCode: '60110505p',
+        appCode: '60110505',
+        areaCode: 'traincontCard'
+    },
+    agree_finish_postcont: {
+        pageCode: '60110507p',
+        appCode: '60110507',
+        areaCode: 'postcontCard'
+    },
+    agree_finish_secrerycont: {
+        pageCode: '60110507p',
+        appCode: '60110507',
+        areaCode: 'secrerycontCard'
+    },
+    agree_finish_traincont: {
+        pageCode: '60110507p',
+        appCode: '60110507',
+        areaCode: 'traincontCard'
+    }
+};
+
+export const formToWeb = {
+    cont_change_dataBase: ['cont_change_dataBefore', 'cont_change_dataAfter'],
+    cont_extend_dataBase: ['cont_extend_dataBefore', 'cont_extend_dataAfter']
+};
+
+// 加载业务处理模板用
+export const templateArr = [
+    {//合同签订
+        config: {
+            pagecode: '60110303p',
+            appcode: '60110303'
+        },
+        templateId: 'dataCard',
+        newId: transactionFormId.contSign
+    },
+    {//合同变更
+        config: {
+            pagecode: '60110305p',
+            appcode: '60110305'
+        },
+        templateId: ['dataBase', 'dataBefore', 'dataAfter'],
+        newId: transactionFormId.contChange
+    },
+    {//合同续签
+        config: {
+            pagecode: '60110307p',
+            appcode: '60110307'
+        },
+        templateId: ['dataBase', 'dataBefore', 'dataAfter'],
+        newId: transactionFormId.contExtend
+    },
+    {//合同解除
+        config: {
+            pagecode: '60110309p',
+            appcode: '60110309'
+        },
+        templateId: 'dataCard',
+        newId: transactionFormId.contRelease,
+    },
+    {//合同终止
+        config: {
+            pagecode: '60110311p',
+            appcode: '60110311'
+        },
+        templateId: 'dataCard',
+        newId: transactionFormId.contFinish,
+    }
+];

+ 37 - 0
src/hrcm/contractmgt/account/main/container/functions/contractTextViewAction.js

@@ -0,0 +1,37 @@
+import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';
+import nodeRefs from '../pageIns';
+export default function ContractTextViewAction() {
+    const {orgVal, contractPage, contractData, contractArea} = this.state;
+    console.log(contractArea)
+    let pk_psndoc_subs = '';
+    if (contractPage === 'main') {
+        const clickRow = this.props.table.getClickRowIndex('contractList');
+        pk_psndoc_subs = clickRow.record.values.pk_psndoc_sub.value;
+    } else {
+        pk_psndoc_subs = contractData.rows[0].values.pk_psndoc_sub.value;
+    }
+    const postData = {
+        pk_org: orgVal.refpk,
+        pk_psndoc_subs
+    };
+
+    proFetch({
+        url: '/nccloud/hrcm/templet/ContractTextViewAction.do',
+        body: postData,
+    })
+        .then((res) => {
+            if (res.success) {
+                if (!res['data']) return;
+                if (contractPage === 'main') {
+                    const clickRow = this.props.table.getClickRowIndex('contractList');
+                    nodeRefs.wpsview.openView([{data: clickRow.record}], 'ct')
+                } else {
+                    /*获取表单所有数据*/
+                    let formData = this.props.form.getAllFormValue(contractArea).rows;
+                    nodeRefs.wpsview.openView(formData, 'ct')
+                }
+                // let location = window.location;
+                // location.port ? window.open("uclient://start/http://" + location.hostname + ":" + location.port + res.data) : window.open("uclient://start/http://" + location.hostname + res.data)
+            }
+        });
+}

+ 141 - 0
src/hrcm/contractmgt/account/main/container/functions/editAgree.js

@@ -0,0 +1,141 @@
+import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';
+import handleAllpks from "./handleAllpks";
+import {agreeFormTypeMap, custFormToServer, formToServer} from "./configData";
+import {setFormAttrAndValue} from "../../../../../public/functions/checkFormAction";
+import checkBtnPermission from "./checkBtnPermission";
+
+export default function editAgree(record) {
+    const {orgVal} = this.state;
+    checkBtnPermission(record.pk_agreement.value, 'edit', 'agreement', () => {
+        proFetch({
+            url: '/nccloud/hrcm/account/EditContractAction.do',
+            body: {
+                pk_org: orgVal.refpk,
+                selectedPk: record.pk_agreement.value,
+                isContract: false
+            },
+        }).then((res) => {
+            if (res.success) {
+                setData.call(this, record)
+            }
+        })
+    })
+}
+
+function setData(record) {
+    let typeConf = agreeFormTypeMap[record.conttype.value][record.agreementtype.value];
+    const {json, orgVal} = this.state;
+    let mainArea, areas, postData;
+    if (typeConf) {
+        mainArea = typeConf.mainArea;
+        areas = typeConf.areas;
+        postData = formToServer[mainArea];
+    } else {
+        mainArea = record.agreementtype.value;
+        areas = mainArea + 'Card';
+        if (record.conttype.value === '3') {
+            areas = ['agreementCard', areas + 'Before', areas + 'After'];
+        } else {
+            areas = [areas];
+        }
+        postData = {
+            ...custFormToServer[record.conttype.value],
+            areaCode: !typeConf && record.conttype.value === '3' ? areas.join(','):  areas[0]
+        };
+    }
+    const agreeAppCode = postData.appCode;
+    postData = {
+        ...postData,
+        pk_org: orgVal.refpk,
+        pk_psndoc_sub: record.pk_agreement.value,
+        tempFlag: true,
+        isContract: false
+    };
+    proFetch({
+        url: '/nccloud/hrcm/common/QueryDataCardAction.do',
+        body: postData,
+    })
+        .then((res) => {
+            if (res.success) {
+                let template = this.props.meta.getMeta();
+                let isRadio = false;
+                areas.forEach(item => {
+                    /*if (item.indexOf('CardBefore') > -1) {
+                        res.data.template[item].items.forEach(item2 => {
+                            item2.attrcode = item2.attrcode + '_old';
+                            item2.disabled = true;
+                        });
+                    }*/
+                    const ifpropItem = res.data.template[item].items.find(item2 => item2.attrcode === 'ifprop');
+                    isRadio = ifpropItem && ifpropItem.itemtype === 'radio';
+                    template[item] = res.data.template[item];
+                });
+                const [area, ...subArea] = areas;
+                let editArea = area;
+                if (subArea.length) {
+                    template['formrelation'] = {
+                        ...(template['formrelation'] || {}),
+                        [area]: subArea
+                    };
+                    editArea = subArea[subArea.length - 1];
+                }
+                let registed = this.registed;
+                for (let key in template) {
+                    if(template.hasOwnProperty(key) && template[key].moduletype){
+                        if(!registed.includes(template[key].code)) {
+                            template[key].moduletype === 'form' && this.props.use.form(template[key].code);
+                            template[key].moduletype === 'table' && this.props.use.editTable(template[key].code);
+                        }
+                  }
+                }
+                this.props.meta.setMeta(template,()=>{
+                    if (res.data.attrMap) {
+                        setFormAttrAndValue(res.data.attrMap, res.data.valueMap, this.props, area, areas)
+                    }
+                });
+                
+                const allpks = this.props.table.getAllTableData('agreementList').rows.map(item => item.values.pk_agreement.value);
+                handleAllpks.set(allpks);
+                const areaValue = res.data.data[area];
+                if (isRadio) {
+                    if (areaValue.rows[0].values.hasOwnProperty('ifprop')) {
+                        let ifprop = areaValue.rows[0].values.ifprop.value;
+                        areaValue.rows[0].values.ifprop.value = ifprop ? 'Y' : 'N';
+                        areaValue.rows[0].values.ifprop.display = ifprop ? json['cm6011-000057'] : json['cm6011-000058'];
+                    }
+                    if (areaValue.rows[0].values.hasOwnProperty('ifprop_old')) {
+                        let ifprop_old = areaValue.rows[0].values.ifprop_old.value;
+                        areaValue.rows[0].values.ifprop_old.value = ifprop_old ? 'Y' : 'N';
+                        areaValue.rows[0].values.ifprop_old.display = ifprop_old ? json['cm6011-000057'] : json['cm6011-000058'];
+                    }
+                }
+                this.setState({
+                    agreeArea: area,
+                    agreeAllpks: allpks,
+                    agreeData: areaValue,
+                    agreeAppCode,
+                    agreementPage: 'edit',
+                    lastAgreementPage: 'main',
+                    agreeSubArea: subArea,
+                    agreePageid: res.data.template.pageid
+                }, () => {
+                    this.props.form.setAllFormValue({[area]: areaValue});
+                    this.props.form.setFormStatus(area, 'edit');
+                    /*if (areaValue.rows[0].values.hasOwnProperty('ifprop')) {
+                        //initFormMeta.call(this, 'agree', area, areaValue.rows[0].values.ifprop);
+                        if (isRadio) {
+                            let ifprop = areaValue.rows[0].values.ifprop.value;
+                            let ifprop_old = areaValue.rows[0].values.ifprop_old && areaValue.rows[0].values.ifprop_old.value;
+                            this.props.form.setFormItemsValue([area], {
+                                ifprop: {value: ifprop ? 'Y' : 'N'}, ifprop_old: {value: ifprop_old ? 'Y' : 'N'}
+                            });
+                        }
+                    }*/
+                    if (subArea.length) {
+                        subArea.forEach(item => this.props.form.openArea(item))
+                    }
+                    this.updateButtonStatus();
+                })
+            }
+        });
+}

+ 120 - 0
src/hrcm/contractmgt/account/main/container/functions/editContract.js

@@ -0,0 +1,120 @@
+import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';
+import handleAllpks from "./handleAllpks";
+import {contFormTypeMap, formToServer} from "./configData";
+import {setFormAttrAndValue} from "../../../../../public/functions/checkFormAction";
+import checkBtnPermission from "./checkBtnPermission";
+
+export default function editContract(record) {
+    const {orgVal} = this.state;
+    checkBtnPermission(record.pk_psndoc_sub.value, 'edit', 'contract', () => {
+        proFetch({
+            url: '/nccloud/hrcm/account/EditContractAction.do',
+            body: {
+                pk_org: orgVal.refpk,
+                selectedPk: record.pk_psndoc_sub.value,
+                isContract: true
+            },
+        }).then((res) => {
+            if (res.success) {
+                setData.call(this, record)
+            }
+        })
+    })
+}
+
+function setData(record) {
+    const {mainArea, areas} = contFormTypeMap[record.conttype.value];
+    const {json, orgVal} = this.state;
+    let postData = formToServer[mainArea];
+    const contAppCode = postData.appCode;
+    postData = {
+        ...postData,
+        pk_org: orgVal.refpk,
+        pk_psndoc_sub: record.pk_psndoc_sub.value,
+        tempFlag: true,
+        isContract: true
+    };
+    proFetch({
+        url: '/nccloud/hrcm/common/QueryDataCardAction.do',
+        body: postData,
+    })
+        .then((res) => {
+            if (res.success) {
+                let template = this.props.meta.getMeta();
+                let isRadio = false;
+                areas.forEach(item => {
+                    /*if (item === 'dataBefore') {
+                        res.data.template[item].items.forEach(item2 => item2.attrcode = item2.attrcode + '_old');
+                    }*/
+                    const ifpropItem = res.data.template[item].items.find(item2 => item2.attrcode === 'ifprop');
+                    isRadio = ifpropItem && ifpropItem.itemtype === 'radio';
+                    template[item] = res.data.template[item];
+                });
+                const [area, ...subArea] = areas;
+                let editArea = area;
+                if (subArea.length) {
+                    template['formrelation'] = {
+                        ...(template['formrelation'] || {}),
+                        [area]: subArea
+                    };
+                    editArea = subArea[subArea.length - 1];
+                }
+                let registed = this.registed;
+                for (let key in template) {
+                    if(template.hasOwnProperty(key) && template[key].moduletype){
+                        if(!registed.includes(template[key].code)) {
+                            template[key].moduletype === 'form' && this.props.use.form(template[key].code);
+                            template[key].moduletype === 'table' && this.props.use.editTable(template[key].code);
+                        }
+                  }
+                }
+                this.props.meta.setMeta(template,()=>{
+                    if (res.data.attrMap) {
+                        setFormAttrAndValue(res.data.attrMap, res.data.valueMap, this.props, area, areas)
+                    }
+                });
+                const allpks = this.props.table.getAllTableData('contractList').rows.map(item => item.values.pk_psndoc_sub.value);
+                handleAllpks.set(allpks);
+                const areaValue = res.data.data[area];
+                if (isRadio) {
+                    if (areaValue.rows[0].values.hasOwnProperty('ifprop')) {
+                        let ifprop = areaValue.rows[0].values.ifprop.value;
+                        areaValue.rows[0].values.ifprop.value = ifprop ? 'Y' : 'N';
+                        areaValue.rows[0].values.ifprop.display = ifprop ? json['cm6011-000057'] : json['cm6011-000058'];
+                    }
+                    if (areaValue.rows[0].values.hasOwnProperty('ifprop_old')) {
+                        let ifprop_old = areaValue.rows[0].values.ifprop_old.value;
+                        areaValue.rows[0].values.ifprop_old.value = ifprop_old ? 'Y' : 'N';
+                        areaValue.rows[0].values.ifprop_old.display = ifprop_old ? json['cm6011-000057'] : json['cm6011-000058'];
+                    }
+                }
+                this.setState({
+                    contractArea: area,
+                    contractAllpks: allpks,
+                    contractData: areaValue,
+                    contAppCode,
+                    contractPage: 'edit',
+                    lastContractPage: 'main',
+                    contractSubArea: subArea,
+                    contractPageid: res.data.template.pageid
+                }, () => {
+                    this.props.form.setAllFormValue({[area]: areaValue});
+                    this.props.form.setFormStatus(area, 'edit');
+                    /*if (areaValue.rows[0].values.hasOwnProperty('ifprop')) {
+                        //initFormMeta.call(this, 'contract', area, areaValue.rows[0].values.ifprop);
+                        if (isRadio) {
+                            let ifprop = areaValue.rows[0].values.ifprop.value;
+                            let ifprop_old = areaValue.rows[0].values.ifprop_old && areaValue.rows[0].values.ifprop_old.value;
+                            this.props.form.setFormItemsValue([area], {
+                                ifprop: {value: ifprop ? 'Y' : 'N'}, ifprop_old: {value: ifprop_old ? 'Y' : 'N'}
+                            });
+                        }
+                    }*/
+                    if (subArea.length) {
+                        subArea.forEach(item => this.props.form.openArea(item))
+                    }
+                    this.updateButtonStatus();
+                })
+            }
+        });
+}

+ 55 - 0
src/hrcm/contractmgt/account/main/container/functions/editData.js

@@ -0,0 +1,55 @@
+import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';
+import checkBtnPermission from './checkBtnPermission';
+
+export default function editData() {
+    const {tabKey, orgVal, contractArea, agreeArea, contractData, agreeData} = this.state;
+    if (tabKey === 'contract') {
+        checkBtnPermission(contractData.rows[0].values.pk_psndoc_sub.value, 'edit', 'contract', () => {
+            proFetch({
+                url: '/nccloud/hrcm/account/EditContractAction.do',
+                body: {
+                    pk_org: orgVal.refpk,
+                    selectedPk: contractData.rows[0].values.pk_psndoc_sub.value,
+                    isContract: true
+                },
+            }).then((res) => {
+                if (res.success) {
+                    this.props.form.setFormStatus(contractArea, 'edit');
+                    /*if (contractData.rows[0].values.hasOwnProperty('ifprop')) {
+                        initFormMeta.call(this, 'contract', contractArea, contractData.rows[0].values.ifprop);
+                    }*/
+                    this.setState({
+                        contractPage: 'edit',
+                        lastContractPage: 'view'
+                    }, () => {
+                        this.updateButtonStatus();
+                    })
+                }
+            })
+        })
+    } else {
+        checkBtnPermission(agreeData.rows[0].values.pk_agreement.value, 'edit', 'agreement', () => {
+            proFetch({
+                url: '/nccloud/hrcm/account/EditContractAction.do',
+                body: {
+                    pk_org: orgVal.refpk,
+                    selectedPk: agreeData.rows[0].values.pk_agreement.value,
+                    isContract: false
+                },
+            }).then((res) => {
+                if (res.success) {
+                    this.props.form.setFormStatus(agreeArea, 'edit');
+                    /*if (agreeData.rows[0].values.hasOwnProperty('ifprop')) {
+                        initFormMeta.call(this, 'agree', agreeArea, agreeData.rows[0].values.ifprop);
+                    }*/
+                    this.setState({
+                        agreementPage: 'edit',
+                        lastAgreementPage: 'view'
+                    }, () => {
+                        this.updateButtonStatus();
+                    })
+                }
+            })
+        })
+    }
+}

+ 69 - 0
src/hrcm/contractmgt/account/main/container/functions/getAgreeTableData.js

@@ -0,0 +1,69 @@
+import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';
+import {toast} from 'nc-lightapp-front';
+
+export default function getAgreeTableData(isRefresh) {
+    const {orgVal, agreeSearchModalValue, agreementPageInfo, pk_psndocList, isQueryTemplate} = this.state;
+    const {table} = this.props;
+    if (!orgVal.refpk) {
+        table.setAllTableData('agreementList', {
+            rows: []
+        });
+        this.updateButtonStatus();
+        return;
+    }
+
+    return proFetch({
+        url: '/nccloud/hrcm/account/QueryAgreementAction.do',
+        body: {
+            ...agreeSearchModalValue,
+            pk_org: orgVal.refpk,
+            isQueryTemplate,
+            areaCode: 'agreementList',
+            pageInfo: agreementPageInfo,
+            pk_psndocList,
+            isContract: false
+        },
+    }).then((res) => {
+        if (res.success) {
+            if (isRefresh) {
+                toast({color: "success", content: this.state.json['cm6011-000099']});
+            }
+            if (res.data && res.data.data && res.data.data.agreementList) {
+                table.setAllTableData('agreementList', {
+                    rows: res.data.data.agreementList.rows
+                });
+                if (res.data.data.agreementList.rows.length) {
+                    this.props.table.setClickRowIndex('agreementList', {
+                        record: res.data.data.agreementList.rows[0].values,
+                        index: 0
+                    });
+                    this.props.table.focusRowByIndex('agreementList', 0);
+                }
+                this.setState({
+                    searched: true,
+                    agreementPageInfo: res.data.data.agreementList.pageInfo || {
+                        pageSize: 10,
+                        pageIndex: 1,
+                        total: 0,
+                        totalPage: 1
+                    }
+                }, () => {
+                    this.updateButtonStatus();
+                });
+            } else {
+                table.setAllTableData('agreementList', {rows: []});
+                this.setState({
+                    searched: true,
+                    agreementPageInfo: {
+                        pageSize: 10,
+                        pageIndex: 1,
+                        total: 0,
+                        totalPage: 1
+                    }
+                }, () => {
+                    this.updateButtonStatus();
+                })
+            }
+        }
+    });
+}

+ 12 - 0
src/hrcm/contractmgt/account/main/container/functions/getAgreeTypes.js

@@ -0,0 +1,12 @@
+import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';
+
+export default function getAgreeType() {
+    return proFetch({
+        url: '/nccloud/hrcm/agreement/AgreementTypeQueryAction.do',
+        body: {},
+    }).then((res) => {
+        if (res.success) {
+            return res.data || [];
+        }
+    });
+}

+ 71 - 0
src/hrcm/contractmgt/account/main/container/functions/getConTableData.js

@@ -0,0 +1,71 @@
+import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';
+import {toast} from 'nc-lightapp-front';
+
+export default function getConTableData(isRefresh) {
+    const {orgVal, searchModalValue, contractPageInfo, queryOid} = this.state;
+    const {table} = this.props;
+    if (!orgVal.refpk) {
+        table.setAllTableData('contractList', {
+            rows: []
+        });
+        this.updateButtonStatus();
+        return;
+    }
+    //if (!queryOid) return;
+
+    return proFetch({
+        url: '/nccloud/hrcm/account/QueryContractAction.do',
+        body: {
+            ...searchModalValue,
+            pk_org: orgVal.refpk,
+            areaCode: 'contractList',
+            pageInfo: contractPageInfo,
+            isContract: true,
+            oid: queryOid
+        },
+    }).then((res) => {
+        if (res.success) {
+            if (isRefresh) {
+                toast({color: "success", content: this.state.json['cm6011-000099']});
+            }
+            if (res.data && res.data.data && res.data.data.contractList) {
+                table.setAllTableData('contractList', {
+                    rows: res.data.data.contractList.rows
+                });
+                if (res.data.data.contractList.rows.length) {
+                    this.props.table.setClickRowIndex('contractList', {
+                        record: res.data.data.contractList.rows[0].values,
+                        index: 0
+                    });
+                    this.props.table.focusRowByIndex('contractList', 0);
+                }
+                this.setState({
+                    searched: true,
+                    pk_psndocList: res.data.pk_psndocList,
+                    contractPageInfo: res.data.data.contractList.pageInfo || {
+                        pageSize: 10,
+                        pageIndex: 1,
+                        total: 0,
+                        totalPage: 1
+                    }
+                }, () => {
+                    this.updateButtonStatus();
+                });
+            } else {
+                table.setAllTableData('contractList', {rows: []});
+                this.setState({
+                    searched: true,
+                    pk_psndocList: [],
+                    contractPageInfo: {
+                        pageSize: 10,
+                        pageIndex: 1,
+                        total: 0,
+                        totalPage: 1
+                    }
+                }, () => {
+                    this.updateButtonStatus();
+                });
+            }
+        }
+    });
+}

+ 35 - 0
src/hrcm/contractmgt/account/main/container/functions/handleAllpks.js

@@ -0,0 +1,35 @@
+import {cacheTools} from 'nc-lightapp-front';
+
+function get() {
+    return cacheTools.get('allpks') || [];
+}
+
+function add(pk) {
+    let allpks = get();
+    const index = allpks.indexOf(pk);
+    if (index === -1) {
+        allpks.push(pk);
+    }
+    set(allpks);
+}
+
+function remove(pk) {
+    let allpks = get();
+    const index = allpks.indexOf(pk);
+    if (index > -1) {
+        allpks.splice(index, 1);
+    }
+    set(allpks);
+}
+
+function set(pks) {
+    cacheTools.set('allpks', pks);
+}
+
+let handleAllpks = {
+    get,
+    set,
+    add,
+    remove
+};
+export default handleAllpks;

+ 75 - 0
src/hrcm/contractmgt/account/main/container/functions/initFormMeta.js

@@ -0,0 +1,75 @@
+export default function initFormMeta(tabKey, moduleId, value) {
+    if (tabKey === 'contract') {
+        let template = this.props.meta.getMeta(), area = moduleId;
+        if (template.formrelation && template.formrelation[moduleId]) {
+            area = template.formrelation[moduleId][template.formrelation[moduleId].length - 1];
+        }
+        const hasIfprop = template[area].items.find(item => item.attrcode === 'ifprop');
+        if (!hasIfprop) return;
+        const promonth = template[area].items.find(item => item.attrcode === 'promonth');
+        const prop_unit = template[area].items.find(item => item.attrcode === 'prop_unit');
+        const probegindate = template[area].items.find(item => item.attrcode === 'probegindate');
+        const probenddate = template[area].items.find(item => item.attrcode === 'probenddate');
+        if (!value.value) {
+            promonth.required = false;
+            prop_unit.required = false;
+            probegindate.required = false;
+            probenddate.required = false;
+            this.props.meta.setMeta(template);
+            this.props.form.setFormItemsDisabled(moduleId, {
+                'promonth': true,
+                'prop_unit': true,
+                'probegindate': true,
+                'probenddate': true
+            });
+        } else {
+            promonth.required = true;
+            prop_unit.required = true;
+            probegindate.required = true;
+            probenddate.required = true;
+            this.props.meta.setMeta(template);
+            this.props.form.setFormItemsDisabled(moduleId, {
+                'promonth': false,
+                'prop_unit': false,
+                'probegindate': false,
+                'probenddate': false
+            });
+        }
+    } else {
+        let template = this.props.meta.getMeta(), area = moduleId;
+        if (template.formrelation && template.formrelation[moduleId]) {
+            area = template.formrelation[moduleId][template.formrelation[moduleId].length - 1];
+        }
+        const hasIfprop = template[area].items.find(item => item.attrcode === 'ifprop');
+        if (!hasIfprop) return;
+        const probmonth = template[area].items.find(item => item.attrcode === 'probmonth');
+        const prop_unit = template[area].items.find(item => item.attrcode === 'prop_unit');
+        const probegindate = template[area].items.find(item => item.attrcode === 'probegindate');
+        const probenddate = template[area].items.find(item => item.attrcode === 'probenddate');
+        if (!value.value) {
+            probmonth.required = false;
+            prop_unit.required = false;
+            probegindate.required = false;
+            probenddate.required = false;
+            this.props.meta.setMeta(template);
+            this.props.form.setFormItemsDisabled(moduleId, {
+                'probmonth': true,
+                'prop_unit': true,
+                'probegindate': true,
+                'probenddate': true
+            });
+        } else {
+            probmonth.required = true;
+            prop_unit.required = true;
+            probegindate.required = true;
+            probenddate.required = true;
+            this.props.meta.setMeta(template);
+            this.props.form.setFormItemsDisabled(moduleId, {
+                'probmonth': false,
+                'prop_unit': false,
+                'probegindate': false,
+                'probenddate': false
+            });
+        }
+    }
+}

+ 142 - 0
src/hrcm/contractmgt/account/main/container/functions/processTemplateData.js

@@ -0,0 +1,142 @@
+// 初始化处理template数据
+import React from "react";
+import checkBtnPermission from "./checkBtnPermission";
+import getAgreeType from '../functions/getAgreeTypes';
+
+export default async function processTemplate(template) {
+    const {json} = this.state;
+    const contractnum = template['contractList'].items.find(item => item.attrcode === 'contractnum');
+    contractnum.render = (text, record, index) => {
+        return (
+            <span
+                className="simple-table-title"
+                style={{color: '#007ace', cursor: 'pointer'}}
+                onClick={() => {
+                    this.viewContract(text, record, index);
+                }}
+            >
+                {record && record['contractnum'] && record['contractnum'].value}
+            </span>
+        );
+    };
+
+    template['contractList'].items.push({
+        attrcode: 'file',
+        itemtype: 'customer',
+        hyperlinkflag: false,
+        label: json['cm6011-000146'], /* 国际化处理: 附件管理*/
+        width: '80px',
+        textAlign: 'center',
+        visible: true,
+        fixed: 'right',
+        render: (text, record, index) => {
+            return (
+                <a style={{cursor: 'pointer'}}>
+                    <i className="icon iconfont icon-fujianshenpi" onClick={() => {
+                        checkBtnPermission(record.pk_psndoc_sub.value, 'attachment', 'contract', () => {
+                            this.fileManage(record.pk_psndoc_sub.value)
+                        })
+                    }}/>
+                </a>
+            )
+        }
+    });
+
+    template['contractList'].items.push({
+        itemtype: 'customer',
+        width: '130px',
+        label: json['cm6011-000064'],/* 国际化处理: 操作,操作*/
+        visible: true,
+        fixed: 'right',
+        attrcode: 'opr',
+        render: (text, record, index) => {
+            return (
+                record.lastflag && record.lastflag.value ? <div>
+                    <a
+                        href="javascript:void(0)"
+                        className="operator-btn"
+                        onClick={
+                            () => {
+                                this.editContract(text, record, index)
+                            }
+                        }
+                    >
+                        {json['cm6011-000067']}{/* 国际化处理: 修改*/}
+                    </a>
+                </div> : null
+            );
+        }
+    });
+    //contcode
+    const contcode = template['agreementList'].items.find(item => item.attrcode === 'contcode');
+    contcode.render = (text, record, index) => {
+        return (
+            <span
+                className="simple-table-title"
+                style={{color: '#007ace', cursor: 'pointer'}}
+                onClick={() => {
+                    this.viewAgree(text, record, index);
+                }}
+            >
+                {record && record['contcode'] && record['contcode'].value}
+            </span>
+        );
+    };
+    template['agreementList'].items.push({
+        attrcode: 'file',
+        itemtype: 'customer',
+        hyperlinkflag: false,
+        label: json['cm6011-000146'], /* 国际化处理: 附件管理*/
+        width: '80px',
+        textAlign: 'center',
+        visible: true,
+        fixed: 'right',
+        render: (text, record, index) => {
+            return (
+                <a style={{cursor: 'pointer'}}>
+                    <i className="icon iconfont icon-fujianshenpi" onClick={() => {
+                        checkBtnPermission(record.pk_agreement.value, 'attachment', 'agreement', () => {
+                            this.fileManage(record.pk_agreement.value)
+                        })
+                    }}/>
+                </a>
+            )
+        }
+    });
+    template['agreementList'].items.push({
+        itemtype: 'customer',
+        width: '130px',
+        label: json['cm6011-000064'],/* 国际化处理: 操作,操作*/
+        visible: true,
+        fixed: 'right',
+        attrcode: 'opr',
+        render: (text, record, index) => {
+            return (
+                record.lastflag && record.lastflag.value ? <div>
+                    <a
+                        href="javascript:void(0)"
+                        className="operator-btn"
+                        onClick={
+                            () => {
+                                this.editAgreement(text, record, index)
+                            }
+                        }
+                    >
+                        {json['cm6011-000067']}{/* 国际化处理: 修改*/}
+                    </a>
+                </div> : null
+            );
+        }
+    });
+
+    const agreementTypes = await getAgreeType();
+    const queryItem = template['agreementquery'].items.find(item => item.attrcode === 'hrcm_agreement.agreementtype');
+    queryItem.options = agreementTypes.map(type => {
+        return {
+            "display": type.name,
+            "value": type.code
+        }
+    });
+
+    return template;
+}

+ 22 - 0
src/hrcm/contractmgt/account/main/container/functions/resetAllpks.js

@@ -0,0 +1,22 @@
+import handleAllpks from "./handleAllpks";
+
+export default function resetAllpks(tabKey) {
+    const {contractAllpks, agreeAllpks, contractData, agreeData} = this.state;
+    if (tabKey === 'contract') {
+        handleAllpks.set(contractAllpks);
+        /*if (contractData) {
+            this.props.cardPagination.setCardPaginationId({
+                id: contractData.rows[0].values.pk_psndoc_sub.value,
+                status: 1
+            });
+        }*/
+    } else {
+        handleAllpks.set(agreeAllpks);
+        /*if (agreeData) {
+            this.props.cardPagination.setCardPaginationId({
+                id: agreeData.rows[0].values.pk_agreement.value,
+                status: 1
+            });
+        }*/
+    }
+}

+ 102 - 0
src/hrcm/contractmgt/account/main/container/functions/saveData.js

@@ -0,0 +1,102 @@
+import {hrAjax as proFetch, saveValidate} from 'src/hrpub/common/utils/utils';
+import {toast} from 'nc-lightapp-front';
+
+export default function saveData(step = '0') {
+    const {
+        lastAgreementPage, lastContractPage, tabKey, orgVal, contractArea, contractSubArea = [],
+        agreeArea, agreeSubArea = [], contractData, agreeData, json, contractPageid, agreePageid
+    } = this.state;
+    if (tabKey === 'contract') {
+        if (!this.props.form.isCheckNow(contractArea)) return;
+        saveValidate(this.props, contractPageid, contractArea, contractSubArea, 'extcard').then(() => {
+            proFetch({
+                url: '/nccloud/hrcm/account/SaveAccountAction.do',
+                body: {
+                    pk_org: orgVal.refpk,
+                    step: step,
+                    account: {
+                        model: {
+                            rows: this.props.form.getAllFormValue(contractArea).rows
+                        }
+                    },
+                    isContract: true
+                },
+            }).then((res) => {
+                if (res.success) {
+                    if (res.data.step !== '99') {
+                        this.alertModalNode.show([res.data.msg], '',
+                            () => {
+                                saveData.call(this, res.data.step)
+                            })
+                    } else {
+                        toast({color: "success", content: json['cm6011-000005']});
+                        if (lastContractPage === 'view') {
+                            this.props.form.setFormStatus(contractArea, 'browse');
+                            this.viewContract('', contractData.rows[0].values)
+                        } else {
+                            this.props.form.setFormStatus(contractArea, 'browse');
+                            this.setState({
+                                contractPage: lastContractPage,
+                                contractPageInfo: {
+                                    ...this.state.contractPageInfo,
+                                    pageIndex: 1
+                                }
+                            }, () => {
+                                this.updateButtonStatus();
+                                this.getConTableData(false);
+                            });
+                        }
+                    }
+                }
+            });
+        })
+    } else {
+        if (!this.props.form.isCheckNow(agreeArea)) return;
+        saveValidate(this.props, agreePageid, agreeArea, agreeSubArea, 'extcard').then(() => {
+            proFetch({
+                url: '/nccloud/hrcm/account/SaveAccountAction.do',
+                body: {
+                    pk_org: orgVal.refpk,
+                    step: step,
+                    account: {
+                        model: {
+                            rows: this.props.form.getAllFormValue(agreeArea).rows
+                        }
+                    },
+                    isContract: false
+                },
+            }).then((res) => {
+                if (res.success) {
+                    if (res.data.step !== '99') {
+                        this.alertModalNode.show([res.data.msg], '',
+                            () => {
+                                saveData.call(this, res.data.step)
+                            })
+                    } else {
+                        toast({color: "success", content: json['cm6011-000005']});
+                        if (lastAgreementPage === 'view') {
+                            this.props.form.setFormStatus(agreeArea, 'browse');
+                            this.viewAgree('', agreeData.rows[0].values)
+                        } else {
+                            this.props.form.setFormStatus(agreeArea, 'browse');
+                            this.setState({
+                                agreementPage: lastAgreementPage,
+                                agreementPageInfo: {
+                                    ...this.state.agreementPageInfo,
+                                    pageIndex: 1
+                                }
+                            }, () => {
+                                if (lastAgreementPage === 'main') {
+                                    this.updateButtonStatus();
+                                    this.getAgreeTableData(this.state.isQueryTemplate, false);
+                                } else {
+                                    this.updateButtonStatus();
+                                }
+                            });
+                        }
+                    }
+                }
+            });
+        })
+    }
+}

+ 65 - 0
src/hrcm/contractmgt/account/main/container/functions/setQueryMeta.js

@@ -0,0 +1,65 @@
+// 初始化处理template数据
+const unitConf = {
+    multiLang: {
+        domainName: 'uapbd',
+        currentLocale: 'zh-CN',
+        moduleId: 'refer_uapbd',
+    },
+    key: 'pk_org',
+    refType: 'tree',
+    refName: 'refer-000176', /* 国际化处理: 行政组织*/
+    placeholder: 'refer-000176', /* 国际化处理: 行政组织*/
+    refCode: 'uapbd.org.AdminOrgDefaultTreeRef',
+    queryTreeUrl: '/nccloud/riaorg/ref/AdminOrgDefaultTreeRef.do',
+    treeConfig: {name: ['refer-000002', 'refer-000003'], code: ['refcode', 'refname']}, /* 国际化处理: 编码,名称*/
+    rootNode: {refname: 'refer-000176', refpk: 'root'}, /* 国际化处理: 行政组织*/
+    isMultiSelectedEnabled: false
+};
+
+export default function setQueryMeta() {
+    let meta = this.props.meta.getMeta(), that = this,
+        tab = this.props.tabKey === 'contract' ? 'contractquery' : 'agreementquery';
+
+    meta[tab].items.forEach(item => {
+        if (item.itemtype === 'refer' && item.attrcode !== 'pk_dept') {
+            item.queryCondition = function () {
+                return {
+                    "pk_org": that.props.orgVal.refpk
+                }
+            }
+        }
+        switch (item.attrcode) {
+            case 'pk_dept':
+                unitConf.queryCondition = function () {
+                    return {
+                        keyword: item.attrcode,
+                        pk_org: that.props.orgVal.refpk,
+                        TreeRefActionExt: 'nccloud.web.hrhi.pub.sqlbuilder.OrgRefNoPowerSqlBuilder'
+                    }
+                };
+                item.isShowUnit = true;
+                item.unitProps = unitConf;
+                item.defaultUnitValue = {
+                    refpk: that.props.orgVal.refpk
+                };
+                break;
+            case 'pk_post':
+            case 'pk_org':
+                item.queryCondition = {
+                    keyword: item.attrcode,
+                    TreeRefActionExt: 'nccloud.web.hrcm.account.sqlbuilder.HRCMAccountQuerySqlBuilder'
+                };
+                break;
+            case 'hi_psndoc_ctrt.pk_conttext':
+                item.queryCondition = {
+                    keyword: item.attrcode,
+                    pk_org: that.props.orgVal.refpk,
+                    GridRefActionExt: 'nccloud.web.hrcm.account.sqlbuilder.HRCMAccountQuerySqlBuilder'
+                };
+                break;
+            default:
+                break;
+        }
+    });
+    this.props.meta.setMeta(meta);
+}

+ 47 - 0
src/hrcm/contractmgt/account/main/container/functions/tempPrint.js

@@ -0,0 +1,47 @@
+import {toast, print} from 'nc-lightapp-front';
+
+export default function tempPrint() {
+    const {tabKey, json} = this.state;
+    if (tabKey === 'contract') {
+        let oids = this.props.table.getCheckedRows('contractList')
+            .map(item => item.data.values.pk_psndoc_sub.value);
+        if (!oids.length) {
+            oids = [this.props.table.getClickRowIndex('contractList').record.pk_psndoc_sub.value];
+        }
+        print(
+            'pdf',
+            // 修改url
+            '/nccloud/hrcm/account/ContractBatchPrintAction.do',
+            {
+                funcode: '60110301',
+                nodekey: '6011center',
+                oids
+            }
+        );
+    } else {
+        let rows = this.props.table.getCheckedRows('agreementList'), type = '', oids = [];
+        if (!rows.length) {
+            rows = [this.props.table.getClickRowIndex('agreementList')];
+            type = rows[0].record.agreementtype.value;
+            oids = [rows[0].record.pk_agreement.value]
+        } else {
+            type = rows[0].data.values.agreementtype.value;
+            const flag = rows.findIndex(row => row.data.values.agreementtype.value !== type);
+            if (flag > -1) {
+                toast({color: 'danger', content: json['cm6011-000105']});
+                return;
+            }
+            oids = rows.map(item => item.data.values.pk_agreement.value);
+        }
+        print(
+            'pdf',
+            // 修改url
+            '/nccloud/hrcm/account/AgreementBatchPrintAction.do',
+            {
+                funcode: '60110315',
+                nodekey: type,
+                oids
+            }
+        );
+    }
+}

+ 11 - 0
src/hrcm/contractmgt/account/main/container/functions/toggleModalVisible.js

@@ -0,0 +1,11 @@
+
+// 切换各种弹窗显示隐藏的函数
+export default function toggleModal(type, visible) {
+
+    return () => {
+        this.setState({
+            [type]: visible
+        });
+    }
+    
+}

+ 45 - 0
src/hrcm/contractmgt/account/main/container/functions/updateButtonStatus.js

@@ -0,0 +1,45 @@
+// 初始化按钮状态
+
+export default function updateButtonStatus() {
+    const {
+        tabKey, orgVal, contractPage, contractPageInfo,
+        agreementPage, agreementPageInfo, searched
+    } = this.state;
+
+    const orgFlag = !!orgVal.refpk;
+    if (!orgFlag) {
+        if (tabKey !== 'contract' || contractPage !== 'main' || agreementPage !== 'main') {
+            this.setState({
+                tabKey: 'contract',
+                contractPage: 'main',
+                agreementPage: 'main'
+            })
+        }
+    }
+    const isEdit = (tabKey === 'contract' && contractPage === 'edit') || (tabKey === 'agreement' && agreementPage === 'edit');
+    const isView = (tabKey === 'contract' && contractPage === 'view') || (tabKey === 'agreement' && agreementPage === 'view');
+    this.props.button.setButtonVisible({
+        query: orgFlag && !isEdit && !isView,
+        refresh: orgFlag && !isEdit && !isView,
+        edit: isView,
+        browse: isView,
+        viewbooklet: orgFlag && tabKey === 'contract' && !isEdit && !isView,
+        viewAgree: orgFlag && tabKey === 'agreement' && !isEdit && !isView,
+        file: isView,
+        export: orgFlag && !isEdit && !isView,
+        print: orgFlag && !isEdit && !isView,
+        tempPrint: orgFlag && !isEdit && !isView,
+        save: orgFlag && isEdit && !isView,
+        cancel: orgFlag && isEdit && !isView
+    });
+
+    const contFlag = tabKey === 'contract' && contractPageInfo.total === 0;
+    const agreeFlag = tabKey === 'agreement' && agreementPageInfo.total === 0;
+    this.props.button.setButtonDisabled({
+        viewbooklet: contFlag,
+        viewAgree: agreeFlag,
+        export: agreeFlag || contFlag,
+        print: agreeFlag || contFlag,
+        tempPrint: agreeFlag || contFlag
+    });
+}

+ 136 - 0
src/hrcm/contractmgt/account/main/container/functions/viewAgree.js

@@ -0,0 +1,136 @@
+import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';
+import handleAllpks from "./handleAllpks";
+import {agreeFormTypeMap, formToServer, custFormToServer} from "./configData";
+import {setFormAttrAndValue} from "../../../../../public/functions/checkFormAction";
+
+export default function viewAgree(record) {
+    let typeConf = agreeFormTypeMap[record.conttype.value][record.agreementtype.value];
+    const {json, orgVal} = this.state;
+    let mainArea, areas, postData;
+    if (typeConf) {
+        mainArea = typeConf.mainArea;
+        areas = typeConf.areas;
+        postData = formToServer[mainArea];
+    } else {
+        /**
+         * 和后台约定:
+         * 自定义类型表单区域名称为协议类型+Card
+         * 如果是协议变更,则需要有变更前变更后,命名规则为协议类型+Card+Before和After
+         * 如果出错,找后端确认命名是否规范
+         */
+        mainArea = record.agreementtype.value;
+        areas = mainArea + 'Card';
+        if (record.conttype.value === '3') {
+            areas = ['agreementCard', areas + 'Before', areas + 'After'];
+        } else {
+            areas = [areas];
+        }
+        postData = {
+            ...custFormToServer[record.conttype.value],
+            areaCode: !typeConf && record.conttype.value === '3' ? areas.join(','):  areas[0]
+        };
+    }
+    const agreeAppCode = postData.appCode;
+    postData = {
+        ...postData,
+        pk_org: orgVal.refpk,
+        pk_psndoc_sub: record.pk_agreement.value,
+        tempFlag: true,
+        isContract: false
+    };
+    proFetch({
+        url: '/nccloud/hrcm/common/QueryDataCardAction.do',
+        body: postData,
+    })
+        .then((res) => {
+            if (res.success) {
+                this.setState({
+                        agreeArea: ''
+                    }, () => {
+                        const allpks = this.props.table.getAllTableData('agreementList').rows.map(item => item.values.pk_agreement.value);
+                        handleAllpks.set(allpks);
+                        let template = this.props.meta.getMeta();
+                        let isRadio = false;
+                        areas.forEach(item => {
+                            /*if (item.indexOf('CardBefore') > -1) {
+                                res.data.template[item].items.forEach(item2 => {
+                                    item2.attrcode = item2.attrcode + '_old';
+                                    item2.disabled = true;
+                                })
+                            }*/
+                            const ifpropItem = res.data.template[item].items.find(item2 => item2.attrcode === 'ifprop');
+                            isRadio = ifpropItem && ifpropItem.itemtype === 'radio';
+                            template[item] = res.data.template[item];
+                        });
+                        const [area, ...subArea] = areas;
+                        let editArea = area;
+                        if (subArea.length) {
+                            template['formrelation'] = {
+                                ...(template['formrelation'] || {}),
+                                [area]: subArea
+                            };
+                            editArea = subArea[subArea.length - 1];
+                        }
+                        let registed = this.registed;
+                        for (let key in template) {
+                            if(template.hasOwnProperty(key) && template[key].moduletype){
+                                if(!registed.includes(template[key].code)) {
+                                    template[key].moduletype === 'form' && this.props.use.form(template[key].code);
+                                    template[key].moduletype === 'table' && this.props.use.editTable(template[key].code);
+                                }
+                          }
+                        }
+                        this.props.meta.setMeta(template,()=>{
+                            if (res.data.attrMap) {
+                                setFormAttrAndValue(res.data.attrMap, res.data.valueMap, this.props, area, areas)
+                            }
+                        });
+                        const areaValue = res.data.data[area];
+                        if (isRadio) {
+                            if (areaValue.rows[0].values.hasOwnProperty('ifprop')) {
+                                let ifprop = areaValue.rows[0].values.ifprop.value;
+                                areaValue.rows[0].values.ifprop.value = ifprop ? 'Y' : 'N';
+                                areaValue.rows[0].values.ifprop.display = ifprop ? json['cm6011-000057'] : json['cm6011-000058'];
+                            }
+                            if (areaValue.rows[0].values.hasOwnProperty('ifprop_old')) {
+                                let ifprop_old = areaValue.rows[0].values.ifprop_old.value;
+                                areaValue.rows[0].values.ifprop_old.value = ifprop_old ? 'Y' : 'N';
+                                areaValue.rows[0].values.ifprop_old.display = ifprop_old ? json['cm6011-000057'] : json['cm6011-000058'];
+                            }
+                        }
+                        this.setState({
+                            agreeArea: area,
+                            agreeAllpks: allpks,
+                            agreeData: areaValue,
+                            agreeAppCode,
+                            agreementPage: 'view',
+                            agreeSubArea: subArea,
+                            agreePageid: res.data.template.pageid
+                        }, () => {
+                            this.props.form.setAllFormValue({[area]: areaValue});
+                            /*if (isRadio && areaValue.rows[0].values.hasOwnProperty('ifprop')) {
+                                let ifprop = areaValue.rows[0].values.ifprop.value;
+                                let ifprop_old = areaValue.rows[0].values.ifprop_old && areaValue.rows[0].values.ifprop_old.value;
+                                this.props.form.setFormItemsValue([area], {
+                                    ifprop: {value: ifprop ? 'Y' : 'N'}, ifprop_old: {value: ifprop_old ? 'Y' : 'N'}
+                                });
+                            }*/
+                            if (subArea && subArea.length) {
+                                subArea.forEach(item => this.props.form.openArea(item))
+                            }
+                            this.updateButtonStatus();
+                            if (areaValue.rows[0].values.lastflag && areaValue.rows[0].values.lastflag.value) {
+                                this.props.button.setButtonDisabled({
+                                    edit: false
+                                });
+                            } else {
+                                this.props.button.setButtonDisabled({
+                                    edit: true
+                                });
+                            }
+                        })
+                    }
+                )
+            }
+        });
+}

+ 111 - 0
src/hrcm/contractmgt/account/main/container/functions/viewContract.js

@@ -0,0 +1,111 @@
+import {hrAjax as proFetch} from 'src/hrpub/common/utils/utils';
+import handleAllpks from "./handleAllpks";
+import {formToServer, contFormTypeMap,test} from './configData';
+import {setFormAttrAndValue} from "../../../../../public/functions/checkFormAction";
+
+export default function viewContract(record) {
+    const {mainArea, areas} = contFormTypeMap[record.conttype.value];
+    const {json, orgVal} = this.state;
+    let postData = formToServer[mainArea];
+    const contAppCode = postData.appCode;
+    postData = {
+        ...postData,
+        pk_org: orgVal.refpk,
+        pk_psndoc_sub: record.pk_psndoc_sub.value,
+        tempFlag: true,
+        isContract: true
+    };
+    proFetch({
+        url: '/nccloud/hrcm/common/QueryDataCardAction.do',
+        body: postData,
+    })
+        .then((res) => {
+            if (res.success) {
+                this.setState({
+                        contractArea: ''
+                    }, () => {
+                        const allpks = this.props.table.getAllTableData('contractList').rows.map(item => item.values.pk_psndoc_sub.value);
+                        handleAllpks.set(allpks);
+                        let template = this.props.meta.getMeta();
+                        let isRadio = false;
+                        areas.forEach(item => {
+                            /*if (item === 'dataBefore') {
+                                res.data.template[item].items.forEach(item2 => item2.attrcode = item2.attrcode + '_old')
+                            }*/
+                            const ifpropItem = res.data.template[item].items.find(item2 => item2.attrcode === 'ifprop');
+                            isRadio = ifpropItem && ifpropItem.itemtype === 'radio';
+                            template[item] = res.data.template[item];
+                        });
+                        const [area, ...subArea] = areas;
+                        let editArea = area;
+                        if (subArea.length) {
+                            template['formrelation'] = {
+                                ...(template['formrelation'] || {}),
+                                [area]: subArea
+                            };
+                            editArea = subArea[subArea.length - 1];
+                        }
+                        let registed = this.registed;
+                        for (let key in template) {
+                            if(template.hasOwnProperty(key) && template[key].moduletype){
+                                if(!registed.includes(template[key].code)) {
+                                    template[key].moduletype === 'form' && this.props.use.form(template[key].code);
+                                    template[key].moduletype === 'table' && this.props.use.editTable(template[key].code);
+                                }
+                          }
+                        }
+                        this.props.meta.setMeta(template,()=>{
+                            if (res.data.attrMap) {
+                                setFormAttrAndValue(res.data.attrMap, res.data.valueMap, this.props, area, areas)
+                            }
+                        });
+                        
+                        const areaValue = res.data.data[area];
+                        if (isRadio) {
+                            if (areaValue.rows[0].values.hasOwnProperty('ifprop')) {
+                                let ifprop = areaValue.rows[0].values.ifprop.value;
+                                areaValue.rows[0].values.ifprop.value = ifprop ? 'Y' : 'N';
+                                areaValue.rows[0].values.ifprop.display = ifprop ? json['cm6011-000057'] : json['cm6011-000058'];
+                            }
+                            if (areaValue.rows[0].values.hasOwnProperty('ifprop_old')) {
+                                let ifprop_old = areaValue.rows[0].values.ifprop_old.value;
+                                areaValue.rows[0].values.ifprop_old.value = ifprop_old ? 'Y' : 'N';
+                                areaValue.rows[0].values.ifprop_old.display = ifprop_old ? json['cm6011-000057'] : json['cm6011-000058'];
+                            }
+                        }
+                        this.setState({
+                            contractArea: area,
+                            contractAllpks: allpks,
+                            contractData: areaValue,
+                            contAppCode,
+                            contractPage: 'view',
+                            contractSubArea: subArea,
+                            contractPageid: res.data.template.pageid
+                        }, () => {
+                            this.props.form.setAllFormValue({[area]: areaValue});
+                            /*if (isRadio && areaValue.rows[0].values.hasOwnProperty('ifprop')) {
+                                let ifprop = areaValue.rows[0].values.ifprop.value;
+                                let ifprop_old = areaValue.rows[0].values.ifprop_old && areaValue.rows[0].values.ifprop_old.value;
+                                this.props.form.setFormItemsValue([area], {
+                                    ifprop: {value: ifprop ? 'Y' : 'N'}, ifprop_old: {value: ifprop_old ? 'Y' : 'N'}
+                                });
+                            }*/
+                            if (subArea && subArea.length) {
+                                subArea.forEach(item => this.props.form.openArea([area],item))
+                            }
+                            this.updateButtonStatus();
+                            if (areaValue.rows[0].values.lastflag && areaValue.rows[0].values.lastflag.value) {
+                                this.props.button.setButtonDisabled({
+                                    edit: false
+                                });
+                            } else {
+                                this.props.button.setButtonDisabled({
+                                    edit: true
+                                });
+                            }
+                        })
+                    }
+                )
+            }
+        });
+}

+ 410 - 0
src/hrcm/contractmgt/account/main/container/index.js

@@ -0,0 +1,410 @@
+import React, {Component} from 'react';
+import './index.less';
+import {base, high} from 'nc-lightapp-front';
+import Header from '../components/Header';
+import SearchModal from '../components/SearchModal';
+import AgreeSearchModal from '../components/AgreeSearchModal';
+import getConTableData from './functions/getConTableData';
+import getAgreeTableData from './functions/getAgreeTableData';
+import ContractDetail from '../components/ContractDetail';
+import ContractTable from '../components/ContractTable';
+import AgreementDetail from '../components/AgreementDetail';
+import AgreementTable from '../components/AgreementTable';
+import toggleModal from './functions/toggleModalVisible';
+import updateButtonStatus from './functions/updateButtonStatus';
+import EmptyImg from 'src/hrpub/common/components/emptyImg';
+import processTemplate from './functions/processTemplateData';
+import saveData from './functions/saveData';
+import cancelEdit from './functions/cancelEdit';
+import editData from './functions/editData';
+import editAgree from './functions/editAgree';
+import editContract from './functions/editContract';
+import viewAgree from './functions/viewAgree';
+import viewContract from './functions/viewContract';
+import resetAllpks from './functions/resetAllpks';
+import tempPrint from './functions/tempPrint';
+import Uploader from "../components/Uploader";
+import AlertModal from "../components/AlertModal";
+import ContractTextViewAction from './functions/contractTextViewAction';
+import AgreeTextViewAction from './functions/agreeTextViewAction';
+import checkBtnPermission from "./functions/checkBtnPermission";
+import {getAppPageConfig, handleHash} from "src/hrpub/common/utils/utils";
+import WpsModal from 'src/hrpub/common/components/wpsPreModel';
+import nodeRefs from './pageIns';
+const {NCTabs} = base;
+const NCTabPane = NCTabs.NCTabPane;
+
+@handleHash('2019822191712119', '/ifr?page=20198162232323&c=60110315&p=60110315p&ar=0001Z700APPN60110315')
+
+class Account extends Component {
+    constructor(props) {
+        super(props);
+        this.registed = ['dataCard', 'dataBefore', 'dataAfter', 'dataBase', 'postcontCard', 'secrerycontCard', 'traincontCard', 'agreementCard', 'postcontCardBefore', 'postcontCardAfter', 'secrerycontCardBefore', 'secrerycontCardAfter', 'traincontCardBefore', 'traincontCardAfter', 
+        'traincontAgreeInfo', 'traincontTrainInfo', 'traincontBusinessInfo', 'agreementList', 'contractList']
+        if (props.use) {
+            props.use.form('dataCard', 'dataBefore', 'dataAfter', 'dataBase', 'postcontCard', 'secrerycontCard', 'traincontCard', 'agreementCard', 'postcontCardBefore', 'postcontCardAfter', 'secrerycontCardBefore', 'secrerycontCardAfter', 'traincontCardBefore', 'traincontCardAfter', 'traincontAgreeInfo', 'traincontTrainInfo', 'traincontBusinessInfo')
+            props.use.table('agreementList', 'contractList')
+            props.use.search('contractquery', 'agreementquery')
+        }
+        this.config = getAppPageConfig();
+        this.state = {
+            tabKey: 'contract',
+            orgVal: {},
+            json: {},
+            contractPage: 'main',
+            lastContractPage: 'main',
+            contractAllpks: '',
+            contractPageInfo: {
+                pageSize: 10,
+                pageIndex: 1,
+                total: 0,
+                totalPage: 1
+            },
+            contractArea: '',
+            agreementPage: 'main',
+            lastAgreementPage: 'main',
+            agreeArea: '',
+            agreeAllpks: '',
+            agreementPageInfo: {
+                pageSize: 10,
+                pageIndex: 1,
+                total: 0,
+                totalPage: 1
+            },
+            searched: false,
+            pk_psndocList: [],
+            isQueryTemplate: false,
+            showUploader: false,
+            contractData: null,
+            agreeData: null,
+            psndoc: '',
+            agreeAppCode: '',
+            contAppCode: '',
+            searchModalValue: {
+                logic: 'and',
+                conditions: []
+            }
+        };
+
+        props.MultiInit.getMultiLang({
+            moduleId: 'cm6011', domainName: 'hrcm', callback: (json, status, inlt) => {
+                if (status) {
+                    this.setState({json, inlt}, () => {
+                        props.createUIDom(this.config, async (data) => {
+                            this.setState({
+                                buttons: data.button || [],
+                                context: data.context || {},
+                                queryOid: data.template.contractquery.oid,
+                                agreeQueryOid: data.template.agreementquery.oid
+                            });
+                            data.template = await processTemplate.call(this, data.template);
+                            let temp = data.template
+                            for (let key in temp) {
+                                if(temp.hasOwnProperty(key) && temp[key].moduletype){
+                                    if(!this.registed.includes(temp[key].code)) {
+                                        temp[key].moduletype === 'form' && props.use.form(temp[key].code);
+                                        temp[key].moduletype === 'table' && props.use.editTable(temp[key].code);
+                                        this.registed.push(temp[key].code);
+                                    }
+                              }
+                            }
+                            props.meta.setMeta(data && data.template ? data.template : {});
+                            props.button.setButtons(data && data.button ? data.button : {});
+                            this.updateButtonStatus();
+                            //this.getConTableData();
+                        });
+                    })//存json和inlt到页面state中并刷新页面
+                }
+            }
+        });
+        this.updateState = this.updateState.bind(this);
+        this.toggleModal = this.toggleModal.bind(this);
+        this.tabChange = this.tabChange.bind(this);
+        this.updateOrgValue = this.updateOrgValue.bind(this);
+        this.getConTableData = this.getConTableData.bind(this);
+        this.getAgreeTableData = this.getAgreeTableData.bind(this);
+        this.refresh = this.refresh.bind(this);
+        this.editContract = this.editContract.bind(this);
+        this.editAgreement = this.editAgreement.bind(this);
+        this.viewContract = this.viewContract.bind(this);
+        this.viewAgree = this.viewAgree.bind(this);
+        this.updateButtonStatus = this.updateButtonStatus.bind(this);
+        this.cancel = this.cancel.bind(this);
+        this.save = this.save.bind(this);
+        this.edit = this.edit.bind(this);
+        this.viewbooklet = this.viewbooklet.bind(this);
+        this.viewAgreeText = this.viewAgreeText.bind(this);
+        this.tempPrint = this.tempPrint.bind(this);
+        this.checkFileManage = this.checkFileManage.bind(this);
+    }
+
+    componentDidMount() {
+        if (window.location.href.match('localhost:3006'))
+            window.location.hash = '#/ifr?page=2019822191712119'
+    }
+
+    updateOrgValue(value) {
+        this.setState({orgVal: value},
+            () => {
+                if (this.state.searched) {
+                    this.getConTableData();
+                    this.getAgreeTableData();
+                } else {
+                    this.getConTableData();
+                }
+            }
+        );
+    }
+
+    updateState(data, callback = () => {
+    }) {
+        this.setState(data, callback);
+    }
+
+    getConTableData(isRefresh) {
+        getConTableData.call(this, isRefresh);
+    }
+
+    getAgreeTableData(isQueryTemplate, isRefresh) {
+        this.setState({
+            isQueryTemplate: !!isQueryTemplate
+        }, () => {
+            getAgreeTableData.call(this, isRefresh);
+        })
+    }
+
+    updateButtonStatus() {
+        updateButtonStatus.call(this);
+    }
+
+    // 切换各种弹窗显示隐藏,type为弹窗的显示隐藏state的key值
+    toggleModal(type, visible) {
+        return toggleModal.call(this, type, visible);
+    }
+
+    tabChange(tabKey) {
+        resetAllpks.call(this, tabKey);
+        this.setState({
+            tabKey
+        }, () => {
+            if (tabKey === 'agreement' && this.state.searched && this.state.agreementPage === 'main') {
+                const {agreementPageInfo} = this.state;
+                this.setState({
+                    agreementPageInfo: {
+                        ...agreementPageInfo,
+                        pageIndex: 1
+                    }
+                }, () => {
+                    this.getAgreeTableData(true)
+                })
+            }
+            this.updateButtonStatus();
+        });
+    }
+
+    refresh() {
+        if (!this.state.searched) return;
+        if (this.state.tabKey === 'contract') {
+            this.setState({
+                contractPageInfo: {
+                    ...this.state.contractPageInfo,
+                    pageIndex: 1
+                }
+            }, () => {
+                this.getConTableData(true);
+            })
+        } else {
+            this.setState({
+                agreementPageInfo: {
+                    ...this.state.agreementPageInfo,
+                    pageIndex: 1
+                }
+            }, () => {
+                this.getAgreeTableData(this.state.isQueryTemplate, true);
+            })
+        }
+    }
+
+    edit() {
+        editData.call(this);
+    }
+
+    editContract(text, record) {
+        editContract.call(this, record);
+    }
+
+    editAgreement(text, record) {
+        editAgree.call(this, record);
+    }
+
+    viewContract(text, record) {
+        viewContract.call(this, record);
+    }
+
+    viewAgree(text, record) {
+        viewAgree.call(this, record);
+    }
+
+    save() {
+        saveData.call(this);
+    }
+
+    cancel() {
+        cancelEdit.call(this);
+    }
+
+    viewbooklet() {
+        ContractTextViewAction.call(this);
+    }
+
+    viewAgreeText() {
+        AgreeTextViewAction.call(this);
+    }
+
+    checkFileManage() {
+        const {tabKey, contractData, agreeData} = this.state;
+        checkBtnPermission(tabKey === 'contract' ? contractData.rows[0].values.pk_psndoc_sub.value : agreeData.rows[0].values.pk_agreement.value,
+            'attachment', tabKey, () => {
+                this.setState({
+                    showUploader: true
+                })
+            })
+    }
+
+    fileManage(psndoc) {
+        this.setState({
+            psndoc,
+            showUploader: true
+        })
+    }
+
+    tempPrint() {
+        tempPrint.call(this);
+    }
+
+    render() {
+        const {
+            orgVal, tabKey, contractPage, agreementPage, showUploader, json, psndoc,
+            contractArea, contractData, agreeArea, agreeData, isQueryTemplate,
+            contractPageInfo, agreementPageInfo, queryOid, agreeQueryOid,
+            agreeAppCode, contAppCode
+        } = this.state;
+        const {table} = this.props;
+        const isEdit = contractPage === 'edit' || agreementPage === 'edit';
+        return (
+            <div className="entry-staff-query nc-bill-card">
+                <Header
+                    {...this.props}
+                    tabKey={tabKey}
+                    isEdit={isEdit}
+                    orgVal={orgVal}
+                    json={json}
+                    updateState={this.updateState}
+                    updateOrgValue={this.updateOrgValue}
+                    refresh={this.refresh}
+                    save={this.save}
+                    cancel={this.cancel}
+                    edit={this.edit}
+                    viewbooklet={this.viewbooklet}
+                    viewAgreeText={this.viewAgreeText}
+                    tempPrint={this.tempPrint}
+                    checkFileManage={this.checkFileManage}
+                />
+                <div className="entry-staff-query-content">
+                    {!orgVal.refpk ?
+                        <EmptyImg text={json['cm6011-000035']}/> :
+                        <NCTabs
+                            navtype="turn"
+                            contenttype="moveleft"
+                            tabBarPosition="top"
+                            activeKey={tabKey}
+                            onChange={this.tabChange}
+                        >
+                            <NCTabPane tab={json['cm6011-000068']} key={'contract'}>{/* 国际化处理: 合同信息*/}
+                                <div style={{display: contractPage === 'main' ? '' : 'none'}}>
+                                    <ContractTable
+                                        table={table}
+                                        updateState={this.updateState}
+                                        pageInfo={contractPageInfo}
+                                        getConTableData={this.getConTableData}
+                                        view={this.viewContract}
+                                    />
+                                </div>
+                                {contractPage === 'main' ? null :
+                                    <ContractDetail
+                                        {...this.props}
+                                        orgVal={orgVal}
+                                        page={contractPage}
+                                        areaCode={contractArea}
+                                        data={contractData}
+                                        appCode={contAppCode}
+                                        view={this.viewContract}
+                                        updateState={this.updateState}
+                                        updateButton={this.updateButtonStatus}/>}
+                            </NCTabPane>
+                            <NCTabPane tab={json['cm6011-000069']} key={'agreement'}>{/* 国际化处理: 协议信息*/}
+                                <div style={{display: agreementPage === 'main' ? '' : 'none'}}>
+                                    <AgreementTable
+                                        table={table}
+                                        isQueryTemplate={isQueryTemplate}
+                                        updateState={this.updateState}
+                                        view={this.viewAgree}
+                                        pageInfo={agreementPageInfo}
+                                        getAgreeTableData={this.getAgreeTableData}/>
+                                </div>
+                                {agreementPage === 'main' ? null :
+                                    <AgreementDetail
+                                        {...this.props}
+                                        orgVal={orgVal}
+                                        page={agreementPage}
+                                        pageInfo={agreementPageInfo}
+                                        areaCode={agreeArea}
+                                        data={agreeData}
+                                        appCode={agreeAppCode}
+                                        isQueryTemplate={isQueryTemplate}
+                                        view={this.viewAgree}
+                                        updateState={this.updateState}
+                                        updateButton={this.updateButtonStatus}
+                                        getAgreeTableData={this.getAgreeTableData}
+                                    />}
+                            </NCTabPane>
+                        </NCTabs>}
+                </div>
+
+                <SearchModal {...this.props}
+                             json={json}
+                             queryOid={queryOid}
+                             pageInfo={contractPageInfo}
+                             updateState={this.updateState}
+                             getConTableData={this.getConTableData}/>
+
+                <AgreeSearchModal {...this.props}
+                                  json={json}
+                                  queryOid={agreeQueryOid}
+                                  pageInfo={agreementPageInfo}
+                                  updateState={this.updateState}
+                                  getAgreeTableData={this.getAgreeTableData}/>
+
+                <AlertModal ref={node => this.alertModalNode = node} json={json}/>
+
+                {showUploader && <Uploader
+                    tabKey={tabKey}
+                    json={json}
+                    psndoc={psndoc}
+                    contractPage={contractPage}
+                    contractData={contractData}
+                    agreeData={agreeData}
+                    agreementPage={agreementPage}
+                    onClose={this.toggleModal('showUploader', false)}/>}
+                     <WpsModal
+                        {...this.props}
+                        onRef ={ref => nodeRefs.wpsview = ref}
+                        appcode={getAppPageConfig().appcode}
+                        pk_org={orgVal}
+                   />
+            </div>
+        );
+    }
+}
+
+export default Account;

+ 55 - 0
src/hrcm/contractmgt/account/main/container/index.less

@@ -0,0 +1,55 @@
+.entry-staff-query {
+    //background: #ffffff;
+    height: 100%;
+    .entry-staff-query-content {
+        height: calc(~"100% - 46px");
+        position: relative;
+        background-color: #fff;
+        .nc-tabs{
+          height: 100%;
+          .wui-tabs.wui-tabs-top.wui-tabs-simple.lightapp-component-tabs{
+            height: 100%;
+          }
+        }
+
+    }
+    .operator-btn {
+        text-decoration: none;
+        margin-right: 15px;
+        &:last-child {
+            margin-right: 0;
+        }
+    }
+    .cardPagination-lightapp-component {
+        position: absolute;
+        right: 20px;
+    }
+}
+
+// 查询弹窗
+.NC_searchAdvModalBox{
+    .rightArea{
+      .wui-tabs.wui-tabs-top.wui-tabs-simple.lightapp-component-tabs{
+        .wui-tabs-content{
+          height: calc(~'100% - 40px')!important;
+          &>div{
+            height: 100%;
+            &>div{
+              height: 100%;
+              .normalArea,.superArea{
+                position: relative;
+                // height: calc(~'100% - 270px');
+                height: 234px !important;
+                // overflow: hidden;
+                overflow-y: auto;
+                .NC_searchAdvComBox{
+                  height: 100%;
+                  overflow-y: auto;
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }

+ 3 - 0
src/hrcm/contractmgt/account/main/container/pageIns.js

@@ -0,0 +1,3 @@
+export default {
+    wpsview: null
+}

+ 98 - 0
src/hrcm/contractmgt/account/main/index.js

@@ -0,0 +1,98 @@
+/**
+ * Created by guobaogang on 2019-2-25.
+ */
+import React, {Component} from 'react';
+import ReactDOM from 'react-dom';
+import 'src/hrpub/common/static/fonts/iconfont.css'
+import {createPage} from 'nc-lightapp-front';
+
+import HomePage from './container';
+import {handleHash,getAppPageConfig} from "src/hrpub/common/utils/utils";
+const appcode = getAppPageConfig().appcode, pagecode = getAppPageConfig().pagecode;
+// const appcode ='60110315', pagecode = '60110315p';
+let Account = handleHash('2019', `c=${appcode}&p=${pagecode}`)(createPage({
+    billinfo: [{
+        billtype: 'grid',
+        pagecode: appcode,
+        bodycode: 'contractList'
+    }, {
+        billtype: 'grid',
+        pagecode: appcode,
+        bodycode: 'agreementList'
+    }, {
+        billtype: 'form',
+        pagecode: '60110303',
+        headcode: 'dataCard'
+    }, {
+        billtype: 'extcard',
+        pagecode: '60110305',
+        headcode: 'dataBase',
+        bodycode: ['dataBefore', 'dataAfter']
+    }, {
+        billtype: 'extcard',
+        pagecode: '60110307',
+        headcode: 'dataBase',
+        bodycode: ['dataBefore', 'dataAfter']
+    }, {
+        billtype: 'form',
+        pagecode: '60110309',
+        headcode: 'dataCard'
+    }, {
+        billtype: 'form',
+        pagecode: '60110311',
+        headcode: 'dataCard'
+    }, {
+        billtype: 'form',
+        pagecode: '60110501',
+        headcode: 'postcontCard'
+    }, {
+        billtype: 'form',
+        pagecode: '60110501',
+        headcode: 'secrerycontCard'
+    }, {
+        billtype: 'form',
+        pagecode: '60110501',
+        headcode: 'traincontCard'
+    }, {
+        billtype: 'extcard',
+        pagecode: '60110503',
+        headcode: 'agreementCard',
+        bodycode: ['postcontCardBefore', 'postcontCardAfter']
+    }, {
+        billtype: 'extcard',
+        pagecode: '60110503',
+        headcode: 'agreementCard',
+        bodycode: ['secrerycontCardBefore', 'secrerycontCardAfter']
+    }, {
+        billtype: 'extcard',
+        pagecode: '60110503',
+        headcode: 'agreementCard',
+        bodycode: ['traincontCardBefore', 'traincontCardAfter']
+    }, {
+        billtype: 'form',
+        pagecode: '60110505',
+        headcode: 'postcontCard'
+    }, {
+        billtype: 'form',
+        pagecode: '60110505',
+        headcode: 'secrerycontCard'
+    }, {
+        billtype: 'form',
+        pagecode: '60110505',
+        headcode: 'traincontCard'
+    }, {
+        billtype: 'form',
+        pagecode: '60110507',
+        headcode: 'postcontCard'
+    }, {
+        billtype: 'form',
+        pagecode: '60110507',
+        headcode: 'secrerycontCard'
+    }, {
+        billtype: 'form',
+        pagecode: '60110507',
+        headcode: 'traincontCard'
+    }]
+})(HomePage));
+ReactDOM.render(<Account/>,
+    document.querySelector('#app'));

+ 30 - 0
src/hrcm/contractmgt/center/components/Header/functions/ChangeCenterAction.js

@@ -0,0 +1,30 @@
+import proFetch from "../../../../../public/functions/project-fetch";
+
+/**
+ * 合同变更
+ * @param pk_org
+ * @param psnjobs  合同主键已‘,’分隔
+ * @param querylast  仅查最新记录
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function ChangeCenterAction(pk_org, psnjobs, querylast=false) {
+    const postData = {
+        pk_org,
+        psnjobs,
+        querylast
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: '/nccloud/hrcm/center/ChangeCenterAction.do',
+                body: postData,
+            })
+                .then((res) => {
+                    if (res.success) {
+                        resolve(res)
+                    }
+                });
+        })
+    );
+}

+ 28 - 0
src/hrcm/contractmgt/center/components/Header/functions/ContractSign.js

@@ -0,0 +1,28 @@
+import proFetch from "../../../../../public/functions/project-fetch";
+
+/**
+ * 列表查询
+ * @param pk_org
+ * @param pk_psndoc_subs  合同主键已‘,’分隔。(默认第一个有效,选择多个默认也只显示第一个)
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function ContractTextViewAction(pk_org, pk_psndoc_subs) {
+    const postData = {
+        pk_org,
+        pk_psndoc_subs
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: '/nccloud/hrcm/templet/ContractTextViewAction.do',
+                body: postData,
+            })
+                .then((res) => {
+                    if (res.success) {
+                        resolve(res)
+                    }
+                });
+        })
+    );
+}

+ 28 - 0
src/hrcm/contractmgt/center/components/Header/functions/ContractTextViewAction.js

@@ -0,0 +1,28 @@
+import proFetch from "../../../../../public/functions/project-fetch";
+
+/**
+ * 列表查询
+ * @param pk_org
+ * @param pk_psndoc_subs  合同主键已‘,’分隔。(默认第一个有效,选择多个默认也只显示第一个)
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function ContractTextViewAction(pk_org, pk_psndoc_subs) {
+    const postData = {
+        pk_org,
+        pk_psndoc_subs
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: '/nccloud/hrcm/templet/ContractTextViewAction.do',
+                body: postData,
+            })
+                .then((res) => {
+                    if (res.success) {
+                        resolve(res)
+                    }
+                });
+        })
+    );
+}

+ 30 - 0
src/hrcm/contractmgt/center/components/Header/functions/ExtendCenterAction.js

@@ -0,0 +1,30 @@
+import proFetch from "../../../../../public/functions/project-fetch";
+
+/**
+ * 合同续签
+ * @param pk_org
+ * @param psnjobs  合同主键已‘,’分隔
+ * @param querylast  仅查最新记录
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function ExtendCenterAction(pk_org, psnjobs, querylast=false) {
+    const postData = {
+        pk_org,
+        psnjobs,
+        querylast
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: '/nccloud/hrcm/center/ExtendCenterAction.do',
+                body: postData,
+            })
+                .then((res) => {
+                    if (res.success) {
+                        resolve(res)
+                    }
+                });
+        })
+    );
+}

+ 30 - 0
src/hrcm/contractmgt/center/components/Header/functions/FinishCenterAction.js

@@ -0,0 +1,30 @@
+import proFetch from "../../../../../public/functions/project-fetch";
+
+/**
+ * 合同终止
+ * @param pk_org
+ * @param psnjobs  合同主键已‘,’分隔
+ * @param querylast  仅查最新记录
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function FinishCenterAction(pk_org, psnjobs, querylast=false) {
+    const postData = {
+        pk_org,
+        psnjobs,
+        querylast
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: '/nccloud/hrcm/center/FinishCenterAction.do',
+                body: postData,
+            })
+                .then((res) => {
+                    if (res.success) {
+                        resolve(res)
+                    }
+                });
+        })
+    );
+}

+ 38 - 0
src/hrcm/contractmgt/center/components/Header/functions/MakeCenterAction.js

@@ -0,0 +1,38 @@
+import proFetch from "../../../../../public/functions/project-fetch";
+
+/**
+ * 合同签订
+ * @param pk_org
+ * @param psnjobs  合同主键已‘,’分隔
+ * @param querylast  仅查最新记录
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function MakeCenterAction(pk_org, psnjobs, querylast=false,btncode) {
+    const postData = {
+        pk_org,
+        psnjobs,
+        querylast
+    };
+    const url = {
+        sign: '/nccloud/hrcm/center/MakeCenterAction.do',
+        change: '/nccloud/hrcm/center/ChangeCenterAction.do',
+        extend: '/nccloud/hrcm/center/ExtendCenterAction.do',
+        release: '/nccloud/hrcm/center/ReleaseCenterAction.do',
+        finish: '/nccloud/hrcm/center/FinishCenterAction.do',
+        contopinion: '/nccloud/hrcm/center/OpinionRemCenterAction.do',
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: url[btncode],
+                body: postData,
+            })
+                .then((res) => {
+                    if (res.success) {
+                        resolve(res)
+                    }
+                });
+        })
+    );
+}

+ 30 - 0
src/hrcm/contractmgt/center/components/Header/functions/OpinionRemCenterAction.js

@@ -0,0 +1,30 @@
+import proFetch from "../../../../../public/functions/project-fetch";
+
+/**
+ * 续签意见征询
+ * @param pk_org
+ * @param psnjobs  合同主键已‘,’分隔
+ * @param querylast  仅查最新记录
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function OpinionRemCenterAction(pk_org, psnjobs, querylast=false) {
+    const postData = {
+        pk_org,
+        psnjobs,
+        querylast
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: '/nccloud/hrcm/center/OpinionRemCenterAction.do',
+                body: postData,
+            })
+                .then((res) => {
+                    if (res.success) {
+                        resolve(res)
+                    }
+                });
+        })
+    );
+}

+ 30 - 0
src/hrcm/contractmgt/center/components/Header/functions/ReleaseCenterAction.js

@@ -0,0 +1,30 @@
+import proFetch from "../../../../../public/functions/project-fetch";
+
+/**
+ * 合同解除
+ * @param pk_org
+ * @param psnjobs  合同主键已‘,’分隔
+ * @param querylast  仅查最新记录
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function ReleaseCenterAction(pk_org, psnjobs, querylast=false) {
+    const postData = {
+        pk_org,
+        psnjobs,
+        querylast
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: '/nccloud/hrcm/center/ReleaseCenterAction.do',
+                body: postData,
+            })
+                .then((res) => {
+                    if (res.success) {
+                        resolve(res)
+                    }
+                });
+        })
+    );
+}

+ 21 - 0
src/hrcm/contractmgt/center/components/Header/functions/updateButtonStatus.js

@@ -0,0 +1,21 @@
+// 初始化按钮状态
+
+export default function updateButtonStatus(props) {
+    const {showDetail,hrorgval,pk_psndoc_sub} = props;
+    props.button.setButtonVisible({
+        query: !showDetail,
+        transaction: !showDetail,
+        contract: showDetail,
+        file: showDetail,
+        export: !showDetail
+    });
+
+    props.button.setButtonDisabled({
+        query: !hrorgval,
+        transaction: !hrorgval,
+        contract: !hrorgval,
+        file: !pk_psndoc_sub,
+        export: !hrorgval,
+        print: !hrorgval,
+    });
+}

+ 496 - 0
src/hrcm/contractmgt/center/components/Header/index.js

@@ -0,0 +1,496 @@
+import React, {Component} from 'react';
+import './index.less';
+import {
+    base,
+    toast,
+    promptBox,
+    print,
+    output,
+} from 'nc-lightapp-front';
+
+
+import ReferSearch from 'src/hrpub/common/components/referSearch/org';
+import NCBackBtn from 'src/hrpub/common/components/hr-back';
+import do_print from 'src/hrpub/common/utils/print';
+import Export from 'src/hrpub/common/utils/exportHtml'
+import ContractTextViewAction from "./functions/ContractTextViewAction";
+import BrowseTempletAction
+    from "../../../../basicsetting/templet_base/main/components/Header/functions/BrowseTempletAction";
+import updateButtonStatus from "./functions/updateButtonStatus";
+import MakeCenterAction from "./functions/MakeCenterAction";
+import isMac from "../../../../public/functions/isMac";
+import {nodeRefs} from '../../main/common';
+const {NCCheckbox} = base;
+const tableid = 'psninfo';
+
+class Header extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            json: props.json,
+            hrorgobj: {}, //人力资源组织
+            isBtnFirst: true  //是否是按钮的第一次触发
+        };
+        this.onBtnOperation = this.onBtnOperation.bind(this);
+    }
+
+    componentWillReceiveProps(nextprops) {
+        let nextjson = JSON.stringify(nextprops.json);
+        let thisjson = JSON.stringify(this.props.json);
+        if (nextjson !== thisjson) {
+            this.setState({
+                json: nextprops.json
+            })
+        }
+        if (nextprops.showDetail !== this.props.showDetail) {
+            updateButtonStatus(nextprops);
+        }
+    }
+
+    componentDidMount() {
+        updateButtonStatus(this.props);
+    }
+
+    /**
+     * 查询主组织 节点信息
+     */
+    searchChange(val) {
+        if (!this.props.queryOid) {
+            this.setState({
+                hrorgobj: null
+            });
+            return
+        }
+        this.setState({
+            hrorgobj: val
+        });
+        this.props.updateState({
+            hrorgval: val.refpk,
+            hrorgobj: val
+        }, () => {
+            updateButtonStatus(this.props);
+            val.refpk && this.props.getLeftTreeData();
+        });
+    }
+
+    /**
+     * 右表是否包含在职人员
+     * @param val
+     */
+    onCheckChange(val) {
+        // 未选择人力资源资源 退出
+        if (!this.props.hrorgval) return;
+
+        this.props.updateState({
+            inposFlag: val
+        }, () => {
+            //重新请求数据
+            this.props.refresh();
+        })
+    }
+
+    onBtnOperation(props, btncode, areacode, record) {
+        if (areacode === 'list') {
+            switch (btncode) {
+                case 'query':
+                    // 查询
+                    let template = this.props.meta.getMeta();
+                    template["psnquery"].items.map(item => {
+                        // 部门
+                        if (item.attrcode === 'hi_psnjob.pk_dept') {
+                            item.queryCondition = () => {
+                                return {
+                                    'pk_hrorg': this.state.hrorgobj.refpk
+                                }
+                            }
+                        }
+                        if (item.attrcode === 'hi_psndoc_ctrt.pk_conttext') {
+                            item.queryCondition = () => {
+                                return {
+                                    'pk_org': this.state.hrorgobj.refpk,
+                                    'GridRefActionExt': "nccloud.web.hrcm.make.sqlbuilder.ContModelGridSqlBuilder"
+                                }
+                            }
+                        }
+                        // 部门编码
+                        if (item.attrcode === 'hi_psnjob.pk_dept.code') {
+                            item.queryCondition = () => {
+                                return {
+                                    'pk_org': this.state.hrorgobj.refpk
+                                }
+                            }
+                        }
+                        // 员工号
+                        if (item.attrcode === 'hi_psnjob.clerkcode') {
+                            item.queryCondition = () => {
+                                return {
+                                    'pk_org': this.state.hrorgobj.refpk,
+                                    "busiregionEnum": "psnpact",
+                                    "GridRefActionExt": "nccloud.web.hrcm.pub.sqlbuilder.PsndocQryRefSqlBuilder",
+                                    "ismainjob": "Y"
+                                    // "func_type": 4,
+                                    // "GridRefActionExt": "nccloud.web.hrhi.psndoc.sqlbuilder.PsndocQryDlgPsnRefSqlBuilder"
+                                }
+                            }
+                        }
+                    });
+                    this.props.meta.setMeta(template, () => {
+                        this.props.search.openAdvSearch('psnquery', true);
+                    });
+                    break;
+                case 'browse':
+                    // 浏览
+                    this.browseTemplet();
+                    break;
+                case 'contract':
+                    // 合同文本
+                    if (!isMac(this.props.json['cm6011-000148'])) {
+                        this.contractTextView();
+                    }
+                    break;
+                case 'sign':
+                    // 合同签订
+                    this.contractSign(btncode);
+                    break;
+                case 'change':
+                    // 合同变更
+                    this.contractSign(btncode);
+                    break;
+                case 'extend':
+                    // 合同续签
+                    this.contractSign(btncode);
+                    break;
+                case 'release':
+                    // 合同解除
+                    this.contractSign(btncode);
+                    break;
+                case 'finish':
+                    // 合同终止
+                    this.contractSign(btncode);
+                    break;
+                case 'contopinion':
+                    // 续签意见征询
+                    this.contractSign(btncode);
+                    break;
+                case 'refresh':
+                    this.props.refresh(() => {
+                        toast({
+                            color: 'success',
+                            content: this.state.json['cm6011-000006']
+                        });//刷新成功!
+                    });
+                    break;
+                case 'file':
+                    this.props.updateState({
+                        showUploader: true
+                    });
+                    break;
+                case 'export':
+                    //导出
+                    Export(document.querySelector('.wui-table-scroll'),
+                        {
+                            title: this.state.json['cm6011-000061'] /* 国际化处理: 合同处理中心*/,
+                            fileName: this.state.json['cm6011-000102'] /* 国际化处理: 合同处理中心数据*/,
+                            maker: this.state.json['cm6011-000100'] /* 国际化处理: 制单人*/,
+                            date: this.state.json['cm6011-000101'] /* 国际化处理: 制表日期*/
+                        }, {
+                            data: this.props.editTable.getAllData(tableid).rows,
+                            meta: this.props.meta.getMeta()[tableid],
+                            showIndex: false
+                        });
+                    break;
+                case 'print':
+                    if (this.props.showDetail) {
+                        print(
+                            'pdf',
+                            // 修改url
+                            '/nccloud/hrcm/account/ContractBatchPrintAction.do',
+                            {
+                                funcode: '60110301',
+                                nodekey: '6011center',
+                                oids: [this.props.pk_psndoc_sub]
+                            }
+                        );
+                    } else {
+                        const el = document.querySelector('.table_print').cloneNode(true);
+                        // const table = el.querySelector('.wui-table-content');
+                        // table.removeChild(table.lastElementChild);
+                        // const tHeader = el.querySelector('.wui-table-header');
+                        // const tr = tHeader.querySelector('tr');
+                        // tr.removeChild(tr.firstElementChild);
+                        // tr.removeChild(tr.firstElementChild);
+                        const tableTmp = this.props.meta.getMeta()[tableid];
+                        do_print(
+                            el,
+                            {
+                                title: this.state.json['cm6011-000061'] /* 国际化处理: 合同处理中心*/,
+                                maker: this.state.json['cm6011-000033'] /* 国际化处理: 打印人*/,
+                                date: this.state.json['cm6011-000034'] /* 国际化处理: 打印日期*/,
+                                maxColLen: 11,
+                                beforeAppend: (tableDataList) => {
+                                    tableDataList[0][0] = this.getTableTmp(tableTmp);
+                                    return tableDataList
+                                }
+                            },
+                            {
+                                tableTmp: tableTmp,
+                                data: this.props.editTable.getAllRows(tableid)
+                            }
+                        );
+                    }
+                    break;
+                case 'output':
+                    // 点击输出按钮
+                    // debugger
+                    if (this.props.showDetail) {
+                        // 点击输出按钮
+                        output({
+                            url: '/nccloud/hrcm/account/ContractBatchPrintAction.do',
+                            data: {
+                                funcode: '60110301',      //功能节点编码,即模板编码
+                                nodekey: '6011center',     //模板节点标识
+                                oids: [this.props.pk_psndoc_sub],    // 功能节点的数据主键
+                                outputType: 'output',
+                                filename: this.state.json['cm6011-000061'] // 输出文件名
+                            },
+                            callback: function () {
+
+                            }
+                        });
+                    } else {
+                        Export(document.querySelector('.wui-table-scroll'),
+                            {
+                                title: this.state.json['cm6011-000061'] /* 国际化处理: 合同处理中心*/,
+                                fileName: this.state.json['cm6011-000102'] /* 国际化处理: 合同处理中心数据*/,
+                                maker: this.state.json['cm6011-000100'] /* 国际化处理: 制单人*/,
+                                date: this.state.json['cm6011-000101'] /* 国际化处理: 制表日期*/
+                            }, {
+                                data: this.props.editTable.getAllData(tableid).rows,
+                                meta: this.props.meta.getMeta()[tableid],
+                                showIndex: false
+                            });
+                    }
+
+                    break;
+                default:
+                    break;
+            }
+        } else if (areacode === 'body') {
+            switch (btncode) {
+                case 'contract_body':
+                    // 合同文本
+                    if (!isMac(this.props.json['cm6011-000148'])) {
+                        this.contractTextView(record);
+                    }
+                    break;
+                default:
+                    break;
+            }
+        }
+    }
+
+    /**
+     * 合同签订
+     */
+    contractSign(btncode) {
+        let psnjobs = this.getChecked('pk_psnjob');
+        if (!psnjobs) {
+            toast({
+                color: 'warning',
+                content: this.state.json['cm6011-000089'] // "没有选择数据!"
+            });
+            return
+        }
+        MakeCenterAction(this.props.hrorgval, psnjobs, this.props.querylast, btncode).then(async (res) => {
+            let operType = res.data.operType;
+            if (operType === '2') {
+                let warnInf = res.data.warnInf.replace(/\n/g, "<br/>");
+                this.props.updateState({
+                    nextOperationVisible: true,
+                    transactionModelId: btncode,
+                    ctrtVOs: res.data.ctrtVOs,
+                    vPks: JSON.parse(res.data.vPks),
+                    pageUrl: res.data.pageUrl,
+                    warnInf: warnInf
+                });
+                return
+            }
+            if (operType !== '1') {
+                return
+            }
+            if (btncode !== 'extend') {
+                this.openTransaction(btncode);
+                return;
+            }
+            if (psnjobs.indexOf(',') === -1) {
+                this.props.updateState({
+                    extendtype: '0'
+                }, () => {
+                    this.openTransaction(btncode);
+                });
+                return;
+            }
+            this.props.updateState({
+                nextOperationVisible: true,
+                transactionModelId: 'extend',
+                ctrtVOs: null,
+                vPks: null,
+                pageUrl: null,
+                warnInf: this.state.json['cm6011-000118'] // "系统将按所选人员中每个人到期日期的第二天开始续签,<br/>请选择续签方式:"
+            });
+        })
+    }
+
+    /**
+     * 打开业务处理弹窗
+     * @param btncode
+     */
+    openTransaction(btncode) {
+        if (btncode === 'contopinion') {
+            let psnjobs = this.getChecked('pk_psnjob');
+            this.props.openOpinionAskNode(psnjobs);
+        } else {
+            this.props.updateState({
+                transactionFormId: this.props.transactionFormId[btncode],
+                transactionModelId: btncode
+            }, () => {
+                this.props.showTransaction();
+            })
+        }
+    }
+
+    /**
+     * 获取选中列表的某项属性
+     * @param key
+     */
+    getChecked(key) {
+        let keys = [];
+        let rows = this.props.editTable.getCheckedRows(tableid);
+        if (rows.length > 0) {
+            rows.map(item => {
+                let values = item.data.values;
+                if (values.hasOwnProperty(key)) {
+                    keys.push(values[key].value);
+                }
+            })
+        }
+
+        let ret = keys.length > 0 ? keys.join(',') : false;
+        return ret
+    }
+
+    /**
+     * 获取表头
+     * @param tmp
+     * @returns {Array}
+     */
+    getTableTmp(tmp) {
+        let tableTmp = [];
+        let visibleCol = [];
+        tmp.items.forEach((item) => {
+            if (item.visible && item.attrcode !== 'opr') {
+                visibleCol.push(item);
+            }
+        });
+        visibleCol.forEach((col) => {
+            tableTmp.push(col.label);
+        });
+
+        return tableTmp
+    }
+
+    /**
+     * 浏览
+     */
+    browseTemplet() {
+        BrowseTempletAction(this.props.hrorgval, this.props.pk_conmodel).then(res => {
+        })
+    }
+
+    /**
+     * 合同文本
+     */
+    contractTextView(record) {
+        let that = this;
+        let pk_psndoc_subs = record ? record.values.pk_psndoc_sub.value : this.props.pk_psndoc_sub;
+        ContractTextViewAction(this.props.hrorgval, pk_psndoc_subs).then(res => {
+            if (!res['data']) return;
+            if (record) {
+                nodeRefs.wpsview.openView([{data: record}], 'ct')
+            } else {
+                let formId = ''
+                // 签订=1,续签=2,变更=3,解除=4,终止=5
+                if(that.props.conttype === "1") {
+                    formId = 'make';
+                } else if (that.props.conttype === "2") {
+                    formId = 'change';
+                } else if (that.props.conttype === "3") {
+                    formId = "extend"
+                } else if (that.props.conttype === "4") {
+                    formId = "release"
+                } else if (that.props.conttype === "5") {
+                    formId = "finish"
+                }
+                console.log(formId)
+                /*获取表单所有数据*/
+                let formData = that.props.form.getAllFormValue(formId).rows
+                nodeRefs.wpsview.openView(formData, 'ct')
+            }
+
+            // let location = window.location;
+            // location.port ? window.open("uclient://start/http://" + location.hostname + ":" + location.port + res.data) : window.open("uclient://start/http://" + location.hostname + res.data)
+        })
+    }
+
+    back() {
+        this.props.updateState({
+            pk_psndoc_sub: null,
+            showDetail: false
+        })
+    }
+
+    render() {
+        const {button, showDetail} = this.props;
+        return (
+            <div className="page-header header">
+                {showDetail ? <div className={'page-header-left'}>
+                    <NCBackBtn onClick={this.back.bind(this)} title={this.state.json['cm6011-000060']}/>
+                    {/* 国际化处理: 返回*/}
+                </div> : <div className={'page-header-left'}>
+                    <div className={'leftDepartmentChoose'}>
+                        {this.props.queryOid && <ReferSearch
+                            orgVal={this.state.hrorgobj}
+                            getOrgData={this.searchChange.bind(this)}
+                            queryCondition={
+                                () => {
+                                    return {
+                                        controlType: 0
+                                    }
+                                }
+                            }
+                        />}
+                    </div>
+                    {/* 标题 title*/}
+                    {this.props.hrorgval && <div className="title">
+                        <span className="showOff">
+                            <NCCheckbox checked={this.props.inposFlag} onChange={
+                                this.onCheckChange.bind(this)
+                            }>{this.state.json['cm6011-000003']}</NCCheckbox>{/* 国际化处理: 在职人员 */}
+                        </span>
+
+                    </div>}
+                </div>}
+                {this.props.hrorgval && <div className={'page-header-right'}>
+                    {button.createButtonApp({
+                        area: 'list',
+                        onButtonClick: (props, btncode) => {
+                            this.onBtnOperation(props, btncode, 'list', this);
+                        }
+                    })}
+                </div>}
+            </div>
+        );
+    }
+}
+
+export default Header;

+ 15 - 0
src/hrcm/contractmgt/center/components/Header/index.less

@@ -0,0 +1,15 @@
+.page-header {
+  width: 100%;
+  padding: 6px 20px;
+  box-sizing: border-box;
+  display: flex;
+  justify-content: space-between;
+
+  .page-header-left{
+    display: flex;
+    align-items: center;
+    .title{
+      padding-left: 30px;
+    }
+  }
+}

+ 28 - 0
src/hrcm/contractmgt/center/components/LeftTree/functions/CenterTree.js

@@ -0,0 +1,28 @@
+import proFetch from "../../../../../public/functions/project-fetch";
+
+/**
+ * 列表查询
+ * @param pk_org
+ * @param includeOtherNode
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function CenterTree(pk_org, includeOtherNode = true) {
+    const postData = {
+        pk_org,
+        includeOtherNode
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: '/nccloud/hrcm/center/CenterTreeRootAction.do',
+                body: postData,
+            })
+                .then((res) => {
+                    if (res.success) {
+                        resolve(res)
+                    }
+                });
+        })
+    );
+}

+ 26 - 0
src/hrcm/contractmgt/center/components/LeftTree/functions/CenterTreeFirstChildAction.js

@@ -0,0 +1,26 @@
+import proFetch from "../../../../../public/functions/project-fetch";
+
+/**
+ * 树展开子节点事件,ajax请求子节点数据
+ * @param tree_node_id
+ * @constructor
+ */
+export default function CenterTreeFirstChildAction(tree_node_id,pk_org) {
+    const postData = {
+        pk_org,
+        tree_node_id
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: '/nccloud/hrcm/center/CenterTreeFirstChildAction.do',
+                body: postData,
+            })
+                .then((res) => {
+                    if (res.success) {
+                        resolve(res)
+                    }
+                });
+        })
+    );
+}

+ 157 - 0
src/hrcm/contractmgt/center/components/LeftTree/index.js

@@ -0,0 +1,157 @@
+import React, {Component} from 'react';
+import './index.less';
+import {
+    base,
+    toast,
+    high,
+    promptBox,
+    output,
+    print,
+    cacheTools
+} from 'nc-lightapp-front';
+
+import CenterTree from "./functions/CenterTree";
+import CenterTreeFirstChildAction from "./functions/CenterTreeFirstChildAction";
+import {getAllTreeRefpk} from "../../main/common";
+
+const treeId = 'treeid';
+
+class LeftTree extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            json: props.json,
+            treeData: [], // 左树数据
+
+            checkedKeys: [], // 左树选中的分支
+        };
+    }
+
+    componentWillReceiveProps(nextprops) {
+        let nextjson = JSON.stringify(nextprops.json);
+        let thisjson = JSON.stringify(this.props.json);
+        if (nextjson !== thisjson) {
+            this.setState({
+                json: nextprops.json
+            })
+        }
+        // 人力资源组织 发生变化 左树重新请求
+        if (nextprops.hrorgval !== this.props.hrorgval) {
+            this.getTreeData(nextprops.hrorgval);
+        }
+    }
+
+    /**
+     * 左树获取数据
+     */
+    getTreeData = (hrorgval) => {
+        this.props.emptyRightTable();
+        // 请求左树数据
+        CenterTree(hrorgval || this.props.hrorgval).then(res => {
+            if (res['data'] && Array.isArray(res['data'])) {
+                // this.setState({
+                //     treeData: res['data']
+                // })
+                this.creatTree(res['data'])
+            }
+        })
+    };
+
+    /**
+     * 创建左边导航栏
+     */
+    creatTree(navData) {
+        let root = {//树根节点
+            "isleaf": false,
+            "select": true,
+            "key": "ROOT",
+            "title": this.state.json['cm6011-000002'],
+            "id": "ROOT",
+            "innercode": "ROOT",
+            "pid": "",
+            "refname": this.state.json['cm6011-000002'],
+            "refpk": "ROOT",
+            "iconBox": {addIcon: false, delIcon: false, editIcon: false}
+        };
+        if (navData) {
+            root.children = navData;
+        }
+        let treeData = [root];
+        this.props.asyncTree.setTreeData(treeId, treeData);
+        this.props.asyncTree.setNodeSelectedAsync(treeId,root.refpk);
+        this.props.refresh();
+    }
+
+    /**
+     * 选择树节点
+     */
+    selectTree = (refpk, item) => {
+        let deptPk = null, orgPk = null, isOtherNode = false;
+        // 清空表单
+        if (refpk[0] !== 'ROOT') {
+            // 如果没有改变则返回
+            isOtherNode = refpk[0] === 'other_node_msaos';
+            let nodeVal = item.nodeData.nodeValue;
+            deptPk = nodeVal.hasOwnProperty('pk_dept') ? nodeVal.pk_dept : null;
+            orgPk = isOtherNode ? null : (nodeVal.hasOwnProperty('pk_org') ? nodeVal.pk_org : null);
+        }
+        if (deptPk) {
+            orgPk = null;
+        }
+        this.props.updateState({
+            orgPk,
+            deptPk,
+            isOtherNode
+        })
+    };
+
+    loadTreeData = (refpk) => {
+        if (refpk === 'ROOT') {
+            return;
+        }
+        CenterTreeFirstChildAction(refpk, this.props.hrorgval).then(res => {
+            if (!res.data) return;
+            let allRefpk = getAllTreeRefpk(this.props, treeId);
+            let addTreeData = [];
+            res.data.map(item=>{
+                if(!allRefpk.includes(item.refpk)){
+                    addTreeData.push(item)
+                }
+                if(!allRefpk.includes(item.pid)){
+                    item.pid='ROOT'
+                }
+            });
+            this.props.asyncTree.addTreeData(treeId, addTreeData);
+        })
+    };
+
+    render() {
+        let {asyncTree} = this.props;
+        const {createAsyncTree} = asyncTree;
+        return (
+            <div className="left-tree">
+                <div className="tree-area">
+                    {JSON.stringify(this.state.json) !== '{}' ? < div className={'tree-warp'}>
+                        {createAsyncTree({
+                            treeId: treeId,
+                            needSearch: false, //是否需要搜索框
+                            needEdit: false, //不启用编辑
+                            showLine: false, //显示连线
+                            defaultSelectedKeys: ["ROOT"],
+                            onSelectedChange: (node) => {
+                                if (!node) {
+                                    this.props.asyncTree.openNodeByPkAsync(treeId, "ROOT")
+                                }
+                            },
+                            onSelectEve: this.selectTree.bind(this), //节点选中事件
+                            loadTreeData: this.loadTreeData.bind(this), //加载子节点数据
+                            showModal: false //是否使用弹出式编辑
+                        })}
+                    </div> : null}
+                </div>
+            </div>
+        );
+    }
+}
+
+export default LeftTree;

+ 5 - 0
src/hrcm/contractmgt/center/components/LeftTree/index.less

@@ -0,0 +1,5 @@
+.left-tree{
+    height: 100%;
+    overflow: auto;
+    border-top: 1px solid #ccc;
+}

+ 28 - 0
src/hrcm/contractmgt/center/components/NextOperation/functions/CenterDeleteContAction.js

@@ -0,0 +1,28 @@
+import proFetch from "../../../../../public/functions/project-fetch";
+
+/**
+ * 删除未生效的合同信息
+ * @param pk_org
+ * @param vPks
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function CenterDeleteContAction(pk_org, vPks) {
+    const postData = {
+        pk_org,
+        vPks
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: '/nccloud/hrcm/center/CenterDeleteContAction.do',
+                body: postData,
+            })
+                .then((res) => {
+                    if (res.success) {
+                        resolve(res)
+                    }
+                });
+        })
+    );
+}

+ 28 - 0
src/hrcm/contractmgt/center/components/NextOperation/functions/CenterEffectContAction.js

@@ -0,0 +1,28 @@
+import proFetch from "../../../../../public/functions/project-fetch";
+
+/**
+ * 生效合同信息
+ * @param pk_org
+ * @param vPks
+ * @returns {Promise<any>}
+ * @constructor
+ */
+export default function CenterEffectContAction(pk_org, vPks) {
+    const postData = {
+        pk_org,
+        vPks
+    };
+
+    return new Promise(((resolve, reject) => {
+            proFetch({
+                url: '/nccloud/hrcm/center/CenterEffectContAction.do',
+                body: postData,
+            })
+                .then((res) => {
+                    if (res.success) {
+                        resolve(res)
+                    }
+                });
+        })
+    );
+}

+ 194 - 0
src/hrcm/contractmgt/center/components/NextOperation/index.js

@@ -0,0 +1,194 @@
+/**
+ * 下一步操作
+ */
+import React, {Component} from 'react';
+
+import './index.less';
+
+import {
+    base,
+    toast
+} from 'nc-lightapp-front';
+import CenterEffectContAction from "./functions/CenterEffectContAction";
+import CenterDeleteContAction from "./functions/CenterDeleteContAction";
+import {jump} from "../../main/common";
+
+const {
+    NCModal,
+    NCButton,
+    NCRadio
+} = base;
+
+const {
+    Header: NCModalHeader,
+    Body: NCModalBody,
+    Footer: NCModalFooter
+} = NCModal;
+
+class NextOperation extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            json: props.json||{},
+            selectedValue: 'into',
+            extendtype: '1'
+        }
+    }
+
+    componentWillReceiveProps(nextprops) {
+        let nextjson = JSON.stringify(nextprops.json);
+        let thisjson = JSON.stringify(this.props.json);
+        if (nextjson !== thisjson) {
+            this.setState({
+                json: nextprops.json,
+            })
+        }
+    }
+
+    confirm = () => {
+        if (!this.props.ctrtVOs && this.props.transactionModelId === 'extend') {
+            let extendtype = this.state.extendtype;
+            this.props.updateState({
+                extendtype
+            }, () => {
+                this.props.showTransaction(extendtype);
+                this.closeInfoModal();
+            });
+        } else {
+            // 确定
+            let selectedValue = this.state.selectedValue;
+            this[selectedValue]();
+        }
+    };
+
+    /**
+     * 进入业务节点
+     * @param pageUrl  /nccloud/resources/hrcm/contractmgt/change/main
+     */
+    into() {
+        // 跳转到其他节点
+        jump(this.props.vPks, this.props.hrorgobj, this.props.pageUrl);
+        this.closeInfoModal();
+    }
+
+    /**
+     * 生效
+     */
+    enable() {
+        CenterEffectContAction(this.props.hrorgval, this.props.vPks).then(res => {
+            toast({
+                color: 'success',
+                content: this.state.json['cm6011-000073']
+            });//已生效!
+            this.closeInfoModal();
+            this.props.refresh();
+        })
+    }
+
+    /**
+     * 删除
+     */
+    del() {
+        CenterDeleteContAction(this.props.hrorgval, this.props.vPks).then(res => {
+            toast({
+                color: 'success',
+                content: this.state.json['cm6011-000074']
+            });//已删除
+            this.closeInfoModal();
+            this.props.refresh();
+        })
+    }
+
+    closeInfoModal = () => {
+        this.props.updateState({
+            nextOperationVisible: false
+        });
+        this.setState({
+            selectedValue: 'into',
+            extendtype: '1'
+        })
+    };
+
+    /**
+     * 选择下一步操作
+     */
+    handleChange = (value) => {
+        this.setState({selectedValue: value});
+    };
+
+    handleExtend = (value) => {
+        this.setState({extendtype: value});
+    };
+
+    render() {
+        const {
+            nextOperationVisible
+        } = this.props;
+        return (
+            <NCModal
+                backdrop="static"
+                show={nextOperationVisible}
+                size="sm"
+                className="next-operation"
+                onHide={this.closeInfoModal}
+                // onEntered={this.showHandle}
+            >
+                <NCModalHeader
+                    closeButton={true}
+                >
+                    {this.state.json['cm6011-000070']}{/* 国际化处理: 请选择下一步操作*/}
+                </NCModalHeader>
+                <NCModalBody>
+                    <div className="next-operation">
+                        <div className={'message'} dangerouslySetInnerHTML={{
+                            __html: this.props.warnInf
+                        }}>
+                        </div>
+                        {(this.props.transactionModelId === 'extend' && !this.props.ctrtVOs) ?
+                            <div className={'radio-extend'}>
+                                <NCRadio.NCRadioGroup
+                                    name="extend"
+                                    selectedValue={this.state.extendtype}
+                                    onChange={this.handleExtend.bind(this)}>
+
+                                    <NCRadio value="1">{this.state.json["cm6011-000097"]}</NCRadio>
+
+                                    <NCRadio value="2">{this.state.json["cm6011-000098"]}</NCRadio>
+                                </NCRadio.NCRadioGroup>
+                            </div> : <div className={'radio-box'}>
+                                <NCRadio.NCRadioGroup
+                                    name="fruit"
+                                    selectedValue={this.state.selectedValue}
+                                    onChange={this.handleChange.bind(this)}>
+
+                                    <NCRadio value="into">{this.state.json["cm6011-000072"]}</NCRadio>
+
+                                    <NCRadio value="enable">{this.state.json["cm6011-000071"]}</NCRadio>
+
+                                    <NCRadio value="del">{this.state.json["cm6011-000065"]}</NCRadio>
+
+                                </NCRadio.NCRadioGroup>
+                            </div>}
+
+                    </div>
+                </NCModalBody>
+                <NCModalFooter>
+                    <NCButton
+                        colors="primary"
+                        onClick={this.confirm.bind(this)}
+                    >
+                        {this.state.json['cm6011-000028']}{/* 国际化处理: 确认*/}
+                    </NCButton>
+                    <NCButton
+                        colors="secondary"
+                        onClick={this.closeInfoModal}
+                    >
+                        {this.state.json['cm6011-000054']}{/* 国际化处理: 取消*/}
+                    </NCButton>
+                </NCModalFooter>
+            </NCModal>
+        );
+    }
+}
+
+export default NextOperation

+ 0 - 0
src/hrcm/contractmgt/center/components/NextOperation/index.less


Some files were not shown because too many files changed in this diff