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

133 lines
3.8 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <div class="mod-config pad" style="margin-top: 10px">
  3. <el-form inline="true" style="margin-top: 0px;" label-position="top">
  4. <el-form-item :label="'工厂编号'" style="margin-left: 20px">
  5. <el-select filterable v-model="searchData.site" style="width: 160px">
  6. <el-option label="1-沪声" value="1"></el-option>
  7. <el-option label="2-赫艾" value="2"></el-option>
  8. </el-select>
  9. </el-form-item>
  10. <el-form-item :label="'产品编码/名称/规格型号:'" style="margin-left: 20px">
  11. <el-input v-model="searchData.searchIn" style="width: 220px"></el-input>
  12. </el-form-item>
  13. <el-form-item :label="' '">
  14. <el-button @click="search()" style="margin-left: 24px;height: 35px;width: 80px" type="primary">查询</el-button>
  15. </el-form-item>
  16. </el-form>
  17. <el-table
  18. :height="height"
  19. :data="tableData"
  20. border
  21. style="margin-top: 10px;width: 100%">
  22. <el-table-column
  23. prop="site"
  24. header-align="center"
  25. align="left"
  26. min-width="30"
  27. label="工厂编号">
  28. </el-table-column>
  29. <el-table-column
  30. prop="partNo"
  31. header-align="center"
  32. align="left"
  33. min-width="60"
  34. label="产品编码">
  35. </el-table-column>
  36. <el-table-column
  37. prop="partDescription"
  38. header-align="center"
  39. align="left"
  40. min-width="60"
  41. label="产品名称">
  42. </el-table-column>
  43. <el-table-column
  44. prop="spec"
  45. header-align="center"
  46. align="left"
  47. min-width="60"
  48. label="规格型号">
  49. </el-table-column>
  50. <el-table-column
  51. prop=""
  52. fixed="right"
  53. header-align="center"
  54. align="center"
  55. min-width="30"
  56. label="操作">
  57. <template slot-scope="scope">
  58. <a type="text" size="small" @click="jumpPadPartAttribute(scope.row)">属性</a> &nbsp&nbsp|&nbsp&nbsp
  59. <a type="text" size="small" @click="jumpPadPartPhoto(scope.row)">SOP</a>
  60. </template>
  61. </el-table-column>
  62. </el-table>
  63. </div>
  64. </template>
  65. <script>
  66. import {
  67. getPartData
  68. } from '@/api/pad.js'
  69. export default {
  70. name: 'padPart1',
  71. data () {
  72. return {
  73. height:200,
  74. tableData:[],
  75. searchData:{
  76. site:'1',
  77. searchIn:'',
  78. },
  79. }
  80. },
  81. mounted () {
  82. this.$nextTick(() => {
  83. this.height = window.innerHeight - 150
  84. })
  85. },
  86. methods: {
  87. jumpPadPartAttribute(row){
  88. localStorage.removeItem("search")
  89. localStorage.removeItem("flag")
  90. localStorage.setItem("partData",JSON.stringify(row))
  91. localStorage.setItem("search",JSON.stringify(this.searchData))
  92. localStorage.setItem("tableData",JSON.stringify(this.tableData))
  93. this.$router.push('/padPartAttribute');
  94. },
  95. jumpPadPartPhoto(row){
  96. localStorage.removeItem("search")
  97. localStorage.removeItem("flag")
  98. localStorage.setItem("pictureData",JSON.stringify(row))
  99. localStorage.setItem("search",JSON.stringify(this.searchData))
  100. localStorage.setItem("tableData",JSON.stringify(this.tableData))
  101. this.$router.push('/padPartPhoto');
  102. },
  103. search(){
  104. getPartData(this.searchData).then(({data}) => {
  105. this.tableData = data.rows
  106. })
  107. },
  108. getData(){
  109. let data1= JSON.parse(localStorage.getItem("search"))
  110. this.searchData.site=data1.site;
  111. this.searchData.searchIn=data1.searchIn;
  112. this.tableData= JSON.parse(localStorage.getItem("tableData"))
  113. }
  114. },
  115. created () {
  116. localStorage.removeItem("partData")
  117. localStorage.removeItem("pictureData")
  118. this.getData();
  119. }
  120. }
  121. </script>
  122. <style scoped>
  123. .el-select-dropdown__item{
  124. font-size: 18px;
  125. }
  126. </style>