赫艾前端
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.

533 lines
17 KiB

5 years ago
4 years ago
​
5 years ago
​
​
​
​
​
​
​
​
4 years ago
​
5 years ago
4 years ago
​
​
​
4 years ago
​
5 years ago
4 years ago
​
5 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
5 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
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
4 years ago
​
​
4 years ago
5 years ago
​
​
​
​
4 years ago
5 years ago
​
​
​
​
​
​
​
​
4 years ago
​
5 years ago
​
4 years ago
​
​
​
​
​
4 years ago
5 years ago
​
​
​
​
4 years ago
5 years ago
​
​
​
4 years ago
5 years ago
​
​
4 years ago
​
5 years ago
​
5 years ago
​
4 years ago
​
​
​
​
​
​
​
5 years ago
​
4 years ago
​
​
5 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
4 years ago
5 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
  1. <template>
  2. <div class="mod-config pad" style="margin-top: 0px">
  3. <h5 style="margin-left: 20px;font-size: 20px">产品属性</h5>
  4. <el-form :inline="true" style="margin-left: 20px;margin-top: -20px" label-position="top">
  5. <el-form-item :label="'工厂编号:'">
  6. <el-input v-model="searchData.site" readonly style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'产品编码:'" style="margin-left: 20px">
  9. <el-input v-model="searchData.partNo" readonly style="width: 200px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'产品名称/规格型号:'" style="margin-left: 20px">
  12. <el-input v-model="partDescription" readonly style="width: 300px"></el-input>
  13. </el-form-item>
  14. <el-form-item :label="''">
  15. <el-button @click="jump()" style="margin-left: 24px;height: 35px;width: 80px" type="primary">关闭</el-button>
  16. </el-form-item>
  17. </el-form>
  18. <el-tabs v-model="activeTable" style="margin-top: 10px; width: 100%;height: 22px;"
  19. type="border-card" @tab-click="tabClick" class="customer-tab">
  20. <el-tab-pane label="属性" name="tab1" >
  21. <el-form :inline="true" style="margin-top: 10px;margin-left: 20px" label-position="top">
  22. <el-form-item :label="'序号:'">
  23. <el-input v-model="num" style="width: 120px" readonly></el-input>
  24. </el-form-item>
  25. <el-form-item :label="'描述:'" style="margin-left: 20px">
  26. <el-input v-model="subCodeDesc" style="width: 200px" readonly></el-input>
  27. </el-form-item>
  28. <el-form-item :label="''">
  29. <el-button @click="lastData()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">上一条</el-button>
  30. </el-form-item>
  31. <el-form-item :label="''">
  32. <el-button @click="nextData()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">下一条</el-button>
  33. </el-form-item>
  34. </el-form>
  35. <el-table
  36. :height="height"
  37. :data="tableData"
  38. border
  39. style="width: 100%;margin-top: 20px">
  40. <el-table-column
  41. prop="propertiesItemNo"
  42. header-align="center"
  43. align="left"
  44. min-width="60"
  45. label="属性编码">
  46. </el-table-column>
  47. <el-table-column
  48. prop="itemDesc"
  49. header-align="center"
  50. align="left"
  51. min-width="60"
  52. label="属性描述">
  53. </el-table-column>
  54. <el-table-column
  55. prop="textValue"
  56. header-align="center"
  57. align="left"
  58. min-width="60"
  59. label="文本值">
  60. </el-table-column>
  61. <el-table-column
  62. prop="numValue"
  63. header-align="center"
  64. align="right"
  65. min-width="60"
  66. label="数字值">
  67. </el-table-column>
  68. <el-table-column
  69. prop="valueType"
  70. header-align="center"
  71. align="left"
  72. min-width="60"
  73. label="属性类型">
  74. </el-table-column>
  75. </el-table>
  76. </el-tab-pane>
  77. <el-tab-pane label="产品结构" name="tab2" >
  78. <el-form :inline="true" style="margin-top: 10px;margin-left: 20px" label-position="top">
  79. <el-form-item :label="'版本号:'">
  80. <el-input v-model="bomRevNo" style="width: 120px" readonly></el-input>
  81. </el-form-item>
  82. <el-form-item :label="''">
  83. <el-button @click="lastBom()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">上一版本</el-button>
  84. </el-form-item>
  85. <el-form-item :label="''">
  86. <el-button @click="nextBom()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">下一版本</el-button>
  87. </el-form-item>
  88. <el-form-item :label="''">
  89. <el-button @click="jumpLastPart()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">回退</el-button>
  90. </el-form-item>
  91. </el-form>
  92. <el-table
  93. :height="height"
  94. :data="bomTable"
  95. border
  96. style="width: 100%;margin-top: 20px">
  97. <el-table-column
  98. prop="componentPartNo"
  99. header-align="center"
  100. align="left"
  101. min-width="40"
  102. label="零部件编码">
  103. <template slot-scope="scope">
  104. <a @click="jumpPart(scope.row.componentPartNo)">{{scope.row.componentPartNo}}</a>
  105. </template>
  106. </el-table-column>
  107. <el-table-column
  108. prop="revNo"
  109. header-align="center"
  110. align="left"
  111. min-width="30"
  112. label="零部件版本">
  113. </el-table-column>
  114. <el-table-column
  115. prop="partDesc"
  116. header-align="center"
  117. align="left"
  118. min-width="100"
  119. label="零部件规格/名称">
  120. </el-table-column>
  121. <el-table-column
  122. prop="qtyAssembly"
  123. header-align="center"
  124. align="right"
  125. min-width="30"
  126. label="单位用量/比例">
  127. </el-table-column>
  128. <el-table-column
  129. prop="qtyFixedScrapt"
  130. header-align="center"
  131. align="right"
  132. min-width="30"
  133. label="调机量">
  134. </el-table-column>
  135. <el-table-column
  136. prop="scraptFactor"
  137. header-align="center"
  138. align="right"
  139. min-width="30"
  140. label="损耗率">
  141. </el-table-column>
  142. <el-table-column
  143. prop="umid"
  144. header-align="center"
  145. align="left"
  146. min-width="30"
  147. label="计量单位">
  148. </el-table-column>
  149. <el-table-column
  150. prop="qtyAssemblyPerRecipe"
  151. header-align="center"
  152. align="right"
  153. min-width="30"
  154. label="配方单位用量">
  155. </el-table-column>
  156. </el-table>
  157. </el-tab-pane>
  158. <el-tab-pane label="工艺路线" name="tab3" >
  159. <el-form :inline="true" style="margin-top: 10px;margin-left: 20px" label-position="top">
  160. <el-form-item :label="'版本号:'">
  161. <el-input v-model="routingRevNo" style="width: 120px" readonly></el-input>
  162. </el-form-item>
  163. <el-form-item :label="''">
  164. <el-button @click="lastRouting()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">上一版本</el-button>
  165. </el-form-item>
  166. <el-form-item :label="''">
  167. <el-button @click="nextRouting()" style="margin-top: 10px;margin-left: 24px;height: 35px;width: 90px" type="primary">下一版本</el-button>
  168. </el-form-item>
  169. </el-form>
  170. <el-table
  171. :height="height"
  172. :data="routingTable"
  173. border
  174. style="width: 100%;margin-top: 20px">
  175. <el-table-column
  176. prop="itemNo"
  177. header-align="center"
  178. align="left"
  179. min-width="60"
  180. label="工序">
  181. </el-table-column>
  182. <el-table-column
  183. prop="operationDesc"
  184. header-align="center"
  185. align="left"
  186. min-width="30"
  187. label="工序名称">
  188. </el-table-column>
  189. <el-table-column
  190. prop="workCenterNo"
  191. header-align="center"
  192. align="left"
  193. min-width="100"
  194. label="加工中心编码">
  195. </el-table-column>
  196. <el-table-column
  197. prop="qtyAssembly"
  198. header-align="center"
  199. align="right"
  200. min-width="30"
  201. label="加工中心名称">
  202. </el-table-column>
  203. <el-table-column
  204. prop="machSetupTime"
  205. header-align="center"
  206. align="right"
  207. min-width="30"
  208. label="准备时间">
  209. </el-table-column>
  210. <el-table-column
  211. prop="machRunFactor"
  212. header-align="center"
  213. align="right"
  214. min-width="30"
  215. label="单位产出量">
  216. </el-table-column>
  217. <el-table-column
  218. prop="factorUnit"
  219. header-align="center"
  220. align="left"
  221. min-width="30"
  222. label="产出单位">
  223. </el-table-column>
  224. </el-table>
  225. </el-tab-pane>
  226. </el-tabs>
  227. </div>
  228. </template>
  229. <script>
  230. import {
  231. getPartSubPropertiesValueData,
  232. getPartSubPropertiesValueHeaderData,
  233. getBomDetailData,
  234. getRoutingDetailData,
  235. getPartData,
  236. } from '@/api/pad.js'
  237. export default {
  238. name: 'padPartAttribute',
  239. data () {
  240. return {
  241. activeTable: 'tab1',
  242. height:200,
  243. tableData:[],
  244. currentData: {},
  245. searchData:{
  246. site:'',
  247. partNo:'',
  248. },
  249. partDescription:'',
  250. num:'',
  251. bomNum:'',
  252. routingNum:'',
  253. subCodeDesc:'',
  254. list:[],
  255. bomList:[],
  256. routingList:[],
  257. bomRevNo:'',
  258. routingRevNo:'',
  259. bomTable:[],
  260. routingTable:[],
  261. lastPart:[],
  262. }
  263. },
  264. mounted () {
  265. this.$nextTick(() => {
  266. this.height = window.innerHeight - 230
  267. })
  268. },
  269. methods: {
  270. getData(){
  271. this.lastPart=[];
  272. this.currentData = JSON.parse(localStorage.getItem("partData"))
  273. this.searchData.partNo = this.currentData.partNo
  274. this.num=1;
  275. this.bomNum=1;
  276. this.routingNum=1;
  277. this.remark=this.currentData.remark;
  278. this.searchData.site= this.currentData.site;
  279. this.partDescription= this.currentData.partDescription+(this.currentData.spec ?'/'+this.currentData.spec:"");
  280. getPartSubPropertiesValueHeaderData(this.searchData).then(({data}) => {
  281. this.list = data.rows;
  282. this.bomList = data.rows2;
  283. this.routingList = data.rows3;
  284. // if(data.rows.length==0){
  285. // this.$alert('该物料没有设置属性!', '错误', {
  286. // confirmButtonText: '确定'
  287. // })
  288. // return false;
  289. // }
  290. this.search();
  291. this.searchBom();
  292. this.searchRouting()
  293. this.subCodeDesc=this.list[this.num-1].subCodeDesc;
  294. })
  295. },
  296. jumpPart(partNo){
  297. let lastPartNo=JSON.parse(JSON.stringify(this.searchData.partNo));
  298. let inData={
  299. site:this.currentData.site,
  300. partNo:partNo,
  301. }
  302. getPartData(inData).then(({data}) => {
  303. this.lastPart.push({site:this.searchData.site,partNo:lastPartNo})
  304. this.searchData.partNo = data.rows[0].partNo
  305. this.num=1;
  306. this.bomNum=1;
  307. this.routingNum=1;
  308. this.remark=data.rows[0].remark;
  309. this.searchData.site= data.rows[0].site;
  310. this.partDescription= data.rows[0].partDescription+'/'+data.rows[0].spec;
  311. getPartSubPropertiesValueHeaderData(this.searchData).then(({data}) => {
  312. this.list = data.rows;
  313. this.bomList = data.rows2;
  314. this.routingList = data.rows3;
  315. // if(data.rows.length==0){
  316. // this.$alert('该物料没有设置属性!', '错误', {
  317. // confirmButtonText: '确定'
  318. // })
  319. // return false;
  320. // }
  321. this.search();
  322. this.searchBom();
  323. this.searchRouting()
  324. this.subCodeDesc=this.list[this.num-1].subCodeDesc;
  325. })
  326. })
  327. },
  328. jumpLastPart(){
  329. if(this.lastPart.length==0){
  330. return false;
  331. }
  332. getPartData(this.lastPart[this.lastPart.length-1]).then(({data}) => {
  333. this.searchData.partNo = data.rows[0].partNo
  334. this.num=1;
  335. this.bomNum=1;
  336. this.routingNum=1;
  337. this.remark=data.rows[0].remark;
  338. this.searchData.site= data.rows[0].site;
  339. this.partDescription= data.rows[0].partDescription+'/'+data.rows[0].spec;
  340. this.lastPart.pop();
  341. getPartSubPropertiesValueHeaderData(this.searchData).then(({data}) => {
  342. this.list = data.rows;
  343. this.bomList = data.rows2;
  344. this.routingList = data.rows3;
  345. // if(data.rows.length==0){
  346. // this.$alert('该物料没有设置属性!', '错误', {
  347. // confirmButtonText: '确定'
  348. // })
  349. // return false;
  350. // }
  351. this.search();
  352. this.searchBom();
  353. this.searchRouting()
  354. if(this.list.length>0) {
  355. this.subCodeDesc = this.list[this.num - 1].subCodeDesc;
  356. }else {
  357. this.subCodeDesc ='';
  358. }
  359. })
  360. })
  361. },
  362. search(){
  363. if( this.list.length==0){
  364. this.tableData =[];
  365. return false;
  366. }
  367. let postData={
  368. site:this.searchData.site,
  369. partNo:this.searchData.partNo,
  370. subCodeSeqNo:this.num,
  371. }
  372. getPartSubPropertiesValueData(postData).then(({data}) => {
  373. this.tableData = data.rows
  374. })
  375. },
  376. searchBom(){
  377. if( this.bomList.length==0){
  378. this.bomTable =[];
  379. this.bomRevNo="";
  380. return false;
  381. }
  382. this.bomRevNo=this.bomList[this.bomNum-1].revNo
  383. let postData={
  384. site:this.searchData.site,
  385. partNo:this.searchData.partNo,
  386. revNo:this.bomList[this.bomNum-1].revNo,
  387. }
  388. getBomDetailData(postData).then(({data}) => {
  389. this.bomTable = data.rows
  390. })
  391. },
  392. searchRouting(){
  393. if( this.routingList.length==0){
  394. this.routingTable =[];
  395. this.routingRevNo='';
  396. return false;
  397. }
  398. this.routingRevNo=this.routingList[this.routingNum-1].revNo
  399. let postData={
  400. site:this.searchData.site,
  401. partNo:this.searchData.partNo,
  402. revNo:this.routingList[this.routingNum-1].revNo,
  403. }
  404. getRoutingDetailData(postData).then(({data}) => {
  405. this.routingTable = data.rows
  406. })
  407. },
  408. jump(){
  409. // this.$router.push('/padPart');
  410. this.$router.back();
  411. },
  412. nextData(){
  413. if(this.list.length==0){
  414. this.$alert('该物料没有设置属性!', '错误', {
  415. confirmButtonText: '确定'
  416. })
  417. return false;
  418. }
  419. if(this.num==this.list.length){
  420. this.num=1;
  421. }else{
  422. this.num=this.num+1;
  423. }
  424. let i=this.num-1;
  425. this.subCodeDesc=this.list[i].subCodeDesc;
  426. this.search();
  427. },
  428. lastData(){
  429. if(this.list.length==0){
  430. this.$alert('该物料没有设置属性!', '错误', {
  431. confirmButtonText: '确定'
  432. })
  433. return false;
  434. }
  435. if(this.num==1){
  436. this.num=this.list.length;
  437. }else{
  438. this.num=this.num-1;
  439. }
  440. let i=this.num-1;
  441. this.subCodeDesc=this.list[i].subCodeDesc;
  442. this.search();
  443. },
  444. nextBom(){
  445. if(this.bomList.length==0){
  446. this.$alert('该物料没有维护bom!', '错误', {
  447. confirmButtonText: '确定'
  448. })
  449. return false;
  450. }
  451. if(this.bomNum==this.bomList.length){
  452. this.bomNum=1;
  453. }else{
  454. this.bomNum=this.bomNum+1;
  455. }
  456. let i=this.bomNum-1;
  457. this.searchBom();
  458. },
  459. lastBom(){
  460. if(this.bomList.length==0){
  461. this.$alert('该物料没有维护bom!', '错误', {
  462. confirmButtonText: '确定'
  463. })
  464. return false;
  465. }
  466. if(this.bomNum==1){
  467. this.bomNum=this.bomList.length;
  468. }else{
  469. this.bomNum=this.bomNum-1;
  470. }
  471. // let i=this.num-1;
  472. // this.subCodeDesc=this.list[i].subCodeDesc;
  473. this.searchBom();
  474. },
  475. nextRouting(){
  476. if(this.routingList.length==0){
  477. this.$alert('该物料没有工艺路线!', '错误', {
  478. confirmButtonText: '确定'
  479. })
  480. return false;
  481. }
  482. if(this.routingNum==this.routingList.length){
  483. this.routingNum=1;
  484. }else{
  485. this.routingNum=this.routingNum+1;
  486. }
  487. let i=this.routingNum-1;
  488. this.searchRouting();
  489. },
  490. lastRouting(){
  491. if(this.routingList.length==0){
  492. this.$alert('该物料没有工艺路线!', '错误', {
  493. confirmButtonText: '确定'
  494. })
  495. return false;
  496. }
  497. if(this.routingNum==1){
  498. this.routingNum=this.routingList.length;
  499. }else{
  500. this.routingNum=this.routingNum-1;
  501. }
  502. // let i=this.num-1;
  503. // this.subCodeDesc=this.list[i].subCodeDesc;
  504. this.searchRouting();
  505. },
  506. // 列表表格选择替换
  507. tabClick (tab, event) {
  508. },
  509. },
  510. created () {
  511. this.getData();
  512. }
  513. }
  514. </script>
  515. <style scoped>
  516. </style>