Browse Source

hrkq前端初始化

chenzhfa 2 years ago
parent
commit
01914df1e1
100 changed files with 4119 additions and 0 deletions
  1. 2 0
      src/hrkq/.gitignore
  2. 1 0
      src/hrkq/billApprove/attendance/README.md
  3. 103 0
      src/hrkq/billApprove/attendance/actions/btn.js
  4. 15 0
      src/hrkq/billApprove/attendance/actions/constant.js
  5. 76 0
      src/hrkq/billApprove/attendance/actions/main.js
  6. 66 0
      src/hrkq/billApprove/attendance/actions/turnToFormPage.js
  7. 61 0
      src/hrkq/billApprove/attendance/components/AddPage/actions/main.js
  8. 44 0
      src/hrkq/billApprove/attendance/components/AddPage/components/Header/index.js
  9. 3 0
      src/hrkq/billApprove/attendance/components/AddPage/components/Header/index.less
  10. 30 0
      src/hrkq/billApprove/attendance/components/AddPage/config.js
  11. 46 0
      src/hrkq/billApprove/attendance/components/AddPage/index.js
  12. 14 0
      src/hrkq/billApprove/attendance/components/AddPage/index.less
  13. 56 0
      src/hrkq/billApprove/attendance/components/Uploader/index.js
  14. 0 0
      src/hrkq/billApprove/attendance/components/Uploader/index.less
  15. 41 0
      src/hrkq/billApprove/attendance/container/config.js
  16. 43 0
      src/hrkq/billApprove/attendance/container/index.js
  17. 25 0
      src/hrkq/billApprove/attendance/container/index.less
  18. 14 0
      src/hrkq/billApprove/attendance/main/index.js
  19. 57 0
      src/hrkq/billApprove/attendance/model/model.js
  20. 1 0
      src/hrkq/billApprove/leave/README.md
  21. 103 0
      src/hrkq/billApprove/leave/actions/btn.js
  22. 15 0
      src/hrkq/billApprove/leave/actions/constant.js
  23. 103 0
      src/hrkq/billApprove/leave/actions/main.js
  24. 145 0
      src/hrkq/billApprove/leave/actions/turnToFormPage.js
  25. 61 0
      src/hrkq/billApprove/leave/components/AddPage/actions/main.js
  26. 44 0
      src/hrkq/billApprove/leave/components/AddPage/components/Header/index.js
  27. 3 0
      src/hrkq/billApprove/leave/components/AddPage/components/Header/index.less
  28. 32 0
      src/hrkq/billApprove/leave/components/AddPage/config.js
  29. 52 0
      src/hrkq/billApprove/leave/components/AddPage/index.js
  30. 14 0
      src/hrkq/billApprove/leave/components/AddPage/index.less
  31. 42 0
      src/hrkq/billApprove/leave/components/Uploader/index.js
  32. 0 0
      src/hrkq/billApprove/leave/components/Uploader/index.less
  33. 39 0
      src/hrkq/billApprove/leave/container/config.js
  34. 43 0
      src/hrkq/billApprove/leave/container/index.js
  35. 25 0
      src/hrkq/billApprove/leave/container/index.less
  36. 14 0
      src/hrkq/billApprove/leave/main/index.js
  37. 56 0
      src/hrkq/billApprove/leave/model/model.js
  38. 1 0
      src/hrkq/billApprove/leaveoff/README.md
  39. 103 0
      src/hrkq/billApprove/leaveoff/actions/btn.js
  40. 15 0
      src/hrkq/billApprove/leaveoff/actions/constant.js
  41. 92 0
      src/hrkq/billApprove/leaveoff/actions/main.js
  42. 116 0
      src/hrkq/billApprove/leaveoff/actions/turnToFormPage.js
  43. 61 0
      src/hrkq/billApprove/leaveoff/components/AddPage/actions/main.js
  44. 44 0
      src/hrkq/billApprove/leaveoff/components/AddPage/components/Header/index.js
  45. 3 0
      src/hrkq/billApprove/leaveoff/components/AddPage/components/Header/index.less
  46. 30 0
      src/hrkq/billApprove/leaveoff/components/AddPage/config.js
  47. 45 0
      src/hrkq/billApprove/leaveoff/components/AddPage/index.js
  48. 14 0
      src/hrkq/billApprove/leaveoff/components/AddPage/index.less
  49. 56 0
      src/hrkq/billApprove/leaveoff/components/Uploader/index.js
  50. 0 0
      src/hrkq/billApprove/leaveoff/components/Uploader/index.less
  51. 39 0
      src/hrkq/billApprove/leaveoff/container/config.js
  52. 43 0
      src/hrkq/billApprove/leaveoff/container/index.js
  53. 25 0
      src/hrkq/billApprove/leaveoff/container/index.less
  54. 14 0
      src/hrkq/billApprove/leaveoff/main/index.js
  55. 57 0
      src/hrkq/billApprove/leaveoff/model/model.js
  56. 1 0
      src/hrkq/billApprove/outside/README.md
  57. 17 0
      src/hrkq/billApprove/outside/actions/btn.js
  58. 15 0
      src/hrkq/billApprove/outside/actions/constant.js
  59. 89 0
      src/hrkq/billApprove/outside/actions/main.js
  60. 70 0
      src/hrkq/billApprove/outside/actions/turnToFormPage.js
  61. 61 0
      src/hrkq/billApprove/outside/components/AddPage/actions/main.js
  62. 44 0
      src/hrkq/billApprove/outside/components/AddPage/components/Header/index.js
  63. 3 0
      src/hrkq/billApprove/outside/components/AddPage/components/Header/index.less
  64. 32 0
      src/hrkq/billApprove/outside/components/AddPage/config.js
  65. 52 0
      src/hrkq/billApprove/outside/components/AddPage/index.js
  66. 14 0
      src/hrkq/billApprove/outside/components/AddPage/index.less
  67. 56 0
      src/hrkq/billApprove/outside/components/Uploader/index.js
  68. 0 0
      src/hrkq/billApprove/outside/components/Uploader/index.less
  69. 38 0
      src/hrkq/billApprove/outside/container/config.js
  70. 42 0
      src/hrkq/billApprove/outside/container/index.js
  71. 25 0
      src/hrkq/billApprove/outside/container/index.less
  72. 14 0
      src/hrkq/billApprove/outside/main/index.js
  73. 57 0
      src/hrkq/billApprove/outside/model/model.js
  74. 1 0
      src/hrkq/billApprove/overtime/README.md
  75. 103 0
      src/hrkq/billApprove/overtime/actions/btn.js
  76. 15 0
      src/hrkq/billApprove/overtime/actions/constant.js
  77. 89 0
      src/hrkq/billApprove/overtime/actions/main.js
  78. 90 0
      src/hrkq/billApprove/overtime/actions/turnToFormPage.js
  79. 61 0
      src/hrkq/billApprove/overtime/components/AddPage/actions/main.js
  80. 44 0
      src/hrkq/billApprove/overtime/components/AddPage/components/Header/index.js
  81. 3 0
      src/hrkq/billApprove/overtime/components/AddPage/components/Header/index.less
  82. 30 0
      src/hrkq/billApprove/overtime/components/AddPage/config.js
  83. 45 0
      src/hrkq/billApprove/overtime/components/AddPage/index.js
  84. 14 0
      src/hrkq/billApprove/overtime/components/AddPage/index.less
  85. 125 0
      src/hrkq/billApprove/overtime/components/Header/actions/index.js
  86. 101 0
      src/hrkq/billApprove/overtime/components/Header/index.js
  87. 25 0
      src/hrkq/billApprove/overtime/components/Header/index.less
  88. 56 0
      src/hrkq/billApprove/overtime/components/Uploader/index.js
  89. 0 0
      src/hrkq/billApprove/overtime/components/Uploader/index.less
  90. 36 0
      src/hrkq/billApprove/overtime/container/config.js
  91. 43 0
      src/hrkq/billApprove/overtime/container/index.js
  92. 25 0
      src/hrkq/billApprove/overtime/container/index.less
  93. 14 0
      src/hrkq/billApprove/overtime/main/index.js
  94. 57 0
      src/hrkq/billApprove/overtime/model/model.js
  95. 1 0
      src/hrkq/billApprove/replacecalendar/README.md
  96. 103 0
      src/hrkq/billApprove/replacecalendar/actions/btn.js
  97. 15 0
      src/hrkq/billApprove/replacecalendar/actions/constant.js
  98. 76 0
      src/hrkq/billApprove/replacecalendar/actions/main.js
  99. 70 0
      src/hrkq/billApprove/replacecalendar/actions/turnToFormPage.js
  100. 0 0
      src/hrkq/billApprove/replacecalendar/components/AddPage/actions/main.js

+ 2 - 0
src/hrkq/.gitignore

@@ -0,0 +1,2 @@
+.idea
+.DS_Store

+ 1 - 0
src/hrkq/billApprove/attendance/README.md

@@ -0,0 +1 @@
+## 补考勤审批页面

+ 103 - 0
src/hrkq/billApprove/attendance/actions/btn.js

@@ -0,0 +1,103 @@
+
+export default class ButtonAction {
+    constructor(comp) {
+        this.action = comp.action;
+        this.comp = comp;
+    }
+
+    didAllInstance = () => {
+        this.setBtnHandleMap();
+    }
+
+    // 生成按钮map
+    setBtnHandleMap = () => {
+        this.buttonHandleMap = {
+            // 打印
+            'print': this.printTable,
+            // 输出
+            'output': this.outputTable
+        }
+    }
+
+
+    // 第一次进页面的按钮状态
+    initPageButton = () => {
+        const {props} = this.comp;
+        const {
+            button
+        } = props;
+        button.setButtonVisible({
+            approveinfo: false,
+            cardrpt: false,
+            file: false
+        });
+    }
+
+    // 按钮点击回调
+    headerClick = (props, btnCode) => {
+        console.log(btnCode);
+        if(typeof this.buttonHandleMap[btnCode] === 'function') {
+            this.buttonHandleMap[btnCode]();
+        }
+    }
+
+    // 打印
+    printTable = () => {
+        const {props} = this.comp;
+        const {attendance, editTable, meta} = props;
+
+        let tableWrapper = document.getElementById('mainTable');
+
+        this.print(tableWrapper, {
+            title: attendance.language['gx6008-000067'], // 录用办理
+            maker: attendance.language['gx6008-000068'], // 制作者
+            date: attendance.language['gx6008-000069'], // 制作日期
+            tableInfo: {
+                data: editTable.getAllRows('list'),
+                tableTmp: meta.getMeta()['list']
+            },
+            beforeAppend: (data) => {
+                data[0].map((item, rowIndex) => {
+                    delete item[0];
+                });
+                data[1].map((item) => {
+                    item.length = item.length - 1;
+                });
+                return data;
+            }
+        });
+    }
+
+    // 输出
+    outputTable = () => {
+        const {
+            props: {
+                editTable,
+                attendance: {
+                    language
+                },
+                meta
+            }
+        } = this.comp;
+        let tableWrapper = document.getElementById('mainTable');
+        let tableData = editTable.getAllData('list');
+
+        this.exportHtml(tableWrapper, {
+            fileName: language['gx6008-000067'] // '录用办理'
+        }, {
+            meta: meta.getMeta()['list'],
+            data: tableData.rows,
+            showIndex: false
+        });
+    }
+
+    // 附件管理
+    fileManager = (selectedRows) => {
+        let billId = selectedRows[0].values['bill_code'].value;
+
+        this.update({
+            fileManagerBillId: billId,
+            fileManagerModalVisible: true
+        });
+    }
+}

+ 15 - 0
src/hrkq/billApprove/attendance/actions/constant.js

@@ -0,0 +1,15 @@
+export default class Constant {
+    reqData = [{
+        rqUrl: '/platform/templet/querypage.do',
+        rqJson: `{\n  \"pagecode\": \"60656046nccloud\",\n  \"appcode\": \"60656046\"\n}`,
+        rqCode: 'template'
+    }, {
+        rqUrl: '/platform/appregister/queryallbtns.do',
+        rqJson: `{\n  \"pagecode\": \"60656046nccloud\",\n  \"appcode\": \"60656046\"\n}`,
+        rqCode: 'button'
+    }, {
+        rqUrl: '/platform/appregister/queryappcontext.do',
+        rqJson: `{\n  \"appcode\": \"60656046\"}`,
+        rqCode: 'context'
+    }];
+};

+ 76 - 0
src/hrkq/billApprove/attendance/actions/main.js

@@ -0,0 +1,76 @@
+import Constant from './constant';
+import HrPubCommon from '../../../../hrpub/common/actions';
+import { getAppPageConfig } from 'src/hrpub/common/utils/utils';
+const {appcode, pagecode} = getAppPageConfig()
+export default class MainAction extends HrPubCommon {
+    constructor(comp) {
+        super();
+        this.comp = comp;
+    }
+
+    extend = [Constant]
+
+    appConfig = {
+        pagecode,
+        appcode
+    }
+
+    update = async (obj) => {
+        const {props} = this.comp;
+        const {dispatch} = props;
+
+        await dispatch({
+            type: 'attendance/update',
+            payload: obj
+        });
+    }
+
+    // 获取多语
+    getCurrentLanguage = () => {
+        this.getLanguage('hrkq-approve', 'hrkq').then((json,status, init) => {
+            this.update({
+                language: json
+            })
+        });
+    }
+
+    // 获取模版信息
+    getTemplate = () => {
+        this.getMultiTemplate(this.reqData)
+            .then((res) => {
+                this.update({
+                    context: res.context
+                });
+                // this.afterGetTemplate();
+            });
+    }
+
+    // 当模版获取并设置完成之后的回调函数
+    afterGetTemplate = () => {
+        this.getFormData();
+    }
+
+    // 初始化
+    didMount = () => {
+        this.getTemplate();
+        this.getCurrentLanguage();
+    }
+
+    /**
+     * @desc: 根据id查询详情
+     * @param {type} 
+     * @return: 
+     */
+    getFormData = async () => {
+        const {props, action} = this.comp;
+        const {getUrlParam} = props;
+
+        let scene = getUrlParam('scene');
+        let id = getUrlParam('id');
+        let status = getUrlParam('status');
+
+        let methodsName = status === 'browse' ? 'toBrowsePage' : 'toEditPage'
+        
+        action.formAct[methodsName](id);
+    }
+}

+ 66 - 0
src/hrkq/billApprove/attendance/actions/turnToFormPage.js

@@ -0,0 +1,66 @@
+import { formatDate } from '../../util'
+export default class FormAction {
+    constructor(comp) {
+        this.comp = comp;
+    }
+    formConfig = {
+        area: 'attendance',
+        formCode: 'attendance_approve_card'
+    }
+    // 表单进入浏览态
+    toBrowseStatus = (formValue) => {
+        const {props} = this.comp;
+        const {form, button, attendance, cardPagination} = props;
+
+        // 单据id
+        let billId = '';
+
+        // 表单进入编辑
+        form.setFormStatus(this.formConfig.formCode, 'browse');
+        // 填充表单的值
+        if(formValue) {
+            form.setAllFormValue({
+                [this.formConfig.formCode]: formValue
+            });
+            billId = formValue.rows[0].values['pk_attendance'].value;
+        }
+
+        // 按钮进入编辑的按钮
+        this.update({
+            addPageStatus: 'browse'
+        })
+    }
+
+    // 直接进入预览页面
+    toBrowsePage = async (id, formValue) => {
+        try {
+            let oneBillData = await this.getOneBillData(id);
+            if (oneBillData) {
+                this.toBrowseStatus(oneBillData.data[this.formConfig.area][this.formConfig.formCode]);
+            } 
+        }
+        catch(e) {
+        }
+    }
+
+    // 获取一条数据
+    getOneBillData = async (pk_attendance) => {
+        const {props} = this.comp;
+        const {dispatch, attendance} = props;
+        try {
+            let res = await dispatch({
+                type: 'attendance/getBillDetail',
+                payload: {
+                    pk_attendance
+                }
+            });
+
+            if(res.success) {
+                return res;
+            }
+        }
+        catch(e) {
+        }
+        return false;
+    }
+}

