| xqd
@@ -480,7 +480,13 @@
|
|
|
}, {
|
|
|
flag: true
|
|
|
}, ],
|
|
|
- hospital: [{'name':'医院1'},{'name':'医院2'}],
|
|
|
+ hospital: [{
|
|
|
+ name: '熊科医院'
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // name: '测试医院'
|
|
|
+ // },
|
|
|
+ ],
|
|
|
hospitals: [],
|
|
|
hospitalcurrent: 0,
|
|
|
list: [{
|
| xqd
@@ -597,109 +603,88 @@
|
|
|
service_time: "",
|
|
|
relation_id: 0
|
|
|
}]
|
|
|
- },
|
|
|
- type:2
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
/* 保存 */
|
|
|
- bc:async function(e) {
|
|
|
- let that = this;
|
|
|
+ bc(e) {
|
|
|
/**
|
|
|
* 电话
|
|
|
* */
|
|
|
-
|
|
|
- that.form.is_phone.service_time='';
|
|
|
- that.form.is_chat.service_time='';
|
|
|
- that.form.is_appoint.hospitals[0].service_time='';
|
|
|
- that.form.is_appoint.hospitals[1].service_time='';
|
|
|
- for(let i in that.dh.timeList1){ //遍历选中 保存id
|
|
|
- if(that.dh.timeList1[i].checked){that.form.is_phone.service_time = that.form.is_phone.service_time+","+that.dh.timeList1[i].id}
|
|
|
+ for(let i in this.dh.timeList1){ //遍历选中 保存id
|
|
|
+ if(this.dh.timeList1[i].checked){this.form.is_phone.service_time = this.form.is_phone.service_time+","+this.dh.timeList1[i].id}
|
|
|
}
|
|
|
- for(let i in that.dh.timeList2){ //遍历选中 保存id
|
|
|
- if(that.dh.timeList2[i].checked){that.form.is_phone.service_time = that.form.is_phone.service_time+","+that.dh.timeList2[i].id}
|
|
|
+ for(let i in this.dh.timeList2){ //遍历选中 保存id
|
|
|
+ if(this.dh.timeList2[i].checked){this.form.is_phone.service_time = this.form.is_phone.service_time+","+this.dh.timeList2[i].id}
|
|
|
}
|
|
|
- for(let i in that.dh.timeList3){ //遍历选中 保存id
|
|
|
- if(that.dh.timeList3[i].checked){that.form.is_phone.service_time = that.form.is_phone.service_time+","+that.dh.timeList3[i].id}
|
|
|
+ for(let i in this.dh.timeList3){ //遍历选中 保存id
|
|
|
+ if(this.dh.timeList3[i].checked){this.form.is_phone.service_time = this.form.is_phone.service_time+","+this.dh.timeList3[i].id}
|
|
|
}
|
|
|
//判断开头第一个是否为逗号,是就删除逗号
|
|
|
- if(that.form.is_phone.service_time.startsWith(",")){
|
|
|
- that.form.is_phone.service_time= that.form.is_phone.service_time.substr(1);
|
|
|
+ if(this.form.is_phone.service_time.startsWith(",")){
|
|
|
+ this.form.is_phone.service_time= this.form.is_phone.service_time.substr(1);
|
|
|
}
|
|
|
/**
|
|
|
* 图文
|
|
|
* */
|
|
|
-
|
|
|
- for(let i in that.tw.timeList1){ //遍历选中 保存id
|
|
|
- if(that.tw.timeList1[i].checked){that.form.is_chat.service_time = that.form.is_chat.service_time+","+that.tw.timeList1[i].id}
|
|
|
+ for(let i in this.tw.timeList1){ //遍历选中 保存id
|
|
|
+ if(this.tw.timeList1[i].checked){this.form.is_chat.service_time = this.form.is_chat.service_time+","+this.tw.timeList1[i].id}
|
|
|
}
|
|
|
- for(let i in that.tw.timeList2){ //遍历选中 保存id
|
|
|
- if(that.tw.timeList2[i].checked){that.form.is_chat.service_time = that.form.is_chat.service_time+","+that.tw.timeList2[i].id}
|
|
|
+ for(let i in this.tw.timeList2){ //遍历选中 保存id
|
|
|
+ if(this.tw.timeList2[i].checked){this.form.is_chat.service_time = this.form.is_chat.service_time+","+this.tw.timeList2[i].id}
|
|
|
}
|
|
|
- for(let i in that.tw.timeList3){ //遍历选中 保存id
|
|
|
- if(that.tw.timeList3[i].checked){that.form.is_chat.service_time =thatthat.form.is_chat.service_time+","+that.tw.timeList3[i].id}
|
|
|
+ for(let i in this.tw.timeList3){ //遍历选中 保存id
|
|
|
+ if(this.tw.timeList3[i].checked){this.form.is_chat.service_time = this.form.is_chat.service_time+","+this.tw.timeList3[i].id}
|
|
|
}
|
|
|
//判断开头第一个是否为逗号,是就删除逗号
|
|
|
- if(that.form.is_chat.service_time.startsWith(",")){
|
|
|
-
|
|
|
- that.form.is_chat.service_time= that.form.is_chat.service_time.substr(1);
|
|
|
+ if(this.form.is_chat.service_time.startsWith(",")){
|
|
|
+ this.form.is_chat.service_time= this.form.is_chat.service_time.substr(1);
|
|
|
}
|
|
|
/**
|
|
|
* 门诊
|
|
|
* */
|
|
|
- for(let i in that.mz1.timeList1){ //遍历选中 保存id
|
|
|
- if(that.mz1.timeList1[i].checked){that.form.is_appoint.hospitals[0].service_time = that.form.is_appoint.hospitals[0].service_time+","+that.mz1.timeList1[i].id}
|
|
|
+ for(let i in this.mz1.timeList1){ //遍历选中 保存id
|
|
|
+ if(this.mz1.timeList1[i].checked){this.form.is_appoint.hospitals[0].service_time = this.form.is_appoint.hospitals[0].service_time+","+this.mz1.timeList1[i].id}
|
|
|
}
|
|
|
- for(let i in that.mz1.timeList2){ //遍历选中 保存id
|
|
|
- if(that.mz1.timeList2[i].checked){that.form.is_appoint.hospitals[0].service_time = that.form.is_appoint.hospitals[0].service_time+","+that.mz1.timeList2[i].id}
|
|
|
+ for(let i in this.mz1.timeList2){ //遍历选中 保存id
|
|
|
+ if(this.mz1.timeList2[i].checked){this.form.is_appoint.hospitals[0].service_time = this.form.is_appoint.hospitals[0].service_time+","+this.mz1.timeList2[i].id}
|
|
|
}
|
|
|
- for(let i in that.mz1.timeList3){ //遍历选中 保存id
|
|
|
- if(that.mz1.timeList3[i].checked){that.form.is_appoint.hospitals[0].service_time = that.form.is_appoint.hospitals[0].service_time+","+that.mz1.timeList3[i].id}
|
|
|
+ for(let i in this.mz1.timeList3){ //遍历选中 保存id
|
|
|
+ if(this.mz1.timeList3[i].checked){this.form.is_appoint.hospitals[0].service_time = this.form.is_appoint.hospitals[0].service_time+","+this.mz1.timeList3[i].id}
|
|
|
}
|
|
|
//判断开头第一个是否为逗号,是就删除逗号
|
|
|
- if(that.form.is_appoint.hospitals[0].service_time.startsWith(",")){
|
|
|
-
|
|
|
- that.form.is_appoint.hospitals[0].service_time= that.form.is_appoint.hospitals[0].service_time.substr(1);
|
|
|
+ if(this.form.is_appoint.hospitals[0].service_time.startsWith(",")){
|
|
|
+ this.form.is_appoint.hospitals[0].service_time= this.form.is_appoint.hospitals[0].service_time.substr(1);
|
|
|
}
|
|
|
/**
|
|
|
* 门诊
|
|
|
* */
|
|
|
- for(let i in that.mz2.timeList1){ //遍历选中 保存id
|
|
|
- if(that.mz2.timeList1[i].checked){that.form.is_appoint.hospitals[1].service_time = that.form.is_appoint.hospitals[1].service_time+","+that.mz2.timeList1[i].id}
|
|
|
+ for(let i in this.mz2.timeList1){ //遍历选中 保存id
|
|
|
+ if(this.mz2.timeList1[i].checked){this.form.is_appoint.hospitals[1].service_time = this.form.is_appoint.hospitals[1].service_time+","+this.mz2.timeList1[i].id}
|
|
|
}
|
|
|
- for(let i in that.mz2.timeList2){ //遍历选中 保存id
|
|
|
- if(that.mz2.timeList2[i].checked){that.form.is_appoint.hospitals[1].service_time = that.form.is_appoint.hospitals[1].service_time+","+that.mz2.timeList2[i].id}
|
|
|
+ for(let i in this.mz2.timeList2){ //遍历选中 保存id
|
|
|
+ if(this.mz2.timeList2[i].checked){this.form.is_appoint.hospitals[1].service_time = this.form.is_appoint.hospitals[1].service_time+","+this.mz2.timeList2[i].id}
|
|
|
}
|
|
|
- for(let i in that.mz2.timeList3){ //遍历选中 保存id
|
|
|
- if(that.mz2.timeList3[i].checked){that.form.is_appoint.hospitals[1].service_time = that.form.is_appoint.hospitals[1].service_time+","+that.mz2.timeList3[i].id}
|
|
|
+ for(let i in this.mz2.timeList3){ //遍历选中 保存id
|
|
|
+ if(this.mz2.timeList3[i].checked){this.form.is_appoint.hospitals[1].service_time = this.form.is_appoint.hospitals[1].service_time+","+this.mz2.timeList3[i].id}
|
|
|
}
|
|
|
//判断开头第一个是否为逗号,是就删除逗号
|
|
|
- if(that.form.is_appoint.hospitals[1].service_time.startsWith(",")){
|
|
|
- that.form.is_appoint.hospitals[1].service_time= that.form.is_appoint.hospitals[1].service_time.substr(1);
|
|
|
+ if(this.form.is_appoint.hospitals[1].service_time.startsWith(",")){
|
|
|
+ this.form.is_appoint.hospitals[1].service_time= this.form.is_appoint.hospitals[1].service_time.substr(1);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
- var forms = JSON.parse(JSON.stringify(that.form));
|
|
|
- if(typeof forms!='string'){
|
|
|
- forms = JSON.stringify(forms)
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- console.log('我是form',that.form)
|
|
|
- console.log('我是formzifuc',forms)
|
|
|
- let res = await that.$request.post('doctor/saveSettingList',{data:forms,type:2});
|
|
|
- if(res.status==0){
|
|
|
- uni.showToast({
|
|
|
- icon:'none',
|
|
|
- duration:3000,
|
|
|
- title:'操作成功',
|
|
|
-
|
|
|
- })
|
|
|
- }
|
|
|
- console.log('res对象:',res);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ console.log(this.form)
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 1
|
|
|
+ })
|
|
|
},
|
|
|
/**
|
|
|
* @author Liu Yuanhang
|
| xqd
@@ -712,24 +697,11 @@
|
|
|
if (res.status == 0) {
|
|
|
|
|
|
// 1.控制列表显示,2.渲染数据
|
|
|
- this.showList[0].flag = res.data.show.is_phone;
|
|
|
- this.showList[1].flag = res.data.show.is_chat;
|
|
|
- this.showList[2].flag = res.data.show.is_appoint;
|
|
|
-
|
|
|
- // 获取医院
|
|
|
- if (res.data.org != null) {
|
|
|
- this.hospital=[];
|
|
|
- // this.hospital = res.data.org;
|
|
|
- this.hospitals = res.data.orgs;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+ // this.showList[0].flag = res.data.show.is_phone;
|
|
|
+ // this.showList[1].flag = res.data.show.is_chat;
|
|
|
+ // this.showList[2].flag = res.data.show.is_appoint;
|
|
|
|
|
|
// 渲染显示的基础价格设置
|
|
|
- this.form.is_phone.person = '';
|
|
|
- this.form.is_chat.person ='';
|
|
|
- this.form.is_appoint.person='';
|
|
|
-
|
|
|
if (res.data.list.phone != null) {
|
|
|
// 渲染电话的基础数据
|
|
|
this.form.is_phone.base_price = res.data.list.phone.base_price;
|
| xqd
@@ -751,7 +723,13 @@
|
|
|
this.form.is_appoint.person = res.data.list.men.person;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ // 获取医院
|
|
|
+ if (res.data.org != null) {
|
|
|
+ console.log('获取医院', res.data.org)
|
|
|
+ this.hospital = res.data.org;
|
|
|
+ this.hospitals = res.data.orgs;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
/* 渲染时间 */
|
|
|
//电话的时间
|
| xqd
@@ -797,13 +775,8 @@
|
|
|
dh1 = this.dh.timeList1;
|
|
|
dh2 = this.dh.timeList2;
|
|
|
dh3 = this.dh.timeList3;
|
|
|
- let phone = e.list.phone.service_time.split(',');
|
|
|
- var phones=[];//保存转换后的整型字符串
|
|
|
- phone.forEach(function(data,index,arr){
|
|
|
- phones.push(+data);
|
|
|
- });
|
|
|
+ let phones = e.list.phone.service_time;
|
|
|
console.log('我是电话', phones)
|
|
|
-
|
|
|
for (let i = 0; i < dh1.length; i++) {
|
|
|
if (phones.indexOf(dh1[i].id) != -1) {
|
|
|
dh1[i].checked = true
|
| xqd
@@ -824,101 +797,28 @@
|
|
|
}
|
|
|
|
|
|
// 图文资讯渲染
|
|
|
- if(e.list.chat!=null){
|
|
|
- tw1=this.tw.timeList1;
|
|
|
- tw2=this.tw.timeList2;
|
|
|
- tw3=this.tw.timeList3;
|
|
|
- let chats = e.list.chat.service_time.split(',');
|
|
|
- var chat=[];//保存转换后的整型字符串
|
|
|
- chats.forEach(function(data,index,arr){
|
|
|
- chat.push(+data);
|
|
|
- });
|
|
|
- console.log('我是图文',chat)
|
|
|
- for(let i=0;i<tw1.length;i++){
|
|
|
- if(chat.indexOf(tw1[i].id)!=-1){
|
|
|
- tw1[i].checked = true
|
|
|
- }
|
|
|
- }
|
|
|
- for(let i=0;i<tw2.length;i++){
|
|
|
- if(chat.indexOf(tw2[i].id)!=-1){
|
|
|
- tw2[i].checked = true
|
|
|
- }
|
|
|
- }
|
|
|
- for(let i=0;i<tw3.length;i++){
|
|
|
- if(chat.indexOf(tw3[i].id)!=-1){
|
|
|
- tw3[i].checked = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- let mzCont = e.list.men.length;
|
|
|
- if(mzCont>0){
|
|
|
-
|
|
|
- let men = e.list.men;
|
|
|
- let men1 = e.list.men[0].service_time.split(',');
|
|
|
- let men2 = e.list.men[1].service_time.split(',');
|
|
|
- var men1s=[];//保存转换后的整型字符串
|
|
|
- var men2s=[];//保存转换后的整型字符串
|
|
|
- men1.forEach(function(data,index,arr){
|
|
|
- men1s.push(+data);
|
|
|
- });
|
|
|
- men2.forEach(function(data,index,arr){
|
|
|
- men2s.push(+data);
|
|
|
- });
|
|
|
-
|
|
|
- let p =0;
|
|
|
- var names = '';
|
|
|
- if(mzCont==1){
|
|
|
- for(let k=0;k<this.mz1.timeList1.length;k++){
|
|
|
- if(men1s.indexOf(this.mz1.timeList1[k].id)!=-1){
|
|
|
- this.mz1.timeList1[k].checked = true
|
|
|
- }
|
|
|
- }
|
|
|
- for(let k=0;k<this.mz1.timeList2.length;k++){
|
|
|
- if(men1s.indexOf(this.mz1.timeList2[k].id)!=-1){
|
|
|
- this.mz1.timeList2[k].checked = true
|
|
|
- }
|
|
|
- }
|
|
|
- for(let k=0;k<this.mz1.timeList3.length;k++){
|
|
|
- if(men1s.indexOf(this.mz1.timeList3[k].id)!=-1){
|
|
|
- this.mz1.timeList3[k].checked = true
|
|
|
- }
|
|
|
- }
|
|
|
- }else if(mzCont==2){
|
|
|
- for(let k=0;k<this.mz1.timeList1.length;k++){
|
|
|
- if(men1s.indexOf(this.mz1.timeList1[k].id)!=-1){
|
|
|
- this.mz1.timeList1[k].checked = true
|
|
|
- }
|
|
|
- }
|
|
|
- for(let k=0;k<this.mz1.timeList2.length;k++){
|
|
|
- if(men1s.indexOf(this.mz1.timeList2[k].id)!=-1){
|
|
|
- this.mz1.timeList2[k].checked = true
|
|
|
- }
|
|
|
- }
|
|
|
- for(let k=0;k<this.mz1.timeList3.length;k++){
|
|
|
- if(men1s.indexOf(this.mz1.timeList3[k].id)!=-1){
|
|
|
- this.mz1.timeList3[k].checked = true
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- for(let k=0;k<this.mz2.timeList1.length;k++){
|
|
|
- if(men2s.indexOf(this.mz2.timeList1[k].id)!=-1){
|
|
|
- this.mz2.timeList1[k].checked = true
|
|
|
- }
|
|
|
- }
|
|
|
- for(let k=0;k<this.mz2.timeList2.length;k++){
|
|
|
- if(men2s.indexOf(this.mz2.timeList2[k].id)!=-1){
|
|
|
- this.mz2.timeList2[k].checked = true
|
|
|
- }
|
|
|
- }
|
|
|
- for(let k=0;k<this.mz2.timeList3.length;k++){
|
|
|
- if(men2s.indexOf(this.mz2.timeList3[k].id)!=-1){
|
|
|
- this.mz2.timeList3[k].checked = true
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- console.log(e.list);
|
|
|
+ // if(e.list.chat!=null){
|
|
|
+ // tw1=this.tw.timeList1;
|
|
|
+ // tw2=this.tw.timeList2;
|
|
|
+ // tw3=this.tw.timeList3;
|
|
|
+ // let chat = e.list.chat.service_time;
|
|
|
+ // console.log('我是图文',chat)
|
|
|
+ // for(let i=0;i<tw1.length;i++){
|
|
|
+ // if(chat.indexOf(tw1[i].id)!=-1){
|
|
|
+ // tw1[i].checked = true
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // for(let i=0;i<tw2.length;i++){
|
|
|
+ // if(chat.indexOf(tw2[i].id)!=-1){
|
|
|
+ // tw2[i].checked = true
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // for(let i=0;i<tw3.length;i++){
|
|
|
+ // if(chat.indexOf(tw3[i].id)!=-1){
|
|
|
+ // tw3[i].checked = true
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
uni.hideLoading();
|
|
|
},
|
|
|
dhchange(index) {
|