|
@@ -0,0 +1,198 @@
|
|
|
+<template>
|
|
|
+ <el-dialog v-loading.fullscreen.lock="fullscreenLoading" :close-on-click-modal = "false"
|
|
|
+ v-model="outerVisible" title="任务进度" width="600">
|
|
|
+ <el-form :model="sumbitForm" label-width="auto" ref="workDetailForm" style="max-width: 600px">
|
|
|
+ <el-form-item v-if="handlerId === useUserStore().user.userId" label="任务结果">
|
|
|
+ <el-select
|
|
|
+ v-model="sumbitForm.recordStatus"
|
|
|
+ placeholder="任务结果"
|
|
|
+ size="large"
|
|
|
+ style="width: 240px"
|
|
|
+ :disabled ="sumbitForm.recordStatus ==5 || sumbitForm.recordStatus ==6"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in selectStatus"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if=" handlerId === useUserStore().user.userId">
|
|
|
+ <el-upload
|
|
|
+ v-if="sumbitForm.recordStatus !==5 && sumbitForm.recordStatus !==6 "
|
|
|
+ ref="upload"
|
|
|
+ class="upload-demo"
|
|
|
+ style="flex: auto;"
|
|
|
+ drag
|
|
|
+ action=""
|
|
|
+ :multiple="false"
|
|
|
+ :auto-upload="false"
|
|
|
+ :before-upload="handleBeforeUpload"
|
|
|
+ :http-request="httpRequest"
|
|
|
+ >
|
|
|
+ <el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
|
+ <div class="el-upload__text">
|
|
|
+ 将文件拖入此处, <em>或点击上传</em>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-table ref="Table" :data="filesTable" size="small" height="100%" border
|
|
|
+ header-row-class-name="list-header-row">
|
|
|
+ <el-table-column type="index" label="序号" width="47" align="center" />
|
|
|
+ <el-table-column label="文件名" prop="originalFileName" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-link :href="`${baseUrl}${scope.row.fileUrl}`" :underline="false" target="_blank"
|
|
|
+ type="primary">
|
|
|
+ {{ scope.row.originalFileName }}
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-form>
|
|
|
+ <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>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+<script lang="ts" setup>
|
|
|
+import {ElButton, ElTable} from "element-plus";
|
|
|
+import {ref} from "@vue/reactivity";
|
|
|
+import { uploadFile } from "@/api/tool/file";
|
|
|
+import {defineProps, getCurrentInstance, reactive, toRefs} from "vue";
|
|
|
+import useUserStore from "@/store/modules/user";
|
|
|
+import {
|
|
|
+ updateRecordStatus,
|
|
|
+ FileList
|
|
|
+} from "@/api/business/production/onceWorkOrder";
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+const props = defineProps({
|
|
|
+ getList: {
|
|
|
+ type: Function,
|
|
|
+ default: () => { },
|
|
|
+ },
|
|
|
+});
|
|
|
+const { getList } = toRefs(props);
|
|
|
+
|
|
|
+
|
|
|
+const outerVisible = ref(false);
|
|
|
+const currentRow = ref();
|
|
|
+const fullscreenLoading = ref<boolean>(false);
|
|
|
+const workOrderId = ref();
|
|
|
+const baseUrl = import.meta.env.VITE_APP_BASE_API;
|
|
|
+const filesTable = ref<Ifile[]>();
|
|
|
+const handlerId = ref();
|
|
|
+const tenantId = ref();
|
|
|
+let refile = null;
|
|
|
+const fileEntity = reactive<Ifile>({});
|
|
|
+interface Ifile{
|
|
|
+ fileName?:string;
|
|
|
+ url?:string;
|
|
|
+ originalFileName?:string;
|
|
|
+ fileUrl?:string;
|
|
|
+}
|
|
|
+const data = reactive({
|
|
|
+ selectStatus: [
|
|
|
+ {
|
|
|
+ label: "终止任务",
|
|
|
+ value: 5,
|
|
|
+ color: "#2FCB81",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "完成任务",
|
|
|
+ value: 6,
|
|
|
+ color: "#2FCB81",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "暂停办理",
|
|
|
+ value: 7,
|
|
|
+ color: "#2FCB81",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "办理中",
|
|
|
+ value: 1,
|
|
|
+ color: "#2FCB81",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+});
|
|
|
+
|
|
|
+const { selectStatus } = toRefs(data);
|
|
|
+
|
|
|
+
|
|
|
+const form = reactive({
|
|
|
+ recordStatus:0,
|
|
|
+ file:Blob
|
|
|
+})
|
|
|
+type Tform = typeof form;
|
|
|
+const sumbitForm = reactive<Tform>({
|
|
|
+ file: new Blob,
|
|
|
+ recordStatus: null
|
|
|
+});
|
|
|
+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);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }).then((res) => {
|
|
|
+ proxy.$refs['upload'].clearFiles();
|
|
|
+ }).catch((err) => {
|
|
|
+ proxy.$refs['upload'].clearFiles();
|
|
|
+ })
|
|
|
+}
|
|
|
+function openView(id,status,userId){
|
|
|
+ outerVisible.value = true;
|
|
|
+ workOrderId.value = id;
|
|
|
+ sumbitForm.recordStatus = status;
|
|
|
+ sumbitForm.file = null;
|
|
|
+ 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
|
|
|
+ })
|
|
|
+ outerVisible.value = false;
|
|
|
+ getList.value();
|
|
|
+ })
|
|
|
+}
|
|
|
+function handleBeforeUpload(file) {
|
|
|
+ //const formData = new FormData();
|
|
|
+ refile = file
|
|
|
+ // formData.append("file", file);
|
|
|
+
|
|
|
+}
|
|
|
+defineExpose({
|
|
|
+ openView,
|
|
|
+});
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+</style>
|