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.

640 lines
22 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
  1. <template>
  2. <div class="customer-css">
  3. <el-dialog title="生产订单-工艺路线维护" v-drag v-bind="$attrs" v-on="$listeners" width="800px" class="customer-dialog" >
  4. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -5px;">
  5. <el-form-item :label="'订单号:'">
  6. <el-input v-model="searchData.orderNo" class="customer-input-color-red" readonly style="width: 130px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'物料编码:'">
  9. <el-input v-model="searchData.partNo" class="customer-input-color-red" readonly style="width: 130px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'物料名称/规格:'">
  12. <el-input v-model="searchData.partDesc" class="customer-input-color-red" readonly style="width: 260px"></el-input>
  13. </el-form-item>
  14. <el-form-item :label="'工厂编号:'">
  15. <el-input v-model="searchData.site" class="customer-input-color-red" readonly style="width: 130px"></el-input>
  16. </el-form-item>
  17. </el-form>
  18. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  19. <el-button class="customer-bun-min" type="primary" @click="addModel" style="margin-left: 0px; margin-bottom: 0px;">新增</el-button>
  20. <el-button class="customer-bun-min" type="primary" @click="updateModel" style="margin-left: 0px; margin-bottom: 0px;">编辑</el-button>
  21. <el-button class="customer-bun-min" type="primary" @click="deleteSORoutingData" style="margin-left: 0px; margin-bottom: 0px;">删除</el-button>
  22. </el-form>
  23. <el-table
  24. :height="height"
  25. :data="dataList"
  26. border
  27. @row-click="clickData"
  28. highlight-current-row
  29. v-loading="dataListLoading"
  30. style="width: 100%;">
  31. <el-table-column
  32. v-for="(item,index) in columnList" :key="index"
  33. :sortable="item.columnSortable"
  34. :prop="item.columnProp"
  35. :header-align="item.headerAlign"
  36. :show-overflow-tooltip="item.showOverflowTooltip"
  37. :align="item.align"
  38. :fixed="item.fixed"
  39. :width="item.columnWidth"
  40. :label="item.columnLabel">
  41. <template slot-scope="scope">
  42. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  43. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  44. style="width: 100px; height: 80px"/></span>
  45. </template>
  46. </el-table-column>
  47. </el-table>
  48. </el-dialog>
  49. <el-dialog title="维护工艺路线明细" :close-on-click-modal="false" v-drag :visible.sync="addModelFlag" width="660px">
  50. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
  51. <el-form-item :label="'工序号:'">
  52. <el-input v-model="detailData.itemNo" class="customer-input-color-red" readonly style="width: 130px;text-align: right" type="number"></el-input>
  53. </el-form-item>
  54. <el-form-item :label="'工序名称:'">
  55. <el-input v-model="detailData.operationDesc" style="width: 130px"></el-input>
  56. </el-form-item>
  57. <el-form-item >
  58. <span slot="label" style="" @click="getBaseList(24)"><a herf="#">加工中心编码</a></span>
  59. <el-input v-model="detailData.workCenterNo" style="width: 150px"></el-input>
  60. </el-form-item>
  61. <el-form-item :label="'准备时间:'">
  62. <el-input v-model="detailData.machSetupTime" style="width: 150px"></el-input>
  63. </el-form-item>
  64. </el-form>
  65. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
  66. <el-form-item :label="'单位产出量:'">
  67. <el-input v-model="detailData.machRunFactor" type="number" style="width: 130px"></el-input>
  68. </el-form-item>
  69. <el-form-item :label="'产出单位:'">
  70. <el-select filterable v-model="detailData.factorUnit" style="width: 130px">
  71. <el-option label="单位/小时" value="单位/小时"></el-option>
  72. <el-option label="小时" value="小时"></el-option>
  73. </el-select>
  74. </el-form-item>
  75. <el-form-item :label="'计划开工时间:'">
  76. <el-date-picker
  77. v-model="detailData.planStartTime"
  78. type="datetime"
  79. style="width: 150px"
  80. placeholder="选择日期时间">
  81. </el-date-picker>
  82. </el-form-item>
  83. <el-form-item :label="'计划完工时间:'">
  84. <el-date-picker
  85. v-model="detailData.planFinishTime"
  86. type="datetime"
  87. style="width: 150px"
  88. placeholder="选择日期时间">
  89. </el-date-picker>
  90. </el-form-item>
  91. </el-form>
  92. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
  93. <el-form-item :label="'效率:'">
  94. <el-input v-model="detailData.efficiency" type="number" style="width: 130px"></el-input>
  95. </el-form-item>
  96. <el-form-item :label="'操作工人数:'">
  97. <el-input v-model="detailData.crewsize" type="number" style="width: 130px"></el-input>
  98. </el-form-item>
  99. <el-form-item :label="'备注:'">
  100. <el-input v-model="detailData.remark" style="width: 150px"></el-input>
  101. </el-form-item>
  102. </el-form>
  103. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  104. <el-button type="primary" @click="saveSORoutingData()">保存</el-button>
  105. <el-button type="primary" @click="addModelFlag = false">关闭</el-button>
  106. </el-footer>
  107. </el-dialog>
  108. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  109. </div>
  110. </template>
  111. <script>
  112. import Chooselist from '@/views/modules/common/Chooselist'
  113. import {
  114. getSORoutingData,
  115. }from "@/api/base/site.js"
  116. export default {
  117. name: "updateProductRouting",
  118. components: {
  119. Chooselist
  120. },
  121. data () {
  122. return {
  123. searchData:{
  124. orderNo:'',
  125. partNo:'',
  126. partDesc:'',
  127. site:'',
  128. user:this.$store.state.user.name,
  129. },
  130. tagNo:'',
  131. addModelFlag:false,
  132. height:350,
  133. dataList:[],
  134. dataListLoading:false,
  135. currentRow:null,
  136. columnList:[
  137. {
  138. userId: this.$store.state.user.name,
  139. functionId: 6099,
  140. serialNumber: '6099TableItemNo',
  141. tableId: "6099Table",
  142. tableName: "维护工艺路线工序表",
  143. columnProp: "itemNo",
  144. headerAlign: "center",
  145. align: "right",
  146. columnLabel: "工序号",
  147. columnHidden: false,
  148. columnImage: false,
  149. columnSortable: false,
  150. sortLv: 0,
  151. status: true,
  152. fixed: false,
  153. columnWidth: 60
  154. },
  155. {
  156. userId: this.$store.state.user.name,
  157. functionId: 6099,
  158. serialNumber: '6099TableOperationDesc',
  159. tableId: "6099Table",
  160. tableName: "维护工艺路线工序表",
  161. columnProp: "operationDesc",
  162. headerAlign: "center",
  163. align: "left",
  164. columnLabel: "工序名称",
  165. columnHidden: false,
  166. columnImage: false,
  167. columnSortable: false,
  168. sortLv: 0,
  169. status: true,
  170. fixed: false,
  171. columnWidth: 300
  172. },
  173. {
  174. userId: this.$store.state.user.name,
  175. functionId: 6099,
  176. serialNumber: '6099TableWorkCenterNo',
  177. tableId: "6099Table",
  178. tableName: "维护工艺路线工序表",
  179. columnProp: "workCenterNo",
  180. headerAlign: "center",
  181. align: "left",
  182. columnLabel: "加工中心编码",
  183. columnHidden: false,
  184. columnImage: false,
  185. columnSortable: false,
  186. sortLv: 0,
  187. status: true,
  188. fixed: false,
  189. columnWidth: 100
  190. },
  191. {
  192. userId: this.$store.state.user.name,
  193. functionId: 6099,
  194. serialNumber: '6099TableWorkCenterDesc',
  195. tableId: "6099Table",
  196. tableName: "维护工艺路线工序表",
  197. columnProp: "workCenterDesc",
  198. headerAlign: "center",
  199. align: "left",
  200. columnLabel: "加工中心名称",
  201. columnHidden: false,
  202. columnImage: false,
  203. columnSortable: false,
  204. sortLv: 0,
  205. status: true,
  206. fixed: false,
  207. columnWidth: 100
  208. },
  209. {
  210. userId: this.$store.state.user.name,
  211. functionId: 6099,
  212. serialNumber: '6099TableMachSetupTime',
  213. tableId: "6099Table",
  214. tableName: "维护工艺路线工序表",
  215. columnProp: "machSetupTime",
  216. headerAlign: "center",
  217. align: "right",
  218. columnLabel: "准备时间(小时)",
  219. columnHidden: false,
  220. columnImage: false,
  221. columnSortable: false,
  222. sortLv: 0,
  223. status: true,
  224. fixed: false,
  225. columnWidth: 100
  226. },
  227. {
  228. userId: this.$store.state.user.name,
  229. functionId: 6099,
  230. serialNumber: '6099TableMachRunFactor',
  231. tableId: "6099Table",
  232. tableName: "维护工艺路线工序表",
  233. columnProp: "machRunFactor",
  234. headerAlign: "center",
  235. align: "right",
  236. columnLabel: "单位产出量",
  237. columnHidden: false,
  238. columnImage: false,
  239. columnSortable: false,
  240. sortLv: 0,
  241. status: true,
  242. fixed: false,
  243. columnWidth: 100
  244. },
  245. {
  246. userId: this.$store.state.user.name,
  247. functionId: 6099,
  248. serialNumber: '6099TableFactorUnit',
  249. tableId: "6099Table",
  250. tableName: "维护工艺路线工序表",
  251. columnProp: "factorUnit",
  252. headerAlign: "center",
  253. align: "left",
  254. columnLabel: "产出单位",
  255. columnHidden: false,
  256. columnImage: false,
  257. columnSortable: false,
  258. sortLv: 0,
  259. status: true,
  260. fixed: false,
  261. columnWidth: 100
  262. },
  263. {
  264. userId: this.$store.state.user.name,
  265. functionId: 6099,
  266. serialNumber: '6099TableTimeRequired',
  267. tableId: "6099Table",
  268. tableName: "维护工艺路线工序表",
  269. columnProp: "timeRequired",
  270. headerAlign: "center",
  271. align: "right",
  272. columnLabel: "需求时间",
  273. columnHidden: false,
  274. columnImage: false,
  275. columnSortable: false,
  276. sortLv: 0,
  277. status: true,
  278. fixed: false,
  279. columnWidth: 80
  280. },
  281. {
  282. userId: this.$store.state.user.name,
  283. functionId: 6099,
  284. serialNumber: '6099TableTimeReported',
  285. tableId: "6099Table",
  286. tableName: "维护工艺路线工序表",
  287. columnProp: "timeReported",
  288. headerAlign: "center",
  289. align: "right",
  290. columnLabel: "报告时间",
  291. columnHidden: false,
  292. columnImage: false,
  293. columnSortable: false,
  294. sortLv: 0,
  295. status: true,
  296. fixed: false,
  297. columnWidth: 80
  298. },
  299. {
  300. userId: this.$store.state.user.name,
  301. functionId: 6099,
  302. serialNumber: '6099TableEfficiency',
  303. tableId: "6099Table",
  304. tableName: "维护工艺路线工序表",
  305. columnProp: "efficiency",
  306. headerAlign: "center",
  307. align: "right",
  308. columnLabel: "效率(%)",
  309. columnHidden: false,
  310. columnImage: false,
  311. columnSortable: false,
  312. sortLv: 0,
  313. status: true,
  314. fixed: false,
  315. columnWidth: 80
  316. },
  317. {
  318. userId: this.$store.state.user.name,
  319. functionId: 6099,
  320. serialNumber: '6099TableRemark',
  321. tableId: "6099Table",
  322. tableName: "维护工艺路线工序表",
  323. columnProp: "remark",
  324. headerAlign: "center",
  325. align: "left",
  326. columnLabel: "备注",
  327. columnHidden: false,
  328. columnImage: false,
  329. columnSortable: false,
  330. sortLv: 0,
  331. status: true,
  332. fixed: false,
  333. columnWidth: 160
  334. },
  335. {
  336. userId: this.$store.state.user.name,
  337. functionId: 6099,
  338. serialNumber: '6099TableQtyRequired',
  339. tableId: "6099Table",
  340. tableName: "维护工艺路线工序表",
  341. columnProp: "qtyRequired",
  342. headerAlign: "center",
  343. align: "right",
  344. columnLabel: "需求数量",
  345. columnHidden: false,
  346. columnImage: false,
  347. columnSortable: false,
  348. sortLv: 0,
  349. status: true,
  350. fixed: false,
  351. columnWidth: 80
  352. },
  353. {
  354. userId: this.$store.state.user.name,
  355. functionId: 6099,
  356. serialNumber: '6099TableQtyReported',
  357. tableId: "6099Table",
  358. tableName: "维护工艺路线工序表",
  359. columnProp: "qtyReported",
  360. headerAlign: "center",
  361. align: "right",
  362. columnLabel: "计价单位",
  363. columnHidden: false,
  364. columnImage: false,
  365. columnSortable: false,
  366. sortLv: 0,
  367. status: true,
  368. fixed: false,
  369. columnWidth: 80
  370. },
  371. {
  372. userId: this.$store.state.user.name,
  373. functionId: 6099,
  374. serialNumber: '6099TableQtyApprove',
  375. tableId: "6099Table",
  376. tableName: "维护工艺路线工序表",
  377. columnProp: "qtyApprove",
  378. headerAlign: "center",
  379. align: "right",
  380. columnLabel: "合格数量",
  381. columnHidden: false,
  382. columnImage: false,
  383. columnSortable: false,
  384. sortLv: 0,
  385. status: true,
  386. fixed: false,
  387. columnWidth: 80
  388. },
  389. {
  390. userId: this.$store.state.user.name,
  391. functionId: 6099,
  392. serialNumber: '6099TablePlanStartTime',
  393. tableId: "6099Table",
  394. tableName: "维护工艺路线工序表",
  395. columnProp: "planStartTime",
  396. headerAlign: "center",
  397. align: "left",
  398. columnLabel: "计划开工时间",
  399. columnHidden: false,
  400. columnImage: false,
  401. columnSortable: false,
  402. sortLv: 0,
  403. status: true,
  404. fixed: false,
  405. columnWidth: 140
  406. },
  407. {
  408. userId: this.$store.state.user.name,
  409. functionId: 6099,
  410. serialNumber: '6099TablePlanFinishTime',
  411. tableId: "6099Table",
  412. tableName: "维护工艺路线工序表",
  413. columnProp: "planFinishTime",
  414. headerAlign: "center",
  415. align: "left",
  416. columnLabel: "计划完工时间",
  417. columnHidden: false,
  418. columnImage: false,
  419. columnSortable: false,
  420. sortLv: 0,
  421. status: true,
  422. fixed: false,
  423. columnWidth: 140
  424. },
  425. {
  426. userId: this.$store.state.user.name,
  427. functionId: 6099,
  428. serialNumber: '6099TableBarcodeID',
  429. tableId: "6099Table",
  430. tableName: "维护工艺路线工序表",
  431. columnProp: "barcodeID",
  432. headerAlign: "center",
  433. align: "left",
  434. columnLabel: "条形码",
  435. columnHidden: false,
  436. columnImage: false,
  437. columnSortable: false,
  438. sortLv: 0,
  439. status: true,
  440. fixed: false,
  441. columnWidth: 120
  442. },
  443. {
  444. userId: this.$store.state.user.name,
  445. functionId: 6099,
  446. serialNumber: '6099TableCrewsize',
  447. tableId: "6099Table",
  448. tableName: "维护工艺路线工序表",
  449. columnProp: "crewsize",
  450. headerAlign: "center",
  451. align: "left",
  452. columnLabel: "操作工人数",
  453. columnHidden: false,
  454. columnImage: false,
  455. columnSortable: false,
  456. sortLv: 0,
  457. status: true,
  458. fixed: false,
  459. columnWidth: 100
  460. },
  461. {
  462. userId: this.$store.state.user.name,
  463. functionId: 6099,
  464. serialNumber: '6099TableWXPartNo',
  465. tableId: "6099Table",
  466. tableName: "维护工艺路线工序表",
  467. columnProp: "wxPartNo",
  468. headerAlign: "center",
  469. align: "left",
  470. columnLabel: "费用结算料号",
  471. columnHidden: false,
  472. columnImage: false,
  473. columnSortable: false,
  474. sortLv: 0,
  475. status: true,
  476. fixed: false,
  477. columnWidth: 120
  478. },
  479. {
  480. userId: this.$store.state.user.name,
  481. functionId: 6099,
  482. serialNumber: '6099TableWXSpec',
  483. tableId: "6099Table",
  484. tableName: "维护工艺路线工序表",
  485. columnProp: "wxSpec",
  486. headerAlign: "center",
  487. align: "left",
  488. columnLabel: "费用结算物料名称/规格",
  489. columnHidden: false,
  490. columnImage: false,
  491. columnSortable: false,
  492. sortLv: 0,
  493. status: true,
  494. fixed: false,
  495. columnWidth: 250
  496. },
  497. ],
  498. detailData:{
  499. itemNo:'',
  500. operationDesc:'',
  501. workCenterNo:'',
  502. machSetupTime:'',
  503. machRunFactor:'',
  504. factorUnit:'单位/小时',
  505. planStartTime:'',
  506. planFinishTime:'',
  507. efficiency:'',
  508. crewsize:'',
  509. remark:'',
  510. site:'',
  511. partNo:'',
  512. revNo:'',
  513. add:'',
  514. user:'',
  515. },
  516. detailmodelInputFlag:false,
  517. }
  518. },
  519. mounted() {
  520. },
  521. watch: {
  522. '$route' (to, from) {
  523. // if(localStorage.getItem('calendar')!=undefined){
  524. // this.jump();
  525. // }
  526. }
  527. },
  528. methods: {
  529. getBaseData(val){
  530. if (this.tagNo === 24){
  531. this.detailData.workCenterNo = val.WorkCenterNo
  532. }
  533. },
  534. // 获取基础数据列表
  535. getBaseList(val){
  536. this.tagNo = val
  537. this.$nextTick(() => {
  538. let strVal = "";
  539. if (val === 24){
  540. strVal = this.detailData.workCenterNo
  541. }
  542. this.$refs.baseList.init(val,strVal)
  543. })
  544. },
  545. init(searchData){
  546. //设置参数
  547. this.searchData = searchData;
  548. //调用方法
  549. this.getData();
  550. },
  551. getData(){
  552. getSORoutingData(this.searchData).then(({data}) => {
  553. this.dataList = data.rows;
  554. if(data.total==0){
  555. this.dataList =[];
  556. }
  557. })
  558. },
  559. clickData(row){
  560. this.currentRow = JSON.parse(JSON.stringify(row));
  561. },
  562. addModel(){
  563. this.detailData={
  564. itemNo:'',
  565. operationDesc:'',
  566. workCenterNo:'',
  567. machSetupTime:'',
  568. machRunFactor:'',
  569. factorUnit:'单位/小时',
  570. planStartTime:'',
  571. planFinishTime:'',
  572. efficiency:'',
  573. crewsize:'',
  574. remark:'',
  575. site:'',
  576. partNo:'',
  577. revNo:'',
  578. add:0,
  579. user:this.$store.state.user.name,
  580. };
  581. if(this.dataList===[]){
  582. this.detailData.itemNo=10;
  583. }else {
  584. this.detailData.itemNo=this.dataList[0].itemNo;
  585. for (let i = 0; i < this.dataList.length; i++) {
  586. if(this.detailData.itemNo<this.dataList[i].itemNo){
  587. this.detailData.itemNo=this.dataList[i].itemNo
  588. }
  589. }
  590. this.detailData.itemNo+=10;
  591. }
  592. this.addModelFlag=true;
  593. },
  594. updateModel(){
  595. if(this.currentRow==null){
  596. this.$alert('请选择工序', '错误', {
  597. confirmButtonText: '确定'
  598. })
  599. return false;
  600. }
  601. this.detailData={
  602. itemNo:this.currentRow.itemNo,
  603. operationDesc:this.currentRow.operationDesc,
  604. workCenterNo:this.currentRow.workCenterNo,
  605. machSetupTime:this.currentRow.machSetupTime,
  606. machRunFactor:this.currentRow.machRunFactor,
  607. factorUnit:this.currentRow.factorUnit,
  608. planStartTime:this.currentRow.planStartTime,
  609. planFinishTime:this.currentRow.planFinishTime,
  610. efficiency:this.currentRow.efficiency,
  611. crewsize:this.currentRow.crewsize,
  612. remark:this.currentRow.remark,
  613. site:this.currentRow.site,
  614. partNo:this.currentRow.partNo,
  615. revNo:this.currentRow.revNo,
  616. add:1,
  617. user:this.$store.state.user.name,
  618. }
  619. this.addModelFlag=true;
  620. },
  621. },
  622. created() {
  623. }
  624. }
  625. </script>
  626. <style scoped>
  627. /*统一的input内容颜色样式*/
  628. .customer-input-color-red /deep/ .el-input__inner {
  629. color: red;
  630. }
  631. </style>