index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <div class="layout_display_flex_y">
  3. <div class="obviousBox" style="margin-bottom: 6px;">
  4. <searchArea :searchData="searchData" @submit="searchByForm"></searchArea>
  5. </div>
  6. <div class="layout_display_flex_y" style="height: 85%">
  7. <div style="background-color: #fff;padding: 8px">
  8. <el-button type="primary" icon="Plus" @click="onAddItem" style="margin-left: 5px">新增</el-button>
  9. </div>
  10. <el-table
  11. :data="tableData"
  12. border style="width: 100%" height="100%" stripe highlight-current-row class="ypClassTable normal-size">
  13. <el-table-column prop="code" label="项目编码">
  14. </el-table-column>
  15. <el-table-column prop="name" label="项目名称">
  16. </el-table-column>
  17. <el-table-column prop="name" label="规格">
  18. </el-table-column>
  19. <el-table-column prop="name" label="单位">
  20. </el-table-column>
  21. <el-table-column prop="name" label="物价码">
  22. </el-table-column>
  23. <el-table-column prop="delFlag" label="项目类型">
  24. </el-table-column>
  25. <el-table-column prop="delFlag" label="是否停用">
  26. </el-table-column>
  27. <el-table-column fixed="right" label="操作" min-width="180" width="180" center>
  28. <template #default="scope">
  29. <el-button type="primary" size="small" @click="editYpClass(scope.row)">编辑</el-button>
  30. <el-button :type="scope.row.delFlag !== '0' ? 'success' : 'info'" size="small"
  31. @click.prevent="changeDelFlag(scope.row)">
  32. {{ scope.row.delFlag == '0' ? '停用' : '启用' }}
  33. </el-button>
  34. </template>
  35. </el-table-column>
  36. </el-table>
  37. </div>
  38. <div>
  39. <el-pagination :current-page="pageNumber" :page-size="pageSize" :page-sizes="[10, 15, 20, 25]"
  40. :total="total" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
  41. @size-change="handleSizeChange" @current-change="handleCurrentChange">
  42. </el-pagination>
  43. </div>
  44. </div>
  45. <el-dialog v-model="showDialog" :close-on-click-modal="false" :close-on-press-escape="false"
  46. :title="(currentEditCode ? '编辑' : '新增') + '项目'" width="100%" destroy-on-close fullscreen @close="handleDialogClose">
  47. <!-- <YpPrintName :ypPrintNameDetail="ypPrintNameDetail" @closeYpPrintNameEditFor="closeYpPrintName" /> -->
  48. <info :currentEditCode="currentEditCode" @handleDialogClose="handleDialogClose"></info>
  49. </el-dialog>
  50. </template>
  51. <script setup name="YpDict">
  52. import { ref, onMounted, nextTick } from 'vue'
  53. import { ElMessage, ElMessageBox } from 'element-plus'
  54. import { getLcProjectList, insertLcProject } from '@/api/lc/project.js'
  55. import searchArea from '@/components/searchArea/index.vue';
  56. import info from '@/views/logisticsMaterials/logisticsBasicData/projectInformation/info.vue';
  57. const delFlagOption = [{ value: '0', label: '启用' }, { value: '1', label: '停用' }]
  58. const searchData = ref([
  59. {
  60. label: '项目编码',
  61. key: 'vehicleName',
  62. type: 'input',
  63. value: '',
  64. clearable: true,
  65. },
  66. {
  67. label: '项目名称',
  68. key: 'vehicleType',
  69. type: 'select',
  70. value: '',
  71. optionsData: [ //(0:轿车,1:面包车,2:越野车,3:吉普车,4:巴士,5:卡车)
  72. {
  73. label: '轿车',
  74. value: '0',
  75. },
  76. {
  77. label: '面包车',
  78. value: '1',
  79. },
  80. ],
  81. },
  82. {
  83. label: '项目类型',
  84. key: 'vehicleType',
  85. type: 'select',
  86. value: '',
  87. optionsData: [
  88. {
  89. label: '轿车',
  90. value: '0',
  91. },
  92. {
  93. label: '面包车',
  94. value: '1',
  95. },
  96. ],
  97. },
  98. {
  99. label: '是否停用',
  100. key: 'vehicleType',
  101. type: 'select',
  102. value: '',
  103. optionsData: [
  104. {
  105. label: '否',
  106. value: '0',
  107. },
  108. {
  109. label: '是',
  110. value: '1',
  111. },
  112. ],
  113. },
  114. ])
  115. const pageSize = ref(10)
  116. const pageNumber = ref(1)
  117. const total = ref(0)
  118. const currentEditCode = ref('')
  119. const tableData = ref([])
  120. const handleSizeChange = (val) => {
  121. pageSize.value = val
  122. }
  123. const handleCurrentChange = (val) => {
  124. pageNumber.value = val
  125. }
  126. let showDialog = ref(false)
  127. onMounted(() => {
  128. nextTick(() => {
  129. })
  130. })
  131. //搜索表单方法
  132. const searchByForm = (form) => {
  133. console.log("search", form)
  134. }
  135. // 新增行
  136. const onAddItem = () => {
  137. showDialog.value = true
  138. }
  139. const handleDialogClose = () => {
  140. currentEditCode.value = ""
  141. showDialog.value = false
  142. }
  143. </script>
  144. <style lang="scss" deep>
  145. .el-dialog__body {
  146. // padding: 0 16px;
  147. // height: calc(100% - 25px);
  148. }
  149. .el-tabs {
  150. height: calc(100% - 27px);
  151. .el-tabs__content {
  152. padding: 5px;
  153. height: calc(100% - 27px);
  154. }
  155. .el-tab-pane {
  156. height: calc(100% - 27px);
  157. overflow: auto;
  158. }
  159. .el-table__inner-wrapper {
  160. height: calc(100% - 10px) !important;
  161. }
  162. }
  163. .el-table .warning-row {
  164. --el-table-tr-bg-color: #dd7694;
  165. }
  166. .search-select-pre {
  167. padding: 0 12px;
  168. color: var(--el-text-color-regular);
  169. background: var(--el-fill-color-light);
  170. border-right: 1px solid var(--el-border-color);
  171. --el-select-input-padding-left: '0'
  172. }
  173. </style>