Newer
Older
KaiFengPC / src / views / floodSys / repair / repairManage.vue
@zhangdeliang zhangdeliang on 3 Sep 8 KB update
  1. <template>
  2. <!-- 排水防涝子系统 长效运维 维修管理-->
  3. <div class="publicContainer">
  4. <!-- 搜索区域 -->
  5. <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
  6. <el-form-item label="工单描述" prop="rpOrderDesc">
  7. <el-input v-model="queryParams.rpOrderDesc" placeholder="请输入" clearable @keyup.enter="handleQuery" />
  8. </el-form-item>
  9. <el-form-item label="维修状态" prop="rpStatus">
  10. <el-select v-model="queryParams.rpStatus" placeholder="请选择" clearable>
  11. <el-option v-for="item in statusType" :key="item.value" :label="item.label" :value="item.value" />
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="维修工单类型" prop="rpOrderType">
  15. <el-select v-model="queryParams.rpOrderType" placeholder="请选择" clearable>
  16. <el-option v-for="item in orderType" :key="item.value" :label="item.label" :value="item.value" />
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item label="是否逾期" prop="isOverdue">
  20. <el-select v-model="queryParams.isOverdue" placeholder="请选择" clearable>
  21. <el-option v-for="item in yqType" :key="item.value" :label="item.label" :value="item.value" />
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="创建时间" prop="daterange">
  25. <el-date-picker
  26. type="daterange"
  27. v-model="daterange"
  28. value-format="YYYY-MM-DD"
  29. start-placeholder="开始日期"
  30. end-placeholder="结束日期"
  31. placeholder="请选择日期"
  32. clearable
  33. >
  34. </el-date-picker>
  35. </el-form-item>
  36. <el-form-item>
  37. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  38. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  39. </el-form-item>
  40. </el-form>
  41. <!-- 按钮区域 -->
  42. <el-row :gutter="10" class="mb8">
  43. <right-toolbar v-model:showSearch="showSearch" @queryTable="getDataList"></right-toolbar>
  44. </el-row>
  45. <!-- 表格 -->
  46. <el-table v-loading="tableLoading" :data="tableData" max-height="500">
  47. <el-table-column label="维修工单名称" prop="rpOrderName" />
  48. <el-table-column label="维修工单描述" prop="rpOrderDesc" />
  49. <el-table-column label="维修工单类型" prop="rpOrderType">
  50. <template #default="scope">
  51. <dict-tag :options="orderType" :value="scope.row.rpOrderType" />
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="维修状态" prop="rpStatus">
  55. <template #default="scope">
  56. <dict-tag :options="statusType" :value="scope.row.rpStatus" />
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="任务开始时间" prop="rpStartTime" width="160" />
  60. <el-table-column label="任务结束时间" prop="rpEndTime" width="160" />
  61. <el-table-column label="是否逾期" prop="isOverdue">
  62. <template #default="scope">
  63. {{ scope.row.isOverdue ? '是' : '否' }}
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="派发人" prop="createUserName" />
  67. <el-table-column label="维修人员" prop="rpUserName" />
  68. <el-table-column label="创建时间" prop="createTime" width="160" />
  69. <el-table-column label="操作" width="200" class-name="small-padding fixed-width">
  70. <template #default="scope">
  71. <el-button link type="warning" icon="edit" @click="handleRate(scope.row)" v-hasPermi="['floodSys:warn:order']">
  72. 审核评价
  73. </el-button>
  74. <el-button link type="primary" icon="check" @click="handleDetail(scope.row)" v-hasPermi="['floodSys:warn:AI']">详情</el-button>
  75. </template>
  76. </el-table-column>
  77. </el-table>
  78. <!-- 分页 -->
  79. <pagination
  80. v-show="total > 0"
  81. :total="total"
  82. v-model:page="queryParams.pageNum"
  83. v-model:limit="queryParams.pageSize"
  84. @pagination="getDataList"
  85. />
  86.  
  87. <!-- 添加或修改弹窗 -->
  88. <el-dialog title="维修工单完成情况评价" v-model="dialogShow" width="500px" append-to-body>
  89. <el-form ref="formRef" :model="formData" :rules="rulesForm" label-width="130px" class="publicForm">
  90. <el-form-item label="审核意见" prop="emResult">
  91. <el-select v-model="formData.emResult" placeholder="请选择" clearable>
  92. <el-option v-for="item in auditType" :key="item.value" :label="item.label" :value="item.value" />
  93. </el-select>
  94. </el-form-item>
  95. <el-form-item label="维修质量评分" prop="emQualityScore">
  96. <el-rate v-model="formData.emQualityScore" />
  97. </el-form-item>
  98. <el-form-item label="维修工作时间饱和度评分" prop="emSaturationScore">
  99. <el-rate v-model="formData.emSaturationScore" />
  100. </el-form-item>
  101. <el-form-item label="维修工作响应度评分" prop="emTimelinessScore">
  102. <el-rate v-model="formData.emTimelinessScore" />
  103. </el-form-item>
  104. <el-form-item label="评价意见" prop="emAppraise">
  105. <el-input type="textarea" v-model="formData.emAppraise" placeholder="请输入" />
  106. </el-form-item>
  107. </el-form>
  108. <template #footer>
  109. <div class="dialog-footer">
  110. <el-button type="info" @click="cancelForm">取 消</el-button>
  111. <el-button type="primary" @click="submitForm">确 定</el-button>
  112. </div>
  113. </template>
  114. </el-dialog>
  115. <!-- 详情 -->
  116. <el-dialog title="维修工单详情" v-model="dialogDetail" width="800px" append-to-body>
  117. <RepairDetail :eventId="eventId" v-if="dialogDetail" />
  118. </el-dialog>
  119. </div>
  120. </template>
  121.  
  122. <script setup name="维修管理">
  123. import { repairPage, repairOrder } from '@/api/floodSys/repair';
  124. import RepairDetail from './repairDetail.vue';
  125. import Cookies from 'js-cookie';
  126.  
  127. const { proxy } = getCurrentInstance();
  128.  
  129. const tableData = ref([]);
  130. const tableLoading = ref(true);
  131. const total = ref(0);
  132. const dialogShow = ref(false);
  133. const showSearch = ref(true);
  134. const dialogDetail = ref(false);
  135. const eventId = ref('');
  136.  
  137. const statusType = ref([
  138. { label: '待处理', value: 'unprocess' },
  139. { label: '处理中', value: 'ongoing' },
  140. { label: '已处理待评价', value: 'completed' },
  141. { label: '已审核评价', value: 'examined' },
  142. ]);
  143. const orderType = ref([
  144. { label: '电话投诉事件', value: 'phone' },
  145. { label: '网上投诉事件', value: 'internet' },
  146. { label: '微信公众投诉事件', value: 'weChat' },
  147. { label: '设备故障维修工单', value: 'device_fault' },
  148. ]);
  149. const yqType = ref([
  150. { label: '是', value: true },
  151. { label: '否', value: false },
  152. ]);
  153. const auditType = ref([
  154. { label: '不通过', value: 'no_pass' },
  155. { label: '通过', value: 'special' },
  156. ]);
  157. const daterange = ref([]);
  158.  
  159. const allData = reactive({
  160. formData: {
  161. emAppraise: '',
  162. emQualityScore: 5,
  163. emResult: '',
  164. emSaturationScore: 5,
  165. emTimelinessScore: 5,
  166. repairOrderId: '',
  167. rpUserName: '',
  168. },
  169. queryParams: {
  170. pageNum: 1,
  171. pageSize: 10,
  172. isOverdue: undefined,
  173. rpOrderType: undefined,
  174. rpStatus: undefined,
  175. rpOrderDesc: undefined,
  176. },
  177. rulesForm: {
  178. emResult: [{ required: true, message: '请选择', trigger: 'change' }],
  179. },
  180. });
  181. const { queryParams, formData, rulesForm } = toRefs(allData);
  182.  
  183. /** 搜索列表 */
  184. function getDataList() {
  185. tableLoading.value = true;
  186. queryParams.value.createStartTime = daterange.value[0] ? daterange.value[0] + ' 00:00:00' : '';
  187. queryParams.value.createEndTime = daterange.value[1] ? daterange.value[1] + ' 23:59:59' : '';
  188. repairPage(queryParams.value).then(response => {
  189. tableData.value = response.data;
  190. total.value = response.total;
  191. tableLoading.value = false;
  192. });
  193. }
  194. /** 详情操作 */
  195. function handleDetail(row) {
  196. eventId.value = String(row.id);
  197. dialogDetail.value = true;
  198. }
  199. /** 审核评价 */
  200. function handleRate(row) {
  201. proxy.resetForm('formRef'); //清空表单
  202. formData.value.repairOrderId = row.id;
  203. formData.value.rpUserName = Cookies.get('usernameXG'); //操作人
  204. dialogShow.value = true;
  205. }
  206. /** 取消按钮 */
  207. function cancelForm() {
  208. dialogShow.value = false;
  209. }
  210. /** 搜索按钮操作 */
  211. function handleQuery() {
  212. queryParams.value.pageNum = 1;
  213. getDataList();
  214. }
  215. /** 重置按钮操作 */
  216. function resetQuery() {
  217. proxy.resetForm('queryRef');
  218. handleQuery();
  219. }
  220. /** 提交按钮 */
  221. function submitForm() {
  222. proxy.$refs['formRef'].validate(valid => {
  223. if (valid) {
  224. repairOrder(formData.value).then(response => {
  225. proxy.$modal.msgSuccess('评价成功');
  226. dialogShow.value = false;
  227. getDataList();
  228. });
  229. }
  230. });
  231. }
  232.  
  233. onMounted(() => {
  234. getDataList();
  235. });
  236. </script>