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.

1352 lines
41 KiB

  1. <template>
  2. <div class="mod-config">
  3. <!-- 查询条件 -->
  4. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  5. <el-form-item :label="'物料编码'">
  6. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'物料名称'">
  9. <el-input v-model="searchData.partDesc" clearable style="width: 200px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'工艺类型'">
  12. <el-select v-model="searchData.routingType" clearable style="width: 120px">
  13. <el-option label="Manufacturing" value="Manufacturing"></el-option>
  14. <el-option label="Repair" value="Repair"></el-option>
  15. <el-option label="Prototype" value="Prototype"></el-option>
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item :label="'Routing版本号'">
  19. <el-input-number :controls="false" :step="0" v-model="searchData.routingRevision" style="width: 100px"></el-input-number>
  20. </el-form-item>
  21. <el-form-item :label="'替代编码'">
  22. <el-input v-model="searchData.alternativeNo" style="width: 100px"></el-input>
  23. </el-form-item>
  24. <el-form-item :label="'替代名称'">
  25. <el-input v-model="searchData.alternativeDescription" style="width: 150px"></el-input>
  26. </el-form-item>
  27. <el-form-item :label="'工序编码'">
  28. <el-input v-model="searchData.operationNo" style="width: 100px"></el-input>
  29. </el-form-item>
  30. <el-form-item :label="'工序名称'">
  31. <el-input v-model="searchData.operationName" style="width: 150px"></el-input>
  32. </el-form-item>
  33. <el-form-item :label="' '">
  34. <el-button :loading="queryLoading" @click="getDataList()">查询</el-button>
  35. <download-excel
  36. :fields="fields()"
  37. :data="exportData"
  38. type="xls"
  39. :name="exportName"
  40. :header="exportHeader"
  41. :footer="exportFooter"
  42. :fetch="createExportData"
  43. :before-generate="startDownload"
  44. :before-finish="finishDownload"
  45. worksheet="导出信息"
  46. class="el-button el-button--primary el-button--medium">
  47. {{ "导出" }}
  48. </download-excel>
  49. </el-form-item>
  50. </el-form>
  51. <!-- bom列表 -->
  52. <el-table
  53. :height="height"
  54. :data="dataList"
  55. border
  56. ref="routingAlternativeTable"
  57. @row-click="alternativeClickRow"
  58. @current-change="changeCurrentRow"
  59. style="width: 100%">
  60. <el-table-column
  61. v-for="(item,index) in columnList" :key="index"
  62. :sortable="item.columnSortable"
  63. :prop="item.columnProp"
  64. :header-align="item.headerAlign"
  65. :show-overflow-tooltip="item.showOverflowTooltip"
  66. :align="item.align"
  67. :fixed="item.fixed === ''?false:item.fixed"
  68. :min-width="item.columnWidth"
  69. :label="item.columnLabel">
  70. <template slot-scope="scope">
  71. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  72. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  73. </template>
  74. </el-table-column>
  75. </el-table>
  76. <!-- 分页插件 -->
  77. <el-pagination style="margin-top: 0px"
  78. @size-change="sizeChangeHandle"
  79. @current-change="currentChangeHandle"
  80. :current-page="pageIndex"
  81. :page-sizes="[20, 50, 100, 200, 500]"
  82. :page-size="pageSize"
  83. :total="totalPage"
  84. layout="total, sizes, prev, pager, next, jumper">
  85. </el-pagination>
  86. <!-- 页签 -->
  87. <el-tabs v-model="activeTable" style="width: 100%" :style="{height: secondHeight + 'px'}" type="border-card" @tab-click="tabClick" class="customer-tab">
  88. <!-- Graphical Structure页签 -->
  89. <el-tab-pane label="Work Guidelines" name="WorkGuidelines">
  90. <el-form label-position="top" style="margin-top: 0px">
  91. <!-- <el-form-item>-->
  92. <el-button type="primary" @click="saveWorkGuidelineModal()" style="margin-left: 2px">新增</el-button>
  93. <el-button type="primary" @click="deleteModal()">删除</el-button>
  94. <!-- </el-form-item>-->
  95. </el-form>
  96. <el-table
  97. :height="secondHeight-68"
  98. :data="workGuidelineList"
  99. border
  100. @selection-change="selectionWorkGuideline"
  101. style="width: 100%">
  102. <el-table-column
  103. type="selection"
  104. header-align="center"
  105. align="center"
  106. :selectable="selectFlag"
  107. width="50">
  108. </el-table-column>
  109. <el-table-column
  110. v-for="(item,index) in workGuidelineColumnList" :key="index"
  111. :sortable="item.columnSortable"
  112. :prop="item.columnProp"
  113. :header-align="item.headerAlign"
  114. :show-overflow-tooltip="item.showOverflowTooltip"
  115. :align="item.align"
  116. :fixed="item.fixed==''?false:item.fixed"
  117. :min-width="item.columnWidth"
  118. :label="item.columnLabel">
  119. <template slot-scope="scope">
  120. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  121. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column
  125. fixed="right"
  126. header-align="center"
  127. align="center"
  128. width="100"
  129. label="操作">
  130. <template slot-scope="scope">
  131. <a type="text" size="small" @click="updateWorkGuidelineModal(scope.row)">编辑</a>
  132. </template>
  133. </el-table-column>
  134. </el-table>
  135. </el-tab-pane>
  136. </el-tabs>
  137. <!-- workGuideline 新增模态框 -->
  138. <el-dialog title="替代" :close-on-click-modal="false" v-drag :visible.sync="workGuidelineModal" width="664px">
  139. <el-form :inline="true" label-position="top" :model="workGuidelineData" :rules="guidelineRules" style="margin-left: 5px">
  140. <el-form-item :label="'序号'" prop="guidelineSeq" :rules="guidelineRules.guidelineSeq">
  141. <el-input-number :controls="false" :step="0" v-model="workGuidelineData.guidelineSeq" style="width: 60px"></el-input-number>
  142. </el-form-item>
  143. <el-form-item :label="'工艺指导名称'" prop="guidelineDesc" :rules="guidelineRules.guidelineDesc">
  144. <el-input v-model="workGuidelineData.guidelineDesc" style="width: 126px"></el-input>
  145. </el-form-item>
  146. <el-form-item :label="'工艺指导描述'">
  147. <el-input v-model="workGuidelineData.guidelineText" style="width: 413px"></el-input>
  148. </el-form-item>
  149. </el-form>
  150. <el-form :inline="true" label-position="top" :model="workGuidelineData" :rules="guidelineRules" style="margin-left: 5px">
  151. <el-form-item :label="'工艺指导类型'" prop="guidelineType" :rules="guidelineRules.guidelineType">
  152. <el-select v-model="workGuidelineData.guidelineType" style="width: 200px">
  153. <el-option label="Subtask" value="Subtask"></el-option>
  154. <el-option label="Instruction" value="Instruction"></el-option>
  155. </el-select>
  156. </el-form-item>
  157. <el-form-item :label="'签字'" prop="signOffRequired" :rules="guidelineRules.signOffRequired">
  158. <el-select v-model="workGuidelineData.signOffRequired" style="width: 200px">
  159. <el-option label="Required to Close Operation" value="Required to Close Operation"></el-option>
  160. <el-option label="Not Required" value="Not Required"></el-option>
  161. </el-select>
  162. </el-form-item>
  163. <el-form-item :label="'检验签字'" prop="inspectionSignOffRequired" :rules="guidelineRules.inspectionSignOffRequired">
  164. <el-select v-model="workGuidelineData.inspectionSignOffRequired" style="width: 200px">
  165. <el-option label="Required to Shop Order" value="Required to Shop Order"></el-option>
  166. <el-option label="Required to Close Operation" value="Required to Close Operation"></el-option>
  167. <el-option label="Not Required" value="Not Required"></el-option>
  168. </el-select>
  169. </el-form-item>
  170. </el-form>
  171. <el-footer style="height:35px;margin-top:25px;text-align:center">
  172. <el-button type="primary" @click="workGuidelineCommit()">保存</el-button>
  173. <el-button type="primary" @click="workGuidelineModal = false">关闭</el-button>
  174. </el-footer>
  175. </el-dialog>
  176. <!-- chooseList模态框 -->
  177. <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
  178. </div>
  179. </template>
  180. <script>
  181. import {
  182. routingSearchAlternative, // routing 替代列表查询
  183. getRoutingWorkGuideline, // 获取 workGuideline
  184. getGuidelineSeq, // 获取 guidelineSeq
  185. workGuidelineSave, // 新增 workGuideline
  186. workGuidelineEdit, // 编辑 workGuideline
  187. deleteWorkGuideline, // 删除 workGuideline
  188. } from '@/api/part/routingOperationWorkGuidelines.js'
  189. import ChooseList from '@/views/modules/common/Chooselist'
  190. export default {
  191. // 组件
  192. components: {
  193. ChooseList
  194. },
  195. // 监听
  196. watch: {
  197. searchData: {
  198. deep: true,
  199. handler: function (newV, oldV) {
  200. this.searchData.partNo = this.searchData.partNo.toUpperCase()
  201. }
  202. }
  203. },
  204. // 对象
  205. data () {
  206. return {
  207. // 导出
  208. exportData: [],
  209. exportName: 'bom查询' + this.dayjs().format('YYYYMMDDHHmmss'),
  210. exportHeader: ['bom查询'],
  211. exportFooter: [],
  212. resultList: [],
  213. // ======== 行高 ========
  214. height: 200,
  215. secondHeight: 200,
  216. leftWidth: 300,
  217. rightWidth: '',
  218. // ======== 分页 ========
  219. pageIndex: 1,
  220. pageSize: 50,
  221. totalPage: 0,
  222. // 条件查询
  223. searchData: {
  224. site: this.$store.state.user.site,
  225. partNo: '',
  226. partDesc: '',
  227. routingType: '',
  228. routingRevision: '',
  229. alternativeNo: '',
  230. alternativeDescription: '',
  231. operationNo: '',
  232. operationName: '',
  233. page: 1,
  234. limit: 10
  235. },
  236. // loading
  237. queryLoading: false,
  238. // 初始页签
  239. activeTable: 'WorkGuidelines',
  240. // ======== 数据对象 ========
  241. alternativeData: {
  242. site: '',
  243. partNo: '',
  244. partDesc: '',
  245. bomType: '',
  246. engChgLevel: '',
  247. alternativeNo: '',
  248. alternativeDescription: '',
  249. minLotQty: '',
  250. noteText: '',
  251. status: '',
  252. },
  253. workGuidelineData: {
  254. flag: '',
  255. id: '',
  256. site: this.$store.state.user.site,
  257. partNo: '',
  258. partDesc: '',
  259. routingRevision: '',
  260. routingType: '',
  261. alternativeNo: '',
  262. alternativeDescription: '',
  263. operationNo: '',
  264. operationName: '',
  265. guidelineSeq: '',
  266. guidelineDesc: '',
  267. guidelineText: '',
  268. guidelineType: '',
  269. signOffRequired: '',
  270. inspectionSignOffRequired: '',
  271. createBy: '',
  272. updateBy: ''
  273. },
  274. // ======== 选中的当前行数据 ========
  275. alternativeCurrentRow: {},
  276. // ======== 数据列表 ========
  277. dataList: [],
  278. workGuidelineList: [],
  279. // ======== 列表表头 ========
  280. columnList: [
  281. {
  282. userId: this.$store.state.user.name,
  283. functionId: 104010,
  284. serialNumber: '104010Table1PartNo',
  285. tableId: '104010Table1',
  286. tableName: 'Routing表',
  287. columnProp: 'partNo',
  288. headerAlign: 'center',
  289. align: 'center',
  290. columnLabel: '物料编码',
  291. columnHidden: false,
  292. columnImage: false,
  293. columnSortable: false,
  294. sortLv: 0,
  295. status: true,
  296. fixed: '',
  297. columnWidth: 120
  298. },
  299. {
  300. userId: this.$store.state.user.name,
  301. functionId: 104010,
  302. serialNumber: '104010Table1PartDesc',
  303. tableId: '104010Table1',
  304. tableName: 'Routing表',
  305. columnProp: 'partDesc',
  306. headerAlign: 'center',
  307. align: 'left',
  308. columnLabel: '物料名称',
  309. columnHidden: false,
  310. columnImage: false,
  311. columnSortable: false,
  312. sortLv: 0,
  313. status: true,
  314. fixed: '',
  315. columnWidth: 200
  316. },
  317. {
  318. userId: this.$store.state.user.name,
  319. functionId: 104010,
  320. serialNumber: '104010Table1RoutingType',
  321. tableId: '104010Table1',
  322. tableName: 'Routing表',
  323. columnProp: 'routingType',
  324. headerAlign: 'center',
  325. align: 'center',
  326. columnLabel: '工艺类型',
  327. columnHidden: false,
  328. columnImage: false,
  329. columnSortable: false,
  330. sortLv: 0,
  331. status: true,
  332. fixed: '',
  333. columnWidth: 120
  334. },
  335. {
  336. userId: this.$store.state.user.name,
  337. functionId: 104010,
  338. serialNumber: '104010Table1RoutingRevision',
  339. tableId: '104010Table1',
  340. tableName: 'Routing表',
  341. columnProp: 'routingRevision',
  342. headerAlign: 'center',
  343. align: 'center',
  344. columnLabel: 'Routing版本号',
  345. columnHidden: false,
  346. columnImage: false,
  347. columnSortable: false,
  348. sortLv: 0,
  349. status: true,
  350. fixed: '',
  351. columnWidth: 80
  352. },
  353. {
  354. userId: this.$store.state.user.name,
  355. functionId: 104010,
  356. serialNumber: '104010Table1AlternativeNo',
  357. tableId: '104010Table1',
  358. tableName: 'Routing表',
  359. columnProp: 'alternativeNo',
  360. headerAlign: 'center',
  361. align: 'center',
  362. columnLabel: '替代编码',
  363. columnHidden: false,
  364. columnImage: false,
  365. columnSortable: false,
  366. sortLv: 0,
  367. status: true,
  368. fixed: '',
  369. columnWidth: 120
  370. },
  371. {
  372. userId: this.$store.state.user.name,
  373. functionId: 104010,
  374. serialNumber: '104010Table1AlternativeDescription',
  375. tableId: '104010Table1',
  376. tableName: 'Routing表',
  377. columnProp: 'alternativeDescription',
  378. headerAlign: 'center',
  379. align: 'left',
  380. columnLabel: '替代名称',
  381. columnHidden: false,
  382. columnImage: false,
  383. columnSortable: false,
  384. sortLv: 0,
  385. status: true,
  386. fixed: '',
  387. columnWidth: 200
  388. },
  389. {
  390. userId: this.$store.state.user.name,
  391. functionId: 104010,
  392. serialNumber: '104010Table1OperationNo',
  393. tableId: '104010Table1',
  394. tableName: 'Routing表',
  395. columnProp: 'operationNo',
  396. headerAlign: 'center',
  397. align: 'center',
  398. columnLabel: '工序编码',
  399. columnHidden: false,
  400. columnImage: false,
  401. columnSortable: false,
  402. sortLv: 0,
  403. status: true,
  404. fixed: '',
  405. columnWidth: 80
  406. },
  407. {
  408. userId: this.$store.state.user.name,
  409. functionId: 104010,
  410. serialNumber: '104010Table1OperationName',
  411. tableId: '104010Table1',
  412. tableName: 'Routing表',
  413. columnProp: 'operationName',
  414. headerAlign: 'center',
  415. align: 'left',
  416. columnLabel: '工序名称',
  417. columnHidden: false,
  418. columnImage: false,
  419. columnSortable: false,
  420. sortLv: 0,
  421. status: true,
  422. fixed: '',
  423. columnWidth: 120
  424. },
  425. {
  426. userId: this.$store.state.user.name,
  427. functionId: 104010,
  428. serialNumber: '104010Table1MachineNo',
  429. tableId: '104010Table1',
  430. tableName: 'Routing表',
  431. columnProp: 'machineNo',
  432. headerAlign: 'center',
  433. align: 'center',
  434. columnLabel: '机台',
  435. columnHidden: false,
  436. columnImage: false,
  437. columnSortable: false,
  438. sortLv: 0,
  439. status: true,
  440. fixed: '',
  441. columnWidth: 100
  442. },
  443. {
  444. userId: this.$store.state.user.name,
  445. functionId: 104010,
  446. serialNumber: '104010Table1WorkCenterNo',
  447. tableId: '104010Table1',
  448. tableName: 'Routing表',
  449. columnProp: 'workCenterNo',
  450. headerAlign: 'center',
  451. align: 'center',
  452. columnLabel: '加工中心',
  453. columnHidden: false,
  454. columnImage: false,
  455. columnSortable: false,
  456. sortLv: 0,
  457. status: true,
  458. fixed: '',
  459. columnWidth: 100
  460. },
  461. {
  462. userId: this.$store.state.user.name,
  463. functionId: 104010,
  464. serialNumber: '104010Table1MachRunFactor',
  465. tableId: '104010Table1',
  466. tableName: 'Routing表',
  467. columnProp: 'machRunFactor',
  468. headerAlign: 'center',
  469. align: 'right',
  470. columnLabel: '机器运行速度',
  471. columnHidden: false,
  472. columnImage: false,
  473. columnSortable: false,
  474. sortLv: 0,
  475. status: true,
  476. fixed: '',
  477. columnWidth: 80
  478. },
  479. {
  480. userId: this.$store.state.user.name,
  481. functionId: 104010,
  482. serialNumber: '104010Table1LaborSetupTime',
  483. tableId: '104010Table1',
  484. tableName: 'Routing表',
  485. columnProp: 'laborSetupTime',
  486. headerAlign: 'center',
  487. align: 'right',
  488. columnLabel: '人工生产速度',
  489. columnHidden: false,
  490. columnImage: false,
  491. columnSortable: false,
  492. sortLv: 0,
  493. status: true,
  494. fixed: '',
  495. columnWidth: 80
  496. },
  497. {
  498. userId: this.$store.state.user.name,
  499. functionId: 104010,
  500. serialNumber: '104010Table1MachSetupTime',
  501. tableId: '104010Table1',
  502. tableName: 'Routing表',
  503. columnProp: 'machSetupTime',
  504. headerAlign: 'center',
  505. align: 'right',
  506. columnLabel: '调机时长',
  507. columnHidden: false,
  508. columnImage: false,
  509. columnSortable: false,
  510. sortLv: 0,
  511. status: true,
  512. fixed: '',
  513. columnWidth: 80
  514. },
  515. {
  516. userId: this.$store.state.user.name,
  517. functionId: 104010,
  518. serialNumber: '104010Table1RunTimeCode',
  519. tableId: '104010Table1',
  520. tableName: 'Routing表',
  521. columnProp: 'runTimeCode',
  522. headerAlign: 'center',
  523. align: 'center',
  524. columnLabel: '时长单位',
  525. columnHidden: false,
  526. columnImage: false,
  527. columnSortable: false,
  528. sortLv: 0,
  529. status: true,
  530. fixed: '',
  531. columnWidth: 100
  532. },
  533. {
  534. userId: this.$store.state.user.name,
  535. functionId: 104010,
  536. serialNumber: '104010Table1SetupCrewSize',
  537. tableId: '104010Table1',
  538. tableName: 'Routing表',
  539. columnProp: 'setupCrewSize',
  540. headerAlign: 'center',
  541. align: 'right',
  542. columnLabel: '调机过程中人数',
  543. columnHidden: false,
  544. columnImage: false,
  545. columnSortable: false,
  546. sortLv: 0,
  547. status: true,
  548. fixed: '',
  549. columnWidth: 80
  550. },
  551. {
  552. userId: this.$store.state.user.name,
  553. functionId: 104010,
  554. serialNumber: '104010Table1CrewSize',
  555. tableId: '104010Table1',
  556. tableName: 'Routing表',
  557. columnProp: 'crewSize',
  558. headerAlign: 'center',
  559. align: 'right',
  560. columnLabel: '生产过程中人数',
  561. columnHidden: false,
  562. columnImage: false,
  563. columnSortable: false,
  564. sortLv: 0,
  565. status: true,
  566. fixed: '',
  567. columnWidth: 80
  568. },
  569. {
  570. userId: this.$store.state.user.name,
  571. functionId: 104010,
  572. serialNumber: '104010Table1EfficiencyFactor',
  573. tableId: '104010Table1',
  574. tableName: 'Routing表',
  575. columnProp: 'efficiencyFactor',
  576. headerAlign: 'center',
  577. align: 'right',
  578. columnLabel: '机器效率',
  579. columnHidden: false,
  580. columnImage: false,
  581. columnSortable: false,
  582. sortLv: 0,
  583. status: true,
  584. fixed: '',
  585. columnWidth: 80
  586. },
  587. {
  588. userId: this.$store.state.user.name,
  589. functionId: 104010,
  590. serialNumber: '104010Table1LaborRunFactor',
  591. tableId: '104010Table1',
  592. tableName: 'Routing表',
  593. columnProp: 'laborRunFactor',
  594. headerAlign: 'center',
  595. align: 'right',
  596. columnLabel: '人工效率',
  597. columnHidden: false,
  598. columnImage: false,
  599. columnSortable: false,
  600. sortLv: 0,
  601. status: true,
  602. fixed: '',
  603. columnWidth: 80
  604. },
  605. {
  606. userId: this.$store.state.user.name,
  607. functionId: 104010,
  608. serialNumber: '104010Table1LaborClassNo',
  609. tableId: '104010Table1',
  610. tableName: 'Routing表',
  611. columnProp: 'laborClassNo',
  612. headerAlign: 'center',
  613. align: 'center',
  614. columnLabel: '人员等级',
  615. columnHidden: false,
  616. columnImage: false,
  617. columnSortable: false,
  618. sortLv: 0,
  619. status: true,
  620. fixed: '',
  621. columnWidth: 100
  622. },
  623. {
  624. userId: this.$store.state.user.name,
  625. functionId: 104010,
  626. serialNumber: '104010Table1SetupLaborClassNo',
  627. tableId: '104010Table1',
  628. tableName: 'Routing表',
  629. columnProp: 'setupLaborClassNo',
  630. headerAlign: 'center',
  631. align: 'center',
  632. columnLabel: '调机时的人员等级',
  633. columnHidden: false,
  634. columnImage: false,
  635. columnSortable: false,
  636. sortLv: 0,
  637. status: true,
  638. fixed: '',
  639. columnWidth: 100
  640. },
  641. {
  642. userId: this.$store.state.user.name,
  643. functionId: 104010,
  644. serialNumber: '104010Table1OutsideOpItem',
  645. tableId: '104010Table1',
  646. tableName: 'Routing表',
  647. columnProp: 'outsideOpItem',
  648. headerAlign: 'center',
  649. align: 'center',
  650. columnLabel: '外协时的采购料号',
  651. columnHidden: false,
  652. columnImage: false,
  653. columnSortable: false,
  654. sortLv: 0,
  655. status: true,
  656. fixed: '',
  657. columnWidth: 120
  658. },
  659. {
  660. userId: this.$store.state.user.name,
  661. functionId: 104010,
  662. serialNumber: '104010Table1CreateDate',
  663. tableId: '104010Table1',
  664. tableName: 'Routing表',
  665. columnProp: 'createDate',
  666. headerAlign: 'center',
  667. align: 'center',
  668. columnLabel: '创建时间',
  669. columnHidden: false,
  670. columnImage: false,
  671. columnSortable: false,
  672. sortLv: 0,
  673. status: true,
  674. fixed: '',
  675. columnWidth: 130
  676. },
  677. {
  678. userId: this.$store.state.user.name,
  679. functionId: 104010,
  680. serialNumber: '104010Table1CreateBy',
  681. tableId: '104010Table1',
  682. tableName: 'Routing表',
  683. columnProp: 'createBy',
  684. headerAlign: 'center',
  685. align: 'center',
  686. columnLabel: '创建人',
  687. columnHidden: false,
  688. columnImage: false,
  689. columnSortable: false,
  690. sortLv: 0,
  691. status: true,
  692. fixed: '',
  693. columnWidth: 80
  694. },
  695. {
  696. userId: this.$store.state.user.name,
  697. functionId: 104010,
  698. serialNumber: '104010Table1UpdateDate',
  699. tableId: '104010Table1',
  700. tableName: 'Routing表',
  701. columnProp: 'updateDate',
  702. headerAlign: 'center',
  703. align: 'center',
  704. columnLabel: '更新时间',
  705. columnHidden: false,
  706. columnImage: false,
  707. columnSortable: false,
  708. sortLv: 0,
  709. status: true,
  710. fixed: '',
  711. columnWidth: 130
  712. },
  713. {
  714. userId: this.$store.state.user.name,
  715. functionId: 104010,
  716. serialNumber: '104010Table1UpdateBy',
  717. tableId: '104010Table1',
  718. tableName: 'Routing表',
  719. columnProp: 'updateBy',
  720. headerAlign: 'center',
  721. align: 'center',
  722. columnLabel: '更新人',
  723. columnHidden: false,
  724. columnImage: false,
  725. columnSortable: false,
  726. sortLv: 0,
  727. status: true,
  728. fixed: '',
  729. columnWidth: 80
  730. }
  731. ],
  732. workGuidelineColumnList: [
  733. {
  734. userId: this.$store.state.user.name,
  735. functionId: 104010,
  736. serialNumber: '104010Table2GuidelineSeq',
  737. tableId: '104010Table2',
  738. tableName: 'workGuideline表',
  739. columnProp: 'guidelineSeq',
  740. headerAlign: 'center',
  741. align: 'right',
  742. columnLabel: '序号',
  743. columnHidden: false,
  744. columnImage: false,
  745. columnSortable: false,
  746. sortLv: 0,
  747. status: true,
  748. fixed: '',
  749. columnWidth: 60
  750. },
  751. {
  752. userId: this.$store.state.user.name,
  753. functionId: 104010,
  754. serialNumber: '104010Table2GuidelineDesc',
  755. tableId: '104010Table2',
  756. tableName: 'workGuideline表',
  757. columnProp: 'guidelineDesc',
  758. headerAlign: 'center',
  759. align: 'left',
  760. columnLabel: '工艺指导名称',
  761. columnHidden: false,
  762. columnImage: false,
  763. columnSortable: false,
  764. sortLv: 0,
  765. status: true,
  766. fixed: '',
  767. columnWidth: 120
  768. },
  769. {
  770. userId: this.$store.state.user.name,
  771. functionId: 104010,
  772. serialNumber: '104010Table2GuidelineText',
  773. tableId: '104010Table2',
  774. tableName: 'workGuideline表',
  775. columnProp: 'guidelineText',
  776. headerAlign: 'center',
  777. align: 'left',
  778. columnLabel: '工艺指导描述',
  779. columnHidden: false,
  780. columnImage: false,
  781. columnSortable: false,
  782. sortLv: 0,
  783. status: true,
  784. fixed: '',
  785. columnWidth: 200
  786. },
  787. {
  788. userId: this.$store.state.user.name,
  789. functionId: 104010,
  790. serialNumber: '104010Table2GuidelineType',
  791. tableId: '104010Table2',
  792. tableName: 'workGuideline表',
  793. columnProp: 'guidelineType',
  794. headerAlign: 'center',
  795. align: 'center',
  796. columnLabel: '工艺指导类型',
  797. columnHidden: false,
  798. columnImage: false,
  799. columnSortable: false,
  800. sortLv: 0,
  801. status: true,
  802. fixed: '',
  803. columnWidth: 120
  804. },
  805. {
  806. userId: this.$store.state.user.name,
  807. functionId: 104010,
  808. serialNumber: '104010Table2SignOffRequired',
  809. tableId: '104010Table2',
  810. tableName: 'workGuideline表',
  811. columnProp: 'signOffRequired',
  812. headerAlign: 'center',
  813. align: 'center',
  814. columnLabel: '签字',
  815. columnHidden: false,
  816. columnImage: false,
  817. columnSortable: false,
  818. sortLv: 0,
  819. status: true,
  820. fixed: '',
  821. columnWidth: 150
  822. },
  823. {
  824. userId: this.$store.state.user.name,
  825. functionId: 104010,
  826. serialNumber: '104010Table2InspectionSignOffRequired',
  827. tableId: '104010Table2',
  828. tableName: 'workGuideline表',
  829. columnProp: 'inspectionSignOffRequired',
  830. headerAlign: 'center',
  831. align: 'center',
  832. columnLabel: '检验签字',
  833. columnHidden: false,
  834. columnImage: false,
  835. columnSortable: false,
  836. sortLv: 0,
  837. status: true,
  838. fixed: '',
  839. columnWidth: 150
  840. },
  841. {
  842. userId: this.$store.state.user.name,
  843. functionId: 104010,
  844. serialNumber: '104010Table2CreateDate',
  845. tableId: '104010Table2',
  846. tableName: 'BOM信息表',
  847. columnProp: 'createDate',
  848. headerAlign: 'center',
  849. align: 'center',
  850. columnLabel: '创建时间',
  851. columnHidden: false,
  852. columnImage: false,
  853. columnSortable: false,
  854. sortLv: 0,
  855. status: true,
  856. fixed: '',
  857. columnWidth: 130
  858. },
  859. {
  860. userId: this.$store.state.user.name,
  861. functionId: 104010,
  862. serialNumber: '104010Table2CreateBy',
  863. tableId: '104010Table2',
  864. tableName: 'BOM信息表',
  865. columnProp: 'createBy',
  866. headerAlign: 'center',
  867. align: 'center',
  868. columnLabel: '创建人',
  869. columnHidden: false,
  870. columnImage: false,
  871. columnSortable: false,
  872. sortLv: 0,
  873. status: true,
  874. fixed: '',
  875. columnWidth: 80
  876. },
  877. {
  878. userId: this.$store.state.user.name,
  879. functionId: 104010,
  880. serialNumber: '104010Table2UpdateDate',
  881. tableId: '104010Table2',
  882. tableName: 'BOM信息表',
  883. columnProp: 'updateDate',
  884. headerAlign: 'center',
  885. align: 'center',
  886. columnLabel: '更新时间',
  887. columnHidden: false,
  888. columnImage: false,
  889. columnSortable: false,
  890. sortLv: 0,
  891. status: true,
  892. fixed: '',
  893. columnWidth: 130
  894. },
  895. {
  896. userId: this.$store.state.user.name,
  897. functionId: 104010,
  898. serialNumber: '104010Table2UpdateBy',
  899. tableId: '104010Table2',
  900. tableName: 'BOM信息表',
  901. columnProp: 'updateBy',
  902. headerAlign: 'center',
  903. align: 'center',
  904. columnLabel: '更新人',
  905. columnHidden: false,
  906. columnImage: false,
  907. columnSortable: false,
  908. sortLv: 0,
  909. status: true,
  910. fixed: '',
  911. columnWidth: 80
  912. }
  913. ],
  914. // ======== 必填规则 ========
  915. guidelineRules: {
  916. guidelineSeq: [
  917. {
  918. required: true,
  919. message: ' ',
  920. trigger: 'change'
  921. }
  922. ],
  923. guidelineDesc: [
  924. {
  925. required: true,
  926. message: ' ',
  927. trigger: 'change'
  928. }
  929. ],
  930. guidelineType: [
  931. {
  932. required: true,
  933. message: ' ',
  934. trigger: 'change'
  935. }
  936. ],
  937. signOffRequired: [
  938. {
  939. required: true,
  940. message: ' ',
  941. trigger: 'change'
  942. }
  943. ],
  944. inspectionSignOffRequired: [
  945. {
  946. required: true,
  947. message: ' ',
  948. trigger: 'change'
  949. }
  950. ]
  951. },
  952. // ======== 复选数据集 ========
  953. workGuidelineSelections: [],
  954. // ======== 模态框开关控制 ========
  955. workGuidelineModal: false,
  956. workGuidelineDisableModal: false
  957. }
  958. },
  959. mounted () {
  960. this.$nextTick(() => {
  961. this.height = window.innerHeight / 2 - 240
  962. /*第二个表格高度的动态调整*/
  963. this.secondHeight = window.innerHeight - this.height - 175
  964. this.rightWidth = window.innerWidth - this.leftWidth - 275
  965. })
  966. },
  967. created () {
  968. this.getDataList()
  969. },
  970. // js
  971. methods: {
  972. // ======== 分页相关方法 ========
  973. /**
  974. * 每页数
  975. * @param val
  976. */
  977. sizeChangeHandle (val) {
  978. this.pageSize = val
  979. this.pageIndex = 1
  980. this.getDataList()
  981. },
  982. /**
  983. * 当前页
  984. * @param val
  985. */
  986. currentChangeHandle (val) {
  987. this.pageIndex = val
  988. this.getDataList()
  989. },
  990. // ======== 列表数据操作方法 ========
  991. /**
  992. * 获取数据列表
  993. */
  994. getDataList () {
  995. this.searchData.limit = this.pageSize
  996. this.searchData.page = this.pageIndex
  997. this.queryLoading = true
  998. routingSearchAlternative(this.searchData).then(({data}) => {
  999. if (data.code === 0) {
  1000. this.dataList = data.page.list
  1001. this.pageIndex = data.page.currPage
  1002. this.pageSize = data.page.pageSize
  1003. this.totalPage = data.page.totalCount
  1004. // 判断是否全部存在数据
  1005. if (this.dataList.length > 0) {
  1006. // 设置选中行
  1007. this.$refs.routingAlternativeTable.setCurrentRow(this.dataList[0])
  1008. this.alternativeClickRow(this.dataList[0])
  1009. } else {
  1010. this.alternativeCurrentRow = {}
  1011. }
  1012. // 加载当前的页签的table
  1013. this.refreshCurrentTabTable()
  1014. }
  1015. this.queryLoading = false
  1016. })
  1017. },
  1018. /**
  1019. * 获取 workGuideline
  1020. */
  1021. getRoutingWorkGuideline () {
  1022. getRoutingWorkGuideline(this.alternativeCurrentRow).then(({data}) => {
  1023. if (data && data.code === 0) {
  1024. this.workGuidelineList = data.rows
  1025. } else {
  1026. this.workGuidelineList = []
  1027. }
  1028. })
  1029. },
  1030. /**
  1031. * 单机选中信息
  1032. * @param row
  1033. */
  1034. alternativeClickRow (row) {
  1035. this.$refs.routingAlternativeTable.toggleRowSelection(row)
  1036. this.alternativeCurrentRow = JSON.parse(JSON.stringify(row))
  1037. },
  1038. /**
  1039. * 复选列表信息
  1040. * @param val
  1041. */
  1042. selectionWorkGuideline (val) {
  1043. this.workGuidelineSelections = val
  1044. },
  1045. // ======== 新增/编辑模态框 ========
  1046. /**
  1047. * workGuideline 新增模态框
  1048. */
  1049. saveWorkGuidelineModal () {
  1050. this.workGuidelineData = {
  1051. flag: '1',
  1052. id: '',
  1053. site: this.$store.state.user.site,
  1054. partNo: this.alternativeCurrentRow.partNo,
  1055. partDesc: this.alternativeCurrentRow.partDesc,
  1056. routingRevision: this.alternativeCurrentRow.routingRevision,
  1057. routingType: this.alternativeCurrentRow.routingType,
  1058. alternativeNo: this.alternativeCurrentRow.alternativeNo,
  1059. alternativeDescription: this.alternativeCurrentRow.alternativeDescription,
  1060. operationNo: this.alternativeCurrentRow.operationNo,
  1061. operationName: this.alternativeCurrentRow.operationName,
  1062. guidelineSeq: '',
  1063. guidelineDesc: '',
  1064. guidelineText: '',
  1065. guidelineType: '',
  1066. signOffRequired: '',
  1067. inspectionSignOffRequired: '',
  1068. createBy: this.$store.state.user.name,
  1069. updateBy: ''
  1070. }
  1071. // 查询seq
  1072. getGuidelineSeq(this.alternativeCurrentRow).then(({data}) => {
  1073. if (data && data.code === 0) {
  1074. this.workGuidelineData.guidelineSeq = data.guidelineSeq
  1075. }
  1076. })
  1077. // 开启模态框
  1078. this.workGuidelineModal = true
  1079. this.workGuidelineDisableModal = false
  1080. },
  1081. /**
  1082. * workGuideline 编辑模态框
  1083. */
  1084. updateWorkGuidelineModal (row) {
  1085. this.workGuidelineData = {
  1086. flag: '2',
  1087. id: row.id,
  1088. site: row.site,
  1089. partNo: row.partNo,
  1090. partDesc: row.partDesc,
  1091. routingRevision: row.routingRevision,
  1092. routingType: row.routingType,
  1093. alternativeNo: row.alternativeNo,
  1094. alternativeDescription: row.alternativeDescription,
  1095. operationNo: row.operationNo,
  1096. operationName: row.operationName,
  1097. guidelineSeq: row.guidelineSeq,
  1098. guidelineDesc: row.guidelineDesc,
  1099. guidelineText: row.guidelineText,
  1100. guidelineType: row.guidelineType,
  1101. signOffRequired: row.signOffRequired,
  1102. inspectionSignOffRequired: row.inspectionSignOffRequired,
  1103. createBy: '',
  1104. updateBy: this.$store.state.user.name
  1105. }
  1106. // 开启模态框
  1107. this.workGuidelineModal = true
  1108. this.workGuidelineDisableModal = true
  1109. },
  1110. // ======== 新增/编辑/删除方法 ========
  1111. /**
  1112. * workGuideline 新增方法
  1113. */
  1114. workGuidelineCommit () {
  1115. if (this.workGuidelineData.guidelineSeq === '' || this.workGuidelineData.guidelineSeq == null) {
  1116. this.$message.warning('请输入序号!')
  1117. return
  1118. }
  1119. if (this.workGuidelineData.guidelineDesc === '' || this.workGuidelineData.guidelineDesc == null) {
  1120. this.$message.warning('请输入工艺指导名称!')
  1121. return
  1122. }
  1123. if (this.workGuidelineData.guidelineType === '' || this.workGuidelineData.guidelineType == null) {
  1124. this.$message.warning('请选择工艺指导类型!')
  1125. return
  1126. }
  1127. if (this.workGuidelineData.signOffRequired === '' || this.workGuidelineData.signOffRequired == null) {
  1128. this.$message.warning('请选择签字!')
  1129. return
  1130. }
  1131. if (this.workGuidelineData.inspectionSignOffRequired === '' || this.workGuidelineData.inspectionSignOffRequired == null) {
  1132. this.$message.warning('请选择检验签字!')
  1133. return
  1134. }
  1135. if (this.workGuidelineData.flag === '1') {
  1136. workGuidelineSave(this.workGuidelineData).then(({data}) => {
  1137. if (data && data.code === 0) {
  1138. this.getRoutingWorkGuideline()
  1139. this.workGuidelineModal = false
  1140. this.$message({
  1141. message: '操作成功',
  1142. type: 'success',
  1143. duration: 1500,
  1144. onClose: () => {}
  1145. })
  1146. } else {
  1147. this.$alert(data.msg, '错误', {
  1148. confirmButtonText: '确定'
  1149. })
  1150. }
  1151. })
  1152. } else {
  1153. workGuidelineEdit(this.workGuidelineData).then(({data}) => {
  1154. if (data && data.code === 0) {
  1155. this.getRoutingWorkGuideline()
  1156. this.workGuidelineModal = false
  1157. this.$message({
  1158. message: '操作成功',
  1159. type: 'success',
  1160. duration: 1500,
  1161. onClose: () => {}
  1162. })
  1163. } else {
  1164. this.$alert(data.msg, '错误', {
  1165. confirmButtonText: '确定'
  1166. })
  1167. }
  1168. })
  1169. }
  1170. },
  1171. /**
  1172. * 删除 workGuideline
  1173. */
  1174. deleteModal () {
  1175. if(this.workGuidelineSelections.length === 0){
  1176. this.$message.warning('请勾选要删除的工艺指导!')
  1177. return
  1178. }
  1179. this.$confirm(`是否删除这 `+ this.workGuidelineSelections.length +` 条工艺指导?`, '提示', {
  1180. confirmButtonText: '确定',
  1181. cancelButtonText: '取消',
  1182. type: 'warning'
  1183. }).then(() => {
  1184. let tempData = {
  1185. informationList: this.workGuidelineSelections
  1186. }
  1187. deleteWorkGuideline(tempData).then(({data}) => {
  1188. if (data && data.code === 0) {
  1189. this.getDataList()
  1190. this.workGuidelineSelections = []
  1191. this.$message({
  1192. message: '操作成功',
  1193. type: 'success',
  1194. duration: 1500,
  1195. onClose: () => {}
  1196. })
  1197. } else {
  1198. this.$alert(data.msg, '错误', {
  1199. confirmButtonText: '确定'
  1200. })
  1201. }
  1202. })
  1203. }).catch(() => {
  1204. })
  1205. },
  1206. // ======== 页签切换相关方法 ========
  1207. /**
  1208. * 列表表格选择替换
  1209. * @param tab
  1210. * @param event
  1211. */
  1212. tabClick (tab, event) {
  1213. // 刷新列表数据
  1214. this.refreshCurrentTabTable()
  1215. },
  1216. /**
  1217. * 当前值发生变化的时候修改
  1218. * @param row
  1219. * @param oldRow
  1220. */
  1221. changeCurrentRow (row, oldRow) {
  1222. // 判断是否是获取焦点的事件
  1223. if (row) {
  1224. this.alternativeCurrentRow = JSON.parse(JSON.stringify(row))
  1225. //刷新当前页表
  1226. this.refreshCurrentTabTable()
  1227. }
  1228. },
  1229. /**
  1230. * 刷新页签的table数据
  1231. */
  1232. refreshCurrentTabTable () {
  1233. if (this.activeTable === 'WorkGuidelines') {
  1234. // 获取workGuideline
  1235. this.getRoutingWorkGuideline()
  1236. }
  1237. },
  1238. // ======== chooseList相关方法 ========
  1239. /**
  1240. * 获取基础数据列表S
  1241. * @param val
  1242. * @param type
  1243. */
  1244. getBaseList (val, type) {
  1245. this.tagNo = val
  1246. this.$nextTick(() => {
  1247. let strVal = ''
  1248. if (val === 117) {
  1249. strVal = this.componentData.issueToLoc
  1250. }
  1251. this.$refs.baseList.init(val, strVal)
  1252. })
  1253. },
  1254. /**
  1255. * 列表方法的回调
  1256. * @param val
  1257. */
  1258. getBaseData (val) {
  1259. if (this.tagNo === 117) {
  1260. this.componentData.issueToLoc = val.location_id
  1261. this.componentData.issueToLocName = val.location_name
  1262. }
  1263. },
  1264. // ======== 导出相关方法 ========
  1265. /**
  1266. * 导出excel
  1267. */
  1268. async createExportData () {
  1269. this.searchData.limit = -1
  1270. this.searchData.page = 1
  1271. await routingSearchAlternative(this.searchData).then(({data}) => {
  1272. this.resultList = data.page.list
  1273. })
  1274. return this.resultList
  1275. },
  1276. startDownload () {},
  1277. finishDownload () {},
  1278. fields () {
  1279. let json = '{'
  1280. this.columnList.forEach((item, index) => {
  1281. if (index == this.columnList.length - 1) {
  1282. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  1283. } else {
  1284. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  1285. }
  1286. })
  1287. json += '}'
  1288. let s = eval('(' + json + ')')
  1289. return s
  1290. },
  1291. /**
  1292. * 未知
  1293. * @returns {boolean}
  1294. */
  1295. selectFlag () {
  1296. return true
  1297. },
  1298. }
  1299. }
  1300. </script>
  1301. <style scoped lang="scss">
  1302. .numInput /deep/ .el-input__inner{
  1303. text-align: right;
  1304. }
  1305. /deep/ .inlineNumber input::-webkit-outer-spin-button,
  1306. /deep/ .inlineNumber input::-webkit-inner-spin-button {
  1307. -webkit-appearance: none;
  1308. }
  1309. /deep/ .inlineNumber input[type="number"]{
  1310. -moz-appearance: textfield;
  1311. padding-right: 5px !important;
  1312. }
  1313. /deep/ .el-tabs--border-card>.el-tabs__content{
  1314. padding: 5px;
  1315. }
  1316. </style>