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.

1272 lines
38 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <div class="customer-css" >
  3. <el-dialog v-drag
  4. width="975px" class="customer-dialog"
  5. :title="titleCon" v-bind="$attrs" v-on="$listeners">
  6. <!-- 显示信息 -->
  7. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;" >
  8. <el-row style="width: 560px;">
  9. <el-form-item :label="'生产订单号:'">
  10. <el-input v-model="pageData.orderNo" readonly="readonly" style="width: 120px"></el-input>
  11. </el-form-item>
  12. <el-form-item :label="'要求完工日期:'">
  13. <el-input v-model="pageData.needDate" readonly="readonly" style="width: 120px"></el-input>
  14. </el-form-item>
  15. <el-form-item :label="'工厂编号:'">
  16. <el-input v-model="pageData.site" readonly="readonly" style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'加工中心:'">
  19. <el-input v-model="pageData.workCenterNo" readonly="readonly" style="width: 120px"></el-input>
  20. </el-form-item>
  21. </el-row>
  22. <el-row style="width: 560px;">
  23. <el-form-item :label="'工序:'">
  24. <el-input v-model="pageData.itemNo" readonly="readonly" style="width: 120px"></el-input>
  25. </el-form-item>
  26. <el-form-item :label="'工序名称:'">
  27. <el-input v-model="pageData.itemDesc" readonly="readonly" style="width: 120px"></el-input>
  28. </el-form-item>
  29. <el-form-item :label="'待排产数量:'">
  30. <el-input v-model="pageData.qtyToSchedule" readonly="readonly" style="width: 120px"></el-input>
  31. </el-form-item>
  32. <el-form-item :label="'可用机台:'">
  33. <el-select v-model="pageData.resourceId" @change="refreshPageTables" style="width: 120px" placeholder="请选择">
  34. <el-option
  35. v-for="(item, index) in resourceList"
  36. :key="index"
  37. :label="item.resourceDesc"
  38. :value="item.resourceId"
  39. >
  40. </el-option>
  41. </el-select>
  42. </el-form-item>
  43. </el-row>
  44. <el-row style="width: 560px;">
  45. <el-form-item :label="'排产日期:'">
  46. <el-date-picker class="el-time-width"
  47. style=""
  48. v-model="pageData.scheduleDate"
  49. value-format="yyyy-MM-dd">
  50. </el-date-picker>
  51. </el-form-item>
  52. <el-form-item :label="''" style="margin-top: -5px;">
  53. <el-checkbox v-model="pageData.specifiedTime" true-label="Y" false-label="N" style="margin-top: 28px; margin-right: -20px;" ></el-checkbox>
  54. <el-time-picker
  55. format="HH:mm"
  56. arrow-control
  57. style="margin-top: 30px; width: 65px"
  58. v-model="pageData.scheduleTime"
  59. value-format="HH:mm">
  60. </el-time-picker>
  61. </el-form-item>
  62. <el-form-item :label="''" style="margin-left: 0px; margin-top: 20px;">
  63. <el-checkbox v-model="pageData.closeModal" class="customer-checkbox" true-label="Y" false-label="N" style="margin-top: 5px;"
  64. label="排产后关闭对话框"></el-checkbox>
  65. </el-form-item>
  66. <el-form-item :label="'本次排产数量:'" style="margin-left: 0px;">
  67. <el-input v-model="pageData.scheduledQty" style="width: 120px"></el-input>
  68. </el-form-item>
  69. <el-form-item :label="''" style="margin-top: 20px;">
  70. <el-button class="customer-bun-min" type="primary" @click="startScheduleOrderBun" style="margin-left: 10px; margin-bottom: 5px;">排产</el-button>
  71. </el-form-item>
  72. </el-row>
  73. </el-form>
  74. <!-- 机台班次信息 -->
  75. <el-main style="margin-left: 520px; margin-top: -160px; width: 452px;">
  76. <el-table
  77. height="145"
  78. :data="resourceShiftList"
  79. border
  80. v-loading="dataListLoading"
  81. style="width: 100%;">
  82. <el-table-column
  83. v-for="(item,index) in columnTimeArray" :key="index"
  84. :sortable="item.columnSortable"
  85. :prop="item.columnProp"
  86. :header-align="item.headerAlign"
  87. :show-overflow-tooltip="item.showOverflowTooltip"
  88. :align="item.align"
  89. :fixed="item.fixed"
  90. :width="item.columnWidth"
  91. :label="item.columnLabel">
  92. <template slot-scope="scope">
  93. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  94. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  95. style="width: 100px; height: 80px"/></span>
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. </el-main>
  100. <!-- 工单明细表信息 -->
  101. <el-main style="margin-top: -15px; width: 100%; padding: 0px;">
  102. <el-form :inline="true" label-position="top" label-width="100px">
  103. <el-form-item :label="'明细记录'">
  104. </el-form-item>
  105. </el-form>
  106. <el-table
  107. :height="height"
  108. :data="orderScheduleList"
  109. border
  110. highlight-current-row
  111. ref="scheduleTable"
  112. @row-dblclick="warnCancelScheduleConfirm"
  113. v-loading="dataListLoading"
  114. style="margin-top: -20px; width: 955px;">
  115. <el-table-column
  116. v-for="(item,index) in columnOrderScheduleArray" :key="index"
  117. :sortable="item.columnSortable"
  118. :prop="item.columnProp"
  119. :header-align="item.headerAlign"
  120. :show-overflow-tooltip="item.showOverflowTooltip"
  121. :align="item.align"
  122. :fixed="item.fixed"
  123. :width="item.columnWidth"
  124. :label="item.columnLabel">
  125. <template slot-scope="scope">
  126. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  127. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  128. style="width: 100px; height: 80px"/></span>
  129. </template>
  130. </el-table-column>
  131. </el-table>
  132. </el-main>
  133. </el-dialog>
  134. </div>
  135. </template>
  136. <script>
  137. import {
  138. getShopOrderByCon,
  139. getOrderAvailableResource,/*获取可用的机台数据*/
  140. getOrderScheduleList,
  141. getResourceRestList,/*刷新机台班次的数据*/
  142. scheduleOrderWithExpand,/*执行特殊的排产操作*/
  143. cancelSoSchedule,/*取消排产*/
  144. } from '@/api/schedule/com_schedule_order_expand.js'
  145. export default {
  146. data() {
  147. return {
  148. height: 320,
  149. titleCon: '排产扩展',
  150. showPartStockFlag: false,
  151. showChangeWaitTime: false,
  152. resourceList: [],
  153. pageData: {
  154. site: this.$store.state.user.site,
  155. username: this.$store.state.user.name,
  156. orderNo: '',
  157. itemNo: '',
  158. itemDesc: '',
  159. resourceId: '',
  160. workCenterNo: '',
  161. scheduleDate: this.dayjs(new Date()).format('YYYY-MM-DD'),
  162. scheduleTime: '08:30',
  163. specifiedTime: 'N',
  164. needDate: '',
  165. qtyToSchedule: 0,
  166. scheduledQty: 0,
  167. closeModal: 'Y',
  168. calendarId: '',
  169. checkFlag: true
  170. },
  171. resourceShiftList: [],
  172. orderScheduleList: [],
  173. dataListLoading: false,
  174. columnTimeArray: [
  175. {
  176. userId: this.$store.state.user.name,
  177. functionId: 5301,
  178. serialNumber: '5301ShiftShiftDate',
  179. tableId: "5301Shift",
  180. tableName: "工作日历",
  181. columnProp: "shiftDate",
  182. headerAlign: "center",
  183. align: "center",
  184. columnLabel: "日期",
  185. columnWidth: 90,
  186. columnHidden: false,
  187. columnImage: false,
  188. columnSortable: false,
  189. sortLv: 0,
  190. status: true,
  191. fixed: false
  192. },
  193. {
  194. userId: this.$store.state.user.name,
  195. functionId: 5301,
  196. serialNumber: '5301ShiftShiftInfo',
  197. tableId: "5301Shift",
  198. tableName: "工作日历",
  199. columnProp: "shiftInfo",
  200. headerAlign: "center",
  201. align: "center",
  202. columnLabel: "休息时间览表",
  203. columnWidth: 320,
  204. columnHidden: false,
  205. columnImage: false,
  206. columnSortable: false,
  207. sortLv: 0,
  208. status: true,
  209. fixed: false
  210. }
  211. ],
  212. columnOrderScheduleArray: [
  213. {
  214. userId: this.$store.state.user.name,
  215. functionId: 5301,
  216. serialNumber: '5301ScheduleScheduledSeqNo',
  217. tableId: "5301Schedule",
  218. tableName: "排产明细表",
  219. columnProp: "scheduledSeqNo",
  220. headerAlign: "center",
  221. align: "center",
  222. columnLabel: "排产序号",
  223. columnWidth: 80,
  224. columnHidden: false,
  225. columnImage: false,
  226. columnSortable: false,
  227. sortLv: 0,
  228. status: true,
  229. fixed: false
  230. },
  231. {
  232. userId: this.$store.state.user.name,
  233. functionId: 5301,
  234. serialNumber: '5301SchedulePlanStartTime',
  235. tableId: "5301Schedule",
  236. tableName: "排产明细表",
  237. columnProp: "planStartTime",
  238. headerAlign: "center",
  239. align: "center",
  240. columnLabel: "计划开工时间",
  241. columnWidth: 125,
  242. columnHidden: false,
  243. columnImage: false,
  244. columnSortable: false,
  245. sortLv: 0,
  246. status: true,
  247. fixed: false
  248. },
  249. {
  250. userId: this.$store.state.user.name,
  251. functionId: 5301,
  252. serialNumber: '5301SchedulePlanFinishTime',
  253. tableId: "5301Schedule",
  254. tableName: "排产明细表",
  255. columnProp: "planFinishTime",
  256. headerAlign: "center",
  257. align: "center",
  258. columnLabel: "计划完工时间",
  259. columnWidth: 125,
  260. columnHidden: false,
  261. columnImage: false,
  262. columnSortable: false,
  263. sortLv: 0,
  264. status: true,
  265. fixed: false
  266. },
  267. {
  268. userId: this.$store.state.user.name,
  269. functionId: 5301,
  270. serialNumber: '5301ScheduleTimeRequired',
  271. tableId: "5301Schedule",
  272. tableName: "排产明细表",
  273. columnProp: "timeRequired",
  274. headerAlign: "center",
  275. align: "center",
  276. columnLabel: "计划时间",
  277. columnWidth: 80,
  278. columnHidden: false,
  279. columnImage: false,
  280. columnSortable: false,
  281. sortLv: 0,
  282. status: true,
  283. fixed: false
  284. },
  285. {
  286. userId: this.$store.state.user.name,
  287. functionId: 5301,
  288. serialNumber: '5301ScheduleOrderNo',
  289. tableId: "5301Schedule",
  290. tableName: "排产明细表",
  291. columnProp: "orderNo",
  292. headerAlign: "center",
  293. align: "center",
  294. columnLabel: "订单号",
  295. columnWidth: 80,
  296. columnHidden: false,
  297. columnImage: false,
  298. columnSortable: false,
  299. sortLv: 0,
  300. status: true,
  301. fixed: false
  302. },
  303. {
  304. userId: this.$store.state.user.name,
  305. functionId: 5301,
  306. serialNumber: '5301ScheduleNeedDate',
  307. tableId: "5301Schedule",
  308. tableName: "排产明细表",
  309. columnProp: "needDate",
  310. headerAlign: "center",
  311. align: "center",
  312. columnLabel: "需求日期",
  313. columnWidth: 80,
  314. columnHidden: false,
  315. columnImage: false,
  316. columnSortable: false,
  317. sortLv: 0,
  318. status: true,
  319. fixed: false
  320. },
  321. {
  322. userId: this.$store.state.user.name,
  323. functionId: 5301,
  324. serialNumber: '5301ScheduleItemNo',
  325. tableId: "5301Schedule",
  326. tableName: "排产明细表",
  327. columnProp: "itemNo",
  328. headerAlign: "center",
  329. align: "center",
  330. columnLabel: "工序号",
  331. columnWidth: 80,
  332. columnHidden: false,
  333. columnImage: false,
  334. columnSortable: false,
  335. sortLv: 0,
  336. status: true,
  337. fixed: false
  338. },
  339. {
  340. userId: this.$store.state.user.name,
  341. functionId: 5301,
  342. serialNumber: '5301ScheduleItemDesc',
  343. tableId: "5301Schedule",
  344. tableName: "排产明细表",
  345. columnProp: "itemDesc",
  346. headerAlign: "center",
  347. align: "center",
  348. columnLabel: "工序名称",
  349. columnWidth: 80,
  350. columnHidden: false,
  351. columnImage: false,
  352. columnSortable: false,
  353. sortLv: 0,
  354. status: true,
  355. fixed: false
  356. },
  357. {
  358. userId: this.$store.state.user.name,
  359. functionId: 5301,
  360. serialNumber: '5301SchedulePartNo',
  361. tableId: "5301Schedule",
  362. tableName: "排产明细表",
  363. columnProp: "partNo",
  364. headerAlign: "center",
  365. align: "center",
  366. columnLabel: "产品编码",
  367. columnWidth: 120,
  368. columnHidden: false,
  369. columnImage: false,
  370. columnSortable: false,
  371. sortLv: 0,
  372. status: true,
  373. fixed: false
  374. },
  375. {
  376. userId: this.$store.state.user.name,
  377. functionId: 5301,
  378. serialNumber: '5301SchedulePartDesc',
  379. tableId: "5301Schedule",
  380. tableName: "排产明细表",
  381. columnProp: "partDesc",
  382. headerAlign: "center",
  383. align: "center",
  384. columnLabel: "产品名称",
  385. columnWidth: 80,
  386. columnHidden: false,
  387. columnImage: false,
  388. columnSortable: false,
  389. sortLv: 0,
  390. status: true,
  391. fixed: false
  392. },
  393. {
  394. userId: this.$store.state.user.name,
  395. functionId: 5301,
  396. serialNumber: '5301OrderSpec',
  397. tableId: "5301Schedule",
  398. tableName: "排产明细表",
  399. columnProp: "spec",
  400. headerAlign: "center",
  401. align: "center",
  402. columnLabel: "规格型号",
  403. columnWidth: 80,
  404. columnHidden: false,
  405. columnImage: false,
  406. columnSortable: false,
  407. sortLv: 0,
  408. status: true,
  409. fixed: false
  410. },
  411. {
  412. userId: this.$store.state.user.name,
  413. functionId: 5301,
  414. serialNumber: '5301ScheduleQtyRequired',
  415. tableId: "5301Schedule",
  416. tableName: "排产明细表",
  417. columnProp: "qtyRequired",
  418. headerAlign: "center",
  419. align: "center",
  420. columnLabel: "待生产数量",
  421. columnWidth: 80,
  422. columnHidden: false,
  423. columnImage: false,
  424. columnSortable: false,
  425. sortLv: 0,
  426. status: true,
  427. fixed: false
  428. },
  429. {
  430. userId: this.$store.state.user.name,
  431. functionId: 5301,
  432. serialNumber: '5301ScheduleQtyRequired',
  433. tableId: "5301Schedule",
  434. tableName: "排产明细表",
  435. columnProp: "qtyRequired",
  436. headerAlign: "center",
  437. align: "center",
  438. columnLabel: "派工单需求数量",
  439. columnWidth: 80,
  440. columnHidden: false,
  441. columnImage: false,
  442. columnSortable: false,
  443. sortLv: 0,
  444. status: true,
  445. fixed: false
  446. },
  447. {
  448. userId: this.$store.state.user.name,
  449. functionId: 5301,
  450. serialNumber: '5301ScheduleQtyReported',
  451. tableId: "5301Schedule",
  452. tableName: "排产明细表",
  453. columnProp: "qtyReported",
  454. headerAlign: "center",
  455. align: "center",
  456. columnLabel: "已报告数量",
  457. columnWidth: 80,
  458. columnHidden: false,
  459. columnImage: false,
  460. columnSortable: false,
  461. sortLv: 0,
  462. status: true,
  463. fixed: false
  464. },
  465. {
  466. userId: this.$store.state.user.name,
  467. functionId: 5301,
  468. serialNumber: '5301SchedulePreItemNo',
  469. tableId: "5301Schedule",
  470. tableName: "排产明细表",
  471. columnProp: "preItemNo",
  472. headerAlign: "center",
  473. align: "center",
  474. columnLabel: "前道工序",
  475. columnWidth: 80,
  476. columnHidden: false,
  477. columnImage: false,
  478. columnSortable: false,
  479. sortLv: 0,
  480. status: true,
  481. fixed: false
  482. },
  483. {
  484. userId: this.$store.state.user.name,
  485. functionId: 5301,
  486. serialNumber: '5301SchedulePreItemDesc',
  487. tableId: "5301Schedule",
  488. tableName: "排产明细表",
  489. columnProp: "preItemDesc",
  490. headerAlign: "center",
  491. align: "center",
  492. columnLabel: "前道工序名称",
  493. columnWidth: 80,
  494. columnHidden: false,
  495. columnImage: false,
  496. columnSortable: false,
  497. sortLv: 0,
  498. status: true,
  499. fixed: false
  500. },
  501. {
  502. userId: this.$store.state.user.name,
  503. functionId: 5301,
  504. serialNumber: '5301SchedulePreScheduledFlag',
  505. tableId: "5301Schedule",
  506. tableName: "排产明细表",
  507. columnProp: "preScheduledFlag",
  508. headerAlign: "center",
  509. align: "center",
  510. columnLabel: "前道工序是否排产",
  511. columnWidth: 80,
  512. columnHidden: false,
  513. columnImage: false,
  514. columnSortable: false,
  515. sortLv: 0,
  516. status: true,
  517. fixed: false
  518. },
  519. {
  520. userId: this.$store.state.user.name,
  521. functionId: 5301,
  522. serialNumber: '5301ScheduleNextItemNo',
  523. tableId: "5301Schedule",
  524. tableName: "排产明细表",
  525. columnProp: "nextItemNo",
  526. headerAlign: "center",
  527. align: "center",
  528. columnLabel: "后道工序",
  529. columnWidth: 80,
  530. columnHidden: false,
  531. columnImage: false,
  532. columnSortable: false,
  533. sortLv: 0,
  534. status: true,
  535. fixed: false
  536. },
  537. {
  538. userId: this.$store.state.user.name,
  539. functionId: 5301,
  540. serialNumber: '5301ScheduleNextItemDesc',
  541. tableId: "5301Schedule",
  542. tableName: "排产明细表",
  543. columnProp: "nextItemDesc",
  544. headerAlign: "center",
  545. align: "center",
  546. columnLabel: "后道工序名称",
  547. columnWidth: 80,
  548. columnHidden: false,
  549. columnImage: false,
  550. columnSortable: false,
  551. sortLv: 0,
  552. status: true,
  553. fixed: false
  554. },
  555. {
  556. userId: this.$store.state.user.name,
  557. functionId: 5301,
  558. serialNumber: '5301ScheduleNextScheduledFlag',
  559. tableId: "5301Schedule",
  560. tableName: "排产明细表",
  561. columnProp: "nextScheduledFlag",
  562. headerAlign: "center",
  563. align: "center",
  564. columnLabel: "后道工序是否排产",
  565. columnWidth: 80,
  566. columnHidden: false,
  567. columnImage: false,
  568. columnSortable: false,
  569. sortLv: 0,
  570. status: true,
  571. fixed: false
  572. },
  573. {
  574. userId: this.$store.state.user.name,
  575. functionId: 5301,
  576. serialNumber: '5301ScheduleResourceId',
  577. tableId: "5301Schedule",
  578. tableName: "排产明细表",
  579. columnProp: "resourceId",
  580. headerAlign: "center",
  581. align: "center",
  582. columnLabel: "机台号",
  583. columnWidth: 80,
  584. columnHidden: false,
  585. columnImage: false,
  586. columnSortable: false,
  587. sortLv: 0,
  588. status: true,
  589. fixed: false
  590. },
  591. {
  592. userId: this.$store.state.user.name,
  593. functionId: 5301,
  594. serialNumber: '5301ScheduleCustomerName',
  595. tableId: "5301Schedule",
  596. tableName: "排产明细表",
  597. columnProp: "customerName",
  598. headerAlign: "center",
  599. align: "center",
  600. columnLabel: "客户名称",
  601. columnWidth: 80,
  602. columnHidden: false,
  603. columnImage: false,
  604. columnSortable: false,
  605. sortLv: 0,
  606. status: true,
  607. fixed: false
  608. },
  609. {
  610. userId: this.$store.state.user.name,
  611. functionId: 5301,
  612. serialNumber: '5301ScheduleEnterDate',
  613. tableId: "5301Schedule",
  614. tableName: "排产明细表",
  615. columnProp: "enterDate",
  616. headerAlign: "center",
  617. align: "center",
  618. columnLabel: "录入日期",
  619. columnWidth: 125,
  620. columnHidden: false,
  621. columnImage: false,
  622. columnSortable: false,
  623. sortLv: 0,
  624. status: true,
  625. fixed: false
  626. },
  627. {
  628. userId: this.$store.state.user.name,
  629. functionId: 5301,
  630. serialNumber: '5301ScheduleAvailResource',
  631. tableId: "5301Schedule",
  632. tableName: "排产明细表",
  633. columnProp: "availResource",
  634. headerAlign: "center",
  635. align: "center",
  636. columnLabel: "可用机台",
  637. columnWidth: 80,
  638. columnHidden: false,
  639. columnImage: false,
  640. columnSortable: false,
  641. sortLv: 0,
  642. status: true,
  643. fixed: false
  644. },
  645. {
  646. userId: this.$store.state.user.name,
  647. functionId: 5301,
  648. serialNumber: '5301ScheduleWorkCenterNo',
  649. tableId: "5301Schedule",
  650. tableName: "排产明细表",
  651. columnProp: "workCenterNo",
  652. headerAlign: "center",
  653. align: "center",
  654. columnLabel: "加工中心",
  655. columnWidth: 80,
  656. columnHidden: false,
  657. columnImage: false,
  658. columnSortable: false,
  659. sortLv: 0,
  660. status: true,
  661. fixed: false
  662. },
  663. {
  664. userId: this.$store.state.user.name,
  665. functionId: 5301,
  666. serialNumber: '5301ScheduleMachRunFactor',
  667. tableId: "5301Schedule",
  668. tableName: "排产明细表",
  669. columnProp: "machRunFactor",
  670. headerAlign: "center",
  671. align: "center",
  672. columnLabel: "单位产出",
  673. columnWidth: 80,
  674. columnHidden: false,
  675. columnImage: false,
  676. columnSortable: false,
  677. sortLv: 0,
  678. status: true,
  679. fixed: false
  680. },
  681. {
  682. userId: this.$store.state.user.name,
  683. functionId: 5301,
  684. serialNumber: '5301ScheduleMachSetupTime',
  685. tableId: "5301Schedule",
  686. tableName: "排产明细表",
  687. columnProp: "machSetupTime",
  688. headerAlign: "center",
  689. align: "center",
  690. columnLabel: "调机时间",
  691. columnWidth: 80,
  692. columnHidden: false,
  693. columnImage: false,
  694. columnSortable: false,
  695. sortLv: 0,
  696. status: true,
  697. fixed: false
  698. },
  699. {
  700. userId: this.$store.state.user.name,
  701. functionId: 5301,
  702. serialNumber: '5301ScheduleFactorUnit',
  703. tableId: "5301Schedule",
  704. tableName: "排产明细表",
  705. columnProp: "factorUnit",
  706. headerAlign: "center",
  707. align: "center",
  708. columnLabel: "产出单位",
  709. columnWidth: 80,
  710. columnHidden: false,
  711. columnImage: false,
  712. columnSortable: false,
  713. sortLv: 0,
  714. status: true,
  715. fixed: false
  716. },
  717. {
  718. userId: this.$store.state.user.name,
  719. functionId: 5301,
  720. serialNumber: '5301ScheduleSite',
  721. tableId: "5301Schedule",
  722. tableName: "排产明细表",
  723. columnProp: "site",
  724. headerAlign: "center",
  725. align: "center",
  726. columnLabel: "工厂编号",
  727. columnWidth: 80,
  728. columnHidden: false,
  729. columnImage: false,
  730. columnSortable: false,
  731. sortLv: 0,
  732. status: true,
  733. fixed: false
  734. },
  735. {
  736. userId: this.$store.state.user.name,
  737. functionId: 5301,
  738. serialNumber: '5301ScheduleQtyScheduledPreOps',
  739. tableId: "5301Schedule",
  740. tableName: "排产明细表",
  741. columnProp: "qtyScheduledPreOps",
  742. headerAlign: "center",
  743. align: "center",
  744. columnLabel: "前道工序已排产数量",
  745. columnWidth: 80,
  746. columnHidden: false,
  747. columnImage: false,
  748. columnSortable: false,
  749. sortLv: 0,
  750. status: true,
  751. fixed: false
  752. },
  753. {
  754. userId: this.$store.state.user.name,
  755. functionId: 5301,
  756. serialNumber: '5301ScheduleDelayFlag',
  757. tableId: "5301Schedule",
  758. tableName: "排产明细表",
  759. columnProp: "laterShipFlag",
  760. headerAlign: "center",
  761. align: "center",
  762. columnLabel: "晚于发货时间",
  763. columnWidth: 80,
  764. columnHidden: false,
  765. columnImage: false,
  766. columnSortable: false,
  767. sortLv: 0,
  768. status: true,
  769. fixed: false
  770. },
  771. {
  772. userId: this.$store.state.user.name,
  773. functionId: 5301,
  774. serialNumber: '5301ScheduleClosedFlag',
  775. tableId: "5301Schedule",
  776. tableName: "排产明细表",
  777. columnProp: "closedFlag",
  778. headerAlign: "center",
  779. align: "center",
  780. columnLabel: "是否关闭",
  781. columnWidth: 80,
  782. columnHidden: false,
  783. columnImage: false,
  784. columnSortable: false,
  785. sortLv: 0,
  786. status: true,
  787. fixed: false
  788. },
  789. {
  790. userId: this.$store.state.user.name,
  791. functionId: 5301,
  792. serialNumber: '5301ScheduleParkFlag',
  793. tableId: "5301Schedule",
  794. tableName: "排产明细表",
  795. columnProp: "parkFlag",
  796. headerAlign: "center",
  797. align: "center",
  798. columnLabel: "暂停",
  799. columnWidth: 80,
  800. columnHidden: false,
  801. columnImage: false,
  802. columnSortable: false,
  803. sortLv: 0,
  804. status: true,
  805. fixed: false
  806. },
  807. {
  808. userId: this.$store.state.user.name,
  809. functionId: 5301,
  810. serialNumber: '5301ScheduleTimeRequired',
  811. tableId: "5301Schedule",
  812. tableName: "排产明细表",
  813. columnProp: "timeRequired",
  814. headerAlign: "center",
  815. align: "center",
  816. columnLabel: "派工单需求工时",
  817. columnWidth: 80,
  818. columnHidden: false,
  819. columnImage: false,
  820. columnSortable: false,
  821. sortLv: 0,
  822. status: true,
  823. fixed: false
  824. },
  825. {
  826. userId: this.$store.state.user.name,
  827. functionId: 5301,
  828. serialNumber: '5301ScheduleEarlierItemFlag',
  829. tableId: "5301Schedule",
  830. tableName: "排产明细表",
  831. columnProp: "earlierItemFlag",
  832. headerAlign: "center",
  833. align: "center",
  834. columnLabel: "派工单早于上工序",
  835. columnWidth: 80,
  836. columnHidden: false,
  837. columnImage: false,
  838. columnSortable: false,
  839. sortLv: 0,
  840. status: true,
  841. fixed: false
  842. },
  843. {
  844. userId: this.$store.state.user.name,
  845. functionId: 5301,
  846. serialNumber: '5301ScheduleRemark',
  847. tableId: "5301Schedule",
  848. tableName: "排产明细表",
  849. columnProp: "remark",
  850. headerAlign: "center",
  851. align: "center",
  852. columnLabel: "备注",
  853. columnWidth: 80,
  854. columnHidden: false,
  855. columnImage: false,
  856. columnSortable: false,
  857. sortLv: 0,
  858. status: true,
  859. fixed: false
  860. },
  861. {
  862. userId: this.$store.state.user.name,
  863. functionId: 5301,
  864. serialNumber: '5301ScheduleOriSOOrderNo',
  865. tableId: "5301Schedule",
  866. tableName: "排产明细表",
  867. columnProp: "oriSOOrderNo",
  868. headerAlign: "center",
  869. align: "center",
  870. columnLabel: "SAP参考号",
  871. columnWidth: 80,
  872. columnHidden: false,
  873. columnImage: false,
  874. columnSortable: false,
  875. sortLv: 0,
  876. status: true,
  877. fixed: false
  878. },
  879. {
  880. userId: this.$store.state.user.name,
  881. functionId: 5301,
  882. serialNumber: '5301ScheduleCustPartNo',
  883. tableId: "5301Schedule",
  884. tableName: "排产明细表",
  885. columnProp: "custPartNo",
  886. headerAlign: "center",
  887. align: "center",
  888. columnLabel: "客户产品料号",
  889. columnWidth: 80,
  890. columnHidden: false,
  891. columnImage: false,
  892. columnSortable: false,
  893. sortLv: 0,
  894. status: true,
  895. fixed: false
  896. },
  897. {
  898. userId: this.$store.state.user.name,
  899. functionId: 5301,
  900. serialNumber: '5301ScheduleEficiency',
  901. tableId: "5301Schedule",
  902. tableName: "排产明细表",
  903. columnProp: "eficiency",
  904. headerAlign: "center",
  905. align: "center",
  906. columnLabel: "效率",
  907. columnWidth: 80,
  908. columnHidden: false,
  909. columnImage: false,
  910. columnSortable: false,
  911. sortLv: 0,
  912. status: true,
  913. fixed: false
  914. },
  915. {
  916. userId: this.$store.state.user.name,
  917. functionId: 5301,
  918. serialNumber: '5301ScheduleDelayHours',
  919. tableId: "5301Schedule",
  920. tableName: "排产明细表",
  921. columnProp: "delayHours",
  922. headerAlign: "center",
  923. align: "center",
  924. columnLabel: "延误小时数",
  925. columnWidth: 80,
  926. columnHidden: false,
  927. columnImage: false,
  928. columnSortable: false,
  929. sortLv: 0,
  930. status: true,
  931. fixed: false
  932. },
  933. {
  934. userId: this.$store.state.user.name,
  935. functionId: 5301,
  936. serialNumber: '5301Schedule',
  937. tableId: "5301Schedule",
  938. tableName: "排产明细表",
  939. columnProp: "costRollUpFlag",
  940. headerAlign: "center",
  941. align: "center",
  942. columnLabel: "已排料",
  943. columnWidth: 80,
  944. columnHidden: false,
  945. columnImage: false,
  946. columnSortable: false,
  947. sortLv: 0,
  948. status: true,
  949. fixed: false
  950. },
  951. {
  952. userId: this.$store.state.user.name,
  953. functionId: 5301,
  954. serialNumber: '5301Schedule',
  955. tableId: "5301Schedule",
  956. tableName: "排产明细表",
  957. columnProp: "finishPreItemFlag",
  958. headerAlign: "center",
  959. align: "center",
  960. columnLabel: "排产完成时间早于上工序",
  961. columnWidth: 80,
  962. columnHidden: false,
  963. columnImage: false,
  964. columnSortable: false,
  965. sortLv: 0,
  966. status: true,
  967. fixed: false
  968. }
  969. ],
  970. }
  971. },
  972. mounted() {
  973. },
  974. methods: {
  975. /*刷新当前页面的数据*/
  976. init(orderRow){
  977. //设置参数
  978. this.pageData.orderNo = orderRow.orderNo;
  979. this.pageData.itemNo = orderRow.itemNo;
  980. this.pageData.scheduledQty = 0;
  981. this.pageData.closeModal = 'Y';
  982. //清空参数
  983. this.resourceList = [];
  984. this.resourceShiftList = [];
  985. this.pageData.resourceId = '';
  986. this.pageData.workCenterNo = '';
  987. this.orderScheduleList = [];
  988. //页面的参数
  989. this.refreshShopOrderData(orderRow);
  990. },
  991. //刷新派工单的数据
  992. refreshShopOrderData() {
  993. getShopOrderByCon(this.pageData).then(({data}) => {
  994. //刷新排产的数量
  995. this.pageData.qtyToSchedule = data.row.qtyToSchedule;
  996. this.pageData.needDate = data.row.needDate;
  997. this.pageData.workCenterNo = data.row.workCenterNo;
  998. this.pageData.itemDesc = data.row.itemDesc;
  999. //刷新当前的可用机台
  1000. this.getOrderAvailableResourceData();
  1001. });
  1002. },
  1003. /*获取可用机台的*/
  1004. getOrderAvailableResourceData(){
  1005. getOrderAvailableResource(this.pageData).then(({data}) => {
  1006. this.resourceList = data.rows;
  1007. //判断是否只有一个 默认选中第一个
  1008. if(data.rows.length == 1){
  1009. this.pageData.resourceId = data.rows[0].resourceId;
  1010. //刷新列表数据
  1011. this.getOrderScheduleList();
  1012. //刷新班次的数据
  1013. this.getResourceShiftData();
  1014. }
  1015. });
  1016. },
  1017. /*关闭modal*/
  1018. closeDialog(){
  1019. this.$emit('update:visible', false);
  1020. },
  1021. /*获取派工单的信息*/
  1022. getOrderScheduleList() {
  1023. getOrderScheduleList(this.pageData).then(({data}) => {
  1024. this.orderScheduleList = data.rows;
  1025. })
  1026. },
  1027. /*获取机台班次信息的方法*/
  1028. getResourceShiftData() {
  1029. let queryData = {
  1030. site: this.$store.state.user.site,
  1031. workCenterNo: this.pageData.workCenterNo,
  1032. resourceId: this.pageData.resourceId,
  1033. scheduleDate: this.pageData.scheduleDate
  1034. }
  1035. getResourceRestList(queryData).then(({data}) => {
  1036. this.resourceShiftList = data.rows
  1037. this.pageData.calendarId = data.calendarRow.calendarId;
  1038. this.pageData.calendarDesc = data.calendarRow.calendarDesc;
  1039. })
  1040. },
  1041. /*刷新页面table*/
  1042. refreshPageTables(){
  1043. this.getOrderScheduleList();
  1044. //刷新机台班次的信息
  1045. this.getResourceShiftData();
  1046. },
  1047. /*开始排产*/
  1048. startScheduleOrderBun(){
  1049. let scheduledQty = this.pageData.scheduledQty;
  1050. if(scheduledQty == null || scheduledQty == ''){
  1051. this.$message.error('请输入本次排产数量!')
  1052. return false;
  1053. }
  1054. //判断数量是否超限
  1055. if(this.pageData.scheduledQty <= 0){
  1056. this.$message.error('本次排产数量必须大于零!')
  1057. return false;
  1058. }
  1059. //验证可用机台
  1060. let resourceId = this.pageData.resourceId;
  1061. if(resourceId == null || resourceId == '' || resourceId == '请选择'){
  1062. this.$message.error('请选择可用机台!')
  1063. return false;
  1064. }
  1065. let qtyToSchedule = parseFloat(this.pageData.qtyToSchedule);
  1066. if(qtyToSchedule < scheduledQty){
  1067. this.$message.error('排产数量超过本次待排产数量!')
  1068. return false;
  1069. }
  1070. //执行排产时的操作
  1071. this.scheduleOrderOperation(true);
  1072. },
  1073. /*排产生产工单*/
  1074. scheduleOrderOperation(checkFlag){
  1075. //设置是否校验数量
  1076. this.pageData.checkFlag = checkFlag;
  1077. scheduleOrderWithExpand(this.pageData).then(({data}) => {
  1078. if(data.code == 500){
  1079. this.$message.error(data.msg);
  1080. }else if(data.code == 201){
  1081. this.$confirm(data.msg, '提示', {
  1082. confirmButtonText: '确认',
  1083. celButtonText: '取消',
  1084. type: 'warning'
  1085. }).then(() => {
  1086. //排产不校验
  1087. this.scheduleOrderOperation(false);
  1088. });
  1089. }else{
  1090. //清掉上一次排产数量
  1091. this.pageData.scheduledQty = 0;
  1092. this.$message.success(data.msg);
  1093. //判断是否是分批排产
  1094. if(this.pageData.closeModal == 'N'){
  1095. //刷新明细的报工页面
  1096. this.refreshShopOrderData();
  1097. //刷新列表
  1098. this.getOrderScheduleList();
  1099. }else{
  1100. //关闭当前的页面
  1101. this.closeDialog();
  1102. }
  1103. //后续排产都要校验数量
  1104. this.pageData.checkFlag = true;
  1105. }
  1106. });
  1107. },
  1108. /*提示取消派工单*/
  1109. warnCancelScheduleConfirm(row, $event, column) {
  1110. //提示操作
  1111. this.$confirm('确实要取消该派工单吗?', '提示', {
  1112. confirmButtonText: '确认',
  1113. celButtonText: '取消',
  1114. type: 'warning'
  1115. }).then(() => {
  1116. //执行创建新卷的操作
  1117. this.cancelScheduleBun(row);
  1118. });
  1119. },
  1120. /*取消派工单的操作*/
  1121. cancelScheduleBun(scheduleRow) {
  1122. //设置参数
  1123. this.pageData.orderNo = scheduleRow.orderNo;
  1124. this.pageData.itemNo = scheduleRow.itemNo;
  1125. this.pageData.seqNo = scheduleRow.seqNo;
  1126. this.pageData.scheduledQty = scheduleRow.qtyRequired;
  1127. this.pageData.workCenterNo = scheduleRow.workCenterNo;
  1128. this.pageData.resourceId = scheduleRow.resourceId;
  1129. this.pageData.scheduleSeqNo = scheduleRow.scheduledSeqNo;
  1130. this.pageData.planStartTime = scheduleRow.planStartTime;
  1131. //取消排产
  1132. cancelSoSchedule(this.pageData).then(({data}) => {
  1133. if (data.code == 500) {
  1134. this.$message.error(data.msg);
  1135. } else {
  1136. this.$message.success(data.msg);
  1137. //刷新页面的数据
  1138. this.refreshShopOrderData();
  1139. //刷新列表
  1140. this.getOrderScheduleList();
  1141. }
  1142. });
  1143. },
  1144. },
  1145. created() {
  1146. //执行查询休息时间数据
  1147. }
  1148. }
  1149. </script>
  1150. <!--当前页面的标签样式-->
  1151. <style scoped lang="scss">
  1152. /*针对el-card*/
  1153. .customer-card .el-form-item__content{
  1154. margin-top: -15px;
  1155. }
  1156. .customer-card .el-form-item{
  1157. height: 22px;
  1158. }
  1159. .customer-border .el-form-item__content{
  1160. margin-top: -30px;
  1161. }
  1162. /*全局年与日类型 宽度*/
  1163. div.el-time-width{
  1164. width: 110px !important;
  1165. }
  1166. /* 全局时间右边框*/
  1167. .customer-css input.el-input__inner{
  1168. height: 22px !important;
  1169. padding-right: 0px !important;
  1170. }
  1171. /* 控制el-card标签的数据*/
  1172. div.customer-el-card {
  1173. margin-left: 110px;
  1174. margin-top: -15px;
  1175. height: 20px;
  1176. width: 60px;
  1177. }
  1178. /* 颜色控制 */
  1179. div.customer-el-card-pink {
  1180. background: #FF00FF;
  1181. }
  1182. div.customer-el-card-orange {
  1183. background: #FFD700;
  1184. }
  1185. div.customer-el-card-blue {
  1186. background: #0000CD;
  1187. }
  1188. /*清掉样式*/
  1189. .el-radio+.el-radio {
  1190. margin-left: 0px;
  1191. }
  1192. /*当前按钮的通用样式*/
  1193. .customer-css .customer-bun-mid{
  1194. width: 60px;
  1195. text-align: center;
  1196. }
  1197. .customer-css .customer-bun-min{
  1198. width: 50px;
  1199. text-align: center;
  1200. }
  1201. .customer-css .customer-bun-max{
  1202. width: 80px;
  1203. text-align: center;
  1204. }
  1205. /*当前按钮的通用样式*/
  1206. .customer-css .el-button--medium {
  1207. padding: 5px 5px;
  1208. }
  1209. /*灰色的表格行背景颜色*/
  1210. .customer-css /deep/ tr.customer-row-gray:hover {
  1211. background: #7e819e;
  1212. }
  1213. /*灰色的表格行背景颜色*/
  1214. .customer-css /deep/ tr.customer-row-gray > td{
  1215. background: #7e819e;
  1216. }
  1217. /*添加主菜单和明细菜单的样式*/
  1218. .customer-css .customer-dropdown .el-button--primary{
  1219. padding: 2px;
  1220. font-size: 12px;
  1221. }
  1222. /*设置间距*/
  1223. .el-dropdown-menu /deep/ li.customer-li{
  1224. font-size: 12px;
  1225. line-height: 16px;
  1226. padding: 4px 8px;
  1227. }
  1228. .el-input /deep/ .el-icon-time{
  1229. display: none;
  1230. }
  1231. /*modal中table的样式*/
  1232. .customer-css /deep/ .el-table__header th.is-leaf{
  1233. line-height: 16px;
  1234. }
  1235. </style>