+ 61 - 0
src/hrkq/billApprove/attendance/components/AddPage/actions/main.js

@@ -0,0 +1,61 @@
+
+import {
+    output,
+    print
+} from 'nc-lightapp-front';
+
+export default class Main {
+    constructor(comp) {
+        this.comp = comp;
+    }
+
+    didAllInstance = () => {
+        this.setButtonHandleMap();
+    }
+
+    // 设置按钮事件map
+    setButtonHandleMap = () => {
+        const {action} = this.comp;
+
+        this.buttonHandleMap = {
+            'save': this.saveAddPage,
+            'browse_status': {
+                'callback': this.callbackFromCard,
+                'print': this.printIt,
+                'output': this.output,
+            }
+        };
+    }
+
+    // 打印
+    printIt = () => {
+        let formValue = this.comp.props.form.getAllFormValue('card');
+
+        print('pdf', '/nccloud/hryf/entrymng/EntryPrintAction.do', {
+            appcode: '60656046',
+            nodekey: '60081010',
+            oids: [formValue.rows[0].values['pk_entryapply'].value]
+        });
+    }
+
+    // 输出
+    output = () => {
+        const {props} = this.comp;
+        const {
+            attendance
+        } = props;
+        let formValue = this.comp.props.form.getAllFormValue('card');
+        output({
+            url: '/nccloud/hryf/entrymng/EntryPrintAction.do',
+            data: {
+                appcode: '60092010',
+                nodekey: '60081010',
+                oids: [formValue.rows[0].values['pk_entryapply'].value],
+                outputType: 'output',
+                filename: attendance.language['gx6008-000067'] // 录用办理
+            },
+            callback: () => {
+            }
+        });
+    }
+}

+ 44 - 0
src/hrkq/billApprove/attendance/components/AddPage/components/Header/index.js

@@ -0,0 +1,44 @@
+import React, {Component} from 'react';
+
+import './index.less';
+
+import {
+    base
+} from 'nc-lightapp-front';
+
+const {
+    NCButton
+} = base;
+
+export default class AddPageHeader extends Component {
+    constructor(props) {
+        super(props);
+    }
+
+    render() {
+        const {
+            status, 
+            onClick, 
+            button, 
+            language,
+            cancelEdit,
+            cardPagination,
+            toBrowsePage,
+            fromApprove
+        } = this.props;
+
+        return (
+            <div className="add-page-header-wrapper">
+                
+                <Choose>
+                    <When condition={status === 'browse'}>
+                        {button.createButtonApp({
+                            area: 'head',
+                            onButtonClick: onClick('browse_status')
+                        })}
+                    </When>
+                </Choose>
+            </div>
+        );
+    }
+}

+ 3 - 0
src/hrkq/billApprove/attendance/components/AddPage/components/Header/index.less

@@ -0,0 +1,3 @@
+.add-page-header-wrapper {
+    float: right;
+}

+ 30 - 0
src/hrkq/billApprove/attendance/components/AddPage/config.js

@@ -0,0 +1,30 @@
+/**
+ * 
+ * 
+ * 编辑页面配置文件
+ * 
+ */
+ // actions
+import MainAction from './actions/main';
+import FormAction from '../../actions/turnToFormPage';
+
+// 方法
+import {render, connect} from '../../../../../hrpub/common/frame';
+
+// 组件
+import Layout from '../../../../../hrpub/common/components/Layout';
+
+
+ export default {
+      actions: {
+         mainAct: MainAction,
+         formAct: FormAction,
+      },
+      methods: {
+         render,
+         connect
+      },
+      components: {
+         Layout
+      }
+ }

+ 46 - 0
src/hrkq/billApprove/attendance/components/AddPage/index.js

@@ -0,0 +1,46 @@
+import React from 'react';
+import './index.less';
+
+import config from './config';
+
+const {
+    actions,
+    methods: {
+        render,
+        connect
+    },
+    components: {
+        Layout
+    }
+} = config;
+
+const {Header,Content} = Layout;
+
+const Wrapper = render({
+    actions: actions
+})(({props, action, state}) => {
+    props.use.form('attendance_approve_card')
+    const {form, attendance} = props;
+
+    return (
+        <Layout
+            className="employing-add-page"
+        >
+            <div className="bill-bg">
+            <Header
+                showOrgRefer={false}
+                showButtons={false}
+            >
+                <div className="approve_title">
+                    {attendance.language['approve-00001']}{/* 补考勤审批 */}
+                </div>
+            </Header>
+            <Content>
+                {form.createForm('attendance_approve_card', {})}
+            </Content>
+            </div>
+        </Layout>
+    );
+});
+
+export default connect(Wrapper);

+ 14 - 0
src/hrkq/billApprove/attendance/components/AddPage/index.less

@@ -0,0 +1,14 @@
+.employing-add-page {
+    height: 100%;
+}
+.approve_title {
+    display: inline-block;
+    font-size: 16px;
+    color: #111;
+    font-weight: 700;
+    line-height: 38px;
+}
+.bill-bg{
+    overflow: hidden;
+    background: #f6f6f6;
+}

+ 56 - 0
src/hrkq/billApprove/attendance/components/Uploader/index.js

@@ -0,0 +1,56 @@
+import React, {Component} from 'react';
+import './index.less';
+// import {high} from 'nc-lightapp-front';
+
+// const {NCUploader} = high;
+import NCUploader from 'uap/common/components/NCUploader';
+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 {billId, table, clickRow: clickRowProps} = this.props;
+        if (billId) return billId;
+        const clickRow = table.getClickRowIndex('ncc600704list') || clickRowProps;
+
+        return clickRow && clickRow.record.values.pk_psndoc.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) {
+            alert(this.props.language['gx6008-000117'])/* 国际化处理: 上传大小小于2M*/
+        }
+        return isLt2M;
+        // 备注: return false 不执行上传  return true 执行上传
+    }
+
+    render() {
+        return (
+            <div className='uploader'>
+                <NCUploader
+                    billId={this.props.billId}
+                    //getGroupList={this.getGroupList}
+                    onHide={this.onHideUploader} // 关闭功能
+                    //beforeUpload={this.beforeUpload}
+                />
+            </div>
+        );
+    }
+}
+
+export default Uploader;

+ 0 - 0
src/hrkq/billApprove/attendance/components/Uploader/index.less


+ 41 - 0
src/hrkq/billApprove/attendance/container/config.js

@@ -0,0 +1,41 @@
+/** 
+ * 
+ * container组件的配置文件
+ * 
+ */
+
+// actions
+import MainAction from '../actions/main';
+import ButtonAction from '../actions/btn';
+import FormAction from '../actions/turnToFormPage';
+
+// 本节点组件
+import AddPage from '../components/AddPage';
+import FileManager from '../components/Uploader';
+
+// 公用组件
+import Layout from '../../../../hrpub/common/components/Layout';
+import EmptyPage from '../../../../hrpub/common/components/emptyImg';
+
+// 框架方法
+import {createPage, high} from 'nc-lightapp-front';
+import {render} from '../../../../hrpub/common/frame';
+
+export default {
+    actions: {
+        mainAct: MainAction,
+        btnAct: ButtonAction,
+        formAct: FormAction,
+    },
+    components: {
+        AddPage,
+        FileManager,
+        Layout,
+        EmptyPage
+    },
+    methods: {
+        createPage,
+        high,
+        render
+    }
+}

+ 43 - 0
src/hrkq/billApprove/attendance/container/index.js

@@ -0,0 +1,43 @@
+import React from 'react';
+
+import './index.less';
+
+// 页面配置信息配置
+import pageConfig from './config';
+
+const {
+    components: {
+        AddPage, 
+        FileManager
+    },
+    actions,
+    methods: {
+        createPage,
+        render
+    }
+} = pageConfig;
+
+
+const HomePage = render({
+    actions: actions
+})(({props, action, state}) => {
+
+    const {attendance} = props;
+
+    return (
+        <div>
+            <AddPage 
+                {...props}
+            />
+            <If condition={attendance.fileManagerModalVisible}>
+                <FileManager
+                    language={attendance.language}
+                    billId={attendance.fileManagerBillId}
+                    onClose={action.mainAct.closeModal.bind(this, 'fileManagerModalVisible')}
+                />
+            </If>
+        </div>
+    );
+})
+
+export default createPage({})(HomePage);

+ 25 - 0
src/hrkq/billApprove/attendance/container/index.less

@@ -0,0 +1,25 @@
+.employing-page {
+    height: 100%;
+    td {
+        position: relative;
+    }
+
+    .layout-header-button-wrapper {
+        position: relative;
+        top: -4px;
+    }
+    
+    .employing-main-table-wrapper {
+        background: #fff;
+    }
+}
+
+.lightapp-component-approvedown .approvedown-content-lists {
+    padding: 0;
+    .approvedown-content-item {
+        padding: 0 24px;
+    }
+}
+.nc-modal .u-modal-dialog .u-modal-footer .button-undefined {
+    margin-right: 10px !important;
+}

+ 14 - 0
src/hrkq/billApprove/attendance/main/index.js

@@ -0,0 +1,14 @@
+import React from 'react';
+
+import {start, connect} from '../../../../hrpub/common/frame';
+
+import HomePage from '../container';
+import model from '../model/model';
+
+const Wrapper = connect(HomePage);
+
+start({
+    root: document.getElementById('app'),
+    component: <Wrapper />,
+    model: [model]
+});

+ 57 - 0
src/hrkq/billApprove/attendance/model/model.js

@@ -0,0 +1,57 @@
+import { hrAjax as proFetch } from 'src/hrpub/common/utils/utils';
+
+export default {
+    name: 'attendance',
+    data: {
+        orgValue: null, // 人力资源组织
+        language: {}, // 多语
+        context: {}, // 上下文
+        page: 'edit', // 当前页面, main主页面,add新增页面,edit修改页面
+        addPageStatus: 'edit', // 新增页面的状态,edit编辑态,browse浏览态       
+        fileManagerModalVisible: false, // 福建管理弹显示显示隐藏
+        fileManagerBillId: '', // 传递给福建管理的id
+        fromApprove: true, // 是否来自于审批中心的打开
+        approveBillType: '', // 审批详情弹窗的billType
+        approveBillId: '', // 审批详情弹窗的billId
+        approveModalVisible: false, // 审批详情弹窗的显示和隐藏
+        showOrgRefer: false, // 是否显示组织参照
+        compositedisplay: false, //指派弹窗 是否显示
+        compositedata: null, //指派弹窗数据
+        compositepostdata: null,//指派弹窗确认事件传到后台数据
+        pageHeight: 0, // 获取页面高度
+    },
+    sync: {
+        update(state, payload) {
+            return {
+                ...state,
+                ...payload
+            };
+        }
+    },
+    async: {
+    
+        // 跳转到新增页面前进行验证
+        checkToAddPage(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hryf/entrymng/EntryAddAction.do',
+                body: payload.postData
+            });
+        },
+        // 新增页面编辑前
+        formEditBefore(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hryf/entrymng/EntryBeforeEditAction.do',
+                body: payload.postData,
+                loading: false
+            });
+        },
+
+        // 获取一条数据
+        getBillDetail(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hrkq/attendance/QueryByIdApproveAction.do',
+                body: payload
+            });
+        }
+    }
+};

+ 1 - 0
src/hrkq/billApprove/leave/README.md

@@ -0,0 +1 @@
+## 补考勤审批页面

+ 103 - 0
src/hrkq/billApprove/leave/actions/btn.js

@@ -0,0 +1,103 @@
+
+export default class ButtonAction {
+    constructor(comp) {
+        this.action = comp.action;
+        this.comp = comp;
+    }
+    
+    didAllInstance = () => {
+        this.setBtnHandleMap();
+    }
+
+    // 生成按钮map
+    setBtnHandleMap = () => {
+        this.buttonHandleMap = {
+            // 打印
+            'print': this.printTable,
+            // 输出
+            'output': this.outputTable
+        }
+    }
+
+
+    // 第一次进页面的按钮状态
+    initPageButton = () => {
+        const {props} = this.comp;
+        const {
+            button
+        } = props;
+        button.setButtonVisible({
+            approveinfo: false,
+            cardrpt: false,
+            file: false
+        });
+    }
+
+    // 按钮点击回调
+    headerClick = (props, btnCode) => {
+        if(typeof this.buttonHandleMap[btnCode] === 'function') {
+            this.buttonHandleMap[btnCode]();
+        }
+    }
+
+    // 打印
+    printTable = () => {
+        const {props} = this.comp;
+        const {leave, editTable, meta} = props;
+
+        let tableWrapper = document.getElementById('mainTable');
+
+        this.print(tableWrapper, {
+            title: leave.language['gx6008-000067'], // 录用办理
+            maker: leave.language['gx6008-000068'], // 制作者
+            date: leave.language['gx6008-000069'], // 制作日期
+            tableInfo: {
+                data: editTable.getAllRows('list'),
+                tableTmp: meta.getMeta()['list']
+            },
+            beforeAppend: (data) => {
+                data[0].map((item, rowIndex) => {
+                    delete item[0];
+                });
+                data[1].map((item) => {
+                    item.length = item.length - 1;
+                });
+                return data;
+            }
+        });
+    }
+
+    // 输出
+    outputTable = () => {
+        const {
+            props: {
+                editTable,
+                leave: {
+                    language
+                },
+                meta
+            }
+        } = this.comp;
+        let tableWrapper = document.getElementById('mainTable');
+        let tableData = editTable.getAllData('list');
+
+        this.exportHtml(tableWrapper, {
+            fileName: language['gx6008-000067'] // '录用办理'
+        }, {
+            meta: meta.getMeta()['list'],
+            data: tableData.rows,
+            showIndex: false
+        });
+    }
+
+    // 附件管理
+    fileManager = (selectedRows) => {
+        const { dispatch } = this.comp.props;
+        dispatch({
+            type: 'leave/update',
+            payload: {
+                fileManagerModalVisible: true
+            }
+        });
+    }
+}

+ 15 - 0
src/hrkq/billApprove/leave/actions/constant.js

@@ -0,0 +1,15 @@
+export default class Constant {
+    reqData = [{
+        rqUrl: '/platform/templet/querypage.do',
+        rqJson: `{\n  \"pagecode\": \"60656041nccloud\",\n  \"appcode\": \"60656041\"\n}`,
+        rqCode: 'template'
+    }, {
+        rqUrl: '/platform/appregister/queryallbtns.do',
+        rqJson: `{\n  \"pagecode\": \"60656041nccloud\",\n  \"appcode\": \"60656041\"\n}`,
+        rqCode: 'button'
+    }, {
+        rqUrl: '/platform/appregister/queryappcontext.do',
+        rqJson: `{\n  \"appcode\": \"60656041\"}`,
+        rqCode: 'context'
+    }];
+};

