Browse Source

feat: [试验管理] 设置学科功能

master
memorylkf 2 weeks ago
parent
commit
89c0910127
19 changed files with 189 additions and 38 deletions
  1. +25
    -0
      src/api/business/study/studySubject.js
  2. +7
    -1
      src/lang/en/business/study/studyEnter.js
  3. +7
    -1
      src/lang/zh/business/study/studyEnter.js
  4. +1
    -1
      src/views/business/comps/select/SelectDeptUserDialog.vue
  5. +128
    -15
      src/views/business/study/comp/suject.vue
  6. +2
    -1
      src/views/business/study/list.vue
  7. +2
    -2
      src/views/business/template/list.vue
  8. +3
    -3
      src/views/monitor/job/index.vue
  9. +1
    -1
      src/views/monitor/job/log.vue
  10. +1
    -1
      src/views/system/config/index.vue
  11. +1
    -1
      src/views/system/dept/index.vue
  12. +1
    -1
      src/views/system/dict/index.vue
  13. +1
    -1
      src/views/system/menu/index.vue
  14. +1
    -1
      src/views/system/notice/index.vue
  15. +1
    -1
      src/views/system/operlog/index.vue
  16. +1
    -1
      src/views/system/post/index.vue
  17. +3
    -3
      src/views/system/role/index.vue
  18. +1
    -1
      src/views/system/role/selectUser.vue
  19. +2
    -2
      src/views/system/user/index.vue

+ 25
- 0
src/api/business/study/studySubject.js View File

@ -0,0 +1,25 @@
import request from '@/utils/request'
export function studySubject_listByStudyId(query) {
return request({
url: '/system/business/studySubject/listByStudyId',
method: 'get',
params: query
})
}
export function studySubject_getAllListByStudyId(query) {
return request({
url: '/system/business/studySubject/getAllListByStudyId',
method: 'get',
params: query
})
}
export function studySubject_save(data) {
return request({
url: '/system/business/studySubject/save',
method: 'post',
data: data
})
}

+ 7
- 1
src/lang/en/business/study/studyEnter.js View File

@ -7,5 +7,11 @@ export default {
syjsygl: 'Animal Room Usage',
syxkxx: 'Disciplin',
yq: 'Invite'
yq: 'Invite',
//学科信息
xzxk: 'Discipline Setup',
xk: 'Discipline',
czfzr: 'Leader',
xzfzr: 'Choose'
}

+ 7
- 1
src/lang/zh/business/study/studyEnter.js View File

@ -7,5 +7,11 @@ export default {
syjsygl: '饲养间使用管理',
syxkxx: '试验学科信息',
yq: '邀请'
yq: '邀请',
//学科信息
xzxk: '选择学科',
xk: '学科',
czfzr: '学科/操作负责人',
xzfzr: '选择负责人'
}

+ 1
- 1
src/views/business/comps/select/SelectDeptUserDialog.vue View File

@ -1,7 +1,7 @@
<!-- 选择部门 -->
<template>
<el-dialog :title="$t('form.selectMember')" :visible.sync="open" width="800px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="$t('form.selectMember')" :visible.sync="open" width="800px" append-to-body>
<el-row>
<el-col :span="12" class="select-user-left">
<el-input

+ 128
- 15
src/views/business/study/comp/suject.vue View File

