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

631 lines
20 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  4. <el-form-item :label="'生产订单号'">
  5. <el-input v-model="searchData.orderNo" style="width: 130px"></el-input>
  6. </el-form-item>
  7. <el-form-item >
  8. <span slot="label" style="" @click="getBaseList(24)"><a herf="#">加工中心编码</a></span>
  9. <el-input v-model="searchData.sWorkCenterNo" style="width: 130px"></el-input>
  10. </el-form-item>
  11. <el-form-item >
  12. <span slot="label" style="" @click="getBaseList(5)"><a herf="#">产品编码</a></span>
  13. <el-input v-model="searchData.partNo" style="width: 120px"></el-input>
  14. </el-form-item>
  15. <el-form-item :label="'工序编号'">
  16. <el-input v-model="searchData.itemNo" style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'派工单类型'">
  19. <el-select v-model="searchData.scheduleType" style="width: 120px">
  20. <el-option label="全部" value=""></el-option>
  21. <el-option label="生产订单派工单" value="生产订单派工单"></el-option>
  22. <el-option label="日计划派工单" value="日计划派工单"></el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item :label="'是否报工完成'">
  26. <el-select v-model="searchData.reportFlag" style="width: 120px">
  27. <el-option label="全部" value=""></el-option>
  28. <el-option label="是" value="QtyReported>=QtyRequired"></el-option>
  29. <el-option label="否" value="QtyRequired>QtyReported"></el-option>
  30. </el-select>
  31. </el-form-item>
  32. </el-form>
  33. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  34. <el-form-item :label="'派工日期:'">
  35. <el-date-picker
  36. style="width: 130px"
  37. v-model="searchData.startDate"
  38. value-format="yyyy-MM-dd"
  39. placeholder="选择日期">
  40. </el-date-picker>
  41. </el-form-item>
  42. <el-form-item :label="'至: '">
  43. <el-date-picker
  44. style="width: 130px"
  45. v-model="searchData.endDate"
  46. type="date"
  47. value-format="yyyy-MM-dd"
  48. placeholder="选择日期">
  49. </el-date-picker>
  50. </el-form-item>
  51. <el-form-item >
  52. <span slot="label" style="" @click="getBaseList(26)"><a herf="#">操作员姓名</a></span>
  53. <el-input v-model="searchData.operatorName" style="width: 120px"></el-input>
  54. </el-form-item>
  55. <el-form-item >
  56. <span slot="label" style="" @click="getBaseList(88)"><a herf="#">机台ID</a></span>
  57. <el-input v-model="searchData.sResourceID" style="width: 120px"></el-input>
  58. </el-form-item>
  59. <el-form-item :label="'班次'">
  60. <el-select v-model="searchData.sShiftNo" style="width: 120px">
  61. <el-option label="全部" value=""></el-option>
  62. <el-option label="白班" value="白班"></el-option>
  63. <el-option label="晚班" value="晚班"></el-option>
  64. </el-select>
  65. </el-form-item>
  66. <el-form-item :label="'是否关闭'">
  67. <el-select v-model="searchData.closedFlag" style="width: 120px">
  68. <el-option label="全部" value=""></el-option>
  69. <el-option label="是" value="Y"></el-option>
  70. <el-option label="否" value="N"></el-option>
  71. </el-select>
  72. </el-form-item>
  73. <el-form-item :label="' '">
  74. <el-button @click="search()" style="margin-left: 0px;margin-top:0px" type="primary">查询</el-button>
  75. <download-excel
  76. :fields="exportDataStandard"
  77. :data="tableData"
  78. type="xlsx"
  79. :name="exportName"
  80. :header="exportHeader"
  81. :footer="exportFooter"
  82. :defaultValue="exportDefaultValue"
  83. :fetch="createExportData"
  84. :before-generate="startDownload"
  85. :before-finish="finishDownload"
  86. worksheet="导出信息"
  87. class="el-button el-button--primary el-button--medium">
  88. {{'导出'}}
  89. </download-excel>
  90. </el-form-item>
  91. </el-form>
  92. <el-table
  93. :height="height"
  94. :data="tableData"
  95. border
  96. style="width: 100%">
  97. <el-table-column
  98. prop=""
  99. header-align="center"
  100. align="center"
  101. min-width="160"
  102. label="操作">
  103. <template slot-scope="scope" class="foo_container">
  104. <a type="text" size="small" @click="circulation(scope.row)">流转</a>
  105. <a type="text" size="small" @click="closeSchedule(scope.row)">关闭派工单</a>
  106. </template>
  107. </el-table-column>
  108. <el-table-column
  109. prop="seqNo"
  110. header-align="center"
  111. align="left"
  112. min-width="70"
  113. label="派工单号">
  114. </el-table-column>
  115. <el-table-column
  116. prop="orderNo"
  117. header-align="center"
  118. align="left"
  119. min-width="100"
  120. label="关联单号">
  121. </el-table-column>
  122. <el-table-column
  123. prop="scheduleType"
  124. header-align="center"
  125. align="left"
  126. min-width="100"
  127. label="关联单号类型">
  128. </el-table-column>
  129. <el-table-column
  130. prop="itemNo"
  131. header-align="center"
  132. align="left"
  133. min-width="70"
  134. label="工序号">
  135. </el-table-column>
  136. <el-table-column
  137. prop="itemDesc"
  138. header-align="center"
  139. align="left"
  140. min-width="160"
  141. label="工序名称">
  142. </el-table-column>
  143. <el-table-column
  144. prop="qtyRequired"
  145. header-align="center"
  146. align="right"
  147. min-width="80"
  148. label="派工数量">
  149. </el-table-column>
  150. <el-table-column
  151. prop="qtyReported"
  152. header-align="center"
  153. align="right"
  154. min-width="80"
  155. label="报工数量">
  156. </el-table-column>
  157. <el-table-column
  158. prop="qtyApprove"
  159. header-align="center"
  160. align="right"
  161. min-width="80"
  162. label="合格数量">
  163. </el-table-column>
  164. <el-table-column
  165. prop="closedFlag"
  166. header-align="center"
  167. align="left"
  168. min-width="80"
  169. label="是否关闭">
  170. </el-table-column>
  171. <el-table-column
  172. prop="timeRequired"
  173. header-align="center"
  174. align="right"
  175. min-width="80"
  176. label="需求时间">
  177. </el-table-column>
  178. <el-table-column
  179. prop="sScheduledDate"
  180. header-align="center"
  181. align="left"
  182. min-width="80"
  183. label="派工日期">
  184. </el-table-column>
  185. <el-table-column
  186. prop="operatorName"
  187. header-align="center"
  188. align="left"
  189. min-width="80"
  190. label="操作员姓名">
  191. </el-table-column>
  192. <el-table-column
  193. prop="partNo"
  194. header-align="center"
  195. align="left"
  196. min-width="80"
  197. label="产品编码">
  198. </el-table-column>
  199. <el-table-column
  200. prop="partDesc"
  201. header-align="center"
  202. align="left"
  203. min-width="200"
  204. label="产品名称">
  205. </el-table-column>
  206. <el-table-column
  207. prop="sResourceID"
  208. header-align="center"
  209. align="left"
  210. min-width="70"
  211. label="机台ID">
  212. </el-table-column>
  213. <el-table-column
  214. prop="sShiftNo"
  215. header-align="center"
  216. align="left"
  217. min-width="70"
  218. label="班次">
  219. </el-table-column>
  220. <el-table-column
  221. prop="sWorkCenterNo"
  222. header-align="center"
  223. align="left"
  224. min-width="100"
  225. label="加工中心编码">
  226. </el-table-column>
  227. <el-table-column
  228. prop="circulationSeqNo"
  229. header-align="center"
  230. align="right"
  231. min-width="90"
  232. label="流转派工单号">
  233. </el-table-column>
  234. <el-table-column
  235. prop="circulationQty"
  236. header-align="center"
  237. align="right"
  238. min-width="80"
  239. label="流转数量">
  240. </el-table-column>
  241. </el-table>
  242. <el-dialog title="流转派工单" :close-on-click-modal="false" v-drag :visible.sync="circulationFlag" width="600px">
  243. <el-form :inline="true" label-position="top" style="margin-left: 0px;margin-top: -5px;">
  244. <el-form-item :label="'派工单号:'">
  245. <el-input v-model="circulationData.seqNo" ref="start" type="number" style="width: 130px;" readonly></el-input>
  246. </el-form-item>
  247. <el-form-item :label="'派工日期:'">
  248. <!-- <el-input v-model="circulationData.sScheduledDate" ref="start" type="number" style="width: 130px;" readonly></el-input>-->
  249. <el-date-picker
  250. style="width: 130px"
  251. v-model="circulationData.sScheduledDate"
  252. type="date"
  253. value-format="yyyy-MM-dd"
  254. readonly
  255. placeholder="选择日期">
  256. </el-date-picker>
  257. </el-form-item>
  258. <el-form-item :label="'未完成数量:'">
  259. <el-input v-model="circulationData.circulationQty" ref="start" type="number" style="width: 130px;" readonly></el-input>
  260. </el-form-item>
  261. </el-form>
  262. <el-form :inline="true" label-position="top" style="margin-left: 0px;margin-top: 5px;">
  263. <el-form-item :label="'流转日期:'">
  264. <el-date-picker
  265. style="width: 130px"
  266. v-model="circulationData.circulationDate"
  267. type="date"
  268. value-format="yyyy-MM-dd"
  269. placeholder="选择日期">
  270. </el-date-picker>
  271. </el-form-item>
  272. <el-form-item label="派工机台:">
  273. <el-select v-model="circulationData.sResourceID" style="width: 130px"
  274. placeholder="请选择">
  275. <el-option
  276. v-for="(item,index) in availableResourceList"
  277. :key="index"
  278. :label="item.ResouceDesc"
  279. :value="item.ResourceID"
  280. >
  281. </el-option>
  282. </el-select>
  283. </el-form-item>
  284. <el-form-item label="派工班次:">
  285. <el-select v-model="circulationData.sShiftNo" style="width: 130px"
  286. placeholder="请选择">
  287. <el-option label="白班" value="白班"></el-option>
  288. <el-option label="晚班" value="晚班"></el-option>
  289. </el-select>
  290. </el-form-item>
  291. <el-form-item label="派工人员:">
  292. <el-select v-model="circulationData.operatorId" style="width: 130px"
  293. placeholder="请选择">
  294. <el-option v-for="item in operatorIdList " :key="index" :label="item.operatorName"
  295. :value="item.operatorID">
  296. </el-option>
  297. </el-select>
  298. </el-form-item>
  299. </el-form>
  300. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  301. <el-button type="primary" @click="doCirculation()">流转</el-button>
  302. <el-button type="primary" @click="circulationFlag = false">关闭</el-button>
  303. </el-footer>
  304. </el-dialog>
  305. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  306. </div>
  307. </template>
  308. <script>
  309. import {
  310. getWorkCenterOperatorList,
  311. getAvailableResourceList,
  312. } from "@/api/production.js"
  313. import {
  314. getSOScheduleRoutingData
  315. , cancelJob,
  316. circulationSchedule,
  317. closeSchedule
  318. } from '@/api/production/generateReport.js'
  319. import Chooselist from '@/views/modules/common/Chooselist'
  320. import {
  321. printSeqNoLabel,
  322. } from "@/views/modules/production/print_seqNo_label.js"
  323. export default {
  324. name: 'closeSchedule',
  325. components: {
  326. Chooselist
  327. },
  328. data () {
  329. return {
  330. setUp: {
  331. reviewFlag: false,
  332. saveButton: false,
  333. readonlyFlag: false,
  334. disabled: false
  335. },
  336. circulationData:{
  337. site:'',
  338. seqNo:'',
  339. sScheduledDate:'',
  340. circulationQty:'',
  341. circulationDate:'',
  342. sResourceID:'',
  343. sShiftNo:'',
  344. operatorId:'',
  345. },
  346. availableResourceList:[],
  347. operatorIdList:[],
  348. saveHeaderData: {
  349. site: '',
  350. seqNo: '',
  351. itemNo: '',
  352. partNo: '',
  353. partDescription: '',
  354. operationDesc: '',
  355. workCenterNo: '',
  356. workCenterDesc: '',
  357. operatorId: '',
  358. operatorName: '',
  359. planStartTime: '',
  360. planFinishTime: '',
  361. qtyReported: 0,
  362. qtyApprove: 0,
  363. qtyRework: 0,
  364. operatorId2: '',
  365. operatorIdName2: '',
  366. scrapReason: '',
  367. preparationTime: 0,
  368. manufacturingTime: 0,
  369. cleaningTime: 0,
  370. shutdownReason: '',
  371. remark: '',
  372. orderRef1:'',
  373. scheduleType:'',
  374. userId:'',
  375. },
  376. sopFlag:false,
  377. site: this.$store.state.user.site,
  378. operatorType: 0,
  379. // 导出 start
  380. exportData: [],
  381. exportDataStandard: {
  382. '派工单号': 'seqNo',
  383. '关联单号': 'orderNo',
  384. '关联单号类型': 'scheduleType',
  385. '工序号': 'itemNo',
  386. '工序名称': 'itemDesc',
  387. '派工数量': 'qtyRequired',
  388. '报工数量': 'qtyReported',
  389. '合格数量': 'qtyApprove',
  390. '需求时间': 'timeRequired',
  391. '派工日期': 'sScheduledDate',
  392. '操作员姓名': 'operatorName',
  393. '产品编码': 'partNo',
  394. '产品名称': 'partDesc',
  395. '机台ID': 'sResourceID',
  396. '班次': 'sShiftNo',
  397. '加工中心': 'sWorkCenterNo',
  398. },
  399. exportName: '派工单列表' + this.getStrDate(),
  400. exportHeader: ['派工单列表'],
  401. exportFooter: [],
  402. exportDefaultValue: '这一行这一列没有数据',
  403. // 导出 end
  404. height: 200,
  405. tableData: [],
  406. date1: '',
  407. searchData: {
  408. orderNo: '',
  409. sWorkCenterNo: '',
  410. partNo: '',
  411. site: this.$store.state.user.site,
  412. itemNo:'',
  413. scheduleType:'',
  414. reportFlag:'QtyRequired>QtyReported',
  415. startDate:'',
  416. endDate:'',
  417. operatorName:'',
  418. sResourceID:'',
  419. sShiftNo:'',
  420. closedFlag:'',
  421. },
  422. photoUrl:'',
  423. sopData:{
  424. site:'',
  425. partNo:'',
  426. },
  427. partDescription:'',
  428. fileTitle:'',
  429. fileName:'',
  430. num:1,
  431. currentData:'',
  432. photoDatas:[],
  433. uploadImg:[],
  434. showviewer: false,
  435. url: '',
  436. height2:600,
  437. circulationFlag:false,
  438. }
  439. },
  440. mounted () {
  441. this.$nextTick(() => {
  442. this.height = window.innerHeight - 210
  443. this.height2 = window.innerHeight -100
  444. })
  445. },
  446. methods: {
  447. // 获取基础数据列表S
  448. getBaseList (val, type) {
  449. this.tagNo = val
  450. this.$nextTick(() => {
  451. let strVal = ''
  452. if (val === 24) {
  453. strVal = this.searchData.sWorkCenterNo
  454. }
  455. if (val === 5) {
  456. strVal = this.searchData.partNo
  457. }
  458. if (val === 26) {
  459. strVal = this.searchData.operatorName
  460. }
  461. if (val === 88) {
  462. strVal = this.searchData.sResourceID
  463. }
  464. this.$refs.baseList.init(val, strVal)
  465. })
  466. },
  467. /* 列表方法的回调 */
  468. getBaseData (val) {
  469. if (this.tagNo === 24) {
  470. this.searchData.sWorkCenterNo = val.WorkCenterNo
  471. } else if (this.tagNo === 5) {
  472. this.searchData.partNo = val.PartNo
  473. }
  474. if (this.tagNo === 26) {
  475. this.searchData.operatorName = val.OperatorName
  476. }
  477. if (this.tagNo === 88) {
  478. this.searchData.sResourceID = val.ResourceID
  479. }
  480. },
  481. search () {
  482. getSOScheduleRoutingData(this.searchData).then(({data}) => {
  483. this.tableData = data.rows
  484. })
  485. },
  486. createExportData () {
  487. return this.tableData
  488. },
  489. startDownload () {
  490. // this.exportData = this.dataList
  491. },
  492. finishDownload () {
  493. },
  494. getStrDate () {
  495. let dd = new Date()
  496. let Y = dd.getFullYear()
  497. let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 获取当前月份的日期,不足10补0
  498. let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 获取当前几号,不足10补0
  499. let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
  500. let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
  501. let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
  502. return Y + M + D + H + MM + S
  503. },
  504. circulation(row){
  505. this.getWorkCenterOperatorList(row);
  506. this.getAvailableResourceList(row);
  507. this.circulationData.seqNo=row.seqNo;
  508. this.circulationData.sScheduledDate=row.sScheduledDate;
  509. this.circulationData.circulationQty=row.qtyRequired-row.qtyApprove;
  510. this.circulationData.site=row.site;
  511. this.circulationData.circulationDate='';
  512. this.circulationData.sResourceID='';
  513. this.circulationData.sShiftNo='';
  514. this.circulationData.operatorId='';
  515. this.circulationFlag=true;
  516. },
  517. doCirculation(){
  518. if(this.circulationData.circulationDate==''||this.circulationData.circulationDate==null){
  519. this.$alert('请选择流转日期!', '错误', {
  520. confirmButtonText: '确定'
  521. })
  522. return false;
  523. }
  524. if(this.circulationData.sResourceID==''||this.circulationData.sResourceID==null){
  525. this.$alert('请选择机台!', '错误', {
  526. confirmButtonText: '确定'
  527. })
  528. return false;
  529. }
  530. if(this.circulationData.sShiftNo==''||this.circulationData.sShiftNo==null){
  531. this.$alert('请选择班次!', '错误', {
  532. confirmButtonText: '确定'
  533. })
  534. return false;
  535. }
  536. if(this.circulationData.operatorId==''||this.circulationData.operatorId==null){
  537. this.$alert('请选择操作员!', '错误', {
  538. confirmButtonText: '确定'
  539. })
  540. return false;
  541. }
  542. circulationSchedule(this.circulationData).then(({data}) => {
  543. if (data && data.code === 0) {
  544. this.circulationFlag=false;
  545. this.search ();
  546. this.$message({
  547. message: '操作成功',
  548. type: 'success',
  549. duration: 1500,
  550. onClose: () => {
  551. }
  552. })
  553. } else {
  554. this.$alert(data.msg, '错误', {
  555. confirmButtonText: '确定'
  556. })
  557. }
  558. })
  559. },
  560. closeSchedule(row){
  561. this.$confirm(`确定关闭此派工单`, '提示', {
  562. confirmButtonText: '确定',
  563. cancelButtonText: '取消',
  564. type: 'warning'
  565. }).then(() => {
  566. closeSchedule(row).then(({data}) => {
  567. if (data && data.code === 0) {
  568. this.search();
  569. this.$message({
  570. message: '操作成功',
  571. type: 'success',
  572. duration: 1500,
  573. onClose: () => {
  574. }
  575. })
  576. } else {
  577. this.$alert(data.msg, '错误', {
  578. confirmButtonText: '确定'
  579. })
  580. }
  581. })
  582. })
  583. },
  584. getWorkCenterOperatorList(row){
  585. let inData={
  586. site:row.site,
  587. workCenterNo:row.sWorkCenterNo,
  588. }
  589. getWorkCenterOperatorList(inData).then(({data}) => {
  590. this.operatorIdList = data.rows;
  591. })
  592. },
  593. getAvailableResourceList(row){
  594. let inData={
  595. site:row.site,
  596. orderNo:row.orderNo,
  597. itemNo:row.itemNo,
  598. }
  599. getAvailableResourceList(inData).then(({data}) => {
  600. this.availableResourceList = data.rows;
  601. })
  602. },
  603. },
  604. created () {
  605. }
  606. }
  607. </script>
  608. <style scoped>
  609. .input_left{
  610. text-align: left;
  611. }
  612. .input_reight{
  613. text-align: right;
  614. }
  615. /deep/ input::-webkit-inner-spin-button {
  616. -webkit-appearance: none !important;
  617. }
  618. input[type='number'] {
  619. -moz-appearance: textfield !important;
  620. }
  621. </style>