Blame view

src/views/workflow/components/th.vue 4.06 KB
1
<!--
2
 * @Description:
3 4 5
 * @Autor: renchao
 * @LastEditTime: 2023-05-17 10:41:57
-->
liangyifan committed
6
<template>
任超 committed
7 8 9
  <div class="from-clues">
    <!-- 表单部分 -->
    <div class="from-clues-header">
蔡俊立 committed
10
      <div class="title">请选择要退回到的环节:</div>
任超 committed
11
      <el-form ref="queryForm" label-width="90px">
12 13 14 15 16
        <ul style="margin-bottom: 15px">
          <li
            v-for="(item, index) in dataList"
            class="listDetail"
            :key="index"
17
            @click="changeSelectItem(item)">
任超 committed
18
            <p class="icon">
19 20 21
              <el-radio
                v-model="selectActivity"
                :label="item.activityId"
22
                @change="changeSelectItem(item)"></el-radio>
23 24 25 26
            </p>
            <p>{{ item.activityName }}</p>
            <p v-for="(child, childIndex) in item.userInfos" :key="childIndex">
              {{ child.name }}
任超 committed
27 28 29
            </p>
          </li>
        </ul>
蔡俊立 committed
30 31
        <div class="title">退回意见:</div>
        <el-form-item>
32 33 34 35
          <el-input
            class="textArea"
            type="textarea"
            v-model="outstepopinion"
36
            placeholder="请输入退回意见"></el-input>
任超 committed
37
        </el-form-item>
蔡俊立 committed
38
        <el-form-item>
39
          <el-button style="float:right" @click="cancelBack">取消</el-button>
蔡俊立 committed
40 41
          <el-button type="primary" @click="onSubmit" style="float:right">退回</el-button>
        </el-form-item>
任超 committed
42
      </el-form>
liangyifan committed
43
    </div>
任超 committed
44
  </div>
liangyifan committed
45 46 47
</template>

<script>
48

49
  import { getTaskBackNode, sendBackTask } from "@/api/workFlow.js"
50
  import { popupCacel } from "@/utils/popup.js";
51

52 53 54 55 56 57
  export default {
    props: {
      formData: {
        type: Object,
        default: {},
      },
58
    },
59 60 61 62 63 64 65
    data () {
      return {
        selectActivity: "",
        dataList: [],
        outstepopinion: "",
        selectItem: {},
      };
蔡俊立 committed
66
    },
67 68
    created () {
      this.getBackNode();
蔡俊立 committed
69
    },
70
    methods: {
yuanbo committed
71 72 73 74
      /**
       * @description: onSubmit
       * @author: renchao
       */
75
      onSubmit () {
xiaomiao committed
76 77
        console.log(this.formData.bsmSlsq);
        console.log(this.selectItem);
78 79 80
        sendBackTask({
          bsmSlsq: this.formData.bsmSlsq,
          backNodeList: [this.selectItem],
xiaomiao committed
81
          message:this.outstepopinion
82 83 84 85 86 87 88 89 90 91 92 93 94 95
        }).then((res) => {
          this.$message.success("退回成功");
          setTimeout(() => {
            // window.opener.location.reload(); //刷新父窗口
            if (window.opener && window.opener.getBpageList) {
              window.opener.getBpageList();
            } else {
              window.opener.frames[0].getBpageList();
            }
            window.close();
            this.$emit("input", false);
          }, 1000);
        });
      },
yuanbo committed
96 97 98 99 100
      /**
       * @description: changeSelectItem
       * @param {*} item
       * @author: renchao
       */
101 102 103 104 105
      changeSelectItem (item) {
        this.selectItem = item;
        this.selectActivity = item.activityId;
      },
      //获取可回退环节信息
yuanbo committed
106 107 108 109
      /**
       * @description: 获取可回退环节信息
       * @author: renchao
       */
110 111 112 113 114 115 116 117
      getBackNode () {
        getTaskBackNode(this.formData).then((res) => {
          if (res.code == 200) {
            this.dataList = res.result;
            if (res.result) {
              this.selectActivity = res.result[0].activityId;
              this.selectItem = res.result[0];
            }
蔡俊立 committed
118
          }
119 120
        });
      },
121

yuanbo committed
122 123 124 125
      /**
       * @description: cancelBack
       * @author: renchao
       */
126 127 128
      cancelBack () {
        popupCacel();
      }
蔡俊立 committed
129
    }
liangyifan committed
130 131 132
  }
</script>
<style scoped lang="scss">
133
  @import "~@/styles/mixin.scss";
任超 committed
134

135 136 137
  .listDetail {
    display: flex;
    align-items: center;
任超 committed
138 139
    width: 100%;

140 141 142 143 144 145 146 147 148 149 150 151 152 153
    p {
      line-height: 30px;
      height: 30px;
      @include flex-center;
      flex: 1;
      width: 100%;
      border: 1px solid rgb(233, 235, 237);
      margin-top: -1px;
      margin-left: -1px;
    }

    .icon {
      flex: 0 0 60px;
    }
任超 committed
154 155
  }

156 157 158
  .title {
    margin-bottom: 10px;
  }
蔡俊立 committed
159

160 161 162 163 164 165 166
  .textArea {
    /deep/.el-textarea__inner {
      min-height: 90px !important;
    }
  }
  /deep/.el-radio .el-radio__label {
    display: none;
liangyifan committed
167
  }
liangyifan committed
168
</style>