firm.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <!--
  2. firm 厂商
  3. -->
  4. <template>
  5. <el-dialog title="选择型号" :visible.sync="dialog.firm" width="900px">
  6. <div>
  7. <div id="firm">
  8. <div class="title-search query-form" style="padding: 10px;margin-bottom: 10px;">
  9. <el-input
  10. placeholder="输入厂家名称、品牌名、型号进行查找"
  11. v-model="search"
  12. size="small"
  13. style="width:300px;margin-right: 10px;"
  14. clearable
  15. ></el-input>
  16. <el-button @click="searchKey" size="small">查找</el-button>
  17. </div>
  18. <el-radio-group v-model="radio" style="width:100%;">
  19. <el-table class="data-table" border :data="tableData" style="width: 100%" height="300px">
  20. <el-table-column header-align='center' label="生产厂家">
  21. <template slot-scope="scope">
  22. <el-radio v-model="radio" :label="scope.row">{{scope.row.venderName || "--"}}</el-radio>
  23. </template>
  24. </el-table-column>
  25. <el-table-column header-align='center' prop="brandName" label="品牌"></el-table-column>
  26. <el-table-column header-align='center' prop="name" label="型号"></el-table-column>
  27. <el-table-column header-align='center' label="技术参数">
  28. <template slot-scope="scope">
  29. <el-button :disabled="scope.row.specificationId?false:true" type="text" @click="lookParam(scope.row)">技术参数</el-button>
  30. </template>
  31. </el-table-column>
  32. </el-table>
  33. </el-radio-group>
  34. <div class="right" style="background: #fff;">
  35. <p style="height:40px;line-height:40px;text-align:center;color:#9E9E9E; float: left;">
  36. 找不到想要的型号? 赶快去
  37. <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
  38. </p>
  39. <my-pagination :page="page" @change="changed" style="margin-top:10px;"></my-pagination>
  40. </div>
  41. </div>
  42. </div>
  43. <param-details :isLoad="isLoad" :data="data"></param-details>
  44. <div slot="footer">
  45. <el-button
  46. type="primary"
  47. @click="getChange"
  48. >确 定</el-button>
  49. </div>
  50. </el-dialog>
  51. </template>
  52. <script>
  53. import myPagination from "@/components/common/myPagination";
  54. import paramDetails from "@/components/business_space/dialogs/list/paramDetails"
  55. import { getSpecList } from "@/api/scan/request"
  56. export default {
  57. components: {
  58. myPagination,
  59. paramDetails
  60. },
  61. props: {
  62. dialog: {
  63. type: Object,
  64. default: function () {
  65. return {
  66. firm: false
  67. };
  68. }
  69. },
  70. mess: {
  71. type: [Object, String]
  72. }
  73. },
  74. data() {
  75. return {
  76. search: "", //搜索文案
  77. radio: "",
  78. tableData: [
  79. ],
  80. data: {},
  81. isLoad: {
  82. paramShow: false
  83. },
  84. page: {
  85. size: 50,
  86. sizes: [10, 30, 50, 100, 150, 200],
  87. total: 0,
  88. currentPage: 1
  89. },
  90. };
  91. },
  92. created() { },
  93. mounted() { },
  94. methods: {
  95. changed() {
  96. this.getData()
  97. },
  98. //查询技术参数
  99. lookParam(data) {
  100. this.data = data
  101. this.isLoad.paramShow = true
  102. },
  103. getChange() {
  104. if (!!this.radio) {
  105. this.$emit("changeFirm", this.radio)
  106. this.dialog.firm = false
  107. } else {
  108. this.$message("请选择型号")
  109. }
  110. },
  111. searchKey() {
  112. this.changePage()
  113. },
  114. changePage() {
  115. this.page = {
  116. size: 50,
  117. sizes: [10, 30, 50, 100, 150, 200],
  118. total: 0,
  119. currentPage: 1
  120. }
  121. this.getData()
  122. },
  123. getData() {
  124. getSpecList({
  125. limit: {
  126. skip: this.page.size * (this.page.currentPage - 1),
  127. count: this.page.size
  128. },
  129. eqFamily: this.mess.deviceId,
  130. name: this.search
  131. }, res => {
  132. this.page.total = res.totalCount
  133. this.tableData = res.content
  134. console.log(this.tableData)
  135. })
  136. }
  137. },
  138. watch: {
  139. dialog: {
  140. deep: true,
  141. handler: function () {
  142. if (this.dialog.firm) {
  143. console.log(this.mess)
  144. this.changePage()
  145. }
  146. }
  147. }
  148. }
  149. };
  150. </script>
  151. <style lang="less">
  152. #firm {
  153. height: 455px;
  154. overflow-y: auto;
  155. .el-table thead {
  156. tr {
  157. th {
  158. background-color: #f5f7fa;
  159. }
  160. }
  161. }
  162. }
  163. </style>