Blame view

frontend/front/src/views/matter/components/TransferButton.vue 1.5 KB
8d73e917   陈威   初始化提交
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<template>
  <div class="approval-button-item transfer-button">
    <el-button :disabled="disabled" :size="btnSize" @click="handleTransfer">
      {{ name }}
    </el-button>
    <approval-dialog
      ref="approvalDialog"
      is-show-user-selector
      :user-selector-is-single="true"
      :alias="alias"
      :dialog-title="$t('task.TransferSettings')"
      :opinion-label="$t('task.TransferInstructions')"
      @submit-form="handleSubmitForm"
    ></approval-dialog>
  </div>
</template>

<script>
  import ApprovalDialog from './ApprovalDialog'
  import { savaTransfer } from '@/api/process'

  import approvalButton from '@/mixins/approvalButton'

  export default {
    name: 'TransferButton',
    components: {
      ApprovalDialog,
    },
    mixins: [approvalButton],
    methods: {
      handleTransfer() {
        this.$refs.approvalDialog.openDialog()
      },
      handleSubmitForm(dialogFormData, cb) {
        const params = {
          messageType: 'inner',
          taskId: this.taskId,
          formData: JSON.stringify(this.data),
          formKey: this.formKey,
          ...dialogFormData,
        }
        savaTransfer(params)
          .then((res) => {
            if (!res.state) return this.$message.warning(res.message)
            // this.$router.push('/matter/myTask')
            this.filterHasHandleTask()
            this.dialogModeApprovalCompletionToMyTask()
          })
          .finally(() => {
            cb()
          })
      },
    },
  }
</script>

<style lang="scss" scoped></style>