点击编辑附件名称没有回显bug优化

dev
WenShiJun 2024-03-30 16:01:37 +08:00
parent c60f698ef5
commit 6e8d9f4154
20 changed files with 96 additions and 30 deletions

View File

@ -24,7 +24,7 @@
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
:limit="9"
:limit="1"
:size="100"
/>
</el-form-item>

View File

@ -102,7 +102,7 @@
<script setup>
import { useRoute } from "vue-router";
import useListData from "@/assets/js/useListData.js";
import { serialNumber } from "@/assets/js/utils.js";
import { addingPrefixToFile, serialNumber } from "@/assets/js/utils.js";
import { ElMessage, ElMessageBox } from "element-plus";
import { nextTick, reactive, ref } from "vue";
import Add from "@/views/labor_contract/components/add.vue";
@ -162,6 +162,11 @@ const fnAddOrEdit = async (
...detail,
OPERATINGCOMPANY: detail.CORP_NAME,
};
data.addOrEditDialog.form.file = addingPrefixToFile([
{
FILEPATH: detail.ATTACHMENT_ROUTE,
},
]);
}
} else {
data.addOrEditDialog.form = { USER_ID };

View File

@ -30,7 +30,7 @@
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
:limit="9"
:limit="1"
:size="100"
/>
</el-form-item>
@ -43,13 +43,13 @@
placeholder="选择时间"
/>
</el-form-item>
<el-form-item label="备注" prop="MEETING_CONTENT">
<el-input
v-model="form.MEETING_CONTENT"
placeholder="请输入内容"
style="width: 300px"
></el-input>
</el-form-item>
<!-- <el-form-item label="备注" prop="MEETING_CONTENT">-->
<!-- <el-input-->
<!-- v-model="form.MEETING_CONTENT"-->
<!-- placeholder="请输入内容"-->
<!-- style="width: 300px"-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
</el-form>
<template #footer>
<el-button @click="fnClose"></el-button>

View File

@ -122,7 +122,7 @@
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils";
import { addingPrefixToFile, serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive } from "vue";
@ -151,7 +151,20 @@ const fnAddOrEdit = async (STAFFING_ID = "", type = "add") => {
data.addOrEditDialog.visible = true;
data.addOrEditDialog.type = type;
if (type === "edit" && STAFFING_ID) {
data.addOrEditDialog.form.STAFFING_ID = STAFFING_ID;
const resData = await infoStaffingView({ STAFFING_ID });
if (resData) {
const detail = resData.pd;
data.addOrEditDialog.form = {
...detail,
OPERATINGCOMPANY: detail.CORP_NAME,
EXPIRYDATE: detail.EXPIRYDATE,
};
data.addOrEditDialog.form.file = addingPrefixToFile([
{
FILEPATH: detail.ATTACHMENT_ROUTE,
},
]);
}
} else {
data.addOrEditDialog.form = {};
}

View File

@ -28,7 +28,7 @@
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
:limit="9"
:limit="1"
:size="100"
/>
</el-form-item>

View File

@ -104,7 +104,7 @@
<script setup>
import { useRoute } from "vue-router";
import useListData from "@/assets/js/useListData.js";
import { serialNumber } from "@/assets/js/utils.js";
import { addingPrefixToFile, serialNumber } from "@/assets/js/utils.js";
import { ElMessage, ElMessageBox } from "element-plus";
import { nextTick, reactive, ref } from "vue";
import Add from "@/views/occupational_hazards/components/add.vue";
@ -166,6 +166,11 @@ const fnAddOrEdit = async (
...detail,
OPERATINGCOMPANY: detail.CORP_NAME,
};
data.addOrEditDialog.form.file = addingPrefixToFile([
{
FILEPATH: detail.ATTACHMENT_ROUTE,
},
]);
}
} else {
data.addOrEditDialog.form = { USER_ID };

View File

@ -27,7 +27,7 @@
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
:limit="9"
:limit="1"
:size="100"
/>
<!-- <span>{{ form.ATTACHMENT_NAME }}</span>-->

View File

@ -125,7 +125,7 @@
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils";
import { addingPrefixToFile, serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive } from "vue";
@ -166,6 +166,11 @@ const fnAddOrEdit = async (MANAGEMENTAGREEMENT_ID = "", type = "add") => {
OPERATINGCOMPANY: detail.CORP_NAME,
ATTACHMENT_NAME: attachmentName,
};
data.addOrEditDialog.form.file = addingPrefixToFile([
{
FILEPATH: detail.ATTACHMENT_ROUTE,
},
]);
}
} else {
data.addOrEditDialog.form = {}; //

View File

@ -24,7 +24,7 @@
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
:limit="9"
:limit="1"
:size="100"
/>
</el-form-item>

View File

@ -121,7 +121,7 @@
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils";
import { addingPrefixToFile, serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive } from "vue";
@ -146,18 +146,31 @@ const data = reactive({
info: {},
},
});
const fnAddOrEdit = async (SAFETYASSESSMENT_ID = "", type = "add") => {
data.addOrEditDialog.visible = true;
data.addOrEditDialog.type = type;
if (type === "edit" && SAFETYASSESSMENT_ID) {
data.addOrEditDialog.form.SAFETYASSESSMENT_ID = SAFETYASSESSMENT_ID;
const resData = await infoAssessmentView({ SAFETYASSESSMENT_ID });
if (resData) {
const detail = resData.pd;
data.addOrEditDialog.form = {
...detail,
OPERATINGCOMPANY: detail.CORP_NAME,
EXPIRYDATE: detail.EXPIRYDATE,
};
data.addOrEditDialog.form.file = addingPrefixToFile([
{
FILEPATH: detail.ATTACHMENT_ROUTE,
},
]);
}
} else {
data.addOrEditDialog.form = {};
}
await nextTick();
};
const fnView = async (SAFETYASSESSMENT_ID) => {
const resData = await infoAssessmentView({
SAFETYASSESSMENT_ID,

View File

@ -23,7 +23,7 @@
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
:limit="9"
:limit="1"
:size="100"
/>
</el-form-item>

View File

@ -121,7 +121,7 @@
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils";
import { addingPrefixToFile, serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive } from "vue";
@ -157,6 +157,11 @@ const fnAddOrEdit = async (ACTIVITIES_ID = "", type = "add") => {
OPERATINGCOMPANY: resData.pd.CORP_NAME,
EXPIRYDATE: resData.pd.EXPIRYDATE,
};
data.addOrEditDialog.form.file = addingPrefixToFile([
{
FILEPATH: resData.pd.ATTACHMENT_ROUTE,
},
]);
}
} else {
data.addOrEditDialog.form = {};

View File

@ -23,7 +23,7 @@
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
:limit="9"
:limit="1"
:size="100"
/>
</el-form-item>

View File

@ -116,7 +116,7 @@
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils";
import { addingPrefixToFile, serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive } from "vue";
@ -153,6 +153,11 @@ const fnAddOrEdit = async (MANUAL_ID = "", type = "add") => {
OPERATINGCOMPANY: resData.pd.CORP_NAME,
EXPIRYDATE: resData.pd.EXPIRYDATE,
};
data.addOrEditDialog.form.file = addingPrefixToFile([
{
FILEPATH: resData.pd.ATTACHMENT_ROUTE,
},
]);
}
} else {
data.addOrEditDialog.form = {};

View File

@ -24,7 +24,7 @@
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
:limit="9"
:limit="1"
:size="100"
/>
</el-form-item>

View File

@ -121,7 +121,7 @@
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils";
import { addingPrefixToFile, serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive } from "vue";
@ -158,6 +158,11 @@ const fnAddOrEdit = async (SAFETYPRODUCTION_ID = "", type = "add") => {
OPERATINGCOMPANY: detail.CORP_NAME,
EXPIRYDATE: detail.EXPIRYDATE,
};
data.addOrEditDialog.form.file = addingPrefixToFile([
{
FILEPATH: detail.ATTACHMENT_ROUTE,
},
]);
}
} else {
data.addOrEditDialog.form = {};

View File

@ -28,7 +28,7 @@
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
:limit="9"
:limit="1"
:size="100"
/>
</el-form-item>

View File

@ -104,7 +104,7 @@
<script setup>
import { useRoute } from "vue-router";
import useListData from "@/assets/js/useListData.js";
import { serialNumber } from "@/assets/js/utils.js";
import { addingPrefixToFile, serialNumber } from "@/assets/js/utils.js";
import { ElMessage, ElMessageBox } from "element-plus";
import { nextTick, reactive, ref } from "vue";
import Add from "@/views/safety_responsibility/components/add.vue";
@ -166,6 +166,11 @@ const fnAddOrEdit = async (
...detail,
OPERATINGCOMPANY: detail.CORP_NAME,
};
data.addOrEditDialog.form.file = addingPrefixToFile([
{
FILEPATH: detail.ATTACHMENT_ROUTE,
},
]);
}
} else {
data.addOrEditDialog.form = { USER_ID };

View File

@ -29,7 +29,7 @@
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
:limit="9"
:limit="1"
:size="100"
/>
</el-form-item>

View File

@ -109,7 +109,7 @@ import {
getSafetyCommitmentUserList,
} from "@/request/traffic_safety_commitment.js";
import useListData from "@/assets/js/useListData.js";
import { serialNumber } from "@/assets/js/utils.js";
import { addingPrefixToFile, serialNumber } from "@/assets/js/utils.js";
import { ElMessage, ElMessageBox } from "element-plus";
import { nextTick, reactive, ref } from "vue";
import Add from "@/views/security_commitment/components/add.vue";
@ -168,6 +168,11 @@ const fnAddOrEdit = async (
...detail,
OPERATINGCOMPANY: detail.CORP_NAME,
};
data.addOrEditDialog.form.file = addingPrefixToFile([
{
FILEPATH: detail.ATTACHMENT_ROUTE,
},
]);
}
} else {
data.addOrEditDialog.form = { USER_ID };