+ 103 - 0
src/hrkq/billApprove/leave/actions/main.js

@@ -0,0 +1,103 @@
+import Constant from './constant';
+import HrPubCommon from '../../../../hrpub/common/actions';
+import { getAppPageConfig } from 'src/hrpub/common/utils/utils';
+const {appcode, pagecode} = getAppPageConfig()
+
+export default class MainAction extends HrPubCommon {
+    constructor(comp) {
+        super();
+        this.comp = comp;
+    }
+
+    extend = [Constant]
+
+    appConfig = {
+        pagecode,
+        appcode
+    }
+
+    update = async (obj) => {
+        const {props} = this.comp;
+        const {dispatch} = props;
+
+        await dispatch({
+            type: 'leave/update',
+            payload: obj
+        });
+    }
+    // 处理模版
+    processTemplate = (res) => {
+        return this.selfProcessTemplate(res);
+    }
+    // 处理模版数据
+    selfProcessTemplate = (res) => {
+        res.template['leave_approve_card'].items.forEach(item => {
+            if (item.attrcode === 'leaveday' || item.attrcode === 'begintime' || item.attrcode === 'endtime'|| item.attrcode === 'showbegindate' || item.attrcode === 'showenddate') {
+                item.itemtype = 'input'
+            }
+        })
+
+        return res.template
+    }
+    // 获取多语
+    getCurrentLanguage = () => {
+        this.getLanguage('hrkq-approve', 'hrkq').then((json,status, init) => {
+            this.update({
+                language: json
+            })
+        });
+    }
+
+    // 获取模版信息
+    getTemplate = () => {
+        this.getMultiTemplate(this.reqData)
+            .then((res) => {
+                this.update({
+                    context: res.context
+                });
+                // this.afterGetTemplate();
+            });
+    }
+
+    // 当模版获取并设置完成之后的回调函数
+    afterGetTemplate = () => {
+        this.getFormData();
+    }
+
+    // 初始化
+    didMount = () => {
+        this.getTemplate();
+        this.getCurrentLanguage();
+    }
+
+    /**
+     * @desc: 根据id查询详情
+     * @param {type}
+     * @return:
+     */
+    getFormData = async () => {
+        const {props, action} = this.comp;
+        const {getUrlParam} = props;
+
+        let scene = getUrlParam('scene');
+        let id = getUrlParam('id');
+        let status = getUrlParam('status');
+        this.update({
+            fileManagerBillId: id
+        })
+        let methodsName = status === 'browse' ? 'toBrowsePage' : 'toEditPage'
+
+        action.formAct[methodsName](id);
+    }
+
+    /**
+     * @desc: 关闭附件弹框
+     * @param {type}
+     * @return:
+     */
+    hideFileUploader = () => {
+        this.update({
+            fileManagerModalVisible: false
+        })
+    }
+}

+ 145 - 0
src/hrkq/billApprove/leave/actions/turnToFormPage.js

@@ -0,0 +1,145 @@
+import { formatDate } from 'src/hrpub/common/utils/utils';
+export default class FormAction {
+    constructor(comp) {
+        this.comp = comp;
+    }
+    formConfig = {
+        area: 'leave',
+        formCode: 'leave_approve_card'
+    }
+    // 表单进入浏览态
+    toBrowseStatus = (formValue) => {
+        const {props} = this.comp;
+        const {form, button} = props;
+
+        // 单据id
+        let billId = '';
+
+        // 表单进入编辑
+        form.setFormStatus(this.formConfig.formCode, 'browse');
+        // 填充表单的值
+        if(formValue) {
+            form.setAllFormValue({
+                [this.formConfig.formCode]: formValue
+            });
+            let leaveday = form.getFormItemsValue(this.formConfig.formCode, 'leaveday').value;
+            let minunit = form.getFormItemsValue(this.formConfig.formCode, 'minunit').display;
+
+            form.setFormItemsValue(this.formConfig.formCode, {
+                leaveday: {
+                    display: leaveday + minunit,
+                    value: leaveday
+                }
+            })
+            // 判断是否为哺乳假
+            const breastfeedingleaveday = form.getFormItemsValue(this.formConfig.formCode, 'breastfeedingleaveday').value;
+            const breastfeedingleaveway = form.getFormItemsValue(this.formConfig.formCode, 'breastfeedingleaveway').value;
+            if (breastfeedingleaveday && breastfeedingleaveway) {
+                form.setFormItemsValue(this.formConfig.formCode, {
+                    begintime: {
+                        value: form.getFormItemsValue(this.formConfig.formCode, 'begintime').value.split(" ")[0]
+                    },
+                    endtime: {
+                        value: form.getFormItemsValue(this.formConfig.formCode, 'endtime').value.split(" ")[0]
+                    }
+                })
+            }
+
+            this.initCardMeta(this.formConfig.formCode)
+            billId = formValue.rows[0].values['pk_leave'].value;
+        }
+
+        // 按钮进入编辑的按钮
+        this.update({
+            addPageStatus: 'browse'
+        })
+        // 隐藏掉一些按钮
+        button.setButtonVisible({
+            print: true,
+            batchadd: false
+        });
+    }
+    initCardMeta = (formCode) => {
+        const { form } = this.comp.props;
+        const { getFormItemsValue, setFormItemsValue, setFormItemsVisible } = form;
+        let halfDayBegin = getFormItemsValue(formCode, 'start_day_type').value;
+        let halfDayEnd = getFormItemsValue(formCode, 'end_day_type').value;
+        let begintime = getFormItemsValue(formCode, 'begintime').value;
+        let endtime = getFormItemsValue(formCode, 'endtime').value;
+        let showbegindate = getFormItemsValue(formCode, 'showbegindate').value;
+        let showenddate = getFormItemsValue(formCode, 'showenddate').value;
+        let breastfeedingleaveway = getFormItemsValue(formCode, 'breastfeedingleaveway').value;
+        let minunit = form.getFormItemsValue(this.formConfig.formCode, 'minunit').value;
+        let obj = {}
+        let flag = minunit === '1'; // 小时
+        let flag1 = minunit === '2' && !halfDayBegin // 天
+        let flag2 = minunit === '2' && halfDayBegin // 半天
+        let cardDefaultVisiable = {
+            breastfeedingleaveway: !!breastfeedingleaveway,
+            breastfeedingleaveday: !!breastfeedingleaveway,
+            leaveday: !breastfeedingleaveway
+        }
+        setFormItemsVisible(formCode, cardDefaultVisiable);
+        if (!flag || breastfeedingleaveway) {
+            obj = {
+                begintime: {
+                    display: begintime.replace(/\s(\d|:)+/, (a, b) => {
+                        return (flag1 || breastfeedingleaveway)? '' : getFormItemsValue(formCode, 'start_day_type').display
+                    }),
+                    value: begintime,
+                },
+                endtime: {
+                    display: endtime.replace(/\s(\d|:)+/, (a, b) => {
+                        return (flag1 || breastfeedingleaveway)? '' : getFormItemsValue(formCode, 'end_day_type').display
+                    }),
+                    value: endtime,
+                },
+                showbegindate: {
+                    display: showbegindate.replace(/\s(\d|:)+/, (a, b) => {
+                        return (flag1 || breastfeedingleaveway)? '' : getFormItemsValue(formCode, 'start_day_type').display
+                    }),
+                    value: begintime,
+                },
+                showenddate: {
+                    display: showenddate.replace(/\s(\d|:)+/, (a, b) => {
+                        return (flag1 || breastfeedingleaveway)? '' : getFormItemsValue(formCode, 'end_day_type').display
+                    }),
+                    value: endtime,
+                },
+            }
+            setFormItemsValue(formCode, obj)
+        }
+    }
+    // 直接进入预览页面
+    toBrowsePage = async (id, formValue) => {
+        try {
+            let oneBillData = await this.getOneBillData(id);
+            if (oneBillData) {
+                this.toBrowseStatus(oneBillData.data[this.formConfig.area][this.formConfig.formCode]);
+            }
+        }
+        catch(e) {
+        }
+    }
+
+    // 获取一条数据
+    getOneBillData = async (pk_leave) => {
+        const {props} = this.comp;
+        const {dispatch} = props;
+        try {
+            let res = await dispatch({
+                type: 'leave/getBillDetail',
+                payload: {
+                    pk_leave
+                }
+            });
+
+            if(res.success) {
+                return res;
+            }
+        }
+        catch(e) {
+        }
+        return false;
+    }
+}

+ 61 - 0
src/hrkq/billApprove/leave/components/AddPage/actions/main.js

@@ -0,0 +1,61 @@
+
+import {
+    output,
+    print
+} from 'nc-lightapp-front';
+
+export default class Main {
+    constructor(comp) {
+        this.comp = comp;
+    }
+
+    didAllInstance = () => {
+        this.setButtonHandleMap();
+    }
+
+    // 设置按钮事件map
+    setButtonHandleMap = () => {
+        const {action} = this.comp;
+
+        this.buttonHandleMap = {
+            'save': this.saveAddPage,
+            'browse_status': {
+                'callback': this.callbackFromCard,
+                'print': this.printIt,
+                'output': this.output,
+            }
+        };
+    }
+
+    // 打印
+    printIt = () => {
+        let formValue = this.comp.props.form.getAllFormValue('card');
+
+        print('pdf', '/nccloud/hryf/entrymng/EntryPrintAction.do', {
+            appcode: '60656046',
+            nodekey: '60081010',
+            oids: [formValue.rows[0].values['pk_entryapply'].value]
+        });
+    }
+
+    // 输出
+    output = () => {
+        const {props} = this.comp;
+        const {
+            leave
+        } = props;
+        let formValue = this.comp.props.form.getAllFormValue('card');
+        output({
+            url: '/nccloud/hryf/entrymng/EntryPrintAction.do',
+            data: {
+                appcode: '60092010',
+                nodekey: '60081010',
+                oids: [formValue.rows[0].values['pk_entryapply'].value],
+                outputType: 'output',
+                filename: leave.language['gx6008-000067'] // 录用办理
+            },
+            callback: () => {
+            }
+        });
+    }
+}

+ 44 - 0
src/hrkq/billApprove/leave/components/AddPage/components/Header/index.js

@@ -0,0 +1,44 @@
+import React, {Component} from 'react';
+
+import './index.less';
+
+import {
+    base
+} from 'nc-lightapp-front';
+
+const {
+    NCButton
+} = base;
+
+export default class AddPageHeader extends Component {
+    constructor(props) {
+        super(props);
+    }
+
+    render() {
+        const {
+            status, 
+            onClick, 
+            button, 
+            language,
+            cancelEdit,
+            cardPagination,
+            toBrowsePage,
+            fromApprove
+        } = this.props;
+
+        return (
+            <div className="add-page-header-wrapper">
+                
+                <Choose>
+                    <When condition={status === 'browse'}>
+                        {button.createButtonApp({
+                            area: 'head',
+                            onButtonClick: onClick('browse_status')
+                        })}
+                    </When>
+                </Choose>
+            </div>
+        );
+    }
+}

+ 3 - 0
src/hrkq/billApprove/leave/components/AddPage/components/Header/index.less

@@ -0,0 +1,3 @@
+.add-page-header-wrapper {
+    float: right;
+}

+ 32 - 0
src/hrkq/billApprove/leave/components/AddPage/config.js

@@ -0,0 +1,32 @@
+/**
+ * 
+ * 
+ * 编辑页面配置文件
+ * 
+ */
+
+ // actions
+ import MainAction from './actions/main';
+ import Btnction from '../../actions/btn';
+ import FormAction from '../../actions/turnToFormPage';
+ 
+ // 方法
+ import {render, connect} from '../../../../../hrpub/common/frame';
+ 
+ // 组件
+ import Layout from '../../../../../hrpub/common/components/Layout';
+ 
+  export default {
+       actions: {
+          mainAct: MainAction,
+          formAct: FormAction,
+          btnAct: Btnction
+       },
+       methods: {
+          render,
+          connect
+       },
+       components: {
+          Layout
+       }
+  }

+ 52 - 0
src/hrkq/billApprove/leave/components/AddPage/index.js

@@ -0,0 +1,52 @@
+import React from 'react';
+import './index.less';
+
+import config from './config';
+
+const {
+    actions,
+    methods: {
+        render,
+        connect
+    },
+    components: {
+        Layout
+    }
+} = config;
+
+const {Header,Content} = Layout;
+
+const Wrapper = render({
+    actions: actions
+})(({props, action, state}) => {
+    props.use.form('leave_approve_card')
+    const {form, leave, cardPagination, button} = props;
+    const { btnAct } = action
+
+    return (
+        <Layout
+            className="employing-add-page"
+        >
+           <div className="bill-bg">
+           <Header
+                showOrgRefer={false}
+                showButtons={true}
+                button={button}
+                buttonOptions={{
+                    area: 'head', //如果页面中的有多个区域有按钮,这里的area当做筛选条件,只渲染按钮的后台数据中area字段为这里指定值的按钮;
+                    onButtonClick: (props, btncode) => {
+                        btnAct.fileManager()
+                    }// 按钮的点击事件
+                }}
+            >
+                <div className="approve_title">{leave.language['approve-00003']}{/* 休假单审批 */}</div>
+            </Header>
+            <Content>
+                {form.createForm('leave_approve_card', {})}
+            </Content>
+           </div>
+        </Layout>
+    );
+});
+
+export default connect(Wrapper);

+ 14 - 0
src/hrkq/billApprove/leave/components/AddPage/index.less

@@ -0,0 +1,14 @@
+.employing-add-page {
+    height: 100%;
+}
+.approve_title {
+    display: inline-block;
+    font-size: 16px;
+    color: #111;
+    font-weight: 700;
+    line-height: 38px;
+}
+.bill-bg{
+    background: #f6f6f6;
+    overflow: hidden;
+}

+ 42 - 0
src/hrkq/billApprove/leave/components/Uploader/index.js

@@ -0,0 +1,42 @@
+import React, {Component} from 'react';
+import './index.less';
+// import {high} from 'nc-lightapp-front';
+
+// const {NCUploader} = high;
+import NCUploader from 'uap/common/components/NCUploader';
+class Uploader extends Component {
+    constructor(props) {
+        super(props);
+    }
+
+    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) {
+            alert(this.props.language['gx6008-000117'])/* 国际化处理: 上传大小小于2M*/
+        }
+        return isLt2M;
+        // 备注: return false 不执行上传  return true 执行上传
+    }
+
+    render() {
+        return (
+            <NCUploader
+                    billId={this.props.billId}
+                    disableButton={true}
+                    onHide={this.onHideUploader} // 关闭功能
+                    beforeUpload={this.beforeUpload}
+            />
+        );
+    }
+}
+
+export default Uploader;

+ 0 - 0
src/hrkq/billApprove/leave/components/Uploader/index.less


+ 39 - 0
src/hrkq/billApprove/leave/container/config.js

@@ -0,0 +1,39 @@
+/** 
+ * 
+ * container组件的配置文件
+ * 
+ */
+
+// actions
+import MainAction from '../actions/main';
+import ButtonAction from '../actions/btn';
+import FormAction from '../actions/turnToFormPage';
+
+// 本节点组件
+import AddPage from '../components/AddPage';
+import FileManager from '../components/Uploader';
+
+// 公用组件
+import Layout from '../../../../hrpub/common/components/Layout';
+
+// 框架方法
+import {createPage, high} from 'nc-lightapp-front';
+import {render} from '../../../../hrpub/common/frame';
+
+export default {
+    actions: {
+        mainAct: MainAction,
+        btnAct: ButtonAction,
+        formAct: FormAction,
+    },
+    components: {
+        AddPage,
+        FileManager,
+        Layout
+    },
+    methods: {
+        createPage,
+        high,
+        render
+    }
+}

