fix : 修复功能
This commit is contained in:
@@ -54,13 +54,6 @@ export const resubmit = (data) => {
|
||||
data: data
|
||||
});
|
||||
};
|
||||
export const resubmitRequirement = (data) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/requirement/resubmit',
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
};
|
||||
export const deleteFile = (fileId) => {
|
||||
return request({
|
||||
url: `/workflow/process/file/delete/${fileId}`,
|
||||
|
||||
@@ -13,33 +13,11 @@
|
||||
>
|
||||
<el-button color="#DED0B2" :loading="loading">上传文件</el-button>
|
||||
</el-upload>
|
||||
<!-- <div v-if="showTable||fileList.length!==0">-->
|
||||
<!-- <el-table :data="fileList" style="width: 100%">-->
|
||||
<!-- <el-table-column label="序号" type="index" align="center" width="80"/>-->
|
||||
<!-- <el-table-column prop="originalFilename" label="文件名" align="center"/>-->
|
||||
<!-- <el-table-column prop="size" label="文件大小" align="center">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- {{ parseInt(scope.row.size / 1024) }}KB-->
|
||||
<!-- <!– {{ parseInt(scope.row.size / 1024) > 1024 ? 'MB' : 'KB' }}–>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column align="center" label="操作">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <el-button link type="primary" size="small" @click="beforeRemove(scope.row)">-->
|
||||
<!-- 删除-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- </el-table>-->
|
||||
<!-- </div>-->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {defineProps, computed, ref} from "vue";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {getToken} from '@/utils/auth'
|
||||
import {deleteFile} from "@/api/project-demand";
|
||||
|
||||
const baseURL = import.meta.env.VITE_BASE_URL
|
||||
const uploadFileUrl = ref(baseURL + "/workflow/process/file/upload")
|
||||
const headers = reactive({
|
||||
@@ -99,26 +77,6 @@ const handleUploadSuccess = (res, file) => {
|
||||
fileList.value.push(data)
|
||||
emit("getFile", fileList.value)
|
||||
}
|
||||
const beforeRemove = (row) => {
|
||||
ElMessageBox.confirm(`确认删除名称为${row.originalFilename}的表格吗?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
handleRemove(row)
|
||||
}).catch(() => {
|
||||
ElMessage.warning("用户取消删除! ");
|
||||
})
|
||||
}
|
||||
|
||||
const handleRemove = (row) => {
|
||||
deleteFile(row.id).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success("删除成功");
|
||||
fileList.value.splice(fileList.value.findIndex((item) => item.id === row.id), 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@@ -74,14 +74,12 @@
|
||||
<script setup lang="jsx">
|
||||
import {useAuthStore} from '@/stores/userstore.js'
|
||||
import {useProcessStore} from '@/stores/processStore.js';
|
||||
import {getWorkflowInfo, addRequirement, getFormInfo,resubmit} from "@/api/project-demand/index.js";
|
||||
import {getWorkflowInfo, addRequirement, getFormInfo,resubmit,deleteFile} from "@/api/project-demand/index.js";
|
||||
import FileUpload from "@/components/FileUpload.vue";
|
||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {useRoute, useRouter} from 'vue-router'
|
||||
import {getSubCompOpt} from '@/api/user/user.js'
|
||||
import {deleteFile} from "@/api/project-demand";
|
||||
import {resubmitRequirement} from "../../../api/project-demand";
|
||||
|
||||
const authStore = useAuthStore()
|
||||
const router = useRouter()
|
||||
@@ -187,7 +185,7 @@ const init = async () => {
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (route.query.isAdd == undefined) {
|
||||
resubmitRequirement({
|
||||
resubmit({
|
||||
...formData.value,
|
||||
requirementId: 0,
|
||||
files: fileList.value,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属公司">
|
||||
<span>{{ formData.companyIds }}</span>
|
||||
<span>{{ getDataSourceOptionItem(formData.companyIds) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -100,6 +100,7 @@ const companyOption = ref([])
|
||||
const processInstanceData = ref({})
|
||||
const processDiagramViewer = ref(false)
|
||||
const processTree = ref()
|
||||
const companyNameArray = ref([])
|
||||
const formData = ref({})
|
||||
const auditOpinion = ref('')
|
||||
const handleSubmit = () => {
|
||||
@@ -121,33 +122,38 @@ const handleReject = () => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
const getCompanyOption=async ()=>{
|
||||
const getCompanyOption = async () => {
|
||||
const res = await getSubCompOpt()
|
||||
companyOption.value= res.data
|
||||
console.log('companyOption.value',companyOption.value)
|
||||
companyOption.value = res.data
|
||||
}
|
||||
const getDataSourceOptionItem = (val) => {
|
||||
console.log('val',val,companyOption.value)
|
||||
if(val!==undefined){
|
||||
|
||||
const matterTree = (data, id) => {
|
||||
if(id){
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (data[i].value == id) {
|
||||
companyNameArray.value.push(data[i].label);
|
||||
}
|
||||
if (data[i].children && data[i].children.length > 0) {
|
||||
matterTree(data[i].children)
|
||||
}
|
||||
}
|
||||
return companyNameArray.value;
|
||||
}
|
||||
// let arr=[]
|
||||
// console.log('arr',arr)
|
||||
// for (let item of companyOption.value) {
|
||||
// if (item.value === dataSourceId) {
|
||||
// return item.label;
|
||||
// }
|
||||
// }
|
||||
// return "";
|
||||
}
|
||||
|
||||
const getDataSourceOptionItem = (val) => {
|
||||
if (val !== undefined) {
|
||||
val.forEach(item => {
|
||||
matterTree(companyOption.value,item)
|
||||
})
|
||||
}
|
||||
return companyNameArray.value.join(',');
|
||||
}
|
||||
const init = async () => {
|
||||
await getCompanyOption()
|
||||
getInfo(route.query.id).then(res => {
|
||||
let data = res.data
|
||||
formData.value = data.formData;
|
||||
if(data.formData.companyIds.length!==0){
|
||||
|
||||
}
|
||||
processInstanceData.value = data
|
||||
processStore.setDesign(data)
|
||||
processStore.runningList.value = data.runningList;
|
||||
@@ -169,6 +175,7 @@ a {
|
||||
font-size: 14px;
|
||||
color: #2a99ff;
|
||||
}
|
||||
|
||||
.detail-block {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
Reference in New Issue
Block a user