Browse Source

Merge branch 'zq-0627' of gitea.intra.yunpaper.com:zhangqi/acupuncture_admin into admin_version1.0_2025_06_26

admin_version1.0_2025_06_26
kuaileWu 2 weeks ago
parent
commit
3e5b355dce
  1. 52
      src/components/BatchProject.vue
  2. 1
      src/components/GuipTable.vue
  3. 470
      src/views/AddNewTreatment.vue
  4. 54
      src/views/HosInformation.vue

52
src/components/BatchProject.vue

@ -4,19 +4,19 @@
录入格式1.请按照 项目名称 空格 单次价格 格式输入2.每行一条数据 回车 确认</p> 录入格式1.请按照 项目名称 空格 单次价格 格式输入2.每行一条数据 回车 确认</p>
<div class="content-wrap"> <div class="content-wrap">
<el-form :model="form" :rules="formRules"> <el-form :model="form" :rules="formRules">
<GuipRadio v-model="groupType" class="radio-form" :options="groupOptions" label="分组形式" prop="language" @change="radioChange" /> <GuipRadio v-model="form.groupType" class="radio-form" :options="groupOptions" label="分组形式" prop="language" />
<GuipFormItem class="mb24 mt24" v-if="groupType==1" label="已有分组"> <GuipFormItem class="mb24 mt24" v-if="form.groupType==1" label="已有分组">
<div class="tabProject flex" slot="formDom" > <div class="tabProject tabProject1 flex" slot="formDom" >
<div :class="['tab-item ', projectSearchId == item.id ? 'active' : '']" @click="selectTag(item)" <div :class="['tab-item point', form.classify_id == item.id ? 'active' : '']" @click="selectTag(item)"
v-for="(item) in projectTagData" :key="item.name">{{ item.name }}</div> v-for="(item) in projectTagData" :key="item.name">{{ item.name }}</div>
</div> </div>
</GuipFormItem> </GuipFormItem>
<GuipFormItem v-if="groupType == 2" class="mb24 mt24" label="分组名称"> <GuipFormItem v-if="form.groupType == 2" class="mb24 mt24" label="分组名称">
<GuipInput slot="formDom" ref="GuipInput" v-model="form.name" <GuipInput slot="formDom" ref="GuipInput" v-model="form.classify_name"
prop="name" placeholder="请填写新增分组名称" @change="changeName"/> prop="classify_name" placeholder="请填写新增分组名称"/>
</GuipFormItem> </GuipFormItem>
<GuipFormItem class=" form-special" label="录入项目"> <GuipFormItem class=" form-special" label="录入项目">
<GuipTextarea slot="formDom" v-model="form.notice" prop="description" width="100%" height="262px" <GuipTextarea slot="formDom" v-model="form.project_contents" prop="description" width="100%" height="262px"
autosize :placeholder="'例如:\n推拿 168\n针灸 100'" @change="getNotice"/> autosize :placeholder="'例如:\n推拿 168\n针灸 100'" @change="getNotice"/>
</GuipFormItem> </GuipFormItem>
</el-form> </el-form>
@ -41,38 +41,39 @@ export default {
data() { data() {
return { return {
formRules: { formRules: {
name: [ classify_name: [
{ required: true, message: '请输入', trigger: 'blur' } { required: true, message: '请输入', trigger: 'blur' }
], ],
}, },
form:{ form:{
name:'', classify_name:'',
},
groupType: '1', groupType: '1',
notice:'', project_contents:'',
projectSearchId:'', classify_id:''
},
groupOptions: [ groupOptions: [
{ label: '归入已有分组', value: '1' }, { label: '归入已有分组', value: '1' },
{ label: '新增分组', value: '2' }, // { label: '新增分组', value: '2' }, //
{ label: '不分组', value: '3' }, // { label: '', value: '3' },
], ],
} }
}, },
methods: { methods: {
getNotice(e){ getNotice(e){
// \n // \n
let flag = e.includes('\n') let str = e.replace('\n','')
console.log(JSON.stringify(e),flag,'===---'); this.form.project_contents = str;
},
changeName(e){
console.log(e,'===---');
},
radioChange(data) {
console.log(data, 'radio--data');
}, },
selectTag(item){ selectTag(item){
this.projectSearchId = item.id this.form.classify_id = item.id
},
formReset(){
this.form = {
classify_name:'',
groupType: '1',
project_contents:'',
classify_id:''
}
} }
}, },
} }
@ -128,6 +129,9 @@ export default {
background: #F2F3F5; background: #F2F3F5;
} }
} }
.tabProject1{
width: 100%;
}
.form-special{ .form-special{
align-items: flex-start; align-items: flex-start;
} }