@ -10,29 +10,58 @@
<div class="operate-img"></div>
<div class="operate-left">{{$t('page.business.study.studyEnter.syxkxx')}}</div>
<div class="operate-right">
<i class="el-icon-edit operate-icon"></i>
<i class="el-icon-edit operate-icon" @click="editSubject"></i>
</div>
</div>
<div class="subject-content">
<div class="subject-item" v-for="(item,index) in subjectList" :key="index">
<div class="subject-item-name">{{item.name}}({{item.leader}})</div>
<div class="subject-item-name">{{item.deptName}}({{item.leaderName}})</div>
<div class="subject-item-add">
<el-button type="primary" plain>{{$t('page.business.study.studyEnter.yq')}}</el-button>
<el-button type="primary" plain @click="yq(item)">{{$t('page.business.study.studyEnter.yq')}}</el-button>
</div>
</div>
</div>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="infoDialog.title" :visible.sync="infoDialog.visible" width="800px" append-to-body>
<el-table v-loading="infoDialog.loading" :data="infoDialog.list">
<el-table-column label="" type="index" width="50">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.select"></el-checkbox>
</template>
</el-table-column>
<el-table-column :label="$t('page.business.study.studyEnter.xk')" prop="deptName" align="center" />
<el-table-column :label="$t('page.business.study.studyEnter.czfzr')" align="center">
<template slot-scope="scope">
<div class="subject-table-box">
<div class="subject-table-left">
<el-input v-model="scope.row.leaderName" maxlength="100" readonly />
</div>
<div class="subject-table-right">
<el-button type="primary" plain @click="chooseLeader(scope.row)">{{$t('page.business.study.studyEnter.xzfzr')}}</el-button>
</div>
</div>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="save">{{$t('form.saveConfirm')}}</el-button>
<el-button @click="infoDialog.visible = false">{{$t('form.cancel')}}</el-button>
</div>
</el-dialog>
<SelectDeptUserDialog ref="selectSubjectDeptUserDialog" v-model="infoDialog.subject.leader" :name="infoDialog.subject.leaderName" @change="changeSubject" />
</div>
</template>
<script>
import {
study_list,
study_info,
study_save,
study_delete
} from '@/api/business/study/study'
studySubject_listByStudyId,
studySubject_getAllListByStudyId,
studySubject_save
} from '@/api/business/study/studySubject'
import SelectDeptUserDialog from '../../comps/select/SelectDeptUserDialog.vue';
export default {
name: 'StudyYtbd',
name: 'StudySubject',
props: {
study:{
type:Object,
@ -41,20 +70,91 @@ export default {
}
}
},
components: {},
watch: {
study: {
immediate: true,
handler(v) {
this.getList()
}
},
},
components: {SelectDeptUserDialog},
computed: {},
filters: {},
data() {
return {
subjectList:[
{name:'色谱',leader:'谭飞'},
{name:'供试品',leader:'韩龙'},
{name:'细胞',leader:'何栋'}
]
subjectList:[],
infoDialog:{
title:this.$t('page.business.study.studyEnter.xzxk'),
visible:false,
loading:false,
list:[],
subject:{
leader:'',
leaderName:'',
}
}
}
},
created() {},
methods: {
getList(){
studySubject_listByStudyId({studyId:this.study.id}).then(response => {
this.subjectList = response.data;
})
},
editSubject(){
this.infoDialog.list = []
this.infoDialog.loading = true
studySubject_getAllListByStudyId({studyId:this.study.id}).then(response => {
this.infoDialog.list = response.data;
this.infoDialog.visible = true;
}).finally(()=>{
this.infoDialog.loading = false;
});
},
save(){
let postList = _.filter(this.infoDialog.list, (o)=> { return o.select })
if(postList.length>0){
for(let i=0;i<postList.length;i++){
let item = postList[i]
if(!item.leader || !item.leaderName){
this.$message.error(`${item.deptName}还没设置负责人`)
return false
}
}
}
this.$modal.loading()
studySubject_save({
studyId:this.study.id,
subjectList:postList
}).then(() => {
this.infoDialog.visible = false
this.getList()
}).finally(() => {
this.$modal.closeLoading()
})
},
chooseLeader(row){
this.infoDialog.subject = row
this.$refs.selectSubjectDeptUserDialog.show()
},
changeSubject(val){
this.infoDialog.subject.leader = val.id
this.infoDialog.subject.leaderName = val.name
this.infoDialog.subject.select = true
let index = _.findIndex(this.infoDialog.list,(item)=>{
return item.deptId===this.infoDialog.subject.deptId
})
if(index>-1){
this.infoDialog.list.splice(index,1,this.infoDialog.subject)
}
},
yq(item){
},
}
}
</script>
@ -131,4 +231,17 @@ export default {
}
}
}
.subject-table-box{
display: flex;
flex-direction: row;
align-items: center;
.subject-table-left{
flex-shrink: 0;
width: 60%;
}
.subject-table-right{
flex-grow: 1;
margin-left: 5px;
}
}
</style>

+ 2
- 1
src/views/business/study/list.vue View File

