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.

1147 lines
35 KiB

  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. :row-style="rowToolStyle"
  39. ref="mainTable"
  40. @row-click="changeData"
  41. highlight-current-row
  42. v-loading="dataListLoading"
  43. style="width: 100%;">
  44. <el-table-column
  45. header-align="center"
  46. align="center"
  47. width="150"
  48. fixed="right"
  49. label="操作">
  50. <template slot-scope="scope">
  51. <a type="text" size="small" @click="editToolInfoModal(scope.row)">编辑 </a>
  52. <a type="text" size="small" v-if = "scope.row.propertyNo && scope.row.propertyNo !== ''" @click="editToolInfoPropertyModal(scope.row)">属性 </a>
  53. <a type="text" size="small" @click="deleteToolInfoConfirm(scope.row)">删除 </a>
  54. </template>
  55. </el-table-column>
  56. <el-table-column
  57. v-for="(item,index) in columnList" :key="index"
  58. :sortable="item.columnSortable"
  59. :prop="item.columnProp"
  60. :header-align="item.headerAlign"
  61. :show-overflow-tooltip="item.showOverflowTooltip"
  62. :align="item.align"
  63. :fixed="item.fixed==''?false:item.fixed"
  64. :min-width="item.columnWidth"
  65. :label="item.columnLabel">
  66. <template slot-scope="scope">
  67. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  68. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  69. style="width: 100px; height: 80px"/></span>
  70. </template>
  71. </el-table-column>
  72. </el-table>
  73. <el-pagination
  74. @size-change="sizeChangeHandle"
  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. @row-click="changeInstanceData"
  91. highlight-current-row
  92. :row-style="rowToolInstanceStyle"
  93. v-loading="dataListLoading"
  94. style="width: 100%; ">
  95. <el-table-column
  96. v-for="(item,index) in columnDetailList" :key="index"
  97. :sortable="item.columnSortable"
  98. :prop="item.columnProp"
  99. :header-align="item.headerAlign"
  100. :show-overflow-tooltip="item.showOverflowTooltip"
  101. :align="item.align"
  102. :fixed="item.fixed==''?false:item.fixed"
  103. :min-width="item.columnWidth"
  104. :label="item.columnLabel">
  105. <template slot-scope="scope">
  106. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  107. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  108. style="width: 100px; height: 80px"/></span>
  109. </template>
  110. </el-table-column>
  111. <el-table-column
  112. header-align="center"
  113. align="center"
  114. width="180"
  115. fixed="right"
  116. label="操作">
  117. <template slot-scope="scope">
  118. <a type="text" size="small" @click="editToolInstanceModal(scope.row)">编辑 </a>
  119. <a type="text" size="small" v-if = "scope.row.propertyNo && scope.row.propertyNo !== ''" @click="editToolInstancePropertyModal(scope.row)">属性 </a>
  120. <a type="text" size="small" @click="editToolInstanceDateModal(scope.row)">生命周期 </a>
  121. <a type="text" size="small" @click="deleteToolInstanceConfirm(scope.row)">删除 </a>
  122. </template>
  123. </el-table-column>
  124. </el-table>
  125. </el-tab-pane>
  126. </el-tabs>
  127. <!-- 选择组件 -->
  128. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  129. <!-- 工具信息 -->
  130. <toolInfoAddUpdate ref="toolInfoAddUpdate" :close-on-click-modal="false" @refreshTooInfoData="refreshTooInfoData" @changeCurrentToolInfo="changeCurrentToolInfo">
  131. </toolInfoAddUpdate>
  132. <!-- 工具实例信息 -->
  133. <toolInstanceAddUpdate ref="toolInstanceAddUpdate" :close-on-click-modal="false" @refreshTooInstanceData="refreshTooInstanceData" @changeCurrentToolInstance="changeCurrentToolInstance">
  134. </toolInstanceAddUpdate>
  135. <!-- 工具实例生命周期信息 -->
  136. <toolInstanceDateShow ref="toolInstanceDateShow" :close-on-click-modal="false" @refreshTooInstanceData="refreshTooInstanceData">
  137. </toolInstanceDateShow>
  138. <!-- 工具属性信息 -->
  139. <toolPropertyShow ref="toolPropertyShow" :close-on-click-modal="false" >
  140. </toolPropertyShow>
  141. </div>
  142. </template>
  143. <script>
  144. import {
  145. getToolInfoList, // 工具信息查询
  146. getToolInstanceList, //工具实例信息查询
  147. removeToolInfo,/*删除工具信息*/
  148. removeToolInstance,/*删除工具实例信息*/
  149. } from '@/api/tool/tool_info.js'
  150. /*组件*/
  151. import Chooselist from '@/views/modules/common/Chooselist'; /*选择组件*/
  152. import toolInfoAddUpdate from "./components/com_tool_info_add_update"; /*工具新增和修改组件*/
  153. import toolInstanceAddUpdate from "./components/com_tool_instance_add_update"; /*工具实例新增和修改组件*/
  154. import toolInstanceDateShow from "./components/com_tool_instance_date_show"; /*工具实例新增日期和修改组件*/
  155. import toolPropertyShow from "./components/com_tool_property_show"; /*工具属性修改组件*/
  156. /*組件*/
  157. export default {
  158. components: {
  159. Chooselist,/*选择组件*/
  160. toolInfoAddUpdate,/*工具新增和修改组件*/
  161. toolInstanceAddUpdate,/*工具实例新增和修改组件*/
  162. toolInstanceDateShow,/*工具实例新增日期和修改组件*/
  163. toolPropertyShow,/*工具属性修改组件*/
  164. },
  165. data() {
  166. return {
  167. fileContentList: [],
  168. activeName: 'detail',
  169. searchData:{
  170. pageIndex: 1,
  171. pageSize: 100,
  172. site:this.$store.state.user.site,
  173. toolId:'',
  174. toolType:'',
  175. startDate:'',
  176. endDate:'',
  177. },
  178. currentRow:{},
  179. currentInstanceRow: {},
  180. height: 200,
  181. dataList:[],
  182. detailList:[],
  183. dataListLoading: false,
  184. // 导出 start
  185. exportData: [],
  186. exportName: "工具信息" + this.dayjs().format('YYYYMMDDHHmmss'),
  187. exportHeader: ["工具信息"],
  188. exportFooter: [],
  189. exportList:[],
  190. tagNo:'',
  191. pageIndex: 1,
  192. pageSize: 100,
  193. totalPage: 0,
  194. // 导出 end
  195. columnList: [
  196. {
  197. userId: this.$store.state.user.name,
  198. functionId: 106003,
  199. serialNumber: '106003Table1Site',
  200. tableId: "106003Table1",
  201. tableName: "刀具信息主表",
  202. columnProp: "site",
  203. headerAlign: "center",
  204. align: "left",
  205. columnLabel: "工厂编码",
  206. columnHidden: false,
  207. columnImage: false,
  208. columnSortable: false,
  209. sortLv: 0,
  210. status: true,
  211. fixed: '',
  212. columnWidth: 80
  213. },
  214. {
  215. userId: this.$store.state.user.name,
  216. functionId: 106003,
  217. serialNumber: '106003Table1ToolId',
  218. tableId: "106003Table1",
  219. tableName: "刀具信息主表",
  220. columnProp: "toolId",
  221. headerAlign: "center",
  222. align: "left",
  223. columnLabel: "工具编码",
  224. columnHidden: false,
  225. columnImage: false,
  226. columnSortable: false,
  227. sortLv: 0,
  228. status: true,
  229. fixed: '',
  230. columnWidth: 80
  231. },
  232. {
  233. userId: this.$store.state.user.name,
  234. functionId: 106003,
  235. serialNumber: '106003Table1ToolDesc',
  236. tableId: "106003Table1",
  237. tableName: "刀具信息主表",
  238. columnProp: "toolDesc",
  239. headerAlign: "center",
  240. align: "left",
  241. columnLabel: "工具描述",
  242. columnHidden: false,
  243. columnImage: false,
  244. columnSortable: false,
  245. sortLv: 0,
  246. status: true,
  247. fixed: '',
  248. columnWidth: 160
  249. },
  250. {
  251. userId: this.$store.state.user.name,
  252. functionId: 106003,
  253. serialNumber: '106003TableToolType',
  254. tableId: "106003Table1",
  255. tableName: "刀具信息主表",
  256. columnProp: "toolType",
  257. headerAlign: "center",
  258. align: "left",
  259. columnLabel: "工具类型",
  260. columnHidden: false,
  261. columnImage: false,
  262. columnSortable: false,
  263. sortLv: 0,
  264. status: true,
  265. fixed: '',
  266. columnWidth: 80
  267. },
  268. {
  269. userId: this.$store.state.user.name,
  270. functionId: 106003,
  271. serialNumber: '106003TableCalendarId',
  272. tableId: "106003Table1",
  273. tableName: "刀具信息主表",
  274. columnProp: "calendarId",
  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: 80
  285. },
  286. {
  287. userId: this.$store.state.user.name,
  288. functionId: 106003,
  289. serialNumber: '106003TablePropertyNo',
  290. tableId: "106003Table1",
  291. tableName: "刀具信息主表",
  292. columnProp: "propertyNo",
  293. headerAlign: "center",
  294. align: "left",
  295. columnLabel: "属性模版",
  296. columnHidden: false,
  297. columnImage: false,
  298. columnSortable: false,
  299. sortLv: 0,
  300. status: true,
  301. fixed: '',
  302. columnWidth: 80
  303. },
  304. {
  305. userId: this.$store.state.user.name,
  306. functionId: 106003,
  307. serialNumber: '106003TableSchedCapacity',
  308. tableId: "106003Table1",
  309. tableName: "刀具信息主表",
  310. columnProp: "schedCapacity",
  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: 106003,
  325. serialNumber: '106003TableCalibrationControl',
  326. tableId: "106003Table1",
  327. tableName: "刀具信息主表",
  328. columnProp: "calibrationControl",
  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: 80
  339. },
  340. {
  341. userId: this.$store.state.user.name,
  342. functionId: 106003,
  343. serialNumber: '106003TableCalibrationTime',
  344. tableId: "106003Table1",
  345. tableName: "刀具信息主表",
  346. columnProp: "calibrationTime",
  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: 106003,
  361. serialNumber: '106003TableLastUsed',
  362. tableId: "106003Table1",
  363. tableName: "刀具信息主表",
  364. columnProp: "lastUsed",
  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: 80
  375. },
  376. {
  377. userId: this.$store.state.user.name,
  378. functionId: 106003,
  379. serialNumber: '106003TableAlternateToolId',
  380. tableId: "106003Table1",
  381. tableName: "刀具信息主表",
  382. columnProp: "alternateToolId",
  383. headerAlign: "center",
  384. align: "left",
  385. columnLabel: "备选工具标识号",
  386. columnHidden: false,
  387. columnImage: false,
  388. columnSortable: false,
  389. sortLv: 0,
  390. status: true,
  391. fixed: '',
  392. columnWidth: 80
  393. },
  394. {
  395. userId: this.$store.state.user.name,
  396. functionId: 106003,
  397. serialNumber: '106003TableEnabledForControlPlanDb',
  398. tableId: "106003Table1",
  399. tableName: "刀具信息主表",
  400. columnProp: "enabledForControlPlanDb",
  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: 80
  411. },
  412. {
  413. userId: this.$store.state.user.name,
  414. functionId: 106003,
  415. serialNumber: '106003TableNoteText',
  416. tableId: "106003Table1",
  417. tableName: "刀具信息主表",
  418. columnProp: "noteText",
  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: 180
  429. },
  430. {
  431. userId: this.$store.state.user.name,
  432. functionId: 106003,
  433. serialNumber: '106003Table1CreatedBy',
  434. tableId: "106003Table1",
  435. tableName: "刀具信息主表",
  436. columnProp: "createdBy",
  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: 80
  447. },
  448. {
  449. userId: this.$store.state.user.name,
  450. functionId: 106003,
  451. serialNumber: '106003Table1CreateDate',
  452. tableId: "106003Table1",
  453. tableName: "刀具信息主表",
  454. columnProp: "createDate",
  455. headerAlign: "center",
  456. align: "left",
  457. columnLabel: "创建时间",
  458. columnHidden: false,
  459. columnImage: false,
  460. columnSortable: false,
  461. sortLv: 0,
  462. status: true,
  463. fixed: '',
  464. columnWidth: 90
  465. },
  466. {
  467. userId: this.$store.state.user.name,
  468. functionId: 106003,
  469. serialNumber: '106003Table1UpdatedBy',
  470. tableId: "106003Table1",
  471. tableName: "刀具信息主表",
  472. columnProp: "updatedBy",
  473. headerAlign: "center",
  474. align: "left",
  475. columnLabel: "修改人",
  476. columnHidden: false,
  477. columnImage: false,
  478. columnSortable: false,
  479. sortLv: 0,
  480. status: true,
  481. fixed: '',
  482. columnWidth: 80
  483. },
  484. {
  485. userId: this.$store.state.user.name,
  486. functionId: 106003,
  487. serialNumber: '106003Table1UpdatedDate',
  488. tableId: "106003Table1",
  489. tableName: "刀具信息主表",
  490. columnProp: "updatedDate",
  491. headerAlign: "center",
  492. align: "left",
  493. columnLabel: "修改时间",
  494. columnHidden: false,
  495. columnImage: false,
  496. columnSortable: false,
  497. sortLv: 0,
  498. status: true,
  499. fixed: '',
  500. columnWidth: 90
  501. },
  502. ],
  503. columnDetailList: [
  504. {
  505. userId: this.$store.state.user.name,
  506. functionId: 106003,
  507. serialNumber: '106003Table2ToolInstance',
  508. tableId: '106003Table2',
  509. tableName: '工具实例明细',
  510. columnProp: 'toolInstance',
  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: '',
  520. columnWidth: 40
  521. },
  522. {
  523. userId: this.$store.state.user.name,
  524. functionId: 106003,
  525. serialNumber: '106003Table2Description',
  526. tableId: '106003Table2',
  527. tableName: '工具实例明细',
  528. columnProp: 'description',
  529. headerAlign: 'center',
  530. align: 'center',
  531. columnLabel: '工具实例描述',
  532. columnHidden: false,
  533. columnImage: false,
  534. columnSortable: false,
  535. sortLv: 0,
  536. status: true,
  537. fixed: '',
  538. columnWidth: 70
  539. },
  540. {
  541. userId: this.$store.state.user.name,
  542. functionId: 106003,
  543. serialNumber: '106003Table2ToolNo',
  544. tableId: '106003Table2',
  545. tableName: '工具实例明细',
  546. columnProp: 'toolNo',
  547. headerAlign: 'center',
  548. align: 'center',
  549. columnLabel: '工具编码',
  550. columnHidden: false,
  551. columnImage: false,
  552. columnSortable: false,
  553. sortLv: 0,
  554. status: true,
  555. fixed: '',
  556. columnWidth: 70
  557. },
  558. {
  559. userId: this.$store.state.user.name,
  560. functionId: 106003,
  561. serialNumber: '106003Table2LastPropertyNo',
  562. tableId: '106003Table2',
  563. tableName: '工具实例明细',
  564. columnProp: 'propertyNo',
  565. headerAlign: 'center',
  566. align: 'center',
  567. columnLabel: '属性模版',
  568. columnHidden: false,
  569. columnImage: false,
  570. columnSortable: false,
  571. sortLv: 0,
  572. status: true,
  573. fixed: '',
  574. columnWidth: 120
  575. },
  576. {
  577. userId: this.$store.state.user.name,
  578. functionId: 106003,
  579. serialNumber: '106003Table2LastCalibrationDate',
  580. tableId: '106003Table2',
  581. tableName: '工具实例明细',
  582. columnProp: 'lastCalibrationDate',
  583. headerAlign: 'center',
  584. align: 'center',
  585. columnLabel: '最近校准日期',
  586. columnHidden: false,
  587. columnImage: false,
  588. columnSortable: false,
  589. sortLv: 0,
  590. status: true,
  591. fixed: '',
  592. columnWidth: 120
  593. },
  594. {
  595. userId: this.$store.state.user.name,
  596. functionId: 106003,
  597. serialNumber: '106003Table2ObjectId',
  598. tableId: '106003Table2',
  599. tableName: '工具实例明细',
  600. columnProp: 'objectId',
  601. headerAlign: 'center',
  602. align: 'center',
  603. columnLabel: '对象标识',
  604. columnHidden: false,
  605. columnImage: false,
  606. columnSortable: false,
  607. sortLv: 0,
  608. status: true,
  609. fixed: '',
  610. columnWidth: 120
  611. },
  612. {
  613. userId: this.$store.state.user.name,
  614. functionId: 106003,
  615. serialNumber: '106003Table2NormalWorkCenterNo',
  616. tableId: '106003Table2',
  617. tableName: '工具实例明细',
  618. columnProp: 'normalWorkCenterNo',
  619. headerAlign: 'center',
  620. align: 'center',
  621. columnLabel: '工作中心',
  622. columnHidden: false,
  623. columnImage: false,
  624. columnSortable: false,
  625. sortLv: 0,
  626. status: true,
  627. fixed: '',
  628. columnWidth: 60
  629. },
  630. {
  631. userId: this.$store.state.user.name,
  632. functionId: 106003,
  633. serialNumber: '106003Table2NormalWorkCenterDesc',
  634. tableId: '106003Table2',
  635. tableName: '工具实例明细',
  636. columnProp: 'normalWorkCenterDesc',
  637. headerAlign: 'center',
  638. align: 'center',
  639. columnLabel: '工作重心描述',
  640. columnHidden: false,
  641. columnImage: false,
  642. columnSortable: false,
  643. sortLv: 0,
  644. status: true,
  645. fixed: '',
  646. columnWidth: 60
  647. },
  648. {
  649. userId: this.$store.state.user.name,
  650. functionId: 106003,
  651. serialNumber: '106003Table2NormalProductionLine',
  652. tableId: '106003Table2',
  653. tableName: '工具实例明细',
  654. columnProp: 'normalProductionLine',
  655. headerAlign: 'center',
  656. align: 'center',
  657. columnLabel: '生产线',
  658. columnHidden: false,
  659. columnImage: false,
  660. columnSortable: false,
  661. sortLv: 0,
  662. status: true,
  663. fixed: '',
  664. columnWidth: 50
  665. },
  666. {
  667. userId: this.$store.state.user.name,
  668. functionId: 106003,
  669. serialNumber: '106003Table2NormalProductionLineDesc',
  670. tableId: '106003Table2',
  671. tableName: '工具实例明细',
  672. columnProp: 'normalProductionLineDesc',
  673. headerAlign: 'center',
  674. align: 'center',
  675. columnLabel: '生产线描述',
  676. columnHidden: false,
  677. columnImage: false,
  678. columnSortable: false,
  679. sortLv: 0,
  680. status: true,
  681. fixed: '',
  682. columnWidth: 60
  683. },
  684. {
  685. userId: this.$store.state.user.name,
  686. functionId: 106003,
  687. serialNumber: '106003Table2NoteText',
  688. tableId: '106003Table2',
  689. tableName: '工具实例明细',
  690. columnProp: 'noteText',
  691. headerAlign: 'center',
  692. align: 'center',
  693. columnLabel: '备注',
  694. columnHidden: false,
  695. columnImage: false,
  696. columnSortable: false,
  697. sortLv: 0,
  698. status: true,
  699. fixed: '',
  700. columnWidth: 200
  701. },
  702. {
  703. userId: this.$store.state.user.name,
  704. functionId: 106003,
  705. serialNumber: '106003Table2CreatedBy',
  706. tableId: "106003Table2",
  707. tableName: "工具实例明细",
  708. columnProp: "createdBy",
  709. headerAlign: "center",
  710. align: "left",
  711. columnLabel: "创建人",
  712. columnHidden: false,
  713. columnImage: false,
  714. columnSortable: false,
  715. sortLv: 0,
  716. status: true,
  717. fixed: '',
  718. columnWidth: 80
  719. },
  720. {
  721. userId: this.$store.state.user.name,
  722. functionId: 106003,
  723. serialNumber: '106003Table2CreatedDate',
  724. tableId: "106003Table2",
  725. tableName: "工具实例明细",
  726. columnProp: "createdDate",
  727. headerAlign: "center",
  728. align: "left",
  729. columnLabel: "创建时间",
  730. columnHidden: false,
  731. columnImage: false,
  732. columnSortable: false,
  733. sortLv: 0,
  734. status: true,
  735. fixed: '',
  736. columnWidth: 90
  737. },
  738. {
  739. userId: this.$store.state.user.name,
  740. functionId: 106003,
  741. serialNumber: '106003Table2UpdatedBy',
  742. tableId: "106003Table2",
  743. tableName: "工具实例明细",
  744. columnProp: "updatedBy",
  745. headerAlign: "center",
  746. align: "left",
  747. columnLabel: "修改人",
  748. columnHidden: false,
  749. columnImage: false,
  750. columnSortable: false,
  751. sortLv: 0,
  752. status: true,
  753. fixed: '',
  754. columnWidth: 80
  755. },
  756. {
  757. userId: this.$store.state.user.name,
  758. functionId: 106003,
  759. serialNumber: '106003Table2UpdatedDate',
  760. tableId: "106003Table2",
  761. tableName: "刀具信息主表",
  762. columnProp: "updatedDate",
  763. headerAlign: "center",
  764. align: "left",
  765. columnLabel: "修改时间",
  766. columnHidden: false,
  767. columnImage: false,
  768. columnSortable: false,
  769. sortLv: 0,
  770. status: true,
  771. fixed: '',
  772. columnWidth: 90
  773. },
  774. ],
  775. }
  776. },
  777. watch: {
  778. // columnList: {
  779. // deep: true,
  780. // handler: function (newV, oldV) {
  781. // debugger
  782. //
  783. // }
  784. // }
  785. },
  786. mounted() {
  787. this.$nextTick(() => {
  788. this.height = window.innerHeight - 520;
  789. })
  790. },
  791. methods: {
  792. // 获取基础数据列表S
  793. getBaseList (val, type) {
  794. this.tagNo = val
  795. this.$nextTick(() => {
  796. let strVal = ''
  797. this.$refs.baseList.init(val, strVal)
  798. })
  799. },
  800. /* 列表方法的回调 */
  801. getBaseData (val) {
  802. if (this.tagNo === 1016) {
  803. this.searchData.toolType = val.tool_type;
  804. }
  805. },
  806. //导出excel
  807. async createExportData() {
  808. this.searchData.limit = -1
  809. this.searchData.page = 1
  810. await getToolInfoList(this.searchData).then(({data}) => {
  811. this.exportList= data.page.list;
  812. })
  813. return this.exportList;
  814. },
  815. startDownload() {
  816. // this.exportData = this.dataList
  817. },
  818. finishDownload() {
  819. },
  820. fields() {
  821. let json = "{"
  822. this.columnList.forEach((item, index) => {
  823. if (index == this.columnList.length - 1) {
  824. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  825. } else {
  826. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  827. }
  828. })
  829. json += "}"
  830. let s = eval("(" + json + ")")
  831. return s
  832. },
  833. /*刷新工具信息*/
  834. refreshTooInfoData() {
  835. this.searchData.pageSize = this.pageSize
  836. this.searchData.pageIndex = this.pageIndex
  837. getToolInfoList(this.searchData).then(({data}) => {
  838. if (data.code == 200) {
  839. this.dataList = data.rows;
  840. this.totalPage = data.total;
  841. }
  842. this.dataListLoading = false
  843. })
  844. },
  845. /*新增工具的modal*/
  846. addToolInfoModal(){
  847. //打开modal的页面
  848. this.$nextTick(() => {
  849. this.$refs.toolInfoAddUpdate.init(null, true)
  850. });
  851. },
  852. /*编辑工具信息*/
  853. editToolInfoModal(toolInfo){
  854. //打开modal的页面
  855. this.$nextTick(() => {
  856. this.$refs.toolInfoAddUpdate.init(toolInfo, false)
  857. });
  858. },
  859. /*工具属性的维护*/
  860. editToolInfoPropertyModal(toolInfo){
  861. //打开modal的页面
  862. this.$nextTick(() => {
  863. this.$refs.toolPropertyShow.init(toolInfo, 'TL');
  864. });
  865. },
  866. /*工具实例属性的维护*/
  867. editToolInstancePropertyModal(toolInfo){
  868. //打开modal的页面
  869. this.$nextTick(() => {
  870. this.$refs.toolPropertyShow.init(toolInfo, 'TLI');
  871. });
  872. },
  873. /*删除工具的确认选项*/
  874. deleteToolInfoConfirm(toolInfo) {
  875. this.$confirm('是否删除工具标识号:'+ toolInfo.toolId+'?', '提示', {
  876. confirmButtonText: '确定',
  877. cancelButtonText: '取消',
  878. type: 'warning'
  879. }).then(() => {
  880. removeToolInfo(toolInfo).then(({data}) => {
  881. if (data.code === 200) {
  882. this.$message.success('操作成功!');
  883. this.refreshTooInfoData();
  884. } else {
  885. this.$message.error(data.msg);
  886. }
  887. })
  888. })
  889. },
  890. /*新增工具实例的modal*/
  891. addToolInstanceModal(){
  892. //判断是否选择好数据
  893. if(this.currentRow && Object.keys(this.currentRow).length > 0){
  894. //打开modal的页面
  895. this.$nextTick(() => {
  896. this.$refs.toolInstanceAddUpdate.init(this.currentRow, true)
  897. });
  898. }else{
  899. this.$message.error('请先选择工具信息再添加工具实例!');
  900. }
  901. },
  902. /*修改工具实例的modal*/
  903. editToolInstanceModal(row){
  904. this.currentInstanceRow = row;
  905. //判断是否选择好数据
  906. if(Object.keys(this.currentInstanceRow).length > 0){
  907. //打开modal的页面
  908. this.$nextTick(() => {
  909. this.$refs.toolInstanceAddUpdate.init(this.currentInstanceRow, false)
  910. });
  911. }else{
  912. this.$message.error('请先选择工具实例再添加工具实例!');
  913. }
  914. },
  915. /*刷新工具信息*/
  916. refreshTooInstanceData() {
  917. getToolInstanceList(this.currentRow).then(({data}) => {
  918. if (data.code == 200) {
  919. this.detailList = data.rows;
  920. }
  921. this.dataListLoading = false
  922. })
  923. },
  924. /*删除工具实例确认*/
  925. deleteToolInstanceConfirm(toolInfo){
  926. this.$confirm('是否删除工具实例:'+ toolInfo.toolInstance+'?', '提示', {
  927. confirmButtonText: '确定',
  928. cancelButtonText: '取消',
  929. type: 'warning'
  930. }).then(() => {
  931. removeToolInstance(toolInfo).then(({data}) => {
  932. if (data.code === 200) {
  933. this.$message.success('操作成功!');
  934. this.refreshTooInstanceData();
  935. } else {
  936. this.$message.error(data.msg);
  937. }
  938. })
  939. })
  940. },
  941. /*工具实例的生命周期*/
  942. editToolInstanceDateModal(toolInfo){
  943. this.currentInstanceRow = toolInfo;
  944. //添加工具分类和分类的描述信息
  945. this.currentInstanceRow.toolType = this.currentRow.toolType;
  946. this.currentInstanceRow.toolDesc = this.currentRow.toolDesc;
  947. //判断是否选择好数据
  948. if(Object.keys(this.currentInstanceRow).length > 0){
  949. //打开modal的页面
  950. this.$nextTick(() => {
  951. this.$refs.toolInstanceDateShow.init(this.currentInstanceRow)
  952. });
  953. }else{
  954. this.$message.error('请先选择工具实例再添加工具实例!');
  955. }
  956. },
  957. //切换工具触发
  958. changeData(row) {
  959. this.currentRow = JSON.parse(JSON.stringify(row));
  960. this.refreshCurrentTabTable ();
  961. },
  962. /*切换工具实例*/
  963. changeInstanceData(row){
  964. this.currentInstanceRow = JSON.parse(JSON.stringify(row));
  965. },
  966. // 获取数据列表
  967. search () {
  968. this.searchData.pageSize = this.pageSize
  969. this.searchData.pageIndex = this.pageIndex
  970. getToolInfoList(this.searchData).then(({data}) => {
  971. if (data.code == 200) {
  972. this.dataList = data.rows;
  973. this.totalPage = data.total;
  974. if(this.dataList.length > 0){
  975. this.$refs.mainTable.setCurrentRow(this.dataList[0]);
  976. //如果已经存在则 不修改默认数值 不然修改默认选择行为第一行
  977. if(this.currentRow && Object.keys(this.currentRow).length > 0){
  978. //已经存在 不需要修改
  979. }else{
  980. this.currentRow = JSON.parse(JSON.stringify(this.dataList[0]));
  981. }
  982. }else {
  983. this.currentRow ={}
  984. }
  985. this.refreshCurrentTabTable ()
  986. }
  987. this.dataListLoading = false
  988. })
  989. },
  990. tabClick (tab, event) {
  991. // 刷新列表数据
  992. this.refreshCurrentTabTable()
  993. },
  994. // 刷新页签的table数据
  995. refreshCurrentTabTable () {
  996. if (this.activeName == 'detail') {
  997. this.refreshToolInstanceData();
  998. }
  999. },
  1000. /*刷新工具实例的信息*/
  1001. refreshToolInstanceData(){
  1002. getToolInstanceList(this.currentRow).then(({data}) => {
  1003. if (data.code == 200) {
  1004. this.detailList = data.rows;
  1005. }
  1006. this.dataListLoading = false
  1007. })
  1008. },
  1009. // 下载
  1010. downloadFile(row){
  1011. downLoadProjectFile(row)
  1012. .then(({data}) => {
  1013. // 不限制文件下载类型
  1014. const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'})
  1015. // 下载文件名称
  1016. const fileName = row.fileName
  1017. // a标签下载
  1018. const linkNode = document.createElement('a')
  1019. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  1020. linkNode.style.display = 'none'
  1021. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  1022. console.log(linkNode)
  1023. // if(val == 'Y'){
  1024. // this.pdfVisible = true
  1025. // this.pdfUrl = linkNode.href
  1026. // }else {
  1027. document.body.appendChild(linkNode)
  1028. linkNode.click() // 模拟在按钮上的一次鼠标单击
  1029. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  1030. document.body.removeChild(linkNode)
  1031. // }
  1032. })
  1033. // }else {
  1034. // this.$alert('没有权限下载这个项目的文件!', '错误', {
  1035. // confirmButtonText: '确定'
  1036. // })
  1037. // }
  1038. // })
  1039. },
  1040. // 每页数
  1041. sizeChangeHandle (val) {
  1042. this.pageSize = val
  1043. this.pageIndex = 1
  1044. this.search()
  1045. },
  1046. /*调整等待派工单的等待时间*/
  1047. changeCurrentToolInfo(tempData) {
  1048. //重置选择行
  1049. this.currentRow = JSON.parse(JSON.stringify(tempData));
  1050. },
  1051. /*调整等待派工单的等待时间*/
  1052. changeCurrentToolInstance(tempData) {
  1053. //重置选择行
  1054. this.currentInstanceRow = JSON.parse(JSON.stringify(tempData));
  1055. },
  1056. /*选中行的样式*/
  1057. rowToolStyle ({row}) {
  1058. if (this.currentRow.site === row.site && this.currentRow.toolId === row.toolId) {
  1059. return { 'background-color': '#D9EDF7', cursor: 'pointer' };
  1060. }
  1061. },
  1062. /*选中行的样式*/
  1063. rowToolInstanceStyle ({row}) {
  1064. if (this.currentInstanceRow.site === row.site && this.currentInstanceRow.toolInstance === row.toolInstance) {
  1065. return { 'background-color': '#D9EDF7', cursor: 'pointer' };
  1066. }
  1067. },
  1068. },
  1069. activated() {
  1070. },
  1071. }
  1072. </script>
  1073. <style >
  1074. /deep/ .customer-tab .el-tabs__content {
  1075. padding: 0px !important;
  1076. }
  1077. .el-transfer-panel {
  1078. border: 2px solid #17b3a3;
  1079. border-radius: 4px;
  1080. overflow: hidden;
  1081. background: #fff;
  1082. display: inline-block;
  1083. vertical-align: middle;
  1084. width: 200px;
  1085. max-height: 100%;
  1086. -webkit-box-sizing: border-box;
  1087. box-sizing: border-box;
  1088. position: relative;
  1089. }
  1090. .el-transfer-panel .el-transfer-panel__header {
  1091. height: 40px;
  1092. line-height: 40px;
  1093. background: #17b3a3;
  1094. margin: 0;
  1095. padding-left: 15px;
  1096. border-bottom: 1px solid #17b3a3;
  1097. -webkit-box-sizing: border-box;
  1098. box-sizing: border-box;
  1099. color: #000;
  1100. }
  1101. .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label {
  1102. font-size: 14px;
  1103. color: #303133;
  1104. font-weight: 400;
  1105. }
  1106. </style>