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.

617 lines
17 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-button :loading="queryLoading" @click="getDataList()">查询</el-button>
  29. <download-excel
  30. :fields="fields()"
  31. :data="exportData"
  32. type="xls"
  33. :name="exportName"
  34. :header="exportHeader"
  35. :footer="exportFooter"
  36. :fetch="createExportData"
  37. :before-generate="startDownload"
  38. :before-finish="finishDownload"
  39. worksheet="导出信息"
  40. class="el-button el-button--primary el-button--medium">
  41. {{ "导出" }}
  42. </download-excel>
  43. </el-form-item>
  44. </el-form>
  45. <!-- bom列表 -->
  46. <el-table
  47. :height="height"
  48. :data="dataList"
  49. border
  50. style="width: 100%">
  51. <el-table-column
  52. v-for="(item,index) in columnList" :key="index"
  53. :sortable="item.columnSortable"
  54. :prop="item.columnProp"
  55. :header-align="item.headerAlign"
  56. :show-overflow-tooltip="item.showOverflowTooltip"
  57. :align="item.align"
  58. :fixed="item.fixed === ''?false:item.fixed"
  59. :min-width="item.columnWidth"
  60. :label="item.columnLabel">
  61. <template slot-scope="scope">
  62. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  63. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. <!-- 分页插件 -->
  68. <el-pagination style="margin-top: 0px"
  69. @size-change="sizeChangeHandle"
  70. @current-change="currentChangeHandle"
  71. :current-page="pageIndex"
  72. :page-sizes="[20, 50, 100, 200, 500]"
  73. :page-size="pageSize"
  74. :total="totalPage"
  75. layout="total, sizes, prev, pager, next, jumper">
  76. </el-pagination>
  77. <!-- chooseList模态框 -->
  78. <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
  79. </div>
  80. </template>
  81. <script>
  82. import {
  83. workGuidelinesSearch, // workGuidelines 列表查询
  84. } from '@/api/part/routingOperationWorkGuidelines.js'
  85. import ChooseList from '@/views/modules/common/Chooselist'
  86. export default {
  87. // 组件
  88. components: {
  89. ChooseList
  90. },
  91. // 监听
  92. watch: {
  93. searchData: {
  94. deep: true,
  95. handler: function (newV, oldV) {
  96. this.searchData.partNo = this.searchData.partNo.toUpperCase()
  97. }
  98. }
  99. },
  100. // 对象
  101. data () {
  102. return {
  103. // 导出
  104. exportData: [],
  105. exportName: '工艺指导' + this.dayjs().format('YYYYMMDDHHmmss'),
  106. exportHeader: ['工艺指导'],
  107. exportFooter: [],
  108. resultList: [],
  109. // ======== 行高 ========
  110. height: 200,
  111. // ======== 分页 ========
  112. pageIndex: 1,
  113. pageSize: 50,
  114. totalPage: 0,
  115. // 条件查询
  116. searchData: {
  117. site: this.$store.state.user.site,
  118. partNo: '',
  119. partDesc: '',
  120. routingType: '',
  121. routingRevision: '',
  122. alternativeNo: '',
  123. alternativeDescription: '',
  124. page: 1,
  125. limit: 10
  126. },
  127. // loading
  128. queryLoading: false,
  129. // 初始页签
  130. // ======== 数据对象 ========
  131. // ======== 选中的当前行数据 ========
  132. // ======== 数据列表 ========
  133. dataList: [],
  134. // ======== 列表表头 ========
  135. columnList: [
  136. {
  137. userId: this.$store.state.user.name,
  138. functionId: 104011,
  139. serialNumber: '104011Table1PartNo',
  140. tableId: '104011Table1',
  141. tableName: 'Routing表',
  142. columnProp: 'partNo',
  143. headerAlign: 'center',
  144. align: 'center',
  145. columnLabel: '物料编码',
  146. columnHidden: false,
  147. columnImage: false,
  148. columnSortable: false,
  149. sortLv: 0,
  150. status: true,
  151. fixed: '',
  152. columnWidth: 120
  153. },
  154. {
  155. userId: this.$store.state.user.name,
  156. functionId: 104011,
  157. serialNumber: '104011Table1PartDesc',
  158. tableId: '104011Table1',
  159. tableName: 'Routing表',
  160. columnProp: 'partDesc',
  161. headerAlign: 'center',
  162. align: 'left',
  163. columnLabel: '物料名称',
  164. columnHidden: false,
  165. columnImage: false,
  166. columnSortable: false,
  167. sortLv: 0,
  168. status: true,
  169. fixed: '',
  170. columnWidth: 300
  171. },
  172. {
  173. userId: this.$store.state.user.name,
  174. functionId: 104011,
  175. serialNumber: '104011Table1RoutingType',
  176. tableId: '104011Table1',
  177. tableName: 'Routing表',
  178. columnProp: 'routingType',
  179. headerAlign: 'center',
  180. align: 'left',
  181. columnLabel: '工艺类型',
  182. columnHidden: false,
  183. columnImage: false,
  184. columnSortable: false,
  185. sortLv: 0,
  186. status: true,
  187. fixed: '',
  188. columnWidth: 120
  189. },
  190. {
  191. userId: this.$store.state.user.name,
  192. functionId: 104011,
  193. serialNumber: '104011Table1RoutingRevision',
  194. tableId: '104011Table1',
  195. tableName: 'Routing表',
  196. columnProp: 'routingRevision',
  197. headerAlign: 'center',
  198. align: 'right',
  199. columnLabel: 'Routing版本号',
  200. columnHidden: false,
  201. columnImage: false,
  202. columnSortable: false,
  203. sortLv: 0,
  204. status: true,
  205. fixed: '',
  206. columnWidth: 100
  207. },
  208. {
  209. userId: this.$store.state.user.name,
  210. functionId: 104011,
  211. serialNumber: '104011Table1AlternativeNo',
  212. tableId: '104011Table1',
  213. tableName: 'Routing表',
  214. columnProp: 'alternativeNo',
  215. headerAlign: 'center',
  216. align: 'center',
  217. columnLabel: '替代编码',
  218. columnHidden: false,
  219. columnImage: false,
  220. columnSortable: false,
  221. sortLv: 0,
  222. status: true,
  223. fixed: '',
  224. columnWidth: 100
  225. },
  226. {
  227. userId: this.$store.state.user.name,
  228. functionId: 104011,
  229. serialNumber: '104011Table1AlternativeDescription',
  230. tableId: '104011Table1',
  231. tableName: 'Routing表',
  232. columnProp: 'alternativeDescription',
  233. headerAlign: 'center',
  234. align: 'left',
  235. columnLabel: '替代名称',
  236. columnHidden: false,
  237. columnImage: false,
  238. columnSortable: false,
  239. sortLv: 0,
  240. status: true,
  241. fixed: '',
  242. columnWidth: 200
  243. },
  244. {
  245. userId: this.$store.state.user.name,
  246. functionId: 104011,
  247. serialNumber: '104011Table1OperationNo',
  248. tableId: '104011Table1',
  249. tableName: 'Routing表',
  250. columnProp: 'operationNo',
  251. headerAlign: 'center',
  252. align: 'center',
  253. columnLabel: '工序编码',
  254. columnHidden: false,
  255. columnImage: false,
  256. columnSortable: false,
  257. sortLv: 0,
  258. status: true,
  259. fixed: '',
  260. columnWidth: 100
  261. },
  262. {
  263. userId: this.$store.state.user.name,
  264. functionId: 104011,
  265. serialNumber: '104011Table1OperationName',
  266. tableId: '104011Table1',
  267. tableName: 'Routing表',
  268. columnProp: 'operationName',
  269. headerAlign: 'center',
  270. align: 'left',
  271. columnLabel: '工序名称',
  272. columnHidden: false,
  273. columnImage: false,
  274. columnSortable: false,
  275. sortLv: 0,
  276. status: true,
  277. fixed: '',
  278. columnWidth: 120
  279. },
  280. {
  281. userId: this.$store.state.user.name,
  282. functionId: 104011,
  283. serialNumber: '104011Table1GuidelineSeq',
  284. tableId: '104011Table1',
  285. tableName: 'workGuideline表',
  286. columnProp: 'guidelineSeq',
  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: 100
  297. },
  298. {
  299. userId: this.$store.state.user.name,
  300. functionId: 104011,
  301. serialNumber: '104011Table1GuidelineDesc',
  302. tableId: '104011Table1',
  303. tableName: 'workGuideline表',
  304. columnProp: 'guidelineDesc',
  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: 120
  315. },
  316. {
  317. userId: this.$store.state.user.name,
  318. functionId: 104011,
  319. serialNumber: '104011Table1GuidelineText',
  320. tableId: '104011Table1',
  321. tableName: 'workGuideline表',
  322. columnProp: 'guidelineText',
  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: 200
  333. },
  334. {
  335. userId: this.$store.state.user.name,
  336. functionId: 104011,
  337. serialNumber: '104011Table1GuidelineType',
  338. tableId: '104011Table1',
  339. tableName: 'workGuideline表',
  340. columnProp: 'guidelineType',
  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: 120
  351. },
  352. {
  353. userId: this.$store.state.user.name,
  354. functionId: 104011,
  355. serialNumber: '104011Table1SignOffRequired',
  356. tableId: '104011Table1',
  357. tableName: 'workGuideline表',
  358. columnProp: 'signOffRequired',
  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: 150
  369. },
  370. {
  371. userId: this.$store.state.user.name,
  372. functionId: 104011,
  373. serialNumber: '104011Table1InspectionSignOffRequired',
  374. tableId: '104011Table1',
  375. tableName: 'workGuideline表',
  376. columnProp: 'inspectionSignOffRequired',
  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: 150
  387. },
  388. {
  389. userId: this.$store.state.user.name,
  390. functionId: 104011,
  391. serialNumber: '104011Table1CreateDate',
  392. tableId: '104011Table1',
  393. tableName: 'BOM信息表',
  394. columnProp: 'createDate',
  395. headerAlign: 'center',
  396. align: 'center',
  397. columnLabel: '创建时间',
  398. columnHidden: false,
  399. columnImage: false,
  400. columnSortable: false,
  401. sortLv: 0,
  402. status: true,
  403. fixed: '',
  404. columnWidth: 170
  405. },
  406. {
  407. userId: this.$store.state.user.name,
  408. functionId: 104011,
  409. serialNumber: '104011Table1CreateBy',
  410. tableId: '104011Table1',
  411. tableName: 'BOM信息表',
  412. columnProp: 'createBy',
  413. headerAlign: 'center',
  414. align: 'center',
  415. columnLabel: '创建人',
  416. columnHidden: false,
  417. columnImage: false,
  418. columnSortable: false,
  419. sortLv: 0,
  420. status: true,
  421. fixed: '',
  422. columnWidth: 100
  423. },
  424. {
  425. userId: this.$store.state.user.name,
  426. functionId: 104011,
  427. serialNumber: '104011Table1UpdateDate',
  428. tableId: '104011Table1',
  429. tableName: 'BOM信息表',
  430. columnProp: 'updateDate',
  431. headerAlign: 'center',
  432. align: 'center',
  433. columnLabel: '更新时间',
  434. columnHidden: false,
  435. columnImage: false,
  436. columnSortable: false,
  437. sortLv: 0,
  438. status: true,
  439. fixed: '',
  440. columnWidth: 170
  441. },
  442. {
  443. userId: this.$store.state.user.name,
  444. functionId: 104011,
  445. serialNumber: '104011Table1UpdateBy',
  446. tableId: '104011Table1',
  447. tableName: 'BOM信息表',
  448. columnProp: 'updateBy',
  449. headerAlign: 'center',
  450. align: 'center',
  451. columnLabel: '更新人',
  452. columnHidden: false,
  453. columnImage: false,
  454. columnSortable: false,
  455. sortLv: 0,
  456. status: true,
  457. fixed: '',
  458. columnWidth: 100
  459. }
  460. ],
  461. // ======== 必填规则 ========
  462. // ======== 复选数据集 ========
  463. // ======== 模态框开关控制 ========
  464. }
  465. },
  466. mounted () {
  467. this.$nextTick(() => {
  468. this.height = window.innerHeight - 180
  469. })
  470. },
  471. created () {
  472. this.getDataList()
  473. },
  474. // js
  475. methods: {
  476. // ======== 分页相关方法 ========
  477. /**
  478. * 每页数
  479. * @param val
  480. */
  481. sizeChangeHandle (val) {
  482. this.pageSize = val
  483. this.pageIndex = 1
  484. this.getDataList()
  485. },
  486. /**
  487. * 当前页
  488. * @param val
  489. */
  490. currentChangeHandle (val) {
  491. this.pageIndex = val
  492. this.getDataList()
  493. },
  494. // ======== 列表数据操作方法 ========
  495. /**
  496. * 获取数据列表
  497. */
  498. getDataList () {
  499. this.searchData.limit = this.pageSize
  500. this.searchData.page = this.pageIndex
  501. this.queryLoading = true
  502. workGuidelinesSearch(this.searchData).then(({data}) => {
  503. if (data.code === 0) {
  504. this.dataList = data.page.list
  505. this.pageIndex = data.page.currPage
  506. this.pageSize = data.page.pageSize
  507. this.totalPage = data.page.totalCount
  508. }
  509. this.queryLoading = false
  510. })
  511. },
  512. // ======== chooseList相关方法 ========
  513. /**
  514. * 获取基础数据列表S
  515. * @param val
  516. * @param type
  517. */
  518. getBaseList (val, type) {
  519. this.tagNo = val
  520. this.$nextTick(() => {
  521. let strVal = ''
  522. if (val === 117) {
  523. strVal = this.componentData.issueToLoc
  524. }
  525. this.$refs.baseList.init(val, strVal)
  526. })
  527. },
  528. /**
  529. * 列表方法的回调
  530. * @param val
  531. */
  532. getBaseData (val) {
  533. if (this.tagNo === 117) {
  534. this.componentData.issueToLoc = val.location_id
  535. this.componentData.issueToLocName = val.location_name
  536. }
  537. },
  538. // ======== 导出相关方法 ========
  539. /**
  540. * 导出excel
  541. */
  542. async createExportData () {
  543. this.searchData.limit = -1
  544. this.searchData.page = 1
  545. await workGuidelinesSearch(this.searchData).then(({data}) => {
  546. this.resultList = data.page.list
  547. })
  548. return this.resultList
  549. },
  550. startDownload () {},
  551. finishDownload () {},
  552. fields () {
  553. let json = '{'
  554. this.columnList.forEach((item, index) => {
  555. if (index == this.columnList.length - 1) {
  556. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  557. } else {
  558. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  559. }
  560. })
  561. json += '}'
  562. let s = eval('(' + json + ')')
  563. return s
  564. },
  565. /**
  566. * 未知
  567. * @returns {boolean}
  568. */
  569. selectFlag () {
  570. return true
  571. },
  572. }
  573. }
  574. </script>
  575. <style scoped lang="scss">
  576. .numInput /deep/ .el-input__inner{
  577. text-align: right;
  578. }
  579. /deep/ .inlineNumber input::-webkit-outer-spin-button,
  580. /deep/ .inlineNumber input::-webkit-inner-spin-button {
  581. -webkit-appearance: none;
  582. }
  583. /deep/ .inlineNumber input[type="number"]{
  584. -moz-appearance: textfield;
  585. padding-right: 5px !important;
  586. }
  587. </style>