Newer
Older
KaiFengPC / src / views / project / projectInformation / components / plantCont.vue
@zhangdeliang zhangdeliang on 23 May 4 KB 初始化项目
  1. <template>
  2. <div class="water-analysis-page">
  3. <div class="top">
  4. <div class="LeftBox1">
  5. <el-progress
  6. type="circle"
  7. :percentage="DetailData.projectProgress * 1"
  8. :width="150"
  9. style="margin: 10px 10px 20px 20px"
  10. :stroke-width="20"
  11. striped
  12. striped-flow
  13. />
  14. <!-- <p class="HTNo">{{ DetailData.projectTypeName }}</p> -->
  15. <div style="width: 380px; display: flex">
  16. <div class="HTMoney1">
  17. <div class="JENum">{{ DetailData.projectProgress }}<span style="font-size: 14px">(%)</span></div>
  18. <div class="JEName">项目进度</div>
  19. </div>
  20. </div>
  21. </div>
  22. <el-table
  23. :data="postList.projectPlanInventoryList"
  24. style="width: 100%"
  25. row-key="id"
  26. default-expand-all
  27. :tree-prop="{ children: 'children' }"
  28. >
  29. <el-table-column :label="i.label" :prop="i.props" show-overflow-tooltip v-for="i in plantContCloum">
  30. <template #default="{ row }" v-if="i.props == 'schedule'"> {{ row.schedule || 0 }}% </template>
  31. <template #default="{ row }" v-if="i.props == 'dutyUserId'">
  32. {{ getStateName(row.dutyUserId) }}
  33. </template>
  34. <template #default="{ row }" v-if="i.props == 'outputData'">
  35. <span class="projectName">{{ row.outputData }}</span>
  36. </template>
  37. </el-table-column>
  38. </el-table>
  39. </div>
  40. </div>
  41. </template>
  42. <script setup>
  43. import { projectInfoSelectByProjectNo, projectPlanInfoselectByProjectNo } from '@/api/project/tenderReview';
  44. import { projectInfoAdd, projectTypeList, projectCompany, getUserProfile, userList } from '@/api/project/projectInformation';
  45. import { plantContCloum } from '@/utils/cloums';
  46. const { proxy } = getCurrentInstance();
  47. const emits = defineEmits();
  48. const typeList = inject('typeList1');
  49. const postList = ref([]);
  50. const project_TypeId = ref([]);
  51. const unit_list = ref([]);
  52. const personList = ref([]);
  53. let FormList = ref({
  54. pageNum: 1,
  55. pageSize: 10,
  56. });
  57. const DetailData = ref({});
  58.  
  59. const submit = () => {
  60. proxy.$refs.ruleForm.validate(valid => {
  61. if (valid) {
  62. FormList.value.content = JSON.stringify([FormList.value.content[0], { type: 'new', projectInfo: { ...FormList.value } }]);
  63. console.log(JSON.stringify(FormList.value.content));
  64. console.log(FormList.value, 'typeListtypeList');
  65. if (typeList.type == 3) {
  66. FormList.value.operation = 'add';
  67. projectInfoAdd(FormList.value).then(({ code }) => {
  68. if (code == 200) {
  69. emits('onModalClose');
  70. proxy.$refs.ruleForm.resetFields();
  71. }
  72. });
  73. } else if (typeList.type == 5) {
  74. FormList.value.operation = 'update';
  75. projectInfoAdd(FormList.value).then(({ code }) => {
  76. if (code == 200) {
  77. emits('onModalClose');
  78. proxy.$refs.ruleForm.resetFields();
  79. }
  80. });
  81. }
  82. }
  83. });
  84. };
  85. function closeds() {
  86. proxy.$refs.ruleForm.resetFields();
  87. }
  88. defineExpose({ submit, closeds });
  89. const projectTypeListM = async () => {
  90. let { data } = await projectTypeList();
  91. project_TypeId.value = data;
  92. };
  93. const projectCompanyM = async () => {
  94. let { data } = await projectCompany();
  95. unit_list.value = data;
  96. };
  97. const getUserProfileM = async () => {
  98. let { data } = await getUserProfile();
  99. // unit_list.value = data
  100. };
  101. const userListM = async () => {
  102. let { data } = await userList();
  103. personList.value = data;
  104. FormList.value = typeList.value;
  105. };
  106. //获取项目计划进度
  107. const getProjectStatisticsM = async id => {
  108. let { data } = await projectInfoSelectByProjectNo(id);
  109. DetailData.value = data;
  110. };
  111. const projectPlanInfoIDM = async p => {
  112. let { data } = await projectPlanInfoselectByProjectNo(p);
  113. postList.value = data;
  114. };
  115. const getStateName = r => {
  116. let a = '';
  117. personList.value.map(i => {
  118. if (i.userId == r) {
  119. a = i;
  120. }
  121. });
  122. return a.nickName;
  123. };
  124. onMounted(() => {
  125. // projectTypeListM();
  126. // projectCompanyM();
  127. userListM();
  128. getProjectStatisticsM(typeList.value.projectNo);
  129. projectPlanInfoIDM(typeList.value.projectNo);
  130. });
  131. </script>
  132. <style lang="scss" scoped>
  133. .water-analysis-page {
  134. padding: 20px;
  135. .top {
  136. display: flex;
  137. // flex-direction:column;
  138. }
  139. }
  140. .iconCLass {
  141. :deep .el-input__wrapper {
  142. box-shadow: 0 0 0 0;
  143. }
  144. }
  145. .tabs {
  146. :deep .el-input__wrapper {
  147. box-shadow: 0 0 0 0;
  148. }
  149. }
  150. .LeftBox1 {
  151. width: 280px;
  152. height: 100%;
  153. float: left;
  154.  
  155. .HTNo {
  156. width: 340px;
  157. // text-align: center;
  158. font-size: 16px;
  159. }
  160.  
  161. .HTMoney1 {
  162. width: 170px;
  163. height: 60px;
  164. float: left;
  165. text-align: center;
  166.  
  167. .JENum {
  168. width: 100%;
  169. height: 40px;
  170. font-size: 18px;
  171. font-weight: 400;
  172. color: #409eff;
  173. }
  174.  
  175. .JEName {
  176. width: 100%;
  177. height: 40px;
  178. font-size: 16px;
  179. color: black;
  180. }
  181. }
  182. }
  183. </style>