更新
This commit is contained in:
parent
03979613f3
commit
bb2f84a630
@ -380,16 +380,21 @@
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-form label-width="100px">
|
||||
<el-form-item v-if="isshow" label="合同上传" prop="field127">
|
||||
<el-form-item
|
||||
v-if="isshow || formData?.status == 0"
|
||||
label="合同上传"
|
||||
prop="field127"
|
||||
>
|
||||
<el-upload
|
||||
:headers="{ Token: userStore.token }"
|
||||
v-model:file-list="fileList"
|
||||
class="upload-demo"
|
||||
:action="base_url + '/upload/file'"
|
||||
:on-success="handleAvatarSuccess_four"
|
||||
multiple
|
||||
:before-upload="handleBeforeUpload"
|
||||
:limit="1"
|
||||
v-if="+formData?.check_status < 3"
|
||||
v-if="formData?.status == 0"
|
||||
:on-exceed="handleExceed"
|
||||
ref="upload"
|
||||
>
|
||||
<el-button type="primary">{{
|
||||
formData.file ? "重新上传" : "上传"
|
||||
@ -403,10 +408,10 @@
|
||||
>合同已上传,点击查看</a
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="isshow">
|
||||
<el-form-item v-if="isshow || formData.status == 0">
|
||||
<el-button type="primary" @click="submitContract">确定</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item v-else-if="formData.file">
|
||||
<el-form-item v-else-if="formData.file && formData.status">
|
||||
<a
|
||||
v-if="formData.file"
|
||||
style="margin-left: 10px; color: #4a5dff"
|
||||
@ -431,6 +436,7 @@ import { ref, reactive, defineExpose, computed, inject } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { dictDataLists } from "@/api/setting/dict";
|
||||
import { upContact } from "@/api/consumer";
|
||||
import { genFileId } from "element-plus";
|
||||
const { query } = useRoute();
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import useMultipleTabs from "@/hooks/useMultipleTabs";
|
||||
@ -509,6 +515,23 @@ async function render() {
|
||||
}
|
||||
}
|
||||
|
||||
const handleBeforeUpload = (e: any) => {
|
||||
if (e?.name?.substring(e.name.length - 4, e.name.length) != ".pdf") {
|
||||
ElMessage.error("仅支持上传.pdf文件");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const upload = ref(null);
|
||||
const handleExceed = (files: any) => {
|
||||
upload.value!.clearFiles();
|
||||
const file = files[0] as UploadRawFile;
|
||||
file.uid = genFileId();
|
||||
upload.value!.handleStart(file);
|
||||
upload.value!.submit();
|
||||
};
|
||||
|
||||
const handleAvatarSuccess_four: UploadProps["onSuccess"] = (
|
||||
response,
|
||||
uploadFile
|
||||
|
Loading…
x
Reference in New Issue
Block a user