Browse Source

考试高级筛选时间的添加

lidie 2 years ago
parent
commit
e2c341c77e

+ 600 - 600
src/business/platform/bpmn/form/index.vue

@@ -1,152 +1,152 @@
 <template>
-  <div class="ibps-fixed-top">
-    <template v-if="formModel.type === 'INNER'">
-      <!---在线表单--->
-      <formrender
-        v-if="formDef"
-        ref="formrender"
-        :form-def="formDef"
-        :buttons="buttons"
-        :data="formData"
-        :params="formParams"
-        :readonly="readonly"
-        @action-event="(actionKey,args)=>emitEventHandler(actionKey,args)"
-        @callback="callbackPage"
-        @close="closeDialog"
-      />
-    </template>
-    <!---内嵌url表单,外部url表单---->
-    <template
-      v-else-if="formModel.type === 'URL_LOAD'|| formModel.type === 'FRAME'"
-    >
-      <form-toolbar
-        v-if="formModel.type === 'URL_LOAD'"
-        :buttons="buttons"
-        :validate-form="validateForm"
-        :on-load-actions="onLoadActions"
-        :before-script="beforeScript"
-        :after-script="afterScript"
-        @action-event="(actionKey,args)=>emitButtonEventHandler(actionKey,args)"
-        @callback="callbackPage"
-        @close="closeDialog"
-      />
+    <div class="ibps-fixed-top">
+        <template v-if="formModel.type === 'INNER'">
+            <!---在线表单--->
+            <formrender
+                v-if="formDef"
+                ref="formrender"
+                :form-def="formDef"
+                :buttons="buttons"
+                :data="formData"
+                :params="formParams"
+                :readonly="readonly"
+                @action-event="(actionKey,args)=>emitEventHandler(actionKey,args)"
+                @callback="callbackPage"
+                @close="closeDialog"
+            />
+        </template>
+        <!---内嵌url表单,外部url表单---->
+        <template
+            v-else-if="formModel.type === 'URL_LOAD'|| formModel.type === 'FRAME'"
+        >
+            <form-toolbar
+                v-if="formModel.type === 'URL_LOAD'"
+                :buttons="buttons"
+                :validate-form="validateForm"
+                :on-load-actions="onLoadActions"
+                :before-script="beforeScript"
+                :after-script="afterScript"
+                @action-event="(actionKey,args)=>emitButtonEventHandler(actionKey,args)"
+                @callback="callbackPage"
+                @close="closeDialog"
+            />
 
-      <!--url表单 iframe方式-->
-      <iframe
-        v-if="formUrlType === 'iframe'"
-        ref="formrender"
-        :class="formModel.type === 'URL_LOAD'?'ibps-container-url-frame':'ibps-container-frame'"
-        frameborder="0"
-      />
-      <!--url表单 vue组件方式-->
-      <template v-else>
-        <component
-          :is="formUrlName"
-          v-if="!loading"
-          ref="formrender"
-          :params="formParams"
-          :readonly="readonly"
-          @action-event="(actionKey,args)=>emitButtonEventHandler(actionKey,args)"
-          @callback="callbackPage"
-          @close="closeDialog"
-        />
-      </template>
-    </template>
+            <!--url表单 iframe方式-->
+            <iframe
+                v-if="formUrlType === 'iframe'"
+                ref="formrender"
+                :class="formModel.type === 'URL_LOAD'?'ibps-container-url-frame':'ibps-container-frame'"
+                frameborder="0"
+            />
+            <!--url表单 vue组件方式-->
+            <template v-else>
+                <component
+                    :is="formUrlName"
+                    v-if="!loading"
+                    ref="formrender"
+                    :params="formParams"
+                    :readonly="readonly"
+                    @action-event="(actionKey,args)=>emitButtonEventHandler(actionKey,args)"
+                    @callback="callbackPage"
+                    @close="closeDialog"
+                />
+            </template>
+        </template>
 
-    <!--流程图-->
-    <flow-diagram-dialog
-      :visible="flowDiagramVisible"
-      :def-id="defId"
-      :task-id="taskId"
-      :inst-id="instId"
-      @close="visible => flowDiagramVisible= visible"
-    />
-    <!--流程历史-->
-    <approval-history-dialog
-      :visible="approvalHistoryVisible"
-      :task-id="taskId"
-      :inst-id="instId"
-      @close="visible => approvalHistoryVisible= visible"
-    />
-    <!--流程实例-->
-    <!-- <instance-detail
+        <!--流程图-->
+        <flow-diagram-dialog
+            :visible="flowDiagramVisible"
+            :def-id="defId"
+            :task-id="taskId"
+            :inst-id="instId"
+            @close="visible => flowDiagramVisible= visible"
+        />
+        <!--流程历史-->
+        <approval-history-dialog
+            :visible="approvalHistoryVisible"
+            :task-id="taskId"
+            :inst-id="instId"
+            @close="visible => approvalHistoryVisible= visible"
+        />
+        <!--流程实例-->
+        <!-- <instance-detail
       :visible="instanceDetailVisible"
       :bpmn-inst-id="instId"
       @close="visible => instanceDetailVisible= visible"
     /> -->
 
-    <!--启动流程-->
-    <start-flow-dialog
-      :visible="startFlowDialogVisible"
-      :def-id="defId"
-      :data="submitFormData"
-      :title="actionTitle"
-      @close="visible => startFlowDialogVisible= visible"
-      @action-event="saveStartFlow"
-    />
+        <!--启动流程-->
+        <start-flow-dialog
+            :visible="startFlowDialogVisible"
+            :def-id="defId"
+            :data="submitFormData"
+            :title="actionTitle"
+            @close="visible => startFlowDialogVisible= visible"
+            @action-event="saveStartFlow"
+        />
 
-    <!--同意-->
-    <agree-dialog
-      :visible="agreeDialogVisible"
-      :action="actionName"
-      :title="actionTitle"
-      :task-id="taskId"
-      :version="version"
-      :is-common="attributes.isCommonJumpType"
-      :hide-opinion="isBpmOpinionHide"
-      :hide-path="attributes.isHidePath"
-      :form-opinion="submitFormOpinion"
-      @close="visible => agreeDialogVisible= visible"
-      @action-event="handleActionEvent"
-    />
+        <!--同意-->
+        <agree-dialog
+            :visible="agreeDialogVisible"
+            :action="actionName"
+            :title="actionTitle"
+            :task-id="taskId"
+            :version="version"
+            :is-common="attributes.isCommonJumpType"
+            :hide-opinion="isBpmOpinionHide"
+            :hide-path="attributes.isHidePath"
+            :form-opinion="submitFormOpinion"
+            @close="visible => agreeDialogVisible= visible"
+            @action-event="handleActionEvent"
+        />
 
-    <!--驳回-->
-    <reject-dialog
-      :visible="rejectDialogVisible"
-      :action="actionName"
-      :title="actionTitle"
-      :task-id="taskId"
-      :hide-opinion="isBpmOpinionHide"
-      :form-opinion="submitFormOpinion"
-      @close="visible => rejectDialogVisible= visible"
-      @action-event="handleActionEvent"
-    />
-    <!--终止流程-->
-    <approve-dialog
-      :visible="approveDialogVisible"
-      :action="actionName"
-      :title="actionTitle"
-      :task-id="taskId"
-      :hide-opinion="isBpmOpinionHide"
-      :form-opinion="submitFormOpinion"
-      callback-event
-      @close="visible => approveDialogVisible= visible"
-      @action-event="handleActionEvent"
-    />
-    <!--转办-->
-    <delegate-dialog
-      :id="taskChangeId"
-      :visible="delegateDialogVisible"
-      :action="actionName"
-      :title="actionTitle"
-      :task-id="taskId"
-      :readonly="delegateReadonly"
-      @close="visible => delegateDialogVisible= visible"
-      @callback="callbackPage"
-    />
-    <!--任务补签-->
-    <add-sign-task-dialog
-      :visible="addSignTaskDialogVisible"
-      :action="actionName"
-      :title="actionTitle"
-      :task-id="taskId"
-      :hide-opinion="false"
-      :form-opinion="submitFormOpinion"
-      @close="visible => addSignTaskDialogVisible= visible"
-      @action-event="handleActionEvent"
-      @callback="callbackPage"
-    />
-  </div>
+        <!--驳回-->
+        <reject-dialog
+            :visible="rejectDialogVisible"
+            :action="actionName"
+            :title="actionTitle"
+            :task-id="taskId"
+            :hide-opinion="isBpmOpinionHide"
+            :form-opinion="submitFormOpinion"
+            @close="visible => rejectDialogVisible= visible"
+            @action-event="handleActionEvent"
+        />
+        <!--终止流程-->
+        <approve-dialog
+            :visible="approveDialogVisible"
+            :action="actionName"
+            :title="actionTitle"
+            :task-id="taskId"
+            :hide-opinion="isBpmOpinionHide"
+            :form-opinion="submitFormOpinion"
+            callback-event
+            @close="visible => approveDialogVisible= visible"
+            @action-event="handleActionEvent"
+        />
+        <!--转办-->
+        <delegate-dialog
+            :id="taskChangeId"
+            :visible="delegateDialogVisible"
+            :action="actionName"
+            :title="actionTitle"
+            :task-id="taskId"
+            :readonly="delegateReadonly"
+            @close="visible => delegateDialogVisible= visible"
+            @callback="callbackPage"
+        />
+        <!--任务补签-->
+        <add-sign-task-dialog
+            :visible="addSignTaskDialogVisible"
+            :action="actionName"
+            :title="actionTitle"
+            :task-id="taskId"
+            :hide-opinion="false"
+            :form-opinion="submitFormOpinion"
+            @close="visible => addSignTaskDialogVisible= visible"
+            @action-event="handleActionEvent"
+            @callback="callbackPage"
+        />
+    </div>
 </template>
 <script>
 import { getFormData, getInstFormData } from '@/api/platform/bpmn/bpmInst'
