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

647 lines
20 KiB

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