You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1079 lines
32 KiB

  1. <template>
  2. <div class="mod-config">
  3. <div>
  4. <span @click="favoriteFunction()">
  5. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
  6. </span>
  7. </div>
  8. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  9. <el-form-item :label="'BU'">
  10. <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 130px">
  11. <el-option
  12. v-for = "i in userBuList"
  13. :key = "i.buNo"
  14. :label = "i.buDesc"
  15. :value = "i.buDesc">
  16. </el-option>
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item :label="'计划编码'">
  20. <el-input v-model="searchData.planID" clearable style="width: 120px"></el-input>
  21. </el-form-item>
  22. <el-form-item :label="'工单编码'">
  23. <el-input v-model="searchData.orderNo" clearable style="width: 120px"></el-input>
  24. </el-form-item>
  25. <el-form-item :label="'设备编码'">
  26. <el-input v-model="searchData.objectID" clearable style="width: 120px"></el-input>
  27. </el-form-item>
  28. <el-form-item :label="'计划执行人员'">
  29. <el-input v-model="searchData.planOperatorName" clearable style="width: 120px"></el-input>
  30. </el-form-item>
  31. <el-form-item :label="'状态'">
  32. <el-select filterable v-model="searchData.status" style="width: 130px">
  33. <el-option label="全部" value=""></el-option>
  34. <el-option label="未开工" value="未开工"></el-option>
  35. <el-option label="待审核" value="待审核"></el-option>
  36. <el-option label="已完工" value="已完工"></el-option>
  37. <el-option label="已取消" value="已取消"></el-option>
  38. </el-select>
  39. </el-form-item>
  40. </el-form>
  41. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  42. <el-form-item :label="'维修项目编码'">
  43. <el-input v-model="searchData.itemNo" clearable style="width: 120px"></el-input>
  44. </el-form-item>
  45. <el-form-item :label="'维修项目名称'">
  46. <el-input v-model="searchData.itemDesc" clearable style="width: 120px"></el-input>
  47. </el-form-item>
  48. <el-form-item :label="'计划执行日期'">
  49. <el-date-picker
  50. style="width: 120px"
  51. v-model="searchData.startDate"
  52. :picker-options="pickerOptions"
  53. type="date"
  54. value-format="yyyy-MM-dd"
  55. placeholder="选择日期">
  56. </el-date-picker>
  57. </el-form-item>
  58. <el-form-item style="margin-top: 23px;">
  59. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  60. </el-form-item>
  61. <el-form-item :label="' '">
  62. <el-date-picker
  63. style="width: 120px"
  64. v-model="searchData.endDate"
  65. :picker-options="pickerOptions"
  66. type="date"
  67. value-format="yyyy-MM-dd"
  68. placeholder="选择日期">
  69. </el-date-picker>
  70. </el-form-item>
  71. <el-form-item :label="'执行时间'">
  72. <el-date-picker
  73. style="width: 170px"
  74. v-model="searchData.reachDate"
  75. :picker-options="pickerOptions"
  76. type="datetime"
  77. value-format='yyyy-MM-dd HH:mm:ss'
  78. format='yyyy-MM-dd HH:mm:ss'
  79. placeholder="到达时间">
  80. </el-date-picker>
  81. </el-form-item>
  82. <el-form-item style="margin-top: 23px;">
  83. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  84. </el-form-item>
  85. <el-form-item :label="' '">
  86. <el-date-picker
  87. style="width: 170px"
  88. v-model="searchData.actualDate"
  89. :picker-options="pickerOptions"
  90. type="datetime"
  91. value-format="yyyy-MM-dd HH:mm:ss"
  92. format='yyyy-MM-dd HH:mm:ss'
  93. placeholder="实际执行时间">
  94. </el-date-picker>
  95. </el-form-item>
  96. <el-form-item :label="' '">
  97. <el-button type="primary" @click="searchClick()">查询</el-button>
  98. <download-excel
  99. :fields="fields()"
  100. :data="exportData"
  101. type="xls"
  102. :name="exportName"
  103. :header="exportHeader"
  104. :footer="exportFooter"
  105. :fetch="createExportData"
  106. :before-generate="startDownload"
  107. :before-finish="finishDownload"
  108. worksheet="导出信息"
  109. class="el-button el-button--primary el-button--medium">
  110. {{ "导出" }}
  111. </download-excel>
  112. </el-form-item>
  113. </el-form>
  114. <el-table
  115. :height="height"
  116. :data="dataList"
  117. border
  118. :row-style="controlRowStyle"
  119. style="width: 100%;">
  120. <el-table-column
  121. prop="urgency"
  122. header-align="center"
  123. align="center"
  124. label="紧急程度"
  125. width="90">
  126. </el-table-column>
  127. <el-table-column
  128. prop="result"
  129. header-align="center"
  130. align="center"
  131. label="维修结论"
  132. width="80">
  133. <template slot-scope="scope">
  134. <div :style="{fontWeight:'bold', color: scope.row.result =='维修失败' ? 'red' : scope.row.result =='维修完成' ? '#3ac252' : ''}">
  135. {{ scope.row.result }}
  136. </div>
  137. </template>
  138. </el-table-column>
  139. <el-table-column
  140. v-for="(item,index) in columnList" :key="index"
  141. :sortable="item.columnSortable"
  142. :prop="item.columnProp"
  143. :header-align="item.headerAlign"
  144. :show-overflow-tooltip="item.showOverflowTooltip"
  145. :align="item.align"
  146. :fixed="item.fixed==''?false:item.fixed"
  147. :min-width="item.columnWidth"
  148. :label="item.columnLabel">
  149. <template slot-scope="scope">
  150. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  151. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  152. </template>
  153. </el-table-column>
  154. </el-table>
  155. <el-pagination
  156. @size-change="sizeChangeHandle"
  157. @current-change="currentChangeHandle"
  158. :current-page="pageIndex"
  159. :page-sizes="[20, 50, 100, 200, 500]"
  160. :page-size="pageSize"
  161. :total="totalPage"
  162. layout="total, sizes, prev, pager, next, jumper">
  163. </el-pagination>
  164. <el-dialog title="图片查看" :close-on-click-modal="false" v-drag :visible.sync="imageModalFlag" width="390px" style="height: 550px;">
  165. <div v-viewer>
  166. <img v-for="(item, index) in descImages" :src="item" :key="index" style="width: 100px;height: 100px"/>
  167. </div>
  168. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  169. <el-button type="primary" @click="imageModalFlag = false">关闭</el-button>
  170. </el-footer>
  171. </el-dialog>
  172. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  173. </div>
  174. </template>
  175. <script>
  176. import {
  177. eamDefectRecordSearch,
  178. searchFileUrl,
  179. getSiteAndBuByUserName
  180. } from "@/api/eam/eam.js"
  181. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  182. import Chooselist from '@/views/modules/common/Chooselist_eam'
  183. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  184. export default {
  185. components: {
  186. Chooselist
  187. },
  188. watch: {
  189. searchData: {
  190. deep: true,
  191. handler: function (newV, oldV) {
  192. this.searchData.groupID = this.searchData.groupID.toUpperCase()
  193. }
  194. }
  195. },
  196. data () {
  197. return {
  198. // 是否收藏
  199. favorite: false,
  200. // 导出 start
  201. exportData: [],
  202. exportName: "设备维修记录" + this.dayjs().format('YYYYMMDDHHmmss'),
  203. exportHeader: ["设备维修记录"],
  204. exportFooter: [],
  205. exportList: [],
  206. // 导出 end
  207. tagNo:'',
  208. searchData: {
  209. site: this.$store.state.user.site,
  210. userName: this.$store.state.user.name,
  211. orderNo: '',
  212. planID: '',
  213. objectID: '',
  214. planOperator: '',
  215. buDesc: '',
  216. functionType: 'A',
  217. status: '',
  218. startDate: '',
  219. endDate: '',
  220. planDate: new Date(),
  221. page: 1,
  222. limit: 10,
  223. reachDate: '',
  224. actualDate: '',
  225. itemNo: '',
  226. itemDesc: ''
  227. },
  228. height: 200,
  229. pageIndex: 1,
  230. pageSize: 20,
  231. totalPage: 0,
  232. dataList: [],
  233. // 展示列集
  234. columnList: [
  235. {
  236. userId: this.$store.state.user.name,
  237. functionId: 101005009,
  238. serialNumber: '101005009Table1BuDesc',
  239. tableId: "101005009Table1",
  240. tableName: "维修工单表",
  241. columnProp: 'buDesc',
  242. headerAlign: "center",
  243. align: "center",
  244. columnLabel: 'BU',
  245. columnHidden: false,
  246. columnImage: false,
  247. columnSortable: false,
  248. sortLv: 0,
  249. status: true,
  250. fixed: '',
  251. columnWidth: 80,
  252. },
  253. {
  254. userId: this.$store.state.user.name,
  255. functionId: 101005009,
  256. serialNumber: '101005009Table1DisposalMeasures',
  257. tableId: "101005009Table1",
  258. tableName: "维修工单表",
  259. columnProp: 'disposalMeasures',
  260. headerAlign: "center",
  261. align: "center",
  262. columnLabel: '处置措施',
  263. columnHidden: false,
  264. columnImage: false,
  265. columnSortable: false,
  266. sortLv: 0,
  267. status: true,
  268. fixed: '',
  269. columnWidth: 80,
  270. },
  271. {
  272. userId: this.$store.state.user.name,
  273. functionId: 101005009,
  274. serialNumber: '101005009Table1OrderNo',
  275. tableId: "101005009Table1",
  276. tableName: "维修工单表",
  277. columnProp: 'orderNo',
  278. headerAlign: "center",
  279. align: "center",
  280. columnLabel: '工单编码',
  281. columnHidden: false,
  282. columnImage: false,
  283. columnSortable: true,
  284. sortLv: 0,
  285. status: true,
  286. fixed: '',
  287. columnWidth: 100,
  288. },
  289. {
  290. userId: this.$store.state.user.name,
  291. functionId: 101005009,
  292. serialNumber: '101005009Table1PlanID',
  293. tableId: "101005009Table1",
  294. tableName: "维修工单表",
  295. columnProp: 'planID',
  296. headerAlign: "center",
  297. align: "center",
  298. columnLabel: '反馈单号',
  299. columnHidden: false,
  300. columnImage: false,
  301. columnSortable: true,
  302. sortLv: 0,
  303. status: true,
  304. fixed: '',
  305. columnWidth: 100,
  306. },
  307. {
  308. userId: this.$store.state.user.name,
  309. functionId: 101005009,
  310. serialNumber: '101005009Table1FeedBackDesc',
  311. tableId: "101005009Table1",
  312. tableName: "维修工单表",
  313. columnProp: 'feedBackDesc',
  314. headerAlign: "center",
  315. align: "center",
  316. columnLabel: '反馈描述',
  317. columnHidden: false,
  318. columnImage: false,
  319. columnSortable: true,
  320. sortLv: 0,
  321. status: true,
  322. fixed: '',
  323. columnWidth: 100,
  324. },
  325. {
  326. userId: this.$store.state.user.name,
  327. functionId: 101005009,
  328. serialNumber: '101005009Table1DefectID',
  329. tableId: "101005009Table1",
  330. tableName: "维修工单表",
  331. columnProp: 'defectID',
  332. headerAlign: "center",
  333. align: "center",
  334. columnLabel: '故障编码',
  335. columnHidden: false,
  336. columnImage: false,
  337. columnSortable: false,
  338. sortLv: 0,
  339. status: true,
  340. fixed: '',
  341. columnWidth: 80,
  342. },
  343. {
  344. userId: this.$store.state.user.name,
  345. functionId: 101005009,
  346. serialNumber: '101005009Table1DefectDesc',
  347. tableId: "101005009Table1",
  348. tableName: "维修工单表",
  349. columnProp: 'defectDesc',
  350. headerAlign: "center",
  351. align: "center",
  352. columnLabel: '故障名称',
  353. columnHidden: false,
  354. columnImage: false,
  355. columnSortable: false,
  356. sortLv: 0,
  357. status: true,
  358. fixed: '',
  359. columnWidth: 80,
  360. },
  361. {
  362. userId: this.$store.state.user.name,
  363. functionId: 101005009,
  364. serialNumber: '101005009Table1ObjectID',
  365. tableId: "101005009Table1",
  366. tableName: "维修工单表",
  367. columnProp: 'objectID',
  368. headerAlign: "center",
  369. align: "center",
  370. columnLabel: '设备编码',
  371. columnHidden: false,
  372. columnImage: false,
  373. columnSortable: false,
  374. sortLv: 0,
  375. status: true,
  376. fixed: '',
  377. columnWidth: 80,
  378. },
  379. {
  380. userId: this.$store.state.user.name,
  381. functionId: 101005009,
  382. serialNumber: '101005009Table1ObjectDesc',
  383. tableId: "101005009Table1",
  384. tableName: "维修工单表",
  385. columnProp: 'objectDesc',
  386. headerAlign: "center",
  387. align: "center",
  388. columnLabel: '设备名称',
  389. columnHidden: false,
  390. columnImage: false,
  391. columnSortable: false,
  392. sortLv: 0,
  393. status: true,
  394. fixed: '',
  395. columnWidth: 120,
  396. },
  397. {
  398. userId: this.$store.state.user.name,
  399. functionId: 101005009,
  400. serialNumber: '101005009Table1ResourceDesc',
  401. tableId: "101005009Table1",
  402. tableName: "维修工单表",
  403. columnProp: 'resourceDesc',
  404. headerAlign: "center",
  405. align: "center",
  406. columnLabel: '机台名称',
  407. columnHidden: false,
  408. columnImage: false,
  409. columnSortable: false,
  410. sortLv: 0,
  411. status: true,
  412. fixed: '',
  413. columnWidth: 120,
  414. },
  415. {
  416. userId: this.$store.state.user.name,
  417. functionId: 101005009,
  418. serialNumber: '101005009Table1DepartmentName',
  419. tableId: "101005009Table1",
  420. tableName: "维修工单表",
  421. columnProp: 'departmentName',
  422. headerAlign: "center",
  423. align: "center",
  424. columnLabel: '设备部门',
  425. columnHidden: false,
  426. columnImage: false,
  427. columnSortable: false,
  428. sortLv: 0,
  429. status: true,
  430. fixed: '',
  431. columnWidth: 100,
  432. },
  433. {
  434. userId: this.$store.state.user.name,
  435. functionId: 101005009,
  436. serialNumber: '101005009Table1CreateBy',
  437. tableId: "101005009Table1",
  438. tableName: "维修工单表",
  439. columnProp: 'createBy',
  440. headerAlign: "center",
  441. align: "center",
  442. columnLabel: '报修人员名称',
  443. columnHidden: false,
  444. columnImage: false,
  445. columnSortable: false,
  446. sortLv: 0,
  447. status: true,
  448. fixed: '',
  449. columnWidth: 80,
  450. },
  451. {
  452. userId: this.$store.state.user.name,
  453. functionId: 101005009,
  454. serialNumber: '101005009Table1Status',
  455. tableId: "101005009Table1",
  456. tableName: "维修工单表",
  457. columnProp: 'status',
  458. headerAlign: "center",
  459. align: "center",
  460. columnLabel: '状态',
  461. columnHidden: false,
  462. columnImage: false,
  463. columnSortable: true,
  464. sortLv: 0,
  465. status: true,
  466. fixed: '',
  467. columnWidth: 80,
  468. },
  469. {
  470. userId: this.$store.state.user.name,
  471. functionId: 101005009,
  472. serialNumber: '101005009Table1PlanOperatorName',
  473. tableId: "101005009Table1",
  474. tableName: "维修工单表",
  475. columnProp: 'planOperatorName',
  476. headerAlign: "center",
  477. align: "center",
  478. columnLabel: '计划执行人员',
  479. columnHidden: false,
  480. columnImage: false,
  481. columnSortable: false,
  482. sortLv: 0,
  483. status: true,
  484. fixed: '',
  485. columnWidth: 100,
  486. },
  487. {
  488. userId: this.$store.state.user.name,
  489. functionId: 101005009,
  490. serialNumber: '101005009Table1ActualOperatorName',
  491. tableId: "101005009Table1",
  492. tableName: "维修工单表",
  493. columnProp: 'actualOperatorName',
  494. headerAlign: "center",
  495. align: "center",
  496. columnLabel: '实际执行人员',
  497. columnHidden: false,
  498. columnImage: false,
  499. columnSortable: false,
  500. sortLv: 0,
  501. status: true,
  502. fixed: '',
  503. columnWidth: 100,
  504. },
  505. {
  506. userId: this.$store.state.user.name,
  507. functionId: 101005009,
  508. serialNumber: '101005009Table1PlanDate',
  509. tableId: "101005009Table1",
  510. tableName: "维修工单表",
  511. columnProp: 'planDate',
  512. headerAlign: "center",
  513. align: "center",
  514. columnLabel: '计划执行日期',
  515. columnHidden: false,
  516. columnImage: false,
  517. columnSortable: true,
  518. sortLv: 0,
  519. status: true,
  520. fixed: '',
  521. columnWidth: 100,
  522. },
  523. {
  524. userId: this.$store.state.user.name,
  525. functionId: 101005009,
  526. serialNumber: '101005009Table1CreatedDate',
  527. tableId: "101005009Table1",
  528. tableName: "维修工单表",
  529. columnProp: 'createdDate',
  530. headerAlign: "center",
  531. align: "center",
  532. columnLabel: '故障时间',
  533. columnHidden: false,
  534. columnImage: false,
  535. columnSortable: true,
  536. sortLv: 0,
  537. status: true,
  538. fixed: '',
  539. columnWidth: 130,
  540. },
  541. {
  542. userId: this.$store.state.user.name,
  543. functionId: 101005009,
  544. serialNumber: '101005009Table1ReachDate',
  545. tableId: "101005009Table1",
  546. tableName: "维修工单表",
  547. columnProp: 'reachDate',
  548. headerAlign: "center",
  549. align: "center",
  550. columnLabel: '到达时间',
  551. columnHidden: false,
  552. columnImage: false,
  553. columnSortable: true,
  554. sortLv: 0,
  555. status: true,
  556. fixed: '',
  557. columnWidth: 130,
  558. },
  559. {
  560. userId: this.$store.state.user.name,
  561. functionId: 101005009,
  562. serialNumber: '101005009Table1ActualDate',
  563. tableId: "101005009Table1",
  564. tableName: "维修工单表",
  565. columnProp: 'actualDate',
  566. headerAlign: "center",
  567. align: "center",
  568. columnLabel: '实际执行时间',
  569. columnHidden: false,
  570. columnImage: false,
  571. columnSortable: true,
  572. sortLv: 0,
  573. status: true,
  574. fixed: '',
  575. columnWidth: 130,
  576. },
  577. {
  578. userId: this.$store.state.user.name,
  579. functionId: 101005009,
  580. serialNumber: '101005009Table1ResponseTime',
  581. tableId: "101005009Table1",
  582. tableName: "维修工单表",
  583. columnProp: 'responseTime',
  584. headerAlign: "center",
  585. align: "right",
  586. columnLabel: '维修响应时长(m)',
  587. columnHidden: false,
  588. columnImage: false,
  589. columnSortable: false,
  590. sortLv: 0,
  591. status: true,
  592. fixed: '',
  593. columnWidth: 110,
  594. },
  595. {
  596. userId: this.$store.state.user.name,
  597. functionId: 101005009,
  598. serialNumber: '101005009Table1WorkTime',
  599. tableId: "101005009Table1",
  600. tableName: "维修工单表",
  601. columnProp: 'workTime',
  602. headerAlign: "center",
  603. align: "right",
  604. columnLabel: '工作时长(m)',
  605. columnHidden: false,
  606. columnImage: false,
  607. columnSortable: false,
  608. sortLv: 0,
  609. status: true,
  610. fixed: '',
  611. columnWidth: 80,
  612. },
  613. {
  614. userId: this.$store.state.user.name,
  615. functionId: 101005009,
  616. serialNumber: '101005009Table1Remark',
  617. tableId: "101005009Table1",
  618. tableName: "维修工单表",
  619. columnProp: 'remark',
  620. headerAlign: "center",
  621. align: "center",
  622. columnLabel: '工单备注',
  623. columnHidden: false,
  624. columnImage: false,
  625. columnSortable: false,
  626. sortLv: 0,
  627. status: true,
  628. fixed: '',
  629. columnWidth: 120,
  630. },
  631. {
  632. userId: this.$store.state.user.name,
  633. functionId: 101005009,
  634. serialNumber: '101005009Table1DifficultyLevel',
  635. tableId: "101005009Table1",
  636. tableName: "维修工单表",
  637. columnProp: 'difficultyLevel',
  638. headerAlign: "center",
  639. align: "center",
  640. columnLabel: '难度等级',
  641. columnHidden: false,
  642. columnImage: false,
  643. columnSortable: false,
  644. sortLv: 0,
  645. status: true,
  646. fixed: '',
  647. columnWidth: 80,
  648. },
  649. {
  650. userId: this.$store.state.user.name,
  651. functionId: 101005009,
  652. serialNumber: '101005009Table1DifficultyRemark',
  653. tableId: "101005009Table1",
  654. tableName: "维修工单表",
  655. columnProp: 'difficultyRemark',
  656. headerAlign: "center",
  657. align: "center",
  658. columnLabel: '难度备注',
  659. columnHidden: false,
  660. columnImage: false,
  661. columnSortable: false,
  662. sortLv: 0,
  663. status: true,
  664. fixed: '',
  665. columnWidth: 120,
  666. },
  667. {
  668. userId: this.$store.state.user.name,
  669. functionId: 101005009,
  670. serialNumber: '101005009Table1DocumentSource',
  671. tableId: "101005009Table1",
  672. tableName: "维修工单表",
  673. columnProp: 'documentSource',
  674. headerAlign: "center",
  675. align: "center",
  676. columnLabel: '单据来源',
  677. columnHidden: false,
  678. columnImage: false,
  679. columnSortable: false,
  680. sortLv: 0,
  681. status: true,
  682. fixed: '',
  683. columnWidth: 100,
  684. },
  685. {
  686. userId: this.$store.state.user.name,
  687. functionId: 101005009,
  688. serialNumber: '101005009Table1ItemNo',
  689. tableId: "101005009Table1",
  690. tableName: "维修项目表",
  691. columnProp: 'itemNo',
  692. headerAlign: "center",
  693. align: "center",
  694. columnLabel: '维修项目编码',
  695. columnHidden: false,
  696. columnImage: false,
  697. columnSortable: false,
  698. sortLv: 0,
  699. status: true,
  700. fixed: '',
  701. columnWidth: 90,
  702. },
  703. {
  704. userId: this.$store.state.user.name,
  705. functionId: 101005009,
  706. serialNumber: '101005009Table1ItemDesc',
  707. tableId: "101005009Table1",
  708. tableName: "维修项目表",
  709. columnProp: 'itemDesc',
  710. headerAlign: "center",
  711. align: "center",
  712. columnLabel: '维修项目名称',
  713. columnHidden: false,
  714. columnImage: false,
  715. columnSortable: false,
  716. sortLv: 0,
  717. status: true,
  718. fixed: '',
  719. columnWidth: 90,
  720. },
  721. {
  722. userId: this.$store.state.user.name,
  723. functionId: 101005009,
  724. serialNumber: '101005009Table1ItemRemark',
  725. tableId: "101005009Table1",
  726. tableName: "维修项目表",
  727. columnProp: 'itemRemark',
  728. headerAlign: "center",
  729. align: "center",
  730. columnLabel: '维修方法说明',
  731. columnHidden: false,
  732. columnImage: false,
  733. columnSortable: false,
  734. sortLv: 0,
  735. status: true,
  736. fixed: '',
  737. columnWidth: 120,
  738. },
  739. {
  740. userId: this.$store.state.user.name,
  741. functionId: 101005009,
  742. serialNumber: '101005009Table1ValueType',
  743. tableId: "101005009Table1",
  744. tableName: "维修项目表",
  745. columnProp: 'valueType',
  746. headerAlign: "center",
  747. align: "center",
  748. columnLabel: '检测值类型',
  749. columnHidden: false,
  750. columnImage: false,
  751. columnSortable: false,
  752. sortLv: 0,
  753. status: true,
  754. fixed: '',
  755. columnWidth: 70,
  756. },
  757. {
  758. userId: this.$store.state.user.name,
  759. functionId: 101005009,
  760. serialNumber: '101005009Table1DefaultValue',
  761. tableId: "101005009Table1",
  762. tableName: "维修项目表",
  763. columnProp: 'defaultValue',
  764. headerAlign: "center",
  765. align: "center",
  766. columnLabel: '参照值',
  767. columnHidden: false,
  768. columnImage: false,
  769. columnSortable: false,
  770. sortLv: 0,
  771. status: true,
  772. fixed: '',
  773. columnWidth: 70,
  774. },
  775. {
  776. userId: this.$store.state.user.name,
  777. functionId: 101005009,
  778. serialNumber: '101005009Table1MaxValue',
  779. tableId: "101005009Table1",
  780. tableName: "维修项目表",
  781. columnProp: 'maxValue',
  782. headerAlign: "center",
  783. align: "center",
  784. columnLabel: '最大值',
  785. columnHidden: false,
  786. columnImage: false,
  787. columnSortable: false,
  788. sortLv: 0,
  789. status: true,
  790. fixed: '',
  791. columnWidth: 70,
  792. },
  793. {
  794. userId: this.$store.state.user.name,
  795. functionId: 101005009,
  796. serialNumber: '101005009Table1MinValue',
  797. tableId: "101005009Table1",
  798. tableName: "维修项目表",
  799. columnProp: 'minValue',
  800. headerAlign: "center",
  801. align: "center",
  802. columnLabel: '最小值',
  803. columnHidden: false,
  804. columnImage: false,
  805. columnSortable: false,
  806. sortLv: 0,
  807. status: true,
  808. fixed: '',
  809. columnWidth: 70,
  810. },
  811. ],
  812. planOperator: '',
  813. planOperatorName: '',
  814. // 日期限制
  815. pickerOptions: {
  816. disabledDate(time) {
  817. return time.getTime() > Date.now();
  818. },
  819. },
  820. descImages: [],
  821. imageModalFlag: false,
  822. userBuList: []
  823. }
  824. },
  825. mounted () {
  826. this.$nextTick(() => {
  827. this.height = window.innerHeight - 210
  828. })
  829. },
  830. created () {
  831. // 获取用户的 site 和 bu
  832. this.getSiteAndBuByUserName()
  833. // 校验用户是否收藏
  834. this.favoriteIsOk()
  835. // 获取数据列表
  836. this.getDataList()
  837. // 动态列
  838. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  839. },
  840. methods: {
  841. // 获取用户的bu
  842. getSiteAndBuByUserName () {
  843. let tempData = {
  844. username: this.$store.state.user.name,
  845. }
  846. getSiteAndBuByUserName(tempData).then(({data}) => {
  847. if (data.code === 0) {
  848. this.userBuList = data.rows
  849. }
  850. })
  851. },
  852. // 控制单行的背景颜色
  853. controlRowStyle ({row, rowIndex}) {
  854. // 区分不同的样式对应不同的颜色
  855. if (row.status === '待审核') {
  856. return "background-color: #D8ECF1"
  857. }
  858. },
  859. /**
  860. * 查看项目图片
  861. */
  862. checkItemImageModal (row) {
  863. this.descImages = []
  864. let tempData = {
  865. site: row.site,
  866. orderNo: row.orderNo,
  867. folder: row.itemNo,
  868. buNo: row.buNo
  869. }
  870. searchFileUrl(tempData).then(({data}) => {
  871. if (data.code === 0) {
  872. for (let i = 0; i < data.rows.length; i++) {
  873. this.descImages.push(data.rows[i].url)
  874. }
  875. } else {
  876. this.$message.warning(data.msg)
  877. }
  878. })
  879. this.imageModalFlag = true
  880. },
  881. // 校验用户是否收藏
  882. favoriteIsOk () {
  883. let userFavorite = {
  884. userId: this.$store.state.user.id,
  885. languageCode: this.$i18n.locale
  886. }
  887. userFavoriteList(userFavorite).then(({data}) => {
  888. for (let i = 0; i < data.list.length; i++) {
  889. if (this.$route.meta.menuId === data.list[i].menuId) {
  890. this.favorite = true
  891. }
  892. }
  893. })
  894. },
  895. // 收藏 OR 取消收藏
  896. favoriteFunction () {
  897. let userFavorite = {
  898. userId: this.$store.state.user.id,
  899. functionId: this.$route.meta.menuId,
  900. }
  901. if (this.favorite) {
  902. removeUserFavorite(userFavorite).then(({data}) => {
  903. this.$message.success(data.msg)
  904. this.favorite = false
  905. })
  906. } else {
  907. // 收藏
  908. saveUserFavorite(userFavorite).then(({data}) => {
  909. this.$message.success(data.msg)
  910. this.favorite = true
  911. })
  912. }
  913. },
  914. // 获取基础数据列表S
  915. getBaseList (val,type) {
  916. this.tagNo = val
  917. this.$nextTick(() => {
  918. let strVal = ''
  919. if (val === 201) {
  920. strVal = this.planOperator
  921. this.$refs.baseList.init(val, strVal)
  922. }
  923. })
  924. },
  925. /* 列表方法的回调 */
  926. getBaseData (val) {
  927. if (this.tagNo === 201) {
  928. this.planOperator = val.username
  929. this.planOperatorName = val.user_display
  930. }
  931. },
  932. //导出excel
  933. async createExportData () {
  934. this.searchData.limit = -1
  935. this.searchData.page = 1
  936. await eamDefectRecordSearch(this.searchData).then(({data}) => {
  937. this.exportList= data.page.list
  938. })
  939. return this.exportList
  940. },
  941. startDownload() {},
  942. finishDownload() {},
  943. fields() {
  944. let json = "{"
  945. this.columnList.forEach((item, index) => {
  946. if (index == this.columnList.length - 1) {
  947. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  948. } else {
  949. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  950. }
  951. })
  952. json += "}"
  953. let s = eval("(" + json + ")")
  954. return s
  955. },
  956. // 重置查询时间
  957. searchClick () {
  958. this.searchData.planDate = ''
  959. this.getDataList()
  960. },
  961. // 获取数据列表
  962. getDataList () {
  963. this.searchData.limit = this.pageSize
  964. this.searchData.page = this.pageIndex
  965. eamDefectRecordSearch(this.searchData).then(({data}) => {
  966. if (data.code === 0) {
  967. this.dataList = data.page.list
  968. this.pageIndex = data.page.currPage
  969. this.pageSize = data.page.pageSize
  970. this.totalPage = data.page.totalCount
  971. }
  972. })
  973. },
  974. // 每页数
  975. sizeChangeHandle (val) {
  976. this.pageSize = val
  977. this.pageIndex = 1
  978. this.getDataList()
  979. },
  980. // 当前页
  981. currentChangeHandle (val) {
  982. this.pageIndex = val
  983. this.getDataList()
  984. },
  985. // 动态列开始 获取 用户保存的 格式列
  986. async getTableUserColumn (tableId, columnId) {
  987. let queryTableUser = {
  988. userId: this.$store.state.user.name,
  989. functionId: this.$route.meta.menuId,
  990. tableId: tableId,
  991. status: true,
  992. languageCode: this.$i18n.locale
  993. }
  994. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  995. if (data.rows.length > 0) {
  996. //this.columnList1 = []
  997. switch (columnId) {
  998. case 1:
  999. this.columnList = data.rows
  1000. break;
  1001. // case 2:
  1002. // this.columnDetailList = data.rows
  1003. // break;
  1004. // case 3:
  1005. // this.columnList2 = data.rows
  1006. // break;
  1007. // case 4:
  1008. // this.columnList3 = data.rows
  1009. // break;
  1010. }
  1011. } else {
  1012. this.getColumnList(tableId, columnId)
  1013. }
  1014. })
  1015. },
  1016. // 获取 tableDefault 列
  1017. async getColumnList(tableId, columnId) {
  1018. let queryTable = {
  1019. functionId: this.$route.meta.menuId,
  1020. tableId: tableId,
  1021. languageCode: this.$i18n.locale
  1022. }
  1023. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1024. if (!data.rows.length == 0) {
  1025. switch (columnId) {
  1026. case 1:
  1027. this.columnList = data.rows
  1028. break;
  1029. // case 2:
  1030. // this.columnDetailList = data.rows
  1031. // break;
  1032. // case 3:
  1033. // this.columnList2 = data.rows
  1034. // break;
  1035. // case 4:
  1036. // this.columnList3 = data.rows
  1037. // break;
  1038. }
  1039. } else {
  1040. // this.showDefault = true.
  1041. }
  1042. })
  1043. },
  1044. }
  1045. }
  1046. </script>
  1047. <style scoped>
  1048. .numInput /deep/ .el-input__inner{
  1049. text-align: right;
  1050. }
  1051. </style>