联调普测计划管理页面
This commit is contained in:
@@ -49,7 +49,6 @@
|
||||
<el-form-item label="上传文件:">
|
||||
<el-upload
|
||||
v-model:file-list="formdata.fileList"
|
||||
v-if="title != '查看计划'"
|
||||
ref="upload"
|
||||
action=""
|
||||
:limit="5"
|
||||
@@ -60,13 +59,6 @@
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<div v-else>
|
||||
<div v-for="(item, index) in aList">
|
||||
<el-button type="primary" link @click="downloadFile(item.url, item.fileName)">
|
||||
{{ item.fileName }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-form>
|
||||
@@ -76,7 +68,7 @@
|
||||
<generalTestTree ref="treeRef" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div
|
||||
<!-- <div
|
||||
v-if="
|
||||
(title == '查看计划' || title == '计划审核') &&
|
||||
(title == '计划审核' || formdata.status == 1 || formdata.status == 3 || formdata.status == 4)
|
||||
@@ -89,7 +81,7 @@
|
||||
:autosize="{ minRows: 2, maxRows: 4 }"
|
||||
v-model="formdata.checkComment"
|
||||
></el-input>
|
||||
</div>
|
||||
</div> -->
|
||||
<template #footer v-if="title != '查看计划'">
|
||||
<div class="dialog-footer pd10">
|
||||
<el-button type="primary" @click="submitFn">提交</el-button>
|
||||
@@ -101,7 +93,7 @@
|
||||
<script setup lang="ts">
|
||||
import generalTestTree from '@/components/tree/pqs/generalTestTree.vue'
|
||||
import { ref, reactive, nextTick } from 'vue'
|
||||
import { addSurvey } from '@/api/process-boot/generalTest'
|
||||
import { addSurvey, auditSurvey } from '@/api/process-boot/generalTest'
|
||||
import Area from '@/components/form/area/index.vue'
|
||||
import { ElMessage, UploadProps } from 'element-plus'
|
||||
import { uploadFile, getFileNameAndFilePath } from '@/api/system-boot/file'
|
||||
@@ -127,7 +119,6 @@ const formdata: any = ref({
|
||||
checkComment: '',
|
||||
filePath: ''
|
||||
})
|
||||
const aList: any = ref([])
|
||||
const formRef = ref()
|
||||
const treeRef = ref()
|
||||
const rules = {
|
||||
@@ -147,17 +138,30 @@ const submitFn = () => {
|
||||
formRef.value.validate(async (valid: any) => {
|
||||
if (valid) {
|
||||
let filePath = ''
|
||||
formdata.value.subIds = ['123', '3123'] //treeRef.value.treeRef.getCheckedKeys(false)
|
||||
formdata.value.subIds = treeRef.value.treeRef.getCheckedKeys(false)
|
||||
for (let i = 0; i < formdata.value.fileList.length; i++) {
|
||||
await uploadFile(formdata.value.fileList[i].raw, 'supervision/').then(res => {
|
||||
filePath = filePath + res.data.name + ','
|
||||
})
|
||||
if (i == formdata.value.fileList.length - 1) {
|
||||
await addSurvey({ ...formdata.value, filePath: filePath }).then((res: any) => {
|
||||
ElMessage.success('新增成功!')
|
||||
cancelFn()
|
||||
emit('onsubmit')
|
||||
if (formdata.value.fileList[i].raw) {
|
||||
await uploadFile(formdata.value.fileList[i].raw, 'supervision/').then(res => {
|
||||
filePath = filePath + res.data.name + ','
|
||||
})
|
||||
} else {
|
||||
filePath = filePath + formdata.value.fileList[i].supervision + ','
|
||||
}
|
||||
|
||||
if (i == formdata.value.fileList.length - 1) {
|
||||
if (title.value == '普测计划新增') {
|
||||
await addSurvey({ ...formdata.value, filePath: filePath }).then((res: any) => {
|
||||
ElMessage.success('新增成功!')
|
||||
cancelFn()
|
||||
emit('onsubmit')
|
||||
})
|
||||
} else if (title.value == '重新发起计划') {
|
||||
await auditSurvey({ ...formdata.value, filePath: filePath }).then((res: any) => {
|
||||
ElMessage.success('重新发起计划成功!')
|
||||
cancelFn()
|
||||
emit('onsubmit')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -194,10 +198,19 @@ const open = (text: string, row?: any) => {
|
||||
if (row) {
|
||||
formdata.value = JSON.parse(JSON.stringify(row))
|
||||
nextTick(() => {
|
||||
getFilePath()
|
||||
formdata.value.fileList = []
|
||||
treeRef.value.loadData()
|
||||
treeRef.value.setKey(row.subIds || [], text)
|
||||
// formdata.value.filePath.join(',')
|
||||
let arr = row.filePath.split(',')
|
||||
arr.slice(0, -1).forEach((item: any) => {
|
||||
getFileNameAndFilePath({ filePath: item }).then((res: any) => {
|
||||
formdata.value.fileList.push({
|
||||
name: res.data.fileName,
|
||||
supervision: res.data.name,
|
||||
url: res.data.url
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
nextTick(() => {
|
||||
@@ -205,24 +218,6 @@ const open = (text: string, row?: any) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
const getFilePath = () => {
|
||||
aList.value = []
|
||||
let arr = formdata.value.filePath.split(',')
|
||||
|
||||
arr.slice(0, -1).forEach((item: any) => {
|
||||
getFileNameAndFilePath({ filePath: item }).then((res: any) => {
|
||||
aList.value.push(res.data)
|
||||
})
|
||||
})
|
||||
}
|
||||
const downloadFile = (url: string, fileName: string) => {
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = fileName
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
@@ -33,13 +33,15 @@ import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { submitAuditUser } from '@/api/process-boot/generalTest'
|
||||
import { submitAuditUser,cancel } from '@/api/process-boot/generalTest'
|
||||
import planAdd from './planAdd.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
|
||||
import { queryPlan,removeSurvey } from '@/api/process-boot/generalTest'
|
||||
import { getUserByRoleType } from '@/api/user-boot/user'
|
||||
const dictData = useDictData()
|
||||
const { push } = useRouter()
|
||||
const dialogVisible=ref(false)
|
||||
const tableRef = ref()
|
||||
|
||||
@@ -71,18 +73,16 @@ const tableStore = new TableStore({
|
||||
title: '计划状态',
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'info',
|
||||
1: 'primary',
|
||||
2: 'warning',
|
||||
2: 'success',
|
||||
3: 'danger',
|
||||
4: 'info',
|
||||
4: 'warning'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '新建',
|
||||
1: '审批中',
|
||||
2: '审批通过',
|
||||
3: '审批不通',
|
||||
4: '已取消',
|
||||
3: '审批不通过',
|
||||
4: '已取消'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -92,16 +92,43 @@ const tableStore = new TableStore({
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '查看',
|
||||
name: 'productSetting',
|
||||
title: '流程详情',
|
||||
type: 'primary',
|
||||
|
||||
icon: 'el-icon-Plus',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
planAddRef.value.open('查看计划', row)
|
||||
// planAddRef.value.open('查看计划', row)
|
||||
handleAudit(row.processInstanceId)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '重新发起',
|
||||
type: 'warning',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.status == 1 || row.status == 2
|
||||
},
|
||||
click: row => {
|
||||
// deviceQuitPopup.value.open('重新发起退运', row)
|
||||
planAddRef.value.open('重新发起计划', row)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'cancel',
|
||||
title: '取消',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.status == 3 || row.status == 2 || row.status == 4
|
||||
},
|
||||
click: row => {
|
||||
cancelLeave(row)
|
||||
}
|
||||
}
|
||||
// {
|
||||
// name: 'edit',
|
||||
// title: '编辑',
|
||||
@@ -193,10 +220,42 @@ const exportFn = () => {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**取消流程操作*/
|
||||
const cancelLeave = async (row: any) => {
|
||||
// 二次确认
|
||||
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
||||
inputErrorMessage: '取消原因不能为空'
|
||||
})
|
||||
// 发起取消
|
||||
let data = {
|
||||
id: row.planNo,
|
||||
processInstanceId: row.processInstanceId,
|
||||
reason: value
|
||||
}
|
||||
await cancel(data)
|
||||
ElMessage.success('取消成功')
|
||||
// 加载数据
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false
|
||||
auditUser.value = ''
|
||||
}
|
||||
|
||||
/** 处理审批按钮 */
|
||||
const handleAudit = (instanceId: any) => {
|
||||
push({
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
query: {
|
||||
id: instanceId
|
||||
}
|
||||
})
|
||||
}
|
||||
// 取消
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user