Browse Source

医院科室添加

pull/1/head
kuaileWu 2 weeks ago
parent
commit
fba69a5e51
  1. 2
      src/components/GuipSelect.vue
  2. 2
      src/components/GuipSwitch.vue
  3. 186
      src/views/HosInformation.vue

2
src/components/GuipSelect.vue

@ -3,7 +3,7 @@
:class="[{ 'column': column }, { 'w510': addClass == 'w510' }, { 'w388': addClass == 'w388' }, 'form-item']"
:label="label" :prop="prop" :rules="rules">
<p v-if="desc" class="desc_right">{{ desc }}</p>
<el-select :style="{ width: width }" :placeholder="placeholder1" @change="handleChange" v-model="selectedValue"
<el-select :style="{ width: width }" :placeholder="placeholder1" @change="handleChange" v-model="selectedValue" :disabled="disabled"
v-bind="$attrs">
<el-option v-for="item in processedOptions" :key="getItemValue(item)" :label="getItemLabel(item)"
:disabled="item.disabled" :value="getItemValue(item)">

2
src/components/GuipSwitch.vue

@ -18,7 +18,7 @@
</template>
<!-- 他这个描述文案不太符合当前使用暂且不用 -->
<!-- :active-text="activeText"
<!-- :active-text="activeText"
:inactive-text="inactiveText" -->
<!-- 设置active-value和inactive-value属性接受Boolean, String或Number类型的值 -->
<script>

186
src/views/HosInformation.vue

