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.

1111 lines
34 KiB

  1. <template >
  2. <div class="mod-config" ref="getHeight">
  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" :model="querySysLanguagePack" @keyup.enter.native="getDataList()">
  9. <el-form-item :label="inputLabel.headerInput.label1">
  10. <el-input style="width: 100px;" v-model="queryDetailData.toolId" ></el-input>
  11. </el-form-item>
  12. <el-form-item :label="inputLabel.headerInput.label2">
  13. <el-input style="width: 100px;" v-model="queryDetailData.toolInstanceId" ></el-input>
  14. </el-form-item>
  15. <el-form-item :label="inputLabel.headerInput.label3">
  16. <el-input style="width: 100px;" v-model="queryDetailData.toolDescription" ></el-input>
  17. </el-form-item>
  18. <el-form-item>
  19. <el-button @click="getDataList()" type="primary">{{buttons.search}}</el-button>
  20. <el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{buttons.defaultTable}}
  21. </el-button>
  22. <el-button @click="userSetting" type="primary">{{ buttons.settingTable}}</el-button>
  23. <download-excel
  24. :fields="fields()"
  25. :data="exportData"
  26. type="xls"
  27. :name="exportName"
  28. :header="exportHeader"
  29. :footer="exportFooter"
  30. :defaultValue="exportDefaultValue"
  31. :fetch="createExportData"
  32. :before-generate="startDownload"
  33. :before-finish="finishDownload"
  34. worksheet="导出信息"
  35. class="el-button el-button--primary el-button--medium">
  36. {{buttons.download}}
  37. </download-excel>
  38. <el-button v-if="isAuth(':prd:delete')" type="danger" @click="deleteHandle()"
  39. :disabled="dataListSelections.length <= 0">{{ buttons.deleteList}}
  40. </el-button>
  41. </el-form-item>
  42. </el-form>
  43. <el-table
  44. id="commmon"
  45. :height="height"
  46. :data="dataList"
  47. border
  48. v-loading="dataListLoading"
  49. @selection-change="selectionChangeHandle"
  50. @cell-click = "toolDetailChange"
  51. style="width: 100%;">
  52. <el-table-column
  53. v-for="(item,index) in columnList" :key="index"
  54. :sortable="item.columnSortable"
  55. :prop="item.columnProp"
  56. :header-align="item.headerAlign"
  57. :show-overflow-tooltip="item.showOverflowTooltip"
  58. :align="item.align"
  59. :fixed="item.fixed"
  60. :width="item.columnWidth"
  61. :label="item.columnLabel">
  62. <template slot-scope="scope">
  63. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  64. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  65. style="width: 100px; height: 80px"/></span>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. <el-table
  70. id="commmon1"
  71. :height="detailHeight"
  72. :data="detailTransList"
  73. border
  74. v-loading="dataListLoading"
  75. @selection-change="selectionChangeHandle"
  76. style="width: 100%;">
  77. <el-table-column
  78. v-for="(item,index) in columnList1" :key="index"
  79. :sortable="item.columnSortable"
  80. :prop="item.columnProp"
  81. :header-align="item.headerAlign"
  82. :show-overflow-tooltip="item.showOverflowTooltip"
  83. :align="item.align"
  84. :fixed="item.fixed"
  85. :width="item.columnWidth"
  86. :label="item.columnLabel">
  87. <template slot-scope="scope">
  88. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  89. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  90. style="width: 100px; height: 80px"/></span>
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. <column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
  95. </div>
  96. </template>
  97. <script>
  98. import column from "../common/column";
  99. import {
  100. searchSysLanguagePackList,
  101. searchSysLanguageParam,
  102. searchFunctionButtonList,
  103. saveButtonList,
  104. searchSysLanguage,
  105. searchLanguageListByLanguageCode,
  106. saveSysLanguageOne
  107. } from "@/api/sysLanguage.js"
  108. import getLodop from '@/utils/LodopFuncs.js'
  109. import {
  110. saveTableDefaultList,
  111. saveTableUser,
  112. getTableDefaultListLanguage,
  113. getTableUserListLanguage
  114. } from "@/api/table.js"
  115. import {
  116. userFavoriteList,
  117. saveUserFavorite,
  118. removeUserFavorite
  119. } from '@/api/userFavorite.js'
  120. import {
  121. getToolDetailResumeList,
  122. getToolDetailTrans,
  123. } from '@/api/toolMan/toolResume.js'
  124. export default {
  125. components: {
  126. column
  127. },
  128. data() {
  129. return {
  130. detailTransList : [],
  131. currentDetailData : {
  132. site : this.$store.state.user.site,
  133. toolInstanceId : '',
  134. },
  135. queryDetailData : {
  136. site : this.$store.state.user.site,
  137. toolId : '',
  138. toolInstanceId : '',
  139. toolDescription : '',
  140. status : '',
  141. },
  142. inputLabel :{
  143. headerInput : {
  144. label1 : '工具编码',
  145. label2 : '工具实例编码',
  146. label3 : '工具名称',
  147. },
  148. },
  149. // table高度
  150. height:450,
  151. detailHeight : 300,
  152. // 是否收藏
  153. favorite: false,
  154. addLanguage: false,
  155. functionId: 1101,
  156. tableId: "toolDetail1101",
  157. value1: true,
  158. visible: false,
  159. showDefault: false,
  160. // 默认table 查询参数
  161. queryTable: {
  162. functionId: 1101,
  163. tableId: "toolDetail1101",
  164. languageCode: this.$i18n.locale
  165. },
  166. // 用户table 查询参数
  167. queryTableUser: {
  168. userId: this.$store.state.user.name,
  169. functionId: 1101,
  170. tableId: "toolDetail1101",
  171. status: true,
  172. languageCode: this.$i18n.locale
  173. },
  174. // 语言词典查询参数
  175. querySysLanguageParam: {
  176. languageCode: this.$i18n.locale
  177. },
  178. // 语言词典集合
  179. sysLanguageParams: [],
  180. // 用户table 配置集合
  181. userColumnList: [],
  182. // 展示列集
  183. columnList: [
  184. {
  185. userId: this.$store.state.user.name,
  186. functionId: 1101,
  187. serialNumber: 'toolDetail1101ToolId',
  188. tableId: "toolDetail1101",
  189. tableName: "common",
  190. columnProp: "toolId",
  191. headerAlign: "center",
  192. align: "center",
  193. columnLabel: "工具编码",
  194. columnHidden: false,
  195. columnImage: false,
  196. columnSortable: false,
  197. sortLv: 0,
  198. status: true,
  199. fixed: false,
  200. columnWidth : 80,
  201. },
  202. {
  203. userId: this.$store.state.user.name,
  204. functionId: 1101,
  205. serialNumber: 'toolDetail1101ToolInstanceId',
  206. tableId: "toolDetail1101",
  207. tableName: "common",
  208. columnProp: "toolInstanceId",
  209. headerAlign: "center",
  210. align: "center",
  211. columnLabel: "工具实例编码",
  212. columnHidden: false,
  213. columnImage: false,
  214. columnSortable: false,
  215. sortLv: 0,
  216. status: true,
  217. fixed: false,
  218. columnWidth : 95,
  219. },
  220. {
  221. userId: this.$store.state.user.name,
  222. functionId: 1101,
  223. serialNumber: 'toolDetail1101type',
  224. tableId: "toolDetail1101",
  225. tableName: "common",
  226. columnProp: "toolDescription",
  227. headerAlign: "center",
  228. align: "center",
  229. columnLabel: "工具名称",
  230. columnHidden: false,
  231. columnImage: false,
  232. columnSortable: false,
  233. sortLv: 0,
  234. status: true,
  235. fixed: false,
  236. columnWidth : 80,
  237. },
  238. {
  239. userId: this.$store.state.user.name,
  240. functionId: 1101,
  241. serialNumber: 'toolDetail1101CreateDate',
  242. tableId: "toolDetail1101",
  243. tableName: "common",
  244. columnProp: "createDate",
  245. headerAlign: "center",
  246. align: "center",
  247. columnLabel: "接收日期",
  248. columnHidden: false,
  249. columnImage: false,
  250. columnSortable: false,
  251. sortLv: 0,
  252. status: true,
  253. fixed: false,
  254. columnWidth : 135,
  255. },
  256. {
  257. userId: this.$store.state.user.name,
  258. functionId: 1101,
  259. serialNumber: 'toolDetail1101Status',
  260. tableId: "toolDetail1101",
  261. tableName: "common",
  262. columnProp: "status",
  263. headerAlign: "center",
  264. align: "center",
  265. columnLabel: "状态",
  266. columnHidden: false,
  267. columnImage: false,
  268. columnSortable: false,
  269. sortLv: 0,
  270. status: true,
  271. fixed: false,
  272. columnWidth : 60,
  273. },
  274. {
  275. userId: this.$store.state.user.name,
  276. functionId: 1101,
  277. serialNumber: 'toolDetail1101CurrLocationId',
  278. tableId: "toolDetail1101",
  279. tableName: "common",
  280. columnProp: "currLocationId",
  281. headerAlign: "center",
  282. align: "center",
  283. columnLabel: "库位编码",
  284. columnHidden: false,
  285. columnImage: false,
  286. columnSortable: false,
  287. sortLv: 0,
  288. status: true,
  289. fixed: false,
  290. columnWidth : 75,
  291. },
  292. {
  293. userId: this.$store.state.user.name,
  294. functionId: 1101,
  295. serialNumber: 'toolDetail1101CurrLocationId',
  296. tableId: "toolDetail1101",
  297. tableName: "common",
  298. columnProp: "locationName",
  299. headerAlign: "center",
  300. align: "center",
  301. columnLabel: "库位名称",
  302. columnHidden: false,
  303. columnImage: false,
  304. columnSortable: false,
  305. sortLv: 0,
  306. status: true,
  307. fixed: false,
  308. columnWidth : 95,
  309. },
  310. {
  311. userId: this.$store.state.user.name,
  312. functionId: 1101,
  313. serialNumber: 'toolDetail1101DeliveryDate',
  314. tableId: "toolDetail1101",
  315. tableName: "common",
  316. columnProp: "deliveryDate",
  317. headerAlign: "center",
  318. align: "center",
  319. columnLabel: "送修日期",
  320. columnHidden: false,
  321. columnImage: false,
  322. columnSortable: false,
  323. sortLv: 0,
  324. status: true,
  325. fixed: false,
  326. columnWidth : 135,
  327. },
  328. {
  329. userId: this.$store.state.user.name,
  330. functionId: 1101,
  331. serialNumber: 'toolDetail1101TransNo',
  332. tableId: "toolDetail1101",
  333. tableName: "common",
  334. columnProp: "transNo",
  335. headerAlign: "center",
  336. align: "center",
  337. columnLabel: "送修单号",
  338. columnHidden: false,
  339. columnImage: false,
  340. columnSortable: false,
  341. sortLv: 0,
  342. status: true,
  343. fixed: false,
  344. },
  345. {
  346. userId: this.$store.state.user.name,
  347. functionId: 1101,
  348. serialNumber: 'toolDetail1101SupplierName',
  349. tableId: "toolDetail1101",
  350. tableName: "common",
  351. columnProp: "supplierName",
  352. headerAlign: "center",
  353. align: "center",
  354. columnLabel: "维修供应商",
  355. columnHidden: false,
  356. columnImage: false,
  357. columnSortable: false,
  358. sortLv: 0,
  359. status: true,
  360. fixed: false,
  361. columnWidth : 190,
  362. },
  363. {
  364. userId: this.$store.state.user.name,
  365. functionId: 1101,
  366. serialNumber: 'toolDetail1101ActualuseQty',
  367. tableId: "toolDetail1101",
  368. tableName: "common",
  369. columnProp: "actualuseQty",
  370. headerAlign: "center",
  371. align: "center",
  372. columnLabel: "已使用次数",
  373. columnHidden: false,
  374. columnImage: false,
  375. columnSortable: false,
  376. sortLv: 0,
  377. status: true,
  378. fixed: false,
  379. columnWidth : 90,
  380. },
  381. {
  382. userId: this.$store.state.user.name,
  383. functionId: 1101,
  384. serialNumber: 'toolDetail1101EstuseQty',
  385. tableId: "toolDetail1101",
  386. tableName: "common",
  387. columnProp: "estuseQty",
  388. headerAlign: "center",
  389. align: "right",
  390. columnLabel: "预计使用次数",
  391. columnHidden: false,
  392. columnImage: false,
  393. columnSortable: false,
  394. sortLv: 0,
  395. status: true,
  396. fixed: false,
  397. columnWidth : 100,
  398. },
  399. {
  400. userId: this.$store.state.user.name,
  401. functionId: 1101,
  402. serialNumber: 'toolDetail1101Prop',
  403. tableId: "toolDetail1101",
  404. tableName: "common",
  405. columnProp: "prop",
  406. headerAlign: "center",
  407. align: "center",
  408. columnLabel: "占比",
  409. columnHidden: false,
  410. columnImage: false,
  411. columnSortable: false,
  412. sortLv: 0,
  413. status: true,
  414. fixed: false,
  415. columnWidth : 60,
  416. },
  417. ],
  418. // 展示列集
  419. columnList1: [
  420. {
  421. userId: this.$store.state.user.name,
  422. functionId: 1101,
  423. tableId: "toolTrans1101",
  424. tableName: "toolTransTable",
  425. columnProp: "transNo",
  426. headerAlign: "center",
  427. align: "center",
  428. columnLabel: "单号",
  429. columnHidden: false,
  430. columnImage: false,
  431. columnSortable: false,
  432. sortLv: 0,
  433. status: true,
  434. fixed: false,
  435. columnWidth : 135,
  436. },
  437. {
  438. userId: this.$store.state.user.name,
  439. functionId: 1101,
  440. tableId: "toolTrans1101",
  441. tableName: "toolTransTable",
  442. columnProp: "toolInstanceId",
  443. headerAlign: "center",
  444. align: "center",
  445. columnLabel: "工具实例编码",
  446. columnHidden: false,
  447. columnImage: false,
  448. columnSortable: false,
  449. sortLv: 0,
  450. status: true,
  451. fixed: false,
  452. columnWidth : 100,
  453. },
  454. {
  455. userId: this.$store.state.user.name,
  456. functionId: 1101,
  457. tableId: "toolTrans1101",
  458. tableName: "toolTransTable",
  459. columnProp: "locationId",
  460. headerAlign: "center",
  461. align: "center",
  462. columnLabel: "库位编码",
  463. columnHidden: false,
  464. columnImage: false,
  465. columnSortable: false,
  466. sortLv: 0,
  467. status: true,
  468. fixed: false,
  469. columnWidth : 80,
  470. },
  471. {
  472. userId: this.$store.state.user.name,
  473. functionId: 1101,
  474. tableId: "toolTrans1101",
  475. tableName: "toolTransTable",
  476. columnProp: "locationName",
  477. headerAlign: "center",
  478. align: "center",
  479. columnLabel: "库位名称",
  480. columnHidden: false,
  481. columnImage: false,
  482. columnSortable: false,
  483. sortLv: 0,
  484. status: true,
  485. fixed: false,
  486. columnWidth : 80,
  487. },
  488. {
  489. userId: this.$store.state.user.name,
  490. functionId: 1101,
  491. tableId: "toolTrans1101",
  492. tableName: "toolTransTable",
  493. columnProp: "supplierName",
  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: false,
  503. columnWidth : 135,
  504. },
  505. {
  506. userId: this.$store.state.user.name,
  507. functionId: 1101,
  508. tableId: "toolTrans1101",
  509. tableName: "toolTransTable",
  510. columnProp: "oper",
  511. headerAlign: "center",
  512. align: "center",
  513. columnLabel: "操作名称",
  514. columnHidden: false,
  515. columnImage: false,
  516. columnSortable: false,
  517. sortLv: 0,
  518. status: true,
  519. fixed: false,
  520. columnWidth : 80,
  521. },
  522. {
  523. userId: this.$store.state.user.name,
  524. functionId: 1101,
  525. tableId: "toolTrans1101",
  526. tableName: "toolTransTable",
  527. columnProp: "orderNo",
  528. headerAlign: "center",
  529. align: "center",
  530. columnLabel: "工单号",
  531. columnHidden: false,
  532. columnImage: false,
  533. columnSortable: false,
  534. sortLv: 0,
  535. status: true,
  536. fixed: false,
  537. columnWidth : 90,
  538. },
  539. {
  540. userId: this.$store.state.user.name,
  541. functionId: 1101,
  542. tableId: "toolTrans1101",
  543. tableName: "toolTransTable",
  544. columnProp: "createdBy",
  545. headerAlign: "center",
  546. align: "center",
  547. columnLabel: "操作人",
  548. columnHidden: false,
  549. columnImage: false,
  550. columnSortable: false,
  551. sortLv: 0,
  552. status: true,
  553. fixed: false,
  554. columnWidth : 80,
  555. },
  556. {
  557. userId: this.$store.state.user.name,
  558. functionId: 1101,
  559. tableId: "toolTrans1101",
  560. tableName: "toolTransTable",
  561. columnProp: "createDate",
  562. headerAlign: "center",
  563. align: "center",
  564. columnLabel: "操作时间",
  565. columnHidden: false,
  566. columnImage: false,
  567. columnSortable: false,
  568. sortLv: 0,
  569. status: true,
  570. fixed: false,
  571. columnWidth : 135,
  572. },
  573. {
  574. userId: this.$store.state.user.name,
  575. functionId: 1101,
  576. tableId: "toolTrans1101",
  577. tableName: "toolTransTable",
  578. columnProp: "passFlag",
  579. headerAlign: "center",
  580. align: "center",
  581. columnLabel: "检验状态",
  582. columnHidden: false,
  583. columnImage: false,
  584. columnSortable: false,
  585. sortLv: 0,
  586. status: true,
  587. fixed: false,
  588. },
  589. {
  590. userId: this.$store.state.user.name,
  591. functionId: 1101,
  592. tableId: "toolTrans1101",
  593. tableName: "toolTransTable",
  594. columnProp: "actCheckBy",
  595. headerAlign: "center",
  596. align: "center",
  597. columnLabel: "检验人",
  598. columnHidden: false,
  599. columnImage: false,
  600. columnSortable: false,
  601. sortLv: 0,
  602. status: true,
  603. fixed: false,
  604. },
  605. {
  606. userId: this.$store.state.user.name,
  607. functionId: 1101,
  608. tableId: "toolTrans1101ActCheckDate",
  609. tableName: "toolTransTable",
  610. columnProp: "actCheckDate",
  611. headerAlign: "center",
  612. align: "center",
  613. columnLabel: "检验时间",
  614. columnHidden: false,
  615. columnImage: false,
  616. columnSortable: false,
  617. sortLv: 0,
  618. status: true,
  619. fixed: false,
  620. columnWidth : 135,
  621. },
  622. {
  623. userId: this.$store.state.user.name,
  624. functionId: 1101,
  625. tableId: "toolTrans1101DefectCode",
  626. tableName: "toolTransTable",
  627. columnProp: "defectCode",
  628. headerAlign: "center",
  629. align: "center",
  630. columnLabel: "责任类型",
  631. columnHidden: false,
  632. columnImage: false,
  633. columnSortable: false,
  634. sortLv: 0,
  635. status: true,
  636. fixed: false,
  637. columnWidth : 90,
  638. },
  639. {
  640. userId: this.$store.state.user.name,
  641. functionId: 1101,
  642. tableId: "toolTrans1101Remark2",
  643. tableName: "toolTransTable",
  644. columnProp: "remark2",
  645. headerAlign: "center",
  646. align: "center",
  647. columnLabel: "原因",
  648. columnHidden: false,
  649. columnImage: false,
  650. columnSortable: false,
  651. sortLv: 0,
  652. status: true,
  653. fixed: false,
  654. columnWidth : 135,
  655. },
  656. ],
  657. // 数据集
  658. dataList: [],
  659. queryButton: {
  660. functionId: 1101,
  661. table_id: 'toolDetail1101',
  662. languageCode: this.$i18n.locale,
  663. objectType: 'button'
  664. },
  665. buttons: {
  666. add: '添加',
  667. edit: '编辑',
  668. delete: '删除',
  669. deleteList: '批量删除',
  670. cz: '操作',
  671. search: '查询',
  672. download: '导出',
  673. settingTable: '设置列表',
  674. defaultTable: '设置默认配置'
  675. },
  676. // 导出 start
  677. exportData: [],
  678. exportName: "页面功能语言",
  679. exportHeader: ["页面功能语言"],
  680. exportFooter: [],
  681. exportDefaultValue: "这一行这一列没有数据",
  682. // 导出 end
  683. buttonList: [
  684. // {
  685. // functionId: "1101",
  686. // languageValue: '添加',
  687. // objectId: 'add',
  688. // objectType: "button",
  689. // tableId: "toolDetail1101"
  690. // },
  691. // {
  692. // functionId: "1101",
  693. // languageValue: '编辑',
  694. // objectId: 'edit',
  695. // objectType: "button",
  696. // tableId: "toolDetail1101"
  697. // },
  698. // {
  699. // functionId: "1101",
  700. // languageValue: '删除',
  701. // objectId: 'delete',
  702. // objectType: "button",
  703. // tableId: "toolDetail1101"
  704. // },
  705. // {
  706. // functionId: "1101",
  707. // languageValue: '批量删除',
  708. // objectId: 'deleteList',
  709. // objectType: "button",
  710. // tableId: "toolDetail1101"
  711. // },
  712. // {
  713. // functionId: "1101",
  714. // languageValue: '操作',
  715. // objectId: 'cz',
  716. // objectType: "button",
  717. // tableId: "toolDetail1101"
  718. // },
  719. // {
  720. // functionId: "1101",
  721. // languageValue: '查询',
  722. // objectId: 'search',
  723. // objectType: "button",
  724. // tableId: "toolDetail1101"
  725. // },
  726. // {
  727. // functionId: "1101",
  728. // languageValue: '导出',
  729. // objectId: 'download',
  730. // objectType: "button",
  731. // tableId: "toolDetail1101"
  732. // },
  733. // {
  734. // functionId: "1101",
  735. // languageValue: '设置列表',
  736. // objectId: 'settingTable',
  737. // objectType: "button",
  738. // tableId: "toolDetail1101"
  739. // },
  740. // {
  741. // functionId: "1101",
  742. // languageValue: '设置默认配置',
  743. // objectId: 'defaultTable',
  744. // objectType: "button",
  745. // tableId: "toolDetail1101"
  746. // }
  747. ],
  748. languageList: [],
  749. languageColumnList: [],
  750. languageDataList: [],
  751. queryLanguage: {},
  752. // 数据集条件
  753. querySysLanguagePack: {
  754. functionId: '',
  755. page: 1,
  756. limit: 1,
  757. languageValue: '',
  758. objectType: '',
  759. objectId: ''
  760. },
  761. // 分页
  762. pageIndex: 1,
  763. pageSize: 20,
  764. totalPage: 0,
  765. dataListLoading: false,
  766. dataListSelections: [],
  767. addOrUpdateVisible: false
  768. }
  769. },
  770. mounted() {
  771. this.$nextTick(()=>{
  772. console.log("window.innerHeight =" + window.innerHeight)
  773. this.detailHeight = (window.innerHeight - 200) * 0.6;
  774. console.log(this.detailHeight)
  775. })
  776. this.$nextTick(()=>{
  777. this.height = (window.innerHeight - 200) * 0.4 ;
  778. console.log(this.height)
  779. })
  780. },
  781. activated() {
  782. //this.getDataList()
  783. this.getLanguageList()
  784. },
  785. methods: {
  786. toolDetailChange(row, column, event){
  787. this.currentDetailData.toolInstanceId = row.toolInstanceId
  788. this.getDetailTransList()
  789. },
  790. //获取工具实例使用记录
  791. getDetailTransList(){
  792. this.detailTransList = []
  793. getToolDetailTrans(this.currentDetailData).then(({data}) =>{
  794. let list = data.rows
  795. if(list.length > 0){
  796. this.detailTransList = list
  797. }
  798. })
  799. },
  800. // 打印方式
  801. printReport(){
  802. alert( this.$store.state.user.site)
  803. //
  804. // const LODOP = getLodop()
  805. // if (LODOP) {
  806. // var strBodyStyle = '<style>'
  807. // strBodyStyle += 'table { border-top: 1 solid #000000; border-left: 1 solid #000000; border-collapse:collapse; border-spacing:0;}'
  808. // strBodyStyle += 'caption { line-height:2em; }'
  809. // strBodyStyle += 'td { border-right: 1 solid #000000; border-bottom: 1 solid #000000; text-align:center; padding:2px 3px; font-size:11px;}'
  810. // strBodyStyle += '</style>' //设置打印样式
  811. // var strFormHtml = strBodyStyle + '<body>' + document.getElementById('commmon').innerHTML + '</body>' //获取打印内容
  812. //
  813. // LODOP.PRINT_INIT('') //初始化
  814. // LODOP.PRINT_DESIGN();
  815. // //LODOP.PREVIEW();
  816. // //LODOP.PRINT();
  817. //
  818. // LODOP.SET_PRINT_PAGESIZE(2, 0, 0, 'A4') //设置横向
  819. // LODOP.ADD_PRINT_HTM('1%', '1%', '98%', '98%', strFormHtml) //设置打印内容
  820. // LODOP.SET_PREVIEW_WINDOW(2, 0, 0, 800, 600, '') //设置预览窗口模式和大小
  821. // LODOP.PREVIEW()
  822. // }
  823. },
  824. // 校验用户是否收藏
  825. favoriteIsOk(){
  826. let userFavorite ={
  827. userId:this.$store.state.user.id,
  828. languageCode:this.$i18n.locale
  829. }
  830. userFavoriteList(userFavorite).then(({data}) =>{
  831. let size = data.list.filter(item => item.userId==userFavorite.menuId).length;
  832. if (size>0){
  833. this.favorite = true
  834. }else {
  835. this.favorite = false
  836. }
  837. })
  838. },
  839. // 收藏 OR 取消收藏
  840. favoriteFunction(){
  841. let userFavorite ={
  842. userId: this.$store.state.user.id,
  843. functionId: this.$route.meta.menuId,
  844. }
  845. if (this.favorite){
  846. // 取消收藏
  847. this.$confirm(`确定取消收藏`, '提示', {
  848. confirmButtonText: '确定',
  849. cancelButtonText: '取消',
  850. type: 'warning'
  851. }).then(() => {
  852. removeUserFavorite(userFavorite).then(({data})=>{
  853. this.$message.success(data.msg)
  854. this.favorite = false
  855. })
  856. })
  857. }else {
  858. // 收藏
  859. saveUserFavorite(userFavorite).then(({data})=>{
  860. this.$message.success(data.msg)
  861. this.favorite = true
  862. })
  863. }
  864. },
  865. // 保存语言编辑
  866. saveLanguageList(val) {
  867. saveSysLanguageOne(val).then(({data}) => {
  868. if (data.code == 0) {
  869. this.$message.success(data.msg)
  870. } else {
  871. this.$message.error(data.msg)
  872. }
  873. })
  874. },
  875. // 编辑语言
  876. addLanguageFun() {
  877. if (this.querySysLanguagePack.languageCode) {
  878. this.addLanguage = true
  879. this.languageColumnList = []
  880. let query = {
  881. functionId: 1101,
  882. tableId: "common1002",
  883. languageCode: this.$i18n.locale
  884. }
  885. getTableDefaultListLanguage(query).then(({data}) => {
  886. if (data.rows.length > 0) {
  887. this.languageColumnList = data.rows
  888. }
  889. })
  890. this.languageColumnList = this.columnList
  891. searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => {
  892. this.languageDataList = data.rows
  893. })
  894. } else {
  895. this.$message("请选中一种语言")
  896. }
  897. },
  898. // 获取多语言列表
  899. getLanguageList() {
  900. searchSysLanguage(this.queryLanguage).then(({data}) => {
  901. this.languageList = data.rows
  902. })
  903. },
  904. // 获取button的词典
  905. getFunctionButtonList() {
  906. searchFunctionButtonList(this.queryButton).then(({data}) => {
  907. if (JSON.stringify(data.data) != '{}' ) {
  908. this.buttons = data.data
  909. } else {
  910. // saveButtonList(this.buttonList).then(({data}) => {
  911. // })
  912. }
  913. })
  914. },
  915. // 获取语言词典
  916. getSysLanguageParamList() {
  917. searchSysLanguageParam(this.querySysLanguageParam).then(({data}) => {
  918. this.sysLanguageParams = data.rows
  919. })
  920. },
  921. // 打开页面设置
  922. userSetting() {
  923. this.visible = true;
  924. let queryTable = {
  925. userId: this.$store.state.user.name,
  926. functionId: 1101,
  927. tableId: "toolDetail1101",
  928. languageCode: this.$i18n.locale
  929. }
  930. this.$nextTick(() => {
  931. this.$refs.column.init(queryTable);
  932. });
  933. },
  934. // 获取 用户保存的 格式列
  935. getTableUserColumn() {
  936. getTableUserListLanguage(this.queryTableUser).then(({data}) => {
  937. if (data.rows.length > 0) {
  938. //this.columnList = []
  939. this.columnList = data.rows
  940. } else {
  941. this.getColumnList()
  942. }
  943. })
  944. },
  945. // 保存 默认配置 列
  946. saveColumnList() {
  947. saveTableDefaultList(this.columnList).then(({data}) => {
  948. if (data.code == 0) {
  949. this.$message.success(data.msg)
  950. this.showDefault = false
  951. } else {
  952. this.$message.error(data.msg)
  953. }
  954. })
  955. saveTableDefaultList(this.columnList1).then(({data}) => {
  956. if (data.code == 0) {
  957. this.$message.success(data.msg)
  958. this.showDefault = false
  959. } else {
  960. this.$message.error(data.msg)
  961. }
  962. })
  963. saveButtonList(this.buttonList).then(({data}) => {
  964. })
  965. this.getFunctionButtonList()
  966. this.getFunctionButtonList();
  967. this.getColumnList()
  968. },
  969. // 获取 tableDefault 列
  970. getColumnList() {
  971. getTableDefaultListLanguage(this.queryTable).then(({data}) => {
  972. if (!data.rows.length == 0) {
  973. this.showDefault = false
  974. this.columnList = data.rows
  975. } else {
  976. this.showDefault = true
  977. }
  978. })
  979. },
  980. // 获取数据列表
  981. getDataList() {
  982. this.dataListLoading = true
  983. getToolDetailResumeList(this.queryDetailData).then(({data}) => {
  984. if (data && data.code === 0) {
  985. this.dataList = data.rows
  986. if(this.dataList.length > 0){
  987. this.currentDetailData.toolInstanceId = this.dataList[0].toolInstanceId
  988. this.getDetailTransList()
  989. }
  990. } else {
  991. this.dataList = []
  992. }
  993. this.dataListLoading = false
  994. })
  995. },
  996. // 每页数
  997. sizeChangeHandle(val) {
  998. this.pageSize = val
  999. this.pageIndex = 1
  1000. this.getDataList()
  1001. },
  1002. // 当前页
  1003. currentChangeHandle(val) {
  1004. this.pageIndex = val
  1005. this.getDataList()
  1006. },
  1007. // 多选
  1008. selectionChangeHandle(val) {
  1009. this.dataListSelections = val
  1010. },
  1011. // 删除
  1012. deleteHandle(id) {
  1013. var ids = id ? [id] : this.dataListSelections.map(item => {
  1014. return item.id
  1015. })
  1016. this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
  1017. confirmButtonText: '确定',
  1018. cancelButtonText: '取消',
  1019. type: 'warning'
  1020. }).then(() => {
  1021. this.$http({
  1022. url: this.$http.adornUrl('//prd/delete'),
  1023. method: 'post',
  1024. data: this.$http.adornData(ids, false)
  1025. }).then(({data}) => {
  1026. if (data && data.code === 0) {
  1027. this.$message({
  1028. message: '操作成功',
  1029. type: 'success',
  1030. duration: 1500,
  1031. onClose: () => {
  1032. this.getDataList()
  1033. }
  1034. })
  1035. } else {
  1036. this.$message.error(data.msg)
  1037. }
  1038. })
  1039. })
  1040. },
  1041. // 导出
  1042. fields(){
  1043. let json = "{"
  1044. this.columnList.forEach((item,index) =>{
  1045. if (index == this.columnList.length-1 ){
  1046. json +="\""+item.columnLabel+"\"" +":"+"\""+item.columnProp+"\""
  1047. }else {
  1048. json += "\""+item.columnLabel+"\"" +":"+"\""+item.columnProp+"\""+ ","
  1049. }
  1050. })
  1051. json +="}"
  1052. let s = eval("(" + json + ")")
  1053. return s
  1054. },
  1055. createExportData() {
  1056. // 点击导出按钮之后,开始导出数据之前的执行函数,返回值为需要下载的数据
  1057. // TODO:构造需要下载的数据返回
  1058. if(this.dataListSelections.length>0){
  1059. return this.dataListSelections;
  1060. }
  1061. return this.dataList;
  1062. },
  1063. startDownload() {
  1064. // this.exportData = this.dataList
  1065. },
  1066. finishDownload() {
  1067. }
  1068. },
  1069. created() {
  1070. this.getTableUserColumn()
  1071. this.getSysLanguageParamList()
  1072. this.getFunctionButtonList()
  1073. this.favoriteIsOk()
  1074. }
  1075. }
  1076. </script>
  1077. <style scoped >
  1078. .wrapper {
  1079. height: calc(100% - 40px);
  1080. }
  1081. .sl-input {
  1082. background-color: transparent;
  1083. border: 0 !important;
  1084. font-size: 12px !important;
  1085. height: 12px !important;
  1086. line-height: 14px !important;
  1087. background-color: transparent !important;
  1088. width: 140px;
  1089. }
  1090. .sl-input:focus, textarea:focus {
  1091. outline: none;
  1092. }
  1093. .sl-svg{
  1094. overflow: hidden;
  1095. float: right;
  1096. }
  1097. </style>