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

646 lines
21 KiB

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