plm前端
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.

793 lines
26 KiB

2 years ago
2 years ago
1 year ago
7 months ago
7 months ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
10 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
9 months ago
2 years ago
2 years ago
8 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
11 months ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
11 months ago
10 months ago
11 months ago
1 year ago
11 months ago
1 year ago
2 years ago
1 year ago
11 months ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
8 months ago
2 years ago
1 year ago
2 years ago
7 months ago
2 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" style="margin-top: 1px; margin-left: 0px;" >
  4. <el-row :gutter="20">
  5. <el-col :span="18">
  6. <el-form-item label="物料编码/Part No.">
  7. <el-input v-model="bomData.partNo" readonly style="width: 120px"></el-input>
  8. </el-form-item>
  9. <el-form-item label="BOM类型/BOM Type">
  10. <el-input v-model="bomData.bomType" readonly style="width: 120px"></el-input>
  11. </el-form-item>
  12. <el-form-item label="BOM版本/BOM Rev.">
  13. <el-input v-model="bomData.engChgLevel" readonly style="width: 120px"></el-input>
  14. </el-form-item>
  15. <el-form-item label="替代编码/Alternative No.">
  16. <el-input v-model="bomData.alternativeNo" readonly style="width: 130px"></el-input>
  17. </el-form-item>
  18. <el-form-item label="URL文件号/UL Product Model">
  19. <dict-data-select :site="searchData.site" v-if="searchData.site" v-model="bomData.urlFile" style="width: 240px" dict-type="bm_url_file"></dict-data-select>
  20. </el-form-item>
  21. <el-form-item label=" ">
  22. <el-button type="primary" @click="searchTable(true)" >刷新</el-button>
  23. <el-button type="primary" v-if="((!ifDisableFlag && spForm.sp.includes(searchData.username) && baseForm.status === 'spz') || baseForm.status === 'cg' || superAdmin)" @click="changeBomRev()">变更</el-button>
  24. <el-button type="primary" @click="jumpBom()">跳转至BOM</el-button>
  25. <el-button type="primary" v-if="(!ifDisableFlag && isAuth('103002:bmSave') && spForm.sp.includes(searchData.username) && baseForm.status === 'spz') || baseForm.status === 'cg' || superAdmin" @click="updateBMProcess()" >保存数据</el-button>
  26. <el-button v-if="baseForm.status === 'spz' && ((!ifDisableFlag && spForm.sp.includes(searchData.username)) || (superAdmin))" type="primary" @click="agreeSubmit">同意</el-button>
  27. <el-button v-if="baseForm.status === 'spz' && ((baseForm.isReject === 'Y' && !ifDisableFlag && spForm.sp.includes(searchData.username)) || (superAdmin))" type="primary" @click="submitDataModal">驳回</el-button>
  28. <!-- <el-button type="primary" @click="newData()" v-if="!ifDisableFlag">新增</el-button>-->
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="3"><div class="grid-content bg-purple">
  32. <el-form-item label="当前节点/Status" style="width: 100%">
  33. <el-input v-model="spForm.nodeName" disabled></el-input>
  34. </el-form-item>
  35. </div>
  36. </el-col>
  37. <el-col :span="3"><div class="grid-content bg-purple">
  38. <el-form-item label="当前节点审批人/Authorizer" style="width: 100%">
  39. <el-input v-model="spForm.sp" disabled></el-input>
  40. </el-form-item>
  41. </div>
  42. </el-col>
  43. </el-row>
  44. <el-table
  45. :data="bomList"
  46. :height="height"
  47. border
  48. ref="componentTable"
  49. style="width:100%">
  50. <!-- <el-table-column-->
  51. <!-- v-for="(item,index) in columnList1" :key="index"-->
  52. <!-- :sortable="item.columnSortable"-->
  53. <!-- :prop="item.columnProp"-->
  54. <!-- :header-align="item.headerAlign"-->
  55. <!-- :show-overflow-tooltip="item.showOverflowTooltip"-->
  56. <!-- :align="item.align"-->
  57. <!-- :fixed="item.fixed == ''?false:item.fixed"-->
  58. <!-- :min-width="item.columnWidth"-->
  59. <!-- :label="item.columnLabel">-->
  60. <!-- <template slot-scope="scope">-->
  61. <!-- <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>-->
  62. <!-- <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>-->
  63. <!-- </template>-->
  64. <!-- </el-table-column>-->
  65. <el-table-column label="序号" header-align="center">
  66. <el-table-column
  67. prop="lineSequence"
  68. header-align="center"
  69. align="center"
  70. min-width="60"
  71. label="Item No.">
  72. </el-table-column>
  73. </el-table-column>
  74. <el-table-column label="装配件料号" header-align="center">
  75. <el-table-column
  76. prop="componentPart"
  77. header-align="center"
  78. align="center"
  79. min-width="120"
  80. label="Component Part">
  81. </el-table-column>
  82. </el-table-column>
  83. <el-table-column label="描述" header-align="center">
  84. <el-table-column
  85. prop="componentPartDesc"
  86. header-align="center"
  87. align="left"
  88. min-width="160"
  89. label="Description">
  90. </el-table-column>
  91. </el-table-column>
  92. <el-table-column label="单位用量" header-align="center">
  93. <el-table-column
  94. prop="qtyPerAssembly"
  95. header-align="center"
  96. align="right"
  97. min-width="140"
  98. label="Quantity Per Assembly">
  99. </el-table-column>
  100. </el-table-column>
  101. <el-table-column label="调机料" header-align="center">
  102. <el-table-column
  103. prop="componentScrap"
  104. header-align="center"
  105. align="right"
  106. min-width="100"
  107. label="Component Scrap">
  108. </el-table-column>
  109. </el-table-column>
  110. <el-table-column label="损耗率" header-align="center">
  111. <el-table-column
  112. prop="shrinkageFactor"
  113. header-align="center"
  114. align="right"
  115. min-width="100"
  116. label="Scrap Factor(%)">
  117. </el-table-column>
  118. </el-table-column>
  119. <el-table-column label="单位" header-align="center">
  120. <el-table-column
  121. prop="printUnit"
  122. header-align="center"
  123. align="center"
  124. min-width="60"
  125. label="Unit">
  126. </el-table-column>
  127. </el-table-column>
  128. <el-table-column label="发料方式" header-align="center">
  129. <el-table-column
  130. prop="issueType"
  131. header-align="center"
  132. align="center"
  133. min-width="80"
  134. label="Reserve/Issue Method">
  135. </el-table-column>
  136. </el-table-column>
  137. <el-table-column label="工序号" header-align="center">
  138. <el-table-column
  139. prop="operationId"
  140. header-align="center"
  141. align="center"
  142. min-width="80"
  143. label="Operation">
  144. </el-table-column>
  145. </el-table-column>
  146. <el-table-column label="发料库位" header-align="center">
  147. <el-table-column
  148. prop="issueToLocName"
  149. header-align="center"
  150. align="center"
  151. min-width="100"
  152. label="Issue From Loc.">
  153. </el-table-column>
  154. </el-table-column>
  155. <el-table-column label="备注" header-align="center">
  156. <el-table-column
  157. prop="noteText"
  158. header-align="center"
  159. align="left"
  160. min-width="150"
  161. label="Comments">
  162. </el-table-column>
  163. </el-table-column>
  164. <el-table-column
  165. fixed="right"
  166. header-align="center"
  167. align="center"
  168. width="90"
  169. label="操作">
  170. <template slot-scope="scope">
  171. <a type="text" v-if="scope.row.ifHasPeifang==='Y'" size="small" @click="jumpPeifang(scope.row)">跳转配方</a>
  172. </template>
  173. </el-table-column>
  174. </el-table>
  175. </el-form>
  176. <el-dialog title="变更BOM" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="750px">
  177. <el-table
  178. :data="bomDetailList"
  179. height="300"
  180. border
  181. highlight-current-row
  182. onclick=""
  183. @row-click="getRow"
  184. ref="componentTable"
  185. style="width:100%">
  186. <el-table-column
  187. prop="partNo"
  188. header-align="left"
  189. align="left"
  190. min-width="80"
  191. label="物料编码">
  192. </el-table-column>
  193. <el-table-column
  194. prop="bomType"
  195. header-align="left"
  196. align="left"
  197. min-width="80"
  198. label="BOM类型">
  199. </el-table-column>
  200. <el-table-column
  201. prop="engChgLevel"
  202. header-align="left"
  203. align="left"
  204. min-width="80"
  205. label="BOM版本">
  206. </el-table-column>
  207. <el-table-column
  208. prop="alternativeNo"
  209. header-align="left"
  210. align="left"
  211. min-width="80"
  212. label="替代编码">
  213. </el-table-column>
  214. <el-table-column
  215. prop="alternativeDescription"
  216. header-align="left"
  217. align="left"
  218. min-width="80"
  219. label="替代名称">
  220. </el-table-column>
  221. <el-table-column
  222. prop="status"
  223. header-align="left"
  224. align="left"
  225. min-width="60"
  226. label="状态">
  227. </el-table-column>
  228. <el-table-column
  229. prop="effPhaseInDate"
  230. header-align="left"
  231. align="left"
  232. min-width="80"
  233. label="生效日期">
  234. </el-table-column>
  235. <el-table-column
  236. prop="effPhaseOutDate"
  237. header-align="left"
  238. align="left"
  239. min-width="80"
  240. label="失效日期">
  241. </el-table-column>
  242. </el-table>
  243. <el-footer style="height:30px;margin-top:20px;text-align:center">
  244. <el-button type="primary" @click="updateBMBomRev()">确定</el-button>
  245. <el-button type="primary" @click="modalFlag=false">取消</el-button>
  246. </el-footer>
  247. </el-dialog>
  248. <!-- 提交 -->
  249. <el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag" width="500px">
  250. <el-form :inline="true" label-position="top">
  251. <el-form-item :label="'驳回意见'">
  252. <el-input type="textarea" v-model="rejectOpinion" :rows="3" resize='none' show-word-limit style="width: 479px;height: 30px"></el-input>
  253. </el-form-item>
  254. </el-form>
  255. <el-footer style="height:30px;margin-top: 50px;text-align:center">
  256. <el-button type="primary" @click="rejectSubmit">确定</el-button>
  257. <el-button type="primary" @click="submitModalFlag = false">取消</el-button>
  258. </el-footer>
  259. </el-dialog>
  260. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  261. </div>
  262. </template>
  263. <script>
  264. import {
  265. searchBMBom,
  266. searchBMBomDetail,
  267. updateBMBomRev,
  268. tsdBasicInformationSearch,
  269. getBMStatusDesc,
  270. submitChange, // 提交
  271. getOADetailForBM,
  272. updateBMProcessBom, // 保存数据
  273. } from "@/api/sampleManagement/technicalSpecificationList.js"
  274. import {
  275. getNodeAuthority, // 获取节点权限
  276. } from '@/api/changeManagement/changeManagement.js'
  277. import Chooselist from '@/views/modules/common/Chooselist'
  278. import DictDataSelect from "../../sys/dict-data-select-highlight";
  279. export default {
  280. components: {
  281. DictDataSelect,
  282. Chooselist
  283. },
  284. data() {
  285. return {
  286. superAdmin:false,
  287. modalFlag:false,
  288. bomFlag:false,
  289. height:200,
  290. searchData: {
  291. site: '',
  292. username: this.$store.state.user.name,
  293. codeNo: '',
  294. buNo:'',
  295. fieldId:'',
  296. },
  297. bomData:{
  298. site: '',
  299. partNo:'',
  300. alternativeNo:'',
  301. bomType:'',
  302. engChgLevel:'',
  303. urlFile: ''
  304. },
  305. currentRow:"",
  306. bomList:[],
  307. bomDetailList:[],
  308. columnList1: [
  309. {
  310. userId: this.$store.state.user.name,
  311. functionId: 104002,
  312. serialNumber: '104002Table2LineSequence',
  313. tableId: '104002Table2',
  314. tableName: 'BOM子物料表',
  315. columnProp: 'lineSequence',
  316. headerAlign: 'center',
  317. align: 'center',
  318. columnLabel: '序号/Item No.',
  319. columnHidden: false,
  320. columnImage: false,
  321. columnSortable: false,
  322. sortLv: 0,
  323. status: true,
  324. fixed: '',
  325. columnWidth: 60
  326. },
  327. {
  328. userId: this.$store.state.user.name,
  329. functionId: 104002,
  330. serialNumber: '104002Table2ComponentPart',
  331. tableId: '104002Table2',
  332. tableName: 'BOM子物料表',
  333. columnProp: 'componentPart',
  334. headerAlign: 'center',
  335. align: 'center',
  336. columnLabel: '装配件料号/Component Part',
  337. columnHidden: false,
  338. columnImage: false,
  339. columnSortable: false,
  340. sortLv: 0,
  341. status: true,
  342. fixed: '',
  343. columnWidth: 120
  344. },
  345. {
  346. userId: this.$store.state.user.name,
  347. functionId: 104002,
  348. serialNumber: '104002Table2ComponentPartDesc',
  349. tableId: '104002Table2',
  350. tableName: 'BOM子物料表',
  351. columnProp: 'componentPartDesc',
  352. headerAlign: 'center',
  353. align: 'left',
  354. columnLabel: '描述/Description',
  355. columnHidden: false,
  356. columnImage: false,
  357. columnSortable: false,
  358. sortLv: 0,
  359. status: true,
  360. fixed: '',
  361. columnWidth: 160
  362. },
  363. {
  364. userId: this.$store.state.user.name,
  365. functionId: 104002,
  366. serialNumber: '104002Table2QtyPerAssembly',
  367. tableId: '104002Table2',
  368. tableName: 'BOM子物料表',
  369. columnProp: 'qtyPerAssembly',
  370. headerAlign: 'center',
  371. align: 'right',
  372. columnLabel: '单位用量/Quantity Per Assembly',
  373. columnHidden: false,
  374. columnImage: false,
  375. columnSortable: false,
  376. sortLv: 0,
  377. status: true,
  378. fixed: '',
  379. columnWidth: 140
  380. },
  381. {
  382. userId: this.$store.state.user.name,
  383. functionId: 104002,
  384. serialNumber: '104002Table2ComponentScrap',
  385. tableId: '104002Table2',
  386. tableName: 'BOM子物料表',
  387. columnProp: 'componentScrap',
  388. headerAlign: 'center',
  389. align: 'right',
  390. columnLabel: '调机料/Component Scrap',
  391. columnHidden: false,
  392. columnImage: false,
  393. columnSortable: false,
  394. sortLv: 0,
  395. status: true,
  396. fixed: '',
  397. columnWidth: 80
  398. },
  399. {
  400. userId: this.$store.state.user.name,
  401. functionId: 104002,
  402. serialNumber: '104002Table2ShrinkageFactor',
  403. tableId: '104002Table2',
  404. tableName: 'BOM子物料表',
  405. columnProp: 'shrinkageFactor',
  406. headerAlign: 'center',
  407. align: 'right',
  408. columnLabel: '损耗率/Scrap Factor(%)',
  409. columnHidden: false,
  410. columnImage: false,
  411. columnSortable: false,
  412. sortLv: 0,
  413. status: true,
  414. fixed: '',
  415. columnWidth: 80
  416. },
  417. {
  418. userId: this.$store.state.user.name,
  419. functionId: 104002,
  420. serialNumber: '104002Table2PrintUnitName',
  421. tableId: '104002Table2',
  422. tableName: 'BOM子物料表',
  423. columnProp: 'printUnit',
  424. headerAlign: 'center',
  425. align: 'center',
  426. columnLabel: '单位/Unit',
  427. columnHidden: false,
  428. columnImage: false,
  429. columnSortable: false,
  430. sortLv: 0,
  431. status: true,
  432. fixed: '',
  433. columnWidth: 60
  434. },
  435. {
  436. userId: this.$store.state.user.name,
  437. functionId: 104002,
  438. serialNumber: '104002Table2IssueType',
  439. tableId: '104002Table2',
  440. tableName: 'BOM子物料表',
  441. columnProp: 'issueType',
  442. headerAlign: 'center',
  443. align: 'center',
  444. columnLabel: '发料方式/Reserve/Issue Method',
  445. columnHidden: false,
  446. columnImage: false,
  447. columnSortable: false,
  448. sortLv: 0,
  449. status: true,
  450. fixed: '',
  451. columnWidth: 80
  452. },
  453. {
  454. userId: this.$store.state.user.name,
  455. functionId: 104002,
  456. serialNumber: '104002Table2OperationDesc',
  457. tableId: '104002Table2',
  458. tableName: 'BOM子物料表',
  459. columnProp: 'operationId',
  460. headerAlign: 'center',
  461. align: 'center',
  462. columnLabel: '工序号/Operation',
  463. columnHidden: false,
  464. columnImage: false,
  465. columnSortable: false,
  466. sortLv: 0,
  467. status: true,
  468. fixed: '',
  469. columnWidth: 80
  470. },
  471. {
  472. userId: this.$store.state.user.name,
  473. functionId: 104002,
  474. serialNumber: '104002Table2IssueToLoc',
  475. tableId: '104002Table2',
  476. tableName: 'BOM子物料表',
  477. columnProp: 'issueToLocName',
  478. headerAlign: 'center',
  479. align: 'center',
  480. columnLabel: '发料库位/Issue From Loc.',
  481. columnHidden: false,
  482. columnImage: false,
  483. columnSortable: false,
  484. sortLv: 0,
  485. status: true,
  486. fixed: '',
  487. columnWidth: 80
  488. },
  489. {
  490. userId: this.$store.state.user.name,
  491. functionId: 104002,
  492. serialNumber: '104002Table2NoteText',
  493. tableId: '104002Table2',
  494. tableName: 'BOM子物料表',
  495. columnProp: 'noteText',
  496. headerAlign: 'center',
  497. align: 'left',
  498. columnLabel: '备注/Comments',
  499. columnHidden: false,
  500. columnImage: false,
  501. columnSortable: false,
  502. sortLv: 0,
  503. status: true,
  504. fixed: '',
  505. columnWidth: 150
  506. },
  507. ],
  508. baseForm:{
  509. status:'',
  510. isReject:'',
  511. },
  512. spForm:{
  513. sp:'',
  514. nodeName:'',
  515. },
  516. ifDisableFlag:false,
  517. rejectOpinion: '',
  518. submitModalFlag: false,
  519. }
  520. },
  521. mounted () {
  522. this.$nextTick(() => {
  523. this.height = window.innerHeight - 100
  524. })
  525. },
  526. methods: {
  527. // 获取基础数据列表S
  528. getBaseList (val, type) {
  529. this.tagNo = val
  530. this.tagNo1 = type
  531. this.$nextTick(() => {
  532. let strVal = ''
  533. if (val === 1013) {
  534. if(type==1) {
  535. strVal = this.dataForm.partType
  536. }
  537. }
  538. this.$refs.baseList.init(val, strVal)
  539. })
  540. },
  541. /* 列表方法的回调 */
  542. getBaseData (val) {
  543. if (this.tagNo === 1013) {
  544. if(this.tagNo1==1) {
  545. this.dataForm.partType = val.Base_id
  546. this.dataForm.partTypeDesc = val.Base_desc
  547. }
  548. }
  549. },
  550. choosePart(row){
  551. this.dataForm.erpPartNo=row.erpPartNo
  552. this.dataForm.familyId=row.familyId
  553. this.dataForm.familyName=row.familyName
  554. this.dataForm.partDesc=row.partDesc
  555. this.dataForm.spec=row.spec
  556. this.partModelFlag=false;
  557. },
  558. //初始化组件的参数
  559. init (inData) {
  560. if (this.searchData.codeNo != null && this.searchData.codeNo != '') {
  561. return false;
  562. }
  563. // 初始化参数
  564. this.searchData = JSON.parse(JSON.stringify(inData))
  565. if (this.searchData.ifDisableFlag) {
  566. this.ifDisableFlag = true
  567. }
  568. // 刷新表格
  569. this.searchTable()
  570. },
  571. searchTable (type) {
  572. getOADetailForBM(this.searchData).then(({data}) => {
  573. this.spForm.nodeName = data.row.nodeName
  574. this.spForm.sp = data.row.sp == null ? '' : data.row.sp
  575. })
  576. searchBMBom(this.searchData).then(({data}) => {
  577. if (data&& data.code === 0) {
  578. this.bomList = data.rows
  579. this.bomData = data.row
  580. if (type) {
  581. this.$message.success( '操作成功')
  582. }
  583. } else {
  584. this.$message.error(data.msg)
  585. }
  586. })
  587. tsdBasicInformationSearch(this.searchData).then(({data}) => {
  588. this.baseForm=data.row;
  589. this.bomData.site=data.row.site
  590. this.bomData.partNo=data.row.finalPartNo
  591. this.getNodeAuthority(data.row)
  592. })
  593. },
  594. searchDetailTable () {
  595. searchBMBomDetail(this.bomData).then(({data}) => {
  596. this.bomDetailList = data.rows
  597. })
  598. },
  599. changeBomRev () {
  600. this.searchDetailTable()
  601. this.currentRow = null
  602. this.modalFlag = true
  603. },
  604. getRow (row) {
  605. this.currentRow = row
  606. },
  607. updateBMBomRev () {
  608. if (this.currentRow == null) {
  609. this.$alert('请点击选择BOM版本!', '错误', {
  610. confirmButtonText: '确定'
  611. })
  612. return false;
  613. }
  614. if (this.currentRow.status !== 'Buildable') {
  615. this.$alert('只有Buildable状态的可以保存!', '错误', {
  616. confirmButtonText: '确定'
  617. })
  618. return false;
  619. }
  620. let inData = {
  621. site: this.bomData.site,
  622. codeNo: this.searchData.codeNo,
  623. bomType: this.currentRow.bomType,
  624. engChgLevel: this.currentRow.engChgLevel,
  625. bomAlternativeNo: this.currentRow.alternativeNo
  626. }
  627. updateBMBomRev(inData).then(({data})=>{
  628. if(data&& data.code===0){
  629. this.searchTable();
  630. this.modalFlag=false;
  631. this.$message.success( '操作成功')
  632. } else {
  633. this.$message.error(data.msg)
  634. }
  635. })
  636. },
  637. jumpBom () {
  638. if (this.bomData.engChgLevel != null || this.bomData.engChgLevel !== '') {
  639. this.$message.error("bom明细不存在")
  640. }
  641. let inData = {
  642. site: this.searchData.site,
  643. partNo: this.bomData.partNo,
  644. bomType: this.bomData.bomType,
  645. engChgLevel: this.bomData.engChgLevel,
  646. }
  647. localStorage.setItem('bomData', JSON.stringify(inData))
  648. window.open('#/part-bomManagement')
  649. },
  650. jumpPeifang (row) {
  651. let inData = {
  652. site: row.site,
  653. partNo: row.componentPart,
  654. bomType: 'Manufacturing',
  655. }
  656. localStorage.setItem('recipeData', JSON.stringify(inData))
  657. window.open('#/part-recipeManagement')
  658. },
  659. // 获取流程的配置权限
  660. getNodeAuthority (row) {
  661. getBMStatusDesc(this.searchData).then(({data}) => {
  662. this.superAdmin=data.superAdmin
  663. if(data.superAdmin){
  664. this.ifDisableFlag = false
  665. return false
  666. }
  667. if (data.status === '已完成' || data.status === '已升版' || data.status === 'Dead') {
  668. this.ifDisableFlag = true
  669. return false
  670. }
  671. if(data.status === '审批中') {
  672. let tempData = {
  673. site: row.site,
  674. stepId: row.stepId,
  675. menuId: '103002'
  676. }
  677. getNodeAuthority(tempData).then(({data}) => {
  678. if (data && data.code === 0) {
  679. this.ifDisableFlag = true
  680. let plmStepRoleBaseBm = data.rows.plm_stepRole_base_bm
  681. let arr = plmStepRoleBaseBm.filter(a => a.fieldId === this.searchData.fieldId)
  682. if (arr.length > 0) {
  683. if (arr[0].updateFlag === 'N') {
  684. this.ifDisableFlag = true
  685. } else {
  686. this.ifDisableFlag = false
  687. }
  688. } else {
  689. this.ifDisableFlag = true
  690. }
  691. }
  692. })
  693. }
  694. })
  695. },
  696. // 修改表单数据
  697. updateBMProcess () {
  698. let inData = {
  699. site: this.bomData.site,
  700. codeNo: this.searchData.codeNo,
  701. urlFile: this.bomData.urlFile
  702. }
  703. updateBMProcessBom(inData).then(({data})=>{
  704. if (data&& data.code === 0) {
  705. this.searchTable()
  706. this.$message.success( '操作成功')
  707. } else {
  708. this.$message.error(data.msg)
  709. }
  710. })
  711. },
  712. // 同意提交
  713. agreeSubmit () {
  714. this.$confirm(`是否确认提交?`, '提示', {
  715. confirmButtonText: '确定',
  716. cancelButtonText: '取消',
  717. type: 'warning'
  718. }).then(() => {
  719. let tempData = {
  720. site: this.searchData.site,
  721. userName: this.$store.state.user.name,
  722. codeNo: this.searchData.codeNo,
  723. menuId: '103002',
  724. nodeConclusion: 'Y'
  725. }
  726. this.submitData(tempData)
  727. })
  728. },
  729. // 驳回提交
  730. rejectSubmit () {
  731. this.$confirm(`是否确认驳回?`, '提示', {
  732. confirmButtonText: '确定',
  733. cancelButtonText: '取消',
  734. type: 'warning'
  735. }).then(() => {
  736. let tempData = {
  737. site: this.searchData.site,
  738. userName: this.$store.state.user.name,
  739. codeNo: this.searchData.codeNo,
  740. menuId: '103002',
  741. nodeConclusion: 'N',
  742. rejectOpinion : this.rejectOpinion
  743. }
  744. this.submitData(tempData)
  745. })
  746. },
  747. submitData (tempData) {
  748. submitChange(tempData).then(({data}) => {
  749. if (data && data.code === 0) {
  750. this.submitModalFlag = false
  751. // this.searchTable();
  752. window.location.reload();
  753. this.$message({message: '操作成功', type: 'success'})
  754. } else {
  755. this.$alert(data.msg, '错误', {
  756. confirmButtonText: '确定'
  757. })
  758. }
  759. })
  760. },
  761. // 打开提交模态框
  762. submitDataModal () {
  763. this.rejectOpinion = ''
  764. this.submitModalFlag = true
  765. },
  766. },
  767. }
  768. </script>
  769. <style scoped>
  770. input[readonly] {
  771. cursor: text;
  772. }
  773. </style>