liubp
2025-11-06 63ae3f38ceec72bbd32727eaf7fcfdf702afa5d6
组织添加与修改
员工信息添加新字段
岗位维护页面
6个文件已修改
2个文件已添加
424 ■■■■■ 已修改文件
public/components/frame/addOrg/addOrg.html 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/components/frame/addOrg/addOrg.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/components/frame/editOrg/editOrg.html 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/components/frame/editOrg/editOrg.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/pages/frame/addStaff/addStaff.html 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/pages/frame/addStaff/addStaff.js 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/pages/frame/dictList/dictList.html 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/pages/frame/dictList/dictList.js 188 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/components/frame/addOrg/addOrg.html
@@ -30,6 +30,15 @@
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="组织编码" namespace="addOrg"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <input v-model="addOrgInfo.orgCode" type="text"
                                           :placeholder="vc.i18n('选填,请填写组织编码','addOrg')" class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="描述" namespace="addOrg"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
public/components/frame/addOrg/addOrg.js
@@ -11,6 +11,7 @@
                orgLevel: '',
                parentOrgId: '',
                parentOrgName: '',
                orgCode: '',
                description: '',
                belongCommunityId: '',
                parentOrg: [],
@@ -108,6 +109,7 @@
                    orgLevel: '',
                    parentOrgId: '',
                    parentOrgName: '',
                    orgCode: '',
                    description: '',
                    parentOrg: [],
                    belongCommunityId: '',
public/components/frame/editOrg/editOrg.html
@@ -30,6 +30,15 @@
                            </div> -->
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="组织编码" namespace="editOrg"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <input v-model="editOrgInfo.orgCode" type="text"
                                        :placeholder="vc.i18n('选填,请填写组织编码','editOrg')" class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <vc:i18n name="描述" namespace="editOrg"></vc:i18n>
                                </label>
                                <div class="col-sm-10">
public/components/frame/editOrg/editOrg.js
@@ -7,6 +7,7 @@
                orgLevel: '',
                parentOrgId: '',
                parentOrgName: '',
                orgCode: '',
                belongCommunityId: '',
                description: '',
                parentOrg: [],
@@ -100,6 +101,7 @@
                    orgLevel: '',
                    parentOrgId: '',
                    parentOrgName: '',
                    orgCode: '',
                    description: '',
                    belongCommunityId: '',
                    communityId: '',
public/pages/frame/addStaff/addStaff.html
@@ -43,6 +43,15 @@
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label  text-center">
                            <vc:i18n name="基础代码" namespace="addStaff"></vc:i18n>
                    </label>
                    <div class="col-sm-10">
                        <input v-model="addStaffInfo.baseCode" type="text" :placeholder="vc.i18n('必填,7位基础代码','addStaff')"
                            class="form-control" maxlength="7">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label  text-center">
                            <vc:i18n name="照片" namespace="addStaff"></vc:i18n>
                    </label>
                    <div class="col-sm-10">
@@ -85,6 +94,15 @@
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label  text-center">
                            <vc:i18n name="代码汇总" namespace="addStaff"></vc:i18n>
                    </label>
                    <div class="col-sm-10">
                        <input v-model="addStaffInfo.codeSummary" type="text" :placeholder="vc.i18n('必填,11位代码汇总','addStaff')"
                            class="form-control" maxlength="11">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label  text-center">
                            <vc:i18n name="关联组织" namespace="addStaff"></vc:i18n>
                    </label>
                    <div class="col-sm-10">
public/pages/frame/addStaff/addStaff.js
@@ -9,6 +9,8 @@
                idCard: '',
                tel: '',
                address: '',
                baseCode: '',
                codeSummary: '',
                relCd: '',
                relCds: [],
                photo: ''
