zjf
2023-03-08 92b359a6458fb985b78431e0a2f54b548e01b1ca
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<template>
  <div
    v-loading="loading"
    v-empty="list"
    xs-empty-icon="none"
    xs-empty-text="暂无记录">
    <flexbox class="flow-head">
      <div class="flow-head-name">审批流程</div>
      <img
        class="flow-head-close"
        src="@/assets/img/task_close.png"
        @click="close" >
    </flexbox>
    <div class="flow-body">
      <flexbox
        v-for="(item, index) in list"
        :key="index"
        class="cf-flow-item"
        align="stretch"
        justify="flex-start">
        <img
          :src="item.examineStatus|statusIcon"
          class="cf-flow-item-img" >
        <div>
          <flexbox class="cf-flow-item-head">
            <div class="cf-flow-item-des">{{ item.orderId|stepName }}</div>
            <div>{{ item.examineTime }}</div>
          </flexbox>
          <flexbox class="cf-flow-item-info">
            <div class="cf-flow-item-name">{{ item.realname }}</div>
            <div><span>{{ getStatusName(item.examineStatus) }}</span>了此申请</div>
          </flexbox>
          <div
            v-if="item.remarks"
            class="cf-flow-item-content">{{ item.remarks }}
            <div class="cf-flow-item-content-arrow"/>
          </div>
        </div>
        <div class="cf-flow-item-line"/>
      </flexbox>
    </div>
  </div>
</template>
 
<script>
// import { crmExamineFlowRecordList } from '@/api/clients/common' // 审批记录
// import { oaExamineFlowRecordList } from '@/api/oamanagement/examine'
 
import Nzhcn from 'nzh/cn'
 
export default {
  /** 客户管理 的 合同详情  查看审批流程 */
  name: 'CheckFlow',
  components: {},
  filters: {
    statusIcon: function (status) {
      // 0失败,1通过,2撤回,3创建,4待审核
      // JAVA 0 未审核 1 审核通过 2 审核拒绝 3 审核中 4 已撤回 5 创建 6 待提交
      // if (status === 2) {
      //   return require('@/assets/img/check_fail.png')
      // } else if (status === 1) {
      //   return require('@/assets/img/check_suc.png')
      // } else if (status === 4) {
      //   return require('@/assets/img/check_revoke.png')
      // } else if (status === 3) {
      //   return require('@/assets/img/check_create.png')
      // } else if (status === 0 || status === 6) {
      //   return require('@/assets/img/check_wait.png')
      // } else if (status === 5) {
      //   return require('@/assets/img/check_create.png')
      // }
      return ''
    },
    stepName: function (index) {
      return '第' + Nzhcn.encodeS(index) + '级'
    }
  },
  props: {
    examineType: {
      type: String,
      default: ''
    },
    // 详情信息id
    id: [String, Number]
  },
  data () {
    return {
      loading: false,
      list: []
    }
  },
  computed: {},
  watch: {
    id: function (val) {
      if (val) {
        this.list = []
        this.getDetail()
      }
    }
  },
  mounted () {},
  methods: {
    getDetail () {
      if (this.id) {
        this.loading = true
        const request = {
          // crm_contract: crmExamineFlowRecordList,
          // crm_receivables: crmExamineFlowRecordList,
          // oa_examine: oaExamineFlowRecordList
        }[this.examineType]
 
        request({
          recordId: this.id
        })
          .then(res => {
            this.loading = false
            this.list = res.data
            // this.$emit('value-change', {
            //   config: res.data.config, // 审批类型
            //   value: [] // 审批信息
            // })
          })
          .catch(() => {
            this.loading = false
          })
      }
    },
    // 获取状态名称
    getStatusName (status) {
      // 0拒绝,1通过,2撤回,3创建,4待审核
      if (status === 0) {
        return '未审核 '
      } else if (status === 1) {
        return '通过'
      } else if (status === 2) {
        return '拒绝'
      } else if (status === 3) {
        return '审核中'
      } else if (status === 4) {
        return '撤回'
      } else if (status === 5) {
        return '创建'
      } else if (status === 6) {
        return '待提交'
      }
      return ''
    },
    close () {
      this.$emit('close')
    }
  }
}
</script>
 
<style lang="less" scoped>
/** 头部的css */
.flow-head {
  padding: 8px 15px;
  border-bottom: 1px solid #e6e6e6;
  .flow-head-name {
    font-size: 14px;
    color: #333;
    flex: 1;
  }
  .flow-head-name {
    display: block;
    width: 30px;
    height: 30px;
  }
  .flow-head-close {
    cursor: pointer;
    width: 30px;
    height: 30px;
    padding: 8px;
  }
}
.flow-body {
  padding: 15px;
}
/** 每行的css */
.cf-flow-item {
  position: relative;
  padding-bottom: 15px;
  .cf-flow-item-img {
    display: block;
    background-color: white;
    width: 16px;
    height: 16px;
    border-radius: 8px;
    margin-right: 10px;
  }
  .cf-flow-item-head {
    color: #bababa;
    font-size: 12px;
    .cf-flow-item-des {
      margin-right: 10px;
    }
  }
  .cf-flow-item-info {
    margin-top: 8px;
    font-size: 12px;
    color: #979797;
    .cf-flow-item-name {
      color: #333;
      margin-right: 10px;
    }
  }
  .cf-flow-item-line {
    position: absolute;
    z-index: -1;
    width: 1px;
    top: 0px;
    bottom: 0px;
    left: 8px;
    background-color: #e6e6e6;
  }
  .cf-flow-item-content {
    position: relative;
    margin-top: 15px;
    border-radius: 4px;
    background-color: #f7f8fa;
    font-size: 12px;
    color: #929293;
    padding: 8px;
    line-height: 18px;
    .cf-flow-item-content-arrow {
      width: 8px;
      height: 8px;
      background-color: #f7f8fa;
      transform: rotate(45deg);
      position: absolute;
      top: -4px;
      left: 25px;
    }
  }
}
</style>