Newer
Older
KaiFengPC / src / views / longoPeration / ProblemStatistics.vue
@鲁yixuan 鲁yixuan on 6 Sep 6 KB updata
  1. <template>
  2. <!-- 项目问题统计 -->
  3. <div class="publicContainer">
  4. <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
  5. <el-form-item label="项目名称:" prop="projectNo">
  6. <el-select clearable filterable v-model="queryParams.projectNo" style="width: 180px" placeholder="请选择项目名称">
  7. <el-option v-for="proj in projectTList" :key="proj.projectNo" :label="proj.projectName" :value="proj.projectNo" />
  8. </el-select>
  9. </el-form-item>
  10. <el-form-item label="整改状态:" prop="isRectification">
  11. <el-select clearable v-model="queryParams.isRectification" style="width: 180px" placeholder="请选择整改状态">
  12. <el-option v-for="item in case_level" :key="item.value" :label="item.label" :value="item.value" />
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="巡查类型:" prop="uploadType">
  16. <el-select clearable v-model="queryParams.uploadType" style="width: 180px" placeholder="请选择巡查类型">
  17. <el-option v-for="item in patrol_Stype" :key="item.value" :label="item.label" :value="item.value" />
  18. </el-select>
  19. </el-form-item>
  20.  
  21. <el-form-item label="上报时间:" prop="timer">
  22. <el-date-picker
  23. style="width: 280px"
  24. format="YYYY-MM-DD"
  25. value-format="YYYY-MM-DD"
  26. v-model="queryParams.timer"
  27. type="daterange"
  28. unlink-panels
  29. range-separator="至"
  30. start-placeholder="开始时间"
  31. end-placeholder="结束时间"
  32. />
  33. </el-form-item>
  34.  
  35. <el-form-item>
  36. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  37. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  38. <el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
  39. </el-form-item>
  40. </el-form>
  41.  
  42. <!-- 按钮区域 -->
  43. <el-row :gutter="10" class="mb8">
  44. <el-col :span="1.5">
  45. <!-- <el-button type="primary" icon="Plus" @click="handleAdd">新增</el-button> -->
  46. </el-col>
  47. <right-toolbar v-model:showSearch="showSearch" @queryTable="getDataList"></right-toolbar>
  48. </el-row>
  49. <!-- 表格 -->
  50. <el-table :data="dataList" v-loading="loading" :max-height="580">
  51. <el-table-column type="index" width="55" label="序号" />
  52. <el-table-column label="项目名称" prop="projectName" />
  53. <el-table-column label="巡查人员" prop="userName"> </el-table-column>
  54. <el-table-column label="巡查类型" prop="uploadType">
  55. <template #default="scope">
  56. <span>
  57. {{ scope.row.uploadType == '1' ? '计划巡查' : scope.row.uploadType == '2' ? '临时巡查' : '' }}
  58. </span>
  59. </template>
  60. </el-table-column>
  61.  
  62. <el-table-column label="项目整改状态" prop="isRectification">
  63. <template #default="scope">
  64. <span :class="scope.row.isRectification == '1' ? 'green' : 'red'">
  65. {{ scope.row.isRectification == '1' ? '无需整改' : scope.row.isRectification == '2' ? '需要整改' : '' }}
  66. </span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="问题类型" prop="problemTypeName"> </el-table-column>
  70. <el-table-column label="检查项" prop="checkItemName">
  71. <!-- <template #default="scope">
  72. <dict-tag :options="inspection_items" :value="String(scope.row.checkItem)" />
  73. </template> -->
  74. </el-table-column>
  75. <el-table-column label="问题描述" prop="problemContent" />
  76. <el-table-column label="上报地址" prop="problemAddress" />
  77. <el-table-column label="问题图片" prop="sysFileList" width="300">
  78. <template #default="scope">
  79. <el-image
  80. style="width: 60px; height: 60px; margin: 5px"
  81. v-for="i in scope.row.sysFileList"
  82. :src="i.url"
  83. :preview-src-list="[i.url]"
  84. >
  85. </el-image>
  86. <span v-if="scope.row.sysFileList.length == ''">暂无照片</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="上报时间" prop="createTime" width="160" />
  90. </el-table>
  91. <!-- 分页 -->
  92. <pagination
  93. v-show="total > 0"
  94. :total="total"
  95. v-model:page="queryParams.pageNum"
  96. v-model:limit="queryParams.pageSize"
  97. @pagination="getList"
  98. />
  99. </div>
  100. </template>
  101. <script setup name="CaseIssues">
  102. import { patrolProblempage, patrolProblemRectifyedit, projectCompanyList, upreplyfile } from '@/api/longoPeration/CaseIssues';
  103. import { getProjectInfoList } from '@/api/preassess/targetManage';
  104. const { proxy } = getCurrentInstance();
  105. const { problem_type, inspection_items } = proxy.useDict('problem_type', 'inspection_items'); // 巡查类型的字典
  106. const showSearch = ref(true);
  107. const case_level = ref([
  108. {
  109. value: '1',
  110. label: '无需整改',
  111. },
  112. {
  113. value: '2',
  114. label: '需要整改',
  115. },
  116. ]);
  117. const patrol_Stype = ref([
  118. {
  119. value: '1',
  120. label: '计划巡查',
  121. },
  122. {
  123. value: '2',
  124. label: '临时巡查',
  125. },
  126. ]);
  127. const projectTList = ref([]);
  128. const ConstructionUnit = ref([]);
  129. const loading = ref(true);
  130. const total = ref(0);
  131. const dataList = ref([]);
  132. const AllData = reactive({
  133. queryParams: {
  134. pageNum: 1,
  135. pageSize: 10,
  136. },
  137. });
  138. const { queryParams } = toRefs(AllData);
  139.  
  140. //搜索
  141. function handleQuery() {
  142. getList();
  143. }
  144. //重置
  145. function resetQuery() {
  146. queryParams.value.timer = [];
  147. proxy.resetForm('queryRef');
  148. handleQuery();
  149. }
  150. // 下拉框
  151. async function DropDown() {
  152. let { data } = await projectCompanyList();
  153. ConstructionUnit.value = data;
  154. }
  155. // 项目接口
  156. async function projectTypeListM() {
  157. let { data } = await getProjectInfoList();
  158. projectTList.value = data;
  159. }
  160.  
  161. /** 搜索列表 */
  162. const getList = async () => {
  163. if (queryParams.value.timer) {
  164. queryParams.value.startTime = queryParams.value.timer[0];
  165. queryParams.value.endTime = queryParams.value.timer[1];
  166. } else {
  167. queryParams.value.startTime = '';
  168. queryParams.value.endTime = '';
  169. }
  170. loading.value = true;
  171. let res = await patrolProblempage(queryParams.value);
  172. dataList.value = res.data;
  173. total.value = res.total;
  174. loading.value = false;
  175. };
  176.  
  177. /** 导出按钮操作 */
  178. function handleExport() {
  179. proxy.download(
  180. 'business/patrolProblem/export',
  181. {
  182. ...queryParams.value,
  183. },
  184. `项目问题统计 ${new Date().getTime()}.xlsx`
  185. );
  186. }
  187.  
  188. onMounted(() => {
  189. getList();
  190. DropDown();
  191. projectTypeListM();
  192. });
  193. </script>
  194.  
  195. <style scoped lang="scss"></style>