联调 技术监督 草稿功能

This commit is contained in:
GGJ
2024-06-19 19:37:39 +08:00
parent c496a13617
commit 38c61ec5d5
19 changed files with 671 additions and 277 deletions

View File

@@ -48,7 +48,9 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<!-- <el-button type="primary" @click="submit">确认</el-button> -->
<el-button type="primary" @click="submit(true)">保存</el-button>
<el-button type="primary" @click="submit(false)">提交审批</el-button>
</span>
</template>
</el-dialog>
@@ -84,7 +86,8 @@ const form = ref({
deviceType: '1',
devOriginalStatus: '0',
devStatus: '',
propertyNo: ''
propertyNo: '',
saveOrCheckflag: ''
})
//form表单校验规则
@@ -114,7 +117,7 @@ const open = async (text: string, tempData?: any) => {
}
form.value.deviceType = form.value.deviceType + ''
changeDevStatus(form.value.deviceId, true)
form.value.devStatus = form.value.devStatus + ''
form.value.devStatus = form.value.devStatus ? form.value.devStatus + '' : ''
} else {
resetForm()
// 在此处恢复默认表单
@@ -133,33 +136,46 @@ const open = async (text: string, tempData?: any) => {
/**
* 提交用户表单数据
*/
const submit = () => {
formRef.value.validate(async (valid: any) => {
if (valid) {
if (form.value.devOriginalStatus == form.value.devStatus) {
if (form.value.devOriginalStatus == '0') {
ElMessage.warning('终端当前状态就是运行,无需变更!')
} else if (form.value.devOriginalStatus == '1') {
ElMessage.warning('终端当前状态就是检修,无需变更!')
const submit = (flag: boolean) => {
if (flag) {
form.value.saveOrCheckflag = '1'
addRunningDevice(form.value).then(res => {
ElMessage.success('保存成功!')
tableStore.index()
dialogVisible.value = false
})
} else {
formRef.value.validate(async (valid: any) => {
if (valid) {
form.value.saveOrCheckflag = '2'
if (form.value.devOriginalStatus == form.value.devStatus) {
if (form.value.devOriginalStatus == '0') {
ElMessage.warning('终端当前状态就是运行,无需变更!')
} else if (form.value.devOriginalStatus == '1') {
ElMessage.warning('终端当前状态就是检修,无需变更!')
} else {
ElMessage.warning('终端当前状态就是退运,无需变更!')
}
} else {
ElMessage.warning('终端当前状态就是退运,无需变更!')
}
} else {
if (form.value.id) {
await quitRunningDeviceUpdate(form.value)
ElMessage.success('重新发起成功')
tableStore.index()
dialogVisible.value = false
} else {
await addRunningDevice(form.value)
//查询进线数据避免一直处于loading状态
ElMessage.success('申请成功')
tableStore.index()
dialogVisible.value = false
if (form.value.id) {
await quitRunningDeviceUpdate(form.value).then(res => {
ElMessage.success('重新发起成功')
tableStore.index()
dialogVisible.value = false
})
} else {
await addRunningDevice(form.value).then(res => {
//查询进线数据避免一直处于loading状态
ElMessage.success('申请成功')
tableStore.index()
dialogVisible.value = false
})
}
}
}
}
})
})
}
}
/**
@@ -176,6 +192,7 @@ const changeDevStatus = async (event: any, flag?: boolean) => {
await getDeviceDetailData(event).then(res => {
//给当前终端赋值初始运行状态
runFlag.value = res.data.runFlag + ''
form.value.devOriginalStatus = runFlag.value
if (!flag) form.value.devStatus = ''
devStatuData.value = devStatusList.value.filter(item => item.value != res.data.runFlag)
})

View File

@@ -76,14 +76,17 @@ const tableStore = new TableStore({
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info'
4: 'info',
null: 'primary'
},
replaceValue: {
0: '运行',
1: '检修',
2: '停运',
3: '调试',
4: '退运'
4: '退运',
null: '/'
}
},
{
@@ -92,16 +95,20 @@ const tableStore = new TableStore({
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
4: 'warning',
null: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
4: '已取消',
null: '/'
}
},
{ field: 'createTime', title: '开始时间', minWidth: 170 },
@@ -130,6 +137,19 @@ const tableStore = new TableStore({
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
click: row => {
deviceQuitPopup.value.open('编辑', row)
}
},
{
name: 'edit',
title: '重新发起',

View File

@@ -22,17 +22,17 @@
<el-form-item label="监测点当前状态:">
<el-select v-model="runFlag" disabled placeholder="请选择监测点" clearable class="select">
<el-option
v-for="item in runFlagData"
:key="item.name"
v-for="item in runFlagList "
:key="item.id"
:label="item.name"
:value="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="变更状态:" prop="devStatus">
<el-select v-model="form.devStatus" placeholder="请选择监测点变更状态" clearable class="select">
<el-option
v-for="item in runFlagList"
v-for="item in runFlagData"
:key="item.id"
:label="item.name"
:value="item.id"
@@ -59,7 +59,9 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<!-- <el-button type="primary" @click="submit">确认</el-button> -->
<el-button type="primary" @click="submit(true)">保存</el-button>
<el-button type="primary" @click="submit(false)">提交审批</el-button>
</span>
</template>
</el-dialog>
@@ -90,14 +92,15 @@ const form = ref({
deviceType: '2',
devOriginalStatus: '0',
devStatus: '',
saveOrCheckflag: '',
propertyNo: ''
})
const runFlagList = [
{ id: 0, name: '投运' },
{ id: 1, name: '检修' },
{ id: 2, name: '停运' },
{ id: 3, name: '调试' },
{ id: 4, name: '退运' }
{ id: '0', name: '投运' },
{ id: '1', name: '检修' },
{ id: '2', name: '停运' },
{ id: '3', name: '调试' },
{ id: '4', name: '退运' }
]
//form表单校验规则
@@ -128,7 +131,7 @@ const open = async (text: string, tempData?: any) => {
}
form.value.deviceType = form.value.deviceType + ''
changeDevStatus(form.value.deviceId, true)
form.value.devStatus = form.value.devStatus
form.value.devStatus = form.value.devStatus ? form.value.devStatus + '' : ''
} else {
resetForm()
// 在此处恢复默认表单
@@ -145,27 +148,38 @@ const open = async (text: string, tempData?: any) => {
/**
* 提交用户表单数据
*/
const submit = () => {
formRef.value.validate(async (valid: any) => {
if (valid) {
if (form.value.devOriginalStatus == '4') {
ElMessage.warning('终端当前状态就是退运,无需变更!')
} else {
if (form.value.id) {
await quitRunningDeviceUpdate(form.value)
ElMessage.success('重新发起成功')
tableStore.index()
dialogVisible.value = false
const submit = (flag: boolean) => {
if (flag) {
form.value.saveOrCheckflag = '1'
addRunningDevice(form.value).then(res => {
ElMessage.success('保存成功!')
tableStore.index()
dialogVisible.value = false
})
} else {
formRef.value.validate(async (valid: any) => {
if (valid) {
form.value.saveOrCheckflag = '2'
if (form.value.devOriginalStatus == '4') {
ElMessage.warning('终端当前状态就是退运,无需变更!')
} else {
await addRunningDevice(form.value)
//查询进线数据避免一直处于loading状态
ElMessage.success('申请成功')
tableStore.index()
dialogVisible.value = false
if (form.value.id) {
await quitRunningDeviceUpdate(form.value)
ElMessage.success('重新发起成功')
tableStore.index()
dialogVisible.value = false
} else {
await addRunningDevice(form.value)
//查询进线数据避免一直处于loading状态
ElMessage.success('申请成功')
tableStore.index()
dialogVisible.value = false
}
}
}
}
})
})
}
}
/**
@@ -198,7 +212,8 @@ const changeDevStatus = async (event: any, flag?: any) => {
// form.value.devOriginalStatus = '4'
// break
// }
runFlag.value = res.data.runFlag
runFlag.value = runFlagList.filter(item => item.name == res.data.runFlag)[0].id
form.value.devOriginalStatus = runFlag.value
if (!flag) form.value.devStatus = ''
runFlagData.value = runFlagList.filter(item => item.name != res.data.runFlag)
})

View File

@@ -75,14 +75,16 @@ const tableStore = new TableStore({
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info'
4: 'info',
null: 'primary'
},
replaceValue: {
0: '运行',
1: '检修',
2: '停运',
3: '调试',
4: '退运'
4: '退运',
null: '/'
}
},
{
@@ -95,14 +97,16 @@ const tableStore = new TableStore({
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info'
4: 'info',
null: 'primary'
},
replaceValue: {
0: '运行',
1: '检修',
2: '停运',
3: '调试',
4: '退运'
4: '退运',
null:'/'
}
},
{
@@ -111,12 +115,14 @@ const tableStore = new TableStore({
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
@@ -150,6 +156,19 @@ const tableStore = new TableStore({
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
click: row => {
deviceQuitPopup.value.open('编辑', row)
}
},
{
name: 'edit',
title: '重新发起',