451 lines
12 KiB
Vue
451 lines
12 KiB
Vue
<template>
|
|
<el-container>
|
|
<el-header>
|
|
<div class="left-panel-group">
|
|
<el-button
|
|
type="primary"
|
|
icon="el-icon-plus"
|
|
@click="handleAdd"
|
|
v-auth="'paperrecord.create'"
|
|
></el-button>
|
|
</div>
|
|
<div class="right-panel">
|
|
<el-select
|
|
v-model="query.paper"
|
|
placeholder="选择论文名称"
|
|
clearable
|
|
filterable
|
|
:loading="loading"
|
|
@visible-change="handlePatentChange"
|
|
>
|
|
<el-option
|
|
v-for="item in patentList"
|
|
:key="item.id"
|
|
:label="item.name"
|
|
:value="item.id">
|
|
</el-option>
|
|
</el-select>
|
|
<el-button
|
|
type="primary"
|
|
icon="el-icon-search"
|
|
@click="handleQuery"
|
|
></el-button>
|
|
</div>
|
|
</el-header>
|
|
<el-main class="nopadding">
|
|
<scTable ref="table" :apiObj="apiObj" row-key="id">
|
|
<el-table-column label="序号" type="index"></el-table-column>
|
|
<el-table-column
|
|
label="论文编号"
|
|
prop="paper_number"
|
|
min-width="100"
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="名称"
|
|
prop="paper_name"
|
|
min-width="100"
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="论文类型"
|
|
prop="pa_type"
|
|
min-width="100"
|
|
:formatter="formatPcType">
|
|
</el-table-column>
|
|
<el-table-column
|
|
label="单位"
|
|
prop="organization"
|
|
min-width="100">
|
|
</el-table-column>
|
|
<el-table-column
|
|
label="作者"
|
|
prop="author"
|
|
min-width="100"
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="通讯作者"
|
|
prop="cor_author"
|
|
min-width="100"
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="归属平台"
|
|
prop="affiliated_platforms"
|
|
min-width="100"
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="归属项目"
|
|
prop="affiliated_projects"
|
|
min-width="100"
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="接受日期"
|
|
prop="accept_date"
|
|
min-width="100"
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="发表日期"
|
|
prop="public_date"
|
|
min-width="100"
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="版面费缴纳"
|
|
prop="pub_paid"
|
|
min-width="100"
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="状态"
|
|
prop="status"
|
|
min-width="100"
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="报奖情况"
|
|
prop="award_info"
|
|
min-width="100"
|
|
></el-table-column>
|
|
<el-table-column
|
|
label="奖金金额(元)"
|
|
prop="bonus_amount"
|
|
min-width="100"
|
|
></el-table-column>
|
|
<el-table-column label="操作" fixed="right" align="center" width="250">
|
|
<template #default="scope">
|
|
<el-button
|
|
link
|
|
size="small"
|
|
type="primary"
|
|
@click="filerecordEidt(scope.row)"
|
|
v-auth="'paperrecord.update'"
|
|
>编辑
|
|
</el-button>
|
|
<el-popconfirm
|
|
title="确定删除吗?"
|
|
@confirm="filerecordDel(scope.row)"
|
|
>
|
|
<template #reference>
|
|
<el-button
|
|
link
|
|
size="small"
|
|
type="danger"
|
|
v-auth="'paperrecord.delete'"
|
|
>删除</el-button
|
|
>
|
|
</template>
|
|
</el-popconfirm>
|
|
</template>
|
|
</el-table-column>
|
|
</scTable>
|
|
</el-main>
|
|
</el-container>
|
|
<el-drawer title="论文台账" v-model="limitedVisible" size="50%">
|
|
<el-form
|
|
:model="addForm"
|
|
:rules="rules"
|
|
ref="addForm"
|
|
label-width="100px"
|
|
label-position="left"
|
|
>
|
|
<el-form-item label="论文编号" prop="paper_number">
|
|
<el-input v-model="addForm.paper_number" clearable></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="论文名称" prop="paper">
|
|
<el-select
|
|
v-model="addForm.paper"
|
|
placeholder="请选择"
|
|
clearable
|
|
:loading="loading"
|
|
@visible-change="handlePatentChange">
|
|
<el-option
|
|
v-for="item in patentList"
|
|
:key="item.name"
|
|
:value="item.id"
|
|
:label="item.name"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="论文类型" prop="pa_type">
|
|
<el-select v-model="addForm.pa_type" placeholder="请选择" clearable>
|
|
<el-option label="研究论文" value="research"></el-option>
|
|
<el-option label="综述" value="overview"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="单位" prop="organization">
|
|
<el-input v-model="addForm.organization" clearable></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="作者" prop="author">
|
|
<el-input v-model="addForm.author" clearable></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="通讯作者" prop="cor_author" label-width="120px">
|
|
<el-input v-model="addForm.cor_author" clearable></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="归属平台" prop="affiliated_platforms">
|
|
<el-input v-model="addForm.affiliated_platforms" clearable></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="归属项目" prop="affiliated_projects" >
|
|
<el-input v-model="addForm.affiliated_projects" clearable></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="接受日期" prop="accept_date" >
|
|
<el-date-picker
|
|
v-model="addForm.accept_date"
|
|
type="date"
|
|
align="right"
|
|
value-format="YYYY-MM-DD"
|
|
unlink-panels
|
|
palceholder="选择日期"
|
|
></el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="发表日期" prop="public_date" >
|
|
<el-date-picker
|
|
v-model="addForm.public_date"
|
|
type="date"
|
|
align="right"
|
|
value-format="YYYY-MM-DD"
|
|
unlink-panels
|
|
palceholder="选择日期"
|
|
></el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="版面费缴纳" prop="pub_paid" >
|
|
<el-input-number
|
|
v-model="addForm.pub_paid"
|
|
:precision="2"
|
|
:step="0.01"
|
|
:min="0"
|
|
style="width: 200px"
|
|
controls-position="right"></el-input-number>
|
|
</el-form-item>
|
|
<el-form-item label="状态" prop="status">
|
|
<el-select v-model="addForm.status" placeholder="请选择" clearable>
|
|
<el-option
|
|
v-for="(label, value) in statusOptions"
|
|
:key="value"
|
|
:label="label"
|
|
:value="value"/>
|
|
</el-select>
|
|
</el-form-item>
|
|
<el-form-item label="报奖情况" prop="award_info" >
|
|
<el-input
|
|
v-model="addForm.award_info"
|
|
clearable type="textarea"
|
|
palaceholder="请输入内容"
|
|
rows="3">
|
|
></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="奖金发放" prop="bonus_amount" >
|
|
<el-input-number
|
|
v-model="addForm.bonus_amount"
|
|
:precision="2"
|
|
:step="0.01"
|
|
:min="0"
|
|
style="width: 200px"
|
|
controls-position="right"></el-input-number>
|
|
</el-form-item>
|
|
</el-form>
|
|
<template #footer>
|
|
<el-button
|
|
v-auth="'paperrecord.create'"
|
|
v-if="type !== 'show'"
|
|
type="primary"
|
|
:loading="isSaving"
|
|
@click="submitHandle()"
|
|
> 保 存</el-button
|
|
>
|
|
</template>
|
|
</el-drawer>
|
|
</template>
|
|
<script>
|
|
export default {
|
|
name: "index",
|
|
data() {
|
|
return {
|
|
workflowName:"",
|
|
workFlowId:'',
|
|
loading: false,
|
|
apiObj: this.$API.srm.paperrecord.list,
|
|
patentList: [],
|
|
statusOptions: {
|
|
"审稿中":"审稿中" ,
|
|
"一修":"一修",
|
|
"二修":"二修",
|
|
"接收":"接收",
|
|
"发表":"发表"
|
|
},
|
|
query: {},
|
|
editId: null,
|
|
isSaving: false,
|
|
limitedVisible: false,
|
|
limitedWatch: false,
|
|
type: "add",
|
|
titleMap: {
|
|
add: "新增",
|
|
edit: "编辑",
|
|
show: "查看",
|
|
},
|
|
//表单数据
|
|
addForm: {
|
|
paper_number: null,
|
|
paper: null,
|
|
pa_type: null,
|
|
organization: null,
|
|
author: null,
|
|
cor_author: "",
|
|
affiliated_platforms: "",
|
|
affiliated_projects: "",
|
|
accept_date: "",
|
|
public_date: "",
|
|
pub_paid: "",
|
|
status: "",
|
|
award_info: "",
|
|
bonus_amount: "",
|
|
},
|
|
};
|
|
},
|
|
methods: {
|
|
formatPcType(row, column, cellValue) {
|
|
const map = {
|
|
'research': '研究论文',
|
|
'overview': '综述'
|
|
};
|
|
return map[cellValue] || cellValue;
|
|
},
|
|
handleAdd() {
|
|
this.type = "add";
|
|
this.addForm = this.getDefaultForm();
|
|
this.limitedVisible = true;
|
|
},
|
|
handlePatentChange(visible){
|
|
if(visible){
|
|
this.get_patentList();
|
|
}
|
|
},
|
|
async get_patentList() {
|
|
const res = await this.$API.srm.paperrecord.get_name.req();
|
|
this.patentList = res;
|
|
},
|
|
handleAdd_outer() {
|
|
this.addForm = this.getDefaultForm();
|
|
this.type = "add";
|
|
this.limitedVisible = true;
|
|
this.lending_type = "outer";
|
|
this.addForm.is_lending = true;
|
|
},
|
|
handleCancel() {
|
|
this.limitedVisible = false; // 关闭弹窗
|
|
this.lending_type = ""; // 重置 lending_type
|
|
this.getDefaultForm()// 清空表单
|
|
},
|
|
submitHandle() {
|
|
let that = this;
|
|
that.isSaving = true;
|
|
that.submit();
|
|
},
|
|
getDefaultForm(){
|
|
return {
|
|
paper_number: null,
|
|
paper: null,
|
|
pa_type: null,
|
|
organization: null,
|
|
author: null,
|
|
cor_author: "",
|
|
affiliated_platforms: "",
|
|
affiliated_projects: "",
|
|
accept_date: "",
|
|
public_date: "",
|
|
pub_paid: "",
|
|
status: "",
|
|
award_info: "",
|
|
bonus_amount: "",
|
|
}
|
|
},
|
|
async submit() {
|
|
let that = this;
|
|
let res = null;
|
|
try {
|
|
if (that.type === "add") {
|
|
res = await that.$API.srm.paperrecord.create.req(that.addForm);
|
|
} else {
|
|
res = await that.$API.srm.paperrecord.update.req(
|
|
that.editId,
|
|
that.addForm
|
|
);
|
|
}
|
|
that.isSaving = false;
|
|
that.limitedVisible = false;
|
|
that.$refs.table.refresh();
|
|
} catch (e) {
|
|
that.isSaving = false;
|
|
}
|
|
},
|
|
// 审批流结束之后才可以编辑
|
|
filerecordEidt(row) {
|
|
this.type = "edit";
|
|
this.editId = row.id;
|
|
this.limitedVisible = true;
|
|
console.log('row--',row);
|
|
this.addForm = Object.assign({}, row);
|
|
},
|
|
async filerecordDel(row) {
|
|
var id = row.id;
|
|
var res = await this.$API.srm.paperrecord.delete.req(id);
|
|
if (res.err_msg) {
|
|
this.$message.error(res.err_msg);
|
|
} else {
|
|
this.$refs.table.refresh();
|
|
this.$message.success("删除成功");
|
|
}
|
|
},
|
|
//搜索
|
|
handleQuery() {
|
|
this.$refs.table.queryData(this.query);
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style scoped>
|
|
.treeMain {
|
|
height: 280px;
|
|
overflow: auto;
|
|
border: 1px solid #dcdfe6;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
::-webkit-scrollbar {
|
|
width: 10px;
|
|
}
|
|
|
|
::-webkit-scrollbar-track {
|
|
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.2);
|
|
background-color: #fefefe;
|
|
border-radius: 5px;
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
border-radius: 5px;
|
|
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
|
|
background-color: #f5f5f5;
|
|
}
|
|
.node rect {
|
|
stroke: #606266;
|
|
fill: #fff;
|
|
}
|
|
|
|
.edgePath path {
|
|
stroke: #606266;
|
|
fill: #333;
|
|
stroke-width: 1.5px;
|
|
}
|
|
|
|
g.conditions > rect {
|
|
fill: #00ffd0;
|
|
stroke: #000;
|
|
}
|
|
|
|
.el-icon-close {
|
|
cursor: pointer;
|
|
}
|
|
|
|
.left-panel-group {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px; /* 按钮之间的间隙,可以调小点 */
|
|
margin-left: 0; /* 靠左 */
|
|
}
|
|
</style>
|
|
|