| xqd
@@ -48,7 +48,7 @@
|
|
|
<u-checkbox-group style="width: 80%;height: 100%;">
|
|
|
<view class="flex justify-around align-center" style="padding: 40rpx 0;">
|
|
|
<u-checkbox v-model="hitem.checked" v-for="(hitem, hindex) in item.hospital" :key="hindex"
|
|
|
- :disabled="hitem.disabled"></u-checkbox>
|
|
|
+ :disabled="hitem.disabled" @change="horg(index,hindex)"></u-checkbox>
|
|
|
</view>
|
|
|
</u-checkbox-group>
|
|
|
</view>
|
| xqd
@@ -58,6 +58,7 @@
|
|
|
<view class="bottomButton" @click="modalShow=!modalShow">
|
|
|
保存
|
|
|
</view>
|
|
|
+ <u-modal v-model="modalShow" content="确定要保存?" @confirm="bc" :show-cancel-button="true"></u-modal>
|
|
|
<u-modal v-model="remindshow" content="这天是法定节假日,确定要排班吗?" @confirm="remindshow=remind=false" :show-cancel-button="true"></u-modal>
|
|
|
</view>
|
|
|
</template>
|
| xqd
@@ -68,6 +69,7 @@
|
|
|
return {
|
|
|
//标题上显示的医院。也就是当前选中医院
|
|
|
hospital:'',
|
|
|
+ hosptialId:'',
|
|
|
//弹窗
|
|
|
modalShow: false,
|
|
|
//切换历史和新增
|
| xqd
@@ -89,32 +91,23 @@
|
|
|
}],
|
|
|
//历史的排班选择
|
|
|
oldshow: false,
|
|
|
- oldlist: [{
|
|
|
- value: '1',
|
|
|
- label: '历史'
|
|
|
- }, {
|
|
|
- value: '2',
|
|
|
- label: '历史'
|
|
|
- }, {
|
|
|
- value: '3',
|
|
|
- label: '历史'
|
|
|
- }, {
|
|
|
- value: '4',
|
|
|
- label: '历史'
|
|
|
- }],
|
|
|
+ oldlist: [],
|
|
|
//新增一周的数据 title不可更改 value日期 其余 上 下 晚
|
|
|
hospitalWeek: [{
|
|
|
title: '周一',
|
|
|
value: '10-26',
|
|
|
hospital: [{
|
|
|
name: '早上',
|
|
|
+ organization_id:0,
|
|
|
checked: true,
|
|
|
disabled:true
|
|
|
}, {
|
|
|
+ organization_id:0,
|
|
|
name: '下午',
|
|
|
checked: false
|
|
|
}, {
|
|
|
name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}],
|
|
|
}, {
|
| xqd
@@ -122,12 +115,15 @@
|
|
|
value: '10-27',
|
|
|
hospital: [{
|
|
|
name: '早上',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}, {
|
|
|
name: '下午',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}, {
|
|
|
name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}],
|
|
|
}, {
|
| xqd
@@ -135,12 +131,15 @@
|
|
|
value: '10-28',
|
|
|
hospital: [{
|
|
|
name: '早上',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}, {
|
|
|
name: '下午',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}, {
|
|
|
name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}],
|
|
|
}, {
|
| xqd
@@ -148,12 +147,15 @@
|
|
|
value: '10-29',
|
|
|
hospital: [{
|
|
|
name: '早上',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}, {
|
|
|
name: '下午',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}, {
|
|
|
name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}],
|
|
|
}, {
|
| xqd
@@ -161,12 +163,15 @@
|
|
|
value: '10-30',
|
|
|
hospital: [{
|
|
|
name: '早上',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}, {
|
|
|
name: '下午',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}, {
|
|
|
name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}],
|
|
|
}, {
|
| xqd
@@ -174,12 +179,15 @@
|
|
|
value: '10-31',
|
|
|
hospital: [{
|
|
|
name: '早上',
|
|
|
- checked: false
|
|
|
+ organization_id:0,
|
|
|
+ checked: true
|
|
|
}, {
|
|
|
name: '下午',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}, {
|
|
|
name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}],
|
|
|
}, {
|
| xqd
@@ -187,81 +195,133 @@
|
|
|
value: '11-01',
|
|
|
hospital: [{
|
|
|
name: '早上',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}, {
|
|
|
name: '下午',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}, {
|
|
|
name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
checked: false
|
|
|
}],
|
|
|
}],
|
|
|
|
|
|
saveList: [{
|
|
|
- organization_id: '',
|
|
|
- schedule_date: '',
|
|
|
- per_time_num: 10,
|
|
|
- identifi: {
|
|
|
- 'zao': false,
|
|
|
- 'zhong': false,
|
|
|
- 'wan': false
|
|
|
- }
|
|
|
+ title: '周一',
|
|
|
+ value: '10-26',
|
|
|
+ hospital: [{
|
|
|
+ name: '早上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: true,
|
|
|
+ disabled:true
|
|
|
+ }, {
|
|
|
+ organization_id:0,
|
|
|
+ name: '下午',
|
|
|
+ checked: false
|
|
|
+ }, {
|
|
|
+ name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }],
|
|
|
}, {
|
|
|
- organization_id: '',
|
|
|
- schedule_date: '',
|
|
|
- per_time_num: 10,
|
|
|
- identifi: {
|
|
|
- 'zao': false,
|
|
|
- 'zhong': false,
|
|
|
- 'wan': false
|
|
|
- }
|
|
|
+ title: '周二',
|
|
|
+ value: '10-27',
|
|
|
+ hospital: [{
|
|
|
+ name: '早上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }, {
|
|
|
+ name: '下午',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }, {
|
|
|
+ name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }],
|
|
|
}, {
|
|
|
- organization_id: '',
|
|
|
- schedule_date: '',
|
|
|
- per_time_num: 10,
|
|
|
- identifi: {
|
|
|
- 'zao': false,
|
|
|
- 'zhong': false,
|
|
|
- 'wan': false
|
|
|
- }
|
|
|
+ title: '周三',
|
|
|
+ value: '10-28',
|
|
|
+ hospital: [{
|
|
|
+ name: '早上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }, {
|
|
|
+ name: '下午',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }, {
|
|
|
+ name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }],
|
|
|
}, {
|
|
|
- organization_id: '',
|
|
|
- schedule_date: '',
|
|
|
- per_time_num: 10,
|
|
|
- identifi: {
|
|
|
- 'zao': false,
|
|
|
- 'zhong': false,
|
|
|
- 'wan': false
|
|
|
- }
|
|
|
+ title: '周四',
|
|
|
+ value: '10-29',
|
|
|
+ hospital: [{
|
|
|
+ name: '早上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }, {
|
|
|
+ name: '下午',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }, {
|
|
|
+ name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }],
|
|
|
}, {
|
|
|
- organization_id: '',
|
|
|
- schedule_date: '',
|
|
|
- per_time_num: 10,
|
|
|
- identifi: {
|
|
|
- 'zao': false,
|
|
|
- 'zhong': false,
|
|
|
- 'wan': false
|
|
|
- }
|
|
|
+ title: '周五',
|
|
|
+ value: '10-30',
|
|
|
+ hospital: [{
|
|
|
+ name: '早上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }, {
|
|
|
+ name: '下午',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }, {
|
|
|
+ name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }],
|
|
|
}, {
|
|
|
- organization_id: '',
|
|
|
- schedule_date: '',
|
|
|
- per_time_num: 10,
|
|
|
- identifi: {
|
|
|
- 'zao': false,
|
|
|
- 'zhong': false,
|
|
|
- 'wan': false
|
|
|
- }
|
|
|
-
|
|
|
+ title: '周六',
|
|
|
+ value: '10-31',
|
|
|
+ hospital: [{
|
|
|
+ name: '早上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: true
|
|
|
+ }, {
|
|
|
+ name: '下午',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }, {
|
|
|
+ name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }],
|
|
|
}, {
|
|
|
- organization_id: '',
|
|
|
- schedule_date: '',
|
|
|
- per_time_num: 10,
|
|
|
- identifi: {
|
|
|
- 'zao': false,
|
|
|
- 'zhong': false,
|
|
|
- 'wan': false
|
|
|
- }
|
|
|
- }, ],
|
|
|
+ title: '周日',
|
|
|
+ value: '11-01',
|
|
|
+ hospital: [{
|
|
|
+ name: '早上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }, {
|
|
|
+ name: '下午',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }, {
|
|
|
+ name: '晚上',
|
|
|
+ organization_id:0,
|
|
|
+ checked: false
|
|
|
+ }],
|
|
|
+ }],
|
|
|
|
|
|
//历史记录的数组
|
|
|
oldWeek: [],
|
| xqd
@@ -393,11 +453,28 @@
|
|
|
this.position.time = time
|
|
|
this.hospitalshow = true
|
|
|
},
|
|
|
- //医院选择器的确认点击事件
|
|
|
- confirmhospital(e) {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 选择医院逻辑
|
|
|
+ * @author 刘远航
|
|
|
+ * @param {Object} e
|
|
|
+ */
|
|
|
+ confirmhospital:async function(e) {
|
|
|
//保存上一次操作并更换操作的医院
|
|
|
- console.log(e)
|
|
|
+ this.hosptialId = e[0].value;
|
|
|
this.hospital = e[0].label
|
|
|
+ for(let i=0;i<this.hospitalWeek.length;i++){
|
|
|
+ for(let k=0;k<this.hospitalWeek[i].hospital.length;k++){
|
|
|
+ if(this.hospitalWeek[i].hospital[k].organization_id!=0&&this.hospitalWeek[i].hospital[k].organization_id!=this.hosptialId){
|
|
|
+ this.hospitalWeek[i].hospital[k]['disabled'] = true;
|
|
|
+ }else{
|
|
|
+ if(this.hospitalWeek[i].hospital[k].flag==undefined||this.hospitalWeek[i].hospital[k].flag=='undefined'||this.hospitalWeek[i].hospital[k].flag==false){
|
|
|
+ this.hospitalWeek[i].hospital[k]['disabled'] = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|
| xqd
@@ -421,7 +498,11 @@
|
|
|
},
|
|
|
|
|
|
|
|
|
- //保存
|
|
|
+ /**
|
|
|
+ * 提交方法
|
|
|
+ * @author Liu Yh
|
|
|
+ * @param {Object} e
|
|
|
+ */
|
|
|
bc: async function(e) {
|
|
|
console.log('hospitalWeek',this.hospitalWeek)
|
|
|
let that = this;
|
| xqd
@@ -516,11 +597,20 @@
|
|
|
// return currentdate;
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * @author Liu Yh
|
|
|
+ * 时间补0
|
|
|
+ * @param {Object} obj
|
|
|
+ */
|
|
|
Appendzero(obj) {
|
|
|
if (obj < 10) return "0" + "" + obj;
|
|
|
else return obj;
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * @author Liu Yh
|
|
|
+ * 获取信息模板
|
|
|
+ */
|
|
|
getTemplate: async function() {
|
|
|
let that = this;
|
|
|
let startTime = '2020-' + that.hospitalWeek[0].value;
|
| xqd
@@ -529,34 +619,40 @@
|
|
|
'start_date': startTime,
|
|
|
'end_date': endTime
|
|
|
});
|
|
|
-
|
|
|
+ console.log(res.data);
|
|
|
if (res.status == 0) {
|
|
|
- this.fixed = res.data.save_flag
|
|
|
if (typeof res.data.list[0] != undefined && typeof res.data.list[0] != 'undefined') {
|
|
|
let data = res.data.list;
|
|
|
let arr = [];
|
|
|
-
|
|
|
for (let i = 0; i < this.hospitalWeek.length; i++) {
|
|
|
for (let p = 0; p < data.length; p++) {
|
|
|
if (this.hospitalWeek[i].value == data[p].schedule_date) {
|
|
|
- this.saveList[i].identifi.zao = data[p].type.zao_id ? data[p].type.zao_id : false;
|
|
|
- this.saveList[i].identifi.zhong = data[p].type.xia_id ? data[p].type.xia_id : false;
|
|
|
- this.saveList[i].identifi.wan = data[p].type.wan_id ? data[p].type.wan_id : false;
|
|
|
- this.hospitalWeek[i].morning = data[p].type.zao ? data[p].type.zao : '暂无';
|
|
|
- this.hospitalWeek[i].afternoon = data[p].type.xia ? data[p].type.xia : '暂无';
|
|
|
- this.hospitalWeek[i].night = data[p].type.wan ? data[p].type.wan : '暂无';
|
|
|
+ this.saveList[i].hospital[0].organization_id = data[p].type.zao_id ;
|
|
|
+ this.saveList[i].hospital[1].organization_id = data[p].type.xia_id ;
|
|
|
+ this.saveList[i].hospital[2].organization_id = data[p].type.wan_id ;
|
|
|
+
|
|
|
+ this.hospitalWeek[i].hospital[0].organization_id = data[p].type.zao_id ;
|
|
|
+ this.hospitalWeek[i].hospital[1].organization_id = data[p].type.xia_id ;
|
|
|
+ this.hospitalWeek[i].hospital[2].organization_id = data[p].type.wan_id ;
|
|
|
+ this.hospitalWeek[i].hospital[0].checked = data[p].type.zao_id==0 ? false : true;
|
|
|
+ this.hospitalWeek[i].hospital[1].checked = data[p].type.xia_id==0? false: true;
|
|
|
+ this.hospitalWeek[i].hospital[2].checked = data[p].type.wan_id==0 ? false : true;
|
|
|
+
|
|
|
+ // this.hospitalWeek[i].hospital[0]['flag'] = data[p].type.zao_flag;
|
|
|
+ // this.hospitalWeek[i].hospital[1]['flag'] = data[p].type.xia_flag;
|
|
|
+ // this.hospitalWeek[i].hospital[2]['flag'] = data[p].type.wan_flag;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
for (let i = 0; i < this.hospitalWeek.length; i++) {
|
|
|
- this.saveList[i].identifi.zao = false;
|
|
|
- this.saveList[i].identifi.zhong = false;
|
|
|
- this.saveList[i].identifi.wan = false;
|
|
|
- this.hospitalWeek[i].morning = '';
|
|
|
- this.hospitalWeek[i].afternoon = '';
|
|
|
- this.hospitalWeek[i].night = '';
|
|
|
+ this.saveList[i].hospital[0].organization_id = 0;
|
|
|
+ this.saveList[i].hospital[1].organization_id = 0;
|
|
|
+ this.saveList[i].hospital[2].organization_id = 0;
|
|
|
+ this.hospitalWeek[i].hospital[0].checked = false;
|
|
|
+ this.hospitalWeek[i].hospital[1].checked = false;
|
|
|
+ this.hospitalWeek[i].hospital[2].checked = false;
|
|
|
}
|
|
|
}
|
|
|
}
|
| xqd
@@ -564,6 +660,40 @@
|
|
|
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * change事件
|
|
|
+ * @author Liu Yh
|
|
|
+ * @param {Object} index
|
|
|
+ * @param {Object} hindex
|
|
|
+ */
|
|
|
+ horg(index,hindex){
|
|
|
+ if(this.hosptialId==''){
|
|
|
+ uni.showModal({
|
|
|
+ title:'先选择医院否则无法提交',
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(this.hospitalWeek[index].hospital[hindex].organization_id!=0&&this.hospitalWeek[index].hospital[hindex].organization_id!=this.hosptialId){
|
|
|
+ this.hospitalWeek[index].hospital[hindex]['disabled'] = true;
|
|
|
+ }else{
|
|
|
+ this.hospitalWeek[index].hospital[hindex]['disabled'] = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!this.hospitalWeek[index].hospital[hindex]['checked']==false){
|
|
|
+ this.hospitalWeek[index].hospital[hindex].organization_id=0
|
|
|
+ }else{
|
|
|
+ this.hospitalWeek[index].hospital[hindex].organization_id = this.hosptialId;
|
|
|
+ }
|
|
|
+ var saveList = this.saveList
|
|
|
+ var lists;
|
|
|
+ let yeares = new Date().toISOString().slice(0, 4);
|
|
|
+ // 医院的id
|
|
|
+ saveList[index].hospital[hindex].organization_id = this.hospitalWeek[index].hospital[hindex].organization_id;
|
|
|
+ // 是否选中 因为是change不同步所以区反
|
|
|
+ saveList[index].hospital[hindex].checked = !this.hospitalWeek[index].hospital[hindex].checked;
|
|
|
+ // 日期
|
|
|
+ saveList[index].value = yeares+'-'+this.hospitalWeek[index].value
|
|
|
+ },
|
|
|
/**
|
|
|
* 获取医院
|
|
|
*/
|
| xqd
@@ -576,12 +706,13 @@
|
|
|
console.log('我是医院', res);
|
|
|
//默认选中第一个医院
|
|
|
this.hospital = res.data[0].label
|
|
|
+ this.hosptialId = res.data[0].value
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
+ this.gethospitalList();
|
|
|
this.getTime();
|
|
|
- this.gethospitalList();
|
|
|
- this.getOldList();
|
|
|
+ // this.getOldList();
|
|
|
this.cliold()
|
|
|
console.log(this.time)
|
|
|
},
|