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.

602 lines
19 KiB

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