修改 技术监督 草稿功能
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
<el-input v-model="form.planName" placeholder="请输入计划名称"></el-input>
|
<el-input v-model="form.planName" placeholder="请输入计划名称"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="监督类型:" prop="supvType">
|
<el-form-item label="监督类型:" prop="supvType">
|
||||||
<el-select v-model="form.supvType" placeholder="请选择监督类型" style="width: 100%">
|
<el-select v-model="form.supvType" placeholder="请选择监督类型" style="width: 100%" @change="++key">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in supvTypeOptionList"
|
v-for="item in supvTypeOptionList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
for="-"
|
:key="key"
|
||||||
label="关联电站:"
|
label="关联电站:"
|
||||||
v-if="form.customSubstationFlag == 0"
|
v-if="form.customSubstationFlag == 0"
|
||||||
:prop="dynamicProp"
|
:prop="dynamicProp"
|
||||||
@@ -96,7 +96,13 @@
|
|||||||
/> -->
|
/> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item for="-" label="关联电站:" v-if="form.customSubstationFlag == 1" :prop="dynamicProp">
|
<el-form-item
|
||||||
|
for="-"
|
||||||
|
label="关联电站:"
|
||||||
|
:key="key"
|
||||||
|
v-if="form.customSubstationFlag == 1"
|
||||||
|
:prop="dynamicProp"
|
||||||
|
>
|
||||||
<el-input v-model="form.substation" placeholder="请输入关联电站"></el-input>
|
<el-input v-model="form.substation" placeholder="请输入关联电站"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form :model="form" label-width="auto"> -->
|
<!-- <el-form :model="form" label-width="auto"> -->
|
||||||
@@ -164,8 +170,10 @@ const dictData = useDictData()
|
|||||||
const supvTypeOptionList = dictData.getBasicData('supv_type')
|
const supvTypeOptionList = dictData.getBasicData('supv_type')
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
const planAddition = ref(false)
|
const planAddition = ref(false)
|
||||||
|
const key: any = ref(0)
|
||||||
const dynamicProp = computed(() => {
|
const dynamicProp = computed(() => {
|
||||||
|
console.log(123);
|
||||||
|
|
||||||
return supvTypeOptionList.filter(item => item.id === form.value.supvType)[0]?.code == 'Technical_Super'
|
return supvTypeOptionList.filter(item => item.id === form.value.supvType)[0]?.code == 'Technical_Super'
|
||||||
? ''
|
? ''
|
||||||
: 'substation'
|
: 'substation'
|
||||||
@@ -220,18 +228,19 @@ const rules = ref({
|
|||||||
supvObjectName: [{ required: true, message: '请输入计划名称', trigger: 'blur' }],
|
supvObjectName: [{ required: true, message: '请输入计划名称', trigger: 'blur' }],
|
||||||
planName: [{ required: true, message: '请输入计划名称', trigger: 'blur' }],
|
planName: [{ required: true, message: '请输入计划名称', trigger: 'blur' }],
|
||||||
leader: [{ required: true, message: '请输入测试负责人', trigger: 'blur' }],
|
leader: [{ required: true, message: '请输入测试负责人', trigger: 'blur' }],
|
||||||
substation: [{ required: true, message: '请选择关联电站', trigger: 'change' }]
|
substation: [{ required: true, message: '请选择关联电站', trigger: 'blur' }]
|
||||||
// fileList: [{ required: true, message: '请上传文件', trigger: 'change' }],
|
// fileList: [{ required: true, message: '请上传文件', trigger: 'change' }],
|
||||||
})
|
})
|
||||||
const changeSubstationFlag = () => {
|
const changeSubstationFlag = () => {
|
||||||
console.log(form.value.customSubstationFlag)
|
console.log(form.value.customSubstationFlag)
|
||||||
//处理所属变电站手都输入1/下拉数据0
|
//处理所属变电站手都输入1/下拉数据0
|
||||||
|
key.value++
|
||||||
if (form.value.customSubstationFlag == 0) {
|
if (form.value.customSubstationFlag == 0) {
|
||||||
rules.value.substation[0].message = '请选择关联电站'
|
rules.value.substation[0].message = '请选择关联电站'
|
||||||
form.value.substation = ''
|
form.value.substation = []
|
||||||
} else {
|
} else {
|
||||||
rules.value.substation[0].message = '请输入关联电站'
|
rules.value.substation[0].message = '请输入关联电站'
|
||||||
form.value.substation = []
|
form.value.substation = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const cancelFn = () => {
|
const cancelFn = () => {
|
||||||
@@ -265,12 +274,11 @@ const submitFn = (flag: boolean) => {
|
|||||||
addForm.substation = addForm.substation.length == 0 ? '' : addForm.substation.join(',')
|
addForm.substation = addForm.substation.length == 0 ? '' : addForm.substation.join(',')
|
||||||
}
|
}
|
||||||
addForm.saveOrCheckflag = '1'
|
addForm.saveOrCheckflag = '1'
|
||||||
if (title.value == '计划新增') {
|
|
||||||
addSurveyPlan(addForm).then(res => {
|
addSurveyPlan(addForm).then(res => {
|
||||||
cancelFn()
|
cancelFn()
|
||||||
emit('onsubmit')
|
emit('onsubmit')
|
||||||
})
|
})
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
formRef.value.validate(async (valid: any) => {
|
formRef.value.validate(async (valid: any) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
@@ -332,7 +340,9 @@ const open = (text: string, id: any) => {
|
|||||||
})
|
})
|
||||||
title.value = text
|
title.value = text
|
||||||
planAddition.value = true
|
planAddition.value = true
|
||||||
|
setTimeout(() => {
|
||||||
|
key.value++
|
||||||
|
}, 10)
|
||||||
if (id) {
|
if (id) {
|
||||||
detailById(id)
|
detailById(id)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,7 +162,9 @@ const tableStore = new TableStore({
|
|||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.createBy != adminInfo.$state.id || !(row.status == 0)
|
return row.createBy != adminInfo.$state.id || !(row.status == 0)
|
||||||
},
|
},
|
||||||
click: row => {}
|
click: row => {
|
||||||
|
planAddRef.value.open('编辑', row.id, false)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
|
|||||||
@@ -1,82 +1,84 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog draggable :title='title' v-model='planAddition' :before-close='cancelFn'>
|
<el-dialog draggable :title="title" v-model="planAddition" :before-close="cancelFn">
|
||||||
<el-form :model='form' ref='formRef' :rules='rules' label-width='auto' class='form-two' scroll-to-error>
|
<el-form :model="form" ref="formRef" :rules="rules" label-width="auto" class="form-two" scroll-to-error>
|
||||||
<el-form-item label='计划负责单位:'>
|
<el-form-item label="计划负责单位:">
|
||||||
<el-input v-model='form.deptName' disabled></el-input>
|
<el-input v-model="form.deptName" disabled></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='计划名称:' prop='planName'>
|
<el-form-item label="计划名称:" prop="planName">
|
||||||
<el-input v-model='form.planName' disabled></el-input>
|
<el-input v-model="form.planName" disabled></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='监督类型:'>
|
<el-form-item label="监督类型:">
|
||||||
<el-input v-model='form.supvType' disabled></el-input>
|
<el-input v-model="form.supvType" disabled></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='监督对象名称:'>
|
<el-form-item label="监督对象名称:">
|
||||||
<el-input v-model='form.supvObjectName' disabled></el-input>
|
<el-input v-model="form.supvObjectName" disabled></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='计划开始时间:' prop='planStartTime'>
|
<el-form-item label="计划开始时间:" prop="planStartTime">
|
||||||
<el-input v-model='form.planStartTime' disabled></el-input>
|
<el-input v-model="form.planStartTime" disabled></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='计划结束时间:' prop='planEndTime'>
|
<el-form-item label="计划结束时间:" prop="planEndTime">
|
||||||
<el-input v-model='form.planEndTime' disabled></el-input>
|
<el-input v-model="form.planEndTime" disabled></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item for='-' label='测试变电站:' prop='subIds' style='display: flex; align-items: center'>
|
<el-form-item for="-" label="测试变电站:" prop="subIds" style="display: flex; align-items: center">
|
||||||
<el-input v-model='form.substationName' disabled />
|
<el-input v-model="form.substationName" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='实际完成时间:' prop='completeTime'>
|
<el-form-item label="实际完成时间:" prop="completeTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model='form.completeTime'
|
v-model="form.completeTime"
|
||||||
type='date'
|
type="date"
|
||||||
placeholder='选择实际完成时间'
|
placeholder="选择实际完成时间"
|
||||||
value-format='YYYY-MM-DD'
|
value-format="YYYY-MM-DD"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item for='-' label='测试负责人:' prop='completeBy'>
|
<el-form-item for="-" label="测试负责人:" prop="completeBy">
|
||||||
<el-input v-model='form.completeBy' placeholder='请输入测试负责人'></el-input>
|
<el-input v-model="form.completeBy" placeholder="请输入测试负责人"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item for='-' class='uploadFile' label='计划测试报告:' prop='testReport'>
|
<el-form-item for="-" class="uploadFile" label="计划测试报告:" prop="testReport">
|
||||||
<el-upload
|
<el-upload
|
||||||
ref='uploadRef'
|
ref="uploadRef"
|
||||||
v-model:file-list='form.testReport'
|
v-model:file-list="form.testReport"
|
||||||
action=''
|
action=""
|
||||||
:accept='acceptType'
|
:accept="acceptType"
|
||||||
:limit='1'
|
:limit="1"
|
||||||
:on-exceed='handleExceed'
|
:on-exceed="handleExceed"
|
||||||
:on-change='choose'
|
:on-change="choose"
|
||||||
:auto-upload='false'
|
:auto-upload="false"
|
||||||
:on-progress="uploadFileName('testReport')"
|
:on-progress="uploadFileName('testReport')"
|
||||||
>
|
>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-button type='primary'>上传文件</el-button>
|
<el-button type="primary">上传文件</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item for='-' label='测试是否有问题:' prop='problemFlag'>
|
<el-form-item for="-" label="测试是否有问题:" prop="problemFlag">
|
||||||
<!-- 默认值 否 -->
|
<!-- 默认值 否 -->
|
||||||
<el-radio-group v-model='form.problemFlag'>
|
<el-radio-group v-model="form.problemFlag">
|
||||||
<el-radio :value='1'>是</el-radio>
|
<el-radio :value="1">是</el-radio>
|
||||||
<el-radio :value='0'>否</el-radio>
|
<el-radio :value="0">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
style='width: 100%'
|
style="width: 100%"
|
||||||
for='-'
|
for="-"
|
||||||
label='问题描述:'
|
label="问题描述:"
|
||||||
prop='problemDetail'
|
prop="problemDetail"
|
||||||
v-if="form.problemFlag == '1'"
|
v-if="form.problemFlag == '1'"
|
||||||
>
|
>
|
||||||
<el-input type='textarea' v-model='form.problemDetail' placeholder='请输入问题描述'></el-input>
|
<el-input type="textarea" v-model="form.problemDetail" placeholder="请输入问题描述"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- </el-form> -->
|
<!-- </el-form> -->
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class='dialog-footer'>
|
<div class="dialog-footer">
|
||||||
<el-button @click='cancelFn'>取消</el-button>
|
<el-button @click="cancelFn">取消</el-button>
|
||||||
<el-button type='primary' @click='submitFn'>确定</el-button>
|
<!-- <el-button type="primary" @click="submitFn">确定</el-button> -->
|
||||||
|
<el-button type="primary" @click="submitFn(true)">保存</el-button>
|
||||||
|
<el-button type="primary" @click="submitFn(false)">提交审批</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang='ts'>
|
<script setup lang="ts">
|
||||||
import { ref, inject, nextTick } from 'vue'
|
import { ref, inject, nextTick } from 'vue'
|
||||||
import { addSurvey, auditSurvey } from '@/api/process-boot/generalTest'
|
import { addSurvey, auditSurvey } from '@/api/process-boot/generalTest'
|
||||||
import TableStore from '@/utils/tableStore' // 若不是列表页面弹框可删除
|
import TableStore from '@/utils/tableStore' // 若不是列表页面弹框可删除
|
||||||
@@ -140,6 +142,7 @@ const open = async (text: string, id: string, addFlag: boolean) => {
|
|||||||
form.value.problemDetail = ''
|
form.value.problemDetail = ''
|
||||||
form.value.problemFlag = 0
|
form.value.problemFlag = 0
|
||||||
fileList.value = []
|
fileList.value = []
|
||||||
|
|
||||||
if (!addFlag) {
|
if (!addFlag) {
|
||||||
//还需回显上次填报的测试数据 todo...,待重新发起的时候去做
|
//还需回显上次填报的测试数据 todo...,待重新发起的时候去做
|
||||||
form.value = {
|
form.value = {
|
||||||
@@ -147,7 +150,10 @@ const open = async (text: string, id: string, addFlag: boolean) => {
|
|||||||
completeTime: res.data.completeTime,
|
completeTime: res.data.completeTime,
|
||||||
completeBy: res.data.completeBy,
|
completeBy: res.data.completeBy,
|
||||||
problemFlag: res.data.problemFlag,
|
problemFlag: res.data.problemFlag,
|
||||||
testReport: [
|
testReport:
|
||||||
|
res.data.testReport == null
|
||||||
|
? []
|
||||||
|
: [
|
||||||
{
|
{
|
||||||
name: res.data.testReport.split('/')[2]
|
name: res.data.testReport.split('/')[2]
|
||||||
}
|
}
|
||||||
@@ -170,7 +176,7 @@ const rules = {
|
|||||||
completeBy: [{ required: true, message: '请输入测试负责人', trigger: 'blur' }],
|
completeBy: [{ required: true, message: '请输入测试负责人', trigger: 'blur' }],
|
||||||
testReport: [{ required: true, message: '请上传文件', trigger: 'change' }],
|
testReport: [{ required: true, message: '请上传文件', trigger: 'change' }],
|
||||||
problemFlag: [{ required: true, message: '请选择测试是否有问题', trigger: 'change' }],
|
problemFlag: [{ required: true, message: '请选择测试是否有问题', trigger: 'change' }],
|
||||||
problemDetail: [{ required: true, message: '请输入测试问题', trigger: 'blur' }],
|
problemDetail: [{ required: true, message: '请输入测试问题', trigger: 'blur' }]
|
||||||
}
|
}
|
||||||
const cancelFn = () => {
|
const cancelFn = () => {
|
||||||
formRef.value.resetFields()
|
formRef.value.resetFields()
|
||||||
@@ -178,7 +184,20 @@ const cancelFn = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 提交
|
// 提交
|
||||||
const submitFn = () => {
|
const submitFn = (flag: boolean) => {
|
||||||
|
if (flag) {
|
||||||
|
const subForm = JSON.parse(JSON.stringify(form.value))
|
||||||
|
subForm.testReport = testReport.value
|
||||||
|
subForm.saveOrCheckflag = '1'
|
||||||
|
|
||||||
|
//新增,则组装业务数据提交后台
|
||||||
|
addSurveyTest(subForm).then(res => {
|
||||||
|
ElMessage.success('保存成功!')
|
||||||
|
tableStore.index()
|
||||||
|
planAddition.value = false
|
||||||
|
})
|
||||||
|
//查询进线数据,避免一直处于loading状态
|
||||||
|
} else {
|
||||||
formRef.value.validate(async (valid: any) => {
|
formRef.value.validate(async (valid: any) => {
|
||||||
if (!testReport.value) {
|
if (!testReport.value) {
|
||||||
return ElMessage({
|
return ElMessage({
|
||||||
@@ -189,23 +208,27 @@ const submitFn = () => {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
const subForm = JSON.parse(JSON.stringify(form.value))
|
const subForm = JSON.parse(JSON.stringify(form.value))
|
||||||
subForm.testReport = testReport.value
|
subForm.testReport = testReport.value
|
||||||
|
subForm.saveOrCheckflag = '2'
|
||||||
if (addFlagRef.value) {
|
if (addFlagRef.value) {
|
||||||
//新增,则组装业务数据提交后台
|
//新增,则组装业务数据提交后台
|
||||||
await addSurveyTest(subForm)
|
await addSurveyTest(subForm).then(res => {
|
||||||
//查询进线数据,避免一直处于loading状态
|
//查询进线数据,避免一直处于loading状态
|
||||||
ElMessage.success('申请成功')
|
ElMessage.success('申请成功')
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
planAddition.value = false
|
planAddition.value = false
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
await updateSurveyTest(subForm)
|
await updateSurveyTest(subForm).then(res => {
|
||||||
//查询进线数据,避免一直处于loading状态
|
//查询进线数据,避免一直处于loading状态
|
||||||
ElMessage.success('重新申请成功')
|
ElMessage.success('重新申请成功')
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
planAddition.value = false
|
planAddition.value = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const audit = (filePath: any) => {
|
const audit = (filePath: any) => {
|
||||||
if (title.value == '计划测试填报') {
|
if (title.value == '计划测试填报') {
|
||||||
addSurvey({ ...form.value, filePath: filePath }).then((res: any) => {
|
addSurvey({ ...form.value, filePath: filePath }).then((res: any) => {
|
||||||
@@ -243,7 +266,7 @@ const uploadFileName = val => {
|
|||||||
uploadName.value = val
|
uploadName.value = val
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss' scoped>
|
<style lang="scss" scoped>
|
||||||
// :deep(.el-upload-list__item-info) {
|
// :deep(.el-upload-list__item-info) {
|
||||||
// width: 250px;
|
// width: 250px;
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ const tableStore = new TableStore({
|
|||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
custom: {
|
custom: {
|
||||||
0: 'warning',
|
0: 'warning',
|
||||||
6: 'primary',
|
|
||||||
1: 'primary',
|
1: 'primary',
|
||||||
2: 'success',
|
2: 'success',
|
||||||
3: 'danger',
|
3: 'danger',
|
||||||
@@ -122,7 +122,7 @@ const tableStore = new TableStore({
|
|||||||
},
|
},
|
||||||
replaceValue: {
|
replaceValue: {
|
||||||
0: '待提交审批',
|
0: '待提交审批',
|
||||||
6: '新增',
|
|
||||||
1: '审批中',
|
1: '审批中',
|
||||||
2: '审批通过',
|
2: '审批通过',
|
||||||
3: '审批不通过',
|
3: '审批不通过',
|
||||||
@@ -180,10 +180,7 @@ const tableStore = new TableStore({
|
|||||||
return row.createBy != adminInfo.$state.id || !(row.status == 0)
|
return row.createBy != adminInfo.$state.id || !(row.status == 0)
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
addForms.value.open({
|
planTestRef.value.open('编辑', row.id, false)
|
||||||
title: '编辑',
|
|
||||||
row: row
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user