Kaynağa Gözat

代理 列表 ,表单修改

linweizeng 2 yıl önce
ebeveyn
işleme
a7de4494ff

+ 15 - 8
src/views/platform/bpmn/bpmAgent/edit.vue

@@ -1,15 +1,22 @@
 <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>
-            <div v-if="srcList.length > 0" class="imageListClass">
-                <div v-for="(item,index) in srcList" :key="index">
-                    <el-image :src="item" class="sinImageList" :preview-src-list="srcList" />
-                </div>
-            </div>
+            <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="title">
-                        <el-input v-if="!readonly" v-model="bpmAgent.title" placeholder="请输入标题"/>
+                        <el-input v-if="!readonly" v-model="bpmAgent.title" placeholder="请输入标题" />
                         <span v-else>{{ bpmAgent.title }}</span>
                     </el-form-item>
                 </el-col>
@@ -18,13 +25,13 @@
             <el-row>
                 <el-col :span="12">
                     <el-form-item label="生效时间:" prop="effectiveTime">
-                        <el-date-picker v-if="!readonly" v-model="bpmAgent.effectiveTime" class="time" type="date" value-format="yyyy-MM-dd" placeholder="请选择生效时间"/>
+                        <el-date-picker v-if="!readonly" v-model="bpmAgent.effectiveTime" class="time" type="date" value-format="yyyy-MM-dd" placeholder="请选择生效时间" />
                         <span v-else>{{ bpmAgent.effectiveTime }}</span>
                     </el-form-item>
                 </el-col>
                 <el-col :span="12">
                     <el-form-item label="失效时间:" prop="expiryTime">
-                        <el-date-picker v-if="!readonly" v-model="bpmAgent.expiryTime" class="time" type="date" value-format="yyyy-MM-dd" placeholder="请选择失效时间"/>
+                        <el-date-picker v-if="!readonly" v-model="bpmAgent.expiryTime" class="time" type="date" value-format="yyyy-MM-dd" placeholder="请选择失效时间" />
                         <span v-else>{{ bpmAgent.expiryTime }}</span>
                     </el-form-item>
                 </el-col>

+ 69 - 20
src/views/platform/bpmn/bpmAgent/list.vue

@@ -1,8 +1,36 @@
 <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">
+        <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="title"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        >
             <template slot="delegatorId">
-                <ibps-employee-selector :value="searchDelegatorId" style="width: 200px" @input="getDelegatorId" />
+                <!-- <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="(visible) => (dialogFormVisible = visible)" />
@@ -12,6 +40,7 @@
 <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'
@@ -20,10 +49,11 @@ import Edit from './edit'
 export default {
     components: {
         IbpsEmployeeSelector,
-        Edit
+        Edit,
+        ibpsUserSelector
     },
     mixins: [FixHeight],
-    data() {
+    data () {
         return {
             dialogFormVisible: false, // 弹窗
             editId: '', // 编辑dialog需要使用
@@ -57,8 +87,6 @@ export default {
                     forms: [
                         // { prop: 'Q^TITLE_^SL', label: '标题' },
                         {
-                            //agenterId
-                            // prop: 'Q^DELEGATOR_ID_^S',
                             prop: 'Q^AGENTER_ID_^S',
                             label: '代理人',
                             fieldType: 'slot',
@@ -69,7 +97,7 @@ export default {
                             label: '是否启用',
                             fieldType: 'select',
                             options: statusOptions
-                        },
+                        }
                         // {
                         //     prop: 'Q^AGENT_TYPE_^S',
                         //     label: '代理类型',
@@ -111,18 +139,39 @@ export default {
                 //     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() {
+    created () {
         this.loadData()
     },
     methods: {
-        getDelegatorId(value) {
+        getDelegatorId (value) {
+            this.searchDelegatorId = value
+        },
+        callbackAgenterInfo (value, data, type) {
+            console.log(value)
             this.searchDelegatorId = value
         },
         // 加载数据
-        loadData() {
+        loadData () {
             this.loading = true
             queryPageList(this.getSearcFormData())
                 .then((response) => {
@@ -136,35 +185,35 @@ export default {
         /**
          * 获取格式化参数
          */
-        getSearcFormData() {
+        getSearcFormData () {
             const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
-            params['Q^DELEGATOR_ID_^S'] = this.searchDelegatorId
+            params['Q^AGENTER_ID_^S'] = this.searchDelegatorId
             return ActionUtils.formatParams(params, 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)
@@ -210,7 +259,7 @@ export default {
         /**
          * 处理编辑。
          */
-        handleEdit(id = '', readonly = false) {
+        handleEdit (id = '', readonly = false) {
             this.editId = id
             this.readonly = readonly
             this.dialogFormVisible = true
@@ -218,7 +267,7 @@ export default {
         /**
          * 处理删除
          */
-        handleRemove(ids) {
+        handleRemove (ids) {
             remove({ ids: ids })
                 .then((response) => {
                     ActionUtils.removeSuccessMessage()
@@ -226,7 +275,7 @@ export default {
                 })
                 .catch(() => {})
         },
-        handleSetEnable(id, status) {
+        handleSetEnable (id, status) {
             const params = { id: id, isEnabled: status }
             setEnable(params)
                 .then((response) => {