| xqd
@@ -7,76 +7,121 @@
|
|
|
<!-- 医院 -->
|
|
|
<u-select v-model="hospitalshow" :list="hospitalList" @confirm="confirmhospital"></u-select>
|
|
|
<!-- 新增-->
|
|
|
- <view style="padding: 30rpx 35rpx;" class="flex justify-between" v-if="!old">
|
|
|
- <view style="color: #666666;" @click="show = true">
|
|
|
- <text style="margin-right: 20rpx;">选择排班周</text>
|
|
|
- <u-icon name="arrow-down" color="#666666" size="28" v-if="!show"></u-icon>
|
|
|
- <u-icon name="arrow-up" color="#666666" size="28" v-else></u-icon>
|
|
|
+ <view v-if="!old">
|
|
|
+ <view style="padding: 30rpx 35rpx;" class="flex justify-between">
|
|
|
+ <view style="color: #666666;" @click="show = true">
|
|
|
+ <text style="margin-right: 20rpx;">选择排班周</text>
|
|
|
+ <u-icon name="arrow-down" color="#666666" size="28" v-if="!show"></u-icon>
|
|
|
+ <u-icon name="arrow-up" color="#666666" size="28" v-else></u-icon>
|
|
|
+ </view>
|
|
|
+ <view style="color: #666666;" @click="old = true">历史排班</view>
|
|
|
</view>
|
|
|
- <view style="color: #666666;" @click="old = true">历史排班</view>
|
|
|
- </view>
|
|
|
|
|
|
-
|
|
|
- <!-- 历史 -->
|
|
|
- <view style="padding: 30rpx 35rpx;" class="flex justify-between" v-else>
|
|
|
- <view style="color: #666666;" @click="oldshow = true">
|
|
|
- <text style="margin-right: 20rpx;">选择历史排班周</text>
|
|
|
- <u-icon name="arrow-down" color="#666666" size="28" v-if="!show"></u-icon>
|
|
|
- <u-icon name="arrow-up" color="#666666" size="28" v-else></u-icon>
|
|
|
+ <!-- 标题 -->
|
|
|
+ <view class="flex" style="background-color: #FFFFFF;">
|
|
|
+ <!-- 时间 -->
|
|
|
+ <view class="title" style="width: 20%;">时间</view>
|
|
|
+ <u-line color="#cecece" direction="col" />
|
|
|
+ <!-- 上午 -->
|
|
|
+ <view class="title" style="width: 26%;">上午</view>
|
|
|
+ <u-line color="#cecece" direction="col" />
|
|
|
+ <!-- 下午 -->
|
|
|
+ <view class="title" style="width: 26%;">下午</view>
|
|
|
+ <u-line color="#cecece" direction="col" />
|
|
|
+ <!-- 晚上 -->
|
|
|
+ <view class="title" style="width: 26%;">晚上</view>
|
|
|
</view>
|
|
|
- <view style="color: #666666;" @click="old=false">新增排班</view>
|
|
|
- </view>
|
|
|
|
|
|
- <!-- 标题 -->
|
|
|
- <view class="flex" style="background-color: #FFFFFF;">
|
|
|
- <!-- 时间 -->
|
|
|
- <view class="title" style="width: 20%;">时间</view>
|
|
|
- <u-line color="#cecece" direction="col" />
|
|
|
- <!-- 上午 -->
|
|
|
- <view class="title" style="width: 26%;">上午</view>
|
|
|
- <u-line color="#cecece" direction="col" />
|
|
|
- <!-- 下午 -->
|
|
|
- <view class="title" style="width: 26%;">下午</view>
|
|
|
- <u-line color="#cecece" direction="col" />
|
|
|
- <!-- 晚上 -->
|
|
|
- <view class="title" style="width: 26%;">晚上</view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- 表格一条内容 循环七遍-->
|
|
|
- <view v-for="(item,index) in hospitalWeek" :key='index'>
|
|
|
- <u-line color="#cecece" />
|
|
|
- <!-- 星期一 -->
|
|
|
- <view class="flex" style="background-color: #FFFFFF;">
|
|
|
+ <!-- 表格一条内容 循环七遍-->
|
|
|
+ <view v-for="(item,index) in hospitalWeek" :key='index'>
|
|
|
+ <u-line color="#cecece" />
|
|
|
+ <!-- 星期一 -->
|
|
|
+ <view class="flex" style="background-color: #FFFFFF;">
|
|
|
|
|
|
- <view class="content" style="width: 20%;font-weight: bold;">
|
|
|
- <view>
|
|
|
- <view style="text-align: center;">{{item.value}}</view>
|
|
|
- <view style="text-align: center;">{{item.title}}</view>
|
|
|
+ <view class="content" style="width: 20%;font-weight: bold;">
|
|
|
+ <view>
|
|
|
+ <view style="text-align: center;">{{item.value}}</view>
|
|
|
+ <view style="text-align: center;">{{item.title}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+ <u-line color="#cecece" direction="col" />
|
|
|
+ <!-- 上午 -->
|
|
|
+ <view class="content" style="width: 26%;" @click="clickMorning(index)">
|
|
|
+ <view style="width: 80%;text-align: center;word-break:break-all">{{item.morning}}</view>
|
|
|
+ <u-icon name="arrow-down" color="#999999" size="28"></u-icon>
|
|
|
+ </view>
|
|
|
+ <u-line color="#cecece" direction="col" />
|
|
|
+ <!-- 下午 -->
|
|
|
+ <view class="content" style="width: 26%;" @click="clickAfternoon(index)">
|
|
|
+ <view style="width: 80%;text-align: center;word-break:break-all">{{item.afternoon}}</view>
|
|
|
+ <u-icon name="arrow-down" color="#999999" size="28"></u-icon>
|
|
|
+ </view>
|
|
|
+ <u-line color="#cecece" direction="col" />
|
|
|
+ <!-- 晚上 -->
|
|
|
+ <view class="content" style="width: 26%;" @click="clicknight(index)">
|
|
|
+ <view style="width: 80%;text-align: center;word-break:break-all">{{item.night}}</view>
|
|
|
+ <u-icon name="arrow-down" color="#999999" size="28"></u-icon>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 历史 -->
|
|
|
+ <view v-else>
|
|
|
+ <view style="padding: 30rpx 35rpx;" class="flex justify-between">
|
|
|
+ <view style="color: #666666;" @click="oldshow = true">
|
|
|
+ <text style="margin-right: 20rpx;">选择历史排班周</text>
|
|
|
+ <u-icon name="arrow-down" color="#666666" size="28" v-if="!show"></u-icon>
|
|
|
+ <u-icon name="arrow-up" color="#666666" size="28" v-else></u-icon>
|
|
|
</view>
|
|
|
+ <view style="color: #666666;" @click="old=false">新增排班</view>
|
|
|
+ </view>
|
|
|
+ <view class="flex" style="background-color: #FFFFFF;">
|
|
|
+ <!-- 时间 -->
|
|
|
+ <view class="title" style="width: 20%;">时间</view>
|
|
|
<u-line color="#cecece" direction="col" />
|
|
|
<!-- 上午 -->
|
|
|
- <view class="content" style="width: 26%;" @click="clickMorning(index)">
|
|
|
- <view style="width: 80%;text-align: center;word-break:break-all">{{item.morning}}</view>
|
|
|
- <u-icon name="arrow-down" color="#999999" size="28"></u-icon>
|
|
|
- </view>
|
|
|
+ <view class="title" style="width: 26%;">上午</view>
|
|
|
<u-line color="#cecece" direction="col" />
|
|
|
<!-- 下午 -->
|
|
|
- <view class="content" style="width: 26%;" @click="clickAfternoon(index)">
|
|
|
- <view style="width: 80%;text-align: center;word-break:break-all">{{item.afternoon}}</view>
|
|
|
- <u-icon name="arrow-down" color="#999999" size="28"></u-icon>
|
|
|
- </view>
|
|
|
+ <view class="title" style="width: 26%;">下午</view>
|
|
|
<u-line color="#cecece" direction="col" />
|
|
|
<!-- 晚上 -->
|
|
|
- <view class="content" style="width: 26%;" @click="clicknight(index)">
|
|
|
- <view style="width: 80%;text-align: center;word-break:break-all">{{item.night}}</view>
|
|
|
- <u-icon name="arrow-down" color="#999999" size="28"></u-icon>
|
|
|
+ <view class="title" style="width: 26%;">晚上</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 表格一条内容 循环七遍-->
|
|
|
+ <view v-for="(item,index) in oldWeek" :key='index'>
|
|
|
+ <u-line color="#cecece" />
|
|
|
+ <!-- 星期一 -->
|
|
|
+ <view class="flex" style="background-color: #FFFFFF;">
|
|
|
+
|
|
|
+ <view class="content" style="width: 20%;font-weight: bold;">
|
|
|
+ <view>
|
|
|
+ <view style="text-align: center;">{{item.value}}</view>
|
|
|
+ <view style="text-align: center;">{{item.title}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <u-line color="#cecece" direction="col" />
|
|
|
+ <!-- 上午 -->
|
|
|
+ <view class="content" style="width: 26%;" >
|
|
|
+ <view style="width: 80%;text-align: center;word-break:break-all">{{item.morning}}</view>
|
|
|
+ </view>
|
|
|
+ <u-line color="#cecece" direction="col" />
|
|
|
+ <!-- 下午 -->
|
|
|
+ <view class="content" style="width: 26%;" >
|
|
|
+ <view style="width: 80%;text-align: center;word-break:break-all">{{item.afternoon}}</view>
|
|
|
+ </view>
|
|
|
+ <u-line color="#cecece" direction="col" />
|
|
|
+ <!-- 晚上 -->
|
|
|
+ <view class="content" style="width: 26%;" >
|
|
|
+ <view style="width: 80%;text-align: center;word-break:break-all">{{item.night}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
<!-- 保存 -->
|
|
|
- <view class="bottomButton" @click="bc">
|
|
|
+ <view class="bottomButton" @click="bc" v-if="!old">
|
|
|
保存
|
|
|
</view>
|
|
|
|
| xqd
@@ -85,8 +130,14 @@
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
+ onLoad() {
|
|
|
+ this.time = this.getTime();
|
|
|
+ console.log(this.time)
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ //时间
|
|
|
+ time:'',
|
|
|
//切换历史和新增
|
|
|
old: false,
|
|
|
//新增的排班选择 最多排四周
|
| xqd
@@ -119,7 +170,7 @@
|
|
|
value: '4',
|
|
|
label: '历史'
|
|
|
}],
|
|
|
- //一周的数据 title不可更改 value日期 其余 上 下 晚
|
|
|
+ //新增一周的数据 title不可更改 value日期 其余 上 下 晚
|
|
|
hospitalWeek: [{
|
|
|
title: '周一',
|
|
|
value: '10-26',
|
| xqd
@@ -163,6 +214,50 @@
|
|
|
afternoon: '',
|
|
|
night: ''
|
|
|
}],
|
|
|
+ //历史记录的数组
|
|
|
+ oldWeek: [{
|
|
|
+ title: '周一',
|
|
|
+ value: '10-26',
|
|
|
+ morning: '历史',
|
|
|
+ afternoon: '历史',
|
|
|
+ night: '历史'
|
|
|
+ }, {
|
|
|
+ title: '周二',
|
|
|
+ value: '10-27',
|
|
|
+ morning: '历史',
|
|
|
+ afternoon: '历史',
|
|
|
+ night: '历史'
|
|
|
+ }, {
|
|
|
+ title: '周三',
|
|
|
+ value: '10-28',
|
|
|
+ morning: '历史',
|
|
|
+ afternoon: '历史',
|
|
|
+ night: '历史'
|
|
|
+ }, {
|
|
|
+ title: '周四',
|
|
|
+ value: '10-29',
|
|
|
+ morning: '历史',
|
|
|
+ afternoon: '历史',
|
|
|
+ night: '历史'
|
|
|
+ }, {
|
|
|
+ title: '周五',
|
|
|
+ value: '10-30',
|
|
|
+ morning: '历史',
|
|
|
+ afternoon: '历史',
|
|
|
+ night: '历史'
|
|
|
+ }, {
|
|
|
+ title: '周六',
|
|
|
+ value: '10-31',
|
|
|
+ morning: '历史',
|
|
|
+ afternoon: '历史',
|
|
|
+ night: '历史'
|
|
|
+ }, {
|
|
|
+ title: '周日',
|
|
|
+ value: '11-01',
|
|
|
+ morning: '历史',
|
|
|
+ afternoon: '历史',
|
|
|
+ night: '历史'
|
|
|
+ }],
|
|
|
//选择医院
|
|
|
hospital: '',
|
|
|
hospitalList: [{
|
| xqd
@@ -183,7 +278,15 @@
|
|
|
position: {
|
|
|
day: '',
|
|
|
time: '' //1早2下3晚
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ nowTime: new Date(), // 当前时间
|
|
|
+ nowWeek: '星期', //星期几
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
| xqd
@@ -224,6 +327,35 @@
|
|
|
//保存
|
|
|
bc(e) {
|
|
|
console.log(hospitalWeek)
|
|
|
+ },
|
|
|
+ //获取时间
|
|
|
+ getTime(){
|
|
|
+ var date = new Date();
|
|
|
+ var seperator1 = "-";
|
|
|
+ var seperator2 = ":";
|
|
|
+ //以下代码依次是获取当前时间的年月日时分秒
|
|
|
+ var year = date.getFullYear();
|
|
|
+ var month = date.getMonth() + 1;
|
|
|
+ var strDate = date.getDate();
|
|
|
+ var minute = date.getMinutes();
|
|
|
+ var hour = date.getHours();
|
|
|
+ var second = date.getSeconds();
|
|
|
+ //固定时间格式
|
|
|
+ if (month >= 1 && month <= 9) {
|
|
|
+ month = "0" + month;
|
|
|
+ }
|
|
|
+ if (strDate >= 0 && strDate <= 9) {
|
|
|
+ strDate = "0" + strDate;
|
|
|
+ }
|
|
|
+ var currentdate = year + seperator1 + month + seperator1 + strDate
|
|
|
+
|
|
|
+
|
|
|
+ var dateArray = nowTime.split("-");
|
|
|
+ var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
|
|
|
+ var week = "星期" + "日一二三四五六".charAt(date.getDay());
|
|
|
+ this.nowWeek = week // 赋值本地数据
|
|
|
+ alert(week)
|
|
|
+ return currentdate;
|
|
|
}
|
|
|
}
|
|
|
}
|