联调 退役管理
This commit is contained in:
@@ -1,22 +1,21 @@
|
||||
<template>
|
||||
<el-dialog draggable title="新增设备退役申请单" v-model="userAdd" width="500px" :before-close="cancel">
|
||||
<el-dialog draggable :title="title" v-model="userAdd" width="500px" :before-close="cancel">
|
||||
<el-divider content-position="left" style="font-weight: bolder; font-size: 18px">基本信息</el-divider>
|
||||
<el-form :inline="true" ref="formRef" :model="addData" label-width="auto" class="form-one" :rules="rules">
|
||||
<el-form-item label="区域:">
|
||||
<Area ref="areaRef" v-model="addData.orgNo" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编号:" prop="userName">
|
||||
<el-input v-model="addData.userName" clearable placeholder="请输入关键字"></el-input>
|
||||
<el-form-item label="设备编号:" prop="assetNumber">
|
||||
<el-input v-model="addData.assetNumber" clearable placeholder="请输入关键字"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="资产编号:" prop="userName">
|
||||
<el-input v-model="addData.userName" clearable placeholder="请输入关键字"></el-input>
|
||||
<el-form-item label="资产编号:" prop="devNumber">
|
||||
<el-input v-model="addData.devNumber" clearable placeholder="请输入关键字"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="item" label="报告:" style="margin-top: 10px" prop="fileList">
|
||||
<el-upload
|
||||
v-model:file-list="causeAnalysisData.fileList"
|
||||
v-model:file-list="addData.fileList"
|
||||
ref="upload"
|
||||
v-if="!prop.disabled"
|
||||
action=""
|
||||
:limit="1"
|
||||
:on-exceed="handleExceed"
|
||||
@@ -26,111 +25,124 @@
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
|
||||
<el-button type="primary" link @click="download" v-else>
|
||||
{{ prop.List.fileNameYyfx }}
|
||||
</el-button>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="选择审核人:" >
|
||||
|
||||
<el-select v-model="auditUser" clearable placeholder="请选择审核人">
|
||||
<el-option v-for="item in auditList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
|
||||
</el-select>
|
||||
<el-form-item label="选择审核人:" prop="checker">
|
||||
<el-select v-model="addData.checker" clearable placeholder="请选择审核人">
|
||||
<el-option v-for="item in auditList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div style="display: flex; justify-content: center; margin-top: 30px">
|
||||
<el-button type="primary" class="ml20" @click="config">确定</el-button>
|
||||
<el-button type="primary" class="ml20" @click="cancel">取消</el-button>
|
||||
<el-button type="primary" class="ml20" @click="config(1)">保存</el-button>
|
||||
<!-- <el-button type="primary" class="ml20" @click="config(2)">审核</el-button> -->
|
||||
<el-button class="ml20" @click="cancel">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ElMessage, genFileId } from 'element-plus'
|
||||
import Area from '@/components/form/area/index.vue'
|
||||
import { addLoadTypeUser } from '@/api/process-boot/interference'
|
||||
import { onMounted } from 'vue'
|
||||
import { uploadFile, addFlow, update } from '@/api/process-boot/retire'
|
||||
import { getUserByRoleType } from '@/api/user-boot/user'
|
||||
import { UploadProps, UploadRawFile } from 'element-plus'
|
||||
import { UploadProps, UploadRawFile, genFileId, ElMessage } from 'element-plus'
|
||||
|
||||
const dictData = useDictData()
|
||||
const userAdd = ref(false)
|
||||
const interferenceType = dictData.getBasicData('Interference_Source')
|
||||
const emit = defineEmits(['onSubmit'])
|
||||
const rules = reactive({
|
||||
loadType: [{ required: true, message: '请选择干扰源类型', trigger: 'change' }],
|
||||
userName: [{ required: true, message: '请输入干扰源用户名称', trigger: 'blur' }],
|
||||
recordTime: [{ required: true, message: '请选择建档时间', trigger: 'change' }]
|
||||
assetNumber: [{ required: true, message: '请输入设备编号', trigger: 'blur' }],
|
||||
devNumber: [{ required: true, message: '请输入资产编号', trigger: 'blur' }],
|
||||
|
||||
checker: [{ required: true, message: '请选择审核人', trigger: 'change' }],
|
||||
fileList: [{ required: true, message: '请选择文件', trigger: 'change' }]
|
||||
})
|
||||
const addData = ref({
|
||||
const auditList: any = ref([])
|
||||
const title: any = ref('')
|
||||
const addData: any = ref({
|
||||
orgNo: dictData.state.area[0].id,
|
||||
loadType: '',
|
||||
userName: '',
|
||||
recordTime: ''
|
||||
assetNumber: '',
|
||||
devNumber: '',
|
||||
fileList: [],
|
||||
checker: '',
|
||||
applyType: 4,
|
||||
type: 5
|
||||
})
|
||||
const formRef = ref()
|
||||
// 新增
|
||||
const config = () => {
|
||||
formRef.value.validate((valid: any) => {
|
||||
const config = (num?: number) => {
|
||||
formRef.value.validate(async (valid: any) => {
|
||||
if (valid) {
|
||||
addLoadTypeUser(addData.value).then((res: any) => {
|
||||
ElMessage.success('新增成功!')
|
||||
emit('onSubmit')
|
||||
cancel()
|
||||
})
|
||||
if (title.value == '新增设备退役申请单') {
|
||||
let form = new FormData()
|
||||
form.append('file', addData.value.fileList[0].raw)
|
||||
await uploadFile(form).then((res: any) => {
|
||||
addData.value.fileName = res.data.minFileName
|
||||
addData.value.filePath = res.data.minFileUrl
|
||||
})
|
||||
addData.value.applicationFormText = JSON.stringify({
|
||||
assetNumber: addData.value.assetNumber,
|
||||
devNumber: addData.value.devNumber
|
||||
})
|
||||
addData.value.operate = num
|
||||
addData.value.checkerName = auditList.value.find((item: any) => item.id == addData.value.checker).name
|
||||
addFlow(addData.value).then((res: any) => {
|
||||
ElMessage.success('新增成功!')
|
||||
|
||||
cancel()
|
||||
})
|
||||
} else if (title.value == '编辑设备退役申请单') {
|
||||
if (addData.value.fileList[0].raw != undefined) {
|
||||
let form = new FormData()
|
||||
form.append('file', addData.value.fileList[0].raw)
|
||||
await uploadFile(form).then((res: any) => {
|
||||
addData.value.fileName = res.data.minFileName
|
||||
addData.value.filePath = res.data.minFileUrl
|
||||
})
|
||||
}
|
||||
addData.value.applicationFormText = JSON.stringify({
|
||||
assetNumber: addData.value.assetNumber,
|
||||
devNumber: addData.value.devNumber
|
||||
})
|
||||
addData.value.operate = num
|
||||
addData.value.checkerName = auditList.value.find((item: any) => item.id == addData.value.checker).name
|
||||
update(addData.value).then((res: any) => {
|
||||
ElMessage.success('修改成功!')
|
||||
|
||||
cancel()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// 重置
|
||||
const cancel = () => {
|
||||
formRef.value.resetFields()
|
||||
emit('onSubmit')
|
||||
userAdd.value = false
|
||||
}
|
||||
const open = () => {
|
||||
const open = (text: string, row?: any) => {
|
||||
if (row) {
|
||||
addData.value = JSON.parse(JSON.stringify(row))
|
||||
addData.value.assetNumber = row.applyForm.assetNumber
|
||||
addData.value.devNumber = row.applyForm.devNumber
|
||||
addData.value.fileList = [{ name: row.fileName, url: row.filePath }]
|
||||
}
|
||||
title.value = text
|
||||
userAdd.value = true
|
||||
}
|
||||
|
||||
|
||||
const auditList:any = ref([])
|
||||
const auditUser = ref('')
|
||||
const handleClose = () => {
|
||||
auditUser.value = ''
|
||||
}
|
||||
// 取消
|
||||
|
||||
onMounted(() => {
|
||||
getUserByRoleType(3).then(res => {
|
||||
auditList.value = res.data
|
||||
})
|
||||
})
|
||||
const prop = defineProps({
|
||||
addData: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
List: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean
|
||||
}
|
||||
})
|
||||
const upload = ref()
|
||||
const causeAnalysisData: any = ref({
|
||||
reportProcessContentYyfx: [],
|
||||
userReportProcessContentYyfx: [],
|
||||
eventDescriptionYyfx: '',
|
||||
fileNameYyfx: '', //原因分析报告文件名称
|
||||
filePathYyfx: '', //原因分析报告文件路径
|
||||
powerGridAffectDev: [],
|
||||
userAffectDev: [],
|
||||
fileList: []
|
||||
})
|
||||
|
||||
// 上传
|
||||
const handleExceed: UploadProps['onExceed'] = files => {
|
||||
upload.value!.clearFiles()
|
||||
@@ -138,18 +150,11 @@ const handleExceed: UploadProps['onExceed'] = files => {
|
||||
file.uid = genFileId()
|
||||
upload.value!.handleStart(file)
|
||||
}
|
||||
// 下载
|
||||
const download = async () => {
|
||||
// window.open(addForm.value.ifile)
|
||||
let response = await fetch(prop.List.filePathYyfx)
|
||||
let blob = await response.blob()
|
||||
let a = document.createElement('a')
|
||||
a.href = window.URL.createObjectURL(blob)
|
||||
a.download = prop.List.fileNameYyfx
|
||||
a.click()
|
||||
a.remove()
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-upload-list__item) {
|
||||
width: 300px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<Table ref="tableRef" />
|
||||
</div>
|
||||
<!-- 新增编辑 -->
|
||||
<Equipment ref="EquipmentRef" />
|
||||
<Equipment ref="EquipmentRef" @onSubmit="tableStore.index()" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
@@ -18,18 +18,19 @@ import TableHeader from '@/components/table/header/index.vue'
|
||||
import Equipment from './equipment.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { deleteIssues } from '@/api/process-boot/electricitymanagement'
|
||||
import { createCheckflow, getFileUrl } from '@/api/process-boot/retire'
|
||||
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
const dictData = useDictData()
|
||||
const TableHeaderRef = ref()
|
||||
const EquipmentRef = ref()
|
||||
const problemData = dictData.getBasicData('Problem_Sources')
|
||||
const fillingProgress = dictData.getBasicData('Fill_Progress')
|
||||
const auditStatus = dictData.getBasicData('Audit_Status')
|
||||
|
||||
defineOptions({
|
||||
name: '/Processsupervision/retire'
|
||||
})
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/process-boot/electricityQuality/getIssues',
|
||||
url: '/process-boot/rFlowProcess/getFlowProcess',
|
||||
method: 'POST',
|
||||
publicHeight: 65,
|
||||
column: [
|
||||
@@ -44,68 +45,103 @@ const tableStore: any = new TableStore({
|
||||
},
|
||||
{ field: 'orgName', title: '所属单位' },
|
||||
{
|
||||
field: 'problemSources',
|
||||
title: '问题来源'
|
||||
field: 'applyForm',
|
||||
title: '设备编号',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue.assetNumber
|
||||
}
|
||||
},
|
||||
{ field: 'powerQualityProblemNo', title: '问题编号' },
|
||||
{ field: 'problemName', title: '问题名称' },
|
||||
{ field: 'dataDate', title: '问题新建时间' },
|
||||
|
||||
{
|
||||
field: 'applyForm',
|
||||
title: '资产编号',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue.devNumber
|
||||
}
|
||||
},
|
||||
{ field: 'updateTime', title: '创建时间' },
|
||||
{ field: 'checkerName', title: '审核人' },
|
||||
{
|
||||
field: 'processStatus',
|
||||
title: '流程状态',
|
||||
width: 150,
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: '',
|
||||
1: '',
|
||||
2: 'warning',
|
||||
3: 'danger',
|
||||
4: 'success',
|
||||
5: 'success'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '',
|
||||
1: '新建',
|
||||
2: '待审核',
|
||||
3: '驳回',
|
||||
4: '已审核',
|
||||
5: '归档'
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
width: '180',
|
||||
width: '200',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '查看',
|
||||
title: '编辑',
|
||||
type: 'primary',
|
||||
disabled: row => {
|
||||
return row.reportProcessStatus == 'Init'
|
||||
return !(row.processStatus == 1 || row.processStatus == 3)
|
||||
},
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: async row => {}
|
||||
click: async row => {
|
||||
EquipmentRef.value.open('编辑设备退役申请单', row)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '填报',
|
||||
disabled: row => {
|
||||
return (
|
||||
row.reportProcessStatus == 'Auditt' ||
|
||||
(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success') ||
|
||||
row.reportProcess == 'Archived'
|
||||
)
|
||||
},
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '归档',
|
||||
|
||||
{
|
||||
name: 'edit',
|
||||
title: '提交审核',
|
||||
disabled: row => {
|
||||
return !(row.processStatus == 1 || row.processStatus == 3)
|
||||
},
|
||||
type: 'primary',
|
||||
icon: 'el-icon-SuccessFilled',
|
||||
render: 'basicButton',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定归档?'
|
||||
title: '是否提交审核?'
|
||||
},
|
||||
click: row => {}
|
||||
click: row => {
|
||||
createCheckflow({ id: row.id }).then(() => {
|
||||
ElMessage.success('提交成功!')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '审核记录',
|
||||
title: '下载文件',
|
||||
type: 'primary',
|
||||
|
||||
icon: 'el-icon-PieChart',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {}
|
||||
click: async row => {
|
||||
getFileUrl({ filePath: row.filePath }).then(async res => {
|
||||
let response = await fetch(res.data)
|
||||
let blob = await response.blob()
|
||||
let a = document.createElement('a')
|
||||
a.href = window.URL.createObjectURL(blob)
|
||||
a.download = row.fileName
|
||||
a.click()
|
||||
a.remove()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name: 'del',
|
||||
text: '删除',
|
||||
@@ -131,8 +167,9 @@ const tableStore: any = new TableStore({
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
|
||||
tableStore.table.params.dataDate = tableStore.table.params.searchBeginTime
|
||||
tableStore.table.params.dataType = TableHeaderRef.value.datePickerRef.interval
|
||||
tableStore.table.params.pageType = '1'
|
||||
tableStore.table.params.type = 5
|
||||
tableStore.table.params.applyType = 4
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user