Explorar o código

事务代理(角色)

linweizeng %!s(int64=2) %!d(string=hai) anos
pai
achega
17728e3369

+ 650 - 0
src/views/platform/bpmn/bpmAgent/agentByRole/edit.vue

@@ -0,0 +1,650 @@
+<template>
+    <el-dialog :title="title" :visible.sync="dialogVisible" :close-on-click-modal="false" :close-on-press-escape="false" append-to-body class="bpmn-agent-dialog" width="60%" top="10vh" @open="getFormData" @close="closeDialog">
+        <el-form ref="agentForm" v-loading="dialogLoading" class="bpmnForm" :element-loading-text="$t('common.loading')" :model="bpmAgent" :rules="rules" :label-width="formLabelWidth" @submit.native.prevent>
+            <el-row v-if="srcList.length > 0">
+                <el-col :span="24">
+                    <el-form-item label="选择代理人参考图片:">
+                        <div class="imageListClass">
+                            <div v-for="(item, index) in srcList" :key="index">
+                                <el-image :src="item" class="sinImageList" :preview-src-list="srcList" />
+                            </div>
+                        </div>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+
+            <el-row>
+                <el-col :span="24">
+                    <el-form-item label="标题:" prop="biao_ti_">
+                        <el-input v-if="!readonly" v-model="bpmAgent.biao_ti_" placeholder="请输入标题" />
+                        <span v-else>{{ bpmAgent.biao_ti_ }}</span>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+
+            <!-- <el-row>
+                <el-col :span="12">
+                    <el-form-item label="生效时间:" prop="sheng_xiao_shi_ji">
+                        <el-date-picker v-if="!readonly" v-model="bpmAgent.sheng_xiao_shi_ji" class="time" type="date" value-format="yyyy-MM-dd" placeholder="请选择生效时间" :picker-options="options" />
+                        <span v-else>{{ bpmAgent.sheng_xiao_shi_ji }}</span>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="失效时间:" prop="jie_shu_shi_jian_">
+                        <el-date-picker v-if="!readonly" v-model="bpmAgent.jie_shu_shi_jian_" class="time" type="date" value-format="yyyy-MM-dd" placeholder="请选择失效时间" :picker-options="options" />
+                        <span v-else>{{ bpmAgent.jie_shu_shi_jian_ }}</span>
+                    </el-form-item>
+                </el-col>
+            </el-row> -->
+            <el-row>
+                <el-col :span="12" col>
+                    <el-form-item label="是否启用:" prop="shi_fou_qi_yong_">
+                        <el-switch v-if="!readonly" v-model="bpmAgent.shi_fou_qi_yong_" active-value="enabled" inactive-value="disabled" />
+                        <el-tag v-else :type="bpmAgent.shi_fou_qi_yong_ | optionsFilter(statusOptions, 'type')">{{ bpmAgent.shi_fou_qi_yong_ | optionsFilter(statusOptions, 'label') }}</el-tag>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-row>
+                <el-col :span="12">
+                    <el-form-item label="委托人:" prop="wei_tuo_ren_">
+                        <ibps-user-selector
+                            v-if="!formId"
+                            v-model="bpmAgent.wei_tuo_ren_"
+                            :type="type"
+                            :filter="filter"
+                            :multiple="multiple"
+                            :filtrate="filtrate"
+                            :store="store"
+                            :disabled="disabled"
+                            :readonly-text="readonlyText"
+                            placeholder="请选择委托人"
+                            @change-link-data="callbackDelegatorrInfo"
+                        />
+                        <span v-else>{{ bpmAgent.wei_tuo_ren_xing_ }}</span>
+                    </el-form-item>
+                </el-col>
+                <el-col :span="12">
+                    <el-form-item label="代理人:" prop="dai_li_ren_">
+                        <ibps-user-selector
+                            v-if="!formId"
+                            v-model="bpmAgent.dai_li_ren_"
+                            :type="type"
+                            :filter="filter"
+                            :multiple="multiple"
+                            :filtrate="filtrate"
+                            :store="store"
+                            :disabled="disabled"
+                            :readonly-text="readonlyText"
+                            placeholder="请选择代理人"
+                            @change-link-data="callbackAgenterInfo"
+                        />
+                        <span v-else>{{ bpmAgent.dai_li_ren_xing_m }}</span>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+
+
+
+            <el-row>
+                <el-form-item label="权限分配:">
+                    <el-col :span="12">
+                        <div class="transferPanel">
+                            <div class="header">
+                                <span>委托人</span>
+                            </div>
+                            <div class="transferBody">
+                                <el-checkbox-group v-model="checkList1" class="radioBox">
+                                    <el-checkbox v-for="item in weiTuoroleList" :key="item.id" :label="item.id" :disabled="readonly" class="ridioSin">{{ item.name }}</el-checkbox>
+                                </el-checkbox-group>
+                            </div>
+                        </div>
+                    </el-col>
+                    <el-col :span="12">
+                        <div class="transferPanel">
+                            <div class="header">
+                                <span>代理人</span>
+                            </div>
+                            <div class="transferBody">
+                                <el-checkbox-group v-model="checkList2" class="radioBox">
+                                    <el-checkbox v-for="item in daiLiroleList" :key="item.id" :label="item.id" class="ridioSin" :disabled="item.disabled">{{ item.name }}</el-checkbox>
+                                </el-checkbox-group>
+                            </div>
+                        </div>
+                    </el-col>
+                </el-form-item>
+            </el-row>
+        </el-form>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
+        </div>
+    </el-dialog>
+</template>
+
+<script>
+import { save, get } from '@/api/platform/bpmn/bpmAgent'
+import { agentTypeOptions, statusOptions } from '../constants'
+import ActionUtils from '@/utils/action'
+import IbpsEmployeeSelector from '@/business/platform/org/employee/selector'
+import BpmDefinitionSelector from '@/business/platform/bpmn/definition/selector'
+import ibpsUserSelector from '@/business/platform/org/selector'
+import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+import Condition from '../condition'
+import { create, update, load, upEmployee } from '@/api/platform/org/employee'
+
+export default {
+    components: {
+        IbpsEmployeeSelector,
+        BpmDefinitionSelector,
+        Condition,
+        ibpsUserSelector
+    },
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
+        },
+        readonly: {
+            type: Boolean,
+            default: false
+        },
+        id: String,
+        title: String
+    },
+    data () {
+        const { first = '', second = '' } = this.$store.getters.level
+        const level = second || first
+        return {
+            level,
+            formName: 'agentForm',
+            formLabelWidth: '100px',
+            dialogVisible: this.visible,
+            conditionDialogVisible: false, // 条件规则界面
+            dialogLoading: false,
+            rowLoading: false,
+            statusOptions: statusOptions,
+            agentTypeOptions: agentTypeOptions,
+            defaultForm: {},
+            multipleSelection: [],
+            conditionSelection: [],
+            bpmAgent: {
+                biao_ti_: '',
+                wei_tuo_ren_: this.$store.getters.userId,
+                dai_li_ren_: '',
+                wei_tuo_ren_xing_: this.$store.getters.name,
+                dai_li_ren_xing_m: '',
+                shi_fou_qi_yong_: 'enabled',
+                sheng_xiao_shi_ji: '',
+                jie_shu_shi_jian_: '',
+                wei_tuo_jiao_se_i: '',
+                wei_tuo_jiao_se_m: '',
+                wei_tuo_yuan_shi_: '',
+                dai_li_yuan_shi_s: '',
+                bei_zhu_: '',
+                di_dian_: level
+            },
+            rules: {
+                biao_ti_: [
+                    { required: true, message: this.$t('validate.required') },
+                    { min: 1, max: 64, message: '长度不能超过64个字符', trigger: 'blur' }
+                ],
+                wei_tuo_ren_: [{ required: true, message: this.$t('validate.required') }],
+                dai_li_ren_: [{ required: true, message: this.$t('validate.required') }],
+                sheng_xiao_shi_ji: [{ required: true, message: this.$t('validate.required') }],
+                jie_shu_shi_jian_: [{ required: true, message: this.$t('validate.required') }]
+            },
+            toolbars: [
+                {
+                    key: 'save',
+                    hidden: () => {
+                        return this.readonly
+                    }
+                },
+                { key: 'cancel' }
+            ],
+            url: '',
+            srcList: [],
+
+            // 委托人和代理人 选择器修改通用选择器,需要这些参数
+            type: 'user',
+            filter: [
+                {
+                    descVal: '2',
+                    includeSub: true,
+                    old: 'position',
+                    partyId: '',
+                    partyName: '',
+                    scriptContent: '',
+                    type: 'user',
+                    userType: 'position'
+                }
+            ],
+            multiple: false,
+            filtrate: true,
+            store: 'id',
+            disabled: false,
+            readonlyText: 'null',
+
+            transferValue: [],
+            transferData: [],
+            checkList1: [],
+            checkList2: [],
+            weiTuoroleListYuan: [],
+            daiLiroleListYuan: [],
+            weiTuoroleList: [],
+            daiLiroleList: [],
+            dailiRenXinxin: null,
+            options: {
+                // 时间不能大于当前时间
+                disabledDate: time => {
+                    return time.getTime() < Date.now()
+                }
+            }
+        }
+    },
+    computed: {
+        formId () {
+            return this.id
+        }
+    },
+    watch: {
+        visible: {
+            handler: function (val, oldVal) {
+                this.dialogVisible = this.visible
+            },
+            immediate: true
+        },
+        'bpmAgent.wei_tuo_ren_': {
+            handler: function (val, oldVal) {
+                this.getWeiTuo(this.bpmAgent.wei_tuo_ren_, 1)
+            },
+            immediate: true
+        },
+        'bpmAgent.dai_li_ren_': {
+            handler: function (val, oldVal) {
+                this.getWeiTuo(this.bpmAgent.dai_li_ren_, 2)
+            },
+            immediate: true
+        }
+    },
+    created () {
+        this.defaultForm = JSON.parse(JSON.stringify(this.bpmAgent))
+        this.getImage()
+        this.getInit()
+    },
+    mounted () {
+        this.$nextTick(() => {
+            if (this.$refs.multipleTable) {
+                this.$refs.multipleTable.doLayout()
+            }
+        })
+    },
+    methods: {
+        // 初始化
+        getInit () {
+            this.filter[0].partyId = this.$store.getters.userInfo.employee.positions || ''
+        },
+        handleEdit () {
+            this.rowLoading = true
+            setTimeout(() => {
+                this.rowLoading = false
+                // TODO:
+            })
+        },
+        handleRemove () {
+            this.rowLoading = true
+            setTimeout(() => {
+                this.rowLoading = false
+                // TODO:
+            })
+        },
+        handleSelectionChange (val) {
+            this.multipleSelection = val
+        },
+        handleConditionChange (val) {
+            this.conditionSelection = val
+        },
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'save':
+                    this.handleSave()
+                    break
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        // 保存数据
+        handleSave () {
+            this.$refs[this.formName].validate((valid) => {
+                if (valid) {
+                    this.saveData()
+                } else {
+                    ActionUtils.saveErrorMessage()
+                }
+            })
+        },
+        // 提交保存数据
+        saveData () {
+            const list1 = []
+            const listId = []
+            const list3 = []
+            const listName = []
+            this.checkList1.forEach(item => {
+                const itemData = this.weiTuoroleList.find(it => it.id === item)
+                if (itemData) {
+                    list1.push(itemData)
+                }
+            })
+            list1.forEach(item => {
+                const itemData = this.daiLiroleList.find(it => it.id === item.id)
+                if (!itemData) {
+                    listId.push(item.id)
+                    list3.push(item)
+                    listName.push(item.name)
+                }
+            })
+            this.weiTuoroleListYuan = list3
+
+            this.bpmAgent.wei_tuo_jiao_se_i = listId.join(',')
+            this.bpmAgent.wei_tuo_jiao_se_m = listName.join(',')
+            this.bpmAgent.dai_li_yuan_shi_s = JSON.stringify(this.daiLiroleListYuan)
+            this.bpmAgent.wei_tuo_yuan_shi_ = JSON.stringify(this.weiTuoroleListYuan)
+            if (!this.formId) {
+                this.addShiWuDaiLi()
+            } else {
+                this.updateShiWuDaiLi()
+            }
+        },
+        addShiWuDaiLi () {
+            const list = []
+            list.push(this.bpmAgent)
+            const params1 = {
+                tableName: 't_swdl',
+                paramWhere: JSON.stringify(list)
+            }
+            this.$common.request('add', params1).then(res => {
+                if (this.bpmAgent.shi_fou_qi_yong_ === 'enabled') {
+                    this.getUpdate()
+                }
+                this.closeDialog()
+            })
+        },
+        updateShiWuDaiLi () {
+            const list = []
+            const obj = {
+                where: {
+                    id_: this.formId
+                },
+                param: this.bpmAgent
+            }
+            delete this.bpmAgent.create_by_
+            delete this.bpmAgent.create_time_
+            list.push(obj)
+
+            const params1 = {
+                tableName: 't_swdl',
+                updList: list
+            }
+            this.$common.request('update', params1
+            ).then(response => {
+                this.getUpdate()
+                this.closeDialog()
+            })
+        },
+        getUpdate () {
+            const attrValueVoList = []
+            const partyAttrs = this.dailiRenXinxin.variables.partyAttrs
+            partyAttrs.forEach(item => {
+                if (item.values.length > 0) {
+                    const obj = {
+                        attrId: item.values[0].attrID
+                    }
+                    attrValueVoList.push(obj)
+                }
+            })
+
+            // 部门数据组装
+            const partyPositionsList = []
+            const partyPositions = this.dailiRenXinxin.variables.partyPositions
+            partyPositions.forEach(item => {
+                const obj = {
+                    id: item.id,
+                    name: item.name,
+                    isPrincipal: item.isPrincipal === 'Y',
+                    isMainPost: item.isMainPost === 'Y'
+                }
+                partyPositionsList.push(obj)
+            })
+
+            const roleVoList = []
+            this.daiLiroleListYuan.forEach(item => {
+                const obj = {
+                    id: item.id,
+                    name: item.name,
+                    subSystemName: item.subSystemName,
+                    source: item.source,
+                    canDelete: item.source === '自有'
+                }
+                roleVoList.push(obj)
+            })
+            if (this.bpmAgent.shi_fou_qi_yong_ === 'enabled') {
+                this.weiTuoroleListYuan.forEach(item => {
+                    const obj = {
+                        id: item.id,
+                        name: item.name,
+                        subSystemName: item.subSystemName,
+                        source: item.source,
+                        canDelete: item.source === '自有'
+                    }
+                    roleVoList.push(obj)
+                })
+            }
+
+            if (roleVoList.length > 0) {
+                const list = []
+                roleVoList.forEach(item => {
+                    list.push(item.id)
+                })
+                this.dailiRenXinxin.data.job = list.join(',')
+            }
+            console.log(this.dailiRenXinxin)
+            const params = {
+                attrValueVoList: attrValueVoList,
+                partyEmployeePo: this.dailiRenXinxin.data,
+                positionVoList: partyPositionsList,
+                roleVoList: roleVoList,
+                user: this.dailiRenXinxin.data,
+                userGroupPoList: []
+            }
+
+            console.log(params)
+            update(params).then(response => {
+
+            }).catch(() => {
+                this.dialogLoading = false
+            })
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            this.$emit('close', false)
+            this.$refs[this.formName].resetFields()
+        },
+        /**
+         * 表单验证
+         */
+        formValidate () {
+            if (this.readonly) return
+            this.$nextTick(() => {
+                this.$refs[this.formName].validate(() => {})
+            })
+        },
+        /**
+         * 获取表单数据
+         */
+        getFormData () {
+            console.log(this.id)
+            if (this.$utils.isEmpty(this.formId)) {
+                // 重置表单
+                this.bpmAgent = JSON.parse(JSON.stringify(this.defaultForm))
+                this.formValidate()
+                return
+            }
+            this.dialogLoading = true
+
+            const sql1 = `select * from t_swdl where id_ = '${this.formId}'`
+            this.$common.request('sql', sql1).then(res => {
+                const data = res.variables.data[0]
+                this.bpmAgent = data
+                this.checkList1 = data.wei_tuo_jiao_se_i.split(',')
+                this.dialogLoading = false
+            })
+        },
+        addDef () {
+            alert('打开流程选择器')
+        },
+        callbackDelegatorrInfo (value, data, type) {
+            this.bpmAgent.wei_tuo_ren_xing_ = data.name
+        },
+        callbackAgenterInfo (value, data, type) {
+            this.bpmAgent.dai_li_ren_xing_m = data.name
+        },
+        getWeiTuo (id, type = 1) {
+            if (!id) return
+            load({ employeeId: id })
+                .then((response) => {
+                    const data = response
+                    const partyRole = response.variables.partyRoles
+                    if (type === 1) {
+                        this.weiTuoroleListYuan = JSON.parse(JSON.stringify(partyRole))
+                        this.weiTuoroleList = partyRole || []
+                    }
+                    if (type === 2) {
+                        this.dailiRenXinxin = data
+                        // 新增选择代理人数据
+                        if (!this.formId) {
+                            this.daiLiroleListYuan = JSON.parse(JSON.stringify(partyRole))
+                        } else {
+                            // 修改选择代理人选择
+                            const parRoleList = []
+                            // 复原代理人 原来的角色
+                            partyRole.forEach(item => {
+                                const dataIndex = this.checkList1.findIndex(it => it === item.id)
+                                if (dataIndex < 0) {
+                                    parRoleList.push(item)
+                                }
+                            })
+                            this.daiLiroleListYuan = JSON.parse(JSON.stringify(parRoleList))
+                        }
+                        partyRole.forEach(item => {
+                            item.disabled = true
+                        })
+                        this.daiLiroleList = partyRole || []
+                    }
+                })
+                .catch(() => {
+                })
+        },
+
+        getImage () {
+            const sql = `select * from t_dlpz order by create_time_ desc LIMIT 1`
+            curdPost('sql', sql).then((res) => {
+                if (res.state === 200) {
+                    const datas = res.variables.data
+                    if (datas.length > 0) {
+                        const image = JSON.parse(datas[0].tu_pian_)
+                        const idList = image.map((item) => {
+                            return item.id
+                        })
+                        const ids = idList.join(',')
+                        this.getUrl(ids)
+                    }
+                }
+            })
+        },
+        getUrl (id) {
+            const sql1 = `select nei_rong_ from t_ipcc where id_ = '1'`
+            const sql2 = `select * from ibps_file_attachment where find_in_set(ID_,'${id}')`
+            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(([res1, res2]) => {
+                if (res1.state === 200 && res2.state === 200) {
+                    const datas1 = res1.variables.data
+                    const datas2 = res2.variables.data
+                    const ip = datas1[0].nei_rong_
+                    const imageList = datas2.map((item) => {
+                        return ip + '/' + item.FILE_PATH_
+                    })
+                    this.srcList = imageList
+                }
+            })
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.bpmn-agent-dialog {
+    ::v-deep .el-dialog__body {
+        height: calc(70vh - 110px) !important;
+    }
+    .dialog-right {
+        float: right;
+        div {
+            display: inline-block;
+        }
+    }
+}
+.imageListClass {
+    display: flex;
+    flex-wrap: wrap;
+}
+.bpmnForm {
+    padding: 20px;
+}
+.time {
+    width: 100%;
+}
+.sinImageList {
+    width: 150px;
+    height: 150px;
+    margin: 10px;
+}
+
+.transferPanel {
+    border: 1px solid #ebeef5;
+    border-radius: 4px;
+    overflow: hidden;
+    background: #fff;
+    display: inline-block;
+    vertical-align: middle;
+    width: 200px;
+    max-height: 100%;
+    -webkit-box-sizing: border-box;
+    box-sizing: border-box;
+    position: relative;
+
+    .header {
+        height: 40px;
+        line-height: 40px;
+        background: #f5f7fa;
+        margin: 0;
+        padding-left: 15px;
+        border-bottom: 1px solid #ebeef5;
+        -webkit-box-sizing: border-box;
+        box-sizing: border-box;
+        color: #000;
+    }
+
+    .transferBody {
+        height: 246px;
+    }
+}
+.radioBox {
+    display: flex;
+    flex-direction: column;
+
+    .ridioSin {
+        padding: 0 10px;
+    }
+}
+</style>

+ 332 - 0
src/views/platform/bpmn/bpmAgent/agentByRole/list.vue

@@ -0,0 +1,332 @@
+<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"
+            :display-field="listTitle"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        >
+            <template slot="delegatorId">
+                <!-- <ibps-employee-selector :value="searchDelegatorId" style="width: 200px" @input="getDelegatorId" /> -->
+                <ibps-user-selector
+                    v-model="searchDelegatorId"
+                    :type="type"
+                    :filter="filter"
+                    :multiple="multiple"
+                    :filtrate="filtrate"
+                    :store="store"
+                    :disabled="disabled"
+                    :readonly-text="readonlyText"
+                    placeholder="请选择代理人"
+                    @change-link-data="callbackAgenterInfo"
+                />
+            </template>
+        </ibps-crud>
+        <edit :id="editId" :title="title" :visible="dialogFormVisible" :readonly="readonly" @callback="search" @close="closeDialog" />
+    </div>
+</template>
+
+<script>
+import IbpsEmployeeSelector from '@/business/platform/org/employee/selector'
+import { queryPageList, remove, setEnable } from '@/api/platform/bpmn/bpmAgent'
+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'
+
+export default {
+    components: {
+        IbpsEmployeeSelector,
+        Edit,
+        ibpsUserSelector
+    },
+    mixins: [FixHeight],
+    data () {
+        const { first = '', second = '' } = this.$store.getters.level
+        const level = second || first
+        return {
+            level,
+            dialogFormVisible: false, // 弹窗
+            editId: '', // 编辑dialog需要使用
+            readonly: false, // 是否只读
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+
+            searchDelegatorId: '',
+            listTitle: '事务代理',
+            title: '',
+            loading: false,
+            height: document.clientHeight,
+
+            listData: [],
+            pagination: {
+                limit: 10,
+                page: 1,
+                totalCount: 0,
+                totalPages: 0
+            },
+            sorts: {},
+            listConfig: {
+                toolbars: [
+                    {
+                        key: 'search'
+                    },
+                    {
+                        key: 'add'
+                    },
+                    {
+                        key: 'remove'
+                    }
+                ],
+                searchForm: {
+                    forms: [
+                        {
+                            prop: 'dai_li_ren_xing_m',
+                            label: '代理人'
+                        },
+                        {
+                            prop: 'shi_fou_qi_yong_',
+                            label: '是否启用',
+                            fieldType: 'select',
+                            options: statusOptions
+                        }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'biao_ti_', label: '标题', width: 250 },
+                    { prop: 'wei_tuo_ren_xing_', label: '委托人', width: 120 },
+                    { prop: 'dai_li_ren_xing_m', label: '代理人', width: 120 },
+                    { prop: 'shi_fou_qi_yong_', label: '是否启用', tags: statusOptions }
+                    // { prop: 'sheng_xiao_shi_ji', label: '生效时间' },
+                    // { prop: 'jie_shu_shi_jian_', label: '失效时间' }
+                ],
+                rowHandle: {
+                    actions: [{
+                        key: 'edit'
+                    },
+                    {
+                        key: 'enabled',
+                        label: '启用',
+                        icon: 'ibps-icon-toggle-on',
+                        hidden: (rowData, index) => {
+                            return rowData.shi_fou_qi_yong_ === 'enabled'
+                        }
+                    }, {
+                        key: 'disabled',
+                        label: '禁用',
+                        icon: 'ibps-icon-toggle-off',
+                        hidden: (rowData, index) => {
+                            return rowData.shi_fou_qi_yong_ === 'disabled'
+                        }
+                    },
+                    {
+                        key: 'detail'
+                    }]
+                }
+            },
+            // 委托人和代理人 选择器修改通用选择器,需要这些参数
+            type: 'user',
+            filter: [{
+                descVal: '2',
+                includeSub: true,
+                old: 'position',
+                partyId: '',
+                partyName: '',
+                scriptContent: '',
+                type: 'user',
+                userType: 'position'
+            }],
+            multiple: false,
+            filtrate: true,
+            store: 'id',
+            disabled: false,
+            readonlyText: 'null'
+        }
+    },
+    created () {
+        this.getInit()
+        this.loadData()
+    },
+    methods: {
+        // 初始化
+        getInit () {
+            this.filter[0].partyId = this.$store.getters.userInfo.employee.positions || ''
+        },
+        getDelegatorId (value) {
+            this.searchDelegatorId = value
+        },
+        callbackAgenterInfo (value, data, type) {
+            this.searchDelegatorId = value
+        },
+        // 加载数据
+        loadData () {
+            this.loading = true
+            console.log(this.pagination)
+            const start = (this.pagination.page - 1) * this.pagination.limit
+            const end = this.pagination.page * this.pagination.limit
+            const searcFormData = this.getSearcFormData()
+            const sql1 = `select * from t_swdl where di_dian_ = '${this.level}' ${searcFormData} order by create_time_ desc limit ${start},${end}`
+            const sql2 = `select count(id_) as count from t_swdl where 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
+            })
+        },
+        /**
+         * 获取格式化参数
+         */
+        getSearcFormData () {
+            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+            let keyParams = ``
+            if (params) {
+                Object.keys(params).forEach(item => {
+                    if (params[item]) {
+                        keyParams = `and ${item} like '%${params[item]}%'`
+                    }
+                })
+            }
+            return keyParams
+            // 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) {
+            console.log(selection)
+            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) => {
+                            console.log(selection, 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(() => {})
+            const params = {
+                tableName: 't_swdl',
+                paramWhere: {
+                    id_: ids
+                }
+            }
+            this.$common.request('delete', params).then(res => {
+                ActionUtils.removeSuccessMessage()
+                this.search()
+            })
+        },
+        handleSetEnable (id, status) {
+            const params = { id: id, isEnabled: status }
+            setEnable(params)
+                .then((response) => {
+                    ActionUtils.removeSuccessMessage(response.message)
+                    this.search()
+                })
+                .catch(() => {})
+        },
+        closeDialog (val) {
+            this.dialogFormVisible = val
+            this.loadData()
+        }
+    }
+}
+</script>