Newer
Older
KaiFengPC / src / views / project / projectInformation / components / safcityCont.vue
@zhangdeliang zhangdeliang on 23 May 8 KB 初始化项目
  1. <template>
  2. <div class="water-analysis-page">
  3. <div class="top">
  4. <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
  5. <el-tab-pane label="危大功能审批" name="first" v-loading="isLoading">
  6. <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
  7. <el-table-column type="index" width="55" label="序号" />
  8. <el-table-column :label="i.label" :prop="i.props" show-overflow-tooltip v-for="i in safcityContCloumOne">
  9. <template #default="{ row }" v-if="i.props == 'id'">
  10. <span class="projectName"> {{ row.id }}</span>
  11. </template>
  12. <template #default="{ row }" v-if="i.props == 'compilationTime'">
  13. {{ row.compilationTime?.substring(0, 10) }}
  14. </template>
  15. <template #default="{ row }" v-if="i.props == 'area'"> {{ row.area || 0 }}(平方米) </template>
  16. <template #default="{ row }" v-if="i.props == 'fileSaveRequestList'">
  17. <span @click="handlePreview(k)" class="projectName" v-for="k in row.fileSaveRequestList">{{ k.originalName }}</span>
  18. </template>
  19. </el-table-column>
  20. </el-table>
  21. </el-tab-pane>
  22. <el-tab-pane label="患者整改及复查" name="second" v-loading="isLoading">
  23. <el-table :data="postList" max-height="500">
  24. <el-table-column type="index" width="55" label="序号" />
  25. <el-table-column :label="i.label" :prop="i.props" show-overflow-tooltip v-for="i in safcityContCloumTwo">
  26. <template #default="{ row }" v-if="i.propsy == 'reformRecordCode'">
  27. <span class="projectName"> {{ row.reformRecordCode }}</span>
  28. </template>
  29. <template #default="{ row }" v-if="i.props == 'checkTime'">
  30. {{ row.checkTime?.substring(0, 10) }}
  31. </template>
  32. <template #default="{ row }" v-if="i.props == 'hiddenTroubleLevel'">
  33. <dict-tag :options="hidden_trouble_level" :value="row.hiddenTroubleLevel" />
  34. </template>
  35. <template #default="{ row }" v-if="i.props == 'notificationType'">
  36. <dict-tag :options="notification_type" :value="row.notificationType" />
  37. </template>
  38. <template #default="{ row }" v-if="i.props == 'abarbeitungDeadline'">
  39. {{ row.abarbeitungDeadline?.substring(0, 10) }}
  40. </template>
  41. <template #default="{ row }" v-if="i.props == 'actualFinishDate'">
  42. {{ row.actualFinishDate?.substring(0, 10) }}
  43. </template>
  44. <template #default="{ row }" v-if="i.props == 'abarbeitungType'">
  45. {{ row.actualFinishDate?.substring(0, 10) }}
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. </el-tab-pane>
  50. <el-tab-pane label="环境辨识" name="three" v-loading="isLoading">
  51. <el-table :data="postList" max-height="500">
  52. <el-table-column type="index" width="55" label="序号" />
  53. <el-table-column :label="i.label" :prop="i.props" show-overflow-tooltip v-for="i in safcityContCloumThree">
  54. <template #default="{ row }" v-if="i.props == 'identificationDate'">
  55. {{ row.identificationDate?.substring(0, 10) }}
  56. </template>
  57. </el-table-column>
  58. </el-table>
  59. </el-tab-pane>
  60. <el-tab-pane label="环境监测" name="four" v-loading="isLoading">
  61. <el-table :data="postList" max-height="500">
  62. <el-table-column type="index" width="55" label="序号" />
  63. <el-table-column :label="i.label" :prop="i.props" show-overflow-tooltip v-for="i in safcityContCloumFour">
  64. <template #default="{ row }" v-if="i.props == 'measurTime'">
  65. {{ row.measurTime?.substring(0, 10) }}
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. </el-tab-pane>
  70. </el-tabs>
  71. </div>
  72. </div>
  73. </template>
  74. <script setup>
  75. import { projectInfoAdd, userList } from '@/api/project/projectInformation';
  76. import { getInfo } from '@/api/project/engineeringApproval';
  77. import { getInfo as getInfoTwo } from '@/api/project/environmentalIdentificationAndEvaluation';
  78. import { getInfo as getInfoThree } from '@/api/project/environmentalMonitoring';
  79. import { getInfo as getInfoFour } from '@/api/project/hazardRectificationAndReview';
  80. import { ElMessage, ElMessageBox } from 'element-plus';
  81. import { safcityContCloumOne, safcityContCloumTwo, safcityContCloumThree, safcityContCloumFour } from '@/utils/cloums';
  82. const { proxy } = getCurrentInstance();
  83. const { notification_type, hidden_trouble_level } = proxy.useDict('notification_type', 'hidden_trouble_level');
  84. const emits = defineEmits();
  85. const typeList = inject('typeList1');
  86. const postList = ref([]);
  87. const isLoading = ref(false);
  88. const personList = ref([]);
  89. const activeName = ref('first');
  90.  
  91. let FormList = ref({
  92. pageSize: 10,
  93. pageNum: 1,
  94. });
  95. let queryList = ref({
  96. pageNum: 1,
  97. pageSize: 999999,
  98. });
  99.  
  100. const submit = () => {
  101. proxy.$refs.ruleForm.validate(valid => {
  102. if (valid) {
  103. if (typeList.type == 3) {
  104. FormList.value.operation = 'add';
  105. projectInfoAdd(FormList.value).then(({ code }) => {
  106. if (code == 200) {
  107. emits('onModalClose');
  108. proxy.$refs.ruleForm.resetFields();
  109. }
  110. });
  111. } else if (typeList.type == 5) {
  112. FormList.value.operation = 'update';
  113. projectInfoAdd(FormList.value).then(({ code }) => {
  114. if (code == 200) {
  115. emits('onModalClose');
  116. proxy.$refs.ruleForm.resetFields();
  117. }
  118. });
  119. }
  120. }
  121. });
  122. };
  123. function closeds() {
  124. proxy.$refs.ruleForm.resetFields();
  125. }
  126. defineExpose({ submit, closeds });
  127.  
  128. const userListM = async () => {
  129. let { data } = await userList();
  130. personList.value = data;
  131. FormList.value = typeList.value;
  132. };
  133.  
  134. const getInfoM = async p => {
  135. getInfo(p).then(({ data }) => {
  136. postList.value = data;
  137. isLoading.value = false;
  138. });
  139. };
  140. const getInfoTwoM = async p => {
  141. getInfoTwo(p).then(({ data }) => {
  142. postList.value = data;
  143. isLoading.value = false;
  144. });
  145. };
  146. const getInfoThreeM = async p => {
  147. isLoading.value = false;
  148. getInfoThree(p).then(({ data }) => {
  149. postList.value = data;
  150. });
  151. };
  152. const getInfoFourM = async p => {
  153. getInfoFour(p).then(({ data }) => {
  154. postList.value = data;
  155. isLoading.value = false;
  156. });
  157. };
  158. function handleClick({ props: { name } }) {
  159. console.log('vvv', name);
  160. isLoading.value = true;
  161. switch (name) {
  162. case 'first':
  163. getInfoM({ projectNo: typeList.value.projectNo, ...queryList.value });
  164. break;
  165. case 'second':
  166. getInfoTwoM({ projectNo: typeList.value.projectNo, ...queryList.value });
  167. break;
  168. case 'three':
  169. getInfoThreeM({ projectNo: typeList.value.projectNo, ...queryList.value });
  170. break;
  171. case 'four':
  172. getInfoFourM({ projectNo: typeList.value.projectNo, ...queryList.value });
  173. break;
  174. }
  175. }
  176. function handlePreview(file) {
  177. return ElMessageBox.confirm(`下载此文件: ${file.name}?`).then(
  178. () => window.open(file.url),
  179. () => false
  180. );
  181. }
  182. onMounted(() => {
  183. userListM();
  184. // projectPlanMonthlyInfolastM({ projectNo: typeList.value.projectNo });
  185.  
  186. getInfoM({ projectNo: typeList.value.projectNo, pageSize: 999999, pageNum: 1 });
  187. });
  188. </script>
  189. <style lang="scss" scoped>
  190. .water-analysis-page {
  191. padding: 20px;
  192. .top {
  193. // flex-direction:column;
  194. }
  195. }
  196. .pagination {
  197. float: right;
  198. margin-top: 10px;
  199. }
  200. .iconCLass {
  201. :deep .el-input__wrapper {
  202. box-shadow: 0 0 0 0;
  203. }
  204. }
  205. .tabs {
  206. :deep .el-input__wrapper {
  207. box-shadow: 0 0 0 0;
  208. }
  209. }
  210. .LeftBox1 {
  211. // width: 280px;
  212. height: 100%;
  213.  
  214. .HTMoney1 {
  215. flex: 1;
  216. text-align: center;
  217. .JENum {
  218. height: 40px;
  219. font-size: 18px;
  220. font-weight: 400;
  221. color: #409eff;
  222. }
  223.  
  224. .JEName {
  225. width: 100%;
  226. height: 40px;
  227. font-size: 16px;
  228. color: black;
  229. }
  230. }
  231. .HTMoney2 {
  232. background: red;
  233. .JEName {
  234. color: #fff;
  235. }
  236. .JENum {
  237. color: #fff;
  238. }
  239. }
  240. }
  241. .Top_cont {
  242. display: flex;
  243. width: 80vw;
  244. justify-content: center;
  245. align-itemas: center;
  246. margin-bottom: 35px;
  247. }
  248. </style>