Просмотр исходного кода

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc_web into V0.0.2

luojun 2 лет назад
Родитель
Сommit
829281e871

+ 1 - 1
src/assets/styles/element-ui.scss

@@ -90,7 +90,7 @@
 }
 
 .tree-container{
-  height: calc(100vh - 185px);
+  height: calc(100vh - 218px);
   overflow: auto;
 }
 

+ 3 - 1
src/components/layoutContainer/index.vue

@@ -64,9 +64,11 @@ export default {
 <style lang="scss" scoped>
 .big_box {
 //   width: 100%;
+
   display: flex;
   .leftBar {
-    min-width: 200px;
+    min-width: 300px;
+    // overflow: scroll;
   }
   .rightBar {
     width: 80%;

+ 17 - 8
src/components/orgTree/index.vue

@@ -29,7 +29,17 @@
         @node-click="handleNodeClick"
         v-bind="$attrs"
       >
-    </el-tree>
+        <span class="custom-tree-node" slot-scope="{ node, data }">
+          <el-tooltip
+            class="item"
+            effect="light"
+            :content="node.label"
+            placement="top-start"
+          >
+            <span>{{ node.label }}</span>
+          </el-tooltip>
+        </span>
+      </el-tree>
     </div>
   </div>
 </template>
@@ -129,12 +139,11 @@ export default {
 };
 </script>
 
-<style lang='scss' scoped>
-  .el-tree-ex {
-    // overflow: auto;
-    ::v-deep .is-current > .el-tree-node__content {
-      background-color: #d1e0f1 !important;
-    }
+<style lang="scss" scoped>
+.el-tree-ex {
+  // overflow: auto;
+  ::v-deep .is-current > .el-tree-node__content {
+    background-color: #d1e0f1 !important;
   }
-
+}
 </style>

+ 1 - 1
src/utils/ruoyi.js

@@ -12,7 +12,7 @@ export function timeCheck(arr) {
   for (let i = srcs.length - 1; i > 0; i--) {
     let a = timeToNumber(srcs[i]);
     let b = timeToNumber(srcs[i - 1]);
-    if (a < b) {
+    if (a <= b) {
       return false;
     }
   }

+ 1 - 1
src/views/core/accessPlan/index.vue

@@ -164,7 +164,7 @@
           </el-select>
         </el-form-item>
         <el-form-item label="调阅频次" prop="planFrequency">
-          <el-input type="number" v-model.number="form.planFrequency" placeholder="请输入调阅频次" />
+          <el-input type="number" oninput="if(value<=0)value=null;value=parseInt(value)" v-model.number="form.planFrequency" placeholder="请输入调阅频次" />
         </el-form-item>
         <el-form-item label="备注" prop="description">
           <el-input v-model="form.description" type="textarea" placeholder="请输入内容" />

+ 106 - 66
src/views/information/configuration/index.vue

@@ -1,95 +1,121 @@
 <template>
-  <div class="container" style="min-height: 100%; padding-bottom: 100px;">
-    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-border">
-      <div style="display:inline-block;width:100%;">
+  <div class="app-container" style="min-height: 100%;">
+    <el-form :model="day" :rules="rules" ref="day" label-width="130px">
+      <div class="form-item">
         <el-row>
-          <div style="background: grey">
-            每日履职
-          </div>
-          <el-col :xs="24" :sm="12" :md="8" :lg="6">
-            <el-form-item label="营业前提醒分钟数" prop="workType">
-              <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+          <el-col :xs="24" :sm="12" :md="8" :lg="4">
+            <div class="item-title">
+              每日履职
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="5">
+            <el-form-item label="营业前提醒:" prop="workType">
+              
+                <el-input-number size="mini" style="width: 70%;" v-model="day.font" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+              分钟
+            
+            
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :md="8" :lg="6">
-            <el-form-item label="营业中提醒分钟数" prop="educationType">
-              <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+          <el-col :xs="24" :sm="12" :md="8" :lg="5">
+            <el-form-item label="营业中提醒:" prop="educationType">
+              <el-input-number size="mini" style="width: 70%;" v-model="day.z" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+              分钟
             </el-form-item>
           </el-col>
 
-          <el-col :xs="24" :sm="12" :md="8" :lg="6">
-            <el-form-item label="营业后提醒分钟数" prop="professionalQualifications">
-              <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+          <el-col :xs="24" :sm="12" :md="8" :lg="5">
+            <el-form-item label="营业后提醒:" prop="professionalQualifications">
+              <el-input-number size="mini" style="width: 70%;" v-model="day.h" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+              分钟
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :md="8" :lg="6">
-            <el-form-item label="全天提醒分钟数" prop="professionalQualifications">
-              <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+          <el-col :xs="24" :sm="12" :md="8" :lg="5">
+            <el-form-item label="全天提醒:" prop="professionalQualifications">
+              <el-input-number size="mini" style="width: 70%;" v-model="day.all" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+              分钟
             </el-form-item>
           </el-col>
         </el-row>
-
       </div>
-      <div style="display:inline-block;width:100%;">
+    </el-form> 
+    <el-form :model="week" :rules="rules" ref="week" label-width="130px">
+      <div class="form-item">
         <el-row>
-          <div style="background: grey">
-            每周履职
-          </div>
-          <el-col :xs="24" :sm="12" :md="8" :lg="6">
-            <el-form-item label="提前提醒天数" prop="educationType">
-              <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+          <el-col :xs="24" :sm="12" :md="8" :lg="4">
+            <div class="item-title">
+              每周履职
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="5">
+            <el-form-item label="提前提醒:" prop="educationType">
+              <el-input-number size="mini" style="width: 70%" v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+              天
             </el-form-item>
           </el-col>
         </el-row>
-
       </div>
-      <div style="display:inline-block;width:100%;">
+    </el-form> 
+    <el-form :model="month" :rules="rules" ref="month" label-width="130px">
+      <div class="form-item">
         <el-row>
-          <div style="background: grey">
-            每月履职
-          </div>
-
-          <el-col :xs="24" :sm="12" :md="8" :lg="6">
-            <el-form-item label="提前提醒天数" prop="educationType">
-              <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+          <el-col :xs="24" :sm="12" :md="8" :lg="4">
+            <div class="item-title">
+              每月履职
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="5">
+            <el-form-item label="提前提醒:" prop="educationType">
+              <el-input-number  size="mini" v-model="num" style="width: 70%" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+              天
             </el-form-item>
           </el-col>
         </el-row>
       </div>
-      <div style="display:inline-block;width:100%;">
+    </el-form> 
+    <el-form :model="season" :rules="rules" ref="season" label-width="130px">
+      <div class="form-item">
         <el-row>
-          <div style="background: grey">
-            每季履职
-          </div>
-
-          <el-col :xs="24" :sm="12" :md="8" :lg="6">
-            <el-form-item label="提前提醒天数" prop="educationType">
-              <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+          <el-col :xs="24" :sm="12" :md="8" :lg="4">
+            <div class="item-title">
+              每季履职
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="5">
+            <el-form-item label="提前提醒:" prop="educationType">
+              <el-input-number  size="mini" v-model="num" style="width: 70%" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
             </el-form-item>
           </el-col>
         </el-row>
       </div>
-      <div style="display:inline-block;width:100%;">
+    </el-form> 
+    <el-form :model="holfYear" :rules="rules" ref="holfYear" label-width="130px">
+      <div class="form-item">
         <el-row>
-          <div style="background: grey">
-            半年履职
-          </div>
-
-          <el-col :xs="24" :sm="12" :md="8" :lg="6">
-            <el-form-item label="提前提醒天数" prop="educationType">
-              <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+          <el-col :xs="24" :sm="12" :md="8" :lg="4">
+            <div class="item-title">
+              半年履职
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="5">
+            <el-form-item label="提前提醒:" prop="educationType">
+              <el-input-number  size="mini" v-model="num" style="width: 70%" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
             </el-form-item>
           </el-col>
         </el-row>
       </div>
-      <div style="display:inline-block;width:100%;">
+    </el-form> 
+    <el-form :model="year" :rules="rules" ref="year" label-width="130px">
+      <div class="form-item">
         <el-row>
-          <div style="background: grey">
-            每年履职
-          </div>
-          <el-col :xs="24" :sm="12" :md="8" :lg="6">
-            <el-form-item label="提前提醒天数" prop="educationType">
-              <el-input-number v-model="num" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
+          <el-col :xs="24" :sm="12" :md="8" :lg="4">
+            <div class="item-title">
+              每年履职
+            </div>
+          </el-col>
+          <el-col :xs="24" :sm="12" :md="8" :lg="5">
+            <el-form-item label="提前提醒:" prop="educationType">
+              <el-input-number size="mini" v-model="num" style="width: 70%" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number>
             </el-form-item>
           </el-col>
         </el-row>
@@ -110,7 +136,12 @@ export default {
   data() {
     return {
       num: 1,
-
+      day:{},
+      week:{},
+      month:{},
+      season:{},
+      holfYear:{},
+      year:{},
       formData:{
         deptId: null,
         duties: null,
@@ -226,12 +257,21 @@ export default {
 }
 </script>
 
-<style scoped>
-.container {}
-
-.demo-border {
-  border: 1px grey dashed;
-  min-height: 1rem;
-  border-radius: 5px;
+<style lang="scss" scoped>
+.form-item{
+  border: 1px solid #f1f1f1;
+  margin-bottom: 2px;
+  min-height: 100px;
+  display: flex;
+  align-items: center;
+}
+.item-title{
+  width: 100px;
+  color: #fff;
+  background-color: #ccc;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  height: 100%;
 }
 </style>

+ 1 - 1
src/views/system/device/index.vue

@@ -150,7 +150,7 @@
 
           <el-col :span="10">
             <el-form-item v-if="form.deviceType == 2" label="通道号" prop="channel">
-              <el-input v-model="form.channel" placeholder="请输入" />
+              <el-input type="number" max="64" min="0" oninput="if(value<=0)value=null;if(value>=64)value=64;value=parseInt(value)" v-model="form.channel" placeholder="请输入" />
             </el-form-item>
           </el-col>
 

+ 9 - 7
src/views/system/user/index.vue

@@ -216,13 +216,13 @@
               width="160"
               class-name="small-padding fixed-width"
             >
-              <template slot-scope="scope" v-if="scope.row.userId !== 1">
+              <template slot-scope="scope" >
                 <el-button
                   size="mini"
                   type="text"
                   icon="el-icon-plus"
                   @click="handleExtend(scope.row)"
-                  v-hasPermi="['system:user:extend']"
+                  v-hasPermi="['system:user:extend']" v-if="check==true"
                   >补充信息</el-button
                 >
                 <!-- <el-button
@@ -237,7 +237,7 @@
                   type="text"
                   icon="el-icon-edit"
                   @click="handleUpdate(scope.row)"
-                  v-hasPermi="['system:user:edit']"
+                  v-hasPermi="['system:user:edit']" v-if="check==true"
                   >编辑</el-button
                 >
                 <el-button
@@ -485,7 +485,7 @@ import {
 import { getToken } from "@/utils/auth";
 import { deptTreeSelect } from "@/api/system/public";
 import tableList from "@/mixins/tableList";
-
+import {getInfo}from "@/api/login";
 export default {
   name: "User",
   dicts: ["sys_normal_disable", "sys_user_sex","sys_user_is_lock"],
@@ -627,9 +627,9 @@ export default {
 
   created() {
     this.getDeptTree();
-    // this.getConfigKey("sys.user.initPassword").then(response => {
-    //   this.initPassword = response.msg;
-    // });
+    getInfo().then((response)=>{
+      this.roleOptions ==response.roles;
+    })
   },
   mounted() {},
   watch: {
@@ -663,6 +663,7 @@ export default {
         this.deptOptions = response.data;
       });
     },
+  
     // 节点单击事件
     clickTreeNode(data) {
       this.queryParams.orgId = data.id;
@@ -708,6 +709,7 @@ export default {
           this.userList = response.data.rows;
           this.total = response.data.total;
           this.check = response.check;
+          console.log( this.check +"%%%%%%%%%%%%")
           this.loading = false;
         })
         .catch((err) => {

+ 120 - 115
src/views/system/workTimeSet/dialog.add.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="question-infos">
     <DialogCom title="新增作息" @close="handleClose" :visible.sync="isShow" :close-on-click-modal="false"
-      custom-class="gxDialog" width="80%" append-to-body>
+      custom-class="gxDialog" width="911px" append-to-body>
 <!--      <div class="p-5 work-time">-->
         <el-form label-width="90px" label-suffix=":" label-position="right">
 
@@ -14,7 +14,7 @@
           <!--  -->
           <el-form-item label="作息规则">
             <el-table class="w-auto" height="350" border :data="workTimeList">
-              <el-table-column label="日期" width="160px">
+              <el-table-column label="日期" width="160">
                 <template slot-scope="r" >
                   <el-date-picker
                     style="width: 100%"
@@ -28,72 +28,72 @@
                   </el-date-picker>
                 </template>
               </el-table-column>
-              <el-table-column label="星期" width="80px">
+              <el-table-column label="星期" width="80">
                 <template slot-scope="r">
                   <span>{{parseTime(r.row.ymdDate ,'dddd')}}</span>
                 </template>
               </el-table-column>
-              <el-table-column label="状态" width="160px">
+              <el-table-column label="状态" width="160">
                 <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-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>-->
+                  <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="上班时间" >
+<!--              <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.workTime"/>-->
+<!--                </template>-->
+<!--              </el-table-column>-->
+              <el-table-column label="营业时间" width="120">
                 <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="营业时间" >
-                <template slot-scope="r">
-                  <el-time-select
-                    style="width: 100%"
+                    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="营业终了">
+<!--              <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">
                 <template slot-scope="r">
                   <el-time-select
                     style="width: 100%"
@@ -103,17 +103,17 @@
                     v-model="r.row.closeTime"/>
                 </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.workOffTime"/>
-                </template>
-              </el-table-column>
-              <el-table-column label="操作列表" width="140px">
+<!--              <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.workOffTime"/>-->
+<!--                </template>-->
+<!--              </el-table-column>-->
+              <el-table-column label="操作列表" width="140">
                 <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>
@@ -167,7 +167,7 @@ export default {
       return {
         start: "00:00",
         end: "24:00",
-        step: "00:10",
+        step: "00:05",
       };
     },
   },
@@ -190,12 +190,12 @@ export default {
       //获取workTimeList最后一条数据
       let workTime = {
         isEnable: 1,
-        workTime: '08:30',
+        // workTime: '08:30',
         openTime: '09:00',
-        noonbreakStart: '12:00',
-        noonbreakEnd: '14:00',
+        // noonbreakStart: '12:00',
+        // noonbreakEnd: '14:00',
         closeTime: '17:00',
-        workOffTime: '17:30',
+        // workOffTime: '17:30',
         ymdDate: new Date(),
         disabled: false,
       };
@@ -211,19 +211,19 @@ export default {
       let workTime = this.workTimeList[index];
       for(let i=0;i<this.workTimeList.length;i++){
         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].noonbreakStart = workTime.noonbreakStart;
-        this.workTimeList[i].noonbreakEnd = workTime.noonbreakEnd;
+        // this.workTimeList[i].noonbreakStart = workTime.noonbreakStart;
+        // this.workTimeList[i].noonbreakEnd = workTime.noonbreakEnd;
         this.workTimeList[i].closeTime = workTime.closeTime;
-        this.workTimeList[i].workOffTime = workTime.workOffTime;
+        // this.workTimeList[i].workOffTime = workTime.workOffTime;
       }
     },
     deleteData(row,index){
       console.log(index);
       this.workTimeList.splice(index,1);
     },
-    //
+    //检查每一项
     check(other) {
       if(!other.ymdDate){
         this.$message.error(`日期不能为空`);
@@ -232,42 +232,53 @@ export default {
       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;
       }
-      if (other.isEnable) {
-        if (
-            !(
-                other.workTime &&
-                other.openTime &&
-                other.closeTime &&
-                other.workOffTime
-            )
-        ) {
-          this.$message.error(`${ds}未配置时间`);
-          return;
-        }
-        if (!other.noonbreakStart ^ !other.noonbreakEnd) {
-          this.$message.error(`午休开始及结束时间必须同时配置`);
+      if(other.isEnable){
+        if(!other.openTime || !other.closeTime){
+          this.$message.error(`${ds}:未配置时间`);
           return;
         }
-        if (
-            !timeCheck([
-              other.workTime,
-              other.openTime,
-              other.noonbreakStart,
-              other.noonbreakEnd,
-              other.closeTime,
-              other.workOffTime,
-            ])
-        ) {
-          this.$message.error(
-              `${ds}上班时间<=营业时间<=午休开始<=午休结束<=营业终了<=下班时间`
-          );
+        if(!timeCheck([other.openTime,other.closeTime])){
+          this.$message.error(`${ds}:营业时间应在营业终了之前`);
           return false;
         }
       }
-      return true;
+      return true
+      // if (other.isEnable) {
+      //   if (
+      //       !(
+      //           other.workTime &&
+      //           other.openTime &&
+      //           other.closeTime &&
+      //           other.workOffTime
+      //       )
+      //   ) {
+      //     this.$message.error(`${ds}未配置时间`);
+      //     return;
+      //   }
+      //   if (!other.noonbreakStart ^ !other.noonbreakEnd) {
+      //     this.$message.error(`午休开始及结束时间必须同时配置`);
+      //     return;
+      //   }
+      //   if (
+      //       !timeCheck([
+      //         other.workTime,
+      //         other.openTime,
+      //         other.noonbreakStart,
+      //         other.noonbreakEnd,
+      //         other.closeTime,
+      //         other.workOffTime,
+      //       ])
+      //   ) {
+      //     this.$message.error(
+      //         `${ds}上班时间<=营业时间<=午休开始<=午休结束<=营业终了<=下班时间`
+      //     );
+      //     return false;
+      //   }
+      // }
+      // return true;
     },
     handleClose() {
       this.isShow = false;
@@ -279,13 +290,15 @@ export default {
       if (!workTime.isEnable) {
         workTime.openTime = null;
         workTime.closeTime = null;
-        workTime.noonbreakStart = null;
-        workTime.noonbreakEnd = null;
-        workTime.workTime = null;
-        workTime.workOffTime = null;
+        // workTime.noonbreakStart = null;
+        // workTime.noonbreakEnd = null;
+        // workTime.workTime = null;
+        // workTime.workOffTime = null;
       }
     },
     async onSubmit() {
+      if(this.orgIdList.length === 0)return  this.$message.warning('请选择机构!');
+      if(this.workTimeList.length === 0)return  this.$message.warning('请添加日期!');
       //判断是否有重复的日期
       let dateList = [];
       let workTimeList = JSON.parse(JSON.stringify(this.workTimeList))
@@ -309,20 +322,12 @@ export default {
         orgIdList:this.orgIdList,
         workTimeList:workTimeList
       }
+      debugger
       addWorkTimeDay(data).then(res=>{
         this.$emit("ok");
         this.handleClose();
       })
-
-      // await this.$api.workTimeMonth.edit({
-      //   ...this.data,
-      //   workTimeList: this.workTimeList,
-      // }).then((v) => {
-      //   this.$emit("success");
-      //   this.onHide();
-      // });
     },
-    //apimark//
   },
 };
 </script>

+ 86 - 100
src/views/system/workTimeSet/dialog.template.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="question-infos">
     <DialogCom :title="title" @close="handleClose" :visible.sync="isShow" :close-on-click-modal="false"
-      custom-class="gxDialog" width="75%"  append-to-body>
+      custom-class="gxDialog" width="800"  append-to-body>
 <!--      <div class="p-5 work-time-modify">-->
         <el-form
             :disabled="title === '查看作息模版'"
@@ -35,34 +35,34 @@
               <el-table class="w-auto" border :data="formData.dayOfWeeks">
                 <el-table-column label="星期" width="100px" prop="dayOfWeekText">
                 </el-table-column>
-                <el-table-column label="营业状态" width="160px">
+                <el-table-column label="营业状态">
                   <template slot-scope="r">
-                    <el-switch
-                      v-model="r.row.isWorkday"
-                      :active-value="1"
-                      :inactive-value="0"
-                      @change="onEnableChange(r.row)"
-                      active-text="营业"
-                      inactive-text="歇业">
-                    </el-switch>
-<!--                    <el-radio-group-->
-<!--                        v-model="r.row.isWorkday"-->
-<!--                        @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="上班时间">
-                  <template slot-scope="r">
-                    <el-time-select
-                      style="width: 100%"
-                      size="mini"
-                      :picker-options="pickerOptions"
-                      :disabled="!r.row.isWorkday || !r.row.isWorkday"
-                      v-model="r.row.workTime"/>
+<!--                    <el-switch-->
+<!--                      v-model="r.row.isWorkday"-->
+<!--                      :active-value="1"-->
+<!--                      :inactive-value="0"-->
+<!--                      @change="onEnableChange(r.row)"-->
+<!--                      active-text="营业"-->
+<!--                      inactive-text="歇业">-->
+<!--                    </el-switch>-->
+                    <el-radio-group
+                        v-model="r.row.isWorkday"
+                        @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="上班时间">-->
+<!--                  <template slot-scope="r">-->
+<!--                    <el-time-select-->
+<!--                      style="width: 100%"-->
+<!--                      size="mini"-->
+<!--                      :picker-options="pickerOptions"-->
+<!--                      :disabled="!r.row.isWorkday || !r.row.isWorkday"-->
+<!--                      v-model="r.row.workTime"/>-->
+<!--                  </template>-->
+<!--                </el-table-column>-->
                 <el-table-column label="营业时间">
                   <template slot-scope="r">
                     <el-time-select
@@ -73,26 +73,26 @@
                       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.isWorkday || !r.row.isWorkday"
-                      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.isWorkday || !r.row.isWorkday"
-                      v-model="r.row.noonbreakEnd"/>
-                  </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.isWorkday || !r.row.isWorkday"-->
+<!--                      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.isWorkday || !r.row.isWorkday"-->
+<!--                      v-model="r.row.noonbreakEnd"/>-->
+<!--                  </template>-->
+<!--                </el-table-column>-->
                 <el-table-column label="营业终了">
                   <template slot-scope="r">
                     <el-time-select
@@ -103,16 +103,16 @@
                       v-model="r.row.closeTime"/>
                   </template>
                 </el-table-column>
-                <el-table-column label="下班时间">
-                  <template slot-scope="r">
-                    <el-time-select
-                      style="width: 100%"
-                      size="small"
-                      :picker-options="pickerOptions"
-                      :disabled="!r.row.isWorkday || !r.row.isWorkday"
-                      v-model="r.row.workOffTime"/>
-                  </template>
-                </el-table-column>
+<!--                <el-table-column label="下班时间">-->
+<!--                  <template slot-scope="r">-->
+<!--                    <el-time-select-->
+<!--                      style="width: 100%"-->
+<!--                      size="small"-->
+<!--                      :picker-options="pickerOptions"-->
+<!--                      :disabled="!r.row.isWorkday || !r.row.isWorkday"-->
+<!--                      v-model="r.row.workOffTime"/>-->
+<!--                  </template>-->
+<!--                </el-table-column>-->
 
               </el-table>
 
@@ -161,8 +161,8 @@
 import BtnTip from "@/components/btnTip";
 import OrgTreeSelect from '@/components/orgTreeSelect'
 import { timeCheck } from "@/utils/ruoyi";
-import {addTimeWeek,checkData, queryInfoById} from "@/views/system/workTimeSet/api";
-import {json} from './json'
+import {addTimeWeek, queryInfoById} from "@/views/system/workTimeSet/api";
+import {json} from './json'  //导入默认数据
 export default {
   components:{BtnTip,OrgTreeSelect},
   data() {
@@ -190,16 +190,6 @@ export default {
           },
         ],
       },
-      // options: [
-      //   {
-      //     value: new Date().getFullYear(),
-      //     label: new Date().getFullYear(),
-      //   },
-      //   {
-      //     value: new Date().getFullYear() + 1,
-      //     label: new Date().getFullYear() + 1,
-      //   },
-      // ],
       startDatepickerOptions: {
         disabledDate(time) {
           const date = new Date();
@@ -223,7 +213,7 @@ export default {
       return {
         start: "00:00",
         end: "24:00",
-        step: "00:10",
+        step: "00:05",
       };
     },
   },
@@ -240,10 +230,6 @@ export default {
     add(){
       this.title = '新增作息模版';
       this.isShow = true;
-      //this.getData()
-      // for (let i=0; i <= 6;i++){
-      //   this.formData.dayOfWeeks.push({})
-      // }
     },
     show(row) {
       this.title = '查看作息模版';
@@ -264,40 +250,40 @@ export default {
         this.$message.error("生效日期不能为空");
         return;
       }
-      if (this.formData.dayOfWeeks.filter((w) => w.isWorkday == 1 || w.isWorkday).length === 0) {
+      if (this.formData.dayOfWeeks.filter(w => w.isWorkday == 1 || w.isWorkday).length === 0) {
         this.$message.error("工作日不能为空");
         return;
       }
-      this.formData.dayOfWeeks.forEach(v=>{
-        let dayOfWeek = v;
-        console.log(dayOfWeek,'dayOfWeek');
-        //是否启用
-        if(!dayOfWeek.isWorkday ) return ;
-        if (!(dayOfWeek.workTime && dayOfWeek.openTime && dayOfWeek.closeTime && dayOfWeek.workOffTime)) {
-          this.$message.error(`${dayOfWeek.dayOfWeekText}的上班时间、营业时间未配置完整`);
+      // 校验
+      for (let workTime of this.formData.dayOfWeeks) {
+        if (!this.checkItem(workTime)) {
           return;
         }
-        if (!dayOfWeek.noonbreakStart ^ !dayOfWeek.noonbreakEnd) {
-          this.$message.error(`${dayOfWeek.dayOfWeekText}的午休开始及结束时间必须同时配置`);
-          return;
-        }
-        let arr = [dayOfWeek.workTime, dayOfWeek.openTime, dayOfWeek.noonbreakStart, dayOfWeek.noonbreakEnd, dayOfWeek.closeTime, dayOfWeek.workOffTime];
-        let flag = timeCheck(arr);
-        if (!flag) {
-          this.$message.error(`${dayOfWeek.dayOfWeekText}的上班时间<=营业时间<=午休开始<=午休结束<=营业终了<=下班时间`);
-          return false;
-        }
-      })
-      checkData(this.formData).then(res=>{
-        this.checkData = res.checkData;
-        if(!res.checkData) {
-          addTimeWeek(this.formData).then(res=>{
-            this.$emit("success");
-            this.handleClose();
-          })
-        }
+      }
+      addTimeWeek(this.formData).then(res=>{
+        this.$emit("ok");
+        this.handleClose();
       })
     },
+    checkItem(dayOfWeek){
+      console.log(dayOfWeek,'dayOfWeek');
+      //是否启用
+      if(!dayOfWeek.isWorkday) return true;
+      if (!( dayOfWeek.openTime && dayOfWeek.closeTime)) {
+        this.$message.error(`${dayOfWeek.dayOfWeekText}的营业时间未完整配置`);
+        return;
+      }
+      // if (!dayOfWeek.noonbreakStart ^ !dayOfWeek.noonbreakEnd) {
+      //   this.$message.error(`${dayOfWeek.dayOfWeekText}的午休开始及结束时间必须同时配置`);
+      //   return;
+      // }
+      let arr = [dayOfWeek.openTime,dayOfWeek.closeTime];
+      if (!timeCheck(arr)) {
+        this.$message.error(`${dayOfWeek.dayOfWeekText}的营业时间应在营业终了之前`);
+        return false;
+      }
+      return true;
+    },
     async submitData(result){
       this.centerDialogVisible=false;
       this.centerDialogVisiblea=false;

+ 1 - 1
src/views/system/workTimeSet/index.vue

@@ -5,7 +5,7 @@
       <el-tab-pane label="作息配置" name="作息配置">
         <work-time></work-time>
       </el-tab-pane>
-      <el-tab-pane v-hasPermi="['system:time:week']" label="按周配置作息" name="按周配置作息" lazy>
+      <el-tab-pane v-hasPermi="['system:time:week']" label="模板配置作息" name="按周配置作息" lazy>
         <work-time-week ></work-time-week>
       </el-tab-pane>
     </el-tabs>

+ 14 - 14
src/views/system/workTimeSet/workTime.vue

@@ -79,7 +79,7 @@
               icon="el-icon-thumb"
               @click="clickAdd"
               v-hasPermi="['system:time:add']"
-            >指定日期配置</el-button>
+            >新增作息配置</el-button>
           </el-col>
           <el-col :span="1.5">
             <!-- <el-button
@@ -90,7 +90,7 @@
               @click="handleExport"
               v-hasPermi="['system:time:export']">导出</el-button> -->
           </el-col>
-          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
+          <right-toolbar :showSearch.sync="showSearch" size="mini" @queryTable="getList" :columns="columns"></right-toolbar>
         </el-row>
 
         <el-table v-loading="loading" style="width: auto;" size="mini" border :data="tableList">
@@ -98,25 +98,25 @@
           <el-table-column v-if="columns[1].visible" label="日期" >
             <span slot-scope="scope">{{scope.row.ymdDate}}</span>
           </el-table-column>
-          <el-table-column v-if="columns[2].visible" label="营业状态" :width="100">
+          <el-table-column v-if="columns[2].visible" label="营业状态">
             <template slot-scope="r">{{r.row.isEnable?'营业':'歇业'}}</template>
           </el-table-column>
-          <el-table-column v-if="columns[3].visible" label="上下班时间段">
-            <template slot-scope="r">
-              <span>{{r.row.workTime}}-{{r.row.workOffTime}}</span>
-            </template>
-          </el-table-column>
+<!--          <el-table-column v-if="columns[3].visible" label="上下班时间段">-->
+<!--            <template slot-scope="r">-->
+<!--              <span>{{r.row.workTime}}-{{r.row.workOffTime}}</span>-->
+<!--            </template>-->
+<!--          </el-table-column>-->
           <el-table-column v-if="columns[4].visible" label="营业时间段">
             <template slot-scope="r">
               <span>{{r.row.openTime}}-{{r.row.closeTime}}</span>
             </template>
           </el-table-column>
-          <el-table-column v-if="columns[5].visible" label="午休时间段">
-            <template slot-scope="scope">
-              <span>{{scope.row.noonbreakStart}}-{{scope.row.noonbreakEnd}}</span>
-            </template>
-          </el-table-column>
-          <el-table-column v-if="columns[6].visible" prop="modifiedName" label="更新人" width="100"></el-table-column>
+<!--          <el-table-column v-if="columns[5].visible" label="午休时间段">-->
+<!--            <template slot-scope="scope">-->
+<!--              <span>{{scope.row.noonbreakStart}}-{{scope.row.noonbreakEnd}}</span>-->
+<!--            </template>-->
+<!--          </el-table-column>-->
+          <el-table-column v-if="columns[6].visible" prop="modifiedName" label="更新人" ></el-table-column>
           <el-table-column v-if="columns[7].visible" label="更新时间" >
             <span slot-scope="scope">{{scope.row.updateTime}}</span>
           </el-table-column>

+ 1 - 1
src/views/system/workTimeSet/workTimeWeek.vue

@@ -102,7 +102,7 @@
     </el-row>
 
 
-    <dialog-template ref="modalTemplate" ></dialog-template>
+    <dialog-template ref="modalTemplate" @ok="getList" ></dialog-template>
 
   </div>
 </template>