periods.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <hc-new-card title="材料预付款计量期">
  3. <template #extra>
  4. <el-button hc-btn type="primary" @click="editModalClick">
  5. <HcIcon name="edit" />
  6. <span>编辑</span>
  7. </el-button>
  8. </template>
  9. <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" is-new :index-style="{ width: 60 }">
  10. <template #action="{ row }">
  11. <el-link type="danger">锁定</el-link>
  12. </template>
  13. </hc-table>
  14. <template #action>
  15. <hc-pages :pages="searchForm" @change="pageChange" />
  16. </template>
  17. <!-- 编辑修改 -->
  18. <hc-new-dialog is-table widths="1200px" :show="editModalShow" title="材料预付款计量期编辑" @save="editModalSave" @close="editModalClose">
  19. <hc-card-item>
  20. <template #header>
  21. <el-tooltip :visible="editVisible" effect="light" placement="bottom-start">
  22. <template #content>
  23. <div class="text-sm text-red">
  24. 1.日期不能为空<br>
  25. 2.已经存在数据或者被锁定的计量期不能删除数据
  26. </div>
  27. </template>
  28. <el-button type="danger" @mouseenter="editVisible = true" @mouseleave="editVisible = false">
  29. <HcIcon name="question" />
  30. <span>编辑说明</span>
  31. </el-button>
  32. </el-tooltip>
  33. </template>
  34. <template #extra>
  35. <el-button type="primary">
  36. <HcIcon name="page-separator" :line="false" />
  37. <span>插入上一行</span>
  38. </el-button>
  39. <el-button type="primary">
  40. <HcIcon name="page-separator" :line="false" />
  41. <span>插入下一行</span>
  42. </el-button>
  43. </template>
  44. <hc-table :column="tableEditColumn" :datas="tableEditData" is-new :index-style="{ width: 60 }">
  45. <template #key1="{ row }">
  46. <hc-table-input v-model="row.key1" disabled />
  47. </template>
  48. <template #key2="{ row }">
  49. <hc-table-input v-model="row.key2" disabled />
  50. </template>
  51. <template #key3="{ row }">
  52. <el-select v-model="row.key3" placeholder="选择年份" filterable disabled block>
  53. <el-option v-for="item in yearData" :key="item" :label="item" :value="item" />
  54. </el-select>
  55. </template>
  56. <template #key4="{ row }">
  57. <el-select v-model="row.key4" placeholder="选择月份" filterable disabled block>
  58. <el-option v-for="item in monthData" :key="item" :label="item" :value="item" />
  59. </el-select>
  60. </template>
  61. <template #key5="{ row }">
  62. <el-date-picker v-model="row.key5" class="block" format="YYYY-MM-DD" type="date" value-format="YYYY-MM-DD" disabled />
  63. </template>
  64. <template #action="{ row }">
  65. <el-button plain size="small" type="danger">删除</el-button>
  66. </template>
  67. </hc-table>
  68. </hc-card-item>
  69. </hc-new-dialog>
  70. </hc-new-card>
  71. </template>
  72. <script setup>
  73. import { onMounted, ref } from 'vue'
  74. import dayjs from 'dayjs'
  75. import { getMonthList, getYearList } from 'js-fast-way'
  76. defineOptions({
  77. name: 'DebitPayMaterialPeriods',
  78. })
  79. //获取年月等相关日期数据
  80. const year = Number(dayjs().format('YYYY')) + 8
  81. const yearData = getYearList(year, 2010)
  82. const monthData = getMonthList()
  83. //渲染完成
  84. onMounted(() => {
  85. })
  86. //搜索表单
  87. const searchForm = ref({
  88. current: 1, size: 10, total: 0,
  89. })
  90. //分页
  91. const pageChange = ({ current, size }) => {
  92. searchForm.value.current = current
  93. searchForm.value.size = size
  94. }
  95. //表格数据
  96. const tableLoading = ref(false)
  97. const tableColumn = ref([
  98. { key: 'key1', name: '期号' },
  99. { key: 'key2', name: '期名称' },
  100. { key: 'key3', name: '年份' },
  101. { key: 'key4', name: '月份' },
  102. { key: 'key5', name: '报表打印日期' },
  103. { key: 'action', name: '操作', width: 80 },
  104. ])
  105. const tableData = ref([
  106. { key1: '1111' },
  107. ])
  108. //计量期编辑
  109. const editVisible = ref(false)
  110. const editModalShow = ref(false)
  111. const editModalClick = () => {
  112. editModalShow.value = true
  113. }
  114. //编辑的表格
  115. const tableEditColumn = [
  116. { key: 'key1', name: '期号' },
  117. { key: 'key2', name: '期名称' },
  118. { key: 'key3', name: '年份' },
  119. { key: 'key4', name: '月份' },
  120. { key: 'key5', name: '报表打印日期' },
  121. { key: 'action', name: '操作', width: 80, align: 'center' },
  122. ]
  123. const tableEditData = ref([
  124. { key1: '11' },
  125. { key1: '222' },
  126. ])
  127. const editModalSave = () => {
  128. editModalClose()
  129. }
  130. const editModalClose = () => {
  131. editModalShow.value = false
  132. }
  133. </script>
  134. <style scoped lang="scss">
  135. </style>