Newer
Older
KaiFengPC / src / views / project / projectQuality / qualityRectification / qualityComponents / todoDon.vue
@zhangdeliang zhangdeliang on 23 May 4 KB 初始化项目
  1. <template>
  2. <div class="water-analysis-pageTD">
  3. <el-table :data="tableDataList" v-loading="tableLoading" stripe max-height="500">
  4. <el-table-column type="index" width="55" label="序号" />
  5. <el-table-column :label="i.label" :prop="i.props" show-overflow-tooltip v-for="i in qualityRectificationCloum">
  6. <template #default="{ row }" v-if="i.props == 'projectName'">
  7. <span class="projectName"> {{ row.projectName }}</span>
  8. </template>
  9. <template #default="{ row }" v-if="i.props == 'reformNo'">
  10. <span @click="onCheck(row, 4, '详情')" class="projectName"> {{ row.reformNo }}</span>
  11. </template>
  12. <template #default="{ row }" v-if="i.props == 'abarbeitungStartTime'">
  13. {{ row.abarbeitungStartTime.substring(0, 10) }}
  14. </template>
  15. <template #default="{ row }" v-if="i.props == 'abarbeitungEndTime'">
  16. {{ row.abarbeitungEndTime.substring(0, 10) }}
  17. </template>
  18. <template #default="{ row }" v-if="i.props == 'status'">
  19. <span style="color: red" v-if="row.fromStatus">驳回</span>
  20. <dict-tag :options="quality_rectification_status" :value="row.status" />
  21. </template>
  22. </el-table-column>
  23. <el-table-column fixed="right" label="操作" width="230">
  24. <template #default="{ row }">
  25. <el-button link type="primary" icon="View" @click="onCheck(row, 4, '详情')">详情</el-button>
  26. <el-button
  27. v-if="row.status == 'projectDeptReplay' && todoList.queryScope == 'todo'"
  28. icon="Edit"
  29. link
  30. type="success"
  31. @click="onCheck(row, 6, '处理')"
  32. >处理</el-button
  33. >
  34. <el-button
  35. icon="EditPen"
  36. v-if="
  37. (row.status == 'startQualityImprovement' || row.status == 'start') &&
  38. (todoList.queryScope != 'done') & (userName == row.createBy)
  39. "
  40. link
  41. type="success"
  42. @click="onCheck(row, 3, '提交')"
  43. >提交</el-button
  44. >
  45. <el-button
  46. icon="Delete"
  47. v-if="row.status == 'start' && todoList.queryScope == 'main' && userName == row.createBy"
  48. link
  49. type="danger"
  50. @click="onCheck(row, 8)"
  51. >删除</el-button
  52. >
  53. </template>
  54. </el-table-column>
  55. </el-table>
  56. <slot name="pagination"></slot>
  57. <el-dialog
  58. v-model="visible"
  59. :title="'质量整改' + tittle"
  60. :modal-append-to-body="false"
  61. :close-on-click-modal="false"
  62. width="90%"
  63. height="95%"
  64. >
  65. <tableDalgo ref="tableDalgoRef" v-if="visible" @onModalClose="onModalClose" :typeList="typeList"></tableDalgo>
  66. <template #footer>
  67. <div class="dialog-footer">
  68. <el-button v-if="tittle != '详情'" @click="open2" type="primary">{{ tittle }}</el-button>
  69. <el-button @click="closed">关闭</el-button>
  70. </div>
  71. </template>
  72. </el-dialog>
  73. </div>
  74. </template>
  75. <script setup>
  76. import { getInfo, projectInfoDelete, projectInfoGet, getInfoMamin } from '@/api/project/qualityRectification';
  77. import tableDalgo from './tableDalgo.vue';
  78. import emgBox from '@/utils/ElMessageBox';
  79. import { qualityRectificationCloum } from '@/utils/cloums';
  80. const { proxy } = getCurrentInstance();
  81. const { project_operation_pattern, unit_property, credit_line, quality_rectification_status } = proxy.useDict(
  82. 'project_operation_pattern',
  83. 'unit_property',
  84. 'credit_line',
  85. 'quality_rectification_status'
  86. );
  87. const queryParams = ref({
  88. pageNum: 1,
  89. pageSize: 10,
  90. });
  91. const userName = sessionStorage.getItem('userName');
  92. const visible = ref(false);
  93. const tableDataList = ref([]);
  94. const tableLoading = ref(false);
  95. const typeList = ref({});
  96. const tableDalgoRef = ref();
  97. const tittle = ref('');
  98. const { todoList, getInfoList, tableData } = defineProps(['todoList', 'getInfoList', 'tableData']);
  99. const onCheck = (row, v, t) => {
  100. tittle.value = t;
  101. if (v == 8) {
  102. emgBox(row.id, projectInfoDeleteM, '您确定删除吗?');
  103. } else {
  104. projectInfoGet(row.id).then(({ code, data }) => {
  105. if (code == 200) {
  106. typeList.value = { ...data, type: v };
  107. visible.value = true;
  108. }
  109. });
  110. }
  111. };
  112. //删除
  113. const projectInfoDeleteM = async id => {
  114. let { code } = await projectInfoDelete(id);
  115. getInfoList(tableData);
  116. };
  117. function onModalClose() {
  118. getInfoList(tableData);
  119. visible.value = false;
  120. }
  121. function closed() {
  122. console.log(tableDalgoRef.value, 99);
  123. tableDalgoRef.value.closed();
  124. }
  125. function open2() {
  126. tableDalgoRef.value.submit();
  127. }
  128. onMounted(() => {
  129. tableDataList.value = todoList;
  130. });
  131. </script>
  132. <style lang="scss" scoped></style>