@@ -51,6 +53,38 @@
                        param: "",
                        errInfo: "员工性别不能为空"
                    }],
                    'addStaffInfo.baseCode': [{
                        limit: "required",
                        param: "",
                        errInfo: "基础代码不能为空"
                    },
                        {
                            limit: "minLength",
                            param: "7",
                            errInfo: "基础代码必须为7位"
                        },
                        {
                            limit: "maxLength",
                            param: "7",
                            errInfo: "基础代码必须为7位"
                        },
                    ],
                    'addStaffInfo.codeSummary': [{
                        limit: "required",
                        param: "",
                        errInfo: "代码汇总不能为空"
                    },
                        {
                            limit: "minLength",
                            param: "11",
                            errInfo: "代码汇总必须为11位"
                        },
                        {
                            limit: "maxLength",
                            param: "11",
                            errInfo: "代码汇总必须为11位"
                        },
                    ],
                    'addStaffInfo.relCd': [{
                        limit: "required",
                        param: "",
@@ -125,6 +159,8 @@
                    idCard: '',
                    tel: '',
                    address: '',
                    baseCode: '',
                    codeSummary: '',
                    relCd: '',
                    relCds: _relCds,
                    photo: ''
public/pages/frame/dictList/dictList.html
New file
@@ -0,0 +1,160 @@
<div>
    <div class="row" style="display:none;">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <h5>
                        <span><vc:i18n name="查询条件"></vc:i18n></span>
                    </h5>
                    <div class="ibox-tools" style="top:10px;"></div>
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-3">
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('名称','dictList')"
                                       v-model.trim="dictListInfo.conditions.name" class=" form-control">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <div class="form-group">
                                <input type="text" :placeholder="vc.i18n('值','dictList')"
                                       v-model.trim="dictListInfo.conditions.statusCd" class=" form-control">
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <button type="button" class="btn btn-primary btn-sm" v-on:click="_queryDicts()">
                                <i class="fa fa-search"></i>
                                <span><vc:i18n name="查询"></vc:i18n></span>
                            </button>
                            <button type="button" class="btn btn-primary btn-sm" v-on:click="_resetDicts()">
                                <i class="fa fa-repeat"></i>
                                <span><vc:i18n name="重置"></vc:i18n></span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>
                        <span><vc:i18n name="字典列表" namespace="dictList"></vc:i18n></span>
                    </h5>
                    <div class="ibox-tools" style="top:10px;">
                        <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#addDictModal">
                            <i class="fa fa-plus"></i>
                            <span><vc:i18n name="添加" namespace="dictList"></vc:i18n></span>
                        </button>
                    </div>
                </div>
                <div class="ibox-content">
                    <table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
                        <thead>
                        <tr>
                            <th class="text-center"><span><vc:i18n name='字典类型' namespace='dictList'></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name='名称' namespace='dictList'></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name='值' namespace='dictList'></vc:i18n></span></th>
                            <!-- <th class="text-center"><span><vc:i18n name='职级代码' namespace='dictList'></vc:i18n></span></th> -->
                            <th class="text-center"><span><vc:i18n name='描述' namespace='dictList'></vc:i18n></span></th>
                            <th class="text-center"><span><vc:i18n name='操作' namespace='dictList'></vc:i18n></span></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for="dict in dictListInfo.dicts">
                            <td class="text-center">{{dict.specName}}</td>
                            <td class="text-center">{{dict.name}}</td>
                            <td class="text-center">{{dict.statusCd}}</td>
                            <!-- <td class="text-center">{{dict.orgCode}}</td> -->
                            <td class="text-center">{{dict.description}}</td>
                            <td class="text-center">
                                <button type="button" class="btn btn-white btn-sm" v-on:click="_openEdit(dict)">
                                    <i class="fa fa-pencil"></i>
                                    <span><vc:i18n name="编辑" namespace="dictList"></vc:i18n></span>
                                </button>
                                <button type="button" class="btn btn-danger btn-sm" v-on:click="_confirmDelete(dict)">
                                    <i class="fa fa-trash"></i>
                                    <span><vc:i18n name="删除" namespace="dictList"></vc:i18n></span>
                                </button>
                            </td>
                        </tr>
                        </tbody>
                        <tfoot>
                        <tr>
                            <td colspan="7">
                                <ul class="pagination float-right"></ul>
                            </td>
                        </tr>
                        </tfoot>
                    </table>
                    <vc:create path="frame/pagination"></vc:create>
                </div>
            </div>
        </div>
    </div>
    <!-- 添加岗位信息 Modal -->
    <div class="modal fade" id="addDictModal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title"><vc:i18n name="添加岗位信息" namespace="dictList"></vc:i18n></h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label><vc:i18n name="系统存放值" namespace="dictList"></vc:i18n></label>
                        <input type="text" class="form-control" v-model.trim="dictListInfo.addForm.statusCd" placeholder="11000">
                    </div>
                    <div class="form-group">
                        <label><vc:i18n name="岗位名称" namespace="dictList"></vc:i18n></label>
                        <input type="text" class="form-control" v-model.trim="dictListInfo.addForm.name" placeholder="应收款专员">
                    </div>
                    <div class="form-group">
                        <label><vc:i18n name="岗位描述" namespace="dictList"></vc:i18n></label>
                        <input type="text" class="form-control" v-model.trim="dictListInfo.addForm.description" placeholder="请输入岗位描述">
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal"><vc:i18n name="取消" namespace="dictList"></vc:i18n></button>
                    <button type="button" class="btn btn-primary" v-on:click="_saveDict()"><vc:i18n name="保存" namespace="dictList"></vc:i18n></button>
                </div>
            </div>
        </div>
    </div>
    <!-- 编辑岗位信息 Modal -->
    <div class="modal fade" id="editDictModal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title"><vc:i18n name="编辑岗位信息" namespace="dictList"></vc:i18n></h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label><vc:i18n name="系统存放值" namespace="dictList"></vc:i18n></label>
                        <input type="text" class="form-control" v-model.trim="dictListInfo.editForm.statusCd">
                    </div>
                    <div class="form-group">
                        <label><vc:i18n name="岗位名称" namespace="dictList"></vc:i18n></label>
                        <input type="text" class="form-control" v-model.trim="dictListInfo.editForm.name">
                    </div>
                    <div class="form-group">
                        <label><vc:i18n name="岗位描述" namespace="dictList"></vc:i18n></label>
                        <input type="text" class="form-control" v-model.trim="dictListInfo.editForm.description">
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal"><vc:i18n name="取消" namespace="dictList"></vc:i18n></button>
                    <button type="button" class="btn btn-primary" v-on:click="_updateDict()"><vc:i18n name="保存" namespace="dictList"></vc:i18n></button>
                </div>
            </div>
        </div>
    </div>
</div>
public/pages/frame/dictList/dictList.js
New file
@@ -0,0 +1,188 @@
(function (vc) {
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data: {
            dictListInfo: {
                dicts: [],
                total: 0,
                records: 1,
                conditions: {
                    specId: '4',
                    name: '',
                    statusCd: '',
                    page: DEFAULT_PAGE,
                    row: DEFAULT_ROWS
                },
                addForm: {
                    statusCd: '',
                    name: '',
                    // orgCode: '',
                    description: '',
                    specId: '4'
                },
                editForm: {
                    id: '',
                    statusCd: '',
                    name: '',
                    // orgCode: '',
                    description: '',
                    specId: '4'
                }
            }
        },
        _initMethod: function () {
            vc.component._listDicts(DEFAULT_PAGE, DEFAULT_ROWS);
        },
        _initEvent: function () {
            vc.on('pagination', 'page_event', function (_currentPage) {
                vc.component._listDicts(_currentPage, DEFAULT_ROWS);
            });
        },
        methods: {
            _listDicts: function (_page, _rows) {
                vc.component.dictListInfo.conditions.page = _page;
                vc.component.dictListInfo.conditions.row = _rows;
                var param = {
                    params: vc.component.dictListInfo.conditions
                };
                // 发送 GET 请求到 /app/dict.listDict
                vc.http.apiGet('/dict.listDict',
                    param,
                    function (json, res) {
                        var _data = JSON.parse(json);
                        vc.component.dictListInfo.total = _data.total;
                        vc.component.dictListInfo.records = _data.records;
                        vc.component.dictListInfo.dicts = _data.data || [];
                        vc.emit('pagination', 'init', {
                            total: vc.component.dictListInfo.records,
                            dataCount: vc.component.dictListInfo.total,
                            currentPage: _page
                        });
                    }, function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _queryDicts: function () {
                vc.component._listDicts(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            _resetDicts: function () {
                vc.component.dictListInfo.conditions.name = '';
                vc.component.dictListInfo.conditions.statusCd = '';
                vc.component._listDicts(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            _saveDict: function () {
                var form = vc.component.dictListInfo.addForm;
                if (!form.statusCd || !form.name) {
                    vc.toast('请完整填写必填项');
                    return;
                }
                var payload = {
                    statusCd: form.statusCd,
                    name: form.name,
                    // orgCode: form.orgCode,
                    description: form.description,
                    specId: '4'
                };
                vc.http.apiPost(
                    '/dict.saveDict',
                    JSON.stringify(payload),
                    { emulateJSON: true },
                    function (json, res) {
                        var _json = JSON.parse(json);
                        if (_json.code == 0) {
                            $('#addDictModal').modal('hide');
                            // 清空表单
                            vc.component.dictListInfo.addForm.statusCd = '';
                            vc.component.dictListInfo.addForm.name = '';
                            // vc.component.dictListInfo.addForm.orgCode = '';
                            vc.component.dictListInfo.addForm.description = '';
                            vc.toast('添加成功');
                            // 刷新列表
                            vc.component._listDicts(DEFAULT_PAGE, DEFAULT_ROWS);
                        } else {
                            vc.toast(_json.msg || '添加失败');
                        }
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                        vc.toast(errInfo || '请求失败');
                    }
                );
            },
            _openEdit: function (dict) {
                vc.component.dictListInfo.editForm.id = dict.id || dict.dictId || '';
                vc.component.dictListInfo.editForm.statusCd = dict.statusCd || '';
                vc.component.dictListInfo.editForm.name = dict.name || '';
                // vc.component.dictListInfo.editForm.orgCode = dict.orgCode || '';
                vc.component.dictListInfo.editForm.description = dict.description || '';
                $('#editDictModal').modal('show');
            },
            _updateDict: function () {
                var form = vc.component.dictListInfo.editForm;
                if (!form.id || !form.statusCd || !form.name) {
                    vc.toast('请完整填写必填项');
                    return;
                }
                var payload = {
                    id: form.id,
                    statusCd: form.statusCd,
                    name: form.name,
                    // orgCode: form.orgCode,
                    description: form.description,
                    specId: '4'
                };
                vc.http.apiPost(
                    '/dict.updateDict',
                    JSON.stringify(payload),
                    { emulateJSON: true },
                    function (json, res) {
                        var _json = JSON.parse(json);
                        if (_json.code == 0) {
                            $('#editDictModal').modal('hide');
                            vc.toast('修改成功');
                            vc.component._listDicts(DEFAULT_PAGE, DEFAULT_ROWS);
                        } else {
                            vc.toast(_json.msg || '修改失败');
                        }
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                        vc.toast(errInfo || '请求失败');
                    }
                );
            },
            _confirmDelete: function (dict) {
                var id = dict.id || dict.dictId || '';
                if (!id) {
                    vc.toast('缺少ID,无法删除');
                    return;
                }
                if (!window.confirm('确认删除该岗位吗?')) {
                    return;
                }
                vc.http.apiPost(
                    '/dict.deleteDict',
                    JSON.stringify({ id: id }),
                    { emulateJSON: true },
                    function (json, res) {
                        var _json = JSON.parse(json);
                        if (_json.code == 0) {
                            vc.toast('删除成功');
                            vc.component._listDicts(DEFAULT_PAGE, DEFAULT_ROWS);
                        } else {
                            vc.toast(_json.msg || '删除失败');
                        }
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                        vc.toast(errInfo || '请求失败');
                    }
                );
            }
        }
    });
})(window.vc);