index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="线路名称" prop="electLineName">
  5. <el-input
  6. v-model="queryParams.electLineName"
  7. placeholder="请输入线路名称"
  8. clearable
  9. @keyup.enter.native="handleQuery"
  10. />
  11. </el-form-item>
  12. <el-form-item label="主分支名称" prop="branchName" label-width="100px">
  13. <el-input
  14. v-model="queryParams.branchName"
  15. placeholder="请输入主分支名称"
  16. clearable
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <el-form-item label="计划检修超期" label-width="100px">
  21. <el-select
  22. style="margin-right: 8px"
  23. size="mini"
  24. v-model="queryParams.maintenanceOverdue"
  25. placeholder="请选择"
  26. clearable
  27. >
  28. <el-option label="否" value=""> </el-option>
  29. <el-option
  30. v-for="item in maintenanceTimeList"
  31. :key="item.parValue"
  32. :label="`${item.parValue}${item.parUnitCn}`"
  33. :value="`${item.parValue}|${item.parUnit}`"
  34. >
  35. </el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item label="重复停电" >
  39. <el-select
  40. style="margin-right: 8px"
  41. size="mini"
  42. v-model="queryParams.repeatPowerCut"
  43. placeholder="请选择"
  44. clearable
  45. >
  46. <el-option label="否" value=""> </el-option>
  47. <el-option
  48. v-for="item in repeatPowerFailureList"
  49. :key="item.parValue"
  50. :label="`${item.parValue}${item.parUnitCn}`"
  51. :value="`${item.parValue}|${item.parUnit}`"
  52. >
  53. </el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item>
  57. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  58. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  59. </el-form-item>
  60. </el-form>
  61. <el-col :span="1.5">
  62. <el-button
  63. type="warning"
  64. plain
  65. icon="el-icon-download"
  66. size="mini"
  67. @click="handleExport"
  68. v-hasPermi="['powerdistribution:maintenance:statistics:export']"
  69. >导出</el-button>
  70. </el-col>
  71. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  72. </el-row>
  73. <el-table v-loading="loading" :data="maintenanceStatisticsList" @selection-change="handleSelectionChange">
  74. <el-table-column type="selection" width="55" align="center" />
  75. <el-table-column label="事件序号" align="center" prop="eventNo" width="100" fixed >
  76. <template slot-scope="scope">
  77. <a @click="table_show(scope.row, scope.$index)" style="color:blue;cursor:pointer">{{scope.row.eventNo}}</a>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="线路名称" align="center" prop="electLineName" :show-overflow-tooltip="true" width="160" fixed />
  81. <!--el-table-column label="主分支名称" align="center" prop="branchName" :show-overflow-tooltip="true" width="120" fixed/-->
  82. <el-table-column label="数据状态" align="center" prop="dataStatus" fixed/>
  83. <el-table-column label="推送状态" align="center" prop="pushStatus" fixed/>
  84. <el-table-column label="是否可维护" align="center" prop="isMaintainable" width="100" fixed/>
  85. <el-table-column label="是否纯专变" align="center" prop="isPureSpecia" width="100" fixed/>
  86. <el-table-column label="事件类型" align="center" prop="eventType" fixed/>
  87. <el-table-column label="停电起始时间" align="center" prop="powerOutageStart" width="180" fixed>
  88. <!--template slot-scope="scope">
  89. <span>{{ parseTime(scope.row.powerOutageStart, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
  90. </template-->
  91. </el-table-column>
  92. <el-table-column label="停电终止时间" align="center" prop="powerOutageEnd" width="180" fixed>
  93. <!--template slot-scope="scope">
  94. <span>{{ parseTime(scope.row.powerOutageEnd, '{y}-{m}-{d}') }}</span>
  95. </template-->
  96. </el-table-column>
  97. <el-table-column label="停电时户数" align="center" prop="powerOutageDuringHouseholds" width="100" />
  98. <el-table-column label="研判停电性质" align="center" prop="powerOutageNature" width="100" />
  99. <el-table-column label="所属市公司" align="center" prop="city" width="150" />
  100. <el-table-column label="所属县公司" align="center" prop="county" width="150" />
  101. <el-table-column label="所属供电所" align="center" prop="station" width="150" />
  102. <el-table-column label="单位编码" align="center" prop="oranNo" />
  103. <el-table-column label="变电站名称" align="center" prop="substationName" width="100"/>
  104. <el-table-column label="停电户次数" align="center" prop="powerOutageHouseholds" />
  105. <el-table-column label="停电线次数" align="center" prop="powerOutageLine" />
  106. <el-table-column label="无故障持续时间" align="center" prop="faultFreeDuration" />
  107. <el-table-column label="奖励金额" align="center" prop="rewardAmount" />
  108. </el-table>
  109. <pagination
  110. v-show="total>0"
  111. :total="total"
  112. :page.sync="queryParams.pageNum"
  113. :limit.sync="queryParams.pageSize"
  114. @pagination="getList"
  115. />
  116. <recordDetails v-if="dialog.detailsSave" ref="detailsDialog" @closed="dialog.detailsSave=false"></recordDetails>
  117. </div>
  118. </template>
  119. <script>
  120. import recordDetails from './details'
  121. import { listMaintenanceStatistics, getMaintenanceStatistics, delMaintenanceStatistics, addMaintenanceStatistics, updateMaintenanceStatistics } from "@/api/powerdistribution/maintenance";
  122. import { listByParType } from "@/api/powerdistribution/par";
  123. import { getDicts } from "@/api/system/dict/data";
  124. export default {
  125. name: "MaintenanceStatistics",
  126. dicts: ["pdm_maintenance_time","repeat_power_failure"],
  127. components: {
  128. recordDetails
  129. },
  130. data() {
  131. return {
  132. dialog: {
  133. detailsSave:false
  134. },
  135. visible:false,
  136. // 遮罩层
  137. loading: true,
  138. // 选中数组
  139. ids: [],
  140. // 非单个禁用
  141. single: true,
  142. // 非多个禁用
  143. multiple: true,
  144. // 显示搜索条件
  145. showSearch: true,
  146. // 总条数
  147. total: 0,
  148. // 线路检修完成情况表格数据
  149. maintenanceStatisticsList: [],
  150. // 弹出层标题
  151. title: "",
  152. // 是否显示弹出层
  153. open: false,
  154. // 查询参数
  155. queryParams: {
  156. pageNum: 1,
  157. pageSize: 10,
  158. eventNo: null,
  159. electLineName: null,
  160. branchName: null,
  161. dataStatus: null,
  162. pushStatus: null,
  163. isMaintainable: null,
  164. isPureSpecia: null,
  165. eventType: null,
  166. powerOutageStart: null,
  167. powerOutageEnd: null,
  168. powerOutageDuringHouseholds: null,
  169. powerOutageNature: null,
  170. city: null,
  171. county: null,
  172. station: null,
  173. oranNo: null,
  174. substationName: null,
  175. powerOutageHouseholds: null,
  176. powerOutageLine: null,
  177. faultFreeDuration: null,
  178. rewardAmount: null
  179. },
  180. // 表单参数
  181. form: {},
  182. maintenanceTimeList: [],
  183. maintenanceTimeList2: [],
  184. repeatPowerFailureList: [],
  185. maintenanceTimeDicList: [],
  186. // 表单校验
  187. rules: {
  188. eventNo: [
  189. { required: true, message: "事情序号不能为空", trigger: "blur" }
  190. ],
  191. }
  192. };
  193. },
  194. created() {
  195. this.getList();
  196. this.getParList(0);
  197. this.getParList(1);
  198. },
  199. methods: {
  200. /** 查询线路检修完成情况列表 */
  201. getList() {
  202. this.loading = true;
  203. listMaintenanceStatistics(this.queryParams).then(response => {
  204. this.maintenanceStatisticsList = response.rows;
  205. this.total = response.total;
  206. this.loading = false;
  207. });
  208. },
  209. async getParList(parType) {
  210. this.queryParams.parType=parType;
  211. await listByParType(this.queryParams).then(response => {
  212. if(parType==0){
  213. this.maintenanceTimeList= response.data;
  214. }
  215. if(parType==1)this.repeatPowerFailureList= response.data;
  216. });
  217. },
  218. // 取消按钮
  219. cancel() {
  220. this.open = false;
  221. this.reset();
  222. },
  223. // 表单重置
  224. reset() {
  225. this.form = {
  226. eventNo: null,
  227. electLineName: null,
  228. branchName: null,
  229. dataStatus: null,
  230. pushStatus: null,
  231. isMaintainable: null,
  232. isPureSpecia: null,
  233. eventType: null,
  234. powerOutageStart: null,
  235. powerOutageEnd: null,
  236. powerOutageDuringHouseholds: null,
  237. powerOutageNature: null,
  238. city: null,
  239. county: null,
  240. station: null,
  241. oranNo: null,
  242. substationName: null,
  243. powerOutageHouseholds: null,
  244. powerOutageLine: null,
  245. faultFreeDuration: null,
  246. rewardAmount: null
  247. };
  248. this.resetForm("form");
  249. },
  250. /** 搜索按钮操作 */
  251. handleQuery() {
  252. this.queryParams.pageNum = 1;
  253. this.getList();
  254. },
  255. /** 重置按钮操作 */
  256. resetQuery() {
  257. this.resetForm("queryForm");
  258. this.handleQuery();
  259. },
  260. // 多选框选中数据
  261. handleSelectionChange(selection) {
  262. this.ids = selection.map(item => item.eventNo)
  263. this.single = selection.length!==1
  264. this.multiple = !selection.length
  265. },
  266. /** 新增按钮操作 */
  267. handleAdd() {
  268. this.reset();
  269. this.open = true;
  270. this.title = "添加线路检修完成情况";
  271. },
  272. /** 修改按钮操作 */
  273. handleUpdate(row) {
  274. this.reset();
  275. const eventNo = row.eventNo || this.ids
  276. getMaintenanceStatistics(eventNo).then(response => {
  277. this.form = response.data;
  278. this.open = true;
  279. this.title = "修改线路检修完成情况";
  280. });
  281. },
  282. /** 提交按钮 */
  283. submitForm() {
  284. this.$refs["form"].validate(valid => {
  285. if (valid) {
  286. if (this.form.eventNo != null) {
  287. updateMaintenanceStatistics(this.form).then(response => {
  288. this.$modal.msgSuccess("修改成功");
  289. this.open = false;
  290. this.getList();
  291. });
  292. } else {
  293. addMaintenanceStatistics(this.form).then(response => {
  294. this.$modal.msgSuccess("新增成功");
  295. this.open = false;
  296. this.getList();
  297. });
  298. }
  299. }
  300. });
  301. },
  302. /** 删除按钮操作 */
  303. handleDelete(row) {
  304. const eventNos = row.eventNo || this.ids;
  305. this.$modal.confirm('是否确认删除线路检修完成情况编号为"' + eventNos + '"的数据项?').then(function() {
  306. return delMaintenanceStatistics(eventNos);
  307. }).then(() => {
  308. this.getList();
  309. this.$modal.msgSuccess("删除成功");
  310. }).catch(() => {});
  311. },
  312. /** 导出按钮操作 */
  313. handleExport() {
  314. this.download('powerdistribution/maintenance/statistics/export', {
  315. ...this.queryParams
  316. }, `maintenanceStatistics_${new Date().getTime()}.xlsx`)
  317. },
  318. //查看
  319. table_show(row){
  320. this.dialog.detailsSave = true
  321. this.$nextTick(() => {
  322. this.$refs.detailsDialog.open().setData(row)
  323. })
  324. },
  325. }
  326. };
  327. </script>