This commit is contained in:
2026-06-09 17:06:35 +08:00
parent 0895d0b897
commit 1da9b94af2
3 changed files with 69 additions and 22 deletions
@@ -69,12 +69,14 @@ layout("/layouts/platform.html"){
<el-form :model="formData" ref="formRef" label-width="120px" :rules="formRules" label-suffix="">
<el-form-item label="审核结果" prop="tf_schoolResult"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-radio-group v-model="formData.tf_schoolResult" size="small">
<el-radio-group v-model="formData.tf_schoolResult" size="small" @change="schoolResultChange">
<el-radio label="YES" border>通过</el-radio>
<el-radio label="NO" border>不通过</el-radio>
<el-radio label="ROLLBACK" border>退回发起人修改</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="意见类别" prop="typeId"
v-if="isSchoolPass()"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-select v-model="formData.typeId" clearable filterable style="width: 100%" placeholder="请选择意见类别">
<el-option
@@ -87,6 +89,7 @@ layout("/layouts/platform.html"){
</el-form-item>
<el-form-item
label="主办单位"
v-if="isSchoolPass()"
:rules="[{required:true, message:'必填',trigger:['change','blur']}]"
prop="tf_masterUnitId"
>
@@ -100,7 +103,7 @@ layout("/layouts/platform.html"){
></el-option>
</el-select>
</el-form-item>
<el-form-item label="协办单位" prop="tf_slaveUnitIds">
<el-form-item label="协办单位" prop="tf_slaveUnitIds" v-if="isSchoolPass()">
<el-select v-model="formData.tf_slaveUnitIds" filterable clearable multiple
style="width: 100%" placeholder="请选择协办单位">
<el-option
@@ -119,7 +122,7 @@ layout("/layouts/platform.html"){
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
<el-button @click="handleTaskAction(1)" size="small" type="primary">提交</el-button>
<el-button @click="handleTaskAction" size="small" type="primary">提交</el-button>
</el-row>
</div>
</opinion-info>
@@ -187,6 +190,18 @@ layout("/layouts/platform.html"){
onReady() {
this.$refs.basicFormRef.ready(this.row.id, this.row.taskId)
},
// 通过时才需要维护意见类别和承办单位;不通过只填写审核意见,避免退回场景强制选择承办单位。
isSchoolPass() {
return this.formData.tf_schoolResult === 'YES'
},
schoolResultChange() {
if (this.isSchoolPass()) {
return
}
this.$nextTick(() => {
this.$refs.formRef && this.$refs.formRef.clearValidate(["typeId", "tf_masterUnitId", "tf_slaveUnitIds"])
})
},
openView(row) {
this.$refs.guava.edit(() => {
this.showApprovalForm = false
@@ -210,8 +225,10 @@ layout("/layouts/platform.html"){
})
},
handleTaskAction(val) {
this.$refs.formRef.validate((valid) => {
handleTaskAction() {
this.schoolResultChange()
this.$nextTick(() => {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
@@ -219,24 +236,24 @@ layout("/layouts/platform.html"){
type: "warning"
}).then(() => {
const loading = createLoading('提交中')
// The school-union audit can modify opinion type, so persist typeId before completing the workflow task.
this.$axios.post("/platform/opinion/schoolAudit/edit", {
info: JSON.stringify({
const submitType = this.formData.tf_schoolResult === 'ROLLBACK' ? 6 : 1
const executeTask = () => {
const taskData = submitType === 6 ? {
id: this.formData.id,
typeId: this.formData.typeId
})
}).then((editRes) => {
if (editRes.code !== 0) {
loading.close()
return
processTaskId: this.formData.processTaskId,
taskName: this.formData.taskName,
roleCode: this.formData.roleCode,
tf_opinion: this.formData.tf_opinion,
} : {
...this.formData,
tf_masterUnitName: this.formData.tf_masterUnitId ? this.underTakeOptions.find(v => v.id === this.formData.tf_masterUnitId)?.name : null,
tf_slaveUnitNames: this.formData.tf_slaveUnitIds.map(v => this.underTakeOptions.find(v2 => v2.id === v)?.name),
tf_slaveUnitNameStr: this.formData.tf_slaveUnitIds.map(v => this.underTakeOptions.find(v2 => v2.id === v)?.name).join(','),
}
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val,
tf_masterUnitName: this.formData.tf_masterUnitId ? this.underTakeOptions.find(v => v.id === this.formData.tf_masterUnitId)?.name : null,
tf_slaveUnitNames: this.formData.tf_slaveUnitIds.map(v => this.underTakeOptions.find(v2 => v2.id === v)?.name),
tf_slaveUnitNameStr: this.formData.tf_slaveUnitIds.map(v => this.underTakeOptions.find(v2 => v2.id === v)?.name).join(','),
...taskData,
submitType: submitType,
})
}).then((res) => {
if (res.code === 0) {
@@ -247,11 +264,29 @@ layout("/layouts/platform.html"){
}).finally(() => {
loading.close()
})
}
if (submitType === 6 || !this.isSchoolPass()) {
executeTask()
return
}
// 通过审核时校工会可调整意见类别,需要先保存 typeId,再按流程表 YES 分支继续流转。
this.$axios.post("/platform/opinion/schoolAudit/edit", {
info: JSON.stringify({
id: this.formData.id,
typeId: this.formData.typeId
})
}).then((editRes) => {
if (editRes.code === 0) {
executeTask()
return
}
loading.close()
}).catch(() => {
loading.close()
})
})
}
})
})
},