plan.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <hc-new-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. </template>
  13. <template #extra>
  14. <el-button hc-btn type="primary" @click="addModalClick">
  15. <HcIcon name="add" />
  16. <span>新增</span>
  17. </el-button>
  18. <el-button hc-btn type="warning" @click="reportClick">
  19. <HcIcon name="send-plane-2" />
  20. <span>上报</span>
  21. </el-button>
  22. </template>
  23. <div class="relative h-full flex">
  24. <div :id="`hc_table_card_${uuid}`" class="flex-1">
  25. <hc-card-item>
  26. <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" is-new :index-style="{ width: 60 }">
  27. <template #action="{ row }">
  28. <el-link type="success" @click="rowEditClick(row)">修改</el-link>
  29. <el-link type="danger">删除</el-link>
  30. </template>
  31. </hc-table>
  32. <template #action>
  33. <hc-pages :pages="searchForm" @change="pageChange" />
  34. </template>
  35. </hc-card-item>
  36. </div>
  37. <div :id="`hc_info_card_${uuid}`">
  38. <el-scrollbar>
  39. <hc-card-item title="详情信息">
  40. <hc-info-table>
  41. <tr>
  42. <hc-info-table-td center is-title>变更方案编号:</hc-info-table-td>
  43. <hc-info-table-td width="120px">33</hc-info-table-td>
  44. <hc-info-table-td center is-title>变更方案名称:</hc-info-table-td>
  45. <hc-info-table-td width="120px">测试的</hc-info-table-td>
  46. <hc-info-table-td center is-title>变更发起单位:</hc-info-table-td>
  47. <hc-info-table-td width="120px">-</hc-info-table-td>
  48. </tr>
  49. <tr>
  50. <hc-info-table-td center is-title>业务日期:</hc-info-table-td>
  51. <hc-info-table-td width="160px">2022-02-15</hc-info-table-td>
  52. <hc-info-table-td center is-title>变更类型:</hc-info-table-td>
  53. <hc-info-table-td width="120px">一般变更</hc-info-table-td>
  54. <hc-info-table-td center is-title>延长工期:</hc-info-table-td>
  55. <hc-info-table-td width="120px">-</hc-info-table-td>
  56. </tr>
  57. <tr>
  58. <hc-info-table-td center is-title>变更申请金额:</hc-info-table-td>
  59. <hc-info-table-td width="120px">116</hc-info-table-td>
  60. <hc-info-table-td center is-title>现场确认时间:</hc-info-table-td>
  61. <hc-info-table-td width="120px">2022-02-15</hc-info-table-td>
  62. <hc-info-table-td center is-title>实际变更桩号:</hc-info-table-td>
  63. <hc-info-table-td width="120px">-</hc-info-table-td>
  64. </tr>
  65. <tr>
  66. <hc-info-table-td center is-title>引用预变更:</hc-info-table-td>
  67. <hc-info-table-td width="auto" colspan="5">-</hc-info-table-td>
  68. </tr>
  69. <tr>
  70. <hc-info-table-td center is-title>变更原因:</hc-info-table-td>
  71. <hc-info-table-td width="auto" colspan="5">-</hc-info-table-td>
  72. </tr>
  73. </hc-info-table>
  74. </hc-card-item>
  75. <hc-card-item class="mt-3" title="变更申请部位">
  76. <hc-table :column="tableColumn1" :datas="tableData1" is-new :index-style="{ width: 60 }" />
  77. </hc-card-item>
  78. <hc-card-item class="mt-3" title="变更申请清单">
  79. <div class="hc-table-ref-box no-border">
  80. <el-table class="w-full" :data="tableData" row-key="id" height="100%" highlight-current-row border>
  81. <el-table-column type="index" label="序号" />
  82. <el-table-column prop="key1" label="清单编号" />
  83. <el-table-column prop="key2" label="清单名称" />
  84. <el-table-column prop="key3" label="单价" />
  85. <el-table-column label="数量" align="center">
  86. <el-table-column prop="key5" label="变更前" />
  87. <el-table-column prop="key6" label="变更增减" />
  88. <el-table-column prop="key7" label="变更后" />
  89. </el-table-column>
  90. <el-table-column label="金额" align="center">
  91. <el-table-column prop="key8" label="变更前" />
  92. <el-table-column prop="key9" label="变更增减" />
  93. <el-table-column prop="key10" label="变更后" />
  94. </el-table-column>
  95. </el-table>
  96. </div>
  97. </hc-card-item>
  98. <hc-card-item class="mt-3" title="附件列表">
  99. <hc-table :column="tableColumn2" :datas="tableData2" is-new :index-style="{ width: 60 }" />
  100. </hc-card-item>
  101. </el-scrollbar>
  102. </div>
  103. </div>
  104. <!-- 上报弹窗 -->
  105. <hc-report-dialog v-model="isReport" />
  106. <!-- 新增修改的弹窗 -->
  107. <addModal v-model="isAddShow" />
  108. </hc-new-card>
  109. </template>
  110. <script setup>
  111. import { nextTick, onMounted, ref } from 'vue'
  112. import addModal from './components/plan/addModal.vue'
  113. import { getRandom } from 'js-fast-way'
  114. defineOptions({
  115. name: 'AlterAdminPlan',
  116. })
  117. const uuid = getRandom(4)
  118. //渲染完成
  119. onMounted(() => {
  120. setSplitRef()
  121. })
  122. //初始化设置拖动分割线
  123. const setSplitRef = () => {
  124. //配置参考: https://split.js.org/#/?direction=vertical&snapOffset=0
  125. nextTick(() => {
  126. window.$split(['#hc_table_card_' + uuid, '#hc_info_card_' + uuid], {
  127. sizes: [60, 40],
  128. snapOffset: 0,
  129. minSize: [100, 400],
  130. })
  131. })
  132. }
  133. //类型tab数据和相关处理
  134. const tabKey = ref('key1')
  135. const tabTab = ref([
  136. { key: 'key1', name: '普通变更' },
  137. { key: 'key2', name: '工区变更' },
  138. ])
  139. const tabChange = (item) => {
  140. tabKey.value = item?.key
  141. console.log(item)
  142. }
  143. //搜索表单
  144. const searchForm = ref({
  145. key1: null, current: 1, size: 10, total: 0,
  146. })
  147. //分页
  148. const pageChange = ({ current, size }) => {
  149. searchForm.value.current = current
  150. searchForm.value.size = size
  151. }
  152. //表格数据
  153. const tableLoading = ref(false)
  154. const tableColumn = ref([
  155. { key: 'key1', name: '变更编号' },
  156. { key: 'key2', name: '变更名称' },
  157. { key: 'key3', name: '变更金额' },
  158. { key: 'key4', name: '变更类型' },
  159. { key: 'key5', name: '业务日期' },
  160. { key: 'key6', name: '审批状态' },
  161. { key: 'action', name: '操作', width: 94 },
  162. ])
  163. const tableData = ref([
  164. { key1: '1111' },
  165. ])
  166. const rowEditClick = () => {
  167. }
  168. //新增修改的弹窗
  169. const isAddShow = ref(false)
  170. const addModalClick = () => {
  171. isAddShow.value = true
  172. }
  173. //申请部位
  174. const tableColumn1 = ref([
  175. { key: 'key1', name: '工程名称' },
  176. { key: 'key2', name: '节点路径' },
  177. { key: 'key3', name: '合同图号' },
  178. { key: 'key4', name: '变更金额(元)' },
  179. { key: 'key5', name: '是否增补' },
  180. ])
  181. const tableData1 = ref([
  182. { key1: '1111' },
  183. ])
  184. //附件列表
  185. const tableColumn2 = ref([
  186. { key: 'key1', name: '文件名称' },
  187. { key: 'key2', name: '必须上传' },
  188. { key: 'key3', name: '附件列表' },
  189. ])
  190. const tableData2 = ref([
  191. { key1: '工程设计变更申请单', key2: '是', key3: '文件名称' },
  192. ])
  193. //是否上报
  194. const isReport = ref(false)
  195. const reportClick = () => {
  196. isReport.value = true
  197. }
  198. </script>