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

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