|
@@ -1,189 +1,208 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="question-infos">
|
|
<div class="question-infos">
|
|
|
- <DialogCom title="新增作息" @close="handleClose" :visible.sync="isShow" :close-on-click-modal="false"
|
|
|
|
|
- custom-class="gxDialog" width="1320px" append-to-body>
|
|
|
|
|
-<!-- <div class="p-5 work-time">-->
|
|
|
|
|
- <el-form label-width="90px" label-suffix="" label-position="right">
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item label="分配机构">
|
|
|
|
|
- <org-tree-select ref="orgTreeSelect" :checkShow="true" v-model="orgIdList"></org-tree-select>
|
|
|
|
|
- </el-form-item >
|
|
|
|
|
- <el-form-item label="调整日期">
|
|
|
|
|
- <el-button type="primary" @click="addData">新增日期</el-button>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <!-- -->
|
|
|
|
|
- <el-form-item label="作息规则">
|
|
|
|
|
- <el-table class="w-auto" height="350" border :data="workTimeList">
|
|
|
|
|
- <el-table-column label="日期" width="160" align="center">
|
|
|
|
|
- <template slot-scope="r" >
|
|
|
|
|
- <el-date-picker
|
|
|
|
|
|
|
+ <DialogCom
|
|
|
|
|
+ title="新增作息"
|
|
|
|
|
+ @close="handleClose"
|
|
|
|
|
+ :visible.sync="isShow"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ custom-class="gxDialog"
|
|
|
|
|
+ width="1320px"
|
|
|
|
|
+ append-to-body
|
|
|
|
|
+ >
|
|
|
|
|
+ <!-- <div class="p-5 work-time">-->
|
|
|
|
|
+ <el-form label-width="90px" label-suffix="" label-position="right">
|
|
|
|
|
+ <el-form-item label="分配机构">
|
|
|
|
|
+ <org-tree-select
|
|
|
|
|
+ ref="orgTreeSelect"
|
|
|
|
|
+ :checkShow="true"
|
|
|
|
|
+ v-model="orgIdList"
|
|
|
|
|
+ ></org-tree-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="调整日期">
|
|
|
|
|
+ <el-button type="primary" @click="addData">新增日期</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <!-- -->
|
|
|
|
|
+ <el-form-item label="作息规则">
|
|
|
|
|
+ <el-table class="w-auto" height="350" border :data="workTimeList">
|
|
|
|
|
+ <el-table-column label="日期" width="160" align="center">
|
|
|
|
|
+ <template slot-scope="r">
|
|
|
|
|
+ <el-date-picker
|
|
|
:default-timezone="'GMT+8'"
|
|
:default-timezone="'GMT+8'"
|
|
|
- style="width: 100%"
|
|
|
|
|
- v-model="r.row.ymdDate"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- :clearable=false
|
|
|
|
|
- popper-class="no-atTheMoment"
|
|
|
|
|
- :picker-options="startDatepickerOptions"
|
|
|
|
|
- type="date"
|
|
|
|
|
- placeholder="请选择日期">
|
|
|
|
|
- </el-date-picker>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="星期" width="80" align="center">
|
|
|
|
|
- <template slot-scope="r">
|
|
|
|
|
- <span>{{parseTime(r.row.ymdDate ,'dddd')}}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="状态" width="160" align="center">
|
|
|
|
|
- <template slot-scope="r">
|
|
|
|
|
-<!-- <el-switch-->
|
|
|
|
|
-<!-- v-model="r.row.isEnable"-->
|
|
|
|
|
-<!-- :active-value="1"-->
|
|
|
|
|
-<!-- :inactive-value="0"-->
|
|
|
|
|
-<!-- @change="onEnableChange(r.row)"-->
|
|
|
|
|
-<!-- active-text="营业"-->
|
|
|
|
|
-<!-- inactive-text="歇业">-->
|
|
|
|
|
-<!-- </el-switch>-->
|
|
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ v-model="r.row.ymdDate"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :clearable="false"
|
|
|
|
|
+ popper-class="no-atTheMoment"
|
|
|
|
|
+ :picker-options="startDatepickerOptions"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ placeholder="请选择日期"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-date-picker>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="星期" width="80" align="center">
|
|
|
|
|
+ <template slot-scope="r">
|
|
|
|
|
+ <span>{{ parseTime(r.row.ymdDate, "dddd") }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="状态" width="160" align="center">
|
|
|
|
|
+ <template slot-scope="r">
|
|
|
|
|
+ <!-- <el-switch-->
|
|
|
|
|
+ <!-- v-model="r.row.isEnable"-->
|
|
|
|
|
+ <!-- :active-value="1"-->
|
|
|
|
|
+ <!-- :inactive-value="0"-->
|
|
|
|
|
+ <!-- @change="onEnableChange(r.row)"-->
|
|
|
|
|
+ <!-- active-text="营业"-->
|
|
|
|
|
+ <!-- inactive-text="歇业">-->
|
|
|
|
|
+ <!-- </el-switch>-->
|
|
|
|
|
|
|
|
- <el-radio-group
|
|
|
|
|
- :disabled="r.row.disabled"
|
|
|
|
|
- v-model="r.row.isEnable"
|
|
|
|
|
- @change="onEnableChange(r.row)">
|
|
|
|
|
- <el-radio text-color="#48bb78" :label="1">营业</el-radio>
|
|
|
|
|
- <el-radio text-color="#f56565" :label="0">歇业</el-radio>
|
|
|
|
|
- </el-radio-group>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="是否值班打卡" width="160" align="center">
|
|
|
|
|
- <template slot-scope="r">
|
|
|
|
|
- <el-switch
|
|
|
|
|
|
|
+ <el-radio-group
|
|
|
|
|
+ :disabled="r.row.disabled"
|
|
|
|
|
+ v-model="r.row.isEnable"
|
|
|
|
|
+ @change="onEnableChange(r.row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-radio text-color="#48bb78" :label="1">营业</el-radio>
|
|
|
|
|
+ <el-radio text-color="#f56565" :label="0">歇业</el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="是否值班打卡" width="160" align="center">
|
|
|
|
|
+ <template slot-scope="r">
|
|
|
|
|
+ <el-switch
|
|
|
v-model="r.row.isDuty"
|
|
v-model="r.row.isDuty"
|
|
|
:active-value="1"
|
|
:active-value="1"
|
|
|
:inactive-value="0"
|
|
:inactive-value="0"
|
|
|
@change="onEnableChange(r.row)"
|
|
@change="onEnableChange(r.row)"
|
|
|
active-text="是"
|
|
active-text="是"
|
|
|
- inactive-text="否">
|
|
|
|
|
|
|
+ inactive-text="否"
|
|
|
|
|
+ >
|
|
|
</el-switch>
|
|
</el-switch>
|
|
|
|
|
|
|
|
-<!-- <el-radio-group-->
|
|
|
|
|
-<!-- :disabled="r.row.disabled"-->
|
|
|
|
|
-<!-- v-model="r.row.isEnable"-->
|
|
|
|
|
-<!-- @change="onEnableChange(r.row)">-->
|
|
|
|
|
-<!-- <el-radio text-color="#48bb78" :label="1">营业</el-radio>-->
|
|
|
|
|
-<!-- <el-radio text-color="#f56565" :label="0">歇业</el-radio>-->
|
|
|
|
|
-<!-- </el-radio-group>-->
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="上班时间" width="120" align="center">
|
|
|
|
|
- <template slot-scope="r">
|
|
|
|
|
- <el-time-select
|
|
|
|
|
- style="width: 100%"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- :picker-options="pickerOptions"
|
|
|
|
|
- :disabled="r.row.disabled || !r.row.isEnable"
|
|
|
|
|
- v-model="r.row.workTime"/>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="营业开始" width="120" align="center">
|
|
|
|
|
- <template slot-scope="r">
|
|
|
|
|
- <el-time-select
|
|
|
|
|
- style="width: 100%;"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- :picker-options="pickerOptions"
|
|
|
|
|
- :disabled="r.row.disabled || !r.row.isEnable"
|
|
|
|
|
- v-model="r.row.openTime"/>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
-<!-- <el-table-column label="午休开始">-->
|
|
|
|
|
-<!-- <template slot-scope="r">-->
|
|
|
|
|
-<!-- <el-time-select-->
|
|
|
|
|
-<!-- style="width: 100%"-->
|
|
|
|
|
-<!-- size="mini"-->
|
|
|
|
|
-<!-- :picker-options="pickerOptions"-->
|
|
|
|
|
-<!-- :disabled="r.row.disabled || !r.row.isEnable"-->
|
|
|
|
|
-<!-- v-model="r.row.noonbreakStart"/>-->
|
|
|
|
|
-<!-- </template>-->
|
|
|
|
|
-<!-- </el-table-column>-->
|
|
|
|
|
-<!-- <el-table-column label="午休结束">-->
|
|
|
|
|
-<!-- <template slot-scope="r">-->
|
|
|
|
|
-<!-- <el-time-select-->
|
|
|
|
|
-<!-- style="width: 100%"-->
|
|
|
|
|
-<!-- size="mini"-->
|
|
|
|
|
-<!-- :picker-options="pickerOptions"-->
|
|
|
|
|
-<!-- :disabled="r.row.disabled || !r.row.isEnable"-->
|
|
|
|
|
-<!-- v-model="r.row.noonbreakEnd"/>-->
|
|
|
|
|
-<!-- </template>-->
|
|
|
|
|
-<!-- </el-table-column>-->
|
|
|
|
|
- <el-table-column label="营业结束" width="120" align="center">
|
|
|
|
|
- <template slot-scope="r">
|
|
|
|
|
- <el-time-select
|
|
|
|
|
- style="width: 100%"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- :picker-options="pickerOptions"
|
|
|
|
|
- :disabled="r.row.disabled || !r.row.isEnable"
|
|
|
|
|
- v-model="r.row.closeTime"/>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="下班时间" width="120" align="center">
|
|
|
|
|
- <template slot-scope="r">
|
|
|
|
|
- <el-time-select
|
|
|
|
|
- style="width: 100%"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- :picker-options="pickerOptions"
|
|
|
|
|
- :disabled="r.row.disabled || !r.row.isEnable"
|
|
|
|
|
- v-model="r.row.workOffTime"/>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="操作列表" width="140" align="center">
|
|
|
|
|
- <template slot-scope="r">
|
|
|
|
|
- <btn-tip type="text" @click="deleteData(r.row,r.$index)">删除</btn-tip>
|
|
|
|
|
- <el-button type="text" @click="coppy(r.$index)">复制至全部</el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
-<!-- </div>-->
|
|
|
|
|
|
|
+ <!-- <el-radio-group-->
|
|
|
|
|
+ <!-- :disabled="r.row.disabled"-->
|
|
|
|
|
+ <!-- v-model="r.row.isEnable"-->
|
|
|
|
|
+ <!-- @change="onEnableChange(r.row)">-->
|
|
|
|
|
+ <!-- <el-radio text-color="#48bb78" :label="1">营业</el-radio>-->
|
|
|
|
|
+ <!-- <el-radio text-color="#f56565" :label="0">歇业</el-radio>-->
|
|
|
|
|
+ <!-- </el-radio-group>-->
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="上班时间" width="120" align="center">
|
|
|
|
|
+ <template slot-scope="r">
|
|
|
|
|
+ <el-time-select
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :picker-options="pickerOptions"
|
|
|
|
|
+ :disabled="r.row.disabled || !r.row.isEnable"
|
|
|
|
|
+ v-model="r.row.workTime"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="营业开始" width="120" align="center">
|
|
|
|
|
+ <template slot-scope="r">
|
|
|
|
|
+ <el-time-select
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :picker-options="pickerOptions"
|
|
|
|
|
+ :disabled="r.row.disabled || !r.row.isEnable"
|
|
|
|
|
+ v-model="r.row.openTime"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <!-- <el-table-column label="午休开始">-->
|
|
|
|
|
+ <!-- <template slot-scope="r">-->
|
|
|
|
|
+ <!-- <el-time-select-->
|
|
|
|
|
+ <!-- style="width: 100%"-->
|
|
|
|
|
+ <!-- size="mini"-->
|
|
|
|
|
+ <!-- :picker-options="pickerOptions"-->
|
|
|
|
|
+ <!-- :disabled="r.row.disabled || !r.row.isEnable"-->
|
|
|
|
|
+ <!-- v-model="r.row.noonbreakStart"/>-->
|
|
|
|
|
+ <!-- </template>-->
|
|
|
|
|
+ <!-- </el-table-column>-->
|
|
|
|
|
+ <!-- <el-table-column label="午休结束">-->
|
|
|
|
|
+ <!-- <template slot-scope="r">-->
|
|
|
|
|
+ <!-- <el-time-select-->
|
|
|
|
|
+ <!-- style="width: 100%"-->
|
|
|
|
|
+ <!-- size="mini"-->
|
|
|
|
|
+ <!-- :picker-options="pickerOptions"-->
|
|
|
|
|
+ <!-- :disabled="r.row.disabled || !r.row.isEnable"-->
|
|
|
|
|
+ <!-- v-model="r.row.noonbreakEnd"/>-->
|
|
|
|
|
+ <!-- </template>-->
|
|
|
|
|
+ <!-- </el-table-column>-->
|
|
|
|
|
+ <el-table-column label="营业结束" width="120" align="center">
|
|
|
|
|
+ <template slot-scope="r">
|
|
|
|
|
+ <el-time-select
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :picker-options="pickerOptions"
|
|
|
|
|
+ :disabled="r.row.disabled || !r.row.isEnable"
|
|
|
|
|
+ v-model="r.row.closeTime"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="下班时间" width="120" align="center">
|
|
|
|
|
+ <template slot-scope="r">
|
|
|
|
|
+ <el-time-select
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :picker-options="pickerOptions"
|
|
|
|
|
+ :disabled="r.row.disabled || !r.row.isEnable"
|
|
|
|
|
+ v-model="r.row.workOffTime"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="操作列表" width="140" align="center">
|
|
|
|
|
+ <template slot-scope="r">
|
|
|
|
|
+ <btn-tip type="text" @click="deleteData(r.row, r.$index)"
|
|
|
|
|
+ >删除</btn-tip
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button type="text" @click="coppy(r.$index)"
|
|
|
|
|
+ >复制至全部</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <!-- </div>-->
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <btn-tip tip="确定要提交吗?" type="primary" @click="onSubmit">保存</btn-tip>
|
|
|
|
|
|
|
+ <btn-tip tip="确定要提交吗?" type="primary" @click="onSubmit"
|
|
|
|
|
+ >保存</btn-tip
|
|
|
|
|
+ >
|
|
|
<el-button @click="handleClose">取消</el-button>
|
|
<el-button @click="handleClose">取消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</DialogCom>
|
|
</DialogCom>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-
|
|
|
|
|
-import OrgTreeSelect from '@/components/orgTreeSelect'
|
|
|
|
|
|
|
+import OrgTreeSelect from "@/components/orgTreeSelect";
|
|
|
import BtnTip from "@/components/btnTip";
|
|
import BtnTip from "@/components/btnTip";
|
|
|
import dayjs from "dayjs";
|
|
import dayjs from "dayjs";
|
|
|
-import {formatTime, timeCheck} from "@/utils/ruoyi";
|
|
|
|
|
-import {addWorkTimeDay} from "@/views/system/workTimeSet/api";
|
|
|
|
|
|
|
+import { formatTime, timeCheck } from "@/utils/ruoyi";
|
|
|
|
|
+import { addWorkTimeDay } from "@/views/system/workTimeSet/api";
|
|
|
import day from "@/components/Crontab/day";
|
|
import day from "@/components/Crontab/day";
|
|
|
|
|
|
|
|
-
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- components:{OrgTreeSelect,BtnTip},
|
|
|
|
|
|
|
+ components: { OrgTreeSelect, BtnTip },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
selectTreeStrictly: true,
|
|
selectTreeStrictly: true,
|
|
|
isShow: false,
|
|
isShow: false,
|
|
|
workTimeList: [],
|
|
workTimeList: [],
|
|
|
- orgIdList: [],
|
|
|
|
|
- nodes:[],
|
|
|
|
|
|
|
+ orgIdList: [],
|
|
|
|
|
+ nodes: [],
|
|
|
startDatepickerOptions: {
|
|
startDatepickerOptions: {
|
|
|
disabledDate(time) {
|
|
disabledDate(time) {
|
|
|
const date = new Date();
|
|
const date = new Date();
|
|
|
- date.setTime(date.getTime()- 3600 * 1000 * 24 );
|
|
|
|
|
|
|
+ // date.setTime(date.getTime() - 3600 * 1000 * 24);
|
|
|
return time.getTime() < date;
|
|
return time.getTime() < date;
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
props: {},
|
|
props: {},
|
|
|
- watch: {
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ watch: {},
|
|
|
computed: {
|
|
computed: {
|
|
|
pickerOptions() {
|
|
pickerOptions() {
|
|
|
return {
|
|
return {
|
|
@@ -198,41 +217,44 @@ export default {
|
|
|
// console.log(JSON.parse(nodes),'nodes')
|
|
// console.log(JSON.parse(nodes),'nodes')
|
|
|
// this.orgIdList = JSON.parse(nodes).map(v=>{return v.id});
|
|
// this.orgIdList = JSON.parse(nodes).map(v=>{return v.id});
|
|
|
// },
|
|
// },
|
|
|
- add(){
|
|
|
|
|
|
|
+ add() {
|
|
|
this.isShow = true;
|
|
this.isShow = true;
|
|
|
},
|
|
},
|
|
|
- async refresh() {
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ async refresh() {},
|
|
|
reset() {
|
|
reset() {
|
|
|
return {
|
|
return {
|
|
|
- workTimeList:[]
|
|
|
|
|
|
|
+ workTimeList: [],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- addData(){
|
|
|
|
|
|
|
+ addData() {
|
|
|
//获取workTimeList最后一条数据
|
|
//获取workTimeList最后一条数据
|
|
|
let workTime = {
|
|
let workTime = {
|
|
|
isEnable: 1,
|
|
isEnable: 1,
|
|
|
- workTime: '08:30',
|
|
|
|
|
- openTime: '09:00',
|
|
|
|
|
|
|
+ workTime: "08:30",
|
|
|
|
|
+ openTime: "09:00",
|
|
|
// noonbreakStart: '12:00',
|
|
// noonbreakStart: '12:00',
|
|
|
// noonbreakEnd: '14:00',
|
|
// noonbreakEnd: '14:00',
|
|
|
- closeTime: '17:00',
|
|
|
|
|
- workOffTime: '17:30',
|
|
|
|
|
- isDuty:'0',
|
|
|
|
|
- ymdDate: new Date(),
|
|
|
|
|
|
|
+ closeTime: "17:00",
|
|
|
|
|
+ workOffTime: "17:30",
|
|
|
|
|
+ isDuty: "0",
|
|
|
|
|
+ ymdDate: dayjs(new Date()).add(1, "day"),
|
|
|
disabled: false,
|
|
disabled: false,
|
|
|
};
|
|
};
|
|
|
- if(this.workTimeList.length>0){
|
|
|
|
|
- if(this.workTimeList[this.workTimeList.length-1].ymdDate!=null){
|
|
|
|
|
- workTime.ymdDate = dayjs(this.workTimeList[this.workTimeList.length-1].ymdDate).add(1,'day').toDate()
|
|
|
|
|
|
|
+ if (this.workTimeList.length > 0) {
|
|
|
|
|
+ if (this.workTimeList[this.workTimeList.length - 1].ymdDate != null) {
|
|
|
|
|
+ workTime.ymdDate = dayjs(
|
|
|
|
|
+ this.workTimeList[this.workTimeList.length - 1].ymdDate
|
|
|
|
|
+ )
|
|
|
|
|
+ .add(1, "day")
|
|
|
|
|
+ .toDate();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
this.workTimeList.push(workTime);
|
|
this.workTimeList.push(workTime);
|
|
|
- console.log("addData",this.workTimeList);
|
|
|
|
|
|
|
+ console.log("addData", this.workTimeList);
|
|
|
},
|
|
},
|
|
|
- coppy(index){
|
|
|
|
|
|
|
+ coppy(index) {
|
|
|
let workTime = this.workTimeList[index];
|
|
let workTime = this.workTimeList[index];
|
|
|
- for(let i=0;i<this.workTimeList.length;i++){
|
|
|
|
|
|
|
+ for (let i = 0; i < this.workTimeList.length; i++) {
|
|
|
this.workTimeList[i].isEnable = workTime.isEnable;
|
|
this.workTimeList[i].isEnable = workTime.isEnable;
|
|
|
// this.workTimeList[i].workTime = workTime.workTime;
|
|
// this.workTimeList[i].workTime = workTime.workTime;
|
|
|
this.workTimeList[i].openTime = workTime.openTime;
|
|
this.workTimeList[i].openTime = workTime.openTime;
|
|
@@ -242,28 +264,28 @@ export default {
|
|
|
// this.workTimeList[i].workOffTime = workTime.workOffTime;
|
|
// this.workTimeList[i].workOffTime = workTime.workOffTime;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- deleteData(row,index){
|
|
|
|
|
|
|
+ deleteData(row, index) {
|
|
|
console.log(index);
|
|
console.log(index);
|
|
|
- this.workTimeList.splice(index,1);
|
|
|
|
|
|
|
+ this.workTimeList.splice(index, 1);
|
|
|
},
|
|
},
|
|
|
//检查每一项
|
|
//检查每一项
|
|
|
check(other) {
|
|
check(other) {
|
|
|
- if(!other.ymdDate){
|
|
|
|
|
|
|
+ if (!other.ymdDate) {
|
|
|
this.$message.error(`日期不能为空`);
|
|
this.$message.error(`日期不能为空`);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- const ds = this.formatTime(other.ymdDate,"YYYY-MM-DD");
|
|
|
|
|
- console.log(other,'ds')
|
|
|
|
|
- if ( !other.isEnable === null && !other.disabled ) {
|
|
|
|
|
|
|
+ const ds = this.formatTime(other.ymdDate, "YYYY-MM-DD");
|
|
|
|
|
+ console.log(other, "ds");
|
|
|
|
|
+ if (!other.isEnable === null && !other.disabled) {
|
|
|
this.$message.error(`${ds}:未进行配置`);
|
|
this.$message.error(`${ds}:未进行配置`);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(other.isEnable){
|
|
|
|
|
- if(!other.openTime || !other.closeTime){
|
|
|
|
|
|
|
+ if (other.isEnable) {
|
|
|
|
|
+ if (!other.openTime || !other.closeTime) {
|
|
|
this.$message.error(`${ds}:未配置时间`);
|
|
this.$message.error(`${ds}:未配置时间`);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(!timeCheck([other.openTime,other.closeTime])){
|
|
|
|
|
|
|
+ if (!timeCheck([other.openTime, other.closeTime])) {
|
|
|
this.$message.error(`${ds}:营业开始时间应在营业结束之前`);
|
|
this.$message.error(`${ds}:营业开始时间应在营业结束之前`);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -271,12 +293,12 @@ export default {
|
|
|
//return true
|
|
//return true
|
|
|
if (other.isEnable) {
|
|
if (other.isEnable) {
|
|
|
if (
|
|
if (
|
|
|
- !(
|
|
|
|
|
- other.workTime &&
|
|
|
|
|
- other.openTime &&
|
|
|
|
|
- other.closeTime &&
|
|
|
|
|
- other.workOffTime
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ !(
|
|
|
|
|
+ other.workTime &&
|
|
|
|
|
+ other.openTime &&
|
|
|
|
|
+ other.closeTime &&
|
|
|
|
|
+ other.workOffTime
|
|
|
|
|
+ )
|
|
|
) {
|
|
) {
|
|
|
this.$message.error(`${ds}:有尚未配置的时间项`);
|
|
this.$message.error(`${ds}:有尚未配置的时间项`);
|
|
|
return;
|
|
return;
|
|
@@ -286,15 +308,15 @@ export default {
|
|
|
// return;
|
|
// return;
|
|
|
// }
|
|
// }
|
|
|
if (
|
|
if (
|
|
|
- !timeCheck([
|
|
|
|
|
- other.workTime,
|
|
|
|
|
- other.openTime,
|
|
|
|
|
- other.closeTime,
|
|
|
|
|
- other.workOffTime,
|
|
|
|
|
- ])
|
|
|
|
|
|
|
+ !timeCheck([
|
|
|
|
|
+ other.workTime,
|
|
|
|
|
+ other.openTime,
|
|
|
|
|
+ other.closeTime,
|
|
|
|
|
+ other.workOffTime,
|
|
|
|
|
+ ])
|
|
|
) {
|
|
) {
|
|
|
this.$message.error(
|
|
this.$message.error(
|
|
|
- `${ds}:请按照(上班时间<营业时间<营业结束<下班时间)顺序配置`
|
|
|
|
|
|
|
+ `${ds}:请按照(上班时间<营业时间<营业结束<下班时间)顺序配置`
|
|
|
);
|
|
);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -304,8 +326,8 @@ export default {
|
|
|
handleClose() {
|
|
handleClose() {
|
|
|
this.isShow = false;
|
|
this.isShow = false;
|
|
|
this.workTimeList = [];
|
|
this.workTimeList = [];
|
|
|
- this.orgIdList=[];
|
|
|
|
|
- this.$refs['orgTreeSelect'].clear();
|
|
|
|
|
|
|
+ this.orgIdList = [];
|
|
|
|
|
+ this.$refs["orgTreeSelect"].clear();
|
|
|
},
|
|
},
|
|
|
onEnableChange(workTime) {
|
|
onEnableChange(workTime) {
|
|
|
if (!workTime.isEnable) {
|
|
if (!workTime.isEnable) {
|
|
@@ -318,16 +340,17 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async onSubmit() {
|
|
async onSubmit() {
|
|
|
- if(this.orgIdList.length === 0)return this.$message.error('请选择机构');
|
|
|
|
|
- if(this.workTimeList.length === 0)return this.$message.error('请添加日期');
|
|
|
|
|
|
|
+ if (this.orgIdList.length === 0) return this.$message.error("请选择机构");
|
|
|
|
|
+ if (this.workTimeList.length === 0)
|
|
|
|
|
+ return this.$message.error("请添加日期");
|
|
|
//判断是否有重复的日期
|
|
//判断是否有重复的日期
|
|
|
let dateList = [];
|
|
let dateList = [];
|
|
|
- console.log(this.workTimeList,"this.workTimeList")
|
|
|
|
|
|
|
+ console.log(this.workTimeList, "this.workTimeList");
|
|
|
// let workTimeList = JSON.parse(JSON.stringify(this.workTimeList))
|
|
// let workTimeList = JSON.parse(JSON.stringify(this.workTimeList))
|
|
|
let workTimeList = this.workTimeList;
|
|
let workTimeList = this.workTimeList;
|
|
|
for (let v of workTimeList) {
|
|
for (let v of workTimeList) {
|
|
|
if (v.ymdDate) {
|
|
if (v.ymdDate) {
|
|
|
- let date = this.formatTime(v.ymdDate,"YYYY-MM-DD");
|
|
|
|
|
|
|
+ let date = this.formatTime(v.ymdDate, "YYYY-MM-DD");
|
|
|
if (dateList.indexOf(date) > -1) {
|
|
if (dateList.indexOf(date) > -1) {
|
|
|
this.$message.error(`日期: ${date} 重复`);
|
|
this.$message.error(`日期: ${date} 重复`);
|
|
|
return;
|
|
return;
|
|
@@ -337,21 +360,23 @@ export default {
|
|
|
}
|
|
}
|
|
|
// 校验
|
|
// 校验
|
|
|
for (let workTime of workTimeList) {
|
|
for (let workTime of workTimeList) {
|
|
|
- const adjustedDate = new Date(workTime.ymdDate.getTime() + 8 * 60 * 60 * 1000);
|
|
|
|
|
- workTime.ymdDate=adjustedDate.toISOString().split("T")[0];
|
|
|
|
|
|
|
+ const adjustedDate = new Date(
|
|
|
|
|
+ workTime.ymdDate.getTime() + 8 * 60 * 60 * 1000
|
|
|
|
|
+ );
|
|
|
|
|
+ workTime.ymdDate = adjustedDate.toISOString().split("T")[0];
|
|
|
if (!this.check(workTime)) {
|
|
if (!this.check(workTime)) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
let data = {
|
|
let data = {
|
|
|
- orgIdList:this.orgIdList,
|
|
|
|
|
- workTimeList:workTimeList
|
|
|
|
|
- }
|
|
|
|
|
- console.log(workTimeList,"workTimeList")
|
|
|
|
|
- addWorkTimeDay(data).then(res=>{
|
|
|
|
|
|
|
+ orgIdList: this.orgIdList,
|
|
|
|
|
+ workTimeList: workTimeList,
|
|
|
|
|
+ };
|
|
|
|
|
+ console.log(workTimeList, "workTimeList");
|
|
|
|
|
+ addWorkTimeDay(data).then((res) => {
|
|
|
this.$emit("ok");
|
|
this.$emit("ok");
|
|
|
this.handleClose();
|
|
this.handleClose();
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
@@ -361,7 +386,6 @@ export default {
|
|
|
.question-infos {
|
|
.question-infos {
|
|
|
.el-form {
|
|
.el-form {
|
|
|
padding-top: 10px;
|
|
padding-top: 10px;
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -372,5 +396,4 @@ export default {
|
|
|
.change-icon {
|
|
.change-icon {
|
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
</style>
|
|
</style>
|