@ -9,26 +9,24 @@
<GuipFormItem column="column" class="mb24" label="出诊医院省市" :required="true">
<div class="flex-between" slot="formDom">
<div class="short-width">
<GuipSelect width="100%" v-model="form.province" :options="options_province"
<GuipSelect width="100%" v-model="form.province" :options="options_province" :disabled="(depart_id && doctor_id)?true:false"
placeholder="选择省份" @change="provinceChange">
</GuipSelect>
</div>
<div class="short-width">
<GuipSelect width="100%" v-model="form.city" :options="options_city"
<GuipSelect width="100%" v-model="form.city" :options="options_city" :disabled="(depart_id && doctor_id)?true:false"
placeholder="选择城市">
</GuipSelect>
</div>
</div>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="出诊医院名称" :required="true" style="margin-bottom: 0px;">
<!-- <GuipInput slot="formDom" ref="GuipInput" column="column" v-model="form.company_name"
prop="company_name" placeholder="请输入">
<img src="@/assets/input_search_ic.svg" slot="suffix" @click="handleClear" />
</GuipInput> -->
<!-- <GuipSelectFilter :options="hosipitalList"></GuipSelectFilter> -->
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="form.h_realname" :disabled="true" v-if="depart_id && doctor_id"
prop="h_realname">
</GuipInput>
</GuipFormItem>
<div class="mb24" style="margin-top:-24px;">
<div class="mb24" style="margin-top:-24px;" v-if="!depart_id && !doctor_id">
<el-autocomplete
v-model="hospitalSearchState"
:fetch-suggestions="queryHospital"
@ -46,32 +44,30 @@
<GuipFormItem column="column" class="mb24" label="医院简称">
<span slot="formRight" class="desc">方便患者记忆非必填</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="form.h_name"
prop="h_name" placeholder="请输入" />
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="form.h_shortname" prop="h_shortname" placeholder="请输入" />
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="所在科室" :required="true">
<GuipFormItem column="column" class="mb24" label="所在科室">
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="form.depart_name"
prop="depart_name" placeholder="请输入" />
</GuipFormItem>
</div>
<div class="flex-line"></div>
<div class="flex-right">
<GuipFormItem column="column" class="mb24">
<GuipFormItem column="column" class="mb24" v-if="departIsFixed != -1">
<div slot="formLeft" class="form-top-icon">医保定点</div>
<div class="flex" slot="formDom" style="padding: 9px 0px;">
<GuipSwitch :modelValue="form.is_fixed" @change="onSwitchChange" activeText="非医保定点"
inactiveText="非医保定点" active-value="1" inactive-value="0">
<GuipSwitch :model-value="departIsFixed" @change="onSwitchChange" activeText="非医保定点" inactiveText="非医保定点" :active-value="true" :inactive-value="false">
</GuipSwitch>
</div>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="使用功能">
<!-- <el-checkbox-group slot="formDom" v-model="form.type" @change="validateSelection" class="checkboxGroup">
<el-checkbox-group slot="formDom" v-model="departType" @change="validateSelection" class="checkboxGroup">
<div class="flex">
<el-checkbox :label="2" >医生名片基础功能不可取消</el-checkbox>
<el-checkbox :label="0">患者预约</el-checkbox>
<el-checkbox :label="1">仅项目计数</el-checkbox>
</div>
<el-checkbox :label="1">项目计数</el-checkbox>
</el-checkbox-group> -->
<el-checkbox :label="2" >仅医生名片</el-checkbox>
</el-checkbox-group>
</GuipFormItem>
<GuipFormItem column="column" class="" label="就诊提醒">
<div slot="formRight" class="desc">就诊前的注意事项非必填</div>
@ -109,7 +105,7 @@
<GuipFormItem column="column" label="每周出诊安排" :required="true">
<div class="flex weekPlan" slot="formDom">
<GuipSelect v-for="day in weekDays" :key="day.id" v-model="form.worktimes[day.id].plan"
:options="options_weekPlan" @change="weekChange()" :label="day.name" placeholder="休息">
:options="options_weekPlan" :label="day.name" placeholder="休息">
</GuipSelect>
</div>
</GuipFormItem>
@ -139,7 +135,7 @@
<GuipFormItem column="column" class="mb24" label="开放预约" :required="true">
<span class="desc" slot="formRight">患者可提前多久约号</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="form.visit_day"
prop="visit_day" placeholder="请输入" unit="小时">
prop="visit_day" placeholder="请输入" unit="">
<span slot="prependshow">提前</span>
</GuipInput>
</GuipFormItem>
@ -194,8 +190,7 @@
</GuipInput>
</div>
</div>
<GuipTable :tableData="projectList" :key="tableKey" style="width: 100%" ref="multipleTable"
@selection-change="handleSelectionChange" :loading="loading" max-height="600px">
<GuipTable :tableData="projectList" :key="tableKey" style="width: 100%" ref="multipleTable" @selection-change="handleSelectionChange" :loading="loading">
<el-table-column type="selection" label="选择" width="80"></el-table-column>
<el-table-column prop="name" label="项目名称" min-width="185"></el-table-column>
<el-table-column prop="price" label="项目价格" min-width="155">
@ -225,10 +220,10 @@
</template>
</el-table-column> -->
</GuipTable>
<el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange'
<!-- <el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange'
:current-page="currentPage" :page-size=pageSize layout="prev, pager, next,jumper"
:total="projectList.length">
</el-pagination>
</el-pagination> -->
</el-form>
</div>
<div class="siteMessage flex-common mt12" id="siteMessage5">
@ -254,8 +249,7 @@
</div>
</div>
<GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1" max-height="600px"
@selection-change="handleSelectionChange1" :loading="loading1" :key="tableKey1" >
<GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1" @selection-change="handleSelectionChange1" :loading="loading1" :key="tableKey1" >
<el-table-column type="selection" label="选择" width="80"></el-table-column>
<el-table-column prop="name" label="套餐名称" min-width="225"></el-table-column>
<el-table-column prop="price" label="套餐价格" min-width="125"></el-table-column>
@ -279,10 +273,10 @@
</template>
</el-table-column>
</GuipTable>
<el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange'
<!-- <el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange'
:current-page="currentPage" :page-size=pageSize layout="prev, pager, next,jumper"
:total="courseList.length">
</el-pagination>
</el-pagination> -->
</el-form>
</div>
<GuipDialog :dialogVisible="dialogVisible" :title="dialogTitle" :show-close-button="true" width="762"
@ -340,6 +334,8 @@ export default {
data() {
return {
doctorId: '',
depart_id:false,
doctor_id:false,
dialogType: '1',
tableKey:Date.now(),
tableKey1:Date.now(),
@ -352,9 +348,9 @@ export default {
nameRules: [{ required: true, message: '分组名称不得为空', trigger: 'blur' }],
dialogTitle: '批量录入项目',
currentPage: 1,
pageSize: 10,
pageSize: 1000,
currentPage1: 1,
pageSize1: 10,
pageSize1: 1000,
loading: false,
loading1: false,
selectedRows: [],//
@ -368,6 +364,7 @@ export default {
hospitalSearchState: '',
hospitalSearchFlag: false,
hospitalSearchTimeout: false,
departIsFixed:-1,
projectList: [
{
@ -405,6 +402,7 @@ export default {
courseList: [],
selectAll: false,
selectAll1: false,
departType:[],
numSettingForm: {
times: '',
hours: '',
@ -482,12 +480,13 @@ export default {
depart_name: '',
address:"",
afternoon_worktime:"",
depart_id:"1",
depart_id:"0",
h_name:"",
h_pos:"",
hid:"0",
is_fixed:'0',
morning_worktime:"",
h_shortname:'',
notice:"",
time_unit:"0",
time_unit_num:"0",
@ -495,12 +494,6 @@ export default {
visit_day:"0"
},
siteFormrules: {
depart_name: [
{ required: true, message: '请输入科室信息', trigger: 'blur' }
],
h_name: [
{ required: true, message: '请输入出诊医院信息', trigger: 'blur' }
],
},
siteForm1: {
domain_set: '',
@ -627,11 +620,11 @@ export default {
doctor_id: this.doctor_id
}).then(response => {
this.form = { ...this.form, ...response.data,
type:response.type ? [Number(response.type)] : [2],
'morning_worktime':response.data.morning_worktime.split('-'),
'afternoon_worktime':response.data.afternoon_worktime.split('-')
}
this.departType = (response.data.type || response.data.type === 0 || response.data.type === "0") ? [Number(response.data.type)] : []
this.departIsFixed = response.data.is_fixed == "1" ? true : false
this.getAreaData(this.form.province)
}).catch(error => {
console.error(error, 'error')
@ -657,15 +650,23 @@ export default {
},
//
fetchProjectData() {
this.$http('POST', '/api/admin/get_project_list', {
var param = {
depart_id: this.depart_id,
doctor_id: this.doctor_id
}).then(response => {
doctor_id: this.doctor_id,
name:this.projectSearchName,
classify_id:this.projectSearchId
}
this.$http('POST', '/api/admin/get_project_list', param).then(response => {
if(response.code == 0){
this.loading = false
this.$nextTick(()=>{
this.projectTagData = response.data.classify;//
this.projectList = Object.values(response.data.list);//
if(response.data.list) {
this.projectList = Object.values(response.data.list);//
}else{
this.projectList = []
}
this.tableKey = Date.now(); //
// this.$set('projectList',Object.values(response.data.list))
// this.$set('projectTagData',response.data.classify)
@ -686,13 +687,8 @@ export default {
})
},
validateSelection(val) {
//
if (!val.includes(2)) {
this.$nextTick(() => {
this.form.type = [...val, 2];
this.$message.warning('基础功能不可取消');
});
}
this.departType = []
if(val.length > 0) this.departType[0] = val[val.length-1]
},
selectTag(item) {
if(item == 'all'){
@ -701,33 +697,18 @@ export default {
this.projectSearchId = item.id;
}
//
// this.getFilterProject()
this.fetchProjectData()
},
getFilterProject(){
//
this.$http('POST', '/supernew/ajax_get_type_batch_list', {
//
projectid:this.projectSearchId == 'all' ? '' : this.projectSearchId,
//
projectSearchName:this.projectSearchName
}).then(response => {
this.projectTagData = response.data;
}).catch(error => {
console.error(error, 'error')
})
this.fetchProjectData()
},
//
changePrice(row) {
if (row.sort) {
this.editorProjectInfo({ price: row.price, project_id: row.id })
}
this.editorProjectInfo({ price: row.price, project_id: row.id })
},
//
changeClassify(row) {
if (row.sort) {
this.editorProjectInfo({ classify_id: row.classify_id, project_id: row.id })
}
this.editorProjectInfo({ classify_id: row.classify_id, project_id: row.id })
},
editorProjectInfo(props) {
this.$http('POST', '/api/admin/edit_project', {
@ -824,12 +805,18 @@ export default {
console.log(data, 'data098908090');
},
onSwitchChange1(row) {
row.status = !row.status;
row.status = row.status == 0 ? 1 : 0;
this.$set(this.projectList, row)
this.editorProjectInfo({ status: row.status, project_id: row.id })
},
onSwitchChange2(row) {
row.status = !row.status;
console.log(row.status)
var tmpstatus = row.status == 1 ? 0 : 1
this.$set(this.courseList, row)
this.selectedRows1 = [row]
this.batchOperate(tmpstatus, 'group')
},
handleClick1(row) {
console.log(row);
@ -1005,21 +992,26 @@ export default {
this.selectedItem = { ...item };
console.log(this.selectedItem, 'this.selectedItem====');
},
//
domain_radioChange(type) {
console.log(type, '--');
},
onSwitchChange(data) {
this.form.is_fixed = data ? 1 : 0
this.departIsFixed = data
console.log(data, '---');
},
updateHosInfo(props){
console.log(props)
this.$http('POST', '/api/admin/set_hospital_depart', {
updateHosInfo(props, url){
if(this.doctor_id && this.depart_id) {
props.doctor_id = this.doctor_id;
props.depart_id = this.depart_id;
props.hid = this.form.hid;
}
this.$http('POST', url, {
...props
}).then(response => {
if(response.code == 0){
this.$Message.success('更新成功')
return;
}
this.$Message.error(response.msg)
}).catch(error => {
console.error(error, 'error')
})
@ -1027,33 +1019,51 @@ export default {
submitForm(form) {
this.$refs[form].validate((valid) => {
console.log(this[form], '======formxinxi8', '=============='+form);
var rqurl = '';
if (valid) {
alert('提交成功!');
let props = {}
switch(form){
case 'siteForm1':
var worktimesArray = Object.entries(this.form.worktimes).map(([key, value]) => ({
type: parseInt(key),
plan: value.plan
}));
props={
morning_worktime:form.morning_worktime.join('-'),
afternoon_worktime:form.afternoon_worktime.join('-')
morning_worktime:this.form.morning_worktime.join('-'),
afternoon_worktime:this.form.afternoon_worktime.join('-'),
week_visit_plan:JSON.stringify(worktimesArray),
}
rqurl = "/api/admin/set_depart_worktime";
break;
case 'siteForm':
if(this.departType.length <= 0) {
this.$Message.info('请选择站点类型')
return;
}
props={
is_fixed:this.form.is_fixed,
type:form.type,
notice:form.notice
type:this.departType[0],
notice:this.form.notice,
h_shortname:this.form.h_shortname,
}
rqurl = "/api/admin/set_hospital_depart";
break;
case 'numSettingForm':
props={
time_unit:form.time_unit,
time_unit_num:form.time_unit_num,
visit_day:form.visit_day,
treat_expire:form.treat_expire,
time_unit:this.form.time_unit,
time_unit_num:this.form.time_unit_num,
visit_day:this.form.visit_day,
treat_expire:this.form.treat_expire,
}
rqurl = "/api/admin/set_visit_num";
break;
}
this.updateHosInfo(props)
this.updateHosInfo(props, rqurl)
} else {
return false;
}

Loading…
Cancel
Save