12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template>
- <hc-dialog is-to-body is-table is-footer-center widths="90%" :show="isShow" title="变更清单添加" @save="addModalSave" @close="addModalClose">
- <hc-card-item>
- <template #header>
- <div class="w-60">
- <el-input v-model="searchForm.key1" placeholder="清单编号" />
- </div>
- </template>
- <template #extra>
- <el-link type="primary">显示已分解</el-link>
- </template>
- <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check @selection-change="tableCheckChange" />
- <template #action>
- <hc-pages :pages="searchForm" @change="pageChange" />
- </template>
- </hc-card-item>
- </hc-dialog>
- </template>
- <script setup>
- import { ref, watch } from 'vue'
- const props = defineProps({
- ids: {
- type: [String, Number],
- default: '',
- },
- })
- //事件
- const emit = defineEmits(['finish', 'close'])
- //双向绑定
- // eslint-disable-next-line no-undef
- const isShow = defineModel('modelValue', {
- default: false,
- })
- //监听
- watch(() => [
- props.ids,
- ], ([ids]) => {
- console.log('ids', ids)
- }, { immediate: true })
- //监听
- watch(isShow, (val) => {
- if (val) {
- console.log('isShow', val)
- }
- })
- //搜索表单
- const searchForm = ref({
- key1: null, current: 1, size: 10, total: 0,
- })
- //分页
- const pageChange = ({ current, size }) => {
- searchForm.value.current = current
- searchForm.value.size = size
- }
- //表格数据
- const tableLoading = ref(false)
- const tableColumn = ref([
- { key: 'key1', name: '清单编号' },
- { key: 'key2', name: '清单名称' },
- { key: 'key3', name: '单价(元)' },
- { key: 'key4', name: '合同数量' },
- { key: 'key5', name: '合同变更后数量' },
- { key: 'key6', name: '施工图变更后数量' },
- { key: 'key7', name: '分解剩余量' },
- ])
- const tableData = ref([
- { key1: '1111' },
- ])
- const tableCheckChange = () => {
- }
- const addModalSave = () => {
- emit('finish')
- addModalClose()
- }
- //关闭弹窗
- const addModalClose = () => {
- isShow.value = false
- emit('close')
- }
- </script>
- <style scoped lang="scss">
- </style>
|