Newer
Older
Nanping_sponge_GCGL / src / views / project / projectConfiguration / imgwh / tableDalgo.vue
@liyingjing liyingjing on 25 Oct 2 KB 海绵工程管理
<template>
    <div class="water-analysis-page" >
        <div class="top">
            <el-form label-width="auto" ref="ruleForm"  :model="FormList">
                <el-form-item label="文件上传"  :rules="[{ required: true, message: '文件上传', trigger: 'change' }]" props="investFileUrl">
                    <el-upload  list-type="picture-card" ref="upload"  class="avatar-uploader"  action="/prod-api/system/upload" :limit="1"
                        :on-change="handleExceed" v-model:file-list="investFileUrl" :auto-upload="false">
                        <template #trigger>
                            <el-icon  class="avatar-uploader-icon"><Plus /></el-icon>
                        </template>
                        <template #tip>
                        </template>
                    </el-upload>
                </el-form-item>
            </el-form>
            <div style="text-align:right ;">
                        <el-button  v-if="typeList?.type!=1"  type="primary" @click="submit">保存</el-button>
                        <el-button @click="emits('onModalClose')">关闭</el-button>
                    </div>
        </div>
    </div>
</template>
<script setup>
import {
    projectInfoAdd,
    projectInfoEdit
} from "@/api/projectEstimate";
import { stateOption } from '@/utils/common'
import { onMounted, toRefs, defineEmits, reactive, defineProps } from 'vue';
const { proxy } = getCurrentInstance();
const { typeList } = defineProps(['typeList'])
console.log(typeList, 'propsprops');
const emits = defineEmits()
let FormList = ref({projectNo:11212})
function submit() {
    proxy.$refs.ruleForm.validate(valid => {
        if (valid) {
            if (typeList.type) {
                projectInfoEdit(FormList.value).then(({ code }) => {
                    if (code == 200) {
                        emits('onModalClose')
                        // FormList.value = {}
                    }
                });
            } else {
                projectInfoAdd(FormList.value).then(({ code }) => {
                    if (code == 200) {
                        emits('onModalClose')
                        // FormList.value = {}
                    }
                });
            }
        }
    });
};
onMounted(() => {
    FormList.value=typeList
    console.log(FormList.value,'  FormList.value');
})
</script>
<style lang="scss"  scoped>
.water-analysis-page {
}
.pagination {
    float: right;
    margin-top: 10px;
}

.iconCLass {
    ::v-deep .el-input__wrapper {
        box-shadow: 0 0 0 0;
    }
}

// .action-span {
//
//     }</style>