pre.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <hc-card>
  3. <template #header>
  4. <hc-new-switch :datas="tabTab" :keys="tabKey" :round="false" size="default" @change="tabChange" />
  5. <div v-if="tabKey === 'key2'" class="ml-3 w-40">
  6. <el-select v-model="searchForm.key1" filterable block placeholder="选择工区">
  7. <el-option label="工区1" value="1" />
  8. <el-option label="工区2" value="2" />
  9. <el-option label="工区3" value="3" />
  10. </el-select>
  11. </div>
  12. <div class="ml-5 font-400 text-orange">温馨提示:已经被变更方案引用的预变更,无法进行修改、删除操作</div>
  13. </template>
  14. <template #extra>
  15. <el-button hc-btn type="primary" @click="addModalClick">
  16. <HcIcon name="add" />
  17. <span>新增</span>
  18. </el-button>
  19. </template>
  20. <div class="relative h-full flex">
  21. <div id="hc_table_card" class="flex-1">
  22. <hc-card-item>
  23. <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading">
  24. <template #action="{ row }">
  25. <el-link type="success" @click="rowEditClick(row)">修改</el-link>
  26. <el-link type="danger">删除</el-link>
  27. </template>
  28. </hc-table>
  29. <template #action>
  30. <hc-pages :pages="searchForm" @change="pageChange" />
  31. </template>
  32. </hc-card-item>
  33. </div>
  34. <div id="hc_info_card">
  35. <el-scrollbar>
  36. <hc-card-item title="详情信息">
  37. <hc-info-table>
  38. <tr>
  39. <hc-info-table-td center is-title>预变更编号:</hc-info-table-td>
  40. <hc-info-table-td width="120px">33</hc-info-table-td>
  41. <hc-info-table-td center is-title>预变更名称:</hc-info-table-td>
  42. <hc-info-table-td width="120px">测试的</hc-info-table-td>
  43. <hc-info-table-td center is-title>变更申请金额:</hc-info-table-td>
  44. <hc-info-table-td width="120px">1</hc-info-table-td>
  45. </tr>
  46. <tr>
  47. <hc-info-table-td center is-title>变更类型:</hc-info-table-td>
  48. <hc-info-table-td width="120px">一般变更</hc-info-table-td>
  49. <hc-info-table-td center is-title>延长工期:</hc-info-table-td>
  50. <hc-info-table-td width="120px">-</hc-info-table-td>
  51. <hc-info-table-td center is-title>变更发起单位:</hc-info-table-td>
  52. <hc-info-table-td width="120px">-</hc-info-table-td>
  53. </tr>
  54. <tr>
  55. <hc-info-table-td center is-title>业务日期:</hc-info-table-td>
  56. <hc-info-table-td width="auto">-</hc-info-table-td>
  57. <hc-info-table-td center is-title>实际变更桩号:</hc-info-table-td>
  58. <hc-info-table-td width="auto" colspan="3">-</hc-info-table-td>
  59. </tr>
  60. <tr>
  61. <hc-info-table-td center is-title>变更原因:</hc-info-table-td>
  62. <hc-info-table-td width="auto" colspan="5">-</hc-info-table-td>
  63. </tr>
  64. </hc-info-table>
  65. </hc-card-item>
  66. <hc-card-item class="mt-3" title="变更申请部位">
  67. <hc-table :column="tableColumn1" :datas="tableData1" />
  68. </hc-card-item>
  69. <hc-card-item class="mt-3" title="变更申请清单">
  70. <div class="hc-table-ref-box no-border">
  71. <el-table class="w-full" :data="tableData" row-key="id" height="100%" highlight-current-row border>
  72. <el-table-column type="index" label="序号" />
  73. <el-table-column prop="key1" label="清单编号" />
  74. <el-table-column prop="key2" label="清单名称" />
  75. <el-table-column prop="key3" label="单价" />
  76. <el-table-column label="数量" align="center">
  77. <el-table-column prop="key5" label="变更前" />
  78. <el-table-column prop="key6" label="变更增减" />
  79. <el-table-column prop="key7" label="变更后" />
  80. </el-table-column>
  81. <el-table-column label="金额" align="center">
  82. <el-table-column prop="key8" label="变更前" />
  83. <el-table-column prop="key9" label="变更增减" />
  84. <el-table-column prop="key10" label="变更后" />
  85. </el-table-column>
  86. </el-table>
  87. </div>
  88. </hc-card-item>
  89. </el-scrollbar>
  90. </div>
  91. </div>
  92. <!-- 新增修改的弹窗 -->
  93. <addModal v-model="isAddShow" />
  94. </hc-card>
  95. </template>
  96. <script setup>
  97. import { nextTick, onMounted, ref } from 'vue'
  98. import addModal from './components/pre/addModal.vue'
  99. defineOptions({
  100. name: 'AlterAdminPre',
  101. })
  102. //渲染完成
  103. onMounted(() => {
  104. setSplitRef()
  105. })
  106. //类型tab数据和相关处理
  107. const tabKey = ref('key1')
  108. const tabTab = ref([
  109. { key: 'key1', name: '普通变更' },
  110. { key: 'key2', name: '工区变更' },
  111. ])
  112. const tabChange = (item) => {
  113. tabKey.value = item?.key
  114. console.log(item)
  115. }
  116. //初始化设置拖动分割线
  117. const setSplitRef = () => {
  118. //配置参考: https://split.js.org/#/?direction=vertical&snapOffset=0
  119. nextTick(() => {
  120. window.$split(['#hc_table_card', '#hc_info_card'], {
  121. sizes: [60, 40],
  122. snapOffset: 0,
  123. minSize: [100, 400],
  124. })
  125. })
  126. }
  127. //搜索表单
  128. const searchForm = ref({
  129. key1: null, current: 1, size: 10, total: 0,
  130. })
  131. //分页
  132. const pageChange = ({ current, size }) => {
  133. searchForm.value.current = current
  134. searchForm.value.size = size
  135. }
  136. //表格数据
  137. const tableLoading = ref(false)
  138. const tableColumn = ref([
  139. { key: 'key1', name: '预变更编号' },
  140. { key: 'key2', name: '预变更名称' },
  141. { key: 'key3', name: '预变更金额' },
  142. { key: 'key4', name: '变更类型' },
  143. { key: 'key5', name: '业务日期' },
  144. { key: 'action', name: '操作', width: 94 },
  145. ])
  146. const tableData = ref([
  147. { key1: '1111' },
  148. ])
  149. const rowEditClick = () => {
  150. }
  151. //申请部位
  152. const tableColumn1 = ref([
  153. { key: 'key1', name: '工程名称' },
  154. { key: 'key2', name: '节点路径' },
  155. { key: 'key3', name: '合同图号' },
  156. { key: 'key4', name: '变更金额(元)' },
  157. { key: 'key5', name: '是否增补' },
  158. ])
  159. const tableData1 = ref([
  160. { key1: '1111' },
  161. ])
  162. //新增修改的弹窗
  163. const isAddShow = ref(false)
  164. const addModalClick = () => {
  165. isAddShow.value = true
  166. }
  167. </script>