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.

1195 lines
37 KiB

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