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.

484 lines
14 KiB

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
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
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. <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" @click="changeBomRev()" >变更</el-button>
  19. <el-button type="primary" @click="jumpBom()" >跳转至BOM</el-button>
  20. <!-- <el-button type="primary" @click="newData()" v-if="!ifDisableFlag">新增</el-button>-->
  21. </el-form-item>
  22. <el-table
  23. :data="bomList"
  24. :height="height"
  25. border
  26. ref="componentTable"
  27. style="width:100%">
  28. <el-table-column
  29. v-for="(item,index) in columnList1" :key="index"
  30. :sortable="item.columnSortable"
  31. :prop="item.columnProp"
  32. :header-align="item.headerAlign"
  33. :show-overflow-tooltip="item.showOverflowTooltip"
  34. :align="item.align"
  35. :fixed="item.fixed == ''?false:item.fixed"
  36. :min-width="item.columnWidth"
  37. :label="item.columnLabel">
  38. <template slot-scope="scope">
  39. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  40. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  41. </template>
  42. </el-table-column>
  43. </el-table>
  44. </el-form>
  45. <el-dialog title="变更BOM" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="750px">
  46. <el-table
  47. :data="bomDetailList"
  48. height="300"
  49. border
  50. highlight-current-row
  51. onclick=""
  52. @row-click="getRow"
  53. ref="componentTable"
  54. style="width:100%">
  55. <el-table-column
  56. prop="partNo"
  57. header-align="left"
  58. align="left"
  59. min-width="80"
  60. label="物料编码">
  61. </el-table-column>
  62. <el-table-column
  63. prop="bomType"
  64. header-align="left"
  65. align="left"
  66. min-width="80"
  67. label="BOM类型">
  68. </el-table-column>
  69. <el-table-column
  70. prop="engChgLevel"
  71. header-align="left"
  72. align="left"
  73. min-width="80"
  74. label="BOM版本">
  75. </el-table-column>
  76. <el-table-column
  77. prop="alternativeNo"
  78. header-align="left"
  79. align="left"
  80. min-width="80"
  81. label="替代编码">
  82. </el-table-column>
  83. <el-table-column
  84. prop="alternativeDescription"
  85. header-align="left"
  86. align="left"
  87. min-width="80"
  88. label="替代名称">
  89. </el-table-column>
  90. <el-table-column
  91. prop="status"
  92. header-align="left"
  93. align="left"
  94. min-width="60"
  95. label="状态">
  96. </el-table-column>
  97. <el-table-column
  98. prop="effPhaseInDate"
  99. header-align="left"
  100. align="left"
  101. min-width="80"
  102. label="生效日期">
  103. </el-table-column>
  104. <el-table-column
  105. prop="effPhaseOutDate"
  106. header-align="left"
  107. align="left"
  108. min-width="80"
  109. label="失效日期">
  110. </el-table-column>
  111. </el-table>
  112. <el-footer style="height:30px;margin-top:20px;text-align:center">
  113. <el-button type="primary" @click="updateBMBomRev()">确定</el-button>
  114. <el-button type="primary" @click="modalFlag=false">取消</el-button>
  115. </el-footer>
  116. </el-dialog>
  117. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  118. </div>
  119. </template>
  120. <script>
  121. import {
  122. searchBMBom,
  123. searchBMBomDetail,
  124. updateBMBomRev,
  125. } from "@/api/sampleManagement/technicalSpecificationList.js"
  126. import Chooselist from '@/views/modules/common/Chooselist'
  127. export default {
  128. components: {
  129. Chooselist
  130. },
  131. data() {
  132. return {
  133. modalFlag:false,
  134. bomFlag:false,
  135. height:200,
  136. searchData: {
  137. site: '',
  138. username: this.$store.state.user.name,
  139. codeNo: '',
  140. buNo:'',
  141. },
  142. bomData:{
  143. site: '',
  144. partNo:'',
  145. alternativeNo:'',
  146. bomType:'',
  147. engChgLevel:'',
  148. },
  149. currentRow:"",
  150. bomList:[],
  151. bomDetailList:[],
  152. columnList1: [
  153. {
  154. userId: this.$store.state.user.name,
  155. functionId: 104002,
  156. serialNumber: '104002Table2LineSequence',
  157. tableId: '104002Table2',
  158. tableName: 'BOM子物料表',
  159. columnProp: 'lineSequence',
  160. headerAlign: 'center',
  161. align: 'center',
  162. columnLabel: '序号',
  163. columnHidden: false,
  164. columnImage: false,
  165. columnSortable: false,
  166. sortLv: 0,
  167. status: true,
  168. fixed: '',
  169. columnWidth: 60
  170. },
  171. {
  172. userId: this.$store.state.user.name,
  173. functionId: 104002,
  174. serialNumber: '104002Table2ComponentPart',
  175. tableId: '104002Table2',
  176. tableName: 'BOM子物料表',
  177. columnProp: 'componentPart',
  178. headerAlign: 'center',
  179. align: 'center',
  180. columnLabel: '物料编码',
  181. columnHidden: false,
  182. columnImage: false,
  183. columnSortable: false,
  184. sortLv: 0,
  185. status: true,
  186. fixed: '',
  187. columnWidth: 120
  188. },
  189. {
  190. userId: this.$store.state.user.name,
  191. functionId: 104002,
  192. serialNumber: '104002Table2ComponentPartDesc',
  193. tableId: '104002Table2',
  194. tableName: 'BOM子物料表',
  195. columnProp: 'componentPartDesc',
  196. headerAlign: 'center',
  197. align: 'left',
  198. columnLabel: '物料名称',
  199. columnHidden: false,
  200. columnImage: false,
  201. columnSortable: false,
  202. sortLv: 0,
  203. status: true,
  204. fixed: '',
  205. columnWidth: 120
  206. },
  207. {
  208. userId: this.$store.state.user.name,
  209. functionId: 104002,
  210. serialNumber: '104002Table2QtyPerAssembly',
  211. tableId: '104002Table2',
  212. tableName: 'BOM子物料表',
  213. columnProp: 'qtyPerAssembly',
  214. headerAlign: 'center',
  215. align: 'right',
  216. columnLabel: '单位用量',
  217. columnHidden: false,
  218. columnImage: false,
  219. columnSortable: false,
  220. sortLv: 0,
  221. status: true,
  222. fixed: '',
  223. columnWidth: 80
  224. },
  225. {
  226. userId: this.$store.state.user.name,
  227. functionId: 104002,
  228. serialNumber: '104002Table2ComponentScrap',
  229. tableId: '104002Table2',
  230. tableName: 'BOM子物料表',
  231. columnProp: 'componentScrap',
  232. headerAlign: 'center',
  233. align: 'right',
  234. columnLabel: '调机量',
  235. columnHidden: false,
  236. columnImage: false,
  237. columnSortable: false,
  238. sortLv: 0,
  239. status: true,
  240. fixed: '',
  241. columnWidth: 80
  242. },
  243. {
  244. userId: this.$store.state.user.name,
  245. functionId: 104002,
  246. serialNumber: '104002Table2ShrinkageFactor',
  247. tableId: '104002Table2',
  248. tableName: 'BOM子物料表',
  249. columnProp: 'shrinkageFactor',
  250. headerAlign: 'center',
  251. align: 'right',
  252. columnLabel: '损耗率',
  253. columnHidden: false,
  254. columnImage: false,
  255. columnSortable: false,
  256. sortLv: 0,
  257. status: true,
  258. fixed: '',
  259. columnWidth: 80
  260. },
  261. {
  262. userId: this.$store.state.user.name,
  263. functionId: 104002,
  264. serialNumber: '104002Table2PrintUnitName',
  265. tableId: '104002Table2',
  266. tableName: 'BOM子物料表',
  267. columnProp: 'printUnitName',
  268. headerAlign: 'center',
  269. align: 'center',
  270. columnLabel: '单位',
  271. columnHidden: false,
  272. columnImage: false,
  273. columnSortable: false,
  274. sortLv: 0,
  275. status: true,
  276. fixed: '',
  277. columnWidth: 60
  278. },
  279. {
  280. userId: this.$store.state.user.name,
  281. functionId: 104002,
  282. serialNumber: '104002Table2IssueType',
  283. tableId: '104002Table2',
  284. tableName: 'BOM子物料表',
  285. columnProp: 'issueTypeName',
  286. headerAlign: 'center',
  287. align: 'center',
  288. columnLabel: '生产属性',
  289. columnHidden: false,
  290. columnImage: false,
  291. columnSortable: false,
  292. sortLv: 0,
  293. status: true,
  294. fixed: '',
  295. columnWidth: 80
  296. },
  297. {
  298. userId: this.$store.state.user.name,
  299. functionId: 104002,
  300. serialNumber: '104002Table2OperationDesc',
  301. tableId: '104002Table2',
  302. tableName: 'BOM子物料表',
  303. columnProp: 'operationId',
  304. headerAlign: 'center',
  305. align: 'center',
  306. columnLabel: '工序',
  307. columnHidden: false,
  308. columnImage: false,
  309. columnSortable: false,
  310. sortLv: 0,
  311. status: true,
  312. fixed: '',
  313. columnWidth: 80
  314. },
  315. {
  316. userId: this.$store.state.user.name,
  317. functionId: 104002,
  318. serialNumber: '104002Table2IssueToLoc',
  319. tableId: '104002Table2',
  320. tableName: 'BOM子物料表',
  321. columnProp: 'issueToLocName',
  322. headerAlign: 'center',
  323. align: 'center',
  324. columnLabel: '发料库位',
  325. columnHidden: false,
  326. columnImage: false,
  327. columnSortable: false,
  328. sortLv: 0,
  329. status: true,
  330. fixed: '',
  331. columnWidth: 80
  332. },
  333. {
  334. userId: this.$store.state.user.name,
  335. functionId: 104002,
  336. serialNumber: '104002Table2NoteText',
  337. tableId: '104002Table2',
  338. tableName: 'BOM子物料表',
  339. columnProp: 'noteText',
  340. headerAlign: 'center',
  341. align: 'left',
  342. columnLabel: '备注',
  343. columnHidden: false,
  344. columnImage: false,
  345. columnSortable: false,
  346. sortLv: 0,
  347. status: true,
  348. fixed: '',
  349. columnWidth: 150
  350. },
  351. ],
  352. ifDisableFlag:false,
  353. }
  354. },
  355. mounted () {
  356. this.$nextTick(() => {
  357. this.height = window.innerHeight - 100
  358. })
  359. },
  360. methods: {
  361. // 获取基础数据列表S
  362. getBaseList (val, type) {
  363. this.tagNo = val
  364. this.tagNo1 = type
  365. this.$nextTick(() => {
  366. let strVal = ''
  367. if (val === 1013) {
  368. if(type==1) {
  369. strVal = this.dataForm.partType
  370. }
  371. }
  372. this.$refs.baseList.init(val, strVal)
  373. })
  374. },
  375. /* 列表方法的回调 */
  376. getBaseData (val) {
  377. if (this.tagNo === 1013) {
  378. if(this.tagNo1==1) {
  379. this.dataForm.partType = val.Base_id
  380. this.dataForm.partTypeDesc = val.Base_desc
  381. }
  382. }
  383. },
  384. choosePart(row){
  385. this.dataForm.erpPartNo=row.erpPartNo
  386. this.dataForm.familyId=row.familyId
  387. this.dataForm.familyName=row.familyName
  388. this.dataForm.partDesc=row.partDesc
  389. this.dataForm.spec=row.spec
  390. this.partModelFlag=false;
  391. },
  392. //初始化组件的参数
  393. init(inData) {
  394. if(this.searchData.codeNo!=null&&this.searchData.codeNo!=''){
  395. return false;
  396. }
  397. //初始化参数
  398. this.searchData = JSON.parse(JSON.stringify(inData));
  399. if(this.searchData.ifDisableFlag){
  400. this.ifDisableFlag=true
  401. }
  402. //刷新表格
  403. this.searchTable();
  404. },
  405. searchTable(){
  406. searchBMBom(this.searchData).then(({data}) => {
  407. this.bomList = data.rows;
  408. this.bomData = data.row;
  409. });
  410. },
  411. searchDetailTable(){
  412. searchBMBomDetail(this.bomData).then(({data}) => {
  413. this.bomDetailList=data.rows;
  414. });
  415. },
  416. changeBomRev(){
  417. this.searchDetailTable()
  418. this.currentRow=null
  419. this.modalFlag=true;
  420. },
  421. getRow(row){
  422. this.currentRow=row
  423. },
  424. updateBMBomRev(){
  425. if(this.currentRow==null){
  426. this.$alert('请点击选择BOM版本!', '错误', {
  427. confirmButtonText: '确定'
  428. })
  429. return false;
  430. }
  431. if(this.currentRow.status!=='Buildable'){
  432. this.$alert('只有Buildable状态的可以保存!', '错误', {
  433. confirmButtonText: '确定'
  434. })
  435. return false;
  436. }
  437. let inData={
  438. site:this.bomData.site,
  439. codeNo:this.searchData.codeNo,
  440. bomType:this.currentRow.bomType,
  441. engChgLevel:this.currentRow.engChgLevel,
  442. bomAlternativeNo:this.currentRow.alternativeNo
  443. }
  444. updateBMBomRev(inData).then(({data})=>{
  445. if(data&& data.code===0){
  446. this.searchTable();
  447. this.modalFlag=false;
  448. this.$message.success( '操作成功')
  449. } else {
  450. this.$message.error(data.msg)
  451. }
  452. })
  453. },
  454. jumpBom(){
  455. let inData={
  456. site:this.searchData.site,
  457. partNo:this.bomData.partNo,
  458. bomType:this.bomData.bomType,
  459. engChgLevel:this.bomData.engChgLevel,
  460. }
  461. localStorage.setItem('bomData', JSON.stringify(inData))
  462. window.open('#/part-bomManagement');
  463. },
  464. },
  465. }
  466. </script>
  467. <style scoped>
  468. </style>