撤回按钮

This commit is contained in:
2025-10-22 11:51:32 +08:00
parent 081939df01
commit e29366525d
4 changed files with 99 additions and 8 deletions

16
build/preview-static.js Normal file
View File

@@ -0,0 +1,16 @@
const connect = require('connect');
const serveStatic = require('serve-static');
const chalk = require('chalk');
const path = require('path');
const port = process.env.PORT ? Number(process.env.PORT) : 9526;
const mountPath = '/srs'; // 与生产 publicPath 保持一致
const distDir = path.resolve(__dirname, '..', 'dist');
const app = connect();
app.use(mountPath, serveStatic(distDir, { index: ['index.html', '/'] }));
app.listen(port, () => {
const url = `http://localhost:${port}${mountPath}/`;
console.log(chalk.green(`> Static preview running at ${url}`));
});

View File

@@ -51,6 +51,8 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="lookVClick(scope.row)">查看</el-button> <el-button size="mini" type="text" icon="el-icon-view" @click="lookVClick(scope.row)">查看</el-button>
<!-- 撤回按钮applyStatus 不等于 1 时显示 -->
<el-button v-if="scope.row.applyStatus != 1" size="mini" type="text" icon="el-icon-refresh-left" @click="handleRevoke(scope.row)">撤回</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -132,7 +134,7 @@ import { getTokenKeySessionStorage as getToken } from '@/utils/auth'
import GlApply from '@/views/comprehensive/knzzGlApply/cpnt/GlApply.vue' import GlApply from '@/views/comprehensive/knzzGlApply/cpnt/GlApply.vue'
import GlLook from '@/views/comprehensive/knzzGlApply/cpnt/GlLook.vue' import GlLook from '@/views/comprehensive/knzzGlApply/cpnt/GlLook.vue'
import { listFdyAll as listView } from '@/api/comprehensive/knzzGlApply' import { listFdyAll as listView, doEdit } from '@/api/comprehensive/knzzGlApply'
export default { export default {
@@ -221,6 +223,29 @@ export default {
this.lookV = true this.lookV = true
}, },
// 撤回到“已提交审核”applyStatus=1
async handleRevoke(row) {
try {
await this.$confirm('确定撤回该申请至“已提交审核”状态吗?', '提示', { type: 'warning' })
} catch (e) {
return
}
const loading = this.$loading({ lock: true, text: '撤回中…' })
try {
const payload = { id: row.id, applyStatus: 1 }
const res = await doEdit(payload)
if (res.code === 200) {
this.$message.success('撤回成功,状态已变更为:已提交审核')
this.getList()
} else {
this.$message.error(res.msg || '撤回失败')
}
} catch (err) {
this.$message.error(`撤回失败:${err?.message || '网络错误'}`)
} finally {
loading.close && loading.close()
}
}
} }
} }

View File

@@ -124,9 +124,20 @@
<el-form-item label="家庭人口数"> <el-form-item label="家庭人口数">
<el-input v-model="editForm.familyNum" /> <el-input v-model="editForm.familyNum" />
</el-form-item> </el-form-item>
<el-form-item label="家庭住址">
<el-input v-model="editForm.homeAddr" type="textarea" />
</el-form-item>
<el-form-item label="家庭月总收入"> <el-form-item label="家庭月总收入">
<el-input v-model="editForm.monthMoney" /> <el-input v-model="editForm.monthMoney" />
</el-form-item> </el-form-item>
<!-- 困难类型 -->
<el-form-item label="困难类型">
<el-select v-model="editForm.hardType" placeholder="请选择">
<el-option label="一般困难" value="一般困难" />
<el-option label="比较困难" value="比较困难" />
<el-option label="特别困难" value="特别困难" />
</el-select>
</el-form-item>
<el-form-item label="人均月收入"> <el-form-item label="人均月收入">
<el-input v-model="editForm.perMoney" /> <el-input v-model="editForm.perMoney" />
</el-form-item> </el-form-item>
@@ -273,6 +284,7 @@ export default {
zcpmbl: '', zcpmbl: '',
zpm: '', zpm: '',
zpmbl: '', zpmbl: '',
hardType: '',
hardFile: '', hardFile: '',
softFile: '' softFile: ''
}, },
@@ -447,17 +459,16 @@ export default {
}, },
async handleEditSave() { async handleEditSave() {
const sdata = { ...this.editForm } const sdata = { ...this.editForm }
// 保存前兼容:若意外为数组则取首项
if (Array.isArray(sdata.hardType)) {
sdata.hardType = sdata.hardType[0] || ''
}
const loading = fullLoading(this) const loading = fullLoading(this)
const res =await doEdit(sdata) const res =await doEdit(sdata)
loading.close() loading.close()
if (res.code == 200) { if (res.code == 200) {
this.$message.success('保存成功') this.$message.success('保存成功')
if (this.editV) {
this.editForm = { ...this.editForm, ...payload }
this.editV = false this.editV = false
} else {
this.lookForm = { ...this.lookForm, ...payload }
}
this.getList() this.getList()
} else { } else {
this.$message.error(res.msg || '保存失败') this.$message.error(res.msg || '保存失败')
@@ -515,6 +526,15 @@ export default {
if (res.code === 200) { if (res.code === 200) {
// 直接使用后端返回的完整数据作为编辑表单数据 // 直接使用后端返回的完整数据作为编辑表单数据
this.editForm = { ...res.data } this.editForm = { ...res.data }
// 兼容困难类型为字符串/数组/逗号分隔字符串的回填(单选)
const ht = this.editForm.hardType
if (Array.isArray(ht)) {
this.editForm.hardType = ht[0] || ''
} else if (typeof ht === 'string' && ht.trim()) {
this.editForm.hardType = ht.includes(',') ? ht.split(',')[0].trim() : ht
} else {
this.editForm.hardType = ''
}
this.editV = true this.editV = true
} else { } else {
this.$message.error(res.msg || '获取详情失败') this.$message.error(res.msg || '获取详情失败')

View File

@@ -43,6 +43,9 @@
<el-button type="text" size="mini" icon="el-icon-view" <el-button type="text" size="mini" icon="el-icon-view"
@click="auditVClick(scope.row)" @click="auditVClick(scope.row)"
>查看详情</el-button> >查看详情</el-button>
<el-button v-if="scope.row.applyStatus !== '1'" type="text" size="mini" icon="el-icon-refresh-left"
@click="handleRevoke(scope.row)"
>撤回</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -280,7 +283,7 @@
<script> <script>
import { import {
listFdyAllAudit as listFdyAudit, lookDetail, listStuScoreClassRank, listStuYearCourseScore, countStuPass, countStuIam, fdyAudit listFdyAllAudit as listFdyAudit, lookDetail, listStuScoreClassRank, listStuYearCourseScore, countStuPass, countStuIam, fdyAudit
, fdyExport, applyStatus , fdyExport, applyStatus, changeApply
} from '@/api/stuCQS/good/audit' } from '@/api/stuCQS/good/audit'
import { listOwnClass } from '@/api/stuCQS/info-fill/stu_eva_task' import { listOwnClass } from '@/api/stuCQS/info-fill/stu_eva_task'
import { listAllYear as listYear } from '@/api/stuCQS/basedata/year' import { listAllYear as listYear } from '@/api/stuCQS/basedata/year'
@@ -573,6 +576,33 @@ export default {
this.auditV = true this.auditV = true
} }
}, },
async handleRevoke(row) {
this.$confirm('确定要撤回该申请吗?撤回后申请状态将变为"已提交待辅导员审核"', '撤回确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.loading = true
try {
let res = await changeApply({
applyId: row.applyId,
status: '1'
})
this.loading = false
if (res.code == 200) {
this.$message.success('撤回成功')
this.getList()
} else {
this.$message.error(res.msg || '撤回失败')
}
} catch (error) {
this.loading = false
this.$message.error('撤回失败,请稍后重试')
}
}).catch(() => {
this.$message.info('已取消撤回')
})
},
async countStuIam() { async countStuIam() {
let stuNo = this.auditForm.stuNo let stuNo = this.auditForm.stuNo
let res = await countStuIam(stuNo) let res = await countStuIam(stuNo)