|
@@ -0,0 +1,74 @@
|
|
|
+<template>
|
|
|
+ <hc-dialog v-model="isShow" ui="hc-funding-budget-dialog" is-table widths="80%" :title="isNullES(rowInfo.id) ? '新增' : '修改'" @close="cancelClick">
|
|
|
+ <div>111111</div>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="cancelClick">取消</el-button>
|
|
|
+ <el-button type="primary" :loading="confirmLoading" @click="confirmClick">确定</el-button>
|
|
|
+ </template>
|
|
|
+ </hc-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref, watch } from 'vue'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
+import { getArrValue, isNullES } from 'js-fast-way'
|
|
|
+import mainApi from '~api/funding/budget'
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ info: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({}),
|
|
|
+ },
|
|
|
+})
|
|
|
+
|
|
|
+//事件
|
|
|
+const emit = defineEmits(['finish', 'close'])
|
|
|
+
|
|
|
+//双向绑定
|
|
|
+const isShow = defineModel('modelValue', {
|
|
|
+ default: false,
|
|
|
+})
|
|
|
+
|
|
|
+//获取全局变量
|
|
|
+const store = useAppStore()
|
|
|
+const projectId = ref(store.getProjectId)
|
|
|
+const contractId = ref(store.getContractId)
|
|
|
+
|
|
|
+//监听数据
|
|
|
+const rowInfo = ref(props.info)
|
|
|
+watch(() => props.info, (data) => {
|
|
|
+ rowInfo.value = data
|
|
|
+}, { immediate: true, deep: true })
|
|
|
+
|
|
|
+//监听显示
|
|
|
+watch(isShow, (val) => {
|
|
|
+ if (val) setInitData()
|
|
|
+})
|
|
|
+
|
|
|
+//弹窗打开后,初始化数据
|
|
|
+const setInitData = () => {
|
|
|
+ projectId.value = store.getProjectId
|
|
|
+ contractId.value = store.getContractId
|
|
|
+ console.log(rowInfo.value)
|
|
|
+}
|
|
|
+
|
|
|
+//确认提交保存
|
|
|
+const confirmLoading = ref(false)
|
|
|
+const confirmClick = () => {
|
|
|
+ cancelClick()
|
|
|
+ emit('finish')
|
|
|
+}
|
|
|
+
|
|
|
+//取消并关闭弹窗
|
|
|
+const cancelClick = () => {
|
|
|
+ isShow.value = false
|
|
|
+ rowInfo.value = {}
|
|
|
+ emit('close')
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.el-dialog.hc-funding-budget-dialog .el-dialog__body .hc-new-dialog-body{
|
|
|
+ padding: 10px 0;
|
|
|
+}
|
|
|
+</style>
|