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.

821 lines
30 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
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
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
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
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 >
  5. <span slot="label" style="" @click="getSearchModal()"><a herf="#">物料编码</a></span>
  6. <el-input v-model="mainData.partNo" readonly style="width: 130px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'物料名称/规格型号:'">
  9. <el-input v-model="mainData.spec" readonly style="width: 274px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'状态:'">
  12. <el-input v-model="mainData.status" readonly style="width: 130px"></el-input>
  13. </el-form-item>
  14. <el-form-item :label="'工厂编号:'">
  15. <el-input v-model="mainData.site" 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-form-item :label="'工艺路线类型:'">
  20. <el-input v-model="mainData.routingType" readonly style="width: 130px"></el-input>
  21. </el-form-item>
  22. <el-form-item :label="'版本号:'">
  23. <el-input v-model="mainData.revNo" readonly style="width: 130px"></el-input>
  24. </el-form-item>
  25. <el-form-item :label="'启用日期:'">
  26. <el-input v-model="mainData.phaseInDate" readonly style="width: 130px"></el-input>
  27. </el-form-item>
  28. <el-form-item :label="'停用日期:'">
  29. <el-input v-model="mainData.phaseOutDate" readonly style="width: 130px"></el-input>
  30. </el-form-item>
  31. <el-form-item :label="'计量单位:'">
  32. <el-input v-model="mainData.umid" readonly style="width: 130px"></el-input>
  33. </el-form-item>
  34. </el-form>
  35. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  36. <el-form-item :label="'备注:'">
  37. <el-input v-model="mainData.remark" readonly style="width: 417px"></el-input>
  38. <el-checkbox style="margin-left: 20px" disabled v-model="mainData.defaultflag">默认</el-checkbox>
  39. <el-checkbox style="margin-left: 80px" disabled v-model="mainData.repairFlag">修复版本</el-checkbox>
  40. </el-form-item>
  41. </el-form>
  42. <el-tabs v-model="activeName" >
  43. <el-tab-pane :label="'明细'" name="first">
  44. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  45. <el-button @click="addRoutingDetail()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'新增'}}</el-button>
  46. <el-button @click="editRoutingDetail()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'修改'}}</el-button>
  47. <el-button @click="deleteRoutingDetail()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'删除'}}</el-button>
  48. <el-button @click="jumpWorkCenter()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'加工中心'}}</el-button>
  49. <el-button @click="getPartDetail()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'可用机台'}}</el-button>
  50. </el-form>
  51. <el-table
  52. :height="height"
  53. :data="dataList2"
  54. border
  55. @row-click="clickData"
  56. highlight-current-row
  57. v-loading="dataListLoading"
  58. style="width: 100%;">
  59. <el-table-column
  60. v-for="(item,index) in columnList2" :key="index"
  61. :sortable="item.columnSortable"
  62. :prop="item.columnProp"
  63. :header-align="item.headerAlign"
  64. :show-overflow-tooltip="item.showOverflowTooltip"
  65. :align="item.align"
  66. :fixed="item.fixed"
  67. :width="item.columnWidth"
  68. :label="item.columnLabel">
  69. <template slot-scope="scope">
  70. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  71. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  72. style="width: 100px; height: 80px"/></span>
  73. </template>
  74. </el-table-column>
  75. </el-table>
  76. </el-tab-pane>
  77. <el-tab-pane :label="'工具清单'" name="second">
  78. </el-tab-pane>
  79. </el-tabs>
  80. <el-dialog title="数据表" :close-on-click-modal="false" v-drag :visible.sync="modelFlag" width="680px" >
  81. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  82. <el-form-item :label="'物料编码:'">
  83. <el-input v-model="searchPartNo" style="width: 130px"></el-input>
  84. <el-button @click="searchRoutingWithPartNo()" type="primary">查询</el-button>
  85. </el-form-item>
  86. </el-form>
  87. <el-table
  88. height="300"
  89. :data="dataList"
  90. border
  91. @row-dblclick="tableHanddle"
  92. v-loading="dataListLoading"
  93. style="width: 100%;">
  94. <el-table-column
  95. v-for="(item,index) in columnList" :key="index"
  96. :sortable="item.columnSortable"
  97. :prop="item.columnProp"
  98. :header-align="item.headerAlign"
  99. :show-overflow-tooltip="item.showOverflowTooltip"
  100. :align="item.align"
  101. :fixed="item.fixed"
  102. :min-width="item.columnWidth"
  103. :label="item.columnLabel">
  104. <template slot-scope="scope">
  105. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  106. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  107. style="width: 100px; height: 80px"/></span>
  108. </template>
  109. </el-table-column>
  110. </el-table>
  111. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  112. <el-button type="primary" @click="modelFlag = false">关闭</el-button>
  113. </el-footer>
  114. </el-dialog>
  115. <el-dialog title="维护工艺路线明细" :close-on-click-modal="false" v-drag :visible.sync="detailmodelFlag" width="620px">
  116. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
  117. <el-form-item :label="'工序号:'">
  118. <el-input v-model="detailData.itemNo" :disabled="detailmodelInputFlag" style="width: 130px;text-align: right" type="number"></el-input>
  119. </el-form-item>
  120. <el-form-item :label="'工序名称:'">
  121. <el-input v-model="detailData.operationDesc" style="width: 130px"></el-input>
  122. </el-form-item>
  123. <el-form-item :label="'加工中心编码:'">
  124. <el-input v-model="detailData.workCenterNo" style="width: 130px"></el-input>
  125. </el-form-item>
  126. <el-form-item :label="'准备时间:'">
  127. <el-input v-model="detailData.machSetupTime" style="width: 130px"></el-input>
  128. </el-form-item>
  129. </el-form>
  130. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
  131. <el-form-item :label="'单位产出量:'">
  132. <el-input v-model="detailData.machRunFactor" type="number" style="width: 130px"></el-input>
  133. </el-form-item>
  134. <el-form-item :label="'产出单位:'">
  135. <el-select filterable v-model="detailData.factorUnit" style="width: 130px">
  136. <el-option label="" value=""></el-option>
  137. <el-option label="单位/小时" value="单位/小时"></el-option>
  138. <el-option label="小时" value="小时"></el-option>
  139. </el-select>
  140. </el-form-item>
  141. <el-form-item :label="'计价单价:'">
  142. <el-input v-model="detailData.jjgzUnitPrice" type="number" style="width: 130px"></el-input>
  143. </el-form-item>
  144. <el-form-item :label="'单位:'">
  145. <el-select filterable v-model="detailData.jjgzUnitFactor" style="width: 130px">
  146. <el-option label="" value=""></el-option>
  147. <el-option label="小时" value="小时"></el-option>
  148. <el-option label="件" value="件"></el-option>
  149. </el-select>
  150. </el-form-item>
  151. </el-form>
  152. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
  153. <el-form-item :label="'效率:'">
  154. <el-input v-model="detailData.efficiency" type="number" style="width: 130px"></el-input>
  155. </el-form-item>
  156. <el-form-item :label="'操作工人数:'">
  157. <el-input v-model="detailData.crewsize" type="number" style="width: 130px"></el-input>
  158. </el-form-item>
  159. <el-form-item :label="'备注:'">
  160. <el-input v-model="detailData.remark" style="width: 130px"></el-input>
  161. </el-form-item>
  162. </el-form>
  163. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  164. <el-button type="primary" @click="saveRoutingDetailData()">保存</el-button>
  165. <el-button type="primary" @click="detailmodelFlag = false">关闭</el-button>
  166. </el-footer>
  167. </el-dialog>
  168. </div>
  169. </template>
  170. <script>
  171. import {
  172. searchRoutingWithPartNo,
  173. searchRoutingDetailData,
  174. saveRoutingDetailData,
  175. }from "@/api/base/site.js"
  176. export default {
  177. name: "maintainProductRouting",
  178. data () {
  179. return {
  180. dataListLoading: false,
  181. searchPartNo:'',
  182. height:200,
  183. mainData:{
  184. partNo:'',
  185. spec:'',
  186. status:'',
  187. site:'',
  188. routingType:'',
  189. revNo:'',
  190. phaseInDate:'',
  191. phaseOutDate:'',
  192. umid:'',
  193. remark:'',
  194. defaultflag:'',
  195. repairFlag:'',
  196. },
  197. activeName:'first',
  198. modelFlag:false,
  199. detailmodelFlag:false,
  200. detailmodelInputFlag:false,
  201. dataList:[],
  202. dataList2:[],
  203. columnList:[
  204. {
  205. userId: this.$store.state.user.name,
  206. functionId: 6040,
  207. serialNumber: '6040TablePartNo',
  208. tableId: "6040Table",
  209. tableName: "维护工艺路线数据表",
  210. columnProp: "partNo",
  211. headerAlign: "center",
  212. align: "left",
  213. columnLabel: "物料编码",
  214. columnHidden: false,
  215. columnImage: false,
  216. columnSortable: false,
  217. sortLv: 0,
  218. status: true,
  219. fixed: false,
  220. columnWidth: 100
  221. },
  222. {
  223. userId: this.$store.state.user.name,
  224. functionId: 6040,
  225. serialNumber: '6040TableSpec',
  226. tableId: "6040Table",
  227. tableName: "维护工艺路线数据表",
  228. columnProp: "spec",
  229. headerAlign: "center",
  230. align: "left",
  231. columnLabel: "名称/规格",
  232. columnHidden: false,
  233. columnImage: false,
  234. columnSortable: false,
  235. sortLv: 0,
  236. status: true,
  237. fixed: false,
  238. columnWidth: 120
  239. },
  240. {
  241. userId: this.$store.state.user.name,
  242. functionId: 6040,
  243. serialNumber: '6040TableRoutingType',
  244. tableId: "6040Table",
  245. tableName: "维护工艺路线数据表",
  246. columnProp: "routingType",
  247. headerAlign: "center",
  248. align: "left",
  249. columnLabel: "工艺路线类型",
  250. columnHidden: false,
  251. columnImage: false,
  252. columnSortable: false,
  253. sortLv: 0,
  254. status: true,
  255. fixed: false,
  256. columnWidth: 80
  257. },
  258. {
  259. userId: this.$store.state.user.name,
  260. functionId: 6040,
  261. serialNumber: '6040TableRevNo',
  262. tableId: "6040Table",
  263. tableName: "维护工艺路线数据表",
  264. columnProp: "revNo",
  265. headerAlign: "center",
  266. align: "left",
  267. columnLabel: "版本号",
  268. columnHidden: false,
  269. columnImage: false,
  270. columnSortable: false,
  271. sortLv: 0,
  272. status: true,
  273. fixed: false,
  274. columnWidth: 60
  275. },
  276. {
  277. userId: this.$store.state.user.name,
  278. functionId: 6040,
  279. serialNumber: '6040TablePhaseInDate',
  280. tableId: "6040Table",
  281. tableName: "维护工艺路线数据表",
  282. columnProp: "phaseInDate",
  283. headerAlign: "center",
  284. align: "left",
  285. columnLabel: "启用日期",
  286. columnHidden: false,
  287. columnImage: false,
  288. columnSortable: false,
  289. sortLv: 0,
  290. status: true,
  291. fixed: false,
  292. columnWidth: 80
  293. },
  294. {
  295. userId: this.$store.state.user.name,
  296. functionId: 6040,
  297. serialNumber: '6040TablePhaseOutDate',
  298. tableId: "6040Table",
  299. tableName: "维护工艺路线数据表",
  300. columnProp: "phaseOutDate",
  301. headerAlign: "center",
  302. align: "left",
  303. columnLabel: "停用日期",
  304. columnHidden: false,
  305. columnImage: false,
  306. columnSortable: false,
  307. sortLv: 0,
  308. status: true,
  309. fixed: false,
  310. columnWidth: 80
  311. },
  312. {
  313. userId: this.$store.state.user.name,
  314. functionId: 6040,
  315. serialNumber: '6040TableStatus',
  316. tableId: "6040Table",
  317. tableName: "维护工艺路线数据表",
  318. columnProp: "status",
  319. headerAlign: "center",
  320. align: "left",
  321. columnLabel: "状态",
  322. columnHidden: false,
  323. columnImage: false,
  324. columnSortable: false,
  325. sortLv: 0,
  326. status: true,
  327. fixed: false,
  328. columnWidth: 40
  329. },
  330. {
  331. userId: this.$store.state.user.name,
  332. functionId: 6040,
  333. serialNumber: '6040TableSite',
  334. tableId: "6040Table",
  335. tableName: "维护工艺路线数据表",
  336. columnProp: "site",
  337. headerAlign: "center",
  338. align: "left",
  339. columnLabel: "工厂编码",
  340. columnHidden: false,
  341. columnImage: false,
  342. columnSortable: false,
  343. sortLv: 0,
  344. status: true,
  345. fixed: false,
  346. columnWidth: 60
  347. },
  348. ],
  349. columnList2:[
  350. {
  351. userId: this.$store.state.user.name,
  352. functionId: 6040,
  353. serialNumber: '6040Table2ItemNo',
  354. tableId: "6040Table2",
  355. tableName: "维护工艺路线工序表",
  356. columnProp: "itemNo",
  357. headerAlign: "center",
  358. align: "right",
  359. columnLabel: "工序号",
  360. columnHidden: false,
  361. columnImage: false,
  362. columnSortable: false,
  363. sortLv: 0,
  364. status: true,
  365. fixed: false,
  366. columnWidth: 60
  367. },
  368. {
  369. userId: this.$store.state.user.name,
  370. functionId: 6040,
  371. serialNumber: '6040Table2OperationDesc',
  372. tableId: "6040Table2",
  373. tableName: "维护工艺路线工序表",
  374. columnProp: "operationDesc",
  375. headerAlign: "center",
  376. align: "left",
  377. columnLabel: "工序名称",
  378. columnHidden: false,
  379. columnImage: false,
  380. columnSortable: false,
  381. sortLv: 0,
  382. status: true,
  383. fixed: false,
  384. columnWidth: 300
  385. },
  386. {
  387. userId: this.$store.state.user.name,
  388. functionId: 6040,
  389. serialNumber: '6040Table2WorkCenterNo',
  390. tableId: "6040Table2",
  391. tableName: "维护工艺路线工序表",
  392. columnProp: "workCenterNo",
  393. headerAlign: "center",
  394. align: "left",
  395. columnLabel: "加工中心编码",
  396. columnHidden: false,
  397. columnImage: false,
  398. columnSortable: false,
  399. sortLv: 0,
  400. status: true,
  401. fixed: false,
  402. columnWidth: 100
  403. },
  404. {
  405. userId: this.$store.state.user.name,
  406. functionId: 6040,
  407. serialNumber: '6040Table2WorkCenterDesc',
  408. tableId: "6040Table2",
  409. tableName: "维护工艺路线工序表",
  410. columnProp: "workCenterDesc",
  411. headerAlign: "center",
  412. align: "left",
  413. columnLabel: "加工中心名称",
  414. columnHidden: false,
  415. columnImage: false,
  416. columnSortable: false,
  417. sortLv: 0,
  418. status: true,
  419. fixed: false,
  420. columnWidth: 100
  421. },
  422. {
  423. userId: this.$store.state.user.name,
  424. functionId: 6040,
  425. serialNumber: '6040Table2MachSetupTime',
  426. tableId: "6040Table2",
  427. tableName: "维护工艺路线工序表",
  428. columnProp: "machSetupTime",
  429. headerAlign: "center",
  430. align: "right",
  431. columnLabel: "准备时间(小时)",
  432. columnHidden: false,
  433. columnImage: false,
  434. columnSortable: false,
  435. sortLv: 0,
  436. status: true,
  437. fixed: false,
  438. columnWidth: 100
  439. },
  440. {
  441. userId: this.$store.state.user.name,
  442. functionId: 6040,
  443. serialNumber: '6040Table2MachRunFactor',
  444. tableId: "6040Table2",
  445. tableName: "维护工艺路线工序表",
  446. columnProp: "machRunFactor",
  447. headerAlign: "center",
  448. align: "right",
  449. columnLabel: "单位产出量",
  450. columnHidden: false,
  451. columnImage: false,
  452. columnSortable: false,
  453. sortLv: 0,
  454. status: true,
  455. fixed: false,
  456. columnWidth: 100
  457. },
  458. {
  459. userId: this.$store.state.user.name,
  460. functionId: 6040,
  461. serialNumber: '6040Table2FactorUnit',
  462. tableId: "6040Table2",
  463. tableName: "维护工艺路线工序表",
  464. columnProp: "factorUnit",
  465. headerAlign: "center",
  466. align: "left",
  467. columnLabel: "产出单位",
  468. columnHidden: false,
  469. columnImage: false,
  470. columnSortable: false,
  471. sortLv: 0,
  472. status: true,
  473. fixed: false,
  474. columnWidth: 100
  475. },
  476. {
  477. userId: this.$store.state.user.name,
  478. functionId: 6040,
  479. serialNumber: '6040Table2Efficiency',
  480. tableId: "6040Table2",
  481. tableName: "维护工艺路线工序表",
  482. columnProp: "efficiency",
  483. headerAlign: "center",
  484. align: "right",
  485. columnLabel: "效率(%)",
  486. columnHidden: false,
  487. columnImage: false,
  488. columnSortable: false,
  489. sortLv: 0,
  490. status: true,
  491. fixed: false,
  492. columnWidth: 80
  493. },
  494. {
  495. userId: this.$store.state.user.name,
  496. functionId: 6040,
  497. serialNumber: '6040Table2Remark',
  498. tableId: "6040Table2",
  499. tableName: "维护工艺路线工序表",
  500. columnProp: "remark",
  501. headerAlign: "center",
  502. align: "left",
  503. columnLabel: "备注",
  504. columnHidden: false,
  505. columnImage: false,
  506. columnSortable: false,
  507. sortLv: 0,
  508. status: true,
  509. fixed: false,
  510. columnWidth: 160
  511. },
  512. {
  513. userId: this.$store.state.user.name,
  514. functionId: 6040,
  515. serialNumber: '6040Table2JJGZUnitPrice',
  516. tableId: "6040Table2",
  517. tableName: "维护工艺路线工序表",
  518. columnProp: "jjgzUnitPrice",
  519. headerAlign: "center",
  520. align: "right",
  521. columnLabel: "每件计价",
  522. columnHidden: false,
  523. columnImage: false,
  524. columnSortable: false,
  525. sortLv: 0,
  526. status: true,
  527. fixed: false,
  528. columnWidth: 100
  529. },
  530. {
  531. userId: this.$store.state.user.name,
  532. functionId: 6040,
  533. serialNumber: '6040Table2JJGZUnitFactor',
  534. tableId: "6040Table2",
  535. tableName: "维护工艺路线工序表",
  536. columnProp: "jjgzUnitFactor",
  537. headerAlign: "center",
  538. align: "left",
  539. columnLabel: "计价单位",
  540. columnHidden: false,
  541. columnImage: false,
  542. columnSortable: false,
  543. sortLv: 0,
  544. status: true,
  545. fixed: false,
  546. columnWidth: 100
  547. },
  548. {
  549. userId: this.$store.state.user.name,
  550. functionId: 6040,
  551. serialNumber: '6040Table2Crewsize',
  552. tableId: "6040Table2",
  553. tableName: "维护工艺路线工序表",
  554. columnProp: "crewsize",
  555. headerAlign: "center",
  556. align: "left",
  557. columnLabel: "操作工人数",
  558. columnHidden: false,
  559. columnImage: false,
  560. columnSortable: false,
  561. sortLv: 0,
  562. status: true,
  563. fixed: false,
  564. columnWidth: 100
  565. },
  566. {
  567. userId: this.$store.state.user.name,
  568. functionId: 6040,
  569. serialNumber: '6040Table2WorkCenterType',
  570. tableId: "6040Table2",
  571. tableName: "维护工艺路线工序表",
  572. columnProp: "workCenterType",
  573. headerAlign: "center",
  574. align: "left",
  575. columnLabel: "加工中心类型",
  576. columnHidden: false,
  577. columnImage: false,
  578. columnSortable: false,
  579. sortLv: 0,
  580. status: true,
  581. fixed: false,
  582. columnWidth: 100
  583. },
  584. {
  585. userId: this.$store.state.user.name,
  586. functionId: 6040,
  587. serialNumber: '6040Table2WXPartNo',
  588. tableId: "6040Table2",
  589. tableName: "维护工艺路线工序表",
  590. columnProp: "wxPartNo",
  591. headerAlign: "center",
  592. align: "left",
  593. columnLabel: "费用结算料号",
  594. columnHidden: false,
  595. columnImage: false,
  596. columnSortable: false,
  597. sortLv: 0,
  598. status: true,
  599. fixed: false,
  600. columnWidth: 120
  601. },
  602. {
  603. userId: this.$store.state.user.name,
  604. functionId: 6040,
  605. serialNumber: '6040Table2WXSpec',
  606. tableId: "6040Table2",
  607. tableName: "维护工艺路线工序表",
  608. columnProp: "wxSpec",
  609. headerAlign: "center",
  610. align: "left",
  611. columnLabel: "费用结算物料名称/规格",
  612. columnHidden: false,
  613. columnImage: false,
  614. columnSortable: false,
  615. sortLv: 0,
  616. status: true,
  617. fixed: false,
  618. columnWidth: 250
  619. },
  620. ],
  621. detailData:{
  622. itemNo:'',
  623. operationDesc:'',
  624. workCenterNo:'',
  625. machSetupTime:'',
  626. machRunFactor:'',
  627. factorUnit:'',
  628. jjgzUnitPrice:'',
  629. jjgzUnitFactor:'',
  630. efficiency:'',
  631. crewsize:'',
  632. remark:'',
  633. site:'',
  634. partNo:'',
  635. revNo:'',
  636. add:'',
  637. user:'',
  638. }
  639. }
  640. },
  641. mounted() {
  642. this.$nextTick(() => {
  643. this.height = window.innerHeight - 310;
  644. })
  645. },
  646. methods: {
  647. addRoutingDetail(){
  648. if(this.mainData.partNo==null||this.mainData.partNo==''){
  649. this.$alert("请选择物料号!", '错误', {
  650. confirmButtonText: '确定'
  651. })
  652. return false;
  653. }
  654. let size=this.dataList2.length;
  655. this. detailData={
  656. itemNo:this.dataList2[Number(size-1)].itemNo+10,
  657. operationDesc:'',
  658. workCenterNo:'',
  659. machSetupTime:'',
  660. machRunFactor:0,
  661. factorUnit:'',
  662. jjgzUnitPrice:'',
  663. jjgzUnitFactor:'',
  664. efficiency:'',
  665. crewsize:'',
  666. remark:'',
  667. add:0,
  668. partNo:this.mainData.partNo,
  669. revNo:this.mainData.revNo,
  670. site:this.mainData.site,
  671. user:this.$store.state.user.name,
  672. }
  673. this.detailmodelInputFlag=false;
  674. this.detailmodelFlag=true;
  675. },
  676. saveRoutingDetailData(){
  677. if(this.detailData.itemNo==''||this.detailData.itemNo==null){
  678. this.$alert("请输入工序号!",'错误',{
  679. confirmButtonText:'确定'
  680. })
  681. return false;
  682. }
  683. if(this.detailData.operationDesc==''||this.detailData.operationDesc==null){
  684. this.$alert("请输入工序名称!",'错误',{
  685. confirmButtonText:'确定'
  686. })
  687. return false;
  688. }
  689. if(this.detailData.workCenterNo==''||this.detailData.workCenterNo==null){
  690. this.$alert("请输入加工中心编码!",'错误',{
  691. confirmButtonText:'确定'
  692. })
  693. return false;
  694. }
  695. saveRoutingDetailData(this.detailData).then(({data}) => {
  696. if (data && data.code == 200) {
  697. this.detailmodelFlag = false
  698. let data1={
  699. site: this.mainData.site,
  700. partNo:this.mainData.partNo,
  701. revNo:this.mainData.revNo,
  702. }
  703. searchRoutingDetailData(data1).then(({data}) => {
  704. this.dataList2=data.rows;
  705. })
  706. this.$message({
  707. message: '操作成功',
  708. type: 'success',
  709. duration: 1500,
  710. onClose: () => {
  711. }
  712. })
  713. } else {
  714. this.$alert(data.msg, '错误', {
  715. confirmButtonText: '确定'
  716. })
  717. }
  718. })
  719. },
  720. tableHanddle(row) {
  721. let data={
  722. partNo:row.partNo,
  723. site:row.site,
  724. revNo:row.revNo,
  725. }
  726. searchRoutingWithPartNo(data).then(({data}) => {
  727. if(data.rows.length>0){
  728. if(data.rows[0].repairFlag=='Y'){
  729. data.rows[0].repairFlag=true;
  730. }else {
  731. data.rows[0].repairFlag=false;
  732. }
  733. if(data.rows[0].defaultflag=='Y'){
  734. data.rows[0].defaultflag=true;
  735. }else {
  736. data.rows[0].defaultflag=false;
  737. }
  738. this.mainData = data.rows[0]
  739. let data1={
  740. site: data.rows[0].site,
  741. partNo:data.rows[0].partNo,
  742. revNo:data.rows[0].revNo,
  743. }
  744. searchRoutingDetailData(data1).then(({data}) => {
  745. this.dataList2=data.rows;
  746. })
  747. }
  748. })
  749. this.modelFlag = false;
  750. },
  751. getSearchModal() {
  752. this.searchPartNo = '';
  753. this.searchRoutingWithPartNo();
  754. this.modelFlag = true;
  755. },
  756. editRoutingDetail(){
  757. if(this.currentRow==null){
  758. this.$alert("请选择工艺路线工序!", '错误', {
  759. confirmButtonText: '确定'
  760. })
  761. return false;
  762. }
  763. this. detailData={
  764. itemNo:this.currentRow.itemNo,
  765. operationDesc:this.currentRow.operationDesc,
  766. workCenterNo:this.currentRow.workCenterNo,
  767. machSetupTime:this.currentRow.machSetupTime,
  768. machRunFactor:this.currentRow.machRunFactor,
  769. factorUnit:this.currentRow.factorUnit,
  770. jjgzUnitPrice:this.currentRow.jjgzUnitPrice,
  771. jjgzUnitFactor:this.currentRow.jjgzUnitFactor,
  772. efficiency:this.currentRow.efficiency,
  773. crewsize:this.currentRow.crewsize,
  774. remark:this.currentRow.remark,
  775. add:1,
  776. partNo:this.mainData.partNo,
  777. revNo:this.mainData.revNo,
  778. site:this.mainData.site,
  779. user:this.$store.state.user.name,
  780. }
  781. this.detailmodelInputFlag=true;
  782. this.detailmodelFlag=true;
  783. },
  784. searchRoutingWithPartNo() {
  785. let data={
  786. partNo:this.searchPartNo
  787. }
  788. searchRoutingWithPartNo(data).then(({data}) => {
  789. this.dataList = data.rows
  790. })
  791. },
  792. clickData(row){
  793. this.currentRow = JSON.parse(JSON.stringify(row));
  794. },
  795. jumpWorkCenter(){
  796. if(this.currentRow==null){
  797. this.$alert("请选择工艺路线工序!", '错误', {
  798. confirmButtonText: '确定'
  799. })
  800. return false;
  801. }
  802. let inData={user:this.$store.state.user.name,site:this.currentRow.site,workCenterNo:this.currentRow.workCenterNo};
  803. localStorage.setItem('workCenterNo', JSON.stringify(inData))
  804. this.$router.replace('base-workCenter')
  805. },
  806. },
  807. created() {
  808. }
  809. }
  810. </script>
  811. <style scoped>
  812. </style>