| | |
| | | <el-form ref="formRef" :model="state.formData" :rules="state.rules" class="register-form" label-position="top"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="10"> |
| | | <el-button type="primary" :disabled="projectType === 'edit'" @click="addUpload">新增附件列表</el-button> |
| | | <!-- <el-button type="primary" :disabled="projectType === 'edit'" @click="addUpload">新增附件列表</el-button>--> |
| | | <span style="font-size: 20px;font-weight: 600">附件列表</span> |
| | | <span style="font-size: 13px;color: rgb(232, 78, 79);font-weight: 400;margin-left: 10px">项目列表仅支持pdf、jpg、jpeg 等格式上传</span> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="原因说明" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.remark" show-word-limit type="text" size="large"/> |
| | | <el-input v-model="scope.row.remark" show-word-limit type="text" size="large" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="附件上传" align="center" class-name="small-padding fixed-width"> |
| | |
| | | </el-upload> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="danger" @click="delUpload(scope.$index)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <el-button link type="danger" @click="delUpload(scope.$index)">删除</el-button>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="6"> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="18"> |
| | | <el-form-item prop="contractMoney"> |
| | | <el-form-item prop="actualContractMoney"> |
| | | <template #label> |
| | | 项目合同额<span style="font-size: 13px;color: red;font-weight: normal;display: inline-block;margin-left: 6px">预估合同金额,归档阶段可以进行修改。仅支持数字,单位万元,小数点后最多两位,数值范围(0.01-999.99)</span> |
| | | </template> |
| | |
| | | </template> |
| | | <script setup> |
| | | |
| | | import {defineEmits, onMounted, reactive, ref} from "vue"; |
| | | import {defineEmits, defineProps, onMounted, reactive, ref} from "vue"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {addRecord, editRecord, getDetail} from "@/api/projectManage/contractMng"; |
| | | import Cookies from "js-cookie"; |
| | |
| | | import axios from "axios"; |
| | | import {delAccessoryFile, getAccessoryFile} from "@/api/projectManage/project"; |
| | | import {addProcessMaterial, getProcessMaterialDetail, editProcessMaterial} from "@/api/projectManage/riskAnalysis"; |
| | | |
| | | const props = defineProps(['projectId']) |
| | | const emit = defineEmits(["getNextStatus"]); |
| | | const state = reactive({ |
| | | formData: { |
| | |
| | | const isAmin = ref(false) |
| | | const formRef = ref(); |
| | | onMounted(async () => { |
| | | |
| | | const userInfo = JSON.parse(Cookies.get('userInfo')) |
| | | if(userInfo.identity === 0){ |
| | | isAmin.value = true; |
| | | } |
| | | if(Cookies.get('projectId')){ |
| | | state.uploadData.projectId = Cookies.get('projectId'); |
| | | getRecord(state.uploadData.projectId); |
| | | if(props.projectId){ |
| | | state.uploadData.projectId = props.projectId; |
| | | await getRecord(state.uploadData.projectId); |
| | | // const res = await getAccessoryFile({projectId: val,moduleType: 9}); |
| | | // console.log('res',res) |
| | | } |
| | | |
| | | }); |
| | | |
| | | const getRecord = async (val) =>{ |
| | |
| | | }else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | getRecord(val); |
| | | } |
| | | if(type === 'add' || type === 'clickEdit') { |
| | | const valid = await formRef.value.validate(); |
| | |
| | | const file = state.uploadList.map(item => { |
| | | return{ |
| | | id: item.id ? item.id : null, |
| | | fileId: item.fileList ? item.fileList[0].response ? item.fileList[0].response.data.id : item.fileList[0].id : '', |
| | | fileId: item.fileList && item.fileList.length>0 ? item.fileList[0].response ? item.fileList[0].response.data.id : item.fileList[0].id : '', |
| | | name: item.name, |
| | | type: item.type, |
| | | remark: item.remark, |
| | | projectId: val |
| | | } |
| | | }) |
| | | |
| | | let isOk = false; |
| | | try{ |
| | | state.uploadList.forEach(item => { |
| | | if(item.type == 1 && (!item.fileList || item.fileList .length == 0) && item.remark == ""){ |
| | | isOk = true; |
| | | throw Error(); |
| | | } |
| | | }) |
| | | }catch (e) {} |
| | | |
| | | if(isOk){ |
| | | ElMessage.warning("请上传附件或完善原因说明!"); |
| | | return; |
| | | } |
| | | const { ...data} = JSON.parse(JSON.stringify(state.formData)) |
| | | data.actualContractMoney = state.actualContract.actualContractMoney; |
| | | data.actualContractIntroduction = state.actualContract.actualContractIntroduction; |
| | |
| | | const res = await editProcessMaterial(params); |
| | | if (res.code == 200) { |
| | | ElMessage.success('变更成功') |
| | | projectType.value='edit'; |
| | | formRef.value.clearValidate(); |
| | | // emit('getNextStatus', data.project.id); |
| | | } else { |
| | |
| | | const handleAvatarSuccess = (res, uploadFile) => { |
| | | if(res.code === 200){ |
| | | console.log("if",state.uploadList) |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '文件上传成功' |
| | | }) |
| | | // ElMessage({ |
| | | // type: 'success', |
| | | // message: '文件上传成功' |
| | | // }) |
| | | }else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | } |
| | | const res = await delAccessoryFile(accessoryFileId) |
| | | if(res.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '文件已删除' |
| | | }) |
| | | // ElMessage({ |
| | | // type: 'success', |
| | | // message: '文件已删除' |
| | | // }) |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |