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
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
<template>
  <div class="container" v-loading="loading">
    <div class="title">
      <span>项目统计信息</span> <span class="back" @click="back"> <i class="iconfont icon-fanhui"></i> 返回 </span>
    </div>
    <el-descriptions title="项目基本信息" :column="4" border class="projectInfo">
      <!-- <el-descriptions-item
        label="项目名称"
        label-align="right"
        align="center"
        label-class-name="my-label"
        class-name="my-content"
        width="150px"
        >{{ project.project_name }}</el-descriptions-item
      > -->
      <el-descriptions-item label="项目名称">{{ project.project_name }}</el-descriptions-item>
      <el-descriptions-item label="类型">{{ project.project_type_name }}</el-descriptions-item>
      <el-descriptions-item label="项目经理">{{ project.manager_name }}</el-descriptions-item>
      <el-descriptions-item label="客户">{{ project.company_name }}</el-descriptions-item>
      <el-descriptions-item label="客户联系人">{{ project.contact_name }}</el-descriptions-item>
      <el-descriptions-item label="状态">{{ project.project_status_name }}</el-descriptions-item>
      <el-descriptions-item label="阶段">{{ project.project_stage_name }}</el-descriptions-item>
 
      <el-descriptions-item label="对内工时(H)">{{ project.inner_hours }}</el-descriptions-item>
      <el-descriptions-item label="对外工时(H)">{{ project.outer_hours }}</el-descriptions-item>
      <el-descriptions-item label="基础工时(H)">{{ project.base_hours }}</el-descriptions-item>
      <el-descriptions-item label="预计工时(H)">{{ project.estimated_hours }}</el-descriptions-item>
      <el-descriptions-item label="实际工时(H)">{{ project.actual_hours }}</el-descriptions-item>
 
      <el-descriptions-item label="预计开始时间">{{ project.estimate_start_time }}</el-descriptions-item>
      <el-descriptions-item label="预计完成时间">{{ project.estimate_complete_time }}</el-descriptions-item>
      <el-descriptions-item label="实际开始时间">{{ project.actual_start_time }}</el-descriptions-item>
      <el-descriptions-item label="实际完成时间">{{ project.actual_complete_time }}</el-descriptions-item>
      <el-descriptions-item span="4" label="项目描述">{{ project.desc }}</el-descriptions-item>
      <el-descriptions-item span="4" label="备注">{{ project.remark }}</el-descriptions-item>
    </el-descriptions>
 
    <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
      <el-tab-pane label="工时统计" name="statistics">
        <project-hour-statistics :editId="editId"></project-hour-statistics>
      </el-tab-pane>
      <el-tab-pane label="项目日志" name="log">
        <project-log :editId="editId"></project-log>
      </el-tab-pane>
      <!-- <el-tab-pane label="Role" name="third">Role</el-tab-pane>
      <el-tab-pane label="Task" name="fourth">Task</el-tab-pane> -->
    </el-tabs>
  </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'
import projectHourStatistics from './project-hour-statistics'
import ProjectLog from './project-log'
 
export default {
  components: {
    projectHourStatistics,
    ProjectLog,
  },
 
  props: {
    editId: {
      type: String,
      default: null,
    },
  },
  setup(props, context) {
    const form = ref(null)
    const project = ref({})
 
    const finished = ref(false)
    const relationId = ref('')
    const activeName = ref('statistics')
 
    onMounted(() => {
      loadDictDitems()
      getProjectInfo()
    })
 
    // 根据字典类型查询字典
    const loadDictDitems = async () => {
      if (props.editId) {
        relationId.value = props.editId
      }
    }
 
    const getProjectInfo = async () => {
      if (props.editId) {
        project.value = await projectInfo.getProjectInfoDetail(props.editId)
        console.log(project.value)
      }
    }
 
    // 重置表单
    const resetForm = () => {
      form.value.resetFields()
    }
 
    const back = () => {
      context.emit('editClose')
    }
 
    return {
      back,
      finished,
      form,
      resetForm,
      project,
      activeName,
    }
  },
}
</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>