Browse Source

feat:[试验管理][饲养间]页面布局

master
HanLong 6 days ago
parent
commit
5cc8ae78d5
6 changed files with 649 additions and 2 deletions
  1. +9
    -0
      src/api/business/public/public.js
  2. +88
    -0
      src/views/business/comps/select/SelectRoom.vue
  3. +92
    -0
      src/views/business/comps/select/SelectTestArea.vue
  4. +4
    -2
      src/views/business/study/comp/enter.vue
  5. +82
    -0
      src/views/business/study/comp/syj.vue
  6. +374
    -0
      src/views/business/study/comp/syjList.vue

+ 9
- 0
src/api/business/public/public.js View File

@ -37,3 +37,12 @@ export function public_studyFormPreList(query) {
params: query
})
}
// 试验区域-饲养间列表
export function public_roomList(query) {
return request({
url: '/system/business/public/roomList',
method: 'get',
params: query
})
}

+ 88
- 0
src/views/business/comps/select/SelectRoom.vue View File

@ -0,0 +1,88 @@
<!-- 试验区域-饲养间号 -->
<template>
<div>
<el-select style="width:100%" v-model="selected" :placeholder="$t('form.placeholderSelect')" :disabled="readonly" :multiple="multiple" @change="handleChange" :filterable="filterable">
<el-option v-for="item in list" :key="item" :label="item" :value="item" />
</el-select>
</div>
</template>
<script>
import { public_roomList } from "@/api/business/public/public";
export default {
name: "SelectRoom",
components: {},
props: {
value: {
type: [Number, String , Array],
default: '',
},
//
testArea: {
type: String,
default: ''
},
readonly: {
type: Boolean,
default: false
},
multiple: {
type: Boolean,
default: true
},
filterable: {
type: Boolean,
default: true
},
placeholder: {
type: String,
default: ''
}
},
watch: {
value: {
immediate: true,
handler(v) {
if(!this.multiple){
this.selected = v ? v : ''
}else{
if(v){
//,
let arr = v.split(',')
let s = []
_.forEach(arr,a=>{
s.push(a)
})
this.selected = s
}else{
this.selected = []
}
}
}
}
},
data() {
return {
selected: '',
list: [],
queryParam:{
}
};
},
mounted() {
this.getList()
},
methods: {
getList() {
this.list = []
public_roomList({syqy: this.testArea}).then(response => {
this.list = response.data || []
})
},
handleChange(val) {
this.$emit('input', val)
this.$emit('change', val)
},
}
};
</script>

+ 92
- 0
src/views/business/comps/select/SelectTestArea.vue View File

@ -0,0 +1,92 @@
<!-- 试验区域 -->
<template>
<div>
<el-select style="width:100%" v-model="selected" :placeholder="$t('form.placeholderSelect')" :disabled="readonly" :multiple="multiple" @change="handleChange" :filterable="filterable">
<el-option v-for="item in list" :key="item" :label="item" :value="item" />
</el-select>
</div>
</template>
<script>
import { public_roomList } from "@/api/business/public/public";
export default {
name: "SelectTestArea",
components: {},
props: {
value: {
type: [Number, String , Array],
default: '',
},
//
syqy: {
type: String,
default: ''
},
readonly: {
type: Boolean,
default: false
},
multiple: {
type: Boolean,
default: true
},
filterable: {
type: Boolean,
default: true
},
placeholder: {
type: String,
default: ''
}
},
watch: {
value: {
immediate: true,
handler(v) {
if(!this.multiple){
this.selected = v ? v : ''
}else{
if(v){
//,
let arr = v.split(',')
let s = []
_.forEach(arr,a=>{
s.push(a)
})
this.selected = s
}else{
this.selected = []
}
}
}
}
},
data() {
return {
selected: '',
list: [],
queryParam:{
}
};
},
mounted() {
this.getList()
},
methods: {
getList() {
this.list = []
public_roomList(this.queryParam).then(response => {
response.data.forEach(item => {
if(this.list.indexOf(item.syqy) < 0) {
this.list.push(item.syqy)
}
})
})
},
handleChange(val) {
this.$emit('input', val)
this.$emit('change', val)
},
}
};
</script>

