ZaiZai 1 年之前
父節點
當前提交
66a0e91992
共有 1 個文件被更改,包括 91 次插入6 次删除
  1. 91 6
      src/views/funding/modules/plan-data.vue

+ 91 - 6
src/views/funding/modules/plan-data.vue

@@ -1,10 +1,51 @@
 <template>
-    <hc-dialog v-model="isShow" ui="hc-funding-plan-dialog" is-table widths="50rem" title="新增资金预算期" :is-close="false" @close="cancelClick">
-        <template #extra>
-            <el-button type="primary" size="small">插入上一行</el-button>
-            <el-button type="primary" size="small">插入下一行</el-button>
-        </template>
-        <div>准备写弹窗</div>
+    <hc-dialog v-model="isShow" ui="hc-funding-plan-dialog" is-table widths="50rem" title="新增资金预算期" @close="cancelClick">
+        <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">
+                        <hc-icon name="question" />
+                        <span>编辑说明</span>
+                    </el-button>
+                </el-tooltip>
+            </template>
+            <template #extra>
+                <el-button type="primary" @click="addPreRow">
+                    <hc-icon name="page-separator" :line="false" />
+                    <span>插入上一行</span>
+                </el-button>
+                <el-button type="primary" @click="addNextRow">
+                    <hc-icon name="page-separator" :line="false" />
+                    <span>插入下一行</span>
+                </el-button>
+            </template>
+            <hc-table
+                is-new :index-style="{ width: 60 }" :column="tableColumn" :datas="tableData"
+                :loading="tableLoading" is-current-row @row-click="hangeRow"
+            >
+                <template #periodNumber="{ row }">
+                    <hc-table-input v-model="row.periodNumber" />
+                </template>
+                <template #periodYear="{ row }">
+                    <el-select v-model="row.periodYear" placeholder="选择年份" filterable block>
+                        <el-option v-for="item in yearData" :key="item" :label="item" :value="item" />
+                    </el-select>
+                </template>
+                <template #action="{ row, index }">
+                    <el-link type="danger" @click="delRow(row, index)">删除</el-link>
+                </template>
+            </hc-table>
+        </hc-card-item>
         <template #footer>
             <el-button @click="cancelClick">取消</el-button>
             <el-button type="primary" :loading="confirmLoading" @click="confirmClick">确定</el-button>
@@ -41,6 +82,50 @@ const setInitData = () => {
     contractId.value = store.getContractId
 }
 
+//年份
+const yearData = ref([])
+
+//表格数据
+const tableData = ref([])
+const tableColumn = ref([
+    { key: 'key1', name: '期名称' },
+    { key: 'key2', name: '年份' },
+    { key: 'action', name: '操作', width: 80, align: 'center' },
+])
+
+//获取数据
+const tableLoading = ref(false)
+const getTableData = async () => {
+
+}
+
+//编辑说明提示
+const editVisible = ref(false)
+
+//插入上一行
+const addPreRow = () => {
+    //tableData.value.splice(curIndex.value, 0, { isNew: true })
+}
+
+//插入下一行
+const addNextRow = () => {
+    /*if (!curRow.value?.endDate) {
+        curRow.value.endDate = tableEditData.value[tableEditData.value.length - 1].endDate
+    }
+    const netxtDay = getNextDate(curRow.value?.endDate)
+    tableData.value.splice(curIndex.value + 1, 0, { isNew: true, startDate: netxtDay })*/
+}
+
+//行被点击
+const hangeRow = () => {
+
+}
+
+//删除行
+const delRow = (row) => {
+
+}
+
 //确认提交保存
 const confirmLoading = ref(false)
 const confirmClick = () => {