plm前端
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.

971 lines
30 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="mod-config customer-tab">
  3. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  4. <el-form-item label="工厂">
  5. <el-input v-model="searchData.site" style="width: 160px"></el-input>
  6. </el-form-item>
  7. <el-form-item label="工具编码">
  8. <el-input v-model="searchData.toolId" style="width: 160px"></el-input>
  9. </el-form-item>
  10. <el-form-item label="工具类型">
  11. <span slot="label" style="" @click="getBaseList(1016)"><a herf="#">工具类型</a></span>
  12. <el-input v-model="searchData.toolType" style="width: 160px"></el-input>
  13. </el-form-item>
  14. <el-form-item label=" ">
  15. <el-button @click="search()" type="primary" style="margin-left: 2px;margin-top:0px">查询</el-button>
  16. <el-button type="primary" @click="addToolInfoModal()">新增</el-button>
  17. <!-- <el-button @click="addOrUpdateHandle('save')" type="primary" style="margin-left: 2px;margin-top: 0px">新增</el-button>-->
  18. <download-excel
  19. :fields="fields()"
  20. :data="exportData"
  21. type="xls"
  22. :name="exportName"
  23. :header="exportHeader"
  24. :footer="exportFooter"
  25. :fetch="createExportData"
  26. :before-generate="startDownload"
  27. :before-finish="finishDownload"
  28. worksheet="导出信息"
  29. class="el-button el-button--primary el-button--medium">
  30. {{ '导出' }}
  31. </download-excel>
  32. </el-form-item>
  33. </el-form>
  34. <el-table
  35. :height="height"
  36. :data="dataList"
  37. border
  38. ref="mainTable"
  39. @row-click="changeData"
  40. highlight-current-row
  41. v-loading="dataListLoading"
  42. style="width: 100%;">
  43. <el-table-column
  44. header-align="center"
  45. align="center"
  46. width="150"
  47. fixed="right"
  48. label="操作">
  49. <template slot-scope="scope">
  50. <a type="text" size="small" @click="editToolInfoModal(scope.row)">编辑 </a>
  51. <a type="text" size="small" v-if = "scope.row.propertyNo && scope.row.propertyNo !== ''" @click="editToolInfoPropertyModal(scope.row)">属性 </a>
  52. <a type="text" size="small" @click="deleteToolInfoConfirm(scope.row)">删除 </a>
  53. </template>
  54. </el-table-column>
  55. <el-table-column
  56. v-for="(item,index) in columnList" :key="index"
  57. :sortable="item.columnSortable"
  58. :prop="item.columnProp"
  59. :header-align="item.headerAlign"
  60. :show-overflow-tooltip="item.showOverflowTooltip"
  61. :align="item.align"
  62. :fixed="item.fixed==''?false:item.fixed"
  63. :min-width="item.columnWidth"
  64. :label="item.columnLabel">
  65. <template slot-scope="scope">
  66. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  67. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  68. style="width: 100px; height: 80px"/></span>
  69. </template>
  70. </el-table-column>
  71. </el-table>
  72. <el-pagination
  73. @size-change="sizeChangeHandle"
  74. @row-click="changeInstanceData"
  75. :current-page="pageIndex"
  76. :page-sizes="[20, 50, 100, 1000]"
  77. :page-size="pageSize"
  78. :total="totalPage"
  79. layout="total, sizes, prev, pager, next, jumper">
  80. </el-pagination>
  81. <el-tabs style="font-size: 12px;min-height: 330px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick">
  82. <el-tab-pane label="工具实例" name="detail" style="margin-left: -10px;">
  83. <el-form label-position="top" style="margin-top: -15px; margin-left: 2px;">
  84. <el-button type="primary" @click="addToolInstanceModal()">新增</el-button>
  85. </el-form>
  86. <el-table
  87. :data="detailList"
  88. height="240"
  89. border
  90. v-loading="dataListLoading"
  91. style="width: 100%; ">
  92. <el-table-column
  93. v-for="(item,index) in columnDetailList" :key="index"
  94. :sortable="item.columnSortable"
  95. :prop="item.columnProp"
  96. :header-align="item.headerAlign"
  97. :show-overflow-tooltip="item.showOverflowTooltip"
  98. :align="item.align"
  99. :fixed="item.fixed==''?false:item.fixed"
  100. :min-width="item.columnWidth"
  101. :label="item.columnLabel">
  102. <template slot-scope="scope">
  103. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  104. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  105. style="width: 100px; height: 80px"/></span>
  106. </template>
  107. </el-table-column>
  108. <el-table-column
  109. header-align="center"
  110. align="center"
  111. width="150"
  112. fixed="right"
  113. label="操作">
  114. <template slot-scope="scope">
  115. <a type="text" size="small" @click="editToolInstanceModal(scope.row)">编辑</a>
  116. <a type="text" size="small" @click="editToolInstanceDateModal(scope.row, 'toolInstance')">属性</a>
  117. <a type="text" size="small" @click="editToolInstanceDateModal(scope.row)">生命周期</a>
  118. <a type="text" size="small" @click="deleteToolInstanceConfirm(scope.row)">删除</a>
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. </el-tab-pane>
  123. </el-tabs>
  124. <!-- 选择组件 -->
  125. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  126. <!-- 工具信息 -->
  127. <toolInfoAddUpdate ref="toolInfoAddUpdate" :close-on-click-modal="false" @refreshTooInfoData="refreshTooInfoData">
  128. </toolInfoAddUpdate>
  129. <!-- 工具实例信息 -->
  130. <toolInstanceAddUpdate ref="toolInstanceAddUpdate" :close-on-click-modal="false" @refreshTooInstanceData="refreshTooInstanceData">
  131. </toolInstanceAddUpdate>
  132. <!-- 工具实例生命周期信息 -->
  133. <toolInstanceDateShow ref="toolInstanceDateShow" :close-on-click-modal="false" @refreshTooInstanceData="refreshTooInstanceData">
  134. </toolInstanceDateShow>
  135. <!-- 工具属性信息 -->
  136. <toolPropertyShow ref="toolPropertyShow" :close-on-click-modal="false" >
  137. </toolPropertyShow>
  138. </div>
  139. </template>
  140. <script>
  141. import {
  142. getToolInfoList, // 工具信息查询
  143. getToolInstanceList, //工具实例信息查询
  144. removeToolInfo,/*删除工具信息*/
  145. removeToolInstance,/*删除工具实例信息*/
  146. } from '@/api/tool/tool_info.js'
  147. /*组件*/
  148. import Chooselist from '@/views/modules/common/Chooselist'; /*选择组件*/
  149. import toolInfoAddUpdate from "./components/com_tool_info_add_update"; /*工具新增和修改组件*/
  150. import toolInstanceAddUpdate from "./components/com_tool_instance_add_update"; /*工具实例新增和修改组件*/
  151. import toolInstanceDateShow from "./components/com_tool_instance_date_show"; /*工具实例新增日期和修改组件*/
  152. import toolPropertyShow from "./components/com_tool_property_show"; /*工具属性修改组件*/
  153. /*組件*/
  154. export default {
  155. components: {
  156. Chooselist,/*选择组件*/
  157. toolInfoAddUpdate,/*工具新增和修改组件*/
  158. toolInstanceAddUpdate,/*工具实例新增和修改组件*/
  159. toolInstanceDateShow,/*工具实例新增日期和修改组件*/
  160. toolPropertyShow,/*工具属性修改组件*/
  161. },
  162. name: "null",
  163. data() {
  164. return {
  165. fileContentList: [],
  166. activeName: 'detail',
  167. searchData:{
  168. pageIndex: 1,
  169. pageSize: 100,
  170. site:this.$store.state.user.site,
  171. toolId:'',
  172. toolType:'',
  173. startDate:'',
  174. endDate:'',
  175. },
  176. currentRow:{},
  177. currentInstanceRow: {},
  178. height: 200,
  179. dataList:[],
  180. detailList:[],
  181. dataListLoading: false,
  182. // 导出 start
  183. exportData: [],
  184. exportName: "工具信息" + this.dayjs().format('YYYYMMDDHHmmss'),
  185. exportHeader: ["工具信息"],
  186. exportFooter: [],
  187. exportList:[],
  188. tagNo:'',
  189. pageIndex: 1,
  190. pageSize: 100,
  191. totalPage: 0,
  192. // 导出 end
  193. columnList: [
  194. {
  195. userId: this.$store.state.user.name,
  196. functionId: 106003,
  197. serialNumber: '106003Table1Site',
  198. tableId: "106003Table1",
  199. tableName: "刀具信息主表",
  200. columnProp: "site",
  201. headerAlign: "center",
  202. align: "left",
  203. columnLabel: "工厂编码",
  204. columnHidden: false,
  205. columnImage: false,
  206. columnSortable: false,
  207. sortLv: 0,
  208. status: true,
  209. fixed: '',
  210. columnWidth: 80
  211. },
  212. {
  213. userId: this.$store.state.user.name,
  214. functionId: 106003,
  215. serialNumber: '106003Table1ToolId',
  216. tableId: "106003Table1",
  217. tableName: "刀具信息主表",
  218. columnProp: "toolId",
  219. headerAlign: "center",
  220. align: "left",
  221. columnLabel: "工具编码",
  222. columnHidden: false,
  223. columnImage: false,
  224. columnSortable: false,
  225. sortLv: 0,
  226. status: true,
  227. fixed: '',
  228. columnWidth: 80
  229. },
  230. {
  231. userId: this.$store.state.user.name,
  232. functionId: 106003,
  233. serialNumber: '106003Table1ToolDesc',
  234. tableId: "106003Table1",
  235. tableName: "刀具信息主表",
  236. columnProp: "toolDesc",
  237. headerAlign: "center",
  238. align: "left",
  239. columnLabel: "工具描述",
  240. columnHidden: false,
  241. columnImage: false,
  242. columnSortable: false,
  243. sortLv: 0,
  244. status: true,
  245. fixed: '',
  246. columnWidth: 160
  247. },
  248. {
  249. userId: this.$store.state.user.name,
  250. functionId: 106003,
  251. serialNumber: '106003TableToolType',
  252. tableId: "106003Table1",
  253. tableName: "刀具信息主表",
  254. columnProp: "toolType",
  255. headerAlign: "center",
  256. align: "left",
  257. columnLabel: "工具类型",
  258. columnHidden: false,
  259. columnImage: false,
  260. columnSortable: false,
  261. sortLv: 0,
  262. status: true,
  263. fixed: '',
  264. columnWidth: 80
  265. },
  266. {
  267. userId: this.$store.state.user.name,
  268. functionId: 106003,
  269. serialNumber: '106003TableCalendarId',
  270. tableId: "106003Table1",
  271. tableName: "刀具信息主表",
  272. columnProp: "calendarId",
  273. headerAlign: "center",
  274. align: "left",
  275. columnLabel: "日历标识",
  276. columnHidden: false,
  277. columnImage: false,
  278. columnSortable: false,
  279. sortLv: 0,
  280. status: true,
  281. fixed: '',
  282. columnWidth: 80
  283. },
  284. {
  285. userId: this.$store.state.user.name,
  286. functionId: 106003,
  287. serialNumber: '106003TablePropertyNo',
  288. tableId: "106003Table1",
  289. tableName: "刀具信息主表",
  290. columnProp: "propertyNo",
  291. headerAlign: "center",
  292. align: "left",
  293. columnLabel: "属性模版",
  294. columnHidden: false,
  295. columnImage: false,
  296. columnSortable: false,
  297. sortLv: 0,
  298. status: true,
  299. fixed: '',
  300. columnWidth: 80
  301. },
  302. {
  303. userId: this.$store.state.user.name,
  304. functionId: 106003,
  305. serialNumber: '106003TableSchedCapacity',
  306. tableId: "106003Table1",
  307. tableName: "刀具信息主表",
  308. columnProp: "schedCapacity",
  309. headerAlign: "center",
  310. align: "left",
  311. columnLabel: "计划能力",
  312. columnHidden: false,
  313. columnImage: false,
  314. columnSortable: false,
  315. sortLv: 0,
  316. status: true,
  317. fixed: '',
  318. columnWidth: 80
  319. },
  320. {
  321. userId: this.$store.state.user.name,
  322. functionId: 106003,
  323. serialNumber: '106003TableCalibrationControl',
  324. tableId: "106003Table1",
  325. tableName: "刀具信息主表",
  326. columnProp: "calibrationControl",
  327. headerAlign: "center",
  328. align: "left",
  329. columnLabel: "校对控制",
  330. columnHidden: false,
  331. columnImage: false,
  332. columnSortable: false,
  333. sortLv: 0,
  334. status: true,
  335. fixed: '',
  336. columnWidth: 80
  337. },
  338. {
  339. userId: this.$store.state.user.name,
  340. functionId: 106003,
  341. serialNumber: '106003TableCalibrationTime',
  342. tableId: "106003Table1",
  343. tableName: "刀具信息主表",
  344. columnProp: "calibrationTime",
  345. headerAlign: "center",
  346. align: "left",
  347. columnLabel: "校对间隔时间",
  348. columnHidden: false,
  349. columnImage: false,
  350. columnSortable: false,
  351. sortLv: 0,
  352. status: true,
  353. fixed: '',
  354. columnWidth: 80
  355. },
  356. {
  357. userId: this.$store.state.user.name,
  358. functionId: 106003,
  359. serialNumber: '106003TableLastUsed',
  360. tableId: "106003Table1",
  361. tableName: "刀具信息主表",
  362. columnProp: "lastUsed",
  363. headerAlign: "center",
  364. align: "left",
  365. columnLabel: "上次使用",
  366. columnHidden: false,
  367. columnImage: false,
  368. columnSortable: false,
  369. sortLv: 0,
  370. status: true,
  371. fixed: '',
  372. columnWidth: 80
  373. },
  374. {
  375. userId: this.$store.state.user.name,
  376. functionId: 106003,
  377. serialNumber: '106003TableAlternateToolId',
  378. tableId: "106003Table1",
  379. tableName: "刀具信息主表",
  380. columnProp: "alternateToolId",
  381. headerAlign: "center",
  382. align: "left",
  383. columnLabel: "备选工具标识号",
  384. columnHidden: false,
  385. columnImage: false,
  386. columnSortable: false,
  387. sortLv: 0,
  388. status: true,
  389. fixed: '',
  390. columnWidth: 80
  391. },
  392. {
  393. userId: this.$store.state.user.name,
  394. functionId: 106003,
  395. serialNumber: '106003TableEnabledForControlPlanDb',
  396. tableId: "106003Table1",
  397. tableName: "刀具信息主表",
  398. columnProp: "enabledForControlPlanDb",
  399. headerAlign: "center",
  400. align: "left",
  401. columnLabel: "为控制计划启用",
  402. columnHidden: false,
  403. columnImage: false,
  404. columnSortable: false,
  405. sortLv: 0,
  406. status: true,
  407. fixed: '',
  408. columnWidth: 80
  409. },
  410. {
  411. userId: this.$store.state.user.name,
  412. functionId: 106003,
  413. serialNumber: '106003TableNoteText',
  414. tableId: "106003Table1",
  415. tableName: "刀具信息主表",
  416. columnProp: "noteText",
  417. headerAlign: "center",
  418. align: "left",
  419. columnLabel: "备注",
  420. columnHidden: false,
  421. columnImage: false,
  422. columnSortable: false,
  423. sortLv: 0,
  424. status: true,
  425. fixed: '',
  426. columnWidth: 180
  427. },
  428. ],
  429. columnDetailList: [
  430. {
  431. userId: this.$store.state.user.name,
  432. functionId: 106003,
  433. serialNumber: '106003Table2ToolInstance',
  434. tableId: '106003Table2',
  435. tableName: '工具实例明细',
  436. columnProp: 'toolInstance',
  437. headerAlign: 'center',
  438. align: 'center',
  439. columnLabel: '工具实例',
  440. columnHidden: false,
  441. columnImage: false,
  442. columnSortable: false,
  443. sortLv: 0,
  444. status: true,
  445. fixed: '',
  446. columnWidth: 40
  447. },
  448. {
  449. userId: this.$store.state.user.name,
  450. functionId: 106003,
  451. serialNumber: '106003Table2Description',
  452. tableId: '106003Table2',
  453. tableName: '工具实例明细',
  454. columnProp: 'description',
  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: 70
  465. },
  466. {
  467. userId: this.$store.state.user.name,
  468. functionId: 106003,
  469. serialNumber: '106003Table2ToolNo',
  470. tableId: '106003Table2',
  471. tableName: '工具实例明细',
  472. columnProp: 'toolNo',
  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: 70
  483. },
  484. {
  485. userId: this.$store.state.user.name,
  486. functionId: 106003,
  487. serialNumber: '106003Table2LastPropertyNo',
  488. tableId: '106003Table2',
  489. tableName: '工具实例明细',
  490. columnProp: 'propertyNo',
  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: 120
  501. },
  502. {
  503. userId: this.$store.state.user.name,
  504. functionId: 106003,
  505. serialNumber: '106003Table2LastCalibrationDate',
  506. tableId: '106003Table2',
  507. tableName: '工具实例明细',
  508. columnProp: 'lastCalibrationDate',
  509. headerAlign: 'center',
  510. align: 'center',
  511. columnLabel: '最近校准日期',
  512. columnHidden: false,
  513. columnImage: false,
  514. columnSortable: false,
  515. sortLv: 0,
  516. status: true,
  517. fixed: '',
  518. columnWidth: 120
  519. },
  520. {
  521. userId: this.$store.state.user.name,
  522. functionId: 106003,
  523. serialNumber: '106003Table2ObjectId',
  524. tableId: '106003Table2',
  525. tableName: '工具实例明细',
  526. columnProp: 'objectId',
  527. headerAlign: 'center',
  528. align: 'center',
  529. columnLabel: '对象标识',
  530. columnHidden: false,
  531. columnImage: false,
  532. columnSortable: false,
  533. sortLv: 0,
  534. status: true,
  535. fixed: '',
  536. columnWidth: 120
  537. },
  538. {
  539. userId: this.$store.state.user.name,
  540. functionId: 106003,
  541. serialNumber: '106003Table2NormalWorkCenterNo',
  542. tableId: '106003Table2',
  543. tableName: '工具实例明细',
  544. columnProp: 'normalWorkCenterNo',
  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: '',
  554. columnWidth: 60
  555. },
  556. {
  557. userId: this.$store.state.user.name,
  558. functionId: 106003,
  559. serialNumber: '106003Table2NormalWorkCenterDesc',
  560. tableId: '106003Table2',
  561. tableName: '工具实例明细',
  562. columnProp: 'normalWorkCenterDesc',
  563. headerAlign: 'center',
  564. align: 'center',
  565. columnLabel: '工作重心描述',
  566. columnHidden: false,
  567. columnImage: false,
  568. columnSortable: false,
  569. sortLv: 0,
  570. status: true,
  571. fixed: '',
  572. columnWidth: 60
  573. },
  574. {
  575. userId: this.$store.state.user.name,
  576. functionId: 106003,
  577. serialNumber: '106003Table2NormalProductionLine',
  578. tableId: '106003Table2',
  579. tableName: '工具实例明细',
  580. columnProp: 'normalProductionLine',
  581. headerAlign: 'center',
  582. align: 'center',
  583. columnLabel: '生产线',
  584. columnHidden: false,
  585. columnImage: false,
  586. columnSortable: false,
  587. sortLv: 0,
  588. status: true,
  589. fixed: '',
  590. columnWidth: 50
  591. },
  592. {
  593. userId: this.$store.state.user.name,
  594. functionId: 106003,
  595. serialNumber: '106003Table2NormalProductionLineDesc',
  596. tableId: '106003Table2',
  597. tableName: '工具实例明细',
  598. columnProp: 'normalProductionLineDesc',
  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: 60
  609. },
  610. {
  611. userId: this.$store.state.user.name,
  612. functionId: 106003,
  613. serialNumber: '106003Table2NoteText',
  614. tableId: '106003Table2',
  615. tableName: '工具实例明细',
  616. columnProp: 'noteText',
  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: 200
  627. },
  628. ],
  629. }
  630. },
  631. watch: {
  632. // columnList: {
  633. // deep: true,
  634. // handler: function (newV, oldV) {
  635. // debugger
  636. //
  637. // }
  638. // }
  639. },
  640. mounted() {
  641. this.$nextTick(() => {
  642. this.height = window.innerHeight - 520;
  643. })
  644. },
  645. methods: {
  646. // 获取基础数据列表S
  647. getBaseList (val, type) {
  648. this.tagNo = val
  649. this.$nextTick(() => {
  650. let strVal = ''
  651. this.$refs.baseList.init(val, strVal)
  652. })
  653. },
  654. /* 列表方法的回调 */
  655. getBaseData (val) {
  656. if (this.tagNo === 1016) {
  657. this.searchData.toolType = val.tool_type;
  658. }
  659. },
  660. //导出excel
  661. async createExportData() {
  662. this.searchData.limit = -1
  663. this.searchData.page = 1
  664. await getToolInfoList(this.searchData).then(({data}) => {
  665. this.exportList= data.page.list;
  666. })
  667. return this.exportList;
  668. },
  669. startDownload() {
  670. // this.exportData = this.dataList
  671. },
  672. finishDownload() {
  673. },
  674. fields() {
  675. let json = "{"
  676. this.columnList.forEach((item, index) => {
  677. if (index == this.columnList.length - 1) {
  678. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  679. } else {
  680. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  681. }
  682. })
  683. json += "}"
  684. let s = eval("(" + json + ")")
  685. return s
  686. },
  687. /*刷新工具信息*/
  688. refreshTooInfoData() {
  689. this.searchData.pageSize = this.pageSize
  690. this.searchData.pageIndex = this.pageIndex
  691. getToolInfoList(this.searchData).then(({data}) => {
  692. if (data.code == 200) {
  693. this.dataList = data.rows;
  694. this.totalPage = data.total;
  695. }
  696. this.dataListLoading = false
  697. })
  698. },
  699. /*新增工具的modal*/
  700. addToolInfoModal(){
  701. //打开modal的页面
  702. this.$nextTick(() => {
  703. this.$refs.toolInfoAddUpdate.init(null, true)
  704. });
  705. },
  706. /*编辑工具信息*/
  707. editToolInfoModal(toolInfo){
  708. //打开modal的页面
  709. this.$nextTick(() => {
  710. this.$refs.toolInfoAddUpdate.init(toolInfo, false)
  711. });
  712. },
  713. /*工具属性的维护*/
  714. editToolInfoPropertyModal(toolInfo){
  715. //打开modal的页面
  716. this.$nextTick(() => {
  717. this.$refs.toolPropertyShow.init(toolInfo, 'TL');
  718. });
  719. },
  720. /*工具实例属性的维护*/
  721. editToolInstancePropertyModal(toolInfo){
  722. //打开modal的页面
  723. this.$nextTick(() => {
  724. this.$refs.toolPropertyShow.init(toolInfo, 'TLI');
  725. });
  726. },
  727. /*删除工具的确认选项*/
  728. deleteToolInfoConfirm(toolInfo) {
  729. this.$confirm('是否删除工具标识号:'+ toolInfo.toolId+'?', '提示', {
  730. confirmButtonText: '确定',
  731. cancelButtonText: '取消',
  732. type: 'warning'
  733. }).then(() => {
  734. removeToolInfo(toolInfo).then(({data}) => {
  735. if (data.code === 200) {
  736. this.$message.success('操作成功!');
  737. this.refreshTooInfoData();
  738. } else {
  739. this.$message.error(data.msg);
  740. }
  741. })
  742. })
  743. },
  744. /*新增工具实例的modal*/
  745. addToolInstanceModal(){
  746. //判断是否选择好数据
  747. if(this.currentRow && Object.keys(this.currentRow).length > 0){
  748. //打开modal的页面
  749. this.$nextTick(() => {
  750. this.$refs.toolInstanceAddUpdate.init(this.currentRow, true)
  751. });
  752. }else{
  753. this.$message.error('请先选择工具信息再添加工具实例!');
  754. }
  755. },
  756. /*修改工具实例的modal*/
  757. editToolInstanceModal(row){
  758. this.currentInstanceRow = row;
  759. //判断是否选择好数据
  760. if(Object.keys(this.currentInstanceRow).length > 0){
  761. //打开modal的页面
  762. this.$nextTick(() => {
  763. this.$refs.toolInstanceAddUpdate.init(this.currentInstanceRow, false)
  764. });
  765. }else{
  766. this.$message.error('请先选择工具实例再添加工具实例!');
  767. }
  768. },
  769. /*刷新工具信息*/
  770. refreshTooInstanceData() {
  771. getToolInstanceList(this.currentRow).then(({data}) => {
  772. if (data.code == 200) {
  773. this.detailList = data.rows;
  774. }
  775. this.dataListLoading = false
  776. })
  777. },
  778. /*删除工具实例确认*/
  779. deleteToolInstanceConfirm(toolInfo){
  780. this.$confirm('是否删除工具实例:'+ toolInfo.toolInstance+'?', '提示', {
  781. confirmButtonText: '确定',
  782. cancelButtonText: '取消',
  783. type: 'warning'
  784. }).then(() => {
  785. removeToolInstance(toolInfo).then(({data}) => {
  786. if (data.code === 200) {
  787. this.$message.success('操作成功!');
  788. this.refreshTooInstanceData();
  789. } else {
  790. this.$message.error(data.msg);
  791. }
  792. })
  793. })
  794. },
  795. /*工具实例的生命周期*/
  796. editToolInstanceDateModal(toolInfo){
  797. this.currentInstanceRow = toolInfo;
  798. //添加工具分类和分类的描述信息
  799. this.currentInstanceRow.toolType = this.currentRow.toolType;
  800. this.currentInstanceRow.toolDesc = this.currentRow.toolDesc;
  801. //判断是否选择好数据
  802. if(Object.keys(this.currentInstanceRow).length > 0){
  803. //打开modal的页面
  804. this.$nextTick(() => {
  805. this.$refs.toolInstanceDateShow.init(this.currentInstanceRow)
  806. });
  807. }else{
  808. this.$message.error('请先选择工具实例再添加工具实例!');
  809. }
  810. },
  811. //切换工具触发
  812. changeData(row) {
  813. this.currentRow = JSON.parse(JSON.stringify(row));
  814. this.refreshCurrentTabTable ();
  815. },
  816. /*切换工具实例*/
  817. changeInstanceData(row){
  818. this.currentRow = JSON.parse(JSON.stringify(row));
  819. },
  820. // 获取数据列表
  821. search () {
  822. this.searchData.pageSize = this.pageSize
  823. this.searchData.pageIndex = this.pageIndex
  824. getToolInfoList(this.searchData).then(({data}) => {
  825. if (data.code == 200) {
  826. this.dataList = data.rows;
  827. this.totalPage = data.total;
  828. if(this.dataList.length > 0){
  829. this.$refs.mainTable.setCurrentRow(this.dataList[0]);
  830. this.currentRow = JSON.parse(JSON.stringify(this.dataList[0]));
  831. }else {
  832. this.currentRow ={}
  833. }
  834. this.refreshCurrentTabTable ()
  835. }
  836. this.dataListLoading = false
  837. })
  838. },
  839. tabClick (tab, event) {
  840. // 刷新列表数据
  841. this.refreshCurrentTabTable()
  842. },
  843. // 刷新页签的table数据
  844. refreshCurrentTabTable () {
  845. if (this.activeName == 'detail') {
  846. this.refreshToolInstanceData();
  847. }
  848. },
  849. /*刷新工具实例的信息*/
  850. refreshToolInstanceData(){
  851. getToolInstanceList(this.currentRow).then(({data}) => {
  852. if (data.code == 200) {
  853. this.detailList = data.rows;
  854. }
  855. this.dataListLoading = false
  856. })
  857. },
  858. // 下载
  859. downloadFile(row){
  860. downLoadProjectFile(row)
  861. .then(({data}) => {
  862. // 不限制文件下载类型
  863. const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'})
  864. // 下载文件名称
  865. const fileName = row.fileName
  866. // a标签下载
  867. const linkNode = document.createElement('a')
  868. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  869. linkNode.style.display = 'none'
  870. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  871. console.log(linkNode)
  872. // if(val == 'Y'){
  873. // this.pdfVisible = true
  874. // this.pdfUrl = linkNode.href
  875. // }else {
  876. document.body.appendChild(linkNode)
  877. linkNode.click() // 模拟在按钮上的一次鼠标单击
  878. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  879. document.body.removeChild(linkNode)
  880. // }
  881. })
  882. // }else {
  883. // this.$alert('没有权限下载这个项目的文件!', '错误', {
  884. // confirmButtonText: '确定'
  885. // })
  886. // }
  887. // })
  888. },
  889. // 每页数
  890. sizeChangeHandle (val) {
  891. this.pageSize = val
  892. this.pageIndex = 1
  893. this.search()
  894. },
  895. },
  896. activated() {
  897. },
  898. }
  899. </script>
  900. <style >
  901. /deep/ .customer-tab .el-tabs__content {
  902. padding: 0px !important;
  903. }
  904. .el-transfer-panel {
  905. border: 2px solid #17b3a3;
  906. border-radius: 4px;
  907. overflow: hidden;
  908. background: #fff;
  909. display: inline-block;
  910. vertical-align: middle;
  911. width: 200px;
  912. max-height: 100%;
  913. -webkit-box-sizing: border-box;
  914. box-sizing: border-box;
  915. position: relative;
  916. }
  917. .el-transfer-panel .el-transfer-panel__header {
  918. height: 40px;
  919. line-height: 40px;
  920. background: #17b3a3;
  921. margin: 0;
  922. padding-left: 15px;
  923. border-bottom: 1px solid #17b3a3;
  924. -webkit-box-sizing: border-box;
  925. box-sizing: border-box;
  926. color: #000;
  927. }
  928. .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label {
  929. font-size: 14px;
  930. color: #303133;
  931. font-weight: 400;
  932. }
  933. </style>