1
src/components/GuipTable.vue

@ -78,7 +78,6 @@ export default {
methods: { methods: {
handleSelectionChange(row) { handleSelectionChange(row) {
// //
console.log(row, '======');
this.$emit('selectChange', row) this.$emit('selectChange', row)
}, },
// //

470
src/views/AddNewTreatment.vue

@ -30,15 +30,18 @@
<el-checkbox @change="handleSelectAllChange1" v-model="selectAll" <el-checkbox @change="handleSelectAllChange1" v-model="selectAll"
:indeterminate="isIndeterminate">全选</el-checkbox> :indeterminate="isIndeterminate">全选</el-checkbox>
</div> </div>
<span class="totalCount">{{ projectList.length }}已选{{ selectedCount }}</span> <span class="totalCount">{{ displayedProjectCount }}已选{{ selectedCount }}</span>
</div> </div>
<div class="flex-between mb32 mt32"> <div class="flex-between mb32 mt32">
<div class="tabProject flex"> <div class="tabProject flex">
<div :class="['tab-item ', projectSearchId == item.id ? 'active' : '']" <div :class="['tab-item point', projectSearchId == 'all' ? 'active' : '']"
v-for="item in Object.values(projectTagData)" :key="item.name">{{ item.name }}</div> @click="selectTag('all')">全部分类</div>
<div :class="['tab-item point', projectSearchId == item.id ? 'active' : '']"
@click="selectTag(item.id)" v-for="item in Object.values(projectTagData)"
:key="item.name">{{ item.name }}</div>
</div> </div>
<div class="right flex"> <div class="right flex" v-show="false">
<GuipFormItem label="搜索项目"> <GuipFormItem label="搜索项目">
<GuipInput slot="formDom" ref="GuipInput" width="280px" v-model="projectSearchName" <GuipInput slot="formDom" ref="GuipInput" width="280px" v-model="projectSearchName"
placeholder="请输入" @blur="inputBlur"> placeholder="请输入" @blur="inputBlur">
@ -48,34 +51,29 @@
</div> </div>
</div> </div>
<GuipTable :tableData="sortedProjectList" style="width: 100%" ref="multipleTable" max-height="600px" <GuipTable :tableData="sortedProjectList" style="width: 100%" ref="multipleTable" max-height="600px"
@selection-change="handleSelectionChange" :loading="loading"> @selection-change="handleSelectionChange" :loading="loading" @select="handleSelect">
<el-table-column type="selection" label="选择" width="150"></el-table-column> <!-- <el-table-column type="selection" label="选择" width="150"></el-table-column> -->
<el-table-column type="selection" width="150">
<template slot="header">
<span class="selection-header-text">选择</span>
</template>
</el-table-column>
<el-table-column prop="name" label="项目名称" min-width="150"></el-table-column> <el-table-column prop="name" label="项目名称" min-width="150"></el-table-column>
<el-table-column label="次数" min-width="150px" prop="num"> <el-table-column label="次数" min-width="150px" prop="num">
<template slot-scope="scope"> <template slot-scope="scope">
<GuipInput width="90%" v-if="package_id && scope.row.num" v-model="scope.row.num" <GuipInput width="90%" v-if="package_id && scope.row.num" v-model="scope.row.num"
min="1" @change="changeNums(scope.row)" />
<GuipInput width="90%" v-else v-model="scope.row.unit_num" min="1"
@change="changeNums(scope.row)" /> @change="changeNums(scope.row)" />
<GuipInput width="90%" v-else v-model="scope.row.unit_num"
@change="changeNums(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="price" label="项目价格" min-width="150">
<template slot-scope="scope">
<GuipInput width="90%" v-model="scope.row.price" @change="changePrice(scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="price" label="项目价格" min-width="150"></el-table-column>
<el-table-column prop="classify_id" label="分类" min-width="150"> <el-table-column prop="classify_id" label="分类" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<GuipSelect width="90%" v-model="scope.row.classify_id" {{ projectTagData[scope.row.classify_id].name }}
@change="changeClassify(scope.row)" prop="classify_id" :options="projectTagData"
valueKey="id" labelKey="name" />
</template> </template>
</el-table-column> </el-table-column>
</GuipTable> </GuipTable>
<!-- <el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange'
:current-page="currentPage" :page-size=pageSize layout="prev, pager, next,jumper"
:total="treatMentList.length">
</el-pagination> -->
</el-form> </el-form>
</div> </div>
</div> </div>
@ -98,8 +96,9 @@
</div> </div>
<div class="flex content"> <div class="flex content">
<span>套餐项目</span> <span>套餐项目</span>
<div class="column"> <div class="column gap10 project_list">
<span v-for="item in selectedRows" :key="item.id">{{ item.name }} {{ item.nums }}</span> <span v-for="item in sortedProjectRows" :key="item.id">{{ item.name }} {{ item.num || item.unit_num
}}</span>
</div> </div>
</div> </div>
</GuipDialog> </GuipDialog>
@ -113,7 +112,7 @@ import GuipTable from '@/components/GuipTable.vue';
import GuipDialog from '@/components/GuipDialog.vue'; import GuipDialog from '@/components/GuipDialog.vue';
import GuipInput from '@/components/GuipInput.vue'; import GuipInput from '@/components/GuipInput.vue';
import GuipButton from '@/components/GuipButton.vue'; import GuipButton from '@/components/GuipButton.vue';
import GuipSelect from '@/components/GuipSelect.vue'; // import GuipSelect from '@/components/GuipSelect.vue';
export default { export default {
// //
name: '', name: '',
@ -123,7 +122,7 @@ export default {
GuipInput, GuipInput,
GuipDialog, GuipDialog,
GuipButton, GuipButton,
GuipSelect, // GuipSelect,
GuipTable GuipTable
}, },
@ -136,10 +135,11 @@ export default {
pageSize: 10, pageSize: 10,
isIndeterminate: false, isIndeterminate: false,
projectSearchName: '', projectSearchName: '',
projectSearchId: '0', projectSearchId: 'all',
loading: false, loading: false,
treatMentList: [],// treatMentList: [],//
projectList: [],// projectList: [],//
projectTagData: [],
// { // {
// 27:{ // 27:{
// classify_name:"", // classify_name:"",
@ -155,14 +155,15 @@ export default {
// } // }
// }, // },
selectedRows: [], selectedRows: [],
sortedProjectRows: [],
siteForm: { siteForm: {
create_time: "2025-05-29 17:08:29", create_time: "",
depart_id: "1", depart_id: "",
doctor_id: "1", doctor_id: "",
id: "1", id: "",
name: "调理套餐", name: "",
price: "1500.00", price: "",
status: "1" status: ""
}, },
siteFormrules: { siteFormrules: {
name: [ name: [
@ -172,7 +173,6 @@ export default {
{ required: true, message: '请输入套餐价格', trigger: 'blur' } { required: true, message: '请输入套餐价格', trigger: 'blur' }
], ],
}, },
projectTagData: [],
package_id: '', package_id: '',
doctor_id: '', doctor_id: '',
depart_id: '', depart_id: '',
@ -182,17 +182,42 @@ export default {
computed: { computed: {
...mapState(['pageTitle']), ...mapState(['pageTitle']),
sortedProjectList() { sortedProjectList() {
return [...this.projectList].sort((a, b) => { // sort
// sort let sortedList = [...this.projectList].sort((a, b) => {
if (a.sort && !b.sort) return -1; if (a.sort && !b.sort) return -1;
if (!a.sort && b.sort) return 1; if (!a.sort && b.sort) return 1;
// sortsort
if (a.sort && b.sort) return a.sort - b.sort; if (a.sort && b.sort) return a.sort - b.sort;
// sort
return 0; return 0;
}); });
// projectSearchId
if (this.projectSearchId === 'all') {
return sortedList;
} else {
return sortedList.filter(item => item.classify_id == this.projectSearchId);
}
},
//
displayedProjectCount() {
return this.sortedProjectList.length;
},
},
watch: {
projectSearchId() {
this.$nextTick(() => {
this.setSelectedRows();
});
},
projectList: {
deep: true,
handler() {
this.$nextTick(() => {
this.setSelectedRows();
});
}
} }
}, },
mounted() { mounted() {
const { package_id, doctor_id, depart_id } = this.$route.query; // doctorId const { package_id, doctor_id, depart_id } = this.$route.query; // doctorId
this.package_id = package_id; this.package_id = package_id;
@ -207,8 +232,44 @@ export default {
this.fetchProjectData(); this.fetchProjectData();
}, },
methods: { methods: {
//
initSelectedItems() {
if (!this.package_id) {
this.selectedRows = [];
this.sortedProjectRows = []
return;
}
// treatMentList
this.treatMentList.forEach(treatment => {
const foundItem = this.projectList.find(item => item.id == treatment.project_id);
if (foundItem && !this.selectedRows.some(r => r.id === foundItem.id)) {
foundItem.num = treatment.num;
foundItem.sort = treatment.sort;
this.selectedRows.push(foundItem);
}
});
this.sortedProjectRows = [...this.selectedRows]
this.setSelectedRows();
},
// // //
setSelectedRows() {
this.$nextTick(() => {
if (!this.$refs.multipleTable?.$refs.guiptable) return;
//
this.$refs.multipleTable.$refs.guiptable.clearSelection();
this.selectedRows = [];//
//
this.sortedProjectList.forEach(row => {
if (this.sortedProjectRows.some(selected => selected.id === row.id)) {
this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(row, true);
}
});
});
},
getInitData() { getInitData() {
this.$http('POST', '/api/admin/get_project_package_info', { this.$http('POST', '/api/admin/get_project_package_info', {
depart_id: this.depart_id, depart_id: this.depart_id,
@ -226,145 +287,141 @@ export default {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
// mounted fetchProjectData
fetchProjectData() { fetchProjectData() {
this.$http('POST', '/api/admin/get_project_list', { this.$http('POST', '/api/admin/get_project_list', {
depart_id: this.depart_id, depart_id: this.depart_id,
doctor_id: this.doctor_id doctor_id: this.doctor_id
}).then(response => { }).then(response => {
if (response.code == 0) { if (response.code == 0 && response.data.list) {
this.projectTagData = response.data.classify;// this.projectTagData = response.data.classify;
this.projectList = Object.values(response.data.list).map(item => { this.projectList = Object.values(response.data.list).map(item => ({
return {
...item, ...item,
checked: false checked: false
} }));
});//
if (this.package_id) {//
this.treatMentList.forEach(item => {
this.projectList.forEach(item1 => {
if (item.project_id == item1.id) {
item1.checked = true;
item1.num = item.num;
item1.sort = item.sort;
//
this.$nextTick(() => {
this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(item1, true);
this.selectedRows.push(item1)
this.updateSelectionState();
});
//
} if (this.package_id && this.selectedRows.length === 0) {
}) this.initSelectedItems();
})
// this.$nextTick(() => {
// if (this.projectList.length >= 2) {
// const defaultSelected = this.projectList.filter(item => item.checked === true);
// defaultSelected.forEach(row => {
// this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(row, true);
// });
// this.selectedRows = defaultSelected;
// this.updateSelectionState();
// }
// });
} }
} }
}).catch(error => { });
console.error(error, 'error')
})
},
changeChecked() {
}, },
inputBlur(val) { inputBlur(val) {
// //
this.$http('POST', '/supernew/ajax_get_type_batch_list', {
projectSearchId: this.projectSearchId,
search: this.projectSearchName
}).then(response => {
if (response.code == 0) {
this.dialogVisible = false;
}
}).catch(error => {
console.error(error, 'error')
})
console.log(val, '----搜索'); console.log(val, '----搜索');
}, },
updateSelectionState() { updateSelectionState() {
const allSelected = this.selectedRows.length === this.projectList.length; const currentViewSelected = this.sortedProjectList.filter(row =>
const noneSelected = this.selectedRows.length === 0; this.selectedRows.some(selected => selected.id === row.id)
);
const allSelected = currentViewSelected.length === this.sortedProjectList.length;
const noneSelected = currentViewSelected.length === 0;
this.selectAll = allSelected; this.selectAll = allSelected;
this.isIndeterminate = !noneSelected && !allSelected; this.isIndeterminate = !noneSelected && !allSelected;
this.selectedCount = this.selectedRows.length; console.log(this.sortedProjectRows,'sortedProjectRows==');
this.selectedCount = this.sortedProjectRows.length;
}, },
handleSelect(selection, row) {
// console.log(':', row);
// console.log(':', selection);
if (this.sortedProjectRows.includes(row)) {
// console.log('',this.sortedProjectRows);
let index = this.sortedProjectRows.findIndex((item) => item.id === row.id);
if (index > -1) {
this.sortedProjectRows.splice(index, 1)
}
} else {
console.log('zoudaolezheli ');
this.sortedProjectRows.push(row)
}
this.updateSelectionState()
},
handleSelectAll(selection) {
console.log('全选/取消全选:', selection);
},
// //
handleSelectionChange(rows) { handleSelectionChange(rows) {
this.selectedRows = rows; // console.log(rows, '=======---handleSelectionChange');
// ID
const currentViewIds = this.sortedProjectList.map(r => r.id);
//
const preservedSelections = this.selectedRows.filter(
row => !currentViewIds.includes(row.id)
);
//
this.selectedRows = [...preservedSelections, ...rows];
this.updateSelectionState(); this.updateSelectionState();
}, },
handleSelectAllChange1(val) { handleSelectAllChange1(val) {
const currentViewRows = this.sortedProjectList;
if (val) { if (val) {
// //
const unselectedRows = this.projectList.filter( currentViewRows.forEach(row => {
row => !this.selectedRows1.includes(row) // selectedRows
); if (!this.selectedRows.some(r => r.id === row.id)) {
unselectedRows.forEach(row => { this.selectedRows.push(row);
this.$refs.multipleTable1.$refs.guiptable.toggleRowSelection(row, true); }
// sortedProjectRows
if (!this.sortedProjectRows.some(r => r.id === row.id)) {
this.sortedProjectRows.push(row);
}
}); });
} else { } else {
// //
this.selectedRows.forEach(row => { currentViewRows.forEach(row => {
this.$refs.multipleTable1.$refs.guiptable.toggleRowSelection(row, false); // selectedRows
this.selectedRows = this.selectedRows.filter(r => r.id !== row.id);
// sortedProjectRows
this.sortedProjectRows = this.sortedProjectRows.filter(r => r.id !== row.id);
}); });
} }
//
this.$nextTick(() => {
this.setSelectedRows();
this.updateSelectionState();
});
},
//
selectTag(id) {
this.projectSearchId = id === 'all' ? 'all' : id;
this.updateSelectionState();
}, },
// / // /
// //
// //
// //
changeNums(row) { changeNums(row) {
if (row.sort) {
this.editorProjectInfo({ num: row.num, project_id: row.id })
} else {
this.changeSelectStatus(row)
}
},
//
changeClassify(row) {
if (row.sort) {
this.editorProjectInfo({ classify_id: row.classify_id, project_id: row.id })
} else {
this.changeSelectStatus(row)
}
},
//
changePrice(row) {
if (row.sort) {
this.editorProjectInfo({ price: row.price, project_id: row.id })
} else {
this.changeSelectStatus(row) this.changeSelectStatus(row)
}
}, },
changeSelectStatus(row) { changeSelectStatus(row) {
//
if (!this.selectedRows.includes(row)) {
this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(row, true); this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(row, true);
}
row.checked = true row.checked = true
// selectedRows // selectedRows
if (!this.selectedRows.includes(row)) { if (!this.selectedRows.includes(row)) {
this.selectedRows.push(row); this.selectedRows.push(row);
} }
if (!this.sortedProjectRows.includes(row)) {
this.sortedProjectRows.push(row);
}
// //
this.updateSelectionState(); this.updateSelectionState();
}, },
// //
editorProjectInfo(props) { editorProjectInfo(props) {
// console.log(props, '====---');
if (this.package_id) props.package_id = this.package_id
this.$http('POST', '/api/admin/edit_project', { this.$http('POST', '/api/admin/edit_project', {
...props, ...props,
depart_id: this.depart_id, depart_id: this.depart_id,
@ -372,7 +429,12 @@ export default {
}).then(response => { }).then(response => {
if (response.code == 0) { if (response.code == 0) {
this.$Message.success('修改成功') this.$Message.success('修改成功')
this.getInitData() //
// if(this.package_id){
// this.getInitData()
// }else{
// this.fetchProjectData()
// }
} }
}).catch(error => { }).catch(error => {
console.error(error, 'error') console.error(error, 'error')
@ -385,51 +447,38 @@ export default {
this.dialogVisible = false; this.dialogVisible = false;
}, },
handleConfirm() { handleConfirm() {
let project_infos = [];
this.selectedRows.forEach(item => {
project_infos.push({ project_id: item.id, num: item.num || item.unit_num })
})
let props = {
name: this.siteForm.name,
price: this.siteForm.price,
project_infos: JSON.stringify(project_infos)
}
if (this.package_id) props.package_id = this.package_id
// //
this.$http('POST', '/supernew/ajax_get_type_batch_list', { this.$http('POST', '/api/admin/set_project_package', {
depart_id: this.depart_id,
doctor_id: this.doctor_id,
...props
}).then(response => { }).then(response => {
if (response.code == 0) { if (response.code == 0) {
this.$Message.success('保存成功')
this.dialogVisible = false; this.dialogVisible = false;
this.$router.push({
name: '医院信息',
query: { doctor_id: this.doctor_id, depart_id: this.depart_id }
})
} }
}).catch(error => { }).catch(error => {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
handleClear(value) { handleClear(value) {
// this.handleInput('') this.projectSearchName = ''
console.log(value, 'value===qinghcu'); console.log(value, 'value===qinghcu');
}, },
handleSelectAllChange(val) {
console.log(this.$refs.multipleTable, 'multipleTable-');
if (val) {
//
const unselectedRows = this.projectList.filter(
row => !this.selectedRows.includes(row)
);
unselectedRows.forEach(row => {
this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(row, true);
});
} else {
//
this.selectedRows.forEach(row => {
this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(row, false);
});
}
},
// //
// handleSelectionChange(rows) {
// this.selectedRows = rows;
// //
// const allSelected = rows.length === this.treatMentList.length;
// const noneSelected = rows.length === 0;
// this.selectAll = allSelected;
// this.isIndeterminate = !noneSelected && !allSelected;
// },
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize = val this.pageSize = val
this.getData() this.getData()
@ -438,75 +487,57 @@ export default {
this.currentPage = val this.currentPage = val
this.getData() this.getData()
}, },
changeSelect(value) {
console.log(value, '--');
},
btnClick() {
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
//
handleAvatarSuccess(res, file) {
this.imageUrl1 = URL.createObjectURL(file.raw);
},
beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg' || file.type === 'image/png';
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG) {
this.$message.error('上传头像图片只能是 JPG 或 PNG 格式!');
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!');
}
return isJPG && isLt2M;
},
changeNormalWeixin() {
},
changeSelectWeixin(item, flag) {
if (flag) {
this.select_placeholder_weixin = this.options_weixin_null.desc;
return
}
this.selectedItem = { ...item };
console.log(this.selectedItem, 'this.selectedItem====');
},
//
domain_radioChange(type) {
console.log(type, '--');
},
onSwitchChange(data) {
console.log(data, '---');
},
submitForm(form) {
this.$refs[form].validate((valid) => {
console.log(this[form], '======formxinxi');
if (valid) {
alert('提交成功!');
} else {
return false;
}
});
},
cancelClick() { cancelClick() {
this.$router.push({ this.$router.push({
name: '医院信息', name: '医院信息',
query: { doctor_id: this.doctor_id,depart_id:this.depart_id } query: { doctor_id: this.doctor_id, depart_id: this.depart_id }
}) })
}, },
confirmClick() { confirmClick() {
console.log(this.sortedProjectList, 'sortedProjectList==');
console.log(this.sortedProjectRows, 'sortedProjectRows==');
// //
this.$refs['siteForm1'].validate((valid) => {
if (valid) {
if (this.selectedRows.length == 0) {
this.$Message('请选择套餐项目')
return
}
this.dialogVisible = true; this.dialogVisible = true;
} else {
return false;
}
});
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .el-table__header-wrapper .el-checkbox {
display: none;
}
/* 隐藏表头的复选框 */
::v-deep .el-table__header-wrapper .el-checkbox {
display: none !important;
}
/* 确保选择文字可见 */
::v-deep .selection-header-text {
display: inline-block;
margin-left: 8px;
/* 调整位置 */
font-size: 14px;
color: #606266;
font-weight: bold;
}
/* 调整表头单元格的padding */
::v-deep .el-table .el-table__header th {
padding: 8px 0;
/* 根据需要调整 */
}
.siteMessage { .siteMessage {
border-radius: 4px; border-radius: 4px;
transition: all .5s; transition: all .5s;
@ -534,6 +565,11 @@ export default {
} }
} }
.project_list {
max-height: 200px;
overflow-y: auto;
}
.totalCount { .totalCount {
font-size: 12px; font-size: 12px;
font-weight: normal; font-weight: normal;

54
src/views/HosInformation.vue

@ -283,7 +283,7 @@
<GuipDialog :dialogVisible="dialogVisible" :title="dialogTitle" :show-close-button="true" width="762" <GuipDialog :dialogVisible="dialogVisible" :title="dialogTitle" :show-close-button="true" width="762"
:show-cancel-button="true" @confirm="handleConfirm" @cancel="handleCancel" :show-cancel-button="true" @confirm="handleConfirm" @cancel="handleCancel"
@close="handleClose" @dialogVisibleChange="dialogVisibleChange"> @close="handleClose" @dialogVisibleChange="dialogVisibleChange">
<BatchProject v-if="dialogType == '1'" :projectTagData="projectTagData" @getproTag="getProTagData" /> <BatchProject ref="channelProject" v-if="dialogType == '1'" :projectTagData="projectTagData" />
</GuipDialog> </GuipDialog>
<GuipDialog :dialogVisible="dialogVisible1" :title="'新增项目分组'" :show-close-button="true" width="599px" <GuipDialog :dialogVisible="dialogVisible1" :title="'新增项目分组'" :show-close-button="true" width="599px"
type="center" :show-cancel-button="true" @confirm="handleConfirm" @cancel="handleCancel" type="center" :show-cancel-button="true" @confirm="handleConfirm" @cancel="handleCancel"
@ -694,16 +694,6 @@ export default {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
getProTagData() {
this.$http('POST', '/supernew/ajax_get_type_batch_list', {
}).then(response => {
this.projectTagData = response.data
}).catch(error => {
console.error(error, 'error')
})
},
// //
changePrice(row) { changePrice(row) {
if (row.sort) { if (row.sort) {
@ -724,14 +714,14 @@ export default {
}).then(response => { }).then(response => {
if (response.code == 0) { if (response.code == 0) {
this.$Message.success('修改成功') this.$Message.success('修改成功')
this.getInitData() this.fetchProjectData()
} }
}).catch(error => { }).catch(error => {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
addNewSetMenu() { addNewSetMenu() {
this.$router.push(`/addNewTreatment?doctor_id=${this.doctor_id}&depart_id${this.depart_id}`) this.$router.push(`/addNewTreatment?doctor_id=${this.doctor_id}&depart_id=${this.depart_id}`)
}, },
addNewGroup(){ addNewGroup(){
this.dialogVisible1 = true this.dialogVisible1 = true
@ -757,22 +747,50 @@ export default {
if (this.dialogVisible1) { if (this.dialogVisible1) {
this.$refs['projectNameForm'].validate((valid) => { this.$refs['projectNameForm'].validate((valid) => {
if (valid) { if (valid) {
alert('submit!'); this.$http('POST', '/api/admin/add_project_group', {
name:this.form1.projectName.trim(),
depart_id: this.depart_id,
doctor_id: this.doctor_id,
}).then(response => {
if (response.code == 0) {
this.$Message.success('修改成功')
this.dialogVisible1 = false; this.dialogVisible1 = false;
this.form1.projectName = ''
this.fetchProjectData()
}
}).catch(error => {
this.$Message.error(error || '错误!')
})
} else { } else {
console.log('error submit!!'); this.$Message.info('项目分组名称不可为空')
return false; return false;
} }
}); });
} else if (this.dialogVisible) { } else if (this.dialogVisible) {
this.$Message.success('点击了确认按钮'); let data = this.$refs.channelProject.form;
if(!data.project_contents || (data.groupType == '1' && !data.classify_id) || (data.groupType == '2' && !data.classify_name)){
this.$Message.info('请填写完整信息!')
}else{
this.$http('POST', '/api/admin/mitil_add_project', {
depart_id: this.depart_id,
doctor_id: this.doctor_id,
...data
}).then(response => {
if (response.code == 0) {
this.$Message.success('新增项目成功')
this.$refs.channelProject.formReset()
this.dialogVisible = false; this.dialogVisible = false;
this.fetchProjectData();
}
}).catch(error => {
this.$Message.error(error || '错误!')
})
}
} }
}, },
// //
handleCancel() { handleCancel() {
this.$Message.warning('点击了取消按钮'); if(this.dialogVisible)this.$refs.channelProject.formReset()
this.dialogVisible = false; this.dialogVisible = false;
this.dialogVisible1 = false; this.dialogVisible1 = false;
}, },

Loading…
Cancel
Save