修改进度管理bug
This commit is contained in:
@ -48,7 +48,7 @@
|
||||
v-if="scope.row.status !== 'draft'"
|
||||
icon="Edit"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['design:PrelimScheme:query']"
|
||||
v-hasPermi="['design:prelimScheme:query']"
|
||||
>查看流程</el-button
|
||||
>
|
||||
<el-button
|
||||
@ -57,7 +57,7 @@
|
||||
v-if="scope.row.status === 'draft'"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['design:PrelimScheme:edit']"
|
||||
v-hasPermi="['design:prelimScheme:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<!-- <el-button
|
||||
@ -109,7 +109,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: PrelimSchemeForm = {
|
||||
id: undefined,
|
||||
projectId: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
ossId: undefined,
|
||||
fileName: undefined,
|
||||
fileUrl: undefined,
|
||||
@ -120,7 +120,8 @@ const data = reactive<PageData<PrelimSchemeForm, PrelimSchemeQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
|
||||
ossId: undefined,
|
||||
fileName: undefined,
|
||||
fileUrl: undefined,
|
||||
|
@ -173,8 +173,6 @@ const getInfo = () => {
|
||||
const res = await getPrelimScheme(routeParams.value.id);
|
||||
Object.assign(form.value, res.data);
|
||||
form.value.file = res.data.ossId;
|
||||
showFileList.value = false;
|
||||
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
@ -188,11 +186,10 @@ const submitForm = async (status1: string) => {
|
||||
if (form.value.id) {
|
||||
if (!updateFileStatus.value) return proxy?.$modal.msgError('请上传图纸文件');
|
||||
buttonLoading.value = true;
|
||||
let data = { id: form.value.id, projectId: form.value.id, file: form.value.file };
|
||||
if (form.value.file === form.value.ossId) {
|
||||
let data = { id: form.value.id, projectId: form.value.projectId, file: form.value.file };
|
||||
if (form.value.file === form.value.ossId && !isUpdateFile.value) {
|
||||
data.file = '';
|
||||
res = await updatePrelimScheme(data).finally(() => (buttonLoading.value = false));
|
||||
|
||||
if (res.code == 200) {
|
||||
dialog.visible = false;
|
||||
submit(status.value, form.value);
|
||||
@ -286,10 +283,11 @@ const handleUploadSuccess = (list, res) => {
|
||||
|
||||
const fileStatus = ref(false);
|
||||
const updateFileStatus = ref(true);
|
||||
|
||||
const isUpdateFile = ref(false); //记录是否在修改页面时是否有新上传的文件
|
||||
const handleFileChange = (file, fileList) => {
|
||||
if (form.value.id) {
|
||||
updateFileStatus.value = true;
|
||||
isUpdateFile.value = true; //记录是否在修改页面时是否有新上传的文件
|
||||
}
|
||||
fileStatus.value = true;
|
||||
};
|
||||
@ -297,6 +295,7 @@ const handleFileChange = (file, fileList) => {
|
||||
const handleFileRemove = (file, fileList) => {
|
||||
if (form.value.id) {
|
||||
updateFileStatus.value = false;
|
||||
isUpdateFile.value = false; //记录是否在修改页面时是否有新上传的文件
|
||||
}
|
||||
showFileList.value = true;
|
||||
|
||||
|
@ -185,8 +185,6 @@ const getInfo = () => {
|
||||
const res = await getScheme(routeParams.value.id);
|
||||
Object.assign(form.value, res.data);
|
||||
form.value.file = res.data.ossId;
|
||||
showFileList.value = false;
|
||||
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
@ -202,7 +200,7 @@ const submitForm = async (status1: string) => {
|
||||
buttonLoading.value = true;
|
||||
|
||||
let data = { id: form.value.id, projectId: form.value.id, file: form.value.file };
|
||||
if (form.value.file === form.value.ossId) {
|
||||
if (form.value.file === form.value.ossId && !isUpdateFile.value) {
|
||||
data.file = '';
|
||||
res = await updateScheme(data).finally(() => (buttonLoading.value = false));
|
||||
if (res.code == 200) {
|
||||
@ -298,10 +296,11 @@ const handleUploadSuccess = (list, res) => {
|
||||
};
|
||||
const fileStatus = ref(false);
|
||||
const updateFileStatus = ref(true);
|
||||
|
||||
const isUpdateFile = ref(false);
|
||||
const handleFileChange = (file, fileList) => {
|
||||
if (form.value.id) {
|
||||
updateFileStatus.value = true;
|
||||
isUpdateFile.value = true;
|
||||
}
|
||||
fileStatus.value = true;
|
||||
};
|
||||
@ -309,6 +308,7 @@ const handleFileChange = (file, fileList) => {
|
||||
const handleFileRemove = (file, fileList) => {
|
||||
if (form.value.id) {
|
||||
updateFileStatus.value = false;
|
||||
isUpdateFile.value = false;
|
||||
}
|
||||
showFileList.value = true;
|
||||
|
||||
|
Reference in New Issue
Block a user