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

677 lines
22 KiB

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