tj
2025-06-05 bba272999cc546f65781bf3d20245a3f819af67f
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
<template>
  <div class="container" v-loading="loading">
    <el-table size="small" show-summary :data="projectStatistics" stripe style="width: 100%">
      <el-table-column
        v-for="column in projectStatisticsCloums"
        :key="column.prop"
        :prop="column.prop"
        :label="column.label"
      >
      </el-table-column>
    </el-table>
  </div>
</template>
 
<script>
import logModel from 'lin/model/log'
import projectInfo from '@/model/projectInfo'
 
import { ref, reactive, onMounted } from 'vue'
import { ElMessageBox, ElMessage } from 'element-plus'
 
export default {
  props: {
    editId: {
      type: String,
      default: null,
    },
  },
  setup(props, context) {
    const form = ref(null)
    const project = ref({})
    const projectStatistics = ref([])
    const finished = ref(false)
    const relationId = ref('')
    const projectStatisticsCloums = ref([
      { label: '姓名', prop: 'create_user_name' },
      { label: '计划工时', prop: 'estimated_hours' },
      { label: '实际工时', prop: 'actual_hours' },
      { label: '实际工时百分比', prop: 'actual_hours_percent' },
    ])
 
    onMounted(() => {
      loadDictDitems()
      getProjectStatistics()
      getProjectInfo()
    })
 
    // 根据字典类型查询字典
    const loadDictDitems = async () => {
      if (props.editId) {
        relationId.value = props.editId
      }
    }
 
    const getProjectInfo = async () => {
      if (props.editId) {
        project.value = await projectInfo.getProjectInfoDetail(props.editId)
      }
    }
 
    // 根据字典类型查询字典
    const getProjectStatistics = async () => {
      projectStatistics.value = []
      const searchParam = { project_Id: props.editId }
      // const res = await projectInfo.getProjectStatistics(searchParam)
      const res = await projectInfo.getProjectStatisticsUnconfirm(searchParam)
      projectStatistics.value = res
    }
 
    // 重置表单
    const resetForm = () => {
      form.value.resetFields()
    }
 
    const back = () => {
      context.emit('editClose')
    }
 
    return {
      back,
      projectStatisticsCloums,
      projectStatistics,
      finished,
      form,
      resetForm,
      project,
    }
  },
}
</script>
 
<style lang="scss" scoped>
.container {
  .title {
    height: 59px;
    line-height: 59px;
    color: $parent-title-color;
    font-size: 16px;
    font-weight: 500;
    text-indent: 40px;
    border-bottom: 1px solid #dae1ec;
 
    .back {
      float: right;
      margin-right: 40px;
      cursor: pointer;
    }
  }
 
  .content {
    padding: 10px;
  }
 
  .wrap {
    padding: 20px;
  }
 
  .submit {
    float: left;
  }
  .projectInfo {
    margin: 10px;
  }
}
 
.things {
  font-size: 14px;
  color: #45526b;
  margin-bottom: 15px;
  margin-top: 5px;
}
 
.more {
  height: 40px;
  line-height: 40px;
  color: $theme;
  font-size: 14px;
  margin-left: 28px;
  cursor: pointer;
  &.nothing {
    cursor: text;
  }
 
  .icon-gengduo {
    display: inline;
    margin-left: 6px;
  }
 
  .icon-loading {
    &:before {
      display: inline-block;
      animation: spin 1s linear infinite;
    }
  }
}
 
.nothing {
  color: #45526b;
  font-size: 14px;
}
</style>