+ 43 - 0
src/hrkq/billApprove/leave/container/index.js

@@ -0,0 +1,43 @@
+import React from 'react';
+
+import './index.less';
+
+// 页面配置信息配置
+import pageConfig from './config';
+
+const {
+    components: {
+        AddPage, 
+        FileManager
+    },
+    actions,
+    methods: {
+        createPage,
+        render
+    }
+} = pageConfig;
+
+
+const HomePage = render({
+    actions: actions
+})(({props, action, state}) => {
+
+    const {leave} = props;
+
+    return (
+        <div>
+            <AddPage 
+                {...props}
+            />
+            {
+                leave.fileManagerModalVisible && <FileManager
+                language={leave.language}
+                billId={leave.fileManagerBillId}
+                onClose={action.mainAct.hideFileUploader}
+            />
+            }
+        </div>
+    );
+})
+
+export default createPage({})(HomePage);

+ 25 - 0
src/hrkq/billApprove/leave/container/index.less

@@ -0,0 +1,25 @@
+.employing-page {
+    height: 100%;
+    td {
+        position: relative;
+    }
+
+    .layout-header-button-wrapper {
+        position: relative;
+        top: -4px;
+    }
+    
+    .employing-main-table-wrapper {
+        background: #fff;
+    }
+}
+
+.lightapp-component-approvedown .approvedown-content-lists {
+    padding: 0;
+    .approvedown-content-item {
+        padding: 0 24px;
+    }
+}
+.nc-modal .u-modal-dialog .u-modal-footer .button-undefined {
+    margin-right: 10px !important;
+}

+ 14 - 0
src/hrkq/billApprove/leave/main/index.js

@@ -0,0 +1,14 @@
+import React from 'react';
+
+import {start, connect} from '../../../../hrpub/common/frame';
+
+import HomePage from '../container';
+import model from '../model/model';
+import { handleHash } from 'src/hrpub/common/utils/utils'
+const Wrapper = handleHash('201910116420104', 'c=60656041&p=60656041nccloud')(connect(HomePage));
+
+start({
+    root: document.getElementById('app'),
+    component: <Wrapper />,
+    model: [model]
+});

+ 56 - 0
src/hrkq/billApprove/leave/model/model.js

@@ -0,0 +1,56 @@
+import { hrAjax as proFetch } from 'src/hrpub/common/utils/utils';
+export default {
+    name: 'leave',
+    data: {
+        orgValue: null, // 人力资源组织
+        language: {}, // 多语
+        context: {}, // 上下文
+        page: 'edit', // 当前页面, main主页面,add新增页面,edit修改页面
+        addPageStatus: 'edit', // 新增页面的状态,edit编辑态,browse浏览态       
+        fileManagerModalVisible: false, // 福建管理弹显示显示隐藏
+        fileManagerBillId: '', // 传递给福建管理的id
+        fromApprove: true, // 是否来自于审批中心的打开
+        approveBillType: '', // 审批详情弹窗的billType
+        approveBillId: '', // 审批详情弹窗的billId
+        approveModalVisible: false, // 审批详情弹窗的显示和隐藏
+        showOrgRefer: false, // 是否显示组织参照
+        compositedisplay: false, //指派弹窗 是否显示
+        compositedata: null, //指派弹窗数据
+        compositepostdata: null,//指派弹窗确认事件传到后台数据
+        pageHeight: 0 // 获取页面高度
+    },
+    sync: {
+        update(state, payload) {
+            return {
+                ...state,
+                ...payload
+            };
+        }
+    },
+    async: {
+    
+        // 跳转到新增页面前进行验证
+        checkToAddPage(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hryf/entrymng/EntryAddAction.do',
+                body: payload.postData
+            });
+        },
+        // 新增页面编辑前
+        formEditBefore(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hryf/entrymng/EntryBeforeEditAction.do',
+                body: payload.postData,
+                loading: false
+            });
+        },
+
+        // 获取一条数据
+        getBillDetail(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hrkq/leave/QueryByIdApproveAction.do',
+                body: payload
+            });
+        }
+    }
+};

+ 1 - 0
src/hrkq/billApprove/leaveoff/README.md

@@ -0,0 +1 @@
+## 补考勤审批页面

+ 103 - 0
src/hrkq/billApprove/leaveoff/actions/btn.js

@@ -0,0 +1,103 @@
+
+export default class ButtonAction {
+    constructor(comp) {
+        this.action = comp.action;
+        this.comp = comp;
+    }
+
+    didAllInstance = () => {
+        this.setBtnHandleMap();
+    }
+
+    // 生成按钮map
+    setBtnHandleMap = () => {
+        this.buttonHandleMap = {
+            // 打印
+            'print': this.printTable,
+            // 输出
+            'output': this.outputTable
+        }
+    }
+
+
+    // 第一次进页面的按钮状态
+    initPageButton = () => {
+        const {props} = this.comp;
+        const {
+            button
+        } = props;
+        button.setButtonVisible({
+            approveinfo: false,
+            cardrpt: false,
+            file: false
+        });
+    }
+
+    // 按钮点击回调
+    headerClick = (props, btnCode) => {
+        console.log(btnCode);
+        if(typeof this.buttonHandleMap[btnCode] === 'function') {
+            this.buttonHandleMap[btnCode]();
+        }
+    }
+
+    // 打印
+    printTable = () => {
+        const {props} = this.comp;
+        const {leaveoff, editTable, meta} = props;
+
+        let tableWrapper = document.getElementById('mainTable');
+
+        this.print(tableWrapper, {
+            title: leaveoff.language['gx6008-000067'], // 录用办理
+            maker: leaveoff.language['gx6008-000068'], // 制作者
+            date: leaveoff.language['gx6008-000069'], // 制作日期
+            tableInfo: {
+                data: editTable.getAllRows('list'),
+                tableTmp: meta.getMeta()['list']
+            },
+            beforeAppend: (data) => {
+                data[0].map((item, rowIndex) => {
+                    delete item[0];
+                });
+                data[1].map((item) => {
+                    item.length = item.length - 1;
+                });
+                return data;
+            }
+        });
+    }
+
+    // 输出
+    outputTable = () => {
+        const {
+            props: {
+                editTable,
+                leaveoff: {
+                    language
+                },
+                meta
+            }
+        } = this.comp;
+        let tableWrapper = document.getElementById('mainTable');
+        let tableData = editTable.getAllData('list');
+
+        this.exportHtml(tableWrapper, {
+            fileName: language['gx6008-000067'] // '录用办理'
+        }, {
+            meta: meta.getMeta()['list'],
+            data: tableData.rows,
+            showIndex: false
+        });
+    }
+
+    // 附件管理
+    fileManager = (selectedRows) => {
+        let billId = selectedRows[0].values['bill_code'].value;
+
+        this.update({
+            fileManagerBillId: billId,
+            fileManagerModalVisible: true
+        });
+    }
+}

+ 15 - 0
src/hrkq/billApprove/leaveoff/actions/constant.js

@@ -0,0 +1,15 @@
+export default class Constant {
+    reqData = [{
+        rqUrl: '/platform/templet/querypage.do',
+        rqJson: `{\n  \"pagecode\": \"60656044nccloud\",\n  \"appcode\": \"60656044\"\n}`,
+        rqCode: 'template'
+    }, {
+        rqUrl: '/platform/appregister/queryallbtns.do',
+        rqJson: `{\n  \"pagecode\": \"60656044nccloud\",\n  \"appcode\": \"60656044\"\n}`,
+        rqCode: 'button'
+    }, {
+        rqUrl: '/platform/appregister/queryappcontext.do',
+        rqJson: `{\n  \"appcode\": \"60656044\"}`,
+        rqCode: 'context'
+    }];
+};

+ 92 - 0
src/hrkq/billApprove/leaveoff/actions/main.js

@@ -0,0 +1,92 @@
+import Constant from './constant';
+import HrPubCommon from '../../../../hrpub/common/actions';
+import { getAppPageConfig } from 'src/hrpub/common/utils/utils';
+const {appcode, pagecode} = getAppPageConfig()
+
+export default class MainAction extends HrPubCommon {
+    constructor(comp) {
+        super();
+        this.comp = comp;
+    }
+
+    extend = [Constant]
+
+    appConfig = {
+        pagecode,
+        appcode
+    }
+
+    update = async (obj) => {
+        const {props} = this.comp;
+        const {dispatch} = props;
+
+        await dispatch({
+            type: 'leaveoff/update',
+            payload: obj
+        });
+    }
+    // 处理模版
+    processTemplate = (res) => {
+        return this.selfProcessTemplate(res);
+    }
+     // 处理模版数据
+    selfProcessTemplate = (res) => {
+        // 请假时长,销假时长,请假show 时间,销假 show 时间
+        let inputTypeAttrcode = ['leaveday','leaveoffday','leaveshowbegindate','leaveshowenddate','leaveoffshowbegindate','leaveoffshowenddate']
+        res.template['leaveoff_approve_card'].items.forEach(item => {
+            if (inputTypeAttrcode.includes(item.attrcode)) {
+                item.itemtype = 'input'
+            }
+        })
+
+        return res.template
+    }
+    // 获取多语
+    getCurrentLanguage = () => {
+        this.getLanguage('hrkq-approve', 'hrkq').then((json,status, init) => {
+            this.update({
+                language: json
+            })
+        });
+    }
+
+    // 获取模版信息
+    getTemplate = () => {
+        this.getMultiTemplate(this.reqData)
+            .then((res) => {
+                this.update({
+                    context: res.context
+                });
+                // this.afterGetTemplate();
+            });
+    }
+
+    // 当模版获取并设置完成之后的回调函数
+    afterGetTemplate = () => {
+        this.getFormData();
+    }
+
+    // 初始化
+    didMount = () => {
+        this.getTemplate();
+        this.getCurrentLanguage();
+    }
+
+    /**
+     * @desc: 根据id查询详情
+     * @param {type}
+     * @return:
+     */
+    getFormData = async () => {
+        const {props, action} = this.comp;
+        const {getUrlParam} = props;
+
+        let scene = getUrlParam('scene');
+        let id = getUrlParam('id');
+        let status = getUrlParam('status');
+
+        let methodsName = status === 'browse' ? 'toBrowsePage' : 'toEditPage'
+
+        action.formAct[methodsName](id);
+    }
+}

+ 116 - 0
src/hrkq/billApprove/leaveoff/actions/turnToFormPage.js

@@ -0,0 +1,116 @@
+import {getBusinessInfo, cacheTools} from 'nc-lightapp-front';
+
+let businessInfo = getBusinessInfo() || {};
+
+export default class FormAction {
+    constructor(comp) {
+        this.comp = comp;
+    }
+    formConfig = {
+        area: 'leaveoff',
+        formCode: 'leaveoff_approve_card'
+    }
+
+    // 表单进入浏览态
+    toBrowseStatus = (formValue) => {
+        const {props} = this.comp;
+        const {form, button} = props;
+
+        // 单据id
+        let billId = '';
+
+        // 表单进入编辑
+        form.setFormStatus(this.formConfig.formCode, 'browse');
+        // 填充表单的值
+        if(formValue) {
+            this.initCardMeta(formValue)
+            form.setAllFormValue({
+                [this.formConfig.formCode]: formValue
+            });
+        }
+
+        // 按钮进入编辑的按钮
+        this.update({
+            addPageStatus: 'browse'
+        })
+        // 隐藏掉一些按钮
+        button.setButtonVisible({
+            print: true,
+            batchadd: false
+        });
+    }
+
+    // 直接进入预览页面
+    toBrowsePage = async (id, formValue) => {
+        try {
+            let oneBillData = await this.getOneBillData(id);
+            if (oneBillData) {
+                this.toBrowseStatus(oneBillData.data[this.formConfig.area][this.formConfig.formCode]);
+            }
+        }
+        catch(e) {
+        }
+    }
+
+    // 获取一条数据
+    getOneBillData = async (pk_leaveoff) => {
+        const {props} = this.comp;
+        const {dispatch, leaveoff} = props;
+        try {
+            let res = await dispatch({
+                type: 'leaveoff/getBillDetail',
+                payload: {
+                    pk_leaveoff
+                }
+            });
+
+            if(res.success) {
+                return res;
+            }
+        }
+        catch(e) {
+        }
+        return false;
+    }
+    initCardMeta = (formValue) => {
+        let values = formValue.rows[0].values
+        let leaveday = values.leaveday.value;
+        let leaveoffday = values.leaveoffday.value;
+        let minunitDisplay = values.minunit.display;
+
+        let halfDay = values.leave_start_day_type.value;
+        let leaveshowbegindate = values.leaveshowbegindate.value||'';
+        let leaveshowenddate = values.leaveshowenddate.value||'';
+        let leaveoffshowbegindate = values.leaveoffshowbegindate.value||'';
+        let leaveoffshowenddate = values.leaveoffshowenddate.value||'';
+        let dr_flag = values.dr_flag.value;
+        let breastfeedingleaveday = values.breastfeedingleaveday;
+        let feedStatus = breastfeedingleaveday && breastfeedingleaveday.value || false
+        let minunit = values.minunit.value;
+        values.leaveday.display = leaveday + minunitDisplay;
+        if (dr_flag === '1') {
+            values.leaveoffday.display = 0 + minunitDisplay;
+        } else {
+            values.leaveoffday.display = leaveoffday + minunitDisplay;
+        }
+
+        let obj = {}
+        let flag = minunit === '1'; // 小时
+        let flag1 = minunit === '2' && !halfDay // 天
+        let flag2 = minunit === '2' && halfDay // 半天
+        if (!flag||feedStatus) {
+            values.leaveshowbegindate.display =leaveshowbegindate.replace(/\s((?:\d|:)+)/, (a, b) => {
+                return flag1||feedStatus ? '' : (b > '12:00:00' ? ' 下午' : ' 上午')
+            })
+            values.leaveshowenddate.display =leaveshowenddate.replace(/\s((?:\d|:)+)/, (a, b) => {
+                return flag1||feedStatus ? '' : (b > '12:00:00' ? ' 下午' : ' 上午')
+            })
+            values.leaveoffshowbegindate.display =leaveoffshowbegindate.replace(/\s((?:\d|:)+)/, (a, b) => {
+                return flag1||feedStatus ? '' : (b > '12:00:00' ? ' 下午' : ' 上午')
+            })
+            values.leaveoffshowenddate.display =leaveoffshowenddate.replace(/\s((?:\d|:)+)/, (a, b) => {
+                return flag1||feedStatus ? '' : (b > '12:00:00' ? ' 下午' : ' 上午')
+            })
+        }
+    }
+}

+ 61 - 0
src/hrkq/billApprove/leaveoff/components/AddPage/actions/main.js

