Browse Source

feat: [试验管理] 试验列表

luojie
memorylkf 2 weeks ago
parent
commit
5752508329
7 changed files with 410 additions and 3 deletions
  1. +33
    -0
      src/api/business/study/study.js
  2. +5
    -1
      src/lang/en.js
  3. +39
    -0
      src/lang/en/business/study/study.js
  4. +5
    -1
      src/lang/zh.js
  5. +39
    -0
      src/lang/zh/business/study/study.js
  6. +288
    -0
      src/views/business/study/list.vue
  7. +1
    -1
      src/views/system/role/index.vue

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

@ -0,0 +1,33 @@
import request from '@/utils/request'
export function study_list(query) {
return request({
url: '/system/business/study/list',
method: 'get',
params: query
})
}
export function study_info(query) {
return request({
url: '/system/business/study/info',
method: 'get',
params: query
})
}
export function study_save(data) {
return request({
url: '/system/business/study/save',
method: 'post',
data: data
})
}
export function study_delete(data) {
return request({
url: '/system/business/study/delete',
method: 'post',
data: data
})
}

+ 5
- 1
src/lang/en.js View File

@ -10,6 +10,9 @@ import user from './en/system/user'
// 模板管理 // 模板管理
import template from './en/system/template' import template from './en/system/template'
// 试验管理
import study from './en/business/study/study'
//资源库管理 //资源库管理
// 仪器管理 // 仪器管理
import yq from './en/business/resource/yq/yq' import yq from './en/business/resource/yq/yq'
@ -123,7 +126,8 @@ export default {
mjy, mjy,
yq, yq,
sj sj
}
},
study: study
} }
} }
} }

+ 39
- 0
src/lang/en/business/study/study.js View File

@ -0,0 +1,39 @@
export default {
name: 'Study Name',
sn: 'Study ID',
dateRange: 'Date Range',
status: 'Status',
startDate: 'Start Date',
endDate: 'End Date',
leader: 'Study Director',
add: 'Create',
sort: 'Num',
borrowStatus: 'Check-out Status',
formCount: 'Records',
formFinishCount: 'Completed Records',
createDate: 'Creation Date',
remark: 'Remark',
statusCg: 'Draft',
statusSyz: 'On-going',
statusYsd: 'Locked',
statusDgd: 'Pending Archiving',
statusGd: 'Archived',
statusDjd: 'Pending De-archiving',
borrowStatusWjy: '未借阅',
borrowStatusJyz: 'In Review',
borrowStatusDjy: 'Pending Review',
edit: 'Edit',
enter: 'Enter',
delete: 'Remove',
detail: 'Detail',
gd: 'Archive',
jy: 'Check out',
jd: 'De-archive',
js: 'Unlock',
notEmpty: ' Can Not Be Empty'
}

+ 5
- 1
src/lang/zh.js View File

@ -10,6 +10,9 @@ import user from './zh/system/user'
// 模板管理 // 模板管理
import template from './zh/system/template' import template from './zh/system/template'
// 试验管理
import study from './zh/business/study/study'
//资源库管理 //资源库管理
// 仪器管理 // 仪器管理
import yq from './zh/business/resource/yq/yq' import yq from './zh/business/resource/yq/yq'
@ -120,7 +123,8 @@ export default {
mjy, mjy,
yq, yq,
sj sj
}
},
study: study
} }
} }
} }

+ 39
- 0
src/lang/zh/business/study/study.js View File

@ -0,0 +1,39 @@
export default {
name: '试验名称',
sn: '试验编号',
dateRange: '试验时间范围',
status: '试验状态',
startDate: '开始时间',
endDate: '结束时间',
leader: '负责人',
add: '新增试验',
sort: '序号',
borrowStatus: '借阅状态',
formCount: '试验表单数',
formFinishCount: '试验完成表单数',
createDate: '创建时间',
remark: '试验简述',
statusCg: '草稿',
statusSyz: '试验中',
statusYsd: '已锁定',
statusDgd: '待归档',
statusGd: '归档',
statusDjd: '待解档',
borrowStatusWjy: '未借阅',
borrowStatusJyz: '借阅中',
borrowStatusDjy: '待借阅',
edit: '编辑',
enter: '进入试验',
delete: '删除',
detail: '详情',
gd: '归档',
jy: '借阅',
jd: '解档',
js: '解锁',
notEmpty: '不能为空'
}

+ 288
- 0
src/views/business/study/list.vue View File

