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

179 lines
5.3 KiB

4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
2 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
2 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 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" >
  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)">图纸</a>
  60. </template>
  61. </el-table-column>
  62. </el-table>
  63. <div style=" font-size: 18px;">
  64. <el-pagination
  65. @size-change="sizeChangeHandle"
  66. @current-change="currentChangeHandle"
  67. :current-page="pageIndex"
  68. :page-sizes="[20, 100, 500, 1000]"
  69. :page-size="pageSize"
  70. :total="totalPage"
  71. layout="total, sizes, prev, pager, next, jumper">
  72. </el-pagination>
  73. </div>
  74. </div>
  75. </template>
  76. <script>
  77. import {
  78. searchPartData
  79. } from '@/api/pad.js'
  80. export default {
  81. name: 'padPart1',
  82. data () {
  83. return {
  84. height:200,
  85. tableData:[],
  86. searchData:{
  87. site:'1',
  88. searchIn:'',
  89. page: 1,
  90. limit: 10,
  91. },
  92. pageIndex: 1,
  93. pageSize: 20,
  94. totalPage: 0,
  95. }
  96. },
  97. mounted () {
  98. this.$nextTick(() => {
  99. this.height = window.innerHeight - 210
  100. })
  101. },
  102. methods: {
  103. // 每页数
  104. sizeChangeHandle (val) {
  105. this.pageSize = val
  106. this.pageIndex = 1
  107. this.search()
  108. },
  109. // 当前页
  110. currentChangeHandle (val) {
  111. this.pageIndex = val
  112. this.search()
  113. },
  114. jumpPadPartAttribute(row){
  115. let pageData={
  116. pageIndex: this.pageIndex,
  117. pageSize: this.pageSize,
  118. totalPage: this.totalPage,
  119. }
  120. localStorage.removeItem("search")
  121. localStorage.removeItem("flag")
  122. localStorage.setItem("partData",JSON.stringify(row))
  123. localStorage.setItem("search",JSON.stringify(this.searchData))
  124. localStorage.setItem("tableData",JSON.stringify(this.tableData))
  125. localStorage.setItem("pageData",JSON.stringify(pageData))
  126. this.$router.push('/padPartAttribute');
  127. },
  128. jumpPadPartPhoto(row){
  129. let pageData={
  130. pageIndex: this.pageIndex,
  131. pageSize: this.pageSize,
  132. totalPage: this.totalPage,
  133. }
  134. localStorage.removeItem("search")
  135. localStorage.removeItem("flag")
  136. localStorage.setItem("pictureData",JSON.stringify(row))
  137. localStorage.setItem("search",JSON.stringify(this.searchData))
  138. localStorage.setItem("tableData",JSON.stringify(this.tableData))
  139. localStorage.setItem("pageData",JSON.stringify(pageData))
  140. this.$router.push('/padPartPhoto');
  141. },
  142. search(){
  143. this.searchData.limit = this.pageSize
  144. this.searchData.page = this.pageIndex
  145. searchPartData(this.searchData).then(({data}) => {
  146. this.tableData = data.page.list
  147. this.pageIndex = data.page.currPage
  148. this.pageSize = data.page.pageSize
  149. this.totalPage = data.page.totalCount
  150. })
  151. },
  152. getData(){
  153. let data1= JSON.parse(localStorage.getItem("search"))
  154. this.searchData.site=data1.site;
  155. this.searchData.searchIn=data1.searchIn;
  156. this.tableData= JSON.parse(localStorage.getItem("tableData"))
  157. let pageData= JSON.parse(localStorage.getItem("pageData"))
  158. this.pageIndex=pageData.pageIndex
  159. this.pageSize=pageData.pageSize
  160. this.totalPage=pageData.totalPage
  161. }
  162. },
  163. created () {
  164. localStorage.removeItem("partData")
  165. localStorage.removeItem("pictureData")
  166. this.getData();
  167. }
  168. }
  169. </script>
  170. <style scoped>
  171. .el-select-dropdown__item{
  172. font-size: 18px;
  173. }
  174. </style>