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.

661 lines
21 KiB

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