diff --git a/src/api/business/public/public.js b/src/api/business/public/public.js index a300ec0..629fbae 100644 --- a/src/api/business/public/public.js +++ b/src/api/business/public/public.js @@ -67,3 +67,11 @@ export function public_studyList(query) { params: query }) } +// 部长列表 +export function public_bzList(query) { + return request({ + url: '/system/business/public/bzList', + method: 'get', + params: query + }) +} diff --git a/src/components/Template/SelectTable.vue b/src/components/Template/SelectTable.vue index 8738b33..3eb7097 100644 --- a/src/components/Template/SelectTable.vue +++ b/src/components/Template/SelectTable.vue @@ -97,8 +97,8 @@ export default { methods: { show(){ this.localSelectedId = '' - this.getList(); this.initSearchForm(); + this.getList(); }, //初始化查询表单 initSearchForm() { @@ -122,7 +122,8 @@ export default { this.getList(); }, reset(){ - this.$refs.SearchSjRef.resetFields() + this.initSearchForm(); + this.getList(); this.onSearch() }, //分页大小切换 diff --git a/src/views/business/comps/template/dialog/SelectReagentDialog.vue b/src/views/business/comps/template/dialog/SelectReagentDialog.vue index d89b7a2..f4e77ac 100644 --- a/src/views/business/comps/template/dialog/SelectReagentDialog.vue +++ b/src/views/business/comps/template/dialog/SelectReagentDialog.vue @@ -2,20 +2,13 @@
- + 试验 部门 - - - - +
import SelectTable from '@/components/Template/SelectTable.vue'; -import { public_sjList } from '@/api/business/public/public'; +import SelectDept from "@/views/business/comps/select/SelectDept"; +import { public_sjList,public_bzList } from '@/api/business/public/public'; export default { components: { SelectTable, + SelectDept }, props: { type: { @@ -108,17 +103,9 @@ export default { selectedId: "", currentRow: {}, radio:1, + + bzList:[], depart:"", - options:[ - { - value:1, - label:"部门1", - }, - { - value:2, - label:"部门", - }, - ] } }, computed: { @@ -143,6 +130,14 @@ export default { show(){ this.visible = true this.showTableData() + if(this.type === 'MJYLQSQD'){ + this.getBzList() + } + }, + getBzList(){ + public_bzList(this.searchForm).then(response => { + this.bzList = response.data + }); }, showTableData(){ if(this.$refs.selectSjRef){ @@ -163,8 +158,13 @@ export default { if(this.radio === 1) { row = row; }else{ - const o = this.options.find(item => item.value === this.depart); - row = {syNo:o.label,SD:o.value}; + const o = this.bzList.find(item => item.deptId == this.depart); + if(o){ + row = o; + }else{ + this.$message.error(`该部门没有设置部长!`) + return + } } } this.$emit('submit', this.selectedId,row); @@ -173,6 +173,11 @@ export default { this.selectedId = code; this.currentRow = row; }, + changeRadio(val){ + if(val==1){ + this.showTableData() + } + } } }