|
|
@ -153,16 +153,17 @@ |
|
|
|
</div> |
|
|
|
<span class="totalCount">共{{ projectList.length }}条,已选{{ selectedCount }}条</span> |
|
|
|
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px', margin: '0 26px' }" |
|
|
|
@click="batchOperate('1','project')">批量禁用</GuipButton> |
|
|
|
@click="batchOperate(0,'project')">批量禁用</GuipButton> |
|
|
|
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px' }" |
|
|
|
@click="batchOperate('2','project')"> |
|
|
|
@click="batchOperate(1,'project')"> |
|
|
|
批量启用</GuipButton> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="flex-between mb32 mt32"> |
|
|
|
<div class="tabProject scroll-container"> |
|
|
|
<div class="tabProject scroll-container" v-if="Object.values(projectTagData).length > 0"> |
|
|
|
<div class="overTab scroll-list"> |
|
|
|
<div :class="['tab-item point', projectSearchId == 'all'? 'active' : '']" @click="selectTag('all')">全部分类</div> |
|
|
|
<div :class="['tab-item point', projectSearchId == item.id ? 'active' : '']" @click="selectTag(item)" |
|
|
|
v-for="item in projectTagData" :key="item.name">{{ item.name }}</div> |
|
|
|
</div> |
|
|
@ -175,12 +176,22 @@ |
|
|
|
</GuipInput> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<GuipTable :tableData="projectList" style="width: 100%" ref="multipleTable" |
|
|
|
@selection-change="handleSelectionChange" :loading="loading"> |
|
|
|
<GuipTable :tableData="projectList" :key="tableKey" style="width: 100%" ref="multipleTable" |
|
|
|
@selection-change="handleSelectionChange" :loading="loading" max-height="600px"> |
|
|
|
<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> |
|
|
|
<el-table-column prop="group" label="分组" min-width="125"></el-table-column> |
|
|
|
<el-table-column prop="name" label="项目名称" min-width="185"></el-table-column> |
|
|
|
<el-table-column prop="price" label="项目价格" min-width="155"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<GuipInput width="90%" v-model="scope.row.price" @change="changePrice(scope.row)" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="classify_id" label="分组" min-width="155"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<GuipSelect width="90%" v-model="scope.row.classify_id" |
|
|
|
@change="changeClassify(scope.row)" prop="classify_id" :options="projectTagData" |
|
|
|
valueKey="id" labelKey="name" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="create_time" label="添加时间" min-width="225"></el-table-column> |
|
|
|
<el-table-column prop="status" label="状态" min-width="125"> |
|
|
|
<template slot-scope="scope"> |
|
|
@ -218,15 +229,15 @@ |
|
|
|
</div> |
|
|
|
<span class="totalCount">共{{ courseList.length }}条,已选{{ selectedCount }}条</span> |
|
|
|
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px', margin: '0 26px' }" |
|
|
|
@click="batchOperate('1','group')">批量禁用</GuipButton> |
|
|
|
@click="batchOperate(0,'group')">批量禁用</GuipButton> |
|
|
|
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px' }" |
|
|
|
@click="batchOperate('2','group')"> |
|
|
|
@click="batchOperate(1,'group')"> |
|
|
|
批量启用</GuipButton> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
<GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1" |
|
|
|
@selection-change="handleSelectionChange1" :loading="loading1"> |
|
|
|
<GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1" max-height="600px" |
|
|
|
@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> |
|
|
@ -286,6 +297,7 @@ import GuipSwitch from '@/components/GuipSwitch.vue'; |
|
|
|
import GuipTable from '@/components/GuipTable.vue'; |
|
|
|
import GuipDialog from '@/components/GuipDialog.vue'; |
|
|
|
import { mapState } from 'vuex'; |
|
|
|
import { Object } from 'core-js'; |
|
|
|
|
|
|
|
export default { |
|
|
|
// 站点设置 |
|
|
@ -308,6 +320,8 @@ export default { |
|
|
|
return { |
|
|
|
doctorId: '', |
|
|
|
dialogType: '1', |
|
|
|
tableKey:Date.now(), |
|
|
|
tableKey1:Date.now(), |
|
|
|
dialogVisible: false, |
|
|
|
dialogVisible1: false, |
|
|
|
form1: { |
|
|
@ -325,7 +339,7 @@ export default { |
|
|
|
selectedRows1: [],//已选中数据 |
|
|
|
isIndeterminate: false, |
|
|
|
isIndeterminate1: false, |
|
|
|
projectSearchId: '', |
|
|
|
projectSearchId: 'all', |
|
|
|
projectSearchName: '', |
|
|
|
projectList: [ |
|
|
|
{ |
|
|
@ -513,6 +527,10 @@ export default { |
|
|
|
...mapState(['hosMenuData']) // 从Vuex映射showSidebar状态到组件的计算属性中 |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
random() { |
|
|
|
var randomNumber = Math.random(); |
|
|
|
return randomNumber |
|
|
|
}, |
|
|
|
fetchDoctorData() { |
|
|
|
this.$http('POST', '/api/admin/get_depart_info', { |
|
|
|
depart_id: this.depart_id, |
|
|
@ -535,7 +553,11 @@ export default { |
|
|
|
doctor_id: this.doctor_id |
|
|
|
}).then(response => { |
|
|
|
if(response.code == 0){ |
|
|
|
this.courseList = response.data.list |
|
|
|
this.loading1 = false |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.courseList = response.data.list; |
|
|
|
this.tableKey1 = Date.now(); // 强制重新渲染表格 |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
@ -549,8 +571,14 @@ export default { |
|
|
|
doctor_id: this.doctor_id |
|
|
|
}).then(response => { |
|
|
|
if(response.code == 0){ |
|
|
|
this.projectTagData = Object.values(response.data.classify);//项目分类 |
|
|
|
this.projectList = Object.values(response.data.list);//项目列表 |
|
|
|
this.loading = false |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.projectTagData = response.data.classify;//项目分类 |
|
|
|
this.projectList = Object.values(response.data.list);//项目列表 |
|
|
|
this.tableKey = Date.now(); // 强制重新渲染表格 |
|
|
|
// this.$set('projectList',Object.values(response.data.list)) |
|
|
|
// this.$set('projectTagData',response.data.classify) |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
@ -576,21 +604,24 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
selectTag(item) { |
|
|
|
this.projectSearchId = item.id; |
|
|
|
if(item == 'all'){ |
|
|
|
this.projectSearchId = 'all'; |
|
|
|
}else{ |
|
|
|
this.projectSearchId = item.id; |
|
|
|
} |
|
|
|
// 筛选逻辑 |
|
|
|
this.getFilterProject() |
|
|
|
// this.getFilterProject() |
|
|
|
|
|
|
|
}, |
|
|
|
getFilterProject(){ |
|
|
|
// 接口需要更改 |
|
|
|
this.$http('POST', '/supernew/ajax_get_type_batch_list', { |
|
|
|
// 项目筛选 |
|
|
|
projectid:this.projectSearchId, |
|
|
|
projectid:this.projectSearchId == 'all' ? '' : this.projectSearchId, |
|
|
|
// 项目名称搜索 |
|
|
|
projectSearchName:this.projectSearchName |
|
|
|
}).then(response => { |
|
|
|
this.projectTagData = response.data |
|
|
|
|
|
|
|
this.projectTagData = response.data; |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
@ -605,6 +636,32 @@ export default { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 修改项目价格 |
|
|
|
changePrice(row) { |
|
|
|
if (row.sort) { |
|
|
|
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 }) |
|
|
|
} |
|
|
|
}, |
|
|
|
editorProjectInfo(props) { |
|
|
|
this.$http('POST', '/api/admin/edit_project', { |
|
|
|
...props, |
|
|
|
depart_id: this.depart_id, |
|
|
|
doctor_id: this.doctor_id, |
|
|
|
}).then(response => { |
|
|
|
if (response.code == 0) { |
|
|
|
this.$Message.success('修改成功') |
|
|
|
this.getInitData() |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
}, |
|
|
|
addNewSetMenu() { |
|
|
|
this.$router.push(`/addNewTreatment?doctor_id=${this.doctor_id}&depart_id${this.depart_id}`) |
|
|
|
}, |
|
|
@ -731,36 +788,64 @@ export default { |
|
|
|
}, |
|
|
|
// 批量操作 |
|
|
|
batchOperate(type,name) { |
|
|
|
// 默认疗程 |
|
|
|
// 默认疗程 启用、禁用 |
|
|
|
let url= '/api/admin/project_package_mutil_option'; |
|
|
|
let props = {} |
|
|
|
if (type == '1') {//启用 |
|
|
|
let props = { |
|
|
|
status:type, |
|
|
|
depart_id:this.depart_id, |
|
|
|
doctor_id:this.doctor_id |
|
|
|
} |
|
|
|
let str = [] |
|
|
|
// 禁用 |
|
|
|
if(name == 'project'){ |
|
|
|
// 修改项目列表 |
|
|
|
}else{ |
|
|
|
// selectedRows1 |
|
|
|
// 修改疗程套餐 |
|
|
|
if(name == 'project'){ |
|
|
|
// 修改项目列表 |
|
|
|
url='/api/admin/project_mutil_option'; |
|
|
|
// selectedRows |
|
|
|
console.log(this.selectedRows,'----09999888'); |
|
|
|
this.selectedRows.forEach(item=>{ |
|
|
|
if(item.status != type){ |
|
|
|
str.push(item.id) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(str.length == 0){ |
|
|
|
this.$message.error('请重新选择!') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
if(name == 'project'){ |
|
|
|
// 修改项目列表 |
|
|
|
}else{ |
|
|
|
// 修改疗程套餐 |
|
|
|
props.project_ids = str.join(',') |
|
|
|
}else{ |
|
|
|
// 修改疗程套餐 |
|
|
|
// selectedRows1 |
|
|
|
this.selectedRows1.forEach(item=>{ |
|
|
|
if(item.status != type){ |
|
|
|
str.push(item.id) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(str.length == 0){ |
|
|
|
this.$message.error('请重新选择!') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
props.package_ids = str.join(',') |
|
|
|
} |
|
|
|
this.changePackData(url,props) |
|
|
|
// console.log(url,props); |
|
|
|
this.changePackData(url,props,name) |
|
|
|
}, |
|
|
|
// |
|
|
|
changePackData(url,params) { |
|
|
|
changePackData(url,params,name) { |
|
|
|
this.$http('POST',url , { |
|
|
|
...params |
|
|
|
}).then(response => { |
|
|
|
let data = response.data |
|
|
|
console.log(data); |
|
|
|
|
|
|
|
if(response.code == 0){ |
|
|
|
this.$Message.success('操作成功') |
|
|
|
if(name == 'project'){ |
|
|
|
this.loading = true; |
|
|
|
this.selectedRows=[] |
|
|
|
this.fetchProjectData() |
|
|
|
}else{ |
|
|
|
this.loading1 = true; |
|
|
|
this.selectedRows1=[]; |
|
|
|
this.fetchPackData() |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|