Commit 23d69457 authored by 徐俊's avatar 徐俊

xujun

parent 8dd452d4
......@@ -485,6 +485,12 @@ export default {
save (params) {
return fetch(`/v1/science-admin/com-talent-apply/save`, params, 'post', 'json')
},
delete (params) {
return fetch(`/v1/science-admin/com-talent-apply/delete/${params.id}`, params, 'delete', 'json')
},
report (params) {
return fetch(`/v1/science-admin/com-talent-apply/report`, params, 'post', 'json')
},
},
task: {
getListByPage (params) {
......@@ -791,6 +797,9 @@ export default {
save (params) {
return fetch(`/v1/science-admin/system-set/save`, params, 'post', 'json')
},
getTalentTraningInfo (params) {
return fetch(`/v1/science-admin/system-set/getTalentTraningInfo`, params)
},
},
parameter: {
getListByPage (params) {
......
......@@ -33,6 +33,7 @@
<a-popconfirm title="确定要上报吗?" v-if="((record.talentState == 10 || record.talentState == 30))" ok-text="确定" cancel-text="取消" @confirm="recordClick(record,'report')">
<a-button type="link" size="small">上报</a-button>
</a-popconfirm>
<a-button type="link" size="small" v-if="record.talentState <= 10" @click="recordClick(record,'delete')">删除</a-button>
</template>
</a-table>
<a-pagination v-if="pagination.total > 0" :total="pagination.total" show-size-changer show-quick-jumper v-model="pagination.pageIndex" :page-size="pagination.pageSize" :page-size-options="pagination.pageSizeOptions" @showSizeChange="showSizeChange" @change="change" :showTotal="() => `共 ${pagination.total} 条`" />
......@@ -179,7 +180,36 @@ export default {
this.id = record.id
this.visibleEdit = true
} else if (type === 'delete') {
let self = this
this.$confirm({
title: '',
content: '确定要删除该人才申报记录?',
okText: '确定',
okType: 'danger',
cancelText: '取消',
onOk () {
self.loading = true
let par = { id: record.id }
self.$api.talent.delete(par).then(({ code, data }) => {
if (data) {
self.$message.success('删除成功!')
self.getListByPage()
}
self.loading = false
}).catch(() => { self.loading = false })
},
onCancel () {
},
})
} else if (type === 'report') {
this.loading = true
this.$api.talent.report({ auditObjectId: record.id, auditType: 6 }).then(({ data = {} }) => {
if (data) {
this.$message.success('上报成功!')
this.getListByPage()
}
this.loading = false
}).catch(() => { this.loading = false })
}
},
exportData() {
......
......@@ -33,7 +33,7 @@
<div class="special-middle">
<div>
<a-form-model-item prop="talentCategory">
<para-select v-model="formData.talentCategory" :typeId="21" :width="180" />
<para-select v-model="formData.talentCategory" :typeId="21" @change="talentCategoryChange" :width="180" />
</a-form-model-item>
</div>
</div>
......@@ -584,6 +584,17 @@ export default {
scientificList: [],
fileList: [],
},
talentTraningInfo: {
HTTalent: null,
ALTalent: null,
RTTalent: null,
ALTrainingYear: null,
ALEveryYearFee: null,
HTTrainingYear: null,
HTEveryYearFee: null,
RTTrainingYear: null,
RTEveryYearFee: null,
},
rules: {
talentCategory: [{ required: true, message: '*', trigger: 'change' },],
certId: [{ required: true, message: '*', trigger: 'blur' },],
......@@ -612,9 +623,12 @@ export default {
planTarget: [{ required: true, message: '*', trigger: 'blur' }],
unitAdvice: [{ required: true, message: '*', trigger: 'blur' }],
},
talentTypeId: -1,
};
},
created () {
this.getTalentTraningInfo()
if (this.value)
this.getTalentApplyById()
else
......@@ -622,6 +636,14 @@ export default {
},
methods: {
moment,
getTalentTraningInfo () {
this.$api.systemSet.getTalentTraningInfo().then(({ data = {} }) => {
if (data) {
this.talentTraningInfo = data
console.log(this.talentTraningInfo)
}
})
},
getNewTalentApply() {
this.$api.talent.getNewTalentApply({ }).then(({ data = {} }) => {
if (data) {
......@@ -642,13 +664,16 @@ export default {
this.$api.talent.getTalentApplyById({ id: this.value }).then(({ data = {} }) => {
if (data) {
// 处理字符串转数组
let talentType = null
if (typeof data.talentType === 'string' && data.talentType) {
data.talentType = data.talentType.split(',')
talentType = [...data.talentType]
}
if (typeof data.graduateTeacher === 'string' && data.graduateTeacher) {
data.graduateTeacher = data.graduateTeacher.split(',')
}
this.formData = data
this.talentCategoryHolder(talentType)
this.$emit('onStepChange', { step: 0, state: data.completeStatus })
this.loadList()
} else {
......@@ -893,37 +918,25 @@ export default {
},
FundChange() {
this.formData.totalFund = this.formData.applyFund + this.formData.otherFund
}
},
computed: {
talentTypeId() {
if (this.formData.talentCategory === '57de1220-ff12-11ef-b6cb-0c42a1380f01' ||
this.formData.talentCategory === '57de1220-ff12-11ef-b6cb-0c42a1380f03') {
return 23;
} else if (this.formData.talentCategory === '57de1220-ff12-11ef-b6cb-0c42a1380f02') {
return 16;
},
talentCategoryChange() {
this.talentCategoryHolder(null)
},
talentCategoryHolder(talentType) {
if (this.formData.talentCategory === this.talentTraningInfo.HTTalent ||
this.formData.talentCategory === this.talentTraningInfo.RTTalent) {
this.talentTypeId = 23
} else if (this.formData.talentCategory === this.talentTraningInfo.ALTalent) {
this.talentTypeId = 16
} else {
return 16;
this.talentTypeId = 16
}
if (talentType)
this.formData.talentType = talentType
else
this.formData.talentType = []
}
},
watch: {
'formData.talentCategory': {
handler(newVal, oldVal) {
if (newVal !== oldVal) {
// 清空选择
this.formData.talentType = [];
// 添加一个短暂的延迟,确保组件有时间响应变化
// this.$nextTick(() => {
// // 可以在这里添加一些额外的逻辑,如果需要的话
// console.log('人才类别已更改为:', newVal);
// console.log('当前使用的 typeId:', this.talentTypeId);
// });
}
},
immediate: true
}
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment