Преглед изворни кода

首页系统指引增加表单编号及自定义排序,系统管理员筛选可选所有角色

cfort пре 2 година
родитељ
комит
3d0eb27aaf

+ 4 - 3
src/views/system/dashboard/components/workbench.js

@@ -139,7 +139,8 @@ export const listSearchForm = {
             { prop: 'suo_shu_xi_tong_', label: '所属子系统', labelWidth: 85, fieldType: 'select', options: [] },
             { prop: 'gong_neng_mo_kuai', label: '所属功能模块', labelWidth: 100, fieldType: 'input' },
             { prop: 'role', label: '编制角色', labelWidth: 70, fieldType: 'select', options: [] },
-            { prop: 'biao_dan_ming_che', label: '记录表单', labelWidth: 70, fieldType: 'input' },
+            { prop: 'biao_dan_ming_che', label: '表单名称', labelWidth: 70, fieldType: 'input' },
+            { prop: 'biao_dan_bian_hao', label: '表单编号', labelWidth: 70, fieldType: 'input' },
             { prop: 'shi_wu_lei_xing_', label: '事务类型', labelWidth: 70, fieldType: 'select', options: taskTypeOption }
         ]
     }
@@ -185,7 +186,7 @@ export const listColumns = {
         { prop: 'depName', label: '发布部门', sortable: 'custom', width: 120 },
         { prop: 'userName', label: '发布人', width: 120 },
         { prop: 'publicDate', label: '发布日期', sortable: 'custom', dateFormat: 'yyyy-MM-dd', width: 120 },
-       // { prop: 'loseDate', label: '有效截至日期', sortable: 'custom', dateFormat: 'yyyy-MM-dd', width: 120 },
+        // { prop: 'loseDate', label: '有效截至日期', sortable: 'custom', dateFormat: 'yyyy-MM-dd', width: 120 },
         { prop: 'status', label: '发布状态', tags: typeOptions, width: 100 }
     ],
     guide: [
@@ -193,7 +194,7 @@ export const listColumns = {
         { prop: 'sysName', label: '所属子系统', width: 100 },
         { prop: 'module', label: '所属功能模块', width: fieldWidth },
         { prop: 'tableName', label: '记录表单', width: 200 },
-        // { prop: 'tableNo', label: '表单编号', width: 100 },
+        { prop: 'tableNo', label: '表单编号', width: 150, sortable: 'custom' },
         { prop: 'timing', label: '填写时机/记录频次', minWidth: fieldWidth },
         { prop: 'taskType', label: '事务类型', tags: taskTypeOption, width: 100 },
         { prop: 'fileName', label: '程序文件', width: 160 },

+ 19 - 2
src/views/system/dashboard/components/workbench.vue

@@ -128,8 +128,17 @@ export default {
         const { first = '', second = '' } = this.$store.getters.level || {}
         const level = second || first
         const { userList = [], deptList = [], role = [], menus = [], isSuper } = this.$store.getters || {}
+        const allRolesMap = new Map()
+        userList.forEach(user => {
+            user.roleId.split(',').forEach((roleId, index) => {
+                if (!allRolesMap.has(roleId)) {
+                    allRolesMap.set(roleId, user.roles.split(',')[index])
+                }
+            })
+        })
+        const allRoles = Array.from(allRolesMap, ([key, value]) => ({ key, value: key, label: value }))
         const isManager = role.some(i => i.alias === 'xtgljs') || isSuper
-        const roleOption = role.map(i => ({ key: i.id, value: i.id, label: i.name }))
+        const roleOption = isManager ? allRoles : role.map(i => ({ key: i.id, value: i.id, label: i.name }))
         const sysOption = menus.map(i => ({ key: i.alias, value: i.title, label: i.title })).filter(i => !['xtgl', 'xnyz'].includes(i.key))
         listSearchForm.guide.forms[0].value = isManager ? 'all' : 'aboutMe'
         listSearchForm.guide.forms[1].options = sysOption
@@ -144,6 +153,13 @@ export default {
                 review: [],
                 approve: []
             }
+            const sortField = {
+                TABLE_NO_: 'biao_dan_bian_hao'
+            }
+            let sortParams = 'sn_ + 0 asc'
+            if (sorts && sorts.length) {
+                sortParams = sorts.map(i => `${sortField[i.field]} ${i.order}`).join(',')
+            }
             role.forEach(i => {
                 range.aboutMe.push(`bian_zhi_jiao_se_ like '%${i.id}%' or shen_he_jiao_se_ like '%${i.id}%' or shen_pi_jiao_se_ like '%${i.id}%'`)
                 range.sponsor.push(`bian_zhi_jiao_se_ like '%${i.id}%'`)
@@ -164,7 +180,7 @@ export default {
             }, '')
             params = params + aboutMeParams + roleParams
             // and di_dian_ = '${level}'
-            const sql = `select sn_ as sn, suo_shu_xi_tong_ as sysName, gong_neng_mo_kuai as module, biao_dan_ming_che as tableName, biao_dan_bian_hao as tableNo, tian_xie_shi_ji_ as timing, shi_wu_lei_xing_ as taskType, cheng_xu_wen_jian as fileName, bian_zhi_ren_ as creator, shen_he_ren_ as reviewer, shen_pi_ren_ as approver, ye_mian_lu_jing_ as path, zi_yuan_lu_jing_ as res from t_bdbhpzb where sn_ + 0 > 0 ${params} order by sn_ + 0 asc`
+            const sql = `select sn_ as sn, suo_shu_xi_tong_ as sysName, gong_neng_mo_kuai as module, biao_dan_ming_che as tableName, biao_dan_bian_hao as tableNo, tian_xie_shi_ji_ as timing, shi_wu_lei_xing_ as taskType, cheng_xu_wen_jian as fileName, bian_zhi_ren_ as creator, shen_he_ren_ as reviewer, shen_pi_ren_ as approver, ye_mian_lu_jing_ as path, zi_yuan_lu_jing_ as res from t_bdbhpzb where sn_ + 0 > 0 ${params} order by ${sortParams}`
             const { pageNo = 1, limit = 15 } = requestPage || {}
             return new Promise((resolve, reject) => {
                 this.$common.request('sql', sql).then(res => {
@@ -411,6 +427,7 @@ export default {
                 pageParams = page
             }
             // const s = this.activeTab === 'news' ? this.sorts { 'PUBLIC_DATE_': 'DESC' } : this.sorts
+            console.log(ActionUtils.formatParams(params, pageParams, this.sorts))
             return ActionUtils.formatParams(params, pageParams, this.sorts)
         },
         // 处理表格点击事件