@@ -172,502 +172,502 @@ import AddSignTaskDialog from '../form-ext/addSignTask'
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
 
 export default {
-  components: {
-    Formrender,
-    FormToolbar,
-    FlowDiagramDialog,
-    ApprovalHistoryDialog,
+    components: {
+        Formrender,
+        FormToolbar,
+        FlowDiagramDialog,
+        ApprovalHistoryDialog,
 
-    StartFlowDialog,
-    ApproveDialog,
-    AgreeDialog,
-    RejectDialog,
-    DelegateDialog,
-    AddSignTaskDialog
-  },
-  mixins: [
-    ActionMixin,
-    RouteLeaveMixin
-  ],
-  props: {
-    defId: { // 流程定义ID
-      type: String
+        StartFlowDialog,
+        ApproveDialog,
+        AgreeDialog,
+        RejectDialog,
+        DelegateDialog,
+        AddSignTaskDialog
     },
-    proInstId: { // 草稿流程实例ID
-      type: String
-    },
-    instId: { // 流程实例ID
-      type: String
-    },
-    taskId: { // 流程任务ID
-      type: String
-    },
-    taskChangeId: { // 转办代理任务ID
-      type: String
-    },
-    copyFlow: { // 是否复制流程
-      type: Boolean,
-      default: false
+    mixins: [
+        ActionMixin,
+        RouteLeaveMixin
+    ],
+    props: {
+        defId: { // 流程定义ID
+            type: String
+        },
+        proInstId: { // 草稿流程实例ID
+            type: String
+        },
+        instId: { // 流程实例ID
+            type: String
+        },
+        taskId: { // 流程任务ID
+            type: String
+        },
+        taskChangeId: { // 转办代理任务ID
+            type: String
+        },
+        copyFlow: { // 是否复制流程
+            type: Boolean,
+            default: false
+        },
+        closeable: {
+            type: Boolean,
+            default: true
+        }
     },
-    closeable: {
-      type: Boolean,
-      default: true
-    }
-  },
-  data() {
-    return {
-      isRoute: false,
+    data() {
+        return {
+            isRoute: false,
 
-      flowDiagramVisible: false, // 流程图
-      approvalHistoryVisible: false,
-      instanceDetailVisible: false,
-      startFlowDialogVisible: false,
-      agreeDialogVisible: false, // 同意
-      rejectDialogVisible: false, // 驳回
-      delegateDialogVisible: false,
-      addSignTaskDialogVisible: false,
-      approveDialogVisible: false,
+            flowDiagramVisible: false, // 流程图
+            approvalHistoryVisible: false,
+            instanceDetailVisible: false,
+            startFlowDialogVisible: false,
+            agreeDialogVisible: false, // 同意
+            rejectDialogVisible: false, // 驳回
+            delegateDialogVisible: false,
+            addSignTaskDialogVisible: false,
+            approveDialogVisible: false,
 
-      delegateReadonly: false,
+            delegateReadonly: false,
 
-      endProcessTaskId: '',
+            endProcessTaskId: '',
 
-      actionName: '',
-      actionTitle: '',
-      version: 0,
-      // ========表单的数据=======
-      loading: false,
-      formUrlName: '',
-      formUrlType: 'inner', // 内嵌url方式:inner: vue组件方式,iframe:iframe方式
+            actionName: '',
+            actionTitle: '',
+            version: 0,
+            // ========表单的数据=======
+            loading: false,
+            formUrlName: '',
+            formUrlType: 'inner', // 内嵌url方式:inner: vue组件方式,iframe:iframe方式
 
-      formModel: {
-        type: 'INNER'
-      },
-      formDef: null,
-      buttons: [],
-      formData: {},
-      attributes: {}, // 新增扩展属性
-      formParams: {}, // 表单流程扩展参数
-      isBpmOpinionHide: false,
-      readonly: false,
+            formModel: {
+                type: 'INNER'
+            },
+            formDef: null,
+            buttons: [],
+            formData: {},
+            attributes: {}, // 新增扩展属性
+            formParams: {}, // 表单流程扩展参数
+            isBpmOpinionHide: false,
+            readonly: false,
 
-      submitFormData: {},
-      submitFormOpinion: ''
-    }
-  },
+            submitFormData: {},
+            submitFormOpinion: ''
+        }
+    },
 
-  // created() {
-  //   const query = this.$route.query
-  //   this.defId = query.defId // 流程定义
-  //   this.proInstId = query.proInstId // 草稿启动的流程实例id
-  //   this.taskId = query.taskId//  任务ID
-  //   this.instId = query.instId// 任务实例ID
-  //   this.nodeId = query.nodeId// 节点ID
-  //   this.taskChangeId = query.taskChangeId // 转办ID
+    // created() {
+    //   const query = this.$route.query
+    //   this.defId = query.defId // 流程定义
+    //   this.proInstId = query.proInstId // 草稿启动的流程实例id
+    //   this.taskId = query.taskId//  任务ID
+    //   this.instId = query.instId// 任务实例ID
+    //   this.nodeId = query.nodeId// 节点ID
+    //   this.taskChangeId = query.taskChangeId // 转办ID
 
-  //   this.title = this.$route.params.title || ''// 标题
+    //   this.title = this.$route.params.title || ''// 标题
 
-  //   this.loadFormData()
-  // },
-  methods: {
+    //   this.loadFormData()
+    // },
+    methods: {
     // 获取数据
-    loadFormData() {
-      this.loading = true
-      this.formDef = null
-      this.buttons = null
-      this.formData = null
-      this.$nextTick(() => {
-        this.readonly = false
-        if (this.$utils.isNotEmpty(this.taskId)) { // 处理流程任务
-          this.getTaskFormData()
-        } else if (this.$utils.isNotEmpty(this.defId)) { // 启动 或者草稿流程启动
-          this.getDefinitionFormData()
-        } else if (this.$utils.isNotEmpty(this.instId)) { // 流程实例
-          this.getInstanceFormData()
-        } else {
-          this.$dialog.alert({
-            message: '未获取正确的参数,请检查传入参数'
-          }).then(() => {
-            this.closeDialog()
-          })
-          this.loading = false
-        }
-      })
-    },
+        loadFormData() {
+            this.loading = true
+            this.formDef = null
+            this.buttons = null
+            this.formData = null
+            this.$nextTick(() => {
+                this.readonly = false
+                if (this.$utils.isNotEmpty(this.taskId)) { // 处理流程任务
+                    this.getTaskFormData()
+                } else if (this.$utils.isNotEmpty(this.defId)) { // 启动 或者草稿流程启动
+                    this.getDefinitionFormData()
+                } else if (this.$utils.isNotEmpty(this.instId)) { // 流程实例
+                    this.getInstanceFormData()
+                } else {
+                    this.$dialog.alert({
+                        message: '未获取正确的参数,请检查传入参数'
+                    }).then(() => {
+                        this.closeDialog()
+                    })
+                    this.loading = false
+                }
+            })
+        },
 
-    /**
+        /**
      * 启动 或者草稿流程
      */
-    getDefinitionFormData() {
-      this.formParams.defId = this.defId
-      this.formParams.proInstId = this.proInstId || null
-      this.formParams.copyFlow = this.copyFlow
-      getFormData({
-        defId: this.defId,
-        proInstId: this.proInstId || null
-      }).then(response => {
-        this.loading = false
-        this.buildFormData(response.data)
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
+        getDefinitionFormData() {
+            this.formParams.defId = this.defId
+            this.formParams.proInstId = this.proInstId || null
+            this.formParams.copyFlow = this.copyFlow
+            getFormData({
+                defId: this.defId,
+                proInstId: this.proInstId || null
+            }).then(response => {
+                this.loading = false
+                this.buildFormData(response.data)
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
      * 获取流程任务表单
      */
-    getTaskFormData() {
-      this.loading = true
-      this.formParams.taskId = this.taskId || null
-      getTaskFormData({
-        taskId: this.taskId
-      }).then(response => {
-        this.loading = false
-        this.buildFormData(response.data)
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
+        getTaskFormData() {
+            this.loading = true
+            this.formParams.taskId = this.taskId || null
+            getTaskFormData({
+                taskId: this.taskId
+            }).then(response => {
+                this.loading = false
+                this.buildFormData(response.data)
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
      * 流程实例 的表单数据
      */
-    getInstanceFormData() {
-      this.readonly = true
-      this.formParams.instId = this.instId || null
-      getInstFormData({
-        instId: this.instId
-      }).then(response => {
-        this.loading = false
-        this.buildFormData(response.data)
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
+        getInstanceFormData() {
+            this.readonly = true
+            this.formParams.instId = this.instId || null
+            getInstFormData({
+                instId: this.instId
+            }).then(response => {
+                this.loading = false
+                this.buildFormData(response.data)
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
      * 构建表单相关数据
      */
-    buildFormData(data) {
-      if (this.$utils.isEmpty(data)) {
-        this.$dialog.alert({
-          message: `未获取到数据`
-        }).then(() => {
-          this.closeDialog()
-        })
-        return
-      }
-      const formModel = data.formModel
-      this.formUrlType = 'inner'
+        buildFormData(data) {
+            if (this.$utils.isEmpty(data)) {
+                this.$dialog.alert({
+                    message: `未获取到数据`
+                }).then(() => {
+                    this.closeDialog()
+                })
+                return
+            }
+            const formModel = data.formModel
+            this.formUrlType = 'inner'
 
-      // 判断是否设置表单
-      if (this.$utils.isEmpty(formModel)) {
-        this.$dialog.alert({
-          message: `未设置表单,请流程定义中设置表单`
-        }).then(() => {
-          this.closeDialog()
-        })
-        return
-      }
-      this.formModel = formModel
-      // ============在线表单 ================
-      if (formModel.type === 'INNER') {
-        if (this.$utils.isEmpty(formModel.formData)) {
-          this.$dialog.alert({
-            message: `未设置在线表单`
-          }).then(() => {
-            this.closeDialog()
-          })
-        }
-        // this.title = this.$utils.isEmpty(this.title) ? data.title : this.title
+            // 判断是否设置表单
+            if (this.$utils.isEmpty(formModel)) {
+                this.$dialog.alert({
+                    message: `未设置表单,请流程定义中设置表单`
+                }).then(() => {
+                    this.closeDialog()
+                })
+                return
+            }
+            this.formModel = formModel
+            // ============在线表单 ================
+            if (formModel.type === 'INNER') {
+                if (this.$utils.isEmpty(formModel.formData)) {
+                    this.$dialog.alert({
+                        message: `未设置在线表单`
+                    }).then(() => {
+                        this.closeDialog()
+                    })
+                }
+                // this.title = this.$utils.isEmpty(this.title) ? data.title : this.title
 
-        // 表单定义
-        this.formDef = this.$utils.parseData(formModel.formData) || {}
+                // 表单定义
+                this.formDef = this.$utils.parseData(formModel.formData) || {}
 
-        this.formData = {
-        // 表单数据
-          responses: this.$utils.parseData(data.boData) || {},
-          // 表单权限
-          permissions: this.$utils.parseData(data.permissions) || {}
-        }
+                this.formData = {
+                    // 表单数据
+                    responses: this.$utils.parseData(data.boData) || {},
+                    // 表单权限
+                    permissions: this.$utils.parseData(data.permissions) || {}
+                }
 
-        // 一些参数
-        this.attributes = this.initAttributes(data)
-        this.formParams.nodeId = this.attributes.nodeId
-        // 操作按钮
-        this.buttons = this.buildButtons(data.buttons, this.attributes) || []
-        // 表单意见
-        this.formParams.formOpinionData = FormUtil.initFormOpinionData(data.attributes || {})
+                // 一些参数
+                this.attributes = this.initAttributes(data)
+                this.formParams.nodeId = this.attributes.nodeId
+                // 操作按钮
+                this.buttons = this.buildButtons(data.buttons, this.attributes) || []
+                // 表单意见
+                this.formParams.formOpinionData = FormUtil.initFormOpinionData(data.attributes || {})
 
-        // 表单意见是否隐藏意见
-        this.$nextTick(() => {
-          this.isBpmOpinionHide = this.handleBpmOpinionHide(data.attributes || {})
-        })
-        // 流程关联信息
-        this.formParams.bpmLinkData = FormUtil.getBpmLinkData(data.attributes || {})
-        // 版本号
-        this.version = data.version
-        // 设置标题
-        this.$store.dispatch('ibps/app/setTitle', this.title)
-        // 设置数据是否改变
-        this.$store.dispatch('ibps/app/setDataChange', false)
+                // 表单意见是否隐藏意见
+                this.$nextTick(() => {
+                    this.isBpmOpinionHide = this.handleBpmOpinionHide(data.attributes || {})
+                })
+                // 流程关联信息
+                this.formParams.bpmLinkData = FormUtil.getBpmLinkData(data.attributes || {})
+                // 版本号
+                this.version = data.version
+                // 设置标题
+                this.$store.dispatch('ibps/app/setTitle', this.title)
+                // 设置数据是否改变
+                this.$store.dispatch('ibps/app/setDataChange', false)
 
-        // 流程实例当前审批节点
-        this.endProcessTaskId = data.endProcessTaskId
+                // 流程实例当前审批节点
+                this.endProcessTaskId = data.endProcessTaskId
 
-      //  ============内嵌表单[按钮这边提供] ================
-      } else if (formModel.type === 'URL_LOAD') {
-        const urlForm = formModel.mobileValue
-        if (this.$utils.isEmpty(urlForm)) {
-          this.$dialog.alert({
-            message: `未设置内嵌表单`
-          }).then(() => {
-            this.closeDialog()
-          })
-        }
-        // 一些参数
-        this.attributes = this.initAttributes(data)
-        this.formParams.nodeId = this.attributes.nodeId
-        // 操作按钮
-        this.buttons = this.buildButtons(data.buttons, this.attributes) || []
-        // 初始化url表单
-        this.initUrlForm(urlForm)
-      //  ============外部表单【iframe】 ================
-      } else if (formModel.type === 'FRAME') {
-        const urlForm = formModel.mobileValue
-        if (this.$utils.isEmpty(urlForm)) {
-          this.$dialog.alert({
-            message: `未设置外部表单`
-          }).then(() => {
-            this.closeDialog()
-          })
-        }
+                //  ============内嵌表单[按钮这边提供] ================
+            } else if (formModel.type === 'URL_LOAD') {
+                const urlForm = formModel.mobileValue
+                if (this.$utils.isEmpty(urlForm)) {
+                    this.$dialog.alert({
+                        message: `未设置内嵌表单`
+                    }).then(() => {
+                        this.closeDialog()
+                    })
+                }
+                // 一些参数
+                this.attributes = this.initAttributes(data)
+                this.formParams.nodeId = this.attributes.nodeId
+                // 操作按钮
+                this.buttons = this.buildButtons(data.buttons, this.attributes) || []
+                // 初始化url表单
+                this.initUrlForm(urlForm)
+                //  ============外部表单【iframe】 ================
+            } else if (formModel.type === 'FRAME') {
+                const urlForm = formModel.mobileValue
+                if (this.$utils.isEmpty(urlForm)) {
+                    this.$dialog.alert({
+                        message: `未设置外部表单`
+                    }).then(() => {
+                        this.closeDialog()
+                    })
+                }
+                // 初始化url表单
+                this.initUrlForm(urlForm)
+            }
+        },
         // 初始化url表单
-        this.initUrlForm(urlForm)
-      }
-    },
-    // 初始化url表单
-    initUrlForm(url) {
-      if (url.startsWith('http')) {
-        this.formUrlType = 'iframe'
-        this.$nextTick(() => {
-          this.$refs.formrender.src = url
-          // 传递消息
-          this.$refs.formrender.contentWindow.postMessage({ data: this.attributes }, '*')
-        })
-      } else {
-        const component = url.split('?')[0]
-        this.formParams.attrs = this.urlParse(url)
-        this.formUrlType = 'inner'
-        const formUrlName = 'IbpsBpmnFormUrl'
-        this.$options.components[formUrlName] = _import(component)
-        this.formUrlName = formUrlName
-      }
-    },
-    urlParse(str) {
-      const obj = {}
-      if (str.indexOf('?') !== -1) {
-        const str1 = str.split('?')[1].split('&')
-        for (let i = 0; i < str1.length; i++) {
-          const params = str1[i].split('=')
-          obj[params[0]] = params[1]
-        }
-      }
-      return obj
-    },
-    initAttributes(data) {
-      const attributes = data.attributes || {}
-      return {
-        title: this.title,
-        defId: this.defId,
-        proInstId: this.proInstId,
-        taskId: this.taskId,
-        nodeId: attributes.nodeId,
-        lockUser: attributes.lockUser,
-        // 当前用户
-        curUserId: attributes.curUserId,
-        // 挂起状态
-        suspendState: attributes.suspendState,
-        // 是否转办
-        isHiddenDelegate: this.$utils.toBoolean(attributes.isHiddenDelegate),
-        // 是否正常跳转
-        isCommonJumpType: this.$utils.toBoolean(attributes.isCommonJumpType),
-        // 是否隐藏意见
-        isHideOpinion: this.$utils.toBoolean(attributes.isHideOpinion),
-        // 是否隐藏路径
-        isHidePath: this.$utils.toBoolean(attributes.isHidePath),
-        // 是否结束
-        isEnd: this.$utils.toBoolean(attributes.isEnd),
-        // 第一个节点是否选择
-        firstNodeUserAssign: attributes.firstNodeUserAssign,
-        // 打印模版
-        printTemplateId: data.formModel.templateId,
-        // BO版本号
-        version: data.version
-      }
-    },
-    handleBpmOpinionHide(attributes = {}) {
-      const formOpinionSetting = attributes.formOpinionSetting
-      const nodeId = attributes.nodeId
-      if (this.$utils.isNotEmpty(formOpinionSetting)) {
-        let flag = false
-        for (const o in formOpinionSetting) {
-          const formOpinionHidden = formOpinionSetting[o]
-          try {
-            if (this.$utils.parseJSON(o).includes(nodeId)) {
-              flag = this.$utils.toBoolean(formOpinionHidden)
-              break
+        initUrlForm(url) {
+            if (url.startsWith('http')) {
+                this.formUrlType = 'iframe'
+                this.$nextTick(() => {
+                    this.$refs.formrender.src = url
+                    // 传递消息
+                    this.$refs.formrender.contentWindow.postMessage({ data: this.attributes }, '*')
+                })
+            } else {
+                const component = url.split('?')[0]
+                this.formParams.attrs = this.urlParse(url)
+                this.formUrlType = 'inner'
+                const formUrlName = 'IbpsBpmnFormUrl'
+                this.$options.components[formUrlName] = _import(component)
+                this.formUrlName = formUrlName
             }
-          } catch (err) {
-            console.error(err)
-          }
-        }
-        return this.hasFormOpinion() && !flag ? flag : true
-      }
-      if (this.hasFormOpinion()) {
-        return true
-      }
-      // 是否有表单意见
-      return this.attributes.isHideOpinion || false
-    },
-    /**
+        },
+        urlParse(str) {
+            const obj = {}
+            if (str.indexOf('?') !== -1) {
+                const str1 = str.split('?')[1].split('&')
+                for (let i = 0; i < str1.length; i++) {
+                    const params = str1[i].split('=')
+                    obj[params[0]] = params[1]
+                }
+            }
+            return obj
+        },
+        initAttributes(data) {
+            const attributes = data.attributes || {}
+            return {
+                title: this.title,
+                defId: this.defId,
+                proInstId: this.proInstId,
+                taskId: this.taskId,
+                nodeId: attributes.nodeId,
+                lockUser: attributes.lockUser,
+                // 当前用户
+                curUserId: attributes.curUserId,
+                // 挂起状态
+                suspendState: attributes.suspendState,
+                // 是否转办
+                isHiddenDelegate: this.$utils.toBoolean(attributes.isHiddenDelegate),
+                // 是否正常跳转
+                isCommonJumpType: this.$utils.toBoolean(attributes.isCommonJumpType),
+                // 是否隐藏意见
+                isHideOpinion: this.$utils.toBoolean(attributes.isHideOpinion),
+                // 是否隐藏路径
+                isHidePath: this.$utils.toBoolean(attributes.isHidePath),
+                // 是否结束
+                isEnd: this.$utils.toBoolean(attributes.isEnd),
+                // 第一个节点是否选择
+                firstNodeUserAssign: attributes.firstNodeUserAssign,
+                // 打印模版
+                printTemplateId: data.formModel.templateId,
+                // BO版本号
+                version: data.version
+            }
+        },
+        handleBpmOpinionHide(attributes = {}) {
+            const formOpinionSetting = attributes.formOpinionSetting
+            const nodeId = attributes.nodeId
+            if (this.$utils.isNotEmpty(formOpinionSetting)) {
+                let flag = false
+                for (const o in formOpinionSetting) {
+                    const formOpinionHidden = formOpinionSetting[o]
+                    try {
+                        if (this.$utils.parseJSON(o).includes(nodeId)) {
+                            flag = this.$utils.toBoolean(formOpinionHidden)
+                            break
+                        }
+                    } catch (err) {
+                        console.error(err)
+                    }
+                }
+                return this.hasFormOpinion() && !flag ? flag : true
+            }
+            if (this.hasFormOpinion()) {
+                return true
+            }
+            // 是否有表单意见
+            return this.attributes.isHideOpinion || false
+        },
+        /**
      * 构建操作按钮
      */
-    buildButtons(buttons, params) {
-      if (this.$utils.isEmpty(buttons)) {
-        buttons = []
-      }
-      // 如果转办,代理不为空
-      if (this.$utils.isNotEmpty(this.taskChangeId)) {
-        buttons.unshift({
-          alias: 'delegateDetail',
-          name: '转办/代理明细'
-        })
-      }
-      const btns = []
-      for (let i = 0; i < buttons.length; i++) {
-        const button = buttons[i]
-        const alias = button.alias
-        const code = button.code
-        button.key = alias === 'custom' ? (code || (alias + i)) : alias
-        btns.push(button)
-      }
-      const btn = new BpmnButton({
-        buttons: btns,
-        params: params
-      })
-      return btn.response_buttons
-    },
-    getFormEL() {
-      if (this.formUrlType === 'inner') {
-        return this.$refs.formrender
-      } else {
-        try {
-          // 跨域获取表单数据
-          return this.$refs.formrender.contentWindow.ibpsFormUrl
-        } catch (err) {
-          console.error(err)
+        buildButtons(buttons, params) {
+            if (this.$utils.isEmpty(buttons)) {
+                buttons = []
+            }
+            // 如果转办,代理不为空
+            if (this.$utils.isNotEmpty(this.taskChangeId)) {
+                buttons.unshift({
+                    alias: 'delegateDetail',
+                    name: '转办/代理明细'
+                })
+            }
+            const btns = []
+            for (let i = 0; i < buttons.length; i++) {
+                const button = buttons[i]
+                const alias = button.alias
+                const code = button.code
+                button.key = alias === 'custom' ? (code || (alias + i)) : alias
+                btns.push(button)
+            }
+            const btn = new BpmnButton({
+                buttons: btns,
+                params: params
+            })
+            return btn.response_buttons
+        },
+        getFormEL() {
+            if (this.formUrlType === 'inner') {
+                return this.$refs.formrender
+            } else {
+                try {
+                    // 跨域获取表单数据
+                    return this.$refs.formrender.contentWindow.ibpsFormUrl
+                } catch (err) {
+                    console.error(err)
+                }
+            }
+        },
+        // 获取表单数据
+        getFormData() {
+            if (!(this.getFormEL() && this.getFormEL().getFormData)) {
+                this.$toast('URL表单必须包含获取表单数据的方法【getFormData】')
+                return
+            }
+            return this.getFormEL().getFormData()
+        },
+        // 是否有审批意见字段
+        hasFormOpinion() {
+            if (!(this.getFormEL() && this.getFormEL().hasFormOpinion)) {
+                return false
+            }
+            return this.getFormEL().hasFormOpinion() || false
+        },
+        // 获取表单意见数据
+        getFormOpinionData() {
+            if (!(this.getFormEL() && this.getFormEL().getFormOpinionData)) {
+                return ''
+            }
+            const formOpinionData = this.getFormEL().getFormOpinionData()
+            let data = ''
+            if (this.$utils.isEmpty(formOpinionData)) {
+                return data
+            }
+            // 如果只有一个,多个,取最后一个
+            for (const key in formOpinionData) {
+                data = formOpinionData[key]
+            }
+            return data
+        },
+        onLoadActions() {
+            return false
+        },
+        // 前置事件
+        beforeScript(key, callback) {
+            if (!(this.getFormEL() && this.getFormEL().beforeScript)) {
+                const flag = true
+                callback(flag)
+                return
+            }
+            return this.getFormEL().beforeScript(key, callback)
+        },
+        // 后置事件
+        afterScript(key, params, callback) {
+            if (!(this.getFormEL() && this.getFormEL().afterScript)) {
+                const flag = true
+                callback(flag)
+                return
+            }
+            return this.getFormEL().afterScript(key, params, callback)
+        },
+        // 回调上一个页面
+        callbackPage() {
+            if (!this.isRoute) {
+                this.closeDialog()
+            }
+            this.$emit('callback', this)
+        },
+        // 关闭当前窗口
+        closeDialog() {
+            if (this.isRoute) {
+                this.$router.go(-1)
+            } else {
+                this.$emit('close', this)
+            }
+        },
+        // 跳转页面
+        jumpPage(path, reload = false) {
+            if (!this.isRoute) {
+                return
+            }
+            if (reload) {
+                this.$router.push({ path: '/refresh' })
+            } else {
+                setTimeout(() => {
+                    this.$router.push({ path: `/bpmn/${path}/index` })
+                }, 1000)
+            }
+        },
+        // 验证表单if
+        validateForm(callback) {
+            if (!(this.getFormEL() && this.getFormEL().validate)) {
+                const flag = true
+                callback(flag)
+                return
+            }
+            this.getFormEL().validate().then(() => {
+                callback(true)
+            }).catch((valid) => {
+                callback(false)
+                this.$notify({
+                    type: 'warning',
+                    message: this.$t('common.formError')
+                })
+            })
+        },
+        isDraft: function() {
+            return this.$utils.isNotEmpty(this.proInstId)
         }
-      }
-    },
-    // 获取表单数据
-    getFormData() {
-      if (!(this.getFormEL() && this.getFormEL().getFormData)) {
-        this.$toast('URL表单必须包含获取表单数据的方法【getFormData】')
-        return
-      }
-      return this.getFormEL().getFormData()
-    },
-    // 是否有审批意见字段
-    hasFormOpinion() {
-      if (!(this.getFormEL() && this.getFormEL().hasFormOpinion)) {
-        return false
-      }
-      return this.getFormEL().hasFormOpinion() || false
-    },
-    // 获取表单意见数据
-    getFormOpinionData() {
-      if (!(this.getFormEL() && this.getFormEL().getFormOpinionData)) {
-        return ''
-      }
-      const formOpinionData = this.getFormEL().getFormOpinionData()
-      let data = ''
-      if (this.$utils.isEmpty(formOpinionData)) {
-        return data
-      }
-      // 如果只有一个,多个,取最后一个
-      for (const key in formOpinionData) {
-        data = formOpinionData[key]
-      }
-      return data
-    },
-    onLoadActions() {
-      return false
-    },
-    // 前置事件
-    beforeScript(key, callback) {
-      if (!(this.getFormEL() && this.getFormEL().beforeScript)) {
-        const flag = true
-        callback(flag)
-        return
-      }
-      return this.getFormEL().beforeScript(key, callback)
-    },
-    // 后置事件
-    afterScript(key, params, callback) {
-      if (!(this.getFormEL() && this.getFormEL().afterScript)) {
-        const flag = true
-        callback(flag)
-        return
-      }
-      return this.getFormEL().afterScript(key, params, callback)
-    },
-    // 回调上一个页面
-    callbackPage() {
-      if (!this.isRoute) {
-        this.closeDialog()
-      }
-      this.$emit('callback', this)
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      if (this.isRoute) {
-        this.$router.go(-1)
-      } else {
-        this.$emit('close', this)
-      }
-    },
-    // 跳转页面
-    jumpPage(path, reload = false) {
-      if (!this.isRoute) {
-        return
-      }
-      if (reload) {
-        this.$router.push({ path: '/refresh' })
-      } else {
-        setTimeout(() => {
-          this.$router.push({ path: `/bpmn/${path}/index` })
-        }, 1000)
-      }
-    },
-    // 验证表单if
-    validateForm(callback) {
-      if (!(this.getFormEL() && this.getFormEL().validate)) {
-        const flag = true
-        callback(flag)
-        return
-      }
-      this.getFormEL().validate().then(() => {
-        callback(true)
-      }).catch((valid) => {
-        callback(false)
-        this.$notify({
-          type: 'warning',
-          message: this.$t('common.formError')
-        })
-      })
-    },
-    isDraft: function() {
-      return this.$utils.isNotEmpty(this.proInstId)
     }
-  }
 }
 </script>
 <style lang="scss" scoped>

+ 521 - 519
src/business/platform/form/dynamic-form/form.vue

@@ -1,40 +1,42 @@
 <template>
-  <van-form ref="form" :colon="colon" :label-width="labelWidth" :label-align="labelPosition" :input-align="inputAlign">
-    <template v-for="(field, index) in formDef.fields">
-      <!--栅格布局-->
-      <ibps-dynamic-form-grid
-v-if="
-          field.field_type === 'grid' ||
-            field.field_type === 'tabs' ||
-            field.field_type === 'steps' ||
-            field.field_type === 'collapse'
-        "
-:key="field.name + index"
-ref="formItem"
-:models.sync="models"
-:rights.sync="rights"
-:field="field"
-        :code="code"
-:form-opinion="responseFormOpinionData[field.name]"
-:desc-position="formDef.attrs.descPosition"
-        :params="formParams"
-:readonly-rights="readonlyRights"
-@change-form-opinion="handleFormOpinion" />
-      <ibps-dynamic-form-item
-v-else
-ref="formItem"
-:key="field.name + index"
-:models.sync="models"
-        :rights.sync="rights"
-:field="field"
-:code="code"
-:form-opinion="responseFormOpinionData[field.name]"
-        :desc-position="formDef.attrs.descPosition"
-:params="formParams"
-:readonly-rights="readonlyRights"
-        @change-form-opinion="handleFormOpinion" />
-    </template>
-  </van-form>
+    <van-form ref="form" :colon="colon" :label-width="labelWidth" :label-align="labelPosition" :input-align="inputAlign">
+        <template v-for="(field, index) in formDef.fields">
+            <!--栅格布局-->
+            <ibps-dynamic-form-grid
+                v-if="
+                    field.field_type === 'grid' ||
+                        field.field_type === 'tabs' ||
+                        field.field_type === 'steps' ||
+                        field.field_type === 'collapse'
+                "
+                :key="field.name + index"
+                ref="formItem"
+                :models.sync="models"
+                :rights.sync="rights"
+                :field="field"
+                :code="code"
+                :form-opinion="responseFormOpinionData[field.name]"
+                :desc-position="formDef.attrs.descPosition"
+                :params="formParams"
+                :readonly-rights="readonlyRights"
+                @change-form-opinion="handleFormOpinion"
+            />
+            <ibps-dynamic-form-item
+                v-else
+                ref="formItem"
+                :key="field.name + index"
+                :models.sync="models"
+                :rights.sync="rights"
+                :field="field"
+                :code="code"
+                :form-opinion="responseFormOpinionData[field.name]"
+                :desc-position="formDef.attrs.descPosition"
+                :params="formParams"
+                :readonly-rights="readonlyRights"
+                @change-form-opinion="handleFormOpinion"
+            />
+        </template>
+    </van-form>
 </template>
 
 <script>
@@ -42,549 +44,549 @@ import FormOptions from '../constants/formOptions'
 import FormUtils from '../utils/formUtil'
 
 export default {
-  provide() {
-    return {
-      dynamicForm: this
-    }
-  },
-  props: {
-    formDef: {
-      type: Object,
-      required: true
-    },
-    value: {
-      type: Object
-    },
-    readonly: {
-      type: Boolean,
-      default: false
-    },
-    permissions: {
-      type: Object
-    },
-    columnMinWidth: {
-      type: String
-    },
-    validateImmediately: {
-      // 是否初始验证
-      type: Boolean,
-      default: true
-    },
-    initialization: {
-      type: Boolean,
-      default: false
-    },
-    // 扩展参数
-    params: Object,
-    // 当前激活步骤
-    curActiveStep: Number
-  },
-  data() {
-    return {
-      models: {}, // 表单model对象数据
-      rights: {}, // 表单权限
-      responseFormOpinionData: {},
-      responseFormula: {}, // 公式
-      responseLinkages: {},
-      responseVerifys: [], // 表单提交校验
-      responseOpinionFields: {}, // 表单的意见字段
-      responseLabelFields: {}, // 表单的文本字段
-      border: false,
-      init: false,
-      tabs: 'tabs_0',
-      steps: 'steps_0'
-    }
-  },
-  computed: {
-    formAttrs() {
-      return this.formDef ? this.formDef.attrs || {} : {}
+    provide() {
+        return {
+            dynamicForm: this
+        }
     },
-    colon() {
-      return !!(this.formAttrs && this.formAttrs.colon)
+    props: {
+        formDef: {
+            type: Object,
+            required: true
+        },
+        value: {
+            type: Object
+        },
+        readonly: {
+            type: Boolean,
+            default: false
+        },
+        permissions: {
+            type: Object
+        },
+        columnMinWidth: {
+            type: String
+        },
+        validateImmediately: {
+            // 是否初始验证
+            type: Boolean,
+            default: true
+        },
+        initialization: {
+            type: Boolean,
+            default: false
+        },
+        // 扩展参数
+        params: Object,
+        // 当前激活步骤
+        curActiveStep: Number
+    },
+    data() {
+        return {
+            models: {}, // 表单model对象数据
+            rights: {}, // 表单权限
+            responseFormOpinionData: {},
+            responseFormula: {}, // 公式
+            responseLinkages: {},
+            responseVerifys: [], // 表单提交校验
+            responseOpinionFields: {}, // 表单的意见字段
+            responseLabelFields: {}, // 表单的文本字段
+            border: false,
+            init: false,
+            tabs: 'tabs_0',
+            steps: 'steps_0'
+        }
     },
-    labelWidth() {
-      if (
-        this.$utils.isNotEmpty(this.formAttrs.labelWidth) &&
+    computed: {
+        formAttrs() {
+            return this.formDef ? this.formDef.attrs || {} : {}
+        },
+        colon() {
+            return !!(this.formAttrs && this.formAttrs.colon)
+        },
+        labelWidth() {
+            if (
+                this.$utils.isNotEmpty(this.formAttrs.labelWidth) &&
           this.$utils.isNotEmpty(this.formAttrs.labelWidthUnit)
-      ) {
-        return this.formAttrs.labelWidth + this.formAttrs.labelWidthUnit
-      } else {
-        return '100px'
-      }
-    },
-    labelPosition() {
-      return this.$utils.isNotEmpty(this.formAttrs.mobileLabelPosition)
-        ? this.formAttrs.mobileLabelPosition
-        : 'right'
-    },
-    inputAlign() {
-      return this.$utils.isNotEmpty(this.formAttrs.mobileInputAlign)
-        ? this.formAttrs.mobileInputAlign
-        : 'left'
-    },
-    customClass() {
-      return this.$utils.isNotEmpty(this.formAttrs.customClass)
-        ? this.formAttrs.customClass
-        : null
-    },
-    code() {
-      return this.formDef.code
-    },
-    readonlyRights() {
-      return this.readonly
-    },
-    readonlyStyle() {
-      return this.formAttrs && this.formAttrs.read_style
-        ? this.formAttrs.read_style
-        : 'text'
-    },
-    hasScript() {
-      return this.formAttrs
-        ? this.$utils.isNotEmpty(this.formAttrs.mobile_script)
-          ? this.$utils.isNotEmpty(this.formAttrs.mobile_script)
-          : this.$utils.isNotEmpty(this.formAttrs.script)
-        : false
-    },
-    formParams() {
-      // 扩展参数
-      const params = {
-        code: this.code,
-        responseFormula: this.responseFormula,
-        responseLinkages: this.responseLinkages,
-        responseFormOpinionData: this.responseFormOpinionData,
-        readonly: this.readonly,
-        permissions: this.rights,
-        inputAlign: this.inputAlign
-      }
+            ) {
+                return this.formAttrs.labelWidth + this.formAttrs.labelWidthUnit
+            } else {
+                return '100px'
+            }
+        },
+        labelPosition() {
+            return this.$utils.isNotEmpty(this.formAttrs.mobileLabelPosition)
+                ? this.formAttrs.mobileLabelPosition
+                : 'right'
+        },
+        inputAlign() {
+            return this.$utils.isNotEmpty(this.formAttrs.mobileInputAlign)
+                ? this.formAttrs.mobileInputAlign
+                : 'left'
+        },
+        customClass() {
+            return this.$utils.isNotEmpty(this.formAttrs.customClass)
+                ? this.formAttrs.customClass
+                : null
+        },
+        code() {
+            return this.formDef.code
+        },
+        readonlyRights() {
+            return this.readonly
+        },
+        readonlyStyle() {
+            return this.formAttrs && this.formAttrs.read_style
+                ? this.formAttrs.read_style
+                : 'text'
+        },
+        hasScript() {
+            return this.formAttrs
+                ? this.$utils.isNotEmpty(this.formAttrs.mobile_script)
+                    ? this.$utils.isNotEmpty(this.formAttrs.mobile_script)
+                    : this.$utils.isNotEmpty(this.formAttrs.script)
+                : false
+        },
+        formParams() {
+            // 扩展参数
+            const params = {
+                code: this.code,
+                responseFormula: this.responseFormula,
+                responseLinkages: this.responseLinkages,
+                responseFormOpinionData: this.responseFormOpinionData,
+                readonly: this.readonly,
+                permissions: this.rights,
+                inputAlign: this.inputAlign
+            }
 
-      return Object.assign(params, this.params)
-    }
-  },
-  watch: {
-    formDef: {
-      handler(val) {
-        this.initResponseFields()
-      },
-      deep: true,
-      immediate: true
+            return Object.assign(params, this.params)
+        }
     },
-    models: {
-      handler(val) {
-        // 延迟验证
+    watch: {
+        formDef: {
+            handler(val) {
+                this.initResponseFields()
+            },
+            deep: true,
+            immediate: true
+        },
+        models: {
+            handler(val) {
+                // 延迟验证
+                this.$nextTick(() => {
+                    this.getFormValidator()
+                        .then(() => { })
+                        .catch(() => { })
+                })
+            },
+            deep: true,
+            immediate: true
+        },
+        initialization(val) {
+            if (val && this.hasScript) {
+                this.$emit('load-script')
+            }
+        }
+    },
+    mounted() {
+    // 初始化脚本
         this.$nextTick(() => {
-          this.getFormValidator()
-            .then(() => { })
-            .catch(() => { })
+            if (this.validateImmediately) {
+                this.getFormValidator()
+                    .then(() => { })
+                    .catch(() => { })
+            }
         })
-      },
-      deep: true,
-      immediate: true
     },
-    initialization(val) {
-      if (val && this.hasScript) {
-        this.$emit('load-script')
-      }
-    }
-  },
-  mounted() {
-    // 初始化脚本
-    this.$nextTick(() => {
-      if (this.validateImmediately) {
-        this.getFormValidator()
-          .then(() => { })
-          .catch(() => { })
-      }
-    })
-  },
-  methods: {
+    methods: {
     /**
        * 初始化字段
        */
-    async initResponseFields() {
-      const fields = this.formDef.fields
-      if (!fields) {
-        return
-      }
-      await this.generateModles(fields)
-      // 初始化运行公式计算
-      await this.initRunCalFormula()
-      // 初始化表单意见
-      await this.initResponseOpinionData()
-    },
-    /**
+        async initResponseFields() {
+            const fields = this.formDef.fields
+            if (!fields) {
+                return
+            }
+            await this.generateModles(fields)
+            // 初始化运行公式计算
+            await this.initRunCalFormula()
+            // 初始化表单意见
+            await this.initResponseOpinionData()
+        },
+        /**
        * 生成modles
        */
-    async generateModles(fields) {
-      for (let i = 0; i < fields.length; i++) {
-        const field = fields[i]
-        const fieldName = field.name
-        const fieldType = field.field_type
-        const fieldOptions = field.field_options
+        async generateModles(fields) {
+            for (let i = 0; i < fields.length; i++) {
+                const field = fields[i]
+                const fieldName = field.name
+                const fieldType = field.field_type
+                const fieldOptions = field.field_options
 
-        if (FormOptions.t.NESTED_FIELD_TYPES.includes(fieldType)) {
-          // 嵌套布局
-          if (
-            this.$utils.isNotEmpty(fieldOptions) &&
+                if (FormOptions.t.NESTED_FIELD_TYPES.includes(fieldType)) {
+                    // 嵌套布局
+                    if (
+                        this.$utils.isNotEmpty(fieldOptions) &&
               this.$utils.isNotEmpty(fieldOptions.columns)
-          ) {
-            // 循环遍历所有字段
-            fieldOptions.columns.forEach(item => {
-              this.generateModles(item.fields)
-            })
-          }
-        } else if (fieldType === 'table') {
-          // 子表单
-          const data = this.value ? this.value[fieldName] : []
-          if (fieldOptions.mode === 'block') {
-            if (this.$utils.isEmpty(data)) {
-              this.$set(this.models, fieldName, [])
-              const defaultValue = await FormUtils.getTableDefaultData(field)
-              this.models[fieldName].push(
-                JSON.parse(JSON.stringify(defaultValue))
-              )
-            } else {
-              this.models[fieldName] = data || []
-            }
-          } else {
-            this.models[fieldName] = data || []
-          }
-          // 初始化表单扩展参数
-          this.initFormFieldParameter(field)
-        } else if (fieldType === 'approval_opinion') {
-          // 审批意见
-          this.models[fieldName] = ''
-          this.responseOpinionFields[fieldName] = field
-          // ====== 初始化表单权限
-          this.initFormApprovalOpinionRights(field)
-        } else {
-          if (fieldType === 'label') {
-            // 文本字段
-            this.responseLabelFields[fieldName] = field
-          }
-          // 不是只读字段
-          if (!FormOptions.t.NON_MODEL_FIELD_TYPES.includes(fieldType)) {
-            // 空值默认
-            const defaultValueEmpty = this.$utils.toBoolean(
-              fieldOptions.default_value_empty,
-              true
-            )
-            if (this.value && Object.keys(this.value).indexOf(fieldName) >= 0) {
-              // 有值
-              const data = this.value[fieldName]
-              if (this.$utils.isEmpty(data)) {
-                if (defaultValueEmpty) {
-                  // this.models[fieldName] = await FormUtils.getFieldDefaultValue(
-                  //   field
-                  // )
-                  const defaultValue = await FormUtils.getFieldDefaultValue(field)
-                  this.models[fieldName] = defaultValue
+                    ) {
+                        // 循环遍历所有字段
+                        fieldOptions.columns.forEach(item => {
+                            this.generateModles(item.fields)
+                        })
+                    }
+                } else if (fieldType === 'table') {
+                    // 子表单
+                    const data = this.value ? this.value[fieldName] : []
+                    if (fieldOptions.mode === 'block') {
+                        if (this.$utils.isEmpty(data)) {
+                            this.$set(this.models, fieldName, [])
+                            const defaultValue = await FormUtils.getTableDefaultData(field)
+                            this.models[fieldName].push(
+                                JSON.parse(JSON.stringify(defaultValue))
+                            )
+                        } else {
+                            this.models[fieldName] = data || []
+                        }
+                    } else {
+                        this.models[fieldName] = data || []
+                    }
+                    // 初始化表单扩展参数
+                    this.initFormFieldParameter(field)
+                } else if (fieldType === 'approval_opinion') {
+                    // 审批意见
+                    this.models[fieldName] = ''
+                    this.responseOpinionFields[fieldName] = field
+                    // ====== 初始化表单权限
+                    this.initFormApprovalOpinionRights(field)
+                } else {
+                    if (fieldType === 'label') {
+                        // 文本字段
+                        this.responseLabelFields[fieldName] = field
+                    }
+                    // 不是只读字段
+                    if (!FormOptions.t.NON_MODEL_FIELD_TYPES.includes(fieldType)) {
+                        // 空值默认
+                        const defaultValueEmpty = this.$utils.toBoolean(
+                            fieldOptions.default_value_empty,
+                            true
+                        )
+                        if (this.value && Object.keys(this.value).indexOf(fieldName) >= 0) {
+                            // 有值
+                            const data = this.value[fieldName]
+                            if (this.$utils.isEmpty(data)) {
+                                if (defaultValueEmpty) {
+                                    // this.models[fieldName] = await FormUtils.getFieldDefaultValue(
+                                    //   field
+                                    // )
+                                    const defaultValue = await FormUtils.getFieldDefaultValue(field)
+                                    this.models[fieldName] = defaultValue
+                                }
+                            } else {
+                                this.models[fieldName] = await this.getInitData(field, data)
+                            }
+                        } else {
+                            // 默认值
+                            // this.models[fieldName] = await FormUtils.getFieldDefaultValue(
+                            //   field
+                            // )
+                            this.models[fieldName] = await FormUtils.getFieldDefaultValue(field)
+                            if (this.dynamicParams && this.dynamicParams[field.field_name]) {
+                                this.models[fieldName] = this.dynamicParams[field.field_name]
+                            }
+                        }
+                    } else {
+                        // 自定义组件单独处理
+                        if (fieldType === 'component') {
+                            this.models[fieldName] = this.value[fieldName]
+                        }
+                    }
+                    // 初始化表单扩展参数
+                    this.initFormFieldParameter(field)
                 }
-              } else {
-                this.models[fieldName] = await this.getInitData(field, data)
-              }
-            } else {
-              // 默认值
-              // this.models[fieldName] = await FormUtils.getFieldDefaultValue(
-              //   field
-              // )
-              this.models[fieldName] = await FormUtils.getFieldDefaultValue(field)
-              if (this.dynamicParams && this.dynamicParams[field.field_name]) {
-                this.models[fieldName] = this.dynamicParams[field.field_name]
-              }
             }
-          } else {
-            // 自定义组件单独处理
-            if (fieldType === 'component') {
-              this.models[fieldName] = this.value[fieldName]
+        },
+        async getInitData(field, data) {
+            const fieldType = field.field_type
+            const copyFlow = this.$utils.toBoolean(
+                this.formParams ? this.formParams.copyFlow : false,
+                false
+            )
+            if (fieldType === 'autoNumber' && copyFlow) {
+                // 复制流程初始化数据
+                return await FormUtils.getFieldDefaultValue(field)
             }
-          }
-          // 初始化表单扩展参数
-          this.initFormFieldParameter(field)
-        }
-      }
-    },
-    async getInitData(field, data) {
-      const fieldType = field.field_type
-      const copyFlow = this.$utils.toBoolean(
-        this.formParams ? this.formParams.copyFlow : false,
-        false
-      )
-      if (fieldType === 'autoNumber' && copyFlow) {
-        // 复制流程初始化数据
-        return await FormUtils.getFieldDefaultValue(field)
-      }
-      return data
-    },
-    /**
+            return data
+        },
+        /**
        *  初始化表单扩展参数
        */
-    initFormFieldParameter(field) {
-      // ====== 初始化表单权限
-      this.initFormRights(field)
-      // ====== 初始化需要进行公式计算的字段
-      this.initResponseFormula(field)
-      // ======  初始化需要进行联动数据的字段
-      this.initResponseLinkages(field)
-    },
-    initFormApprovalOpinionRights(field) {
-      this.rights[field.name] =
+        initFormFieldParameter(field) {
+            // ====== 初始化表单权限
+            this.initFormRights(field)
+            // ====== 初始化需要进行公式计算的字段
+            this.initResponseFormula(field)
+            // ======  初始化需要进行联动数据的字段
+            this.initResponseLinkages(field)
+        },
+        initFormApprovalOpinionRights(field) {
+            this.rights[field.name] =
           FormUtils.getDefaultApprovalOpinionRigths(field, this.params) ||
           this.getPermissions(this.permissions, field) ||
           FormUtils.getDefaultRigths(field)
-    },
-    /**
+        },
+        /**
        *  初始化表单权限
        */
-    initFormRights(field) {
-      this.rights[field.name] =
+        initFormRights(field) {
+            this.rights[field.name] =
           this.getPermissions(this.permissions, field) ||
           FormUtils.getDefaultRigths(field)
-    },
-    // 获取权限
-    getPermissions(permissions, field) {
-      if (this.$utils.isEmpty(permissions)) {
-        return
-      }
-      const fieldType = field.field_type
-      const name = field.name
-      let rightsValue = null
-      const isNonInputField = FormOptions.t.NON_INPUT_FIELD_TYPES.includes(
-        fieldType
-      )
-      let isSpecial = false
-      if (isNonInputField && permissions.fields) {
-        // 非输入字段
-        rightsValue = permissions.fields[name] ? permissions.fields[name] : null
-      } else if (fieldType === 'approval_opinion' && permissions.opinions) {
-        // 意见 特殊处理
-        rightsValue = permissions.opinions[name]
-          ? permissions.opinions[name]
-          : null
-      } else if (fieldType === 'table' && permissions.tables) {
-        // 子表
-        isSpecial = true
-        rightsValue = permissions.tables[name] ? permissions.tables[name] : null
-      } else {
-        // 字段
-        rightsValue = permissions.fields[name] ? permissions.fields[name] : null
-      }
-      if (this.readonly && !isNonInputField && !isSpecial) {
-        // 只读权限
-        // 修复空权限默认值的bug
-        if (this.$utils.isEmpty(rightsValue)) {
-          rightsValue = FormUtils.getDefaultRigths(field)
-        }
-        rightsValue =
+        },
+        // 获取权限
+        getPermissions(permissions, field) {
+            if (this.$utils.isEmpty(permissions)) {
+                return
+            }
+            const fieldType = field.field_type
+            const name = field.name
+            let rightsValue = null
+            const isNonInputField = FormOptions.t.NON_INPUT_FIELD_TYPES.includes(
+                fieldType
+            )
+            let isSpecial = false
+            if (isNonInputField && permissions.fields) {
+                // 非输入字段
+                rightsValue = permissions.fields[name] ? permissions.fields[name] : null
+            } else if (fieldType === 'approval_opinion' && permissions.opinions) {
+                // 意见 特殊处理
+                rightsValue = permissions.opinions[name]
+                    ? permissions.opinions[name]
+                    : null
+            } else if (fieldType === 'table' && permissions.tables) {
+                // 子表
+                isSpecial = true
+                rightsValue = permissions.tables[name] ? permissions.tables[name] : null
+            } else {
+                // 字段
+                rightsValue = permissions.fields[name] ? permissions.fields[name] : null
+            }
+            if (this.readonly && !isNonInputField && !isSpecial) {
+                // 只读权限
+                // 修复空权限默认值的bug
+                if (this.$utils.isEmpty(rightsValue)) {
+                    rightsValue = FormUtils.getDefaultRigths(field)
+                }
+                rightsValue =
             rightsValue !== FormOptions.t.PERMISSIONS.HIDE
-              ? FormOptions.t.PERMISSIONS.READ
-              : rightsValue
-      }
-      return rightsValue
-    },
-    // 初始化需要进行公式计算的字段
-    initResponseFormula(item) {
-      FormUtils.setResponseFormula(this.responseFormula, item, this.code)
-    },
-    // 初始化运行公式计算
-    initRunCalFormula() {
-      // 不需要字段的进行公式计算 比如获取但其当前时间
-      FormUtils.runCalFormula(
-        this,
-        this.responseFormula[FormUtils.NOT_NEED_FIELD],
-        this.formDef.code
-      )
-    },
-    // 初始化联动数据
-    initResponseLinkages(item) {
-      FormUtils.setResponseLinkages(this.responseLinkages, item, this.code)
-    },
-    // 初始化表单意见
-    initResponseOpinionData() {
-      this.responseFormOpinionData = {}
-      const opinionData = this.params ? this.params.formOpinionData || {} : {}
-      if (this.$utils.isEmpty(opinionData) || !this.hasFormOpinion()) {
-        return
-      }
-      const hasBindNode = opinionData.hasBindNode
-      const formOpinionConfig = opinionData.formOpinionConfig
-      if (hasBindNode) {
-        // 1、有流程节点绑定的流程意见
-        const nodeData = opinionData.formOpinionNodeData
-        for (const key in this.responseOpinionFields) {
-          if (this.responseOpinionFields.hasOwnProperty(key)) {
-            if (formOpinionConfig[key]) {
-              this.responseFormOpinionData[key] = nodeData[key]
+                ? FormOptions.t.PERMISSIONS.READ
+                : rightsValue
+            }
+            return rightsValue
+        },
+        // 初始化需要进行公式计算的字段
+        initResponseFormula(item) {
+            FormUtils.setResponseFormula(this.responseFormula, item, this.code)
+        },
+        // 初始化运行公式计算
+        initRunCalFormula() {
+            // 不需要字段的进行公式计算 比如获取但其当前时间
+            FormUtils.runCalFormula(
+                this,
+                this.responseFormula[FormUtils.NOT_NEED_FIELD],
+                this.formDef.code
+            )
+        },
+        // 初始化联动数据
+        initResponseLinkages(item) {
+            FormUtils.setResponseLinkages(this.responseLinkages, item, this.code)
+        },
+        // 初始化表单意见
+        initResponseOpinionData() {
+            this.responseFormOpinionData = {}
+            const opinionData = this.params ? this.params.formOpinionData || {} : {}
+            if (this.$utils.isEmpty(opinionData) || !this.hasFormOpinion()) {
+                return
+            }
+            const hasBindNode = opinionData.hasBindNode
+            const formOpinionConfig = opinionData.formOpinionConfig
+            if (hasBindNode) {
+                // 1、有流程节点绑定的流程意见
+                const nodeData = opinionData.formOpinionNodeData
+                for (const key in this.responseOpinionFields) {
+                    if (this.responseOpinionFields.hasOwnProperty(key)) {
+                        if (formOpinionConfig[key]) {
+                            this.responseFormOpinionData[key] = nodeData[key]
+                        } else {
+                            this.responseFormOpinionData[key] = opinionData.opinionList
+                        }
+                    }
+                }
             } else {
-              this.responseFormOpinionData[key] = opinionData.opinionList
+                for (const key in this.responseOpinionFields) {
+                    if (this.responseOpinionFields.hasOwnProperty(key)) {
+                        this.responseFormOpinionData[key] = opinionData.opinionList
+                    }
+                }
             }
-          }
-        }
-      } else {
-        for (const key in this.responseOpinionFields) {
-          if (this.responseOpinionFields.hasOwnProperty(key)) {
-            this.responseFormOpinionData[key] = opinionData.opinionList
-          }
-        }
-      }
-    },
-    handleInput(data) {
-      // 这里没有上报event,直接就是value了
-      this.models = data
-    },
-    handleFormOpinion(opinionData) {
-      let data = ''
-      // 如果有多个,取最后一个
-      if (this.$utils.isNotEmpty(opinionData)) {
-        for (const o in opinionData) {
-          data = opinionData[o] || ''
-        }
-      }
-      this.opinionData = data
-    },
-    /**
+        },
+        handleInput(data) {
+            // 这里没有上报event,直接就是value了
+            this.models = data
+        },
+        handleFormOpinion(opinionData) {
+            let data = ''
+            // 如果有多个,取最后一个
+            if (this.$utils.isNotEmpty(opinionData)) {
+                for (const o in opinionData) {
+                    data = opinionData[o] || ''
+                }
+            }
+            this.opinionData = data
+        },
+        /**
        * 表单提交校验
        */
-    formSubmitVerify(callback) {
-      let flag = true
-      const verifys = this.formAttrs ? this.formAttrs.verifys : []
-      if (this.$utils.isEmpty(verifys)) {
-        callback(flag)
-        return
-      }
-      const formData = this.getFormData()
-      for (let i = 0; i < verifys.length; i++) {
-        const verify = verifys[i]
-        if (
-          !FormUtils.runFormSubmitVerify(
-            verify.formula,
-            formData,
-            this.formDef.code
-          )
-        ) {
-          flag = false
-          callback(flag, verify.msg)
-          return
-        }
-      }
-      flag = true
-      callback(flag)
-    },
-    /**
+        formSubmitVerify(callback) {
+            let flag = true
+            const verifys = this.formAttrs ? this.formAttrs.verifys : []
+            if (this.$utils.isEmpty(verifys)) {
+                callback(flag)
+                return
+            }
+            const formData = this.getFormData()
+            for (let i = 0; i < verifys.length; i++) {
+                const verify = verifys[i]
+                if (
+                    !FormUtils.runFormSubmitVerify(
+                        verify.formula,
+                        formData,
+                        this.formDef.code
+                    )
+                ) {
+                    flag = false
+                    callback(flag, verify.msg)
+                    return
+                }
+            }
+            flag = true
+            callback(flag)
+        },
+        /**
        * 获取表单数据
        */
-    getFormData() {
-      const data = {}
-      // 去除文本字段,表单意见字段
-      for (var key in this.models) {
-        if (
-          !this.responseOpinionFields[key] &&
+        getFormData() {
+            const data = {}
+            // 去除文本字段,表单意见字段
+            for (var key in this.models) {
+                if (
+                    !this.responseOpinionFields[key] &&
             !this.responseLabelFields[key]
-        ) {
-          data[key] = this.models[key]
-        }
-      }
-      return data
-    },
-    /**
+                ) {
+                    data[key] = this.models[key]
+                }
+            }
+            return data
+        },
+        /**
        * 设置表单字段数据
        */
-    setFieldData(name, value) {
-      this.models[name] = value
-    },
-    /**
+        setFieldData(name, value) {
+            this.models[name] = value
+        },
+        /**
            * 设置表单权限
            */
-    getFormRights(name) {
-      return this.rights[name]
-    },
-    /**
+        getFormRights(name) {
+            return this.rights[name]
+        },
+        /**
        * 设置表单权限
        */
-    setFormRights(name, value) {
-      this.rights[name] = value
-    },
-    // 表单关联
-    getTableList(list) {
-      this.titleList = list
-    },
-    // 将对象参数传入, 进行渲染
-    getStatisOrRecord(type) {
-      this.record = type
-    },
-    /**
+        setFormRights(name, value) {
+            this.rights[name] = value
+        },
+        // 表单关联
+        getTableList(list) {
+            this.titleList = list
+        },
+        // 将对象参数传入, 进行渲染
+        getStatisOrRecord(type) {
+            this.record = type
+        },
+        /**
        *  是否有审批意见字段
        */
-    hasFormOpinion() {
-      return this.$utils.isNotEmpty(this.responseOpinionFields)
-    },
-    /**
+        hasFormOpinion() {
+            return this.$utils.isNotEmpty(this.responseOpinionFields)
+        },
+        /**
        * 获取审批意见数据
        */
-    getFormOpinionData() {
-      const data = {}
-      for (var key in this.models) {
-        if (
-          this.responseOpinionFields[key] &&
+        getFormOpinionData() {
+            const data = {}
+            for (var key in this.models) {
+                if (
+                    this.responseOpinionFields[key] &&
             (this.$utils.isEmpty(this.rights[key]) ||
               this.rights[key] ===
               (FormOptions.t.PERMISSIONS.EDIT ||
                 FormOptions.t.PERMISSIONS.REQUIRED))
-        ) {
-          data[key] = this.models[key]
-        }
-      }
-      return data
-    },
-    /**
+                ) {
+                    data[key] = this.models[key]
+                }
+            }
+            return data
+        },
+        /**
        * 获取审批意见验证
        */
-    formOpinionValidate(callback, flag = false) {
-      if (this.$utils.isEmpty(this.responseOpinionFields)) {
-        callback(true)
-        return
-      }
-      let i = 0
-      if (flag) {
-        for (const key in this.responseOpinionFields) {
-          if (
-            this.$utils.isEmpty(this.models[key]) &&
+        formOpinionValidate(callback, flag = false) {
+            if (this.$utils.isEmpty(this.responseOpinionFields)) {
+                callback(true)
+                return
+            }
+            let i = 0
+            if (flag) {
+                for (const key in this.responseOpinionFields) {
+                    if (
+                        this.$utils.isEmpty(this.models[key]) &&
               (this.$utils.isEmpty(this.rights[key]) ||
                 this.rights[key] === FormOptions.t.PERMISSIONS.EDIT ||
                 this.rights[key] === FormOptions.t.PERMISSIONS.REQUIRED)
-          ) {
-            i++
-          }
-        }
-      } else {
-        for (const key in this.responseOpinionFields) {
-          if (
-            this.$utils.isEmpty(this.models[key]) &&
+                    ) {
+                        i++
+                    }
+                }
+            } else {
+                for (const key in this.responseOpinionFields) {
+                    if (
+                        this.$utils.isEmpty(this.models[key]) &&
               this.rights[key] === FormOptions.t.PERMISSIONS.REQUIRED
-          ) {
-            i++
-          }
-        }
-      }
+                    ) {
+                        i++
+                    }
+                }
+            }
 
-      if (i > 0) {
-        callback(false)
-      } else {
-        callback(true)
-      }
-    },
-    /**
+            if (i > 0) {
+                callback(false)
+            } else {
+                callback(true)
+            }
+        },
+        /**
        * 表单验证
        */
-    getFormValidator() {
-      this.$refs.form.resetValidation()
-      return this.$refs.form.validate()
-    },
-    /**
+        getFormValidator() {
+            this.$refs.form.resetValidation()
+            return this.$refs.form.validate()
+        },
+        /**
        * 表单验证错误信息
        */
-    scrollToField(name) {
-      return this.$refs.form.scrollToField(name)
+        scrollToField(name) {
+            return this.$refs.form.scrollToField(name)
+        }
     }
-  }
 }
 </script>

+ 469 - 467
src/business/platform/form/formrender/formrender.vue

@@ -1,39 +1,41 @@
 <template>
-  <div class="van-fr ibps-fixed-toolbar">
-    <!-- fr-header  表头-->
-    <slot v-if="formDef.name" name="fr-header">
-      <div class="van-block__title van-ellipsis">
-        {{ formDef.name }}
-      </div>
-      <div v-if="formDef.desc" class="van-block__desc">
-        {{ formDef.desc }}
-      </div>
-    </slot>
-    <!-- fr-header  表单内容-->
-    <div :style="bodyStyle" class="van-fr-body">
-      <ibps-dynamic-form
-ref="dynamicForm"
-v-model="formData"
-:form-def="formDefData"
-:permissions="permissions"
-        :readonly="readonly"
-:params="params"
-:input-align="inputAlign"
-:initialization="initialization"
-        :cur-active-step.sync="curActiveStep"
-@load-script="loadScript" />
+    <div class="van-fr ibps-fixed-toolbar">
+        <!-- fr-header  表头-->
+        <slot v-if="formDef.name" name="fr-header">
+            <div class="van-block__title van-ellipsis">
+                {{ formDef.name }}
+            </div>
+            <div v-if="formDef.desc" class="van-block__desc">
+                {{ formDef.desc }}
+            </div>
+        </slot>
+        <!-- fr-header  表单内容-->
+        <div :style="bodyStyle" class="van-fr-body">
+            <ibps-dynamic-form
+                ref="dynamicForm"
+                v-model="formData"
+                :form-def="formDefData"
+                :permissions="permissions"
+                :readonly="readonly"
+                :params="params"
+                :input-align="inputAlign"
+                :initialization="initialization"
+                :cur-active-step.sync="curActiveStep"
+                @load-script="loadScript"
+            />
+        </div>
+        <!-- fr-toolbar  表单操作按钮-->
+        <slot name="fr-toolbar">
+            <ibps-toolbar
+                v-if="hasActions"
+                ref="frToolbar"
+                :actions="actions"
+                :more-actions="moreActions"
+                icon-prefix="ibps-icon"
+            />
+        </slot>
+        <slot ref="frExt" name="fr-ext" />
     </div>
-    <!-- fr-toolbar  表单操作按钮-->
-    <slot name="fr-toolbar">
-      <ibps-toolbar
-v-if="hasActions"
-ref="frToolbar"
-:actions="actions"
-:more-actions="moreActions"
-        icon-prefix="ibps-icon" />
-    </slot>
-    <slot ref="frExt" name="fr-ext" />
-  </div>
 </template>
 
 <script>
@@ -44,31 +46,31 @@ import IbpsToolbar from '@/components/ibps-toolbar' // 工具栏
 const JFormId = 'JForm'
 
 export default {
-  components: {
-    IbpsToolbar
-  },
-  props: {
-    formDef: {
-      type: Object,
-      required: true
-    },
-    data: {
-      type: Object
-    },
-    /**
+    components: {
+        IbpsToolbar
+    },
+    props: {
+        formDef: {
+            type: Object,
+            required: true
+        },
+        data: {
+            type: Object
+        },
+        /**
        * @description 工具栏
        */
-    buttons: {
-      type: Array
-    },
-    /**
+        buttons: {
+            type: Array
+        },
+        /**
        * 是否只读 (流程实例时候控制)
        */
-    readonly: {
-      type: Boolean,
-      default: false
-    },
-    /**
+        readonly: {
+            type: Boolean,
+            default: false
+        },
+        /**
        *  @description 扩展参数 比如流程id等
        *流程相关信息:
        * taskId:任务id
@@ -76,464 +78,464 @@ export default {
        * defId:定义Id
        * formOpinionData: 流程意见配置及已经审批的意见数据
        */
-    params: {
-      type: Object
-    },
-    mode: {
-      // 表单模式
-      type: String
+        params: {
+            type: Object
+        },
+        mode: {
+            // 表单模式
+            type: String
+        },
+        inputAlign: {
+            type: String
+        }
     },
-    inputAlign: {
-      type: String
-    }
-  },
-  data() {
-    return {
-      loading: false,
-      formData: {},
-      permissions: null,
-      initialization: false,
-      formParams: {},
-      curActiveStep: 0,
-      curTime: new Date().getTime(),
-      stepLoading: false,
+    data() {
+        return {
+            loading: false,
+            formData: {},
+            permissions: null,
+            initialization: false,
+            formParams: {},
+            curActiveStep: 0,
+            curTime: new Date().getTime(),
+            stepLoading: false,
 
-      btnNum: this.getBtnNumByWidth()
-    }
-  },
-  computed: {
-    formDefData() {
-      return JSON.parse(JSON.stringify(this.formDef))
+            btnNum: this.getBtnNumByWidth()
+        }
     },
+    computed: {
+        formDefData() {
+            return JSON.parse(JSON.stringify(this.formDef))
+        },
 
-    actions() {
-      if (this.toolbars.length > this.btnNum) {
-        return this.toolbars.slice(0, this.btnNum)
-      } else {
-        return this.toolbars
-      }
-    },
-    moreActions() {
-      if (this.toolbars.length > this.btnNum) {
-        return this.toolbars.slice(this.btnNum, this.toolbars.length)
-      } else {
-        return null
-      }
-    },
-    toolbars() {
-      return this.getActions()
-    },
-    hasActions() {
-      // this.hasStepButton ||
-      return this.actions && this.actions.length > 0
-    },
-    dynamicForm() {
-      return this.$refs ? this.$refs.dynamicForm : null
-    },
-    hasStepButton() {
-      return this.$utils.isNotEmpty(this.stepButtons) && this.mode !== 'dialog'
-    },
-    stepNum() {
-      if (this.$utils.isEmpty(this.step)) {
-        return 0
-      }
-      return this.step.field_options.columns.length
-    },
-    finishStep() {
-      return this.stepNum - 1 === this.curActiveStep
-    },
-    stepButtons() {
-      return this.getStepButtons()
-    },
-    step() {
-      return this.getFormStep()
-    },
-    bodyStyle() {
-      if (this.$isServer) {
-        return
-      }
-      // header高度82px, fr actions高度50px,如果改动了样式自己传下bodyOffsetTop调整下
-      const maxHeight = window.innerHeight - this.bodyOffsetTop
-      return {
-        maxHeight: maxHeight + 'px'
-      }
-    }
-  },
-  watch: {
-    formDef: {
-      handler: function(val, oldVal) {
-        if (val && val !== oldVal) {
-          this.initialization = false
-          this.initUI()
+        actions() {
+            if (this.toolbars.length > this.btnNum) {
+                return this.toolbars.slice(0, this.btnNum)
+            } else {
+                return this.toolbars
+            }
+        },
+        moreActions() {
+            if (this.toolbars.length > this.btnNum) {
+                return this.toolbars.slice(this.btnNum, this.toolbars.length)
+            } else {
+                return null
+            }
+        },
+        toolbars() {
+            return this.getActions()
+        },
+        hasActions() {
+            // this.hasStepButton ||
+            return this.actions && this.actions.length > 0
+        },
+        dynamicForm() {
+            return this.$refs ? this.$refs.dynamicForm : null
+        },
+        hasStepButton() {
+            return this.$utils.isNotEmpty(this.stepButtons) && this.mode !== 'dialog'
+        },
+        stepNum() {
+            if (this.$utils.isEmpty(this.step)) {
+                return 0
+            }
+            return this.step.field_options.columns.length
+        },
+        finishStep() {
+            return this.stepNum - 1 === this.curActiveStep
+        },
+        stepButtons() {
+            return this.getStepButtons()
+        },
+        step() {
+            return this.getFormStep()
+        },
+        bodyStyle() {
+            if (this.$isServer) {
+                return
+            }
+            // header高度82px, fr actions高度50px,如果改动了样式自己传下bodyOffsetTop调整下
+            const maxHeight = window.innerHeight - this.bodyOffsetTop
+            return {
+                maxHeight: maxHeight + 'px'
+            }
         }
-      },
-      immediate: true
     },
-    data: {
-      handler: function(val, oldVal) {
-        if (val && val !== oldVal) {
-          const data = JSON.parse(JSON.stringify(val))
-          // 表单数据
-          this.formData = data.responses || {}
-          // 表单权限
-          this.permissions = data.permissions || null
+    watch: {
+        formDef: {
+            handler: function(val, oldVal) {
+                if (val && val !== oldVal) {
+                    this.initialization = false
+                    this.initUI()
+                }
+            },
+            immediate: true
+        },
+        data: {
+            handler: function(val, oldVal) {
+                if (val && val !== oldVal) {
+                    const data = JSON.parse(JSON.stringify(val))
+                    // 表单数据
+                    this.formData = data.responses || {}
+                    // 表单权限
+                    this.permissions = data.permissions || null
+                }
+            },
+            immediate: true,
+            deep: true
+        },
+        curActiveStep() {
+            this.$emit('cur-active-step', this.curActiveStep)
         }
-      },
-      immediate: true,
-      deep: true
     },
-    curActiveStep() {
-      this.$emit('cur-active-step', this.curActiveStep)
-    }
-  },
-  created() {
-    this.initUI()
-  },
-  destroyed() {
-    const script = document.getElementById(JFormId)
-    if (script) {
-      script.parentNode.removeChild(script)
-    }
-  },
-  methods: {
-    getBtnNumByWidth() {
-      const width = document.documentElement.clientWidth
-      if (width >= 375) return 3
-      else return 2
+    created() {
+        this.initUI()
     },
-    initUI() {
-      if (!this.initialization) {
-        this.initJForm()
-        this.initialization = true
-        this.$nextTick(() => {
-          setTimeout(() => {
-            this.loadScript()
-          }, 10)
-        })
-      }
+    destroyed() {
+        const script = document.getElementById(JFormId)
+        if (script) {
+            script.parentNode.removeChild(script)
+        }
     },
-    getActions() {
-      if (this.$utils.isEmpty(this.buttons)) {
-        return []
-      }
+    methods: {
+        getBtnNumByWidth() {
+            const width = document.documentElement.clientWidth
+            if (width >= 375) return 3
+            else return 2
+        },
+        initUI() {
+            if (!this.initialization) {
+                this.initJForm()
+                this.initialization = true
+                this.$nextTick(() => {
+                    setTimeout(() => {
+                        this.loadScript()
+                    }, 10)
+                })
+            }
+        },
+        getActions() {
+            if (this.$utils.isEmpty(this.buttons)) {
+                return []
+            }
 
-      const actions = []
-      this.buttons.forEach((btn, i) => {
-        const key = btn.getAlias()
-        let disabled = false
-        let hidden = false
-        // if (btn.getAlias() !== 'close' && this.hasStepButton && !this.finishStep) {
-        //   disabled = true
-        // }
+            const actions = []
+            this.buttons.forEach((btn, i) => {
+                const key = btn.getAlias()
+                let disabled = false
+                let hidden = false
+                // if (btn.getAlias() !== 'close' && this.hasStepButton && !this.finishStep) {
+                //   disabled = true
+                // }
 
-        hidden = this.onLoadActions(key, btn, 'hidden', hidden)
-        disabled = this.onLoadActions(key, btn, 'disabled', disabled)
+                hidden = this.onLoadActions(key, btn, 'hidden', hidden)
+                disabled = this.onLoadActions(key, btn, 'disabled', disabled)
 
-        const button = {
-          key: key,
-          name: btn.getLabel(),
-          icon: btn.getIcon(),
-          type: btn.getStyle(),
-          plain: btn.getPlain(),
-          disabled: disabled,
-          hidden: hidden,
-          callback: () => {
-            if (i >= this.btnNum) {
-              this.closeMoreAction()
+                const button = {
+                    key: key,
+                    name: btn.getLabel(),
+                    icon: btn.getIcon(),
+                    type: btn.getStyle(),
+                    plain: btn.getPlain(),
+                    disabled: disabled,
+                    hidden: hidden,
+                    callback: () => {
+                        if (i >= this.btnNum) {
+                            this.closeMoreAction()
+                        }
+                        // 前置事件
+                        this.beforeScript(btn.getAlias(), result => {
+                            if (result) {
+                                return btn.action.apply(this, [btn])
+                            }
+                        })
+                    }
+                }
+                actions.push(button)
+            })
+            return actions
+        },
+        closeMoreAction() {
+            this.$refs.frToolbar.closeMoreAction()
+        },
+        // 自定义按钮数据事件
+        onLoadActions: function(key, button, type, defaultVal) {
+            const buttonActionResult = JForm._onLoadActions(this, key, button, type)
+            if (typeof buttonActionResult !== 'undefined' && buttonActionResult) {
+                return true
             }
-            // 前置事件
-            this.beforeScript(btn.getAlias(), result => {
-              if (result) {
-                return btn.action.apply(this, [btn])
-              }
+            return defaultVal
+        },
+        handleButtonEvent(button, position, data, index) {
+            const action = this.actions.find(action => {
+                return button.key === action.key
             })
-          }
-        }
-        actions.push(button)
-      })
-      return actions
-    },
-    closeMoreAction() {
-      this.$refs.frToolbar.closeMoreAction()
-    },
-    // 自定义按钮数据事件
-    onLoadActions: function(key, button, type, defaultVal) {
-      const buttonActionResult = JForm._onLoadActions(this, key, button, type)
-      if (typeof buttonActionResult !== 'undefined' && buttonActionResult) {
-        return true
-      }
-      return defaultVal
-    },
-    handleButtonEvent(button, position, data, index) {
-      const action = this.actions.find(action => {
-        return button.key === action.key
-      })
-      if (action) {
-        action.callback()
-      }
-    },
-    handleActionEvent(actionKey, args = {}) {
-      this.$emit('action-event', actionKey, args)
-    },
-    disabledStepButton(key) {
-      if (key === 'prev') {
-        return this.curActiveStep === 0
-      } else {
-        return this.stepNum - 1 === this.curActiveStep
-      }
-    },
-    /** **Step 处理 */
-    getStepButtons() {
-      if (this.$utils.isEmpty(this.step)) {
-        return []
-      }
-      if (this.$utils.isNotEmpty(this.step.field_options.buttons)) {
-        return this.step.field_options.buttons
-      } else {
-        const defaultButtons = [
-          {
-            key: 'prev',
-            icon: 'angle-left',
-            label: '上一步'
-          },
-          {
-            key: 'next',
-            icon: 'angle-right',
-            label: '下一步'
-          }
-        ]
-        return defaultButtons
-      }
-    },
-    getFormStep() {
-      const step = {}
-      if (this.$utils.isEmpty(this.formDef)) {
-        return
-      }
-      for (let i = 0; i < this.formDef.fields.length; i++) {
-        const field = this.formDef.fields[i]
-        if (field.field_type === 'steps') {
-          return field
-        }
-      }
-      return step
-    },
-    handleStepButtonEvent(button) {
-      const key = button.key
-      if (key === 'next' && this.curActiveStep === this.stepNum - 1) {
-        ActionUtils.warning('没有更多')
-        return
-      }
-      if (key === 'prev' && this.curActiveStep === 0) {
-        ActionUtils.warning('没有上一步')
-        return
-      }
-      this.stepLoading = true
-      const curDate = new Date().getTime()
-      let time = 0
-      if (this.curTime + 1500 >= curDate) {
-        time = 1000
-      }
-      this.curTime = curDate
-      setTimeout(() => {
-        if (key === 'next') {
-          this.validate(valid => {
-            if (valid) {
-              this.curActiveStep++
+            if (action) {
+                action.callback()
+            }
+        },
+        handleActionEvent(actionKey, args = {}) {
+            this.$emit('action-event', actionKey, args)
+        },
+        disabledStepButton(key) {
+            if (key === 'prev') {
+                return this.curActiveStep === 0
             } else {
-              this.formErrorToast()
+                return this.stepNum - 1 === this.curActiveStep
             }
-          })
-        } else {
-          this.curActiveStep--
-        }
-        this.stepLoading = false
-      }, time)
-    },
-    callback() {
-      this.$emit('callback')
-    },
-    closeDialog() {
-      this.$emit('close')
-    },
-    getForm() {
-      return this.$refs.dynamicForm
-    },
-    getFormValidator() {
-      return this.getForm().getFormValidator()
-    },
-    /**
+        },
+        /** **Step 处理 */
+        getStepButtons() {
+            if (this.$utils.isEmpty(this.step)) {
+                return []
+            }
+            if (this.$utils.isNotEmpty(this.step.field_options.buttons)) {
+                return this.step.field_options.buttons
+            } else {
+                const defaultButtons = [
+                    {
+                        key: 'prev',
+                        icon: 'angle-left',
+                        label: '上一步'
+                    },
+                    {
+                        key: 'next',
+                        icon: 'angle-right',
+                        label: '下一步'
+                    }
+                ]
+                return defaultButtons
+            }
+        },
+        getFormStep() {
+            const step = {}
+            if (this.$utils.isEmpty(this.formDef)) {
+                return
+            }
+            for (let i = 0; i < this.formDef.fields.length; i++) {
+                const field = this.formDef.fields[i]
+                if (field.field_type === 'steps') {
+                    return field
+                }
+            }
+            return step
+        },
+        handleStepButtonEvent(button) {
+            const key = button.key
+            if (key === 'next' && this.curActiveStep === this.stepNum - 1) {
+                ActionUtils.warning('没有更多')
+                return
+            }
+            if (key === 'prev' && this.curActiveStep === 0) {
+                ActionUtils.warning('没有上一步')
+                return
+            }
+            this.stepLoading = true
+            const curDate = new Date().getTime()
+            let time = 0
+            if (this.curTime + 1500 >= curDate) {
+                time = 1000
+            }
+            this.curTime = curDate
+            setTimeout(() => {
+                if (key === 'next') {
+                    this.validate(valid => {
+                        if (valid) {
+                            this.curActiveStep++
+                        } else {
+                            this.formErrorToast()
+                        }
+                    })
+                } else {
+                    this.curActiveStep--
+                }
+                this.stepLoading = false
+            }, time)
+        },
+        callback() {
+            this.$emit('callback')
+        },
+        closeDialog() {
+            this.$emit('close')
+        },
+        getForm() {
+            return this.$refs.dynamicForm
+        },
+        getFormValidator() {
+            return this.getForm().getFormValidator()
+        },
+        /**
        * 获取表单验证
        */
-    validate(callback) {
-      this.getFormValidator()
-        .then(() => {
-          callback(true)
-        })
-        .catch(e => {
-          if (e && e[0]) {
-            this.getForm().scrollToField(e[0].name)
-          }
-          callback(false, e)
-        })
-    },
-    formErrorToast(e) {
-      this.$notify({
-        type: 'warning',
-        message: this.$t('common.formError')
-      })
-    },
-    // 处理表单提交验证
-    formSubmitVerify(callback) {
-      if (!this.hasScript()) {
-        if (callback) {
-          this.getForm().formSubmitVerify(callback)
-        }
-        return
-      }
+        validate(callback) {
+            this.getFormValidator()
+                .then(() => {
+                    callback(true)
+                })
+                .catch(e => {
+                    if (e && e[0]) {
+                        this.getForm().scrollToField(e[0].name)
+                    }
+                    callback(false, e)
+                })
+        },
+        formErrorToast(e) {
+            this.$notify({
+                type: 'warning',
+                message: this.$t('common.formError')
+            })
+        },
+        // 处理表单提交验证
+        formSubmitVerify(callback) {
+            if (!this.hasScript()) {
+                if (callback) {
+                    this.getForm().formSubmitVerify(callback)
+                }
+                return
+            }
 
-      JForm._onValidate(this, (result, errorMsg) => {
-        if (!result) {
-          return callback(result, errorMsg || '验证不通过,请检查表单')
-        }
-        this.getForm().formSubmitVerify(callback)
-      })
-    },
+            JForm._onValidate(this, (result, errorMsg) => {
+                if (!result) {
+                    return callback(result, errorMsg || '验证不通过,请检查表单')
+                }
+                this.getForm().formSubmitVerify(callback)
+            })
+        },
 
-    /**
+        /**
        * 获取表单数据
        */
-    getFormData() {
-      return this.getForm().getFormData()
-    },
-    /**
+        getFormData() {
+            return this.getForm().getFormData()
+        },
+        /**
        * 获取字段数据
        */
-    getData(name) {
-      const data = this.getFormData()
-      return data[name]
-    },
-    /**
+        getData(name) {
+            const data = this.getFormData()
+            return data[name]
+        },
+        /**
        * 设置字段数据
        */
-    setData(name, value) {
-      return this.getForm().setFieldData(name, value)
-    },
-    /**
+        setData(name, value) {
+            return this.getForm().setFieldData(name, value)
+        },
+        /**
        * 设置表单权限
        */
-    getFormRights(name) {
-      return this.getForm().getFormRights(name)
-    },
-    /**
+        getFormRights(name) {
+            return this.getForm().getFormRights(name)
+        },
+        /**
        * 设置表单权限
        */
-    setFormRights(name, value) {
-      return this.getForm().setFormRights(name, value)
-    },
-    hasFormOpinion() {
-      return this.getForm().hasFormOpinion()
-    },
-    /**
+        setFormRights(name, value) {
+            return this.getForm().setFormRights(name, value)
+        },
+        hasFormOpinion() {
+            return this.getForm().hasFormOpinion()
+        },
+        /**
        * 表单意见数据
        */
-    getFormOpinionData() {
-      return this.getForm().getFormOpinionData()
-    },
-    /**
+        getFormOpinionData() {
+            return this.getForm().getFormOpinionData()
+        },
+        /**
        * 获取审批意见验证
        */
-    formOpinionValidate(calback, flag) {
-      this.getForm().formOpinionValidate(calback, flag)
-    },
+        formOpinionValidate(calback, flag) {
+            this.getForm().formOpinionValidate(calback, flag)
+        },
 
-    /**
+        /**
            * 获取表单字段组件实例
            */
-    getRefs(fieldName) {
-      return this.getForm().getRefs(fieldName)
-    },
-    /**
+        getRefs(fieldName) {
+            return this.getForm().getRefs(fieldName)
+        },
+        /**
        * 获取表单字段的具体控件组件实例
        */
-    getRefsField(fieldName) {
-      return this.getForm().getRefsField(fieldName)
-    },
-    /* 给与表头赋值关联对话框及数据*/
-    getTableList(list) {
-      return this.getForm().getTableList(list)
-    },
-    /* 获取统计页面或记录页面*/
-    getStatisOrRecord(type) {
-      return this.getForm().getStatisOrRecord(type)
-    },
-    /* 表头点击事件*/
-    clickTableHeand(a) {
-      return this.getForm().clickTableHeand(a)
-    },
+        getRefsField(fieldName) {
+            return this.getForm().getRefsField(fieldName)
+        },
+        /* 给与表头赋值关联对话框及数据*/
+        getTableList(list) {
+            return this.getForm().getTableList(list)
+        },
+        /* 获取统计页面或记录页面*/
+        getStatisOrRecord(type) {
+            return this.getForm().getStatisOrRecord(type)
+        },
+        /* 表头点击事件*/
+        clickTableHeand(a) {
+            return this.getForm().clickTableHeand(a)
+        },
 
-    /**
+        /**
        * 初始化脚本
        */
-    initJForm() {
-      let script = document.getElementById(JFormId)
-      if (script) {
-        script.parentNode.removeChild(script)
-      }
-      if (
-        this.formDef.attrs &&
+        initJForm() {
+            let script = document.getElementById(JFormId)
+            if (script) {
+                script.parentNode.removeChild(script)
+            }
+            if (
+                this.formDef.attrs &&
           (this.formDef.attrs.mobile_script || this.formDef.attrs.script)
-      ) {
-        const codeScript =
+            ) {
+                const codeScript =
             this.formDef.attrs.mobile_script || this.formDef.attrs.script
-        script = document.createElement('script')
-        script.type = 'text/javascript'
-        script.id = JFormId
-        document.body.appendChild(script)
-        try {
-          script.appendChild(document.createTextNode(codeScript))
-        } catch (ex) {
-          console.error(ex)
-          script.text = codeScript
-        }
-        document.body.appendChild(script)
-      }
-    },
-    // 处理脚本
-    hasScript() {
-      return this.getForm().hasScript
-    },
-    // 加载脚本
-    loadScript() {
-      this.$emit('load', this)
-      if (!this.hasScript()) {
-        return
-      }
-      JForm._onLoad(this, this.getForm)
-    },
-    // 前置脚本
-    beforeScript(action, callback) {
-      if (!this.hasScript()) {
-        if (callback) {
-          const flag = true
-          callback(flag)
-        }
-        return
-      }
-      JForm._beforeSubmit(this, action, this.getFormData(), callback)
-    },
-    // 后置脚本
-    afterScript(action, params, callback) {
-      this.formParams = params
-      if (!this.hasScript()) {
-        if (callback) {
-          const flag = true
-          callback(flag)
+                script = document.createElement('script')
+                script.type = 'text/javascript'
+                script.id = JFormId
+                document.body.appendChild(script)
+                try {
+                    script.appendChild(document.createTextNode(codeScript))
+                } catch (ex) {
+                    console.error(ex)
+                    script.text = codeScript
+                }
+                document.body.appendChild(script)
+            }
+        },
+        // 处理脚本
+        hasScript() {
+            return this.getForm().hasScript
+        },
+        // 加载脚本
+        loadScript() {
+            this.$emit('load', this)
+            if (!this.hasScript()) {
+                return
+            }
+            JForm._onLoad(this, this.getForm)
+        },
+        // 前置脚本
+        beforeScript(action, callback) {
+            if (!this.hasScript()) {
+                if (callback) {
+                    const flag = true
+                    callback(flag)
+                }
+                return
+            }
+            JForm._beforeSubmit(this, action, this.getFormData(), callback)
+        },
+        // 后置脚本
+        afterScript(action, params, callback) {
+            this.formParams = params
+            if (!this.hasScript()) {
+                if (callback) {
+                    const flag = true
+                    callback(flag)
+                }
+                return
+            }
+            JForm._afterSubmit(this, action, this.getFormData(), callback)
         }
-        return
-      }
-      JForm._afterSubmit(this, action, this.getFormData(), callback)
     }
-  }
 }
 </script>

+ 105 - 105
src/business/platform/form/utils/JForm.js

@@ -18,123 +18,123 @@ import router from '@/router'
 // 定义全局
 var JForm
 if (!window.JForm) {
-  JForm = window.JForm = {}
+    JForm = window.JForm = {}
 } else {
-  JForm = window.JForm
+    JForm = window.JForm
 }
 /**
  * 封装自定义代码扩展接口
  */
 _.extend(JForm, {
-  // 已经初始化
-  // _request: request,
-  _isInitialization: false,
-  _isLoadJavaScriptFile: false,
-  // 初始化表单
-  _init: function(form) {
-    if (this._isInitialization) return
-    this.$form = form
-    this.$vue = Vue
-    this.$request = request
-    this.$common = common
-    this.$router = router
-    this.$store = store
-    this.$import = _import
-    this._ = _
-    this._isInitialization = true
-    this.$loading = Vue.prototype.$loading
-  },
+    // 已经初始化
+    // _request: request,
+    _isInitialization: false,
+    _isLoadJavaScriptFile: false,
+    // 初始化表单
+    _init: function(form) {
+        if (this._isInitialization) return
+        this.$form = form
+        this.$vue = Vue
+        this.$request = request
+        this.$common = common
+        this.$router = router
+        this.$store = store
+        this.$import = _import
+        this._ = _
+        this._isInitialization = true
+        this.$loading = Vue.prototype.$loading
+    },
 
-  // 表单加载
-  _onLoad: function(form) {
-    this._init(form)
-    if (_.isFunction(this.onLoad)) {
-      this.onLoad(form)
-    }
-  },
+    // 表单加载
+    _onLoad: function(form) {
+        this._init(form)
+        if (_.isFunction(this.onLoad)) {
+            this.onLoad(form)
+        }
+    },
 
-  // 加载按钮
-  _onLoadActions: function(form, actions, button, type) {
-    if (_.isFunction(this.onLoadActions)) {
-      this.onLoadActions(form, actions, button, type)
-    }
-  },
+    // 加载按钮
+    _onLoadActions: function(form, actions, button, type) {
+        if (_.isFunction(this.onLoadActions)) {
+            this.onLoadActions(form, actions, button, type)
+        }
+    },
 
-  // 表单校验
-  _onValidate: function(form, callback) {
-    if (_.isFunction(this.onValidate)) {
-      return this.onValidate(form, callback)
-    }
-    if (_.isFunction(callback)) {
-      callback(true)
-    }
-  },
+    // 表单校验
+    _onValidate: function(form, callback) {
+        if (_.isFunction(this.onValidate)) {
+            return this.onValidate(form, callback)
+        }
+        if (_.isFunction(callback)) {
+            callback(true)
+        }
+    },
 
-  // 按钮提交前事件
-  _beforeSubmit: function(form, action, postValue, callback) {
-    if (_.isFunction(this.beforeSubmit)) {
-      try {
-        return this.beforeSubmit(form, action, postValue, callback)
-      } catch (e) {
-        return callback(true)
-      }
-    }
-    if (_.isFunction(callback)) {
-      callback(true)
-    }
-  },
+    // 按钮提交前事件
+    _beforeSubmit: function(form, action, postValue, callback) {
+        if (_.isFunction(this.beforeSubmit)) {
+            try {
+                return this.beforeSubmit(form, action, postValue, callback)
+            } catch (e) {
+                return callback(true)
+            }
+        }
+        if (_.isFunction(callback)) {
+            callback(true)
+        }
+    },
 
-  // 按钮提交后事件
-  _afterSubmit: function(form, action, postValue, callback) {
-    if (_.isFunction(this.afterSubmit)) {
-      return this.afterSubmit(form, action, postValue, callback)
-    }
-    if (_.isFunction(callback)) {
-      callback(true)
-    }
-  },
-  // 子表按钮的提交前事件
-  _beforeSubButton: function(tableForm, action, position, params, callback) {
-    if (_.isFunction(this.beforeSubButton)) {
-      return this.beforeSubButton(
-        tableForm,
-        action,
-        position,
-        params,
-        callback
-      )
-    }
-    if (_.isFunction(callback)) {
-      callback(true)
-    }
-  },
-  // 子表按钮的提交后事件
-  _afterSubButton: function(tableForm, action, position, params, callback) {
-    if (_.isFunction(this.afterSubButton)) {
-      return this.afterSubButton(tableForm, action, position, params, callback)
-    }
-    if (_.isFunction(callback)) {
-      callback(true)
-    }
-  },
-  // 子表统计
-  _summaryMethod: function(tableForm, tableName, params) {
-    if (_.isFunction(this.summaryMethod)) {
-      return this.summaryMethod(tableForm, tableName, params)
+    // 按钮提交后事件
+    _afterSubmit: function(form, action, postValue, callback) {
+        if (_.isFunction(this.afterSubmit)) {
+            return this.afterSubmit(form, action, postValue, callback)
+        }
+        if (_.isFunction(callback)) {
+            callback(true)
+        }
+    },
+    // 子表按钮的提交前事件
+    _beforeSubButton: function(tableForm, action, position, params, callback) {
+        if (_.isFunction(this.beforeSubButton)) {
+            return this.beforeSubButton(
+                tableForm,
+                action,
+                position,
+                params,
+                callback
+            )
+        }
+        if (_.isFunction(callback)) {
+            callback(true)
+        }
+    },
+    // 子表按钮的提交后事件
+    _afterSubButton: function(tableForm, action, position, params, callback) {
+        if (_.isFunction(this.afterSubButton)) {
+            return this.afterSubButton(tableForm, action, position, params, callback)
+        }
+        if (_.isFunction(callback)) {
+            callback(true)
+        }
+    },
+    // 子表统计
+    _summaryMethod: function(tableForm, tableName, params) {
+        if (_.isFunction(this.summaryMethod)) {
+            return this.summaryMethod(tableForm, tableName, params)
+        }
+    },
+    // 清理所有自定义事件
+    cleanEvents: function() {
+        this.onLoad = null
+        this.onLoadActions = null
+        this.onValidate = null
+        this.afterSubButton = null
+        this.beforeSubButton = null
+        this.summaryMethod = null
+        this.afterSubmit = null
+        this.beforeSubmit = null
+        this._isInitialization = false
     }
-  },
-  // 清理所有自定义事件
-  cleanEvents: function() {
-    this.onLoad = null
-    this.onLoadActions = null
-    this.onValidate = null
-    this.afterSubButton = null
-    this.beforeSubButton = null
-    this.summaryMethod = null
-    this.afterSubmit = null
-    this.beforeSubmit = null
-    this._isInitialization = false
-  }
 })
 
 export default JForm

+ 584 - 584
src/business/platform/org/selector/index.vue

@@ -1,210 +1,210 @@
 <template>
-  <div class="van-cell ibps-p-0">
-    <van-field
-      ref="input"
-      v-model="inputValue"
-      :label="label"
-      :name="name"
-      :size="size"
-      :border="border"
-      :disabled="disabled"
-      :required="required"
-      :clearable="clearable"
-      :clickable="clickable"
-      :is-link="isLink"
-      :error="error"
-      :error-message="errorMessage"
+    <div class="van-cell ibps-p-0">
+        <van-field
+            ref="input"
+            v-model="inputValue"
+            :label="label"
+            :name="name"
+            :size="size"
+            :border="border"
+            :disabled="disabled"
+            :required="required"
+            :clearable="clearable"
+            :clickable="clickable"
+            :is-link="isLink"
+            :error="error"
+            :error-message="errorMessage"
 
-      :arrow-direction="arrowDirection"
-      :label-class="labelClass"
-      :label-width="labelWidth"
-      :label-align="labelAlign"
-      :input-align="inputAlign"
-      :error-message-align="errorMessageAlign"
-      :autosize="autosize"
-      :left-icon="leftIcon"
-      :right-icon="rightIcon"
-      :icon-prefix="iconPrefix"
-      :rules="editable?rules:null"
-      class="ibps-selector"
-      readonly
-      @click-input="onClick"
-    >
-      <template #label>
-        {{ label }}<van-icon v-if="desc && descPosition==='lableIcon'" name="warning" class="ibps-dialog-icon" @click="$action.descDialog({ title:label, message:desc })" />
-      </template>
-      <template #input>
-        <!-- {{selectedData}} -->
-        <!-- <div style="display:none">{{ $utils.isEmpty(selectedData) }}</div> -->
-        <template v-if="selectedData==[]">
-          <template v-if="editable">
-            <!-- <van-icon
+            :arrow-direction="arrowDirection"
+            :label-class="labelClass"
+            :label-width="labelWidth"
+            :label-align="labelAlign"
+            :input-align="inputAlign"
+            :error-message-align="errorMessageAlign"
+            :autosize="autosize"
+            :left-icon="leftIcon"
+            :right-icon="rightIcon"
+            :icon-prefix="iconPrefix"
+            :rules="editable?rules:null"
+            class="ibps-selector"
+            readonly
+            @click-input="onClick"
+        >
+            <template #label>
+                {{ label }}<van-icon v-if="desc && descPosition==='lableIcon'" name="warning" class="ibps-dialog-icon" @click="$action.descDialog({ title:label, message:desc })" />
+            </template>
+            <template #input>
+                <!-- {{selectedData}} -->
+                <!-- <div style="display:none">{{ $utils.isEmpty(selectedData) }}</div> -->
+                <template v-if="selectedData==[]">
+                    <template v-if="editable">
+                        <!-- <van-icon
               slot="left-icon"
               name="add-o"
               class="van-cell__left-icon"
             /> -->
-            <!-- <div class="van-field__body">
+                        <!-- <div class="van-field__body">
               <input :placeholder="defaultPlaceholder" class="van-field__control" readonly>
             </div> -->
-            <van-tag
-              v-for="(item,index) in selectedData.slice(0,num) "
-              :key="item[valueKey]"
-              class="ibps-tag-span ibps-mr-8"
-              :color="color"
-              :text-color="textColor"
-              :plain="plain"
-            >
-              <template #default>
-                <div :class="multiple?'ibps-ellipsis':''">{{ item[labelKey] }}</div>
-                <div v-if="editable" class="ibps-tag-close"><van-icon name="clear" @click.stop="removeData(index)" /></div>
-              </template>
-            </van-tag>
-            <van-tag
-              v-if="selectedData.length>num"
-              :color="color"
-              :text-color="textColor"
-              :plain="plain"
-            >+{{ selectedData.length-num }}</van-tag>
-          </template>
-        </template>
-        <template v-else>
-          <div class="van-field__control">
-            <van-tag
-              v-for="(item,index) in selectedData.slice(0,num) "
-              :key="item[valueKey]"
-              class="ibps-tag-span ibps-mr-8"
-              :color="color"
-              :text-color="textColor"
-              :plain="plain"
-            >
-              <template #default>
-                <div :class="multiple?'ibps-ellipsis':''">{{ item[labelKey] }}</div>
-                <div v-if="editable" class="ibps-tag-close"><van-icon name="clear" @click.stop="removeData(index)" /></div>
-              </template>
-            </van-tag>
-            <van-tag
-              v-if="selectedData.length>num"
-              :color="color"
-              :text-color="textColor"
-              :plain="plain"
-            >+{{ selectedData.length-num }}</van-tag>
+                        <van-tag
+                            v-for="(item,index) in selectedData.slice(0,num) "
+                            :key="item[valueKey]"
+                            class="ibps-tag-span ibps-mr-8"
+                            :color="color"
+                            :text-color="textColor"
+                            :plain="plain"
+                        >
+                            <template #default>
+                                <div :class="multiple?'ibps-ellipsis':''">{{ item[labelKey] }}</div>
+                                <div v-if="editable" class="ibps-tag-close"><van-icon name="clear" @click.stop="removeData(index)" /></div>
+                            </template>
+                        </van-tag>
+                        <van-tag
+                            v-if="selectedData.length>num"
+                            :color="color"
+                            :text-color="textColor"
+                            :plain="plain"
+                        >+{{ selectedData.length-num }}</van-tag>
+                    </template>
+                </template>
+                <template v-else>
+                    <div class="van-field__control">
+                        <van-tag
+                            v-for="(item,index) in selectedData.slice(0,num) "
+                            :key="item[valueKey]"
+                            class="ibps-tag-span ibps-mr-8"
+                            :color="color"
+                            :text-color="textColor"
+                            :plain="plain"
+                        >
+                            <template #default>
+                                <div :class="multiple?'ibps-ellipsis':''">{{ item[labelKey] }}</div>
+                                <div v-if="editable" class="ibps-tag-close"><van-icon name="clear" @click.stop="removeData(index)" /></div>
+                            </template>
+                        </van-tag>
+                        <van-tag
+                            v-if="selectedData.length>num"
+                            :color="color"
+                            :text-color="textColor"
+                            :plain="plain"
+                        >+{{ selectedData.length-num }}</van-tag>
 
-          </div>
-        </template>
+                    </div>
+                </template>
 
-      </template>
-      <template #right-icon>
-        <van-icon name="arrow" class="ibps-gray-b2" @click="onClick" />
-      </template>
-    </van-field>
+            </template>
+            <template #right-icon>
+                <van-icon name="arrow" class="ibps-gray-b2" @click="onClick" />
+            </template>
+        </van-field>
 
-    <!-- <template v-if="editable">  // 下一版本初始化数据自己处理-->
-    <!--用户选择器 -->
-    <employee-selector
-      v-if="type ==='employee' || type ==='user'"
-      :show-popup="showPopup"
-      :value="selectedValue"
-      :multiple="multiple"
+        <!-- <template v-if="editable">  // 下一版本初始化数据自己处理-->
+        <!--用户选择器 -->
+        <employee-selector
+            v-if="type ==='employee' || type ==='user'"
+            :show-popup="showPopup"
+            :value="selectedValue"
+            :multiple="multiple"
 
-      :custom-party-type-options="customPartyTypeOptions"
-      :current-org-id="currentOrgId"
-      :party-type-id="partyTypeId"
-      :script="script"
-      :party-type-scope="partyTypeScope"
-      :is-use-scope="true"
+            :custom-party-type-options="customPartyTypeOptions"
+            :current-org-id="currentOrgId"
+            :party-type-id="partyTypeId"
+            :script="script"
+            :party-type-scope="partyTypeScope"
+            :is-use-scope="true"
 
-      :left-text="leftText"
-      :value-key="valueKey"
-      :label-key="labelKey"
+            :left-text="leftText"
+            :value-key="valueKey"
+            :label-key="labelKey"
 
-      :filter="fieldOptions && fieldOptions.filter"
+            :filter="fieldOptions && fieldOptions.filter"
 
-      @init-data="initData"
-      @cancel="onCancel"
-      @confirm="onConfirm"
-      @change-party-type="changePartyType "
-      @callbackData="callbackData"
-    />
+            @init-data="initData"
+            @cancel="onCancel"
+            @confirm="onConfirm"
+            @change-party-type="changePartyType "
+            @callbackData="callbackData"
+        />
 
-    <!--组织选择器 -->
-    <org-selector
-      v-if="type ==='org'"
-      :show-popup="showPopup"
-      :value="selectedValue"
-      :multiple="multiple"
+        <!--组织选择器 -->
+        <org-selector
+            v-if="type ==='org'"
+            :show-popup="showPopup"
+            :value="selectedValue"
+            :multiple="multiple"
 
-      :left-text="leftText"
-      :value-key="valueKey"
-      :label-key="labelKey"
+            :left-text="leftText"
+            :value-key="valueKey"
+            :label-key="labelKey"
 
-      :current-org-id="currentOrgId"
-      :party-type-id="partyTypeId"
-      :script="script"
-      :is-use-scope="true"
+            :current-org-id="currentOrgId"
+            :party-type-id="partyTypeId"
+            :script="script"
+            :is-use-scope="true"
 
-      :other-filter="fieldOptions &&fieldOptions.other_filter"
-      :other-filter-include-sub="fieldOptions &&fieldOptions.other_filter_include_sub"
-      :other-filter-condition="fieldOptions &&fieldOptions.other_filter_condition"
+            :other-filter="fieldOptions &&fieldOptions.other_filter"
+            :other-filter-include-sub="fieldOptions &&fieldOptions.other_filter_include_sub"
+            :other-filter-condition="fieldOptions &&fieldOptions.other_filter_condition"
 
-      @init-data="initData"
-      @cancel="onCancel"
-      @confirm="onConfirm"
-      @callbackData="callbackData"
-    />
+            @init-data="initData"
+            @cancel="onCancel"
+            @confirm="onConfirm"
+            @callbackData="callbackData"
+        />
 
-    <!--岗位选择器 -->
-    <position-selector
-      v-if="type ==='position'"
-      :show-popup="showPopup"
-      :value="selectedValue"
-      :multiple="multiple"
+        <!--岗位选择器 -->
+        <position-selector
+            v-if="type ==='position'"
+            :show-popup="showPopup"
+            :value="selectedValue"
+            :multiple="multiple"
 
-      :left-text="leftText"
-      :value-key="valueKey"
-      :label-key="labelKey"
+            :left-text="leftText"
+            :value-key="valueKey"
+            :label-key="labelKey"
 
-      :current-org-id="currentOrgId"
-      :party-type-id="partyTypeId"
-      :script="script"
-      :is-use-scope="true"
+            :current-org-id="currentOrgId"
+            :party-type-id="partyTypeId"
+            :script="script"
+            :is-use-scope="true"
 
-      :other-filter="fieldOptions &&fieldOptions.other_filter"
-      :other-filter-include-sub="fieldOptions &&fieldOptions.other_filter_include_sub"
-      :other-filter-condition="fieldOptions &&fieldOptions.other_filter_condition"
+            :other-filter="fieldOptions &&fieldOptions.other_filter"
+            :other-filter-include-sub="fieldOptions &&fieldOptions.other_filter_include_sub"
+            :other-filter-condition="fieldOptions &&fieldOptions.other_filter_condition"
 
-      @init-data="initData"
-      @cancel="onCancel"
-      @confirm="onConfirm"
-      @callbackData="callbackData"
-    />
+            @init-data="initData"
+            @cancel="onCancel"
+            @confirm="onConfirm"
+            @callbackData="callbackData"
+        />
 
-    <!--角色选择器 -->
-    <role-selector
-      v-if="type ==='role'"
-      :show-popup="showPopup"
-      :value="selectedValue"
-      :multiple="multiple"
+        <!--角色选择器 -->
+        <role-selector
+            v-if="type ==='role'"
+            :show-popup="showPopup"
+            :value="selectedValue"
+            :multiple="multiple"
 
-      :left-text="leftText"
-      :value-key="valueKey"
-      :label-key="labelKey"
+            :left-text="leftText"
+            :value-key="valueKey"
+            :label-key="labelKey"
 
-      :current-org-id="currentOrgId"
-      :party-type-id="partyTypeId"
-      :script="script"
-      :is-use-scope="true"
+            :current-org-id="currentOrgId"
+            :party-type-id="partyTypeId"
+            :script="script"
+            :is-use-scope="true"
 
-      :other-filter="fieldOptions &&fieldOptions.other_filter"
-      :other-filter-include-sub="fieldOptions &&fieldOptions.other_filter_include_sub"
-      :other-filter-condition="fieldOptions &&fieldOptions.other_filter_condition"
+            :other-filter="fieldOptions &&fieldOptions.other_filter"
+            :other-filter-include-sub="fieldOptions &&fieldOptions.other_filter_include_sub"
+            :other-filter-condition="fieldOptions &&fieldOptions.other_filter_condition"
 
-      @init-data="initData"
-      @cancel="onCancel"
-      @confirm="onConfirm"
-      @callbackData="callbackData"
-    />
+            @init-data="initData"
+            @cancel="onCancel"
+            @confirm="onConfirm"
+            @callbackData="callbackData"
+        />
     <!-- </template> -->
-  </div>
+    </div>
 </template>
 <script>
 import FieldMixin from '@/mixins/field'
@@ -217,427 +217,427 @@ import i18n from '@/utils/i18n' // Internationalization 国际化
 import { typeOptions as partyTypeOptions } from './constants'
 
 export default {
-  name: 'ibps-user-selector',
-  components: {
-    EmployeeSelector,
-    OrgSelector,
-    PositionSelector,
-    RoleSelector
-  },
-  mixins: [FieldMixin],
-  props: {
-    multiple: Boolean,
-    type: { // 选择器类型 user:用户选择器,org:组织选择器,position:岗位选择器,role:角色选择器
-      type: String,
-      required: true
-    },
-    store: { // 存储类型 对应[多选]有效,json: json字符串,id:只存储id, array:存储数组数据 ,arrayId: 字符串类型。
-      type: String,
-      default: 'json',
-      validator: function(value) {
-        return ['json', 'id', 'array', 'arrayId', 'bind'].indexOf(value) !== -1
-      }
-    },
-    storeSeparator: { // 存储值分割符,对于设置字符串类型的分隔符
-      type: String,
-      default: ','
-    },
-    bindId: {
-      type: String
-    },
-    leftText: {
-      type: String,
-      default: i18n.t('cancel')
-    },
-    idKey: {
-      type: String,
-      default: 'id'
-    },
-    parentIdKey: {
-      type: String,
-      default: 'parentId'
-    },
-    valueKey: {
-      type: String,
-      default: 'id'
-    },
-    labelKey: {
-      type: String,
-      default: 'name'
-    },
-    childrenKey: {
-      type: String,
-      default: 'children'
-    },
-    fieldOptions: {
-      type: Object,
-      default: () => {
-        return {}
-      }
-    },
-    color: {
-      type: String,
-      default: '#D6EAFE'
-    },
-    textColor: {
-      type: String,
-      default: '#3396FB'
-    },
-    plain: {
-      type: Boolean,
-      default: false
-    },
-    filter: {
-      type: Array,
-      default: () => []
-    }
-  },
-  data() {
-    return {
-      showPopup: false, // 弹窗
-      selectedData: [], // 选中的值
-      selectedValue: [],
-      bindIdValue: '',
-      num: 3, // 默认最多显示3个选项
-      partyTypeOptions: partyTypeOptions,
-      customPartyTypeOptions: [],
-      // 用户选择器条件
-      condition: {
-        org: {
-          partyTypeId: '',
-          currentOrgId: '',
-          script: ''
-        },
-        position: {
-          partyTypeId: '',
-          currentOrgId: '',
-          script: ''
-        },
-        role: {
-          partyTypeId: '',
-          currentOrgId: '',
-          script: ''
-        },
-        group: {
-          partyTypeId: '',
-          currentOrgId: '',
-          script: ''
+    name: 'ibps-user-selector',
+    components: {
+        EmployeeSelector,
+        OrgSelector,
+        PositionSelector,
+        RoleSelector
+    },
+    mixins: [FieldMixin],
+    props: {
+        multiple: Boolean,
+        type: { // 选择器类型 user:用户选择器,org:组织选择器,position:岗位选择器,role:角色选择器
+            type: String,
+            required: true
+        },
+        store: { // 存储类型 对应[多选]有效,json: json字符串,id:只存储id, array:存储数组数据 ,arrayId: 字符串类型。
+            type: String,
+            default: 'json',
+            validator: function(value) {
+                return ['json', 'id', 'array', 'arrayId', 'bind'].indexOf(value) !== -1
+            }
+        },
+        storeSeparator: { // 存储值分割符,对于设置字符串类型的分隔符
+            type: String,
+            default: ','
+        },
+        bindId: {
+            type: String
+        },
+        leftText: {
+            type: String,
+            default: i18n.t('cancel')
+        },
+        idKey: {
+            type: String,
+            default: 'id'
+        },
+        parentIdKey: {
+            type: String,
+            default: 'parentId'
+        },
+        valueKey: {
+            type: String,
+            default: 'id'
+        },
+        labelKey: {
+            type: String,
+            default: 'name'
+        },
+        childrenKey: {
+            type: String,
+            default: 'children'
+        },
+        fieldOptions: {
+            type: Object,
+            default: () => {
+                return {}
+            }
+        },
+        color: {
+            type: String,
+            default: '#D6EAFE'
+        },
+        textColor: {
+            type: String,
+            default: '#3396FB'
+        },
+        plain: {
+            type: Boolean,
+            default: false
+        },
+        filter: {
+            type: Array,
+            default: () => []
         }
-      },
-      // 传递参数
-      partyTypeId: '',
-      currentOrgId: '',
-      script: '',
-      partyTypeScope: ''
-    }
-  },
-  computed: {
-    showClear() {
-      return this.clearable && this.$utils.isNotEmpty(this.value) && this.isDef(this.value) && this.editable
     },
-    defaultPlaceholder() {
-      if (this.placeholder) { return this.placeholder }
-      const type = this.type ? this.$t('components.selector.' + this.type) : ''
-      return i18n.t('components.selector.placeholder', { type: type })
-    }
-  },
-  watch: {
-    value: {
-      handler() {
-        this.initSelectedData()
-      },
-      immediate: true
-    },
-    filter: {
-      handler(val, oldVal) {
-        // console.info(val, '==>>filter')
-        this.filterScope(val)
-      },
-      immediate: true,
-      deep: true
-    }
-  },
-  created() {
-    this._getNumByWidth()
-  },
-  mounted() {
-    this.initSelectedData()
-  },
-  methods: {
-    _getNumByWidth() {
-      const width = document.documentElement.clientWidth
-      if (width >= 375) this.num = 3
-      else this.num = 2
-    },
-    _setInputValue() {
-      this.inputValue = this.$utils.isNotEmpty(this.value) ? JSON.stringify(this.value) : ''
-      setTimeout(() => {
-        this.validate()
-      }, 10)
-    },
-    initSelectedData() {
-      this.selectedValue = this.getArrayValue(this.value, this.bindId)
-      if (this.$utils.isEmpty(this.selectedValue)) {
-        this.selectedData = []
-      }
-    },
-    getArrayValue(value, bindId) {
-      if (this.$utils.isEmpty(value)) {
-        return []
-      }
-      if (this.store === 'json') { // json
-        return this.parseJsonData(value)
-      } else if (this.store === 'id') { // id
-        // 可能是json数据
-        if (this.$utils.isJSON(value)) {
-          return this.parseJsonData(value)
-        } else {
-          return this.$utils.isString(value) ? value.split(this.storeSeparator) : []
-        }
-      } else if (this.store === 'arrayId') { // 数组id
-        return value
-      } else if (this.store === 'bind') { // 绑定id
-        if (this.$utils.isJSON(value)) {
-          return this.parseJsonData(value)
-        } else {
-          return this.$utils.isString(value) ? value.split(this.storeSeparator) : []
+    data() {
+        return {
+            showPopup: false, // 弹窗
+            selectedData: [], // 选中的值
+            selectedValue: [],
+            bindIdValue: '',
+            num: 3, // 默认最多显示3个选项
+            partyTypeOptions: partyTypeOptions,
+            customPartyTypeOptions: [],
+            // 用户选择器条件
+            condition: {
+                org: {
+                    partyTypeId: '',
+                    currentOrgId: '',
+                    script: ''
+                },
+                position: {
+                    partyTypeId: '',
+                    currentOrgId: '',
+                    script: ''
+                },
+                role: {
+                    partyTypeId: '',
+                    currentOrgId: '',
+                    script: ''
+                },
+                group: {
+                    partyTypeId: '',
+                    currentOrgId: '',
+                    script: ''
+                }
+            },
+            // 传递参数
+            partyTypeId: '',
+            currentOrgId: '',
+            script: '',
+            partyTypeScope: ''
         }
-      } else {
-        return value.map((d) => {
-          return d[this.valueKey]
-        })
-      }
     },
-    parseJsonData(value) {
-      try {
-        const data = this.$utils.parseData(value)
-        const result = []
-        if (Array.isArray(data)) {
-          data.forEach(d => {
-            const node = d[this.valueKey]
-            if (node) result.push(node)
-          })
-        } else {
-          result.push(data[this.valueKey])
+    computed: {
+        showClear() {
+            return this.clearable && this.$utils.isNotEmpty(this.value) && this.isDef(this.value) && this.editable
+        },
+        defaultPlaceholder() {
+            if (this.placeholder) { return this.placeholder }
+            const type = this.type ? this.$t('components.selector.' + this.type) : ''
+            return i18n.t('components.selector.placeholder', { type: type })
         }
-        return result
-      } catch (error) {
-        console.warn(error)
-        return []
-      }
     },
-    getStoreValue(value) {
-      const res = []
-      if (this.store === 'json') { // json
-        if (this.$utils.isEmpty(value)) {
-          return ''
-        }
-        value.forEach(v => {
-          const o = {}
-          o[this.valueKey] = v[this.valueKey]
-          o[this.labelKey] = v[this.labelKey]
-          res.push(o)
-        })
-        return JSON.stringify(res)
-      } else if (this.store === 'id') { // id
-        if (this.$utils.isEmpty(value)) {
-          return ''
-        }
-        value.forEach(v => {
-          res.push(v[this.valueKey])
-        })
-        return res.join(this.storeSeparator)
-      } else if (this.store === 'arrayId') { // 数组id
-        if (this.$utils.isEmpty(value)) {
-          return []
-        } else {
-          return value.map((d) => {
-            return d[this.valueKey]
-          })
+    watch: {
+        value: {
+            handler() {
+                this.initSelectedData()
+            },
+            immediate: true
+        },
+        filter: {
+            handler(val, oldVal) {
+                // console.info(val, '==>>filter')
+                this.filterScope(val)
+            },
+            immediate: true,
+            deep: true
         }
-      } else if (this.store === 'bind') { // 绑定id
-        const res = []
-        const bindIdValue = []
-        value.forEach(v => {
-          bindIdValue.push(v[this.valueKey])
-          res.push(v[this.labelKey])
-        })
-        this.bindIdValue = bindIdValue.join(this.storeSeparator)
-
-        // return res.join(this.storeSeparator)
-        return this.bindIdValue
-      } else { // 数组
-        return value || []
-      }
-    },
-    onClick() {
-      if (!this.editable) { return }
-      this.selectedValue = this.getArrayValue(this.value, this.bindId)
-      this.showPopup = true
-    },
-    onCancel() {
-      this.showPopup = false
-    },
-    onConfirm(selectedData) {
-      if (this.$utils.isEmpty(selectedData)) {
-        this.$notify({
-          type: 'warning',
-          message: '请选择!'
-        })
-        return
-      }
-      if (!this.multiple && this.$utils.isEmpty(selectedData[0])) {
-        this.$notify({
-          type: 'warning',
-          message: '请选择!'
-        })
-        return
-      }
-      this.showPopup = false
-      this.selectedData = selectedData
-      this.$emit('input', this.getStoreValue(selectedData))
-    },
-    callbackData(selectedData) {
-      this.emitInput(selectedData, this.type)
-      this.showPopup = false
-    },
-    emitInput(value, type) {
-      if (this.store === 'bind') {
-        this.$nextTick(() => {
-          this.$emit('bind-callback', value, type)
-        })
-      }
-    },
-    onRightIconClick() {
-      this.showClear ? this.onClear() : this.onClick()
-    },
-    onClear() {
-      this.$emit('input', [])
     },
-    // 回调初始化数据
-    initData(data) {
-      this.selectedData = data
-      this._setInputValue()
+    created() {
+        this._getNumByWidth()
     },
-    removeData(index) {
-      this.selectedData.splice(index, 1)
-      const mid = []
-      this.selectedData.forEach((it, i) => {
-        mid.push(it.id)
-      })
-      this.selectedValue.splice(0)
-      this.selectedValue = mid
-      this.$emit('input', this.getStoreValue(this.selectedData))
+    mounted() {
+        this.initSelectedData()
     },
+    methods: {
+        _getNumByWidth() {
+            const width = document.documentElement.clientWidth
+            if (width >= 375) this.num = 3
+            else this.num = 2
+        },
+        _setInputValue() {
+            this.inputValue = this.$utils.isNotEmpty(this.value) ? JSON.stringify(this.value) : ''
+            setTimeout(() => {
+                this.validate()
+            }, 10)
+        },
+        initSelectedData() {
+            this.selectedValue = this.getArrayValue(this.value, this.bindId)
+            if (this.$utils.isEmpty(this.selectedValue)) {
+                this.selectedData = []
+            }
+        },
+        getArrayValue(value, bindId) {
+            if (this.$utils.isEmpty(value)) {
+                return []
+            }
+            if (this.store === 'json') { // json
+                return this.parseJsonData(value)
+            } else if (this.store === 'id') { // id
+                // 可能是json数据
+                if (this.$utils.isJSON(value)) {
+                    return this.parseJsonData(value)
+                } else {
+                    return this.$utils.isString(value) ? value.split(this.storeSeparator) : []
+                }
+            } else if (this.store === 'arrayId') { // 数组id
+                return value
+            } else if (this.store === 'bind') { // 绑定id
+                if (this.$utils.isJSON(value)) {
+                    return this.parseJsonData(value)
+                } else {
+                    return this.$utils.isString(value) ? value.split(this.storeSeparator) : []
+                }
+            } else {
+                return value.map((d) => {
+                    return d[this.valueKey]
+                })
+            }
+        },
+        parseJsonData(value) {
+            try {
+                const data = this.$utils.parseData(value)
+                const result = []
+                if (Array.isArray(data)) {
+                    data.forEach(d => {
+                        const node = d[this.valueKey]
+                        if (node) result.push(node)
+                    })
+                } else {
+                    result.push(data[this.valueKey])
+                }
+                return result
+            } catch (error) {
+                console.warn(error)
+                return []
+            }
+        },
+        getStoreValue(value) {
+            const res = []
+            if (this.store === 'json') { // json
+                if (this.$utils.isEmpty(value)) {
+                    return ''
+                }
+                value.forEach(v => {
+                    const o = {}
+                    o[this.valueKey] = v[this.valueKey]
+                    o[this.labelKey] = v[this.labelKey]
+                    res.push(o)
+                })
+                return JSON.stringify(res)
+            } else if (this.store === 'id') { // id
+                if (this.$utils.isEmpty(value)) {
+                    return ''
+                }
+                value.forEach(v => {
+                    res.push(v[this.valueKey])
+                })
+                return res.join(this.storeSeparator)
+            } else if (this.store === 'arrayId') { // 数组id
+                if (this.$utils.isEmpty(value)) {
+                    return []
+                } else {
+                    return value.map((d) => {
+                        return d[this.valueKey]
+                    })
+                }
+            } else if (this.store === 'bind') { // 绑定id
+                const res = []
+                const bindIdValue = []
+                value.forEach(v => {
+                    bindIdValue.push(v[this.valueKey])
+                    res.push(v[this.labelKey])
+                })
+                this.bindIdValue = bindIdValue.join(this.storeSeparator)
 
-    changePartyType(value) {
-      const params = this.condition[value]
-      this.partyTypeScope = value
-      this.partyTypeId = params.partyTypeId
-      this.currentOrgId = params.currentOrgId
-      this.script = params.script
-    },
-    filterScope(val) {
-      const existingTypeScope = []
-      const typeScope = []
-      val.forEach(v => {
-        existingTypeScope.push(v.userType)
-        this.filterSelectorType(v)
-      })
-      // 根据设置得范围类型切换选择器左树(或右树)下拉类型数据
-      const partyTypeOptions = JSON.parse(JSON.stringify(this.partyTypeOptions))
-      partyTypeOptions.forEach((f, i) => {
-        if (existingTypeScope.includes(f.value)) {
-          typeScope.push(f)
+                // return res.join(this.storeSeparator)
+                return this.bindIdValue
+            } else { // 数组
+                return value || []
+            }
+        },
+        onClick() {
+            if (!this.editable) { return }
+            this.selectedValue = this.getArrayValue(this.value, this.bindId)
+            this.showPopup = true
+        },
+        onCancel() {
+            this.showPopup = false
+        },
+        onConfirm(selectedData) {
+            if (this.$utils.isEmpty(selectedData)) {
+                this.$notify({
+                    type: 'warning',
+                    message: '请选择!'
+                })
+                return
+            }
+            if (!this.multiple && this.$utils.isEmpty(selectedData[0])) {
+                this.$notify({
+                    type: 'warning',
+                    message: '请选择!'
+                })
+                return
+            }
+            this.showPopup = false
+            this.selectedData = selectedData
+            this.$emit('input', this.getStoreValue(selectedData))
+        },
+        callbackData(selectedData) {
+            this.emitInput(selectedData, this.type)
+            this.showPopup = false
+        },
+        emitInput(value, type) {
+            if (this.store === 'bind') {
+                this.$nextTick(() => {
+                    this.$emit('bind-callback', value, type)
+                })
+            }
+        },
+        onRightIconClick() {
+            this.showClear ? this.onClear() : this.onClick()
+        },
+        onClear() {
+            this.$emit('input', [])
+        },
+        // 回调初始化数据
+        initData(data) {
+            this.selectedData = data
+            this._setInputValue()
+        },
+        removeData(index) {
+            this.selectedData.splice(index, 1)
+            const mid = []
+            this.selectedData.forEach((it, i) => {
+                mid.push(it.id)
+            })
+            this.selectedValue.splice(0)
+            this.selectedValue = mid
+            this.$emit('input', this.getStoreValue(this.selectedData))
+        },
+
+        changePartyType(value) {
+            const params = this.condition[value]
+            this.partyTypeScope = value
+            this.partyTypeId = params.partyTypeId
+            this.currentOrgId = params.currentOrgId
+            this.script = params.script
+        },
+        filterScope(val) {
+            const existingTypeScope = []
+            const typeScope = []
+            val.forEach(v => {
+                existingTypeScope.push(v.userType)
+                this.filterSelectorType(v)
+            })
+            // 根据设置得范围类型切换选择器左树(或右树)下拉类型数据
+            const partyTypeOptions = JSON.parse(JSON.stringify(this.partyTypeOptions))
+            partyTypeOptions.forEach((f, i) => {
+                if (existingTypeScope.includes(f.value)) {
+                    typeScope.push(f)
+                }
+            })
+            this.customPartyTypeOptions = typeScope
+            // 初始化查询范围条件
+            if (this.$utils.isNotEmpty(typeScope)) {
+                this.currentOrgId = this.condition[typeScope[0].value].currentOrgId
+                this.partyTypeId = this.condition[typeScope[0].value].partyTypeId
+                this.script = this.condition[typeScope[0].value].script
+            }
+        },
+        // 根据选择器类型分发筛选条件并储存
+        filterSelectorType(val) {
+            switch (val.type) {
+                case 'user':
+                    this.getUserSelectorCondition(val, val.userType)
+                    break
+                case 'org':
+                    this.getOrgSelectorCondition(val)
+                    break
+                case 'position':
+                    this.getPositionSelectorCondition(val)
+                    break
+                case 'role':
+                    this.getRoleSelectorCondition(val)
+                    break
+            }
+            // console.info(this.condition, '=>>this.condition')
+        },
+        getUserSelectorCondition(val, type) {
+            this.condition[type] ? this.condition[type].partyTypeId = val.descVal : null
+            switch (val.descVal) {
+                case '1':
+                    break
+                case '2':
+                case '3':
+                    this.condition[type].currentOrgId = val.partyId
+                    break
+                case 'script':
+                    this.condition[type].script = val.scriptContent
+                    break
+            }
+        },
+        // 获取组织选择器条件
+        getOrgSelectorCondition(val) {
+            this.partyTypeId = val.descVal
+            switch (val.descVal) {
+                case '1':
+                    break
+                case '2':
+                case '3':
+                    this.currentOrgId = val.partyId
+                    break
+                case 'script':
+                    this.script = val.scriptContent
+                    break
+            }
+        },
+        // 获取岗位选择器条件
+        getPositionSelectorCondition(val) {
+            this.partyTypeId = val.descVal
+            switch (val.descVal) {
+                case '1':
+                    break
+                case '2':
+                case '3':
+                    this.currentOrgId = val.partyId
+                    break
+                case 'script':
+                    this.script = val.scriptContent
+                    break
+            }
+        },
+        // 获取角色选择器条件
+        getRoleSelectorCondition(val) {
+            // console.info(val, '=>>获取角色选择器条件')
+            this.partyTypeId = val.descVal
+            switch (val.descVal) {
+                case '1':
+                    break
+                case '2':
+                case '3':
+                    this.currentOrgId = val.partyId
+                    break
+                case 'script':
+                    this.script = val.scriptContent
+                    break
+            }
         }
-      })
-      this.customPartyTypeOptions = typeScope
-      // 初始化查询范围条件
-      if (this.$utils.isNotEmpty(typeScope)) {
-        this.currentOrgId = this.condition[typeScope[0].value].currentOrgId
-        this.partyTypeId = this.condition[typeScope[0].value].partyTypeId
-        this.script = this.condition[typeScope[0].value].script
-      }
-    },
-    // 根据选择器类型分发筛选条件并储存
-    filterSelectorType(val) {
-      switch (val.type) {
-        case 'user':
-          this.getUserSelectorCondition(val, val.userType)
-          break
-        case 'org':
-          this.getOrgSelectorCondition(val)
-          break
-        case 'position':
-          this.getPositionSelectorCondition(val)
-          break
-        case 'role':
-          this.getRoleSelectorCondition(val)
-          break
-      }
-      // console.info(this.condition, '=>>this.condition')
-    },
-    getUserSelectorCondition(val, type) {
-      this.condition[type] ? this.condition[type].partyTypeId = val.descVal : null
-      switch (val.descVal) {
-        case '1':
-          break
-        case '2':
-        case '3':
-          this.condition[type].currentOrgId = val.partyId
-          break
-        case 'script':
-          this.condition[type].script = val.scriptContent
-          break
-      }
-    },
-    // 获取组织选择器条件
-    getOrgSelectorCondition(val) {
-      this.partyTypeId = val.descVal
-      switch (val.descVal) {
-        case '1':
-          break
-        case '2':
-        case '3':
-          this.currentOrgId = val.partyId
-          break
-        case 'script':
-          this.script = val.scriptContent
-          break
-      }
-    },
-    // 获取岗位选择器条件
-    getPositionSelectorCondition(val) {
-      this.partyTypeId = val.descVal
-      switch (val.descVal) {
-        case '1':
-          break
-        case '2':
-        case '3':
-          this.currentOrgId = val.partyId
-          break
-        case 'script':
-          this.script = val.scriptContent
-          break
-      }
-    },
-    // 获取角色选择器条件
-    getRoleSelectorCondition(val) {
-      // console.info(val, '=>>获取角色选择器条件')
-      this.partyTypeId = val.descVal
-      switch (val.descVal) {
-        case '1':
-          break
-        case '2':
-        case '3':
-          this.currentOrgId = val.partyId
-          break
-        case 'script':
-          this.script = val.scriptContent
-          break
-      }
     }
-  }
 }
 </script>
 <style lang="scss" scoped>

+ 18 - 18
src/constants/btnColor.js

@@ -1,26 +1,26 @@
 /** 用于按钮的自定义颜色 */
 export const colorOptions = [{
-  type: 'primary',
-  color: '#D6EAFE',
-  textColor: '#3396FB'
+    type: 'primary',
+    color: '#D6EAFE',
+    textColor: '#3396FB'
 }, {
-  type: 'danger',
-  color: '#FCDDDB',
-  textColor: '#F0574A'
+    type: 'danger',
+    color: '#FCDDDB',
+    textColor: '#F0574A'
 }, {
-  type: 'default',
-  color: '#FFE5CC',
-  textColor: '#FF7C00'
+    type: 'default',
+    color: '#FFE5CC',
+    textColor: '#FF7C00'
 }, {
-  type: 'success',
-  color: '#e3f3eb',
-  textColor: '#07c160'
+    type: 'success',
+    color: '#e3f3eb',
+    textColor: '#07c160'
 }, {
-  type: 'warning',
-  color: '#FFE5CC',
-  textColor: '#FF7C00'
+    type: 'warning',
+    color: '#FFE5CC',
+    textColor: '#FF7C00'
 }, {
-  type: 'info',
-  color: '#D6EAFE',
-  textColor: '#3396FB'
+    type: 'info',
+    color: '#D6EAFE',
+    textColor: '#3396FB'
 }]

+ 757 - 757
src/views/platform/bpmn/communication/communication.vue

@@ -1,226 +1,226 @@
 <template>
-  <van-overlay class="backgroundSty" z-index="2002" :show="showPop">
-    <div style="height:5%">
-      <van-sticky>
-        <van-nav-bar
-          :title="
-            '沟通记录 ' +
-              (typeValue == '3'
-                ? '编制'
-                : typeValue == '4'
-                ? '修改'
-                : typeValue == '1'
-                ? '详情'
-                : '')
-          "
-          :right-text="typeValue == '4' ? '退回原因' : ''"
-          @click-left="closePop()"
-          @click-right="getBack()"
-        >
-          <template #left>
-            <van-icon name="cross" class="ibps-nav-bar__close-icon" />
-          </template>
-        </van-nav-bar>
-      </van-sticky>
-    </div>
-    <div class="scrollView">
-      <van-form @submit="onSubmit">
-        <van-field
-          v-model="form.biaoDanBianHao"
-          label="表单编号:"
-          placeholder="请输入表单编号"
-          label-width="6em"
-          input-align="left"
-          readonly
-        />
-        <van-field
-          v-model="form.keHuLianXiRen"
-          required
-          label="用户姓名:"
-          placeholder="请输入用户姓名"
-          label-width="6em"
-          clearable
-          :readonly="typeValue != 3 && typeValue != 4 ? true : false"
-        />
-        <van-field
-          v-model="form.keHuDanWeiMin"
-          required
-          label="用户单位:"
-          placeholder="请输入用户单位"
-          label-width="6em"
-          clearable
-          :readonly="typeValue != 3 && typeValue != 4 ? true : false"
-        />
-        <van-field
-          v-model="form.lianXiDianHua"
-          required
-          label="联系电话:"
-          placeholder="请输入联系电话"
-          label-width="6em"
-          clearable
-          :rules="[
-            {
-              validator: $common.getRequest.checkPhone,
-              message: '手机号格式错误'
-            }
-          ]"
-          :readonly="typeValue != 3 && typeValue != 4 ? true : false"
-        />
-        <van-field
-          v-model="form.yongHuYouXiang"
-          required
-          label="用户邮箱:"
-          placeholder="请输入用户邮箱"
-          label-width="6em"
-          clearable
-          :rules="[
-            {
-              validator: $common.getRequest.checkEmail,
-              message: '邮箱格式错误'
-            }
-          ]"
-          :readonly="typeValue != 3 && typeValue != 4 ? true : false"
-        />
-        <van-field
-          required
-          label="沟通类型:"
-          placeholder="请选择沟通类型"
-          label-width="6em"
-          :value="form.gouTongLeiXing"
-          :readonly="typeValue != 3 && typeValue != 4 ? true : false"
-          @click="sheetShow = true"
-        />
-        <van-popup v-model="sheetShow" position="bottom">
-          <van-picker
-            show-toolbar
-            :columns="list"
-            @confirm="actionSheetCallback"
-            @cancel="sheetShow = false"
-          />
-        </van-popup>
-        <van-field
-          v-if="form.gouTongLeiXing == '其它'"
-          v-model="form.qiTa"
-          required
-          label="其他类型:"
-          placeholder="请输入其他类型"
-          label-width="6em"
-          clearable
-          :readonly="typeValue != 3 && typeValue != 4 ? true : false"
-        />
-        <van-field
-          required
-          label="沟通时间:"
-          placeholder="请选择沟通时间"
-          label-width="6em"
-          :value="form.gouTongRiQi"
-          :readonly="typeValue != 3 && typeValue != 4 ? true : false"
-          @click="gouTongRiQiClick(form.gouTongRiQi)"
-        />
-        <van-popup v-model="timeShow" position="bottom">
-          <van-datetime-picker
-            v-model="xuanzeTime"
-            type="datetime"
-            @confirm="timeShowCallback"
-            @cancel="timeShow = false"
-          />
-        </van-popup>
-        <van-field
-          v-model="form.weiTuoDanHao"
-          required
-          autosize
-          type="textarea"
-          label="沟通事项:"
-          placeholder="请输入沟通事项"
-          label-width="6em"
-          clearable
-          :readonly="typeValue != 3 && typeValue != 4 ? true : false"
-        />
-      </van-form>
-      <van-cell-group>
-        <div class="verticalLine" style="width:6em;padding: 1em 0;">
-          沟通内容
+    <van-overlay class="backgroundSty" z-index="2002" :show="showPop">
+        <div style="height:5%">
+            <van-sticky>
+                <van-nav-bar
+                    :title="
+                        '沟通记录 ' +
+                            (typeValue == '3'
+                                ? '编制'
+                                : typeValue == '4'
+                                    ? '修改'
+                                    : typeValue == '1'
+                                        ? '详情'
+                                        : '')
+                    "
+                    :right-text="typeValue == '4' ? '退回原因' : ''"
+                    @click-left="closePop()"
+                    @click-right="getBack()"
+                >
+                    <template #left>
+                        <van-icon name="cross" class="ibps-nav-bar__close-icon" />
+                    </template>
+                </van-nav-bar>
+            </van-sticky>
         </div>
-        <van-field
-          v-model="form.gouTongNeiRong"
-          autosize
-          type="textarea"
-          label=""
-          placeholder="意见和建议"
-          label-width="0"
-          clearable
-          :readonly="typeValue != 3 && typeValue != 4 ? true : false"
-        />
-      </van-cell-group>
+        <div class="scrollView">
+            <van-form @submit="onSubmit">
+                <van-field
+                    v-model="form.biaoDanBianHao"
+                    label="表单编号:"
+                    placeholder="请输入表单编号"
+                    label-width="6em"
+                    input-align="left"
+                    readonly
+                />
+                <van-field
+                    v-model="form.keHuLianXiRen"
+                    required
+                    label="用户姓名:"
+                    placeholder="请输入用户姓名"
+                    label-width="6em"
+                    clearable
+                    :readonly="typeValue != 3 && typeValue != 4 ? true : false"
+                />
+                <van-field
+                    v-model="form.keHuDanWeiMin"
+                    required
+                    label="用户单位:"
+                    placeholder="请输入用户单位"
+                    label-width="6em"
+                    clearable
+                    :readonly="typeValue != 3 && typeValue != 4 ? true : false"
+                />
+                <van-field
+                    v-model="form.lianXiDianHua"
+                    required
+                    label="联系电话:"
+                    placeholder="请输入联系电话"
+                    label-width="6em"
+                    clearable
+                    :rules="[
+                        {
+                            validator: $common.getRequest.checkPhone,
+                            message: '手机号格式错误'
+                        }
+                    ]"
+                    :readonly="typeValue != 3 && typeValue != 4 ? true : false"
+                />
+                <van-field
+                    v-model="form.yongHuYouXiang"
+                    required
+                    label="用户邮箱:"
+                    placeholder="请输入用户邮箱"
+                    label-width="6em"
+                    clearable
+                    :rules="[
+                        {
+                            validator: $common.getRequest.checkEmail,
+                            message: '邮箱格式错误'
+                        }
+                    ]"
+                    :readonly="typeValue != 3 && typeValue != 4 ? true : false"
+                />
+                <van-field
+                    required
+                    label="沟通类型:"
+                    placeholder="请选择沟通类型"
+                    label-width="6em"
+                    :value="form.gouTongLeiXing"
+                    :readonly="typeValue != 3 && typeValue != 4 ? true : false"
+                    @click="sheetShow = true"
+                />
+                <van-popup v-model="sheetShow" position="bottom">
+                    <van-picker
+                        show-toolbar
+                        :columns="list"
+                        @confirm="actionSheetCallback"
+                        @cancel="sheetShow = false"
+                    />
+                </van-popup>
+                <van-field
+                    v-if="form.gouTongLeiXing == '其它'"
+                    v-model="form.qiTa"
+                    required
+                    label="其他类型:"
+                    placeholder="请输入其他类型"
+                    label-width="6em"
+                    clearable
+                    :readonly="typeValue != 3 && typeValue != 4 ? true : false"
+                />
+                <van-field
+                    required
+                    label="沟通时间:"
+                    placeholder="请选择沟通时间"
+                    label-width="6em"
+                    :value="form.gouTongRiQi"
+                    :readonly="typeValue != 3 && typeValue != 4 ? true : false"
+                    @click="gouTongRiQiClick(form.gouTongRiQi)"
+                />
+                <van-popup v-model="timeShow" position="bottom">
+                    <van-datetime-picker
+                        v-model="xuanzeTime"
+                        type="datetime"
+                        @confirm="timeShowCallback"
+                        @cancel="timeShow = false"
+                    />
+                </van-popup>
+                <van-field
+                    v-model="form.weiTuoDanHao"
+                    required
+                    autosize
+                    type="textarea"
+                    label="沟通事项:"
+                    placeholder="请输入沟通事项"
+                    label-width="6em"
+                    clearable
+                    :readonly="typeValue != 3 && typeValue != 4 ? true : false"
+                />
+            </van-form>
+            <van-cell-group>
+                <div class="verticalLine" style="width:6em;padding: 1em 0;">
+                    沟通内容
+                </div>
+                <van-field
+                    v-model="form.gouTongNeiRong"
+                    autosize
+                    type="textarea"
+                    label=""
+                    placeholder="意见和建议"
+                    label-width="0"
+                    clearable
+                    :readonly="typeValue != 3 && typeValue != 4 ? true : false"
+                />
+            </van-cell-group>
 
-      <ibps-uploader
-        v-model="form.fuJian"
-        label="附件"
-        download
-        placeholder="请上传附件"
-        :have-padding="false"
-        multiple
-        clearable
-        :readonly="typeValue != 3 && typeValue != 4 ? true : false"
-      />
-      <ibps-signature
-        v-if="form.leiXing == '2'"
-        v-model="form.keHu"
-        label="用户确认"
-        class="yonghu"
-        placeholder=" "
-        :readonly="typeValue == 3 && typeValue == 4 ? true : false"
-      />
-      <van-cell-group v-if="typeValue != 3 && typeValue != 4">
-        <div class="verticalLine" style="width:8em;padding: 1em 0;">
-          沟通内容确定
-        </div>
-        <van-field
-          v-model="form.gouTongQueDingNei"
-          autosize
-          type="textarea"
-          label=""
-          placeholder="意见和建议"
-          label-width="0"
-          clearable
-          :readonly="typeValue != 2"
-        />
-      </van-cell-group>
-      <ibps-signature
-        v-if="form.leiXing == '1'"
-        v-model="form.keHu"
-        label="沟通确认"
-        class="yonghu"
-        placeholder=" "
-        :readonly="typeValue != 2"
-      />
+            <ibps-uploader
+                v-model="form.fuJian"
+                label="附件"
+                download
+                placeholder="请上传附件"
+                :have-padding="false"
+                multiple
+                clearable
+                :readonly="typeValue != 3 && typeValue != 4 ? true : false"
+            />
+            <ibps-signature
+                v-if="form.leiXing == '2'"
+                v-model="form.keHu"
+                label="用户确认"
+                class="yonghu"
+                placeholder=" "
+                :readonly="typeValue == 3 && typeValue == 4 ? true : false"
+            />
+            <van-cell-group v-if="typeValue != 3 && typeValue != 4">
+                <div class="verticalLine" style="width:8em;padding: 1em 0;">
+                    沟通内容确定
+                </div>
+                <van-field
+                    v-model="form.gouTongQueDingNei"
+                    autosize
+                    type="textarea"
+                    label=""
+                    placeholder="意见和建议"
+                    label-width="0"
+                    clearable
+                    :readonly="typeValue != 2"
+                />
+            </van-cell-group>
+            <ibps-signature
+                v-if="form.leiXing == '1'"
+                v-model="form.keHu"
+                label="沟通确认"
+                class="yonghu"
+                placeholder=" "
+                :readonly="typeValue != 2"
+            />
 
-      <div v-if="typeValue == '3'" class="padding flex flex-direction">
-        <van-button
-type="success"
-class="btn btn-back-color"
-@click="onSubmit"
-          >提交
-        </van-button>
-      </div>
-      <div v-if="typeValue == '2'" class="padding flex flex-direction">
-        <van-button
-          type="success"
-          class="btn btn-back-color"
-          @click="onAgree('已完成', '同意', '确定')"
-          >同意
-        </van-button>
-      </div>
-      <div v-if="typeValue == '4'" class="padding flex flex-direction">
-        <van-button
-          type="success"
-          class="btn btn-back-color"
-          @click="onAgree('已编制', '重新提交', '提交')"
-          >修改
-        </van-button>
-      </div>
-    </div>
-  </van-overlay>
+            <div v-if="typeValue == '3'" class="padding flex flex-direction">
+                <van-button
+                    type="success"
+                    class="btn btn-back-color"
+                    @click="onSubmit"
+                >提交
+                </van-button>
+            </div>
+            <div v-if="typeValue == '2'" class="padding flex flex-direction">
+                <van-button
+                    type="success"
+                    class="btn btn-back-color"
+                    @click="onAgree('已完成', '同意', '确定')"
+                >同意
+                </van-button>
+            </div>
+            <div v-if="typeValue == '4'" class="padding flex flex-direction">
+                <van-button
+                    type="success"
+                    class="btn btn-back-color"
+                    @click="onAgree('已编制', '重新提交', '提交')"
+                >修改
+                </van-button>
+            </div>
+        </div>
+    </van-overlay>
 </template>
 <script>
 import random from '@/mixins/random'
@@ -228,574 +228,574 @@ import bpmnStatus from '@/mixins/bpmnStatus'
 import IbpsUploader from '@/business/platform/file/uploader'
 
 import {
-  getNextIdByAlias,
-  findFormJsonByBo,
-  snapshot
+    getNextIdByAlias,
+    findFormJsonByBo,
+    snapshot
 } from '@/api/platform/form/transfer'
 import { agree } from '@/api/platform/bpmn/bpmTask'
 
 export default {
-  components: {
-    IbpsUploader
-  },
-  mixins: [random, bpmnStatus],
-  props: {
-    showPop: {
-      type: Boolean,
-      default: false
+    components: {
+        IbpsUploader
     },
-    typeValue: {
-      type: String,
-      default: '3'
-    },
-    id: {
-      type: String,
-      default: ''
-    }
-  },
-  data() {
-    const { useId, userInfo } = this.$store.getters
-    return {
-      useId,
-      userInfo,
-      show: this.showPop,
-      // typeValue: '3',
-      sheetShow: false,
-      taskId: '',
-      form: {
-        xuanZeKeHu: '',
-        biaoDanBianHao: '',
-        buMenName: '',
-        keHuDanWeiMin: '',
-        keHuLianXiRen: '',
-        weiTuoDanHao: '',
-        lianXiDianHua: '',
-        yangPinMingCheng: '',
-        yangPinBianHao: '',
-        yangPinLeiXing: '',
-        baoGaoBianHao: '',
-        gouTongLeiXing: '',
-        gouTongNeiRong: '',
-        keHu: '',
-        gouTongQueDingNei: '',
-        leiXing: '2',
-        yongHuYouXiang: '',
-        qiTa: ''
-      },
-      fuJianShangChuanArray: [],
-      popupShow: false,
-      list: [
-        {
-          text: '投诉'
-        },
-        {
-          text: '检验项目'
+    mixins: [random, bpmnStatus],
+    props: {
+        showPop: {
+            type: Boolean,
+            default: false
         },
-        {
-          text: '危机值报告'
+        typeValue: {
+            type: String,
+            default: '3'
         },
-        {
-          text: '口头报告结果'
-        },
-        {
-          text: '延迟报告'
-        },
-        {
-          text: '其它'
+        id: {
+            type: String,
+            default: ''
         }
-      ],
-      kehuXinXinList: [],
+    },
+    data() {
+        const { useId, userInfo } = this.$store.getters
+        return {
+            useId,
+            userInfo,
+            show: this.showPop,
+            // typeValue: '3',
+            sheetShow: false,
+            taskId: '',
+            form: {
+                xuanZeKeHu: '',
+                biaoDanBianHao: '',
+                buMenName: '',
+                keHuDanWeiMin: '',
+                keHuLianXiRen: '',
+                weiTuoDanHao: '',
+                lianXiDianHua: '',
+                yangPinMingCheng: '',
+                yangPinBianHao: '',
+                yangPinLeiXing: '',
+                baoGaoBianHao: '',
+                gouTongLeiXing: '',
+                gouTongNeiRong: '',
+                keHu: '',
+                gouTongQueDingNei: '',
+                leiXing: '2',
+                yongHuYouXiang: '',
+                qiTa: ''
+            },
+            fuJianShangChuanArray: [],
+            popupShow: false,
+            list: [
+                {
+                    text: '投诉'
+                },
+                {
+                    text: '检验项目'
+                },
+                {
+                    text: '危机值报告'
+                },
+                {
+                    text: '口头报告结果'
+                },
+                {
+                    text: '延迟报告'
+                },
+                {
+                    text: '其它'
+                }
+            ],
+            kehuXinXinList: [],
 
-      weiTuoList: [],
-      bianZhiRenName: '',
-      queDingRenName: '',
-      backShow: false,
-      option: '',
-      content: '',
-      timeShow: false,
-      params: {
-        year: true,
-        month: true,
-        day: true,
-        hour: true,
-        minute: true,
-        second: false
-      },
-      level: null,
-      mainPosition: {
-        id: ''
-      },
-      xuanzeTime: null
-    }
-  },
-  computed: {
-    rightText() {
-      return this.checkMode
-        ? this.$t('common.button.cancel')
-        : this.$t('common.button.manage')
+            weiTuoList: [],
+            bianZhiRenName: '',
+            queDingRenName: '',
+            backShow: false,
+            option: '',
+            content: '',
+            timeShow: false,
+            params: {
+                year: true,
+                month: true,
+                day: true,
+                hour: true,
+                minute: true,
+                second: false
+            },
+            level: null,
+            mainPosition: {
+                id: ''
+            },
+            xuanzeTime: null
+        }
     },
-    selectedIds() {
-      return this.checkedIds.join(',')
-    }
-  },
-  watch: {
-    showPop: {
-      handler: function(val, oldVal) {
-        if (val === true) {
-          this.form = {
-            xuanZeKeHu: '',
-            biaoDanBianHao: '',
-            buMenName: '',
-            keHuDanWeiMin: '',
-            keHuLianXiRen: '',
-            weiTuoDanHao: '',
-            lianXiDianHua: '',
-            yangPinMingCheng: '',
-            yangPinBianHao: '',
-            yangPinLeiXing: '',
-            baoGaoBianHao: '',
-            gouTongLeiXing: '',
-            gouTongNeiRong: '',
-            keHu: '',
-            gouTongQueDingNei: '',
-            leiXing: '2',
-            yongHuYouXiang: '',
-            qiTa: ''
-          }
-          this.getKehu()
-          this.level = this.$store.getters.level
-          const mid = JSON.parse(localStorage.getItem('mainPosition'))
-          const mainPosition =
+    computed: {
+        rightText() {
+            return this.checkMode
+                ? this.$t('common.button.cancel')
+                : this.$t('common.button.manage')
+        },
+        selectedIds() {
+            return this.checkedIds.join(',')
+        }
+    },
+    watch: {
+        showPop: {
+            handler: function(val, oldVal) {
+                if (val === true) {
+                    this.form = {
+                        xuanZeKeHu: '',
+                        biaoDanBianHao: '',
+                        buMenName: '',
+                        keHuDanWeiMin: '',
+                        keHuLianXiRen: '',
+                        weiTuoDanHao: '',
+                        lianXiDianHua: '',
+                        yangPinMingCheng: '',
+                        yangPinBianHao: '',
+                        yangPinLeiXing: '',
+                        baoGaoBianHao: '',
+                        gouTongLeiXing: '',
+                        gouTongNeiRong: '',
+                        keHu: '',
+                        gouTongQueDingNei: '',
+                        leiXing: '2',
+                        yongHuYouXiang: '',
+                        qiTa: ''
+                    }
+                    this.getKehu()
+                    this.level = this.$store.getters.level
+                    const mid = JSON.parse(localStorage.getItem('mainPosition'))
+                    const mainPosition =
             mid ||
             (this.userInfo && this.userInfo.mainPosition
-              ? this.userInfo.mainPosition
-              : null)
-          this.mainPosition = mainPosition
-          if (this.id && this.id !== '') {
-            // this.id = this.id
-            this.getDe(this.id)
-          } else {
-            this.getGtbh()
-          }
-          // if (this.typeValue) {
-          //   this.typeValue = this.typeValue
-          // }
+                ? this.userInfo.mainPosition
+                : null)
+                    this.mainPosition = mainPosition
+                    if (this.id && this.id !== '') {
+                        // this.id = this.id
+                        this.getDe(this.id)
+                    } else {
+                        this.getGtbh()
+                    }
+                    // if (this.typeValue) {
+                    //   this.typeValue = this.typeValue
+                    // }
+                }
+            },
+            immediate: true
         }
-      },
-      immediate: true
-    }
-  },
-  created() {},
-  methods: {
-    closePop() {
-      this.$emit('updataSet', false)
-    },
-    toCheckMode() {
-      if (this.$utils.isEmpty(this.listData)) {
-        return
-      }
-      if (this.checkMode) {
-        this.showA = true
-        this.checkedIds = []
-      }
-      this.checkMode = !this.checkMode
-    },
-    actionSheetCallback(e) {
-      this.form.gouTongLeiXing = e.text
-      this.sheetShow = false
-    },
-    timeShowCallback(e) {
-      const nowDate = new Date(e.getTime() + 8 * 60 * 60 * 1000)
-      const time = nowDate
-        .toJSON()
-        .split('T')
-        .join(' ')
-        .substr(0, 16)
-      this.form.gouTongRiQi = time
-      this.timeShow = false
-    },
-    gouTongRiQiClick(e) {
-      this.timeShow = true
-    },
-    // 获取上传状态
-    select(file) {
-      this.$uploades.selectUpload(file).then(res => {
-        res.forEach(item => {
-          this.fuJianShangChuanArray.push(item)
-        })
-      })
     },
-    // 删除
-    deleteMe(id) {
-      this.fuJianShangChuanArray = this.fuJianShangChuanArray.filter(
-        item => item.id !== id
-      )
-    },
-    // 获取上传进度
-    progress(e) {},
-    // 上传成功
-    success(file) {},
-    // 上传失败
-    fail(e) {},
-    // 弹出框显示
-    qianming(index) {
-      this.popupShow = true
-    },
-    // 清除签名
-    deqianming(index) {
-      this.form.keHu = ''
-    },
-    // 保存签名
-    save(val) {
-      this.form.keHu = val
-      this.popupShow = false
-    },
-    // 清除签名
-    clear(val) {
-      this.form.keHu = ''
-    },
-    /**
+    created() {},
+    methods: {
+        closePop() {
+            this.$emit('updataSet', false)
+        },
+        toCheckMode() {
+            if (this.$utils.isEmpty(this.listData)) {
+                return
+            }
+            if (this.checkMode) {
+                this.showA = true
+                this.checkedIds = []
+            }
+            this.checkMode = !this.checkMode
+        },
+        actionSheetCallback(e) {
+            this.form.gouTongLeiXing = e.text
+            this.sheetShow = false
+        },
+        timeShowCallback(e) {
+            const nowDate = new Date(e.getTime() + 8 * 60 * 60 * 1000)
+            const time = nowDate
+                .toJSON()
+                .split('T')
+                .join(' ')
+                .substr(0, 16)
+            this.form.gouTongRiQi = time
+            this.timeShow = false
+        },
+        gouTongRiQiClick(e) {
+            this.timeShow = true
+        },
+        // 获取上传状态
+        select(file) {
+            this.$uploades.selectUpload(file).then(res => {
+                res.forEach(item => {
+                    this.fuJianShangChuanArray.push(item)
+                })
+            })
+        },
+        // 删除
+        deleteMe(id) {
+            this.fuJianShangChuanArray = this.fuJianShangChuanArray.filter(
+                item => item.id !== id
+            )
+        },
+        // 获取上传进度
+        progress(e) {},
+        // 上传成功
+        success(file) {},
+        // 上传失败
+        fail(e) {},
+        // 弹出框显示
+        qianming(index) {
+            this.popupShow = true
+        },
+        // 清除签名
+        deqianming(index) {
+            this.form.keHu = ''
+        },
+        // 保存签名
+        save(val) {
+            this.form.keHu = val
+            this.popupShow = false
+        },
+        // 清除签名
+        clear(val) {
+            this.form.keHu = ''
+        },
+        /**
      * 关闭签名弹窗
      */
-    close() {
-      this.popupShow = false
-    },
+        close() {
+            this.popupShow = false
+        },
 
-    // 获取样品编号
-    getGtbh(callback) {
-      const smsParams = {
-        alias: 'gtbh'
-      }
-      const this_ = this
-      getNextIdByAlias(smsParams).then(res => {
-        if (res.state === 200) {
-          const data = res.data
-          this_.form.biaoDanBianHao = data
-        }
-      })
-    },
-    getKehu() {
-      const info = this.$store.getters.userInfo
-      if (info) {
-        this.form.keHuDanWeiMin = info.user.qq
-        this.form.lianXiDianHua = info.user.mobile
-        // this.form.keHuDanWeiMingChe = info.user.id
-        this.form.keHuLianXiRen = info.user.fullname
-        this.form.gouTongLeiXing = '投诉'
-        this.form.gouTongRiQi = this.$methCommon.time(16)
-        this.xuanzeTime = new Date()
-        this.form.yongHuYouXiang = info.user.email
-      }
-    },
-    getDe(id) {
-      const sql = `select * from t_khgtjlb where id_ = ${id}`
+        // 获取样品编号
+        getGtbh(callback) {
+            const smsParams = {
+                alias: 'gtbh'
+            }
+            const this_ = this
+            getNextIdByAlias(smsParams).then(res => {
+                if (res.state === 200) {
+                    const data = res.data
+                    this_.form.biaoDanBianHao = data
+                }
+            })
+        },
+        getKehu() {
+            const info = this.$store.getters.userInfo
+            if (info) {
+                this.form.keHuDanWeiMin = info.user.qq
+                this.form.lianXiDianHua = info.user.mobile
+                // this.form.keHuDanWeiMingChe = info.user.id
+                this.form.keHuLianXiRen = info.user.fullname
+                this.form.gouTongLeiXing = '投诉'
+                this.form.gouTongRiQi = this.$methCommon.time(16)
+                this.xuanzeTime = new Date()
+                this.form.yongHuYouXiang = info.user.email
+            }
+        },
+        getDe(id) {
+            const sql = `select * from t_khgtjlb where id_ = ${id}`
 
-      this.$common.request('sql', sql).then(res => {
-        if (res.state === 200) {
-          const data = res.variables.data[0]
-          this.form = {
-            id: data.id_,
-            xuanZeKeHu: data.xuan_ze_ke_hu_,
-            biaoDanBianHao: data.biao_dan_bian_hao,
-            buMenName: data.xuan_ze_ke_hu_,
-            keHuDanWeiMin: data.ke_hu_dan_wei_min,
-            keHuLianXiRen: data.ke_hu_lian_xi_ren,
-            weiTuoDanHao: data.wei_tuo_dan_hao_,
-            lianXiDianHua: data.lian_xi_dian_hua_,
-            yangPinMingCheng: data.yang_pin_ming_che,
-            yangPinBianHao: data.yang_pin_bian_hao,
-            yangPinLeiXing: data.yang_pin_lei_xing,
-            baoGaoBianHao: data.bao_gao_bian_hao_,
-            gouTongLeiXing: data.gou_tong_lei_xing,
-            gouTongNeiRong: data.gou_tong_nei_rong,
-            keHu: data.ke_hu_,
-            gouTongQueDingNei: data.gou_tong_que_ding,
-            leiXing: data.lei_xing_,
-            bianZhiShiJian: data.bian_zhi_shi_jian,
-            gouTongRiQi: data.gou_tong_ri_qi_,
-            yongHuYouXiang: data.yong_hu_you_xiang,
-            gouTongRenYuan: data.gou_tong_ren_yuan,
-            fuJian: data.fu_jian_
-          }
-          if (this.typeValue === '2' || this.typeValue === '4') {
-            this.getTaskId(data.id_)
-          }
-        }
-      })
-    },
-    getFileList(ids) {
-      this.$uploades.getFilesList(ids, this).then(res => {
-        this.fuJianShangChuanArray = res
-      })
-    },
-    onSubmit() {
-      if (!this.getYanZheng()) {
-        return
-      }
-      const tmpArray = []
-      this.fuJianShangChuanArray.forEach(item => {
-        tmpArray.push(item.id)
-      })
+            this.$common.request('sql', sql).then(res => {
+                if (res.state === 200) {
+                    const data = res.variables.data[0]
+                    this.form = {
+                        id: data.id_,
+                        xuanZeKeHu: data.xuan_ze_ke_hu_,
+                        biaoDanBianHao: data.biao_dan_bian_hao,
+                        buMenName: data.xuan_ze_ke_hu_,
+                        keHuDanWeiMin: data.ke_hu_dan_wei_min,
+                        keHuLianXiRen: data.ke_hu_lian_xi_ren,
+                        weiTuoDanHao: data.wei_tuo_dan_hao_,
+                        lianXiDianHua: data.lian_xi_dian_hua_,
+                        yangPinMingCheng: data.yang_pin_ming_che,
+                        yangPinBianHao: data.yang_pin_bian_hao,
+                        yangPinLeiXing: data.yang_pin_lei_xing,
+                        baoGaoBianHao: data.bao_gao_bian_hao_,
+                        gouTongLeiXing: data.gou_tong_lei_xing,
+                        gouTongNeiRong: data.gou_tong_nei_rong,
+                        keHu: data.ke_hu_,
+                        gouTongQueDingNei: data.gou_tong_que_ding,
+                        leiXing: data.lei_xing_,
+                        bianZhiShiJian: data.bian_zhi_shi_jian,
+                        gouTongRiQi: data.gou_tong_ri_qi_,
+                        yongHuYouXiang: data.yong_hu_you_xiang,
+                        gouTongRenYuan: data.gou_tong_ren_yuan,
+                        fuJian: data.fu_jian_
+                    }
+                    if (this.typeValue === '2' || this.typeValue === '4') {
+                        this.getTaskId(data.id_)
+                    }
+                }
+            })
+        },
+        getFileList(ids) {
+            this.$uploades.getFilesList(ids, this).then(res => {
+                this.fuJianShangChuanArray = res
+            })
+        },
+        onSubmit() {
+            if (!this.getYanZheng()) {
+                return
+            }
+            const tmpArray = []
+            this.fuJianShangChuanArray.forEach(item => {
+                tmpArray.push(item.id)
+            })
 
-      const info = this.$store.getters.userInfo
-      const useId = info.user.id
-      const detpId = info.employee.positions
-      const para = {
-        parameters: [
-          {
-            key: 'defId',
-            value: '1056942070293331968'
-          },
-          {
-            key: 'version',
-            value: '0'
-          },
-          {
-            key: 'data',
-            value: ''
-          }
-        ]
-      }
-      // this.form.fuJian = tmpArray.join(',')
-      this.form.bianZhiRen = useId
-      this.form.bianZhiShiJian = this.$methCommon.time(16)
-      this.form.bianZhiBuMen = this.mainPosition.id || detpId
-      // this.form.bianZhiBuMen = detpId
+            const info = this.$store.getters.userInfo
+            const useId = info.user.id
+            const detpId = info.employee.positions
+            const para = {
+                parameters: [
+                    {
+                        key: 'defId',
+                        value: '1056942070293331968'
+                    },
+                    {
+                        key: 'version',
+                        value: '0'
+                    },
+                    {
+                        key: 'data',
+                        value: ''
+                    }
+                ]
+            }
+            // this.form.fuJian = tmpArray.join(',')
+            this.form.bianZhiRen = useId
+            this.form.bianZhiShiJian = this.$methCommon.time(16)
+            this.form.bianZhiBuMen = this.mainPosition.id || detpId
+            // this.form.bianZhiBuMen = detpId
 
-      this.form.shiFouGuoShen = '已编制'
-      this.form.diDian = this.level.second
-      this.form.xuanZeKeHu = useId
-      para.parameters[2].value = JSON.stringify(this.form)
-      const that = this
+            this.form.shiFouGuoShen = '已编制'
+            this.form.diDian = this.level.second
+            this.form.xuanZeKeHu = useId
+            para.parameters[2].value = JSON.stringify(this.form)
+            const that = this
 
-      findFormJsonByBo(para)
-        .then(res => {
-          if (res.state === 200) {
-            that.$toast.success('提交成功!')
-            setTimeout(() => {
-              that.closePop()
-            }, 1000)
-          }
-        })
-        .catch(() => {})
-    },
-    onAgree(shiFouGuoShen, opinion, type) {
-      if (this.typeValue !== '2' && !this.getYanZheng()) {
-        return
-      }
-      // const info = this.$store.getters.userInfo
-      // const useId = info.user.id
-      // const detpId = info.employee.positions
-      const tmpArray = []
-      this.fuJianShangChuanArray.forEach(item => {
-        tmpArray.push(item.id)
-      })
-      this.form.fuJian = tmpArray.join(',')
-      this.form.shiFouGuoShen = shiFouGuoShen
-      this.form.diDian = this.level.second
-      this.form.shiFouGuoShen = shiFouGuoShen
-      const editData = {
-        data: JSON.stringify(this.form),
-        opinion: opinion,
-        taskId: this.taskId
-      }
-      agree(editData).then(res => {
-        if (res.state === 200) {
-          if (this.typeValue === '2') {
-            setTimeout(() => {
-              this.getPath(this.id)
-            }, 1000)
-          } else {
-            this.$toast.success(type + '成功!')
-            this.closePop()
-          }
-          this.$toast.success(type + '成功!')
-          setTimeout(() => {
-            this.closePop()
-          }, 1000)
-        } else {
-          this.$toast.fail(type + '异常!')
-        }
-      })
-    },
-    // 生成快照
-    getPath(id) {
-      const org = this.level.first
+            findFormJsonByBo(para)
+                .then(res => {
+                    if (res.state === 200) {
+                        that.$toast.success('提交成功!')
+                        setTimeout(() => {
+                            that.closePop()
+                        }, 1000)
+                    }
+                })
+                .catch(() => {})
+        },
+        onAgree(shiFouGuoShen, opinion, type) {
+            if (this.typeValue !== '2' && !this.getYanZheng()) {
+                return
+            }
+            // const info = this.$store.getters.userInfo
+            // const useId = info.user.id
+            // const detpId = info.employee.positions
+            const tmpArray = []
+            this.fuJianShangChuanArray.forEach(item => {
+                tmpArray.push(item.id)
+            })
+            this.form.fuJian = tmpArray.join(',')
+            this.form.shiFouGuoShen = shiFouGuoShen
+            this.form.diDian = this.level.second
+            this.form.shiFouGuoShen = shiFouGuoShen
+            const editData = {
+                data: JSON.stringify(this.form),
+                opinion: opinion,
+                taskId: this.taskId
+            }
+            agree(editData).then(res => {
+                if (res.state === 200) {
+                    if (this.typeValue === '2') {
+                        setTimeout(() => {
+                            this.getPath(this.id)
+                        }, 1000)
+                    } else {
+                        this.$toast.success(type + '成功!')
+                        this.closePop()
+                    }
+                    this.$toast.success(type + '成功!')
+                    setTimeout(() => {
+                        this.closePop()
+                    }, 1000)
+                } else {
+                    this.$toast.fail(type + '异常!')
+                }
+            })
+        },
+        // 生成快照
+        getPath(id) {
+            const org = this.level.first
 
-      const url = this.$common.getRequest.downloadReport(
-        '咨询活动/客户沟通记录表.rpx',
-        `id_=${id}&org_=${org}`
-      )
-      const data = {
-        url,
-        name: '用户沟通记录表' + this.$methCommon.time(19),
-        type: 'pdf'
-      }
-      snapshot(data).then(res => {
-        const result = res.data
-        if (result.state === 200) {
-          this.updateData(id, result.data.id)
-        }
-      })
-    },
-    updateData(id, fileId) {
-      const pp = {
-        updList: [
-          {
-            where: {
-              id_: id
-            },
-            param: {
-              kuai_zhao_: fileId,
-              shi_fou_guo_shen_: '已完成'
+            const url = this.$common.getRequest.downloadReport(
+                '咨询活动/客户沟通记录表.rpx',
+                `id_=${id}&org_=${org}`
+            )
+            const data = {
+                url,
+                name: '用户沟通记录表' + this.$methCommon.time(19),
+                type: 'pdf'
+            }
+            snapshot(data).then(res => {
+                const result = res.data
+                if (result.state === 200) {
+                    this.updateData(id, result.data.id)
+                }
+            })
+        },
+        updateData(id, fileId) {
+            const pp = {
+                updList: [
+                    {
+                        where: {
+                            id_: id
+                        },
+                        param: {
+                            kuai_zhao_: fileId,
+                            shi_fou_guo_shen_: '已完成'
+                        }
+                    }
+                ],
+                tableName: 't_khgtjlb'
+            }
+            const data = this.$sig(pp)
+            this.$common.request('update', data).then(res => {
+                this.$methCommon.getPrompt('提交成功', 'success')
+                setTimeout(() => {
+                    this.closePop()
+                }, 1000)
+            })
+        },
+        getYanZheng() {
+            const suList = [
+                'keHuLianXiRen',
+                'keHuDanWeiMin',
+                'lianXiDianHua',
+                'yongHuYouXiang',
+                'weiTuoDanHao',
+                'gouTongNeiRong'
+            ]
+            const suListName = [
+                '用户姓名',
+                '用户单位',
+                '联系电话',
+                '用户邮箱',
+                '沟通事项',
+                '沟通内容'
+            ]
+            for (const item in suList) {
+                if (!this.form[suList[item]]) {
+                    this.$toast({
+                        duration: 2000, // 持续展示 toast
+                        message: '请输入' + suListName[item]
+                    })
+                    return false
+                }
             }
-          }
-        ],
-        tableName: 't_khgtjlb'
-      }
-      const data = this.$sig(pp)
-      this.$common.request('update', data).then(res => {
-        this.$methCommon.getPrompt('提交成功', 'success')
-        setTimeout(() => {
-          this.closePop()
-        }, 1000)
-      })
-    },
-    getYanZheng() {
-      const suList = [
-        'keHuLianXiRen',
-        'keHuDanWeiMin',
-        'lianXiDianHua',
-        'yongHuYouXiang',
-        'weiTuoDanHao',
-        'gouTongNeiRong'
-      ]
-      const suListName = [
-        '用户姓名',
-        '用户单位',
-        '联系电话',
-        '用户邮箱',
-        '沟通事项',
-        '沟通内容'
-      ]
-      for (const item in suList) {
-        if (!this.form[suList[item]]) {
-          this.$toast({
-            duration: 2000, // 持续展示 toast
-            message: '请输入' + suListName[item]
-          })
-          return false
-        }
-      }
 
-      const selList = ['gouTongRiQi', 'gouTongLeiXing']
-      const selListName = ['沟通时间', '沟通类型']
-      for (const item in selList) {
-        if (!this.form[selList[item]]) {
-          this.$toast({
-            duration: 2000, // 持续展示 toast
-            message: '请选择' + selListName[item]
-          })
-          return false
-        }
-      }
+            const selList = ['gouTongRiQi', 'gouTongLeiXing']
+            const selListName = ['沟通时间', '沟通类型']
+            for (const item in selList) {
+                if (!this.form[selList[item]]) {
+                    this.$toast({
+                        duration: 2000, // 持续展示 toast
+                        message: '请选择' + selListName[item]
+                    })
+                    return false
+                }
+            }
 
-      if (!this.form.keHu) {
-        this.$toast({
-          duration: 2000, // 持续展示 toast
-          message: '请填写签名'
-        })
-        return false
-      }
+            if (!this.form.keHu) {
+                this.$toast({
+                    duration: 2000, // 持续展示 toast
+                    message: '请填写签名'
+                })
+                return false
+            }
 
-      if (this.form.gouTongLeiXing === '其它' && !this.form.qiTa) {
-        this.$toast({
-          duration: 2000, // 持续展示 toast
-          message: '请填写其他类型'
-        })
-        return false
-      }
+            if (this.form.gouTongLeiXing === '其它' && !this.form.qiTa) {
+                this.$toast({
+                    duration: 2000, // 持续展示 toast
+                    message: '请填写其他类型'
+                })
+                return false
+            }
 
-      return true
-    },
-    // 根据委托单id查询 taskId
-    getTaskId(id) {
-      let sql = ``
-      if (this.typeValue === '2') {
-        sql = `select TASK_ID_,PROC_INST_ID_ from ibps_bpm_tasks where NAME_ = '确认' and NODE_ID_ = 'Activity_02lroj1' and PROC_DEF_KEY_ = 'Process_0pjp1fy' and EXEC_ID_ = (select PROC_INST_ID_ from act_ru_execution where ACT_ID_ = 'Activity_02lroj1' and BUSINESS_KEY_ = '${id}') ORDER BY CREATE_TIME_ desc`
-      } else if (this.typeValue === '4') {
-        sql = `select TASK_ID_,PROC_INST_ID_ from ibps_bpm_tasks where NAME_ = '沟通' and NODE_ID_ = 'Activity_0qy1dd7' and PROC_DEF_KEY_ = 'Process_0pjp1fy' and EXEC_ID_ = (select PROC_INST_ID_ from act_ru_execution where ACT_ID_ = 'Activity_0qy1dd7' and BUSINESS_KEY_ = '${id}') ORDER BY CREATE_TIME_ desc`
-      }
-      this.$common.request('sql', sql).then(res => {
-        if (res.state === 200) {
-          const result = res.variables.data[0]
-          this.taskId = result.TASK_ID_
+            return true
+        },
+        // 根据委托单id查询 taskId
+        getTaskId(id) {
+            let sql = ``
+            if (this.typeValue === '2') {
+                sql = `select TASK_ID_,PROC_INST_ID_ from ibps_bpm_tasks where NAME_ = '确认' and NODE_ID_ = 'Activity_02lroj1' and PROC_DEF_KEY_ = 'Process_0pjp1fy' and EXEC_ID_ = (select PROC_INST_ID_ from act_ru_execution where ACT_ID_ = 'Activity_02lroj1' and BUSINESS_KEY_ = '${id}') ORDER BY CREATE_TIME_ desc`
+            } else if (this.typeValue === '4') {
+                sql = `select TASK_ID_,PROC_INST_ID_ from ibps_bpm_tasks where NAME_ = '沟通' and NODE_ID_ = 'Activity_0qy1dd7' and PROC_DEF_KEY_ = 'Process_0pjp1fy' and EXEC_ID_ = (select PROC_INST_ID_ from act_ru_execution where ACT_ID_ = 'Activity_0qy1dd7' and BUSINESS_KEY_ = '${id}') ORDER BY CREATE_TIME_ desc`
+            }
+            this.$common.request('sql', sql).then(res => {
+                if (res.state === 200) {
+                    const result = res.variables.data[0]
+                    this.taskId = result.TASK_ID_
 
-          this.getProcInstId(result.PROC_INST_ID_)
-        }
-      })
-    },
-    // 根据委托单id查询 taskId
-    getProcInstId(id) {
-      const sql = `select OPTION_ from ibps_bpm_oper_log where PROC_INST_ID_ = '${id}'   order by create_time_ desc  limit 1`
-      this.$common.request('sql', sql).then(res => {
-        if (res.state === 200) {
-          const result = res.variables.data[0]
-          this.option = result.OPTION_
+                    this.getProcInstId(result.PROC_INST_ID_)
+                }
+            })
+        },
+        // 根据委托单id查询 taskId
+        getProcInstId(id) {
+            const sql = `select OPTION_ from ibps_bpm_oper_log where PROC_INST_ID_ = '${id}'   order by create_time_ desc  limit 1`
+            this.$common.request('sql', sql).then(res => {
+                if (res.state === 200) {
+                    const result = res.variables.data[0]
+                    this.option = result.OPTION_
+                }
+            })
+        },
+        getShow() {
+            this.$refs['picker'].show()
+        },
+        getPageA() {
+            // const pages = getCurrentPages()
+            // const prevPage = pages[pages.length - 2]
+            // prevPage.$vm.getValue()
+            // uni.navigateBack({
+            // 	dalta: 1
+            // })
+        },
+        uploadClick(item) {
+            if (/^(pdf|png|jpg|jpeg|gif)$/.test(item.ext)) {
+                // uni.navigateTo({
+                // 	url: `/pages/fileView/fileView?id=${item.id}&ext=${item.ext}`
+                // })
+            } else {
+                this.$uploades.download(item.id, item.name, this)
+            }
+        },
+        // 退回原因
+        getBack() {
+            this.content = this.option
+            this.backShow = true
+            this.$dialog
+                .alert({
+                    title: '退回原因',
+                    message: this.option,
+                    theme: 'round-button',
+                    confirmButtonColor: '#1989fa'
+                })
+                .then(() => {
+                    // on close
+                })
+        },
+        cancel() {
+            this.backShow = false
+        },
+        formatter(type, val) {
+            if (type === 'year') {
+                return val + '年'
+            }
+            if (type === 'month') {
+                return val + '月'
+            }
+            if (type === 'day') {
+                return val + '日'
+            }
+            return val
         }
-      })
-    },
-    getShow() {
-      this.$refs['picker'].show()
-    },
-    getPageA() {
-      // const pages = getCurrentPages()
-      // const prevPage = pages[pages.length - 2]
-      // prevPage.$vm.getValue()
-      // uni.navigateBack({
-      // 	dalta: 1
-      // })
-    },
-    uploadClick(item) {
-      if (/^(pdf|png|jpg|jpeg|gif)$/.test(item.ext)) {
-        // uni.navigateTo({
-        // 	url: `/pages/fileView/fileView?id=${item.id}&ext=${item.ext}`
-        // })
-      } else {
-        this.$uploades.download(item.id, item.name, this)
-      }
-    },
-    // 退回原因
-    getBack() {
-      this.content = this.option
-      this.backShow = true
-      this.$dialog
-        .alert({
-          title: '退回原因',
-          message: this.option,
-          theme: 'round-button',
-          confirmButtonColor: '#1989fa'
-        })
-        .then(() => {
-          // on close
-        })
-    },
-    cancel() {
-      this.backShow = false
-    },
-    formatter(type, val) {
-      if (type === 'year') {
-        return val + '年'
-      }
-      if (type === 'month') {
-        return val + '月'
-      }
-      if (type === 'day') {
-        return val + '日'
-      }
-      return val
     }
-  }
 }
 </script>
 <style lang="scss" scoped>

+ 324 - 311
src/views/platform/bpmn/communication/communicationList.vue

@@ -1,351 +1,364 @@
 <template>
-  <div :class="{'ibps-fixed-toolbar':checkMode}">
-    <van-sticky>
-      <van-nav-bar :title="generateTitle($route.name,$route.params.title||$route.meta.title)"
-        :left-text="$t('common.button.back')" left-arrow
-        @click-left="$router.push({ name: 'dashboard' })" />
-      <van-search v-model="twoParam" show-action placeholder="请输入表单编号/用户姓名" @search="onSearch">
-        <template #action>
-          <van-icon name="filter-o" :class="{'ibps-active':stateActive}" @click="clickMoreSearch" />
-        </template>
-      </van-search>
-    </van-sticky>
-    <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
-      <van-list v-model="loading" :finished="finished" @load="loadData">
-        <van-checkbox-group v-model="checkedIds">
-          <van-cell v-for="(item,index) in listData" :key="item.id+index" >
-            <div class="sectionBox verticalLine">
-							<div class="left ">表单编号:</div>
-							<div>{{item.biao_dan_bian_hao}} </div>
-						</div>
-            <div class="sectionBox">
-							<div class="left">用户姓名:</div>
-							<div>{{item.ke_hu_lian_xi_ren}} </div>
-						</div>
-						<div class="sectionBox">
-							<div class="left">用户单位:</div>
-							<div>{{item.ke_hu_dan_wei_min}} </div>
-						</div>
-						<div class="sectionBox">
-							<div class="left">沟通类型:</div>
-							<div>{{item.gou_tong_lei_xing}} </div>
-						</div>
-						<div class="sectionBox">
-							<div class="left">状态:</div>
-							<div style="color: #7349ff;" v-if="item.shi_fou_guo_shen_ == '1'">已完成</div>
-							<div style="color: red;" v-else-if="item.shi_fou_guo_shen_ == '已退回'">已退回</div>
-							<div v-else>
-								{{item.shi_fou_guo_shen_}}
-							</div>
-						</div>
-						<div style=" width: 100%; text-align: right; padding-top: 5rpx;padding-bottom: 0rpx;">
-							<van-button type="warning" size="small" @click="getGo(item.id_,'2')" class="u-m-r-15 btn-sty" v-if="item.lei_xing_ == '1' && item.shi_fou_guo_shen_ == '已编制'">确定</van-button>
-							<van-button type="success" size="small" class="u-m-r-15 btn-sty" @click="getGo(item.id_,'4')" v-if="item.shi_fou_guo_shen_ == '已退回'">修改
-							</van-button>
-							<van-button type="warning" size="small" class="btn-back-color btn-sty" @click="getGo(item.id_,'1')">查阅
-							</van-button>
-						</div>
-          </van-cell>
-        </van-checkbox-group>
-      </van-list>
-      <ibps-list-result-page :result-type="resultType" :error-type="errorType" :result-message="resultMessage" />
-    </van-pull-refresh>
-    <div class="suspensionBtn">
-      <img src="@/assets/images/add.png" alt="" srcset="" @click="LiftUpPop()">
+    <div :class="{'ibps-fixed-toolbar':checkMode}">
+        <van-sticky>
+            <van-nav-bar
+                :title="generateTitle($route.name,$route.params.title||$route.meta.title)"
+                :left-text="$t('common.button.back')"
+                left-arrow
+                @click-left="$router.push({ name: 'dashboard' })"
+            />
+            <van-search v-model="twoParam" show-action placeholder="请输入表单编号/用户姓名" @search="onSearch">
+                <template #action>
+                    <van-icon name="filter-o" :class="{'ibps-active':stateActive}" @click="clickMoreSearch" />
+                </template>
+            </van-search>
+        </van-sticky>
+        <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
+            <van-list v-model="loading" :finished="finished" @load="loadData">
+                <van-checkbox-group v-model="checkedIds">
+                    <van-cell v-for="(item,index) in listData" :key="item.id+index">
+                        <div class="sectionBox verticalLine">
+                            <div class="left ">表单编号:</div>
+                            <div>{{ item.biao_dan_bian_hao }} </div>
+                        </div>
+                        <div class="sectionBox">
+                            <div class="left">用户姓名:</div>
+                            <div>{{ item.ke_hu_lian_xi_ren }} </div>
+                        </div>
+                        <div class="sectionBox">
+                            <div class="left">用户单位:</div>
+                            <div>{{ item.ke_hu_dan_wei_min }} </div>
+                        </div>
+                        <div class="sectionBox">
+                            <div class="left">沟通类型:</div>
+                            <div>{{ item.gou_tong_lei_xing }} </div>
+                        </div>
+                        <div class="sectionBox">
+                            <div class="left">状态:</div>
+                            <div v-if="item.shi_fou_guo_shen_ == '1'" style="color: #7349ff;">已完成</div>
+                            <div v-else-if="item.shi_fou_guo_shen_ == '已退回'" style="color: red;">已退回</div>
+                            <div v-else>
+                                {{ item.shi_fou_guo_shen_ }}
+                            </div>
+                        </div>
+                        <div style=" width: 100%; text-align: right; padding-top: 5rpx;padding-bottom: 0rpx;">
+                            <van-button v-if="item.lei_xing_ == '1' && item.shi_fou_guo_shen_ == '已编制'" type="warning" size="small" class="u-m-r-15 btn-sty" @click="getGo(item.id_,'2')">确定</van-button>
+                            <van-button v-if="item.shi_fou_guo_shen_ == '已退回'" type="success" size="small" class="u-m-r-15 btn-sty" @click="getGo(item.id_,'4')">修改
+                            </van-button>
+                            <van-button type="warning" size="small" class="btn-back-color btn-sty" @click="getGo(item.id_,'1')">查阅
+                            </van-button>
+                        </div>
+                    </van-cell>
+                </van-checkbox-group>
+            </van-list>
+            <ibps-list-result-page :result-type="resultType" :error-type="errorType" :result-message="resultMessage" />
+        </van-pull-refresh>
+        <div class="suspensionBtn">
+            <img src="@/assets/images/add.png" alt="" srcset="" @click="LiftUpPop()">
+        </div>
+        <approve-popup
+            :visible="batchOpinionPopup"
+            :task-id="selectedIds"
+            :action="actionName"
+            @close="(visible)=>{batchOpinionPopup =visible}"
+            @callback="onRefreshPage"
+        />
+        <!--高级查询-->
+        <ibps-more-search
+            :show="moreSearchPopup"
+            :search-forms="searchForms"
+            @callback="onMoreSearch"
+            @close="callback => moreSearchPopup = callback"
+            @reset-form="resetForm"
+        >
+            <template v-slot:definition>
+                <ibps-bpmn-definition v-model="defKey" value-key="defKey" input-align="left" class="van-hairline--bottom" />
+            </template>
+        </ibps-more-search>
+        <communication :id="id" :show-pop="showPop" :type-value="typeValue" @updataSet="updataSet" />
     </div>
-    <approve-popup :visible="batchOpinionPopup" :task-id="selectedIds" :action="actionName"
-      @close="(visible)=>{batchOpinionPopup =visible}" @callback="onRefreshPage" />
-    <!--高级查询-->
-    <ibps-more-search :show="moreSearchPopup" :search-forms="searchForms" @callback="onMoreSearch"
-      @close="callback => moreSearchPopup = callback" @reset-form="resetForm">
-      <template v-slot:definition>
-        <ibps-bpmn-definition v-model="defKey" value-key="defKey" input-align="left" class="van-hairline--bottom" />
-      </template>
-    </ibps-more-search>
-    <communication :showPop = "showPop" @updataSet="updataSet" :typeValue = "typeValue" :id = "id"></communication>
-  </div>
 </template>
 <script>
-  import i18n from '@/utils/i18n'
-  import random from '@/mixins/random'
-  import bpmnStatus from '@/mixins/bpmnStatus'
-  import ActionUtils from '@/utils/action'
+import i18n from '@/utils/i18n'
+import random from '@/mixins/random'
+import bpmnStatus from '@/mixins/bpmnStatus'
+import ActionUtils from '@/utils/action'
 
-  import ApprovePopup from '@/business/platform/bpmn/form-ext/approve'
+import ApprovePopup from '@/business/platform/bpmn/form-ext/approve'
 
-  import IbpsMoreSearch from '@/components/ibps-more-search'
-  import IbpsAvatar from '@/components/ibps-avatar'
-  import IbpsToolbar from '@/components/ibps-toolbar'
-  import IbpsListResultPage from '@/components/ibps-list-result-page'
-  import IbpsTypeTree from '@/business/platform/cat/type/tree'
-  import IbpsBpmnDefinition from '@/business/platform/bpmn/definition/field'
+import IbpsMoreSearch from '@/components/ibps-more-search'
+import IbpsAvatar from '@/components/ibps-avatar'
+import IbpsToolbar from '@/components/ibps-toolbar'
+import IbpsListResultPage from '@/components/ibps-list-result-page'
+import IbpsTypeTree from '@/business/platform/cat/type/tree'
+import IbpsBpmnDefinition from '@/business/platform/bpmn/definition/field'
 
-  import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
-  import communication from './communication.vue'
+import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
+import communication from './communication.vue'
 
-  export default {
+export default {
     components: {
-      IbpsMoreSearch,
-      IbpsAvatar,
-      IbpsListResultPage,
-      IbpsTypeTree,
-      IbpsBpmnDefinition,
-      IbpsToolbar,
-      ApprovePopup,
-      IbpsBpmnFormrenderDialog,
-      communication
+        IbpsMoreSearch,
+        IbpsAvatar,
+        IbpsListResultPage,
+        IbpsTypeTree,
+        IbpsBpmnDefinition,
+        IbpsToolbar,
+        ApprovePopup,
+        IbpsBpmnFormrenderDialog,
+        communication
     },
     mixins: [random, bpmnStatus],
     data() {
-      const useId = this.$store.getters.userId
-      return {
-        useId,
-        moreSearchPopup: false,
-        stateActive: false,
-        searchForms: {
-          forms: [
-            { prop: 'biao_dan_bian_hao', label: '表单编号', fieldType: 'text'  },
-            { prop: 'ke_hu_lian_xi_ren', label: '用户姓名',  fieldType: 'text' },
-            { prop: 'gou_tong_lei_xing', label: '沟通类型', fieldType: 'checker', cols: 3, options: [
-                {
-                  value: '全部',
-                  label: '全部'
-                }, {
-                  value: '投诉',
-                  label: '投诉'
-                }, {
-                  value: '检验项目',
-                  label: '检验项目'
-                }, {
-                  value: '危机值报告',
-                  label: '危机值报告'
-                }, {
-                  value: '口头报告结果',
-                  label: '口头报告结果'
-                }, {
-                  value: '延迟报告',
-                  label: '延迟报告'
-                }, {
-                  value: '其它',
-                  label: '其它'
-                }
-              ]
-            }
-          ]
-        },
-        subject: '',
-        typeId: '',
-        defKey: '',
-        twoParam: '',
-        moreParams: {},
+        const useId = this.$store.getters.userId
+        return {
+            useId,
+            moreSearchPopup: false,
+            stateActive: false,
+            searchForms: {
+                forms: [
+                    { prop: 'biao_dan_bian_hao', label: '表单编号', fieldType: 'text' },
+                    { prop: 'ke_hu_lian_xi_ren', label: '用户姓名', fieldType: 'text' },
+                    { prop: 'gou_tong_lei_xing', label: '沟通类型', fieldType: 'checker', cols: 3, options: [
+                        {
+                            value: '全部',
+                            label: '全部'
+                        }, {
+                            value: '投诉',
+                            label: '投诉'
+                        }, {
+                            value: '检验项目',
+                            label: '检验项目'
+                        }, {
+                            value: '危机值报告',
+                            label: '危机值报告'
+                        }, {
+                            value: '口头报告结果',
+                            label: '口头报告结果'
+                        }, {
+                            value: '延迟报告',
+                            label: '延迟报告'
+                        }, {
+                            value: '其它',
+                            label: '其它'
+                        }
+                    ]
+                    }
+                ]
+            },
+            subject: '',
+            typeId: '',
+            defKey: '',
+            twoParam: '',
+            moreParams: {},
 
-        listData: [],
-        pagination: {},
-        sorts: {},
+            listData: [],
+            pagination: {},
+            sorts: {},
 
-        loading: false,
-        finished: false,
-        refreshing: false,
-        resultType: 'init',
-        errorType: null,
-        resultMessage: null,
+            loading: false,
+            finished: false,
+            refreshing: false,
+            resultType: 'init',
+            errorType: null,
+            resultMessage: null,
 
-        checkMode: false,
-        checkedIds: [],
-        show: false,
-        batchOpinionPopup: false,
-        actionName: 'agree',
+            checkMode: false,
+            checkedIds: [],
+            show: false,
+            batchOpinionPopup: false,
+            actionName: 'agree',
 
-        typeTreePopup: false,
-        scrollWhere: 0,
-        taskId: '',
-        formrenderVisible: false,
-        formrenderTitle: '',
-        page: 0,
-        showPop: false,
-        typeValue: '0',
-        id: ''
-      }
+            typeTreePopup: false,
+            scrollWhere: 0,
+            taskId: '',
+            formrenderVisible: false,
+            formrenderTitle: '',
+            page: 0,
+            showPop: false,
+            typeValue: '0',
+            id: ''
+        }
     },
     computed: {
-      rightText() {
-        return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
-      },
-      selectedIds() {
-        return this.checkedIds.join(',')
-      }
+        rightText() {
+            return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
+        },
+        selectedIds() {
+            return this.checkedIds.join(',')
+        }
     },
     methods: {
-      updataSet(v){
-        this.showPop=v
-        this.startScroll()
-      },
-      generateTitle(name, title) { // generateTitle by vue-i18n
-        return i18n.generateTitle(name, title)
-      },
-      /**
+        updataSet(v) {
+            this.showPop = v
+            this.startScroll()
+        },
+        generateTitle(name, title) { // generateTitle by vue-i18n
+            return i18n.generateTitle(name, title)
+        },
+        /**
        * 加载数据
        */
-      loadData(j) {
-        this.loading = true
-        const params = this.getSearcFormData()
-        if( j === 'search'){
-          this.page = 0
-        }
-        let itemSql = ``
-        let gtlx = params.parameters.find( i => i.key === 'gou_tong_lei_xing' ) || ''
-				if ( gtlx && gtlx.value != '全部') {
-					itemSql = itemSql + `and gou_tong_lei_xing = '${gtlx.value}'`
-				}
-        let bdbh = params.parameters.find( i => i.key === 'biao_dan_bian_hao' ) || ''
-				if ( bdbh && bdbh.value != '') {
-					itemSql = itemSql + `and biao_dan_bian_hao like '%${bdbh.value}%'`
-				}
-        let khlxr = params.parameters.find( i => i.key === 'ke_hu_lian_xi_ren' ) || ''
-				if ( khlxr && khlxr.value != '') {
-					itemSql = itemSql + `and ke_hu_lian_xi_ren like '%${khlxr.value}%'`
-				}
-        let two = params.parameters.find( i => i.key === 'two' ) || ''
-				if ( two ) {
-					itemSql = itemSql + `and (ke_hu_lian_xi_ren like '%${two.value}%' or biao_dan_bian_hao like '%${two.value}%')`
-				}
-        let sql =
-					`select * from t_khgtjlb where (create_by_ = '${this.useId}' or xuan_ze_ke_hu_ = '${this.useId}') ${itemSql}  ORDER BY create_time_ desc LIMIT ${this.page*params.requestPage.limit},${params.requestPage.limit}`
-        this.$common.request('sql', sql).then(response => {
-          // 处理数据
-          ActionUtils.handleListDataCommon(this, response.variables)
-        }).catch((e) => {
-          ActionUtils.handleErrorData(this, e)
-        })
-      },
-      /**
+        loadData(j) {
+            this.loading = true
+            const params = this.getSearcFormData()
+            if (j === 'search') {
+                this.page = 0
+            }
+            let itemSql = ``
+            const gtlx = params.parameters.find(i => i.key === 'gou_tong_lei_xing') || ''
+            if (gtlx && gtlx.value !== '全部') {
+                itemSql = itemSql + `and gou_tong_lei_xing = '${gtlx.value}'`
+            }
+            const bdbh = params.parameters.find(i => i.key === 'biao_dan_bian_hao') || ''
+            if (bdbh && bdbh.value !== '') {
+                itemSql = itemSql + `and biao_dan_bian_hao like '%${bdbh.value}%'`
+            }
+            const khlxr = params.parameters.find(i => i.key === 'ke_hu_lian_xi_ren') || ''
+            if (khlxr && khlxr.value !== '') {
+                itemSql = itemSql + `and ke_hu_lian_xi_ren like '%${khlxr.value}%'`
+            }
+            const two = params.parameters.find(i => i.key === 'two') || ''
+            if (two) {
+                itemSql = itemSql + `and (ke_hu_lian_xi_ren like '%${two.value}%' or biao_dan_bian_hao like '%${two.value}%')`
+            }
+            const sql =
+					`select * from t_khgtjlb where (create_by_ = '${this.useId}' or xuan_ze_ke_hu_ = '${this.useId}') ${itemSql}  ORDER BY create_time_ desc LIMIT ${this.page * params.requestPage.limit},${params.requestPage.limit}`
+            this.$common.request('sql', sql).then(response => {
+                // 处理数据
+                ActionUtils.handleListDataCommon(this, response.variables)
+            }).catch((e) => {
+                ActionUtils.handleErrorData(this, e)
+            })
+        },
+        /**
        * 获取格式化参数
        */
-      getSearcFormData() {
-        let params = {}
-        if (this.$utils.isNotEmpty(this.twoParam)) {
-          params['two'] = this.twoParam
-        }
-        // if (this.$utils.isNotEmpty(this.typeId)) {
-        //   params['Q^temp.TYPE_ID_^S'] = this.typeId
-        // }
-        // if (this.$utils.isNotEmpty(this.defKey)) {
-        //   params['Q^temp.proc_def_key_^S'] = this.defKey
-        // }
-        if (this.$utils.isNotEmpty(this.moreParams)) {
-          params = Object.assign(params, this.moreParams)
-        }
-        return ActionUtils.formatParams(
-          params,
-          this.pagination,
-          this.sorts)
-      },
-      LiftUpPop() {
-        this.scrollWhere = window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;
-        this.stopScroll()
-        this.getGo('', '3')
-      },
-      /**
+        getSearcFormData() {
+            let params = {}
+            if (this.$utils.isNotEmpty(this.twoParam)) {
+                params['two'] = this.twoParam
+            }
+            // if (this.$utils.isNotEmpty(this.typeId)) {
+            //   params['Q^temp.TYPE_ID_^S'] = this.typeId
+            // }
+            // if (this.$utils.isNotEmpty(this.defKey)) {
+            //   params['Q^temp.proc_def_key_^S'] = this.defKey
+            // }
+            if (this.$utils.isNotEmpty(this.moreParams)) {
+                params = Object.assign(params, this.moreParams)
+            }
+            return ActionUtils.formatParams(
+                params,
+                this.pagination,
+                this.sorts)
+        },
+        LiftUpPop() {
+            this.scrollWhere = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop
+            this.stopScroll()
+            this.getGo('', '3')
+        },
+        /**
        * 下拉刷新
        */
-      onRefresh() {
-        this.refreshing = true
-        this.finished = false
-        this.loading = true
-        this.onSearch()
-      },
-      /**
+        onRefresh() {
+            this.refreshing = true
+            this.finished = false
+            this.loading = true
+            this.onSearch()
+        },
+        /**
        * 查询
        */
-      onSearch() {
-        this.stateActive = false
-        ActionUtils.initListData(this)
-        this.loadData('search')
-      },
-      /**
+        onSearch() {
+            this.stateActive = false
+            ActionUtils.initListData(this)
+            this.loadData('search')
+        },
+        /**
        * 高级查询
        */
-      onMoreSearch(params) {
-        this.moreParams = params
-        this.onSearch()
-        if (this.$utils.isNotEmpty(params)) {
-          this.stateActive = true
-        }
-      },
-      /**
+        onMoreSearch(params) {
+            this.moreParams = params
+            this.onSearch()
+            if (this.$utils.isNotEmpty(params)) {
+                this.stateActive = true
+            }
+        },
+        /**
        * 弹窗更多查询条件
        */
-      clickMoreSearch() {
-        this.moreSearchPopup = true
-        this.stateActive = false
-      },
-      /**
+        clickMoreSearch() {
+            this.moreSearchPopup = true
+            this.stateActive = false
+        },
+        /**
        * 重置表单
        */
-      resetForm() {
-        this.typeId = ''
-        this.defKey = ''
-      },
+        resetForm() {
+            this.typeId = ''
+            this.defKey = ''
+        },
 
-      onRefreshPage() {
-        this.checkedIds = []
-        this.checkMode = false
-        this.onRefresh()
-      },
+        onRefreshPage() {
+            this.checkedIds = []
+            this.checkMode = false
+            this.onRefresh()
+        },
 
-      onClick(item, index) {
-        if (this.checkMode) {
-          this.$refs.checkboxes[index].toggle()
-        } else {
-          this.taskId = item.id
-          this.formrenderTitle = item.procDefName
-          this.formrenderVisible = true
-        }
-      },
-      clickType() {
-        this.typeTreePopup = true
-      },
-      clickTypeNode(data) {
-        this.typeId = data.id
-        this.onMoreSearch({})
-      },
-      toCheckMode() {
-        if (this.$utils.isEmpty(this.listData)) {
-          return
-        }
-        if (this.checkMode) {
-          this.show = true
-          this.checkedIds = []
-        }
-        this.checkMode = !this.checkMode
-      },
-      stopScroll(){
-        let mid = this.scrollWhere
-        // document.documentElement.style.overflow='hidden';
-        document.body.style.overflow='hidden';
-        // document.documentElement.style.position='fixed';
-        document.body.style.position='fixed';
-        // document.documentElement.style.top=-mid+'px';
-        document.body.style.top=-mid+'px';
-      },
-      //启用页面滚动
-      startScroll(){
+        onClick(item, index) {
+            if (this.checkMode) {
+                this.$refs.checkboxes[index].toggle()
+            } else {
+                this.taskId = item.id
+                this.formrenderTitle = item.procDefName
+                this.formrenderVisible = true
+            }
+        },
+        clickType() {
+            this.typeTreePopup = true
+        },
+        clickTypeNode(data) {
+            this.typeId = data.id
+            this.onMoreSearch({})
+        },
+        toCheckMode() {
+            if (this.$utils.isEmpty(this.listData)) {
+                return
+            }
+            if (this.checkMode) {
+                this.show = true
+                this.checkedIds = []
+            }
+            this.checkMode = !this.checkMode
+        },
+        stopScroll() {
+            const mid = this.scrollWhere
+            // document.documentElement.style.overflow='hidden';
+            document.body.style.overflow = 'hidden'
+            // document.documentElement.style.position='fixed';
+            document.body.style.position = 'fixed'
+            // document.documentElement.style.top=-mid+'px';
+            document.body.style.top = -mid + 'px'
+        },
+        // 启用页面滚动
+        startScroll() {
         // document.documentElement.style.overflow='';
-        document.body.style.overflow='auto';
-        document.body.style.position='static';
-        window.scrollTo(0,this.scrollWhere)
-        this.scrollWhere=0
-      },
-      getGo(id, typeValue) {
-        this.id = id
-        this.typeValue = typeValue
-        this.showPop = true
-				// uni.navigateTo({
-				// 	url: `./communication?id=${id}&typeValue=${typeValue}`
-				// })
-			},
+            document.body.style.overflow = 'auto'
+            document.body.style.position = 'static'
+            window.scrollTo(0, this.scrollWhere)
+            this.scrollWhere = 0
+        },
+        getGo(id, typeValue) {
+            this.id = id
+            this.typeValue = typeValue
+            this.showPop = true
+            // uni.navigateTo({
+            // 	url: `./communication?id=${id}&typeValue=${typeValue}`
+            // })
+        }
     }
-  }
+}
 </script>
 <style lang="scss" scoped>
   ::v-deep .van-cell__title {
@@ -409,4 +422,4 @@
       height: 100%;
     }
   }
-</style>
+</style>

+ 271 - 231
src/views/platform/bpmn/my-draft/index.vue

@@ -1,276 +1,316 @@
 <template>
-  <div :class="{'ibps-fixed-toolbar':checkMode}">
-    <van-sticky>
-      <van-nav-bar :title="generateTitle($route.name,$route.params.title||$route.meta.title)"
-        :left-text="$t('common.button.back')" :right-text="$utils.isNotEmpty(listData)?rightText:''" left-arrow
-        @click-left="$router.push({ name: 'dashboard' })" @click-right="toCheckMode()" />
-      <van-search v-model="subject" show-action placeholder="请输入搜索关键词" @search="onSearch">
-        <template #left>
-          <van-icon name="bars" :class="{'ibps-active':$utils.isNotEmpty(typeId)}" class="ibps-pr-5"
-            @click="clickType" />
-        </template>
-        <template #action>
-          <van-icon name="filter-o" :class="{'ibps-active':stateActive}" @click="clickMoreSearch" />
-        </template>
-      </van-search>
-    </van-sticky>
-    <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
-      <van-list v-model="loading" :finished="finished" @load="loadData">
-        <van-checkbox-group v-model="checkedIds">
-          <van-cell v-for="(item,index) in listData" :key="item.id+index" :title="item.procDefName"
-            :label="getTaskDesc(item.subject)" @click="onClick(item,index)">
-            <template slot="icon">
-              <van-checkbox v-if="checkMode" ref="checkboxes" :name="item.id" class="ibps-mr-10" />
-              <ibps-avatar v-else :icon="_randomIcon(index)" :text="item.name" :bg-color="_randomColor(index)"
-                radius="4" icon-prefix="ibps-icon" class="ibps-mr-10" />
-            </template>
-            <span>{{ item.createTime|formatRelativeTime }}</span>
-            <div>
-              <!-- <van-tag plain :type=" item.status | optionsFilter(bpmnStatusOptions,'type')">{{ item.status | optionsFilter(bpmnStatusOptions) }}</van-tag> -->
-              <van-tag size="medium"
-                :color="item.status | optionsFilter(bpmnStatusOptions,'type') | optionsFilter(colorOptions,'color','type')"
-                :text-color="item.status | optionsFilter(bpmnStatusOptions,'type') | optionsFilter(colorOptions,'textColor','type')">
-                {{ item.status| optionsFilter(bpmnStatusOptions) }}</van-tag>
-            </div>
-          </van-cell>
-        </van-checkbox-group>
-        <ibps-list-result-page :result-type="resultType" :error-type="errorType" :result-message="resultMessage" />
-      </van-list>
-    </van-pull-refresh>
+    <div :class="{'ibps-fixed-toolbar':checkMode}">
+        <van-sticky>
+            <van-nav-bar
+                :title="generateTitle($route.name,$route.params.title||$route.meta.title)"
+                :left-text="$t('common.button.back')"
+                :right-text="$utils.isNotEmpty(listData)?rightText:''"
+                left-arrow
+                @click-left="$router.push({ name: 'dashboard' })"
+                @click-right="toCheckMode()"
+            />
+            <van-search v-model="subject" show-action placeholder="请输入搜索关键词" @search="onSearch">
+                <template #left>
+                    <van-icon
+                        name="bars"
+                        :class="{'ibps-active':$utils.isNotEmpty(typeId)}"
+                        class="ibps-pr-5"
+                        @click="clickType"
+                    />
+                </template>
+                <template #action>
+                    <van-icon name="filter-o" :class="{'ibps-active':stateActive}" @click="clickMoreSearch" />
+                </template>
+            </van-search>
+        </van-sticky>
+        <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
+            <van-list v-model="loading" :finished="finished" @load="loadData">
+                <van-checkbox-group v-model="checkedIds">
+                    <van-cell
+                        v-for="(item,index) in listData"
+                        :key="item.id+index"
+                        :title="item.procDefName"
+                        :label="getTaskDesc(item.subject)"
+                        @click="onClick(item,index)"
+                    >
+                        <template slot="icon">
+                            <van-checkbox v-if="checkMode" ref="checkboxes" :name="item.id" class="ibps-mr-10" />
+                            <ibps-avatar
+                                v-else
+                                :icon="_randomIcon(index)"
+                                :text="item.name"
+                                :bg-color="_randomColor(index)"
+                                radius="4"
+                                icon-prefix="ibps-icon"
+                                class="ibps-mr-10"
+                            />
+                        </template>
+                        <span>{{ item.createTime|formatRelativeTime }}</span>
+                        <div>
+                            <!-- <van-tag plain :type=" item.status | optionsFilter(bpmnStatusOptions,'type')">{{ item.status | optionsFilter(bpmnStatusOptions) }}</van-tag> -->
+                            <van-tag
+                                size="medium"
+                                :color="item.status | optionsFilter(bpmnStatusOptions,'type') | optionsFilter(colorOptions,'color','type')"
+                                :text-color="item.status | optionsFilter(bpmnStatusOptions,'type') | optionsFilter(colorOptions,'textColor','type')"
+                            >
+                                {{ item.status| optionsFilter(bpmnStatusOptions) }}</van-tag>
+                        </div>
+                    </van-cell>
+                </van-checkbox-group>
+                <ibps-list-result-page :result-type="resultType" :error-type="errorType" :result-message="resultMessage" />
+            </van-list>
+        </van-pull-refresh>
 
-    <ibps-toolbar v-show="checkMode" :actions="mainActions" />
+        <ibps-toolbar v-show="checkMode" :actions="mainActions" />
 
-    <ibps-more-search :show="moreSearchPopup" :search-forms="searchForms" @callback="onMoreSearch"
-      @close="show => moreSearchPopup = show" @reset-form="resetForm" />
+        <ibps-more-search
+            :show="moreSearchPopup"
+            :search-forms="searchForms"
+            @callback="onMoreSearch"
+            @close="show => moreSearchPopup = show"
+            @reset-form="resetForm"
+        />
 
-    <ibps-type-tree v-model="typeTreePopup" title="流程分类" category-key="FLOW_TYPE" @node-click="clickTypeNode"
-      @close="visible => typeTreePopup = visible" />
+        <ibps-type-tree
+            v-model="typeTreePopup"
+            title="流程分类"
+            category-key="FLOW_TYPE"
+            @node-click="clickTypeNode"
+            @close="visible => typeTreePopup = visible"
+        />
 
-    <ibps-bpmn-formrender-dialog :visible="formrenderVisible" :title="formrenderTitle" :pro-inst-id="proInstId"
-      :def-id="defId" @close="visible => formrenderVisible = visible" @callback="onSearch" />
+        <ibps-bpmn-formrender-dialog
+            :visible="formrenderVisible"
+            :title="formrenderTitle"
+            :pro-inst-id="proInstId"
+            :def-id="defId"
+            @close="visible => formrenderVisible = visible"
+            @callback="onSearch"
+        />
 
-  </div>
+    </div>
 
 </template>
 <script>
-  import { myDraft, removeDraft } from '@/api/platform/office/bpmInitiated'
+import { myDraft, removeDraft } from '@/api/platform/office/bpmInitiated'
 
-  import ActionUtils from '@/utils/action'
-  import i18n from '@/utils/i18n'
-  import random from '@/mixins/random'
-  import bpmnStatus from '@/mixins/bpmnStatus'
+import ActionUtils from '@/utils/action'
+import i18n from '@/utils/i18n'
+import random from '@/mixins/random'
+import bpmnStatus from '@/mixins/bpmnStatus'
 
-  import IbpsMoreSearch from '@/components/ibps-more-search'
-  import IbpsTypeTree from '@/business/platform/cat/type/tree'
-  import IbpsAvatar from '@/components/ibps-avatar'
-  import IbpsToolbar from '@/components/ibps-toolbar'
-  import IbpsListResultPage from '@/components/ibps-list-result-page'
-  import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
+import IbpsMoreSearch from '@/components/ibps-more-search'
+import IbpsTypeTree from '@/business/platform/cat/type/tree'
+import IbpsAvatar from '@/components/ibps-avatar'
+import IbpsToolbar from '@/components/ibps-toolbar'
+import IbpsListResultPage from '@/components/ibps-list-result-page'
+import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
 
-  export default {
+export default {
     components: {
-      IbpsMoreSearch,
-      IbpsTypeTree,
-      IbpsAvatar,
-      IbpsToolbar,
-      IbpsListResultPage,
-      IbpsBpmnFormrenderDialog
+        IbpsMoreSearch,
+        IbpsTypeTree,
+        IbpsAvatar,
+        IbpsToolbar,
+        IbpsListResultPage,
+        IbpsBpmnFormrenderDialog
     },
     mixins: [random, bpmnStatus],
     data() {
-      return {
-        stateActive: false,
-        moreSearchPopup: false,
-        typeTreePopup: false,
-        searchForms: {
-          forms: [
-            { prop: 'Q^subject_^SL', label: '事务名称', fieldType: 'text' },
-            // { prop: 'Q^proc_def_name_^SL', label: '事务说明', fieldType: 'text' },
-            { prop: 'Q^inst.subject_^SL', label: '事务说明', fieldType: 'text' },
-            { prop: ['Q^create_time_^DL', 'Q^create_time_^DG'], label: '创建时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' } }
-          ]
-        },
+        return {
+            stateActive: false,
+            moreSearchPopup: false,
+            typeTreePopup: false,
+            searchForms: {
+                forms: [
+                    { prop: 'Q^subject_^SL', label: '事务名称', fieldType: 'text' },
+                    // { prop: 'Q^proc_def_name_^SL', label: '事务说明', fieldType: 'text' },
+                    { prop: 'Q^inst.subject_^SL', label: '事务说明', fieldType: 'text' },
+                    { prop: ['Q^create_time_^DL', 'Q^create_time_^DG'], label: '创建时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
+                ]
+            },
 
-        subject: '',
-        typeId: '',
-        moreParams: {},
+            subject: '',
+            typeId: '',
+            moreParams: {},
 
-        listData: [],
-        pagination: {},
-        sorts: {},
+            listData: [],
+            pagination: {},
+            sorts: {},
 
-        loading: false,
-        finished: false,
-        refreshing: false,
-        resultType: 'init',
-        errorType: null,
-        resultMessage: null,
+            loading: false,
+            finished: false,
+            refreshing: false,
+            resultType: 'init',
+            errorType: null,
+            resultMessage: null,
 
-        checkMode: false,
-        checkedIds: [],
-        mainActions: [{
-          'name': this.$t('common.button.remove'),
-          'type': 'danger',
-          'callback': this.onRemove
-        }],
+            checkMode: false,
+            checkedIds: [],
+            mainActions: [{
+                'name': this.$t('common.button.remove'),
+                'type': 'danger',
+                'callback': this.onRemove
+            }],
 
-        proInstId: '',
-        defId: '',
-        formrenderVisible: false,
-        formrenderTitle: ''
-      }
+            proInstId: '',
+            defId: '',
+            formrenderVisible: false,
+            formrenderTitle: ''
+        }
     },
     computed: {
-      rightText() {
-        return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
-      },
-      selectedIds() {
-        return this.checkedIds.join(',')
-      }
+        rightText() {
+            return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
+        },
+        selectedIds() {
+            return this.checkedIds.join(',')
+        }
     },
     methods: {
-      generateTitle(name, title) { // generateTitle by vue-i18n
-        return i18n.generateTitle(name, title)
-      },
-      /**
+        generateTitle(name, title) { // generateTitle by vue-i18n
+            return i18n.generateTitle(name, title)
+        },
+        /**
        * 加载数据
-       * 
+       *
       */
-      loadData() {
-        this.loading = true
-        myDraft(this.getSearcFormData()).then(response => {
-          // 处理数据
-          ActionUtils.handleListData(this, response.data)
-        }).catch((e) => {
-          ActionUtils.handleErrorData(this, e)
-        })
-      },
-      /**
+        loadData() {
+            this.loading = true
+            console.log('11', this.getSearcFormData())
+            myDraft(this.getSearcFormData()).then(response => {
+                // 处理数据
+                ActionUtils.handleListData(this, response.data)
+            }).catch((e) => {
+                ActionUtils.handleErrorData(this, e)
+            })
+        },
+        /**
        * 获取格式化参数
        */
-      getSearcFormData() {
-        let params = {}
-        if (this.$utils.isNotEmpty(this.subject)) {
-          params['Q^subject_^SL'] = this.subject
-        }
-        if (this.$utils.isNotEmpty(this.moreParams)) {
-          params = Object.assign(params, this.moreParams)
-        }
-        return ActionUtils.formatParams(
-          params,
-          this.pagination,
-          this.sorts)
-      },
-      /**
+        getSearcFormData() {
+            let params = {}
+            if (this.$utils.isNotEmpty(this.subject)) {
+                params['Q^subject_^SL'] = this.subject
+            }
+            if (this.$utils.isNotEmpty(this.moreParams)) {
+                params = Object.assign(params, this.moreParams)
+            }
+            return ActionUtils.formatParams(
+                params,
+                this.pagination,
+                this.sorts)
+        },
+        /**
        * 下拉刷新
        */
-      onRefresh() {
-        this.refreshing = true
-        this.finished = false
-        this.loading = true
-        this.onSearch()
-      },
-      /**
+        onRefresh() {
+            this.refreshing = true
+            this.finished = false
+            this.loading = true
+            this.onSearch()
+        },
+        /**
        * 查询
        */
-      onSearch() {
-        this.stateActive = false
-        ActionUtils.initListData(this)
-        this.loadData()
-      },
-      /**
+        onSearch() {
+            this.stateActive = false
+            ActionUtils.initListData(this)
+            this.loadData()
+        },
+        /**
        * 高级查询
        */
-      onMoreSearch(params) {
-        console.log("params", params, this.typeId);
-        if (this.$utils.isNotEmpty(this.typeId)) {
-          params['Q^type_id_^SL'] = this.typeId
-        }
-        this.moreParams = params
-        this.onSearch()
-        if (this.$utils.isNotEmpty(params)) {
-          this.stateActive = true
-        }
-      },
-      /**
+        onMoreSearch(params) {
+            console.log('params', params, this.typeId)
+            if (this.$utils.isNotEmpty(this.typeId)) {
+                params['Q^type_id_^SL'] = this.typeId
+            }
+            this.moreParams = params
+            this.onSearch()
+            if (this.$utils.isNotEmpty(params)) {
+                this.stateActive = true
+            }
+        },
+        /**
        * 弹窗更多查询条件
        */
-      clickMoreSearch() {
-        this.moreSearchPopup = true
-        this.stateActive = false
-      },
-      /**
+        clickMoreSearch() {
+            this.moreSearchPopup = true
+            this.stateActive = false
+        },
+        /**
        * 重置表单
        */
-      resetForm() {
-        this.typeId = ''
-      },
-      getTaskDesc(v) {
-        if (!v.includes('#')) {
-          return ''
-        }
-        return v.split('#')[1] || ''
-      },
-      // 点击左边显示
-      clickType() {
-        this.typeTreePopup = true
-      },
-      clickTypeNode(data) {
-        this.typeId = data.id
-        this.onMoreSearch({})
-      },
-      onClick(item, index) {
-        if (this.checkMode) {
-          this.$refs.checkboxes[index].toggle()
-        } else {
-          this.proInstId = item.id
-          this.defId = item.procDefId
+        resetForm() {
+            this.typeId = ''
+        },
+        getTaskDesc(v) {
+            if (!v.includes('#')) {
+                return ''
+            }
+            return v.split('#')[1] || ''
+        },
+        // 点击左边显示
+        clickType() {
+            this.typeTreePopup = true
+        },
+        clickTypeNode(data) {
+            this.typeId = data.id
+            this.onMoreSearch({})
+        },
+        onClick(item, index) {
+            if (this.checkMode) {
+                this.$refs.checkboxes[index].toggle()
+            } else {
+                this.proInstId = item.id
+                this.defId = item.procDefId
 
-          this.formrenderTitle = item.procDefName
-          this.formrenderVisible = true
-        }
-      },
-      onRefreshPage() {
-        this.checkedIds = []
-        this.checkMode = false
-        this.onRefresh()
-      },
-      toCheckMode() {
-        if (this.$utils.isEmpty(this.listData)) {
-          return
-        }
-        if (this.checkMode) {
-          // this.show = true
-          this.checkedIds = []
-        }
-        this.checkMode = !this.checkMode
-      },
-      onRemove() {
-        if (this.checkedIds.length === 0) {
-          this.$notify({
-            type: 'warning',
-            message: this.$t('common.dialog.selectedRecords')
-          })
-          return
-        }
-        this.$dialog.confirm({
-          title: this.$t('common.dialog.warn'),
-          message: this.$t('common.operate.makeSure')
-        }).then(() => {
-          removeDraft({ ids: this.selectedIds }).then(response => {
-            this.$notify({
-              type: 'success',
-              message: '删除草稿成功!'
+                this.formrenderTitle = item.procDefName
+                this.formrenderVisible = true
+            }
+        },
+        onRefreshPage() {
+            this.checkedIds = []
+            this.checkMode = false
+            this.onRefresh()
+        },
+        toCheckMode() {
+            if (this.$utils.isEmpty(this.listData)) {
+                return
+            }
+            if (this.checkMode) {
+                // this.show = true
+                this.checkedIds = []
+            }
+            this.checkMode = !this.checkMode
+        },
+        onRemove() {
+            if (this.checkedIds.length === 0) {
+                this.$notify({
+                    type: 'warning',
+                    message: this.$t('common.dialog.selectedRecords')
+                })
+                return
+            }
+            this.$dialog.confirm({
+                title: this.$t('common.dialog.warn'),
+                message: this.$t('common.operate.makeSure')
+            }).then(() => {
+                removeDraft({ ids: this.selectedIds }).then(response => {
+                    this.$notify({
+                        type: 'success',
+                        message: '删除草稿成功!'
+                    })
+                    this.onRefreshPage()
+                }).catch((e) => {
+                    console.error(e)
+                })
             })
-            this.onRefreshPage()
-          }).catch((e) => {
-            console.error(e)
-          })
-        })
-      }
+        }
     }
 
-  }
+}
 </script>
 <style lang="scss" scoped>
   ::v-deep .van-cell__title {
@@ -280,4 +320,4 @@
       overflow-wrap: break-word;
     }
   }
-</style>
+</style>

File diff suppressed because it is too large
+ 570 - 492
src/views/platform/bpmn/my-test/index.vue


Some files were not shown because too many files changed in this diff