Przeglądaj źródła

修复首页待办为空时查询数据异常、代理列表调整

cfort 2 lat temu
rodzic
commit
961f0aba7a

+ 24 - 24
src/views/platform/bpmn/bpmTaskChange/constants/index.js

@@ -1,29 +1,29 @@
 export const typeOptions = [
-  {
-    value: 'assignee',
-    label: '代理'
-  },
-  {
-    value: 'shift',
-    label: '转办',
-    type: 'success'
-  }
+    {
+        value: 'assignee',
+        label: '代理'
+    },
+    {
+        value: 'shift',
+        label: '转办',
+        type: 'success'
+    }
 
 ]
 export const statusOptions = [
-  {
-    value: 'running',
-    label: '运行中',
-    type: 'primary'
-  },
-  {
-    value: 'finish',
-    label: '完成',
-    type: 'success'
-  },
-  {
-    value: 'cancel',
-    label: '取消',
-    type: 'danger'
-  }
+    {
+        value: 'running',
+        label: '运行中',
+        type: 'primary'
+    },
+    {
+        value: 'finish',
+        label: '完成',
+        type: 'success'
+    },
+    {
+        value: 'cancel',
+        label: '取消',
+        type: 'danger'
+    }
 ]

+ 89 - 80
src/views/platform/bpmn/bpmTaskChange/list.vue

@@ -1,13 +1,35 @@
 <template>
     <div class="main-container">
-        <ibps-crud ref="crud" :height="height" :data="listData" :toolbars="listConfig.toolbars" :search-form="listConfig.searchForm" :pk-key="pkKey" :columns="listConfig.columns" :pagination="pagination" :loading="loading" :displayField="title" :index-row="false" @action-event="handleAction" @column-link-click="handleLinkClick" @sort-change="handleSortChange" @pagination-change="handlePaginationChange" />
-
-        <edit :id="editId" :title="title" :readonly="readonly" :visible="dialogFormVisible" @callback="search" @close="(visible) => (dialogFormVisible = visible)" />
+        <ibps-crud
+            ref="crud"
+            :height="height"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :pagination="pagination"
+            :loading="loading"
+            :display-field="title"
+            :index-row="false"
+            @action-event="handleAction"
+            @column-link-click="handleLinkClick"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        />
+        <edit
+            :id="editId"
+            :title="title"
+            :readonly="readonly"
+            :visible="dialogFormVisible"
+            @callback="search"
+            @close="(visible) => (dialogFormVisible = visible)"
+        />
         <bpmn-formrender :visible="formrenderDialogFormVisible" :instance-id="instanceId" :task-change-id="editId" @close="(visible) => (formrenderDialogFormVisible = visible)" />
     </div>
 </template>
 
-  <script>
+<script>
 import { queryPageList, setStatus } from '@/api/platform/bpmn/bpmTaskChange'
 import ActionUtils from '@/utils/action'
 import FixHeight from '@/mixins/height'
@@ -23,7 +45,7 @@ export default {
         BpmnFormrender
     },
     mixins: [FixHeight],
