Quellcode durchsuchen

电子表单填写、事务代理记录列表通用查询接口改为后台接口对接

cfort vor 11 Monaten
Ursprung
Commit
8c8d9765ee

+ 1 - 14
src/api/business/general.js

@@ -79,21 +79,8 @@ export function queryFileInfo (params) {
  */
 export function queryTaskAgemt (data) {
     return request({
-        url: BUSINESS_BASE_URL() + '/swdl/queryData',
+        url: BUSINESS_BASE_URL() + '/sql/swdl/queryData',
         method: 'post',
         data
     })
 }
-
-/**
- * 获取考试记录
- * @param {*} params
- */
-export function queryExams (data) {
-    return request({
-        url: BUSINESS_BASE_URL() + '/exam/management/queryData',
-        method: 'post',
-        data
-    })
-}
-

+ 18 - 12
src/views/business/onlineForm/index.vue

@@ -186,8 +186,8 @@ export default {
                     itemWidth: 150,
                     forms: [
                         { prop: 'bian_zhi_bu_men_', label: '部门', fieldType: 'slot', slotName: 'dept', itemWidth: 120 },
-                        { prop: 'biao_dan_ming_che', label: '表单名称' },
-                        { prop: 'shi_fou_guo_shen_', label: '状态', fieldType: 'select', options: stateOption },
+                        { prop: 'Q^biao_dan_ming_che^SL', label: '表单名称' },
+                        { prop: 'Q^shi_fou_guo_shen_^S', label: '状态', fieldType: 'select', options: stateOption },
                         { prop: 'bian_zhi_ren_', label: '填写人', fieldType: 'slot', slotName: 'user' },
                         { prop: ['Q^bian_zhi_shi_jian^DL', 'Q^bian_zhi_shi_jian^DG'], label: '填写时间', fieldType: 'daterange', itemWidth: 240 }
                     ]
@@ -367,21 +367,26 @@ export default {
             }
             const { dept, submitBy } = this.searchParams
             if (this.$utils.isNotEmpty(dept)) {
-                dept.split(',').forEach(item => {
-                    params[`Q^bian_zhi_bu_men_^S`] = item
-                })
+                params[`Q^bian_zhi_bu_men_^S`] = dept.split(',')
             }
             if (this.$utils.isNotEmpty(submitBy)) {
-                submitBy.split(',').forEach(item => {
-                    params[`Q^bian_zhi_ren_^S`] = item
-                })
+                params[`Q^bian_zhi_ren_^S`] = submitBy.split(',')
             }
             params['Q^di_dian_^S'] = this.level
-            return ActionUtils.formatParams(
-                params,
-                this.pagination,
-                this.sorts
+            // console.log(params)
+            const result = {
+                parameters: this.formatParameters(params),
+                ...ActionUtils.formatParams(null, this.pagination, this.sorts)
+            }
+            return result
+        },
+        formatParameters (data) {
+            const parameters = Object.entries(data).map(([key, value]) =>
+                Array.isArray(value)
+                    ? { relation: 'OR', parameters: value.map(v => ({ key, value: v, param: this.$utils.guid() })) }
+                    : { key, value }
             )
+            return parameters.length === 1 ? [parameters[0]] : [{ relation: 'AND', parameters }]
         },
         /**
          * 处理分页事件
@@ -394,6 +399,7 @@ export default {
          * 处理排序
          */
         handleSortChange (sort) {
+            sort.sortBy = sort.sortBy.slice(0, 17)
             ActionUtils.setSorts(this.sorts, sort)
             this.loadData()
         },

+ 50 - 42
src/views/platform/bpmn/bpmAgent/agentByRole/list.vue

@@ -38,14 +38,15 @@
 
 <script>
 import IbpsEmployeeSelector from '@/business/platform/org/employee/selector'
-import { queryPageList, remove, setEnable } from '@/api/platform/bpmn/bpmAgent'
+// import { queryPageList, remove, setEnable } from '@/api/platform/bpmn/bpmAgent'
+import { queryTaskAgemt } from '@api/business/general'
 import ibpsUserSelector from '@/business/platform/org/selector'
 import ActionUtils from '@/utils/action'
 import FixHeight from '@/mixins/height'
 import { statusOptions, agentTypeOptions } from '../constants'
 import Edit from './edit'
-import { create, update, load, upEmployee } from '@/api/platform/org/employee'
 import agent from './agent'
+import { keyBy, mapValues } from 'lodash'
 
 export default {
     components: {
@@ -71,12 +72,7 @@ export default {
             height: document.clientHeight,
 
             listData: [],
-            pagination: {
-                limit: 10,
-                page: 1,
-                totalCount: 0,
-                totalPages: 0
-            },
+            pagination: {},
             sorts: {},
             listConfig: {
                 toolbars: [
@@ -93,11 +89,11 @@ export default {
                 searchForm: {
                     forms: [
                         {
-                            prop: 'dai_li_ren_xing_m',
+                            prop: 'daiLiRenXingM',
                             label: '代理人'
                         },
                         {
-                            prop: 'shi_fou_qi_yong_',
+                            prop: 'shiFouQiYong',
                             label: '是否启用',
                             fieldType: 'select',
                             options: statusOptions
@@ -171,30 +167,39 @@ export default {
             this.searchDelegatorId = value
         },
         // 加载数据
+        // loadData () {
+        //     this.loading = true
+        //     const start = (this.pagination.page - 1) * this.pagination.limit
+        //     const end = this.pagination.page * this.pagination.limit
+        //     const searcFormData = this.getSearcFormData()
+        //     const sql1 = `select a.*,b.name_ from t_swdl a left join ibps_party_employee b on a.create_by_ = b.ID_  where a.di_dian_ = '${this.level}' ${searcFormData} order by a.create_time_ desc limit ${start},${end}`
+        //     const sql2 = `select count(a.id_) as count from t_swdl a where a.di_dian_ = '${this.level}' ${searcFormData}`
+        //     Promise.all([this.$common.request('sql', sql1), this.$common.request('sql', sql2)]).then((res) => {
+        //         const list0 = res[0].variables.data
+        //         list0.forEach(item => {
+        //             item.id = item.id_
+        //         })
+        //         const list1 = res[1].variables.data
+        //         const page = {
+        //             limit: this.pagination.limit,
+        //             page: this.pagination.page,
+        //             totalCount: list1[0].count,
+        //             totalPages: Math.ceil(list1[0].count / this.pagination.limit)
+        //         }
+        //         const result = {
+        //             dataResult: list0,
+        //             pageResult: page
+        //         }
+        //         ActionUtils.handleListData(this, result)
+        //         this.loading = false
+        //     }).catch(() => {
+        //         this.loading = false
+        //     })
+        // },
         loadData () {
             this.loading = true
-            const start = (this.pagination.page - 1) * this.pagination.limit
-            const end = this.pagination.page * this.pagination.limit
-            const searcFormData = this.getSearcFormData()
-            const sql1 = `select a.*,b.name_ from t_swdl a left join ibps_party_employee b on a.create_by_ = b.ID_  where a.di_dian_ = '${this.level}' ${searcFormData} order by a.create_time_ desc limit ${start},${end}`
-            const sql2 = `select count(a.id_) as count from t_swdl a where a.di_dian_ = '${this.level}' ${searcFormData}`
-            Promise.all([this.$common.request('sql', sql1), this.$common.request('sql', sql2)]).then((res) => {
-                const list0 = res[0].variables.data
-                list0.forEach(item => {
-                    item.id = item.id_
-                })
-                const list1 = res[1].variables.data
-                const page = {
-                    limit: this.pagination.limit,
-                    page: this.pagination.page,
-                    totalCount: list1[0].count,
-                    totalPages: Math.ceil(list1[0].count / this.pagination.limit)
-                }
-                const result = {
-                    dataResult: list0,
-                    pageResult: page
-                }
-                ActionUtils.handleListData(this, result)
+            queryTaskAgemt(this.getSearchFormData()).then(res => {
+                ActionUtils.handleListData(this, res.data)
                 this.loading = false
             }).catch(() => {
                 this.loading = false
@@ -203,18 +208,21 @@ export default {
         /**
          * 获取格式化参数
          */
-        getSearcFormData () {
+        getSearchFormData () {
             const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-            let keyParams = ``
-            if (params) {
-                Object.keys(params).forEach(item => {
-                    if (params[item]) {
-                        keyParams = `and a.${item} like '%${params[item]}%'`
-                    }
-                })
+            const formatParams = ActionUtils.formatParams(
+                params,
+                this.pagination,
+                this.sorts
+            )
+            const { parameters, requestPage, sorts } = formatParams || {}
+            const p = mapValues(keyBy(parameters, 'key'), 'value')
+            const { pageNo, limit } = requestPage || {}
+            return {
+                ...p,
+                pageNo,
+                limit
             }
-            return keyParams
-            // return ActionUtils.formatParams(params, this.pagination, this.sorts)
         },
         /**
          * 处理分页事件