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

681 lines
21 KiB

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