MrShi
2024-01-30 3db567c3f22fd2513f6eeac314e509b4abcd6c8b
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<template>
    <GlobalWindow
        :title="title"
        width="100%"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <div class="info">
            <div class="info_list">
                <div class="info_list_item">
                    <div class="info_list_item_label">派遣单位:</div>
                    <div class="info_list_item_val">{{form.name}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">派遣单位信用代码:</div>
                    <div class="info_list_item_val">{{form.code}}</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">派遣单位状态:</div>
                    <div class="info_list_item_val" style="color:#2E68EC;" v-if="form.unitStatus === 0">待审核</div>
                    <div class="info_list_item_val"   v-if="form.unitStatus === 1">
                        <span style="color:#2E68EC;" v-if="form.worktypeStatus  ==null||form.worktypeStatus === 0">工种待审</span>
                        <span style="color: green" v-if="form.worktypeStatus === 1">审核通过</span>
                        <span style="color: red;" v-if="form.worktypeStatus === 2">工种审核不通过</span>
                    </div>
                    <div class="info_list_item_val"  style="color: red;" v-if="form.unitStatus === 2">审核不通过</div>
                </div>
                <div class="info_list_item">
                    <div class="info_list_item_label">派遣单位详述:</div>
                    <div class="info_list_item_val">{{form.content}}</div>
                </div>
            </div>
            <div class="info_btns">
                <el-button type="primary" @click="edit">修改派遣单位</el-button>
                <el-button type="primary" @click="$refs.addJobType.open('添加工种', { id: form.id })">添加工种</el-button>
            </div>
            <div class="info_table">
                <div class="info_table_item" v-for="(item, index) in form.duSolutionList" :key="index">
                    <div class="info_table_item_label">保险方案:{{item.solutionName}}</div>
                    <div class="info_table_item_content">
                        <el-table
                            :data="item.duWorktypeList"
                            border
                            style="width: 100%">
                            <el-table-column label="序号" width="80px">
                                <template slot-scope="scope">
                                    <span>{{scope.$index + 1}}</span>
                                </template>
                            </el-table-column>
                            <el-table-column
                                prop="workTypeName"
                                label="所属工种">
                            </el-table-column>
                            <el-table-column
                                prop="name"
                                label="操作视频">
                                <template slot-scope="{row}">
                                    <video loop controls width="150px" height="150px" :src="row.videoUrlFull"></video>
                                </template>
                            </el-table-column>
                            <el-table-column
                                prop="checkDate"
                                label="审核通过日期">
                            </el-table-column>
                            <el-table-column
                                label="状态">
                                <template slot-scope="{row}">
                                    <span v-if="row.status === 0">待审核</span>
                                    <span v-if="row.status === 1">审核通过</span>
                                    <span v-if="row.status === 2">审核不通过</span>
                                </template>
                            </el-table-column>
                            <el-table-column
                                label="操作">
                                <template slot-scope="scope">
                                    <el-button type="text" style="color: red;" v-if="scope.row.status === 2" @click="dele(scope.row.id, index, scope.$index)">删除</el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                </div>
            </div>
            <div class="info_status">
                <div class="info_status_label">审核流程</div>
                <div class="info_status_list">
                    <el-timeline :reverse="reverse">
                        <el-timeline-item
                            v-for="(activity, index) in form.duLogList"
                            :key="index">
                            <div style="display: flex; flex-direction: column;">
                                <span style="font-size: 16px; font-weight: 400; color: black;">
                                    {{activity.title}}
                                    <span style="font-size: 16px; font-weight: 400; color: black; margin-left: 10px;" v-if="activity.objType === 5 || activity.objType === 6 || activity.objType === 1 || activity.objType === 2">
                                        提交意见: -
                                    </span>
                                </span>
                                <span style="margin-top: 5px; font-size: 12px; font-weight: 400; color: #999999;">
                                    操作员-{{activity.creatorName}}({{activity.companyName}}){{activity.createDate}}
                                </span>
                            </div>
                        </el-timeline-item>
                    </el-timeline>
                </div>
            </div>
        </div>
        <!--    添加方案    -->
        <addJobType ref="addJobType" @success="callback" />
        <!-- 编辑 -->
        <OperaDispatchUnitWindow ref="OperaDispatchUnitWindow" @success="callback" />
    </GlobalWindow>
</template>
 
<script>
  import BaseOpera from '@/components/base/BaseOpera'
  import GlobalWindow from '@/components/common/GlobalWindow'
  import addJobType from '@/components/enterprise/addJobType'
  import OperaDispatchUnitWindow from '@/components/enterprise/OperaDispatchUnitWindow'
  import { getById } from '@/api/business/dispatchUnit'
  import { deleteById } from '@/api/business/duWorktype'
  export default {
    name: 'dispatchUnitDetails',
    extends: BaseOpera,
    components: { GlobalWindow, addJobType, OperaDispatchUnitWindow },
    data () {
      return {
        // 表单数据
        form: {
          id: null,
          name: '',
          code: '',
          content: '',
          unitStatus: '',
          duLogList: [],
          duSolutionList: [],
          saveDuSolutionDTOList: [
            {
              id: '',
              saveDuWorkTypeDTOList: [
                {
                  videoUrl: '',
                  workTypeId: '',
                  file: {
                    videourl: '',
                    videourlfull: ''
                  }
                }
              ],
              typeWork: [],
              solutionId: ''
            }
          ]
        },
        tableData: [],
        insuranceScheme: [],
        reverse: true,
        activities: []
      }
    },
    created () {
      this.config({
        api: '/business/dispatchUnit',
        'field.id': 'id'
      })
    },
    methods: {
        edit() {
            this.$confirm('修改派遣单位会导致该派遣单位不可用,如您需要修改该派遣单位的使用保险方案及工种请点击“添加工种”按钮。', '温馨提醒', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.$refs.OperaDispatchUnitWindow.open('编辑派遣单位', {
                    id: this.form.id,
                    name: this.form.name,
                    code: this.form.code,
                    content: this.form.content,
                    type: 1
                })
            }).catch(() => {
 
            });
        },
      dele (id, b, c) {
        this.$confirm('此操作将永久删除该工种, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          deleteById(id)
            .then(res => {
              this.$message.success('删除成功')
              this.getDetails()
            })
        }).catch(() => {
 
        });
      },
      open (title, target) {
        this.title = title
        this.form.id = target.id
        this.visible = true
        this.getDetails()
      },
      async getDetails() {
        let res = await getById(this.form.id)
        for (const key in this.form) {
          this.form[key] = res[key]
        }
      },
      callback() {
          this.visible = false
          this.$emit('success')
      }
    }
  }
</script>
 
<style lang="scss" scoped>
    .info {
        width: 100%;
        .info_list {
            width: 100%;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            .info_list_item {
                width: 33.3%;
                display: flex;
                align-items: center;
                margin-bottom: 15px;
                .info_list_item_label {
                    flex-shrink: 0;
                    width: 150px;
                    font-size: 14px;
                    color: black;
                }
                .info_list_item_val {
                    flex: 1;
                    font-size: 14px;
                    color: black;
                }
            }
        }
        .info_btns {
            width: 100%;
            display: flex;
            align-items: center;
            margin-bottom: 15px;
        }
        .info_table {
            width: 100%;
            display: flex;
            flex-direction: column;
            margin-bottom: 15px;
            .info_table_item {
                width: 100%;
                display: flex;
                flex-direction: column;
                margin-bottom: 15px;
                &:last-child {
                    margin: 0 !important;
                }
                .info_table_item_label {
                    font-size: 14px;
                    color: black;
                    margin-bottom: 10px;
                }
                .info_table_item_content {
                    width: 100%;
                }
            }
        }
        .info_status {
            width: 100%;
            .info_status_label {
                width: 100%;
                font-size: 18px;
                font-weight: bold;
                margin-bottom: 15px;
            }
        }
    }
</style>