@ -0,0 +1,288 @@
<template>
<div class="app-container study-page">
<el-form :model="searchForm" ref="searchForm" :inline="true">
<el-form-item prop="name">
<el-input v-model="searchForm.name" :label="$t('page.business.study.name')" :placeholder="$t('form.placeholderInput')" clearable style="width: 150px" @keyup.enter.native="search" />
</el-form-item>
<el-form-item prop="sn">
<el-input v-model="searchForm.sn" :label="$t('page.business.study.sn')" :placeholder="$t('form.placeholderInput')" clearable style="width: 150px" @keyup.enter.native="search" />
</el-form-item>
<el-form-item>
<el-date-picker v-model="daterange" :label="$t('page.business.study.dateRange')" clearable type="daterange" range-separator="-" :start-placeholder="$t('page.business.study.startDate')"
:end-placeholder="$t('page.business.study.endDate')" value-format="yyyy-MM-dd" @change="search" style="width: 220px" />
</el-form-item>
<el-form-item prop="status">
<el-select
v-model="searchForm.status"
:label="$t('page.business.study.status')"
:placeholder="$t('form.placeholderSelect')"
clearable
style="width: 100px"
@change="search"
>
<el-option :label="$t('page.business.study.statusCg')" :value="1" />
<el-option :label="$t('page.business.study.statusSyz')" :value="3" />
<el-option :label="$t('page.business.study.statusYsd')" :value="5" />
<el-option :label="$t('page.business.study.statusDgd')" :value="7" />
<el-option :label="$t('page.business.study.statusGd')" :value="9" />
<el-option :label="$t('page.business.study.statusDjd')" :value="10" />
</el-select>
</el-form-item>
<el-form-item prop="leaderName">
<el-input v-model="searchForm.leaderName" :label="$t('page.business.study.leader')" :placeholder="$t('form.placeholderInput')" clearable style="width: 150px" @keyup.enter.native="search" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search">{{ $t('form.search') }}</el-button>
<el-button icon="el-icon-refresh" @click="reset">{{ $t('form.reset') }}</el-button>
</el-form-item>
</el-form>
<el-row>
<el-col>
<el-button type="primary" icon="el-icon-plus" @click="edit(null)" v-hasPermi="['business:study:add']">{{ $t('page.business.study.add') }}</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="list">
<el-table-column :label="$t('page.business.study.sort')" type="index" width="50" />
<el-table-column :label="$t('page.business.study.name')" align="center" prop="name" />
<el-table-column :label="$t('page.business.study.sn')" align="center" prop="sn" />
<el-table-column :label="$t('page.business.study.status')" prop="status" width="150">
<template slot-scope="scope">
<span v-if="scope.row.status===1">{{$t('page.business.study.statusCg')}}</span>
<span v-if="scope.row.status===3">{{$t('page.business.study.statusSyz')}}</span>
<span v-if="scope.row.status===5">{{$t('page.business.study.statusYsd')}}</span>
<span v-if="scope.row.status===7">{{$t('page.business.study.statusDgd')}}</span>
<span v-if="scope.row.status===9">{{$t('page.business.study.statusGd')}}</span>
<span v-if="scope.row.status===10">{{$t('page.business.study.statusDjd')}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('page.business.study.borrowStatus')" prop="borrowStatus" width="150">
<template slot-scope="scope">
<span v-if="scope.row.borrowStatus===1">{{$t('page.business.study.borrowStatusWjy')}}</span>
<span v-if="scope.row.borrowStatus===5">{{$t('page.business.study.borrowStatusJyz')}}</span>
<span v-if="scope.row.borrowStatus===10">{{$t('page.business.study.borrowStatusDjy')}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('page.business.study.formCount')" align="center" prop="formCount" width="100" />
<el-table-column :label="$t('page.business.study.formFinishCount')" align="center" prop="formFinishCount" width="100" />
<el-table-column :label="$t('page.business.study.leader')" align="center" prop="leaderName" />
<el-table-column :label="$t('page.business.study.createDate')" align="center" prop="createTime" width="150" />
<el-table-column :label="$t('form.operate')" fixed="right" align="center" width="100">
<template slot-scope="scope">
<!-- 编辑 -->
<el-button type="text" @click="edit(scope.row)" v-hasPermi="['business:study:edit']" v-if="scope.row.status===1 || scope.row.status===3">{{$t('page.business.study.edit')}}</el-button>
<!-- 删除 -->
<el-button type="text" @click="del(scope.row)" v-hasPermi="['business:study:remove']" v-if="scope.row.status===1">{{$t('page.business.study.delete')}}</el-button>
<!-- 详情 -->
<el-button type="text" @click="detail(scope.row)" v-hasPermi="['business:study:detail']" v-if="scope.row.status===1 || scope.row.status===3 || scope.row.status===5 || (scope.row.status===9 && scope.row.borrowStatus===10)">{{$t('page.business.study.detail')}}</el-button>
<!-- 进入试验 -->
<el-button type="text" @click="enter(scope.row)" v-hasPermi="['business:study:enter']" v-if="scope.row.status===3 || scope.row.status===5 || (scope.row.status===9 && scope.row.borrowStatus===10)">{{$t('page.business.study.enter')}}</el-button>
<!-- 归档 -->
<el-button type="text" @click="gd(scope.row)" v-hasPermi="['business:study:gd']" v-if="scope.row.status===5">{{$t('page.business.study.gd')}}</el-button>
<!-- 解锁 -->
<el-button type="text" @click="jd(scope.row)" v-hasPermi="['business:study:js']" v-if="scope.row.status===5">{{$t('page.business.study.js')}}</el-button>
<!-- 解档 -->
<el-button type="text" @click="jd(scope.row)" v-hasPermi="['business:study:jd']" v-if="scope.row.status===9 && scope.row.borrowStatus===1">{{$t('page.business.study.jd')}}</el-button>
<!-- 借阅 -->
<el-button type="text" @click="jd(scope.row)" v-hasPermi="['business:study:jy']" v-if="scope.row.status===9 && scope.row.borrowStatus===1">{{$t('page.business.study.jy')}}</el-button>
</template>
</el-table-column>
</el-table>
<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" append-to-body>
<el-form ref="infoDialogForm" :model="infoDialog.formData" :rules="infoDialog.rules" label-width="100px">
<el-row>
<el-col :span="24">
<el-form-item :label="$t('page.business.study.name')+':'" prop="name">
<el-input v-model="infoDialog.formData.name" :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="$t('page.business.study.sn')+':'" prop="sn">
<el-input v-model="infoDialog.formData.sn" :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="$t('page.business.study.leader')+':'" prop="leader">
<el-input v-model="infoDialog.formData.leader" :placeholder="$t('form.placeholderInput')" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="$t('page.business.study.remark')+':'" prop="remark">
<el-input type="textarea" :rows="5" :placeholder="$t('form.placeholderInput')" v-model="infoDialog.formData.remark"> </el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="save"> </el-button>
<el-button @click="infoDialog.visible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { study_list,study_info,study_save,study_delete} from "@/api/business/study/study";
import SelectDept from '../comps/select/SelectDept.vue';
const EmptyDialogData = {
id:'',
name:'',
sn:'',
leader:'',
reamrk:''
}
export default {
name: "Study",
props:{
},
components:{
SelectDept
},
computed: {
},
filters:{
},
data() {
return {
daterange:[],
searchForm: {
pageNum: 1,
pageSize: 10,
sn:'',
name:'',
leaderName:'',
status:'',
startDate:'',
endDate:'',
},
loading: true,
total: 0,
list: [],
infoDialog:{
title:'',
visible:false,
formData:{},
rules:{
name: [
{ required: true, message: this.$t('page.business.study.name')+this.$t('page.business.study.notEmpty'), trigger: "blur" }
],
sn: [
{ required: true, message: this.$t('page.business.study.sn')+this.$t('page.business.study.notEmpty'), trigger: "blur" }
],
leader: [
{ required: true, message: this.$t('page.business.study.leader')+this.$t('page.business.study.notEmpty'), trigger: "change" }
],
}
},
};
},
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
this.searchForm.startDate = this.daterange && this.daterange.length > 0 ? this.daterange[0] : ''
this.searchForm.endDate = this.daterange && this.daterange.length > 1 ? this.daterange[1] : ''
study_list(this.searchForm).then(response => {
this.list = response.rows;
this.total = response.total;
this.loading = false;
});
},
search() {
this.searchForm.pageNum = 1;
this.getList();
},
reset(){
this.searchForm = {
pageNum: 1,
pageSize: 10,
sn:'',
name:'',
leaderName:'',
status:'',
startDate:'',
endDate:'',
}
this.daterange = []
this.search()
},
edit(row) {
this.$refs['infoDialogForm'] && this.$refs['infoDialogForm'].resetFields()
this.infoDialog.title = '新增'
this.infoDialog.formData = _.merge({}, EmptyDialogData)
if(row && row.id){
this.infoDialog.title = '编辑'
this.$modal.loading()
study_info({id:row.id}).then(({data}) => {
this.infoDialog.formData = data
}).finally(() => {
this.$modal.closeLoading()
})
}
this.infoDialog.visible = true
// this.infoDialog.title = this.$t('page.business.study.edit')
// this.$modal.loading()
// study_info({id:row.id}).then(({data}) => {
// this.infoDialog.formData = data
// }).finally(() => {
// this.$modal.closeLoading()
// })
},
save() {
this.$refs['infoDialogForm'].validate(valid => {
if (valid) {
this.$modal.loading()
study_save(this.infoDialog.formData).then(() => {
this.infoDialog.visible = false
this.getList()
}).finally(() => {
this.$modal.closeLoading()
})
}
})
},
del(row) {
this.$confirm('确定要删除吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$modal.loading()
study_delete({ id: row.id}).then(() => {
this.getList()
})
.finally(() => {
this.$modal.closeLoading()
})
})
.catch(() => {})
},
}
};
</script>
<style lang="scss">
</style>

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

@ -239,7 +239,7 @@
show-checkbox show-checkbox
ref="menu" ref="menu"
node-key="id" node-key="id"
:check-strictly="!form.menuCheckStrictly"
:check-strictly="false"
empty-text="loading" empty-text="loading"
:props="defaultProps" :props="defaultProps"
></el-tree> ></el-tree>

Loading…
Cancel
Save