|
@@ -8,7 +8,7 @@
|
|
|
placeholder="任务结果"
|
|
|
size="large"
|
|
|
style="width: 240px"
|
|
|
- :disabled ="sumbitForm.recordStatus ==5 || sumbitForm.recordStatus ==6"
|
|
|
+ :disabled ="formHidden ==5 || formHidden ==6"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in selectStatus"
|
|
@@ -21,12 +21,13 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if=" handlerId === useUserStore().user.userId">
|
|
|
<el-upload
|
|
|
- v-if="sumbitForm.recordStatus !==5 && sumbitForm.recordStatus !==6 "
|
|
|
+ v-if="formHidden !==5 && formHidden !==6 "
|
|
|
ref="upload"
|
|
|
class="upload-demo"
|
|
|
style="flex: auto;"
|
|
|
drag
|
|
|
action=""
|
|
|
+ v-model:file-list="fileList"
|
|
|
:multiple="false"
|
|
|
:auto-upload="false"
|
|
|
:before-upload="handleBeforeUpload"
|
|
@@ -55,7 +56,7 @@
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
|
<el-button @click="outerVisible = false">取消</el-button>
|
|
|
- <el-button type="primary" v-if="(sumbitForm.recordStatus !==4 && sumbitForm.recordStatus !==5 )" v-hasPermi="['business:production:onceWork:finished']" @click="onsumbit">提交</el-button>
|
|
|
+ <el-button type="primary" v-if="handlerId === useUserStore().user.userId && (formHidden !==4 && formHidden !==5 )" v-hasPermi="['business:production:onceWork:finished']" @click="onsumbit">提交</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
@@ -79,7 +80,7 @@ const props = defineProps({
|
|
|
});
|
|
|
const { getList } = toRefs(props);
|
|
|
|
|
|
-
|
|
|
+const fileList = ref([]);
|
|
|
const outerVisible = ref(false);
|
|
|
const currentRow = ref();
|
|
|
const fullscreenLoading = ref<boolean>(false);
|
|
@@ -88,8 +89,10 @@ const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
|
|
const filesTable = ref<Ifile[]>();
|
|
|
const handlerId = ref();
|
|
|
const tenantId = ref();
|
|
|
+const formHidden = ref();
|
|
|
let refile = null;
|
|
|
-const fileEntity = reactive<Ifile>({});
|
|
|
+let fileEntity = {};
|
|
|
+
|
|
|
interface Ifile{
|
|
|
fileName?:string;
|
|
|
url?:string;
|
|
@@ -136,17 +139,31 @@ const sumbitForm = reactive<Tform>({
|
|
|
const httpRequest = (parm) => {
|
|
|
const formData2 = new FormData();
|
|
|
formData2.append("file", parm.file);
|
|
|
- const formData = new FormData();
|
|
|
- formData.append("workOrderId", workOrderId.value);
|
|
|
- formData.append("recordStatus", sumbitForm.recordStatus);
|
|
|
+ // const formData = new FormData();
|
|
|
+ // formData.append("workOrderId", workOrderId.value);
|
|
|
+ // formData.append("recordStatus", sumbitForm.recordStatus);
|
|
|
+ // formData.append("sysFileStorage",fileEntity);
|
|
|
uploadFile(formData2).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
fileEntity.fileName = res.newFileName;
|
|
|
fileEntity.url = res.url;
|
|
|
fileEntity.originalFileName = res.originalFilename;
|
|
|
fileEntity.fileUrl = res.fileName;
|
|
|
- formData.append("sysFileStorage",fileEntity);
|
|
|
}
|
|
|
+ updateRecordStatus(workOrderId.value,sumbitForm.recordStatus,fileEntity).then(response => {
|
|
|
+ proxy.$alert(
|
|
|
+ "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
|
|
+ "提交完成" +
|
|
|
+ "</div>",
|
|
|
+ { dangerouslyUseHTMLString: true }
|
|
|
+ );
|
|
|
+ fileEntity= {};
|
|
|
+ FileList({"masterTableName":"biz_work_order_record","masterId":workOrderId.value}).then((response) => {
|
|
|
+ filesTable.value = response.data
|
|
|
+ })
|
|
|
+ //outerVisible.value = false;
|
|
|
+ //getList.value();
|
|
|
+ })
|
|
|
}).then((res) => {
|
|
|
proxy.$refs['upload'].clearFiles();
|
|
|
}).catch((err) => {
|
|
@@ -158,31 +175,35 @@ function openView(id,status,userId){
|
|
|
workOrderId.value = id;
|
|
|
sumbitForm.recordStatus = status;
|
|
|
sumbitForm.file = null;
|
|
|
+ formHidden.value = status;
|
|
|
fileEntity.fileName = null;
|
|
|
fileEntity.url = null;
|
|
|
fileEntity.originalFileName = null;
|
|
|
fileEntity.fileUrl = null;
|
|
|
handlerId.value = userId;
|
|
|
-
|
|
|
FileList({"masterTableName":"biz_work_order_record","masterId":id}).then((response) => {
|
|
|
filesTable.value = response.data
|
|
|
})
|
|
|
}
|
|
|
const onsumbit = () => {
|
|
|
- proxy.$refs['upload'].submit()
|
|
|
- updateRecordStatus(workOrderId.value,sumbitForm.recordStatus,fileEntity).then(response => {
|
|
|
- proxy.$alert(
|
|
|
- "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
|
|
- "提交完成" +
|
|
|
- "</div>",
|
|
|
- { dangerouslyUseHTMLString: true }
|
|
|
- );
|
|
|
- FileList({"masterTableName":"biz_work_order_record","masterId":workOrderId.value}).then((response) => {
|
|
|
- filesTable.value = response.data
|
|
|
+ console.log()
|
|
|
+ if(fileList.value.length===0){
|
|
|
+ updateRecordStatus(workOrderId.value,sumbitForm.recordStatus,fileEntity).then(response => {
|
|
|
+ proxy.$alert(
|
|
|
+ "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
|
|
+ "提交完成" +
|
|
|
+ "</div>",
|
|
|
+ { dangerouslyUseHTMLString: true }
|
|
|
+ );
|
|
|
+ outerVisible.value = false;
|
|
|
+ fileEntity= {};
|
|
|
+ FileList({"masterTableName":"biz_work_order_record","masterId":workOrderId.value}).then((response) => {
|
|
|
+ filesTable.value = response.data
|
|
|
+ })
|
|
|
})
|
|
|
- outerVisible.value = false;
|
|
|
- getList.value();
|
|
|
- })
|
|
|
+ }
|
|
|
+ proxy.$refs['upload'].submit()
|
|
|
+ getList.value();
|
|
|
}
|
|
|
function handleBeforeUpload(file) {
|
|
|
//const formData = new FormData();
|