高雄 1 рік тому
батько
коміт
0d6cc7dafb

+ 18 - 5
src/api/system/org.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 
-export function listByTypes (args){  
+export function listByTypes (args){
     return request({
       url: '/system/dept/findListByOrgTypes',
       method: 'post',
@@ -8,7 +8,7 @@ export function listByTypes (args){
     })
   }
 
-  export function wholeTreeByType (orgType){  
+  export function wholeTreeByType (orgType){
     return request({
       url: '/system/dept/deptTree/wholetree/bytype',
       method: 'get',
@@ -18,10 +18,23 @@ export function listByTypes (args){
     })
   }
 
-  
-  export function deptTreeWithSameTypeUp (){  
+
+  export function deptTreeWithSameTypeUp (){
     return request({
       url: '/system/dept/deptTree/depttreewithsametypeup',
       method: 'get'
     })
-  }
+  }
+
+/**
+ * 根据查询条件获取机构列表
+ * @param args
+ * @returns {*}
+ */
+export function selectOrgList (args){
+    return request({
+      url: '/system/dept/selectOrgList',
+      method: 'post',
+      data: args
+    })
+  }

+ 669 - 0
src/components/orgSelect/index.vue

@@ -0,0 +1,669 @@
+<!--编写穿梭框的插件,左右都有很多搜索条件-->
+<template>
+  <div>
+
+    <div style="width: 98%;">
+      <div class="tags-box" :class="{'tags-box-disabled':!disabled,'tags-box-mini':size === 'mini'}" @click="showDialog">
+        <el-tag type="success" :size="size" v-for="v in currentTempList" :key="v.id">{{ v.shortName }}</el-tag>
+
+      </div>
+      <div  class="tags_last">
+        <i v-if="currentTempList.length > 0 && !disabled" class="el-icon-circle-close close-icon" @click="clear"></i>
+        <span v-show="currentTempList.length > 0" class="tags-num">{{ currentTempList.length }}</span>
+      </div>
+    </div>
+
+
+    <el-dialog
+      :title="title"
+      :visible.sync="visible"
+      width="80%"
+      top="10vh"
+      :close-on-click-modal="false"
+      append-to-body
+      @opened="open"
+      @closed="closed"
+    >
+      <el-row class="el-row-top">
+        <el-col :span="11">
+          <el-card class="box-card leftbox" :body-style="{ height: '100%' }">
+            <el-form
+              ref="formleft"
+              v-model="left.condition"
+              label-width="120px"
+              size="mini"
+              style="width: 95%"
+            >
+              <el-form-item label="上级机构:">
+                <tree-select
+                  v-model="left.condition.orgId"
+                  :searchable="searchable"
+                  :default-expand-level="level"
+                  :normalizer="tenantIdnormalizer"
+                  :options="treeList"
+                  :show-count="true"
+                  :props="{ checkStrictly: true, label: 'name' }"
+                  placeholder="请选择机构"
+                  clearValueText="清除"
+                  :noChildrenText="''"
+                  @select="leftTreeSelect"
+                  noOptionsText="没有数据"
+                  noResultsText="没有搜索结果"
+                />
+              </el-form-item>
+              <!--            <el-form-item >
+                            <el-checkbox v-model="left.condition.searchChild" @change="leftSearch">是否包含下级</el-checkbox>
+                          </el-form-item>-->
+              <el-form-item label="机构类型:">
+                <el-select
+                  prop="type"
+                  label="机构类型"
+                  v-model="left.condition.orgType"
+                  style="width: 100%"
+                  placeholder="请选择机构类型"
+                  @change="leftSearch"
+                  clearable
+                >
+                  <el-option
+                    v-for="dict in dict.type.sys_org_type"
+                    :key="dict.value"
+                    :label="dict.label"
+                    :value="dict.value"
+                  />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="机构名称:">
+                <el-input
+                  v-model="left.condition.orgName"
+                  clearable
+                  @input="leftSearch"
+                ></el-input>
+              </el-form-item>
+            </el-form>
+            <el-row class="result_row">
+              <el-col :span="12">搜索结果</el-col>
+              <el-col :span="12" style="text-align: right"
+              >{{ left.selectedRows.length }}/{{ left.data.length }}
+              </el-col
+              >
+            </el-row>
+            <el-table
+              style="width: 100%"
+              height="calc(100% - 100px)"
+              :data="left.data"
+              @selection-change="handleLeftSelectionChange"
+            >
+              <el-table-column type="selection" width="55"></el-table-column>
+              <el-table-column prop="affiliatedArea" align="center" label="地区"></el-table-column>
+              <el-table-column prop="affiliatedBank" label="行社" align="center"></el-table-column>
+              <el-table-column prop="shortName" label="机构名称" align="center"></el-table-column>
+            </el-table>
+          </el-card>
+        </el-col>
+        <el-col :span="2">
+          <div class="controller">
+            <el-button type="primary" @click="handleAdd">添加 >></el-button>
+            <el-button class="remove" type="primary" @click="handleRemove">移除 <<</el-button>
+          </div>
+        </el-col>
+        <el-col :span="11">
+          <el-card class="box-card" :body-style="{ height: '100%' }">
+            <el-form
+              ref="formRight"
+              v-model="right.condition"
+              label-width="120px"
+              size="mini"
+              style="width: 95%"
+            >
+              <el-form-item label="组织机构:">
+                <tree-select
+                  v-model="right.condition.orgId"
+                  :searchable="searchable"
+                  :options="treeList"
+                  :default-expand-level="level"
+                  :normalizer="tenantIdnormalizer"
+                  :show-count="true"
+                  :props="{ checkStrictly: true, label: 'name' }"
+                  placeholder="请选择归属机构"
+                  clearValueText="清除"
+                  :noChildrenText="''"
+                  @select="rightTreeSelect"
+                  noOptionsText="没有数据"
+                  noResultsText="没有搜索结果"
+                />
+
+              </el-form-item>
+              <!--            <el-form-item >
+                            <el-checkbox v-model="right.condition.searchChild" @change="rightSearch">是否包含下级</el-checkbox>
+                          </el-form-item>-->
+              <el-form-item label="机构类型:">
+                <el-select
+                  prop="type"
+                  label="机构类型"
+                  v-model="right.condition.orgType"
+                  style="width: 100%"
+                  placeholder="请选择机构类型"
+                  @change="rightSearch"
+                  clearable
+                >
+                  <el-option
+                    v-for="dict in dict.type.sys_org_type"
+                    :key="dict.value"
+                    :label="dict.label"
+                    :value="dict.value"
+                  />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="机构名称:">
+                <el-input
+                  v-model="right.condition.orgName"
+                  clearable
+                  @input="rightSearch"
+                ></el-input>
+              </el-form-item>
+            </el-form>
+            <el-row class="result_row">
+              <el-col :span="12">搜索结果</el-col>
+              <el-col :span="12" style="text-align: right"
+              >{{ right.selectedRows.length }}/{{ right.data.length }}
+              </el-col
+              >
+            </el-row>
+            <el-table
+              height="calc(100% - 100px)"
+              :data="right.data"
+              @selection-change="handleRightSelectionChange"
+            >
+              <el-table-column type="selection" width="55"></el-table-column>
+              <el-table-column prop="affiliatedArea" label="地区"></el-table-column>
+              <el-table-column prop="affiliatedBank" label="行社"></el-table-column>
+              <el-table-column prop="shortName" label="机构名称"></el-table-column>
+            </el-table>
+          </el-card>
+        </el-col>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+      <el-button @click="visible = false">关闭</el-button>
+      <el-button type="primary" @click="onOK">确定</el-button>
+    </span>
+    </el-dialog>
+
+
+  </div>
+</template>
+<script>
+import {selectOrgList} from "@/api/system/org.js";
+
+const defaultData = {
+  left: {
+    condition: {
+      orgId: null,
+      orgName: "",
+      orgType: null,
+      searchChild: false,
+    },
+    total: 0,
+    selectedCount: 0,
+    selectedRows: [],
+    data: [],
+  },
+  right: {
+    condition: {
+      orgId: null,
+      orgName: "",
+      orgType: null,
+      searchChild: false,
+    },
+    total: 0,
+    selectedCount: 0,
+    selectedRows: [],
+    data: [],
+  },
+}
+export default {
+  name: "orgSelect",
+  dicts: ["sys_org_type"],
+  props: {
+    orgList : {
+      type: Array,
+      default: new Array(),
+    },
+    size: {
+      type: String,
+      default: 'small',
+    },
+    trigger: {
+      type: String,
+      default: 'click',
+    },
+    //组件禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+    customRequest: {
+      type: Function,
+    },
+    hangsheTree: {
+      type: Boolean,
+      default: false,
+    },
+    businessTree: {
+      type: Boolean,
+      default: false,
+    },
+    wholeTree: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  watch: {
+    orgList: function (data) {
+      this.currentTempList = this.orgList;
+    }
+  },
+  data() {
+    return {
+      orgs: [],
+      title: "选择机构",
+      level: 1,
+      clearable: true,
+      searchable: true,
+      visible: false,
+      deviceType: null,
+      loading: false,
+      treeList: [],
+      deptOptions: [],
+      currentTempList: [],
+      boundOrgsClone: [],
+      left: {
+        condition: {
+          orgId: this.$store.getters.orgId,
+          deviceName: "",
+          searchChild: false,
+        },
+        total: 0,
+        selectedCount: 0,
+        selectedRows: [],
+        data: [],
+      },
+      right: {
+        condition: {
+          orgId: this.$store.getters.orgId,
+          deviceName: "",
+          searchChild: false,
+        },
+        total: 0,
+        selectedCount: 0,
+        selectedRows: [],
+        data: [],
+      },
+      rightOrgIds: [],
+      boundOrgIds: [],
+      searchOrgs: [],
+
+    };
+  },
+  created() {
+    this.boundOrgsClone = [];
+  },
+  mounted() {
+
+  },
+
+  methods: {
+    clear() {
+      this.currentTempList = [];
+      this.boundOrgsClone = [];
+      this.$emit("selectNode", []);
+      this.$emit("selectNodeId", []);
+    },
+
+    tenantIdnormalizer(node, instanceId) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.id,
+        label: node.shortName,
+        children: node.children,
+      };
+    },
+    orgTree() {
+
+      //获取所有机构列表
+      this.getAllOrgs();
+
+      if (this.customRequest) {
+        this.customRequest().then((response) => {
+          this.treeList = response.data;
+          return;
+        });
+      } else {
+        if (this.hangsheTree) {
+          this.treeList = this.$store.getters.depTree;
+        } else if (this.businessTree) {
+          this.treeList = this.$store.getters.businessTree;
+        } else if (this.wholeTree) {
+          this.treeList = this.$store.getters.wholeTree;
+        } else {
+          this.treeList = this.$store.getters.orgTree;
+        }
+      }
+    },
+    getChildIds(orgTree, parentId) {
+      if (parentId) {
+        orgTree.forEach((v, i) => {
+          if (v.path.indexOf(parentId) != -1) {
+            this.rightOrgIds.push(v.id);
+          }
+
+          if (v.children && v.children.length > 0) {
+            this.getChildIds(v.children, parentId);
+          }
+        });
+      }
+    },
+    open() {
+      this.right.data = JSON.parse(JSON.stringify(this.currentTempList));
+      this.boundOrgsClone = JSON.parse(JSON.stringify(this.currentTempList));
+      //this.leftSearch();
+    },
+    showDialog() {
+      this.orgTree();
+      this.visible = true;
+    },
+    hideDialog() {
+      this.visible = false;
+      this.left = defaultData.left;
+      this.right = defaultData.right;
+      this.searchOrgs = [];
+      this.boundOrgIds = [];
+      this.boundOrgsClone = [];
+    },
+    closed() {
+      this.left = defaultData.left;
+      this.right = defaultData.right;
+      this.searchOrgs = [];
+      this.boundOrgIds = [];
+      this.boundOrgsClone = [];
+      this.left.data = [];
+      this.right.data = [];
+      this.left.condition.orgId = this.$store.getters.orgId;
+      this.right.condition.orgId = this.$store.getters.orgId;
+      this.left.condition.orgType = null;
+      this.right.condition.orgType = null;
+      this.left.condition.orgName = null;
+      this.right.condition.orgName = null;
+    },
+    leftTreeSelect(node) {
+      this.left.condition.orgId = node.id;
+      this.left.condition.orgPath = node.path;
+      this.leftSearch();
+    },
+    rightTreeSelect(node) {
+      this.right.condition.orgId = node.id;
+      this.right.condition.orgPath = node.path;
+      this.rightSearch();
+    },
+    handleLeftSelectionChange(val) {
+      this.left.selectedCount = val.length;
+      this.left.selectedRows = val;
+    },
+    handleRightSelectionChange(val) {
+      this.right.selectedCount = val.length;
+      this.right.selectedRows = val;
+    },
+    handleAdd() {
+      this.right.condition.orgId = null;
+      this.right.condition.orgType = null;
+      this.right.condition.orgName = null;
+      let addData = this.left.selectedRows.filter(
+        (row) => this.boundOrgIds.indexOf(row.id) < 0
+      );
+      if (addData.length > 0) {
+        addData.forEach((i, v) => {
+          this.right.data.push(i);
+          this.boundOrgsClone.push(i);
+        });
+        this.boundOrgIds = this.boundOrgsClone.map((d) => d.deviceId);
+
+        this.left.data = this.searchOrgs.filter((row) => this.boundOrgIds.indexOf(row.id) < 0)
+      }
+      this.leftSearch();
+    },
+    handleRemove() {
+      /* this.right.condition.orgId = null;
+       this.right.condition.orgType = null;
+       this.right.condition.orgName = null;
+       this.right.condition.orgPath = null;*/
+      let rightSelectedIds = this.right.selectedRows.map(
+        (r) => r.id
+      );
+      if (rightSelectedIds.length > 0) {
+        this.right.data = this.right.data.filter(
+          (d) => rightSelectedIds.indexOf(d.id) < 0
+        );
+        this.boundOrgsClone = this.boundOrgsClone.filter(
+          (d) => rightSelectedIds.indexOf(d.id) < 0
+        );
+        this.boundOrgIds = this.boundOrgsClone.map((d) => d.id);
+
+        this.left.data = this.searchOrgs.filter((row) => this.boundOrgIds.indexOf(row.id) < 0)
+        if (this.left.condition.orgId) {
+          this.leftSearch();
+        }
+      }
+
+
+    },
+    getAllOrgs() {
+      selectOrgList({}).then((result) => {
+        this.orgs = result;
+      });
+    },
+    leftSearch() {
+      let {condition} = this.left;
+      this.left.prevCondition = {...condition};
+      this.boundOrgIds = this.boundOrgsClone.map((d) => d.id);
+      this.left.data = this.orgs
+        .filter(
+          (d) => this.boundOrgIds.indexOf(d.id) < 0
+        )
+        .filter(
+          (d) => !condition.orgName || d.shortName.includes(condition.orgName)
+        )
+        .filter(
+          // 过滤机构类型
+          (d) => !condition.orgType || d.type == condition.orgType
+        )
+        .filter(
+          // 过滤父级机构
+          (d) => !condition.orgPath || d.path.includes(condition.orgPath)
+        );
+    },
+    rightSearch() {
+      const {condition} = this.right;
+      if (this.boundOrgsClone.length > 0) {
+        this.right.data = this.boundOrgsClone
+          .filter(
+            // 过滤机构名称
+            (d) =>
+              !condition.orgName || d.shortName.includes(condition.orgName)
+          )
+          .filter(
+            // 过滤机构类型
+            (d) => !condition.orgType || d.type == condition.orgType
+          )
+          .filter(
+            // 过滤父级机构
+            (d) => !condition.orgPath || d.path.includes(condition.orgPath)
+          );
+      }
+    },
+    onOK() {
+      this.currentTempList = this.boundOrgsClone;
+      this.$emit("selectNodeId", this.boundOrgIds);
+      this.hideDialog();
+    },
+  },
+  model: {
+    event: "selectNodeId",
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+
+.result_row {
+  width: 96%;
+  padding: 6px;
+}
+
+.dialog-footer {
+  float: right;
+}
+
+::v-deep .el-dialog__footer {
+  height: 60px;
+}
+
+::v-deep .el-dialog__body {
+  padding: 10px 5px;
+}
+
+::v-deep .el-card__body {
+  padding: 10px 5px;
+}
+
+.controller {
+  margin: auto;
+  width: 80px;
+  top: calc(50% - 30px);
+  position: relative;
+
+  .remove {
+    margin-top: 20px;
+    margin-left: 0px;
+  }
+}
+
+.el-row-top {
+  height: 500px;
+  display: flex;
+
+  v-deep & > .el-col {
+    height: 100%;
+    width: calc(50% - 50px);
+  }
+
+  v-deep & > .el-col:nth-child(2) {
+    width: 100px;
+  }
+}
+
+.box-card {
+  height: 100%;
+  display: flex;
+  justify-content: space-between;
+
+  v-deep .el-card__body {
+    height: 100%;
+  }
+}
+
+.leftbox {
+  v-deep .k-tree-select__clear {
+    display: none !important;
+  }
+}
+
+.deviceName-column-content {
+  display: block;
+  text-align: right;
+}
+
+
+.tags-box {
+  background-color: #fff;
+  border-radius: 4px;
+  border-top: 1px solid #dcdfe6; /* 上边框 */
+  border-bottom: 1px solid #dcdfe6; /* 下边框 */
+  border-left: 1px solid #dcdfe6; /* 左边框 */
+  border-right: none; /* 取消右边框 */
+  color: #606266;
+  outline: 0;
+  padding: 0 40px 0 5px;
+  width: 90%;
+  min-height: 40px;
+  max-height: 40px;
+  position: relative;
+  overflow: hidden;
+  display: inline-block;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  cursor: pointer;
+}
+.tags_last{
+  background-color: #fff;
+  border-radius: 4px;
+  border-top: 1px solid #dcdfe6; /* 上边框 */
+  border-bottom: 1px solid #dcdfe6; /* 下边框 */
+  border-right: 1px solid #dcdfe6; /* 左边框 */
+  border-left: none; /* 取消右边框 */
+  color: #606266;
+  outline: 0;
+  width: 10%;
+  float: right;
+  min-height: 40px;
+  max-height: 40px;
+  > span {
+    margin: 5px 10px;
+    color: #161617;
+  }
+  .close-icon {
+    position: absolute;
+    right: 28px;
+    cursor: pointer;
+    margin: 10px 10px;
+    &:hover {
+      color: #aaa;
+    }
+  }
+}
+
+.tags-box-disabled {
+  cursor: default;
+}
+
+.tags-box-mini {
+  min-height: 32px;
+  max-height: 32px;
+  line-height: 32px;
+
+  > span {
+    margin: 0 5px;
+  }
+
+  > .tags-num {
+    line-height: 38px;
+  }
+}
+
+.tags-num {
+  color: #ccc;
+  position: absolute;
+  right: 48px;
+  top: -4px;
+}
+
+.tree-box {
+  margin-top: 20px;
+  max-height: 300px;
+  overflow: auto;
+  border-radius: 4px;
+  border: 1px solid #dcdfe6;
+  user-select: none;
+}
+</style>

+ 6 - 4
src/views/system/workTimeSet/dialog.add.vue

@@ -12,11 +12,12 @@
       <!--      <div class="p-5 work-time">-->
       <el-form label-width="90px" label-suffix="" label-position="right">
         <el-form-item label="分配机构">
-          <org-tree-select
+<!--          <org-tree-select
             ref="orgTreeSelect"
             :checkShow="true"
             v-model="orgIdList"
-          ></org-tree-select>
+          ></org-tree-select>-->
+          <org-select ref="orgSelect" v-model="orgIdList" ></org-select>
         </el-form-item>
         <el-form-item label="调整日期">
           <el-button type="primary" @click="addData">新增日期</el-button>
@@ -183,9 +184,10 @@ import { validateTimes } from "@/utils/ruoyi";
 import { formatTime, timeCheck } from "@/utils/ruoyi";
 import { addWorkTimeDay } from "@/views/system/workTimeSet/api";
 import day from "@/components/Crontab/day";
+import orgSelect from "@/components/orgSelect/index.vue";
 
 export default {
-  components: { OrgTreeSelect, BtnTip },
+  components: {orgSelect, OrgTreeSelect, BtnTip },
   data() {
     return {
       selectTreeStrictly: true,
@@ -322,7 +324,7 @@ export default {
       this.isShow = false;
       this.workTimeList = [];
       this.orgIdList = [];
-      this.$refs["orgTreeSelect"].clear();
+      this.$refs["orgSelect"].clear();
     },
     onEnableChange(workTime) {
       if (!workTime.isEnable) {

+ 0 - 2
src/views/system/workTimeSet/dialog.edit.vue

@@ -157,7 +157,6 @@ export default {
         this.formData = res.data;
         this.show = true;
       })
-      console.log(row,'11111')
     },
     edit(row){
       this.orgId = row.id;
@@ -166,7 +165,6 @@ export default {
         this.formData = res.data;
         this.show = true;
       })
-      console.log(row,'11111')
     },
     reset() {
       return {

+ 13 - 4
src/views/system/workTimeSet/dialog.template.vue

@@ -10,7 +10,8 @@
             label-position="left">
           <el-form-item>
             <span slot="label"> <span style="color: red"> * </span>机构 </span>
-            <org-tree-select v-model="formData.orgIds" :checkShow="true" :disabled="disabled" ></org-tree-select>
+<!--            <org-tree-select v-model="formData.orgIds" :checkShow="true" :disabled="disabled" ></org-tree-select>-->
+            <org-select ref="orgSelect" v-model="formData.orgIds" :orgList="orgList" ></org-select>
           </el-form-item>
           <el-form-item >
             <span slot="label"> <span style="color: red"> * </span>生效日期 </span>
@@ -173,11 +174,14 @@ import BtnTip from "@/components/btnTip";
 import OrgTreeSelect from '@/components/orgTreeSelect'
 import { validateTimes } from "@/utils/ruoyi";
 import {addTimeWeek, queryInfoById} from "@/views/system/workTimeSet/api";
-import {json} from './json'  //导入默认数据
+import {json} from './json'
+import {getDept} from "@/api/system/dept"
+import orgSelect from "@/components/orgSelect/index.vue";  //导入默认数据
 export default {
-  components:{BtnTip,OrgTreeSelect},
+  components:{orgSelect, BtnTip,OrgTreeSelect},
   data() {
     return {
+      orgList: [],
       title:'',
       isShow: false,
       row:null,
@@ -223,10 +227,15 @@ export default {
       this.isShow = true;
       this.id = row.id;
       this.orgId = row.orgId;
-      this.getData();
+      this.orgList = [];
+      getDept(row.orgId).then(res=>{
+        this.orgList.push(res.data);
+        this.getData();
+      });
     },
     add(){
       this.title = '新增作息模版';
+      this.orgList = [];
       this.formData.dayOfWeeks = JSON.parse(JSON.stringify(json));
       this.isShow = true;
     },

+ 184 - 218
src/views/system/workTimeSet/workTimeWeek.vue

@@ -17,43 +17,22 @@
           <div class="main-search-box">
             <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
               <el-form-item label="机构名称">
-                <org-tree
-                v-model="queryParams.orgId"
-                @defaultKey="getDefaultKey"
-                @checkChange="changeCheckBox"
-                @click="handleNodeClick"
-                  ref="orgTree"
-              ></org-tree>
+                <org-tree v-model="queryParams.orgId" @defaultKey="getDefaultKey" @checkChange="changeCheckBox"
+                  @click="handleNodeClick" ref="orgTree"></org-tree>
               </el-form-item>
               <el-form-item label="机构类型" prop="orgType">
                 <el-select v-model="queryParams.orgType" placeholder="请选择机构类型">
-                  <el-option
-                    v-for="dict in dict.type.sys_org_type"
-                    :key="dict.value"
-                    :label="dict.label"
+                  <el-option v-for="dict in dict.type.sys_org_type" :key="dict.value" :label="dict.label"
                     :value="`${dict.value}`">
                   </el-option>
                 </el-select>
               </el-form-item>
               <el-form-item label="生效日期">
-                <DataRangePicker
-                  style="width: 240px"
-                  v-model="queryParams.dateRange"
-                  key="daterange"
-                  type="daterange"
-                  :editable="false"
-                  :clearable="false"
-                  range-separator="-"
-                  start-placeholder="开始日期"
-                  end-placeholder="结束日期"
-                />
+                <DataRangePicker style="width: 240px" v-model="queryParams.dateRange" key="daterange" type="daterange"
+                  :editable="false" :clearable="false" range-separator="-" start-placeholder="开始日期"
+                  end-placeholder="结束日期" />
               </el-form-item>
-    <!--          <el-form-item label="仅显示当前生效" label-width="120px">-->
-    <!--            <el-switch-->
-    <!--              v-model="queryParams.isEnable"-->
-    <!--              inactive-color="#ccc">-->
-    <!--            </el-switch>-->
-    <!--          </el-form-item>-->
+
             </el-form>
             <!--    按纽    -->
             <el-row :gutter="10">
@@ -64,228 +43,215 @@
                 <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetForm">重置</el-button>
               </el-col>
               <el-col :span="1.5">
-                <el-button
-                  type="primary"
-                  icon="el-icon-plus"
-                  size="mini"
-                  @click="addTemplate"
-                  v-hasPermi="['system:time:add']"
-                >新增作息模板</el-button>
+                <el-button type="primary" icon="el-icon-plus" size="mini" @click="addTemplate"
+                  v-hasPermi="['system:time:add']">新增作息模板</el-button>
               </el-col>
               <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
             </el-row>
           </div>
-          <el-table
-            v-loading="loading"
-            border
-            height="597"
-            size="small"
-            :data="tableList">
+          <el-table v-loading="loading" border height="597" size="small" :data="tableList">
             <el-table-column label="序号" type="index" align="center" width="70"></el-table-column>
             <el-table-column prop="orgName" align="center" label="机构" :show-overflow-tooltip="true"></el-table-column>
             <el-table-column prop="effectiveDate" align="center" label="生效日期" width="160"></el-table-column>
+            <el-table-column prop="effectiveDate" align="center" label="是否定时循环" width="160">
+              <template slot-scope="r">是</template>
+            </el-table-column>
             <el-table-column prop="workDay" align="center" label="工作日" width="300"></el-table-column>
-            <el-table-column prop="updateBy" align="center" label="更新人" width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="updateBy" align="center" label="更新人" width="160"
+              show-overflow-tooltip></el-table-column>
             <el-table-column prop="updateTime" align="center" label="更新时间" width="180"></el-table-column>
-            <el-table-column label="操作" align="center"  width="140" >
+            <el-table-column label="操作" align="center" width="140">
               <template slot-scope="r">
-  <!--                <el-button type="text" v-if="r.row.timeCheck===0" @click="onDelete(r.row.id)">删除</el-button>-->
-  <!--                <el-button type="text" v-if="r.row.timeCheck===1||r.row.timeCheck===2" @click="lookItem(r.row)">查看</el-button>-->
-                  <el-button
-                    size="mini"
-                    type="text"
-                    icon="el-icon-document"
-                    @click="lookItem(r.row)">查看</el-button>
+                <!--                <el-button type="text" v-if="r.row.timeCheck===0" @click="onDelete(r.row.id)">删除</el-button>-->
+                <!--                <el-button type="text" v-if="r.row.timeCheck===1||r.row.timeCheck===2" @click="lookItem(r.row)">查看</el-button>-->
+                <el-button size="mini" type="text" icon="el-icon-document" @click="lookItem(r.row)">查看</el-button>
 
-                  <span v-if="ifOrg(r.row)">
-                    <el-button
-                      size="mini"
-                      type="text"
-                      icon="el-icon-edit-outline"
-                      v-hasPermi="['system:time:edit']"
-                      @click="onEdit(r.row)">编辑</el-button>
-                  </span>
+                <span v-if="ifOrg(r.row)">
+                  <el-button size="mini" type="text" icon="el-icon-edit-outline" v-hasPermi="['system:time:edit']"
+                    @click="onEdit(r.row)">编辑</el-button>
+                </span>
               </template>
             </el-table-column>
           </el-table>
-          <pagination
-            :total="total"
-            :page.sync="queryParams.pageNum"
-            :limit.sync="queryParams.pageSize"
-            @pagination="getList"
-          />
+          <pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
+            @pagination="getList" />
         </div>
       </el-col>
     </el-row>
-
-
-    <dialog-template ref="modalTemplate" @ok="getList" ></dialog-template>
+    <dialog-template ref="modalTemplate" @ok="getList"></dialog-template>
 
   </div>
 </template>
 
 <script>
-import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
-import DialogTemplate from './dialog.template'
-/** 引入节点树接口*/
-import { deptTreeSelect} from "@/api/system/public";
-import {weekTableList} from './api'
-import { mapGetters } from "vuex";
-import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
-export default {
-  /**  得先引入字典才能使用 */
-  dicts: ['sys_business_type','sys_org_type'],
-  components: {DataRangePicker, OrgTree,DialogTemplate},
-  data() {
-    return {
-      loading:false,
-      //选中的行
-      selectRow:null,
-      // 显示搜索条件
-      showSearch: true,
-      // 用户表格数据
-      tableList: null,
-      // 树选项
-      orgTree: null,
-      // 是否显示弹出层
-      open: false,
-      // 通过机构名称查询tree
-      deptName: null,
-      //是否关联下级
-      checked: false,
-      //自定义机构树数据
-      defaultProps: {
-        children: "children",
-        label: "name"
-      },
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        checkSub: true,
-        orgId: null,
-        isEnable:false,
-        orgType:null,
-        dateRange:[],
-      },
-      total:0,
-      // 列信息
-      columns: [
-        { key: 0, label: `机构`, visible: true },
-        { key: 1, label: `日期`, visible: true },
-        { key: 2, label: `营业状态`, visible: true },
-        { key: 3, label: `上下班时间段`, visible: true },
-        { key: 4, label: `营业时间段`, visible: true },
-        { key: 5, label: `午休时间段`, visible: true },
-        { key: 6, label: `更新人`, visible: true },
-        { key: 7, label: `更新时间`, visible: true },
-        { key: 8, label: `操作`, visible: true }
-      ],
-      //默认选中节点
-      defaultKeys:[],
-    };
-  },
-  computed: {
-    ...mapGetters(["orgId","isAdmin"]),
-    pickerOptions() {
+  import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
+  import DialogTemplate from './dialog.template'
+  /** 引入节点树接口*/
+  import { deptTreeSelect } from "@/api/system/public";
+  import { weekTableList } from './api'
+  import { mapGetters } from "vuex";
+  import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
+  import addrelvance from "@/views/warnRule/addRelvance.vue";
+  import OrgTreeSelect from "@/components/orgTreeSelect/index.vue";
+  export default {
+    /**  得先引入字典才能使用 */
+    dicts: ['sys_business_type', 'sys_org_type'],
+    components: {OrgTreeSelect, DataRangePicker, OrgTree, DialogTemplate},
+    data () {
       return {
-        start: "00:00",
-        end: "24:00",
-        step: "00:10",
+        test: [],
+        loading: false,
+        //选中的行
+        selectRow: null,
+        // 显示搜索条件
+        showSearch: true,
+        // 用户表格数据
+        tableList: null,
+        // 树选项
+        orgTree: null,
+        // 是否显示弹出层
+        open: false,
+        // 通过机构名称查询tree
+        deptName: null,
+        //是否关联下级
+        checked: false,
+        //自定义机构树数据
+        defaultProps: {
+          children: "children",
+          label: "name"
+        },
+        // 查询参数
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          checkSub: true,
+          orgId: null,
+          isEnable: false,
+          orgType: null,
+          dateRange: [],
+        },
+        total: 0,
+        // 列信息
+        columns: [
+          { key: 0, label: `机构`, visible: true },
+          { key: 1, label: `日期`, visible: true },
+          { key: 2, label: `营业状态`, visible: true },
+          { key: 3, label: `上下班时间段`, visible: true },
+          { key: 4, label: `营业时间段`, visible: true },
+          { key: 5, label: `午休时间段`, visible: true },
+          { key: 6, label: `更新人`, visible: true },
+          { key: 7, label: `更新时间`, visible: true },
+          { key: 8, label: `操作`, visible: true }
+        ],
+        //默认选中节点
+        defaultKeys: [],
       };
     },
-  },
-  created() {
-    // this.getDeptTree();
-    // this.getConfigKey("sys.user.initPassword").then(response => {
-    //   this.initPassword = response.msg;
-    // });
-  },
-  methods: {
-    ifOrg(row){
-      console.log(row.orgId,this.orgId,'row','isAdmin',this.isAdmin)
-      return row.orgId === this.orgId || this.isAdmin;
-    },
-    getDefaultKey(key) {
-      this.queryParams.orgId = key;
-      this.getList();
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 查看 */
-    lookItem(row) {
-      this.selectRow = row;
-      this.$refs.modalTemplate.show(row);
-    },
-    onEdit(row){
-      this.selectRow = row;
-      this.$refs.modalTemplate.edit(row);
-    },
-    addTemplate(){
-      this.$refs.modalTemplate.add();
+    computed: {
+      ...mapGetters(["orgId", "isAdmin"]),
+      pickerOptions () {
+        return {
+          start: "00:00",
+          end: "24:00",
+          step: "00:10",
+        };
+      },
     },
-    /** 下穿状态改变*/
-    changeCheckBox(){
-      this.queryParams.checkSub = !this.queryParams.checkSub;
-      this.getList();
+    created () {
+      // this.getDeptTree();
+      // this.getConfigKey("sys.user.initPassword").then(response => {
+      //   this.initPassword = response.msg;
+      // });
     },
-    /** 查询列表 */
-    getList() {
-      this.loading = true;
-      weekTableList(this.queryParams).then(response => {
+    methods: {
+      handleAddOrg(){
+        this.$refs.orgSelect.visible = true
+        this.$refs.orgSelect.orgTree();
+      },
+      ifOrg (row) {
+        console.log(row.orgId, this.orgId, 'row', 'isAdmin', this.isAdmin)
+        return row.orgId === this.orgId || this.isAdmin;
+      },
+      getDefaultKey (key) {
+        this.queryParams.orgId = key;
+        this.getList();
+      },
+      /** 搜索按钮操作 */
+      handleQuery () {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 查看 */
+      lookItem (row) {
+        this.selectRow = row;
+        this.$refs.modalTemplate.show(row);
+      },
+      onEdit (row) {
+        this.selectRow = row;
+        this.$refs.modalTemplate.edit(row);
+      },
+      addTemplate () {
+        this.$refs.modalTemplate.add();
+      },
+      /** 下穿状态改变*/
+      changeCheckBox () {
+        this.queryParams.checkSub = !this.queryParams.checkSub;
+        this.getList();
+      },
+      /** 查询列表 */
+      getList () {
+        this.loading = true;
+        weekTableList(this.queryParams).then(response => {
           this.tableList = response.data.records;
           this.total = response.data.total;
           this.loading = false;
         }
-      ).catch(err=>{
-        this.loading = false;
-      })
-    },
-    /** 查询机构树 */
-    getDeptTree() {
-      deptTreeSelect().then(response => {
-        this.orgTree = response.data;
-        this.defaultKeys.push(response.data[0].id);
-        this.queryParams.orgId = response.data[0].id;
+        ).catch(err => {
+          this.loading = false;
+        })
+      },
+      /** 查询机构树 */
+      getDeptTree () {
+        deptTreeSelect().then(response => {
+          this.orgTree = response.data;
+          this.defaultKeys.push(response.data[0].id);
+          this.queryParams.orgId = response.data[0].id;
+          this.handleQuery();
+        });
+      },
+      // 筛选节点
+      filterNode (value, data) {
+        if (!value) return true;
+        return data.name.indexOf(value) !== -1;
+      },
+      // 节点单击事件
+      handleNodeClick (data) {
+        this.queryParams.orgId = data.id;
         this.handleQuery();
-      });
-    },
-    // 筛选节点
-    filterNode(value, data) {
-      if (!value) return true;
-      return data.name.indexOf(value) !== -1;
-    },
-    // 节点单击事件
-    handleNodeClick(data) {
-      this.queryParams.orgId = data.id;
-      this.handleQuery();
-    },
+      },
 
-    /** 提交按钮 */
-    submitForm() {
+      /** 提交按钮 */
+      submitForm () {
 
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('system/time/export', {
-        ...this.queryParams
-      }, `user_${new Date().getTime()}.xlsx`)
-    },
-    /* 重置搜索 */
-    resetForm(name){
-      this.queryParams.isEnable = false;
-      this.queryParams.pageNum= 1;
-      this.queryParams.pageSize=10;
-      this.queryParams.dateRange = ['',''];
-      this.queryParams.orgId=this.orgId;
-      this.queryParams.orgType = null;
-      this.queryParams.checkSub = true;
-      this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub)
-      this.getList();
-    },
-  }
-};
+      },
+      /** 导出按钮操作 */
+      handleExport () {
+        this.download('system/time/export', {
+          ...this.queryParams
+        }, `user_${new Date().getTime()}.xlsx`)
+      },
+      /* 重置搜索 */
+      resetForm (name) {
+        this.queryParams.isEnable = false;
+        this.queryParams.pageNum = 1;
+        this.queryParams.pageSize = 10;
+        this.queryParams.dateRange = ['', ''];
+        this.queryParams.orgId = this.orgId;
+        this.queryParams.orgType = null;
+        this.queryParams.checkSub = true;
+        this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub)
+        this.getList();
+      },
+    }
+  };
 </script>