Browse Source

feat: [模板管理] 获取部长列表

lkf
memorylkf 3 months ago
parent
commit
00979f401a
3 changed files with 38 additions and 24 deletions
  1. +8
    -0
      src/api/business/public/public.js
  2. +3
    -2
      src/components/Template/SelectTable.vue
  3. +27
    -22
      src/views/business/comps/template/dialog/SelectReagentDialog.vue

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

@ -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
})
}

+ 3
- 2
src/components/Template/SelectTable.vue View File

@ -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()
},
//

+ 27
- 22
src/views/business/comps/template/dialog/SelectReagentDialog.vue View File

@ -2,20 +2,13 @@
<el-dialog :title="$t(title)" @close="onCancel" :visible.sync="visible" append-to-body width="80%">
<!-- 麻醉/精神药品配制/领取申请单 -->
<div v-if="type === 'MJYLQSQD'" class="header-row">
<el-radio-group v-model="radio">
<el-radio-group v-model="radio" @input="changeRadio">
<el-radio :label="1">试验</el-radio>
<el-radio :label="2">
部门
</el-radio>
</el-radio-group>
<el-select v-model="depart" filterable :placeholder="$t('form.placeholderSelect')">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<select-dept v-if="radio==2" v-model="depart" style="width:200px;margin-left:10px" />
</div>
<SelectTable v-if = "isShowTable" ref="selectSjRef" :columns="columns"
@ -33,11 +26,13 @@
<script>
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()
}
}
}
}
</script>

Loading…
Cancel
Save