Browse Source

作息管理修改bug

凉纪 2 năm trước cách đây
mục cha
commit
ce868cfec3

+ 3 - 3
.env.development

@@ -6,11 +6,11 @@ ENV = 'development'
 
 # 开发环境
 #测试地址
-#VUE_APP_BASE_API = 'http://10.87.10.55:8081'
+#VUE_APP_BASE_API = 'http://10.87.10.91:8080'
 #罗俊
-#VUE_APP_BASE_API = 'http://10.87.10.49:8080'
+VUE_APP_BASE_API = 'http://10.87.10.49:8080'
 #罗伟
-VUE_APP_BASE_API = 'http://10.87.10.47:8080'
+#VUE_APP_BASE_API = 'http://10.87.10.47:8080'
 #高雄
 #VUE_APP_BASE_API = 'http://10.87.11.94:8080'
 # 路由懒加载

+ 2 - 2
src/components/orgTreeSelect/index.vue

@@ -6,7 +6,7 @@
       v-model="visible">
       <!--  选中的值  -->
       <div  slot="reference" class="tags-box">
-        <i v-if="sNodeList.length > 0 && !disabled" class="el-icon-circle-close close-icon" @click="clickClear"></i>
+        <i v-if="sNodeList.length > 0 && !disabled" class="el-icon-circle-close close-icon" @click="clear"></i>
         <el-tag type="success" v-for="v in sNodeList" :key="v.id">{{v.name}}</el-tag>
       </div>
 
@@ -118,7 +118,7 @@ export default {
     event: 'change'
   },
   methods:{
-    clickClear(){
+    clear(){
       this.sNodeList = [];
       this.$refs.tree.setCheckedKeys([]);
       this.$refs.tree.setCurrentKey(null);

+ 1 - 1
src/router/index.js

@@ -214,7 +214,7 @@ Router.prototype.replace = function push(location) {
 }
 
 export default new Router({
-  mode: 'hash', // 去掉url中的#
+  mode: 'hash',
   scrollBehavior: () => ({ y: 0 }),
   routes: constantRoutes
 })

+ 1 - 2
src/utils/request.js

@@ -6,7 +6,6 @@ import errorCode from '@/utils/errorCode'
 import { tansParams, blobValidate } from "@/utils/ruoyi";
 import cache from '@/plugins/cache'
 import { saveAs } from 'file-saver'
-import permission from "@/store/modules/permission";
 
 let loading;
 let downloadLoadingInstance;
@@ -87,7 +86,7 @@ let success = res => {
         isRelogin.show = false;
         store.dispatch('LogOut').then(() => {
           removeSession();
-          location.href = '/index';
+          location.href = '/login';
         })
       }).catch(() => {
         isRelogin.show = false;

+ 1 - 1
src/utils/ruoyi.js

@@ -23,7 +23,7 @@ function timeToNumber(src) {
   return src.replace(":", "") * 1;
 }
 
-// 日期格式化 2023-12-30 00:00:00
+// 日期格式化 2023-12-30 00:00:00 或者获取星期几
 export function parseTime(value, format = "YYYY-MM-DD HH:mm:ss") {
   if ((value + "").length == 10 && format != 'dddd') {
     value *= 1000;

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

@@ -6,7 +6,7 @@
         <el-form label-width="90px" label-suffix=":" label-position="right">
 
           <el-form-item label="分配机构">
-            <org-tree-select @selectNode="queryNode"></org-tree-select>
+            <org-tree-select ref="orgTreeSelect" @selectNode="queryNode"></org-tree-select>
           </el-form-item >
           <el-form-item label="调整日期">
             <el-button type="primary" @click="addData">新增日期</el-button>
@@ -222,8 +222,9 @@ export default {
         this.$message.error(`日期不能为空`);
         return;
       }
-      const ds = this.parseTime(other.date,"YYYY-MM-DD");
-      if (!other.disabled && !other.isEnable) {
+      const ds = this.formatTime(other.date,"YYYY-MM-DD");
+      console.log(other,'ds')
+      if ( !other.isEnable === null && !other.disabled ) {
         this.$message.error(`${ds}未进行配置`);
         return;
       }
@@ -265,6 +266,7 @@ export default {
       this.isShow = false;
       this.workTimeList = [];
       this.orgIdList=[];
+      this.$refs['orgTreeSelect'].clear();
     },
     onEnableChange(workTime) {
       if (!workTime.isEnable) {
@@ -279,9 +281,11 @@ export default {
     async onSubmit() {
       //判断是否有重复的日期
       let dateList = [];
-      for (let v of this.workTimeList) {
+      let workTimeList = JSON.parse(JSON.stringify(this.workTimeList))
+      for (let v of workTimeList) {
         if (v.date) {
           let date = this.formatTime(v.date,"YYYY-MM-DD");
+          v.ymdDate = date;
           if (dateList.indexOf(date) > -1) {
             this.$message.error(`日期: ${date} 重复`);
             return;
@@ -290,14 +294,14 @@ export default {
         }
       }
       // 校验
-      for (let workTime of this.workTimeList) {
+      for (let workTime of workTimeList) {
         if (!this.check(workTime)) {
           return;
         }
       }
       let data = {
         orgIdList:this.orgIdList,
-        workTimeList:this.workTimeList
+        workTimeList:workTimeList
       }
       addWorkTimeDay(data).then(res=>{
         this.$emit("success");