+ 4
- 2
src/views/business/study/comp/enter.vue View File

@ -14,6 +14,7 @@
<syxx v-if="active === 'syxx'" :study="study" @showDetail="showDetailCallback"/>
<syff v-if="active === 'syff'" :study="study" @showDetail="showDetailCallback"/>
<wzlb v-if="active === 'wzlb'" :study="study" @showDetail="showDetailCallback"/>
<syj v-if="active === 'syj'" :study="study" @showDetail="showDetailCallback"/>
</div>
</div>
</div>
@ -25,10 +26,11 @@ import tbbd from './tbbd.vue'
import syxx from './syxx.vue'
import syff from './syff.vue'
import wzlb from './wzlb.vue'
import syj from './syj.vue'
export default {
name: 'StudyEnter',
props: {},
components: { ytbd, tbbd ,syxx,syff,wzlb},
components: { ytbd, tbbd ,syxx,syff,wzlb, syj},
computed: {},
filters: {},
data() {
@ -47,7 +49,7 @@ export default {
study: {},
}
},
created() {
created() {
// let x = this.$route.params
// let y = this.$route.query
// debugger

+ 82
- 0
src/views/business/study/comp/syj.vue View File

@ -0,0 +1,82 @@
<!-- 饲养间使用管理 -->
<template>
<div class="study-tbbd">
<div class="tbbd-left" v-show="!showDetail">
<sbject :study="study" @change="changeSubject" />
</div>
<div class="tbbd-right" v-if="studyInfo.studySubjectId != ''">
<syjList :study="studyInfo" @showDetail="showDetailCallback" />
</div>
</div>
</template>
<script>
import sbject from './suject.vue'
import syjList from './syjList.vue'
export default {
name: 'StudySyj',
props: {
study: {
type: Object,
default: () => {
return {}
}
}
},
watch: {
study: {
immediate: true,
handler(v) {
this.studyInfo = {
studyId: v.id,
studyLeader: v.leader,
studySubjectId: ''
}
},
deep: true,
},
},
components: { sbject, syjList },
computed: {},
filters: {},
data() {
return {
showDetail: false,
studyInfo: {
studyId: this.study.id,
studyLeader: this.study.leader,
studySubjectId: ''
}
}
},
created() { },
methods: {
changeSubject(val) {
this.studyInfo.studySubjectId = val
},
showDetailCallback(val) {
this.showDetail = val
this.$emit('showDetail', val)
}
}
}
</script>
<style lang="scss" scoped>
.study-tbbd {
display: flex;
flex-direction: row;
.tbbd-left {
background: #fff;
padding: 20px;
margin-right: 10px;
flex-shrink: 0;
width: 350px;
}
.tbbd-right {
flex-grow: 1;
overflow: hidden;
}
}
</style>

+ 374
- 0
src/views/business/study/comp/syjList.vue View File

@ -0,0 +1,374 @@
<!-- 饲养间列表 -->
<template>
<div>
<div class="tbbd-list" v-show="!showDetail && !showEdit && !showAudit && !showFh">
<div class="tbbd-search">
<el-form :model="searchForm" ref="searchForm" :inline="true" label-width="100px">
<el-row>
<el-col :span="6">
<el-form-item :label="$t('page.business.form.bdmc')" prop="name">
<el-input v-model="searchForm.bdmc" :placeholder="$t('form.placeholderInput')" clearable
style="width: 200px" @keyup.enter.native="search" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('page.business.form.bdbh')" prop="sn">
<el-input v-model="searchForm.bdbh" :placeholder="$t('form.placeholderInput')" clearable
style="width: 200px" @keyup.enter.native="search" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('page.business.form.gsr')" prop="userId">
<SelectDeptUser v-model="searchForm.userId" style="width: 200px" :name="searchForm.userMc" key="userId"
@change="userChange" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<div style="margin-left: 100px;">
<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>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item :label="$t('page.business.form.xtmbmc')" prop="templateName">
<el-input v-model="searchForm.templateMc" :placeholder="$t('form.placeholderInput')" clearable
style="width: 200px" @keyup.enter.native="search" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('page.business.form.cjsj')">
<el-date-picker v-model="daterange" clearable type="daterange" range-separator="-"
:start-placeholder="$t('page.business.form.startDate')"
:end-placeholder="$t('page.business.form.endDate')" value-format="yyyy-MM-dd" @change="search"
style="width: 200px" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('page.business.form.tjsj')">
<el-date-picker v-model="daterangetj" clearable type="daterange" range-separator="-"
:start-placeholder="$t('page.business.form.startDate')"
:end-placeholder="$t('page.business.form.endDate')" value-format="yyyy-MM-dd" @change="search"
style="width: 200px" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="$t('page.business.study.studyFormFill.sfbl')">
<el-select v-model="searchForm.sfbl" :placeholder="$t('form.placeholderSelect')" clearable
@change="search">
<el-option :label="$t('page.business.study.studyFormFill.yes')" :value="10" />
<el-option :label="$t('page.business.study.studyFormFill.no')" :value="1" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="tbbd-content">
<el-row class="add-box">
<el-col>
<el-button type="primary" icon="el-icon-plus" @click="add()" v-hasPermi="['business:studyFormFill:xz']">{{
$t('page.business.study.studyFormFill.xzbd') }}</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="list">
<el-table-column :label="$t('page.business.form.bh')" prop="bdbh" />
<el-table-column :label="$t('page.business.form.bdmc')" prop="bdmc" />
<el-table-column :label="$t('page.business.form.xtmbmc')" prop="templateMc" />
<el-table-column :label="$t('page.business.form.cjsj')" align="center" prop="createTime" width="140" />
<el-table-column :label="$t('page.business.form.gsr')" align="center" prop="userMc" width="100" />
<el-table-column :label="$t('page.business.form.status')" prop="status" align="center" width="100">
<template slot-scope="scope">
<span v-if="scope.row.bdzt === 1">{{ $t('page.business.study.studyFormFill.tbz') }}</span>
<span v-if="scope.row.bdzt === 3">{{ $t('page.business.study.studyFormFill.ytj') }}</span>
<span v-if="scope.row.bdzt === 5">{{ $t('page.business.study.studyFormFill.ywc') }}</span>
<span v-if="scope.row.bdzt === 7">{{ $t('page.business.study.studyFormFill.ywcfh') }}</span>
<span v-if="scope.row.bdzt === 9">{{ $t('page.business.study.studyFormFill.dfz') }}</span>
<span v-if="scope.row.bdzt === 11">{{ $t('page.business.study.studyFormFill.yfz') }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('page.business.study.studyFormFill.sfbl')" align="center" prop="status"
width="100">
<template slot-scope="scope">
<span v-if="scope.row.sfbl === 10">{{ $t('page.business.study.studyFormFill.yes') }}</span>
<span v-if="scope.row.sfbl === 1">{{ $t('page.business.study.studyFormFill.no') }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('page.business.form.tjsj')" align="center" prop="tjsj" width="140" />
<el-table-column :label="$t('form.operate')" align="left" fixed="right" width="200">
<template slot-scope="scope">
<!-- 表单状态1填报中3已提交5已完成经复核7已完成9待废止11已废止 -->
<!-- 详情 -->
<el-button type="text" @click="detail(scope.row)" v-hasPermi="['business:studyFormFill:xq']">{{
$t('form.detail') }}</el-button>
<!-- 编辑 -->
<el-button type="text" v-if="scope.row.bdzt === 1 || scope.row.bdzt === 5 || scope.row.bdzt === 7"
@click="edit(scope.row)" v-hasPermi="['business:studyFormFill:bj']">{{
$t('form.edit') }}</el-button>
<!-- 复核 -->
<el-button type="text" v-if="scope.row.bdzt === 3" @click="fh(scope.row)"
v-hasPermi="['business:studyFormFill:fh']">{{
$t('page.business.study.studyFormFill.fh') }}</el-button>
<!-- 加签 -->
<el-button type="text" v-if="scope.row.bdzt === 1" @click="jq(scope.row)"
v-hasPermi="['business:studyFormFill:jq']">{{
$t('page.business.study.studyFormFill.jq') }}</el-button>
<!-- 更换归属人 -->
<el-button type="text"
v-if="scope.row.bdzt === 1 || scope.row.bdzt === 3 || scope.row.bdzt === 5 || scope.row.bdzt === 7"
@click="ghgsr(scope.row)" v-hasPermi="['business:studyFormFill:ghgsr']">{{
$t('page.business.study.studyFormFill.ghgsr') }}</el-button>
<!-- 审阅 -->
<el-button type="text" v-if="scope.row.bdzt === 5 || scope.row.bdzt === 7" @click="sy(scope.row)"
v-hasPermi="['business:studyFormFill:sy']">{{
$t('page.business.study.studyFormFill.sy') }}</el-button>
<!-- 废止 -->
<el-button type="text" v-if="scope.row.bdzt === 1" @click="fz(scope.row)"
v-hasPermi="['business:studyFormFill:fz']">{{
$t('page.business.study.studyFormFill.fz') }}</el-button>
<!-- 确认废止 -->
<el-button type="text" v-if="scope.row.bdzt === 9" @click="qrfz(scope.row)"
v-hasPermi="['business:studyFormFill:qrfz']">{{
$t('page.business.study.studyFormFill.qrfz') }}</el-button>
<!-- 观察 -->
<el-button type="text" v-if="scope.row.bdzt === 1" @click="gc(scope.row)"
v-hasPermi="['business:studyFormFill:gc']">{{
$t('page.business.study.studyFormFill.gc') }}</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" />
</div>
</div>
<!-- 编辑 -->
<Bj v-show="showEdit" key="Bj" ref="Bj" @close="bjClose" />
<!-- 详情 -->
<Xq v-show="showDetail" key="Xq" ref="Xq" @close="xqClose" />
<!-- 审阅 -->
<Sy v-show="showAudit" key="Sy" ref="Sy" @close="syClose" />
<!-- 复核 -->
<Fh v-show="showFh" key="Fh" ref="Fh" @close="fhClose" />
<!-- 废止 -->
<Fz key="Fz" ref="Fz" @callback="search" />
<!-- 确认废止 -->
<Qrfz key="Qrfz" ref="Qrfz" @callback="search" />
<!-- 加签 -->
<Jq key="Jq" ref="Jq" @callback="search" />
<!-- 观察 -->
<Gc key="Gc" ref="Gc" @callback="search" />
<!-- 更换归属人 -->
<Ghgsr key="Ghgsr" ref="Ghgsr" @callback="search" />
<SelectDeptUserDialog ref="selectDeptUserDialog" @change="ghgsrChange" />
</div>
</template>
<script>
import { studyFormFill_list } from '@/api/business/study/studyFormFill'
import Bj from "./tbbd/Bj";
import Xq from "./tbbd/Xq";
import Sy from "./tbbd/Sy";
import Fz from "./tbbd/Fz";
import Fh from "./tbbd/Fh";
import Qrfz from "./tbbd/Qrfz";
import Jq from "./tbbd/Jq";
import Ghgsr from "./tbbd/Ghgsr";
import Gc from "./tbbd/Gc";
import SelectDeptUser from '@/views/business/comps/select/SelectDeptUser';
import SelectDeptUserDialog from '@/views/business/comps/select/SelectDeptUserDialog';
import { mapGetters } from 'vuex'
import moment from "moment";
export default {
name: 'SyjList',
props: {
study: {
type: Object,
default: () => {
return {}
}
}
},
computed: {
...mapGetters([
'id'
]),
},
watch: {
study: {
handler(newVal) {
this.searchForm.studySn = newVal.sn
this.searchForm.studyMc = newVal.name
this.searchForm.studyId = newVal.studyId
this.searchForm.studySubjectId = newVal.studySubjectId
this.leader = newVal.leader
this.search()
},
immediate: true,
deep: true
}
},
components: { Ghgsr, Fh, Fz, Bj, Xq, Qrfz, Sy, Jq, Gc, SelectDeptUser, SelectDeptUserDialog },
data() {
return {
leader: null,
showFh: false,
showAudit: false,
showEdit: false,
showDetail: false,
daterangetj: [],
daterange: [],
searchForm: {
pageNum: 1,
pageSize: 10,
studyId: '',
studySn: '',
studyMc: '',
studySubjectId: '',
bdbh: '',
bdmc: '',
userId: '',
userMc: '',
templateMc: '',
cjsjjs: '',
cjsjks: '',
tjsjjs: '',
tjsjks: '',
},
loading: false,
total: 0,
list: [],
currentRow: null
}
},
created() { },
methods: {
ghgsr(row) {
this.currentRow = row
this.$refs.selectDeptUserDialog.show(null, null)
},
ghgsrChange(val) {
this.$refs.Ghgsr.show({ id: this.currentRow.id, userId: val.id, userMc: val.name })
},
jq(row) {
this.$refs.Jq.show(row)
},
qrfz(row) {
this.$refs.Qrfz.show(row)
},
gc(row) {
this.$refs.Gc.show(row)
},
fz(row) {
this.$refs.Fz.show(row)
},
userChange(val) {
this.searchForm.userId = val.id
this.searchForm.userMc = val.name
this.search()
},
search() {
this.searchForm.pageNum = 1
this.getList()
},
reset() {
this.resetForm("searchForm")
this.handleQuery()
},
getList() {
if (this.daterange != null && this.daterange.length > 0) {
this.searchForm.cjsjks = this.daterange[0]
this.searchForm.cjsjjs = moment().add(this.daterange[1], 'days').format('YYYY-MM-DD');
} else {
this.searchForm.cjsjks = ''
this.searchForm.cjsjjs = ''
}
if (this.daterangetj != null && this.daterangetj.length > 0) {
this.searchForm.tjsjks = this.daterangetj[0]
this.searchForm.tjsjjs = moment().add(this.daterangetj[1], 'days').format('YYYY-MM-DD');
} else {
this.searchForm.tjsjks = ''
this.searchForm.tjsjjs = ''
}
this.loading = true
studyFormFill_list(this.searchForm).then(response => {
this.list = response.rows
this.total = response.total
this.loading = false
})
},
add() {
this.showEdit = true
this.$emit('showDetail', this.showEdit)
this.$refs.Bj.edit({ studySn:this.searchForm.studySn, studyMc:this.searchForm.studyMc,studyId: this.searchForm.studyId, studySubjectId: this.searchForm.studySubjectId })
},
edit(row) {
this.showEdit = true
this.$emit('showDetail', this.showEdit)
this.$refs.Bj.edit(row)
},
bjClose() {
this.showEdit = false
this.$emit('showDetail', this.showEdit)
this.search()
},
xqClose() {
this.showDetail = false
this.$emit('showDetail', this.showDetail)
this.search()
},
syClose() {
this.showAudit = false
this.$emit('showDetail', this.showAudit)
this.search()
},
fhClose() {
this.showFh = false
this.$emit('showDetail', this.showFh)
this.search()
},
detail(row) {
this.showDetail = true
this.$emit('showDetail', this.showDetail)
this.$refs.Xq.show(row)
},
sy(row) {
this.showAudit = true
this.$emit('showDetail', this.showAudit)
this.$refs.Sy.show(row)
},
fh(row) {
this.showFh = true
this.$emit('showDetail', this.showFh)
this.$refs.Fh.show(row)
},
}
}
</script>
<style lang="scss" scoped>
.tbbd-list {
.tbbd-search {
background: #fff;
padding: 20px;
margin-bottom: 10px;
.right-btn {
text-align: right
}
}
.tbbd-content {
padding: 20px;
background: #fff;
.add-box {
margin-bottom: 10px;
}
}
}
</style>

Loading…
Cancel
Save