Browse Source

批量启用禁用修改

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

3
src/views/AddNewTreatment.vue

@ -47,7 +47,7 @@
</GuipFormItem> </GuipFormItem>
</div> </div>
</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"> @selection-change="handleSelectionChange" :loading="loading">
<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 prop="name" label="项目名称" min-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, '---'); console.log(data, '---');
}, },
submitForm(form) { submitForm(form) {
console.log(this.$refs[form], '-----');
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
console.log(this[form], '======formxinxi'); console.log(this[form], '======formxinxi');
if (valid) { if (valid) {

155
src/views/HosInformation.vue

@ -153,16 +153,17 @@
</div> </div>
<span class="totalCount">{{ projectList.length }}已选{{ selectedCount }}</span> <span class="totalCount">{{ projectList.length }}已选{{ selectedCount }}</span>
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px', margin: '0 26px' }" <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' }" <GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px' }"
@click="batchOperate('2','project')"> @click="batchOperate(1,'project')">
批量启用</GuipButton> 批量启用</GuipButton>
</div> </div>
</div> </div>
<div class="flex-between mb32 mt32"> <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="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)" <div :class="['tab-item point', projectSearchId == 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>
@ -175,12 +176,22 @@
</GuipInput> </GuipInput>
</div> </div>
</div> </div>
<GuipTable :tableData="projectList" style="width: 100%" ref="multipleTable" <GuipTable :tableData="projectList" :key="tableKey" style="width: 100%" ref="multipleTable"
@selection-change="handleSelectionChange" :loading="loading"> @selection-change="handleSelectionChange" :loading="loading" max-height="600px">
<el-table-column type="selection" label="选择" width="80"></el-table-column> <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="name" label="项目名称" min-width="185"></el-table-column>
<el-table-column prop="price" label="项目价格" min-width="125"></el-table-column> <el-table-column prop="price" label="项目价格" min-width="155">
<el-table-column prop="group" label="分组" min-width="125"></el-table-column> <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="create_time" label="添加时间" min-width="225"></el-table-column>
<el-table-column prop="status" label="状态" min-width="125"> <el-table-column prop="status" label="状态" min-width="125">
<template slot-scope="scope"> <template slot-scope="scope">
@ -218,15 +229,15 @@
</div> </div>
<span class="totalCount">{{ courseList.length }}已选{{ selectedCount }}</span> <span class="totalCount">{{ courseList.length }}已选{{ selectedCount }}</span>
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px', margin: '0 26px' }" <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' }" <GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px' }"
@click="batchOperate('2','group')"> @click="batchOperate(1,'group')">
批量启用</GuipButton> 批量启用</GuipButton>
</div> </div>
</div> </div>
<GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1" <GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1" max-height="600px"
@selection-change="handleSelectionChange1" :loading="loading1"> @selection-change="handleSelectionChange1" :loading="loading1" :key="tableKey1" >
<el-table-column type="selection" label="选择" width="80"></el-table-column> <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="name" label="套餐名称" min-width="225"></el-table-column>
<el-table-column prop="price" label="套餐价格" min-width="125"></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 GuipTable from '@/components/GuipTable.vue';
import GuipDialog from '@/components/GuipDialog.vue'; import GuipDialog from '@/components/GuipDialog.vue';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import { Object } from 'core-js';
export default { export default {
// //
@ -308,6 +320,8 @@ export default {
return { return {
doctorId: '', doctorId: '',
dialogType: '1', dialogType: '1',
tableKey:Date.now(),
tableKey1:Date.now(),
dialogVisible: false, dialogVisible: false,
dialogVisible1: false, dialogVisible1: false,
form1: { form1: {
@ -325,7 +339,7 @@ export default {
selectedRows1: [],// selectedRows1: [],//
isIndeterminate: false, isIndeterminate: false,
isIndeterminate1: false, isIndeterminate1: false,
projectSearchId: '', projectSearchId: 'all',
projectSearchName: '', projectSearchName: '',
projectList: [ projectList: [
{ {
@ -513,6 +527,10 @@ export default {
...mapState(['hosMenuData']) // VuexshowSidebar ...mapState(['hosMenuData']) // VuexshowSidebar
}, },
methods: { methods: {
random() {
var randomNumber = Math.random();
return randomNumber
},
fetchDoctorData() { fetchDoctorData() {
this.$http('POST', '/api/admin/get_depart_info', { this.$http('POST', '/api/admin/get_depart_info', {
depart_id: this.depart_id, depart_id: this.depart_id,
@ -535,7 +553,11 @@ export default {
doctor_id: this.doctor_id doctor_id: this.doctor_id
}).then(response => { }).then(response => {
if(response.code == 0){ 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 => { }).catch(error => {
@ -549,8 +571,14 @@ export default {
doctor_id: this.doctor_id doctor_id: this.doctor_id
}).then(response => { }).then(response => {
if(response.code == 0){ if(response.code == 0){
this.projectTagData = Object.values(response.data.classify);// this.loading = false
this.$nextTick(()=>{
this.projectTagData = response.data.classify;//
this.projectList = Object.values(response.data.list);// 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 => { }).catch(error => {
console.error(error, 'error') console.error(error, 'error')
@ -576,21 +604,24 @@ export default {
} }
}, },
selectTag(item) { selectTag(item) {
if(item == 'all'){
this.projectSearchId = 'all';
}else{
this.projectSearchId = item.id; this.projectSearchId = item.id;
}
// //
this.getFilterProject() // this.getFilterProject()
}, },
getFilterProject(){ getFilterProject(){
// //
this.$http('POST', '/supernew/ajax_get_type_batch_list', { this.$http('POST', '/supernew/ajax_get_type_batch_list', {
// //
projectid:this.projectSearchId, projectid:this.projectSearchId == 'all' ? '' : this.projectSearchId,
// //
projectSearchName:this.projectSearchName projectSearchName:this.projectSearchName
}).then(response => { }).then(response => {
this.projectTagData = response.data this.projectTagData = response.data;
}).catch(error => { }).catch(error => {
console.error(error, 'error') console.error(error, 'error')
}) })
@ -605,6 +636,32 @@ export default {
console.error(error, 'error') 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() { 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}`)
}, },
@ -731,36 +788,64 @@ export default {
}, },
// //
batchOperate(type,name) { batchOperate(type,name) {
// //
let url= '/api/admin/project_package_mutil_option'; let url= '/api/admin/project_package_mutil_option';
let props = {} let props = {
if (type == '1') {// status:type,
depart_id:this.depart_id,
doctor_id:this.doctor_id
}
let str = []
// //
if(name == 'project'){ if(name == 'project'){
// //
}else{ url='/api/admin/project_mutil_option';
// selectedRows1 // selectedRows
// console.log(this.selectedRows,'----09999888');
this.selectedRows.forEach(item=>{
if(item.status != type){
str.push(item.id)
} }
})
} else { if(str.length == 0){
if(name == 'project'){ this.$message.error('请重新选择!')
// return
}
props.project_ids = str.join(',')
}else{ }else{
// //
// selectedRows1
this.selectedRows1.forEach(item=>{
if(item.status != type){
str.push(item.id)
} }
})
if(str.length == 0){
this.$message.error('请重新选择!')
return
} }
this.changePackData(url,props) props.package_ids = str.join(',')
}
// console.log(url,props);
this.changePackData(url,props,name)
}, },
// //
changePackData(url,params) { changePackData(url,params,name) {
this.$http('POST',url , { this.$http('POST',url , {
...params ...params
}).then(response => { }).then(response => {
let data = response.data if(response.code == 0){
console.log(data); this.$Message.success('操作成功')
if(name == 'project'){
this.loading = true;
this.selectedRows=[]
this.fetchProjectData()
}else{
this.loading1 = true;
this.selectedRows1=[];
this.fetchPackData()
}
}
}).catch(error => { }).catch(error => {
console.error(error, 'error') console.error(error, 'error')
}) })

Loading…
Cancel
Save