赫艾前端
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
19 KiB

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
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
2 years ago
2 years ago
1 year ago
2 years 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
1 year ago
2 years 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
1 year ago
2 years 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
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
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" >
  4. <el-form-item :label="'工厂编码'">
  5. <el-input v-model="searchData.site" style="width: 130px"></el-input>
  6. </el-form-item>
  7. <el-form-item :label="'生产订单号'">
  8. <el-input v-model="searchData.orderNo" style="width: 130px"></el-input>
  9. </el-form-item>
  10. <el-form-item :label="'派工单号'">
  11. <el-input v-model="searchData.seqNo" type="number" style="width: 130px"></el-input>
  12. </el-form-item>
  13. <el-form-item :label="'操作员姓名'">
  14. <el-input v-model="searchData.operatorDesc" style="width: 130px"></el-input>
  15. </el-form-item>
  16. <el-form-item >
  17. <span slot="label" style="" @click="getBaseList(5)"><a herf="#">产品编码</a></span>
  18. <el-input v-model="searchData.partNo" style="width: 120px"></el-input>
  19. </el-form-item>
  20. <el-form-item :label="'规格型号'">
  21. <el-input v-model="searchData.partSpec" style="width: 120px"></el-input>
  22. </el-form-item>
  23. <el-form-item :label="'派工日期:'">
  24. <el-date-picker
  25. style="width: 130px"
  26. v-model="searchData.startDate"
  27. value-format="yyyy-MM-dd"
  28. placeholder="选择日期">
  29. </el-date-picker>
  30. </el-form-item>
  31. <el-form-item :label="'到:'">
  32. <el-date-picker
  33. style="width: 130px"
  34. v-model="searchData.endDate"
  35. value-format="yyyy-MM-dd"
  36. placeholder="选择日期">
  37. </el-date-picker>
  38. <el-button @click="search()" type="primary">查询</el-button>
  39. <download-excel
  40. :fields="fields()"
  41. type="xls"
  42. :name="exportName"
  43. :fetch="createExportData"
  44. worksheet="导出信息"
  45. class="el-button el-button--primary el-button--medium">
  46. {{ '导出' }}
  47. </download-excel>
  48. </el-form-item>
  49. </el-form>
  50. <el-table
  51. :height="height"
  52. :data="tableData"
  53. border
  54. style="width: 100%">
  55. <el-table-column
  56. v-for="(item,index) in columnList" :key="index"
  57. :sortable="item.columnSortable"
  58. :prop="item.columnProp"
  59. header-align="center"
  60. :show-overflow-tooltip="item.showOverflowTooltip"
  61. :align="item.align"
  62. :fixed="item.fixed==''?false:item.fixed"
  63. :min-width="item.columnWidth"
  64. :label="item.columnLabel">
  65. <template slot-scope="scope">
  66. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  67. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  68. style="width: 100px; height: 80px"/></span>
  69. </template>
  70. </el-table-column>
  71. </el-table>
  72. <el-pagination
  73. @size-change="sizeChangeHandle"
  74. @current-change="currentChangeHandle"
  75. :current-page="pageIndex"
  76. :page-sizes="[20, 100, 500]"
  77. :page-size="pageSize"
  78. :total="totalPage"
  79. layout="total, sizes, prev, pager, next, jumper">
  80. </el-pagination>
  81. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  82. </div>
  83. </template>
  84. <script>
  85. import {
  86. getLiuhuaView,
  87. } from '@/api/production/generateReport.js'
  88. import Chooselist from '@/views/modules/common/Chooselist'
  89. export default {
  90. name: 'liuhuaProductView',
  91. components: {
  92. Chooselist
  93. },
  94. data () {
  95. return {
  96. pageIndex: 1,
  97. pageSize: 20,
  98. totalPage: 0,
  99. site: this.$store.state.user.site,
  100. // 导出+动态列 start
  101. exportData: [],
  102. userDev:this.$store.state.user.userDev,
  103. exportName: "半成品派工单追踪表"+this.getStrDate(),
  104. columnList: [
  105. {
  106. tableId: "liuhuaView",
  107. tableName: this.$route.meta.title,
  108. columnProp: "site",
  109. columnLabel: "工厂",
  110. columnHidden: false,
  111. columnImage: false,
  112. columnSortable: false,
  113. columnWidth: 40,
  114. format: null,
  115. functionId: this.$route.meta.menuId,
  116. sortLv: 0,
  117. status: true,
  118. fixed: '',
  119. serialNumber: null,
  120. columnType: null,
  121. align: 'left'
  122. }, {
  123. tableId: "liuhuaView",
  124. tableName: this.$route.meta.title,
  125. columnProp: "seqNo",
  126. columnLabel: "派工单号",
  127. columnHidden: false,
  128. columnImage: false,
  129. columnSortable: false,
  130. columnWidth: 70,
  131. format: null,
  132. functionId: this.$route.meta.menuId,
  133. sortLv: 0,
  134. status: true,
  135. fixed: '',
  136. serialNumber: null,
  137. columnType: null,
  138. align: 'left'
  139. }, {
  140. tableId: "liuhuaView",
  141. tableName: this.$route.meta.title,
  142. columnProp: "orderNo",
  143. columnLabel: "生产订单",
  144. columnHidden: false,
  145. columnImage: false,
  146. columnSortable: false,
  147. columnWidth: 100,
  148. format: null,
  149. functionId: this.$route.meta.menuId,
  150. sortLv: 0,
  151. status: true,
  152. fixed: '',
  153. serialNumber: null,
  154. columnType: null,
  155. align: 'left'
  156. }, {
  157. tableId: "liuhuaView",
  158. tableName: this.$route.meta.title,
  159. columnProp: "operatorDesc",
  160. columnLabel: "操作员姓名",
  161. columnHidden: false,
  162. columnImage: false,
  163. columnSortable: false,
  164. columnWidth: 80,
  165. format: null,
  166. functionId: this.$route.meta.menuId,
  167. sortLv: 0,
  168. status: true,
  169. fixed: '',
  170. serialNumber: null,
  171. columnType: null,
  172. align: 'left'
  173. }, {
  174. tableId: "liuhuaView",
  175. tableName: this.$route.meta.title,
  176. columnProp: "partSpec",
  177. columnLabel: "规格型号",
  178. columnHidden: false,
  179. columnImage: false,
  180. columnSortable: false,
  181. columnWidth: 120,
  182. format: null,
  183. functionId: this.$route.meta.menuId,
  184. sortLv: 0,
  185. status: true,
  186. fixed: '',
  187. serialNumber: null,
  188. columnType: null,
  189. align: 'left'
  190. }, {
  191. tableId: "liuhuaView",
  192. tableName: this.$route.meta.title,
  193. columnProp: "firstReportDate2",
  194. columnLabel: "首次报工日期",
  195. columnHidden: false,
  196. columnImage: false,
  197. columnSortable: false,
  198. columnWidth: 100,
  199. format: null,
  200. functionId: this.$route.meta.menuId,
  201. sortLv: 0,
  202. status: true,
  203. fixed: '',
  204. serialNumber: null,
  205. columnType: null,
  206. align: 'center'
  207. }, {
  208. tableId: "liuhuaView",
  209. tableName: this.$route.meta.title,
  210. columnProp: "qtyRequired",
  211. columnLabel: "派工数量",
  212. columnHidden: false,
  213. columnImage: false,
  214. columnSortable: false,
  215. columnWidth: 70,
  216. format: null,
  217. functionId: this.$route.meta.menuId,
  218. sortLv: 0,
  219. status: true,
  220. fixed: '',
  221. serialNumber: null,
  222. columnType: null,
  223. align: 'right'
  224. }, {
  225. tableId: "liuhuaView",
  226. tableName: this.$route.meta.title,
  227. columnProp: "qtyReported",
  228. columnLabel: "报工数量",
  229. columnHidden: false,
  230. columnImage: false,
  231. columnSortable: false,
  232. columnWidth: 70,
  233. format: null,
  234. functionId: this.$route.meta.menuId,
  235. sortLv: 0,
  236. status: true,
  237. fixed: '',
  238. serialNumber: null,
  239. columnType: null,
  240. align: 'right'
  241. }, {
  242. tableId: "liuhuaView",
  243. tableName: this.$route.meta.title,
  244. columnProp: "liuhuaWancheng",
  245. columnLabel: "硫化完成率",
  246. columnHidden: false,
  247. columnImage: false,
  248. columnSortable: false,
  249. columnWidth: 80,
  250. format: null,
  251. functionId: this.$route.meta.menuId,
  252. sortLv: 0,
  253. status: true,
  254. fixed: '',
  255. serialNumber: null,
  256. columnType: null,
  257. align: 'right'
  258. }, {
  259. tableId: "liuhuaView",
  260. tableName: this.$route.meta.title,
  261. columnProp: "liuhuaTime",
  262. columnLabel: "硫化首次报工",
  263. columnHidden: false,
  264. columnImage: false,
  265. columnSortable: false,
  266. columnWidth: 130,
  267. format: null,
  268. functionId: this.$route.meta.menuId,
  269. sortLv: 0,
  270. status: true,
  271. fixed: '',
  272. serialNumber: null,
  273. columnType: null,
  274. align: 'center'
  275. }, {
  276. tableId: "liuhuaView",
  277. tableName: this.$route.meta.title,
  278. columnProp: "xiubianWancheng",
  279. columnLabel: "修边完成率",
  280. columnHidden: false,
  281. columnImage: false,
  282. columnSortable: false,
  283. columnWidth: 80,
  284. format: null,
  285. functionId: this.$route.meta.menuId,
  286. sortLv: 0,
  287. status: true,
  288. fixed: '',
  289. serialNumber: null,
  290. columnType: null,
  291. align: 'right'
  292. }, {
  293. tableId: "liuhuaView",
  294. tableName: this.$route.meta.title,
  295. columnProp: "xiubianTime",
  296. columnLabel: "修边首次报工",
  297. columnHidden: false,
  298. columnImage: false,
  299. columnSortable: false,
  300. columnWidth: 130,
  301. format: null,
  302. functionId: this.$route.meta.menuId,
  303. sortLv: 0,
  304. status: true,
  305. fixed: '',
  306. serialNumber: null,
  307. columnType: null,
  308. align: 'center'
  309. }, {
  310. tableId: "liuhuaView",
  311. tableName: this.$route.meta.title,
  312. columnProp: "hongkaoWancheng",
  313. columnLabel: "烘烤完成率",
  314. columnHidden: false,
  315. columnImage: false,
  316. columnSortable: false,
  317. columnWidth: 80,
  318. format: null,
  319. functionId: this.$route.meta.menuId,
  320. sortLv: 0,
  321. status: true,
  322. fixed: '',
  323. serialNumber: null,
  324. columnType: null,
  325. align: 'right'
  326. }, {
  327. tableId: "liuhuaView",
  328. tableName: this.$route.meta.title,
  329. columnProp: "hongkaoTime",
  330. columnLabel: "烘烤首次报工",
  331. columnHidden: false,
  332. columnImage: false,
  333. columnSortable: false,
  334. columnWidth: 130,
  335. format: null,
  336. functionId: this.$route.meta.menuId,
  337. sortLv: 0,
  338. status: true,
  339. fixed: '',
  340. serialNumber: null,
  341. columnType: null,
  342. align: 'center'
  343. }, {
  344. tableId: "liuhuaView",
  345. tableName: this.$route.meta.title,
  346. columnProp: "jiagongWancheng",
  347. columnLabel: "加工完成率",
  348. columnHidden: false,
  349. columnImage: false,
  350. columnSortable: false,
  351. columnWidth: 80,
  352. format: null,
  353. functionId: this.$route.meta.menuId,
  354. sortLv: 0,
  355. status: true,
  356. fixed: '',
  357. serialNumber: null,
  358. columnType: null,
  359. align: 'right'
  360. }, {
  361. tableId: "liuhuaView",
  362. tableName: this.$route.meta.title,
  363. columnProp: "jiagongTime",
  364. columnLabel: "加工首次报工",
  365. columnHidden: false,
  366. columnImage: false,
  367. columnSortable: false,
  368. columnWidth: 130,
  369. format: null,
  370. functionId: this.$route.meta.menuId,
  371. sortLv: 0,
  372. status: true,
  373. fixed: '',
  374. serialNumber: null,
  375. columnType: null,
  376. align: 'center'
  377. }, {
  378. tableId: "liuhuaView",
  379. tableName: this.$route.meta.title,
  380. columnProp: "jianyanWancheng",
  381. columnLabel: "检验完成率",
  382. columnHidden: false,
  383. columnImage: false,
  384. columnSortable: false,
  385. columnWidth: 80,
  386. format: null,
  387. functionId: this.$route.meta.menuId,
  388. sortLv: 0,
  389. status: true,
  390. fixed: '',
  391. serialNumber: null,
  392. columnType: null,
  393. align: 'right'
  394. }, {
  395. tableId: "liuhuaView",
  396. tableName: this.$route.meta.title,
  397. columnProp: "jianyanTime",
  398. columnLabel: "检验首次报工",
  399. columnHidden: false,
  400. columnImage: false,
  401. columnSortable: false,
  402. columnWidth: 130,
  403. format: null,
  404. functionId: this.$route.meta.menuId,
  405. sortLv: 0,
  406. status: true,
  407. fixed: '',
  408. serialNumber: null,
  409. columnType: null,
  410. align: 'center'
  411. }, {
  412. tableId: "liuhuaView",
  413. tableName: this.$route.meta.title,
  414. columnProp: "baozhuangWancheng",
  415. columnLabel: "包装完成率",
  416. columnHidden: false,
  417. columnImage: false,
  418. columnSortable: false,
  419. columnWidth: 80,
  420. format: null,
  421. functionId: this.$route.meta.menuId,
  422. sortLv: 0,
  423. status: true,
  424. fixed: '',
  425. serialNumber: null,
  426. columnType: null,
  427. align: 'right'
  428. }, {
  429. tableId: "liuhuaView",
  430. tableName: this.$route.meta.title,
  431. columnProp: "baozhuangTime",
  432. columnLabel: "包装首次报工",
  433. columnHidden: false,
  434. columnImage: false,
  435. columnSortable: false,
  436. columnWidth: 130,
  437. format: null,
  438. functionId: this.$route.meta.menuId,
  439. sortLv: 0,
  440. status: true,
  441. fixed: '',
  442. serialNumber: null,
  443. columnType: null,
  444. align: 'center'
  445. }, {
  446. tableId: "liuhuaView",
  447. tableName: this.$route.meta.title,
  448. columnProp: "liuhuahegelv",
  449. columnLabel: "硫化合格率",
  450. columnHidden: false,
  451. columnImage: false,
  452. columnSortable: false,
  453. columnWidth: 80,
  454. format: null,
  455. functionId: this.$route.meta.menuId,
  456. sortLv: 0,
  457. status: true,
  458. fixed: '',
  459. serialNumber: null,
  460. columnType: null,
  461. align: 'right'
  462. }
  463. ],
  464. visible:false,
  465. // 导出 end
  466. height: 200,
  467. tableData: [],
  468. exportList: [],
  469. searchData: {
  470. page: 1,
  471. limit: 20,
  472. site:'',
  473. operatorDesc:'',
  474. orderNo: '',
  475. partNo: '',
  476. partSpec:'',
  477. startDate:'',
  478. endDate:'',
  479. seqNo:'',
  480. },
  481. }
  482. },
  483. mounted () {
  484. this.$nextTick(() => {
  485. this.height = window.innerHeight - 240
  486. })
  487. },
  488. methods: {
  489. // 获取基础数据列表S
  490. getBaseList (val, type) {
  491. this.tagNo = val
  492. this.$nextTick(() => {
  493. let strVal = ''
  494. if (val === 24) {
  495. strVal = this.searchData.workCenterNo
  496. }
  497. if (val === 5) {
  498. strVal = this.searchData.partNo
  499. }
  500. if (val === 26) {
  501. strVal = this.searchData.operatorName
  502. }
  503. if (val === 88) {
  504. strVal = this.searchData.resourceId
  505. }
  506. this.$refs.baseList.init(val, strVal)
  507. })
  508. },
  509. /* 列表方法的回调 */
  510. getBaseData (val) {
  511. if (this.tagNo === 24) {
  512. this.searchData.workCenterNo = val.WorkCenterNo
  513. } else if (this.tagNo === 5) {
  514. this.searchData.partNo = val.PartNo
  515. }
  516. if (this.tagNo === 26) {
  517. this.searchData.operatorName = val.OperatorName
  518. }
  519. if (this.tagNo === 88) {
  520. this.searchData.resourceId = val.ResourceID
  521. }
  522. },
  523. search() {
  524. if (this.searchData.site === ''&&this.searchData.orderNo === ''&&this.searchData.partNo === ''
  525. &&this.searchData.partSpec === ''&&this.searchData.startDate === ''&&this.searchData.endDate === ''
  526. &&this.searchData.seqNo === ''&&this.searchData.operatorDesc === ''){
  527. this.$alert('计算量过大,请至少填写一个筛选条件!', '错误', {
  528. confirmButtonText: '确定'
  529. })
  530. return false;
  531. }
  532. this.searchData.limit = this.pageSize
  533. this.searchData.page = this.pageIndex
  534. getLiuhuaView(this.searchData).then(({data}) => {
  535. if (data.code == 0) {
  536. this.tableData = data.page.list
  537. this.pageIndex = data.page.currPage
  538. this.pageSize = data.page.pageSize
  539. this.totalPage = data.page.totalCount
  540. }
  541. this.dataListLoading = false
  542. })
  543. },
  544. // 导出+动态列
  545. fields() {
  546. let json = "{"
  547. this.columnList.forEach((item, index) => {
  548. if (index == this.columnList.length - 1) {
  549. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  550. } else {
  551. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  552. }
  553. })
  554. json += "}"
  555. let s = eval("(" + json + ")")
  556. return s
  557. },
  558. async createExportData() {
  559. // 点击导出按钮之后,开始导出数据之前的执行函数,返回值为需要下载的数据
  560. this.searchData.limit = -1
  561. this.searchData.page = 1
  562. await getLiuhuaView(this.searchData).then(({data}) => {
  563. this.exportList= data.page.list;
  564. })
  565. return this.exportList;
  566. },
  567. getStrDate() {
  568. let dd = new Date();
  569. let Y = dd.getFullYear();
  570. let M = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1);//获取当前月份的日期,不足10补0
  571. let D = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();//获取当前几号,不足10补0
  572. let H = dd.getHours() < 10 ? "0" + dd.getHours() : dd.getHours();
  573. let MM = dd.getMinutes() < 10 ? "0" + dd.getMinutes() : dd.getMinutes();
  574. let S = dd.getSeconds() < 10 ? "0" + dd.getSeconds() : dd.getSeconds();
  575. return Y + M + D + H + MM + S;
  576. },
  577. // 每页数
  578. sizeChangeHandle (val) {
  579. this.pageSize = val
  580. this.pageIndex = 1
  581. this.search()
  582. },
  583. // 当前页
  584. currentChangeHandle (val) {
  585. this.pageIndex = val
  586. this.search()
  587. },
  588. },
  589. created () {
  590. // this.getTableUserColumn()
  591. }
  592. }
  593. </script>
  594. <style scoped>
  595. .input_left{
  596. text-align: left;
  597. }
  598. .input_reight{
  599. text-align: right;
  600. }
  601. /deep/ input::-webkit-inner-spin-button {
  602. -webkit-appearance: none !important;
  603. }
  604. input[type='number'] {
  605. -moz-appearance: textfield !important;
  606. }
  607. </style>