@ -194,8 +194,9 @@ export default {
study_list(this.searchForm).then(response => {
this.list = response.rows;
this.total = response.total;
}).finally(()=>{
this.loading = false;
});
})
},
search() {
this.searchForm.pageNum = 1;

+ 2
- 2
src/views/business/template/list.vue View File

@ -51,7 +51,7 @@
<pagination v-show="total > 0" :total="total" :page.sync="searchForm.pageNum" :limit.sync="searchForm.pageSize"
@pagination="getList" />
<el-dialog :close-on-click-modal="false" :title="infoDialog.title" :visible.sync="infoDialog.visible" width="600px"
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="infoDialog.title" :visible.sync="infoDialog.visible" width="600px"
append-to-body>
<el-form ref="infoDialogForm" :model="infoDialog.formData" :rules="infoDialog.rules" label-width="100px">
<el-row>
@ -77,7 +77,7 @@
<el-button @click="infoDialog.visible = false"> </el-button>
</div>
</el-dialog>
<el-dialog :close-on-click-modal="false" :title="$t('page.system.template.bdpz')" :visible.sync="tableDialog.visible"
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="$t('page.system.template.bdpz')" :visible.sync="tableDialog.visible"
width="90%" append-to-body>
<TemplateTable :sn="tableDialog.sn" />
</el-dialog>

+ 3
- 3
src/views/monitor/job/index.vue View File

@ -152,7 +152,7 @@
/>
<!-- 添加或修改定时任务对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
@ -236,12 +236,12 @@
</div>
</el-dialog>
<el-dialog title="Cron表达式生成器" :visible.sync="openCron" append-to-body destroy-on-close class="scrollbar">
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" title="Cron表达式生成器" :visible.sync="openCron" append-to-body destroy-on-close class="scrollbar">
<crontab @hide="openCron=false" @fill="crontabFill" :expression="expression"></crontab>
</el-dialog>
<!-- 任务日志详细 -->
<el-dialog title="任务详细" :visible.sync="openView" width="700px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" title="任务详细" :visible.sync="openView" width="700px" append-to-body>
<el-form ref="form" :model="form" label-width="120px">
<el-row>
<el-col :span="12">

+ 1
- 1
src/views/monitor/job/log.vue View File

@ -144,7 +144,7 @@
/>
<!-- 调度日志详细 -->
<el-dialog title="调度日志详细" :visible.sync="open" width="700px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" title="调度日志详细" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" label-width="100px">
<el-row>
<el-col :span="12">

+ 1
- 1
src/views/system/config/index.vue View File

@ -148,7 +148,7 @@
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="参数名称" prop="configName">
<el-input v-model="form.configName" placeholder="请输入参数名称" />

+ 1
- 1
src/views/system/dept/index.vue View File

@ -105,7 +105,7 @@
</el-table>
<!-- 添加或修改部门对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-row>
<el-col :span="24" v-if="form.parentId !== 0">

+ 1
- 1
src/views/system/dict/index.vue View File

@ -158,7 +158,7 @@
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="字典名称" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入字典名称" />

+ 1
- 1
src/views/system/menu/index.vue View File

@ -109,7 +109,7 @@
</el-table>
<!-- 添加或修改菜单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" width="680px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="24">

+ 1
- 1
src/views/system/notice/index.vue View File

@ -123,7 +123,7 @@
/>
<!-- 添加或修改公告对话框 -->
<el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" width="780px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">

+ 1
- 1
src/views/system/operlog/index.vue View File

@ -160,7 +160,7 @@
/>
<!-- 操作日志详细 -->
<el-dialog title="操作日志详细" :visible.sync="open" width="800px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" title="操作日志详细" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" label-width="100px">
<el-row>
<el-col :span="12">

+ 1
- 1
src/views/system/post/index.vue View File

@ -124,7 +124,7 @@
/>
<!-- 添加或修改岗位对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="岗位名称" prop="postName">
<el-input v-model="form.postName" placeholder="请输入岗位名称" />

+ 3
- 3
src/views/system/role/index.vue View File

@ -197,7 +197,7 @@
/>
<!-- 添加或修改角色配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-form-item :label="$t('page.system.role.name')+':'" prop="roleName">
<el-input v-model="form.roleName" :placeholder="$t('form.placeholderInput')" :readonly="readonly" />
@ -253,7 +253,7 @@
</el-dialog>
<!-- 分配角色数据权限对话框 -->
<el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="openDataScope" width="500px" append-to-body>
<el-form :model="form" label-width="80px">
<el-form-item label="角色名称">
<el-input v-model="form.roleName" :disabled="true" />
@ -296,7 +296,7 @@
<!-- 分配角色数据权限对话框 -->
<el-dialog :title="transferDialog.title" :visible.sync="transferDialog.visible" width="750px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="transferDialog.title" :visible.sync="transferDialog.visible" width="750px" append-to-body>
<el-transfer class="role-transfer" v-model="transferDialog.selected" :data="transferDialog.list" :titles="[$t('page.system.role.unauthorized'), $t('page.system.role.authorized')]"
filterable
:filter-method="filterMethod"

+ 1
- 1
src/views/system/role/selectUser.vue View File

@ -1,6 +1,6 @@
<template>
<!-- 授权用户 -->
<el-dialog title="选择用户" :visible.sync="visible" width="800px" top="5vh" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" title="选择用户" :visible.sync="visible" width="800px" top="5vh" append-to-body>
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="用户名称" prop="userName">
<el-input

+ 2
- 2
src/views/system/user/index.vue View File

@ -136,7 +136,7 @@
</el-row>
<!-- 添加或修改用户配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-row>
<el-col :span="24">
@ -237,7 +237,7 @@
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>

Loading…
Cancel
Save