|
@@ -1,29 +1,184 @@
|
|
|
<template>
|
|
|
- <hc-card>
|
|
|
- <template #header>
|
|
|
- 1
|
|
|
- </template>
|
|
|
+ <hc-card title="合同计量期">
|
|
|
<template #extra>
|
|
|
- <el-button hc-btn type="primary">
|
|
|
- <HcIcon name="add" />
|
|
|
- <span>新增</span>
|
|
|
+ <el-button hc-btn type="primary" @click="editModalClick">
|
|
|
+ <HcIcon name="edit" />
|
|
|
+ <span>编辑</span>
|
|
|
</el-button>
|
|
|
</template>
|
|
|
- 1111
|
|
|
+ <div class="relative h-full flex">
|
|
|
+ <div class="flex-1">
|
|
|
+ <hc-card-item>
|
|
|
+ <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading">
|
|
|
+ <template #action="{ row }">
|
|
|
+ <el-link type="danger">锁定</el-link>
|
|
|
+ </template>
|
|
|
+ </hc-table>
|
|
|
+ <template #action>
|
|
|
+ <hc-pages :pages="searchForm" @change="pageChange" />
|
|
|
+ </template>
|
|
|
+ </hc-card-item>
|
|
|
+ </div>
|
|
|
+ <div class="ml-3 w-[600px]">
|
|
|
+ <hc-card-item title="详情信息" scrollbar>
|
|
|
+ <hc-info-table>
|
|
|
+ <tr>
|
|
|
+ <hc-info-table-td center is-title>期号:</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">-</hc-info-table-td>
|
|
|
+ <hc-info-table-td center is-title>报表打印日期:</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">-</hc-info-table-td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <hc-info-table-td center is-title>年份:</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">第1期</hc-info-table-td>
|
|
|
+ <hc-info-table-td center is-title>月份:</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">-</hc-info-table-td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <hc-info-table-td center is-title>开始日期:</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">2020-09-10</hc-info-table-td>
|
|
|
+ <hc-info-table-td center is-title>结束日期:</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">-</hc-info-table-td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <hc-info-table-td center is-title>关联工区计量期:</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="auto" colspan="3">-</hc-info-table-td>
|
|
|
+ </tr>
|
|
|
+ </hc-info-table>
|
|
|
+ </hc-card-item>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 编辑修改 -->
|
|
|
+ <hc-dialog is-to-body is-table is-footer-center widths="1200px" :show="editModalShow" title="计量期编辑" @save="editModalSave" @close="editModalClose">
|
|
|
+ <hc-card-item>
|
|
|
+ <template #header>
|
|
|
+ <el-tooltip :visible="editVisible" effect="light" placement="bottom-start">
|
|
|
+ <template #content>
|
|
|
+ <div class="text-sm text-red">
|
|
|
+ 1.日期不能为空<br>
|
|
|
+ 2.同一期的结束日期不能小于开始日期<br>
|
|
|
+ 3.连续的两期,上一期结束日期和下一期的开始日期必须连续<br>
|
|
|
+ 如:期号1的结束日期为2018-1-25,则期号2的开始日期必须是2018-1-26 !<br>
|
|
|
+ 4.已经存在数据的计量周期不能进行删除!<br>
|
|
|
+ 5.已经存在上报数据的计量周期不能进行数据修改!
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <el-button type="danger" @mouseenter="editVisible = true" @mouseleave="editVisible = false">
|
|
|
+ <HcIcon name="question" />
|
|
|
+ <span>编辑说明</span>
|
|
|
+ </el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ <template #extra>
|
|
|
+ <el-button type="primary">
|
|
|
+ <HcIcon name="page-separator" :line="false" />
|
|
|
+ <span>插入上一行</span>
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary">
|
|
|
+ <HcIcon name="page-separator" :line="false" />
|
|
|
+ <span>插入下一行</span>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <hc-table :column="tableEditColumn" :datas="tableEditData">
|
|
|
+ <template #key1="{ row }">
|
|
|
+ <hc-table-input v-model="row.key1" disabled />
|
|
|
+ </template>
|
|
|
+ <template #key2="{ row }">
|
|
|
+ <el-select v-model="row.key3" placeholder="选择年份" filterable disabled block>
|
|
|
+ <el-option v-for="item in yearData" :key="item" :label="item" :value="item" />
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template #key3="{ row }">
|
|
|
+ <el-select v-model="row.key4" placeholder="选择月份" filterable disabled block>
|
|
|
+ <el-option v-for="item in monthData" :key="item" :label="item" :value="item" />
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template #key4="{ row }">
|
|
|
+ <el-date-picker v-model="row.key5" class="block" format="YYYY-MM-DD" type="date" value-format="YYYY-MM-DD" disabled />
|
|
|
+ </template>
|
|
|
+ <template #key5="{ row }">
|
|
|
+ <el-date-picker v-model="row.key5" class="block" format="YYYY-MM-DD" type="date" value-format="YYYY-MM-DD" disabled />
|
|
|
+ </template>
|
|
|
+ <template #action="{ row }">
|
|
|
+ <el-button plain size="small" type="danger">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </hc-table>
|
|
|
+ </hc-card-item>
|
|
|
+ </hc-dialog>
|
|
|
</hc-card>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import { onMounted, ref } from 'vue'
|
|
|
+import { getMonthList, getYearList } from 'js-fast-way'
|
|
|
+import dayjs from 'dayjs'
|
|
|
|
|
|
defineOptions({
|
|
|
name: 'PeriodsContractAdminPhase',
|
|
|
})
|
|
|
|
|
|
+//获取年月等相关日期数据
|
|
|
+const year = Number(dayjs().format('YYYY')) + 8
|
|
|
+const yearData = getYearList(year, 2010)
|
|
|
+const monthData = getMonthList()
|
|
|
+
|
|
|
//渲染完成
|
|
|
onMounted(() => {
|
|
|
|
|
|
})
|
|
|
+
|
|
|
+//搜索表单
|
|
|
+const searchForm = ref({
|
|
|
+ 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: 'action', name: '操作', width: 80 },
|
|
|
+])
|
|
|
+const tableData = ref([
|
|
|
+ { key1: '1111' },
|
|
|
+])
|
|
|
+
|
|
|
+//计量期编辑
|
|
|
+const editVisible = ref(false)
|
|
|
+const editModalShow = ref(false)
|
|
|
+const editModalClick = () => {
|
|
|
+ editModalShow.value = true
|
|
|
+}
|
|
|
+
|
|
|
+//编辑的表格
|
|
|
+const tableEditColumn = [
|
|
|
+ { key: 'key1', name: '期号' },
|
|
|
+ { key: 'key2', name: '年份' },
|
|
|
+ { key: 'key3', name: '月份' },
|
|
|
+ { key: 'key4', name: '结束日期' },
|
|
|
+ { key: 'key5', name: '报表打印日期' },
|
|
|
+ { key: 'action', name: '操作', width: 80, align: 'center' },
|
|
|
+]
|
|
|
+const tableEditData = ref([
|
|
|
+ { key1: '11' },
|
|
|
+ { key1: '222' },
|
|
|
+])
|
|
|
+
|
|
|
+const editModalSave = () => {
|
|
|
+ editModalClose()
|
|
|
+}
|
|
|
+const editModalClose = () => {
|
|
|
+ editModalShow.value = false
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|