Browse Source

update 代理

linweizeng 3 years ago
parent
commit
8cf3d0fbd5

+ 3 - 1
src/views/platform/bpmn/bpmAgent/edit.vue

@@ -265,7 +265,9 @@ export default {
       toolbars: [
         { key: 'save', hidden: () => { return this.readonly } },
         { key: 'cancel' }
-      ]
+      ],
+      orgAddIndex: 'qita',
+      orgAddId: '990905993732816896,1017183192769101824,990915218848612352,1017182150320979968,1017182194042404864,990914314816716800,990915476898971648,990915611989114880,990915712052625408,1017182721685848064,1017183098200129536'
     }
   },
   computed: {

+ 219 - 233
src/views/platform/bpmn/bpmAgent/list.vue

@@ -1,39 +1,12 @@
 <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"
-      :row-handle="listConfig.rowHandle"
-      :pagination="pagination"
-      :loading="loading"
-      :index-row="false"
-      :displayField="title"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    >
-      <template slot="delegatorId">
-        <ibps-employee-selector
-          :value="searchDelegatorId"
-          style="width:200px;"
-          @input="getDelegatorId"
-        />
-      </template>
-    </ibps-crud>
-    <edit
-      :id="editId"
-      :title="title"
-      :visible="dialogFormVisible"
-      :readonly="readonly"
-      @callback="search"
-      @close="visible => dialogFormVisible = visible"
-    />
-  </div>
+    <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" :row-handle="listConfig.rowHandle" :pagination="pagination" :loading="loading" :index-row="false" :displayField="title" @action-event="handleAction" @sort-change="handleSortChange" @pagination-change="handlePaginationChange">
+            <template slot="delegatorId">
+                <ibps-employee-selector :value="searchDelegatorId" style="width: 200px" @input="getDelegatorId" />
+            </template>
+        </ibps-crud>
+        <edit :id="editId" :title="title" :visible="dialogFormVisible" :readonly="readonly" @callback="search" @close="(visible) => (dialogFormVisible = visible)" />
+    </div>
 </template>
 
 <script>
@@ -45,210 +18,223 @@ import { statusOptions, agentTypeOptions } from './constants'
 import Edit from './edit'
 
 export default {
-  components: {
-    IbpsEmployeeSelector,
-    Edit
-  },
-  mixins: [FixHeight],
-  data() {
-    return {
-      dialogFormVisible: false, // 弹窗
-      editId: '', // 编辑dialog需要使用
-      readonly: false, // 是否只读
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
+    components: {
+        IbpsEmployeeSelector,
+        Edit
+    },
+    mixins: [FixHeight],
+    data() {
+        return {
+            dialogFormVisible: false, // 弹窗
+            editId: '', // 编辑dialog需要使用
+            readonly: false, // 是否只读
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
 
-      searchDelegatorId: '',
-      title: '事务代理业务',
-      loading: true,
-      height: document.clientHeight,
+            searchDelegatorId: '',
+            title: '事务代理记录列表',
+            loading: true,
+            height: document.clientHeight,
 
-      listData: [],
-      pagination: {},
-      sorts: {},
-      listConfig: {
-        toolbars: [
-          {
-            key: 'search'
-          },
-          {
-            key: 'add'
-          },
-          {
-            key: 'edit'
-          },
-          {
-            key: 'remove'
-          }
-        ],
-        searchForm: {
-          forms: [
-            { prop: 'Q^TITLE_^SL', label: '标题' },
-            {
-              prop: 'Q^DELEGATOR_ID_^S',
-              label: '委托人',
-              fieldType: 'slot',
-              slotName: 'delegatorId'
-            }, {
-              prop: 'Q^IS_ENABLED_^S',
-              label: '是否启用',
-              fieldType: 'select',
-              options: statusOptions
-            }, {
-              prop: 'Q^AGENT_TYPE_^S',
-              label: '代理类型',
-              fieldType: 'select',
-              options: agentTypeOptions
-            }
-          ]
-        },
-        // 表格字段配置
-        columns: [
-          { prop: 'title', label: '标题' },
-          { prop: 'delegatorName', label: '委托人' },
-          { prop: 'agenterName', label: '代理人' },
-          { prop: 'isEnabled', label: '是否启动', tags: statusOptions },
-          { prop: 'effectiveTime', label: '生效时间', sortable: 'custom' },
-          { prop: 'expiryTime', label: '失效时间', sortable: 'custom' },
-          { prop: 'agentType', label: '代理类型', tags: agentTypeOptions }
-        ],
-        rowHandle: {
-          actions: [{
-            key: 'edit'
-          }, {
-            key: 'enabled',
-            label: '启用',
-            icon: 'ibps-icon-toggle-on',
-            hidden: (rowData, index) => {
-              return rowData.isEnabled === 'enabled'
+            listData: [],
+            pagination: {},
+            sorts: {},
+            listConfig: {
+                toolbars: [
+                    {
+                        key: 'search'
+                    },
+                    {
+                        key: 'add'
+                    },
+                    {
+                        key: 'edit'
+                    },
+                    {
+                        key: 'remove'
+                    }
+                ],
+                searchForm: {
+                    forms: [
+                        // { prop: 'Q^TITLE_^SL', label: '标题' },
+                        {
+                            //agenterId
+                            // prop: 'Q^DELEGATOR_ID_^S',
+                            prop: 'Q^AGENTER_ID_^S',
+                            label: '代理人',
+                            fieldType: 'slot',
+                            slotName: 'delegatorId'
+                        },
+                        {
+                            prop: 'Q^IS_ENABLED_^S',
+                            label: '是否启用',
+                            fieldType: 'select',
+                            options: statusOptions
+                        },
+                        // {
+                        //     prop: 'Q^AGENT_TYPE_^S',
+                        //     label: '代理类型',
+                        //     fieldType: 'select',
+                        //     options: agentTypeOptions
+                        // }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'title', label: '标题' },
+                    { prop: 'delegatorName', label: '委托人' },
+                    { prop: 'agenterName', label: '代理人' },
+                    { prop: 'isEnabled', label: '是否启用', tags: statusOptions },
+                    { prop: 'effectiveTime', label: '生效时间', sortable: 'custom' },
+                    { prop: 'expiryTime', label: '失效时间', sortable: 'custom' },
+                    { prop: 'agentType', label: '代理类型', tags: agentTypeOptions }
+                ]
+                // rowHandle: {
+                //   actions: [{
+                //     key: 'edit'
+                //   }, {
+                //     key: 'enabled',
+                //     label: '启用',
+                //     icon: 'ibps-icon-toggle-on',
+                //     hidden: (rowData, index) => {
+                //       return rowData.isEnabled === 'enabled'
+                //     }
+                //   }, {
+                //     key: 'disabled',
+                //     label: '禁用',
+                //     icon: 'ibps-icon-toggle-off',
+                //     hidden: (rowData, index) => {
+                //       return rowData.isEnabled === 'disabled'
+                //     }
+                //   }, {
+                //     key: 'remove'
+                //   }, {
+                //     key: 'detail'
+                //   }]
+                // }
             }
-          }, {
-            key: 'disabled',
-            label: '禁用',
-            icon: 'ibps-icon-toggle-off',
-            hidden: (rowData, index) => {
-              return rowData.isEnabled === 'disabled'
-            }
-          }, {
-            key: 'remove'
-          }, {
-            key: 'detail'
-          }]
         }
-      }
-    }
-  },
-  created() {
-    this.loadData()
-  },
-  methods: {
-    getDelegatorId(value) {
-      this.searchDelegatorId = value
-    },
-    // 加载数据
-    loadData() {
-      this.loading = true
-      queryPageList(this.getSearcFormData()).then(response => {
-        ActionUtils.handleListData(this, response.data)
-        this.loading = false
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 获取格式化参数
-     */
-    getSearcFormData() {
-      const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-      params['Q^DELEGATOR_ID_^S'] = this.searchDelegatorId
-      return ActionUtils.formatParams(
-        params,
-        this.pagination,
-        this.sorts)
-    },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadData()
-    },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadData()
-    },
-    /**
-     * 查询
-     */
-    search() {
-      this.loadData()
-    },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        case 'add':// 添加
-          this.handleEdit()
-          this.title = '添加流程代理'
-          break
-        case 'edit':// 编辑
-          ActionUtils.selectedRecord(selection).then((id) => {
-            this.handleEdit(id)
-            this.title = '编辑流程代理'
-          }).catch(() => { })
-          break
-        case 'detail':// 明细
-          ActionUtils.selectedRecord(selection).then((id) => {
-            this.handleEdit(id, true)
-            this.title = '流程代理明细'
-          }).catch(() => { })
-          break
-        case 'remove':// 删除
-          ActionUtils.removeRecord(selection).then((ids) => {
-            this.handleRemove(ids)
-          }).catch(() => { })
-          break
-        case 'enabled':// 启用
-          this.handleSetEnable(data.id, 'enabled')
-          break
-        case 'disabled':// 禁用
-          this.handleSetEnable(data.id, 'disabled')
-          break
-        default:
-          break
-      }
-    },
-    /**
-     * 处理编辑。
-     */
-    handleEdit(id = '', readonly = false) {
-      this.editId = id
-      this.readonly = readonly
-      this.dialogFormVisible = true
     },
-    /**
-     * 处理删除
-     */
-    handleRemove(ids) {
-      remove({ ids: ids }).then(response => {
-        ActionUtils.removeSuccessMessage()
-        this.search()
-      }).catch(() => {})
+    created() {
+        this.loadData()
     },
-    handleSetEnable(id, status) {
-      const params = { 'id': id, 'isEnabled': status }
-      setEnable(params).then(response => {
-        ActionUtils.removeSuccessMessage(response.message)
-        this.search()
-      }).catch(() => {})
+    methods: {
+        getDelegatorId(value) {
+            this.searchDelegatorId = value
+        },
+        // 加载数据
+        loadData() {
+            this.loading = true
+            queryPageList(this.getSearcFormData())
+                .then((response) => {
+                    ActionUtils.handleListData(this, response.data)
+                    this.loading = false
+                })
+                .catch(() => {
+                    this.loading = false
+                })
+        },
+        /**
+         * 获取格式化参数
+         */
+        getSearcFormData() {
+            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            params['Q^DELEGATOR_ID_^S'] = this.searchDelegatorId
+            return ActionUtils.formatParams(params, this.pagination, this.sorts)
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange(page) {
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange(sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadData()
+        },
+        /**
+         * 查询
+         */
+        search() {
+            this.loadData()
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction(command, position, selection, data) {
+            switch (command) {
+                case 'search': // 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                case 'add': // 添加
+                    this.handleEdit()
+                    this.title = '事务代理设置'
+                    break
+                case 'edit': // 编辑
+                    ActionUtils.selectedRecord(selection)
+                        .then((id) => {
+                            this.handleEdit(id)
+                            this.title = '编辑流程代理'
+                        })
+                        .catch(() => {})
+                    break
+                case 'detail': // 明细
+                    ActionUtils.selectedRecord(selection)
+                        .then((id) => {
+                            this.handleEdit(id, true)
+                            this.title = '流程代理明细'
+                        })
+                        .catch(() => {})
+                    break
+                case 'remove': // 删除
+                    ActionUtils.removeRecord(selection)
+                        .then((ids) => {
+                            this.handleRemove(ids)
+                        })
+                        .catch(() => {})
+                    break
+                case 'enabled': // 启用
+                    this.handleSetEnable(data.id, 'enabled')
+                    break
+                case 'disabled': // 禁用
+                    this.handleSetEnable(data.id, 'disabled')
+                    break
+                default:
+                    break
+            }
+        },
+        /**
+         * 处理编辑。
+         */
+        handleEdit(id = '', readonly = false) {
+            this.editId = id
+            this.readonly = readonly
+            this.dialogFormVisible = true
+        },
+        /**
+         * 处理删除
+         */
+        handleRemove(ids) {
+            remove({ ids: ids })
+                .then((response) => {
+                    ActionUtils.removeSuccessMessage()
+                    this.search()
+                })
+                .catch(() => {})
+        },
+        handleSetEnable(id, status) {
+            const params = { id: id, isEnabled: status }
+            setEnable(params)
+                .then((response) => {
+                    ActionUtils.removeSuccessMessage(response.message)
+                    this.search()
+                })
+                .catch(() => {})
+        }
     }
-  }
 }
 </script>

+ 49 - 15
src/views/platform/bpmn/bpmTaskChange/list.vue

@@ -8,7 +8,6 @@
       :search-form="listConfig.searchForm"
       :pk-key="pkKey"
       :columns="listConfig.columns"
-      :row-handle="listConfig.rowHandle"
       :pagination="pagination"
       :loading="loading"
       :displayField="title"
@@ -18,6 +17,7 @@
       @sort-change="handleSortChange"
       @pagination-change="handlePaginationChange"
     />
+
     <edit
       :id="editId"
       :title="title"
@@ -42,6 +42,8 @@ import FixHeight from '@/mixins/height'
 import { typeOptions, statusOptions } from './constants'
 import Edit from '@/business/platform/bpmn/task-change/edit'
 import BpmnFormrender from '@/business/platform/bpmn/form/dialog'
+import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+import dayjs from 'dayjs'
 
 export default {
   components: {
@@ -57,7 +59,7 @@ export default {
       formrenderDialogFormVisible: false,
       instanceId: '',
 
-      title: '代理记录',
+      title: '事务代理记录列表',
       loading: true,
       height: document.clientHeight,
       readonly: false,
@@ -74,30 +76,36 @@ export default {
         ],
         searchForm: {
           forms: [
-            { prop: 'Q^TASK_SUBJECT_^SL', label: '事项标题' },
-            { prop: 'Q^TASK_NAME_^SL', label: '务名称' },
-            {
-              prop: 'Q^CHANGE_TYPE_^SL',
-              label: '更改类型',
-              fieldType: 'select',
-              options: typeOptions
-            },
+            // { prop: 'Q^TASK_SUBJECT_^SL', label: '事项标题' },
+            { prop: 'Q^TASK_NAME_^SL', label: '务名称' },
+            // {
+            //   prop: 'Q^CHANGE_TYPE_^SL',
+            //   label: '更改类型',
+            //   fieldType: 'select',
+            //   options: typeOptions
+            // },
             {
               prop: 'Q^STATUS_^SL',
               label: '状态',
               fieldType: 'select',
               options: statusOptions
             },
-            { prop: ['Q^CREATE_TIME_^DL', 'Q^CREATE_TIME_^DG'], label: '创建时间', fieldType: 'daterange' }
+            // { prop: ['Q^CREATE_TIME_^DL', 'Q^CREATE_TIME_^DG'], label: '创建时间', fieldType: 'daterange' }
           ]
         },
         // 表格字段配置
         columns: [
-          { prop: 'taskSubject', label: '事项标题', link: 'dialog' },
-          { prop: 'taskName', label: '任务名称', width: 250 },
-          { prop: 'changeType', label: '更改类型', tags: typeOptions, width: 150 },
+          { prop: 'taskSubject', label: '事务名称', link: 'dialog' },
+          { prop: 'taskSubjectName', label: '事务名称' },
+          { prop: 'executorName', label: '代理人', width: 120},
+          { prop: 'createTime', label: '事务创建时间', width: 150 },
+        //   { prop: 'taskName', label: '任务名称', width: 250 },
           { prop: 'status', label: '状态', tags: statusOptions, width: 150 },
-          { prop: 'createTime', label: '创建时间', width: 140 }
+          { 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 },
         ],
         rowHandle: {
           actions: [{
@@ -127,12 +135,38 @@ export default {
     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,(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
       })
     },
+    //反查代理数据
+    getDaiLi(val1,val2,callback){
+        let sql =   `select * from ibps_bpm_agent where DELEGATOR_ID_ = '${val1}' and AGENTER_ID_ = '${val2}' and IS_ENABLED_ = 'enabled'`
+        curdPost('sql',sql).then((res)=> {
+            if(res.state == 200){
+                let datas = res.variables.data
+                callback(datas)
+            }
+        })
+    },
     /**
      * 获取格式化参数
      */