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.

933 lines
28 KiB

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