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

168 lines
4.9 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" >
  4. <el-form-item :label="'电视机ID'">
  5. <el-input v-model="searchData.tvId" style="width: 130px"></el-input>
  6. </el-form-item>
  7. <el-form-item :label="'工位'">
  8. <el-input v-model="searchData.workStation" style="width: 130px"></el-input>
  9. <el-button @click="search()" style="margin-left: 0px;margin-top:0px" type="primary">查询</el-button>
  10. </el-form-item>
  11. </el-form>
  12. <el-table
  13. :height="height"
  14. :data="tableData"
  15. border
  16. style="width: 100%">
  17. <el-table-column
  18. v-for="(item,index) in columnList" :key="index"
  19. :sortable="item.columnSortable"
  20. :prop="item.columnProp"
  21. header-align="center"
  22. :show-overflow-tooltip="item.showOverflowTooltip"
  23. :align="item.align"
  24. :fixed="item.fixed==''?false:item.fixed"
  25. :min-width="item.columnWidth"
  26. :label="item.columnLabel">
  27. <template slot-scope="scope">
  28. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  29. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  30. style="width: 100px; height: 80px"/></span>
  31. </template>
  32. </el-table-column>
  33. <el-table-column
  34. prop=""
  35. header-align="center"
  36. align="center"
  37. width="140"
  38. fixed="right"
  39. label="操作">
  40. <template slot-scope="scope" class="foo_container">
  41. <a type="text" size="small" @click="tvModel(scope.row)">修改工位</a>
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. <el-dialog title="维护工位" :close-on-click-modal="false" v-drag :visible.sync="tvModalFlag" width="215px">
  46. <el-form :inline="true" label-position="top" style="margin-left: 22px;margin-top: -5px;" @submit.native.prevent>
  47. <el-form-item :label="'工位'">
  48. <el-input v-model="tvData.workStation" style="width: 130px;" ></el-input>
  49. </el-form-item>
  50. </el-form>
  51. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  52. <el-button type="primary" @click="updateWorkStation()">确定</el-button>
  53. <el-button type="primary" @click="tvModalFlag = false">取消</el-button>
  54. </el-footer>
  55. </el-dialog>
  56. </div>
  57. </template>
  58. <script>
  59. import {
  60. getTvList,
  61. updateWorkStation,
  62. } from '@/api/production.js'
  63. export default {
  64. name: 'tvList',
  65. data () {
  66. return {
  67. tvData:{
  68. tvId:'',
  69. workStation:'',
  70. },
  71. tvModalFlag:false,
  72. columnList: [
  73. {
  74. tableId: "tvSopBase",
  75. tableName: this.$route.meta.title,
  76. columnProp: "tvId",
  77. columnLabel: "电视机ID",
  78. columnHidden: false,
  79. columnImage: false,
  80. columnSortable: false,
  81. columnWidth: 80,
  82. format: null,
  83. functionId: this.$route.meta.menuId,
  84. sortLv: 0,
  85. status: true,
  86. fixed: '',
  87. serialNumber: null,
  88. columnType: null,
  89. align: 'left'
  90. }, {
  91. tableId: "tvSopBase",
  92. tableName: this.$route.meta.title,
  93. columnProp: "workStation",
  94. columnLabel: "工位",
  95. columnHidden: false,
  96. columnImage: false,
  97. columnSortable: false,
  98. columnWidth: 80,
  99. format: null,
  100. functionId: this.$route.meta.menuId,
  101. sortLv: 0,
  102. status: true,
  103. fixed: '',
  104. serialNumber: null,
  105. columnType: null,
  106. align: 'left'
  107. }
  108. ],
  109. visible:false,
  110. // 导出 end
  111. height: 200,
  112. tableData: [],
  113. searchData: {
  114. tvId:'',
  115. workStation: '',
  116. },
  117. }
  118. },
  119. mounted () {
  120. this.$nextTick(() => {
  121. this.height = window.innerHeight - 210
  122. })
  123. },
  124. methods: {
  125. search () {
  126. getTvList(this.searchData).then(({data}) => {
  127. this.tableData = data.rows
  128. })
  129. },
  130. tvModel(row){
  131. this.tvData.tvId=row.tvId;
  132. this.tvData.workStation=row.workStation;
  133. this.tvModalFlag=true;
  134. },
  135. updateWorkStation(){
  136. updateWorkStation(this.tvData).then(({data}) => {
  137. if (data && data.code === 0) {
  138. this.search();
  139. this.tvModalFlag = false
  140. this.$message({
  141. message: '操作成功',
  142. type: 'success',
  143. duration: 1500,
  144. onClose: () => {
  145. }
  146. })
  147. } else {
  148. this.$alert(data.msg, '错误', {
  149. confirmButtonText: '确定'
  150. })
  151. }
  152. })
  153. },
  154. },
  155. created () {
  156. this.search();
  157. }
  158. }
  159. </script>
  160. <style scoped>
  161. </style>