@@ -0,0 +1,61 @@
+
+import {
+    output,
+    print
+} from 'nc-lightapp-front';
+
+export default class Main {
+    constructor(comp) {
+        this.comp = comp;
+    }
+
+    didAllInstance = () => {
+        this.setButtonHandleMap();
+    }
+
+    // 设置按钮事件map
+    setButtonHandleMap = () => {
+        const {action} = this.comp;
+
+        this.buttonHandleMap = {
+            'save': this.saveAddPage,
+            'browse_status': {
+                'callback': this.callbackFromCard,
+                'print': this.printIt,
+                'output': this.output,
+            }
+        };
+    }
+
+    // 打印
+    printIt = () => {
+        let formValue = this.comp.props.form.getAllFormValue('card');
+
+        print('pdf', '/nccloud/hryf/entrymng/EntryPrintAction.do', {
+            appcode: '60656046',
+            nodekey: '60081010',
+            oids: [formValue.rows[0].values['pk_entryapply'].value]
+        });
+    }
+
+    // 输出
+    output = () => {
+        const {props} = this.comp;
+        const {
+            leaveoff
+        } = props;
+        let formValue = this.comp.props.form.getAllFormValue('card');
+        output({
+            url: '/nccloud/hryf/entrymng/EntryPrintAction.do',
+            data: {
+                appcode: '60092010',
+                nodekey: '60081010',
+                oids: [formValue.rows[0].values['pk_entryapply'].value],
+                outputType: 'output',
+                filename: leaveoff.language['gx6008-000067'] // 录用办理
+            },
+            callback: () => {
+            }
+        });
+    }
+}

+ 44 - 0
src/hrkq/billApprove/leaveoff/components/AddPage/components/Header/index.js

@@ -0,0 +1,44 @@
+import React, {Component} from 'react';
+
+import './index.less';
+
+import {
+    base
+} from 'nc-lightapp-front';
+
+const {
+    NCButton
+} = base;
+
+export default class AddPageHeader extends Component {
+    constructor(props) {
+        super(props);
+    }
+
+    render() {
+        const {
+            status, 
+            onClick, 
+            button, 
+            language,
+            cancelEdit,
+            cardPagination,
+            toBrowsePage,
+            fromApprove
+        } = this.props;
+
+        return (
+            <div className="add-page-header-wrapper">
+                
+                <Choose>
+                    <When condition={status === 'browse'}>
+                        {button.createButtonApp({
+                            area: 'head',
+                            onButtonClick: onClick('browse_status')
+                        })}
+                    </When>
+                </Choose>
+            </div>
+        );
+    }
+}

+ 3 - 0
src/hrkq/billApprove/leaveoff/components/AddPage/components/Header/index.less

@@ -0,0 +1,3 @@
+.add-page-header-wrapper {
+    float: right;
+}

+ 30 - 0
src/hrkq/billApprove/leaveoff/components/AddPage/config.js

@@ -0,0 +1,30 @@
+/**
+ * 
+ * 
+ * 编辑页面配置文件
+ * 
+ */
+
+ // actions
+import MainAction from './actions/main';
+import FormAction from '../../actions/turnToFormPage';
+
+// 方法
+import {render, connect} from '../../../../../hrpub/common/frame';
+
+// 组件
+import Layout from '../../../../../hrpub/common/components/Layout';
+
+ export default {
+      actions: {
+         mainAct: MainAction,
+         formAct: FormAction,
+      },
+      methods: {
+         render,
+         connect
+      },
+      components: {
+         Layout
+      }
+ }

+ 45 - 0
src/hrkq/billApprove/leaveoff/components/AddPage/index.js

@@ -0,0 +1,45 @@
+import React from 'react';
+import './index.less';
+
+import config from './config';
+
+
+const {
+    actions,
+    methods: {
+        render,
+        connect
+    },
+    components: {
+        Layout
+    }
+} = config;
+
+const {Header,Content} = Layout;
+
+const Wrapper = render({
+    actions: actions
+})(({props, action, state}) => {
+    props.use.form('leaveoff_approve_card')
+    const {form, leaveoff, cardPagination} = props;
+
+    return (
+        <Layout
+            className="employing-add-page"
+        >
+            <div className="bill-bg">
+            <Header
+                showOrgRefer={false}
+                showButtons={false}
+            >
+                <div className="approve_title">{leaveoff.language['approve-00007']}{/* 销假单审批 */}</div>
+            </Header>
+            <Content>
+                {form.createForm('leaveoff_approve_card', {})}
+            </Content>
+            </div>
+        </Layout>
+    );
+});
+
+export default connect(Wrapper);

+ 14 - 0
src/hrkq/billApprove/leaveoff/components/AddPage/index.less

@@ -0,0 +1,14 @@
+.employing-add-page {
+    height: 100%;
+}
+.approve_title {
+    display: inline-block;
+    font-size: 16px;
+    color: #111;
+    font-weight: 700;
+    line-height: 38px;
+}
+.bill-bg{
+    overflow: hidden;
+    background: #f6f6f6;
+}

+ 56 - 0
src/hrkq/billApprove/leaveoff/components/Uploader/index.js

@@ -0,0 +1,56 @@
+import React, {Component} from 'react';
+import './index.less';
+// import {high} from 'nc-lightapp-front';
+
+// const {NCUploader} = high;
+import NCUploader from 'uap/common/components/NCUploader';
+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 {billId, table, clickRow: clickRowProps} = this.props;
+        if (billId) return billId;
+        const clickRow = table.getClickRowIndex('ncc600704list') || clickRowProps;
+
+        return clickRow && clickRow.record.values.pk_psndoc.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) {
+            alert(this.props.language['gx6008-000117'])/* 国际化处理: 上传大小小于2M*/
+        }
+        return isLt2M;
+        // 备注: return false 不执行上传  return true 执行上传
+    }
+
+    render() {
+        return (
+            <div className='uploader'>
+                <NCUploader
+                    billId={this.props.billId}
+                    //getGroupList={this.getGroupList}
+                    onHide={this.onHideUploader} // 关闭功能
+                    //beforeUpload={this.beforeUpload}
+                />
+            </div>
+        );
+    }
+}
+
+export default Uploader;

+ 0 - 0
src/hrkq/billApprove/leaveoff/components/Uploader/index.less


+ 39 - 0
src/hrkq/billApprove/leaveoff/container/config.js

@@ -0,0 +1,39 @@
+/** 
+ * 
+ * container组件的配置文件
+ * 
+ */
+
+// actions
+import MainAction from '../actions/main';
+import ButtonAction from '../actions/btn';
+import FormAction from '../actions/turnToFormPage';
+
+// 本节点组件
+import AddPage from '../components/AddPage';
+import FileManager from '../components/Uploader';
+
+// 公用组件
+import Layout from '../../../../hrpub/common/components/Layout';
+
+// 框架方法
+import {createPage, high} from 'nc-lightapp-front';
+import {render} from '../../../../hrpub/common/frame';
+
+export default {
+    actions: {
+        mainAct: MainAction,
+        btnAct: ButtonAction,
+        formAct: FormAction,
+    },
+    components: {
+        AddPage,
+        FileManager,
+        Layout
+    },
+    methods: {
+        createPage,
+        high,
+        render
+    }
+}

+ 43 - 0
src/hrkq/billApprove/leaveoff/container/index.js

@@ -0,0 +1,43 @@
+import React from 'react';
+
+import './index.less';
+
+// 页面配置信息配置
+import pageConfig from './config';
+
+const {
+    components: {
+        AddPage, 
+        FileManager
+    },
+    actions,
+    methods: {
+        createPage,
+        render
+    }
+} = pageConfig;
+
+
+const HomePage = render({
+    actions: actions
+})(({props, action, state}) => {
+
+    const {leaveoff} = props;
+
+    return (
+        <div>
+            <AddPage 
+                {...props}
+            />
+            <If condition={leaveoff.fileManagerModalVisible}>
+                <FileManager
+                    language={leaveoff.language}
+                    billId={leaveoff.fileManagerBillId}
+                    onClose={action.mainAct.closeModal.bind(this, 'fileManagerModalVisible')}
+                />
+            </If>
+        </div>
+    );
+})
+
+export default createPage({})(HomePage);

+ 25 - 0
src/hrkq/billApprove/leaveoff/container/index.less

@@ -0,0 +1,25 @@
+.employing-page {
+    height: 100%;
+    td {
+        position: relative;
+    }
+
+    .layout-header-button-wrapper {
+        position: relative;
+        top: -4px;
+    }
+    
+    .employing-main-table-wrapper {
+        background: #fff;
+    }
+}
+
+.lightapp-component-approvedown .approvedown-content-lists {
+    padding: 0;
+    .approvedown-content-item {
+        padding: 0 24px;
+    }
+}
+.nc-modal .u-modal-dialog .u-modal-footer .button-undefined {
+    margin-right: 10px !important;
+}

+ 14 - 0
src/hrkq/billApprove/leaveoff/main/index.js

@@ -0,0 +1,14 @@
+import React from 'react';
+
+import {start, connect} from '../../../../hrpub/common/frame';
+
+import HomePage from '../container';
+import model from '../model/model';
+
+const Wrapper = connect(HomePage);
+
+start({
+    root: document.getElementById('app'),
+    component: <Wrapper />,
+    model: [model]
+});

+ 57 - 0
src/hrkq/billApprove/leaveoff/model/model.js

@@ -0,0 +1,57 @@
+import { hrAjax as proFetch } from 'src/hrpub/common/utils/utils';
+
+export default {
+    name: 'leaveoff',
+    data: {
+        orgValue: null, // 人力资源组织
+        language: {}, // 多语
+        context: {}, // 上下文
+        page: 'edit', // 当前页面, main主页面,add新增页面,edit修改页面
+        addPageStatus: 'edit', // 新增页面的状态,edit编辑态,browse浏览态       
+        fileManagerModalVisible: false, // 福建管理弹显示显示隐藏
+        fileManagerBillId: '', // 传递给福建管理的id
+        fromApprove: true, // 是否来自于审批中心的打开
+        approveBillType: '', // 审批详情弹窗的billType
+        approveBillId: '', // 审批详情弹窗的billId
+        approveModalVisible: false, // 审批详情弹窗的显示和隐藏
+        showOrgRefer: false, // 是否显示组织参照
+        compositedisplay: false, //指派弹窗 是否显示
+        compositedata: null, //指派弹窗数据
+        compositepostdata: null,//指派弹窗确认事件传到后台数据
+        pageHeight: 0, // 获取页面高度
+    },
+    sync: {
+        update(state, payload) {
+            return {
+                ...state,
+                ...payload
+            };
+        }
+    },
+    async: {
+    
+        // 跳转到新增页面前进行验证
+        checkToAddPage(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hryf/entrymng/EntryAddAction.do',
+                body: payload.postData
+            });
+        },
+        // 新增页面编辑前
+        formEditBefore(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hryf/entrymng/EntryBeforeEditAction.do',
+                body: payload.postData,
+                loading: false
+            });
+        },
+
+        // 获取一条数据
+        getBillDetail(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hrkq/leaveoff/QueryByIdApproveAction.do',
+                body: payload
+            });
+        }
+    }
+};

+ 1 - 0
src/hrkq/billApprove/outside/README.md

@@ -0,0 +1 @@
+## 补考勤审批页面

+ 17 - 0
src/hrkq/billApprove/outside/actions/btn.js

@@ -0,0 +1,17 @@
+export default class ButtonAction {
+    constructor(comp) {
+        this.action = comp.action;
+        this.comp = comp;
+    }
+
+    // 附件管理
+    fileManager = () => {
+        const { dispatch } = this.comp.props;
+        dispatch({
+            type: 'outside/update',
+            payload: {
+                fileManagerModalVisible: true
+            }
+        });
+    }
+}

+ 15 - 0
src/hrkq/billApprove/outside/actions/constant.js

@@ -0,0 +1,15 @@
+export default class Constant {
+    reqData = [{
+        rqUrl: '/platform/templet/querypage.do',
+        rqJson: `{\n  \"pagecode\": \"60656047nccloud\",\n  \"appcode\": \"60656047\"\n}`,
+        rqCode: 'template'
+    }, {
+        rqUrl: '/platform/appregister/queryallbtns.do',
+        rqJson: `{\n  \"pagecode\": \"60656047nccloud\",\n  \"appcode\": \"60656047\"\n}`,
+        rqCode: 'button'
+    }, {
+        rqUrl: '/platform/appregister/queryappcontext.do',
+        rqJson: `{\n  \"appcode\": \"60656047\"}`,
+        rqCode: 'context'
+    }];
+};

+ 89 - 0
src/hrkq/billApprove/outside/actions/main.js

@@ -0,0 +1,89 @@
+import Constant from './constant';
+import HrPubCommon from '../../../../hrpub/common/actions';
+import { getAppPageConfig } from 'src/hrpub/common/utils/utils';
+const {appcode, pagecode} = getAppPageConfig()
+
+export default class MainAction extends HrPubCommon {
+    constructor(comp) {
+        super();
+        this.comp = comp;
+    }
+
+    extend = [Constant]
+
+    appConfig = {
+        pagecode,
+        appcode
+    }
+
+    update = async (obj) => {
+        const {props} = this.comp;
+        const {dispatch} = props;
+
+        await dispatch({
+            type: 'outside/update',
+            payload: obj
+        });
+    }
+
+    // 获取多语
+    getCurrentLanguage = () => {
+        this.getLanguage('hrkq-approve', 'hrkq').then((json,status, init) => {
+            this.update({
+                language: json
+            })
+        });
+    }
+
+    // 获取模版信息
+    getTemplate = () => {
+        this.getMultiTemplate(this.reqData)
+            .then((res) => {
+                this.update({
+                    context: res.context
+                });
+                // this.afterGetTemplate();
+            });
+    }
+
+    // 当模版获取并设置完成之后的回调函数
+    afterGetTemplate = () => {
+        this.getFormData();
+    }
+
+    // 初始化
+    didMount = () => {
+        this.getTemplate();
+        this.getCurrentLanguage();
+    }
+
+    /**
+     * @desc: 根据id查询详情
+     * @param {type}
+     * @return:
+     */
+    getFormData = async () => {
+        const {props, action} = this.comp;
+        const {getUrlParam} = props;
+
+        let scene = getUrlParam('scene');
+        let id = getUrlParam('id');
+        let status = getUrlParam('status');
+        this.update({
+            fileManagerBillId: id
+        })
+        let methodsName = status === 'browse' ? 'toBrowsePage' : 'toEditPage'
+
+        action.formAct[methodsName](id);
+    }
+    /**
+     * @desc: 关闭附件弹框
+     * @param {type}
+     * @return:
+     */
+    hideFileUploader = () => {
+        this.update({
+            fileManagerModalVisible: false
+        })
+    }
+}

+ 70 - 0
src/hrkq/billApprove/outside/actions/turnToFormPage.js

@@ -0,0 +1,70 @@
+export default class FormAction {
+    constructor(comp) {
+        this.comp = comp;
+    }
+    formConfig = {
+        area: 'outside',
+        formCode: 'outside_approve_card'
+    }
+    // 表单进入浏览态
+    toBrowseStatus = (formValue) => {
+        const {props} = this.comp;
+        const {form, button} = props;
+
+        // 单据id
+        let billId = '';
+
+        // 表单进入编辑
+        form.setFormStatus(this.formConfig.formCode, 'browse');
+        // 填充表单的值
+        if(formValue) {
+            form.setAllFormValue({
+                [this.formConfig.formCode]: formValue
+            });
+            billId = formValue.rows[0].values['pk_outside'].value;
+        }
+
+        // 按钮进入编辑的按钮
+        this.update({
+            addPageStatus: 'browse'
+        })
+        // 隐藏掉一些按钮
+        button.setButtonVisible({
+            print: true,
+            batchadd: false
+        });
+    }
+
+    // 直接进入预览页面
+    toBrowsePage = async (id, formValue) => {
+        try {
+            let oneBillData = await this.getOneBillData(id);
+            if (oneBillData) {
+                this.toBrowseStatus(oneBillData.data[this.formConfig.area][this.formConfig.formCode]);
+            } 
+        }
+        catch(e) {
+        }
+    }
+
+    // 获取一条数据
+    getOneBillData = async (pk_outside) => {
+        const {props} = this.comp;
+        const {dispatch, outside} = props;
+        try {
+            let res = await dispatch({
+                type: 'outside/getBillDetail',
+                payload: {
+                    pk_outside
+                }
+            });
+
+            if(res.success) {
+                return res;
+            }
+        }
+        catch(e) {
+        }
+        return false;
+    }
+}