-    data() {
+    data () {
         return {
             dialogFormVisible: false, // 弹窗
             editId: '', // 编辑dialog需要使用
@@ -67,17 +89,17 @@ export default {
                 },
                 // 表格字段配置
                 columns: [
-                    { prop: 'taskSubject', label: '事务名称', link: 'dialog' },
-                    { prop: 'taskSubjectName', label: '事务说明', width: 350 },
-                    { prop: 'executorName', label: '代理人', width: 120 },
-                    { prop: 'createTime', label: '事务创建时间', width: 150 },
-                    //   { prop: 'taskName', label: '任务名称', width: 250 },
-                    { prop: 'status', label: '状态', tags: statusOptions, width: 150 },
-                    { prop: 'ownerName', label: '委托人', width: 120 },
-                    //   { prop: 'createTime', label: '创建时间', width: 150 }
-                    { prop: 'startTime', label: '代理生效时间', width: 150 },
-                    { prop: 'endTime', label: '代理截止时间', width: 150 },
-                    { prop: 'changeType', label: '更改类型', tags: typeOptions, width: 120 }
+                    { prop: 'taskSubject', label: '事务名称', link: 'dialog', width: 200 },
+                    { prop: 'taskSubjectName', label: '事务说明', minWidth: 250 },
+                    { prop: 'createTime', label: '事务创建时间', sortable: 'custom', width: 140 },
+                    { prop: 'status', label: '状态', tags: statusOptions, width: 80 },
+                    { prop: 'ownerName', label: '委托人', width: 90 },
+                    // { prop: 'executorName', label: '代理人', width: 90 },
+                    // { prop: 'taskName', label: '任务名称', width: 250 },
+                    // { prop: 'createTime', label: '创建时间', width: 150 }
+                    // { prop: 'startTime', label: '代理生效时间', sortable: 'custom', width: 120 },
+                    // { prop: 'endTime', label: '代理截止时间', sortable: 'custom', width: 120 },
+                    { prop: 'changeType', label: '更改类型', tags: typeOptions, width: 100 }
                 ],
                 rowHandle: {
                     actions: [
@@ -85,14 +107,14 @@ export default {
                             key: 'revoke',
                             label: '撤回',
                             icon: 'ibps-icon-cancel',
-                            hidden: function (row, index) {
+                            hidden (row, index) {
                                 if (row.ownerId === this.$store.getters.userId && row.status === 'running') return false
                                 return true
                             }
                         },
                         {
                             key: 'detail',
-                            hidden: function (row, index) {
+                            hidden (row, index) {
                                 if (row.ownerId === this.$store.getters.userId) return false
                                 return true
                             }
@@ -102,44 +124,39 @@ export default {
             }
         }
     },
-    created() {
+    created () {
         this.loadData()
     },
     methods: {
         // 加载数据
-        loadData() {
+        loadData () {
             this.loading = true
-            queryPageList(this.getSearcFormData())
-                .then((response) => {
-                    response.data.dataResult.forEach((item) => {
-                        if (item.completeTime) {
-                            item.completeTime = item.completeTime.split(' ')[0]
-                        }
-                        let taskSubject = item.taskSubject.split('#')
-                        item.taskSubject = taskSubject[0]
-                        this.$set(item, 'taskSubjectName', taskSubject[1])
-                        if (item.changeType == 'assignee' && item.ownerId && item.executorId) {
-                            this.getDaiLi(item.ownerId, item.executorId, item.createTime, (ruselt) => {
-                                if (ruselt.length > 0) {
-                                    this.$set(item, 'startTime', dayjs(ruselt[0].EFFECTIVE_TIME_).format('YYYY-MM-DD'))
-                                    this.$set(item, 'endTime', dayjs(ruselt[0].EXPIRY_TIME).format('YYYY-MM-DD'))
-                                }
-                            })
-                        }
-                    })
-                    ActionUtils.handleListData(this, response.data)
-                    this.loading = false
-                })
-                .catch(() => {
-                    this.loading = false
+            queryPageList(this.getSearcFormData()).then((response) => {
+                response.data.dataResult.forEach((item) => {
+                    const taskSubject = item.taskSubject.split('#')
+                    item.taskSubject = taskSubject[0]
+                    this.$set(item, 'taskSubjectName', taskSubject[1])
+                    // if (item.changeType === 'assignee' && item.ownerId && item.executorId) {
+                    //     this.getDaiLi(item.ownerId, item.executorId, item.createTime, (result) => {
+                    //         if (result.length) {
+                    //             this.$set(item, 'startTime', result[0].EFFECTIVE_TIME_)
+                    //             this.$set(item, 'endTime', result[0].EXPIRY_TIME_)
+                    //         }
+                    //     })
+                    // }
                 })
+                ActionUtils.handleListData(this, response.data)
+                this.loading = false
+            }).catch(() => {
+                this.loading = false
+            })
         },
-        //反查代理数据
-        getDaiLi(val1, val2, createTime, callback) {
-            let sql = `select * from ibps_bpm_agent where DELEGATOR_ID_ = '${val1}' and AGENTER_ID_ = '${val2}' and IS_ENABLED_ = 'enabled' and DATE_FORMAT('${createTime}','%Y-%m-%d') BETWEEN EFFECTIVE_TIME_ and EXPIRY_TIME_`
+        // 反查代理数据
+        getDaiLi (val1, val2, createTime, callback) {
+            const sql = `select DATE_FORMAT(EXPIRY_TIME_,'%Y-%m-%d') AS EXPIRY_TIME_, DATE_FORMAT(EFFECTIVE_TIME_,'%Y-%m-%d') AS EFFECTIVE_TIME_ from ibps_bpm_agent where DELEGATOR_ID_ = '${val1}' and AGENTER_ID_ = '${val2}' and DATE_FORMAT('${createTime}','%Y-%m-%d') BETWEEN EFFECTIVE_TIME_ and EXPIRY_TIME_`
             curdPost('sql', sql).then((res) => {
-                if (res.state == 200) {
-                    let datas = res.variables.data
+                if (res.state === 200) {
+                    const datas = res.variables.data
                     callback(datas)
                 }
             })
@@ -147,84 +164,76 @@ export default {
         /**
          * 获取格式化参数
          */
-        getSearcFormData() {
+        getSearcFormData () {
             return ActionUtils.formatParams(this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}, this.pagination, this.sorts)
         },
         /**
          * 处理分页事件
          */
-        handlePaginationChange(page) {
+        handlePaginationChange (page) {
             ActionUtils.setPagination(this.pagination, page)
             this.loadData()
         },
         /**
          * 处理排序
          */
-        handleSortChange(sort) {
+        handleSortChange (sort) {
             ActionUtils.setSorts(this.sorts, sort)
             this.loadData()
         },
         /**
          * 查询
          */
-        search() {
+        search () {
             this.loadData()
         },
         /**
          * 处理按钮事件
          */
-        handleAction(command, position, selection, data) {
+        handleAction (command, position, selection, data) {
             switch (command) {
                 case 'search': // 查询
                     ActionUtils.setFirstPagination(this.pagination)
                     this.search()
                     break
                 case 'revoke': // 撤消
-                    ActionUtils.selectedRecord(selection)
-                        .then((id) => {
-                            this.handleRevoke(id)
-                        })
-                        .catch(() => {})
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.handleRevoke(id)
+                    }).catch(() => {})
                     break
                 case 'detail': // 明细
-                    ActionUtils.selectedRecord(selection)
-                        .then((id) => {
-                            this.handleEdit(id, true)
-                            this.title = '转办代理明细'
-                        })
-                        .catch(() => {})
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.handleEdit(id, true)
+                        this.title = '转办代理明细'
+                    }).catch(() => {})
                     break
                 default:
                     break
             }
         },
         // 处理撤回
-        handleRevoke(id) {
+        handleRevoke (id) {
             this.$confirm('确定撤回?', this.$t('common.dialog.title'), {
                 type: 'warning'
-            })
-                .then(() => {
-                    setStatus({
-                        id: id,
-                        status: 'cancel'
-                    })
-                        .then((response) => {
-                            ActionUtils.successMessage('撤回任务成功')
-                            this.search()
-                        })
-                        .catch(() => {})
-                })
-                .catch(() => {})
+            }).then(() => {
+                setStatus({
+                    id: id,
+                    status: 'cancel'
+                }).then((response) => {
+                    ActionUtils.successMessage('撤回任务成功')
+                    this.search()
+                }).catch(() => {})
+            }).catch(() => {})
         },
         /**
          * 处理编辑
          */
-        handleEdit(id = '', readonly = true) {
+        handleEdit (id = '', readonly = true) {
             this.editId = id
             this.readonly = readonly
             this.dialogFormVisible = true
         },
-        handleLinkClick(data, columns) {
+        handleLinkClick (data, columns) {
             this.editId = data.id
             this.instanceId = data.procInstId
             this.formrenderDialogFormVisible = true

+ 2 - 2
src/views/platform/system/news/edit.vue

@@ -80,10 +80,10 @@
                 <el-form-item label="作者:" prop="author">
                     <el-input v-model="form.author" />
                 </el-form-item>
-                <el-form-item label="关键字:" prop="key">
+                <!-- <el-form-item label="关键字:" prop="key">
                     <el-input v-model="form.key" />
                 </el-form-item>
-                <!-- <el-form-item label="发布时间:" prop="publicDate">
+                <el-form-item label="发布时间:" prop="publicDate">
                     <el-date-picker
                         v-model="form.publicDate"
                         type="date"

+ 1 - 1
src/views/system/dashboard/components/workbench.vue

@@ -405,7 +405,7 @@ export default {
                     dataResult.forEach(item => {
                         instList.push(item.bpmnInstId)
                     })
-                    const sql = `select b.bpmn_inst_id_, b.create_by_, a.name_ from ibps_bpm_inst b left join ibps_party_employee a on a.id_ = b.create_by_ where b.bpmn_inst_id_ in (${instList.join(',')}) order by find_in_set(b.bpmn_inst_id_,'${instList.join(',')}')`
+                    const sql = `select b.bpmn_inst_id_, b.create_by_, a.name_ from ibps_bpm_inst b left join ibps_party_employee a on a.id_ = b.create_by_ where b.bpmn_inst_id_ in ('${instList.join(',')}') order by find_in_set(b.bpmn_inst_id_,'${instList.join(',')}')`
                     const currentTime = Date.now()
                     this.$common.request('sql', sql).then(res => {
                         const data = res.variables && res.variables.data