changeRequest.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <hc-dialog is-to-body is-table is-footer-center widths="90%" :show="isShow" title="变更清单添加" @save="addModalSave" @close="addModalClose">
  3. <hc-card-item>
  4. <template #header>
  5. <div class="w-60">
  6. <el-input v-model="searchForm.key1" placeholder="清单编号" />
  7. </div>
  8. </template>
  9. <template #extra>
  10. <el-link type="primary">显示已分解</el-link>
  11. </template>
  12. <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check @selection-change="tableCheckChange" />
  13. <template #action>
  14. <hc-pages :pages="searchForm" @change="pageChange" />
  15. </template>
  16. </hc-card-item>
  17. </hc-dialog>
  18. </template>
  19. <script setup>
  20. import { ref, watch } from 'vue'
  21. const props = defineProps({
  22. ids: {
  23. type: [String, Number],
  24. default: '',
  25. },
  26. })
  27. //事件
  28. const emit = defineEmits(['finish', 'close'])
  29. //双向绑定
  30. // eslint-disable-next-line no-undef
  31. const isShow = defineModel('modelValue', {
  32. default: false,
  33. })
  34. //监听
  35. watch(() => [
  36. props.ids,
  37. ], ([ids]) => {
  38. console.log('ids', ids)
  39. }, { immediate: true })
  40. //监听
  41. watch(isShow, (val) => {
  42. if (val) {
  43. console.log('isShow', val)
  44. }
  45. })
  46. //搜索表单
  47. const searchForm = ref({
  48. key1: null, current: 1, size: 10, total: 0,
  49. })
  50. //分页
  51. const pageChange = ({ current, size }) => {
  52. searchForm.value.current = current
  53. searchForm.value.size = size
  54. }
  55. //表格数据
  56. const tableLoading = ref(false)
  57. const tableColumn = ref([
  58. { key: 'key1', name: '清单编号' },
  59. { key: 'key2', name: '清单名称' },
  60. { key: 'key3', name: '单价(元)' },
  61. { key: 'key4', name: '合同数量' },
  62. { key: 'key5', name: '合同变更后数量' },
  63. { key: 'key6', name: '施工图变更后数量' },
  64. { key: 'key7', name: '分解剩余量' },
  65. ])
  66. const tableData = ref([
  67. { key1: '1111' },
  68. ])
  69. const tableCheckChange = () => {
  70. }
  71. const addModalSave = () => {
  72. emit('finish')
  73. addModalClose()
  74. }
  75. //关闭弹窗
  76. const addModalClose = () => {
  77. isShow.value = false
  78. emit('close')
  79. }
  80. </script>
  81. <style scoped lang="scss">
  82. </style>