+ 61 - 0
src/hrkq/billApprove/outside/components/AddPage/actions/main.js

@@ -0,0 +1,61 @@
+
+import {
+    output,
+    print
+} from 'nc-lightapp-front';
+
+export default class Main {
+    constructor(comp) {
+        this.comp = comp;
+    }
+
+    didAllInstance = () => {
+        this.setButtonHandleMap();
+    }
+
+    // 设置按钮事件map
+    setButtonHandleMap = () => {
+        const {action} = this.comp;
+
+        this.buttonHandleMap = {
+            'save': this.saveAddPage,
+            'browse_status': {
+                'callback': this.callbackFromCard,
+                'print': this.printIt,
+                'output': this.output,
+            }
+        };
+    }
+
+    // 打印
+    printIt = () => {
+        let formValue = this.comp.props.form.getAllFormValue('card');
+
+        print('pdf', '/nccloud/hryf/entrymng/EntryPrintAction.do', {
+            appcode: '60656046',
+            nodekey: '60081010',
+            oids: [formValue.rows[0].values['pk_entryapply'].value]
+        });
+    }
+
+    // 输出
+    output = () => {
+        const {props} = this.comp;
+        const {
+            outside
+        } = props;
+        let formValue = this.comp.props.form.getAllFormValue('card');
+        output({
+            url: '/nccloud/hryf/entrymng/EntryPrintAction.do',
+            data: {
+                appcode: '60092010',
+                nodekey: '60081010',
+                oids: [formValue.rows[0].values['pk_entryapply'].value],
+                outputType: 'output',
+                filename: outside.language['gx6008-000067'] // 录用办理
+            },
+            callback: () => {
+            }
+        });
+    }
+}

+ 44 - 0
src/hrkq/billApprove/outside/components/AddPage/components/Header/index.js

@@ -0,0 +1,44 @@
+import React, {Component} from 'react';
+
+import './index.less';
+
+import {
+    base
+} from 'nc-lightapp-front';
+
+const {
+    NCButton
+} = base;
+
+export default class AddPageHeader extends Component {
+    constructor(props) {
+        super(props);
+    }
+
+    render() {
+        const {
+            status, 
+            onClick, 
+            button, 
+            language,
+            cancelEdit,
+            cardPagination,
+            toBrowsePage,
+            fromApprove
+        } = this.props;
+
+        return (
+            <div className="add-page-header-wrapper">
+                
+                <Choose>
+                    <When condition={status === 'browse'}>
+                        {button.createButtonApp({
+                            area: 'head',
+                            onButtonClick: onClick('browse_status')
+                        })}
+                    </When>
+                </Choose>
+            </div>
+        );
+    }
+}

+ 3 - 0
src/hrkq/billApprove/outside/components/AddPage/components/Header/index.less

@@ -0,0 +1,3 @@
+.add-page-header-wrapper {
+    float: right;
+}

+ 32 - 0
src/hrkq/billApprove/outside/components/AddPage/config.js

@@ -0,0 +1,32 @@
+/**
+ *
+ *
+ * 编辑页面配置文件
+ *
+ */
+
+ // actions
+import MainAction from './actions/main';
+import FormAction from '../../actions/turnToFormPage';
+
+// 方法
+import {render, connect} from '../../../../../hrpub/common/frame';
+
+// 组件
+import Layout from '../../../../../hrpub/common/components/Layout';
+import BtnAction from "../../actions/btn";
+
+ export default {
+      actions: {
+         mainAct: MainAction,
+         formAct: FormAction,
+          btnAct: BtnAction
+      },
+      methods: {
+         render,
+         connect
+      },
+      components: {
+         Layout
+      }
+ }

+ 52 - 0
src/hrkq/billApprove/outside/components/AddPage/index.js

@@ -0,0 +1,52 @@
+import React from 'react';
+import './index.less';
+
+import config from './config';
+
+
+const {
+    actions,
+    methods: {
+        render,
+        connect
+    },
+    components: {
+        Layout
+    }
+} = config;
+
+const {Header,Content} = Layout;
+
+const Wrapper = render({
+    actions: actions
+})(({props, action, state}) => {
+    props.use.form('outside_approve_card')
+    const {form, outside, button} = props;
+    const {btnAct} = action
+    return (
+        <Layout
+            className="employing-add-page"
+        >
+            <div className="bill-bg">
+            <Header
+                showOrgRefer={false}
+                showButtons={true}
+                button={button}
+                buttonOptions={{
+                    area: 'head', //如果页面中的有多个区域有按钮,这里的area当做筛选条件,只渲染按钮的后台数据中area字段为这里指定值的按钮;
+                    onButtonClick: (props, btncode) => {
+                        btnAct.fileManager()
+                    }// 按钮的点击事件
+                }}
+            >
+                <div className="approve_title">{outside.language['approve-00002']}{/* 外勤审批 */}</div>
+            </Header>
+            <Content>
+                {form.createForm('outside_approve_card', {})}
+            </Content>
+            </div>
+        </Layout>
+    );
+});
+
+export default connect(Wrapper);

+ 14 - 0
src/hrkq/billApprove/outside/components/AddPage/index.less

@@ -0,0 +1,14 @@
+.employing-add-page {
+    height: 100%;
+}
+.approve_title {
+    display: inline-block;
+    font-size: 16px;
+    color: #111;
+    font-weight: 700;
+    line-height: 38px;
+}
+.bill-bg{
+    overflow: hidden;
+    background: #f6f6f6;
+}

+ 56 - 0
src/hrkq/billApprove/outside/components/Uploader/index.js

@@ -0,0 +1,56 @@
+import React, {Component} from 'react';
+import './index.less';
+// import {high} from 'nc-lightapp-front';
+
+// const {NCUploader} = high;
+import NCUploader from 'uap/common/components/NCUploader';
+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 {billId, table, clickRow: clickRowProps} = this.props;
+        if (billId) return billId;
+        const clickRow = table.getClickRowIndex('ncc600704list') || clickRowProps;
+
+        return clickRow && clickRow.record.values.pk_psndoc.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) {
+            alert(this.props.language['gx6008-000117'])/* 国际化处理: 上传大小小于2M*/
+        }
+        return isLt2M;
+        // 备注: return false 不执行上传  return true 执行上传
+    }
+
+    render() {
+        return (
+            <div className='uploader'>
+                <NCUploader
+                    billId={this.props.billId}
+                    //getGroupList={this.getGroupList}
+                    onHide={this.onHideUploader} // 关闭功能
+                    //beforeUpload={this.beforeUpload}
+                />
+            </div>
+        );
+    }
+}
+
+export default Uploader;

+ 0 - 0
src/hrkq/billApprove/outside/components/Uploader/index.less


+ 38 - 0
src/hrkq/billApprove/outside/container/config.js

@@ -0,0 +1,38 @@
+/**
+ *
+ * container组件的配置文件
+ *
+ */
+
+// actions
+import MainAction from '../actions/main';
+import FormAction from '../actions/turnToFormPage';
+import BtnAction from '../actions/btn';
+
+// 本节点组件
+import AddPage from '../components/AddPage';
+import FileManager from '../components/Uploader';
+
+// 公用组件
+import Layout from '../../../../hrpub/common/components/Layout';
+
+// 框架方法
+import {createPage} from 'nc-lightapp-front';
+import {render} from '../../../../hrpub/common/frame';
+
+export default {
+    actions: {
+        mainAct: MainAction,
+        formAct: FormAction,
+        btnAct: BtnAction
+    },
+    components: {
+        AddPage,
+        Layout,
+        FileManager
+    },
+    methods: {
+        createPage,
+        render
+    }
+}

+ 42 - 0
src/hrkq/billApprove/outside/container/index.js

@@ -0,0 +1,42 @@
+import React from 'react';
+
+import './index.less';
+
+// 页面配置信息配置
+import pageConfig from './config';
+
+const {
+    components: {
+        AddPage,
+        FileManager
+    },
+    actions,
+    methods: {
+        createPage,
+        render
+    }
+} = pageConfig;
+
+
+const HomePage = render({
+    actions: actions
+})(({props, action, state}) => {
+
+    const {outside} = props;
+
+    return (
+        <div>
+            <AddPage
+                {...props}
+            />
+
+            {outside.fileManagerModalVisible && <FileManager
+                language={outside.language}
+                billId={outside.fileManagerBillId}
+                onClose={action.mainAct.hideFileUploader}
+            />}
+        </div>
+    );
+})
+
+export default createPage({})(HomePage);

+ 25 - 0
src/hrkq/billApprove/outside/container/index.less

@@ -0,0 +1,25 @@
+.employing-page {
+    height: 100%;
+    td {
+        position: relative;
+    }
+
+    .layout-header-button-wrapper {
+        position: relative;
+        top: -4px;
+    }
+    
+    .employing-main-table-wrapper {
+        background: #fff;
+    }
+}
+
+.lightapp-component-approvedown .approvedown-content-lists {
+    padding: 0;
+    .approvedown-content-item {
+        padding: 0 24px;
+    }
+}
+.nc-modal .u-modal-dialog .u-modal-footer .button-undefined {
+    margin-right: 10px !important;
+}

+ 14 - 0
src/hrkq/billApprove/outside/main/index.js

@@ -0,0 +1,14 @@
+import React from 'react';
+
+import {start, connect} from '../../../../hrpub/common/frame';
+
+import HomePage from '../container';
+import model from '../model/model';
+
+const Wrapper = connect(HomePage);
+
+start({
+    root: document.getElementById('app'),
+    component: <Wrapper />,
+    model: [model]
+});

+ 57 - 0
src/hrkq/billApprove/outside/model/model.js

@@ -0,0 +1,57 @@
+import { hrAjax as proFetch } from 'src/hrpub/common/utils/utils';
+
+export default {
+    name: 'outside',
+    data: {
+        orgValue: null, // 人力资源组织
+        language: {}, // 多语
+        context: {}, // 上下文
+        page: 'edit', // 当前页面, main主页面,add新增页面,edit修改页面
+        addPageStatus: 'edit', // 新增页面的状态,edit编辑态,browse浏览态       
+        fileManagerModalVisible: false, // 福建管理弹显示显示隐藏
+        fileManagerBillId: '', // 传递给福建管理的id
+        fromApprove: true, // 是否来自于审批中心的打开
+        approveBillType: '', // 审批详情弹窗的billType
+        approveBillId: '', // 审批详情弹窗的billId
+        approveModalVisible: false, // 审批详情弹窗的显示和隐藏
+        showOrgRefer: false, // 是否显示组织参照
+        compositedisplay: false, //指派弹窗 是否显示
+        compositedata: null, //指派弹窗数据
+        compositepostdata: null,//指派弹窗确认事件传到后台数据
+        pageHeight: 0, // 获取页面高度
+    },
+    sync: {
+        update(state, payload) {
+            return {
+                ...state,
+                ...payload
+            };
+        }
+    },
+    async: {
+    
+        // 跳转到新增页面前进行验证
+        checkToAddPage(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hryf/entrymng/EntryAddAction.do',
+                body: payload.postData
+            });
+        },
+        // 新增页面编辑前
+        formEditBefore(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hryf/entrymng/EntryBeforeEditAction.do',
+                body: payload.postData,
+                loading: false
+            });
+        },
+
+        // 获取一条数据
+        getBillDetail(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hrkq/outside/QueryByIdApproveAction.do',
+                body: payload
+            });
+        }
+    }
+};

+ 1 - 0
src/hrkq/billApprove/overtime/README.md

@@ -0,0 +1 @@
+## 补考勤审批页面

+ 103 - 0
src/hrkq/billApprove/overtime/actions/btn.js

@@ -0,0 +1,103 @@
+
+export default class ButtonAction {
+    constructor(comp) {
+        this.action = comp.action;
+        this.comp = comp;
+    }
+
+    didAllInstance = () => {
+        this.setBtnHandleMap();
+    }
+
+    // 生成按钮map
+    setBtnHandleMap = () => {
+        this.buttonHandleMap = {
+            // 打印
+            'print': this.printTable,
+            // 输出
+            'output': this.outputTable
+        }
+    }
+
+
+    // 第一次进页面的按钮状态
+    initPageButton = () => {
+        const {props} = this.comp;
+        const {
+            button
+        } = props;
+        button.setButtonVisible({
+            approveinfo: false,
+            cardrpt: false,
+            file: false
+        });
+    }
+
+    // 按钮点击回调
+    headerClick = (props, btnCode) => {
+        console.log(btnCode);
+        if(typeof this.buttonHandleMap[btnCode] === 'function') {
+            this.buttonHandleMap[btnCode]();
+        }
+    }
+
+    // 打印
+    printTable = () => {
+        const {props} = this.comp;
+        const {overtime, editTable, meta} = props;
+
+        let tableWrapper = document.getElementById('mainTable');
+
+        this.print(tableWrapper, {
+            title: overtime.language['gx6008-000067'], // 录用办理
+            maker: overtime.language['gx6008-000068'], // 制作者
+            date: overtime.language['gx6008-000069'], // 制作日期
+            tableInfo: {
+                data: editTable.getAllRows('list'),
+                tableTmp: meta.getMeta()['list']
+            },
+            beforeAppend: (data) => {
+                data[0].map((item, rowIndex) => {
+                    delete item[0];
+                });
+                data[1].map((item) => {
+                    item.length = item.length - 1;
+                });
+                return data;
+            }
+        });
+    }
+
+    // 输出
+    outputTable = () => {
+        const {
+            props: {
+                editTable,
+                overtime: {
+                    language
+                },
+                meta
+            }
+        } = this.comp;
+        let tableWrapper = document.getElementById('mainTable');
+        let tableData = editTable.getAllData('list');
+
+        this.exportHtml(tableWrapper, {
+            fileName: language['gx6008-000067'] // '录用办理'
+        }, {
+            meta: meta.getMeta()['list'],
+            data: tableData.rows,
+            showIndex: false
+        });
+    }
+
+    // 附件管理
+    fileManager = (selectedRows) => {
+        let billId = selectedRows[0].values['bill_code'].value;
+
+        this.update({
+            fileManagerBillId: billId,
+            fileManagerModalVisible: true
+        });
+    }
+}

+ 15 - 0
src/hrkq/billApprove/overtime/actions/constant.js

@@ -0,0 +1,15 @@
+export default class Constant {
+    reqData = [{
+        rqUrl: '/platform/templet/querypage.do',
+        rqJson: `{\n  \"pagecode\": \"60656043nccloud\",\n  \"appcode\": \"60656043\"\n}`,
+        rqCode: 'template'
+    }, {
+        rqUrl: '/platform/appregister/queryallbtns.do',
+        rqJson: `{\n  \"pagecode\": \"60656043nccloud\",\n  \"appcode\": \"60656043\"\n}`,
+        rqCode: 'button'
+    }, {
+        rqUrl: '/platform/appregister/queryappcontext.do',
+        rqJson: `{\n  \"appcode\": \"60656043\"}`,
+        rqCode: 'context'
+    }];
+};

