Browse Source

批量启用禁用修改

master
zq 3 weeks ago
parent
commit
f838c58bd4
  1. 3
      src/views/AddNewTreatment.vue
  2. 167
      src/views/HosInformation.vue

3
src/views/AddNewTreatment.vue

@ -47,7 +47,7 @@
</GuipFormItem>
</div>
</div>
<GuipTable :tableData="sortedProjectList" style="width: 100%" ref="multipleTable"
<GuipTable :tableData="sortedProjectList" style="width: 100%" ref="multipleTable" max-height="600px"
@selection-change="handleSelectionChange" :loading="loading">
<el-table-column type="selection" label="选择" width="150"></el-table-column>
<el-table-column prop="name" label="项目名称" min-width="150"></el-table-column>
@ -484,7 +484,6 @@ export default {
console.log(data, '---');
},
submitForm(form) {
console.log(this.$refs[form], '-----');
this.$refs[form].validate((valid) => {
console.log(this[form], '======formxinxi');
if (valid) {

167
src/views/HosInformation.vue

@ -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']) // VuexshowSidebar
},
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')
})

Loading…
Cancel
Save