|
|
@@ -13,14 +13,14 @@
|
|
|
<!-- 选择状态 -->
|
|
|
<van-radio-group :disabled="formData.isDisabled" v-model="formData.isEnable">
|
|
|
<van-cell-group>
|
|
|
- <van-cell title="营业" clickable @click="formData.isDisabled?null: changeRadio(1)">
|
|
|
+ <van-cell title="营业" clickable @click="formData.isDisabled?null: changeRadio('1')">
|
|
|
<template #right-icon>
|
|
|
- <van-radio :name="1" />
|
|
|
+ <van-radio name="1" />
|
|
|
</template>
|
|
|
</van-cell>
|
|
|
- <van-cell title="歇业" clickable @click="formData.isDisabled?null: changeRadio(0)">
|
|
|
+ <van-cell title="歇业" clickable @click="formData.isDisabled?null: changeRadio('0')">
|
|
|
<template #right-icon>
|
|
|
- <van-radio :name="0" />
|
|
|
+ <van-radio name="0" />
|
|
|
</template>
|
|
|
</van-cell>
|
|
|
</van-cell-group>
|
|
|
@@ -28,8 +28,8 @@
|
|
|
|
|
|
<!-- 选择时间 -->
|
|
|
<van-cell-group >
|
|
|
- <date-cell :disabled="formData.isDisabled || !formData.isEnable" title="营业开始" v-model="formData.openTime" @change="startChange" date-type="time"></date-cell>
|
|
|
- <date-cell :disabled="formData.isDisabled || !formData.isEnable" title="营业结束" @change="endChange" v-model="formData.closeTime" date-type="time"></date-cell>
|
|
|
+ <hours-cell :disabled="formData.isDisabled || !formData.isEnable || formData.isEnable =='0'" title="营业开始" v-model="formData.openTime"></hours-cell>
|
|
|
+ <hours-cell :disabled="formData.isDisabled || !formData.isEnable || formData.isEnable =='0'" title="营业结束" v-model="formData.closeTime"></hours-cell>
|
|
|
<!-- 操作 -->
|
|
|
</van-cell-group>
|
|
|
<van-cell center title="是否复制到全月" v-if="!formData.isDisabled">
|
|
|
@@ -47,14 +47,14 @@
|
|
|
import NavBar from '@/components/NavBar';
|
|
|
import Calendar from '@/components/Calendar';
|
|
|
import OrgTree from '@/components/orgTree';
|
|
|
-import DateCell from '@/components/dateCell';
|
|
|
+import HoursCell from '@/components/HoursCell';
|
|
|
import {mapGetters} from "vuex";
|
|
|
import {deptTreeList} from "@/api/public";
|
|
|
import {editWorkTime} from "@/views/menu/workTime/api";
|
|
|
import {timeCheck} from "@/utils/date"
|
|
|
import {dataList} from "@/views/menu/educationStatistics/api";
|
|
|
export default {
|
|
|
- components:{NavBar,Calendar,OrgTree,DateCell},
|
|
|
+ components:{NavBar,Calendar,OrgTree,HoursCell},
|
|
|
data(){
|
|
|
return{
|
|
|
// orgInfo:{
|
|
|
@@ -62,8 +62,8 @@ export default {
|
|
|
// orgName:null,
|
|
|
// },
|
|
|
formData:{
|
|
|
- workTime:null,
|
|
|
- workOffTime:null,
|
|
|
+ openTime:null,
|
|
|
+ closeTime:null,
|
|
|
isEnable:null,
|
|
|
ymdDate:null,
|
|
|
isDisabled:false,
|
|
|
@@ -94,13 +94,11 @@ export default {
|
|
|
...mapGetters(['orgName','orgId']),
|
|
|
},
|
|
|
methods:{
|
|
|
- startChange(){
|
|
|
-
|
|
|
- },
|
|
|
- endChange(){},
|
|
|
//切换状态
|
|
|
changeRadio(s){
|
|
|
this.formData.isEnable = s;
|
|
|
+ this.formData.openTime = null;
|
|
|
+ this.formData.closeTime = null;
|
|
|
},
|
|
|
//获取复制的数据
|
|
|
getCopyData(arr){
|
|
|
@@ -111,30 +109,30 @@ export default {
|
|
|
this.$refs.calendar.copyMouth(this.formData);
|
|
|
this.isCopy = true;
|
|
|
},
|
|
|
- //获取机构树
|
|
|
- getTreeList(){
|
|
|
- deptTreeList(this.orgId).then(res=>{
|
|
|
- this.options = res.data;
|
|
|
- this.orgInfo.orgId = this.orgId;
|
|
|
- this.orgInfo.orgName = this.orgName;
|
|
|
- console.log(res,'3333')
|
|
|
- })
|
|
|
- },
|
|
|
- //改变机构后将重新发起请求
|
|
|
- changeTree({selectedOptions}){
|
|
|
- console.log(selectedOptions,'aaaaaa')
|
|
|
- this.formData.orgId = selectedOptions[selectedOptions.length-1].id;
|
|
|
- this.formData.orgName = selectedOptions[selectedOptions.length-1].name;
|
|
|
- },
|
|
|
+ // //获取机构树
|
|
|
+ // getTreeList(){
|
|
|
+ // deptTreeList(this.orgId).then(res=>{
|
|
|
+ // this.options = res.data;
|
|
|
+ // this.orgInfo.orgId = this.orgId;
|
|
|
+ // this.orgInfo.orgName = this.orgName;
|
|
|
+ // console.log(res,'3333')
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // //改变机构后将重新发起请求
|
|
|
+ // changeTree({selectedOptions}){
|
|
|
+ // console.log(selectedOptions,'aaaaaa')
|
|
|
+ // this.formData.orgId = selectedOptions[selectedOptions.length-1].id;
|
|
|
+ // this.formData.orgName = selectedOptions[selectedOptions.length-1].name;
|
|
|
+ // },
|
|
|
// 全部选项选择完毕后,会触发 finish 事件
|
|
|
- onFinish({ selectedOptions }) {
|
|
|
- this.showOrg = false;
|
|
|
- this.fieldValue = selectedOptions.map((option) => option.text).join('/');
|
|
|
- },
|
|
|
- //显示机构选择
|
|
|
- showPopup() {
|
|
|
- this.showOrg = true;
|
|
|
- },
|
|
|
+ // onFinish({ selectedOptions }) {
|
|
|
+ // this.showOrg = false;
|
|
|
+ // this.fieldValue = selectedOptions.map((option) => option.text).join('/');
|
|
|
+ // },
|
|
|
+ // //显示机构选择
|
|
|
+ // showPopup() {
|
|
|
+ // this.showOrg = true;
|
|
|
+ // },
|
|
|
//提交
|
|
|
onsubmit(){
|
|
|
if(!this.formData.orgId) return this.$toast('请选择机构');
|
|
|
@@ -153,10 +151,10 @@ export default {
|
|
|
if(this.formData.isEnable === null){
|
|
|
return this.$toast('请选择营业状态');
|
|
|
}else {
|
|
|
- if(this.formData.isEnable){
|
|
|
+ if(this.formData.isEnable == '1'){
|
|
|
if(!this.formData.openTime) return this.$toast('请选择开始时间');
|
|
|
if(!this.formData.closeTime) return this.$toast('请选择结束时间');
|
|
|
- if(!timeCheck([this.formData.workTime,this.formData.workOffTime])) return this.$toast('开始时间不能大于结束时间');
|
|
|
+ if(!timeCheck([this.formData.openTime,this.formData.closeTime])) return this.$toast('开始时间不能大于结束时间');
|
|
|
}
|
|
|
}
|
|
|
let data = {
|