+ 89 - 0
src/hrkq/billApprove/overtime/actions/main.js

@@ -0,0 +1,89 @@
+import Constant from './constant';
+import HrPubCommon from '../../../../hrpub/common/actions';
+import { getAppPageConfig } from 'src/hrpub/common/utils/utils';
+const {appcode, pagecode} = getAppPageConfig()
+export default class MainAction extends HrPubCommon {
+    constructor(comp) {
+        super();
+        this.comp = comp;
+    }
+
+    extend = [Constant]
+
+    appConfig = {
+        pagecode,
+        appcode
+    }
+
+    update = async (obj) => {
+        const {props} = this.comp;
+        const {dispatch} = props;
+
+        await dispatch({
+            type: 'overtime/update',
+            payload: obj
+        });
+    }
+    // 处理模版
+    processTemplate = (res) => {
+        return this.selfProcessTemplate(res);
+    }
+    // 处理模版数据
+    selfProcessTemplate = (res) => {
+        res.template['overtime_approve_card'].items.forEach(item => {
+            if (item.attrcode === 'otapplylength' || item.attrcode === 'actuallen') {
+                item.itemtype = 'input'
+            }
+        })        
+        
+        return res.template
+    }
+    // 获取多语
+    getCurrentLanguage = () => {
+        this.getLanguage('hrkq-approve', 'hrkq').then((json,status, init) => {
+            this.update({
+                language: json
+            })
+        });
+    }
+
+    // 获取模版信息
+    getTemplate = () => {
+        this.getMultiTemplate(this.reqData)
+            .then((res) => {
+                this.update({
+                    context: res.context
+                });
+                // this.afterGetTemplate();
+            });
+    }
+
+    // 当模版获取并设置完成之后的回调函数
+    afterGetTemplate = () => {
+        this.getFormData();
+    }
+
+    // 初始化
+    didMount = () => {
+        this.getTemplate();
+        this.getCurrentLanguage();
+    }
+
+    /**
+     * @desc: 根据id查询详情
+     * @param {type} 
+     * @return: 
+     */
+    getFormData = async () => {
+        const {props, action} = this.comp;
+        const {getUrlParam} = props;
+
+        let scene = getUrlParam('scene');
+        let id = getUrlParam('id');
+        let status = getUrlParam('status');
+
+        let methodsName = status === 'browse' ? 'toBrowsePage' : 'toEditPage'
+        
+        action.formAct[methodsName](id);
+    }
+}

+ 90 - 0
src/hrkq/billApprove/overtime/actions/turnToFormPage.js

@@ -0,0 +1,90 @@
+import {getBusinessInfo, cacheTools} from 'nc-lightapp-front';
+
+let businessInfo = getBusinessInfo() || {};
+
+export default class FormAction {
+    constructor(comp) {
+        this.comp = comp;
+    }
+    formConfig = {
+        area: 'overtime',
+        formCode: 'overtime_approve_card'
+    }
+    // 表单进入浏览态
+    toBrowseStatus = (formValue) => {
+        const {props} = this.comp;
+        const {form, button} = props;
+
+        // 单据id
+        let billId = '';
+
+        // 表单进入编辑
+        form.setFormStatus(this.formConfig.formCode, 'browse');
+        // 填充表单的值
+        if(formValue) {
+            form.setAllFormValue({
+                [this.formConfig.formCode]: formValue
+            });
+            billId = formValue.rows[0].values['pk_overtime'].value;
+            let otapplylength = form.getFormItemsValue(this.formConfig.formCode, 'otapplylength').value;
+            let isallnight = form.getFormItemsValue(this.formConfig.formCode, 'isallnight').value;
+            let isoverday = form.getFormItemsValue(this.formConfig.formCode, 'isoverday').value;
+            form.setItemsVisible(this.formConfig.formCode, {
+                isallnight: !!isoverday
+            })
+            form.setFormItemsValue(this.formConfig.formCode, {
+                otapplylength: {
+                    display: otapplylength ? ((otapplylength - 0).toFixed(2) + '小时') : '',
+                    value: otapplylength
+                },
+                isallnight: {
+                    display: isallnight ? '是' : '否',
+                    value: isallnight
+                }
+            })
+        }
+
+        // 按钮进入编辑的按钮
+        this.update({
+            addPageStatus: 'browse'
+        })
+        // 隐藏掉一些按钮
+        button.setButtonVisible({
+            print: true,
+            batchadd: false
+        });
+    }
+
+    // 直接进入预览页面
+    toBrowsePage = async (id, formValue) => {
+        try {
+            let oneBillData = await this.getOneBillData(id);
+            if (oneBillData) {
+                this.toBrowseStatus(oneBillData.data[this.formConfig.area][this.formConfig.formCode]);
+            } 
+        }
+        catch(e) {
+        }
+    }
+
+    // 获取一条数据
+    getOneBillData = async (pk_overtime) => {
+        const {props} = this.comp;
+        const {dispatch, overtime} = props;
+        try {
+            let res = await dispatch({
+                type: 'overtime/getBillDetail',
+                payload: {
+                    pk_overtime
+                }
+            });
+
+            if(res.success) {
+                return res;
+            }
+        }
+        catch(e) {
+        }
+        return false;
+    }
+}

+ 61 - 0
src/hrkq/billApprove/overtime/components/AddPage/actions/main.js

@@ -0,0 +1,61 @@
+
+import {
+    output,
+    print
+} from 'nc-lightapp-front';
+
+export default class Main {
+    constructor(comp) {
+        this.comp = comp;
+    }
+
+    didAllInstance = () => {
+        this.setButtonHandleMap();
+    }
+
+    // 设置按钮事件map
+    setButtonHandleMap = () => {
+        const {action} = this.comp;
+
+        this.buttonHandleMap = {
+            'save': this.saveAddPage,
+            'browse_status': {
+                'callback': this.callbackFromCard,
+                'print': this.printIt,
+                'output': this.output,
+            }
+        };
+    }
+
+    // 打印
+    printIt = () => {
+        let formValue = this.comp.props.form.getAllFormValue('card');
+
+        print('pdf', '/nccloud/hryf/entrymng/EntryPrintAction.do', {
+            appcode: '60656046',
+            nodekey: '60081010',
+            oids: [formValue.rows[0].values['pk_entryapply'].value]
+        });
+    }
+
+    // 输出
+    output = () => {
+        const {props} = this.comp;
+        const {
+            overtime
+        } = props;
+        let formValue = this.comp.props.form.getAllFormValue('card');
+        output({
+            url: '/nccloud/hryf/entrymng/EntryPrintAction.do',
+            data: {
+                appcode: '60092010',
+                nodekey: '60081010',
+                oids: [formValue.rows[0].values['pk_entryapply'].value],
+                outputType: 'output',
+                filename: overtime.language['gx6008-000067'] // 录用办理
+            },
+            callback: () => {
+            }
+        });
+    }
+}

+ 44 - 0
src/hrkq/billApprove/overtime/components/AddPage/components/Header/index.js

@@ -0,0 +1,44 @@
+import React, {Component} from 'react';
+
+import './index.less';
+
+import {
+    base
+} from 'nc-lightapp-front';
+
+const {
+    NCButton
+} = base;
+
+export default class AddPageHeader extends Component {
+    constructor(props) {
+        super(props);
+    }
+
+    render() {
+        const {
+            status, 
+            onClick, 
+            button, 
+            language,
+            cancelEdit,
+            cardPagination,
+            toBrowsePage,
+            fromApprove
+        } = this.props;
+
+        return (
+            <div className="add-page-header-wrapper">
+                
+                <Choose>
+                    <When condition={status === 'browse'}>
+                        {button.createButtonApp({
+                            area: 'head',
+                            onButtonClick: onClick('browse_status')
+                        })}
+                    </When>
+                </Choose>
+            </div>
+        );
+    }
+}

+ 3 - 0
src/hrkq/billApprove/overtime/components/AddPage/components/Header/index.less

@@ -0,0 +1,3 @@
+.add-page-header-wrapper {
+    float: right;
+}

+ 30 - 0
src/hrkq/billApprove/overtime/components/AddPage/config.js

@@ -0,0 +1,30 @@
+/**
+ * 
+ * 
+ * 编辑页面配置文件
+ * 
+ */
+
+ // actions
+import MainAction from './actions/main';
+import FormAction from '../../actions/turnToFormPage';
+
+// 方法
+import {render, connect} from '../../../../../hrpub/common/frame';
+
+// 组件
+import Layout from '../../../../../hrpub/common/components/Layout';
+
+ export default {
+     actions: {
+        mainAct: MainAction,
+        formAct: FormAction,
+     },
+     methods: {
+        render,
+        connect
+     },
+     components: {
+        Layout
+     }
+ }

+ 45 - 0
src/hrkq/billApprove/overtime/components/AddPage/index.js

@@ -0,0 +1,45 @@
+import React from 'react';
+import './index.less';
+
+import config from './config';
+
+
+const {
+    actions,
+    methods: {
+        render,
+        connect
+    },
+    components: {
+        Layout
+    }
+} = config;
+
+const {Header,Content} = Layout;
+
+const Wrapper = render({
+    actions: actions
+})(({props, action, state}) => {
+    props.use.form('overtime_approve_card')
+    const {form, overtime, cardPagination} = props;
+
+    return (
+        <Layout
+            className="employing-add-page"
+        >
+            <div className="bill-bg">
+            <Header
+                showOrgRefer={false}
+                showButtons={false}
+            >
+                <div className="approve_title">{overtime.language['approve-00004']}{/* 加班单审批 */}</div>
+            </Header>
+            <Content>
+                {form.createForm('overtime_approve_card', {})}
+            </Content>
+            </div>
+        </Layout>
+    );
+});
+
+export default connect(Wrapper);

+ 14 - 0
src/hrkq/billApprove/overtime/components/AddPage/index.less

@@ -0,0 +1,14 @@
+.employing-add-page {
+    height: 100%;
+}
+.approve_title {
+    display: inline-block;
+    font-size: 16px;
+    color: #111;
+    font-weight: 700;
+    line-height: 38px;
+}
+.bill-bg{
+    overflow: hidden;
+    background: #f6f6f6;
+}

+ 125 - 0
src/hrkq/billApprove/overtime/components/Header/actions/index.js

@@ -0,0 +1,125 @@
+let timer = null;
+
+export default class HeaderAction {
+    constructor(comp) {
+        this.comp = comp;
+        this.dispatch = this.comp.props.dispatch;
+    }
+
+    // 订单状态下拉框的内容数据
+    getOrderStatusList = () => {
+        const {props} = this.comp;
+        const {overtime} = props;
+
+        return [{
+            key: 'all',
+            label: overtime.language['gx6008-000070'], // 全部
+        }, {
+            key: '-1',
+            label: overtime.language['gx6008-000001'], // '自由态'
+        }, {
+            key: '3',
+            label: overtime.language['gx6008-000002'], // 提交
+        }, {
+            key: '2',
+            label: overtime.language['gx6008-000003'], // 审批进行中
+        }, {
+            key: '1',
+            label: overtime.language['gx6008-000004'], // 审批通过
+        }, {
+            key: '4',
+            label: overtime.language['gx6008-000006'], // 已发offer
+        }, {
+            key: '5',
+            label: overtime.language['gx6008-000007'], // 接受offer
+        }, {
+            key: '6',
+            label: overtime.language['gx6008-000008'], // 拒绝offer
+        }, {
+            key: '7',
+            label: overtime.language['gx6008-000009'], // 待入职
+        }, {
+            key: '8',
+            label: overtime.language['gx6008-000010'], // 拒绝入职
+        }, {
+            key: '102',
+            label: overtime.language['gx6008-000011'], // 已入职
+        }];
+    }
+
+    // 订单时间范围的下拉框内容
+    getOrderTimeRangeList = () => {
+        const {props} = this.comp;
+        const {overtime} = props;
+
+        return {
+            'oneWeek': overtime.language['gx6008-000012'], // 一周内
+            'oneMonth': overtime.language['gx6008-000013'], // 一个月内
+            'threeMonth': overtime.language['gx6008-000014'], // 三个月内
+            'custom': overtime.language['gx6008-000015'], // 自定义
+        };
+    }
+
+    // 选择订单状态
+    changeOrderStatus = (value) => {
+        const {props} = this.comp;
+        const {
+            overtime: {
+                orderStatus: prevOrderStatus
+            }
+        } = props;
+
+        let valueWithoutAll = [];
+        if((value.includes('all') && !prevOrderStatus.includes('all')) || value.length === 0) {
+            valueWithoutAll = ['all'];
+            this.update({
+                orderStatus: valueWithoutAll
+            });
+        }
+        else {
+            value.map((item) => {
+                if(item !== 'all') {
+                    valueWithoutAll.push(item);
+                }
+            });
+            this.update({
+                orderStatus: valueWithoutAll
+            });
+        }
+        
+        clearTimeout(timer);
+        timer = setTimeout(() => {
+            this.pubSub.publish('getMainTableData', {
+                billstate: valueWithoutAll
+            });
+        }, 1000);
+    }
+
+    // 选择订单时间范围
+    changeOrderRange = (value) => {
+      
+        if(value !== 'custom') {
+            this.pubSub.publish('getMainTableData', {
+                time: value
+            });
+        }
+
+        this.update({
+            orderTimeRange: value,
+            orderBeginTime: '',
+            orderEndTime: ''
+        });
+    }
+
+    // 自定义订单时间范围
+    changeOrderTime = (value) => {
+        this.update({
+            orderBeginTime: value[0],
+            orderEndTime: value[1]
+        });
+        this.pubSub.publish('getMainTableData', {
+            orderBeginTime: value[0],
+            orderEndTime: value[1]
+        });
+    }
+}

+ 101 - 0
src/hrkq/billApprove/overtime/components/Header/index.js

@@ -0,0 +1,101 @@
+
+import React from 'react';
+import './index.less';
+
+
+import {render, connect} from '../../../../../hrpub/common/frame';
+
+import {base} from 'nc-lightapp-front';
+
+import HeaderAction from './actions/index';
+
+const {
+    NCSelect,
+    NCDatePicker
+} = base;
+
+const {NCRangePicker} = NCDatePicker;
+
+const {NCOption} = NCSelect;
+
+const Wrapper = render({
+    actions: {
+        headerAct: HeaderAction
+    }
+})(({props, state, action}) => {
+
+    const {overtime} = props;
+    const statusList = action.headerAct.getOrderStatusList();
+    const timeRangeList = action.headerAct.getOrderTimeRangeList();
+
+    let timerRangeValue = (overtime.orderBeginTime && overtime.orderEndTime) ? [overtime.orderBeginTime, overtime.orderEndTime] : [];
+
+    return (
+        <div className="employing-header-middle-content">
+            <span 
+                className="header-middle-item-wrapper"
+                style={{
+                    width: '160px'
+                }}
+            >
+                <NCSelect
+                    multiple={true}
+                    style={{
+                        width: '160px'
+                    }}
+                    placeholder="单据状态"
+                    onChange={action.headerAct.changeOrderStatus}
+                    value={overtime.orderStatus}
+                >
+                    {statusList.map((item) => {
+                        return (
+                            <NCOption
+                                key={item.key}
+                            >
+                                {item.label}
+                            </NCOption>
+                        );
+                    })}
+                </NCSelect>
+            </span>
+            <span className="header-middle-item-wrapper">
+                <NCSelect
+                    style={{
+                        width: '140px'
+                    }}
+                    value={overtime.orderTimeRange}
+                    onChange={action.headerAct.changeOrderRange}
+                >
+                    {Object.keys(timeRangeList).map((key) => {
+                        return (
+                            <NCOption
+                                key={key}
+                            >
+                                {timeRangeList[key]}
+                            </NCOption>
+                        );
+                    })}
+                    
+                </NCSelect>
+            </span>
+            <If condition={overtime.orderTimeRange === 'custom'}>
+                <span 
+                    className="header-middle-item-wrapper"
+                    style={{
+                        width: '213px'
+                    }}
+                >
+                    <NCRangePicker
+                        placeholder={'开始日期 - 结束日期'}
+                        onChange={action.headerAct.changeOrderTime}
+                        value={timerRangeValue}
+                    />
+                </span>
+            </If>
+        </div>
+    );
+
+});
+
+
+export default connect(Wrapper);

