patternList.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <div>
  3. <div class="gva-table-box">
  4. <el-form :inline="true" style="padding: 20px;">
  5. <!-- 店铺下拉 -->
  6. <el-form-item label="选择店铺">
  7. <el-select v-model="shopValue" placeholder="请选择店铺" clearable style="width: 180px;">
  8. <el-option v-for="item in shopOptions" :key="item.value" :label="item.label" :value="item.value" />
  9. </el-select>
  10. </el-form-item>
  11. <!-- SKC输入 -->
  12. <el-form-item label="SKC编码">
  13. <el-input v-model="searchInfo" placeholder="请输入SKC编码" clearable style="width: 180px;" />
  14. </el-form-item>
  15. <!-- 查询按钮 -->
  16. <el-form-item>
  17. <el-button type="primary" @click="onSubmit">查询</el-button>
  18. </el-form-item>
  19. </el-form>
  20. <!-- 表格 -->
  21. <el-table
  22. ref="multipleTable"
  23. style="width: 100%; height: 65vh"
  24. :row-style="{ height: '20px' }"
  25. :header-cell-style="{ padding: '0px' }"
  26. :cell-style="{ padding: '0px' }"
  27. :header-row-style="{ height: '20px' }"
  28. border
  29. tooltip-effect="dark"
  30. :data="tableData"
  31. row-key="ID"
  32. highlight-current-row="true"
  33. :cell-class-name="tableDataCellClass"
  34. @row-click="Clickonthetable"
  35. @row-dblclick="Doubleclickonthetable"
  36. @selection-change="cjsSelectionChange"
  37. :show-overflow-tooltip="true"
  38. >
  39. <el-table-column align="center" type="selection" width="30" />
  40. <el-table-column align="left" sortable label="订单编号" prop="订单编号" width="105" />
  41. </el-table>
  42. <!-- 分页 -->
  43. <div class="gva-pagination">
  44. <el-pagination
  45. @size-change="handleSizeChange"
  46. @current-change="handleCurrentChange"
  47. :current-page="page"
  48. :page-sizes="[10, 30, 50, 100]"
  49. :page-size="pageSize"
  50. layout="total, sizes, prev, pager, next, jumper"
  51. :total="total"
  52. />
  53. </div>
  54. </div>
  55. </div>
  56. </template>
  57. <script setup>
  58. import { ref, reactive, onMounted } from 'vue'
  59. import { ElMessage } from 'element-plus'
  60. import { useUserStore } from '@/pinia/modules/user'
  61. import {PatternApi} from '@/api/mes/job'
  62. defineOptions({ name: '06PackingDocuments' })
  63. // 用户信息
  64. const userStore = useUserStore()
  65. const _username = ref(`${userStore.userInfo.userName}/${userStore.userInfo.nickName}`)
  66. console.log('用户名称:', _username.value)
  67. // 当前日期
  68. const today = new Date()
  69. const year = today.getFullYear()
  70. const month = String(today.getMonth() + 1).padStart(2, '0')
  71. const day = String(today.getDate()).padStart(2, '0')
  72. const hours = String(today.getHours()).padStart(2, '0')
  73. const minutes = String(today.getMinutes()).padStart(2, '0')
  74. const seconds = String(today.getSeconds()).padStart(2, '0')
  75. const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
  76. const currentDates = `${year}-${month}-${day}`
  77. // 下拉框
  78. const shopValue = ref('')
  79. const shopOptions = ref([
  80. { label: 'hengda xiaodian', value: '634418222212751' },
  81. { label: 'LuxePanels', value: 'LuxePanels' }
  82. ])
  83. // 搜索框
  84. const searchInfo = ref('')
  85. // 表格数据
  86. const tableData = reactive([])
  87. // 分页
  88. const total = ref(0)
  89. const page = ref(1)
  90. const pageSize = ref(10)
  91. // 查询逻辑
  92. const onSubmit = async () => {
  93. console.log('查询触发:')
  94. console.log('店铺:', shopValue.value)
  95. console.log('SKC:', searchInfo.value)
  96. const res = await PatternApi({ pattern_id: shopValue.value });
  97. console.log(res)
  98. }
  99. // 表格交互
  100. const Clickonthetable = (row) => {
  101. console.log('点击行:', row)
  102. }
  103. const Doubleclickonthetable = (row) => {
  104. console.log('双击行:', row)
  105. }
  106. const cjsSelectionChange = (row) => {
  107. console.log('选择变更:', row)
  108. }
  109. const tableDataCellClass = () => {
  110. return ''
  111. }
  112. // 分页事件
  113. const handleCurrentChange = (val) => {
  114. page.value = val
  115. }
  116. const handleSizeChange = (val) => {
  117. pageSize.value = val
  118. }
  119. </script>
  120. <style scoped>
  121. :deep(.el-table__body .warning-row) {
  122. background: #FFFF80 !important;
  123. }
  124. :deep(.el-table__body tr.current-row)>td {
  125. background: #ff80ff !important;
  126. }
  127. :deep(.el-table .bg-yellow) {
  128. background: yellow;
  129. }
  130. :deep(.el-table td .cell) {
  131. line-height: 25px !important;
  132. }
  133. :deep(.el-tabs__header) {
  134. margin-bottom: 0;
  135. }
  136. .search {
  137. margin-left: 0px !important;
  138. margin-right: 10px !important;
  139. }
  140. .bt {
  141. margin-left: 2px !important;
  142. padding: 3px !important;
  143. font-size: 12px;
  144. }
  145. .el-tabs__header {
  146. margin: 0px !important;
  147. }
  148. .gva-table-box {
  149. padding: 0px !important;
  150. }
  151. .mab {
  152. margin-bottom: 5px;
  153. }
  154. </style>