+ 25 - 0
src/hrkq/billApprove/overtime/components/Header/index.less

@@ -0,0 +1,25 @@
+.employing-header-middle-content {
+
+    .header-middle-item-wrapper {
+        margin-left: 10px;
+        float: left;
+        width: 140px;
+        margin-bottom: 10px;
+
+        .u-select-selection--multiple .u-select-selection-choice {
+            width: 60px;
+            margin-bottom: 5px;
+        }
+        .nc-select .u-select-selection--multiple .u-select-selection-rendered {
+            height: 30px;
+            overflow: hidden;
+            ul {
+                height: 30px;
+                overflow: hidden;
+            }
+        }
+        .calendar-picker.u-input-group.simple.nc-input {
+            width: 213px;
+        }
+    }
+}

+ 56 - 0
src/hrkq/billApprove/overtime/components/Uploader/index.js

@@ -0,0 +1,56 @@
+import React, {Component} from 'react';
+import './index.less';
+// import {high} from 'nc-lightapp-front';
+
+// const {NCUploader} = high;
+import NCUploader from 'uap/common/components/NCUploader';
+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 {billId, table, clickRow: clickRowProps} = this.props;
+        if (billId) return billId;
+        const clickRow = table.getClickRowIndex('ncc600704list') || clickRowProps;
+
+        return clickRow && clickRow.record.values.pk_psndoc.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) {
+            alert(this.props.language['gx6008-000117'])/* 国际化处理: 上传大小小于2M*/
+        }
+        return isLt2M;
+        // 备注: return false 不执行上传  return true 执行上传
+    }
+
+    render() {
+        return (
+            <div className='uploader'>
+                <NCUploader
+                    billId={this.props.billId}
+                    //getGroupList={this.getGroupList}
+                    onHide={this.onHideUploader} // 关闭功能
+                    //beforeUpload={this.beforeUpload}
+                />
+            </div>
+        );
+    }
+}
+
+export default Uploader;

+ 0 - 0
src/hrkq/billApprove/overtime/components/Uploader/index.less


+ 36 - 0
src/hrkq/billApprove/overtime/container/config.js

@@ -0,0 +1,36 @@
+/** 
+ * 
+ * container组件的配置文件
+ * 
+ */
+
+// actions
+import MainAction from '../actions/main';
+import FormAction from '../actions/turnToFormPage';
+
+// 本节点组件
+import AddPage from '../components/AddPage';
+import FileManager from '../components/Uploader';
+
+// 公用组件
+import Layout from '../../../../hrpub/common/components/Layout';
+// 框架方法
+import {createPage, high} from 'nc-lightapp-front';
+import {render} from '../../../../hrpub/common/frame';
+
+export default {
+    actions: {
+        mainAct: MainAction,
+        formAct: FormAction,
+    },
+    components: {
+        AddPage,
+        FileManager,
+        Layout
+    },
+    methods: {
+        createPage,
+        high,
+        render
+    }
+}

+ 43 - 0
src/hrkq/billApprove/overtime/container/index.js

@@ -0,0 +1,43 @@
+import React from 'react';
+
+import './index.less';
+
+// 页面配置信息配置
+import pageConfig from './config';
+
+const {
+    components: {
+        AddPage, 
+        FileManager
+    },
+    actions,
+    methods: {
+        createPage,
+        render
+    }
+} = pageConfig;
+
+
+const HomePage = render({
+    actions: actions
+})(({props, action, state}) => {
+
+    const {overtime} = props;
+
+    return (
+        <div>
+            <AddPage 
+                {...props}
+            />
+            <If condition={overtime.fileManagerModalVisible}>
+                <FileManager
+                    language={overtime.language}
+                    billId={overtime.fileManagerBillId}
+                    onClose={action.mainAct.closeModal.bind(this, 'fileManagerModalVisible')}
+                />
+            </If>
+        </div>
+    );
+})
+
+export default createPage({})(HomePage);

+ 25 - 0
src/hrkq/billApprove/overtime/container/index.less

@@ -0,0 +1,25 @@
+.employing-page {
+    height: 100%;
+    td {
+        position: relative;
+    }
+
+    .layout-header-button-wrapper {
+        position: relative;
+        top: -4px;
+    }
+    
+    .employing-main-table-wrapper {
+        background: #fff;
+    }
+}
+
+.lightapp-component-approvedown .approvedown-content-lists {
+    padding: 0;
+    .approvedown-content-item {
+        padding: 0 24px;
+    }
+}
+.nc-modal .u-modal-dialog .u-modal-footer .button-undefined {
+    margin-right: 10px !important;
+}

+ 14 - 0
src/hrkq/billApprove/overtime/main/index.js

@@ -0,0 +1,14 @@
+import React from 'react';
+
+import {start, connect} from '../../../../hrpub/common/frame';
+
+import HomePage from '../container';
+import model from '../model/model';
+
+const Wrapper = connect(HomePage);
+
+start({
+    root: document.getElementById('app'),
+    component: <Wrapper />,
+    model: [model]
+});

+ 57 - 0
src/hrkq/billApprove/overtime/model/model.js

@@ -0,0 +1,57 @@
+import { hrAjax as proFetch } from 'src/hrpub/common/utils/utils';
+
+export default {
+    name: 'overtime',
+    data: {
+        orgValue: null, // 人力资源组织
+        language: {}, // 多语
+        context: {}, // 上下文
+        page: 'edit', // 当前页面, main主页面,add新增页面,edit修改页面
+        addPageStatus: 'edit', // 新增页面的状态,edit编辑态,browse浏览态       
+        fileManagerModalVisible: false, // 福建管理弹显示显示隐藏
+        fileManagerBillId: '', // 传递给福建管理的id
+        fromApprove: true, // 是否来自于审批中心的打开
+        approveBillType: '', // 审批详情弹窗的billType
+        approveBillId: '', // 审批详情弹窗的billId
+        approveModalVisible: false, // 审批详情弹窗的显示和隐藏
+        showOrgRefer: false, // 是否显示组织参照
+        compositedisplay: false, //指派弹窗 是否显示
+        compositedata: null, //指派弹窗数据
+        compositepostdata: null,//指派弹窗确认事件传到后台数据
+        pageHeight: 0, // 获取页面高度
+    },
+    sync: {
+        update(state, payload) {
+            return {
+                ...state,
+                ...payload
+            };
+        }
+    },
+    async: {
+    
+        // 跳转到新增页面前进行验证
+        checkToAddPage(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hryf/entrymng/EntryAddAction.do',
+                body: payload.postData
+            });
+        },
+        // 新增页面编辑前
+        formEditBefore(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hryf/entrymng/EntryBeforeEditAction.do',
+                body: payload.postData,
+                loading: false
+            });
+        },
+
+        // 获取一条数据
+        getBillDetail(dispatch, getState, payload) {
+            return proFetch({
+                url: '/nccloud/hrkq/overtime/QueryByIdApproveAction.do',
+                body: payload
+            });
+        }
+    }
+};

+ 1 - 0
src/hrkq/billApprove/replacecalendar/README.md

@@ -0,0 +1 @@
+## 补考勤审批页面

+ 103 - 0
src/hrkq/billApprove/replacecalendar/actions/btn.js

@@ -0,0 +1,103 @@
+
+export default class ButtonAction {
+    constructor(comp) {
+        this.action = comp.action;
+        this.comp = comp;
+    }
+
+    didAllInstance = () => {
+        this.setBtnHandleMap();
+    }
+
+    // 生成按钮map
+    setBtnHandleMap = () => {
+        this.buttonHandleMap = {
+            // 打印
+            'print': this.printTable,
+            // 输出
+            'output': this.outputTable
+        }
+    }
+
+
+    // 第一次进页面的按钮状态
+    initPageButton = () => {
+        const {props} = this.comp;
+        const {
+            button
+        } = props;
+        button.setButtonVisible({
+            approveinfo: false,
+            cardrpt: false,
+            file: false
+        });
+    }
+
+    // 按钮点击回调
+    headerClick = (props, btnCode) => {
+        console.log(btnCode);
+        if(typeof this.buttonHandleMap[btnCode] === 'function') {
+            this.buttonHandleMap[btnCode]();
+        }
+    }
+
+    // 打印
+    printTable = () => {
+        const {props} = this.comp;
+        const {replacecalendar, editTable, meta} = props;
+
+        let tableWrapper = document.getElementById('mainTable');
+
+        this.print(tableWrapper, {
+            title: replacecalendar.language['gx6008-000067'], // 录用办理
+            maker: replacecalendar.language['gx6008-000068'], // 制作者
+            date: replacecalendar.language['gx6008-000069'], // 制作日期
+            tableInfo: {
+                data: editTable.getAllRows('list'),
+                tableTmp: meta.getMeta()['list']
+            },
+            beforeAppend: (data) => {
+                data[0].map((item, rowIndex) => {
+                    delete item[0];
+                });
+                data[1].map((item) => {
+                    item.length = item.length - 1;
+                });
+                return data;
+            }
+        });
+    }
+
+    // 输出
+    outputTable = () => {
+        const {
+            props: {
+                editTable,
+                replacecalendar: {
+                    language
+                },
+                meta
+            }
+        } = this.comp;
+        let tableWrapper = document.getElementById('mainTable');
+        let tableData = editTable.getAllData('list');
+
+        this.exportHtml(tableWrapper, {
+            fileName: language['gx6008-000067'] // '录用办理'
+        }, {
+            meta: meta.getMeta()['list'],
+            data: tableData.rows,
+            showIndex: false
+        });
+    }
+
+    // 附件管理
+    fileManager = (selectedRows) => {
+        let billId = selectedRows[0].values['bill_code'].value;
+
+        this.update({
+            fileManagerBillId: billId,
+            fileManagerModalVisible: true
+        });
+    }
+}

+ 15 - 0
src/hrkq/billApprove/replacecalendar/actions/constant.js

@@ -0,0 +1,15 @@
+export default class Constant {
+    reqData = [{
+        rqUrl: '/platform/templet/querypage.do',
+        rqJson: `{\n  \"pagecode\": \"60656048nccloud\",\n  \"appcode\": \"60656048\"\n}`,
+        rqCode: 'template'
+    }, {
+        rqUrl: '/platform/appregister/queryallbtns.do',
+        rqJson: `{\n  \"pagecode\": \"60656048nccloud\",\n  \"appcode\": \"60656048\"\n}`,
+        rqCode: 'button'
+    }, {
+        rqUrl: '/platform/appregister/queryappcontext.do',
+        rqJson: `{\n  \"appcode\": \"60656048\"}`,
+        rqCode: 'context'
+    }];
+};

+ 76 - 0
src/hrkq/billApprove/replacecalendar/actions/main.js

@@ -0,0 +1,76 @@
+import Constant from './constant';
+import HrPubCommon from '../../../../hrpub/common/actions';
+import { getAppPageConfig } from 'src/hrpub/common/utils/utils';
+const {appcode, pagecode} = getAppPageConfig()
+export default class MainAction extends HrPubCommon {
+    constructor(comp) {
+        super();
+        this.comp = comp;
+    }
+
+    extend = [Constant]
+
+    appConfig = {
+        pagecode,
+        appcode
+    }
+
+    update = async (obj) => {
+        const {props} = this.comp;
+        const {dispatch} = props;
+
+        await dispatch({
+            type: 'replacecalendar/update',
+            payload: obj
+        });
+    }
+
+    // 获取多语
+    getCurrentLanguage = () => {
+        this.getLanguage('hrkq-approve', 'hrkq').then((json,status, init) => {
+            this.update({
+                language: json
+            })
+        });
+    }
+
+    // 获取模版信息
+    getTemplate = () => {
+        this.getMultiTemplate(this.reqData)
+            .then((res) => {
+                this.update({
+                    context: res.context
+                });
+                // this.afterGetTemplate();
+            });
+    }
+
+    // 当模版获取并设置完成之后的回调函数
+    afterGetTemplate = () => {
+        this.getFormData();
+    }
+
+    // 初始化
+    didMount = () => {
+        this.getTemplate();
+        this.getCurrentLanguage();
+    }
+
+    /**
+     * @desc: 根据id查询详情
+     * @param {type} 
+     * @return: 
+     */
+    getFormData = async () => {
+        const {props, action} = this.comp;
+        const {getUrlParam} = props;
+
+        let scene = getUrlParam('scene');
+        let id = getUrlParam('id');
+        let status = getUrlParam('status');
+
+        let methodsName = status === 'browse' ? 'toBrowsePage' : 'toEditPage'
+        
+        action.formAct[methodsName](id);
+    }
+}

+ 70 - 0
src/hrkq/billApprove/replacecalendar/actions/turnToFormPage.js

@@ -0,0 +1,70 @@
+export default class FormAction {
+    constructor(comp) {
+        this.comp = comp;
+    }
+    formConfig = {
+        area: 'replacecalendar',
+        formCode: 'replacecalendar_approve_card'
+    }
+    // 表单进入浏览态
+    toBrowseStatus = (formValue) => {
+        const {props} = this.comp;
+        const {form, button} = props;
+
+        // 单据id
+        let billId = '';
+
+        // 表单进入编辑
+        form.setFormStatus(this.formConfig.formCode, 'browse');
+        // 填充表单的值
+        if(formValue) {
+            form.setAllFormValue({
+                [this.formConfig.formCode]: formValue
+            });
+            billId = formValue.rows[0].values['pk_replacecalendar'].value;
+        }
+
+        // 按钮进入编辑的按钮
+        this.update({
+            addPageStatus: 'browse'
+        })
+        // 隐藏掉一些按钮
+        button.setButtonVisible({
+            print: true,
+            batchadd: false
+        });
+    }
+
+    // 直接进入预览页面
+    toBrowsePage = async (id, formValue) => {
+        try {
+            let oneBillData = await this.getOneBillData(id);
+            if (oneBillData) {
+                this.toBrowseStatus(oneBillData.data[this.formConfig.area][this.formConfig.formCode]);
+            } 
+        }
+        catch(e) {
+        }
+    }
+
+    // 获取一条数据
+    getOneBillData = async (pk_replacecalendar) => {
+        const {props} = this.comp;
+        const {dispatch, replacecalendar} = props;
+        try {
+            let res = await dispatch({
+                type: 'replacecalendar/getBillDetail',
+                payload: {
+                    pk_replacecalendar
+                }
+            });
+
+            if(res.success) {
+                return res;
+            }
+        }
+        catch(e) {
+        }
+        return false;
+    }
+}

+ 0 - 0
src/hrkq/billApprove/replacecalendar/components/AddPage/actions/main.js


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